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 |
schorsch |
1.3 |
|
29 |
schorsch |
1.1 |
def find_gl(env): |
30 |
|
|
# Check for libGL, set flag |
31 |
schorsch |
1.3 |
dl = [(None,None)] # standard search path |
32 |
|
|
if env.has_key('X11INCLUDE'): # sometimes found there (Darwin) |
33 |
|
|
dl.append((env['X11INCLUDE'], env['X11LIB'])) |
34 |
|
|
#if os.name == 'nt': |
35 |
|
|
# dl.append((some win specific dirs)) |
36 |
|
|
#if some other weirdness: |
37 |
|
|
# ... |
38 |
|
|
for incdir, libdir in dl: |
39 |
|
|
if incdir: env.Append(CPPPATH=[incdir]) # add temporarily |
40 |
|
|
if libdir: env.Append(LIBPATH=[libdir]) |
41 |
|
|
conf = SConf(env) |
42 |
schorsch |
1.2 |
if conf.CheckLibWithHeader('GL', 'GL/gl.h', 'C', autoadd=0): |
43 |
|
|
env['OGL'] = 1 |
44 |
|
|
if incdir: env['CPPPATH'].remove(incdir) # not needed for now |
45 |
schorsch |
1.3 |
if libdir: env['LIBPATH'].remove(libdir) |
46 |
|
|
if env.has_key('OGL'): |
47 |
|
|
if incdir: env.Replace(OGLINCLUDE=[incdir]) |
48 |
|
|
#if libdir: env.Replace(OGLLIB=[libdir]) |
49 |
|
|
conf.Finish() |
50 |
|
|
break |
51 |
|
|
conf.Finish() |
52 |
schorsch |
1.1 |
|