2010-04-04 23:07:37 +00:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Cwd;
|
|
|
|
use File::Basename;
|
2014-02-13 07:30:03 +00:00
|
|
|
use File::Path;
|
2010-04-04 23:07:37 +00:00
|
|
|
|
|
|
|
my ($myself, $path) = fileparse($0);
|
|
|
|
chdir($path);
|
|
|
|
|
|
|
|
require 'helpers.pm';
|
|
|
|
|
|
|
|
#Go to main source dir
|
2014-02-09 05:45:40 +00:00
|
|
|
chdir(Build::PathFormat('../../..'));
|
2010-04-04 23:07:37 +00:00
|
|
|
|
2014-02-09 05:23:02 +00:00
|
|
|
#Get the source path.
|
|
|
|
our ($root) = getcwd();
|
|
|
|
|
|
|
|
my $reconf = 0;
|
|
|
|
|
|
|
|
if (!(-f 'OUTPUT/.ambuild2/graph') || !(-f 'OUTPUT/.ambuild2/vars')) {
|
|
|
|
rmtree('OUTPUT');
|
|
|
|
mkdir('OUTPUT') or die("Failed to create output folder: $!\n");
|
|
|
|
chdir('OUTPUT');
|
|
|
|
my ($result, $argn);
|
|
|
|
$argn = $#ARGV + 1;
|
|
|
|
print "Attempting to reconfigure...\n";
|
|
|
|
my $conf_args = '--enable-optimize --no-color';
|
|
|
|
if ($argn > 0 && $^O !~ /MSWin/) {
|
|
|
|
$result = `CC=$ARGV[0] CXX=$ARGV[0] python ../build/configure.py $conf_args`;
|
|
|
|
} else {
|
|
|
|
if ($^O =~ /MSWin/) {
|
|
|
|
$result = `C:\\Python27\\Python.exe ..\\build\\configure.py $conf_args`;
|
|
|
|
} else {
|
|
|
|
$result = `CC=clang CXX=clang python ../build/configure.py $conf_args`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print "$result\n";
|
|
|
|
if ($? != 0) {
|
|
|
|
die("Could not configure: $!\n");
|
|
|
|
}
|
2010-04-04 23:07:37 +00:00
|
|
|
}
|
|
|
|
|
2014-02-09 05:23:02 +00:00
|
|
|
sub IsNewer
|
|
|
|
{
|
|
|
|
my ($file, $time) = (@_);
|
2010-04-04 23:24:42 +00:00
|
|
|
|
2014-02-09 05:23:02 +00:00
|
|
|
my @s = stat($file);
|
|
|
|
my $mtime = $s[9];
|
|
|
|
return $mtime > $time;
|
2010-04-04 23:24:42 +00:00
|
|
|
}
|
|
|
|
|
2014-02-09 05:23:02 +00:00
|
|
|
exit(0);
|
|
|
|
|
2010-04-04 23:37:28 +00:00
|
|
|
|
2010-04-04 23:24:42 +00:00
|
|
|
|