diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-04-13 19:07:49 -0400 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-04-13 19:08:07 -0400 |
commit | c8da1ac9a6d4a3bec039e67036009445de970382 (patch) | |
tree | 8f3aa50059c5d606d1e68f6045af2e83cf2873f1 /contrib | |
parent | 227015e52e993bf8cd2228f5e7d0acce3ead910f (diff) |
jenkins: Add the build script from jenkins here
This can be used to replicate a build issue more easily.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/jenkins_sysmobts.sh | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh new file mode 100755 index 00000000..7d171fcf --- /dev/null +++ b/contrib/jenkins_sysmobts.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +set -ex + +rm -rf deps/install +mkdir deps || true +cd deps + +# Get the headers.. +git clone git://git.osmocom.org/openbsc || true +cd openbsc +git pull --rebase + + +# Build the dependency +cd ../ + +# Analysis code +osmo-deps.sh osmo-static-analysis + +osmo-deps.sh libosmocore +cd libosmocore +autoreconf --install --force +./configure --prefix=$PWD/../install +$MAKE $PARALLEL_MAKE install + +cd ../ +osmo-deps.sh libosmo-abis +cd libosmo-abis +autoreconf --install --force +PKG_CONFIG_PATH=$PWD/../install/lib/pkgconfig ./configure --prefix=$PWD/../install +PKG_CONFIG_PATH=$PWD/../install/lib/pkgconfig $MAKE $PARALLEL_MAKE install + +cd ../ +if ! test -d layer1-api; +then + git clone git://git.sysmocom.de/sysmo-bts/layer1-api.git layer1-api +fi + +cd layer1-api +git fetch origin +if [ $FIRMWARE_VERSION = "master" ]; +then +git reset --hard origin/master +else +git reset --hard $FIRMWARE_VERSION +fi +mkdir -p $PWD/../install/include/sysmocom/femtobts/ +cp include/*.h ../install/include/sysmocom/femtobts/ + + +# Build osmo-bts +cd ../../ +autoreconf --install --force +PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig ./configure --enable-sysmocom-bts --with-openbsc=$PWD/deps/openbsc/openbsc/include +PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig $MAKE $PARALLEL_MAKE +PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE check +DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$PWD/deps/openbsc/openbsc/include" PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig LD_LIBRARY_PATH=$PWD/deps/install/lib $MAKE distcheck + + +# This will not work for the femtobts +if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then + PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig $MAKE -C contrib/sysmobts-calib +fi + +# Use spatch to find common issues +spatch -include_headers -in_place -sp_file deps/osmo-static-analysis/coccinelle/memcpy.cocci . +RES=`git status --porcelain | grep ' M' | wc -l` +git checkout . + +if [ $RES -gt 0 ]; then + echo "Static analysis failed. Please fix the code." + exit 23 +fi |