]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/m4/sim_ac_option_hardware.m4
sim: hw: rework configure option & device selection
[thirdparty/binutils-gdb.git] / sim / m4 / sim_ac_option_hardware.m4
CommitLineData
760b3e8b
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-hardware is for users of the simulator
760b3e8b 17AC_DEFUN([SIM_AC_OPTION_HARDWARE],
be0387ee
MF
18[dnl
19AC_MSG_CHECKING([for sim hardware settings])
760b3e8b 20AC_ARG_ENABLE(sim-hardware,
be0387ee
MF
21 [AS_HELP_STRING([--enable-sim-hardware],
22 [Whether to enable hardware/device simulation])],
9d903352 23 ,[enable_sim_hardware="yes"])
be0387ee 24sim_hw_sockser=
760b3e8b 25if test "$enable_sim_hardware" = no; then
760b3e8b 26 sim_hw_cflags="-DWITH_HW=0"
be0387ee 27elif test "$enable_sim_hardware" = yes; then
760b3e8b 28 sim_hw_cflags="-DWITH_HW=1"
760b3e8b
MF
29 # mingw does not support sockser
30 case ${host} in
31 *mingw*) ;;
32 *) # TODO: We don't add dv-sockser to sim_hw as it is not a "real" device
33 # that you instatiate. Instead, other code will call into it directly.
34 # At some point, we should convert it over.
be0387ee 35 sim_hw_sockser="dv-sockser.o"
bcaa61f7 36 sim_hw_cflags="$sim_hw_cflags -DHAVE_DV_SOCKSER"
760b3e8b
MF
37 ;;
38 esac
be0387ee
MF
39else
40 AC_MSG_ERROR([unknown argument "$enable_sim_hardware"])
760b3e8b 41fi
be0387ee
MF
42dnl AM_CONDITIONAL([SIM_ENABLE_HW], [test "$enable_sim_hardware" = "yes"])
43if test "$enable_sim_hardware" = "yes"; then
44 SIM_ENABLE_HW_TRUE=
45 SIM_ENABLE_HW_FALSE='#'
46else
47 SIM_ENABLE_HW_TRUE='#'
48 SIM_ENABLE_HW_FALSE=
49fi
50AC_SUBST(SIM_ENABLE_HW_TRUE)
51AC_SUBST(SIM_ENABLE_HW_FALSE)
52AC_MSG_RESULT(${enable_sim_hardware})
760b3e8b 53AC_SUBST(sim_hw_cflags)
be0387ee
MF
54AC_SUBST(sim_hw_sockser)
55])