2010-04-05 03:07:37 +04:00
|
|
|
#!/usr/bin/perl
|
2014-05-18 01:37:12 +04:00
|
|
|
# vim: set ts=2 sw=2 tw=99 noet:
|
2010-04-05 03:07:37 +04:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Cwd;
|
|
|
|
use File::Basename;
|
2014-02-13 11:30:03 +04:00
|
|
|
use File::Path;
|
2010-04-05 03:07:37 +04:00
|
|
|
|
|
|
|
my ($myself, $path) = fileparse($0);
|
|
|
|
chdir($path);
|
|
|
|
|
|
|
|
require 'helpers.pm';
|
|
|
|
|
2014-05-18 01:37:12 +04:00
|
|
|
#Go back above build dir
|
2014-02-09 09:45:40 +04:00
|
|
|
chdir(Build::PathFormat('../../..'));
|
2010-04-05 03:07:37 +04:00
|
|
|
|
2014-02-09 09:23:02 +04: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-18 01:37:12 +04: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/) {
|
2021-07-12 03:30:38 +03:00
|
|
|
$result = `CC=$ARGV[0] CXX=$ARGV[0] python3 ../build/configure.py $conf_args`;
|
2014-05-18 01:37:12 +04:00
|
|
|
} else {
|
|
|
|
if ($^O =~ /MSWin/) {
|
2021-02-11 00:32:02 +03:00
|
|
|
$result = `C:\\Python38\\Python.exe ..\\build\\configure.py $conf_args`;
|
2014-02-09 09:23:02 +04:00
|
|
|
} else {
|
2021-07-12 03:30:38 +03:00
|
|
|
$result = `CC=clang CXX=clang python3 ../build/configure.py $conf_args`;
|
2014-02-09 09:23:02 +04:00
|
|
|
}
|
2010-04-05 03:07:37 +04:00
|
|
|
}
|
2014-05-18 01:37:12 +04:00
|
|
|
print "$result\n";
|
|
|
|
if ($? != 0) {
|
|
|
|
die("Could not configure: $!\n");
|
|
|
|
}
|
2010-04-05 03:07:37 +04:00
|
|
|
|
2014-02-09 09:23:02 +04:00
|
|
|
sub IsNewer
|
|
|
|
{
|
|
|
|
my ($file, $time) = (@_);
|
2010-04-05 03:24:42 +04:00
|
|
|
|
2014-02-09 09:23:02 +04:00
|
|
|
my @s = stat($file);
|
|
|
|
my $mtime = $s[9];
|
|
|
|
return $mtime > $time;
|
2010-04-05 03:24:42 +04:00
|
|
|
}
|
|
|
|
|
2014-02-09 09:23:02 +04:00
|
|
|
exit(0);
|
|
|
|
|
2010-04-05 03:37:28 +04:00
|
|
|
|