support/buildbot/bootstrap.pl
author David Anderson <dvander@alliedmods.net>
Mon Nov 18 10:14:38 2013 -0800 (2013-11-18)
changeset 873 d7e398fed28e
parent 871 d1853b81049e
child 875 fbc03d6caf7f
permissions -rwxr-xr-x
Disable console colors on buildbot.
     1 #!/usr/bin/perl
     2 # vim: set ts=2 sw=2 tw=99 noet: 
     3 
     4 use strict;
     5 use Cwd;
     6 use File::Basename;
     7 use File::Path;
     8 
     9 my ($myself, $path) = fileparse($0);
    10 chdir($path);
    11 
    12 require 'helpers.pm';
    13 
    14 #Go back above build dir
    15 chdir(Build::PathFormat('../../..'));
    16 
    17 #Get the source path.
    18 our ($root) = getcwd();
    19 
    20 my $reconf = 0;
    21 
    22 if (!(-f 'OUTPUT/.ambuild2/graph')) {
    23 	rmtree('OUTPUT');
    24 	mkdir('OUTPUT') or die("Failed to create output folder: $!\n");
    25 	chdir('OUTPUT');
    26 	my ($result, $argn);
    27 	$argn = $#ARGV + 1;
    28 	print "Attempting to reconfigure...\n";
    29 	if ($argn > 0 && $^O !~ /MSWin/) {
    30 		$result = `CC=$ARGV[0] CXX=$ARGV[0] python ../build/configure.py --enable-optimize`;
    31 	} else {
    32 		if ($^O eq "linux") {
    33 			$result = `CC=gcc-4.4 CXX=gcc-4.4 python ../build/configure.py --enable-optimize`;
    34 		} elsif ($^O eq "darwin") {
    35 			$result = `CC=clang CXX=clang python ../build/configure.py --enable-optimize`;
    36 		} else {
    37 			$result = `C:\\Python27\\Python.exe ..\\build\\configure.py --enable-optimize`;
    38 		}
    39 	}
    40 	print "$result\n";
    41 	if ($? != 0) {
    42 		die('Could not configure!');
    43 	}
    44 	open(FILE, '>sentinel');
    45 	print FILE "this is nothing.\n";
    46 	close(FILE);
    47 }
    48 
    49 sub IsNewer
    50 {
    51 	my ($file, $time) = (@_);
    52 
    53 	my @s = stat($file);
    54 	my $mtime = $s[9];
    55 	return $mtime > $time;
    56 }
    57 
    58 exit(0);
    59 
    60