0001-Added-configuration-flags-for-site-and-vendor-archit.patch

Vit Ondruch, 09/06/2011 06:45 PM

Download (6.97 KB)

View differences:

Makefile.in
33 33
arch = @arch@
34 34
sitearch = @sitearch@
35 35
sitedir = @sitedir@
36
sitearchdir= @sitearchdir@
37
vendordir = @vendordir@
38
vendorarchdir = @vendorarchdir@
36 39
ruby_version = @ruby_version@
37 40

  
38 41
TESTUI = console
configure.in
2796 2796
    dir="${SITE_DIR}"
2797 2797
done
2798 2798

  
2799
AC_ARG_WITH(sitearchdir,
2800
	    AS_HELP_STRING([--with-sitearchdir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]]]),
2801
            [sitearchdir=$withval],
2802
            [sitearchdir='${rubylibprefix}/site_ruby/${arch}'])
2803
dir="${sitearchdir}"
2804
until SITEARCH_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${SITEARCH_DIR}"; do
2805
    dir="${SITEARCH_DIR}"
2806
done
2807

  
2799 2808
AC_ARG_WITH(vendordir,
2800 2809
	    AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]]]),
2801 2810
            [vendordir=$withval],
......
2805 2814
    dir="${VENDOR_DIR}"
2806 2815
done
2807 2816

  
2817
AC_ARG_WITH(vendorarchdir,
2818
	    AS_HELP_STRING([--with-vendorarchdir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]]]),
2819
            [vendorarchdir=$withval],
2820
            [vendorarchdir='${rubylibprefix}/vendor_ruby/${arch}'])
2821
dir="${vendorarchdir}"
2822
until VENDORARCH_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDORARCH_DIR}"; do
2823
    dir="${VENDORARCH_DIR}"
2824
done
2825

  
2808 2826
if test "${LOAD_RELATIVE+set}"; then
2809 2827
    AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
2810 2828
    RUBY_EXEC_PREFIX=""
2811 2829
    RUBY_LIB_PREFIX="`eval echo "$RUBY_LIB_PREFIX" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
2812 2830
    RUBY_SITE_LIB_PATH="`eval echo "$SITE_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
2831
    RUBY_SITE_ARCHLIB_PATH="`eval echo "$SITEARCH_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
2813 2832
    RUBY_VENDOR_LIB_PATH="`eval echo "$VENDOR_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
2833
    RUBY_VENDOR_ARCHLIB_PATH="`eval echo "$VENDORARCH_DIR" | sed 's|^NONE/|/|;s|^'"$prefix"'/|/|'`"
2814 2834
else
2815 2835
    RUBY_EXEC_PREFIX="`eval echo \\"$exec_prefix/\\" | sed 's|^NONE/|'"$prefix"'/|;s|/$||'`"
2816 2836
    RUBY_LIB_PREFIX="`eval echo \\"$RUBY_LIB_PREFIX\\" | sed 's|^NONE/|'"$prefix"'/|'`"
2817 2837
    RUBY_SITE_LIB_PATH="`eval echo \\"$SITE_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
2838
    RUBY_SITE_ARCHLIB_PATH="`eval echo \\"$SITEARCH_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
2818 2839
    RUBY_VENDOR_LIB_PATH="`eval echo \\"$VENDOR_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
2840
    RUBY_VENDOR_ARCHLIB_PATH="`eval echo \\"$VENDORARCH_DIR\\" | sed 's|^NONE/|'"$prefix"'/|'`"
2819 2841
fi
2820 2842

  
2821 2843
pat=`echo "$RUBY_LIB_PREFIX/" | tr -c '\012' .`'\(.*\)'
......
2826 2848
  [
2827 2849
    RUBY_SITE_LIB_PATH="\"${RUBY_SITE_LIB_PATH}\""
2828 2850
    ])
2851
AS_CASE(["$RUBY_SITE_ARCHLIB_PATH"],
2852
  ["$RUBY_LIB_PREFIX/"*], [
2853
    RUBY_SITE_ARCHLIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_SITE_ARCHLIB_PATH\" : \"$pat\"`"'"'
2854
    ],
2855
  [
2856
    RUBY_SITE_ARCHLIB_PATH="\"${RUBY_SITE_ARCHLIB_PATH}\""
2857
    ])
