don't leave the user in limbo when privacy system is 'none' and auto signing/encrypti...
[claws.git] / configure.ac
index edf77674d9296fa92b5695478a57ec78aeca5adb..a5f1bc95d3e871a386b8fe6739e72a5e1238e084 100644 (file)
@@ -65,6 +65,14 @@ AC_SUBST(GIT_VERSION)
 AC_CHECK_PROG(HAVE_GTK_ICON_CACHE, gtk-update-icon-cache, yes, no)
 AM_CONDITIONAL(UPDATE_GTK_ICON_CACHE, test x"$HAVE_GTK_ICON_CACHE" = xyes)
 
 AC_CHECK_PROG(HAVE_GTK_ICON_CACHE, gtk-update-icon-cache, yes, no)
 AM_CONDITIONAL(UPDATE_GTK_ICON_CACHE, test x"$HAVE_GTK_ICON_CACHE" = xyes)
 
+dnl Require pkg-config
+m4_ifndef([PKG_PROG_PKG_CONFIG],
+    [m4_fatal([Could not locate the pkg-config autoconf macros. These
+are usually located in /usr/share/aclocal/pkg.m4. If your macros
+are in a different location, try setting the environment variable
+ACLOCAL_FLAGS before running ./autogen.sh or autoreconf again. E.g.:
+export ACLOCAL_FLAGS="-I/other/macro/dir"])
+])
 PKG_PROG_PKG_CONFIG
 
 dnl libtool versioning
 PKG_PROG_PKG_CONFIG
 
 dnl libtool versioning
@@ -172,7 +180,7 @@ if test x"$_gcc_psign" = xyes ; then
        CFLAGS="$CFLAGS -Wno-pointer-sign"
 fi
 
        CFLAGS="$CFLAGS -Wno-pointer-sign"
 fi
 
-CFLAGS="$CFLAGS -Wall"
+CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
 
 if test $USE_MAINTAINER_MODE = yes; then
        CFLAGS="$CFLAGS -g -Wno-pointer-sign -DUSE_MAINTAINER_MODE"
 
 if test $USE_MAINTAINER_MODE = yes; then
        CFLAGS="$CFLAGS -g -Wno-pointer-sign -DUSE_MAINTAINER_MODE"
@@ -296,6 +304,10 @@ AC_ARG_ENABLE(svg,
         [  --disable-svg                   Do not build SVG support],
         [enable_svg=$enableval], [enable_svg=yes])
 
         [  --disable-svg                   Do not build SVG support],
         [enable_svg=$enableval], [enable_svg=yes])
 
+AC_ARG_ENABLE(tests,
+                               [ --enable-tests                   Build unit tests],
+                               [enable_tests=$enableval], [enable_tests=no])
+
 manualdir='${docdir}/manual'
 AC_ARG_WITH(manualdir,
        [  --with-manualdir=DIR    Manual directory],
 manualdir='${docdir}/manual'
 AC_ARG_WITH(manualdir,
        [  --with-manualdir=DIR    Manual directory],
@@ -415,7 +427,7 @@ AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
               uname flock lockf inet_aton inet_addr \
               fchmod mkstemp truncate getuid regcomp)
 
               uname flock lockf inet_aton inet_addr \
               fchmod mkstemp truncate getuid regcomp)
 
-AC_CHECK_FUNCS(fgets_unlocked fwrite_unlocked)
+AC_CHECK_FUNCS(fgets_unlocked fgetc_unlocked fputs_unlocked fputc_unlocked fread_unlocked fwrite_unlocked feof_unlocked ferror_unlocked fmemopen)
 
 dnl *****************
 dnl ** common code **
 
 dnl *****************
 dnl ** common code **
@@ -965,6 +977,14 @@ else
 fi
 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$enable_valgrind" = x"yes")
 
 fi
 AM_CONDITIONAL(CLAWS_VALGRIND, test x"$enable_valgrind" = x"yes")
 
