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-pcre2 \ 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-pcre2 \ 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 -j 2 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_PCRE2=ON \ 59 -DWITH_ZSTD=ON \ 60 -DWITH_BROTLI=ON \ 61 -DWITH_BZIP=ON \ 62 -DWITH_GDBM=ON \ 63 -DWITH_LDAP=ON \ 64 -DWITH_LIBEV=ON \ 65 -DWITH_LIBUNWIND=ON \ 66 -DWITH_LUA=ON \ 67 -DWITH_MEMCACHED=ON \ 68 -DWITH_DBI=ON \ 69 -DWITH_MYSQL=ON \ 70 -DWITH_PGSQL=ON \ 71 -DWITH_GNUTLS=ON \ 72 -DWITH_NETTLE=ON \ 73 -DWITH_OPENSSL=ON \ 74 -DWITH_WEBDAV_LOCKS=ON \ 75 -DWITH_WEBDAV_PROPS=ON \ 76 .. 77 make -j 2 78 ctest -V 79 ;; 80"scons") 81 case "${label}" in 82 debian*) 83 # static linking needs some extra stuff on debian 84 export LDFLAGS="-pthread" 85 export LIBS="-ldl" 86 ;; 87 esac 88 # scons -j 2 with_pcre2=yes with_zlib=yes with_brotli=yes with_openssl=yes -k check_fullstatic 89 # scons -j 2 with_pcre2=yes with_zlib=yes with_brotli=yes with_openssl=yes -k check_static check_dynamic 90 scons -j 2 with_pcre2=yes with_zlib=yes with_brotli=yes with_openssl=yes -k check_fullstatic check_static check_dynamic 91 ;; 92*) 93 echo >&2 "Unknown build system: ${build}" 94 exit 1 95 ;; 96esac 97