]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5337] Altered boost lib test macro to handle static linking
authorThomas Markwalder <tmark@isc.org>
Mon, 24 Jul 2017 13:10:12 +0000 (09:10 -0400)
committerThomas Markwalder <tmark@isc.org>
Mon, 24 Jul 2017 13:10:12 +0000 (09:10 -0400)
m4macros/ax_boost_for_kea.m4
    Altered the test to add "-static" flag and wrap the compilation
    in a call to libtool as we do in our Makefiles. This should make the
    test yield the same results as when we make.  This is important for
    -static as libtool may use .so if a .a is not available.  On systems
    which glibc .a's are not installed, our Makes with libtool would
    succeed where a call to just g++ will fail.

m4macros/ax_boost_for_kea.m4

index e2a4bb9e41ae0ebaf838d7bee2c603ccbc812b93..5a8ad4c47b8890df2cfbdbc85c315a568d109369 100644 (file)
@@ -196,13 +196,26 @@ if test "x${BOOST_LIBS}" != "x"; then
    LIBS_SAVED="$LIBS"
    LIBS="$BOOST_LIBS $LIBS"
 
+   if test $enable_static_link = yes; then
+       LIBS="-static $LIBS"
+   fi
+
+   # Wrap the compilation in libtool as we do in our Makefiles
+   # when linking.  That way if we're static linking we should
+   # get the same result our Makefiles would.  We don't provide
+   # a path to our libtool as it may not exist yet.
+   CXX_SAVED="$CXX"
+   CXX="libtool --tag=CXX --mode=link $CXX"
+
    AC_LINK_IFELSE(
      [AC_LANG_PROGRAM([#include <boost/system/error_code.hpp>],
                       [boost::system::error_code ec;])],
      [AC_MSG_RESULT([checking for Boost system library... yes])],
      [AC_MSG_RESULT([checking for Boost system library... no])
-      AC_MSG_ERROR([Linking with ${BOOST_LIBS} is not enough: please make sure libboost_system is installed])])
+      AC_MSG_ERROR([Linking with ${BOOST_LIBS} is not enough: please make sure libboost_system is installed;
+                    Check config.log for details, you may be missing other libraries.])])
 
+    CXX="$CXX_SAVED"
     LIBS="$LIBS_SAVED"
 fi