| 1 |
dnl This file is part of `nagios-plugins-linux'. |
| 2 |
dnl Copyright (C) 2018 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_LDFLAGS (LDFLAGS) |
| 20 |
dnl ------------------------------------------------------------ |
| 21 |
dnl Checks if $CC supports a given set of LDFLAGS. |
| 22 |
dnl If supported, the current LDFLAGS is appended to SUPPORTED_LDFLAGS |
| 23 |
AC_DEFUN([cc_TRY_LDFLAGS], |
| 24 |
[AC_MSG_CHECKING([whether compiler accepts $1]) |
| 25 |
ac_save_LDFLAGS="$LDFLAGS" |
| 26 |
LDFLAGS="$LDFLAGS $1" |
| 27 |
AC_LINK_IFELSE( |
| 28 |
[AC_LANG_PROGRAM([[]],[[int x;]])], |
| 29 |
[AC_MSG_RESULT([yes]) |
| 30 |
SUPPORTED_LDFLAGS="$SUPPORTED_LDFLAGS $1"], |
| 31 |
[AC_MSG_RESULT([no])] |
| 32 |
) |
| 33 |
LDFLAGS="$ac_save_LDFLAGS" |
| 34 |
]) |