diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ext/extmk.rb | 2 | ||||
-rw-r--r-- | lib/mkmf.rb | 15 |
3 files changed, 18 insertions, 3 deletions
@@ -1,6 +1,6 @@ Mon Jan 12 12:07:22 2004 Dave Thomas <dave@pragprog.com> - * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods): + * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods): Someone changed the "// in eval.c" comments to "/*...*/" style, so the parsing of the source file name broke. @@ -12,7 +12,7 @@ Mon Jan 12 12:07:22 2004 Dave Thomas <dave@pragprog.com> and all intervening code was included in the following method's documentation. - * lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter::break_to_newline): + * lib/rdoc/ri/ri_formatter.rb (RI::HtmlFormatter::break_to_newline): HTML formats need explicit line breaks. Mon Jan 12 11:46:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> diff --git a/ext/extmk.rb b/ext/extmk.rb index fe777a4ceb..4e7af05ba0 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -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 diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 2a0adab739..e6d4c18177 100644 --- a/lib/mkmf.rb +++ b/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' |