sim: mips: merge mips64vr4300 with existing multi-run build
[binutils-gdb.git] / sim / m4 / sim_ac_option_cgen_maint.m4
1 dnl Copyright (C) 1997-2022 Free Software Foundation, Inc.
2 dnl
3 dnl This program is free software; you can redistribute it and/or modify
4 dnl it under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation; either version 3 of the License, or
6 dnl (at your option) any later version.
7 dnl
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 dnl GNU General Public License for more details.
12 dnl
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
15 dnl
16 dnl --enable-cgen-maint support
17 AC_DEFUN([SIM_AC_OPTION_CGEN_MAINT],
18 [
19 cgen_maint=no
20 dnl Default is to use one in build tree.
21 cgen=guile
22 cgendir='$(srcdir)/../../cgen'
23 dnl Having --enable-maintainer-mode take arguments is another way to go.
24 dnl ??? One can argue --with is more appropriate if one wants to specify
25 dnl a directory name, but what we're doing here is an enable/disable kind
26 dnl of thing and specifying both --enable and --with is klunky.
27 dnl If you reeely want this to be --with, go ahead and change it.
28 AC_ARG_ENABLE(cgen-maint,
29 [AS_HELP_STRING([--enable-cgen-maint[=DIR]], [build cgen generated files])],
30 [case "${enableval}" in
31 yes) cgen_maint=yes ;;
32 no) cgen_maint=no ;;
33 *)
34 # Argument is a directory where cgen can be found. In some
35 # future world cgen could be installable, but right now this
36 # is not the case. Instead we assume the directory is a path
37 # to the cgen source tree.
38 cgen_maint=yes
39 if test -r ${enableval}/iformat.scm; then
40 # This looks like a cgen source tree.
41 cgendir=${enableval}
42 else
43 AC_MSG_ERROR(${enableval} doesn't look like a cgen source tree)
44 fi
45 ;;
46 esac])dnl
47 dnl AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} != xno)
48 if test x${cgen_maint} != xno ; then
49 CGEN_MAINT=''
50 else
51 CGEN_MAINT='#'
52 fi
53 AC_SUBST(CGEN_MAINT)
54 AC_SUBST(cgendir)
55 AC_SUBST(cgen)
56 ])