Home | History | Annotate | Line # | Download | only in m4
      1 dnl Copyright (C) 1997-2024 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
     17 AC_DEFUN([SIM_AC_OPTION_HARDWARE],
     18 [dnl
     19 AC_MSG_CHECKING([for sim hardware settings])
     20 AC_ARG_ENABLE(sim-hardware,
     21   [AS_HELP_STRING([--enable-sim-hardware],
     22 		  [Whether to enable hardware/device simulation])],
     23   ,[enable_sim_hardware="yes"])
     24 sim_hw_sockser=
     25 if test "$enable_sim_hardware" = no; then
     26   sim_hw_cflags="-DWITH_HW=0"
     27 elif test "$enable_sim_hardware" = yes; then
     28   sim_hw_cflags="-DWITH_HW=1"
     29   dnl TODO: We don't add dv-sockser to sim_hw as it is not a "real" device
     30   dnl that you instatiate.  Instead, other code will call into it directly.
     31   dnl At some point, we should convert it over.
     32   sim_hw_sockser="dv-sockser.o"
     33   sim_hw_cflags="$sim_hw_cflags -DHAVE_DV_SOCKSER"
     34 else
     35   AC_MSG_ERROR([unknown argument "$enable_sim_hardware"])
     36 fi
     37 AM_CONDITIONAL([SIM_ENABLE_HW], [test "$enable_sim_hardware" = "yes"])
     38 AC_MSG_RESULT(${enable_sim_hardware})
     39 SIM_HW_CFLAGS=$sim_hw_cflags
     40 AC_SUBST(SIM_HW_CFLAGS)
     41 SIM_HW_SOCKSER=$sim_hw_sockser
     42 AC_SUBST(SIM_HW_SOCKSER)
     43 ])
     44