compile-dist 1.52 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.
#
9
test -f Makefile && make maintainer-clean
unknown's avatar
unknown committed
10 11 12

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

14 15 16 17 18 19 20 21 22 23 24 25 26 27
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

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

if test -z "$CC" ; then
40
  export CC
41
  CC=gcc
42 43
fi

44

45 46 47
# Use ccache, if available
if ccache -V > /dev/null 2>&1
then
48
  if echo "$CC" | grep -v ccache > /dev/null
49
  then
50
    export CC
51
    CC="ccache $CC"
52
  fi
53
  if echo "$CXX" | grep -v ccache > /dev/null
54
  then
55
    export CXX
56
    CXX="ccache $CXX"
57 58 59 60
  fi
fi

# Make sure to enable all features that affect "make dist"
61
# Remember that configure restricts the man pages to the configured features !
62
./configure \
63
  --with-embedded-server \
unknown's avatar
unknown committed
64
  --with-ndbcluster
65
$gmake
66