Summary: | pkg-config: Does not support sysroot when using -isystem or -idirafter flags (affects libbsd-overlay) | ||
---|---|---|---|
Product: | pkg-config | Reporter: | Vincent Bernat <bernat> |
Component: | src | Assignee: | Dan Nicholson <nicholson> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | guillem, nicholson, ola.x.nilsson |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
check: Add more flags to the special-flags test
check: Include special-flags in sysroot test Respect sysroot for -isystem and -idirafter |
Description
Vincent Bernat
2016-08-13 22:16:06 UTC
HiĀ” I think this needs to be fixed in pkg-config itself. Because it already understands -isystem and -idirafter, but it does not prefix them with the sysroot path when specified. As a "temporary" workarounds you could switch to use pkgconf which seems to have already fixed this issue last month. Because the only workarounds that occur to me when using pkg-config for now are to fix its output in configure.ac scripts and similar which might bee too invasive. Or perhaps hardcode the sysroot path in the libbsd-overlay.pc file? (ugh) Hmm, hadn't thought of that case. pkg-config prepends the sysroot for -I or -L flags. I think it could be extended to cover -isystem pretty easily. Created attachment 126755 [details] [review] check: Add more flags to the special-flags test Make sure that all the flag types are covered so that the ordering between them is being tested. Created attachment 126756 [details] [review] check: Include special-flags in sysroot test Make sure that the sysroot behavior works right when we have non-I/L flags to consider. Created attachment 126757 [details] [review] Respect sysroot for -isystem and -idirafter Treat -isystem and -idirafter as -I Cflags since they control the compiler search path. Adjust the sysroot handling so that the arguments to these options have the sysroot prefixed. However, leave them out of the system Cflags handling since these directives are explicitly trying to adjust the compiler's system header search behavior. The special-flags test case output needs adjustment since all the flags are now considered -I flags and come out in the order specified in the pc file. This fixes it in my testing. The 3rd patch is the important one. The others are just for prepping the test suite. Can you test it out? I went ahead and pushed the patches since I think they do the right thing. Please reopen if this doesn't work for you. Attachment 126755 [details] pushed as a737256 - check: Add more flags to the special-flags test Attachment 126756 [details] pushed as 7707d2f - check: Include special-flags in sysroot test Attachment 126757 [details] pushed as d5d8074 - Respect sysroot for -isystem and -idirafter |
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.