Changes in tools/autotool.py [6db5d4b:232cd4f] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autotool.py

    r6db5d4b r232cd4f  
    182182                             "Please contact the developers of HelenOS."])
    183183
    184 def get_target(config):
    185         target = None
    186         gnu_target = None
    187         clang_target = None
    188         cc_args = []
    189        
    190         if (config['PLATFORM'] == "abs32le"):
    191                 check_config(config, "CROSS_TARGET")
    192                 target = config['CROSS_TARGET']
    193                
    194                 if (config['CROSS_TARGET'] == "arm32"):
    195                         gnu_target = "arm-linux-gnueabi"
    196                         clang_target = "arm-unknown-linux"
    197                
    198                 if (config['CROSS_TARGET'] == "ia32"):
    199                         gnu_target = "i686-pc-linux-gnu"
    200                         clang_target = "i386-unknown-linux"
    201                
    202                 if (config['CROSS_TARGET'] == "mips32"):
    203                         gnu_target = "mipsel-linux-gnu"
    204                         clang_target = "mipsel-unknown-linux"
    205                         common['CC_ARGS'].append("-mabi=32")
    206        
    207         if (config['PLATFORM'] == "amd64"):
    208                 target = config['PLATFORM']
    209                 gnu_target = "amd64-linux-gnu"
    210                 clang_target = "x86_64-unknown-linux"
    211        
    212         if (config['PLATFORM'] == "arm32"):
    213                 target = config['PLATFORM']
    214                 gnu_target = "arm-linux-gnueabi"
    215                 clang_target = "arm-unknown-linux"
    216        
    217         if (config['PLATFORM'] == "ia32"):
    218                 target = config['PLATFORM']
    219                 gnu_target = "i686-pc-linux-gnu"
    220                 clang_target = "i386-unknown-linux"
    221        
    222         if (config['PLATFORM'] == "ia64"):
    223                 target = config['PLATFORM']
    224                 gnu_target = "ia64-pc-linux-gnu"
    225        
    226         if (config['PLATFORM'] == "mips32"):
    227                 check_config(config, "MACHINE")
    228                 cc_args.append("-mabi=32")
    229                
    230                 if ((config['MACHINE'] == "msim") or (config['MACHINE'] == "lmalta")):
    231                         target = config['PLATFORM']
    232                         gnu_target = "mipsel-linux-gnu"
    233                         clang_target = "mipsel-unknown-linux"
    234                
    235                 if ((config['MACHINE'] == "bmalta")):
    236                         target = "mips32eb"
    237                         gnu_target = "mips-linux-gnu"
    238                         clang_target = "mips-unknown-linux"
    239        
    240         if (config['PLATFORM'] == "mips64"):
    241                 check_config(config, "MACHINE")
    242                 cc_args.append("-mabi=64")
    243                
    244                 if (config['MACHINE'] == "msim"):
    245                         target = config['PLATFORM']
    246                         gnu_target = "mips64el-linux-gnu"
    247                         clang_target = "mips64el-unknown-linux"
    248        
    249         if (config['PLATFORM'] == "ppc32"):
    250                 target = config['PLATFORM']
    251                 gnu_target = "ppc-linux-gnu"
    252                 clang_target = "powerpc-unknown-linux"
    253        
    254         if (config['PLATFORM'] == "sparc64"):
    255                 target = config['PLATFORM']
    256                 gnu_target = "sparc64-linux-gnu"
    257                 clang_target = "sparc-unknown-linux"
    258        
    259         return (target, cc_args, gnu_target, clang_target)
    260 
    261184def check_app(args, name, details):
    262185        "Check whether an application can be executed"
     
    719642                common['CC_ARGS'] = []
    720643                if (config['COMPILER'] == "gcc_cross"):
    721                         target, cc_args, gnu_target, clang_target = get_target(config)
    722                        
    723                         if (target is None) or (gnu_target is None):
    724                                 print_error(["Unsupported compiler target for GNU GCC.",
    725                                              "Please contact the developers of HelenOS."])
     644                        if (config['PLATFORM'] == "abs32le"):
     645                                check_config(config, "CROSS_TARGET")
     646                                target = config['CROSS_TARGET']
     647                               
     648                                if (config['CROSS_TARGET'] == "arm32"):
     649                                        gnu_target = "arm-linux-gnueabi"
     650                               
     651                                if (config['CROSS_TARGET'] == "ia32"):
     652                                        gnu_target = "i686-pc-linux-gnu"
     653                               
     654                                if (config['CROSS_TARGET'] == "mips32"):
     655                                        gnu_target = "mipsel-linux-gnu"
     656                                        common['CC_ARGS'].append("-mabi=32")
     657                       
     658                        if (config['PLATFORM'] == "amd64"):
     659                                target = config['PLATFORM']
     660                                gnu_target = "amd64-linux-gnu"
     661                       
     662                        if (config['PLATFORM'] == "arm32"):
     663                                target = config['PLATFORM']
     664                                gnu_target = "arm-linux-gnueabi"
     665                       
     666                        if (config['PLATFORM'] == "ia32"):
     667                                target = config['PLATFORM']
     668                                gnu_target = "i686-pc-linux-gnu"
     669                       
     670                        if (config['PLATFORM'] == "ia64"):
     671                                target = config['PLATFORM']
     672                                gnu_target = "ia64-pc-linux-gnu"
     673                       
     674                        if (config['PLATFORM'] == "mips32"):
     675                                check_config(config, "MACHINE")
     676                                common['CC_ARGS'].append("-mabi=32")
     677                               
     678                                if ((config['MACHINE'] == "msim") or (config['MACHINE'] == "lmalta")):
     679                                        target = config['PLATFORM']
     680                                        gnu_target = "mipsel-linux-gnu"
     681                               
     682                                if ((config['MACHINE'] == "bmalta")):
     683                                        target = "mips32eb"
     684                                        gnu_target = "mips-linux-gnu"
     685                       
     686                        if (config['PLATFORM'] == "mips64"):
     687                                check_config(config, "MACHINE")
     688                                common['CC_ARGS'].append("-mabi=64")
     689                               
     690                                if (config['MACHINE'] == "msim"):
     691                                        target = config['PLATFORM']
     692                                        gnu_target = "mips64el-linux-gnu"
     693                       
     694                        if (config['PLATFORM'] == "ppc32"):
     695                                target = config['PLATFORM']
     696                                gnu_target = "ppc-linux-gnu"
     697                       
     698                        if (config['PLATFORM'] == "sparc64"):
     699                                target = config['PLATFORM']
     700                                gnu_target = "sparc64-linux-gnu"
    726701                       
    727702                        path = "%s/%s/bin" % (cross_prefix, target)
     
    733708                        check_common(common, "GCC")
    734709                        common['CC'] = common['GCC']
    735                         common['CC_ARGS'].extend(cc_args)
    736710               
    737711                if (config['COMPILER'] == "gcc_native"):
     
    749723               
    750724                if (config['COMPILER'] == "clang"):
    751                         target, cc_args, gnu_target, clang_target = get_target(config)
    752                        
    753                         if (target is None) or (gnu_target is None) or (clang_target is None):
    754                                 print_error(["Unsupported compiler target for clang.",
    755                                              "Please contact the developers of HelenOS."])
    756                        
    757                         path = "%s/%s/bin" % (cross_prefix, target)
    758                         prefix = "%s-" % gnu_target
    759                        
    760                         check_app(["clang", "--version"], "clang compiler", "preferably version 1.0 or newer")
    761                         check_gcc(path, prefix, common, PACKAGE_GCC)
    762                         check_binutils(path, prefix, common, PACKAGE_BINUTILS)
    763                        
    764                         check_common(common, "GCC")
    765725                        common['CC'] = "clang"
    766                         common['CC_ARGS'].extend(cc_args)
    767                         common['CC_ARGS'].append("-target")
    768                         common['CC_ARGS'].append(clang_target)
    769                         common['CLANG_TARGET'] = clang_target
     726                        check_app([common['CC'], "--version"], "Clang compiler", "preferably version 1.0 or newer")
     727                        check_gcc(None, "", common, PACKAGE_GCC)
     728                        check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
    770729               
    771730                # Platform-specific utilities
Note: See TracChangeset for help on using the changeset viewer.