Skip to content

Commit bb99c4e

Browse files
committed
build: update boost macros to latest upstream
Fixes: bitcoin#16803 I opened an [upstream PR](autoconf-archive/autoconf-archive#197) to improve the Boost error reporting, so pull the latest macros.
1 parent fb4f5be commit bb99c4e

6 files changed

+94
-81
lines changed

build-aux/m4/ax_boost_base.m4

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# and this notice are preserved. This file is offered as-is, without any
3434
# warranty.
3535

36-
#serial 45
36+
#serial 47
3737

3838
# example boost program (need to pass version)
3939
m4_define([_AX_BOOST_BASE_PROGRAM],
@@ -113,6 +113,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
113113
dnl are found, e.g. when only header-only libraries are installed!
114114
AS_CASE([${host_cpu}],
115115
[x86_64],[libsubdirs="lib64 libx32 lib lib64"],
116+
[mips*64*],[libsubdirs="lib64 lib32 lib lib64"],
116117
[ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64],[libsubdirs="lib64 lib lib64"],
117118
[libsubdirs="lib"]
118119
)

build-aux/m4/ax_boost_chrono.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# and this notice are preserved. This file is offered as-is, without any
3030
# warranty.
3131

32-
#serial 4
32+
#serial 5
3333

3434
AC_DEFUN([AX_BOOST_CHRONO],
3535
[
@@ -105,7 +105,7 @@ AC_DEFUN([AX_BOOST_CHRONO],
105105
106106
fi
107107
if test "x$ax_lib" = "x"; then
108-
AC_MSG_ERROR(Could not find a version of the library!)
108+
AC_MSG_ERROR(Could not find a version of the Boost::Chrono library!)
109109
fi
110110
if test "x$link_chrono" = "xno"; then
111111
AC_MSG_ERROR(Could not link against $ax_lib !)

build-aux/m4/ax_boost_filesystem.m4

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# http://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html
2+
# https://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html
33
# ===========================================================================
44
#
55
# SYNOPSIS
@@ -31,7 +31,7 @@
3131
# and this notice are preserved. This file is offered as-is, without any
3232
# warranty.
3333

34-
#serial 26
34+
#serial 28
3535

3636
AC_DEFUN([AX_BOOST_FILESYSTEM],
3737
[
@@ -80,7 +80,6 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
8080
if test "x$ax_cv_boost_filesystem" = "xyes"; then
8181
AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
8282
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
83-
ax_lib=
8483
if test "x$ax_boost_user_filesystem_lib" = "x"; then
8584
for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
8685
ax_lib=${libextension}
@@ -105,7 +104,7 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
105104
106105
fi
107106
if test "x$ax_lib" = "x"; then
108-
AC_MSG_ERROR(Could not find a version of the boost_filesystem library!)
107+
AC_MSG_ERROR(Could not find a version of the Boost::Filesystem library!)
109108
fi
110109
if test "x$link_filesystem" != "xyes"; then
111110
AC_MSG_ERROR(Could not link against $ax_lib !)

build-aux/m4/ax_boost_system.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# and this notice are preserved. This file is offered as-is, without any
3232
# warranty.
3333

34-
#serial 19
34+
#serial 20
3535

3636
AC_DEFUN([AX_BOOST_SYSTEM],
3737
[
@@ -108,7 +108,7 @@ AC_DEFUN([AX_BOOST_SYSTEM],
108108
109109
fi
110110
if test "x$ax_lib" = "x"; then
111-
AC_MSG_ERROR(Could not find a version of the library!)
111+
AC_MSG_ERROR(Could not find a version of the Boost::System library!)
112112
fi
113113
if test "x$link_system" = "xno"; then
114114
AC_MSG_ERROR(Could not link against $ax_lib !)

build-aux/m4/ax_boost_thread.m4

+83-70
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# http://www.gnu.org/software/autoconf-archive/ax_boost_thread.html
2+
# https://www.gnu.org/software/autoconf-archive/ax_boost_thread.html
33
# ===========================================================================
44
#
55
# SYNOPSIS
@@ -30,121 +30,134 @@
3030
# and this notice are preserved. This file is offered as-is, without any
3131
# warranty.
3232

33-
#serial 27
33+
#serial 32
3434

3535
AC_DEFUN([AX_BOOST_THREAD],
3636
[
37-
AC_ARG_WITH([boost-thread],
38-
AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],
39-
[use the Thread library from boost - it is possible to specify a certain library for the linker
40-
e.g. --with-boost-thread=boost_thread-gcc-mt ]),
37+
AC_ARG_WITH([boost-thread],
38+
AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],
39+
[use the Thread library from boost -
40+
it is possible to specify a certain library for the linker
41+
e.g. --with-boost-thread=boost_thread-gcc-mt ]),
4142
[
42-
if test "$withval" = "no"; then
43-
want_boost="no"
44-
elif test "$withval" = "yes"; then
43+
if test "$withval" = "yes"; then
4544
want_boost="yes"
4645
ax_boost_user_thread_lib=""
4746
else
48-
want_boost="yes"
49-
ax_boost_user_thread_lib="$withval"
50-
fi
47+
want_boost="yes"
48+
ax_boost_user_thread_lib="$withval"
49+
fi
5150
],
5251
[want_boost="yes"]
53-
)
52+
)
5453
55-
if test "x$want_boost" = "xyes"; then
54+
if test "x$want_boost" = "xyes"; then
5655
AC_REQUIRE([AC_PROG_CC])
5756
AC_REQUIRE([AC_CANONICAL_BUILD])
58-
CPPFLAGS_SAVED="$CPPFLAGS"
59-
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
60-
export CPPFLAGS
57+
CPPFLAGS_SAVED="$CPPFLAGS"
58+
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
59+
export CPPFLAGS
6160
62-
LDFLAGS_SAVED="$LDFLAGS"
63-
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
64-
export LDFLAGS
61+
LDFLAGS_SAVED="$LDFLAGS"
62+
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
63+
export LDFLAGS
6564
6665
AC_CACHE_CHECK(whether the Boost::Thread library is available,
67-
ax_cv_boost_thread,
66+
ax_cv_boost_thread,
6867
[AC_LANG_PUSH([C++])
69-
CXXFLAGS_SAVE=$CXXFLAGS
68+
CXXFLAGS_SAVE=$CXXFLAGS
7069
71-
if test "x$host_os" = "xsolaris" ; then
72-
CXXFLAGS="-pthreads $CXXFLAGS"
73-
elif test "x$host_os" = "xmingw32" ; then
74-
CXXFLAGS="-mthreads $CXXFLAGS"
75-
else
76-
CXXFLAGS="-pthread $CXXFLAGS"
77-
fi
78-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]],
79-
[[boost::thread_group thrds;
80-
return 0;]])],
81-
ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
82-
CXXFLAGS=$CXXFLAGS_SAVE
70+
if test "x$host_os" = "xsolaris" ; then
71+
CXXFLAGS="-pthreads $CXXFLAGS"
72+
elif test "x$host_os" = "xmingw32" ; then
73+
CXXFLAGS="-mthreads $CXXFLAGS"
74+
else
75+
CXXFLAGS="-pthread $CXXFLAGS"
76+
fi
77+
AC_COMPILE_IFELSE([
78+
AC_LANG_PROGRAM(
79+
[[@%:@include <boost/thread/thread.hpp>]],
80+
[[boost::thread_group thrds;
81+
return 0;]])],
82+
ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
83+
CXXFLAGS=$CXXFLAGS_SAVE
8384
AC_LANG_POP([C++])
84-
])
85-
if test "x$ax_cv_boost_thread" = "xyes"; then
85+
])
86+
if test "x$ax_cv_boost_thread" = "xyes"; then
8687
if test "x$host_os" = "xsolaris" ; then
87-
BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
88-
elif test "x$host_os" = "xmingw32" ; then
89-
BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
90-
else
91-
BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
92-
fi
88+
BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
89+
elif test "x$host_os" = "xmingw32" ; then
90+
BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
91+
else
92+
BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
93+
fi
9394
94-
AC_SUBST(BOOST_CPPFLAGS)
95+
AC_SUBST(BOOST_CPPFLAGS)
9596
96-
AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available])
97+
AC_DEFINE(HAVE_BOOST_THREAD,,
98+
[define if the Boost::Thread library is available])
9799
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
98100
99-
LDFLAGS_SAVE=$LDFLAGS
101+
LDFLAGS_SAVE=$LDFLAGS
100102
case "x$host_os" in
101103
*bsd* )
102104
LDFLAGS="-pthread $LDFLAGS"
103105
break;
104106
;;
105107
esac
106108
if test "x$ax_boost_user_thread_lib" = "x"; then
107-
ax_lib=
108109
for libextension in `ls -r $BOOSTLIBDIR/libboost_thread* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'`; do
109110
ax_lib=${libextension}
110-
AC_CHECK_LIB($ax_lib, exit,
111-
[BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
111+
AC_CHECK_LIB($ax_lib, exit,
112+
[link_thread="yes"; break],
112113
[link_thread="no"])
113-
done
114+
done
114115
if test "x$link_thread" != "xyes"; then
115116
for libextension in `ls -r $BOOSTLIBDIR/boost_thread* 2>/dev/null | sed 's,.*/,,' | sed 's,\..*,,'`; do
116117
ax_lib=${libextension}
117-
AC_CHECK_LIB($ax_lib, exit,
118-
[BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
118+
AC_CHECK_LIB($ax_lib, exit,
119+
[link_thread="yes"; break],
119120
[link_thread="no"])
120-
done
121+
done
121122
fi
122123
123124
else
124125
for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do
125-
AC_CHECK_LIB($ax_lib, exit,
126-
[BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
126+
AC_CHECK_LIB($ax_lib, exit,
127+
[link_thread="yes"; break],
127128
[link_thread="no"])
128129
done
129130
130131
fi
131132
if test "x$ax_lib" = "x"; then
132-
AC_MSG_ERROR(Could not find a version of the boost_thread library!)
133+
AC_MSG_ERROR(Could not find a version of the Boost::Thread library!)
133134
fi
134-
if test "x$link_thread" = "xno"; then
135-
AC_MSG_ERROR(Could not link against $ax_lib !)
136-
else
137-
case "x$host_os" in
138-
*bsd* )
139-
BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS"
140-
break;
141-
;;
142-
esac
143-
144-
fi
145-
fi
135+
if test "x$link_thread" = "xno"; then
136+
AC_MSG_ERROR(Could not link against $ax_lib !)
137+
else
138+
BOOST_THREAD_LIB="-l$ax_lib"
139+
case "x$host_os" in
140+
*bsd* )
141+
BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS"
142+
break;
143+
;;
144+
xsolaris )
145+
BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread"
146+
break;
147+
;;
148+
xmingw32 )
149+
break;
150+
;;
151+
* )
152+
BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread"
153+
break;
154+
;;
155+
esac
156+
AC_SUBST(BOOST_THREAD_LIB)
157+
fi
158+
fi
146159
147-
CPPFLAGS="$CPPFLAGS_SAVED"
148-
LDFLAGS="$LDFLAGS_SAVED"
149-
fi
160+
CPPFLAGS="$CPPFLAGS_SAVED"
161+
LDFLAGS="$LDFLAGS_SAVED"
162+
fi
150163
])

build-aux/m4/ax_boost_unit_test_framework.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# and this notice are preserved. This file is offered as-is, without any
3030
# warranty.
3131

32-
#serial 21
32+
#serial 22
3333

3434
AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK],
3535
[
@@ -124,7 +124,7 @@ AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK],
124124
done
125125
fi
126126
if test "x$ax_lib" = "x"; then
127-
AC_MSG_ERROR(Could not find a version of the library!)
127+
AC_MSG_ERROR(Could not find a version of the Boost::Unit_Test_Framework library!)
128128
fi
129129
if test "x$link_unit_test_framework" != "xyes"; then
130130
AC_MSG_ERROR(Could not link against $ax_lib !)

0 commit comments

Comments
 (0)