diff options
author | Pedro Alves <palves@redhat.com> | 2016-01-21 11:18:45 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-01-21 11:18:45 +0000 |
commit | a994041db36c9a6058fe591c7ccd018ed7affc76 (patch) | |
tree | 92f99c044731b750b9855d971f15d6182d287210 /gdb/gdbserver | |
parent | aebf9be7089c1903581740851ae9ae67ffee2f4b (diff) | |
download | gdb-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/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gdbserver/Makefile.in | 7 | ||||
-rwxr-xr-x | gdb/gdbserver/configure | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index c33c5d3..9c42fcf 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +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. + 2016-01-21 Yao Qi <yao.qi@linaro.org> * linux-arm-low.c (arm_sigreturn_next_pc): Add parameter diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 4719e48..f9b9dbe 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -51,6 +51,8 @@ RANLIB = @RANLIB@ # The name of the compiler to use. COMPILER = @COMPILER@ +# Set to CFLAGS or CXXFLAGS, depending on compiler/language. +COMPILER_CFLAGS = @COMPILER_CFLAGS@ CC = @CC@ CXX = @CXX@ @@ -129,13 +131,14 @@ WERROR_CFLAGS = @WERROR_CFLAGS@ WARN_CFLAGS_NO_FORMAT = `echo " $(WARN_CFLAGS) " \ | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"` -# CFLAGS is specifically reserved for setting from the command line +# These are specifically reserved for setting from the command line # when running make. I.E. "make CFLAGS=-Wmissing-prototypes". CFLAGS = @CFLAGS@ +CXXFLAGS = @CXXFLAGS@ CPPFLAGS = @CPPFLAGS@ # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. -INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \ +INTERNAL_CFLAGS_BASE = ${COMPILER_CFLAGS} ${GLOBAL_CFLAGS} \ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS) INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 763c77d..4a6f26b 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -615,6 +615,7 @@ DEPDIR am__leading_dot host_noncanonical target_noncanonical +COMPILER_CFLAGS COMPILER RANLIB AR @@ -4834,12 +4835,15 @@ fi if test "$enable_build_with_cxx" = "yes"; then COMPILER='$(CXX)' + COMPILER_CFLAGS='$(CXXFLAGS)' else COMPILER='$(CC)' + COMPILER_CFLAGS='$(CFLAGS)' fi + # Set the 'development' global. . $srcdir/../../bfd/development.sh |