Merge #16870: build: update boost macros to latest upstream for improved error reporting

bb99c4e684bbd3053ecf7a789049b11b29260189 build: update boost macros to latest upstream (fanquake)

Pull request description:

  Fixes: #16803

  I opened an [upstream PR](https://github.com/autoconf-archive/autoconf-archive/pull/197) to improve the Boost error reporting, so pull the latest macros.

ACKs for top commit:
  laanwj:
    Code review ACK bb99c4e684bbd3053ecf7a789049b11b29260189
  jonatack:
    Sanity check ACK bb99c4e684bbd3053ecf7a789049b11b29260189, light code read, built and ran tests on Debian 4.19.37-5+deb10u2 (2019-08-08) x86_64 GNU/Linux. Only tested the happy path.

Tree-SHA512: 34704ed623ac0085215fd874a23fde8f6e39a69fa20d78472b0c4d2306dc101c0571fa26c4c8821600746b94daaaf05faf6d15546899d588081c26357d29ec46
This commit is contained in:
fanquake 2019-09-21 09:29:16 +08:00 committed by pasta
parent 6b46bddf64
commit d3a9042e01
6 changed files with 94 additions and 81 deletions

View File

@ -33,7 +33,7 @@
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 45 #serial 47
# example boost program (need to pass version) # example boost program (need to pass version)
m4_define([_AX_BOOST_BASE_PROGRAM], m4_define([_AX_BOOST_BASE_PROGRAM],
@ -113,6 +113,7 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
dnl are found, e.g. when only header-only libraries are installed! dnl are found, e.g. when only header-only libraries are installed!
AS_CASE([${host_cpu}], AS_CASE([${host_cpu}],
[x86_64],[libsubdirs="lib64 libx32 lib lib64"], [x86_64],[libsubdirs="lib64 libx32 lib lib64"],
[mips*64*],[libsubdirs="lib64 lib32 lib lib64"],
[ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64],[libsubdirs="lib64 lib lib64"], [ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64],[libsubdirs="lib64 lib lib64"],
[libsubdirs="lib"] [libsubdirs="lib"]
) )

View File

@ -29,7 +29,7 @@
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 4 #serial 5
AC_DEFUN([AX_BOOST_CHRONO], AC_DEFUN([AX_BOOST_CHRONO],
[ [
@ -105,7 +105,7 @@ AC_DEFUN([AX_BOOST_CHRONO],
fi fi
if test "x$ax_lib" = "x"; then if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the library!) AC_MSG_ERROR(Could not find a version of the Boost::Chrono library!)
fi fi
if test "x$link_chrono" = "xno"; then if test "x$link_chrono" = "xno"; then
AC_MSG_ERROR(Could not link against $ax_lib !) AC_MSG_ERROR(Could not link against $ax_lib !)

View File

@ -1,5 +1,5 @@
# =========================================================================== # ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html # https://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html
# =========================================================================== # ===========================================================================
# #
# SYNOPSIS # SYNOPSIS
@ -31,7 +31,7 @@
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 26 #serial 28
AC_DEFUN([AX_BOOST_FILESYSTEM], AC_DEFUN([AX_BOOST_FILESYSTEM],
[ [
@ -80,7 +80,6 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
if test "x$ax_cv_boost_filesystem" = "xyes"; then if test "x$ax_cv_boost_filesystem" = "xyes"; then
AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available]) AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
ax_lib=
if test "x$ax_boost_user_filesystem_lib" = "x"; then if test "x$ax_boost_user_filesystem_lib" = "x"; then
for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
ax_lib=${libextension} ax_lib=${libextension}
@ -105,7 +104,7 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
fi fi
if test "x$ax_lib" = "x"; then if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the boost_filesystem library!) AC_MSG_ERROR(Could not find a version of the Boost::Filesystem library!)
fi fi
if test "x$link_filesystem" != "xyes"; then if test "x$link_filesystem" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !) AC_MSG_ERROR(Could not link against $ax_lib !)

View File

@ -31,7 +31,7 @@
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 19 #serial 20
AC_DEFUN([AX_BOOST_SYSTEM], AC_DEFUN([AX_BOOST_SYSTEM],
[ [
@ -108,7 +108,7 @@ AC_DEFUN([AX_BOOST_SYSTEM],
fi fi
if test "x$ax_lib" = "x"; then if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the library!) AC_MSG_ERROR(Could not find a version of the Boost::System library!)
fi fi
if test "x$link_system" = "xno"; then if test "x$link_system" = "xno"; then
AC_MSG_ERROR(Could not link against $ax_lib !) AC_MSG_ERROR(Could not link against $ax_lib !)

View File

@ -1,5 +1,5 @@
# =========================================================================== # ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_boost_thread.html # https://www.gnu.org/software/autoconf-archive/ax_boost_thread.html
# =========================================================================== # ===========================================================================
# #
# SYNOPSIS # SYNOPSIS
@ -30,18 +30,17 @@
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 27 #serial 32
AC_DEFUN([AX_BOOST_THREAD], AC_DEFUN([AX_BOOST_THREAD],
[ [
AC_ARG_WITH([boost-thread], AC_ARG_WITH([boost-thread],
AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@], AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],
[use the Thread library from boost - it is possible to specify a certain library for the linker [use the Thread library from boost -
it is possible to specify a certain library for the linker
e.g. --with-boost-thread=boost_thread-gcc-mt ]), e.g. --with-boost-thread=boost_thread-gcc-mt ]),
[ [
if test "$withval" = "no"; then if test "$withval" = "yes"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes" want_boost="yes"
ax_boost_user_thread_lib="" ax_boost_user_thread_lib=""
else else
@ -75,7 +74,9 @@ AC_DEFUN([AX_BOOST_THREAD],
else else
CXXFLAGS="-pthread $CXXFLAGS" CXXFLAGS="-pthread $CXXFLAGS"
fi fi
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]], AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(
[[@%:@include <boost/thread/thread.hpp>]],
[[boost::thread_group thrds; [[boost::thread_group thrds;
return 0;]])], return 0;]])],
ax_cv_boost_thread=yes, ax_cv_boost_thread=no) ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
@ -93,7 +94,8 @@ AC_DEFUN([AX_BOOST_THREAD],
AC_SUBST(BOOST_CPPFLAGS) AC_SUBST(BOOST_CPPFLAGS)
AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available]) AC_DEFINE(HAVE_BOOST_THREAD,,
[define if the Boost::Thread library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
LDFLAGS_SAVE=$LDFLAGS LDFLAGS_SAVE=$LDFLAGS
@ -104,18 +106,17 @@ AC_DEFUN([AX_BOOST_THREAD],
;; ;;
esac esac
if test "x$ax_boost_user_thread_lib" = "x"; then if test "x$ax_boost_user_thread_lib" = "x"; then
ax_lib=
for libextension in `ls -r $BOOSTLIBDIR/libboost_thread* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'`; do for libextension in `ls -r $BOOSTLIBDIR/libboost_thread* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'`; do
ax_lib=${libextension} ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit, AC_CHECK_LIB($ax_lib, exit,
[BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], [link_thread="yes"; break],
[link_thread="no"]) [link_thread="no"])
done done
if test "x$link_thread" != "xyes"; then if test "x$link_thread" != "xyes"; then
for libextension in `ls -r $BOOSTLIBDIR/boost_thread* 2>/dev/null | sed 's,.*/,,' | sed 's,\..*,,'`; do for libextension in `ls -r $BOOSTLIBDIR/boost_thread* 2>/dev/null | sed 's,.*/,,' | sed 's,\..*,,'`; do
ax_lib=${libextension} ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit, AC_CHECK_LIB($ax_lib, exit,
[BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], [link_thread="yes"; break],
[link_thread="no"]) [link_thread="no"])
done done
fi fi
@ -123,24 +124,36 @@ AC_DEFUN([AX_BOOST_THREAD],
else else
for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do
AC_CHECK_LIB($ax_lib, exit, AC_CHECK_LIB($ax_lib, exit,
[BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], [link_thread="yes"; break],
[link_thread="no"]) [link_thread="no"])
done done
fi fi
if test "x$ax_lib" = "x"; then if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the boost_thread library!) AC_MSG_ERROR(Could not find a version of the Boost::Thread library!)
fi fi
if test "x$link_thread" = "xno"; then if test "x$link_thread" = "xno"; then
AC_MSG_ERROR(Could not link against $ax_lib !) AC_MSG_ERROR(Could not link against $ax_lib !)
else else
BOOST_THREAD_LIB="-l$ax_lib"
case "x$host_os" in case "x$host_os" in
*bsd* ) *bsd* )
BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS" BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS"
break; break;
;; ;;
xsolaris )
BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread"
break;
;;
xmingw32 )
break;
;;
* )
BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread"
break;
;;
esac esac
AC_SUBST(BOOST_THREAD_LIB)
fi fi
fi fi

View File

@ -29,7 +29,7 @@
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 21 #serial 22
AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK], AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK],
[ [
@ -124,7 +124,7 @@ AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK],
done done
fi fi
if test "x$ax_lib" = "x"; then if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the library!) AC_MSG_ERROR(Could not find a version of the Boost::Unit_Test_Framework library!)
fi fi
if test "x$link_unit_test_framework" != "xyes"; then if test "x$link_unit_test_framework" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !) AC_MSG_ERROR(Could not link against $ax_lib !)