From 8a53b71959dbbaf59d25add76122057203f88008 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Fri, 30 Mar 2007 20:52:43 +0000 Subject: [PATCH] pull up r19234 from trunk r19234@cathode-dark-space: kpkoch | 2007-03-16 14:38:28 -0400 Subject: KfW automated build scripts & supporting files. Updated scripts & additional configuration files. Ticket: new Target_Version: 1.6.1 tags: pullup ticket: 5490 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@19348 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/build/BKWconfig.xml | 154 ++++++-- src/windows/build/Logger.pm | 87 +++++ src/windows/build/bkw-automation.html | 13 - src/windows/build/bkw.pl | 530 +++++++++++++++----------- src/windows/build/copyfiles.pl | 132 +++++++ src/windows/build/copyfiles.xml | 12 +- src/windows/build/corebinaryfiles.xml | 87 +++++ src/windows/build/sdkfiles.xml | 147 +++++++ src/windows/build/srcfiles.xml | 13 + 9 files changed, 899 insertions(+), 276 deletions(-) create mode 100644 src/windows/build/Logger.pm create mode 100644 src/windows/build/copyfiles.pl create mode 100644 src/windows/build/corebinaryfiles.xml create mode 100644 src/windows/build/sdkfiles.xml create mode 100644 src/windows/build/srcfiles.xml diff --git a/src/windows/build/BKWconfig.xml b/src/windows/build/BKWconfig.xml index 61e5ee59d..c7296ece4 100644 --- a/src/windows/build/BKWconfig.xml +++ b/src/windows/build/BKWconfig.xml @@ -2,40 +2,46 @@ - + - - - + + + - - - - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + @@ -43,8 +49,8 @@ The otherwise identical paths differ in one section. For example: .../target/bin/i386/bin/rel/filename and .../target/bin/i386/dbg/filename. Here we define the two differing sections: --> - - + + - - - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/windows/build/Logger.pm b/src/windows/build/Logger.pm new file mode 100644 index 000000000..f74c21807 --- /dev/null +++ b/src/windows/build/Logger.pm @@ -0,0 +1,87 @@ +package Logger; + +use strict; +use IO::File; +use FindBin; + +my $bStarted = 0; + +sub new { + my $class = shift; + my $file = shift; + my $append = shift; + $file || die "Usage: \$foo = new Logger filename [append]\n"; + my $self = {}; + bless $self, $class; + $self->{FILE} = $file; + $self->{APPEND} = $append?'-a':''; + return $self; +} + +sub start { + my $self = shift; + + return 1 if $self->{PIPE}; + + STDOUT->flush; + STDERR->flush; + + my $fh_out = new IO::File; + my $fh_err = new IO::File; + my $fh_pipe = new IO::File; + + $self->{OUT} = $fh_out; + $self->{ERR} = $fh_err; + $self->{PIPE} = $fh_pipe; + + $fh_out->open(">&STDOUT") || die; + $fh_err->open(">&STDERR") || die; + $fh_pipe->open("|$^X $FindBin::Bin/tee.pl $self->{APPEND} $self->{FILE}") || die; + + STDOUT->fdopen(fileno $fh_pipe, "w") || die; + STDERR->fdopen(fileno $fh_pipe, "w") || die; + + STDOUT->autoflush(1); + STDERR->autoflush(1); + + $SIG{__DIE__} = sub { + print STDERR $_[0]; + $self->stop; + die "\n"; + }; + + $bStarted = 1; + return 1; +} + +# 20070314 kpkoch: +# There appears to be a bug in ActivePerl where Logger's games with streams +# and the SIG DIE handler cause eval to throw exceptions. By deleting the DIE handler, +# subsequent evals do not fail. +sub no_die_handler { + delete $SIG{__DIE__}; + } + +sub stop { + my $self = shift; + + return 0 if !$self->{PIPE}; + + STDOUT->close; + STDERR->close; + $self->{PIPE}->close; + STDOUT->fdopen(fileno $self->{OUT}, "w"); + STDERR->fdopen(fileno $self->{ERR}, "w"); + delete $self->{OUT}; + delete $self->{ERR}; + delete $self->{PIPE}; + $bStarted = 0; + return 1; +} + +sub DESTROY { + my $self = shift; + $self->stop if ($bStarted); + } + +1; diff --git a/src/windows/build/bkw-automation.html b/src/windows/build/bkw-automation.html index d7ca7a0c3..f018b348b 100644 --- a/src/windows/build/bkw-automation.html +++ b/src/windows/build/bkw-automation.html @@ -201,19 +201,6 @@

Remaining work / bug list

This is a work in progress. What's left: