build,qt: Build Qt with -fPIC if required or requested
* configure.ac: Add option to enable building the Qt 6 binding with -fPIC. Fix typo and mention default for --enable-no-direct-extern-access option. * m4/qt6.m4: Add -fPIC to GPGME_QT6_CFLAGS if requested or if Qt 6 was built with reduce_relocations. -- GnuPG-bug-id: 6781
This commit is contained in:
parent
cf88690cf4
commit
ae332749ee
3
NEWS
3
NEWS
@ -4,6 +4,9 @@ Noteworthy changes in version 1.23.2 (unreleased)
|
||||
* qt: Use a temporary file name when creating signed or encrypted
|
||||
archives. [T6721]
|
||||
|
||||
* qt: Build Qt 6 bindings with -fPIC if requested or Qt 6 was built with
|
||||
this flag. [T6781]
|
||||
|
||||
|
||||
Noteworthy changes in version 1.23.1 (2023-10-27)
|
||||
-------------------------------------------------
|
||||
|
16
configure.ac
16
configure.ac
@ -338,6 +338,18 @@ if test x$fixed_search_path != x ; then
|
||||
[Locate binaries only via this PATH])
|
||||
fi
|
||||
|
||||
# Option --enable-reduce-relocations
|
||||
#
|
||||
# Allow building the Qt 6 bindings explicitly with -fPIC if the automatic
|
||||
# detection fails. Note: We assume that this flag is always available (unless
|
||||
# we built for Windows).
|
||||
AC_ARG_ENABLE([reduce-relocations],
|
||||
AS_HELP_STRING([--enable-reduce-relocations],
|
||||
[build Qt 6 bindings with -fPIC (default is
|
||||
auto)]),
|
||||
[use_reduce_relocations="$enableval"],
|
||||
[use_reduce_relocations=""])
|
||||
|
||||
# Option --enable-no-direct-extern-access
|
||||
#
|
||||
# Some distributions build Qt 6 with -mno-direct-extern-access. Libraries and
|
||||
@ -352,8 +364,8 @@ AX_CHECK_COMPILE_FLAG([-mno-direct-extern-access],
|
||||
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]),
|
||||
[build Qt 6 bindings with
|
||||
-mno-direct-extern-access (default is auto)]),
|
||||
[use_no_direct_extern_access="$enableval"],
|
||||
[use_no_direct_extern_access=""])
|
||||
|
||||
|
29
m4/qt6.m4
29
m4/qt6.m4
@ -34,10 +34,30 @@ AC_DEFUN([FIND_QT6],
|
||||
fi
|
||||
|
||||
if test "$have_qt6_libs" = "yes"; then
|
||||
if test "$have_no_direct_extern_access" = yes; then
|
||||
if test -z "$use_no_direct_extern_access" && test "$have_w32_system" != yes; then
|
||||
if test "$have_w32_system" != yes; then
|
||||
mkspecsdir=$($PKG_CONFIG --variable mkspecsdir Qt6Platform)
|
||||
if test -n "$mkspecsdir"; then
|
||||
if test -z "$mkspecsdir"; then
|
||||
AC_MSG_WARN([Failed to determine Qt's mkspecs directory. Cannot check its build configuration.])
|
||||
fi
|
||||
fi
|
||||
|
||||
# check if we need -fPIC
|
||||
if test -z "$use_reduce_relocations" && test -n "$mkspecsdir"; then
|
||||
AC_MSG_CHECKING([whether Qt was built with -fPIC])
|
||||
if grep -q "QT_CONFIG .* reduce_relocations" $mkspecsdir/qconfig.pri; then
|
||||
use_reduce_relocations="yes"
|
||||
else
|
||||
use_reduce_relocations="no"
|
||||
fi
|
||||
AC_MSG_RESULT([$use_reduce_relocations])
|
||||
fi
|
||||
if test "$use_reduce_relocations" = yes; then
|
||||
GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS -fPIC"
|
||||
fi
|
||||
|
||||
# check if we need -mno-direct-extern-access
|
||||
if test "$have_no_direct_extern_access" = yes; then
|
||||
if test -z "$use_no_direct_extern_access" && 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"
|
||||
@ -45,9 +65,6 @@ AC_DEFUN([FIND_QT6],
|
||||
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"
|
||||
|
Loading…
Reference in New Issue
Block a user