#!/usr/bin/perl -w use Getopt::Long; $opt_help=0; $opt_tarball=$opt_builddir=""; GetOptions( "help", "tarball=s", "builddir=s", ) || print_help(); print_help() if ($opt_help); chomp($MSDEV=`which msdev`); if (!$opt_builddir) { $opt_builddir = "/cygdrive/c/mysql-win-build"; } $opt_tarball =~ /(mysql[^\/]*)-win-src\.tar/; $mysqlver=$1; $basedir = "$opt_builddir/$mysqlver"; # Make sure build dir exists mkdir($opt_builddir); # Clean out any previous build system("rm -rf $basedir"); mkdir($basedir); mkdir("$basedir/tarball"); system("cp $opt_tarball $basedir/tarball"); if (!chdir($basedir)) { print "Do-win-build error: Could not change to $opt_builddir"; exit 1; } mkdir("build"); chdir("build"); system("tar -zxvf ../tarball/$mysqlver-win-src.tar.gz"); chdir($mysqlver); system("\"$MSDEV\" mysql.dsw /MAKE \"ALL\" /OUT $mysqlver-build.log"); # # Print a help text message # sub print_help { print < Set the Cygwin path to build under; the tarball will actually be moved to /mysql-/tarball and extracted under /mysql-/build. Default: /cygdrive/c/mysql-win-build --tarball= Windows source tarball to use for this build. Must be of the form mysql[com]-x.x.x-win-src.tar.gz (REQUIRED) EOF exit 1; }