]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/m4/sim_ac_option_default_model.m4
115093734bc6ae9e0576d3957a5a19cb2aa7dd04
[thirdparty/binutils-gdb.git] / sim / m4 / sim_ac_option_default_model.m4
1 dnl Copyright (C) 1997-2021 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 The argument is the default model if none is specified.
17 AC_DEFUN([SIM_AC_OPTION_DEFAULT_MODEL],
18 [
19 default_sim_default_model="ifelse([$1],,0,[$1])"
20 AC_ARG_ENABLE(sim-default-model,
21 [AS_HELP_STRING([--enable-sim-default-model=model],
22 [Specify default model to simulate])],
23 [case "${enableval}" in
24 yes|no) AC_MSG_ERROR("Missing argument to --enable-sim-default-model");;
25 *) sim_default_model="-DWITH_DEFAULT_MODEL='\"${enableval}\"'";;
26 esac
27 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
28 echo "Setting default model = $sim_default_model" 6>&1
29 fi],[sim_default_model="-DWITH_DEFAULT_MODEL='\"${default_sim_default_model}\"'"])
30 ])
31 AC_SUBST(sim_default_model)