Commit Graph

74 Commits

Author SHA1 Message Date
Ingo Klöcker
4e321a0f06
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
2023-09-21 22:53:00 +02:00
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
NIIBE Yutaka
0518ed32e2
build: Update libassuan.m4 for libassuan version 3 in future.
* m4/libassuan.m4: Update from libassuan master.

--

New libassuan 3 has backward compatible API.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-07-28 14:07:06 +09: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
NIIBE Yutaka
806a5d18b9
build: Update gpg-error.m4.
* m4/gpg-error.m4: Update from libgpg-error master.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-06 08:40:12 +09:00
Ben Greiner (bnavigator)
d086653cc3
python: Update python.m4 configure script.
* configure.ac: Unset PYTHON_LIBS.  Support python 3.10.
* m4/python.m4: Find correct version string for python >= 3.10.
--

See-also: https://dev.gnupg.org/D546

Also test for 3.11 and 3.12 (wk).
2023-03-17 10:06:55 +01:00
NIIBE Yutaka
2b7fcbf2f2
m4: Update gpg-error.m4.
* m4/gpg-error.m4: Update from libgpg-error master.

--

GnuPG-bug-id: 6273
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2022-11-15 13:39:56 +09:00
NIIBE Yutaka
9f5e117292
build: Update libassuan.m4.
* m4/libassuan.m4: Update from libassuan master.

--

