Debian Codegraph @

madrisan-nagios-plugins-linux/nagios-plugins-linux/m4/cc_try_cflags.m4

raw
1 dnl This file is part of `nagios-plugins-linux'.
2 dnl Copyright (C) 2014 by Davide Madrisan <[email protected]>
3
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
13 dnl
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 dnl Process this file with autoconf to produce a configure script.
18
19 dnl cc_TRY_CFLAGS (CFLAGS)
20 dnl ------------------------------------------------------------
21 dnl Checks if $CC supports a given set of CFLAGS.
22 dnl If supported, the current CFLAGS is appended to SUPPORTED_CFLAGS
23 AC_DEFUN([cc_TRY_CFLAGS],
24 [AC_MSG_CHECKING([whether compiler accepts $1])
25 ac_save_CFLAGS="$CFLAGS"
26 CFLAGS="$CFLAGS -Werror $1"
27 AC_COMPILE_IFELSE(
28 [AC_LANG_PROGRAM([[]],[[]])],
29 [AC_MSG_RESULT([yes])
30 SUPPORTED_CFLAGS="$SUPPORTED_CFLAGS $1"],
31 [AC_MSG_RESULT([no])]
32 )
33 CFLAGS="$ac_save_CFLAGS"
34 ])