Spdk/autopackage.sh
Michal Berger fa633b2825 autopackage: Move packaging test to autobuild
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ifbe4d98f3d7a4b9970f923acd6d299d9cc02d350
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17206
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-05-09 17:58:11 +08:00

55 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (C) 2015 Intel Corporation
# All rights reserved.
#
rootdir=$(readlink -f $(dirname $0))
source "$rootdir/test/common/autobuild_common.sh"
MAKEFLAGS=${MAKEFLAGS:--j16}
cd $rootdir
timing_enter porcelain_check
if [[ -e $rootdir/mk/config.mk ]]; then
$MAKE clean
fi
if [ $(git status --porcelain --ignore-submodules | wc -l) -ne 0 ]; then
echo make clean left the following files:
git status --porcelain --ignore-submodules
exit 1
fi
timing_exit porcelain_check
if [[ $SPDK_TEST_RELEASE_BUILD -eq 1 ]]; then
build_packaging
$MAKE clean
fi
if [[ $RUN_NIGHTLY -eq 0 || $SPDK_TEST_UNITTEST -eq 0 ]]; then
timing_finish
exit 0
fi
timing_enter build_release
config_params="$(get_config_params | sed 's/--enable-debug//g')"
if [ $(uname -s) = Linux ]; then
# LTO needs a special compiler to work under clang. See detect_cc.sh for details.
if [[ $CC == *clang* ]]; then
LD=$(type -P ld.gold)
export LD
fi
$rootdir/configure $config_params --enable-lto
else
# LTO needs a special compiler to work on BSD.
$rootdir/configure $config_params
fi
$MAKE ${MAKEFLAGS}
$MAKE ${MAKEFLAGS} clean
timing_exit build_release
timing_finish