Subversion Repositories DevTools

Rev

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

Rev 325 Rev 331
Line 39... Line 39...
39
#
39
#
40
our $ScmBuildlib            = 0;
40
our $ScmBuildlib            = 0;
41
our $ScmBuildSrc            = "";
41
our $ScmBuildSrc            = "";
42
 
42
 
43
our $CmdSwitch              = "";
43
our $CmdSwitch              = "";
44
our $CmdParm                = "";
-
 
45
our $Clobber                = 0;
44
our $Clobber                = 0;
46
our $Archive                = 0;
45
our $Archive                = 0;
47
our $Interface              = 0;
46
our $Interface              = 0;
48
our $RootOnly               = 0;
47
our $RootOnly               = 0;
49
our $Perms                  = 0;
48
our $Perms                  = 0;
50
our $Expert                 = 0;
49
our $Expert                 = 0;
51
our $All                    = 0;
50
our $All                    = 0;
52
our $Nolog                  = 0;
51
our $Nolog                  = 0;
53
our $Cache                  = 0;
52
our $Cache                  = 0;
54
our $FullJats               = 0;
-
 
55
our $NoPackageError         = 0;
53
our $NoPackageError         = 0;
56
our $ForceBuildPkg          = 0;
54
our $ForceBuildPkg          = 0;
57
our $Srcdir                 = "";               # default source root
55
our $Srcdir                 = "";               # default source root
-
 
56
our $ForceBuild             = 1;
58
 
57
 
59
#.. Public symbols, referenced by many build.pl implementations
58
#.. Public symbols, referenced by many build.pl implementations
60
#
59
#
61
our $BUILDPREVIOUSVERSION   = "0.0.0";          # BuildPreviousVersion()
60
our $BUILDPREVIOUSVERSION   = "0.0.0";          # BuildPreviousVersion()
62
our @BUILDPLATFORMS         = ();               # BuildPlatforms()
61
our @BUILDPLATFORMS         = ();               # BuildPlatforms()
Line 89... Line 88...
89
our $BUILDPHASE             = 0;                # In Build Phase
88
our $BUILDPHASE             = 0;                # In Build Phase
90
our @CLOBBERDIRS            = ();               # Directories to clobber
89
our @CLOBBERDIRS            = ();               # Directories to clobber
91
our @CLOBBERFILES           = ();               # Files to clobber
90
our @CLOBBERFILES           = ();               # Files to clobber
92
our %BUILD_KNOWNFILES       = ();               # Files that will be known
91
our %BUILD_KNOWNFILES       = ();               # Files that will be known
93
 
92
 
94
our $Makelib                = "";
-
 
95
 
-
 
96
our $GBE_CORE;                                  # Root of JATS
93
our $GBE_CORE;                                  # Root of JATS
97
our $MAKELIB_PL;                                # Name of the makelib file
-
 
98
our $InterfaceVersion;                          # Interface directory format version
94
our $InterfaceVersion;                          # Interface directory format version
99
our $ScmInterface;                              # Interface directory
95
our $ScmInterface;                              # Interface directory
100
 
96
 
101
 
97
 
102
 
98
 
