qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 for-5.0] configure: warn if not using a separate build directory
@ 2020-04-03 13:53 Daniel P. Berrangé
  2020-04-03 14:02 ` Eric Blake
  2020-04-05 14:38 ` Peter Maydell
  0 siblings, 2 replies; 10+ messages in thread
From: Daniel P. Berrangé @ 2020-04-03 13:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Daniel P. Berrangé,
	Stefan Hajnoczi, Philippe Mathieu-Daudé, Markus Armbruster,
	Liviu Ionescu, 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.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---

Changed in v4:
  - Adopted Eric's suggested wording

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

diff --git a/configure b/configure
index 22870f3867..d275c36c85 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,22 @@ 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 BUILDING IN THE SOURCE DIR IS DEPRECATED"
+    echo
+    echo "Support for running the 'configure' script directly from the"
+    echo "source directory is deprecated. In-tree builds are not covered"
+    echo "by automated testing and thus may not correctly build QEMU."
+    echo "Users are recommended to use 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] 10+ messages in thread

end of thread, other threads:[~2020-04-06  9:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-03 13:53 [PATCH v4 for-5.0] configure: warn if not using a separate build directory Daniel P. Berrangé
2020-04-03 14:02 ` Eric Blake
2020-04-03 14:42   ` Eric Blake
2020-04-03 22:35     ` Aleksandar Markovic
2020-04-04  9:14       ` Peter Maydell
2020-04-05 17:10         ` Aleksandar Markovic
2020-04-03 15:02   ` BALATON Zoltan
2020-04-05 14:38 ` Peter Maydell
2020-04-05 16:41   ` Aleksandar Markovic
2020-04-06  9:16   ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).