diff options
-rwxr-xr-x | contrib/jenkins-arm.sh | 21 | ||||
-rwxr-xr-x | contrib/jenkins.sh | 26 | ||||
-rw-r--r-- | contrib/jenkins_common.sh | 18 |
3 files changed, 43 insertions, 22 deletions
diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index e0c75fa6..ef116b12 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -2,8 +2,13 @@ . $(dirname "$0")/jenkins_common.sh +src_dir="$PWD" build() { - $1 --enable-static \ + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static \ --prefix=/usr/local/arm-none-eabi \ --host=arm-none-eabi \ --enable-embedded \ @@ -11,15 +16,11 @@ build() { --disable-shared \ CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh + $MAKE $PARALLEL_MAKE \ + || cat-testlogs.sh } # verify build in dir other than source tree -mkdir -p builddir -cd builddir -build ../configure - -cd .. -build ./configure - +build builddir +# verify build in source tree +build . diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index c397d528..d7315040 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -9,19 +9,23 @@ if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" fi +src_dir="$PWD" build() { - $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" + $MAKE $PARALLEL_MAKE check \ + || cat-testlogs.sh } # verify build in dir other than source tree -mkdir -p builddir -cd builddir -build ../configure $ENABLE_SANITIZE - -cd .. -build ./configure $ENABLE_SANITIZE +build builddir +# verify build in source tree +build . +# do distcheck only once, which is fine from built source tree, since distcheck +# is well separated from the source tree state. +$MAKE distcheck \ + || cat-testlogs.sh diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index e52a96a9..6cfa3347 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -4,4 +4,20 @@ set -ex verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -autoreconf --install --force +prep_build() { + _src_dir="$1" + _build_dir="$2" + + cd "$_src_dir" + + # a failed 'make distcheck' may leave files without write permissions + chmod -R a+w . + git clean -dxf + # make absolutely sure no src files have modifications + git checkout -f HEAD + + autoreconf --install --force + + mkdir -p "$_build_dir" + cd "$_build_dir" +} |