mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
merge revision(s) 27939,29703,29704,30164:
* ruby.c (ruby_init_loadpath_safe): use real path for non-shared build. * configure.in (LIBRUBY_RELATIVE): use rpath token expansion. * tool/rbinstall.rb (bin-comm): prepend prolog shell script if necessary. * ruby.c (ruby_init_loadpath_safe): relatively called non-shared binary cannot be found in PATH, so use given pathname. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@35755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2c7e082f47
commit
ac3be749d5
5 changed files with 55 additions and 10 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
Tue May 22 11:09:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ruby.c (ruby_init_loadpath_safe): use real path for non-shared
|
||||||
|
build.
|
||||||
|
|
||||||
|
* configure.in (LIBRUBY_RELATIVE): use rpath token expansion.
|
||||||
|
|
||||||
|
* tool/rbinstall.rb (bin-comm): prepend prolog shell script if
|
||||||
|
necessary.
|
||||||
|
|
||||||
|
* ruby.c (ruby_init_loadpath_safe): relatively called non-shared
|
||||||
|
binary cannot be found in PATH, so use given pathname.
|
||||||
|
|
||||||
Mon May 21 16:27:24 2012 Akinori MUSHA <knu@iDaemons.org>
|
Mon May 21 16:27:24 2012 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* ext/syslog/syslog.c (mSyslog_inspect): Make sure self is a
|
* ext/syslog/syslog.c (mSyslog_inspect): Make sure self is a
|
||||||
|
|
13
configure.in
13
configure.in
|
@ -2107,6 +2107,8 @@ AC_ARG_ENABLE(shared,
|
||||||
AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
|
AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
|
||||||
[enable_shared=$enableval])
|
[enable_shared=$enableval])
|
||||||
LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
|
LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
|
||||||
|
libprefix='$(libdir)'
|
||||||
|
LIBRUBY_RELATIVE=no
|
||||||
if test "$enable_shared" = 'yes'; then
|
if test "$enable_shared" = 'yes'; then
|
||||||
LIBRUBY='$(LIBRUBY_SO)'
|
LIBRUBY='$(LIBRUBY_SO)'
|
||||||
LIBRUBYARG='$(LIBRUBYARG_SHARED)'
|
LIBRUBYARG='$(LIBRUBYARG_SHARED)'
|
||||||
|
@ -2122,6 +2124,10 @@ if test "$enable_shared" = 'yes'; then
|
||||||
[linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu], [
|
[linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu], [
|
||||||
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
|
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'
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
|
||||||
|
if test "$load_relative" = yes; then
|
||||||
|
LIBRUBY_RPATHFLAGS="'-Wl,-rpath,\$\${ORIGIN}/../lib'"
|
||||||
|
LIBRUBY_RELATIVE=yes
|
||||||
|
fi
|
||||||
],
|
],
|
||||||
[freebsd*|dragonfly*], [
|
[freebsd*|dragonfly*], [
|
||||||
SOLIBS='$(LIBS)'
|
SOLIBS='$(LIBS)'
|
||||||
|
@ -2175,8 +2181,7 @@ if test "$enable_shared" = 'yes'; then
|
||||||
LIBRUBY_LDSHARED='$(CC) -dynamiclib'
|
LIBRUBY_LDSHARED='$(CC) -dynamiclib'
|
||||||
if test "$load_relative" = yes; then
|
if test "$load_relative" = yes; then
|
||||||
libprefix='@executable_path/../lib'
|
libprefix='@executable_path/../lib'
|
||||||
else
|
LIBRUBY_RELATIVE=yes
|
||||||
libprefix='$(libdir)'
|
|
||||||
fi
|
fi
|
||||||
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
|
||||||
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY)'
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY)'
|
||||||
|
@ -2194,10 +2199,12 @@ if test "$enable_shared" = 'yes'; then
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
if test "$enable_rpath" = yes; then
|
if test "$enable_rpath" = yes; then
|
||||||
LIBRUBY_RPATHFLAGS="${linker_flag}-R ${linker_flag}\$(libdir) -L\$(libdir)"
|
test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
|
||||||
|
LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${linker_flag}-R ${linker_flag}${libprefix} -L\$(libdir)"
|
||||||
LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
|
LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
|
||||||
LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
|
LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
|
||||||
fi
|
fi
|
||||||
|
AC_SUBST(LIBRUBY_RELATIVE)
|
||||||
|
|
||||||
LDFLAGS="-L. $LDFLAGS"
|
LDFLAGS="-L. $LDFLAGS"
|
||||||
AC_SUBST(ARCHFILE)
|
AC_SUBST(ARCHFILE)
|
||||||
|
|
9
ruby.c
9
ruby.c
|
@ -370,9 +370,12 @@ ruby_init_loadpath_safe(int safe_level)
|
||||||
#elif defined(HAVE_DLADDR)
|
#elif defined(HAVE_DLADDR)
|
||||||
Dl_info dli;
|
Dl_info dli;
|
||||||
if (dladdr((void *)(VALUE)expand_include_path, &dli)) {
|
if (dladdr((void *)(VALUE)expand_include_path, &dli)) {
|
||||||
VALUE fname = rb_str_new_cstr(dli.dli_fname);
|
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
|
||||||
sopath = rb_file_absolute_path(fname, Qnil);
|
char fbuf[MAXPATHLEN];
|
||||||
rb_str_resize(fname, 0);
|
char *f = dln_find_file_r(dli.dli_fname, getenv(PATH_ENV), fbuf, sizeof(fbuf));
|
||||||
|
VALUE fname = rb_str_new_cstr(f ? f : dli.dli_fname);
|
||||||
|
rb_str_freeze(fname);
|
||||||
|
sopath = rb_realpath_internal(Qnil, fname, 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sopath = rb_str_new(0, 0);
|
sopath = rb_str_new(0, 0);
|
||||||
|
|
|
@ -300,6 +300,7 @@ enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
|
||||||
dll = CONFIG["LIBRUBY_SO"]
|
dll = CONFIG["LIBRUBY_SO"]
|
||||||
lib = CONFIG["LIBRUBY"]
|
lib = CONFIG["LIBRUBY"]
|
||||||
arc = CONFIG["LIBRUBY_A"]
|
arc = CONFIG["LIBRUBY_A"]
|
||||||
|
load_relative = configure_args.include?("--enable-load-relative")
|
||||||
|
|
||||||
install?(:local, :arch, :bin, :'bin-arch') do
|
install?(:local, :arch, :bin, :'bin-arch') do
|
||||||
prepare "binary commands", bindir
|
prepare "binary commands", bindir
|
||||||
|
@ -371,6 +372,23 @@ install?(:doc, :capi) do
|
||||||
install_recursive "doc/capi", capidir, :mode => $data_mode
|
install_recursive "doc/capi", capidir, :mode => $data_mode
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if load_relative
|
||||||
|
PROLOG_SCRIPT = <<EOS
|
||||||
|
#!/bin/sh\n# -*- ruby -*-
|
||||||
|
bindir=`#{CONFIG["CHDIR"]} "${0%/*}" 2>/dev/null; pwd`
|
||||||
|
EOS
|
||||||
|
if CONFIG["LIBRUBY_RELATIVE"] != 'yes' and libpathenv = CONFIG["LIBPATHENV"]
|
||||||
|
pathsep = File::PATH_SEPARATOR
|
||||||
|
PROLOG_SCRIPT << <<EOS
|
||||||
|
prefix="${bindir%/bin}"
|
||||||
|
export #{libpathenv}="$prefix/lib${#{libpathenv}#{pathsep}+#{pathsep}$#{libpathenv}}"
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
PROLOG_SCRIPT << %Q[exec "$bindir/#{ruby_install_name}" -x "$0" "$@"\n]
|
||||||
|
else
|
||||||
|
PROLOG_SCRIPT = nil
|
||||||
|
end
|
||||||
|
|
||||||
install?(:local, :comm, :bin, :'bin-comm') do
|
install?(:local, :comm, :bin, :'bin-comm') do
|
||||||
prepare "command scripts", bindir
|
prepare "command scripts", bindir
|
||||||
|
|
||||||
|
@ -416,7 +434,11 @@ install?(:local, :comm, :bin, :'bin-comm') do
|
||||||
shebang = f.gets
|
shebang = f.gets
|
||||||
body = f.read
|
body = f.read
|
||||||
end
|
end
|
||||||
shebang.sub!(/^\#!.*?ruby\b/) {"#!" + ruby_shebang}
|
if PROLOG_SCRIPT
|
||||||
|
shebang.sub!(/\A(\#!.*?ruby\b)?/) {PROLOG_SCRIPT + ($1 || "#!ruby\n")}
|
||||||
|
else
|
||||||
|
shebang.sub!(/\A\#!.*?ruby\b/) {"#!" + ruby_shebang}
|
||||||
|
end
|
||||||
shebang.sub!(/\r$/, '')
|
shebang.sub!(/\r$/, '')
|
||||||
body.gsub!(/\r$/, '')
|
body.gsub!(/\r$/, '')
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#define RUBY_VERSION "1.9.2"
|
#define RUBY_VERSION "1.9.2"
|
||||||
#define RUBY_PATCHLEVEL 322
|
#define RUBY_PATCHLEVEL 323
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
#define RUBY_VERSION_MINOR 9
|
#define RUBY_VERSION_MINOR 9
|
||||||
#define RUBY_VERSION_TEENY 1
|
#define RUBY_VERSION_TEENY 1
|
||||||
|
|
||||||
#define RUBY_RELEASE_YEAR 2012
|
#define RUBY_RELEASE_YEAR 2012
|
||||||
#define RUBY_RELEASE_MONTH 5
|
#define RUBY_RELEASE_MONTH 5
|
||||||
#define RUBY_RELEASE_DAY 21
|
#define RUBY_RELEASE_DAY 22
|
||||||
#define RUBY_RELEASE_DATE "2012-05-21"
|
#define RUBY_RELEASE_DATE "2012-05-22"
|
||||||
|
|
||||||
#include "ruby/version.h"
|
#include "ruby/version.h"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue