Add host_id.
[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 for compiler in gcc cc icc; do
11
12   # arrgh, "which" gives no err code on solaris
13   path=`which $compiler`
14   if [ -x "$path" ]; then
15
16     # We do not want to build with the same compiler twice
17     # cc is a symlink to gcc on some systems
18     cur_compiler_sum="`sum $path`"
19     test x"$cur_compiler_sum" = x"" && {
20        cur_compiler_sum="$path"
21     }
22     test x"$last_compiler_sum" = x"$cur_compiler_sum" && {
23        continue;
24     }
25     last_compiler_sum="$cur_compiler_sum"
26
27     if $compiler -v 2>&1 | grep gcc.version > /dev/null; then
28        isgcc=1
29        CFLAGS="$ENVCFLAGS -Wall"
30     else
31        isgcc=0
32        CFLAGS="$ENVCFLAGS"
33     fi
34     CFLAGS_THIS_COMPILER=`eval CFLAGS_$compiler 2>/dev/null`
35     if [ $? = 0 ] ; then
36             CFLAGS="$CFLAGS_THIS_COMPILER $CFLAGS"
37     fi
38     export CFLAGS
39         TDB_NO_FSYNC=1
40         export TDB_NO_FSYNC
41     test_tree samba_4_0_test source4 $compiler
42         TDB_NO_FSYNC=0
43         export TDB_NO_FSYNC
44     if [ $compiler = gcc -o $isgcc = 0 ]; then
45       . common.fns
46       test_tree lorikeet-heimdal . $compiler
47
48       # only attempt samba-gtk if we have perl and gtk+-2.0
49       if which perl > /dev/null && which pkg-config > /dev/null && pkg-config --exists gtk+-2.0; then
50         test_tree samba-gtk . $compiler
51       fi
52
53       test_tree samba_3_current source $compiler
54       test_tree samba_3_next source $compiler
55       test_tree samba_3_master source $compiler
56
57       # by default build ppp only on SunOS or Linux systems
58       if [ "$system" = Linux -o "$system" = SunOS ]; then
59          test_tree ppp . $compiler
60       fi
61     fi
62   fi
63 done
64
65 # only attempt pidl if we have perl
66 if which perl > /dev/null; then
67   test_tree pidl . cc
68 fi
69
70 global_unlock