Back to index

radiance  4R0+20100331
Functions
build_utils.find_libs Namespace Reference

Functions

def find_radlib
def find_x11
def find_gl
def find_libtiff

Function Documentation

Definition at line 38 of file find_libs.py.

00038 
00039 def find_gl(env):
00040        # Check for libGL, set flag
00041        dl = [(None,None)] # standard search path
00042        if env.has_key('X11INCLUDE'): # sometimes found there (Darwin)
00043               dl.append((env['X11INCLUDE'], env['X11LIB']))
00044        for incdir, libdir in dl:
00045               if incdir: env.Prepend(CPPPATH=[incdir]) # add temporarily
00046               if libdir: env.Prepend(LIBPATH=[libdir])
00047               conf = SConf(env)
00048               if conf.CheckLibWithHeader('GL', 'GL/gl.h', 'C', autoadd=0):
00049                      env['OGL'] = 1
00050               if incdir: env['CPPPATH'].remove(incdir) # not needed for now
00051               if libdir: env['LIBPATH'].remove(libdir)
00052               if env.has_key('OGL'):
00053                      if incdir: env.Replace(OGLINCLUDE=[incdir])
00054                      #if libdir: env.Replace(OGLLIB=[libdir])
00055                      conf.Finish()
00056                      break
00057               conf.Finish()
00058 

Definition at line 59 of file find_libs.py.

00059 
00060 def find_libtiff(env):
00061        # Check for libtiff, set flag and include/lib directories
00062        dl = [ (None,None), ] # standard search path
00063        cfgi = env.get('TIFFINCLUDE')
00064        cfgl = env.get('TIFFLIB')
00065        if cfgi or cfgl:
00066               dl.insert(0,(cfgi, cfgl))
00067        for incdir, libdir in dl:
00068               if incdir: env.Prepend(CPPPATH=[incdir]) # add temporarily
00069               if libdir: env.Prepend(LIBPATH=[libdir])
00070               conf = SConf(env)
00071               if conf.CheckLib('tiff', 'TIFFInitSGILog',
00072                             header='void TIFFInitSGILog(void);', autoadd=0):
00073                      env['TIFFLIB_INSTALLED'] = 1
00074               if incdir: env['CPPPATH'].remove(incdir) # not needed for now
00075               if libdir: env['LIBPATH'].remove(libdir)
00076               if env.has_key('TIFFLIB_INSTALLED'):
00077                      if incdir: env.Replace(RAD_TIFFINCLUDE=[incdir])
00078                      if libdir: env.Replace(RAD_TIFFLIB=[libdir])
00079                      conf.Finish()
00080                      break
00081               conf.Finish()
00082 

Definition at line 5 of file find_libs.py.

00005 
00006 def find_radlib(env):
00007        v = env.FindFile('Verdana.fnt', './lib')
00008        if not v:
00009               print '''
00010        Radiance auxiliary support files not found.
00011        -> Download from radiance-online.org and extract.
00012        '''
00013               env.Exit()

Definition at line 14 of file find_libs.py.

00014 
00015 def find_x11(env):
00016        # Search for libX11, remember the X11 library and include dirs
00017        for d in ('/usr/X11R6', '/usr/X11', '/usr/openwin'):
00018               if os.path.isdir (d):
00019                      incdir = os.path.join(d, 'include')
00020                      libdir = os.path.join(d, 'lib')
00021                      env.Prepend(CPPPATH=[incdir]) # add temporarily
00022                      env.Prepend(LIBPATH=[libdir]) 
00023                      conf = SConf(env)
00024                      if conf.CheckLibWithHeader('X11', 'X11/X.h', 'C', autoadd=0):
00025                             env.Replace(X11INCLUDE=incdir)
00026                             env.Replace(X11LIB=libdir)
00027                      env['CPPPATH'].remove(incdir) # not needed for now
00028                      env['LIBPATH'].remove(libdir)
00029                      if env['X11INCLUDE']:
00030                             # Check for SGI stereo extension
00031                             if conf.CheckCHeader('X11/extensions/SGIStereo.h'):
00032                                    env['RAD_STEREO'] = '-DSTEREO'
00033                             else: env['RAD_STEREO'] = '-DNOSTEREO'
00034                             env = conf.Finish ()
00035                             break
00036                      env = conf.Finish ()
00037