ax_python_glue.m4 1.26 KB
Newer Older
1 2 3
#
# AX_PYTHON_GLUE([MINVERSION = 0])
#
4
AC_DEFUN([AX_PYTHON_GLUE],[
5
	AC_REQUIRE([AM_PATH_PYTHON])
6
	AX_PYTHON_MODULE([glue])
7
	AS_IF([test "x$HAVE_PYMOD_GLUE" == "xyes"], [
8
		AC_MSG_CHECKING(glue version)
9
		GLUE_VERSION=`$PYTHON -c "from glue import __version__ ; print '.'.join(__version__.strip().split('.'))"`
10 11 12 13
		AS_IF([test $? != "0"], [
			AC_MSG_ERROR(["cannot determine version"])
		])
		minversion=$1
14
		AX_COMPARE_VERSION([$GLUE_VERSION], [ge], [${minversion:-0}], [
15 16 17 18 19 20
			AC_MSG_RESULT([$GLUE_VERSION])
		], [
			AC_MSG_WARN([found $GLUE_VERSION, require at least $1])
		])
		unset minversion
	])
21 22
])

23 24 25
#
# AX_PYTHON_LIGO_SEGMENTS([MINVERSION = 0])
#
26
AC_DEFUN([AX_PYTHON_LIGO_SEGMENTS],[
27
	AC_REQUIRE([AM_PATH_PYTHON])
28
	AX_PYTHON_MODULE([ligo.segments])
29
	AS_IF([test "x$HAVE_PYMOD_LIGO_SEGMENTS" == "xyes"], [
30 31
		AC_MSG_CHECKING(ligo.segments version)
		LIGO_SEGMENTS_VERSION=`$PYTHON -c "from ligo.segments import __version__ ; print '.'.join(__version__.strip().split('.'))"`
32 33 34 35 36 37 38 39 40 41 42
		AS_IF([test $? != "0"], [
			AC_MSG_ERROR(["cannot determine version"])
		])
		minversion=$1
		AX_COMPARE_VERSION([$LIGO_SEGMENTS_VERSION], [ge], [${minversion:-0}], [
			AC_MSG_RESULT([$LIGO_SEGMENTS_VERSION])
		], [
			AC_MSG_WARN([found $LIGO_SEGMENTS_VERSION, require at least $1])
		])
		unset minversion
	])
43
])