lib-network
[apps/madmutt.git] / configure.ac
index 9bc1c0d..2a889f4 100644 (file)
@@ -6,10 +6,8 @@ dnl !!! TO DUMP THEIR RESULTS WHEN MUTT -V IS CALLED            !!!
 AC_PREREQ([2.50])
 AC_INIT([mutt.h])
 AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(madmutt, `cat "$srcdir/VERSION.in"`)
 
-mutt_cv_version=`cat "$srcdir/VERSION.in"`
-
-AM_INIT_AUTOMAKE(madmutt, $mutt_cv_version)
 AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION.in'])
 
 AC_GNU_SOURCE
@@ -26,13 +24,18 @@ else
 fi
 AC_MSG_RESULT($mutt_cv_prefix)
 
-AC_PROG_CC
-AC_ISC_POSIX
+AC_PROG_CPP
+AC_PROG_CC_C99
+
 AM_C_PROTOTYPES
+AC_C_INLINE
+AC_C_CONST
 if test "x$U" != "x"; then
     AC_MSG_ERROR(Compiler not ANSI compliant)
 fi
-AC_PROG_CPP
+AC_ISC_POSIX
+AC_HEADER_STDC
+
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
 AC_PROG_RANLIB
@@ -40,29 +43,10 @@ AC_PROG_GPERF
 PKG_PROG_PKG_CONFIG
 AC_CHECK_TOOL(AR, ar, ar)
 
-AC_C_INLINE
-AC_C_CONST
-
 AC_SYS_LARGEFILE
 AC_FUNC_FSEEKO
 AC_CHECK_SIZEOF(off_t)
 
