summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-16 07:15:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-16 07:15:48 +0000
commit49d37e6edc41d58208f671da0a4697a271eedb9d (patch)
tree968cf02018c4927892cb02d9d3096af5701e69ed
parentf13a0a4ddaad8131e9fe0a4e74108578d8a098a3 (diff)
verconf.h: fix for default prefix
* configure.in, template/verconf.h.in (RUBY_EXEC_PREFIX): fix for default prefix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--configure.in19
-rw-r--r--template/verconf.h.in18
3 files changed, 24 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 01d3b42..942fa39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu May 16 16:15:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in, template/verconf.h.in (RUBY_EXEC_PREFIX): fix for
+ default prefix.
+
Thu May 16 13:12:27 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* template/verconf.h.in: generate verconf.h from the template and
diff --git a/configure.in b/configure.in
index ea248c5..540d7d2 100644
--- a/configure.in
+++ b/configure.in
@@ -2831,18 +2831,19 @@ else
fi
AC_SUBST(setup)
-save_prefix="$prefix"
-save_exec_prefix="$exec_prefix"
-test x"$prefix" = xNONE && prefix=$ac_default_prefix
-test x"${exec_prefix}" = xNONE && exec_prefix="$prefix"
-pat=`echo "${exec_prefix}" | tr -c '\012' .`'\(.*\)'
+if test x"${exec_prefix}" != xNONE; then
+ RUBY_EXEC_PREFIX="$exec_prefix"
+elif test x"$prefix" != xNONE; then
+ RUBY_EXEC_PREFIX="$prefix"
+else
+ RUBY_EXEC_PREFIX=$ac_default_prefix
+fi
+pat=`echo "${RUBY_EXEC_PREFIX}" | tr -c '\012' .`'\(.*\)'
for var in bindir libdir; do
eval val='"$'$var'"'
- AS_CASE(["$val"], ["${exec_prefix}"*], [val='${exec_prefix}'"`expr \"$val\" : \"$pat\"`"])
+ AS_CASE(["$val"], ["${RUBY_EXEC_PREFIX}"*], [val='${exec_prefix}'"`expr \"$val\" : \"$pat\"`"])
eval $var='"$val"'
done
-prefix="$save_prefix"
-exec_prefix="$save_exec_prefix"
BTESTRUBY='$(MINIRUBY)'
if test x"$cross_compiling" = xyes; then
@@ -3566,8 +3567,6 @@ AC_ARG_WITH(vendorarchdir,
if test "${LOAD_RELATIVE+set}"; then
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
RUBY_EXEC_PREFIX=''
-else
- RUBY_EXEC_PREFIX="${exec_prefix}"
fi
AC_SUBST(RUBY_EXEC_PREFIX)
diff --git a/template/verconf.h.in b/template/verconf.h.in
index a97cf30..83e2ca4 100644
--- a/template/verconf.h.in
+++ b/template/verconf.h.in
@@ -1,18 +1,19 @@
% require './rbconfig'
-% C = RbConfig::MAKEFILE_CONFIG
-%
-% verconf =
+% C = RbConfig::MAKEFILE_CONFIG.dup
+% def C.[](name) str = super and (str unless str.empty?); end
#define RUBY_BASE_NAME "${RUBY_BASE_NAME}"
#define RUBY_VERSION_NAME RUBY_BASE_NAME"-"RUBY_LIB_VERSION
% if C["RUBY_LIB_VERSION_STYLE"]
#define RUBY_LIB_VERSION_STYLE ${RUBY_LIB_VERSION_STYLE}
+% elsif !C["RUBY_LIB_VERSION"]
+#define RUBY_LIB_VERSION_STYLE 3 /* full */
% else
#define RUBY_LIB_VERSION ${RUBY_LIB_VERSION}
% end
-#define RUBY_EXEC_PREFIX "${RUBY_EXEC_PREFIX}"
+#define RUBY_EXEC_PREFIX "<%='${RUBY_EXEC_PREFIX}' if C['RUBY_EXEC_PREFIX']%>"
#define RUBY_LIB_PREFIX "${rubylibprefix}"
-% unless C["sitearch"] == '$(arch)'
-#define RUBY_SITEARCH "${sitearch}"
+% unless (sitearch = C["sitearch"]) == '$(arch)'
+#define RUBY_SITEARCH "<%=sitearch%>"
% end
#define RUBY_ARCH_PREFIX_FOR(arch) "${rubyarchprefix}"
#define RUBY_SITEARCH_PREFIX_FOR(arch) "${rubysitearchprefix}"
@@ -30,7 +31,7 @@
#define RUBY_VENDOR_LIB "${vendordir}"
#define RUBY_VENDOR_ARCH_LIB_FOR(arch) "${vendorarchdir}"
% end
-% unless C["RUBY_SEARCH_PATH"] == ""
+% if C["RUBY_SEARCH_PATH"]
#define RUBY_SEARCH_PATH "${RUBY_SEARCH_PATH}"
% end
%
@@ -47,7 +48,8 @@
% R["rubyarchprefix"] = '"RUBY_ARCH_PREFIX_FOR(arch)"'
% R["rubysitearchprefix"] = '"RUBY_SITEARCH_PREFIX_FOR(arch)"'
% R["exec_prefix"] = '"RUBY_EXEC_PREFIX"'
-% verconf.gsub!(/^(#define\s+(\S+)\s+)(.*)/) {
+% R["prefix"] = '"RUBY_EXEC_PREFIX"'
+% _erbout.gsub!(/^(#define\s+(\S+)\s+)(.*)/) {
% pre, name, repl = $1, $2, $3
% pat = %["#{name}"]
% c = C.merge(R.reject {|key, value| key == name or value.include?(pat)})