summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb4
1 files changed, 3 insertions, 1 deletions
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)}$/, "")