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/configure | |
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/configure')
-rwxr-xr-x | gdb/configure | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/configure b/gdb/configure index 701cfcb..26a00d8 100755 --- a/gdb/configure +++ b/gdb/configure @@ -731,6 +731,7 @@ MAKE CCDEPMODE DEPDIR am__leading_dot +COMPILER_CFLAGS COMPILER INSTALL_STRIP_PROGRAM STRIP @@ -5015,12 +5016,15 @@ fi if test "$enable_build_with_cxx" = "yes"; then COMPILER='$(CXX)' + COMPILER_CFLAGS='$(CXXFLAGS)' else COMPILER='$(CC)' + COMPILER_CFLAGS='$(CFLAGS)' fi + # Dependency checking. rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null |