| 1467 |
alewis |
1 |
########################################################################
|
|
|
2 |
# Copyright (C) 2008 ERG Limited, All rights reserved
|
|
|
3 |
#
|
|
|
4 |
# Module name : wsdl-tools
|
|
|
5 |
# Module type : JATS Plugin
|
|
|
6 |
# Compiler(s) : Perl
|
|
|
7 |
# Environment(s): JATS
|
|
|
8 |
#
|
|
|
9 |
# Description : This package extends the JATS toolset at build time
|
|
|
10 |
# It provides additional directives to the JATS makefiles
|
|
|
11 |
# to simplify the directives.
|
|
|
12 |
#
|
|
|
13 |
# The directive matches up with a run-time tool to
|
|
|
14 |
# do the bulk of the work.
|
|
|
15 |
#
|
|
|
16 |
# Operation : This package adds the JATS directive ShellBuild
|
|
|
17 |
# When used the directive will use GenerateFiles to invoke
|
|
|
18 |
# a shell program at make-time to actually do the hard work.
|
|
|
19 |
#
|
|
|
20 |
# Directives : ShellBuild (platform, script, ... )
|
|
|
21 |
#
|
|
|
22 |
#......................................................................#
|
|
|
23 |
|
|
|
24 |
use strict;
|
|
|
25 |
use warnings;
|
|
|
26 |
use File::Basename;
|
|
|
27 |
use JatsError;
|
|
|
28 |
|
|
|
29 |
#
|
|
|
30 |
# Global JATS-internal variables
|
|
|
31 |
#
|
|
|
32 |
our $so; # Toolset dependent shared library suffix
|
|
|
33 |
our %SHLIB_LIBS; # Hash keyed by known Shared Libraries
|
|
|
34 |
|
|
|
35 |
#-------------------------------------------------------------------------------
|
|
|
36 |
# Function : ShellBuild
|
|
|
37 |
#
|
|
|
38 |
# Description : Launches a shell build script that has had a set of
|
|
|
39 |
# pre-invoke work performed already.
|
|
|
40 |
#
|
|
|
41 |
# Inputs : platform - Standard Platform Specifier
|
|
|
42 |
# script - The shell build script to launch.
|
|
|
43 |
# uargs - User options
|
|
|
44 |
#
|
|
|
45 |
# -DownloadPkg= - Name of the package that has been
|
|
|
46 |
# downloaded. If empty the download package
|
|
|
47 |
# is generated automatically.
|
|
|
48 |
# -XGccInPath - Forces the cross compiler GCC to be
|
|
|
49 |
# placed in the path directly.
|
| 1469 |
alewis |
50 |
# -ConfigVarient= - Sets the name of the package build
|
|
|
51 |
# configuration varient. This can then
|
|
|
52 |
# be used in the call-out script as
|
|
|
53 |
# ${CONFIG_VARIENT}.
|
| 1467 |
alewis |
54 |
#
|
|
|
55 |
# Returns : Nothing
|
|
|
56 |
#
|
|
|
57 |
sub ShellBuild
|
|
|
58 |
{
|
|
|
59 |
my ($platforms, $script, @uargs) = @_;
|
|
|
60 |
|
|
|
61 |
return if ( ! ActivePlatform($platforms) );
|
|
|
62 |
|
|
|
63 |
#
|
|
|
64 |
# Generate the files
|
|
|
65 |
# Use standard JATS directive
|
|
|
66 |
#
|
|
|
67 |
Src($platforms, $script);
|
|
|
68 |
GenerateFiles($platforms, '--Tool=shellbuild.sh', '-ShellBuild='.$script,
|
|
|
69 |
'--Var(BuildName)', # Target Package
|
|
|
70 |
'--Var(BuildVersion)', # Target Package Version
|
|
|
71 |
'--Var(Platform)', # Target platform
|
|
|
72 |
'--Var(Type)', # Build Type
|
|
|
73 |
'--Var(Arch)', # Architecture
|
|
|
74 |
'--Var(MachType)', # Machine Type
|
|
|
75 |
'--Var(BuildRoot)', # Build Root
|
|
|
76 |
'--Var(CompilerPath)', # Path to compiler
|
| 1469 |
alewis |
77 |
'--Var(BinDir)', # Binary output directory
|
|
|
78 |
'--Var(ObjDir)', # Object output directory
|
|
|
79 |
'--Var(LibDir)', # Library output directory
|
| 1467 |
alewis |
80 |
'--Var(PackageBinDir)', # Package Bin dir
|
|
|
81 |
'--Var(PackageIncDir)', # Package Inc dir
|
|
|
82 |
'--Var(PackageLibDir)', # Package Lib dir
|
|
|
83 |
'--Var(PackagePkgDir)', # Package Pkg dir
|
|
|
84 |
'--Var(PackageDir)', # Package dir
|
|
|
85 |
'--Var(PackageToolDir)', # Tools dir
|
|
|
86 |
'--Var(PackageToolBin)', # Tools binaries dir
|
|
|
87 |
'--Var(PackageToolScript)', # Tools scripts dir
|
|
|
88 |
"--NoGenerate", "--Clean", @uargs );
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
#-------------------------------------------------------------------------------
|
|
|
92 |
# Function : DebianShellBuild
|
|
|
93 |
#
|
|
|
94 |
# Description : Launches a shell build script that has had a set of
|
|
|
95 |
# pre-invoke work performed already. Once the script
|
|
|
96 |
# Completes a Debian package builder is launched.
|
|
|
97 |
#
|
|
|
98 |
# Inputs : platform - Standard Platform Specifier
|
|
|
99 |
# script - The shell build script to launch.
|
|
|
100 |
# uargs - User options, as per ShellBuild().
|
|
|
101 |
#
|
|
|
102 |
# Returns : Nothing
|
|
|
103 |
#
|
|
|
104 |
sub DebianShellBuild
|
|
|
105 |
{
|
|
|
106 |
my ($platforms, $script, @uargs) = @_;
|
|
|
107 |
|
|
|
108 |
return if ( ! ActivePlatform($platforms) );
|
|
|
109 |
|
|
|
110 |
# Generate the files using ShellBuild()
|
|
|
111 |
ShellBuild($platforms, $script, '-DebianPackage', @uargs);
|
|
|
112 |
|
|
|
113 |
MakeDebianPackage($platforms, '--Script=.deb/debbuild.pl' );
|
|
|
114 |
}
|
|
|
115 |
|
|
|
116 |
1;
|