Changeset 39ba6d5 in mainline


Ignore:
Timestamp:
2013-03-10T21:59:23Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1570759b
Parents:
c8752175
Message:

clang needs cross-binutils as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autotool.py

    rc8752175 r39ba6d5  
    181181                print_error(["Failed to determine the value %s." % key,
    182182                             "Please contact the developers of HelenOS."])
     183
     184def get_target(config):
     185        target = None
     186        gnu_target = None
     187       
     188        if (config['PLATFORM'] == "abs32le"):
     189                check_config(config, "CROSS_TARGET")
     190                target = config['CROSS_TARGET']
     191               
     192                if (config['CROSS_TARGET'] == "arm32"):
     193                        gnu_target = "arm-linux-gnueabi"
     194               
     195                if (config['CROSS_TARGET'] == "ia32"):
     196                        gnu_target = "i686-pc-linux-gnu"
     197               
     198                if (config['CROSS_TARGET'] == "mips32"):
     199                        gnu_target = "mipsel-linux-gnu"
     200                        common['CC_ARGS'].append("-mabi=32")
     201       
     202        if (config['PLATFORM'] == "amd64"):
     203                target = config['PLATFORM']
     204                gnu_target = "amd64-linux-gnu"
     205       
     206        if (config['PLATFORM'] == "arm32"):
     207                target = config['PLATFORM']
     208                gnu_target = "arm-linux-gnueabi"
     209       
     210        if (config['PLATFORM'] == "ia32"):
     211                target = config['PLATFORM']
     212                gnu_target = "i686-pc-linux-gnu"
     213       
     214        if (config['PLATFORM'] == "ia64"):
     215                target = config['PLATFORM']
     216                gnu_target = "ia64-pc-linux-gnu"
     217       
     218        if (config['PLATFORM'] == "mips32"):
     219                check_config(config, "MACHINE")
     220                common['CC_ARGS'].append("-mabi=32")
     221               
     222                if ((config['MACHINE'] == "lgxemul") or (config['MACHINE'] == "msim")):
     223                        target = config['PLATFORM']
     224                        gnu_target = "mipsel-linux-gnu"
     225               
     226                if (config['MACHINE'] == "bgxemul"):
     227                        target = "mips32eb"
     228                        gnu_target = "mips-linux-gnu"
     229       
     230        if (config['PLATFORM'] == "mips64"):
     231                check_config(config, "MACHINE")
     232                common['CC_ARGS'].append("-mabi=64")
     233               
     234                if (config['MACHINE'] == "msim"):
     235                        target = config['PLATFORM']
     236                        gnu_target = "mips64el-linux-gnu"
     237       
     238        if (config['PLATFORM'] == "ppc32"):
     239                target = config['PLATFORM']
     240                gnu_target = "ppc-linux-gnu"
     241       
     242        if (config['PLATFORM'] == "sparc64"):
     243                target = config['PLATFORM']
     244                gnu_target = "sparc64-linux-gnu"
     245       
     246        if (target is None) or (gnu_target is None):
     247                print_error(["Failed to determine target for compiler.",
     248                             "Please contact the developers of HelenOS."])
     249       
     250        return (target, gnu_target)
    183251
    184252def check_app(args, name, details):
     
    642710                common['CC_ARGS'] = []
    643711                if (config['COMPILER'] == "gcc_cross"):
    644                         if (config['PLATFORM'] == "abs32le"):
    645                                 check_config(config, "CROSS_TARGET")
    646                                 target = config['CROSS_TARGET']
     712                        target, gnu_target = get_target(config)
    647713                               
    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'] == "lgxemul") or (config['MACHINE'] == "msim")):
    679                                         target = config['PLATFORM']
    680                                         gnu_target = "mipsel-linux-gnu"
    681                                
    682                                 if (config['MACHINE'] == "bgxemul"):
    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"
    701                        
    702714                        path = "%s/%s/bin" % (cross_prefix, target)
    703715                        prefix = "%s-" % gnu_target
     
    723735               
    724736                if (config['COMPILER'] == "clang"):
     737                        target, gnu_target = get_target(config)
     738                        path = "%s/%s/bin" % (cross_prefix, target)
     739                        prefix = "%s-" % gnu_target
     740                       
    725741                        common['CC'] = "clang"
    726742                        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)
     743                        check_gcc(path, prefix, common, PACKAGE_GCC)
     744                        check_binutils(path, prefix, common, PACKAGE_BINUTILS)
    729745               
    730746                # Platform-specific utilities
Note: See TracChangeset for help on using the changeset viewer.