sbsv1/abld/toolinfo/gcce_plat2set.pm
changeset 599 fa7a3cc6effd
equal deleted inserted replaced
596:9f25be3da657 599:fa7a3cc6effd
       
     1 # Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of "Eclipse Public License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Nokia Corporation - initial contribution.
       
    10 #
       
    11 # Contributors:
       
    12 #
       
    13 # Description:
       
    14 # This module provides a mapping from build platforms (e.g. GCCE) to the
       
    15 # corresponding GCC-E environment settings.
       
    16 # Currently this module only provides very simple functionality. The intention is
       
    17 # that if we're going to support different GCC-E versions for different build
       
    18 # platforms (as we do for RVCT) this module should be extended to provide similar
       
    19 # functionality to rvct_plat2set.
       
    20 # 
       
    21 #
       
    22 
       
    23 package gcce_plat2set;
       
    24 
       
    25 
       
    26 # Returns the GCCE version corresponding to the given build platform. The first
       
    27 # function returns the data as a string (e.g. "4.2.3"); the second function
       
    28 # returns the data as a list (e.g. [4,2,3]).
       
    29 sub get_version_string($);
       
    30 sub get_version_list($);
       
    31 
       
    32 # Returns true if a GCC-E version for the given platform exists.
       
    33 sub compiler_exists($);
       
    34 
       
    35 
       
    36 my $g_version;
       
    37 
       
    38 
       
    39 sub get_version_string($)
       
    40 {
       
    41     return $g_version;
       
    42 }
       
    43 
       
    44 sub get_version_list($)
       
    45 {
       
    46     return split(/\./, $g_version);
       
    47 }
       
    48 
       
    49 sub compiler_exists($)
       
    50 {
       
    51     if ($g_version)
       
    52     {
       
    53         return 1;
       
    54     }
       
    55     else
       
    56     {
       
    57         return 0;
       
    58     }
       
    59 }
       
    60 
       
    61 BEGIN
       
    62 {
       
    63     my $vers = qx/arm-none-symbianelf-gcc -dumpversion 2>&1/;
       
    64 
       
    65     if ($vers =~ /^\s*(\d+\.\d+.\d+)\s*$/)
       
    66     {
       
    67         $g_version = "$1";
       
    68     }
       
    69 }
       
    70 
       
    71 
       
    72 1;
       
    73 
       
    74