1 dnl Process this file with autoconf to produce a configure script.
2 sinclude(../common/aclocal.m4)
9 # Put a plausible default for CC_FOR_BUILD in Makefile.
10 if test "x$cross_compiling" = "xno"; then
15 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
17 dnl We don't use gettext, but bfd does. So we do the appropriate checks
18 dnl to see if there are intl libraries we should link against.
20 ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
23 AC_ARG_ENABLE(sim-alignment,
24 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
25 [case "${enableval}" in
26 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
27 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
28 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
29 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
31 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
32 echo "Setting alignment flags = $sim_alignment" 6>&1
33 fi],[sim_alignment=""])dnl
36 AC_ARG_ENABLE(sim-assert,
37 [ --enable-sim-assert Specify whether to perform random assertions.],
38 [case "${enableval}" in
39 yes) sim_assert="-DWITH_ASSERT=1";;
40 no) sim_assert="-DWITH_ASSERT=0";;
41 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
43 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
44 echo "Setting assert flags = $sim_assert" 6>&1
45 fi],[sim_assert=""])dnl
48 AC_ARG_ENABLE(sim-bitsize,
49 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
50 [case "${enableval}" in
51 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
52 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval. Expected 32 or 64"); sim_bitsize="";;
54 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
55 echo "Setting bitsize flags = $sim_bitsize" 6>&1
56 fi],[sim_bitsize=""])dnl
59 AC_ARG_ENABLE(sim-bswap,
60 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
61 [case "${enableval}" in
62 yes) sim_bswap="-DWITH_BSWAP=1";;
63 no) sim_bswap="-DWITH_BSWAP=0";;
64 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
66 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
67 echo "Setting bswap flags = $sim_bswap" 6>&1
68 fi],[sim_bswap=""])dnl
71 AC_ARG_ENABLE(sim-cflags,
72 [ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
73 [case "${enableval}" in
74 yes) sim_cflags="-O2 -fomit-frame-pointer";;
76 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
78 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
79 echo "Setting sim cflags = $sim_cflags" 6>&1
80 fi],[sim_cflags=""])dnl
83 AC_ARG_ENABLE(sim-config,
84 [ --enable-sim-config=file Override default config file],
85 [case "${enableval}" in
86 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
87 *) if test -f "${srcdir}/${enableval}"; then
88 sim_config="${enableval}";
89 elif test -f "${srcdir}/${enableval}-config.h"; then
90 sim_config="${enableval}-config.h"
92 AC_MSG_ERROR("Config file $enableval was not found");
93 sim_config=std-config.h
96 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
97 echo "Setting config flags = $sim_config" 6>&1
98 fi],[sim_config="std-config.h"
99 if test x"$silent" != x"yes"; then
100 echo "Setting config flags = $sim_config" 6>&1
104 AC_ARG_ENABLE(sim-decode-mechanism,
105 [ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
106 [case "${enableval}" in
107 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
108 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
109 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
110 sim_decode_mechanism="switch";;
112 if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
113 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
114 fi],[sim_decode_mechanism=""
115 if test x"$silent" != x"yes"; then
116 echo "Setting decode mechanism flags = $sim_decode_mechanism"
120 AC_ARG_ENABLE(sim-default-model,
121 [ --enable-sim-default-model=which Specify default PowerPC to model.],
122 [case "${enableval}" in
123 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
124 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
126 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
127 echo "Setting default-model flags = $sim_default_model" 6>&1
128 fi],[sim_default_model=""])dnl
131 AC_ARG_ENABLE(sim-duplicate,
132 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
133 [case "${enableval}" in
136 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
138 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
139 echo "Setting duplicate flags = $sim_dup" 6>&1
141 if test x"$silent" != x"yes"; then
142 echo "Setting duplicate flags = $sim_dup" 6>&1
146 AC_ARG_ENABLE(sim-endian,
147 [ --enable-sim-endian=endian Specify target byte endian orientation.],
148 [case "${enableval}" in
149 yes) case "$target" in
150 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
151 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
152 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
154 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
155 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
156 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
157 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
159 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
160 echo "Setting endian flags = $sim_endian" 6>&1
161 fi],[sim_endian=""])dnl
164 AC_ARG_ENABLE(sim-env,
165 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
166 [case "${enableval}" in
167 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
168 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
169 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
170 no) sim_env="-DWITH_ENVIRONMENT=0";;
171 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
173 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
174 echo "Setting env flags = $sim_env" 6>&1
178 AC_ARG_ENABLE(sim-filter,
179 [ --enable-sim-filter=rule Specify filter rules.],
180 [case "${enableval}" in
181 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
183 *) sim_filter="-F $enableval";;
185 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
186 echo "Setting filter flags = $sim_filter" 6>&1
187 fi],[sim_filter="-F 32,f,o"
188 if test x"$silent" != x"yes"; then
189 echo "Setting filter flags = $sim_filter" 6>&1
193 AC_ARG_ENABLE(sim-float,
194 [ --enable-sim-float Specify whether the target has hard, soft, altivec or e500 floating point.],
195 [case "${enableval}" in
196 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
197 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
198 altivec) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
199 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
200 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
202 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
203 echo "Setting float flags = $sim_float" 6>&1
206 *altivec*) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
207 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
212 AC_CACHE_CHECK([if union semun defined],
213 ac_cv_HAS_UNION_SEMUN,
215 #include <sys/types.h>
217 #include <sys/sem.h>],
219 [ac_cv_has_union_semun="yes"],
220 [ac_cv_has_union_semun="no"])
221 AC_MSG_RESULT($ac_cv_has_union_semun)
225 if test "$ac_cv_has_union_semun" = "yes"; then
226 AC_CACHE_CHECK(whether System V semaphores are supported,
231 #include <sys/types.h>
237 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
240 arg.val = 0; /* avoid implicit type cast to union */
241 if (semctl(id, 0, IPC_RMID, arg) == -1)
246 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
248 else # semun is not defined
249 AC_CACHE_CHECK(whether System V semaphores are supported,
254 #include <sys/types.h>
259 struct semid_ds *buf;
265 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
268 arg.val = 0; /* avoid implicit type cast to union */
269 if (semctl(id, 0, IPC_RMID, arg) == -1)
274 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
278 AC_CACHE_CHECK(whether System V shared memory is supported,
282 #include <sys/types.h>
286 int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
289 if (shmctl(id, IPC_RMID, 0) == -1)
294 ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
297 if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
298 sim_sysv_ipc_hw=",sem,shm";
303 if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
304 AC_DEFINE(HAVE_UNION_SEMUN, 1,
305 [Define if union semun is defined in <sys/sem.h>])
309 AC_ARG_ENABLE(sim-hardware,
310 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
311 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
312 case "${enableval}" in
314 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
315 ,*) hardware="${hardware}${enableval}";;
316 *,) hardware="${enableval}${hardware}";;
317 *) hardware="${enableval}"'';;
319 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
320 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
321 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
322 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
323 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
324 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
325 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
326 if test x"$silent" != x"yes"; then
327 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
330 AC_ARG_ENABLE(sim-hostbitsize,
331 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
332 [case "${enableval}" in
333 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
334 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
336 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
337 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
338 fi],[sim_hostbitsize=""])dnl
341 AC_ARG_ENABLE(sim-hostendian,
342 [ --enable-sim-hostendian=end Specify host byte endian orientation.],
343 [case "${enableval}" in
344 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
345 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
346 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
347 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
349 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
350 echo "Setting hostendian flags = $sim_hostendian" 6>&1
352 if test "x$cross_compiling" = "xno"; then
354 if test $ac_cv_c_bigendian = yes; then
355 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
357 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
360 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
364 AC_ARG_ENABLE(sim-icache,
365 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
367 case "${enableval}" in
368 yes) icache="1024"; sim_icache="-I $icache";;
369 no) sim_icache="-R";;
372 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
374 define) sim_icache="${sim_icache}R";;
375 semantic) sim_icache="${sim_icache}C";;
376 insn) sim_icache="${sim_icache}S";;
377 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
378 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
381 sim_icache="${sim_icache}I $icache";;
383 if test x"$silent" != x"yes" && test x"$icache" != x""; then
384 echo "Setting instruction cache size to $icache ($sim_icache)"
385 fi],[sim_icache="-CSRI 1024"
386 if test x"$silent" != x"yes"; then
387 echo "Setting instruction cache size to 1024 ($sim_icache)"
391 AC_ARG_ENABLE(sim-inline,
392 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
395 no) sim_inline="-DDEFAULT_INLINE=0";;
396 0) sim_inline="-DDEFAULT_INLINE=0";;
397 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
398 1) sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS";;
399 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
402 *_INLINE=*) new_flag="-D$x";;
403 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
404 *_INLINE) new_flag="-D$x=ALL_INLINE";;
405 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
407 if test x"$sim_inline" = x""; then
408 sim_inline="$new_flag"
410 sim_inline="$sim_inline $new_flag"
414 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
415 echo "Setting inline flags = $sim_inline" 6>&1
416 fi],[if test x"$GCC" != ""; then
417 sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS"
418 if test x"$silent" != x"yes"; then
419 echo "Setting inline flags = $sim_inline" 6>&1
426 AC_ARG_ENABLE(sim-jump,
427 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
428 [case "${enableval}" in
431 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
433 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
434 echo "Setting jump flag = $sim_jump" 6>&1
436 if test x"$silent" != x"yes"; then
437 echo "Setting jump flag = $sim_jump" 6>&1
441 AC_ARG_ENABLE(sim-line-nr,
442 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
443 [case "${enableval}" in
444 yes) sim_line_nr="";;
445 no) sim_line_nr="-L";;
446 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
448 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
449 echo "Setting warning flags = $sim_line_nr" 6>&1
450 fi],[sim_line_nr=""])dnl
453 AC_ARG_ENABLE(sim-model,
454 [ --enable-sim-model=which Specify PowerPC to model.],
455 [case "${enableval}" in
456 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
457 *) sim_model="-DWITH_MODEL=${enableval}";;
459 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
460 echo "Setting model flags = $sim_model" 6>&1
461 fi],[sim_model=""])dnl
464 AC_ARG_ENABLE(sim-model-issue,
465 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
466 [case "${enableval}" in
467 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
468 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
469 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
471 if test x"$silent" != x"yes"; then
472 echo "Setting model-issue flags = $sim_model_issue" 6>&1
473 fi],[sim_model_issue=""])dnl
476 AC_ARG_ENABLE(sim-monitor,
477 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
478 [case "${enableval}" in
479 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
480 no) sim_monitor="-DWITH_MON=0";;
481 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
482 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
483 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
485 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
486 echo "Setting monitor flags = $sim_monitor" 6>&1
487 fi],[sim_monitor=""])dnl
490 AC_ARG_ENABLE(sim-opcode,
491 [ --enable-sim-opcode=which Override default opcode lookup.],
492 [case "${enableval}" in
493 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
494 *) if test -f "${srcdir}/${enableval}"; then
495 sim_opcode="${enableval}"
496 elif test -f "${srcdir}/dc-${enableval}"; then
497 sim_opcode="dc-${enableval}"
499 AC_MSG_ERROR("File $enableval is not an opcode rules file");
500 sim_opcode="dc-complex"
503 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
504 echo "Setting opcode flags = $sim_opcode" 6>&1
505 fi],[sim_opcode="dc-complex"
506 if test x"$silent" != x"yes"; then
507 echo "Setting opcode flags = $sim_opcode"
511 AC_ARG_ENABLE(sim-packages,
512 [ --enable-sim-packages=list Specify the packages to be included in the build.],
514 case "${enableval}" in
516 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
517 ,*) packages="${packages}${enableval}";;
518 *,) packages="${enableval}${packages}";;
519 *) packages="${enableval}"'';;
521 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
522 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
523 if test x"$silent" != x"yes" && test x"$packages" != x""; then
524 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
525 fi],[packages=disklabel
526 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
527 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
528 if test x"$silent" != x"yes"; then
529 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
533 AC_ARG_ENABLE(sim-regparm,
534 [ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
535 [case "${enableval}" in
536 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
537 no) sim_regparm="" ;;
538 yes) sim_regparm="-DWITH_REGPARM=3";;
539 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
541 if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
542 echo "Setting regparm flags = $sim_regparm" 6>&1
543 fi],[sim_regparm=""])dnl
546 AC_ARG_ENABLE(sim-reserved-bits,
547 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
548 [case "${enableval}" in
549 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
550 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
551 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
553 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
554 echo "Setting reserved flags = $sim_reserved" 6>&1
555 fi],[sim_reserved=""])dnl
558 AC_ARG_ENABLE(sim-smp,
559 [ --enable-sim-smp=n Specify number of processors to configure for.],
560 [case "${enableval}" in
561 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
562 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
563 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
565 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
566 echo "Setting smp flags = $sim_smp" 6>&1
567 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
568 if test x"$silent" != x"yes"; then
569 echo "Setting smp flags = $sim_smp" 6>&1
573 AC_ARG_ENABLE(sim-stdcall,
574 [ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
575 [case "${enableval}" in
576 no) sim_stdcall="" ;;
577 std*) sim_stdcall="-DWITH_STDCALL=1";;
578 yes) sim_stdcall="-DWITH_STDCALL=1";;
579 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
581 if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
582 echo "Setting function call flags = $sim_stdcall" 6>&1
583 fi],[sim_stdcall=""])dnl
586 AC_ARG_ENABLE(sim-stdio,
587 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
588 [case "${enableval}" in
589 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
590 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
591 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
593 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
594 echo "Setting stdio flags = $sim_stdio" 6>&1
595 fi],[sim_stdio=""])dnl
598 AC_ARG_ENABLE(sim-switch,
599 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
600 [case "${enableval}" in
601 yes) sim_switch="-s";;
603 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
605 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
606 echo "Setting switch flags = $sim_switch" 6>&1
608 if test x"$silent" != x"yes"; then
609 echo "Setting switch flags = $sim_switch" 6>&1
613 AC_ARG_ENABLE(sim-timebase,
614 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
615 [case "${enableval}" in
616 yes) sim_timebase="-DWITH_TIME_BASE=1";;
617 no) sim_timebase="-DWITH_TIME_BASE=0";;
618 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
620 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
621 echo "Setting timebase flags = $sim_timebase" 6>&1
622 fi],[sim_timebase=""])dnl
625 AC_ARG_ENABLE(sim-trace,
626 [ --enable-sim-trace Specify whether tracing is supported.],
627 [case "${enableval}" in
628 yes) sim_trace="-DWITH_TRACE=1";;
629 no) sim_trace="-DWITH_TRACE=0";;
630 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
632 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
633 echo "Setting trace flags = $sim_trace" 6>&1
634 fi],[sim_trace=""])dnl
637 AC_ARG_ENABLE(sim-warnings,
638 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
639 [case "${enableval}" in
640 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
641 no) sim_warnings="-w";;
642 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
644 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
645 echo "Setting warning flags = $sim_warnings" 6>&1
646 fi],[sim_warnings=""])dnl
649 AC_ARG_ENABLE(sim-xor-endian,
650 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
651 [case "${enableval}" in
652 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
653 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
654 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
656 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
657 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
658 fi],[sim_xor_endian=""])dnl
661 ACX_PKGVERSION([GDB])
662 ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
663 AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
664 AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
669 # BFD conditionally uses zlib, so we must link it in if libbfd does, by
670 # using the same condition.
671 AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
673 . ${srcdir}/../../bfd/configure.host
677 AC_DEFINE(USE_WIN32API, 1,
678 [Define if we should use the Windows API, instead of the
679 POSIX API. On Windows, we use the Windows API when
680 building for MinGW, but the POSIX API when building
685 AC_CONFIG_HEADER(config.h:config.in)
700 AC_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)
702 AC_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)
705 dnl Figure out what type of termio/termios support there is
707 AC_MSG_CHECKING(for struct termios)
708 AC_CACHE_VAL(ac_cv_termios_struct,
709 [AC_TRY_COMPILE([#include <sys/types.h>
710 #include <sys/termios.h>],
711 [static struct termios x;
717 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
718 AC_MSG_RESULT($ac_cv_termios_struct)
719 if test $ac_cv_termios_struct = yes; then
720 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
723 if test "$ac_cv_termios_struct" = "yes"; then
724 AC_MSG_CHECKING(for c_line field in struct termios)
725 AC_CACHE_VAL(ac_cv_termios_cline,
726 [AC_TRY_COMPILE([#include <sys/types.h>
727 #include <sys/termios.h>],
728 [static struct termios x; x.c_line = 0;],
729 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
731 AC_MSG_RESULT($ac_cv_termios_cline)
732 if test $ac_cv_termios_cline = yes; then
733 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
736 ac_cv_termios_cline=no
739 if test "$ac_cv_termios_struct" != "yes"; then
740 AC_MSG_CHECKING(for struct termio)
741 AC_CACHE_VAL(ac_cv_termio_struct,
742 [AC_TRY_COMPILE([#include <sys/types.h>
743 #include <sys/termio.h>],
744 [static struct termio x;
750 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
751 AC_MSG_RESULT($ac_cv_termio_struct)
752 if test $ac_cv_termio_struct = yes; then
753 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
756 ac_cv_termio_struct=no
759 if test "$ac_cv_termio_struct" = "yes"; then
760 AC_MSG_CHECKING(for c_line field in struct termio)
761 AC_CACHE_VAL(ac_cv_termio_cline,
762 [AC_TRY_COMPILE([#include <sys/types.h>
763 #include <sys/termio.h>],
764 [static struct termio x; x.c_line = 0;],
765 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
767 AC_MSG_RESULT($ac_cv_termio_cline)
768 if test $ac_cv_termio_cline = yes; then
769 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
772 ac_cv_termio_cline=no
775 dnl Check for struct statfs
776 AC_MSG_CHECKING(for struct statfs)
777 AC_CACHE_VAL(ac_cv_struct_statfs,
778 [AC_TRY_COMPILE([#include <sys/types.h>
779 #ifdef HAVE_SYS_PARAM_H
780 #include <sys/param.h>
782 #ifdef HAVE_SYS_MOUNT_H
783 #include <sys/mount.h>
785 #ifdef HAVE_SYS_VFS_H
788 #ifdef HAVE_SYS_STATFS_H
789 #include <sys/statfs.h>
791 [static struct statfs s;],
792 ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
793 AC_MSG_RESULT($ac_cv_struct_statfs)
794 if test $ac_cv_struct_statfs = yes; then
795 AC_DEFINE(HAVE_STRUCT_STATFS, 1,
796 [Define if struct statfs is defined in <sys/mount.h>])
799 AC_CHECK_TYPES(long long)
801 dnl Figure out if /dev/zero exists or not
803 AC_MSG_CHECKING(for /dev/zero)
804 AC_CACHE_VAL(ac_cv_devzero,
805 [AC_TRY_RUN([#include <fcntl.h>
809 int fd = open ("/dev/zero", O_RDONLY);
812 for (i = 0; i < sizeof (buf); i++)
814 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
816 for (i = 0; i < sizeof (buf); i++)
820 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
821 AC_MSG_RESULT($ac_cv_devzero)
822 if test $ac_cv_devzero = yes; then
823 sim_devzero="-DHAVE_DEVZERO"
828 dnl Figure out if we are in the new Cygnus tree with a common directory or not
829 AC_MSG_CHECKING(for common simulator directory)
830 if test -f "${srcdir}/../common/callback.c"; then
832 sim_callback="callback.o targ-map.o"
833 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
840 AC_MSG_CHECKING(for common simulator directory fpu implementation)
841 if test -f "${srcdir}/../common/sim-fpu.c"; then
843 sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
851 # Since we run commands on the build system, we have to create a
852 # separate config header for the build system if build != host.
853 if test x$host = x$build; then
854 AC_CONFIG_COMMANDS([build-config.h],[cp config.h build-config.h])
861 /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
862 *) realsrcdir=../${srcdir};;
864 saved_CFLAGS="${CFLAGS}"
865 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
866 LDFLAGS="${LDFLAGS_FOR_BUILD}" \
867 ${realsrcdir}/configure \
868 --enable-languages=${enable_languages-all} \
869 --target=$target_alias --host=$build_alias --build=$build_alias
870 CFLAGS="${saved_CFLAGS}"
871 mv config.h ../build-config.h
876 dnl Check for exe extension
879 AC_SUBST(CC_FOR_BUILD)
880 AC_SUBST(CFLAGS_FOR_BUILD)
887 AC_SUBST(sim_warnings)
888 AC_SUBST(sim_line_nr)
893 AC_SUBST(sim_decode_mechanism)
904 AC_SUBST(sim_regparm)
905 AC_SUBST(sim_stdcall)
906 AC_SUBST(sim_xor_endian)
907 AC_SUBST(sim_hostendian)
909 AC_SUBST(sim_igen_smp)
910 AC_SUBST(sim_bitsize)
911 AC_SUBST(sim_hostbitsize)
913 AC_SUBST(sim_timebase)
914 AC_SUBST(sim_alignment)
918 AC_SUBST(sim_reserved)
919 AC_SUBST(sim_monitor)
921 AC_SUBST(sim_default_model)
922 AC_SUBST(sim_model_issue)
925 AC_SUBST(sim_devzero)
926 AC_SUBST(sim_callback)
927 AC_SUBST(sim_targ_vals)
928 AC_SUBST(sim_fpu_cflags)
932 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])