sm-ext-dhooks2/buildbot/bootstrap.pl

81 lines
2.5 KiB
Perl
Raw Normal View History

2013-09-01 17:11:38 +02:00
#!/usr/bin/perl
# vim: set ts=2 sw=2 tw=99 noet:
use strict;
use Cwd;
use File::Basename;
use File::Path;
my ($myself, $path) = fileparse($0);
chdir($path);
require 'helpers.pm';
#Go back above build dir
chdir(Build::PathFormat('../..'));
#Get the source path.
our ($root) = getcwd();
rmtree('OUTPUT');
mkdir('OUTPUT') or die("Failed to create output folder: $!\n");
chdir('OUTPUT');
my ($result);
print "Attempting to reconfigure...\n";
#update and configure shiz
if ($^O eq "linux") {
#my @sdks = ('sourcemod-1.3', 'mmsource-1.8', 'hl2sdk', 'hl2sdk-ob', 'hl2sdk-ob-valve', 'hl2sdk-l4d', 'hl2sdk-l4d2');
#my ($sdk);
#foreach $sdk (@sdks) {
# print "Updating checkout of ", $sdk, " on ", $^O, "\n";
# $result = `hg pull -u /home/builds/common/$sdk`;
# print $result;
#}
$ENV{'SOURCEMOD14'} = '/home/builds/common/sourcemod-1.4';
2013-09-01 19:28:56 +02:00
$ENV{'SMCENTRAL'} = '/home/builds/common/sourcemod-central';
2013-09-01 17:11:38 +02:00
$ENV{'MMSOURCE19'} = '/home/builds/common/mmsource-1.9';
$ENV{'HL2SDK'} = '/home/builds/common/hl2sdk';
$ENV{'HL2SDKOB'} = '/home/builds/common/hl2sdk-ob';
$ENV{'HL2SDKOBVALVE'} = '/home/builds/common/hl2sdk-ob-valve';
$ENV{'HL2SDKL4D'} = '/home/builds/common/hl2sdk-l4d';
$ENV{'HL2SDKL4D2'} = '/home/builds/common/hl2sdk-l4d2';
$ENV{'HL2SDKCSGO'} = '/home/builds/common/hl2sdk-csgo';
} elsif ($^O eq "darwin") {
#my @sdks = ('sourcemod-1.3', 'mmsource-1.8', 'hl2sdk-ob-valve');
#my ($sdk);
#foreach $sdk (@sdks) {
# print "Updating checkout of ", $sdk, " on ", $^O, "\n";
# $result = `hg pull -u /Users/builds/slaves/common/$sdk`;
# print $result;
#}
$ENV{'SOURCEMOD14'} = '/Users/builds/slaves/common/sourcemod-1.4';
2013-09-01 19:28:56 +02:00
$ENV{'SMCENTRAL'} = '/Users/builds/slaves/common/sourcemod-central';
2013-09-01 17:11:38 +02:00
$ENV{'MMSOURCE18'} = '/Users/builds/slaves/common/mmsource-1.8';
$ENV{'MMSOURCE19'} = '/Users/builds/slaves/common/mmsource-central';
$ENV{'HL2SDKOBVALVE'} = '/Users/builds/slaves/common/hl2sdk-ob-valve';
$ENV{'HL2SDKCSS'} = '/Users/builds/slaves/common/hl2sdk-css';
} else {
#JUST IN CASE
#$ENV{'MMSOURCE19'} = "C:\\Scripts\\common\\mmsource-1.9";
#$ENV{'HL2SDKCSGO'} = "C:\\Scripts\\common\\hl2sdk-csgo";
}
# Windows vars should already be set.
#configure AMBuild
if ($^O eq "linux") {
2013-09-01 19:02:53 +02:00
$result = `CC=gcc CXX=gcc python3 ../build/configure.py --enable-optimize`;
2013-09-01 17:11:38 +02:00
} elsif ($^O eq "darwin") {
2013-09-01 19:02:53 +02:00
$result = `CC=clang CXX=clang python3 ../build/configure.py --enable-optimize`;
2013-09-01 17:11:38 +02:00
} else {
2013-09-01 19:02:53 +02:00
$result = `C:\\Python31\\Python.exe ..\\build\\configure.py --enable-optimize`;
2013-09-01 17:11:38 +02:00
}
print "$result\n";
if ($? != 0) {
die('Could not configure!');
}