Alexandre Julliard : configure: Detect out of tree builds made from an unclean source tree.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Dec 28 07:40:18 CST 2006


Module: wine
Branch: master
Commit: 73b724e7e60146889768964bb77fa5d809f2b16f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=73b724e7e60146889768964bb77fa5d809f2b16f

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec 28 11:40:19 2006 +0100

configure: Detect out of tree builds made from an unclean source tree.

---

 configure    |   11 +++++++++++
 configure.ac |    9 +++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 479aa40..6e7728f 100755
--- a/configure
+++ b/configure
@@ -1999,6 +1999,17 @@ then
   WIN16_INSTALL=""
 fi
 
+case "$srcdir" in
+ .) ;;
+ *) if test -f "$srcdir/Makefile" -o -f "$srcdir/include/config.h"; then
+      { { echo "$as_me:$LINENO: error: you are building out of the source tree, but the source tree contains object files.
+You need to run 'make distclean' in the source tree first." >&5
+echo "$as_me: error: you are building out of the source tree, but the source tree contains object files.
+You need to run 'make distclean' in the source tree first." >&2;}
+   { (exit 1); exit 1; }; }
+    fi ;;
+esac
+
 
 { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
diff --git a/configure.ac b/configure.ac
index 48b5a23..037e47a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,6 +49,15 @@ then
   WIN16_INSTALL=""
 fi
 
+dnl check for out of tree build with unclean source tree
+case "$srcdir" in
+ .) ;;
+ *) if test -f "$srcdir/Makefile" -o -f "$srcdir/include/config.h"; then
+      AC_MSG_ERROR([you are building out of the source tree, but the source tree contains object files.
+You need to run 'make distclean' in the source tree first.])
+    fi ;;
+esac
+
 dnl **** Check for some programs ****
 
 AC_PROG_MAKE_SET




More information about the wine-cvs mailing list