1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/buildbot/bootstrap.pl Sat Apr 16 01:16:39 2011 -0700
1.3 @@ -0,0 +1,75 @@
1.4 +#!/usr/bin/perl
1.5 +# vim: set ts=2 sw=2 tw=99 noet:
1.6 +
1.7 +use strict;
1.8 +use Cwd;
1.9 +use File::Basename;
1.10 +use File::Path;
1.11 +
1.12 +my ($myself, $path) = fileparse($0);
1.13 +chdir($path);
1.14 +
1.15 +require 'helpers.pm';
1.16 +
1.17 +#Go back above build dir
1.18 +chdir(Build::PathFormat('../..'));
1.19 +
1.20 +#Get the source path.
1.21 +our ($root) = getcwd();
1.22 +
1.23 +my $reconf = 0;
1.24 +
1.25 +#Create output folder if it doesn't exist.
1.26 +if (!(-d 'OUTPUT')) {
1.27 + $reconf = 1;
1.28 +} else {
1.29 + if (-f 'OUTPUT/sentinel') {
1.30 + my @s = stat('OUTPUT/sentinel');
1.31 + my $mtime = $s[9];
1.32 + my @files = ('build/pushbuild.txt', 'build/AMBuildScript', 'build/product.version');
1.33 + my ($i);
1.34 + for ($i = 0; $i <= $#files; $i++) {
1.35 + if (IsNewer($files[$i], $mtime)) {
1.36 + $reconf = 1;
1.37 + last;
1.38 + }
1.39 + }
1.40 + } else {
1.41 + $reconf = 1;
1.42 + }
1.43 +}
1.44 +
1.45 +if ($reconf) {
1.46 + rmtree('OUTPUT');
1.47 + mkdir('OUTPUT') or die("Failed to create output folder: $!\n");
1.48 + chdir('OUTPUT');
1.49 + my ($result);
1.50 + print "Attempting to reconfigure...\n";
1.51 + if ($^O eq "linux") {
1.52 + $result = `CC=gcc-4.1 CXX=gcc-4.1 python3.1 ../build/configure.py --enable-optimize`;
1.53 + } elsif ($^O eq "darwin") {
1.54 + $result = `CC=gcc-4.2 CXX=gcc-4.2 python3.1 ../build/configure.py --enable-optimize`;
1.55 + } else {
1.56 + $result = `C:\\Python31\\Python.exe ..\\build\\configure.py --enable-optimize`;
1.57 + }
1.58 + print "$result\n";
1.59 + if ($? != 0) {
1.60 + die('Could not configure!');
1.61 + }
1.62 + open(FILE, '>sentinel');
1.63 + print FILE "this is nothing.\n";
1.64 + close(FILE);
1.65 +}
1.66 +
1.67 +sub IsNewer
1.68 +{
1.69 + my ($file, $time) = (@_);
1.70 +
1.71 + my @s = stat($file);
1.72 + my $mtime = $s[9];
1.73 + return $mtime > $time;
1.74 +}
1.75 +
1.76 +exit(0);
1.77 +
1.78 +