This should fix bug 7620.
###################################################
# Check for different/missing (set|get|end)netgrent prototypes
CFLAGS_SAVE=$CFLAGS
-CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
+if test x"$samba_cv_HAVE_Wdeclaration_after_statement" = x"yes"; then
+ CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
+fi
AC_CACHE_CHECK([for setnetgrent prototype],samba_cv_setnetgrent_prototype, [
AC_TRY_COMPILE([#include<netdb.h>
#ifdef HAVE_NETGROUP_H