sim_ac_option_assert.m4 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. dnl Copyright (C) 1997-2022 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 Conditionally compile in assertion statements.
  17. AC_DEFUN([SIM_AC_OPTION_ASSERT],
  18. [
  19. AC_MSG_CHECKING([whether to enable sim asserts])
  20. sim_assert="1"
  21. AC_ARG_ENABLE(sim-assert,
  22. [AS_HELP_STRING([--enable-sim-assert],
  23. [Specify whether to perform random assertions])],
  24. [case "${enableval}" in
  25. yes) sim_assert="1";;
  26. no) sim_assert="0";;
  27. *) AC_MSG_ERROR([--enable-sim-assert does not take a value]);;
  28. esac])dnl
  29. AC_DEFINE_UNQUOTED([WITH_ASSERT], [$sim_assert], [Sim assert settings])
  30. AC_MSG_RESULT($sim_assert)
  31. ])