Subversion Repositories DevTools

Rev

Rev 1469 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

########################################################################
# Copyright (C) 2008 ERG Limited, All rights reserved
#
# Module name   : wsdl-tools
# Module type   : JATS Plugin
# Compiler(s)   : Perl
# Environment(s): JATS
#
# Description   : This package extends the JATS toolset at build time
#                 It provides additional directives to the JATS makefiles
#                 to simplify the directives.
#
#                 The directive matches up with a run-time tool to
#                 do the bulk of the work.
#
# Operation     : This package adds the JATS directive ShellBuild
#                 When used the directive will use GenerateFiles to invoke
#                 a shell program at make-time to actually do the hard work.
#
# Directives    : ShellBuild (platform, script, ... )
#
#......................................................................#

use strict;
use warnings;
use File::Basename;
use JatsError;

#
#   Global JATS-internal variables
#
our $so;                            # Toolset dependent shared library suffix
our %SHLIB_LIBS;                    # Hash keyed by known Shared Libraries

#-------------------------------------------------------------------------------
# Function        : ShellBuild
#
# Description     : Launches a shell build script that has had a set of 
#                   pre-invoke work performed already.
#
# Inputs          : platform          - Standard Platform Specifier
#                   script            - The shell build script to launch.
#                   uargs             - User options
#
#                     -DownloadPkg=   - Name of the package that has been 
#                                       downloaded.  If empty the download package
#                                       is generated automatically.
#                     -XGccInPath     - Forces the cross compiler GCC to be 
#                                       placed in the path directly.
#
# Returns         : Nothing
#
sub ShellBuild
{
    my ($platforms, $script, @uargs) = @_;

    return if ( ! ActivePlatform($platforms) );

    #
    #   Generate the files
    #   Use standard JATS directive
    #
    Src($platforms, $script);
    GenerateFiles($platforms, '--Tool=shellbuild.sh', '-ShellBuild='.$script,
                  '--Var(BuildName)',               # Target Package
                  '--Var(BuildVersion)',            # Target Package Version
                  '--Var(Platform)',                # Target platform
                  '--Var(Type)',                    # Build Type
                  '--Var(Arch)',                    # Architecture
                  '--Var(MachType)',                # Machine Type
                  '--Var(BuildRoot)',               # Build Root
                  '--Var(CompilerPath)',            # Path to compiler
                  '--Var(PackageBinDir)',           # Package Bin dir
                  '--Var(PackageIncDir)',           # Package Inc dir
                  '--Var(PackageLibDir)',           # Package Lib dir
                  '--Var(PackagePkgDir)',           # Package Pkg dir
                  '--Var(PackageDir)',              # Package dir
                  '--Var(PackageToolDir)',          # Tools dir
                  '--Var(PackageToolBin)',          # Tools binaries dir
                  '--Var(PackageToolScript)',       # Tools scripts dir
                  "--NoGenerate", "--Clean", @uargs );
}

#-------------------------------------------------------------------------------
# Function        : DebianShellBuild
#
# Description     : Launches a shell build script that has had a set of 
#                   pre-invoke work performed already.  Once the script
#                   Completes a Debian package builder is launched.
#
# Inputs          : platform          - Standard Platform Specifier
#                   script            - The shell build script to launch.
#                   uargs             - User options, as per ShellBuild().
#
# Returns         : Nothing
#
sub DebianShellBuild
{
    my ($platforms, $script, @uargs) = @_;

    return if ( ! ActivePlatform($platforms) );

    # Generate the files using ShellBuild()
    ShellBuild($platforms, $script, '-DebianPackage', @uargs);
    
    MakeDebianPackage($platforms, '--Script=.deb/debbuild.pl' );
}

1;