2010-04-04 23:07:37 +00:00
|
|
|
#!/usr/bin/perl
|
2014-05-17 21:37:12 +00:00
|
|
|
# vim: set ts=2 sw=2 tw=99 noet:
|
2010-04-04 23:07:37 +00:00
|
|
|
|
|
|
|
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';
|
|
|
|
|
2014-05-17 21:37:12 +00:00
|
|
|
#Go back above build 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");
|
2014-05-17 21:37:12 +00:00
|
|
|
}
|
|
|
|
chdir('OUTPUT');
|
|
|
|
my ($result, $argn);
|
|
|
|
$argn = $#ARGV + 1;
|
|
|
|
print "Attempting to reconfigure...\n";
|
|
|
|
my $conf_args = '--enable-optimize --no-color --symbol-files';
|
|
|
|
if ($argn > 0 && $^O !~ /MSWin/) {
|
|
|
|
$result = `CC=$ARGV[0] CXX=$ARGV[0] python ../build/configure.py $conf_args`;
|
|
|
|
} else {
|
|
|
|
if ($^O =~ /MSWin/) {
|
2021-02-10 21:32:02 +00:00
|
|
|
$result = `C:\\Python38\\Python.exe ..\\build\\configure.py $conf_args`;
|
2014-02-09 05:23:02 +00:00
|
|
|
} else {
|
2014-05-17 21:37:12 +00:00
|
|
|
$result = `CC=clang CXX=clang python ../build/configure.py $conf_args`;
|
2014-02-09 05:23:02 +00:00
|
|
|
}
|
2010-04-04 23:07:37 +00:00
|
|
|
}
|
2014-05-17 21:37:12 +00:00
|
|
|
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
|
|
|
|