2008-09-06 09:39:10 +02:00
|
|
|
#!/usr/bin/perl
|
2009-08-30 09:21:42 +02:00
|
|
|
# vim: set ts=2 sw=2 tw=99 noet:
|
2008-09-06 09:39:10 +02:00
|
|
|
|
2008-09-06 10:35:27 +02:00
|
|
|
use strict;
|
|
|
|
use Cwd;
|
|
|
|
use File::Basename;
|
2009-10-06 08:46:06 +02:00
|
|
|
use File::Path;
|
2008-09-06 10:35:27 +02:00
|
|
|
|
|
|
|
my ($myself, $path) = fileparse($0);
|
|
|
|
chdir($path);
|
|
|
|
|
2021-12-13 19:16:14 +01:00
|
|
|
use FindBin;
|
|
|
|
use lib $FindBin::Bin;
|
2008-09-06 10:19:05 +02:00
|
|
|
require 'helpers.pm';
|
2008-09-06 09:39:10 +02:00
|
|
|
|
2015-03-16 03:31:34 +01:00
|
|
|
#Go back to tree root.
|
|
|
|
my ($result);
|
|
|
|
chdir(Build::PathFormat('../..'));
|
|
|
|
$result = `git submodule update --init --recursive`;
|
|
|
|
print "$result\n";
|
|
|
|
|
2009-08-30 09:21:42 +02:00
|
|
|
#Go back above build dir
|
2015-03-16 03:31:34 +01:00
|
|
|
chdir(Build::PathFormat('..'));
|
2008-09-06 11:12:21 +02:00
|
|
|
|
|
|
|
#Get the source path.
|
2009-01-12 06:36:36 +01:00
|
|
|
our ($root) = getcwd();
|
2008-09-06 11:12:21 +02:00
|
|
|
|
2020-08-19 08:42:36 +02:00
|
|
|
my $trigger_file = 'build/tools/buildbot/trigger_full_rebuild';
|
|
|
|
if (-f $trigger_file) {
|
|
|
|
my $trigger_mtime = (stat $trigger_file)[9];
|
|
|
|
if (-f 'OUTPUT/.ambuild2/graph') {
|
2020-08-19 08:29:24 +02:00
|
|
|
my $graph_mtime = (stat 'OUTPUT/.ambuild2/graph')[9];
|
|
|
|
if ($trigger_mtime > $graph_mtime) {
|
2020-08-19 08:42:36 +02:00
|
|
|
print "Trigger time $trigger_mtime > $graph_mtime, cleaning objdir...\n";
|
2020-08-19 08:29:24 +02:00
|
|
|
rmtree('OUTPUT');
|
|
|
|
}
|
2020-08-19 08:42:36 +02:00
|
|
|
}
|
2020-08-19 08:29:24 +02:00
|
|
|
}
|
2013-12-30 23:51:01 +01:00
|
|
|
if (!(-f 'OUTPUT/.ambuild2/graph') || !(-f 'OUTPUT/.ambuild2/vars')) {
|
2009-10-06 08:46:06 +02:00
|
|
|
rmtree('OUTPUT');
|
|
|
|
mkdir('OUTPUT') or die("Failed to create output folder: $!\n");
|
2014-02-03 05:26:04 +01:00
|
|
|
}
|
|
|
|
chdir('OUTPUT');
|
2015-03-16 03:31:34 +01:00
|
|
|
my ($argn);
|
2014-02-03 05:26:04 +01:00
|
|
|
$argn = $#ARGV + 1;
|
2014-05-27 07:17:58 +02:00
|
|
|
|
2014-02-03 05:26:04 +01:00
|
|
|
print "Attempting to reconfigure...\n";
|
2014-05-27 07:17:58 +02:00
|
|
|
|
|
|
|
my @conf_argv = (
|
|
|
|
'--enable-optimize',
|
|
|
|
'--breakpad-dump',
|
|
|
|
'--no-color',
|
|
|
|
'--symbol-files'
|
|
|
|
);
|
|
|
|
|
|
|
|
if ($^O =~ /darwin/) {
|
|
|
|
push(@conf_argv, '--hl2sdk-root=/Volumes/hgshare');
|
2021-09-28 05:14:21 +02:00
|
|
|
push(@conf_argv, '--mms-path=/Users/builds/slaves/common/mmsource-master');
|
2014-05-27 07:17:58 +02:00
|
|
|
} elsif ($^O =~ /linux/) {
|
2014-05-27 07:21:27 +02:00
|
|
|
push(@conf_argv, '--hl2sdk-root=/hgshare');
|
2021-09-28 05:14:21 +02:00
|
|
|
push(@conf_argv, '--mms-path=/home/builds/common/mmsource-master');
|
2014-05-27 07:17:58 +02:00
|
|
|
} elsif ($^O =~ /MSWin/) {
|
|
|
|
push(@conf_argv, '--hl2sdk-root=H:\\');
|
2021-10-13 16:36:15 +02:00
|
|
|
push(@conf_argv, '--mms-path=D:\\Scripts\\common\\mmsource-master');
|
2014-05-27 07:17:58 +02:00
|
|
|
}
|
|
|
|
|
2020-08-21 08:17:21 +02:00
|
|
|
push(@conf_argv, '--targets=x86,x86_64');
|
2020-08-16 06:25:25 +02:00
|
|
|
push(@conf_argv, '--sdks=all');
|
2017-12-20 08:56:23 +01:00
|
|
|
|
2014-05-27 07:17:58 +02:00
|
|
|
my $conf_args = join(' ', @conf_argv);
|
|
|
|
|
2014-02-03 05:26:04 +01:00
|
|
|
if ($argn > 0 && $^O !~ /MSWin/) {
|
2021-07-12 07:34:14 +02:00
|
|
|
$result = `CC=$ARGV[0] CXX=$ARGV[1] python3 ../build/configure.py $conf_args`;
|
2014-02-03 05:26:04 +01:00
|
|
|
} else {
|
|
|
|
if ($^O =~ /MSWin/) {
|
2020-08-19 09:39:54 +02:00
|
|
|
$result = `C:\\Python38\\Python.exe ..\\build\\configure.py $conf_args`;
|
2009-08-30 09:21:42 +02:00
|
|
|
} else {
|
2021-07-12 07:34:14 +02:00
|
|
|
$result = `CC=clang CXX=clang python3 ../build/configure.py $conf_args`;
|
2009-08-30 09:21:42 +02:00
|
|
|
}
|
2008-09-06 11:12:21 +02:00
|
|
|
}
|
2014-02-03 05:26:04 +01:00
|
|
|
print "$result\n";
|
|
|
|
if ($? != 0) {
|
|
|
|
die("Could not configure: $!\n");
|
|
|
|
}
|
2008-09-06 11:12:21 +02:00
|
|
|
|
2009-08-30 09:21:42 +02:00
|
|
|
exit(0);
|