diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-09 11:44:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-09 11:44:01 +0000 |
commit | 9e4da4486b4b454b01cac1d0aa06f490d760b140 (patch) | |
tree | b0a04d7c8b3e43e62f6b562f48d6466b988dc3d3 /configure.in | |
parent | f9ca64368317a8cdfc59e6faf942030d245fb415 (diff) |
configure.in: rpath with OPTDIR
* configure.in: add rpath flags which is needed for OPTDIR as well
as -L options, when it is given. [ruby-dev:50065] [Bug #13411]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/configure.in b/configure.in index 239ddce22c..95be5c54c6 100644 --- a/configure.in +++ b/configure.in @@ -809,6 +809,23 @@ AC_DEFUN([RUBY_TRY_LDFLAGS], [ ]) : ${DLDFLAGS="$LDFLAGS"} +: ${RPATHFLAG=''} +rpathflag='' +AS_IF([test x"${RPATHFLAG}" = x], [ + AS_CASE(["$target_os"], + [hpux*], [AS_IF([test "$rb_cv_prog_gnu_ld" = no], [rpathflag='+b '])], + [aix*], [rpathflag='-blibpath:'], + [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=]) + AS_IF([test "x${rpathflag}" != x], []) + done]) +], [ + rpathflag=`echo "$RPATHFLAG" | sed 's/%.*//'` +]) AS_CASE([$RUBY_PATCHLEVEL], [-*], [particular_werror_flags=yes], [particular_werror_flags=no]) @@ -1035,7 +1052,7 @@ AC_ARG_WITH(opt-dir, [ val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -I\1/include|g;s/^ //"` CPPFLAGS="$CPPFLAGS $val" - val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -L\1/lib|g;s/^ //"` + val=`echo "$PATH_SEPARATOR$withval" | sed "s|$PATH_SEPARATOR\([[^$PATH_SEPARATOR]*]\)| -L\1/lib${rpathflag:+ $rpathflag\\\\1/lib}|g;s/^ //"` LDFLAGS="$LDFLAGS $val" LDFLAGS_OPTDIR="$val" OPT_DIR="$withval" @@ -3322,7 +3339,6 @@ AC_SUBST(LIBEXT)dnl AC_SUBST(ASMEXT, S)dnl STATIC= -: ${PATHFLAG=''} if test "$with_dln_a_out" != yes; then rb_cv_dlopen=unknown @@ -3361,9 +3377,6 @@ if test "$with_dln_a_out" != yes; then : ${LDSHARED='$(LD) -b'} XLDFLAGS="$XLDFLAGS -Wl,-E" : ${LIBPATHENV=SHLIB_PATH} - if test "$rb_cv_prog_gnu_ld" = no; then - RPATHFLAG=' +b %1$-s' - fi rb_cv_dlopen=yes], [solaris*], [ if test "$GCC" = yes; then : ${LDSHARED='$(CC) -shared'} @@ -3434,7 +3447,6 @@ if test "$with_dln_a_out" != yes; then TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)' TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)' : ${LIBPATHENV=LIBPATH} - RPATHFLAG=" ${linker_flag}-blibpath:%1\$-s:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}" rb_cv_dlopen=yes], [nto-qnx*], [ DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib" : ${LDSHARED='$(LD) -Bshareable -x'} @@ -3470,21 +3482,11 @@ if test "$with_dln_a_out" != yes; then ]) fi - 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 + AS_IF([test "$enable_rpath:${RPATHFLAG}" = yes:], [ + AS_IF([test "x$rpathflag" != x], [ RPATHFLAG=" ${rpathflag}%1\$-s" - break - fi - done - fi - fi + ]) + ]) fi if test "${LDSHAREDXX}" = ""; then AS_CASE(["${LDSHARED}"], |