Remove path name from test case
[binutils-gdb.git] / sim / m4 / sim_ac_option_cgen_maint.m4
1 dnl Copyright (C) 1997-2023 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 if test -r ${srcdir}/../cgen/iformat.scm; then
24 cgendir='$(srcdir)/../cgen'
25 fi
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 ;;
35 no) cgen_maint=no ;;
36 *)
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.
41 cgen_maint=yes
42 if test -r ${enableval}/iformat.scm; then
43 # This looks like a cgen source tree.
44 cgendir=${enableval}
45 else
46 AC_MSG_ERROR(${enableval} doesn't look like a cgen source tree)
47 fi
48 ;;
49 esac])dnl
50 dnl AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} != xno)
51 if test x${cgen_maint} != xno ; then
52 CGEN_MAINT=''
53 else
54 CGEN_MAINT='#'
55 fi
56 AC_SUBST(CGEN_MAINT)
57 AC_SUBST(cgendir)
58 AC_SUBST(cgen)
59 ])