From fd752417d6aa79b2f04577535e90a0ac6d4fdfbb Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 11 May 2014 02:15:39 +0000 Subject: [PATCH] Update Autoconf Boost macros. git-svn-id: https://valelab.ucsf.edu/svn/micromanager2/trunk@13370 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd --- m4/ax_boost_asio.m4 | 7 +++---- m4/ax_boost_base.m4 | 25 ++++++++++++++++++++----- m4/ax_boost_date_time.m4 | 6 +++--- m4/ax_boost_system.m4 | 6 +++--- m4/ax_boost_thread.m4 | 18 +++++++++--------- 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/m4/ax_boost_asio.m4 b/m4/ax_boost_asio.m4 index 9a9b9e737c..b57d4878e1 100644 --- a/m4/ax_boost_asio.m4 +++ b/m4/ax_boost_asio.m4 @@ -30,7 +30,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 13 +#serial 16 AC_DEFUN([AX_BOOST_ASIO], [ @@ -82,10 +82,9 @@ AC_DEFUN([AX_BOOST_ASIO], if test "x$ax_cv_boost_asio" = "xyes"; then AC_DEFINE(HAVE_BOOST_ASIO,,[define if the Boost::ASIO library is available]) BN=boost_system + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` if test "x$ax_boost_user_asio_lib" = "x"; then - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do + for ax_lib in `ls $BOOSTLIBDIR/libboost_system*.so* $BOOSTLIBDIR/libboost_system*.dylib* $BOOSTLIBDIR/libboost_system*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_system.*\)\.a.*$;\1;' ` ; do AC_CHECK_LIB($ax_lib, main, [BOOST_ASIO_LIB="-l$ax_lib" AC_SUBST(BOOST_ASIO_LIB) link_thread="yes" break], [link_thread="no"]) done diff --git a/m4/ax_boost_base.m4 b/m4/ax_boost_base.m4 index ec23a0abb7..8e6ee9a9bd 100644 --- a/m4/ax_boost_base.m4 +++ b/m4/ax_boost_base.m4 @@ -33,7 +33,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 18 +#serial 23 AC_DEFUN([AX_BOOST_BASE], [ @@ -59,7 +59,7 @@ AC_ARG_WITH([boost], AC_ARG_WITH([boost-libdir], AS_HELP_STRING([--with-boost-libdir=LIB_DIR], - [Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]), + [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.]), [ if test -d "$withval" then @@ -84,15 +84,30 @@ if test "x$want_boost" = "xyes"; then AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) succeeded=no - dnl On x86_64 systems check for system libraries in both lib64 and lib. + dnl On 64-bit systems check for system libraries in both lib64 and lib. dnl The former is specified by FHS, but e.g. Debian does not adhere to dnl this (as it rises problems for generic multi-arch support). dnl The last entry in the list is chosen by default when no libraries dnl are found, e.g. when only header-only libraries are installed! libsubdirs="lib" - if test `uname -m` = x86_64; then + ax_arch=`uname -m` + case $ax_arch in + x86_64|ppc64|s390x|sparc64|aarch64) libsubdirs="lib64 lib lib64" - fi + ;; + esac + + dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give + dnl them priority over the other paths since, if libs are found there, they + dnl are almost assuredly the ones desired. + AC_REQUIRE([AC_CANONICAL_HOST]) + libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs" + + case ${host_cpu} in + i?86) + libsubdirs="lib/i386-${host_os} $libsubdirs" + ;; + esac dnl first we check the system location for boost libraries dnl this location ist chosen if boost libraries are installed with the --layout=system option diff --git a/m4/ax_boost_date_time.m4 b/m4/ax_boost_date_time.m4 index 5d61ce8fa3..ec9c0445a2 100644 --- a/m4/ax_boost_date_time.m4 +++ b/m4/ax_boost_date_time.m4 @@ -30,7 +30,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 19 +#serial 21 AC_DEFUN([AX_BOOST_DATE_TIME], [ @@ -76,14 +76,14 @@ AC_DEFUN([AX_BOOST_DATE_TIME], AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available]) BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` if test "x$ax_boost_user_date_time_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_date_time*.so* $BOOSTLIBDIR/libboost_date_time*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_date_time.*\)\.so.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.a*$;\1;'` ; do + for libextension in `ls $BOOSTLIBDIR/libboost_date_time*.so* $BOOSTLIBDIR/libboost_date_time*.dylib* $BOOSTLIBDIR/libboost_date_time*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_date_time.*\)\.so.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.a*$;\1;'` ; do ax_lib=${libextension} AC_CHECK_LIB($ax_lib, exit, [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break], [link_date_time="no"]) done if test "x$link_date_time" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_date_time*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_date_time.*\)\.dll.*$;\1;' -e 's;^\(boost_date_time.*\)\.a*$;\1;'` ; do + for libextension in `ls $BOOSTLIBDIR/boost_date_time*.dll* $BOOSTLIBDIR/boost_date_time*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_date_time.*\)\.dll.*$;\1;' -e 's;^\(boost_date_time.*\)\.a.*$;\1;'` ; do ax_lib=${libextension} AC_CHECK_LIB($ax_lib, exit, [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break], diff --git a/m4/ax_boost_system.m4 b/m4/ax_boost_system.m4 index 7fbf6d360d..c4c45559d8 100644 --- a/m4/ax_boost_system.m4 +++ b/m4/ax_boost_system.m4 @@ -31,7 +31,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 14 +#serial 17 AC_DEFUN([AX_BOOST_SYSTEM], [ @@ -83,14 +83,14 @@ AC_DEFUN([AX_BOOST_SYSTEM], LDFLAGS_SAVE=$LDFLAGS if test "x$ax_boost_user_system_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_system*.so* $BOOSTLIBDIR/libboost_system*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.a*$;\1;'` ; do + for libextension in `ls -r $BOOSTLIBDIR/libboost_system* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do ax_lib=${libextension} AC_CHECK_LIB($ax_lib, exit, [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], [link_system="no"]) done if test "x$link_system" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_system*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_system.*\)\.dll.*$;\1;' -e 's;^\(boost_system.*\)\.a*$;\1;'` ; do + for libextension in `ls -r $BOOSTLIBDIR/boost_system* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do ax_lib=${libextension} AC_CHECK_LIB($ax_lib, exit, [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], diff --git a/m4/ax_boost_thread.m4 b/m4/ax_boost_thread.m4 index 2c073b5665..79e12cdb4e 100644 --- a/m4/ax_boost_thread.m4 +++ b/m4/ax_boost_thread.m4 @@ -30,7 +30,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 22 +#serial 27 AC_DEFUN([AX_BOOST_THREAD], [ @@ -68,9 +68,9 @@ AC_DEFUN([AX_BOOST_THREAD], [AC_LANG_PUSH([C++]) CXXFLAGS_SAVE=$CXXFLAGS - if test "x$build_os" = "xsolaris" ; then + if test "x$host_os" = "xsolaris" ; then CXXFLAGS="-pthreads $CXXFLAGS" - elif test "x$build_os" = "xming32" ; then + elif test "x$host_os" = "xmingw32" ; then CXXFLAGS="-mthreads $CXXFLAGS" else CXXFLAGS="-pthread $CXXFLAGS" @@ -83,9 +83,9 @@ AC_DEFUN([AX_BOOST_THREAD], AC_LANG_POP([C++]) ]) if test "x$ax_cv_boost_thread" = "xyes"; then - if test "x$build_os" = "xsolaris" ; then + if test "x$host_os" = "xsolaris" ; then BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS" - elif test "x$build_os" = "xming32" ; then + elif test "x$host_os" = "xmingw32" ; then BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS" else BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS" @@ -97,21 +97,21 @@ AC_DEFUN([AX_BOOST_THREAD], BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` LDFLAGS_SAVE=$LDFLAGS - case "x$build_os" in + case "x$host_os" in *bsd* ) LDFLAGS="-pthread $LDFLAGS" break; ;; esac if test "x$ax_boost_user_thread_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_thread*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.a*$;\1;'`; do + for libextension in `ls -r $BOOSTLIBDIR/libboost_thread* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'`; do ax_lib=${libextension} AC_CHECK_LIB($ax_lib, exit, [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], [link_thread="no"]) done if test "x$link_thread" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_thread*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.a*$;\1;'` ; do + for libextension in `ls -r $BOOSTLIBDIR/boost_thread* 2>/dev/null | sed 's,.*/,,' | sed 's,\..*,,'`; do ax_lib=${libextension} AC_CHECK_LIB($ax_lib, exit, [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], @@ -133,7 +133,7 @@ AC_DEFUN([AX_BOOST_THREAD], if test "x$link_thread" = "xno"; then AC_MSG_ERROR(Could not link against $ax_lib !) else - case "x$build_os" in + case "x$host_os" in *bsd* ) BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS" break;