ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/SConscript
Revision: 1.11
Committed: Wed Sep 14 09:28:35 2005 UTC (18 years, 7 months ago) by schorsch
Branch: MAIN
Changes since 1.10: +2 -1 lines
Log Message:
SCons: Removed getpagesize.c from RAD_COMPAT, added RAD_SOCKETLIB.

File Contents

# User Rev Content
1 schorsch 1.1 import os
2    
3     Import('env') # inherit from parent
4    
5 schorsch 1.7 mlib = ['$RAD_MLIB']
6     progs = []
7 schorsch 1.1
8     # compose paths
9 schorsch 1.7 def radbin(name): return os.path.join('$RAD_BUILDBIN', name)
10     def radlib(name): return os.path.join('$RAD_BUILDLIB', name)
11 schorsch 1.1
12 schorsch 1.5 Version = env.Object(source='../rt/Version.c') # XXX ../rt/not_nice
13 schorsch 1.2
14 schorsch 1.1 # standard targets
15     PROGS = [
16 schorsch 1.10 ('findglare', Split('findglare.c glareval.c glaresrc.c setscan.c'),
17 schorsch 1.2 ['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem','rterror']),
18     ('glarendx', Split('glarendx.c'), ['rtpic','rtio','rtargs','rtmath']),
19     ('vwright', Split('vwright.c'), ['rtpic','rtio','rtargs','rtmath']),
20     ('vwrays', Split('vwrays.c'), ['rtpic','rtio','rtargs','rtmath']),
21     ('rad', Split('rad.c'),
22     ['rtpic','rtproc','rtpath','rtio','rtmath','rtargs','rtcont','rtmem','rterror']),
23 schorsch 1.5 ('rpiece', Split('rpiece.c') + [Version],
24 schorsch 1.2 ['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem']),
25 schorsch 1.1 ]
26 schorsch 1.2 if os.name == 'nt': # XXX should be set in a *.cfg file
27     netproc = 'win_netproc.c'
28     netlib = ['ws2_32']
29     else:
30     netproc = 'netproc.c'
31     netlib = []
32    
33     PROGS.append(('ranimate', ['ranimate.c', netproc],
34 schorsch 1.11 ['rtpic','rtargs','rtio','rtcont','rtmem','rtpath','rtmath',
35     'rtnet','$RAD_SOCKETLIB','rterror'] + netlib))
36 schorsch 1.1 for p in PROGS:
37 schorsch 1.2 prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib)
38 schorsch 1.7 progs.append(prog)
39 schorsch 1.1
40 schorsch 1.2 if os.name != 'nt': # XXX pending Windows version of raypcalls.c
41 schorsch 1.1 # targets with different includes/libs
42     rs = Split('ranimove.c ranimove1.c ranimove2.c')
43 schorsch 1.2 ranimove = env.Program(target=radbin('ranimove'), source=rs,
44     CPPPATH=env.get('CPPPATH', [])+ ['#src/rt'],
45     LIBS=['raycalls','rttrace','rtscene','rtpic','rtfunc','rtio',
46     'rtmath','rtcont','rtmem','rtargs','rtproc','rtpath','rterror'] + mlib)
47 schorsch 1.7 progs.append(ranimove)
48 schorsch 1.1
49 schorsch 1.2 getinfo = env.Program(target=radbin('getinfo'), source='getinfo.c',
50     LIBS=['rtio'])
51 schorsch 1.7 progs.append(getinfo)
52 schorsch 1.1
53    
54     # X11 targets
55 schorsch 1.2 if env.has_key('X11LIB'):
56 schorsch 1.7 xincl = env.get('CPPPATH', []) + ['$X11INCLUDE']
57     xlibp = env.get('LIBPATH', []) + ['$X11LIB']
58 schorsch 1.6 x11findwind = env.Object(source='../common/x11findwind.c', # XXX ../not/nice
59     CPPPATH=xincl)
60 schorsch 1.2 xglaresrc = env.Program(target=radbin('xglaresrc'),
61 schorsch 1.5 source=Split('xglaresrc.c') + [x11findwind],
62 schorsch 1.2 LIBPATH=xlibp, CPPPATH=xincl,
63     LIBS=['rtpic','rtmath','rtargs','rtio','X11']+ mlib)
64 schorsch 1.7 progs.append(xglaresrc)
65 schorsch 1.2
66     # OpenGL targets that also depend on X11
67     if env.has_key('OGL'):
68     glrad = env.Program(target=radbin('glrad'), source=Split('glrad.c'),
69 schorsch 1.7 CPPFLAGS=env.get('CPPFLAGS', []) + ['$RAD_STEREO'],
70 schorsch 1.2 LIBPATH=xlibp, CPPPATH=xincl,
71     LIBS=['rgl','rtpic','rtscene','rtio','rtproc','rtpath','rtargs',
72     'rtmath','rtcont','rtmem','rterror',
73     'GL', 'GLU','X11'],)
74 schorsch 1.7 progs.append(glrad)
75 schorsch 1.1
76 schorsch 1.7 if os.name == 'posix': # XXX ignoring trad.wsh
77     for s in Split('''objview objline objpict
78     glare dayfact debugcal rlux raddepend compamb vinfo genambpos'''):
79     Default(env.InstallCsh(radbin(s), s + '.csh'))
80 schorsch 1.8 # Those don't really work yet
81     #else:
82     # for s in Split('''objview glare rlux '''):
83     # prog = env.Program(target=radbin(s), source=s+'.c')
84     # progs.append(prog)
85 schorsch 1.7
86     Default('#src/util')
87     env.Install('$RAD_BINDIR', progs)
88 schorsch 1.1