rbtree: add rb_search_exact()
[nasm.git] / autoconf / m4 / pa_add_flags.m4
blob5a88d16d1070327198eb726039893addaa5bcce7
1 dnl --------------------------------------------------------------------------
2 dnl PA_ADD_FLAGS(variable, flag [,actual_flag])
3 dnl
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"
12  $1="$$1 $2"
13  AC_TRY_LINK(AC_INCLUDES_DEFAULT,
14  [printf("Hello, World!\n");],
15  [AC_MSG_RESULT([yes])
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])],
19  [AC_MSG_RESULT([no])
20   $1="$pa_add_flags__old_flags"])])