Permalink
Browse files

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
  • Loading branch information...
1 parent 97ef718 commit 46cdc66f84b933cce2495f31e1210829d2cddceb @nobu nobu committed Feb 18, 2013
Showing with 7 additions and 3 deletions.
  1. +1 −1 configure.in
  2. +3 −2 ruby.c
  3. +3 −0 version.c
View
@@ -3347,7 +3347,7 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then
else
AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION] !<verconf>!)
fi
-AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, ${RUBY_EXEC_PREFIX})
+AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, ${RUBY_EXEC_PREFIX} !<verconf>!)
AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX} !<verconf>!)
AC_DEFINE_UNQUOTED(RUBY_ARCH_PREFIX_FOR(arch), ${RUBY_ARCH_PREFIX_FOR} !<verconf>!)
AC_DEFINE_UNQUOTED(RUBY_SITEARCH_PREFIX_FOR(arch), ${RUBY_SITEARCH_PREFIX_FOR} !<verconf>!)
View
@@ -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;
View
@@ -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

0 comments on commit 46cdc66

Please sign in to comment.