1999-04-14 13:02:14 +04:00
|
|
|
#!/usr/bin/perl
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
require 5.000;
|
|
|
|
|
|
|
|
use Sys::Hostname;
|
|
|
|
use POSIX "sys_wait_h";
|
|
|
|
use Cwd;
|
|
|
|
|
1999-05-05 08:00:55 +04:00
|
|
|
$Version = '$Revision: 1.24 $';
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
sub InitVars {
|
|
|
|
# PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
|
|
|
$BuildAdministrator = "$ENV{'USER'}\@$ENV{'HOST'}";
|
|
|
|
|
1999-04-30 03:27:05 +04:00
|
|
|
# Default values of cmdline opts (1==on, 0==off)
|
|
|
|
$BuildDepend = 1; # Depend or Clobber
|
|
|
|
$BuildNSCommercial = 0; # Build Netscape commercial client (internal only)
|
|
|
|
$BuildOnce = 0; # Build once, don't send results to server
|
|
|
|
$ReportStatus = 1; # Send results to server, or not
|
|
|
|
$RunTest = 1; # Run the smoke test on successful build, or not
|
|
|
|
$UseObjDir = 1; # Use a separate object dir, or build in the source tree
|
|
|
|
$UseTimeStamp = 0; # Use the CVS 'pull-by-timestamp' option, or not
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
# Set these to what makes sense for your system
|
|
|
|
$cpus = 1;
|
1999-03-18 12:19:22 +03:00
|
|
|
$Make = 'gmake'; # Must be GNU make
|
1999-02-23 06:52:21 +03:00
|
|
|
$MakeOverrides = '';
|
1999-02-14 10:15:44 +03:00
|
|
|
$mail = '/bin/mail';
|
1999-04-07 04:29:45 +04:00
|
|
|
$CVS = 'cvs -q';
|
1999-03-30 02:34:51 +04:00
|
|
|
$CVSCO = 'checkout -P';
|
1999-02-14 10:15:44 +03:00
|
|
|
|
1999-04-14 13:02:14 +04:00
|
|
|
# You'll need to change these to suit your machine's needs
|
|
|
|
$BaseDir = '/builds/tinderbox/SeaMonkey';
|
|
|
|
$NSPRDir = '/builds/tinderbox/SeaMonkey/nspr';
|
1999-05-05 08:00:55 +04:00
|
|
|
$DisplayServer = 'costarica.mcom.com:0.0';
|
1999-04-14 13:02:14 +04:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
# These shouldn't really need to be changed
|
1999-04-30 03:27:05 +04:00
|
|
|
$BinaryName = '/dist/bin/apprunner';
|
1999-02-14 10:15:44 +03:00
|
|
|
$BuildName = '';
|
|
|
|
$BuildObjName = '';
|
1999-04-30 03:27:05 +04:00
|
|
|
$BuildSleep = 10; # Minimum wait period from start of build to start of next build in minutes.
|
1999-03-30 02:34:51 +04:00
|
|
|
$BuildStart = '';
|
1999-04-30 03:27:05 +04:00
|
|
|
$BuildTag = '';
|
|
|
|
$BuildTree = 'MozillaTest'; # Your build results will be displayed on this Tinderbox page.
|
|
|
|
$Compiler = 'gcc';
|
1999-04-08 07:01:20 +04:00
|
|
|
$ConfigureEnvArgs = '';
|
1999-04-14 13:02:14 +04:00
|
|
|
$ConfigureArgs = '--with-nspr=' . $NSPRDir . ' --cache-file=/dev/null ';
|
1999-02-14 10:15:44 +03:00
|
|
|
$ConfigGuess = './build/autoconf/config.guess';
|
1999-04-30 03:27:05 +04:00
|
|
|
$FE = 'apprunner';
|
1999-02-14 10:15:44 +03:00
|
|
|
$Logfile = '${BuildDir}.log';
|
1999-04-30 03:27:05 +04:00
|
|
|
$NSCommModule = 'CommercialClient50All';
|
1999-04-14 13:02:14 +04:00
|
|
|
$NSPRArgs = 'DIST=' . $NSPRDir . ' MOZILLA_CLIENT=1 NSDISTMODE=copy NO_MDUPDATE=1 ';
|
1999-03-18 11:47:10 +03:00
|
|
|
$ShellOverride = ''; # Only used if the default shell is too stupid
|
1999-05-05 08:00:55 +04:00
|
|
|
$Tinderbox_server = 'tinderbox-daemon\@cvs-mirror.mozilla.org';
|
1999-04-30 03:27:05 +04:00
|
|
|
$TopLevel = '.';
|
|
|
|
$Topsrcdir = 'mozilla';
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
1999-03-18 11:47:10 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
sub SetupEnv {
|
|
|
|
umask(0);
|
|
|
|
$ENV{"CVSROOT"} = ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot';
|
1999-04-14 13:02:14 +04:00
|
|
|
$ENV{"DISPLAY"} = $DisplayServer;
|
1999-05-05 08:00:55 +04:00
|
|
|
$ENV{"LD_LIBRARY_PATH"} = $NSPRDir . '/lib:' . $BaseDir . '/' . $DirName . '/mozilla/' . $ObjDir . '/dist/bin:/usr/lib/png:/usr/local/lib';
|
|
|
|
$ENV{"TMPDIR"} = '.';
|
1999-03-18 11:47:10 +03:00
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
sub SetupPath {
|
1999-03-09 03:44:04 +03:00
|
|
|
my($Path, $comptmp);
|
|
|
|
$comptmp = '';
|
1999-02-14 10:15:44 +03:00
|
|
|
$Path = $ENV{PATH};
|
|
|
|
print "Path before: $Path\n";
|
|
|
|
|
1999-02-23 06:52:21 +03:00
|
|
|
if ( $OS eq 'AIX' ) {
|
|
|
|
$ENV{'PATH'} = '/builds/local/bin:' . $ENV{'PATH'} . ':/usr/lpp/xlC/bin';
|
|
|
|
$ConfigureArgs .= '--x-includes=/usr/include/X11 --x-libraries=/usr/lib --disable-shared';
|
|
|
|
$ConfigureEnvArgs = 'CC=xlC_r CXX=xlC_r';
|
1999-03-09 03:15:46 +03:00
|
|
|
$Compiler = 'xlC_r';
|
1999-02-24 07:33:17 +03:00
|
|
|
$NSPRArgs .= 'NS_USE_NATIVE=1 USE_PTHREADS=1';
|
1999-02-23 06:52:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( $OS eq 'BSD_OS' ) {
|
|
|
|
$ENV{'PATH'} = '/usr/contrib/bin:/bin:/usr/bin:' . $ENV{'PATH'};
|
|
|
|
$ConfigureArgs .= '--disable-shared';
|
|
|
|
$ConfigureEnvArgs = 'CC=shlicc2 CXX=shlicc2';
|
1999-03-09 03:15:46 +03:00
|
|
|
$Compiler = 'shlicc2';
|
1999-02-23 06:52:21 +03:00
|
|
|
$mail = '/usr/ucb/mail';
|
|
|
|
$MakeOverrides = 'CPP_PROG_LINK=0 CCF=shlicc2'; # because ld dies if it encounters -include
|
1999-02-24 07:33:17 +03:00
|
|
|
$NSPRArgs .= 'NS_USE_GCC=1 NS_USE_NATIVE=';
|
1999-02-23 06:52:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( $OS eq 'FreeBSD' ) {
|
|
|
|
$ENV{'PATH'} = '/bin:/usr/bin:' . $ENV{'PATH'};
|
1999-03-09 03:15:46 +03:00
|
|
|
if ( $ENV{'HOST'} eq 'angelus.mcom.com' ) {
|
|
|
|
$ConfigureEnvArgs = 'CC=egcc CXX=eg++';
|
|
|
|
$Compiler = 'egcc';
|
|
|
|
}
|
1999-02-23 06:52:21 +03:00
|
|
|
$mail = '/usr/bin/mail';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $OS eq 'HP-UX' ) {
|
|
|
|
$ENV{'PATH'} = '/opt/ansic/bin:/opt/aCC/bin:/builds/local/bin:' . $ENV{'PATH'};
|
|
|
|
$ENV{'LPATH'} = '/usr/lib:' . $ENV{'LD_LIBRARY_PATH'} . ':/builds/local/lib';
|
|
|
|
$ENV{'SHLIB_PATH'} = $ENV{'LPATH'};
|
|
|
|
$ConfigureArgs .= '--disable-gtktest --x-includes=/usr/include/X11 --x-libraries=/usr/lib';
|
|
|
|
$ConfigureEnvArgs = 'CC="cc -Ae" CXX="aCC -ext"';
|
1999-03-09 03:15:46 +03:00
|
|
|
$Compiler = 'cc/aCC';
|
1999-02-23 06:52:21 +03:00
|
|
|
# Use USE_PTHREADS=1 instead of CLASSIC_NSPR if you've got DCE installed.
|
1999-02-24 07:33:17 +03:00
|
|
|
$NSPRArgs .= 'NS_USE_NATIVE=1 CLASSIC_NSPR=1';
|
1999-02-23 06:52:21 +03:00
|
|
|
}
|
|
|
|
|
1999-03-20 05:04:21 +03:00
|
|
|
if ( $OS eq 'IRIX' ) {
|
|
|
|
$ENV{'PATH'} = '/opt/bin:' . $ENV{'PATH'};
|
|
|
|
$ENV{'LD_LIBRARY_PATH'} .= ':/opt/lib';
|
|
|
|
$ENV{'LD_LIBRARYN32_PATH'} = $ENV{'LD_LIBRARY_PATH'};
|
|
|
|
$ConfigureEnvArgs = 'CC=cc CXX=CC CFLAGS="-n32 -O" CXXFLAGS="-n32 -O"';
|
|
|
|
$Compiler = 'cc/CC';
|
|
|
|
$NSPRArgs .= 'NS_USE_NATIVE=1 USE_PTHREADS=1';
|
|
|
|
}
|
|
|
|
|
1999-03-09 03:15:46 +03:00
|
|
|
if ( $OS eq 'NetBSD' ) {
|
|
|
|
$ENV{'PATH'} = '/bin:/usr/bin:' . $ENV{'PATH'};
|
1999-03-10 06:30:42 +03:00
|
|
|
$ENV{'LD_LIBRARY_PATH'} .= ':/usr/X11R6/lib';
|
1999-03-09 03:15:46 +03:00
|
|
|
$ConfigureEnvArgs = 'CC=egcc CXX=eg++';
|
|
|
|
$Compiler = 'egcc';
|
|
|
|
$mail = '/usr/bin/mail';
|
|
|
|
}
|
|
|
|
|
1999-02-23 06:52:21 +03:00
|
|
|
if ( $OS eq 'OSF1' ) {
|
|
|
|
$ENV{'PATH'} = '/usr/gnu/bin:' . $ENV{'PATH'};
|
|
|
|
$ENV{'LD_LIBRARY_PATH'} .= ':/usr/gnu/lib';
|
|
|
|
$ConfigureEnvArgs = 'CC="cc -readonly_strings" CXX="cxx"';
|
1999-03-09 03:15:46 +03:00
|
|
|
$Compiler = 'cc/cxx';
|
1999-03-18 11:47:10 +03:00
|
|
|
$MakeOverrides = 'SHELL=/usr/bin/ksh';
|
1999-02-24 07:33:17 +03:00
|
|
|
$NSPRArgs .= 'NS_USE_NATIVE=1 USE_PTHREADS=1';
|
1999-03-18 11:47:10 +03:00
|
|
|
$ShellOverride = '/usr/bin/ksh';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $OS eq 'QNX' ) {
|
|
|
|
$ENV{'PATH'} = '/usr/local/bin:' . $ENV{'PATH'};
|
|
|
|
$ENV{'LD_LIBRARY_PATH'} .= ':/usr/X11/lib';
|
|
|
|
$ConfigureArgs .= '--disable-shared --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib';
|
1999-04-30 03:27:05 +04:00
|
|
|
$ConfigureEnvArgs = 'CC="cc -DQNX" CXX="cc -DQNX" LIBS="-lunix -lc"';
|
1999-03-20 05:04:21 +03:00
|
|
|
$Compiler = 'cc';
|
1999-03-18 11:47:10 +03:00
|
|
|
$mail = '/usr/bin/sendmail';
|
1999-02-23 06:52:21 +03:00
|
|
|
}
|
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
if ( $OS eq 'SunOS' ) {
|
1999-02-27 07:55:44 +03:00
|
|
|
if ( $OSVerMajor eq '4' ) {
|
|
|
|
$ENV{'PATH'} = '/usr/gnu/bin:/usr/local/sun4/bin:/usr/bin:' . $ENV{'PATH'};
|
|
|
|
$ENV{'LD_LIBRARY_PATH'} = '/home/motif/usr/lib:' . $ENV{'LD_LIBRARY_PATH'};
|
1999-03-03 04:21:42 +03:00
|
|
|
$ConfigureArgs .= '--x-includes=/home/motif/usr/include/X11 --x-libraries=/home/motif/usr/lib';
|
1999-02-27 07:55:44 +03:00
|
|
|
$ConfigureEnvArgs = 'CC="egcc -DSUNOS4" CXX="eg++ -DSUNOS4"';
|
1999-03-09 03:15:46 +03:00
|
|
|
$Compiler = 'egcc';
|
1999-02-27 07:55:44 +03:00
|
|
|
} else {
|
|
|
|
$ENV{'PATH'} = '/usr/ccs/bin:' . $ENV{'PATH'};
|
|
|
|
}
|
1999-02-24 07:33:17 +03:00
|
|
|
if ( $CPU eq 'i86pc' ) {
|
|
|
|
$ENV{'PATH'} = '/opt/gnu/bin:' . $ENV{'PATH'};
|
|
|
|
$ENV{'LD_LIBRARY_PATH'} .= ':/opt/gnu/lib';
|
1999-02-26 02:35:52 +03:00
|
|
|
$ConfigureEnvArgs = 'CC=egcc CXX=eg++';
|
1999-03-09 03:15:46 +03:00
|
|
|
$Compiler = 'egcc';
|
1999-02-24 07:33:17 +03:00
|
|
|
# This may just be an NSPR bug, but if USE_PTHREADS is defined, then
|
|
|
|
# _PR_HAVE_ATOMIC_CAS gets defined (erroneously?) and libnspr21 doesn't work.
|
1999-02-27 07:55:44 +03:00
|
|
|
$NSPRArgs .= 'CLASSIC_NSPR=1 NS_USE_GCC=1 NS_USE_NATIVE=';
|
1999-02-24 07:33:17 +03:00
|
|
|
} else {
|
1999-02-27 07:55:44 +03:00
|
|
|
# This is utterly lame....
|
|
|
|
if ( $ENV{'HOST'} eq 'fugu' ) {
|
1999-03-03 04:21:42 +03:00
|
|
|
$ENV{'PATH'} = '/tools/ns/workshop/bin:/usrlocal/bin:' . $ENV{'PATH'};
|
|
|
|
$ENV{'LD_LIBRARY_PATH'} = '/tools/ns/workshop/lib:/usrlocal/lib:' . $ENV{'LD_LIBRARY_PATH'};
|
1999-02-27 07:55:44 +03:00
|
|
|
$ConfigureEnvArgs = 'CC=cc CXX=CC';
|
1999-03-09 03:44:04 +03:00
|
|
|
$comptmp = `cc -V 2>&1 | head -1`;
|
|
|
|
chop($comptmp);
|
|
|
|
$Compiler = "cc/CC \($comptmp\)";
|
1999-02-27 07:55:44 +03:00
|
|
|
$NSPRArgs .= 'NS_USE_NATIVE=1';
|
|
|
|
} else {
|
|
|
|
$NSPRArgs .= 'NS_USE_GCC=1 NS_USE_NATIVE=';
|
|
|
|
}
|
|
|
|
if ( $OSVerMajor eq '5' ) {
|
1999-03-09 03:15:46 +03:00
|
|
|
$NSPRArgs .= ' USE_PTHREADS=1';
|
1999-02-27 07:55:44 +03:00
|
|
|
}
|
1999-02-24 07:33:17 +03:00
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
$Path = $ENV{PATH};
|
|
|
|
print "Path After: $Path\n";
|
1999-03-18 11:47:10 +03:00
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# NO USER CONFIGURABLE PIECES BEYOND THIS POINT #
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
sub GetSystemInfo {
|
|
|
|
$OS = `uname -s`;
|
|
|
|
$OSVer = `uname -r`;
|
1999-02-23 06:52:21 +03:00
|
|
|
$CPU = `uname -m`;
|
1999-03-03 04:21:42 +03:00
|
|
|
|
|
|
|
my($host) = "";
|
|
|
|
my($myhost) = hostname;
|
1999-02-23 06:52:21 +03:00
|
|
|
|
|
|
|
chop($OS, $OSVer, $CPU);
|
1999-03-03 04:21:42 +03:00
|
|
|
chomp($myhost);
|
|
|
|
|
|
|
|
($host, $junk) = split(/\./, $myhost);
|
1999-02-23 06:52:21 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
if ( $OS eq 'AIX' ) {
|
1999-03-03 04:21:42 +03:00
|
|
|
my($osAltVer) = `uname -v`;
|
|
|
|
chop($osAltVer);
|
|
|
|
$OSVer = $osAltVer . "." . $OSVer;
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
1999-02-23 06:52:21 +03:00
|
|
|
|
|
|
|
if ( $OS eq 'BSD/OS' ) {
|
|
|
|
$OS = 'BSD_OS';
|
|
|
|
}
|
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
if ( $OS eq 'IRIX64' ) {
|
|
|
|
$OS = 'IRIX';
|
|
|
|
}
|
1999-02-23 06:52:21 +03:00
|
|
|
|
1999-03-18 11:47:10 +03:00
|
|
|
if ( $OS eq 'QNX' ) {
|
|
|
|
$OSVer = `uname -v`;
|
|
|
|
chop($OSVer);
|
|
|
|
$OSVer =~ s/^([0-9])([0-9]*)$/$1.$2/;
|
|
|
|
}
|
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
if ( $OS eq 'SCO_SV' ) {
|
|
|
|
$OS = 'SCOOS';
|
|
|
|
$OSVer = '5.0';
|
|
|
|
}
|
1999-02-23 06:52:21 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
if ( "$host" ne "" ) {
|
1999-04-30 03:27:05 +04:00
|
|
|
$BuildName = $host . ' ' . $OS . ' ' . $OSVer;
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Defining ObjDir really ought to be done by first checking out
|
|
|
|
# mozilla/build/autoconf/config.guess, and then using it to do
|
|
|
|
# the definition once.
|
|
|
|
#
|
|
|
|
|
|
|
|
if ( $OS eq 'AIX' ) {
|
|
|
|
# Assumes 4.2.1 for now.
|
|
|
|
$ObjDir = 'obj-powerpc-ibm-aix4.2.1.0';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $OS eq 'BSD_OS' ) {
|
|
|
|
$ObjDir = 'obj-' . $CPU . '-pc-bsdi' . $OSVer;
|
|
|
|
$BuildName = $host . ' BSD/OS ' . $OSVer;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $OS eq 'FreeBSD' ) {
|
|
|
|
$ObjDir = 'obj-' . $CPU . '-unknown-freebsd' . $OSVer;
|
|
|
|
$ObjDir =~ s/(bsd[0-9]\.[0-9])(-[A-Za-z0-9]*)$/$1/o;
|
|
|
|
$BuildName = $host . ' ' . $OS . '/' . $CPU . ' ' . $OSVer;
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
1999-02-23 06:52:21 +03:00
|
|
|
|
1999-04-30 03:27:05 +04:00
|
|
|
if ( $OS eq 'HP-UX' ) {
|
|
|
|
$ObjDir = 'obj-hppa1.1-hp-hpux' . $OSVer;
|
|
|
|
$ObjDir =~ s/hpux[AB]\./hpux/o;
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
|
|
|
|
1999-04-30 03:27:05 +04:00
|
|
|
if ( $OS eq 'IRIX' ) {
|
|
|
|
$ObjDir = 'obj-mips-sgi-irix' . $OSVer;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $OS eq 'Linux' ) {
|
|
|
|
if ( $CPU eq 'alpha' || $CPU eq 'sparc' ) {
|
|
|
|
$ObjDir = 'obj-' . $CPU . '-unknown-linux-gnu';
|
|
|
|
$BuildName = $host . ' ' . $OS . '/' . $CPU . ' ' . $OSVer;
|
|
|
|
} elsif ( $CPU eq 'armv4l' || $CPU eq 'sa110' ) {
|
|
|
|
$ObjDir = 'obj-arm-unknown-linux-gnu';
|
|
|
|
$BuildName = $host . ' ' . $OS . '/arm ' . $OSVer;
|
|
|
|
# This is here because I ran out of space on my netwinder. --briano.
|
|
|
|
$ConfigureArgs .= '--disable-debug --enable-optimize';
|
|
|
|
} elsif ( $CPU eq 'ppc' ) {
|
|
|
|
$ObjDir = 'obj-powerpc-unknown-linux-gnu';
|
|
|
|
$BuildName = $host . ' ' . $OS . '/' . $CPU . ' ' . $OSVer;
|
|
|
|
} else {
|
|
|
|
$ObjDir = 'obj-' . $CPU . '-pc-linux-gnu';
|
|
|
|
$BuildName = $host . ' ' . $OS . '/i386 ' . $OSVer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $OS eq 'NetBSD' ) {
|
|
|
|
$ObjDir = 'obj-' . $CPU . '-unknown-netbsd' . $OSVer;
|
|
|
|
$BuildName = $host . ' ' . $OS . '/' . $CPU . ' ' . $OSVer;
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
1999-04-30 03:27:05 +04:00
|
|
|
|
|
|
|
if ( $OS eq 'OSF1' ) {
|
|
|
|
# Assumes 4.0D for now.
|
|
|
|
$ObjDir = 'obj-alpha-dec-osf4.0d';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $OS eq 'QNX' ) {
|
|
|
|
$ObjDir = 'obj-i386-pc-qnx4';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $OS eq 'SunOS' ) {
|
|
|
|
if ( $CPU eq 'i86pc' ) {
|
|
|
|
$ObjDir = 'obj-i386-pc-solaris' . $OSVer;
|
|
|
|
$BuildName = $host . ' ' . $OS . '/i386 ' . $OSVer;
|
|
|
|
} else {
|
|
|
|
$ObjDir = 'obj-sparc-sun-';
|
|
|
|
$OSVerMajor = substr($OSVer, 0, 1);
|
|
|
|
if ( $OSVerMajor eq '4' ) {
|
|
|
|
$ObjDir .= 'sunos';
|
|
|
|
} else {
|
|
|
|
$ObjDir .= 'solaris';
|
|
|
|
$BuildName = $host . ' ' . $OS . '/sparc ' . $OSVer;
|
|
|
|
}
|
|
|
|
$ObjDir .= $OSVer;
|
|
|
|
}
|
|
|
|
$ObjDir =~ s/s5\./s2./o;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $UseObjDir == 0 ) {
|
|
|
|
$ObjDir = '';
|
|
|
|
}
|
|
|
|
$BuildName .= ' ' . ($BuildDepend?'Depend':'Clobber');
|
|
|
|
$DirName = $OS . '_' . $OSVer . '_' . ($BuildDepend?'depend':'clobber');
|
|
|
|
$logfile = "${DirName}.log";
|
1999-03-18 11:47:10 +03:00
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
sub BuildIt {
|
1999-04-30 03:27:05 +04:00
|
|
|
my($fe, @felist, $ClobberTarget, $DependTarget, $EarlyExit, $LastTime, $SaveCVSCO, $StartTimeStr, $comptmp, $jflag);
|
1999-03-09 03:44:04 +03:00
|
|
|
$comptmp = '';
|
1999-04-06 02:43:52 +04:00
|
|
|
$jflag = '';
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
mkdir("$DirName", 0777);
|
|
|
|
chdir("$DirName") || die "Couldn't enter $DirName";
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
$StartDir = getcwd();
|
|
|
|
$LastTime = 0;
|
|
|
|
$EarlyExit = 0;
|
1999-04-08 07:01:20 +04:00
|
|
|
$SaveCVSCO = $CVSCO;
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-04-06 02:43:52 +04:00
|
|
|
# With only one it makes no sense to use this.
|
|
|
|
$jflag = "-j $cpus" if ( $cpus > 1 );
|
|
|
|
|
1999-05-05 08:00:55 +04:00
|
|
|
print "Starting dir is: $StartDir\n";
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
while ( ! $EarlyExit ) {
|
|
|
|
chdir("$StartDir");
|
|
|
|
if ( time - $LastTime < (60 * $BuildSleep) ) {
|
|
|
|
$SleepTime = (60 * $BuildSleep) - (time - $LastTime);
|
|
|
|
print "\n\nSleeping $SleepTime seconds ...\n";
|
|
|
|
sleep($SleepTime);
|
|
|
|
}
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
$LastTime = time;
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-04-15 05:46:04 +04:00
|
|
|
if ( $UseTimeStamp ) {
|
|
|
|
$CVSCO = $SaveCVSCO;
|
|
|
|
} else {
|
1999-04-16 05:57:00 +04:00
|
|
|
$CVSCO = $SaveCVSCO . ' -A';
|
1999-04-15 05:46:04 +04:00
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
$StartTime = time - 60 * 10;
|
|
|
|
$StartTimeStr = &CVSTime($StartTime);
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-03-18 12:19:22 +03:00
|
|
|
&StartBuild if ( $ReportStatus );
|
1999-02-14 10:15:44 +03:00
|
|
|
$CurrentDir = getcwd();
|
|
|
|
if ( $CurrentDir ne $StartDir ) {
|
|
|
|
print "startdir: $StartDir, curdir $CurrentDir\n";
|
|
|
|
die "curdir != startdir";
|
|
|
|
}
|
|
|
|
|
|
|
|
$BuildDir = $CurrentDir;
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
unlink( "$logfile" );
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
print "opening $logfile\n";
|
|
|
|
open( LOG, ">$logfile" ) || print "can't open $?\n";
|
1999-02-27 07:55:44 +03:00
|
|
|
print LOG "current dir is -- " . $ENV{'HOST'} . ":$CurrentDir\n";
|
1999-02-14 10:15:44 +03:00
|
|
|
print LOG "Build Administrator is $BuildAdministrator\n";
|
|
|
|
&PrintEnv;
|
1999-03-09 03:15:46 +03:00
|
|
|
if ( $Compiler ne '' ) {
|
|
|
|
print LOG "===============================\n";
|
|
|
|
if ( $Compiler eq 'gcc' || $Compiler eq 'egcc' ) {
|
1999-03-09 03:44:04 +03:00
|
|
|
$comptmp = `$Compiler --version`;
|
|
|
|
chop($comptmp);
|
|
|
|
print LOG "Compiler is -- $Compiler \($comptmp\)\n";
|
1999-03-09 03:15:46 +03:00
|
|
|
} else {
|
|
|
|
print LOG "Compiler is -- $Compiler\n";
|
|
|
|
}
|
|
|
|
print LOG "===============================\n";
|
|
|
|
}
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
$BuildStatus = 0;
|
|
|
|
|
|
|
|
mkdir($TopLevel, 0777);
|
|
|
|
chdir($TopLevel) || die "chdir($TopLevel): $!\n";
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-04-30 03:27:05 +04:00
|
|
|
print "$CVS $CVSCO mozilla/client.mk\n";
|
|
|
|
print LOG "$CVS $CVSCO mozilla/client.mk\n";
|
|
|
|
open (PULL, "$CVS $CVSCO mozilla/client.mk 2>&1 |") || die "open: $!\n";
|
1999-02-14 10:15:44 +03:00
|
|
|
while (<PULL>) {
|
|
|
|
print $_;
|
|
|
|
print LOG $_;
|
|
|
|
}
|
|
|
|
close(PULL);
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
# Do a separate checkout with toplevel makefile
|
1999-04-30 03:27:05 +04:00
|
|
|
print LOG "$Make -f mozilla/client.mk checkout CVSCO=\"$CVS $CVSCO\"|\n";
|
|
|
|
open (PULLALL, "$Make -f mozilla/client.mk checkout CVSCO=\"$CVS $CVSCO\" |\n");
|
|
|
|
while (<PULLALL>) {
|
|
|
|
print LOG $_;
|
|
|
|
print $_;
|
|
|
|
}
|
|
|
|
close(PULLALL);
|
|
|
|
|
|
|
|
if ( $BuildNSCommercial ) {
|
|
|
|
print LOG "$CVS -d /m/src $CVSCO $NSCommModule\n";
|
|
|
|
open (PULLNS, "$CVS -d /m/src $CVSCO $NSCommModule 2>&1 |") || die "open: $!\n";
|
|
|
|
while (<PULLNS>) {
|
1999-02-14 10:15:44 +03:00
|
|
|
print LOG $_;
|
|
|
|
print $_;
|
|
|
|
}
|
1999-04-30 03:27:05 +04:00
|
|
|
close(PULLNS);
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
chdir($Topsrcdir) || die "chdir($Topsrcdir): $!\n";
|
1999-04-30 03:27:05 +04:00
|
|
|
print LOG "Build nspr\n";
|
|
|
|
open (BUILDNSPR, "gmake -C nsprpub $NSPRArgs export 2>&1 | ") || die "Build nspr: $!\n";
|
|
|
|
while (<BUILDNSPR>) {
|
|
|
|
print LOG $_;
|
|
|
|
print $_;
|
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
|
1999-04-30 03:27:05 +04:00
|
|
|
if ( $UseObjDir ) {
|
|
|
|
print LOG "$ConfigGuess\n";
|
|
|
|
$BuildObjName = "obj-";
|
|
|
|
open (GETOBJ, "$ConfigGuess 2>&1 |") || die "$ConfigGuess: $!\n";
|
|
|
|
while (<GETOBJ>) {
|
|
|
|
print $_;
|
|
|
|
print LOG $_;
|
|
|
|
chomp($BuildObjName .= $_);
|
|
|
|
}
|
|
|
|
close (GETOBJ);
|
|
|
|
|
|
|
|
mkdir($BuildObjName, 0777);
|
|
|
|
chdir($BuildObjName) || die "chdir($BuildObjName): $!\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
print LOG "$ConfigureEnvArgs ../configure $ConfigureArgs\n";
|
|
|
|
open (CONFIGURE, "$ConfigureEnvArgs $ShellOverride ../configure $ConfigureArgs 2>&1 |") || die "../configure: $!\n";
|
|
|
|
while (<CONFIGURE>) {
|
1999-04-28 01:32:19 +04:00
|
|
|
print $_;
|
|
|
|
print LOG $_;
|
1999-04-30 03:27:05 +04:00
|
|
|
}
|
|
|
|
close(CONFIGURE);
|
|
|
|
|
1999-03-18 12:19:22 +03:00
|
|
|
# If we are building depend, rebuild dependencies
|
|
|
|
if ( $BuildDepend ) {
|
1999-04-30 03:27:05 +04:00
|
|
|
$ClobberTarget = '';
|
|
|
|
$DependTarget = 'depend';
|
1999-02-14 10:15:44 +03:00
|
|
|
} else {
|
1999-04-30 03:27:05 +04:00
|
|
|
$ClobberTarget = 'realclean';
|
|
|
|
$DependTarget = '';
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
|
|
|
|
1999-04-30 03:27:05 +04:00
|
|
|
print LOG "$Make MAKE='$Make $jflag' $DependTarget $ClobberTarget 2>&1 |\n";
|
|
|
|
open (MAKEPREBUILD, "$Make MAKE='$Make $jflag' $DependTarget $ClobberTarget 2>&1 |");
|
|
|
|
while (<MAKEPREBUILD>) {
|
|
|
|
print $_;
|
|
|
|
print LOG $_;
|
|
|
|
}
|
|
|
|
close (MAKEPREBUILD);
|
|
|
|
system("rm -rf dist");
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-04-30 03:27:05 +04:00
|
|
|
print LOG "$Make MAKE='$Make $jflag' $MakeOverrides 2>&1 |\n";
|
|
|
|
open(BUILD, "$Make MAKE='$Make $jflag' $MakeOverrides 2>&1 |\n");
|
|
|
|
while (<BUILD>) {
|
|
|
|
print $_;
|
|
|
|
print LOG $_;
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
1999-04-30 03:27:05 +04:00
|
|
|
close(BUILD);
|
|
|
|
|
|
|
|
@felist = split(/,/, $FE);
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
foreach $fe (@felist) {
|
1999-03-18 12:19:22 +03:00
|
|
|
if ( &BinaryExists($fe) ) {
|
1999-03-03 04:21:42 +03:00
|
|
|
if ( $RunTest ) {
|
1999-04-30 03:27:05 +04:00
|
|
|
print LOG "$FE binary exists, build successful. Testing...\n";
|
1999-03-03 04:21:42 +03:00
|
|
|
$BuildStatus = &RunSmokeTest($fe);
|
|
|
|
} else {
|
1999-04-30 03:27:05 +04:00
|
|
|
print LOG "$FE binary exists, build successful. Skipping test.\n";
|
1999-03-03 04:21:42 +03:00
|
|
|
$BuildStatus = 0;
|
|
|
|
}
|
|
|
|
} else {
|
1999-04-30 03:27:05 +04:00
|
|
|
print LOG "$FE binary missing, build FAILED\n";
|
1999-03-03 04:21:42 +03:00
|
|
|
$BuildStatus = 666;
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
if ( $BuildStatus == 0 ) {
|
1999-03-03 04:21:42 +03:00
|
|
|
$BuildStatusStr = 'success';
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
|
|
|
elsif ( $BuildStatus == 333 ) {
|
1999-03-03 04:21:42 +03:00
|
|
|
$BuildStatusStr = 'testfailed';
|
|
|
|
} else {
|
|
|
|
$BuildStatusStr = 'busted';
|
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
print LOG "tinderbox: tree: $BuildTree\n";
|
|
|
|
print LOG "tinderbox: builddate: $StartTime\n";
|
|
|
|
print LOG "tinderbox: status: $BuildStatusStr\n";
|
|
|
|
print LOG "tinderbox: build: $BuildName $fe\n";
|
|
|
|
print LOG "tinderbox: errorparser: unix\n";
|
|
|
|
print LOG "tinderbox: buildfamily: unix\n";
|
|
|
|
print LOG "tinderbox: END\n";
|
|
|
|
}
|
|
|
|
close(LOG);
|
|
|
|
chdir("$StartDir");
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-05-05 08:00:55 +04:00
|
|
|
# This fun line added on 2/5/98. Do not remove. Translated to english,
|
1999-03-03 04:21:42 +03:00
|
|
|
# that's "take any line longer than 1000 characters, and split it into less
|
|
|
|
# than 1000 char lines. If any of the resulting lines is
|
|
|
|
# a dot on a line by itself, replace that with a blank line."
|
|
|
|
# This is to prevent cases where a <cr>.<cr> occurs in the log file. Sendmail
|
|
|
|
# interprets that as the end of the mail, and truncates the log before
|
1999-05-05 08:00:55 +04:00
|
|
|
# it gets to Tinderbox. (Terry Weismann, Chris Yeh)
|
1999-03-03 04:21:42 +03:00
|
|
|
#
|
|
|
|
# This was replaced by a perl 'port' of the above, writen by
|
|
|
|
# preed@netscape.com; good things: no need for system() call, and now it's
|
|
|
|
# all in perl, so we don't have to do OS checking like before.
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
open(LOG, "$logfile") || die "Couldn't open logfile: $!\n";
|
|
|
|
open(OUTLOG, ">${logfile}.last") || die "Couldn't open logfile: $!\n";
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
while (<LOG>) {
|
|
|
|
$q = 0;
|
|
|
|
for (;;) {
|
|
|
|
$val = $q * 1000;
|
|
|
|
$Output = substr($_, $val, 1000);
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-03-18 12:19:22 +03:00
|
|
|
last if ( $Output eq undef );
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
$Output =~ s/^\.$//g;
|
|
|
|
$Output =~ s/\n//g;
|
|
|
|
print OUTLOG "$Output\n";
|
|
|
|
$q++;
|
1999-04-07 04:29:45 +04:00
|
|
|
}
|
1999-04-14 13:02:14 +04:00
|
|
|
}
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
close(LOG);
|
|
|
|
close(OUTLOG);
|
|
|
|
|
1999-03-03 04:21:42 +03:00
|
|
|
system( "$mail $Tinderbox_server < ${logfile}.last" ) if ( $ReportStatus );
|
1999-02-14 10:15:44 +03:00
|
|
|
unlink("$logfile");
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-03-18 12:19:22 +03:00
|
|
|
# If this is a test run, set early_exit to 0.
|
|
|
|
# This mean one loop of execution
|
|
|
|
$EarlyExit++ if ( $BuildOnce );
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
1999-03-18 11:47:10 +03:00
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
sub CVSTime {
|
|
|
|
my($StartTimeArg) = @_;
|
1999-03-09 03:15:46 +03:00
|
|
|
my($RetTime, $sec, $minute, $hour, $mday, $mon, $year);
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
($sec,$minute,$hour,$mday,$mon,$year) = localtime($StartTimeArg);
|
|
|
|
$mon++; # month is 0 based.
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-04-07 04:29:45 +04:00
|
|
|
if ( $UseTimeStamp ) {
|
|
|
|
$BuildStart = `date '+%D %H:%M'`;
|
|
|
|
chop($BuildStart);
|
|
|
|
$CVSCO .= " -D '$BuildStart'";
|
|
|
|
}
|
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
sprintf("%02d/%02d/%02d %02d:%02d:00", $mon,$mday,$year,$hour,$minute );
|
|
|
|
}
|
|
|
|
|
|
|
|
sub StartBuild {
|
|
|
|
my($fe, @felist);
|
|
|
|
|
|
|
|
@felist = split(/,/, $FE);
|
|
|
|
|
|
|
|
open( LOG, "|$mail $Tinderbox_server" );
|
|
|
|
foreach $fe ( @felist ) {
|
|
|
|
print LOG "\n";
|
|
|
|
print LOG "tinderbox: tree: $BuildTree\n";
|
|
|
|
print LOG "tinderbox: builddate: $StartTime\n";
|
|
|
|
print LOG "tinderbox: status: building\n";
|
|
|
|
print LOG "tinderbox: build: $BuildName $fe\n";
|
|
|
|
print LOG "tinderbox: errorparser: unix\n";
|
|
|
|
print LOG "tinderbox: buildfamily: unix\n";
|
|
|
|
print LOG "tinderbox: END\n";
|
|
|
|
print LOG "\n";
|
|
|
|
}
|
|
|
|
close( LOG );
|
|
|
|
}
|
|
|
|
|
|
|
|
# check for the existence of the binary
|
|
|
|
sub BinaryExists {
|
1999-04-30 03:27:05 +04:00
|
|
|
my($Binname);
|
|
|
|
|
|
|
|
$BinName = $BuildDir . '/' . $TopLevel . '/' . $Topsrcdir . '/' . $BuildObjName . $BinaryName;
|
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
print LOG $BinName . "\n";
|
1999-03-18 12:19:22 +03:00
|
|
|
if ( (-e $BinName) && (-x $BinName) && (-s $BinName) ) {
|
1999-04-30 03:27:05 +04:00
|
|
|
1;
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
|
|
|
else {
|
1999-04-30 03:27:05 +04:00
|
|
|
0;
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub ParseArgs {
|
|
|
|
my($i, $manArg);
|
|
|
|
|
|
|
|
if( @ARGV == 0 ) {
|
|
|
|
&PrintUsage;
|
|
|
|
}
|
|
|
|
$i = 0;
|
|
|
|
$manArg = 0;
|
|
|
|
while( $i < @ARGV ) {
|
1999-04-30 03:27:05 +04:00
|
|
|
if ( $ARGV[$i] eq '--clobber' ) {
|
1999-02-14 10:15:44 +03:00
|
|
|
$BuildDepend = 0;
|
1999-04-30 03:27:05 +04:00
|
|
|
$ConfigureArgs .= '--disable-md ';
|
1999-02-14 10:15:44 +03:00
|
|
|
$manArg++;
|
|
|
|
}
|
1999-04-30 03:27:05 +04:00
|
|
|
elsif ( $ARGV[$i] eq '--commercial' ) {
|
|
|
|
$BuildNSCommercial = 1;
|
|
|
|
}
|
1999-04-07 04:29:45 +04:00
|
|
|
elsif ( $ARGV[$i] eq '--compress' ) {
|
|
|
|
$CVS = 'cvs -q -z3';
|
|
|
|
}
|
1999-03-18 12:19:22 +03:00
|
|
|
elsif ( $ARGV[$i] eq '--depend' ) {
|
1999-03-03 04:21:42 +03:00
|
|
|
$BuildDepend = 1;
|
|
|
|
$manArg++;
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
1999-03-18 12:30:57 +03:00
|
|
|
elsif ( $ARGV[$i] eq '--help' || $ARGV[$i] eq '-h' ) {
|
1999-04-14 13:02:14 +04:00
|
|
|
&PrintUsage;
|
1999-03-18 12:30:57 +03:00
|
|
|
}
|
1999-04-30 03:27:05 +04:00
|
|
|
elsif ( $ARGV[$i] eq '--noobjdir' ) {
|
|
|
|
$UseObjDir = 0;
|
1999-04-06 02:43:52 +04:00
|
|
|
}
|
1999-03-18 12:19:22 +03:00
|
|
|
elsif ( $ARGV[$i] eq '--noreport' ) {
|
1999-02-14 10:15:44 +03:00
|
|
|
$ReportStatus = 0;
|
|
|
|
}
|
1999-03-18 12:19:22 +03:00
|
|
|
elsif ( $ARGV[$i] eq '--notest' ) {
|
1999-03-03 04:21:42 +03:00
|
|
|
$RunTest = 0;
|
|
|
|
}
|
|
|
|
elsif ( $ARGV[$i] eq '--once' ) {
|
|
|
|
$BuildOnce = 1;
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
|
|
|
elsif ( $ARGV[$i] eq '-tag' ) {
|
|
|
|
$i++;
|
|
|
|
$BuildTag = $ARGV[$i];
|
1999-03-18 12:19:22 +03:00
|
|
|
if ( $BuildTag eq '' || $BuildTag eq '-t' ) {
|
1999-02-14 10:15:44 +03:00
|
|
|
&PrintUsage;
|
1999-04-30 03:27:05 +04:00
|
|
|
} else {
|
|
|
|
$CVSCO .= " -r $BuildTag";
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
|
|
|
}
|
1999-04-07 04:29:45 +04:00
|
|
|
elsif ( $ARGV[$i] eq '--timestamp' ) {
|
|
|
|
$UseTimeStamp = 1;
|
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
elsif ( $ARGV[$i] eq '-t' ) {
|
|
|
|
$i++;
|
|
|
|
$BuildTree = $ARGV[$i];
|
|
|
|
if ( $BuildTree eq '' ) {
|
|
|
|
&PrintUsage;
|
|
|
|
}
|
1999-03-03 04:21:42 +03:00
|
|
|
}
|
1999-03-18 12:19:22 +03:00
|
|
|
elsif ( $ARGV[$i] eq '--version' || $ARGV[$i] eq '-v' ) {
|
|
|
|
die "$0: version" . substr($Version,9,6) . "\n";
|
1999-02-14 10:15:44 +03:00
|
|
|
} else {
|
|
|
|
&PrintUsage;
|
|
|
|
}
|
|
|
|
$i++;
|
1999-03-18 12:19:22 +03:00
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
if ( $BuildTree =~ /^\s+$/i ) {
|
|
|
|
&PrintUsage;
|
|
|
|
}
|
|
|
|
|
1999-03-18 12:19:22 +03:00
|
|
|
if ( $BuildDepend eq undef ) {
|
1999-02-14 10:15:44 +03:00
|
|
|
&PrintUsage;
|
|
|
|
}
|
|
|
|
|
1999-03-18 12:19:22 +03:00
|
|
|
&PrintUsage if ( $manArg == 0 );
|
1999-03-18 11:47:10 +03:00
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
sub PrintUsage {
|
1999-04-30 03:27:05 +04:00
|
|
|
die "usage: $0 --depend | --clobber [ --once --compress --noreport --notest --timestamp -tag TREETAG -t TREENAME --version ]\n";
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
sub PrintEnv {
|
1999-03-18 11:47:10 +03:00
|
|
|
my($key);
|
|
|
|
foreach $key (sort(keys %ENV)) {
|
|
|
|
print LOG $key, '=', $ENV{$key}, "\n";
|
|
|
|
print $key, '=', $ENV{$key}, "\n";
|
1999-02-14 10:15:44 +03:00
|
|
|
}
|
1999-03-18 11:47:10 +03:00
|
|
|
}
|
1999-02-14 10:15:44 +03:00
|
|
|
|
|
|
|
sub RunSmokeTest {
|
1999-04-30 03:27:05 +04:00
|
|
|
my($Binary, $BinaryLog);
|
1999-03-03 04:21:42 +03:00
|
|
|
my($status) = 0;
|
1999-04-30 03:27:05 +04:00
|
|
|
my($waittime) = 60;
|
1999-03-03 04:21:42 +03:00
|
|
|
my($pid) = fork;
|
1999-02-14 10:15:44 +03:00
|
|
|
|
1999-04-30 03:27:05 +04:00
|
|
|
$ENV{"MOZILLA_FIVE_HOME"} = $BuildDir . '/' . $TopLevel . '/' . $Topsrcdir . '/' . $BuildObjName . '/dist/bin';
|
|
|
|
$Binary = $BuildDir . '/' . $TopLevel . '/' . $Topsrcdir . '/' . $BuildObjName . $BinaryName;
|
|
|
|
$BinaryLog = $BuildDir . '/runlog';
|
|
|
|
|
1999-02-23 06:52:21 +03:00
|
|
|
print LOG $Binary . "\n";
|
1999-02-14 10:15:44 +03:00
|
|
|
|
1999-04-28 01:32:19 +04:00
|
|
|
if ( !$pid ) { # child
|
1999-04-30 03:27:05 +04:00
|
|
|
chdir("$ENV{'MOZILLA_FIVE_HOME'}");
|
|
|
|
print LOG "MOZILLA_FIVE_HOME = $ENV{'MOZILLA_FIVE_HOME'}\n";
|
|
|
|
print LOG `pwd`;
|
|
|
|
unlink("$BinaryLog");
|
|
|
|
open(STDOUT,">$BinaryLog");
|
|
|
|
select STDOUT; $| = 1; # make STDOUT unbuffered
|
|
|
|
open(STDERR,">&STDOUT");
|
|
|
|
select STDERR; $| = 1; # make STDERR unbuffered
|
|
|
|
exec("$Binary");
|
|
|
|
close(STDOUT);
|
|
|
|
close(STDERR);
|
|
|
|
die "Couldn't exec()";
|
|
|
|
}
|
|
|
|
|
1999-03-03 04:21:42 +03:00
|
|
|
# parent - wait $waittime seconds then check on child
|
|
|
|
sleep $waittime;
|
|
|
|
$status = waitpid($pid, WNOHANG());
|
1999-03-18 12:19:22 +03:00
|
|
|
if ( $status != 0 ) {
|
1999-03-03 04:21:42 +03:00
|
|
|
print LOG "$Binary has crashed or quit. Turn the tree orange now.\n";
|
1999-04-30 03:27:05 +04:00
|
|
|
print LOG "------------------------- Output from $FE\n";
|
|
|
|
open(READRUNLOG, "$BinaryLog");
|
1999-04-28 01:32:19 +04:00
|
|
|
while (<READRUNLOG>) {
|
1999-04-30 03:27:05 +04:00
|
|
|
print $_;
|
|
|
|
print LOG $_;
|
1999-04-28 01:32:19 +04:00
|
|
|
}
|
|
|
|
close(READRUNLOG);
|
1999-04-30 03:27:05 +04:00
|
|
|
print LOG "------------------------- End of Output\n";
|
1999-03-03 04:21:42 +03:00
|
|
|
return 333;
|
|
|
|
}
|
|
|
|
|
1999-04-30 03:27:05 +04:00
|
|
|
print LOG "Success! $FE is still running. Killing...\n";
|
1999-03-03 04:21:42 +03:00
|
|
|
for ($i=0 ; $i<3 ; $i++) {
|
|
|
|
kill('TERM',$pid,);
|
|
|
|
# give it 3 seconds to actually die
|
|
|
|
sleep 3;
|
|
|
|
$status = waitpid($pid, WNOHANG());
|
1999-03-18 12:19:22 +03:00
|
|
|
last if ( $status != 0 );
|
1999-03-03 04:21:42 +03:00
|
|
|
}
|
|
|
|
return 0;
|
1999-03-18 11:47:10 +03:00
|
|
|
}
|
1999-03-03 04:21:42 +03:00
|
|
|
|
1999-02-14 10:15:44 +03:00
|
|
|
# Main function
|
|
|
|
&InitVars;
|
|
|
|
&ParseArgs;
|
|
|
|
&GetSystemInfo;
|
|
|
|
&SetupEnv;
|
|
|
|
&SetupPath;
|
|
|
|
&BuildIt;
|
|
|
|
|
|
|
|
1;
|