From patchwork Sun Jan 5 07:30:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 37203 Received: (qmail 61907 invoked by alias); 5 Jan 2020 07:30:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 61797 invoked by uid 89); 5 Jan 2020 07:30:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:2750 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 Jan 2020 07:30:19 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AFF4F116FC0; Sun, 5 Jan 2020 02:30:06 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pAIky9XiqM1R; Sun, 5 Jan 2020 02:30:06 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 49318116FAE; Sun, 5 Jan 2020 02:30:06 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id ADDB3838B8; Sun, 5 Jan 2020 11:30:01 +0400 (+04) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Tom Tromey , Joel Brobecker Subject: [RFA/gdb-9-branch] Abort configure immediately if building GDB in tree Date: Sun, 5 Jan 2020 11:30:00 +0400 Message-Id: <20200105073000.1012-1-brobecker@adacore.com> Hello, Following the discussions on the gdb@ mailing-list regarding the fact that GDB 9 is not buildable when configured in tree, I propose the following patch for the gdb-9-branch. Ideally, I would have liked to propose it for both master and gdb-9-branch, but I think toplevel configure is supposed to be coordinated between GCC and ourselves. Looking at this patch, I don't think it's necessary, since we hope to lift that limitation at some point. --------------------------------------------------------------------------- The move of gnulib to the toplevel directory is causing the GDB build to break if configured in tree. We hope to lift that limitation at some point but, in the meantime, this commit allows us to abort the initial configure right away with a clear error message should the user attempt to build in tree. ChangeLog: * configure.ac: Abort the build with an error if trying to build GDB in tree. * configure: Regenerate. Tested by running the configure script with no argument, --enable-gdb, and --disable-gdb; from both the toplevel source directory as well as from other directories. OK to push to gdb-9-branch? Thanks, diff --git a/configure b/configure index 6a9719f6091..6273a6a4055 100755 --- a/configure +++ b/configure @@ -2279,6 +2279,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test x"${enable_gdb}" != x"no"; then + # For this branch, we do not support building GDB in-tree. + # Try to detect whether we are in this situation or not by + # searching for a couple of known files in the source directory. + if test -f gnulib/update-gnulib.sh -a -f gdb/ChangeLog; then + as_fn_error $? "GDB must be configured and built in a directory separate from its sources" "$LINENO" 5 + fi +fi + progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi diff --git a/configure.ac b/configure.ac index 7433badc217..25b3392da9a 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,15 @@ m4_include([config/isl.m4]) AC_INIT(move-if-change) AC_DISABLE_OPTION_CHECKING +if test x"${enable_gdb}" != x"no"; then + # For this branch, we do not support building GDB in-tree. + # Try to detect whether we are in this situation or not by + # searching for a couple of known files in the source directory. + if test -f gnulib/update-gnulib.sh -a -f gdb/ChangeLog; then + AC_MSG_ERROR([GDB must be configured and built in a directory separate from its sources]) + fi +fi + progname=$0 # if PWD already has a value, it is probably wrong. if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi