mpd/m4/mpd_check_cflag.m4
Max Kellermann d05c8fd422 quote "=" in the CFLAGS check
Previously, it was not possible to check for e.g. "-std=c99".
2008-08-25 15:51:18 +02:00

19 lines
477 B
Plaintext

AC_DEFUN([MPD_CHECK_FLAG],[
var=`echo "$1" | tr "=-" "__"`
AC_CACHE_CHECK([whether the C compiler accepts $1],
[mpd_check_cflag_$var],[
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_COMPILE_IFELSE([
int main(void) { return 0; }
], [ eval "mpd_check_cflag_$var=yes"
], [ eval "mpd_check_cflag_$var=no" ])
CFLAGS="$save_CFLAGS"
])
if eval "test x`echo '$mpd_check_cflag_'$var` = xyes"
then
MPD_CFLAGS="$MPD_CFLAGS $1"
fi
])
])