mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* configure.in (RUBY_EXEC_PREFIX): added to config.h.
* ruby.c (ruby_init_loadpath_safe): TMP_RUBY_PREFIX should be exec_prefix, not rubylibprefix. [ruby-core:28718] * version.c (RUBY_LIB_PREFIX): fallback to RUBY_EXEC_PREFIX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ad41699b47
commit
43ab72099b
4 changed files with 27 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
|||
Thu Mar 18 06:28:32 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in (RUBY_EXEC_PREFIX): added to config.h.
|
||||
|
||||
* ruby.c (ruby_init_loadpath_safe): TMP_RUBY_PREFIX should be
|
||||
exec_prefix, not rubylibprefix. [ruby-core:28718]
|
||||
|
||||
* version.c (RUBY_LIB_PREFIX): fallback to RUBY_EXEC_PREFIX.
|
||||
|
||||
Thu Mar 18 05:58:27 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/bigdecimal/bigdecimal.c (BigDecimal_{to_i,mod,divmod,div2}):
|
||||
|
|
13
configure.in
13
configure.in
|
@ -2394,10 +2394,12 @@ done
|
|||
|
||||
if test "${LOAD_RELATIVE+set}"; then
|
||||
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
|
||||
RUBY_EXEC_PREFIX=""
|
||||
RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
|
||||
RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
|
||||
RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
|
||||
else
|
||||
RUBY_EXEC_PREFIX="`eval echo \\"$exec_prefix/\\" | sed 's|^NONE/|'"$prefix"'/|;s|/$||'`"
|
||||
RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
|
||||
RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
|
||||
RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
|
||||
|
@ -2418,13 +2420,22 @@ AS_CASE(["$RUBY_VENDOR_LIB_PATH"],
|
|||
[
|
||||
RUBY_VENDOR_LIB_PATH="\"${RUBY_VENDOR_LIB_PATH}\""
|
||||
])
|
||||
pat=`echo "$RUBY_EXEC_PREFIX/" | tr -c '\012' .`'\(.*\)'
|
||||
AS_CASE(["$RUBY_LIB_PREFIX"],
|
||||
["$RUBY_EXEC_PREFIX/"*], [
|
||||
RUBY_LIB_PREFIX='RUBY_EXEC_PREFIX"/'"`expr \"$RUBY_LIB_PREFIX\" : \"$pat\"`"'"'
|
||||
],
|
||||
[
|
||||
RUBY_LIB_PREFIX="\"${RUBY_LIB_PREFIX}\""
|
||||
])
|
||||
|
||||
if test ${RUBY_LIB_VERSION_STYLE+set}; then
|
||||
AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE)
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION])
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, "${RUBY_LIB_PREFIX}")
|
||||
AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, "${RUBY_EXEC_PREFIX}")
|
||||
AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX})
|
||||
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH})
|
||||
AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH})
|
||||
|
||||
|
|
3
ruby.c
3
ruby.c
|
@ -430,8 +430,9 @@ ruby_init_loadpath_safe(int safe_level)
|
|||
|
||||
#define RUBY_RELATIVE(path, len) rb_str_buf_cat(BASEPATH(), path, len)
|
||||
#else
|
||||
static const char exec_prefix[] = RUBY_EXEC_PREFIX;
|
||||
#define RUBY_RELATIVE(path, len) rubylib_mangled_path(path, len)
|
||||
#define PREFIX_PATH() rubylib_mangled_path(RUBY_LIB_PREFIX, sizeof(RUBY_LIB_PREFIX)-1)
|
||||
#define PREFIX_PATH() rubylib_mangled_path(exec_prefix, sizeof(exec_prefix)-1)
|
||||
#endif
|
||||
load_path = GET_VM()->load_path;
|
||||
|
||||
|
|
|
@ -26,7 +26,10 @@
|
|||
#define RUBY_THINARCH RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS
|
||||
#endif
|
||||
#ifndef RUBY_LIB_PREFIX
|
||||
#error RUBY_LIB_PREFIX must be defined
|
||||
#ifndef RUBY_EXEC_PREFIX
|
||||
#error RUBY_EXEC_PREFIX must be defined
|
||||
#endif
|
||||
#define RUBY_LIB_PREFIX RUBY_EXEC_PREFIX"/lib/ruby"
|
||||
#endif
|
||||
#ifndef RUBY_SITE_LIB
|
||||
#define RUBY_SITE_LIB RUBY_LIB_PREFIX"/site_ruby"
|
||||
|
|
Loading…
Reference in a new issue