ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/build_utils/find_libs.py
(Generate patch)

Comparing ray/build_utils/find_libs.py (file contents):
Revision 1.7 by schorsch, Thu Mar 10 01:49:56 2016 UTC vs.
Revision 1.11 by schorsch, Mon Jan 8 13:38:37 2018 UTC

# Line 1 | Line 1
1 + from __future__ import division, print_function, unicode_literals
2 +
3   import os
4  
5   from SCons.SConf import SConf # aka Configure
# Line 5 | Line 7 | 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_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'):
# Line 44 | Line 61 | def find_gl(env):
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
# Line 61 | Line 88 | def find_libtiff(env):
88          dl = [ (None,None), ] # standard search path
89          cfgi = env.get('TIFFINCLUDE')
90          cfgl = env.get('TIFFLIB')
64        #print('TIFFLIB:', cfgl)
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)
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'
72                header = 'void TIFFInitSGILog(void);'
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=header, autoadd=0):
105 >                                header='''#include "tiff.h"''', autoadd=0):
106                          env['TIFFLIB_INSTALLED'] = 1
78                if incdir: env['CPPPATH'].remove(incdir) # not needed for now
79                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()
112                          break
113                  conf.Finish()
114 +
115 + # vi: set ts=4 sw=4 :
116  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines