2012-11-19 13:32:58 +00:00
|
|
|
From be687364922657501e861e9f53f8ec647a73fe00 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: Mon, 5 Sep 2011 13:10:47 +0200
|
|
|
|
Subject: [PATCH] Added configuration flags for site and vendor architecture
|
|
|
|
specific directories.
|
|
|
|
|
|
|
|
---
|
2012-11-19 13:32:58 +00:00
|
|
|
Makefile.in | 3 +++
|
|
|
|
configure.in | 40 ++++++++++++++++++++++++++++++++++++++++
|
|
|
|
tool/mkconfig.rb | 8 ++++++--
|
|
|
|
version.c | 4 ++++
|
2012-01-18 14:54:01 +00:00
|
|
|
4 files changed, 53 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/Makefile.in b/Makefile.in
|
2012-11-19 13:32:58 +00:00
|
|
|
index 690ff8e..8c7dd98 100644
|
2012-01-18 14:54:01 +00:00
|
|
|
--- a/Makefile.in
|
|
|
|
+++ b/Makefile.in
|
2012-11-19 13:32:58 +00:00
|
|
|
@@ -39,6 +39,9 @@ arch = @arch@
|
2012-01-18 14:54:01 +00:00
|
|
|
archdir = @archdir@
|
|
|
|
sitearch = @sitearch@
|
|
|
|
sitedir = @sitedir@
|
|
|
|
+sitearchdir= @sitearchdir@
|
|
|
|
+vendordir = @vendordir@
|
|
|
|
+vendorarchdir = @vendorarchdir@
|
|
|
|
ruby_version = @ruby_version@
|
|
|
|
|
|
|
|
TESTUI = console
|
|
|
|
diff --git a/configure.in b/configure.in
|
2012-11-19 13:32:58 +00:00
|
|
|
index 8e4aaec..c65e0c7 100644
|
2012-01-18 14:54:01 +00:00
|
|
|
--- a/configure.in
|
|
|
|
+++ b/configure.in
|
2012-12-17 09:52:59 +00:00
|
|
|
@@ -3178,6 +3178,15 @@ until SITE_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITE_DIR}"; do
|
2012-01-18 14:54:01 +00:00
|
|
|
dir="${SITE_DIR}"
|
|
|
|
done
|
|
|
|
|
|
|
|
+AC_ARG_WITH(sitearchdir,
|
|
|
|
+ AS_HELP_STRING([--with-sitearchdir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]]]),
|
|
|
|
+ [sitearchdir=$withval],
|
|
|
|
+ [sitearchdir='${rubylibprefix}/site_ruby/${arch}'])
|
|
|
|
+dir="${sitearchdir}"
|
|
|
|
+until SITEARCH_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITEARCH_DIR}"; do
|
|
|
|
+ dir="${SITEARCH_DIR}"
|
|
|
|
+done
|
|
|
|
+
|
|
|
|
AC_ARG_WITH(vendordir,
|
2012-02-23 08:14:02 +00:00
|
|
|
AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
|
2012-01-18 14:54:01 +00:00
|
|
|
[vendordir=$withval],
|
2012-12-17 09:52:59 +00:00
|
|
|
@@ -3187,19 +3196,32 @@ until VENDOR_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDOR_DIR}"; do
|
2012-01-18 14:54:01 +00:00
|
|
|
dir="${VENDOR_DIR}"
|
|
|
|
done
|
|
|
|
|
|
|
|
+AC_ARG_WITH(vendorarchdir,
|
|
|
|
+ AS_HELP_STRING([--with-vendorarchdir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]]]),
|
|
|
|
+ [vendorarchdir=$withval],
|
|
|
|
+ [vendorarchdir='${rubylibprefix}/vendor_ruby/${arch}'])
|
|
|
|
+dir="${vendorarchdir}"
|
|
|
|
+until VENDORARCH_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDORARCH_DIR}"; do
|
|
|
|
+ dir="${VENDORARCH_DIR}"
|
|
|
|
+done
|
|
|
|
+
|
|
|
|
if test "${LOAD_RELATIVE+set}"; then
|
|
|
|
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_SITE_ARCHLIB_PATH="`eval echo "$SITEARCH_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
|
|
|
|
RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
|
|
|
|
+ RUBY_VENDOR_ARCHLIB_PATH="`eval echo "$VENDORARCH_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_SITE_ARCHLIB_PATH="`eval echo \\"$SITEARCH_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
|
|
|
|
RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
|
|
|
|
+ RUBY_VENDOR_ARCHLIB_PATH="`eval echo \\"$VENDORARCH_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
|
|
|
|
fi
|
|
|
|
|
|
|
|
pat=`echo "$RUBY_LIB_PREFIX/" | tr -c '\012' .`'\(.*\)'
|
2012-12-17 09:52:59 +00:00
|
|
|
@@ -3217,6 +3239,13 @@ AS_CASE(["$RUBY_SITE_LIB_PATH"],
|
2012-01-18 14:54:01 +00:00
|
|
|
[
|
|
|
|
RUBY_SITE_LIB_PATH="\"${RUBY_SITE_LIB_PATH}\""
|
|
|
|
])
|
|
|
|
+AS_CASE(["$RUBY_SITE_ARCHLIB_PATH"],
|
|
|
|
+ ["$RUBY_LIB_PREFIX/"*], [
|
|
|
|
+ RUBY_SITE_ARCHLIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_SITE_ARCHLIB_PATH\" : \"$pat\"`"'"'
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ RUBY_SITE_ARCHLIB_PATH="\"${RUBY_SITE_ARCHLIB_PATH}\""
|
|
|
|
+ ])
|
|
|
|
AS_CASE(["$RUBY_VENDOR_LIB_PATH"],
|
|
|
|
["$RUBY_LIB_PREFIX/"*], [
|
|
|
|
RUBY_VENDOR_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_VENDOR_LIB_PATH\" : \"$pat\"`"'"'
|
2012-12-17 09:52:59 +00:00
|
|
|
@@ -3224,6 +3253,13 @@ AS_CASE(["$RUBY_VENDOR_LIB_PATH"],
|
2012-01-18 14:54:01 +00:00
|
|
|
[
|
|
|
|
RUBY_VENDOR_LIB_PATH="\"${RUBY_VENDOR_LIB_PATH}\""
|
2012-11-19 13:32:58 +00:00
|
|
|
])
|
2012-01-18 14:54:01 +00:00
|
|
|
+AS_CASE(["$RUBY_VENDOR_ARCHLIB_PATH"],
|
|
|
|
+ ["$RUBY_LIB_PREFIX/"*], [
|
|
|
|
+ RUBY_VENDOR_ARCHLIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_VENDOR_ARCHLIB_PATH\" : \"$pat\"`"'"'
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ RUBY_VENDOR_ARCHLIB_PATH="\"${RUBY_VENDOR_ARCHLIB_PATH}\""
|
2012-11-19 13:32:58 +00:00
|
|
|
+ ])
|
2012-01-18 14:54:01 +00:00
|
|
|
pat=`echo "$RUBY_EXEC_PREFIX/" | tr -c '\012' .`'\(.*\)'
|
|
|
|
AS_CASE(["$RUBY_LIB_PREFIX"],
|
2012-11-19 13:32:58 +00:00
|
|
|
["$RUBY_EXEC_PREFIX/"*], [
|
2012-12-17 09:52:59 +00:00
|
|
|
@@ -3245,11 +3281,13 @@ 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-04-18 17:40:36 +00:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH} !<verconf>!)
|
|
|
|
+ AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, ${RUBY_SITE_ARCHLIB_PATH} !<verconf>!)
|
2012-01-18 14:54:01 +00:00
|
|
|
fi
|
|
|
|
if test "x$VENDOR_DIR" = xno; then
|
2012-04-18 17:40:36 +00:00
|
|
|
AC_DEFINE(NO_RUBY_VENDOR_LIB, [] !<verconf>!)
|
2012-01-18 14:54:01 +00:00
|
|
|
else
|
2012-04-18 17:40:36 +00:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH} !<verconf>!)
|
|
|
|
+ AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, ${RUBY_VENDOR_ARCHLIB_PATH} !<verconf>!)
|
2012-01-18 14:54:01 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(arch)dnl
|
2012-12-17 09:52:59 +00:00
|
|
|
@@ -3257,7 +3295,9 @@ AC_SUBST(sitearch)dnl
|
2012-01-18 14:54:01 +00:00
|
|
|
AC_SUBST(ruby_version)dnl
|
|
|
|
AC_SUBST(archdir)dnl
|
|
|
|
AC_SUBST(sitedir)dnl
|
|
|
|
+AC_SUBST(sitearchdir)dnl
|
|
|
|
AC_SUBST(vendordir)dnl
|
|
|
|
+AC_SUBST(vendorarchdir)dnl
|
|
|
|
|
|
|
|
configure_args=$ac_configure_args
|
|
|
|
AC_SUBST(configure_args)dnl
|
|
|
|
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
|
2012-11-19 13:32:58 +00:00
|
|
|
index 03c3332..79b8e44 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
|
|
|
@@ -44,6 +44,8 @@ continued_name = nil
|
2012-01-18 14:54:01 +00:00
|
|
|
continued_line = nil
|
|
|
|
path_version = "/$(ruby_version)"
|
|
|
|
archdir_override = "$(vendorlibdir)/$(sitearch)"
|
|
|
|
+sitearchdir_override = "$(sitelibdir)/$(sitearch)"
|
|
|
|
+vendorarchdir_override = "$(vendorlibdir)/$(sitearch)"
|
|
|
|
File.foreach "config.status" do |line|
|
|
|
|
next if /^#/ =~ line
|
|
|
|
name = nil
|
2012-12-10 15:22:43 +00:00
|
|
|
@@ -80,6 +82,8 @@ File.foreach "config.status" do |line|
|
2012-01-18 14:54:01 +00:00
|
|
|
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 /^sitearchdir$/; sitearchdir_override = val; next
|
|
|
|
+ when /^vendorarchdir$/; vendorarchdir_override = val; next
|
|
|
|
when /^sitearch/; val = '$(arch)' if val.empty?
|
|
|
|
end
|
|
|
|
case val
|
2012-12-10 15:22:43 +00:00
|
|
|
@@ -214,11 +218,11 @@ print <<EOS
|
2012-01-18 14:54:01 +00:00
|
|
|
EOS
|
|
|
|
print <<EOS unless v_disabled["sitedir"]
|
|
|
|
CONFIG["sitelibdir"] = "$(sitedir)#{path_version}"
|
|
|
|
- CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
|
|
|
|
+ CONFIG["sitearchdir"] = "#{sitearchdir_override}"
|
|
|
|
EOS
|
|
|
|
print <<EOS unless v_disabled["vendordir"]
|
|
|
|
CONFIG["vendorlibdir"] = "$(vendordir)#{path_version}"
|
|
|
|
- CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
|
|
|
|
+ CONFIG["vendorarchdir"] = "#{vendorarchdir_override}"
|
|
|
|
EOS
|
|
|
|
print <<EOS
|
|
|
|
CONFIG["topdir"] = File.dirname(__FILE__)
|
|
|
|
diff --git a/version.c b/version.c
|
2012-11-19 13:32:58 +00:00
|
|
|
index a117059..962f39f 100644
|
2012-01-18 14:54:01 +00:00
|
|
|
--- a/version.c
|
|
|
|
+++ b/version.c
|
2012-04-18 17:40:36 +00:00
|
|
|
@@ -51,8 +51,12 @@
|
2012-01-18 14:54:01 +00:00
|
|
|
#ifndef RUBY_ARCHLIB
|
|
|
|
#define RUBY_ARCHLIB RUBY_LIB "/"RUBY_ARCH
|
|
|
|
#endif
|
|
|
|
+#ifndef RUBY_SITE_ARCHLIB
|
|
|
|
#define RUBY_SITE_ARCHLIB RUBY_SITE_LIB2 "/"RUBY_SITEARCH
|
|
|
|
+#endif
|
|
|
|
+#ifndef RUBY_VENDOR_ARCHLIB
|
|
|
|
#define RUBY_VENDOR_ARCHLIB RUBY_VENDOR_LIB2 "/"RUBY_SITEARCH
|
|
|
|
+#endif
|
|
|
|
#ifdef RUBY_THINARCH
|
|
|
|
#define RUBY_THIN_ARCHLIB RUBY_LIB "/"RUBY_THINARCH
|
|
|
|
#define RUBY_SITE_THIN_ARCHLIB RUBY_SITE_LIB2 "/"RUBY_THINARCH
|
|
|
|
--
|
2012-11-19 13:32:58 +00:00
|
|
|
1.8.0
|
2012-01-18 14:54:01 +00:00
|
|
|
|