-AC_PATH_PROG(DBX, dbx, no)
-AC_PATH_PROG(GDB, gdb, no)
-AC_PATH_PROG(SDB, sdb, no)
-
-if test $GDB != no ; then
-    DEBUGGER=$GDB
-elif test $DBX != no ; then
-    DEBUGGER=$DBX
-elif test $SDB != no ; then
-    DEBUGGER=$SDB
-else
-    DEBUGGER=no
-fi
-
-AC_SUBST([DEBUGGER])
-
 AH_TEMPLATE([sig_atomic_t],
             [Define to 'int' if <signal.h> doesn't define.])
 AH_TEMPLATE([HAVE_START_COLOR],
@@ -103,8 +87,10 @@ AC_ARG_ENABLE(gpgme, AC_HELP_STRING([--enable-gpgme], [Enable GPGME support]),[
     if test x$enableval = xyes; then
         AM_PATH_GPGME(,,[AC_MSG_ERROR(GPGME not found)])
         MUTTLIBS="$MUTTLIBS $GPGME_LIBS"
-        MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS crypt-gpgme.o crypt-mod-pgp-gpgme.o crypt-mod-smime-gpgme.o"
         AC_DEFINE(CRYPT_BACKEND_GPGME, 1, [Defined, if GPGME support is enabled])
+        AM_CONDITIONAL(BUILD_GPGME, true)
+    else
+        AM_CONDITIONAL(BUILD_GPGME, false)
     fi
 ])
 
@@ -233,8 +219,6 @@ main ()
             LIBS="$old_LIBS"
         ])
 
-AC_HEADER_STDC
-
 AC_CHECK_HEADERS(stdarg.h sys/ioctl.h ioctl.h sysexits.h)
 AC_CHECK_HEADERS(sys/time.h sys/resource.h)
 AC_CHECK_HEADERS(unix.h)
@@ -275,30 +259,11 @@ if test $ac_cv_func_getopt = yes; then
     AC_CHECK_HEADERS(getopt.h)
 fi
 
-AC_ARG_WITH(regex, AC_HELP_STRING([--with-regex], [Use the GNU regex library]),
-        [mutt_cv_regex=yes],
-        [AC_CHECK_FUNCS(regcomp, mutt_cv_regex=no, mutt_cv_regex=yes)])
-
-if test $mutt_cv_regex = no ; then
-    AC_CACHE_CHECK([whether your system's regexp library is completely broken],
-        [mutt_cv_regex_broken],
-        AC_TRY_RUN([
-#include <unistd.h>
-#include <regex.h>
-main() { regex_t blah ; regmatch_t p; p.rm_eo = p.rm_eo; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec (&blah, "foobar", 0, NULL, 0); }],
-        mutt_cv_regex_broken=no, mutt_cv_regex_broken=yes, mutt_cv_regex_broken=yes))
-    if test $mutt_cv_regex_broken = yes ; then
-        echo "Using the included GNU regex instead." >&AC_FD_MSG
-        mutt_cv_regex=yes
-    fi
-fi
-
-if test $mutt_cv_regex = yes; then
-    AC_DEFINE(USE_GNU_REGEX,1,[ Define if you want to use the included regex.c. ])
-    LIBOBJS="$LIBOBJS regex.o"
+AC_CHECK_FUNC(regcomp)
+if test $ac_cv_func_regcomp = yes; then
+   AC_CHECK_HEADERS(regex.h)
 fi
 
-
 AC_ARG_WITH(homespool,
             AC_HELP_STRING([--with-homespool[=FILE]],
                            [File in user's directory where new mail is spooled]),
@@ -441,27 +406,23 @@ AM_CONDITIONAL(USE_GSS, test x$need_gss = xyes)
 dnl -- end imap dependencies --
 
 AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl[=PFX]], [Compile in SSL support for POP/IMAP]),
-[       if test "$with_ssl" != "no"
-        then
-          if test "$with_ssl" != "yes"
-          then
-           LDFLAGS="$LDFLAGS -L$withval/lib"
-           CPPFLAGS="$CPPFLAGS -I$withval/include"
-          fi
-          saved_LIBS="$LIBS"
-
-          AC_CHECK_LIB(crypto, X509_new,, AC_MSG_ERROR([Unable to find SSL library]))
-          AC_CHECK_LIB(ssl, SSL_new,, AC_MSG_ERROR([Unable to find SSL library]), -lcrypto)
+[   if test "$with_ssl" != "no"; then
+        if test "$with_ssl" != "yes"; then
+            LDFLAGS="$LDFLAGS -L$withval/lib"
+            CPPFLAGS="$CPPFLAGS -I$withval/include"
+        fi
+        saved_LIBS="$LIBS"
 
-          AC_CHECK_FUNCS(RAND_status RAND_egd)
+        AC_CHECK_LIB(crypto, X509_new,, AC_MSG_ERROR([Unable to find SSL library]))
+        AC_CHECK_LIB(ssl, SSL_new,, AC_MSG_ERROR([Unable to find SSL library]), -lcrypto)
 
-          AC_DEFINE(USE_SSL,1,[ Define if you want support for SSL. ])
-          LIBS="$saved_LIBS"
-          MUTTLIBS="$MUTTLIBS -lssl -lcrypto"
-          MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_ssl.o"
-          need_ssl=yes
+        AC_CHECK_FUNCS(RAND_status RAND_egd)
 
-        fi
+        AC_DEFINE(USE_SSL,1,[ Define if you want support for SSL. ])
+        LIBS="$saved_LIBS"
+        MUTTLIBS="$MUTTLIBS -lssl -lcrypto"
+        need_ssl=yes
+    fi
 ])
 
 AC_ARG_WITH([gnutls], AC_HELP_STRING([--with-gnutls], [Enable SSL support using gnutls]),
@@ -474,12 +435,12 @@ if test "$gnutls_prefix" != "no"; then
         CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
         MUTTLIBS="$MUTTLIBS $LIBGNUTLS_LIBS"
         AC_DEFINE(USE_GNUTLS, 1, [Define if you want support for SSL via the gnutls library.])
-        MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_ssl_gnutls.o"
         need_ssl=yes],
         [AC_MSG_ERROR([could not find libgnutls])
     ])
 fi
 AM_CONDITIONAL(USE_SSL, test x$need_ssl = xyes)
+AC_SUBST(MUTT_SSL_OBJECTS)
 
 AC_ARG_WITH(sasl2, AC_HELP_STRING([--with-sasl2[=PFX]],
             [Use Cyrus SASL library version 2 for POP/IMAP authentication]),[
@@ -491,8 +452,7 @@ AC_ARG_WITH(sasl2, AC_HELP_STRING([--with-sasl2[=PFX]],
 
         saved_LIBS="$LIBS"
 
-        AC_CHECK_LIB(sasl2, sasl_client_init,,
-                     AC_MSG_ERROR([could not find libsasl2]),)
+        AC_CHECK_LIB(sasl2, sasl_client_init,,AC_MSG_ERROR([could not find libsasl2]))
 
         MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o"
         MUTTLIBS="$MUTTLIBS -lsasl2"
@@ -943,11 +903,12 @@ AC_SUBST(HTMLCLEAN_CMD)
 
 AC_OUTPUT(Makefile intl/Makefile m4/Makefile
         po/Makefile.in doc/Makefile contrib/Makefile
-        muttbug.sh
         lib-lib/Makefile
         lib-mime/Makefile
         lib-crypt/Makefile
         lib-hash/Makefile
+        lib-network/Makefile
+        lib-ui/Makefile
         lib/Makefile
         imap/Makefile
         pop/Makefile