Line 109... Line 105...
109
sub BuildLibInit
105
sub BuildLibInit
110
{
106
{
111
 
107
 
112
#.. Set environment
108
#.. Set environment
113
#
109
#
114
    EnvImport( "GBE_VERSION" );
110
    EnvImport( 'GBE_VERSION' );
115
    EnvImport( "GBE_BIN" );
111
    EnvImport( 'GBE_BIN' );
116
    EnvImport( "GBE_CORE" );
112
    EnvImport( 'GBE_CORE' );
117
    EnvImport( "GBE_PERL" );
113
    EnvImport( 'GBE_PERL' );
118
    EnvImport( "GBE_TOOLS" );
114
    EnvImport( 'GBE_TOOLS' );
119
    EnvImport( "GBE_CONFIG" );
115
    EnvImport( 'GBE_CONFIG' );
120
    EnvImport( "GBE_DPKG" );
116
    EnvImport( 'GBE_DPKG' );
121
    EnvImport( "GBE_MACHTYPE" );
117
    EnvImport( 'GBE_MACHTYPE' );
122
    EnvImport( "USER" );
118
    EnvImport( 'USER' );
123
    EnvImport( "GBE_HOSTNAME");
119
    EnvImport( 'GBE_HOSTNAME');
124
    EnvImport( "GBE_DRV" )
120
    EnvImport( 'GBE_DRV' )
125
        if ( $ScmHost ne "Unix" );            # DOS or WIN special
121
        if ( $ScmHost ne 'Unix' );            # DOS or WIN special
126
 
122
 
127
    EnvImportOptional ( 'GBE_DPKG_STORE','' );
123
    EnvImportOptional ( 'GBE_DPKG_STORE','' );
128
    EnvImportOptional ( 'GBE_DPKG_CACHE','' );
124
    EnvImportOptional ( 'GBE_DPKG_CACHE','' );
129
    EnvImportOptional ( 'GBE_DPKG_LOCAL','' );
125
    EnvImportOptional ( 'GBE_DPKG_LOCAL','' );
130
    EnvImportOptional ( 'GBE_DPKG_SBOX' ,'' );
126
    EnvImportOptional ( 'GBE_DPKG_SBOX' ,'' );
Line 135... Line 131...
135
    EnvImportOptional ( 'GBE_ABT' );                # optional ABT flags          
131
    EnvImportOptional ( 'GBE_ABT' );                # optional ABT flags          
136
    
132
    
137
#.. Common stuff
133
#.. Common stuff
138
#
134
#
139
    require "$::GBE_TOOLS/common.pl";
135
    require "$::GBE_TOOLS/common.pl";
140
    CommonInit( "buildlib" );
136
    CommonInit( 'buildlib' );
141
    Debug( "Version:   $BuildVersion" );
137
    Debug( "Version:   $BuildVersion" );
142
    Require( "$::GBE_CONFIG/PLATFORM", "PLATFORM_CFG.PM"  );
138
    Require( "$::GBE_CONFIG/PLATFORM", "PLATFORM_CFG.PM"  );
143
 
139
 
144
#.. Parse command line
140
#.. Parse command line
145
#
141
#
146
    $ScmBuildSrc = $0;                          # Name of the build file
142
    $ScmBuildSrc = $0;                          # Name of the build file
147
    ($Cwd, $Makelib) = @ARGV;
143
    $Cwd = shift @ARGV;
148
    $Cwd =~ tr~\\/~/~s;;                        # Need / in path, Remove doubles
144
    $Cwd =~ tr~\\/~/~s;;                        # Need / in path, Remove doubles
149
 
145
 
150
    Debug( "Host:      $ScmHost" );
-
 
151
    Debug( "Cwd:       $Cwd" );
-
 
152
    Debug( "Makelib:   $Makelib" );
-
 
153
    Debug( "BuildFile: $ScmBuildSrc" );
-
 
154
 
-
 
155
    Verbose ("Command Line: @ARGV");
146
    Verbose ("Command Line: @ARGV");
156
    my $result = GetOptions( "help|h:+"      => \$opt_help,
147
    my $result = GetOptions( "help|h:+"      => \$opt_help,
157
                             "man:3"         => \$opt_help,
148
                             "man:3"         => \$opt_help,
158
                             "debug:+"       => \$::ScmDebug,
149
                             "debug:+"       => \$::ScmDebug,
159
                             "verbose:+"     => \$::ScmVerbose,
150
                             "verbose:+"     => \$::ScmVerbose,
160
                             "expert:1"      => \$Expert,
151
                             "expert:1"      => \$Expert,
161
                             "all"           => \$All,
152
                             "all"           => \$All,
162
                             "nolog"         => \$Nolog,
153
                             "nolog"         => \$Nolog,
163
                             "cache+"        => \$Cache,
154
                             "cache:+"       => \$Cache,
164
                             "project"       => \$FullJats,
-
 
165
                             "package"       => \$NoPackageError,
155
                             "package"       => \$NoPackageError,
166
                             "forcebuildpkg" => \$ForceBuildPkg,
156
                             "forcebuildpkg" => \$ForceBuildPkg,
-
 
157
                             "force!"        => \$ForceBuild,
167
                             );
158
                             );
168
    Usage() if ( $opt_help || !$result );
159
    Usage() if ( $opt_help || !$result );
169
 
160
 
-
 
161
    Debug( "Host:          ", $ScmHost );
-
 
162
    Debug( "Cwd:           ", $Cwd );
-
 
163
    Debug( "BuildFile:     ", $ScmBuildSrc );
170
    Debug( "Debug:         $::ScmDebug" );
164
    Debug( "Debug:         ", $::ScmDebug );
171
    Debug( "Verbose:       $::ScmVerbose" );
165
    Debug( "Verbose:       ", $::ScmVerbose );
172
    Debug( "Expert:        $Expert" );
166
    Debug( "Expert:        ", $Expert );
173
    Debug( "All:           $All" );
167
    Debug( "All:           ", $All );
174
    Debug( "Nolog:         $Nolog" );
168
    Debug( "Nolog:         ", $Nolog );
175
    Debug( "Cache:         $Cache" );
169
    Debug( "Cache:         ", $Cache );
176
    Debug( "project:       $FullJats" );
170
    Debug( "package:       ", $NoPackageError );
177
    Debug( "package:       $NoPackageError" );
171
    Debug( "ForcePkg  :    ", $ForceBuildPkg );
178
    Debug( "Force  :       $ForceBuildPkg" );
172
    Debug( "ForceBuild :   ", $ForceBuild );
179
 
173
 
180
#.. Command
174
#.. Command
181
#
175
#
182
    my $argc = 2;
-
 
183
    $CmdSwitch = $ARGV[ $argc++ ] if ($argc <= $#ARGV);
176
    $CmdSwitch = shift @ARGV;
184
    $CmdParm = $ARGV[ $argc++ ] if ($argc <= $#ARGV);
177
    Debug( "CmdSwitch:     ", $CmdSwitch );
185
 
178
 
-
 
179
    if ( $CmdSwitch )
-
 
180
    {
186
    Debug( "CmdSwitch: $CmdSwitch" );
181
        if ( $CmdSwitch eq "interface" ) {
187
    Debug( "CmdParm:   $CmdParm" );
182
            $Interface      = 1;
188
 
183
 
189
    if ( $argc <= $#ARGV && $ARGV[ $argc ] ne "" ) {
184
        } elsif ( $CmdSwitch eq "rootonly" ) {
190
        Usage( "(E) unexpected argument \"$ARGV[ $argc ]\"" );
185
            $RootOnly       = 1;
191
    }
-
 
192
 
186
 
193
    if ( $CmdSwitch eq "interface" ) {
187
        } elsif ( $CmdSwitch eq "clobber" ) {
194
        $Interface      = 1;
188
            $Clobber        = 1;
195
 
189
 
196
    } elsif ( $CmdSwitch eq "rootonly" ) {
190
        } elsif ( $CmdSwitch eq "help" || $CmdSwitch eq "usage" ) {
197
        $RootOnly       = 1;
191
            $opt_help = 1;
-
 
192
            Usage();
198
 
193
 
199
    } elsif ( $CmdSwitch eq "clobber" ) {
194
        } elsif ( $CmdSwitch eq "changelog" ) {
-
 
195
            if ( -d "CVS" )                         # CVS support subdir
-
 
196
            {
-
 
197
                System( "$::GBE_PERL $::GBE_TOOLS/cvs2cl.pl --tags --branches --revisions --day-of-week" )
-
 
198
            }
200
        $Clobber        = 1;
199
            exit(1);
201
 
200
 
-
 
201
        } else {
202
    } elsif ( $CmdSwitch eq "help" || $CmdSwitch eq "usage" ) {
202
            Usage( "(E) build. Unknown command \"$CmdSwitch\"" );
203
        $opt_help = 1;
203
        }
204
        Usage();
204
    }
205
 
205
 
-
 
206
    #
-
 
207
    #   If in -noforce, then check to see if we really need
-
 
208
    #   to force a build. Primarily used within a sandbox to
-
 
209
    #   see if any work needs to be done
-
 
210
    #
206
    } elsif ( $CmdSwitch eq "changelog" ) {
211
    if ( ! $ForceBuild && !$Clobber )
-
 
212
    {
-
 
213
        my @build_warn;
-
 
214
        my $bstamp = -M "$Cwd/$ScmBuildSrc";
-
 
215
        my $tstamp = -M "$Cwd/Makefile.gbe";
-
 
216
 
207
        if ( -d "CVS" )                         # CVS support subdir
217
        push @build_warn, "Missing: Makefile.gbe" unless ( defined $tstamp );
-
 
218
        push @build_warn, "Modified build file ($ScmBuildSrc)" if ( $tstamp && $bstamp < $tstamp );
-
 
219
 
-
 
220
        if ( @build_warn )
208
        {
221
        {
-
 
222
            Verbose ("Forcing Build", @build_warn );
-
 
223
        }
-
 
224
        else
-
 
225
        {
209
            System( "$::GBE_PERL $::GBE_TOOLS/cvs2cl.pl --tags --branches --revisions --day-of-week" )
226
            Verbose ("No build performed. Build files up to date");
-
 
227
            exit 0;
210
        }
228
        }
211
        exit(1);
-
 
212
 
-
 
213
    } elsif ( $CmdSwitch ne "" ) {
-
 
214
        Usage( "(E) unknown switch \"$CmdSwitch\"" );
-
 
215
    }
229
    }
216
 
230
 
217
    #
231
    #
218
    #   Must inform makelib that its running under buildlib
232
    #   Must inform makelib that its running under buildlib
219
    #
233
    #
Line 230... Line 244...
230
 
244
 
231
#-------------------------------------------------------------------------------
245
#-------------------------------------------------------------------------------
232
# Function        : Log
246
# Function        : Log
233
#
247
#
234
# Description     : Internal function to generate a log file of the build process
248
# Description     : Internal function to generate a log file of the build process
235
#                   The function will print its argumenst tot he screen and a log file
249
#                   The function will print its argumenst to the screen and a log file
236
#
250
#
237
# Inputs          : Arguments will be printed
251
# Inputs          : Arguments will be printed
238
#
252
#
239
# Returns         : Nothing
253
# Returns         : Nothing
240
#
254
#
Line 1480... Line 1494...
1480
 
1494
 
1481
        if ( !defined($platform) || $platform eq "*" ) 
1495
        if ( !defined($platform) || $platform eq "*" ) 
1482
        {
1496
        {
1483
            foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
1497
            foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
1484
            {
1498
            {
1485
                LinkEntry( $platform, $path, $name, "!sandbox", 1 );
1499
                LinkEntry( $platform, $path, $name, "!sandbox", 1, 1 );
1486
            }
1500
            }
1487
        }
1501
        }
1488
        else
1502
        else
1489
        {
1503
        {
1490
            my(@platforms) = split( ',', $platform );
1504
            my(@platforms) = split( ',', $platform );
1491
            @platforms = ExpandPlatforms( @platforms );
1505
            @platforms = ExpandPlatforms( @platforms );
1492
 
1506
 
1493
            foreach my $platform ( @platforms )
1507
            foreach my $platform ( @platforms )
1494
            {
1508
            {
1495
                LinkEntry( $platform, $path, $name, "!sandbox", 1 );
1509
                LinkEntry( $platform, $path, $name, "!sandbox", 1, 1 );
1496
            }
1510
            }
1497
        }
1511
        }
1498
    }
1512
    }
1499
}
1513
}
1500
 
