summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-07 14:59:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-07 14:59:24 +0000
commitd882436a8b4e9da97b5c51601301ed3f3588ad5d (patch)
tree76b0906aec83dab16ede52a468df1d9ae60c1fbc /ext/extmk.rb
parent435303f1e933d0682375864551d9240a1ffcba90 (diff)
* ext/extmk.rb (extmake): keep directory names in Makefile as macros.
* lib/mkmf.rb (configuration, create_makefile): ditto. * lib/mkmf.rb (CXX_EXT): separate C++ extensions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rw-r--r--ext/extmk.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 5bbed957c2..05d9c26e5a 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -102,6 +102,8 @@ def extmake(target)
Dir.chdir target
top_srcdir = $top_srcdir
topdir = $topdir
+ mk_srcdir = CONFIG["srcdir"]
+ mk_topdir = CONFIG["topdir"]
prefix = "../" * (target.count("/")+1)
$hdrdir = $top_srcdir = relative_from(top_srcdir, prefix)
$topdir = prefix + $topdir
@@ -115,6 +117,9 @@ def extmake(target)
unless $ignore
Config::CONFIG["srcdir"] = $srcdir
Config::CONFIG["topdir"] = $topdir
+ CONFIG["hdrdir"] = ($hdrdir == top_srcdir) ? top_srcdir : "$(topdir)/"+top_srcdir
+ CONFIG["srcdir"] = "$(hdrdir)/ext/#{$mdir}"
+ CONFIG["topdir"] = $topdir
begin
if (!(ok &&= extract_makefile(makefile)) ||
!(t = modified?(makefile, MTIMES)) ||
@@ -140,14 +145,12 @@ def extmake(target)
rm_f "conftest*"
config = $0
$0 = $PROGRAM_NAME
- Config::CONFIG["srcdir"] = $top_srcdir
- Config::CONFIG["topdir"] = topdir
end
end
ok = yield(ok) if block_given?
unless ok
open(makefile, "w") do |f|
- f.print dummy_makefile($srcdir)
+ f.print dummy_makefile(CONFIG["srcdir"])
end
return true
end
@@ -175,6 +178,10 @@ def extmake(target)
end
ensure
$hdrdir = $top_srcdir = top_srcdir
+ Config::CONFIG["topdir"] = topdir
+ CONFIG["srcdir"] = mk_srcdir
+ CONFIG["topdir"] = mk_topdir
+ CONFIG.delete("hdrdir")
$topdir = topdir
Dir.chdir dir
end