* ruby.c (ruby_init_loadpath_safe): use real path for non-shared

build.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-05-21 04:35:58 +00:00
Родитель b32e8a5911
Коммит 73997d38f4
3 изменённых файлов: 13 добавлений и 6 удалений

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

@ -1,3 +1,8 @@
Fri May 21 13:35:55 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (ruby_init_loadpath_safe): use real path for non-shared
build.
Fri May 21 12:25:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* marshal.c (w_float): use dtoa directly instead of stripping

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

@ -2049,6 +2049,7 @@ AC_ARG_ENABLE(shared,
AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
[enable_shared=$enableval])
LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
libprefix='$(libdir)'
if test "$enable_shared" = 'yes'; then
LIBRUBY='$(LIBRUBY_SO)'
LIBRUBYARG='$(LIBRUBYARG_SHARED)'
@ -2117,8 +2118,6 @@ if test "$enable_shared" = 'yes'; then
LIBRUBY_LDSHARED='$(CC) -dynamiclib'
if test "$load_relative" = yes; then
libprefix='@executable_path/../lib'
else
libprefix='$(libdir)'
fi
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY)'
@ -2134,7 +2133,7 @@ if test "$enable_shared" = 'yes'; then
])
fi
if test "$enable_rpath" = yes; then
LIBRUBY_RPATHFLAGS="${linker_flag}-R ${linker_flag}\$(libdir) -L\$(libdir)"
LIBRUBY_RPATHFLAGS="${linker_flag}-R ${linker_flag}${libprefix} -L\$(libdir)"
LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
fi

9
ruby.c
Просмотреть файл

@ -370,9 +370,12 @@ ruby_init_loadpath_safe(int safe_level)
#elif defined(HAVE_DLADDR)
Dl_info dli;
if (dladdr(expand_include_path, &dli)) {
VALUE fname = rb_str_new_cstr(dli.dli_fname);
sopath = rb_file_absolute_path(fname, Qnil);
rb_str_resize(fname, 0);
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
char fbuf[MAXPATHLEN];
char *f = dln_find_file_r(dli.dli_fname, getenv(PATH_ENV), fbuf, sizeof(fbuf));
VALUE fname = rb_str_new_cstr(f);
rb_str_freeze(fname);
sopath = rb_realpath_internal(Qnil, fname, 1);
}
else {
sopath = rb_str_new(0, 0);