summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-01 07:17:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-01 07:17:53 +0000
commit262669e6c68e28322c1ab2b9323977548d46c09a (patch)
tree31b45fbd2a944ebd6f02cb1d16075d5a44f45432 /ext/extmk.rb
parent84c8319c8d14b6e75cc6af995118a7a26cb394ea (diff)
extmk.rb: always dynamic non-install extensions
* ext/extmk.rb (extmake): extensions not to be installed should not make static libraries, but make dynamic libraries always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 1a318b3..871996e 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -144,6 +144,8 @@ def extmake(target)
$srcs = []
$compiled[target] = false
makefile = "./Makefile"
+ static = $static
+ $static = nil if noinstall = File.fnmatch?("-*", target)
ok = File.exist?(makefile)
unless $ignore
rbconfig0 = RbConfig::CONFIG
@@ -216,7 +218,14 @@ def extmake(target)
end
ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]}
ok = yield(ok) if block_given?
- unless ok
+ if ok
+ open(makefile, "r+") do |f|
+ s = f.read.sub!(/^(static:)\s.*/, '\1 all')
+ f.rewind
+ f.print(s)
+ f.truncate(f.pos)
+ end
+ else
open(makefile, "w") do |f|
f.puts "# " + DUMMY_SIGNATURE
f.print(*dummy_makefile(CONFIG["srcdir"]))
@@ -236,7 +245,7 @@ def extmake(target)
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
args += [sysquote("DESTDIR=" + relative_from($destdir, "../"+prefix))]
end
- if $static and ok and !$objs.empty? and !File.fnmatch?("-*", target)
+ if $static and ok and !$objs.empty? and !noinstall
args += ["static"] unless $clean
$extlist.push [$static, target, $target, $preload]
end
@@ -279,6 +288,7 @@ def extmake(target)
$top_srcdir = top_srcdir
$topdir = topdir
$hdrdir = hdrdir
+ $static = static
Dir.chdir dir
end
begin