summaryrefslogtreecommitdiff
path: root/Build-tools
diff options
context:
space:
mode:
Diffstat (limited to 'Build-tools')
-rwxr-xr-xBuild-tools/Do-compile67
-rwxr-xr-xBuild-tools/Do-pkg17
-rwxr-xr-xBuild-tools/mysql-copyright81
3 files changed, 116 insertions, 49 deletions
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index 1650e3d4a09..c17995f5779 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_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_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=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,
@@ -39,6 +40,7 @@ GetOptions(
"perl-files=s",
"perl-options=s",
"raid",
+ "readline",
"stage=i",
"static-client",
"static-perl",
@@ -50,13 +52,13 @@ GetOptions(
"use-old-distribution",
"user=s",
"version-suffix=s",
+ "with-cluster",
"with-debug",
"with-low-memory",
"with-other-libc=s",
"with-small-disk",
"without-embedded",
- "clearlogs",
- "without-ndbcluster",
+ "clearlogs",
) || usage();
usage() if ($opt_help);
@@ -147,6 +149,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";
@@ -253,14 +256,23 @@ 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_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
# Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB)
@@ -314,7 +326,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")
@@ -358,10 +371,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");
}
#
@@ -378,7 +393,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)
{
@@ -479,14 +494,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>
@@ -498,7 +518,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
@@ -519,7 +539,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
@@ -537,16 +557,22 @@ Do not run the benchmark test (written in perl)
--no-mysqltest
Do not run the the mysql-test-run test (Same as 'make test')
---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
+
+--stage=[1-6]
Start script from some specific point.
--static-client
@@ -561,27 +587,30 @@ 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 cluster
+Compile and test with NDB Cluster enabled
+
--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..b9df444a4ba 100755
--- a/Build-tools/Do-pkg
+++ b/Build-tools/Do-pkg
@@ -95,7 +95,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 +196,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!");
diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright
index 84e13d6041e..16f0738dc76 100755
--- a/Build-tools/mysql-copyright
+++ b/Build-tools/mysql-copyright
@@ -79,7 +79,7 @@ sub main
$newdistname .= $suffix if $win_flag;
}
# find out the extract path (should be same as distname!)
- chomp($destdir = `tar ztf ../$distfile | head -1`);
+ chomp($destdir= `tar ztf ../$distfile | head -1`);
# remove slash from the end
$destdir= substr($destdir, 0, -1);
@@ -103,28 +103,13 @@ sub main
unlink("$destdir/PUBLIC", "$destdir/README");
unlink("$destdir/COPYING", "$destdir/EXCEPTIONS-CLIENT");
copy("$WD/Docs/MySQLEULA.txt", "$destdir");
-
- # remove readline subdir and update configure accordingly
- system("rm -rf $destdir/cmd-line-utils/readline");
- if ($win_flag) {
- chdir("$destdir") or (print "$! Unable to change directory to $destdir!\n" && exit(0));
- } else {
- chdir("$destdir");
- unlink ("configure") or die "Can't delete $destdir/configure: $!\n";
- open(CONFIGURE,"<configure.in") or die "$! Unable to open configure.in to read from!\n";
- local $/;
- undef $/;
- my $configure = <CONFIGURE>;
- close(CONFIGURE);
- $configure =~ s|cmd\-line\-utils/readline/Makefile dnl\n?||g;
- open(CONFIGURE,">configure.in") or die "$! Unable to open configure.in to write to!\n";
- print CONFIGURE $configure;
- close(CONFIGURE);
- `autoconf`;
- if (! -f "configure") {
- print "\"./configure\" was not produced, exiting!\n";
- exit(0);
- }
+
+ # remove readline, bdb subdirs and update 'configure'
+ my @extra_fat= ('bdb', 'cmd-line-utils/readline');
+
+ foreach my $fat (@extra_fat)
+ {
+ &trim_the_fat($fat);
}
# fix file copyrights
@@ -157,6 +142,55 @@ sub main
}
####
+#### This function will remove unwanted parts of a src tree for the mysqlcom
+#### distributions.
+####
+sub trim_the_fat
+{
+ my $the_fat= shift;
+ my $cwd= getcwd();
+
+ system("rm -rf $destdir/${the_fat}");
+ if ($win_flag)
+ {
+ chdir("$destdir") or die "Unable to change directory to $destdir!: $!\n";
+ }
+ else
+ {
+ chdir("$destdir");
+ unlink ("configure") or die "Can't delete $destdir/configure: $!\n";
+ open(CONFIGURE,"<configure.in") or die "Unable to open configure.in for read: $!\n";
+ undef $/;
+ my $configure= <CONFIGURE>;
+ close(CONFIGURE);
+
+ #
+ # If $the_fat Makefile line closes the parenthesis, then
+ # replace that line with just the closing parenthesis.
+ #
+ if ($configure=~ m|${the_fat}/Makefile\)\n?|)
+ {
+ $configure=~ s|${the_fat}/Makefile(\)\n?)|$1|;
+ }
+ #
+ # Else just delete the line
+ #
+ else
+ {
+ $configure=~ s|${the_fat}/Makefile dnl\n?||;
+ }
+
+ open(CONFIGURE,">configure.in") or die "Unable to open configure.in for write: $!\n";
+ print CONFIGURE $configure;
+ close(CONFIGURE);
+ `autoconf`;
+ die "'./configure' was not produced!" unless (-f "configure");
+ chdir("$cwd");
+ }
+}
+
+
+####
#### mysqld and MySQL client programs have a usage printed with --help.
#### This usage includes a copyright, which needs to be modified
####
@@ -187,6 +221,7 @@ sub add_copyright
foreach my $file (@files)
{
next if ! -f $file;
+ next if -B $file;
print "processing file $file in cwd $cwd\n" if $opt_verbose;
`$WD/Build-tools/mysql-copyright-2 "$file"`;
}