title: How to set default CPPFLAGS on autotools project
body: <p>I need to set "-Wall -Werror" as CPPFLAGS for all the source files in my project. Is there a way to do that in autotools?</p>
  
  <p>I have tried the following in configure.ac:</p>
  
  <pre><code>AC_SUBST([AM_CPPFLAGS], [-Wall -Wextra])
  </code></pre>
  
  <p>It doesn't seem to work.</p>
  
  <p><strong>EDIT:</strong>
  I found an m4 macro called AX_CXXFLAGS_WARN_ALL here: <a href="http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html" rel="nofollow">http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html</a> However I get the following error when I try to use it:</p>
  
  <pre><code>configure.ac:10: /usr/bin/m4: ERROR: recursion limit of 1024 exceeded, use -L&lt;N&gt; to change it
  autom4te: /usr/bin/m4 failed with exit status: 1
  aclocal: autom4te failed with exit status: 1
  autoreconf: aclocal failed with exit status: 1
  </code></pre>
  
  <p>My configure.ac is as follows:</p>
  
  <pre><code>AC_INIT([foo], [1.0], [bar@baz.com])
  m4_include([m4/ax_cflags_warn_all.m4])
  m4_include([m4/ax_append_flag.m4])
  m4_include([m4/ax_lib_oracle_oci.m4])
  m4_include([m4/ax_check_openssl.m4])
  AM_INIT_AUTOMAKE([foreign subdir-objects])
  AM_PROG_CC_C_O
  AC_PROG_CXX
  AC_PROG_LIBTOOL
  AX_CFLAGS_WARN_ALL
  AC_CONFIG_HEADERS([config.h])
  AC_CONFIG_FILES([Makefile])
  AX_LIB_ORACLE_OCI([11.0])
  AX_CHECK_OPENSSL
  AC_SUBST([AM_CXXFLAGS], [-fpic])
  AC_OUTPUT
  </code></pre>