aboutsummaryrefslogtreecommitdiff
path: root/gdb/Makefile.in
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-01-21 11:18:45 +0000
committerPedro Alves <palves@redhat.com>2016-01-21 11:18:45 +0000
commita994041db36c9a6058fe591c7ccd018ed7affc76 (patch)
tree92f99c044731b750b9855d971f15d6182d287210 /gdb/Makefile.in
parentaebf9be7089c1903581740851ae9ae67ffee2f4b (diff)
downloadgdb-a994041db36c9a6058fe591c7ccd018ed7affc76.zip
gdb-a994041db36c9a6058fe591c7ccd018ed7affc76.tar.gz
gdb-a994041db36c9a6058fe591c7ccd018ed7affc76.tar.bz2
gdb: Respect CXXFLAGS when building with C++ compiler
Currently, even when built with --enable-build-with-cxx, gdb uses CFLAGS instead of CXXFLAGS. This commit fixes it. CXXFLAGS set in the environment when configure was run is now honored in the generated gdb/Makefile, and you can also override CXXFLAGS in the command like at make time, with the usual 'make CXXFLAGS="..."' Objects built with a C compiler (e.g., gnulib) still honor CFLAGS instead. gdb/ChangeLog: 2016-01-21 Pedro Alves <palves@redhat.com> * Makefile.in (COMPILER_CFLAGS): New. (CXXFLAGS): Get it from configure. (INTERNAL_CFLAGS_BASE, INTERNAL_LDFLAGS): Use COMPILER_CFLAGS instead of CFLAGS. * build-with-cxx.m4 (GDB_AC_BUILD_WITH_CXX): Set and AC_SUBST COMPILER_CFLAGS. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2016-01-21 Pedro Alves <palves@redhat.com> * Makefile.in (COMPILER_CFLAGS, CXXFLAGS): New. (INTERNAL_CFLAGS_BASE): Use COMPILER_CFLAGS instead of CFLAGS. * configure: Regenerate.
Diffstat (limited to 'gdb/Makefile.in')
-rw-r--r--gdb/Makefile.in18
1 files changed, 9 insertions, 9 deletions
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 895ece6..5e8eb9a 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -81,6 +81,8 @@ CATALOGS = @CATALOGS@
# The name of the compiler to use.
COMPILER = @COMPILER@
+# Set to CFLAGS or CXXFLAGS, depending on compiler/language.
+COMPILER_CFLAGS = @COMPILER_CFLAGS@
# If you are compiling with GCC, make sure that either 1) You have the
# fixed include files where GCC can reach them, or 2) You use the
@@ -551,9 +553,10 @@ GLOBAL_CFLAGS = $(MH_CFLAGS)
PROFILE_CFLAGS = @PROFILE_CFLAGS@
-# CFLAGS is specifically reserved for setting from the command line
-# when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
+# These are specifically reserved for setting from the command line
+# when running make. I.E.: "make CFLAGS=-Wmissing-prototypes".
CFLAGS = @CFLAGS@
+CXXFLAGS = @CXXFLAGS@
# Set by configure, for e.g. expat. Python installations are such that
# C headers are included using their basename (for example, we #include
@@ -563,14 +566,9 @@ CFLAGS = @CFLAGS@
# a bit the consequences by putting the Python includes last in the list.
INTERNAL_CPPFLAGS = @CPPFLAGS@ @GUILE_CPPFLAGS@ @PYTHON_CPPFLAGS@
-# Need to pass this to testsuite for "make check". Probably should be
-# consistent with top-level Makefile.in and gdb/testsuite/Makefile.in
-# so "make check" has the same result no matter where it is run.
-CXXFLAGS = -g -O
-
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
INTERNAL_CFLAGS_BASE = \
- $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
+ $(COMPILER_CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
$(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) $(ZLIBINC) \
$(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \
$(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS)
@@ -585,7 +583,9 @@ LDFLAGS = @LDFLAGS@
# I think it's perfectly reasonable for a user to set -pg in CFLAGS
# and have it work; that's why CFLAGS is here.
# PROFILE_CFLAGS is _not_ included, however, because we use monstartup.
-INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS)
+INTERNAL_LDFLAGS = \
+ $(COMPILER_CFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) \
+ $(LDFLAGS) $(CONFIG_LDFLAGS)
# If your system is missing alloca(), or, more likely, it's there but
# it doesn't work, then refer to libiberty.