ci-build.sh 2.5 KB

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