less and less cruft: always compile socket support in
authorPierre Habouzit <madcoder@debian.org>
Sat, 4 Nov 2006 23:35:54 +0000 (00:35 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sat, 4 Nov 2006 23:35:54 +0000 (00:35 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Makefile.am
configure.ac
curs_lib.c
globals.h
hook.c
init.h

index bde3f54..4567094 100644 (file)
@@ -39,7 +39,7 @@ muttng_SOURCES = $(BUILT_SOURCES) \
        recvattach.c recvcmd.c rfc1524.c rfc3676.c \
        score.c send.c sendlib.c sidebar.c signal.c sort.c state.c status.c system.c \
        thread.c url.c utf8.c wcwidth.c \
        recvattach.c recvcmd.c rfc1524.c rfc3676.c \
        score.c send.c sendlib.c sidebar.c signal.c sort.c state.c status.c system.c \
        thread.c url.c utf8.c wcwidth.c \
-       \
+       account.c mutt_socket.c mutt_tunnel.c \
        pgp.c pgpinvoke.c pgpkey.c pgplib.c gnupgparse.c pgpmicalg.c pgppacket.c \
        crypt-mod-pgp-classic.c smime.c crypt-mod-smime-classic.c
 
        pgp.c pgpinvoke.c pgpkey.c pgplib.c gnupgparse.c pgpmicalg.c pgppacket.c \
        crypt-mod-pgp-classic.c smime.c crypt-mod-smime-classic.c
 
index f500375..370486f 100644 (file)
@@ -14,8 +14,6 @@ AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION.in'])
 
 AC_GNU_SOURCE
 
 
 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
 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
 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)
 
 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
 
     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)])
 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. ])
 
 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
 
 
 fi
 
 
@@ -425,8 +413,6 @@ fi
 AC_SUBST(DOTLOCK_GROUP)
 AC_SUBST(DOTLOCK_PERMISSION)
 
 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]),
 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"
         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
         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"
         LIBIMAP="-Limap -limap"
         LIBIMAPDEPS="\$(top_srcdir)/imap/imap.h imap/libimap.a"
         need_imap="yes"
-        need_socket="yes"
         need_md5="yes"
     fi
 ])
         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"
         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 --
 
     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 --
 
 
 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
 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"
           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
     [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])
   if test x"$need_ssl" = x"yes"
   then
     AC_MSG_ERROR([Only either OpenSSL or GNUTLS may be used])
index 443f510..451a6b1 100644 (file)
@@ -299,7 +299,6 @@ void mutt_curses_error (const char *fmt, ...)
   set_option (OPTMSGERR);
 }
 
   set_option (OPTMSGERR);
 }
 
-#ifdef USE_SOCKET
 void mutt_progress_bar (progress_t* progress, long pos) {
   char posstr[SHORT_STRING];
 
 void mutt_progress_bar (progress_t* progress, long pos) {
   char posstr[SHORT_STRING];
 
@@ -327,7 +326,6 @@ void mutt_progress_bar (progress_t* progress, long pos) {
       mutt_message ("%s %s", progress->msg, posstr);
   }
 }
       mutt_message ("%s %s", progress->msg, posstr);
   }
 }
-#endif
 
 void mutt_curses_message (const char *fmt, ...)
 {
 
 void mutt_curses_message (const char *fmt, ...)
 {
index a627708..0542e87 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -91,11 +91,9 @@ WHERE rx_t Smileys;
 WHERE rx_t GecosMask;
 WHERE rx_t StripWasRegexp;
 
 WHERE rx_t GecosMask;
 WHERE rx_t StripWasRegexp;
 
-#ifdef USE_SOCKET
 WHERE char *Preconnect INITVAL (NULL);
 WHERE char *Tunnel INITVAL (NULL);
 WHERE short NetInc;
 WHERE char *Preconnect INITVAL (NULL);
 WHERE char *Tunnel INITVAL (NULL);
 WHERE short NetInc;
-#endif /* USE_SOCKET */
 
 #ifdef MIXMASTER
 WHERE char *Mixmaster;
 
 #ifdef MIXMASTER
 WHERE char *Mixmaster;
diff --git a/hook.c b/hook.c
index 836a882..4eb6e01 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -440,7 +440,6 @@ char *mutt_crypt_hook (address_t * adr)
   return _mutt_string_hook (adr->mailbox, M_CRYPTHOOK);
 }
 
   return _mutt_string_hook (adr->mailbox, M_CRYPTHOOK);
 }
 
-#ifdef USE_SOCKET
 void mutt_account_hook (const char *url)
 {
   HOOK *hook;
 void mutt_account_hook (const char *url)
 {
   HOOK *hook;
@@ -471,4 +470,3 @@ void mutt_account_hook (const char *url)
 
   p_delete(&token.data);
 }
 
   p_delete(&token.data);
 }
