annotate lib/swig/swigwin-2.0.11/Tools/config/ax_boost_base.m4 @ 1933:5fcf6023f9c3

DamageMonsterFromParty some additional vars removed, changed the ordering part to something more readable
author Grumpy7
date Wed, 23 Oct 2013 21:13:28 -0700
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 # ===========================================================================
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 # http://www.gnu.org/software/autoconf-archive/ax_boost_base.html
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 # ===========================================================================
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 # SYNOPSIS
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 # AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 # DESCRIPTION
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 # Test for the Boost C++ libraries of a particular version (or newer)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 # If no path to the installed boost library is given the macro searchs
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 # under /usr, /usr/local, /opt and /opt/local and evaluates the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 # $BOOST_ROOT environment variable. Further documentation is available at
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 # <http://randspringer.de/boost/index.html>.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 # This macro calls:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 # AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 # And sets:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 # HAVE_BOOST
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 # LICENSE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 # Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 # Copyright (c) 2009 Peter Adolphs
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 # Copying and distribution of this file, with or without modification, are
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 # permitted in any medium without royalty provided the copyright notice
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 # and this notice are preserved. This file is offered as-is, without any
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 # warranty.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 #serial 20
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 AC_DEFUN([AX_BOOST_BASE],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 [
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 AC_ARG_WITH([boost],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 [AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 [use Boost library from a standard location (ARG=yes),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 from the specified location (ARG=<path>),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 or disable it (ARG=no)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 @<:@ARG=yes@:>@ ])],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 [
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 if test "$withval" = "no"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 want_boost="no"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 elif test "$withval" = "yes"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 want_boost="yes"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 ac_boost_path=""
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 want_boost="yes"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 ac_boost_path="$withval"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 ],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 [want_boost="yes"])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 AC_ARG_WITH([boost-libdir],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 [Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 [
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 if test -d "$withval"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65 then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 ac_boost_lib_path="$withval"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68 AC_MSG_ERROR(--with-boost-libdir expected directory name)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70 ],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71 [ac_boost_lib_path=""]
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 )
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74 if test "x$want_boost" = "xyes"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77 boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78 boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79 boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80 if test "x$boost_lib_version_req_sub_minor" = "x" ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 boost_lib_version_req_sub_minor="0"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
83 WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
84 AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
85 succeeded=no
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
86
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
87 dnl On 64-bit systems check for system libraries in both lib64 and lib.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
88 dnl The former is specified by FHS, but e.g. Debian does not adhere to
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
89 dnl this (as it rises problems for generic multi-arch support).
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
90 dnl The last entry in the list is chosen by default when no libraries
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
91 dnl are found, e.g. when only header-only libraries are installed!
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
92 libsubdirs="lib"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
93 ax_arch=`uname -m`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
94 if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
95 libsubdirs="lib64 lib lib64"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
96 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
97
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
98 dnl first we check the system location for boost libraries
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
99 dnl this location ist chosen if boost libraries are installed with the --layout=system option
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
100 dnl or if you install boost with RPM
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
101 if test "$ac_boost_path" != ""; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
102 BOOST_CPPFLAGS="-I$ac_boost_path/include"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
103 for ac_boost_path_tmp in $libsubdirs; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
104 if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
105 BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
106 break
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
107 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
108 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
109 elif test "$cross_compiling" != yes; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
110 for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
111 if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
112 for libsubdir in $libsubdirs ; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
113 if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
114 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
115 BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
116 BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
117 break;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
118 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
119 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
120 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
121
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
122 dnl overwrite ld flags if we have required special directory with
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
123 dnl --with-boost-libdir parameter
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
124 if test "$ac_boost_lib_path" != ""; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
125 BOOST_LDFLAGS="-L$ac_boost_lib_path"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
126 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
127
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
128 CPPFLAGS_SAVED="$CPPFLAGS"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
129 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
130 export CPPFLAGS
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
131
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
132 LDFLAGS_SAVED="$LDFLAGS"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
133 LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
134 export LDFLAGS
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
135
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
136 AC_REQUIRE([AC_PROG_CXX])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
137 AC_LANG_PUSH(C++)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
138 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
139 @%:@include <boost/version.hpp>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
140 ]], [[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
141 #if BOOST_VERSION >= $WANT_BOOST_VERSION
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
142 // Everything is okay
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
143 #else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
144 # error Boost version is too old
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
145 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
146 ]])],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
147 AC_MSG_RESULT(yes)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
148 succeeded=yes
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
149 found_system=yes
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
150 ],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
151 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
152 AC_LANG_POP([C++])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
153
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
154
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
155
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
156 dnl if we found no boost with system layout we search for boost libraries
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
157 dnl built and installed without the --layout=system option or for a staged(not installed) version
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
158 if test "x$succeeded" != "xyes"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
159 _version=0
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
160 if test "$ac_boost_path" != ""; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
161 if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
162 for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
163 _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
164 V_CHECK=`expr $_version_tmp \> $_version`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
165 if test "$V_CHECK" = "1" ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
166 _version=$_version_tmp
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
167 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
168 VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
169 BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
170 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
171 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
172 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
173 if test "$cross_compiling" != yes; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
174 for ac_boost_path in /usr /usr/local /opt /opt/local ; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
175 if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
176 for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
177 _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
178 V_CHECK=`expr $_version_tmp \> $_version`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
179 if test "$V_CHECK" = "1" ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
180 _version=$_version_tmp
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
181 best_path=$ac_boost_path
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
182 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
183 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
184 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
185 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
186
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
187 VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
188 BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
189 if test "$ac_boost_lib_path" = ""; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
190 for libsubdir in $libsubdirs ; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
191 if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
192 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
193 BOOST_LDFLAGS="-L$best_path/$libsubdir"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
194 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
195 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
196
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
197 if test "x$BOOST_ROOT" != "x"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
198 for libsubdir in $libsubdirs ; do
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
199 if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
200 done
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
201 if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
202 version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
203 stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
204 stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
205 V_CHECK=`expr $stage_version_shorten \>\= $_version`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
206 if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
207 AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
208 BOOST_CPPFLAGS="-I$BOOST_ROOT"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
209 BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
210 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
211 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
212 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
213 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
214
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
215 CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
216 export CPPFLAGS
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
217 LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
218 export LDFLAGS
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
219
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
220 AC_LANG_PUSH(C++)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
221 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
222 @%:@include <boost/version.hpp>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
223 ]], [[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
224 #if BOOST_VERSION >= $WANT_BOOST_VERSION
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
225 // Everything is okay
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
226 #else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
227 # error Boost version is too old
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
228 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
229 ]])],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
230 AC_MSG_RESULT(yes)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
231 succeeded=yes
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
232 found_system=yes
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
233 ],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
234 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
235 AC_LANG_POP([C++])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
236 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
237
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
238 if test "$succeeded" != "yes" ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
239 if test "$_version" = "0" ; then
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
240 AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
241 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
242 AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
243 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
244 # execute ACTION-IF-NOT-FOUND (if present):
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
245 ifelse([$3], , :, [$3])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
246 else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
247 AC_SUBST(BOOST_CPPFLAGS)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
248 AC_SUBST(BOOST_LDFLAGS)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
249 AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
250 # execute ACTION-IF-FOUND (if present):
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
251 ifelse([$2], , :, [$2])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
252 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
253
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
254 CPPFLAGS="$CPPFLAGS_SAVED"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
255 LDFLAGS="$LDFLAGS_SAVED"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
256 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
257
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
258 ])