Salome HOME
To see which hdf5 we're using in configure log
[modules/kernel.git] / salome_adm / unix / config_files / python.m4
index 240f6ec0d15e3790e83a3b30e1b184d606f324c0..16c068371b98e43c5339e3602b887663c683d770 100644 (file)
@@ -1,23 +1,23 @@
-dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-dnl 
-dnl  This library is free software; you can redistribute it and/or 
-dnl  modify it under the terms of the GNU Lesser General Public 
-dnl  License as published by the Free Software Foundation; either 
-dnl  version 2.1 of the License. 
-dnl 
-dnl  This library is distributed in the hope that it will be useful, 
-dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-dnl  Lesser General Public License for more details. 
-dnl 
-dnl  You should have received a copy of the GNU Lesser General Public 
-dnl  License along with this library; if not, write to the Free Software 
-dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-dnl 
-dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
+dnl  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 dnl
+dnl  This library is free software; you can redistribute it and/or
+dnl  modify it under the terms of the GNU Lesser General Public
+dnl  License as published by the Free Software Foundation; either
+dnl  version 2.1 of the License.
+dnl
+dnl  This library is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl  Lesser General Public License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public
+dnl  License along with this library; if not, write to the Free Software
+dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+dnl
+dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 dnl
 ## ------------------------
 ## Python file handling
@@ -36,6 +36,8 @@ dnl a `module'.
 
 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"
@@ -45,6 +47,9 @@ AC_DEFUN([CHECK_PYTHON],
     ])
   
   AC_CHECKING([local Python configuration])
+
+  AC_REQUIRE([AC_LINKER_OPTIONS])dnl
+
   PYTHON_PREFIX=`echo $PYTHON | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
   PYTHON_PREFIX=`echo $PYTHON_PREFIX | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
   PYTHONHOME=$PYTHON_PREFIX
@@ -57,19 +62,20 @@ AC_DEFUN([CHECK_PYTHON],
   changequote([, ])dnl
   AC_SUBST(PYTHON_VERSION)
 
-  PY_MAKEFILE=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config/Makefile
+  PY_MAKEFILE=${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python$PYTHON_VERSION/config/Makefile
   if test ! -f "$PY_MAKEFILE"; then
-     AC_MSG_ERROR([*** Couldn't find ${PY_MAKEFILE}.  Maybe you are
+     AC_MSG_WARN([*** Couldn't find ${PY_MAKEFILE}.  Maybe you are
 *** missing the development portion of the python installation])
+     python_ok=no
   fi
 
   AC_SUBST(PYTHON_INCLUDES)
   AC_SUBST(PYTHON_LIBS)
 
   PYTHON_INCLUDES=-I$PYTHON_PREFIX/include/python$PYTHON_VERSION
-  PYTHON_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
+  PYTHON_LIBS="-L${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
   PYTHON_LIB=$PYTHON_LIBS
-  PYTHON_LIBA=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config/libpython$PYTHON_VERSION.a
+  PYTHON_LIBA=${PYTHON_PREFIX}/lib${LIB_LOCATION_SUFFIX}/python$PYTHON_VERSION/config/libpython$PYTHON_VERSION.a
 
   dnl At times (like when building shared libraries) you may want
   dnl to know which OS Python thinks this is.
@@ -91,7 +97,7 @@ dnl python_site_given=no]
 
    [PYTHON_SITE="$withval"
     python_site_given=yes],
-   [PYTHON_SITE=$prefix"/lib/python"$PYTHON_VERSION/site-packages
+   [PYTHON_SITE=${prefix}"/lib${LIB_LOCATION_SUFFIX}/python"${PYTHON_VERSION}/site-packages
     python_site_given=no])
 
   AC_SUBST(PYTHON_SITE_PACKAGE)
@@ -109,7 +115,7 @@ dnl python_site_given=no]
     [if test "$python_site_given" = yes; then
        PYTHON_SITE_EXEC=$PYTHON_SITE
      else
-       PYTHON_SITE_EXEC=$PYTHON_EXEC_PREFIX"/lib/python"$PYTHON_VERSION/site-packages
+       PYTHON_SITE_EXEC=${PYTHON_EXEC_PREFIX}"/lib${LIB_LOCATION_SUFFIX}/python"${PYTHON_VERSION}/site-packages
      fi])
 
   dnl Set up the install directory
@@ -120,7 +126,7 @@ dnl python_site_given=no]
 
   dnl Also lets automake think PYTHON means something.
 
-  pythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/
+  pythondir=${PYTHON_PREFIX}"/lib${LIB_LOCATION_SUFFIX}/python"${PYTHON_VERSION}/
   AC_SUBST(pythondir)
 
  AC_MSG_CHECKING([if we need libdb])
@@ -159,5 +165,7 @@ dnl python_site_given=no]
      AC_MSG_RESULT(no)
   fi
 
-  python_ok=yes
-  AC_MSG_RESULT(looks good)])
+  if test "$python_ok" == "yes"; then
+      AC_MSG_RESULT(looks good)
+  fi
+])