-#endif
diff --git a/init.h b/init.h
index e106401..480212a 100644 (file)
--- a/init.h
+++ b/init.h
@@ -93,9 +93,6 @@ struct option_t {
 # ifndef USE_SSL
 #  define USE_SSL
 # endif
 # ifndef USE_SSL
 #  define USE_SSL
 # endif
-# ifndef USE_SOCKET
-#  define USE_SOCKET
-# endif
 # ifndef USE_LIBESMTP
 #  define USE_LIBESMTP
 # endif
 # ifndef USE_LIBESMTP
 #  define USE_LIBESMTP
 # endif
@@ -1927,7 +1924,6 @@ struct option_t MuttVars[] = {
    ** was connection lost.
    */
 #endif
    ** was connection lost.
    */
 #endif
-#ifdef USE_SOCKET
   { "net_inc", DT_NUM, R_NONE, UL &NetInc, "10" },
   /*
   ** .pp
   { "net_inc", DT_NUM, R_NONE, UL &NetInc, "10" },
   /*
   ** .pp
@@ -1937,7 +1933,6 @@ struct option_t MuttVars[] = {
   ** .pp
   ** See also ``$$read_inc'' and ``$$write_inc''.
   */
   ** .pp
   ** See also ``$$read_inc'' and ``$$write_inc''.
   */
-#endif 
   {"pager", DT_PATH, R_NONE, UL &Pager, "builtin"},
   /*
    ** .pp
   {"pager", DT_PATH, R_NONE, UL &Pager, "builtin"},
   /*
    ** .pp
@@ -2889,7 +2884,6 @@ struct option_t MuttVars[] = {
    ** in the mailbox specified by this variable.  Also see the ``$$postpone''
    ** variable.
    */
    ** in the mailbox specified by this variable.  Also see the ``$$postpone''
    ** variable.
    */
-#ifdef USE_SOCKET
   {"preconnect", DT_STR, R_NONE, UL &Preconnect, "" },
   /*
    ** .pp
   {"preconnect", DT_STR, R_NONE, UL &Preconnect, "" },
   /*
    ** .pp
@@ -2907,7 +2901,6 @@ struct option_t MuttVars[] = {
    ** \fBNote:\fP For this example to work, you must be able to log in to the
    ** remote machine without having to enter a password.
    */
    ** \fBNote:\fP For this example to work, you must be able to log in to the
    ** remote machine without having to enter a password.
    */
-#endif /* USE_SOCKET */
   {"print", DT_QUAD, R_NONE, OPT_PRINT, "ask-no" },
   /*
    ** .pp
   {"print", DT_QUAD, R_NONE, OPT_PRINT, "ask-no" },
   /*
    ** .pp
@@ -3671,7 +3664,6 @@ struct option_t MuttVars[] = {
    ** \fBNote\fP: When you delete a message in the trash folder, it is really
    ** deleted, so that there is no way to recover mail.
    */
    ** \fBNote\fP: When you delete a message in the trash folder, it is really
    ** deleted, so that there is no way to recover mail.
    */
-#ifdef USE_SOCKET
   {"tunnel", DT_STR, R_NONE, UL &Tunnel, "" },
   /*
    ** .pp
   {"tunnel", DT_STR, R_NONE, UL &Tunnel, "" },
   /*
    ** .pp
@@ -3684,7 +3676,6 @@ struct option_t MuttVars[] = {
    ** \fBNote:\fP For this example to work you must be able to log in to the remote
    ** machine without having to enter a password.
    */
    ** \fBNote:\fP For this example to work you must be able to log in to the remote
    ** machine without having to enter a password.
    */
-#endif
   {"umask", DT_NUM, R_NONE, UL &Umask, "0077" },
   /*
    ** .pp
   {"umask", DT_NUM, R_NONE, UL &Umask, "0077" },
   /*
    ** .pp
@@ -4007,9 +3998,7 @@ struct command_t Commands[] = {
   {"attachments", parse_attachments, 0 },
   {"unattachments",parse_unattachments,0 },
   {"unalternates", parse_unalternates, 0},
   {"attachments", parse_attachments, 0 },
   {"unattachments",parse_unattachments,0 },
   {"unalternates", parse_unalternates, 0},
-#ifdef USE_SOCKET
   {"account-hook", mutt_parse_hook, M_ACCOUNTHOOK},
   {"account-hook", mutt_parse_hook, M_ACCOUNTHOOK},
-#endif
   {"alias", parse_alias, 0},
   {"auto_view", parse_list, UL &AutoViewList},
   {"alternative_order", parse_list, UL &AlternativeOrderList},
   {"alias", parse_alias, 0},
   {"auto_view", parse_list, UL &AutoViewList},
   {"alternative_order", parse_list, UL &AlternativeOrderList},