]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/m4/sim_ac_option_profile.m4
sim: move sim-inline to the common code
[thirdparty/binutils-gdb.git] / sim / m4 / sim_ac_option_profile.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-profile
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 profiling
19dnl elements to enable. The latter is only supported on simulators that
20dnl use WITH_PROFILE.
21AC_DEFUN([SIM_AC_OPTION_PROFILE],
22[dnl
23AC_MSG_CHECKING([for sim profile settings])
24profile="1"
25sim_profile="-1"
26AC_ARG_ENABLE(sim-profile,
27[AS_HELP_STRING([--enable-sim-profile=opts], [Enable profiling flags])],
28[case "${enableval}" in
29 yes) profile="1" sim_profile="-1";;
30 no) profile="0" sim_profile="0";;
31 [[-0-9]]*)
32 profile="(${enableval})" sim_profile="(${enableval})";;
33 [[a-z]]*)
34 profile="1"
35 sim_profile=""
36 for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
37 if test x"$sim_profile" = x; then
38 sim_profile="(PROFILE_$x"
39 else
40 sim_profile="${sim_profile}|PROFILE_$x"
41 fi
42 done
43 sim_profile="$sim_profile)" ;;
44esac])dnl
45AC_DEFINE_UNQUOTED([PROFILE], [$profile], [Sim profile settings])
46AC_DEFINE_UNQUOTED([WITH_PROFILE], [$sim_profile], [Sim profile settings])
47AC_MSG_RESULT($sim_profile)
48])