function compute_compiler_info

%   Copyright 1995-2009 The MathWorks, Inc.

global gTargetInfo %#ok<GVMIS>

[gTargetInfo.compilerName, gTargetInfo.mexopt, gTargetInfo.compilerInfo] = figure_out_the_required_compiler();
gTargetInfo.codingMSVCMakefile  = 0;
gTargetInfo.codingLccMakefile     = 0;
gTargetInfo.codingUnixMakefile    = 0;
gTargetInfo.codingMinGWMakefile = 0;

if ~gTargetInfo.codingSFunction
   return;
end

switch gTargetInfo.compilerName
    case cgxeprivate('supportedPCCompilers','microsoft')
        gTargetInfo.codingMSVCMakefile    = 1;
    case 'lcc'
        gTargetInfo.codingLccMakefile     = 1;
    case 'unix'
        gTargetInfo.codingUnixMakefile    = 1;
    case cgxeprivate('supportedPCCompilers','mingw')
        gTargetInfo.codingMinGWMakefile = 1;
    otherwise
        gTargetInfo.codingLccMakefile     = 1;
        % WISH internal error
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [compilerName, mexopt,compilerInfo]= figure_out_the_required_compiler
global gTargetInfo %#ok<GVMIS>
 
compilerInfo = sfprivate('compilerman', 'get_compiler_info', gTargetInfo.gencpp);
if isunix
    compilerName = 'unix';
    mexopt = '';
else
    compilerName = compilerInfo.compilerName;
    mexopt = compilerInfo.MexOpt;
end

