summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-05 12:35:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-05 12:35:44 +0000
commitc5bab032f671eb2e56fb473c9cbbfa43bc6da1ca (patch)
treef4c6e34a2921f082cd2241d4536637d42889fa53 /configure.in
parent006e66b6680f60adfb434ee7397f0dbc77de7873 (diff)
configure.in: fix rpath flag
* configure.in (RPATHFLAG): use -rpath if -R is not available. * configure.in (LIBRUBY_RPATHFLAGS): use RPATHFLAG instead of hardcoded -R option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in28
1 files changed, 23 insertions, 5 deletions
diff --git a/configure.in b/configure.in
index f993a1bc3e..f9e9431640 100644
--- a/configure.in
+++ b/configure.in
@@ -2601,9 +2601,6 @@ if test "$with_dln_a_out" != yes; then
AS_HELP_STRING([--enable-rpath], [embed run path into extension libraries.
enabled by default on ELF platforms]),
[enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
- if test "$enable_rpath" = yes; then
- RPATHFLAG=" ${linker_flag}-R%1\$-s"
- fi
AS_CASE(["$target_os"],
[hpux*], [ DLDFLAGS="$DLDFLAGS -E"
@@ -2735,6 +2732,22 @@ if test "$with_dln_a_out" != yes; then
[nacl], [ LDSHARED='$(CC) -shared' ],
[ : ${LDSHARED='$(LD)'}])
AC_MSG_RESULT($rb_cv_dlopen)
+
+ if test "$enable_rpath" = yes; then
+ if test x"${RPATHFLAG}" = x; then
+ for rpathflag in -R "-rpath "; do
+ AS_CASE("$rpathflag",
+ [*" "], [AS_CASE(["${linker_flag}"],
+ [*,], [rpathflag=`echo "$rpathflag" | tr ' ' ,`])])
+ rpathflag="${linker_flag}${rpathflag}"
+ RUBY_TRY_LDFLAGS(["${rpathflag}."], [], [rpathflag=])
+ if test "x${rpathflag}" != x; then
+ RPATHFLAG=" ${rpathflag}%1\$-s"
+ break
+ fi
+ done
+ fi
+ fi
fi
if test "${LDSHAREDXX}" = ""; then
AS_CASE(["${LDSHARED}"],
@@ -3231,8 +3244,13 @@ AS_CASE("$enable_shared", [yes], [
])
if test "$enable_rpath" = yes; then
test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
- LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${linker_flag}-R ${linker_flag}${libprefix}"
- test "x$cross_compiling" = xyes || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS -L${libprefix}"
+ rpathflag="${RPATHFLAG}"
+ AS_CASE(["${cross_compiling}${load_relative}"], [*yes*], [], [rpathflag="$RPATHFLAG$LIBPATHFLAG"])
+ rpathflag=`IFS="$PATH_SEPARATOR"
+ echo x "$rpathflag" |
+ sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${libprefix}${IFS}g;s${IFS}%s${IFS}${libprefix}${IFS}g"
+ `
+ LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${rpathflag}"
LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
fi