mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
mkconfig.rb: without fake.rb
* tool/mkconfig.rb: use arguments instead of built-in constants to work without fake.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e9f3a59e85
commit
6268830ba8
4 changed files with 20 additions and 13 deletions
|
@ -254,6 +254,8 @@ ruby_pc = @ruby_pc@
|
||||||
$(ruby_pc):
|
$(ruby_pc):
|
||||||
@./config.status --file=$@:$(srcdir)/template/ruby.pc.in
|
@./config.status --file=$@:$(srcdir)/template/ruby.pc.in
|
||||||
|
|
||||||
|
$(RBCONFIG): $($(CROSS_COMPILING:no=)PREP)
|
||||||
|
|
||||||
install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/config.h \
|
install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/config.h \
|
||||||
$(LIBRUBY_A) $(LIBRUBY_SO) $(ARCHFILE)
|
$(LIBRUBY_A) $(LIBRUBY_SO) $(ARCHFILE)
|
||||||
$(ECHO) installing cross-compiling stuff
|
$(ECHO) installing cross-compiling stuff
|
||||||
|
|
|
@ -588,8 +588,9 @@ extconf: $(PREP)
|
||||||
$(Q) $(MAKEDIRS) "$(EXTCONFDIR)"
|
$(Q) $(MAKEDIRS) "$(EXTCONFDIR)"
|
||||||
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
|
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
|
||||||
|
|
||||||
$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h $(PREP)
|
$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h
|
||||||
$(Q)$(MINIRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
|
$(Q)$(BOOTSTRAPRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
|
||||||
|
-arch=$(arch) -version=$(ruby_version) \
|
||||||
-install_name=$(RUBY_INSTALL_NAME) \
|
-install_name=$(RUBY_INSTALL_NAME) \
|
||||||
-so_name=$(RUBY_SO_NAME) rbconfig.rb
|
-so_name=$(RUBY_SO_NAME) rbconfig.rb
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
# avoid warnings with -d.
|
# avoid warnings with -d.
|
||||||
$install_name ||= nil
|
$install_name ||= nil
|
||||||
$so_name ||= nil
|
$so_name ||= nil
|
||||||
|
arch = $arch or raise "missing -arch"
|
||||||
|
version = $version or raise "missing -version"
|
||||||
|
|
||||||
srcdir = File.expand_path('../..', __FILE__)
|
srcdir = File.expand_path('../..', __FILE__)
|
||||||
$:.replace [srcdir+"/lib"] unless defined?(CROSS_COMPILING)
|
$:.replace [srcdir+"/lib"] unless defined?(CROSS_COMPILING)
|
||||||
|
@ -16,7 +18,6 @@ unless File.directory?(dir = File.dirname(rbconfig_rb))
|
||||||
FileUtils.makedirs(dir, :verbose => true)
|
FileUtils.makedirs(dir, :verbose => true)
|
||||||
end
|
end
|
||||||
|
|
||||||
version = RUBY_VERSION
|
|
||||||
config = ""
|
config = ""
|
||||||
def config.write(arg)
|
def config.write(arg)
|
||||||
concat(arg.to_s)
|
concat(arg.to_s)
|
||||||
|
@ -24,17 +25,7 @@ end
|
||||||
$stdout = config
|
$stdout = config
|
||||||
|
|
||||||
fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
|
fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
|
||||||
print %[
|
|
||||||
# This file was created by #{mkconfig} when ruby was built. Any
|
|
||||||
# changes made to this file will be lost the next time ruby is built.
|
|
||||||
|
|
||||||
module RbConfig
|
|
||||||
RUBY_VERSION.start_with?("#{version}"[/^[0-9]+[.][0-9]+[.]/]) or
|
|
||||||
raise "ruby lib version (#{version}) doesn't match executable version (\#{RUBY_VERSION})"
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
arch = RUBY_PLATFORM
|
|
||||||
win32 = /mswin/ =~ arch
|
win32 = /mswin/ =~ arch
|
||||||
universal = /universal.*darwin/ =~ arch
|
universal = /universal.*darwin/ =~ arch
|
||||||
v_fast = []
|
v_fast = []
|
||||||
|
@ -175,6 +166,15 @@ end
|
||||||
prefix = vars.expand(vars["prefix"] ||= "")
|
prefix = vars.expand(vars["prefix"] ||= "")
|
||||||
rubyarchdir = vars.expand(vars["rubyarchdir"] ||= "")
|
rubyarchdir = vars.expand(vars["rubyarchdir"] ||= "")
|
||||||
relative_archdir = rubyarchdir.rindex(prefix, 0) ? rubyarchdir[prefix.size..-1] : rubyarchdir
|
relative_archdir = rubyarchdir.rindex(prefix, 0) ? rubyarchdir[prefix.size..-1] : rubyarchdir
|
||||||
|
puts %[\
|
||||||
|
# This file was created by #{mkconfig} when ruby was built. Any
|
||||||
|
# changes made to this file will be lost the next time ruby is built.
|
||||||
|
|
||||||
|
module RbConfig
|
||||||
|
RUBY_VERSION.start_with?("#{version}"[/^[0-9]+[.][0-9]+[.]/]) or
|
||||||
|
raise "ruby lib version (#{version}) doesn't match executable version (\#{RUBY_VERSION})"
|
||||||
|
|
||||||
|
]
|
||||||
print " TOPDIR = File.dirname(__FILE__).chomp!(#{relative_archdir.dump})\n"
|
print " TOPDIR = File.dirname(__FILE__).chomp!(#{relative_archdir.dump})\n"
|
||||||
print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"
|
print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"
|
||||||
print <<'ARCH' if universal
|
print <<'ARCH' if universal
|
||||||
|
|
|
@ -1045,6 +1045,10 @@ clean-enc distclean-enc realclean-enc:
|
||||||
@-$(MAKE) -f $(ENC_MK) $(MFLAGS) V=$(V) $(@:-enc=)
|
@-$(MAKE) -f $(ENC_MK) $(MFLAGS) V=$(V) $(@:-enc=)
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
!if "$(CROSS_COMPILING)" == "no"
|
||||||
|
$(RBCONFIG): $(PREP)
|
||||||
|
!endif
|
||||||
|
|
||||||
$(RCFILES): $(RBCONFIG) $(srcdir)/revision.h $(srcdir)/win32/resource.rb
|
$(RCFILES): $(RBCONFIG) $(srcdir)/revision.h $(srcdir)/win32/resource.rb
|
||||||
@$(MINIRUBY) $(srcdir)/win32/resource.rb \
|
@$(MINIRUBY) $(srcdir)/win32/resource.rb \
|
||||||
-ruby_name=$(RUBY_INSTALL_NAME) \
|
-ruby_name=$(RUBY_INSTALL_NAME) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue