comparison m4/ax_boost_python.m4 @ 29:6d75691c5c07 task

Modified build configuration in the hope that it will be more stable.
author David Grundberg <individ@acc.umu.se>
date Mon, 04 May 2009 19:38:17 +0200
parents 4da14cce0890
children 5cfff4925d14
comparison
equal deleted inserted replaced
28:c9c8ae243701 29:6d75691c5c07
2 # http://autoconf-archive.cryp.to/ax_boost_python.html 2 # http://autoconf-archive.cryp.to/ax_boost_python.html
3 # =========================================================================== 3 # ===========================================================================
4 # 4 #
5 # SYNOPSIS 5 # SYNOPSIS
6 # 6 #
7 # AX_BOOST_PYTHON 7 # AX_BOOST_PYTHON([ACTION_IF_FOUND], [ACTION_IF_NOT_FOUND])
8 # 8 #
9 # DESCRIPTION 9 # DESCRIPTION
10 # 10 #
11 # This macro checks to see if the Boost.Python library is installed. It 11 # This macro checks to see if the Boost.Python library is installed. It
12 # also attempts to guess the currect library name using several attempts. 12 # also attempts to guess the currect library name using several attempts.
16 # If the library is found, HAVE_BOOST_PYTHON is defined and 16 # If the library is found, HAVE_BOOST_PYTHON is defined and
17 # BOOST_PYTHON_LIB is set to the name of the library. 17 # BOOST_PYTHON_LIB is set to the name of the library.
18 # 18 #
19 # This macro calls AC_SUBST(BOOST_PYTHON_LIB). 19 # This macro calls AC_SUBST(BOOST_PYTHON_LIB).
20 # 20 #
21 # In order to ensure that the Python headers are specified on the include
22 # path, this macro requires AX_PYTHON to be called.
23 #
24 # LAST MODIFICATION 21 # LAST MODIFICATION
25 # 22 #
26 # 2008-04-12 23 # 2009-04-04
27 # 24 #
28 # COPYLEFT 25 # COPYLEFT
29 # 26 #
27 # Copyright (c) 2009 David Grundberg
30 # Copyright (c) 2008 Michael Tindal 28 # Copyright (c) 2008 Michael Tindal
31 # 29 #
32 # This program is free software; you can redistribute it and/or modify it 30 # This program is free software; you can redistribute it and/or modify it
33 # under the terms of the GNU General Public License as published by the 31 # under the terms of the GNU General Public License as published by the
34 # Free Software Foundation; either version 2 of the License, or (at your 32 # Free Software Foundation; either version 2 of the License, or (at your
53 # This special exception to the GPL applies to versions of the Autoconf 51 # This special exception to the GPL applies to versions of the Autoconf
54 # Macro released by the Autoconf Macro Archive. When you make and 52 # Macro released by the Autoconf Macro Archive. When you make and
55 # distribute a modified version of the Autoconf Macro, you may extend this 53 # distribute a modified version of the Autoconf Macro, you may extend this
56 # special exception to the GPL to apply to your modified version as well. 54 # special exception to the GPL to apply to your modified version as well.
57 55
58 AC_DEFUN([AX_BOOST_PYTHON], 56 AC_DEFUN([AX_BOOST_PYTHON], [
59 [AC_REQUIRE([AX_PYTHON])dnl 57 AC_CACHE_CHECK([[whether the Boost::Python library is available]],
60 AC_CACHE_CHECK(whether the Boost::Python library is available,
61 ac_cv_boost_python, 58 ac_cv_boost_python,
62 [AC_LANG_SAVE 59 [
60 BOOST_PYTHON_LIB=
61 AC_LANG_SAVE
63 AC_LANG_CPLUSPLUS 62 AC_LANG_CPLUSPLUS
64 CPPFLAGS_SAVE=$CPPFLAGS 63 CPPFLAGS_SAVE=$CPPFLAGS
65 if test x$PYTHON_INCLUDE_DIR != x; then
66 CPPFLAGS=-I$PYTHON_INCLUDE_DIR $CPPFLAGS
67 fi
68 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ 64 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
69 #include <boost/python/module.hpp> 65 #include <boost/python/module.hpp>
70 using namespace boost::python; 66 using namespace boost::python;
71 BOOST_PYTHON_MODULE(test) { throw "Boost::Python test."; }]], 67 BOOST_PYTHON_MODULE(test) { throw "Boost::Python test."; }]],
72 [[return 0;]]), 68 [[return 0;]]),
74 AC_LANG_RESTORE 70 AC_LANG_RESTORE
75 CPPFLAGS=$CPPFLAGS_SAVE 71 CPPFLAGS=$CPPFLAGS_SAVE
76 ]) 72 ])
77 if test "$ac_cv_boost_python" = "yes"; then 73 if test "$ac_cv_boost_python" = "yes"; then
78 AC_DEFINE(HAVE_BOOST_PYTHON,,[define if the Boost::Python library is available]) 74 AC_DEFINE(HAVE_BOOST_PYTHON,,[define if the Boost::Python library is available])
79 ax_python_lib=boost_python 75 ax_boost_python_lib=boost_python
80 AC_ARG_WITH([boost-python],AS_HELP_STRING([--with-boost-python],[specify the boost python library or suffix to use]), 76 AS_IF([test -n "$PYTHON_VERSION"], [
81 [if test "x$with_boost_python" != "xno"; then 77 # Read ax_python_devel for info about the PYTHON_VERSION variable
82 ax_python_lib=$with_boost_python 78 ax_boost_python_lib=boost_python$PYTHON_VERSION
83 ax_boost_python_lib=boost_python-$with_boost_python 79 ])
84 fi]) 80 AC_ARG_WITH([boost-python],AS_HELP_STRING([--with-boost-python],[specify the boost python library or suffix to use]), [
85 for ax_lib in $ax_python_lib $ax_boost_python_lib boost_python; do 81 AS_IF([test "x$with_boost_python" != "xno"], [
82 ax_boost_python_lib=$with_boost_python
83 ])
84 ])
85 for ax_lib in $ax_boost_python_lib boost_python; do
86 AC_CHECK_LIB($ax_lib, exit, [BOOST_PYTHON_LIB=$ax_lib break]) 86 AC_CHECK_LIB($ax_lib, exit, [BOOST_PYTHON_LIB=$ax_lib break])
87 done 87 done
88 AC_SUBST(BOOST_PYTHON_LIB) 88 AC_SUBST(BOOST_PYTHON_LIB)
89 fi 89 fi
90
91 if test -n "$BOOST_PYTHON_LIB" ; then
92 m4_ifvaln([$1],[$1],[:])dnl
93 m4_ifvaln([$2],[else $2])dnl
94 fi
90 ])dnl 95 ])dnl