From c7c6f2381eff3d1a474392181d17236ceb0c0fd9 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 18 Mar 2015 12:39:57 +1300 Subject: [PATCH] Eliminate AC_COMPARE_VERSION We also have AX_COMPARE_VERSION which does essentially the same job. --- Tools/config/ac_compare_version.m4 | 40 ------------------------------ configure.ac | 2 +- 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 Tools/config/ac_compare_version.m4 diff --git a/Tools/config/ac_compare_version.m4 b/Tools/config/ac_compare_version.m4 deleted file mode 100644 index 0828f4789..000000000 --- a/Tools/config/ac_compare_version.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl @synopsis AC_COMPARE_VERSION\ -dnl (version-a, version-b, action-if-greater, action-if-equal, action-if-less) -dnl -dnl This macro compares two version numbers and executes the indicated action -dnl based on whether they're equal or one is greater than the other. -dnl It's needed to determine whether ocaml is new enough that the incompatible -dnl change 'loc' -> '_loc' is present in this version of camlp4. -dnl -dnl It's implemented from scratch just for SWIG by arty. -dnl -dnl @category Misc -dnl @author arty -dnl @version 2006-11-02 -dnl @license GPLWithACException - -AC_DEFUN([AC_COMPARE_VERSION], [ - # Split the version into units. - ver_a="[$1]" - ver_b="[$2]" - nodots_a=`echo $ver_a | sed -e 's/\./ /g'` - condition="equal" - isolate_b_regex='\([[0-9]]\+\).*' - for ver_part in $nodots_a ; do - b_ver_part=`echo "$ver_b" | sed -e 's/'"$isolate_b_regex"'/\1/'` - if test \( "$ver_part" -lt "$b_ver_part" \) -a \( "x$condition" = "xequal" \) ; then - condition=less - elif test \( "$ver_part" -gt "$b_ver_part" \) -a \( "x$condition" = "xequal" \) ; then - condition=greater - fi - isolate_b_regex='[[0-9]]\+\.'"$isolate_b_regex" - done - - if test "x$condition" = "xequal" ; then - [$4] - elif test "x$condition" = "xless" ; then - [$3] - elif test "x$condition" = "xgreater" ; then - [$5] - fi -]) diff --git a/configure.ac b/configure.ac index 6a1c8129e..06f037a53 100644 --- a/configure.ac +++ b/configure.ac @@ -1805,7 +1805,7 @@ else AC_MSG_CHECKING(if Ocaml version is greater than 3.08.2) OCAMLVER=`$OCAMLC -version | sed -e 's/.*version //g'` - AC_COMPARE_VERSION([$OCAMLVER],[3.08.2],[:],[:],[OCAMLLOC=_loc]) + AX_COMPARE_VERSION([$OCAMLVER], [ge], [3.08.2], [OCAMLLOC=_loc]) AC_MSG_RESULT($OCAMLVER) fi fi # Disabling ocaml