From 4ea690ea3b19680ef168f5b32d7a132cc4d05a5c Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 23 May 2013 15:18:05 +0000 Subject: extmk.rb: don't duplicate * ext/extmk.rb (extract_makefile): do not add dldflags if duplicated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/extmk.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/extmk.rb b/ext/extmk.rb index 9521e6ca0a..eda487c30e 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -105,7 +105,9 @@ def extract_makefile(makefile, keep = true) /^STATIC_LIB[ \t]*=[ \t]*\S+/ =~ m or $static = false end $preload = Shellwords.shellwords(m[/^preload[ \t]*=[ \t]*(.*)/, 1] || "") - $DLDFLAGS += " " + (m[/^dldflags[ \t]*=[ \t]*(.*)/, 1] || "") + if dldflags = m[/^dldflags[ \t]*=[ \t]*(.*)/, 1] and !$DLDFLAGS.include?(dldflags) + $DLDFLAGS += " " + dldflags + end if s = m[/^LIBS[ \t]*=[ \t]*(.*)/, 1] s.sub!(/^#{Regexp.quote($LIBRUBYARG)} */, "") s.sub!(/ *#{Regexp.quote($LIBS)}$/, "") -- cgit v1.2.3