server/configure

27 lines
557 B
Plaintext
Raw Normal View History

#!/bin/sh
git submodule update --init
MACHINE=`uname -m`
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
[ -z "$JOBS" ] && JOBS=$(nproc)
2014-03-17 04:01:52 +01:00
BIN_DIR="build-$MACHINE-$CC-Debug"
DISTCC=`which distcc`
if [ ! -z "$DISTCC" ] ; then
JOBS=`distcc -j`
if [ -z "$JOBS" ] ; then
JOBS=1
elif [ $JOBS -gt 1 ] ; then
2014-03-17 04:01:52 +01:00
CC="$DISTCC $CC"
MAKEOPTS=-j$JOBS
fi
fi
echo "Building with $CC and $JOBS jobs"
mkdir -p $BIN_DIR
cd $BIN_DIR
CC="$CC" ../s/cmake-init
make -j$JOBS
make test