Cosmetic - reformat python3 detection code

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13109 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-05-23 19:09:18 +00:00
commit 1d000ef6a6

View file

@ -626,17 +626,16 @@ AS_HELP_STRING([--with-python=path], [Set location of Python executable]),[ PYBI
# First, check for "--without-python" or "--with-python=no". # First, check for "--without-python" or "--with-python=no".
if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then
AC_MSG_NOTICE([Disabling Python]) AC_MSG_NOTICE([Disabling Python])
else else
# First figure out the name of the Python executable # First figure out the name of the Python executable
if test "x$PYBIN" = xyes; then
AC_CHECK_PROGS(PYTHON, [python python2.8 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4 python])
else
PYTHON="$PYBIN"
fi
if test "x$PYBIN" = xyes; then if test -n "$PYTHON"; then
AC_CHECK_PROGS(PYTHON, [python python2.8 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4 python])
else
PYTHON="$PYBIN"
fi
if test -n "$PYTHON"; then
AC_MSG_CHECKING(for Python prefix) AC_MSG_CHECKING(for Python prefix)
PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null` PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null`
AC_MSG_RESULT($PYPREFIX) AC_MSG_RESULT($PYPREFIX)
@ -699,15 +698,15 @@ if test -n "$PYTHON"; then
else else
PYLINK="-l$PYVERSION" PYLINK="-l$PYVERSION"
fi fi
fi fi
# Cygwin (Windows) needs the library for dynamic linking # Cygwin (Windows) needs the library for dynamic linking
case $host in case $host in
*-*-cygwin* | *-*-mingw*) PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK" *-*-cygwin* | *-*-mingw*) PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK"
DEFS="-DUSE_DL_IMPORT $DEFS" PYINCLUDE="$PYINCLUDE" DEFS="-DUSE_DL_IMPORT $DEFS" PYINCLUDE="$PYINCLUDE"
;; ;;
*)PYTHONDYNAMICLINKING="";; *)PYTHONDYNAMICLINKING="";;
esac esac
fi fi
AC_SUBST(PYINCLUDE) AC_SUBST(PYINCLUDE)
@ -732,24 +731,24 @@ AS_HELP_STRING([--with-python3=path], [Set location of Python 3.x executable]),[
# First, check for "--without-python3" or "--with-python3=no". # First, check for "--without-python3" or "--with-python3=no".
if test x"${PY3BIN}" = xno -o x"${with_alllang}" = xno ; then if test x"${PY3BIN}" = xno -o x"${with_alllang}" = xno ; then
AC_MSG_NOTICE([Disabling Python 3.x support]) AC_MSG_NOTICE([Disabling Python 3.x support])
else else
# First figure out the name of the Python3 executable # First figure out the name of the Python3 executable
if test "x$PY3BIN" = xyes; then if test "x$PY3BIN" = xyes; then
AC_CHECK_PROGS(PYTHON3, [python3 python3.0 python3.1 python3.2 python3.3 python3.4 python3.5 python3.6]) AC_CHECK_PROGS(PYTHON3, [python3 python3.0 python3.1 python3.2 python3.3 python3.4 python3.5 python3.6])
else else
PYTHON3="$PY3BIN" PYTHON3="$PY3BIN"
fi fi
# Check for Python 3.x development tools (header files, static library and python3-config) # Check for Python 3.x development tools (header files, static library and python3-config)
if test "x$PYTHON3" = x; then if test "x$PYTHON3" = x; then
AC_CHECK_PROGS(PY3CONFIG, [python3-config python3.0-config python3.1-config python3.2-config python3.3-config python3.4-config python3.5-config python3.6-config]) AC_CHECK_PROGS(PY3CONFIG, [python3-config python3.0-config python3.1-config python3.2-config python3.3-config python3.4-config python3.5-config python3.6-config])
else else
AC_CHECK_PROGS(PY3CONFIG, [$PYTHON3-config python3-config python3.0-config python3.1-config python3.2-config python3.3-config python3.4-config python3.5-config python3.6-config]) AC_CHECK_PROGS(PY3CONFIG, [$PYTHON3-config python3-config python3.0-config python3.1-config python3.2-config python3.3-config python3.4-config python3.5-config python3.6-config])
fi fi
if test -n "$PYTHON3" -a -n "$PY3CONFIG"; then if test -n "$PYTHON3" -a -n "$PY3CONFIG"; then
AC_MSG_CHECKING([for Python 3.x prefix]) AC_MSG_CHECKING([for Python 3.x prefix])
PY3PREFIX=`($PY3CONFIG --prefix) 2>/dev/null` PY3PREFIX=`($PY3CONFIG --prefix) 2>/dev/null`
AC_MSG_RESULT($PY3PREFIX) AC_MSG_RESULT($PY3PREFIX)
@ -799,15 +798,15 @@ if test -n "$PYTHON3" -a -n "$PY3CONFIG"; then
fi fi
PY3LINK="-l$PY3VERSION" PY3LINK="-l$PY3VERSION"
fi fi
# Cygwin (Windows) needs the library for dynamic linking # Cygwin (Windows) needs the library for dynamic linking
case $host in case $host in
*-*-cygwin* | *-*-mingw*) PYTHON3DYNAMICLINKING="-L$PYLIB $PY3LINK" *-*-cygwin* | *-*-mingw*) PYTHON3DYNAMICLINKING="-L$PYLIB $PY3LINK"
DEFS="-DUSE_DL_IMPORT $DEFS" PY3INCLUDE="$PY3INCLUDE" DEFS="-DUSE_DL_IMPORT $DEFS" PY3INCLUDE="$PY3INCLUDE"
;; ;;
*)PYTHON3DYNAMICLINKING="";; *)PYTHON3DYNAMICLINKING="";;
esac esac
fi fi
AC_SUBST(PY3INCLUDE) AC_SUBST(PY3INCLUDE)