]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/m4/sim_ac_option_hardware.m4
Automatic date update in version.in
[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
9d903352 17dnl arg[1] is a space separated list of extra target specific devices.
760b3e8b
MF
18AC_DEFUN([SIM_AC_OPTION_HARDWARE],
19[
9d903352 20hardware="cfi core pal glue [$1]"
760b3e8b
MF
21sim_hw_cflags="-DWITH_HW=1"
22sim_hw="$hardware"
23sim_hw_objs="\$(SIM_COMMON_HW_OBJS) `echo $sim_hw | sed -e 's/\([[^ ]][[^ ]]*\)/dv-\1.o/g'`"
24
25AC_ARG_ENABLE(sim-hardware,
26 [AS_HELP_STRING([--enable-sim-hardware=LIST],
27 [Specify the hardware to be included in the build.])],
9d903352 28 ,[enable_sim_hardware="yes"])
760b3e8b
MF
29case ${enable_sim_hardware} in
30 yes|no) ;;
31 ,*) hardware="${hardware} `echo ${enableval} | sed -e 's/,/ /'`";;
32 *,) hardware="`echo ${enableval} | sed -e 's/,/ /'` ${hardware}";;
33 *) hardware="`echo ${enableval} | sed -e 's/,/ /'`"'';;
34esac
35
36if test "$enable_sim_hardware" = no; then
37 sim_hw_objs=
38 sim_hw_cflags="-DWITH_HW=0"
39 sim_hw=
40else
41 sim_hw_cflags="-DWITH_HW=1"
42 # remove duplicates
43 sim_hw=""
44 sim_hw_objs="\$(SIM_COMMON_HW_OBJS)"
45 for i in $hardware ; do
46 case " $sim_hw " in
47 *" $i "*) ;;
48 *) sim_hw="$sim_hw $i" ; sim_hw_objs="$sim_hw_objs dv-$i.o";;
49 esac
50 done
51 # mingw does not support sockser
52 case ${host} in
53 *mingw*) ;;
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"
bcaa61f7 58 sim_hw_cflags="$sim_hw_cflags -DHAVE_DV_SOCKSER"
760b3e8b
MF
59 ;;
60 esac
61 if test x"$silent" != x"yes"; then
62 echo "Setting hardware to $sim_hw_cflags, $sim_hw, $sim_hw_objs"
63 fi
760b3e8b
MF
64fi
65])
66AC_SUBST(sim_hw_cflags)
67AC_SUBST(sim_hw_objs)
68AC_SUBST(sim_hw)