1 |
+ |
from __future__ import print_function |
2 |
+ |
|
3 |
|
import os |
4 |
|
|
5 |
|
from SCons.SConf import SConf # aka Configure |
7 |
|
def find_radlib(env): |
8 |
|
v = env.FindFile('helvet.fnt', './lib') |
9 |
|
if not v: |
10 |
< |
print ''' |
10 |
> |
print(''' |
11 |
|
Radiance auxiliary support files not found. |
12 |
|
-> Download from radiance-online.org and extract. |
13 |
< |
''' |
13 |
> |
''') |
14 |
|
env.Exit() |
15 |
|
|
16 |
|
def find_x11(env): |
63 |
|
dl = [ (None,None), ] # standard search path |
64 |
|
cfgi = env.get('TIFFINCLUDE') |
65 |
|
cfgl = env.get('TIFFLIB') |
64 |
– |
#print('TIFFLIB:', cfgl) |
66 |
|
if cfgi or cfgl: |
67 |
|
dl.insert(0,(cfgi, cfgl)) |
68 |
|
for incdir, libdir in dl: |
69 |
< |
if incdir: env.Prepend(CPPPATH=[incdir]) # add temporarily |
70 |
< |
if libdir: env.Prepend(LIBPATH=[libdir]) |
71 |
< |
conf = SConf(env) |
69 |
> |
xenv = env.Clone() |
70 |
> |
if incdir: xenv.Prepend(CPPPATH=[incdir]) # add temporarily |
71 |
> |
if libdir: |
72 |
> |
xenv.Prepend(LIBPATH=[libdir]) |
73 |
> |
xenv.Prepend(PATH=[libdir]) |
74 |
> |
conf = SConf(xenv) |
75 |
|
libname = 'tiff' |
72 |
– |
header = 'void TIFFInitSGILog(void);' |
76 |
|
if os.name == 'nt': |
77 |
+ |
xenv['INCPREFIX'] = '/I ' # Bug in SCons (uses '/I') |
78 |
|
libname = 'libtiff' |
79 |
|
if conf.CheckLib(libname, 'TIFFInitSGILog', |
80 |
< |
header=header, autoadd=0): |
80 |
> |
header='''#include "tiff.h"''', autoadd=0): |
81 |
|
env['TIFFLIB_INSTALLED'] = 1 |
78 |
– |
if incdir: env['CPPPATH'].remove(incdir) # not needed for now |
79 |
– |
if libdir: env['LIBPATH'].remove(libdir) |
82 |
|
if env.has_key('TIFFLIB_INSTALLED'): |
83 |
+ |
env.Replace(RAD_LIBTIFF=libname) |
84 |
|
if incdir: env.Replace(RAD_TIFFINCLUDE=[incdir]) |
85 |
|
if libdir: env.Replace(RAD_TIFFLIB=[libdir]) |
86 |
|
conf.Finish() |