1514
 
Line 1536... Line 1550...
1536
    }
1550
    }
1537
 
1551
 
1538
    if ( $Cache && $::GBE_DPKG_CACHE )
1552
    if ( $Cache && $::GBE_DPKG_CACHE )
1539
    {
1553
    {
1540
        my $mode = ($Cache > 1) ? "-refresh" : "";
1554
        my $mode = ($Cache > 1) ? "-refresh" : "";
1541
        Log( "LinkPkgArchive . $name ($version) Update Cache" );
1555
        Log( "LinkPkgArchive .. $name ($version) Update Cache" );
1542
        System('--NoExit', "$::GBE_PERL $::GBE_TOOLS/cache_dpkg.pl $mode -quiet $name/$version" );
1556
        System('--NoExit', "$::GBE_PERL $::GBE_TOOLS/cache_dpkg.pl $mode -quiet $name/$version" );
1543
    }
1557
    }
1544
 
1558
 
1545
    #
1559
    #
1546
    #   Locate the package ONCE
1560
    #   Locate the package ONCE
1547
    #
1561
    #
1548
    Log( "LinkPkgArchive . $name ($version)" );
1562
    Log( "LinkPkgArchive .. $name ($version)" );
1549
    my ($pkg, $local ) = PackageLocate( $name, $version );
