From 51ab849bdf1d09b69e4be5aedcbae39e4ad692fc Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 3 Nov 2022 07:28:06 +0000 Subject: [PATCH] configure: emit command line options to mk/config.mk This can be useful to know which command line parameters were passed to configure to generate the current build environment. Fixes issue #2758. Signed-off-by: Jim Harris Change-Id: Ia662c73072101abfc5f59c463f4a1c821c3fa0e0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15249 Tested-by: SPDK CI Jenkins Reviewed-by: wanghailiang Reviewed-by: Tomasz Zawadzki Reviewed-by: Krzysztof Karas Reviewed-by: Changpeng Liu Community-CI: Mellanox Build Bot --- CONFIG | 2 ++ configure | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CONFIG b/CONFIG index 542c87c74..6215a4345 100644 --- a/CONFIG +++ b/CONFIG @@ -4,6 +4,8 @@ # Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # +# configure options: __CONFIGURE_OPTIONS__ + # Installation prefix CONFIG_PREFIX="/usr/local" diff --git a/configure b/configure index ba7805111..bfa92c03a 100755 --- a/configure +++ b/configure @@ -1196,6 +1196,8 @@ fi echo -n "Creating mk/config.mk..." cp -f $rootdir/CONFIG $rootdir/mk/config.mk +ARGS=$(echo "$@" | sed 's/ /\\ /g') +sed -i.bak -r "s#__CONFIGURE_OPTIONS__#${ARGS}#g" $rootdir/mk/config.mk for key in "${!CONFIG[@]}"; do sed -i.bak -r "s#[[:space:]]*CONFIG_${key}=.*#CONFIG_${key}\?=${CONFIG[$key]}#g" $rootdir/mk/config.mk done