mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* Makefile.in, win32/Makefile.sub (MINIRUBY): append MINIRUBYOPT.
* mkconfig.rb, ext/extmk.rb, lib/mkmf.rb, win32/mkexports.rb: suppress warnings with $VERBOSE. * win32/resource.rb: only file which has more than one icon is DLL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
82f7f29c59
commit
f594f850a4
8 changed files with 58 additions and 30 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
Sat Sep 9 04:47:45 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* Makefile.in, win32/Makefile.sub (MINIRUBY): append MINIRUBYOPT.
|
||||||
|
|
||||||
|
* mkconfig.rb, ext/extmk.rb, lib/mkmf.rb, win32/mkexports.rb: suppress
|
||||||
|
warnings with $VERBOSE.
|
||||||
|
|
||||||
|
* win32/resource.rb: only file which has more than one icon is DLL.
|
||||||
|
|
||||||
Fri Sep 8 16:53:30 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Fri Sep 8 16:53:30 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* string.c (str_alloc): should allocate a String object, even when
|
* string.c (str_alloc): should allocate a String object, even when
|
||||||
|
|
|
@ -33,8 +33,8 @@ RIDATADIR = $(DESTDIR)$(datadir)/ri/$(MAJOR).$(MINOR)/system
|
||||||
|
|
||||||
empty =
|
empty =
|
||||||
OUTFLAG = @OUTFLAG@$(empty)
|
OUTFLAG = @OUTFLAG@$(empty)
|
||||||
CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@
|
CFLAGS = @CFLAGS@ @ARCH_FLAG@
|
||||||
XCFLAGS = -I. -I$(srcdir)
|
XCFLAGS = -I. -I$(srcdir) @XCFLAGS@
|
||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
|
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
|
||||||
EXTLDFLAGS =
|
EXTLDFLAGS =
|
||||||
|
@ -53,7 +53,7 @@ RUBY_SO_NAME=@RUBY_SO_NAME@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
||||||
RUBY = $(RUBY_INSTALL_NAME)
|
RUBY = $(RUBY_INSTALL_NAME)
|
||||||
MINIRUBY = @MINIRUBY@
|
MINIRUBY = @MINIRUBY@ $(MINIRUBYOPT)
|
||||||
RUNRUBY = @RUNRUBY@
|
RUNRUBY = @RUNRUBY@
|
||||||
|
|
||||||
#### End of system configuration section. ####
|
#### End of system configuration section. ####
|
||||||
|
|
43
ext/extmk.rb
43
ext/extmk.rb
|
@ -1,13 +1,19 @@
|
||||||
#! /usr/local/bin/ruby
|
#! /usr/local/bin/ruby
|
||||||
# -*- ruby -*-
|
# -*- ruby -*-
|
||||||
|
|
||||||
|
$extension = nil
|
||||||
|
$extstatic = nil
|
||||||
$force_static = nil
|
$force_static = nil
|
||||||
$install = nil
|
$install = nil
|
||||||
$destdir = nil
|
$destdir = nil
|
||||||
|
$dryrun = false
|
||||||
$clean = nil
|
$clean = nil
|
||||||
$nodynamic = nil
|
$nodynamic = nil
|
||||||
$extinit = nil
|
$extinit = nil
|
||||||
$extobjs = nil
|
$extobjs = nil
|
||||||
|
$extflags = ""
|
||||||
|
$extlibs = nil
|
||||||
|
$extpath = nil
|
||||||
$ignore = nil
|
$ignore = nil
|
||||||
$message = nil
|
$message = nil
|
||||||
|
|
||||||
|
@ -79,6 +85,8 @@ def extract_makefile(makefile, keep = true)
|
||||||
s.sub!(/ *#{Regexp.quote($LIBS)}$/, "")
|
s.sub!(/ *#{Regexp.quote($LIBS)}$/, "")
|
||||||
$libs = s
|
$libs = s
|
||||||
end
|
end
|
||||||
|
$objs = (m[/^OBJS[ \t]*=[ \t](.*)/, 1] || "").split
|
||||||
|
$srcs = (m[/^SRCS[ \t]*=[ \t](.*)/, 1] || "").split
|
||||||
$LOCAL_LIBS = m[/^LOCAL_LIBS[ \t]*=[ \t]*(.*)/, 1] || ""
|
$LOCAL_LIBS = m[/^LOCAL_LIBS[ \t]*=[ \t]*(.*)/, 1] || ""
|
||||||
$LIBPATH = Shellwords.shellwords(m[/^libpath[ \t]*=[ \t]*(.*)/, 1] || "") - %w[$(libdir) $(topdir)]
|
$LIBPATH = Shellwords.shellwords(m[/^libpath[ \t]*=[ \t]*(.*)/, 1] || "") - %w[$(libdir) $(topdir)]
|
||||||
true
|
true
|
||||||
|
@ -113,6 +121,8 @@ def extmake(target)
|
||||||
$mdir = target
|
$mdir = target
|
||||||
$srcdir = File.join($top_srcdir, "ext", $mdir)
|
$srcdir = File.join($top_srcdir, "ext", $mdir)
|
||||||
$preload = nil
|
$preload = nil
|
||||||
|
$objs = ""
|
||||||
|
$srcs = ""
|
||||||
$compiled[target] = false
|
$compiled[target] = false
|
||||||
makefile = "./Makefile"
|
makefile = "./Makefile"
|
||||||
ok = File.exist?(makefile)
|
ok = File.exist?(makefile)
|
||||||
|
@ -128,7 +138,7 @@ def extmake(target)
|
||||||
ok &&= extract_makefile(makefile)
|
ok &&= extract_makefile(makefile)
|
||||||
if (($extconf_h && !File.exist?($extconf_h)) ||
|
if (($extconf_h && !File.exist?($extconf_h)) ||
|
||||||
!(t = modified?(makefile, MTIMES)) ||
|
!(t = modified?(makefile, MTIMES)) ||
|
||||||
%W"#{$srcdir}/makefile.rb #{$srcdir}/extconf.rb #{$srcdir}/depend".any? {|f| modified?(f, [t])})
|
["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb", "#{$srcdir}/depend"].any? {|f| modified?(f, [t])})
|
||||||
then
|
then
|
||||||
ok = false
|
ok = false
|
||||||
init_mkmf
|
init_mkmf
|
||||||
|
@ -155,7 +165,7 @@ def extmake(target)
|
||||||
ok = yield(ok) if block_given?
|
ok = yield(ok) if block_given?
|
||||||
unless ok
|
unless ok
|
||||||
open(makefile, "w") do |f|
|
open(makefile, "w") do |f|
|
||||||
f.print *dummy_makefile(CONFIG["srcdir"])
|
f.print(*dummy_makefile(CONFIG["srcdir"]))
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -420,9 +430,13 @@ if $ignore
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
if $extlist.size > 0
|
$extinit ||= ""
|
||||||
$extinit ||= ""
|
$extobjs ||= ""
|
||||||
$extobjs ||= ""
|
$extpath ||= []
|
||||||
|
$extflags ||= ""
|
||||||
|
$extlibs ||= []
|
||||||
|
unless $extlist.empty?
|
||||||
|
$extinit << "\n" unless $extinit.empty?
|
||||||
list = $extlist.dup
|
list = $extlist.dup
|
||||||
built = []
|
built = []
|
||||||
while e = list.shift
|
while e = list.shift
|
||||||
|
@ -436,16 +450,23 @@ if $extlist.size > 0
|
||||||
end
|
end
|
||||||
f = format("%s/%s.%s", s, i, $LIBEXT)
|
f = format("%s/%s.%s", s, i, $LIBEXT)
|
||||||
if File.exist?(f)
|
if File.exist?(f)
|
||||||
$extinit += "\tinit(Init_#{i}, \"#{t}.so\");\n"
|
$extinit << " init(Init_#{i}, \"#{t}.so\");\n"
|
||||||
$extobjs += "ext/#{f} "
|
$extobjs << "ext/#{f} "
|
||||||
built << t
|
built << t
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
src = %{\
|
src = %{\
|
||||||
extern char *ruby_sourcefile, *rb_source_filename();
|
#include "ruby.h"
|
||||||
#define init(func, name) (ruby_sourcefile = src = rb_source_filename(name), func(), rb_provide(src))
|
|
||||||
void Init_ext() {\n\tchar* src;\n#$extinit}
|
#define init(func, name) { \
|
||||||
|
void func _((void)); \
|
||||||
|
ruby_sourcefile = src = rb_source_filename(name); \
|
||||||
|
func(); \
|
||||||
|
rb_provide(src); \
|
||||||
|
}
|
||||||
|
|
||||||
|
void Init_ext _((void))\n{\n char *src;#$extinit}
|
||||||
}
|
}
|
||||||
if !modified?(extinit.c, MTIMES) || IO.read(extinit.c) != src
|
if !modified?(extinit.c, MTIMES) || IO.read(extinit.c) != src
|
||||||
open(extinit.c, "w") {|f| f.print src}
|
open(extinit.c, "w") {|f| f.print src}
|
||||||
|
@ -464,7 +485,7 @@ void Init_ext() {\n\tchar* src;\n#$extinit}
|
||||||
].map {|n, v|
|
].map {|n, v|
|
||||||
"#{n}=#{v}" if v and !(v = v.strip).empty?
|
"#{n}=#{v}" if v and !(v = v.strip).empty?
|
||||||
}.compact
|
}.compact
|
||||||
puts conf
|
puts(*conf)
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
$mflags.concat(conf)
|
$mflags.concat(conf)
|
||||||
else
|
else
|
||||||
|
|
|
@ -1172,6 +1172,7 @@ def create_makefile(target, srcprefix = nil)
|
||||||
elsif !(srcs = $srcs)
|
elsif !(srcs = $srcs)
|
||||||
srcs = $objs.collect {|obj| obj.sub(/\.o\z/, '.c')}
|
srcs = $objs.collect {|obj| obj.sub(/\.o\z/, '.c')}
|
||||||
end
|
end
|
||||||
|
$srcs = srcs
|
||||||
for i in $objs
|
for i in $objs
|
||||||
i.sub!(/\.o\z/, ".#{$OBJEXT}")
|
i.sub!(/\.o\z/, ".#{$OBJEXT}")
|
||||||
end
|
end
|
||||||
|
@ -1205,7 +1206,7 @@ def create_makefile(target, srcprefix = nil)
|
||||||
dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
|
dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
|
||||||
staticlib = target ? "$(TARGET).#$LIBEXT" : ""
|
staticlib = target ? "$(TARGET).#$LIBEXT" : ""
|
||||||
mfile = open("Makefile", "wb")
|
mfile = open("Makefile", "wb")
|
||||||
mfile.print *configuration(srcprefix)
|
mfile.print(*configuration(srcprefix))
|
||||||
mfile.print %{
|
mfile.print %{
|
||||||
libpath = #{$LIBPATH.join(" ")}
|
libpath = #{$LIBPATH.join(" ")}
|
||||||
LIBPATH = #{libpath}
|
LIBPATH = #{libpath}
|
||||||
|
@ -1390,7 +1391,7 @@ site-install-rb: install-rb
|
||||||
unless suffixes.empty?
|
unless suffixes.empty?
|
||||||
mfile.print ".SUFFIXES: .", suffixes.uniq.join(" ."), "\n\n"
|
mfile.print ".SUFFIXES: .", suffixes.uniq.join(" ."), "\n\n"
|
||||||
end
|
end
|
||||||
mfile.print *depout.flatten
|
mfile.print(*depout.flatten)
|
||||||
else
|
else
|
||||||
headers = %w[ruby.h defines.h]
|
headers = %w[ruby.h defines.h]
|
||||||
if RULE_SUBST
|
if RULE_SUBST
|
||||||
|
|
|
@ -41,7 +41,7 @@ File.foreach "config.status" do |line|
|
||||||
if /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/ =~ line
|
if /^s([%,])@(\w+)@\1(?:\|\#_!!_\#\|)?(.*)\1/ =~ line
|
||||||
name = $2
|
name = $2
|
||||||
val = $3.gsub(/\\(?=,)/, '')
|
val = $3.gsub(/\\(?=,)/, '')
|
||||||
next if /^(?:ac_.*|DEFS|configure_input)$/ =~ name
|
next if /^(?:ac_.*|DEFS|configure_input|(?:top_)?srcdir)$/ =~ name
|
||||||
next if /^\$\(ac_\w+\)$/ =~ val
|
next if /^\$\(ac_\w+\)$/ =~ val
|
||||||
next if /^\$\{ac_\w+\}$/ =~ val
|
next if /^\$\{ac_\w+\}$/ =~ val
|
||||||
next if /^\$ac_\w+$/ =~ val
|
next if /^\$ac_\w+$/ =~ val
|
||||||
|
@ -106,8 +106,8 @@ if $so_name
|
||||||
v_fast << " CONFIG[\"RUBY_SO_NAME\"] = \"" + $so_name + "\"\n"
|
v_fast << " CONFIG[\"RUBY_SO_NAME\"] = \"" + $so_name + "\"\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
print *v_fast
|
print(*v_fast)
|
||||||
print *v_others
|
print(*v_others)
|
||||||
print <<EOS
|
print <<EOS
|
||||||
CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
|
CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)"
|
||||||
CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
|
CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)"
|
||||||
|
|
|
@ -166,7 +166,7 @@ EXEEXT = .exe
|
||||||
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
|
||||||
WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
|
WPROGRAM=$(RUBYW_INSTALL_NAME)$(EXEEXT)
|
||||||
RUBYDEF = $(RUBY_SO_NAME).def
|
RUBYDEF = $(RUBY_SO_NAME).def
|
||||||
MINIRUBY = .\miniruby$(EXEEXT)
|
MINIRUBY = .\miniruby$(EXEEXT) $(MINIRUBYOPT)
|
||||||
RUNRUBY = .\ruby$(EXEEXT) "$(srcdir)/runruby.rb" --extout="$(EXTOUT)" --
|
RUNRUBY = .\ruby$(EXEEXT) "$(srcdir)/runruby.rb" --extout="$(EXTOUT)" --
|
||||||
|
|
||||||
!if !defined(STACK)
|
!if !defined(STACK)
|
||||||
|
@ -211,9 +211,6 @@ config.status: $(CONFIG_H)
|
||||||
|
|
||||||
$(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
|
$(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
|
||||||
@echo Creating config.h
|
@echo Creating config.h
|
||||||
!if exist(config.h)
|
|
||||||
@copy config.h config.h.old > nul
|
|
||||||
!endif
|
|
||||||
@$(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat config.h <<
|
@$(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat config.h <<
|
||||||
#if _MSC_VER != $(MSC_VER)
|
#if _MSC_VER != $(MSC_VER)
|
||||||
#error MSC version unmatch
|
#error MSC version unmatch
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!./miniruby -s
|
#!./miniruby -s
|
||||||
|
|
||||||
|
$name = $library = $description = nil
|
||||||
|
|
||||||
module RbConfig
|
module RbConfig
|
||||||
autoload :CONFIG, "rbconfig"
|
autoload :CONFIG, "rbconfig"
|
||||||
end
|
end
|
||||||
|
@ -130,5 +132,5 @@ end
|
||||||
|
|
||||||
END {
|
END {
|
||||||
exports = Exports.extract(ARGV)
|
exports = Exports.extract(ARGV)
|
||||||
Exports.output {|f| f.puts exports}
|
Exports.output {|f| f.puts(*exports)}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,16 +29,14 @@ else
|
||||||
end
|
end
|
||||||
|
|
||||||
ruby_icon = rubyw_icon = nil
|
ruby_icon = rubyw_icon = nil
|
||||||
[$ruby_name, 'ruby'].each do |i|
|
[$ruby_name, 'ruby'].find do |i|
|
||||||
if i = icons[i]
|
if i = icons[i]
|
||||||
ruby_icon = "1 ICON DISCARDABLE "+i.dump+"\n"
|
ruby_icon = "1 ICON DISCARDABLE "+i.dump+"\n"
|
||||||
break
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
[$rubyw_name, 'rubyw'].each do |i|
|
[$rubyw_name, 'rubyw'].find do |i|
|
||||||
if i = icons[i]
|
if i = icons[i]
|
||||||
rubyw_icon = "1 ICON DISCARDABLE "+i.dump+"\n"
|
rubyw_icon = "1 ICON DISCARDABLE "+i.dump+"\n"
|
||||||
break
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
dll_icons = []
|
dll_icons = []
|
||||||
|
@ -49,7 +47,7 @@ end
|
||||||
[ # base name extension file type desc, icons
|
[ # base name extension file type desc, icons
|
||||||
[$ruby_name, CONFIG["EXEEXT"], 'VFT_APP', 'CUI', ruby_icon],
|
[$ruby_name, CONFIG["EXEEXT"], 'VFT_APP', 'CUI', ruby_icon],
|
||||||
[$rubyw_name, CONFIG["EXEEXT"], 'VFT_APP', 'GUI', rubyw_icon || ruby_icon],
|
[$rubyw_name, CONFIG["EXEEXT"], 'VFT_APP', 'GUI', rubyw_icon || ruby_icon],
|
||||||
[$so_name, '.dll', 'VFT_DLL', 'DLL', dll_icons],
|
[$so_name, '.dll', 'VFT_DLL', 'DLL', dll_icons.join],
|
||||||
].each do |base, ext, type, desc, icons|
|
].each do |base, ext, type, desc, icons|
|
||||||
open(base + '.rc', "w") { |f|
|
open(base + '.rc', "w") { |f|
|
||||||
f.binmode if /mingw/ =~ RUBY_PLATFORM
|
f.binmode if /mingw/ =~ RUBY_PLATFORM
|
||||||
|
@ -60,7 +58,7 @@ end
|
||||||
#include <winver.h>
|
#include <winver.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#{icons ? icons.join : ''}
|
#{icons || ''}
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION #{fversion}
|
FILEVERSION #{fversion}
|
||||||
PRODUCTVERSION #{fversion}
|
PRODUCTVERSION #{fversion}
|
||||||
|
|
Loading…
Reference in a new issue