changeset 12:a0c819a31e02

Better checking for Python dependencies.
author David Grundberg <individ@acc.umu.se>
date Thu, 23 Oct 2008 20:16:38 +0200
parents 826701fb3194
children dc8f6015f3e1
files ChangeLog configure.ac
diffstat 2 files changed, 27 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 20 13:14:00 2008 +0200
+++ b/ChangeLog	Thu Oct 23 20:16:38 2008 +0200
@@ -1,3 +1,9 @@
+2008-10-xx  David Grundberg <individ@acc.umu.se>
+
+	* configure.ac: Better testing for Python dependencies.
+	* configure.ac: Renamed my_ to pytave_
+	* configure.ac: Fixed whitespace.
+
 2008-10-20  David Grundberg  <individ@acc.umu.se>
 
 	* Makefile.am: added test/exceptions.py to extra dist.
--- a/configure.ac	Mon Oct 20 13:14:00 2008 +0200
+++ b/configure.ac	Thu Oct 23 20:16:38 2008 +0200
@@ -22,10 +22,9 @@
 AC_ARG_WITH([octave],
             [AS_HELP_STRING([--with-octave],
                             [Optionally set Octave package to use.
-							@<:@default=check@:>@])],
+                            @<:@default=check@:>@])],
             [with_octave=$withval],
             [with_octave=check])
-          
 AS_IF([test "x$with_octave" == xno],
 [
    AC_MSG_FAILURE([--without-octave was given but Octave required])
@@ -48,8 +47,7 @@
 [
    AC_MSG_WARN([Could not find octave-config.])
 ],
-[ 
-
+[
    PYTAVE_OCTAVE_RPATH=`$octaveconfig -p OCTLIBDIR`
    PYTAVE_OCTAVE_INCLUDE_PATH=`$octaveconfig -p OCTINCLUDEDIR`
    AC_MSG_RESULT([  results of the Octave check:])
@@ -67,15 +65,17 @@
    old_libs="$LIBS"
    LIBS="-loctave -lcruft -loctinterp $LIBS"
 
-   AC_CACHE_CHECK([whether linking to Octave library works], [my_cv_lib_octave],
+   AC_CACHE_CHECK([whether linking to Octave library works], [pytave_cv_lib_octave],
    [
-      my_cv_lib_octave=no
-	  AC_LANG_ASSERT(C++)
-	  AC_LINK_IFELSE(AC_LANG_PROGRAM([[#include <octave/oct.h>
-									   #include <octave/Matrix.h> ]],
-									 [[MatrixType()]]),
-						   [my_cv_lib_octave=yes],
-						   [my_cv_lib_octave=no])
+      pytave_cv_lib_octave=no
+      AC_LANG_ASSERT(C++)
+      AC_LINK_IFELSE(
+         AC_LANG_PROGRAM(
+            [[#include <octave/oct.h>
+              #include <octave/Matrix.h> ]],
+            [[MatrixType()]]),
+         [pytave_cv_lib_octave=yes],
+         [pytave_cv_lib_octave=no])
    ])
 
 
@@ -88,21 +88,25 @@
 
 # Look for boost::python
 AX_PYTHON()
+old_libs="$LIBS"
+AS_IF([test "x$PYTHON_LIB" != "x"],[
+LIBS="-l$PYTHON_LIB $LIBS"
+],[])
 AX_BOOST_PYTHON()
+LIBS="$old_libs"
 
 # Now check the two vital libs, if they have problems, halt.
 pytave_fatal_errors=no
 
-AS_IF(test "x$my_cv_lib_octave" != "xyes",
+AS_IF(test "x$pytave_cv_lib_octave" != "xyes",
 [
    AC_MSG_WARN([Linking to Octave failed.])
    pytave_fatal_errors=yes
 ], [])
 
-# XXX: hohoho, this is ugly.
-AS_IF(test "x$ac_cv_boost_python" != "xyes",
+AS_IF(test "x$BOOST_PYTHON_LIB" == "x",
 [
-   AC_MSG_WARN([Boost::Python test failed.])
+   AC_MSG_WARN([Cannot find Boost::Python lib.])
    pytave_fatal_errors=yes
 ], [])
 
@@ -125,7 +129,6 @@
 AC_PROG_MAKE_SET
 
 # Checks for libraries.
-		  
 
 # Checks for header files.
 
@@ -141,7 +144,7 @@
    PYTAVE_MODULE_INSTALL_PATH=/../invalidpath,
 ],
 [
-   PYTAVE_MODULE_INSTALL_PATH=${prefix}  
+   PYTAVE_MODULE_INSTALL_PATH=${prefix}
 ])
 
 # Substitutes for the Makefile/Jamfile