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