compile-dist 1.7 KB
Newer Older
1 2 3 4 5 6 7 8
#!/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.
#
unknown's avatar
unknown committed
9
test -f Makefile && make distclean
10 11 12 13 14 15 16 17
aclocal
autoheader
libtoolize --automake --force --copy
automake --force --add-missing --copy
autoconf
(cd bdb/dist && sh s_all)
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)

18 19 20 21 22 23 24 25 26 27 28 29 30 31
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

32 33
# Default to gcc for CC and CXX
if test -z "$CXX" ; then
34 35
  export CXX
  CXX=gcc
36 37
  # Set some required compile options
  if test -z "$CXXFLAGS" ; then
38 39
    export CXXFLAGS
    CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
40
  fi
41 42 43
fi

if test -z "$CC" ; then
44 45
  export CC
  CC=gcc
46 47
fi

48

49 50 51
# Use ccache, if available
if ccache -V > /dev/null 2>&1
then
52
  if echo "$CC" | grep -v ccache > /dev/null
53
  then
54 55
    export CC
    CC="ccache $CC"
56
  fi
57
  if echo "$CXX" | grep -v ccache > /dev/null
58
  then
59 60
    export CXX
    CXX="ccache $CXX"
61 62 63 64 65 66 67 68
  fi
fi

# Make sure to enable all features that affect "make dist"
./configure \
  --with-embedded-server \
  --with-berkeley-db \
  --with-innodb \
69
  --enable-thread-safe-client \
70
  --with-extra-charsets=complex \
71
  --with-ndbcluster
72 73

$gmake