BIND 10 master, updated. acd8358522b4ac20a75684b6ec616269bcc705f2 [2667] minor doc update: mentioning --disable-rpath and not mentioning -rpath
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jan 31 22:23:27 UTC 2013
The branch, master has been updated
via acd8358522b4ac20a75684b6ec616269bcc705f2 (commit)
via 23610f5bf4d613f503793bf7c8526c67f95df223 (commit)
via 1c50c5a6ee7e9675e3ab154f2c7f975ef519fca2 (commit)
from 937c982cf30ed26570ca8853c45f8afe1a32e3e7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit acd8358522b4ac20a75684b6ec616269bcc705f2
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Thu Jan 31 14:18:29 2013 -0800
[2667] minor doc update: mentioning --disable-rpath and not mentioning -rpath
(-rpath isn't actually checked in this macro)
commit 23610f5bf4d613f503793bf7c8526c67f95df223
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Thu Jan 31 14:04:05 2013 -0800
[2667] editorial fix: folded some long lines
commit 1c50c5a6ee7e9675e3ab154f2c7f975ef519fca2
Author: Adam Tkac <atkac at redhat.com>
Date: Thu Jan 10 18:04:04 2013 +0100
[2667] Add --disable-rpath configure switch.
Some dynamic linkers are wise enough (at least the Linux one) to correctly pick
needed shared libraries without hardcoded rpath. The --disable-rpath configure
switch allows distributors to avoid hardcoded rpath paths in libraries and
executables.
Signed-off-by: Adam Tkac <atkac at redhat.com>
-----------------------------------------------------------------------
Summary of changes:
examples/configure.ac | 5 ++--
examples/m4/ax_isc_rpath.m4 | 62 +++++++++++++++++++++++++------------------
2 files changed, 39 insertions(+), 28 deletions(-)
-----------------------------------------------------------------------
diff --git a/examples/configure.ac b/examples/configure.ac
index 37515d9..850e7ef 100644
--- a/examples/configure.ac
+++ b/examples/configure.ac
@@ -14,9 +14,10 @@ AC_LANG([C++])
# Checks for BIND 10 headers and libraries
AX_ISC_BIND10
-# We use -R, -rpath etc so the resulting program will be more likekly to
+# We use -R option etc so the resulting program will be more likekly to
# "just work" by default. Embedding a specific library path is a controversial
-# practice, though; if you don't like it you can remove the following setting.
+# practice, though; if you don't like it you can remove the following setting,
+# or use the --disable-rpath option.
if test "x$BIND10_RPATH" != "x"; then
LDFLAGS="$LDFLAGS $BIND10_RPATH"
fi
diff --git a/examples/m4/ax_isc_rpath.m4 b/examples/m4/ax_isc_rpath.m4
index 91d9b8a..ee1e472 100644
--- a/examples/m4/ax_isc_rpath.m4
+++ b/examples/m4/ax_isc_rpath.m4
@@ -3,44 +3,54 @@ dnl
dnl @summary figure out whether and which "rpath" linker option is available
dnl
dnl This macro checks if the linker supports an option to embed a path
-dnl to a runtime library (often installed in an uncommon place), such as
-dnl gcc's -rpath option. If found, it sets the ISC_RPATH_FLAG variable to
+dnl to a runtime library (often installed in an uncommon place), such as the
+dnl commonly used -R option. If found, it sets the ISC_RPATH_FLAG variable to
dnl the found option flag. The main configure.ac can use it as follows:
dnl if test "x$ISC_RPATH_FLAG" != "x"; then
dnl LDFLAGS="$LDFLAGS ${ISC_RPATH_FLAG}/usr/local/lib/some_library"
dnl fi
+dnl
+dnl If you pass --disable-rpath to configure, ISC_RPATH_FLAG is not set
AC_DEFUN([AX_ISC_RPATH], [
-# We'll tweak both CXXFLAGS and CCFLAGS so this function will work whichever
-# language is used in the main script. Note also that it's not LDFLAGS;
-# technically this is a linker flag, but we've noticed $LDFLAGS can be placed
-# where the compiler could interpret it as a compiler option, leading to
-# subtle failure mode. So, in the check below using the compiler flag is
-# safer (in the actual Makefiles the flag should be set in LDFLAGS).
-CXXFLAGS_SAVED="$CXXFLAGS"
-CXXFLAGS="$CXXFLAGS -Wl,-R/usr/lib"
-CCFLAGS_SAVED="$CCFLAGS"
-CCFLAGS="$CCFLAGS -Wl,-R/usr/lib"
+AC_ARG_ENABLE(rpath,
+ [AC_HELP_STRING([--disable-rpath], [don't hardcode library path into binaries])],
+ rpath=$enableval, rpath=yes)
+
+if test x$rpath != xno; then
+ # We'll tweak both CXXFLAGS and CCFLAGS so this function will work
+ # whichever language is used in the main script. Note also that it's not
+ #LDFLAGS; technically this is a linker flag, but we've noticed $LDFLAGS
+ # can be placed where the compiler could interpret it as a compiler
+ # option, leading to subtle failure mode. So, in the check below using
+ # the compiler flag is safer (in the actual Makefiles the flag should be
+ # set in LDFLAGS).
+ CXXFLAGS_SAVED="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -Wl,-R/usr/lib"
+ CCFLAGS_SAVED="$CCFLAGS"
+ CCFLAGS="$CCFLAGS -Wl,-R/usr/lib"
-# check -Wl,-R and -R rather than gcc specific -rpath to be as portable
-# as possible. -Wl,-R seems to be safer, so we try it first. In some cases
-# -R is not actually recognized but AC_TRY_LINK doesn't fail due to that.
-AC_MSG_CHECKING([whether -Wl,-R flag is available in linker])
-AC_TRY_LINK([],[],
- [ AC_MSG_RESULT(yes)
- ISC_RPATH_FLAG=-Wl,-R
- ],[ AC_MSG_RESULT(no)
- AC_MSG_CHECKING([whether -R flag is available in linker])
- CXXFLAGS="$CXXFLAGS_SAVED -R"
- CCFLAGS="$CCFLAGS_SAVED -R"
+ # check -Wl,-R and -R rather than gcc specific -rpath to be as portable
+ # as possible. -Wl,-R seems to be safer, so we try it first. In some
+ # cases -R is not actually recognized but AC_TRY_LINK doesn't fail due to
+ # that.
+ AC_MSG_CHECKING([whether -Wl,-R flag is available in linker])
+ AC_TRY_LINK([],[],
+ [ AC_MSG_RESULT(yes)
+ ISC_RPATH_FLAG=-Wl,-R
+ ],[ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING([whether -R flag is available in linker])
+ CXXFLAGS="$CXXFLAGS_SAVED -R"
+ CCFLAGS="$CCFLAGS_SAVED -R"
AC_TRY_LINK([], [],
[ AC_MSG_RESULT([yes; note that -R is more sensitive about the position in option arguments])
ISC_RPATH_FLAG=-R
],[ AC_MSG_RESULT(no) ])
- ])
+ ])
-CXXFLAGS=$CXXFLAGS_SAVED
-CCFLAGS=$CCFLAGS_SAVED
+ CXXFLAGS=$CXXFLAGS_SAVED
+ CCFLAGS=$CCFLAGS_SAVED
+fi
])dnl AX_ISC_RPATH
More information about the bind10-changes
mailing list