mkmf.rb: mingw64+MSYS pkg-config fix

* lib/mkmf.rb (MakeMakefile#pkg_config): strip all white spaces for
  mingw64+MSYS pkg-config which errouneously emits extra newlines.
  [ruby-core:47998] [Bug #7163]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-11-23 14:44:45 +00:00
parent 400d2d9d03
commit e54cd2bd97
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,9 @@
Fri Nov 23 23:44:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (MakeMakefile#pkg_config): strip all white spaces for
mingw64+MSYS pkg-config which errouneously emits extra newlines.
[ruby-core:47998] [Bug #7163]
Fri Nov 23 17:31:54 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (usage): wrap description lines if options are too long.

View File

@ -1,3 +1,4 @@
# -*- coding: us-ascii -*-
# module to create Makefile for extension modules
# invoke like: ruby -r mkmf extconf.rb
@ -1668,16 +1669,16 @@ SRC
def pkg_config(pkg)
if pkgconfig = with_config("#{pkg}-config") and find_executable0(pkgconfig)
# iff package specific config command is given
get = proc {|opt| `#{pkgconfig} --#{opt}`.chomp}
get = proc {|opt| `#{pkgconfig} --#{opt}`.strip}
elsif ($PKGCONFIG ||=
(pkgconfig = with_config("pkg-config", ("pkg-config" unless CROSS_COMPILING))) &&
find_executable0(pkgconfig) && pkgconfig) and
system("#{$PKGCONFIG} --exists #{pkg}")
# default to pkg-config command
get = proc {|opt| `#{$PKGCONFIG} --#{opt} #{pkg}`.chomp}
get = proc {|opt| `#{$PKGCONFIG} --#{opt} #{pkg}`.strip}
elsif find_executable0(pkgconfig = "#{pkg}-config")
# default to package specific config command, as a last resort.
get = proc {|opt| `#{pkgconfig} --#{opt}`.chomp}
get = proc {|opt| `#{pkgconfig} --#{opt}`.strip}
end
if get and try_ldflags(ldflags = get['libs'])
cflags = get['cflags']