1 dnl Copyright (C) 1997-2024 Free Software Foundation, Inc.
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.
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.
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/>.
16 dnl --enable-sim-inline is for users that wish to ramp up the simulator's
17 dnl performance by inlining functions.
18 dnl Default sims to no inlining.
19 AC_DEFUN([SIM_AC_OPTION_INLINE],
21 AC_MSG_CHECKING([sim inline settings])
22 sim_inline="-DDEFAULT_INLINE=m4_ifblank([$1],[0],[$1])"
23 AC_ARG_ENABLE(sim-inline,
24 [AS_HELP_STRING([--enable-sim-inline=inlines],
25 [Specify which functions should be inlined])],
28 no) sim_inline="-DDEFAULT_INLINE=0";;
29 0) sim_inline="-DDEFAULT_INLINE=0";;
30 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_C_INLINE";;
31 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
32 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
35 *_INLINE=*) new_flag="-D$x";;
36 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
37 *_INLINE) new_flag="-D$x=ALL_C_INLINE";;
38 *) new_flag="-D$x""_INLINE=ALL_C_INLINE";;
40 if test x"$sim_inline" = x""; then
41 sim_inline="$new_flag"
43 sim_inline="$sim_inline $new_flag"
48 AC_MSG_RESULT([$sim_inline])
49 SIM_INLINE=$sim_inline