1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2025-12-08 04:05:20 +00:00

build: Enable compiling with -Werror.

This helps find compile warnings because they simply break
the build.

To use:
./configure --enable-warnings --enable-werror

Signed-off-by: Ben Greear <greearb@candelatech.com>
This commit is contained in:
Ben Greear
2010-07-29 23:43:02 -07:00
parent 3e33e2c2ba
commit 45557a138e
3 changed files with 41 additions and 0 deletions

View File

@ -253,6 +253,37 @@ AC_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]),
AC_MSG_RESULT([$want_warnings])
])
dnl CARES_CHECK_OPTION_WERROR
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
dnl --enable-werror or --disable-werror, and set
dnl shell variable want_werror as appropriate.
AC_DEFUN([CARES_CHECK_OPTION_WERROR], [
AC_MSG_CHECKING([whether to treat compile warnings as errors])
OPT_COMPILER_WERROR="default"
AC_ARG_ENABLE(werror,
AC_HELP_STRING([--enable-werror],[Treat compile warnings as errors])
AC_HELP_STRING([--disable-warnings],[Don't treat compile warnings as werrors]),
OPT_COMPILER_WERROR=$enableval)
case "$OPT_COMPILER_WERROR" in
no)
dnl --disable-werror option used
want_werror="no"
;;
default)
dnl configure option not specified, so
dnl use same setting as --enable-debug
want_werror="no"
;;
*)
dnl --enable-werror option used
want_werror="yes"
;;
esac
AC_MSG_RESULT([$want_werror])
])
dnl CARES_CHECK_NONBLOCKING_SOCKET
dnl -------------------------------------------------