Files
osmo-trx/contrib/jenkins.sh
Oliver Smith 3642b5956c contrib/jenkins: remove broken chroot + qemu code
The mirror where it would download images from is not online anymore,
and it looks like this whole block has not been executed in years (we
always test the arm builds on native arm machines nowadays, and run all
builds in docker).

Replace the whole block with a simple check that ensures when arm flags
are used, that the build is actually running on an arm machine.

Change-Id: I2e204e4a0a7dfcf32f011ed6fb403b564f8155a7
2024-09-12 09:59:09 +02:00

92 lines
2.0 KiB
Bash
Executable File

#!/bin/sh
# jenkins build helper script for osmo-trx. This is how we build on jenkins.osmocom.org
#
# environment variables:
# * INSTR: configure the CPU instruction set ("--with-sse", "--with-neon" or "--with-neon-vfpv4")
# * WITH_MANUALS: build manual PDFs if set to "1"
# * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1")
# * INSIDE_CHROOT: (used internally) set to "1" when the script runs with QEMU in an ARM chroot
#
set -ex
case "$INSTR" in
"--with-neon"*)
case "$(arch)" in
arm*)
;;
*)
set +x
echo "ERROR: trying to build with INSTR=$INSTR but not running on a 32-bit arm machine! (arch=$(arch))"
exit 1
;;
esac
;;
esac
if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
exit 2
fi
base="$PWD"
deps="$base/deps"
inst="$deps/install"
export deps inst
osmo-clean-workspace.sh
mkdir "$deps" || true
osmo-build-dep.sh libosmocore "" "--enable-sanitize --disable-doxygen --disable-pcsc"
PARALLEL_MAKE="" osmo-build-dep.sh libusrp
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
export PATH="$inst/bin:$PATH"
CONFIG="
--enable-sanitize
--enable-werror
--with-bladerf
--with-ipc
--with-lms
--with-mstrx
--with-uhd
--with-usrp1
$INSTR
"
# Additional configure options and depends
if [ "$WITH_MANUALS" = "1" ]; then
CONFIG="$CONFIG --enable-manuals"
fi
set +x
echo
echo
echo
echo " =============================== osmo-trx ==============================="
echo
set -x
cd "$base"
git submodule status
autoreconf --install --force
./configure $CONFIG
$MAKE $PARALLEL_MAKE
$MAKE check \
|| cat-testlogs.sh
if arch | grep -v -q arm; then
DISTCHECK_CONFIGURE_FLAGS="$(echo $CONFIG | tr -d '\n')" $MAKE $PARALLEL_MAKE distcheck \
|| cat-testlogs.sh
fi
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
make -C "$base/doc/manuals" publish
fi
$MAKE $PARALLEL_MAKE maintainer-clean
osmo-clean-workspace.sh