- AC_PATH_PROG(CLN_CONFIG, cln-config, no)
- min_cln_version=ifelse([$1], ,1.1.0,$1)
- AC_MSG_CHECKING(for CLN - version >= $min_cln_version)
- no_cln=""
- if test "$CLN_CONFIG" = "no" ; then
- no_cln=yes
- else
- LIBCLN_CPPFLAGS=`$CLN_CONFIG $clnconf_args --cppflags`
- LIBCLN_LIBS=`$CLN_CONFIG $clnconf_args --libs`
-
- cln_major_version=`$CLN_CONFIG $cln_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- cln_minor_version=`$CLN_CONFIG $cln_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- cln_micro_version=`$CLN_CONFIG $cln_config_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- if test "x$enable_clntest" = "xyes" ; then
- ac_save_CPPFLAGS="$CPPFLAGS"
- ac_save_LIBS="$LIBS"
- CPPFLAGS="$CPPFLAGS $LIBCLN_CPPFLAGS"
- LIBS="$LIBS $LIBCLN_LIBS"
-dnl
-dnl Now check if the installed CLN is sufficiently new. (Also sanity
-dnl checks the results of cln-config to some extent
-dnl
- rm -f conf.clntest
- AC_TRY_RUN([
+AC_PATH_PROG(CLN_CONFIG, cln-config, no)
+cln_min_version=ifelse([$1], ,1.1.0,$1)
+AC_MSG_CHECKING(for CLN - version >= $cln_min_version)
+if test "$CLN_CONFIG" = "no" ; then
+ AC_MSG_RESULT(no)
+ echo "*** The cln-config script installed by CLN could not be found"
+ echo "*** If CLN was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the CLN_CONFIG environment variable to the"
+ echo "*** full path to cln-config."
+ ifelse([$3], , :, [$3])
+else
+dnl Parse required version and the result of cln-config.
+ cln_min_major_version=`echo $cln_min_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ cln_min_minor_version=`echo $cln_min_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ cln_min_micro_version=`echo $cln_min_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ CLN_CPPFLAGS=`$CLN_CONFIG $cln_config_args --cppflags`
+ CLN_LIBS=`$CLN_CONFIG $cln_config_args --libs`
+ cln_config_major_version=`$CLN_CONFIG $cln_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ cln_config_minor_version=`$CLN_CONFIG $cln_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ cln_config_micro_version=`$CLN_CONFIG $cln_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+dnl Check if the installed CLN is sufficiently new according to cln-config.
+ if test \( $cln_config_major_version -lt $cln_min_major_version \) -o \
+ \( $cln_config_major_version -eq $cln_min_major_version -a $cln_config_minor_version -lt $cln_min_minor_version \) -o \
+ \( $cln_config_major_version -eq $cln_min_major_version -a $cln_config_minor_version -eq $cln_min_minor_version -a $cln_config_micro_version -lt $cln_min_micro_version \); then
+ echo -e "\n*** 'cln-config --version' returned $cln_config_major_version.$cln_config_minor_version.$cln_config_micro_version, but the minimum version"
+ echo "*** of CLN required is $cln_min_major_version.$cln_min_minor_version.$cln_min_micro_version. If cln-config is correct, then it is"
+ echo "*** best to upgrade to the required version."
+ echo "*** If cln-config was wrong, set the environment variable CLN_CONFIG"
+ echo "*** to point to the correct copy of cln-config, and remove the file"
+ echo "*** config.cache before re-running configure."
+ ifelse([$3], , :, [$3])
+ else
+dnl The versions match so far. Now do a sanity check: Does the result of cln-config
+dnl match the version of the headers and the version built into the library, too?
+ no_cln=""
+ if test "x$enable_clntest" = "xyes" ; then
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LIBS="$LIBS"
+ CPPFLAGS="$CPPFLAGS $CLN_CPPFLAGS"
+ LIBS="$LIBS $CLN_LIBS"
+ rm -f conf.clntest
+ AC_TRY_RUN([