cross-plat-dev-utils/get_hostplatform_dir.pm
changeset 2 39c28ec933dd
equal deleted inserted replaced
1:820b22e13ff1 2:39c28ec933dd
       
     1 #!/usr/bin/perl
       
     2 # Copyright (c) 2010 Symbian Foundation Ltd
       
     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 # Mike Kinghan, mikek@symbian.org, for Symbian Foundation Ltd - initial contribution.
       
    10 
       
    11 # Subroutines to get Raptor's value of HOSTPLATFORM_DIR
       
    12 
       
    13 use strict;
       
    14 use File::Spec;
       
    15 
       
    16 sub get_hostplatform_dir()
       
    17 {
       
    18 	my $any_old_targ = File::Spec->catfile("buildtoolguides","romtoolsguide");
       
    19 	my $build_log = perl_slurp("build_target.pl $any_old_targ --what 2> ". File::Spec->devnull());
       
    20 	$build_log =~ /<info>Environment HOSTPLATFORM_DIR=(\S*)<\/info>/;
       
    21 	my $host_platform_dir = $1;
       
    22 	die "*** Error: Can't determine HOSTPLATFORM_DIR ***", unless ($host_platform_dir);
       
    23 	return $host_platform_dir;
       
    24 }
       
    25 
       
    26 1;
       
    27 
       
    28