Don't override CFLAGS etc in configure-generated makefile

CPPFLAGS, CFLAGS, CXXFLAGS and LDFLAGS are supposed to be under
user-control and putting configure-determined options in them broke
something as simple as running "make CXXFLAGS=-Wno-some-extra-warning"
because this overrode the CXXFLAGS set by configure and required for
build.

Improve this by using WX_*FLAGS in the generated makefile and leaving
the user-controlled FLAGS alone. This is still not ideal as running
"configure CFLAGS=-DFOO" and then "make CFLAGS=-DBAR" will define both
FOO and BAR, as configure copies CFLAGS to WX_CFLAGS, and so setting it
on make command line won't override it, as it should, but this should be
a much more rare and also much less severe problem, so we should be able
to live with it for now.

Normally this commit shouldn't result in any user-visible changes, i.e.
it shouldn't break any previously working scenarios and only make some
previously broken ones work.
This commit is contained in:
Vadim Zeitlin 2020-02-02 01:57:11 +01:00
parent 13b0981eb9
commit ec091c9f2b
117 changed files with 1238 additions and 922 deletions

View file

@ -379,6 +379,10 @@
</if>
<define>$(NO_VC_CRTDBG)</define>
<define>$(WIN32_WINNT)</define>
<cppflags cond="FORMAT=='autoconf'">$(WX_CPPFLAGS)</cppflags>
<cflags cond="FORMAT=='autoconf'">$(WX_CFLAGS)</cflags>
<cxxflags cond="FORMAT=='autoconf'">$(WX_CXXFLAGS)</cxxflags>
<ldflags cond="FORMAT=='autoconf'">$(WX_LDFLAGS)</ldflags>
<res-define>$(WIN32_DPI_MANIFEST)</res-define>
<ldflags>$(WIN32_DPI_LINKFLAG)</ldflags>
<if cond="FORMAT=='msvc'">
@ -557,7 +561,6 @@ $(TAB)cl /EP /nologo "$(DOLLAR)(InputPath)" > "$(SETUPHDIR)\wx\msw\rcdefs.h"
<lib-path>$(LIBDIRNAME)</lib-path>
<warnings>max</warnings>
<cxxflags cond="FORMAT=='autoconf'">$(CXXWARNINGS)</cxxflags>
<cppflags-watcom>
-wcd=549 <!-- 'sizeof' operand contains compiler generated information -->
-wcd=656 <!-- define this function inside its class definition (may improve code quality) -->