Changes in tools/autotool.py [c7a67c4:bfdb7c63] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/autotool.py
rc7a67c4 rbfdb7c63 54 54 PACKAGE_GCC = "preferably version 4.7.0 or newer" 55 55 PACKAGE_CROSS = "use tools/toolchain.sh to build the cross-compiler toolchain" 56 PACKAGE_CLANG = "reasonably recent version of clang needs to be installed" 56 57 57 58 COMPILER_FAIL = "The compiler is probably not capable to compile HelenOS." … … 208 209 209 210 def get_target(config): 211 platform = None 212 gnu_target = None 213 helenos_target = None 210 214 target = None 211 gnu_target = None212 clang_target = None213 helenos_target = None214 215 cc_args = [] 215 216 216 217 if (config['PLATFORM'] == "abs32le"): 217 218 check_config(config, "CROSS_TARGET") 218 target= config['CROSS_TARGET']219 platform = config['CROSS_TARGET'] 219 220 220 221 if (config['CROSS_TARGET'] == "arm32"): 221 222 gnu_target = "arm-linux-gnueabi" 222 clang_target = "arm-unknown-none"223 223 helenos_target = "arm-helenos-gnueabi" 224 224 225 225 if (config['CROSS_TARGET'] == "ia32"): 226 226 gnu_target = "i686-pc-linux-gnu" 227 clang_target = "i686-unknown-none"228 227 helenos_target = "i686-pc-helenos" 229 228 … … 231 230 cc_args.append("-mabi=32") 232 231 gnu_target = "mipsel-linux-gnu" 233 clang_target = "mipsel-unknown-none"234 232 helenos_target = "mipsel-helenos" 235 233 236 234 if (config['PLATFORM'] == "amd64"): 237 target = config['PLATFORM'] 238 gnu_target = "amd64-linux-gnu" 239 clang_target = "x86_64-unknown-none" 235 platform = config['PLATFORM'] 236 gnu_target = "amd64-unknown-elf" 240 237 helenos_target = "amd64-helenos" 241 238 242 239 if (config['PLATFORM'] == "arm32"): 243 target= config['PLATFORM']240 platform = config['PLATFORM'] 244 241 gnu_target = "arm-linux-gnueabi" 245 clang_target = "arm-unknown-none-eabi"246 242 helenos_target = "arm-helenos-gnueabi" 247 243 248 244 if (config['PLATFORM'] == "ia32"): 249 target= config['PLATFORM']245 platform = config['PLATFORM'] 250 246 gnu_target = "i686-pc-linux-gnu" 251 clang_target = "i686-unknown-none"252 247 helenos_target = "i686-pc-helenos" 253 248 254 249 if (config['PLATFORM'] == "ia64"): 255 target= config['PLATFORM']250 platform = config['PLATFORM'] 256 251 gnu_target = "ia64-pc-linux-gnu" 257 252 helenos_target = "ia64-pc-helenos" … … 262 257 263 258 if ((config['MACHINE'] == "msim") or (config['MACHINE'] == "lmalta")): 264 target= config['PLATFORM']259 platform = config['PLATFORM'] 265 260 gnu_target = "mipsel-linux-gnu" 266 clang_target = "mipsel-unknown-none"267 261 helenos_target = "mipsel-helenos" 268 262 269 263 if ((config['MACHINE'] == "bmalta")): 270 target= "mips32eb"264 platform = "mips32eb" 271 265 gnu_target = "mips-linux-gnu" 272 clang_target = "mips-unknown-none"273 266 helenos_target = "mips-helenos" 274 267 … … 278 271 279 272 if (config['MACHINE'] == "msim"): 280 target= config['PLATFORM']273 platform = config['PLATFORM'] 281 274 gnu_target = "mips64el-linux-gnu" 282 clang_target = "mips64el-unknown-none"283 275 helenos_target = "mips64el-helenos" 284 276 285 277 if (config['PLATFORM'] == "ppc32"): 286 target= config['PLATFORM']278 platform = config['PLATFORM'] 287 279 gnu_target = "ppc-linux-gnu" 288 clang_target = "ppc-unknown-none"289 280 helenos_target = "ppc-helenos" 290 281 291 282 if (config['PLATFORM'] == "riscv64"): 292 target= config['PLATFORM']283 platform = config['PLATFORM'] 293 284 gnu_target = "riscv64-unknown-linux-gnu" 294 clang_target = "riscv-unknown-none"295 285 helenos_target = "riscv64-helenos" 296 286 297 287 if (config['PLATFORM'] == "sparc64"): 298 target= config['PLATFORM']288 platform = config['PLATFORM'] 299 289 gnu_target = "sparc64-linux-gnu" 300 clang_target = "sparc-unknown-none"301 290 helenos_target = "sparc64-helenos" 302 291 303 return (target, cc_args, gnu_target, clang_target, helenos_target) 292 if (config['COMPILER'] == "gcc_helenos"): 293 target = helenos_target 294 else: 295 target = gnu_target 296 297 return (platform, cc_args, target) 304 298 305 299 def check_app(args, name, details): … … 351 345 return found 352 346 347 def check_clang(path, prefix, common, details): 348 "Check for clang" 349 350 common['CLANG'] = "%sclang" % prefix 351 352 if (not path is None): 353 common['CLANG'] = "%s/%s" % (path, common['CLANG']) 354 355 check_app([common['CLANG'], "--version"], "clang", details) 356 353 357 def check_gcc(path, prefix, common, details): 354 358 "Check for GCC" … … 427 431 outf.close() 428 432 429 args = [common['CC']] 430 args.extend(common['CC_ARGS']) 433 args = common['CC_AUTOGEN'].split(' ') 431 434 args.extend(["-S", "-o", PROBE_OUTPUT, PROBE_SOURCE]) 432 435 … … 547 550 outf.close() 548 551 549 args = [common['CC']] 550 args.extend(common['CC_ARGS']) 552 args = common['CC_AUTOGEN'].split(' ') 551 553 args.extend(["-S", "-o", PROBE_INT128_OUTPUT, PROBE_INT128_SOURCE]) 552 554 … … 849 851 check_app(["make", "--version"], "Make utility", "preferably GNU Make") 850 852 check_app(["makedepend", "-f", "-"], "Makedepend utility", "usually part of imake or xutils") 853 check_app(["unzip"], "unzip utility", "usually part of zip/unzip utilities") 854 855 platform, cc_args, target = get_target(config) 856 857 if (platform is None) or (target is None): 858 print_error(["Unsupported compiler target.", 859 "Please contact the developers of HelenOS."]) 860 861 path = "%s/%s/bin" % (cross_prefix, target) 862 863 # Compatibility with earlier toolchain paths. 864 if not os.path.exists(path): 865 if (config['COMPILER'] == "gcc_helenos"): 866 check_path = "%s/%s/%s" % (cross_helenos_prefix, platform, target) 867 if not os.path.exists(check_path): 868 print_error(["Toolchain for target is not installed, or CROSS_PREFIX is not set correctly."]) 869 path = "%s/%s/bin" % (cross_helenos_prefix, platform) 870 else: 871 check_path = "%s/%s/%s" % (cross_prefix, platform, target) 872 if not os.path.exists(check_path): 873 print_error(["Toolchain for target is not installed, or CROSS_PREFIX is not set correctly."]) 874 path = "%s/%s/bin" % (cross_prefix, platform) 875 876 prefix = "%s-" % target 851 877 852 878 # Compiler 853 common['CC_ARGS'] = [] 854 if (config['COMPILER'] == "gcc_cross"): 855 target, cc_args, gnu_target, clang_target, helenos_target = get_target(config) 856 857 if (target is None) or (gnu_target is None): 858 print_error(["Unsupported compiler target for GNU GCC.", 859 "Please contact the developers of HelenOS."]) 860 861 path = "%s/%s/bin" % (cross_prefix, target) 862 prefix = "%s-" % gnu_target 863 879 if (config['COMPILER'] == "gcc_cross" or config['COMPILER'] == "gcc_helenos"): 864 880 check_gcc(path, prefix, common, PACKAGE_CROSS) 865 881 check_binutils(path, prefix, common, PACKAGE_CROSS) 866 882 867 883 check_common(common, "GCC") 868 common['CC'] = common['GCC'] 869 common['CC_ARGS'].extend(cc_args) 870 871 if (config['COMPILER'] == "gcc_helenos"): 872 target, cc_args, gnu_target, clang_target, helenos_target = get_target(config) 873 874 if (target is None) or (helenos_target is None): 875 print_error(["Unsupported compiler target for GNU GCC.", 876 "Please contact the developers of HelenOS."]) 877 878 path = "%s/%s/bin" % (cross_helenos_prefix, target) 879 prefix = "%s-" % helenos_target 880 881 check_gcc(path, prefix, common, PACKAGE_CROSS) 882 check_binutils(path, prefix, common, PACKAGE_CROSS) 883 884 check_common(common, "GCC") 885 common['CC'] = common['GCC'] 886 common['CC_ARGS'].extend(cc_args) 884 common['CC'] = " ".join([common['GCC']] + cc_args) 885 common['CC_AUTOGEN'] = common['CC'] 887 886 888 887 if (config['COMPILER'] == "gcc_native"): … … 892 891 check_common(common, "GCC") 893 892 common['CC'] = common['GCC'] 894 895 if (config['COMPILER'] == "icc"):896 check_app([common['CC'], "-V"], "Intel C++ Compiler", "support is experimental")897 check_ gcc(None, "", common, PACKAGE_GCC)898 check_ binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)893 common['CC_AUTOGEN'] = common['CC'] 894 895 if (config['COMPILER'] == "clang"): 896 check_binutils(path, prefix, common, PACKAGE_CROSS) 897 check_clang(path, prefix, common, PACKAGE_CLANG) 899 898 900 common['CC'] = "icc" 901 902 if (config['COMPILER'] == "clang"): 903 target, cc_args, gnu_target, clang_target, helenos_target = get_target(config) 899 check_common(common, "CLANG") 900 common['CC'] = " ".join([common['CLANG']] + cc_args) 901 common['CC_AUTOGEN'] = common['CC'] + " -no-integrated-as" 904 902 905 if (target is None) or (gnu_target is None) or (clang_target is None): 906 print_error(["Unsupported compiler target for clang.", 907 "Please contact the developers of HelenOS."]) 903 if (config['INTEGRATED_AS'] == "yes"): 904 common['CC'] += " -integrated-as" 908 905 909 path = "%s/%s/bin" % (cross_prefix, target) 910 prefix = "%s-" % gnu_target 911 912 check_app(["clang", "--version"], "clang compiler", "preferably version 1.0 or newer") 913 check_gcc(path, prefix, common, PACKAGE_GCC) 914 check_binutils(path, prefix, common, PACKAGE_BINUTILS) 915 916 check_common(common, "GCC") 917 common['CC'] = "clang" 918 common['CC_ARGS'].extend(cc_args) 919 common['CC_ARGS'].append("-target") 920 common['CC_ARGS'].append(clang_target) 921 common['CLANG_TARGET'] = clang_target 906 if (config['INTEGRATED_AS'] == "no"): 907 common['CC'] += " -no-integrated-as" 922 908 923 909 check_python()
Note:
See TracChangeset
for help on using the changeset viewer.