first noticed against samba-3.0, but the bug still exists in samba-3.2. i cant really figure out where the code has gone in samba-4.0+ though, so i dont know if it affects newer trees as well.
at any rate, the LFS case for *linux* targets does:
AC_CACHE_CHECK([for LFS support],LINUX_LFS_SUPPORT, [
CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
see the slight bug ? :) CPPFLAGS is saved inside of AC_CACHE_CHECK() and outside of AC_TRY_RUN(), but restored outside of both. so if the var is cached (as is the case for me), then CPPFLAGS gets set to "" here (basically clobbering the value).
fix is to either move the CPPFLAGS save step outside of AC_CACHE_CHECK(), or the CPPFLAGS restore step inside of AC_CACHE_CHECK()
I can't find any of those in the current trees (looked in 3.0/3.2/3.3/3.4/master). Seems to be fixed already. Can you please cross-check? If you find one, please reopen this bug and give me a hint where to look! :-)
Thanks for reporting!