sbsv1_os/e32toolp/e32util/_secure_E32Env.pm
changeset 0 83f4b4db085c
child 1 d4b442d23379
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     1 # Copyright (c) 1997-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 # E32ENV.PM
       
    15 # Contains information for makmake and associated e32tools perl programs
       
    16 # within the Epoc32 Environment
       
    17 # 
       
    18 #
       
    19 
       
    20 package E32env;
       
    21 
       
    22 use strict;
       
    23 
       
    24 use vars qw(%Data);
       
    25 
       
    26 BEGIN {
       
    27 	my $epocroot = $ENV{EPOCROOT};
       
    28 	die "ERROR: Must set the EPOCROOT environment variable\n" if (!defined($epocroot));
       
    29 	$epocroot =~ s-/-\\-go;	# for those working with UNIX shells
       
    30 	$epocroot =~ s/^ +//;
       
    31 	$epocroot =~ s/ +$//;
       
    32 	$ENV{EPOCROOT} = $epocroot;
       
    33 	die "ERROR: EPOCROOT must not include a drive letter\n" if ($epocroot =~ /^.:/);
       
    34 	die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\\/);
       
    35 	die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\\\\/);
       
    36 	die "ERROR: EPOCROOT must end with a backslash\n" if ($epocroot !~ /\\$/);
       
    37  	open PIPE, "set EPOCROOT |";
       
    38  	my $found=0;
       
    39 	while (<PIPE>) {
       
    40 		if (/^EPOCROOT=.*/) {
       
    41 			$found=1;
       
    42 			last;
       
    43 		}
       
    44 	}
       
    45 	close PIPE;
       
    46 	die "EPOCROOT environment variable must be capitalised\n" if (!$found);
       
    47 	print "WARNING: EPOCROOT does not specify an existing directory\n" if (!-d $epocroot);
       
    48 
       
    49 	$epocroot=~ s-\\$--;		# chop trailing \\
       
    50 
       
    51 	$Data{EPOCPath} = $epocroot."\\epoc32\\";
       
    52 
       
    53 	$Data{EPOCDataPath} = $epocroot."\\epoc32\\data\\";
       
    54 	$Data{EPOCIncPath} = $epocroot."\\epoc32\\include\\";
       
    55 	$Data{BldPath} = $epocroot."\\EPOC32\\BUILD\\";
       
    56 	$Data{LinkPath} = $epocroot."\\epoc32\\release\\";
       
    57 	$Data{RelPath} = $epocroot."\\epoc32\\release\\";
       
    58 	$Data{EPOCToolsPath} = $epocroot."\\epoc32\\tools\\";
       
    59 	$Data{RomPath} = $epocroot."\\epoc32\\rom\\";
       
    60 
       
    61 	$Data{DataPath} = "z\\system\\data\\";
       
    62 	
       
    63 	$Data{SecurePlatform} = 1;
       
    64 }
       
    65 
       
    66 1;