sbsv1/abld/e32util/_secure_E32Env.pm
author Ross Qin <ross.qin@nokia.com>
Tue, 30 Nov 2010 13:59:58 +0800
changeset 712 df89378e9223
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Fix these errors: Some cases of PREQ1230 fail because of buildrom issue rombuild crashs when create ext-romimage readimage crashes on reading wk42 vasco_ui core image vc2008 compiling issues
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 1997-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
# E32ENV.PM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
# Contains information for makmake and associated e32tools perl programs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
# within the Epoc32 Environment
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
# 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
package E32env;
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
use vars qw(%Data);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
BEGIN {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
	my $epocroot = $ENV{EPOCROOT};
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
	die "ERROR: Must set the EPOCROOT environment variable\n" if (!defined($epocroot));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
	$epocroot =~ s-/-\\-go;	# for those working with UNIX shells
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
	$epocroot =~ s/^ +//;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
	$epocroot =~ s/ +$//;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
	$ENV{EPOCROOT} = $epocroot;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
	die "ERROR: EPOCROOT must not include a drive letter\n" if ($epocroot =~ /^.:/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
	die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\\/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
	die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\\\\/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
	die "ERROR: EPOCROOT must end with a backslash\n" if ($epocroot !~ /\\$/);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
 	open PIPE, "set EPOCROOT |";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
 	my $found=0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
	while (<PIPE>) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
		if (/^EPOCROOT=.*/) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
			$found=1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
			last;
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
	close PIPE;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
	die "EPOCROOT environment variable must be capitalised\n" if (!$found);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
	print "WARNING: EPOCROOT does not specify an existing directory\n" if (!-d $epocroot);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
	$epocroot=~ s-\\$--;		# chop trailing \\
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
	$Data{EPOCPath} = $epocroot."\\epoc32\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
	$Data{EPOCDataPath} = $epocroot."\\epoc32\\data\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
	$Data{EPOCIncPath} = $epocroot."\\epoc32\\include\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
	$Data{BldPath} = $epocroot."\\EPOC32\\BUILD\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
	$Data{LinkPath} = $epocroot."\\epoc32\\release\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
	$Data{RelPath} = $epocroot."\\epoc32\\release\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
	$Data{EPOCToolsPath} = $epocroot."\\epoc32\\tools\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
	$Data{RomPath} = $epocroot."\\epoc32\\rom\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
	$Data{DataPath} = "z\\system\\data\\";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61
	
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    62
	$Data{SecurePlatform} = 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    63
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    64
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    65
1;