[Buildroot] [PATCH 1/1] ti-gfx: pkg-config should also set parent include dir

Peter Kümmel syntheticpp at gmx.net
Fri May 30 21:29:55 UTC 2014


On 30.05.2014 22:52, Peter Korsgaard wrote:
>>>>>> "Peter" == Peter Kümmel <syntheticpp at gmx.net> writes:
>
> Hi,
>
>   >> Agreed, and therefore I'd like to understand in more details why the
>   >> patch is needed. We typically don't commit things we don't understand
>   >> why they are needed :)
>
>   > In short: anybody assumes "#include <GLES2/gl2.h>" works when the search
>   > paths of pkg-config are used. But when pkg-config reports /usr/include/GLES2
>   > gl2.h could not be found, because there is no /usr/include/GLES2/GLES2/gl2.h.
>
>   > Until now this doesn't pop up because by chance the directory GLES2
>   > resides in /usr/include and this path is added by most by build systems.
>   > But the cmake configure scripts of Qt5 test for "GLES2/gl2.h" only in the path
>   > reported by pkg-config.
>
> But $SYSROOT/usr/include is the standard include path, so gcc
> automatically looks there. What exactly doesn't work for you?

See my last mail with the cmake code.

Overall I think it is the best solution that pkg-config reports
a path which in combination with the uppercase prefix in #include
makes it possible to include an OpenGL header without being dependent
on any implicit set include paths.

I don't know if Ubuntu is a reference here, but when you install gles2
     sudo apt-get install libgles2-mesa-dev
and have a look at the.pc file,
     cat /usr/lib/x86_64-linux-gnu/pkgconfig/glesv2.pc
(or gl.pc) you see, that there also the path to the dir containing GLES2 is set:

prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib/x86_64-linux-gnu
includedir=${prefix}/include

Name: glesv2
Description: Mesa OpenGL ES 2.0 library
Requires.private:
Version: 9.0.3
Libs: -L${libdir} -lGLESv2
Libs.private: -lm -lpthread -ldl
Cflags: -I${includedir}


>
> This is exactly the same as E.G. #include <sys/stat.h> for open(2).
>




More information about the buildroot mailing list