summaryrefslogtreecommitdiff
path: root/scripts/make_binary_distribution.sh
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2009-08-12 15:44:34 +0200
committerGuilhem Bichot <guilhem@mysql.com>2009-08-12 15:44:34 +0200
commit8d1fdf09bb39663e8aad2a01f7ece81924e1f5a1 (patch)
tree5fdae14ec96fd61b574fe1c8b2d62d304114c53c /scripts/make_binary_distribution.sh
parenta39de6353abfb787723a61479fb20a942622a160 (diff)
parentcea2f8b6303b07906ab710b36c0c292a7865f52f (diff)
downloadmariadb-git-8d1fdf09bb39663e8aad2a01f7ece81924e1f5a1.tar.gz
merge of 5.1-main into mysql-trunk.
Changes to ha_innodb.cc are not propagated to plugin, they will come back via Oracle/Innobase if needed.
Diffstat (limited to 'scripts/make_binary_distribution.sh')
-rw-r--r--scripts/make_binary_distribution.sh59
1 files changed, 54 insertions, 5 deletions
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index feff3a9bc16..bf22267cf42 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
@@ -459,7 +508,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