diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-22 14:52:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-22 14:52:59 +0000 |
commit | 984f9a0df167c8f68832388b10c0d395a099d7a9 (patch) | |
tree | df2ac1f4ed4ba5cd77a5320c1a2858d689856173 /lib | |
parent | 21189400d60904d34ba756839c9129a731709c3c (diff) |
* configure.in, lib/mkmf.rb: use simple commands if available.
* mkconfig.rb: remove autoconf internal variables from rbconfig.rb.
* lib/mkmf.rb (create_makefile): substitute implicit rules in depend
file.
* {bcc32,win32,wince}/Makefile.sub (COMPILE_RULES, RULE_SUBST):
include $(topdir) and $(hdrdir) to search path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mkmf.rb | 62 |
1 files changed, 46 insertions, 16 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index c4c16c44ea..be4b897a6e 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -877,10 +877,11 @@ ruby_version = #{Config::CONFIG['ruby_version']} ruby = #{$ruby} RUBY = #{($nmake && !$extmk && !$configure_args.has_key?('--ruby')) ? '$(ruby:/=\)' : '$(ruby)'} RM = #{config_string('RM') || '$(RUBY) -run -e rm -- -f'} -MAKEDIRS = $(RUBY) -run -e mkdir -- -p -INSTALL_PROG = $(RUBY) -run -e install -- -vpm 0755 -INSTALL_DATA = $(RUBY) -run -e install -- -vpm 0644 -COPY = $(RUBY) -run -e cp -- -v +MAKEDIRS = #{config_string('MAKEDIRS') || '$(RUBY) -run -e mkdir -- -p'} +INSTALL = #{config_string('INSTALL') || '$(RUBY) -run -e install -- -vp'} +INSTALL_PROG = $(INSTALL) -m 0755 +INSTALL_DATA = $(INSTALL) -m 0644 +COPY = #{config_string('COPY') || '$(RUBY) -run -e cp -- -v'} #### End of system configuration section. #### @@ -1078,28 +1079,56 @@ site-install-rb: install-rb end depend = File.join(srcdir, "depend") - cont = rule = false if File.exist?(depend) open(depend, "r") do |dfile| mfile.printf "###\n" - while line = dfile.gets() - line.gsub!(/\.o\b/, ".#{$OBJEXT}") - line.gsub!(/\$\(hdrdir\)\/config.h/, $config_h) if $config_h - if $nmake - rule = /^[$\w][^#]*:/ =~ line unless cont - cont = /(?:^|[^\\])(?:\\\\)*\\$/ =~ line - if rule - line.gsub!(%r"(?<=\s)(?!\.)(?=[^\s\/]+\.(?:#{(SRC_EXT + ['h']).join('|')})(?:\s|\z))"o, '{.;$(VPATH)}') + cont = implicit = nil + impconv = proc do + COMPILE_RULES.each {|rule| mfile.print(rule % implicit[0], implicit[1])} + implicit = nil + end + ruleconv = proc do |line| + if implicit + if /\A\t/ =~ line + implicit[1] << line + next else - line.sub!(/^(\.\w+)(\.\w+)(?=\s*:)/, '{.;$(VPATH)}\1{}\2') + impconv[] end end + if /\A\.(\w+)\.(\w+)(?:\s*:)/ =~ line + implicit = [[$1, $2], [$']] + next + elsif RULE_SUBST and /\A[$\w][^#]*:/ =~ line + line.gsub!(%r"(?<=\A|\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {|*m| RULE_SUBST % m} + end mfile.print line end + while line = dfile.gets() + line.gsub!(/\.o\b/, ".#{$OBJEXT}") + line.gsub!(/\$\(hdrdir\)\/config.h/, $config_h) if $config_h + if /(?:^|[^\\])(?:\\\\)*\\$/ =~ line + (cont ||= []) << line + next + elsif cont + line = (cont << line).join + cont = nil + end + ruleconv.call(line) + end + if cont + ruleconv.call(cont.join) + elsif implicit + impconv.call + end end else - vpath = ($nmake ? "{$(hdrdir)}" : "") - mfile.print "$(OBJS): #{vpath}ruby.h #{vpath}defines.h #{$config_h}\n" + headers = %w[ruby.h defines.h] + if RULE_SUBST + headers.each {|h| h.sub!(/.*/) {|*m| RULE_SUBST % m}} + end + headers << $config_h if $config_h + mfile.print "$(OBJS): ", headers.join(' '), "\n" end $makefile_created = true @@ -1202,6 +1231,7 @@ COMMON_HEADERS = (hdr.join("\n") unless hdr.empty?) COMMON_LIBS = config_string('COMMON_LIBS', &split) || [] COMPILE_RULES = config_string('COMPILE_RULES', &split) || %w[.%s.%s:] +RULE_SUBST = config_string('RULE_SUBST') COMPILE_C = config_string('COMPILE_C') || '$(CC) $(CFLAGS) $(CPPFLAGS) -c $<' COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<' TRY_LINK = config_string('TRY_LINK') || |