Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 114 lines (91 sloc) 2.589 kb
4f2fcbd @berrange Added autobuild control file
berrange authored
1 #!/bin/sh
2
3 set -e
26ceeb4 @berrange Added code coverage testing enabled via --enable-test-coverage
berrange authored
4 set -v
4f2fcbd @berrange Added autobuild control file
berrange authored
5
6 # Make things clean.
7
7e0da18 autobuild.sh: Fix minor shell-quoting bugs.
Jim Meyering authored
8 test -n "$1" && RESULTS=$1 || RESULTS=results.log
94f7144 autobuild.sh: provide default prefix
Eric Blake authored
9 : ${AUTOBUILD_INSTALL_ROOT=$HOME/builder}
4f2fcbd @berrange Added autobuild control file
berrange authored
10
11 test -f Makefile && make -k distclean || :
26ceeb4 @berrange Added code coverage testing enabled via --enable-test-coverage
berrange authored
12 rm -rf coverage
4f2fcbd @berrange Added autobuild control file
berrange authored
13
ec28eb2 autobuild.sh: use VPATH build
Eric Blake authored
14 rm -rf build
15 mkdir build
16 cd build
4f2fcbd @berrange Added autobuild control file
berrange authored
17
daa8c96 build: let autobuild check more code
Eric Blake authored
18 # Run with options not normally exercised by the rpm build, for
19 # more complete code coverage.
ec28eb2 autobuild.sh: use VPATH build
Eric Blake authored
20 ../autogen.sh --prefix="$AUTOBUILD_INSTALL_ROOT" \
dc8c775 @berrange Make compiler warnings fatal errors for automated builds
berrange authored
21 --enable-test-coverage \
daa8c96 build: let autobuild check more code
Eric Blake authored
22 --disable-nls \
851117b @berrange Enable all warnings permanently & default to -Werror for GIT builds
berrange authored
23 --enable-werror
4f2fcbd @berrange Added autobuild control file
berrange authored
24
ff7ecc1 improve parallel build support
Jim Meyering authored
25 # If the MAKEFLAGS envvar does not yet include a -j option,
26 # add -jN where N depends on the number of processors.
27 case $MAKEFLAGS in
28 *-j*) ;;
29 *) n=$(getconf _NPROCESSORS_ONLN 2> /dev/null)
30 test "$n" -gt 0 || n=1
31 n=$(expr $n + 1)
32 MAKEFLAGS="$MAKEFLAGS -j$n"
33 export MAKEFLAGS
34 ;;
35 esac
36
4f2fcbd @berrange Added autobuild control file
berrange authored
37 make
38 make install
39
fc6d5b2 autobuild.sh: avoid bashism
Eric Blake authored
40 # set -o pipefail is a bashism; this use of exec is the POSIX alternative
41 exec 3>&1
42 st=$(
43 exec 4>&1 >&3
7aaf4e6 test: fix commandtest under autobuild.sh
Eric Blake authored
44 { make check syntax-check 2>&1 3>&- 4>&-; echo $? >&4; } | tee "$RESULTS"
fc6d5b2 autobuild.sh: avoid bashism
Eric Blake authored
45 )
46 exec 3>&-
38afe8f build: fix autobuild failures on gcov upgrade
Eric Blake authored
47 test "$st" = 0
f855e91 @berrange Only run coverage tests if lcov is installed
berrange authored
48 test -x /usr/bin/lcov && make cov
4f2fcbd @berrange Added autobuild control file
berrange authored
49
50 rm -f *.tar.gz
51 make dist
52
6a714d3 @berrange Switch automated builds to use Mingw64 toolchain instead of Mingw32
berrange authored
53 if test -n "$AUTOBUILD_COUNTER" ; then
0ae2631 @rwmjones Updated MinGW spec file.
rwmjones authored
54 EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
55 else
56 NOW=`date +"%s"`
57 EXTRA_RELEASE=".$USER$NOW"
58 fi
542039f @berrange Fully support mingw builds
berrange authored
59
6a714d3 @berrange Switch automated builds to use Mingw64 toolchain instead of Mingw32
berrange authored
60 if test -f /usr/bin/rpmbuild ; then
542039f @berrange Fully support mingw builds
berrange authored
61 rpmbuild --nodeps \
62 --define "extra_release $EXTRA_RELEASE" \
63 --define "_sourcedir `pwd`" \
64 -ba --clean libvirt.spec
65 fi
66
6a714d3 @berrange Switch automated builds to use Mingw64 toolchain instead of Mingw32
berrange authored
67 # Test mingw32 cross-compile
68 if test -x /usr/bin/i686-w64-mingw32-gcc ; then
542039f @berrange Fully support mingw builds
berrange authored
69 make distclean
70
6a714d3 @berrange Switch automated builds to use Mingw64 toolchain instead of Mingw32
berrange authored
71 PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig" \
72 CC="i686-w64-mingw32-gcc" \
ec28eb2 autobuild.sh: use VPATH build
Eric Blake authored
73 ../configure \
6a714d3 @berrange Switch automated builds to use Mingw64 toolchain instead of Mingw32
berrange authored
74 --build=$(uname -m)-w64-linux \
75 --host=i686-w64-mingw32 \
76 --prefix="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \
851117b @berrange Enable all warnings permanently & default to -Werror for GIT builds
berrange authored
77 --enable-werror \
6e4750e @berrange Disable python explicitly in mingw32 autobuild
berrange authored
78 --without-libvirtd \
79 --without-python
542039f @berrange Fully support mingw builds
berrange authored
80
81 make
82 make install
83
6a714d3 @berrange Switch automated builds to use Mingw64 toolchain instead of Mingw32
berrange authored
84 fi
85
86 # Test mingw64 cross-compile
87 if test -x /usr/bin/x86_64-w64-mingw32-gcc ; then
88 make distclean
89
90 PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig" \
91 CC="x86_64-w64-mingw32-gcc" \
92 ../configure \
93 --build=$(uname -m)-w64-linux \
94 --host=x86_64-w64-mingw32 \
95 --prefix="$AUTOBUILD_INSTALL_ROOT/x86_64-w64-mingw32/sys-root/mingw" \
96 --enable-werror \
97 --without-libvirtd \
98 --without-python
99
100 make
101 make install
102
103 fi
104
542039f @berrange Fully support mingw builds
berrange authored
105
6a714d3 @berrange Switch automated builds to use Mingw64 toolchain instead of Mingw32
berrange authored
106 if test -x /usr/bin/i686-w64-mingw32-gcc && test -x /usr/bin/x86_64-w64-mingw32-gcc ; then
107 if test -f /usr/bin/rpmbuild ; then
0ae2631 @rwmjones Updated MinGW spec file.
rwmjones authored
108 rpmbuild --nodeps \
109 --define "extra_release $EXTRA_RELEASE" \
110 --define "_sourcedir `pwd`" \
6a714d3 @berrange Switch automated builds to use Mingw64 toolchain instead of Mingw32
berrange authored
111 -ba --clean mingw-libvirt.spec
0ae2631 @rwmjones Updated MinGW spec file.
rwmjones authored
112 fi
4f2fcbd @berrange Added autobuild control file
berrange authored
113 fi
Something went wrong with that request. Please try again.