e$B$J$+$@$G$9!#e(B
At Wed, 16 Aug 2006 11:58:39 +0900,
Minero A. wrote in [ruby-dev:29272]:
e$B4pK\E*$K$OF~$l$k$Y$-$@$H;W$&$s$G$9$,!"$A$g$C$H$"$^$j$K%j%j!<%9e(B
e$B@#A0$9$.$k$N$G!":#2s$O8+Aw$j$^$7$g$&!#$3$3$GJQ$J$3$H$d$C$Fe(B
make install e$B$9$iDL$i$J$$$H$+$$$&;vBV$O@dBP$KHr$1$?$$$G$9$+$i!#e(B
e$B:#2s$NOC$Oe(B 1.8.5 e$B%j%j!<%98e$KBP1~$7$?$$$H;W$$$^$9!#e(B
e$B$3$N7o$O$I$&$7$^$7$g$&$+!#e(B
EXTOUTe$B$r;H$&>l9g$Oe(Bextmk.rbe$B$h$j$be(Binstruby.rbe$B$GA4It:Q$^$;$?$[$&$,e(B
e$B2?$+$HET9g$,$$$$$N$G!"=hM}$r0\F0$7$?$$$H;W$$$^$9!#$D$$$G$K!“e(B
make
uninstalle$B$7$?$$$H$$$&OC$be(B([ruby-talk:213908]e$B$H$+e(B)e$B$H$-$*$je(B
e$B8+$+$1$k$N$G!”$$$C$7$g$KBP1~$7$F$_$^$7$?!#e(B
Index: Makefile.in
RCS file: /cvs/ruby/src/ruby/Makefile.in,v
retrieving revision 1.55.2.16
diff -p -u -2 -r1.55.2.16 Makefile.in
— Makefile.in 8 Sep 2006 19:48:52 -0000 1.55.2.16
+++ Makefile.in 15 Sep 2006 06:26:29 -0000
@@ -86,5 +86,5 @@ OBJEXT = @OBJEXT@
MANTYPE = @MANTYPE@
-PREINSTALL = @PREINSTALL@
+INSTALLED_LIST= .installed.list
End of variables
Index: common.mk
RCS file: /cvs/ruby/src/ruby/common.mk,v
retrieving revision 1.13.2.10
diff -p -u -2 -r1.13.2.10 common.mk
— common.mk 2 Sep 2006 04:26:40 -0000 1.13.2.10
+++ common.mk 15 Sep 2006 09:42:52 -0000
@@ -54,8 +54,10 @@ OBJS = array.$(OBJEXT) \
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
-EXTMK_ARGS = $(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension $(EXTS)
–extstatic $(EXTSTATIC) –
+EXTMK_ARGS = $(SCRIPT_ARGS) --extension $(EXTS) --extstatic
$(EXTSTATIC) –
+INSTRUBY_ARGS = $(SCRIPT_ARGS) --installed-list $(INSTALLED_LIST)
all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
@@ -81,44 +83,141 @@ install: install-nodoc $(RDOCTARGET)
install-all: install-nodoc install-doc
-install-nodoc: install-local install-ext
+install-nodoc: pre-install-nodoc do-install-nodoc post-install-nodoc
+pre-install-nodoc:: pre-install-local pre-install-ext
+do-install-nodoc:
- $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS)
–mantype="$(MANTYPE)"
+post-install-nodoc:: post-install-local post-install-ext
-
install-local: pre-install-local do-install-local post-install-local
-install-ext: pre-install-ext do-install-ext post-install-ext
+pre-install-local:: pre-install-bin pre-install-lib pre-install-man
+do-install-local:
- $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=local
–mantype="$(MANTYPE)"
+post-install-local:: post-install-bin post-install-lib post-install-man
-do-install-local: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS)
–mantype="$(MANTYPE)"
-do-install-ext: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) install
-
-install-bin: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=bin
-install-lib: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=lib
-install-man: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --install=man
–mantype="$(MANTYPE)"
+install-ext: pre-install-ext do-install-ext post-install-ext
+pre-install-ext:: pre-install-ext-arch pre-install-ext-comm
+do-install-ext:
- $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=ext
+post-install-ext:: post-install-ext-arch post-install-ext-comm
-
+install-arch: pre-install-arch do-install-arch post-install-arch
+pre-install-arch:: pre-install-bin pre-install-ext-arch
+do-install-arch:
- $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=bin
–install=ext-arch
+post-install-arch:: post-install-bin post-install-ext-arch
-
+install-comm: pre-install-comm do-install-comm post-install-comm
+pre-install-comm:: pre-install-lib pre-install-ext-comm pre-install-man
+do-install-comm:
- $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=lib
–install=ext-comm --install=man
+post-install-comm:: post-install-lib post-install-ext-comm
post-install-man
-
+install-bin: pre-install-bin do-install-bin post-install-bin
+pre-install-bin:: install-prereq
+do-install-bin:
- $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=bin
+post-install-bin::
-
+install-lib: pre-install-lib do-install-lib post-install-lib
+pre-install-lib:: install-prereq
+do-install-lib:
- $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=lib
+post-install-lib::
-
+install-ext-comm: pre-install-ext-comm do-install-ext-comm
post-install-ext-comm
+pre-install-ext-comm:: install-prereq
+do-install-ext-comm:
- $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=ext-comm
+post-install-ext-comm::
-
+install-ext-arch: pre-install-ext-arch do-install-ext-arch
post-install-ext-arch
+pre-install-ext-arch:: install-prereq
+do-install-ext-arch:
- $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=ext-arch
+post-install-ext-arch::
-
+install-man: pre-install-man do-install-man post-install-man
+pre-install-man:: install-prereq
+do-install-man:
- $(MINIRUBY) $(srcdir)/instruby.rb $(INSTRUBY_ARGS) --install=man
–mantype="$(MANTYPE)"
+post-install-man::
-
+what-where: no-install
+no-install: no-install-nodoc $(RDOCTARGET)
+what-where-all: no-install-all
+no-install-all: no-install-nodoc
+
+what-where-nodoc: no-install-nodoc
+no-install-nodoc: pre-no-install-nodoc dont-install-nodoc
post-no-install-nodoc
+pre-no-install-nodoc:: pre-no-install-local pre-no-install-ext
+dont-install-nodoc:
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS)
–mantype="$(MANTYPE)"
+post-no-install-nodoc:: post-no-install-local post-no-install-ext
-what-where-all no-install-all: no-install no-install-doc
-what-where no-install: no-install-local no-install-ext
what-where-local: no-install-local
-no-install-local: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(SCRIPT_ARGS)
–mantype="$(MANTYPE)"
+no-install-local: pre-no-install-local dont-install-local
post-no-install-local
+pre-no-install-local:: pre-no-install-bin pre-no-install-lib
pre-no-install-man
+dont-install-local:
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=local
–mantype="$(MANTYPE)"
+post-no-install-local:: post-no-install-bin post-no-install-lib
post-no-install-man
-
what-where-ext: no-install-ext
-no-install-ext: $(RBCONFIG)
- $(MINIRUBY) $(srcdir)/ext/extmk.rb -n $(EXTMK_ARGS) install
+no-install-ext: pre-no-install-ext dont-install-ext post-no-install-ext
+pre-no-install-ext:: pre-no-install-ext-arch pre-no-install-ext-comm
+dont-install-ext:
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=ext
+post-no-install-ext:: post-no-install-ext-arch post-no-install-ext-comm
-
+what-where-arch: no-install-arch
+no-install-arch: pre-no-install-arch dont-install-arch
post-no-install-arch
+pre-no-install-arch:: pre-no-install-bin pre-no-install-ext-arch
+dont-install-arch:
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=bin
–install=ext-arch
+post-no-install-arch:: post-no-install-lib post-no-install-man
post-no-install-ext-arch
-
+what-where-comm: no-install-comm
+no-install-comm: pre-no-install-comm dont-install-comm
post-no-install-comm
+pre-no-install-comm:: pre-no-install-lib pre-no-install-ext-comm
pre-no-install-man
+dont-install-comm:
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=lib
–install=ext-comm --install=man
+post-no-install-comm:: post-no-install-lib post-no-install-ext-comm
post-no-install-man
-
+what-where-bin: no-install-bin
+no-install-bin: pre-no-install-bin dont-install-bin post-no-install-bin
+pre-no-install-bin:: install-prereq
+dont-install-bin:
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=bin
+post-no-install-bin::
-
+what-where-lib: no-install-lib
+no-install-lib: pre-no-install-lib dont-install-lib post-no-install-lib
+pre-no-install-lib:: install-prereq
+dont-install-lib:
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=lib
+post-no-install-lib::
-
+what-where-ext-comm: no-install-ext-comm
+no-install-ext-comm: pre-no-install-ext-comm dont-install-ext-comm
post-no-install-ext-comm
+pre-no-install-ext-comm:: install-prereq
+dont-install-ext-comm:
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS)
–install=ext-comm
+post-no-install-ext-comm::
-
+what-where-ext-arch: no-install-ext-arch
+no-install-ext-arch: pre-no-install-ext-arch dont-install-ext-arch
post-no-install-ext-arch
+pre-no-install-ext-arch:: install-prereq
+dont-install-ext-arch:
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS)
–install=ext-arch
+post-no-install-ext-arch::
-
+what-where-man: no-install-man
+no-install-man: pre-no-install-man dont-install-man post-no-install-man
+pre-no-install-man:: install-prereq
+dont-install-man:
- $(MINIRUBY) $(srcdir)/instruby.rb -n $(INSTRUBY_ARGS) --install=man
–mantype="$(MANTYPE)"
+post-no-install-man::
-install-doc: pre-install-doc do-install-doc post-install-doc
-do-install-doc: $(PROGRAM)
-
@echo Generating RDoc documentation
- $(RUNRUBY) “$(srcdir)/bin/rdoc” --all --ri --op “$(RIDATADIR)”
“$(srcdir)”
-
-pre-install: pre-install-local pre-install-ext
-pre-install-local:: PHONY
- $(PREINSTALL)
-pre-install-ext:: PHONY
-pre-install-doc:: PHONY
-
-post-install: post-install-local post-install-ext
-post-install-local:: PHONY
-post-install-ext:: PHONY
-post-install-doc:: PHONY
+install-prereq:
-
@exit > $(INSTALLED_LIST)
clean: clean-ext clean-local
Index: instruby.rb
RCS file: /cvs/ruby/src/ruby/instruby.rb,v
retrieving revision 1.59.2.7
diff -p -u -2 -r1.59.2.7 instruby.rb
— instruby.rb 24 Feb 2006 03:12:27 -0000 1.59.2.7
+++ instruby.rb 15 Sep 2006 09:40:32 -0000
@@ -18,10 +18,14 @@ def parse_args()
$mantype = ‘doc’
$destdir = nil
- $extout = nil
$make = ‘make’
$mflags = []
$install = []
- $installed_list = nil
- $dryrun = false
opt = OptionParser.new
opt.on(’-n’) {$dryrun = true}
opt.on(’–dest-dir=DIR’) {|dir| $destdir = dir}
- opt.on(’–extout=DIR’) {|dir| $extout = (dir unless dir.empty?)}
opt.on(’–make=COMMAND’) {|make| $make = make}
opt.on(’–mantype=MAN’) {|man| $mantype = man}
@@ -32,5 +36,9 @@ def parse_args()
$mflags.concat(v)
end
- opt.on(’–install=TYPE’, [:bin, :lib, :man]) {|ins| $install << ins}
- opt.on(’-i’, ‘–install=TYPE’,
-
[:local, :bin, :lib, :man, :ext, :"ext-arch", :"ext-comm"]) do
|ins|
- $install << ins
- end
- opt.on(’–installed-list [FILENAME]’) {|name| $installed_list = name}
opt.parse! rescue abort [$!.message, opt].join("\n")
@@ -42,4 +50,8 @@ def parse_args()
false
end
-
def $mflags.defined?(var)
-
grep(/\A#{var}=(.*)/) {return $1}
-
false
-
end
if $mflags.set?(?n)
@@ -49,7 +61,14 @@ def parse_args()
end
- $mflags << “DESTDIR=#{$destdir}”
-
$destdir ||= $mflags.defined?(“DESTDIR”)
-
$extout ||= $mflags.defined?(“EXTOUT”)
$continue = $mflags.set?(?k)
-
-
if $installed_list ||= $mflags.defined?(‘INSTALLED_LIST’)
-
Config.expand($installed_list, Config::CONFIG)
-
$installed_list = open($installed_list, “ab”)
-
$installed_list.sync = true
-
end
end
@@ -61,6 +80,6 @@ include FileUtils::NoWrite if $dryrun
@fileutils_label = ‘’
-def install?(type)
- yield if $install.empty? or $install.include?(type)
+def install?(*types)
- yield if $install.empty? or !($install & types).empty?
end
@@ -68,4 +87,13 @@ def install(src, dest, options = {})
options[:preserve] = true
super
- if $installed_list
- dest = File.join(dest, File.basename(src)) if $made_dirs[dest]
- $installed_list.puts dest
- end
+end
-
+def ln_sf(src, dest)
- super
- $installed_list.puts dest if $installed_list
end
@@ -109,5 +137,5 @@ arc = CONFIG[“LIBRUBY_A”]
makedirs [bindir, libdir, rubylibdir, archlibdir, sitelibdir,
sitearchlibdir]
-install?(:bin) do
+install?(:local, :arch, :bin) do
ruby_bin = File.join(bindir, ruby_install_name)
@@ -145,7 +173,38 @@ install?(:bin) do
end
+if $extout
- RbConfig.expand(extout = “#$extout”)
- if noinst = CONFIG[“no_install_files”] and noinst.empty?
- noinst = nil
- end
- dest = rubylibdir
- subpath = nil
- copy = proc do |s|
- d = dest + s[subpath]
- if File.directory?(s)
-
makedirs(d)
- else
-
install s, d
- end
- end
- install?(:ext, :arch, :‘ext-arch’) do
- subpath = extout.size…-1
- Dir.glob("#{extout}/#{CONFIG[‘arch’]}/**/*", File::FNM_DOTMATCH) do
|src|
-
unless /\A\.{1,2}\z/ =~ (base = File.basename(src)) or
-
(noinst and File.fnmatch?(noinst, File.basename(src)))
-
copy[src]
-
end
- end
- end
- install?(:ext, :comm, :‘ext-comm’) do
- src = “#{extout}/common”
- subpath = src.size…-1
- Dir.glob("#{src}/**/*", File::FNM_DOTMATCH, ©)
- end
+end
-
Dir.chdir srcdir
-install?(:lib) do
+install?(:local, :arch, :lib) do
ruby_shebang = File.join(CONFIG[“bindir”], ruby_install_name)
if File::ALT_SEPARATOR
@@ -178,6 +237,6 @@ for src in Dir[“bin/*”]
if ruby_bin_dosish
batfile = File.join(CONFIG[“bindir”], name + “.bat”)
-
open(with_destdir(batfile), "wb") { |b|
-
b.print((<<EOH+shebang+body+<<EOF).gsub(/$/, "\r"))
@echo off
if not “%~d0” == “~d0” goto WinNT
@@ -202,5 +261,5 @@ end
end
-install?(:bin) do
+install?(:local, :arch, :bin) do
for f in Dir["*.h"]
install f, archlibdir, :mode => 0644
@@ -213,5 +272,5 @@ end
end
-install?(:man) do
+install?(:local, :comm, :man) do
for mdoc in Dir["*.[1-9]"]
next unless File.file?(mdoc) and open(mdoc){|fh| fh.read(1) == ‘.’}
Index: ext/extmk.rb
RCS file: /cvs/ruby/src/ruby/ext/extmk.rb,v
retrieving revision 1.44.2.31
diff -p -u -2 -r1.44.2.31 extmk.rb
— ext/extmk.rb 8 Sep 2006 19:55:03 -0000 1.44.2.31
+++ ext/extmk.rb 15 Sep 2006 06:27:52 -0000
@@ -391,14 +391,6 @@ end
if $extout
- Config.expand(extout = “#$extout”,
Config::CONFIG.merge(“topdir”=>$topdir))
FileUtils.mkpath(extout)
end
Index: lib/mkmf.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/mkmf.rb,v
retrieving revision 1.162.2.63
diff -p -u -2 -r1.162.2.63 mkmf.rb
— lib/mkmf.rb 9 Sep 2006 09:02:29 -0000 1.162.2.63
+++ lib/mkmf.rb 15 Sep 2006 06:32:56 -0000
@@ -84,6 +84,6 @@ def install_dirs(target_prefix = nil)
if $extout
dirs = [
-
['RUBYCOMMONDIR', '$(extout)'],
-
['RUBYLIBDIR', '$(extout)$(target_prefix)'],
-
['RUBYCOMMONDIR', '$(extout)/common'],
-
['RUBYLIBDIR', '$(RUBYCOMMONDIR)/$(target_prefix)'],
['RUBYARCHDIR', '$(extout)/$(arch)$(target_prefix)'],
['extout', "#$extout"],
@@ -1216,5 +1216,5 @@ DLLIB = #{dllib}
EXTSTATIC = #{$static || “”}
STATIC_LIB = #{staticlib unless $static.nil?}
+#{!$extout && defined?($installed_list) ? “INSTALLED_LIST =
#{$installed_list}\n” : “”}
}
install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if
/^[[:upper:]]/ =~ d[0]}
@@ -1249,4 +1249,7 @@ static: $(STATIC_LIB)#{$extout ? " inst
end
mfile.print “\t$(INSTALL_PROG) #{f} #{dir}\n”