this restores building on mingw with Collada support, also it restores cross compilin...
authorTom Musgrove <LetterRip@gmail.com>
Mon, 1 Feb 2010 18:39:41 +0000 (18:39 +0000)
committerTom Musgrove <LetterRip@gmail.com>
Mon, 1 Feb 2010 18:39:41 +0000 (18:39 +0000)
14 files changed:
SConstruct
config/linuxcross-config.py
config/win32-mingw-config.py
intern/elbeem/SConscript
intern/smoke/SConscript
source/SConscript
source/blender/blenfont/SConscript
source/blender/blenlib/SConscript
source/blender/makesdna/intern/SConscript
source/blender/render/SConscript
source/icons/SConscript
tools/Blender.py
tools/btools.py
tools/crossmingw.py

index 354915541b89a6e42defdc43aa38479626d9ae9e..837edb94d8601b19d6337d769b723a7da64b6ad4 100644 (file)
@@ -169,7 +169,9 @@ if crossbuild and env['PLATFORM'] != 'win32':
        env.Tool('crossmingw', ['tools'])
        # todo: determine proper libs/includes etc.
        # Needed for gui programs, console programs should do without it
-       env.Append(LINKFLAGS=['-mwindows'])
+
+       # Now we don't need this option to have console window
+       # env.Append(LINKFLAGS=['-mwindows'])
 
 userconfig = B.arguments.get('BF_CONFIG', 'user-config.py')
 # first read platform config. B.arguments will override
@@ -524,7 +526,11 @@ if env['OURPLATFORM']=='linux2':
 # TODO - add more libs, for now this lets blenderlite run
 if env['OURPLATFORM']=='linuxcross':
        dir=env['BF_INSTALLDIR']
-       source = ['../lib/windows/pthreads/lib/pthreadGC2.dll']
+       source = []
+
+       if env['WITH_BF_OPENMP']:
+               source += ['../lib/windows/pthreads/lib/pthreadGC2.dll']
+
        scriptinstall.append(env.Install(dir=dir, source=source))
 
 #-- plugins
@@ -577,49 +583,66 @@ elif env['OURPLATFORM']=='linux2':
 else:
                allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
 
-if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
        dllsources = []
 
