Changes in tools/autotool.py [9ce911d:84eb4edd] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autotool.py

    r9ce911d r84eb4edd  
    5454PACKAGE_GCC = "preferably version 4.7.0 or newer"
    5555PACKAGE_CROSS = "use tools/toolchain.sh to build the cross-compiler toolchain"
     56PACKAGE_CLANG = "reasonably recent version of clang needs to be installed"
    5657
    5758COMPILER_FAIL = "The compiler is probably not capable to compile HelenOS."
     
    210211        target = None
    211212        gnu_target = None
    212         clang_target = None
    213213        helenos_target = None
    214214        cc_args = []
     
    220220                if (config['CROSS_TARGET'] == "arm32"):
    221221                        gnu_target = "arm-linux-gnueabi"
    222                         clang_target = "arm-unknown-none"
    223222                        helenos_target = "arm-helenos-gnueabi"
    224223               
    225224                if (config['CROSS_TARGET'] == "ia32"):
    226225                        gnu_target = "i686-pc-linux-gnu"
    227                         clang_target = "i686-unknown-none"
    228226                        helenos_target = "i686-pc-helenos"
    229227               
     
    231229                        cc_args.append("-mabi=32")
    232230                        gnu_target = "mipsel-linux-gnu"
    233                         clang_target = "mipsel-unknown-none"
    234231                        helenos_target = "mipsel-helenos"
    235232       
     
    237234                target = config['PLATFORM']
    238235                gnu_target = "amd64-linux-gnu"
    239                 clang_target = "x86_64-unknown-none"
    240236                helenos_target = "amd64-helenos"
    241237       
     
    243239                target = config['PLATFORM']
    244240                gnu_target = "arm-linux-gnueabi"
    245                 clang_target = "arm-unknown-none-eabi"
    246241                helenos_target = "arm-helenos-gnueabi"
    247242       
     
    249244                target = config['PLATFORM']
    250245                gnu_target = "i686-pc-linux-gnu"
    251                 clang_target = "i686-unknown-none"
    252246                helenos_target = "i686-pc-helenos"
    253247       
     
    264258                        target = config['PLATFORM']
    265259                        gnu_target = "mipsel-linux-gnu"
    266                         clang_target = "mipsel-unknown-none"
    267260                        helenos_target = "mipsel-helenos"
    268261               
     
    270263                        target = "mips32eb"
    271264                        gnu_target = "mips-linux-gnu"
    272                         clang_target = "mips-unknown-none"
    273265                        helenos_target = "mips-helenos"
    274266       
     
    280272                        target = config['PLATFORM']
    281273                        gnu_target = "mips64el-linux-gnu"
    282                         clang_target = "mips64el-unknown-none"
    283274                        helenos_target = "mips64el-helenos"
    284275       
     
    286277                target = config['PLATFORM']
    287278                gnu_target = "ppc-linux-gnu"
    288                 clang_target = "ppc-unknown-none"
    289279                helenos_target = "ppc-helenos"
    290280       
     
    292282                target = config['PLATFORM']
    293283                gnu_target = "riscv64-unknown-linux-gnu"
    294                 clang_target = "riscv-unknown-none"
    295284                helenos_target = "riscv64-helenos"
    296285       
     
    298287                target = config['PLATFORM']
    299288                gnu_target = "sparc64-linux-gnu"
    300                 clang_target = "sparc-unknown-none"
    301289                helenos_target = "sparc64-helenos"
    302290       
    303         return (target, cc_args, gnu_target, clang_target, helenos_target)
     291        return (target, cc_args, gnu_target, helenos_target)
    304292
    305293def check_app(args, name, details):
     
    351339        return found
    352340
     341def 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
    353351def check_gcc(path, prefix, common, details):
    354352        "Check for GCC"
     
    427425        outf.close()
    428426       
    429         args = [common['CC']]
    430         args.extend(common['CC_ARGS'])
     427        args = common['CC_AUTOGEN'].split(' ')
    431428        args.extend(["-S", "-o", PROBE_OUTPUT, PROBE_SOURCE])
    432429       
     
    547544        outf.close()
    548545       
    549         args = [common['CC']]
    550         args.extend(common['CC_ARGS'])
     546        args = common['CC_AUTOGEN'].split(' ')
    551547        args.extend(["-S", "-o", PROBE_INT128_OUTPUT, PROBE_INT128_SOURCE])
    552548       
     
    852848               
    853849                # Compiler
    854                 common['CC_ARGS'] = []
    855850                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)
    857852                       
    858853                        if (target is None) or (gnu_target is None):
     
    867862                       
    868863                        check_common(common, "GCC")
    869                         common['CC'] = common['GCC']
    870                         common['CC_ARGS'].extend(cc_args)
     864                        common['CC'] = " ".join([common['GCC']] + cc_args)
     865                        common['CC_AUTOGEN'] = common['CC']
    871866               
    872867                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)
    874869                       
    875870                        if (target is None) or (helenos_target is None):
     
    884879                       
    885880                        check_common(common, "GCC")
    886                         common['CC'] = common['GCC']
    887                         common['CC_ARGS'].extend(cc_args)
     881                        common['CC'] = " ".join([common['GCC']] + cc_args)
     882                        common['CC_AUTOGEN'] = common['CC']
    888883               
    889884                if (config['COMPILER'] == "gcc_native"):
     
    893888                        check_common(common, "GCC")
    894889                        common['CC'] = common['GCC']
     890                        common['CC_AUTOGEN'] = common['CC']
    895891               
    896892                if (config['COMPILER'] == "icc"):
     
    900896                       
    901897                        common['CC'] = "icc"
     898                        common['CC_AUTOGEN'] = common['CC']
    902899               
    903900                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.",
    908905                                             "Please contact the developers of HelenOS."])
    909906                       
     
    911908                        prefix = "%s-" % gnu_target
    912909                       
    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"
    923922               
    924923                check_python()
Note: See TracChangeset for help on using the changeset viewer.