-isystem in pc(5) (was: Packaging liba2i, a new library I wrote, for Gentoo)
Guillem Jover
guillem at hadrons.org
Tue Feb 27 17:15:38 UTC 2024
Hi!
On Tue, 2024-02-27 at 17:52:57 +0100, Alejandro Colomar wrote:
> On Wed, Feb 07, 2024 at 03:01:14AM +0100, Alejandro Colomar wrote:
> > >
> > > * pkgconfig: The pkgconfig file looks wrong
> > > (https://www.alejandro-colomar.es/src/alx/alx/lib/liba2i.git/tree/share/pkgconfig/liba2i-uninstalled.pc#n13):
> > > I don't think you should be injecting things into -isystem like that,
> >
> > Hmm, I thought this was normal. Otherwise, programs would get warnings
> > from included libraries, no?
> >
> > But after your comment, I looked at my system, and indeed you seem to be
> > right:
> I have seen again the first pc(5) file that I saw in my life, from which
> I learnt to write my libraries. It was libbsd, which I started using
> long ago. It uses -isystem. That's probably why I always used
> -isystem. Is it problematic?
>
> $ pkgconf --cflags libbsd-overlay
> -isystem /usr/include/bsd -DLIBBSD_OVERLAY
>
> I've always thought it would be the right choice, as you don't want to
> inject warnings in other projects. But majority seems to be with '-I',
> as I learnt recently.
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.
Thanks,
Guillem
More information about the libbsd
mailing list