-       if env['OURPLATFORM'] != 'win64-vc':
-               if env['OURPLATFORM'] != 'win32-mingw':
-                       # For MinGW static linking will be used
-                       dllsources += ['${LCGDIR}/gettext/lib/gnu_gettext.dll']         
-               
-               dllsources += ['${BF_PNG_LIBPATH}/libpng.dll',
-                               '${BF_ZLIB_LIBPATH}/zlib.dll',
-                               '${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
-       dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
+       if not env['OURPLATFORM'] in ('win32-mingw', 'win64-vc', 'linuxcross'):
+               # For MinGW and linuxcross static linking will be used
+               dllsources += ['${LCGDIR}/gettext/lib/gnu_gettext.dll']
+
+       dllsources += ['${BF_PNG_LIBPATH}/libpng.dll',
+                       '${BF_ZLIB_LIBPATH}/zlib.dll',
+                       '${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
+
+       if env['OURPLATFORM'] != 'linuxcross':
+               # pthreads library is already added
+               dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
+
        if env['WITH_BF_SDL']:
                if env['OURPLATFORM'] == 'win64-vc':
                        pass # we link statically already to SDL on win64
                else:
                        dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
+
        if env['WITH_BF_PYTHON']:
                if env['BF_DEBUG']:
                        dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll')
                else:
                        dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll')
+
        if env['WITH_BF_ICONV']:
                if env['OURPLATFORM'] == 'win64-vc':
                        pass # we link statically to iconv on win64
-               elif env['OURPLATFORM'] != 'win32-mingw':
-                       #gettext for MinGW is compiled staticly
+               elif not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
+                       #gettext for MinGW and cross-compilation is compiled staticly
                        dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
+
        if env['WITH_BF_OPENAL']:
                dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
                dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
+
        if env['WITH_BF_SNDFILE']:
                dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
+
        if env['WITH_BF_FFMPEG']:
-               dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-52.dll',
-                                               '${LCGDIR}/ffmpeg/lib/avformat-52.dll',
-                                               '${LCGDIR}/ffmpeg/lib/avdevice-52.dll',
-                                               '${LCGDIR}/ffmpeg/lib/avutil-50.dll',
-                                               '${LCGDIR}/ffmpeg/lib/swscale-0.dll',
-                                               '${LCGDIR}/ffmpeg/lib/libfaac-0.dll',
-                                               '${LCGDIR}/ffmpeg/lib/libfaad-2.dll',
-                                               '${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll',
-                                               '${LCGDIR}/ffmpeg/lib/libx264-67.dll']
+               dllsources += ['${BF_FFMPEG_LIBPATH}/avcodec-52.dll',
+                                       '${BF_FFMPEG_LIBPATH}/avformat-52.dll',
+                                       '${BF_FFMPEG_LIBPATH}/avdevice-52.dll',
+                                       '${BF_FFMPEG_LIBPATH}/avutil-50.dll',
+                                       '${BF_FFMPEG_LIBPATH}/swscale-0.dll']
+
+               if env['OURPLATFORM'] != 'linuxcross':
+                       #
+                       # TODO: Does it mean we haven't got support of this codecs if
+                       #       we're using cross-compilation?
+                       #       Or in case of native compilation this libraries are
+                       #       unneccessary to?
+                       #
+                       dllsources += ['${LCGDIR}/ffmpeg/lib/libfaac-0.dll',
+                                                       '${LCGDIR}/ffmpeg/lib/libfaad-2.dll',
+                                                       '${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll',
+                                                       '${LCGDIR}/ffmpeg/lib/libx264-67.dll']
+
        if env['WITH_BF_JACK']:
                dllsources += ['${LCGDIR}/jack/lib/libjack.dll']
        windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
index 571d644a9c4a67824ae91f9c4ca3c26e77ccdece..fe5e954f3bcc00d5daae6661047704eb4f397509 100644 (file)
@@ -5,14 +5,15 @@ BF_PYTHON = LIBDIR + '/python'
 BF_PYTHON_VERSION = '3.1'
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
 BF_PYTHON_BINARY = 'python'
-BF_PYTHON_LIB = 'python25'
+BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}mw'
+BF_PYTHON_DLL = 'python31'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 
 WITH_BF_OPENAL = True
 WITH_BF_STATICOPENAL = False
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'openal_static'
+BF_OPENAL_LIB = 'OpenAL32 wrap_oal'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 # Warning, this static lib configuration is untested! users of this OS please confirm.
 BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
@@ -33,6 +34,18 @@ BF_SDL_INC = '${BF_SDL}/include'
 BF_SDL_LIB = 'SDL'
 BF_SDL_LIBPATH = '${BF_SDL}/lib'
 
+WITH_BF_JACK = False
+BF_JACK = LIBDIR + '/jack'
+BF_JACK_INC = '${BF_JACK}/include'
+BF_JACK_LIB = 'jack'
+BF_JACK_LIBPATH = '${BF_JACK}/lib'
+
+WITH_BF_SNDFILE = False
+BF_SNDFILE = LIBDIR + '/sndfile'
+BF_SNDFILE_INC = '${BF_SNDFILE}/include'
+BF_SNDFILE_LIB = 'sndfile-1'
+BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
+
 BF_PTHREADS = LIBDIR + '/pthreads'
 BF_PTHREADS_INC = '${BF_PTHREADS}/include'
 BF_PTHREADS_LIB = 'pthreadGC2'
@@ -61,8 +74,11 @@ BF_PNG_INC = '${BF_PNG}/include'
 BF_PNG_LIB = 'png'
 BF_PNG_LIBPATH = '${BF_PNG}/lib'
 
