Bug #7163

Chomp problem in pkg_config of mkmf.rb (ruby 1.9.3 P286)

Added by ray linn over 1 year ago. Updated over 1 year ago.

[ruby-core:47998]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:-
Target version:-
ruby -v: Backport:

Description

when compiled the ext packages under mingw64 + MSYS, mkmf reports error like this:

"gcc -o conftest -Ic:/ruby64/include/ruby-1.9.1/x64-mingw32 -Ic:/ruby64/include/ruby-1.9.1/ruby/backward -Ic:/ruby64/include/ruby-1.9.1 -I. -I./.. -DFILEOFFSETBITS=64 -O2 -finline-functions -I/usr/local/include -DUSEMINGWANSISTDIO -IC:/msys/1.0/local/include

conftest.c -L. -Lc:/ruby64/lib -L. -L/usr/local/lib -LC:/msys/1.0/local/lib -lssl -lcrypto

-lx64-msvcrt-ruby191 -lshell32 -lws2_32 -limagehlp "
gcc: fatal error: no input files
compilation terminated.

the root cause is several enter characters are added in this compile command, these enters are from the pkgconfig in mkmf.rb, add chomp in the following line in pkgconfig function, issue is fixed.

cflags = get['cflags']
ldflags = get['libs']
libs = get['libs-only-l']

as
cflags = get['cflags'].chomp
ldflags = get['libs'].chomp
libs = get['libs-only-l'].chomp

the attached is mkmf.log before/after the change.

mkmf.bad.log - before the mkmf.rb change (760 Bytes) ray linn, 10/15/2012 03:01 PM

mkmf.good.log - after the mkmf.rb change (2.04 KB) ray linn, 10/15/2012 03:01 PM

Associated revisions

Revision 37820
Added by Nobuyoshi Nakada over 1 year ago

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. [Bug #7163]

History

#1 Updated by Usaku NAKAMURA over 1 year ago

  • Tracker changed from Backport to Bug
  • Project changed from Backport93 to ruby-trunk
  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

#2 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r37820.
ray, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


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. [Bug #7163]

Also available in: Atom PDF