blob: 08f4a40970878eec9b9dbdc793c859a5e87df71b [file] [log] [blame]
Erik de Castro Lopo05609d52013-03-05 21:53:18 +11001dnl @synopsis XIPH_ADD_CFLAGS
2dnl
3dnl Add the given option to CFLAGS, if it doesn't break the compiler
4
5AC_DEFUN([XIPH_ADD_CFLAGS],
6[AC_MSG_CHECKING([if $CC accepts $1])
7 ac_add_cflags__old_cflags="$CFLAGS"
8 CFLAGS="$1"
9 AC_TRY_LINK([
10 #include <stdio.h>
11 ],
12 [puts("Hello, World!"); return 0;],
13 AC_MSG_RESULT([yes])
14 CFLAGS="$ac_add_cflags__old_cflags $1",
15 AC_MSG_RESULT([no])
16 CFLAGS="$ac_add_cflags__old_cflags"
17 )
18])# XIPH_ADD_CFLAGS