Changes in tools/autotool.py [bfdb7c63:c7a67c4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/autotool.py
rbfdb7c63 rc7a67c4 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"57 56 58 57 COMPILER_FAIL = "The compiler is probably not capable to compile HelenOS." … … 209 208 210 209 def get_target(config): 211 platform= None210 target = None 212 211 gnu_target = None 212 clang_target = None 213 213 helenos_target = None 214 target = None215 214 cc_args = [] 216 215 217 216 if (config['PLATFORM'] == "abs32le"): 218 217 check_config(config, "CROSS_TARGET") 219 platform= config['CROSS_TARGET']218 target = config['CROSS_TARGET'] 220 219 221 220 if (config['CROSS_TARGET'] == "arm32"): 222 221 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" 227 228 helenos_target = "i686-pc-helenos" 228 229 … … 230 231 cc_args.append("-mabi=32") 231 232 gnu_target = "mipsel-linux-gnu" 233 clang_target = "mipsel-unknown-none" 232 234 helenos_target = "mipsel-helenos" 233 235 234 236 if (config['PLATFORM'] == "amd64"): 235 platform = config['PLATFORM'] 236 gnu_target = "amd64-unknown-elf" 237 target = config['PLATFORM'] 238 gnu_target = "amd64-linux-gnu" 239 clang_target = "x86_64-unknown-none" 237 240 helenos_target = "amd64-helenos" 238 241 239 242 if (config['PLATFORM'] == "arm32"): 240 platform= config['PLATFORM']243 target = config['PLATFORM'] 241 244 gnu_target = "arm-linux-gnueabi" 245 clang_target = "arm-unknown-none-eabi" 242 246 helenos_target = "arm-helenos-gnueabi" 243 247 244 248 if (config['PLATFORM'] == "ia32"): 245 platform= config['PLATFORM']249 target = config['PLATFORM'] 246 250 gnu_target = "i686-pc-linux-gnu" 251 clang_target = "i686-unknown-none" 247 252 helenos_target = "i686-pc-helenos" 248 253 249 254 if (config['PLATFORM'] == "ia64"): 250 platform= config['PLATFORM']255 target = config['PLATFORM'] 251 256 gnu_target = "ia64-pc-linux-gnu" 252 257 helenos_target = "ia64-pc-helenos" … … 257 262 258 263 if ((config['MACHINE'] == "msim") or (config['MACHINE'] == "lmalta")): 259 platform= config['PLATFORM']264 target = config['PLATFORM'] 260 265 gnu_target = "mipsel-linux-gnu" 266 clang_target = "mipsel-unknown-none" 261 267 helenos_target = "mipsel-helenos" 262 268 263 269 if ((config['MACHINE'] == "bmalta")): 264 platform= "mips32eb"270 target = "mips32eb" 265 271 gnu_target = "mips-linux-gnu" 272 clang_target = "mips-unknown-none" 266 273 helenos_target = "mips-helenos" 267 274 … … 271 278 272 279 if (config['MACHINE'] == "msim"): 273 platform= config['PLATFORM']280 target = config['PLATFORM'] 274 281 gnu_target = "mips64el-linux-gnu" 282 clang_target = "mips64el-unknown-none" 275 283 helenos_target = "mips64el-helenos" 276 284 277 285 if (config['PLATFORM'] == "ppc32"): 278 platform= config['PLATFORM']286 target = config['PLATFORM'] 279 287 gnu_target = "ppc-linux-gnu" 288 clang_target = "ppc-unknown-none" 280 289 helenos_target = "ppc-helenos" 281 290 282 291 if (config['PLATFORM'] == "riscv64"): 283 platform= config['PLATFORM']292 target = config['PLATFORM'] 284 293 gnu_target = "riscv64-unknown-linux-gnu" 294 clang_target = "riscv-unknown-none" 285 295 helenos_target = "riscv64-helenos" 286 296 287 297 if (config['PLATFORM'] == "sparc64"): 288 platform= config['PLATFORM']298 target = config['PLATFORM'] 289 299 gnu_target = "sparc64-linux-gnu" 300 clang_target = "sparc-unknown-none" 290 301 helenos_target = "sparc64-helenos" 291 302 292 if (config['COMPILER'] == "gcc_helenos"): 293 target = helenos_target 294 else: 295 target = gnu_target 296 297 return (platform, cc_args, target) 303 return (target, cc_args, gnu_target, clang_target, helenos_target) 298 304 299 305 def check_app(args, name, details): … … 345 351 return found 346 352 347 def check_clang(path, prefix, common, details):348 "Check for clang"349 350 common['CLANG'] = "%sclang" % prefix351 352 if (not path is None):353 common['CLANG'] = "%s/%s" % (path, common['CLANG'])354 355 check_app([common['CLANG'], "--version"], "clang", details)356 357 353 def check_gcc(path, prefix, common, details): 358 354 "Check for GCC" … … 431 427 outf.close() 432 428 433 args = common['CC_AUTOGEN'].split(' ') 429 args = [common['CC']] 430 args.extend(common['CC_ARGS']) 434 431 args.extend(["-S", "-o", PROBE_OUTPUT, PROBE_SOURCE]) 435 432 … … 550 547 outf.close() 551 548 552 args = common['CC_AUTOGEN'].split(' ') 549 args = [common['CC']] 550 args.extend(common['CC_ARGS']) 553 551 args.extend(["-S", "-o", PROBE_INT128_OUTPUT, PROBE_INT128_SOURCE]) 554 552 … … 851 849 check_app(["make", "--version"], "Make utility", "preferably GNU Make") 852 850 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-" % target877 851 878 852 # Compiler 879 if (config['COMPILER'] == "gcc_cross" or config['COMPILER'] == "gcc_helenos"): 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 880 864 check_gcc(path, prefix, common, PACKAGE_CROSS) 881 865 check_binutils(path, prefix, common, PACKAGE_CROSS) 882 866 883 867 check_common(common, "GCC") 884 common['CC'] = " ".join([common['GCC']] + cc_args) 885 common['CC_AUTOGEN'] = common['CC'] 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) 886 887 887 888 if (config['COMPILER'] == "gcc_native"): … … 891 892 check_common(common, "GCC") 892 893 common['CC'] = common['GCC'] 893 common['CC_AUTOGEN'] = common['CC'] 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) 899 900 common['CC'] = "icc" 894 901 895 902 if (config['COMPILER'] == "clang"): 896 check_binutils(path, prefix, common, PACKAGE_CROSS) 897 check_clang(path, prefix, common, PACKAGE_CLANG) 898 899 check_common(common, "CLANG") 900 common['CC'] = " ".join([common['CLANG']] + cc_args) 901 common['CC_AUTOGEN'] = common['CC'] + " -no-integrated-as" 902 903 if (config['INTEGRATED_AS'] == "yes"): 904 common['CC'] += " -integrated-as" 905 906 if (config['INTEGRATED_AS'] == "no"): 907 common['CC'] += " -no-integrated-as" 903 target, cc_args, gnu_target, clang_target, helenos_target = get_target(config) 904 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."]) 908 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 908 922 909 923 check_python()
Note:
See TracChangeset
for help on using the changeset viewer.