build,qt: Support building Qt bindings as nested package of gpgme

* autogen-all.sh (packages): Add lang/qt.
* configure.ac: Add qt to available languages if subdir exists. Add
qt to nested languages if enabled to generate corresponding make
targets. Call configure script of nested qt package recursively.
* lang/qt/configure.ac: Check if qgpgme is built as nested package
and set GPGME_CFLAGS, GPGME_LIBS, GPGMEPP_CFLAGS, and GPGMEPP_LIBS
accordingly.
--

This re-adds the ability to build the Qt bindings together with gpgme
with a single `configure && make` command (if building from git).

GnuPG-bug-id: 7110
This commit is contained in:
Ingo Klöcker 2024-06-05 17:20:12 +02:00
parent 6334960bbe
commit 0b0a2881ff
No known key found for this signature in database
GPG Key ID: F5A5D1692277A1E9
3 changed files with 44 additions and 9 deletions

View File

@ -15,7 +15,7 @@
prog=$(basename "$0") prog=$(basename "$0")
packages=". lang/cpp" packages=". lang/cpp lang/qt"
fatal () { fatal () {
echo "${prog}:" "$*" >&2 echo "${prog}:" "$*" >&2

View File

@ -238,7 +238,7 @@ have_macos_system=no
build_w32_glib=no build_w32_glib=no
available_languages="cl" available_languages="cl"
default_languages="cl" default_languages="cl"
for lang in cpp; do for lang in cpp qt; do
if test -d $srcdir/lang/$lang; then if test -d $srcdir/lang/$lang; then
available_languages="$available_languages $lang" available_languages="$available_languages $lang"
fi fi
@ -360,6 +360,10 @@ LIST_MEMBER("cpp", $enabled_languages)
if test "$found" = "1"; then if test "$found" = "1"; then
nested_languages="$nested_languages cpp" nested_languages="$nested_languages cpp"
fi fi
LIST_MEMBER("qt", $enabled_languages)
if test "$found" = "1"; then
nested_languages="$nested_languages qt"
fi
AC_SUBST(NESTED_LANGUAGES, $nested_languages) AC_SUBST(NESTED_LANGUAGES, $nested_languages)
@ -843,6 +847,10 @@ LIST_MEMBER("cpp", $enabled_languages)
if test "$found" = "1"; then if test "$found" = "1"; then
AC_CONFIG_SUBDIRS([lang/cpp]) AC_CONFIG_SUBDIRS([lang/cpp])
fi fi
LIST_MEMBER("qt", $enabled_languages)
if test "$found" = "1"; then
AC_CONFIG_SUBDIRS([lang/qt])
fi
AC_OUTPUT AC_OUTPUT

View File

@ -469,16 +469,43 @@ AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
AM_CONDITIONAL(USE_GPGRT_CONFIG, [test -n "$GPGRT_CONFIG" \ AM_CONDITIONAL(USE_GPGRT_CONFIG, [test -n "$GPGRT_CONFIG" \
-a "$ac_cv_path_GPG_ERROR_CONFIG" = no]) -a "$ac_cv_path_GPG_ERROR_CONFIG" = no])
# And for gpgme. # Check for gpgme and gpgmepp.
have_gpgme=no have_gpgme=no
have_gpgmepp=no
# Check if qgpgme is built as nested package of gpgme
builddir=`pwd`
if test "${srcdir%/lang/qt}/lang/qt" == "$srcdir" -a \
"${builddir%/lang/qt}/lang/qt" == "$builddir"; then
AC_MSG_CHECKING(for GpgME - assuming nested build)
gpgme_build_dir=${builddir%/lang/qt}
if test -f "$gpgme_build_dir/src/gpgme.h"; then
GPGME_CFLAGS="-I$gpgme_build_dir/src"
GPGME_LIBS="$gpgme_build_dir/src/libgpgme.la"
have_gpgme=yes
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for GpgME++ - assuming nested build)
gpgmepp_build_dir=${builddir%/lang/qt}/lang/cpp
if test -f "$gpgmepp_build_dir/src/gpgmepp_version.h"; then
GPGMEPP_CFLAGS="-I$gpgmepp_build_dir/src"
GPGMEPP_LIBS="$gpgmepp_build_dir/src/libgpgmepp.la"
have_gpgmepp=yes
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
if test "$have_gpgme" = "no"; then
AM_PATH_GPGME("$NEED_GPGME_VERSION", AM_PATH_GPGME("$NEED_GPGME_VERSION",
have_gpgme=yes, have_gpgme=no) have_gpgme=yes, have_gpgme=no)
fi
# And for gpgmepp. if test "$have_gpgmepp" = "no"; then
have_gpgmepp=no
AM_PATH_GPGMEPP("$NEED_GPGMEPP_VERSION", AM_PATH_GPGMEPP("$NEED_GPGMEPP_VERSION",
have_gpgmepp=yes, have_gpgmepp=no) have_gpgmepp=yes, have_gpgmepp=no)
fi
# Last check. # Last check.
die=no die=no