diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-01 13:01:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-01 13:01:52 +0000 |
commit | 54fc5df3370340e0ea1498e3c5319b95f668eec0 (patch) | |
tree | fd143ad2a5af414643067d5f8d21393c115a6008 | |
parent | 03224fa1b5a26c821607f0a3b5beded3d11e7519 (diff) | |
download | ruby-54fc5df3370340e0ea1498e3c5319b95f668eec0.tar.gz |
mkmf.rb: split --libs
* 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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/mkmf.rb | 15 |
2 files changed, 17 insertions, 4 deletions
@@ -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 |