From 4e4441fd32e694753824a543c050e5d3c0b49a5a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 12 Apr 2008 04:16:22 +0000 Subject: configure: better CFLAGS checking needed for compatibility with older gcc. Also, threw in some warnings for things I find offensive (declaration-after-statement, shadow) git-svn-id: https://svn.musicpd.org/mpd/trunk@7299 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- m4/mpd_check_cflag.m4 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 m4/mpd_check_cflag.m4 (limited to 'm4') diff --git a/m4/mpd_check_cflag.m4 b/m4/mpd_check_cflag.m4 new file mode 100644 index 000000000..05682f611 --- /dev/null +++ b/m4/mpd_check_cflag.m4 @@ -0,0 +1,18 @@ +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 + ]) +]) -- cgit v1.2.3