aboutsummaryrefslogtreecommitdiff
path: root/ares/m4/cares-confopts.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-10-02 03:56:55 +0000
committerYang Tse <yangsita@gmail.com>2008-10-02 03:56:55 +0000
commit2245ac2f884513bb3145f841fb3a9aed80b6ff34 (patch)
treebc60c78e19ae34e8b57ef5bf19c12fe30ae33d33 /ares/m4/cares-confopts.m4
parent1bfaf76dd09a12ccd0dea7f4ec7d1a34b38cbce5 (diff)
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 'ares/m4/cares-confopts.m4')
-rw-r--r--ares/m4/cares-confopts.m486
1 files changed, 86 insertions, 0 deletions
diff --git a/ares/m4/cares-confopts.m4 b/ares/m4/cares-confopts.m4
new file mode 100644
index 000000000..2299b6074
--- /dev/null
+++ b/ares/m4/cares-confopts.m4
@@ -0,0 +1,86 @@
+#***************************************************************************
+# $Id$
+#
+# Copyright (C) 2008 by Daniel Stenberg et al
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation for any purpose and without fee is hereby granted, provided
+# that the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+#***************************************************************************
+
+# File version for 'aclocal' use. Keep it a single number.
+# serial 1
+
+
+dnl CARES_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([CARES_CHECK_OPTION_DEBUG], [
+ AC_BEFORE([$0],[CARES_CHECK_OPTION_WARNINGS])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 CARES_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([CARES_CHECK_OPTION_WARNINGS], [
+ AC_REQUIRE([CARES_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])
+])