* 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
This commit is contained in:
nobu 2005-02-22 14:52:59 +00:00
parent 21189400d6
commit 984f9a0df1
7 changed files with 72 additions and 20 deletions

View File

@ -1,3 +1,15 @@
Tue Feb 22 23:52:45 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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.
Tue Feb 22 23:51:45 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> Tue Feb 22 23:51:45 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/syck/rubyext.c: get rid of warnings caused by a bug of VC. * ext/syck/rubyext.c: get rid of warnings caused by a bug of VC.

View File

@ -368,7 +368,8 @@ s,@LIBARG@,%s.lib,;t t
s,@LINK_SO@,$$(LDSHARED) $$(DLDFLAGS) $$(LIBPATH) $$(OBJS), $$(@:/=\), nul, $$(LIBS) $$(LOCAL_LIBS), $$(DEFFILE), $$(RESFILE),;t t s,@LINK_SO@,$$(LDSHARED) $$(DLDFLAGS) $$(LIBPATH) $$(OBJS), $$(@:/=\), nul, $$(LIBS) $$(LOCAL_LIBS), $$(DEFFILE), $$(RESFILE),;t t
s,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c $$(<:/=\),;t t s,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c $$(<:/=\),;t t
s,@COMPILE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -P -c $$(<:/=\),;t t s,@COMPILE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -P -c $$(<:/=\),;t t
s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: .%s.%s:,;t t s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: {$$(topdir)}.%s{}.%s: {$$(hdrdir)}.%s{}.%s: .%s.%s:,;t t
s,@RULE_SUBST@,{.;$$(VPATH)}%s,;t t
s,@COMMON_LIBS@,m advapi32 avicap32 avifil32 cap comctl32 comdlg32 dlcapi gdi32 glu32 imagehlp imm32 inetmib1 kernel32 loadperf lsapi32 lz32 mapi32 mgmtapi mpr msacm32 msvfw32 nddeapi netapi32 ole32 oleaut32 oledlg olepro32 opengl32 pdh pkpd32 rasapi32 rasdlg rassapi rpcrt4 setupapi shell32 shfolder snmpapi sporder tapi32 url user32 vdmdbg version win32spl winmm wintrust wsock32,;t t s,@COMMON_LIBS@,m advapi32 avicap32 avifil32 cap comctl32 comdlg32 dlcapi gdi32 glu32 imagehlp imm32 inetmib1 kernel32 loadperf lsapi32 lz32 mapi32 mgmtapi mpr msacm32 msvfw32 nddeapi netapi32 ole32 oleaut32 oledlg olepro32 opengl32 pdh pkpd32 rasapi32 rasdlg rassapi rpcrt4 setupapi shell32 shfolder snmpapi sporder tapi32 url user32 vdmdbg version win32spl winmm wintrust wsock32,;t t
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t
s,@COMMON_HEADERS@,winsock2.h windows.h,;t t s,@COMMON_HEADERS@,winsock2.h windows.h,;t t

View File

@ -188,6 +188,13 @@ AC_AIX
AC_MINIX AC_MINIX
AC_SUBST(RM, ['rm -f']) AC_SUBST(RM, ['rm -f'])
AC_SUBST(CP, ['cp -v'])
AC_SUBST(INSTALL, ['install -vp'])
if $as_mkdir_p; then
AC_SUBST(MAKEDIRS, ['mkdir -p'])
else
AC_SUBST(MAKEDIRS, ['install -d'])
fi
dnl check for large file stuff dnl check for large file stuff
AC_SYS_LARGEFILE AC_SYS_LARGEFILE

View File

