2015-09-21 21:48:40 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -xe
|
|
|
|
|
2015-10-08 19:40:44 +00:00
|
|
|
rootdir=$(readlink -f $(dirname $0))
|
2018-02-27 22:14:08 +00:00
|
|
|
source "$rootdir/test/common/autotest_common.sh"
|
2015-10-03 00:11:56 +00:00
|
|
|
|
2015-09-21 21:48:40 +00:00
|
|
|
out=$PWD
|
|
|
|
|
|
|
|
MAKEFLAGS=${MAKEFLAGS:--j16}
|
2015-10-08 19:40:44 +00:00
|
|
|
cd $rootdir
|
|
|
|
|
|
|
|
timing_enter autopackage
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2015-10-03 00:11:56 +00:00
|
|
|
$MAKE clean
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2018-07-25 18:02:47 +00:00
|
|
|
if [ `git status --porcelain --ignore-submodules | wc -l` -ne 0 ]; then
|
2015-09-21 21:48:40 +00:00
|
|
|
echo make clean left the following files:
|
|
|
|
git status --porcelain
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-05-08 22:07:13 +00:00
|
|
|
spdk_pv=spdk-$(date +%Y_%m_%d)
|
|
|
|
spdk_tarball=${spdk_pv}.tar
|
|
|
|
dpdk_pv=dpdk-$(date +%Y_%m_%d)
|
|
|
|
dpdk_tarball=${dpdk_pv}.tar
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2017-05-08 22:07:13 +00:00
|
|
|
find . -iname "spdk-*.tar* dpdk-*.tar*" -delete
|
2017-05-31 22:14:50 +00:00
|
|
|
git archive HEAD^{tree} --prefix=${spdk_pv}/ -o ${spdk_tarball}
|
2015-09-21 21:48:40 +00:00
|
|
|
|
|
|
|
# Build from packaged source
|
|
|
|
tmpdir=$(mktemp -d)
|
|
|
|
echo "tmpdir=$tmpdir"
|
2017-05-08 22:07:13 +00:00
|
|
|
tar -C "$tmpdir" -xf $spdk_tarball
|
|
|
|
|
|
|
|
if [ -z "$WITH_DPDK_DIR" ]; then
|
|
|
|
cd dpdk
|
2017-05-31 22:14:50 +00:00
|
|
|
git archive HEAD^{tree} --prefix=dpdk/ -o ../${dpdk_tarball}
|
2017-05-08 22:07:13 +00:00
|
|
|
cd ..
|
|
|
|
tar -C "$tmpdir/${spdk_pv}" -xf $dpdk_tarball
|
|
|
|
fi
|
|
|
|
|
2015-09-24 20:56:01 +00:00
|
|
|
(
|
|
|
|
cd "$tmpdir"/spdk-*
|
2017-05-08 22:07:13 +00:00
|
|
|
# use $config_params to get the right dependency options, but disable coverage and ubsan
|
|
|
|
# explicitly since they are not needed for this build
|
|
|
|
./configure $config_params --disable-debug --enable-werror --disable-coverage --disable-ubsan
|
2017-03-30 19:06:49 +00:00
|
|
|
time $MAKE ${MAKEFLAGS}
|
2015-09-24 20:56:01 +00:00
|
|
|
)
|
2015-09-21 21:48:40 +00:00
|
|
|
rm -rf "$tmpdir"
|
2015-10-08 19:40:44 +00:00
|
|
|
|
|
|
|
timing_exit autopackage
|
|
|
|
|
|
|
|
timing_finish
|