]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/ppc/configure.in
* scripttempl/mmo.sc: Add .debug_ranges to listed sections.
[thirdparty/binutils-gdb.git] / sim / ppc / configure.in
CommitLineData
c906108c
SS
1dnl Process this file with autoconf to produce a configure script.
2sinclude(../common/aclocal.m4)
3AC_PREREQ(2.5)dnl
4AC_INIT(Makefile.in)
5
6AC_PROG_INSTALL
7AC_PROG_CC
8
9# Put a plausible default for CC_FOR_BUILD in Makefile.
10if test "x$cross_compiling" = "xno"; then
11 CC_FOR_BUILD='$(CC)'
12else
13 CC_FOR_BUILD=gcc
14fi
15
16dnl We don't use gettext, but bfd does. So we do the appropriate checks
17dnl to see if there are intl libraries we should link against.
18ALL_LINGUAS=
19CY_GNU_GETTEXT
20
21
22AC_ARG_ENABLE(sim-alignment,
23[ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
24[case "${enableval}" in
25 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
26 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
27 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
28 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
29esac
30if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
31 echo "Setting alignment flags = $sim_alignment" 6>&1
32fi],[sim_alignment=""])dnl
33
34
35AC_ARG_ENABLE(sim-assert,
36[ --enable-sim-assert Specify whether to perform random assertions.],
37[case "${enableval}" in
38 yes) sim_assert="-DWITH_ASSERT=1";;
39 no) sim_assert="-DWITH_ASSERT=0";;
40 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
41esac
42if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
43 echo "Setting assert flags = $sim_assert" 6>&1
44fi],[sim_assert=""])dnl
45
46
47AC_ARG_ENABLE(sim-bitsize,
48[ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
49[case "${enableval}" in
50 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
51 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval. Expected 32 or 64"); sim_bitsize="";;
52esac
53if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
54 echo "Setting bitsize flags = $sim_bitsize" 6>&1
55fi],[sim_bitsize=""])dnl
56
57
58AC_ARG_ENABLE(sim-bswap,
59[ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
60[case "${enableval}" in
61 yes) sim_bswap="-DWITH_BSWAP=1";;
62 no) sim_bswap="-DWITH_BSWAP=0";;
63 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
64esac
65if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
66 echo "Setting bswap flags = $sim_bswap" 6>&1
67fi],[sim_bswap=""])dnl
68
69
70AC_ARG_ENABLE(sim-cflags,
71[ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
72[case "${enableval}" in
73 yes) sim_cflags="-O2 -fomit-frame-pointer";;
74 no) sim_cflags="";;
75 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
76esac
77if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
78 echo "Setting sim cflags = $sim_cflags" 6>&1
79fi],[sim_cflags=""])dnl
80
81
82AC_ARG_ENABLE(sim-config,
83[ --enable-sim-config=file Override default config file],
84[case "${enableval}" in
85 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
86 *) if test -f "${srcdir}/${enableval}"; then
87 sim_config="${enableval}";
88 elif test -f "${srcdir}/${enableval}-config.h"; then
89 sim_config="${enableval}-config.h"
90 else
91 AC_MSG_ERROR("Config file $enableval was not found");
92 sim_config=std-config.h
93 fi;;
94esac
95if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
96 echo "Setting config flags = $sim_config" 6>&1
97fi],[sim_config="std-config.h"
98if test x"$silent" != x"yes"; then
99 echo "Setting config flags = $sim_config" 6>&1
100fi])dnl
101
102
103AC_ARG_ENABLE(sim-decode-mechanism,
104[ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
105[case "${enableval}" in
106 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
107 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
108 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
109 sim_decode_mechanism="switch";;
110esac
111if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
112 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
113fi],[sim_decode_mechanism=""
114if test x"$silent" != x"yes"; then
115 echo "Setting decode mechanism flags = $sim_decode_mechanism"
116fi])dnl
117
118
119AC_ARG_ENABLE(sim-default-model,
120[ --enable-sim-default-model=which Specify default PowerPC to model.],
121[case "${enableval}" in
122 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
123 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
124esac
125if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
126 echo "Setting default-model flags = $sim_default_model" 6>&1
127fi],[sim_default_model=""])dnl
128
129
130AC_ARG_ENABLE(sim-duplicate,
131[ --enable-sim-duplicate Expand (duplicate) semantic functions.],
132[case "${enableval}" in
133 yes) sim_dup="-E";;
134 no) sim_dup="";;
135 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
136esac
137if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
138 echo "Setting duplicate flags = $sim_dup" 6>&1
139fi],[sim_dup="-E"
140if test x"$silent" != x"yes"; then
141 echo "Setting duplicate flags = $sim_dup" 6>&1
142fi])dnl
143
144
145AC_ARG_ENABLE(sim-endian,
146[ --enable-sim-endian=endian Specify target byte endian orientation.],
147[case "${enableval}" in
148 yes) case "$target" in
149 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
150 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
151 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
152 esac;;
153 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
154 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
155 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
156 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
157esac
158if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
159 echo "Setting endian flags = $sim_endian" 6>&1
160fi],[sim_endian=""])dnl
161
162
163AC_ARG_ENABLE(sim-env,
164[ --enable-sim-env=env Specify target environment (operating, virtual, user).],
165[case "${enableval}" in
166 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
167 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
168 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
169 no) sim_env="-DWITH_ENVIRONMENT=0";;
170 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
171esac
172if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
173 echo "Setting env flags = $sim_env" 6>&1
174fi],[sim_env=""])dnl
175
176
177AC_ARG_ENABLE(sim-filter,
178[ --enable-sim-filter=rule Specify filter rules.],
179[case "${enableval}" in
180 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
181 no) sim_filter="";;
182 *) sim_filter="-F $enableval";;
183esac
184if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
185 echo "Setting filter flags = $sim_filter" 6>&1
186fi],[sim_filter="-F 32,f,o"
187if test x"$silent" != x"yes"; then
188 echo "Setting filter flags = $sim_filter" 6>&1
189fi])dnl
190
191
192AC_ARG_ENABLE(sim-float,
193[ --enable-sim-float Specify whether to use host floating point or simulate.],
194[case "${enableval}" in
195 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
196 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
197 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
198esac
199if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
200 echo "Setting float flags = $sim_float" 6>&1
201fi],[sim_float=""])dnl
202
203
204AC_ARG_ENABLE(sim-hardware,
205[ --enable-sim-hardware=list Specify the hardware to be included in the build.],
206[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
207case "${enableval}" in
208 yes) ;;
209 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
210 ,*) hardware="${hardware}${enableval}";;
211 *,) hardware="${enableval}${hardware}";;
212 *) hardware="${enableval}"'';;
213esac
214sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
215sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
216if test x"$silent" != x"yes" && test x"$hardware" != x""; then
217 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
218fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
219sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
220sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
221if test x"$silent" != x"yes"; then
222 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
223fi])dnl
224
225
226AC_ARG_ENABLE(sim-hostbitsize,
227[ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
228[case "${enableval}" in
229 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
230 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
231esac
232if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
233 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
234fi],[sim_hostbitsize=""])dnl
235
236
237AC_ARG_ENABLE(sim-hostendian,
238[ --enable-sim-hostendian=end Specify host byte endian orientation.],
239[case "${enableval}" in
240 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
241 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
242 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
243 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
244esac
245if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
246 echo "Setting hostendian flags = $sim_hostendian" 6>&1
247fi],[
248if test "x$cross_compiling" = "xno"; then
249 AC_C_BIGENDIAN
250 if test $ac_cv_c_bigendian = yes; then
251 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
252 else
253 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
254 fi
255else
256 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
257fi])dnl
258
259
260AC_ARG_ENABLE(sim-icache,
261[ --enable-sim-icache=size Specify instruction-decode cache size and type.],
262[icache="-R"
263 case "${enableval}" in
264 yes) icache="1024"; sim_icache="-I $icache";;
265 no) sim_icache="-R";;
266 *) icache=1024
267 sim_icache="-"
268 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
269 case "$x" in
270 define) sim_icache="${sim_icache}R";;
271 semantic) sim_icache="${sim_icache}C";;
272 insn) sim_icache="${sim_icache}S";;
273 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
274 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
275 esac
276 done
277 sim_icache="${sim_icache}I $icache";;
278esac
279if test x"$silent" != x"yes" && test x"$icache" != x""; then
280 echo "Setting instruction cache size to $icache ($sim_icache)"
281fi],[sim_icache="-CSRI 1024"
282if test x"$silent" != x"yes"; then
283 echo "Setting instruction cache size to 1024 ($sim_icache)"
284fi])dnl
285
286
287AC_ARG_ENABLE(sim-inline,
288[ --enable-sim-inline=inlines Specify which functions should be inlined.],
289[sim_inline=""
290case "$enableval" in
291 no) sim_inline="-DDEFAULT_INLINE=0";;
292 0) sim_inline="-DDEFAULT_INLINE=0";;
293 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
d29d5195 294 1) sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS";;
c906108c
SS
295 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
296 new_flag=""
297 case "$x" in
298 *_INLINE=*) new_flag="-D$x";;
299 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
300 *_INLINE) new_flag="-D$x=ALL_INLINE";;
301 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
302 esac
303 if test x"$sim_inline" = x""; then
304 sim_inline="$new_flag"
305 else
306 sim_inline="$sim_inline $new_flag"
307 fi
308 done;;
309esac
310if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
311 echo "Setting inline flags = $sim_inline" 6>&1
312fi],[if test x"$GCC" != ""; then
d29d5195 313 sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS"
c906108c
SS
314 if test x"$silent" != x"yes"; then
315 echo "Setting inline flags = $sim_inline" 6>&1
316 fi
317else
318 sim_inline=""
319fi])dnl
320
321
322AC_ARG_ENABLE(sim-jump,
323[ --enable-sim-jump Jump between semantic code (instead of call/return).],
324[case "${enableval}" in
325 yes) sim_jump="-J";;
326 no) sim_jump="";;
327 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
328esac
329if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
330 echo "Setting jump flag = $sim_jump" 6>&1
331fi],[sim_jump=""
332if test x"$silent" != x"yes"; then
333 echo "Setting jump flag = $sim_jump" 6>&1
334fi])dnl
335
336
337AC_ARG_ENABLE(sim-line-nr,
338[ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
339[case "${enableval}" in
340 yes) sim_line_nr="";;
341 no) sim_line_nr="-L";;
342 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
343esac
344if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
345 echo "Setting warning flags = $sim_line_nr" 6>&1
346fi],[sim_line_nr=""])dnl
347
348
349AC_ARG_ENABLE(sim-model,
350[ --enable-sim-model=which Specify PowerPC to model.],
351[case "${enableval}" in
352 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
353 *) sim_model="-DWITH_MODEL=${enableval}";;
354esac
355if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
356 echo "Setting model flags = $sim_model" 6>&1
357fi],[sim_model=""])dnl
358
359
360AC_ARG_ENABLE(sim-model-issue,
361[ --enable-sim-model-issue Specify whether to simulate model specific actions],
362[case "${enableval}" in
363 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
364 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
365 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
366esac
367if test x"$silent" != x"yes"; then
368 echo "Setting model-issue flags = $sim_model_issue" 6>&1
369fi],[sim_model_issue=""])dnl
370
371
372AC_ARG_ENABLE(sim-monitor,
373[ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
374[case "${enableval}" in
375 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
376 no) sim_monitor="-DWITH_MON=0";;
377 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
378 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
379 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
380esac
381if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
382 echo "Setting monitor flags = $sim_monitor" 6>&1
383fi],[sim_monitor=""])dnl
384
385
386AC_ARG_ENABLE(sim-opcode,
387[ --enable-sim-opcode=which Override default opcode lookup.],
388[case "${enableval}" in
389 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
390 *) if test -f "${srcdir}/${enableval}"; then
391 sim_opcode="${enableval}"
392 elif test -f "${srcdir}/dc-${enableval}"; then
393 sim_opcode="dc-${enableval}"
394 else
395 AC_MSG_ERROR("File $enableval is not an opcode rules file");
396 sim_opcode="dc-complex"
397 fi;;
398esac
399if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
400 echo "Setting opcode flags = $sim_opcode" 6>&1
401fi],[sim_opcode="dc-complex"
402if test x"$silent" != x"yes"; then
403 echo "Setting opcode flags = $sim_opcode"
404fi])dnl
405
406
407AC_ARG_ENABLE(sim-packages,
408[ --enable-sim-packages=list Specify the packages to be included in the build.],
409[packages=disklabel
410case "${enableval}" in
411 yes) ;;
412 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
413 ,*) packages="${packages}${enableval}";;
414 *,) packages="${enableval}${packages}";;
415 *) packages="${enableval}"'';;
416esac
417sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
418sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
419if test x"$silent" != x"yes" && test x"$packages" != x""; then
420 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
421fi],[packages=disklabel
422sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
423sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
424if test x"$silent" != x"yes"; then
425 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
426fi])dnl
427
428
429AC_ARG_ENABLE(sim-regparm,
430[ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
431[case "${enableval}" in
432 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
433 no) sim_regparm="" ;;
434 yes) sim_regparm="-DWITH_REGPARM=3";;
435 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
436esac
437if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
438 echo "Setting regparm flags = $sim_regparm" 6>&1
439fi],[sim_regparm=""])dnl
440
441
442AC_ARG_ENABLE(sim-reserved-bits,
443[ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
444[case "${enableval}" in
445 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
446 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
447 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
448esac
449if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
450 echo "Setting reserved flags = $sim_reserved" 6>&1
451fi],[sim_reserved=""])dnl
452
453
454AC_ARG_ENABLE(sim-smp,
455[ --enable-sim-smp=n Specify number of processors to configure for.],
456[case "${enableval}" in
457 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
458 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
459 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
460esac
461if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
462 echo "Setting smp flags = $sim_smp" 6>&1
463fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
464if test x"$silent" != x"yes"; then
465 echo "Setting smp flags = $sim_smp" 6>&1
466fi])dnl
467
468
469AC_ARG_ENABLE(sim-stdcall,
470[ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
471[case "${enableval}" in
472 no) sim_stdcall="" ;;
473 std*) sim_stdcall="-DWITH_STDCALL=1";;
474 yes) sim_stdcall="-DWITH_STDCALL=1";;
475 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
476esac
477if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
478 echo "Setting function call flags = $sim_stdcall" 6>&1
479fi],[sim_stdcall=""])dnl
480
481
482AC_ARG_ENABLE(sim-stdio,
483[ --enable-sim-stdio Specify whether to use stdio for console input/output.],
484[case "${enableval}" in
485 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
486 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
487 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
488esac
489if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
490 echo "Setting stdio flags = $sim_stdio" 6>&1
491fi],[sim_stdio=""])dnl
492
493
494AC_ARG_ENABLE(sim-switch,
495[ --enable-sim-switch Use a switch instead of a table for instruction call.],
496[case "${enableval}" in
497 yes) sim_switch="-s";;
498 no) sim_switch="";;
499 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
500esac
501if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
502 echo "Setting switch flags = $sim_switch" 6>&1
503fi],[sim_switch="";
504if test x"$silent" != x"yes"; then
505 echo "Setting switch flags = $sim_switch" 6>&1
506fi])dnl
507
508
509AC_ARG_ENABLE(sim-timebase,
510[ --enable-sim-timebase Specify whether the PPC timebase is supported.],
511[case "${enableval}" in
512 yes) sim_timebase="-DWITH_TIME_BASE=1";;
513 no) sim_timebase="-DWITH_TIME_BASE=0";;
514 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
515esac
516if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
517 echo "Setting timebase flags = $sim_timebase" 6>&1
518fi],[sim_timebase=""])dnl
519
520
521AC_ARG_ENABLE(sim-trace,
522[ --enable-sim-trace Specify whether tracing is supported.],
523[case "${enableval}" in
524 yes) sim_trace="-DWITH_TRACE=1";;
525 no) sim_trace="-DWITH_TRACE=0";;
526 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
527esac
528if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
529 echo "Setting trace flags = $sim_trace" 6>&1
530fi],[sim_trace=""])dnl
531
532
533AC_ARG_ENABLE(sim-warnings,
534[ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
535[case "${enableval}" in
536 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
537 no) sim_warnings="-w";;
538 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
539esac
540if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
541 echo "Setting warning flags = $sim_warnings" 6>&1
542fi],[sim_warnings=""])dnl
543
544
545AC_ARG_ENABLE(sim-xor-endian,
546[ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
547[case "${enableval}" in
548 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
549 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
550 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
551esac
552if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
553 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
554fi],[sim_xor_endian=""])dnl
555
556
557AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
558AC_CANONICAL_SYSTEM
559AC_ARG_PROGRAM
560
561. ${srcdir}/../../bfd/configure.host
562
563AC_CONFIG_HEADER(config.h:config.in)
564
565AC_STRUCT_ST_BLKSIZE
566AC_STRUCT_ST_BLOCKS
567AC_STRUCT_ST_RDEV
568AC_STRUCT_TIMEZONE
569
570AC_TYPE_GETGROUPS
571AC_TYPE_MODE_T
572AC_TYPE_OFF_T
573AC_TYPE_PID_T
574AC_TYPE_SIGNAL
575AC_TYPE_SIZE_T
576AC_TYPE_UID_T
577
578AC_CHECK_FUNCS(access cfgetispeed cfgetospeed cfsetispeed cfsetospeed chdir chmod chown dup dup2 fchmod fchown fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getppid getrusage gettimeofday getuid ioctl kill link lseek lstat mkdir pipe readlink rmdir setreuid setregid stat sigprocmask stat symlink tcgetattr tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp time umask unlink)
579
580AC_CHECK_HEADERS(fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h)
581AC_HEADER_DIRENT
582
583dnl Figure out what type of termio/termios support there is
584sim_termio=""
585AC_MSG_CHECKING(for struct termios)
586AC_CACHE_VAL(ac_cv_termios_struct,
587[AC_TRY_COMPILE([#include <sys/types.h>
588#include <sys/termios.h>],
589[static struct termios x;
590 x.c_iflag = 0;
591 x.c_oflag = 0;
592 x.c_cflag = 0;
593 x.c_lflag = 0;
594 x.c_cc[NCCS] = 0;],
595ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
596AC_MSG_RESULT($ac_cv_termios_struct)
597if test $ac_cv_termios_struct = yes; then
598 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
599fi
600
601if test "$ac_cv_termios_struct" = "yes"; then
602 AC_MSG_CHECKING(for c_line field in struct termios)
603 AC_CACHE_VAL(ac_cv_termios_cline,
604 [AC_TRY_COMPILE([#include <sys/types.h>
605#include <sys/termios.h>],
606[static struct termios x; x.c_line = 0;],
607 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
608
609 AC_MSG_RESULT($ac_cv_termios_cline)
610 if test $ac_cv_termios_cline = yes; then
611 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
612 fi
613else
614 ac_cv_termios_cline=no
615fi
616
617if test "$ac_cv_termios_struct" != "yes"; then
618 AC_MSG_CHECKING(for struct termio)
619 AC_CACHE_VAL(ac_cv_termio_struct,
620 [AC_TRY_COMPILE([#include <sys/types.h>
621#include <sys/termio.h>],
622[static struct termio x;
623 x.c_iflag = 0;
624 x.c_oflag = 0;
625 x.c_cflag = 0;
626 x.c_lflag = 0;
627 x.c_cc[NCC] = 0;],
628ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
629 AC_MSG_RESULT($ac_cv_termio_struct)
630 if test $ac_cv_termio_struct = yes; then
631 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
632 fi
633else
634 ac_cv_termio_struct=no
635fi
636
637if test "$ac_cv_termio_struct" = "yes"; then
638 AC_MSG_CHECKING(for c_line field in struct termio)
639 AC_CACHE_VAL(ac_cv_termio_cline,
640 [AC_TRY_COMPILE([#include <sys/types.h>
641#include <sys/termio.h>],
642[static struct termio x; x.c_line = 0;],
643 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
644
645 AC_MSG_RESULT($ac_cv_termio_cline)
646 if test $ac_cv_termio_cline = yes; then
647 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
648 fi
649else
650 ac_cv_termio_cline=no
651fi
652
653dnl Figure out if /dev/zero exists or not
654sim_devzero=""
655AC_MSG_CHECKING(for /dev/zero)
656AC_CACHE_VAL(ac_cv_devzero,
657[AC_TRY_RUN([#include <fcntl.h>
658main () {
659 char buf[2048];
660 int i;
661 int fd = open ("/dev/zero", O_RDONLY);
662 if (fd < 0)
663 return 1;
664 for (i = 0; i < sizeof (buf); i++)
665 buf[i] = 1;
666 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
667 return 1;
668 for (i = 0; i < sizeof (buf); i++)
669 if (buf[i])
670 return 1;
671 return 0;
672}],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
673AC_MSG_RESULT($ac_cv_devzero)
674if test $ac_cv_devzero = yes; then
675 sim_devzero="-DHAVE_DEVZERO"
676else
677 sim_devzero=""
678fi
679
680dnl Figure out if we are in the new Cygnus tree with a common directory or not
681AC_MSG_CHECKING(for common simulator directory)
682if test -f "${srcdir}/../common/callback.c"; then
683 AC_MSG_RESULT(yes)
684 sim_callback="callback.o targ-map.o"
685 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
686else
687 AC_MSG_RESULT(no)
688 sim_callback=""
689 sim_targ_vals=""
690fi
691
d29d5195
MG
692AC_MSG_CHECKING(for common simulator directory fpu implementation)
693if test -f "${srcdir}/../common/sim-fpu.c"; then
694 AC_MSG_RESULT(yes)
695 sim_fpu_cflags="-DHAVE_COMMON_FPU -I${srcdir}/../common"
696 sim_fpu="sim-fpu.o sim-bits.o"
697else
698 AC_MSG_RESULT(no)
699 sim_fpu_cflags=
700 sim_fpu=
701fi
702
c906108c 703dnl Check for exe extension
cd0fc7c3 704AC_EXEEXT
c906108c
SS
705
706AC_SUBST(CC_FOR_BUILD)
707AC_SUBST(CFLAGS)
708AC_SUBST(HDEFINES)
709AR=${AR-ar}
710AC_SUBST(AR)
711AC_PROG_RANLIB
712AC_SUBST(sim_cflags)
713AC_SUBST(sim_warnings)
714AC_SUBST(sim_line_nr)
715AC_SUBST(sim_config)
716AC_SUBST(sim_opcode)
717AC_SUBST(sim_switch)
718AC_SUBST(sim_dup)
719AC_SUBST(sim_decode_mechanism)
720AC_SUBST(sim_jump)
721AC_SUBST(sim_filter)
722AC_SUBST(sim_icache)
723AC_SUBST(sim_hw_src)
724AC_SUBST(sim_hw_obj)
725AC_SUBST(sim_pk_src)
726AC_SUBST(sim_pk_obj)
727AC_SUBST(sim_inline)
728AC_SUBST(sim_bswap)
729AC_SUBST(sim_endian)
730AC_SUBST(sim_regparm)
731AC_SUBST(sim_stdcall)
732AC_SUBST(sim_xor_endian)
733AC_SUBST(sim_hostendian)
734AC_SUBST(sim_smp)
735AC_SUBST(sim_igen_smp)
736AC_SUBST(sim_bitsize)
737AC_SUBST(sim_hostbitsize)
738AC_SUBST(sim_env)
739AC_SUBST(sim_timebase)
740AC_SUBST(sim_alignment)
741AC_SUBST(sim_float)
742AC_SUBST(sim_trace)
743AC_SUBST(sim_assert)
744AC_SUBST(sim_reserved)
745AC_SUBST(sim_monitor)
746AC_SUBST(sim_model)
747AC_SUBST(sim_default_model)
748AC_SUBST(sim_model_issue)
749AC_SUBST(sim_stdio)
750AC_SUBST(sim_termio)
751AC_SUBST(sim_devzero)
752AC_SUBST(sim_callback)
753AC_SUBST(sim_targ_vals)
d29d5195
MG
754AC_SUBST(sim_fpu_cflags)
755AC_SUBST(sim_fpu)
c906108c
SS
756
757AC_OUTPUT(Makefile,
758[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])