diff options
author | Yang Tse <yangsita@gmail.com> | 2008-10-02 03:56:55 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-10-02 03:56:55 +0000 |
commit | 2245ac2f884513bb3145f841fb3a9aed80b6ff34 (patch) | |
tree | bc60c78e19ae34e8b57ef5bf19c12fe30ae33d33 /m4/curl-confopts.m4 | |
parent | 1bfaf76dd09a12ccd0dea7f4ec7d1a34b38cbce5 (diff) | |
download | curl-2245ac2f884513bb3145f841fb3a9aed80b6ff34.tar.gz |
Initial attempt to support configure's --(dis|en)able-warnings
option to specify dis(activation) of picky compiler warnings.
If option is specified, it will be honored independant of the
--(dis|en)able-debug option.
If option is not specified, it will follow --(dis|en)able-debug
setting, whose default is disabled if not specified.
Diffstat (limited to 'm4/curl-confopts.m4')
-rw-r--r-- | m4/curl-confopts.m4 | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/m4/curl-confopts.m4 b/m4/curl-confopts.m4 new file mode 100644 index 000000000..5daf2df5e --- /dev/null +++ b/m4/curl-confopts.m4 @@ -0,0 +1,93 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at http://curl.haxx.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# $Id$ +#*************************************************************************** + +# File version for 'aclocal' use. Keep it a single number. +# serial 1 + + +dnl CURL_CHECK_OPTION_DEBUG +dnl ------------------------------------------------- +dnl Verify if configure has been invoked with option +dnl --enable-debug or --disable-debug, and set shell +dnl variable want_debug value as appropriate. + +AC_DEFUN([CURL_CHECK_OPTION_DEBUG], [ + AC_BEFORE([$0],[CURL_CHECK_OPTION_DEBUG])dnl + AC_BEFORE([$0],[AC_PROG_CC])dnl + AC_MSG_CHECKING([whether to enable debug build options]) + OPT_DEBUG_BUILD="default" + AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug],[Enable debug build options]) + AC_HELP_STRING([--disable-debug],[Disable debug build options]), + OPT_DEBUG_BUILD=$enableval) + case "$OPT_DEBUG_BUILD" in + no) + dnl --disable-debug option used + want_debug="no" + ;; + default) + dnl configure option not specified + want_debug="no" + ;; + *) + dnl --enable-debug option used + want_debug="yes" + ;; + esac + AC_MSG_RESULT([$want_debug]) +]) + + +dnl CURL_CHECK_OPTION_WARNINGS +dnl ------------------------------------------------- +dnl Verify if configure has been invoked with option +dnl --enable-warnings or --disable-warnings, and set +DNL shell variable want_warnings as appropriate. + +AC_DEFUN([CURL_CHECK_OPTION_WARNINGS], [ + AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl + AC_BEFORE([$0],[AC_PROG_CC])dnl + AC_MSG_CHECKING([whether to enable strict compiler warnings]) + OPT_COMPILER_WARNINGS="default" + AC_ARG_ENABLE(warnings, + AC_HELP_STRING([--enable-warnings],[Enable strict compiler warnings]) + AC_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]), + OPT_COMPILER_WARNINGS=$enableval) + case "$OPT_COMPILER_WARNINGS" in + no) + dnl --disable-warnings option used + want_warnings="no" + ;; + default) + dnl configure option not specified, so + dnl use same setting as --enable-debug + want_warnings="$want_debug" + ;; + *) + dnl --enable-warnings option used + want_warnings="yes" + ;; + esac + AC_MSG_RESULT([$want_warnings]) +]) + |