From d6981cb508c050accdc879e6b4886193751ae72f Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Mon, 19 Jul 2010 18:07:09 +0200 Subject: build: Enable configure --enable-werror This passes -Werror to gcc when building curl and libcurl, allowing easy dection of compile warnings. Signed-off-by: Ben Greear --- m4/curl-confopts.m4 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'm4') diff --git a/m4/curl-confopts.m4 b/m4/curl-confopts.m4 index fb73ef559..12be6847d 100644 --- a/m4/curl-confopts.m4 +++ b/m4/curl-confopts.m4 @@ -339,6 +339,38 @@ AC_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]), AC_MSG_RESULT([$want_warnings]) ]) +dnl CURL_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([CURL_CHECK_OPTION_WERROR], [ + AC_REQUIRE([CURL_CHECK_OPTION_WARNINGS])dnl + AC_BEFORE([$0],[CURL_CHECK_PROG_CC])dnl + AC_MSG_CHECKING([whether to enable compiler warnings as errors]) + OPT_COMPILER_WERROR="default" + AC_ARG_ENABLE(werror, +AC_HELP_STRING([--enable-werror],[Enable compiler warnings as errors]) +AC_HELP_STRING([--disable-werror],[Disable compiler warnings as errors]), + OPT_COMPILER_WERROR=$enableval) + case "$OPT_COMPILER_WERROR" in + no) + dnl --disable-werror option used + want_werror="no" + ;; + default) + dnl --disable-werror option not specified, default to off + want_werror="no" + ;; + *) + dnl --enable-werror option used + want_werror="yes" + ;; + esac + AC_MSG_RESULT([$want_werror]) +]) + dnl CURL_CHECK_NONBLOCKING_SOCKET dnl ------------------------------------------------- -- cgit v1.2.3