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