]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim/opcodes: Allow use of out of tree cgen source directory
authorAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 10 Oct 2018 13:58:10 +0000 (14:58 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 6 Dec 2018 12:21:10 +0000 (12:21 +0000)
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.

12 files changed:
opcodes/ChangeLog
opcodes/configure
opcodes/configure.ac
sim/ChangeLog
sim/common/acinclude.m4
sim/cris/configure
sim/frv/configure
sim/iq2000/configure
sim/lm32/configure
sim/m32r/configure
sim/or1k/configure
sim/sh64/configure

index 753be9f1a3a92555d9abe9f04dd6243385c7aed3..5588e4b500e36c06daf42eeaae70c1b09ed30135 100644 (file)
@@ -1,3 +1,9 @@
+2018-12-06  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * configure.ac (enable-cgen-maint): Support passing path to cgen
+       source tree.
+       * configure: Regenerate.
+
 2018-12-06  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * disassembler.c (disassemble_init_for_target): Add RISC-V
index 389e5513cf9a5904b2a08541eef6c5c528007bd8..eb74324ca8ad5daf1a62e9051920b511c1a52b9b 100755 (executable)
@@ -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
index 4c3698356bbf8d81ab2f909d45b21fb6c9862a6d..7384684bc06bd8d19b92eaabc1f96e55755dda8f 100644 (file)
@@ -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)
index 8fdef08be9e770ac3d1625d4ccb00d01a9e04ff5..efd1f8837ecf679dac11ad39c1479f6358ee330f 100644 (file)
@@ -1,3 +1,15 @@
+2018-12-06  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * 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.
+
 2018-10-05  Stafford Horne  <shorne@gmail.com>
 
        * or1k/cpu.h: Regenerate.
index abc15a93ac04e832283a2082b7dfa77d84c7e8bb..71a8841ab02dabecce5604199389226b4ff35c9f 100644 (file)
@@ -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)
index 8ef9155d8241d317d6801c52d3cecf45aff648ba..76f3c284e0b2e9ecc22d10d4b7f1650248500be3 100755 (executable)
@@ -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
index 934afd06cab07c1dfef1352fec0634d9b25b353e..eeffc95c755fcc3db4930ab8af9ceb6b03aa8ea9 100755 (executable)
@@ -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
index 9486ef4a3d5abc8fbd0c9454799881e5a3f9e992..92ed9c8b395d82637d2ac0489655e35642f863d7 100755 (executable)
@@ -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
index 9624db3d83954b305bdea96bd56515c92c094f9c..748266d2e05253705b6271dfa9678d805763b33e 100755 (executable)
@@ -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
index 43c25a621f3ded894930e5409bf50932ae7b14d7..8ce674c0e17489dbc973ff10990ba296007cf8df 100755 (executable)
@@ -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
index 93aeb8f50dd8ab4866dca50fb94a7cef0962cda7..13865856547ed13ede68eceb2730f7a008ca6292 100755 (executable)
@@ -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
index 17a483329ff2ca53a145327215ccc2465160b3c4..b02f835518a72e2824e29c95c8caef6f44eeb1ce 100755 (executable)
@@ -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