+AC_MSG_CHECKING([whether to build unit tests])
+if test x$enable_tests = xyes; then
+       AC_MSG_RESULT(yes)
+else
+       AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(BUILD_TESTS, test "x$enable_tests" = "xyes")
+
 dnl *************************
 dnl ** section for plugins **
 dnl *************************
 dnl *************************
 dnl ** section for plugins **
 dnl *************************
@@ -1097,7 +1117,7 @@ AC_ARG_ENABLE(vcalendar-plugin,
 
 dnl disabled by default
 AC_ARG_ENABLE(demo-plugin,
 
 dnl disabled by default
 AC_ARG_ENABLE(demo-plugin,
-               [  --enable-demo-plugin         Build demo plugin],
+               [  --enable-demo-plugin            Build demo plugin],
                [enable_demo_plugin=$enableval], [enable_demo_plugin=no])
 
 
                [enable_demo_plugin=$enableval], [enable_demo_plugin=no])
 
 
@@ -1148,7 +1168,7 @@ AC_SUBST(EXPAT_CFLAGS)
 AC_SUBST(EXPAT_LIBS)
 
 dnl webkit *********************************************************************
 AC_SUBST(EXPAT_LIBS)
 
 dnl webkit *********************************************************************
-PKG_CHECK_MODULES(WEBKIT, webkit-1.0 >= 1.1.14, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
+PKG_CHECK_MODULES(WEBKIT, webkit-1.0 >= 1.10.0, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
 AC_SUBST(WEBKIT_LIBS)
 AC_SUBST(WEBKIT_CFLAGS)
 
 AC_SUBST(WEBKIT_LIBS)
 AC_SUBST(WEBKIT_CFLAGS)
 
@@ -2029,6 +2049,7 @@ src/common/version.h
 src/Makefile
 src/common/Makefile
 src/common/passcrypt.h
 src/Makefile
 src/common/Makefile
 src/common/passcrypt.h
+src/common/tests/Makefile
 src/gtk/Makefile
 src/etpan/Makefile
 src/plugins/Makefile
 src/gtk/Makefile
 src/etpan/Makefile
 src/plugins/Makefile
@@ -2061,12 +2082,15 @@ src/plugins/pgpcore/Makefile
 src/plugins/pgpmime/Makefile
 src/plugins/pgpinline/Makefile
 src/plugins/rssyl/Makefile
 src/plugins/pgpmime/Makefile
 src/plugins/pgpinline/Makefile
 src/plugins/rssyl/Makefile
+src/plugins/rssyl/tests/Makefile
 src/plugins/rssyl/libfeed/Makefile
 src/plugins/rssyl/libfeed/Makefile
+src/plugins/rssyl/libfeed/tests/Makefile
 src/plugins/smime/Makefile
 src/plugins/spamassassin/Makefile
 src/plugins/spam_report/Makefile
 src/plugins/tnef_parse/Makefile
 src/plugins/vcalendar/Makefile
 src/plugins/smime/Makefile
 src/plugins/spamassassin/Makefile
 src/plugins/spam_report/Makefile
 src/plugins/tnef_parse/Makefile
 src/plugins/vcalendar/Makefile
+src/tests/Makefile
 doc/Makefile
 doc/man/Makefile
 tools/Makefile
 doc/Makefile
 doc/man/Makefile
 tools/Makefile
@@ -2120,6 +2144,7 @@ echo "Generic UMPC code  : $enable_generic_umpc"
 echo "SVG support        : $enable_svg"
 echo "Config dir         : $ac_cv_with_config_dir"
 echo "Password crypto    : $pwd_crypto"
 echo "SVG support        : $enable_svg"
 echo "Config dir         : $ac_cv_with_config_dir"
 echo "Password crypto    : $pwd_crypto"
+echo "Unit tests         : $enable_tests"
 
 echo "Plugins"
 echo "   Built:"
 
 echo "Plugins"
 echo "   Built:"