we're synced...
[claws.git] / configure.ac
index 5ea18c46fe128488fc490f668f850550798685d9..57b1a1edf2a258eef9ac394bd18e28a2b3eb063f 100644 (file)
@@ -11,9 +11,9 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=39
+EXTRA_VERSION=57
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.2
+EXTRA_GTK2_VERSION=.1
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
@@ -279,7 +279,17 @@ else
 fi
 
 dnl Check for OpenSSL
-AM_PATH_OPENSSL
+AC_ARG_ENABLE(openssl,
+       [  --enable-openssl    Attempt to use OpenSSL for SSL support.],
+       [ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=yes])
+if test x"$ac_cv_enable_openssl" = xyes; then
+       PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.7, :, ac_cv_enable_openssl=no)
+       if test x$ac_cv_enable_openssl = xyes; then
+               AC_DEFINE(USE_OPENSSL, 1, Define if you want OpenSSL support)
+       fi
+fi
+AC_SUBST(OPENSSL_CFLAGS)
+AC_SUBST(OPENSSL_LIBS)
 
 dnl password encryption
 OLDLIBS=$LIBS
@@ -356,13 +366,40 @@ else
        AC_MSG_RESULT(no)
 fi
 
+dnl check for pthread support
+AC_ARG_ENABLE(pthread,
+       [  --disable-pthread           Disable pthread support],
+       [ac_cv_enable_pthread=$enableval], [ac_cv_enable_pthread=yes])
+AC_MSG_CHECKING([whether to use pthread])
+if test x$ac_cv_enable_pthread = xno; then
+       AC_MSG_RESULT(no)
+else
+       AC_MSG_RESULT(yes)
+
+       AC_CHECK_LIB(pthread, pthread_create, :, ac_cv_enable_pthread=no)
+       AC_CHECK_HEADERS(pthread.h, :, ac_cv_enable_pthread=no)
+
+       if test x$ac_cv_enable_pthread = xyes; then
+               AC_DEFINE(USE_PTHREAD, 1, Define if you have pthread)
+               PTHREAD_LIBS="-lpthread"
+       fi
+
+fi
+AC_SUBST(PTHREAD_LIBS)
+
 dnl for LDAP support in addressbook
 dnl no check for libraries; dynamically loaded
 AC_ARG_ENABLE(ldap,
        [  --enable-ldap           Enable LDAP support [default=no]],
        [ac_cv_enable_ldap=$enableval], [ac_cv_enable_ldap=no])
 AC_MSG_CHECKING([whether to use LDAP])
-if test "$ac_cv_enable_ldap" = yes; then
+if test x"$ac_cv_enable_ldap" = xno; then
+       AC_MSG_RESULT(no)
+elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
+       AC_MSG_RESULT(no - LDAP support needs pthread support)
+
+       ac_cv_enable_ldap=no
+else
        AC_MSG_RESULT(yes)
 
        dnl check for available libraries, and pull them in
@@ -372,11 +409,7 @@ if test "$ac_cv_enable_ldap" = yes; then
        AC_CHECK_LIB(lber, ber_get_tag, LDAP_LIBS="$LDAP_LIBS -llber",,
                     $LDAP_LIBS)
 
-       dnl we need libpthread for sylpheed ldap,  until we find
-       dnl a better way to handle ldap requests asynchronously...
-       AC_CHECK_LIB(pthread, pthread_create, LDAP_LIBS="$LDAP_LIBS -lpthread")
-
-       AC_CHECK_HEADERS(ldap.h lber.h pthread.h,
+       AC_CHECK_HEADERS(ldap.h lber.h,
                         [ ac_cv_enable_ldap=yes ],
                         [ ac_cv_enable_ldap=no ])
 
@@ -385,19 +418,28 @@ if test "$ac_cv_enable_ldap" = yes; then
                             [ ac_cv_enable_ldap=yes ],
                             [ ac_cv_enable_ldap=no ],
                             $LDAP_LIBS)
