Re: AC_CHECK_FUNCS and gcc with -Werror

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/03/2010 03:27 PM, Steffen Dettmer wrote:
On Wed, Mar 3, 2010 at 2:44 PM, Eric Blake<eblake@xxxxxxxxxx>  wrote:
According to Steffen Dettmer on 3/3/2010 6:33 AM:
Do I understand correctly that it is generally adviced to not use
the option -Werror?

Not quite.  The advice is to not mix -Werror and configure.

ahh ok, this is fine!
There is no need to have -Werror during configure.
So it seems again we just do the things wrongly :)
But how to do it correctly?

Post-configure, you can use -Werror to your heart's content, and I do it
all the time in packages that I maintain.

I'm not sure if I get this...
How do I use -Werror or -WX post-configure correctly?

Several ways:

a) Override CFLAGS at make time:
./configure CFLAGS="<cflags>"
make CFLAGS="<cflags -Werror"

This is what I would do - It doesn't clutter the autotool-files with GCC-proprietary -Werror handling and is appropriate for development purposes.


b) Implement it as a conditional AC_SUBST, i.e.
something similar to

AC_ARG_ENABLE([werror],
...
/* if gcc */
CFLAGS_WERROR="-Werror"
...
/* if other compiler */
CFLAGS_WERROR="<whatever>"
...
])
AC_SUBST([CFLAGS_WERROR])


accompanied by something similar to this in your Makefile.in's
CFLAGS = @CFLAGS@ @CFLAGS_WERROR@
rsp. (in case of using automake)
AM_CFLAGS = @CFLAGS_WERROR@

I would not want to use this approach.

Ralf


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux