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