From 3a84d90084b5b2bf8685e814fb3fef04f0bbe311 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Tue, 12 Oct 2021 14:52:03 +0800 Subject: [PATCH] configure: simplify config-host.h & config-host.mak generation Create the configuration files using a here-string, rather than separate commands. While we're at it, fix the configure-command-line formatting in the .h header. Signed-off-by: Jeremy Kerr --- configure | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 91a56d05..feb39caa 100755 --- a/configure +++ b/configure @@ -98,18 +98,21 @@ print_config() { CFLAGS="-D_GNU_SOURCE -include config-host.h" BUILD_CFLAGS="" +cmdstr=$(printf " '%s'" "$0" "$@") # Print configure header at the top of $config_host_h -echo "/*" > $config_host_h -echo " * Automatically generated by configure - do not modify" >> $config_host_h -printf " * Configured with:" >> $config_host_h -printf " * '%s'" "$0" "$@" >> $config_host_h -echo "" >> $config_host_h -echo " */" >> $config_host_h - -echo "# Automatically generated by configure - do not modify" > $config_host_mak -printf "# Configured with:" >> $config_host_mak -printf " '%s'" "$0" "$@" >> $config_host_mak -echo >> $config_host_mak +cat > $config_host_h < $config_host_mak <