summaryrefslogtreecommitdiff
path: root/BUILD/compile-dist
blob: 3b02629b8c1e1027132856ae092bc5605783aa6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
#
# This script's purpose is to update the automake/autoconf helper scripts and
# to run a plain "configure" without any special compile flags. Only features
# that affect the content of the source distribution are enabled. The resulting
# tree can then be picked up by "make dist" to create the "pristine source
# package" that is used as the basis for all other binary builds.
#
test -f Makefile && make maintainer-clean

path=`dirname $0`
. $path/autorun.sh

gmake=
for x in gmake gnumake make; do
  if $x --version 2>/dev/null | grep GNU > /dev/null; then
    gmake=$x
    break;
  fi
done

if [ -z "$gmake" ]; then
  # Our build may not depend on GNU make, but I wouldn't count on it
  echo "Please install GNU make, and ensure it is in your path as gnumake, gmake, or make" >&2
  exit 2
fi

# Default to gcc for CC and CXX
if test -z "$CXX" ; then
  export CXX
  CXX=g++
  # Set some required compile options
  if test -z "$CXXFLAGS" ; then
    export CXXFLAGS
    CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
  fi
fi

if test -z "$CC" ; then
  export CC
  CC=gcc
fi


# Use ccache, if available
if ccache -V > /dev/null 2>&1
then
  if echo "$CC" | grep -v ccache > /dev/null
  then
    export CC
    CC="ccache $CC"
  fi
  if echo "$CXX" | grep -v ccache > /dev/null
  then
    export CXX
    CXX="ccache $CXX"
  fi
fi

# Make sure to enable all features that affect "make dist"
# Remember that configure restricts the man pages to the configured features !
./configure \
  --with-plugins=max-no-ndb \
  --with-embedded-server
$gmake -j4