1 Cache the check for Linux LFS support, so it can be prepopulated from
2 the site cache for configure variables for cross-compiling. Without this,
3 samba gets the idea that it can use dirent64 and friends without defining
4 the flags it needs to get it, such as _GNU_SOURCE and _LARGEFILE64_SOURCE.
6 Symptoms of getting the configuration wrong on cross-compile inculde
9 smbd/trans2.c: In function `get_lanman2_dir_entry':
10 smbd/trans2.c:1065: warning: right shift count >= width of type
14 smbd/vfs.c:630: error: dereferencing pointer to incomplete type
16 (when trying to dereference dirent64.)
18 --- source/configure.in.orig 2005-05-29 14:46:18.000000000 -0700
19 +++ source/configure.in 2005-05-29 14:51:57.000000000 -0700
21 # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
24 - AC_MSG_CHECKING([for LFS support])
25 + AC_CACHE_CHECK([for LFS support], samba_cv_LINUX_LFS_SUPPORT,[
26 old_CPPFLAGS="$CPPFLAGS"
27 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
33 -], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
34 - CPPFLAGS="$old_CPPFLAGS"
35 - if test x$LINUX_LFS_SUPPORT = xyes ; then
36 +], [samba_cv_LINUX_LFS_SUPPORT=yes], [samba_cv_LINUX_LFS_SUPPORT=no], [samba_cv_LINUX_LFS_SUPPORT=cross])
37 + CPPFLAGS="$old_CPPFLAGS"])
38 + if test x"$samba_cv_LINUX_LFS_SUPPORT" = x"yes" ; then
39 CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
40 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
41 AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
42 AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
44 - AC_MSG_RESULT([$LINUX_LFS_SUPPORT])