[1/2] sim/opcodes: Allow use of out of tree cgen source directory
Commit Message
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(-)
Comments
On 2018-11-06 12:35, Andrew Burgess wrote:
> 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)
Just wondering, does the "else" part have any real-world use? Before
today, was there any reason to pass a path to --enable-cgen-maint ?
Simon
* Simon Marchi <simon.marchi@polymtl.ca> [2018-11-26 16:07:35 -0500]:
> On 2018-11-06 12:35, Andrew Burgess wrote:
> > 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)
>
> Just wondering, does the "else" part have any real-world use? Before today,
> was there any reason to pass a path to --enable-cgen-maint ?
Thanks for taking a look at this patch :)
Not as far as I can tell. I left it in just in case, but as far as I
can tell there's no way to "install" CGEN. I'd be happy to drop the
../lib/cgen references (the else block) completely, and then validate
that we have a CGEN source tree or error.... But the above seemed like
the least invasive change.
Andrew
On 2018-11-27 06:21, Andrew Burgess wrote:
> Not as far as I can tell. I left it in just in case, but as far as I
> can tell there's no way to "install" CGEN. I'd be happy to drop the
> ../lib/cgen references (the else block) completely, and then validate
> that we have a CGEN source tree or error.... But the above seemed like
> the least invasive change.
From what I understand from you description, there's no way it could
have been useful... but again, it's not hard to leave it there just to
be safe. It's not my decision anyway :).
By the way, maybe this should still be sent to binutils for the opcodes
part?
Simon
On 11/27/18 11:47 AM, Simon Marchi wrote:
> On 2018-11-27 06:21, Andrew Burgess wrote:
>> Not as far as I can tell. I left it in just in case, but as far as I
>> can tell there's no way to "install" CGEN. I'd be happy to drop the
>> ../lib/cgen references (the else block) completely, and then validate
>> that we have a CGEN source tree or error.... But the above seemed like
>> the least invasive change.
>
> From what I understand from you description, there's no way it could
> have been useful... but again, it's not hard to leave it there just to
> be safe. It's not my decision anyway :).
>
> By the way, maybe this should still be sent to binutils for the opcodes
> part?
My vote would actually be to remove it if it isn't really useful. If
someone really needs it in the future they can always dig it out of the
history.
* Simon Marchi <simon.marchi@polymtl.ca> [2018-11-27 14:47:31 -0500]:
> On 2018-11-27 06:21, Andrew Burgess wrote:
> > Not as far as I can tell. I left it in just in case, but as far as I
> > can tell there's no way to "install" CGEN. I'd be happy to drop the
> > ../lib/cgen references (the else block) completely, and then validate
> > that we have a CGEN source tree or error.... But the above seemed like
> > the least invasive change.
>
> From what I understand from you description, there's no way it could have
> been useful... but again, it's not hard to leave it there just to be safe.
> It's not my decision anyway :).
Right now I more worried that the only SIM maintained hasn't been seen
on either the GDB list or the binutils list in months, and despite
being included on the to/cc list, hasn't followed up on this mail.
Still, it's not been a month yet, so I'm sure it will all work itself
out :)
> By the way, maybe this should still be sent to binutils for the opcodes
> part?
I originally posted to the binutils list, and had the opcodes part
approved. They pointed out that the sim/ part needed to be posted
here.
Thanks,
Andrew
On 2018-11-27 15:27, Andrew Burgess wrote:
> * Simon Marchi <simon.marchi@polymtl.ca> [2018-11-27 14:47:31 -0500]:
>
>> On 2018-11-27 06:21, Andrew Burgess wrote:
>> > Not as far as I can tell. I left it in just in case, but as far as I
>> > can tell there's no way to "install" CGEN. I'd be happy to drop the
>> > ../lib/cgen references (the else block) completely, and then validate
>> > that we have a CGEN source tree or error.... But the above seemed like
>> > the least invasive change.
>>
>> From what I understand from you description, there's no way it could
>> have
>> been useful... but again, it's not hard to leave it there just to be
>> safe.
>> It's not my decision anyway :).
>
> Right now I more worried that the only SIM maintained hasn't been seen
> on either the GDB list or the binutils list in months, and despite
> being included on the to/cc list, hasn't followed up on this mail.
>
> Still, it's not been a month yet, so I'm sure it will all work itself
> out :)
>
>> By the way, maybe this should still be sent to binutils for the
>> opcodes
>> part?
>
> I originally posted to the binutils list, and had the opcodes part
> approved. They pointed out that the sim/ part needed to be posted
> here.
Ah sorry, I didn't catch it was already approved, good!
Simon
>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:
John> My vote would actually be to remove it if it isn't really useful. If
John> someone really needs it in the future they can always dig it out of the
John> history.
Me too, especially considering that this is written for a feature that
doesn't exist, and that nobody appears to be working on.
Tom
@@ -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
@@ -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)
@@ -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)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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