Bug 5393 - CPPFLAGS gets clobbered for linux targets due to cached LFS test
Summary: CPPFLAGS gets clobbered for linux targets due to cached LFS test
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.2
Classification: Unclassified
Component: Build environment (show other bugs)
Version: unspecified
Hardware: Other Linux
: P3 normal
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-14 04:28 UTC by Mike Frysinger
Modified: 2009-07-07 10:46 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Frysinger 2008-04-14 04:28:21 UTC
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, [
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
AC_TRY_RUN([
...........])])
CPPFLAGS="$old_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()
Comment 1 Björn Jacke 2009-07-07 10:46:51 UTC
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!