less and less cruft: always compile socket support in
[apps/madmutt.git] / configure.ac
index f500375..370486f 100644 (file)
@@ -14,8 +14,6 @@ AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION.in'])
 
 AC_GNU_SOURCE
 
-ifdef([AC_LIBOBJ], , [define([AC_LIBOBJ], [LIB[]OBJS="$LIBOBJS $1.o"])])
-
 ALL_LINGUAS="de ru it es uk fr pl nl cs id sk ko el zh_TW zh_CN pt_BR eo gl sv da lt tr ja hu et ca bg"
 
 AC_CANONICAL_HOST
@@ -288,7 +286,6 @@ fi
 AC_DECL_SYS_SIGLIST
 
 AC_TYPE_PID_T
-dnl AC_CHECK_TYPE(ssize_t, int)
 
 AC_CHECK_FUNCS(fgetpos memmove setegid srand48 strerror)
 AC_REPLACE_FUNCS(strcasecmp setenv)
@@ -299,15 +296,6 @@ if test $ac_cv_func_getopt = yes; then
     AC_CHECK_HEADERS(getopt.h)
 fi
 
-dnl SCO uses chsize() instead of ftruncate()
-AC_CHECK_FUNCS(ftruncate, , [AC_CHECK_LIB(x, chsize)])
-
-dnl SCO has strftime() in libintl
-AC_CHECK_FUNCS(strftime, , [AC_CHECK_LIB(intl, strftime)])
-
-dnl AIX may not have fchdir()
-AC_CHECK_FUNCS(fchdir, , [mutt_cv_fchdir=no])
-
 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)])
@@ -328,7 +316,7 @@ fi
 
 if test $mutt_cv_regex = yes; then
     AC_DEFINE(USE_GNU_REGEX,1,[ Define if you want to use the included regex.c. ])
-    AC_LIBOBJ(regex)
+    LIBOBJS="$LIBOBJS regex.o"
 fi
 
 
@@ -425,8 +413,6 @@ fi
 AC_SUBST(DOTLOCK_GROUP)
 AC_SUBST(DOTLOCK_PERMISSION)
 
-need_socket="no"
-
 dnl -- socket dependencies --
 
 AC_ARG_ENABLE(pop,  AC_HELP_STRING([--enable-pop], [Enable POP3 support]),
@@ -434,7 +420,6 @@ AC_ARG_ENABLE(pop,  AC_HELP_STRING([--enable-pop], [Enable POP3 support]),
         AC_DEFINE(USE_POP,1,[ Define if you want support for the POP3 protocol. ])
         LIBPOP="-Lpop -lpop"
         LIBPOPDEPS="\$(top_srcdir)/pop/pop.h pop/libpop.a"
-        need_socket="yes"
         need_pop="yes"
         need_md5="yes"
     fi
@@ -447,7 +432,6 @@ AC_ARG_ENABLE(imap, AC_HELP_STRING([--enable-imap], [Enable IMAP support]),
         LIBIMAP="-Limap -limap"
         LIBIMAPDEPS="\$(top_srcdir)/imap/imap.h imap/libimap.a"
         need_imap="yes"
-        need_socket="yes"
         need_md5="yes"
     fi
 ])
@@ -459,26 +443,19 @@ AC_ARG_ENABLE(nntp, [  --enable-nntp              Enable NNTP support],
         LIBNNTP="-Lnntp -lnntp"
         LIBNNTPDEPS="\$(top_srcdir)/nntp/nntp.h nntp/libnntp.a"
         need_nntp="yes"
-        need_socket="yes"
     fi
 ])
 AM_CONDITIONAL(BUILD_NNTP, test x$need_nntp = xyes)
 
 dnl -- end socket dependencies --
 
-if test "$need_socket" = "yes"
-then
-    AC_MSG_CHECKING([for socklen_t])
-    AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]),
-            AC_MSG_RESULT([no])
-            AC_DEFINE(socklen_t,int, [ Define to 'int' if <sys/socket.h> doesn't have it. ]))
-    AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
-    AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
-    AC_CHECK_FUNCS(getaddrinfo)
-    AC_DEFINE(USE_SOCKET,1,
-            [ Include code for socket support. Set automatically if you enable POP3 or IMAP ])
-    MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS account.o mutt_socket.o mutt_tunnel.o"
-fi
+AC_MSG_CHECKING([for socklen_t])
+AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]),
+        AC_MSG_RESULT([no])
+        AC_DEFINE(socklen_t,int, [ Define to 'int' if <sys/socket.h> doesn't have it. ]))
+AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
+AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
+AC_CHECK_FUNCS(getaddrinfo)
 
 dnl -- imap dependencies --
 
@@ -515,10 +492,6 @@ 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 "$need_socket" != "yes"; then
-           AC_MSG_ERROR([SSL support is only useful with POP or IMAP support])
-          fi
-
           if test "$with_ssl" != "yes"
           then
            LDFLAGS="$LDFLAGS -L$withval/lib"
@@ -544,10 +517,6 @@ AC_ARG_WITH([gnutls], AC_HELP_STRING([--with-gnutls[=PFX]], [Enable SSL support
     [gnutls_prefix="$withval"], [gnutls_prefix="no"])
 if test "$gnutls_prefix" != "no"
 then
-  if test "$need_socket" != "yes"
-  then
-    AC_MSG_ERROR([SSL support is only useful with POP or IMAP support])
-  fi
   if test x"$need_ssl" = x"yes"
   then
     AC_MSG_ERROR([Only either OpenSSL or GNUTLS may be used])