summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/make_binary_distribution.sh59
-rw-r--r--scripts/mysql_find_rows.sh2
-rw-r--r--scripts/mysql_fix_extensions.sh2
-rw-r--r--scripts/mysql_setpermission.sh2
-rw-r--r--scripts/mysql_zap.sh2
-rw-r--r--scripts/mysqlaccess.sh2
-rw-r--r--scripts/mysqld_multi.sh20
7 files changed, 78 insertions, 11 deletions
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 152225f86b1..bc54dc7062f 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -56,6 +56,12 @@ SOURCE=`pwd`
CP="cp -p"
MV="mv"
+# There are platforms, notably OS X on Intel (x86 + x86_64),
+# for which "uname" does not provide sufficient information.
+# The value of CFLAGS as used during compilation is the most exact info
+# we can get - after all, we care about _what_ we built, not _where_ we did it.
+cflags="@CFLAGS@"
+
STRIP=1 # Option ignored
SILENT=0
PLATFORM=""
@@ -104,7 +110,50 @@ if [ x"$PLATFORM" = x"" ] ; then
system=`echo $system | sed -e 's/linux-gnu/linux/g'`
system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'`
system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'`
+fi
+
+# Get the "machine", which really is the CPU architecture (including the size).
+# The precedence is:
+# 1) use an explicit argument, if given;
+# 2) use platform-specific fixes, if there are any (see bug#37808);
+# 3) stay with the default (determined during "configure", using predefined macros).
+
+if [ x"$MACHINE" != x"" ] ; then
+ machine=$MACHINE
+else
+ case $system in
+ osx* )
+ # Extract "XYZ" from CFLAGS "... -arch XYZ ...", or empty!
+ cflag_arch=`echo "$cflags" | sed -n -e 's=.* -arch \([^ ]*\) .*=\1=p'`
+ case "$cflag_arch" in
+ i386 ) case $system in
+ osx10.4 ) machine=i686 ;; # Used a different naming
+ * ) machine=x86 ;;
+ esac ;;
+ x86_64 ) machine=x86_64 ;;
+ ppc ) ;; # No treatment needed with PPC
+ ppc64 ) ;;
+ * ) # No matching compiler flag? "--platform" is needed
+ if [ x"$PLATFORM" != x"" ] ; then
+ : # See below: "$PLATFORM" will take precedence anyway
+ elif [ "$system" = "osx10.3" -a -z "$cflag_arch" ] ; then
+ : # Special case of OS X 10.3, which is PPC-32 only and doesn't use "-arch"
+ else
+ echo "On system '$system' only specific '-arch' values are expected."
+ echo "It is taken from the 'CFLAGS' whose value is:"
+ echo "$cflags"
+ echo "'-arch $cflag_arch' is unexpected, and no '--platform' was given: ABORT"
+ exit 1
+ fi ;;
+ esac # "$cflag_arch"
+ ;;
+ esac # $system
+fi
+# Combine OS and CPU to the "platform". Again, an explicit argument takes precedence.
+if [ x"$PLATFORM" != x"" ] ; then
+ :
+else
PLATFORM="$system-$machine"
fi
@@ -153,10 +202,10 @@ which_1 ()
do
for file in $d/$cmd
do
- if [ -x $file -a ! -d $file ] ; then
- echo $file
- exit 0
- fi
+ if [ -x $file -a ! -d $file ] ; then
+ echo $file
+ exit 0
+ fi
done
done
done
@@ -460,7 +509,7 @@ rm -f $BASE/support-files/magic \
$BASE/support-files/mysql-log-rotate \
$BASE/support-files/binary-configure \
$BASE/support-files/build-tags \
- $BASE/support-files/MySQL-shared-compat.spec \
+ $BASE/support-files/MySQL-shared-compat.spec \
$BASE/INSTALL-BINARY
# Clean up if we did this from a bk tree
diff --git a/scripts/mysql_find_rows.sh b/scripts/mysql_find_rows.sh
index 77eacc8a9b4..967a8196ebd 100644
--- a/scripts/mysql_find_rows.sh
+++ b/scripts/mysql_find_rows.sh
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
# Copyright (C) 2000, 2004 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
diff --git a/scripts/mysql_fix_extensions.sh b/scripts/mysql_fix_extensions.sh
index fbc72406f5e..6d4e017f678 100644
--- a/scripts/mysql_fix_extensions.sh
+++ b/scripts/mysql_fix_extensions.sh
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
# This is a utility for MySQL. It is not needed by any standard part
# of MySQL.
diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh
index b1ea26a9b7d..5fa6b969e39 100644
--- a/scripts/mysql_setpermission.sh
+++ b/scripts/mysql_setpermission.sh
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
## Emacs, this is -*- perl -*- mode? :-)
##
## Permission setter for MySQL
diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh
index 3bb92aaec2e..f78212e2578 100644
--- a/scripts/mysql_zap.sh
+++ b/scripts/mysql_zap.sh
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
# Copyright (C) 2000-2002, 2004 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh
index bcaf9f8af8e..0153a3afa7c 100644
--- a/scripts/mysqlaccess.sh
+++ b/scripts/mysqlaccess.sh
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
# ****************************
package MySQLaccess;
#use strict;
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index f35be69c151..430c74874eb 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use Getopt::Long;
-use POSIX qw(strftime);
+use POSIX qw(strftime getcwd);
$|=1;
$VER="2.16";
@@ -295,6 +295,7 @@ sub start_mysqlds()
{
@options = defaults_for_group($groups[$i]);
+ $basedir_found= 0; # The default
$mysqld_found= 1; # The default
$mysqld_found= 0 if (!length($mysqld));
$com= "$mysqld";
@@ -310,6 +311,14 @@ sub start_mysqlds()
$com= $options[$j];
$mysqld_found= 1;
}
+ elsif ("--basedir=" eq substr($options[$j], 0, 10))
+ {
+ $basedir= $options[$j];
+ $basedir =~ s/^--basedir=//;
+ $basedir_found= 1;
+ $options[$j]= quote_shell_word($options[$j]);
+ $tmp.= " $options[$j]";
+ }
else
{
$options[$j]= quote_shell_word($options[$j]);
@@ -337,7 +346,16 @@ sub start_mysqlds()
print "group [$groups[$i]] separately.\n";
exit(1);
}
+ if ($basedir_found)
+ {
+ $curdir=getcwd();
+ chdir($basedir) or die "Can't change to datadir $basedir";
+ }
system($com);
+ if ($basedir_found)
+ {
+ chdir($curdir) or die "Can't change back to original dir $curdir";
+ }
}
if (!$i && !$opt_no_log)
{