TEMP disable %check
[libvirt/apevec.git] / autobuild.sh
blob4eda788a54b01c3785cd118e64130160e347c44c
1 #!/bin/sh
3 set -e
4 set -v
6 # Make things clean.
8 test -n "$1" && RESULTS=$1 || RESULTS=results.log
9 : ${AUTOBUILD_INSTALL_ROOT=$HOME/builder}
11 test -f Makefile && make -k distclean || :
12 rm -rf coverage
14 #rm -rf build
15 #mkdir build
16 #cd build
18 ./autogen.sh --prefix="$AUTOBUILD_INSTALL_ROOT" \
19 --enable-test-coverage \
20 --enable-compile-warnings=error \
21 --with-xen-proxy
23 # If the MAKEFLAGS envvar does not yet include a -j option,
24 # add -jN where N depends on the number of processors.
25 case $MAKEFLAGS in
26 *-j*) ;;
27 *) n=$(getconf _NPROCESSORS_ONLN 2> /dev/null)
28 test "$n" -gt 0 || n=1
29 n=$(expr $n + 1)
30 MAKEFLAGS="$MAKEFLAGS -j$n"
31 export MAKEFLAGS
33 esac
35 make
36 make install
38 # set -o pipefail is a bashism; this use of exec is the POSIX alternative
39 exec 3>&1
40 st=$(
41 exec 4>&1 >&3
42 { make check syntax-check 2>&1; echo $? >&4; } | tee "$RESULTS"
44 exec 3>&-
45 test $st = 0
46 test -x /usr/bin/lcov && make cov
48 rm -f *.tar.gz
49 make dist
51 if [ -n "$AUTOBUILD_COUNTER" ]; then
52 EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
53 else
54 NOW=`date +"%s"`
55 EXTRA_RELEASE=".$USER$NOW"
58 if [ -f /usr/bin/rpmbuild ]; then
59 rpmbuild --nodeps \
60 --define "extra_release $EXTRA_RELEASE" \
61 --define "_sourcedir `pwd`" \
62 -ba --clean libvirt.spec
65 if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then
66 make distclean
68 PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig" \
69 CC="i686-pc-mingw32-gcc" \
70 ./configure \
71 --build=$(uname -m)-pc-linux \
72 --host=i686-pc-mingw32 \
73 --prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \
74 --enable-compile-warnings=error \
75 --without-sasl \
76 --without-avahi \
77 --without-polkit \
78 --without-python \
79 --without-xen \
80 --without-qemu \
81 --without-lxc \
82 --without-uml \
83 --without-vbox \
84 --without-openvz \
85 --without-one \
86 --without-phyp \
87 --without-netcf \
88 --without-audit \
89 --without-dtrace \
90 --without-libvirtd
92 make
93 make install
95 #set -o pipefail
96 #make check 2>&1 | tee "$RESULTS"
98 if [ -f /usr/bin/rpmbuild ]; then
99 rpmbuild --nodeps \
100 --define "extra_release $EXTRA_RELEASE" \
101 --define "_sourcedir `pwd`" \
102 -ba --clean mingw32-libvirt.spec