diff --git a/configure b/configure index 711d1fc69..9f9b60cab 100755 --- a/configure +++ b/configure @@ -369,7 +369,7 @@ scripts/detect_cc.sh --cc="$CC" --cxx="$CXX" --lto="${CONFIG[LTO]}" --ld="$LD" - CC=$(cat mk/cc.mk | grep "CC=" | cut -d "=" -f 2) CC_TYPE=$(cat 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 if [[ "${CONFIG[ISAL]}" = "y" ]]; then @@ -417,7 +417,7 @@ if [ -z "${CONFIG[ENV]}" ]; then # program, just compile it if ! echo -e '#include \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 echo "Notice: DPDK's rte_vhost not found or version < 19.05, using internal," \ "legacy rte_vhost library." @@ -486,7 +486,7 @@ fi if [ "${CONFIG[RDMA]}" = "y" ]; then if ! echo -e '#include \n#include \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 Please install then re-run this script. exit 1 @@ -494,7 +494,7 @@ if [ "${CONFIG[RDMA]}" = "y" ]; then if echo -e '#include \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" else CONFIG[RDMA_SEND_WITH_INVAL]="n" @@ -565,7 +565,7 @@ fi if [[ "${CONFIG[PMDK]}" = "y" ]]; then if ! echo -e '#include \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 Please install then re-run this script. exit 1 @@ -574,7 +574,7 @@ fi if [[ "${CONFIG[REDUCE]}" = "y" ]]; then if ! echo -e '#include \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 Please install then re-run this script. exit 1 @@ -586,7 +586,7 @@ if [[ "${CONFIG[VPP]}" = "y" ]]; then VPP_CFLAGS="-L${CONFIG[VPP_DIR]}/lib -I${CONFIG[VPP_DIR]}/include" fi if ! echo -e '#include \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 Please install then re-run this script. exit 1 @@ -596,7 +596,7 @@ fi if [[ "${CONFIG[RBD]}" = "y" ]]; then if ! echo -e '#include \n#include \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 Please install then re-run this script. exit 1 @@ -610,7 +610,7 @@ if [[ "${CONFIG[ISCSI_INITIATOR]}" = "y" ]]; then '#error\n' \ '#endif\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 'LIBISCSI_API_VERSION >= 20150621.' echo Please install then re-run this script. @@ -620,7 +620,7 @@ fi if [[ "${CONFIG[LOG_BACKTRACE]}" = "y" ]]; then if ! echo -e '#include \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 Please install then re-run this script. exit 1 @@ -629,7 +629,7 @@ fi if [[ "${CONFIG[ASAN]}" = "y" ]]; then 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 Please install then re-run this script. exit 1 @@ -638,7 +638,7 @@ fi if [[ "${CONFIG[UBSAN]}" = "y" ]]; then 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 Please install then re-run this script. exit 1 @@ -647,7 +647,7 @@ fi if [[ "${CONFIG[TSAN]}" = "y" ]]; then 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 Please install then re-run this script. exit 1