Add tdb2 build
[amitay/build-farm.git] / generic.fns
1 per_run_hook
2
3 global_lock
4
5 system=`uname`
6
7 ENVCFLAGS=$CFLAGS
8 cur_compiler_sum=""
9 last_compiler_sum=""
10
11 if [ "x$compilers" = "x" ]; then
12         compilers="gcc cc icc"
13 fi
14
15 for compiler in $compilers; do
16
17   echo "working with compiler $compiler"
18   # arrgh, "which" gives no err code on solaris
19   path=`which $compiler`
20   if [ -x "$path" ]; then
21
22     # We do not want to build with the same compiler twice
23     # cc is a symlink to gcc on some systems
24     cur_compiler_sum="`sum $path | sed 's/ .*//'`"
25     test x"$cur_compiler_sum" = x"" && {
26        cur_compiler_sum="$path"
27     }
28     test x"$last_compiler_sum" = x"$cur_compiler_sum" && {
29        continue;
30     }
31     last_compiler_sum="$cur_compiler_sum"
32
33     if $compiler -v 2>&1 | grep gcc.version > /dev/null; then
34        isgcc=1
35        CFLAGS="$ENVCFLAGS -Wall -g"
36     else
37        isgcc=0
38        CFLAGS="$ENVCFLAGS -g"
39     fi
40
41     CFLAGS_THIS_COMPILER=`eval CFLAGS_$compiler 2>/dev/null`
42     if [ $? = 0 ] ; then
43         CFLAGS="$CFLAGS_THIS_COMPILER $CFLAGS"
44     fi
45     export CFLAGS
46
47     TDB_NO_FSYNC=1
48     export TDB_NO_FSYNC
49     test_tree samba_4_0_test . $compiler
50     TDB_NO_FSYNC=0
51     export TDB_NO_FSYNC
52
53     if [ $compiler = gcc -o $isgcc = 0 ]; then
54       . common.fns
55       test_tree lorikeet-heimdal . $compiler
56
57       # only attempt samba-gtk if we have perl and gtk+-2.0
58       if which perl > /dev/null && which pkg-config > /dev/null && pkg-config --exists gtk+-2.0; then
59         test_tree samba-gtk . $compiler
60       fi
61
62       TDB_NO_FSYNC=1
63       export TDB_NO_FSYNC
64       test_tree samba_3_current source3 $compiler
65       test_tree samba_3_next source3 $compiler
66       test_tree samba_3_master source3 $compiler
67       TDB_NO_FSYNC=0
68       export TDB_NO_FSYNC
69
70       # by default build ppp only on SunOS or Linux systems
71       if [ "$system" = Linux -o "$system" = SunOS ]; then
72          test_tree ppp . $compiler
73       fi
74     fi
75   fi
76 done
77
78 # only attempt pidl if we have perl
79 if which perl > /dev/null; then
80   test_tree pidl . cc
81 fi
82
83 global_unlock