From 266438b5e0224de4653ba2a795a069781e926007 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 19 Jul 2010 09:02:27 +0000 Subject: - Use correct paths for mstoolkit and crossmingw tools in sconscript - Use _stat64i32 instead of _stat in BLI_exist Needed for correct compilation by mingw, no sense for msvc (_stat is equivalent to _stat64i32 in Visual C++ 2005, and later i suppose) - Added library msvcr90 for mingw to solve linking error to _stat64i32 --- SConstruct | 9 ++++++--- build_files/scons/config/linuxcross-config.py | 2 +- build_files/scons/config/win32-mingw-config.py | 2 +- source/blender/blenlib/intern/storage.c | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/SConstruct b/SConstruct index b11df1b4c67..21d25f97777 100644 --- a/SConstruct +++ b/SConstruct @@ -46,8 +46,11 @@ import glob import re from tempfile import mkdtemp +# store path to tools +toolpath=os.path.join(".", "build_files", "scons", "tools") + # needed for importing tools -sys.path.append(os.path.join(".", "build_files", "scons", "tools")) +sys.path.append(toolpath) import Blender import btools @@ -121,7 +124,7 @@ if toolset: print "Using " + toolset if toolset=='mstoolkit': env = BlenderEnvironment(ENV = os.environ) - env.Tool('mstoolkit', ['tools']) + env.Tool('mstoolkit', [toolpath]) else: env = BlenderEnvironment(tools=[toolset], ENV = os.environ) # xxx commented out, as was supressing warnings under mingw.. @@ -170,7 +173,7 @@ else: if crossbuild and env['PLATFORM'] != 'win32': print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC - env.Tool('crossmingw', ['tools']) + env.Tool('crossmingw', [toolpath]) # todo: determine proper libs/includes etc. # Needed for gui programs, console programs should do without it diff --git a/build_files/scons/config/linuxcross-config.py b/build_files/scons/config/linuxcross-config.py index 1650201f8c6..6ec429ef2f8 100644 --- a/build_files/scons/config/linuxcross-config.py +++ b/build_files/scons/config/linuxcross-config.py @@ -182,7 +182,7 @@ C_WARN = [ '-Wall' , '-Wno-char-subscripts', '-Wdeclaration-after-statement' ] CC_WARN = [ '-Wall' ] -LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++', '-luuid', '-lole32'] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ] +LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++', '-luuid', '-lole32', '-lmsvcr90'] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ] BF_DEBUG = False BF_DEBUG_CCFLAGS = ['-g'] diff --git a/build_files/scons/config/win32-mingw-config.py b/build_files/scons/config/win32-mingw-config.py index f8b67781172..b9e6ba358a1 100644 --- a/build_files/scons/config/win32-mingw-config.py +++ b/build_files/scons/config/win32-mingw-config.py @@ -173,7 +173,7 @@ C_WARN = [ '-Wno-char-subscripts', '-Wdeclaration-after-statement' ] CC_WARN = [ '-Wall' ] -LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid'] +LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lmsvcr90'] BF_DEBUG = False BF_DEBUG_CCFLAGS= ['-g'] diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index e8eb2070929..5bf6acf3847 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -447,7 +447,7 @@ int BLI_exist(char *name) BLI_strncpy(tmp, name, FILE_MAXDIR+FILE_MAXFILE); len = strlen(tmp); if (len > 3 && ( tmp[len-1]=='\\' || tmp[len-1]=='/') ) tmp[len-1] = '\0'; - res = _stat(tmp, &st); + res = _stat64i32(tmp, &st); if (res == -1) return(0); #else struct stat st; -- cgit v1.2.3