fix typo.
[vuplus_openvuplus] / meta-openvuplus / recipes-base / samba / samba / config-lfs.patch
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.
5
6 Symptoms of getting the configuration wrong on cross-compile inculde
7 warnings such as
8
9   smbd/trans2.c: In function `get_lanman2_dir_entry':
10   smbd/trans2.c:1065: warning: right shift count >= width of type
11
12 and errors like
13
14   smbd/vfs.c:630: error: dereferencing pointer to incomplete type
15
16 (when trying to dereference dirent64.)
17
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
20 @@ -588,7 +588,7 @@
21  # Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
22  #
23      *linux*)
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"
28         AC_TRY_RUN([
29 @@ -627,15 +627,14 @@
30         exit(1);
31  #endif
32  }
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])
43         fi
44 -       AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
45         ;;
46  
47  #