+WITH_BF_TIFF = True
 BF_TIFF = LIBDIR + '/tiff'
 BF_TIFF_INC = '${BF_TIFF}/include'
+BF_TIFF_LIB = 'libtiff'
+BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
 
 WITH_BF_ZLIB = True
 BF_ZLIB = LIBDIR + '/zlib'
@@ -72,12 +88,12 @@ BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
 
 WITH_BF_INTERNATIONAL = True
 
-BF_GETTEXT = LIBDIR + '/gettext'
+BF_GETTEXT = LIBDIR + '/gcc/gettext'
 BF_GETTEXT_INC = '${BF_GETTEXT}/include'
-BF_GETTEXT_LIB = 'gnu_gettext'
+BF_GETTEXT_LIB = 'intl'
 BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
 
-WITH_BF_GAMEENGINE = False
+WITH_BF_GAMEENGINE = True
 WITH_BF_PLAYER = False
 
 WITH_BF_BULLET = True
@@ -89,6 +105,7 @@ BF_WINTAB = LIBDIR + '/wintab'
 BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
 
 # enable freetype2 support for text objects
+BF_WITH_FREETYPE = True
 BF_FREETYPE = LIBDIR + '/gcc/freetype'
 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
 BF_FREETYPE_LIB = 'freetype'
@@ -99,11 +116,35 @@ BF_QUICKTIME = '/usr/local'
 BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
 
 WITH_BF_ICONV = False
-BF_ICONV = LIBDIR + "/iconv"
+BF_ICONV = LIBDIR + "/gcc/iconv"
 BF_ICONV_INC = '${BF_ICONV}/include'
 BF_ICONV_LIB = 'iconv'
 BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
 
+WITH_BF_BINRELOC = False
+
+# enable ffmpeg  support
+WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
+BF_FFMPEG = LIBDIR + '/ffmpeg'
+BF_FFMPEG_LIB = 'avformat-52 avcodec-52 avdevice-52 avutil-50 swscale-0'
+BF_FFMPEG_INC = '${BF_FFMPEG}/include'
+BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib'
+
+WITH_BF_OPENJPEG = True
+BF_OPENJPEG = '#extern/libopenjpeg'
+BF_OPENJPEG_LIB = ''
+BF_OPENJPEG_INC = '${BF_OPENJPEG}'
+BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
+
+WITH_BF_FFTW3 = False
+BF_FFTW3 = LIBDIR + '/gcc/fftw3'
+BF_FFTW3_INC = '${BF_FFTW3}/include'
+BF_FFTW3_LIB = 'fftw3'
+BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
+
+WITH_BF_REDCODE = False
+BF_REDCODE_INC = '#extern'
+
 # Mesa Libs should go here if your using them as well....
 WITH_BF_STATICOPENGL = False
 BF_OPENGL = 'C:\\MingW'
@@ -114,24 +155,42 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a'
              '${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
              '${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
 
+WITH_BF_OPENMP = True
+BF_OPENMP = LIBDIR + '/gcc/gomp'
+BF_OPENMP_INC = '${BF_OPENMP}/include'
+BF_OPENMP_LIBPATH = '${BF_OPENMP}/lib'
+
+WITH_BF_COLLADA = False
+BF_COLLADA = '#source/blender/collada'
+BF_COLLADA_INC = '${BF_COLLADA}'
+BF_COLLADA_LIB = 'bf_collada'
+
+BF_OPENCOLLADA = LIBDIR + '/gcc/opencollada'
+BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
+BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa'
+BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib ${BF_ICONV_LIBPATH}'
+
+#Ray trace optimization
+WITH_BF_RAYOPTIMIZATION = False
+BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
+
 CC = 'i586-mingw32msvc-gcc'
 CXX = 'i586-mingw32msvc-g++'
 
 CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
 
 CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS']
