Changeset bbe5e34 in mainline for tools/autotool.py
- Timestamp:
- 2018-08-31T14:32:39Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 58e7b26
- Parents:
- fa86fff
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-08-31 14:32:39)
- git-committer:
- GitHub <noreply@…> (2018-08-31 14:32:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/autotool.py
rfa86fff rbbe5e34 178 178 def get_target(config): 179 179 platform = None 180 gnu_target = None181 helenos_target = None182 180 target = None 183 181 cc_args = [] … … 188 186 189 187 if (config['CROSS_TARGET'] == "arm32"): 190 gnu_target = "arm-linux-gnueabi" 191 helenos_target = "arm-helenos" 188 target = "arm-helenos" 192 189 193 190 if (config['CROSS_TARGET'] == "ia32"): 194 gnu_target = "i686-pc-linux-gnu" 195 helenos_target = "i686-helenos" 191 target = "i686-helenos" 196 192 197 193 if (config['CROSS_TARGET'] == "mips32"): 198 194 cc_args.append("-mabi=32") 199 gnu_target = "mipsel-linux-gnu" 200 helenos_target = "mipsel-helenos" 195 target = "mipsel-helenos" 201 196 202 197 if (config['PLATFORM'] == "amd64"): 203 198 platform = config['PLATFORM'] 204 gnu_target = "amd64-unknown-elf" 205 helenos_target = "amd64-helenos" 199 target = "amd64-helenos" 206 200 207 201 if (config['PLATFORM'] == "arm32"): 208 202 platform = config['PLATFORM'] 209 gnu_target = "arm-linux-gnueabi" 210 helenos_target = "arm-helenos" 203 target = "arm-helenos" 211 204 212 205 if (config['PLATFORM'] == "ia32"): 213 206 platform = config['PLATFORM'] 214 gnu_target = "i686-pc-linux-gnu" 215 helenos_target = "i686-helenos" 207 target = "i686-helenos" 216 208 217 209 if (config['PLATFORM'] == "ia64"): 218 210 platform = config['PLATFORM'] 219 gnu_target = "ia64-pc-linux-gnu" 220 helenos_target = "ia64-helenos" 211 target = "ia64-helenos" 221 212 222 213 if (config['PLATFORM'] == "mips32"): … … 226 217 if ((config['MACHINE'] == "msim") or (config['MACHINE'] == "lmalta")): 227 218 platform = config['PLATFORM'] 228 gnu_target = "mipsel-linux-gnu" 229 helenos_target = "mipsel-helenos" 219 target = "mipsel-helenos" 230 220 231 221 if ((config['MACHINE'] == "bmalta")): 232 222 platform = "mips32eb" 233 gnu_target = "mips-linux-gnu" 234 helenos_target = "mips-helenos" 223 target = "mips-helenos" 235 224 236 225 if (config['PLATFORM'] == "mips64"): … … 240 229 if (config['MACHINE'] == "msim"): 241 230 platform = config['PLATFORM'] 242 gnu_target = "mips64el-linux-gnu" 243 helenos_target = "mips64el-helenos" 231 target = "mips64el-helenos" 244 232 245 233 if (config['PLATFORM'] == "ppc32"): 246 234 platform = config['PLATFORM'] 247 gnu_target = "ppc-linux-gnu" 248 helenos_target = "ppc-helenos" 235 target = "ppc-helenos" 249 236 250 237 if (config['PLATFORM'] == "riscv64"): 251 238 platform = config['PLATFORM'] 252 gnu_target = "riscv64-unknown-linux-gnu" 253 helenos_target = "riscv64-helenos" 239 target = "riscv64-helenos" 254 240 255 241 if (config['PLATFORM'] == "sparc64"): 256 242 platform = config['PLATFORM'] 257 gnu_target = "sparc64-linux-gnu" 258 helenos_target = "sparc64-helenos" 259 260 if (config['COMPILER'] == "gcc_helenos"): 261 target = helenos_target 262 else: 263 target = gnu_target 243 target = "sparc64-helenos" 264 244 265 245 return (platform, cc_args, target) … … 279 259 280 260 sys.stderr.write("ok\n") 261 262 def check_path_gcc(target): 263 "Check whether GCC for a given target is present in $PATH." 264 265 try: 266 subprocess.Popen([ "%s-gcc" % target, "--version" ], stdout = subprocess.PIPE, stderr = subprocess.PIPE).wait() 267 return True 268 except: 269 return False 281 270 282 271 def check_app_alternatives(alts, args, name, details): … … 561 550 cross_prefix = "/usr/local/cross" 562 551 563 # HelenOS cross-compiler prefix564 if ('CROSS_HELENOS_PREFIX' in os.environ):565 cross_helenos_prefix = os.environ['CROSS_HELENOS_PREFIX']566 else:567 cross_helenos_prefix = "/usr/local/cross-helenos"568 569 # Prefix binutils tools on Solaris570 if (os.uname()[0] == "SunOS"):571 binutils_prefix = "g"572 else:573 binutils_prefix = ""574 575 552 owd = sandbox_enter() 576 553 … … 593 570 "Please contact the developers of HelenOS."]) 594 571 595 path = "%s/%s/bin" % (cross_prefix, target) 596 597 # Compatibility with earlier toolchain paths. 598 if not os.path.exists(path): 599 if (config['COMPILER'] == "gcc_helenos"): 600 check_path = "%s/%s/%s" % (cross_helenos_prefix, platform, target) 601 if not os.path.exists(check_path): 602 print_error(TOOLCHAIN_FAIL) 603 path = "%s/%s/bin" % (cross_helenos_prefix, platform) 604 else: 605 check_path = "%s/%s/%s" % (cross_prefix, platform, target) 606 if not os.path.exists(check_path): 607 print_error(TOOLCHAIN_FAIL) 608 path = "%s/%s/bin" % (cross_prefix, platform) 572 path = None 573 574 if not check_path_gcc(target): 575 path = "%s/bin" % cross_prefix 609 576 610 577 common['TARGET'] = target … … 612 579 613 580 # Compiler 614 if (config['COMPILER'] == "gcc_cross" or config['COMPILER'] == "gcc_helenos"):581 if (config['COMPILER'] == "gcc_cross"): 615 582 check_gcc(path, prefix, common, PACKAGE_CROSS) 616 583 check_binutils(path, prefix, common, PACKAGE_CROSS) … … 622 589 check_common(common, "GXX") 623 590 common['CXX'] = common['GXX'] 624 625 if (config['COMPILER'] == "gcc_native"):626 check_gcc(None, "", common, PACKAGE_GCC)627 check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)628 629 check_common(common, "GCC")630 common['CC'] = common['GCC']631 common['CC_AUTOGEN'] = common['CC']632 591 633 592 if (config['COMPILER'] == "clang"):
Note:
See TracChangeset
for help on using the changeset viewer.