From 4670d23c56f21afaa7ef2e0289a47a6a0d112671 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 5 Nov 2006 00:35:54 +0100 Subject: [PATCH] less and less cruft: always compile socket support in Signed-off-by: Pierre Habouzit --- Makefile.am | 2 +- configure.ac | 47 ++++++++--------------------------------------- curs_lib.c | 2 -- globals.h | 2 -- hook.c | 2 -- init.h | 11 ----------- 6 files changed, 9 insertions(+), 57 deletions(-) diff --git a/Makefile.am b/Makefile.am index bde3f54..4567094 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ - \ + 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 diff --git a/configure.ac b/configure.ac index f500375..370486f 100644 --- a/configure.ac +++ b/configure.ac @@ -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 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 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]) diff --git a/curs_lib.c b/curs_lib.c index 443f510..451a6b1 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -299,7 +299,6 @@ void mutt_curses_error (const char *fmt, ...) set_option (OPTMSGERR); } -#ifdef USE_SOCKET 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); } } -#endif void mutt_curses_message (const char *fmt, ...) { diff --git a/globals.h b/globals.h index a627708..0542e87 100644 --- a/globals.h +++ b/globals.h @@ -91,11 +91,9 @@ WHERE rx_t Smileys; WHERE rx_t GecosMask; WHERE rx_t StripWasRegexp; -#ifdef USE_SOCKET WHERE char *Preconnect INITVAL (NULL); WHERE char *Tunnel INITVAL (NULL); WHERE short NetInc; -#endif /* USE_SOCKET */ #ifdef MIXMASTER WHERE char *Mixmaster; diff --git a/hook.c b/hook.c index 836a882..4eb6e01 100644 --- 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); } -#ifdef USE_SOCKET void mutt_account_hook (const char *url) { HOOK *hook; @@ -471,4 +470,3 @@ void mutt_account_hook (const char *url) p_delete(&token.data); } -#endif diff --git a/init.h b/init.h index e106401..480212a 100644 --- a/init.h +++ b/init.h @@ -93,9 +93,6 @@ struct option_t { # ifndef USE_SSL # define USE_SSL # endif -# ifndef USE_SOCKET -# define USE_SOCKET -# endif # ifndef USE_LIBESMTP # define USE_LIBESMTP # endif @@ -1927,7 +1924,6 @@ struct option_t MuttVars[] = { ** was connection lost. */ #endif -#ifdef USE_SOCKET { "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''. */ -#endif {"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. */ -#ifdef USE_SOCKET {"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. */ -#endif /* USE_SOCKET */ {"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. */ -#ifdef USE_SOCKET {"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. */ -#endif {"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}, -#ifdef USE_SOCKET {"account-hook", mutt_parse_hook, M_ACCOUNTHOOK}, -#endif {"alias", parse_alias, 0}, {"auto_view", parse_list, UL &AutoViewList}, {"alternative_order", parse_list, UL &AlternativeOrderList}, -- 2.20.1