sim_ac_option_debug.m4 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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 --enable-sim-debug is for developers of the simulator
  17. dnl the allowable values are work-in-progress
  18. AC_DEFUN([SIM_AC_OPTION_DEBUG],
  19. [dnl
  20. AC_MSG_CHECKING([for sim debug setting])
  21. sim_debug="0"
  22. AC_ARG_ENABLE(sim-debug,
  23. [AS_HELP_STRING([--enable-sim-debug=opts],
  24. [Enable debugging flags (for developers of the sim itself)])],
  25. [case "${enableval}" in
  26. yes) sim_debug="7";;
  27. no) sim_debug="0";;
  28. *) sim_debug="($enableval)";;
  29. esac])dnl
  30. if test "$sim_debug" != "0"; then
  31. AC_DEFINE_UNQUOTED([DEBUG], [$sim_debug], [Sim debug setting])
  32. fi
  33. AC_DEFINE_UNQUOTED([WITH_DEBUG], [$sim_debug], [Sim debug setting])
  34. AC_MSG_RESULT($sim_debug)
  35. ])