Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: vapier@gentoo.org,	Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory
Date: Tue, 06 Nov 2018 17:35:00 -0000	[thread overview]
Message-ID: <0745ff244d76a8cd8ec7e7b9a53840f3773a139d.1541525137.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1541525136.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1541525136.git.andrew.burgess@embecosm.com>

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 improve on this code slightly 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       | 18 ++++++++++++++----
 opcodes/configure.ac    | 18 ++++++++++++++----
 sim/ChangeLog           | 12 ++++++++++++
 sim/common/acinclude.m4 | 20 +++++++++++++++-----
 sim/cris/configure      | 20 +++++++++++++++-----
 sim/frv/configure       | 20 +++++++++++++++-----
 sim/iq2000/configure    | 20 +++++++++++++++-----
 sim/lm32/configure      | 20 +++++++++++++++-----
 sim/m32r/configure      | 20 +++++++++++++++-----
 sim/or1k/configure      | 20 +++++++++++++++-----
 sim/sh64/configure      | 20 +++++++++++++++-----
 12 files changed, 166 insertions(+), 48 deletions(-)

diff --git a/opcodes/configure b/opcodes/configure
index 389e5513cf..28da5a6824 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -12574,11 +12574,21 @@ 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
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+	  cgendir=${enableval}/lib/cgen
+        fi
 	;;
 esac
 fi
diff --git a/opcodes/configure.ac b/opcodes/configure.ac
index 4c3698356b..9e48fedf9a 100644
--- a/opcodes/configure.ac
+++ b/opcodes/configure.ac
@@ -109,11 +109,21 @@ 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
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+	  cgendir=${enableval}/lib/cgen
+        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..aa68e52d0d 100644
--- a/sim/common/acinclude.m4
+++ b/sim/common/acinclude.m4
@@ -851,11 +851,21 @@ 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
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+	  cgendir=${enableval}/lib/cgen
+        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..3894a9586f 100755
--- a/sim/cris/configure
+++ b/sim/cris/configure
@@ -13912,11 +13912,21 @@ 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
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+	  cgendir=${enableval}/lib/cgen
+        fi
 	;;
 esac
 fi
diff --git a/sim/frv/configure b/sim/frv/configure
index 934afd06ca..a20a460abd 100755
--- a/sim/frv/configure
+++ b/sim/frv/configure
@@ -13681,11 +13681,21 @@ 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
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+	  cgendir=${enableval}/lib/cgen
+        fi
 	;;
 esac
 fi
diff --git a/sim/iq2000/configure b/sim/iq2000/configure
index 9486ef4a3d..f610141f72 100755
--- a/sim/iq2000/configure
+++ b/sim/iq2000/configure
@@ -13678,11 +13678,21 @@ 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
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+	  cgendir=${enableval}/lib/cgen
+        fi
 	;;
 esac
 fi
diff --git a/sim/lm32/configure b/sim/lm32/configure
index 9624db3d83..f400a956f5 100755
--- a/sim/lm32/configure
+++ b/sim/lm32/configure
@@ -13678,11 +13678,21 @@ 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
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+	  cgendir=${enableval}/lib/cgen
+        fi
 	;;
 esac
 fi
diff --git a/sim/m32r/configure b/sim/m32r/configure
index 43c25a621f..e17b3c2f62 100755
--- a/sim/m32r/configure
+++ b/sim/m32r/configure
@@ -13680,11 +13680,21 @@ 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
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+	  cgendir=${enableval}/lib/cgen
+        fi
 	;;
 esac
 fi
diff --git a/sim/or1k/configure b/sim/or1k/configure
index 93aeb8f50d..335ae8a542 100755
--- a/sim/or1k/configure
+++ b/sim/or1k/configure
@@ -13788,11 +13788,21 @@ 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
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+	  cgendir=${enableval}/lib/cgen
+        fi
 	;;
 esac
 fi
diff --git a/sim/sh64/configure b/sim/sh64/configure
index 17a483329f..89612913f6 100755
--- a/sim/sh64/configure
+++ b/sim/sh64/configure
@@ -13678,11 +13678,21 @@ 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
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+	  cgendir=${enableval}/lib/cgen
+        fi
 	;;
 esac
 fi
-- 
2.14.5


  reply	other threads:[~2018-11-06 17:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 17:35 [PATCH 0/2] Allow use of out-of-tree CGEN source Andrew Burgess
2018-11-06 17:35 ` Andrew Burgess [this message]
2018-11-26 21:07   ` [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory Simon Marchi
2018-11-27 11:21     ` Andrew Burgess
2018-11-27 19:47       ` Simon Marchi
2018-11-27 20:03         ` John Baldwin
2018-11-29 19:01           ` Tom Tromey
2018-11-27 20:27         ` Andrew Burgess
2018-11-27 20:31           ` Simon Marchi
2018-11-30 19:07   ` Andrew Burgess
2018-11-30 19:50     ` Tom Tromey
2018-11-06 17:35 ` [PATCH 2/2] sim/cris: Fix references to cgen cpu directory Andrew Burgess
2018-11-30 19:51   ` Tom Tromey
2018-11-26 15:17 ` [PATCH 0/2] Allow use of out-of-tree CGEN source Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0745ff244d76a8cd8ec7e7b9a53840f3773a139d.1541525137.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox