pvalena / rpms / ruby

Forked from rpms/ruby 3 years ago
Clone
619366
From 50d6113cc3752d1810d58b78d9d009662e143041 Mon Sep 17 00:00:00 2001
117278
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
117278
Date: Thu, 8 Sep 2011 15:30:05 +0200
117278
Subject: [PATCH] Add configuration arch specific dir flag.
117278
117278
---
619366
 Makefile.in      |  1 +
619366
 configure.in     | 20 ++++++++++++++++++++
619366
 tool/mkconfig.rb |  4 +++-
619366
 version.c        |  2 ++
619366
 4 files changed, 26 insertions(+), 1 deletion(-)
117278
117278
diff --git a/Makefile.in b/Makefile.in
619366
index 78d7139..690ff8e 100644
117278
--- a/Makefile.in
117278
+++ b/Makefile.in
a91606
@@ -38,6 +38,7 @@ libexecdir = @libexecdir@
117278
 datarootdir = @datarootdir@
117278
 datadir = @datadir@
117278
 arch = @arch@
117278
+archdir = @archdir@
117278
 sitearch = @sitearch@
117278
 sitedir = @sitedir@
117278
 ruby_version = @ruby_version@
117278
diff --git a/configure.in b/configure.in
619366
index db3641b..8e4aaec 100644
117278
--- a/configure.in
117278
+++ b/configure.in
a91606
@@ -3179,6 +3179,15 @@ else
117278
     RUBY_LIB_VERSION="\"${ruby_version}\""
117278
 fi
117278
 
117278
+AC_ARG_WITH(archdir,
117278
+	    AS_HELP_STRING([--with-archdir=DIR], [architecture specific ruby libraries [[LIBDIR/RUBY_BASE_NAME/ARCH]]]),
117278
+            [archdir=$withval],
117278
+            [archdir='${rubylibprefix}/${arch}'])
117278
+dir="${archdir}"
117278
+until ARCH_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${ARCH_DIR}"; do
117278
+    dir="${ARCH_DIR}"
117278
+done
117278
+
117278
 AC_ARG_WITH(sitedir,
7fe201
 	    AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
117278
             [sitedir=$withval],
a91606
@@ -3201,16 +3210,25 @@ if test "${LOAD_RELATIVE+set}"; then
117278
     AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
117278
     RUBY_EXEC_PREFIX=""
117278
     RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
117278
+    RUBY_ARCH_LIB_PATH="`eval echo "$ARCH_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
117278
     RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
117278
     RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
117278
 else
117278
     RUBY_EXEC_PREFIX="`eval echo \\"$exec_prefix/\\" | sed 's|^NONE/|'"$prefix"'/|;s|/$||'`"
117278
     RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
117278
+    RUBY_ARCH_LIB_PATH="`eval echo \\"$ARCH_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
117278
     RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
117278
     RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
117278
 fi
117278
 
117278
 pat=`echo "$RUBY_LIB_PREFIX/" | tr -c '\012' .`'\(.*\)'
117278
+AS_CASE(["$RUBY_ARCH_LIB_PATH"],
117278
+  ["$RUBY_LIB_PREFIX/"*], [
117278
+    RUBY_ARCH_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_ARCH_LIB_PATH\" : \"$pat\"`"'"'
117278
+    ],
117278
+  [
117278
+    RUBY_ARCH_LIB_PATH="\"${RUBY_ARCH_LIB_PATH}\""
117278
+    ])
117278
 AS_CASE(["$RUBY_SITE_LIB_PATH"],
117278
   ["$RUBY_LIB_PREFIX/"*], [
117278
     RUBY_SITE_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_SITE_LIB_PATH\" : \"$pat\"`"'"'
a91606
@@ -3241,6 +3259,7 @@ else
117278
 fi
117278
 AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, "${RUBY_EXEC_PREFIX}")
ea3cb6
 AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX} !<verconf>!)
ea3cb6
+AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, ${RUBY_ARCH_LIB_PATH} !<verconf>!)
117278
 if test "x$SITE_DIR" = xno; then
ea3cb6
     AC_DEFINE(NO_RUBY_SITE_LIB, [] !<verconf>!)
117278
 else
a91606
@@ -3255,6 +3274,7 @@ fi
117278
 AC_SUBST(arch)dnl
117278
 AC_SUBST(sitearch)dnl
117278
 AC_SUBST(ruby_version)dnl
117278
+AC_SUBST(archdir)dnl
117278
 AC_SUBST(sitedir)dnl
117278
 AC_SUBST(vendordir)dnl
117278
 
117278
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
619366
index d9e26c1..03c3332 100755
117278
--- a/tool/mkconfig.rb
117278
+++ b/tool/mkconfig.rb
619366
@@ -43,6 +43,7 @@ vars = {}
117278
 continued_name = nil
117278
 continued_line = nil
117278
 path_version = "/$(ruby_version)"
117278
+archdir_override = "$(vendorlibdir)/$(sitearch)"
117278
 File.foreach "config.status" do |line|
117278
   next if /^#/ =~ line
117278
   name = nil
f700ed
@@ -78,6 +79,7 @@ File.foreach "config.status" do |line|
117278
     when /^RUBY_INSTALL_NAME$/; next if $install_name
117278
     when /^RUBY_SO_NAME$/; next if $so_name
117278
     when /^arch$/; if val.empty? then val = arch else arch = val end
117278
+    when /^archdir$/; archdir_override = val; next
117278
     when /^sitearch/; val = '$(arch)' if val.empty?
117278
     end
117278
     case val
f700ed
@@ -208,7 +210,7 @@ print(*v_fast)
117278
 print(*v_others)
117278
 print <
117278
   CONFIG["rubylibdir"] = "$(rubylibprefix)#{path_version}"
117278
-  CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
117278
+  CONFIG["archdir"] = "#{archdir_override}"
117278
 EOS
117278
 print <
117278
   CONFIG["sitelibdir"] = "$(sitedir)#{path_version}"
117278
diff --git a/version.c b/version.c
619366
index 05e5069..a117059 100644
117278
--- a/version.c
117278
+++ b/version.c
ea3cb6
@@ -48,7 +48,9 @@
117278
 #define RUBY_SITE_LIB2              RUBY_SITE_LIB    "/"RUBY_LIB_VERSION
117278
 #define RUBY_VENDOR_LIB2            RUBY_VENDOR_LIB  "/"RUBY_LIB_VERSION
117278
 #endif
117278
+#ifndef RUBY_ARCHLIB
117278
 #define RUBY_ARCHLIB                RUBY_LIB         "/"RUBY_ARCH
117278
+#endif
117278
 #define RUBY_SITE_ARCHLIB           RUBY_SITE_LIB2   "/"RUBY_SITEARCH
117278
 #define RUBY_VENDOR_ARCHLIB         RUBY_VENDOR_LIB2 "/"RUBY_SITEARCH
117278
 #ifdef  RUBY_THINARCH
117278
-- 
619366
1.8.0
117278