Exemplo n.º 1
0
def find_gl(env):
	# Check for libGL, set flag
	dl = [(None,None)] # standard search path
	if env.has_key('X11INCLUDE'): # sometimes found there (Darwin)
		dl.append((env['X11INCLUDE'], env['X11LIB']))
	for incdir, libdir in dl:
		if incdir: env.Prepend(CPPPATH=[incdir]) # add temporarily
		if libdir: env.Prepend(LIBPATH=[libdir])
		conf = SConf(env)
		if (conf.CheckLib('GL')
				or conf.CheckLib('opengl32')
				or conf.CheckCHeader('OpenGL/gl.h')
				or conf.CheckCHeader('GL/gl.h')):
			env['OGL'] = 1
		if os.name == 'nt':
			if (conf.CheckLib('GLU') # for winrview
					or conf.CheckLib('glu32')
					or conf.CheckCHeader('OpenGL/glu.h')):
				env['GLU'] = 1
		if incdir: env['CPPPATH'].remove(incdir) # not needed for now
		if libdir: env['LIBPATH'].remove(libdir)
		if env.has_key('OGL'):
			if incdir: env.Replace(OGLINCLUDE=[incdir])
			if env.has_key('GLU'):
				if incdir: env.Replace(GLUINCLUDE=[incdir])
			#if libdir: env.Replace(OGLLIB=[libdir])
			conf.Finish()
			break
		conf.Finish()
Exemplo n.º 2
0
def find_libtiff(env):
    # Check for libtiff, set flag and include/lib directories
    dl = [
        (None, None),
    ]  # standard search path
    cfgi = env.get('TIFFINCLUDE')
    cfgl = env.get('TIFFLIB')
    if cfgi or cfgl:
        dl.insert(0, (cfgi, cfgl))
    for incdir, libdir in dl:
        if incdir: env.Prepend(CPPPATH=[incdir])  # add temporarily
        if libdir: env.Prepend(LIBPATH=[libdir])
        conf = SConf(env)
        if conf.CheckLib('tiff',
                         'TIFFInitSGILog',
                         header='void TIFFInitSGILog(void);',
                         autoadd=0):
            env['TIFFLIB_INSTALLED'] = 1
        if incdir: env['CPPPATH'].remove(incdir)  # not needed for now
        if libdir: env['LIBPATH'].remove(libdir)
        if env.has_key('TIFFLIB_INSTALLED'):
            if incdir: env.Replace(RAD_TIFFINCLUDE=[incdir])
            if libdir: env.Replace(RAD_TIFFLIB=[libdir])
            conf.Finish()
            break
        conf.Finish()
Exemplo n.º 3
0
def find_libtiff(env):
	# Check for libtiff, set flag and include/lib directories
	dl = [ (None,None), ] # standard search path
	cfgi = env.get('TIFFINCLUDE')
	cfgl = env.get('TIFFLIB')
	if cfgi or cfgl:
		dl.insert(0,(cfgi, cfgl))
	for incdir, libdir in dl:
		xenv = env.Clone()
		if incdir: xenv.Prepend(CPPPATH=[incdir]) # add temporarily
		if libdir:
			xenv.Prepend(LIBPATH=[libdir])
			xenv.Prepend(PATH=[libdir])
		conf = SConf(xenv)
		libname = 'tiff'
		if os.name == 'nt':
			xenv['INCPREFIX'] = '/I ' # Bug in SCons (uses '/I')
			libname = 'libtiff'
		if conf.CheckLib(libname, 'TIFFInitSGILog',
				header='''#include "tiff.h"''', autoadd=0):
			env['TIFFLIB_INSTALLED'] = 1
		if env.has_key('TIFFLIB_INSTALLED'):
			env.Replace(RAD_LIBTIFF=libname)
			if incdir: env.Replace(RAD_TIFFINCLUDE=[incdir])
			if libdir: env.Replace(RAD_TIFFLIB=[libdir])
			conf.Finish()
			break
		conf.Finish()