1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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>
* 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,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -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_MACROS@,WIN32_LEAN_AND_MEAN;t t
s,@COMMON_HEADERS@,winsock2.h windows.h,;t t

View file

@ -188,6 +188,13 @@ AC_AIX
AC_MINIX
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
AC_SYS_LARGEFILE

View file

@ -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') ||

View file

@ -44,7 +44,7 @@ File.foreach "config.status" do |line|
elsif /^s[%,]@(\w+)@[%,](.*)[%,]/ =~ line
name = $1
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 $so_name and /^RUBY_SO_NAME$/ =~ 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,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;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,@COMMON_LIBS@,m,;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,@COMPILE_C@,$$(CC) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;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,@COMMON_LIBS@,coredll winsock,;t t
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t