1 dnl Copyright (C) 1997-2021 Free Software Foundation, Inc.
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.
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.
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/>.
16 dnl --enable-sim-hardware is for users of the simulator
17 dnl arg[1] is a space separated list of extra target specific devices.
18 AC_DEFUN([SIM_AC_OPTION_HARDWARE],
20 hardware="cfi core pal glue [$1]"
21 sim_hw_cflags="-DWITH_HW=1"
23 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([[^ ]][[^ ]]*\)/dv-\1.o/g'`"
25 AC_ARG_ENABLE(sim-hardware,
26 [AS_HELP_STRING([--enable-sim-hardware=LIST],
27 [Specify the hardware to be included in the build.])],
28 ,[enable_sim_hardware="yes"])
29 case ${enable_sim_hardware} in
31 ,*) hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
32 *,) hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
33 *) hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
36 if test "$enable_sim_hardware" = no; then
38 sim_hw_cflags="-DWITH_HW=0"
41 sim_hw_cflags="-DWITH_HW=1"
44 sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
45 for i in $hardware ; do
48 *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
51 # mingw does not support sockser
54 *) # TODO: We don't add dv-sockser to sim_hw as it is not a "real" device
55 # that you instatiate. Instead, other code will call into it directly.
56 # At some point, we should convert it over.
57 sim_hw_objs="$sim_hw_objs dv-sockser.o"
58 sim_hw_cflags="$sim_hw_cflags -DHAVE_DV_SOCKSER"
61 if test x"$silent" != x"yes"; then
62 echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
66 AC_SUBST(sim_hw_cflags)