summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorpbrook2006-04-16 14:41:07 +0200
committerpbrook2006-04-16 14:41:07 +0200
commitad06484063972abdf3f426412af9aa101bea26a8 (patch)
treebdfdf87a59f2cd4f6a690dce17b54ff576e422f6 /configure
parentSet slirp client hostname. (diff)
downloadqemu-ad06484063972abdf3f426412af9aa101bea26a8.tar.gz
qemu-ad06484063972abdf3f426412af9aa101bea26a8.tar.xz
qemu-ad06484063972abdf3f426412af9aa101bea26a8.zip
Fix out of tree builds.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1814 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 12 insertions, 6 deletions
diff --git a/configure b/configure
index ff504b2b3a..8331e4f25d 100755
--- a/configure
+++ b/configure
@@ -139,14 +139,16 @@ if [ "$bsd" = "yes" ] ; then
fi
# find source path
-# XXX: we assume an absolute path is given when launching configure,
-# except in './configure' case.
-source_path=${0%configure}
-source_path=${source_path%/}
-source_path_used="yes"
-if test -z "$source_path" -o "$source_path" = "." ; then
+source_path=`dirname "$0"`
+if [ -z "$source_path" ]; then
source_path=`pwd`
+else
+ source_path=`cd "$source_path"; pwd`
+fi
+if test "$source_path" = `pwd` ; then
source_path_used="no"
+else
+ source_path_used="yes"
fi
for opt do
@@ -158,6 +160,7 @@ for opt do
--interp-prefix=*) interp_prefix=`echo $opt | cut -d '=' -f 2`
;;
--source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
+ source_path_used="yes"
;;
--cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
;;
@@ -615,6 +618,9 @@ head $source_path/VERSION >> $config_h
echo "\"" >> $config_h
echo "SRC_PATH=$source_path" >> $config_mak
+if [ "$source_path_used" = "yes" ]; then
+ echo "VPATH=$source_path" >> $config_mak
+fi
echo "TARGET_DIRS=$target_list" >> $config_mak
# XXX: suppress that