sim: hw: rework configure option & device selection
[deliverable/binutils-gdb.git] / sim / m4 / sim_ac_option_trace.m4
CommitLineData
497a20bd
MF
1dnl Copyright (C) 1997-2021 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-trace is for users of the simulator
17dnl The argument is either a bitmask of things to enable [exactly what is
18dnl up to the simulator], or is a comma separated list of names of tracing
19dnl elements to enable. The latter is only supported on simulators that
20dnl use WITH_TRACE. Default to all tracing but internal debug.
21AC_DEFUN([SIM_AC_OPTION_TRACE],
22[dnl
23AC_MSG_CHECKING([for sim trace settings])
24sim_trace="~TRACE_debug"
25AC_ARG_ENABLE(sim-trace,
26[AS_HELP_STRING([--enable-sim-trace=opts],
27 [Enable tracing of simulated programs])],
28[case "${enableval}" in
29 yes) sim_trace="-1";;
30 no) sim_trace="0";;
31 [[-0-9]]*)
32 sim_trace="'(${enableval})'";;
33 [[[:lower:]]]*)
34 sim_trace=""
35 for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
36 if test x"$sim_trace" = x; then
37 sim_trace="(TRACE_$x"
38 else
39 sim_trace="${sim_trace}|TRACE_$x"
40 fi
41 done
42 sim_trace="$sim_trace)" ;;
43esac])dnl
44AC_DEFINE_UNQUOTED([WITH_TRACE], [$sim_trace], [Sim trace settings])
45AC_MSG_RESULT($sim_trace)
46])
This page took 0.025058 seconds and 4 git commands to generate.