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


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autotool.py

    r84eb4edd r9ce911d  
    5454PACKAGE_GCC = "preferably version 4.7.0 or newer"
    5555PACKAGE_CROSS = "use tools/toolchain.sh to build the cross-compiler toolchain"
    56 PACKAGE_CLANG = "reasonably recent version of clang needs to be installed"
    5756
    5857COMPILER_FAIL = "The compiler is probably not capable to compile HelenOS."
     
    211210        target = None
    212211        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"
    222223                        helenos_target = "arm-helenos-gnueabi"
    223224               
    224225                if (config['CROSS_TARGET'] == "ia32"):
    225226                        gnu_target = "i686-pc-linux-gnu"
     227                        clang_target = "i686-unknown-none"
    226228                        helenos_target = "i686-pc-helenos"
    227229               
     
    229231                        cc_args.append("-mabi=32")
    230232                        gnu_target = "mipsel-linux-gnu"
     233                        clang_target = "mipsel-unknown-none"
    231234                        helenos_target = "mipsel-helenos"
    232235       
     
    234237                target = config['PLATFORM']
    235238                gnu_target = "amd64-linux-gnu"
     239                clang_target = "x86_64-unknown-none"
    236240                helenos_target = "amd64-helenos"
    237241       
     
    239243                target = config['PLATFORM']
    240244                gnu_target = "arm-linux-gnueabi"
     245                clang_target = "arm-unknown-none-eabi"
    241246                helenos_target = "arm-helenos-gnueabi"
    242247       
     
    244249                target = config['PLATFORM']
    245250                gnu_target = "i686-pc-linux-gnu"
     251                clang_target = "i686-unknown-none"
    246252                helenos_target = "i686-pc-helenos"
    247253       
     
    258264                        target = config['PLATFORM']
    259265                        gnu_target = "mipsel-linux-gnu"
     266                        clang_target = "mipsel-unknown-none"
    260267                        helenos_target = "mipsel-helenos"
    261268               
     
    263270                        target = "mips32eb"
    264271                        gnu_target = "mips-linux-gnu"
     272                        clang_target = "mips-unknown-none"
    265273                        helenos_target = "mips-helenos"
    266274       
     
    272280                        target = config['PLATFORM']
    273281                        gnu_target = "mips64el-linux-gnu"
     282                        clang_target = "mips64el-unknown-none"
    274283                        helenos_target = "mips64el-helenos"
    275284       
     
    277286                target = config['PLATFORM']
    278287                gnu_target = "ppc-linux-gnu"
     288                clang_target = "ppc-unknown-none"
    279289                helenos_target = "ppc-helenos"
    280290       
     
    282292                target = config['PLATFORM']
    283293                gnu_target = "riscv64-unknown-linux-gnu"
     294                clang_target = "riscv-unknown-none"
    284295                helenos_target = "riscv64-helenos"
    285296       
     
    287298                target = config['PLATFORM']
    288299                gnu_target = "sparc64-linux-gnu"
     300                clang_target = "sparc-unknown-none"
    289301                helenos_target = "sparc64-helenos"
    290302       
    291         return (target, cc_args, gnu_target, helenos_target)
     303        return (target, cc_args, gnu_target, clang_target, helenos_target)
    292304
    293305def check_app(args, name, details):
     
    339351        return found
    340352
    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 
    351353def check_gcc(path, prefix, common, details):
    352354        "Check for GCC"
     
    425427        outf.close()
    426428       
    427         args = common['CC_AUTOGEN'].split(' ')
     429        args = [common['CC']]
     430        args.extend(common['CC_ARGS'])
    428431        args.extend(["-S", "-o", PROBE_OUTPUT, PROBE_SOURCE])
    429432       
     
    544547        outf.close()
    545548       
    546         args = common['CC_AUTOGEN'].split(' ')
     549        args = [common['CC']]
     550        args.extend(common['CC_ARGS'])
    547551        args.extend(["-S", "-o", PROBE_INT128_OUTPUT, PROBE_INT128_SOURCE])
    548552       
     
    848852               
    849853                # Compiler
     854                common['CC_ARGS'] = []
    850855                if (config['COMPILER'] == "gcc_cross"):
    851                         target, cc_args, gnu_target, helenos_target = get_target(config)
     856                        target, cc_args, gnu_target, clang_target, helenos_target = get_target(config)
    852857                       
    853858                        if (target is None) or (gnu_target is None):
     
    862867                       
    863868                        check_common(common, "GCC")
    864                         common['CC'] = " ".join([common['GCC']] + cc_args)
    865                         common['CC_AUTOGEN'] = common['CC']
     869                        common['CC'] = common['GCC']
     870                        common['CC_ARGS'].extend(cc_args)
    866871               
    867872                if (config['COMPILER'] == "gcc_helenos"):
    868                         target, cc_args, gnu_target, helenos_target = get_target(config)
     873                        target, cc_args, gnu_target, clang_target, helenos_target = get_target(config)
    869874                       
    870875                        if (target is None) or (helenos_target is None):
     
    879884                       
    880885                        check_common(common, "GCC")
    881                         common['CC'] = " ".join([common['GCC']] + cc_args)
    882                         common['CC_AUTOGEN'] = common['CC']
     886                        common['CC'] = common['GCC']
     887                        common['CC_ARGS'].extend(cc_args)
    883888               
    884889                if (config['COMPILER'] == "gcc_native"):
     
    888893                        check_common(common, "GCC")
    889894                        common['CC'] = common['GCC']
    890                         common['CC_AUTOGEN'] = common['CC']
    891895               
    892896                if (config['COMPILER'] == "icc"):
     
    896900                       
    897901                        common['CC'] = "icc"
    898                         common['CC_AUTOGEN'] = common['CC']
    899902               
    900903                if (config['COMPILER'] == "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.",
     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.",
    905908                                             "Please contact the developers of HelenOS."])
    906909                       
     
    908911                        prefix = "%s-" % gnu_target
    909912                       
    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"
     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
    922923               
    923924                check_python()
Note: See TracChangeset for help on using the changeset viewer.