1 dnl Copyright (C) 1997-2024 Free Software Foundation, Inc.
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.
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.
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/>.
16 dnl --enable-cgen-maint support
17 AC_DEFUN([SIM_AC_OPTION_CGEN_MAINT],
20 dnl Default is to use one in build tree.
22 cgendir='$(srcdir)/../../cgen'
23 if test -r ${srcdir}/../cgen/iformat.scm; then
24 cgendir='$(srcdir)/../cgen'
26 dnl Having --enable-maintainer-mode take arguments is another way to go.
27 dnl ??? One can argue --with is more appropriate if one wants to specify
28 dnl a directory name, but what we're doing here is an enable/disable kind
29 dnl of thing and specifying both --enable and --with is klunky.
30 dnl If you reeely want this to be --with, go ahead and change it.
31 AC_ARG_ENABLE(cgen-maint,
32 [AS_HELP_STRING([--enable-cgen-maint[=DIR]], [build cgen generated files])],
33 [case "${enableval}" in
34 yes) cgen_maint=yes ;;
37 # Argument is a directory where cgen can be found. In some
38 # future world cgen could be installable, but right now this
39 # is not the case. Instead we assume the directory is a path
40 # to the cgen source tree.
42 if test -r ${enableval}/iformat.scm; then
43 # This looks like a cgen source tree.
46 AC_MSG_ERROR(${enableval} doesn't look like a cgen source tree)
50 dnl AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} != xno)
51 if test x${cgen_maint} != xno ; then