mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/extmk.rb (extmake): should not reduce necessary libraries.
[ruby-dev:22440] * lib/mkmf.rb (merge_libs): merge libraries according to dependency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6f69b2b00a
commit
bafe6d8504
3 changed files with 24 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
Fri Jan 9 11:20:24 2004 Siena. <siena@faculty.chiba-u.jp>
|
||||
|
||||
* ext/extmk.rb (extmake): should not reduce necessary libraries.
|
||||
[ruby-dev:22440]
|
||||
|
||||
* lib/mkmf.rb (merge_libs): merge libraries according to
|
||||
dependency.
|
||||
|
||||
Fri Jan 9 10:05:23 2004 Siena. <siena@faculty.chiba-u.jp>
|
||||
|
||||
* lib/mkmf.rb (libpathflag): use single quotes. [ruby-dev:22440]
|
||||
|
|
|
@ -109,7 +109,7 @@ def extmake(target)
|
|||
$extpath ||= []
|
||||
$extflags += " " + $DLDFLAGS unless $DLDFLAGS.empty?
|
||||
$extflags += " " + $LDFLAGS unless $LDFLAGS.empty?
|
||||
$extlibs |= $libs.split | $LOCAL_LIBS.split
|
||||
$extlibs = merge_libs($extlibs, $libs.split, $LOCAL_LIBS.split)
|
||||
$extpath |= $LIBPATH
|
||||
end
|
||||
ensure
|
||||
|
|
15
lib/mkmf.rb
15
lib/mkmf.rb
|
@ -113,6 +113,21 @@ def modified?(target, times)
|
|||
t if times.all? {|n| n <= t}
|
||||
end
|
||||
|
||||
def merge_libs(*libs)
|
||||
libs.inject([]) do |x, y|
|
||||
xy = x & y
|
||||
xn = yn = 0
|
||||
y.each_with_index do |v, yi|
|
||||
if xy.include?(v)
|
||||
xi = [x.index(v), xn].max()
|
||||
x[xi, 1] = y[yn..yi]
|
||||
xn, yn = xi + (yi - yn + 1), yi + 1
|
||||
end
|
||||
end
|
||||
x.concat(y[yn..-1] || [])
|
||||
end
|
||||
end
|
||||
|
||||
module Logging
|
||||
@log = nil
|
||||
@logfile = 'mkmf.log'
|
||||
|
|
Loading…
Reference in a new issue