From: Gerhard Sittig Date: Tue, 22 Nov 2022 10:11:50 +0000 (+0100) Subject: configure: Accept glibmm-2.68 as an alternative to glibmm-2.4 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ee9e086f1d6c9a43a19426045d150379a40ba779;p=libsigrok.git configure: Accept glibmm-2.68 as an alternative to glibmm-2.4 Check for both glibmm-2.4 as well as glibmm-2.68. Prefer the former when either is available, to remain backwards compatible. This unbreaks builds on OS X with homebrew where only glibmm-2.68 is available. Implementor's note: It's yet to get determined whether glibmm-2.68 is to get preferred, being the first stable release of that external dependency. https://gitlab.gnome.org/GNOME/glibmm/-/blob/2.68.2/NEWS The commit is phrased to simplify future adjustment of this preference. This commit is based on work that was Submitted-By: Fabrice Fontaine --- diff --git a/README b/README index ecdc2fd9..8686a262 100644 --- a/README +++ b/README @@ -64,7 +64,7 @@ Requirements for the C++ bindings: - doxygen (required for building the bindings, not only for C++ API docs!) - graphviz (optional, only needed for the C++ API docs) - Python (2 or 3) executable (development files are not needed) - - glibmm-2.4 (>= 2.32.0) + - glibmm-2.4 (>= 2.32.0) or glibmm-2.68 (>= 2.68.0) Requirements for the Python bindings: diff --git a/bindings/cxx/libsigrokcxx.pc.in b/bindings/cxx/libsigrokcxx.pc.in index 10a92f2d..7d2723fc 100644 --- a/bindings/cxx/libsigrokcxx.pc.in +++ b/bindings/cxx/libsigrokcxx.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: libsigrokcxx Description: C++ bindings for libsigrok URL: http://www.sigrok.org -Requires: libsigrok glibmm-2.4 +Requires: libsigrok @SR_GLIBMM_REQUIRES@ Version: @SR_PACKAGE_VERSION@ Libs: -L${libdir} -lsigrokcxx Libs.private: -lm diff --git a/configure.ac b/configure.ac index f36a3b24..c98c55a4 100644 --- a/configure.ac +++ b/configure.ac @@ -421,8 +421,21 @@ AS_IF([test "x$HAVE_MODERN_CXX" = x], [SR_APPEND([sr_cxx_missing], [', '], ['C++11'])]) # The C++ bindings need glibmm. -SR_PKG_CHECK([glibmm], [SR_PKGLIBS_CXX], [glibmm-2.4 >= 2.32.0]) +# Prefer glibmm-2.4 for backwards compatibility. +# Accept glibmm-2.68 when glibmm-2.4 is not available. +sr_have_glibmm=no AS_IF([test "x$sr_have_glibmm" != xyes], + [SR_PKG_CHECK([glibmm24], [SR_PKGLIBS_CXX], [glibmm-2.4 >= 2.32.0])]) +AS_IF([test "x$sr_have_glibmm24" = xyes], + [SR_APPEND([SR_GLIBMM_REQUIRES], [glibmm-2.4>=2.32.0]) + sr_have_glibmm=yes]) +AS_IF([test "x$sr_have_glibmm" != xyes], + [SR_PKG_CHECK([glibmm268], [SR_PKGLIBS_CXX], [glibmm-2.68 >= 2.68.0])]) +AS_IF([test "x$sr_have_glibmm268" = xyes], + [SR_APPEND([SR_GLIBMM_REQUIRES], [glibmm-2.68>=2.68.0]) + sr_have_glibmm=yes]) +AS_IF([test "x$sr_have_glibmm" = xyes], + [AC_SUBST(SR_GLIBMM_REQUIRES)], [SR_APPEND([sr_cxx_missing], [', '], [glibmm])]) # The C++ bindings use Doxygen to parse libsigrok symbols.