diff options
Diffstat (limited to 'Build-tools')
-rwxr-xr-x | Build-tools/Do-compile | 119 | ||||
-rwxr-xr-x | Build-tools/Do-pkg | 35 |
2 files changed, 123 insertions, 31 deletions
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index af03f3209aa..c640a1c1bb7 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -10,12 +10,13 @@ use Sys::Hostname; $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; -$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=0; -$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_without_ndbcluster=0; +$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; +$opt_skip_embedded_test=$opt_skip_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_with_federated=0; GetOptions( "bdb", "build-thread=i", + "bundled-zlib", "config-env=s" => \@config_env, "config-extra-env=s" => \@config_extra_env, "config-options=s" => \@config_options, @@ -40,6 +41,9 @@ GetOptions( "perl-files=s", "perl-options=s", "raid", + "readline", + "skip-embedded-test", + "skip-ps-test", "stage=i", "static-client", "static-perl", @@ -51,13 +55,17 @@ GetOptions( "use-old-distribution", "user=s", "version-suffix=s", + "with-archive", + "with-cluster", + "with-csv", "with-debug", + "with-example", + "with-federated", "with-low-memory", "with-other-libc=s", "with-small-disk", "without-embedded", - "clearlogs", - "without-ndbcluster", + "clearlogs", ) || usage(); usage() if ($opt_help); @@ -148,6 +156,7 @@ $ENV{'MYSQL_TCP_PORT'}= $mysql_tcp_port= 3334 + $opt_build_thread*2; $ENV{'MYSQL_UNIX_PORT'}=$mysql_unix_port="$opt_tmp/mysql$opt_suffix.build"; $ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl"; $slave_port=$mysql_tcp_port+16; +$ndbcluster_port= 9350 + $opt_build_thread*2; $manager_port=$mysql_tcp_port+1; $mysqladmin_args="--no-defaults -u root --connect_timeout=5 --shutdown_timeout=20"; @@ -254,14 +263,28 @@ if ($opt_stage <= 1) log_system("$make clean") if ($opt_use_old_distribution); $opt_config_options.= " --disable-shared" if (!$opt_enable_shared); # Default for binary versions $opt_config_options.= " --with-berkeley-db" if ($opt_bdb); + $opt_config_options.= " --with-zlib-dir=bundled" if ($opt_bundled_zlib); $opt_config_options.= " --with-client-ldflags=-all-static" if ($opt_static_client); $opt_config_options.= " --with-debug" if ($opt_with_debug); $opt_config_options.= " --with-libwrap" if ($opt_libwrap); $opt_config_options.= " --with-low-memory" if ($opt_with_low_memory); $opt_config_options.= " --with-mysqld-ldflags=-all-static" if ($opt_static_server); $opt_config_options.= " --with-raid" if ($opt_raid); + if ($opt_readline) + { + $opt_config_options.= " --with-readline"; + } + else + { + $opt_config_options.= " --with-libedit"; + } $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); - $opt_config_options.= " --without-ndbcluster" if ($opt_without_ndbcluster); + $opt_skip_embedded_test= 1 if ($opt_without_embedded); + $opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive); + $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); + $opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv); + $opt_config_options.= " --with-example-storage-engine" if ($opt_with_example); + $opt_config_options.= " --with-federated-storage-engine" if ($opt_with_federated); # Only enable InnoDB when requested (required to be able to # build the "Classic" packages that do not include InnoDB) @@ -316,7 +339,8 @@ if ($opt_stage <= 3) log_system("nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz | cat"); } - $flags.= "--no-strip" if ($opt_no_strip || $opt_with_debug); + $flags.= " --no-strip" if ($opt_no_strip || $opt_with_debug); + $flags.= " --with-ndbcluster" if ($opt_with_cluster); check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created"); safe_system("mv mysql*.t*gz $pwd/$host"); if (-f "client/.libs/mysqladmin") @@ -360,15 +384,30 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" . # if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) { - my $force= ""; - if (!$opt_one_error) - { - $force= "--force"; # default - } + my $flags= ""; + $flags.= " --with-ndbcluster" if ($opt_with_cluster); + $flags.= " --force" if (!$opt_one_error); log_timestamp(); + info("Running test suite"); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); safe_cd("${test_dir}/mysql-test"); - check_system("./mysql-test-run $force --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + + unless ($opt_skip_ps_test) + { + log_timestamp(); + info("Running test suite using prepared statements"); + check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + } + + unless ($opt_skip_embedded_test) + { + log_timestamp(); + info("Running embedded server test suite"); + # Embedded server and NDB don't jive + $flags=~ s/ --with-ndbcluster//; + check_system("./mysql-test-run $flags --embedded-server --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + } # 'mysql-test-run' writes its own final message for log evaluation. } @@ -386,7 +425,7 @@ if (!$opt_no_test && !$opt_no_benchmark) $extra=""; if ($opt_bdb) { - $extra.=" --bdb_cache_size=16M --bdb_max_lock=60000" + $extra.=" --bdb_cache_size=16M --bdb_max_lock=240000" } if ($opt_innodb) { @@ -487,14 +526,19 @@ $0 takes the following options: --bdb Compile with support for Berkeley DB tables ---config-env <environment for configure> +--build-thread=<1,2,3...> +When running several Do-compile runs in parallel, each build +should have its own thread ID, so running the test suites +does not cause conflicts with duplicate TCP port numbers. + +--config-env=<environment for configure> To set up the environment, like 'CC=cc CXX=gcc CXXFLAGS=-O3' --config-extra-env <environment for configure> Additional flags for environment (not CC or CXX). Should be used when one wants Do-compile to propose proper CC and CXX flags. ---config-options <options> +--config-options=<options> To add some extra options to configure (e.g. '--with-perl=yes') --dbd-options <options> @@ -506,7 +550,7 @@ Print all shell commands on stdout. --delete Delete the distribution file. ---distribution <distribution_file> +--distribution=<distribution_file> Name of the MySQL source distribution file. --enable-shared @@ -527,7 +571,7 @@ Compile with TCP wrapper support --local-perl Install Perl modules locally ---make-options <options> +--make-options=<options> Options to make after configure. (Like 'CXXLD=gcc') --no-crash-me @@ -548,16 +592,28 @@ Do not run the mysql-test-run test (Same as 'make test') --one-error Terminate the mysql-test-run test after the first difference (default: use '--force') ---perl-files=list of files +--no-perl +Do not compile or install Perl modules, use the system installed ones + +--perl-files=<list of files> Compile and install the given perl modules. ---perl-options <options> +--perl-options=<options> Build Perl modules with the additional options --raid Compile with RAID support ---stage (1-6) +--readline +Compile against readline library instead of libedit + +--skip-embedded-test +Skip running the test suite against the embedded server + +--skip-ps-test +Skip running the additional test run that uses the prepared statement protocol + +--stage=[1-6] Start script from some specific point. --static-client @@ -572,27 +628,42 @@ Build statically linked server binary --tcpip Connect to the server to be tested via TCP/IP instead of socket ---tmp <directory> +--tmp=<directory> Use a different temporary directory than /tmp --use-old-distribution Do not clean up the build environment and extract a fresh source distribution, use an existing one instead. ---user <user_name> +--user=<user_name> Mail 'user_name'\@mysql.com if something went wrong. If user is empty then no mail is sent. ---version-suffix suffix +--version-suffix=suffix Set name suffix (e.g. 'com' or '-max') for a distribution +--with-archive +Enable the Archive storage engine + +--with-cluster +Compile and test with NDB Cluster enabled + +--with-csv +Enable the CSV storage engine + +--with-example +Enable the Example storage engine + +--with-federated +Enable the Federated storage engine + --with-debug Build binaries with debug information (implies "--no-strip") --with-low-memory Use less memory when compiling. ---with-other-libc <path to libc> +--with-other-libc=<path to libc> Link against libc and other standard libraries installed in the specified non-standard location overriding default. diff --git a/Build-tools/Do-pkg b/Build-tools/Do-pkg index 2fd1946ed0e..38c1c47e2f3 100755 --- a/Build-tools/Do-pkg +++ b/Build-tools/Do-pkg @@ -31,6 +31,7 @@ $opt_help= undef; $opt_log= undef; $opt_mail= ""; $opt_skip_dmg= undef; +$opt_skip_prefpane= undef; $opt_skip_si= undef; $opt_suffix= undef; $opt_verbose= undef; @@ -41,6 +42,7 @@ GetOptions( "help|h", "log|l:s", "mail|m=s", + "skip-prefpane|p", "skip-dmg|skip-disk-image|s", "skip-si|skip-startup-item", "suffix=s", @@ -82,6 +84,7 @@ $HOST=~ /^([^.-]*)/; $HOST= $1; $LOGFILE= "$PWD/Logs/$HOST-$MAJOR.$MINOR$SUFFIX.log"; $BUILDDIR= "$PWD/$HOST"; +$PREFPANE= "$PWD/mysql-administrator/source/mac/PreferencePane/build/MySQL.prefPane"; $SRCBASEDIR= <$BUILDDIR/mysql*-$VERSION>; $SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>; $TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc.tar.gz>; @@ -95,7 +98,8 @@ $SI_DESC= <$SUPFILEDIR/StartupItem.Description.plist>; $SI_PARAMS= <$SUPFILEDIR/StartupParameters.plist>; $SI_POST= <$SUPFILEDIR/StartupItem.postinstall>; $SI_NAME= "MySQLStartupItem"; -$SI_SCRIPT= <$SUPFILEDIR/MySQL>; +$SI_DIR_NAME= "MySQLCOM"; +$SI_SCRIPT= <$SUPFILEDIR/MySQLCOM>; @RESOURCES= qw/ ReadMe.txt postinstall preinstall /; @LICENSES= ("$SRCBASEDIR/COPYING","$SRCBASEDIR/MySQLEULA.txt"); @@ -195,16 +199,18 @@ unless ($opt_skip_si) &logger("Cleaning up $RESOURCE_DIR"); &run_command("rm -rf $RESOURCE_DIR/*", "Unable to clean up $RESOURCE_DIR!"); - &logger("Installing MySQL StartupItem files into $PKGROOT/MySQL"); + my $SI_DIR= $PKGROOT . "/" . $SI_DIR_NAME; + &logger("Installing MySQL StartupItem files into $SI_DIR"); unless($opt_dry_run) { - mkdir("$PKGROOT/MySQL") or &abort("Error creating $PKGROOT/MySQL"); - copy("$SI_SCRIPT", "$PKGROOT/MySQL/") + mkdir("$SI_DIR") + or &abort("Error creating $SI_DIR"); + copy("$SI_SCRIPT", "$SI_DIR/") or &abort("Error copying $SI_SCRIPT!"); - chmod(0755, "$PKGROOT/MySQL/" . basename("$SI_SCRIPT")); - copy("$SI_PARAMS", "$PKGROOT/MySQL/") + chmod(0755, "$SI_DIR/" . basename("$SI_SCRIPT")); + copy("$SI_PARAMS", "$SI_DIR/") or &abort("Error copying $SI_PARAMS!"); - chmod(0644, "$PKGROOT/MySQL/" . basename("$SI_PARAMS")); + chmod(0644, "$SI_DIR/" . basename("$SI_PARAMS")); &run_command("chown -R root:wheel $PKGROOT/*", "Cannot chown $PKGROOT!"); copy("$SI_POST", "$RESOURCE_DIR/postinstall") or &abort("Error copying $SI_POST!"); @@ -216,6 +222,19 @@ unless ($opt_skip_si) &run_command($command, "Error while building package $SI_NAME.pkg!"); } +# +# Include the MySQL Preference Pane +# +unless ($opt_skip_prefpane) +{ + &abort("Could not find PrefPane helper application. Did you compile and install it?") + unless (-f "$PREFPANE/Contents/Resources/mahelper"); + &logger("Including $PREFPANE in $PKGDEST"); + &run_command("mkdir $PKGDEST/MySQL.prefPane", "Could not create $PKGDEST/MySQL.prefPane!"); + &run_command("ditto $PREFPANE $PKGDEST/MySQL.prefPane", "Could not copy $PREFPANE into $PKGDEST!"); + &run_command("chown -R root:wheel $PKGDEST/MySQL.prefPane", "Cannot chown $PKGDEST/MySQL.prefPane!"); +} + if ($opt_skip_dmg) { &logger("SUCCESS: Package $PKGDEST/$NAME.pkg created"); @@ -251,6 +270,7 @@ chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f3 -d" "`) if (!$opt_d &logger("Copying $PKGDEST/$NAME.pkg to Disk image /Volumes/$NAME"); &run_command("ditto $PKGDEST /Volumes/$NAME", "Could not copy $PKGDEST to /Volumes/$NAME!"); &run_command("ditto $SUPFILEDIR/ReadMe.txt /Volumes/$NAME", "Could not copy $SPFILEDIR/ReadMe.txt to /Volumes/$NAME!"); +&run_command("chown root:wheel /Volumes/$NAME/ReadMe.txt", "Could not fix ownerships of /Volumes/$NAME/ReadMe.txt!"); chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f1 -d" "`) if (!$opt_dry_run); &abort("/Volumes/$NAME not attached!") if (!$mountpoint && !$opt_dry_run); &logger("Unmounting $mountpoint"); @@ -299,6 +319,7 @@ Options: if logging is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com +-p, --skip-prefpane Skip including the PreferencePane -s, --skip-disk-image, --skip-dmg Just build the PKGs, don't put it into a disk image afterwards --skip-startup-item, --skip-si Skip the creation of the StartupItem PKG |