summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-04-12 05:06:23 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-04-12 05:06:23 +0000
commit861e4ba6b396eadbf37208b92f1b64fad16314fd (patch)
tree831d5938bb42940c5db6c4363bd0d974ec1e32bf /lib/mkmf.rb
parentdc2f6b3d257b99a49b4cd258623566113c9f7f35 (diff)
mkmf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb22
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 6a16c54..74238b9 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -13,6 +13,8 @@ $config_cache = CONFIG["compile_dir"]+"/ext/config.cache"
$srcdir = CONFIG["srcdir"]
$libdir = CONFIG["libdir"]+"/ruby/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
$archdir = $libdir+"/"+CONFIG["arch"]
+$sitelibdir = CONFIG["sitedir"]+"/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
+$sitearchdir = $sitelibdir+"/"+CONFIG["arch"]
if File.exist? $archdir + "/ruby.h"
$hdrdir = $archdir
@@ -107,7 +109,7 @@ def try_run(src, opt="")
end
end
-def install_rb(mfile, srcdir = nil)
+def install_rb(mfile, dest, srcdir = nil)
libdir = "lib"
libdir = srcdir + "/" + libdir if srcdir
path = []
@@ -120,10 +122,10 @@ def install_rb(mfile, srcdir = nil)
end
for f in dir
next if f == "."
- mfile.printf "\t@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir)/%s\n", f
+ mfile.printf "\t@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' %s/%s\n", dest, f
end
for f in path
- mfile.printf "\t@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)' lib/%s $(libdir)/%s\n", f, f
+ mfile.printf "\t@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)' lib/%s %s/%s\n", f, dest, f
end
end
@@ -373,6 +375,8 @@ prefix = #{CONFIG["prefix"]}
exec_prefix = #{CONFIG["exec_prefix"]}
libdir = #{$libdir}
archdir = #{$archdir}
+sitelibdir = #{$sitelibdir}
+sitearchdir = #{$sitearchdir}
#### End of system configuration section. ####
@@ -398,11 +402,21 @@ realclean: clean
install: $(archdir)/$(DLLIB)
+site-install: $(sitearchdir)/$(DLLIB)
+
$(archdir)/$(DLLIB): $(DLLIB)
@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir) $(archdir)
@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(archdir)/$(DLLIB)
EOMF
- install_rb(mfile)
+ install_rb(mfile, "$(libdir)")
+ mfile.printf "\n"
+
+ mfile.printf <<EOMF
+$(sitearchdir)/$(DLLIB): $(DLLIB)
+ @$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir) $(sitearchdir)
+ @$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(sitearchdir)/$(DLLIB)
+EOMF
+ install_rb(mfile, "$(sitelibdir)")
mfile.printf "\n"
if CONFIG["DLEXT"] != $OBJEXT