1563
    my ($pkg, $local ) = PackageLocate( $name, $version );
1550
    if ( $pkg )
1564
    if ( $pkg )
1551
    {
1565
    {
1552
        #
1566
        #
1553
        #   Generate package rules for each active platform
1567
        #   Generate package rules for each active platform
1554
        #
1568
        #
1555
        foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
1569
        foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
1556
        {
1570
        {
1557
            LinkEntry( $platform, $pkg, $name, $version, 0 );
1571
            LinkEntry( $platform, $pkg, $name, $version, 0, $local );
1558
        }
1572
        }
1559
    }
1573
    }
1560
}
1574
}
1561
 
1575
 
1562
sub LinkClean
1576
sub LinkClean
Line 1659... Line 1673...
1659
        #       current_<USER_NAME>
1673
        #       current_<USER_NAME>
1660
        #   This is an old mechanism whose use should not be encouraged
1674
        #   This is an old mechanism whose use should not be encouraged
1661
        #
1675
        #
1662
        #..
1676
        #..
1663
        if ( $version eq "!current" )
1677
        if ( $version eq "!current" )
-
 
1678
        {
1664
        {                                       # 'current' user
1679
            Error ("Use of !version is not allowed in ABT build")
1665
            EnvImport( "USER" );
1680
                if ( $::GBE_ABT );
1666
 
-
 
1667
            $pkg = "$dpkg/$name/current";       # default
-
 
1668
 
1681
 
-
 
1682
            $pkg = "$dpkg/$name/current";       # current
1669
            $pkg = "$dpkg/$name/current.lnk"
1683
            $pkg = "$dpkg/$name/current.lnk"
1670
                if ( -e "$dpkg/$name/current.lnk" );
1684
                if ( -e "$dpkg/$name/current.lnk" );
1671
 
1685
 
1672
                                                # USER specific
1686
                                                # USER specific current
-
 
1687
            EnvImport( "USER" );
1673
            $pkg = "$dpkg/$name/current_$::USER"
1688
            $pkg = "$dpkg/$name/current_$::USER"
1674
                if ( -e "$dpkg/$name/current_$::USER" );
1689
                if ( -e "$dpkg/$name/current_$::USER" );
1675
 
1690
 
1676
            $pkg = "$dpkg/$name/current_$::USER.lnk"
1691
            $pkg = "$dpkg/$name/current_$::USER.lnk"
1677
                if ( -e "$dpkg/$name/current_$::USER.lnk" );
1692
                if ( -e "$dpkg/$name/current_$::USER.lnk" );
1678
        }
1693
        }
1679
        else
1694
        else
1680
        {                                       # standard
1695
        {                                       # standard
1681
            $pkg = "$dpkg/$name/$version";
1696
            $pkg = "$dpkg/$name/$version";
1682
 
-
 
1683
            $pkg = "$dpkg/$name/$version.lnk"
1697
            $pkg = "$dpkg/$name/$version.lnk"
1684
                if ( -e "$dpkg/$name/$version.lnk" );
1698
                if ( -e "$dpkg/$name/$version.lnk" );
1685
        }
1699
        }
1686
 
1700
 
1687
        #
1701
        #
Line 1760... Line 1774...
1760
# Inputs          : platform being processed
1774
# Inputs          : platform being processed
1761
#                   path to the package
1775
#                   path to the package
1762
#                   name of the package
1776
#                   name of the package
1763
#                   version of the package
1777
#                   version of the package
1764
#                   sandbox support (non-zero)
1778
#                   sandbox support (non-zero)
-
 
