Simon Josefsson <[EMAIL PROTECTED]> writes: > This is likely a autoconf or automake question, but since it was related > to the warnings module, and some of the relevant people is on this list > as well, I'm trying to raise it here: > > How do I get the WARN_CFLAGS variable defined in all of my Makefile's? > In GnuTLS, I now use AC_CONFIG_SUBDIR for lib/ and libextra/ > sub-directories. I want to add this to my top-level configure.ac: > > gl_WARN_ADD([-W]) > > and then get the WARN_CFLAGS replicated into lib/Makefile and > libextra/Makefile as well. > > I've tried adding AC_SUBST and AC_ARG_VAR for WARN_CFLAGS in > lib/configure.ac, and the variables were defined in lib/Makefile but the > content was empty. > > Any ideas? > > What mechanism propagates the CFLAGS setting to sub-directories? I used > to add -W etc to CFLAGS in the top-level configure.ac, and they were > propagated into lib/Makefile and libextra/Makefile without problem. One > solution I thought about was if I could mark WARN_CFLAGS as a similar > variable to CFLAGS somehow.
For the record, I found the solution to this problem, and it was to put export WARN_CFLAGS in the top-level configure.ac and to put AC_SUBST([WARN_CFLAGS]) in sub-ordinate configure.ac's. /Simon