--- ray/build_utils/find_libs.py 2010/05/27 19:32:12 1.6 +++ ray/build_utils/find_libs.py 2016/03/10 17:36:18 1.8 @@ -1,3 +1,5 @@ +from __future__ import print_function + import os from SCons.SConf import SConf # aka Configure @@ -5,10 +7,10 @@ from SCons.SConf import SConf # aka Configure def find_radlib(env): v = env.FindFile('helvet.fnt', './lib') if not v: - print ''' + print(''' Radiance auxiliary support files not found. -> Download from radiance-online.org and extract. - ''' + ''') env.Exit() def find_x11(env): @@ -64,15 +66,21 @@ def find_libtiff(env): if cfgi or cfgl: dl.insert(0,(cfgi, cfgl)) for incdir, libdir in dl: - if incdir: env.Prepend(CPPPATH=[incdir]) # add temporarily - if libdir: env.Prepend(LIBPATH=[libdir]) - conf = SConf(env) - if conf.CheckLib('tiff', 'TIFFInitSGILog', - header='void TIFFInitSGILog(void);', autoadd=0): + xenv = env.Clone() + if incdir: xenv.Prepend(CPPPATH=[incdir]) # add temporarily + if libdir: + xenv.Prepend(LIBPATH=[libdir]) + xenv.Prepend(PATH=[libdir]) + conf = SConf(xenv) + libname = 'tiff' + if os.name == 'nt': + xenv['INCPREFIX'] = '/I ' # Bug in SCons (uses '/I') + libname = 'libtiff' + if conf.CheckLib(libname, 'TIFFInitSGILog', + header='''#include "tiff.h"''', autoadd=0): env['TIFFLIB_INSTALLED'] = 1 - if incdir: env['CPPPATH'].remove(incdir) # not needed for now - if libdir: env['LIBPATH'].remove(libdir) if env.has_key('TIFFLIB_INSTALLED'): + env.Replace(RAD_LIBTIFF=libname) if incdir: env.Replace(RAD_TIFFINCLUDE=[incdir]) if libdir: env.Replace(RAD_TIFFLIB=[libdir]) conf.Finish()