-CXXFLAGS = ['-pipe', '-mwindows', '-funsigned-char', '-fno-strict-aliasing' ]
+CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
 REL_CFLAGS = [ '-O2' ]
 REL_CCFLAGS = [ '-O2' ]
 C_WARN = [ '-Wall' , '-Wno-char-subscripts', '-Wdeclaration-after-statement' ]
 
 CC_WARN = [ '-Wall' ]
 
-
-LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz'] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ]
+LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++', '-luuid', '-lole32'] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ]
 
 BF_DEBUG = False
-BF_DEBUG_CCFLAGS= []
+BF_DEBUG_CCFLAGS = ['-g']
 
 BF_PROFILE = False
 BF_PROFILE_CCFLAGS = ['-pg','-g']
index 987d3694873ee4680643fe7daba5e6a9853e6838..9088db5a5d8493422bdbe9b6dbf3860a0a5a07d9 100644 (file)
@@ -90,6 +90,12 @@ BF_GETTEXT_INC = '${BF_GETTEXT}/include'
 BF_GETTEXT_LIB = 'intl'
 BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
 
+WITH_BF_OPENJPEG = True
+BF_OPENJPEG = '#extern/libopenjpeg'
+BF_OPENJPEG_LIB = ''
+BF_OPENJPEG_INC = '${BF_OPENJPEG}'
+BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
+
 WITH_BF_FFTW3 = False
 BF_FFTW3 = LIBDIR + '/gcc/fftw3'
 BF_FFTW3_INC = '${BF_FFTW3}/include'
@@ -123,6 +129,9 @@ BF_ICONV_INC = '${BF_ICONV}/include'
 BF_ICONV_LIB = 'iconv'
 BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
 
+WITH_BF_REDCODE = False
+BF_REDCODE_INC = '#extern'
+
 # Mesa Libs should go here if your using them as well....
 WITH_BF_STATICOPENGL = False
 BF_OPENGL = 'C:\\MingW'
@@ -138,9 +147,9 @@ BF_COLLADA = '#source/blender/collada'
 BF_COLLADA_INC = '${BF_COLLADA}'
 BF_COLLADA_LIB = 'bf_collada'
 
-BF_OPENCOLLADA = LIBDIR + '/opencollada'
+BF_OPENCOLLADA = LIBDIR + '/gcc/opencollada'
 BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
-BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre'
+BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa'
 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
 
 #Ray trace optimization
index 0900ab1db5c53a35468bd8ddda297fc6b77ae5ab..f0417f7400162358f3dba66db145dacd50f093e3 100644 (file)
@@ -5,14 +5,18 @@ Import('env')
 
 sources = env.Glob('intern/*.cpp')
 
+incs = ''
 defs = 'NOGUI ELBEEM_BLENDER=1'
 
 if env['WITH_BF_OPENMP']:
+    if env['OURPLATFORM'] == 'linuxcross':
+            incs += ' ' + env['BF_OPENMP_INC']
+
     defs += ' PARALLEL'
 
 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
     defs += ' USE_MSVC6FIXES'
-incs = env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] 
+incs += ' ' + env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] 
 incs += ' extern '
 
 env.BlenderLib ('bf_elbeem', sources, Split(incs), Split(defs), libtype='intern', priority=0 )
index af5bf1aeb20cf7af4d4de9c5f97dae8a007a3052..2fc8798fc789b019933cf2dcbbe25210fc89b918 100644 (file)
@@ -3,12 +3,16 @@ Import ('env')
 
 sources = env.Glob('intern/*.cpp')
 
+incs = ''
 defs = ''
 
 if env['WITH_BF_OPENMP']:
+    if env['OURPLATFORM'] == 'linuxcross':
+        incs += ' ' + env['BF_OPENMP_INC']
+
     defs += ' PARALLEL=1'
 
-incs = env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] 
+incs += ' ' + env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] 
 incs += ' intern ../../extern/bullet2/src ../memutil ../guardealloc '
 
 if env['WITH_BF_FFTW3']:
