function buildToolsStruct = getBuildToolsInfo(config)
%GETBUILDTOOLSINFO for compatibility with legacy code, will be deleted with
%   g1846289.

%   Copyright 2012-2018 The MathWorks, Inc.

    if isa(config, 'Simulink.ConfigSet')
        lToolchainName = get_param(config, 'Toolchain');
    else
        lToolchainName = config.Toolchain;
    end
    
    lToolchainInfo = coder.make.internal.getToolchainInfoFromName(lToolchainName);
    
    buildToolsStruct = struct('ToolchainInfo', {lToolchainInfo}, 'Toolchain', {lToolchainInfo.Name});
