Subversion Repositories DevTools

Rev

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

Rev 277 Rev 279
Line 116... Line 116...
116
    EnvImport( "GBE_TOOLS" );
116
    EnvImport( "GBE_TOOLS" );
117
    EnvImport( "GBE_CONFIG" );
117
    EnvImport( "GBE_CONFIG" );
118
    EnvImport( "GBE_DPKG" );
118
    EnvImport( "GBE_DPKG" );
119
    EnvImport( "GBE_MACHTYPE" );
119
    EnvImport( "GBE_MACHTYPE" );
120
    EnvImport( "USER" );
120
    EnvImport( "USER" );
-
 
121
    EnvImport( "GBE_HOSTNAME");
121
    EnvImport( "GBE_DRV" )
122
    EnvImport( "GBE_DRV" )
122
        if ( $ScmHost ne "Unix" );            # DOS or WIN special
123
        if ( $ScmHost ne "Unix" );            # DOS or WIN special
123
 
124
 
124
    EnvImportOptional ( 'GBE_DPKG_STORE','' );
125
    EnvImportOptional ( 'GBE_DPKG_STORE','' );
125
    EnvImportOptional ( 'GBE_DPKG_CACHE','' );
126
    EnvImportOptional ( 'GBE_DPKG_CACHE','' );
Line 133... Line 134...
133
#.. Common stuff
134
#.. Common stuff
134
#
135
#
135
    require "$::GBE_TOOLS/common.pl";
136
    require "$::GBE_TOOLS/common.pl";
136
    CommonInit( "buildlib" );
137
    CommonInit( "buildlib" );
137
    Debug( "Version:   $BuildVersion" );
138
    Debug( "Version:   $BuildVersion" );
-
 
139
    Require( "$::GBE_CONFIG/PLATFORM", "PLATFORM_CFG.PM"  );
138
 
140
 
139
#.. Parse command line
141
#.. Parse command line
140
#
142
#
141
    $ScmBuildSrc = $0;                          # Name of the build file
143
    $ScmBuildSrc = $0;                          # Name of the build file
142
    ($Cwd, $Makelib) = @ARGV;
144
    ($Cwd, $Makelib) = @ARGV;
Line 161... Line 163...
161
                "package"       => \$NoPackageError,
163
                "package"       => \$NoPackageError,
162
                "forcebuildpkg" => \$ForceBuildPkg,
164
                "forcebuildpkg" => \$ForceBuildPkg,
163
                );
165
                );
164
    Usage() if ( $opt_help || !$result );
166
    Usage() if ( $opt_help || !$result );
165
 
167
 
166
    Debug( "Debug:          $::ScmDebug" );
168
    Debug( "Debug:         $::ScmDebug" );
167
    Debug( "Verbose:        $::ScmVerbose" );
169
    Debug( "Verbose:       $::ScmVerbose" );
168
    Debug( "Expert:        $Expert" );
170
    Debug( "Expert:        $Expert" );
169
    Debug( "All:           $All" );
171
    Debug( "All:           $All" );
170
    Debug( "Nolog:         $Nolog" );
172
    Debug( "Nolog:         $Nolog" );
171
    Debug( "Cache:         $Cache" );
173
    Debug( "Cache:         $Cache" );
172
    Debug( "project:       $FullJats" );
174
    Debug( "project:       $FullJats" );
Line 773... Line 775...
773
    #   Locate the optional PLATFORM configuration file
775
    #   Locate the optional PLATFORM configuration file
774
    #   If it does exist then it can extend build-time information
776
    #   If it does exist then it can extend build-time information
775
    #
777
    #
776
    my $target = $pInfo->{TARGET};
778
    my $target = $pInfo->{TARGET};
777
 
779
 
778
################################################################################
-
 
779
#
780
    #
780
#   Temp remove: 08-Apr-08
781
    #   Yukky Kludge
-
 
782
    #   JATS has a mechanism whereby packages can create new platforms
781
#   Does not play well with LMOS stuff, as LMOS platforms are defined within
783
    #   Luckily this has only been done for LMOS - don't every do it again
-
 
784
    #   One problem is that we can't validate the target name at this point
782
#   the LMOS package. This is uggly, but its what we have.
785
    #   in time: as the packages are loaded much later.
783
#
786
    #
-
 
787
    #   Kludge. Assume that a leading LMOS_ can be removed when determing
-
 
788
    #           validity of the target platform.
784
#   Solutions:
789
    #
