diff --git a/Makefile.in b/Makefile.in index 9c8dbced0f..2afea66b8b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -246,9 +246,6 @@ $(LIBRUBY_SO): @-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link rescue nil; \ File.symlink "$(LIBRUBY_SO)", link}' \ $(LIBRUBY_ALIASES) || true -$(arch)-fake.rb: config.status $(srcdir)/template/fake.rb.in - @./config.status --file=$@:$(srcdir)/template/fake.rb.in - @chmod +x $@ ruby_pc = @ruby_pc@ $(ruby_pc): diff --git a/common.mk b/common.mk index b84de9c519..7949e61f47 100644 --- a/common.mk +++ b/common.mk @@ -549,6 +549,11 @@ fake: $(CROSS_COMPILING)-fake yes-fake: $(arch)-fake.rb $(RBCONFIG) PHONY no-fake: PHONY +$(arch)-fake.rb: $(RBCONFIG) $(srcdir)/template/fake.rb.in $(srcdir)/tool/expand-config.rb rbconfig.rb + @$(BOOTSTRAPRUBY) $(srcdir)/tool/expand-config.rb \ + -output=$@ -mode=$(INSTALL_PROG_MODE) -expand -config=rbconfig.rb \ + srcdir="$(srcdir)" BASERUBY="$(BASERUBY)" $(srcdir)/template/fake.rb.in + btest: $(TEST_RUNNABLE)-btest no-btest: PHONY yes-btest: fake miniruby$(EXEEXT) PHONY diff --git a/template/fake.rb.in b/template/fake.rb.in index 8e461c57a4..0363b10e83 100644 --- a/template/fake.rb.in +++ b/template/fake.rb.in @@ -19,11 +19,7 @@ class Object RUBY_DESCRIPTION = "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]" end builddir = File.dirname(__FILE__) -top_srcdir = "@abs_top_srcdir@" -if /mingw/ =~ RUBY_PLATFORM - # convert MSYS path to Windows path - top_srcdir.sub!(/\A\/([a-z])\//, '\\1:/') -end +top_srcdir = File.join(builddir, "@srcdir@") $:.unshift(File.expand_path(builddir)) fake = File.join(top_srcdir, "tool/fake.rb") eval(File.read(fake), nil, fake) diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 7d0fbf1b1b..11bcee6e6f 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -1056,24 +1056,6 @@ $(RCFILES): $(RBCONFIG) $(srcdir)/revision.h $(srcdir)/win32/resource.rb -so_name=$(RUBY_SO_NAME) \ . $(icondirs) $(win_srcdir) -$(arch)-fake.rb: $(MKFILES) $(srcdir)/version.h - @echo Creating <<$@ -class Object - remove_const :CROSS_COMPILING if defined?(CROSS_COMPILING) - CROSS_COMPILING = RUBY_PLATFORM - remove_const :RUBY_PLATFORM - remove_const :RUBY_VERSION - remove_const :RUBY_DESCRIPTION if defined?(RUBY_DESCRIPTION) - RUBY_PLATFORM = "$(arch)" - RUBY_VERSION = $(RUBY_PROGRAM_VERSION) - RUBY_DESCRIPTION = "ruby #{RUBY_VERSION} (" $(RUBY_RELEASE_DATE) ") [#{RUBY_PLATFORM}]" -end -class File - remove_const :ALT_SEPARATOR - ALT_SEPARATOR = "\\" -end -<