Module: check_mk
Branch: master
Commit: 0d581cac54cdfd12372e8763cf249f135d2a07ee
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0d581cac54cdfd…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu May 18 14:09:52 2017 +0200
Fixed boost_system detection.
Change-Id: If51a26e362fc3afd9e0c39930bdbeeea11301025
---
m4/ax_boost_asio.m4 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/m4/ax_boost_asio.m4 b/m4/ax_boost_asio.m4
index a72c1e1..e18c3d1 100644
--- a/m4/ax_boost_asio.m4
+++ b/m4/ax_boost_asio.m4
@@ -83,6 +83,10 @@ AC_DEFUN([AX_BOOST_ASIO],
AC_DEFINE(HAVE_BOOST_ASIO,,[define if the Boost::ASIO library is available])
BN=boost_system
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ # NOTE: The AC_LANG_PUSH/POP below is a local modification! Without it, AC_CHECK_LIB
+ # would use the C compiler for compilation and linking of C++ libraries, which is
wrong
+ # in general: C++ compilers usually add some magic linking flags etc. behind the
scenes.
+ AC_LANG_PUSH([C++])
if test "x$ax_boost_user_asio_lib" = "x"; then
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],
@@ -96,6 +100,7 @@ AC_DEFUN([AX_BOOST_ASIO],
done
fi
+ AC_LANG_POP([C++])
if test "x$ax_lib" = "x"; then
AC_MSG_ERROR(Could not find a version of the library!)
fi