8
8
#
9
9
# DESCRIPTION
10
10
#
11
- # Test for the Boost C++ libraries of a particular version (or newer)
11
+ # Test for the Boost C++ headers of a particular version (or newer)
12
12
#
13
13
# If no path to the installed boost library is given the macro searchs
14
14
# under /usr, /usr/local, /opt, /opt/local and /opt/homebrew and evaluates
17
17
#
18
18
# This macro calls:
19
19
#
20
- # AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
20
+ # AC_SUBST(BOOST_CPPFLAGS)
21
21
#
22
22
# And sets:
23
23
#
24
24
# HAVE_BOOST
25
25
#
26
+ # Note that this macro has been modified compared to upstream.
27
+ #
26
28
# LICENSE
27
29
#
28
30
# Copyright (c) 2008 Thomas Porschberg <[email protected] >
@@ -59,26 +61,10 @@ AC_ARG_WITH([boost],
59
61
] ,
60
62
[ want_boost="yes"] )
61
63
62
-
63
- AC_ARG_WITH ( [ boost-libdir] ,
64
- [ AS_HELP_STRING ( [ --with-boost-libdir=LIB_DIR] ,
65
- [ Force given directory for boost libraries.
66
- Note that this will override library path detection,
67
- so use this parameter only if default library detection fails
68
- and you know exactly where your boost libraries are located.] ) ] ,
69
- [
70
- AS_IF ( [ test -d "$withval"] ,
71
- [ _AX_BOOST_BASE_boost_lib_path="$withval"] ,
72
- [ AC_MSG_ERROR ( [ --with-boost-libdir expected directory name] ) ] )
73
- ] ,
74
- [ _AX_BOOST_BASE_boost_lib_path=""] )
75
-
76
- BOOST_LDFLAGS=""
77
64
BOOST_CPPFLAGS=""
78
65
AS_IF ( [ test "x$want_boost" = "xyes"] ,
79
66
[ _AX_BOOST_BASE_RUNDETECT([ $1 ] ,[ $2 ] ,[ $3 ] )] )
80
67
AC_SUBST ( BOOST_CPPFLAGS )
81
- AC_SUBST ( BOOST_LDFLAGS )
82
68
] )
83
69
84
70
@@ -139,7 +125,6 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
139
125
AC_MSG_CHECKING ( [ for boostlib >= $1 ($WANT_BOOST_VERSION) lib path in "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"] )
140
126
AS_IF ( [ test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ] ,[
141
127
AC_MSG_RESULT ( [ yes] )
142
- BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp";
143
128
break;
144
129
] ,
145
130
[ AC_MSG_RESULT ( [ no] ) ] )
@@ -156,27 +141,17 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
156
141
for libsubdir in $search_libsubdirs ; do
157
142
if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
158
143
done
159
- BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path_tmp/$libsubdir"
160
144
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path_tmp/include"
161
145
break;
162
146
fi
163
147
done
164
148
] )
165
149
166
- dnl overwrite ld flags if we have required special directory with
167
- dnl --with-boost-libdir parameter
168
- AS_IF ( [ test "x$_AX_BOOST_BASE_boost_lib_path" != "x"] ,
169
- [ BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"] )
170
-
171
- AC_MSG_CHECKING ( [ for boostlib >= $1 ($WANT_BOOST_VERSION)] )
150
+ AC_MSG_CHECKING ( [ for Boost headers >= $1 ($WANT_BOOST_VERSION)] )
172
151
CPPFLAGS_SAVED="$CPPFLAGS"
173
152
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
174
153
export CPPFLAGS
175
154
176
- LDFLAGS_SAVED="$LDFLAGS"
177
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
178
- export LDFLAGS
179
-
180
155
AC_REQUIRE ( [ AC_PROG_CXX ] )
181
156
AC_LANG_PUSH ( C++ )
182
157
AC_COMPILE_IFELSE ( [ _AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)] ,[
@@ -193,11 +168,8 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
193
168
dnl built and installed without the --layout=system option or for a staged(not installed) version
194
169
if test "x$succeeded" != "xyes" ; then
195
170
CPPFLAGS="$CPPFLAGS_SAVED"
196
- LDFLAGS="$LDFLAGS_SAVED"
197
171
BOOST_CPPFLAGS=
198
- if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
199
- BOOST_LDFLAGS=
200
- fi
172
+
201
173
_version=0
202
174
if test -n "$_AX_BOOST_BASE_boost_path" ; then
203
175
if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path"; then
@@ -216,14 +188,6 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
216
188
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path"
217
189
fi
218
190
fi
219
- dnl if we found something and BOOST_LDFLAGS was unset before
220
- dnl (because "$_AX_BOOST_BASE_boost_lib_path" = ""), set it here.
221
- if test -n "$BOOST_CPPFLAGS" && test -z "$BOOST_LDFLAGS"; then
222
- for libsubdir in $libsubdirs ; do
223
- if ls "$_AX_BOOST_BASE_boost_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
224
- done
225
- BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$libsubdir"
226
- fi
227
191
fi
228
192
else
229
193
if test "x$cross_compiling" != "xyes" ; then
@@ -242,12 +206,6 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
242
206
243
207
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
244
208
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
245
- if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
246
- for libsubdir in $libsubdirs ; do
247
- if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
248
- done
249
- BOOST_LDFLAGS="-L$best_path/$libsubdir"
250
- fi
251
209
fi
252
210
253
211
if test -n "$BOOST_ROOT" ; then
@@ -259,19 +217,16 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
259
217
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
260
218
stage_version_shorten=`expr $stage_version : '\([ [ 0-9] ] *\.[ [ 0-9] ] *\)'`
261
219
V_CHECK=`expr $stage_version_shorten \>\= $_version`
262
- if test "x$V_CHECK" = "x1" && test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
220
+ if test "x$V_CHECK" = "x1" ; then
263
221
AC_MSG_NOTICE ( We will use a staged boost library from $BOOST_ROOT )
264
222
BOOST_CPPFLAGS="-I$BOOST_ROOT"
265
- BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
266
223
fi
267
224
fi
268
225
fi
269
226
fi
270
227
271
228
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
272
229
export CPPFLAGS
273
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
274
- export LDFLAGS
275
230
276
231
AC_LANG_PUSH ( C++ )
277
232
AC_COMPILE_IFELSE ( [ _AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)] ,[
@@ -298,6 +253,4 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
298
253
fi
299
254
300
255
CPPFLAGS="$CPPFLAGS_SAVED"
301
- LDFLAGS="$LDFLAGS_SAVED"
302
-
303
256
] )
0 commit comments