sim: mips: merge mips64vr4300 with existing multi-run build
[binutils-gdb.git] / sim / m4 / sim_ac_option_environment.m4
1 dnl Copyright (C) 1997-2022 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 Additional SIM options that can (optionally) be configured
17 dnl For optional simulator options, a macro SIM_AC_OPTION_* is defined.
18 dnl Simulators that wish to use the relevant option specify the macro
19 dnl in the simulator specific configure.ac file between the SIM_AC_COMMON
20 dnl and SIM_AC_OUTPUT lines.
21 dnl
22 dnl Specify the running environment.
23 dnl If the simulator invokes this in its configure.ac then without this option
24 dnl the default is the user environment and all are runtime selectable.
25 dnl If the simulator doesn't invoke this, only the user environment is
26 dnl supported.
27 dnl ??? Until there is demonstrable value in doing something more complicated,
28 dnl let's not.
29 AC_DEFUN([SIM_AC_OPTION_ENVIRONMENT],
30 [
31 AC_MSG_CHECKING([default sim environment setting])
32 sim_environment="ALL_ENVIRONMENT"
33 AC_ARG_ENABLE(sim-environment,
34 [AS_HELP_STRING([--enable-sim-environment=environment],
35 [Specify mixed, user, virtual or operating environment])],
36 [case "${enableval}" in
37 all | ALL) sim_environment="ALL_ENVIRONMENT";;
38 user | USER) sim_environment="USER_ENVIRONMENT";;
39 virtual | VIRTUAL) sim_environment="VIRTUAL_ENVIRONMENT";;
40 operating | OPERATING) sim_environment="OPERATING_ENVIRONMENT";;
41 *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-environment]);;
42 esac])dnl
43 AC_DEFINE_UNQUOTED([WITH_ENVIRONMENT], [$sim_environment], [Sim default environment])
44 AC_MSG_RESULT($sim_environment)
45 ])