* gdb.base/fileio.c: Include unistd.h as required for lseek(2).
[deliverable/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,
345d88d9 193[ --enable-sim-float Specify whether the target has hard, soft, altivec or e500 floating point.],
c906108c
SS
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";;
345d88d9
AC
197 altivec) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
198 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
c906108c
SS
199 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
200esac
201if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
202 echo "Setting float flags = $sim_float" 6>&1
345d88d9
AC
203fi],[
204case "${target}" in
205 *altivec*) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
206 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
207 *) sim_float=""
208esac
209])dnl
c906108c
SS
210
211
212AC_ARG_ENABLE(sim-hardware,
213[ --enable-sim-hardware=list Specify the hardware to be included in the build.],
214[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
215case "${enableval}" in
216 yes) ;;
217 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
218 ,*) hardware="${hardware}${enableval}";;
219 *,) hardware="${enableval}${hardware}";;
220 *) hardware="${enableval}"'';;
221esac
222sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
223sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
224if test x"$silent" != x"yes" && test x"$hardware" != x""; then
225 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
226fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
227sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
228sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
229if test x"$silent" != x"yes"; then
230 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
231fi])dnl
232
233
234AC_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="";;
239esac
240if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
241 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
242fi],[sim_hostbitsize=""])dnl
243
244
245AC_ARG_ENABLE(sim-hostendian,
246[ --enable-sim-hostendian=end Specify host byte endian orientation.],
247[case "${enableval}" in
248 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
249 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
250 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
251 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
252esac
253if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
254 echo "Setting hostendian flags = $sim_hostendian" 6>&1
255fi],[
256if test "x$cross_compiling" = "xno"; then
257 AC_C_BIGENDIAN
258 if test $ac_cv_c_bigendian = yes; then
259 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
260 else
261 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
262 fi
263else
264 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
265fi])dnl
266
267
268AC_ARG_ENABLE(sim-icache,
269[ --enable-sim-icache=size Specify instruction-decode cache size and type.],
270[icache="-R"
271 case "${enableval}" in
272 yes) icache="1024"; sim_icache="-I $icache";;
273 no) sim_icache="-R";;
274 *) icache=1024
275 sim_icache="-"
276 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
277 case "$x" in
278 define) sim_icache="${sim_icache}R";;
279 semantic) sim_icache="${sim_icache}C";;
280 insn) sim_icache="${sim_icache}S";;
281 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
282 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
283 esac
284 done
285 sim_icache="${sim_icache}I $icache";;
286esac
287if test x"$silent" != x"yes" && test x"$icache" != x""; then
288 echo "Setting instruction cache size to $icache ($sim_icache)"
289fi],[sim_icache="-CSRI 1024"
290if test x"$silent" != x"yes"; then
291 echo "Setting instruction cache size to 1024 ($sim_icache)"
292fi])dnl
293
294
295AC_ARG_ENABLE(sim-inline,
296[ --enable-sim-inline=inlines Specify which functions should be inlined.],
297[sim_inline=""
298case "$enableval" in
299 no) sim_inline="-DDEFAULT_INLINE=0";;
300 0) sim_inline="-DDEFAULT_INLINE=0";;
301 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
d29d5195 302 1) sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS";;
c906108c
SS
303 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
304 new_flag=""
305 case "$x" in
306 *_INLINE=*) new_flag="-D$x";;
307 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
308 *_INLINE) new_flag="-D$x=ALL_INLINE";;
309 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
310 esac
311 if test x"$sim_inline" = x""; then
312 sim_inline="$new_flag"
313 else
314 sim_inline="$sim_inline $new_flag"
315 fi
316 done;;
317esac
318if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
319 echo "Setting inline flags = $sim_inline" 6>&1
320fi],[if test x"$GCC" != ""; then
d29d5195 321 sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS"
c906108c
SS
322 if test x"$silent" != x"yes"; then
323 echo "Setting inline flags = $sim_inline" 6>&1
324 fi
325else
326 sim_inline=""
327fi])dnl
328
329
330AC_ARG_ENABLE(sim-jump,
331[ --enable-sim-jump Jump between semantic code (instead of call/return).],
332[case "${enableval}" in
333 yes) sim_jump="-J";;
334 no) sim_jump="";;
335 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
336esac
337if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
338 echo "Setting jump flag = $sim_jump" 6>&1
339fi],[sim_jump=""
340if test x"$silent" != x"yes"; then
341 echo "Setting jump flag = $sim_jump" 6>&1
342fi])dnl
343
344
345AC_ARG_ENABLE(sim-line-nr,
346[ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
347[case "${enableval}" in
348 yes) sim_line_nr="";;
349 no) sim_line_nr="-L";;
350 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
351esac
352if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
353 echo "Setting warning flags = $sim_line_nr" 6>&1
354fi],[sim_line_nr=""])dnl
355
356
357AC_ARG_ENABLE(sim-model,
358[ --enable-sim-model=which Specify PowerPC to model.],
359[case "${enableval}" in
360 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
361 *) sim_model="-DWITH_MODEL=${enableval}";;
362esac
363if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
364 echo "Setting model flags = $sim_model" 6>&1
365fi],[sim_model=""])dnl
366
367
368AC_ARG_ENABLE(sim-model-issue,
369[ --enable-sim-model-issue Specify whether to simulate model specific actions],
370[case "${enableval}" in
371 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
372 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
373 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
374esac
375if test x"$silent" != x"yes"; then
376 echo "Setting model-issue flags = $sim_model_issue" 6>&1
377fi],[sim_model_issue=""])dnl
378
379
380AC_ARG_ENABLE(sim-monitor,
381[ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
382[case "${enableval}" in
383 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
384 no) sim_monitor="-DWITH_MON=0";;
385 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
386 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
387 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
388esac
389if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
390 echo "Setting monitor flags = $sim_monitor" 6>&1
391fi],[sim_monitor=""])dnl
392
393
394AC_ARG_ENABLE(sim-opcode,
395[ --enable-sim-opcode=which Override default opcode lookup.],
396[case "${enableval}" in
397 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
398 *) if test -f "${srcdir}/${enableval}"; then
399 sim_opcode="${enableval}"
400 elif test -f "${srcdir}/dc-${enableval}"; then
401 sim_opcode="dc-${enableval}"
402 else
403 AC_MSG_ERROR("File $enableval is not an opcode rules file");
404 sim_opcode="dc-complex"
405 fi;;
406esac
407if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
408 echo "Setting opcode flags = $sim_opcode" 6>&1
409fi],[sim_opcode="dc-complex"
410if test x"$silent" != x"yes"; then
411 echo "Setting opcode flags = $sim_opcode"
412fi])dnl
413
414
415AC_ARG_ENABLE(sim-packages,
416[ --enable-sim-packages=list Specify the packages to be included in the build.],
417[packages=disklabel
418case "${enableval}" in
419 yes) ;;
420 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
421 ,*) packages="${packages}${enableval}";;
422 *,) packages="${enableval}${packages}";;
423 *) packages="${enableval}"'';;
424esac
425sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
426sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
427if test x"$silent" != x"yes" && test x"$packages" != x""; then
428 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
429fi],[packages=disklabel
430sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
431sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
432if test x"$silent" != x"yes"; then
433 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
434fi])dnl
435
436
437AC_ARG_ENABLE(sim-regparm,
438[ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
439[case "${enableval}" in
440 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
441 no) sim_regparm="" ;;
442 yes) sim_regparm="-DWITH_REGPARM=3";;
443 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
444esac
445if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
446 echo "Setting regparm flags = $sim_regparm" 6>&1
447fi],[sim_regparm=""])dnl
448
449
450AC_ARG_ENABLE(sim-reserved-bits,
451[ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
452[case "${enableval}" in
453 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
454 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
455 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
456esac
457if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
458 echo "Setting reserved flags = $sim_reserved" 6>&1
459fi],[sim_reserved=""])dnl
460
461
462AC_ARG_ENABLE(sim-smp,
463[ --enable-sim-smp=n Specify number of processors to configure for.],
464[case "${enableval}" in
465 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
466 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
467 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
468esac
469if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
470 echo "Setting smp flags = $sim_smp" 6>&1
471fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
472if test x"$silent" != x"yes"; then
473 echo "Setting smp flags = $sim_smp" 6>&1
474fi])dnl
475
476
477AC_ARG_ENABLE(sim-stdcall,
478[ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
479[case "${enableval}" in
480 no) sim_stdcall="" ;;
481 std*) sim_stdcall="-DWITH_STDCALL=1";;
482 yes) sim_stdcall="-DWITH_STDCALL=1";;
483 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
484esac
485if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
486 echo "Setting function call flags = $sim_stdcall" 6>&1
487fi],[sim_stdcall=""])dnl
488
489
490AC_ARG_ENABLE(sim-stdio,
491[ --enable-sim-stdio Specify whether to use stdio for console input/output.],
492[case "${enableval}" in
493 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
494 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
495 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
496esac
497if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
498 echo "Setting stdio flags = $sim_stdio" 6>&1
499fi],[sim_stdio=""])dnl
500
501
502AC_ARG_ENABLE(sim-switch,
503[ --enable-sim-switch Use a switch instead of a table for instruction call.],
504[case "${enableval}" in
505 yes) sim_switch="-s";;
506 no) sim_switch="";;
507 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
508esac
509if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
510 echo "Setting switch flags = $sim_switch" 6>&1
511fi],[sim_switch="";
512if test x"$silent" != x"yes"; then
513 echo "Setting switch flags = $sim_switch" 6>&1
514fi])dnl
515
516
517AC_ARG_ENABLE(sim-timebase,
518[ --enable-sim-timebase Specify whether the PPC timebase is supported.],
519[case "${enableval}" in
520 yes) sim_timebase="-DWITH_TIME_BASE=1";;
521 no) sim_timebase="-DWITH_TIME_BASE=0";;
522 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
523esac
524if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
525 echo "Setting timebase flags = $sim_timebase" 6>&1
526fi],[sim_timebase=""])dnl
527
528
529AC_ARG_ENABLE(sim-trace,
530[ --enable-sim-trace Specify whether tracing is supported.],
531[case "${enableval}" in
532 yes) sim_trace="-DWITH_TRACE=1";;
533 no) sim_trace="-DWITH_TRACE=0";;
534 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
535esac
536if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
537 echo "Setting trace flags = $sim_trace" 6>&1
538fi],[sim_trace=""])dnl
539
540
541AC_ARG_ENABLE(sim-warnings,
542[ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
543[case "${enableval}" in
544 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
545 no) sim_warnings="-w";;
546 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
547esac
548if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
549 echo "Setting warning flags = $sim_warnings" 6>&1
550fi],[sim_warnings=""])dnl
551
552
553AC_ARG_ENABLE(sim-xor-endian,
554[ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
555[case "${enableval}" in
556 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
557 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
558 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
559esac
560if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
561 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
562fi],[sim_xor_endian=""])dnl
563
564
565AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
566AC_CANONICAL_SYSTEM
567AC_ARG_PROGRAM
568
569. ${srcdir}/../../bfd/configure.host
570
571AC_CONFIG_HEADER(config.h:config.in)
572
573AC_STRUCT_ST_BLKSIZE
574AC_STRUCT_ST_BLOCKS
575AC_STRUCT_ST_RDEV
576AC_STRUCT_TIMEZONE
577
578AC_TYPE_GETGROUPS
579AC_TYPE_MODE_T
580AC_TYPE_OFF_T
581AC_TYPE_PID_T
582AC_TYPE_SIGNAL
583AC_TYPE_SIZE_T
584AC_TYPE_UID_T
585
586AC_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)
587
1f362c96 588AC_CHECK_HEADERS(fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.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 sys/vfs.h sys/statfs.h)
c906108c
SS
589AC_HEADER_DIRENT
590
591dnl Figure out what type of termio/termios support there is
592sim_termio=""
593AC_MSG_CHECKING(for struct termios)
594AC_CACHE_VAL(ac_cv_termios_struct,
595[AC_TRY_COMPILE([#include <sys/types.h>
596#include <sys/termios.h>],
597[static struct termios x;
598 x.c_iflag = 0;
599 x.c_oflag = 0;
600 x.c_cflag = 0;
601 x.c_lflag = 0;
602 x.c_cc[NCCS] = 0;],
603ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
604AC_MSG_RESULT($ac_cv_termios_struct)
605if test $ac_cv_termios_struct = yes; then
606 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
607fi
608
609if test "$ac_cv_termios_struct" = "yes"; then
610 AC_MSG_CHECKING(for c_line field in struct termios)
611 AC_CACHE_VAL(ac_cv_termios_cline,
612 [AC_TRY_COMPILE([#include <sys/types.h>
613#include <sys/termios.h>],
614[static struct termios x; x.c_line = 0;],
615 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
616
617 AC_MSG_RESULT($ac_cv_termios_cline)
618 if test $ac_cv_termios_cline = yes; then
619 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
620 fi
621else
622 ac_cv_termios_cline=no
623fi
624
625if test "$ac_cv_termios_struct" != "yes"; then
626 AC_MSG_CHECKING(for struct termio)
627 AC_CACHE_VAL(ac_cv_termio_struct,
628 [AC_TRY_COMPILE([#include <sys/types.h>
629#include <sys/termio.h>],
630[static struct termio x;
631 x.c_iflag = 0;
632 x.c_oflag = 0;
633 x.c_cflag = 0;
634 x.c_lflag = 0;
635 x.c_cc[NCC] = 0;],
636ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
637 AC_MSG_RESULT($ac_cv_termio_struct)
638 if test $ac_cv_termio_struct = yes; then
639 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
640 fi
641else
642 ac_cv_termio_struct=no
643fi
644
645if test "$ac_cv_termio_struct" = "yes"; then
646 AC_MSG_CHECKING(for c_line field in struct termio)
647 AC_CACHE_VAL(ac_cv_termio_cline,
648 [AC_TRY_COMPILE([#include <sys/types.h>
649#include <sys/termio.h>],
650[static struct termio x; x.c_line = 0;],
651 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
652
653 AC_MSG_RESULT($ac_cv_termio_cline)
654 if test $ac_cv_termio_cline = yes; then
655 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
656 fi
657else
658 ac_cv_termio_cline=no
659fi
660
1f362c96
AC
661dnl Check for struct statfs
662AC_MSG_CHECKING(for struct statfs)
663AC_CACHE_VAL(ac_cv_struct_statfs,
664[AC_TRY_COMPILE([#include <sys/types.h>
665#ifdef HAVE_SYS_PARAM_H
666#include <sys/param.h>
667#endif
668#ifdef HAVE_SYS_MOUNT_H
669#include <sys/mount.h>
670#endif
671#ifdef HAVE_SYS_VFS_H
672#include <sys/vfs.h>
673#endif
674#ifdef HAVE_SYS_STATFS_H
675#include <sys/statfs.h>
676#endif],
677[static struct statfs s;],
678ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
679AC_MSG_RESULT($ac_cv_struct_statfs)
680if test $ac_cv_struct_statfs = yes; then
681 AC_DEFINE(HAVE_STRUCT_STATFS, 1,
682 [Define if struct statfs is defined in <sys/mount.h>])
683fi
684
c906108c
SS
685dnl Figure out if /dev/zero exists or not
686sim_devzero=""
687AC_MSG_CHECKING(for /dev/zero)
688AC_CACHE_VAL(ac_cv_devzero,
689[AC_TRY_RUN([#include <fcntl.h>
690main () {
691 char buf[2048];
692 int i;
693 int fd = open ("/dev/zero", O_RDONLY);
694 if (fd < 0)
695 return 1;
696 for (i = 0; i < sizeof (buf); i++)
697 buf[i] = 1;
698 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
699 return 1;
700 for (i = 0; i < sizeof (buf); i++)
701 if (buf[i])
702 return 1;
703 return 0;
704}],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
705AC_MSG_RESULT($ac_cv_devzero)
706if test $ac_cv_devzero = yes; then
707 sim_devzero="-DHAVE_DEVZERO"
708else
709 sim_devzero=""
710fi
711
712dnl Figure out if we are in the new Cygnus tree with a common directory or not
713AC_MSG_CHECKING(for common simulator directory)
714if test -f "${srcdir}/../common/callback.c"; then
715 AC_MSG_RESULT(yes)
716 sim_callback="callback.o targ-map.o"
717 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
718else
719 AC_MSG_RESULT(no)
720 sim_callback=""
721 sim_targ_vals=""
722fi
723
d29d5195
MG
724AC_MSG_CHECKING(for common simulator directory fpu implementation)
725if test -f "${srcdir}/../common/sim-fpu.c"; then
726 AC_MSG_RESULT(yes)
3e5e53f9 727 sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
3a11ea24 728 sim_fpu="sim-fpu.o"
d29d5195
MG
729else
730 AC_MSG_RESULT(no)
731 sim_fpu_cflags=
732 sim_fpu=
733fi
734
c906108c 735dnl Check for exe extension
cd0fc7c3 736AC_EXEEXT
c906108c
SS
737
738AC_SUBST(CC_FOR_BUILD)
739AC_SUBST(CFLAGS)
740AC_SUBST(HDEFINES)
741AR=${AR-ar}
742AC_SUBST(AR)
743AC_PROG_RANLIB
744AC_SUBST(sim_cflags)
745AC_SUBST(sim_warnings)
746AC_SUBST(sim_line_nr)
747AC_SUBST(sim_config)
748AC_SUBST(sim_opcode)
749AC_SUBST(sim_switch)
750AC_SUBST(sim_dup)
751AC_SUBST(sim_decode_mechanism)
752AC_SUBST(sim_jump)
753AC_SUBST(sim_filter)
754AC_SUBST(sim_icache)
755AC_SUBST(sim_hw_src)
756AC_SUBST(sim_hw_obj)
757AC_SUBST(sim_pk_src)
758AC_SUBST(sim_pk_obj)
759AC_SUBST(sim_inline)
760AC_SUBST(sim_bswap)
761AC_SUBST(sim_endian)
762AC_SUBST(sim_regparm)
763AC_SUBST(sim_stdcall)
764AC_SUBST(sim_xor_endian)
765AC_SUBST(sim_hostendian)
766AC_SUBST(sim_smp)
767AC_SUBST(sim_igen_smp)
768AC_SUBST(sim_bitsize)
769AC_SUBST(sim_hostbitsize)
770AC_SUBST(sim_env)
771AC_SUBST(sim_timebase)
772AC_SUBST(sim_alignment)
773AC_SUBST(sim_float)
774AC_SUBST(sim_trace)
775AC_SUBST(sim_assert)
776AC_SUBST(sim_reserved)
777AC_SUBST(sim_monitor)
778AC_SUBST(sim_model)
779AC_SUBST(sim_default_model)
780AC_SUBST(sim_model_issue)
781AC_SUBST(sim_stdio)
782AC_SUBST(sim_termio)
783AC_SUBST(sim_devzero)
784AC_SUBST(sim_callback)
785AC_SUBST(sim_targ_vals)
d29d5195
MG
786AC_SUBST(sim_fpu_cflags)
787AC_SUBST(sim_fpu)
c906108c
SS
788
789AC_OUTPUT(Makefile,
790[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
This page took 0.30721 seconds and 4 git commands to generate.