diff --git a/configure.ac b/configure.ac index 43518ccd..749d61e0 100644 --- a/configure.ac +++ b/configure.ac @@ -126,12 +126,10 @@ AC_CONFIG_FILES([Makefile ## helper for CC stuff cc_supports_flag() { - local CPPFLAGS="$CPPFLAGS $@" - AC_MSG_CHECKING([whether $CC supports "$@"]) - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])], - [RC=0; AC_MSG_RESULT([yes])], - [RC=1; AC_MSG_RESULT([no])]) - return $RC + local CFLAGS="-Werror $@" + AC_MSG_CHECKING(whether $CC supports "$@") + AC_COMPILE_IFELSE([int main(){return 0;}] ,[RC=0; AC_MSG_RESULT(yes)],[RC=1; AC_MSG_RESULT(no)]) + return $RC } ## cleanup