diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-08-13 05:45:20 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-08-13 05:45:20 +0000 |
commit | 65a5162550f58047974793cdc8067a970b2435c0 (patch) | |
tree | 082bb7d5568f3b2e36e3fe166e9f3039394fcf44 /instruby.rb | |
parent | fcd020c83028f5610d382e85a2df00223e12bd7e (diff) |
1.4.0
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'instruby.rb')
-rw-r--r-- | instruby.rb | 82 |
1 files changed, 58 insertions, 24 deletions
diff --git a/instruby.rb b/instruby.rb index d489e0f838..52c7c2397f 100644 --- a/instruby.rb +++ b/instruby.rb @@ -7,51 +7,85 @@ destdir = ARGV[0] || '' $:.unshift CONFIG["srcdir"]+"/lib" require "ftools" +require "find" -binsuffix = CONFIG["binsuffix"] +exeext = CONFIG["EXEEXT"] if ENV["prefix"] prefix = ENV["prefix"] else prefix = CONFIG["prefix"] end ruby_install_name = CONFIG["ruby_install_name"] -bindir = CONFIG["bindir"] -libdir = CONFIG["libdir"] -pkglibdir = libdir + "/" + ruby_install_name +bindir = destdir+CONFIG["bindir"] +libdir = destdir+CONFIG["libdir"] +#pkglibdir = libdir + "/" + ruby_install_name+"/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"] +pkglibdir = libdir + "/ruby/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"] archdir = pkglibdir + "/" + CONFIG["arch"] -mandir = CONFIG["mandir"] + "/man1" +mandir = destdir+CONFIG["mandir"] + "/man1" wdir = Dir.getwd -File.makedirs "#{destdir}#{bindir}", true -File.install "ruby#{binsuffix}", - "#{destdir}#{bindir}/#{ruby_install_name}#{binsuffix}", 0755, true +File.makedirs bindir, true +File.install ruby_install_name+exeext, + "#{bindir}/#{ruby_install_name}#{exeext}", 0755, true for dll in Dir['*.dll'] - File.install dll, "#{destdir}#{bindir}/#{dll}", 0755, true + File.install dll, "#{bindir}/#{dll}", 0755, true end -File.makedirs "#{destdir}#{libdir}", true -for lib in ["libruby.so", "libruby.so.LIB"] +File.makedirs libdir, true +for lib in ["libruby.so.LIB", CONFIG["LIBRUBY_SO"]] if File.exist? lib - File.install lib, "#{destdir}#{libdir}", 0644, true + File.install lib, libdir, 0555, true end end -File.makedirs "#{destdir}#{pkglibdir}", true -File.makedirs "#{destdir}#{archdir}", true +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 +File.makedirs pkglibdir, true +File.makedirs archdir, true +File.makedirs pkglibdir+"/site_ruby", true +File.makedirs pkglibdir+"/site_ruby/"+CONFIG["arch"], true + +if RUBY_PLATFORM =~ /cygwin/ and File.exist? "import.h" + File.install "import.h", archdir, 0644, true +end + +if RUBY_PLATFORM =~ /-aix/ + File.install "ruby.imp", archdir, 0644, true +end + Dir.chdir "ext" -system "../miniruby#{binsuffix} extmk.rb install #{destdir}" +system "../miniruby#{exeext} extmk.rb install #{destdir}" Dir.chdir CONFIG["srcdir"] -for f in Dir["lib/*.rb"] - File.install f, "#{destdir}#{pkglibdir}", 0644, true + +Find.find("lib") do |f| + next unless /\.rb$/ =~ f + dir = pkglibdir+"/"+File.dirname(f[4..-1]) + File.makedirs dir, true unless File.directory? dir + File.install f, dir, 0644, true end -File.makedirs(archdir,true) for f in Dir["*.h"] - File.install f, "#{destdir}#{archdir}", 0644, true + File.install f, archdir, 0644, true +end +if RUBY_PLATFORM =~ /mswin32/ + File.makedirs archdir + "/win32", true + File.install "win32/win32.h", archdir + "/win32", 0644, true + if File.exist? wdir+'/rubymw.lib' + File.install wdir+'/rubymw.lib', archdir, 0644, true + end end -File.install "libruby.a", "#{destdir}#{archdir}", 0644, true +File.install wdir+'/'+CONFIG['LIBRUBY_A'], archdir, 0644, true -File.makedirs "#{destdir}#{mandir}", true -File.install "ruby.1", "#{destdir}#{mandir}", 0644, true +File.makedirs mandir, true +File.install "ruby.1", mandir, 0644, true Dir.chdir wdir -File.install "config.h", "#{destdir}#{archdir}", 0644, true -File.install "rbconfig.rb", "#{destdir}#{archdir}", 0644, true +File.install "config.h", archdir, 0644, true +File.install "rbconfig.rb", archdir, 0644, true # vi:set sw=2: |