| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 os.execv(gcc_arm_embedded_bin, args) | 78 os.execv(gcc_arm_embedded_bin, args) |
| 79 | 79 |
| 80 def invoke_gcc_local(args): | 80 def invoke_gcc_local(args): |
| 81 if which("arm-eabi-gcc") is not None: | 81 if which("arm-eabi-gcc") is not None: |
| 82 args.insert(0, "arm-eabi-gcc") | 82 args.insert(0, "arm-eabi-gcc") |
| 83 os.execvp("arm-eabi-gcc", args) | 83 os.execvp("arm-eabi-gcc", args) |
| 84 else: | 84 else: |
| 85 args.insert(0, "arm-none-eabi-gcc") | 85 args.insert(0, "arm-none-eabi-gcc") |
| 86 os.execvp("arm-none-eabi-gcc", args) | 86 os.execvp("arm-none-eabi-gcc", args) |
| 87 | 87 |
| 88 def invoke_gcc_mips(args): |
| 89 args.insert(0, "mips-mti-linux-gnu-gcc") |
| 90 os.execvp("mips-mti-linux-gnu-gcc", args) |
| 91 |
| 88 def main(): | 92 def main(): |
| 89 args = sys.argv[1:] | 93 args = sys.argv[1:] |
| 90 if "-L/DARTINO_ASAN" in args: | 94 if "-L/DARTINO_ASAN" in args: |
| 91 args.remove("-L/DARTINO_ASAN") | 95 args.remove("-L/DARTINO_ASAN") |
| 92 args.insert(0, '-fsanitize-undefined-trap-on-error') | 96 args.insert(0, '-fsanitize-undefined-trap-on-error') |
| 93 args.insert(0, '-fsanitize=address') | 97 args.insert(0, '-fsanitize=address') |
| 94 if "-DDARTINO_CLANG" in args: | 98 if "-DDARTINO_CLANG" in args: |
| 95 args.remove("-DDARTINO_CLANG") | 99 args.remove("-DDARTINO_CLANG") |
| 96 invoke_clang(args) | 100 invoke_clang(args) |
| 97 elif "-L/DARTINO_CLANG" in args: | 101 elif "-L/DARTINO_CLANG" in args: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 110 elif "-DGCC_XARM_EMBEDDED" in args: | 114 elif "-DGCC_XARM_EMBEDDED" in args: |
| 111 invoke_gcc_arm_embedded(args) | 115 invoke_gcc_arm_embedded(args) |
| 112 elif "-L/GCC_XARM_EMBEDDED" in args: | 116 elif "-L/GCC_XARM_EMBEDDED" in args: |
| 113 args.remove("-L/GCC_XARM_EMBEDDED") | 117 args.remove("-L/GCC_XARM_EMBEDDED") |
| 114 invoke_gcc_arm_embedded(args) | 118 invoke_gcc_arm_embedded(args) |
| 115 elif "-DGCC_XARM_LOCAL" in args: | 119 elif "-DGCC_XARM_LOCAL" in args: |
| 116 invoke_gcc_local(args) | 120 invoke_gcc_local(args) |
| 117 elif "-L/GCC_XARM_LOCAL" in args: | 121 elif "-L/GCC_XARM_LOCAL" in args: |
| 118 args.remove("-L/GCC_XARM_LOCAL") | 122 args.remove("-L/GCC_XARM_LOCAL") |
| 119 invoke_gcc_local(args) | 123 invoke_gcc_local(args) |
| 124 elif "-DDARTINO_MIPS" in args: |
| 125 invoke_gcc_mips(args) |
| 126 elif "-L/DARTINO_MIPS" in args: |
| 127 args.remove("-L/DARTINO_MIPS") |
| 128 invoke_gcc_mips(args) |
| 120 else: | 129 else: |
| 121 invoke_gcc(args) | 130 invoke_gcc(args) |
| 122 | 131 |
| 123 if __name__ == '__main__': | 132 if __name__ == '__main__': |
| 124 main() | 133 main() |
| OLD | NEW |