From 927f129663b8bde1ecb4e2ac2b233a7baca8a568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Thu, 21 Sep 2023 10:56:26 +0200 Subject: 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 --- configure.ac | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'configure.ac') 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. -- cgit v1.2.3