GnuPG-bug-id: 5034
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2022-11-02 10:12:48 +09:00
NIIBE Yutaka
d36905bb80
build: Update gpg-error.m4.
* m4/gpg-error.m4: Update from libgpg-error 1.46.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2022-10-24 12:10:39 +09: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
Ingo Klöcker
8e908029ff
build,qt: Explicitly namespace a few Qt variables for Qt5
m4/qt.m4: Rename to
m4/qt5.m4: this.
(FIND_QT): Rename to FIND_QT5.
(GPGME_QT): Change variable prefix to GPGME_QT5.
(GPGME_QTTEST: Change variable prefix to GPGME_QT5TEST.
configure.ac, lang/qt/src/Makefile.am, lang/qt/tests/Makefile.am:
Adjust accordingly.
--

In preparation to adding support for building qgpgme for Qt6, add the
version number to a few variables to avoid confusion.
2022-10-10 14:46:39 +02:00
Ingo Klöcker
73e96bfaa8 build: Update ax_cxx_compile_stdcxx macro
* m4/ax_cxx_compile_stdcxx.m4: Replace with current version from the
autoconf archive.
--

This fixes the problem that the switch -std=c++11 was omitted if the
compiler supported C++11 features by default. This made gcc happily
compile C++14 code. Now C++11 is enforced by gcc.

GnuPG-bug-id: 6141
2022-08-22 15:04:32 +02:00
NIIBE Yutaka
16020c5fd9 build: Fix for modern Autoconf.
* m4/glib-2.0.m4: Use AC_RUN_IFELSE and AC_LINK_IFELSE.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2022-07-21 13:47:06 +09:00
NIIBE Yutaka
aa94b4cee5 build: Update gpg-error.m4
* m4/gpg-error.m4: Update from libgpg-error.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2022-06-28 11:28:06 +09:00
Ingo Klöcker
fe588fef09 cpp: Set default visibility of all symbols to hidden
* configure.ac: Add -fvisibility=hidden to GPGME_CPP_CFLAGS if gcc
supports the flag.
* lang/cpp/src/Makefile.am (AM_CPPFLAGS): Add GPGME_CPP_CFLAGS.
* m4/ax_gcc_func_attribute.m4: New.
--

With this change all defined symbols are hidden by default, so that they
are not exported anymore. All symbols that are part of the ABI and that
shall still be exported are already marked as having default visibility.

The m4 macro was taken from the website mentioned in the License header
of the file.

GnuPG-bug-id: 5906
2022-03-28 17:22:48 +02:00
NIIBE Yutaka
50daf3d75d libtool: Link without -flat_namespace for macOS.
* m4/libtool.m4: Not setting 10.0 to MACOSX_DEPLOYMENT_TARGET when not
defined.  Only specify -flat_namespace to linker for specific
(older) versions and hosts.

--

Original patch was by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
in

    https://lists.gnu.org/archive/html/libtool-patches/
    2020-06/msg00001.html

Reported-by: Aleix Conchillo Flaque
GnuPG-bug-id: 5610
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-11-10 11:06:34 +09:00
NIIBE Yutaka
792a7e7f04 build: Update gpg-error.m4
* m4/gpg-error.m4: Update from libgpg-error.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-05-27 13:35:38 +09:00
NIIBE Yutaka
223779dfde build: Update with newer autoconf constructs.
* configure.ac: Use AC_USE_SYSTEM_EXTENSIONS instead of AC_GNU_SOURCE.
Use AS_HELP_STRING instead of AC_HELP_STRING.
* m4/libtool.m4: Update from libgpg-error.
* m4/gpg-error.m4: Update from libgpg-error.
* m4/libassuan.m4: Update from libassuan.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2020-11-18 14:34:52 +09:00
Werner Koch
2b8680aba9
python: Also detect python 3.9.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2020-02-14 13:16:01 +01:00
Daniel Kahn Gillmor
414938cfed m4/python: Scan for python 3.8 as well
* m4/python.m4: Scan for python 3.8 as well.

--

It's not clear to me why python3.8 should be commented out of the
python path search.  This change simplifies and normalizes the search
for modern versions of python 3.

Signed-Off-By: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2020-01-23 18:26:48 -05:00
NIIBE Yutaka
c4aa4af50f build: Update gpg-error.m4 and libassuan.m4.
* m4/gpg-error.m4: Update from master.
* m4/libassuan.m4: Update from master.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2018-11-13 11:44:24 +09:00
Daniel Kahn Gillmor
2557d0ae6f spelling: fix misspellings
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-11-08 12:34:27 +07:00
Daniel Kahn Gillmor
2f12427e41 doc: use https:// for www.gnu.org
--

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-10-18 00:28:51 -04:00
Werner Koch
ff6ff616ae
python: Auto-check for all installed python versions.
* m4/python.m4 (AM_PATH_PYTHON): Add a 4th arg.
* configure.ac (available_languages): Remove separate python2 and
python3 and keep just python.  Simplify test for pythons.  Use an
explicit list of python versions to test.
--

This seems to be a starightforward chnage to support more than two
python versions.  I am not sure why we had that complicated thing
before.  On my box I get builds and run tests for 2.7, 3.4 and 3.5.
If 3.6, 3.7 or 3.8 are installed they should also work.

GnuPG-bug-id: 3354
Signed-off-by: Werner Koch <wk@gnupg.org>
2018-10-17 10:05:35 +02:00
Ben McGinnes
23894ac9a9 python bindings: CPython order
* Changed the order of python versions the configure/make process
  checks for, placing Python 3.7 ahead of 3.6.
* Updated the HOWTO documentation to reflect this change.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-10-03 06:58:51 +10:00
Ben McGinnes
35e29e1395 m4 update: python 3.7
* Fixed an error in arcane m4 syntax.
2018-06-29 14:52:37 +10:00
Ben McGinnes
43a2b57545 python bindings: python 3.7
* Bindings confirmed to work with the newly released 3.7.0.
* Updated M4 file to reflect this change and correct the Python binary
  search order (3.7 is not yet given priority, but will still be found
  first via the more generic python3 executable).
* Updated setup.py.in, bindings documentation and README to reflect this.
2018-06-29 14:26:30 +10:00
Justus Winter
104635eb50
python: Improve Python detection.
* m4/python.m4 (_AM_PYTHON_INTERPRETER_LIST): Prefer the generic
'pythonX' over 'pythonX.Y'.  This way we select the users preferred
version for both flavors.  Prefer 'python' over 'python3' but not over
'python2' so that the algorithm still finds a 'python2' even if
'python' is a Python3.

Fixes-commit: 5189c08af9
Signed-off-by: Justus Winter <justus@g10code.com>
2017-03-22 15:33:06 +01:00
Justus Winter
5189c08af9
build: Tune M4 macros for our needs.
* m4/ax_python_devel.m4: Do not emit 'HAVE_PYTHON'.
* m4/python.m4 (_AM_PYTHON_INTERPRETER_LIST): Add newer Python
versions, drop older ones.  Also, sort the list with older versions at
the front, newer and generic versions towards the end.  This makes the
algorithm pick the lowest version that meets the version requirement.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-03-14 12:20:18 +01:00
Justus Winter
067da472f9
build: Add M4 macros for python.
* m4/python.m4: New file.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-03-14 12:01:19 +01:00
Raphael Kubo da Costa
211844f049 Qt: Make sure extended grep is used with '|'.
* m4/qt.m4: Use grep -E when using the alternation character.
--

POSIX specifies '|' is only supposed to work as an alternation special
character when grep is used in extended mode. The code worked fine
with GNU grep because it accepts extended regular expressions by
default, but other POSIX-compliant implementations might fail and take
it literally.

Signed-off-by: Raphael Kubo da Costa <rakuco@FreeBSD.org>
2016-12-19 10:36:17 +01:00
Werner Koch
7f5f26fd66
doc: Replace http: by https: in core source files.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2016-11-16 13:27:00 +01:00
Justus Winter
99db351288 python: Improve build system integration.
* configure.ac: Try to compile a Python module for each version.
* m4/m4_ax_swig_python.m4: Drop unused file.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-14 13:10:40 +02:00
Andre Heinecke
938f7e9c8b m4: Don't set fpic for qt on windows
* m4/qt.m4 (FIND_QT): Do not set fpic for windows.

--
Otherwise each compile call will result in a warning that
fpic is ignored for windows.
2016-07-12 15:26:14 +02:00
Andre Heinecke
744978cce8 m4: Use LIBS instead of LDFLAGS for Qt libs
* m4/qt.m4: Modify LIBS instead of LDFLAGS for link test.

--
The test would otherwise fail when building for windows because the
link order was wrong.
2016-07-12 15:10:16 +02:00
Andre Heinecke
ed07031315 m4: Add compile / link check for qt
* m4/qt.m4 (FIND_QT): Check if a qt application can be compiled and
linked.

--
In case gpgme is cross compiled pkg-config may pick up qt
for the build system and not for the host system. To avoid that
we check that we can compile a qt program for host.
2016-07-11 18:48:42 +02:00
Justus Winter
1607aa7fe5 python: Make Python detection more robust.
Previously, missing Python development packages made configure fail
instead of merely disabling the bindings.

* configure.ac: Check for 'PYTHON_VERSION'.
* m4/ax_python_devel.m4: Make test non-fatal.

Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-01 15:33:52 +02:00
Andre Heinecke
b107fc8a92 Cpp: Set -std=c++11 also if CXXCPP is already set
* m4/ax_cxx_compile_stdxx.m4 (AX_CXX_COMPILE_STDCXX): Set CXXCPP if
neccessary.

--
This fixes the build with scan-build where CXXCPP is already set but
does not include stdc++11. While this deviates from the
autotools-archive version of the script it does not make sense
to me first to check if stdc++11 needs to be set and then not
set it.
2016-05-24 14:13:52 +02:00
Justus Winter
4711a1e181 build: Add python autoconf macro.
* m4/ax_python_devel.m4: New file.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-17 16:34:39 +02:00
Justus Winter
db34332535 Merge branch 'justus/pyme3' 2016-05-17 15:10:28 +02:00
Justus Winter
a29babd07c python: Integrate into the build system.
* configure.ac: Make Python bindings configurable, add new Makefile.
* lang/python/Makefile.am: New file.
* lang/python/setup.py: Integrate into the build system.
* m4/ax_pkg_swig.m4: New file from the autoconf archive.
* m4/m4_ax_swig_python.m4: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2016-05-11 13:33:05 +02:00
Andre Heinecke
c07aaef6eb Cpp: Require c++ 11 if cpp binding requested
* configure.ac: Call ax_cxx_compile_stdcxx
* m4/ax_cxx_compile_stdcxx.m4

--
Depending on c++11 is intended to make the port away from
Boost easier.

The m4 macro was taken from the website mentioned in the License
header of the file.
2016-04-03 04:46:51 -08:00
Andre Heinecke
faf987dd62 Qt: Add a unit test for qgpgme
* configure.ac: Configure test Makefile.
* m4/qt.m4: Look up Qt5Test flags.
* lang/qt/tests/t-keylist.cpp: New. Simple keylist check.
* lang/qt/tests/Makefile.am: New. General test framework.

--
This test mostly checks that it basically compiles / works and
adds a test framework.
2016-04-03 01:48:46 -08:00
Andre Heinecke
8347f3d5fc Add qgpgme as qt language binding
* configure.ac: Add version defines. Check for qt if neccessary.
* lang/README: Mention qt
* lang/cpp/src/GpgmeppConfig.cmake.in.in: Remove comment. Find qgpgme.
* lang/qt/src/Makefile.am: New. Build qgpgme.
* lang/qt/README,
 lang/qt/src/Makefile.am,
 lang/qt/src/QGpgmeConfig.cmake.in.in,
 lang/qt/src/QGpgmeConfigVersion.cmake.in,
 lang/qt/src/dataprovider.cpp,
 lang/qt/src/dataprovider.h,
 lang/qt/src/qgpgme_export.h,
 m4/qt.m4: New.
* lang/cpp/src/GpgmeppConfig.cmake.in.in,
 lang/cpp/src/Makefile.am: Fix generated config file.

--
For now this is just the dataprovider which was part of the
KF5 Gpgmepp QGpgme variant. This is very thin but a useful
class which is used downstream.
2016-03-08 15:37:10 +01:00
Werner Koch
4027a0a897 build: Implement SYSROOT feature.
* configure.ac: Document SYSROOT.
* m4/gpg-error.m4: Update from libgpg-error master.
* src/gpgme.m4: Implement SYSROOT stuff.
2014-10-02 15:57:50 +02:00
Werner Koch
d739d4d8cf Fix libtool 2.4.2 to correctly detect .def files.
* build-aux/ltmain.sh (sed_uncomment_deffile): New.
(orig_export_symbols): Uncomment def file before testing for EXPORTS.
* m4/libtool.m4: Do the same for the generated code.
--

The old code was not correct in that it only looked at the first line
and puts an EXPORTS keyword in front if missing.  Binutils 2.22
accepted a duplicated EXPORTS keyword but at least 2.23.2 is more
stringent and bails out without this fix.

There is no need to send this upstream.  Upstream's git master has a
lot of changes including a similar fix for this problems.  There are
no signs that a libtool 2.4.3 will be released to fix this problem and
thus we need to stick to our copy of 2.4.2 along with this patch.

Signed-off-by: Werner Koch <wk@gnupg.org>
2013-05-23 20:15:30 +02:00