From: Martin Mares Date: Sun, 27 Jun 2004 15:37:43 +0000 (+0000) Subject: Added a script for testing compilability of different feature sets. X-Git-Tag: holmes-import~1001 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c06102fc01007ad6e543a05817cd99f6a96f7629;p=libucw.git Added a script for testing compilability of different feature sets. --- diff --git a/build/check-customs b/build/check-customs new file mode 100755 index 00000000..0d5ed237 --- /dev/null +++ b/build/check-customs @@ -0,0 +1,58 @@ +#!/bin/bash +# A script for testing compilability of different configurations +# (c) 2004 Martin Mares + +set -e + +TEST=0 + +function try +{ + TEST=$(($TEST+1)) + echo "### Test $TEST: $@ ###" + + CUST=$1 + shift + SUBST= + APP="!!### Added by check-customs:" + while [ -n "$1" ] ; do + X=$1 + Y=${X#!} + if [ "$X" != "$Y" ] ; then + SUBST="${S}/^$Y/s/^/# /;" + else + APP="$APP!$X" + fi + shift + done + rm -rf custom + mkdir custom custom/lib + cp $CUST/lib/custom.h custom/lib/ + cp $CUST/Makefile custom/ + sed "$SUBST;p;d" <$CUST/config.mk >custom/config.mk + echo $APP | tr ! '\n' >>custom/config.mk + + make clean >test$TEST.log 2>&1 + if ! make >>test$TEST.log 2>&1 ; then + echo " FAILED" + exit 1 + fi + echo " PASSED" +} + +if [ -e custom -a ! -e custom.old ] ; then + mv custom custom.old +fi + +rm -f test*.log +try free # the free version +try bare !CONFIG_INDEXER !CONFIG_SEARCH # absolutely stripped version +try bare # the bare version +try centrum !CONFIG_GATHERD !CONFIG_GATHERER !CONFIG_REAPD !CONFIG_INDEXER # search servers +try centrum !CONFIG_GATHERD !CONFIG_GATHERER !CONFIG_REAPD # indexing server +try centrum !CONFIG_GATHERD # gathering server + +rm -rf custom +if [ -e custom.old ] ; then + mv custom.old custom +fi