Project

General

Profile

Feature #5281 ยป 0001-Added-configuration-flags-for-site-and-vendor-archit.patch

vo.x (Vit Ondruch), 09/06/2011 06:45 PM

View differences:

Makefile.in
arch = @arch@
sitearch = @sitearch@
sitedir = @sitedir@
sitearchdir= @sitearchdir@
vendordir = @vendordir@
vendorarchdir = @vendorarchdir@
ruby_version = @ruby_version@
TESTUI = console
configure.in
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,
AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]]]),
[vendordir=$withval],
......
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_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_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' .`'\(.*\)'
......
[
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\"`"'"'
......
[
RUBY_VENDOR_LIB_PATH="\"${RUBY_VENDOR_LIB_PATH}\""
])
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}\""
])
pat=`echo "$RUBY_EXEC_PREFIX/" | tr -c '\012' .`'\(.*\)'
AS_CASE(["$RUBY_LIB_PREFIX"],
["$RUBY_EXEC_PREFIX/"*], [
......
AC_DEFINE(NO_RUBY_SITE_LIB)
else
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH})
AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, ${RUBY_SITE_ARCHLIB_PATH})
fi
if test "x$VENDOR_DIR" = xno; then
AC_DEFINE(NO_RUBY_VENDOR_LIB)
else
AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH})
AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, ${RUBY_VENDOR_ARCHLIB_PATH})
fi
AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl
AC_SUBST(ruby_version)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
tool/mkconfig.rb
vars = {}
continued_name = nil
continued_line = nil
sitearchdir_override = "$(sitelibdir)/$(sitearch)"
vendorarchdir_override = "$(vendorlibdir)/$(sitearch)"
File.foreach "config.status" do |line|
next if /^#/ =~ line
name = nil
......
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 /^sitearchdir$/; sitearchdir_override = val; next
when /^vendorarchdir$/; vendorarchdir_override = val; next
when /^sitearch/; val = '$(arch)' if val.empty?
end
case val
......
EOS
print <<EOS unless v_disabled["sitedir"]
CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
CONFIG["sitearchdir"] = "#{sitearchdir_override}"
EOS
print <<EOS unless v_disabled["vendordir"]
CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
CONFIG["vendorarchdir"] = "#{vendorarchdir_override}"
EOS
print <<EOS
CONFIG["topdir"] = File.dirname(__FILE__)
version.c
#define RUBY_SITE_LIB2 RUBY_SITE_LIB "/"RUBY_LIB_VERSION
#define RUBY_VENDOR_LIB2 RUBY_VENDOR_LIB "/"RUBY_LIB_VERSION
#define RUBY_ARCHLIB RUBY_LIB "/"RUBY_ARCH
#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
    (1-1/1)