mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Major work on Windows build automation-- add binary packaging, suffixes
This commit is contained in:
@ -3,12 +3,13 @@
|
||||
use Getopt::Long;
|
||||
|
||||
$opt_help=0;
|
||||
$opt_tarball=$opt_builddir="";
|
||||
$opt_tarball=$opt_builddir=$opt_suffix="";
|
||||
|
||||
GetOptions(
|
||||
"help",
|
||||
"tarball=s",
|
||||
"builddir=s",
|
||||
"tarball=s",
|
||||
"builddir=s",
|
||||
"suffix=s"
|
||||
) || print_help();
|
||||
|
||||
print_help() if ($opt_help);
|
||||
@ -28,27 +29,54 @@ $scriptdir = `pwd`;
|
||||
mkdir($opt_builddir);
|
||||
# Clean out any previous build
|
||||
system("rm -rf $basedir");
|
||||
mkdir($basedir);
|
||||
mkdir("$basedir/tarball");
|
||||
|
||||
system("cp $opt_tarball $basedir/tarball");
|
||||
# Unpack in the script directory
|
||||
system("tar -zxvf $opt_tarball");
|
||||
# Move to the build directory
|
||||
system("mv $mysqlver $opt_builddir");
|
||||
|
||||
if (!chdir($basedir))
|
||||
{
|
||||
print "Do-win-build error: Could not change to $opt_builddir";
|
||||
print "Do-win-build error: Could not change to $basedir";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
mkdir("build");
|
||||
chdir("build");
|
||||
# Check whether this is a classic edition build
|
||||
if ($opt_suffix =~ /-classic/)
|
||||
{
|
||||
# Blank out ha_innodb.cpp
|
||||
chmod 0644, 'sql/ha_innodb.cpp';
|
||||
open(OUT, '>', 'sql/ha_innodb.cpp');
|
||||
close(OUT);
|
||||
|
||||
system("tar -zxvf ../tarball/$mysqlver-win-src.tar.gz");
|
||||
|
||||
chdir($mysqlver);
|
||||
# Remove HAVE_INNOBASE_DB from the requisite project files
|
||||
for $dspfile ('libmysqld/libmysqld.dsp', 'mysqldemb/mysqldemb.dsp', 'mysqlserver/mysqlserver.dsp', 'sql/mysqld.dsp', 'sql/mysqldmax.dsp')
|
||||
{
|
||||
open(IN, '<', $dspfile);
|
||||
open(OUT, '>', "$dspfile.tmp");
|
||||
while (readline IN)
|
||||
{
|
||||
s/\D \"HAVE_INNOBASE_DB\" //g;
|
||||
print OUT $_;
|
||||
}
|
||||
close(IN);
|
||||
close(OUT);
|
||||
unlink $dspfile;
|
||||
rename "$dspfile.tmp", $dspfile;
|
||||
}
|
||||
}
|
||||
|
||||
# Perform compilation
|
||||
system("\"$MSDEV\" mysql.dsw /MAKE \"ALL\" /OUT $mysqlver-build.log");
|
||||
|
||||
system("cp $mysqlver-build.log $scriptdir");
|
||||
# Package binary
|
||||
system("./scripts/make_win_binary_distribution --suffix=$opt_suffix");
|
||||
|
||||
# Copy log back to script directory
|
||||
system("cp $mysqlver$suffix-build.log $scriptdir");
|
||||
|
||||
# Move binary package to script directory
|
||||
system("mv *.zip $scriptdir");
|
||||
|
||||
#
|
||||
# Print a help text message
|
||||
@ -62,7 +90,11 @@ Unpacks a Windows source distribution on the local machine and
|
||||
compiles it using VC++ 6.0.
|
||||
|
||||
This script is intended for Cygwin Perl. You must have a working
|
||||
MSDEV.EXE in your path for compilation.
|
||||
MSDEV.EXE in your path for compilation, as well as the following:
|
||||
|
||||
sed
|
||||
tar (GNU tar)
|
||||
which
|
||||
|
||||
|
||||
Options:
|
||||
@ -76,6 +108,13 @@ be moved to <builddir>/mysql-<version>/tarball and extracted under
|
||||
<builddir>/mysql-<version>/build.
|
||||
Default: /cygdrive/c/mysql-win-build
|
||||
|
||||
--suffix=<suffix>
|
||||
If specified, the resulting binary will have the specified suffix
|
||||
in its name. If the suffix is "-classic", the project files will
|
||||
be stripped of all occurrences of HAVE_INNOBASE_DB and
|
||||
ha_innodb.cpp will be blanked out, to create classic edition
|
||||
server binaries.
|
||||
|
||||
--tarball=<file>
|
||||
Windows source tarball to use for this build. Must be of the form
|
||||
mysql[com]-x.x.x-win-src.tar.gz (REQUIRED)
|
||||
|
Reference in New Issue
Block a user