Harald Welte | 645fa46 | 2019-11-06 07:58:19 +0100 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | # jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org |
| 3 | # |
| 4 | # environment variables: |
| 5 | # * WITH_MANUALS: build manual PDFs if set to "1" |
| 6 | # * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1") |
| 7 | # |
| 8 | |
| 9 | if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then |
| 10 | echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" |
| 11 | exit 2 |
| 12 | fi |
| 13 | |
| 14 | |
| 15 | set -ex |
| 16 | |
| 17 | base="$PWD" |
| 18 | deps="$base/deps" |
| 19 | inst="$deps/install" |
| 20 | export deps inst |
| 21 | |
| 22 | osmo-clean-workspace.sh |
| 23 | |
| 24 | mkdir "$deps" || true |
| 25 | |
| 26 | osmo-build-dep.sh libosmocore "" '--disable-doxygen --enable-gnutls' |
| 27 | |
| 28 | verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") |
| 29 | |
| 30 | export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" |
| 31 | export LD_LIBRARY_PATH="$inst/lib" |
| 32 | export PATH="$inst/bin:$PATH" |
| 33 | |
| 34 | osmo-build-dep.sh libosmo-abis |
| 35 | |
| 36 | # Additional configure options and depends |
| 37 | CONFIG="" |
| 38 | if [ "$WITH_MANUALS" = "1" ]; then |
| 39 | osmo-build-dep.sh osmo-gsm-manuals |
| 40 | CONFIG="--enable-manuals" |
| 41 | fi |
| 42 | |
| 43 | set +x |
| 44 | echo |
| 45 | echo |
| 46 | echo |
| 47 | echo " =============================== osmo-e1-recorder ===============================" |
| 48 | echo |
| 49 | set -x |
| 50 | |
| 51 | cd "$base" |
| 52 | autoreconf --install --force |
| 53 | ./configure --enable-sanitize --enable-external-tests --enable-werror $CONFIG |
| 54 | $MAKE $PARALLEL_MAKE |
| 55 | LD_LIBRARY_PATH="$inst/lib" $MAKE check \ |
| 56 | || cat-testlogs.sh |
| 57 | LD_LIBRARY_PATH="$inst/lib" \ |
| 58 | DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests --enable-werror $CONFIG" \ |
| 59 | $MAKE distcheck \ |
| 60 | || cat-testlogs.sh |
| 61 | |
Harald Welte | 54fc223 | 2019-12-04 13:57:24 +0100 | [diff] [blame] | 62 | #if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then |
| 63 | # make -C "$base/doc/manuals" publish |
| 64 | #fi |
Harald Welte | 645fa46 | 2019-11-06 07:58:19 +0100 | [diff] [blame] | 65 | |
| 66 | $MAKE maintainer-clean |
| 67 | osmo-clean-workspace.sh |