[svn] commit: r1789 - /branches/trac148/configure.ac
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Apr 21 18:21:12 UTC 2010
Author: jinmei
Date: Wed Apr 21 18:21:11 2010
New Revision: 1789
Log:
try harder to identify the availability of boost libs and necessary build options to minimize/eliminate additional run time setting (in particular (DY)LD_LIBRARY_PATH).
to address trac ticket #148.
Modified:
branches/trac148/configure.ac
Modified: branches/trac148/configure.ac
==============================================================================
--- branches/trac148/configure.ac (original)
+++ branches/trac148/configure.ac Wed Apr 21 18:21:11 2010
@@ -65,6 +65,11 @@
fi
AC_SUBST(PYTHON_LDFLAGS)
+# We're going to explore various options to build our libraries and executtables
+# with boost libraries without requiring the user to do counter-intuitive
+# run time setting. These options include the non-portable -R (rpath) linker
+# flag to embed the path to the boost libraries in our binaries. We first
+# identify the availability of this flag for subsequent checks.
AC_MSG_CHECKING([whether -R flag is available in linker])
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-R/usr/lib"
@@ -75,6 +80,9 @@
rpath_available=no
])
LDFLAGS=$LDFLAGS_SAVED
+# Check for Boost.python may require libpython to be linked. Again, it may
+# be installed in a non standard path, which may make the test fail. So we
+# set up the temporary rpath for libpython when it's available.
if test $rpath_available = yes; then
for flag in ${PYTHON_LDFLAGS}; do
python_rpath="${python_rpath} -Wl,`echo $flag | sed -ne 's/^\(\-L\)/-R/p'`"
@@ -220,6 +228,13 @@
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -Iext"
+ # Identifying the availability and location of boost libraries is
+ # tricky due to the fact that they are often installed in a non
+ # standard path and may require linking a shared object version of
+ # the library. Also, on some systems only multi-thread version
+ # (with the common suffix of -mt) of the library may be available.
+ # We're going try all possible combinations we can think of, and use
+ # the first one that works.
for BOOST_TRY_LIB in boost_system boost_system-mt; do
result_msg=
for mode in normal with_rflag with_static; do
@@ -246,6 +261,10 @@
;;
esac
LIBS="$LIBS_SAVED ${BOOST_SYSTEM_LIB}"
+ # We need to do TRY_RUN, rather than compile or link,
+ # because if it's a shared library it may cause a run
+ # time problem, e.g., due to the lack of path to the
+ # library.
AC_TRY_RUN([
#include <boost/system/error_code.hpp>
int main() {
@@ -305,21 +324,20 @@
for BOOST_TRY_LIB in boost_python boost_python-mt; do
result_msg=
for mode in normal with_rflag with_static; do
+ LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS}"
case "${mode}" in
normal)
- LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS}"
BOOST_PYTHON_LIB="-l${BOOST_TRY_LIB}"
;;
with_rflag)
if test $rpath_available = no; then
continue
fi
- LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS} -Wl,${boost_rpath_flag}"
+ LDFLAGS="$LDFLAGS -Wl,${boost_rpath_flag}"
BOOST_PYTHON_LIB="-l${BOOST_TRY_LIB}"
result_msg=" (using rpath)"
;;
with_static)
- LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS}"
if test -z "${boost_library_path}"; then
continue
fi
@@ -357,7 +375,7 @@
if test "X${BOOST_PYTHON_LIB}" = X; then
AC_MSG_RESULT(no)
if test "X$boost_library_path" != X; then
- AC_MSG_WARN([Could not find boost python library in $boost_library_path. If it is a shared library in a non standard path, retry with specifying the run time load path (such as LD_LIBRARY_PATH).])
+ AC_MSG_WARN([Could not find boost python library in $boost_library_path. If it is a shared library in a non standard path, retry with specifying the run time load path (such as LD_LIBRARY_PATH). Note also that this test requires libpython. If it is installed in a non standard path the test may fail even if the build option for Boost.python is correct. In that case make sure the shared library configuration is correct for libpython. You only need to configure it for this script; at run time the built binaries will be run on the python interpreter, which should know the location of libpython.])
fi
if test "$with_boost_python" = "yes"; then
AC_MSG_ERROR([boost python library is requested but not found])
More information about the bind10-changes
mailing list