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