Skip to content

Commit

Permalink
* ext/extmk.rb, enc/make_encmake.rb: load current mkmf.rb even if
Browse files Browse the repository at this point in the history
  cross-compiling.

* ext/extmk.rb, enc/make_encmake.rb, lib/mkmf.rb: need to be 1.8
  compatible for cross-compiling.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Feb 26, 2008
1 parent 99e8314 commit 9d014dc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 25 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Wed Feb 27 03:55:58 2008 Nobuyoshi Nakada <[email protected]>

* 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 <[email protected]>

* misc/ruby-mode.el (ruby-calculate-indent): should distinguish
Expand Down
4 changes: 2 additions & 2 deletions enc/make_encmake.rb
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
43 changes: 24 additions & 19 deletions ext/extmk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@
$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)
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -337,18 +338,22 @@ def $mflags.defined?(var)

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)}

Expand Down Expand Up @@ -398,12 +403,12 @@ def $mflags.defined?(var)
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)
Expand Down Expand Up @@ -550,7 +555,7 @@ def initialize(src)
end
end
$mflags.unshift("topdir=#$topdir")
ENV["RUBYOPT"] = ''
ENV.delete("RUBYOPT")
system($make, *sysquote($mflags)) or exit($?.exitstatus)

#Local variables:
Expand Down
2 changes: 1 addition & 1 deletion lib/mkmf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions version.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#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
#define RUBY_VERSION_MINOR 9
#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[];
Expand Down

0 comments on commit 9d014dc

Please sign in to comment.