Initialize the test_root variable so that the output of the pwd
[amitay/build-farm.git] / m104.fns
1 # Build control file for Stratus VOS
2 # Contact: Paul.Green at stratus.com (paulg at samba.org)
3
4 export CC="gcc"
5 export CFLAGS=""
6 export CPPFLAGS="-D_POSIX_C_SOURCE=200112L -D_SYSV"
7 export MAXTIME=14400
8 export TIMELIMIT_FLAGS="-D_POSIX_C_SOURCE=200112L"
9 export noclean="yes"
10
11 # avoid vos bug bin-340
12 export LDFLAGS="-specs=/s/pg/bf/posix/command_library/pg.specs"
13
14 # avoid vos bug ac-79
15 export ac_cv_prog_cc_ccache_gcc_c_o=yes
16
17 # ensure vos pathnames do not contain % or # characters
18 # workaround until vos suggestion posix-1014 is implemented
19 test_root=/build_farm
20
21 ############################
22 # configure the tree
23 # VOS: modified to print message and invoke bash explicitly
24 action_configure() {
25         echo " "
26         echo "NOTE: VOS has some restrictions that cause build or test"
27         echo "      failures. I am working to resolve these."
28         echo "      1. VOS does not implement Unix-domain sockets."
29         echo "      2. VOS is missing some POSIX or Unix functions. I am"
30         echo "         supplying private versions to avoid build errors."
31         echo "      3. VOS implements the POSIX-style shared memory API,"
32         echo "         not the System V-style shared memory API."
33         echo "      4. VOS seems to have some bugs in POSIX file locking."
34         echo " "
35         echo "The following differences from standard POSIX systems are"
36         echo "essentially unfixable:"
37         echo "      5. VOS has symbolic links not hard links. link() is a dummy."
38         echo "      6. VOS has a 32-character limit on file names, and a 256-char"
39         echo "         limit on pathnames."
40         echo "      7. VOS does not implement shared libraries (no gcc -shared)."
41         echo " "
42         echo "Please contact Paul dot Green at stratus.com for further information."
43         echo " "
44         if [ ! -x configure ]; then
45             ls -l configure
46             ./autogen.sh
47         fi
48         echo "CPPFLAGS=$CPPFLAGS"
49         echo "CFLAGS=$CFLAGS"
50         echo configure options: $config_and_prefix
51         echo CC="$CCACHE $compiler" $srcdir/configure $config_and_prefix
52         CC="$CCACHE $compiler"
53         export CC
54 # VOS: explicitly invoke bash here.
55         ./timelimit $MAXTIME bash $srcdir/configure $config_and_prefix
56         cstatus=$?
57         echo "CONFIGURE STATUS: $cstatus"
58         if [ -f config.h ]; then
59             echo "contents of config.h:"
60             cat config.h
61         fi
62         if [ -f include/config.h ]; then
63             echo "contents of include/config.h:"
64             cat include/config.h
65         fi
66         return $cstatus;
67 }
68
69 ############################
70 # VOS: apply any pending patches.
71 apply_patches() {
72         tree=$1
73         if [ -f $tree.patch.txt ]; then
74                 cd $tree
75              echo "Patching $tree with local changes."
76                 ../patch -u -b -p 2 -i ../$tree.patch.txt
77                 cd ..
78         fi
79 }
80
81 ############################
82 # VOS: fake up df command, since VOS doesn't have it.
83 function df {
84         display_disk_info;
85 }
86
87 ############################
88 # fetch the latest copy of the tree
89 # VOS: apply local patches to the tree, skip files w/long names.
90 fetch_tree() {
91         if [ "$norsync" = "yes" ]; then
92                 echo "skipping tree transfer"
93         else
94                 fetchtree=$1
95                 if rsync --exclude=autom4te.cache/ --exclude=.svn/ --delete-excluded -q --partial --timeout=200 -crlpz --delete --ignore-errors --exclude=granig* --exclude=lisa--* --exclude=distccmon-gnome* \
96                         samba.org::ftp/unpacked/$fetchtree/ $test_root/$fetchtree; then
97                         echo "transferred $fetchtree OK"
98                 else
99                         echo "transfer of $fetchtree failed code $?"
100                         return 1
101                 fi
102         fi
103         apply_patches "$fetchtree"
104         return 0
105 }
106
107 ############################
108 # VOS: fake up mount command, since VOS doesn't have it.
109 mount() {
110      return 0;
111 }
112
113 ############################
114 # VOS: fake up ulimit command, since VOS doesn't have it.
115 ulimit() {
116      return 0;
117 }
118
119 ############################
120 # VOS: fake up vmstat command, since VOS doesn't have it.
121 vmstat() {
122      return 0;
123 }
124
125 per_run_hook
126
127 . common.fns
128
129 test_tree samba_3_0 source gcc
130 #Skip Samba4 until we shorten file names
131 #test_tree samba4 source gcc