[Mesa-dev] [PATCH 1/7] i965: use AM_CPPFLAGS instead of AM_CFLAGS/CXXFLAGS

Eric Anholt eric at anholt.net
Thu Jan 19 09:44:21 PST 2012


On Wed, 18 Jan 2012 13:38:38 -0500, Gaetan Nadon <memsize at videotron.ca> wrote:
> On 12-01-18 01:11 PM, Eric Anholt wrote:
> > On Tue, 17 Jan 2012 15:58:11 -0500, Matt Turner <mattst88 at gmail.com> wrote:
> >
> > As far as I can tell, the point of AM_CPPFLAGS existing is if you want
> > to make a target that separately calls the preprocessor, so you a list
> > of includes and a list of non-preprocessor compiler flags.  Given that
> > we don't have any preprocessor invocations, we're sure to leak actual
> > cflags into the cppflags, so I don't see why we'd make this change..
> That's the only scenario I am aware of that will actually "break". You
> never know when this target might be added in the makefile. It's
> preferable to keep the flags separate where possible. Automake keeps
> them separate from top to bottom. A builder can append flags at make
> invocation using CFLAGS and CPPFLAGS, knowing they will used with the
> correct target.
> 
> Unfortunately too many developers don't bother and when mixed flags are
> passed in through a variable from another module, they cannot be
> separated again.
> 
> In another post, I expressed my reservations due to INTEL_CFLAGS that
> may contain mixed flags. Using AM_CFLAGS would be safer, unfortunately.

We have no preprocessor-using those targets, so the person adding one
would have to deal with it.  If you try to split today with no target
present, they'll still have to deal with it when they add the first
target, because it will be broken.

Part of the reason I'm so confident that it will be broken when the
first target is added (if ever -- I don't expect one, making this all a
waste of time) is that llvm puts compiler flags in their config, and I
expect to see llvm used in more pieces of Mesa over time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120119/e859340d/attachment.pgp>


More information about the mesa-dev mailing list