Changes in tools/autotool.py [9ce911d:84eb4edd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/autotool.py
r9ce911d r84eb4edd 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." … … 210 211 target = None 211 212 gnu_target = None 212 clang_target = None213 213 helenos_target = None 214 214 cc_args = [] … … 220 220 if (config['CROSS_TARGET'] == "arm32"): 221 221 gnu_target = "arm-linux-gnueabi" 222 clang_target = "arm-unknown-none"223 222 helenos_target = "arm-helenos-gnueabi" 224 223 225 224 if (config['CROSS_TARGET'] == "ia32"): 226 225 gnu_target = "i686-pc-linux-gnu" 227 clang_target = "i686-unknown-none"228 226 helenos_target = "i686-pc-helenos" 229 227 … … 231 229 cc_args.append("-mabi=32") 232 230 gnu_target = "mipsel-linux-gnu" 233 clang_target = "mipsel-unknown-none"234 231 helenos_target = "mipsel-helenos" 235 232 … … 237 234 target = config['PLATFORM'] 238 235 gnu_target = "amd64-linux-gnu" 239 clang_target = "x86_64-unknown-none"240 236 helenos_target = "amd64-helenos" 241 237 … … 243 239 target = config['PLATFORM'] 244 240 gnu_target = "arm-linux-gnueabi" 245 clang_target = "arm-unknown-none-eabi"246 241 helenos_target = "arm-helenos-gnueabi" 247 242 … … 249 244 target = config['PLATFORM'] 250 245 gnu_target = "i686-pc-linux-gnu" 251 clang_target = "i686-unknown-none"252 246 helenos_target = "i686-pc-helenos" 253 247 … … 264 258 target = config['PLATFORM'] 265 259 gnu_target = "mipsel-linux-gnu" 266 clang_target = "mipsel-unknown-none"267 260 helenos_target = "mipsel-helenos" 268 261 … … 270 263 target = "mips32eb" 271 264 gnu_target = "mips-linux-gnu" 272 clang_target = "mips-unknown-none"273 265 helenos_target = "mips-helenos" 274 266 … … 280 272 target = config['PLATFORM'] 281 273 gnu_target = "mips64el-linux-gnu" 282 clang_target = "mips64el-unknown-none"283 274 helenos_target = "mips64el-helenos" 284 275 … … 286 277 target = config['PLATFORM'] 287 278 gnu_target = "ppc-linux-gnu" 288 clang_target = "ppc-unknown-none"289 279 helenos_target = "ppc-helenos" 290 280 … … 292 282 target = config['PLATFORM'] 293 283 gnu_target = "riscv64-unknown-linux-gnu" 294 clang_target = "riscv-unknown-none"295 284 helenos_target = "riscv64-helenos" 296 285 … … 298 287 target = config['PLATFORM'] 299 288 gnu_target = "sparc64-linux-gnu" 300 clang_target = "sparc-unknown-none"301 289 helenos_target = "sparc64-helenos" 302 290 303 return (target, cc_args, gnu_target, clang_target,helenos_target)291 return (target, cc_args, gnu_target, helenos_target) 304 292 305 293 def check_app(args, name, details): … … 351 339 return found 352 340 341 def check_clang(path, prefix, common, details): 342 "Check for clang" 343 344 common['CLANG'] = "%sclang" % prefix 345 346 if (not path is None): 347 common['CLANG'] = "%s/%s" % (path, common['CLANG']) 348 349 check_app([common['CLANG'], "--version"], "clang", details) 350 353 351 def check_gcc(path, prefix, common, details): 354 352 "Check for GCC" … … 427 425 outf.close() 428 426 429 args = [common['CC']] 430 args.extend(common['CC_ARGS']) 427 args = common['CC_AUTOGEN'].split(' ') 431 428 args.extend(["-S", "-o", PROBE_OUTPUT, PROBE_SOURCE]) 432 429 … … 547 544 outf.close() 548 545 549 args = [common['CC']] 550 args.extend(common['CC_ARGS']) 546 args = common['CC_AUTOGEN'].split(' ') 551 547 args.extend(["-S", "-o", PROBE_INT128_OUTPUT, PROBE_INT128_SOURCE]) 552 548 … … 852 848 853 849 # Compiler 854 common['CC_ARGS'] = []855 850 if (config['COMPILER'] == "gcc_cross"): 856 target, cc_args, gnu_target, clang_target,helenos_target = get_target(config)851 target, cc_args, gnu_target, helenos_target = get_target(config) 857 852 858 853 if (target is None) or (gnu_target is None): … … 867 862 868 863 check_common(common, "GCC") 869 common['CC'] = common['GCC']870 common['CC_A RGS'].extend(cc_args)864 common['CC'] = " ".join([common['GCC']] + cc_args) 865 common['CC_AUTOGEN'] = common['CC'] 871 866 872 867 if (config['COMPILER'] == "gcc_helenos"): 873 target, cc_args, gnu_target, clang_target,helenos_target = get_target(config)868 target, cc_args, gnu_target, helenos_target = get_target(config) 874 869 875 870 if (target is None) or (helenos_target is None): … … 884 879 885 880 check_common(common, "GCC") 886 common['CC'] = common['GCC']887 common['CC_A RGS'].extend(cc_args)881 common['CC'] = " ".join([common['GCC']] + cc_args) 882 common['CC_AUTOGEN'] = common['CC'] 888 883 889 884 if (config['COMPILER'] == "gcc_native"): … … 893 888 check_common(common, "GCC") 894 889 common['CC'] = common['GCC'] 890 common['CC_AUTOGEN'] = common['CC'] 895 891 896 892 if (config['COMPILER'] == "icc"): … … 900 896 901 897 common['CC'] = "icc" 898 common['CC_AUTOGEN'] = common['CC'] 902 899 903 900 if (config['COMPILER'] == "clang"): 904 target, cc_args, gnu_target, clang_target,helenos_target = get_target(config)905 906 if (target is None) or (gnu_target is None) or (clang_target is None):907 print_error(["Unsupported compiler target for clang.",901 target, cc_args, gnu_target, helenos_target = get_target(config) 902 903 if (target is None) or (gnu_target is None): 904 print_error(["Unsupported compiler target.", 908 905 "Please contact the developers of HelenOS."]) 909 906 … … 911 908 prefix = "%s-" % gnu_target 912 909 913 check_app(["clang", "--version"], "clang compiler", "preferably version 1.0 or newer") 914 check_gcc(path, prefix, common, PACKAGE_GCC) 915 check_binutils(path, prefix, common, PACKAGE_BINUTILS) 916 917 check_common(common, "GCC") 918 common['CC'] = "clang" 919 common['CC_ARGS'].extend(cc_args) 920 common['CC_ARGS'].append("-target") 921 common['CC_ARGS'].append(clang_target) 922 common['CLANG_TARGET'] = clang_target 910 check_binutils(path, prefix, common, PACKAGE_CROSS) 911 check_clang(path, prefix, common, PACKAGE_CLANG) 912 913 check_common(common, "CLANG") 914 common['CC'] = " ".join([common['CLANG']] + cc_args) 915 common['CC_AUTOGEN'] = common['CC'] + " -no-integrated-as" 916 917 if (config['INTEGRATED_AS'] == "yes"): 918 common['CC'] += " -integrated-as" 919 920 if (config['INTEGRATED_AS'] == "no"): 921 common['CC'] += " -no-integrated-as" 923 922 924 923 check_python()
Note:
See TracChangeset
for help on using the changeset viewer.