index e4e89671653027646ce89bcc965ec95c0e503a06..3944a3c6df5d485fc8c6bd9dec53415012067f65 100644 (file)
@@ -10,5 +10,5 @@ if env['WITH_BF_GAMEENGINE']:
 if env['WITH_BF_PLAYER']:
        SConscript (['blenderplayer/bad_level_call_stubs/SConscript'])
 
-if env['OURPLATFORM'] in ('win64-vc', 'win32-vc', 'win32-mingw'):
+if env['OURPLATFORM'] in ('win64-vc', 'win32-vc', 'win32-mingw', 'linuxcross'):
        SConscript (['icons/SConscript'])
index 91edc46ba8bb18471d132e9fe0bb16c43c25d051..34ffaa71c76d211005da214ce9ba0fac6273d1e4 100644 (file)
@@ -11,7 +11,7 @@ incs += ' ' + env['BF_GETTEXT_INC']
 
 defs = []
 
-if sys.platform == 'win32':
+if sys.platform == 'win32' or env['OURPLATFORM'] == 'linuxcross':
        defs.append('_WIN32')
        defs.append('USE_GETTEXT_DLL')
 
index bca9399bc2783792943b7f30170a5dcecec6f326..df1a096cb99d4cadc313aaf98baa6a496f72d663 100644 (file)
@@ -16,4 +16,8 @@ if env['OURPLATFORM'] == 'linux2':
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
     incs += ' ' + env['BF_PTHREADS_INC']
 
+if env['OURPLATFORM'] == 'linuxcross':
+    if env['WITH_BF_OPENMP']:
+        incs += ' ' + env['BF_OPENMP_INC']
+
 env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [363,170], compileflags =cflags )
