]> mj.ucw.cz Git - libucw.git/blob - build/check-customs
Adjusted the checker.
[libucw.git] / build / check-customs
1 #!/bin/bash
2 # A script for testing compilability of different configurations
3 # (c) 2004 Martin Mares <mj@ucw.cz>
4
5 set -e
6
7 TEST=0
8
9 function try
10 {
11         TEST=$(($TEST+1))
12         echo "### Test $TEST: $@ ###"
13
14         CUST=$1
15         shift
16         SUBST=
17         APP="!!### Added by check-customs:"
18         while [ -n "$1" ] ; do
19                 X=$1
20                 Y=${X#!}
21                 if [ "$X" != "$Y" ] ; then
22                         SUBST="${S}/^$Y/s/^/# /;"
23                 else
24                         APP="$APP!$X"
25                 fi
26                 shift
27         done
28         rm -rf custom
29         mkdir custom custom/lib
30         cp $CUST/lib/custom.h custom/lib/
31         cp $CUST/Makefile custom/
32         sed "$SUBST;p;d" <$CUST/config.mk >custom/config.mk
33         echo $APP | tr ! '\n' >>custom/config.mk
34
35         make clean >test$TEST.log 2>&1
36         if ! make >>test$TEST.log 2>&1 ; then
37                 echo "  FAILED"
38                 exit 1
39         fi
40         echo "  PASSED"
41 }
42
43 if [ -e custom -a ! -e custom.old ] ; then
44         mv custom custom.old
45 fi
46
47 rm -f test*.log
48 try free                                                                        # the free version
49 try bare !CONFIG_INDEXER !CONFIG_SEARCH                                         # absolutely stripped version
50 try bare                                                                        # the bare version
51 try centrum !CONFIG_GATHERER !CONFIG_GATHERD !CONFIG_SHEPHERD !CONFIG_REAPD !CONFIG_INDEXER     # search servers
52 try centrum !CONFIG_GATHERER !CONFIG_GATHERD !CONFIG_SHEPHERD !CONFIG_REAPD     # indexing server
53 try centrum !CONFIG_GATHERD !CONFIG_SHEPHERD !CONFIG_INDEXER !CONFIG_SEARCH     # reapd server
54 try centrum                                                                     # full config
55
56 rm -rf custom
57 if [ -e custom.old ] ; then
58         mv custom.old custom
59 fi