-
 
790
    my $base_target = $target;
785
#       1) Move LMOS magic out of the LMOS package
791
    $base_target =~ s~^LMOS_~~;
-
 
792
 
-
 
793
    #
786
#       2) Have a config file of known targets
794
    #   Ensure target is known to JATS
787
#          This will limit the auto-expandability of LMOS
795
    #   Remove unknown targets from the build. Create a list of unknown
788
#       3) Process later
796
    #   targets and report them later.
-
 
797
    #
789
#          Change the way the build.pl parser works to do two phases
798
    #   If there are signs that the target has been processed, then it may be
790
#           a) Collect information from directives
799
    #   an alias that has not been expanded.
-
 
800
    #
791
#           b) Process the information
801
    #   One result will be that alias platforms, such as DEVLINUX, that don't
792
#          This will solve a number of problems, not only here but elsewhere.
802
    #   expand on WIN32 will be shown as DEVLINUX and not its components.
793
#          It will:
803
    #
794
#               Simplify the handling of clobber
804
    unless ($pInfo->{NOT_AVAILABLE} )
-
 
805
    {
795
#               Remove the need to order the directives
806
        unless ( Exists( "$::GBE_CONFIG/PLATFORM", $base_target  ) )
-
 
807
        {
796
#               Simplify processing as all the information
808
            UniquePush (\@BUILD_BADNAME, $target );
797
#               will be present when the
809
            $pInfo->{NOT_AVAILABLE} = 1;
-
 
810
        }
-
 
811
    }
798
#
812
 
799
#    #
813
    #
800
#    #   Ensure target is known to JATS
-
 
801
#    #   Remove unknown targets from the build. Create a list of unknown
814
    #   Mark as NOT_AVAILABLE platforms that are not available on the machine
802
#    #   targets and report them later.
-
 
803
#    #
815
    #
804
#    unless ( Exists( "$::GBE_CONFIG/PLATFORM", $target  ) )
816
    unless ($pInfo->{NOT_AVAILABLE} )
805
#    {
817
    {
806
#        $pInfo->{NOT_AVAILABLE} = 1;
818
        $pInfo->{NOT_AVAILABLE} = 1
807
#        UniquePush (\@BUILD_BADNAME, $target );
819
            unless ( PlatformConfig::checkBuildAvailability( $base_target ) );
808
#    }
820
    }
809
################################################################################
-
 
810
 
821
 
811
    unless ($pInfo->{NOT_AVAILABLE} )
822
    unless ($pInfo->{NOT_AVAILABLE} )
812
    {
823
    {
813
        if ( my $build_cfg = Require( "$::GBE_CONFIG/PLATFORM", "${target}.cfg"  ) )
824
        if ( my $build_cfg = Require( "$::GBE_CONFIG/PLATFORM", "${target}.cfg"  ) )
814
        {
825
        {
Line 1120... Line 1131...
1120
 
1131
 
1121
    HashJoin( \%BUILDPLATFORMARGS, $;, $platform, @arguments )
1132
    HashJoin( \%BUILDPLATFORMARGS, $;, $platform, @arguments )
1122
        if ( $platform );
1133
        if ( $platform );
1123
}
1134
}
1124
 
1135
 
-
 
1136
#-------------------------------------------------------------------------------
-
 
1137
# Function        : BuildName
-
 
1138
#
-
 
1139
# Description     : Defines the package name and version
1125
 
1140
#
-
 
1141
# Inputs          : build arguments
-
 
1142
#                   Various formats are allowed for backward compatability
-
 
1143
#                   Must support a number of different formats
-
 
1144
#                       "name nn.nn.nn prj"
-
 
1145
#                       "name nn.nn.nn.prj"
-
 
1146
#
-
 
1147
#                       "name nn.nn.nn prj", "nn.nn.nn"
-
 
1148
#                       "name nn.nn.nn.prj", "nn.nn.nn"
-
 
1149
#
-
 
1150
#                       "name", "nn.nn.nn.prj"
-
 
1151
#
-
 
1152
#                       "name", "nn.nn.nn", "prj", --RelaxedVersion
-
 
1153
#
-
 
1154
# Returns         : Nothing
-
 
1155
#
1126
sub BuildName
1156
sub BuildName
1127
{
1157
{
1128
    my( @arguments ) = @_;
1158
    my( @arguments ) = @_;
1129
    my $relaxed_version_name = 0;
1159
    my $relaxed_version_name = 0;
1130
    my @args;
1160
    my @args;
Line 2801... Line 2831...
2801
    my @opts;
2831
    my @opts;
2802
    my $supports_opts;
2832
    my $supports_opts;
2803
 
2833
 
2804
    StartBuildPhase();                          # Starting the build phase. No more data collection
2834
    StartBuildPhase();                          # Starting the build phase. No more data collection
2805
 
2835
 
2806
    if ( defined($Prefix) && $Prefix =~ /^--/ )
2836
    if ( defined($Prefix) && $Prefix =~ /^-/ )
2807
    {
2837
    {
2808
        $Prefix = undef;
2838
        $Prefix = undef;
2809
        $Type = undef;
2839
        $Type = undef;
2810
        $Mode = undef;
2840
        $Mode = undef;
2811
        foreach  ( @_ )
2841
        foreach  ( @_ )
Line 2826... Line 2856...
2826
                $Mode = 'defs';
2856
                $Mode = 'defs';
2827
                $ModePrefix = "";
2857
                $ModePrefix = "";
2828
 
2858
 
2829
            } elsif ( /^--Style=(.*)/ ) {
2859
            } elsif ( /^--Style=(.*)/ ) {
2830
                $Style = $1;
2860
                $Style = $1;
-
 
2861
                $VersionFiles = 1;
2831
                $supports_opts = 1 if ( $Style =~ /^WinRC/i );
2862
                $supports_opts = 1 if ( $Style =~ /^WinRC/i );
2832
 
2863
 
2833
            } elsif ( /^--File=(.*)/ ) {
2864
            } elsif ( /^--File=(.*)/ ) {
2834
                $FileName = $1;
2865
                $FileName = $1;
2835
 
2866
 
Line 2907... Line 2938...
2907
    #
2938
    #
2908
    my $pkgfile = BuildAddKnownFile ( $Srcdir, 'descpkg' );
2939
    my $pkgfile = BuildAddKnownFile ( $Srcdir, 'descpkg' );
2909
    return if ( $Clobber );                 # clobber mode ?
2940
    return if ( $Clobber );                 # clobber mode ?
2910
 
2941
 
2911
    my @desc;
2942
    my @desc;
2912
    push @desc, "Package Name: $BUILDNAME_PACKAGE";
2943
    push @desc, "Package Name:  $BUILDNAME_PACKAGE";
2913
    push @desc, "Version:      $BUILDVERSION";
2944
    push @desc, "Version:       $BUILDVERSION";
2914
    push @desc, "Released By:  $::USER";
2945
    push @desc, "Released By:   $::USER";
2915
    push @desc, "Released On:  $::CurrentTime";
2946
    push @desc, "Released On:   $::CurrentTime";
-
 
2947
    push @desc, "Build Machine: $::GBE_HOSTNAME";
2916
    push @desc, "Path:         $Cwd";
2948
    push @desc, "Path:          $Cwd";
2917
    push @desc, "Jats Version: $::GBE_VERSION";
2949
    push @desc, "Jats Version:  $::GBE_VERSION";
2918
    push @desc, "Jats Path:    $::GBE_CORE";
2950
    push @desc, "Jats Path:     $::GBE_CORE";
2919
    push @desc, "";
2951
    push @desc, "";
2920
    push @desc, "Build Dependencies:";
2952
    push @desc, "Build Dependencies:";
2921
    push @desc, "";
2953
    push @desc, "";
2922
 
2954
 
2923
    foreach my $tag ( PackageEntry::GetPackageList )
2955
    foreach my $tag ( PackageEntry::GetPackageList )
Line 3373... Line 3405...
3373
        foreach ( reverse @dos_paths )
3405
        foreach ( reverse @dos_paths )
3374
        {
3406
        {
3375
            tr~\\/~/~s;
3407
            tr~\\/~/~s;
3376
            $fh->Write ( "PATH=$_\\;\$PATH\n" );
3408
            $fh->Write ( "PATH=$_\\;\$PATH\n" );
3377
        }
3409
        }
3378
        $fh->Write ( "\n\"\$\@\"\n" );
3410
        $fh->Write ( "\n" . '[ -n "$@" ] && "$@"'  ."\n" );
3379
        $fh->Close();
3411
        $fh->Close();
3380
    }
3412
    }
3381
}
3413
}
3382
 
3414
 
3383
#-------------------------------------------------------------------------------
3415
#-------------------------------------------------------------------------------