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