Qt: Fix unit test by adding initial.test dep
[gpgme.git] / configure.ac
index 4660122..b6b67ef 100644 (file)
@@ -1,7 +1,7 @@
 # configure.ac for GPGME
 # Copyright (C) 2000 Werner Koch (dd9jn)
 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-#               2009, 2010, 2011, 2012, 2013  g10 Code GmbH
+#               2009, 2010, 2011, 2012, 2013, 2014, 2015  g10 Code GmbH
 #
 # This file is part of GPGME.
 #
@@ -20,7 +20,7 @@
 
 # (Process this file with autoconf to produce a configure script.)
 AC_PREREQ(2.59)
-min_automake_version="1.11"
+min_automake_version="1.14"
 
 # To build a release you need to create a tag with the version number
 # (git tag -s gpgme-n.m.k) and run "./autogen.sh --force".  Please
@@ -29,7 +29,7 @@ min_automake_version="1.11"
 # for the LT versions.
 m4_define(mym4_version_major, [1])
 m4_define(mym4_version_minor, [6])
-m4_define(mym4_version_micro, [0])
+m4_define(mym4_version_micro, [1])
 
 # Below is m4 magic to extract and compute the revision number, the
 # decimalized short revision number, a beta version string, and a flag
@@ -55,11 +55,19 @@ AC_INIT([gpgme],[mym4_full_version],[http://bugs.gnupg.org])
 #   (Interfaces added:                 AGE++)
 #   (Interfaces removed/changed:       AGE=0)
 #
-LIBGPGME_LT_CURRENT=24
+LIBGPGME_LT_CURRENT=25
 # Subtract 2 from this value if you want to make the LFS transition an
 # ABI break.  [Note to self: Remove this comment with the next regular break.]
-LIBGPGME_LT_AGE=13
-LIBGPGME_LT_REVISION=2
+LIBGPGME_LT_AGE=14
+LIBGPGME_LT_REVISION=0
+
+LIBGPGMEPP_LT_CURRENT=3
+LIBGPGMEPP_LT_AGE=0
+LIBGPGMEPP_LT_REVISION=0
+
+LIBQGPGME_LT_CURRENT=1
+LIBQGPGME_LT_AGE=0
+LIBQGPGME_LT_REVISION=0
 
 # If the API is changed in an incompatible way: increment the next counter.
 GPGME_CONFIG_API_VERSION=1
@@ -77,9 +85,7 @@ AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SRCDIR(src/gpgme.h.in)
 AC_CONFIG_HEADER(config.h)
-# Note: For automake 1.13 add the option
-#          serial-tests
-AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
+AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
 AM_MAINTAINER_MODE
 AC_CANONICAL_HOST
 AM_SILENT_RULES
@@ -106,6 +112,12 @@ AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog, [gitlog-to-changelog])
 AC_SUBST(LIBGPGME_LT_CURRENT)
 AC_SUBST(LIBGPGME_LT_AGE)
 AC_SUBST(LIBGPGME_LT_REVISION)
+AC_SUBST(LIBGPGMEPP_LT_CURRENT)
+AC_SUBST(LIBGPGMEPP_LT_AGE)
+AC_SUBST(LIBGPGMEPP_LT_REVISION)
+AC_SUBST(LIBQGPGME_LT_CURRENT)
+AC_SUBST(LIBQGPGME_LT_AGE)
+AC_SUBST(LIBQGPGME_LT_REVISION)
 
 AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
@@ -148,6 +160,8 @@ have_w32_system=no
 have_w64_system=no
 build_w32_glib=no
 build_w32_qt=no
+available_languages="cpp cl qt"
+default_languages="cpp cl qt"
 case "${host}" in
     x86_64-*mingw32*)
         have_w64_system=yes
@@ -173,20 +187,9 @@ case "${host}" in
        AC_ARG_ENABLE(w32-glib,
            AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]),
                           build_w32_glib=$enableval)
-
-       # Check disabled, because the qt-dev packages in gpg4win do
-       # not provide any support for cross compilation.
-       # PKG_CHECK_MODULES(QT4_CORE, QtCore)
-
-       # Use it like this:
-       # ./configure --enable-w32-qt QT4_CORE_CFLAGS="..." QT4_CORE_LIBS="..."
-       AC_SUBST(QT4_CORE_CFLAGS)
-       AC_SUBST(QT4_CORE_LIBS)
-       AC_ARG_ENABLE(w32-qt,
-           AC_HELP_STRING([--enable-w32-qt], [build GPGME Qt for W32]),
-                          build_w32_qt=$enableval)
-        ;;
+       ;;
     *)
+
        AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
        if test "$have_pthread" = yes; then
          AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
@@ -232,7 +235,6 @@ fi
 AM_CONDITIONAL(HAVE_ANDROID_SYSTEM, test "$have_android_system" = yes)
 
 AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
-AM_CONDITIONAL(BUILD_W32_QT, test "$build_w32_qt" = yes)
 
 AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
 
@@ -247,6 +249,48 @@ if test x$fixed_search_path != x ; then
                     [Locate binaries only via this PATH])
 fi
 
+AC_ARG_ENABLE([languages],
+              AC_HELP_STRING([--enable-languages=languages],
+                             [enable only specific language bindings]),
+                             [enabled_languages=`echo $enableval | \
+                             tr ',:' '  ' | tr '[A-Z]' '[a-z]' | \
+                             sed 's/c++/cpp/'`],
+                             [enabled_languages="$default_languages"])
+if test "x$enabled_languages" = "x" \
+   -o "$enabled_languages" = "no"; then
+   enabled_languages=
+fi
+for language in $enabled_languages; do
+    LIST_MEMBER($language, $available_languages)
+    if test "$found" = "0"; then
+       AC_MSG_ERROR([unsupported language binding specified])
+    fi
+done
+# Enable C++ 11 if cpp language is requested
+LIST_MEMBER("cpp", $enabled_languages)
+if test "$found" = "1"; then
+    AX_CXX_COMPILE_STDCXX(11, noext, optional)
+fi
+
+# Check that if qt is enabled cpp also is enabled
+LIST_MEMBER("qt", $enabled_languages)
+if test "$found" = "1"; then
+   LIST_MEMBER("cpp", $enabled_languages)
+   if test "$found" = "0"; then
+      AC_MSG_ERROR([qt binding depends on cpp language binding])
+   fi
+   FIND_QT
+   if test "$have_qt5_libs" != "yes"; then
+       AC_MSG_ERROR([[
+   ***
+   *** Qt5 (Qt5Core) is required for qt binding.
+   ***]])
+   fi
+   # Make sure that qt comes after cpp
+   enabled_languages=`echo $enabled_languages | sed 's/qt//'`
+   enabled_languages=`echo $enabled_languages qt`
+fi
+AC_SUBST(ENABLED_LANGUAGES, $enabled_languages)
 
 #
 # Provide information about the build.
@@ -262,11 +306,21 @@ changequote([,])dnl
 BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec"
 AC_SUBST(BUILD_FILEVERSION)
 
-BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
+AC_ARG_ENABLE([build-timestamp],
+  AC_HELP_STRING([--enable-build-timestamp],
+                 [set an explicit build timestamp for reproducibility.
+                  (default is the current time in ISO-8601 format)]),
+     [if test "$enableval" = "yes"; then
+        BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
+      else
+        BUILD_TIMESTAMP="$enableval"
+      fi],
+     [BUILD_TIMESTAMP="<none>"])
 AC_SUBST(BUILD_TIMESTAMP)
 AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
                    [The time this package was configured for a build])
 
+
 #
 # Options to disable some regression tests
 #
@@ -548,7 +602,7 @@ AH_BOTTOM([
 #define GPG_ERR_ENABLE_ERRNO_MACROS 1
 
 #define CRIGHTBLURB "Copyright (C) 2000 Werner Koch\n" \
-                    "Copyright (C) 2001--2013 g10 Code GmbH\n"
+                    "Copyright (C) 2001--2015 g10 Code GmbH\n"
 ])
 
 
@@ -624,18 +678,27 @@ AC_CONFIG_FILES(Makefile src/Makefile
                 src/versioninfo.rc
                 src/gpgme.h)
 AC_CONFIG_FILES(src/gpgme-config, chmod +x src/gpgme-config)
+AC_CONFIG_FILES(lang/cpp/Makefile lang/cpp/src/Makefile)
+AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig.cmake.in)
+AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfigVersion.cmake)
+AC_CONFIG_FILES(lang/qt/Makefile lang/qt/src/Makefile)
+AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in)
+AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake)
+AC_CONFIG_FILES(lang/qt/tests/Makefile)
 AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
 AC_OUTPUT
 
 echo "
         GPGME v${VERSION} has been configured as follows:
 
-        Revision:        mym4_revision  (mym4_revision_dec)
-        Platform:        $host
+        Revision:          mym4_revision  (mym4_revision_dec)
+        Platform:          $host
+
+        UI Server:         $uiserver
+        FD Passing:        $use_descriptor_passing
+        GPGME Pthread:     $have_pthread
 
-        UI Server:       $uiserver
-        FD Passing:      $use_descriptor_passing
-        GPGME Pthread:   $have_pthread
+        Language bindings: $enabled_languages
 "
 if test "x${gpg_config_script_warn}" != x; then
 cat <<G10EOF