]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/mips/configure
mips - for r5900 generate igen simulator.
[thirdparty/binutils-gdb.git] / sim / mips / configure
1 #! /bin/sh
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78 # Guess values for system-dependent variables and create Makefiles.
79 # Generated automatically using autoconf version 2.12
80 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
81 #
82 # This configure script is free software; the Free Software Foundation
83 # gives unlimited permission to copy, distribute and modify it.
84
85 # Defaults:
86 ac_help=
87 ac_default_prefix=/usr/local
88 # Any additions from configure.in:
89 ac_help="$ac_help
90 --enable-maintainer-mode Enable developer functionality."
91 ac_help="$ac_help
92 --enable-sim-bswap Use Host specific BSWAP instruction."
93 ac_help="$ac_help
94 --enable-sim-cflags=opts Extra CFLAGS for use in building simulator"
95 ac_help="$ac_help
96 --enable-sim-debug=opts Enable debugging flags"
97 ac_help="$ac_help
98 --enable-sim-stdio Specify whether to use stdio for console input/output."
99 ac_help="$ac_help
100 --enable-sim-trace=opts Enable tracing flags"
101 ac_help="$ac_help
102 --enable-sim-profile=opts Enable profiling flags"
103 ac_help="$ac_help
104 --enable-sim-inline=inlines Specify which functions should be inlined."
105 ac_help="$ac_help
106 --enable-sim-alignment=align Specify strict, nonstrict or forced alignment of memory accesses."
107 ac_help="$ac_help
108 --enable-sim-hostendian=end Specify host byte endian orientation."
109 ac_help="$ac_help
110 --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings"
111 ac_help="$ac_help
112 --enable-sim-endian=endian Specify target byte endian orientation."
113 ac_help="$ac_help
114 --enable-sim-bitsize=n Specify target bitsize (32 or 64)."
115 ac_help="$ac_help
116 --enable-sim-float Specify that the target processor has floating point hardware."
117 ac_help="$ac_help
118 --enable-sim-igen=opts Enable IGEN simulator"
119
120 # Initialize some variables set by options.
121 # The variables have the same names as the options, with
122 # dashes changed to underlines.
123 build=NONE
124 cache_file=./config.cache
125 exec_prefix=NONE
126 host=NONE
127 no_create=
128 nonopt=NONE
129 no_recursion=
130 prefix=NONE
131 program_prefix=NONE
132 program_suffix=NONE
133 program_transform_name=s,x,x,
134 silent=
135 site=
136 srcdir=
137 target=NONE
138 verbose=
139 x_includes=NONE
140 x_libraries=NONE
141 bindir='${exec_prefix}/bin'
142 sbindir='${exec_prefix}/sbin'
143 libexecdir='${exec_prefix}/libexec'
144 datadir='${prefix}/share'
145 sysconfdir='${prefix}/etc'
146 sharedstatedir='${prefix}/com'
147 localstatedir='${prefix}/var'
148 libdir='${exec_prefix}/lib'
149 includedir='${prefix}/include'
150 oldincludedir='/usr/include'
151 infodir='${prefix}/info'
152 mandir='${prefix}/man'
153
154 # Initialize some other variables.
155 subdirs=
156 MFLAGS= MAKEFLAGS=
157 # Maximum number of lines to put in a shell here document.
158 ac_max_here_lines=12
159
160 ac_prev=
161 for ac_option
162 do
163
164 # If the previous option needs an argument, assign it.
165 if test -n "$ac_prev"; then
166 eval "$ac_prev=\$ac_option"
167 ac_prev=
168 continue
169 fi
170
171 case "$ac_option" in
172 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
173 *) ac_optarg= ;;
174 esac
175
176 # Accept the important Cygnus configure options, so we can diagnose typos.
177
178 case "$ac_option" in
179
180 -bindir | --bindir | --bindi | --bind | --bin | --bi)
181 ac_prev=bindir ;;
182 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
183 bindir="$ac_optarg" ;;
184
185 -build | --build | --buil | --bui | --bu)
186 ac_prev=build ;;
187 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
188 build="$ac_optarg" ;;
189
190 -cache-file | --cache-file | --cache-fil | --cache-fi \
191 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
192 ac_prev=cache_file ;;
193 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
194 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
195 cache_file="$ac_optarg" ;;
196
197 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
198 ac_prev=datadir ;;
199 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
200 | --da=*)
201 datadir="$ac_optarg" ;;
202
203 -disable-* | --disable-*)
204 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
205 # Reject names that are not valid shell variable names.
206 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
207 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
208 fi
209 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
210 eval "enable_${ac_feature}=no" ;;
211
212 -enable-* | --enable-*)
213 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
214 # Reject names that are not valid shell variable names.
215 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
216 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
217 fi
218 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
219 case "$ac_option" in
220 *=*) ;;
221 *) ac_optarg=yes ;;
222 esac
223 eval "enable_${ac_feature}='$ac_optarg'" ;;
224
225 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
226 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
227 | --exec | --exe | --ex)
228 ac_prev=exec_prefix ;;
229 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
230 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
231 | --exec=* | --exe=* | --ex=*)
232 exec_prefix="$ac_optarg" ;;
233
234 -gas | --gas | --ga | --g)
235 # Obsolete; use --with-gas.
236 with_gas=yes ;;
237
238 -help | --help | --hel | --he)
239 # Omit some internal or obsolete options to make the list less imposing.
240 # This message is too long to be a string in the A/UX 3.1 sh.
241 cat << EOF
242 Usage: configure [options] [host]
243 Options: [defaults in brackets after descriptions]
244 Configuration:
245 --cache-file=FILE cache test results in FILE
246 --help print this message
247 --no-create do not create output files
248 --quiet, --silent do not print \`checking...' messages
249 --version print the version of autoconf that created configure
250 Directory and file names:
251 --prefix=PREFIX install architecture-independent files in PREFIX
252 [$ac_default_prefix]
253 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
254 [same as prefix]
255 --bindir=DIR user executables in DIR [EPREFIX/bin]
256 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
257 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
258 --datadir=DIR read-only architecture-independent data in DIR
259 [PREFIX/share]
260 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
261 --sharedstatedir=DIR modifiable architecture-independent data in DIR
262 [PREFIX/com]
263 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
264 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
265 --includedir=DIR C header files in DIR [PREFIX/include]
266 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
267 --infodir=DIR info documentation in DIR [PREFIX/info]
268 --mandir=DIR man documentation in DIR [PREFIX/man]
269 --srcdir=DIR find the sources in DIR [configure dir or ..]
270 --program-prefix=PREFIX prepend PREFIX to installed program names
271 --program-suffix=SUFFIX append SUFFIX to installed program names
272 --program-transform-name=PROGRAM
273 run sed PROGRAM on installed program names
274 EOF
275 cat << EOF
276 Host type:
277 --build=BUILD configure for building on BUILD [BUILD=HOST]
278 --host=HOST configure for HOST [guessed]
279 --target=TARGET configure for TARGET [TARGET=HOST]
280 Features and packages:
281 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
282 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
283 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
284 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
285 --x-includes=DIR X include files are in DIR
286 --x-libraries=DIR X library files are in DIR
287 EOF
288 if test -n "$ac_help"; then
289 echo "--enable and --with options recognized:$ac_help"
290 fi
291 exit 0 ;;
292
293 -host | --host | --hos | --ho)
294 ac_prev=host ;;
295 -host=* | --host=* | --hos=* | --ho=*)
296 host="$ac_optarg" ;;
297
298 -includedir | --includedir | --includedi | --included | --include \
299 | --includ | --inclu | --incl | --inc)
300 ac_prev=includedir ;;
301 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
302 | --includ=* | --inclu=* | --incl=* | --inc=*)
303 includedir="$ac_optarg" ;;
304
305 -infodir | --infodir | --infodi | --infod | --info | --inf)
306 ac_prev=infodir ;;
307 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
308 infodir="$ac_optarg" ;;
309
310 -libdir | --libdir | --libdi | --libd)
311 ac_prev=libdir ;;
312 -libdir=* | --libdir=* | --libdi=* | --libd=*)
313 libdir="$ac_optarg" ;;
314
315 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
316 | --libexe | --libex | --libe)
317 ac_prev=libexecdir ;;
318 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
319 | --libexe=* | --libex=* | --libe=*)
320 libexecdir="$ac_optarg" ;;
321
322 -localstatedir | --localstatedir | --localstatedi | --localstated \
323 | --localstate | --localstat | --localsta | --localst \
324 | --locals | --local | --loca | --loc | --lo)
325 ac_prev=localstatedir ;;
326 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
327 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
328 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
329 localstatedir="$ac_optarg" ;;
330
331 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
332 ac_prev=mandir ;;
333 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
334 mandir="$ac_optarg" ;;
335
336 -nfp | --nfp | --nf)
337 # Obsolete; use --without-fp.
338 with_fp=no ;;
339
340 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
341 | --no-cr | --no-c)
342 no_create=yes ;;
343
344 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
345 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
346 no_recursion=yes ;;
347
348 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
349 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
350 | --oldin | --oldi | --old | --ol | --o)
351 ac_prev=oldincludedir ;;
352 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
353 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
354 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
355 oldincludedir="$ac_optarg" ;;
356
357 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
358 ac_prev=prefix ;;
359 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
360 prefix="$ac_optarg" ;;
361
362 -program-prefix | --program-prefix | --program-prefi | --program-pref \
363 | --program-pre | --program-pr | --program-p)
364 ac_prev=program_prefix ;;
365 -program-prefix=* | --program-prefix=* | --program-prefi=* \
366 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
367 program_prefix="$ac_optarg" ;;
368
369 -program-suffix | --program-suffix | --program-suffi | --program-suff \
370 | --program-suf | --program-su | --program-s)
371 ac_prev=program_suffix ;;
372 -program-suffix=* | --program-suffix=* | --program-suffi=* \
373 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
374 program_suffix="$ac_optarg" ;;
375
376 -program-transform-name | --program-transform-name \
377 | --program-transform-nam | --program-transform-na \
378 | --program-transform-n | --program-transform- \
379 | --program-transform | --program-transfor \
380 | --program-transfo | --program-transf \
381 | --program-trans | --program-tran \
382 | --progr-tra | --program-tr | --program-t)
383 ac_prev=program_transform_name ;;
384 -program-transform-name=* | --program-transform-name=* \
385 | --program-transform-nam=* | --program-transform-na=* \
386 | --program-transform-n=* | --program-transform-=* \
387 | --program-transform=* | --program-transfor=* \
388 | --program-transfo=* | --program-transf=* \
389 | --program-trans=* | --program-tran=* \
390 | --progr-tra=* | --program-tr=* | --program-t=*)
391 program_transform_name="$ac_optarg" ;;
392
393 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
394 | -silent | --silent | --silen | --sile | --sil)
395 silent=yes ;;
396
397 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
398 ac_prev=sbindir ;;
399 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
400 | --sbi=* | --sb=*)
401 sbindir="$ac_optarg" ;;
402
403 -sharedstatedir | --sharedstatedir | --sharedstatedi \
404 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
405 | --sharedst | --shareds | --shared | --share | --shar \
406 | --sha | --sh)
407 ac_prev=sharedstatedir ;;
408 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
409 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
410 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
411 | --sha=* | --sh=*)
412 sharedstatedir="$ac_optarg" ;;
413
414 -site | --site | --sit)
415 ac_prev=site ;;
416 -site=* | --site=* | --sit=*)
417 site="$ac_optarg" ;;
418
419 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
420 ac_prev=srcdir ;;
421 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
422 srcdir="$ac_optarg" ;;
423
424 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
425 | --syscon | --sysco | --sysc | --sys | --sy)
426 ac_prev=sysconfdir ;;
427 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
428 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
429 sysconfdir="$ac_optarg" ;;
430
431 -target | --target | --targe | --targ | --tar | --ta | --t)
432 ac_prev=target ;;
433 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
434 target="$ac_optarg" ;;
435
436 -v | -verbose | --verbose | --verbos | --verbo | --verb)
437 verbose=yes ;;
438
439 -version | --version | --versio | --versi | --vers)
440 echo "configure generated by autoconf version 2.12"
441 exit 0 ;;
442
443 -with-* | --with-*)
444 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
445 # Reject names that are not valid shell variable names.
446 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
447 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
448 fi
449 ac_package=`echo $ac_package| sed 's/-/_/g'`
450 case "$ac_option" in
451 *=*) ;;
452 *) ac_optarg=yes ;;
453 esac
454 eval "with_${ac_package}='$ac_optarg'" ;;
455
456 -without-* | --without-*)
457 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
458 # Reject names that are not valid shell variable names.
459 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
460 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
461 fi
462 ac_package=`echo $ac_package| sed 's/-/_/g'`
463 eval "with_${ac_package}=no" ;;
464
465 --x)
466 # Obsolete; use --with-x.
467 with_x=yes ;;
468
469 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
470 | --x-incl | --x-inc | --x-in | --x-i)
471 ac_prev=x_includes ;;
472 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
473 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
474 x_includes="$ac_optarg" ;;
475
476 -x-libraries | --x-libraries | --x-librarie | --x-librari \
477 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
478 ac_prev=x_libraries ;;
479 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
480 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
481 x_libraries="$ac_optarg" ;;
482
483 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
484 ;;
485
486 *)
487 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
488 echo "configure: warning: $ac_option: invalid host type" 1>&2
489 fi
490 if test "x$nonopt" != xNONE; then
491 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
492 fi
493 nonopt="$ac_option"
494 ;;
495
496 esac
497 done
498
499 if test -n "$ac_prev"; then
500 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
501 fi
502
503 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
504
505 # File descriptor usage:
506 # 0 standard input
507 # 1 file creation
508 # 2 errors and warnings
509 # 3 some systems may open it to /dev/tty
510 # 4 used on the Kubota Titan
511 # 6 checking for... messages and results
512 # 5 compiler messages saved in config.log
513 if test "$silent" = yes; then
514 exec 6>/dev/null
515 else
516 exec 6>&1
517 fi
518 exec 5>./config.log
519
520 echo "\
521 This file contains any messages produced by compilers while
522 running configure, to aid debugging if configure makes a mistake.
523 " 1>&5
524
525 # Strip out --no-create and --no-recursion so they do not pile up.
526 # Also quote any args containing shell metacharacters.
527 ac_configure_args=
528 for ac_arg
529 do
530 case "$ac_arg" in
531 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
532 | --no-cr | --no-c) ;;
533 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
534 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
535 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
536 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
537 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
538 esac
539 done
540
541 # NLS nuisances.
542 # Only set these to C if already set. These must not be set unconditionally
543 # because not all systems understand e.g. LANG=C (notably SCO).
544 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
545 # Non-C LC_CTYPE values break the ctype check.
546 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
547 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
548 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
549 if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
550
551 # confdefs.h avoids OS command line length limits that DEFS can exceed.
552 rm -rf conftest* confdefs.h
553 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
554 echo > confdefs.h
555
556 # A filename unique to this package, relative to the directory that
557 # configure is in, which we can look for to find out if srcdir is correct.
558 ac_unique_file=Makefile.in
559
560 # Find the source files, if location was not specified.
561 if test -z "$srcdir"; then
562 ac_srcdir_defaulted=yes
563 # Try the directory containing this script, then its parent.
564 ac_prog=$0
565 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
566 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
567 srcdir=$ac_confdir
568 if test ! -r $srcdir/$ac_unique_file; then
569 srcdir=..
570 fi
571 else
572 ac_srcdir_defaulted=no
573 fi
574 if test ! -r $srcdir/$ac_unique_file; then
575 if test "$ac_srcdir_defaulted" = yes; then
576 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
577 else
578 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
579 fi
580 fi
581 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
582
583 # Prefer explicitly selected file to automatically selected ones.
584 if test -z "$CONFIG_SITE"; then
585 if test "x$prefix" != xNONE; then
586 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
587 else
588 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
589 fi
590 fi
591 for ac_site_file in $CONFIG_SITE; do
592 if test -r "$ac_site_file"; then
593 echo "loading site script $ac_site_file"
594 . "$ac_site_file"
595 fi
596 done
597
598 if test -r "$cache_file"; then
599 echo "loading cache $cache_file"
600 . $cache_file
601 else
602 echo "creating cache $cache_file"
603 > $cache_file
604 fi
605
606 ac_ext=c
607 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
608 ac_cpp='$CPP $CPPFLAGS'
609 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
610 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
611 cross_compiling=$ac_cv_prog_cc_cross
612
613 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
614 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
615 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
616 ac_n= ac_c='
617 ' ac_t=' '
618 else
619 ac_n=-n ac_c= ac_t=
620 fi
621 else
622 ac_n= ac_c='\c' ac_t=
623 fi
624
625
626
627 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
628 echo "configure:629: checking how to run the C preprocessor" >&5
629 # On Suns, sometimes $CPP names a directory.
630 if test -n "$CPP" && test -d "$CPP"; then
631 CPP=
632 fi
633 if test -z "$CPP"; then
634 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
635 echo $ac_n "(cached) $ac_c" 1>&6
636 else
637 # This must be in double quotes, not single quotes, because CPP may get
638 # substituted into the Makefile and "${CC-cc}" will confuse make.
639 CPP="${CC-cc} -E"
640 # On the NeXT, cc -E runs the code through the compiler's parser,
641 # not just through cpp.
642 cat > conftest.$ac_ext <<EOF
643 #line 644 "configure"
644 #include "confdefs.h"
645 #include <assert.h>
646 Syntax Error
647 EOF
648 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
649 { (eval echo configure:650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
650 ac_err=`grep -v '^ *+' conftest.out`
651 if test -z "$ac_err"; then
652 :
653 else
654 echo "$ac_err" >&5
655 echo "configure: failed program was:" >&5
656 cat conftest.$ac_ext >&5
657 rm -rf conftest*
658 CPP="${CC-cc} -E -traditional-cpp"
659 cat > conftest.$ac_ext <<EOF
660 #line 661 "configure"
661 #include "confdefs.h"
662 #include <assert.h>
663 Syntax Error
664 EOF
665 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
666 { (eval echo configure:667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
667 ac_err=`grep -v '^ *+' conftest.out`
668 if test -z "$ac_err"; then
669 :
670 else
671 echo "$ac_err" >&5
672 echo "configure: failed program was:" >&5
673 cat conftest.$ac_ext >&5
674 rm -rf conftest*
675 CPP=/lib/cpp
676 fi
677 rm -f conftest*
678 fi
679 rm -f conftest*
680 ac_cv_prog_CPP="$CPP"
681 fi
682 CPP="$ac_cv_prog_CPP"
683 else
684 ac_cv_prog_CPP="$CPP"
685 fi
686 echo "$ac_t""$CPP" 1>&6
687
688
689 # autoconf.info says this should be called right after AC_INIT.
690
691
692 ac_aux_dir=
693 for ac_dir in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../..; do
694 if test -f $ac_dir/install-sh; then
695 ac_aux_dir=$ac_dir
696 ac_install_sh="$ac_aux_dir/install-sh -c"
697 break
698 elif test -f $ac_dir/install.sh; then
699 ac_aux_dir=$ac_dir
700 ac_install_sh="$ac_aux_dir/install.sh -c"
701 break
702 fi
703 done
704 if test -z "$ac_aux_dir"; then
705 { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../.." 1>&2; exit 1; }
706 fi
707 ac_config_guess=$ac_aux_dir/config.guess
708 ac_config_sub=$ac_aux_dir/config.sub
709 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
710
711
712 # Do some error checking and defaulting for the host and target type.
713 # The inputs are:
714 # configure --host=HOST --target=TARGET --build=BUILD NONOPT
715 #
716 # The rules are:
717 # 1. You are not allowed to specify --host, --target, and nonopt at the
718 # same time.
719 # 2. Host defaults to nonopt.
720 # 3. If nonopt is not specified, then host defaults to the current host,
721 # as determined by config.guess.
722 # 4. Target and build default to nonopt.
723 # 5. If nonopt is not specified, then target and build default to host.
724
725 # The aliases save the names the user supplied, while $host etc.
726 # will get canonicalized.
727 case $host---$target---$nonopt in
728 NONE---*---* | *---NONE---* | *---*---NONE) ;;
729 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
730 esac
731
732
733 # Make sure we can run config.sub.
734 if $ac_config_sub sun4 >/dev/null 2>&1; then :
735 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
736 fi
737
738 echo $ac_n "checking host system type""... $ac_c" 1>&6
739 echo "configure:740: checking host system type" >&5
740
741 host_alias=$host
742 case "$host_alias" in
743 NONE)
744 case $nonopt in
745 NONE)
746 if host_alias=`$ac_config_guess`; then :
747 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
748 fi ;;
749 *) host_alias=$nonopt ;;
750 esac ;;
751 esac
752
753 host=`$ac_config_sub $host_alias`
754 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
755 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
756 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
757 echo "$ac_t""$host" 1>&6
758
759 echo $ac_n "checking target system type""... $ac_c" 1>&6
760 echo "configure:761: checking target system type" >&5
761
762 target_alias=$target
763 case "$target_alias" in
764 NONE)
765 case $nonopt in
766 NONE) target_alias=$host_alias ;;
767 *) target_alias=$nonopt ;;
768 esac ;;
769 esac
770
771 target=`$ac_config_sub $target_alias`
772 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
773 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
774 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
775 echo "$ac_t""$target" 1>&6
776
777 echo $ac_n "checking build system type""... $ac_c" 1>&6
778 echo "configure:779: checking build system type" >&5
779
780 build_alias=$build
781 case "$build_alias" in
782 NONE)
783 case $nonopt in
784 NONE) build_alias=$host_alias ;;
785 *) build_alias=$nonopt ;;
786 esac ;;
787 esac
788
789 build=`$ac_config_sub $build_alias`
790 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
791 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
792 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
793 echo "$ac_t""$build" 1>&6
794
795 test "$host_alias" != "$target_alias" &&
796 test "$program_prefix$program_suffix$program_transform_name" = \
797 NONENONEs,x,x, &&
798 program_prefix=${target_alias}-
799
800 if test "$program_transform_name" = s,x,x,; then
801 program_transform_name=
802 else
803 # Double any \ or $. echo might interpret backslashes.
804 cat <<\EOF_SED > conftestsed
805 s,\\,\\\\,g; s,\$,$$,g
806 EOF_SED
807 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
808 rm -f conftestsed
809 fi
810 test "$program_prefix" != NONE &&
811 program_transform_name="s,^,${program_prefix},; $program_transform_name"
812 # Use a double $ so make ignores it.
813 test "$program_suffix" != NONE &&
814 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
815
816 # sed with no file args requires a program.
817 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
818
819 # Extract the first word of "gcc", so it can be a program name with args.
820 set dummy gcc; ac_word=$2
821 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
822 echo "configure:823: checking for $ac_word" >&5
823 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
824 echo $ac_n "(cached) $ac_c" 1>&6
825 else
826 if test -n "$CC"; then
827 ac_cv_prog_CC="$CC" # Let the user override the test.
828 else
829 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
830 for ac_dir in $PATH; do
831 test -z "$ac_dir" && ac_dir=.
832 if test -f $ac_dir/$ac_word; then
833 ac_cv_prog_CC="gcc"
834 break
835 fi
836 done
837 IFS="$ac_save_ifs"
838 fi
839 fi
840 CC="$ac_cv_prog_CC"
841 if test -n "$CC"; then
842 echo "$ac_t""$CC" 1>&6
843 else
844 echo "$ac_t""no" 1>&6
845 fi
846
847 if test -z "$CC"; then
848 # Extract the first word of "cc", so it can be a program name with args.
849 set dummy cc; ac_word=$2
850 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
851 echo "configure:852: checking for $ac_word" >&5
852 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
853 echo $ac_n "(cached) $ac_c" 1>&6
854 else
855 if test -n "$CC"; then
856 ac_cv_prog_CC="$CC" # Let the user override the test.
857 else
858 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
859 ac_prog_rejected=no
860 for ac_dir in $PATH; do
861 test -z "$ac_dir" && ac_dir=.
862 if test -f $ac_dir/$ac_word; then
863 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
864 ac_prog_rejected=yes
865 continue
866 fi
867 ac_cv_prog_CC="cc"
868 break
869 fi
870 done
871 IFS="$ac_save_ifs"
872 if test $ac_prog_rejected = yes; then
873 # We found a bogon in the path, so make sure we never use it.
874 set dummy $ac_cv_prog_CC
875 shift
876 if test $# -gt 0; then
877 # We chose a different compiler from the bogus one.
878 # However, it has the same basename, so the bogon will be chosen
879 # first if we set CC to just the basename; use the full file name.
880 shift
881 set dummy "$ac_dir/$ac_word" "$@"
882 shift
883 ac_cv_prog_CC="$@"
884 fi
885 fi
886 fi
887 fi
888 CC="$ac_cv_prog_CC"
889 if test -n "$CC"; then
890 echo "$ac_t""$CC" 1>&6
891 else
892 echo "$ac_t""no" 1>&6
893 fi
894
895 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
896 fi
897
898 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
899 echo "configure:900: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
900
901 ac_ext=c
902 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
903 ac_cpp='$CPP $CPPFLAGS'
904 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
905 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
906 cross_compiling=$ac_cv_prog_cc_cross
907
908 cat > conftest.$ac_ext <<EOF
909 #line 910 "configure"
910 #include "confdefs.h"
911 main(){return(0);}
912 EOF
913 if { (eval echo configure:914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
914 ac_cv_prog_cc_works=yes
915 # If we can't run a trivial program, we are probably using a cross compiler.
916 if (./conftest; exit) 2>/dev/null; then
917 ac_cv_prog_cc_cross=no
918 else
919 ac_cv_prog_cc_cross=yes
920 fi
921 else
922 echo "configure: failed program was:" >&5
923 cat conftest.$ac_ext >&5
924 ac_cv_prog_cc_works=no
925 fi
926 rm -fr conftest*
927
928 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
929 if test $ac_cv_prog_cc_works = no; then
930 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
931 fi
932 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
933 echo "configure:934: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
934 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
935 cross_compiling=$ac_cv_prog_cc_cross
936
937 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
938 echo "configure:939: checking whether we are using GNU C" >&5
939 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
940 echo $ac_n "(cached) $ac_c" 1>&6
941 else
942 cat > conftest.c <<EOF
943 #ifdef __GNUC__
944 yes;
945 #endif
946 EOF
947 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
948 ac_cv_prog_gcc=yes
949 else
950 ac_cv_prog_gcc=no
951 fi
952 fi
953
954 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
955
956 if test $ac_cv_prog_gcc = yes; then
957 GCC=yes
958 ac_test_CFLAGS="${CFLAGS+set}"
959 ac_save_CFLAGS="$CFLAGS"
960 CFLAGS=
961 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
962 echo "configure:963: checking whether ${CC-cc} accepts -g" >&5
963 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
964 echo $ac_n "(cached) $ac_c" 1>&6
965 else
966 echo 'void f(){}' > conftest.c
967 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
968 ac_cv_prog_cc_g=yes
969 else
970 ac_cv_prog_cc_g=no
971 fi
972 rm -f conftest*
973
974 fi
975
976 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
977 if test "$ac_test_CFLAGS" = set; then
978 CFLAGS="$ac_save_CFLAGS"
979 elif test $ac_cv_prog_cc_g = yes; then
980 CFLAGS="-g -O2"
981 else
982 CFLAGS="-O2"
983 fi
984 else
985 GCC=
986 test "${CFLAGS+set}" = set || CFLAGS="-g"
987 fi
988
989 # Find a good install program. We prefer a C program (faster),
990 # so one script is as good as another. But avoid the broken or
991 # incompatible versions:
992 # SysV /etc/install, /usr/sbin/install
993 # SunOS /usr/etc/install
994 # IRIX /sbin/install
995 # AIX /bin/install
996 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
997 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
998 # ./install, which can be erroneously created by make from ./install.sh.
999 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1000 echo "configure:1001: checking for a BSD compatible install" >&5
1001 if test -z "$INSTALL"; then
1002 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1003 echo $ac_n "(cached) $ac_c" 1>&6
1004 else
1005 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
1006 for ac_dir in $PATH; do
1007 # Account for people who put trailing slashes in PATH elements.
1008 case "$ac_dir/" in
1009 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1010 *)
1011 # OSF1 and SCO ODT 3.0 have their own names for install.
1012 for ac_prog in ginstall installbsd scoinst install; do
1013 if test -f $ac_dir/$ac_prog; then
1014 if test $ac_prog = install &&
1015 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1016 # AIX install. It has an incompatible calling convention.
1017 # OSF/1 installbsd also uses dspmsg, but is usable.
1018 :
1019 else
1020 ac_cv_path_install="$ac_dir/$ac_prog -c"
1021 break 2
1022 fi
1023 fi
1024 done
1025 ;;
1026 esac
1027 done
1028 IFS="$ac_save_IFS"
1029
1030 fi
1031 if test "${ac_cv_path_install+set}" = set; then
1032 INSTALL="$ac_cv_path_install"
1033 else
1034 # As a last resort, use the slow shell script. We don't cache a
1035 # path for INSTALL within a source directory, because that will
1036 # break other packages using the cache if that directory is
1037 # removed, or if the path is relative.
1038 INSTALL="$ac_install_sh"
1039 fi
1040 fi
1041 echo "$ac_t""$INSTALL" 1>&6
1042
1043 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1044 # It thinks the first close brace ends the variable substitution.
1045 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1046
1047 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1048
1049
1050 # Put a plausible default for CC_FOR_BUILD in Makefile.
1051 if test "x$cross_compiling" = "xno"; then
1052 CC_FOR_BUILD='$(CC)'
1053 else
1054 CC_FOR_BUILD=gcc
1055 fi
1056
1057
1058
1059
1060 AR=${AR-ar}
1061
1062 # Extract the first word of "ranlib", so it can be a program name with args.
1063 set dummy ranlib; ac_word=$2
1064 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1065 echo "configure:1066: checking for $ac_word" >&5
1066 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1067 echo $ac_n "(cached) $ac_c" 1>&6
1068 else
1069 if test -n "$RANLIB"; then
1070 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1071 else
1072 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1073 for ac_dir in $PATH; do
1074 test -z "$ac_dir" && ac_dir=.
1075 if test -f $ac_dir/$ac_word; then
1076 ac_cv_prog_RANLIB="ranlib"
1077 break
1078 fi
1079 done
1080 IFS="$ac_save_ifs"
1081 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1082 fi
1083 fi
1084 RANLIB="$ac_cv_prog_RANLIB"
1085 if test -n "$RANLIB"; then
1086 echo "$ac_t""$RANLIB" 1>&6
1087 else
1088 echo "$ac_t""no" 1>&6
1089 fi
1090
1091
1092 # Check for common headers.
1093 # FIXME: Seems to me this can cause problems for i386-windows hosts.
1094 # At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*.
1095 for ac_hdr in stdlib.h string.h strings.h unistd.h time.h sys/time.h sys/resource.h
1096 do
1097 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1098 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1099 echo "configure:1100: checking for $ac_hdr" >&5
1100 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1101 echo $ac_n "(cached) $ac_c" 1>&6
1102 else
1103 cat > conftest.$ac_ext <<EOF
1104 #line 1105 "configure"
1105 #include "confdefs.h"
1106 #include <$ac_hdr>
1107 EOF
1108 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1109 { (eval echo configure:1110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1110 ac_err=`grep -v '^ *+' conftest.out`
1111 if test -z "$ac_err"; then
1112 rm -rf conftest*
1113 eval "ac_cv_header_$ac_safe=yes"
1114 else
1115 echo "$ac_err" >&5
1116 echo "configure: failed program was:" >&5
1117 cat conftest.$ac_ext >&5
1118 rm -rf conftest*
1119 eval "ac_cv_header_$ac_safe=no"
1120 fi
1121 rm -f conftest*
1122 fi
1123 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1124 echo "$ac_t""yes" 1>&6
1125 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1126 cat >> confdefs.h <<EOF
1127 #define $ac_tr_hdr 1
1128 EOF
1129
1130 else
1131 echo "$ac_t""no" 1>&6
1132 fi
1133 done
1134
1135 for ac_func in getrusage time sigaction
1136 do
1137 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1138 echo "configure:1139: checking for $ac_func" >&5
1139 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1140 echo $ac_n "(cached) $ac_c" 1>&6
1141 else
1142 cat > conftest.$ac_ext <<EOF
1143 #line 1144 "configure"
1144 #include "confdefs.h"
1145 /* System header to define __stub macros and hopefully few prototypes,
1146 which can conflict with char $ac_func(); below. */
1147 #include <assert.h>
1148 /* Override any gcc2 internal prototype to avoid an error. */
1149 /* We use char because int might match the return type of a gcc2
1150 builtin and then its argument prototype would still apply. */
1151 char $ac_func();
1152
1153 int main() {
1154
1155 /* The GNU C library defines this for functions which it implements
1156 to always fail with ENOSYS. Some functions are actually named
1157 something starting with __ and the normal name is an alias. */
1158 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1159 choke me
1160 #else
1161 $ac_func();
1162 #endif
1163
1164 ; return 0; }
1165 EOF
1166 if { (eval echo configure:1167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1167 rm -rf conftest*
1168 eval "ac_cv_func_$ac_func=yes"
1169 else
1170 echo "configure: failed program was:" >&5
1171 cat conftest.$ac_ext >&5
1172 rm -rf conftest*
1173 eval "ac_cv_func_$ac_func=no"
1174 fi
1175 rm -f conftest*
1176 fi
1177
1178 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1179 echo "$ac_t""yes" 1>&6
1180 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1181 cat >> confdefs.h <<EOF
1182 #define $ac_tr_func 1
1183 EOF
1184
1185 else
1186 echo "$ac_t""no" 1>&6
1187 fi
1188 done
1189
1190
1191 . ${srcdir}/../../bfd/configure.host
1192
1193
1194
1195 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
1196 if test "${enable_maintainer_mode+set}" = set; then
1197 enableval="$enable_maintainer_mode"
1198 case "${enableval}" in
1199 yes) MAINT="" ;;
1200 no) MAINT="#" ;;
1201 *) { echo "configure: error: "--enable-maintainer-mode does not take a value"" 1>&2; exit 1; }; MAINT="#" ;;
1202 esac
1203 if test x"$silent" != x"yes" && test x"$MAINT" = x""; then
1204 echo "Setting maintainer mode" 6>&1
1205 fi
1206 else
1207 MAINT="#"
1208 fi
1209
1210
1211
1212 # Check whether --enable-sim-bswap or --disable-sim-bswap was given.
1213 if test "${enable_sim_bswap+set}" = set; then
1214 enableval="$enable_sim_bswap"
1215 case "${enableval}" in
1216 yes) sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";;
1217 no) sim_bswap="-DWITH_BSWAP=0";;
1218 *) { echo "configure: error: "--enable-sim-bswap does not take a value"" 1>&2; exit 1; }; sim_bswap="";;
1219 esac
1220 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
1221 echo "Setting bswap flags = $sim_bswap" 6>&1
1222 fi
1223 else
1224 sim_bswap=""
1225 fi
1226
1227
1228
1229 # Check whether --enable-sim-cflags or --disable-sim-cflags was given.
1230 if test "${enable_sim_cflags+set}" = set; then
1231 enableval="$enable_sim_cflags"
1232 case "${enableval}" in
1233 yes) sim_cflags="-O2";;
1234 trace) { echo "configure: error: "Please use --enable-sim-debug instead."" 1>&2; exit 1; }; sim_cflags="";;
1235 no) sim_cflags="";;
1236 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
1237 esac
1238 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
1239 echo "Setting sim cflags = $sim_cflags" 6>&1
1240 fi
1241 else
1242 sim_cflags=""
1243 fi
1244
1245
1246
1247 # Check whether --enable-sim-debug or --disable-sim-debug was given.
1248 if test "${enable_sim_debug+set}" = set; then
1249 enableval="$enable_sim_debug"
1250 case "${enableval}" in
1251 yes) sim_debug="-DDEBUG=7 -DWITH_DEBUG=7";;
1252 no) sim_debug="-DDEBUG=0 -DWITH_DEBUG=0";;
1253 *) sim_debug="-DDEBUG='(${enableval})' -DWITH_DEBUG='(${enableval})'";;
1254 esac
1255 if test x"$silent" != x"yes" && test x"$sim_debug" != x""; then
1256 echo "Setting sim debug = $sim_debug" 6>&1
1257 fi
1258 else
1259 sim_debug=""
1260 fi
1261
1262
1263
1264 # Check whether --enable-sim-stdio or --disable-sim-stdio was given.
1265 if test "${enable_sim_stdio+set}" = set; then
1266 enableval="$enable_sim_stdio"
1267 case "${enableval}" in
1268 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
1269 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
1270 *) { echo "configure: error: "Unknown value $enableval passed to --enable-sim-stdio"" 1>&2; exit 1; }; sim_stdio="";;
1271 esac
1272 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
1273 echo "Setting stdio flags = $sim_stdio" 6>&1
1274 fi
1275 else
1276 sim_stdio=""
1277 fi
1278
1279
1280
1281 # Check whether --enable-sim-trace or --disable-sim-trace was given.
1282 if test "${enable_sim_trace+set}" = set; then
1283 enableval="$enable_sim_trace"
1284 case "${enableval}" in
1285 yes) sim_trace="-DTRACE=1 -DWITH_TRACE=-1";;
1286 no) sim_trace="-DTRACE=0 -DWITH_TRACE=0";;
1287 [-0-9]*)
1288 sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";;
1289 [a-z]*)
1290 sim_trace=""
1291 for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
1292 if test x"$sim_trace" = x; then
1293 sim_trace="-DWITH_TRACE='(TRACE_$x"
1294 else
1295 sim_trace="${sim_trace}|TRACE_$x"
1296 fi
1297 done
1298 sim_trace="$sim_trace)'" ;;
1299 esac
1300 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
1301 echo "Setting sim trace = $sim_trace" 6>&1
1302 fi
1303 else
1304 sim_trace=""
1305 fi
1306
1307
1308
1309 # Check whether --enable-sim-profile or --disable-sim-profile was given.
1310 if test "${enable_sim_profile+set}" = set; then
1311 enableval="$enable_sim_profile"
1312 case "${enableval}" in
1313 yes) sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1";;
1314 no) sim_profile="-DPROFILE=0 -DWITH_PROFILE=0";;
1315 [-0-9]*)
1316 sim_profile="-DPROFILE='(${enableval})' -DWITH_PROFILE='(${enableval})'";;
1317 [a-z]*)
1318 sim_profile=""
1319 for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
1320 if test x"$sim_profile" = x; then
1321 sim_profile="-DWITH_PROFILE='(PROFILE_$x"
1322 else
1323 sim_profile="${sim_profile}|PROFILE_$x"
1324 fi
1325 done
1326 sim_profile="$sim_profile)'" ;;
1327 esac
1328 if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then
1329 echo "Setting sim profile = $sim_profile" 6>&1
1330 fi
1331 else
1332 sim_profile=""
1333 fi
1334
1335
1336
1337 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
1338 echo "configure:1339: checking return type of signal handlers" >&5
1339 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
1340 echo $ac_n "(cached) $ac_c" 1>&6
1341 else
1342 cat > conftest.$ac_ext <<EOF
1343 #line 1344 "configure"
1344 #include "confdefs.h"
1345 #include <sys/types.h>
1346 #include <signal.h>
1347 #ifdef signal
1348 #undef signal
1349 #endif
1350 #ifdef __cplusplus
1351 extern "C" void (*signal (int, void (*)(int)))(int);
1352 #else
1353 void (*signal ()) ();
1354 #endif
1355
1356 int main() {
1357 int i;
1358 ; return 0; }
1359 EOF
1360 if { (eval echo configure:1361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1361 rm -rf conftest*
1362 ac_cv_type_signal=void
1363 else
1364 echo "configure: failed program was:" >&5
1365 cat conftest.$ac_ext >&5
1366 rm -rf conftest*
1367 ac_cv_type_signal=int
1368 fi
1369 rm -f conftest*
1370 fi
1371
1372 echo "$ac_t""$ac_cv_type_signal" 1>&6
1373 cat >> confdefs.h <<EOF
1374 #define RETSIGTYPE $ac_cv_type_signal
1375 EOF
1376
1377
1378
1379
1380 sim_link_files=
1381 sim_link_links=
1382
1383 sim_link_links=tconfig.h
1384 if test -f ${srcdir}/tconfig.in
1385 then
1386 sim_link_files=tconfig.in
1387 else
1388 sim_link_files=../common/tconfig.in
1389 fi
1390
1391 # targ-vals.def points to the libc macro description file.
1392 case "${target}" in
1393 *-*-*) TARG_VALS_DEF=../common/nltvals.def ;;
1394 esac
1395 sim_link_files="${sim_link_files} ${TARG_VALS_DEF}"
1396 sim_link_links="${sim_link_links} targ-vals.def"
1397
1398
1399
1400
1401 default_sim_inline="-DDEFAULT_INLINE=0"
1402 # Check whether --enable-sim-inline or --disable-sim-inline was given.
1403 if test "${enable_sim_inline+set}" = set; then
1404 enableval="$enable_sim_inline"
1405 sim_inline=""
1406 case "$enableval" in
1407 no) sim_inline="-DDEFAULT_INLINE=0";;
1408 0) sim_inline="-DDEFAULT_INLINE=0";;
1409 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
1410 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
1411 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
1412 new_flag=""
1413 case "$x" in
1414 *_INLINE=*) new_flag="-D$x";;
1415 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
1416 *_INLINE) new_flag="-D$x=ALL_INLINE";;
1417 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
1418 esac
1419 if test x"$sim_inline" = x""; then
1420 sim_inline="$new_flag"
1421 else
1422 sim_inline="$sim_inline $new_flag"
1423 fi
1424 done;;
1425 esac
1426 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
1427 echo "Setting inline flags = $sim_inline" 6>&1
1428 fi
1429 else
1430 if test x"$GCC" != "x" -a x"${default_sim_inline}" != "x" ; then
1431 sim_inline="${default_sim_inline}"
1432 if test x"$silent" != x"yes"; then
1433 echo "Setting inline flags = $sim_inline" 6>&1
1434 fi
1435 else
1436 sim_inline=""
1437 fi
1438 fi
1439
1440 wire_alignment="NONSTRICT_ALIGNMENT"
1441 default_alignment=""
1442
1443 # Check whether --enable-sim-alignment or --disable-sim-alignment was given.
1444 if test "${enable_sim_alignment+set}" = set; then
1445 enableval="$enable_sim_alignment"
1446 case "${enableval}" in
1447 strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
1448 nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
1449 forced | FORCED) sim_alignment="-DWITH_ALIGNMENT=FORCED_ALIGNMENT";;
1450 yes) if test x"$wire_alignment" != x; then
1451 sim_alignment="-DWITH_ALIGNMENT=${wire_alignment}"
1452 else
1453 if test x"$default_alignment" != x; then
1454 sim_alignment="-DWITH_ALIGNMENT=${default_alignment}"
1455 else
1456 echo "No hard-wired alignment for target $target" 1>&6
1457 sim_alignment="-DWITH_ALIGNMENT=0"
1458 fi
1459 fi;;
1460 no) if test x"$default_alignment" != x; then
1461 sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${default_alignment}"
1462 else
1463 if test x"$wire_alignment" != x; then
1464 sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${wire_alignment}"
1465 else
1466 echo "No default alignment for target $target" 1>&6
1467 sim_alignment="-DWITH_DEFAULT_ALIGNMENT=0"
1468 fi
1469 fi;;
1470 *) { echo "configure: error: "Unknown value $enableval passed to --enable-sim-alignment"" 1>&2; exit 1; }; sim_alignment="";;
1471 esac
1472 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
1473 echo "Setting alignment flags = $sim_alignment" 6>&1
1474 fi
1475 else
1476 if test x"$default_alignment" != x; then
1477 sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${default_alignment}"
1478 else
1479 if test x"$wire_alignment" != x; then
1480 sim_alignment="-DWITH_ALIGNMENT=${wire_alignment}"
1481 else
1482 sim_alignment=
1483 fi
1484 fi
1485 fi
1486
1487
1488 # Check whether --enable-sim-hostendian or --disable-sim-hostendian was given.
1489 if test "${enable_sim_hostendian+set}" = set; then
1490 enableval="$enable_sim_hostendian"
1491 case "${enableval}" in
1492 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
1493 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
1494 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
1495 *) { echo "configure: error: "Unknown value $enableval for --enable-sim-hostendian"" 1>&2; exit 1; }; sim_hostendian="";;
1496 esac
1497 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
1498 echo "Setting hostendian flags = $sim_hostendian" 6>&1
1499 fi
1500 else
1501
1502 if test "x$cross_compiling" = "xno"; then
1503 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
1504 echo "configure:1505: checking whether byte ordering is bigendian" >&5
1505 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
1506 echo $ac_n "(cached) $ac_c" 1>&6
1507 else
1508 ac_cv_c_bigendian=unknown
1509 # See if sys/param.h defines the BYTE_ORDER macro.
1510 cat > conftest.$ac_ext <<EOF
1511 #line 1512 "configure"
1512 #include "confdefs.h"
1513 #include <sys/types.h>
1514 #include <sys/param.h>
1515 int main() {
1516
1517 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
1518 bogus endian macros
1519 #endif
1520 ; return 0; }
1521 EOF
1522 if { (eval echo configure:1523: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1523 rm -rf conftest*
1524 # It does; now see whether it defined to BIG_ENDIAN or not.
1525 cat > conftest.$ac_ext <<EOF
1526 #line 1527 "configure"
1527 #include "confdefs.h"
1528 #include <sys/types.h>
1529 #include <sys/param.h>
1530 int main() {
1531
1532 #if BYTE_ORDER != BIG_ENDIAN
1533 not big endian
1534 #endif
1535 ; return 0; }
1536 EOF
1537 if { (eval echo configure:1538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1538 rm -rf conftest*
1539 ac_cv_c_bigendian=yes
1540 else
1541 echo "configure: failed program was:" >&5
1542 cat conftest.$ac_ext >&5
1543 rm -rf conftest*
1544 ac_cv_c_bigendian=no
1545 fi
1546 rm -f conftest*
1547 else
1548 echo "configure: failed program was:" >&5
1549 cat conftest.$ac_ext >&5
1550 fi
1551 rm -f conftest*
1552 if test $ac_cv_c_bigendian = unknown; then
1553 if test "$cross_compiling" = yes; then
1554 { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
1555 else
1556 cat > conftest.$ac_ext <<EOF
1557 #line 1558 "configure"
1558 #include "confdefs.h"
1559 main () {
1560 /* Are we little or big endian? From Harbison&Steele. */
1561 union
1562 {
1563 long l;
1564 char c[sizeof (long)];
1565 } u;
1566 u.l = 1;
1567 exit (u.c[sizeof (long) - 1] == 1);
1568 }
1569 EOF
1570 if { (eval echo configure:1571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1571 then
1572 ac_cv_c_bigendian=no
1573 else
1574 echo "configure: failed program was:" >&5
1575 cat conftest.$ac_ext >&5
1576 rm -fr conftest*
1577 ac_cv_c_bigendian=yes
1578 fi
1579 rm -fr conftest*
1580 fi
1581
1582 fi
1583 fi
1584
1585 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
1586 if test $ac_cv_c_bigendian = yes; then
1587 cat >> confdefs.h <<\EOF
1588 #define WORDS_BIGENDIAN 1
1589 EOF
1590
1591 fi
1592
1593 if test $ac_cv_c_bigendian = yes; then
1594 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
1595 else
1596 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
1597 fi
1598 else
1599 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
1600 fi
1601 fi
1602
1603
1604 # Check whether --enable-sim-warnings or --disable-sim-warnings was given.
1605 if test "${enable_sim_warnings+set}" = set; then
1606 enableval="$enable_sim_warnings"
1607 case "${enableval}" in
1608 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
1609 no) sim_warnings="-w";;
1610 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
1611 esac
1612 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
1613 echo "Setting warning flags = $sim_warnings" 6>&1
1614 fi
1615 else
1616 sim_warnings=""
1617 fi
1618
1619
1620
1621 # Ensure a reasonable default simulator is constructed:
1622 case "${target}" in
1623 # start-sanitize-tx19
1624 mipstx19*-*-*) SIMCONF="-mips1 -mcpu=r1900 -mno-fp --warnings";;
1625 # end-sanitize-tx19
1626 # start-sanitize-tx49
1627 mips64tx49*-*-*) SIMCONF="-mips3 --warnings -mcpu=r4900";;
1628 # end-sanitize-tx49
1629 # start-sanitize-r5900
1630 mips64r59*-*-*) SIMCONF="-mips3 --warnings -mcpu=r5900";;
1631 # end-sanitize-r5900
1632 mips64*-*-*) SIMCONF="-mips0 --warnings";;
1633 mips16*-*-*) SIMCONF="-mips0 --warnings";;
1634 mips*-*-*) SIMCONF="-mips2 --warnings";;
1635 *) SIMCONF="-mips0 --warnings";;
1636 esac
1637
1638
1639 case "${target}" in
1640 # start-sanitize-tx19
1641 mipstx19*-*-*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
1642 # end-sanitize-tx19
1643 *) SIM_SUBTARGET="";;
1644 esac
1645
1646
1647
1648 #
1649 # Select the byte order of the target
1650 #
1651 mips_endian=
1652 default_endian=
1653 case "${target}" in
1654 # start-sanitize-tx19
1655 mipstx19*-*-*) default_endian=BIG_ENDIAN ;;
1656 # end-sanitize-tx19
1657 # start-sanitize-r5900
1658 mips64r59*-*-*) mips_endian=LITTLE_ENDIAN ;;
1659 # end-sanitize-r5900
1660 mips64*-*-*) default_endian=BIG_ENDIAN ;;
1661 mips16*-*-*) default_endian=BIG_ENDIAN ;;
1662 mips*-*-*) default_endian=BIG_ENDIAN ;;
1663 *) default_endian=BIG_ENDIAN ;;
1664 esac
1665
1666 wire_endian="$mips_endian"
1667 default_endian="$default_endian"
1668 # Check whether --enable-sim-endian or --disable-sim-endian was given.
1669 if test "${enable_sim_endian+set}" = set; then
1670 enableval="$enable_sim_endian"
1671 case "${enableval}" in
1672 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
1673 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
1674 yes) if test x"$wire_endian" != x; then
1675 sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}"
1676 else
1677 if test x"$default_endian" != x; then
1678 sim_endian="-DWITH_TARGET_BYTE_ORDER=${default_endian}"
1679 else
1680 echo "No hard-wired endian for target $target" 1>&6
1681 sim_endian="-DWITH_TARGET_BYTE_ORDER=0"
1682 fi
1683 fi;;
1684 no) if test x"$default_endian" != x; then
1685 sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}"
1686 else
1687 if test x"$wire_endian" != x; then
1688 sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${wire_endian}"
1689 else
1690 echo "No default endian for target $target" 1>&6
1691 sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0"
1692 fi
1693 fi;;
1694 *) { echo "configure: error: "Unknown value $enableval for --enable-sim-endian"" 1>&2; exit 1; }; sim_endian="";;
1695 esac
1696 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
1697 echo "Setting endian flags = $sim_endian" 6>&1
1698 fi
1699 else
1700 if test x"$default_endian" != x; then
1701 sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}"
1702 else
1703 if test x"$wire_endian" != x; then
1704 sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}"
1705 else
1706 sim_endian=
1707 fi
1708 fi
1709 fi
1710
1711
1712
1713 #
1714 # Select the bitsize of the target
1715 #
1716 case "${target}" in
1717 # start-sanitize-tx19
1718 mipstx19*-*-*) mips_bitsize=32 ; mips_msb=31 ;;
1719 # end-sanitize-tx19
1720 # start-sanitize-r5900
1721 mips64r59*-*-*) mips_bitsize=64 ; mips_msb=63 ;;
1722 # end-sanitize-r5900
1723 mips64*-*-*) mips_bitsize=64 ; mips_msb=63 ;;
1724 mips16*-*-*) mips_bitsize=64 ; mips_msb=63 ;;
1725 mips*-*-*) mips_bitsize=32 ; mips_msb=31 ;;
1726 *) mips_bitsize=64 ; mips_msb=63 ;;
1727 esac
1728 wire_bitsize="$mips_bitsize"
1729 wire_msb="$mips_msb"
1730 # Check whether --enable-sim-bitsize or --disable-sim-bitsize was given.
1731 if test "${enable_sim_bitsize+set}" = set; then
1732 enableval="$enable_sim_bitsize"
1733 case "${enableval}" in
1734 64,63) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=63";;
1735 32,31) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31";;
1736 64,0) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0";;
1737 32,0) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0";;
1738 32) if test x"$wire_msb" != x -a x"$wire_msb" != x0; then
1739 sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31"
1740 else
1741 sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=0"
1742 fi ;;
1743 64) if test x"$wire_msb" != x -a x"$wire_msb" != x0; then
1744 sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=63"
1745 else
1746 sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=64 -DWITH_TARGET_WORD_MSB=0"
1747 fi ;;
1748 *) { echo "configure: error: "--enable-sim-bitsize was given $enableval. Expected 32 or 64"" 1>&2; exit 1; }; sim_bitsize="";;
1749 esac
1750 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
1751 echo "Setting bitsize flags = $sim_bitsize" 6>&1
1752 fi
1753 else
1754 sim_bitsize=""
1755 if test x"$wire_bitsize" != x; then
1756 sim_bitsize="$sim_bitsize -DWITH_TARGET_WORD_BITSIZE=$wire_bitsize"
1757 fi
1758 if test x"$wire_msb" != x; then
1759 sim_bitsize="$sim_bitsize -DWITH_TARGET_WORD_MSB=$wire_msb"
1760 fi
1761 fi
1762
1763
1764
1765 #
1766 # Select the floating hardware support of the target
1767 #
1768 mips_fpu=HARDWARE_FLOATING_POINT
1769 case "${target}" in
1770 # start-sanitize-tx19
1771 mipstx19*-*-*) mips_fpu=SOFT_FLOATING_POINT ;;
1772 # end-sanitize-tx19
1773 # start-sanitize-r5900
1774 mips64r59*-*-*) mips_fpu=HARD_FLOATING_POINT ;;
1775 # end-sanitize-r5900
1776 mips64*-*-*) mips_fpu=HARD_FLOATING_POINT ;;
1777 mips16*-*-*) mips_fpu=HARD_FLOATING_POINT ;;
1778 mips*-*-*) mips_fpu=HARD_FLOATING_POINT ;;
1779 *) mips_fpu=HARD_FLOATING_POINT ;;
1780 esac
1781
1782 default_sim_floating_point="$mips_fpu"
1783 # Check whether --enable-sim-float or --disable-sim-float was given.
1784 if test "${enable_sim_float+set}" = set; then
1785 enableval="$enable_sim_float"
1786 case "${enableval}" in
1787 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
1788 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
1789 *) { echo "configure: error: "Unknown value $enableval passed to --enable-sim-float"" 1>&2; exit 1; }; sim_float="";;
1790 esac
1791 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
1792 echo "Setting float flags = $sim_float" 6>&1
1793 fi
1794 else
1795 sim_float="-DWITH_FLOATING_POINT=${default_sim_floating_point}"
1796 fi
1797
1798
1799
1800 #
1801 # Select the IGEN architecture
1802 #
1803 sim_use_gen=NO
1804 sim_igen_machine="-M mipsIV"
1805 sim_m16_machine="-M mips16"
1806 sim_igen_filter="32,64,f"
1807 sim_m16_filter="16"
1808
1809 case "${target}" in
1810 # start-sanitize-tx19
1811 mipstx19*-*-*) sim_default_gen=M16
1812 sim_igen_machine="-M tx19"
1813 sim_m16_machine="-M tx19"
1814 sim_igen_filter="32"
1815 sim_m16_filter="16"
1816 ;;
1817 # end-sanitize-tx19
1818 # start-sanitize-r5900
1819 mips64r59*-*-*) sim_default_gen=IGEN
1820 sim_use_gen=IGEN
1821 sim_igen_machine="-M r5900"
1822 ;;
1823 # end-sanitize-r5900
1824 # start-sanitize-vr5400
1825 mips64vr54*-*-*) sim_default_gen=IGEN
1826 sim_use_gen=IGEN
1827 sim_igen_machine="-M vr5000,vr5400 -G gen-multi-sim=vr5400"
1828 ;;
1829 # end-sanitize-vr5400
1830 mips64vr5*-*-*) sim_default_gen=IGEN
1831 sim_use_gen=IGEN
1832 sim_igen_machine="-M vr5000"
1833 # start-sanitize-vr5400
1834 sim_igen_machine="-M vr5000,vr5400 -G gen-multi-sim=vr5000"
1835 # end-sanitize-vr5400
1836 ;;
1837 mips16*-*-*) sim_default_gen=M16
1838 ;;
1839 mips32*-*-*) sim_default_gen=IGEN
1840 sim_igen_filter="32,f"
1841 ;;
1842 *) sim_default_gen=IGEN
1843 ;;
1844 esac
1845 sim_igen_flags="-F ${sim_igen_filter} ${sim_igen_machine}"
1846 sim_m16_flags=" -F ${sim_m16_filter} ${sim_m16_machine}"
1847
1848
1849
1850 #
1851 # Enable igen
1852 #
1853 # Check whether --enable-sim-igen or --disable-sim-igen was given.
1854 if test "${enable_sim_igen+set}" = set; then
1855 enableval="$enable_sim_igen"
1856 case "${enableval}" in
1857 yes) sim_gen="${sim_default_gen}";;
1858 no) sim_gen=NO;;
1859 16) sim_gen=M16;;
1860 *) { echo "configure: error: "Unknown value $enableval passed to --enable-sim-stdio"" 1>&2; exit 1; }; sim_gen="";;
1861 esac
1862 if test x"$silent" != x"yes" && test x"$sim_gen" != x""; then
1863 echo "Setting sim_igen = $sim_gen" 6>&1
1864 fi
1865 else
1866 sim_gen="${sim_use_gen}"
1867 fi
1868
1869
1870
1871
1872 for ac_hdr in string.h strings.h stdlib.h stdlib.h
1873 do
1874 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1875 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1876 echo "configure:1877: checking for $ac_hdr" >&5
1877 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1878 echo $ac_n "(cached) $ac_c" 1>&6
1879 else
1880 cat > conftest.$ac_ext <<EOF
1881 #line 1882 "configure"
1882 #include "confdefs.h"
1883 #include <$ac_hdr>
1884 EOF
1885 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1886 { (eval echo configure:1887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1887 ac_err=`grep -v '^ *+' conftest.out`
1888 if test -z "$ac_err"; then
1889 rm -rf conftest*
1890 eval "ac_cv_header_$ac_safe=yes"
1891 else
1892 echo "$ac_err" >&5
1893 echo "configure: failed program was:" >&5
1894 cat conftest.$ac_ext >&5
1895 rm -rf conftest*
1896 eval "ac_cv_header_$ac_safe=no"
1897 fi
1898 rm -f conftest*
1899 fi
1900 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1901 echo "$ac_t""yes" 1>&6
1902 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1903 cat >> confdefs.h <<EOF
1904 #define $ac_tr_hdr 1
1905 EOF
1906
1907 else
1908 echo "$ac_t""no" 1>&6
1909 fi
1910 done
1911
1912 echo $ac_n "checking for fabs in -lm""... $ac_c" 1>&6
1913 echo "configure:1914: checking for fabs in -lm" >&5
1914 ac_lib_var=`echo m'_'fabs | sed 'y%./+-%__p_%'`
1915 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1916 echo $ac_n "(cached) $ac_c" 1>&6
1917 else
1918 ac_save_LIBS="$LIBS"
1919 LIBS="-lm $LIBS"
1920 cat > conftest.$ac_ext <<EOF
1921 #line 1922 "configure"
1922 #include "confdefs.h"
1923 /* Override any gcc2 internal prototype to avoid an error. */
1924 /* We use char because int might match the return type of a gcc2
1925 builtin and then its argument prototype would still apply. */
1926 char fabs();
1927
1928 int main() {
1929 fabs()
1930 ; return 0; }
1931 EOF
1932 if { (eval echo configure:1933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1933 rm -rf conftest*
1934 eval "ac_cv_lib_$ac_lib_var=yes"
1935 else
1936 echo "configure: failed program was:" >&5
1937 cat conftest.$ac_ext >&5
1938 rm -rf conftest*
1939 eval "ac_cv_lib_$ac_lib_var=no"
1940 fi
1941 rm -f conftest*
1942 LIBS="$ac_save_LIBS"
1943
1944 fi
1945 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1946 echo "$ac_t""yes" 1>&6
1947 ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1948 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1949 cat >> confdefs.h <<EOF
1950 #define $ac_tr_lib 1
1951 EOF
1952
1953 LIBS="-lm $LIBS"
1954
1955 else
1956 echo "$ac_t""no" 1>&6
1957 fi
1958
1959 for ac_func in aint anint sqrt
1960 do
1961 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1962 echo "configure:1963: checking for $ac_func" >&5
1963 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1964 echo $ac_n "(cached) $ac_c" 1>&6
1965 else
1966 cat > conftest.$ac_ext <<EOF
1967 #line 1968 "configure"
1968 #include "confdefs.h"
1969 /* System header to define __stub macros and hopefully few prototypes,
1970 which can conflict with char $ac_func(); below. */
1971 #include <assert.h>
1972 /* Override any gcc2 internal prototype to avoid an error. */
1973 /* We use char because int might match the return type of a gcc2
1974 builtin and then its argument prototype would still apply. */
1975 char $ac_func();
1976
1977 int main() {
1978
1979 /* The GNU C library defines this for functions which it implements
1980 to always fail with ENOSYS. Some functions are actually named
1981 something starting with __ and the normal name is an alias. */
1982 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1983 choke me
1984 #else
1985 $ac_func();
1986 #endif
1987
1988 ; return 0; }
1989 EOF
1990 if { (eval echo configure:1991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1991 rm -rf conftest*
1992 eval "ac_cv_func_$ac_func=yes"
1993 else
1994 echo "configure: failed program was:" >&5
1995 cat conftest.$ac_ext >&5
1996 rm -rf conftest*
1997 eval "ac_cv_func_$ac_func=no"
1998 fi
1999 rm -f conftest*
2000 fi
2001
2002 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2003 echo "$ac_t""yes" 1>&6
2004 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2005 cat >> confdefs.h <<EOF
2006 #define $ac_tr_func 1
2007 EOF
2008
2009 else
2010 echo "$ac_t""no" 1>&6
2011 fi
2012 done
2013
2014
2015
2016
2017 trap '' 1 2 15
2018 cat > confcache <<\EOF
2019 # This file is a shell script that caches the results of configure
2020 # tests run on this system so they can be shared between configure
2021 # scripts and configure runs. It is not useful on other systems.
2022 # If it contains results you don't want to keep, you may remove or edit it.
2023 #
2024 # By default, configure uses ./config.cache as the cache file,
2025 # creating it if it does not exist already. You can give configure
2026 # the --cache-file=FILE option to use a different cache file; that is
2027 # what configure does when it calls configure scripts in
2028 # subdirectories, so they share the cache.
2029 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2030 # config.status only pays attention to the cache file if you give it the
2031 # --recheck option to rerun configure.
2032 #
2033 EOF
2034 # The following way of writing the cache mishandles newlines in values,
2035 # but we know of no workaround that is simple, portable, and efficient.
2036 # So, don't put newlines in cache variables' values.
2037 # Ultrix sh set writes to stderr and can't be redirected directly,
2038 # and sets the high bit in the cache file unless we assign to the vars.
2039 (set) 2>&1 |
2040 case `(ac_space=' '; set) 2>&1` in
2041 *ac_space=\ *)
2042 # `set' does not quote correctly, so add quotes (double-quote substitution
2043 # turns \\\\ into \\, and sed turns \\ into \).
2044 sed -n \
2045 -e "s/'/'\\\\''/g" \
2046 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2047 ;;
2048 *)
2049 # `set' quotes correctly as required by POSIX, so do not add quotes.
2050 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2051 ;;
2052 esac >> confcache
2053 if cmp -s $cache_file confcache; then
2054 :
2055 else
2056 if test -w $cache_file; then
2057 echo "updating cache $cache_file"
2058 cat confcache > $cache_file
2059 else
2060 echo "not updating unwritable cache $cache_file"
2061 fi
2062 fi
2063 rm -f confcache
2064
2065 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2066
2067 test "x$prefix" = xNONE && prefix=$ac_default_prefix
2068 # Let make expand exec_prefix.
2069 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2070
2071 # Any assignment to VPATH causes Sun make to only execute
2072 # the first set of double-colon rules, so remove it if not needed.
2073 # If there is a colon in the path, we need to keep it.
2074 if test "x$srcdir" = x.; then
2075 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
2076 fi
2077
2078 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2079
2080 DEFS=-DHAVE_CONFIG_H
2081
2082 # Without the "./", some shells look in PATH for config.status.
2083 : ${CONFIG_STATUS=./config.status}
2084
2085 echo creating $CONFIG_STATUS
2086 rm -f $CONFIG_STATUS
2087 cat > $CONFIG_STATUS <<EOF
2088 #! /bin/sh
2089 # Generated automatically by configure.
2090 # Run this file to recreate the current configuration.
2091 # This directory was configured as follows,
2092 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2093 #
2094 # $0 $ac_configure_args
2095 #
2096 # Compiler output produced by configure, useful for debugging
2097 # configure, is in ./config.log if it exists.
2098
2099 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2100 for ac_option
2101 do
2102 case "\$ac_option" in
2103 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2104 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2105 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2106 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2107 echo "$CONFIG_STATUS generated by autoconf version 2.12"
2108 exit 0 ;;
2109 -help | --help | --hel | --he | --h)
2110 echo "\$ac_cs_usage"; exit 0 ;;
2111 *) echo "\$ac_cs_usage"; exit 1 ;;
2112 esac
2113 done
2114
2115 ac_given_srcdir=$srcdir
2116 ac_given_INSTALL="$INSTALL"
2117
2118 trap 'rm -fr `echo "Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in .gdbinit:../common/gdbinit.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2119 EOF
2120 cat >> $CONFIG_STATUS <<EOF
2121
2122 # Protect against being on the right side of a sed subst in config.status.
2123 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2124 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2125 $ac_vpsub
2126 $extrasub
2127 s%@sim_environment@%$sim_environment%g
2128 s%@sim_alignment@%$sim_alignment%g
2129 s%@sim_assert@%$sim_assert%g
2130 s%@sim_bitsize@%$sim_bitsize%g
2131 s%@sim_endian@%$sim_endian%g
2132 s%@sim_hostendian@%$sim_hostendian%g
2133 s%@sim_float@%$sim_float%g
2134 s%@sim_scache@%$sim_scache%g
2135 s%@sim_default_model@%$sim_default_model%g
2136 s%@sim_hardware@%$sim_hardware%g
2137 s%@sim_inline@%$sim_inline%g
2138 s%@sim_packages@%$sim_packages%g
2139 s%@sim_regparm@%$sim_regparm%g
2140 s%@sim_reserved_bits@%$sim_reserved_bits%g
2141 s%@sim_smp@%$sim_smp%g
2142 s%@sim_stdcall@%$sim_stdcall%g
2143 s%@sim_xor_endian@%$sim_xor_endian%g
2144 s%@sim_warnings@%$sim_warnings%g
2145 s%@CFLAGS@%$CFLAGS%g
2146 s%@CPPFLAGS@%$CPPFLAGS%g
2147 s%@CXXFLAGS@%$CXXFLAGS%g
2148 s%@DEFS@%$DEFS%g
2149 s%@LDFLAGS@%$LDFLAGS%g
2150 s%@LIBS@%$LIBS%g
2151 s%@exec_prefix@%$exec_prefix%g
2152 s%@prefix@%$prefix%g
2153 s%@program_transform_name@%$program_transform_name%g
2154 s%@bindir@%$bindir%g
2155 s%@sbindir@%$sbindir%g
2156 s%@libexecdir@%$libexecdir%g
2157 s%@datadir@%$datadir%g
2158 s%@sysconfdir@%$sysconfdir%g
2159 s%@sharedstatedir@%$sharedstatedir%g
2160 s%@localstatedir@%$localstatedir%g
2161 s%@libdir@%$libdir%g
2162 s%@includedir@%$includedir%g
2163 s%@oldincludedir@%$oldincludedir%g
2164 s%@infodir@%$infodir%g
2165 s%@mandir@%$mandir%g
2166 s%@host@%$host%g
2167 s%@host_alias@%$host_alias%g
2168 s%@host_cpu@%$host_cpu%g
2169 s%@host_vendor@%$host_vendor%g
2170 s%@host_os@%$host_os%g
2171 s%@target@%$target%g
2172 s%@target_alias@%$target_alias%g
2173 s%@target_cpu@%$target_cpu%g
2174 s%@target_vendor@%$target_vendor%g
2175 s%@target_os@%$target_os%g
2176 s%@build@%$build%g
2177 s%@build_alias@%$build_alias%g
2178 s%@build_cpu@%$build_cpu%g
2179 s%@build_vendor@%$build_vendor%g
2180 s%@build_os@%$build_os%g
2181 s%@CC@%$CC%g
2182 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2183 s%@INSTALL_DATA@%$INSTALL_DATA%g
2184 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
2185 s%@HDEFINES@%$HDEFINES%g
2186 s%@AR@%$AR%g
2187 s%@RANLIB@%$RANLIB%g
2188 s%@CPP@%$CPP%g
2189 s%@MAINT@%$MAINT%g
2190 s%@sim_bswap@%$sim_bswap%g
2191 s%@sim_cflags@%$sim_cflags%g
2192 s%@sim_debug@%$sim_debug%g
2193 s%@sim_stdio@%$sim_stdio%g
2194 s%@sim_trace@%$sim_trace%g
2195 s%@sim_profile@%$sim_profile%g
2196 s%@SIMCONF@%$SIMCONF%g
2197 s%@SIM_SUBTARGET@%$SIM_SUBTARGET%g
2198 s%@sim_igen_flags@%$sim_igen_flags%g
2199 s%@sim_m16_flags@%$sim_m16_flags%g
2200 s%@sim_gen@%$sim_gen%g
2201
2202 CEOF
2203 EOF
2204
2205 cat >> $CONFIG_STATUS <<\EOF
2206
2207 # Split the substitutions into bite-sized pieces for seds with
2208 # small command number limits, like on Digital OSF/1 and HP-UX.
2209 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2210 ac_file=1 # Number of current file.
2211 ac_beg=1 # First line for current file.
2212 ac_end=$ac_max_sed_cmds # Line after last line for current file.
2213 ac_more_lines=:
2214 ac_sed_cmds=""
2215 while $ac_more_lines; do
2216 if test $ac_beg -gt 1; then
2217 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2218 else
2219 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2220 fi
2221 if test ! -s conftest.s$ac_file; then
2222 ac_more_lines=false
2223 rm -f conftest.s$ac_file
2224 else
2225 if test -z "$ac_sed_cmds"; then
2226 ac_sed_cmds="sed -f conftest.s$ac_file"
2227 else
2228 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2229 fi
2230 ac_file=`expr $ac_file + 1`
2231 ac_beg=$ac_end
2232 ac_end=`expr $ac_end + $ac_max_sed_cmds`
2233 fi
2234 done
2235 if test -z "$ac_sed_cmds"; then
2236 ac_sed_cmds=cat
2237 fi
2238 EOF
2239
2240 cat >> $CONFIG_STATUS <<EOF
2241
2242 CONFIG_FILES=\${CONFIG_FILES-"Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in .gdbinit:../common/gdbinit.in"}
2243 EOF
2244 cat >> $CONFIG_STATUS <<\EOF
2245 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2246 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2247 case "$ac_file" in
2248 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2249 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2250 *) ac_file_in="${ac_file}.in" ;;
2251 esac
2252
2253 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2254
2255 # Remove last slash and all that follows it. Not all systems have dirname.
2256 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2257 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2258 # The file is in a subdirectory.
2259 test ! -d "$ac_dir" && mkdir "$ac_dir"
2260 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2261 # A "../" for each directory in $ac_dir_suffix.
2262 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2263 else
2264 ac_dir_suffix= ac_dots=
2265 fi
2266
2267 case "$ac_given_srcdir" in
2268 .) srcdir=.
2269 if test -z "$ac_dots"; then top_srcdir=.
2270 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2271 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2272 *) # Relative path.
2273 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2274 top_srcdir="$ac_dots$ac_given_srcdir" ;;
2275 esac
2276
2277 case "$ac_given_INSTALL" in
2278 [/$]*) INSTALL="$ac_given_INSTALL" ;;
2279 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2280 esac
2281
2282 echo creating "$ac_file"
2283 rm -f "$ac_file"
2284 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2285 case "$ac_file" in
2286 *Makefile*) ac_comsub="1i\\
2287 # $configure_input" ;;
2288 *) ac_comsub= ;;
2289 esac
2290
2291 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2292 sed -e "$ac_comsub
2293 s%@configure_input@%$configure_input%g
2294 s%@srcdir@%$srcdir%g
2295 s%@top_srcdir@%$top_srcdir%g
2296 s%@INSTALL@%$INSTALL%g
2297 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2298 fi; done
2299 rm -f conftest.s*
2300
2301 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2302 # NAME is the cpp macro being defined and VALUE is the value it is being given.
2303 #
2304 # ac_d sets the value in "#define NAME VALUE" lines.
2305 ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
2306 ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
2307 ac_dC='\3'
2308 ac_dD='%g'
2309 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2310 ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2311 ac_uB='\([ ]\)%\1#\2define\3'
2312 ac_uC=' '
2313 ac_uD='\4%g'
2314 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2315 ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2316 ac_eB='$%\1#\2define\3'
2317 ac_eC=' '
2318 ac_eD='%g'
2319
2320 if test "${CONFIG_HEADERS+set}" != set; then
2321 EOF
2322 cat >> $CONFIG_STATUS <<EOF
2323 CONFIG_HEADERS="config.h:config.in"
2324 EOF
2325 cat >> $CONFIG_STATUS <<\EOF
2326 fi
2327 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2328 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2329 case "$ac_file" in
2330 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2331 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2332 *) ac_file_in="${ac_file}.in" ;;
2333 esac
2334
2335 echo creating $ac_file
2336
2337 rm -f conftest.frag conftest.in conftest.out
2338 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2339 cat $ac_file_inputs > conftest.in
2340
2341 EOF
2342
2343 # Transform confdefs.h into a sed script conftest.vals that substitutes
2344 # the proper values into config.h.in to produce config.h. And first:
2345 # Protect against being on the right side of a sed subst in config.status.
2346 # Protect against being in an unquoted here document in config.status.
2347 rm -f conftest.vals
2348 cat > conftest.hdr <<\EOF
2349 s/[\\&%]/\\&/g
2350 s%[\\$`]%\\&%g
2351 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2352 s%ac_d%ac_u%gp
2353 s%ac_u%ac_e%gp
2354 EOF
2355 sed -n -f conftest.hdr confdefs.h > conftest.vals
2356 rm -f conftest.hdr
2357
2358 # This sed command replaces #undef with comments. This is necessary, for
2359 # example, in the case of _POSIX_SOURCE, which is predefined and required
2360 # on some systems where configure will not decide to define it.
2361 cat >> conftest.vals <<\EOF
2362 s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2363 EOF
2364
2365 # Break up conftest.vals because some shells have a limit on
2366 # the size of here documents, and old seds have small limits too.
2367
2368 rm -f conftest.tail
2369 while :
2370 do
2371 ac_lines=`grep -c . conftest.vals`
2372 # grep -c gives empty output for an empty file on some AIX systems.
2373 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2374 # Write a limited-size here document to conftest.frag.
2375 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2376 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2377 echo 'CEOF
2378 sed -f conftest.frag conftest.in > conftest.out
2379 rm -f conftest.in
2380 mv conftest.out conftest.in
2381 ' >> $CONFIG_STATUS
2382 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2383 rm -f conftest.vals
2384 mv conftest.tail conftest.vals
2385 done
2386 rm -f conftest.vals
2387
2388 cat >> $CONFIG_STATUS <<\EOF
2389 rm -f conftest.frag conftest.h
2390 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
2391 cat conftest.in >> conftest.h
2392 rm -f conftest.in
2393 if cmp -s $ac_file conftest.h 2>/dev/null; then
2394 echo "$ac_file is unchanged"
2395 rm -f conftest.h
2396 else
2397 # Remove last slash and all that follows it. Not all systems have dirname.
2398 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2399 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2400 # The file is in a subdirectory.
2401 test ! -d "$ac_dir" && mkdir "$ac_dir"
2402 fi
2403 rm -f $ac_file
2404 mv conftest.h $ac_file
2405 fi
2406 fi; done
2407
2408 EOF
2409
2410 cat >> $CONFIG_STATUS <<EOF
2411 ac_sources="$sim_link_files"
2412 ac_dests="$sim_link_links"
2413 EOF
2414
2415 cat >> $CONFIG_STATUS <<\EOF
2416 srcdir=$ac_given_srcdir
2417 while test -n "$ac_sources"; do
2418 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
2419 set $ac_sources; ac_source=$1; shift; ac_sources=$*
2420
2421 echo "linking $srcdir/$ac_source to $ac_dest"
2422
2423 if test ! -r $srcdir/$ac_source; then
2424 { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
2425 fi
2426 rm -f $ac_dest
2427
2428 # Make relative symlinks.
2429 # Remove last slash and all that follows it. Not all systems have dirname.
2430 ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
2431 if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
2432 # The dest file is in a subdirectory.
2433 test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
2434 ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
2435 # A "../" for each directory in $ac_dest_dir_suffix.
2436 ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
2437 else
2438 ac_dest_dir_suffix= ac_dots=
2439 fi
2440
2441 case "$srcdir" in
2442 [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
2443 *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
2444 esac
2445
2446 # Make a symlink if possible; otherwise try a hard link.
2447 if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
2448 ln $srcdir/$ac_source $ac_dest; then :
2449 else
2450 { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
2451 fi
2452 done
2453 EOF
2454 cat >> $CONFIG_STATUS <<EOF
2455
2456 EOF
2457 cat >> $CONFIG_STATUS <<\EOF
2458 case "x$CONFIG_FILES" in
2459 xMakefile*)
2460 echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
2461 rm -f Makesim1.tmp Makesim2.tmp Makefile
2462 sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
2463 sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
2464 sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
2465 -e '/^## COMMON_POST_/ r Makesim2.tmp' \
2466 <Makefile.sim >Makefile
2467 rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
2468 ;;
2469 esac
2470 case "x$CONFIG_HEADERS" in xconfig.h:config.in) echo > stamp-h ;; esac
2471
2472 exit 0
2473 EOF
2474 chmod +x $CONFIG_STATUS
2475 rm -fr confdefs* $ac_clean_files
2476 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2477
2478