~ubuntu-branches/ubuntu/hardy/swig1.3/hardy

« back to all changes in this revision

Viewing changes to Tools/config/ac_compile_warnings.m4

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl Available from the GNU Autoconf Macro Archive at:
2
 
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_compile_warnings.html
3
 
dnl
4
 
dnl Modified from original to increase the warning levels from -Wall
5
 
AC_DEFUN([AC_COMPILE_WARNINGS],
6
 
[AC_MSG_CHECKING(maximum warning verbosity option)
7
 
if test -n "$CXX"
8
 
then
9
 
  if test "$GXX" = "yes"
10
 
  then
11
 
    ac_compile_warnings_opt='-Wall -ansi -pedantic'
12
 
  fi
13
 
  CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt"
14
 
  ac_compile_warnings_msg="$ac_compile_warnings_opt for C++"
15
 
fi
16
 
 
17
 
if test -n "$CC"
18
 
then
19
 
  if test "$GCC" = "yes"
20
 
  then
21
 
    ac_compile_warnings_opt='-Wall -ansi -pedantic'
22
 
  fi
23
 
  CFLAGS="$CFLAGS $ac_compile_warnings_opt"
24
 
  ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C"
25
 
fi
26
 
AC_MSG_RESULT($ac_compile_warnings_msg)
27
 
unset ac_compile_warnings_msg
28
 
unset ac_compile_warnings_opt
 
1
dnl @synopsis AC_COMPILE_WARNINGS
 
2
dnl
 
3
dnl Set the maximum warning verbosity according to C and C++ compiler used.
 
4
dnl Currently supports g++ and gcc.
 
5
dnl
 
6
dnl The compiler options are always added CFLAGS and CXXFLAGS even if
 
7
dnl these are overidden at configure time. Removing the maximum warning
 
8
dnl flags can be removed with --without-maximum-compile-warnings. For example:
 
9
dnl
 
10
dnl   ./configure --without-maximum-compile-warnings CFLAGS= CXXFLAGS=
 
11
dnl
 
12
dnl @category Misc
 
13
dnl @author Loic Dachary <loic@senga.org>
 
14
dnl @author William Fulton <wsf@fultondesigns.co.uk>
 
15
dnl @version 2005-04-29
 
16
dnl @license GPLWithACException
 
17
 
 
18
AC_DEFUN([AC_COMPILE_WARNINGS], [
 
19
AC_MSG_CHECKING([maximum warning verbosity option])
 
20
  AC_REQUIRE([AC_PROG_CC])
 
21
  AC_REQUIRE([AC_PROG_CXX])
 
22
 
 
23
  AC_ARG_WITH([maximum-compile-warnings], 
 
24
              AS_HELP_STRING([--without-maximum-compile-warnings],
 
25
                             [Disable maximum warning verbosity]),
 
26
              [ac_compile_warnings_on="$withval"],
 
27
              [ac_compile_warnings_on=""])
 
28
 
 
29
  if test x"$ac_compile_warnings_on" = xno
 
30
  then
 
31
    ac_compile_warnings_msg=no
 
32
  else
 
33
    if test -n "$CXX"
 
34
    then
 
35
      if test "$GXX" = "yes"
 
36
      then
 
37
        ac_compile_warnings_opt='-Wall -W -ansi -pedantic'
 
38
      fi
 
39
      CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt"
 
40
      ac_compile_warnings_msg="$ac_compile_warnings_opt for C++"
 
41
    fi
 
42
 
 
43
  if test -n "$CC"
 
44
  then
 
45
    if test "$GCC" = "yes"
 
46
    then
 
47
      ac_compile_warnings_opt='-Wall -W -ansi -pedantic'
 
48
    fi
 
49
    CFLAGS="$CFLAGS $ac_compile_warnings_opt"
 
50
    ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C"
 
51
  fi
 
52
  fi
 
53
  AC_MSG_RESULT([$ac_compile_warnings_msg])
 
54
  unset ac_compile_warnings_msg
 
55
  unset ac_compile_warnings_opt
29
56
])