qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] configure: warn if not using a separate build directory


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] configure: warn if not using a separate build directory
Date: Tue, 31 Mar 2020 13:11:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 3/31/20 12:37 PM, Daniel P. Berrangé wrote:
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é <address@hidden>
---
  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")

This duplicates $source_path.
Maybe you can rename it $source_path and remove the $source_path assignment later.

+
+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 address@hidden."
  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

I'd move it at the very end of the file, to be the last thing displayed.

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>

+
  config_host_mak="config-host.mak"
echo "# Automatically generated by configure - do not modify" >config-all-disas.mak





reply via email to

[Prev in Thread] Current Thread [Next in Thread]