Bug 50677

Summary: Fix usage of pkg-config with redirections in windows
Product: pkg-config Reporter: Andoni Morales Alastruey <ylatuya>
Component: srcAssignee: Dan Nicholson <dbn.lists>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Open stdout in binary mode to avoid inserting CR+LF line endings

Description Andoni Morales Alastruey 2012-06-04 06:31:18 UTC
Created attachment 62507 [details] [review]
Open stdout in binary mode to avoid inserting CR+LF line endings

On windows, pkg-config is adding CR+LF line endings writing to stdout, which breaks the usage of pkg-config in most configure scripts.
The proposed patch sets the binary mode in stdout instead of the default text mode which uses the CR+LF line endings.
Comment 1 Dan Nicholson 2012-08-14 12:53:24 UTC
What environment are you using exactly? mingw/msys? msvc/cmd? Also, what version of pkg-config are you using?

The reason I ask is because pkg-config (at least 0.27) does not itself write out \r. Previously it was adding \r for the final newline, but it was found that it was working around a bug in an older msys shell. That commit was reverted in 79c768aa and now pkg-config only writes \n. It's the shell programs that are adding the \r. Take a look at bug 17053.

Can you try the current version or at least with commit 79c768aa applied to your version?
Comment 2 Andoni Morales Alastruey 2012-11-01 02:07:15 UTC
My bug was caused by 79c768aa.

*** This bug has been marked as a duplicate of bug 17053 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.