scons: normalize paths to make sure that trailing slashes are striped and the lib/include directories are removed with dirname

This commit is contained in:
Dane Springmeyer 2010-08-25 22:20:19 +00:00
parent 05d37a282f
commit 317830784e

View file

@ -55,7 +55,7 @@ def regular_print(color,text,newline=True):
print text print text
def call(cmd, silent=False): def call(cmd, silent=False):
stdin, stderr = Popen(cmd,shell=True,stdout=PIPE,stderr=PIPE).communicate() stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
if not stderr: if not stderr:
return stdin.strip() return stdin.strip()
elif not silent: elif not silent:
@ -555,9 +555,11 @@ def FindBoost(context, prefixes, thread_flag):
search_lib = 'libboost_thread' search_lib = 'libboost_thread'
else: else:
search_lib = 'libboost_filesystem' search_lib = 'libboost_filesystem'
prefixes.insert(0,os.path.dirname(env['BOOST_INCLUDES'])) # note: must call normpath to strip trailing slash otherwise dirname
prefixes.insert(0,os.path.dirname(env['BOOST_LIBS'])) # does not remove 'lib' and 'include'
prefixes.insert(0,os.path.dirname(os.path.normpath(env['BOOST_INCLUDES'])))
prefixes.insert(0,os.path.dirname(os.path.normpath(env['BOOST_LIBS'])))
for searchDir in prefixes: for searchDir in prefixes:
libItems = glob(os.path.join(searchDir, LIBDIR_SCHEMA, '%s*.*' % search_lib)) libItems = glob(os.path.join(searchDir, LIBDIR_SCHEMA, '%s*.*' % search_lib))
if not libItems: if not libItems: