sbsv1_os/e32toolp/toolinfo/gcce_plat2set.pm
changeset 0 83f4b4db085c
child 1 d4b442d23379
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     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 use strict;
       
    25 
       
    26 
       
    27 # Returns the GCCE version corresponding to the given build platform. The first
       
    28 # function returns the data as a string (e.g. "4.2.3"); the second function
       
    29 # returns the data as a list (e.g. [4,2,3]).
       
    30 sub get_version_string($);
       
    31 sub get_version_list($);
       
    32 
       
    33 # Returns true if a GCC-E version for the given platform exists.
       
    34 sub compiler_exists($);
       
    35 
       
    36 
       
    37 my $g_version;
       
    38 
       
    39 
       
    40 sub get_version_string($)
       
    41 {
       
    42     return $g_version;
       
    43 }
       
    44 
       
    45 sub get_version_list($)
       
    46 {
       
    47     return split(/\./, $g_version);
       
    48 }
       
    49 
       
    50 sub compiler_exists($)
       
    51 {
       
    52     if ($g_version)
       
    53     {
       
    54         return 1;
       
    55     }
       
    56     else
       
    57     {
       
    58         return 0;
       
    59     }
       
    60 }
       
    61 
       
    62 BEGIN
       
    63 {
       
    64     my $vers = qx/arm-none-symbianelf-gcc -dumpversion 2>&1/;
       
    65 
       
    66     if ($vers =~ /^\s*(\d+\.\d+.\d+)\s*$/)
       
    67     {
       
    68         $g_version = "$1";
       
    69     }
       
    70 }
       
    71 
       
    72 
       
    73 1;
       
    74 
       
    75