1 |
+ |
from __future__ import print_function |
2 |
+ |
|
3 |
|
import os |
4 |
|
|
5 |
|
from SCons.SConf import SConf # aka Configure |
6 |
|
|
7 |
|
def find_radlib(env): |
8 |
< |
v = env.FindFile('Verdana.fnt', './lib') |
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_pyinstaller(env): |
17 |
+ |
if os.name != 'nt': |
18 |
+ |
return |
19 |
+ |
conf = SConf(env) |
20 |
+ |
oldpath = (env['ENV'].get('PATH')) |
21 |
+ |
try: |
22 |
+ |
env['ENV']['PATH'] = os.environ['PATH'] |
23 |
+ |
pyinst = conf.CheckProg('pyinstaller.exe') |
24 |
+ |
if pyinst: |
25 |
+ |
env['PYINSTALLER'] = pyinst |
26 |
+ |
env['PYSCRIPTS'] = [] |
27 |
+ |
env = conf.Finish() |
28 |
+ |
finally: |
29 |
+ |
env['ENV']['PATH'] = oldpath |
30 |
+ |
|
31 |
|
def find_x11(env): |
32 |
|
# Search for libX11, remember the X11 library and include dirs |
33 |
|
for d in ('/usr/X11R6', '/usr/X11', '/usr/openwin'): |
61 |
|
if incdir: env.Prepend(CPPPATH=[incdir]) # add temporarily |
62 |
|
if libdir: env.Prepend(LIBPATH=[libdir]) |
63 |
|
conf = SConf(env) |
64 |
< |
if conf.CheckLibWithHeader('GL', 'GL/gl.h', 'C', autoadd=0): |
64 |
> |
if (conf.CheckLib('GL') |
65 |
> |
or conf.CheckLib('opengl32') |
66 |
> |
or conf.CheckCHeader('OpenGL/gl.h') |
67 |
> |
or conf.CheckCHeader('GL/gl.h')): |
68 |
|
env['OGL'] = 1 |
69 |
+ |
if os.name == 'nt': |
70 |
+ |
if (conf.CheckLib('GLU') # for winrview |
71 |
+ |
or conf.CheckLib('glu32') |
72 |
+ |
or conf.CheckCHeader('OpenGL/glu.h')): |
73 |
+ |
env['GLU'] = 1 |
74 |
|
if incdir: env['CPPPATH'].remove(incdir) # not needed for now |
75 |
|
if libdir: env['LIBPATH'].remove(libdir) |
76 |
|
if env.has_key('OGL'): |
77 |
|
if incdir: env.Replace(OGLINCLUDE=[incdir]) |
78 |
+ |
if env.has_key('GLU'): |
79 |
+ |
if incdir: env.Replace(GLUINCLUDE=[incdir]) |
80 |
|
#if libdir: env.Replace(OGLLIB=[libdir]) |
81 |
|
conf.Finish() |
82 |
|
break |
91 |
|
if cfgi or cfgl: |
92 |
|
dl.insert(0,(cfgi, cfgl)) |
93 |
|
for incdir, libdir in dl: |
94 |
< |
if incdir: env.Prepend(CPPPATH=[incdir]) # add temporarily |
95 |
< |
if libdir: env.Prepend(LIBPATH=[libdir]) |
96 |
< |
conf = SConf(env) |
97 |
< |
if conf.CheckLib('tiff', 'TIFFInitSGILog', |
98 |
< |
header='void TIFFInitSGILog(void);', autoadd=0): |
94 |
> |
xenv = env.Clone() |
95 |
> |
if incdir: xenv.Prepend(CPPPATH=[incdir]) # add temporarily |
96 |
> |
if libdir: |
97 |
> |
xenv.Prepend(LIBPATH=[libdir]) |
98 |
> |
xenv.Prepend(PATH=[libdir]) |
99 |
> |
conf = SConf(xenv) |
100 |
> |
libname = 'tiff' |
101 |
> |
if os.name == 'nt': |
102 |
> |
xenv['INCPREFIX'] = '/I ' # Bug in SCons (uses '/I') |
103 |
> |
libname = 'libtiff' |
104 |
> |
if conf.CheckLib(libname, 'TIFFInitSGILog', |
105 |
> |
header='''#include "tiff.h"''', autoadd=0): |
106 |
|
env['TIFFLIB_INSTALLED'] = 1 |
73 |
– |
if incdir: env['CPPPATH'].remove(incdir) # not needed for now |
74 |
– |
if libdir: env['LIBPATH'].remove(libdir) |
107 |
|
if env.has_key('TIFFLIB_INSTALLED'): |
108 |
+ |
env.Replace(RAD_LIBTIFF=libname) |
109 |
|
if incdir: env.Replace(RAD_TIFFINCLUDE=[incdir]) |
110 |
|
if libdir: env.Replace(RAD_TIFFLIB=[libdir]) |
111 |
|
conf.Finish() |