Add --enable-sim-stdio to make console I/O use stdio, not printf_filtered and polling...
[deliverable/binutils-gdb.git] / sim / ppc / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.3)dnl
3 AC_INIT(Makefile.in)
4
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";;
9 no) sim_cflags="";;
10 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
11 esac
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
15
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="-Werror -Wall -Wpointer-arith -Wmissing-prototypes";;
20 no) sim_warnings="-w";;
21 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
22 esac
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
26
27 AC_ARG_ENABLE(sim-config,
28 [ --enable-sim-config=file Override default config file],
29 [case "${enableval}" in
30 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
31 *) if test -f "${srcdir}/${enableval}"; then
32 sim_config="${enableval}";
33 elif test -f "${srcdir}/${enableval}-config.h"; then
34 sim_config="${enableval}-config.h"
35 else
36 AC_MSG_ERROR("Config file $enableval was not found");
37 sim_config=std-config.h
38 fi;;
39 esac
40 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
41 echo "Setting config flags = $sim_config" 6>&1
42 fi],[sim_config="std-config.h"
43 if test x"$silent" != x"yes"; then
44 echo "Setting config flags = $sim_config" 6>&1
45 fi])dnl
46
47 AC_ARG_ENABLE(sim-opcode,
48 [ --enable-sim-opcode=which Override default opcode lookup.],
49 [case "${enableval}" in
50 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
51 *) if test -f "${srcdir}/${enableval}"; then
52 sim_opcode="${enableval}"
53 elif test -f "${srcdir}/ppc-opcode-${enableval}"; then
54 sim_opcode="ppc-opcode-${enableval}"
55 else
56 AC_MSG_ERROR("File $enableval is not an opcode rules file");
57 sim_opcode="ppc-opcode-complex"
58 fi;;
59 esac
60 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
61 echo "Setting opcode flags = $sim_opcode" 6>&1
62 fi],[sim_opcode="ppc-opcode-complex"
63 if test x"$silent" != x"yes"; then
64 echo "Setting opcode flags = $sim_opcode"
65 fi])dnl
66
67 AC_ARG_ENABLE(sim-switch,
68 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
69 [case "${enableval}" in
70 yes) sim_switch="-s";;
71 no) sim_switch="";;
72 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
73 esac
74 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
75 echo "Setting switch flags = $sim_switch" 6>&1
76 fi],[sim_switch="";
77 if test x"$silent" != x"yes"; then
78 echo "Setting switch flags = $sim_switch" 6>&1
79 fi])dnl
80
81 AC_ARG_ENABLE(sim-duplicate,
82 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
83 [case "${enableval}" in
84 yes) sim_dup="-e";;
85 no) sim_dup="";;
86 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
87 esac
88 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
89 echo "Setting duplicate flags = $sim_dup" 6>&1
90 fi],[sim_dup="-e"
91 if test x"$silent" != x"yes"; then
92 echo "Setting duplicate flags = $sim_dup" 6>&1
93 fi])dnl
94
95 AC_ARG_ENABLE(sim-filter,
96 [ --enable-sim-filter=rule Specify filter rules.],
97 [case "${enableval}" in
98 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
99 no) sim_filter="";;
100 *) sim_filter="-f $enableval";;
101 esac
102 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
103 echo "Setting filter flags = $sim_filter" 6>&1
104 fi],[sim_filter="-f 64"
105 if test x"$silent" != x"yes"; then
106 echo "Setting filter flags = $sim_filter" 6>&1
107 fi])dnl
108
109 AC_ARG_ENABLE(sim-icache,
110 [ --enable-sim-icache=size Specify instruction cache size.],
111 icache=""
112 [case "${enableval}" in
113 yes) sim_icache="-r 1024"; icache="1024";;
114 define) sim_icache="-r 1024 -R"; icache="1024";;
115 no) sim_icache="";;
116 *) sim_icache="-r ${enableval}"; icache="${enableval}";;
117 esac
118 if test x"$silent" != x"yes" && test x"$icache" != x""; then
119 echo "Setting instruction cache size to $icache"
120 fi],[sim_icache="-r 1024"
121 if test x"$silent" != x"yes"; then
122 echo "Setting instruction cache size to 1024"
123 fi])dnl
124
125 AC_ARG_ENABLE(sim-inline,
126 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
127 [sim_inline=""
128 case "$enableval" in
129 no) sim_inline="-DDEFAULT_INLINE=0";;
130 0) sim_inline="-DDEFAULT_INLINE=0";;
131 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
132 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
133 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
134 new_flag=""
135 case "$x" in
136 *_INLINE=*) new_flag="-D$x";;
137 *_INLINE) new_flag="-D$x=ALL_INLINE";;
138 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
139 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
140 esac
141 if test x"$sim_inline" = x""; then
142 sim_inline="$new_flag"
143 else
144 sim_inline="$sim_inline $new_flag"
145 fi
146 done;;
147 esac
148 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
149 echo "Setting inline flags = $sim_inline" 6>&1
150 fi],[if test x"$GCC" != ""; then
151 sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
152 if test x"$silent" != x"yes"; then
153 echo "Setting inline flags = $sim_inline" 6>&1
154 fi
155 else
156 sim_inline=""
157 fi])dnl
158
159 AC_ARG_ENABLE(sim-bswap,
160 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
161 [case "${enableval}" in
162 yes) sim_bswap="-DWITH_BSWAP=1";;
163 no) sim_bswap="-DWITH_BSWAP=0";;
164 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
165 esac
166 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
167 echo "Setting bswap flags = $sim_bswap" 6>&1
168 fi],[sim_bswap=""])dnl
169
170 AC_ARG_ENABLE(sim-endian,
171 [ --enable-sim-endian=endian Specify target byte endian orientation.],
172 [case "${enableval}" in
173 yes) case "$target" in
174 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
175 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
176 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
177 esac;;
178 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
179 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
180 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
181 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
182 esac
183 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
184 echo "Setting endian flags = $sim_endian" 6>&1
185 fi],[sim_endian=""])dnl
186
187 AC_ARG_ENABLE(sim-hostendian,
188 [ --enable-sim-hostendain=end Specify host byte endian orientation.],
189 [case "${enableval}" in
190 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
191 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
192 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
193 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
194 esac
195 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
196 echo "Setting hostendian flags = $sim_hostendian" 6>&1
197 fi],[sim_hostendian=""])dnl
198
199 AC_ARG_ENABLE(sim-smp,
200 [ --enable-sim-smp=n Specify number of processors to configure for.],
201 [case "${enableval}" in
202 yes) sim_smp="-DWITH_SMP=5";;
203 no) sim_smp="-DWITH_SMP=0";;
204 *) sim_smp="-DWITH_SMP=$enableval";;
205 esac
206 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
207 echo "Setting smp flags = $sim_smp" 6>&1
208 fi],[sim_smp="-DWITH_SMP=5"
209 if test x"$silent" != x"yes"; then
210 echo "Setting smp flags = $sim_smp" 6>&1
211 fi])dnl
212
213 AC_ARG_ENABLE(sim-xor-endian,
214 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
215 [case "${enableval}" in
216 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
217 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
218 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
219 esac
220 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
221 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
222 fi],[sim_xor_endian=""])dnl
223
224 AC_ARG_ENABLE(sim-bitsize,
225 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
226 [case "${enableval}" in
227 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
228 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval, expected 32 or 64"); sim_bitsize="";;
229 esac
230 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
231 echo "Setting bitsize flags = $sim_bitsize" 6>&1
232 fi],[sim_bitsize=""])dnl
233
234 AC_ARG_ENABLE(sim-hostbitsize,
235 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
236 [case "${enableval}" in
237 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
238 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval, expected 32 or 64"); sim_hostbitsize="";;
239 esac
240 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
241 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
242 fi],[sim_hostbitsize=""])dnl
243
244 AC_ARG_ENABLE(sim-env,
245 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
246 [case "${enableval}" in
247 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
248 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
249 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
250 no) sim_env="-DWITH_ENVIRONMENT=0";;
251 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
252 esac
253 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
254 echo "Setting env flags = $sim_env" 6>&1
255 fi],[sim_env=""])dnl
256
257 AC_ARG_ENABLE(sim-timebase,
258 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
259 [case "${enableval}" in
260 yes) sim_timebase="-DWITH_TIME_BASE=1";;
261 no) sim_timebase="-DWITH_TIME_BASE=0";;
262 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
263 esac
264 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
265 echo "Setting timebase flags = $sim_timebase" 6>&1
266 fi],[sim_timebase=""])dnl
267
268 AC_ARG_ENABLE(sim-alignment,
269 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
270 [case "${enableval}" in
271 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
272 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
273 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
274 esac
275 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
276 echo "Setting alignment flags = $sim_alignment" 6>&1
277 fi],[sim_alignment=""])dnl
278
279 AC_ARG_ENABLE(sim-trace,
280 [ --enable-sim-trace Specify whether tracing is supported.],
281 [case "${enableval}" in
282 yes) sim_trace="-DWITH_TRACE=1";;
283 no) sim_trace="-DWITH_TRACE=0";;
284 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
285 esac
286 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
287 echo "Setting trace flags = $sim_trace" 6>&1
288 fi],[sim_trace=""])dnl
289
290 AC_ARG_ENABLE(sim-assert,
291 [ --enable-sim-assert Specify whether to perform random assertions.],
292 [case "${enableval}" in
293 yes) sim_assert="-DWITH_ASSERT=1";;
294 no) sim_assert="-DWITH_ASSERT=0";;
295 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
296 esac
297 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
298 echo "Setting assert flags = $sim_assert" 6>&1
299 fi],[sim_assert=""])dnl
300
301 AC_ARG_ENABLE(sim-reserved-bits,
302 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
303 [case "${enableval}" in
304 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
305 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
306 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
307 esac
308 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
309 echo "Setting reserved flags = $sim_reserved" 6>&1
310 fi],[sim_reserved=""])dnl
311
312 AC_ARG_ENABLE(sim-float,
313 [ --enable-sim-float Specify whether to use host floating point or simulate.],
314 [case "${enableval}" in
315 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
316 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
317 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
318 esac
319 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
320 echo "Setting float flags = $sim_float" 6>&1
321 fi],[sim_float=""])dnl
322
323 AC_ARG_ENABLE(sim-monitor,
324 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
325 [case "${enableval}" in
326 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
327 no) sim_monitor="-DWITH_MON=0";;
328 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
329 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
330 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
331 esac
332 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
333 echo "Setting monitor flags = $sim_monitor" 6>&1
334 fi],[sim_monitor=""])dnl
335
336 AC_ARG_ENABLE(sim-model,
337 [ --enable-sim-model=which Specify PowerPC to model.],
338 [case "${enableval}" in
339 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
340 *) sim_model="-DWITH_MODEL=${enableval}";;
341 esac
342 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
343 echo "Setting model flags = $sim_model" 6>&1
344 fi],[sim_model=""])dnl
345
346 AC_ARG_ENABLE(sim-default-model,
347 [ --enable-sim-default-model=which Specify default PowerPC to model.],
348 [case "${enableval}" in
349 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
350 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
351 esac
352 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
353 echo "Setting default-model flags = $sim_default_model" 6>&1
354 fi],[sim_model=""])dnl
355
356 AC_ARG_ENABLE(sim-model-issue,
357 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
358 [case "${enableval}" in
359 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
360 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
361 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
362 esac
363 if test x"$silent" != x"yes"; then
364 echo "Setting model-issue flags = $sim_model_issue" 6>&1
365 fi],[sim_model_issue=""])dnl
366
367 AC_ARG_ENABLE(sim-stdio,
368 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
369 [case "${enableval}" in
370 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
371 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
372 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
373 esac
374 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
375 echo "Setting stdio flags = $sim_stdio" 6>&1
376 fi],[sim_stdio=""])dnl
377
378 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
379 AC_CANONICAL_SYSTEM
380 AC_ARG_PROGRAM
381
382 . ${srcdir}/../../bfd/configure.host
383
384 AC_CONFIG_HEADER(config.h:config.in)
385
386 AC_PROG_CC
387 AC_SUBST(CFLAGS)
388 AC_SUBST(HDEFINES)
389 AR=${AR-ar}
390 AC_SUBST(AR)
391 AC_PROG_RANLIB
392 AC_SUBST(sim_cflags)
393 AC_SUBST(sim_warnings)
394 AC_SUBST(sim_config)
395 AC_SUBST(sim_opcode)
396 AC_SUBST(sim_switch)
397 AC_SUBST(sim_dup)
398 AC_SUBST(sim_filter)
399 AC_SUBST(sim_icache)
400 AC_SUBST(sim_inline)
401 AC_SUBST(sim_bswap)
402 AC_SUBST(sim_endian)
403 AC_SUBST(sim_xor_endian)
404 AC_SUBST(sim_hostendian)
405 AC_SUBST(sim_smp)
406 AC_SUBST(sim_bitsize)
407 AC_SUBST(sim_hostbitsize)
408 AC_SUBST(sim_env)
409 AC_SUBST(sim_timebase)
410 AC_SUBST(sim_alignment)
411 AC_SUBST(sim_float)
412 AC_SUBST(sim_trace)
413 AC_SUBST(sim_assert)
414 AC_SUBST(sim_reserved)
415 AC_SUBST(sim_monitor)
416 AC_SUBST(sim_model)
417 AC_SUBST(sim_default_model)
418 AC_SUBST(sim_model_issue)
419 AC_SUBST(sim_stdio)
420
421 AC_CHECK_FUNCS(getrusage)
422
423 # Put a plausible default for CC_FOR_BUILD in Makefile.
424 AC_C_CROSS
425 if test "x$cross_compiling" = "xno"; then
426 CC_FOR_BUILD='$(CC)'
427 else
428 CC_FOR_BUILD=gcc
429 fi
430 AC_SUBST(CC_FOR_BUILD)
431
432 AC_C_BIGENDIAN
433 AC_SUBST(WORDS_BIGENDIAN)
434
435 AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/mount.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h)
436 AC_HEADER_DIRENT
437
438 AC_OUTPUT(Makefile,
439 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
This page took 0.039564 seconds and 5 git commands to generate.