diff --git a/configure.in b/configure.in index 7573e6c..cabe939 100644 --- a/configure.in +++ b/configure.in @@ -2206,9 +2206,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" @@ -2338,6 +2335,12 @@ 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 + AS_CASE(["${LDSHARED}"], + [ld" "*], [RPATHFLAG=" -R%1\$-s"], + [RPATHFLAG=" ${linker_flag}-R%1\$-s"]) + fi fi if test "${LDSHAREDXX}" = ""; then AS_CASE(["${LDSHARED}"],