summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-02 16:54:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-02 16:54:35 +0000
commita7ec244cc7f875936042ea4872c4d4d89eb86d29 (patch)
tree3968be2cb042a0ffb6156a8dddd9fbc6477bd374 /ext/extmk.rb
parent1e1054f3d852ff02612908ded87450d86c5ece0c (diff)
* ext/extmk.rb (extmake): extact target prefix from Makefiles.
* ext/extmk.rb: already built-in libraries satisfy dependencies. [ruby-dev:24028] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rw-r--r--ext/extmk.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 7d49f49e39..c41354bf46 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -103,7 +103,11 @@ def extmake(target)
else
if $static
m = File.read(makefile)
- $target = m[/^TARGET[ \s]*=[ \s]*(\S*)/, 1] or $static = nil
+ if !($target = m[/^TARGET[ \t]*=[ \t]*(\S*)/, 1])
+ $static = nil
+ elsif target_prefix = m[/^target_prefix[ \t]*=[ \t]*\/(.*)/, 1]
+ $target = "#{target_prefix}/#{$target}"
+ end
/^STATIC_LIB[ \t]*=[ \t]*\S+/ =~ m or $static = nil
$preload = Shellwords.shellwords(m[/^preload[ \t]*=[ \t]*(.*)/, 1] || "")
$DLDFLAGS += " " + (m[/^DLDFLAGS[ \t]*=[ \t]*(.*)/, 1] || "")
@@ -353,9 +357,10 @@ if $extlist.size > 0
$extinit ||= ""
$extobjs ||= ""
list = $extlist.dup
+ built = []
while e = list.shift
s,t,i,r = e
- if r and !r.empty?
+ if r and !(r -= built).empty?
l = list.size
if (while l > 0; break true if r.include?(list[l-=1][1]) end)
list.insert(l + 1, e)
@@ -366,6 +371,7 @@ if $extlist.size > 0
if File.exist?(f)
$extinit += "\tinit(Init_#{i}, \"#{t}.so\");\n"
$extobjs += "ext/#{f} "
+ built << t
end
end