On Sun, 2022-01-09 at 08:22 +0100, Gerhard Sittig wrote: > > On Mon, 2022-01-03 at 08:32 +0100, Fabrice Fontaine wrote: > > > > --- a/configure.ac > > +++ b/configure.ac > > @@ -407,9 +407,14 @@ AS_IF([test "x$HAVE_CXX11" != x1], > > [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]) > > +SR_GLIBMM_REQUIRES=glibmm-2.4 > > +SR_PKG_CHECK([glibmm], [SR_PKGLIBS_CXX], [$SR_GLIBMM_REQUIRES >= 2.32.0]) > > +AS_IF([test "x$sr_have_glibmm" != xyes], > > + [SR_GLIBMM_REQUIRES=glibmm-2.68 > > + SR_PKG_CHECK([glibmm], [SR_PKGLIBS_CXX], [$SR_GLIBMM_REQUIRES >= > > 2.68.0])]) > > AS_IF([test "x$sr_have_glibmm" != xyes], > > [SR_APPEND([sr_cxx_missing], [', '], [glibmm])]) > > +AC_SUBST(SR_GLIBMM_REQUIRES) > > > > # The C++ bindings use Doxygen to parse libsigrok symbols. > > AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no]) > > This logic confuses me, can you come up with phrases that better > reflect what's happening? Ideally search in order of preference, > search once then use whatever was found.
Does this phrase better communicate intention? Regardless of the preferred search order. Does it work for others? Don't have many different systems here, so it's only tested with glibmm absent, and an older version present. Not tested with a newer version present, neither with both versions available. Just fishing for some resulting implementation that's easier to maintain later. configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 424b00022729..515e22d76917 100644 --- a/configure.ac +++ b/configure.ac @@ -407,7 +407,11 @@ AS_IF([test "x$HAVE_CXX11" != x1], [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]) +SR_PKG_CHECK([glibmm], [SR_PKGLIBS_CXX], + [glibmm-2.68 >= 2.68.0], [glibmm-2.4 >= 2.32.0]) +AS_IF([test "x$sr_have_glibmm" == xyes], [ + SR_APPEND([SR_GLIBMM_REQUIRES], [$SR_PKGLIBS_CXX]) + AC_SUBST(SR_GLIBMM_REQUIRES)]) AS_IF([test "x$sr_have_glibmm" != xyes], [SR_APPEND([sr_cxx_missing], [', '], [glibmm])]) virtually yours Gerhard Sittig -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. _______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel