From: Michael S. Tsirkin Date: Mon, 28 Apr 2014 12:09:01 +0000 (+0300) Subject: configure: make source tree build more robust X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=cab00a5aa163b6bba3043ef0636c4a3a061511ec;p=qemu.git 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 --- diff --git a/configure b/configure index 8c50d78f87..b18f531606 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 <