From 903b6d2c6d9cff921f624d1284bea908144a7c1c Mon Sep 17 00:00:00 2001 From: Arnaud Gardelein Date: Sat, 16 Feb 2013 18:01:18 +0100 Subject: [PATCH] Check for numpy in configure.ac --- configure.ac | 1 + m4/numpy.m4 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 m4/numpy.m4 diff --git a/configure.ac b/configure.ac index ffe02c6..26afd56 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,7 @@ AM_PATH_PYTHON([2.5]) AM_PATH_IPYTHON([0.13]) AM_PATH_MATPLOTLIB([1.1]) +AM_PATH_NUMPY([1.6]) ##################################################################### # Check for libraries that use pkg-config diff --git a/m4/numpy.m4 b/m4/numpy.m4 new file mode 100644 index 0000000..418a368 --- /dev/null +++ b/m4/numpy.m4 @@ -0,0 +1,50 @@ +## ipython.m4 - Check for IPython version on a system. -*-Autoconf-*- +## Copyright (C) 2013 Arnaud Gardelein. +## Author: Arnaud Gardelein $1 needed])])]) +]) + +# AM_NUMPY_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------------------- +# Run ACTION-IF-TRUE if the IPYTHON interpreter PROG has version >= VERSION. +# Run ACTION-IF-FALSE otherwise. + +AC_DEFUN([AM_NUMPY_CHECK_VERSION], + [prog="import sys, numpy;minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]];ver = list(map(int, numpy.version.version[[0:3]].split('.'))) + [[0, 0, 0]];minverhex = sum([[minver[i]<<((4-i)*8) for i in range(0, 4)]]);verhex = sum([[ver[i]<<((4-i)*8) for i in range(0, 4)]]);sys.stdout.write('1' if verhex < minverhex else '0');" + AS_IF([AM_RUN_LOG_IPYTHON([$1 -c "$prog"])], [$3], [$4])]) + -- 2.11.4.GIT