aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2023-09-21 08:56:26 +0000
committerIngo Klöcker <[email protected]>2023-09-21 08:58:27 +0000
commit927f129663b8bde1ecb4e2ac2b233a7baca8a568 (patch)
treef9c2ad1da99b49b624a6bb341057b38374b1f400 /configure.ac
parentbuild,qt: Drop broken check for -fPIC (diff)
downloadgpgme-927f129663b8bde1ecb4e2ac2b233a7baca8a568.tar.gz
gpgme-927f129663b8bde1ecb4e2ac2b233a7baca8a568.zip
build,qt: Optionally build Qt 6 bindings with -mno-direct-extern-access
* configure.ac: Check if C++ compiler supports -mno-direct-extern-access. Add option to enable building with -mno-direct-extern-access. * m4/ax_check_compile_flag.m4: New. * m4/qt6.m4: Add -mno-direct-extern-access to GPGME_QT6_CFLAGS if supported and requested. -- This adds the possibility to build the Qt 6 bindings with the -mno-direct-extern-access flag. This is required if Qt 6 was built with this flag. This is a workaround for the lack of Qt 6's pkgconfig files providing this flag if needed. GnuPG-bug-id: 6696
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3115ec28..b70e31e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -338,6 +338,25 @@ 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.