]> sigrok.org Git - libsigrok.git/commitdiff
configure: Accept glibmm-2.68 as an alternative to glibmm-2.4
authorGerhard Sittig <redacted>
Tue, 22 Nov 2022 10:11:50 +0000 (11:11 +0100)
committerGerhard Sittig <redacted>
Thu, 24 Nov 2022 12:52:01 +0000 (13:52 +0100)
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 <redacted>
README
bindings/cxx/libsigrokcxx.pc.in
configure.ac

diff --git a/README b/README
index ecdc2fd92875f35f14dd23c629c8a46503a289e7..8686a262889351fae0e088883be6b8157bcdd4c1 100644 (file)
--- 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:
 
index 10a92f2dce314b88dcbd2af7b49d9323f51485a3..7d2723fc89a972090a56d9bd6533038450c934f9 100644 (file)
@@ -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
index f36a3b2452be0dfeb9035660dc9d69297dc6f267..c98c55a4808b9921bce93e245134afdf481993ed 100644 (file)
@@ -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.