diff options
author | greg@mysql.com <> | 2004-02-19 19:04:47 -0100 |
---|---|---|
committer | greg@mysql.com <> | 2004-02-19 19:04:47 -0100 |
commit | 0786eb656ccbb0ed861c7983d53e47c5141918f9 (patch) | |
tree | 65592227dddccd6ef76970ff6c262886c812b0b3 /Build-tools/Do-win-build | |
parent | e1fee022fa10fc0cceafbd774441d70311e10434 (diff) | |
download | mariadb-git-0786eb656ccbb0ed861c7983d53e47c5141918f9.tar.gz |
Major work on Windows build automation-- add binary packaging, suffixes
Diffstat (limited to 'Build-tools/Do-win-build')
-rwxr-xr-x | Build-tools/Do-win-build | 67 |
1 files changed, 53 insertions, 14 deletions
diff --git a/Build-tools/Do-win-build b/Build-tools/Do-win-build index 0885507588c..a78b091a737 100755 --- a/Build-tools/Do-win-build +++ b/Build-tools/Do-win-build @@ -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); + + # 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; + } +} -system("tar -zxvf ../tarball/$mysqlver-win-src.tar.gz"); +# Perform compilation +system("\"$MSDEV\" mysql.dsw /MAKE \"ALL\" /OUT $mysqlver-build.log"); -chdir($mysqlver); +# Package binary +system("./scripts/make_win_binary_distribution --suffix=$opt_suffix"); -system("\"$MSDEV\" mysql.dsw /MAKE \"ALL\" /OUT $mysqlver-build.log"); +# Copy log back to script directory +system("cp $mysqlver$suffix-build.log $scriptdir"); -system("cp $mysqlver-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) |