Review at https://gerrit.osmocom.org/3132
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 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh A contrib/jenkins_common.sh 3 files changed, 29 insertions(+), 46 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/3132/1 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index 510b0e9..507652f 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -1,33 +1,16 @@ #!/bin/sh -set -ex +. $(dirname "$0")/jenkins_common.sh -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - -autoreconf --install --force -./configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh +build() { + $1 --enable-static --prefix=/usr/local/arm-none-eabi --host=arm-none-eabi --enable-embedded --disable-shared CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" + $MAKE $PARALLEL_MAKE || cat-testlogs.sh +} # verify build in dir other than source tree -rm -rf * -git checkout . -autoreconf --install --force -mkdir builddir +mkdir -p builddir cd builddir +build ../configure -../configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh +cd .. +build ./configure diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6a72840..4a26630 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,30 +1,23 @@ -#!/usr/bin/env bash +#!/bin/sh -set -ex +. $(dirname "$0")/jenkins_common.sh -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +ENABLE_SANITIZE="--enable-sanitize" if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" -else - ENABLE_SANITIZE="--enable-sanitize" fi -autoreconf --install --force -./configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh +build() { + $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror" + $MAKE $PARALLEL_MAKE check || cat-testlogs.sh + $MAKE distcheck || cat-testlogs.sh +} # verify build in dir other than source tree -rm -rf * -git checkout . -autoreconf --install --force -mkdir builddir +mkdir -p builddir cd builddir -../configure --enable-static CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh +build ../configure $ENABLE_SANITIZE + +cd .. +build ./configure $ENABLE_SANITIZE diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh new file mode 100644 index 0000000..c7bc7f6 --- /dev/null +++ b/contrib/jenkins_common.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -ex + +./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +autoreconf --install --force -- To view, visit https://gerrit.osmocom.org/3132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max <msur...@sysmocom.de>