]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - config/always-no-bool-compare.m4
Linux 4.7 compat: replace blk_queue_flush with blk_queue_write_cache
[FreeBSD/FreeBSD.git] / config / always-no-bool-compare.m4
1 dnl #
2 dnl # Check if gcc supports -Wno-bool-compare option.
3 dnl #
4 dnl # We actually invoke gcc with the -Wbool-compare option
5 dnl # and infer the 'no-' version does or doesn't exist based upon
6 dnl # the results.  This is required because when checking any of
7 dnl # no- prefixed options gcc always returns success.
8 dnl #
9 AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_NO_BOOL_COMPARE], [
10         AC_MSG_CHECKING([for -Wno-bool-compare support])
11
12         saved_flags="$CFLAGS"
13         CFLAGS="$CFLAGS -Wbool-compare"
14
15         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
16         [
17                 NO_BOOL_COMPARE=-Wno-bool-compare
18                 AC_MSG_RESULT([yes])
19         ],
20         [
21                 NO_BOOL_COMPARE=
22                 AC_MSG_RESULT([no])
23         ])
24
25         CFLAGS="$saved_flags"
26         AC_SUBST([NO_BOOL_COMPARE])
27 ])