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

@@ -32,7 +32,9 @@ TOOLCHAIN_FULLNAME = @TOOLCHAIN_FULLNAME@
EXTRALIBS = @EXTRALIBS@
EXTRALIBS_XML = @EXTRALIBS_XML@
EXTRALIBS_GUI = @EXTRALIBS_GUI@
CXXWARNINGS = @CXXWARNINGS@
WX_CPPFLAGS = @WX_CPPFLAGS@
WX_CXXFLAGS = @WX_CXXFLAGS@
WX_LDFLAGS = @WX_LDFLAGS@
HOST_SUFFIX = @HOST_SUFFIX@
wx_top_builddir = @wx_top_builddir@
@@ -41,10 +43,10 @@ wx_top_builddir = @wx_top_builddir@
DESTDIR =
WX_RELEASE = 3.1
LIBDIRNAME = $(wx_top_builddir)/lib
WXEMULATOR_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \
WXEMULATOR_CXXFLAGS = $(WX_CPPFLAGS) -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) \
$(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
$(__THREAD_DEFINE_p) -I$(srcdir) $(__DLLFLAG_p) \
-I$(srcdir)/../../../samples $(CXXWARNINGS) $(CPPFLAGS) $(CXXFLAGS)
-I$(srcdir)/../../../samples $(WX_CXXFLAGS) $(CPPFLAGS) $(CXXFLAGS)
WXEMULATOR_OBJECTS = \
$(__wxemulator___win32rc) \
wxemulator_emulator.o
@@ -133,7 +135,7 @@ distclean: clean
rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
wxemulator$(EXEEXT): $(WXEMULATOR_OBJECTS) $(__wxemulator___win32rc)
$(CXX) -o $@ $(WXEMULATOR_OBJECTS) -L$(LIBDIRNAME) $(LDFLAGS_GUI) $(LDFLAGS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS)
$(CXX) -o $@ $(WXEMULATOR_OBJECTS) $(WX_LDFLAGS) -L$(LIBDIRNAME) $(LDFLAGS_GUI) $(LDFLAGS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS)
$(__wxemulator___os2_emxbindcmd)
data: