diff --git a/ChangeLog b/ChangeLog index 8892fd512a..167b32f034 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Feb 27 03:55:58 2008 Nobuyoshi Nakada + + * ext/extmk.rb, enc/make_encmake.rb: load current mkmf.rb even if + cross-compiling. + + * ext/extmk.rb, enc/make_encmake.rb, lib/mkmf.rb: need to be 1.8 + compatible for cross-compiling. + Tue Feb 26 16:53:13 2008 Yukihiro Matsumoto * misc/ruby-mode.el (ruby-calculate-indent): should distinguish diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb index d491b28d6e..e36723294d 100644 --- a/enc/make_encmake.rb +++ b/enc/make_encmake.rb @@ -1,10 +1,10 @@ #! ./miniruby dir = File.expand_path("../..", __FILE__) -$:.unshift(File.join(dir, "lib")) $:.unshift(dir) $:.unshift(".") -require 'mkmf' +$" << "mkmf.rb" +load File.expand_path("lib/mkmf.rb", dir) require 'erb' if /--builtin-encs=/ =~ ARGV[0] diff --git a/ext/extmk.rb b/ext/extmk.rb index a91e3e1104..667aad0573 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -24,17 +24,18 @@ alias $0 $progname $extlist = [] $compiled = {} -$:.replace([Dir.pwd]) -require 'rbconfig' - srcdir = File.dirname(File.dirname(__FILE__)) - -$:.unshift(srcdir, File.expand_path("lib", srcdir)) +unless defined?(CROSS_COMPILING) and CROSS_COMPILING + $:.replace([File.expand_path("lib", srcdir), Dir.pwd]) +end +$:.unshift(srcdir) +require 'rbconfig' $topdir = "." $top_srcdir = srcdir -require 'mkmf' +$" << "mkmf.rb" +load File.expand_path("lib/mkmf.rb", srcdir) require 'optparse/shellwords' def sysquote(x) @@ -60,7 +61,7 @@ def extract_makefile(makefile, keep = true) unless installrb.empty? config = CONFIG.dup install_dirs(target_prefix).each {|var, val| config[var] = val} - FileUtils.rm_f(installrb.values.collect {|f| RbConfig.expand(f, config)}, verbose: true) + FileUtils.rm_f(installrb.values.collect {|f| RbConfig.expand(f, config)}, :verbose => true) end end return false @@ -287,7 +288,7 @@ def parse_args() $mflags.unshift(*rest) unless rest.empty? def $mflags.set?(flag) - grep(/\A-(?!-).*#{'%s' % flag}/i) { return true } + grep(/\A-(?!-).*#{flag.chr}/i) { return true } false end def $mflags.defined?(var) @@ -337,18 +338,22 @@ end EXEEXT = CONFIG['EXEEXT'] if CROSS_COMPILING - $ruby = CONFIG['MINIRUBY'] + $ruby = $mflags.defined?("MINIRUBY") || CONFIG['MINIRUBY'] elsif sep = config_string('BUILD_FILE_SEPARATOR') $ruby = "$(topdir:/=#{sep})#{sep}miniruby" + EXEEXT else $ruby = '$(topdir)/miniruby' + EXEEXT end -$ruby << " -I'$(topdir)' -I'$(top_srcdir)/lib'" -$ruby << " -I'$(extout)/$(arch)' -I'$(extout)/common'" if $extout -$ruby << " -I'$(top_srcdir)/ext' -rpurelib.rb" +$ruby << " -I'$(topdir)'" +unless CROSS_COMPILING + $ruby << " -I'$(top_srcdir)/lib'" + $ruby << " -I'$(extout)/$(arch)' -I'$(extout)/common'" if $extout + $ruby << " -I'$(top_srcdir)/ext' -rpurelib.rb" + ENV["RUBYLIB"] = "-" + ENV["RUBYOPT"] = "-rpurelib.rb" +end $config_h = '$(arch_hdrdir)/ruby/config.h' -ENV["RUBYLIB"] = "-" -ENV["RUBYOPT"] = "-rpurelib.rb" +$mflags << "ruby=#$ruby" MTIMES = [__FILE__, 'rbconfig.rb', srcdir+'/lib/mkmf.rb'].collect {|f| File.mtime(f)} @@ -398,12 +403,12 @@ else elsif (w = w.grep(String)).empty? proc {true} else - w.collect {|o| o.split(/,/)}.flatten.method(:any?) + proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)} end } - cond = proc {|ext| - cond1 = proc {|n| File.fnmatch(n, ext, File::FNM_PATHNAME)} - withes.call(&cond1) or !withouts.call(&cond1) + cond = proc {|ext, *| + cond1 = proc {|n| File.fnmatch(n, ext)} + withes.call(cond1) or !withouts.call(cond1) } exts |= Dir.glob("#{ext_prefix}/*/**/extconf.rb").collect {|d| d = File.dirname(d) @@ -550,7 +555,7 @@ if $nmake == ?b end end $mflags.unshift("topdir=#$topdir") -ENV["RUBYOPT"] = '' +ENV.delete("RUBYOPT") system($make, *sysquote($mflags)) or exit($?.exitstatus) #Local variables: diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 45bf90872d..6a3e9d194e 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1316,7 +1316,7 @@ def depend_rules(depend) implicit = [[m[1], m[2]], [m.post_match]] next elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line - line.gsub!(%r"(?<=\s)(?![./\\])([^$(){}+=:\s,]+)(?=\s|\z)", &RULE_SUBST.method(:%)) + line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2} end depout << line end diff --git a/version.h b/version.h index 33ef1b63d2..79d97827ee 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2008-02-26" +#define RUBY_RELEASE_DATE "2008-02-27" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20080226 +#define RUBY_RELEASE_CODE 20080227 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 2 -#define RUBY_RELEASE_DAY 26 +#define RUBY_RELEASE_DAY 27 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[];