diff options
author | Slávek Banko <[email protected]> | 2018-05-24 00:35:19 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2018-05-24 00:35:31 +0200 |
commit | bf5a8ec42e72c69b546b1e18c1f18e38cf0e6222 (patch) | |
tree | 8135b9582d60f67094a88a1ac913dd2638accf60 | |
parent | a1cd2ba6b0f1baa6f2edf9cc940e23abe6d23f19 (diff) | |
download | admin-bf5a8ec42e72c69b546b1e18c1f18e38cf0e6222.tar.gz admin-bf5a8ec42e72c69b546b1e18c1f18e38cf0e6222.zip |
Add cppunit detection using pkg-configr14.0.5
Obsolete cppunit-config was removed in cppunit 1.14.0
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit e0f1af443c246204b79936bb79c0925cb4f8db4e)
-rw-r--r-- | acinclude.m4.in | 113 |
1 files changed, 61 insertions, 52 deletions
diff --git a/acinclude.m4.in b/acinclude.m4.in index e4bdd59..87f2463 100644 --- a/acinclude.m4.in +++ b/acinclude.m4.in @@ -6512,63 +6512,72 @@ if test "x$enable_cppunit" = "xyes"; then [ --enable-online-tests Include online tests with CPPUNIT tests],, enable_online_tests=no) AC_MSG_RESULT($enable_online_tests) + cppunit_version_min=$1 - if test x$cppunit_config_exec_prefix != x ; then - cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" - if test x${CPPUNIT_CONFIG+set} != xset ; then - CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config + if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists cppunit; then + PKG_CHECK_MODULES(CPPUNIT, [cppunit >= $cppunit_version_min],, + [ + AC_MSG_WARN(Minimum version of CPPUNIT couldn't be found. Tests will not be built) + no_cppunit=yes + ]) + else + if test x$cppunit_config_exec_prefix != x ; then + cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" + if test x${CPPUNIT_CONFIG+set} != xset ; then + CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config + fi fi - fi - if test x$cppunit_config_prefix != x ; then - cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" - if test x${CPPUNIT_CONFIG+set} != xset ; then - CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config + if test x$cppunit_config_prefix != x ; then + cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" + if test x${CPPUNIT_CONFIG+set} != xset ; then + CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config + fi fi - fi - AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no) - cppunit_version_min=$1 + AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no) + + AC_MSG_CHECKING(for CPPUNIT - version >= $cppunit_version_min) + no_cppunit="" + if test "$CPPUNIT_CONFIG" = "no" ; then + AC_MSG_RESULT(no) + AC_MSG_WARN(Unable to locate cppunit-config. Tests will not be built) + no_cppunit=yes + else + CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` + CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` + cppunit_version=`$CPPUNIT_CONFIG --version` + + cppunit_major_version=`echo $cppunit_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + cppunit_minor_version=`echo $cppunit_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + cppunit_micro_version=`echo $cppunit_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + + cppunit_major_min=`echo $cppunit_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + cppunit_minor_min=`echo $cppunit_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + cppunit_micro_min=`echo $cppunit_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + + cppunit_version_proper=`expr \ + $cppunit_major_version \> $cppunit_major_min \| \ + $cppunit_major_version \= $cppunit_major_min \& \ + $cppunit_minor_version \> $cppunit_minor_min \| \ + $cppunit_major_version \= $cppunit_major_min \& \ + $cppunit_minor_version \= $cppunit_minor_min \& \ + $cppunit_micro_version \>= $cppunit_micro_min ` + + if test "$cppunit_version_proper" = "1" ; then + AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version]) + else + AC_MSG_RESULT(no) + AC_MSG_WARN(Minimum version of CPPUNIT couldn't be found. Tests will not be built) + no_cppunit=yes + fi + fi - AC_MSG_CHECKING(for CPPUNIT - version >= $cppunit_version_min) - no_cppunit="" - if test "$CPPUNIT_CONFIG" = "no" ; then - AC_MSG_RESULT(no) - AC_MSG_WARN(Unable to locate cppunit-config. Tests will not be built) - no_cppunit=yes - else - CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` - CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` - cppunit_version=`$CPPUNIT_CONFIG --version` - - cppunit_major_version=`echo $cppunit_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - cppunit_minor_version=`echo $cppunit_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - cppunit_micro_version=`echo $cppunit_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - cppunit_major_min=`echo $cppunit_version_min | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - cppunit_minor_min=`echo $cppunit_version_min | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - cppunit_micro_min=`echo $cppunit_version_min | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - cppunit_version_proper=`expr \ - $cppunit_major_version \> $cppunit_major_min \| \ - $cppunit_major_version \= $cppunit_major_min \& \ - $cppunit_minor_version \> $cppunit_minor_min \| \ - $cppunit_major_version \= $cppunit_major_min \& \ - $cppunit_minor_version \= $cppunit_minor_min \& \ - $cppunit_micro_version \>= $cppunit_micro_min ` - - if test "$cppunit_version_proper" = "1" ; then - AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version]) - else - AC_MSG_RESULT(no) - AC_MSG_WARN(Minimum version of CPPUNIT couldn't be found. Tests will not be built) - no_cppunit=yes - fi fi else no_cppunit=user |