index 8a0e738080cf5fb8c94311da6dc87168f2ec0b76..38819ccdf9653f9a1ecce2984593d9ac3f88031f 100644 (file)
@@ -55,15 +55,17 @@ makesdna = makesdna_tool.Program (target = targetdir, source = source_files, LIB
 dna_dict = dna.Dictionary()
 dna.Depends ('dna.c', makesdna)
 dna.Depends ('dna.c', header_files)
+
 if env['OURPLATFORM'] != 'linuxcross':
+       if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
+               dna.Command ('dna.c', '', "\"" + root_build_dir+os.sep+"makesdna\" $TARGET")
+       else:
+               dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET")
+else:
        if USE_WINE:
                dna.Command ('dna.c', '', 'wine ' + root_build_dir+os.sep+"makesdna $TARGET")
        else:
-               if env['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
-                       dna.Command ('dna.c', '', "\"" + root_build_dir+os.sep+"makesdna\" $TARGET")
-               else:
-                       dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET")
-else:
-       dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna.exe $TARGET")
+               dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna.exe $TARGET")
+
 obj = ['intern/dna.c', 'intern/dna_genfile.c']
 Return ('obj')
index d9a074c1470296d51587800cb35f483bfbb4239e..366f6bd723c07d5fff197aa6ed4d6242e521204b 100644 (file)
@@ -34,6 +34,11 @@ if env['OURPLATFORM'] == 'linux2':
         cxxflags = env['CXXFLAGS'] +  env['BF_RAYOPTIMIZATION_SSE_FLAGS']
     incs += ' ../../../extern/binreloc/include'
 
+if env['OURPLATFORM'] == 'linuxcross':
+    if env['WITH_BF_RAYOPTIMIZATION']:
+        cflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
+        cxxflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
+
 if env['WITH_BF_QUICKTIME']:
     defs.append('WITH_QUICKTIME')
     incs += ' ../quicktime ' + env['BF_QUICKTIME_INC']
@@ -44,6 +49,12 @@ if env['WITH_BF_OPENEXR']:
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
     incs += ' ' + env['BF_PTHREADS_INC']
 
+#
+# HACK: To fix problem with error 'MMX instruction set not enabled' from mmintrin.h
+#
+if env['OURPLATFORM'] == 'linuxcross':
+    defs.append('__MMX__')
+
 if env['WITH_BF_RAYOPTIMIZATION']:
     defs.append('__SSE__')
 
index c929729f05b98501b042d9ffcb31fa58c9ebb875..5abb36aafea8a5ed84543017d4f06d544d6b490c 100644 (file)
@@ -1,6 +1,9 @@
 #!/usr/bin/python
 Import ('env')
 
-source = 'winblender.rcscons'
+if env['OURPLATFORM'] == 'linuxcross':
+       source = 'linuxcrossblender.rcscons'
+else:
+       source = 'winblender.rcscons'
 
 env.BlenderRes('winresource', source, ['core'], priority=[95])
index c51c1367f33a4dc3bf34f07bb917b726eb410a94..441d454b782647aaa6d777c76e3dd696ea38c453 100644 (file)
@@ -117,15 +117,19 @@ def setup_staticlibs(lenv):
        statlibs = [
                #here libs for static linking
        ]
-       libincs = [
-               '/usr/lib',
+
+       libincs = []
+       if lenv['OURPLATFORM'] != 'linuxcross':
+               libincs.append('/usr/lib')
+
+       libincs.extend([
                lenv['BF_OPENGL_LIBPATH'],
                lenv['BF_JPEG_LIBPATH'],
                lenv['BF_PNG_LIBPATH'],
                lenv['BF_ZLIB_LIBPATH'],
                lenv['BF_LIBSAMPLERATE_LIBPATH'],
                lenv['BF_ICONV_LIBPATH']
-               ]
+               ])
 
        libincs += Split(lenv['BF_FREETYPE_LIBPATH'])
        if lenv['WITH_BF_PYTHON']:
@@ -167,6 +171,10 @@ def setup_staticlibs(lenv):
                        libincs += Split(lenv['BF_PCRE_LIBPATH'])
                        libincs += Split(lenv['BF_EXPAT_LIBPATH'])
 
+       if lenv['WITH_BF_OPENMP']:
+               if lenv['OURPLATFORM'] == 'linuxcross':
+                       libincs += Split(lenv['BF_OPENMP_LIBPATH'])
+
 
        return statlibs, libincs
 
@@ -752,11 +760,11 @@ class BlenderEnvironment(SConsEnvironment):
                if  lenv['OURPLATFORM']=='darwin':
                        lenv['BINARYKIND'] = binarykind
                        lenv.AddPostAction(prog,Action(AppIt,strfunction=my_appit_print))
-               elif os.sep == '/': # any unix
+               elif os.sep == '/' and lenv['OURPLATFORM'] != 'linuxcross': # any unix (except cross-compilation)
                        if lenv['WITH_BF_PYTHON']:
                                if not lenv['WITHOUT_BF_INSTALL'] and not lenv['WITHOUT_BF_PYTHON_INSTALL']:
                                        lenv.AddPostAction(prog,Action(UnixPyBundle,strfunction=my_unixpybundle_print))
-               elif lenv['OURPLATFORM'].startswith('win'): # windows
+               elif lenv['OURPLATFORM'].startswith('win') or lenv['OURPLATFORM'] == 'linuxcross': # windows or cross-compilation
                        if lenv['WITH_BF_PYTHON']:
                                if not lenv['WITHOUT_BF_PYTHON_INSTALL']:
                                        lenv.AddPostAction(prog,Action(WinPyBundle,strfunction=my_winpybundle_print))
index 7dde9a14f6c37c0d02aff8a65e80e117813340fe..a8e39e3d1006a22cf2a3093e075e929ec4013c8e 100644 (file)
@@ -64,6 +64,9 @@ def validate_arguments(args, bc):
             'WITHOUT_BF_INSTALL',
             'WITHOUT_BF_PYTHON_INSTALL',
             'WITH_BF_OPENMP',
+            'BF_OPENMP',
+            'BF_OPENMP_INC',
+            'BF_OPENMP_LIBPATH',
             'WITH_GHOST_COCOA',
             'USE_QTKIT',
             'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE',
@@ -318,6 +321,9 @@ def read_opts(cfg, args):
         ('BF_FREETYPE_LIBPATH', 'Freetype library path', ''),
 
         (BoolVariable('WITH_BF_OPENMP', 'Use OpenMP if true', False)),
+        ('BF_OPENMP', 'Base path to OpenMP (used when cross-compiling with older versions of WinGW)', ''),
+        ('BF_OPENMP_INC', 'Path to OpenMP includes (used when cross-compiling with older versions of WinGW)', ''),
+        ('BF_OPENMP_LIBPATH', 'Path to OpenMP libraries (used when cross-compiling with older versions of WinGW)', ''),
         (BoolVariable('WITH_GHOST_COCOA', 'Use Cocoa-framework if true', False)),
         (BoolVariable('USE_QTKIT', 'Use QTKIT if true', False)),
 
index 299bfca929d23910f8385a23023a5b2c8f685a49..ba6d4878593e957cb9c3f29581bebbbf190a235c 100644 (file)
@@ -1,7 +1,4 @@
-#coments are #JB where this file was altered by Jasen Betts
-# email:  'n@tres'.join(['jase','hna.com'])
-
-"""tools.crossmingw
+"""SCons.Tool.gcc
 
 Tool-specific initialization for MinGW (http://www.mingw.org/)
 
@@ -12,7 +9,7 @@ selection method.
 """
 
 #
-# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -34,7 +31,7 @@ selection method.
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #
 
-__revision__ = "/home/scons/scons/branch.0/branch.96/baseline/src/engine/SCons/Tool/mingw.py 0.96.91.D001 2005/09/08 09:14:36 knight"
+__revision__ = "src/engine/SCons/Tool/mingw.py 4043 2009/02/23 09:06:45 scons"
 
 import os
 import os.path
@@ -42,6 +39,7 @@ import string
 
 import SCons.Action
 import SCons.Builder
+import SCons.Defaults
 import SCons.Tool
 import SCons.Util
 
@@ -63,18 +61,20 @@ def find(env):
     return ''
 
 def shlib_generator(target, source, env, for_signature):
-    cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS'])
+    cmd = SCons.Util.CLVar(['$SHLINK']) 
 
     dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
     if dll: cmd.extend(['-o', dll])
 
-    cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])
+    cmd.extend(['$SOURCES', '$SHLINKFLAGS', '$_LIBDIRFLAGS', '$_LIBFLAGS'])
 
     implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
     if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature))
 
-    def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
-    if def_target: cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature))
+    def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
+    insert_def = env.subst("$WINDOWS_INSERT_DEF")
+    if not insert_def in ['', '0', 0] and def_target: \
+        cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature))
 
     return [cmd]
 
@@ -89,7 +89,7 @@ def shlib_emitter(target, source, env):
        not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):
 
         # Append an import library to the list of targets.
-        target.append(env.ReplaceIxes(dll,
+        target.append(env.ReplaceIxes(dll,  
                                       'SHLIBPREFIX', 'SHLIBSUFFIX',
                                       'LIBPREFIX', 'LIBSUFFIX'))
 
@@ -97,76 +97,64 @@ def shlib_emitter(target, source, env):
     # or a def file source. There is no option to disable def file
     # target emitting, because I can't figure out why someone would ever
     # want to turn it off.
-    def_source = env.FindIxes(source, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
-    def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
+    def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
+    def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
     if not def_source and not def_target:
-        target.append(env.ReplaceIxes(dll,
+        target.append(env.ReplaceIxes(dll,  
                                       'SHLIBPREFIX', 'SHLIBSUFFIX',
-                                      'WIN32DEFPREFIX', 'WIN32DEFSUFFIX'))
+                                      'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX'))
 
     return (target, source)
 
-#JB  """ I'm blindly susbstuting lines from the mingw.py
-#JB      file becase these lines cause python errors here. """
-#JB shlib_action = SCons.Action.Action(shlib_generator,generator=1)
-shlib_action = SCons.Action.CommandGeneratorAction(shlib_generator)
-
-res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
 
-#JB """ changed for what was in mingw.py """
-#JB res_builder = SCons.Builder.Builder(action=res_action, suffix='.o',
-#JB                                    source_scanner=SCons.Tool.SourceFileScanner)
+shlib_action = SCons.Action.Action(shlib_generator, generator=1)
 
-res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.o',
-                                    source_scanner=SCons.Defaults.ObjSourceScan)
+res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
 
-#JB  SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)
-SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan)
-#JB """ no more changes """
+res_builder = SCons.Builder.Builder(action=res_action, suffix='.o',
+                                    source_scanner=SCons.Tool.SourceFileScanner)
+SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)
 
 def generate(env):
