fix large file support in samba3 (closes: #4014)
authorNicolas Thill <nico@openwrt.org>
Tue, 23 Sep 2008 21:45:46 +0000 (21:45 +0000)
committerNicolas Thill <nico@openwrt.org>
Tue, 23 Sep 2008 21:45:46 +0000 (21:45 +0000)
SVN-Revision: 12676

net/samba3/Makefile
net/samba3/files/config-lfs.h [new file with mode: 0644]

index be69a4504c1b53640c61a4446242501632866c87..59c1e390b3d69e64c509c8eff9f827cf8e418ab2 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=samba3
 PKG_VERSION:=3.0.24
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 #PKG_MD5SUM:=b51b2975f21006f85f7297f3fb1acde1
 
 PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/samba/old-versions/
@@ -35,13 +35,24 @@ define Package/samba3/config
        source "$(SOURCE)/Config.in"
 endef
 
+ifneq ($(CONFIG_LARGEFILE),)
+  define Build/Prepare/LFS
+       cat ./files/config-lfs.h >> $(PKG_BUILD_DIR)/source/include/config.h
+  endef
+endif
+
+define Build/Prepare
+$(call Build/Prepare/Default)
+$(call Build/Prepare/LFS)
+endef
+
 define Build/Compile
-       CFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" \
        CC="$(TARGET_CC)" \
-       CPPFLAGS="$(TARGET_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" \
+       CFLAGS="$(TARGET_CFLAGS)" \
+       CPPFLAGS="$(TARGET_CPPFLAGS)" \
        LDFLAGS="$(TARGET_LDFLAGS)" \
-               $(MAKE) -C $(PKG_BUILD_DIR)/source \
-                       all bin/smbpasswd       
+       $(MAKE) -C $(PKG_BUILD_DIR)/source \
+               all bin/smbpasswd       
 endef
 
 define Package/samba3/install
diff --git a/net/samba3/files/config-lfs.h b/net/samba3/files/config-lfs.h
new file mode 100644 (file)
index 0000000..128e8a5
--- /dev/null
@@ -0,0 +1,56 @@
+#undef HAVE_CREAT64
+#define HAVE_CREAT64 1
+
+#undef HAVE_FSEEKO64
+#define HAVE_FSEEKO64 1
+
+#undef HAVE_FSTAT64
+#define HAVE_FSTAT64 1
+
+#undef HAVE_FTELLO64
+#define HAVE_FTELLO64 1
+
+#undef HAVE_FTRUNCATE64
+#define HAVE_FTRUNCATE64 1
+
+#undef HAVE_LSEEK64
+#define HAVE_LSEEK64 1
+
+#undef HAVE_LSTAT64
+#define HAVE_LSTAT64 1
+
+#undef HAVE_OPEN64
+#define HAVE_OPEN64 1
+
+#undef HAVE_PREAD64
+#define HAVE_PREAD64 1
+
+#undef HAVE_PWRITE64
+#define HAVE_PWRITE64 1
+
+#undef HAVE_READDIR64
+#define HAVE_READDIR64 1
+
+#undef HAVE_STAT64
+#define HAVE_STAT64 1
+
+#undef HAVE_STRUCT_FLOCK64
+#define HAVE_STRUCT_FLOCK64 1
+
+#undef SIZEOF_LONG_LONG
+#define SIZEOF_LONG_LONG 8
+
+#undef SIZEOF_OFF_T
+#define SIZEOF_OFF_T 8
+
+#undef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+
+#undef _GNU_SOURCE
+#define _GNU_SOURCE 1
+
+#undef _LARGEFILE_SOURCE
+#define _LARGEFILE_SOURCE 1
+
+#undef _LARGEFILE64_SOURCE
+#define _LARGEFILE64_SOURCE 1