* configure.in (PRELOADENV): platform specific environment to
  pre-load the given shared libraries.

* tool/runruby.rb: use config['PRELOADENV'] instead of hardcoded
  LD_PRELOAD.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-02-26 08:01:54 +00:00
Родитель fefdad109a
Коммит 68c062b1f0
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -2972,6 +2972,7 @@ if test "$with_dln_a_out" != yes; then
[darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'}
: ${LDFLAGS=""}
: ${LIBPATHENV=DYLD_LIBRARY_PATH}
: ${PRELOADENV=DYLD_INSERT_LIBRARIES}
rb_cv_dlopen=yes],
[aix*], [ : ${LDSHARED='$(CC)'}
LDSHARED="$LDSHARED ${linker_flag}-G"
@ -3080,6 +3081,7 @@ AC_SUBST(LINK_SO)
AC_SUBST(LIBPATHFLAG)
AC_SUBST(RPATHFLAG)
AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
AC_SUBST(PRELOADENV, "${PRELOADENV-LD_PRELOAD}")
AC_SUBST(TRY_LINK)
if test "x$OPT_DIR" != x; then

Просмотреть файл

@ -79,8 +79,12 @@ if File.file?(libruby_so)
if e = config['LIBPATHENV'] and !e.empty?
env[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR)
end
if /linux/ =~ RUBY_PLATFORM
env["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ')
if e = config['PRELOADENV']
e = nil if e.empty?
e ||= "LD_PRELOAD" if /linux/ =~ RUBY_PLATFORM
end
if e
env[e] = [libruby_so, ENV[e]].compact.join(' ')
end
end