xref: /netbsd-src/external/gpl3/gdb/dist/sim/m4/sim_ac_option_debug.m4 (revision 345cf9fb81bd0411c53e25d62cd93bdcaa865312)
1dnl Copyright (C) 1997-2023 Free Software Foundation, Inc.
2dnl
3dnl This program is free software; you can redistribute it and/or modify
4dnl it under the terms of the GNU General Public License as published by
5dnl the Free Software Foundation; either version 3 of the License, or
6dnl (at your option) any later version.
7dnl
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11dnl GNU General Public License for more details.
12dnl
13dnl You should have received a copy of the GNU General Public License
14dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
15dnl
16dnl --enable-sim-debug is for developers of the simulator
17dnl the allowable values are work-in-progress
18AC_DEFUN([SIM_AC_OPTION_DEBUG],
19[dnl
20AC_MSG_CHECKING([for sim debug setting])
21sim_debug="0"
22AC_ARG_ENABLE(sim-debug,
23[AS_HELP_STRING([--enable-sim-debug=opts],
24		[Enable debugging flags (for developers of the sim itself)])],
25[case "${enableval}" in
26  yes) sim_debug="7";;
27  no)  sim_debug="0";;
28  *)   sim_debug="($enableval)";;
29esac])dnl
30if test "$sim_debug" != "0"; then
31  AC_DEFINE_UNQUOTED([DEBUG], [$sim_debug], [Sim debug setting])
32fi
33AC_DEFINE_UNQUOTED([WITH_DEBUG], [$sim_debug], [Sim debug setting])
34AC_MSG_RESULT($sim_debug)
35])
36