[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32871] trunk/blender: Global definition of _LARGEFILE_SOURCE, _FILE_OFFSET_BITS and _LARGEFILE64_SOURCE at linux and win32/ mingw platforms

Sergey Sharybin g.ulairi at gmail.com
Thu Nov 4 18:02:27 CET 2010


Revision: 32871
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32871
Author:   nazgul
Date:     2010-11-04 18:02:25 +0100 (Thu, 04 Nov 2010)

Log Message:
-----------
Global definition of _LARGEFILE_SOURCE, _FILE_OFFSET_BITS and _LARGEFILE64_SOURCE at linux and win32/mingw platforms

Needed to work properly with large files at 32bit system (display correct size in file browser, i.e.)

This will also fix compilation with zlib 1.2.5

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/build_files/make/nan_compile.mk
    trunk/blender/build_files/scons/config/freebsd7-config.py
    trunk/blender/build_files/scons/config/freebsd8-config.py
    trunk/blender/build_files/scons/config/freebsd9-config.py
    trunk/blender/build_files/scons/config/linux2-config.py
    trunk/blender/build_files/scons/config/linuxcross-config.py
    trunk/blender/build_files/scons/config/win32-mingw-config.py
    trunk/blender/source/blender/blenlib/BLI_storage.h

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2010-11-04 16:17:37 UTC (rev 32870)
+++ trunk/blender/CMakeLists.txt	2010-11-04 17:02:25 UTC (rev 32871)
@@ -317,6 +317,9 @@
 		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
 	ENDIF(WITH_OPENMP)
 
+	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
+	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
+
 	SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
 
 	SET(PLATFORM_LINKFLAGS "-pthread")
@@ -558,6 +561,9 @@
 				SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
 				SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
 			ENDIF(WITH_OPENMP)
+
+			SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
+			SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE")
 		ENDIF(CMAKE_COMPILER_IS_GNUCC)
 
 		ADD_DEFINITIONS(-DFREE_WINDOWS)

Modified: trunk/blender/build_files/make/nan_compile.mk
===================================================================
--- trunk/blender/build_files/make/nan_compile.mk	2010-11-04 16:17:37 UTC (rev 32870)
+++ trunk/blender/build_files/make/nan_compile.mk	2010-11-04 17:02:25 UTC (rev 32871)
@@ -173,8 +173,8 @@
     CCC ?= g++
 #    CFLAGS += -pipe
 #    CCFLAGS += -pipe
-    CFLAGS  += -pipe -fPIC -funsigned-char -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-    CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+    CFLAGS  += -pipe -fPIC -funsigned-char -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+    CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
     REL_CFLAGS  += -O2
     REL_CCFLAGS += -O2
     NAN_DEPEND = true

Modified: trunk/blender/build_files/scons/config/freebsd7-config.py
===================================================================
--- trunk/blender/build_files/scons/config/freebsd7-config.py	2010-11-04 16:17:37 UTC (rev 32870)
+++ trunk/blender/build_files/scons/config/freebsd7-config.py	2010-11-04 17:02:25 UTC (rev 32871)
@@ -173,10 +173,10 @@
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
 
-CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 
 CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 if WITH_BF_FFMPEG:
   # libavutil needs UINT64_C()
   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]

Modified: trunk/blender/build_files/scons/config/freebsd8-config.py
===================================================================
--- trunk/blender/build_files/scons/config/freebsd8-config.py	2010-11-04 16:17:37 UTC (rev 32870)
+++ trunk/blender/build_files/scons/config/freebsd8-config.py	2010-11-04 17:02:25 UTC (rev 32871)
@@ -173,10 +173,10 @@
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
 
-CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 
 CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 if WITH_BF_FFMPEG:
   # libavutil needs UINT64_C()
   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]

Modified: trunk/blender/build_files/scons/config/freebsd9-config.py
===================================================================
--- trunk/blender/build_files/scons/config/freebsd9-config.py	2010-11-04 16:17:37 UTC (rev 32870)
+++ trunk/blender/build_files/scons/config/freebsd9-config.py	2010-11-04 17:02:25 UTC (rev 32871)
@@ -173,10 +173,10 @@
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
 
-CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 
 CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 if WITH_BF_FFMPEG:
   # libavutil needs UINT64_C()
   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]

Modified: trunk/blender/build_files/scons/config/linux2-config.py
===================================================================
--- trunk/blender/build_files/scons/config/linux2-config.py	2010-11-04 16:17:37 UTC (rev 32870)
+++ trunk/blender/build_files/scons/config/linux2-config.py	2010-11-04 17:02:25 UTC (rev 32871)
@@ -189,10 +189,10 @@
 ##ifeq ($CPU),alpha)
 ##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
 
-CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 
 CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
+CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 if WITH_BF_FFMPEG:
   # libavutil needs UINT64_C()
   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]

Modified: trunk/blender/build_files/scons/config/linuxcross-config.py
===================================================================
--- trunk/blender/build_files/scons/config/linuxcross-config.py	2010-11-04 16:17:37 UTC (rev 32870)
+++ trunk/blender/build_files/scons/config/linuxcross-config.py	2010-11-04 17:02:25 UTC (rev 32871)
@@ -174,7 +174,7 @@
 
 CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
 
-CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS']
+CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE']
 CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
 REL_CFLAGS = [ '-O2' ]
 REL_CCFLAGS = [ '-O2' ]

Modified: trunk/blender/build_files/scons/config/win32-mingw-config.py
===================================================================
--- trunk/blender/build_files/scons/config/win32-mingw-config.py	2010-11-04 16:17:37 UTC (rev 32870)
+++ trunk/blender/build_files/scons/config/win32-mingw-config.py	2010-11-04 17:02:25 UTC (rev 32871)
@@ -164,7 +164,7 @@
 
 CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
 
-CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS']
+CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE']
 CXXFLAGS = ['-pipe', '-mwindows', '-funsigned-char', '-fno-strict-aliasing' ]
 REL_CFLAGS = [ '-O2' ]
 REL_CCFLAGS = [ '-O2' ]

Modified: trunk/blender/source/blender/blenlib/BLI_storage.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_storage.h	2010-11-04 16:17:37 UTC (rev 32870)
+++ trunk/blender/source/blender/blenlib/BLI_storage.h	2010-11-04 17:02:25 UTC (rev 32871)
@@ -29,17 +29,6 @@
 #ifndef BLI_STORAGE_H
 #define BLI_STORAGE_H
 
-/* NOTE: these have to be defined before including unistd.h! */
-#ifndef __APPLE__
-#ifndef WIN32
-#ifndef _LARGEFILE_SOURCE
-#define _LARGEFILE_SOURCE
-#define _LARGEFILE64_SOURCE
-#define _FILE_OFFSET_BITS 64
-#endif
-#endif
-#endif
-
 #ifdef WIN32
 /* for size_t, only needed on win32 for some reason */
 #include <stddef.h>





More information about the Bf-blender-cvs mailing list