sbsv1_os/e32toolp/toolinfo/gcce_plat2set.pm
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 27 Apr 2010 17:48:57 +0300
branchRCL_3
changeset 6 5e522efbae7b
parent 2 99082257a271
child 16 22bdd8a90cc4
permissions -rw-r--r--
Revision: 201017 Kit: 201017

# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description:
# This module provides a mapping from build platforms (e.g. GCCE) to the
# corresponding GCC-E environment settings.
# Currently this module only provides very simple functionality. The intention is
# that if we're going to support different GCC-E versions for different build
# platforms (as we do for RVCT) this module should be extended to provide similar
# functionality to rvct_plat2set.
# 
#

package gcce_plat2set;
use strict;


# Returns the GCCE version corresponding to the given build platform. The first
# function returns the data as a string (e.g. "4.2.3"); the second function
# returns the data as a list (e.g. [4,2,3]).
sub get_version_string($);
sub get_version_list($);

# Returns true if a GCC-E version for the given platform exists.
sub compiler_exists($);


my $g_version;


sub get_version_string($)
{
    return $g_version;
}

sub get_version_list($)
{
    return split(/\./, $g_version);
}

sub compiler_exists($)
{
    if ($g_version)
    {
        return 1;
    }
    else
    {
        return 0;
    }
}

BEGIN
{
    my $vers = qx/arm-none-symbianelf-gcc -dumpversion 2>&1/;

    if ($vers =~ /^\s*(\d+\.\d+.\d+)\s*$/)
    {
        $g_version = "$1";
    }
}


1;