-    mingw_prefix = find(env)
-
-    if mingw_prefix:
-        dir = os.path.dirname(env.WhereIs(mingw_prefix + 'gcc') or SCons.Util.WhereIs(mingw_prefix + 'gcc'))
-
-        # The mingw bin directory must be added to the path:
-        path = env['ENV'].get('PATH', [])
-        if not path:
-            path = []
-        if SCons.Util.is_String(path):
-            path = string.split(path, os.pathsep)
-
-        env['ENV']['PATH'] = string.join([dir] + path, os.pathsep)
+    mingw = find(env)
+    if mingw:
+        dir = os.path.dirname(mingw)
+        env.PrependENVPath('PATH', dir )
+        
 
     # Most of mingw is the same as gcc and friends...
-    gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas']
+    gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'm4']
     for tool in gnu_tools:
         SCons.Tool.Tool(tool)(env)
 
     #... but a few things differ:
-    env['CC'] = mingw_prefix + 'gcc'
+    env['CC'] = mingw + 'gcc'
     env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
-    env['CXX'] = mingw_prefix + 'g++'
+    env['CXX'] = mingw + 'g++'
     env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
     env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
     env['SHLINKCOM']   = shlib_action
-    env['AR'] = mingw_prefix + 'ar'
-    env['RANLIB'] = mingw_prefix + 'ranlib'
+    env['LDMODULECOM'] = shlib_action
     env.Append(SHLIBEMITTER = [shlib_emitter])
