All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 for-5.0] configure: warn if not using a separate build directory
@ 2020-04-06 15:33 Daniel P. Berrangé
  2020-04-06 15:38 ` Eric Blake
  2020-04-14 19:25 ` Peter Maydell
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel P. Berrangé @ 2020-04-06 15:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Daniel P. Berrangé,
	Liviu Ionescu, Markus Armbruster, Aleksandar Markovic,
	Stefan Hajnoczi, Paolo Bonzini, Michal Suchánek,
	Philippe Mathieu-Daudé,
	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.

Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---

Changed in v5:

 - Use PeterM's suggested wording instead.
 - Dropped previous R-bs due to wording change

 configure | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/configure b/configure
index 22870f3867..b8f1d26293 100755
--- a/configure
+++ b/configure
@@ -285,6 +285,16 @@ then
   error_exit "main directory cannot contain spaces nor colons"
 fi
 
+canon_build_path=$(realpath -- "$PWD")
+canon_source_path=$(realpath -- "$source_path")
+
+in_srcdir=no
+if [ "$canon_build_path" = "$canon_source_path" ]
+then
+    in_srcdir=yes
+fi
+
+
 # default parameters
 cpu=""
 iasl="iasl"
@@ -6751,6 +6761,23 @@ if test "$supported_os" = "no"; then
     echo "us upstream at qemu-devel@nongnu.org."
 fi
 
+if test "$in_srcdir" = "yes"; then
+    echo
+    echo "NOTE: we recommend against building in the source directory"
+    echo
+    echo "You've run the 'configure' script directly from the source"
+    echo "directory. This will work, but we recommend using a separate"
+    echo "build directory, especially if you plan to work with the QEMU"
+    echo "sources rather than just building it once. You can switch to"
+    echo "a separate build directory like this:"
+    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] 6+ messages in thread

end of thread, other threads:[~2020-04-15  8:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 15:33 [PATCH v5 for-5.0] configure: warn if not using a separate build directory Daniel P. Berrangé
2020-04-06 15:38 ` Eric Blake
2020-04-06 15:45   ` Daniel P. Berrangé
2020-04-14 19:25 ` Peter Maydell
2020-04-15  6:13   ` Markus Armbruster
2020-04-15  8:52     ` Peter Maydell

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.