More flexible configuration for 3dmouse library for scons.
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 2 Aug 2011 17:59:43 +0000 (17:59 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 2 Aug 2011 17:59:43 +0000 (17:59 +0000)
Needed for release environment and buildbot.

Buildbot rules would be updated with next commit after
environment will be tested.

build_files/scons/config/linux2-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
intern/ghost/SConscript

index 6fb9090b022a8088d7b0982bb623b9d3f951d1ec..d8e227cfb21531da3d98a34d6a2cc1f61cff8d19 100644 (file)
@@ -194,7 +194,11 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
 
 #SpaceNavigator and friends
 WITH_BF_3DMOUSE = True
+BF_3DMOUSE = '/usr'
+BF_3DMOUSE_INC = '${BF_3DMOUSE}/include'
+BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
 BF_3DMOUSE_LIB = 'spnav'
+BF_3DMOUSE_LIB_STATIC = '${BF_3DMOUSE_LIBPATH}/libspnav.a'
 
 ##
 CC = 'gcc'
@@ -227,8 +231,6 @@ CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
 ##FIX_STUBS_WARNINGS = -Wno-unused
 
 LLIBS = ['util', 'c', 'm', 'dl', 'pthread', 'stdc++']
-if WITH_BF_3DMOUSE:
-       LLIBS = LLIBS + [BF_3DMOUSE_LIB];
 ##LOPTS = --dynamic
 ##DYNLDFLAGS = -shared $(LDFLAGS)
 
index 75af7e47edd5061be4fe6c0d7068e3cd39818b3b..6fae2785192a545092dd5befcb2a14065a0a116d 100644 (file)
@@ -206,6 +206,12 @@ def setup_staticlibs(lenv):
         if lenv['WITH_BF_STATICJEMALLOC']:
             statlibs += Split(lenv['BF_JEMALLOC_LIB_STATIC'])
 
+    if lenv['OURPLATFORM']=='linux2':
+        if lenv['WITH_BF_3DMOUSE']:
+            libincs += Split(lenv['BF_3DMOUSE_LIBPATH'])
+            if lenv['WITH_BF_STATIC3DMOUSE']:
+                statlibs += Split(lenv['BF_3DMOUSE_LIB_STATIC'])
+
     return statlibs, libincs
 
 def setup_syslibs(lenv):
@@ -271,6 +277,11 @@ def setup_syslibs(lenv):
         if not lenv['WITH_BF_STATICJEMALLOC']:
             syslibs += Split(lenv['BF_JEMALLOC_LIB'])
 
+    if lenv['OURPLATFORM']=='linux2':
+        if lenv['WITH_BF_3DMOUSE']:
+            if not lenv['WITH_BF_STATIC3DMOUSE']:
+                syslibs += Split(lenv['BF_3DMOUSE_LIB'])
+
     syslibs += lenv['LLIBS']
 
     return syslibs
index a96bf8ce4cca25db5c4e8c5a0e5143e107b73618..b20f3ede68d0f95c6c64c1c03e514f40c1e759fe 100644 (file)
@@ -438,6 +438,12 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
 
         (BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)),
+        (BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)),
+        ('BF_3DMOUSE', '3d mouse library base path', ''),
+        ('BF_3DMOUSE_INC', '3d mouse library include path', ''),
+        ('BF_3DMOUSE_LIB', '3d mouse library', ''),
+        ('BF_3DMOUSE_LIBPATH', '3d mouse library path', ''),
+        ('BF_3DMOUSE_LIB_STATIC', '3d mouse static library', ''),
 
         ('CFLAGS', 'C only flags', []),
         ('CCFLAGS', 'Generic C and C++ flags', []),
index 761cbe56344fac896a5d15c17b5385e82dfb58aa..234fc0a172e1685fe1b27718b09664b31f5f874f 100644 (file)
@@ -80,6 +80,9 @@ else:
 
 if env['WITH_BF_3DMOUSE']:
     defs.append('WITH_INPUT_NDOF')
+
+    if env['OURPLATFORM']=='linux2':
+        incs += ' ' + env['BF_3DMOUSE_INC']
 else:
     sources.remove('intern' + os.sep + 'GHOST_NDOFManager.cpp')
     try: