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-pcre \ 21 --with-zlib --with-zstd --with-brotli --with-bzip2 \ 22 --with-webdav-props --with-webdav-locks --with-gdbm \ 23 --with-memcached --with-lua --with-libev --with-libunwind \ 24 --with-krb5 \ 25 --with-nettle \ 26 --with-gnutls \ 27 --with-mbedtls \ 28 --with-nss \ 29 --with-openssl \ 30 --with-wolfssl 31 make clean 32 export PATH="${COVERITY_PATH}" 33 cov-build --dir "cov-int" make 34 ;; 35"autobuild") 36 mkdir -p m4 37 autoreconf --force --install 38 ./configure \ 39 --with-pic --enable-extra-warnings \ 40 --with-dbi --with-mysql --with-pgsql \ 41 --with-ldap --with-pcre \ 42 --with-zlib --with-zstd --with-brotli --with-bzip2 \ 43 --with-webdav-props --with-webdav-locks --with-gdbm \ 44 --with-memcached --with-lua --with-libev --with-libunwind \ 45 --with-krb5 --with-sasl \ 46 --with-nettle \ 47 --with-gnutls \ 48 --with-openssl 49 make 50 make check 51 ;; 52"cmake") 53 mkdir cmakebuild 54 cd cmakebuild 55 cmake \ 56 -DBUILD_EXTRA_WARNINGS=ON \ 57 -DCMAKE_BUILD_TYPE=RelWithDebInfo \ 58 -DWITH_ZSTD=ON \ 59 -DWITH_BROTLI=ON \ 60 -DWITH_BZIP=ON \ 61 -DWITH_GDBM=ON \ 62 -DWITH_LDAP=ON \ 63 -DWITH_LIBEV=ON \ 64 -DWITH_LIBUNWIND=ON \ 65 -DWITH_LUA=ON \ 66 -DWITH_MEMCACHED=ON \ 67 -DWITH_DBI=ON \ 68 -DWITH_MYSQL=ON \ 69 -DWITH_PGSQL=ON \ 70 -DWITH_GNUTLS=ON \ 71 -DWITH_NETTLE=ON \ 72 -DWITH_OPENSSL=ON \ 73 -DWITH_WEBDAV_LOCKS=ON \ 74 -DWITH_WEBDAV_PROPS=ON \ 75 .. 76 make 77 ctest -V 78 ;; 79"scons") 80 case "${label}" in 81 debian*) 82 # static linking needs some extra stuff on debian 83 export LDFLAGS="-pthread" 84 export LIBS="-ldl" 85 ;; 86 esac 87 # scons with_zlib=yes with_brotli=yes with_bzip2=yes with_openssl=yes -k check_fullstatic 88 # scons with_zlib=yes with_brotli=yes with_bzip2=yes with_openssl=yes with_memcached=yes -k check_static check_dynamic 89 scons with_zlib=yes with_brotli=yes with_bzip2=yes with_openssl=yes -k check_fullstatic check_static check_dynamic 90 ;; 91*) 92 echo >&2 "Unknown build system: ${build}" 93 exit 1 94 ;; 95esac 96