1 | # |
---|
2 | # RTEMS Tools Project (http://www.rtems.org/) |
---|
3 | # Copyright 2010-2012 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 | # RTEMS Tools is free software: you can redistribute it and/or modify |
---|
9 | # it under the terms of the GNU General Public License as published by |
---|
10 | # the Free Software Foundation, either version 3 of the License, or |
---|
11 | # (at your option) any later version. |
---|
12 | # |
---|
13 | # RTEMS Tools is distributed in the hope that it will be useful, |
---|
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | # GNU General Public License for more details. |
---|
17 | # |
---|
18 | # You should have received a copy of the GNU General Public License |
---|
19 | # along with RTEMS Tools. If not, see <http://www.gnu.org/licenses/>. |
---|
20 | # |
---|
21 | |
---|
22 | # |
---|
23 | # Windows specific support and overrides. |
---|
24 | # |
---|
25 | |
---|
26 | import pprint |
---|
27 | import os |
---|
28 | |
---|
29 | import execute |
---|
30 | |
---|
31 | def load(): |
---|
32 | uname = 'win32' |
---|
33 | if os.environ.has_key('NUMBER_OF_PROCESSORS'): |
---|
34 | ncpus = int(os.environ['NUMBER_OF_PROCESSORS']) |
---|
35 | else: |
---|
36 | ncpus = 0 |
---|
37 | if ncpus > 1: |
---|
38 | smp_mflags = '-j' + str(ncpus) |
---|
39 | else: |
---|
40 | smp_mflags = '' |
---|
41 | if os.environ.has_key('HOSTTYPE'): |
---|
42 | hosttype = os.environ['HOSTTYPE'] |
---|
43 | else: |
---|
44 | hosttype = 'i686' |
---|
45 | system = 'mingw32' |
---|
46 | defines = { |
---|
47 | '_os': 'win32', |
---|
48 | '_host': hosttype + '-pc-' + system, |
---|
49 | '_host_vendor': 'microsoft', |
---|
50 | '_host_os': 'win32', |
---|
51 | '_host_cpu': hosttype, |
---|
52 | '_host_alias': '%{nil}', |
---|
53 | '_host_arch': hosttype, |
---|
54 | '_usr': '/opt/local', |
---|
55 | '_var': '/opt/local/var', |
---|
56 | 'optflags': '-O2 -fasynchronous-unwind-tables', |
---|
57 | '_smp_mflags': smp_mflags, |
---|
58 | '__sh': 'sh', |
---|
59 | '_buildshell': '%{__sh}', |
---|
60 | '___setup_shell': '%{__sh}' |
---|
61 | } |
---|
62 | return defines |
---|
63 | |
---|
64 | if __name__ == '__main__': |
---|
65 | pprint.pprint(load()) |
---|