diff options
Diffstat (limited to 'Build-tools/Do-compile')
-rwxr-xr-x | Build-tools/Do-compile | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 03571593f77..cf466ef5848 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -7,16 +7,17 @@ use Sys::Hostname; @config_options= (); @make_options= (); -$opt_distribution=$opt_user=$opt_config_env=""; +$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_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_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; -$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_without_ndbcluster=0; +$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; GetOptions( "bdb", "build-thread=i", "config-env=s" => \@config_env, + "config-extra-env=s" => \@config_extra_env, "config-options=s" => \@config_options, "dbd-options=s", "debug", @@ -56,8 +57,7 @@ GetOptions( "with-other-libc=s", "with-small-disk", "without-embedded", - "clearlogs", - "without-ndbcluster", + "clearlogs", ) || usage(); usage() if ($opt_help); @@ -81,6 +81,12 @@ if (@config_env > 0) $opt_config_env= join(" ", @config_env); } +if (@config_extra_env > 0) +{ + chomp(@config_extra_env); + $opt_config_extra_env= join(" ", @config_extra_env); +} + $host= hostname(); chomp($uname=`uname`); $full_host_name=$host; @@ -91,6 +97,7 @@ $email="$opt_user\@mysql.com"; chomp($pwd = `pwd`); $VER= basename($opt_distribution); $VER=~ /mysql.*-([1-9]\.[0-9]{1,2}\.[0-9]{1,2}.*)\.tar*/; $version=$1; +$release=""; # Shut up perl ($major, $minor, $release) = split(/\./,$version); $log="$pwd/Logs/$host-$major.$minor$opt_version_suffix.log"; $opt_distribution =~ /(mysql[^\/]*)\.tar/; @@ -113,6 +120,8 @@ if (defined($gcc_version) && ! $opt_config_env) } } +$opt_config_env.=" $opt_config_extra_env"; + $new_opt_tmp=0; if ($opt_tmp) { @@ -139,6 +148,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"; @@ -156,6 +166,9 @@ select STDOUT; $|=1; info("Compiling MySQL$opt_version_suffix at $host$opt_suffix, stage: $opt_stage\n"); +info("LD_LIBRARY_PATH is $ENV{LD_LIBRARY_PATH}"); +info("PATH is $ENV{PATH}"); + log_timestamp(); if (-x "$host/bin/mysqladmin") @@ -237,9 +250,15 @@ if ($opt_stage <= 1) $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); - $opt_config_options.= " --with-readline" if ($opt_readline); + 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_config_options.= " --with-ndbcluster" if ($opt_with_cluster); # Only enable InnoDB when requested (required to be able to @@ -295,7 +314,7 @@ if ($opt_stage <= 3) } $flags.= " --no-strip" if ($opt_no_strip || $opt_with_debug); - $flags.= " --with-ndbcluster" if ($opt__with_ndbcluster); + $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") @@ -334,10 +353,12 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" . # if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) { + my $flags= ""; + $flags.= " --with-ndbcluster" if ($opt_with_cluster); log_timestamp(); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); safe_cd("${test_dir}/mysql-test"); - check_system("./mysql-test-run --warnings --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 --warnings --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"); } # @@ -448,16 +469,25 @@ exit 0; sub usage { print <<EOF; -$0 version 1.5 +$0 version 1.6 $0 takes the following options: --bdb Compile with support for Berkeley DB tables +--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> To add some extra options to configure (e.g. '--with-perl=yes') @@ -554,7 +584,7 @@ If user is empty then no mail is sent. Set name suffix (e.g. 'com' or '-max') for a distribution --with cluster -Compile with NDB Cluster +Compile and test with NDB Cluster enabled --with-debug Build binaries with debug information (implies "--no-strip") |