2011-09-22 22:16:29 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-08-13 23:48:39 +00:00
|
|
|
MAKE_JOBS=8
|
2013-05-02 21:49:58 +00:00
|
|
|
[ -z "${PREFIX}" ] && PREFIX=/usr
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
-h)
|
|
|
|
echo "Usage: sys/build.sh [/usr]"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
'')
|
|
|
|
:
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
PREFIX="$1"
|
|
|
|
;;
|
|
|
|
esac
|
2012-08-27 15:02:58 +00:00
|
|
|
|
|
|
|
[ ! "${PREFIX}" = /usr ] && \
|
|
|
|
CFGARG=--with-rpath
|
2012-08-10 09:35:38 +00:00
|
|
|
|
2011-07-02 21:15:40 +00:00
|
|
|
MAKE=make
|
|
|
|
gmake --help >/dev/null 2>&1
|
|
|
|
[ $? = 0 ] && MAKE=gmake
|
|
|
|
|
2011-09-22 22:16:29 +00:00
|
|
|
# find root
|
|
|
|
cd `dirname $PWD/$0` ; cd ..
|
|
|
|
|
|
|
|
ccache --help > /dev/null 2>&1
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
[ -z "${CC}" ] && CC=gcc
|
|
|
|
CC="ccache ${CC}"
|
|
|
|
export CC
|
|
|
|
fi
|
|
|
|
|
|
|
|
# build
|
2012-08-10 09:35:38 +00:00
|
|
|
${MAKE} mrproper > /dev/null 2>&1
|
|
|
|
[ "`uname`" = Linux ] && export LDFLAGS="-Wl,--as-needed"
|
2012-08-14 23:32:02 +00:00
|
|
|
rm -f plugins.cfg
|
2012-08-27 15:02:58 +00:00
|
|
|
./configure ${CFGARG} --prefix=${PREFIX} || exit 1
|
2012-08-14 13:44:17 +00:00
|
|
|
exec ${MAKE} -s -j ${MAKE_JOBS}
|