From ad76a8a10c22e251c9d22dc20cdc9613e0c785e8 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 31 Jan 2013 12:24:12 +0000 Subject: [PATCH] Fix scons building under unix. Now we should really have only *one* '/usr/lib' lib search path, in last position! Previously we could have a bunch of those, even in first position, which would e.g. prevent linking against a custom boost in /opt/lib/boost if you had a system boost installed... --- build_files/scons/tools/Blender.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 94a9f1d9c24..3688a829a4d 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -29,6 +29,7 @@ from SCons.Script.SConscript import SConsEnvironment import SCons.Action import SCons.Util import SCons.Builder +import SCons.Subst import SCons.Tool import bcolors bc = bcolors.bcolors() @@ -234,10 +235,6 @@ def setup_staticlibs(lenv): if lenv['WITH_BF_STATICLLVM']: statlibs += Split(lenv['BF_LLVM_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', 'win64-mingw'): - libincs.append('/usr/lib') - if lenv['WITH_BF_JEMALLOC']: libincs += Split(lenv['BF_JEMALLOC_LIBPATH']) if lenv['WITH_BF_STATICJEMALLOC']: @@ -249,6 +246,12 @@ def setup_staticlibs(lenv): if lenv['WITH_BF_STATIC3DMOUSE']: statlibs += Split(lenv['BF_3DMOUSE_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', 'win64-mingw'): + # We must remove any previous items defining this path, for same reason stated above! + libincs = [e for e in libincs if SCons.Subst.scons_subst(e, lenv, gvars=lenv.Dictionary()) != "/usr/lib"] + libincs.append('/usr/lib') + return statlibs, libincs def setup_syslibs(lenv):