xref: /lighttpd1.4/scripts/ci-build.sh (revision f2e4e83a)
1#!/bin/sh
2# build script used by jenkins
3
4set -ex
5
6build="${1:-autobuild}" # build system: coverity, autobuild, cmake, scons, ...
7label="$2"              # label: {debian-{stable,testing},freebsd*}-{i386,amd64}
8compiler="${3:-gcc}"    # might want to overwrite a compiler
9# build=coverity:
10# - create "cov-int" directory for upload (gets `tar`d)
11# - access coverity binaries with export PATH="${COVERITY_PATH}"
12
13case "${build}" in
14"coverity")
15	mkdir -p m4
16	autoreconf --force --install
17	./configure \
18		--with-pic --enable-extra-warnings \
19		--with-dbi --with-mysql --with-pgsql \
20		--with-ldap --with-attr --with-openssl --with-pcre \
21		--with-zlib --with-brotli --with-bzip2 \
22		--with-webdav-props --with-webdav-locks --with-fam --with-gdbm \
23		--with-memcached --with-lua --with-libev --with-libunwind \
24		--with-krb5 --with-geoip
25	make clean
26	export PATH="${COVERITY_PATH}"
27	cov-build --dir "cov-int" make
28	;;
29"autobuild")
30	mkdir -p m4
31	autoreconf --force --install
32	./configure \
33		--with-pic --enable-extra-warnings \
34		--with-dbi --with-mysql --with-pgsql \
35		--with-ldap --with-attr --with-openssl --with-pcre \
36		--with-zlib --with-brotli --with-bzip2 \
37		--with-webdav-props --with-webdav-locks --with-fam --with-gdbm \
38		--with-memcached --with-lua --with-libev --with-libunwind \
39		--with-krb5 --with-geoip --with-sasl
40	make
41	make check
42	;;
43"cmake")
44	mkdir cmakebuild
45	cd cmakebuild
46	cmake \
47		-DBUILD_EXTRA_WARNINGS=ON \
48		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
49		-DWITH_BROTLI=ON \
50		-DWITH_BZIP=ON \
51		-DWITH_FAM=ON \
52		-DWITH_GDBM=ON \
53		-DWITH_LDAP=ON \
54		-DWITH_LIBEV=ON \
55		-DWITH_LIBUNWIND=ON \
56		-DWITH_LUA=ON \
57		-DWITH_MEMCACHED=ON \
58		-DWITH_DBI=ON \
59		-DWITH_MYSQL=ON \
60		-DWITH_PGSQL=ON \
61		-DWITH_OPENSSL=ON \
62		-DWITH_WEBDAV_LOCKS=ON \
63		-DWITH_WEBDAV_PROPS=ON \
64		-DWITH_XATTR=ON \
65		..
66	make
67	ctest -V
68	;;
69"scons")
70	case "${label}" in
71	debian*)
72		# static linking needs some extra stuff on debian
73		export LDFLAGS="-pthread"
74		export LIBS="-ldl"
75		;;
76	esac
77	# scons with_zlib=yes with_brotli=yes with_bzip2=yes with_openssl=yes -k check_fullstatic
78	# scons with_zlib=yes with_brotli=yes with_bzip2=yes with_openssl=yes with_memcached=yes -k check_static check_dynamic
79	scons with_zlib=yes with_brotli=yes with_bzip2=yes with_openssl=yes -k check_fullstatic check_static check_dynamic
80	;;
81*)
82	echo >&2 "Unknown build system: ${build}"
83	exit 1
84	;;
85esac
86