-isystem in pc(5) (was: Packaging liba2i, a new library I wrote, for Gentoo)
Alejandro Colomar
alx at kernel.org
Tue Feb 27 16:52:57 UTC 2024
[CC += libbsd, Guillem]
Hi Sam,
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:
>
> $ grep -hr Cflags /usr/share/pkgconfig/ \
> | grep -o -- '-I[^ /]*' \
> | sort \
> | uniq -c;
> 31 -I${includedir}
> $ grep -hr Cflags /usr/lib/x86_64-linux-gnu/pkgconfig/ \
> | grep -o -- '-I[^ /]*' \
> | sort \
> | uniq -c;
> 4 -I
> 1 -I${OpenEXR_includedir}
> 3 -I${includearchdir}
> 154 -I${includedir}
> 1 -I${libdir}
> 2 -I${prefix}
> 1 -I${sdkdir}
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.
$ grep -hr Cflags /usr/lib/x86_64-linux-gnu/pkgconfig/ \
| grep -o -- '-isystem' \
| sort \
| uniq -c;
7 -isystem
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/libbsd/attachments/20240227/6106354e/attachment.sig>
More information about the libbsd
mailing list