All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] configure: warn if not using a separate build directory
@ 2020-03-31 10:37 Daniel P. Berrangé
  2020-03-31 11:11 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Daniel P. Berrangé @ 2020-03-31 10:37 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Daniel P. Berrangé,
	Liviu Ionescu, Markus Armbruster, Stefan Hajnoczi, Paolo Bonzini,
	Michal Suchánek, Aleksandar Markovic

Running configure directly from the source directory is a build
configuration that will go away in future. It is also not currently
covered by any automated testing. Display a deprecation warning if
the user attempts to use an in-srcdir build setup, so that they are
aware that they're building QEMU in an undesirable manner.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 configure | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/configure b/configure
index e225a1e3ff..1ab7492ab5 100755
--- a/configure
+++ b/configure
@@ -3,6 +3,19 @@
 # qemu configure script (c) 2003 Fabrice Bellard
 #
 
+BUILDDIR=$(pwd)
+SRCDIR=$(dirname "$0")
+
+ABS_BUILDDIR=$(realpath $BUILDDIR)
+ABS_SRCDIR=$(realpath $SRCDIR)
+
+in_srcdir=no
+if [ "$ABS_SRCDIR" == "$ABS_BUILDDIR" ]
+then
+    in_srcdir=yes
+fi
+
+
 # Unset some variables known to interfere with behavior of common tools,
 # just as autoconf does.
 CLICOLOR_FORCE= GREP_OPTIONS=
@@ -6799,6 +6812,23 @@ if test "$supported_os" = "no"; then
     echo "us upstream at qemu-devel@nongnu.org."
 fi
 
+if test "$in_srcdir" = "yes"; then
+    echo
+    echo "WARNING: SUPPORT FOR IN SOURCE DIR BUILDS IS DEPRECATED"
+    echo
+    echo "Support for running the 'configure' script directly from the"
+    echo "source directory is deprecated and will go away in a future"
+    echo "release. In source dir builds are not covered by automated"
+    echo "testing and are liable to break without warning. Users are"
+    echo "strongly recommended to switch to a separate build directory:"
+    echo
+    echo "  $ mkdir build"
+    echo "  $ cd build"
+    echo "  $ ../configure"
+    echo "  $ make"
+    echo
+fi
+
 config_host_mak="config-host.mak"
 
 echo "# Automatically generated by configure - do not modify" >config-all-disas.mak
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-04-01  3:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 10:37 [PATCH] configure: warn if not using a separate build directory Daniel P. Berrangé
2020-03-31 11:11 ` Philippe Mathieu-Daudé
2020-03-31 11:41   ` Daniel P. Berrangé
2020-03-31 12:56     ` Philippe Mathieu-Daudé
2020-03-31 14:44 ` Eric Blake
2020-03-31 14:56   ` Daniel P. Berrangé
2020-03-31 15:51     ` Kevin Wolf
2020-03-31 15:10   ` BALATON Zoltan
2020-04-01  3:03 ` Carlo Arenas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.