ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/SConscript
Revision: 1.4
Committed: Sun Mar 28 20:33:14 2004 UTC (20 years ago) by schorsch
Branch: MAIN
Changes since 1.3: +2 -1 lines
Log Message:
Continued ANSIfication, and other fixes and clarifications.

File Contents

# User Rev Content
1 schorsch 1.1 import os
2    
3     Import('env') # inherit from parent
4    
5 schorsch 1.2 mlib = env['RAD_MLIB']
6 schorsch 1.1
7     # compose paths
8     def radbin(name): return os.path.join(env['RAD_BUILDBIN'], name)
9     def radlib(name): return os.path.join(env['RAD_BUILDLIB'], name)
10    
11 schorsch 1.2 setscan = env.Object(source='setscan.c')
12    
13 schorsch 1.1 # standard targets
14     PROGS = [
15 schorsch 1.2 ('findglare', Split('findglare.c glareval.c glaresrc.c')+[setscan],
16     ['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem','rterror']),
17 schorsch 1.3 #('contour', Split('contour.c'), ['rtmath']), # XXX what is this?
18 schorsch 1.2 ('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     ('rpiece', Split('rpiece.c Version.c'),
24     ['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     ['rtpic','rtargs','rtio','rtcont','rtmem','rtpath','rtmath','rtnet','rterror'] + netlib))
35 schorsch 1.1 for p in PROGS:
36 schorsch 1.2 prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib)
37     Default(prog)
38     env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], 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.1 Default(ranimove)
48 schorsch 1.2 env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ranimove)])
49 schorsch 1.1
50 schorsch 1.2 getinfo = env.Program(target=radbin('getinfo'), source='getinfo.c',
51     LIBS=['rtio'])
52 schorsch 1.1 Default(getinfo)
53 schorsch 1.2 env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], getinfo)])
54 schorsch 1.1
55     # special targets not normally built
56 schorsch 1.2 if os.name != 'nt': # XXX pending replacement of fork() and friends
57     scanner = env.Program(target=radbin('scanner'), source='scanner.c',
58     LIBS=mlib)
59     scanner_i = env.Install(env['RAD_BINDIR'], scanner)
60     makedist = env.Program(target=radbin('makedist'),
61 schorsch 1.4 source=Split('makedist.c')+[setscan],
62     LIBS=['rtmath']+mlib)
63 schorsch 1.2 makedist_i = env.Install(env['RAD_BINDIR'], makedist)
64     env.Alias('util_special', [scanner, makedist])
65     env.Alias('util_special_install', [scanner_i, makedist_i])
66 schorsch 1.1
67     # X11 targets
68 schorsch 1.2 if env.has_key('X11LIB'):
69     xlibp = env.get('LIBPATH',[]) + [env['X11LIB']]
70     xincl = env.get('CPPPATH',[]) + [env['X11INCLUDE']]
71     xglaresrc = env.Program(target=radbin('xglaresrc'),
72     source=Split('xglaresrc.c x11findwind.c'),
73     LIBPATH=xlibp, CPPPATH=xincl,
74     LIBS=['rtpic','rtmath','rtargs','rtio','X11']+ mlib)
75     Default(xglaresrc)
76     env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], xglaresrc)])
77    
78     # OpenGL targets that also depend on X11
79     if env.has_key('OGL'):
80     glrad = env.Program(target=radbin('glrad'), source=Split('glrad.c'),
81     CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']],
82     LIBPATH=xlibp, CPPPATH=xincl,
83     LIBS=['rgl','rtpic','rtscene','rtio','rtproc','rtpath','rtargs',
84     'rtmath','rtcont','rtmem','rterror',
85     'GL', 'GLU','X11'],)
86     Default(glrad)
87     env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], glrad)])
88 schorsch 1.1
89