diff options
author | Max Kellermann <max@duempel.org> | 2008-09-15 12:27:28 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-15 12:27:28 +0200 |
commit | 7d98fb19dc2b7c3af289b0a7c1a0db68e7fea8c9 (patch) | |
tree | 57a18b76a1815dff1a9083c9b812feedce6aa694 /m4/cflags.m4 | |
parent | 629401644d03c1fc57895409b74ea8267c276a4b (diff) | |
download | mpd-7d98fb19dc2b7c3af289b0a7c1a0db68e7fea8c9.tar.gz mpd-7d98fb19dc2b7c3af289b0a7c1a0db68e7fea8c9.tar.xz mpd-7d98fb19dc2b7c3af289b0a7c1a0db68e7fea8c9.zip |
enable gcc warnings
Enable all useful warnings which were also enabled in MPD. Steal
m4/mpd_check_cflag.m4 from MPD.
Diffstat (limited to 'm4/cflags.m4')
-rw-r--r-- | m4/cflags.m4 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/m4/cflags.m4 b/m4/cflags.m4 new file mode 100644 index 000000000..cc6d5fab3 --- /dev/null +++ b/m4/cflags.m4 @@ -0,0 +1,15 @@ +AC_DEFUN([CHECK_CFLAG], [ + var=`echo "$1" | tr "=-" "__"` + AC_CACHE_CHECK([whether the C compiler accepts $1],[check_cflag_$var],[ + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + AC_COMPILE_IFELSE([int main(void) { return 0; }], + [eval "check_cflag_$var=yes"], + [eval "check_cflag_$var=no"]) + CFLAGS="$save_CFLAGS" + ]) + if eval "test x`echo '$check_cflag_'$var` = xyes"; then + AM_CFLAGS="$AM_CFLAGS $1" + fi + ]) +]) |