1dnl This library is free software; you can redistribute it and/or
2dnl modify it under the terms of the GNU Lesser General Public
3dnl License as published by the Free Software Foundation; either
4dnl version 2.1 of the License, or (at your option) any later version.
5dnl
6dnl This library is distributed in the hope that it will be useful,
7dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
8dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9dnl Lesser General Public License for more details.
10dnl
11dnl You should have received a copy of the GNU Lesser General Public
12dnl License along with this library; if not, write to the Free Software
13dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
14
15dnl AC_CHECK_LDFLAG(CACHEVAR, FLAGS, APPENDVAR)
16AC_DEFUN([AC_CHECK_LDFLAG],
17[AC_CACHE_CHECK([whether the target compiler accepts $2], $1,
18    [$1=no
19    echo 'int main(){return 0;}' > conftest.c
20    if test -z "`${CC} $2 -o conftest conftest.c 2>&1`"; then
21        $1=yes
22    else
23        $1=no
24    fi
25    rm -f conftest*
26    ])
27if test x${$1} = xyes; then $3="$2 ${$3}"; fi
28])
29