This commit was generated by cvs2svn to track changes on a CVS vendor
[external/binutils.git] / sim / sh / 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 sim_inline="-DDEFAULT_INLINE=0"
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
79
80
81 # This file is derived from `gettext.m4'.  The difference is that the
82 # included macros assume Cygnus-style source and build trees.
83
84 # Macro to add for using GNU gettext.
85 # Ulrich Drepper <drepper@cygnus.com>, 1995.
86 #
87 # This file file be copied and used freely without restrictions.  It can
88 # be used in projects which are not available under the GNU Public License
89 # but which still want to provide support for the GNU gettext functionality.
90 # Please note that the actual code is *not* freely available.
91
92 # serial 3
93
94
95
96
97
98 # Search path for a program which passes the given test.
99 # Ulrich Drepper <drepper@cygnus.com>, 1996.
100 #
101 # This file file be copied and used freely without restrictions.  It can
102 # be used in projects which are not available under the GNU Public License
103 # but which still want to provide support for the GNU gettext functionality.
104 # Please note that the actual code is *not* freely available.
105
106 # serial 1
107
108
109
110 # Check whether LC_MESSAGES is available in <locale.h>.
111 # Ulrich Drepper <drepper@cygnus.com>, 1995.
112 #
113 # This file file be copied and used freely without restrictions.  It can
114 # be used in projects which are not available under the GNU Public License
115 # but which still want to provide support for the GNU gettext functionality.
116 # Please note that the actual code is *not* freely available.
117
118 # serial 1
119
120
121
122
123 # Guess values for system-dependent variables and create Makefiles.
124 # Generated automatically using autoconf version 2.12.1 
125 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
126 #
127 # This configure script is free software; the Free Software Foundation
128 # gives unlimited permission to copy, distribute and modify it.
129
130 # Defaults:
131 ac_help=
132 ac_default_prefix=/usr/local
133 # Any additions from configure.in:
134 ac_help="$ac_help
135   --disable-nls           do not use Native Language Support"
136 ac_help="$ac_help
137   --with-included-gettext use the GNU gettext library included here"
138 ac_help="$ac_help
139   --enable-maintainer-mode              Enable developer functionality."
140 ac_help="$ac_help
141   --enable-sim-bswap                    Use Host specific BSWAP instruction."
142 ac_help="$ac_help
143   --enable-sim-cflags=opts              Extra CFLAGS for use in building simulator"
144 ac_help="$ac_help
145   --enable-sim-debug=opts               Enable debugging flags"
146 ac_help="$ac_help
147   --enable-sim-stdio                    Specify whether to use stdio for console input/output."
148 ac_help="$ac_help
149   --enable-sim-trace=opts               Enable tracing flags"
150 ac_help="$ac_help
151   --enable-sim-profile=opts             Enable profiling flags"
152
153 # Initialize some variables set by options.
154 # The variables have the same names as the options, with
155 # dashes changed to underlines.
156 build=NONE
157 cache_file=./config.cache
158 exec_prefix=NONE
159 host=NONE
160 no_create=
161 nonopt=NONE
162 no_recursion=
163 prefix=NONE
164 program_prefix=NONE
165 program_suffix=NONE
166 program_transform_name=s,x,x,
167 silent=
168 site=
169 srcdir=
170 target=NONE
171 verbose=
172 x_includes=NONE
173 x_libraries=NONE
174 bindir='${exec_prefix}/bin'
175 sbindir='${exec_prefix}/sbin'
176 libexecdir='${exec_prefix}/libexec'
177 datadir='${prefix}/share'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 libdir='${exec_prefix}/lib'
182 includedir='${prefix}/include'
183 oldincludedir='/usr/include'
184 infodir='${prefix}/info'
185 mandir='${prefix}/man'
186
187 # Initialize some other variables.
188 subdirs=
189 MFLAGS= MAKEFLAGS=
190 SHELL=${CONFIG_SHELL-/bin/sh}
191 # Maximum number of lines to put in a shell here document.
192 ac_max_here_lines=12
193
194 ac_prev=
195 for ac_option
196 do
197
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   case "$ac_option" in
206   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
207   *) ac_optarg= ;;
208   esac
209
210   # Accept the important Cygnus configure options, so we can diagnose typos.
211
212   case "$ac_option" in
213
214   -bindir | --bindir | --bindi | --bind | --bin | --bi)
215     ac_prev=bindir ;;
216   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
217     bindir="$ac_optarg" ;;
218
219   -build | --build | --buil | --bui | --bu)
220     ac_prev=build ;;
221   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
222     build="$ac_optarg" ;;
223
224   -cache-file | --cache-file | --cache-fil | --cache-fi \
225   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
226     ac_prev=cache_file ;;
227   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
228   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
229     cache_file="$ac_optarg" ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir="$ac_optarg" ;;
236
237   -disable-* | --disable-*)
238     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
239     # Reject names that are not valid shell variable names.
240     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
241       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
242     fi
243     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
244     eval "enable_${ac_feature}=no" ;;
245
246   -enable-* | --enable-*)
247     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
248     # Reject names that are not valid shell variable names.
249     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
250       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
251     fi
252     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
253     case "$ac_option" in
254       *=*) ;;
255       *) ac_optarg=yes ;;
256     esac
257     eval "enable_${ac_feature}='$ac_optarg'" ;;
258
259   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
260   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
261   | --exec | --exe | --ex)
262     ac_prev=exec_prefix ;;
263   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
264   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
265   | --exec=* | --exe=* | --ex=*)
266     exec_prefix="$ac_optarg" ;;
267
268   -gas | --gas | --ga | --g)
269     # Obsolete; use --with-gas.
270     with_gas=yes ;;
271
272   -help | --help | --hel | --he)
273     # Omit some internal or obsolete options to make the list less imposing.
274     # This message is too long to be a string in the A/UX 3.1 sh.
275     cat << EOF
276 Usage: configure [options] [host]
277 Options: [defaults in brackets after descriptions]
278 Configuration:
279   --cache-file=FILE       cache test results in FILE
280   --help                  print this message
281   --no-create             do not create output files
282   --quiet, --silent       do not print \`checking...' messages
283   --version               print the version of autoconf that created configure
284 Directory and file names:
285   --prefix=PREFIX         install architecture-independent files in PREFIX
286                           [$ac_default_prefix]
287   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
288                           [same as prefix]
289   --bindir=DIR            user executables in DIR [EPREFIX/bin]
290   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
291   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
292   --datadir=DIR           read-only architecture-independent data in DIR
293                           [PREFIX/share]
294   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
295   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
296                           [PREFIX/com]
297   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
298   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
299   --includedir=DIR        C header files in DIR [PREFIX/include]
300   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
301   --infodir=DIR           info documentation in DIR [PREFIX/info]
302   --mandir=DIR            man documentation in DIR [PREFIX/man]
303   --srcdir=DIR            find the sources in DIR [configure dir or ..]
304   --program-prefix=PREFIX prepend PREFIX to installed program names
305   --program-suffix=SUFFIX append SUFFIX to installed program names
306   --program-transform-name=PROGRAM
307                           run sed PROGRAM on installed program names
308 EOF
309     cat << EOF
310 Host type:
311   --build=BUILD           configure for building on BUILD [BUILD=HOST]
312   --host=HOST             configure for HOST [guessed]
313   --target=TARGET         configure for TARGET [TARGET=HOST]
314 Features and packages:
315   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
316   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
317   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
318   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
319   --x-includes=DIR        X include files are in DIR
320   --x-libraries=DIR       X library files are in DIR
321 EOF
322     if test -n "$ac_help"; then
323       echo "--enable and --with options recognized:$ac_help"
324     fi
325     exit 0 ;;
326
327   -host | --host | --hos | --ho)
328     ac_prev=host ;;
329   -host=* | --host=* | --hos=* | --ho=*)
330     host="$ac_optarg" ;;
331
332   -includedir | --includedir | --includedi | --included | --include \
333   | --includ | --inclu | --incl | --inc)
334     ac_prev=includedir ;;
335   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
336   | --includ=* | --inclu=* | --incl=* | --inc=*)
337     includedir="$ac_optarg" ;;
338
339   -infodir | --infodir | --infodi | --infod | --info | --inf)
340     ac_prev=infodir ;;
341   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
342     infodir="$ac_optarg" ;;
343
344   -libdir | --libdir | --libdi | --libd)
345     ac_prev=libdir ;;
346   -libdir=* | --libdir=* | --libdi=* | --libd=*)
347     libdir="$ac_optarg" ;;
348
349   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
350   | --libexe | --libex | --libe)
351     ac_prev=libexecdir ;;
352   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
353   | --libexe=* | --libex=* | --libe=*)
354     libexecdir="$ac_optarg" ;;
355
356   -localstatedir | --localstatedir | --localstatedi | --localstated \
357   | --localstate | --localstat | --localsta | --localst \
358   | --locals | --local | --loca | --loc | --lo)
359     ac_prev=localstatedir ;;
360   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
361   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
362   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
363     localstatedir="$ac_optarg" ;;
364
365   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
366     ac_prev=mandir ;;
367   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
368     mandir="$ac_optarg" ;;
369
370   -nfp | --nfp | --nf)
371     # Obsolete; use --without-fp.
372     with_fp=no ;;
373
374   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
375   | --no-cr | --no-c)
376     no_create=yes ;;
377
378   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
379   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
380     no_recursion=yes ;;
381
382   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
383   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
384   | --oldin | --oldi | --old | --ol | --o)
385     ac_prev=oldincludedir ;;
386   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
387   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
388   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
389     oldincludedir="$ac_optarg" ;;
390
391   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
392     ac_prev=prefix ;;
393   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
394     prefix="$ac_optarg" ;;
395
396   -program-prefix | --program-prefix | --program-prefi | --program-pref \
397   | --program-pre | --program-pr | --program-p)
398     ac_prev=program_prefix ;;
399   -program-prefix=* | --program-prefix=* | --program-prefi=* \
400   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
401     program_prefix="$ac_optarg" ;;
402
403   -program-suffix | --program-suffix | --program-suffi | --program-suff \
404   | --program-suf | --program-su | --program-s)
405     ac_prev=program_suffix ;;
406   -program-suffix=* | --program-suffix=* | --program-suffi=* \
407   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
408     program_suffix="$ac_optarg" ;;
409
410   -program-transform-name | --program-transform-name \
411   | --program-transform-nam | --program-transform-na \
412   | --program-transform-n | --program-transform- \
413   | --program-transform | --program-transfor \
414   | --program-transfo | --program-transf \
415   | --program-trans | --program-tran \
416   | --progr-tra | --program-tr | --program-t)
417     ac_prev=program_transform_name ;;
418   -program-transform-name=* | --program-transform-name=* \
419   | --program-transform-nam=* | --program-transform-na=* \
420   | --program-transform-n=* | --program-transform-=* \
421   | --program-transform=* | --program-transfor=* \
422   | --program-transfo=* | --program-transf=* \
423   | --program-trans=* | --program-tran=* \
424   | --progr-tra=* | --program-tr=* | --program-t=*)
425     program_transform_name="$ac_optarg" ;;
426
427   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
428   | -silent | --silent | --silen | --sile | --sil)
429     silent=yes ;;
430
431   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
432     ac_prev=sbindir ;;
433   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
434   | --sbi=* | --sb=*)
435     sbindir="$ac_optarg" ;;
436
437   -sharedstatedir | --sharedstatedir | --sharedstatedi \
438   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
439   | --sharedst | --shareds | --shared | --share | --shar \
440   | --sha | --sh)
441     ac_prev=sharedstatedir ;;
442   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
443   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
444   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
445   | --sha=* | --sh=*)
446     sharedstatedir="$ac_optarg" ;;
447
448   -site | --site | --sit)
449     ac_prev=site ;;
450   -site=* | --site=* | --sit=*)
451     site="$ac_optarg" ;;
452
453   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
454     ac_prev=srcdir ;;
455   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
456     srcdir="$ac_optarg" ;;
457
458   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
459   | --syscon | --sysco | --sysc | --sys | --sy)
460     ac_prev=sysconfdir ;;
461   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
462   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
463     sysconfdir="$ac_optarg" ;;
464
465   -target | --target | --targe | --targ | --tar | --ta | --t)
466     ac_prev=target ;;
467   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
468     target="$ac_optarg" ;;
469
470   -v | -verbose | --verbose | --verbos | --verbo | --verb)
471     verbose=yes ;;
472
473   -version | --version | --versio | --versi | --vers)
474     echo "configure generated by autoconf version 2.12.1"
475     exit 0 ;;
476
477   -with-* | --with-*)
478     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
479     # Reject names that are not valid shell variable names.
480     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
481       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
482     fi
483     ac_package=`echo $ac_package| sed 's/-/_/g'`
484     case "$ac_option" in
485       *=*) ;;
486       *) ac_optarg=yes ;;
487     esac
488     eval "with_${ac_package}='$ac_optarg'" ;;
489
490   -without-* | --without-*)
491     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
492     # Reject names that are not valid shell variable names.
493     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
494       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
495     fi
496     ac_package=`echo $ac_package| sed 's/-/_/g'`
497     eval "with_${ac_package}=no" ;;
498
499   --x)
500     # Obsolete; use --with-x.
501     with_x=yes ;;
502
503   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
504   | --x-incl | --x-inc | --x-in | --x-i)
505     ac_prev=x_includes ;;
506   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
507   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
508     x_includes="$ac_optarg" ;;
509
510   -x-libraries | --x-libraries | --x-librarie | --x-librari \
511   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
512     ac_prev=x_libraries ;;
513   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
514   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
515     x_libraries="$ac_optarg" ;;
516
517   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
518     ;;
519
520   *)
521     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
522       echo "configure: warning: $ac_option: invalid host type" 1>&2
523     fi
524     if test "x$nonopt" != xNONE; then
525       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
526     fi
527     nonopt="$ac_option"
528     ;;
529
530   esac
531 done
532
533 if test -n "$ac_prev"; then
534   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
535 fi
536
537 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
538
539 # File descriptor usage:
540 # 0 standard input
541 # 1 file creation
542 # 2 errors and warnings
543 # 3 some systems may open it to /dev/tty
544 # 4 used on the Kubota Titan
545 # 6 checking for... messages and results
546 # 5 compiler messages saved in config.log
547 if test "$silent" = yes; then
548   exec 6>/dev/null
549 else
550   exec 6>&1
551 fi
552 exec 5>./config.log
553
554 echo "\
555 This file contains any messages produced by compilers while
556 running configure, to aid debugging if configure makes a mistake.
557 " 1>&5
558
559 # Strip out --no-create and --no-recursion so they do not pile up.
560 # Also quote any args containing shell metacharacters.
561 ac_configure_args=
562 for ac_arg
563 do
564   case "$ac_arg" in
565   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
566   | --no-cr | --no-c) ;;
567   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
568   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
569   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
570   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
571   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
572   esac
573 done
574
575 # NLS nuisances.
576 # Only set these to C if already set.  These must not be set unconditionally
577 # because not all systems understand e.g. LANG=C (notably SCO).
578 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
579 # Non-C LC_CTYPE values break the ctype check.
580 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
581 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
582 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
583 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
584
585 # confdefs.h avoids OS command line length limits that DEFS can exceed.
586 rm -rf conftest* confdefs.h
587 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
588 echo > confdefs.h
589
590 # A filename unique to this package, relative to the directory that
591 # configure is in, which we can look for to find out if srcdir is correct.
592 ac_unique_file=Makefile.in
593
594 # Find the source files, if location was not specified.
595 if test -z "$srcdir"; then
596   ac_srcdir_defaulted=yes
597   # Try the directory containing this script, then its parent.
598   ac_prog=$0
599   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
600   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
601   srcdir=$ac_confdir
602   if test ! -r $srcdir/$ac_unique_file; then
603     srcdir=..
604   fi
605 else
606   ac_srcdir_defaulted=no
607 fi
608 if test ! -r $srcdir/$ac_unique_file; then
609   if test "$ac_srcdir_defaulted" = yes; then
610     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
611   else
612     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
613   fi
614 fi
615 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
616
617 # Prefer explicitly selected file to automatically selected ones.
618 if test -z "$CONFIG_SITE"; then
619   if test "x$prefix" != xNONE; then
620     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
621   else
622     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
623   fi
624 fi
625 for ac_site_file in $CONFIG_SITE; do
626   if test -r "$ac_site_file"; then
627     echo "loading site script $ac_site_file"
628     . "$ac_site_file"
629   fi
630 done
631
632 if test -r "$cache_file"; then
633   echo "loading cache $cache_file"
634   . $cache_file
635 else
636   echo "creating cache $cache_file"
637   > $cache_file
638 fi
639
640 ac_ext=c
641 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
642 ac_cpp='$CPP $CPPFLAGS'
643 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
644 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
645 cross_compiling=$ac_cv_prog_cc_cross
646
647 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
648   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
649   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
650     ac_n= ac_c='
651 ' ac_t='        '
652   else
653     ac_n=-n ac_c= ac_t=
654   fi
655 else
656   ac_n= ac_c='\c' ac_t=
657 fi
658
659
660
661 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
662 echo "configure:663: checking how to run the C preprocessor" >&5
663 # On Suns, sometimes $CPP names a directory.
664 if test -n "$CPP" && test -d "$CPP"; then
665   CPP=
666 fi
667 if test -z "$CPP"; then
668 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
669   echo $ac_n "(cached) $ac_c" 1>&6
670 else
671     # This must be in double quotes, not single quotes, because CPP may get
672   # substituted into the Makefile and "${CC-cc}" will confuse make.
673   CPP="${CC-cc} -E"
674   # On the NeXT, cc -E runs the code through the compiler's parser,
675   # not just through cpp.
676   cat > conftest.$ac_ext <<EOF
677 #line 678 "configure"
678 #include "confdefs.h"
679 #include <assert.h>
680 Syntax Error
681 EOF
682 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
683 { (eval echo configure:684: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
684 ac_err=`grep -v '^ *+' conftest.out`
685 if test -z "$ac_err"; then
686   :
687 else
688   echo "$ac_err" >&5
689   echo "configure: failed program was:" >&5
690   cat conftest.$ac_ext >&5
691   rm -rf conftest*
692   CPP="${CC-cc} -E -traditional-cpp"
693   cat > conftest.$ac_ext <<EOF
694 #line 695 "configure"
695 #include "confdefs.h"
696 #include <assert.h>
697 Syntax Error
698 EOF
699 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
700 { (eval echo configure:701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
701 ac_err=`grep -v '^ *+' conftest.out`
702 if test -z "$ac_err"; then
703   :
704 else
705   echo "$ac_err" >&5
706   echo "configure: failed program was:" >&5
707   cat conftest.$ac_ext >&5
708   rm -rf conftest*
709   CPP=/lib/cpp
710 fi
711 rm -f conftest*
712 fi
713 rm -f conftest*
714   ac_cv_prog_CPP="$CPP"
715 fi
716   CPP="$ac_cv_prog_CPP"
717 else
718   ac_cv_prog_CPP="$CPP"
719 fi
720 echo "$ac_t""$CPP" 1>&6
721
722 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
723 echo "configure:724: checking whether ${MAKE-make} sets \${MAKE}" >&5
724 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
725 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
726   echo $ac_n "(cached) $ac_c" 1>&6
727 else
728   cat > conftestmake <<\EOF
729 all:
730         @echo 'ac_maketemp="${MAKE}"'
731 EOF
732 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
733 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
734 if test -n "$ac_maketemp"; then
735   eval ac_cv_prog_make_${ac_make}_set=yes
736 else
737   eval ac_cv_prog_make_${ac_make}_set=no
738 fi
739 rm -f conftestmake
740 fi
741 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
742   echo "$ac_t""yes" 1>&6
743   SET_MAKE=
744 else
745   echo "$ac_t""no" 1>&6
746   SET_MAKE="MAKE=${MAKE-make}"
747 fi
748
749 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
750 echo "configure:751: checking for POSIXized ISC" >&5
751 if test -d /etc/conf/kconfig.d &&
752   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
753 then
754   echo "$ac_t""yes" 1>&6
755   ISC=yes # If later tests want to check for ISC.
756   cat >> confdefs.h <<\EOF
757 #define _POSIX_SOURCE 1
758 EOF
759
760   if test "$GCC" = yes; then
761     CC="$CC -posix"
762   else
763     CC="$CC -Xp"
764   fi
765 else
766   echo "$ac_t""no" 1>&6
767   ISC=
768 fi
769
770 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
771 echo "configure:772: checking for ANSI C header files" >&5
772 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
773   echo $ac_n "(cached) $ac_c" 1>&6
774 else
775   cat > conftest.$ac_ext <<EOF
776 #line 777 "configure"
777 #include "confdefs.h"
778 #include <stdlib.h>
779 #include <stdarg.h>
780 #include <string.h>
781 #include <float.h>
782 EOF
783 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
784 { (eval echo configure:785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
785 ac_err=`grep -v '^ *+' conftest.out`
786 if test -z "$ac_err"; then
787   rm -rf conftest*
788   ac_cv_header_stdc=yes
789 else
790   echo "$ac_err" >&5
791   echo "configure: failed program was:" >&5
792   cat conftest.$ac_ext >&5
793   rm -rf conftest*
794   ac_cv_header_stdc=no
795 fi
796 rm -f conftest*
797
798 if test $ac_cv_header_stdc = yes; then
799   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
800 cat > conftest.$ac_ext <<EOF
801 #line 802 "configure"
802 #include "confdefs.h"
803 #include <string.h>
804 EOF
805 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
806   egrep "memchr" >/dev/null 2>&1; then
807   :
808 else
809   rm -rf conftest*
810   ac_cv_header_stdc=no
811 fi
812 rm -f conftest*
813
814 fi
815
816 if test $ac_cv_header_stdc = yes; then
817   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
818 cat > conftest.$ac_ext <<EOF
819 #line 820 "configure"
820 #include "confdefs.h"
821 #include <stdlib.h>
822 EOF
823 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
824   egrep "free" >/dev/null 2>&1; then
825   :
826 else
827   rm -rf conftest*
828   ac_cv_header_stdc=no
829 fi
830 rm -f conftest*
831
832 fi
833
834 if test $ac_cv_header_stdc = yes; then
835   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
836 if test "$cross_compiling" = yes; then
837   :
838 else
839   cat > conftest.$ac_ext <<EOF
840 #line 841 "configure"
841 #include "confdefs.h"
842 #include <ctype.h>
843 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
844 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
845 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
846 int main () { int i; for (i = 0; i < 256; i++)
847 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
848 exit (0); }
849
850 EOF
851 if { (eval echo configure:852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
852 then
853   :
854 else
855   echo "configure: failed program was:" >&5
856   cat conftest.$ac_ext >&5
857   rm -fr conftest*
858   ac_cv_header_stdc=no
859 fi
860 rm -fr conftest*
861 fi
862
863 fi
864 fi
865
866 echo "$ac_t""$ac_cv_header_stdc" 1>&6
867 if test $ac_cv_header_stdc = yes; then
868   cat >> confdefs.h <<\EOF
869 #define STDC_HEADERS 1
870 EOF
871
872 fi
873
874 echo $ac_n "checking for working const""... $ac_c" 1>&6
875 echo "configure:876: checking for working const" >&5
876 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
877   echo $ac_n "(cached) $ac_c" 1>&6
878 else
879   cat > conftest.$ac_ext <<EOF
880 #line 881 "configure"
881 #include "confdefs.h"
882
883 int main() {
884
885 /* Ultrix mips cc rejects this.  */
886 typedef int charset[2]; const charset x;
887 /* SunOS 4.1.1 cc rejects this.  */
888 char const *const *ccp;
889 char **p;
890 /* NEC SVR4.0.2 mips cc rejects this.  */
891 struct point {int x, y;};
892 static struct point const zero = {0,0};
893 /* AIX XL C 1.02.0.0 rejects this.
894    It does not let you subtract one const X* pointer from another in an arm
895    of an if-expression whose if-part is not a constant expression */
896 const char *g = "string";
897 ccp = &g + (g ? g-g : 0);
898 /* HPUX 7.0 cc rejects these. */
899 ++ccp;
900 p = (char**) ccp;
901 ccp = (char const *const *) p;
902 { /* SCO 3.2v4 cc rejects this.  */
903   char *t;
904   char const *s = 0 ? (char *) 0 : (char const *) 0;
905
906   *t++ = 0;
907 }
908 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
909   int x[] = {25, 17};
910   const int *foo = &x[0];
911   ++foo;
912 }
913 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
914   typedef const int *iptr;
915   iptr p = 0;
916   ++p;
917 }
918 { /* AIX XL C 1.02.0.0 rejects this saying
919      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
920   struct s { int j; const int *ap[3]; };
921   struct s *b; b->j = 5;
922 }
923 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
924   const int foo = 10;
925 }
926
927 ; return 0; }
928 EOF
929 if { (eval echo configure:930: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
930   rm -rf conftest*
931   ac_cv_c_const=yes
932 else
933   echo "configure: failed program was:" >&5
934   cat conftest.$ac_ext >&5
935   rm -rf conftest*
936   ac_cv_c_const=no
937 fi
938 rm -f conftest*
939 fi
940
941 echo "$ac_t""$ac_cv_c_const" 1>&6
942 if test $ac_cv_c_const = no; then
943   cat >> confdefs.h <<\EOF
944 #define const 
945 EOF
946
947 fi
948
949 echo $ac_n "checking for inline""... $ac_c" 1>&6
950 echo "configure:951: checking for inline" >&5
951 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
952   echo $ac_n "(cached) $ac_c" 1>&6
953 else
954   ac_cv_c_inline=no
955 for ac_kw in inline __inline__ __inline; do
956   cat > conftest.$ac_ext <<EOF
957 #line 958 "configure"
958 #include "confdefs.h"
959
960 int main() {
961 } $ac_kw foo() {
962 ; return 0; }
963 EOF
964 if { (eval echo configure:965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
965   rm -rf conftest*
966   ac_cv_c_inline=$ac_kw; break
967 else
968   echo "configure: failed program was:" >&5
969   cat conftest.$ac_ext >&5
970 fi
971 rm -f conftest*
972 done
973
974 fi
975
976 echo "$ac_t""$ac_cv_c_inline" 1>&6
977 case "$ac_cv_c_inline" in
978   inline | yes) ;;
979   no) cat >> confdefs.h <<\EOF
980 #define inline 
981 EOF
982  ;;
983   *)  cat >> confdefs.h <<EOF
984 #define inline $ac_cv_c_inline
985 EOF
986  ;;
987 esac
988
989 echo $ac_n "checking for off_t""... $ac_c" 1>&6
990 echo "configure:991: checking for off_t" >&5
991 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
992   echo $ac_n "(cached) $ac_c" 1>&6
993 else
994   cat > conftest.$ac_ext <<EOF
995 #line 996 "configure"
996 #include "confdefs.h"
997 #include <sys/types.h>
998 #if STDC_HEADERS
999 #include <stdlib.h>
1000 #include <stddef.h>
1001 #endif
1002 EOF
1003 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1004   egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1005   rm -rf conftest*
1006   ac_cv_type_off_t=yes
1007 else
1008   rm -rf conftest*
1009   ac_cv_type_off_t=no
1010 fi
1011 rm -f conftest*
1012
1013 fi
1014 echo "$ac_t""$ac_cv_type_off_t" 1>&6
1015 if test $ac_cv_type_off_t = no; then
1016   cat >> confdefs.h <<\EOF
1017 #define off_t long
1018 EOF
1019
1020 fi
1021
1022 echo $ac_n "checking for size_t""... $ac_c" 1>&6
1023 echo "configure:1024: checking for size_t" >&5
1024 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1025   echo $ac_n "(cached) $ac_c" 1>&6
1026 else
1027   cat > conftest.$ac_ext <<EOF
1028 #line 1029 "configure"
1029 #include "confdefs.h"
1030 #include <sys/types.h>
1031 #if STDC_HEADERS
1032 #include <stdlib.h>
1033 #include <stddef.h>
1034 #endif
1035 EOF
1036 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1037   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1038   rm -rf conftest*
1039   ac_cv_type_size_t=yes
1040 else
1041   rm -rf conftest*
1042   ac_cv_type_size_t=no
1043 fi
1044 rm -f conftest*
1045
1046 fi
1047 echo "$ac_t""$ac_cv_type_size_t" 1>&6
1048 if test $ac_cv_type_size_t = no; then
1049   cat >> confdefs.h <<\EOF
1050 #define size_t unsigned
1051 EOF
1052
1053 fi
1054
1055 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
1056 # for constant arguments.  Useless!
1057 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
1058 echo "configure:1059: checking for working alloca.h" >&5
1059 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
1060   echo $ac_n "(cached) $ac_c" 1>&6
1061 else
1062   cat > conftest.$ac_ext <<EOF
1063 #line 1064 "configure"
1064 #include "confdefs.h"
1065 #include <alloca.h>
1066 int main() {
1067 char *p = alloca(2 * sizeof(int));
1068 ; return 0; }
1069 EOF
1070 if { (eval echo configure:1071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1071   rm -rf conftest*
1072   ac_cv_header_alloca_h=yes
1073 else
1074   echo "configure: failed program was:" >&5
1075   cat conftest.$ac_ext >&5
1076   rm -rf conftest*
1077   ac_cv_header_alloca_h=no
1078 fi
1079 rm -f conftest*
1080 fi
1081
1082 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
1083 if test $ac_cv_header_alloca_h = yes; then
1084   cat >> confdefs.h <<\EOF
1085 #define HAVE_ALLOCA_H 1
1086 EOF
1087
1088 fi
1089
1090 echo $ac_n "checking for alloca""... $ac_c" 1>&6
1091 echo "configure:1092: checking for alloca" >&5
1092 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
1093   echo $ac_n "(cached) $ac_c" 1>&6
1094 else
1095   cat > conftest.$ac_ext <<EOF
1096 #line 1097 "configure"
1097 #include "confdefs.h"
1098
1099 #ifdef __GNUC__
1100 # define alloca __builtin_alloca
1101 #else
1102 # if HAVE_ALLOCA_H
1103 #  include <alloca.h>
1104 # else
1105 #  ifdef _AIX
1106  #pragma alloca
1107 #  else
1108 #   ifndef alloca /* predefined by HP cc +Olibcalls */
1109 char *alloca ();
1110 #   endif
1111 #  endif
1112 # endif
1113 #endif
1114
1115 int main() {
1116 char *p = (char *) alloca(1);
1117 ; return 0; }
1118 EOF
1119 if { (eval echo configure:1120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1120   rm -rf conftest*
1121   ac_cv_func_alloca_works=yes
1122 else
1123   echo "configure: failed program was:" >&5
1124   cat conftest.$ac_ext >&5
1125   rm -rf conftest*
1126   ac_cv_func_alloca_works=no
1127 fi
1128 rm -f conftest*
1129 fi
1130
1131 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
1132 if test $ac_cv_func_alloca_works = yes; then
1133   cat >> confdefs.h <<\EOF
1134 #define HAVE_ALLOCA 1
1135 EOF
1136
1137 fi
1138
1139 if test $ac_cv_func_alloca_works = no; then
1140   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
1141   # that cause trouble.  Some versions do not even contain alloca or
1142   # contain a buggy version.  If you still want to use their alloca,
1143   # use ar to extract alloca.o from them instead of compiling alloca.c.
1144   ALLOCA=alloca.o
1145   cat >> confdefs.h <<\EOF
1146 #define C_ALLOCA 1
1147 EOF
1148
1149
1150 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
1151 echo "configure:1152: checking whether alloca needs Cray hooks" >&5
1152 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
1153   echo $ac_n "(cached) $ac_c" 1>&6
1154 else
1155   cat > conftest.$ac_ext <<EOF
1156 #line 1157 "configure"
1157 #include "confdefs.h"
1158 #if defined(CRAY) && ! defined(CRAY2)
1159 webecray
1160 #else
1161 wenotbecray
1162 #endif
1163
1164 EOF
1165 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1166   egrep "webecray" >/dev/null 2>&1; then
1167   rm -rf conftest*
1168   ac_cv_os_cray=yes
1169 else
1170   rm -rf conftest*
1171   ac_cv_os_cray=no
1172 fi
1173 rm -f conftest*
1174
1175 fi
1176
1177 echo "$ac_t""$ac_cv_os_cray" 1>&6
1178 if test $ac_cv_os_cray = yes; then
1179 for ac_func in _getb67 GETB67 getb67; do
1180   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1181 echo "configure:1182: checking for $ac_func" >&5
1182 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1183   echo $ac_n "(cached) $ac_c" 1>&6
1184 else
1185   cat > conftest.$ac_ext <<EOF
1186 #line 1187 "configure"
1187 #include "confdefs.h"
1188 /* System header to define __stub macros and hopefully few prototypes,
1189     which can conflict with char $ac_func(); below.  */
1190 #include <assert.h>
1191 /* Override any gcc2 internal prototype to avoid an error.  */
1192 /* We use char because int might match the return type of a gcc2
1193     builtin and then its argument prototype would still apply.  */
1194 char $ac_func();
1195
1196 int main() {
1197
1198 /* The GNU C library defines this for functions which it implements
1199     to always fail with ENOSYS.  Some functions are actually named
1200     something starting with __ and the normal name is an alias.  */
1201 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1202 choke me
1203 #else
1204 $ac_func();
1205 #endif
1206
1207 ; return 0; }
1208 EOF
1209 if { (eval echo configure:1210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1210   rm -rf conftest*
1211   eval "ac_cv_func_$ac_func=yes"
1212 else
1213   echo "configure: failed program was:" >&5
1214   cat conftest.$ac_ext >&5
1215   rm -rf conftest*
1216   eval "ac_cv_func_$ac_func=no"
1217 fi
1218 rm -f conftest*
1219 fi
1220
1221 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1222   echo "$ac_t""yes" 1>&6
1223   cat >> confdefs.h <<EOF
1224 #define CRAY_STACKSEG_END $ac_func
1225 EOF
1226
1227   break
1228 else
1229   echo "$ac_t""no" 1>&6
1230 fi
1231
1232 done
1233 fi
1234
1235 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
1236 echo "configure:1237: checking stack direction for C alloca" >&5
1237 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
1238   echo $ac_n "(cached) $ac_c" 1>&6
1239 else
1240   if test "$cross_compiling" = yes; then
1241   ac_cv_c_stack_direction=0
1242 else
1243   cat > conftest.$ac_ext <<EOF
1244 #line 1245 "configure"
1245 #include "confdefs.h"
1246 find_stack_direction ()
1247 {
1248   static char *addr = 0;
1249   auto char dummy;
1250   if (addr == 0)
1251     {
1252       addr = &dummy;
1253       return find_stack_direction ();
1254     }
1255   else
1256     return (&dummy > addr) ? 1 : -1;
1257 }
1258 main ()
1259 {
1260   exit (find_stack_direction() < 0);
1261 }
1262 EOF
1263 if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1264 then
1265   ac_cv_c_stack_direction=1
1266 else
1267   echo "configure: failed program was:" >&5
1268   cat conftest.$ac_ext >&5
1269   rm -fr conftest*
1270   ac_cv_c_stack_direction=-1
1271 fi
1272 rm -fr conftest*
1273 fi
1274
1275 fi
1276
1277 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
1278 cat >> confdefs.h <<EOF
1279 #define STACK_DIRECTION $ac_cv_c_stack_direction
1280 EOF
1281
1282 fi
1283
1284 for ac_hdr in unistd.h
1285 do
1286 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1287 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1288 echo "configure:1289: checking for $ac_hdr" >&5
1289 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1290   echo $ac_n "(cached) $ac_c" 1>&6
1291 else
1292   cat > conftest.$ac_ext <<EOF
1293 #line 1294 "configure"
1294 #include "confdefs.h"
1295 #include <$ac_hdr>
1296 EOF
1297 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1298 { (eval echo configure:1299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1299 ac_err=`grep -v '^ *+' conftest.out`
1300 if test -z "$ac_err"; then
1301   rm -rf conftest*
1302   eval "ac_cv_header_$ac_safe=yes"
1303 else
1304   echo "$ac_err" >&5
1305   echo "configure: failed program was:" >&5
1306   cat conftest.$ac_ext >&5
1307   rm -rf conftest*
1308   eval "ac_cv_header_$ac_safe=no"
1309 fi
1310 rm -f conftest*
1311 fi
1312 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1313   echo "$ac_t""yes" 1>&6
1314     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1315   cat >> confdefs.h <<EOF
1316 #define $ac_tr_hdr 1
1317 EOF
1318  
1319 else
1320   echo "$ac_t""no" 1>&6
1321 fi
1322 done
1323
1324 for ac_func in getpagesize
1325 do
1326 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1327 echo "configure:1328: checking for $ac_func" >&5
1328 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1329   echo $ac_n "(cached) $ac_c" 1>&6
1330 else
1331   cat > conftest.$ac_ext <<EOF
1332 #line 1333 "configure"
1333 #include "confdefs.h"
1334 /* System header to define __stub macros and hopefully few prototypes,
1335     which can conflict with char $ac_func(); below.  */
1336 #include <assert.h>
1337 /* Override any gcc2 internal prototype to avoid an error.  */
1338 /* We use char because int might match the return type of a gcc2
1339     builtin and then its argument prototype would still apply.  */
1340 char $ac_func();
1341
1342 int main() {
1343
1344 /* The GNU C library defines this for functions which it implements
1345     to always fail with ENOSYS.  Some functions are actually named
1346     something starting with __ and the normal name is an alias.  */
1347 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1348 choke me
1349 #else
1350 $ac_func();
1351 #endif
1352
1353 ; return 0; }
1354 EOF
1355 if { (eval echo configure:1356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1356   rm -rf conftest*
1357   eval "ac_cv_func_$ac_func=yes"
1358 else
1359   echo "configure: failed program was:" >&5
1360   cat conftest.$ac_ext >&5
1361   rm -rf conftest*
1362   eval "ac_cv_func_$ac_func=no"
1363 fi
1364 rm -f conftest*
1365 fi
1366
1367 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1368   echo "$ac_t""yes" 1>&6
1369     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1370   cat >> confdefs.h <<EOF
1371 #define $ac_tr_func 1
1372 EOF
1373  
1374 else
1375   echo "$ac_t""no" 1>&6
1376 fi
1377 done
1378
1379 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
1380 echo "configure:1381: checking for working mmap" >&5
1381 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
1382   echo $ac_n "(cached) $ac_c" 1>&6
1383 else
1384   if test "$cross_compiling" = yes; then
1385   ac_cv_func_mmap_fixed_mapped=no
1386 else
1387   cat > conftest.$ac_ext <<EOF
1388 #line 1389 "configure"
1389 #include "confdefs.h"
1390
1391 /* Thanks to Mike Haertel and Jim Avera for this test.
1392    Here is a matrix of mmap possibilities:
1393         mmap private not fixed
1394         mmap private fixed at somewhere currently unmapped
1395         mmap private fixed at somewhere already mapped
1396         mmap shared not fixed
1397         mmap shared fixed at somewhere currently unmapped
1398         mmap shared fixed at somewhere already mapped
1399    For private mappings, we should verify that changes cannot be read()
1400    back from the file, nor mmap's back from the file at a different
1401    address.  (There have been systems where private was not correctly
1402    implemented like the infamous i386 svr4.0, and systems where the
1403    VM page cache was not coherent with the filesystem buffer cache
1404    like early versions of FreeBSD and possibly contemporary NetBSD.)
1405    For shared mappings, we should conversely verify that changes get
1406    propogated back to all the places they're supposed to be.
1407
1408    Grep wants private fixed already mapped.
1409    The main things grep needs to know about mmap are:
1410    * does it exist and is it safe to write into the mmap'd area
1411    * how to use it (BSD variants)  */
1412 #include <sys/types.h>
1413 #include <fcntl.h>
1414 #include <sys/mman.h>
1415
1416 /* This mess was copied from the GNU getpagesize.h.  */
1417 #ifndef HAVE_GETPAGESIZE
1418 # ifdef HAVE_UNISTD_H
1419 #  include <unistd.h>
1420 # endif
1421
1422 /* Assume that all systems that can run configure have sys/param.h.  */
1423 # ifndef HAVE_SYS_PARAM_H
1424 #  define HAVE_SYS_PARAM_H 1
1425 # endif
1426
1427 # ifdef _SC_PAGESIZE
1428 #  define getpagesize() sysconf(_SC_PAGESIZE)
1429 # else /* no _SC_PAGESIZE */
1430 #  ifdef HAVE_SYS_PARAM_H
1431 #   include <sys/param.h>
1432 #   ifdef EXEC_PAGESIZE
1433 #    define getpagesize() EXEC_PAGESIZE
1434 #   else /* no EXEC_PAGESIZE */
1435 #    ifdef NBPG
1436 #     define getpagesize() NBPG * CLSIZE
1437 #     ifndef CLSIZE
1438 #      define CLSIZE 1
1439 #     endif /* no CLSIZE */
1440 #    else /* no NBPG */
1441 #     ifdef NBPC
1442 #      define getpagesize() NBPC
1443 #     else /* no NBPC */
1444 #      ifdef PAGESIZE
1445 #       define getpagesize() PAGESIZE
1446 #      endif /* PAGESIZE */
1447 #     endif /* no NBPC */
1448 #    endif /* no NBPG */
1449 #   endif /* no EXEC_PAGESIZE */
1450 #  else /* no HAVE_SYS_PARAM_H */
1451 #   define getpagesize() 8192   /* punt totally */
1452 #  endif /* no HAVE_SYS_PARAM_H */
1453 # endif /* no _SC_PAGESIZE */
1454
1455 #endif /* no HAVE_GETPAGESIZE */
1456
1457 #ifdef __cplusplus
1458 extern "C" { void *malloc(unsigned); }
1459 #else
1460 char *malloc();
1461 #endif
1462
1463 int
1464 main()
1465 {
1466         char *data, *data2, *data3;
1467         int i, pagesize;
1468         int fd;
1469
1470         pagesize = getpagesize();
1471
1472         /*
1473          * First, make a file with some known garbage in it.
1474          */
1475         data = malloc(pagesize);
1476         if (!data)
1477                 exit(1);
1478         for (i = 0; i < pagesize; ++i)
1479                 *(data + i) = rand();
1480         umask(0);
1481         fd = creat("conftestmmap", 0600);
1482         if (fd < 0)
1483                 exit(1);
1484         if (write(fd, data, pagesize) != pagesize)
1485                 exit(1);
1486         close(fd);
1487
1488         /*
1489          * Next, try to mmap the file at a fixed address which
1490          * already has something else allocated at it.  If we can,
1491          * also make sure that we see the same garbage.
1492          */
1493         fd = open("conftestmmap", O_RDWR);
1494         if (fd < 0)
1495                 exit(1);
1496         data2 = malloc(2 * pagesize);
1497         if (!data2)
1498                 exit(1);
1499         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
1500         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
1501             MAP_PRIVATE | MAP_FIXED, fd, 0L))
1502                 exit(1);
1503         for (i = 0; i < pagesize; ++i)
1504                 if (*(data + i) != *(data2 + i))
1505                         exit(1);
1506
1507         /*
1508          * Finally, make sure that changes to the mapped area
1509          * do not percolate back to the file as seen by read().
1510          * (This is a bug on some variants of i386 svr4.0.)
1511          */
1512         for (i = 0; i < pagesize; ++i)
1513                 *(data2 + i) = *(data2 + i) + 1;
1514         data3 = malloc(pagesize);
1515         if (!data3)
1516                 exit(1);
1517         if (read(fd, data3, pagesize) != pagesize)
1518                 exit(1);
1519         for (i = 0; i < pagesize; ++i)
1520                 if (*(data + i) != *(data3 + i))
1521                         exit(1);
1522         close(fd);
1523         unlink("conftestmmap");
1524         exit(0);
1525 }
1526
1527 EOF
1528 if { (eval echo configure:1529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1529 then
1530   ac_cv_func_mmap_fixed_mapped=yes
1531 else
1532   echo "configure: failed program was:" >&5
1533   cat conftest.$ac_ext >&5
1534   rm -fr conftest*
1535   ac_cv_func_mmap_fixed_mapped=no
1536 fi
1537 rm -fr conftest*
1538 fi
1539
1540 fi
1541
1542 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
1543 if test $ac_cv_func_mmap_fixed_mapped = yes; then
1544   cat >> confdefs.h <<\EOF
1545 #define HAVE_MMAP 1
1546 EOF
1547
1548 fi
1549
1550
1551 # autoconf.info says this should be called right after AC_INIT.
1552
1553
1554 ac_aux_dir=
1555 for ac_dir in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../..; do
1556   if test -f $ac_dir/install-sh; then
1557     ac_aux_dir=$ac_dir
1558     ac_install_sh="$ac_aux_dir/install-sh -c"
1559     break
1560   elif test -f $ac_dir/install.sh; then
1561     ac_aux_dir=$ac_dir
1562     ac_install_sh="$ac_aux_dir/install.sh -c"
1563     break
1564   fi
1565 done
1566 if test -z "$ac_aux_dir"; then
1567   { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../.." 1>&2; exit 1; }
1568 fi
1569 ac_config_guess=$ac_aux_dir/config.guess
1570 ac_config_sub=$ac_aux_dir/config.sub
1571 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
1572
1573
1574 # Do some error checking and defaulting for the host and target type.
1575 # The inputs are:
1576 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
1577 #
1578 # The rules are:
1579 # 1. You are not allowed to specify --host, --target, and nonopt at the
1580 #    same time.
1581 # 2. Host defaults to nonopt.
1582 # 3. If nonopt is not specified, then host defaults to the current host,
1583 #    as determined by config.guess.
1584 # 4. Target and build default to nonopt.
1585 # 5. If nonopt is not specified, then target and build default to host.
1586
1587 # The aliases save the names the user supplied, while $host etc.
1588 # will get canonicalized.
1589 case $host---$target---$nonopt in
1590 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1591 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1592 esac
1593
1594
1595 # Make sure we can run config.sub.
1596 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1597 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1598 fi
1599
1600 echo $ac_n "checking host system type""... $ac_c" 1>&6
1601 echo "configure:1602: checking host system type" >&5
1602
1603 host_alias=$host
1604 case "$host_alias" in
1605 NONE)
1606   case $nonopt in
1607   NONE)
1608     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1609     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1610     fi ;;
1611   *) host_alias=$nonopt ;;
1612   esac ;;
1613 esac
1614
1615 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1616 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1617 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1618 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1619 echo "$ac_t""$host" 1>&6
1620
1621 echo $ac_n "checking target system type""... $ac_c" 1>&6
1622 echo "configure:1623: checking target system type" >&5
1623
1624 target_alias=$target
1625 case "$target_alias" in
1626 NONE)
1627   case $nonopt in
1628   NONE) target_alias=$host_alias ;;
1629   *) target_alias=$nonopt ;;
1630   esac ;;
1631 esac
1632
1633 target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
1634 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1635 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1636 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1637 echo "$ac_t""$target" 1>&6
1638
1639 echo $ac_n "checking build system type""... $ac_c" 1>&6
1640 echo "configure:1641: checking build system type" >&5
1641
1642 build_alias=$build
1643 case "$build_alias" in
1644 NONE)
1645   case $nonopt in
1646   NONE) build_alias=$host_alias ;;
1647   *) build_alias=$nonopt ;;
1648   esac ;;
1649 esac
1650
1651 build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
1652 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1653 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1654 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1655 echo "$ac_t""$build" 1>&6
1656
1657 test "$host_alias" != "$target_alias" &&
1658   test "$program_prefix$program_suffix$program_transform_name" = \
1659     NONENONEs,x,x, &&
1660   program_prefix=${target_alias}-
1661
1662 if test "$program_transform_name" = s,x,x,; then
1663   program_transform_name=
1664 else
1665   # Double any \ or $.  echo might interpret backslashes.
1666   cat <<\EOF_SED > conftestsed
1667 s,\\,\\\\,g; s,\$,$$,g
1668 EOF_SED
1669   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1670   rm -f conftestsed
1671 fi
1672 test "$program_prefix" != NONE &&
1673   program_transform_name="s,^,${program_prefix},; $program_transform_name"
1674 # Use a double $ so make ignores it.
1675 test "$program_suffix" != NONE &&
1676   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
1677
1678 # sed with no file args requires a program.
1679 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1680
1681 # Extract the first word of "gcc", so it can be a program name with args.
1682 set dummy gcc; ac_word=$2
1683 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1684 echo "configure:1685: checking for $ac_word" >&5
1685 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1686   echo $ac_n "(cached) $ac_c" 1>&6
1687 else
1688   if test -n "$CC"; then
1689   ac_cv_prog_CC="$CC" # Let the user override the test.
1690 else
1691   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1692   for ac_dir in $PATH; do
1693     test -z "$ac_dir" && ac_dir=.
1694     if test -f $ac_dir/$ac_word; then
1695       ac_cv_prog_CC="gcc"
1696       break
1697     fi
1698   done
1699   IFS="$ac_save_ifs"
1700 fi
1701 fi
1702 CC="$ac_cv_prog_CC"
1703 if test -n "$CC"; then
1704   echo "$ac_t""$CC" 1>&6
1705 else
1706   echo "$ac_t""no" 1>&6
1707 fi
1708
1709 if test -z "$CC"; then
1710   # Extract the first word of "cc", so it can be a program name with args.
1711 set dummy cc; ac_word=$2
1712 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1713 echo "configure:1714: checking for $ac_word" >&5
1714 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1715   echo $ac_n "(cached) $ac_c" 1>&6
1716 else
1717   if test -n "$CC"; then
1718   ac_cv_prog_CC="$CC" # Let the user override the test.
1719 else
1720   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1721   ac_prog_rejected=no
1722   for ac_dir in $PATH; do
1723     test -z "$ac_dir" && ac_dir=.
1724     if test -f $ac_dir/$ac_word; then
1725       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1726         ac_prog_rejected=yes
1727         continue
1728       fi
1729       ac_cv_prog_CC="cc"
1730       break
1731     fi
1732   done
1733   IFS="$ac_save_ifs"
1734 if test $ac_prog_rejected = yes; then
1735   # We found a bogon in the path, so make sure we never use it.
1736   set dummy $ac_cv_prog_CC
1737   shift
1738   if test $# -gt 0; then
1739     # We chose a different compiler from the bogus one.
1740     # However, it has the same basename, so the bogon will be chosen
1741     # first if we set CC to just the basename; use the full file name.
1742     shift
1743     set dummy "$ac_dir/$ac_word" "$@"
1744     shift
1745     ac_cv_prog_CC="$@"
1746   fi
1747 fi
1748 fi
1749 fi
1750 CC="$ac_cv_prog_CC"
1751 if test -n "$CC"; then
1752   echo "$ac_t""$CC" 1>&6
1753 else
1754   echo "$ac_t""no" 1>&6
1755 fi
1756
1757   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1758 fi
1759
1760 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1761 echo "configure:1762: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1762
1763 ac_ext=c
1764 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1765 ac_cpp='$CPP $CPPFLAGS'
1766 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1767 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1768 cross_compiling=$ac_cv_prog_cc_cross
1769
1770 cat > conftest.$ac_ext <<EOF
1771 #line 1772 "configure"
1772 #include "confdefs.h"
1773 main(){return(0);}
1774 EOF
1775 if { (eval echo configure:1776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1776   ac_cv_prog_cc_works=yes
1777   # If we can't run a trivial program, we are probably using a cross compiler.
1778   if (./conftest; exit) 2>/dev/null; then
1779     ac_cv_prog_cc_cross=no
1780   else
1781     ac_cv_prog_cc_cross=yes
1782   fi
1783 else
1784   echo "configure: failed program was:" >&5
1785   cat conftest.$ac_ext >&5
1786   ac_cv_prog_cc_works=no
1787 fi
1788 rm -fr conftest*
1789
1790 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1791 if test $ac_cv_prog_cc_works = no; then
1792   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1793 fi
1794 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1795 echo "configure:1796: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1796 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1797 cross_compiling=$ac_cv_prog_cc_cross
1798
1799 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1800 echo "configure:1801: checking whether we are using GNU C" >&5
1801 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1802   echo $ac_n "(cached) $ac_c" 1>&6
1803 else
1804   cat > conftest.c <<EOF
1805 #ifdef __GNUC__
1806   yes;
1807 #endif
1808 EOF
1809 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1810   ac_cv_prog_gcc=yes
1811 else
1812   ac_cv_prog_gcc=no
1813 fi
1814 fi
1815
1816 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1817
1818 if test $ac_cv_prog_gcc = yes; then
1819   GCC=yes
1820   ac_test_CFLAGS="${CFLAGS+set}"
1821   ac_save_CFLAGS="$CFLAGS"
1822   CFLAGS=
1823   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1824 echo "configure:1825: checking whether ${CC-cc} accepts -g" >&5
1825 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1826   echo $ac_n "(cached) $ac_c" 1>&6
1827 else
1828   echo 'void f(){}' > conftest.c
1829 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1830   ac_cv_prog_cc_g=yes
1831 else
1832   ac_cv_prog_cc_g=no
1833 fi
1834 rm -f conftest*
1835
1836 fi
1837
1838 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1839   if test "$ac_test_CFLAGS" = set; then
1840     CFLAGS="$ac_save_CFLAGS"
1841   elif test $ac_cv_prog_cc_g = yes; then
1842     CFLAGS="-g -O2"
1843   else
1844     CFLAGS="-O2"
1845   fi
1846 else
1847   GCC=
1848   test "${CFLAGS+set}" = set || CFLAGS="-g"
1849 fi
1850
1851 # Find a good install program.  We prefer a C program (faster),
1852 # so one script is as good as another.  But avoid the broken or
1853 # incompatible versions:
1854 # SysV /etc/install, /usr/sbin/install
1855 # SunOS /usr/etc/install
1856 # IRIX /sbin/install
1857 # AIX /bin/install
1858 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1859 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1860 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1861 # ./install, which can be erroneously created by make from ./install.sh.
1862 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1863 echo "configure:1864: checking for a BSD compatible install" >&5
1864 if test -z "$INSTALL"; then
1865 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1866   echo $ac_n "(cached) $ac_c" 1>&6
1867 else
1868     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
1869   for ac_dir in $PATH; do
1870     # Account for people who put trailing slashes in PATH elements.
1871     case "$ac_dir/" in
1872     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1873     *)
1874       # OSF1 and SCO ODT 3.0 have their own names for install.
1875       # Don't use installbsd from OSF since it installs stuff as root
1876       # by default.
1877       for ac_prog in ginstall scoinst install; do
1878         if test -f $ac_dir/$ac_prog; then
1879           if test $ac_prog = install &&
1880             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1881             # AIX install.  It has an incompatible calling convention.
1882             :
1883           else
1884             ac_cv_path_install="$ac_dir/$ac_prog -c"
1885             break 2
1886           fi
1887         fi
1888       done
1889       ;;
1890     esac
1891   done
1892   IFS="$ac_save_IFS"
1893
1894 fi
1895   if test "${ac_cv_path_install+set}" = set; then
1896     INSTALL="$ac_cv_path_install"
1897   else
1898     # As a last resort, use the slow shell script.  We don't cache a
1899     # path for INSTALL within a source directory, because that will
1900     # break other packages using the cache if that directory is
1901     # removed, or if the path is relative.
1902     INSTALL="$ac_install_sh"
1903   fi
1904 fi
1905 echo "$ac_t""$INSTALL" 1>&6
1906
1907 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1908 # It thinks the first close brace ends the variable substitution.
1909 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1910
1911 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1912
1913
1914 # Put a plausible default for CC_FOR_BUILD in Makefile.
1915 if test "x$cross_compiling" = "xno"; then
1916   CC_FOR_BUILD='$(CC)'
1917 else
1918   CC_FOR_BUILD=gcc
1919 fi
1920
1921
1922
1923
1924 AR=${AR-ar}
1925
1926 # Extract the first word of "ranlib", so it can be a program name with args.
1927 set dummy ranlib; ac_word=$2
1928 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1929 echo "configure:1930: checking for $ac_word" >&5
1930 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1931   echo $ac_n "(cached) $ac_c" 1>&6
1932 else
1933   if test -n "$RANLIB"; then
1934   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1935 else
1936   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1937   for ac_dir in $PATH; do
1938     test -z "$ac_dir" && ac_dir=.
1939     if test -f $ac_dir/$ac_word; then
1940       ac_cv_prog_RANLIB="ranlib"
1941       break
1942     fi
1943   done
1944   IFS="$ac_save_ifs"
1945   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1946 fi
1947 fi
1948 RANLIB="$ac_cv_prog_RANLIB"
1949 if test -n "$RANLIB"; then
1950   echo "$ac_t""$RANLIB" 1>&6
1951 else
1952   echo "$ac_t""no" 1>&6
1953 fi
1954
1955
1956 ALL_LINGUAS=
1957                               
1958    for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
1959 unistd.h values.h sys/param.h
1960 do
1961 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1962 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1963 echo "configure:1964: checking for $ac_hdr" >&5
1964 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1965   echo $ac_n "(cached) $ac_c" 1>&6
1966 else
1967   cat > conftest.$ac_ext <<EOF
1968 #line 1969 "configure"
1969 #include "confdefs.h"
1970 #include <$ac_hdr>
1971 EOF
1972 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1973 { (eval echo configure:1974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1974 ac_err=`grep -v '^ *+' conftest.out`
1975 if test -z "$ac_err"; then
1976   rm -rf conftest*
1977   eval "ac_cv_header_$ac_safe=yes"
1978 else
1979   echo "$ac_err" >&5
1980   echo "configure: failed program was:" >&5
1981   cat conftest.$ac_ext >&5
1982   rm -rf conftest*
1983   eval "ac_cv_header_$ac_safe=no"
1984 fi
1985 rm -f conftest*
1986 fi
1987 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1988   echo "$ac_t""yes" 1>&6
1989     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1990   cat >> confdefs.h <<EOF
1991 #define $ac_tr_hdr 1
1992 EOF
1993  
1994 else
1995   echo "$ac_t""no" 1>&6
1996 fi
1997 done
1998
1999    for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
2000 __argz_count __argz_stringify __argz_next
2001 do
2002 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2003 echo "configure:2004: checking for $ac_func" >&5
2004 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2005   echo $ac_n "(cached) $ac_c" 1>&6
2006 else
2007   cat > conftest.$ac_ext <<EOF
2008 #line 2009 "configure"
2009 #include "confdefs.h"
2010 /* System header to define __stub macros and hopefully few prototypes,
2011     which can conflict with char $ac_func(); below.  */
2012 #include <assert.h>
2013 /* Override any gcc2 internal prototype to avoid an error.  */
2014 /* We use char because int might match the return type of a gcc2
2015     builtin and then its argument prototype would still apply.  */
2016 char $ac_func();
2017
2018 int main() {
2019
2020 /* The GNU C library defines this for functions which it implements
2021     to always fail with ENOSYS.  Some functions are actually named
2022     something starting with __ and the normal name is an alias.  */
2023 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2024 choke me
2025 #else
2026 $ac_func();
2027 #endif
2028
2029 ; return 0; }
2030 EOF
2031 if { (eval echo configure:2032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2032   rm -rf conftest*
2033   eval "ac_cv_func_$ac_func=yes"
2034 else
2035   echo "configure: failed program was:" >&5
2036   cat conftest.$ac_ext >&5
2037   rm -rf conftest*
2038   eval "ac_cv_func_$ac_func=no"
2039 fi
2040 rm -f conftest*
2041 fi
2042
2043 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2044   echo "$ac_t""yes" 1>&6
2045     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2046   cat >> confdefs.h <<EOF
2047 #define $ac_tr_func 1
2048 EOF
2049  
2050 else
2051   echo "$ac_t""no" 1>&6
2052 fi
2053 done
2054
2055
2056    if test "${ac_cv_func_stpcpy+set}" != "set"; then
2057      for ac_func in stpcpy
2058 do
2059 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2060 echo "configure:2061: checking for $ac_func" >&5
2061 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2062   echo $ac_n "(cached) $ac_c" 1>&6
2063 else
2064   cat > conftest.$ac_ext <<EOF
2065 #line 2066 "configure"
2066 #include "confdefs.h"
2067 /* System header to define __stub macros and hopefully few prototypes,
2068     which can conflict with char $ac_func(); below.  */
2069 #include <assert.h>
2070 /* Override any gcc2 internal prototype to avoid an error.  */
2071 /* We use char because int might match the return type of a gcc2
2072     builtin and then its argument prototype would still apply.  */
2073 char $ac_func();
2074
2075 int main() {
2076
2077 /* The GNU C library defines this for functions which it implements
2078     to always fail with ENOSYS.  Some functions are actually named
2079     something starting with __ and the normal name is an alias.  */
2080 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2081 choke me
2082 #else
2083 $ac_func();
2084 #endif
2085
2086 ; return 0; }
2087 EOF
2088 if { (eval echo configure:2089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2089   rm -rf conftest*
2090   eval "ac_cv_func_$ac_func=yes"
2091 else
2092   echo "configure: failed program was:" >&5
2093   cat conftest.$ac_ext >&5
2094   rm -rf conftest*
2095   eval "ac_cv_func_$ac_func=no"
2096 fi
2097 rm -f conftest*
2098 fi
2099
2100 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2101   echo "$ac_t""yes" 1>&6
2102     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2103   cat >> confdefs.h <<EOF
2104 #define $ac_tr_func 1
2105 EOF
2106  
2107 else
2108   echo "$ac_t""no" 1>&6
2109 fi
2110 done
2111
2112    fi
2113    if test "${ac_cv_func_stpcpy}" = "yes"; then
2114      cat >> confdefs.h <<\EOF
2115 #define HAVE_STPCPY 1
2116 EOF
2117
2118    fi
2119
2120    if test $ac_cv_header_locale_h = yes; then
2121     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
2122 echo "configure:2123: checking for LC_MESSAGES" >&5
2123 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
2124   echo $ac_n "(cached) $ac_c" 1>&6
2125 else
2126   cat > conftest.$ac_ext <<EOF
2127 #line 2128 "configure"
2128 #include "confdefs.h"
2129 #include <locale.h>
2130 int main() {
2131 return LC_MESSAGES
2132 ; return 0; }
2133 EOF
2134 if { (eval echo configure:2135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2135   rm -rf conftest*
2136   am_cv_val_LC_MESSAGES=yes
2137 else
2138   echo "configure: failed program was:" >&5
2139   cat conftest.$ac_ext >&5
2140   rm -rf conftest*
2141   am_cv_val_LC_MESSAGES=no
2142 fi
2143 rm -f conftest*
2144 fi
2145
2146 echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
2147     if test $am_cv_val_LC_MESSAGES = yes; then
2148       cat >> confdefs.h <<\EOF
2149 #define HAVE_LC_MESSAGES 1
2150 EOF
2151
2152     fi
2153   fi
2154    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
2155 echo "configure:2156: checking whether NLS is requested" >&5
2156         # Check whether --enable-nls or --disable-nls was given.
2157 if test "${enable_nls+set}" = set; then
2158   enableval="$enable_nls"
2159   USE_NLS=$enableval
2160 else
2161   USE_NLS=yes
2162 fi
2163
2164     echo "$ac_t""$USE_NLS" 1>&6
2165     
2166
2167     USE_INCLUDED_LIBINTL=no
2168
2169         if test "$USE_NLS" = "yes"; then
2170       cat >> confdefs.h <<\EOF
2171 #define ENABLE_NLS 1
2172 EOF
2173
2174       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
2175 echo "configure:2176: checking whether included gettext is requested" >&5
2176       # Check whether --with-included-gettext or --without-included-gettext was given.
2177 if test "${with_included_gettext+set}" = set; then
2178   withval="$with_included_gettext"
2179   nls_cv_force_use_gnu_gettext=$withval
2180 else
2181   nls_cv_force_use_gnu_gettext=no
2182 fi
2183
2184       echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
2185
2186       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
2187       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
2188                                         nls_cv_header_intl=
2189         nls_cv_header_libgt=
2190         CATOBJEXT=NONE
2191
2192         ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
2193 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
2194 echo "configure:2195: checking for libintl.h" >&5
2195 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2196   echo $ac_n "(cached) $ac_c" 1>&6
2197 else
2198   cat > conftest.$ac_ext <<EOF
2199 #line 2200 "configure"
2200 #include "confdefs.h"
2201 #include <libintl.h>
2202 EOF
2203 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2204 { (eval echo configure:2205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2205 ac_err=`grep -v '^ *+' conftest.out`
2206 if test -z "$ac_err"; then
2207   rm -rf conftest*
2208   eval "ac_cv_header_$ac_safe=yes"
2209 else
2210   echo "$ac_err" >&5
2211   echo "configure: failed program was:" >&5
2212   cat conftest.$ac_ext >&5
2213   rm -rf conftest*
2214   eval "ac_cv_header_$ac_safe=no"
2215 fi
2216 rm -f conftest*
2217 fi
2218 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2219   echo "$ac_t""yes" 1>&6
2220   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
2221 echo "configure:2222: checking for gettext in libc" >&5
2222 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
2223   echo $ac_n "(cached) $ac_c" 1>&6
2224 else
2225   cat > conftest.$ac_ext <<EOF
2226 #line 2227 "configure"
2227 #include "confdefs.h"
2228 #include <libintl.h>
2229 int main() {
2230 return (int) gettext ("")
2231 ; return 0; }
2232 EOF
2233 if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2234   rm -rf conftest*
2235   gt_cv_func_gettext_libc=yes
2236 else
2237   echo "configure: failed program was:" >&5
2238   cat conftest.$ac_ext >&5
2239   rm -rf conftest*
2240   gt_cv_func_gettext_libc=no
2241 fi
2242 rm -f conftest*
2243 fi
2244
2245 echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
2246
2247            if test "$gt_cv_func_gettext_libc" != "yes"; then
2248              echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
2249 echo "configure:2250: checking for bindtextdomain in -lintl" >&5
2250 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
2251 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2252   echo $ac_n "(cached) $ac_c" 1>&6
2253 else
2254   ac_save_LIBS="$LIBS"
2255 LIBS="-lintl  $LIBS"
2256 cat > conftest.$ac_ext <<EOF
2257 #line 2258 "configure"
2258 #include "confdefs.h"
2259 /* Override any gcc2 internal prototype to avoid an error.  */
2260 /* We use char because int might match the return type of a gcc2
2261     builtin and then its argument prototype would still apply.  */
2262 char bindtextdomain();
2263
2264 int main() {
2265 bindtextdomain()
2266 ; return 0; }
2267 EOF
2268 if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2269   rm -rf conftest*
2270   eval "ac_cv_lib_$ac_lib_var=yes"
2271 else
2272   echo "configure: failed program was:" >&5
2273   cat conftest.$ac_ext >&5
2274   rm -rf conftest*
2275   eval "ac_cv_lib_$ac_lib_var=no"
2276 fi
2277 rm -f conftest*
2278 LIBS="$ac_save_LIBS"
2279
2280 fi
2281 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2282   echo "$ac_t""yes" 1>&6
2283   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
2284 echo "configure:2285: checking for gettext in libintl" >&5
2285 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
2286   echo $ac_n "(cached) $ac_c" 1>&6
2287 else
2288   cat > conftest.$ac_ext <<EOF
2289 #line 2290 "configure"
2290 #include "confdefs.h"
2291
2292 int main() {
2293 return (int) gettext ("")
2294 ; return 0; }
2295 EOF
2296 if { (eval echo configure:2297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2297   rm -rf conftest*
2298   gt_cv_func_gettext_libintl=yes
2299 else
2300   echo "configure: failed program was:" >&5
2301   cat conftest.$ac_ext >&5
2302   rm -rf conftest*
2303   gt_cv_func_gettext_libintl=no
2304 fi
2305 rm -f conftest*
2306 fi
2307
2308 echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
2309 else
2310   echo "$ac_t""no" 1>&6
2311 fi
2312
2313            fi
2314
2315            if test "$gt_cv_func_gettext_libc" = "yes" \
2316               || test "$gt_cv_func_gettext_libintl" = "yes"; then
2317               cat >> confdefs.h <<\EOF
2318 #define HAVE_GETTEXT 1
2319 EOF
2320
2321               # Extract the first word of "msgfmt", so it can be a program name with args.
2322 set dummy msgfmt; ac_word=$2
2323 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2324 echo "configure:2325: checking for $ac_word" >&5
2325 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
2326   echo $ac_n "(cached) $ac_c" 1>&6
2327 else
2328   case "$MSGFMT" in
2329   /*)
2330   ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
2331   ;;
2332   *)
2333   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2334   for ac_dir in $PATH; do
2335     test -z "$ac_dir" && ac_dir=.
2336     if test -f $ac_dir/$ac_word; then
2337       if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
2338         ac_cv_path_MSGFMT="$ac_dir/$ac_word"
2339         break
2340       fi
2341     fi
2342   done
2343   IFS="$ac_save_ifs"
2344   test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
2345   ;;
2346 esac
2347 fi
2348 MSGFMT="$ac_cv_path_MSGFMT"
2349 if test -n "$MSGFMT"; then
2350   echo "$ac_t""$MSGFMT" 1>&6
2351 else
2352   echo "$ac_t""no" 1>&6
2353 fi
2354               if test "$MSGFMT" != "no"; then
2355                 for ac_func in dcgettext
2356 do
2357 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2358 echo "configure:2359: checking for $ac_func" >&5
2359 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2360   echo $ac_n "(cached) $ac_c" 1>&6
2361 else
2362   cat > conftest.$ac_ext <<EOF
2363 #line 2364 "configure"
2364 #include "confdefs.h"
2365 /* System header to define __stub macros and hopefully few prototypes,
2366     which can conflict with char $ac_func(); below.  */
2367 #include <assert.h>
2368 /* Override any gcc2 internal prototype to avoid an error.  */
2369 /* We use char because int might match the return type of a gcc2
2370     builtin and then its argument prototype would still apply.  */
2371 char $ac_func();
2372
2373 int main() {
2374
2375 /* The GNU C library defines this for functions which it implements
2376     to always fail with ENOSYS.  Some functions are actually named
2377     something starting with __ and the normal name is an alias.  */
2378 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2379 choke me
2380 #else
2381 $ac_func();
2382 #endif
2383
2384 ; return 0; }
2385 EOF
2386 if { (eval echo configure:2387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2387   rm -rf conftest*
2388   eval "ac_cv_func_$ac_func=yes"
2389 else
2390   echo "configure: failed program was:" >&5
2391   cat conftest.$ac_ext >&5
2392   rm -rf conftest*
2393   eval "ac_cv_func_$ac_func=no"
2394 fi
2395 rm -f conftest*
2396 fi
2397
2398 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2399   echo "$ac_t""yes" 1>&6
2400     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2401   cat >> confdefs.h <<EOF
2402 #define $ac_tr_func 1
2403 EOF
2404  
2405 else
2406   echo "$ac_t""no" 1>&6
2407 fi
2408 done
2409
2410                 # Extract the first word of "gmsgfmt", so it can be a program name with args.
2411 set dummy gmsgfmt; ac_word=$2
2412 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2413 echo "configure:2414: checking for $ac_word" >&5
2414 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
2415   echo $ac_n "(cached) $ac_c" 1>&6
2416 else
2417   case "$GMSGFMT" in
2418   /*)
2419   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
2420   ;;
2421   ?:/*)                  
2422   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
2423   ;;
2424   *)
2425   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2426   for ac_dir in $PATH; do
2427     test -z "$ac_dir" && ac_dir=.
2428     if test -f $ac_dir/$ac_word; then
2429       ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
2430       break
2431     fi
2432   done
2433   IFS="$ac_save_ifs"
2434   test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
2435   ;;
2436 esac
2437 fi
2438 GMSGFMT="$ac_cv_path_GMSGFMT"
2439 if test -n "$GMSGFMT"; then
2440   echo "$ac_t""$GMSGFMT" 1>&6
2441 else
2442   echo "$ac_t""no" 1>&6
2443 fi
2444
2445                 # Extract the first word of "xgettext", so it can be a program name with args.
2446 set dummy xgettext; ac_word=$2
2447 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2448 echo "configure:2449: checking for $ac_word" >&5
2449 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
2450   echo $ac_n "(cached) $ac_c" 1>&6
2451 else
2452   case "$XGETTEXT" in
2453   /*)
2454   ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
2455   ;;
2456   *)
2457   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2458   for ac_dir in $PATH; do
2459     test -z "$ac_dir" && ac_dir=.
2460     if test -f $ac_dir/$ac_word; then
2461       if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
2462         ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
2463         break
2464       fi
2465     fi
2466   done
2467   IFS="$ac_save_ifs"
2468   test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
2469   ;;
2470 esac
2471 fi
2472 XGETTEXT="$ac_cv_path_XGETTEXT"
2473 if test -n "$XGETTEXT"; then
2474   echo "$ac_t""$XGETTEXT" 1>&6
2475 else
2476   echo "$ac_t""no" 1>&6
2477 fi
2478
2479                 cat > conftest.$ac_ext <<EOF
2480 #line 2481 "configure"
2481 #include "confdefs.h"
2482
2483 int main() {
2484 extern int _nl_msg_cat_cntr;
2485                                return _nl_msg_cat_cntr
2486 ; return 0; }
2487 EOF
2488 if { (eval echo configure:2489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2489   rm -rf conftest*
2490   CATOBJEXT=.gmo
2491                    DATADIRNAME=share
2492 else
2493   echo "configure: failed program was:" >&5
2494   cat conftest.$ac_ext >&5
2495   rm -rf conftest*
2496   CATOBJEXT=.mo
2497                    DATADIRNAME=lib
2498 fi
2499 rm -f conftest*
2500                 INSTOBJEXT=.mo
2501               fi
2502             fi
2503         
2504 else
2505   echo "$ac_t""no" 1>&6
2506 fi
2507
2508
2509                 
2510         if test "$CATOBJEXT" = "NONE"; then
2511                           nls_cv_use_gnu_gettext=yes
2512         fi
2513       fi
2514
2515       if test "$nls_cv_use_gnu_gettext" = "yes"; then
2516                 INTLOBJS="\$(GETTOBJS)"
2517         # Extract the first word of "msgfmt", so it can be a program name with args.
2518 set dummy msgfmt; ac_word=$2
2519 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2520 echo "configure:2521: checking for $ac_word" >&5
2521 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
2522   echo $ac_n "(cached) $ac_c" 1>&6
2523 else
2524   case "$MSGFMT" in
2525   /*)
2526   ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
2527   ;;
2528   *)
2529   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2530   for ac_dir in $PATH; do
2531     test -z "$ac_dir" && ac_dir=.
2532     if test -f $ac_dir/$ac_word; then
2533       if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
2534         ac_cv_path_MSGFMT="$ac_dir/$ac_word"
2535         break
2536       fi
2537     fi
2538   done
2539   IFS="$ac_save_ifs"
2540   test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt"
2541   ;;
2542 esac
2543 fi
2544 MSGFMT="$ac_cv_path_MSGFMT"
2545 if test -n "$MSGFMT"; then
2546   echo "$ac_t""$MSGFMT" 1>&6
2547 else
2548   echo "$ac_t""no" 1>&6
2549 fi
2550
2551         # Extract the first word of "gmsgfmt", so it can be a program name with args.
2552 set dummy gmsgfmt; ac_word=$2
2553 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2554 echo "configure:2555: checking for $ac_word" >&5
2555 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
2556   echo $ac_n "(cached) $ac_c" 1>&6
2557 else
2558   case "$GMSGFMT" in
2559   /*)
2560   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
2561   ;;
2562   ?:/*)                  
2563   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
2564   ;;
2565   *)
2566   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2567   for ac_dir in $PATH; do
2568     test -z "$ac_dir" && ac_dir=.
2569     if test -f $ac_dir/$ac_word; then
2570       ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
2571       break
2572     fi
2573   done
2574   IFS="$ac_save_ifs"
2575   test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
2576   ;;
2577 esac
2578 fi
2579 GMSGFMT="$ac_cv_path_GMSGFMT"
2580 if test -n "$GMSGFMT"; then
2581   echo "$ac_t""$GMSGFMT" 1>&6
2582 else
2583   echo "$ac_t""no" 1>&6
2584 fi
2585
2586         # Extract the first word of "xgettext", so it can be a program name with args.
2587 set dummy xgettext; ac_word=$2
2588 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2589 echo "configure:2590: checking for $ac_word" >&5
2590 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
2591   echo $ac_n "(cached) $ac_c" 1>&6
2592 else
2593   case "$XGETTEXT" in
2594   /*)
2595   ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
2596   ;;
2597   *)
2598   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2599   for ac_dir in $PATH; do
2600     test -z "$ac_dir" && ac_dir=.
2601     if test -f $ac_dir/$ac_word; then
2602       if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
2603         ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
2604         break
2605       fi
2606     fi
2607   done
2608   IFS="$ac_save_ifs"
2609   test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
2610   ;;
2611 esac
2612 fi
2613 XGETTEXT="$ac_cv_path_XGETTEXT"
2614 if test -n "$XGETTEXT"; then
2615   echo "$ac_t""$XGETTEXT" 1>&6
2616 else
2617   echo "$ac_t""no" 1>&6
2618 fi
2619
2620         
2621         USE_INCLUDED_LIBINTL=yes
2622         CATOBJEXT=.gmo
2623         INSTOBJEXT=.mo
2624         DATADIRNAME=share
2625         INTLDEPS='$(top_builddir)/../intl/libintl.a'
2626         INTLLIBS=$INTLDEPS
2627         LIBS=`echo $LIBS | sed -e 's/-lintl//'`
2628         nls_cv_header_intl=libintl.h
2629         nls_cv_header_libgt=libgettext.h
2630       fi
2631
2632             if test "$XGETTEXT" != ":"; then
2633                         if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2634           : ;
2635         else
2636           echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
2637           XGETTEXT=":"
2638         fi
2639       fi
2640
2641       # We need to process the po/ directory.
2642       POSUB=po
2643     else
2644       DATADIRNAME=share
2645       nls_cv_header_intl=libintl.h
2646       nls_cv_header_libgt=libgettext.h
2647     fi
2648
2649     # If this is used in GNU gettext we have to set USE_NLS to `yes'
2650     # because some of the sources are only built for this goal.
2651     if test "$PACKAGE" = gettext; then
2652       USE_NLS=yes
2653       USE_INCLUDED_LIBINTL=yes
2654     fi
2655
2656                 for lang in $ALL_LINGUAS; do
2657       GMOFILES="$GMOFILES $lang.gmo"
2658       POFILES="$POFILES $lang.po"
2659     done
2660
2661         
2662     
2663     
2664     
2665     
2666     
2667     
2668     
2669     
2670     
2671     
2672   
2673
2674    if test "x$CATOBJEXT" != "x"; then
2675      if test "x$ALL_LINGUAS" = "x"; then
2676        LINGUAS=
2677      else
2678        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
2679 echo "configure:2680: checking for catalogs to be installed" >&5
2680        NEW_LINGUAS=
2681        for lang in ${LINGUAS=$ALL_LINGUAS}; do
2682          case "$ALL_LINGUAS" in
2683           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
2684          esac
2685        done
2686        LINGUAS=$NEW_LINGUAS
2687        echo "$ac_t""$LINGUAS" 1>&6
2688      fi
2689
2690           if test -n "$LINGUAS"; then
2691        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2692      fi
2693    fi
2694
2695             if test $ac_cv_header_locale_h = yes; then
2696      INCLUDE_LOCALE_H="#include <locale.h>"
2697    else
2698      INCLUDE_LOCALE_H="\
2699 /* The system does not provide the header <locale.h>.  Take care yourself.  */"
2700    fi
2701    
2702
2703             if test -f $srcdir/po2tbl.sed.in; then
2704       if test "$CATOBJEXT" = ".cat"; then
2705          ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
2706 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
2707 echo "configure:2708: checking for linux/version.h" >&5
2708 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2709   echo $ac_n "(cached) $ac_c" 1>&6
2710 else
2711   cat > conftest.$ac_ext <<EOF
2712 #line 2713 "configure"
2713 #include "confdefs.h"
2714 #include <linux/version.h>
2715 EOF
2716 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2717 { (eval echo configure:2718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2718 ac_err=`grep -v '^ *+' conftest.out`
2719 if test -z "$ac_err"; then
2720   rm -rf conftest*
2721   eval "ac_cv_header_$ac_safe=yes"
2722 else
2723   echo "$ac_err" >&5
2724   echo "configure: failed program was:" >&5
2725   cat conftest.$ac_ext >&5
2726   rm -rf conftest*
2727   eval "ac_cv_header_$ac_safe=no"
2728 fi
2729 rm -f conftest*
2730 fi
2731 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2732   echo "$ac_t""yes" 1>&6
2733   msgformat=linux
2734 else
2735   echo "$ac_t""no" 1>&6
2736 msgformat=xopen
2737 fi
2738
2739
2740                          sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
2741       fi
2742             sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
2743          $srcdir/po2tbl.sed.in > po2tbl.sed
2744    fi
2745
2746             if test "$PACKAGE" = "gettext"; then
2747      GT_NO="#NO#"
2748      GT_YES=
2749    else
2750      GT_NO=
2751      GT_YES="#YES#"
2752    fi
2753    
2754    
2755
2756    MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
2757    
2758
2759       l=
2760    
2761
2762             if test -d $srcdir/po; then
2763       test -d po || mkdir po
2764       if test "x$srcdir" != "x."; then
2765          if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
2766             posrcprefix="$srcdir/"
2767          else
2768             posrcprefix="../$srcdir/"
2769          fi
2770       else
2771          posrcprefix="../"
2772       fi
2773       rm -f po/POTFILES
2774       sed -e "/^#/d" -e "/^\$/d" -e "s,.*,      $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
2775          < $srcdir/po/POTFILES.in > po/POTFILES
2776    fi
2777   
2778
2779 # Check for common headers.
2780 # FIXME: Seems to me this can cause problems for i386-windows hosts.
2781 # At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*.
2782 for ac_hdr in stdlib.h string.h strings.h unistd.h time.h
2783 do
2784 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2785 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2786 echo "configure:2787: checking for $ac_hdr" >&5
2787 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2788   echo $ac_n "(cached) $ac_c" 1>&6
2789 else
2790   cat > conftest.$ac_ext <<EOF
2791 #line 2792 "configure"
2792 #include "confdefs.h"
2793 #include <$ac_hdr>
2794 EOF
2795 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2796 { (eval echo configure:2797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2797 ac_err=`grep -v '^ *+' conftest.out`
2798 if test -z "$ac_err"; then
2799   rm -rf conftest*
2800   eval "ac_cv_header_$ac_safe=yes"
2801 else
2802   echo "$ac_err" >&5
2803   echo "configure: failed program was:" >&5
2804   cat conftest.$ac_ext >&5
2805   rm -rf conftest*
2806   eval "ac_cv_header_$ac_safe=no"
2807 fi
2808 rm -f conftest*
2809 fi
2810 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2811   echo "$ac_t""yes" 1>&6
2812     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2813   cat >> confdefs.h <<EOF
2814 #define $ac_tr_hdr 1
2815 EOF
2816  
2817 else
2818   echo "$ac_t""no" 1>&6
2819 fi
2820 done
2821
2822 for ac_hdr in sys/time.h sys/resource.h
2823 do
2824 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2825 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2826 echo "configure:2827: checking for $ac_hdr" >&5
2827 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2828   echo $ac_n "(cached) $ac_c" 1>&6
2829 else
2830   cat > conftest.$ac_ext <<EOF
2831 #line 2832 "configure"
2832 #include "confdefs.h"
2833 #include <$ac_hdr>
2834 EOF
2835 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2836 { (eval echo configure:2837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2837 ac_err=`grep -v '^ *+' conftest.out`
2838 if test -z "$ac_err"; then
2839   rm -rf conftest*
2840   eval "ac_cv_header_$ac_safe=yes"
2841 else
2842   echo "$ac_err" >&5
2843   echo "configure: failed program was:" >&5
2844   cat conftest.$ac_ext >&5
2845   rm -rf conftest*
2846   eval "ac_cv_header_$ac_safe=no"
2847 fi
2848 rm -f conftest*
2849 fi
2850 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2851   echo "$ac_t""yes" 1>&6
2852     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2853   cat >> confdefs.h <<EOF
2854 #define $ac_tr_hdr 1
2855 EOF
2856  
2857 else
2858   echo "$ac_t""no" 1>&6
2859 fi
2860 done
2861
2862 for ac_hdr in fcntl.h fpu_control.h
2863 do
2864 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2865 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2866 echo "configure:2867: checking for $ac_hdr" >&5
2867 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2868   echo $ac_n "(cached) $ac_c" 1>&6
2869 else
2870   cat > conftest.$ac_ext <<EOF
2871 #line 2872 "configure"
2872 #include "confdefs.h"
2873 #include <$ac_hdr>
2874 EOF
2875 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2876 { (eval echo configure:2877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2877 ac_err=`grep -v '^ *+' conftest.out`
2878 if test -z "$ac_err"; then
2879   rm -rf conftest*
2880   eval "ac_cv_header_$ac_safe=yes"
2881 else
2882   echo "$ac_err" >&5
2883   echo "configure: failed program was:" >&5
2884   cat conftest.$ac_ext >&5
2885   rm -rf conftest*
2886   eval "ac_cv_header_$ac_safe=no"
2887 fi
2888 rm -f conftest*
2889 fi
2890 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2891   echo "$ac_t""yes" 1>&6
2892     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2893   cat >> confdefs.h <<EOF
2894 #define $ac_tr_hdr 1
2895 EOF
2896  
2897 else
2898   echo "$ac_t""no" 1>&6
2899 fi
2900 done
2901
2902 for ac_func in getrusage time sigaction __setfpucw
2903 do
2904 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2905 echo "configure:2906: checking for $ac_func" >&5
2906 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2907   echo $ac_n "(cached) $ac_c" 1>&6
2908 else
2909   cat > conftest.$ac_ext <<EOF
2910 #line 2911 "configure"
2911 #include "confdefs.h"
2912 /* System header to define __stub macros and hopefully few prototypes,
2913     which can conflict with char $ac_func(); below.  */
2914 #include <assert.h>
2915 /* Override any gcc2 internal prototype to avoid an error.  */
2916 /* We use char because int might match the return type of a gcc2
2917     builtin and then its argument prototype would still apply.  */
2918 char $ac_func();
2919
2920 int main() {
2921
2922 /* The GNU C library defines this for functions which it implements
2923     to always fail with ENOSYS.  Some functions are actually named
2924     something starting with __ and the normal name is an alias.  */
2925 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2926 choke me
2927 #else
2928 $ac_func();
2929 #endif
2930
2931 ; return 0; }
2932 EOF
2933 if { (eval echo configure:2934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2934   rm -rf conftest*
2935   eval "ac_cv_func_$ac_func=yes"
2936 else
2937   echo "configure: failed program was:" >&5
2938   cat conftest.$ac_ext >&5
2939   rm -rf conftest*
2940   eval "ac_cv_func_$ac_func=no"
2941 fi
2942 rm -f conftest*
2943 fi
2944
2945 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2946   echo "$ac_t""yes" 1>&6
2947     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2948   cat >> confdefs.h <<EOF
2949 #define $ac_tr_func 1
2950 EOF
2951  
2952 else
2953   echo "$ac_t""no" 1>&6
2954 fi
2955 done
2956
2957
2958 . ${srcdir}/../../bfd/configure.host
2959
2960
2961
2962 USE_MAINTAINER_MODE=no
2963 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
2964 if test "${enable_maintainer_mode+set}" = set; then
2965   enableval="$enable_maintainer_mode"
2966   case "${enableval}" in
2967   yes)  MAINT="" USE_MAINTAINER_MODE=yes ;;
2968   no)   MAINT="#" ;;
2969   *)    { echo "configure: error: "--enable-maintainer-mode does not take a value"" 1>&2; exit 1; }; MAINT="#" ;;
2970 esac
2971 if test x"$silent" != x"yes" && test x"$MAINT" = x""; then
2972   echo "Setting maintainer mode" 6>&1
2973 fi
2974 else
2975   MAINT="#"
2976 fi
2977
2978
2979
2980 # Check whether --enable-sim-bswap or --disable-sim-bswap was given.
2981 if test "${enable_sim_bswap+set}" = set; then
2982   enableval="$enable_sim_bswap"
2983   case "${enableval}" in
2984   yes)  sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";;
2985   no)   sim_bswap="-DWITH_BSWAP=0";;
2986   *)    { echo "configure: error: "--enable-sim-bswap does not take a value"" 1>&2; exit 1; }; sim_bswap="";;
2987 esac
2988 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
2989   echo "Setting bswap flags = $sim_bswap" 6>&1
2990 fi
2991 else
2992   sim_bswap=""
2993 fi
2994
2995
2996
2997 # Check whether --enable-sim-cflags or --disable-sim-cflags was given.
2998 if test "${enable_sim_cflags+set}" = set; then
2999   enableval="$enable_sim_cflags"
3000   case "${enableval}" in
3001   yes)   sim_cflags="-O2 -fomit-frame-pointer";;
3002   trace) { echo "configure: error: "Please use --enable-sim-debug instead."" 1>&2; exit 1; }; sim_cflags="";;
3003   no)    sim_cflags="";;
3004   *)     sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
3005 esac
3006 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
3007   echo "Setting sim cflags = $sim_cflags" 6>&1
3008 fi
3009 else
3010   sim_cflags=""
3011 fi
3012
3013
3014
3015 # Check whether --enable-sim-debug or --disable-sim-debug was given.
3016 if test "${enable_sim_debug+set}" = set; then
3017   enableval="$enable_sim_debug"
3018   case "${enableval}" in
3019   yes) sim_debug="-DDEBUG=7 -DWITH_DEBUG=7";;
3020   no)  sim_debug="-DDEBUG=0 -DWITH_DEBUG=0";;
3021   *)   sim_debug="-DDEBUG='(${enableval})' -DWITH_DEBUG='(${enableval})'";;
3022 esac
3023 if test x"$silent" != x"yes" && test x"$sim_debug" != x""; then
3024   echo "Setting sim debug = $sim_debug" 6>&1
3025 fi
3026 else
3027   sim_debug=""
3028 fi
3029
3030
3031
3032 # Check whether --enable-sim-stdio or --disable-sim-stdio was given.
3033 if test "${enable_sim_stdio+set}" = set; then
3034   enableval="$enable_sim_stdio"
3035   case "${enableval}" in
3036   yes)  sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
3037   no)   sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
3038   *)    { echo "configure: error: "Unknown value $enableval passed to --enable-sim-stdio"" 1>&2; exit 1; }; sim_stdio="";;
3039 esac
3040 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
3041   echo "Setting stdio flags = $sim_stdio" 6>&1
3042 fi
3043 else
3044   sim_stdio=""
3045 fi
3046
3047
3048
3049 # Check whether --enable-sim-trace or --disable-sim-trace was given.
3050 if test "${enable_sim_trace+set}" = set; then
3051   enableval="$enable_sim_trace"
3052   case "${enableval}" in
3053   yes)  sim_trace="-DTRACE=1 -DWITH_TRACE=-1";;
3054   no)   sim_trace="-DTRACE=0 -DWITH_TRACE=0";;
3055   [-0-9]*)
3056         sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";;
3057   [a-z]*)
3058         sim_trace=""
3059         for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
3060           if test x"$sim_trace" = x; then
3061             sim_trace="-DWITH_TRACE='(TRACE_$x"
3062           else
3063             sim_trace="${sim_trace}|TRACE_$x"
3064           fi
3065         done
3066         sim_trace="$sim_trace)'" ;;
3067 esac
3068 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
3069   echo "Setting sim trace = $sim_trace" 6>&1
3070 fi
3071 else
3072   sim_trace=""
3073 fi
3074
3075
3076
3077 # Check whether --enable-sim-profile or --disable-sim-profile was given.
3078 if test "${enable_sim_profile+set}" = set; then
3079   enableval="$enable_sim_profile"
3080   case "${enableval}" in
3081   yes)  sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1";;
3082   no)   sim_profile="-DPROFILE=0 -DWITH_PROFILE=0";;
3083   [-0-9]*)
3084         sim_profile="-DPROFILE='(${enableval})' -DWITH_PROFILE='(${enableval})'";;
3085   [a-z]*)
3086         sim_profile=""
3087         for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
3088           if test x"$sim_profile" = x; then
3089             sim_profile="-DWITH_PROFILE='(PROFILE_$x"
3090           else
3091             sim_profile="${sim_profile}|PROFILE_$x"
3092           fi
3093         done
3094         sim_profile="$sim_profile)'" ;;
3095 esac
3096 if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then
3097   echo "Setting sim profile = $sim_profile" 6>&1
3098 fi
3099 else
3100   sim_profile=""
3101 fi
3102
3103
3104
3105 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3106 echo "configure:3107: checking return type of signal handlers" >&5
3107 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
3108   echo $ac_n "(cached) $ac_c" 1>&6
3109 else
3110   cat > conftest.$ac_ext <<EOF
3111 #line 3112 "configure"
3112 #include "confdefs.h"
3113 #include <sys/types.h>
3114 #include <signal.h>
3115 #ifdef signal
3116 #undef signal
3117 #endif
3118 #ifdef __cplusplus
3119 extern "C" void (*signal (int, void (*)(int)))(int);
3120 #else
3121 void (*signal ()) ();
3122 #endif
3123
3124 int main() {
3125 int i;
3126 ; return 0; }
3127 EOF
3128 if { (eval echo configure:3129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3129   rm -rf conftest*
3130   ac_cv_type_signal=void
3131 else
3132   echo "configure: failed program was:" >&5
3133   cat conftest.$ac_ext >&5
3134   rm -rf conftest*
3135   ac_cv_type_signal=int
3136 fi
3137 rm -f conftest*
3138 fi
3139
3140 echo "$ac_t""$ac_cv_type_signal" 1>&6
3141 cat >> confdefs.h <<EOF
3142 #define RETSIGTYPE $ac_cv_type_signal
3143 EOF
3144
3145
3146
3147
3148 sim_link_files=
3149 sim_link_links=
3150
3151 sim_link_links=tconfig.h
3152 if test -f ${srcdir}/tconfig.in
3153 then
3154   sim_link_files=tconfig.in
3155 else
3156   sim_link_files=../common/tconfig.in
3157 fi
3158
3159 # targ-vals.def points to the libc macro description file.
3160 case "${target}" in
3161 *-*-*) TARG_VALS_DEF=../common/nltvals.def ;;
3162 esac
3163 sim_link_files="${sim_link_files} ${TARG_VALS_DEF}"
3164 sim_link_links="${sim_link_links} targ-vals.def"
3165
3166
3167
3168 for ac_hdr in unistd.h
3169 do
3170 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3171 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3172 echo "configure:3173: checking for $ac_hdr" >&5
3173 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3174   echo $ac_n "(cached) $ac_c" 1>&6
3175 else
3176   cat > conftest.$ac_ext <<EOF
3177 #line 3178 "configure"
3178 #include "confdefs.h"
3179 #include <$ac_hdr>
3180 EOF
3181 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3182 { (eval echo configure:3183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3183 ac_err=`grep -v '^ *+' conftest.out`
3184 if test -z "$ac_err"; then
3185   rm -rf conftest*
3186   eval "ac_cv_header_$ac_safe=yes"
3187 else
3188   echo "$ac_err" >&5
3189   echo "configure: failed program was:" >&5
3190   cat conftest.$ac_ext >&5
3191   rm -rf conftest*
3192   eval "ac_cv_header_$ac_safe=no"
3193 fi
3194 rm -f conftest*
3195 fi
3196 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3197   echo "$ac_t""yes" 1>&6
3198     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3199   cat >> confdefs.h <<EOF
3200 #define $ac_tr_hdr 1
3201 EOF
3202  
3203 else
3204   echo "$ac_t""no" 1>&6
3205 fi
3206 done
3207
3208
3209
3210
3211 trap '' 1 2 15
3212 cat > confcache <<\EOF
3213 # This file is a shell script that caches the results of configure
3214 # tests run on this system so they can be shared between configure
3215 # scripts and configure runs.  It is not useful on other systems.
3216 # If it contains results you don't want to keep, you may remove or edit it.
3217 #
3218 # By default, configure uses ./config.cache as the cache file,
3219 # creating it if it does not exist already.  You can give configure
3220 # the --cache-file=FILE option to use a different cache file; that is
3221 # what configure does when it calls configure scripts in
3222 # subdirectories, so they share the cache.
3223 # Giving --cache-file=/dev/null disables caching, for debugging configure.
3224 # config.status only pays attention to the cache file if you give it the
3225 # --recheck option to rerun configure.
3226 #
3227 EOF
3228 # The following way of writing the cache mishandles newlines in values,
3229 # but we know of no workaround that is simple, portable, and efficient.
3230 # So, don't put newlines in cache variables' values.
3231 # Ultrix sh set writes to stderr and can't be redirected directly,
3232 # and sets the high bit in the cache file unless we assign to the vars.
3233 (set) 2>&1 |
3234   case `(ac_space=' '; set) 2>&1 | grep ac_space` in
3235   *ac_space=\ *)
3236     # `set' does not quote correctly, so add quotes (double-quote substitution
3237     # turns \\\\ into \\, and sed turns \\ into \).
3238     sed -n \
3239       -e "s/'/'\\\\''/g" \
3240       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3241     ;;
3242   *)
3243     # `set' quotes correctly as required by POSIX, so do not add quotes.
3244     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3245     ;;
3246   esac >> confcache
3247 if cmp -s $cache_file confcache; then
3248   :
3249 else
3250   if test -w $cache_file; then
3251     echo "updating cache $cache_file"
3252     cat confcache > $cache_file
3253   else
3254     echo "not updating unwritable cache $cache_file"
3255   fi
3256 fi
3257 rm -f confcache
3258
3259 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3260
3261 test "x$prefix" = xNONE && prefix=$ac_default_prefix
3262 # Let make expand exec_prefix.
3263 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3264
3265 # Any assignment to VPATH causes Sun make to only execute
3266 # the first set of double-colon rules, so remove it if not needed.
3267 # If there is a colon in the path, we need to keep it.
3268 if test "x$srcdir" = x.; then
3269   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
3270 fi
3271
3272 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3273
3274 DEFS=-DHAVE_CONFIG_H
3275
3276 # Without the "./", some shells look in PATH for config.status.
3277 : ${CONFIG_STATUS=./config.status}
3278
3279 echo creating $CONFIG_STATUS
3280 rm -f $CONFIG_STATUS
3281 cat > $CONFIG_STATUS <<EOF
3282 #! /bin/sh
3283 # Generated automatically by configure.
3284 # Run this file to recreate the current configuration.
3285 # This directory was configured as follows,
3286 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3287 #
3288 # $0 $ac_configure_args
3289 #
3290 # Compiler output produced by configure, useful for debugging
3291 # configure, is in ./config.log if it exists.
3292
3293 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3294 for ac_option
3295 do
3296   case "\$ac_option" in
3297   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3298     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3299     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3300   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
3301     echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
3302     exit 0 ;;
3303   -help | --help | --hel | --he | --h)
3304     echo "\$ac_cs_usage"; exit 0 ;;
3305   *) echo "\$ac_cs_usage"; exit 1 ;;
3306   esac
3307 done
3308
3309 ac_given_srcdir=$srcdir
3310 ac_given_INSTALL="$INSTALL"
3311
3312 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
3313 EOF
3314 cat >> $CONFIG_STATUS <<EOF
3315
3316 # Protect against being on the right side of a sed subst in config.status.
3317 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3318  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
3319 $ac_vpsub
3320 $extrasub
3321 s%@sim_environment@%$sim_environment%g
3322 s%@sim_alignment@%$sim_alignment%g
3323 s%@sim_assert@%$sim_assert%g
3324 s%@sim_bitsize@%$sim_bitsize%g
3325 s%@sim_endian@%$sim_endian%g
3326 s%@sim_hostendian@%$sim_hostendian%g
3327 s%@sim_float@%$sim_float%g
3328 s%@sim_scache@%$sim_scache%g
3329 s%@sim_default_model@%$sim_default_model%g
3330 s%@sim_hardware@%$sim_hardware%g
3331 s%@sim_hw_obj@%$sim_hw_obj%g
3332 s%@sim_hw@%$sim_hw%g
3333 s%@sim_inline@%$sim_inline%g
3334 s%@sim_packages@%$sim_packages%g
3335 s%@sim_regparm@%$sim_regparm%g
3336 s%@sim_reserved_bits@%$sim_reserved_bits%g
3337 s%@sim_smp@%$sim_smp%g
3338 s%@sim_stdcall@%$sim_stdcall%g
3339 s%@sim_xor_endian@%$sim_xor_endian%g
3340 s%@sim_warnings@%$sim_warnings%g
3341 s%@SHELL@%$SHELL%g
3342 s%@CFLAGS@%$CFLAGS%g
3343 s%@CPPFLAGS@%$CPPFLAGS%g
3344 s%@CXXFLAGS@%$CXXFLAGS%g
3345 s%@DEFS@%$DEFS%g
3346 s%@LDFLAGS@%$LDFLAGS%g
3347 s%@LIBS@%$LIBS%g
3348 s%@exec_prefix@%$exec_prefix%g
3349 s%@prefix@%$prefix%g
3350 s%@program_transform_name@%$program_transform_name%g
3351 s%@bindir@%$bindir%g
3352 s%@sbindir@%$sbindir%g
3353 s%@libexecdir@%$libexecdir%g
3354 s%@datadir@%$datadir%g
3355 s%@sysconfdir@%$sysconfdir%g
3356 s%@sharedstatedir@%$sharedstatedir%g
3357 s%@localstatedir@%$localstatedir%g
3358 s%@libdir@%$libdir%g
3359 s%@includedir@%$includedir%g
3360 s%@oldincludedir@%$oldincludedir%g
3361 s%@infodir@%$infodir%g
3362 s%@mandir@%$mandir%g
3363 s%@host@%$host%g
3364 s%@host_alias@%$host_alias%g
3365 s%@host_cpu@%$host_cpu%g
3366 s%@host_vendor@%$host_vendor%g
3367 s%@host_os@%$host_os%g
3368 s%@target@%$target%g
3369 s%@target_alias@%$target_alias%g
3370 s%@target_cpu@%$target_cpu%g
3371 s%@target_vendor@%$target_vendor%g
3372 s%@target_os@%$target_os%g
3373 s%@build@%$build%g
3374 s%@build_alias@%$build_alias%g
3375 s%@build_cpu@%$build_cpu%g
3376 s%@build_vendor@%$build_vendor%g
3377 s%@build_os@%$build_os%g
3378 s%@CC@%$CC%g
3379 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
3380 s%@INSTALL_DATA@%$INSTALL_DATA%g
3381 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
3382 s%@HDEFINES@%$HDEFINES%g
3383 s%@AR@%$AR%g
3384 s%@RANLIB@%$RANLIB%g
3385 s%@SET_MAKE@%$SET_MAKE%g
3386 s%@CPP@%$CPP%g
3387 s%@ALLOCA@%$ALLOCA%g
3388 s%@USE_NLS@%$USE_NLS%g
3389 s%@MSGFMT@%$MSGFMT%g
3390 s%@GMSGFMT@%$GMSGFMT%g
3391 s%@XGETTEXT@%$XGETTEXT%g
3392 s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
3393 s%@CATALOGS@%$CATALOGS%g
3394 s%@CATOBJEXT@%$CATOBJEXT%g
3395 s%@DATADIRNAME@%$DATADIRNAME%g
3396 s%@GMOFILES@%$GMOFILES%g
3397 s%@INSTOBJEXT@%$INSTOBJEXT%g
3398 s%@INTLDEPS@%$INTLDEPS%g
3399 s%@INTLLIBS@%$INTLLIBS%g
3400 s%@INTLOBJS@%$INTLOBJS%g
3401 s%@POFILES@%$POFILES%g
3402 s%@POSUB@%$POSUB%g
3403 s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
3404 s%@GT_NO@%$GT_NO%g
3405 s%@GT_YES@%$GT_YES%g
3406 s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
3407 s%@l@%$l%g
3408 s%@MAINT@%$MAINT%g
3409 s%@sim_bswap@%$sim_bswap%g
3410 s%@sim_cflags@%$sim_cflags%g
3411 s%@sim_debug@%$sim_debug%g
3412 s%@sim_stdio@%$sim_stdio%g
3413 s%@sim_trace@%$sim_trace%g
3414 s%@sim_profile@%$sim_profile%g
3415
3416 CEOF
3417 EOF
3418
3419 cat >> $CONFIG_STATUS <<\EOF
3420
3421 # Split the substitutions into bite-sized pieces for seds with
3422 # small command number limits, like on Digital OSF/1 and HP-UX.
3423 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3424 ac_file=1 # Number of current file.
3425 ac_beg=1 # First line for current file.
3426 ac_end=$ac_max_sed_cmds # Line after last line for current file.
3427 ac_more_lines=:
3428 ac_sed_cmds=""
3429 while $ac_more_lines; do
3430   if test $ac_beg -gt 1; then
3431     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3432   else
3433     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3434   fi
3435   if test ! -s conftest.s$ac_file; then
3436     ac_more_lines=false
3437     rm -f conftest.s$ac_file
3438   else
3439     if test -z "$ac_sed_cmds"; then
3440       ac_sed_cmds="sed -f conftest.s$ac_file"
3441     else
3442       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3443     fi
3444     ac_file=`expr $ac_file + 1`
3445     ac_beg=$ac_end
3446     ac_end=`expr $ac_end + $ac_max_sed_cmds`
3447   fi
3448 done
3449 if test -z "$ac_sed_cmds"; then
3450   ac_sed_cmds=cat
3451 fi
3452 EOF
3453
3454 cat >> $CONFIG_STATUS <<EOF
3455
3456 CONFIG_FILES=\${CONFIG_FILES-"Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in .gdbinit:../common/gdbinit.in"}
3457 EOF
3458 cat >> $CONFIG_STATUS <<\EOF
3459 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3460   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3461   case "$ac_file" in
3462   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3463        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3464   *) ac_file_in="${ac_file}.in" ;;
3465   esac
3466
3467   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
3468
3469   # Remove last slash and all that follows it.  Not all systems have dirname.
3470   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3471   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3472     # The file is in a subdirectory.
3473     test ! -d "$ac_dir" && mkdir "$ac_dir"
3474     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3475     # A "../" for each directory in $ac_dir_suffix.
3476     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3477   else
3478     ac_dir_suffix= ac_dots=
3479   fi
3480
3481   case "$ac_given_srcdir" in
3482   .)  srcdir=.
3483       if test -z "$ac_dots"; then top_srcdir=.
3484       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3485   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3486   *) # Relative path.
3487     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3488     top_srcdir="$ac_dots$ac_given_srcdir" ;;
3489   esac
3490
3491   case "$ac_given_INSTALL" in
3492   [/$]*) INSTALL="$ac_given_INSTALL" ;;
3493   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
3494   esac
3495
3496   echo creating "$ac_file"
3497   rm -f "$ac_file"
3498   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3499   case "$ac_file" in
3500   *Makefile*) ac_comsub="1i\\
3501 # $configure_input" ;;
3502   *) ac_comsub= ;;
3503   esac
3504
3505   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3506   sed -e "$ac_comsub
3507 s%@configure_input@%$configure_input%g
3508 s%@srcdir@%$srcdir%g
3509 s%@top_srcdir@%$top_srcdir%g
3510 s%@INSTALL@%$INSTALL%g
3511 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
3512 fi; done
3513 rm -f conftest.s*
3514
3515 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3516 # NAME is the cpp macro being defined and VALUE is the value it is being given.
3517 #
3518 # ac_d sets the value in "#define NAME VALUE" lines.
3519 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
3520 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
3521 ac_dC='\3'
3522 ac_dD='%g'
3523 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3524 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3525 ac_uB='\([      ]\)%\1#\2define\3'
3526 ac_uC=' '
3527 ac_uD='\4%g'
3528 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3529 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3530 ac_eB='$%\1#\2define\3'
3531 ac_eC=' '
3532 ac_eD='%g'
3533
3534 if test "${CONFIG_HEADERS+set}" != set; then
3535 EOF
3536 cat >> $CONFIG_STATUS <<EOF
3537   CONFIG_HEADERS="config.h:config.in"
3538 EOF
3539 cat >> $CONFIG_STATUS <<\EOF
3540 fi
3541 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
3542   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3543   case "$ac_file" in
3544   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3545        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3546   *) ac_file_in="${ac_file}.in" ;;
3547   esac
3548
3549   echo creating $ac_file
3550
3551   rm -f conftest.frag conftest.in conftest.out
3552   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3553   cat $ac_file_inputs > conftest.in
3554
3555 EOF
3556
3557 # Transform confdefs.h into a sed script conftest.vals that substitutes
3558 # the proper values into config.h.in to produce config.h.  And first:
3559 # Protect against being on the right side of a sed subst in config.status.
3560 # Protect against being in an unquoted here document in config.status.
3561 rm -f conftest.vals
3562 cat > conftest.hdr <<\EOF
3563 s/[\\&%]/\\&/g
3564 s%[\\$`]%\\&%g
3565 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
3566 s%ac_d%ac_u%gp
3567 s%ac_u%ac_e%gp
3568 EOF
3569 sed -n -f conftest.hdr confdefs.h > conftest.vals
3570 rm -f conftest.hdr
3571
3572 # This sed command replaces #undef with comments.  This is necessary, for
3573 # example, in the case of _POSIX_SOURCE, which is predefined and required
3574 # on some systems where configure will not decide to define it.
3575 cat >> conftest.vals <<\EOF
3576 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3577 EOF
3578
3579 # Break up conftest.vals because some shells have a limit on
3580 # the size of here documents, and old seds have small limits too.
3581
3582 rm -f conftest.tail
3583 while :
3584 do
3585   ac_lines=`grep -c . conftest.vals`
3586   # grep -c gives empty output for an empty file on some AIX systems.
3587   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3588   # Write a limited-size here document to conftest.frag.
3589   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3590   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3591   echo 'CEOF
3592   sed -f conftest.frag conftest.in > conftest.out
3593   rm -f conftest.in
3594   mv conftest.out conftest.in
3595 ' >> $CONFIG_STATUS
3596   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3597   rm -f conftest.vals
3598   mv conftest.tail conftest.vals
3599 done
3600 rm -f conftest.vals
3601
3602 cat >> $CONFIG_STATUS <<\EOF
3603   rm -f conftest.frag conftest.h
3604   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
3605   cat conftest.in >> conftest.h
3606   rm -f conftest.in
3607   if cmp -s $ac_file conftest.h 2>/dev/null; then
3608     echo "$ac_file is unchanged"
3609     rm -f conftest.h
3610   else
3611     # Remove last slash and all that follows it.  Not all systems have dirname.
3612       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3613       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3614       # The file is in a subdirectory.
3615       test ! -d "$ac_dir" && mkdir "$ac_dir"
3616     fi
3617     rm -f $ac_file
3618     mv conftest.h $ac_file
3619   fi
3620 fi; done
3621
3622 EOF
3623
3624 cat >> $CONFIG_STATUS <<EOF
3625 ac_sources="$sim_link_files"
3626 ac_dests="$sim_link_links"
3627 EOF
3628
3629 cat >> $CONFIG_STATUS <<\EOF
3630 srcdir=$ac_given_srcdir
3631 while test -n "$ac_sources"; do
3632   set $ac_dests; ac_dest=$1; shift; ac_dests=$*
3633   set $ac_sources; ac_source=$1; shift; ac_sources=$*
3634
3635   echo "linking $srcdir/$ac_source to $ac_dest"
3636
3637   if test ! -r $srcdir/$ac_source; then
3638     { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
3639   fi
3640   rm -f $ac_dest
3641
3642   # Make relative symlinks.
3643   # Remove last slash and all that follows it.  Not all systems have dirname.
3644   ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
3645   if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
3646     # The dest file is in a subdirectory.
3647     test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
3648     ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
3649     # A "../" for each directory in $ac_dest_dir_suffix.
3650     ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
3651   else
3652     ac_dest_dir_suffix= ac_dots=
3653   fi
3654
3655   case "$srcdir" in
3656   [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
3657   *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
3658   esac
3659
3660   # Make a symlink if possible; otherwise try a hard link.
3661   if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
3662     ln $srcdir/$ac_source $ac_dest; then :
3663   else
3664     { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
3665   fi
3666 done
3667 EOF
3668 cat >> $CONFIG_STATUS <<EOF
3669
3670 EOF
3671 cat >> $CONFIG_STATUS <<\EOF
3672 case "x$CONFIG_FILES" in
3673  xMakefile*)
3674    echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
3675    rm -f Makesim1.tmp Makesim2.tmp Makefile
3676    sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
3677    sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
3678    sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
3679         -e '/^## COMMON_POST_/ r Makesim2.tmp' \
3680         <Makefile.sim >Makefile
3681    rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
3682    ;;
3683  esac
3684  case "x$CONFIG_HEADERS" in xconfig.h:config.in) echo > stamp-h ;; esac
3685
3686 exit 0
3687 EOF
3688 chmod +x $CONFIG_STATUS
3689 rm -fr confdefs* $ac_clean_files
3690 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3691
3692