imgtools/buildrom/tools/romosvariant.pm
changeset 607 378360dbbdba
parent 600 6d08f4a05d93
equal deleted inserted replaced
591:22486c9c7b15 607:378360dbbdba
       
     1 # Copyright (c) 2006-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 the License "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 # Collection of utilitiy functions which is copied from Symbian OS perl modules. 
       
    15 # It provides platform related information to ROM Tools including buildrom, 
       
    16 # features.pl, etc.
       
    17 # 
       
    18 
       
    19 package romosvariant;
       
    20 
       
    21 require Exporter;
       
    22 @ISA=qw(Exporter);
       
    23 @EXPORT=qw(
       
    24 	os_name
       
    25 	is_windows
       
    26 	is_linux
       
    27 	env_delimiter
       
    28 	path_delimiter
       
    29 );
       
    30 
       
    31 use strict;
       
    32 
       
    33 sub os_name
       
    34 {
       
    35 	return $^O;
       
    36 }
       
    37 
       
    38 sub is_windows
       
    39 {
       
    40 	if ($^O =~ /^MSWin32$/i){
       
    41 		return 1;
       
    42 	}else{
       
    43 		return 0;
       
    44 	}	
       
    45 }
       
    46 
       
    47 sub is_linux
       
    48 {
       
    49 	if ($^O =~ /^MSWin32$/i){
       
    50 		return 0;
       
    51 	}else{
       
    52 		return 1;
       
    53 	}	
       
    54 }
       
    55 
       
    56 sub env_delimiter
       
    57 {
       
    58 	if ($^O =~ /^MSWin32$/i){
       
    59 		return ";";
       
    60 	}else{
       
    61 		return ":";
       
    62 	}
       
    63 }
       
    64 
       
    65 sub path_delimiter
       
    66 {
       
    67 	if ($^O =~ /^MSWin32$/i){
       
    68 		return "\\";
       
    69 	}else{
       
    70 		return "\/";
       
    71 	}
       
    72 }
       
    73 
       
    74 1;