]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
python.m4 updated for Python 3
authorGilles DAVID <gilles-g.david@edf.fr>
Wed, 25 Oct 2017 17:16:08 +0000 (17:16 +0000)
committerGilles DAVID <gilles-g.david@edf.fr>
Wed, 25 Oct 2017 17:16:08 +0000 (17:16 +0000)
salome_adm/unix/config_files/python.m4

index fc21aa35b86dae5835842728bab659ba20c2a18b..bba9fabf59ba2d3ae3721799becb9d65d5b58db4 100644 (file)
@@ -39,13 +39,7 @@ AC_DEFUN([CHECK_PYTHON],
  [
   python_ok=yes
  
-  AC_ARG_WITH(python,
-   [AC_HELP_STRING([--with-python=DIR],[root directory path of python installation])],
-   [PYTHON="$withval/bin/python"
-    AC_MSG_RESULT("select python distribution in $withval")
-   ], [
-    AC_PATH_PROG(PYTHON, python)
-    ])
+  AM_PATH_PYTHON([3])
   
   AC_CHECKING([local Python configuration])
 
@@ -55,15 +49,18 @@ AC_DEFUN([CHECK_PYTHON],
   PYTHON_PREFIX=`echo $PYTHON_PREFIX | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
   PYTHONHOME=$PYTHON_PREFIX
 
-  AC_SUBST(PYTHON_PREFIX)
-  AC_SUBST(PYTHONHOME)
-
   changequote(<<, >>)dnl
-  PYTHON_VERSION=`$PYTHON -c "import sys; print(sys.version[:3])"`
+  PYTHON_ABIFLAGS=`$PYTHON -c "import sys; print(sys.abiflags)"`
   changequote([, ])dnl
-  AC_SUBST(PYTHON_VERSION)
+
+  AC_SUBST(PYTHON_PREFIX)
+  AC_SUBST(PYTHONHOME)
+  AC_SUBST(PYTHON_ABIFLAGS)
 
   PY_MAKEFILE=${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python$PYTHON_VERSION/config/Makefile
+  if test ! -f "$PY_MAKEFILE"; then
+    PY_MAKEFILE=${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python$PYTHON_VERSION/config-${PYTHON_VERSION}${PYTHON_ABIFLAGS}-${build_cpu}-${build_os}/Makefile
+  fi
   if test ! -f "$PY_MAKEFILE"; then
     # For Ubuntu >= 13.04
     PY_MAKEFILE=${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python$PYTHON_VERSION/config-${build_cpu}-${build_os}/Makefile