--- ray/src/hd/SConscript 2005/09/19 12:37:46 1.5 +++ ray/src/hd/SConscript 2016/03/10 21:43:23 1.10 @@ -5,40 +5,39 @@ Import('env') # math libs mlib = env['RAD_MLIB'] +# compose paths +def radbin(name): return os.path.join('$RAD_BUILDBIN', name) +def radlib(name): return os.path.join('$RAD_BUILDLIB', name) + # common objects viewbeams = env.Object(source='viewbeams.c') holo = env.Object(source='holo.c') holofile = env.Object(source='holofile.c') clumpbeams = env.Object(source='clumpbeams.c') -Version = env.Object(source='../rt/Version.c') # XXX ../rt/not_nice - # standard targets PROGS = ( ('rholo', Split('''rholo.c rholo2.c rholo2l.c rholo3.c rholo4.c''') - + [Version, holofile, holo, viewbeams], - ['rtpic','rtio','rtproc','rtpath','rtargs','rtmath','rtmem','rterror']), -('rhpict', Split('rhpict.c rhpict2.c')+[Version, holofile, holo, viewbeams], - ['rtpic','rtio','rtproc','rtargs','rtmath','rtmem','rterror']), -('rhcopy', Split('rhcopy.c') + [clumpbeams, holofile, holo], - ['rtpic','rtio','rtproc','rtargs','rtmath','rtmem','rterror']), -('rhinfo', Split('rhinfo.c') + [holofile, holo], - ['rtio','rtproc', 'rtmath','rterror']), -('rhoptimize', Split('rhoptimize.c') + [clumpbeams, holofile, holo], - ['rtio','rtproc', 'rtmath','rterror']), -('genrhgrid', Split('genrhgrid.c') + [holofile, holo], - ['rtio','rtmath','rtproc','rterror']), + + [env.version, holofile, holo, viewbeams], ['rtrad'],0), +('rhpict', Split('rhpict.c rhpict2.c')+[env.version, holofile, holo, viewbeams], + ['rtrad'],1), +('rhcopy', Split('rhcopy.c') + [clumpbeams, holofile, holo], ['rtrad'],1), +('rhinfo', Split('rhinfo.c') + [holofile, holo], ['rtrad'],1), +('rhoptimize', Split('rhoptimize.c') + [clumpbeams,holofile,holo], ['rtrad'],1), +('genrhgrid', Split('genrhgrid.c') + [holofile, holo], ['rtrad'],1), ) -if os.name != 'nt': # pending some major work... +if 1: for p in PROGS: - prog = env.Program(target=os.path.join(env['RAD_BUILDBIN'], p[0]), + print(p[0]) + if not p[3] and os.name == 'nt': continue + prog = env.Program(target=radbin(p[0]), source=p[1], LIBS=p[2] + mlib) Default(prog) env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)]) # display drivers if env.has_key('X11INCLUDE'): - xenv = env.Copy(CPPPATH=[env['X11INCLUDE']] + env['CPPPATH'], + xenv = env.Clone(CPPPATH=[env['X11INCLUDE']] + env['CPPPATH'], LIBPATH=[env['X11LIB']] + env['LIBPATH'],) # common objects rhdisp = xenv.Object(source='rhdisp.c') @@ -53,15 +52,15 @@ if env.has_key('X11INCLUDE'): # XXX the .hdi extension will cause problems on Windows xenv['PROGSUFFIX'] = '.hdi' - dlibs = ['rtpic','rtio','rtmath','rtcont','rtmem','rtargs','rterror'] + dlibs = ['rtrad', 'rtdummy'] def make_hdi(p): # build them obj = xenv.Object(target=p[3], source=p[4], CPPFLAGS=ocppflags + p[5]) - prog = xenv.Program(target=os.path.join(devdir, p[0]), + prog = xenv.Program(target=radbin(p[0]), source=[obj] + p[1] + xcommon, LIBS=p[2]) Default(prog) inst = xenv.Install(idevdir, prog) # XXX what are the alternative "h" names good for? - insth = xenv.InstallAs(target=os.path.join(idevdir, + insth = xenv.InstallAs(target=radbin( p[0] + 'h' + xenv['PROGSUFFIX']), source=prog) env.Append(RAD_BININSTALL=[inst, insth]) @@ -74,7 +73,7 @@ if env.has_key('X11INCLUDE'): make_hdi(p) if env.has_key('OGL'): - rgllibs = ['rgl','rtscene','rtpath'] + rgllibs = ['rgl','rtrad'] ogl_common_s = Split('rhd_odraw.c rhd_geom.c') ogl_common = map(lambda s:xenv.Object(source=s), ogl_common_s) rhdobj = xenv.Object(source='rhdobj.c') @@ -92,7 +91,7 @@ if env.has_key('X11INCLUDE'): # ogloh ('oglo', [rhdobj] + ogl_common, - rgllibs+['rtproc']+dlibs+['GLU','GL','X11'] + mlib, + rgllibs+['rtrad']+dlibs+['GLU','GL','X11'] + mlib, 'rhd_oglo', 'rhd_ogl.c', ['-DDOBJ', '-DNOSTEREO']), ) for p in GLHDI: @@ -115,3 +114,4 @@ if env.has_key('X11INCLUDE'): +# vim: set syntax=python: