0001-Allow-to-disable-versioned-paths.patch

Vit Ondruch, 08/25/2011 09:53 PM

Download (3.55 KB)

View differences:

configure.in
2948 2948
fi
2949 2949
AC_SUBST(USE_RUBYGEMS)
2950 2950

  
2951
AC_ARG_ENABLE(versioned-paths,
2952
	AS_HELP_STRING([--disable-versioned-paths], [disable paths with version number]),
2953
	[enable_versioned_paths="$enableval"], [enable_versioned_paths=yes])
2954
if test x"$enable_versioned_paths" = xno; then
2955
    AC_DEFINE(DISABLE_VERSIONED_PATHS, 1)
2956
    USE_VERSIONED_PATHS=NO
2957
else
2958
    USE_VERSIONED_PATHS=YES
2959
fi
2960
AC_SUBST(USE_VERSIONED_PATHS)
2961

  
2951 2962
arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
2952 2963
AS_MKDIR_P("${arch_hdrdir}")
2953 2964
config_h="${arch_hdrdir}/config.h"
tool/mkconfig.rb
42 42
vars = {}
43 43
continued_name = nil
44 44
continued_line = nil
45
path_version = "/$(ruby_version)"
45 46
File.foreach "config.status" do |line|
46 47
  next if /^#/ =~ line
47 48
  name = nil
......
138 139
    case name
139 140
    when "ruby_version"
140 141
      version = val[/\A"(.*)"\z/, 1]
142
    when /^USE_VERSIONED_PATHS$/
143
      path_version = nil if /NO/ =~ val
141 144
    end
142 145
  end
143 146
#  break if /^CEOF/
......
203 206
print(*v_fast)
204 207
print(*v_others)
205 208
print <<EOS
206
  CONFIG["rubylibdir"] = "$(rubylibprefix)/$(ruby_version)"
209
  CONFIG["rubylibdir"] = "$(rubylibprefix)#{path_version}"
207 210
  CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
208 211
EOS
209 212
print <<EOS unless v_disabled["sitedir"]
210
  CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
213
  CONFIG["sitelibdir"] = "$(sitedir)#{path_version}"
211 214
  CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
212 215
EOS
213 216
print <<EOS unless v_disabled["vendordir"]
214
  CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
217
  CONFIG["vendorlibdir"] = "$(vendordir)#{path_version}"
215 218
  CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
216 219
EOS
217 220
print <<EOS
version.c
38 38
#define RUBY_VENDOR_LIB RUBY_LIB_PREFIX"/vendor_ruby"
39 39
#endif
40 40

  
41
#ifdef DISABLE_VERSIONED_PATHS
42
#define RUBY_LIB                    RUBY_LIB_PREFIX
43
#define RUBY_SITE_LIB2              RUBY_SITE_LIB
44
#define RUBY_VENDOR_LIB2            RUBY_VENDOR_LIB
45
#else
41 46
#define RUBY_LIB                    RUBY_LIB_PREFIX  "/"RUBY_LIB_VERSION
42 47
#define RUBY_SITE_LIB2              RUBY_SITE_LIB    "/"RUBY_LIB_VERSION
43 48
#define RUBY_VENDOR_LIB2            RUBY_VENDOR_LIB  "/"RUBY_LIB_VERSION
49
#endif
44 50
#define RUBY_ARCHLIB                RUBY_LIB         "/"RUBY_ARCH
45 51
#define RUBY_SITE_ARCHLIB           RUBY_SITE_LIB2   "/"RUBY_SITEARCH
46 52
#define RUBY_VENDOR_ARCHLIB         RUBY_VENDOR_LIB2 "/"RUBY_SITEARCH
......
70 76
    RUBY_SEARCH_PATH "\0"
71 77
#endif
72 78
#ifndef NO_RUBY_SITE_LIB
79
#ifndef DISABLE_VERSIONED_PATHS
73 80
    RUBY_SITE_LIB2 "\0"
81
#endif
74 82
#ifdef RUBY_SITE_THIN_ARCHLIB
75 83
    RUBY_SITE_THIN_ARCHLIB "\0"
76 84
#endif
......
79 87
#endif
80 88

  
81 89
#ifndef NO_RUBY_VENDOR_LIB
90
#ifndef DISABLE_VERSIONED_PATHS
82 91
    RUBY_VENDOR_LIB2 "\0"
92
#endif
83 93
#ifdef RUBY_VENDOR_THIN_ARCHLIB
84 94
    RUBY_VENDOR_THIN_ARCHLIB "\0"
85 95
#endif
86
-