mpd/m4/mpd_check_cflag.m4
Max Kellermann bdb3129f18 configure.ac: declare AM_CFLAGS
Moved generic compiler options to AM_CFLAGS.  MPD_CFLAGS/MPD_LIBS will
hopefully fade away one day, in favor of more fine-grained variables.
2009-02-25 16:46:07 +01:00

19 lines
475 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
AM_CFLAGS="$AM_CFLAGS $1"
fi
])
])