aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/mkmf.rb15
2 files changed, 17 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e070790837..7ccdf8df5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Jun 1 22:01:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (pkg_config): split --libs if --libs-only-l option
+ is not available. patch in [ruby-core:69428] by Hans Mackowiak.
+ [ruby-core:69421] [Bug #11201]
+
Mon Jun 1 21:18:24 2015 Koichi Sasada <ko1@atdot.net>
* gc.c (gc_mark_children): remove a garbage character
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index be9b06ca51..0d19562db6 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1818,11 +1818,18 @@ SRC
cflags = get['cflags']
end
libs = get['libs-only-l']
- ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
- $CFLAGS += " " << cflags
- $CXXFLAGS += " " << cflags
- $LDFLAGS = [orig_ldflags, ldflags].join(' ')
+ if cflags
+ $CFLAGS += " " << cflags
+ $CXXFLAGS += " " << cflags
+ end
+ if libs
+ ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
+ else
+ libs, ldflags = Shellwords.shellwords(ldflags).partition {|s| s =~ /-l([^ ]+)/ }.map {|l|l.quote.join(" ")}
+ end
$libs += " " << libs
+
+ $LDFLAGS = [orig_ldflags, ldflags].join(' ')
Logging::message "package configuration for %s\n", pkg
Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",
cflags, ldflags, libs