From: Bruno Haible Date: Sat, 1 Feb 2020 14:51:26 +0000 (+0100) Subject: ansi-c++-opt: Set CXXFLAGS to "-g -O2" by default. X-Git-Tag: v1.0~4286 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=ffcdc458053b9a161294dd04a9a869bd43a636ba;p=gnulib.git ansi-c++-opt: Set CXXFLAGS to "-g -O2" by default. * m4/ansi-c++.m4 (gl_PROG_ANSI_CXX): Determine CXXFLAGS like AC_PROG_CXX does. --- diff --git a/ChangeLog b/ChangeLog index 604c94917c..b89d50a641 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-02-01 Bruno Haible + + ansi-c++-opt: Set CXXFLAGS to "-g -O2" by default. + * m4/ansi-c++.m4 (gl_PROG_ANSI_CXX): Determine CXXFLAGS like AC_PROG_CXX + does. + 2020-01-29 Bruno Haible array-map, hash-map, linkedhash-map: Fix module description. diff --git a/m4/ansi-c++.m4 b/m4/ansi-c++.m4 index 856109f589..f93c324335 100644 --- a/m4/ansi-c++.m4 +++ b/m4/ansi-c++.m4 @@ -1,4 +1,4 @@ -# ansi-c++.m4 serial 10 +# ansi-c++.m4 serial 11 dnl Copyright (C) 2002-2003, 2005, 2010-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -122,6 +122,16 @@ EOF dnl /usr/local/share/automake-1.11/am/depend2.am: The usual way to define 'am__fastdepCXX' is to add 'AC_PROG_CXX' dnl /usr/local/share/automake-1.11/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again. _AM_DEPENDENCIES([CXX]) + dnl Determine a good default for the CXXFLAGS variable. + AC_LANG_PUSH([C++]) + _AC_LANG_COMPILER_GNU + if test $ac_compiler_gnu = yes; then + GXX=yes + else + GXX= + fi + _AC_PROG_CXX_G + AC_LANG_POP([C++]) else AM_CONDITIONAL([am__fastdepCXX], [false]) fi