configure: make BUILD_CMD an array variable.

Most modern shells know how to interpret the string version of commands
when parsing them from a variable, but some shells like the one centos 7
uses misinterpret the command causing the dpdk version check in
configure to fail erroneously. This can be observed in the CentOS logs
of recent vs dpdk master jobs on the CI.

This method looks to be the more conservative way of doing the same
thing and fixes the issue on my dev machine.

Change-Id: Ib51c537ec88c781eb62519e08e4252ae05e554ef
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467714
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Seth Howell 2019-09-06 16:15:47 -07:00 committed by Ben Walker
parent 758b2f9439
commit 43a713f9f0

26
configure vendored
View File

@ -371,7 +371,7 @@ $rootdir/scripts/detect_cc.sh --cc="$CC" --cxx="$CXX" --lto="${CONFIG[LTO]}" --l
CC=$(cat $rootdir/mk/cc.mk | grep "CC=" | cut -d "=" -f 2) CC=$(cat $rootdir/mk/cc.mk | grep "CC=" | cut -d "=" -f 2)
CC_TYPE=$(cat $rootdir/mk/cc.mk | grep "CC_TYPE=" | cut -d "=" -f 2) CC_TYPE=$(cat $rootdir/mk/cc.mk | grep "CC_TYPE=" | cut -d "=" -f 2)
BUILD_CMD="$CC -o /dev/null -x c $CPPFLAGS $CFLAGS $LDFLAGS" BUILD_CMD=($CC -o /dev/null -x c $CPPFLAGS $CFLAGS $LDFLAGS)
# Detect architecture and force no ISA-L if non-x86 archtecture # Detect architecture and force no ISA-L if non-x86 archtecture
if [[ "${CONFIG[ISAL]}" = "y" ]]; then if [[ "${CONFIG[ISAL]}" = "y" ]]; then
@ -418,7 +418,7 @@ if [ -z "${CONFIG[ENV]}" ]; then
# program, just compile it # program, just compile it
if ! echo -e '#include <rte_vhost.h>\n' \ if ! echo -e '#include <rte_vhost.h>\n' \
'int main(void) { return rte_vhost_extern_callback_register(0, NULL, NULL); }\n' \ 'int main(void) { return rte_vhost_extern_callback_register(0, NULL, NULL); }\n' \
| $BUILD_CMD -c -Wno-deprecated-declarations -Werror \ | ${BUILD_CMD[@]} -c -Wno-deprecated-declarations -Werror \
-I"${CONFIG[DPDK_DIR]}/include" - &>/dev/null; then -I"${CONFIG[DPDK_DIR]}/include" - &>/dev/null; then
echo "Notice: DPDK's rte_vhost not found or version < 19.05, using internal," \ echo "Notice: DPDK's rte_vhost not found or version < 19.05, using internal," \
"legacy rte_vhost library." "legacy rte_vhost library."
@ -487,7 +487,7 @@ fi
if [ "${CONFIG[RDMA]}" = "y" ]; then if [ "${CONFIG[RDMA]}" = "y" ]; then
if ! echo -e '#include <infiniband/verbs.h>\n#include <rdma/rdma_verbs.h>\n' \ if ! echo -e '#include <infiniband/verbs.h>\n#include <rdma/rdma_verbs.h>\n' \
'int main(void) { return 0; }\n' \ 'int main(void) { return 0; }\n' \
| $BUILD_CMD -libverbs -lrdmacm - 2>/dev/null; then | ${BUILD_CMD[@]} -libverbs -lrdmacm - 2>/dev/null; then
echo --with-rdma requires libverbs and librdmacm. echo --with-rdma requires libverbs and librdmacm.
echo Please install then re-run this script. echo Please install then re-run this script.
exit 1 exit 1
@ -495,7 +495,7 @@ if [ "${CONFIG[RDMA]}" = "y" ]; then
if echo -e '#include <infiniband/verbs.h>\n' \ if echo -e '#include <infiniband/verbs.h>\n' \
'int main(void) { return !!IBV_WR_SEND_WITH_INV; }\n' \ 'int main(void) { return !!IBV_WR_SEND_WITH_INV; }\n' \
| $BUILD_CMD -c - 2>/dev/null; then | ${BUILD_CMD[@]} -c - 2>/dev/null; then
CONFIG[RDMA_SEND_WITH_INVAL]="y" CONFIG[RDMA_SEND_WITH_INVAL]="y"
else else
CONFIG[RDMA_SEND_WITH_INVAL]="n" CONFIG[RDMA_SEND_WITH_INVAL]="n"
@ -566,7 +566,7 @@ fi
if [[ "${CONFIG[PMDK]}" = "y" ]]; then if [[ "${CONFIG[PMDK]}" = "y" ]]; then
if ! echo -e '#include <libpmemblk.h>\nint main(void) { return 0; }\n' \ if ! echo -e '#include <libpmemblk.h>\nint main(void) { return 0; }\n' \
| $BUILD_CMD -lpmemblk - 2>/dev/null; then | ${BUILD_CMD[@]} -lpmemblk - 2>/dev/null; then
echo --with-pmdk requires libpmemblk. echo --with-pmdk requires libpmemblk.
echo Please install then re-run this script. echo Please install then re-run this script.
exit 1 exit 1
@ -575,7 +575,7 @@ fi
if [[ "${CONFIG[REDUCE]}" = "y" ]]; then if [[ "${CONFIG[REDUCE]}" = "y" ]]; then
if ! echo -e '#include <libpmem.h>\nint main(void) { return 0; }\n' \ if ! echo -e '#include <libpmem.h>\nint main(void) { return 0; }\n' \
| $BUILD_CMD -lpmem - 2>/dev/null; then | ${BUILD_CMD[@]} -lpmem - 2>/dev/null; then
echo --with-reduce requires libpmem. echo --with-reduce requires libpmem.
echo Please install then re-run this script. echo Please install then re-run this script.
exit 1 exit 1
@ -587,7 +587,7 @@ if [[ "${CONFIG[VPP]}" = "y" ]]; then
VPP_CFLAGS="-L${CONFIG[VPP_DIR]}/lib -I${CONFIG[VPP_DIR]}/include" VPP_CFLAGS="-L${CONFIG[VPP_DIR]}/lib -I${CONFIG[VPP_DIR]}/include"
fi fi
if ! echo -e '#include <vnet/session/application_interface.h>\nint main(void) { return 0; }\n' \ if ! echo -e '#include <vnet/session/application_interface.h>\nint main(void) { return 0; }\n' \
| $BUILD_CMD ${VPP_CFLAGS} -lvppinfra -lsvm -lvlibmemoryclient - 2>/dev/null; then | ${BUILD_CMD[@]} ${VPP_CFLAGS} -lvppinfra -lsvm -lvlibmemoryclient - 2>/dev/null; then
echo --with-vpp requires installed vpp. echo --with-vpp requires installed vpp.
echo Please install then re-run this script. echo Please install then re-run this script.
exit 1 exit 1
@ -597,7 +597,7 @@ fi
if [[ "${CONFIG[RBD]}" = "y" ]]; then if [[ "${CONFIG[RBD]}" = "y" ]]; then
if ! echo -e '#include <rbd/librbd.h>\n#include <rados/librados.h>\n' \ if ! echo -e '#include <rbd/librbd.h>\n#include <rados/librados.h>\n' \
'int main(void) { return 0; }\n' \ 'int main(void) { return 0; }\n' \
| $BUILD_CMD -lrados -lrbd - 2>/dev/null; then | ${BUILD_CMD[@]} -lrados -lrbd - 2>/dev/null; then
echo --with-rbd requires librados and librbd. echo --with-rbd requires librados and librbd.
echo Please install then re-run this script. echo Please install then re-run this script.
exit 1 exit 1
@ -611,7 +611,7 @@ if [[ "${CONFIG[ISCSI_INITIATOR]}" = "y" ]]; then
'#error\n' \ '#error\n' \
'#endif\n' \ '#endif\n' \
'int main(void) { return 0; }\n' \ 'int main(void) { return 0; }\n' \
| $BUILD_CMD -L/usr/lib64/iscsi -liscsi - 2>/dev/null; then | ${BUILD_CMD[@]} -L/usr/lib64/iscsi -liscsi - 2>/dev/null; then
echo --with-iscsi-initiator requires libiscsi with echo --with-iscsi-initiator requires libiscsi with
echo 'LIBISCSI_API_VERSION >= 20150621.' echo 'LIBISCSI_API_VERSION >= 20150621.'
echo Please install then re-run this script. echo Please install then re-run this script.
@ -621,7 +621,7 @@ fi
if [[ "${CONFIG[LOG_BACKTRACE]}" = "y" ]]; then if [[ "${CONFIG[LOG_BACKTRACE]}" = "y" ]]; then
if ! echo -e '#include <libunwind.h>\nint main(void) { return 0; }\n' \ if ! echo -e '#include <libunwind.h>\nint main(void) { return 0; }\n' \
| $BUILD_CMD -lunwind - 2>/dev/null; then | ${BUILD_CMD[@]} -lunwind - 2>/dev/null; then
echo --enable-log-bt requires libunwind. echo --enable-log-bt requires libunwind.
echo Please install then re-run this script. echo Please install then re-run this script.
exit 1 exit 1
@ -630,7 +630,7 @@ fi
if [[ "${CONFIG[ASAN]}" = "y" ]]; then if [[ "${CONFIG[ASAN]}" = "y" ]]; then
if ! echo -e 'int main(void) { return 0; }\n' \ if ! echo -e 'int main(void) { return 0; }\n' \
| $BUILD_CMD -fsanitize=address - 2>/dev/null; then | ${BUILD_CMD[@]} -fsanitize=address - 2>/dev/null; then
echo --enable-asan requires libasan. echo --enable-asan requires libasan.
echo Please install then re-run this script. echo Please install then re-run this script.
exit 1 exit 1
@ -639,7 +639,7 @@ fi
if [[ "${CONFIG[UBSAN]}" = "y" ]]; then if [[ "${CONFIG[UBSAN]}" = "y" ]]; then
if ! echo -e 'int main(void) { return 0; }\n' \ if ! echo -e 'int main(void) { return 0; }\n' \
| $BUILD_CMD -fsanitize=undefined - 2>/dev/null; then | ${BUILD_CMD[@]} -fsanitize=undefined - 2>/dev/null; then
echo --enable-ubsan requires libubsan. echo --enable-ubsan requires libubsan.
echo Please install then re-run this script. echo Please install then re-run this script.
exit 1 exit 1
@ -648,7 +648,7 @@ fi
if [[ "${CONFIG[TSAN]}" = "y" ]]; then if [[ "${CONFIG[TSAN]}" = "y" ]]; then
if ! echo -e 'int main(void) { return 0; }\n' \ if ! echo -e 'int main(void) { return 0; }\n' \
| $BUILD_CMD -fsanitize=thread - 2>/dev/null; then | ${BUILD_CMD[@]} -fsanitize=thread - 2>/dev/null; then
echo --enable-tsan requires libtsan. echo --enable-tsan requires libtsan.
echo Please install then re-run this script. echo Please install then re-run this script.
exit 1 exit 1