diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-19 08:25:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-19 08:25:36 +0000 |
commit | 80f52f38c7751854a1ab7c3187d104f4c09d35e6 (patch) | |
tree | d801a40ff1b9c17b1ca90c4d132aba4efddd8e1e /configure.in | |
parent | 32ea57aa2b8ca590f0e2ee11847b5977c46c87a6 (diff) |
* configure.in (enable_rpath): use rpath flag to embed the library
path into extensions on ELF environment. [ruby-dev:25035]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/configure.in b/configure.in index 1f3723c739..81fd449677 100644 --- a/configure.in +++ b/configure.in @@ -787,14 +787,6 @@ linux* | gnu* | k*bsd*-gnu) else LDFLAGS="$LDFLAGS -rdynamic" fi;; -netbsd*|openbsd*) - if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] - then - netbsd_elf=yes - else - netbsd_elf=no - fi - ;; esac LIBEXT=a @@ -861,8 +853,11 @@ if test "$with_dln_a_out" != yes; then rb_cv_dlopen=yes ;; osf*) : ${LDSHARED="ld -shared -expect_unresolved \"*\""} rb_cv_dlopen=yes ;; - linux* | gnu* | k*bsd*-gnu) - : ${LDSHARED="$CC -shared"} + linux* | gnu* | k*bsd*-gnu | netbsd*) + : ${LDSHARED='${CC} -shared'} + if test "$rb_cv_binary_elf" = yes; then + LDFLAGS="$LDFLAGS -Wl,-export-dynamic" + fi rb_cv_dlopen=yes ;; interix*) : ${LDSHARED="$CC -shared"} XLDFLAGS="$XLDFLAGS -Wl,-E" @@ -876,13 +871,6 @@ if test "$with_dln_a_out" != yes; then test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable" fi rb_cv_dlopen=yes ;; - netbsd*) : ${LDSHARED='${CC} -shared'} - if test "$rb_cv_binary_elf" = yes; then - LDFLAGS="$LDFLAGS -Wl,-export-dynamic" - LIBPATHFLAG=" -L'%1\$-s'" - RPATHFLAG=" -Wl,-R'%1\$-s'" - fi - rb_cv_dlopen=yes ;; openbsd*) : ${LDSHARED="\$(CC) -shared ${CCDLFLAGS}"} if test "$rb_cv_binary_elf" = yes; then LDFLAGS="$LDFLAGS -Wl,-E" @@ -949,6 +937,14 @@ if test "$with_dln_a_out" != yes; then *) : ${LDSHARED='ld'} ;; esac AC_MSG_RESULT($rb_cv_dlopen) + + AC_ARG_ENABLE(rpath, + [ --disable-rpath embedd run path.], + [enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"]) + if test "$enable_rpath" = yes; then + LIBPATHFLAG=" -L'%1\$-s'" + RPATHFLAG=" -Wl,-R'%1\$-s'" + fi fi AC_SUBST(LINK_SO) AC_SUBST(LIBPATHFLAG) @@ -1157,7 +1153,7 @@ if test "$enable_shared" = 'yes'; then sunos4*) LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so' ;; - linux* | gnu* | k*bsd*-gnu) + linux* | gnu* | k*bsd*-gnu | atheos*) LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)' LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so' ;; @@ -1173,7 +1169,6 @@ if test "$enable_shared" = 'yes'; then SOLIBS='$(LIBS)' LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)' LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)' - LIBRUBYARG_SHARED='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)' if test "$rb_cv_binary_elf" = yes; then # ELF platforms LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so' else # a.out platforms @@ -1185,6 +1180,14 @@ if test "$enable_shared" = 'yes'; then LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}` ;; solaris*) + SOLIBS='$(LIBS)' + LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)' + LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY) lib$(RUBY_SO_NAME).so' + if test "$GCC" = yes; then + LIBRUBY_DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(@F)' + else + enable_rpath=no + fi XLDFLAGS="$XLDFLAGS "'-R${libdir}' ;; hpux*) @@ -1216,10 +1219,6 @@ if test "$enable_shared" = 'yes'; then LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)' LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib' ;; - atheos*) - LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)' - LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so' - ;; interix*) LIBRUBYARG_SHARED='-L${libdir} -L. -l$(RUBY_SO_NAME)' ;; @@ -1227,6 +1226,10 @@ if test "$enable_shared" = 'yes'; then ;; esac fi +if test "$enable_rpath" = yes; then + LIBRUBYARG_SHARED='-Wl,-R -Wl,$(libdir) -L$(libdir) -L. '"$LIBRUBYARG_SHARED" +fi + XLDFLAGS="$XLDFLAGS -L." AC_SUBST(ARCHFILE) |