Skip to content

Commit 14afc71

Browse files
committed
build: remove Boost lib detection from ax_boost_base
We don't use / link against Boost libraries, so there is no reason for us to try and detect them / muddle with LDFLAGS.
1 parent 07c54de commit 14afc71

File tree

1 file changed

+7
-54
lines changed

1 file changed

+7
-54
lines changed

build-aux/m4/ax_boost_base.m4

Lines changed: 7 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
# DESCRIPTION
1010
#
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)
1212
#
1313
# If no path to the installed boost library is given the macro searchs
1414
# under /usr, /usr/local, /opt, /opt/local and /opt/homebrew and evaluates
@@ -17,12 +17,14 @@
1717
#
1818
# This macro calls:
1919
#
20-
# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
20+
# AC_SUBST(BOOST_CPPFLAGS)
2121
#
2222
# And sets:
2323
#
2424
# HAVE_BOOST
2525
#
26+
# Note that this macro has been modified compared to upstream.
27+
#
2628
# LICENSE
2729
#
2830
# Copyright (c) 2008 Thomas Porschberg <[email protected]>
@@ -59,26 +61,10 @@ AC_ARG_WITH([boost],
5961
],
6062
[want_boost="yes"])
6163
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=""
7764
BOOST_CPPFLAGS=""
7865
AS_IF([test "x$want_boost" = "xyes"],
7966
[_AX_BOOST_BASE_RUNDETECT([$1],[$2],[$3])])
8067
AC_SUBST(BOOST_CPPFLAGS)
81-
AC_SUBST(BOOST_LDFLAGS)
8268
])
8369

8470

@@ -139,7 +125,6 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
139125
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) lib path in "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"])
140126
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" ],[
141127
AC_MSG_RESULT([yes])
142-
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp";
143128
break;
144129
],
145130
[AC_MSG_RESULT([no])])
@@ -156,27 +141,17 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
156141
for libsubdir in $search_libsubdirs ; do
157142
if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
158143
done
159-
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path_tmp/$libsubdir"
160144
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path_tmp/include"
161145
break;
162146
fi
163147
done
164148
])
165149
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)])
172151
CPPFLAGS_SAVED="$CPPFLAGS"
173152
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
174153
export CPPFLAGS
175154
176-
LDFLAGS_SAVED="$LDFLAGS"
177-
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
178-
export LDFLAGS
179-
180155
AC_REQUIRE([AC_PROG_CXX])
181156
AC_LANG_PUSH(C++)
182157
AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
@@ -193,11 +168,8 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
193168
dnl built and installed without the --layout=system option or for a staged(not installed) version
194169
if test "x$succeeded" != "xyes" ; then
195170
CPPFLAGS="$CPPFLAGS_SAVED"
196-
LDFLAGS="$LDFLAGS_SAVED"
197171
BOOST_CPPFLAGS=
198-
if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
199-
BOOST_LDFLAGS=
200-
fi
172+
201173
_version=0
202174
if test -n "$_AX_BOOST_BASE_boost_path" ; then
203175
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],[
216188
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path"
217189
fi
218190
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
227191
fi
228192
else
229193
if test "x$cross_compiling" != "xyes" ; then
@@ -242,12 +206,6 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
242206
243207
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
244208
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
251209
fi
252210
253211
if test -n "$BOOST_ROOT" ; then
@@ -259,19 +217,16 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
259217
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
260218
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
261219
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
263221
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
264222
BOOST_CPPFLAGS="-I$BOOST_ROOT"
265-
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
266223
fi
267224
fi
268225
fi
269226
fi
270227
271228
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
272229
export CPPFLAGS
273-
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
274-
export LDFLAGS
275230
276231
AC_LANG_PUSH(C++)
277232
AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
@@ -298,6 +253,4 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
298253
fi
299254
300255
CPPFLAGS="$CPPFLAGS_SAVED"
301-
LDFLAGS="$LDFLAGS_SAVED"
302-
303256
])

0 commit comments

Comments
 (0)