aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--m4/mpd_check_cflag.m418
1 files changed, 18 insertions, 0 deletions
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
+ ])
+])