[bf13d27] | 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 | # 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': 'win32', |
---|
| 46 | '_host': hosttype + '-pc-' + system, |
---|
| 47 | '_host_vendor': 'microsoft', |
---|
| 48 | '_host_os': 'win32', |
---|
| 49 | '_host_cpu': hosttype, |
---|
| 50 | '_host_alias': '%{nil}', |
---|
| 51 | '_host_arch': hosttype, |
---|
| 52 | '_usr': '/opt/local', |
---|
| 53 | '_var': '/opt/local/var', |
---|
| 54 | 'optflags': '-O2 -fasynchronous-unwind-tables', |
---|
| 55 | '_smp_mflags': smp_mflags, |
---|
| 56 | '__sh': 'sh', |
---|
| 57 | '_buildshell': '%{__sh}', |
---|
| 58 | '___setup_shell': '%{__sh}', |
---|
| 59 | # Build flags |
---|
| 60 | 'optflags': '-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields' |
---|
| 61 | } |
---|
| 62 | Return defines |
---|
| 63 | |
---|
| 64 | if __name__ == '__main__': |
---|
| 65 | pprint.pprint(load()) |
---|