From patchwork Fri Nov 30 19:07:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 30480 Received: (qmail 111217 invoked by alias); 30 Nov 2018 19:07:20 -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 111086 invoked by uid 89); 30 Nov 2018 19:07:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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.2 spammy=Hx-spam-relays-external:209.85.128.65, configuring, H*RU:209.85.128.65 X-HELO: mail-wm1-f65.google.com Received: from mail-wm1-f65.google.com (HELO mail-wm1-f65.google.com) (209.85.128.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Nov 2018 19:07:14 +0000 Received: by mail-wm1-f65.google.com with SMTP id s14so25842wmh.1 for ; Fri, 30 Nov 2018 11:07:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ALX8NNPmXUg9+LpRhhkSjunhxDVIBub/2V6Q3YqSZWk=; b=LHq0lVqdsxaUl/8/jDmdhcd2whc+1cwzzybLX153+HMnEXF0mON0d4+53/YAXCXFPA DH+mrzOg5GgrEBpQqXg8Idu3m7e+9p74aj690sVGgf54swHRjtK51Nu9u+deFihOx6M5 uydcMkGXdk3dLf/MuM7yQ86D5N0R4T17DbXgruHyFocnpjcuFqQWpElqqak0VaO5HWjE zZ7c9x6yOQCsGyl74PFknBVMlwY0psAHlVAjSTBErapVykM/MYJLFJpWEA9QOhTNvBZj K0TEW2z0QnuSEQpUgxhDouiGb1/RIYD8mutLT1cm2cUoSyPQq0zUQPcSNCS/VNZQmxgq KEYA== Return-Path: Received: from localhost (host86-156-236-171.range86-156.btcentralplus.com. [86.156.236.171]) by smtp.gmail.com with ESMTPSA id j8sm5224498wrt.40.2018.11.30.11.07.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Nov 2018 11:07:10 -0800 (PST) Date: Fri, 30 Nov 2018 19:07:08 +0000 From: Andrew Burgess To: gdb-patches@sourceware.org Cc: vapier@gentoo.org, John Baldwin , Tom Tromey Subject: Re: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory Message-ID: <20181130190708.GL18841@embecosm.com> References: <0745ff244d76a8cd8ec7e7b9a53840f3773a139d.1541525137.git.andrew.burgess@embecosm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0745ff244d76a8cd8ec7e7b9a53840f3773a139d.1541525137.git.andrew.burgess@embecosm.com> X-Fortune: If you're not careful, you're going to catch something. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes Thanks to John and Tom for their feedback. This revised version of the patch removes the old "installed cgen" support. Thanks, Andrew --- sim/opcodes: Allow use of out of tree cgen source directory When configuring with '--enbale-cgen-maint' the default for both the opcodes/ and sim/ directories is to assume that the cgen source is within the binutils-gdb source tree as binutils-gdb/cgen/. In the old cvs days, this worked well, as cgen was just another sub-module of the single cvs repository and could easily be checked out within the binutils-gdb directory, and managed by cvs in the normal way. Now that binutils-gdb is in git, while cgen is still in cvs, placing the cgen respository within the binutils-gdb tree is more troublesome, and it would be nice if the two tools could be kept separate. Luckily there is already some initial code in the configure.ac files for both opcodes/ and sim/ to support having cgen be located outside of the binutils-gdb tree, however, this was speculative code written imagining a future where cgen would be built and installed to some location. Right now there is no install support for cgen, and so the configure code in opcodes/ and sim/ doesn't really do anything useful. In this commit I repurpose this code to allow binutils-gdb to be configured so that it can make use of a cgen source directory that is outside of the binutils-gdb tree. With this commit applied it is now possible to configure and build binutils-gdb like this: /path/to/binutils-gdb/src/configure --enable-cgen-maint=/path/to/cgen/src/cgen/ make all-opcodes make -C opcodes run-cgen-all Just in case anyone is still using cgen inside the binutils-gdb tree, I have left the default behaviour of '--enable-cgen-maint' (with no parameter) unchanged, that is it looks for the cgen directory as 'binutils-gdb/cgen/'. opcodes/ChangeLog: * configure.ac (enable-cgen-maint): Support passing path to cgen source tree. * configure: Regenerate. sim/ChangeLog: * common/acinclude.m4 (enable-cgen-maint): Support passing path to cgen source tree. * cris/configure: Regenerate. * frv/configure: Regenerate. * iq2000/configure: Regenerate. * lm32/configure: Regenerate. * m32r/configure: Regenerate. * or1k/configure: Regenerate. * sh64/configure: Regenerate. --- opcodes/ChangeLog | 6 ++++++ opcodes/configure | 14 ++++++++++---- opcodes/configure.ac | 14 ++++++++++---- sim/ChangeLog | 12 ++++++++++++ sim/common/acinclude.m4 | 16 +++++++++++----- sim/cris/configure | 16 +++++++++++----- sim/frv/configure | 16 +++++++++++----- sim/iq2000/configure | 16 +++++++++++----- sim/lm32/configure | 16 +++++++++++----- sim/m32r/configure | 16 +++++++++++----- sim/or1k/configure | 16 +++++++++++----- sim/sh64/configure | 16 +++++++++++----- 12 files changed, 126 insertions(+), 48 deletions(-) diff --git a/opcodes/configure b/opcodes/configure index 389e5513cf..eb74324ca8 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -12574,11 +12574,17 @@ if test "${enable_cgen_maint+set}" = set; then : yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) - # argument is cgen install directory (not implemented yet). - # Having a `share' directory might be more appropriate for the .scm, - # .cpu, etc. files. + # Argument is a directory where cgen can be found. In some + # future world cgen could be installable, but right now this + # is not the case. Instead we assume the directory is a path + # to the cgen source tree. cgen_maint=yes - cgendir=${cgen_maint}/lib/cgen + if test -r ${enableval}/iformat.scm; then + # This looks like a cgen source tree. + cgendir=${enableval} + else + as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5 + fi ;; esac fi diff --git a/opcodes/configure.ac b/opcodes/configure.ac index 4c3698356b..7384684bc0 100644 --- a/opcodes/configure.ac +++ b/opcodes/configure.ac @@ -109,11 +109,17 @@ AC_ARG_ENABLE(cgen-maint, yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) - # argument is cgen install directory (not implemented yet). - # Having a `share' directory might be more appropriate for the .scm, - # .cpu, etc. files. + # Argument is a directory where cgen can be found. In some + # future world cgen could be installable, but right now this + # is not the case. Instead we assume the directory is a path + # to the cgen source tree. cgen_maint=yes - cgendir=${cgen_maint}/lib/cgen + if test -r ${enableval}/iformat.scm; then + # This looks like a cgen source tree. + cgendir=${enableval} + else + AC_MSG_ERROR(${enableval} doesn't look like a cgen source tree) + fi ;; esac])dnl AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} = xyes) diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4 index abc15a93ac..71a8841ab0 100644 --- a/sim/common/acinclude.m4 +++ b/sim/common/acinclude.m4 @@ -851,11 +851,17 @@ AC_ARG_ENABLE(cgen-maint, yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) - # argument is cgen install directory (not implemented yet). - # Having a `share' directory might be more appropriate for the .scm, - # .cpu, etc. files. - cgendir=${cgen_maint}/lib/cgen - cgen=guile + # Argument is a directory where cgen can be found. In some + # future world cgen could be installable, but right now this + # is not the case. Instead we assume the directory is a path + # to the cgen source tree. + cgen_maint=yes + if test -r ${enableval}/iformat.scm; then + # This looks like a cgen source tree. + cgendir=${enableval} + else + AC_MSG_ERROR(${enableval} doesn't look like a cgen source tree) + fi ;; esac])dnl dnl AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} != xno) diff --git a/sim/cris/configure b/sim/cris/configure index 8ef9155d82..76f3c284e0 100755 --- a/sim/cris/configure +++ b/sim/cris/configure @@ -13912,11 +13912,17 @@ if test "${enable_cgen_maint+set}" = set; then : yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) - # argument is cgen install directory (not implemented yet). - # Having a `share' directory might be more appropriate for the .scm, - # .cpu, etc. files. - cgendir=${cgen_maint}/lib/cgen - cgen=guile + # Argument is a directory where cgen can be found. In some + # future world cgen could be installable, but right now this + # is not the case. Instead we assume the directory is a path + # to the cgen source tree. + cgen_maint=yes + if test -r ${enableval}/iformat.scm; then + # This looks like a cgen source tree. + cgendir=${enableval} + else + as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5 + fi ;; esac fi diff --git a/sim/frv/configure b/sim/frv/configure index 934afd06ca..eeffc95c75 100755 --- a/sim/frv/configure +++ b/sim/frv/configure @@ -13681,11 +13681,17 @@ if test "${enable_cgen_maint+set}" = set; then : yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) - # argument is cgen install directory (not implemented yet). - # Having a `share' directory might be more appropriate for the .scm, - # .cpu, etc. files. - cgendir=${cgen_maint}/lib/cgen - cgen=guile + # Argument is a directory where cgen can be found. In some + # future world cgen could be installable, but right now this + # is not the case. Instead we assume the directory is a path + # to the cgen source tree. + cgen_maint=yes + if test -r ${enableval}/iformat.scm; then + # This looks like a cgen source tree. + cgendir=${enableval} + else + as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5 + fi ;; esac fi diff --git a/sim/iq2000/configure b/sim/iq2000/configure index 9486ef4a3d..92ed9c8b39 100755 --- a/sim/iq2000/configure +++ b/sim/iq2000/configure @@ -13678,11 +13678,17 @@ if test "${enable_cgen_maint+set}" = set; then : yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) - # argument is cgen install directory (not implemented yet). - # Having a `share' directory might be more appropriate for the .scm, - # .cpu, etc. files. - cgendir=${cgen_maint}/lib/cgen - cgen=guile + # Argument is a directory where cgen can be found. In some + # future world cgen could be installable, but right now this + # is not the case. Instead we assume the directory is a path + # to the cgen source tree. + cgen_maint=yes + if test -r ${enableval}/iformat.scm; then + # This looks like a cgen source tree. + cgendir=${enableval} + else + as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5 + fi ;; esac fi diff --git a/sim/lm32/configure b/sim/lm32/configure index 9624db3d83..748266d2e0 100755 --- a/sim/lm32/configure +++ b/sim/lm32/configure @@ -13678,11 +13678,17 @@ if test "${enable_cgen_maint+set}" = set; then : yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) - # argument is cgen install directory (not implemented yet). - # Having a `share' directory might be more appropriate for the .scm, - # .cpu, etc. files. - cgendir=${cgen_maint}/lib/cgen - cgen=guile + # Argument is a directory where cgen can be found. In some + # future world cgen could be installable, but right now this + # is not the case. Instead we assume the directory is a path + # to the cgen source tree. + cgen_maint=yes + if test -r ${enableval}/iformat.scm; then + # This looks like a cgen source tree. + cgendir=${enableval} + else + as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5 + fi ;; esac fi diff --git a/sim/m32r/configure b/sim/m32r/configure index 43c25a621f..8ce674c0e1 100755 --- a/sim/m32r/configure +++ b/sim/m32r/configure @@ -13680,11 +13680,17 @@ if test "${enable_cgen_maint+set}" = set; then : yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) - # argument is cgen install directory (not implemented yet). - # Having a `share' directory might be more appropriate for the .scm, - # .cpu, etc. files. - cgendir=${cgen_maint}/lib/cgen - cgen=guile + # Argument is a directory where cgen can be found. In some + # future world cgen could be installable, but right now this + # is not the case. Instead we assume the directory is a path + # to the cgen source tree. + cgen_maint=yes + if test -r ${enableval}/iformat.scm; then + # This looks like a cgen source tree. + cgendir=${enableval} + else + as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5 + fi ;; esac fi diff --git a/sim/or1k/configure b/sim/or1k/configure index 93aeb8f50d..1386585654 100755 --- a/sim/or1k/configure +++ b/sim/or1k/configure @@ -13788,11 +13788,17 @@ if test "${enable_cgen_maint+set}" = set; then : yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) - # argument is cgen install directory (not implemented yet). - # Having a `share' directory might be more appropriate for the .scm, - # .cpu, etc. files. - cgendir=${cgen_maint}/lib/cgen - cgen=guile + # Argument is a directory where cgen can be found. In some + # future world cgen could be installable, but right now this + # is not the case. Instead we assume the directory is a path + # to the cgen source tree. + cgen_maint=yes + if test -r ${enableval}/iformat.scm; then + # This looks like a cgen source tree. + cgendir=${enableval} + else + as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5 + fi ;; esac fi diff --git a/sim/sh64/configure b/sim/sh64/configure index 17a483329f..b02f835518 100755 --- a/sim/sh64/configure +++ b/sim/sh64/configure @@ -13678,11 +13678,17 @@ if test "${enable_cgen_maint+set}" = set; then : yes) cgen_maint=yes ;; no) cgen_maint=no ;; *) - # argument is cgen install directory (not implemented yet). - # Having a `share' directory might be more appropriate for the .scm, - # .cpu, etc. files. - cgendir=${cgen_maint}/lib/cgen - cgen=guile + # Argument is a directory where cgen can be found. In some + # future world cgen could be installable, but right now this + # is not the case. Instead we assume the directory is a path + # to the cgen source tree. + cgen_maint=yes + if test -r ${enableval}/iformat.scm; then + # This looks like a cgen source tree. + cgendir=${enableval} + else + as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5 + fi ;; esac fi