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


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autotool.py

    r6db5d4b ra4a0f1d  
    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"
     
    640563        outmk.write('#########################################\n')
    641564        outmk.write('## AUTO-GENERATED FILE, DO NOT EDIT!!! ##\n')
    642         outmk.write('## Generated by: tools/autotool.py     ##\n')
    643565        outmk.write('#########################################\n\n')
    644566       
     
    658580        outhd.write('/***************************************\n')
    659581        outhd.write(' * AUTO-GENERATED FILE, DO NOT EDIT!!! *\n')
    660         outhd.write(' * Generated by: tools/autotool.py     *\n')
    661582        outhd.write(' ***************************************/\n\n')
    662583       
     
    719640                common['CC_ARGS'] = []
    720641                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."])
     642                        if (config['PLATFORM'] == "abs32le"):
     643                                check_config(config, "CROSS_TARGET")
     644                                target = config['CROSS_TARGET']
     645                               
     646                                if (config['CROSS_TARGET'] == "arm32"):
     647                                        gnu_target = "arm-linux-gnueabi"
     648                               
     649                                if (config['CROSS_TARGET'] == "ia32"):
     650                                        gnu_target = "i686-pc-linux-gnu"
     651                               
     652                                if (config['CROSS_TARGET'] == "mips32"):
     653                                        gnu_target = "mipsel-linux-gnu"
     654                                        common['CC_ARGS'].append("-mabi=32")
     655                       
     656                        if (config['PLATFORM'] == "amd64"):
     657                                target = config['PLATFORM']
     658                                gnu_target = "amd64-linux-gnu"
     659                       
     660                        if (config['PLATFORM'] == "arm32"):
     661                                target = config['PLATFORM']
     662                                gnu_target = "arm-linux-gnueabi"
     663                       
     664                        if (config['PLATFORM'] == "ia32"):
     665                                target = config['PLATFORM']
     666                                gnu_target = "i686-pc-linux-gnu"
     667                       
     668                        if (config['PLATFORM'] == "ia64"):
     669                                target = config['PLATFORM']
     670                                gnu_target = "ia64-pc-linux-gnu"
     671                       
     672                        if (config['PLATFORM'] == "mips32"):
     673                                check_config(config, "MACHINE")
     674                                common['CC_ARGS'].append("-mabi=32")
     675                               
     676                                if ((config['MACHINE'] == "lgxemul") or (config['MACHINE'] == "msim")):
     677                                        target = config['PLATFORM']
     678                                        gnu_target = "mipsel-linux-gnu"
     679                               
     680                                if (config['MACHINE'] == "bgxemul"):
     681                                        target = "mips32eb"
     682                                        gnu_target = "mips-linux-gnu"
     683                       
     684                        if (config['PLATFORM'] == "mips64"):
     685                                check_config(config, "MACHINE")
     686                                common['CC_ARGS'].append("-mabi=64")
     687                               
     688                                if (config['MACHINE'] == "msim"):
     689                                        target = config['PLATFORM']
     690                                        gnu_target = "mips64el-linux-gnu"
     691                       
     692                        if (config['PLATFORM'] == "ppc32"):
     693                                target = config['PLATFORM']
     694                                gnu_target = "ppc-linux-gnu"
     695                       
     696                        if (config['PLATFORM'] == "sparc64"):
     697                                target = config['PLATFORM']
     698                                gnu_target = "sparc64-linux-gnu"
    726699                       
    727700                        path = "%s/%s/bin" % (cross_prefix, target)
     
    733706                        check_common(common, "GCC")
    734707                        common['CC'] = common['GCC']
    735                         common['CC_ARGS'].extend(cc_args)
    736708               
    737709                if (config['COMPILER'] == "gcc_native"):
     
    748720                        check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
    749721               
     722                if (config['COMPILER'] == "suncc"):
     723                        common['CC'] = "suncc"
     724                        check_app([common['CC'], "-V"], "Sun Studio Compiler", "support is experimental")
     725                        check_gcc(None, "", common, PACKAGE_GCC)
     726                        check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
     727               
    750728                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")
    765729                        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
     730                        check_app([common['CC'], "--version"], "Clang compiler", "preferably version 1.0 or newer")
     731                        check_gcc(None, "", common, PACKAGE_GCC)
     732                        check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
    770733               
    771734                # Platform-specific utilities
Note: See TracChangeset for help on using the changeset viewer.