]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/ppc/configure.ac
sim: ppc: inline the sim-packages option
[thirdparty/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 dnl The sim shouldn't be checking $target and changing behavior. But it is,
9 dnl and until we clean that up, we need to expand --target for use below.
10 AC_CANONICAL_SYSTEM
11
12 AC_ARG_ENABLE(sim-bitsize,
13 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
14 [case "${enableval}" in
15 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
16 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval. Expected 32 or 64"); sim_bitsize="";;
17 esac
18 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
19 echo "Setting bitsize flags = $sim_bitsize" 6>&1
20 fi],[sim_bitsize=""])dnl
21
22
23 AC_ARG_ENABLE(sim-decode-mechanism,
24 [ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
25 [case "${enableval}" in
26 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
27 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
28 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
29 sim_decode_mechanism="switch";;
30 esac
31 if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
32 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
33 fi],[sim_decode_mechanism=""
34 if test x"$silent" != x"yes"; then
35 echo "Setting decode mechanism flags = $sim_decode_mechanism"
36 fi])dnl
37
38
39 AC_ARG_ENABLE(sim-default-model,
40 [ --enable-sim-default-model=which Specify default PowerPC to model.],
41 [case "${enableval}" in
42 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
43 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
44 esac
45 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
46 echo "Setting default-model flags = $sim_default_model" 6>&1
47 fi],[sim_default_model=""])dnl
48
49
50 AC_ARG_ENABLE(sim-duplicate,
51 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
52 [case "${enableval}" in
53 yes) sim_dup="-E";;
54 no) sim_dup="";;
55 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
56 esac
57 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
58 echo "Setting duplicate flags = $sim_dup" 6>&1
59 fi],[sim_dup="-E"
60 if test x"$silent" != x"yes"; then
61 echo "Setting duplicate flags = $sim_dup" 6>&1
62 fi])dnl
63
64
65 AC_ARG_ENABLE(sim-filter,
66 [ --enable-sim-filter=rule Specify filter rules.],
67 [case "${enableval}" in
68 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
69 no) sim_filter="";;
70 *) sim_filter="-F $enableval";;
71 esac
72 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
73 echo "Setting filter flags = $sim_filter" 6>&1
74 fi],[sim_filter="-F 32,f,o"
75 if test x"$silent" != x"yes"; then
76 echo "Setting filter flags = $sim_filter" 6>&1
77 fi])dnl
78
79
80 AC_ARG_ENABLE(sim-float,
81 [ --enable-sim-float Specify whether the target has hard, soft, altivec or e500 floating point.],
82 [case "${enableval}" in
83 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
84 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
85 altivec) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
86 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
87 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
88 esac
89 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
90 echo "Setting float flags = $sim_float" 6>&1
91 fi],[
92 case "${target}" in
93 *altivec*) sim_float="-DWITH_ALTIVEC" ; sim_filter="${sim_filter},av" ;;
94 *spe*|*simd*) sim_float="-DWITH_E500" ; sim_filter="${sim_filter},e500" ;;
95 *) sim_float=""
96 esac
97 ])dnl
98
99 AC_CACHE_CHECK([if union semun defined],
100 ac_cv_HAS_UNION_SEMUN,
101 [AC_TRY_COMPILE([
102 #include <sys/types.h>
103 #include <sys/ipc.h>
104 #include <sys/sem.h>],
105 [union semun arg ;],
106 [ac_cv_has_union_semun="yes"],
107 [ac_cv_has_union_semun="no"])
108 AC_MSG_RESULT($ac_cv_has_union_semun)
109 ])
110
111
112 if test "$ac_cv_has_union_semun" = "yes"; then
113 AC_CACHE_CHECK(whether System V semaphores are supported,
114 ac_cv_sysv_sem,
115 [
116 AC_TRY_RUN(
117 [
118 #include <sys/types.h>
119 #include <sys/ipc.h>
120 #include <sys/sem.h>
121 int main () {
122 union semun arg ;
123
124 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
125 if (id == -1)
126 exit(1);
127 arg.val = 0; /* avoid implicit type cast to union */
128 if (semctl(id, 0, IPC_RMID, arg) == -1)
129 exit(1);
130 exit(0);
131 }
132 ],
133 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
134 ])
135 else # semun is not defined
136 AC_CACHE_CHECK(whether System V semaphores are supported,
137 ac_cv_sysv_sem,
138 [
139 AC_TRY_RUN(
140 [
141 #include <sys/types.h>
142 #include <sys/ipc.h>
143 #include <sys/sem.h>
144 union semun {
145 int val;
146 struct semid_ds *buf;
147 ushort *array;
148 };
149 int main () {
150 union semun arg ;
151
152 int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
153 if (id == -1)
154 exit(1);
155 arg.val = 0; /* avoid implicit type cast to union */
156 if (semctl(id, 0, IPC_RMID, arg) == -1)
157 exit(1);
158 exit(0);
159 }
160 ],
161 ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
162 ])
163 fi
164
165 AC_CACHE_CHECK(whether System V shared memory is supported,
166 ac_cv_sysv_shm,
167 [
168 AC_TRY_RUN([
169 #include <sys/types.h>
170 #include <sys/ipc.h>
171 #include <sys/shm.h>
172 int main () {
173 int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
174 if (id == -1)
175 exit(1);
176 if (shmctl(id, IPC_RMID, 0) == -1)
177 exit(1);
178 exit(0);
179 }
180 ],
181 ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
182 ])
183
184 if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
185 sim_sysv_ipc_hw=",sem,shm";
186 else
187 sim_sysv_ipc_hw="";
188 fi
189
190 if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
191 AC_DEFINE(HAVE_UNION_SEMUN, 1,
192 [Define if union semun is defined in <sys/sem.h>])
193 fi
194
195
196 AC_ARG_ENABLE(sim-hardware,
197 [ --enable-sim-hardware=list Specify the hardware to be included in the build.],
198 [hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
199 case "${enableval}" in
200 yes) ;;
201 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
202 ,*) hardware="${hardware}${enableval}";;
203 *,) hardware="${enableval}${hardware}";;
204 *) hardware="${enableval}"'';;
205 esac
206 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
207 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
208 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
209 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
210 fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
211 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
212 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
213 if test x"$silent" != x"yes"; then
214 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
215 fi])dnl
216
217 AC_ARG_ENABLE(sim-hostbitsize,
218 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
219 [case "${enableval}" in
220 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
221 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
222 esac
223 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
224 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
225 fi],[sim_hostbitsize=""])dnl
226
227
228 AC_ARG_ENABLE(sim-icache,
229 [ --enable-sim-icache=size Specify instruction-decode cache size and type.],
230 [icache="-R"
231 case "${enableval}" in
232 yes) icache="1024"; sim_icache="-I $icache";;
233 no) sim_icache="-R";;
234 *) icache=1024
235 sim_icache="-"
236 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
237 case "$x" in
238 define) sim_icache="${sim_icache}R";;
239 semantic) sim_icache="${sim_icache}C";;
240 insn) sim_icache="${sim_icache}S";;
241 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
242 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
243 esac
244 done
245 sim_icache="${sim_icache}I $icache";;
246 esac
247 if test x"$silent" != x"yes" && test x"$icache" != x""; then
248 echo "Setting instruction cache size to $icache ($sim_icache)"
249 fi],[sim_icache="-CSRI 1024"
250 if test x"$silent" != x"yes"; then
251 echo "Setting instruction cache size to 1024 ($sim_icache)"
252 fi])dnl
253
254
255 AC_ARG_ENABLE(sim-jump,
256 [ --enable-sim-jump Jump between semantic code (instead of call/return).],
257 [case "${enableval}" in
258 yes) sim_jump="-J";;
259 no) sim_jump="";;
260 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
261 esac
262 if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
263 echo "Setting jump flag = $sim_jump" 6>&1
264 fi],[sim_jump=""
265 if test x"$silent" != x"yes"; then
266 echo "Setting jump flag = $sim_jump" 6>&1
267 fi])dnl
268
269
270 AC_ARG_ENABLE(sim-line-nr,
271 [ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
272 [case "${enableval}" in
273 yes) sim_line_nr="";;
274 no) sim_line_nr="-L";;
275 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
276 esac
277 if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
278 echo "Setting warning flags = $sim_line_nr" 6>&1
279 fi],[sim_line_nr=""])dnl
280
281
282 AC_ARG_ENABLE(sim-model,
283 [ --enable-sim-model=which Specify PowerPC to model.],
284 [case "${enableval}" in
285 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
286 *) sim_model="-DWITH_MODEL=${enableval}";;
287 esac
288 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
289 echo "Setting model flags = $sim_model" 6>&1
290 fi],[sim_model=""])dnl
291
292
293 AC_ARG_ENABLE(sim-model-issue,
294 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
295 [case "${enableval}" in
296 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
297 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
298 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
299 esac
300 if test x"$silent" != x"yes"; then
301 echo "Setting model-issue flags = $sim_model_issue" 6>&1
302 fi],[sim_model_issue=""])dnl
303
304
305 AC_ARG_ENABLE(sim-monitor,
306 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
307 [case "${enableval}" in
308 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
309 no) sim_monitor="-DWITH_MON=0";;
310 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
311 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
312 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon");;
313 esac
314 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
315 echo "Setting monitor flags = $sim_monitor" 6>&1
316 fi],[sim_monitor=""])dnl
317
318
319 AC_ARG_ENABLE(sim-opcode,
320 [ --enable-sim-opcode=which Override default opcode lookup.],
321 [case "${enableval}" in
322 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
323 *) if test -f "${srcdir}/${enableval}"; then
324 sim_opcode="${enableval}"
325 elif test -f "${srcdir}/dc-${enableval}"; then
326 sim_opcode="dc-${enableval}"
327 else
328 AC_MSG_ERROR("File $enableval is not an opcode rules file");
329 sim_opcode="dc-complex"
330 fi;;
331 esac
332 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
333 echo "Setting opcode flags = $sim_opcode" 6>&1
334 fi],[sim_opcode="dc-complex"
335 if test x"$silent" != x"yes"; then
336 echo "Setting opcode flags = $sim_opcode"
337 fi])dnl
338
339
340 AC_ARG_ENABLE(sim-smp,
341 [ --enable-sim-smp=n Specify number of processors to configure for.],
342 [case "${enableval}" in
343 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
344 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
345 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
346 esac
347 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
348 echo "Setting smp flags = $sim_smp" 6>&1
349 fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
350 if test x"$silent" != x"yes"; then
351 echo "Setting smp flags = $sim_smp" 6>&1
352 fi])dnl
353
354
355 AC_ARG_ENABLE(sim-switch,
356 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
357 [case "${enableval}" in
358 yes) sim_switch="-s";;
359 no) sim_switch="";;
360 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
361 esac
362 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
363 echo "Setting switch flags = $sim_switch" 6>&1
364 fi],[sim_switch="";
365 if test x"$silent" != x"yes"; then
366 echo "Setting switch flags = $sim_switch" 6>&1
367 fi])dnl
368
369
370 AC_ARG_ENABLE(sim-timebase,
371 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
372 [case "${enableval}" in
373 yes) sim_timebase="-DWITH_TIME_BASE=1";;
374 no) sim_timebase="-DWITH_TIME_BASE=0";;
375 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
376 esac
377 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
378 echo "Setting timebase flags = $sim_timebase" 6>&1
379 fi],[sim_timebase=""])dnl
380
381
382 AC_ARG_ENABLE(sim-xor-endian,
383 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
384 [case "${enableval}" in
385 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
386 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
387 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
388 esac
389 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
390 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
391 fi],[sim_xor_endian=""])dnl
392
393
394 case ${host} in
395 *mingw32*)
396 AC_DEFINE(USE_WIN32API, 1,
397 [Define if we should use the Windows API, instead of the
398 POSIX API. On Windows, we use the Windows API when
399 building for MinGW, but the POSIX API when building
400 for Cygwin.])
401 ;;
402 esac
403
404 AC_CONFIG_HEADER(config.h:config.in)
405
406
407 dnl Figure out what type of termio/termios support there is
408 sim_termio=""
409 AC_MSG_CHECKING(for struct termios)
410 AC_CACHE_VAL(ac_cv_termios_struct,
411 [AC_TRY_COMPILE([#include <sys/types.h>
412 #include <sys/termios.h>],
413 [static struct termios x;
414 x.c_iflag = 0;
415 x.c_oflag = 0;
416 x.c_cflag = 0;
417 x.c_lflag = 0;
418 x.c_cc[NCCS] = 0;],
419 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
420 AC_MSG_RESULT($ac_cv_termios_struct)
421 if test $ac_cv_termios_struct = yes; then
422 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
423 fi
424
425 if test "$ac_cv_termios_struct" = "yes"; then
426 AC_MSG_CHECKING(for c_line field in struct termios)
427 AC_CACHE_VAL(ac_cv_termios_cline,
428 [AC_TRY_COMPILE([#include <sys/types.h>
429 #include <sys/termios.h>],
430 [static struct termios x; x.c_line = 0;],
431 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
432
433 AC_MSG_RESULT($ac_cv_termios_cline)
434 if test $ac_cv_termios_cline = yes; then
435 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
436 fi
437 else
438 ac_cv_termios_cline=no
439 fi
440
441 if test "$ac_cv_termios_struct" != "yes"; then
442 AC_MSG_CHECKING(for struct termio)
443 AC_CACHE_VAL(ac_cv_termio_struct,
444 [AC_TRY_COMPILE([#include <sys/types.h>
445 #include <sys/termio.h>],
446 [static struct termio x;
447 x.c_iflag = 0;
448 x.c_oflag = 0;
449 x.c_cflag = 0;
450 x.c_lflag = 0;
451 x.c_cc[NCC] = 0;],
452 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
453 AC_MSG_RESULT($ac_cv_termio_struct)
454 if test $ac_cv_termio_struct = yes; then
455 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
456 fi
457 else
458 ac_cv_termio_struct=no
459 fi
460
461 if test "$ac_cv_termio_struct" = "yes"; then
462 AC_MSG_CHECKING(for c_line field in struct termio)
463 AC_CACHE_VAL(ac_cv_termio_cline,
464 [AC_TRY_COMPILE([#include <sys/types.h>
465 #include <sys/termio.h>],
466 [static struct termio x; x.c_line = 0;],
467 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
468
469 AC_MSG_RESULT($ac_cv_termio_cline)
470 if test $ac_cv_termio_cline = yes; then
471 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
472 fi
473 else
474 ac_cv_termio_cline=no
475 fi
476
477 dnl Check for struct statfs
478 AC_MSG_CHECKING(for struct statfs)
479 AC_CACHE_VAL(ac_cv_struct_statfs,
480 [AC_TRY_COMPILE([#include <sys/types.h>
481 #ifdef HAVE_SYS_PARAM_H
482 #include <sys/param.h>
483 #endif
484 #ifdef HAVE_SYS_MOUNT_H
485 #include <sys/mount.h>
486 #endif
487 #ifdef HAVE_SYS_VFS_H
488 #include <sys/vfs.h>
489 #endif
490 #ifdef HAVE_SYS_STATFS_H
491 #include <sys/statfs.h>
492 #endif],
493 [static struct statfs s;],
494 ac_cv_struct_statfs=yes, ac_cv_struct_statfs=no)])
495 AC_MSG_RESULT($ac_cv_struct_statfs)
496 if test $ac_cv_struct_statfs = yes; then
497 AC_DEFINE(HAVE_STRUCT_STATFS, 1,
498 [Define if struct statfs is defined in <sys/mount.h>])
499 fi
500
501 AC_CHECK_TYPES(long long)
502
503 dnl Figure out if /dev/zero exists or not
504 sim_devzero=""
505 AC_MSG_CHECKING(for /dev/zero)
506 AC_CACHE_VAL(ac_cv_devzero,
507 [AC_TRY_RUN([#include <fcntl.h>
508 main () {
509 char buf[2048];
510 int i;
511 int fd = open ("/dev/zero", O_RDONLY);
512 if (fd < 0)
513 return 1;
514 for (i = 0; i < sizeof (buf); i++)
515 buf[i] = 1;
516 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
517 return 1;
518 for (i = 0; i < sizeof (buf); i++)
519 if (buf[i])
520 return 1;
521 return 0;
522 }],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
523 AC_MSG_RESULT($ac_cv_devzero)
524 if test $ac_cv_devzero = yes; then
525 sim_devzero="-DHAVE_DEVZERO"
526 else
527 sim_devzero=""
528 fi
529
530 # Since we run commands on the build system, we have to create a
531 # separate config header for the build system if build != host.
532 if test x$host = x$build; then
533 AC_CONFIG_COMMANDS([build-config.h],[cp config.h build-config.h])
534 else
535 tempdir=build.$$
536 rm -rf $tempdir
537 mkdir $tempdir
538 cd $tempdir
539 case ${srcdir} in
540 /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
541 *) realsrcdir=../${srcdir};;
542 esac
543 saved_CFLAGS="${CFLAGS}"
544 # Put a plausible default for CC_FOR_BUILD in Makefile.
545 if test "x$cross_compiling" = "xno"; then
546 CC_FOR_BUILD='$(CC)'
547 else
548 CC_FOR_BUILD=gcc
549 fi
550 CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD-${CFLAGS}}" \
551 LDFLAGS="${LDFLAGS_FOR_BUILD}" \
552 ${realsrcdir}/configure \
553 --enable-languages=${enable_languages-all} \
554 --target=$target_alias --host=$build_alias --build=$build_alias
555 CFLAGS="${saved_CFLAGS}"
556 mv config.h ../build-config.h
557 cd ..
558 rm -rf $tempdir
559 fi
560
561 AC_SUBST(sim_line_nr)
562 AC_SUBST(sim_opcode)
563 AC_SUBST(sim_switch)
564 AC_SUBST(sim_dup)
565 AC_SUBST(sim_decode_mechanism)
566 AC_SUBST(sim_jump)
567 AC_SUBST(sim_filter)
568 AC_SUBST(sim_icache)
569 AC_SUBST(sim_hw_src)
570 AC_SUBST(sim_hw_obj)
571 AC_SUBST(sim_xor_endian)
572 AC_SUBST(sim_smp)
573 AC_SUBST(sim_igen_smp)
574 AC_SUBST(sim_bitsize)
575 AC_SUBST(sim_hostbitsize)
576 AC_SUBST(sim_timebase)
577 AC_SUBST(sim_float)
578 AC_SUBST(sim_monitor)
579 AC_SUBST(sim_model)
580 AC_SUBST(sim_default_model)
581 AC_SUBST(sim_model_issue)
582 AC_SUBST(sim_termio)
583 AC_SUBST(sim_devzero)
584
585 AC_OUTPUT(Makefile,
586 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])