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"`;;
12 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
13 echo "Setting sim cflags = $sim_cflags" 6>&1
14 fi],[sim_cflags=""])dnl
16 AC_ARG_ENABLE(sim-warnings,
17 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
18 [case "${enableval}" in
19 yes) sim_warnings="-Wall -Wpointer-arith -Wbad-function-cast -Wmissing-prototypes -Wmissing-declarations";;
20 no) sim_warnings="-w";;
21 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
23 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
24 echo "Setting warning flags = $sim_warnings" 6>&1
25 fi],[sim_warnings=""])dnl
27 AC_ARG_ENABLE(sim-config,
28 [ --enable-sim-config=file Override default config file],
29 [case "${enableval}" in
30 yes) sim_config="std-config.h";;
31 no) sim_config="std-config.h";;
32 *) sim_config="${enableval}";;
34 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
35 echo "Setting config flags = $sim_config" 6>&1
36 fi],[sim_config="std-config.h"; echo "Setting config flags = $sim_config" 6>&1])dnl
38 AC_ARG_ENABLE(sim-opcode,
39 [ --enable-sim-opcode=which Override default opcode lookup.],
40 [case "${enableval}" in
41 yes) sim_opcode="ppc-opcode-simple";;
42 no) sim_opcode="ppc-opcode-simple";;
43 *) sim_opcode="ppc-opcode-${enableval}";;
45 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
46 echo "Setting opcode flags = $sim_opcode" 6>&1
47 fi],[sim_opcode="ppc-opcode-simple"; echo "Setting opcode flags = $sim_opcode"])dnl
49 AC_ARG_ENABLE(sim-switch,
50 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
51 [case "${enableval}" in
52 yes) sim_switch="-s";;
55 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
56 echo "Setting switch flags = $sim_switch" 6>&1
58 if test x"$silent" != x"yes"; then
59 echo "Setting switch flags = $sim_switch" 6>&1
62 AC_ARG_ENABLE(sim-duplicate,
63 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
64 [case "${enableval}" in
68 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
69 echo "Setting duplicate flags = $sim_dup" 6>&1
71 if test x"$silent" != x"yes"; then
72 echo "Setting duplicate flags = $sim_dup" 6>&1
75 AC_ARG_ENABLE(sim-filter,
76 [ --enable-sim-filter=rule Specify filter rules.],
77 [case "${enableval}" in
79 *) sim_filter="-f $enableval";;
81 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
82 echo "Setting filter flags = $sim_filter" 6>&1
83 fi],[sim_filter="-f 64"
84 if test x"$silent" != x"yes"; then
85 echo "Setting filter flags = $sim_filter" 6>&1
88 AC_ARG_ENABLE(sim-icache,
89 [ --enable-sim-icache=size Specify instruction cache size.],
90 [case "${enableval}" in
91 yes) sim_icache="-r 1024";;
93 esac],[sim_icache=""])dnl
95 AC_ARG_ENABLE(sim-inline,
96 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
100 0) sim_inline="-DDEFAULT_INLINE=0";;
101 yes | 2) sim_inline="-DDEFAULT_INLINE=2";;
102 1) sim_inline="-DDEFAULT_INLINE=1";;
103 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
106 *_INLINE=*) new_flag="-D$x";;
107 *_INLINE) new_flag="-D$x=2";;
108 *=*) new_flag=`sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
109 *) new_flag="-D$x""_INLINE=2";;
111 if x"$sim_inline" = x""; then
112 sim_inline="$new_flag"
114 sim_inline="$flags $new_flag"
118 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
119 echo "Setting inline flags = $sim_inline" 6>&1
120 fi],[if test x"$GCC" != ""; then
121 sim_inline="-DDEFAULT_INLINE=1"
122 if test x"$silent" != x"yes"; then
123 echo "Setting inline flags = $sim_inline" 6>&1
129 AC_ARG_ENABLE(sim-bswap,
130 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
131 [case "${enableval}" in
132 yes) sim_bswap="-DWITH_BSWAP=1";;
133 no) sim_bswap="-DWITH_BSWAP=0";;
136 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
137 echo "Setting bswap flags = $sim_bswap" 6>&1
138 fi],[sim_bswap=""])dnl
140 AC_ARG_ENABLE(sim-endian,
141 [ --enable-sim-endian=endian Specify target byte endian orientation.],
142 [case "${enableval}" in
143 yes) case "$target" in
144 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
145 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
146 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
148 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
149 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
150 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
153 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
154 echo "Setting endian flags = $sim_endian" 6>&1
155 fi],[sim_endian=""])dnl
157 AC_ARG_ENABLE(sim-hostendian,
158 [ --enable-sim-hostendain=end Specify host byte endian orientation.],
159 [case "${enableval}" in
160 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
161 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
162 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
163 *) sim_hostendian="";;
165 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
166 echo "Setting hostendian flags = $sim_hostendian" 6>&1
167 fi],[sim_hostendian=""])dnl
169 AC_ARG_ENABLE(sim-smp,
170 [ --enable-sim-smp=n Specify number of processors to configure for.],
171 [case "${enableval}" in
172 yes) sim_smp="-DWITH_SMP=2";;
173 no) sim_smp="-DWITH_SMP=0";;
174 *) sim_smp="-DWITH_SMP=$enableval";;
176 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
177 echo "Setting smp flags = $sim_smp" 6>&1
178 fi],[sim_smp="-DWITH_SMP=0"
179 if test x"$silent" != x"yes"; then
180 echo "Setting smp flags = $sim_smp" 6>&1
183 AC_ARG_ENABLE(sim-bitsize,
184 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
185 [case "${enableval}" in
186 yes) sim_bitsize="";;
188 *) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
190 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
191 echo "Setting bitsize flags = $sim_bitsize" 6>&1
192 fi],[sim_bitsize=""])dnl
194 AC_ARG_ENABLE(sim-hostbitsize,
195 [ --enable-sim-hostbitsize=n Specify host bitsize (32 or 64).],
196 [case "${enableval}" in
197 yes) sim_hostbitsize="";;
198 no) sim_hostbitsize="";;
199 *) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
201 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
202 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
203 fi],[sim_hostbitsize=""])dnl
205 AC_ARG_ENABLE(sim-env,
206 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
207 [case "${enableval}" in
208 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
209 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
210 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
213 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
214 echo "Setting env flags = $sim_env" 6>&1
217 AC_ARG_ENABLE(sim-timebase,
218 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
219 [case "${enableval}" in
220 yes) sim_timebase="-DWITH_TIME_BASE=1";;
221 no) sim_timebase="-DWITH_TIME_BASE=0";;
224 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
225 echo "Setting timebase flags = $sim_timebase" 6>&1
226 fi],[sim_timebase=""])dnl
228 AC_ARG_ENABLE(sim-alignment,
229 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
230 [case "${enableval}" in
231 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
232 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
233 *) sim_alignment="-DWITH_ALIGNMENT=$enableval";;
235 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
236 echo "Setting alignment flags = $sim_alignment" 6>&1
237 fi],[sim_alignment=""])dnl
239 AC_ARG_ENABLE(sim-trace,
240 [ --enable-sim-trace Specify whether tracing is supported.],
241 [case "${enableval}" in
242 yes) sim_trace="-DWITH_TRACE=1";;
243 no) sim_trace="-DWITH_TRACE=0";;
246 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
247 echo "Setting trace flags = $sim_trace" 6>&1
248 fi],[sim_trace=""])dnl
250 AC_ARG_ENABLE(sim-assert,
251 [ --enable-sim-assert Specify whether to perform random assertions.],
252 [case "${enableval}" in
253 yes) sim_assert="-DWITH_ASSERT=1";;
254 no) sim_assert="-DWITH_ASSERT=0";;
257 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
258 echo "Setting assert flags = $sim_assert" 6>&1
259 fi],[sim_assert=""])dnl
261 AC_ARG_ENABLE(sim-float,
262 [ --enable-sim-float Specify whether to use host floating point or simulate.],
263 [case "${enableval}" in
264 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
265 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
268 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
269 echo "Setting float flags = $sim_float" 6>&1
270 fi],[sim_float=""])dnl
272 AC_ARG_ENABLE(sim-monitor,
273 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
274 [case "${enableval}" in
275 yes) sim_mon="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
276 no) sim_mon="-DWITH_MON=0";;
277 instruction) sim_mon="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
278 memory) sim_mon="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
279 *) sim_mon="-DWITH_MON='$enableval'";;
281 if test x"$silent" != x"yes" && test x"$sim_mon" != x""; then
282 echo "Setting monitor flags = $sim_mon" 6>&1
285 AC_ARG_ENABLE(sim-function-unit,
286 [ --enable-sim-function-unit Specify whether detailed functional unit support is built.],
287 [case "${enableval}" in
288 yes) sim_func="-DWITH_FUNCTION_UNIT=1";;
289 no) sim_func="-DWITH_FUNCTION_UNIT=0";;
292 if test x"$silent" != x"yes" && test x"$sim_func" != x""; then
293 echo "Setting function-unit flags = $sim_func" 6>&1
294 fi],[sim_func=""])dnl
296 AC_ARG_ENABLE(sim-model,
297 [ --enable-sim-model=which Specify PowerPC to model.],
298 [case "${enableval}" in
301 *) sim_model="-DWITH_PPC_MODEL=${enableval}";;
303 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
304 echo "Setting model flags = $sim_model" 6>&1
305 fi],[sim_model=""])dnl
307 AC_ARG_ENABLE(sim-default-model,
308 [ --enable-sim-default-model=which Specify default PowerPC to model.],
309 [case "${enableval}" in
310 yes) sim_default_model="";;
311 no) sim_default_model="";;
312 *) sim_default_model="-DWITH_DEFAULT_PPC_MODEL=${enableval}";;
314 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
315 echo "Setting default-model flags = $sim_default_model" 6>&1
316 fi],[sim_model=""])dnl
318 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
322 . ${srcdir}/../../bfd/configure.host
324 AC_CONFIG_HEADER(config.h:config.in)
333 AC_SUBST(sim_warnings)
343 AC_SUBST(sim_hostendian)
345 AC_SUBST(sim_bitsize)
346 AC_SUBST(sim_hostbitsize)
348 AC_SUBST(sim_timebase)
349 AC_SUBST(sim_alignment)
353 AC_SUBST(sim_monitor)
356 AC_SUBST(sim_default_model)
358 AC_CHECK_FUNCS(getrusage)
360 # Put a plausible default for CC_FOR_BUILD in Makefile.
362 if test "x$cross_compiling" = "xno"; then
367 AC_SUBST(CC_FOR_BUILD)
369 AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/times.h unistd.h sys/resource.h)
372 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])