OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 3 # Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 import utils | 9 import utils |
10 import subprocess | 10 import subprocess |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 os.execv(gcc_arm_embedded_bin, args) | 77 os.execv(gcc_arm_embedded_bin, args) |
78 | 78 |
79 def invoke_gcc_local(args): | 79 def invoke_gcc_local(args): |
80 if which("arm-eabi-g++") is not None: | 80 if which("arm-eabi-g++") is not None: |
81 args.insert(0, "arm-eabi-g++") | 81 args.insert(0, "arm-eabi-g++") |
82 os.execvp("arm-eabi-g++", args) | 82 os.execvp("arm-eabi-g++", args) |
83 else: | 83 else: |
84 args.insert(0, "arm-none-eabi-g++") | 84 args.insert(0, "arm-none-eabi-g++") |
85 os.execvp("arm-none-eabi-g++", args) | 85 os.execvp("arm-none-eabi-g++", args) |
86 | 86 |
| 87 def invoke_gcc_mips(args): |
| 88 args.insert(0, "mips-mti-linux-gnu-g++") |
| 89 os.execvp("mips-mti-linux-gnu-g++", args) |
| 90 |
87 def main(): | 91 def main(): |
88 args = sys.argv[1:] | 92 args = sys.argv[1:] |
89 if "-L/DARTINO_ASAN" in args: | 93 if "-L/DARTINO_ASAN" in args: |
90 args.remove("-L/DARTINO_ASAN") | 94 args.remove("-L/DARTINO_ASAN") |
91 args.insert(0, '-fsanitize=address') | 95 args.insert(0, '-fsanitize=address') |
92 if "-L/DARTINO_CLANG" in args: | 96 if "-L/DARTINO_CLANG" in args: |
93 args.insert(0, '-fsanitize-undefined-trap-on-error') | 97 args.insert(0, '-fsanitize-undefined-trap-on-error') |
94 if "-DDARTINO_CLANG" in args: | 98 if "-DDARTINO_CLANG" in args: |
95 invoke_clang(args) | 99 invoke_clang(args) |
96 elif "-L/DARTINO_CLANG" in args: | 100 elif "-L/DARTINO_CLANG" in args: |
(...skipping 17 matching lines...) Expand all Loading... |
114 elif "-DGCC_XARM_EMBEDDED" in args: | 118 elif "-DGCC_XARM_EMBEDDED" in args: |
115 invoke_gcc_arm_embedded(args) | 119 invoke_gcc_arm_embedded(args) |
116 elif "-L/GCC_XARM_EMBEDDED" in args: | 120 elif "-L/GCC_XARM_EMBEDDED" in args: |
117 args.remove("-L/GCC_XARM_EMBEDDED") | 121 args.remove("-L/GCC_XARM_EMBEDDED") |
118 invoke_gcc_arm_embedded(args) | 122 invoke_gcc_arm_embedded(args) |
119 elif "-DGCC_XARM_LOCAL" in args: | 123 elif "-DGCC_XARM_LOCAL" in args: |
120 invoke_gcc_local(args) | 124 invoke_gcc_local(args) |
121 elif "-L/GCC_XARM_LOCAL" in args: | 125 elif "-L/GCC_XARM_LOCAL" in args: |
122 args.remove("-L/GCC_XARM_LOCAL") | 126 args.remove("-L/GCC_XARM_LOCAL") |
123 invoke_gcc_local(args) | 127 invoke_gcc_local(args) |
| 128 elif "-DDARTINO_MIPS" in args: |
| 129 invoke_gcc_mips(args) |
| 130 elif "-L/DARTINO_MIPS" in args: |
| 131 args.remove("-L/DARTINO_MIPS") |
| 132 invoke_gcc_mips(args) |
124 else: | 133 else: |
125 invoke_gcc(args) | 134 invoke_gcc(args) |
126 | 135 |
127 if __name__ == '__main__': | 136 if __name__ == '__main__': |
128 main() | 137 main() |
OLD | NEW |