]> Savannah Git Hosting - gnulib.git/commitdiff
ansi-c++-opt: Set CXXFLAGS to "-g -O2" by default.
authorBruno Haible <bruno@clisp.org>
Sat, 1 Feb 2020 14:51:26 +0000 (15:51 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 1 Feb 2020 14:51:26 +0000 (15:51 +0100)
* m4/ansi-c++.m4 (gl_PROG_ANSI_CXX): Determine CXXFLAGS like AC_PROG_CXX
does.

ChangeLog
m4/ansi-c++.m4

index 604c94917caf94332df7dc99847f308cdf9b37cb..b89d50a641699bd1f48fd044029db57f38babb4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-02-01  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        array-map, hash-map, linkedhash-map: Fix module description.
index 856109f589f0dfda38f95b1bb496a79dd7508c93..f93c324335bb007e56119f382f0f0188c19adcfc 100644 (file)
@@ -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