1 dnl --------------------------------------------------------------------------
2 dnl PA_ADD_FLAGS(variable, flag [,actual_flag])
4 dnl Attempt to add the given option to CPPFLAGS, if it doesn't break
5 dnl compilation. If the option to be tested is different than the
6 dnl option that should actually be added, add the option to be
7 dnl actually added as a second argument.
8 dnl --------------------------------------------------------------------------
9 AC_DEFUN([PA_ADD_FLAGS],
10 [AC_MSG_CHECKING([if $CC accepts $2])
11 pa_add_flags__old_flags="$$1"
13 AC_TRY_LINK(AC_INCLUDES_DEFAULT,
14 [printf("Hello, World!\n");],
16 $1="$pa_add_flags__old_flags ifelse([$3],[],[$2],[$3])"
17 AC_DEFINE(PA_SYM([$1_],[$2]), 1,
18 [Define to 1 if compiled with the `$2' compiler flag])],
20 $1="$pa_add_flags__old_flags"])])