Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 356 lines (298 sloc) 8.649 kB
80bec90 matz
matz authored
1 #!./miniruby
a2af08d This commit was generated by cvs2svn to compensate for changes in r372,
matz authored
2
80bec90 matz
matz authored
3 load "./rbconfig.rb"
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
4 include RbConfig
986c389 Initial revision
matz authored
5
97975b5 @unak * instruby.rb, rubytest.rb (srcdir): no longer embed srcdir into
unak authored
6 srcdir = File.dirname(__FILE__)
e58338f @nobu * instruby.rb: expand source library path.
nobu authored
7 $:.unshift File.expand_path("lib", srcdir)
0b0a6aa @nobu * instruby.rb: check only `-' option, and use fileutils instead of
nobu authored
8 require 'fileutils'
9 require 'shellwords'
71d5fc5 @nobu * Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,
nobu authored
10 require 'optparse'
11 require 'optparse/shellwords'
6c80c88 @knu * configure.in (MANTYPE): Detect if the system's nroff(1) groks
knu authored
12 require 'tempfile'
0b0a6aa @nobu * instruby.rb: check only `-' option, and use fileutils instead of
nobu authored
13
71d5fc5 @nobu * Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,
nobu authored
14 STDOUT.sync = true
e399e0b * lib/fileutils.rb: use hashes to pass options.
aamine authored
15 File.umask(0)
0b178b8 @nobu * instruby.rb: add dryrun mode.
nobu authored
16
f010320 @knu * instruby.rb, ext/extmk.rb, Makefile.in, win32/Makefile.sub,
knu authored
17 def parse_args()
71d5fc5 @nobu * Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,
nobu authored
18 $mantype = 'doc'
19 $destdir = nil
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
20 $extout = nil
71d5fc5 @nobu * Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,
nobu authored
21 $make = 'make'
22 $mflags = []
23 $install = []
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
24 $installed_list = nil
25 $dryrun = false
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
26 $rdocdir = nil
71d5fc5 @nobu * Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,
nobu authored
27 opt = OptionParser.new
28 opt.on('-n') {$dryrun = true}
29 opt.on('--dest-dir=DIR') {|dir| $destdir = dir}
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
30 opt.on('--extout=DIR') {|dir| $extout = (dir unless dir.empty?)}
71d5fc5 @nobu * Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,
nobu authored
31 opt.on('--make=COMMAND') {|make| $make = make}
32 opt.on('--mantype=MAN') {|man| $mantype = man}
33 opt.on('--make-flags=FLAGS', '--mflags', Shellwords) do |v|
34 if arg = v.first
35 arg.insert(0, '-') if /\A[^-][^=]*\Z/ =~ arg
36 end
37 $mflags.concat(v)
7a865f0 @knu * instruby.rb (parse_args), ext/extmk.rb (parse_args): Prepend a
knu authored
38 end
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
39 opt.on('-i', '--install=TYPE',
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
40 [:local, :bin, :lib, :man, :ext, :"ext-arch", :"ext-comm", :rdoc]) do |ins|
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
41 $install << ins
42 end
43 opt.on('--installed-list [FILENAME]') {|name| $installed_list = name}
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
44 opt.on('--rdoc-output [DIR]') {|dir| $rdocdir = dir}
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
45
71d5fc5 @nobu * Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,
nobu authored
46 opt.parse! rescue abort [$!.message, opt].join("\n")
7a865f0 @knu * instruby.rb (parse_args), ext/extmk.rb (parse_args): Prepend a
knu authored
47
f010320 @knu * instruby.rb, ext/extmk.rb, Makefile.in, win32/Makefile.sub,
knu authored
48 $make, *rest = Shellwords.shellwords($make)
49 $mflags.unshift(*rest) unless rest.empty?
50
9a6862f @knu * instruby.rb (parse_args), ext/extmk.rb (parse_args): Detect -n
knu authored
51 def $mflags.set?(flag)
7a865f0 @knu * instruby.rb (parse_args), ext/extmk.rb (parse_args): Prepend a
knu authored
52 grep(/\A-(?!-).*#{'%c' % flag}/i) { return true }
53 false
9a6862f @knu * instruby.rb (parse_args), ext/extmk.rb (parse_args): Detect -n
knu authored
54 end
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
55 def $mflags.defined?(var)
56 grep(/\A#{var}=(.*)/) {return $1}
57 false
58 end
9a6862f @knu * instruby.rb (parse_args), ext/extmk.rb (parse_args): Detect -n
knu authored
59
60 if $mflags.set?(?n)
61 $dryrun = true
62 else
63 $mflags << '-n' if $dryrun
64 end
f010320 @knu * instruby.rb, ext/extmk.rb, Makefile.in, win32/Makefile.sub,
knu authored
65
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
66 $destdir ||= $mflags.defined?("DESTDIR")
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
67 if $extout ||= $mflags.defined?("EXTOUT")
68 Config.expand($extout)
69 end
f010320 @knu * instruby.rb, ext/extmk.rb, Makefile.in, win32/Makefile.sub,
knu authored
70
9a6862f @knu * instruby.rb (parse_args), ext/extmk.rb (parse_args): Detect -n
knu authored
71 $continue = $mflags.set?(?k)
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
72
73 if $installed_list ||= $mflags.defined?('INSTALLED_LIST')
74 Config.expand($installed_list, Config::CONFIG)
75 $installed_list = open($installed_list, "ab")
76 $installed_list.sync = true
77 end
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
78
79 $rdocdir ||= $mflags.defined?('RDOCOUT')
f010320 @knu * instruby.rb, ext/extmk.rb, Makefile.in, win32/Makefile.sub,
knu authored
80 end
81
82 parse_args()
a2af08d This commit was generated by cvs2svn to compensate for changes in r372,
matz authored
83
942d66d @nobu * instruby.rb: include FileUtils unconditionally.
nobu authored
84 include FileUtils
0b0a6aa @nobu * instruby.rb: check only `-' option, and use fileutils instead of
nobu authored
85 include FileUtils::NoWrite if $dryrun
86 @fileutils_output = STDOUT
87 @fileutils_label = ''
98ee2b2 @eban * instruby.rb (install): preserve the timestamp for Mac OS X ranlib p…
eban authored
88
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
89 $install_procs = Hash.new {[]}
90 def install?(*types, &block)
91 $install_procs[:all] <<= block
92 types.each do |type|
93 $install_procs[type] <<= block
94 end
71d5fc5 @nobu * Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,
nobu authored
95 end
96
98ee2b2 @eban * instruby.rb (install): preserve the timestamp for Mac OS X ranlib p…
eban authored
97 def install(src, dest, options = {})
76d7c01 @eban * lib/fileutils.rb (install): support preserve timestamp.
eban authored
98 options[:preserve] = true
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
99 super(src, with_destdir(dest), options)
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
100 if $installed_list
101 dest = File.join(dest, File.basename(src)) if $made_dirs[dest]
102 $installed_list.puts dest
103 end
104 end
105
106 def ln_sf(src, dest)
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
107 super(src, with_destdir(dest))
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
108 $installed_list.puts dest if $installed_list
8aaa8c8 @nobu *** empty log message ***
nobu authored
109 end
98ee2b2 @eban * instruby.rb (install): preserve the timestamp for Mac OS X ranlib p…
eban authored
110
e8b5dcd @nobu * instruby.rb (makedirs): make same directory only once even if
nobu authored
111 $made_dirs = {}
112 def makedirs(dirs)
113 dirs = fu_list(dirs)
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
114 dirs.collect! do |dir|
115 realdir = with_destdir(dir)
116 realdir unless $made_dirs.fetch(dir) do
e8b5dcd @nobu * instruby.rb (makedirs): make same directory only once even if
nobu authored
117 $made_dirs[dir] = true
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
118 $installed_list.puts(File.join(dir, "")) if $installed_list
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
119 File.directory?(realdir)
e8b5dcd @nobu * instruby.rb (makedirs): make same directory only once even if
nobu authored
120 end
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
121 end.compact!
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
122 super(dirs, :mode => 0755) unless dirs.empty?
e8b5dcd @nobu * instruby.rb (makedirs): make same directory only once even if
nobu authored
123 end
e83d532 2000-02-17
matz authored
124
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
125 def install_recursive(src, dest, options = {})
126 noinst = options.delete(:no_install)
127 subpath = src.size..-1
128 Dir.glob("#{src}/**/*", File::FNM_DOTMATCH) do |src|
129 next if /\A\.{1,2}\z/ =~ (base = File.basename(src))
130 next if noinst and File.fnmatch?(noinst, File.basename(src))
131 d = dest + src[subpath]
132 if File.directory?(src)
133 makedirs(d)
134 else
135 install src, d
136 end
137 end
138 end
139
140 def open_for_install(path, mode, &block)
141 unless $dryrun
142 open(with_destdir(path), mode, &block)
143 end
144 $installed_list.puts path if /^w/ =~ mode and $installed_list
145 end
146
ebfc8b5 @nobu * instruby.rb (DOSISH): embedded path in batch files should not be
nobu authored
147 def with_destdir(dir)
e58338f @nobu * instruby.rb: expand source library path.
nobu authored
148 return dir if !$destdir or $destdir.empty?
ebfc8b5 @nobu * instruby.rb (DOSISH): embedded path in batch files should not be
nobu authored
149 dir = dir.sub(/\A\w:/, '') if File::PATH_SEPARATOR == ';'
150 $destdir + dir
151 end
152
0b178b8 @nobu * instruby.rb: add dryrun mode.
nobu authored
153 exeext = CONFIG["EXEEXT"]
154
986c389 Initial revision
matz authored
155 ruby_install_name = CONFIG["ruby_install_name"]
0b178b8 @nobu * instruby.rb: add dryrun mode.
nobu authored
156 rubyw_install_name = CONFIG["rubyw_install_name"]
e83d532 2000-02-17
matz authored
157
0b178b8 @nobu * instruby.rb: add dryrun mode.
nobu authored
158 version = CONFIG["ruby_version"]
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
159 bindir = CONFIG["bindir"]
160 libdir = CONFIG["libdir"]
161 rubylibdir = CONFIG["rubylibdir"]
162 archlibdir = CONFIG["archdir"]
163 sitelibdir = CONFIG["sitelibdir"]
164 sitearchlibdir = CONFIG["sitearchdir"]
165 mandir = File.join(CONFIG["mandir"], "man")
4575613 @nobu * configure.in (LIBPATHFLAG): should escape $. [ruby-dev:18572]
nobu authored
166 configure_args = Shellwords.shellwords(CONFIG["configure_args"])
a364cba @unak * instruby.rb, lib/mkmf.rb: use CONFIG["ENABLE_SHARED"] instead of
unak authored
167 enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
0b178b8 @nobu * instruby.rb: add dryrun mode.
nobu authored
168 dll = CONFIG["LIBRUBY_SO"]
169 lib = CONFIG["LIBRUBY"]
170 arc = CONFIG["LIBRUBY_A"]
171
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
172 install?(:local, :arch, :bin) do
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
173 puts "installing binary commands"
174
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
175 makedirs [bindir, libdir, archlibdir]
efe7e52 @unak * instruby.rb: use real interpreter pathname at shebang line.
unak authored
176
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
177 install ruby_install_name+exeext, bindir, :mode => 0755
8ceed3b @unak * instruby.rb: install *.exe.manifest and *.dll.manifest if exist.
unak authored
178 if rubyw_install_name and !rubyw_install_name.empty?
179 install rubyw_install_name+exeext, bindir, :mode => 0755
180 end
181 if enable_shared and dll != lib
182 install dll, bindir, :mode => 0755
183 end
184 install lib, libdir, :mode => 0755 unless lib == arc
185 install arc, libdir, :mode => 0644
186 install "config.h", archlibdir, :mode => 0644
187 install "rbconfig.rb", archlibdir, :mode => 0644
188 if CONFIG["ARCHFILE"]
189 for file in CONFIG["ARCHFILE"].split
190 install file, archlibdir, :mode => 0644
191 end
a2af08d This commit was generated by cvs2svn to compensate for changes in r372,
matz authored
192 end
0b178b8 @nobu * instruby.rb: add dryrun mode.
nobu authored
193
8ceed3b @unak * instruby.rb: install *.exe.manifest and *.dll.manifest if exist.
unak authored
194 if dll == lib and dll != arc
195 for link in CONFIG["LIBRUBY_ALIASES"].split
196 ln_sf(dll, File.join(libdir, link))
197 end
07bb9f2 1.4.0
matz authored
198 end
199 end
3d5010d @eban * configure.in: modify program_prefix only if specified
eban authored
200
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
201 if $extout
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
202 extout = "#$extout"
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
203 install?(:ext, :arch, :'ext-arch') do
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
204 puts "installing extension objects"
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
205 makedirs [archlibdir, sitearchlibdir]
206 if noinst = CONFIG["no_install_files"] and noinst.empty?
207 noinst = nil
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
208 end
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
209 install_recursive("#{extout}/#{CONFIG['arch']}", archlibdir, :no_install => noinst)
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
210 end
211 install?(:ext, :comm, :'ext-comm') do
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
212 puts "installing extension scripts"
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
213 makedirs [rubylibdir, sitelibdir]
214 install_recursive("#{extout}/common", rubylibdir)
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
215 end
216 end
217
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
218 install?(:rdoc) do
219 if $rdocdir
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
220 puts "installing rdoc"
221
222 ridatadir = File.join(CONFIG['datadir'], 'ri/$(MAJOR).$(MINOR)/system')
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
223 Config.expand(ridatadir)
224 makedirs [ridatadir]
225 install_recursive($rdocdir, ridatadir)
226 end
227 end
07bb9f2 1.4.0
matz authored
228
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
229 install?(:local, :comm, :bin) do
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
230 puts "installing command scripts"
231
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
232 Dir.chdir srcdir
233 makedirs [bindir, rubylibdir]
234
235 ruby_shebang = File.join(bindir, ruby_install_name)
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
236 if File::ALT_SEPARATOR
237 ruby_bin_dosish = ruby_shebang.tr(File::SEPARATOR, File::ALT_SEPARATOR)
238 end
239 for src in Dir["bin/*"]
240 next unless File.file?(src)
241 next if /\/[.#]|(\.(old|bak|orig|rej|diff|patch|core)|~|\/core)$/i =~ src
50a9d1d @knu * bin/irb: Moved from sample/irb.rb.
knu authored
242
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
243 name = ruby_install_name.sub(/ruby/, File.basename(src))
244 dest = File.join(bindir, name)
50a9d1d @knu * bin/irb: Moved from sample/irb.rb.
knu authored
245
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
246 install src, dest, :mode => 0755
4fe7705 @knu * instruby.rb: Rewrite installed scripts' shebang lines.
knu authored
247
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
248 next if $dryrun
efe7e52 @unak * instruby.rb: use real interpreter pathname at shebang line.
unak authored
249
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
250 shebang = ''
251 body = ''
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
252 open_for_install(dest, "r+") { |f|
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
253 shebang = f.gets
254 body = f.read
4fe7705 @knu * instruby.rb: Rewrite installed scripts' shebang lines.
knu authored
255
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
256 if shebang.sub!(/^\#!.*?ruby\b/) {"#!" + ruby_shebang}
257 f.rewind
258 f.print shebang, body
259 f.truncate(f.pos)
260 end
261 }
6975b89 @knu * instruby.rb: Install batch files on Windows. [Submitted by usa]
knu authored
262
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
263 if ruby_bin_dosish
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
264 batfile = File.join(bindir, name + ".bat")
ab59325 @unak * instruby.rb: for cross compile.
unak authored
265 open_for_install(batfile, "wb") {|b|
266 b.print((<<EOH+shebang+body+<<EOF).gsub(/\r?\n/, "\r\n"))
6975b89 @knu * instruby.rb: Install batch files on Windows. [Submitted by usa]
knu authored
267 @echo off
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
268 @if not "%~d0" == "~d0" goto WinNT
efe7e52 @unak * instruby.rb: use real interpreter pathname at shebang line.
unak authored
269 #{ruby_bin_dosish} -x "#{batfile}" %1 %2 %3 %4 %5 %6 %7 %8 %9
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
270 @goto endofruby
6975b89 @knu * instruby.rb: Install batch files on Windows. [Submitted by usa]
knu authored
271 :WinNT
475af75 @nobu * instruby.rb (with_destdir): should return the given argument if no
nobu authored
272 "%~dp0#{ruby_install_name}" -x "%~f0" %*
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
273 @goto endofruby
6975b89 @knu * instruby.rb: Install batch files on Windows. [Submitted by usa]
knu authored
274 EOH
275 __END__
276 :endofruby
277 EOF
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
278 }
279 end
efe7e52 @unak * instruby.rb: use real interpreter pathname at shebang line.
unak authored
280 end
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
281 end
282
283 install?(:local, :comm, :lib) do
284 puts "installing library scripts"
285
286 Dir.chdir srcdir
287 makedirs [rubylibdir]
a0b0c78 matz
matz authored
288
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
289 for f in Dir["lib/**/*{.rb,help-message}"]
290 dir = File.dirname(f).sub!(/\Alib/, rubylibdir) || rubylibdir
291 makedirs dir
292 install f, dir, :mode => 0644
293 end
71d5fc5 @nobu * Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,
nobu authored
294 end
a2af08d This commit was generated by cvs2svn to compensate for changes in r372,
matz authored
295
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
296 install?(:local, :arch, :lib) do
297 puts "installing headers"
298
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
299 Dir.chdir(srcdir)
300 makedirs [archlibdir]
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
301 for f in Dir["*.h"]
302 install f, archlibdir, :mode => 0644
303 end
6c80c88 @knu * configure.in (MANTYPE): Detect if the system's nroff(1) groks
knu authored
304
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
305 if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
306 win32libdir = File.join(archlibdir, "win32")
307 makedirs win32libdir
308 install "win32/win32.h", win32libdir, :mode => 0644
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
309 end
71d5fc5 @nobu * Makefile.in, */Makefile.sub, */configure.bat, cygwin/GNUmakefile.in,
nobu authored
310 end
a2af08d This commit was generated by cvs2svn to compensate for changes in r372,
matz authored
311
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
312 install?(:local, :comm, :man) do
cefefb1 @nobu * common.mk (no-install): not install rdoc actually.
nobu authored
313 puts "installing manpages"
314
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
315 Dir.chdir(srcdir)
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
316 for mdoc in Dir["*.[1-9]"]
317 next unless File.file?(mdoc) and open(mdoc){|fh| fh.read(1) == '.'}
fcd6db0 @eban * instruby.rb: do not install shared libraries as man pages.
eban authored
318
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
319 destdir = mandir + mdoc[/(\d+)$/]
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
320 destfile = File.join(destdir, mdoc.sub(/ruby/, ruby_install_name))
6c80c88 @knu * configure.in (MANTYPE): Detect if the system's nroff(1) groks
knu authored
321
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
322 makedirs destdir
6c80c88 @knu * configure.in (MANTYPE): Detect if the system's nroff(1) groks
knu authored
323
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
324 if $mantype == "doc"
325 install mdoc, destfile, :mode => 0644
326 else
327 require 'mdoc2man.rb'
6c80c88 @knu * configure.in (MANTYPE): Detect if the system's nroff(1) groks
knu authored
328
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
329 w = Tempfile.open(mdoc)
6c80c88 @knu * configure.in (MANTYPE): Detect if the system's nroff(1) groks
knu authored
330
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
331 open(mdoc) { |r|
332 Mdoc2Man.mdoc2man(r, w)
333 }
6c80c88 @knu * configure.in (MANTYPE): Detect if the system's nroff(1) groks
knu authored
334
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
335 w.close
6c80c88 @knu * configure.in (MANTYPE): Detect if the system's nroff(1) groks
knu authored
336
e0df26d @nobu * Makefile.in, common.in, instruby.rb, ext/extmk.rb, lib/mkmf.rb:
nobu authored
337 install w.path, destfile, :mode => 0644
338 end
6c80c88 @knu * configure.in (MANTYPE): Detect if the system's nroff(1) groks
knu authored
339 end
340 end
0b178b8 @nobu * instruby.rb: add dryrun mode.
nobu authored
341
5713ba1 @nobu * common.mk (install-doc): reverted.
nobu authored
342 $install.concat ARGV.collect {|n| n.intern}
343 $install << :local << :ext if $install.empty?
344 $install.each do |inst|
345 $install_procs[inst].each do |block|
346 dir = Dir.pwd
347 begin
348 block.call
349 ensure
350 Dir.chdir(dir)
351 end
352 end
353 end
354
986c389 Initial revision
matz authored
355 # vi:set sw=2:
Something went wrong with that request. Please try again.