From cab00a5aa163b6bba3043ef0636c4a3a061511ec Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Mon, 28 Apr 2014 15:09:01 +0300 Subject: configure: make source tree build more robust 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(-) (limited to 'configure') diff --git a/configure b/configure index 8c50d78f8..b18f53160 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 <