Commit Graph

7 Commits

Author SHA1 Message Date
Ingo Klöcker
927f129663
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
2023-09-21 10:58:27 +02:00
Ingo Klöcker
3e64856208
build,qt: Drop broken check for -fPIC
* m4/qt6.m4: Remove attempt to build a Qt program with -fPIC.
--

libtool already takes care of adding -fPIC. Moreover, building without
-fPIC succeeded even if Qt was built with -fPIC, i.e. the check didn't
work as intended.

GnuPG-bug-id: 6696
2023-09-21 10:45:09 +02:00
Ingo Klöcker
a14155d2c1
build,qt: Simplify check for moc
m4/qt6.m4: Remove alternative checks for moc that were taken over from
Qt 5 and that are obsolete for Qt 6.
--
2023-04-19 09:23:05 +02:00
Ingo Klöcker
2ff09f474f
build,qt: Check whether building with -fPIC is needed
m4/qt6.m4: Use build test to check whether -fPIC is needed for building
a Qt application.
--
2022-10-14 14:16:47 +02:00
Ingo Klöcker
1792db5834
build,qt: Fail check for Qt if moc wasn't found
* m4/qt5.m4, m4/qt6.m4: Perform build test only if moc was found.
--

If moc wasn't found but the build test (which doesn't require moc)
succeeded, then success was reported.
2022-10-14 14:02:26 +02:00
Ingo Klöcker
f7a4671428
build,qt: Always compile the Qt 6 test application with -fpic
* m4/qt6.m4: Do not add -fpic to GPGME_QT6_CFLAGS. Add -fpic to CPPFLAGS
used for build test of simple Qt 6 application.
--

The pkgconfig files of Qt6Core do not contain the qt_config variable,
so that we cannot easily check whether Qt6 was compiled with pic. For
simplicity we always compile the test application with -fpic to avoid
a build failure if Qt6 was actually compiled with pic.
For the actual build of QGpgME libtool automatically uses -fPIC, so that
we don't have to add it to the GPGME_QT6_CFLAGS.
2022-10-14 09:31:18 +02:00
Ingo Klöcker
8d019bbb8d
build,qt: Allow building QGpgME for Qt 6
* configure.ac: Look for Qt 5 and/or Qt 6. Require C++17 if Qt 6 binding
is built. Build cmake files QGpgmeConfig* for Qt 5 and QGpgmeQt6Config*
for Qt 6.
(available_languages): Add "qt5" and "qt6".
(WANT_QT5, WANT_QT6): New conditionals.
* lang/qt/src/Makefile.am: Keep building libqgpgme for Qt 5. Build
libqgpgmeqt6 for Qt 6.
* lang/qt/tests/Makefile.am: Build tests for Qt 5 or Qt 6.
* lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in,
lang/qt/src/QGpgmeQt6Config.cmake.in.in,
lang/qt/src/QGpgmeQt6ConfigVersion.cmake.in, m4/qt6.m4: New.
--

This makes it possible to build QGpgME optionally for Qt 6.4.0 or later.
By default or if the language "qt" is enabled, then QGpgME is built
either for Qt 5 (if found) or Qt 6. A build for Qt 5 or Qt 6 can be
requested by explicitly enabling the language "qt5" or "qt6". Building
QGpgME for Qt 5 and Qt 6 simultaneously is not supported.
2022-10-11 11:00:14 +02:00