imgtools/buildrom/tools/romosvariant.pm
author marvin shi <marvin.shi@nokia.com>
Wed, 17 Nov 2010 14:05:07 +0800
changeset 691 9eeecb73a5d4
parent 600 6d08f4a05d93
permissions -rw-r--r--
fix ou1cimx1#651819
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
600
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     1
# Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     2
# All rights reserved.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     3
# This component and the accompanying materials are made available
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     5
# which accompanies this distribution, and is available
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     7
#
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     8
# Initial Contributors:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    10
#
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    11
# Contributors:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    12
#
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    13
# Description:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    14
# Collection of utilitiy functions which is copied from Symbian OS perl modules. 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    15
# It provides platform related information to ROM Tools including buildrom, 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    16
# features.pl, etc.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    17
# 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    18
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    19
package romosvariant;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    20
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    21
require Exporter;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    22
@ISA=qw(Exporter);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    23
@EXPORT=qw(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    24
	os_name
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    25
	is_windows
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    26
	is_linux
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    27
	env_delimiter
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    28
	path_delimiter
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    29
);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    30
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    31
use strict;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    32
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    33
sub os_name
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    34
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    35
	return $^O;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    36
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    37
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    38
sub is_windows
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    39
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    40
	if ($^O =~ /^MSWin32$/i){
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    41
		return 1;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    42
	}else{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    43
		return 0;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    44
	}	
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    45
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    46
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    47
sub is_linux
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    48
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    49
	if ($^O =~ /^MSWin32$/i){
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    50
		return 0;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    51
	}else{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    52
		return 1;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    53
	}	
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    54
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    55
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    56
sub env_delimiter
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    57
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    58
	if ($^O =~ /^MSWin32$/i){
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    59
		return ";";
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    60
	}else{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    61
		return ":";
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    62
	}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    63
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    64
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    65
sub path_delimiter
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    66
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    67
	if ($^O =~ /^MSWin32$/i){
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    68
		return "\\";
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    69
	}else{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    70
		return "\/";
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    71
	}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    72
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    73
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    74
1;