From 4c0db9d83daeaf6fe0b7292ade512ba8da7f5571 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 28 Nov 2015 14:27:45 +0000 Subject: [PATCH] Python 3 on windows configure fix For Appveyor, don't use python-config which comes from Cygwin --- configure.ac | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index b6842e35c..f352b8201 100644 --- a/configure.ac +++ b/configure.ac @@ -624,6 +624,10 @@ else AC_MSG_RESULT($PYVER) if test -z "$PYVER"; then PYVER=0 + else + AC_MSG_CHECKING(for Python os.name) + PYOSNAME=`($PYTHON -c "import sys, os; sys.stdout.write(os.name)")` + AC_MSG_RESULT($PYOSNAME) fi fi @@ -634,9 +638,6 @@ else AC_MSG_CHECKING(for Python exec-prefix) PYEPREFIX=`($PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)") 2>/dev/null` AC_MSG_RESULT($PYEPREFIX) - AC_MSG_CHECKING(for Python os.name) - PYOSNAME=`($PYTHON -c "import sys, os; sys.stdout.write(os.name)")` - AC_MSG_RESULT($PYOSNAME) if test x"$PYOSNAME" = x"nt"; then # Windows installations are quite different to posix installations @@ -751,22 +752,28 @@ AS_HELP_STRING([--with-python3=path], [Set location of Python 3.x executable]),[ if test x"${PY3BIN}" = xno; then AC_MSG_NOTICE([Disabling Python 3.x support]) else + if test -z "$PYVER"; then + PYVER=0 + fi if test "x$PY3BIN" = xyes; then - for py_ver in 3 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 ""; do - AC_CHECK_PROGS(PYTHON3, [python$py_ver]) - if test -n "$PYTHON3"; then - AC_CHECK_PROGS(PY3CONFIG, [$PYTHON3-config]) - if test -n "$PY3CONFIG"; then - break + if test x"$PYOSNAME" = x"nt" -a $PYVER -ge 3; then + PYTHON3="$PYTHON" + else + for py_ver in 3 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0 ""; do + AC_CHECK_PROGS(PYTHON3, [python$py_ver]) + if test -n "$PYTHON3"; then + AC_CHECK_PROGS(PY3CONFIG, [$PYTHON3-config]) + if test -n "$PY3CONFIG"; then + break + fi fi - fi - done + done + fi else PYTHON3="$PY3BIN" AC_CHECK_PROGS(PY3CONFIG, [$PYTHON3-config]) fi - PYVER=0 if test -n "$PYTHON3"; then AC_MSG_CHECKING([for $PYTHON3 major version number]) PYVER=`($PYTHON3 -c "import sys; sys.stdout.write(sys.version[[0]])") 2>/dev/null`