2008-09-06 09:39:10 +02:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
2008-09-06 10:35:27 +02:00
|
|
|
use strict;
|
|
|
|
use Cwd;
|
|
|
|
use File::Basename;
|
|
|
|
|
|
|
|
my ($myself, $path) = fileparse($0);
|
|
|
|
chdir($path);
|
|
|
|
|
2008-09-06 10:19:05 +02:00
|
|
|
require 'helpers.pm';
|
2008-09-06 09:39:10 +02:00
|
|
|
|
2008-09-06 10:19:05 +02:00
|
|
|
chdir(Build::PathFormat('../builder'));
|
2008-09-06 09:39:10 +02:00
|
|
|
if ($^O eq "linux")
|
|
|
|
{
|
|
|
|
Build::Command('make clean');
|
|
|
|
Build::Command('make');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-09-28 01:19:56 +02:00
|
|
|
Build::Command('"' . $ENV{'VC9BUILDER'} . '" /rebuild builder.csproj Release');
|
2008-09-06 09:39:10 +02:00
|
|
|
Build::Command('move ' . Build::PathFormat('bin/Release/builder.exe') . ' .');
|
|
|
|
}
|
|
|
|
|
|
|
|
die "Unable to build builder tool!\n" unless -e 'builder.exe';
|
|
|
|
|
2008-09-06 11:12:21 +02:00
|
|
|
#Go back to main source dir.
|
|
|
|
chdir(Build::PathFormat('../..'));
|
|
|
|
|
|
|
|
#Get the source path.
|
2009-01-12 06:36:36 +01:00
|
|
|
our ($root) = getcwd();
|
2008-09-06 11:12:21 +02:00
|
|
|
|
|
|
|
#Create output folder if it doesn't exist.
|
|
|
|
if (!(-d 'OUTPUT')) {
|
|
|
|
mkdir('OUTPUT') or die("Failed to create output folder: $!\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
#Write the configuration file.
|
|
|
|
open(CONF, '>build.cfg') or die("Failed to write build.cfg: $!\n");
|
|
|
|
print CONF "OutputBase = " . Build::PathFormat($root . '/OUTPUT') . "\n";
|
|
|
|
print CONF "SourceBase = $root\n";
|
|
|
|
if ($^O eq "linux")
|
|
|
|
{
|
|
|
|
print CONF "BuilderPath = /usr/bin/make\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-09-28 01:19:56 +02:00
|
|
|
print CONF "BuilderPath = " . $ENV{'VC9BUILDER'} . "\n";
|
2008-09-07 01:24:56 +02:00
|
|
|
print CONF "PDBLog = $root\\OUTPUT\\pdblog.txt\n";
|
2008-09-06 11:12:21 +02:00
|
|
|
}
|
|
|
|
close(CONF);
|
|
|
|
|
|
|
|
#Do the annoying revision bumping.
|
|
|
|
#Linux needs some help here.
|
|
|
|
if ($^O eq "linux")
|
|
|
|
{
|
|
|
|
Build::Command("flip -u modules.versions");
|
|
|
|
Build::Command("flip -u tools/versionchanger.pl");
|
|
|
|
Build::Command("chmod +x tools/versionchanger.pl");
|
|
|
|
}
|
2008-09-14 08:13:25 +02:00
|
|
|
Build::Command(Build::PathFormat('tools/versionchanger.pl') . ' --buildstring="-dev"');
|
2009-01-12 06:36:36 +01:00
|
|
|
|
|
|
|
#Bootstrap extensions that have complex dependencies
|
|
|
|
|
|
|
|
if ($^O eq "linux")
|
|
|
|
{
|
|
|
|
BuildLibCurl_Linux();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BuildLibCurl_Win32();
|
|
|
|
}
|
|
|
|
|
|
|
|
sub BuildLibCurl_Win32
|
|
|
|
{
|
|
|
|
chdir("extensions\\curl\\curl-src\\lib");
|
2009-01-12 07:15:29 +01:00
|
|
|
Build::Command('"' . $ENV{'VC9BUILDER'} . '" /rebuild build_libcurl.vcproj "LIB Release"');
|
2009-01-12 06:36:36 +01:00
|
|
|
die "Unable to find libcurl.lib!\n" unless (-f "LIB-Release\\libcurl.lib");
|
|
|
|
chdir("..\\..\\..\\..");
|
|
|
|
}
|
|
|
|
|
|
|
|
sub BuildLibCurl_Linux
|
|
|
|
{
|
|
|
|
chdir("extensions/curl/curl-src");
|
|
|
|
Build::Command("mkdir -p Release");
|
|
|
|
Build::Command("chmod +x configure");
|
|
|
|
chdir("Release");
|
|
|
|
Build::Command("../configure --enable-static --disable-shared --disable-ldap --without-ssl --without-zlib");
|
|
|
|
Build::Command("make");
|
|
|
|
die "Unable to find libcurl.a!\n" unless (-f "lib/.libs/libcurl.a");
|
|
|
|
chdir("../../../..");
|
|
|
|
}
|