1 |
schorsch |
1.1 |
import os |
2 |
|
|
|
3 |
|
|
from SCons.SConf import SConf # aka Configure |
4 |
|
|
|
5 |
|
|
def find_x11(env): |
6 |
|
|
# Search for libX11, remember the X11 library and include dirs |
7 |
|
|
for d in ('/usr/X11R6', '/usr/X11', '/usr/openwin'): |
8 |
|
|
if os.path.isdir (d): |
9 |
|
|
incdir = os.path.join(d, 'include') |
10 |
|
|
libdir = os.path.join(d, 'lib') |
11 |
|
|
env.Append(CPPPATH=[incdir]) # add temporarily |
12 |
|
|
env.Append(LIBPATH=[libdir]) |
13 |
|
|
conf = SConf(env) |
14 |
|
|
if conf.CheckLibWithHeader('X11', 'X11/X.h', 'C', autoadd=0): |
15 |
|
|
env.Replace(X11INCLUDE=incdir) |
16 |
|
|
env.Replace(X11LIB=libdir) |
17 |
|
|
env['CPPPATH'].remove(incdir) # not needed for now |
18 |
|
|
env['LIBPATH'].remove(libdir) |
19 |
|
|
if env['X11INCLUDE']: |
20 |
|
|
# Check for SGI stereo extension |
21 |
|
|
if conf.CheckCHeader('X11/extensions/SGIStereo.h'): |
22 |
|
|
env['RAD_STEREO'] = '-DSTEREO' |
23 |
|
|
else: env['RAD_STEREO'] = '-DNOSTEREO' |
24 |
|
|
env = conf.Finish () |
25 |
|
|
break |
26 |
|
|
env = conf.Finish () |
27 |
|
|
|
28 |
|
|
def find_gl(env): |
29 |
|
|
# Check for libGL, set flag |
30 |
|
|
conf = SConf(env) |
31 |
|
|
if conf.CheckLibWithHeader('GL', 'GL/gl.h', 'C', autoadd=0): |
32 |
|
|
env['OGL'] = 1 |
33 |
schorsch |
1.2 |
elif env.has_key('X11INCLUDE'): # sometimes found there |
34 |
|
|
incdir = env['X11INCLUDE'] |
35 |
|
|
libdir = env['X11LIB'] |
36 |
|
|
env.Append(CPPPATH=[incdir]) # add temporarily |
37 |
|
|
#env.Append(LIBPATH=[libdir]) |
38 |
|
|
if conf.CheckLibWithHeader('GL', 'GL/gl.h', 'C', autoadd=0): |
39 |
|
|
env['OGL'] = 1 |
40 |
|
|
env.Replace(OGLINCLUDE=incdir) |
41 |
|
|
env.Replace(OGLLIB=libdir) |
42 |
|
|
if incdir: env['CPPPATH'].remove(incdir) # not needed for now |
43 |
|
|
#if libdir: env['LIBPATH'].remove(libdir) |
44 |
|
|
conf.Finish() |
45 |
schorsch |
1.1 |
|
46 |
|
|
|
47 |
|
|
|