Debian Codegraph @

BUILD/compile-dist

raw
1 #!/bin/sh
2 # Copyright (c) 2004-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
3 # Use is subject to license terms.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
17
18 #
19 # This script's purpose is to update the automake/autoconf helper scripts and
20 # to run a plain "configure" without any special compile flags. Only features
21 # that affect the content of the source distribution are enabled. The resulting
22 # tree can then be picked up by "make dist" to create the "pristine source
23 # package" that is used as the basis for all other binary builds.
24 #
25 test -f Makefile && make maintainer-clean
26
27 path=`dirname $0`
28 . $path/autorun.sh
29
30 gmake=
31 for x in gmake gnumake make; do
32 if $x --version 2>/dev/null | grep GNU > /dev/null; then
33 gmake=$x
34 break;
35 fi
36 done
37
38 if [ -z "$gmake" ]; then
39 # Our build may not depend on GNU make, but I wouldn't count on it
40 echo "Please install GNU make, and ensure it is in your path as gnumake, gmake, or make" >&2
41 exit 2
42 fi
43
44 # Default to gcc for CC and CXX
45 if test -z "$CXX" ; then
46 export CXX
47 CXX=g++
48 # Set some required compile options
49 if test -z "$CXXFLAGS" ; then
50 export CXXFLAGS
51 CXXFLAGS="-felide-constructors -fno-exceptions"
52 fi
53 fi
54
55 if test -z "$CC" ; then
56 export CC
57 CC=gcc
58 fi
59
60
61 # Use ccache, if available
62 if ccache -V > /dev/null 2>&1
63 then
64 if echo "$CC" | grep -v ccache > /dev/null
65 then
66 export CC
67 CC="ccache $CC"
68 fi
69 if echo "$CXX" | grep -v ccache > /dev/null
70 then
71 export CXX
72 CXX="ccache $CXX"
73 fi
74 fi
75
76 # Make sure to enable all features that affect "make dist"
77 # Remember that configure restricts the man pages to the configured features !
78 ./configure \
79 --with-embedded-server \
80 --with-perfschema \
81 --with-plugins=max
82 $gmake -j4