diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-03 09:43:59 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-03 09:43:59 +0000 |
commit | f81db3c80ee49b0259cb8641630beeca58cb6af4 (patch) | |
tree | 6a5478aba5fac097d6455c104e73a71f335c41be /lib | |
parent | bf571987ecdb9faf350ee3bcd772fca5a3e79f85 (diff) |
merge revision(s) 50717: [Backport #11201]
* 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/branches/ruby_2_1@51123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mkmf.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index f5c462b58e..7a59e572bf 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1756,11 +1756,18 @@ SRC elsif get and try_ldflags(ldflags = get['libs']) cflags = get['cflags'] 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 |