10 |
|
_platdir = 'platform' |
11 |
|
|
12 |
|
|
13 |
< |
def read_plat(env, args, fn): |
13 |
> |
def read_plat(env, fn): |
14 |
|
envdict = env.Dictionary().copy() |
15 |
|
# can't feed ConfigParser the original dict, because it also |
16 |
|
# contains non-string values. |
94 |
|
nl.append(ss) |
95 |
|
return ''.join(nl) |
96 |
|
|
97 |
< |
def load_plat(env, args, arch=None): |
97 |
> |
def load_plat(env): |
98 |
|
memmodel, binformat = platform.architecture() |
99 |
+ |
# XXX env['TARGET_ARCH'] --> memmodel |
100 |
|
platsys = platform.system() |
101 |
|
print('Detected platform "%s" (%s).' % (platsys, memmodel)) |
102 |
|
cfgname = platsys + '_' + memmodel[:2] |
108 |
|
cust_pfn = os.path.join(_platdir, cfgname + '_custom.cfg') |
109 |
|
if os.path.isfile(cust_pfn): |
110 |
|
print('Reading configuration "%s"' % cust_pfn) |
111 |
< |
read_plat(env, args, cust_pfn) |
111 |
> |
read_plat(env, cust_pfn) |
112 |
|
return 1 |
113 |
|
pfn = os.path.join(_platdir, cfgname + '.cfg') |
114 |
|
if os.path.isfile(pfn): |
115 |
|
print('Reading configuration "%s"' % pfn) |
116 |
< |
read_plat(env, args, pfn) |
116 |
> |
read_plat(env, pfn) |
117 |
|
return 1 |
118 |
|
|
119 |
|
if os.name == 'posix': |
121 |
|
if os.path.isfile(pfn): |
122 |
|
print('No platform specific configuration found.\n') |
123 |
|
print('Reading generic configuration "%s".' % pfn) |
124 |
< |
read_plat(env, args, pfn) |
124 |
> |
read_plat(env, pfn) |
125 |
|
return 1 |
126 |
|
|
127 |
|
print('Platform "%s", system "%s" not supported yet' |