-cxx_warnings_as_errors=""
-AC_ARG_ENABLE(
- [warnings-as-errors],
- [--enable-warnings-as-errors Treat compiler warnings as errors],
- [cxx_warnings_as_errors="-Werror"]
-)
+
+dnl The three macros above are known to override CFLAGS if the user
+dnl didn't specify them. Though I'm sure somebody thought this was
+dnl a good idea, it makes it hard to use other than -g -O2 when compiling
+dnl selected files. Thus we "undo" the damage here...
+dnl
+dnl If the user specified CFLAGS, we use them.
+dnl See Makefile.common for the rest of the magic.
+if test "$user_set_cflags" != yes; then
+ autoconf_default_CFLAGS="$CFLAGS"
+ CFLAGS=""
+fi
+AC_SUBST(autoconf_default_CFLAGS)
+