==SCons==
authorNathan Letwory <nathan@letworyinteractive.com>
Sat, 25 Feb 2006 14:53:27 +0000 (14:53 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Sat, 25 Feb 2006 14:53:27 +0000 (14:53 +0000)
+ SCons support for pthreads-win32. Library will be committed shortly into
  lib/windows, so be sure to check commit list and update that as well
  when the pthread lib is available.

SConstruct
config/win32-mingw-config.py
config/win32-vc-config.py
source/blender/blenlib/SConscript
tools/Blender.py
tools/btools.py

index 70931073ad7fc0f59cec99842f9ff63b8a88fc11..d16fd9a292ba7820d736b4861ee76f2f04276db8 100644 (file)
 # along with this program; if not, write to the Free Software Foundation,
 # Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# The Original Code is Copyright (C) 2006, Blender Foundation
 # All rights reserved.
 #
-# The Original Code is: none of this file.
+# The Original Code is: all of this file.
 #
 # Contributor(s): Nathan Letwory.
 #
@@ -290,12 +290,17 @@ textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
 
 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
 
-if env['OURPLATFORM'] == 'win32-vc':
-    windlls = env.Install(dir=env['BF_INSTALLDIR'], source = ['#../lib/windows/gettext/lib/gnu_gettext.dll',
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
+    dllsources = ['#../lib/windows/gettext/lib/gnu_gettext.dll',
                         '#../lib/windows/png/lib/libpng.dll',
                         '#../lib/windows/python/lib/python24.dll',
                         '#../lib/windows/sdl/lib/SDL.dll',
-                        '#../lib/windows/zlib/lib/zlib.dll'])
+                        '#../lib/windows/zlib/lib/zlib.dll']
+    if env['OURPLATFORM'] == 'win32-mingw':
+        dllsources += ['#../lib/windows/pthreads/lib/pthreadGC2.dll']
+    else:
+        dllsources += ['#../lib/windows/pthreads/lib/pthreadVC2.dll']
+    windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
     allinstall += windlls
 
 installtarget = env.Alias('install', allinstall)
index ed87a13ce3efbfc534548f615c6c43bab0997c7c..d5c7c9d8a9e7c42b897bc14d274abfb64e651a00 100644 (file)
@@ -14,10 +14,15 @@ BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 
 WITH_BF_SDL = 'true'
 BF_SDL = LCGDIR + '/sdl'
-BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+BF_SDL_INC = '${BF_SDL}/include'
 BF_SDL_LIB = 'SDL'
 BF_SDL_LIBPATH = '${BF_SDL}/lib'
 
+BF_PTHREADS = LCGDIR + '/pthreads'
+BF_PTHREADS_INC = '${BF_PTHREADS}/include'
+BF_PTHREADS_LIB = 'pthreadGC2'
+BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
+
 WITH_BF_FMOD = 'false'
 BF_FMOD = LCGDIR + '/fmod'
 
index 906ff2694ff0400859ec98e0599df4bd0f518427..6100bfd978f38a9d39e9345d53bfb19e0306ebb9 100644 (file)
@@ -24,6 +24,11 @@ BF_SDL_INC = '${BF_SDL}/include'
 BF_SDL_LIB = 'SDL.lib'
 BF_SDL_LIBPATH = '${BF_SDL}/lib'
 
+BF_PTHREADS = LCGDIR + '/pthreads'
+BF_PTHREADS_INC = '${BF_PTHREADS}/include'
+BF_PTHREADS_LIB = 'pthreadVC2'
+BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
+
 WITH_BF_FMOD = 'false'
 BF_FMOD = LCGDIR + '/fmod'
 
index de588c5a54a4b27c1dd247f8058799e01dd0e79e..a7dab45ad13e574d4355d7d5a172ce669398ddde 100644 (file)
@@ -16,4 +16,7 @@ if env['WITH_BF_INTERNATIONAL'] == 1:
 if env['OURPLATFORM'] == 'linux2':
     cflags='-pthread'
 
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
+    incs += ' ' + env['BF_PTHREADS_INC']
+
 env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [85,195], compileflags =cflags )
index ad744697c7aa59f141803cd7b8d97a99d85cff0d..1243fb7d309afb515b9a6678447eb49e5a642b96 100644 (file)
@@ -124,6 +124,9 @@ def setup_staticlibs(lenv):
     if lenv['WITH_BF_STATICOPENGL']:
         statlibs += Split(lenv['BF_OPENGL_LIB_STATIC'])
 
+    if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
+        libincs += Split(lenv['BF_PTHREADS_LIBPATH'])
+
     return statlibs, libincs
 
 def setup_syslibs(lenv):
@@ -147,6 +150,9 @@ def setup_syslibs(lenv):
     syslibs += Split(lenv['BF_SDL_LIB'])
     if not lenv['WITH_BF_STATICOPENGL']:
         syslibs += Split(lenv['BF_OPENGL_LIB'])
+    if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
+        syslibs += Split(lenv['BF_PTHREADS_LIB'])
+
     syslibs += Split(lenv['LLIBS'])
 
     return syslibs
index ba14712c201a40b50831a0475232f0ee66e28cbc..2c80bd7131cff171fc4d409584616219d71cf534 100755 (executable)
@@ -18,6 +18,7 @@ def validate_arguments(args, bc):
             'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'BF_PYTHON_LINKFLAGS',
             'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH',
             'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
+            'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
             'WITH_BF_FMOD',
             'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH',
             'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB', 
@@ -129,6 +130,11 @@ def read_opts(cfg, args):
         ('BF_SDL_LIB', 'SDL library', ''),      #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
         ('BF_SDL_LIBPATH', 'SDL library path', ''),
 
+        ('BF_PTHREADS', 'Pthreads base path', ''),
+        ('BF_PTHREADS_INC', 'Pthreads include path', ''),
+        ('BF_PTHREADS_LIB', 'Pthreads library', ''),
+        ('BF_PTHREADS_LIBPATH', 'Pthreads library path', ''),
+
         (BoolOption('WITH_BF_FMOD', 'Use FMOD if true', 'false')),
         #  BF_FMOD = $(LCGDIR)/fmod