1 | # |
---|
2 | # RTEMS Tools Project (http://www.rtems.org/) |
---|
3 | # Copyright 2010-2013 Chris Johns (chrisj@rtems.org) |
---|
4 | # All rights reserved. |
---|
5 | # |
---|
6 | # This file is part of the RTEMS Tools package in 'rtems-tools'. |
---|
7 | # |
---|
8 | # Permission to use, copy, modify, and/or distribute this software for any |
---|
9 | # purpose with or without fee is hereby granted, provided that the above |
---|
10 | # copyright notice and this permission notice appear in all copies. |
---|
11 | # |
---|
12 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
---|
13 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
---|
14 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
---|
15 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
---|
16 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
---|
17 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
---|
18 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
---|
19 | |
---|
20 | # |
---|
21 | # Windows specific support and overrides. |
---|
22 | # |
---|
23 | |
---|
24 | import pprint |
---|
25 | import os |
---|
26 | |
---|
27 | import execute |
---|
28 | |
---|
29 | def load(): |
---|
30 | uname = 'win32' |
---|
31 | if os.environ.has_key('NUMBER_OF_PROCESSORS'): |
---|
32 | ncpus = int(os.environ['NUMBER_OF_PROCESSORS']) |
---|
33 | else: |
---|
34 | ncpus = 0 |
---|
35 | if ncpus > 1: |
---|
36 | smp_mflags = '-j' + str(ncpus) |
---|
37 | else: |
---|
38 | smp_mflags = '' |
---|
39 | if os.environ.has_key('HOSTTYPE'): |
---|
40 | hosttype = os.environ['HOSTTYPE'] |
---|
41 | else: |
---|
42 | hosttype = 'i686' |
---|
43 | system = 'mingw32' |
---|
44 | defines = { |
---|
45 | '_os': ('none', 'none', 'win32'), |
---|
46 | '_host': ('triplet', 'required', hosttype + '-pc-' + system), |
---|
47 | '_host_vendor': ('none', 'none', 'microsoft'), |
---|
48 | '_host_os': ('none', 'none', 'win32'), |
---|
49 | '_host_cpu': ('none', 'none', hosttype), |
---|
50 | '_host_alias': ('none', 'none', '%{nil}'), |
---|
51 | '_host_arch': ('none', 'none', hosttype), |
---|
52 | '_usr': ('dir', 'optional', '/opt/local'), |
---|
53 | '_var': ('dir', 'optional', '/opt/local/var'), |
---|
54 | '_smp_mflags': ('none', 'none', smp_mflags), |
---|
55 | '__bash': ('exe', 'required', 'bash'), |
---|
56 | '__bzip2': ('exe', 'required', 'bzip2'), |
---|
57 | '__bison': ('exe', 'required', 'bison'), |
---|
58 | '__cat': ('exe', 'required', 'cat'), |
---|
59 | '__cc': ('exe', 'required', 'gcc'), |
---|
60 | '__chgrp': ('exe', 'required', 'chgrp'), |
---|
61 | '__chmod': ('exe', 'required', 'chmod'), |
---|
62 | '__chown': ('exe', 'required', 'chown'), |
---|
63 | '__cp': ('exe', 'required', 'cp'), |
---|
64 | '__cxx': ('exe', 'required', 'g++'), |
---|
65 | '__flex': ('exe', 'required', 'flex'), |
---|
66 | '__grep': ('exe', 'required', 'grep'), |
---|
67 | '__gzip': ('exe', 'required', 'gzip'), |
---|
68 | '__id': ('exe', 'required', 'id'), |
---|
69 | '__install': ('exe', 'required', 'install'), |
---|
70 | '__install_info': ('exe', 'required', 'install-info'), |
---|
71 | '__ld': ('exe', 'required', 'ld'), |
---|
72 | '__ldconfig': ('exe', 'none', ''), |
---|
73 | '__makeinfo': ('exe', 'required', 'makeinfo'), |
---|
74 | '__mkdir': ('exe', 'required', 'mkdir'), |
---|
75 | '__mv': ('exe', 'required', 'mv'), |
---|
76 | '__nm': ('exe', 'required', 'nm'), |
---|
77 | '__nm': ('exe', 'required', 'nm'), |
---|
78 | '__objcopy': ('exe', 'required', 'objcopy'), |
---|
79 | '__objdump': ('exe', 'required', 'objdump'), |
---|
80 | '__patch': ('exe', 'required', 'patch'), |
---|
81 | '__rm': ('exe', 'required', 'rm'), |
---|
82 | '__sed': ('exe', 'required', 'sed'), |
---|
83 | '__sh': ('exe', 'required', 'sh'), |
---|
84 | '__tar': ('exe', 'required', 'bsdtar'), |
---|
85 | '__unzip': ('exe', 'required', 'unzip'), |
---|
86 | '__xz': ('exe', 'required', 'xz'), |
---|
87 | '_buildshell': ('exe', 'required', '%{__sh}'), |
---|
88 | '___setup_shell': ('exe', 'required', '%{__sh}'), |
---|
89 | 'optflags': ('none', 'none', '-O2 -pipe'), |
---|
90 | } |
---|
91 | return defines |
---|
92 | |
---|
93 | if __name__ == '__main__': |
---|
94 | pprint.pprint(load()) |
---|