[DTrace-devel] [PATCH v2 3/9] build: track configured vars
Kris Van Hees
kris.van.hees at oracle.com
Fri Aug 2 05:28:30 UTC 2024
On Thu, Aug 01, 2024 at 02:21:50PM +0100, Nick Alcock wrote:
> This lets the build system determine whether a variable was
> explicitly set via ./configure (the assumption being that
> if you set something explicitly, you knew what you were doing,
> so e.g. if you set the --systemd-unit-dir to /foo/bar, you
> have also arranged for systemd to look there for unit files,
> so the build system can install the systemd unit files there
> on the assumption that they will work).
>
> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
> configure | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/configure b/configure
> index 462548bcc69c..fb9a45cda1b7 100755
> --- a/configure
> +++ b/configure
> @@ -17,13 +17,12 @@ write_make_var()
> {
> local val="$(printf "%s" "$2" | sed 's,^.*=,,')"
>
> - [[ ! -d build ]] && mkdir -p build
> -
> if [[ ! -f build/.config-vars.mk.new ]]; then
> echo '# This file is automatically generated.' > build/.config-vars.mk.new
> fi
>
> printf '%s=%s\n' $1 "$val" >> build/.config-vars.mk.new
> + printf "override CONFIGURED_VARS+=%s\n" $1 >> build/.config-vars.mk.new
> }
>
> # Write out build/.config/*.mk and build/.config/*.h, which are the same
> @@ -115,7 +114,9 @@ above stick for future make invocations until "make clean".
> EOF
> }
>
> +[[ ! -d build ]] && mkdir -p build
> rm -rf build/.config.new build/.config-vars.mk.new
> +echo 'override CONFIGURED_VARS=' > build/.config-vars.mk.new
> trap 'rm -rf build/.config.new build/.config-vars.mk.new' ERR
>
> for option in "$@"; do
> @@ -173,8 +174,6 @@ done
>
> echo 'Writing build/config-vars.mk'
> rm -f build/config-vars.mk
> -[[ ! -f build/.config-vars.mk.new ]] && \
> - touch build/config-vars.mk
> mv -f build/.config-vars.mk.new build/config-vars.mk
>
> rm -rf build/.config
> --
> 2.46.0.277.ge12b8151ed
More information about the DTrace-devel
mailing list