From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeIsK-0007gg-4U for qemu-devel@nongnu.org; Thu, 07 Nov 2013 01:15:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeIs9-0002l2-5h for qemu-devel@nongnu.org; Thu, 07 Nov 2013 01:15:28 -0500 Received: from qemu.weilnetz.de ([2a03:4000:2:362::1]:38366 helo=v2201305906712890.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeIs8-0002kf-V3 for qemu-devel@nongnu.org; Thu, 07 Nov 2013 01:15:17 -0500 From: Stefan Weil Date: Thu, 7 Nov 2013 07:15:08 +0100 Message-Id: <1383804909-376-3-git-send-email-sw@weilnetz.de> In-Reply-To: <1383804909-376-1-git-send-email-sw@weilnetz.de> References: <1383804909-376-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH for 1.7 2/3] configure: Add config.status to recreate the current configuration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Stefan Weil , qemu-devel The latest configure invocation was saved in config-host.mak and could be extracted from that file to recreate the configuration. Now it is saved in a new file config.status which can be directly executed to recreate the configuration. The file name and the comments were copied from GNU autoconf. Makefile now uses config.status, but also includes transitional code for the old mechanism. Signed-off-by: Stefan Weil Reviewed-by: Fam Zheng --- Makefile | 9 ++++++++- configure | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b15003f..073f18b 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,14 @@ CONFIG_ALL=y include $(SRC_PATH)/rules.mak config-host.mak: $(SRC_PATH)/configure @echo $@ is out-of-date, running configure - @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh + @# TODO: The next lines include code which supports a smooth + @# transition from old configurations without config.status. + @# This code can be removed after QEMU 1.7. + @if test -x config.status; then \ + ./config.status; \ + else \ + sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh; \ + fi else config-host.mak: ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) diff --git a/configure b/configure index 9addff1..a1cc5be 100755 --- a/configure +++ b/configure @@ -27,6 +27,19 @@ printf " '%s'" "$0" "$@" >> config.log echo >> config.log echo "#" >> config.log +# Save the configure command line for later reuse. +cat <config.status +#!/bin/sh +# Generated by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. +EOD +printf "exec" >>config.status +printf " '%s'" "$0" "$@" >>config.status +echo >>config.status +chmod +x config.status + error_exit() { echo echo "ERROR: $1" @@ -3757,8 +3770,6 @@ config_host_mak="config-host.mak" echo "# Automatically generated by configure - do not modify" >config-all-disas.mak 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 echo all: >> $config_host_mak -- 1.7.10.4