diff options
author | Ben Greear <greearb@candelatech.com> | 2010-07-19 18:07:09 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-07-21 21:29:47 +0200 |
commit | d6981cb508c050accdc879e6b4886193751ae72f (patch) | |
tree | 9caa1ee30cb246434ef4467725e6151447ab80a8 /m4/curl-confopts.m4 | |
parent | 40ecd6c9b8104019bc210d6cb39dfbf79389550c (diff) | |
download | curl-d6981cb508c050accdc879e6b4886193751ae72f.tar.gz |
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 <greearb@candelatech.com>
Diffstat (limited to 'm4/curl-confopts.m4')
-rw-r--r-- | m4/curl-confopts.m4 | 32 |
1 files changed, 32 insertions, 0 deletions
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 ------------------------------------------------- |