Cleanup jenkins build scripts

* reorder builds to avoid rm -rf invocation
* avoid useless double autoreconf
* move common parts into shared helper
* move common build steps into separate function

Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0
This commit is contained in:
Max 2017-10-20 16:07:06 +02:00 committed by Harald Welte
parent 32f9971a71
commit 15b05fef76
3 changed files with 26 additions and 32 deletions

View File

@ -1,11 +1,9 @@
#!/bin/sh #!/bin/sh
set -ex . $(dirname "$0")/jenkins_common.sh
verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") build() {
$1 --enable-static \
autoreconf --install --force
./configure --enable-static \
--prefix=/usr/local/arm-none-eabi \ --prefix=/usr/local/arm-none-eabi \
--host=arm-none-eabi \ --host=arm-none-eabi \
--enable-embedded \ --enable-embedded \
@ -14,20 +12,13 @@ autoreconf --install --force
$MAKE $PARALLEL_MAKE \ $MAKE $PARALLEL_MAKE \
|| cat-testlogs.sh || cat-testlogs.sh
}
# verify build in dir other than source tree # verify build in dir other than source tree
rm -rf * mkdir -p builddir
git checkout .
autoreconf --install --force
mkdir builddir
cd builddir cd builddir
build ../configure
../configure --enable-static \ cd ..
--prefix=/usr/local/arm-none-eabi \ build ./configure
--host=arm-none-eabi \
--enable-embedded \
--disable-shared \
CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror"
$MAKE $PARALLEL_MAKE \
|| cat-testlogs.sh

View File

@ -1,31 +1,27 @@
#!/bin/sh #!/bin/sh
# jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org # jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org
set -ex . $(dirname "$0")/jenkins_common.sh
verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") ENABLE_SANITIZE="--enable-sanitize"
if [ "x$label" = "xFreeBSD_amd64" ]; then if [ "x$label" = "xFreeBSD_amd64" ]; then
ENABLE_SANITIZE="" ENABLE_SANITIZE=""
else
ENABLE_SANITIZE="--enable-sanitize"
fi fi
autoreconf --install --force build() {
./configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror"
$MAKE $PARALLEL_MAKE check \ $MAKE $PARALLEL_MAKE check \
|| cat-testlogs.sh || cat-testlogs.sh
$MAKE distcheck \ $MAKE distcheck \
|| cat-testlogs.sh || cat-testlogs.sh
}
# verify build in dir other than source tree # verify build in dir other than source tree
rm -rf * mkdir -p builddir
git checkout .
autoreconf --install --force
mkdir builddir
cd builddir cd builddir
../configure --enable-static CFLAGS="-Werror" CPPFLAGS="-Werror" build ../configure $ENABLE_SANITIZE
$MAKE $PARALLEL_MAKE check \
|| cat-testlogs.sh cd ..
$MAKE distcheck \ build ./configure $ENABLE_SANITIZE
|| cat-testlogs.sh

View File

@ -0,0 +1,7 @@
#!/bin/sh
set -ex
verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
autoreconf --install --force