Search code examples
makefileautotoolsautomakesuppress-warningsautogen

How do I remove -Werror from autotools-generated makefiles?


I am compiling a large library which uses the autotools build process. There are many makefiles. Each of them are getting CFLAGS = .... -Werror.

When I attempt to compile there are some minor warnings which kill the build on my setup.

I would like to try building despite the warnings so I need to take the -Werror out of all the makefiles. Is there a way to prevent autotools from putting in -Werror in all these makefiles?


Solution

  • I poked around in configure.ac and found this:

    AC_ARG_ENABLE([werror],
      AS_HELP_STRING([--disable-werror], [Do not treat warnings as errors]),
      [gcc_werror=$enableval], [gcc_werror=$gcc_warnings])
    

    So I ran configure like this:

    ./configure --disable-werror
    

    It worked like a charm. No more -Werror flags in my makefile. Thanks for your comment Till!