Alexey Kodanev | 20eb071 | 2014-04-11 13:26:59 +0400 | [diff] [blame] | 1 | dnl Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved. |
| 2 | dnl |
| 3 | dnl This program is free software; you can redistribute it and/or |
| 4 | dnl modify it under the terms of the GNU General Public License as |
| 5 | dnl published by the Free Software Foundation; either version 2 of |
| 6 | dnl the License, or (at your option) any later version. |
| 7 | dnl |
| 8 | dnl This program is distributed in the hope that it would be useful, |
| 9 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | dnl GNU General Public License for more details. |
| 12 | dnl |
| 13 | dnl You should have received a copy of the GNU General Public License |
| 14 | dnl along with this program; if not, write the Free Software Foundation, |
| 15 | dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 16 | dnl |
| 17 | dnl Author: Alexey Kodanev <alexey.kodanev@oracle.com> |
| 18 | dnl |
| 19 | |
| 20 | AC_DEFUN([LTP_CHECK_CC_WARN_OLDSTYLE],[dnl |
| 21 | |
Nicolas Joly | 7d279ed | 2015-10-04 10:25:51 +0200 | [diff] [blame] | 22 | wflag="-Wold-style-definition" |
| 23 | AC_MSG_CHECKING([if $CC supports $wflag]) |
Alexey Kodanev | 20eb071 | 2014-04-11 13:26:59 +0400 | [diff] [blame] | 24 | |
| 25 | backup_cflags="$CFLAGS" |
Cyril Hrubis | 9fb4fcf | 2016-01-06 16:25:18 +0100 | [diff] [blame] | 26 | CFLAGS="$CFLAGS $wflag" |
Alexey Kodanev | 20eb071 | 2014-04-11 13:26:59 +0400 | [diff] [blame] | 27 | |
| 28 | AC_LINK_IFELSE( |
| 29 | [AC_LANG_PROGRAM([])], |
Nicolas Joly | 7d279ed | 2015-10-04 10:25:51 +0200 | [diff] [blame] | 30 | [GCC_WARN_OLDSTYLE="$wflag"] |
Alexey Kodanev | 20eb071 | 2014-04-11 13:26:59 +0400 | [diff] [blame] | 31 | [AC_MSG_RESULT([yes])], |
| 32 | [AC_MSG_RESULT([no])] |
| 33 | ) |
| 34 | |
| 35 | AC_SUBST(GCC_WARN_OLDSTYLE) |
| 36 | CFLAGS="$backup_cflags" |
| 37 | |
| 38 | ]) |