[Flac-dev] 1.2.1 pkg-config file "error"

Josh Coalson
Sat, 29 Nov 2008 20:57:13 -0000

good catch, fixed in CVS

--- Paul Davis <paul at linuxaudiosystems.com> wrote:

> hi, and sorry that my first post to the list is a complaint.
>
> the .pc file for 1.2.1 produces this for --cflags:
>
>     -I$PREFIX/include/FLAC
>
> i humbly suggest that this is wrong. it appears to support inclusion
> of
> FLAC headers with
>
>     #include <filename.h>
>
> rather than
>
>     #include <FLAC/filename.h>
>
> but more importantly, it means that when building an app using
> pkg-config to determine compiler flags, we end up with a rather
> serious
> problem as soon as the app uses "assert.h":
>
>    #include <assert.h>
>
>  combined with:
>
>    -I/usr/local/include/FLAC
>
> means that we find the FLAC assert.h file first. this file the tries
> to
> help out by doing
>
>   #include <assert.h>
>
> which simply causes it to include itself again.
>
> The .pc.in file should use $PREFIX/include for the cflags, not
> $includedir which is where the headers are installed. apps should use
> <FLAC/foobar.h> to include FLAC headers, not <foobar.h> as this
> mistake with assert.h demonstrates.
>
> --p