Commit 4c10d203 authored by Karl Wette's avatar Karl Wette

lalsuite_build.m4: add LALSUITE_VERSION_COMPARE() macro

- more intuitive wrapper around AS_VERSION_COMPARE() macro
Original: 65352c34aaf94a28f70467087f4366d1fbaf74c8
parent 379dc8f1
# -*- mode: autoconf; -*-
# lalsuite_build.m4 - top level build macros
#
# serial 92
# serial 93
# not present in older versions of pkg.m4
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
......@@ -187,6 +187,14 @@ AC_DEFUN([LALSUITE_ADD_PATH],[
# end $0
])
AC_DEFUN([LALSUITE_VERSION_COMPARE],[
# $0: compare versions using the given operator
m4_case([$2],[<],,[<=],,[=],,[>=],,[>],,[m4_fatal([$0: invalid operator $2])])
AS_VERSION_COMPARE([$1],[$3],[lalsuite_op='<'],[lalsuite_op='='],[lalsuite_op='>'])
AS_CASE(['$2'],[*${lalsuite_op}*],[m4_default([$4],[:])],[*],[m4_default([$5],[:])])
# end $0
])
AC_DEFUN([LALSUITE_CHECK_GIT_REPO],[
# $0: check for git
AC_PATH_PROGS([GIT],[git],[false])
......@@ -337,7 +345,7 @@ AC_DEFUN([LALSUITE_REQUIRE_PYTHON],[
AS_IF([test "x${lalsuite_require_pyvers}" = x],[
lalsuite_require_pyvers="$1"
],[
AS_VERSION_COMPARE([${lalsuite_require_pyvers}],[$1],[
LALSUITE_VERSION_COMPARE([$1],[>],[${lalsuite_require_pyvers}],[
lalsuite_require_pyvers="$1"
])
])
......@@ -348,7 +356,7 @@ AC_DEFUN([LALSUITE_CHECK_PYTHON],[
# $0: check for Python
lalsuite_pyvers="$1"
AS_IF([test "x${lalsuite_require_pyvers}" != x],[
AS_VERSION_COMPARE([${lalsuite_pyvers}],[${lalsuite_require_pyvers}],[
LALSUITE_VERSION_COMPARE([${lalsuite_require_pyvers}],[>],[${lalsuite_pyvers}],[
lalsuite_pyvers="${lalsuite_require_pyvers}"
])
])
......
......@@ -2,7 +2,7 @@
# lalsuite_swig.m4 - SWIG configuration
# Author: Karl Wette, 2011--2014
#
# serial 67
# serial 68
AC_DEFUN([_LALSUITE_CHECK_SWIG_VERSION],[
# $0: check the version of $1, and store it in ${swig_version}
......@@ -119,7 +119,7 @@ AC_DEFUN([LALSUITE_USE_SWIG],[
AS_IF([test "x${SWIG}" != x],[
AC_MSG_CHECKING([if ${SWIG} version >= ${swig_min_version}])
_LALSUITE_CHECK_SWIG_VERSION([${SWIG}])
AS_VERSION_COMPARE([${swig_version}],[${swig_min_version}],[
LALSUITE_VERSION_COMPARE([${swig_version}],[<],[${swig_min_version}],[
AC_MSG_RESULT([no (${swig_version})])
AC_MSG_ERROR([require SWIG with version >= ${swig_min_version}])
])
......@@ -128,12 +128,12 @@ AC_DEFUN([LALSUITE_USE_SWIG],[
AC_PATH_PROGS_FEATURE_CHECK([SWIG],[swig swig2.0],[
AC_MSG_CHECKING([if ${ac_path_SWIG} version >= ${swig_min_version}])
_LALSUITE_CHECK_SWIG_VERSION([${ac_path_SWIG}])
ac_path_SWIG_found=true
AS_VERSION_COMPARE([${swig_version}],[${swig_min_version}],[ac_path_SWIG_found=false])
AS_IF([${ac_path_SWIG_found}],[
LALSUITE_VERSION_COMPARE([${swig_version}],[>=],[${swig_min_version}],[
ac_path_SWIG_found=true
AC_MSG_RESULT([yes (${swig_version})])
ac_cv_path_SWIG="${ac_path_SWIG}"
],[
ac_path_SWIG_found=false
AC_MSG_RESULT([no (${swig_version})])
])
],[
......@@ -280,7 +280,7 @@ AC_DEFUN([LALSUITE_USE_SWIG_OCTAVE],[
AC_MSG_ERROR([could not determine ${OCTAVE} version])
])
AC_MSG_RESULT([${octave_version}])
AS_VERSION_COMPARE([${octave_min_version}],[${octave_version}],[],[],[
LALSUITE_VERSION_COMPARE([${octave_version}],[<],[${octave_min_version}],[
AC_MSG_ERROR([require Octave version >= ${octave_min_version}])
])
......@@ -385,7 +385,7 @@ EOD`]
# check NumPy version
AC_MSG_CHECKING([NumPy version])
AS_VERSION_COMPARE([${numpy_min_version}],[${numpy_version}],[],[],[
LALSUITE_VERSION_COMPARE([${numpy_version}],[<],[${numpy_min_version}],[
AC_MSG_ERROR([require NumPy version >= ${numpy_min_version}])
])
AC_MSG_RESULT([${numpy_version}])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment