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

@@ -31,7 +31,9 @@ TOOLKIT_VERSION = @TOOLKIT_VERSION@
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@
@@ -40,10 +42,10 @@ wx_top_builddir = @wx_top_builddir@
DESTDIR =
WX_RELEASE = 3.1
LIBDIRNAME = $(wx_top_builddir)/lib
EXECMON_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \
$(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \
-I$(srcdir) $(__DLLFLAG_p) -DwxUSE_GUI=0 $(CXXWARNINGS) $(CPPFLAGS) \
$(CXXFLAGS)
EXECMON_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) -DwxUSE_GUI=0 $(WX_CXXFLAGS) \
$(CPPFLAGS) $(CXXFLAGS)
EXECMON_OBJECTS = \
execmon_execmon.o
@@ -107,7 +109,7 @@ distclean: clean
rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
@COND_USE_XRC_1@execmon$(EXEEXT): $(EXECMON_OBJECTS)
@COND_USE_XRC_1@ $(CXX) -o $@ $(EXECMON_OBJECTS) -L$(LIBDIRNAME) $(LDFLAGS) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_PNG_IF_MONO_p) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS)
@COND_USE_XRC_1@ $(CXX) -o $@ $(EXECMON_OBJECTS) $(WX_LDFLAGS) -L$(LIBDIRNAME) $(LDFLAGS) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_PNG_IF_MONO_p) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS)
@COND_USE_XRC_1@install_execmon: $(__execmon___depname)
@COND_USE_XRC_1@ $(INSTALL_DIR) $(DESTDIR)$(bindir)