Switch bootstrap.pl and startbuild.pl to AMBuild.
Former-commit-id: 462765c926139c44a1c2922e0281b4653fad783a
This commit is contained in:
parent
f0f319a418
commit
426771deda
|
@ -12,54 +12,44 @@ require 'helpers.pm';
|
||||||
#Go to main source dir
|
#Go to main source dir
|
||||||
chdir(Build::PathFormat('../..'));
|
chdir(Build::PathFormat('../..'));
|
||||||
|
|
||||||
#Do the annoying revision bumping.
|
#Get the source path.
|
||||||
#Linux needs some help here.
|
our ($root) = getcwd();
|
||||||
if ($^O eq "linux" || $^O eq "darwin")
|
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub IsNewer
|
||||||
{
|
{
|
||||||
Build::Command("flip -u modules.versions");
|
my ($file, $time) = (@_);
|
||||||
Build::Command("flip -u support/versionchanger.pl");
|
|
||||||
Build::Command("chmod +x support/versionchanger.pl");
|
|
||||||
}
|
|
||||||
Build::Command(Build::PathFormat('support/versionchanger.pl') . ' --buildstring="-dev"');
|
|
||||||
#Build::Command(Build::PathFormat('support/versionchanger.pl'));
|
|
||||||
|
|
||||||
my $DEVENV = "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe";
|
my @s = stat($file);
|
||||||
|
my $mtime = $s[9];
|
||||||
|
return $mtime > $time;
|
||||||
|
}
|
||||||
|
|
||||||
#Build the amxmodx builder tool.
|
exit(0);
|
||||||
chdir('installer/builder');
|
|
||||||
if ($^O eq "linux" || $^O eq "darwin") {
|
|
||||||
Build::Command("make");
|
|
||||||
} else {
|
|
||||||
Build::Command("\"$DEVENV\" builder.csproj /p:Configuration=Release /t:Rebuild");
|
|
||||||
}
|
|
||||||
if (!(-f 'builder.exe')) {
|
|
||||||
die "Could not find build tool.\n";
|
|
||||||
}
|
|
||||||
chdir('../..');
|
|
||||||
|
|
||||||
if (-d '../OUTPUT') {
|
|
||||||
Build::Delete(Cwd::abs_path('../OUTPUT'));
|
|
||||||
}
|
|
||||||
Build::Command("mkdir " . Build::PathFormat('../OUTPUT'));
|
|
||||||
|
|
||||||
#Output directions on how to build.
|
|
||||||
open(DIRECTIONS, '>installer/builder/directions.info');
|
|
||||||
if ($^O eq "linux") {
|
|
||||||
print DIRECTIONS "compress = /bin/tar\n";
|
|
||||||
} elsif ($^O eq "darwin") {
|
|
||||||
print DIRECTIONS "compress = /usr/bin/zip\n";
|
|
||||||
} else {
|
|
||||||
print DIRECTIONS "compress = C:\\WINDOWS\\zip.exe\n";
|
|
||||||
}
|
|
||||||
print DIRECTIONS "source = " . Cwd::abs_path('.') . "\n";
|
|
||||||
print DIRECTIONS "makeopts = \n";
|
|
||||||
print DIRECTIONS "output = " . Cwd::abs_path('../OUTPUT') . "\n";
|
|
||||||
if ($^O eq "linux" || $^O eq "darwin") {
|
|
||||||
print DIRECTIONS "devenv = /usr/bin/make\n";
|
|
||||||
} else {
|
|
||||||
print DIRECTIONS "devenv = $DEVENV\n";
|
|
||||||
}
|
|
||||||
print DIRECTIONS "release = amxmodx-" . Build::ProductVersion('product.version') .
|
|
||||||
"-hg" . Build::HgRevNum('.') . "\n";
|
|
||||||
close(DIRECTIONS);
|
|
||||||
|
|
||||||
|
|
|
@ -7,19 +7,22 @@ chdir($path);
|
||||||
|
|
||||||
require 'helpers.pm';
|
require 'helpers.pm';
|
||||||
|
|
||||||
chdir('../../installer/builder');
|
chdir('../../OUTPUT');
|
||||||
|
|
||||||
my $output;
|
my $argn = $#ARGV + 1;
|
||||||
if ($^O eq "linux" || $^O eq "darwin") {
|
if ($argn > 0) {
|
||||||
$output = `mono builder.exe directions.info`;
|
$ENV{CC} = $ARGV[0];
|
||||||
} else {
|
$ENV{CXX} = $ARGV[0];
|
||||||
$output = `builder.exe directions.info`;
|
|
||||||
}
|
}
|
||||||
print $output . "\n";
|
|
||||||
|
|
||||||
if (!($output =~ /Build succeeded/)) {
|
system("ambuild --no-color 2>&1");
|
||||||
die "Build failed!\n";
|
|
||||||
} else {
|
if ($? != 0)
|
||||||
|
{
|
||||||
|
die "Build failed: $!\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user