From 22f0c35dd2576b0121992ab09fe89e68c6532459 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 25 Feb 2015 10:48:59 +0100 Subject: Simplify with-python handling --- build/linux/configure.ac | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'build/linux/configure.ac') diff --git a/build/linux/configure.ac b/build/linux/configure.ac index f9755f9..525ca9d 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -165,8 +165,18 @@ AC_SUBST(HAVEMATLAB) AC_ARG_WITH(python, [[ --with-python=path path of Python binary (optional)]],,) HAVEPYTHON=no -if test x"$with_python" != x; then - AC_CHECK_FILE([$with_python],[PYTHON=$with_python],[AC_PATH_PROG([PYTHON], [$with_python], [AC_MSG_ERROR(Python binary not found)], [$PATH])]) +if test x"$with_python" != x -a x"$with_python" != xno; then + if test x"$with_python" = xyes; then + PYTHON=python + else + PYTHON="$with_python" + fi + AC_MSG_CHECKING(for python) + ASTRA_RUN_LOGOUTPUT(echo 'import sys' | $PYTHON -) + if test $? -ne 0; then + AC_MSG_ERROR(Python binary not found)] + fi + AC_MSG_RESULT([$PYTHON]) HAVEPYTHON=yes AC_SUBST(PYTHON) AC_MSG_CHECKING(for numpy module) @@ -215,6 +225,7 @@ echo echo "Summary of ASTRA Toolbox build options:" echo " CUDA : $HAVECUDA" echo " Matlab : $HAVEMATLAB" +echo " Python : $HAVEPYTHON" echo echo " prefix : $prefix" echo -- cgit v1.2.3