[Intel-gfx] [PATCH i-g-t 01/12] build: Define _GNU_SOURCE in Makefile.am

Daniel Vetter daniel at ffwll.ch
Mon Sep 4 08:48:06 UTC 2017


On Sun, Sep 03, 2017 at 10:27:03AM +0100, Chris Wilson wrote:
> Quoting Daniel Vetter (2017-09-02 18:03:55)
> > In meson I want to just set this everywhere (no reason not to), and
> > doing so will allow us to clean up a few things.
> 
> GNU_SOURCE is defined in config.h, which should be included from all
> files (at least those that depend on system library foibles). I presume
> you intend to move all of config.h onto the command line?

Wrt including config.h, we seem to be rather inconsistent with that. So
what I opted for is to put stuff like that onto the cmdline, and generate
a minimal config.h with just the few #defines we actually use in the meson
build. That seems a robust approach, since if you use such a #define
without including config.h, you'll get a complain. GNU_SOURCE otoh doesn't
result in any complaints if you don't set it, but it is rather surprising
to have it in some files, but not in others. Hence why I figured it's best
to just add it to the gcc cmdline.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list