1 dnl Process this file with autoconf to produce a configure script.
5 AC_ARG_ENABLE(sim-cflags,
6 [ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
7 [case "${enableval}" in
8 yes) sim_cflags="-O2 -fomit-frame-pointer";;
10 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
11 esac],[sim_cflags=""])dnl
13 AC_ARG_ENABLE(sim-warnings,
14 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o and semantics.o],
15 [case "${enableval}" in
16 yes) sim_warnings="-Wall";;
17 no) sim_warnings="-w";;
18 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
19 esac],[sim_warnings=""])dnl
21 AC_ARG_ENABLE(sim-config,
22 [ --enable-sim-config=file Override default config file],
23 [case "${enableval}" in
24 yes) sim_config="std-config.h";;
25 no) sim_config="std-config.h";;
26 *) sim_config="${enableval}";;
27 esac],[sim_config="std-config.h]")dnl
29 AC_ARG_ENABLE(sim-opcode,
30 [ --enable-sim-opcode=which Override default opcode lookup.],
31 [case "${enableval}" in
32 yes) sim_opcode="ppc-opcode-simple";;
33 no) sim_opcode="ppc-opcode-simple";;
34 *) sim_opcode="ppc-opcode-${enableval}";;
35 esac],[sim_opcode="ppc-opcode-simple"])dnl
37 AC_ARG_ENABLE(sim-switch,
38 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
39 [case "${enableval}" in
40 yes) sim_switch="-s";;
42 esac],[sim_switch=""])dnl
44 AC_ARG_ENABLE(sim-duplicate,
45 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
46 [case "${enableval}" in
49 esac],[sim_dup=""])dnl
51 AC_ARG_ENABLE(sim-filter,
52 [ --enable-sim-filter=rule Specify filter rules.],
53 [case "${enableval}" in
55 *) sim_filter="-f $enableval";;
56 esac],[sim_filter="-f 64"])dnl
58 AC_ARG_ENABLE(sim-icache,
59 [ --enable-sim-icache=size Specify instruction cache size.],
60 [case "${enableval}" in
61 yes) sim_icache="-r 1024";;
63 esac],[sim_icache=""])dnl
65 AC_ARG_ENABLE(sim-inline,
66 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
70 0) sim_inline="-DDEFAULT_INLINE=0";;
71 yes | 2) sim_inline="-DDEFAULT_INLINE=2";;
72 1) sim_inline="-DDEFAULT_INLINE=1";;
73 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
76 *_INLINE=*) new_flag="-D$x";;
77 *_INLINE) new_flag="-D$x=2";;
78 *=*) new_flag=`sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
79 *) new_flag="-D$x""_INLINE=2";;
81 if x"$sim_inline" = x""; then
82 sim_inline="$new_flag"
84 sim_inline="$flags $new_flag"
87 esac],[sim_inline=""])dnl
89 AC_ARG_ENABLE(sim-bswap,
90 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
91 [case "${enableval}" in
92 yes) sim_bswap="-DWITH_BSWAP=1";;
93 no) sim_bswap="-DWITH_BSWAP=0";;
95 esac],[sim_bswap=""])dnl
97 AC_ARG_ENABLE(sim-endian,
98 [ --enable-sim-endian=endian Specify target byte endian orientation.],
99 [case "${enableval}" in
100 yes) case "$target" in
101 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
102 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
103 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
105 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
106 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
107 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
109 esac],[sim_endian=""])dnl
111 AC_ARG_ENABLE(sim-hostendian,
112 [ --enable-sim-hostendain=end Specify host byte endian orientation.],
113 [case "${enableval}" in
114 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
115 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
116 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
117 *) sim_hostendian="";;
118 esac],[sim_hostendian=""])dnl
120 AC_ARG_ENABLE(sim-smp,
121 [ --enable-sim-smp=n Specify number of processors to configure for.],
122 [case "${enableval}" in
123 yes) sim_smp="-DWITH_SMP=2";;
124 no) sim_smp="-DWITH_SMP=0";;
125 *) sim_smp="-DWITH_SMP=$enableval";;
126 esac],[sim_smp=""])dnl
128 AC_ARG_ENABLE(sim-bitsize,
129 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
130 [case "${enableval}" in
131 yes) sim_bitsize="";;
133 *) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
134 esac],[sim_bitsize=""])dnl
136 AC_ARG_ENABLE(sim-hostbitsize,
137 [ --enable-sim-hostbitsize=n Specify host bitsize (32 or 64).],
138 [case "${enableval}" in
139 yes) sim_hostbitsize="";;
140 no) sim_hostbitsize="";;
141 *) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
142 esac],[sim_hostbitsize=""])dnl
144 AC_ARG_ENABLE(sim-env,
145 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
146 [case "${enableval}" in
147 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
148 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
149 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
151 esac],[sim_env=""])dnl
153 AC_ARG_ENABLE(sim-timebase,
154 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
155 [case "${enableval}" in
156 yes) sim_timebase="-DWITH_TIME_BASE=1";;
157 no) sim_timebase="-DWITH_TIME_BASE=0";;
159 esac],[sim_timebase=""])dnl
161 AC_ARG_ENABLE(sim-alignment,
162 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
163 [case "${enableval}" in
164 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
165 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NOSTRICT_ALIGNMENT";;
166 *) sim_alignment="-DWITH_ALIGNMENT=$enableval";;
167 esac],[sim_alignment=""])dnl
169 AC_ARG_ENABLE(sim-trace,
170 [ --enable-sim-trace Specify whether tracing is supported.],
171 [case "${enableval}" in
172 yes) sim_trace="-DWITH_TRACE=1";;
173 no) sim_trace="-DWITH_TRACE=0";;
175 esac],[sim_trace=""])dnl
177 AC_ARG_ENABLE(sim-assert,
178 [ --enable-sim-assert Specify whether to perform random assertions.],
179 [case "${enableval}" in
180 yes) sim_assert="-DWITH_ASSERT=1";;
181 no) sim_assert="-DWITH_ASSERT=0";;
183 esac],[sim_assert=""])dnl
185 AC_ARG_ENABLE(sim-float,
186 [ --enable-sim-float Specify whether to use host floating point or simulate.],
187 [case "${enableval}" in
188 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
189 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
191 esac],[sim_float=""])dnl
193 AC_ARG_ENABLE(sim-monitor,
194 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
195 [case "${enableval}" in
196 yes) sim_mon="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
197 no) sim_mon="-DWITH_MON=0";;
198 instruction) sim_mon="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
199 memory) sim_mon="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
200 *) sim_mon="-DWITH_MON='$enableval'";;
201 esac],[sim_float=""])dnl
203 AC_ARG_ENABLE(sim-function-unit,
204 [ --enable-sim-function-unit Specify whether detailed functional unit support is built.],
205 [case "${enableval}" in
206 yes) sim_func="-DWITH_FUNCTION_UNIT=1";;
207 no) sim_func="-DWITH_FUNCTION_UNIT=0";;
209 esac],[sim_func=""])dnl
211 AC_ARG_ENABLE(sim-model,
212 [ --enable-sim-model=which Specify PowerPC to model.],
213 [case "${enableval}" in
216 *) sim_model="-DWITH_PPC_MODEL=${enableval}";;
217 esac],[sim_model=""])dnl
219 AC_ARG_ENABLE(sim-default-model,
220 [ --enable-sim-default-model=which Specify default PowerPC to model.],
221 [case "${enableval}" in
222 yes) sim_default_model="";;
223 no) sim_default_model="";;
224 *) sim_default_model="-DWITH_DEFAULT_PPC_MODEL=${enableval}";;
225 esac],[sim_model=""])dnl
227 AC_CONFIG_HEADER(config.h:config.in)
229 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
233 . ${srcdir}/../../bfd/configure.host
242 AC_SUBST(sim_warnings)
252 AC_SUBST(sim_hostendian)
254 AC_SUBST(sim_bitsize)
255 AC_SUBST(sim_hostbitsize)
257 AC_SUBST(sim_timebase)
258 AC_SUBST(sim_alignment)
262 AC_SUBST(sim_monitor)
265 AC_SUBST(sim_default_model)
267 AC_CHECK_FUNCS(getrusage)
269 # Put a plausible default for CC_FOR_BUILD in Makefile.
271 if test "x$cross_compiling" = "xno"; then
276 AC_SUBST(CC_FOR_BUILD)
278 AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/times.h unistd.h sys/resource.h)
281 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])