|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +if [ ! -f "sql/mysqld.cc" ]; then |
| 4 | + echo "You must run this script from the MySQL top-level directory." |
| 5 | + exit 1 |
| 6 | +fi |
| 7 | + |
| 8 | +cflags="-64 -mips4" |
| 9 | + |
| 10 | +if [ "$#" != 0 ]; then |
| 11 | + case "$1" in |
| 12 | + --help) |
| 13 | + echo "Usage: $0 [options]" |
| 14 | + echo "Options:" |
| 15 | + echo "--help print this message" |
| 16 | + echo "-32 build 32-bit binary" |
| 17 | + echo "-64 build 64-bit binary [default]" |
| 18 | + exit 0 |
| 19 | + ;; |
| 20 | + -64) |
| 21 | + echo "Building 64-bit binary" |
| 22 | + ;; |
| 23 | + -32) |
| 24 | + echo "Building 32-bit binary" |
| 25 | + cflags="" |
| 26 | + ;; |
| 27 | + *) |
| 28 | + echo "$0: invalid option '$1'; use --help to show usage" |
| 29 | + exit 1 |
| 30 | + ;; |
| 31 | + esac |
| 32 | +else |
| 33 | + echo "Building 64-bit binary" |
| 34 | +fi |
| 35 | + |
| 36 | +set -x |
| 37 | +make distclean |
| 38 | +aclocal |
| 39 | +autoheader |
| 40 | +libtoolize --automake --force |
| 41 | +automake --force --add-missing |
| 42 | +autoconf |
| 43 | + |
| 44 | +(cd bdb/dist && sh s_all) |
| 45 | +(cd innobase && aclocal && autoheader && aclocal && automake && autoconf) |
| 46 | + |
| 47 | +# C options: |
| 48 | +# -apo - auto-parallize for multiprocessors (implies -mp) |
| 49 | +# -mp - generate multiprocessor code |
| 50 | +# These two common optimization options apparently use 'sproc' model of |
| 51 | +# threading, which is not compatible with PTHREADS: don't add them unless you |
| 52 | +# know what you're doing. |
| 53 | +# |
| 54 | +# -c99 - enable C features standardized in C99, such as long long, |
| 55 | +# strtoll, stroull etc. |
| 56 | +# This option is vital to compile MySQL. |
| 57 | +# -woff - turn off some warnings |
| 58 | +# -64 - generate 64 bit object (implies -mips4) |
| 59 | +# -mips4 - produce code for MIPS R10000, MIPS R12000 and further 64 bit |
| 60 | +# processors |
| 61 | +# -OPT:Olimit=0 - no limits exists to size of function for compiler to optimize |
| 62 | +# it |
| 63 | +nowarn="-woff 1064,1188,1460,1552,1681,1682,3303" |
| 64 | +cflags="$cflags $nowarn -O3 -c99 -OPT:Olimit=0" |
| 65 | + |
| 66 | +# C++ only options: |
| 67 | +# -LANG:exceptions=OFF - don't generate exception handling code |
| 68 | +# MySQL doesn't use exceptions. |
| 69 | +# -LANG:std=OFF - don't link standard C++ library, such as |
| 70 | +# <iostream>, <complex>, etc. |
| 71 | +# -LANG:libc_in_namespace_std=OFF - libstdc functions can be |
| 72 | +# declared in namespace 'std', when included |
| 73 | +# into C++ code. Switch this feature off. |
| 74 | +# This option is vital to compile MySQL |
| 75 | + |
| 76 | +cxxflags="$cflags -LANG:exceptions=OFF -LANG:std=OFF" |
| 77 | +cxxflags="$cxxflags -LANG:libc_in_namespace_std=OFF" |
| 78 | + |
| 79 | +CC=cc CXX=CC CFLAGS="$cflags" CXXFLAGS="$cxxflags" \ |
| 80 | +./configure --prefix=/usr/local/mysql --disable-shared \ |
| 81 | + --with-extra-charsets=complex --enable-thread-safe-client \ |
| 82 | + --without-extra-tools --disable-dependency-tracking |
| 83 | + |
| 84 | +make |
0 commit comments