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): |
46 |
|
if incdir: env.Prepend(CPPPATH=[incdir]) # add temporarily |
47 |
|
if libdir: env.Prepend(LIBPATH=[libdir]) |
48 |
|
conf = SConf(env) |
49 |
< |
if conf.CheckLibWithHeader('GL', 'GL/gl.h', 'C', autoadd=0): |
49 |
> |
if (conf.CheckLib('GL') |
50 |
> |
or conf.CheckLib('opengl32') |
51 |
> |
or conf.CheckCHeader('OpenGL/gl.h') |
52 |
> |
or conf.CheckCHeader('GL/gl.h')): |
53 |
|
env['OGL'] = 1 |
54 |
+ |
if os.name == 'nt': |
55 |
+ |
if (conf.CheckLib('GLU') # for winrview |
56 |
+ |
or conf.CheckLib('glu32') |
57 |
+ |
or conf.CheckCHeader('OpenGL/glu.h')): |
58 |
+ |
env['GLU'] = 1 |
59 |
|
if incdir: env['CPPPATH'].remove(incdir) # not needed for now |
60 |
|
if libdir: env['LIBPATH'].remove(libdir) |
61 |
|
if env.has_key('OGL'): |
62 |
|
if incdir: env.Replace(OGLINCLUDE=[incdir]) |
63 |
+ |
if env.has_key('GLU'): |
64 |
+ |
if incdir: env.Replace(GLUINCLUDE=[incdir]) |
65 |
|
#if libdir: env.Replace(OGLLIB=[libdir]) |
66 |
|
conf.Finish() |
67 |
|
break |
73 |
|
dl = [ (None,None), ] # standard search path |
74 |
|
cfgi = env.get('TIFFINCLUDE') |
75 |
|
cfgl = env.get('TIFFLIB') |
64 |
– |
#print('TIFFLIB:', cfgl) |
76 |
|
if cfgi or cfgl: |
77 |
|
dl.insert(0,(cfgi, cfgl)) |
78 |
|
for incdir, libdir in dl: |
79 |
< |
if incdir: env.Prepend(CPPPATH=[incdir]) # add temporarily |
80 |
< |
if libdir: env.Prepend(LIBPATH=[libdir]) |
81 |
< |
conf = SConf(env) |
79 |
> |
xenv = env.Clone() |
80 |
> |
if incdir: xenv.Prepend(CPPPATH=[incdir]) # add temporarily |
81 |
> |
if libdir: |
82 |
> |
xenv.Prepend(LIBPATH=[libdir]) |
83 |
> |
xenv.Prepend(PATH=[libdir]) |
84 |
> |
conf = SConf(xenv) |
85 |
|
libname = 'tiff' |
72 |
– |
header = 'void TIFFInitSGILog(void);' |
86 |
|
if os.name == 'nt': |
87 |
+ |
xenv['INCPREFIX'] = '/I ' # Bug in SCons (uses '/I') |
88 |
|
libname = 'libtiff' |
89 |
|
if conf.CheckLib(libname, 'TIFFInitSGILog', |
90 |
< |
header=header, autoadd=0): |
90 |
> |
header='''#include "tiff.h"''', autoadd=0): |
91 |
|
env['TIFFLIB_INSTALLED'] = 1 |
78 |
– |
if incdir: env['CPPPATH'].remove(incdir) # not needed for now |
79 |
– |
if libdir: env['LIBPATH'].remove(libdir) |
92 |
|
if env.has_key('TIFFLIB_INSTALLED'): |
93 |
+ |
env.Replace(RAD_LIBTIFF=libname) |
94 |
|
if incdir: env.Replace(RAD_TIFFINCLUDE=[incdir]) |
95 |
|
if libdir: env.Replace(RAD_TIFFLIB=[libdir]) |
96 |
|
conf.Finish() |