From 46cdc66f84b933cce2495f31e1210829d2cddceb Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 18 Feb 2013 01:11:58 +0000 Subject: [PATCH] version.c: move ruby_exec_prefix * version.c (ruby_exec_prefix): move all path configuration stuffs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 2 +- ruby.c | 5 +++-- version.c | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 586bfc2a19..60c62fed39 100644 --- a/configure.in +++ b/configure.in @@ -3347,7 +3347,7 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then else AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION] !!) fi -AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, ${RUBY_EXEC_PREFIX}) +AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, ${RUBY_EXEC_PREFIX} !!) AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX} !!) AC_DEFINE_UNQUOTED(RUBY_ARCH_PREFIX_FOR(arch), ${RUBY_ARCH_PREFIX_FOR} !!) AC_DEFINE_UNQUOTED(RUBY_SITEARCH_PREFIX_FOR(arch), ${RUBY_SITEARCH_PREFIX_FOR} !!) diff --git a/ruby.c b/ruby.c index 9e112623a9..f8b05f7f72 100644 --- a/ruby.c +++ b/ruby.c @@ -492,9 +492,10 @@ 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; + extern const char ruby_exec_prefix[]; + const size_t exec_prefix_len = strlen(ruby_exec_prefix); #define RUBY_RELATIVE(path, len) rubylib_mangled_path((path), (len)) -#define PREFIX_PATH() RUBY_RELATIVE(exec_prefix, sizeof(exec_prefix)-1) +#define PREFIX_PATH() RUBY_RELATIVE(ruby_exec_prefix, exec_prefix_len) #endif load_path = GET_VM()->load_path; diff --git a/version.c b/version.c index 6ba645315b..743ca67e7c 100644 --- a/version.c +++ b/version.c @@ -67,6 +67,9 @@ const char ruby_description[] = RUBY_DESCRIPTION; const char ruby_copyright[] = RUBY_COPYRIGHT; const char ruby_engine[] = "ruby"; VALUE ruby_engine_name = Qnil; +#if !defined(LOAD_RELATIVE) || !LOAD_RELATIVE +const char ruby_exec_prefix[] = RUBY_EXEC_PREFIX; +#endif const char ruby_initial_load_paths[] = #ifndef NO_INITIAL_LOAD_PATH