Changeset: fb7305c917ec for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fb7305c917ec
Modified Files:
configure.ag
Branch: Oct2012
Log Message:
configure fixes for if there is no python2 binary, but python is version 2.
Also fixed a syntax error.
diffs (114 lines):
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1103,28 +1103,10 @@ AC_SUBST(PERL_LIBDIR)
# check if python2 and python3 exist
# if python2 or python3 doesn't exist, use python if major matches
-AC_PATH_PROG(PYTHON,python,no,$PATH)
-PYTHON_MAJ=
-if test "x$PYTHON" != xno; then
- AC_MSG_CHECKING([major version of $PYTHON])
- case "`"$PYTHON" -V 2>&1`" in
- "Python 2."[[67]]*) # older Pythons don't get Python3 syntax
- PYTHON_MAJ=2
- AC_MSG_RESULT([2])
- ;;
- "Python 3."*)
- PYTHON_MAJ=3
- AC_MSG_RESULT([3])
- ;;
- *)
- AC_MSG_ERROR([unknown Python version])
- ;;
- esac
-fi
-
-
have_python2=auto
PYTHON2=python2
+have_python3=auto
+PYTHON3=python3
AC_ARG_WITH(python2,
AS_HELP_STRING([--with-python2=FILE], [python2 is installed as FILE]),
@@ -1137,6 +1119,49 @@ case "$have_python2" in
;;
esac
+AC_ARG_WITH(python3,
+ AS_HELP_STRING([--with-python3=FILE], [python3 is installed as FILE]),
+ have_python3="$withval")
+
+case "$have_python3" in
+ yes|no|auto) ;;
+ *)
+ PYTHON3="$have_python3"
+ ;;
+esac
+
+AC_PATH_PROG(PYTHON,python,no,$PATH)
+PYTHON_MAJ=
+if test "x$PYTHON" != xno; then
+ AC_MSG_CHECKING([major version of $PYTHON])
+ case "`"$PYTHON" -V 2>&1`" in
+ "Python 2."[[67]]*) # older Pythons don't get Python3 syntax
+ PYTHON_MAJ=2
+ case "$have_python2" in
+ yes|auto)
+ have_python2=yes
+ PYTHON2="$PYTHON"
+ ;;
+ esac
+ AC_MSG_RESULT([2])
+ ;;
+ "Python 3."*)
+ PYTHON_MAJ=3
+ case "$have_python3" in
+ yes|auto)
+ have_python3=yes
+ PYTHON3="$PYTHON"
+ ;;
+ esac
+ AC_MSG_RESULT([3])
+ ;;
+ *)
+ AC_MSG_ERROR([unknown Python version])
+ ;;
+ esac
+fi
+
+
if test "x$have_python2" != xno; then
if test x$cross_compiling != xyes; then
AC_PATH_PROG(PYTHON2,$PYTHON2,no,$PATH)
@@ -1193,20 +1218,6 @@ AC_SUBST(PYTHON2)
AM_CONDITIONAL(HAVE_PYTHON2, test x"$have_python2" != xno)
AC_SUBST(PYTHON2_LIBDIR)
-have_python3=auto
-PYTHON3=python3
-
-AC_ARG_WITH(python3,
- AS_HELP_STRING([--with-python3=FILE], [python3 is installed as FILE]),
- have_python3="$withval")
-
-case "$have_python3" in
- yes|no|auto) ;;
- *)
- PYTHON3="$have_python3"
- ;;
-esac
-
if test "x$have_python3" != xno; then
if test x$cross_compiling != xyes; then
AC_PATH_PROG(PYTHON3,$PYTHON3,no,$PATH)
@@ -1272,7 +1283,7 @@ AC_SUBST(PYTHON)
# Mtest/Mfilter currently require Python 2
if test "x$enable_testing" != xno ; then
if test "x$PYTHON2" = xfalse ; then
- enable_testing = no
+ enable_testing=no
fi
fi
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list