tools/buildbot/bootstrap.pl
author Scott Ehlert <ds@alliedmods.net>
Sat May 17 15:05:58 2014 -0500 (2014-05-17)
changeset 4370 c4fb9175ac12
parent 4223 ce8d03613a20
permissions -rwxr-xr-x
Add --symbol-files option to AMBuild configure.
     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') || !(-f 'OUTPUT/.ambuild2/vars')) {
    23 	rmtree('OUTPUT');
    24 	mkdir('OUTPUT') or die("Failed to create output folder: $!\n");
    25 }
    26 chdir('OUTPUT');
    27 my ($result, $argn);
    28 $argn = $#ARGV + 1;
    29 print "Attempting to reconfigure...\n";
    30 my $conf_args = '--enable-optimize --breakpad-dump --no-color --symbol-files';
    31 if ($argn > 0 && $^O !~ /MSWin/) {
    32 	$result = `CC=$ARGV[0] CXX=$ARGV[0] python ../build/configure.py $conf_args`;
    33 } else {
    34 	if ($^O =~ /MSWin/) {
    35 		$result = `C:\\Python27\\Python.exe ..\\build\\configure.py $conf_args`;
    36 	} else {
    37 		$result = `CC=clang CXX=clang python ../build/configure.py $conf_args`;
    38 	}
    39 }
    40 print "$result\n";
    41 if ($? != 0) {
    42 	die("Could not configure: $!\n");
    43 }
    44 
    45 sub IsNewer
    46 {
    47 	my ($file, $time) = (@_);
    48 
    49 	my @s = stat($file);
    50 	my $mtime = $s[9];
    51 	return $mtime > $time;
    52 }
    53 
    54 exit(0);
    55 
    56