OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [config/] [warnings.m4] - Blame information for rev 294

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
# Autoconf include file defining macros related to compile-time warnings.
2
 
3
# Copyright 2004, 2005 Free Software Foundation, Inc.
4
 
5
#This file is part of GCC.
6
 
7
#GCC is free software; you can redistribute it and/or modify it under
8
#the terms of the GNU General Public License as published by the Free
9
#Software Foundation; either version 2, or (at your option) any later
10
#version.
11
 
12
#GCC is distributed in the hope that it will be useful, but WITHOUT
13
#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
#FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15
#for more details.
16
 
17
#You should have received a copy of the GNU General Public License
18
#along with GCC; see the file COPYING.  If not, write to the Free
19
#Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20
#02110-1301, USA.
21
 
22
# ACX_PROG_CC_WARNING_OPTS([-Wfoo -Wbar -Wbaz])
23
#   Sets @WARN_CFLAGS@ to the subset of the given options which the
24
#   compiler accepts.
25
AC_DEFUN([ACX_PROG_CC_WARNING_OPTS],
26
[AC_REQUIRE([AC_PROG_CC])dnl
27
AC_SUBST([WARN_CFLAGS])dnl
28
WARN_CFLAGS=
29
save_CFLAGS="$CFLAGS"
30
for option in $1; do
31
  AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option])
32
  AC_CACHE_CHECK([whether $CC supports $option], acx_Woption,
33
    [CFLAGS="$option"
34
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
35
      [AS_VAR_SET(acx_Woption, yes)],
36
      [AS_VAR_SET(acx_Woption, no)])
37
  ])
38
  AS_IF([test AS_VAR_GET(acx_Woption) = yes],
39
        [WARN_CFLAGS="$WARN_CFLAGS${WARN_CFLAGS:+ }$option"])
40
  AS_VAR_POPDEF([acx_Woption])dnl
41
done
42
CFLAGS="$save_CFLAGS"
43
])# ACX_PROG_CC_WARNING_OPTS
44
 
45
# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long ...])
46
#   Sets WARN_PEDANTIC to "-pedantic" + the argument, if the compiler is GCC
47
#   and accepts all of those options simultaneously, otherwise to nothing.
48
AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC],
49
[AC_REQUIRE([AC_PROG_CC])dnl
50
AC_SUBST([WARN_PEDANTIC])dnl
51
AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_$1])dnl
52
WARN_PEDANTIC=
53
AS_IF([test "$GCC" = yes],
54
[AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic,
55
[save_CFLAGS="$CFLAGS"
56
CFLAGS="-pedantic $1"
57
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
58
   [AS_VAR_SET(acx_Pedantic, yes)],
59
   [AS_VAR_SET(acx_Pedantic, no)])
60
CFLAGS="$save_CFLAGS"])
61
AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
62
      [WARN_PEDANTIC="-pedantic $1"])
63
])
64
AS_VAR_POPDEF([acx_Pedantic])dnl
65
])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC
66
 
67
# ACX_PROG_CC_WARNINGS_ARE_ERRORS([x.y.z])
68
#   sets WERROR to "-Werror" if the compiler is GCC >=x.y.z, or if
69
#   --enable-werror-always was given on the command line, otherwise
70
#   to nothing.
71
#   If the argument is the word "manual" instead of a version number,
72
#   then WERROR will be set to -Werror only if --enable-werror-always
73
#   appeared on the configure command line.
74
AC_DEFUN([ACX_PROG_CC_WARNINGS_ARE_ERRORS],
75
[AC_REQUIRE([AC_PROG_CC])dnl
76
AC_SUBST([WERROR])dnl
77
WERROR=
78
AC_ARG_ENABLE(werror-always,
79
    AS_HELP_STRING([--enable-werror-always],
80
                   [enable -Werror despite compiler version]),
81
[], [enable_werror_always=no])
82
AS_IF([test $enable_werror_always = yes],
83
      [WERROR=-Werror],
84
 m4_if($1, [manual],,
85
 [AS_VAR_PUSHDEF([acx_GCCvers], [acx_cv_prog_cc_gcc_$1_or_newer])dnl
86
  AC_CACHE_CHECK([whether $CC is GCC >=$1], acx_GCCvers,
87
    [set fnord `echo $1 | tr '.' ' '`
88
     shift
89
     AC_PREPROC_IFELSE(
90
[#if __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ \
91
  < [$]1 * 10000 + [$]2 * 100 + [$]3
92
#error insufficient
93
#endif],
94
   [AS_VAR_SET(acx_GCCvers, yes)],
95
   [AS_VAR_SET(acx_GCCvers, no)])])
96
 AS_IF([test AS_VAR_GET(acx_GCCvers) = yes],
97
       [WERROR=-WerrorB])
98
  AS_VAR_POPDEF([acx_GCCvers])]))
99
])# ACX_PROG_CC_WARNINGS_ARE_ERRORS

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.