]>
Commit | Line | Data |
---|---|---|
760b3e8b MF |
1 | dnl Copyright (C) 1997-2021 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 --enable-sim-hardware is for users of the simulator | |
760b3e8b | 17 | AC_DEFUN([SIM_AC_OPTION_HARDWARE], |
be0387ee MF |
18 | [dnl |
19 | AC_MSG_CHECKING([for sim hardware settings]) | |
760b3e8b | 20 | AC_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 | 24 | sim_hw_sockser= |
760b3e8b | 25 | if test "$enable_sim_hardware" = no; then |
760b3e8b | 26 | sim_hw_cflags="-DWITH_HW=0" |
be0387ee | 27 | elif 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 |
39 | else |
40 | AC_MSG_ERROR([unknown argument "$enable_sim_hardware"]) | |
760b3e8b | 41 | fi |
be0387ee MF |
42 | dnl AM_CONDITIONAL([SIM_ENABLE_HW], [test "$enable_sim_hardware" = "yes"]) |
43 | if test "$enable_sim_hardware" = "yes"; then | |
44 | SIM_ENABLE_HW_TRUE= | |
45 | SIM_ENABLE_HW_FALSE='#' | |
46 | else | |
47 | SIM_ENABLE_HW_TRUE='#' | |
48 | SIM_ENABLE_HW_FALSE= | |
49 | fi | |
50 | AC_SUBST(SIM_ENABLE_HW_TRUE) | |
51 | AC_SUBST(SIM_ENABLE_HW_FALSE) | |
52 | AC_MSG_RESULT(${enable_sim_hardware}) | |
760b3e8b | 53 | AC_SUBST(sim_hw_cflags) |
be0387ee MF |
54 | AC_SUBST(sim_hw_sockser) |
55 | ]) |