summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xext/extmk.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 9521e6ca0a2..eda487c30e0 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)}$/, "")