2829 2858
AS_CASE(["$RUBY_VENDOR_LIB_PATH"],
2830 2859
  ["$RUBY_LIB_PREFIX/"*], [
2831 2860
    RUBY_VENDOR_LIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_VENDOR_LIB_PATH\" : \"$pat\"`"'"'
......
2833 2862
  [
2834 2863
    RUBY_VENDOR_LIB_PATH="\"${RUBY_VENDOR_LIB_PATH}\""
2835 2864
    ])
2865
AS_CASE(["$RUBY_VENDOR_ARCHLIB_PATH"],
2866
  ["$RUBY_LIB_PREFIX/"*], [
2867
    RUBY_VENDOR_ARCHLIB_PATH='RUBY_LIB_PREFIX"/'"`expr \"$RUBY_VENDOR_ARCHLIB_PATH\" : \"$pat\"`"'"'
2868
    ],
2869
  [
2870
    RUBY_VENDOR_ARCHLIB_PATH="\"${RUBY_VENDOR_ARCHLIB_PATH}\""
2871
    ])
2836 2872
pat=`echo "$RUBY_EXEC_PREFIX/" | tr -c '\012' .`'\(.*\)'
2837 2873
AS_CASE(["$RUBY_LIB_PREFIX"],
2838 2874
  ["$RUBY_EXEC_PREFIX/"*], [
......
2853 2889
    AC_DEFINE(NO_RUBY_SITE_LIB)
2854 2890
else
2855 2891
    AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH})
2892
    AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, ${RUBY_SITE_ARCHLIB_PATH})
2856 2893
fi
2857 2894
if test "x$VENDOR_DIR" = xno; then
2858 2895
    AC_DEFINE(NO_RUBY_VENDOR_LIB)
2859 2896
else
2860 2897
    AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH})
2898
    AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, ${RUBY_VENDOR_ARCHLIB_PATH})
2861 2899
fi
2862 2900

  
2863 2901
AC_SUBST(arch)dnl
2864 2902
AC_SUBST(sitearch)dnl
2865 2903
AC_SUBST(ruby_version)dnl
2866 2904
AC_SUBST(sitedir)dnl
2905
AC_SUBST(sitearchdir)dnl
2867 2906
AC_SUBST(vendordir)dnl
2907
AC_SUBST(vendorarchdir)dnl
2868 2908

  
2869 2909
configure_args=$ac_configure_args
2870 2910
AC_SUBST(configure_args)dnl
tool/mkconfig.rb
42 42
vars = {}
43 43
continued_name = nil
44 44
continued_line = nil
45
sitearchdir_override = "$(sitelibdir)/$(sitearch)"
46
vendorarchdir_override = "$(vendorlibdir)/$(sitearch)"
45 47
File.foreach "config.status" do |line|
46 48
  next if /^#/ =~ line
47 49
  name = nil
......
76 78
    when /^RUBY_INSTALL_NAME$/; next if $install_name
77 79
    when /^RUBY_SO_NAME$/; next if $so_name
78 80
    when /^arch$/; if val.empty? then val = arch else arch = val end
81
    when /^sitearchdir$/; sitearchdir_override = val; next
82
    when /^vendorarchdir$/; vendorarchdir_override = val; next
79 83
    when /^sitearch/; val = '$(arch)' if val.empty?
80 84
    end
81 85
    case val
......
208 212
EOS
209 213
print <<EOS unless v_disabled["sitedir"]
210 214
  CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
211
  CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
215
  CONFIG["sitearchdir"] = "#{sitearchdir_override}"
212 216
EOS
213 217
print <<EOS unless v_disabled["vendordir"]
214 218
  CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
215
  CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
219
  CONFIG["vendorarchdir"] = "#{vendorarchdir_override}"
216 220
EOS
217 221
print <<EOS
218 222
  CONFIG["topdir"] = File.dirname(__FILE__)
version.c
42 42
#define RUBY_SITE_LIB2              RUBY_SITE_LIB    "/"RUBY_LIB_VERSION
43 43
#define RUBY_VENDOR_LIB2            RUBY_VENDOR_LIB  "/"RUBY_LIB_VERSION
44 44
#define RUBY_ARCHLIB                RUBY_LIB         "/"RUBY_ARCH
45
#ifndef RUBY_SITE_ARCHLIB
45 46
#define RUBY_SITE_ARCHLIB           RUBY_SITE_LIB2   "/"RUBY_SITEARCH
47
#endif
48
#ifndef RUBY_VENDOR_ARCHLIB
46 49
#define RUBY_VENDOR_ARCHLIB         RUBY_VENDOR_LIB2 "/"RUBY_SITEARCH
50
#endif
47 51
#ifdef  RUBY_THINARCH
48 52
#define RUBY_THIN_ARCHLIB           RUBY_LIB         "/"RUBY_THINARCH
49 53
#define RUBY_SITE_THIN_ARCHLIB      RUBY_SITE_LIB2   "/"RUBY_THINARCH
50
-