Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 17 lines (16 sloc) 0.627 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
dnl Usage: AX_TRY_CPPFLAGS(flags,[action-if-yes,[action-if-no]])
dnl
dnl The default action-if-yes is to append the flags to CPPFLAGS

AC_DEFUN([AX_TRY_CPPFLAGS],
[
    AS_VAR_PUSHDEF([ac_var], ac_cv_cppflags_[[$1]])dnl
    AC_CACHE_CHECK([whether the current compiler supports $1], ac_var,
    [
        save_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $1"
        AC_LINK_IFELSE(AC_LANG_PROGRAM(), [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)])
        CPPFLAGS="$save_CPPFLAGS"
    ])
    AS_IF([test AS_VAR_GET(ac_var) = yes], [m4_default([$2], [CPPFLAGS="$CPPFLAGS $1"])], [$3])
    AS_VAR_POPDEF([ac_var])dnl
])
Something went wrong with that request. Please try again.