From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi4YO-0006ME-QJ for qemu-devel@nongnu.org; Wed, 07 May 2014 12:18:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wi4YI-00020P-EA for qemu-devel@nongnu.org; Wed, 07 May 2014 12:18:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi4YI-00020C-5h for qemu-devel@nongnu.org; Wed, 07 May 2014 12:18:38 -0400 Date: Wed, 7 May 2014 19:17:27 +0300 From: "Michael S. Tsirkin" Message-ID: <1399479367-31336-12-git-send-email-mst@redhat.com> References: <1399479367-31336-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1399479367-31336-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v2 11/11] configure: make source tree build more robust List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Stefan Weil , Michael Tokarev , Anthony Liguori , Paolo Bonzini , Richard Henderson When source directory can be arrived at by two paths, configure might misdetect an out of tree build. The simplest way to trigger the problem is running configure using a full path. E.g. ( refers to qemu source tree): ln -s cd /configure A more practical way is when make runs configure automatically: 1. cd /; ./configure SRC_PATH=/ is written into config_host.mak 2. cd /; touch configure; make make now runs /configure, so configure assumes it's an out of tree build When this happens configure overwrites parts of the current tree with symlinks. Make the test more robust: look for configure in the current directory. If there - we know it's a source build! Signed-off-by: Michael S. Tsirkin --- configure | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 8c50d78..b18f531 100755 --- a/configure +++ b/configure @@ -403,6 +403,14 @@ fi # make source path absolute source_path=`cd "$source_path"; pwd` +# running configure in the source tree? +# we know that's the case if configure is there. +if test -f "./configure"; then + pwd_is_source_path="y" +else + pwd_is_source_path="n" +fi + check_define() { cat > $TMPC <