diff options
| author | Ingo Klöcker <[email protected]> | 2024-06-06 09:38:28 +0000 |
|---|---|---|
| committer | Ingo Klöcker <[email protected]> | 2024-06-11 12:58:00 +0000 |
| commit | 67ebc53b0f7193dab53bb03e3536b0e81c78e2c1 (patch) | |
| tree | 60874f93284789e8d252daa23b637184be11d5ec /lang/python/configure.ac | |
| parent | build,qt: Support building Qt bindings as nested package of gpgme (diff) | |
| download | gpgme-67ebc53b0f7193dab53bb03e3536b0e81c78e2c1.tar.gz gpgme-67ebc53b0f7193dab53bb03e3536b0e81c78e2c1.zip | |
build,python: Support building Python bindings as nested package
* autogen-all.sh (packages): Add lang/python.
* configure.ac: Add python to available languages if subdir exists. Add
python to nested languages if enabled to generate corresponding make
targets. Call configure script of nested python package recursively.
* lang/python/configure.ac: Check if Python bindings are built as
nested package and set GPGME_CFLAGS and GPGME_LIBS accordingly.
* lang/python/setup.py.in: Define some variables where they are used
first. Extract library directories from GPGME_LIBS variable similar
to the extraction of include directories from GPGME_CFLAGS. Adjust
library locations in case of win32 the same way as the include
locations. Prefer gpgme.h in the include directories from GPGME_CFLAGS
over the one in the prefix, so that the correct gpgme.h is taken in
case of nested builds.
--
This re-adds the ability to build the Python bindings together with
gpgme with a single `configure && make` command (if building from git).
GnuPG-bug-id: 7110
Diffstat (limited to 'lang/python/configure.ac')
| -rw-r--r-- | lang/python/configure.ac | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lang/python/configure.ac b/lang/python/configure.ac index 34033ed3..116d7d0b 100644 --- a/lang/python/configure.ac +++ b/lang/python/configure.ac @@ -409,8 +409,26 @@ AM_CONDITIONAL(USE_GPGRT_CONFIG, [test -n "$GPGRT_CONFIG" \ # And for gpgme. have_gpgme=no -AM_PATH_GPGME("$NEED_GPGME_VERSION", - have_gpgme=yes, have_gpgme=no) +builddir=`pwd` +# Check if Python bindings are built as nested package of gpgme +if test "${srcdir%/lang/python}/lang/python" == "$srcdir" -a \ + "${builddir%/lang/python}/lang/python" == "$builddir"; then + AC_MSG_CHECKING(for GpgME - assuming nested build) + gpgme_build_dir=${builddir%/lang/python} + if test -f "$gpgme_build_dir/src/gpgme.h"; then + GPGME_CFLAGS="-I$gpgme_build_dir/src" + GPGME_LIBS="-L$gpgme_build_dir/src/.libs -lgpgme" + have_gpgme=yes + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +fi + +if test "$have_gpgme" = "no"; then + AM_PATH_GPGME("$NEED_GPGME_VERSION", + have_gpgme=yes, have_gpgme=no) +fi # |
