From d5cc6dcc7e911858735fff65126e2d8de0cfc28f Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 29 Oct 2022 14:58:09 -0700 Subject: [PATCH] use newly acquired 'AX_COMPARE_VERSION' to simplify some version checks --- configure.ac | 66 +++++++++++----------------------------------------- 1 file changed, 13 insertions(+), 53 deletions(-) diff --git a/configure.ac b/configure.ac index 77ba70a23..e703cd7bb 100644 --- a/configure.ac +++ b/configure.ac @@ -540,24 +540,12 @@ else else SWIG_VERSION=`$SWIG -version 2>&1 | $EGREP Version | cut -d ' ' -f 3` AC_SUBST([SWIG_VERSION]) - SWIG_VERSION_MAJOR=`echo $SWIG_VERSION | cut -d '.' -f 1` - SWIG_VERSION_MINOR=`echo $SWIG_VERSION | cut -d '.' -f 2` - SWIG_VERSION_MICRO=`echo $SWIG_VERSION | cut -d '.' -f 3` - if test $SWIG_VERSION_MAJOR -lt 2; then - if test $SWIG_VERSION_MAJOR -lt 1; then - SWIG= - else - if test $SWIG_VERSION_MINOR -lt 3; then - SWIG= - else - # EL5 has swig-1.3.29 which does not define SWIGJAVA - if test $SWIG_VERSION_MICRO -lt 40; then - SWIGJAVA_CPPFLAGS=-DSWIGJAVA - AC_SUBST([SWIGJAVA_CPPFLAGS]) - fi - fi - fi - fi + AX_COMPARE_VERSION([$SWIG_VERSION], [lt], [1.3.0], [SWIG=]) + AX_COMPARE_VERSION([$SWIG_VERSION], [lt], [1.3.40], [ + # EL5 has swig-1.3.29 which does not define SWIGJAVA + SWIGJAVA_CPPFLAGS=-DSWIGJAVA + AC_SUBST([SWIGJAVA_CPPFLAGS]) + ]) AX_COMPARE_VERSION([$SWIG_VERSION], [lt], [4.1.0], [ SWIG_PHP_DATA=gv.php ], [ @@ -700,15 +688,8 @@ else GUILE_VERSION_MAJOR=`echo $GUILE_VERSION | cut -d '.' -f 1` GUILE_VERSION_MINOR=`echo $GUILE_VERSION | cut -d '.' -f 2` AC_CHECK_PROGS(GUILE,guile$GUILE_VERSION_MAJOR.$GUILE_VERSION_MINOR guile$GUILE_VERSION_MAJOR guile) - if test 0$GUILE_VERSION_MAJOR -lt 2; then - if test 0$GUILE_VERSION_MAJOR -lt 1; then - GUILE_CONFIG= - else - if test 0$GUILE_VERSION_MINOR -lt 4; then - GUILE_CONFIG= - fi - fi - fi + AX_COMPARE_VERSION([0$GUILE_VERSION_MAJOR.0$GUILE_VERSION_MINOR], [lt], + [1.4], [GUILE_CONFIG=]) if test "x$GUILE_CONFIG" = "x"; then use_guile="No (guile is too old)" else @@ -1187,10 +1168,7 @@ else if test "x$PYTHON_VERSION" = "x"; then PYTHON= else - PYTHON_VERSION_MAJOR=`echo $PYTHON_VERSION | cut -d '.' -f 1` - if test $PYTHON_VERSION_MAJOR -lt 3; then - PYTHON= - fi + AX_COMPARE_VERSION([$PYTHON_VERSION], [lt], [3], [PYTHON=]) fi fi if test "x$PYTHON" = "x"; then @@ -2192,29 +2170,11 @@ if test "x$use_gd" = "x"; then GD_FEATURES=`$GDLIB_CONFIG --features` # GD version check >= 2.0.33 -- centos-5.8 has gd-2.0.33 - GDLIB_VERSION_MAJOR=`echo $GDLIB_VERSION | cut -d '.' -f 1` - GDLIB_VERSION_MINOR=`echo $GDLIB_VERSION | cut -d '.' -f 2` - GDLIB_VERSION_MICRO=`echo $GDLIB_VERSION | cut -d '.' -f 3` - REQ_GDLIB_VERSION_MAJOR=2 - REQ_GDLIB_VERSION_MINOR=0 - REQ_GDLIB_VERSION_MICRO=33 - if test $GDLIB_VERSION_MAJOR -lt $REQ_GDLIB_VERSION_MAJOR; then - use_gd="No (major version too old)" - else - if test $GDLIB_VERSION_MAJOR -eq $REQ_GDLIB_VERSION_MAJOR; then - if test $GDLIB_VERSION_MINOR -lt $REQ_GDLIB_VERSION_MINOR; then - use_gd="No (minor version too old)" - else - if test $GDLIB_VERSION_MINOR -eq $REQ_GDLIB_VERSION_MINOR; then - if test $GDLIB_VERSION_MICRO -lt $REQ_GDLIB_VERSION_MICRO; then - use_gd="No (revision too old)" - fi - fi - fi - fi - fi + AX_COMPARE_VERSION([$GDLIB_VERSION], [lt], [2.0.33], [ + use_gd="No (version too old)" + ]) if test "x$use_gd" != "x"; then - AC_MSG_WARN(GD library version $GDLIB_VERSION_MAJOR.$GDLIB_VERSION_MINOR.$GDLIB_VERSION_MICRO < $REQ_GDLIB_VERSION_MAJOR.$REQ_GDLIB_VERSION_MINOR.$REQ_GDLIB_VERSION_MICRO) + AC_MSG_WARN(GD library version $GDLIB_VERSION < 2.0.33) fi else AC_MSG_WARN(GD neither gdlib pkgconfig nor gdlib-config was found) -- 2.40.0