1779
#                   local package
1765
#
1780
#
1766
sub LinkEntry
1781
sub LinkEntry
1767
{
1782
{
1768
    my( $platform, $pkg, $name, $version, $sandbox ) = @_;
1783
    my( $platform, $pkg, $name, $version, $sandbox, $local ) = @_;
1769
    my( $entry );
1784
    my( $entry );
1770
 
1785
 
1771
    #   Create entry record
1786
    #   Create entry record
1772
    #
1787
    #
1773
    #..
1788
    #..
1774
    $entry = PackageEntry::New( $pkg, $name, $version, $sandbox, 'link' );
1789
    $entry = PackageEntry::New( $pkg, $name, $version, $sandbox, 'link', $local );
1775
 
1790
 
1776
    #   Populate includes:
1791
    #   Populate includes:
1777
    #
1792
    #
1778
    #   - include/$platform                 (eg include/solaris)
1793
    #   - include/$platform                 (eg include/solaris)
1779
    #   - inc/$platform                     (eg inc/solaris)
1794
    #   - inc/$platform                     (eg inc/solaris)
Line 1906... Line 1921...
1906
    if ( $pkg )
1921
    if ( $pkg )
1907
    {
1922
    {
1908
        #
1923
        #
1909
        #   Create a Package Entry
1924
        #   Create a Package Entry
1910
        #
1925
        #
1911
        my $entry = PackageEntry::New( $pkg, $name, $version, 0, 'build' );
1926
        my $entry = PackageEntry::New( $pkg, $name, $version, 0, 'build', $local );
1912
 
1927
 
1913
        #
1928
        #
1914
        #   Determine if the package needs to be installed:
1929
        #   Determine if the package needs to be installed:
1915
        #       If the package is a 'local' package then force transfer
1930
        #       If the package is a 'local' package then force transfer
1916
        #       If the user has specified --cache then force transfer
1931
        #       If the user has specified --cache then force transfer
Line 1945... Line 1960...
1945
 
1960
 
1946
                #
1961
                #
1947
                #   If forcing a BuildPkg, then don't use symlinks
1962
                #   If forcing a BuildPkg, then don't use symlinks
1948
                #   to files in dpkg_archive
1963
                #   to files in dpkg_archive
1949
                #
1964
                #
1950
                my $opts = "";
1965
                my @opts;
1951
                $opts = "--NoSymlinks" if ( $ForceBuildPkg );
1966
                push @opts, "--NoSymlinks" if ( $ForceBuildPkg );
-
 
1967
                push @opts, "--AllowOverWrite" if ( $local );
1952
 
1968
 
1953
                #
1969
                #
1954
                #   Determine all the Platforms, Products and Targets
1970
                #   Determine all the Platforms, Products and Targets
1955
                #   that need to be installed
1971
                #   that need to be installed
1956
                #
1972
                #
1957
                my $arglist = GenerateInstallArgumentList();
1973
                my $arglist = GenerateInstallArgumentList();
1958
                System( "cd $pkg; $::GBE_PERL $::GBE_TOOLS/installpkg.pl $Cwd/$BUILDINTERFACE $Cwd $opts $arglist");
1974
                System( "cd $pkg; $::GBE_PERL $::GBE_TOOLS/installpkg.pl $Cwd/$BUILDINTERFACE $Cwd @opts $arglist");
1959
                Error( "Package installation error" ) if ( $? != 0 );
1975
                Error( "Package installation error" ) if ( $? != 0 );
1960
            }
1976
            }
1961
            elsif ( -e "$pkg/InstallPkg.sh" )
1977
            elsif ( -e "$pkg/InstallPkg.sh" )
1962
            {
1978
            {
1963
                System( "(cd $pkg; ./InstallPkg.sh $Cwd/$BUILDINTERFACE $Cwd)" );
1979
                System( "(cd $pkg; ./InstallPkg.sh $Cwd/$BUILDINTERFACE $Cwd)" );
Line 2413... Line 2429...
2413
#                   Don't know what it was meant to do
2429
#                   Don't know what it was meant to do
2414
#                   Unfortunately it is present in a lot of build.pl files
2430
#                   Unfortunately it is present in a lot of build.pl files
2415
#
2431
#
2416
#                   Not well supported on all machine types
2432
#                   Not well supported on all machine types
2417
#
2433
#
2418
# Inputs          : $BuildFilename          - Root of output filename
2434
# Inputs          : None that are used
2419
#                   $BuildDir               - Path of subdir to tar
-
 
2420
#
-
 
2421
#                   Also uses the undocumented: GBE_SNAPSHOT_DIR
-
 
2422
#
2435
#
2423
# Returns         : Does not return
2436
# Returns         : Undefined
2424
#                   Once invoked this function will exit the build
-
 
2425
#
2437
#
2426
sub BuildReleaseFile
2438
sub BuildReleaseFile
2427
{
2439
{
2428
    my ( $BuildFilename, $BuildDir ) = @_;
-
 
2429
    my ( $SnapDir );
-
 
2430
 
-
 
2431
    # Check if archive requested...
-
 
2432
    #
-
 
2433
    return unless ( $CmdSwitch eq "archive" );
-
 
2434
 
-
 
2435
    # Build the release archive file...
-
 
2436
    #
-
 
2437
    $SnapDir = "$ENV{ \"GBE_SNAPSHOT_DIR\" }/";
-
 
2438
    $SnapDir = "" unless ($SnapDir ne "/");
-
 
2439
 
-
 
2440
    Log( "Creating release archive: $SnapDir$BuildFilename.tgz of $Cwd/$BuildDir/" );
-
 
2441
 
-
 
2442
    # GNU tar and zip the build directory NOT following links...
-
 
2443
    #
-
 
2444
    System( "$::GBE_BIN/tar czf $SnapDir$BuildFilename.tgz $BuildDir" );
-
 
2445
 
-
 
2446
    Error( "To extract use: $::GBE_BIN/tar xvzf $BuildFilename.tgz" );
-
 
2447
}
2440
}
2448
 
2441
 
2449
#-------------------------------------------------------------------------------
2442
#-------------------------------------------------------------------------------
2450
# Function        : BuildSnapshot
2443
# Function        : BuildSnapshot
2451
#
2444
#
Line 2621... Line 2614...
2621
# Function        : BuildAccessPerms
2614
# Function        : BuildAccessPerms
2622
#
2615
#
2623
# Description     : Check if access/permissions setting requested...
2616
# Description     : Check if access/permissions setting requested...
2624
#                   Legacy
2617
#                   Legacy
2625
#
2618
#
2626
# Inputs          : None
2619
#                   Don't know what it was meant to do
-
 
2620
#                   Unfortunately it is present in a lot of build.pl files
2627
#
2621
#
-
 
2622
# Inputs          : None that are used
-
 
2623
#
2628
# Returns         : 
2624
# Returns         : Undefined
2629
#
2625
#
2630
sub BuildAccessPerms
2626
sub BuildAccessPerms
2631
{
2627
{
2632
    my( $PermsFilename );
-
 
2633
 
-
 
2634
    return unless ( $CmdSwitch eq "perms" );
-
 
2635
 
-
 
2636
    # Set the build access permissions from the shell script...
-
 
2637
    $PermsFilename = $CmdParm;
-
 
2638
    if ( -e $PermsFilename )
-
 
2639
    {
-
 
2640
        Log( "Setting build access permissions from $PermsFilename..." );
-
 
2641
        System( "su root -c \"sh $PermsFilename\"" );
-
 
2642
    }
-
 
2643
    else
-
 
2644
    {
-
 
2645
        Log( "ERROR: Could not find file to set the access permissions: $PermsFilename" );
-
 
2646
    }
-
 
2647
    die "\n";
-
 
2648
}
2628
}
2649
 
2629
 
2650
 
2630
 
2651
sub BuildSetenv
2631
sub BuildSetenv
2652
{
2632
{
Line 3061... Line 3041...
3061
    #       the following substitutions are done.
3041
    #       the following substitutions are done.
3062
    #
3042
    #
3063
    @ARGV = ();
3043
    @ARGV = ();
3064
    $0 = "makefile.pl ";
3044
    $0 = "makefile.pl ";
3065
    push @ARGV, "$Cwd";                         # current working directory
3045
    push @ARGV, "$Cwd";                         # current working directory
3066
    push @ARGV, "$::MAKELIB_PL";                # makelib.pl image
3046
    push @ARGV, "$::GBE_TOOLS/makelib.pl";     # makelib.pl image
3067
    push @ARGV, "--interface=$BUILDINTERFACE"
3047
    push @ARGV, "--interface=$BUILDINTERFACE"
3068
        if ($BUILDINTERFACE);
3048
        if ($BUILDINTERFACE);
3069
 
3049
 
3070
    Debug( "ARGV:      @ARGV" );
3050
    Debug( "ARGV:      @ARGV" );
3071
 
3051
 
Line 3532... Line 3512...
3532
        next if ( $symname =~ m/^ENV$/  );              # Don't keep the user ENV
3512
        next if ( $symname =~ m/^ENV$/  );              # Don't keep the user ENV
3533
        next if ( $symname =~ m/^INC$/  );              # Don't keep the INC paths
3513
        next if ( $symname =~ m/^INC$/  );              # Don't keep the INC paths
3534
        next if ( $symname =~ m/^DEFINES/  );           # Don't keep
3514
        next if ( $symname =~ m/^DEFINES/  );           # Don't keep
3535
        next if ( $symname =~ m/^TOOLSETRULES/  );      # Don't keep
3515
        next if ( $symname =~ m/^TOOLSETRULES/  );      # Don't keep
3536
 
3516
 
-
 
3517
        no strict 'vars';
3537
        local *sym = $main::{$symname};
3518
        local *sym = $main::{$symname};
3538
 
3519
 
3539
        $cf_build_info{"\$$symname"} =  $::sym if defined $::sym;
3520
        $cf_build_info{"\$$symname"} =  $sym if defined $sym;
3540
        $cf_build_info{"\@$symname"} = \@::sym if defined @::sym;
3521
        $cf_build_info{"\@$symname"} = \@sym if defined @sym;
3541
        $cf_build_info{"\%$symname"} = \%::sym if defined %::sym;
3522
        $cf_build_info{"\%$symname"} = \%sym if defined %sym;
-
 
3523
        use strict 'vars';
3542
    }
3524
    }
3543
 
3525
 
3544
    #
3526
    #
3545
    #   Dump out the configuration information
3527
    #   Dump out the configuration information
3546
    #
3528
    #
Line 3901... Line 3883...
3901
 
3883
 
3902
     [perl buildlib.pl [options] PWD [command]]
3884
     [perl buildlib.pl [options] PWD [command]]
3903
 
3885
 
3904
 
3886
 
3905
 Options:
3887
 Options:
3906
    --help          - Display terse usage
3888
    -help          - Display terse usage
3907
    --help --help   - Display verbose usage
3889
    -help -help   - Display verbose usage
3908
    --man           - Display internal manual
3890
    -man           - Display internal manual
3909
    --verbose[=n]   - Set level of progress verbosity
3891
    -verbose[=n]   - Set level of progress verbosity
3910
    --debug[=n]     - Set the debug level
3892
    -debug[=n]     - Set the debug level
3911
    --nolog         - Do not generate/update Changelog
3893
    -nolog         - Do not generate/update Changelog
3912
    --cache         - Cache packages in the local dpkg_package cache
3894
    -cache         - Cache packages in the local dpkg_package cache
3913
    --cache --cache - Forced refresh dependent packages in the local cache
3895
    -cache -cache - Forced refresh dependent packages in the local cache
3914
    --project       - Generate support files for external tools
-
 
3915
    --package       - Ignore packages that are not available and continue
3896
    -package       - Ignore packages that are not available and continue
3916
    --forcebuildpkg - Treat LinkPkgArchive directives as BuildPkgArchive
3897
    -forcebuildpkg - Treat LinkPkgArchive directives as BuildPkgArchive
3917
                      Also suppress the use of symlinks so that the phsical
3898
                      Also suppress the use of symlinks so that the phsical
3918
                      file will be copied locally.
3899
                      file will be copied locally.
-
 
3900
    -[no]force     - Force build even if build.pl is not newer
-
 
3901
                      Default: -force
3919
 
3902
 
3920
 Sticky settings:
3903
 Sticky settings:
3921
    --all           - Build for all platforms ignoring GBE_BUILDFILTER
3904
    -all           - Build for all platforms ignoring GBE_BUILDFILTER
3922
    --expert[=n]    - Relaxing dependency checks on the user makefiles
3905
    -expert[=n]    - Relaxing dependency checks on the user makefiles
3923
 
3906
 
3924
 Commands:
3907
 Commands:
3925
    changelog       - Only update ChangeLog.
3908
    changelog       - Only update ChangeLog.
3926
    interface       - Only (re)build the interface tree, including ChangeLog.
3909
    interface       - Only (re)build the interface tree, including ChangeLog.
3927
    rootonly        - Only (re)build the root directory.
3910
    rootonly        - Only (re)build the root directory.
Line 3930... Line 3913...
3930
 
3913
 
3931
=head1 OPTIONS
3914
=head1 OPTIONS
3932
 
3915
 
3933
=over 8
3916
=over 8
3934
 
3917
 
3935
=item B<--help>
3918
=item B<-help>
3936
 
3919
 
3937
Print a brief help message and exits.
3920
Print a brief help message and exits.
3938
 
3921
 
3939
=item B<-help -help>
3922
=item B<-help -help>
3940
 
3923
 
Line 3942... Line 3925...
3942
 
3925
 
3943
=item B<-man>
3926
=item B<-man>
3944
 
3927
 
3945
Prints the manual page and exits.
3928
Prints the manual page and exits.
3946
 
3929
 
3947
=item B<--verbose[=n]>
3930
=item B<-verbose[=n]>
3948
 
3931
 
3949
Increases program output.
3932
Increases program output.
3950
 
3933
 
3951
If an argument is provided, then it will be used to set the level, otherwise the
3934
If an argument is provided, then it will be used to set the level, otherwise the
3952
existing level will be incremented. This option may be specified multiple times.
3935
existing level will be incremented. This option may be specified multiple times.
Line 3957... Line 3940...
3957
progress information.
3940
progress information.
3958
 
3941
 
3959
If an argument is provided, then it will be used to set the level, otherwise the
3942
If an argument is provided, then it will be used to set the level, otherwise the
3960
existing level will be incremented. This option may be specified multiple times.
3943
existing level will be incremented. This option may be specified multiple times.
3961
 
3944
 
3962
=item B<--nolog>
3945
=item B<-nolog>
3963
 
3946
 
3964
Do not generate or update the ChangeLog maintained when a CVS directory is detected
3947
Do not generate or update the ChangeLog maintained when a CVS directory is detected
3965
in the build directory.
3948
in the build directory.
3966
 
3949
 
3967
=item B<--cache>
3950
=item B<-cache>
3968
 
3951
 
3969
This option will cause dependent packages to be cached in the local
3952
This option will cause dependent packages to be cached in the local
3970
dpkg_archive cache.
3953
dpkg_archive cache.
3971
 
3954
 
3972
If the option is used twice then the packages will be forcibly refreshed.
3955
If the option is used twice then the packages will be forcibly refreshed.
3973
 
3956
 
3974
=item B<--project>
-
 
3975
 
-
 
3976
This option is used to indicate that the build.pl is being processed by a full
-
 
3977
JATS environment and not by any pre-existing mechanism.
-
 
3978
 
-
 
3979
This option will prevent the generation of configuration batch files that are
-
 
3980
not required by the full environment.
-
 
3981
 
-
 
3982
=item B<--package>
3957
=item B<-package>
3983
 
3958
 
3984
This option will cause the build process to ignore packages that cannot be
3959
This option will cause the build process to ignore packages that cannot be
3985
located. The package build may fail at a later stage.
3960
located. The package build may fail at a later stage.
3986
 
3961
 
3987
This option is used by the Auto Build Tool to handle packages that may not be
3962
This option is used by the Auto Build Tool to handle packages that may not be
3988
needed in all builds.
3963
needed in all builds.
3989
 
3964
 
3990
=item B<--forcebuildpkg>
3965
=item B<-forcebuildpkg>
3991
 
3966
 
3992
This option will force LinkPkgArchive directives to be treated as
3967
This option will force LinkPkgArchive directives to be treated as
3993
BuildPkgArchive directives. The result is that the 'interface' directory will be
3968
BuildPkgArchive directives. The result is that the 'interface' directory will be
3994
populated with the contents of all dependent packages. Moreover, on a Unix
3969
populated with the contents of all dependent packages. Moreover, on a Unix
3995
machine, the files will be copied and not referenced with a soft link.
3970
machine, the files will be copied and not referenced with a soft link.
Line 4004... Line 3979...
4004
 
3979
 
4005
=item * Local modification of files for test/debug/development
3980
=item * Local modification of files for test/debug/development
4006
 
3981
 
4007
=back
3982
=back
4008
 
3983
 
-
 
3984
=item B<-[no]force>
-
 
3985
 
-
 
3986
The '-noforce' option will only perform a build, if the build.pl file
-
 
3987
has build.pl file has been modified since the last build.
-
 
3988
 
-
 
3989
The default operation will alwars force a build.
-
 
3990
 
4009
=item B<--all>
3991
=item B<-all>
4010
 
3992
 
4011
This option will cause the build process to generate makefiles for all
3993
This option will cause the build process to generate makefiles for all
4012
possible build targets ignoring the use of GBE_BUILDFILTER.
3994
possible build targets ignoring the use of GBE_BUILDFILTER.
4013
 
3995
 
4014
This option is sticky. Once used in a build it will be retained when makefiles
3996
This option is sticky. Once used in a build it will be retained when makefiles
4015
are rebuilt.
3997
are rebuilt.
4016
 
3998
 
4017
=item B<--expert[=n]>
3999
=item B<-expert[=n]>
4018
 
4000
 
4019
This option causes the generation of makefiles with relaxed dependancy checks.
4001
This option causes the generation of makefiles with relaxed dependancy checks.
4020
 
4002
 
4021
If an argument is provided, then it will be used to set the level, otherwise a
4003
If an argument is provided, then it will be used to set the level, otherwise a
4022
level of '1' will be set.
4004
level of '1' will be set.
Line 4078... Line 4060...
4078
This perl library (buildlib.pl) is not designed to be invoked directly by the
4060
This perl library (buildlib.pl) is not designed to be invoked directly by the
4079
user. It should be invoked through a 'build.pl' file. Moreover, for historical
4061
user. It should be invoked through a 'build.pl' file. Moreover, for historical
4080
reasons, the build.pl is not easily invoked. It is best to only invoke the
4062
reasons, the build.pl is not easily invoked. It is best to only invoke the
4081
'build' process via the JATS wrapper scripts : jats.bat or jats.sh.
4063
'build' process via the JATS wrapper scripts : jats.bat or jats.sh.
4082
 
4064
 
4083
The build.pl file must be invoked with two fixed arguments, followed by user
4065
The build.pl file must be invoked with one fixed arguments, followed by user
4084
options and subcommands
4066
options and subcommands
4085
 
4067
 
4086
=over 8
4068
=over 8
4087
 
4069
 
4088
=item   1 The current working directory
4070
=item   1 The current working directory
4089
 
4071
 
4090
This could have been derived directly by the program, rather than having it
4072
This could have been derived directly by the program, rather than having it
4091
passed in.
4073
passed in.
4092
 
4074
 
4093
=item   2 The absolute path to buildlib.pl (this library)
-
 
4094
 
-
 
4095
In practice this value is not used, but is provided for historical reasons.
-
 
4096
 
-
 
4097
=item   3 Options and commands may follow the first two mandatory arguments.
4075
=item   2 Options and commands may follow the first two mandatory arguments.
4098
 
4076
 
4099
=back
4077
=back
4100
 
4078
 
4101
The build.pl file must 'require' the buildlib.pl and makelib.pl. The preferred
4079
The build.pl file must 'require' the buildlib.pl and makelib.pl. The preferred
4102
code is:
4080
code is: