summaryrefslogtreecommitdiffstats
path: root/src/windows/build
diff options
context:
space:
mode:
authorKevin Koch <kpkoch@mit.edu>2007-04-12 14:29:07 +0000
committerKevin Koch <kpkoch@mit.edu>2007-04-12 14:29:07 +0000
commit484f2c118521d1976a989414b314a29e540137f9 (patch)
treec0ddf886f86bce2997669e3f31e5bed0f97b3159 /src/windows/build
parent238e74ebb806b1470d66ee375561464c540886a2 (diff)
downloadkrb5-484f2c118521d1976a989414b314a29e540137f9.tar.gz
krb5-484f2c118521d1976a989414b314a29e540137f9.tar.xz
krb5-484f2c118521d1976a989414b314a29e540137f9.zip
KfW build automation:
Consolidate all command line switch info in one section of the config.xml, flatten structure. Don't prune .../site/... . Use getopts negate option where possible. New method of dealing with repository options, driven from config xml. Adjust code to find switches in new place. Hardwire default config to bkwconfig.xml. Makes "bkw.pl" the out-of-the-box command line. Hardwire unixfind path to C:\tools\cygwin\bin. Add filver to required programs list. Update documentation. Target_Version: 1.6.1 Ticket: 5521 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19430 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/windows/build')
-rw-r--r--src/windows/build/BKWconfig.xml79
-rw-r--r--src/windows/build/bkw-automation.html652
-rw-r--r--src/windows/build/bkw.pl228
-rw-r--r--src/windows/build/copyfiles.pl6
-rw-r--r--src/windows/build/makeZip.pl14
-rw-r--r--src/windows/build/pruneFiles.pl2
-rw-r--r--src/windows/build/signFiles.pl2
7 files changed, 537 insertions, 446 deletions
diff --git a/src/windows/build/BKWconfig.xml b/src/windows/build/BKWconfig.xml
index 35ba056505..31294ea669 100644
--- a/src/windows/build/BKWconfig.xml
+++ b/src/windows/build/BKWconfig.xml
@@ -1,38 +1,55 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- BKW: Build Kerberos for Windows -->
<BKW_Config>
- <CommandLine>
- <!-- The most changeable parameters can be specified on the command line. -->
- <Tags>
- <cvs value="" />
- <svntag value="" />
- <svnbranch value="" />
- </Tags>
- <Directories>
- <!-- Sources will be checked out of repositories into <src>. The structure
- of the repositories will cause pismere/athena to be created under <src>. -->
- <src path ="C:\projects\Autobuild" />
- <out path ="C:\projects\Autobuild\public" /> <!-- Must be absolute path. -->
- </Directories>
- <Options>
- <debug value="0" />
- <logfile value="1" path="bkw.pl.log" />
- <repository value="skip" />
- <clean value="0" />
- <nomake value="0" />
- <nopackage value="0" />
- <sign value="0" />
- <verbose value="0" />
- <vverbose value="0" />
- </Options>
- </CommandLine>
+ <Config>
+ <!-- All the parameters are specified here. They can be over-ridden
+ on the command line.
+
+ Parameters are grouped into Options, Directories, Repository and Environment.
+
+ Attributes a parameter can have:
+ def: defined or not. A value of 'A' for 'always' means the
+ option can't be negated on the command line.
+ value: string value, if the option can have a value. If the option
+ can't take a value, omit the value attribute.
+ options: space-delimited list, the 1st element is the default.
+ Synonyms for a valid option are concatenated with '|'.
+ env: an environment variable will be set to value or deleted,
+ depending on def.
+ -->
+ <!-- Options: -->
+ <clean def="0" />
+ <debug def="0" />
+ <help def="0" />
+ <logfile def="1" value="bkw.pl.log" />
+ <make def="1" />
+ <package def="1" />
+ <repository def="1" value="skip" options="skip checkout|co update|up" />
+ <sign def="0" />
+ <verbose def="0" />
+ <vverbose def="0" />
+
+ <!-- Directory settings: -->
+ <!-- Sources will be checked out of repositories into <src>. The structure
+ of the repositories will cause pismere/athena to be created under <src>. -->
+ <src def="A" value="C:\KfW" /> <!-- Must be absolute path. -->
+ <out def="A" value="C:\KfW\public" /> <!-- Must be absolute path. -->
+
+ <!-- Repository settings: -->
+ <cvstag def="0" value="" />
+ <svntag def="0" value="" />
+ <svnbranch def="0" value="" />
+ <CVSROOT def="A" value=":kserver:cvs.mit.edu:/cvs/pismere" />
+ <SVNURL def="A" value="svn.mit.edu" /> <!-- NB: No protocol or slashes!! -->
+ <USERNAME def="0" value="" /> <!-- Needed for svn/plink. Override from command line -->
+
+ <!-- Environment variables: -->>
+ <KH_RELEASE def="1" env="1" value="OFFICIAL" options="OFFICIAL PRERELEASE PRIVATE" />
+ <NODEBUG def="1" env="1" /> <!-- Interacts with /DEBUG -->
+
+ </Config>
<Stages>
<FetchSources>
- <Config>
- <CVSROOT name=":kserver:cvs.mit.edu:/cvs/pismere" />
- <SVNURL name="svn.mit.edu" /> <!-- NB: No protocol or slashes!! -->
- <USERNAME name="" /> <!-- Needed for svn/plink. Override from command line -->
- </Config>
<Zips>
<Zip dummy="foo" /> <!-- To force desired XML::Simple behavior -->
<Zip name="SRC" filename="%filestem%-src.zip" topdir="%filestem%-final">
@@ -52,7 +69,7 @@
<Prune name="CVS" />
<Prune name=".cvsignore" flags="i" />
<Prune name="Changelog" flags="i" />
- <Prune name="site" />
+<!-- <Prune name="site" /> -->
</Prunes>
<Requires>
<Switch dummy="foo" />
diff --git a/src/windows/build/bkw-automation.html b/src/windows/build/bkw-automation.html
index eb41053c5b..d463df3a6b 100644
--- a/src/windows/build/bkw-automation.html
+++ b/src/windows/build/bkw-automation.html
@@ -1,295 +1,361 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0066)https://confab.mit.edu/confluence/display/ISDA/lore-bkw-automation -->
-<HTML>
- <HEAD>
- <TITLE>lore-bkw-automation - Confluence</TITLE>
- <META http-equiv="Content-Type" content="text/html; charset=utf-8">
- <META http-equiv="Pragma" content="no-cache">
- <META http-equiv="Expires" content="-1">
- <LINK href="css/main-action.css" type="text/css" rel="stylesheet">
- <LINK href="css\main-action(1).css" type="text/css" rel="stylesheet">
- <META content="MSHTML 6.00.2900.3059" name="GENERATOR"></HEAD>
- <BODY>
- <DIV style="MARGIN-LEFT: 10px; MARGIN-RIGHT: 10px" align="left">
- <DIV class="wiki-content" style="MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px" align="left">The
- Kerberos For Windows build is being automated. This description consists of
- </DIV>
- <UL>
- <LI>
- <A href="#lore-bkw-automation-Buildsteps">Build steps</A>
- <LI>
- <A href="#Script-structure">Script structure</A>
- <LI>
- <A href="#Configfile">Config file</A>
- <LI>
- <A href="#Remainingwork">Remaining work / bug list</A>
- <LI>
- <A href="#Troubleshooting">Troubleshooting</A></LI>
- </UL>
- <H2><A name="lore-bkw-automation-Buildsteps"></A>Build steps</H2>
- <P>Building the complete KfW product consists of these steps:</P>
- <UL>
- <LI>
- Setting up the environment
- <LI>
- Fetching sources from repositories
- <LI>
- Building the sources with nmake
- <LI>
- Setting up the packaging environment
- <LI>
- Building the two installers -- a msi installer and an exe installer
- <LI>
- Building other distribution components
- <UL>
- <LI>
- KfW source distribution
- <LI>
- KfW core binaries
- <LI>
- KfW SDK
- <LI>
- Microsoft redistributable components
- <LI>
- Individual files: release notes, Leash user guide, MSI Deployment Guide.
- </LI>
- </UL>
- </LI>
- </UL>
- <H2><A name="Script-structure"></A>Script structure</H2>
- <P>The build is a perl script controlled by command line switches and an XML
- configuration file. The config file is required. Settings in the config file
- can be overridden by optional command line switches.</P>
- <P>The main steps in the script are</P>
- <UL>
- <LI>
- Setting up the environment
- <LI>
- Fetching the sources from repositories
- <LI>
- Building the sources
- <LI>
- Setting up the packaging environment
- <LI>
- Building the msi with the package nmake
- <LI>
- Building the rest of the components
- </LI>
- </UL>
- <P>The usage message shows the available switches:</P>
- <P><TT>C:\Projects\KfW&gt;perl bkw.pl /?</TT><BR>
- <TT>Usage: bkw.pl (-f --config) config-file [options] NMAKE-options</TT></P>
- <P><TT>Options are case insensitive.</TT></P>
- <P><TT>Options:</TT><BR>
- <TT>/help /? usage information (what you now see)</TT><BR>
- <TT>/srcdir dir&nbsp;&nbsp; Source directory to use. Should contain</TT><BR>
- <TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- pismere/athena. If cvstag or svntag is null,</TT><BR>
- <TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- the directory should be prepopulated.</TT><BR>
- <TT>/cvstag tag&nbsp;&nbsp; \ For whichever of these tags is specified,</TT><BR>
- <TT>/svntag url&nbsp;&nbsp; / a checkout will be done into srcdir</TT><BR>
- <TT>/debug&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Do debug make instead of
- release make</TT><BR>
- <TT>/outdir dir&nbsp;&nbsp; Directory to be created where build results will go</TT><BR>
- <TT>/nomake&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Skip make step</TT><BR>
- <TT>/nopackage&nbsp;&nbsp;&nbsp;&nbsp;Skip packaging step</TT><BR>
- <TT>/clean&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Build clean target</TT><BR>
- <TT>/verbose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Debug mode - verbose output</TT><BR>
- <TT>/vverbose&nbsp;&nbsp;&nbsp;&nbsp; very verbose output</TT><BR>
- <TT>/config path&nbsp; Path to config file</TT><BR>
- <TT>/logfile path Where to write output. If omitted, ...</TT><BR>
- <TT>/srcdir dir&nbsp;&nbsp; Source directory to use. Should contain
- <BR>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT><TT>pismere/athena.
- If cvstag or svntag is null,
- <BR>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- the directory should be prepopulated.
- <BR>
- </TT><TT>/outdir dir&nbsp;&nbsp; Directory to be created where build results will
- go
- <BR>
- /repository checkout | co \ What repository action to take.
- <BR>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </TT><TT>update&nbsp;&nbsp;
- | up | Options are to checkout, update or<BR>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;skip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- / take no action [skip].
- <BR>
- /cvstag tag&nbsp;&nbsp; \ For whichever of these tags is specified,
- <BR>
- </TT><TT>/svntag url&nbsp;&nbsp; / the repository action will be done into srcdir
- <BR>
- /debug&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Do debug make instead of
- release make
- <BR>
- /nomake&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Skip make step
- <BR>
- /nopackage&nbsp;&nbsp;&nbsp; Skip packaging step
- <BR>
- /clean&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Build clean target
- <BR>
- /verbose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Debug mode - verbose output
- <BR>
- /config path&nbsp; Path to config file
- <BR>
- /logfile path Where to write output. If omitted, ...<BR>
- </TT><TT>Other:</TT><BR>
- <TT>NMAKE-options any options you want to pass to NMAKE, which can be:</TT><BR>
- <TT>(note: /nologo is always used)</TT><BR>
- <TT>[ nmake options follow ]</TT></P>
- <P>Additional controls, not available from the command line:</P>
- <P><TT>&lt;CVSROOT name=":kserver:cvs.mit.edu:/cvs/pismere" /&gt;</TT><BR>
- <TT>&lt;SVNURL name="" /&gt;</TT><BR>
- <TT>&lt;CopyList&gt;&lt;Config&gt;&lt;DebugArea value="dbg" /&gt;</TT><BR>
- <TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- &lt;ReleaseArea value="rel" /&gt;</TT><BR>
- <TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;AlwaysTag
- value="%bldtype%" /&gt;</TT><BR>
- <TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- &lt;DebugTag value="%debug%" /&gt;</TT><BR>
- <TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- &lt;ReleaseTag value="%release%" /&gt;</TT><BR>
- <TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- &lt;Files&gt;&lt;Include path="copyfiles.xml" /&gt;</TT></P>
- <P><TT><FONT face="Verdana">The pre-package steps gathers up build results and puts them in
- a <FONT face="Courier">target</FONT> area.&nbsp; "target" is hardwired in the
- build script.</FONT></TT></P>
- <P><TT><FONT face="Verdana">The post-package step zips up various files and then copies the
- zips and other files to<FONT face="Courier"><EM>srcdir</EM></FONT>/<FONT face="Courier">public</FONT>.&nbsp;
- "public" is hardwired in the build script.</FONT></TT></P>
- <H2><A name="#Configfile"></A>Config file</H2>
- <H3>
- CopyLists</H3>
- <P>
- CopyLists are used in many places.&nbsp;&nbsp;There is an optional
- Configuration section and a required Files section.&nbsp;</P>
- <P>The configuration section defines the roots of the from and to paths and can
- optionally define path substitutions.&nbsp;
- </P>
- <P>Internally, the to and from paths are required.&nbsp; They are forced by the
- script rather than being set in the config file.&nbsp; Comments in the copyfile
- xml indicate this.</P>
- <P>The overall build configuration specifies a debug or release build.&nbsp; The
- debug and release results are put in different places.&nbsp; File entries can
- indicate a variable part of a path with a tag such as %bldtype%.&nbsp; The
- script will substitute %bldtype% with either dbg or rel, depending on the build
- type.&nbsp; The substitution tags are specified with these declarations:</P>
- <P>
- <TABLE id="Table1" height="0" cellSpacing="1" cellPadding="1" border="1">
- <TR>
- <TD>DebugArea</TD>
- <TD height="21">Path value used in debug build.&nbsp; Must match what the build
- script uses.&nbsp; Typically "dbg."</TD>
- </TR>
- <TR>
- <TD>ReleaseArea</TD>
- <TD height="9">Path value used in release build.&nbsp; Must match the build
- script.&nbsp; Typically "rel."</TD>
- </TR>
- <TR>
- <TD>AlwaysTag</TD>
- <TD height="17">String in file entries which will always be changed to either
- DebugArea or ReleaseArea. File is always copied.&nbsp; Typically "%bldtype%."</TD>
- </TR>
- <TR>
- <TD>DebugTag</TD>
- <TD>String in file entries which will only be changed to DebugArea during a debug
- build.&nbsp; File is only copied in a debug build.&nbsp; Typically "%debug%."</TD>
- </TR>
- <TR>
- <TD>ReleaseTag</TD>
- <TD>String in file entries which will only be changed to ReleaseArea during a
- release build.&nbsp; File is only copied in a release build.&nbsp; Typically
- "%release%."</TD>
- </TR>
- <TR>
- <TD>FileStem</TD>
- <TD>%filestem% will always be changed to FileStem.&nbsp; Example:&nbsp;
- "kfw-3-2-0."&nbsp; This is used in when building or copying the final build
- results.</TD>
- </TR>
- </TABLE>
- </P>
- <P><STRONG>Example</STRONG></P>
- <P>Each segment of the file's path that comes from a different place is in a
- different color.</P>
- <P>
- Release build.&nbsp; Config file:
- </P>
- <P>
- <TABLE id="Table2" cellSpacing="1" cellPadding="1" border="0">
- <TR>
- <TD colspan="4"><FONT face="courier">&lt;BKW_Config&gt;</FONT></TD>
- </TR>
- <TR>
- <TD width="23"></TD>
- <TD colspan="3"><FONT face="courier">&lt;CommandLine&gt;</FONT></TD>
- </TR>
- <TR>
- <TD width="23"></TD>
- <TD width="20"></TD>
- <TD colspan="2"><FONT face="courier">&lt;Directories&gt;</FONT></TD>
- </TR>
- <TR>
- <TD width="23"></TD>
- <TD width="20"></TD>
- <TD width="22"></TD>
- <TD><FONT face="courier">&lt;src path ="<FONT color="#000099">C:\projects\Autobuild"</FONT>
- /&gt;</FONT>
- </TD>
- </TR>
- </TABLE>
- </P>
- <P>Copylist comments:</P>
- <P class="code">
- &lt;!-- File from paths are relative to
- <src>\<FONT color="#ff00cc">pismere\athena</FONT> --&gt;
-<BR>
- &lt;!-- File to paths are relative to <src>\<FONT color="#00ff00">pismere\staging</FONT>
- --&gt;
- </P>
- <P>When the script processes this copylist, it will force the from and to paths as
- indicated.</P>
- <P>This line
- </P>
- <P class="code">&lt;File name="<FONT color="#00ffff">comerr32.dll</FONT>" from="<FONT color="#ff9933">..\target\bin\i386</FONT>\<FONT color="#ff0000">%bldtype%</FONT>\"
- to="\<FONT color="#9966ff">bin\i386</FONT>" /&gt;</P>
- <P>will result in <FONT face="Courier"><FONT color="#000099">C:\projects\Autobuild</FONT>\<FONT color="#ff00cc">pismere\athena</FONT>\<FONT color="#ff9933">..\target\bin\i386</FONT>\<FONT color="#ff0000">rel</FONT>\<FONT color="#00ffff">comerr32.dll</FONT></FONT></P>
- <P>being copied to <FONT face="Courier"><FONT color="#000099">C:\projects\Autobuild</FONT>\<FONT color="#00ff00">pismere\staging</FONT>\<FONT color="#9966ff">bin\i386</FONT>\<FONT color="#00ffff">comerr32.dll</FONT></FONT>.</P>
- <TT>
- <P>
- Other possible attributes in a copylist entry:</P>
- <UL>
- <LI>
- <TT>notrequired</TT>
- <LI>
- <TT>newname="filename"</TT>
- </LI>
- </UL>
- <P>By default, copylist entries are required and the script will die if they aren't
- present. To ignore missing files, add <TT>notrequired</TT>.</P>
- <P>To rename the file, set the <TT>newname</TT> attribute.</P>
- <P>Lengthy copy lists can be kept in separate files and included with the Include
- directive.&nbsp; Example:</P>
- <P class="code">&lt;Include path="sdkfiles.xml" /&gt;</P>
- <H2><FONT face="Verdana"><A name="Remainingwork"></A>Remaining work / bug list</FONT></H2>
- <P>This is a work in progress. What's left:</P>
- <P>Bugs:</P>
- <UL>
- <LI>
- <FONT face="Verdana">Eliminate need for redundant <TT>/debug debug</TT>. </FONT>
- <LI>
- <FONT face="Verdana">Handle checkout into non-existant directory.</FONT>
- </LI>
- </UL>
- <H2><FONT face="Verdana"><A name="Troubleshooting"></A>Troubleshooting</FONT>
- </TT></H2>
- <P><TT><FONT face="Verdana"><STRONG>svn can't create tunnel:<BR>
- </STRONG>Make sure environment variable SVN_SSH points to a valid
- plink.exe.&nbsp; Path separators must be backslashes and must be doubled.</FONT></TT><TT></P>
- </TT>
- </DIV>
- </BODY>
+<!-- saved from url=(0066)https://confab.mit.edu/confluence/display/ISDA/lore-bkw-automation --><HTML><HEAD>
+ <TITLE>lore-bkw-automation - Confluence</TITLE>
+ <META http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <META http-equiv="Pragma" content="no-cache">
+ <META http-equiv="Expires" content="-1">
+ <LINK href="css/main-action.css" type="text/css" rel="stylesheet">
+ <LINK href="css\main-action(1).css" type="text/css" rel="stylesheet">
+ <META content="MSHTML 6.00.2900.3059" name="GENERATOR"></HEAD>
+ <BODY>
+ <DIV style="MARGIN-LEFT: 10px; MARGIN-RIGHT: 10px" align="left">
+ <DIV class="wiki-content" style="MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px" align="left">The
+ Kerberos for Windows (KfW) build is automated.&nbsp; A script will fetch the
+ sources from a repository and then build, sign and package all the KfW
+ distribution components.
+ </DIV>
+ <DIV class="wiki-content" style="MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px" align="left">This
+ description consists of
+ </DIV>
+ <UL>
+ <LI>
+ <A href="#Environment">Setting up the build environment</A>
+ <LI>
+ <A href="#Running">Running the script</A>
+ <LI>
+ <A href="Details">Script internal details</A>
+ <LI>
+ <A href="#Remainingwork">Remaining work / bug list</A>
+ <LI>
+ <A href="#Troubleshooting">Troubleshooting</A>
+ </LI>
+ </UL>
+ <H2>Setting Up the Build Environment</H2>
+ <P>KfW is built on a Windows PC, in the default Windows shell (cmd.exe). These
+ components must be installed:</P>
+ <UL>
+ <LI>
+ Visual Studio 2003<BR>
+ Versions of Visual Studio before or after 2003 are not supported.
+ <LI>
+ A recent release of the
+ <SPAN class="nobr">
+ <A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&amp;displaylang=en">
+ Microsoft Platform SDK</A></SPAN>
+ &nbsp;
+ <LI>
+ <SPAN class="nobr">
+ <A title="Visit page outside Confluence" href="http://www.activestate.com" rel="nofollow">
+ ActiveState Perl 5.8 or more recent</A></SPAN><BR>
+ Build 631 is known to work.
+ <LI>
+ <SPAN class="nobr">
+ <A title="Visit page outside Confluence" href="http://www.doxygen.org/" rel="nofollow">
+ Doxygen</A></SPAN>
+ <LI>
+ sed, awk, cat, rm and find<BR>
+ These can be obtained from the
+ <SPAN class="nobr">
+ <A title="Visit page outside Confluence" href="http://cygwin.com/" rel="nofollow">Cygwin
+ distribution</A></SPAN>.
+ <BR clear="all">
+ <BR clear="all">
+ find must be in C:\tools\cygwin\bin, so install Cygwin in C:\tools\cygwin.
+ <BR>
+ <BR>
+ The cygwin awk is a link and the MS shell doesn't deal well with that.&nbsp; <TT>C</TT>
+ opy <TT>c:\tools\cygwin\bin\gawk</TT> to <TT>c:\tools\cygwin\bin\awk</TT>.
+ <LI>
+ <SPAN class="nobr">
+ <A title="Visit page outside Confluence" href="http://sourceforge.net/project/showfiles.php?group_id=105970"
+ rel="nofollow">Wix</A></SPAN>
+ <LI>
+ <SPAN class="nobr">
+ <A title="Visit page outside Confluence" href="http://nsis.sourceforge.net" rel="nofollow">
+ NSIS</A></SPAN></LI></UL>
+ <H3>Environment variables</H3>
+ <P>
+ All the components above must be in PATH. Installing ActivePerl puts perl in
+ the PATH. Doxygen, Cygwin, hhc, wix and&nbsp;nsis need to be added.</P>
+ <P>perl must be installed so that .pl files are automatically executed with perl.
+ The ActivePerl installation will do this for you.</P>
+ <P>In the INCLUDE path, the Microsoft Platform SDK must come before the Microsoft
+ Visual C++ include files. Using a Platform SDK Build Environment window will
+ set this up the right way.&nbsp;</P>
+ <P>If you make your path modifications permanent via Control Panel / System /
+ Advanced / Environment Variables:&nbsp; If you use a Platform SDK Build
+ Environment window, it appears that you need to put your PATH components in the
+ System PATH, not the User PATH.</P>
+ <P>Visual Studio installs hhc in C:\Program Files\HTML Help Workshop.</P>
+ <P>nmake must be in PATH. If you use a Platform SDK build environment window, it is
+ already done for you.</P>
+ <h2>Running the Script<A name="Running"></A></h2>
+ <P>
+ The build is a perl script controlled by command line switches and an XML
+ configuration file. The config file is required. Settings in the config file
+ can be overridden by optional command line switches.&nbsp;</P>
+ <P>There are options for controlling most steps of the build process.&nbsp; The
+ steps are</P>
+ <UL>
+ <LI>
+ Verifying the environment
+ <LI>
+ Fetching the sources from repositories
+ <LI>
+ Building the sources
+ <LI>
+ Setting up the packaging environment
+ <LI>
+ Building the installers
+ <LI>
+ Building the rest of the components
+ </LI>
+ </UL>
+ <P>The usage message shows the switches that control these steps:</P>
+ <P><TT>C:\Projects\KfW&gt;perl bkw.pl /?</TT><BR>
+ <TT>Usage: bkw.pl [options] NMAKE-options</TT></P>
+ <P><TT>&nbsp; Options are case insensitive. </TT>
+ </P>
+ <P><TT>&nbsp; Options:&nbsp;
+ <BR>
+ </TT><TT>&nbsp; /help /?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ usage information (what you now see).
+ <BR>
+ &nbsp; /config /f path&nbsp;&nbsp; Path to config file. Default is
+ bkwconfig.xml.
+ <BR>
+ &nbsp; /src /r dir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Source directory to use.
+ Should contain
+ <BR>
+ &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ pismere/athena. If cvstag or svntag is&nbsp;null,
+ <BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ the directory should be prepopulated.
+ <BR>
+ &nbsp; /out /o dir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Directory to be created
+ where build results will go
+ <BR>
+ </TT><TT>&nbsp; /repository checkout | co \ What repository action to take.
+ <BR>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ update&nbsp;&nbsp; | up&nbsp; ) Options are to checkout, update or
+ <BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ skip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/ take no
+ action [skip].
+ <BR>
+ &nbsp; /username /u name username used to access svn if checking out.
+ <BR>
+ &nbsp; /cvstag /c tag&nbsp;&nbsp;&nbsp; use -r &lt;tag&gt;
+ <TAG>in cvs
+command <BR>&nbsp; /svnbranch /b tag use
+/branches/&lt;tag&gt;<TAG>&nbsp;instead of /trunk.<BR>&nbsp; /svntag /s tag&nbsp;&nbsp;&nbsp; use
+/tags/&lt;tag&gt;<TAG>&nbsp;instead of /trunk.<BR>&nbsp; /debug
+/d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Do&nbsp;debug make instead of
+release make. <BR>&nbsp;
+/[no]make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Control the make
+step. <BR>&nbsp;
+/clean&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Build
+clean target. <BR>&nbsp;
+/[no]package&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Control the packaging step. <BR>&nbsp;
+/[no]sign&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Control
+signinf
+of executable&nbsp;files. <BR>&nbsp; /verbose
+/v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Debug mode - verbose output. <BR>&nbsp; /logfile /l path&nbsp; Where to write output.
+Default is bkw.pl.log. <BR>&nbsp;
+ /nolog&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Don't
+ save output. </TT>
+ </P>
+ <P><TT>&nbsp; Other:
+ <BR>
+ &nbsp;&nbsp;&nbsp; NMAKE-options any options you want to pass to NMAKE, which
+ can be:
+ <BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ (note: /nologo is always used)<BR>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NODEBUG=1</TT></P>
+ <P><TT>NMAKE-options any options you want to pass to NMAKE, which can be:</TT><BR>
+ <TT>(note: /nologo is always used)</TT><BR>
+ <TT>[ nmake options follow ]</TT></P>
+ <P><BR>
+ Notes on the script steps:</P>
+ <P><STRONG>Verifying the environment</STRONG>:&nbsp;
+ <BR>
+ The script tests for each program that it needs and warns if the program isn't
+ found.</P>
+ <P><STRONG>Fetching sources from repositories</STRONG>:&nbsp;
+ <BR>
+ If building from a source distribution kit, this section does not apply.</P>
+ <P>CVSROOT and SVNURL must be specified in the configuration file.</P>
+ <P>A source zip file can only be produced if checking out fresh sources from a
+ repository.&nbsp;</P>
+ <P>If checking out, the entire pismere directory will be deleted.&nbsp; A warning
+ message requires that you confirm this action.</P>
+ <P><STRONG>Building the sources:</STRONG><BR>
+ /DEBUG controls whether a debug or release build is done.&nbsp; /CLEAN will
+ build the CLEAN target.</P>
+ <P><STRONG>Setting up the packaging environment :<BR>
+ </STRONG>The pre-package steps gathers up build results and puts them in a <FONT face="Courier">
+ staging</FONT> area.&nbsp;
+ </P>
+ <P>If /SIGN is specified, <FONT face="Courier">.exe</FONT>s, <FONT face="Courier">.dll</FONT>s
+ and <FONT face="Courier">.cpl</FONT>s are signed.&nbsp; The signing command
+ template is in the configuration file.</P>
+ <P><STRONG>Building the installers:</STRONG><BR>
+ The <FONT face="Courier">staging </FONT>area is copied into a fresh area for
+ each of the installers.&nbsp; The installer results are copied back to the <FONT face="Courier">
+ staging </FONT>area.</P>
+ <P><STRONG>Building the rest of the components:</STRONG><BR>
+ Zip files are built in temporary areas and copied to <FONT face="Courier">outdir</FONT>.&nbsp;
+ The installers and assorted files are copied from <FONT face="Courier">staging</FONT>
+ to <FONT face="Courier">outdir</FONT>.&nbsp; If /SIGN is specified, the
+ installers will be signed.</P>
+ <P>&nbsp;</P>
+ <H2><A name="Details"></A>Script Internal Details</H2>
+ <H3><A name="Copylists"></A>Copy Lists</H3>
+ <P>CopyLists are used in many places.&nbsp;&nbsp;For example, files to be put into
+ a .zip are copied to a fresh directory which is then zipped up.&nbsp; There is
+ an optional Configuration section and a required Files section.&nbsp;</P>
+ <P>The configuration section defines the roots of the from and to paths and can
+ optionally define path substitutions.&nbsp;
+ </P>
+ <P>The to and from paths are forced by the script rather than being set in the
+ config file.&nbsp; Comments in the copyfile xml indicate this.</P>
+ <P>Lengthy copy lists can be kept in separate files and included with the Include
+ directive.&nbsp; Example:</P>
+ <P><TT>&lt;Include path="sdkfiles.xml" /&gt;</TT></P>
+ <H3>Substitution tags</H3>
+ <P>Filenames in copylists can contain variable 'tags' that are replaced before the
+ file is copied.&nbsp; Some configuration files contain substitution tags which
+ customize the configuration.&nbsp; The supported tags are</P>
+ <P>
+ <TABLE id="Table3" height="0" cellSpacing="1" cellPadding="1" border="1">
+ <TR>
+ <TD width="136">%VERSION_MAJOR%</TD>
+ <TD height="21">KfW Version from pismere/athena/include/kerberos.ver.</TD>
+ </TR>
+ <TR>
+ <TD width="136">%VERSION_MINOR%</TD>
+ <TD height="9">KfW Version from pismere/athena/include/kerberos.ver.</TD>
+ </TR>
+ <TR>
+ <TD width="136">%VERSION_PATCH%</TD>
+ <TD height="17">KfW Version from pismere/athena/include/kerberos.ver.</TD>
+ </TR>
+ <TR>
+ <TD width="136">%filestem%</TD>
+ <TD height="17">Defined as kfw-%VERSION_MAJOR%-%VERSION_MINOR%-%VERSION_PATCH%.</TD>
+ </TR>
+ <TR>
+ <TD width="136">%debug%</TD>
+ <TD>'dbg.'&nbsp; Only substituted during a debug build.&nbsp;</TD>
+ </TR>
+ <TR>
+ <TD width="136">%release%</TD>
+ <TD>'rel.'&nbsp; Only substituted during a release build.&nbsp;
+ </TD>
+ </TR>
+ <TR>
+ <TD width="136">%bldtype%</TD>
+ <TD>Always substituted, to 'dbg' or 'rel,' depending on the type of build.</TD>
+ </TR>
+ <TR>
+ <TD width="136">%-DEBUG%</TD>
+ <TD>'-DEBUG' during a debug build; otherwise empty.</TD>
+ </TR>
+ <TR>
+ <TD width="136">%BUILDDIR%</TD>
+ <TD>SRCDIR\pismere.&nbsp; Used in site-local installer configuration files.</TD>
+ </TR>
+ <TR>
+ <TD width="136">%TARGETDIR%</TD>
+ <TD>SRCDIR\pismere\staging.&nbsp; Used in site-local installer configuration files.</TD>
+ </TR>
+ <TR>
+ <TD width="136">%CONFIGDIR-WIX%</TD>
+ <TD>SRCDIR\pismere\staging\sample.&nbsp; Used in site-local installer configuration
+ files.</TD>
+ </TR>
+ <TR>
+ <TD width="136">%CONFIGDIR-NSI%</TD>
+ <TD>SRCDIR\pismere\staging.&nbsp; Used in site-local installer configuration files.</TD>
+ </TR>
+ </TABLE>
+ </P>
+ <P>The overall build configuration specifies a debug or release build.&nbsp; Debug
+ and release results are put in different places.&nbsp; Files whose location
+ depend on the build type can use %bldtype% in their names.&nbsp; The script
+ will substitute %bldtype% with either dbg or rel, depending on the build
+ type.&nbsp;<STRONG></P>
+ </DIV>
+ <DIV style="MARGIN-LEFT: 10px; MARGIN-RIGHT: 10px" align="left">
+ <H3>Example</H3>
+ </STRONG>
+ <P>Here is&nbsp;a copylist entry.&nbsp; Each segment of the file's path that comes
+ from a different place is in a different color.</P>
+ <P>Release build.&nbsp; Config file:
+ </P>
+ <P>
+ <TABLE id="Table2" cellSpacing="1" cellPadding="1" border="0">
+ <TR>
+ <TD colSpan="4"><FONT face="courier">&lt;BKW_Config&gt;</FONT></TD>
+ </TR>
+ <TR>
+ <TD width="23"></TD>
+ <TD colSpan="3"><FONT face="courier">&lt;CommandLine&gt;</FONT></TD>
+ </TR>
+ <TR>
+ <TD width="23"></TD>
+ <TD width="20"></TD>
+ <TD colSpan="2"><FONT face="courier">&lt;Directories&gt;</FONT></TD>
+ </TR>
+ <TR>
+ <TD width="23"></TD>
+ <TD width="20"></TD>
+ <TD width="22"></TD>
+ <TD><FONT face="courier">&lt;src path ="<FONT color="#000099">C:\bkw"</FONT> /&gt;</FONT>
+ </TD>
+ </TR>
+ </TABLE>
+ </P>
+ <P>Copylist comments:</P>
+ <P><tt>&lt;!-- File from paths are relative to
+ <src>\<FONT color="#ff00cc">pismere\athena</FONT> --&gt; <BR>&lt;!-- File to paths are relative to <src>\<FONT color="#00ff00">
+ pismere\staging</FONT>
+ --&gt; </tt>
+ </P>
+ <P>When the script processes this copylist, it will force the from and to paths as
+ indicated.</P>
+ <P>This line
+ </P>
+ <P><tt>&lt;File name="<FONT color="#00ffff">comerr32.dll</FONT>" from="<FONT color="#ff9933">..\target\bin\i386</FONT>\<FONT color="#ff0000">%bldtype%</FONT>\"
+ to="\<FONT color="#9966ff">bin\i386</FONT>" /&gt;</tt></P>
+ <P>will result in <FONT face="Courier"><FONT color="#000099">C:\bkw</FONT>\<FONT color="#ff00cc">pismere\athena</FONT>\<FONT color="#ff9933">..\target\bin\i386</FONT>\<FONT color="#ff0000">rel</FONT>\<FONT color="#00ffff">comerr32.dll</FONT></FONT></P>
+ <P>being copied to <FONT face="Courier"><FONT color="#000099">C:\bkw</FONT>\<FONT color="#00ff00">pismere\staging</FONT>\<FONT color="#9966ff">bin\i386</FONT>\<FONT color="#00ffff">comerr32.dll</FONT></FONT>.</P>
+ <P>Other possible attributes in a copylist entry:</P>
+ <UL>
+ <LI>
+ <TT>notrequired</TT>
+ <LI>
+ <TT>newname="filename"</TT>
+ </LI>
+ </UL>
+ <P>By default, copylist entries are required and the script will die if they aren't
+ present. To ignore missing files, add <TT>notrequired</TT>.</P>
+ <P>To rename the file, set the <TT>newname</TT> attribute.</P>
+ <H2><FONT face="Verdana"><A name="Remainingwork"></A>Remaining Work / Bug List</FONT></H2>
+ <P>Implement RETAIL, OFFICIAL, PRERELEASE, PRIVATE, SPECIAL.</P>
+ <P>Figure out what MIT_ONLY, BUILD_KFW, DEBUG_SYMBOL should be.</P>
+ <P>TARGET, APPVER.</P>
+ <P>NODEBUG=1.&nbsp; Set if release build.</P>
+ <H2><FONT face="Verdana"><A name="Troubleshooting"></A>Troubleshooting</FONT>
+ </H2>
+ <P><STRONG>Can't clean directory; can't delete file or directory</STRONG><BR>
+ Make sure a file in the named directory isn't open in another application.</P>
+ </DIV>
+ </BODY>
</HTML>
diff --git a/src/windows/build/bkw.pl b/src/windows/build/bkw.pl
index 2f7c6be137..ea7c192ac9 100644
--- a/src/windows/build/bkw.pl
+++ b/src/windows/build/bkw.pl
@@ -34,13 +34,13 @@ sub get_info {
sub usage {
print <<USAGE;
-Usage: $0 (-f --config) config-file [options] NMAKE-options
+Usage: $0 [options] NMAKE-options
Options are case insensitive.
Options:
/help /? usage information (what you now see).
- /config /f path Path to config file.
+ /config /f path Path to config file. Default is bkwconfig.xml.
/srcdir /r dir Source directory to use. Should contain
pismere/athena. If cvstag or svntag is null,
the directory should be prepopulated.
@@ -50,17 +50,16 @@ Usage: $0 (-f --config) config-file [options] NMAKE-options
skip / take no action [skip].
/username /u name username used to access svn if checking out.
/cvstag /c tag use -r <tag> in cvs command
- /svnbranch /b tag append /branches/<tag> to svn path.
- /svntag /s tag append /tags/<tag> to svn path.
+ /svnbranch /b tag use /branches/<tag> instead of /trunk.
+ /svntag /s tag use /tags/<tag> instead of /trunk.
/debug /d Do debug make instead of release make.
- /nomake Skip make step.
+ /[no]make Control the make step.
/clean Build clean target.
- /nopackage Skip packaging step.
- /sign Sign files
- /nosign Don't sign files
+ /[no]package Control the packaging step.
+ /[no]sign Control signing of executable files.
/verbose /v Debug mode - verbose output.
- /logfile /l path Where to write output. Default is bkw.pl.log
- /nolog Don't save output
+ /logfile /l path Where to write output. Default is bkw.pl.log.
+ /nolog Don't save output.
Other:
NMAKE-options any options you want to pass to NMAKE, which can be:
(note: /nologo is always used)
@@ -82,6 +81,9 @@ EOH
}
sub main {
+ local $cmdline = "bkw.pl";
+ foreach $arg (@ARGV) {$cmdline .= " $arg";}
+
Getopt::Long::Configure('no_bundling', 'no_auto_abbrev',
'no_getopt_compat', 'require_order',
'ignore_case', 'pass_through',
@@ -92,21 +94,21 @@ sub main {
'cvstag|c:s',
'svntag|s:s',
'svnbranch|b:s',
- 'srcdir|r:s',
- 'outdir|o:s',
+ 'src|r:s',
+ 'out|o:s',
'debug|d',
- 'config|f:s',
+ 'nodebug',
+ 'config|f=s',
'logfile|l:s',
'nolog',
'repository:s',
'username|u:s',
'verbose|v',
'vverbose',
- 'nomake',
+ 'make!',
'clean',
- 'nopackage',
- 'sign',
- 'nosign',
+ 'package!',
+ 'sign!',
);
if ( $OPT->{help} ) {
@@ -114,17 +116,22 @@ sub main {
exit(0);
}
+ delete $OPT->{foo};
+
##++ Validate required conditions:
- if ($OPT->{config}) {}
- else {
- print "Fatal -- Configuration file must be specified.\n";
+ local $argvsize = @ARGV;
+ if ($argvsize > 0) {
+ print "Error -- invalid argument: $ARGV[0]\n";
usage();
- exit(0);
+ die;
}
+
+ if (! exists $OPT->{config}) {$OPT->{config} = "bkwconfig.xml";}
# List of programs which must be in PATH:
- my @required_list = ('sed', 'awk', 'which', 'cat', 'rm', 'cvs', 'svn', 'doxygen', 'hhc', 'candle', 'light', 'makensis', 'nmake', 'plink');
+ my @required_list = ('sed', 'awk', 'which', 'cat', 'rm', 'cvs', 'svn', 'doxygen',
+ 'hhc', 'candle', 'light', 'makensis', 'nmake', 'plink', 'filever');
my $requirements_met = 1;
my $first_missing = 0;
my $error_list = "";
@@ -161,66 +168,78 @@ sub main {
# Get configuration file:
my $xml = new XML::Simple();
$config = $xml->XMLin($configfile);
-
# Set up convenience variables:
- my (@switches, @paths, @tags, @fetch);
- @switches = $config->{CommandLine}->{Options};
- @paths = $config->{CommandLine}->{Directories};
- @tags = $config->{CommandLine}->{Tags};
- @fetch = $config->{Stages}->{FetchSources}->{Config};
-
- # Update the configuration with overrides from the command line:
- $tags[0]->{cvs}->{value} = $OPT->{cvstag} if exists $OPT->{cvstag};
- $tags[0]->{svntag}->{value} = $OPT->{svntag} if exists $OPT->{svntag};
- $tags[0]->{svnbranch}->{value} = $OPT->{svnbranch} if exists $OPT->{svnbranch};
- $paths[0]->{src}->{path} = $OPT->{srcdir} if exists $OPT->{srcdir};
- $paths[0]->{out}->{path} = $OPT->{outdir} if exists $OPT->{outdir};
- $switches[0]->{debug}->{value} = $OPT->{debug} if exists $OPT->{debug};
- $switches[0]->{clean}->{value} = 1 if exists $OPT->{clean};
- $switches[0]->{repository}->{value} = $OPT->{repository} if exists $OPT->{repository};
- $fetch[0]->{USERNAME}->{name} = $OPT->{username} if exists $OPT->{username};
- $switches[0]->{nomake}->{value} = 1 if exists $OPT->{nomake};
- $switches[0]->{nopackage}->{value} = 1 if exists $OPT->{nopackage};
- $switches[0]->{verbose}->{value} = $OPT->{verbose} if exists $OPT->{verbose};
- $switches[0]->{vverbose}->{value} = $OPT->{verbose} if exists $OPT->{vverbose};
- if (exists $OPT->{logfile}) {
- $switches[0]->{logfile}->{path} = $OPT->{logfile};
- $switches[0]->{logfile}->{value} = 1;
- }
- if (exists $OPT->{nolog}) {
- $switches[0]->{logfile}->{value} = 0;
- }
- if (exists $OPT->{sign}) {
- $switches[0]->{sign}->{timestampserver} = $OPT->{sign};
- $switches[0]->{sign}->{value} = 1;
- }
- if (exists $OPT->{nosign}) {
- $switches[0]->{sign}->{value} = 0;
+ local $odr = $config->{Config}; ## Options, directories, repository, environment.
+
+#while ($v = each %$OPT) {print "$v: $OPT->{$v}\n";}
+
+ # Scan the configuration for switch definitions:
+ while (($sw, $val) = each %$odr) {
+ next if (! exists $val->{def}); ## ?? Should always exist.
+ # If the switch is in the command line, override the stored value:
+ if (exists $OPT->{$sw}) {
+ if (exists $val->{value}) {
+ $val->{value} = $OPT->{$sw};
+ $val->{def} = 1;
+ }
+ else {
+ $val->{def} = $OPT->{$sw}; ## If no<switch>, value will be zero.
+ }
+ }
+ # If the switch can be negated, test that, too:
+ if ( ! ($val->{def} =~ /A/)) {
+ local $nosw = "no".$sw;
+ if (exists $OPT->{$nosw}) {
+ $val->{def} = 0;
+ }
+ }
+
+ # For any switch definition with fixed values ("options"), validate:
+ if (exists $val->{options}) {
+ local $bValid = 0;
+ # options can be like value1|syn1 value2|syn2|syn3
+ foreach $option (split(/ /, $val->{options})) {
+ local $bFirst = 1;
+ local $sFirst;
+ foreach $opt (split(/\|/, $option)) {
+ # opt will be like value2, syn2, syn3
+ if ($bFirst) {
+ $sFirst = $opt; ## Remember the full name of the option.
+ $bFirst = 0;
+ }
+ if ($val->{value} =~ /$opt/i) {
+ $val->{value} = $sFirst; ## Save the full name.
+ $bValid = 1;
+ }
+ }
+ }
+ if (! $bValid) {
+ print "Fatal -- invalid $sw value $val->{value}. Possible values are $val->{options}.\n";
+ usage();
+ die;
+ }
+ }
}
- our $verbose = $config->{CommandLine}->{Options}->{verbose}->{value};
- our $vverbose = $config->{CommandLine}->{Options}->{vverbose}->{value};
- our $clean = $switches[0]->{clean}->{value};
- local $src = $paths[0]->{src}->{path};
- local $out = $paths[0]->{out}->{path};
- if ($clean && !$switches[0]->{nopackage}->{value}) {
+ # Set up convenience variables:
+ our $verbose = $odr->{verbose}->{def};
+ our $vverbose = $odr->{vverbose}->{def};
+ our $clean = $clean->{clean}->{def};
+ local $src = $odr->{src}->{value};
+ local $out = $odr->{out}->{value};
+
+ if ($clean && $odr->{package}->{def}) {
print "Info -- /clean forces /nopackage.\n";
- $switches[0]->{nopackage}->{value} = 1;
+ $odr->{package}->{def} = 0;
}
if ($vverbose) {print "Debug -- Config: ".Dumper($config);}
- # Examples of use:
- #print "Logfile path: $switches[0]->{log}->{path}\n";
- #print "src path: $paths[0]->{src}->{path}\n";
- #print "cvs tag: $tags[0]->{cvs}->{value}\n";
- #print "CVSROOT: $fetch[0]->{CVSROOT}->{name}\n";
-
# Test the unix find command:
- if (! exists $config->{CommandLine}->{Directories}->{unixfind}->{path}) {
- $config->{CommandLine}->{Directories}->{unixfind}->{path} = "C:\\tools\\cygwin\\bin";
+ if (! exists $odr->{unixfind}->{value}) {
+ $odr->{unixfind}->{value} = "C:\\tools\\cygwin\\bin";
}
- local $unixfind = $config->{CommandLine}->{Directories}->{unixfind}->{path};
+ local $unixfind = $odr->{unixfind}->{value};
local $savedPATH = $ENV{PATH};
$ENV{PATH} = $unixfind.";".$savedPATH;
@@ -234,38 +253,25 @@ sub main {
}
# Don't allow /svntag and /svnbranch simultaneously:
- if ( (length $tags[0]->{svntag}->{value} > 0) &&
- (length $tags[0]->{svnbranch}->{value} > 0) ) {
+ if ( (length $odr->{svntag}->{value} > 0) &&
+ (length $odr->{svnbranch}->{value} > 0) ) {
die "Fatal -- Can't specify both /SVNTAG and /SVNBRANCH.";
}
##-- Assemble configuration from config file and command line.
- my $sw = $switches[0]->{repository}->{value};
- my $rverb;
- if ($sw =~ /skip/i) {$rverb = "skip";}
- elsif ($sw =~ /update/i) {$rverb = "update";}
- elsif ($sw =~ /up/i) {$rverb = "update";}
- elsif ($sw =~ /checkout/i) {$rverb = "checkout";}
- elsif ($sw =~ /co/i) {$rverb = "checkout";}
- else {
- print "Fatal -- invalid /repository value.\n";
- usage();
- die;
- }
- $switches[0]->{repository}->{value} = $rverb; ## Save canonicalized repository verb.
-
+ local $rverb = $odr->{repository}->{value};
if ( ($rverb =~ /checkout/) && $clean) {
print "Warning -- Because sources afe being checked out, make clean will not be run.\n";
- $clean = $switches[0]->{clean}->{value} = 0;
+ $clean = $odr->{clean}->{def} = 0;
}
my $wd = $src."\\pismere";
if (! ($rverb =~ /skip/)) {
local $len = 0;
- if (exists $fetch[0]->{USERNAME}->{name}) {
- $len = length $fetch[0]->{USERNAME}->{name};
+ if (exists $odr->{USERNAME}->{value}) {
+ $len = length $odr->{USERNAME}->{value};
}
if ($len < 1) {
die "Fatal -- you won't get far accessing the repository without specifying a username.";
@@ -285,13 +291,15 @@ sub main {
# Begin logging:
my $l;
- if ($switches[0]->{logfile}->{value}) {
- print "Info -- logging to $switches[0]->{logfile}->{path}.\n";
- $l = new Logger $switches[0]->{logfile}->{path};
+ if ($odr->{logfile}->{def}) {
+ print "Info -- logging to $odr->{logfile}->{value}.\n";
+ $l = new Logger $odr->{logfile}->{value};
$l->start;
$l->no_die_handler; ## Needed so XML::Simple won't throw exceptions.
}
+ print "Executing $cmdline\n";
+
##++ Begin repository action:
if ($rverb =~ /skip/) {print "Info -- *** Skipping repository access.\n" if ($verbose);}
else {
@@ -305,12 +313,12 @@ sub main {
}
# Set up cvs environment variables:
- $ENV{CVSROOT} = $fetch[0]->{CVSROOT}->{name};
+ $ENV{CVSROOT} = $odr->{CVSROOT}->{value};
local $krb5dir = "$wd\\athena\\auth\\krb5";
local $cvscmdroot = "cvs $rverb";
- if (length $tags[0]->{cvs}->{value} > 0) {
- $cvscmdroot .= " -r $tags[0]->{cvs}->{value}";
+ if (length $odr->{cvstag}->{value} > 0) {
+ $cvscmdroot .= " -r $odr->{cvstag}->{value}";
}
if ($rverb =~ /checkout/) {
@@ -351,12 +359,12 @@ sub main {
my $svncmd = "svn $rverb ";
if ($rverb =~ /checkout/) { # Append the rest of the checkout command:
chdir("..");
- $svncmd .= "svn+ssh://".$fetch[0]->{USERNAME}->{name}."@".$fetch[0]->{SVNURL}->{name}."/krb5/";
- if (length $tags[0]->{svntag}->{value} > 0) {
- $svncmd .= "tags/$tags[0]->{svntag}->{value}";
+ $svncmd .= "svn+ssh://".$odr->{USERNAME}->{value}."@".$odr->{SVNURL}->{value}."/krb5/";
+ if (length $odr->{svntag}->{value} > 0) {
+ $svncmd .= "tags/$odr->{svntag}->{value}";
}
- elsif (length $tags[0]->{svnbranch}->{value} > 0) {
- $svncmd .= "branches/$tags[0]->{svnbranch}->{value}";
+ elsif (length $odr->{svnbranch}->{value} > 0) {
+ $svncmd .= "branches/$odr->{svnbranch}->{value}";
}
else {
$svncmd .= "trunk";
@@ -442,7 +450,7 @@ sub main {
##-- End repository action, part 2.
##++ Make action:
- if ( (!$switches[0]->{nomake}->{value}) ) {
+ if ( ($odr->{make}->{def}) ) {
if ($verbose) {print "Info -- *** Begin preparing for build.\n";}
chdir("$wd") or die "Fatal -- couldn't chdir to $wd\n";
@@ -482,8 +490,8 @@ sub main {
chdir("$wd\\athena") or die "Fatal -- couldn't chdir to source directory $wd\\athena\n";
print "Info -- chdir to ".`cd`."\n" if ($verbose);
- local $dbgswitch = ($switches[0]->{debug}->{value}) ? " " : "NODEBUG=1";
- !system("perl ../scripts/build.pl --softdirs --nolog $buildtarget $dbgswitch") or die "Fatal -- build $buildtarget failed.";
+ local $dbgswitch = ($odr->{debug}->{def}) ? " " : "NODEBUG=1";
+ !system("perl ../scripts/build.pl --softdirs --nolog $buildtarget $dbgswitch BUILD_OFFICIAL=1") or die "Fatal -- build $buildtarget failed.";
chdir("$wd") or die "Fatal -- couldn't chdir to $wd.";
if ($clean) {
@@ -498,7 +506,7 @@ sub main {
##-- Make action.
##++ Package action:
- if ($switches[0]->{nopackage}->{value}) { ## If /clean, nopackage will be set.
+ if (! $odr->{package}->{def}) { ## If /clean, nopackage will be set.
print "Info -- *** Skipping packaging.\n";
if ((-d $out) && ! $bOutputCleaned) {
print "Warning -- *** Output directory $out will not be cleaned.\n";
@@ -534,7 +542,7 @@ sub main {
# Sign files:
chdir($staging) or die "Fatal -- couldn't chdir to $staging\n";
print "Info -- chdir to ".`cd`."\n" if ($verbose);
- if ($switches[0]->{sign}->{value}) {
+ if ($odr->{sign}->{def}) {
signFiles($config->{Stages}->{PostPackage}->{Config}->{Signing}, $config);
}
@@ -576,7 +584,7 @@ sub main {
!system("sed -f ..\\wix\\$tmpfile site-local-tagged.nsi > b.tmp") or die "Fatal -- Couldn't modify site-local.wxi.";
!system("rm site-local-tagged.nsi") or die "Fatal -- Couldn't remove site-local-tagged.nsi.";
# Add DEBUG or RELEASE:
- if ($switches[0]->{debug}->{value}) { ## debug build
+ if ($odr->{debug}->{def}) { ## debug build
!system("echo !define DEBUG >> b.tmp") or die "Fatal -- Couldn't modify b.tmp.";
}
else { ## release build
@@ -632,7 +640,7 @@ sub main {
copyFiles($config->{Stages}->{PostPackage}->{CopyList}, $config); ## Copy any files
print "Info -- chdir to ".`cd`."\n" if ($verbose);
- if ($switches[0]->{sign}->{value}) {
+ if ($odr->{sign}->{def}) {
signFiles($config->{Stages}->{PostPackage}->{Config}->{Signing}, $config);
}
@@ -645,7 +653,7 @@ sub main {
system("rm -rf $out/ziptemp"); ## Clean up junk.
# End logging:
- if ($switches[0]->{logfile}->{value}) {$l->stop;}
+ if ($odr->{logfile}->{def}) {$l->stop;}
return 0;
} ## End subroutine main.
diff --git a/src/windows/build/copyfiles.pl b/src/windows/build/copyfiles.pl
index 9160db07bc..79b6e156ba 100644
--- a/src/windows/build/copyfiles.pl
+++ b/src/windows/build/copyfiles.pl
@@ -6,7 +6,7 @@ use Data::Dumper;
sub copyFiles {
local ($xml, $config) = @_;
- local @switches = $config->{CommandLine}->{Options};
+ local @odr = $config->{Config};
local @files = $xml->{Files};
# Check for includes:
if (exists $xml->{Files}->{Include}->{path}) {
@@ -38,7 +38,7 @@ sub copyFiles {
my $bPathTags = (exists $xml->{Config}->{DebugArea}) && (exists $xml->{Config}->{ReleaseArea});
my $bFileStem = (exists $xml->{Config}->{FileStem});
- if ($switches[0]->{debug}->{value}) { ## Debug build tags:
+ if ($odr->{debug}->{def}) { ## Debug build tags:
$PathFragment = $xml->{Config}->{DebugArea}->{value};
$BuildDependentTag = $xml->{Config}->{DebugTag}->{value};
$IgnoreTag = $xml->{Config}->{ReleaseTag}->{value};
@@ -84,7 +84,7 @@ sub copyFiles {
$to =~ s/%filestem%/$FileStemFragment/g;
}
# %-DEBUG% substitution:
- local $DebugFragment = ($switches[0]->{debug}->{value}) ? "-DEBUG" : "";
+ local $DebugFragment = ($odr->{debug}->{def}) ? "-DEBUG" : "";
$from =~ s/%\-DEBUG%/$DebugFragment/g;
$to =~ s/%\-DEBUG%/$DebugFragment/g;
$to =~ s/\*.*//; ## Truncate to path before any wildcard
diff --git a/src/windows/build/makeZip.pl b/src/windows/build/makeZip.pl
index 12215ddcd6..1a1b533c33 100644
--- a/src/windows/build/makeZip.pl
+++ b/src/windows/build/makeZip.pl
@@ -9,15 +9,15 @@ use Data::Dumper;
sub makeZip {
local ($zip, $config) = @_;
- local $src = $config->{CommandLine}->{Directories}->{src}->{path};
- local $out = $config->{CommandLine}->{Directories}->{out}->{path};
- local @switches = $config->{CommandLine}->{Options};
- local $zipname = $zip->{filename};
- local $filestem = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name};
- $zipname =~ s/%filestem%/$filestem/g;
+ local $odr = $config->{Config}; ## Options, directories, repository, environment.
+ local $src = $odr->{src}->{value};
+ local $out = $odr->{out}->{value};
+ local $zipname = $zip->{filename};
+ local $filestem = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name};
+ $zipname =~ s/%filestem%/$filestem/g;
if (exists $zip->{Requires}) {
local $bMakeIt = 1;
- local $rverb = $switches[0]->{repository}->{value};
+ local $rverb = $odr->{repository}->{value};
local $j = 0;
while ($zip->{Requires}->{Switch}[$j]) { ## Check Require switches
local $switch = $zip->{Requires}->{Switch}[$j];
diff --git a/src/windows/build/pruneFiles.pl b/src/windows/build/pruneFiles.pl
index 2406c770ec..a62da536e8 100644
--- a/src/windows/build/pruneFiles.pl
+++ b/src/windows/build/pruneFiles.pl
@@ -10,7 +10,7 @@ sub pruneFiles {
# Use Unix find instead of Windows find. Save PATH so we can restore it when we're done:
local $savedPATH = $ENV{PATH};
- $ENV{PATH} = $config->{CommandLine}->{Directories}->{unixfind}->{path}.";".$savedPATH;
+ $ENV{PATH} = $config->{Config}->{Directories}->{unixfind}->{path}.";".$savedPATH;
local $j=0;
print "Info -- Processing prunes in ".`cd`."\n" if ($verbose);
while ($prunes->{Prune}->[$j]) {
diff --git a/src/windows/build/signFiles.pl b/src/windows/build/signFiles.pl
index d2ffb2c0e3..65ccb0a11c 100644
--- a/src/windows/build/signFiles.pl
+++ b/src/windows/build/signFiles.pl
@@ -9,7 +9,7 @@ sub signFiles {
local $template = $signing->{CommandTemplate}->{value};
# Use Unix find instead of Windows find. Save PATH so we can restore it when we're done:
local $savedPATH= $ENV{PATH};
- $ENV{PATH} = $config->{CommandLine}->{Directories}->{unixfind}->{path}.";".$savedPATH;
+ $ENV{PATH} = $config->{Config}->{unixfind}->{value}.";".$savedPATH;
foreach $expr (split(" ", $exprs)) { ## exprs is something like "*.exe *.dll"
local $cmd = "find . -iname \"$expr\"";
local $list = `$cmd`; ## $list is files matching *.exe, for example.