-isystem in pc(5) (was: Packaging liba2i, a new library I wrote, for Gentoo)

Guillem Jover guillem at hadrons.org
Tue Feb 27 17:48:53 UTC 2024


On Tue, 2024-02-27 at 18:27:18 +0100, Alejandro Colomar wrote:
> On Tue, Feb 27, 2024 at 06:15:38PM +0100, Guillem Jover wrote:
> > Notice how the libbsd.pc file uses -I, while libbsd-overlay.pc uses
> > -isystem to make it behave as if it was part of the system, help with
> > the include_next magic, and give it less priority than user supplied
> > include directories. But, yeah otherwise I don't think this is an
> > option normal libraries should be using.
> 
> Ahh, makes sense.  Thanks!

I'll add a comment to the «.pc» file to make this clear for future
unsuspecting readers. :)

> BTW, I'm a bit puzzled about this:
> 
> 	$ pkg-config --path libbsd
> 	/usr/lib/x86_64-linux-gnu/pkgconfig/libbsd.pc
> 	$ grep Cflags <$(pkg-config --path libbsd)
> 	Cflags: -I${includedir}
> 	$ pkg-config --cflags libbsd
> 
> 	$ echo $?
> 	0
> 
> Why is there no output at all?

pkg-config implementations understand several/most of the
pre-processor/compiler flags involved in path settings, and if they
detect they are redundant (as in passing a system directories), then
they will remove the entry to avoid duplication.

Thanks,
Guillem


More information about the libbsd mailing list