From 8e908029ffa03d21662030d3111dcf556b722e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Mon, 10 Oct 2022 14:30:41 +0200 Subject: [PATCH] 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. --- configure.ac | 4 ++-- lang/qt/src/Makefile.am | 4 ++-- lang/qt/tests/Makefile.am | 8 ++++---- m4/{qt.m4 => qt5.m4} | 18 +++++++++--------- 4 files changed, 17 insertions(+), 17 deletions(-) rename m4/{qt.m4 => qt5.m4} (89%) diff --git a/configure.ac b/configure.ac index e7fe04a7..8fcf14f6 100644 --- a/configure.ac +++ b/configure.ac @@ -375,7 +375,7 @@ if test "$found" = "1"; then *** Qt language binding depends on cpp binding. ***]]) fi - FIND_QT + FIND_QT5 if test "$have_qt5_libs" != "yes"; then if test "$explicit_languages" = "1"; then AC_MSG_ERROR([[ @@ -408,7 +408,7 @@ LIST_MEMBER("qt", $enabled_languages) if test "$found" = "1"; then AX_GCC_FUNC_ATTRIBUTE(visibility) if test "$ax_cv_have_func_attribute_visibility" = "yes"; then - GPGME_QT_CFLAGS="$GPGME_QT_CFLAGS -fvisibility=hidden" + GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS -fvisibility=hidden" fi fi diff --git a/lang/qt/src/Makefile.am b/lang/qt/src/Makefile.am index 3923e5bf..aa03cc72 100644 --- a/lang/qt/src/Makefile.am +++ b/lang/qt/src/Makefile.am @@ -261,12 +261,12 @@ nodist_qgpgmeinclude_HEADERS = qgpgme_version.h libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers) AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ - @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ + @GPGME_QT5_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ -DBUILDING_QGPGME -Wsuggest-override \ -Wzero-as-null-pointer-constant libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \ - @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT_LIBS@ + @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT5_LIBS@ libqgpgme_la_LDFLAGS = -no-undefined -version-info \ @LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@ diff --git a/lang/qt/tests/Makefile.am b/lang/qt/tests/Makefile.am index 5724a2df..a1d1b82f 100644 --- a/lang/qt/tests/Makefile.am +++ b/lang/qt/tests/Makefile.am @@ -45,12 +45,12 @@ moc_files = \ AM_LDFLAGS = -no-install LDADD = ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ - ../../../src/libgpgme.la @GPGME_QT_LIBS@ @GPG_ERROR_LIBS@ \ - @GPGME_QTTEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++ + ../../../src/libgpgme.la @GPGME_QT5_LIBS@ @GPG_ERROR_LIBS@ \ + @GPGME_QT5TEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++ AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ - @GPG_ERROR_CFLAGS@ @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ \ - @LIBASSUAN_CFLAGS@ @GPGME_QTTEST_CFLAGS@ -DBUILDING_QGPGME \ + @GPG_ERROR_CFLAGS@ @GPGME_QT5_CFLAGS@ @GPG_ERROR_CFLAGS@ \ + @LIBASSUAN_CFLAGS@ @GPGME_QT5TEST_CFLAGS@ -DBUILDING_QGPGME \ -I$(top_srcdir)/lang/qt/src \ -DTOP_SRCDIR="$(top_srcdir)" diff --git a/m4/qt.m4 b/m4/qt5.m4 similarity index 89% rename from m4/qt.m4 rename to m4/qt5.m4 index 62579d55..db32e686 100644 --- a/m4/qt.m4 +++ b/m4/qt5.m4 @@ -1,31 +1,31 @@ -dnl qt.m4 +dnl qt5.m4 dnl Copyright (C) 2016 Intevation GmbH dnl dnl This file is part of gpgme and is provided under the same license as gpgme -dnl Autoconf macro to find either Qt4 or Qt5 +dnl Autoconf macro to find Qt5 dnl -dnl sets GPGME_QT_LIBS and GPGME_QT_CFLAGS +dnl sets GPGME_QT5_LIBS and GPGME_QT5_CFLAGS dnl dnl if QT5 was found have_qt5_libs is set to yes -AC_DEFUN([FIND_QT], +AC_DEFUN([FIND_QT5], [ have_qt5_libs="no"; - PKG_CHECK_MODULES(GPGME_QT, + PKG_CHECK_MODULES(GPGME_QT5, Qt5Core >= 5.0.0, [have_qt5_libs="yes"], [have_qt5_libs="no"]) - PKG_CHECK_MODULES(GPGME_QTTEST, + PKG_CHECK_MODULES(GPGME_QT5TEST, Qt5Test >= 5.0.0, [have_qt5test_libs="yes"], [have_qt5test_libs="no"]) if ! test "$have_w32_system" = yes; then if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then - GPGME_QT_CFLAGS="$GPGME_QT_CFLAGS -fpic" + GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS -fpic" fi fi if test "$have_qt5_libs" = "yes"; then @@ -61,9 +61,9 @@ AC_DEFUN([FIND_QT], dnl we check here that we can actually compile / link a qt application dnl for host. OLDCPPFLAGS=$CPPFLAGS - CPPFLAGS=$GPGME_QT_CFLAGS + CPPFLAGS=$GPGME_QT5_CFLAGS OLDLIBS=$LIBS - LIBS=$GPGME_QT_LIBS + LIBS=$GPGME_QT5_LIBS AC_LANG_PUSH(C++) AC_MSG_CHECKING([whether a simple qt program can be built]) AC_LINK_IFELSE([AC_LANG_SOURCE([