summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-15 02:46:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-15 02:46:53 +0000
commit5e0fa644ed95b8d4bb356ef39b762a8012335128 (patch)
tree27d7139b600eb414fe3c5e723c5607f929efa37f /ext/extmk.rb
parent93bc5024362ed16d0d1fc0a218aaf70752c4fa32 (diff)
extmk.rb: no static-ext in gems
* ext/extmk.rb (extmake): extension libraries in gems cannot link statically. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 97604cf..aa9b0d8 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -131,7 +131,7 @@ def extract_makefile(makefile, keep = true)
true
end
-def extmake(target, basedir = 'ext')
+def extmake(target, basedir = (maybestatic = 'ext'))
unless $configure_only || verbose?
print "#{$message} #{target}\n"
$stdout.flush
@@ -269,7 +269,7 @@ def extmake(target, basedir = 'ext')
end
if $static and ok and !$objs.empty? and !noinstall
args += ["static"] unless $clean
- $extlist.push [$static, target, $target, $preload]
+ $extlist.push [(maybestatic ? $static : false), target, $target, $preload]
end
FileUtils.rm_f(old_cleanfiles - $distcleanfiles - $cleanfiles)
FileUtils.rm_f(old_objs - $objs)
@@ -613,7 +613,8 @@ unless $extlist.empty?
list = $extlist.dup
built = []
while e = list.shift
- _, target, feature, required = e
+ static, target, feature, required = e
+ next unless static
if required and !(required -= built).empty?
l = list.size
if (while l > 0; break true if required.include?(list[l-=1][1]) end)
@@ -737,7 +738,8 @@ if $configure_only and $command_output
mf.puts
targets = %w[all install static install-so install-rb clean distclean realclean]
targets.each do |tgt|
- mf.puts "#{tgt}: $(extensions:/.=/#{tgt}) $(gems:/.=/#{tgt})"
+ mf.puts "#{tgt}: $(extensions:/.=/#{tgt})"
+ mf.puts "#{tgt}: $(gems:/.=/#{tgt})" unless tgt == 'static'
mf.puts "#{tgt}: note" unless /clean\z/ =~ tgt
end
mf.puts