ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/SConscript
Revision: 1.2
Committed: Mon Oct 27 10:35:43 2003 UTC (20 years, 5 months ago) by schorsch
Branch: MAIN
Changes since 1.1: +62 -45 lines
Log Message:
Experimental SCons update: Debug builds, split libraries, more Windows targets.

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     ('glarendx', Split('glarendx.c'), ['rtpic','rtio','rtargs','rtmath']),
18     ('vwright', Split('vwright.c'), ['rtpic','rtio','rtargs','rtmath']),
19     ('vwrays', Split('vwrays.c'), ['rtpic','rtio','rtargs','rtmath']),
20     ('rad', Split('rad.c'),
21     ['rtpic','rtproc','rtpath','rtio','rtmath','rtargs','rtcont','rtmem','rterror']),
22     ('rpiece', Split('rpiece.c Version.c'),
23     ['rtpic','rtargs','rtio','rtproc','rtmath','rtpath','rtmem']),
24 schorsch 1.1 ]
25 schorsch 1.2 if os.name == 'nt': # XXX should be set in a *.cfg file
26     netproc = 'win_netproc.c'
27     netlib = ['ws2_32']
28     else:
29     netproc = 'netproc.c'
30     netlib = []
31    
32     PROGS.append(('ranimate', ['ranimate.c', netproc],
33     ['rtpic','rtargs','rtio','rtcont','rtmem','rtpath','rtmath','rtnet','rterror'] + netlib))
34 schorsch 1.1 for p in PROGS:
35 schorsch 1.2 prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2]+mlib)
36     Default(prog)
37     env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)])
38 schorsch 1.1
39 schorsch 1.2 if os.name != 'nt': # XXX pending Windows version of raypcalls.c
40 schorsch 1.1 # targets with different includes/libs
41     rs = Split('ranimove.c ranimove1.c ranimove2.c')
42 schorsch 1.2 ranimove = env.Program(target=radbin('ranimove'), source=rs,
43     CPPPATH=env.get('CPPPATH', [])+ ['#src/rt'],
44     LIBS=['raycalls','rttrace','rtscene','rtpic','rtfunc','rtio',
45     'rtmath','rtcont','rtmem','rtargs','rtproc','rtpath','rterror'] + mlib)
46 schorsch 1.1 Default(ranimove)
47 schorsch 1.2 env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], ranimove)])
48 schorsch 1.1
49 schorsch 1.2 getinfo = env.Program(target=radbin('getinfo'), source='getinfo.c',
50     LIBS=['rtio'])
51 schorsch 1.1 Default(getinfo)
52 schorsch 1.2 env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], getinfo)])
53 schorsch 1.1
54     # special targets not normally built
55 schorsch 1.2 if os.name != 'nt': # XXX pending replacement of fork() and friends
56     scanner = env.Program(target=radbin('scanner'), source='scanner.c',
57     LIBS=mlib)
58     scanner_i = env.Install(env['RAD_BINDIR'], scanner)
59     makedist = env.Program(target=radbin('makedist'),
60     source=Split('makedist.c')+[setscan])
61     makedist_i = env.Install(env['RAD_BINDIR'], makedist)
62     env.Alias('util_special', [scanner, makedist])
63     env.Alias('util_special_install', [scanner_i, makedist_i])
64 schorsch 1.1
65     # X11 targets
66 schorsch 1.2 if env.has_key('X11LIB'):
67     xlibp = env.get('LIBPATH',[]) + [env['X11LIB']]
68     xincl = env.get('CPPPATH',[]) + [env['X11INCLUDE']]
69     xglaresrc = env.Program(target=radbin('xglaresrc'),
70     source=Split('xglaresrc.c x11findwind.c'),
71     LIBPATH=xlibp, CPPPATH=xincl,
72     LIBS=['rtpic','rtmath','rtargs','rtio','X11']+ mlib)
73     Default(xglaresrc)
74     env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], xglaresrc)])
75    
76     # OpenGL targets that also depend on X11
77     if env.has_key('OGL'):
78     glrad = env.Program(target=radbin('glrad'), source=Split('glrad.c'),
79     CPPFLAGS=env.get('CPPFLAGS', []) + [env['RAD_STEREO']],
80     LIBPATH=xlibp, CPPPATH=xincl,
81     LIBS=['rgl','rtpic','rtscene','rtio','rtproc','rtpath','rtargs',
82     'rtmath','rtcont','rtmem','rterror',
83     'GL', 'GLU','X11'],)
84     Default(glrad)
85     env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], glrad)])
86 schorsch 1.1
87