summaryrefslogtreecommitdiff
path: root/Build-tools/mysql-copyright
diff options
context:
space:
mode:
Diffstat (limited to 'Build-tools/mysql-copyright')
-rwxr-xr-xBuild-tools/mysql-copyright115
1 files changed, 74 insertions, 41 deletions
diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright
index 0c091890e72..dbb18e4e866 100755
--- a/Build-tools/mysql-copyright
+++ b/Build-tools/mysql-copyright
@@ -1,9 +1,9 @@
-#!/usr/bin/perl -i
+#!/usr/bin/perl -wi
# Untar a MySQL distribution, change the copyright texts,
# pack it up again to a given directory
-$VER="1.3";
+$VER="1.4";
use Cwd;
use File::Basename;
@@ -104,7 +104,7 @@ sub main
unlink("$destdir/COPYING", "$destdir/EXCEPTIONS-CLIENT");
copy("$WD/Docs/MySQLEULA.txt", "$destdir");
- # remove readline, bdb subdirs and update 'configure'
+ # remove subdirectories 'bdb', 'cmd-line-utils/readline'
my @extra_fat= ('bdb', 'cmd-line-utils/readline');
foreach my $fat (@extra_fat)
@@ -118,7 +118,10 @@ sub main
# fix LICENSE tag in include/mysql_version.h
&fix_mysql_version();
-
+
+ # apply "autotools" - must be last to ensure proper timestamps
+ &run_autotools();
+
# rename the directory with new distribution name
chdir("$WD/$dir");
print "renaming $destdir $newdistname\n" if $opt_verbose;
@@ -142,7 +145,7 @@ sub main
}
}
exit(0);
-}
+}
####
#### This function will s/GPL/Commercial/ in include/mysql_version.h for the
@@ -150,6 +153,7 @@ sub main
####
sub fix_mysql_version
{
+ my $cwd= getcwd();
chdir("$destdir");
my $header_file= (-f 'include/mysql_version.h.in')? 'include/mysql_version.h.in' : 'include/mysql_version.h';
@@ -170,44 +174,73 @@ sub fix_mysql_version
#### 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");
- 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);
- `aclocal && autoheader && aclocal && automake && autoconf`;
- die "'./configure' was not produced!" unless (-f "configure");
- chdir("$cwd");
- }
+ my $the_fat= shift;
+ my $cwd= getcwd();
+
+ chdir("$destdir");
+ if ( -d "${the_fat}" )
+ {
+ system("rm -rf ${the_fat}");
+ if (!$win_flag)
+ {
+ open(CONFIG_IN,"<configure.in") or die "Unable to open configure.in for read: $!\n";
+ undef $/;
+ my $config_in= <CONFIG_IN>;
+ close(CONFIG_IN);
+
+ #
+ # If $the_fat Makefile line closes the parenthesis, then
+ # replace that line with just the closing parenthesis.
+ #
+ if ($config_in=~ m|${the_fat}/Makefile\)\n?|)
+ {
+ $config_in=~ s|${the_fat}/Makefile(\)\n?)|$1|;
+ }
+ #
+ # Else just delete the line
+ #
+ else
+ {
+ $config_in=~ s|${the_fat}/Makefile dnl\n?||;
+ }
+
+ open(CONFIG_IN,">configure.in") or die "Unable to open configure.in for write: $!\n";
+ print CONFIG_IN $config_in;
+ close(CONFIG_IN);
+ }
+ }
+ chdir("$cwd");
+}
+
+
+####
+#### This function will run the autotools on the reduced source tree.
+####
+
+sub run_autotools
+{
+ my $cwd= getcwd();
+
+ if (!$win_flag)
+ {
+ chdir("$destdir");
+ unlink ("configure") or die "Can't delete $destdir/configure: $!\n";
+
+ # File "configure.in" has already been modified by "trim_the_fat()"
+
+ `aclocal && autoheader && aclocal && automake && autoconf`;
+ die "'./configure' was not produced!" unless (-f "configure");
+
+ if (-d "autom4te.cache") {
+ print "Trying to delete autom4te.cache dir\n" if $opt_verbose;
+ system("rm -rf autom4te.cache") or print "Unable to delete autom4te.cache dir: $!\n";
+ }
+
+ chdir("$cwd");
+ }
}