1999-01-20 07:59:39 +03:00
|
|
|
#!./miniruby -I.
|
|
|
|
|
1998-01-16 15:19:09 +03:00
|
|
|
require "rbconfig.rb"
|
|
|
|
include Config
|
|
|
|
|
1999-01-20 07:59:39 +03:00
|
|
|
destdir = ARGV[0] || ''
|
|
|
|
|
1998-01-16 15:19:09 +03:00
|
|
|
$:.unshift CONFIG["srcdir"]+"/lib"
|
|
|
|
require "ftools"
|
1999-08-13 09:45:20 +04:00
|
|
|
require "find"
|
1998-01-16 15:19:09 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
exeext = CONFIG["EXEEXT"]
|
1998-01-16 15:19:09 +03:00
|
|
|
if ENV["prefix"]
|
|
|
|
prefix = ENV["prefix"]
|
|
|
|
else
|
|
|
|
prefix = CONFIG["prefix"]
|
|
|
|
end
|
2000-02-17 10:11:22 +03:00
|
|
|
|
1998-01-16 15:19:09 +03:00
|
|
|
ruby_install_name = CONFIG["ruby_install_name"]
|
2000-02-17 10:11:22 +03:00
|
|
|
version = "/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
|
2000-03-13 10:18:45 +03:00
|
|
|
arch = "/"+CONFIG["arch"]
|
2000-02-17 10:11:22 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
bindir = destdir+CONFIG["bindir"]
|
|
|
|
libdir = destdir+CONFIG["libdir"]
|
2000-03-13 10:18:45 +03:00
|
|
|
rubylibdir = destdir+CONFIG["prefix"]+"/lib/ruby"+version
|
|
|
|
archlibdir = rubylibdir+arch
|
2000-04-12 09:06:23 +04:00
|
|
|
sitelibdir = destdir+CONFIG["sitedir"]+version
|
2000-03-13 10:18:45 +03:00
|
|
|
sitearchlibdir = sitelibdir+arch
|
1999-08-13 09:45:20 +04:00
|
|
|
mandir = destdir+CONFIG["mandir"] + "/man1"
|
1999-01-20 07:59:39 +03:00
|
|
|
wdir = Dir.getwd
|
1998-01-16 15:19:09 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
File.makedirs bindir, true
|
|
|
|
File.install ruby_install_name+exeext,
|
|
|
|
"#{bindir}/#{ruby_install_name}#{exeext}", 0755, true
|
1999-01-20 07:59:39 +03:00
|
|
|
for dll in Dir['*.dll']
|
1999-08-13 09:45:20 +04:00
|
|
|
File.install dll, "#{bindir}/#{dll}", 0755, true
|
1999-01-20 07:59:39 +03:00
|
|
|
end
|
1999-08-13 09:45:20 +04:00
|
|
|
File.makedirs libdir, true
|
|
|
|
for lib in ["libruby.so.LIB", CONFIG["LIBRUBY_SO"]]
|
1999-01-20 07:59:39 +03:00
|
|
|
if File.exist? lib
|
1999-08-13 09:45:20 +04:00
|
|
|
File.install lib, libdir, 0555, true
|
1999-01-20 07:59:39 +03:00
|
|
|
end
|
|
|
|
end
|
1999-08-13 09:45:20 +04:00
|
|
|
Dir.chdir libdir
|
|
|
|
if File.exist? CONFIG["LIBRUBY_SO"]
|
|
|
|
for link in CONFIG["LIBRUBY_ALIASES"].split
|
|
|
|
if File.exist? link
|
|
|
|
File.delete link
|
|
|
|
end
|
|
|
|
File.symlink CONFIG["LIBRUBY_SO"], link
|
|
|
|
print "link #{CONFIG['LIBRUBY_SO']} -> #{link}\n"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
Dir.chdir wdir
|
2000-03-13 10:18:45 +03:00
|
|
|
File.makedirs rubylibdir, true
|
2000-02-17 10:11:22 +03:00
|
|
|
File.makedirs archlibdir, true
|
|
|
|
File.makedirs sitelibdir, true
|
2000-03-09 12:04:36 +03:00
|
|
|
File.makedirs sitearchlibdir, true
|
1999-08-13 09:45:20 +04:00
|
|
|
|
|
|
|
if RUBY_PLATFORM =~ /cygwin/ and File.exist? "import.h"
|
2000-02-17 10:11:22 +03:00
|
|
|
File.install "import.h", archlibdir, 0644, true
|
1999-08-13 09:45:20 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
if RUBY_PLATFORM =~ /-aix/
|
2000-02-17 10:11:22 +03:00
|
|
|
File.install "ruby.imp", archlibdir, 0644, true
|
1999-08-13 09:45:20 +04:00
|
|
|
end
|
|
|
|
|
1998-01-16 15:19:09 +03:00
|
|
|
Dir.chdir "ext"
|
2000-05-21 13:25:58 +04:00
|
|
|
if defined? CROSS_COMPILING
|
|
|
|
system "#{CONFIG['MINIRUBY']} extmk.rb install #{destdir}"
|
|
|
|
else
|
|
|
|
system "../miniruby#{exeext} extmk.rb install #{destdir}"
|
|
|
|
end
|
1998-01-16 15:19:09 +03:00
|
|
|
Dir.chdir CONFIG["srcdir"]
|
1999-08-13 09:45:20 +04:00
|
|
|
|
|
|
|
Find.find("lib") do |f|
|
|
|
|
next unless /\.rb$/ =~ f
|
2000-03-13 10:18:45 +03:00
|
|
|
dir = rubylibdir+"/"+File.dirname(f[4..-1])
|
1999-08-13 09:45:20 +04:00
|
|
|
File.makedirs dir, true unless File.directory? dir
|
|
|
|
File.install f, dir, 0644, true
|
1999-01-20 07:59:39 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
for f in Dir["*.h"]
|
2000-02-17 10:11:22 +03:00
|
|
|
File.install f, archlibdir, 0644, true
|
1999-08-13 09:45:20 +04:00
|
|
|
end
|
|
|
|
if RUBY_PLATFORM =~ /mswin32/
|
2000-02-17 10:11:22 +03:00
|
|
|
File.makedirs archlibdir + "/win32", true
|
|
|
|
File.install "win32/win32.h", archlibdir + "/win32", 0644, true
|
1999-08-13 09:45:20 +04:00
|
|
|
if File.exist? wdir+'/rubymw.lib'
|
2000-02-17 10:11:22 +03:00
|
|
|
File.install wdir+'/rubymw.lib', archlibdir, 0644, true
|
1999-08-13 09:45:20 +04:00
|
|
|
end
|
1998-01-16 15:19:09 +03:00
|
|
|
end
|
2000-02-17 10:11:22 +03:00
|
|
|
File.install wdir+'/'+CONFIG['LIBRUBY_A'], archlibdir, 0644, true
|
1999-01-20 07:59:39 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
File.makedirs mandir, true
|
|
|
|
File.install "ruby.1", mandir, 0644, true
|
1999-01-20 07:59:39 +03:00
|
|
|
Dir.chdir wdir
|
2000-02-17 10:11:22 +03:00
|
|
|
File.install "config.h", archlibdir, 0644, true
|
|
|
|
File.install "rbconfig.rb", archlibdir, 0644, true
|
1998-01-16 15:19:09 +03:00
|
|
|
# vi:set sw=2:
|