Subversion Repositories DevTools

Rev

Rev 325 | Rev 331 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 325 Rev 329
Line 3353... Line 3353...
3353
#                                   Not all options are avalaible on all variables
3353
#                                   Not all options are avalaible on all variables
3354
#                   @opts           - Options
3354
#                   @opts           - Options
3355
#                                       --notag     - Default is --notag
3355
#                                       --notag     - Default is --notag
3356
#
3356
#
3357
# Returns         : String
3357
# Returns         : String
-
 
3358
#                   is_path
-
 
3359
#                   is_abs
3358
#
3360
#
3359
 
3361
 
3360
#
3362
#
3361
#   Create a Hash to simplify the process of converting Var names
3363
#   Create a Hash to simplify the process of converting Var names
3362
#   into makefile variables.
3364
#   into makefile variables.
Line 3401... Line 3403...
3401
    'BuildRoot'         => '$(GBE_ROOT),+',
3403
    'BuildRoot'         => '$(GBE_ROOT),+',
3402
 
3404
 
3403
 
3405
 
3404
    'Verbose'           => '$(CC_PRE)',
3406
    'Verbose'           => '$(CC_PRE)',
3405
    'LeaveTmp'          => '$(LEAVETMP)',
3407
    'LeaveTmp'          => '$(LEAVETMP)',
3406
    'Cwd'               => '$(CURDIR)',
3408
    'Cwd'               => '$(CURDIR),-',
3407
 
3409
 
3408
    'CompilerPath'      => '$(SCM_COMPILERPATH)',
3410
    'CompilerPath'      => '$(SCM_COMPILERPATH)',
3409
    );
3411
    );
3410
 
3412
 
3411
sub ExpandGenVar
3413
sub ExpandGenVar
Line 3415... Line 3417...
3415
    my $prefix='';
3417
    my $prefix='';
3416
    my ($tag, @opts) = split('\s*,\s*', $args);
3418
    my ($tag, @opts) = split('\s*,\s*', $args);
3417
    my $no_prefix;
3419
    my $no_prefix;
3418
    my $default_value;
3420
    my $default_value;
3419
    my $allow_none;
3421
    my $allow_none;
-
 
3422
    my $is_abs = 0;
3420
 
3423
 
3421
    #
3424
    #
3422
    #   Parse options lists
3425
    #   Parse options lists
3423
    #       Options provided by the caller
3426
    #       Options provided by the caller
3424
    #       Options embedded in the argument
3427
    #       Options embedded in the argument
Line 3467... Line 3470...
3467
            unless ( $expansion );
3470
            unless ( $expansion );
3468
    }
3471
    }
3469
 
3472
 
3470
 
3473
 
3471
    ($expansion,my $is_path) = split (',', $expansion );
3474
    ($expansion,my $is_path) = split (',', $expansion );
-
 
3475
    $is_abs = 1
-
 
3476
        if ($is_path && $is_path eq '-' );
3472
 
3477
 
3473
    #
3478
    #
3474
    #   Process options
3479
    #   Process options
3475
    #   Assume that a tag will be provided
3480
    #   Assume that a tag will be provided
3476
    #
3481
    #
Line 3484... Line 3489...
3484
            $prefix = "-$tag=";
3489
            $prefix = "-$tag=";
3485
 
3490
 
3486
        } elsif ( $opt =~ m/^--notag/i ) {
3491
        } elsif ( $opt =~ m/^--notag/i ) {
3487
            $prefix = '';
3492
            $prefix = '';
3488
 
3493
 
3489
        } elsif ( $is_path && $opt =~ /--abspath|--absdrive/i ) {
3494
        } elsif ( $is_path && !$is_abs && $opt =~ /--abspath|--absdrive/i ) {
3490
            $expansion = '$(CURDIR)/' . $expansion;
3495
            $expansion = '$(CURDIR)/' . $expansion;
-
 
3496
            $is_abs = 1;
3491
 
3497
 
3492
        } elsif ( $opt =~ m/^--default=(.+)/i ) {
3498
        } elsif ( $opt =~ m/^--default=(.+)/i ) {
3493
            # Already processed
3499
            # Already processed
3494
        } elsif ( $opt =~ m/^--allownone$/i ) {
3500
        } elsif ( $opt =~ m/^--allownone$/i ) {
3495
            # Already processed
3501
            # Already processed
Line 3497... Line 3503...
3497
            Error ("$dname: Unsupported option($opt) for --Var(@_)");
3503
            Error ("$dname: Unsupported option($opt) for --Var(@_)");
3498
        }
3504
        }
3499
    }
3505
    }
3500
 
3506
 
3501
    Debug ("ExpandGenVar: args $args --> $prefix$expansion");
3507
    Debug ("ExpandGenVar: args $args --> $prefix$expansion");
3502
    return $prefix . $expansion;
3508
    return $prefix . $expansion, $is_path ? 1 : 0, $is_abs;
3503
 
3509
 
3504
}
3510
}
3505
 
3511
 
3506
#-------------------------------------------------------------------------------
3512
#-------------------------------------------------------------------------------
3507
# Function        : ProcessPathName
3513
# Function        : ProcessPathName
Line 4622... Line 4628...
4622
            my $mb = $-[0];                     # Match begin offset
4628
            my $mb = $-[0];                     # Match begin offset
4623
            my $me = $+[0];                     # Match end
4629
            my $me = $+[0];                     # Match end
4624
            my $flags = '';                     # Optional flags ( --dir or --file )
4630
            my $flags = '';                     # Optional flags ( --dir or --file )
4625
            my $raw_arg = $ufn;                 # Raw arguments
4631
            my $raw_arg = $ufn;                 # Raw arguments
4626
            my $all = substr( $arg, $mb, $me ); # All of match. Avoid use of $&
4632
            my $all = substr( $arg, $mb, $me ); # All of match. Avoid use of $&
-
 
4633
            my $is_abs;
-
 
4634
            my $is_path = 1;
4627
 
4635
 
4628
            Error ("RunTest. Empty element not allowed: $all")
4636
            Error ("RunTest. Empty element not allowed: $all")
4629
                unless ( defined($ufn) );
4637
                unless ( defined($ufn) );
4630
 
4638
 
4631
            $ufn =~ s/\s+$//;
4639
            $ufn =~ s/\s+$//;
Line 4666... Line 4674...
4666
            {
4674
            {
4667
                $fn = GetPackageInfo( "RunTest", $raw_arg );
4675
                $fn = GetPackageInfo( "RunTest", $raw_arg );
4668
            }
4676
            }
4669
            elsif ( $cmd =~ /^Var/ )
4677
            elsif ( $cmd =~ /^Var/ )
4670
            {
4678
            {
4671
                $fn = ExpandGenVar( "RunTest", $raw_arg );
4679
                ($fn, $is_path, $is_abs) = ExpandGenVar( "RunTest", $raw_arg );
4672
                $flags = '';
4680
                $flags = '';
4673
            }
4681
            }
4674
            elsif ( $cmd =~ /^Local/ )
4682
            elsif ( $cmd =~ /^Local/ )
4675
            {
4683
            {
4676
                $fn = '$(LOCALDIR)/' . $ufn ;
4684
                $fn = '$(LOCALDIR)/' . $ufn ;
Line 4694... Line 4702...
4694
            #
4702
            #
4695
            #   The program is going to be executed within a subdirectory
4703
            #   The program is going to be executed within a subdirectory
4696
            #   so add one more level of indirection to the path, but only if
4704
            #   so add one more level of indirection to the path, but only if
4697
            #   the path is relative
4705
            #   the path is relative
4698
            #
4706
            #
4699
            unless ( $fn =~ m~^/|\w:/~  )
4707
            if ( $is_path && ! $is_abs )
4700
            {
4708
            {
-
 
4709
                unless ( $fn =~ m~^/|^\w:/~  )
-
 
4710
                {
4701
                $fn = '../' . $fn;
4711
                    $fn = '../' . $fn
-
 
4712
                        unless( $fn =~ s~=~=../~ );
4702
                $fn =~ s~/.$~~;
4713
                    $fn =~ s~/.$~~;
-
 
4714
                }
4703
            }
4715
            }
4704
 
4716
 
4705
            #
4717
            #
4706
            #   Minor kludge under windows. Ensure directores have a "\" sep
4718
            #   Minor kludge under windows. Ensure directores have a "\" sep
4707
            #   Unless the user has specified a straight shell command
4719
            #   Unless the user has specified a straight shell command