-    env['LINK'] = mingw_prefix + 'gcc'
-    env['AS'] = mingw_prefix + 'as'
+    env['RANLIB'] = mingw + 'ranlib'
+    env['LINK'] = mingw + 'gcc'
+    env['AS'] = mingw + 'as'
+    env['AR'] = mingw + 'ar'
+
     env['WIN32DEFPREFIX']        = ''
     env['WIN32DEFSUFFIX']        = '.def'
+    env['WINDOWSDEFPREFIX']      = '${WIN32DEFPREFIX}'
+    env['WINDOWSDEFSUFFIX']      = '${WIN32DEFSUFFIX}'
+
     env['SHOBJSUFFIX'] = '.o'
     env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
 
-    env['RC'] = mingw_prefix + 'windres'
+    env['RC'] = mingw + 'windres'
     env['RCFLAGS'] = SCons.Util.CLVar('')
-    env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET)} $)'
+    env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
     env['RCINCPREFIX'] = '--include-dir '
     env['RCINCSUFFIX'] = ''
-    env['RCCOM'] = '$RC $RCINCFLAGS $RCINCPREFIX $SOURCE.dir $RCFLAGS -i $SOURCE -o $TARGET'
+    env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'
     env['BUILDERS']['RES'] = res_builder
 
     # Some setting from the platform also have to be overridden:
@@ -187,3 +175,9 @@ def generate(env):
 
 def exists(env):
     return find(env)
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: