No empty .Rs/.Re
[netbsd-mini2440.git] / external / bsd / atf / dist / m4 / developer-mode.m4
blob9927a709d3b8b24c54d91249f4733f363086fba0
1 dnl
2 dnl Automated Testing Framework (atf)
3 dnl
4 dnl Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
5 dnl All rights reserved.
6 dnl
7 dnl Redistribution and use in source and binary forms, with or without
8 dnl modification, are permitted provided that the following conditions
9 dnl are met:
10 dnl 1. Redistributions of source code must retain the above copyright
11 dnl    notice, this list of conditions and the following disclaimer.
12 dnl 2. Redistributions in binary form must reproduce the above copyright
13 dnl    notice, this list of conditions and the following disclaimer in the
14 dnl    documentation and/or other materials provided with the distribution.
15 dnl
16 dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17 dnl CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 dnl IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 dnl IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 dnl
30 dnl -----------------------------------------------------------------------
31 dnl Set up the developer mode
32 dnl -----------------------------------------------------------------------
34 dnl
35 dnl ATF_DEVELOPER_MODE
36 dnl
37 dnl Adds a --enable-developer flag to the configure script and, when given,
38 dnl checks for and enables several flags useful during development.
39 dnl
40 AC_DEFUN([ATF_DEVELOPER_MODE], [
41     AC_ARG_ENABLE(developer,
42                   AS_HELP_STRING(--enable-developer,
43                                  [enable developer features]),,
44                   [case ${PACKAGE_VERSION} in
45                    0.*|*99*|*alpha*|*beta*)
46                        enable_developer=yes
47                        ;;
48                    *)
49                        enable_developer=no
50                        ;;
51                    esac])
53     if test ${enable_developer} = yes; then
54         try_c_cxx_flags="-g \
55                          -Wall \
56                          -Wcast-qual \
57                          -Werror \
58                          -Wextra \
59                          -Wno-unused-parameter \
60                          -Wpointer-arith \
61                          -Wredundant-decls \
62                          -Wreturn-type \
63                          -Wshadow \
64                          -Wsign-compare \
65                          -Wswitch \
66                          -Wwrite-strings"
68         try_c_flags="-Wmissing-prototypes \
69                      -Wno-traditional \
70                      -Wstrict-prototypes"
72         try_cxx_flags="-Wabi \
73                        -Wctor-dtor-privacy \
74                        -Wno-deprecated \
75                        -Wno-non-template-friend \
76                        -Wno-pmf-conversions \
77                        -Wnon-virtual-dtor \
78                        -Woverloaded-virtual \
79                        -Wreorder \
80                        -Wsign-promo \
81                        -Wsynth"
83         #
84         # The following flags should also be enabled but cannot be.  Reasons
85         # given below.
86         #
87         # -Wold-style-cast: Raises errors when using TIOCGWINSZ, at least under
88         #                   Mac OS X.  This is due to the way _IOR is defined.
89         #
90     else
91         try_c_cxx_flags="-DNDEBUG"
92     fi
93     try_c_cxx_flags="${try_c_cxx_flags} -D_FORTIFY_SOURCE=2"
95     ATF_CC_FLAGS(${try_c_cxx_flags} ${try_c_flags}, CFLAGS)
96     ATF_CXX_FLAGS(${try_c_cxx_flags} ${try_cxx_flags}, CXXFLAGS)