Commit b8e3f80d authored by Daniel Veillard's avatar Daniel Veillard
Browse files

updated configure.in for python3

parent 0ab8ce53
......@@ -766,7 +766,7 @@ if test "$with_python" != "no" ; then
if test -x "$PYTHON"
then
echo Found python in environment PYTHON=$PYTHON
with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
with_python=`$PYTHON -c "import sys; print(sys.exec_prefix)"`
else
AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
fi
......@@ -775,50 +775,53 @@ if test "$with_python" != "no" ; then
fi
if test "$PYTHON" != ""
then
PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
PYTHON_VERSION=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_version())"`
PYTHON_INCLUDES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`
# does not work as it produce a /usr/lib/python path instead of/usr/lib64/python
#
# PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib())"`
echo Found Python version $PYTHON_VERSION
fi
if test "$PYTHON_VERSION" != ""
if test "$PYTHON_VERSION" != "" -a "$PYTHON_INCLUDES" = ""
then
if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
-d $with_python/lib/python$PYTHON_VERSION/site-packages
if test -r $with_python/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
else
if test -r $prefix/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
else
if test -r /usr/include/python$PYTHON_VERSION/Python.h
then
PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
else
if test -r $with_python/include/Python.h -a \
-d $with_python/lib/site-packages
if test -r $with_python/include/Python.h
then
PYTHON_INCLUDES=$with_python/include
PYTHON_SITE_PACKAGES=$with_python/lib/site-packages
else
echo could not find python$PYTHON_VERSION/Python.h or $with_python/include/Python.h
fi
fi
fi
if test ! -d "$PYTHON_SITE_PACKAGES"
then
PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
fi
fi
PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`
fi
if test "$with_python" != ""
if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = ""
then
pythondir='$(PYTHON_SITE_PACKAGES)'
else
pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages'
if test -d $libdir/python$PYTHON_VERSION/site-packages
then
PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages
else
if test -d $with_python/lib/site-packages
then
PYTHON_SITE_PACKAGES=$with_python/lib/site-packages
else
PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib())"`
fi
fi
fi
pythondir='$(PYTHON_SITE_PACKAGES)'
PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`
else
PYTHON=
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment