From 57f9f0968804bdd70a09df360be1f89f23fccd24 Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Wed, 7 Jul 2010 18:42:45 +0000 Subject: [PATCH] comments, cleanups, simplification. git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac148b@2425 e5f2f494-b856-4b98-b285-d166d9295462 --- configure.ac | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index f8514b63cc..a26b05112d 100644 --- a/configure.ac +++ b/configure.ac @@ -18,6 +18,20 @@ AC_LANG([C++]) AM_CONDITIONAL(USE_GXX, test "X${GXX}" = "Xyes") AC_CHECK_DECL([__SUNPRO_CC], [SUNCXX="yes"], [SUNCXX="no"]) +# Linker options + +# check -R rather than gcc specific -rpath to be as portable as possible. +AC_MSG_CHECKING([whether -R flag is available in linker]) +LDFLAGS_SAVED="$LDFLAGS" +LDFLAGS="$LDFLAGS -R/usr/lib" +AC_TRY_LINK([],[], + [ AC_MSG_RESULT(yes) + rpath_available=yes + ],[ AC_MSG_RESULT(no) + rpath_available=no + ]) +LDFLAGS=$LDFLAGS_SAVED + # OS dependent compiler flags case "$host" in *-solaris*) @@ -84,23 +98,15 @@ else fi fi -rpath_available=no -if test "X$GXX" = "Xyes"; then - 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 -fi +# Some OSes including NetBSD don't install libpython.so in a well known path. +# To avoid requiring dynamic library path with our python wrapper loadable +# modules, we embed the path to the modules when possible. We do this even +# when the path is known in the common operational environment (e.g. when +#it's stored in a comon "hint" file) for simplicity. if test $rpath_available = yes; then python_rpath= for flag in ${PYTHON_LDFLAGS}; do - python_rpath="${python_rpath} -Wl,`echo $flag | sed -ne 's/^\(\-L\)/-R/p'`" + python_rpath="${python_rpath} `echo $flag | sed -ne 's/^\(\-L\)/-R/p'`" done PYTHON_LDFLAGS="${PYTHON_LDFLAGS} ${python_rpath}" fi @@ -113,7 +119,6 @@ CPPFLAGS="$CPPFLAGS ${PYTHON_INCLUDES}" AC_CHECK_HEADERS([Python.h],, AC_MSG_ERROR([Missing Python.h])) CPPFLAGS="$CPPFLAGS_SAVED" - # Check for python library. Needed for Python-wrapper libraries. LDFLAGS_SAVED="$LDFLAGS" LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"