# GNU make is used. The overrides implement dependency tracking.
COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
COMPILE.post = -c -o $@
-COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
POSTCOMPILE = @true
+# CXXFLAGS is at the very end on purpose, so that user-supplied flags can
+# override internal flags.
+COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(CXXFLAGS) \
+ $(COMPILE.post)
+
YACC = @YACC@
# This is used to rebuild ada-lex.c from ada-lex.l. If the program is
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
INTERNAL_CFLAGS_BASE = \
- $(CXXFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
+ $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
$(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) $(ZLIBINC) \
$(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \
$(INTL_CFLAGS) $(INCGNU) $(INCSUPPORT) $(ENABLE_CFLAGS) \
@echo Checking headers.
for i in $(CHECK_HEADERS) ; do \
$(CXX) $(CXX_DIALECT) -x c++-header -c -fsyntax-only \
- $(INTERNAL_CFLAGS) -include defs.h $(srcdir)/$$i ; \
+ $(INTERNAL_CFLAGS) $(CXXFLAGS) -include defs.h $(srcdir)/$$i ; \
done
.PHONY: check-headers
+2020-10-07 Simon Marchi <simon.marchi@efficios.com>
+
+ * Makefile.in (COMPILE): Add CXXFLAGS.
+ (INTERNAL_CFLAGS_BASE): Remove CXXFLAGS.
+ (gdbserver$(EXEEXT)): Add CXXFLAGS.
+ (gdbreplay$(EXEEXT)): Add CXXFLAGS.
+ ($(IPA_LIB)): Add CXXFLAGS.
+ (IPAGENT_COMPILE): Add CXXFLAGS.
+
2020-10-07 Anton Kolesov <anton.kolesov@synopsys.com>
* configure.srv: Support ARC architecture.
# GNU make is used. The overrides implement dependency tracking.
COMPILE.pre = $(CXX) $(CXX_DIALECT)
COMPILE.post = -c -o $@
-COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
POSTCOMPILE = @true
+# CXXFLAGS is at the very end on purpose, so that user-supplied flags can
+# override internal flags.
+COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(CXXFLAGS) $(COMPILE.post)
+
# It is also possible that you will need to add -I/usr/include/sys to the
# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
# is where it should be according to Posix).
WIN32APILIBS = @WIN32APILIBS@
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
-INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \
+INTERNAL_CFLAGS_BASE = ${GLOBAL_CFLAGS} \
${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS)
INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
$(INTL_DEPS) $(GDBSUPPORT)
$(SILENCE) rm -f gdbserver$(EXEEXT)
$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
+ $(CXXFLAGS) \
-o gdbserver$(EXEEXT) $(OBS) $(GDBSUPPORT) $(LIBGNU) \
$(LIBIBERTY) $(INTL) $(GDBSERVER_LIBS) $(XM_CLIBS) \
$(WIN32APILIBS)
$(INTL_DEPS) $(GDBSUPPORT)
$(SILENCE) rm -f gdbreplay$(EXEEXT)
$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
+ $(CXXFLAGS) \
-o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) \
$(GDBSUPPORT) $(LIBGNU) $(LIBIBERTY) $(INTL) \
$(WIN32APILIBS)
$(SILENCE) rm -f $(IPA_LIB)
$(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
-Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
+ $(CXXFLAGS) \
-o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
# Put the proper machine-specific files first, so M-. on a machine
-fPIC -DIN_PROCESS_AGENT \
-fvisibility=hidden
-IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post)
+# CXXFLAGS is at the very end on purpose, so that user-supplied flags can
+# override internal flags.
+IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(CXXFLAGS) $(COMPILE.post)
# Rules for special cases.