@ -877,10 +877,11 @@ ruby_version = #{Config::CONFIG['ruby_version']}
ruby = #{$ruby} ruby = #{$ruby}
RUBY = #{($nmake && !$extmk && !$configure_args.has_key?('--ruby')) ? '$(ruby:/=\)' : '$(ruby)'} RUBY = #{($nmake && !$extmk && !$configure_args.has_key?('--ruby')) ? '$(ruby:/=\)' : '$(ruby)'}
RM = #{config_string('RM') || '$(RUBY) -run -e rm -- -f'} RM = #{config_string('RM') || '$(RUBY) -run -e rm -- -f'}
MAKEDIRS = $(RUBY) -run -e mkdir -- -p MAKEDIRS = #{config_string('MAKEDIRS') || '$(RUBY) -run -e mkdir -- -p'}
INSTALL_PROG = $(RUBY) -run -e install -- -vpm 0755 INSTALL = #{config_string('INSTALL') || '$(RUBY) -run -e install -- -vp'}
INSTALL_DATA = $(RUBY) -run -e install -- -vpm 0644 INSTALL_PROG = $(INSTALL) -m 0755
COPY = $(RUBY) -run -e cp -- -v INSTALL_DATA = $(INSTALL) -m 0644
COPY = #{config_string('COPY') || '$(RUBY) -run -e cp -- -v'}
#### End of system configuration section. #### #### End of system configuration section. ####
@ -1078,28 +1079,56 @@ site-install-rb: install-rb
end end
depend = File.join(srcdir, "depend") depend = File.join(srcdir, "depend")
cont = rule = false
if File.exist?(depend) if File.exist?(depend)
open(depend, "r") do |dfile| open(depend, "r") do |dfile|
mfile.printf "###\n" mfile.printf "###\n"
while line = dfile.gets() cont = implicit = nil
line.gsub!(/\.o\b/, ".#{$OBJEXT}") impconv = proc do
line.gsub!(/\$\(hdrdir\)\/config.h/, $config_h) if $config_h COMPILE_RULES.each {|rule| mfile.print(rule % implicit[0], implicit[1])}
if $nmake implicit = nil
rule = /^[$\w][^#]*:/ =~ line unless cont end
cont = /(?:^|[^\\])(?:\\\\)*\\$/ =~ line ruleconv = proc do |line|
if rule if implicit
line.gsub!(%r"(?<=\s)(?!\.)(?=[^\s\/]+\.(?:#{(SRC_EXT + ['h']).join('|')})(?:\s|\z))"o, '{.;$(VPATH)}') if /\A\t/ =~ line
implicit[1] << line
next
else else
line.sub!(/^(\.\w+)(\.\w+)(?=\s*:)/, '{.;$(VPATH)}\1{}\2') impconv[]
end end
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 mfile.print line
end 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 end
else else
vpath = ($nmake ? "{$(hdrdir)}" : "") headers = %w[ruby.h defines.h]
mfile.print "$(OBJS): #{vpath}ruby.h #{vpath}defines.h #{$config_h}\n" 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 end
$makefile_created = true $makefile_created = true
@ -1202,6 +1231,7 @@ COMMON_HEADERS = (hdr.join("\n") unless hdr.empty?)
COMMON_LIBS = config_string('COMMON_LIBS', &split) || [] COMMON_LIBS = config_string('COMMON_LIBS', &split) || []
COMPILE_RULES = config_string('COMPILE_RULES', &split) || %w[.%s.%s:] 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_C = config_string('COMPILE_C') || '$(CC) $(CFLAGS) $(CPPFLAGS) -c $<'
COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<' COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<'
TRY_LINK = config_string('TRY_LINK') || TRY_LINK = config_string('TRY_LINK') ||

View File

@ -44,7 +44,7 @@ File.foreach "config.status" do |line|
elsif /^s[%,]@(\w+)@[%,](.*)[%,]/ =~ line elsif /^s[%,]@(\w+)@[%,](.*)[%,]/ =~ line
name = $1 name = $1
val = $2 || "" val = $2 || ""
next if /^(INSTALL|DEFS|configure_input|srcdir|top_srcdir)$/ =~ name next if /^(?:ac_.*|DEFS|configure_input|.*(?:src|build)dir)$/ =~ name
next if $install_name and /^RUBY_INSTALL_NAME$/ =~ name next if $install_name and /^RUBY_INSTALL_NAME$/ =~ name
next if $so_name and /^RUBY_SO_NAME$/ =~ name next if $so_name and /^RUBY_SO_NAME$/ =~ name
v = " CONFIG[\"" + name + "\"] = " + v = " CONFIG[\"" + name + "\"] = " +

View File

@ -363,7 +363,8 @@ s,@LIBARG@,%s.lib,;t t
s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) $$(DLDFLAGS),;t t s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) $$(DLDFLAGS),;t t
s,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;t t s,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;t t
s,@COMPILE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -c -Tp$$(<:\=/),;t t s,@COMPILE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -c -Tp$$(<:\=/),;t t
s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: .%s.%s:,;t t s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: {$$(topdir)}.%s{}.%s: {$$(hdrdir)}.%s{}.%s: .%s.%s:,;t t
s,@RULE_SUBST@,{.;$$(srcdir);$$(topdir);$$(hdrdir)}%s,;t t
s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) -link $$(LDFLAGS) $$(LIBPATH) $$(XLDFLAGS),;t t s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) -link $$(LDFLAGS) $$(LIBPATH) $$(XLDFLAGS),;t t
s,@COMMON_LIBS@,m,;t t s,@COMMON_LIBS@,m,;t t
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t

View File

@ -389,7 +389,8 @@ s,@LIBARG@,%s.lib,;t t
s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) $$(DLDFLAGS),;t t s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) $$(DLDFLAGS),;t t
s,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;t t s,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;t t
s,@COMPILE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -c -Tp$$(<:\=/),;t t s,@COMPILE_CXX@,$$(CXX) $$(CXXFLAGS) $$(CPPFLAGS) -c -Tp$$(<:\=/),;t t
s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: .%s.%s:,;t t s,@COMPILE_RULES@,{$$(srcdir)}.%s{}.%s: {$$(topdir)}.%s{}.%s: {$$(hdrdir)}.%s{}.%s: .%s.%s:,;t t
s,@RULE_SUBST@,{.;$$(srcdir);$$(topdir);$$(hdrdir)}%s,;t t
s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) -link $$(LDFLAGS) $$(LIBPATH) $$(XLDFLAGS),;t t s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) -link $$(LDFLAGS) $$(LIBPATH) $$(XLDFLAGS),;t t
s,@COMMON_LIBS@,coredll winsock,;t t s,@COMMON_LIBS@,coredll winsock,;t t
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t