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