- Added options to link staticly against oiio/boost
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 9 Nov 2011 19:02:42 +0000 (19:02 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 9 Nov 2011 19:02:42 +0000 (19:02 +0000)
- Also changed buildbot settings so now linking should happe staticly

build_files/buildbot/config/user-config-i686.py
build_files/buildbot/config/user-config-x86_64.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py

index 0a35babeaf5981532ac85f8e3c10f743f26e6bb3..c368bf1bd7970dcb9d70fa5db9eb626184ad02cd 100644 (file)
@@ -96,16 +96,18 @@ WITH_BF_JACK = True
 WITH_BF_CYCLES = True
 
 WITH_BF_OIIO = True
+WITH_BF_STATICOIIO = True
 BF_OIIO = '/opt/oiio'
-BF_OIIO_INC = '/opt/oiio/include'
-BF_OIIO_LIB = 'OpenImageIO IlmImf'
-BF_OIIO_LIBPATH = '/opt/oiio/lib'
+BF_OIIO_INC = '${BF_OIIO}/include'
+BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a'
+BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
 
 WITH_BF_BOOST = True
+WITH_BF_STATICBOOST = True
 BF_BOOST = '/opt/boost'
-BF_BOOST_INC = '/opt/boost/include'
-BF_BOOST_LIB = 'libboost_date_time libboost_filesystem libboost_regex libboost_system libboost_thread'
-BF_BOOST_LIBPATH = '/opt/boost/lib'
+BF_BOOST_INC = '${BF_BOOST}/include'
+BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
 # Compilation and optimization
 BF_DEBUG = False
index c3c1f0b9d90b02a525c06603bc02584104049900..d72b3bfb1c4ff19b23391e7ca32d1efd0d24dd54 100644 (file)
@@ -96,16 +96,18 @@ WITH_BF_JACK = True
 WITH_BF_CYCLES = True
 
 WITH_BF_OIIO = True
+WITH_BF_STATICOIIO = True
 BF_OIIO = '/opt/oiio'
-BF_OIIO_INC = '/opt/oiio/include'
-BF_OIIO_LIB = 'OpenImageIO IlmImf'
-BF_OIIO_LIBPATH = '/opt/oiio/lib'
+BF_OIIO_INC = '${BF_OIIO}/include'
+BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a'
+BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
 
 WITH_BF_BOOST = True
+WITH_BF_STATICBOOST = True
 BF_BOOST = '/opt/boost'
-BF_BOOST_INC = '/opt/boost/include'
-BF_BOOST_LIB = 'libboost_date_time libboost_filesystem libboost_regex libboost_system libboost_thread'
-BF_BOOST_LIBPATH = '/opt/boost/lib'
+BF_BOOST_INC = '${BF_BOOST}/include'
+BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_system.a ${BF_BOOST_LIBPATH}/libboost_thread.a'
+BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 
 # Compilation and optimization
 BF_DEBUG = False
index 434f52dac87d8b89e8f001934b452cb221357b17..71a4af1dc36c5366040f08858180bbe68c8b9e38 100644 (file)
@@ -195,8 +195,13 @@ def setup_staticlibs(lenv):
             
     if lenv['WITH_BF_OIIO']:
         libincs += Split(lenv['BF_OIIO_LIBPATH'])
+        if lenv['WITH_BF_STATICOIIO']:
+            statlibs += Split(lenv['BF_OIIO_LIB_STATIC'])
+
     if lenv['WITH_BF_BOOST']:
         libincs += Split(lenv['BF_BOOST_LIBPATH'])
+        if lenv['WITH_BF_STATICBOOST']:
+            statlibs += Split(lenv['BF_BOOST_LIB_STATIC'])
 
     # setting this last so any overriding of manually libs could be handled
     if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
@@ -238,7 +243,8 @@ def setup_syslibs(lenv):
     if lenv['WITH_BF_ICONV']:
         syslibs += Split(lenv['BF_ICONV_LIB'])
     if lenv['WITH_BF_OIIO']:
-        syslibs += Split(lenv['BF_OIIO_LIB'])
+        if not lenv['WITH_BF_STATICOIIO']:
+            syslibs += Split(lenv['BF_OIIO_LIB'])
 
     if lenv['WITH_BF_OPENEXR'] and not lenv['WITH_BF_STATICOPENEXR']:
         syslibs += Split(lenv['BF_OPENEXR_LIB'])
@@ -279,7 +285,7 @@ def setup_syslibs(lenv):
             if not lenv['WITH_BF_STATIC3DMOUSE']:
                 syslibs += Split(lenv['BF_3DMOUSE_LIB'])
                 
-    if lenv['WITH_BF_BOOST']:
+    if lenv['WITH_BF_BOOST'] and not lenv['WITH_BF_STATICBOOST']:
         syslibs += Split(lenv['BF_BOOST_LIB'])
 
     syslibs += Split(lenv['BF_JPEG_LIB'])
index b4b10ba0bfa3dcdeda68e647eeb813d8bf2610df..7de1649fd626b0b29c79b1d45eaf7d4751641121 100644 (file)
@@ -157,8 +157,8 @@ def validate_arguments(args, bc):
             'BUILDBOT_BRANCH',
             'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
             'WITH_BF_CYCLES',
-            'WITH_BF_OIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIBPATH',
-            'WITH_BF_BOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIBPATH'
+            'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
+            'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH'
             ]
     
     # Have options here that scons expects to be lists
@@ -538,20 +538,26 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_CXX_GUARDEDALLOC', 'Enable GuardedAlloc for C++ memory allocation tracking.', False)),
 
         ('BUILDBOT_BRANCH', 'Buildbot branch name', ''),
-        
+    ) # end of opts.AddOptions()
+
+    localopts.AddVariables(
         (BoolVariable('WITH_BF_CYCLES', 'Build with the Cycles engine', True)),
-        
+
         (BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)),
+        (BoolVariable('WITH_BF_STATICOIIO', 'Staticly link to OpenImageIO', False)),
         ('BF_OIIO', 'OIIO root path', ''),
         ('BF_OIIO_INC', 'OIIO include path', ''),
         ('BF_OIIO_LIB', 'OIIO library', ''),
         ('BF_OIIO_LIBPATH', 'OIIO library path', ''),
-        
+        ('BF_OIIO_LIB_STATIC', 'OIIO static library', ''),
+
         (BoolVariable('WITH_BF_BOOST', 'Build with Boost', False)),
+        (BoolVariable('WITH_BF_STATICBOOST', 'Staticly link to boost', False)),
         ('BF_BOOST', 'Boost root path', ''),
         ('BF_BOOST_INC', 'Boost include path', ''),
         ('BF_BOOST_LIB', 'Boost library', ''),
-        ('BF_BOOST_LIBPATH', 'Boost library path', '')
+        ('BF_BOOST_LIBPATH', 'Boost library path', ''),
+        ('BF_BOOST_LIB_STATIC', 'Boost static library', '')
     ) # end of opts.AddOptions()
 
     return localopts