Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Alex Ameen
The rationale for placement of `CPPFLAGS` early is to allow users to better control include ordering. This is similar to why `CFLAGS` is last. Consider this situation : User wants to preempt the default include path, and wants to override the C standard. make CPPFLAGS='-Ifoo/bar'

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Evgeny Grin
On 24.03.2022 21:37, Nick Bowler wrote: On 2022-03-24, Zack Weinberg wrote: On Thu, Mar 24, 2022, at 11:13 AM, Nick Bowler wrote: However, GNU coding standards state that CFLAGS should be the last item on compilation commands, so it would appear that this is a case where traditional "make"

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Evgeny Grin
Original Message From: Evgeny Grin Sent: Thursday, March 24, 2022, 14:26 UTC+3 Subject: Wrong order of preprocessor and compiler flags I've found that everywhere in autoconf scripts flags are used like: $CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >_MESSAGE_LOG_FD while

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Nick Bowler
On 2022-03-24, Zack Weinberg wrote: > On Thu, Mar 24, 2022, at 11:13 AM, Nick Bowler wrote: >> However, GNU coding standards state that CFLAGS should be the last >> item on compilation commands, so it would appear that this is a case >> where traditional "make" behaviour contrasts with GNU

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Zack Weinberg
On Thu, Mar 24, 2022, at 11:13 AM, Nick Bowler wrote: > On 2022-03-23, Zack Weinberg wrote: >> ... before we change >> anything, we need to check what the rules *built into GNU and BSD >> Make* do with CFLAGS and CPPFLAGS (and also CXXFLAGS, OBJCFLAGS, etc) >> because those are much much harder

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Nick Bowler
On 2022-03-23, Zack Weinberg wrote: > On Wed, Mar 23, 2022, at 11:31 AM, Evgeny Grin wrote: >> I've found that everywhere in autoconf scripts flags are used like: >> $CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >_MESSAGE_LOG_FD >> while automake and libtool use flags in the other order: >> $(CC)

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Evgeny Grin
I've found that everywhere in autoconf scripts flags are used like: $CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >_MESSAGE_LOG_FD while automake and libtool use flags in the other order: $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) I agree that

Re: Wrong order of preprocessor and compiler flags

2022-03-23 Thread Zack Weinberg
On Wed, Mar 23, 2022, at 11:31 AM, Evgeny Grin wrote: > Hello, > > I've found that everywhere in autoconf scripts flags are used like: > $CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >_MESSAGE_LOG_FD > while automake and libtool use flags in the other order: > $(CC) $(DEFS) $(DEFAULT_INCLUDES)