Browse Source

[master] Building with Boost system lib is now the default

    Merges in branch 'trac5215'
Thomas Markwalder 7 years ago
parent
commit
b6f1ee0d12
3 changed files with 36 additions and 7 deletions
  1. 14 2
      configure.ac
  2. 11 2
      m4macros/ax_boost_for_kea.m4
  3. 11 3
      src/lib/asiolink/asio_wrapper.h

+ 14 - 2
configure.ac

@@ -1346,7 +1346,7 @@ if test $enable_gtest != "no"; then
     	[AC_MSG_ERROR([XXX_TRUE() Google Test macros won't compile; the most likely reason is that a later version of Google Test is required])])
     	[AC_MSG_ERROR([XXX_TRUE() Google Test macros won't compile; the most likely reason is that a later version of Google Test is required])])
     CPPFLAGS=$CPPFLAGS_SAVED
     CPPFLAGS=$CPPFLAGS_SAVED
 fi
 fi
-	    
+
 # Check for CreateUnifiedDiff from gtest >= 1.8.0
 # Check for CreateUnifiedDiff from gtest >= 1.8.0
 if test $enable_gtest != "no"; then
 if test $enable_gtest != "no"; then
    AC_MSG_CHECKING([for CreateUnifiedDiff in $GTEST_INCLUDES/gtest.h])
    AC_MSG_CHECKING([for CreateUnifiedDiff in $GTEST_INCLUDES/gtest.h])
@@ -1370,7 +1370,7 @@ if test $enable_gtest != "no"; then
 	 [Define to 1 if gtest defines edit_distance::CreateUnifiedDiff])],
 	 [Define to 1 if gtest defines edit_distance::CreateUnifiedDiff])],
 	[AC_MSG_RESULT(no)])
 	[AC_MSG_RESULT(no)])
     CPPFLAGS=$CPPFLAGS_SAVED
     CPPFLAGS=$CPPFLAGS_SAVED
-fi    
+fi
 
 
 #
 #
 # ASIO: we extensively use it as the C++ event management module.
 # ASIO: we extensively use it as the C++ event management module.
@@ -1811,6 +1811,18 @@ Boost:
   BOOST_INCLUDES:  ${BOOST_INCLUDES}
   BOOST_INCLUDES:  ${BOOST_INCLUDES}
   BOOST_LIBS:      ${BOOST_LIBS}
   BOOST_LIBS:      ${BOOST_LIBS}
 
 
+END
+if test x"$BOOST_LIBS" = "x"; then
+   cat >> config.report << END
+    WARNING: You will be building with boost headers only rather
+    than linking with boost_system library. This is NOT recommended as
+    it may result in non-optimized code on some platforms and
+    introduce runtime errors on others.
+
+END
+fi
+
+cat >> config.report << END
 ${CRYPTO_NAME}:
 ${CRYPTO_NAME}:
   CRYPTO_VERSION:  ${CRYPTO_VERSION}
   CRYPTO_VERSION:  ${CRYPTO_VERSION}
   CRYPTO_CFLAGS:   ${CRYPTO_CFLAGS}
   CRYPTO_CFLAGS:   ${CRYPTO_CFLAGS}

+ 11 - 2
m4macros/ax_boost_for_kea.m4

@@ -40,7 +40,7 @@ AC_LANG([C++])
 
 
 DISTCHECK_BOOST_CONFIGURE_FLAG=
 DISTCHECK_BOOST_CONFIGURE_FLAG=
 
 
-# No library by default (and as goal)
+# We'll attempt to Use Boost system library by default
 BOOST_LIBS=
 BOOST_LIBS=
 BOOST_LIB_DIR=
 BOOST_LIB_DIR=
 boost_lib_path=
 boost_lib_path=
@@ -155,7 +155,16 @@ AC_ARG_WITH([boost-lib-dir],
   AC_HELP_STRING([--with-boost-lib-dir=PATH],
   AC_HELP_STRING([--with-boost-lib-dir=PATH],
     [specify directory where to find Boost libraries]),
     [specify directory where to find Boost libraries]),
     [BOOST_LIB_DIR="$withval"
     [BOOST_LIB_DIR="$withval"
-     DISTCHECK_BOOST_CONFIGURE_FLAG="$DISTCHECK_BOOST_CONFIGURE_FLAG --with-boot-lib-dir=$withval"])
+     DISTCHECK_BOOST_CONFIGURE_FLAG="$DISTCHECK_BOOST_CONFIGURE_FLAG --with-boost-lib-dir=$withval"])
+
+AC_ARG_ENABLE([boost-headers-only],
+    [AS_HELP_STRING([--enable-boost-headers-only],
+        [Build with boost headers only rather than link
+         with boost_system library. This is NOT recommended
+         as it may result in non-optimized code on some
+         platforms or introduce runtime errors on others.])],
+    [enable_boost_header="yes"; BOOST_LIBS=""],
+    [BOOST_LIBS="${BOOST_LIBS} -lboost_system"])
 
 
 # BOOST_ERROR_CODE_HEADER_ONLY in versions below Boost 1.56.0 can fail
 # BOOST_ERROR_CODE_HEADER_ONLY in versions below Boost 1.56.0 can fail
 # to find the error_code.cpp file.
 # to find the error_code.cpp file.

+ 11 - 3
src/lib/asiolink/asio_wrapper.h

@@ -6,11 +6,19 @@
 #ifndef ASIO_WRAPPER_H
 #ifndef ASIO_WRAPPER_H
 #define ASIO_WRAPPER_H 1
 #define ASIO_WRAPPER_H 1
 
 
-// !!! IMPORTANT !!!!
+// !!! IMPORTANT THIS IS A HACK FOR BOOST HEADERS ONLY BUILDING !!!!
+//
+// As of #5215 (Kea 1.3) The default build configuration is to link with
+// Boost's system library (boost_system) rather than build with Boost's
+// headers only. Linking with the boost_system elminiates the issue as
+// detailed below. This file exists solely for the purpose of allowing
+// people to attempt to build headers only.  ISC DOES NOT RECOMMEND
+// building Kea with Boost headers only.
+//
 // This file must be included anywhere one would normally have included
 // This file must be included anywhere one would normally have included
 // boost/asio.hpp.  Until the issue described below is resolved in some
 // boost/asio.hpp.  Until the issue described below is resolved in some
-// other fashion  asio.hpp should not be included other than through
-// this file.
+// other fashion, (or we abandon support for headers only building)
+// asio.hpp MUST NOT be included other than through this file.
 //
 //
 // The optimizer as of gcc 5.2.0, may not reliably ensure a single value
 // The optimizer as of gcc 5.2.0, may not reliably ensure a single value
 // returned by boost::system::system_category() within a translation unit
 // returned by boost::system::system_category() within a translation unit