lib-network
authorPierre Habouzit <madcoder@debian.org>
Sat, 11 Nov 2006 22:50:44 +0000 (23:50 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sat, 11 Nov 2006 22:50:44 +0000 (23:50 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
20 files changed:
Makefile.am
configure.ac
imap/imap.c
imap/imap_private.h
imap/util.c
init.c
init.h
lib-network/Makefile.am [new file with mode: 0644]
lib-network/mutt_socket.c [moved from mutt_socket.c with 100% similarity]
lib-network/mutt_socket.h [moved from mutt_socket.h with 100% similarity]
lib-network/mutt_ssl.c [moved from mutt_ssl.c with 100% similarity]
lib-network/mutt_ssl.h [moved from mutt_ssl.h with 91% similarity]
lib-network/mutt_ssl_gnutls.c [moved from mutt_ssl_gnutls.c with 100% similarity]
lib-network/mutt_tunnel.c [moved from mutt_tunnel.c with 100% similarity]
lib-network/mutt_tunnel.h [moved from mutt_tunnel.h with 100% similarity]
mutt_sasl.c
mutt_sasl.h
nntp/nntp.h
pop/pop.h
pop/pop_lib.c

index fae6d91..b7fbfcc 100644 (file)
@@ -10,7 +10,7 @@ NNTP_INCLUDES = -I$(top_srcdir)/nntp
 endif
 
 SUBDIRS = intl m4 po $(XXXXXXXXXXXX_doc) contrib \
-         lib-lib lib-mime lib-crypt lib-hash lib-ui lib \
+         lib-lib lib-mime lib-crypt lib-hash lib-network lib-ui lib \
          pop imap $(NNTP_SUBDIR)
 
 BUILT_SOURCES = keymap_defs.h version.h
@@ -27,13 +27,12 @@ madmutt_SOURCES = $(BUILT_SOURCES) \
        pager.c pattern.c postpone.c query.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
+       thread.c url.c utf8.c wcwidth.c account.c
 
 madmutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \
               -Limap -limap -Lpop -lpop $(LIBNNTP) \
               -Llib-lib -llib -Llib-mime -lmime -Llib-crypt -lcrypt -Llib-hash -lhash \
-              -Llib-ui -lui \
+              -Llib-network -lnetwork -Llib-ui -lui \
               -Llib -lsane $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
 
 madmutt_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \
@@ -63,8 +62,7 @@ INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(NNTP_INCLUDES) $(GPGME_CFLAGS) -
 CPPFLAGS=@CPPFLAGS@ -I$(includedir)
 
 EXTRA_madmutt_SOURCES = \
-       account.c mutt_sasl.c mutt_socket.c mutt_ssl.c \
-       mutt_tunnel.c resize.c dotlock.c remailer.c \
+       account.c mutt_sasl.c resize.c dotlock.c remailer.c \
        alias.h browser.h mbyte.h remailer.h url.h state.h \
        mutt_idna.h mutt_libesmtp.c sidebar.h state.h
 
@@ -74,8 +72,7 @@ EXTRA_DIST = config.rpath  COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
        dotlock.h functions.def gen_defs \
        recvattach.h handler.h thread.h \
        globals.h history.h init.h keymap.h mutt_crypt.h \
-       mime.h mutt.h mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
-       mbox.h mh.h mx.h pager.h protos.h rfc1524.h \
+       mime.h mutt.h mutt_sasl.h mbox.h mh.h mx.h pager.h protos.h rfc1524.h \
        rfc3676.h sort.h mime.types autogen.sh \
        OPS.MIX remailer.c remailer.h browser.h state.h \
        mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h madmuttrc.head madmuttrc \
index c229080..2a889f4 100644 (file)
@@ -406,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]),
@@ -439,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]),[
@@ -456,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"
@@ -912,6 +907,7 @@ AC_OUTPUT(Makefile intl/Makefile m4/Makefile
         lib-mime/Makefile
         lib-crypt/Makefile
         lib-hash/Makefile
+        lib-network/Makefile
         lib-ui/Makefile
         lib/Makefile
         imap/Makefile
index 57648c6..005c15f 100644 (file)
@@ -28,7 +28,7 @@
 #include "message.h"
 #include "imap_private.h"
 #if defined(USE_SSL) || defined(USE_GNUTLS)
-# include "mutt_ssl.h"
+# include <lib-network/mutt_ssl.h>
 #endif
 #include "buffy.h"
 
index 290f81a..b61b9b2 100644 (file)
@@ -16,7 +16,7 @@
 #include <lib-ui/curses.h>
 
 #include "imap.h"
-#include "mutt_socket.h"
+#include <lib-network/mutt_socket.h>
 
 /* -- symbols -- */
 #define IMAP_PORT 143
index f869a98..8c294d2 100644 (file)
@@ -20,7 +20,7 @@
 #include "mx.h"                 /* for M_IMAP */
 #include "url.h"
 #include "imap_private.h"
-#include "mutt_ssl.h"
+#include <lib-network/mutt_ssl.h>
 
 #include <lib-lib/macros.h>
 #include "lib/debug.h"
diff --git a/init.c b/init.c
index 7ff48e9..ce6054e 100644 (file)
--- a/init.c
+++ b/init.c
@@ -34,7 +34,7 @@
 #include "mutt_idna.h"
 
 #if defined(USE_SSL) || defined(USE_GNUTLS)
-#include "mutt_ssl.h"
+#include <lib-network/mutt_ssl.h>
 #endif
 
 #if defined (USE_LIBESMTP) && (defined (USE_SSL) || defined (USE_GNUTLS))
diff --git a/init.h b/init.h
index aa2c2bd..d76776e 100644 (file)
--- a/init.h
+++ b/init.h
@@ -1345,7 +1345,7 @@ struct option_t MuttVars[] = {
    ** files when the header cache is in use. This incurs one \fTstat(2)\fP per
    ** message every time the folder is opened.
    */
-#if HAVE_GDBM || HAVE_DB4
+#if defined(HAVE_GDBM) || defined(HAVE_DB4)
   {"header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, "16384"},
   /*
    ** .pp
diff --git a/lib-network/Makefile.am b/lib-network/Makefile.am
new file mode 100644 (file)
index 0000000..aadbab1
--- /dev/null
@@ -0,0 +1,8 @@
+noinst_LIBRARIES = libnetwork.a
+
+libnetwork_a_SOURCES = mutt_socket.h mutt_tunnel.c mutt_ssl.h \
+                      mutt_socket.c mutt_tunnel.h mutt_ssl.c mutt_ssl_gnutls.c
+
+noinst_HEADERS       = mutt_socket.h mutt_tunnel.c mutt_ssl.h
+
+-include ../cflags.mk
similarity index 100%
rename from mutt_socket.c
rename to lib-network/mutt_socket.c
similarity index 100%
rename from mutt_socket.h
rename to lib-network/mutt_socket.h
similarity index 100%
rename from mutt_ssl.c
rename to lib-network/mutt_ssl.c
similarity index 91%
rename from mutt_ssl.h
rename to lib-network/mutt_ssl.h
index 97a3fab..b0e6ee6 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "mutt_socket.h"
 
-#if defined (USE_SSL) || defined (USE_GNUTLS)
+#if defined(USE_SSL) || defined(USE_GNUTLS)
 
 int mutt_ssl_starttls (CONNECTION * conn);
 int mutt_ssl_socket_setup (CONNECTION * conn);
similarity index 100%
rename from mutt_tunnel.c
rename to lib-network/mutt_tunnel.c
similarity index 100%
rename from mutt_tunnel.h
rename to lib-network/mutt_tunnel.h
index 699e677..d5738b6 100644 (file)
@@ -18,7 +18,7 @@
 #include "mutt.h"
 #include "account.h"
 #include "mutt_sasl.h"
-#include "mutt_socket.h"
+#include <lib-network/mutt_socket.h>
 
 #include "lib/debug.h"
 
index 763c8d9..9c71a67 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <sasl/sasl.h>
 
-#include "mutt_socket.h"
+#include <lib-network/mutt_socket.h>
 
 int mutt_sasl_client_new (CONNECTION *, sasl_conn_t **);
 sasl_callback_t *mutt_sasl_get_callbacks (ACCOUNT *);
index 261a156..d82bd60 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef _NNTP_H_
 #define _NNTP_H_ 1
 
-#include "mutt_socket.h"
+#include <lib-network/mutt_socket.h>
 #include "mx.h"
 
 #include <time.h>
index edde8b7..495849b 100644 (file)
--- a/pop/pop.h
+++ b/pop/pop.h
@@ -13,7 +13,7 @@
 #include <lib-ui/curses.h>
 
 #include "mx.h"
-#include "mutt_socket.h"
+#include <lib-network/mutt_socket.h>
 
 #define POP_PORT 110
 #define POP_SSL_PORT 995
index fae3c9b..e462a6a 100644 (file)
@@ -21,7 +21,7 @@
 #include "url.h"
 #include "pop.h"
 #if defined (USE_SSL) || defined (USE_GNUTLS)
-# include "mutt_ssl.h"
+# include <lib-network/mutt_ssl.h>
 #endif
 
 #include "lib/debug.h"