aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2023-09-21 20:53:00 +0000
committerIngo Klöcker <[email protected]>2023-09-21 20:53:00 +0000
commit4e321a0f06ffba2437fa34ccb88527e9ea633703 (patch)
tree06ae31f41cd287a3bc53ae9a7d9a4e79ba93c311
parentbuild,qt: Optionally build Qt 6 bindings with -mno-direct-extern-access (diff)
downloadgpgme-4e321a0f06ffba2437fa34ccb88527e9ea633703.tar.gz
gpgme-4e321a0f06ffba2437fa34ccb88527e9ea633703.zip
build,qt: Autodetect whether Qt was built with -mno-direct-extern-access
* m4/qt6.m4: Check the build configuration of Qt 6 for no_direct_extern_access. -- If building with -mno-direct-extern-access has been neither enabled nor disabled explicitly, then check whether Qt 6 was built with this flag. The check is skipped, if we build for Windows. GnuPG-bug-id: 6696
-rw-r--r--m4/qt6.m421
1 files changed, 18 insertions, 3 deletions
diff --git a/m4/qt6.m4 b/m4/qt6.m4
index f317eace..e87fc244 100644
--- a/m4/qt6.m4
+++ b/m4/qt6.m4
@@ -34,9 +34,24 @@ AC_DEFUN([FIND_QT6],
fi
if test "$have_qt6_libs" = "yes"; then
- if test "$have_no_direct_extern_access" = "yes" \
- && test "$use_no_direct_extern_access" = "yes"; then
- GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS -mno-direct-extern-access"
+ if test "$have_no_direct_extern_access" = yes; then
+ if test -z "$use_no_direct_extern_access" && test "$have_w32_system" != yes; then
+ mkspecsdir=$($PKG_CONFIG --variable mkspecsdir Qt6Platform)
+ if test -n "$mkspecsdir"; then
+ AC_MSG_CHECKING([whether Qt was built with -mno-direct-extern-access])
+ if grep -q "QT_CONFIG .* no_direct_extern_access" $mkspecsdir/qconfig.pri; then
+ use_no_direct_extern_access="yes"
+ else
+ use_no_direct_extern_access="no"
+ fi
+ AC_MSG_RESULT([$use_no_direct_extern_access])
+ else
+ AC_MSG_WARN([Failed to determine Qt's mkspecs directory. Cannot check its build configuration.])
+ fi
+ fi
+ if test "$use_no_direct_extern_access" = yes; then
+ GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS -mno-direct-extern-access"
+ fi
fi
dnl Check that a binary can actually be build with this qt.