ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/build_utils/load_plat.py
(Generate patch)

Comparing ray/build_utils/load_plat.py (file contents):
Revision 1.3 by schorsch, Thu Oct 21 15:47:12 2004 UTC vs.
Revision 1.11 by schorsch, Thu Apr 24 10:28:24 2008 UTC

# Line 1 | Line 1
1  
2   import os
3   import sys
4 import string
4   import ConfigParser
5  
6  
7   _platdir = 'platform'
8  
9  
11 def POSIX_setup(env):
12    # common stuff for all posix systems
13    env['RAD_PROCESS'] = string.split('unix_process.c')
14
15
10   def read_plat(env, args, fn):
11          cfig = ConfigParser.ConfigParser(env.Dictionary())
12          cfig.read(fn)
13          buildvars = [['CC'], # replace
14                          ['CPPPATH', 'CPPDEFINES', 'CPPFLAGS', 'CCFLAGS',
15 <                        'LIBPATH', 'LINKFLAGS']] # append
15 >                        'LIBPATH', 'LINKFLAGS',
16 >                        'EZXML_CPPDEFINES', # build flags specific to ezxml.c
17 >                        ]] # append
18          vars = [
19                  ['install',
20                          ['RAD_BASEDIR', 'RAD_BINDIR', 'RAD_RLIBDIR', 'RAD_MANDIR'],
21                          []],
22                  ['code',
23 <                        ['RAD_SPEED'],
24 <                        ['RAD_COMPAT', 'RAD_MEMCOMPAT', 'RAD_MATHCOMPAT', 'RAD_ARGSCOMPAT',
25 <                        'RAD_MLIB', 'RAD_PROCESS']],
23 >                        [], # replace
24 >                        [   # append
25 >                        'RAD_COMPAT',     # theoretically obsolete (src/common/strcmp.c)
26 >                        'RAD_MATHCOMPAT', # erf.c floating point error function
27 >                        'RAD_ARGSCOMPAT', # fixargv0.c for Windows
28 >                        'RAD_NETCOMPAT',  # [win_]netproc.c for ranimate
29 >                        'RAD_MLIB',       # usually 'm', or any fastlib available
30 >                        'RAD_SOCKETLIB',  # ws_2_32 on Windows (VC links it automatically)
31 >                        'RAD_PROCESS',    # our process abstraction and win_popen()
32 >                        'RAD_PCALLS',     # more custom process abstraction
33 >                        ]],
34          ]
35          if args.get('RAD_DEBUG',0):
36                  vars.insert(0, ['debug'] + buildvars)
37          else: vars.insert(0, ['build'] + buildvars)
38          for section in vars:
39                  if cfig.has_section(section[0]):
40 <                        for p in section[1]:
40 >                        for p in section[1]: # single items to replace
41                                  try: v = cfig.get(section[0], p)
42                                  except ConfigParser.NoOptionError: continue
43                                  env[p] = v
44                                  #print '%s: %s' % (p, env[p])
45 <                        for p in section[2]:
45 >                        for p in section[2]: # multiple items to append
46                                  try: v = cfig.get(section[0], p)
47                                  except ConfigParser.NoOptionError: continue
48 <                                apply(env.Append,[],{p:string.split(v)})
45 <                                #print '%s: %s' % (p, env[p])
48 >                                apply(env.Append,[],{p:env.Split(v)})
49          # XXX Check that basedir exists.
50          for k in ['RAD_BINDIR', 'RAD_RLIBDIR', 'RAD_MANDIR']:
51                  if (env.has_key('RAD_BASEDIR') and env.has_key(k)
# Line 51 | Line 54 | def read_plat(env, args, fn):
54  
55  
56   def load_plat(env, args, platform=None):
54        if os.name == 'posix':
55                POSIX_setup(env)
57          if platform == None: # override
58                  p = sys.platform
59          else: p = platform
60 +        if p == 'win32' and 'gcc' in env['TOOLS']:
61 +                # we don't really want to know this here...
62 +                p = 'mingw'
63          pl = []
64          print 'Detected platform "%s" (%s).' % (sys.platform, os.name)
65          for i in [len(p), -1, -2]:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines