Permalink
Browse files

fix SConscript/SConstruct files to allow setting the os lib path

  • Loading branch information...
1 parent 8068a68 commit e5ff75e83e475d90c31278d18122b3f44a1aacc6 @opencollada-sebastian opencollada-sebastian committed Oct 12, 2010
Showing with 17 additions and 5 deletions.
  1. +7 −2 COLLADAValidator/SConscript
  2. +2 −1 SConstruct
  3. +8 −2 dae2ogre/SConscript
@@ -40,6 +40,8 @@ libPath = [ '../COLLADABaseUtils/' + env['libDir'] + env['configurationBaseName
if not env['PCRENATIVE']:
libPath += '../Externals/pcre/' + env['libDir'] + env['configurationBaseName'],
+else:
+ libPath += '/usr/' + env['libDir']
if (env['XMLPARSER'] == 'expat') or (env['XMLPARSER'] == 'expatnative'):
env['CPPFLAGS'] += ' -DXMLPARSER_EXPAT'
@@ -53,15 +55,18 @@ else:
libs += ['xml']
else:
libs += ['xml2']
+ if not env['PCRENATIVE']:
+ libPath += '/usr/' + env['libDir']
linkFlags = []
if env['PG']:
linkFlags += ['-pg']
-if not env['SHAREDLIB']:
- linkFlags += ['-static']
+# This is commented out to allow linking against shared system libraries.
+#if not env['SHAREDLIB']:
+# linkFlags += ['-static']
Program(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'], LIBS=libs, LIBPATH=libPath, LINKFLAGS=linkFlags)
View
@@ -9,6 +9,7 @@ vars = Variables('custom.py')
vars.Add(BoolVariable('RELEASE', 'Set to build for release', 0))
vars.Add(BoolVariable('PG', 'Set to build with -pg set for gcc for profiling', 0))
vars.Add(BoolVariable('SHAREDLIB', 'Set to build shared libraries instead of static ones (untested).', 0))
+vars.Add(EnumVariable('LIBDIRNAME', 'The name of the systems library directory, for linux use', 'lib/', allowed_values=('lib/', 'lib64/') ))
vars.Add(BoolVariable('PCRENATIVE',
"""Set to build using the systems native pcre lib instead of the delivered lib. Uses same configuration dir for both configurations.
""", 1))
@@ -52,7 +53,7 @@ else:
env['validationConfName'] = ''
env['objDir'] = 'obj/'
-env['libDir'] = 'lib/'
+env['libDir'] = env['LIBDIRNAME']
env['binDir'] = 'bin/'
View
@@ -41,6 +41,9 @@ libPath = [ '../COLLADABaseUtils/' + env['libDir'] + env['configurationBaseName
if not env['PCRENATIVE']:
libPath += '../Externals/pcre/' + env['libDir'] + env['configurationBaseName'],
+else:
+ libPath += '/usr/' + env['libDir']
+
if (env['XMLPARSER'] == 'expat') or (env['XMLPARSER'] == 'expatnative'):
env['CPPFLAGS'] += ' -DXMLPARSER_EXPAT'
libs += ['expat']
@@ -53,15 +56,18 @@ else:
libs += ['xml']
else:
libs += ['xml2']
+ if not env['PCRENATIVE']:
+ libPath += '/usr/' + env['libDir']
linkFlags = []
if env['PG']:
linkFlags += ['-pg']
-if not env['SHAREDLIB']:
- linkFlags += ['-static']
+# This is commented out to allow linking against shared system libraries regardless of whether we build static or shared libs
+#if not env['SHAREDLIB']:
+# linkFlags += ['-static']
Program(target=targetPath, source=src, CPPPATH=incDirs, CCFLAGS=env['CPPFLAGS'], LIBS=libs, LIBPATH=libPath, LINKFLAGS=linkFlags)

0 comments on commit e5ff75e

Please sign in to comment.