Subversion Repositories DevTools

Rev

Rev 4836 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4836 Rev 4837
Line 37... Line 37...
37
# Symbols to autoexport (:DEFAULT tag)
37
# Symbols to autoexport (:DEFAULT tag)
38
@EXPORT = qw(
38
@EXPORT = qw(
39
                AllocateParsedConfig
39
                AllocateParsedConfig
40
                WriteParsedConfig
40
                WriteParsedConfig
41
                WriteCommonInfo
41
                WriteCommonInfo
-
 
42
                GetMakfilefileUid
42
            );
43
            );
43
 
44
 
44
#
45
#
45
#   Global data
46
#   Global data
46
#
47
#
Line 49... Line 50...
49
our %cf_info2;
50
our %cf_info2;
50
 
51
 
51
#
52
#
52
#   Local Data
53
#   Local Data
53
#
54
#
-
 
55
my $fmtVersion = 1;                 # Data Format. Must match in readers: jmake.pl
54
my $cfg_file;                       # Last file read
56
my $cfg_file;                       # Last file read
55
 
-
 
-
 
57
my $cfg_uid;                        # Last file Unique Index
56
 
58
 
57
#-------------------------------------------------------------------------------
59
#-------------------------------------------------------------------------------
58
# Function        : CheckGlobals
60
# Function        : CheckGlobals
59
#
61
#
60
# Description     : Validate assumptions on global variables
62
# Description     : Validate assumptions on global variables
Line 168... Line 170...
168
        #   Ensure that it doesn't exist. May be left over from another life
170
        #   Ensure that it doesn't exist. May be left over from another life
169
        #
171
        #
170
        unlink "$::ScmRoot/$::ScmInterface/$cfg_file";
172
        unlink "$::ScmRoot/$::ScmInterface/$cfg_file";
171
    }
173
    }
172
 
174
 
-
 
175
    $cfg_file =~ m~Makefile_(.*)\.cfg~;
-
 
176
    $cfg_uid = $1;
-
 
177
 
173
    return $cfg_file;
178
    return $cfg_file;
174
}
179
}
175
 
180
 
176
#-------------------------------------------------------------------------------
181
#-------------------------------------------------------------------------------
-
 
182
# Function        : GetMakfilefileUid 
-
 
183
#
-
 
184
# Description     : Return the Makefile's Unqiue ID
-
 
185
#
-
 
186
# Inputs          : None 
-
 
187
#
-
 
188
# Returns         : Numeric ID
-
 
189
#
-
 
190
sub GetMakfilefileUid
-
 
191
{
-
 
192
    AllocateParsedConfig();
-
 
193
    return $cfg_uid;
-
 
194
}
-
 
195
 
-
 
196
#-------------------------------------------------------------------------------
177
# Function        : WriteParsedConfig
197
# Function        : WriteParsedConfig
178
#
198
#
179
# Description     : Adds information to the Parsed Config File
199
# Description     : Adds information to the Parsed Config File
180
#                   Does not handle complex structures as a deep copy is
200
#                   Does not handle complex structures as a deep copy is
181
#                   not used. In the current implementation this is OK.
201
#                   not used. In the current implementation this is OK.
Line 257... Line 277...
257
 
277
 
258
    #
278
    #
259
    #   Prepare the data
279
    #   Prepare the data
260
    #
280
    #
261
    %cf_info2 = ();
281
    %cf_info2 = ();
262
    $cf_info2{version} = 1;
282
    $cf_info2{version} = $fmtVersion;
263
    $cf_info2{subdirs} = $SUBDIRS_ref;
283
    $cf_info2{subdirs} = $SUBDIRS_ref;
264
    $cf_info2{platforms} = $PLATFORMS_ref;
284
    $cf_info2{platforms} = $PLATFORMS_ref;
265
    $cf_info2{noplatforms} = 1 if ( $noplatforms );
285
    $cf_info2{noplatforms} = 1 if ( $noplatforms );
266
    $cf_info2{root} = 1 if ( $rmf );
286
    $cf_info2{root} = 1 if ( $rmf );
267
 
287
 
Line 463... Line 483...
463
 
483
 
464
    delete $INC{ $cfg_file };
484
    delete $INC{ $cfg_file };
465
    require $cfg_file;
485
    require $cfg_file;
466
 
486
 
467
    #
487
    #
468
    #   BAsic sanity test
488
    #   Basic sanity test
469
    #
489
    #
470
    Error ("Makefile info2 not present")
490
    Error ("Makefile info2 not present")
471
        unless ( keys %cf_info2 );
491
        unless ( keys %cf_info2 );
472
 
492
 
473
    Error ("Makefile info2 incorrect version. Rebuild required")
493
    Error ("Makefile info2 incorrect version. Rebuild required")
474
        unless ( exists $cf_info2{version} && $cf_info2{version} eq 1 );
494
        unless ( exists $cf_info2{version} && $cf_info2{version} eq $fmtVersion );
475
 
495
 
476
    $self->{CFG} = $cfg_file;
496
    $self->{CFG} = $cfg_file;
477
    %{$self->{INFO}} = %cf_info2;
497
    %{$self->{INFO}} = %cf_info2;
478
    %{$self->{FULL}} = %cf_info;
498
    %{$self->{FULL}} = %cf_info;
479
        
499