Debian Codegraph @

macros/ac_compile_warnings.m4

raw
1 dnl AC_COMPILE_WARNINGS
2 dnl
3 dnl Set the maximum warning verbosity according to compiler
4 dnl used. Currently supports g++ and gcc. This macro must be put after
5 dnl AC_PROG_CC and AC_PROG_CXX in configure.in
6 dnl
7 dnl Author: Loic Dachary
8 dnl
9 dnl Source:
10 dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_compile_warnings.html
11
12 AC_DEFUN([AC_COMPILE_WARNINGS],
13 [AC_MSG_CHECKING(maximum warning verbosity option)
14 if test -n "$CXX"
15 then
16 if test "$GXX" = "yes"
17 then
18 ac_compile_warnings_opt='-W -Wall'
19 fi
20 CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt"
21 ac_compile_warnings_msg="$ac_compile_warnings_opt for C++"
22 fi
23
24 if test -n "$CC"
25 then
26 if test "$GCC" = "yes"
27 then
28 ac_compile_warnings_opt='-W -Wall'
29 fi
30 CFLAGS="$CFLAGS $ac_compile_warnings_opt"
31 ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C"
32 fi
33 AC_MSG_RESULT($ac_compile_warnings_msg)
34 unset ac_compile_warnings_msg
35 unset ac_compile_warnings_opt
36 ])