annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
1 # ===========================================================================
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
2 # http://autoconf-archive.cryp.to/ax_boost_python.html
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
3 # ===========================================================================
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
4 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
5 # SYNOPSIS
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
6 #
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
7 # AX_BOOST_PYTHON([ACTION_IF_FOUND], [ACTION_IF_NOT_FOUND])
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
8 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
9 # DESCRIPTION
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
10 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
11 # This macro checks to see if the Boost.Python library is installed. It
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
12 # also attempts to guess the currect library name using several attempts.
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
13 # It tries to build the library name using a user supplied name or suffix
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
14 # and then just the raw library.
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
15 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
16 # If the library is found, HAVE_BOOST_PYTHON is defined and
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
17 # BOOST_PYTHON_LIB is set to the name of the library.
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
18 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
19 # This macro calls AC_SUBST(BOOST_PYTHON_LIB).
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
20 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
21 # LAST MODIFICATION
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
22 #
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
23 # 2009-04-04
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
24 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
25 # COPYLEFT
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
26 #
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
27 # Copyright (c) 2009 David Grundberg
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
28 # Copyright (c) 2008 Michael Tindal
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
29 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
30 # This program is free software; you can redistribute it and/or modify it
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
31 # under the terms of the GNU General Public License as published by the
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
32 # Free Software Foundation; either version 2 of the License, or (at your
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
33 # option) any later version.
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
34 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
35 # This program is distributed in the hope that it will be useful, but
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
36 # WITHOUT ANY WARRANTY; without even the implied warranty of
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
37 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
38 # Public License for more details.
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
39 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
40 # You should have received a copy of the GNU General Public License along
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
41 # with this program. If not, see <http://www.gnu.org/licenses/>.
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
42 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
43 # As a special exception, the respective Autoconf Macro's copyright owner
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
44 # gives unlimited permission to copy, distribute and modify the configure
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
45 # scripts that are the output of Autoconf when processing the Macro. You
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
46 # need not follow the terms of the GNU General Public License when using
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
47 # or distributing such scripts, even though portions of the text of the
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
48 # Macro appear in them. The GNU General Public License (GPL) does govern
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
49 # all other use of the material that constitutes the Autoconf Macro.
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
50 #
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
51 # This special exception to the GPL applies to versions of the Autoconf
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
52 # Macro released by the Autoconf Macro Archive. When you make and
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
53 # distribute a modified version of the Autoconf Macro, you may extend this
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
54 # special exception to the GPL to apply to your modified version as well.
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
55
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
56 AC_DEFUN([AX_BOOST_PYTHON], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
57 AC_CACHE_CHECK([[whether the Boost::Python library is available]],
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
58 ac_cv_boost_python,
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
59 [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
60 BOOST_PYTHON_LIB=
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
61 AC_LANG_SAVE
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
62 AC_LANG_CPLUSPLUS
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
63 CPPFLAGS_SAVE=$CPPFLAGS
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
64 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
65 #include <boost/python/module.hpp>
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
66 using namespace boost::python;
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
67 BOOST_PYTHON_MODULE(test) { throw "Boost::Python test."; }]],
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
68 [[return 0;]]),
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
69 ac_cv_boost_python=yes, ac_cv_boost_python=no)
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
70 AC_LANG_RESTORE
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
71 CPPFLAGS=$CPPFLAGS_SAVE
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
72 ])
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
73 if test "$ac_cv_boost_python" = "yes"; then
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
74 AC_DEFINE(HAVE_BOOST_PYTHON,,[define if the Boost::Python library is available])
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
75 ax_boost_python_lib=boost_python
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
76 AS_IF([test -n "$PYTHON_VERSION"], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
77 # Read ax_python_devel for info about the PYTHON_VERSION variable
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
78 ax_boost_python_lib=boost_python$PYTHON_VERSION
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
79 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
80 AC_ARG_WITH([boost-python],AS_HELP_STRING([--with-boost-python],[specify the boost python library or suffix to use]), [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
81 AS_IF([test "x$with_boost_python" != "xno"], [
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
82 ax_boost_python_lib=$with_boost_python
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
83 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
84 ])
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
85 for ax_lib in $ax_boost_python_lib boost_python; do
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
86 AC_CHECK_LIB($ax_lib, exit, [BOOST_PYTHON_LIB=$ax_lib break])
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
87 done
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
88 AC_SUBST(BOOST_PYTHON_LIB)
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
89 fi
29
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
90
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
91 if test -n "$BOOST_PYTHON_LIB" ; then
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
92 m4_ifvaln([$1],[$1],[:])dnl
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
93 m4_ifvaln([$2],[else $2])dnl
6d75691c5c07 Modified build configuration in the hope that it will be more stable.
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
94 fi
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
95 ])dnl