Changeset b08941d in mainline


Ignore:
Timestamp:
2017-10-09T15:33:26Z (7 years ago)
Author:
jzr <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
591b989
Parents:
07cb0108
Message:

Allow the cross-compiler toolchain path to be prefixed with
full target triple, not just the architecture name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autotool.py

    r07cb0108 rb08941d  
    209209
    210210def get_target(config):
    211         target = None
     211        platform = None
    212212        gnu_target = None
    213213        helenos_target = None
     214        target = None
    214215        cc_args = []
    215216       
    216217        if (config['PLATFORM'] == "abs32le"):
    217218                check_config(config, "CROSS_TARGET")
    218                 target = config['CROSS_TARGET']
     219                platform = config['CROSS_TARGET']
    219220               
    220221                if (config['CROSS_TARGET'] == "arm32"):
     
    232233       
    233234        if (config['PLATFORM'] == "amd64"):
    234                 target = config['PLATFORM']
     235                platform = config['PLATFORM']
    235236                gnu_target = "amd64-linux-gnu"
    236237                helenos_target = "amd64-helenos"
    237238       
    238239        if (config['PLATFORM'] == "arm32"):
    239                 target = config['PLATFORM']
     240                platform = config['PLATFORM']
    240241                gnu_target = "arm-linux-gnueabi"
    241242                helenos_target = "arm-helenos-gnueabi"
    242243       
    243244        if (config['PLATFORM'] == "ia32"):
    244                 target = config['PLATFORM']
     245                platform = config['PLATFORM']
    245246                gnu_target = "i686-pc-linux-gnu"
    246247                helenos_target = "i686-pc-helenos"
    247248       
    248249        if (config['PLATFORM'] == "ia64"):
    249                 target = config['PLATFORM']
     250                platform = config['PLATFORM']
    250251                gnu_target = "ia64-pc-linux-gnu"
    251252                helenos_target = "ia64-pc-helenos"
     
    256257               
    257258                if ((config['MACHINE'] == "msim") or (config['MACHINE'] == "lmalta")):
    258                         target = config['PLATFORM']
     259                        platform = config['PLATFORM']
    259260                        gnu_target = "mipsel-linux-gnu"
    260261                        helenos_target = "mipsel-helenos"
    261262               
    262263                if ((config['MACHINE'] == "bmalta")):
    263                         target = "mips32eb"
     264                        platform = "mips32eb"
    264265                        gnu_target = "mips-linux-gnu"
    265266                        helenos_target = "mips-helenos"
     
    270271               
    271272                if (config['MACHINE'] == "msim"):
    272                         target = config['PLATFORM']
     273                        platform = config['PLATFORM']
    273274                        gnu_target = "mips64el-linux-gnu"
    274275                        helenos_target = "mips64el-helenos"
    275276       
    276277        if (config['PLATFORM'] == "ppc32"):
    277                 target = config['PLATFORM']
     278                platform = config['PLATFORM']
    278279                gnu_target = "ppc-linux-gnu"
    279280                helenos_target = "ppc-helenos"
    280281       
    281282        if (config['PLATFORM'] == "riscv64"):
    282                 target = config['PLATFORM']
     283                platform = config['PLATFORM']
    283284                gnu_target = "riscv64-unknown-linux-gnu"
    284285                helenos_target = "riscv64-helenos"
    285286       
    286287        if (config['PLATFORM'] == "sparc64"):
    287                 target = config['PLATFORM']
     288                platform = config['PLATFORM']
    288289                gnu_target = "sparc64-linux-gnu"
    289290                helenos_target = "sparc64-helenos"
    290291       
    291         return (target, cc_args, gnu_target, helenos_target)
     292        if (config['COMPILER'] == "gcc_helenos"):
     293                target = helenos_target
     294        else:
     295                target = gnu_target
     296       
     297        return (platform, cc_args, target)
    292298
    293299def check_app(args, name, details):
     
    847853                check_app(["unzip"], "unzip utility", "usually part of zip/unzip utilities")
    848854               
     855                platform, cc_args, target = get_target(config)
     856               
     857                if (platform is None) or (target is None):
     858                        print_error(["Unsupported compiler target.",
     859                                     "Please contact the developers of HelenOS."])
     860               
     861                path = "%s/%s/bin" % (cross_prefix, target)
     862               
     863                # Compatibility with earlier toolchain paths.
     864                if not os.path.exists(path):
     865                        if (config['COMPILER'] == "gcc_helenos"):
     866                                check_path = "%s/%s/%s" % (cross_helenos_prefix, platform, target)
     867                                if not os.path.exists(check_path):
     868                                        print_error(["Toolchain for target is not installed, or CROSS_PREFIX is not set correctly."])
     869                                path = "%s/%s/bin" % (cross_helenos_prefix, platform)
     870                        else:
     871                                check_path = "%s/%s/%s" % (cross_prefix, platform, target)
     872                                if not os.path.exists(check_path):
     873                                        print_error(["Toolchain for target is not installed, or CROSS_PREFIX is not set correctly."])
     874                                path = "%s/%s/bin" % (cross_prefix, platform)
     875               
     876                prefix = "%s-" % target
     877               
    849878                # Compiler
    850                 if (config['COMPILER'] == "gcc_cross"):
    851                         target, cc_args, gnu_target, helenos_target = get_target(config)
    852                        
    853                         if (target is None) or (gnu_target is None):
    854                                 print_error(["Unsupported compiler target for GNU GCC.",
    855                                              "Please contact the developers of HelenOS."])
    856                        
    857                         path = "%s/%s/bin" % (cross_prefix, target)
    858                         prefix = "%s-" % gnu_target
    859                        
    860                         check_gcc(path, prefix, common, PACKAGE_CROSS)
    861                         check_binutils(path, prefix, common, PACKAGE_CROSS)
    862                        
    863                         check_common(common, "GCC")
    864                         common['CC'] = " ".join([common['GCC']] + cc_args)
    865                         common['CC_AUTOGEN'] = common['CC']
    866                
    867                 if (config['COMPILER'] == "gcc_helenos"):
    868                         target, cc_args, gnu_target, helenos_target = get_target(config)
    869                        
    870                         if (target is None) or (helenos_target is None):
    871                                 print_error(["Unsupported compiler target for GNU GCC.",
    872                                              "Please contact the developers of HelenOS."])
    873                        
    874                         path = "%s/%s/bin" % (cross_helenos_prefix, target)
    875                         prefix = "%s-" % helenos_target
    876                        
     879                if (config['COMPILER'] == "gcc_cross" or config['COMPILER'] == "gcc_helenos"):
    877880                        check_gcc(path, prefix, common, PACKAGE_CROSS)
    878881                        check_binutils(path, prefix, common, PACKAGE_CROSS)
     
    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.",
    905                                              "Please contact the developers of HelenOS."])
    906                        
    907                         path = "%s/%s/bin" % (cross_prefix, target)
    908                         prefix = "%s-" % gnu_target
    909                        
    910904                        check_binutils(path, prefix, common, PACKAGE_CROSS)
    911905                        check_clang(path, prefix, common, PACKAGE_CLANG)
Note: See TracChangeset for help on using the changeset viewer.