summaryrefslogtreecommitdiff
path: root/Build-tools/Do-compile
diff options
context:
space:
mode:
Diffstat (limited to 'Build-tools/Do-compile')
-rwxr-xr-xBuild-tools/Do-compile46
1 files changed, 28 insertions, 18 deletions
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index 9b26a93d100..bd6c89d7ded 100755
--- a/Build-tools/Do-compile
+++ b/Build-tools/Do-compile
@@ -1,6 +1,8 @@
#!/usr/bin/perl -w
+use File::Basename;
use Getopt::Long;
+use Sys::Hostname;
@config_options= ();
@make_options= ();
@@ -8,7 +10,7 @@ use Getopt::Long;
$opt_distribution=$opt_user=$opt_config_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_debug=$opt_no_benchmark=$opt_no_mysqltest=0;
+$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_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=0;
$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=0;
GetOptions(
@@ -51,6 +53,7 @@ GetOptions(
"with-low-memory",
"with-other-libc=s",
"with-small-disk",
+ "without-embedded",
) || usage();
usage() if ($opt_help);
@@ -74,7 +77,7 @@ if (@config_env > 0)
$opt_config_env= join(" ", @config_env);
}
-chomp($host=`hostname`);
+$host= hostname();
chomp($uname=`uname`);
$full_host_name=$host;
$connect_option= ($opt_tcpip ? "--host=$host" : "");
@@ -82,7 +85,7 @@ $host =~ /^([^.-]*)/;
$host=$1 . $opt_suffix;
$email="$opt_user\@mysql.com";
chomp($pwd = `pwd`);
-$VER= `basename $opt_distribution`; chop $VER;
+$VER= basename($opt_distribution);
$VER=~ /mysql.*-([1-9]\.[0-9]{1,2}\.[0-9]{1,2}.*)\.tar*/; $version=$1;
($major, $minor, $release) = split(/\./,$version);
$log="$pwd/Logs/$host-$major.$minor$opt_version_suffix.log";
@@ -109,7 +112,7 @@ if (defined($gcc_version) && ! $opt_config_env)
$new_opt_tmp=0;
if ($opt_tmp)
{
- if (! -d $opt_tmp)
+ unless (-d $opt_tmp)
{
safe_system("mkdir $opt_tmp");
$new_opt_tmp=1;
@@ -132,7 +135,8 @@ $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;
-$mysqladmin_args="--no-defaults -u root";
+$manager_port=$mysql_tcp_port+1;
+$mysqladmin_args="--no-defaults -u root --connect_timeout=5 --shutdown_timeout=20";
if ($opt_stage == 0)
{
@@ -158,7 +162,7 @@ if (-x "$host/bin/mysqladmin")
log_system("$host/bin/mysqladmin $mysqladmin_args -P 9306 -h $host -s shutdown");
log_system("$host/bin/mysqladmin $mysqladmin_args -P 9307 -h $host -s shutdown");
}
-
+kill_all("mysqlmanager");
#
# Kill all old processes that are in the build directories
# This is to find any old mysqld servers left from previous builds
@@ -229,6 +233,7 @@ 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-embedded-server" unless ($opt_without_embedded);
# Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB)
@@ -247,7 +252,8 @@ if ($opt_stage <= 1)
$opt_config_options.= $opt_with_other_libc;
}
- check_system("$opt_config_env ./configure --prefix=/usr/local/mysql --with-comment=\"Official MySQL$opt_version_suffix binary\" --with-extra-charsets=complex --with-server-suffix=\"$opt_version_suffix\" --enable-thread-safe-client --enable-local-infile $opt_config_options","Thank you for choosing MySQL");
+ $prefix="/usr/local/mysql";
+ check_system("$opt_config_env ./configure --prefix=$prefix --localstatedir=$prefix/data --libexecdir=$prefix/bin --with-comment=\"Official MySQL$opt_version_suffix binary\" --with-extra-charsets=complex --with-server-suffix=\"$opt_version_suffix\" --enable-thread-safe-client --enable-local-infile $opt_config_options","Thank you for choosing MySQL");
if (-d "$pwd/$host/include-mysql")
{
safe_system("cp -r $pwd/$host/include-mysql/* $pwd/$host/$ver/include");
@@ -274,12 +280,16 @@ if ($opt_stage <= 3)
{
my $flags= "";
log_timestamp();
- log_system("rm -fr mysql-3* mysql-4* $pwd/$host/*.tar.gz");
- log_system("nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz | cat");
+ log_system("rm -fr mysql-{3,4,5}* $pwd/$host/mysql*.t*gz");
+ # No need to add the debug symbols, if the binaries are not stripped (saves space)
+ unless ($opt_with_debug || $opt_no_strip)
+ {
+ 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);
check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created");
- safe_system("mv mysql*.tar.gz $pwd/$host");
+ safe_system("mv mysql*.t*gz $pwd/$host");
if (-f "client/.libs/mysqladmin")
{
safe_system("cp client/.libs/mysqladmin $pwd/$host/bin");
@@ -291,11 +301,8 @@ if ($opt_stage <= 3)
safe_system("$make clean") if ($opt_with_small_disk);
}
-$tar_file=<$pwd/$host/*.tar.gz>;
-if (!defined($tar_file))
-{
- $tar_file=<$pwd/$host/*.tgz>;
-}
+$tar_file=<$pwd/$host/mysql*.t*gz>;
+abort ("Could not find tarball!") unless ($tar_file);
#
# Unpack the binary distribution
@@ -308,7 +315,7 @@ if ($opt_stage <= 4 && !$opt_no_test)
safe_system("gunzip < $tar_file | $tar xf -");
}
-$tar_file =~ /(mysql[^\/]*)\.tar/;
+$tar_file =~ /(mysql[^\/]*)\.(tar\.gz|tgz)/;
$ver=$1;
$test_dir="$pwd/$host/test/$ver";
$ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" .
@@ -322,7 +329,7 @@ if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
log_timestamp();
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
safe_cd("${test_dir}/mysql-test");
- check_system("./mysql-test-run --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --sleep=10", "tests were successful");
+ 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");
}
#
@@ -339,7 +346,7 @@ if (!$opt_no_test && !$opt_no_benchmark)
$extra="";
if ($opt_bdb)
{
- $extra.=" -O bdb_cache_size=16M";
+ $extra.=" --bdb_cache_size=16M --bdb_max_lock=60000"
}
if ($opt_innodb)
{
@@ -545,6 +552,9 @@ non-standard location overriding default.
--with-small-disk
Clean up the build environment before testing the binary distribution
(to save disk space)
+
+--without-embedded
+Don't compile the embedded server.
EOF
exit 1;
}