ruby-changes:15093
From: nobu <ko1@a...>
Date: Thu, 18 Mar 2010 06:29:05 +0900 (JST)
Subject: [ruby-changes:15093] Ruby:r26970 (trunk): * configure.in (RUBY_EXEC_PREFIX): added to config.h.
nobu 2010-03-18 06:28:36 +0900 (Thu, 18 Mar 2010) New Revision: 26970 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26970 Log: * 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. Modified files: trunk/ChangeLog trunk/configure.in trunk/ruby.c trunk/version.c Index: configure.in =================================================================== --- configure.in (revision 26969) +++ configure.in (revision 26970) @@ -2394,10 +2394,12 @@ 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 @@ [ 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}) Index: ChangeLog =================================================================== --- ChangeLog (revision 26969) +++ ChangeLog (revision 26970) @@ -1,3 +1,12 @@ +Thu Mar 18 06:28:32 2010 Nobuyoshi Nakada <nobu@r...> + + * 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@r...> * ext/bigdecimal/bigdecimal.c (BigDecimal_{to_i,mod,divmod,div2}): Index: version.c =================================================================== --- version.c (revision 26969) +++ version.c (revision 26970) @@ -26,8 +26,11 @@ #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" #endif Index: ruby.c =================================================================== --- ruby.c (revision 26969) +++ ruby.c (revision 26970) @@ -430,8 +430,9 @@ #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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/