[前][次][番号順一覧][スレッド一覧]

ruby-changes:32427

From: nobu <ko1@a...>
Date: Sun, 5 Jan 2014 21:35:48 +0900 (JST)
Subject: [ruby-changes:32427] nobu:r44506 (trunk): configure.in: fix rpath flag

nobu	2014-01-05 21:35:44 +0900 (Sun, 05 Jan 2014)

  New Revision: 44506

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44506

  Log:
    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.

  Modified files:
    trunk/configure.in
Index: configure.in
===================================================================
--- configure.in	(revision 44505)
+++ configure.in	(revision 44506)
@@ -2601,9 +2601,6 @@ if test "$with_dln_a_out" != yes; then https://github.com/ruby/ruby/blob/trunk/configure.in#L2601
        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 https://github.com/ruby/ruby/blob/trunk/configure.in#L2732
         [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], [ https://github.com/ruby/ruby/blob/trunk/configure.in#L3244
 ])
 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]