summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-24 13:26:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-24 13:26:21 +0000
commit97a016ac8ae37e7880841179c10bff15163514d9 (patch)
tree1a2deb52036f0d5183223510070da573b5f8d22d /ext/extmk.rb
parent3778f2f3d5497b700b25d008973d354baae66dca (diff)
install extra libraries
* ext/extmk.rb (extract_makefile, extmake, configuration): store extra libraries to be installed. * tool/rbinstall.rb (ext-arch): install extra libraries. * ext/zlib/extconf.rb: install zlib if built. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index b73b8b6..8617483 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -81,6 +81,7 @@ def extract_makefile(makefile, keep = true)
m = File.read(makefile)
s = m[/^CLEANFILES[ \t]*=[ \t](.*)/, 1] and $cleanfiles = s.split
s = m[/^DISTCLEANFILES[ \t]*=[ \t](.*)/, 1] and $distcleanfiles = s.split
+ s = m[/^EXTSO[ \t]*=[ \t](.*)/, 1] and $extso = s.split
if !(target = m[/^TARGET[ \t]*=[ \t]*(\S*)/, 1])
return keep
end
@@ -165,6 +166,7 @@ def extmake(target, basedir = (maybestatic = 'ext'))
$preload = nil
$objs = []
$srcs = []
+ $extso = []
$compiled[target] = false
makefile = "./Makefile"
static = $static
@@ -552,6 +554,10 @@ extend Module.new {
def timestamp_file(name, target_prefix = nil)
super.sub(%r[/\.extout\.(?:-\.)?], '/.')
end
+
+ def configuration(srcdir)
+ super << "EXTSO #{['=', $extso].join(' ')}\n"
+ end
}
dir = Dir.pwd
@@ -560,12 +566,14 @@ Dir::chdir('ext')
hdrdir = $hdrdir
$hdrdir = ($top_srcdir = relative_from(srcdir, $topdir = "..")) + "/include"
+extso = []
fails = []
exts.each do |d|
$static = $force_static ? true : $static_ext[d]
if $ignore or !$nodynamic or $static
result = extmake(d) or abort
+ extso |= $extso
fails << result unless result == true
end
end
@@ -608,6 +616,7 @@ gems.each do |d|
$extout = extout.dup
@gemname = d[%r{\A[^/]+}]
extmake(d, 'gems')
+ extso |= $extso
end
$extout = extout
Dir.chdir('../ext')
@@ -745,6 +754,7 @@ if $configure_only and $command_output
mf.macro "gems", gems
mf.macro "EXTOBJS", $extlist.empty? ? ["dmyext.#{$OBJEXT}"] : ["ext/extinit.#{$OBJEXT}", *$extobjs]
mf.macro "EXTLIBS", $extlibs
+ mf.macro "EXTSO", extso
mf.macro "EXTLDFLAGS", $extflags.split
submakeopts = []
if enable_config("shared", $enable_shared)
@@ -797,6 +807,9 @@ if $configure_only and $command_output
mf.puts "#{d[0..-2]}#{tgt}:\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)"
end
end
+ mf.puts "\n""extso:\n"
+ mf.puts "\t@echo EXTSO=$(EXTSO)"
+
mf.puts "\n""note:\n"
unless fails.empty?
mf.puts %Q<\t@echo "*** Following extensions failed to configure:">