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] Enable sim-hw by default? ("yes" or "no")
18 dnl arg[2] is a space separated list of devices that override the defaults
19 dnl arg[3] is a space separated list of extra target specific devices.
20 AC_DEFUN([SIM_AC_OPTION_HARDWARE],
25 hardware="cfi core pal glue"
27 hardware="$hardware [$3]"
29 sim_hw_cflags="-DWITH_HW=1"
31 sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([[^ ]][[^ ]]*\)/dv-\1.o/g'`"
33 AC_ARG_ENABLE(sim-hardware,
34 [AS_HELP_STRING([--enable-sim-hardware=LIST],
35 [Specify the hardware to be included in the build.])],
36 ,[enable_sim_hardware="[$1]"])
37 case ${enable_sim_hardware} in
39 ,*) hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
40 *,) hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
41 *) hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
44 if test "$enable_sim_hardware" = no; then
46 sim_hw_cflags="-DWITH_HW=0"
49 sim_hw_cflags="-DWITH_HW=1"
52 sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
53 for i in $hardware ; do
56 *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
59 # mingw does not support sockser
62 *) # TODO: We don't add dv-sockser to sim_hw as it is not a "real" device
63 # that you instatiate. Instead, other code will call into it directly.
64 # At some point, we should convert it over.
65 sim_hw_objs="$sim_hw_objs dv-sockser.o"
67 [HAVE_DV_SOCKSER], 1, [Define if dv-sockser is usable.])
70 if test x"$silent" != x"yes"; then
71 echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
73 dnl Some devices require extra libraries.
75 *" cfi "*) AC_CHECK_LIB(m, log2);;
79 AC_SUBST(sim_hw_cflags)