+
+               AC_CHECK_LIB(ldap, ldap_start_tls_s,
+                            [ ac_cv_have_tls=yes ],
+                            [ ac_cv_have_tls=no ])
+
        fi
 
        AC_MSG_CHECKING([whether ldap library is available])
        AC_MSG_RESULT($ac_cv_enable_ldap)
 
+       AC_MSG_CHECKING([whether TLS library is available])
+       AC_MSG_RESULT($ac_cv_have_tls)
+
        if test "$ac_cv_enable_ldap" = yes; then
                CFLAGS="$CFLAGS `$GLIB_CONFIG --cflags gthread`"
                LDAP_LIBS="$LDAP_LIBS -lldap `$GLIB_CONFIG --libs gthread`"
                AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
                AC_SUBST(LDAP_LIBS)
+               if test "$ac_cv_have_tls" = yes; then
+                       AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
+               fi
        fi
-else
-       AC_MSG_RESULT(no)
 fi
 
 dnl for JPilot support in addressbook
@@ -467,6 +509,15 @@ if test x"$ac_cv_enable_spamassassin_plugin" = xyes; then
 fi
 AM_CONDITIONAL(BUILD_SPAMASSASSIN_PLUGIN, test x"$ac_cv_enable_spamassassin_plugin" = xyes)
 
+dnl --- PGP/MIME ---
+AC_ARG_ENABLE(pgpmime-plugin,
+       [  --disable-pgpmime-plugin           Do not build PGP/MIME plugin],
+       [ac_cv_enable_pgpmime_plugin=$enableval], [ac_cv_enable_pgpmime_plugin=yes])
+if test x"$ac_cv_enable_gpgme" = xyes -a x"$ac_cv_enable_pgpmime_plugin" = xyes; then
+       PLUGINS="pgpmime $PLUGINS"
+fi
+AM_CONDITIONAL(BUILD_PGPMIME_PLUGIN, test x"$ac_cv_enable_pgpmime_plugin" = xyes)
+
 dnl --- MathML Viewer ---
 AC_ARG_ENABLE(mathml-viewer-plugin,
        [  --disable-mathml-viewer-plugin    Do not build MathML-Viewer plugin],
@@ -475,12 +526,12 @@ if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
        PKG_CHECK_MODULES(GTK_MATH_VIEW, gtkmathview >= 0.5, :, ac_cv_enable_mathml_viewer_plugin=no)
 
        if test x"$ac_cv_enable_mathml_viewer_plugin" = xyes; then
-               AC_SUBST(GTK_MATH_VIEW_CFLAGS)
-               AC_SUBST(GTK_MATH_VIEW_LIBS)
 
                PLUGINS="mathml-viewer $PLUGINS"
        fi
 fi
+AC_SUBST(GTK_MATH_VIEW_CFLAGS)
+AC_SUBST(GTK_MATH_VIEW_LIBS)
 AM_CONDITIONAL(BUILD_MATHML_VIEWER_PLUGIN, test x"$ac_cv_enable_mathml_viewer_plugin" = xyes)
 
 dnl --- Image Viewer ---
@@ -537,13 +588,13 @@ if test x"$ac_cv_enable_clamav_plugin" = xyes; then
        AC_CHECK_HEADERS(clamav.h, :, ac_cv_enable_clamav_plugin=no)
        if test x"$ac_cv_enable_clamav_plugin" = xyes; then
                CLAMAV_LIBS="${clamav_lib}"
-               AC_SUBST(CLAMAV_LIBS)
 
                PLUGINS="clamav $PLUGINS"
        else
                AC_MSG_NOTICE([clamav library not found, will not build clamav plugin])
        fi
 fi
+AC_SUBST(CLAMAV_LIBS)
 AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes)
 
 dnl ****************************
@@ -570,6 +621,7 @@ src/plugins/image_viewer/Makefile
 src/plugins/trayicon/Makefile
 src/plugins/trayicon/libeggtrayicon/Makefile
 src/plugins/clamav/Makefile
+src/plugins/pgpmime/Makefile
 doc/Makefile
 doc/faq/Makefile
 doc/faq/de/Makefile