gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / sim / ppc / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(Makefile.in)
3 sinclude(../common/acinclude.m4)
4
5 AC_PROG_INSTALL
6 AC_PROG_CC
7
8 # Put a plausible default for CC_FOR_BUILD in Makefile.
9 if test "x$cross_compiling" = "xno"; then
10 CC_FOR_BUILD='$(CC)'
11 else
12 CC_FOR_BUILD=gcc
13 fi
14 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
15
16 dnl We don't use gettext, but bfd does. So we do the appropriate checks
17 dnl to see if there are intl libraries we should link against.
18 ALL_LINGUAS=
19 ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
20
21
22 AC_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="";;
29 esac
30 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
31 echo "Setting alignment flags = $sim_alignment" 6>&1
32 fi],[sim_alignment=""])dnl
33
34
35 AC_MSG_CHECKING([whether to enable sim asserts])
36 sim_assert="1"
37 AC_ARG_ENABLE(sim-assert,
38 [ --enable-sim-assert Specify whether to perform random assertions.],
39 [case "${enableval}" in
40 yes) sim_assert="1";;
41 no) sim_assert="0";;
42 *) AC_MSG_ERROR([--enable-sim-assert does not take a value]);;
43 esac])dnl
44 AC_DEFINE_UNQUOTED([WITH_ASSERT], [$sim_assert], [Sim assert settings])
45 AC_MSG_RESULT($sim_assert)
46
47
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="";;
53 esac
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
57
58
59 AC_ARG_ENABLE(sim-config,
60 [ --enable-sim-config=file Override default config file],
61 [case "${enableval}" in
62 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
63 *) if test -f "${srcdir}/${enableval}"; then
64 sim_config="${enableval}";
65 elif test -f "${srcdir}/${enableval}-config.h"; then
66 sim_config="${enableval}-config.h"
67 else
68 AC_MSG_ERROR("Config file $enableval was not found");
69 sim_config=std-config.h
70 fi;;
71 esac
72 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
73 echo "Setting config flags = $sim_config" 6>&1
74 fi],[sim_config="std-config.h"
75 if test x"$silent" != x"yes"; then
76 echo "Setting config flags = $sim_config" 6>&1
77 fi])dnl
78
79
80 AC_ARG_ENABLE(sim-decode-mechanism,
81 [ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
82 [case "${enableval}" in
83 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
84 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
85 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
86 sim_decode_mechanism="switch";;
87 esac
88 if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
89 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
90 fi],[sim_decode_mechanism=""
91 if test x"$silent" != x"yes"; then
92 echo "Setting decode mechanism flags = $sim_decode_mechanism"
93 fi])dnl
94
95
96 AC_ARG_ENABLE(sim-default-model,
97 [ --enable-sim-default-model=which Specify default PowerPC to model.],
98 [case "${enableval}" in
99 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
100 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
101 esac
102 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
103 echo "Setting default-model flags = $sim_default_model" 6>&1
104 fi],[sim_default_model=""])dnl
105
106
107 AC_ARG_ENABLE(sim-duplicate,
108 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
109 [case "${enableval}" in
110 yes) sim_dup="-E";;
111 no) sim_dup="";;
112 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
113 esac
114 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
115 echo "Setting duplicate flags = $sim_dup" 6>&1
116 fi],[sim_dup="-E"
117 if test x"$silent" != x"yes"; then
118 echo "Setting duplicate flags = $sim_dup" 6>&1
119 fi])dnl
120
121
122 AC_ARG_ENABLE(sim-endian,
123 [ --enable-sim-endian=endian Specify target byte endian orientation.],
124 [case "${enableval}" in
125 yes) case "$target" in
126 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
127 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
128 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
129 esac;;
130 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
131 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
132 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
133 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
134 esac
135 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
136 echo "Setting endian flags = $sim_endian" 6>&1
137 fi],[sim_endian=""])dnl
138
139
140 AC_MSG_CHECKING([default sim environment setting])
141 sim_env="0"
142 AC_ARG_ENABLE(sim-env,
143 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
144 [case "${enableval}" in
145 operating | os | oea) sim_env="OPERATING_ENVIRONMENT";;
146 virtual | vea) sim_env="VIRTUAL_ENVIRONMENT";;
147 user | uea) sim_env="USER_ENVIRONMENT";;
148 no) sim_env="0";;
149 *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-env]);;
150 esac])dnl
151 AC_DEFINE_UNQUOTED([WITH_ENVIRONMENT], [$sim_env], [Sim default environment])
152 AC_MSG_RESULT($sim_env)
153
154
155 AC_ARG_ENABLE(sim-filter,
156 [ --enable-sim-filter=rule Specify filter rules.],
157 [case "${enableval}" in
158 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
159 no) sim_filter="";;
160 *) sim_filter="-F $enableval";;
161 esac
162 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
163 echo "Setting filter flags = $sim_filter" 6>&1
164 fi],[sim_filter="-F 32,f,o"
165 if test x"$silent" != x"yes"; then
166 echo "Setting filter flags = $sim_filter" 6>&1
167 fi])dnl
168
169
170 AC_ARG_ENABLE(sim-float,
171 [ --enable-sim-float Specify whether the target has hard, soft, altivec or e500 floating point.],
172 [case "${enableval}" in
173 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
174 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
175 altivec) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
176 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
177 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
178 esac
179 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
180 echo "Setting float flags = $sim_float" 6>&1
181 fi],[
182 case "${target}" in
183 *altivec*) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
184 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
185 *) sim_float=""
186 esac
187 ])dnl
188
189 AC_CACHE_CHECK([if union semun defined],
190 ac_cv_HAS_UNION_SEMUN,
191 [AC_TRY_COMPILE([
192 #include <sys/types.h>
193 #include <sys/ipc.h>
194 #include <sys/sem.h>],
195 [union semun arg ;],
196 [ac_cv_has_union_semun="yes"],
197 [ac_cv_has_union_semun="no"])
198 AC_MSG_RESULT($ac_cv_has_union_semun)
199 ])
200
201
202 if test "$ac_cv_has_union_semun" = "yes"; then
203 AC_CACHE_CHECK(whether System V semaphores are supported,
204 ac_cv_sysv_sem,
205 [
206 AC_TRY_RUN(
207 [
208 #include <sys/types.h>
209 #include <sys/ipc.h>
210 #include <sys/sem.h>
211 int main () {
212 union semun arg ;
213
214 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
215 if (id == -1)
216 exit(1);
217 arg.val = 0; /* avoid implicit type cast to union */
218 if (semctl(id, 0, IPC_RMID, arg) == -1)
219 exit(1);
220 exit(0);
221 }
222 ],
223 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
224 ])
225 else # semun is not defined
226 AC_CACHE_CHECK(whether System V semaphores are supported,
227 ac_cv_sysv_sem,
228 [
229 AC_TRY_RUN(
230 [
231 #include <sys/types.h>
232 #include <sys/ipc.h>
233 #include <sys/sem.h>
234 union semun {
235 int val;
236 struct semid_ds *buf;
237 ushort *array;
238 };
239 int main () {
240 union semun arg ;
241
242 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
243 if (id == -1)
244 exit(1);
245 arg.val = 0; /* avoid implicit type cast to union */
246 if (semctl(id, 0, IPC_RMID, arg) == -1)
247 exit(1);
248 exit(0);
249 }
250 ],
251 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
252 ])
253 fi
254
255 AC_CACHE_CHECK(whether System V shared memory is supported,
256 ac_cv_sysv_shm,
257 [
258 AC_TRY_RUN([
259 #include <sys/types.h>
260 #include <sys/ipc.h>
261 #include <sys/shm.h>
262 int main () {
263 int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
264 if (id == -1)
265 exit(1);
266 if (shmctl(id, IPC_RMID, 0) == -1)
267 exit(1);
268 exit(0);
269 }
270 ],
271 ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
272 ])
273
274 if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
275 sim_sysv_ipc_hw=",sem,shm";
276 else
277 sim_sysv_ipc_hw="";
278 fi
279
280 if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
281 AC_DEFINE(HAVE_UNION_SEMUN, 1,
282 [Define if union semun is defined in <sys/sem.h>])
283 fi
284
285
286 AC_ARG_ENABLE(sim-hardware,
287 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
288 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
289 case "${enableval}" in
290 yes) ;;
291 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
292 ,*) hardware="${hardware}${enableval}";;
293 *,) hardware="${enableval}${hardware}";;
294 *) hardware="${enableval}"'';;
295 esac
296 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
297 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
298 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
299 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
300 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
301 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
302 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
303 if test x"$silent" != x"yes"; then
304 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
305 fi])dnl
306
307 AC_ARG_ENABLE(sim-hostbitsize,
308 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
309 [case "${enableval}" in
310 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
311 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
312 esac
313 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
314 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
315 fi],[sim_hostbitsize=""])dnl
316
317
318 AC_ARG_ENABLE(sim-hostendian,
319 [ --enable-sim-hostendian=end Specify host byte endian orientation.],
320 [case "${enableval}" in
321 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
322 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
323 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
324 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
325 esac
326 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
327 echo "Setting hostendian flags = $sim_hostendian" 6>&1
328 fi],[
329 if test "x$cross_compiling" = "xno"; then
330 AC_C_BIGENDIAN
331 if test $ac_cv_c_bigendian = yes; then
332 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
333 else
334 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
335 fi
336 else
337 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
338 fi])dnl
339
340
341 AC_ARG_ENABLE(sim-icache,
342 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
343 [icache="-R"
344 case "${enableval}" in
345 yes) icache="1024"; sim_icache="-I $icache";;
346 no) sim_icache="-R";;
347 *) icache=1024
348 sim_icache="-"
349 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
350 case "$x" in
351 define) sim_icache="${sim_icache}R";;
352 semantic) sim_icache="${sim_icache}C";;
353 insn) sim_icache="${sim_icache}S";;
354 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
355 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
356 esac
357 done
358 sim_icache="${sim_icache}I $icache";;
359 esac
360 if test x"$silent" != x"yes" && test x"$icache" != x""; then
361 echo "Setting instruction cache size to $icache ($sim_icache)"
362 fi],[sim_icache="-CSRI 1024"
363 if test x"$silent" != x"yes"; then
364 echo "Setting instruction cache size to 1024 ($sim_icache)"
365 fi])dnl
366
367
368 AC_ARG_ENABLE(sim-inline,
369 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
370 [sim_inline=""
371 case "$enableval" in
372 no) sim_inline="-DDEFAULT_INLINE=0";;
373 0) sim_inline="-DDEFAULT_INLINE=0";;
374 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
375 1) sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS";;
376 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
377 new_flag=""
378 case "$x" in
379 *_INLINE=*) new_flag="-D$x";;
380 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
381 *_INLINE) new_flag="-D$x=ALL_INLINE";;
382 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
383 esac
384 if test x"$sim_inline" = x""; then
385 sim_inline="$new_flag"
386 else
387 sim_inline="$sim_inline $new_flag"
388 fi
389 done;;
390 esac
391 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
392 echo "Setting inline flags = $sim_inline" 6>&1
393 fi],[if test x"$GCC" != ""; then
394 sim_inline="-DDEFAULT_INLINE=PSIM_INLINE_LOCALS"
395 if test x"$silent" != x"yes"; then
396 echo "Setting inline flags = $sim_inline" 6>&1
397 fi
398 else
399 sim_inline=""
400 fi])dnl
401
402
403 AC_ARG_ENABLE(sim-jump,
404 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
405 [case "${enableval}" in
406 yes) sim_jump="-J";;
407 no) sim_jump="";;
408 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
409 esac
410 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
411 echo "Setting jump flag = $sim_jump" 6>&1
412 fi],[sim_jump=""
413 if test x"$silent" != x"yes"; then
414 echo "Setting jump flag = $sim_jump" 6>&1
415 fi])dnl
416
417
418 AC_ARG_ENABLE(sim-line-nr,
419 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
420 [case "${enableval}" in
421 yes) sim_line_nr="";;
422 no) sim_line_nr="-L";;
423 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
424 esac
425 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
426 echo "Setting warning flags = $sim_line_nr" 6>&1
427 fi],[sim_line_nr=""])dnl
428
429
430 AC_ARG_ENABLE(sim-model,
431 [ --enable-sim-model=which Specify PowerPC to model.],
432 [case "${enableval}" in
433 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
434 *) sim_model="-DWITH_MODEL=${enableval}";;
435 esac
436 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
437 echo "Setting model flags = $sim_model" 6>&1
438 fi],[sim_model=""])dnl
439
440
441 AC_ARG_ENABLE(sim-model-issue,
442 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
443 [case "${enableval}" in
444 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
445 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
446 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
447 esac
448 if test x"$silent" != x"yes"; then
449 echo "Setting model-issue flags = $sim_model_issue" 6>&1
450 fi],[sim_model_issue=""])dnl
451
452
453 AC_ARG_ENABLE(sim-monitor,
454 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
455 [case "${enableval}" in
456 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
457 no) sim_monitor="-DWITH_MON=0";;
458 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
459 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
460 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
461 esac
462 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
463 echo "Setting monitor flags = $sim_monitor" 6>&1
464 fi],[sim_monitor=""])dnl
465
466
467 AC_ARG_ENABLE(sim-opcode,
468 [ --enable-sim-opcode=which Override default opcode lookup.],
469 [case "${enableval}" in
470 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
471 *) if test -f "${srcdir}/${enableval}"; then
472 sim_opcode="${enableval}"
473 elif test -f "${srcdir}/dc-${enableval}"; then
474 sim_opcode="dc-${enableval}"
475 else
476 AC_MSG_ERROR("File $enableval is not an opcode rules file");
477 sim_opcode="dc-complex"
478 fi;;
479 esac
480 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
481 echo "Setting opcode flags = $sim_opcode" 6>&1
482 fi],[sim_opcode="dc-complex"
483 if test x"$silent" != x"yes"; then
484 echo "Setting opcode flags = $sim_opcode"
485 fi])dnl
486
487
488 AC_ARG_ENABLE(sim-packages,
489 [ --enable-sim-packages=list Specify the packages to be included in the build.],
490 [packages=disklabel
491 case "${enableval}" in
492 yes) ;;
493 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
494 ,*) packages="${packages}${enableval}";;
495 *,) packages="${enableval}${packages}";;
496 *) packages="${enableval}"'';;
497 esac
498 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
499 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
500 if test x"$silent" != x"yes" && test x"$packages" != x""; then
501 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
502 fi],[packages=disklabel
503 sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
504 sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
505 if test x"$silent" != x"yes"; then
506 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
507 fi])dnl
508
509
510 AC_ARG_ENABLE(sim-reserved-bits,
511 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
512 [case "${enableval}" in
513 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
514 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
515 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
516 esac
517 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
518 echo "Setting reserved flags = $sim_reserved" 6>&1
519 fi],[sim_reserved=""])dnl
520
521
522 AC_ARG_ENABLE(sim-smp,
523 [ --enable-sim-smp=n Specify number of processors to configure for.],
524 [case "${enableval}" in
525 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
526 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
527 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
528 esac
529 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
530 echo "Setting smp flags = $sim_smp" 6>&1
531 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
532 if test x"$silent" != x"yes"; then
533 echo "Setting smp flags = $sim_smp" 6>&1
534 fi])dnl
535
536
537 AC_MSG_CHECKING([for sim stdio debug behavior])
538 sim_stdio=0
539 AC_ARG_ENABLE(sim-stdio,
540 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
541 [case "${enableval}" in
542 yes) sim_stdio="DO_USE_STDIO";;
543 no) sim_stdio="DONT_USE_STDIO";;
544 *) AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-stdio]);;
545 esac])dnl
546 AC_DEFINE_UNQUOTED([WITH_STDIO], [$sim_stdio], [How to route I/O])
547 AC_MSG_RESULT($sim_stdio)
548
549
550 AC_ARG_ENABLE(sim-switch,
551 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
552 [case "${enableval}" in
553 yes) sim_switch="-s";;
554 no) sim_switch="";;
555 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
556 esac
557 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
558 echo "Setting switch flags = $sim_switch" 6>&1
559 fi],[sim_switch="";
560 if test x"$silent" != x"yes"; then
561 echo "Setting switch flags = $sim_switch" 6>&1
562 fi])dnl
563
564
565 AC_ARG_ENABLE(sim-timebase,
566 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
567 [case "${enableval}" in
568 yes) sim_timebase="-DWITH_TIME_BASE=1";;
569 no) sim_timebase="-DWITH_TIME_BASE=0";;
570 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
571 esac
572 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
573 echo "Setting timebase flags = $sim_timebase" 6>&1
574 fi],[sim_timebase=""])dnl
575
576
577 AC_MSG_CHECKING([for sim trace settings])
578 sim_trace="1"
579 AC_ARG_ENABLE(sim-trace,
580 [ --enable-sim-trace Specify whether tracing is supported.],
581 [case "${enableval}" in
582 yes) sim_trace="1";;
583 no) sim_trace="0";;
584 *) AC_MSG_ERROR([--enable-sim-trace does not take a value]);;
585 esac])dnl
586 AC_DEFINE_UNQUOTED([WITH_TRACE], [$sim_trace], [Sim trace settings])
587 AC_MSG_RESULT($sim_trace)
588
589
590 AC_ARG_ENABLE(sim-warnings,
591 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
592 [case "${enableval}" in
593 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
594 no) sim_warnings="-w";;
595 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
596 esac
597 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
598 echo "Setting warning flags = $sim_warnings" 6>&1
599 fi],[sim_warnings=""])dnl
600
601
602 AC_ARG_ENABLE(sim-xor-endian,
603 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
604 [case "${enableval}" in
605 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
606 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
607 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
608 esac
609 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
610 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
611 fi],[sim_xor_endian=""])dnl
612
613
614 ACX_PKGVERSION([GDB])
615 ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
616 AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
617 AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
618
619 AC_CANONICAL_SYSTEM
620 AC_ARG_PROGRAM
621
622 # BFD conditionally uses zlib, so we must link it in if libbfd does, by
623 # using the same condition.
624 AM_ZLIB
625
626 # BFD uses libdl when when plugins enabled.
627 AC_PLUGINS
628
629 . ${srcdir}/../../bfd/configure.host
630
631 case ${host} in
632 *mingw32*)
633 AC_DEFINE(USE_WIN32API, 1,
634 [Define if we should use the Windows API, instead of the
635 POSIX API. On Windows, we use the Windows API when
636 building for MinGW, but the POSIX API when building
637 for Cygwin.])
638 ;;
639 esac
640
641 AC_CONFIG_HEADER(config.h:config.in)
642
643 AC_STRUCT_ST_BLKSIZE
644 AC_STRUCT_ST_BLOCKS
645 AC_STRUCT_ST_RDEV
646 AC_STRUCT_TIMEZONE
647
648 AC_TYPE_GETGROUPS
649 AC_TYPE_MODE_T
650 AC_TYPE_OFF_T
651 AC_TYPE_PID_T
652 AC_TYPE_SIGNAL
653 AC_TYPE_SIZE_T
654 AC_TYPE_UID_T
655
656 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)
657
658 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)
659 AC_HEADER_DIRENT
660
661 dnl Figure out what type of termio/termios support there is
662 sim_termio=""
663 AC_MSG_CHECKING(for struct termios)
664 AC_CACHE_VAL(ac_cv_termios_struct,
665 [AC_TRY_COMPILE([#include <sys/types.h>
666 #include <sys/termios.h>],
667 [static struct termios x;
668 x.c_iflag = 0;
669 x.c_oflag = 0;
670 x.c_cflag = 0;
671 x.c_lflag = 0;
672 x.c_cc[NCCS] = 0;],
673 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
674 AC_MSG_RESULT($ac_cv_termios_struct)
675 if test $ac_cv_termios_struct = yes; then
676 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
677 fi
678
679 if test "$ac_cv_termios_struct" = "yes"; then
680 AC_MSG_CHECKING(for c_line field in struct termios)
681 AC_CACHE_VAL(ac_cv_termios_cline,
682 [AC_TRY_COMPILE([#include <sys/types.h>
683 #include <sys/termios.h>],
684 [static struct termios x; x.c_line = 0;],
685 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
686
687 AC_MSG_RESULT($ac_cv_termios_cline)
688 if test $ac_cv_termios_cline = yes; then
689 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
690 fi
691 else
692 ac_cv_termios_cline=no
693 fi
694
695 if test "$ac_cv_termios_struct" != "yes"; then
696 AC_MSG_CHECKING(for struct termio)
697 AC_CACHE_VAL(ac_cv_termio_struct,
698 [AC_TRY_COMPILE([#include <sys/types.h>
699 #include <sys/termio.h>],
700 [static struct termio x;
701 x.c_iflag = 0;
702 x.c_oflag = 0;
703 x.c_cflag = 0;
704 x.c_lflag = 0;
705 x.c_cc[NCC] = 0;],
706 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
707 AC_MSG_RESULT($ac_cv_termio_struct)
708 if test $ac_cv_termio_struct = yes; then
709 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
710 fi
711 else
712 ac_cv_termio_struct=no
713 fi
714
715 if test "$ac_cv_termio_struct" = "yes"; then
716 AC_MSG_CHECKING(for c_line field in struct termio)
717 AC_CACHE_VAL(ac_cv_termio_cline,
718 [AC_TRY_COMPILE([#include <sys/types.h>
719 #include <sys/termio.h>],
720 [static struct termio x; x.c_line = 0;],
721 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
722
723 AC_MSG_RESULT($ac_cv_termio_cline)
724 if test $ac_cv_termio_cline = yes; then
725 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
726 fi
727 else
728 ac_cv_termio_cline=no
729 fi
730
731 dnl Check for struct statfs
732 AC_MSG_CHECKING(for struct statfs)
733 AC_CACHE_VAL(ac_cv_struct_statfs,
734 [AC_TRY_COMPILE([#include <sys/types.h>
735 #ifdef HAVE_SYS_PARAM_H
736 #include <sys/param.h>
737 #endif
738 #ifdef HAVE_SYS_MOUNT_H
739 #include <sys/mount.h>
740 #endif
741 #ifdef HAVE_SYS_VFS_H
742 #include <sys/vfs.h>
743 #endif
744 #ifdef HAVE_SYS_STATFS_H
745 #include <sys/statfs.h>
746 #endif],
747 [static struct statfs s;],
748 ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
749 AC_MSG_RESULT($ac_cv_struct_statfs)
750 if test $ac_cv_struct_statfs = yes; then
751 AC_DEFINE(HAVE_STRUCT_STATFS, 1,
752 [Define if struct statfs is defined in <sys/mount.h>])
753 fi
754
755 AC_CHECK_TYPES(long long)
756
757 dnl Figure out if /dev/zero exists or not
758 sim_devzero=""
759 AC_MSG_CHECKING(for /dev/zero)
760 AC_CACHE_VAL(ac_cv_devzero,
761 [AC_TRY_RUN([#include <fcntl.h>
762 main () {
763 char buf[2048];
764 int i;
765 int fd = open ("/dev/zero", O_RDONLY);
766 if (fd < 0)
767 return 1;
768 for (i = 0; i < sizeof (buf); i++)
769 buf[i] = 1;
770 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
771 return 1;
772 for (i = 0; i < sizeof (buf); i++)
773 if (buf[i])
774 return 1;
775 return 0;
776 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
777 AC_MSG_RESULT($ac_cv_devzero)
778 if test $ac_cv_devzero = yes; then
779 sim_devzero="-DHAVE_DEVZERO"
780 else
781 sim_devzero=""
782 fi
783
784 dnl Figure out if we are in the new Cygnus tree with a common directory or not
785 AC_MSG_CHECKING(for common simulator directory)
786 if test -f "${srcdir}/../common/callback.c"; then
787 AC_MSG_RESULT(yes)
788 sim_callback="callback.o targ-map.o"
789 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
790 else
791 AC_MSG_RESULT(no)
792 sim_callback=""
793 sim_targ_vals=""
794 fi
795
796 AC_MSG_CHECKING(for common simulator directory fpu implementation)
797 if test -f "${srcdir}/../common/sim-fpu.c"; then
798 AC_MSG_RESULT(yes)
799 sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
800 sim_fpu="sim-fpu.o"
801 else
802 AC_MSG_RESULT(no)
803 sim_fpu_cflags=
804 sim_fpu=
805 fi
806
807 # Since we run commands on the build system, we have to create a
808 # separate config header for the build system if build != host.
809 if test x$host = x$build; then
810 AC_CONFIG_COMMANDS([build-config.h],[cp config.h build-config.h])
811 else
812 tempdir=build.$$
813 rm -rf $tempdir
814 mkdir $tempdir
815 cd $tempdir
816 case ${srcdir} in
817 /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
818 *) realsrcdir=../${srcdir};;
819 esac
820 saved_CFLAGS="${CFLAGS}"
821 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
822 LDFLAGS="${LDFLAGS_FOR_BUILD}" \
823 ${realsrcdir}/configure \
824 --enable-languages=${enable_languages-all} \
825 --target=$target_alias --host=$build_alias --build=$build_alias
826 CFLAGS="${saved_CFLAGS}"
827 mv config.h ../build-config.h
828 cd ..
829 rm -rf $tempdir
830 fi
831
832 dnl Check for exe extension
833 AC_EXEEXT
834
835 AC_SUBST(CC_FOR_BUILD)
836 AC_SUBST(CFLAGS_FOR_BUILD)
837 AC_SUBST(CFLAGS)
838 AC_SUBST(HDEFINES)
839 AR=${AR-ar}
840 AC_SUBST(AR)
841 AC_PROG_RANLIB
842 AC_SUBST(sim_warnings)
843 AC_SUBST(sim_line_nr)
844 AC_SUBST(sim_config)
845 AC_SUBST(sim_opcode)
846 AC_SUBST(sim_switch)
847 AC_SUBST(sim_dup)
848 AC_SUBST(sim_decode_mechanism)
849 AC_SUBST(sim_jump)
850 AC_SUBST(sim_filter)
851 AC_SUBST(sim_icache)
852 AC_SUBST(sim_hw_src)
853 AC_SUBST(sim_hw_obj)
854 AC_SUBST(sim_pk_src)
855 AC_SUBST(sim_pk_obj)
856 AC_SUBST(sim_inline)
857 AC_SUBST(sim_endian)
858 AC_SUBST(sim_xor_endian)
859 AC_SUBST(sim_hostendian)
860 AC_SUBST(sim_smp)
861 AC_SUBST(sim_igen_smp)
862 AC_SUBST(sim_bitsize)
863 AC_SUBST(sim_hostbitsize)
864 AC_SUBST(sim_timebase)
865 AC_SUBST(sim_alignment)
866 AC_SUBST(sim_float)
867 AC_SUBST(sim_reserved)
868 AC_SUBST(sim_monitor)
869 AC_SUBST(sim_model)
870 AC_SUBST(sim_default_model)
871 AC_SUBST(sim_model_issue)
872 AC_SUBST(sim_termio)
873 AC_SUBST(sim_devzero)
874 AC_SUBST(sim_callback)
875 AC_SUBST(sim_targ_vals)
876 AC_SUBST(sim_fpu_cflags)
877 AC_SUBST(sim_fpu)
878
879 AC_OUTPUT(Makefile,
880 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
This page took 0.052151 seconds and 4 git commands to generate.