Bug 1278 - [PENDING] pkg-config breaks packages that use two or more -framework flags on MacOS X
Summary: [PENDING] pkg-config breaks packages that use two or more -framework flags on...
Status: RESOLVED FIXED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: PowerPC All
: high blocker
Assignee: Dan Nicholson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-02 12:42 UTC by Denis de Leeuw Duarte
Modified: 2016-01-29 22:45 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
[PATCH] Also match -Wl,-framework for OSX framework (1.05 KB, patch)
2014-09-28 00:11 UTC, Dan Nicholson
Details | Splinter Review

Description Denis de Leeuw Duarte 2004-09-02 12:42:27 UTC
On OS X, gcc has a special -framework flag, which is used to link against
frameworks (frameworks are directories containing ordinary libraries). The
framework flag is a flag with a parameter. pkg-config messes up these flags
because it weeds out duplicates. For instance, if a package links against two
frameworks, Foo and Bar, we get this:

   -framework Foo -framework Bar

..which gets mangled by pkgconfig into:

   -framework Foo Bar

..which gcc will parse as '-framework Foo' with some garbage 'Bar'. 

So, each package that uses pkgconfig on OS X will break if it uses more than one
-framework flag.
Comment 1 Tollef Fog Heen 2005-04-02 01:07:23 UTC
 2005-04-02  Tollef Fog Heen  <tfheen@err.no>

       * parse.c (parse_libs): Handle -framework as a single argument.
       (Freedesktop #1278)

If you could try with the current CVS version, that would be nice.  It seems to
work in my preliminary testing.
Comment 2 Tollef Fog Heen 2005-04-12 04:18:01 UTC
pkg-config 0.17 released; closing bug
Comment 3 Hanspeter Niederstrasser 2013-05-21 11:02:03 UTC
Still broken:

$ cat libcdio.pc 
prefix=/sw
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libcdio
Description: Portable CD-ROM I/O library
Version: 0.79
#Requires: glib-2.0 
Libs: -L${libdir} -lcdio -L/sw/lib -lm  -Wl,-framework -Wl,CoreFoundation -Wl,-framework -Wl,IOKit
Cflags: -I${includedir}

$ pkg-config --libs libcdio
-L/sw/lib -Wl,-framework -Wl,CoreFoundation -Wl,IOKit -lcdio -lm
Comment 4 Dan Nicholson 2014-09-28 00:11:54 UTC
Created attachment 106975 [details] [review]
[PATCH] Also match -Wl,-framework for OSX framework


Freedesktop #1278 (https://bugs.freedesktop.org/show_bug.cgi?id=1278)
---
 parse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 5 Dan Nicholson 2014-09-28 00:12:39 UTC
Does the attached patch fix things for you? We were only matching on -framework and not -Wl,-framework.
Comment 6 Dan Nicholson 2016-01-29 22:45:20 UTC
Went ahead and pushed the fix in 8d19fad. Moving back to fixed.


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.