[svn] commit: r1787 - /branches/trac148/configure.ac

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Apr 21 17:46:19 UTC 2010


Author: jinmei
Date: Wed Apr 21 17:46:18 2010
New Revision: 1787

Log:
checkpoint

Modified:
    branches/trac148/configure.ac

Modified: branches/trac148/configure.ac
==============================================================================
--- branches/trac148/configure.ac (original)
+++ branches/trac148/configure.ac Wed Apr 21 17:46:18 2010
@@ -62,9 +62,25 @@
 # we try the "lib" sub directory under the common prefix for this python.
 if test -z "${PYTHON_LDFLAGS}"; then
 	PYTHON_LDFLAGS="-L`${PYTHON}-config --prefix`/lib"
-	python_rpath="-R`${PYTHON}-config --prefix`/lib"
 fi
 AC_SUBST(PYTHON_LDFLAGS)
+
+AC_MSG_CHECKING([whether -R flag is available in linker])
+LDFLAGS_SAVED="$LDFLAGS"
+LDFLAGS="$LDFLAGS -Wl,-R/usr/lib"
+AC_TRY_LINK([],[],
+	[ AC_MSG_RESULT(yes)
+	  rpath_available=yes
+	],[ AC_MSG_RESULT(no)
+	  rpath_available=no
+	])
+LDFLAGS=$LDFLAGS_SAVED
+if test $rpath_available = yes; then
+	for flag in ${PYTHON_LDFLAGS}; do
+		rflag=`echo $flag | sed -ne 's/^\(\-L\)/-R/p'`
+		python_rpath="${python_rpath} -Wl,$rflag"
+	done
+fi
 
 # Check for python library (not absolutely mandatory, but needed for
 # Boost.Python when we use it.  See below.)
@@ -133,7 +149,6 @@
 [  --with-gtest=PATH       specify a path to gtest header files (PATH/include) and library (PATH/lib)],
     gtest_path="$withval", gtest_path="no")
 
-
 USE_LCOV="no"
 if test "$lcov" != "no"; then
 	# force gtest if not set
@@ -207,6 +222,7 @@
 	CPPFLAGS="$CPPFLAGS -Iext"
 
 	for BOOST_TRY_LIB in boost_system boost_system-mt; do
+		result_msg=
 		for mode in normal with_rflag with_static; do
 			case "${mode}" in
 			normal)
@@ -214,6 +230,9 @@
 				BOOST_SYSTEM_LIB="-l${BOOST_TRY_LIB}"
 				;;
 			with_rflag)
+				if test $rpath_available = no; then
+					continue
+				fi
 				LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS} -Wl,${boost_rpath_flag}"
 				BOOST_SYSTEM_LIB="-l${BOOST_TRY_LIB}"
 				result_msg=" (using rpath)"
@@ -285,6 +304,7 @@
 	CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
 
 	for BOOST_TRY_LIB in boost_python boost_python-mt; do
+		result_msg=
 		for mode in normal with_rflag with_static; do
 			case "${mode}" in
 			normal)
@@ -292,12 +312,15 @@
 				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}"
 				BOOST_PYTHON_LIB="-l${BOOST_TRY_LIB}"
 				result_msg=" (using rpath)"
 				;;
 			with_static)
-				LDFLAGS="-static $LDFLAGS_SAVED ${BOOST_LDFLAGS}"
+				LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS}"
 				if test -z "${boost_library_path}"; then
 					continue
 				fi
@@ -306,7 +329,7 @@
 				;;
 			esac
 			LIBS="$LIBS_SAVED ${BOOST_PYTHON_LIB} ${PYTHON_LIB}"
-			LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS -Wl,${python_rpath}"
+			LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS ${python_rpath}"
 			AC_TRY_RUN([
 #include <boost/python/module.hpp>
 using namespace boost::python;




More information about the bind10-changes mailing list