Discussion:
[PATCH] sim/opcodes: Allow use of out of tree cgen source directory
Andrew Burgess
2018-10-10 16:02:46 UTC
Permalink
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.4
Nick Clifton
2018-10-16 16:32:59 UTC
Permalink
Hi Andrew,
Post by Andrew Burgess
* configure.ac (enable-cgen-maint): Support passing path to cgen
source tree.
* configure: Regenerate.
This part of the patch is approved.

Cheers
Nick
Andrew Burgess
2018-12-06 09:54:06 UTC
Permalink
Post by Nick Clifton
Hi Andrew,
Post by Andrew Burgess
* configure.ac (enable-cgen-maint): Support passing path to cgen
source tree.
* configure: Regenerate.
This part of the patch is approved.
I finally got approval for the sim/ parts of this patch on the
gdb-patches mailing list. However, there was some feedback and I
ended up changing the patch slightly.

For consistency I kept the opcodes/ and sim/ changes the same, the new
patch is below.

The changes is that support for using an "installed CGEN" is now
removed. There is no support (as far as I can tell) for "installing"
CGEN right now, I only left this code in originally to minimise the
changes I made, but it never really made sense. The feeling on the
gdb list was that if installing ever became a thing then we can just
add some suitable code back in the future.

I haven't pushed this yet, but given that its not _too_ different from
what was already approved, if I don't hear any objections in the next
few days, I'll push this.

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 389e5513cf9..eb74324ca8a 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 4c3698356bb..7384684bc06 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 abc15a93ac0..71a8841ab02 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 8ef9155d824..76f3c284e0b 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 934afd06cab..eeffc95c755 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 9486ef4a3d5..92ed9c8b395 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 9624db3d839..748266d2e05 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 43c25a621f3..8ce674c0e17 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 93aeb8f50dd..13865856547 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 17a483329ff..b02f835518a 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
--
2.14.5
Nick Clifton
2018-12-06 11:16:26 UTC
Permalink
Hi Andrew,
Post by Andrew Burgess
I haven't pushed this yet, but given that its not _too_ different from
what was already approved, if I don't hear any objections in the next
few days, I'll push this.
No objections from me. :-)

Cheers
Nick

Andrew Burgess
2018-10-23 10:15:30 UTC
Permalink
Ping! For the sim/ parts (Thanks Nick for the opcodes/ review).

Andrew
Post by Andrew Burgess
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
/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/'.
* configure.ac (enable-cgen-maint): Support passing path to cgen
source tree.
* configure: Regenerate.
* 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
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
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
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
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
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
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
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
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.4
Nick Clifton
2018-11-06 15:31:54 UTC
Permalink
Hi Andrew,
Post by Andrew Burgess
Ping! For the sim/ parts (Thanks Nick for the opcodes/ review).
The sim sources belong to the gdb project, not the binutils project,
so you probably need to send a patch to gdb-patches@ ...

Cheers
Nick
Loading...