summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac309
1 files changed, 248 insertions, 61 deletions
diff --git a/configure.ac b/configure.ac
index 9d696b9..16061e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,8 +31,8 @@ min_automake_version="1.14"
# for the LT versions.
m4_define([mym4_package],[gpgme])
m4_define([mym4_major], [1])
-m4_define([mym4_minor], [18])
-m4_define([mym4_micro], [0])
+m4_define([mym4_minor], [23])
+m4_define([mym4_micro], [1])
# Below is m4 magic to extract and compute the git revision number,
# the decimalized short revision number, a beta version string and a
@@ -53,19 +53,19 @@ AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
# (Interfaces added: AGE++)
# (Interfaces removed: AGE=0)
#
-LIBGPGME_LT_CURRENT=38
-LIBGPGME_LT_AGE=27
+LIBGPGME_LT_CURRENT=43
+LIBGPGME_LT_AGE=32
LIBGPGME_LT_REVISION=0
# If there is an ABI break in gpgmepp or qgpgme also bump the
# version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in
-LIBGPGMEPP_LT_CURRENT=21
-LIBGPGMEPP_LT_AGE=15
+LIBGPGMEPP_LT_CURRENT=26
+LIBGPGMEPP_LT_AGE=20
LIBGPGMEPP_LT_REVISION=0
-LIBQGPGME_LT_CURRENT=16
-LIBQGPGME_LT_AGE=1
+LIBQGPGME_LT_CURRENT=20
+LIBQGPGME_LT_AGE=5
LIBQGPGME_LT_REVISION=0
################################################
@@ -206,6 +206,44 @@ esac
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
+#
+# Specify how we support our local modification of libtool for Windows
+# 64-bit. Options are:
+#
+# (1) apply: when appying patch fails, it results failure of entire build
+# (2) never: never apply the patch (no try)
+# (3) try: use patched if it goes well, use original if fails
+#
+AC_ARG_WITH([libtool-modification],
+ AS_HELP_STRING([--with-libtool-modification=apply|never|try],
+ [how to handle libtool modification (default=never)]),
+ build_libtool_modification=$withval,
+ build_libtool_modification=never)
+
+#
+# Apply a patch (locally maintained one of ours) to libtool
+#
+case $host in
+ x86_64-*mingw32*)
+AC_CONFIG_COMMANDS([libtool-patch],[[
+ if test "$build_selection" = never; then
+ echo "patch not applied"
+ elif (mv -f libtool libtool.orig; \
+ sed -f $srcdir/build-aux/libtool-patch.sed libtool.orig >libtool); then
+ echo "applied successfully"
+ elif test "$build_selection" = try; then
+ mv -f libtool.orig libtool
+ echo "patch failed, thus, using original"
+ else
+ echo "patch failed"
+ as_fn_exit 1
+ fi
+]],[build_selection=$build_libtool_modification])
+ ;;
+ *)
+ ;;
+esac
+
GPG_DEFAULT=no
GPGSM_DEFAULT=no
GPGCONF_DEFAULT=no
@@ -218,7 +256,7 @@ have_w64_system=no
have_macos_system=no
build_w32_glib=no
build_w32_qt=no
-available_languages="cl cpp python qt"
+available_languages="cl cpp python qt qt5 qt6"
default_languages="cl cpp python qt"
case "${host}" in
x86_64-*mingw32*)
@@ -300,12 +338,33 @@ if test x$fixed_search_path != x ; then
[Locate binaries only via this PATH])
fi
+# Option --enable-no-direct-extern-access
+#
+# Some distributions build Qt 6 with -mno-direct-extern-access. Libraries and
+# applications using Qt then must also be build with this flag. As workaround
+# for a bug in Qt's pkgconfig files which don't have this flag we allow
+# building with this flag explicitly.
+AC_LANG_PUSH(C++)
+AX_CHECK_COMPILE_FLAG([-mno-direct-extern-access],
+ [have_no_direct_extern_access="yes"],
+ [have_no_direct_extern_access="no"],
+ [-Werror])
+AC_LANG_POP()
+AC_ARG_ENABLE([no-direct-extern-access],
+ AS_HELP_STRING([--enable-no-direct-extern-access],
+ [build Qt 6 bindinds with
+ -mno-direct-extern-access]),
+ [use_no_direct_extern_access="$enableval"],
+ [use_no_direct_extern_access=""])
+
# Note: You need to declare all possible languages also in
# lang/Makefile.am's DIST_SUBDIRS.
AC_ARG_ENABLE([languages],
AS_HELP_STRING([--enable-languages=languages],
- [enable only specific language bindings]),
+ [enable only specific language bindings:
+ cl cpp python qt qt5 qt6 (qt selects qt5 or qt6,
+ and qt5 and qt6 exclude each other)]),
[enabled_languages=`echo $enableval | \
tr ',:' ' ' | tr '[A-Z]' '[a-z]' | \
sed 's/c++/cpp/'`],
@@ -331,84 +390,160 @@ for language in $enabled_languages; do
fi
done
-# Enable C++ 11 if cpp language is requested
-LIST_MEMBER("cpp", $enabled_languages)
+# Check whether Qt5 and/or Qt6 are enabled explicitly
+want_qt5="no";
+LIST_MEMBER("qt5", $enabled_languages)
if test "$found" = "1"; then
- AX_CXX_COMPILE_STDCXX(11, noext, optional)
- if test "$HAVE_CXX11" != "1"; then
- if test "$explicit_languages" = "1"; then
- AC_MSG_ERROR([[
+ want_qt5="yes";
+ # Remove qt5; further down qt will be added
+ enabled_languages=$(echo $enabled_languages | sed 's/qt5//')
+fi
+want_qt6="no";
+LIST_MEMBER("qt6", $enabled_languages)
+if test "$found" = "1"; then
+ want_qt6="yes";
+ # Remove qt6; further down qt will be added
+ enabled_languages=$(echo $enabled_languages | sed 's/qt6//')
+fi
+if test "$want_qt5" = "yes" -a "$want_qt6" = "yes"; then
+ AC_MSG_ERROR([[
***
-*** A compiler with c++11 support is required for the c++ binding.
+*** The bindings for Qt5 and Qt6 cannot be built simultaneously.
***]])
+fi
+
+# Ensure that pkg-config is available for all calls of FIND_QT5/FIND_QT6
+PKG_PROG_PKG_CONFIG
+
+# If the generic qt is enabled, then check for Qt5 or Qt6 (in this order)
+LIST_MEMBER("qt", $enabled_languages)
+if test "$found" = "1"; then
+ # Remove the generic qt (qt5 and qt6 have already been removed)
+ enabled_languages=$(echo $enabled_languages | sed 's/qt//')
+ FIND_QT5
+ if test "$have_qt5_libs" = "yes"; then
+ want_qt5="yes";
+ else
+ FIND_QT6
+ if test "$have_qt6_libs" = "yes"; then
+ want_qt6="yes";
else
- enabled_languages=$(echo $enabled_languages | sed 's/cpp//')
- enabled_languages=$(echo $enabled_languages | sed 's/qt//')
- AC_MSG_WARN([[
+ if test "$explicit_languages" = "1"; then
+ AC_MSG_ERROR([[
***
-*** No c++11 support detected. C++ and Qt bindings will be disabled.
+*** Qt5 (Qt5Core) or Qt6 (Qt6Core) is required for the Qt binding.
***]])
+ else
+ AC_MSG_WARN([[
+***
+*** Qt5 (Qt5Core) and Qt6 (Qt6Core) not found. Qt Binding will be disabled.
+***]])
+ fi
fi
fi
-fi
-
-# Check whether compiler supports visibility attribute (if cpp language is enabled)
-LIST_MEMBER("cpp", $enabled_languages)
-if test "$found" = "1"; then
- AX_GCC_FUNC_ATTRIBUTE(visibility)
- if test "$ax_cv_have_func_attribute_visibility" = "yes"; then
- GPGME_CPP_CFLAGS="$GPGME_CPP_CFLAGS -fvisibility=hidden"
+elif test "$want_qt5" = "yes"; then
+ FIND_QT5
+ if test "$have_qt5_libs" != "yes"; then
+ AC_MSG_ERROR([[
+***
+*** Qt5 (Qt5Core) is required for the Qt 5 binding.
+***]])
+ fi
+elif test "$want_qt6" = "yes"; then
+ FIND_QT6
+ if test "$have_qt6_libs" != "yes"; then
+ AC_MSG_ERROR([[
+***
+*** Qt6 (Qt6Core) is required for the Qt 6 binding.
+***]])
fi
fi
-AC_SUBST(GPGME_CPP_CFLAGS)
-# Check that if qt is enabled cpp also is enabled
-LIST_MEMBER("qt", $enabled_languages)
-if test "$found" = "1"; then
- # We need to ensure that in the language order qt comes after cpp
- # so we remove qt first and explicitly add it as last list member.
- enabled_languages=$(echo $enabled_languages | sed 's/qt//')
+# Check that cpp is enabled if qt5 or qt6 is enabled
+if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
LIST_MEMBER("cpp", $enabled_languages)
if test "$found" = "0"; then
AC_MSG_ERROR([[
***
-*** Qt language binding depends on cpp binding.
+*** The Qt bindings depend on the C++ binding.
***]])
fi
- FIND_QT
- if test "$have_qt5_libs" != "yes"; then
+fi
+
+# Enable C++ 17 if qt6 is requested
+if test "$want_qt6" = "yes"; then
+ AX_CXX_COMPILE_STDCXX(17, noext, optional)
+ if test "$HAVE_CXX17" != "1"; then
if test "$explicit_languages" = "1"; then
- AC_MSG_ERROR([[
+ AC_MSG_ERROR([[
***
-*** Qt5 (Qt5Core) is required for Qt binding.
+*** A compiler with c++17 support is required for the Qt 6 binding.
***]])
else
- AC_MSG_WARN([[
+ want_qt6="no"
+ AC_MSG_WARN([[
***
-*** Qt5 (Qt5Core) not found Qt Binding will be disabled.
+*** No c++17 support detected. Qt 6 binding will be disabled.
***]])
fi
- else
- enabled_languages=`echo $enabled_languages qt`
+ fi
+fi
- AC_CHECK_PROGS([DOXYGEN], [doxygen])
- if test -z "$DOXYGEN";
- # This is not highlighted because it's not really important.
- then AC_MSG_WARN([Doxygen not found - Qt binding doc will not be built.])
- fi
- AC_CHECK_PROGS([GRAPHVIZ], [dot])
- if test -z "$GRAPHVIZ";
- then AC_MSG_WARN([Graphviz not found - Qt binding doc will not have diagrams.])
+# Enable C++ 11 if cpp is requested (unless C++ 17 was already enabled)
+LIST_MEMBER("cpp", $enabled_languages)
+if test "$found" = "1" -a "$HAVE_CXX17" != "1"; then
+ AX_CXX_COMPILE_STDCXX(11, noext, optional)
+ if test "$HAVE_CXX11" != "1"; then
+ if test "$explicit_languages" = "1"; then
+ AC_MSG_ERROR([[
+***
+*** A compiler with c++11 support is required for the C++ binding.
+***]])
+ else
+ enabled_languages=$(echo $enabled_languages | sed 's/cpp//')
+ want_qt5="no"
+ AC_MSG_WARN([[
+***
+*** No c++11 support detected. C++ and Qt 5 bindings will be disabled.
+***]])
fi
fi
fi
-# Check if compiler supports visibility attribute (if qt is enabled)
-LIST_MEMBER("qt", $enabled_languages)
+# Now append qt to the list of language bindings
+if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
+ enabled_languages=$(echo $enabled_languages qt)
+fi
+
+# Check whether compiler supports visibility attribute (if cpp language is enabled)
+LIST_MEMBER("cpp", $enabled_languages)
if test "$found" = "1"; then
AX_GCC_FUNC_ATTRIBUTE(visibility)
if test "$ax_cv_have_func_attribute_visibility" = "yes"; then
- GPGME_QT_CFLAGS="$GPGME_QT_CFLAGS -fvisibility=hidden"
+ GPGME_CPP_CFLAGS="$GPGME_CPP_CFLAGS -fvisibility=hidden"
+ if test "$want_qt5" = "yes"; then
+ GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS -fvisibility=hidden"
+ fi
+ if test "$want_qt6" = "yes"; then
+ GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS -fvisibility=hidden"
+ fi
+ fi
+fi
+AC_SUBST(GPGME_CPP_CFLAGS)
+
+AM_CONDITIONAL(WANT_QT5, test "$want_qt5" = yes)
+AM_CONDITIONAL(WANT_QT6, test "$want_qt6" = yes)
+
+# Check for tools for building the Qt binding docs
+if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
+ AC_CHECK_PROGS([DOXYGEN], [doxygen])
+ if test -z "$DOXYGEN"; then
+ # This is not highlighted because it's not really important.
+ AC_MSG_WARN([Doxygen not found - Qt binding doc will not be built.])
+ fi
+ AC_CHECK_PROGS([GRAPHVIZ], [dot])
+ if test -z "$GRAPHVIZ"; then
+ AC_MSG_WARN([Graphviz not found - Qt binding doc will not have diagrams.])
fi
fi
@@ -443,11 +578,13 @@ if test "$found_py" = "1"; then
if test "$found_py" = "1" -o "$found_py3" = "1"; then
# Reset everything, so that we can look for another Python.
m4_foreach([mym4pythonver],
- [[2.7],[3.4],[3.5],[3.6],[3.7],[3.8],[3.9],[all]],
+ [[2.7],[3.4],[3.5],[3.6],[3.7],[3.8],[3.9],[3.10],
+ [3.11],[3.12],[all]],
[unset PYTHON
unset PYTHON_VERSION
unset PYTHON_CPPFLAGS
unset PYTHON_LDFLAGS
+ unset PYTHON_LIBS
unset PYTHON_SITE_PKG
unset PYTHON_EXTRA_LIBS
unset PYTHON_EXTRA_LDFLAGS
@@ -842,6 +979,9 @@ AH_BOTTOM([
# define GPGME_GCC_A_PURE
#endif
+/* Under Windows we use the gettext code from gpgrt. */
+#define GPG_ERR_ENABLE_GETTEXT_MACROS 1
+
/* Under WindowsCE we need gpg-error's strerror macro. */
#define GPG_ERR_ENABLE_ERRNO_MACROS 1
@@ -850,11 +990,45 @@ AH_BOTTOM([
])
-# Substitution used for gpgme-config
+# Substitution used for gpgme-config and gpgme.pc
GPGME_CONFIG_LIBS="-lgpgme"
GPGME_CONFIG_CFLAGS=""
GPGME_CONFIG_HOST="$host"
GPGME_CONFIG_AVAIL_LANG="$enabled_languages"
+
+case "$includedir" in
+ /usr/include|/include) ;;
+ '${prefix}/include')
+ if test "$prefix" != / -a "$prefix" != /usr; then
+ if test -z "$GPGME_CONFIG_CFLAGS"; then
+ GPGME_CONFIG_CFLAGS="-I\${includedir}"
+ else
+ GPGME_CONFIG_CFLAGS="-I\${includedir} $GPGME_CONFIG_CFLAGS"
+ fi
+ fi
+ ;;
+ *)
+ if test -z "$GPGME_CONFIG_CFLAGS"; then
+ GPGME_CONFIG_CFLAGS="-I\${includedir}"
+ else
+ GPGME_CONFIG_CFLAGS="-I\${includedir} $GPGME_CONFIG_CFLAGS"
+ fi
+ ;;
+esac
+case "$libdir" in
+ /usr/lib|/usr/lib64|/lib|/lib64) ;;
+ '${exec_prefix}/lib'|'${exec_prefix}/lib64')
+ if test "$exec_prefix" = "NONE"; then
+ if test "$prefix" != / -a "$prefix" != /usr; then
+ GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS"
+ fi
+ elif test "$exec_prefix" != / -a "$exec_prefix" != /usr; then
+ GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS"
+ fi
+ ;;
+ *) GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS" ;;
+esac
+
AC_SUBST(GPGME_CONFIG_API_VERSION)
AC_SUBST(GPGME_CONFIG_LIBS)
AC_SUBST(GPGME_CONFIG_CFLAGS)
@@ -933,9 +1107,16 @@ AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig.cmake.in)
AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfigVersion.cmake)
AC_CONFIG_FILES(lang/cpp/src/gpgmepp_version.h)
AC_CONFIG_FILES(lang/qt/Makefile lang/qt/src/Makefile)
-AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig-w32.cmake.in)
-AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in)
-AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake)
+if test "$want_qt5" = "yes"; then
+ AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig-w32.cmake.in)
+ AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in)
+ AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake)
+fi
+if test "$want_qt6" = "yes"; then
+ AC_CONFIG_FILES(lang/qt/src/QGpgmeQt6Config-w32.cmake.in)
+ AC_CONFIG_FILES(lang/qt/src/QGpgmeQt6Config.cmake.in)
+ AC_CONFIG_FILES(lang/qt/src/QGpgmeQt6ConfigVersion.cmake)
+fi
AC_CONFIG_FILES(lang/qt/tests/Makefile)
AC_CONFIG_FILES(lang/qt/src/qgpgme_version.h)
AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
@@ -953,6 +1134,12 @@ AC_CONFIG_FILES([lang/python/Makefile
AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
AC_OUTPUT
+if test "$want_qt5" = "yes"; then
+ enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 5)/")
+elif test "$want_qt6" = "yes"; then
+ enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 6)/")
+fi
+
echo "
GPGME v${VERSION} has been configured as follows: