ruby/ruby-1.9.3-arch-specific-dir.patch

133 lines
4.8 KiB
Diff
Raw Normal View History

2012-11-19 13:32:58 +00:00
From 50d6113cc3752d1810d58b78d9d009662e143041 Mon Sep 17 00:00:00 2001
2012-01-18 14:54:01 +00:00
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Thu, 8 Sep 2011 15:30:05 +0200
Subject: [PATCH] Add configuration arch specific dir flag.
---
2012-11-19 13:32:58 +00:00
Makefile.in | 1 +
configure.in | 20 ++++++++++++++++++++
tool/mkconfig.rb | 4 +++-
version.c | 2 ++
4 files changed, 26 insertions(+), 1 deletion(-)
2012-01-18 14:54:01 +00:00
diff --git a/Makefile.in b/Makefile.in
2012-11-19 13:32:58 +00:00
index 78d7139..690ff8e 100644
2012-01-18 14:54:01 +00:00
--- a/Makefile.in
+++ b/Makefile.in
2012-11-19 13:32:58 +00:00
@@ -36,6 +36,7 @@ libexecdir = @libexecdir@
2012-01-18 14:54:01 +00:00
datarootdir = @datarootdir@
datadir = @datadir@
arch = @arch@
+archdir = @archdir@
sitearch = @sitearch@
sitedir = @sitedir@
ruby_version = @ruby_version@
diff --git a/configure.in b/configure.in
2012-11-19 13:32:58 +00:00
index db3641b..8e4aaec 100644
2012-01-18 14:54:01 +00:00
--- a/configure.in
+++ b/configure.in
2012-12-04 11:51:34 +00:00
@@ -3152,6 +3152,15 @@ else
2012-01-18 14:54:01 +00:00
RUBY_LIB_VERSION="\"${ruby_version}\""
fi
+AC_ARG_WITH(archdir,
+ AS_HELP_STRING([--with-archdir=DIR], [architecture specific ruby libraries [[LIBDIR/RUBY_BASE_NAME/ARCH]]]),
+ [archdir=$withval],
+ [archdir='${rubylibprefix}/${arch}'])
+dir="${archdir}"
+until ARCH_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${ARCH_DIR}"; do
+ dir="${ARCH_DIR}"
+done
+
AC_ARG_WITH(sitedir,
2012-02-23 08:14:02 +00:00
AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
2012-01-18 14:54:01 +00:00
[sitedir=$withval],
2012-12-04 11:51:34 +00:00
@@ -3174,16 +3183,25 @@ if test "${LOAD_RELATIVE+set}"; then
2012-01-18 14:54:01 +00:00
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
RUBY_EXEC_PREFIX=""
RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
+ RUBY_ARCH_LIB_PATH="`eval echo "$ARCH_DIR" | 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_ARCH_LIB_PATH="`eval echo \\"$ARCH_DIR\\" | 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"'/|'`"
fi
pat=`echo "$RUBY_LIB_PREFIX/" | tr -c '\012' .`'\(.*\)'
+AS_CASE(["$RUBY_ARCH_LIB_PATH"],
+ ["$RUBY_LIB_PREFIX/"*], [
+ RUBY_ARCH_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_ARCH_LIB_PATH\" : \"$pat\"`"'"'
+ ],
+ [
+ RUBY_ARCH_LIB_PATH="\"${RUBY_ARCH_LIB_PATH}\""
+ ])
AS_CASE(["$RUBY_SITE_LIB_PATH"],
["$RUBY_LIB_PREFIX/"*], [
RUBY_SITE_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_SITE_LIB_PATH\" : \"$pat\"`"'"'
2012-12-04 11:51:34 +00:00
@@ -3214,6 +3232,7 @@ else
2012-01-18 14:54:01 +00:00
fi
AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, "${RUBY_EXEC_PREFIX}")
2012-04-18 17:40:36 +00:00
AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX} !<verconf>!)
+AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, ${RUBY_ARCH_LIB_PATH} !<verconf>!)
2012-01-18 14:54:01 +00:00
if test "x$SITE_DIR" = xno; then
2012-04-18 17:40:36 +00:00
AC_DEFINE(NO_RUBY_SITE_LIB, [] !<verconf>!)
2012-01-18 14:54:01 +00:00
else
2012-12-04 11:51:34 +00:00
@@ -3228,6 +3247,7 @@ fi
2012-01-18 14:54:01 +00:00
AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl
AC_SUBST(ruby_version)dnl
+AC_SUBST(archdir)dnl
AC_SUBST(sitedir)dnl
AC_SUBST(vendordir)dnl
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
2012-11-19 13:32:58 +00:00
index d9e26c1..03c3332 100755
2012-01-18 14:54:01 +00:00
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
2012-11-19 13:32:58 +00:00
@@ -43,6 +43,7 @@ vars = {}
2012-01-18 14:54:01 +00:00
continued_name = nil
continued_line = nil
path_version = "/$(ruby_version)"
+archdir_override = "$(vendorlibdir)/$(sitearch)"
File.foreach "config.status" do |line|
next if /^#/ =~ line
name = nil
@@ -77,6 +78,7 @@ File.foreach "config.status" do |line|
when /^RUBY_INSTALL_NAME$/; next if $install_name
when /^RUBY_SO_NAME$/; next if $so_name
when /^arch$/; if val.empty? then val = arch else arch = val end
+ when /^archdir$/; archdir_override = val; next
when /^sitearch/; val = '$(arch)' if val.empty?
end
case val
@@ -207,7 +209,7 @@ print(*v_fast)
print(*v_others)
print <<EOS
CONFIG["rubylibdir"] = "$(rubylibprefix)#{path_version}"
- CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
+ CONFIG["archdir"] = "#{archdir_override}"
EOS
print <<EOS unless v_disabled["sitedir"]
CONFIG["sitelibdir"] = "$(sitedir)#{path_version}"
diff --git a/version.c b/version.c
2012-11-19 13:32:58 +00:00
index 05e5069..a117059 100644
2012-01-18 14:54:01 +00:00
--- a/version.c
+++ b/version.c
2012-04-18 17:40:36 +00:00
@@ -48,7 +48,9 @@
2012-01-18 14:54:01 +00:00
#define RUBY_SITE_LIB2 RUBY_SITE_LIB "/"RUBY_LIB_VERSION
#define RUBY_VENDOR_LIB2 RUBY_VENDOR_LIB "/"RUBY_LIB_VERSION
#endif
+#ifndef RUBY_ARCHLIB
#define RUBY_ARCHLIB RUBY_LIB "/"RUBY_ARCH
+#endif
#define RUBY_SITE_ARCHLIB RUBY_SITE_LIB2 "/"RUBY_SITEARCH
#define RUBY_VENDOR_ARCHLIB RUBY_VENDOR_LIB2 "/"RUBY_SITEARCH
#ifdef RUBY_THINARCH
--
2012-11-19 13:32:58 +00:00
1.8.0
2012-01-18 14:54:01 +00:00