| 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | |
| 3 | dnl Copyright (C) 2005-2017 Free Software Foundation, Inc. |
| 4 | dnl Contributed by Red Hat, Inc. |
| 5 | dnl |
| 6 | dnl This file is part of the GNU simulators. |
| 7 | dnl |
| 8 | dnl This program is free software; you can redistribute it and/or modify |
| 9 | dnl it under the terms of the GNU General Public License as published by |
| 10 | dnl the Free Software Foundation; either version 3 of the License, or |
| 11 | dnl (at your option) any later version. |
| 12 | dnl |
| 13 | dnl This program is distributed in the hope that it will be useful, |
| 14 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | dnl GNU General Public License for more details. |
| 17 | dnl |
| 18 | dnl You should have received a copy of the GNU General Public License |
| 19 | dnl along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | dnl |
| 21 | AC_PREREQ(2.64)dnl |
| 22 | AC_INIT(Makefile.in) |
| 23 | sinclude(../common/acinclude.m4) |
| 24 | |
| 25 | SIM_AC_COMMON |
| 26 | |
| 27 | AC_CHECK_HEADERS(getopt.h) |
| 28 | |
| 29 | AC_ARG_ENABLE(cycle-accurate, |
| 30 | [AS_HELP_STRING([--disable-cycle-accurate], |
| 31 | [Disable cycle accurate simulation (faster runtime)])], |
| 32 | [case "${enableval}" in |
| 33 | yes | no) ;; |
| 34 | *) AC_MSG_ERROR(bad value ${enableval} given for --enable-cycle-accurate option) ;; |
| 35 | esac]) |
| 36 | |
| 37 | AC_ARG_ENABLE(cycle-stats, |
| 38 | [AS_HELP_STRING([--disable-cycle-stats], |
| 39 | [Disable cycle statistics (faster runtime)])], |
| 40 | [case "${enableval}" in |
| 41 | yes | no) ;; |
| 42 | *) AC_MSG_ERROR(bad value ${enableval} given for --enable-cycle-stats option) ;; |
| 43 | esac]) |
| 44 | |
| 45 | echo enable_cycle_accurate is $enable_cycle_accurate |
| 46 | echo enable_cycle_stats is $enable_cycle_stats |
| 47 | |
| 48 | if test "x${enable_cycle_accurate}" != xno; then |
| 49 | AC_DEFINE([CYCLE_ACCURATE], 1, [--enable-cycle-accurate]) |
| 50 | |
| 51 | if test "x${enable_cycle_stats}" != xno; then |
| 52 | AC_DEFINE([CYCLE_STATS], 1, [--enable-cycle-stats]) |
| 53 | fi |
| 54 | else |
| 55 | if test "x${enable_cycle_stats}" != xno; then |
| 56 | AC_ERROR([cycle-stats not available without cycle-accurate]) |
| 57 | fi |
| 58 | fi |
| 59 | |
| 60 | SIM_AC_OUTPUT |