summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-12 02:12:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-12 02:12:48 +0000
commitfd36ed94f302e79e5184bceff68f7e36d6a17e3d (patch)
tree0942bdd289b56e7aa9240634cc6b6d8ebe8f20a2 /ext/extmk.rb
parent8eb6b7328ecc7108fd589aa1b48e029c28392308 (diff)
* Makefile.in: static link libraries to LIBRUBY_SO with static linked
ext. [ruby-dev:21157] * ext/extmk.rb (extmake): sort extension library initialization order. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4372 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 eb2a277600..b5286980a7 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -60,6 +60,7 @@ def extmake(target)
$target = target
$mdir = target
$srcdir = File.join($top_srcdir, "ext", $mdir)
+ $preload = nil
unless $ignore
if $static ||
!(t = modified?("./Makefile", MTIMES)) ||
@@ -88,7 +89,7 @@ def extmake(target)
end
if File.exist?("./Makefile")
if $static
- $extlist.push [$static, $target, File.basename($target)]
+ $extlist.push [$static, $target, File.basename($target), $preload]
end
unless system($make, *sysquote($mflags))
$ignore or $continue or return false
@@ -228,7 +229,13 @@ end
if $extlist.size > 0
$extinit ||= ""
$extobjs ||= ""
- for s,t,i in $extlist
+ list = $extlist.dup
+ until list.empty?
+ s,t,i,r = list.shift
+ if r and list.any? {|l| r.include?(l[1])}
+ list << [s,t,i]
+ next
+ end
f = format("%s/%s.%s", s, i, $LIBEXT)
if File.exist?(f)
$extinit += "\tinit(Init_#{i}, \"#{t}.so\");\n"
@@ -252,7 +259,7 @@ SRC
$extpath.delete("$(topdir)")
$extflags = libpathflag($extpath) << " " << $extflags.strip
conf = [
- ['SETUP', $setup], ['EXTOBJS', $extobjs],
+ ['SETUP', $setup], [$enable_shared ? 'DLDOBJS' : 'EXTOBJS', $extobjs],
['EXTLIBS', $extlibs], ['EXTLDFLAGS', $extflags]
].map {|n, v|
"#{n}=#{v}" if v and !(v = v.strip).empty?