]> ncurses.scripts.mit.edu Git - ncurses.git/blob - configure
ncurses 5.1
[ncurses.git] / configure
1 #! /bin/sh
2
3 # From configure.in Revision: 1.195 
4
5
6
7 # Guess values for system-dependent variables and create Makefiles.
8 # Generated automatically using autoconf version 2.13.19990117 
9 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
10 #
11 # This configure script is free software; the Free Software Foundation
12 # gives unlimited permission to copy, distribute and modify it.
13
14 # Defaults:
15 ac_help=
16 ac_default_prefix=/usr/local
17 # Any additions from configure.in:
18
19 # Initialize some variables set by options.
20 # The variables have the same names as the options, with
21 # dashes changed to underlines.
22 build=NONE
23 cache_file=./config.cache
24 exec_prefix=NONE
25 host=NONE
26 no_create=
27 nonopt=NONE
28 no_recursion=
29 prefix=NONE
30 program_prefix=NONE
31 program_suffix=NONE
32 program_transform_name=s,x,x,
33 silent=
34 site=
35 srcdir=
36 target=NONE
37 verbose=
38 x_includes=NONE
39 x_libraries=NONE
40 bindir='${exec_prefix}/bin'
41 sbindir='${exec_prefix}/sbin'
42 libexecdir='${exec_prefix}/libexec'
43 datadir='${prefix}/share'
44 sysconfdir='${prefix}/etc'
45 sharedstatedir='${prefix}/com'
46 localstatedir='${prefix}/var'
47 libdir='${exec_prefix}/lib'
48 includedir='${prefix}/include'
49 oldincludedir='/usr/include'
50 infodir='${prefix}/info'
51 mandir='${prefix}/man'
52
53 # Initialize some other variables.
54 subdirs=
55 MFLAGS= MAKEFLAGS=
56 SHELL=${CONFIG_SHELL-/bin/sh}
57 # Maximum number of lines to put in a shell here document.
58 ac_max_here_lines=12
59
60 ac_prev=
61 for ac_option
62 do
63
64   # If the previous option needs an argument, assign it.
65   if test -n "$ac_prev"; then
66     eval "$ac_prev=\$ac_option"
67     ac_prev=
68     continue
69   fi
70
71   case "$ac_option" in
72   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
73   *) ac_optarg= ;;
74   esac
75
76   # Accept the important Cygnus configure options, so we can diagnose typos.
77
78   case "$ac_option" in
79
80   -bindir | --bindir | --bindi | --bind | --bin | --bi)
81     ac_prev=bindir ;;
82   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
83     bindir="$ac_optarg" ;;
84
85   -build | --build | --buil | --bui | --bu)
86     ac_prev=build ;;
87   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
88     build="$ac_optarg" ;;
89
90   -cache-file | --cache-file | --cache-fil | --cache-fi \
91   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
92     ac_prev=cache_file ;;
93   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
94   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
95     cache_file="$ac_optarg" ;;
96
97   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
98     ac_prev=datadir ;;
99   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
100   | --da=*)
101     datadir="$ac_optarg" ;;
102
103   -disable-* | --disable-*)
104     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
105     # Reject names that are not valid shell variable names.
106     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
107       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
108     fi
109     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
110     eval "enable_${ac_feature}=no" ;;
111
112   -enable-* | --enable-*)
113     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
114     # Reject names that are not valid shell variable names.
115     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
116       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
117     fi
118     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
119     case "$ac_option" in
120       *=*) ;;
121       *) ac_optarg=yes ;;
122     esac
123     eval "enable_${ac_feature}='$ac_optarg'" ;;
124
125   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
126   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
127   | --exec | --exe | --ex)
128     ac_prev=exec_prefix ;;
129   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
130   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
131   | --exec=* | --exe=* | --ex=*)
132     exec_prefix="$ac_optarg" ;;
133
134   -gas | --gas | --ga | --g)
135     # Obsolete; use --with-gas.
136     with_gas=yes ;;
137
138   -help | --help | --hel | --he)
139     # Omit some internal or obsolete options to make the list less imposing.
140     # This message is too long to be a string in the A/UX 3.1 sh.
141     cat << EOF
142 Usage: configure [options] [host]
143 Options: [defaults in brackets after descriptions]
144 Configuration:
145   --cache-file=FILE       cache test results in FILE
146   --help                  print this message
147   --no-create             do not create output files
148   --quiet, --silent       do not print \`checking...' messages
149   --version               print the version of autoconf that created configure
150 Directory and file names:
151   --prefix=PREFIX         install architecture-independent files in PREFIX
152                           [$ac_default_prefix]
153   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
154                           [same as prefix]
155   --bindir=DIR            user executables in DIR [EPREFIX/bin]
156   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
157   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
158   --datadir=DIR           read-only architecture-independent data in DIR
159                           [PREFIX/share]
160   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
161   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
162                           [PREFIX/com]
163   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
164   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
165   --includedir=DIR        C header files in DIR [PREFIX/include]
166   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
167   --infodir=DIR           info documentation in DIR [PREFIX/info]
168   --mandir=DIR            man documentation in DIR [PREFIX/man]
169   --srcdir=DIR            find the sources in DIR [configure dir or ..]
170   --program-prefix=PREFIX prepend PREFIX to installed program names
171   --program-suffix=SUFFIX append SUFFIX to installed program names
172   --program-transform-name=PROGRAM
173                           run sed PROGRAM on installed program names
174 EOF
175     cat << EOF
176 Host type:
177   --build=BUILD           configure for building on BUILD [BUILD=HOST]
178   --host=HOST             configure for HOST [guessed]
179   --target=TARGET         configure for TARGET [TARGET=HOST]
180 Features and packages:
181   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
182   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
183   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
184   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
185   --x-includes=DIR        X include files are in DIR
186   --x-libraries=DIR       X library files are in DIR
187 EOF
188 cat <<EOF
189 --enable and --with options recognized:
190   --with-system-type=XXX  test: override derived host system-type
191   --enable-add-ons=DIR... used to check if we are a glibc add-on.
192   --without-cxx           do not adjust ncurses bool to match C++
193   --without-cxx-binding   do not build C++ binding and demo
194   --without-ada           suppress check for Ada95, don't build demo
195   --without-progs         suppress build with programs (e.g., tic)
196   --with-install-prefix   prefixes actual install-location
197 Options to Specify How Manpages are Installed:
198   --with-manpage-format   specify manpage-format: gzip/compress/BSDI/normal and
199                           optionally formatted, e.g., gzip,formatted
200   --with-manpage-renames  specify manpage-renaming
201   --with-manpage-symlinks specify manpage-symlinks
202 Options to Specify the Libraries Built/Used:
203   --with-shared           generate shared-libraries
204 EOF
205 cat <<EOF
206   --with-normal           generate normal-libraries (default)
207   --with-debug            generate debug-libraries (default)
208   --with-profile          generate profile-libraries
209   --with-termlib          generate separate terminfo library
210   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
211   --with-dmalloc          test: use Gray Watson's dmalloc library
212   --with-gpm              use Alessandro Rubini's GPM library
213   --enable-rpath          use rpath option when generating shared libraries
214   --with-shlib-version=X  Specify rel or abi version for shared libs
215 Fine-Tuning Your Configuration:
216   --disable-overwrite     leave out the link to -lcurses
217   --disable-database      use only built-in data
218 EOF
219 cat <<EOF
220   --with-fallbacks=XXX    specify list of fallback terminal descriptions
221   --with-terminfo-dirs=XXX specify list of terminfo directories (default: DATADIR/terminfo)
222   --disable-big-core      assume machine has little memory
223   --enable-termcap        compile in termcap fallback support
224   --enable-getcap         fast termcap load, no xrefs to terminfo
225   --enable-getcap-cache   cache translated termcaps in ~/.terminfo
226   --enable-symlinks       make tic use symbolic links not hard links
227   --enable-broken_linker  compile with broken-linker support code
228   --enable-bsdpad         recognize BSD-style prefix padding
229   --with-rcs-ids          compile-in RCS identifiers
230 Extensions:
231   --disable-ext-funcs     disable function-extensions
232 EOF
233 cat <<EOF
234   --enable-const          compile with extra/non-standard const
235   --enable-hashmap        compile with hashmap scrolling-optimization code
236   --enable-no-padding     compile with \$NCURSES_NO_PADDING code
237   --enable-sigwinch       compile with SIGWINCH handler
238   --enable-tcap-names     compile with user-definable terminal capabilities
239 Experimental Code:
240   --with-develop          enable all experimental options for testing
241   --enable-colorfgbg      compile with experimental \$COLORFGBG code
242   --enable-hard-tabs      compile with experimental hard-tabs code
243   --enable-safe-sprintf   compile with experimental safe-sprintf code
244   --disable-scroll-hints  compile without scroll-hints code
245   --enable-widec          compile with experimental wide-char code
246 EOF
247 cat <<EOF
248   --enable-xmc-glitch     compile with experimental xmc code
249 Testing/development Options:
250   --enable-echo           build: display "compiling" commands (default)
251   --enable-warnings       build: turn on GCC compiler warnings
252   --enable-assertions     test: turn on generation of assertion code
253   --disable-leaks         test: suppress permanent memory-leaks
254   --enable-expanded       test: generate functions for certain macros
255   --disable-macros        test: use functions rather than macros
256 Ada95 Binding Options:
257   --with-ada-compiler=CMD Specify Ada95 compiler command (default gnatmake)
258   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/lib/ada/adainclude)
259   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
260 EOF
261 cat <<EOF
262 EOF
263     exit 0 ;;
264
265   -host | --host | --hos | --ho)
266     ac_prev=host ;;
267   -host=* | --host=* | --hos=* | --ho=*)
268     host="$ac_optarg" ;;
269
270   -includedir | --includedir | --includedi | --included | --include \
271   | --includ | --inclu | --incl | --inc)
272     ac_prev=includedir ;;
273   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
274   | --includ=* | --inclu=* | --incl=* | --inc=*)
275     includedir="$ac_optarg" ;;
276
277   -infodir | --infodir | --infodi | --infod | --info | --inf)
278     ac_prev=infodir ;;
279   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
280     infodir="$ac_optarg" ;;
281
282   -libdir | --libdir | --libdi | --libd)
283     ac_prev=libdir ;;
284   -libdir=* | --libdir=* | --libdi=* | --libd=*)
285     libdir="$ac_optarg" ;;
286
287   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
288   | --libexe | --libex | --libe)
289     ac_prev=libexecdir ;;
290   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
291   | --libexe=* | --libex=* | --libe=*)
292     libexecdir="$ac_optarg" ;;
293
294   -localstatedir | --localstatedir | --localstatedi | --localstated \
295   | --localstate | --localstat | --localsta | --localst \
296   | --locals | --local | --loca | --loc | --lo)
297     ac_prev=localstatedir ;;
298   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
299   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
300   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
301     localstatedir="$ac_optarg" ;;
302
303   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
304     ac_prev=mandir ;;
305   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
306     mandir="$ac_optarg" ;;
307
308   -nfp | --nfp | --nf)
309     # Obsolete; use --without-fp.
310     with_fp=no ;;
311
312   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
313   | --no-cr | --no-c)
314     no_create=yes ;;
315
316   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
317   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
318     no_recursion=yes ;;
319
320   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
321   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
322   | --oldin | --oldi | --old | --ol | --o)
323     ac_prev=oldincludedir ;;
324   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
325   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
326   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
327     oldincludedir="$ac_optarg" ;;
328
329   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
330     ac_prev=prefix ;;
331   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
332     prefix="$ac_optarg" ;;
333
334   -program-prefix | --program-prefix | --program-prefi | --program-pref \
335   | --program-pre | --program-pr | --program-p)
336     ac_prev=program_prefix ;;
337   -program-prefix=* | --program-prefix=* | --program-prefi=* \
338   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
339     program_prefix="$ac_optarg" ;;
340
341   -program-suffix | --program-suffix | --program-suffi | --program-suff \
342   | --program-suf | --program-su | --program-s)
343     ac_prev=program_suffix ;;
344   -program-suffix=* | --program-suffix=* | --program-suffi=* \
345   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
346     program_suffix="$ac_optarg" ;;
347
348   -program-transform-name | --program-transform-name \
349   | --program-transform-nam | --program-transform-na \
350   | --program-transform-n | --program-transform- \
351   | --program-transform | --program-transfor \
352   | --program-transfo | --program-transf \
353   | --program-trans | --program-tran \
354   | --progr-tra | --program-tr | --program-t)
355     ac_prev=program_transform_name ;;
356   -program-transform-name=* | --program-transform-name=* \
357   | --program-transform-nam=* | --program-transform-na=* \
358   | --program-transform-n=* | --program-transform-=* \
359   | --program-transform=* | --program-transfor=* \
360   | --program-transfo=* | --program-transf=* \
361   | --program-trans=* | --program-tran=* \
362   | --progr-tra=* | --program-tr=* | --program-t=*)
363     program_transform_name="$ac_optarg" ;;
364
365   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
366   | -silent | --silent | --silen | --sile | --sil)
367     silent=yes ;;
368
369   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
370     ac_prev=sbindir ;;
371   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
372   | --sbi=* | --sb=*)
373     sbindir="$ac_optarg" ;;
374
375   -sharedstatedir | --sharedstatedir | --sharedstatedi \
376   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
377   | --sharedst | --shareds | --shared | --share | --shar \
378   | --sha | --sh)
379     ac_prev=sharedstatedir ;;
380   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
381   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
382   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
383   | --sha=* | --sh=*)
384     sharedstatedir="$ac_optarg" ;;
385
386   -site | --site | --sit)
387     ac_prev=site ;;
388   -site=* | --site=* | --sit=*)
389     site="$ac_optarg" ;;
390
391   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
392     ac_prev=srcdir ;;
393   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
394     srcdir="$ac_optarg" ;;
395
396   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
397   | --syscon | --sysco | --sysc | --sys | --sy)
398     ac_prev=sysconfdir ;;
399   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
400   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
401     sysconfdir="$ac_optarg" ;;
402
403   -target | --target | --targe | --targ | --tar | --ta | --t)
404     ac_prev=target ;;
405   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
406     target="$ac_optarg" ;;
407
408   -v | -verbose | --verbose | --verbos | --verbo | --verb)
409     verbose=yes ;;
410
411   -version | --version | --versio | --versi | --vers)
412     echo "configure generated by autoconf version 2.13.19990117"
413     exit 0 ;;
414
415   -with-* | --with-*)
416     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
417     # Reject names that are not valid shell variable names.
418     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
419       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
420     fi
421     ac_package=`echo $ac_package| sed 's/-/_/g'`
422     case "$ac_option" in
423       *=*) ;;
424       *) ac_optarg=yes ;;
425     esac
426     eval "with_${ac_package}='$ac_optarg'" ;;
427
428   -without-* | --without-*)
429     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
430     # Reject names that are not valid shell variable names.
431     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
432       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
433     fi
434     ac_package=`echo $ac_package| sed 's/-/_/g'`
435     eval "with_${ac_package}=no" ;;
436
437   --x)
438     # Obsolete; use --with-x.
439     with_x=yes ;;
440
441   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
442   | --x-incl | --x-inc | --x-in | --x-i)
443     ac_prev=x_includes ;;
444   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
445   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
446     x_includes="$ac_optarg" ;;
447
448   -x-libraries | --x-libraries | --x-librarie | --x-librari \
449   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
450     ac_prev=x_libraries ;;
451   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
452   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
453     x_libraries="$ac_optarg" ;;
454
455   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
456     ;;
457
458   *)
459     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
460       echo "configure: warning: $ac_option: invalid host type" 1>&2
461     fi
462     if test "x$nonopt" != xNONE; then
463       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
464     fi
465     nonopt="$ac_option"
466     ;;
467
468   esac
469 done
470
471 if test -n "$ac_prev"; then
472   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
473 fi
474
475 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
476
477 # File descriptor usage:
478 # 0 standard input
479 # 1 file creation
480 # 2 errors and warnings
481 # 3 some systems may open it to /dev/tty
482 # 4 used on the Kubota Titan
483 # 6 checking for... messages and results
484 # 5 compiler messages saved in config.log
485 if test "$silent" = yes; then
486   exec 6>/dev/null
487 else
488   exec 6>&1
489 fi
490 exec 5>./config.log
491
492 echo "\
493 This file contains any messages produced by compilers while
494 running configure, to aid debugging if configure makes a mistake.
495 " 1>&5
496
497 # Strip out --no-create and --no-recursion so they do not pile up.
498 # Also quote any args containing shell metacharacters.
499 ac_configure_args=
500 for ac_arg
501 do
502   case "$ac_arg" in
503   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
504   | --no-cr | --no-c) ;;
505   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
506   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
507   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
508   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
509   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
510   esac
511 done
512
513 # NLS nuisances.
514 # Only set these to C if already set.  These must not be set unconditionally
515 # because not all systems understand e.g. LANG=C (notably SCO).
516 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
517 # Non-C LC_CTYPE values break the ctype check.
518 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
519 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
520 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
521 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
522
523 # confdefs.h avoids OS command line length limits that DEFS can exceed.
524 rm -rf conftest* confdefs.h
525 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
526 echo > confdefs.h
527
528 # A filename unique to this package, relative to the directory that
529 # configure is in, which we can look for to find out if srcdir is correct.
530 ac_unique_file=ncurses/base/lib_initscr.c
531
532 # Find the source files, if location was not specified.
533 if test -z "$srcdir"; then
534   ac_srcdir_defaulted=yes
535   # Try the directory containing this script, then its parent.
536   ac_prog=$0
537   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
538   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
539   srcdir=$ac_confdir
540   if test ! -r $srcdir/$ac_unique_file; then
541     srcdir=..
542   fi
543 else
544   ac_srcdir_defaulted=no
545 fi
546 if test ! -r $srcdir/$ac_unique_file; then
547   if test "$ac_srcdir_defaulted" = yes; then
548     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
549   else
550     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
551   fi
552 fi
553 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
554
555 # Prefer explicitly selected file to automatically selected ones.
556 if test -z "$CONFIG_SITE"; then
557   if test "x$prefix" != xNONE; then
558     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
559   else
560     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
561   fi
562 fi
563 for ac_site_file in $CONFIG_SITE; do
564   if test -r "$ac_site_file"; then
565     echo "loading site script $ac_site_file"
566     . "$ac_site_file"
567   fi
568 done
569
570 if test -r "$cache_file"; then
571   echo "loading cache $cache_file"
572   . $cache_file
573 else
574   echo "creating cache $cache_file"
575   > $cache_file
576 fi
577
578 ac_ext=c
579 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
580 ac_cpp='$CPP $CPPFLAGS'
581 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
582 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
583 cross_compiling=$ac_cv_prog_cc_cross
584
585 ac_exeext=
586 ac_objext=o
587 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
588   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
589   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
590     ac_n= ac_c='
591 ' ac_t='        '
592   else
593     ac_n=-n ac_c= ac_t=
594   fi
595 else
596   ac_n= ac_c='\c' ac_t=
597 fi
598
599
600
601
602
603 NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
604 NCURSES_MINOR="`egrep '^NCURSES_MINOR[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
605 NCURSES_PATCH="`egrep '^NCURSES_PATCH[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
606 cf_cv_abi_version=${NCURSES_MAJOR}
607 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
608 echo "$ac_t""Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version (`date`)" 1>&6
609
610
611
612
613
614
615
616
617 ac_aux_dir=
618 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
619   if test -f $ac_dir/install-sh; then
620     ac_aux_dir=$ac_dir
621     ac_install_sh="$ac_aux_dir/install-sh -c"
622     break
623   elif test -f $ac_dir/install.sh; then
624     ac_aux_dir=$ac_dir
625     ac_install_sh="$ac_aux_dir/install.sh -c"
626     break
627   fi
628 done
629 if test -z "$ac_aux_dir"; then
630   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
631 fi
632 ac_config_guess=$ac_aux_dir/config.guess
633 ac_config_sub=$ac_aux_dir/config.sub
634 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
635
636
637 if test -f $srcdir/config.guess ; then
638         
639 # Make sure we can run config.sub.
640 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
641 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
642 fi
643
644 echo $ac_n "checking host system type""... $ac_c" 1>&6
645 echo "configure:646: checking host system type" >&5
646
647 host_alias=$host
648 case "$host_alias" in
649 NONE)
650   case $nonopt in
651   NONE)
652     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
653     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
654     fi ;;
655   *) host_alias=$nonopt ;;
656   esac ;;
657 esac
658
659 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
660 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
661 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
662 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
663 echo "$ac_t""$host" 1>&6
664
665         system_name="$host_os"
666 else
667         system_name="`(uname -s -r) 2>/dev/null`"
668         if test -z "$system_name" ; then
669                 system_name="`(hostname) 2>/dev/null`"
670         fi
671 fi
672 test -n "$system_name" && cat >> confdefs.h <<EOF
673 #define SYSTEM_NAME "$system_name"
674 EOF
675
676 if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
677   echo $ac_n "(cached) $ac_c" 1>&6
678 else
679   cf_cv_system_name="$system_name"
680 fi
681
682
683 test -z "$system_name" && system_name="$cf_cv_system_name"
684 test -n "$cf_cv_system_name" && echo "$ac_t"""Configuring for $cf_cv_system_name"" 1>&6
685
686 if test ".$system_name" != ".$cf_cv_system_name" ; then
687         echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
688         { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
689 fi
690
691
692 # Check whether --with-system-type or --without-system-type was given.
693 if test "${with_system_type+set}" = set; then
694   withval="$with_system_type"
695   echo "configure: warning: overriding system type to $withval" 1>&2
696  cf_cv_system_name=$withval
697 fi
698
699
700 # We need a configure script only when compiling as part of GNU C library.
701 # Here we have to generate one of the files we need while compiling.
702 #
703 # The only problem is that users of the package might think they have to
704 # run configure themself and find it irritating when nothing happens.
705 #
706 # So we try here to find out whether we are called from the glibc configure
707 # or by a user.
708 #
709
710 # Check whether --enable-add-ons or --disable-add-ons was given.
711 if test "${enable_add_ons+set}" = set; then
712   enableval="$enable_add_ons"
713   glibc_add_on=yes
714 else
715   glibc_add_on=
716 fi
717
718
719 if test x"$glibc_add_on" = "xyes" ; then
720   rm -f $srcdir/Banner
721   # We are in glibc.
722   rm -f $srcdir/Makefile
723   cp $srcdir/Makefile.glibc $srcdir/Makefile
724   echo "ncurses `grep \"^[      ]*ncurses-version[      ]*=.*$\" \
725                 $srcdir/Makefile | sed -e \
726                 's/^[   ]*ncurses-version[      ]*=[    ]*\([^  ^ ]*\)[         ]*$/\1/'`" > $srcdir/Banner
727   exit 0
728 fi
729
730 ###     Save the given $CFLAGS to allow user-override.
731 cf_user_CFLAGS="$CFLAGS"
732
733 ###     Default install-location
734
735 echo $ac_n "checking for prefix""... $ac_c" 1>&6
736 echo "configure:737: checking for prefix" >&5
737 if test "x$prefix" = "xNONE" ; then
738         case "$cf_cv_system_name" in
739                 # non-vendor systems don't have a conflict
740         openbsd*|netbsd*|freebsd*|linux*)
741                 prefix=/usr
742                 ;;
743         *)      prefix=$ac_default_prefix
744                 ;;
745         esac
746 fi
747 echo "$ac_t""$prefix" 1>&6
748
749 if test "x$prefix" = "xNONE" ; then
750 echo $ac_n "checking for default include-directory""... $ac_c" 1>&6
751 echo "configure:752: checking for default include-directory" >&5
752 test -n "$verbose" && echo 1>&6
753 for cf_symbol in \
754         $includedir \
755         $includedir/ncurses \
756         $prefix/include \
757         $prefix/include/ncurses \
758         /usr/local/include \
759         /usr/local/include/ncurses \
760         /usr/include \
761         /usr/include/ncurses
762 do
763         cf_dir=`eval echo $cf_symbol`
764         if test -f $cf_dir/curses.h ; then
765         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
766                 includedir="$cf_symbol"
767                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
768                 break
769         fi
770         fi
771         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
772 done
773 echo "$ac_t""$includedir" 1>&6
774 fi
775
776
777 ###     Checks for programs.
778 # Extract the first word of "gcc", so it can be a program name with args.
779 set dummy gcc; ac_word=$2
780 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
781 echo "configure:782: checking for $ac_word" >&5
782 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
783   echo $ac_n "(cached) $ac_c" 1>&6
784 else
785   if test -n "$CC"; then
786   ac_cv_prog_CC="$CC" # Let the user override the test.
787 else
788   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
789   ac_dummy="$PATH"
790   for ac_dir in $ac_dummy; do
791     test -z "$ac_dir" && ac_dir=.
792     if test -f $ac_dir/$ac_word; then
793       ac_cv_prog_CC="gcc"
794       break
795     fi
796   done
797   IFS="$ac_save_ifs"
798 fi
799 fi
800 CC="$ac_cv_prog_CC"
801 if test -n "$CC"; then
802   echo "$ac_t""$CC" 1>&6
803 else
804   echo "$ac_t""no" 1>&6
805 fi
806
807 if test -z "$CC"; then
808   # Extract the first word of "cc", so it can be a program name with args.
809 set dummy cc; ac_word=$2
810 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
811 echo "configure:812: checking for $ac_word" >&5
812 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
813   echo $ac_n "(cached) $ac_c" 1>&6
814 else
815   if test -n "$CC"; then
816   ac_cv_prog_CC="$CC" # Let the user override the test.
817 else
818   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
819   ac_prog_rejected=no
820   ac_dummy="$PATH"
821   for ac_dir in $ac_dummy; do
822     test -z "$ac_dir" && ac_dir=.
823     if test -f $ac_dir/$ac_word; then
824       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
825         ac_prog_rejected=yes
826         continue
827       fi
828       ac_cv_prog_CC="cc"
829       break
830     fi
831   done
832   IFS="$ac_save_ifs"
833 if test $ac_prog_rejected = yes; then
834   # We found a bogon in the path, so make sure we never use it.
835   set dummy $ac_cv_prog_CC
836   shift
837   if test $# -gt 0; then
838     # We chose a different compiler from the bogus one.
839     # However, it has the same basename, so the bogon will be chosen
840     # first if we set CC to just the basename; use the full file name.
841     shift
842     set dummy "$ac_dir/$ac_word" "$@"
843     shift
844     ac_cv_prog_CC="$@"
845   fi
846 fi
847 fi
848 fi
849 CC="$ac_cv_prog_CC"
850 if test -n "$CC"; then
851   echo "$ac_t""$CC" 1>&6
852 else
853   echo "$ac_t""no" 1>&6
854 fi
855
856   if test -z "$CC"; then
857     case "`uname -s`" in
858     *win32* | *WIN32*)
859       # Extract the first word of "cl", so it can be a program name with args.
860 set dummy cl; ac_word=$2
861 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
862 echo "configure:863: checking for $ac_word" >&5
863 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
864   echo $ac_n "(cached) $ac_c" 1>&6
865 else
866   if test -n "$CC"; then
867   ac_cv_prog_CC="$CC" # Let the user override the test.
868 else
869   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
870   ac_dummy="$PATH"
871   for ac_dir in $ac_dummy; do
872     test -z "$ac_dir" && ac_dir=.
873     if test -f $ac_dir/$ac_word; then
874       ac_cv_prog_CC="cl"
875       break
876     fi
877   done
878   IFS="$ac_save_ifs"
879 fi
880 fi
881 CC="$ac_cv_prog_CC"
882 if test -n "$CC"; then
883   echo "$ac_t""$CC" 1>&6
884 else
885   echo "$ac_t""no" 1>&6
886 fi
887  ;;
888     esac
889   fi
890   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
891 fi
892
893 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
894 echo "configure:895: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
895
896 ac_ext=c
897 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
898 ac_cpp='$CPP $CPPFLAGS'
899 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
900 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
901 cross_compiling=$ac_cv_prog_cc_cross
902
903 cat > conftest.$ac_ext << EOF
904
905 #line 906 "configure"
906 #include "confdefs.h"
907
908 main(){return(0);}
909 EOF
910 if { (eval echo configure:911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
911   ac_cv_prog_cc_works=yes
912   # If we can't run a trivial program, we are probably using a cross compiler.
913   if (./conftest; exit) 2>/dev/null; then
914     ac_cv_prog_cc_cross=no
915   else
916     ac_cv_prog_cc_cross=yes
917   fi
918 else
919   echo "configure: failed program was:" >&5
920   cat conftest.$ac_ext >&5
921   ac_cv_prog_cc_works=no
922 fi
923 rm -fr conftest*
924 ac_ext=c
925 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
926 ac_cpp='$CPP $CPPFLAGS'
927 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
928 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
929 cross_compiling=$ac_cv_prog_cc_cross
930
931 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
932 if test $ac_cv_prog_cc_works = no; then
933   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
934 fi
935 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
936 echo "configure:937: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
937 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
938 cross_compiling=$ac_cv_prog_cc_cross
939
940 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
941 echo "configure:942: checking whether we are using GNU C" >&5
942 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
943   echo $ac_n "(cached) $ac_c" 1>&6
944 else
945   cat > conftest.c <<EOF
946 #ifdef __GNUC__
947   yes;
948 #endif
949 EOF
950 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
951   ac_cv_prog_gcc=yes
952 else
953   ac_cv_prog_gcc=no
954 fi
955 fi
956
957 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
958
959 if test $ac_cv_prog_gcc = yes; then
960   GCC=yes
961 else
962   GCC=
963 fi
964
965 ac_test_CFLAGS="${CFLAGS+set}"
966 ac_save_CFLAGS="$CFLAGS"
967 CFLAGS=
968 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
969 echo "configure:970: checking whether ${CC-cc} accepts -g" >&5
970 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
971   echo $ac_n "(cached) $ac_c" 1>&6
972 else
973   echo 'void f(){}' > conftest.c
974 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
975   ac_cv_prog_cc_g=yes
976 else
977   ac_cv_prog_cc_g=no
978 fi
979 rm -f conftest*
980
981 fi
982
983 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
984 if test "$ac_test_CFLAGS" = set; then
985   CFLAGS="$ac_save_CFLAGS"
986 elif test $ac_cv_prog_cc_g = yes; then
987   if test "$GCC" = yes; then
988     CFLAGS="-g -O2"
989   else
990     CFLAGS="-g"
991   fi
992 else
993   if test "$GCC" = yes; then
994     CFLAGS="-O2"
995   else
996     CFLAGS=
997   fi
998 fi
999
1000 if test -n "$GCC" ; then
1001 echo $ac_n "checking version of gcc""... $ac_c" 1>&6
1002 echo "configure:1003: checking version of gcc" >&5
1003 eval "$CC --version"
1004 fi
1005 if test $host != $build; then
1006   for ac_prog in $CC gcc cc
1007 do
1008 # Extract the first word of "$ac_prog", so it can be a program name with args.
1009 set dummy $ac_prog; ac_word=$2
1010 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1011 echo "configure:1012: checking for $ac_word" >&5
1012 if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
1013   echo $ac_n "(cached) $ac_c" 1>&6
1014 else
1015   if test -n "$BUILD_CC"; then
1016   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
1017 else
1018   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1019   ac_dummy="$PATH"
1020   for ac_dir in $ac_dummy; do
1021     test -z "$ac_dir" && ac_dir=.
1022     if test -f $ac_dir/$ac_word; then
1023       ac_cv_prog_BUILD_CC="$ac_prog"
1024       break
1025     fi
1026   done
1027   IFS="$ac_save_ifs"
1028 fi
1029 fi
1030 BUILD_CC="$ac_cv_prog_BUILD_CC"
1031 if test -n "$BUILD_CC"; then
1032   echo "$ac_t""$BUILD_CC" 1>&6
1033 else
1034   echo "$ac_t""no" 1>&6
1035 fi
1036
1037 test -n "$BUILD_CC" && break
1038 done
1039
1040 fi
1041 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1042 echo "configure:1043: checking how to run the C preprocessor" >&5
1043 # On Suns, sometimes $CPP names a directory.
1044 if test -n "$CPP" && test -d "$CPP"; then
1045   CPP=
1046 fi
1047 if test -z "$CPP"; then
1048 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1049   echo $ac_n "(cached) $ac_c" 1>&6
1050 else
1051     # This must be in double quotes, not single quotes, because CPP may get
1052   # substituted into the Makefile and "${CC-cc}" will confuse make.
1053   CPP="${CC-cc} -E"
1054   # On the NeXT, cc -E runs the code through the compiler's parser,
1055   # not just through cpp.
1056   cat > conftest.$ac_ext <<EOF
1057 #line 1058 "configure"
1058 #include "confdefs.h"
1059 #include <assert.h>
1060 Syntax Error
1061 EOF
1062 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1063 { (eval echo configure:1064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1064 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1065 if test -z "$ac_err"; then
1066   :
1067 else
1068   echo "$ac_err" >&5
1069   echo "configure: failed program was:" >&5
1070   cat conftest.$ac_ext >&5
1071   rm -rf conftest*
1072   CPP="${CC-cc} -E -traditional-cpp"
1073   cat > conftest.$ac_ext <<EOF
1074 #line 1075 "configure"
1075 #include "confdefs.h"
1076 #include <assert.h>
1077 Syntax Error
1078 EOF
1079 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1080 { (eval echo configure:1081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1081 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1082 if test -z "$ac_err"; then
1083   :
1084 else
1085   echo "$ac_err" >&5
1086   echo "configure: failed program was:" >&5
1087   cat conftest.$ac_ext >&5
1088   rm -rf conftest*
1089   CPP="${CC-cc} -nologo -E"
1090   cat > conftest.$ac_ext <<EOF
1091 #line 1092 "configure"
1092 #include "confdefs.h"
1093 #include <assert.h>
1094 Syntax Error
1095 EOF
1096 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1097 { (eval echo configure:1098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1098 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1099 if test -z "$ac_err"; then
1100   :
1101 else
1102   echo "$ac_err" >&5
1103   echo "configure: failed program was:" >&5
1104   cat conftest.$ac_ext >&5
1105   rm -rf conftest*
1106   CPP=/lib/cpp
1107 fi
1108 rm -f conftest*
1109 fi
1110 rm -f conftest*
1111 fi
1112 rm -f conftest*
1113   ac_cv_prog_CPP="$CPP"
1114 fi
1115   CPP="$ac_cv_prog_CPP"
1116 else
1117   ac_cv_prog_CPP="$CPP"
1118 fi
1119 echo "$ac_t""$CPP" 1>&6
1120
1121 if test $ac_cv_prog_gcc = yes; then
1122     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
1123 echo "configure:1124: checking whether ${CC-cc} needs -traditional" >&5
1124 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
1125   echo $ac_n "(cached) $ac_c" 1>&6
1126 else
1127     ac_pattern="Autoconf.*'x'"
1128   cat > conftest.$ac_ext <<EOF
1129 #line 1130 "configure"
1130 #include "confdefs.h"
1131 #include <sgtty.h>
1132 Autoconf TIOCGETP
1133 EOF
1134 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1135   egrep "$ac_pattern" >/dev/null 2>&1; then
1136   rm -rf conftest*
1137   ac_cv_prog_gcc_traditional=yes
1138 else
1139   rm -rf conftest*
1140   ac_cv_prog_gcc_traditional=no
1141 fi
1142 rm -f conftest*
1143
1144
1145   if test $ac_cv_prog_gcc_traditional = no; then
1146     cat > conftest.$ac_ext <<EOF
1147 #line 1148 "configure"
1148 #include "confdefs.h"
1149 #include <termio.h>
1150 Autoconf TCGETA
1151 EOF
1152 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1153   egrep "$ac_pattern" >/dev/null 2>&1; then
1154   rm -rf conftest*
1155   ac_cv_prog_gcc_traditional=yes
1156 fi
1157 rm -f conftest*
1158
1159   fi
1160 fi
1161
1162 echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
1163   if test $ac_cv_prog_gcc_traditional = yes; then
1164     CC="$CC -traditional"
1165   fi
1166 fi
1167
1168 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
1169 echo "configure:1170: checking for POSIXized ISC" >&5
1170 if test -d /etc/conf/kconfig.d &&
1171   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
1172 then
1173   echo "$ac_t""yes" 1>&6
1174   ISC=yes # If later tests want to check for ISC.
1175   cat >> confdefs.h <<\EOF
1176 #define _POSIX_SOURCE 1
1177 EOF
1178
1179   if test "$GCC" = yes; then
1180     CC="$CC -posix"
1181   else
1182     CC="$CC -Xp"
1183   fi
1184 else
1185   echo "$ac_t""no" 1>&6
1186   ISC=
1187 fi
1188
1189
1190 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1191 echo "configure:1192: checking for ${CC-cc} option to accept ANSI C" >&5
1192 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
1193   echo $ac_n "(cached) $ac_c" 1>&6
1194 else
1195   
1196 cf_cv_ansi_cc=no
1197 cf_save_CFLAGS="$CFLAGS"
1198 # Don't try gcc -ansi; that turns off useful extensions and
1199 # breaks some systems' header files.
1200 # AIX                   -qlanglvl=ansi
1201 # Ultrix and OSF/1      -std1
1202 # HP-UX                 -Aa -D_HPUX_SOURCE
1203 # SVR4                  -Xc
1204 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
1205 for cf_arg in "-DCC_HAS_PROTOS" \
1206         "" \
1207         -qlanglvl=ansi \
1208         -std1 \
1209         -Ae \
1210         "-Aa -D_HPUX_SOURCE" \
1211         -Xc
1212 do
1213         CFLAGS="$cf_save_CFLAGS $cf_arg"
1214         cat > conftest.$ac_ext <<EOF
1215 #line 1216 "configure"
1216 #include "confdefs.h"
1217
1218 #ifndef CC_HAS_PROTOS
1219 #if !defined(__STDC__) || (__STDC__ != 1)
1220 choke me
1221 #endif
1222 #endif
1223
1224 int main() {
1225
1226         int test (int i, double x);
1227         struct s1 {int (*f) (int a);};
1228         struct s2 {int (*f) (double a);};
1229 ; return 0; }
1230 EOF
1231 if { (eval echo configure:1232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1232   rm -rf conftest*
1233   cf_cv_ansi_cc="$cf_arg"; break
1234 else
1235   echo "configure: failed program was:" >&5
1236   cat conftest.$ac_ext >&5
1237 fi
1238 rm -f conftest*
1239 done
1240 CFLAGS="$cf_save_CFLAGS"
1241
1242 fi
1243
1244 echo "$ac_t""$cf_cv_ansi_cc" 1>&6
1245
1246 if test "$cf_cv_ansi_cc" != "no"; then
1247 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1248         CFLAGS="$CFLAGS $cf_cv_ansi_cc"
1249 else
1250         cat >> confdefs.h <<\EOF
1251 #define CC_HAS_PROTOS 1
1252 EOF
1253
1254 fi
1255 fi
1256
1257
1258 if test "$cf_cv_ansi_cc" = "no"; then
1259         { echo "configure: error: Your compiler does not appear to recognize prototypes.
1260 You have the following choices:
1261         a. adjust your compiler options
1262         b. get an up-to-date compiler
1263         c. use a wrapper such as unproto" 1>&2; exit 1; }
1264 fi
1265
1266
1267
1268 PROG_EXT=
1269 case $cf_cv_system_name in
1270 os2*)
1271     # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
1272     CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__"
1273     CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__"
1274     LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"`
1275     PROG_EXT=".exe"
1276     ;;
1277 cygwin*)
1278     PROG_EXT=".exe"
1279     ;;
1280 esac
1281
1282
1283
1284 case "$cf_cv_system_name" in
1285 freebsd*) #(vi
1286   test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
1287   ;;
1288 *) LDPATH=$PATH:/sbin:/usr/sbin
1289   # Extract the first word of "ldconfig", so it can be a program name with args.
1290 set dummy ldconfig; ac_word=$2
1291 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1292 echo "configure:1293: checking for $ac_word" >&5
1293 if eval "test \"`echo '$''{'ac_cv_path_LDCONFIG'+set}'`\" = set"; then
1294   echo $ac_n "(cached) $ac_c" 1>&6
1295 else
1296   case "$LDCONFIG" in
1297   /*)
1298   ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a path.
1299   ;;
1300   ?:/*)                  
1301   ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a dos path.
1302   ;;
1303   *)
1304   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1305   ac_dummy="$LDPATH"
1306   for ac_dir in $ac_dummy; do 
1307     test -z "$ac_dir" && ac_dir=.
1308     if test -f $ac_dir/$ac_word; then
1309       ac_cv_path_LDCONFIG="$ac_dir/$ac_word"
1310       break
1311     fi
1312   done
1313   IFS="$ac_save_ifs"
1314   ;;
1315 esac
1316 fi
1317 LDCONFIG="$ac_cv_path_LDCONFIG"
1318 if test -n "$LDCONFIG"; then
1319   echo "$ac_t""$LDCONFIG" 1>&6
1320 else
1321   echo "$ac_t""no" 1>&6
1322 fi
1323
1324   ;;
1325 esac
1326
1327
1328 echo $ac_n "checking if you want to ensure bool is consistent with C++""... $ac_c" 1>&6
1329 echo "configure:1330: checking if you want to ensure bool is consistent with C++" >&5
1330
1331 # Check whether --with-cxx or --without-cxx was given.
1332 if test "${with_cxx+set}" = set; then
1333   withval="$with_cxx"
1334   cf_with_cxx=$withval
1335 else
1336   cf_with_cxx=yes
1337 fi
1338
1339 echo "$ac_t""$cf_with_cxx" 1>&6
1340 if test "X$cf_with_cxx" = Xno ; then
1341         CXX=""
1342         GXX=""
1343 else
1344                 for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
1345 do
1346 # Extract the first word of "$ac_prog", so it can be a program name with args.
1347 set dummy $ac_prog; ac_word=$2
1348 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1349 echo "configure:1350: checking for $ac_word" >&5
1350 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
1351   echo $ac_n "(cached) $ac_c" 1>&6
1352 else
1353   if test -n "$CXX"; then
1354   ac_cv_prog_CXX="$CXX" # Let the user override the test.
1355 else
1356   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1357   ac_dummy="$PATH"
1358   for ac_dir in $ac_dummy; do
1359     test -z "$ac_dir" && ac_dir=.
1360     if test -f $ac_dir/$ac_word; then
1361       ac_cv_prog_CXX="$ac_prog"
1362       break
1363     fi
1364   done
1365   IFS="$ac_save_ifs"
1366 fi
1367 fi
1368 CXX="$ac_cv_prog_CXX"
1369 if test -n "$CXX"; then
1370   echo "$ac_t""$CXX" 1>&6
1371 else
1372   echo "$ac_t""no" 1>&6
1373 fi
1374
1375 test -n "$CXX" && break
1376 done
1377 test -n "$CXX" || CXX="gcc"
1378
1379
1380 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1381 echo "configure:1382: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
1382
1383 ac_ext=C
1384 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1385 ac_cpp='$CXXCPP $CPPFLAGS'
1386 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1387 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1388 cross_compiling=$ac_cv_prog_cxx_cross
1389
1390 cat > conftest.$ac_ext << EOF
1391
1392 #line 1393 "configure"
1393 #include "confdefs.h"
1394
1395 int main(){return(0);}
1396 EOF
1397 if { (eval echo configure:1398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1398   ac_cv_prog_cxx_works=yes
1399   # If we can't run a trivial program, we are probably using a cross compiler.
1400   if (./conftest; exit) 2>/dev/null; then
1401     ac_cv_prog_cxx_cross=no
1402   else
1403     ac_cv_prog_cxx_cross=yes
1404   fi
1405 else
1406   echo "configure: failed program was:" >&5
1407   cat conftest.$ac_ext >&5
1408   ac_cv_prog_cxx_works=no
1409 fi
1410 rm -fr conftest*
1411 ac_ext=c
1412 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1413 ac_cpp='$CPP $CPPFLAGS'
1414 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1415 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1416 cross_compiling=$ac_cv_prog_cc_cross
1417
1418 echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
1419 if test $ac_cv_prog_cxx_works = no; then
1420   echo "$ac_t""You don't have any C++ compiler, too bad" 1>&6;          cf_with_cxx=no; CXX=""; GXX="";
1421 fi
1422 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1423 echo "configure:1424: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
1424 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
1425 cross_compiling=$ac_cv_prog_cxx_cross
1426
1427 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
1428 echo "configure:1429: checking whether we are using GNU C++" >&5
1429 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
1430   echo $ac_n "(cached) $ac_c" 1>&6
1431 else
1432   cat > conftest.C <<EOF
1433 #ifdef __GNUC__
1434   yes;
1435 #endif
1436 EOF
1437 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1438   ac_cv_prog_gxx=yes
1439 else
1440   ac_cv_prog_gxx=no
1441 fi
1442 fi
1443
1444 echo "$ac_t""$ac_cv_prog_gxx" 1>&6
1445
1446 if test $ac_cv_prog_gxx = yes; then
1447   GXX=yes
1448 else
1449   GXX=
1450 fi
1451
1452 ac_test_CXXFLAGS="${CXXFLAGS+set}"
1453 ac_save_CXXFLAGS="$CXXFLAGS"
1454 CXXFLAGS=
1455 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
1456 echo "configure:1457: checking whether ${CXX-g++} accepts -g" >&5
1457 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
1458   echo $ac_n "(cached) $ac_c" 1>&6
1459 else
1460   echo 'void f(){}' > conftest.cc
1461 if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
1462   ac_cv_prog_cxx_g=yes
1463 else
1464   ac_cv_prog_cxx_g=no
1465 fi
1466 rm -f conftest*
1467
1468 fi
1469
1470 echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
1471 if test "$ac_test_CXXFLAGS" = set; then
1472   CXXFLAGS="$ac_save_CXXFLAGS"
1473 elif test $ac_cv_prog_cxx_g = yes; then
1474   if test "$GXX" = yes; then
1475     CXXFLAGS="-g -O2"
1476   else
1477     CXXFLAGS="-g"
1478   fi
1479 else
1480   if test "$GXX" = yes; then
1481     CXXFLAGS="-O2"
1482   else
1483     CXXFLAGS=
1484   fi
1485 fi
1486
1487         fi
1488 if test -n "$GXX" ; then case "`${CXX-g++} --version`" in 1*|2.[0-6]*) GXX=""; CXX=""; ac_cv_prog_gxx=no; cf_cxx_library=no ; echo No: templates do not work;; esac; fi
1489
1490 echo $ac_n "checking if you want to build C++ binding and demo""... $ac_c" 1>&6
1491 echo "configure:1492: checking if you want to build C++ binding and demo" >&5
1492
1493 # Check whether --with-cxx-binding or --without-cxx-binding was given.
1494 if test "${with_cxx_binding+set}" = set; then
1495   withval="$with_cxx_binding"
1496   cf_with_cxx_binding=$withval
1497 else
1498   cf_with_cxx_binding=$cf_with_cxx
1499 fi
1500
1501 echo "$ac_t""$cf_with_cxx_binding" 1>&6
1502
1503 echo $ac_n "checking if you want to build with Ada95""... $ac_c" 1>&6
1504 echo "configure:1505: checking if you want to build with Ada95" >&5
1505
1506 # Check whether --with-ada or --without-ada was given.
1507 if test "${with_ada+set}" = set; then
1508   withval="$with_ada"
1509   cf_with_ada=$withval
1510 else
1511   cf_with_ada=yes
1512 fi
1513
1514 echo "$ac_t""$cf_with_ada" 1>&6
1515
1516 echo $ac_n "checking if you want to build programs such as tic""... $ac_c" 1>&6
1517 echo "configure:1518: checking if you want to build programs such as tic" >&5
1518
1519 # Check whether --with-progs or --without-progs was given.
1520 if test "${with_progs+set}" = set; then
1521   withval="$with_progs"
1522   cf_with_progs=$withval
1523 else
1524   cf_with_progs=yes
1525 fi
1526
1527 echo "$ac_t""$cf_with_progs" 1>&6
1528
1529 modules_to_build="ncurses"
1530 if test "X$cf_with_progs" != Xno ; then
1531 modules_to_build="$modules_to_build progs tack"
1532 fi
1533 modules_to_build="$modules_to_build panel menu form"
1534
1535 for ac_prog in mawk gawk nawk awk
1536 do
1537 # Extract the first word of "$ac_prog", so it can be a program name with args.
1538 set dummy $ac_prog; ac_word=$2
1539 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1540 echo "configure:1541: checking for $ac_word" >&5
1541 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
1542   echo $ac_n "(cached) $ac_c" 1>&6
1543 else
1544   if test -n "$AWK"; then
1545   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1546 else
1547   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1548   ac_dummy="$PATH"
1549   for ac_dir in $ac_dummy; do
1550     test -z "$ac_dir" && ac_dir=.
1551     if test -f $ac_dir/$ac_word; then
1552       ac_cv_prog_AWK="$ac_prog"
1553       break
1554     fi
1555   done
1556   IFS="$ac_save_ifs"
1557 fi
1558 fi
1559 AWK="$ac_cv_prog_AWK"
1560 if test -n "$AWK"; then
1561   echo "$ac_t""$AWK" 1>&6
1562 else
1563   echo "$ac_t""no" 1>&6
1564 fi
1565
1566 test -n "$AWK" && break
1567 done
1568
1569 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1570 echo "configure:1571: checking whether ${MAKE-make} sets \${MAKE}" >&5
1571 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1572 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1573   echo $ac_n "(cached) $ac_c" 1>&6
1574 else
1575   cat > conftestmake <<\EOF
1576 all:
1577         @echo 'ac_maketemp="${MAKE}"'
1578 EOF
1579 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1580 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1581 if test -n "$ac_maketemp"; then
1582   eval ac_cv_prog_make_${ac_make}_set=yes
1583 else
1584   eval ac_cv_prog_make_${ac_make}_set=no
1585 fi
1586 rm -f conftestmake
1587 fi
1588 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1589   echo "$ac_t""yes" 1>&6
1590   SET_MAKE=
1591 else
1592   echo "$ac_t""no" 1>&6
1593   SET_MAKE="MAKE=${MAKE-make}"
1594 fi
1595
1596 # Find a good install program.  We prefer a C program (faster),
1597 # so one script is as good as another.  But avoid the broken or
1598 # incompatible versions:
1599 # SysV /etc/install, /usr/sbin/install
1600 # SunOS /usr/etc/install
1601 # IRIX /sbin/install
1602 # AIX /bin/install
1603 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1604 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1605 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1606 # ./install, which can be erroneously created by make from ./install.sh.
1607 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1608 echo "configure:1609: checking for a BSD compatible install" >&5
1609 if test -z "$INSTALL"; then
1610 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1611   echo $ac_n "(cached) $ac_c" 1>&6
1612 else
1613     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1614   for ac_dir in $PATH; do
1615     # Account for people who put trailing slashes in PATH elements.
1616     case "$ac_dir/" in
1617     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1618     *)
1619       # OSF1 and SCO ODT 3.0 have their own names for install.
1620       # Don't use installbsd from OSF since it installs stuff as root
1621       # by default.
1622       for ac_prog in ginstall scoinst install; do
1623         if test -f $ac_dir/$ac_prog; then
1624           if test $ac_prog = install &&
1625             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1626             # AIX install.  It has an incompatible calling convention.
1627             :
1628           else
1629             ac_cv_path_install="$ac_dir/$ac_prog -c"
1630             break 2
1631           fi
1632         fi
1633       done
1634       ;;
1635     esac
1636   done
1637   IFS="$ac_save_IFS"
1638
1639 fi
1640   if test "${ac_cv_path_install+set}" = set; then
1641     INSTALL="$ac_cv_path_install"
1642   else
1643     # As a last resort, use the slow shell script.  We don't cache a
1644     # path for INSTALL within a source directory, because that will
1645     # break other packages using the cache if that directory is
1646     # removed, or if the path is relative.
1647     INSTALL="$ac_install_sh"
1648   fi
1649 fi
1650 echo "$ac_t""$INSTALL" 1>&6
1651
1652 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1653 # It thinks the first close brace ends the variable substitution.
1654 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1655
1656 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1657
1658 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1659
1660 case $INSTALL in
1661 /*)
1662   ;;
1663 *)
1664   cf_dir=`echo $INSTALL|sed -e 's%/[^/]*$%%'`
1665   test -z "$cf_dir" && cf_dir=.
1666   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's:^.*/::'`
1667   ;;
1668 esac
1669
1670 echo $ac_n "checking for long file names""... $ac_c" 1>&6
1671 echo "configure:1672: checking for long file names" >&5
1672 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
1673   echo $ac_n "(cached) $ac_c" 1>&6
1674 else
1675   ac_cv_sys_long_file_names=yes
1676 # Test for long file names in all the places we know might matter:
1677 #      .                the current directory, where building will happen
1678 #      $prefix/lib      where we will be installing things
1679 #      $exec_prefix/lib likewise
1680 # eval it to expand exec_prefix.
1681 #      $TMPDIR          if set, where it might want to write temporary files
1682 # if $TMPDIR is not set:
1683 #      /tmp             where it might want to write temporary files
1684 #      /var/tmp         likewise
1685 #      /usr/tmp         likewise
1686 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
1687   ac_tmpdirs="$TMPDIR"
1688 else
1689   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
1690 fi
1691 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
1692   test -d $ac_dir || continue
1693   test -w $ac_dir || continue # It is less confusing to not echo anything here.
1694   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
1695   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
1696   val=`cat $ac_dir/conftest9012345 2>/dev/null`
1697   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
1698     ac_cv_sys_long_file_names=no
1699     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
1700     break
1701   fi
1702   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
1703 done
1704 fi
1705
1706 echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
1707 if test $ac_cv_sys_long_file_names = yes; then
1708   cat >> confdefs.h <<\EOF
1709 #define HAVE_LONG_FILE_NAMES 1
1710 EOF
1711
1712 fi
1713
1714 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1715 echo "configure:1716: checking whether ln -s works" >&5
1716 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1717   echo $ac_n "(cached) $ac_c" 1>&6
1718 else
1719   rm -f conftestdata
1720 if ln -s X conftestdata 2>/dev/null
1721 then
1722   rm -f conftestdata
1723   ac_cv_prog_LN_S="ln -s"
1724 else
1725   ac_cv_prog_LN_S=ln
1726 fi
1727 fi
1728 LN_S="$ac_cv_prog_LN_S"
1729 if test "$ac_cv_prog_LN_S" = "ln -s"; then
1730   echo "$ac_t""yes" 1>&6
1731 else
1732   echo "$ac_t""no" 1>&6
1733 fi
1734
1735 # Extract the first word of "ranlib", so it can be a program name with args.
1736 set dummy ranlib; ac_word=$2
1737 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1738 echo "configure:1739: checking for $ac_word" >&5
1739 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1740   echo $ac_n "(cached) $ac_c" 1>&6
1741 else
1742   if test -n "$RANLIB"; then
1743   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1744 else
1745   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1746   ac_dummy="$PATH"
1747   for ac_dir in $ac_dummy; do
1748     test -z "$ac_dir" && ac_dir=.
1749     if test -f $ac_dir/$ac_word; then
1750       ac_cv_prog_RANLIB="ranlib"
1751       break
1752     fi
1753   done
1754   IFS="$ac_save_ifs"
1755   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1756 fi
1757 fi
1758 RANLIB="$ac_cv_prog_RANLIB"
1759 if test -n "$RANLIB"; then
1760   echo "$ac_t""$RANLIB" 1>&6
1761 else
1762   echo "$ac_t""no" 1>&6
1763 fi
1764
1765 for ac_prog in tdlint lint alint
1766 do
1767 # Extract the first word of "$ac_prog", so it can be a program name with args.
1768 set dummy $ac_prog; ac_word=$2
1769 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1770 echo "configure:1771: checking for $ac_word" >&5
1771 if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then
1772   echo $ac_n "(cached) $ac_c" 1>&6
1773 else
1774   if test -n "$LINT"; then
1775   ac_cv_prog_LINT="$LINT" # Let the user override the test.
1776 else
1777   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1778   ac_dummy="$PATH"
1779   for ac_dir in $ac_dummy; do
1780     test -z "$ac_dir" && ac_dir=.
1781     if test -f $ac_dir/$ac_word; then
1782       ac_cv_prog_LINT="$ac_prog"
1783       break
1784     fi
1785   done
1786   IFS="$ac_save_ifs"
1787 fi
1788 fi
1789 LINT="$ac_cv_prog_LINT"
1790 if test -n "$LINT"; then
1791   echo "$ac_t""$LINT" 1>&6
1792 else
1793   echo "$ac_t""no" 1>&6
1794 fi
1795
1796 test -n "$LINT" && break
1797 done
1798
1799 for ac_prog in man man_db
1800 do
1801 # Extract the first word of "$ac_prog", so it can be a program name with args.
1802 set dummy $ac_prog; ac_word=$2
1803 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1804 echo "configure:1805: checking for $ac_word" >&5
1805 if eval "test \"`echo '$''{'ac_cv_prog_MAN'+set}'`\" = set"; then
1806   echo $ac_n "(cached) $ac_c" 1>&6
1807 else
1808   if test -n "$MAN"; then
1809   ac_cv_prog_MAN="$MAN" # Let the user override the test.
1810 else
1811   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1812   ac_dummy="$PATH"
1813   for ac_dir in $ac_dummy; do
1814     test -z "$ac_dir" && ac_dir=.
1815     if test -f $ac_dir/$ac_word; then
1816       ac_cv_prog_MAN="$ac_prog"
1817       break
1818     fi
1819   done
1820   IFS="$ac_save_ifs"
1821 fi
1822 fi
1823 MAN="$ac_cv_prog_MAN"
1824 if test -n "$MAN"; then
1825   echo "$ac_t""$MAN" 1>&6
1826 else
1827   echo "$ac_t""no" 1>&6
1828 fi
1829
1830 test -n "$MAN" && break
1831 done
1832
1833
1834
1835 if eval "test \"`echo '$''{'cf_cv_subst_LD'+set}'`\" = set"; then
1836   echo $ac_n "(cached) $ac_c" 1>&6
1837 else
1838   
1839 echo $ac_n "checking for loader (symbol LD)""... $ac_c" 1>&6
1840 echo "configure:1841: checking for loader (symbol LD)" >&5
1841 test -z "$LD" && LD=ld
1842 echo "$ac_t""$LD" 1>&6
1843
1844 cf_cv_subst_LD=$LD
1845 fi
1846
1847 LD=${cf_cv_subst_LD}
1848
1849 if eval "test \"`echo '$''{'cf_cv_subst_AR'+set}'`\" = set"; then
1850   echo $ac_n "(cached) $ac_c" 1>&6
1851 else
1852   
1853 echo $ac_n "checking for archiver (symbol AR)""... $ac_c" 1>&6
1854 echo "configure:1855: checking for archiver (symbol AR)" >&5
1855 test -z "$AR" && AR=ar
1856 echo "$ac_t""$AR" 1>&6
1857
1858 cf_cv_subst_AR=$AR
1859 fi
1860
1861 AR=${cf_cv_subst_AR}
1862
1863 if eval "test \"`echo '$''{'cf_cv_subst_AR_OPTS'+set}'`\" = set"; then
1864   echo $ac_n "(cached) $ac_c" 1>&6
1865 else
1866   
1867 echo $ac_n "checking for archiver options (symbol AR_OPTS)""... $ac_c" 1>&6
1868 echo "configure:1869: checking for archiver options (symbol AR_OPTS)" >&5
1869 test -z "$AR_OPTS" && AR_OPTS=rv
1870 echo "$ac_t""$AR_OPTS" 1>&6
1871
1872 cf_cv_subst_AR_OPTS=$AR_OPTS
1873 fi
1874
1875 AR_OPTS=${cf_cv_subst_AR_OPTS}
1876
1877
1878
1879 echo $ac_n "checking for makeflags variable""... $ac_c" 1>&6
1880 echo "configure:1881: checking for makeflags variable" >&5
1881 if eval "test \"`echo '$''{'cf_cv_makeflags'+set}'`\" = set"; then
1882   echo $ac_n "(cached) $ac_c" 1>&6
1883 else
1884   
1885         cf_cv_makeflags=''
1886         for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
1887         do
1888                 cat >cf_makeflags.tmp <<CF_EOF
1889 all :
1890         @ echo '.$cf_option'
1891 CF_EOF
1892                 cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null`
1893                 case "$cf_result" in
1894                 .*k)
1895                         cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
1896                         case "$cf_result" in
1897                         .*CC=*) cf_cv_makeflags=
1898                                 ;;
1899                         *)      cf_cv_makeflags=$cf_option
1900                                 ;;
1901                         esac
1902                         break
1903                         ;;
1904                 *)      echo no match "$cf_result"
1905                         ;;
1906                 esac
1907         done
1908         rm -f cf_makeflags.tmp
1909 fi
1910
1911 echo "$ac_t""$cf_cv_makeflags" 1>&6
1912
1913
1914
1915 echo $ac_n "checking if you have specified an install-prefix""... $ac_c" 1>&6
1916 echo "configure:1917: checking if you have specified an install-prefix" >&5
1917
1918 # Check whether --with-install-prefix or --without-install-prefix was given.
1919 if test "${with_install_prefix+set}" = set; then
1920   withval="$with_install_prefix"
1921   case "$withval" in #(vi
1922         yes|no) #(vi
1923                 ;;
1924         *)      INSTALL_PREFIX="$withval"
1925                 ;;
1926         esac
1927 fi
1928
1929 echo "$ac_t""$INSTALL_PREFIX" 1>&6
1930
1931
1932 ###############################################################################
1933
1934
1935  echo $ac_n "checking format of man-pages""... $ac_c" 1>&6
1936 echo "configure:1937: checking format of man-pages" >&5
1937
1938
1939 # Check whether --with-manpage-format or --without-manpage-format was given.
1940 if test "${with_manpage_format+set}" = set; then
1941   withval="$with_manpage_format"
1942   cf_manpage_form=$withval
1943 else
1944   cf_manpage_form=unknown
1945 fi
1946
1947
1948 case ".$cf_manpage_form" in
1949 .gzip|.compress|.BSDI|.normal|.formatted) # (vi
1950   ;;
1951 .unknown|.) # (vi
1952   if test -z "$MANPATH" ; then
1953     MANPATH="/usr/man:/usr/share/man"
1954   fi
1955   # look for the 'date' man-page (it's most likely to be installed!)
1956   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1957   cf_manpage_form=unknown
1958   for cf_dir in $MANPATH; do
1959     test -z "$cf_dir" && cf_dir=/usr/man
1960     for cf_name in $cf_dir/*/date.[01]* $cf_dir/*/date
1961     do
1962        cf_test=`echo $cf_name | sed -e 's/*//'`
1963        if test "x$cf_test" = "x$cf_name" ; then
1964           case "$cf_name" in
1965           *.gz) cf_manpage_form=gzip;;
1966           *.Z)  cf_manpage_form=compress;;
1967           *.0)  cf_manpage_form=BSDI,formatted;;
1968           *)    cf_manpage_form=normal;;
1969           esac
1970           break
1971        fi
1972     done
1973     if test "$cf_manpage_form" != "unknown" ; then
1974        break
1975     fi
1976   done
1977   IFS="$ac_save_ifs"
1978   ;;
1979 .*) # (vi
1980   echo "configure: warning: Unexpected manpage-format" 1>&2
1981   ;;
1982 esac
1983
1984 echo "$ac_t""$cf_manpage_form" 1>&6
1985
1986
1987 echo $ac_n "checking for manpage renaming""... $ac_c" 1>&6
1988 echo "configure:1989: checking for manpage renaming" >&5
1989
1990
1991 # Check whether --with-manpage-renames or --without-manpage-renames was given.
1992 if test "${with_manpage_renames+set}" = set; then
1993   withval="$with_manpage_renames"
1994   cf_manpage_renames=$withval
1995 else
1996   cf_manpage_renames=yes
1997 fi
1998
1999
2000 case ".$cf_manpage_renames" in #(vi
2001 .no) #(vi
2002   ;;
2003 .|.yes)
2004   # Debian 'man' program?
2005   if test -f /etc/debian_version ; then
2006     cf_manpage_renames=`cd $srcdir && pwd`/man/man_db.renames
2007   else
2008     cf_manpage_renames=no
2009   fi
2010   ;;
2011 esac
2012
2013 if test "$cf_manpage_renames" != no ; then
2014   if test ! -f $cf_manpage_renames ; then
2015     { echo "configure: error: not a filename: $cf_manpage_renames" 1>&2; exit 1; }
2016   fi
2017
2018   test ! -d man && mkdir man
2019
2020   # Construct a sed-script to perform renaming within man-pages
2021   if test -n "$cf_manpage_renames" ; then
2022     test ! -d man && mkdir man
2023     $srcdir/man/make_sed.sh $cf_manpage_renames >man/edit_man.sed
2024   fi
2025 fi
2026
2027 echo "$ac_t""$cf_manpage_renames" 1>&6
2028
2029
2030 echo $ac_n "checking for manpage symlinks""... $ac_c" 1>&6
2031 echo "configure:2032: checking for manpage symlinks" >&5
2032
2033
2034 # Check whether --with-manpage-symlinks or --without-manpage-symlinks was given.
2035 if test "${with_manpage_symlinks+set}" = set; then
2036   withval="$with_manpage_symlinks"
2037   cf_manpage_symlinks=$withval
2038 else
2039   cf_manpage_symlinks=yes
2040 fi
2041
2042
2043 echo "$ac_t""$cf_manpage_symlinks" 1>&6
2044
2045
2046   if test "$prefix" = "NONE" ; then
2047      cf_prefix="$ac_default_prefix"
2048   else
2049      cf_prefix="$prefix"
2050   fi
2051
2052   case "$cf_manpage_form" in # (vi
2053   *formatted*) # (vi
2054     cf_subdir='$mandir/cat'
2055     cf_format=yes
2056     ;;
2057   *)
2058     cf_subdir='$mandir/man'
2059     cf_format=no
2060     ;;
2061   esac
2062
2063 test ! -d man && mkdir man
2064 cat >man/edit_man.sh <<CF_EOF
2065 #! /bin/sh
2066 # this script is generated by the configure-script
2067 prefix="$cf_prefix"
2068 datadir="$datadir"
2069 MKDIRS="`cd $srcdir && pwd`/mkinstalldirs"
2070 INSTALL="$INSTALL"
2071 INSTALL_DATA="$INSTALL_DATA"
2072
2073 TMP=\${TMPDIR-/tmp}/man\$\$
2074 trap "rm -f \$TMP" 0 1 2 5 15
2075
2076 verb=\$1
2077 shift
2078
2079 mandir=\$1
2080 shift
2081
2082 srcdir=\$1
2083 shift
2084
2085 for i in \$* ; do
2086 case \$i in #(vi
2087 *.orig|*.rej) ;; #(vi
2088 *.[0-9]*)
2089         section=\`expr "\$i" : '.*\\.\\([0-9]\\)[xm]*'\`;
2090         if test \$verb = installing ; then
2091         if test ! -d $cf_subdir\${section} ; then
2092                 \$MKDIRS $cf_subdir\$section
2093         fi
2094         fi
2095         aliases=
2096         source=\`basename \$i\`
2097 CF_EOF
2098 if test "$cf_manpage_symlinks" = yes ; then
2099 cat >>man/edit_man.sh <<CF_EOF
2100         aliases=\`sed -f \$srcdir/manlinks.sed \$source | sort -u\`
2101 CF_EOF
2102 fi
2103 if test "$cf_manpage_renames" = no ; then
2104 cat >>man/edit_man.sh <<CF_EOF
2105         target=$cf_subdir\${section}/\$source
2106         sed -e "s,@DATADIR@,\$datadir," < \$i >\$TMP
2107 CF_EOF
2108 else
2109 cat >>man/edit_man.sh <<CF_EOF
2110         target=\`grep "^\$source" $cf_manpage_renames | $AWK '{print \$2}'\`
2111         if test -z "\$target" ; then
2112                 echo '? missing rename for '\$source
2113                 target="\$source"
2114         fi
2115         target="$cf_subdir\$section/\$target"
2116         test \$verb = installing && sed -e "s,@DATADIR@,\$datadir," < \$i | sed -f edit_man.sed >\$TMP
2117 CF_EOF
2118 fi
2119 if test $cf_format = yes ; then
2120 cat >>man/edit_man.sh <<CF_EOF
2121         nroff -man \$TMP >\$TMP.out
2122         mv \$TMP.out \$TMP
2123 CF_EOF
2124 fi
2125 case "$cf_manpage_form" in #(vi
2126 *compress*) #(vi
2127 cat >>man/edit_man.sh <<CF_EOF
2128         if test \$verb = installing ; then
2129         if ( compress -f \$TMP )
2130         then
2131                 mv \$TMP.Z \$TMP
2132         fi
2133         fi
2134         target="\$target.Z"
2135 CF_EOF
2136   ;;
2137 *gzip*) #(vi
2138 cat >>man/edit_man.sh <<CF_EOF
2139         if test \$verb = installing ; then
2140         if ( gzip -f \$TMP )
2141         then
2142                 mv \$TMP.gz \$TMP
2143         fi
2144         fi
2145         target="\$target.gz"
2146 CF_EOF
2147   ;;
2148 *BSDI*)
2149 cat >>man/edit_man.sh <<CF_EOF
2150         # BSDI installs only .0 suffixes in the cat directories
2151         target="\`echo \$target|sed -e 's/\.[1-9]\+.\?/.0/'\`"
2152 CF_EOF
2153   ;;
2154 esac
2155 cat >>man/edit_man.sh <<CF_EOF
2156         echo \$verb \$target
2157         suffix=\`basename \$target | sed -e 's/^[^.]*//'\`
2158         if test \$verb = installing ; then
2159                 \$INSTALL_DATA \$TMP \$target
2160                 test -n "\$aliases" && (
2161                         cd $cf_subdir\${section} && (
2162                                 target=\`basename \$target\`
2163                                 for cf_alias in \$aliases
2164                                 do
2165                                         if test -f \$cf_alias\${suffix} ; then
2166                                                 if ( cmp -s \$target \$cf_alias\${suffix} )
2167                                                 then
2168                                                         :
2169                                                 else
2170                                                         echo .. \$verb alias \$cf_alias\${suffix}
2171                                                         rm -f \$cf_alias\${suffix}
2172                                                         $LN_S \$target \$cf_alias\${suffix}
2173                                                 fi
2174                                         else
2175                                                 echo .. \$verb alias \$cf_alias\${suffix}
2176                                                 rm -f \$cf_alias\${suffix}
2177                                                 $LN_S \$target \$cf_alias\${suffix}
2178                                         fi
2179                                 done
2180                         )
2181                 )
2182         else
2183                 rm -f \$target
2184                 test -n "\$aliases" && (
2185                         cd $cf_subdir\${section} && (
2186                                 for cf_alias in \$aliases
2187                                 do
2188                                         echo .. \$verb alias \$cf_alias\${suffix}
2189                                         rm -f \$cf_alias\${suffix}
2190                                 done
2191                         )
2192                 )
2193         fi
2194         ;;
2195 esac
2196 done
2197 exit 0
2198 CF_EOF
2199 chmod 755 man/edit_man.sh
2200
2201
2202
2203 ###############################################################################
2204
2205
2206 ### Options to allow the user to specify the set of libraries which are used.
2207 ### Use "--without-normal --with-shared" to allow the default model to be
2208 ### shared, for example.
2209 cf_list_models=""
2210
2211 echo $ac_n "checking if you want to build shared libraries""... $ac_c" 1>&6
2212 echo "configure:2213: checking if you want to build shared libraries" >&5
2213
2214 # Check whether --with-shared or --without-shared was given.
2215 if test "${with_shared+set}" = set; then
2216   withval="$with_shared"
2217   with_shared=$withval
2218 else
2219   with_shared=no
2220 fi
2221
2222 echo "$ac_t""$with_shared" 1>&6
2223 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
2224
2225 echo $ac_n "checking if you want to build static libraries""... $ac_c" 1>&6
2226 echo "configure:2227: checking if you want to build static libraries" >&5
2227
2228 # Check whether --with-normal or --without-normal was given.
2229 if test "${with_normal+set}" = set; then
2230   withval="$with_normal"
2231   with_normal=$withval
2232 else
2233   with_normal=yes
2234 fi
2235
2236 echo "$ac_t""$with_normal" 1>&6
2237 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
2238
2239 echo $ac_n "checking if you want to build debug libraries""... $ac_c" 1>&6
2240 echo "configure:2241: checking if you want to build debug libraries" >&5
2241
2242 # Check whether --with-debug or --without-debug was given.
2243 if test "${with_debug+set}" = set; then
2244   withval="$with_debug"
2245   with_debug=$withval
2246 else
2247   with_debug=yes
2248 fi
2249
2250 echo "$ac_t""$with_debug" 1>&6
2251 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
2252
2253 echo $ac_n "checking if you want to build profiling libraries""... $ac_c" 1>&6
2254 echo "configure:2255: checking if you want to build profiling libraries" >&5
2255
2256 # Check whether --with-profile or --without-profile was given.
2257 if test "${with_profile+set}" = set; then
2258   withval="$with_profile"
2259   with_profile=$withval
2260 else
2261   with_profile=no
2262 fi
2263
2264 echo "$ac_t""$with_profile" 1>&6
2265 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
2266
2267 ###############################################################################
2268
2269 echo $ac_n "checking for specified models""... $ac_c" 1>&6
2270 echo "configure:2271: checking for specified models" >&5
2271 test -z "$cf_list_models" && cf_list_models=normal
2272 echo "$ac_t""$cf_list_models" 1>&6
2273
2274 ### Use the first model as the default, and save its suffix for use in building
2275 ### up test-applications.
2276 echo $ac_n "checking for default model""... $ac_c" 1>&6
2277 echo "configure:2278: checking for default model" >&5
2278 DFT_LWR_MODEL=`echo $cf_list_models | $AWK '{print $1}'`
2279 echo "$ac_t""$DFT_LWR_MODEL" 1>&6
2280
2281
2282 DFT_UPR_MODEL=`echo $DFT_LWR_MODEL | tr '[a-z]' '[A-Z]'`
2283
2284
2285 TINFO_NAME=tinfo
2286
2287
2288 LIB_NAME=ncurses
2289
2290
2291 LIB_DIR=../lib
2292
2293         case $cf_cv_system_name in
2294         os2)    LIB_PREFIX=''     ;;
2295         *)      LIB_PREFIX='lib'  ;;
2296         esac
2297 cf_prefix=$LIB_PREFIX
2298         
2299
2300 LIB_PREFIX=$cf_prefix
2301
2302
2303 LIB_SUFFIX=
2304
2305
2306 ###############################################################################
2307
2308 echo $ac_n "checking if you want to build a separate terminfo library""... $ac_c" 1>&6
2309 echo "configure:2310: checking if you want to build a separate terminfo library" >&5
2310
2311 # Check whether --with-termlib or --without-termlib was given.
2312 if test "${with_termlib+set}" = set; then
2313   withval="$with_termlib"
2314   with_termlib=$withval
2315 else
2316   with_termlib=no
2317 fi
2318
2319 echo "$ac_t""$with_termlib" 1>&6
2320
2321 ### Checks for special libraries, must be done up-front.
2322 echo $ac_n "checking if you want to link with dbmalloc for testing""... $ac_c" 1>&6
2323 echo "configure:2324: checking if you want to link with dbmalloc for testing" >&5
2324
2325 # Check whether --with-dbmalloc or --without-dbmalloc was given.
2326 if test "${with_dbmalloc+set}" = set; then
2327   withval="$with_dbmalloc"
2328   with_dbmalloc=$withval
2329 else
2330   with_dbmalloc=no
2331 fi
2332
2333 echo "$ac_t""$with_dbmalloc" 1>&6
2334 if test $with_dbmalloc = yes ; then
2335         echo $ac_n "checking for debug_malloc in -ldbmalloc""... $ac_c" 1>&6
2336 echo "configure:2337: checking for debug_malloc in -ldbmalloc" >&5
2337 ac_lib_var=`echo dbmalloc'_'debug_malloc | sed 'y%./+-%__p_%'`
2338 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2339   echo $ac_n "(cached) $ac_c" 1>&6
2340 else
2341   ac_save_LIBS="$LIBS"
2342 LIBS="-ldbmalloc  $LIBS"
2343 cat > conftest.$ac_ext <<EOF
2344 #line 2345 "configure"
2345 #include "confdefs.h"
2346 /* Override any gcc2 internal prototype to avoid an error.  */
2347 /* We use char because int might match the return type of a gcc2
2348     builtin and then its argument prototype would still apply.  */
2349 char debug_malloc();
2350
2351 int main() {
2352 debug_malloc()
2353 ; return 0; }
2354 EOF
2355 if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2356   rm -rf conftest*
2357   eval "ac_cv_lib_$ac_lib_var=yes"
2358 else
2359   echo "configure: failed program was:" >&5
2360   cat conftest.$ac_ext >&5
2361   rm -rf conftest*
2362   eval "ac_cv_lib_$ac_lib_var=no"
2363 fi
2364 rm -f conftest*
2365 LIBS="$ac_save_LIBS"
2366
2367 fi
2368 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2369   echo "$ac_t""yes" 1>&6
2370     ac_tr_lib=HAVE_LIB`echo dbmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2371     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2372   cat >> confdefs.h <<EOF
2373 #define $ac_tr_lib 1
2374 EOF
2375
2376   LIBS="-ldbmalloc $LIBS"
2377
2378 else
2379   echo "$ac_t""no" 1>&6
2380 fi
2381
2382 fi
2383
2384 echo $ac_n "checking if you want to link with dmalloc for testing""... $ac_c" 1>&6
2385 echo "configure:2386: checking if you want to link with dmalloc for testing" >&5
2386
2387 # Check whether --with-dmalloc or --without-dmalloc was given.
2388 if test "${with_dmalloc+set}" = set; then
2389   withval="$with_dmalloc"
2390   with_dmalloc=$withval
2391 else
2392   with_dmalloc=no
2393 fi
2394
2395 echo "$ac_t""$with_dmalloc" 1>&6
2396 if test $with_dmalloc = yes ; then
2397         echo $ac_n "checking for dmalloc_debug in -ldmalloc""... $ac_c" 1>&6
2398 echo "configure:2399: checking for dmalloc_debug in -ldmalloc" >&5
2399 ac_lib_var=`echo dmalloc'_'dmalloc_debug | sed 'y%./+-%__p_%'`
2400 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2401   echo $ac_n "(cached) $ac_c" 1>&6
2402 else
2403   ac_save_LIBS="$LIBS"
2404 LIBS="-ldmalloc  $LIBS"
2405 cat > conftest.$ac_ext <<EOF
2406 #line 2407 "configure"
2407 #include "confdefs.h"
2408 /* Override any gcc2 internal prototype to avoid an error.  */
2409 /* We use char because int might match the return type of a gcc2
2410     builtin and then its argument prototype would still apply.  */
2411 char dmalloc_debug();
2412
2413 int main() {
2414 dmalloc_debug()
2415 ; return 0; }
2416 EOF
2417 if { (eval echo configure:2418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2418   rm -rf conftest*
2419   eval "ac_cv_lib_$ac_lib_var=yes"
2420 else
2421   echo "configure: failed program was:" >&5
2422   cat conftest.$ac_ext >&5
2423   rm -rf conftest*
2424   eval "ac_cv_lib_$ac_lib_var=no"
2425 fi
2426 rm -f conftest*
2427 LIBS="$ac_save_LIBS"
2428
2429 fi
2430 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2431   echo "$ac_t""yes" 1>&6
2432     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2433     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2434   cat >> confdefs.h <<EOF
2435 #define $ac_tr_lib 1
2436 EOF
2437
2438   LIBS="-ldmalloc $LIBS"
2439
2440 else
2441   echo "$ac_t""no" 1>&6
2442 fi
2443
2444 fi
2445
2446 SHLIB_LIST=""
2447 echo $ac_n "checking if you want to link with the gpm mouse library""... $ac_c" 1>&6
2448 echo "configure:2449: checking if you want to link with the gpm mouse library" >&5
2449
2450 # Check whether --with-gpm or --without-gpm was given.
2451 if test "${with_gpm+set}" = set; then
2452   withval="$with_gpm"
2453   with_gpm=$withval
2454 else
2455   with_gpm=no
2456 fi
2457
2458 echo "$ac_t""$with_gpm" 1>&6
2459 if test $with_gpm = yes ; then
2460         echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
2461 echo "configure:2462: checking for Gpm_Open in -lgpm" >&5
2462 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
2463 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2464   echo $ac_n "(cached) $ac_c" 1>&6
2465 else
2466   ac_save_LIBS="$LIBS"
2467 LIBS="-lgpm  $LIBS"
2468 cat > conftest.$ac_ext <<EOF
2469 #line 2470 "configure"
2470 #include "confdefs.h"
2471 /* Override any gcc2 internal prototype to avoid an error.  */
2472 /* We use char because int might match the return type of a gcc2
2473     builtin and then its argument prototype would still apply.  */
2474 char Gpm_Open();
2475
2476 int main() {
2477 Gpm_Open()
2478 ; return 0; }
2479 EOF
2480 if { (eval echo configure:2481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2481   rm -rf conftest*
2482   eval "ac_cv_lib_$ac_lib_var=yes"
2483 else
2484   echo "configure: failed program was:" >&5
2485   cat conftest.$ac_ext >&5
2486   rm -rf conftest*
2487   eval "ac_cv_lib_$ac_lib_var=no"
2488 fi
2489 rm -f conftest*
2490 LIBS="$ac_save_LIBS"
2491
2492 fi
2493 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2494   echo "$ac_t""yes" 1>&6
2495   
2496                 EXTRA_LIBS="-lgpm -lncurses $EXTRA_LIBS"
2497                 SHLIB_LIST="-lgpm $SHLIB_LIST"
2498                 cat >> confdefs.h <<\EOF
2499 #define HAVE_LIBGPM 1
2500 EOF
2501
2502                 for ac_hdr in gpm.h
2503 do
2504 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2505 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2506 echo "configure:2507: checking for $ac_hdr" >&5
2507 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2508   echo $ac_n "(cached) $ac_c" 1>&6
2509 else
2510   cat > conftest.$ac_ext <<EOF
2511 #line 2512 "configure"
2512 #include "confdefs.h"
2513 #include <$ac_hdr>
2514 EOF
2515 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2516 { (eval echo configure:2517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2517 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2518 if test -z "$ac_err"; then
2519   rm -rf conftest*
2520   eval "ac_cv_header_$ac_safe=yes"
2521 else
2522   echo "$ac_err" >&5
2523   echo "configure: failed program was:" >&5
2524   cat conftest.$ac_ext >&5
2525   rm -rf conftest*
2526   eval "ac_cv_header_$ac_safe=no"
2527 fi
2528 rm -f conftest*
2529 fi
2530 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2531   echo "$ac_t""yes" 1>&6
2532     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2533   cat >> confdefs.h <<EOF
2534 #define $ac_tr_hdr 1
2535 EOF
2536  
2537 else
2538   echo "$ac_t""no" 1>&6
2539 fi
2540 done
2541
2542         
2543 else
2544   echo "$ac_t""no" 1>&6
2545 echo "configure: warning: Cannot link with gpm library - read the FAQ" 1>&2
2546 fi
2547
2548 fi
2549
2550
2551 if test X"$CC_G_OPT" = X"" ; then
2552         CC_G_OPT='-g'
2553         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
2554 fi
2555
2556
2557 if test X"$CXX_G_OPT" = X"" ; then
2558         CXX_G_OPT='-g'
2559         test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
2560 fi
2561
2562
2563 echo $ac_n "checking for default loader flags""... $ac_c" 1>&6
2564 echo "configure:2565: checking for default loader flags" >&5
2565 case $DFT_LWR_MODEL in
2566 normal)  LD_MODEL=''   ;;
2567 debug)   LD_MODEL=$CC_G_OPT ;;
2568 profile) LD_MODEL='-pg';;
2569 shared)  LD_MODEL=''   ;;
2570 esac
2571 echo "$ac_t""$LD_MODEL" 1>&6
2572
2573 echo $ac_n "checking if rpath option should be used""... $ac_c" 1>&6
2574 echo "configure:2575: checking if rpath option should be used" >&5
2575
2576 # Check whether --enable-rpath or --disable-rpath was given.
2577 if test "${enable_rpath+set}" = set; then
2578   enableval="$enable_rpath"
2579   cf_cv_ld_rpath=$enableval
2580 else
2581   cf_cv_ld_rpath=no
2582 fi
2583
2584 echo "$ac_t""$cf_cv_ld_rpath" 1>&6
2585
2586
2587         
2588         LOCAL_LDFLAGS=
2589         LOCAL_LDFLAGS2=
2590         LD_SHARED_OPTS=
2591         INSTALL_LIB="-m 644"
2592
2593         cf_cv_do_symlinks=no
2594
2595         echo $ac_n "checking if release/abi version should be used for shared libs""... $ac_c" 1>&6
2596 echo "configure:2597: checking if release/abi version should be used for shared libs" >&5
2597         
2598 # Check whether --with-shlib-version or --without-shlib-version was given.
2599 if test "${with_shlib_version+set}" = set; then
2600   withval="$with_shlib_version"
2601   test -z "$withval" && withval=auto
2602         case $withval in #(vi
2603         yes) #(vi
2604                 cf_cv_shlib_version=auto
2605                 ;;
2606         rel|abi|auto|no) #(vi
2607                 cf_cv_shlib_version=$withval
2608                 ;;
2609         *)
2610                 { echo "configure: error: option value must be one of: rel, abi, auto or no" 1>&2; exit 1; }
2611                 ;;
2612         esac
2613         
2614 else
2615   cf_cv_shlib_version=auto
2616 fi
2617
2618         echo "$ac_t""$cf_cv_shlib_version" 1>&6
2619
2620         cf_cv_rm_so_locs=no
2621
2622         # Some less-capable ports of gcc support only -fpic
2623         CC_SHARED_OPTS=
2624         if test -n "$GCC"
2625         then
2626                 echo $ac_n "checking which $CC option to use""... $ac_c" 1>&6
2627 echo "configure:2628: checking which $CC option to use" >&5
2628                 cf_save_CFLAGS="$CFLAGS"
2629                 for CC_SHARED_OPTS in -fPIC -fpic ''
2630                 do
2631                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
2632                         cat > conftest.$ac_ext <<EOF
2633 #line 2634 "configure"
2634 #include "confdefs.h"
2635 #include <stdio.h>
2636 int main() {
2637 int x = 1
2638 ; return 0; }
2639 EOF
2640 if { (eval echo configure:2641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2641   rm -rf conftest*
2642   break
2643 else
2644   echo "configure: failed program was:" >&5
2645   cat conftest.$ac_ext >&5
2646 fi
2647 rm -f conftest*
2648                 done
2649                 echo "$ac_t""$CC_SHARED_OPTS" 1>&6
2650                 CFLAGS="$cf_save_CFLAGS"
2651         fi
2652
2653         case $cf_cv_system_name in
2654         beos*)
2655                 MK_SHARED_LIB='$(CC) -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
2656                 ;;
2657         hpux10.*)
2658                 # (tested with gcc 2.7.2 -- I don't have c89)
2659                 if test -n "$GCC"; then
2660                         LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)'
2661                 else
2662                         CC_SHARED_OPTS='+Z'
2663                         LD_SHARED_OPTS='-Wl,+b,$(libdir)'
2664                 fi
2665                 MK_SHARED_LIB='$(LD) +b $(libdir) -b +h `basename $@` -o $@'
2666                 # HP-UX shared libraries must be executable, and should be
2667                 # readonly to exploit a quirk in the memory manager.
2668                 INSTALL_LIB="-m 555"
2669                 cf_cv_do_symlinks=reverse
2670                 ;;
2671         hpux*)
2672                 # (tested with gcc 2.7.2 -- I don't have c89)
2673                 if test -n "$GCC"; then
2674                         LD_SHARED_OPTS='-Xlinker +b -Xlinker $(libdir)'
2675                 else
2676                         CC_SHARED_OPTS='+Z'
2677                         LD_SHARED_OPTS='-Wl,+b,$(libdir)'
2678                 fi
2679                 MK_SHARED_LIB='$(LD) +b $(libdir) -b -o $@'
2680                 # HP-UX shared libraries must be executable, and should be
2681                 # readonly to exploit a quirk in the memory manager.
2682                 INSTALL_LIB="-m 555"
2683                 ;;
2684         irix*)
2685                 # tested with IRIX 5.2 and 'cc'.
2686                 if test -z "$GCC"; then
2687                         CC_SHARED_OPTS='-KPIC'
2688                 fi
2689                 MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $@` -o $@'
2690                 cf_cv_rm_so_locs=yes
2691                 ;;
2692         linux*|gnu*)
2693                 # tested with Linux 2.0.29 and gcc 2.7.2 (ELF)
2694                 test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-Wl,-rpath,"
2695                 if test $DFT_LWR_MODEL = "shared" ; then
2696                         LOCAL_LDFLAGS='-Wl,-rpath,../lib'
2697                         LOCAL_LDFLAGS2='-Wl,-rpath,../../lib'
2698                 fi
2699                 test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
2700                 MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION),-stats,-lc -o $@'
2701                 ;;
2702         openbsd2*)
2703                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
2704                 MK_SHARED_LIB='$(LD) -Bshareable -soname,`basename $@.$(ABI_VERSION)` -o $@'
2705                 ;;
2706         openbsd*|freebsd*)
2707                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
2708                 MK_SHARED_LIB='$(LD) -Bshareable -o $@'
2709                 test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
2710                 ;;
2711         netbsd*)
2712                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
2713                 test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-Wl,-rpath,"
2714                 if test $DFT_LWR_MODEL = "shared" && test $cf_cv_ld_rpath = yes ; then
2715                         LOCAL_LDFLAGS='-Wl,-rpath,../lib'
2716                         LOCAL_LDFLAGS2='-Wl,-rpath,../../lib'
2717                         EXTRA_LDFLAGS="-Wl,-rpath,\$(libdir) $EXTRA_LDFLAGS"
2718                         MK_SHARED_LIB='$(CC) -shared -Wl,-soname,`basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@'
2719                         if test $cf_cv_shlib_version = auto; then
2720                         if test ! -f /usr/libexec/ld.elf_so; then
2721                                 cf_cv_shlib_version=rel
2722                         fi
2723                         fi
2724                 else
2725                         MK_SHARED_LIB='$(LD) -Bshareable -o $@'
2726                 fi
2727                 ;;
2728         osf*|mls+*)
2729                 # tested with OSF/1 V3.2 and 'cc'
2730                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
2731                 # link with shared libs).
2732                 MK_SHARED_LIB='$(LD) -set_version $(REL_VERSION):$(ABI_VERSION) -expect_unresolved "*" -shared -soname `basename $@`'
2733                 test $cf_cv_ld_rpath = yes && cf_ld_rpath_opt="-rpath"
2734                 case $host_os in
2735                 osf4*)
2736                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
2737                         ;;
2738                 esac
2739                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
2740                 if test $DFT_LWR_MODEL = "shared" ; then
2741                         LOCAL_LDFLAGS='-Wl,-rpath,../lib'
2742                         LOCAL_LDFLAGS2='-Wl,-rpath,../../lib'
2743                 fi
2744                 cf_cv_rm_so_locs=yes
2745                 ;;
2746         sco3.2v5*)  # (also uw2* and UW7) hops 13-Apr-98
2747                 # tested with osr5.0.5
2748                 if test $ac_cv_prog_gcc != yes; then
2749                         CC_SHARED_OPTS='-belf -KPIC'
2750                 fi
2751                 MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@'
2752                 if test $cf_cv_ld_rpath = yes ; then
2753                         # only way is to set LD_RUN_PATH but no switch for it
2754                         RUN_PATH=$libdir
2755                 fi
2756                 test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
2757                 LINK_PROGS='LD_RUN_PATH=$(libdir)'
2758                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
2759                 ;;
2760         sunos4*)
2761                 # tested with SunOS 4.1.1 and gcc 2.7.0
2762                 if test $ac_cv_prog_gcc != yes; then
2763                         CC_SHARED_OPTS='-KPIC'
2764                 fi
2765                 MK_SHARED_LIB='$(LD) -assert pure-text -o $@'
2766                 test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
2767                 ;;
2768         solaris2*)
2769                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
2770                 if test $ac_cv_prog_gcc != yes; then
2771                         CC_SHARED_OPTS='-KPIC'
2772                 fi
2773                 MK_SHARED_LIB='$(LD) -dy -G -h `basename $@ .$(REL_VERSION)`.$(ABI_VERSION) -o $@'
2774                 if test $cf_cv_ld_rpath = yes ; then
2775                         cf_ld_rpath_opt="-R"
2776                         EXTRA_LDFLAGS="-R ../lib:\$(libdir) $EXTRA_LDFLAGS"
2777                 fi
2778                 test $cf_cv_shlib_version = auto && cf_cv_shlib_version=rel
2779                 ;;
2780         sysv5uw7*|unix_sv*)
2781                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
2782                 if test $ac_cv_prog_gcc != yes; then
2783                         CC_SHARED_OPTS='-KPIC'
2784                 fi
2785                 MK_SHARED_LIB='$(LD) -d y -G -o $@'
2786                 ;;
2787         *)
2788                 CC_SHARED_OPTS='unknown'
2789                 MK_SHARED_LIB='echo unknown'
2790                 ;;
2791         esac
2792
2793         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
2794         case "$cf_cv_shlib_version" in #(vi
2795         rel|abi)
2796                 case "$MK_SHARED_LIB" in #(vi
2797                 *'-o $@')
2798                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
2799                         ;;
2800                 *)
2801                         echo "configure: warning: ignored --with-shlib-version" 1>&2
2802                         ;;
2803                 esac
2804                 ;;
2805         esac
2806
2807         if test -n "$cf_ld_rpath_opt" ; then
2808                 echo $ac_n "checking if we need a space after rpath option""... $ac_c" 1>&6
2809 echo "configure:2810: checking if we need a space after rpath option" >&5
2810                 cf_save_LIBS="$LIBS"
2811                 LIBS="$LIBS ${cf_ld_rpath_opt}/usr/lib"
2812                 cat > conftest.$ac_ext <<EOF
2813 #line 2814 "configure"
2814 #include "confdefs.h"
2815
2816 int main() {
2817
2818 ; return 0; }
2819 EOF
2820 if { (eval echo configure:2821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2821   rm -rf conftest*
2822   cf_rpath_space=no
2823 else
2824   echo "configure: failed program was:" >&5
2825   cat conftest.$ac_ext >&5
2826   rm -rf conftest*
2827   cf_rpath_space=yes
2828 fi
2829 rm -f conftest*
2830                 LIBS="$cf_save_LIBS"
2831                 echo "$ac_t""$cf_rpath_space" 1>&6
2832                 test $cf_rpath_space = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt "
2833                 MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\$(libdir)"
2834         fi
2835
2836         
2837         
2838         
2839         
2840         
2841         
2842         
2843         
2844         
2845
2846 if test "$CC_SHARED_OPTS" = "unknown"; then
2847         for model in $cf_list_models; do
2848                 if test "$model" = "shared"; then
2849                         { echo "configure: error: Shared libraries are not supported in this version" 1>&2; exit 1; }
2850                 fi
2851         done
2852 fi
2853
2854 ###############################################################################
2855
2856
2857 ###     use option --disable-overwrite to leave out the link to -lcurses
2858 echo $ac_n "checking if you wish to install ncurses overwriting curses""... $ac_c" 1>&6
2859 echo "configure:2860: checking if you wish to install ncurses overwriting curses" >&5
2860
2861 # Check whether --enable-overwrite or --disable-overwrite was given.
2862 if test "${enable_overwrite+set}" = set; then
2863   enableval="$enable_overwrite"
2864   with_overwrite=$enableval
2865 else
2866   with_overwrite=yes
2867 fi
2868
2869 echo "$ac_t""$with_overwrite" 1>&6
2870
2871 echo $ac_n "checking if external terminfo-database is used""... $ac_c" 1>&6
2872 echo "configure:2873: checking if external terminfo-database is used" >&5
2873
2874 # Check whether --enable-database or --disable-database was given.
2875 if test "${enable_database+set}" = set; then
2876   enableval="$enable_database"
2877   with_database=$enableval
2878 else
2879   with_database=yes
2880 fi
2881
2882 echo "$ac_t""$with_database" 1>&6
2883 test $with_database != no && cat >> confdefs.h <<\EOF
2884 #define USE_DATABASE 1
2885 EOF
2886
2887
2888 echo $ac_n "checking for list of fallback descriptions""... $ac_c" 1>&6
2889 echo "configure:2890: checking for list of fallback descriptions" >&5
2890
2891 # Check whether --with-fallbacks or --without-fallbacks was given.
2892 if test "${with_fallbacks+set}" = set; then
2893   withval="$with_fallbacks"
2894   with_fallback=$withval
2895 else
2896   with_fallback=
2897 fi
2898
2899 echo "$ac_t""$with_fallback" 1>&6
2900 FALLBACK_LIST=`echo $with_fallback|sed -e 's/,/ /g'`
2901
2902
2903 echo $ac_n "checking for list of terminfo directories""... $ac_c" 1>&6
2904 echo "configure:2905: checking for list of terminfo directories" >&5
2905
2906
2907 # Check whether --with-terminfo-dirs or --without-terminfo-dirs was given.
2908 if test "${with_terminfo_dirs+set}" = set; then
2909   withval="$with_terminfo_dirs"
2910   :
2911 else
2912   withval="${TERMINFO_DIRS-${datadir}/terminfo}"
2913 fi
2914
2915 IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2916 cf_dst_path=
2917 for cf_src_path in $withval
2918 do
2919   
2920 case ".$cf_src_path" in #(vi
2921 ./*) #(vi
2922   ;;
2923 .a-zA-Z:\\/*) #(vi OS/2 EMX
2924   ;;
2925 .\${*prefix}*) #(vi
2926   eval cf_src_path="$cf_src_path"
2927   case ".$cf_src_path" in #(vi
2928   .NONE/*)
2929     cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@`
2930     ;;
2931   esac
2932   ;; #(vi
2933 .NONE/*)
2934   cf_src_path=`echo $cf_src_path | sed -e s@NONE@$ac_default_prefix@`
2935   ;;
2936 *)
2937   { echo "configure: error: expected a pathname" 1>&2; exit 1; }
2938   ;;
2939 esac
2940
2941   test -n "$cf_dst_path" && cf_dst_path="${cf_dst_path}:"
2942   cf_dst_path="${cf_dst_path}${cf_src_path}"
2943 done
2944 IFS="$ac_save_ifs"
2945
2946 eval TERMINFO_DIRS="$cf_dst_path"
2947
2948 echo "$ac_t""$TERMINFO_DIRS" 1>&6
2949 test -n "$TERMINFO_DIRS" && cat >> confdefs.h <<EOF
2950 #define TERMINFO_DIRS "$TERMINFO_DIRS"
2951 EOF
2952
2953
2954 if test $with_database = no ; then
2955         if test -z $with_fallback ; then
2956                 { echo "configure: error: You have disabled the database w/o specifying fallbacks" 1>&2; exit 1; }
2957         fi
2958 fi
2959
2960 ###     use option --disable-big-core to make tic run on small machines
2961 ###     We need 4Mb, check if we can allocate 50% more than that.
2962 echo $ac_n "checking if big-core option selected""... $ac_c" 1>&6
2963 echo "configure:2964: checking if big-core option selected" >&5
2964
2965 # Check whether --enable-big-core or --disable-big-core was given.
2966 if test "${enable_big_core+set}" = set; then
2967   enableval="$enable_big_core"
2968   with_big_core=$enableval
2969 else
2970   if test "$cross_compiling" = yes; then
2971   with_big_core=no
2972 else
2973   cat > conftest.$ac_ext <<EOF
2974 #line 2975 "configure"
2975 #include "confdefs.h"
2976
2977 #include <stdlib.h>
2978 #include <string.h>
2979 int main() { exit(malloc(6000000L) == 0); }
2980 EOF
2981 if { (eval echo configure:2982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2982 then
2983   with_big_core=yes
2984 else
2985   echo "configure: failed program was:" >&5
2986   cat conftest.$ac_ext >&5
2987   rm -fr conftest*
2988   with_big_core=no
2989 fi
2990 rm -fr conftest*
2991 fi
2992
2993 fi
2994
2995 echo "$ac_t""$with_big_core" 1>&6
2996 test "$with_big_core" = "yes" && cat >> confdefs.h <<\EOF
2997 #define HAVE_BIG_CORE 1
2998 EOF
2999
3000
3001 ###     use option --enable-termcap to compile in the termcap fallback support
3002 echo $ac_n "checking if you want termcap-fallback support""... $ac_c" 1>&6
3003 echo "configure:3004: checking if you want termcap-fallback support" >&5
3004
3005 # Check whether --enable-termcap or --disable-termcap was given.
3006 if test "${enable_termcap+set}" = set; then
3007   enableval="$enable_termcap"
3008   with_termcap=$enableval
3009 else
3010   with_termcap=no
3011 fi
3012
3013 echo "$ac_t""$with_termcap" 1>&6
3014
3015 if test "$with_termcap" != "yes" ; then
3016         cat >> confdefs.h <<\EOF
3017 #define PURE_TERMINFO 1
3018 EOF
3019
3020 else
3021
3022 ###     use option --enable-getcap to use a hacked getcap for reading termcaps
3023 echo $ac_n "checking if fast termcap-loader is needed""... $ac_c" 1>&6
3024 echo "configure:3025: checking if fast termcap-loader is needed" >&5
3025
3026 # Check whether --enable-getcap or --disable-getcap was given.
3027 if test "${enable_getcap+set}" = set; then
3028   enableval="$enable_getcap"
3029   with_getcap=$enableval
3030 else
3031   with_getcap=no
3032 fi
3033
3034 echo "$ac_t""$with_getcap" 1>&6
3035 test "$with_getcap" = "yes" && cat >> confdefs.h <<\EOF
3036 #define USE_GETCAP 1
3037 EOF
3038
3039
3040 echo $ac_n "checking if translated termcaps will be cached in ~/.terminfo""... $ac_c" 1>&6
3041 echo "configure:3042: checking if translated termcaps will be cached in ~/.terminfo" >&5
3042
3043 # Check whether --enable-getcap-cache or --disable-getcap-cache was given.
3044 if test "${enable_getcap_cache+set}" = set; then
3045   enableval="$enable_getcap_cache"
3046   with_getcap_cache=$enableval
3047 else
3048   with_getcap_cache=no
3049 fi
3050
3051 echo "$ac_t""$with_getcap_cache" 1>&6
3052 test "$with_getcap_cache" = "yes" && cat >> confdefs.h <<\EOF
3053 #define USE_GETCAP_CACHE 1
3054 EOF
3055
3056
3057 fi
3058
3059 ###   Use option --enable-symlinks to make tic use symlinks, not hard links
3060 ###   to reduce storage requirements for the terminfo database.
3061
3062 for ac_func in \
3063         remove \
3064         unlink 
3065 do
3066 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3067 echo "configure:3068: checking for $ac_func" >&5
3068 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3069   echo $ac_n "(cached) $ac_c" 1>&6
3070 else
3071   cat > conftest.$ac_ext <<EOF
3072 #line 3073 "configure"
3073 #include "confdefs.h"
3074 /* System header to define __stub macros and hopefully few prototypes,
3075     which can conflict with char $ac_func(); below.  */
3076 #include <assert.h>
3077 /* Override any gcc2 internal prototype to avoid an error.  */
3078 /* We use char because int might match the return type of a gcc2
3079     builtin and then its argument prototype would still apply.  */
3080 char $ac_func();
3081
3082 int main() {
3083
3084 /* The GNU C library defines this for functions which it implements
3085     to always fail with ENOSYS.  Some functions are actually named
3086     something starting with __ and the normal name is an alias.  */
3087 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3088 choke me
3089 #else
3090 $ac_func();
3091 #endif
3092
3093 ; return 0; }
3094 EOF
3095 if { (eval echo configure:3096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3096   rm -rf conftest*
3097   eval "ac_cv_func_$ac_func=yes"
3098 else
3099   echo "configure: failed program was:" >&5
3100   cat conftest.$ac_ext >&5
3101   rm -rf conftest*
3102   eval "ac_cv_func_$ac_func=no"
3103 fi
3104 rm -f conftest*
3105 fi
3106
3107 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3108   echo "$ac_t""yes" 1>&6
3109     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3110   cat >> confdefs.h <<EOF
3111 #define $ac_tr_func 1
3112 EOF
3113  
3114 else
3115   echo "$ac_t""no" 1>&6
3116 fi
3117 done
3118
3119
3120 if test "$ac_cv_prog_cc_cross" = yes ; then
3121         for ac_func in \
3122                 link \
3123                 symlink 
3124 do
3125 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3126 echo "configure:3127: checking for $ac_func" >&5
3127 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3128   echo $ac_n "(cached) $ac_c" 1>&6
3129 else
3130   cat > conftest.$ac_ext <<EOF
3131 #line 3132 "configure"
3132 #include "confdefs.h"
3133 /* System header to define __stub macros and hopefully few prototypes,
3134     which can conflict with char $ac_func(); below.  */
3135 #include <assert.h>
3136 /* Override any gcc2 internal prototype to avoid an error.  */
3137 /* We use char because int might match the return type of a gcc2
3138     builtin and then its argument prototype would still apply.  */
3139 char $ac_func();
3140
3141 int main() {
3142
3143 /* The GNU C library defines this for functions which it implements
3144     to always fail with ENOSYS.  Some functions are actually named
3145     something starting with __ and the normal name is an alias.  */
3146 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3147 choke me
3148 #else
3149 $ac_func();
3150 #endif
3151
3152 ; return 0; }
3153 EOF
3154 if { (eval echo configure:3155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3155   rm -rf conftest*
3156   eval "ac_cv_func_$ac_func=yes"
3157 else
3158   echo "configure: failed program was:" >&5
3159   cat conftest.$ac_ext >&5
3160   rm -rf conftest*
3161   eval "ac_cv_func_$ac_func=no"
3162 fi
3163 rm -f conftest*
3164 fi
3165
3166 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3167   echo "$ac_t""yes" 1>&6
3168     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3169   cat >> confdefs.h <<EOF
3170 #define $ac_tr_func 1
3171 EOF
3172  
3173 else
3174   echo "$ac_t""no" 1>&6
3175 fi
3176 done
3177
3178 else
3179         echo $ac_n "checking if link/symlink functions work""... $ac_c" 1>&6
3180 echo "configure:3181: checking if link/symlink functions work" >&5
3181 if eval "test \"`echo '$''{'cf_cv_link_funcs'+set}'`\" = set"; then
3182   echo $ac_n "(cached) $ac_c" 1>&6
3183 else
3184   
3185                 cf_cv_link_funcs=
3186                 for cf_func in link symlink ; do
3187                         if test "$cross_compiling" = yes; then
3188   
3189                         eval 'ac_cv_func_'$cf_func'=error'
3190 else
3191   cat > conftest.$ac_ext <<EOF
3192 #line 3193 "configure"
3193 #include "confdefs.h"
3194
3195 #include <sys/types.h>
3196 #include <sys/stat.h>
3197 #ifdef HAVE_UNISTD_H
3198 #include <unistd.h>
3199 #endif
3200 int main()
3201 {
3202         int fail = 0;
3203         char *src = "config.log";
3204         char *dst = "conftest.chk";
3205         struct stat src_sb;
3206         struct stat dst_sb;
3207
3208         stat(src, &src_sb);
3209         fail = ($cf_func("config.log", "conftest.chk") < 0)
3210             || (stat(dst, &dst_sb) < 0)
3211             || (dst_sb.st_mtime != src_sb.st_mtime);
3212 #ifdef HAVE_UNLINK
3213         unlink(dst);
3214 #else
3215         remove(dst);
3216 #endif
3217         exit (fail);
3218 }
3219                         
3220 EOF
3221 if { (eval echo configure:3222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3222 then
3223   
3224                         cf_cv_link_funcs="$cf_cv_link_funcs $cf_func"
3225                         eval 'ac_cv_func_'$cf_func'=yes'
3226                         
3227 cf_FUNC=`echo $cf_func | tr '[a-z]' '[A-Z]'`
3228
3229                         cat >> confdefs.h <<EOF
3230 #define HAVE_$cf_FUNC 1
3231 EOF
3232
3233 else
3234   echo "configure: failed program was:" >&5
3235   cat conftest.$ac_ext >&5
3236   rm -fr conftest*
3237   
3238                         eval 'ac_cv_func_'$cf_func'=no'
3239 fi
3240 rm -fr conftest*
3241 fi
3242
3243                 done
3244                 test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no
3245         
3246 fi
3247
3248 echo "$ac_t""$cf_cv_link_funcs" 1>&6
3249 fi
3250
3251
3252 with_links=no
3253 with_symlinks=no
3254
3255 if test "$ac_cv_func_link" != yes ; then
3256     echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6
3257 echo "configure:3258: checking if tic should use symbolic links" >&5
3258     if test "$ac_cv_func_symlink" = yes ; then
3259         with_symlinks=yes
3260     else
3261         with_symlinks=no
3262     fi
3263     echo "$ac_t""$with_symlinks" 1>&6
3264 elif test "$ac_cv_func_symlink" != yes ; then
3265     echo $ac_n "checking if tic should use hard links""... $ac_c" 1>&6
3266 echo "configure:3267: checking if tic should use hard links" >&5
3267     if test "$ac_cv_func_link" = yes ; then
3268         with_links=yes
3269     else
3270         with_links=no
3271     fi
3272     echo "$ac_t""$with_links" 1>&6
3273 else
3274     echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6
3275 echo "configure:3276: checking if tic should use symbolic links" >&5
3276     
3277 # Check whether --enable-symlinks or --disable-symlinks was given.
3278 if test "${enable_symlinks+set}" = set; then
3279   enableval="$enable_symlinks"
3280   with_symlinks=$enableval
3281 else
3282   with_symlinks=no
3283 fi
3284
3285     echo "$ac_t""$with_symlinks" 1>&6
3286 fi
3287
3288 test "$with_links" = yes && cat >> confdefs.h <<\EOF
3289 #define USE_LINKS 1
3290 EOF
3291
3292 test "$with_symlinks" = yes && cat >> confdefs.h <<\EOF
3293 #define USE_SYMLINKS 1
3294 EOF
3295
3296
3297 ###   use option --enable-broken-linker to force on use of broken-linker support
3298 echo $ac_n "checking if you want broken-linker support code""... $ac_c" 1>&6
3299 echo "configure:3300: checking if you want broken-linker support code" >&5
3300
3301 # Check whether --enable-broken_linker or --disable-broken_linker was given.
3302 if test "${enable_broken_linker+set}" = set; then
3303   enableval="$enable_broken_linker"
3304   with_broken_linker=$enableval
3305 else
3306   with_broken_linker=$BROKEN_LINKER
3307 fi
3308
3309 echo "$ac_t""$with_broken_linker" 1>&6
3310 test "$with_broken_linker" = yes && cat >> confdefs.h <<\EOF
3311 #define BROKEN_LINKER 1
3312 EOF
3313
3314
3315 ###   use option --enable-bsdpad to have tputs process BSD-style prefix padding
3316 echo $ac_n "checking if tputs should process BSD-style prefix padding""... $ac_c" 1>&6
3317 echo "configure:3318: checking if tputs should process BSD-style prefix padding" >&5
3318
3319 # Check whether --enable-bsdpad or --disable-bsdpad was given.
3320 if test "${enable_bsdpad+set}" = set; then
3321   enableval="$enable_bsdpad"
3322   with_bsdpad=$enableval
3323 else
3324   with_bsdpad=no
3325 fi
3326
3327 echo "$ac_t""$with_bsdpad" 1>&6
3328 test "$with_bsdpad" = yes && cat >> confdefs.h <<\EOF
3329 #define BSD_TPUTS 1
3330 EOF
3331
3332
3333 ### Enable compiling-in rcs id's
3334 echo $ac_n "checking if RCS identifiers should be compiled-in""... $ac_c" 1>&6
3335 echo "configure:3336: checking if RCS identifiers should be compiled-in" >&5
3336
3337 # Check whether --with-rcs-ids or --without-rcs-ids was given.
3338 if test "${with_rcs_ids+set}" = set; then
3339   withval="$with_rcs_ids"
3340   with_rcs_ids=$withval
3341 else
3342   with_rcs_ids=no
3343 fi
3344
3345 echo "$ac_t""$with_rcs_ids" 1>&6
3346 test "$with_rcs_ids" = yes && cat >> confdefs.h <<\EOF
3347 #define USE_RCS_IDS 1
3348 EOF
3349
3350
3351 ###############################################################################
3352
3353
3354 ### Note that some functions (such as const) are normally disabled anyway.
3355 echo $ac_n "checking if you want to build with function extensions""... $ac_c" 1>&6
3356 echo "configure:3357: checking if you want to build with function extensions" >&5
3357
3358 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
3359 if test "${enable_ext_funcs+set}" = set; then
3360   enableval="$enable_ext_funcs"
3361   with_ext_funcs=$enableval
3362 else
3363   with_ext_funcs=yes
3364 fi
3365
3366 echo "$ac_t""$with_ext_funcs" 1>&6
3367 if test "$with_ext_funcs" = yes ; then
3368         cat >> confdefs.h <<\EOF
3369 #define HAVE_HAS_KEY 1
3370 EOF
3371
3372         cat >> confdefs.h <<\EOF
3373 #define HAVE_RESIZETERM 1
3374 EOF
3375
3376         cat >> confdefs.h <<\EOF
3377 #define HAVE_USE_DEFAULT_COLORS 1
3378 EOF
3379
3380         cat >> confdefs.h <<\EOF
3381 #define HAVE_WRESIZE 1
3382 EOF
3383
3384         cat >> confdefs.h <<\EOF
3385 #define NCURSES_EXT_FUNCS 1
3386 EOF
3387
3388 fi
3389
3390 ###   use option --enable-const to turn on use of const beyond that in XSI.
3391 echo $ac_n "checking for extended use of const keyword""... $ac_c" 1>&6
3392 echo "configure:3393: checking for extended use of const keyword" >&5
3393
3394 # Check whether --enable-const or --disable-const was given.
3395 if test "${enable_const+set}" = set; then
3396   enableval="$enable_const"
3397   with_ext_const=$enableval
3398 else
3399   with_ext_const=no
3400 fi
3401
3402 echo "$ac_t""$with_ext_const" 1>&6
3403 NCURSES_CONST=""
3404 if test "$with_ext_const" = yes ; then
3405         cat >> confdefs.h <<\EOF
3406 #define NCURSES_CONST const
3407 EOF
3408
3409         NCURSES_CONST=const
3410 fi
3411
3412
3413 ###   use option --enable-hashmap to turn on use of hashmap scrolling logic
3414 echo $ac_n "checking if you want hashmap scrolling-optimization code""... $ac_c" 1>&6
3415 echo "configure:3416: checking if you want hashmap scrolling-optimization code" >&5
3416
3417 # Check whether --enable-hashmap or --disable-hashmap was given.
3418 if test "${enable_hashmap+set}" = set; then
3419   enableval="$enable_hashmap"
3420   with_hashmap=$enableval
3421 else
3422   with_hashmap=yes
3423 fi
3424
3425 echo "$ac_t""$with_hashmap" 1>&6
3426 test "$with_hashmap" = yes && cat >> confdefs.h <<\EOF
3427 #define USE_HASHMAP 1
3428 EOF
3429
3430
3431 echo $ac_n "checking if you want \$NCURSES_NO_PADDING code""... $ac_c" 1>&6
3432 echo "configure:3433: checking if you want \$NCURSES_NO_PADDING code" >&5
3433
3434 # Check whether --enable-no-padding or --disable-no-padding was given.
3435 if test "${enable_no_padding+set}" = set; then
3436   enableval="$enable_no_padding"
3437   with_no_padding=$enableval
3438 else
3439   with_no_padding=$with_ext_funcs
3440 fi
3441
3442 echo "$ac_t""$with_no_padding" 1>&6
3443 test "$with_no_padding" = yes && cat >> confdefs.h <<\EOF
3444 #define NCURSES_NO_PADDING 1
3445 EOF
3446
3447
3448 ###   use option --enable-sigwinch to turn on use of SIGWINCH logic
3449 echo $ac_n "checking if you want SIGWINCH handler""... $ac_c" 1>&6
3450 echo "configure:3451: checking if you want SIGWINCH handler" >&5
3451
3452 # Check whether --enable-sigwinch or --disable-sigwinch was given.
3453 if test "${enable_sigwinch+set}" = set; then
3454   enableval="$enable_sigwinch"
3455   with_sigwinch=$enableval
3456 else
3457   with_sigwinch=$with_ext_funcs
3458 fi
3459
3460 echo "$ac_t""$with_sigwinch" 1>&6
3461 test "$with_sigwinch" = yes && cat >> confdefs.h <<\EOF
3462 #define USE_SIGWINCH 1
3463 EOF
3464
3465
3466 ###   use option --enable-tcap-names to allow user to define new capabilities
3467 echo $ac_n "checking if you want user-definable terminal capabilities like termcap""... $ac_c" 1>&6
3468 echo "configure:3469: checking if you want user-definable terminal capabilities like termcap" >&5
3469
3470 # Check whether --enable-tcap-names or --disable-tcap-names was given.
3471 if test "${enable_tcap_names+set}" = set; then
3472   enableval="$enable_tcap_names"
3473   with_tcap_names=$enableval
3474 else
3475   with_tcap_names=$with_ext_funcs
3476 fi
3477
3478 echo "$ac_t""$with_tcap_names" 1>&6
3479 NCURSES_XNAMES=0
3480 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
3481
3482
3483 ###############################################################################
3484
3485 echo $ac_n "checking if you want all experimental code""... $ac_c" 1>&6
3486 echo "configure:3487: checking if you want all experimental code" >&5
3487
3488 # Check whether --with-develop or --without-develop was given.
3489 if test "${with_develop+set}" = set; then
3490   withval="$with_develop"
3491   with_develop=$withval
3492 else
3493   with_develop=no
3494 fi
3495
3496 echo "$ac_t""$with_develop" 1>&6
3497
3498 ###   use option --enable-colorfgbg to turn on use of $COLORFGBG environment
3499 echo $ac_n "checking if you want experimental colorfgbg code""... $ac_c" 1>&6
3500 echo "configure:3501: checking if you want experimental colorfgbg code" >&5
3501
3502 # Check whether --enable-hard-tabs or --disable-hard-tabs was given.
3503 if test "${enable_hard_tabs+set}" = set; then
3504   enableval="$enable_hard_tabs"
3505   with_colorfgbg=$enableval
3506 else
3507   with_colorfgbg=$with_develop
3508 fi
3509
3510 echo "$ac_t""$with_colorfgbg" 1>&6
3511 test "$with_colorfgbg" = yes && cat >> confdefs.h <<\EOF
3512 #define USE_COLORFGBG 1
3513 EOF
3514
3515
3516 ###   use option --enable-hard-tabs to turn on use of hard-tabs optimize
3517 echo $ac_n "checking if you want experimental hard-tabs code""... $ac_c" 1>&6
3518 echo "configure:3519: checking if you want experimental hard-tabs code" >&5
3519
3520 # Check whether --enable-hard-tabs or --disable-hard-tabs was given.
3521 if test "${enable_hard_tabs+set}" = set; then
3522   enableval="$enable_hard_tabs"
3523   with_hardtabs=$enableval
3524 else
3525   with_hardtabs=$with_develop
3526 fi
3527
3528 echo "$ac_t""$with_hardtabs" 1>&6
3529 test "$with_hardtabs" = yes && cat >> confdefs.h <<\EOF
3530 #define USE_HARD_TABS 1
3531 EOF
3532
3533
3534 echo $ac_n "checking if you want experimental safe-sprintf code""... $ac_c" 1>&6
3535 echo "configure:3536: checking if you want experimental safe-sprintf code" >&5
3536
3537 # Check whether --enable-safe-sprintf or --disable-safe-sprintf was given.
3538 if test "${enable_safe_sprintf+set}" = set; then
3539   enableval="$enable_safe_sprintf"
3540   with_safe_sprintf=$enableval
3541 else
3542   with_safe_sprintf=no
3543 fi
3544
3545 echo "$ac_t""$with_safe_sprintf" 1>&6
3546 test "$with_safe_sprintf" = yes && cat >> confdefs.h <<\EOF
3547 #define USE_SAFE_SPRINTF 1
3548 EOF
3549
3550
3551 ###   use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
3552 # when hashmap is used scroll hints are useless
3553 if test "$with_hashmap" = no ; then
3554 echo $ac_n "checking if you want to experiment without scrolling-hints code""... $ac_c" 1>&6
3555 echo "configure:3556: checking if you want to experiment without scrolling-hints code" >&5
3556
3557 # Check whether --enable-scroll-hints or --disable-scroll-hints was given.
3558 if test "${enable_scroll_hints+set}" = set; then
3559   enableval="$enable_scroll_hints"
3560   with_scroll_hints=$enableval
3561 else
3562   with_scroll_hints=yes
3563 fi
3564
3565 echo "$ac_t""$with_scroll_hints" 1>&6
3566 test "$with_scroll_hints" = yes && cat >> confdefs.h <<\EOF
3567 #define USE_SCROLL_HINTS 1
3568 EOF
3569
3570 fi
3571
3572 ###   use option --enable-widec to turn on use of wide-character support
3573 echo $ac_n "checking if you want experimental wide-character code""... $ac_c" 1>&6
3574 echo "configure:3575: checking if you want experimental wide-character code" >&5
3575
3576 # Check whether --enable-widec or --disable-widec was given.
3577 if test "${enable_widec+set}" = set; then
3578   enableval="$enable_widec"
3579   with_widec=$enableval
3580 else
3581   with_widec=no
3582 fi
3583
3584 echo "$ac_t""$with_widec" 1>&6
3585 if test "$with_widec" = yes ; then
3586         LIB_SUFFIX="w${LIB_SUFFIX}"
3587         cat >> confdefs.h <<\EOF
3588 #define USE_WIDEC_SUPPORT 1
3589 EOF
3590
3591 fi
3592
3593 ###   use option --enable-xmc-glitch to turn on use of magic-cookie optimize
3594 echo $ac_n "checking if you want experimental xmc code""... $ac_c" 1>&6
3595 echo "configure:3596: checking if you want experimental xmc code" >&5
3596
3597 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given.
3598 if test "${enable_xmc_glitch+set}" = set; then
3599   enableval="$enable_xmc_glitch"
3600   with_xmc_glitch=$enableval
3601 else
3602   with_xmc_glitch=$with_develop
3603 fi
3604
3605 echo "$ac_t""$with_xmc_glitch" 1>&6
3606 test "$with_xmc_glitch" = yes && cat >> confdefs.h <<\EOF
3607 #define USE_XMC_SUPPORT 1
3608 EOF
3609
3610
3611 ###############################################################################
3612
3613
3614 ###     use option --disable-echo to suppress full display compiling commands
3615
3616 # Check whether --enable-echo or --disable-echo was given.
3617 if test "${enable_echo+set}" = set; then
3618   enableval="$enable_echo"
3619   with_echo=$enableval
3620 else
3621   with_echo=yes
3622 fi
3623
3624 if test "$with_echo" = yes; then
3625         ECHO_LINK=
3626 else
3627         ECHO_LINK='@ echo linking $@ ... ;'
3628 fi
3629
3630
3631 ###     use option --enable-warnings to turn on all gcc warnings
3632
3633 # Check whether --enable-warnings or --disable-warnings was given.
3634 if test "${enable_warnings+set}" = set; then
3635   enableval="$enable_warnings"
3636   with_warnings=$enableval
3637 fi
3638
3639 if test -n "$with_warnings"; then
3640         ADAFLAGS="$ADAFLAGS -gnatg"
3641         
3642 if test -n "$GCC"
3643 then
3644                 cat > conftest.$ac_ext <<EOF
3645 #line 3646 "configure"
3646 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
3647 EOF
3648                 echo "checking for $CC warning options" 1>&6
3649 echo "configure:3650: checking for $CC warning options" >&5
3650         cf_save_CFLAGS="$CFLAGS"
3651         EXTRA_CFLAGS="-W -Wall"
3652         cf_warn_CONST=""
3653         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
3654         for cf_opt in \
3655                 Wbad-function-cast \
3656                 Wcast-align \
3657                 Wcast-qual \
3658                 Winline \
3659                 Wmissing-declarations \
3660                 Wmissing-prototypes \
3661                 Wnested-externs \
3662                 Wpointer-arith \
3663                 Wshadow \
3664                 Wstrict-prototypes $cf_warn_CONST
3665         do
3666                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
3667                 if { (eval echo configure:3668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3668                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
3669                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
3670                         test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES"
3671                 fi
3672         done
3673         rm -f conftest*
3674         CFLAGS="$cf_save_CFLAGS"
3675 fi
3676
3677
3678 fi
3679
3680 if test -n "$GCC"
3681 then
3682 cat > conftest.i <<EOF
3683 #ifndef GCC_PRINTF
3684 #define GCC_PRINTF 0
3685 #endif
3686 #ifndef GCC_SCANF
3687 #define GCC_SCANF 0
3688 #endif
3689 #ifndef GCC_NORETURN
3690 #define GCC_NORETURN /* nothing */
3691 #endif
3692 #ifndef GCC_UNUSED
3693 #define GCC_UNUSED /* nothing */
3694 #endif
3695 EOF
3696 if test -n "$GCC"
3697 then
3698         echo "checking for $CC __attribute__ directives" 1>&6
3699 echo "configure:3700: checking for $CC __attribute__ directives" >&5
3700         cat > conftest.$ac_ext <<EOF
3701 #line 3702 "configure"
3702 #include "confdefs.h"
3703 #include "conftest.h"
3704 #include "conftest.i"
3705 #if     GCC_PRINTF
3706 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3707 #else
3708 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3709 #endif
3710 #if     GCC_SCANF
3711 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3712 #else
3713 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3714 #endif
3715 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3716 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3717 extern void foo(void) GCC_NORETURN;
3718 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3719 EOF
3720                 for cf_attribute in scanf printf unused noreturn
3721         do
3722                 
3723 CF_ATTRIBUTE=`echo $cf_attribute | tr '[a-z]' '[A-Z]'`
3724
3725                 cf_directive="__attribute__(($cf_attribute))"
3726                 echo "checking for $CC $cf_directive" 1>&5
3727                 case $cf_attribute in
3728                 scanf|printf)
3729                 cat >conftest.h <<EOF
3730 #define GCC_$CF_ATTRIBUTE 1
3731 EOF
3732                         ;;
3733                 *)
3734                 cat >conftest.h <<EOF
3735 #define GCC_$CF_ATTRIBUTE $cf_directive
3736 EOF
3737                         ;;
3738                 esac
3739                 if { (eval echo configure:3740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3740                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
3741                         cat conftest.h >>confdefs.h
3742 #               else
3743 #                       sed -e 's/__attr.*/\/*nothing*\//' conftest.h >>confdefs.h
3744                 fi
3745         done
3746 else
3747         fgrep define conftest.i >>confdefs.h
3748 fi
3749 rm -rf conftest*
3750 fi
3751
3752
3753 ###     use option --enable-assertions to turn on generation of assertion code
3754
3755 # Check whether --enable-assertions or --disable-assertions was given.
3756 if test "${enable_assertions+set}" = set; then
3757   enableval="$enable_assertions"
3758   with_assertions=$enableval
3759 else
3760   with_assertions=no
3761 fi
3762
3763 if test -n "$GCC"
3764 then
3765         if test $with_assertions = no
3766         then
3767                 cat >> confdefs.h <<\EOF
3768 #define NDEBUG 1
3769 EOF
3770
3771                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
3772         else
3773                 ADAFLAGS="$ADAFLAGS -gnata"
3774         fi
3775 fi
3776
3777 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
3778
3779 # Check whether --enable-leaks or --disable-leaks was given.
3780 if test "${enable_leaks+set}" = set; then
3781   enableval="$enable_leaks"
3782   test $enableval = no && cat >> confdefs.h <<\EOF
3783 #define NO_LEAKS 1
3784 EOF
3785
3786 fi
3787
3788 cat >> confdefs.h <<\EOF
3789 #define HAVE_NC_ALLOC_H 1
3790 EOF
3791
3792
3793 ###     use option --enable-expanded to generate certain macros as functions
3794
3795 # Check whether --enable-expanded or --disable-expanded was given.
3796 if test "${enable_expanded+set}" = set; then
3797   enableval="$enable_expanded"
3798   test $enableval = yes && cat >> confdefs.h <<\EOF
3799 #define NCURSES_EXPANDED 1
3800 EOF
3801
3802 fi
3803
3804
3805 ###     use option --disable-macros to suppress macros in favor of functions
3806
3807 # Check whether --enable-macros or --disable-macros was given.
3808 if test "${enable_macros+set}" = set; then
3809   enableval="$enable_macros"
3810   test $enableval = no && cat >> confdefs.h <<\EOF
3811 #define NCURSES_NOMACROS 1
3812 EOF
3813
3814 fi
3815
3816
3817 ###     Checks for libraries.
3818 echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6
3819 echo "configure:3820: checking for gettimeofday" >&5
3820 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then
3821   echo $ac_n "(cached) $ac_c" 1>&6
3822 else
3823   cat > conftest.$ac_ext <<EOF
3824 #line 3825 "configure"
3825 #include "confdefs.h"
3826 /* System header to define __stub macros and hopefully few prototypes,
3827     which can conflict with char gettimeofday(); below.  */
3828 #include <assert.h>
3829 /* Override any gcc2 internal prototype to avoid an error.  */
3830 /* We use char because int might match the return type of a gcc2
3831     builtin and then its argument prototype would still apply.  */
3832 char gettimeofday();
3833
3834 int main() {
3835
3836 /* The GNU C library defines this for functions which it implements
3837     to always fail with ENOSYS.  Some functions are actually named
3838     something starting with __ and the normal name is an alias.  */
3839 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
3840 choke me
3841 #else
3842 gettimeofday();
3843 #endif
3844
3845 ; return 0; }
3846 EOF
3847 if { (eval echo configure:3848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3848   rm -rf conftest*
3849   eval "ac_cv_func_gettimeofday=yes"
3850 else
3851   echo "configure: failed program was:" >&5
3852   cat conftest.$ac_ext >&5
3853   rm -rf conftest*
3854   eval "ac_cv_func_gettimeofday=no"
3855 fi
3856 rm -f conftest*
3857 fi
3858
3859 if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then
3860   echo "$ac_t""yes" 1>&6
3861   cat >> confdefs.h <<\EOF
3862 #define HAVE_GETTIMEOFDAY 1
3863 EOF
3864
3865 else
3866   echo "$ac_t""no" 1>&6
3867
3868
3869 echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
3870 echo "configure:3871: checking for gettimeofday in -lbsd" >&5
3871 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
3872 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3873   echo $ac_n "(cached) $ac_c" 1>&6
3874 else
3875   ac_save_LIBS="$LIBS"
3876 LIBS="-lbsd  $LIBS"
3877 cat > conftest.$ac_ext <<EOF
3878 #line 3879 "configure"
3879 #include "confdefs.h"
3880 /* Override any gcc2 internal prototype to avoid an error.  */
3881 /* We use char because int might match the return type of a gcc2
3882     builtin and then its argument prototype would still apply.  */
3883 char gettimeofday();
3884
3885 int main() {
3886 gettimeofday()
3887 ; return 0; }
3888 EOF
3889 if { (eval echo configure:3890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3890   rm -rf conftest*
3891   eval "ac_cv_lib_$ac_lib_var=yes"
3892 else
3893   echo "configure: failed program was:" >&5
3894   cat conftest.$ac_ext >&5
3895   rm -rf conftest*
3896   eval "ac_cv_lib_$ac_lib_var=no"
3897 fi
3898 rm -f conftest*
3899 LIBS="$ac_save_LIBS"
3900
3901 fi
3902 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3903   echo "$ac_t""yes" 1>&6
3904   cat >> confdefs.h <<\EOF
3905 #define HAVE_GETTIMEOFDAY 1
3906 EOF
3907
3908         LIBS="$LIBS -lbsd"
3909 else
3910   echo "$ac_t""no" 1>&6
3911 fi
3912
3913 fi
3914
3915
3916 echo $ac_n "checking if -lm needed for math functions""... $ac_c" 1>&6
3917 echo "configure:3918: checking if -lm needed for math functions" >&5
3918 if eval "test \"`echo '$''{'cf_cv_need_libm'+set}'`\" = set"; then
3919   echo $ac_n "(cached) $ac_c" 1>&6
3920 else
3921   
3922         cat > conftest.$ac_ext <<EOF
3923 #line 3924 "configure"
3924 #include "confdefs.h"
3925
3926         #include <stdio.h>
3927         #include <math.h>
3928         
3929 int main() {
3930 double x = rand(); printf("result = %g\n", sin(x))
3931 ; return 0; }
3932 EOF
3933 if { (eval echo configure:3934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3934   rm -rf conftest*
3935   cf_cv_need_libm=no
3936 else
3937   echo "configure: failed program was:" >&5
3938   cat conftest.$ac_ext >&5
3939   rm -rf conftest*
3940   cf_cv_need_libm=yes
3941 fi
3942 rm -f conftest*
3943 fi
3944
3945 echo "$ac_t""$cf_cv_need_libm" 1>&6
3946 if test "$cf_cv_need_libm" = yes
3947 then
3948 MATH_LIB=-lm
3949 fi
3950
3951
3952
3953 ###     Checks for header files.
3954 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3955 echo "configure:3956: checking for ANSI C header files" >&5
3956 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
3957   echo $ac_n "(cached) $ac_c" 1>&6
3958 else
3959   cat > conftest.$ac_ext <<EOF
3960 #line 3961 "configure"
3961 #include "confdefs.h"
3962 #include <stdlib.h>
3963 #include <stdarg.h>
3964 #include <string.h>
3965 #include <float.h>
3966 EOF
3967 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3968 { (eval echo configure:3969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3969 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3970 if test -z "$ac_err"; then
3971   rm -rf conftest*
3972   ac_cv_header_stdc=yes
3973 else
3974   echo "$ac_err" >&5
3975   echo "configure: failed program was:" >&5
3976   cat conftest.$ac_ext >&5
3977   rm -rf conftest*
3978   ac_cv_header_stdc=no
3979 fi
3980 rm -f conftest*
3981
3982 if test $ac_cv_header_stdc = yes; then
3983   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3984 cat > conftest.$ac_ext <<EOF
3985 #line 3986 "configure"
3986 #include "confdefs.h"
3987 #include <string.h>
3988 EOF
3989 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3990   egrep "memchr" >/dev/null 2>&1; then
3991   :
3992 else
3993   rm -rf conftest*
3994   ac_cv_header_stdc=no
3995 fi
3996 rm -f conftest*
3997
3998 fi
3999
4000 if test $ac_cv_header_stdc = yes; then
4001   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4002 cat > conftest.$ac_ext <<EOF
4003 #line 4004 "configure"
4004 #include "confdefs.h"
4005 #include <stdlib.h>
4006 EOF
4007 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4008   egrep "free" >/dev/null 2>&1; then
4009   :
4010 else
4011   rm -rf conftest*
4012   ac_cv_header_stdc=no
4013 fi
4014 rm -f conftest*
4015
4016 fi
4017
4018 if test $ac_cv_header_stdc = yes; then
4019   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4020 if test "$cross_compiling" = yes; then
4021   :
4022 else
4023   cat > conftest.$ac_ext <<EOF
4024 #line 4025 "configure"
4025 #include "confdefs.h"
4026 #include <ctype.h>
4027 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4028 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4029 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4030 int main () { int i; for (i = 0; i < 256; i++)
4031 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4032 exit (0); }
4033
4034 EOF
4035 if { (eval echo configure:4036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4036 then
4037   :
4038 else
4039   echo "configure: failed program was:" >&5
4040   cat conftest.$ac_ext >&5
4041   rm -fr conftest*
4042   ac_cv_header_stdc=no
4043 fi
4044 rm -fr conftest*
4045 fi
4046
4047 fi
4048 fi
4049
4050 echo "$ac_t""$ac_cv_header_stdc" 1>&6
4051 if test $ac_cv_header_stdc = yes; then
4052   cat >> confdefs.h <<\EOF
4053 #define STDC_HEADERS 1
4054 EOF
4055
4056 fi
4057
4058 ac_header_dirent=no
4059 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4060 do
4061 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4062 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4063 echo "configure:4064: checking for $ac_hdr that defines DIR" >&5
4064 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
4065   echo $ac_n "(cached) $ac_c" 1>&6
4066 else
4067   cat > conftest.$ac_ext <<EOF
4068 #line 4069 "configure"
4069 #include "confdefs.h"
4070 #include <sys/types.h>
4071 #include <$ac_hdr>
4072 int main() {
4073 DIR *dirp = 0;
4074 ; return 0; }
4075 EOF
4076 if { (eval echo configure:4077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4077   rm -rf conftest*
4078   eval "ac_cv_header_dirent_$ac_safe=yes"
4079 else
4080   echo "configure: failed program was:" >&5
4081   cat conftest.$ac_ext >&5
4082   rm -rf conftest*
4083   eval "ac_cv_header_dirent_$ac_safe=no"
4084 fi
4085 rm -f conftest*
4086 fi
4087 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4088   echo "$ac_t""yes" 1>&6
4089     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4090   cat >> confdefs.h <<EOF
4091 #define $ac_tr_hdr 1
4092 EOF
4093  ac_header_dirent=$ac_hdr; break
4094 else
4095   echo "$ac_t""no" 1>&6
4096 fi
4097 done
4098 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4099 if test $ac_header_dirent = dirent.h; then
4100 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4101 echo "configure:4102: checking for opendir in -ldir" >&5
4102 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
4103 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4104   echo $ac_n "(cached) $ac_c" 1>&6
4105 else
4106   ac_save_LIBS="$LIBS"
4107 LIBS="-ldir  $LIBS"
4108 cat > conftest.$ac_ext <<EOF
4109 #line 4110 "configure"
4110 #include "confdefs.h"
4111 /* Override any gcc2 internal prototype to avoid an error.  */
4112 /* We use char because int might match the return type of a gcc2
4113     builtin and then its argument prototype would still apply.  */
4114 char opendir();
4115
4116 int main() {
4117 opendir()
4118 ; return 0; }
4119 EOF
4120 if { (eval echo configure:4121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4121   rm -rf conftest*
4122   eval "ac_cv_lib_$ac_lib_var=yes"
4123 else
4124   echo "configure: failed program was:" >&5
4125   cat conftest.$ac_ext >&5
4126   rm -rf conftest*
4127   eval "ac_cv_lib_$ac_lib_var=no"
4128 fi
4129 rm -f conftest*
4130 LIBS="$ac_save_LIBS"
4131
4132 fi
4133 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4134   echo "$ac_t""yes" 1>&6
4135   LIBS="$LIBS -ldir"
4136 else
4137   echo "$ac_t""no" 1>&6
4138 fi
4139
4140 else
4141 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4142 echo "configure:4143: checking for opendir in -lx" >&5
4143 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
4144 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4145   echo $ac_n "(cached) $ac_c" 1>&6
4146 else
4147   ac_save_LIBS="$LIBS"
4148 LIBS="-lx  $LIBS"
4149 cat > conftest.$ac_ext <<EOF
4150 #line 4151 "configure"
4151 #include "confdefs.h"
4152 /* Override any gcc2 internal prototype to avoid an error.  */
4153 /* We use char because int might match the return type of a gcc2
4154     builtin and then its argument prototype would still apply.  */
4155 char opendir();
4156
4157 int main() {
4158 opendir()
4159 ; return 0; }
4160 EOF
4161 if { (eval echo configure:4162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4162   rm -rf conftest*
4163   eval "ac_cv_lib_$ac_lib_var=yes"
4164 else
4165   echo "configure: failed program was:" >&5
4166   cat conftest.$ac_ext >&5
4167   rm -rf conftest*
4168   eval "ac_cv_lib_$ac_lib_var=no"
4169 fi
4170 rm -f conftest*
4171 LIBS="$ac_save_LIBS"
4172
4173 fi
4174 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4175   echo "$ac_t""yes" 1>&6
4176   LIBS="$LIBS -lx"
4177 else
4178   echo "$ac_t""no" 1>&6
4179 fi
4180
4181 fi
4182
4183
4184 echo $ac_n "checking for regular-expression headers""... $ac_c" 1>&6
4185 echo "configure:4186: checking for regular-expression headers" >&5
4186 if eval "test \"`echo '$''{'cf_cv_regex'+set}'`\" = set"; then
4187   echo $ac_n "(cached) $ac_c" 1>&6
4188 else
4189   
4190 cat > conftest.$ac_ext <<EOF
4191 #line 4192 "configure"
4192 #include "confdefs.h"
4193 #include <sys/types.h>
4194 #include <regex.h>
4195 int main() {
4196
4197         regex_t *p;
4198         int x = regcomp(p, "", 0);
4199         int y = regexec(p, "", 0, 0, 0);
4200         regfree(p);
4201         
4202 ; return 0; }
4203 EOF
4204 if { (eval echo configure:4205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4205   rm -rf conftest*
4206   cf_cv_regex="regex.h"
4207 else
4208   echo "configure: failed program was:" >&5
4209   cat conftest.$ac_ext >&5
4210   rm -rf conftest*
4211   
4212         cat > conftest.$ac_ext <<EOF
4213 #line 4214 "configure"
4214 #include "confdefs.h"
4215 #include <regexp.h>
4216 int main() {
4217
4218                 char *p = compile("", "", "", 0);
4219                 int x = step("", "");
4220         
4221 ; return 0; }
4222 EOF
4223 if { (eval echo configure:4224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4224   rm -rf conftest*
4225   cf_cv_regex="regexp.h"
4226 else
4227   echo "configure: failed program was:" >&5
4228   cat conftest.$ac_ext >&5
4229   rm -rf conftest*
4230   
4231                 cf_save_LIBS="$LIBS"
4232                 LIBS="-lgen $LIBS"
4233                 cat > conftest.$ac_ext <<EOF
4234 #line 4235 "configure"
4235 #include "confdefs.h"
4236 #include <regexpr.h>
4237 int main() {
4238
4239                         char *p = compile("", "", "");
4240                         int x = step("", "");
4241                 
4242 ; return 0; }
4243 EOF
4244 if { (eval echo configure:4245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4245   rm -rf conftest*
4246   cf_cv_regex="regexpr.h"
4247 else
4248   echo "configure: failed program was:" >&5
4249   cat conftest.$ac_ext >&5
4250   rm -rf conftest*
4251   LIBS="$cf_save_LIBS"
4252 fi
4253 rm -f conftest*
4254 fi
4255 rm -f conftest*
4256 fi
4257 rm -f conftest*
4258
4259 fi
4260
4261 echo "$ac_t""$cf_cv_regex" 1>&6
4262 case $cf_cv_regex in
4263         regex.h)   cat >> confdefs.h <<\EOF
4264 #define HAVE_REGEX_H_FUNCS 1
4265 EOF
4266  ;;
4267         regexp.h)  cat >> confdefs.h <<\EOF
4268 #define HAVE_REGEXP_H_FUNCS 1
4269 EOF
4270  ;;
4271         regexpr.h) cat >> confdefs.h <<\EOF
4272 #define HAVE_REGEXPR_H_FUNCS 1
4273 EOF
4274  ;;
4275 esac
4276
4277
4278 for ac_hdr in \
4279 fcntl.h \
4280 getopt.h \
4281 libc.h \
4282 limits.h \
4283 locale.h \
4284 poll.h \
4285 sys/bsdtypes.h \
4286 sys/ioctl.h \
4287 sys/param.h \
4288 sys/poll.h \
4289 sys/select.h \
4290 sys/time.h \
4291 sys/times.h \
4292 termio.h \
4293 termios.h \
4294 ttyent.h \
4295 unistd.h \
4296
4297 do
4298 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4299 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4300 echo "configure:4301: checking for $ac_hdr" >&5
4301 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4302   echo $ac_n "(cached) $ac_c" 1>&6
4303 else
4304   cat > conftest.$ac_ext <<EOF
4305 #line 4306 "configure"
4306 #include "confdefs.h"
4307 #include <$ac_hdr>
4308 EOF
4309 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4310 { (eval echo configure:4311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4311 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4312 if test -z "$ac_err"; then
4313   rm -rf conftest*
4314   eval "ac_cv_header_$ac_safe=yes"
4315 else
4316   echo "$ac_err" >&5
4317   echo "configure: failed program was:" >&5
4318   cat conftest.$ac_ext >&5
4319   rm -rf conftest*
4320   eval "ac_cv_header_$ac_safe=no"
4321 fi
4322 rm -f conftest*
4323 fi
4324 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4325   echo "$ac_t""yes" 1>&6
4326     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4327   cat >> confdefs.h <<EOF
4328 #define $ac_tr_hdr 1
4329 EOF
4330  
4331 else
4332   echo "$ac_t""no" 1>&6
4333 fi
4334 done
4335
4336
4337 # check for ISC (this may also define _POSIX_SOURCE)
4338 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
4339 if test "$ISC" = yes ; then
4340         echo $ac_n "checking for main in -lcposix""... $ac_c" 1>&6
4341 echo "configure:4342: checking for main in -lcposix" >&5
4342 ac_lib_var=`echo cposix'_'main | sed 'y%./+-%__p_%'`
4343 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4344   echo $ac_n "(cached) $ac_c" 1>&6
4345 else
4346   ac_save_LIBS="$LIBS"
4347 LIBS="-lcposix  $LIBS"
4348 cat > conftest.$ac_ext <<EOF
4349 #line 4350 "configure"
4350 #include "confdefs.h"
4351
4352 int main() {
4353 main()
4354 ; return 0; }
4355 EOF
4356 if { (eval echo configure:4357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4357   rm -rf conftest*
4358   eval "ac_cv_lib_$ac_lib_var=yes"
4359 else
4360   echo "configure: failed program was:" >&5
4361   cat conftest.$ac_ext >&5
4362   rm -rf conftest*
4363   eval "ac_cv_lib_$ac_lib_var=no"
4364 fi
4365 rm -f conftest*
4366 LIBS="$ac_save_LIBS"
4367
4368 fi
4369 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4370   echo "$ac_t""yes" 1>&6
4371     ac_tr_lib=HAVE_LIB`echo cposix | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4372     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4373   cat >> confdefs.h <<EOF
4374 #define $ac_tr_lib 1
4375 EOF
4376
4377   LIBS="-lcposix $LIBS"
4378
4379 else
4380   echo "$ac_t""no" 1>&6
4381 fi
4382
4383         echo $ac_n "checking for bzero in -linet""... $ac_c" 1>&6
4384 echo "configure:4385: checking for bzero in -linet" >&5
4385 ac_lib_var=`echo inet'_'bzero | sed 'y%./+-%__p_%'`
4386 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4387   echo $ac_n "(cached) $ac_c" 1>&6
4388 else
4389   ac_save_LIBS="$LIBS"
4390 LIBS="-linet  $LIBS"
4391 cat > conftest.$ac_ext <<EOF
4392 #line 4393 "configure"
4393 #include "confdefs.h"
4394 /* Override any gcc2 internal prototype to avoid an error.  */
4395 /* We use char because int might match the return type of a gcc2
4396     builtin and then its argument prototype would still apply.  */
4397 char bzero();
4398
4399 int main() {
4400 bzero()
4401 ; return 0; }
4402 EOF
4403 if { (eval echo configure:4404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4404   rm -rf conftest*
4405   eval "ac_cv_lib_$ac_lib_var=yes"
4406 else
4407   echo "configure: failed program was:" >&5
4408   cat conftest.$ac_ext >&5
4409   rm -rf conftest*
4410   eval "ac_cv_lib_$ac_lib_var=no"
4411 fi
4412 rm -f conftest*
4413 LIBS="$ac_save_LIBS"
4414
4415 fi
4416 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4417   echo "$ac_t""yes" 1>&6
4418   LIBS="$LIBS -linet"
4419 else
4420   echo "$ac_t""no" 1>&6
4421 fi
4422         for ac_hdr in sys/termio.h 
4423 do
4424 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4425 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4426 echo "configure:4427: checking for $ac_hdr" >&5
4427 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4428   echo $ac_n "(cached) $ac_c" 1>&6
4429 else
4430   cat > conftest.$ac_ext <<EOF
4431 #line 4432 "configure"
4432 #include "confdefs.h"
4433 #include <$ac_hdr>
4434 EOF
4435 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4436 { (eval echo configure:4437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4437 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4438 if test -z "$ac_err"; then
4439   rm -rf conftest*
4440   eval "ac_cv_header_$ac_safe=yes"
4441 else
4442   echo "$ac_err" >&5
4443   echo "configure: failed program was:" >&5
4444   cat conftest.$ac_ext >&5
4445   rm -rf conftest*
4446   eval "ac_cv_header_$ac_safe=no"
4447 fi
4448 rm -f conftest*
4449 fi
4450 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4451   echo "$ac_t""yes" 1>&6
4452     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4453   cat >> confdefs.h <<EOF
4454 #define $ac_tr_hdr 1
4455 EOF
4456  
4457 else
4458   echo "$ac_t""no" 1>&6
4459 fi
4460 done
4461
4462 fi
4463
4464
4465 echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
4466 echo "configure:4467: checking if sys/time.h works with sys/select.h" >&5
4467 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
4468   echo $ac_n "(cached) $ac_c" 1>&6
4469 else
4470   
4471 cat > conftest.$ac_ext <<EOF
4472 #line 4473 "configure"
4473 #include "confdefs.h"
4474
4475 #include <sys/types.h>
4476 #if HAVE_SYS_TIME_H
4477 #include <sys/time.h>
4478 #endif
4479 #if HAVE_SYS_SELECT_H
4480 #include <sys/select.h>
4481 #endif
4482
4483 int main() {
4484
4485 ; return 0; }
4486 EOF
4487 if { (eval echo configure:4488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4488   rm -rf conftest*
4489   cf_cv_sys_time_select=yes
4490 else
4491   echo "configure: failed program was:" >&5
4492   cat conftest.$ac_ext >&5
4493   rm -rf conftest*
4494   cf_cv_sys_time_select=no
4495 fi
4496 rm -f conftest*
4497      
4498 fi
4499
4500 echo "$ac_t""$cf_cv_sys_time_select" 1>&6
4501 test $cf_cv_sys_time_select = yes && cat >> confdefs.h <<\EOF
4502 #define HAVE_SYS_TIME_SELECT 1
4503 EOF
4504
4505
4506
4507 ###     checks for compiler characteristics
4508 ac_ext=c
4509 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
4510 ac_cpp='$CPP $CPPFLAGS'
4511 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
4512 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
4513 cross_compiling=$ac_cv_prog_cc_cross
4514
4515 echo $ac_n "checking for working const""... $ac_c" 1>&6
4516 echo "configure:4517: checking for working const" >&5
4517 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
4518   echo $ac_n "(cached) $ac_c" 1>&6
4519 else
4520   cat > conftest.$ac_ext <<EOF
4521 #line 4522 "configure"
4522 #include "confdefs.h"
4523
4524 int main() {
4525
4526 /* Ultrix mips cc rejects this.  */
4527 typedef int charset[2]; const charset x;
4528 /* SunOS 4.1.1 cc rejects this.  */
4529 char const *const *ccp;
4530 char **p;
4531 /* NEC SVR4.0.2 mips cc rejects this.  */
4532 struct point {int x, y;};
4533 static struct point const zero = {0,0};
4534 /* AIX XL C 1.02.0.0 rejects this.
4535    It does not let you subtract one const X* pointer from another in an arm
4536    of an if-expression whose if-part is not a constant expression */
4537 const char *g = "string";
4538 ccp = &g + (g ? g-g : 0);
4539 /* HPUX 7.0 cc rejects these. */
4540 ++ccp;
4541 p = (char**) ccp;
4542 ccp = (char const *const *) p;
4543 { /* SCO 3.2v4 cc rejects this.  */
4544   char *t;
4545   char const *s = 0 ? (char *) 0 : (char const *) 0;
4546
4547   *t++ = 0;
4548 }
4549 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
4550   int x[] = {25, 17};
4551   const int *foo = &x[0];
4552   ++foo;
4553 }
4554 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4555   typedef const int *iptr;
4556   iptr p = 0;
4557   ++p;
4558 }
4559 { /* AIX XL C 1.02.0.0 rejects this saying
4560      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4561   struct s { int j; const int *ap[3]; };
4562   struct s *b; b->j = 5;
4563 }
4564 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4565   const int foo = 10;
4566 }
4567
4568 ; return 0; }
4569 EOF
4570 if { (eval echo configure:4571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4571   rm -rf conftest*
4572   ac_cv_c_const=yes
4573 else
4574   echo "configure: failed program was:" >&5
4575   cat conftest.$ac_ext >&5
4576   rm -rf conftest*
4577   ac_cv_c_const=no
4578 fi
4579 rm -f conftest*
4580 fi
4581
4582 echo "$ac_t""$ac_cv_c_const" 1>&6
4583 if test $ac_cv_c_const = no; then
4584   cat >> confdefs.h <<\EOF
4585 #define const 
4586 EOF
4587
4588 fi
4589
4590 echo $ac_n "checking for inline""... $ac_c" 1>&6
4591 echo "configure:4592: checking for inline" >&5
4592 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
4593   echo $ac_n "(cached) $ac_c" 1>&6
4594 else
4595   ac_cv_c_inline=no
4596 for ac_kw in inline __inline__ __inline; do
4597   cat > conftest.$ac_ext <<EOF
4598 #line 4599 "configure"
4599 #include "confdefs.h"
4600
4601 int main() {
4602 } $ac_kw foo() {
4603 ; return 0; }
4604 EOF
4605 if { (eval echo configure:4606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4606   rm -rf conftest*
4607   ac_cv_c_inline=$ac_kw; break
4608 else
4609   echo "configure: failed program was:" >&5
4610   cat conftest.$ac_ext >&5
4611 fi
4612 rm -f conftest*
4613 done
4614
4615 fi
4616
4617 echo "$ac_t""$ac_cv_c_inline" 1>&6
4618 case "$ac_cv_c_inline" in
4619   inline | yes) ;;
4620   no) cat >> confdefs.h <<\EOF
4621 #define inline 
4622 EOF
4623  ;;
4624   *)  cat >> confdefs.h <<EOF
4625 #define inline $ac_cv_c_inline
4626 EOF
4627  ;;
4628 esac
4629
4630 test $ac_cv_c_inline != no && cat >> confdefs.h <<\EOF
4631 #define CC_HAS_INLINE_FUNCS 1
4632 EOF
4633
4634
4635
4636 echo $ac_n "checking if unsigned literals are legal""... $ac_c" 1>&6
4637 echo "configure:4638: checking if unsigned literals are legal" >&5
4638 if eval "test \"`echo '$''{'cf_cv_unsigned_literals'+set}'`\" = set"; then
4639   echo $ac_n "(cached) $ac_c" 1>&6
4640 else
4641   
4642         cat > conftest.$ac_ext <<EOF
4643 #line 4644 "configure"
4644 #include "confdefs.h"
4645
4646 int main() {
4647 long x = 1L + 1UL + 1U + 1
4648 ; return 0; }
4649 EOF
4650 if { (eval echo configure:4651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4651   rm -rf conftest*
4652   cf_cv_unsigned_literals=yes
4653 else
4654   echo "configure: failed program was:" >&5
4655   cat conftest.$ac_ext >&5
4656   rm -rf conftest*
4657   cf_cv_unsigned_literals=no
4658 fi
4659 rm -f conftest*
4660         
4661 fi
4662
4663 echo "$ac_t""$cf_cv_unsigned_literals" 1>&6
4664
4665
4666
4667 echo $ac_n "checking for type of chtype""... $ac_c" 1>&6
4668 echo "configure:4669: checking for type of chtype" >&5
4669 if eval "test \"`echo '$''{'cf_cv_typeof_chtype'+set}'`\" = set"; then
4670   echo $ac_n "(cached) $ac_c" 1>&6
4671 else
4672   
4673                 if test "$cross_compiling" = yes; then
4674   cf_cv_typeof_chtype=long
4675 else
4676   cat > conftest.$ac_ext <<EOF
4677 #line 4678 "configure"
4678 #include "confdefs.h"
4679
4680 #if USE_WIDEC_SUPPORT
4681 #include <stddef.h>     /* we want wchar_t */
4682 #define WANT_BITS 39
4683 #else
4684 #define WANT_BITS 31
4685 #endif
4686 #include <stdio.h>
4687 int main()
4688 {
4689         FILE *fp = fopen("cf_test.out", "w");
4690         if (fp != 0) {
4691                 char *result = "long";
4692 #if USE_WIDEC_SUPPORT
4693                 /*
4694                  * If wchar_t is smaller than a long, it must be an int or a
4695                  * short.  We prefer not to use a short anyway.
4696                  */
4697                 if (sizeof(unsigned long) > sizeof(wchar_t))
4698                         result = "int";
4699 #endif
4700                 if (sizeof(unsigned long) > sizeof(unsigned int)) {
4701                         int n;
4702                         unsigned int x;
4703                         for (n = 0; n < WANT_BITS; n++) {
4704                                 unsigned int y = (x >> n);
4705                                 if (y != 1 || x == 0) {
4706                                         x = 0;
4707                                         break;
4708                                 }
4709                         }
4710                         /*
4711                          * If x is nonzero, an int is big enough for the bits
4712                          * that we want.
4713                          */
4714                         result = (x != 0) ? "int" : "long";
4715                 }
4716                 fputs(result, fp);
4717                 fclose(fp);
4718         }
4719         exit(0);
4720 }
4721                 
4722 EOF
4723 if { (eval echo configure:4724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4724 then
4725   cf_cv_typeof_chtype=`cat cf_test.out`
4726 else
4727   echo "configure: failed program was:" >&5
4728   cat conftest.$ac_ext >&5
4729   rm -fr conftest*
4730   cf_cv_typeof_chtype=long
4731 fi
4732 rm -fr conftest*
4733 fi
4734
4735                 rm -f cf_test.out
4736         
4737 fi
4738
4739 echo "$ac_t""$cf_cv_typeof_chtype" 1>&6
4740
4741
4742 cat >> confdefs.h <<EOF
4743 #define TYPEOF_CHTYPE $cf_cv_typeof_chtype
4744 EOF
4745
4746
4747 cf_cv_1UL="1"
4748 test "$cf_cv_unsigned_literals" = yes && cf_cv_1UL="${cf_cv_1UL}U"
4749 test "$cf_cv_typeof_chtype"    = long && cf_cv_1UL="${cf_cv_1UL}L"
4750
4751
4752
4753
4754
4755 echo $ac_n "checking for number of bits in chtype""... $ac_c" 1>&6
4756 echo "configure:4757: checking for number of bits in chtype" >&5
4757 if eval "test \"`echo '$''{'cf_cv_shift_limit'+set}'`\" = set"; then
4758   echo $ac_n "(cached) $ac_c" 1>&6
4759 else
4760   
4761         if test "$cross_compiling" = yes; then
4762   cf_cv_shift_limit=32
4763 else
4764   cat > conftest.$ac_ext <<EOF
4765 #line 4766 "configure"
4766 #include "confdefs.h"
4767
4768 #include <stdio.h>
4769 int main()
4770 {
4771         FILE *fp = fopen("cf_test.out", "w");
4772         if (fp != 0) {
4773                 int n;
4774                 unsigned TYPEOF_CHTYPE x = 1L;
4775                 for (n = 0; ; n++) {
4776                         unsigned long y = (x >> n);
4777                         if (y != 1 || x == 0)
4778                                 break;
4779                         x <<= 1;
4780                 }
4781                 fprintf(fp, "%d", n);
4782                 fclose(fp);
4783         }
4784         exit(0);
4785 }
4786                 
4787 EOF
4788 if { (eval echo configure:4789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4789 then
4790   cf_cv_shift_limit=`cat cf_test.out`
4791 else
4792   echo "configure: failed program was:" >&5
4793   cat conftest.$ac_ext >&5
4794   rm -fr conftest*
4795   cf_cv_shift_limit=32
4796 fi
4797 rm -fr conftest*
4798 fi
4799
4800                 rm -f cf_test.out
4801         
4802 fi
4803
4804 echo "$ac_t""$cf_cv_shift_limit" 1>&6
4805
4806
4807 echo $ac_n "checking for width of character-index""... $ac_c" 1>&6
4808 echo "configure:4809: checking for width of character-index" >&5
4809 if eval "test \"`echo '$''{'cf_cv_widec_shift'+set}'`\" = set"; then
4810   echo $ac_n "(cached) $ac_c" 1>&6
4811 else
4812   
4813 if test ".$with_widec" = ".yes" ; then
4814         cf_attrs_width=39
4815         if ( expr $cf_cv_shift_limit \> $cf_attrs_width >/dev/null )
4816         then
4817                 cf_cv_widec_shift=`expr 16 + $cf_cv_shift_limit - $cf_attrs_width`
4818         else
4819                 cf_cv_widec_shift=16
4820         fi
4821 else
4822         cf_cv_widec_shift=8
4823 fi
4824
4825 fi
4826
4827 echo "$ac_t""$cf_cv_widec_shift" 1>&6
4828
4829
4830
4831 ###     Checks for external-data
4832
4833
4834 echo $ac_n "checking if external errno is declared""... $ac_c" 1>&6
4835 echo "configure:4836: checking if external errno is declared" >&5
4836 if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then
4837   echo $ac_n "(cached) $ac_c" 1>&6
4838 else
4839   
4840     cat > conftest.$ac_ext <<EOF
4841 #line 4842 "configure"
4842 #include "confdefs.h"
4843
4844 #ifdef HAVE_STDLIB_H
4845 #include <stdlib.h>
4846 #endif
4847 #include <stdio.h>
4848 #include <sys/types.h>
4849 #include <errno.h> 
4850 int main() {
4851 long x = (long) errno
4852 ; return 0; }
4853 EOF
4854 if { (eval echo configure:4855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4855   rm -rf conftest*
4856   eval 'cf_cv_dcl_'errno'=yes'
4857 else
4858   echo "configure: failed program was:" >&5
4859   cat conftest.$ac_ext >&5
4860   rm -rf conftest*
4861   eval 'cf_cv_dcl_'errno'=no'
4862 fi
4863 rm -f conftest*
4864
4865 fi
4866
4867
4868 eval 'cf_result=$cf_cv_dcl_'errno
4869 echo "$ac_t""$cf_result" 1>&6
4870
4871 if test "$cf_result" = no ; then
4872     eval 'cf_result=DECL_'errno
4873     
4874 cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`
4875
4876     cat >> confdefs.h <<EOF
4877 #define $cf_result 1
4878 EOF
4879
4880 fi
4881
4882 # It's possible (for near-UNIX clones) that the data doesn't exist
4883
4884 echo $ac_n "checking if external errno exists""... $ac_c" 1>&6
4885 echo "configure:4886: checking if external errno exists" >&5
4886 if eval "test \"`echo '$''{'cf_cv_have_errno'+set}'`\" = set"; then
4887   echo $ac_n "(cached) $ac_c" 1>&6
4888 else
4889   
4890     cat > conftest.$ac_ext <<EOF
4891 #line 4892 "configure"
4892 #include "confdefs.h"
4893
4894 #undef errno
4895 extern int errno;
4896
4897 int main() {
4898 errno = 2
4899 ; return 0; }
4900 EOF
4901 if { (eval echo configure:4902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4902   rm -rf conftest*
4903   eval 'cf_cv_have_'errno'=yes'
4904 else
4905   echo "configure: failed program was:" >&5
4906   cat conftest.$ac_ext >&5
4907   rm -rf conftest*
4908   eval 'cf_cv_have_'errno'=no'
4909 fi
4910 rm -f conftest*
4911 fi
4912
4913
4914 eval 'cf_result=$cf_cv_have_'errno
4915 echo "$ac_t""$cf_result" 1>&6
4916
4917 if test "$cf_result" = yes ; then
4918     eval 'cf_result=HAVE_'errno
4919     
4920 cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`
4921
4922     cat >> confdefs.h <<EOF
4923 #define $cf_result 1
4924 EOF
4925
4926 fi
4927
4928
4929
4930
4931
4932 echo $ac_n "checking if data-only library module links""... $ac_c" 1>&6
4933 echo "configure:4934: checking if data-only library module links" >&5
4934 if eval "test \"`echo '$''{'cf_cv_link_dataonly'+set}'`\" = set"; then
4935   echo $ac_n "(cached) $ac_c" 1>&6
4936 else
4937   
4938         rm -f conftest.a
4939                 cat >conftest.$ac_ext <<EOF
4940 #line 4941 "configure"
4941 int     testdata[3] = { 123, 456, 789 };
4942 EOF
4943                 if { (eval echo configure:4944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } ; then
4944                 mv conftest.o data.o && \
4945                 ( $AR $AR_OPTS conftest.a data.o ) 2>&5 1>/dev/null
4946         fi
4947         rm -f conftest.$ac_ext data.o
4948                 cat >conftest.$ac_ext <<EOF
4949 #line 4950 "configure"
4950 int     testfunc()
4951 {
4952 #if defined(NeXT)
4953         exit(1);        /* I'm told this linker is broken */
4954 #else
4955         extern int testdata[3];
4956         return testdata[0] == 123
4957            &&  testdata[1] == 456
4958            &&  testdata[2] == 789;
4959 #endif
4960 }
4961 EOF
4962                 if { (eval echo configure:4963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4963                 mv conftest.o func.o && \
4964                 ( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null
4965         fi
4966         rm -f conftest.$ac_ext func.o
4967         ( eval $ac_cv_prog_RANLIB conftest.a ) 2>&5 >/dev/null
4968         cf_saveLIBS="$LIBS"
4969         LIBS="conftest.a $LIBS"
4970         if test "$cross_compiling" = yes; then
4971   cf_cv_link_dataonly=unknown
4972 else
4973   cat > conftest.$ac_ext <<EOF
4974 #line 4975 "configure"
4975 #include "confdefs.h"
4976
4977         int main()
4978         {
4979                 extern int testfunc();
4980                 exit (!testfunc());
4981         }
4982         
4983 EOF
4984 if { (eval echo configure:4985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4985 then
4986   cf_cv_link_dataonly=yes
4987 else
4988   echo "configure: failed program was:" >&5
4989   cat conftest.$ac_ext >&5
4990   rm -fr conftest*
4991   cf_cv_link_dataonly=no
4992 fi
4993 rm -fr conftest*
4994 fi
4995
4996         LIBS="$cf_saveLIBS"
4997         
4998 fi
4999
5000 echo "$ac_t""$cf_cv_link_dataonly" 1>&6
5001 test $cf_cv_link_dataonly = no && cat >> confdefs.h <<\EOF
5002 #define BROKEN_LINKER 1
5003 EOF
5004
5005
5006
5007 echo $ac_n "checking for speed_t""... $ac_c" 1>&6
5008 echo "configure:5009: checking for speed_t" >&5
5009 OSPEED_INCLUDES=
5010 cat > conftest.$ac_ext <<EOF
5011 #line 5012 "configure"
5012 #include "confdefs.h"
5013 #include <sys/types.h>
5014 int main() {
5015 speed_t some_variable = 0
5016 ; return 0; }
5017 EOF
5018 if { (eval echo configure:5019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5019   rm -rf conftest*
5020   OSPEED_TYPE=speed_t
5021 else
5022   echo "configure: failed program was:" >&5
5023   cat conftest.$ac_ext >&5
5024   rm -rf conftest*
5025   OSPEED_TYPE=unsigned
5026 fi
5027 rm -f conftest*
5028 cat > conftest.$ac_ext <<EOF
5029 #line 5030 "configure"
5030 #include "confdefs.h"
5031 #include <termios.h>
5032 int main() {
5033 speed_t some_variable = 0
5034 ; return 0; }
5035 EOF
5036 if { (eval echo configure:5037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5037   rm -rf conftest*
5038   OSPEED_TYPE=speed_t
5039          OSPEED_INCLUDES="#include <termios.h>"
5040 else
5041   echo "configure: failed program was:" >&5
5042   cat conftest.$ac_ext >&5
5043 fi
5044 rm -f conftest*
5045
5046
5047 if test "$OSPEED_TYPE" = "unsigned" ; then
5048         echo "$ac_t""no" 1>&6
5049         cat >> confdefs.h <<\EOF
5050 #define speed_t unsigned
5051 EOF
5052
5053 else
5054         echo "$ac_t""yes" 1>&6
5055 fi
5056
5057
5058 ###     Checks for library functions.
5059 for ac_func in \
5060 getcwd \
5061 getttynam \
5062 memccpy \
5063 mkstemp \
5064 nanosleep \
5065 poll \
5066 remove \
5067 select \
5068 setbuf \
5069 setbuffer \
5070 setvbuf \
5071 sigaction \
5072 sigvec \
5073 strdup \
5074 strstr \
5075 tcgetattr \
5076 tcgetpgrp \
5077 times \
5078 vfscanf \
5079 vsnprintf \
5080 vsscanf \
5081
5082 do
5083 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5084 echo "configure:5085: checking for $ac_func" >&5
5085 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5086   echo $ac_n "(cached) $ac_c" 1>&6
5087 else
5088   cat > conftest.$ac_ext <<EOF
5089 #line 5090 "configure"
5090 #include "confdefs.h"
5091 /* System header to define __stub macros and hopefully few prototypes,
5092     which can conflict with char $ac_func(); below.  */
5093 #include <assert.h>
5094 /* Override any gcc2 internal prototype to avoid an error.  */
5095 /* We use char because int might match the return type of a gcc2
5096     builtin and then its argument prototype would still apply.  */
5097 char $ac_func();
5098
5099 int main() {
5100
5101 /* The GNU C library defines this for functions which it implements
5102     to always fail with ENOSYS.  Some functions are actually named
5103     something starting with __ and the normal name is an alias.  */
5104 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5105 choke me
5106 #else
5107 $ac_func();
5108 #endif
5109
5110 ; return 0; }
5111 EOF
5112 if { (eval echo configure:5113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5113   rm -rf conftest*
5114   eval "ac_cv_func_$ac_func=yes"
5115 else
5116   echo "configure: failed program was:" >&5
5117   cat conftest.$ac_ext >&5
5118   rm -rf conftest*
5119   eval "ac_cv_func_$ac_func=no"
5120 fi
5121 rm -f conftest*
5122 fi
5123
5124 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5125   echo "$ac_t""yes" 1>&6
5126     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5127   cat >> confdefs.h <<EOF
5128 #define $ac_tr_func 1
5129 EOF
5130  
5131 else
5132   echo "$ac_t""no" 1>&6
5133 fi
5134 done
5135
5136 if test "$with_getcap" = "yes" ; then
5137         
5138 echo $ac_n "checking for terminal-capability database functions""... $ac_c" 1>&6
5139 echo "configure:5140: checking for terminal-capability database functions" >&5
5140 if eval "test \"`echo '$''{'cf_cv_cgetent'+set}'`\" = set"; then
5141   echo $ac_n "(cached) $ac_c" 1>&6
5142 else
5143   
5144 cat > conftest.$ac_ext <<EOF
5145 #line 5146 "configure"
5146 #include "confdefs.h"
5147
5148 #include <stdlib.h>
5149 int main() {
5150
5151         char temp[128];
5152         char *buf = temp;
5153         char *db_array = temp;
5154         cgetent(&buf, /* int *, */ &db_array, "vt100");
5155         cgetcap(buf, "tc", '=');
5156         cgetmatch(buf, "tc");
5157         
5158 ; return 0; }
5159 EOF
5160 if { (eval echo configure:5161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5161   rm -rf conftest*
5162   cf_cv_cgetent=yes
5163 else
5164   echo "configure: failed program was:" >&5
5165   cat conftest.$ac_ext >&5
5166   rm -rf conftest*
5167   cf_cv_cgetent=no
5168 fi
5169 rm -f conftest*
5170
5171 fi
5172
5173 echo "$ac_t""$cf_cv_cgetent" 1>&6
5174 test $cf_cv_cgetent = yes && cat >> confdefs.h <<\EOF
5175 #define HAVE_BSD_CGETENT 1
5176 EOF
5177
5178
5179 fi
5180
5181
5182 echo $ac_n "checking for isascii""... $ac_c" 1>&6
5183 echo "configure:5184: checking for isascii" >&5
5184 if eval "test \"`echo '$''{'cf_cv_have_isascii'+set}'`\" = set"; then
5185   echo $ac_n "(cached) $ac_c" 1>&6
5186 else
5187   
5188         cat > conftest.$ac_ext <<EOF
5189 #line 5190 "configure"
5190 #include "confdefs.h"
5191 #include <ctype.h>
5192 int main() {
5193 int x = isascii(' ')
5194 ; return 0; }
5195 EOF
5196 if { (eval echo configure:5197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5197   rm -rf conftest*
5198   cf_cv_have_isascii=yes
5199 else
5200   echo "configure: failed program was:" >&5
5201   cat conftest.$ac_ext >&5
5202   rm -rf conftest*
5203   cf_cv_have_isascii=no
5204 fi
5205 rm -f conftest*
5206
5207 fi
5208 echo "$ac_t""$cf_cv_have_isascii" 1>&6
5209 test $cf_cv_have_isascii = yes && cat >> confdefs.h <<\EOF
5210 #define HAVE_ISASCII 1
5211 EOF
5212
5213
5214
5215 if test $ac_cv_func_sigaction = yes; then
5216 echo $ac_n "checking whether sigaction needs _POSIX_SOURCE""... $ac_c" 1>&6
5217 echo "configure:5218: checking whether sigaction needs _POSIX_SOURCE" >&5
5218 cat > conftest.$ac_ext <<EOF
5219 #line 5220 "configure"
5220 #include "confdefs.h"
5221
5222 #include <sys/types.h>
5223 #include <signal.h>
5224 int main() {
5225 struct sigaction act
5226 ; return 0; }
5227 EOF
5228 if { (eval echo configure:5229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5229   rm -rf conftest*
5230   sigact_bad=no
5231 else
5232   echo "configure: failed program was:" >&5
5233   cat conftest.$ac_ext >&5
5234   rm -rf conftest*
5235   
5236 cat > conftest.$ac_ext <<EOF
5237 #line 5238 "configure"
5238 #include "confdefs.h"
5239
5240 #define _POSIX_SOURCE
5241 #include <sys/types.h>
5242 #include <signal.h>
5243 int main() {
5244 struct sigaction act
5245 ; return 0; }
5246 EOF
5247 if { (eval echo configure:5248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5248   rm -rf conftest*
5249   sigact_bad=yes
5250          cat >> confdefs.h <<\EOF
5251 #define SVR4_ACTION 1
5252 EOF
5253
5254 else
5255   echo "configure: failed program was:" >&5
5256   cat conftest.$ac_ext >&5
5257   rm -rf conftest*
5258   sigact_bad=unknown
5259 fi
5260 rm -f conftest*
5261 fi
5262 rm -f conftest*
5263 echo "$ac_t""$sigact_bad" 1>&6
5264 fi
5265
5266
5267 if test $ac_cv_header_termios_h = yes ; then
5268         case "$CFLAGS" in
5269         *-D_POSIX_SOURCE*)
5270                 termios_bad=dunno ;;
5271         *)      termios_bad=maybe ;;
5272         esac
5273         if test $termios_bad = maybe ; then
5274         echo $ac_n "checking whether termios.h needs _POSIX_SOURCE""... $ac_c" 1>&6
5275 echo "configure:5276: checking whether termios.h needs _POSIX_SOURCE" >&5
5276         cat > conftest.$ac_ext <<EOF
5277 #line 5278 "configure"
5278 #include "confdefs.h"
5279 #include <termios.h>
5280 int main() {
5281 struct termios foo; int x = foo.c_iflag
5282 ; return 0; }
5283 EOF
5284 if { (eval echo configure:5285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5285   rm -rf conftest*
5286   termios_bad=no
5287 else
5288   echo "configure: failed program was:" >&5
5289   cat conftest.$ac_ext >&5
5290   rm -rf conftest*
5291   
5292                 cat > conftest.$ac_ext <<EOF
5293 #line 5294 "configure"
5294 #include "confdefs.h"
5295
5296 #define _POSIX_SOURCE
5297 #include <termios.h>
5298 int main() {
5299 struct termios foo; int x = foo.c_iflag
5300 ; return 0; }
5301 EOF
5302 if { (eval echo configure:5303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5303   rm -rf conftest*
5304   termios_bad=unknown
5305 else
5306   echo "configure: failed program was:" >&5
5307   cat conftest.$ac_ext >&5
5308   rm -rf conftest*
5309   termios_bad=yes cat >> confdefs.h <<\EOF
5310 #define SVR4_TERMIO 1
5311 EOF
5312
5313 fi
5314 rm -f conftest*
5315                         
5316 fi
5317 rm -f conftest*
5318         echo "$ac_t""$termios_bad" 1>&6
5319         fi
5320 fi
5321
5322
5323 if test "$cross_compiling" = yes ; then
5324         echo "configure: warning: cross compiling: assume setvbuf params not reversed" 1>&2
5325 else
5326         echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
5327 echo "configure:5328: checking whether setvbuf arguments are reversed" >&5
5328 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then
5329   echo $ac_n "(cached) $ac_c" 1>&6
5330 else
5331   if test "$cross_compiling" = yes; then
5332     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
5333 else
5334   cat > conftest.$ac_ext <<EOF
5335 #line 5336 "configure"
5336 #include "confdefs.h"
5337 #include <stdio.h>
5338 /* If setvbuf has the reversed format, exit 0. */
5339 main () {
5340   /* This call has the arguments reversed.
5341      A reversed system may check and see that the address of main
5342      is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
5343   if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
5344     exit(1);
5345   putc('\r', stdout);
5346   exit(0);                      /* Non-reversed systems segv here.  */
5347 }
5348 EOF
5349 if { (eval echo configure:5350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5350 then
5351   ac_cv_func_setvbuf_reversed=yes
5352 else
5353   echo "configure: failed program was:" >&5
5354   cat conftest.$ac_ext >&5
5355   rm -fr conftest*
5356   ac_cv_func_setvbuf_reversed=no
5357 fi
5358 rm -fr conftest*
5359 fi
5360
5361 rm -f core core.* *.core
5362 fi
5363
5364 echo "$ac_t""$ac_cv_func_setvbuf_reversed" 1>&6
5365 if test $ac_cv_func_setvbuf_reversed = yes; then
5366   cat >> confdefs.h <<\EOF
5367 #define SETVBUF_REVERSED 1
5368 EOF
5369
5370 fi
5371
5372 fi
5373 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
5374 echo "configure:5375: checking return type of signal handlers" >&5
5375 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
5376   echo $ac_n "(cached) $ac_c" 1>&6
5377 else
5378   cat > conftest.$ac_ext <<EOF
5379 #line 5380 "configure"
5380 #include "confdefs.h"
5381 #include <sys/types.h>
5382 #include <signal.h>
5383 #ifdef signal
5384 #undef signal
5385 #endif
5386 #ifdef __cplusplus
5387 extern "C" void (*signal (int, void (*)(int)))(int);
5388 #else
5389 void (*signal ()) ();
5390 #endif
5391
5392 int main() {
5393 int i;
5394 ; return 0; }
5395 EOF
5396 if { (eval echo configure:5397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5397   rm -rf conftest*
5398   ac_cv_type_signal=void
5399 else
5400   echo "configure: failed program was:" >&5
5401   cat conftest.$ac_ext >&5
5402   rm -rf conftest*
5403   ac_cv_type_signal=int
5404 fi
5405 rm -f conftest*
5406 fi
5407
5408 echo "$ac_t""$ac_cv_type_signal" 1>&6
5409 cat >> confdefs.h <<EOF
5410 #define RETSIGTYPE $ac_cv_type_signal
5411 EOF
5412
5413
5414
5415 echo $ac_n "checking for type sigaction_t""... $ac_c" 1>&6
5416 echo "configure:5417: checking for type sigaction_t" >&5
5417 if eval "test \"`echo '$''{'cf_cv_type_sigaction'+set}'`\" = set"; then
5418   echo $ac_n "(cached) $ac_c" 1>&6
5419 else
5420   
5421         cat > conftest.$ac_ext <<EOF
5422 #line 5423 "configure"
5423 #include "confdefs.h"
5424
5425 #include <signal.h>
5426 int main() {
5427 sigaction_t x
5428 ; return 0; }
5429 EOF
5430 if { (eval echo configure:5431: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5431   rm -rf conftest*
5432   cf_cv_type_sigaction=yes
5433 else
5434   echo "configure: failed program was:" >&5
5435   cat conftest.$ac_ext >&5
5436   rm -rf conftest*
5437   cf_cv_type_sigaction=no
5438 fi
5439 rm -f conftest*
5440 fi
5441
5442 echo "$ac_t""$cf_cv_type_sigaction" 1>&6
5443 test $cf_cv_type_sigaction = yes && cat >> confdefs.h <<\EOF
5444 #define HAVE_TYPE_SIGACTION 1
5445 EOF
5446
5447
5448
5449 echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6
5450 echo "configure:5451: checking declaration of size-change" >&5
5451 if eval "test \"`echo '$''{'cf_cv_sizechange'+set}'`\" = set"; then
5452   echo $ac_n "(cached) $ac_c" 1>&6
5453 else
5454   
5455     cf_cv_sizechange=unknown
5456     cf_save_CFLAGS="$CFLAGS"
5457
5458 for cf_opts in "" "NEED_PTEM_H"
5459 do
5460
5461     CFLAGS="$cf_save_CFLAGS"
5462     test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts"
5463     cat > conftest.$ac_ext <<EOF
5464 #line 5465 "configure"
5465 #include "confdefs.h"
5466 #include <sys/types.h>
5467 #if HAVE_TERMIOS_H
5468 #include <termios.h>
5469 #else
5470 #if HAVE_TERMIO_H
5471 #include <termio.h>
5472 #endif
5473 #endif
5474 #if NEED_PTEM_H
5475 /* This is a workaround for SCO:  they neglected to define struct winsize in
5476  * termios.h -- it's only in termio.h and ptem.h
5477  */
5478 #include        <sys/stream.h>
5479 #include        <sys/ptem.h>
5480 #endif
5481 #if !defined(sun) || !defined(HAVE_TERMIOS_H)
5482 #include <sys/ioctl.h>
5483 #endif
5484
5485 int main() {
5486
5487 #ifdef TIOCGSIZE
5488         struct ttysize win;     /* FIXME: what system is this? */
5489         int y = win.ts_lines;
5490         int x = win.ts_cols;
5491 #else
5492 #ifdef TIOCGWINSZ
5493         struct winsize win;
5494         int y = win.ws_row;
5495         int x = win.ws_col;
5496 #else
5497         no TIOCGSIZE or TIOCGWINSZ
5498 #endif /* TIOCGWINSZ */
5499 #endif /* TIOCGSIZE */
5500         
5501 ; return 0; }
5502 EOF
5503 if { (eval echo configure:5504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5504   rm -rf conftest*
5505   cf_cv_sizechange=yes
5506 else
5507   echo "configure: failed program was:" >&5
5508   cat conftest.$ac_ext >&5
5509   rm -rf conftest*
5510   cf_cv_sizechange=no
5511 fi
5512 rm -f conftest*
5513
5514         CFLAGS="$cf_save_CFLAGS"
5515         if test "$cf_cv_sizechange" = yes ; then
5516                 echo "size-change succeeded ($cf_opts)" >&5
5517                 test -n "$cf_opts" && cat >> confdefs.h <<EOF
5518 #define $cf_opts 1
5519 EOF
5520
5521                 break
5522         fi
5523 done
5524         
5525 fi
5526
5527 echo "$ac_t""$cf_cv_sizechange" 1>&6
5528 test $cf_cv_sizechange != no && cat >> confdefs.h <<\EOF
5529 #define HAVE_SIZECHANGE 1
5530 EOF
5531
5532
5533
5534 echo $ac_n "checking for memmove""... $ac_c" 1>&6
5535 echo "configure:5536: checking for memmove" >&5
5536 if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then
5537   echo $ac_n "(cached) $ac_c" 1>&6
5538 else
5539   cat > conftest.$ac_ext <<EOF
5540 #line 5541 "configure"
5541 #include "confdefs.h"
5542 /* System header to define __stub macros and hopefully few prototypes,
5543     which can conflict with char memmove(); below.  */
5544 #include <assert.h>
5545 /* Override any gcc2 internal prototype to avoid an error.  */
5546 /* We use char because int might match the return type of a gcc2
5547     builtin and then its argument prototype would still apply.  */
5548 char memmove();
5549
5550 int main() {
5551
5552 /* The GNU C library defines this for functions which it implements
5553     to always fail with ENOSYS.  Some functions are actually named
5554     something starting with __ and the normal name is an alias.  */
5555 #if defined (__stub_memmove) || defined (__stub___memmove)
5556 choke me
5557 #else
5558 memmove();
5559 #endif
5560
5561 ; return 0; }
5562 EOF
5563 if { (eval echo configure:5564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5564   rm -rf conftest*
5565   eval "ac_cv_func_memmove=yes"
5566 else
5567   echo "configure: failed program was:" >&5
5568   cat conftest.$ac_ext >&5
5569   rm -rf conftest*
5570   eval "ac_cv_func_memmove=no"
5571 fi
5572 rm -f conftest*
5573 fi
5574
5575 if eval "test \"`echo '$ac_cv_func_'memmove`\" = yes"; then
5576   echo "$ac_t""yes" 1>&6
5577   :
5578 else
5579   echo "$ac_t""no" 1>&6
5580
5581 echo $ac_n "checking for bcopy""... $ac_c" 1>&6
5582 echo "configure:5583: checking for bcopy" >&5
5583 if eval "test \"`echo '$''{'ac_cv_func_bcopy'+set}'`\" = set"; then
5584   echo $ac_n "(cached) $ac_c" 1>&6
5585 else
5586   cat > conftest.$ac_ext <<EOF
5587 #line 5588 "configure"
5588 #include "confdefs.h"
5589 /* System header to define __stub macros and hopefully few prototypes,
5590     which can conflict with char bcopy(); below.  */
5591 #include <assert.h>
5592 /* Override any gcc2 internal prototype to avoid an error.  */
5593 /* We use char because int might match the return type of a gcc2
5594     builtin and then its argument prototype would still apply.  */
5595 char bcopy();
5596
5597 int main() {
5598
5599 /* The GNU C library defines this for functions which it implements
5600     to always fail with ENOSYS.  Some functions are actually named
5601     something starting with __ and the normal name is an alias.  */
5602 #if defined (__stub_bcopy) || defined (__stub___bcopy)
5603 choke me
5604 #else
5605 bcopy();
5606 #endif
5607
5608 ; return 0; }
5609 EOF
5610 if { (eval echo configure:5611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5611   rm -rf conftest*
5612   eval "ac_cv_func_bcopy=yes"
5613 else
5614   echo "configure: failed program was:" >&5
5615   cat conftest.$ac_ext >&5
5616   rm -rf conftest*
5617   eval "ac_cv_func_bcopy=no"
5618 fi
5619 rm -f conftest*
5620 fi
5621
5622 if eval "test \"`echo '$ac_cv_func_'bcopy`\" = yes"; then
5623   echo "$ac_t""yes" 1>&6
5624   
5625         echo $ac_n "checking if bcopy does overlapping moves""... $ac_c" 1>&6
5626 echo "configure:5627: checking if bcopy does overlapping moves" >&5
5627 if eval "test \"`echo '$''{'cf_cv_good_bcopy'+set}'`\" = set"; then
5628   echo $ac_n "(cached) $ac_c" 1>&6
5629 else
5630   
5631                 if test "$cross_compiling" = yes; then
5632   cf_cv_good_bcopy=unknown
5633 else
5634   cat > conftest.$ac_ext <<EOF
5635 #line 5636 "configure"
5636 #include "confdefs.h"
5637
5638 int main() {
5639         static char data[] = "abcdefghijklmnopqrstuwwxyz";
5640         char temp[40];
5641         bcopy(data, temp, sizeof(data));
5642         bcopy(temp+10, temp, 15);
5643         bcopy(temp+5, temp+15, 10);
5644         exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
5645 }
5646                 
5647 EOF
5648 if { (eval echo configure:5649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5649 then
5650   cf_cv_good_bcopy=yes
5651 else
5652   echo "configure: failed program was:" >&5
5653   cat conftest.$ac_ext >&5
5654   rm -fr conftest*
5655   cf_cv_good_bcopy=no
5656 fi
5657 rm -fr conftest*
5658 fi
5659
5660                 
5661 fi
5662
5663 echo "$ac_t""$cf_cv_good_bcopy" 1>&6
5664         
5665 else
5666   echo "$ac_t""no" 1>&6
5667 cf_cv_good_bcopy=no
5668 fi
5669
5670         if test $cf_cv_good_bcopy = yes ; then
5671                 cat >> confdefs.h <<\EOF
5672 #define USE_OK_BCOPY 1
5673 EOF
5674
5675         else
5676                 cat >> confdefs.h <<\EOF
5677 #define USE_MY_MEMMOVE 1
5678 EOF
5679
5680         fi
5681
5682 fi
5683
5684
5685 echo $ac_n "checking if poll really works""... $ac_c" 1>&6
5686 echo "configure:5687: checking if poll really works" >&5
5687 if eval "test \"`echo '$''{'cf_cv_working_poll'+set}'`\" = set"; then
5688   echo $ac_n "(cached) $ac_c" 1>&6
5689 else
5690   
5691 if test "$cross_compiling" = yes; then
5692   cf_cv_working_poll=unknown
5693 else
5694   cat > conftest.$ac_ext <<EOF
5695 #line 5696 "configure"
5696 #include "confdefs.h"
5697
5698 #include <stdio.h>
5699 #ifdef HAVE_POLL_H
5700 #include <poll.h>
5701 #else
5702 #include <sys/poll.h>
5703 #endif
5704 int main() {
5705         struct pollfd myfds;
5706         int ret;
5707
5708         myfds.fd = 0;
5709         myfds.events = POLLIN;
5710
5711         ret = poll(&myfds, 1, 100);
5712         exit(ret != 0);
5713 }
5714 EOF
5715 if { (eval echo configure:5716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5716 then
5717   cf_cv_working_poll=yes
5718 else
5719   echo "configure: failed program was:" >&5
5720   cat conftest.$ac_ext >&5
5721   rm -fr conftest*
5722   cf_cv_working_poll=no
5723 fi
5724 rm -fr conftest*
5725 fi
5726
5727 fi
5728
5729 echo "$ac_t""$cf_cv_working_poll" 1>&6
5730 test "$cf_cv_working_poll" = "yes" && cat >> confdefs.h <<\EOF
5731 #define HAVE_WORKING_POLL 1
5732 EOF
5733
5734
5735
5736 if test -z "$cf_user_CFLAGS" ; then
5737         CFLAGS=`echo ${CFLAGS} | sed -e 's/-g //' -e 's/-g$//'`
5738         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's/-g //' -e 's/-g$//'`
5739 fi
5740
5741
5742 echo $ac_n "checking for builtin $CC bool type""... $ac_c" 1>&6
5743 echo "configure:5744: checking for builtin $CC bool type" >&5
5744 if eval "test \"`echo '$''{'cf_cv_cc_bool_type'+set}'`\" = set"; then
5745   echo $ac_n "(cached) $ac_c" 1>&6
5746 else
5747   
5748         cat > conftest.$ac_ext <<EOF
5749 #line 5750 "configure"
5750 #include "confdefs.h"
5751
5752 #include <stdio.h>
5753 #include <sys/types.h>
5754
5755 int main() {
5756 bool x = false
5757 ; return 0; }
5758 EOF
5759 if { (eval echo configure:5760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5760   rm -rf conftest*
5761   cf_cv_cc_bool_type=1
5762 else
5763   echo "configure: failed program was:" >&5
5764   cat conftest.$ac_ext >&5
5765   rm -rf conftest*
5766   cf_cv_cc_bool_type=0
5767 fi
5768 rm -f conftest*
5769         
5770 fi
5771
5772 if test $cf_cv_cc_bool_type = 1
5773 then    echo "$ac_t""yes" 1>&6
5774 else    echo "$ac_t""no" 1>&6
5775 fi
5776
5777 if test -n "$CXX" ; then
5778         ac_ext=C
5779 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
5780 ac_cpp='$CXXCPP $CPPFLAGS'
5781 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
5782 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
5783 cross_compiling=$ac_cv_prog_cxx_cross
5784
5785         
5786 if test -n "$GXX" ; then
5787 case $cf_cv_system_name in #(vi
5788 os2*) #(vi
5789         cf_stdcpp_libname=stdcpp
5790         ;;
5791 *)
5792         cf_stdcpp_libname=stdc++
5793         ;;
5794 esac
5795 echo $ac_n "checking for library $cf_stdcpp_libname""... $ac_c" 1>&6
5796 echo "configure:5797: checking for library $cf_stdcpp_libname" >&5
5797 if eval "test \"`echo '$''{'cf_cv_libstdcpp'+set}'`\" = set"; then
5798   echo $ac_n "(cached) $ac_c" 1>&6
5799 else
5800   
5801         cf_save="$LIBS"
5802         LIBS="$LIBS -l$cf_stdcpp_libname"
5803 cat > conftest.$ac_ext <<EOF
5804 #line 5805 "configure"
5805 #include "confdefs.h"
5806
5807 #include <strstream.h>
5808 int main() {
5809
5810 char buf[80];
5811 strstreambuf foo(buf, sizeof(buf))
5812
5813 ; return 0; }
5814 EOF
5815 if { (eval echo configure:5816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5816   rm -rf conftest*
5817   cf_cv_libstdcpp=yes
5818 else
5819   echo "configure: failed program was:" >&5
5820   cat conftest.$ac_ext >&5
5821   rm -rf conftest*
5822   cf_cv_libstdcpp=no
5823 fi
5824 rm -f conftest*
5825         LIBS="$cf_save"
5826
5827 fi
5828
5829 echo "$ac_t""$cf_cv_libstdcpp" 1>&6
5830 test $cf_cv_libstdcpp = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname"
5831 fi
5832
5833         case "`${CXX-g++} --version`" in
5834         1*|2.0-6*)
5835             cf_cxx_library=yes
5836             ;;
5837         2.7*)
5838             
5839 cf_cxx_library=unknown
5840 case $cf_cv_system_name in #(vi
5841 os2*) #(vi
5842         cf_gpp_libname=gpp
5843         ;;
5844 *)
5845         cf_gpp_libname=g++
5846         ;;
5847 esac
5848 if test $ac_cv_prog_gxx = yes; then
5849         echo $ac_n "checking for lib$cf_gpp_libname""... $ac_c" 1>&6
5850 echo "configure:5851: checking for lib$cf_gpp_libname" >&5
5851         cf_save="$LIBS"
5852         LIBS="$LIBS -l$cf_gpp_libname"
5853         cat > conftest.$ac_ext <<EOF
5854 #line 5855 "configure"
5855 #include "confdefs.h"
5856
5857 #include <$cf_gpp_libname/builtin.h>
5858         
5859 int main() {
5860 two_arg_error_handler_t foo2 = lib_error_handler
5861 ; return 0; }
5862 EOF
5863 if { (eval echo configure:5864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5864   rm -rf conftest*
5865   cf_cxx_library=yes
5866          CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
5867          if test "$cf_gpp_libname" = cpp ; then
5868             cat >> confdefs.h <<\EOF
5869 #define HAVE_GPP_BUILTIN_H 1
5870 EOF
5871
5872          else
5873             cat >> confdefs.h <<\EOF
5874 #define HAVE_GXX_BUILTIN_H 1
5875 EOF
5876
5877          fi
5878 else
5879   echo "configure: failed program was:" >&5
5880   cat conftest.$ac_ext >&5
5881   rm -rf conftest*
5882   cat > conftest.$ac_ext <<EOF
5883 #line 5884 "configure"
5884 #include "confdefs.h"
5885
5886 #include <builtin.h>
5887         
5888 int main() {
5889 two_arg_error_handler_t foo2 = lib_error_handler
5890 ; return 0; }
5891 EOF
5892 if { (eval echo configure:5893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5893   rm -rf conftest*
5894   cf_cxx_library=yes
5895          CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
5896          cat >> confdefs.h <<\EOF
5897 #define HAVE_BUILTIN_H 1
5898 EOF
5899
5900 else
5901   echo "configure: failed program was:" >&5
5902   cat conftest.$ac_ext >&5
5903   rm -rf conftest*
5904   cf_cxx_library=no
5905 fi
5906 rm -f conftest*
5907 fi
5908 rm -f conftest*
5909         LIBS="$cf_save"
5910         echo "$ac_t""$cf_cxx_library" 1>&6
5911 fi
5912
5913             ;;
5914         *)
5915             cf_cxx_library=no
5916             ;;
5917         esac
5918         echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
5919 echo "configure:5920: checking how to run the C++ preprocessor" >&5
5920 if test -z "$CXXCPP"; then
5921 if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
5922   echo $ac_n "(cached) $ac_c" 1>&6
5923 else
5924   ac_ext=C
5925 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
5926 ac_cpp='$CXXCPP $CPPFLAGS'
5927 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
5928 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
5929 cross_compiling=$ac_cv_prog_cxx_cross
5930   CXXCPP="${CXX-g++} -E"
5931   cat > conftest.$ac_ext <<EOF
5932 #line 5933 "configure"
5933 #include "confdefs.h"
5934 #include <stdlib.h>
5935 EOF
5936 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5937 { (eval echo configure:5938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5938 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5939 if test -z "$ac_err"; then
5940   :
5941 else
5942   echo "$ac_err" >&5
5943   echo "configure: failed program was:" >&5
5944   cat conftest.$ac_ext >&5
5945   rm -rf conftest*
5946   CXXCPP=/lib/cpp
5947 fi
5948 rm -f conftest*
5949   ac_cv_prog_CXXCPP="$CXXCPP"
5950 ac_ext=C
5951 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
5952 ac_cpp='$CXXCPP $CPPFLAGS'
5953 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
5954 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
5955 cross_compiling=$ac_cv_prog_cxx_cross
5956 fi
5957 fi
5958 CXXCPP="$ac_cv_prog_CXXCPP"
5959 echo "$ac_t""$CXXCPP" 1>&6
5960
5961 for ac_hdr in typeinfo
5962 do
5963 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5964 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5965 echo "configure:5966: checking for $ac_hdr" >&5
5966 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5967   echo $ac_n "(cached) $ac_c" 1>&6
5968 else
5969   cat > conftest.$ac_ext <<EOF
5970 #line 5971 "configure"
5971 #include "confdefs.h"
5972 #include <$ac_hdr>
5973 EOF
5974 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5975 { (eval echo configure:5976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5976 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5977 if test -z "$ac_err"; then
5978   rm -rf conftest*
5979   eval "ac_cv_header_$ac_safe=yes"
5980 else
5981   echo "$ac_err" >&5
5982   echo "configure: failed program was:" >&5
5983   cat conftest.$ac_ext >&5
5984   rm -rf conftest*
5985   eval "ac_cv_header_$ac_safe=no"
5986 fi
5987 rm -f conftest*
5988 fi
5989 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5990   echo "$ac_t""yes" 1>&6
5991     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5992   cat >> confdefs.h <<EOF
5993 #define $ac_tr_hdr 1
5994 EOF
5995  
5996 else
5997   echo "$ac_t""no" 1>&6
5998 fi
5999 done
6000
6001         
6002 echo $ac_n "checking for builtin $CXX bool type""... $ac_c" 1>&6
6003 echo "configure:6004: checking for builtin $CXX bool type" >&5
6004 if eval "test \"`echo '$''{'cf_cv_builtin_bool'+set}'`\" = set"; then
6005   echo $ac_n "(cached) $ac_c" 1>&6
6006 else
6007   
6008         cat > conftest.$ac_ext <<EOF
6009 #line 6010 "configure"
6010 #include "confdefs.h"
6011
6012 #include <stdio.h>
6013 #include <sys/types.h>
6014
6015 int main() {
6016 bool x = false
6017 ; return 0; }
6018 EOF
6019 if { (eval echo configure:6020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6020   rm -rf conftest*
6021   cf_cv_builtin_bool=1
6022 else
6023   echo "configure: failed program was:" >&5
6024   cat conftest.$ac_ext >&5
6025   rm -rf conftest*
6026   cf_cv_builtin_bool=0
6027 fi
6028 rm -f conftest*
6029         
6030 fi
6031
6032 if test $cf_cv_builtin_bool = 1
6033 then    echo "$ac_t""yes" 1>&6
6034 else    echo "$ac_t""no" 1>&6
6035 fi
6036
6037         
6038 echo $ac_n "checking for size of $CXX bool""... $ac_c" 1>&6
6039 echo "configure:6040: checking for size of $CXX bool" >&5
6040 if eval "test \"`echo '$''{'cf_cv_type_of_bool'+set}'`\" = set"; then
6041   echo $ac_n "(cached) $ac_c" 1>&6
6042 else
6043   
6044         rm -f cf_test.out
6045         if test "$cross_compiling" = yes; then
6046   cf_cv_type_of_bool=unknown
6047 else
6048   cat > conftest.$ac_ext <<EOF
6049 #line 6050 "configure"
6050 #include "confdefs.h"
6051 #ifdef __cplusplus
6052 extern "C" void exit(int);
6053 #endif
6054
6055 #include <stdlib.h>
6056 #include <stdio.h>
6057 #if HAVE_GXX_BUILTIN_H
6058 #include <g++/builtin.h>
6059 #elif HAVE_GPP_BUILTIN_H
6060 #include <gpp/builtin.h>
6061 #elif HAVE_BUILTIN_H
6062 #include <builtin.h>
6063 #endif
6064 main()
6065 {
6066         FILE *fp = fopen("cf_test.out", "w");
6067         if (fp != 0) {
6068                 bool x = true;
6069                 if ((bool)(-x) >= 0)
6070                         fputs("unsigned ", fp);
6071                 if (sizeof(x) == sizeof(int))       fputs("int",  fp);
6072                 else if (sizeof(x) == sizeof(char)) fputs("char", fp);
6073                 else if (sizeof(x) == sizeof(short))fputs("short",fp);
6074                 else if (sizeof(x) == sizeof(long)) fputs("long", fp);
6075                 fclose(fp);
6076         }
6077         exit(0);
6078 }
6079                 
6080 EOF
6081 if { (eval echo configure:6082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6082 then
6083   cf_cv_type_of_bool=`cat cf_test.out`
6084 else
6085   echo "configure: failed program was:" >&5
6086   cat conftest.$ac_ext >&5
6087   rm -fr conftest*
6088   cf_cv_type_of_bool=unknown
6089 fi
6090 rm -fr conftest*
6091 fi
6092
6093         
6094 fi
6095
6096         rm -f cf_test.out
6097 echo "$ac_t""$cf_cv_type_of_bool" 1>&6
6098 if test "$cf_cv_type_of_bool" = unknown ; then
6099         echo "configure: warning: Assuming unsigned for type of bool" 1>&2
6100         cf_cv_type_of_bool=unsigned
6101 fi
6102
6103         
6104 echo $ac_n "checking for special defines needed for etip.h""... $ac_c" 1>&6
6105 echo "configure:6106: checking for special defines needed for etip.h" >&5
6106 cf_save_CXXFLAGS="$CXXFLAGS"
6107 cf_result="none"
6108 for cf_math in "" MATH_H
6109 do
6110 for cf_excp in "" MATH_EXCEPTION
6111 do
6112         CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu"
6113         test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}"
6114         test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}"
6115 cat > conftest.$ac_ext <<EOF
6116 #line 6117 "configure"
6117 #include "confdefs.h"
6118
6119 #include <etip.h.in>
6120
6121 int main() {
6122
6123 ; return 0; }
6124 EOF
6125 if { (eval echo configure:6126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6126   rm -rf conftest*
6127   
6128         test -n "$cf_math" && cat >> confdefs.h <<EOF
6129 #define ETIP_NEEDS_${cf_math} 1
6130 EOF
6131
6132         test -n "$cf_excp" && cat >> confdefs.h <<EOF
6133 #define ETIP_NEEDS_${cf_excp} 1
6134 EOF
6135
6136         cf_result="$cf_math $cf_excp"
6137         break
6138
6139 else
6140   echo "configure: failed program was:" >&5
6141   cat conftest.$ac_ext >&5
6142 fi
6143 rm -f conftest*
6144 done
6145 done
6146 echo "$ac_t""$cf_result" 1>&6
6147 CXXFLAGS="$cf_save_CXXFLAGS"
6148
6149         
6150 if test -n "$CXX" ; then
6151 echo $ac_n "checking if $CXX accepts parameter initialization""... $ac_c" 1>&6
6152 echo "configure:6153: checking if $CXX accepts parameter initialization" >&5
6153 if eval "test \"`echo '$''{'cf_cv_cpp_param_init'+set}'`\" = set"; then
6154   echo $ac_n "(cached) $ac_c" 1>&6
6155 else
6156   
6157         ac_ext=C
6158 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
6159 ac_cpp='$CXXCPP $CPPFLAGS'
6160 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
6161 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
6162 cross_compiling=$ac_cv_prog_cxx_cross
6163
6164         if test "$cross_compiling" = yes; then
6165   cf_cv_cpp_param_init=unknown
6166 else
6167   cat > conftest.$ac_ext <<EOF
6168 #line 6169 "configure"
6169 #include "confdefs.h"
6170 #ifdef __cplusplus
6171 extern "C" void exit(int);
6172 #endif
6173
6174 class TEST {
6175 private:
6176         int value;
6177 public:
6178         TEST(int x = 1);
6179         ~TEST();
6180 };
6181
6182 TEST::TEST(int x = 1)   // some compilers do not like second initializer
6183 {
6184         value = x;
6185 }
6186 void main() { }
6187
6188 EOF
6189 if { (eval echo configure:6190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6190 then
6191   cf_cv_cpp_param_init=yes
6192 else
6193   echo "configure: failed program was:" >&5
6194   cat conftest.$ac_ext >&5
6195   rm -fr conftest*
6196   cf_cv_cpp_param_init=no
6197 fi
6198 rm -fr conftest*
6199 fi
6200
6201
6202 fi
6203
6204 echo "$ac_t""$cf_cv_cpp_param_init" 1>&6
6205 fi
6206 test "$cf_cv_cpp_param_init" = yes && cat >> confdefs.h <<\EOF
6207 #define CPP_HAS_PARAM_INIT 1
6208 EOF
6209
6210
6211         case $cf_cv_system_name in #(vi
6212         sco3.2v5*)
6213             CXXLDFLAGS="-u main"
6214             ;;
6215         esac
6216         
6217 else
6218         cf_cxx_library=no
6219         cf_cv_builtin_bool=1
6220
6221         # Just because we are not configuring against C++ right now does not
6222         # mean that a user will not want to use C++.  Some distributors disable
6223         # the C++ portion of this configuration as a shortcut (or just to avoid
6224         # compiling the demo in the c++ directory).  So we need a reasonable
6225         # default for the 'bool' type.
6226         #
6227         # Caveat: since the storage of the bool type is not standardized, it
6228         # may change.
6229
6230         echo $ac_n "checking for fallback type of bool""... $ac_c" 1>&6
6231 echo "configure:6232: checking for fallback type of bool" >&5
6232         case "$host_cpu" in #(vi
6233         i?86)   cf_cv_type_of_bool=char ;; #(vi
6234         *)      cf_cv_type_of_bool=int  ;;
6235         esac
6236         echo "$ac_t""$cf_cv_type_of_bool" 1>&6
6237 fi
6238
6239
6240
6241
6242 if test "$cf_with_ada" != "no" ; then
6243 cf_ada_make=gnatmake
6244 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
6245 set dummy $cf_ada_make; ac_word=$2
6246 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6247 echo "configure:6248: checking for $ac_word" >&5
6248 if eval "test \"`echo '$''{'ac_cv_prog_gnat_exists'+set}'`\" = set"; then
6249   echo $ac_n "(cached) $ac_c" 1>&6
6250 else
6251   if test -n "$gnat_exists"; then
6252   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
6253 else
6254   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6255   ac_dummy="$PATH"
6256   for ac_dir in $ac_dummy; do
6257     test -z "$ac_dir" && ac_dir=.
6258     if test -f $ac_dir/$ac_word; then
6259       ac_cv_prog_gnat_exists="yes"
6260       break
6261     fi
6262   done
6263   IFS="$ac_save_ifs"
6264   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
6265 fi
6266 fi
6267 gnat_exists="$ac_cv_prog_gnat_exists"
6268 if test -n "$gnat_exists"; then
6269   echo "$ac_t""$gnat_exists" 1>&6
6270 else
6271   echo "$ac_t""no" 1>&6
6272 fi
6273
6274 if test "$ac_cv_prog_gnat_exists" = no; then
6275    cf_ada_make=
6276 else
6277    
6278 cf_cv_gnat_version=`$cf_ada_make -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\
6279   sed -e 's/[^0-9 \.]//g' | $AWK '{print $1;}'`
6280 case $cf_cv_gnat_version in
6281   3.1[1-9]*|3.[2-9]*|[4-9].*)
6282     cf_cv_prog_gnat_correct=yes
6283     ;;
6284   *) echo Unsupported GNAT version $cf_cv_gnat_version. Required is 3.11 or better. Disabling Ada95 binding.
6285      cf_cv_prog_gnat_correct=no
6286      ;;
6287 esac
6288 case $cf_cv_gnat_version in
6289   3.1*|[4-9].*)
6290       cf_compile_generics=generics
6291       cf_generic_objects="\$(GENOBJS)"
6292       ;;
6293   *)  cf_compile_generics=
6294       cf_generic_objects=
6295       ;;
6296 esac
6297
6298    # Extract the first word of "m4", so it can be a program name with args.
6299 set dummy m4; ac_word=$2
6300 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6301 echo "configure:6302: checking for $ac_word" >&5
6302 if eval "test \"`echo '$''{'ac_cv_prog_m4_exists'+set}'`\" = set"; then
6303   echo $ac_n "(cached) $ac_c" 1>&6
6304 else
6305   if test -n "$m4_exists"; then
6306   ac_cv_prog_m4_exists="$m4_exists" # Let the user override the test.
6307 else
6308   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6309   ac_dummy="$PATH"
6310   for ac_dir in $ac_dummy; do
6311     test -z "$ac_dir" && ac_dir=.
6312     if test -f $ac_dir/$ac_word; then
6313       ac_cv_prog_m4_exists="yes"
6314       break
6315     fi
6316   done
6317   IFS="$ac_save_ifs"
6318   test -z "$ac_cv_prog_m4_exists" && ac_cv_prog_m4_exists="no"
6319 fi
6320 fi
6321 m4_exists="$ac_cv_prog_m4_exists"
6322 if test -n "$m4_exists"; then
6323   echo "$ac_t""$m4_exists" 1>&6
6324 else
6325   echo "$ac_t""no" 1>&6
6326 fi
6327
6328    if test "$ac_cv_prog_m4_exists" = no; then
6329       cf_cv_prog_gnat_correct=no
6330       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
6331    fi
6332    if test "$cf_cv_prog_gnat_correct" = yes; then
6333       echo $ac_n "checking if GNAT works""... $ac_c" 1>&6
6334 echo "configure:6335: checking if GNAT works" >&5
6335       
6336 rm -f conftest*
6337 cat >>conftest.ads <<CF_EOF
6338 procedure conftest;
6339 CF_EOF
6340 cat >>conftest.adb <<CF_EOF
6341 with Text_IO;
6342 with GNAT.OS_Lib;
6343 procedure conftest is
6344 begin
6345    Text_IO.Put ("Hello World");
6346    Text_IO.New_Line;
6347    GNAT.OS_Lib.OS_Exit (0);
6348 end conftest;
6349 CF_EOF
6350 if ( $cf_ada_make conftest 1>&5 2>&1 ) ; then
6351    if ( ./conftest 1>&5 2>&1 ) ; then
6352       cf_cv_prog_gnat_correct=yes
6353    else
6354       cf_cv_prog_gnat_correct=no
6355    fi
6356 else
6357    cf_cv_prog_gnat_correct=no
6358 fi
6359 rm -f conftest*
6360
6361       echo "$ac_t""$cf_cv_prog_gnat_correct" 1>&6
6362    fi
6363 fi
6364 if test "$cf_cv_prog_gnat_correct" = yes; then
6365    ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
6366
6367    
6368 # Check whether --with-ada-compiler or --without-ada-compiler was given.
6369 if test "${with_ada_compiler+set}" = set; then
6370   withval="$with_ada_compiler"
6371   cf_ada_compiler=$withval
6372 else
6373   cf_ada_compiler=gnatmake
6374 fi
6375
6376
6377    cf_ada_package=terminal_interface
6378
6379    
6380    
6381    
6382    
6383    
6384    
6385
6386    
6387 # Check whether --with-ada-include or --without-ada-include was given.
6388 if test "${with_ada_include+set}" = set; then
6389   withval="$with_ada_include"
6390   :
6391 else
6392   withval="${ADA_INCLUDE-$prefix/lib/ada/adainclude}"
6393 fi
6394
6395 case ".$withval" in #(vi
6396 ./*) #(vi
6397   ;;
6398 .a-zA-Z:\\/*) #(vi OS/2 EMX
6399   ;;
6400 .\${*prefix}*) #(vi
6401   eval withval="$withval"
6402   case ".$withval" in #(vi
6403   .NONE/*)
6404     withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
6405     ;;
6406   esac
6407   ;; #(vi
6408 .NONE/*)
6409   withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
6410   ;;
6411 *)
6412   { echo "configure: error: expected a pathname" 1>&2; exit 1; }
6413   ;;
6414 esac
6415
6416 eval ADA_INCLUDE="$withval"
6417
6418    
6419
6420    
6421 # Check whether --with-ada-objects or --without-ada-objects was given.
6422 if test "${with_ada_objects+set}" = set; then
6423   withval="$with_ada_objects"
6424   :
6425 else
6426   withval="${ADA_OBJECTS-$prefix/lib/ada/adalib}"
6427 fi
6428
6429 case ".$withval" in #(vi
6430 ./*) #(vi
6431   ;;
6432 .a-zA-Z:\\/*) #(vi OS/2 EMX
6433   ;;
6434 .\${*prefix}*) #(vi
6435   eval withval="$withval"
6436   case ".$withval" in #(vi
6437   .NONE/*)
6438     withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
6439     ;;
6440   esac
6441   ;; #(vi
6442 .NONE/*)
6443   withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
6444   ;;
6445 *)
6446   { echo "configure: error: expected a pathname" 1>&2; exit 1; }
6447   ;;
6448 esac
6449
6450 eval ADA_OBJECTS="$withval"
6451
6452    
6453
6454 # This has been fixed!
6455 #   if test $with_shared = no
6456 #   then
6457 #      AC_MSG_WARN(Ada95 applications will not link properly with static libraries)
6458 #   fi
6459 fi
6460 fi
6461
6462 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
6463 ### using a 'char' for bools.  gcc 2.7.0's conversion-warnings are broken too
6464 ### badly to consider using for development purposes, but 2.5.8 is okay.
6465 if test -n "$with_warnings"; then
6466         if test -n "$GCC"; then
6467                 case "`$CC --version`" in
6468                 2.6.3)
6469                         if test "$cf_cv_type_of_bool" != "char"; then
6470                                 EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
6471                         fi
6472                         ;;
6473                 2.5*)
6474                         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wconversion"
6475                         ;;
6476                 esac
6477         fi
6478 fi
6479
6480 ### Construct the library-subsets, if any, from this set of keywords:
6481 ### none, base, ext_funcs, termlib.
6482 echo $ac_n "checking for library subsets""... $ac_c" 1>&6
6483 echo "configure:6484: checking for library subsets" >&5
6484 if test "$with_termlib" = yes ; then
6485         LIB_SUBSETS="termlib "
6486 else
6487         LIB_SUBSETS="termlib+"
6488 fi
6489 LIB_SUBSETS="${LIB_SUBSETS}base"
6490 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
6491 echo "$ac_t""$LIB_SUBSETS" 1>&6
6492
6493 LIB_TRACING=DEBUG
6494 case "$CFLAGS" in
6495 *-DTRACE*)
6496         LIB_TRACING=all
6497         ;;
6498 esac
6499
6500 ### Construct the list of include-directories to be generated
6501
6502 CPPFLAGS="$CPPFLAGS -I. -I../include"
6503 if test "$srcdir" != "."; then
6504         CPPFLAGS="$CPPFLAGS -I\$(srcdir)/../include"
6505 fi
6506 if test -z "$GCC"; then
6507         CPPFLAGS="$CPPFLAGS -I\$(includedir)"
6508 elif test "$includedir" != "/usr/include"; then
6509         if test "$includedir" = '${prefix}/include' ; then
6510                 if test $prefix != /usr ; then
6511                         CPPFLAGS="$CPPFLAGS -I\$(includedir)"
6512                 fi
6513         else
6514                 CPPFLAGS="$CPPFLAGS -I\$(includedir)"
6515         fi
6516 fi
6517
6518
6519
6520 ACPPFLAGS="$ACPPFLAGS -I. -I../../include"
6521 if test "$srcdir" != "."; then
6522         ACPPFLAGS="$ACPPFLAGS -I\$(srcdir)/../../include"
6523 fi
6524 if test -z "$GCC"; then
6525         ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
6526 elif test "$includedir" != "/usr/include"; then
6527         if test "$includedir" = '${prefix}/include' ; then
6528                 if test $prefix != /usr ; then
6529                         ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
6530                 fi
6531         else
6532                 ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
6533         fi
6534 fi
6535
6536
6537
6538 ### Build up pieces for makefile rules
6539 echo $ac_n "checking default library suffix""... $ac_c" 1>&6
6540 echo "configure:6541: checking default library suffix" >&5
6541
6542         case $DFT_LWR_MODEL in
6543         normal)  DFT_ARG_SUFFIX=''   ;;
6544         debug)   DFT_ARG_SUFFIX='_g' ;;
6545         profile) DFT_ARG_SUFFIX='_p' ;;
6546         shared)  DFT_ARG_SUFFIX=''   ;;
6547         esac
6548         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
6549 echo "$ac_t""$DFT_ARG_SUFFIX" 1>&6
6550
6551 echo $ac_n "checking default library-dependency suffix""... $ac_c" 1>&6
6552 echo "configure:6553: checking default library-dependency suffix" >&5
6553
6554         
6555         case $DFT_LWR_MODEL in
6556         normal)  DFT_DEP_SUFFIX='.a'   ;;
6557         debug)   DFT_DEP_SUFFIX='_g.a' ;;
6558         profile) DFT_DEP_SUFFIX='_p.a' ;;
6559         shared)
6560                 case $cf_cv_system_name in
6561                 hpux*)  DFT_DEP_SUFFIX='.sl'  ;;
6562                 *)      DFT_DEP_SUFFIX='.so'  ;;
6563                 esac
6564         esac
6565         test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
6566 echo "$ac_t""$DFT_DEP_SUFFIX" 1>&6
6567
6568 echo $ac_n "checking default object directory""... $ac_c" 1>&6
6569 echo "configure:6570: checking default object directory" >&5
6570
6571         case $DFT_LWR_MODEL in
6572         normal)  DFT_OBJ_SUBDIR='objects' ;;
6573         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
6574         profile) DFT_OBJ_SUBDIR='obj_p' ;;
6575         shared)  DFT_OBJ_SUBDIR='obj_s' ;;
6576         esac
6577 echo "$ac_t""$DFT_OBJ_SUBDIR" 1>&6
6578
6579 TINFO_LIST="$SHLIB_LIST"
6580 test $with_termlib = yes && SHLIB_LIST="$SHLIB_LIST -ltinfo${LIB_SUFFIX}"
6581
6582 echo $ac_n "checking where we will install curses.h""... $ac_c" 1>&6
6583 echo "configure:6584: checking where we will install curses.h" >&5
6584 test "$with_overwrite" = no && \
6585 test "x$includedir" = 'x${prefix}/include' && \
6586         includedir='$(prefix)/include/ncurses'${LIB_SUFFIX}
6587 echo "$ac_t""$includedir" 1>&6
6588
6589
6590
6591
6592
6593 ### Set up low-level terminfo dependencies for makefiles.  Note that we
6594 ### could override this.
6595 if test "$with_termlib" = yes ; then
6596         TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${TINFO_NAME}${DFT_DEP_SUFFIX}"
6597         TEST_ARGS="-l${TINFO_NAME}${DFT_ARG_SUFFIX}"
6598 fi
6599 PROG_DEPS="$TEST_DEPS"
6600 PROG_ARGS="$TEST_ARGS"
6601
6602 ### Construct the list of subdirectories for which we'll customize makefiles
6603 ### with the appropriate compile-rules.
6604
6605
6606 echo $ac_n "checking for src modules""... $ac_c" 1>&6
6607 echo "configure:6608: checking for src modules" >&5
6608
6609 # dependencies and linker-arguments for test-programs
6610 TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX} $TEST_DEPS"
6611 TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARGS"
6612
6613 # dependencies and linker-arguments for utility-programs
6614 PROG_ARGS="$TEST_ARGS"
6615
6616 cf_cv_src_modules=
6617 for cf_dir in $modules_to_build
6618 do
6619         if test -f $srcdir/$cf_dir/modules; then
6620
6621                 # We may/may not have tack in the distribution, though the
6622                 # makefile is.
6623                 if test $cf_dir = tack ; then
6624                         if test ! -f $srcdir/${cf_dir}/${cf_dir}.h; then
6625                                 continue
6626                         fi
6627                 fi
6628
6629                 if test -z "$cf_cv_src_modules"; then
6630                         cf_cv_src_modules=$cf_dir
6631                 else
6632                         cf_cv_src_modules="$cf_cv_src_modules $cf_dir"
6633                 fi
6634
6635                 # Make the ncurses_cfg.h file record the library interface files as
6636                 # well.  These are header files that are the same name as their
6637                 # directory.  Ncurses is the only library that does not follow
6638                 # that pattern.
6639                 if test $cf_dir = tack ; then
6640                         continue
6641                 elif test -f $srcdir/${cf_dir}/${cf_dir}.h; then
6642                         
6643 cf_have_include=`echo $cf_dir | tr '[a-z]' '[A-Z]'`
6644
6645                         cat >> confdefs.h <<EOF
6646 #define HAVE_${cf_have_include}_H 1
6647 EOF
6648
6649                         cat >> confdefs.h <<EOF
6650 #define HAVE_LIB${cf_have_include} 1
6651 EOF
6652
6653                         TEST_DEPS="${LIB_DIR}/${LIB_PREFIX}${cf_dir}${DFT_DEP_SUFFIX} $TEST_DEPS"
6654                         TEST_ARGS="-l${cf_dir}${DFT_ARG_SUFFIX} $TEST_ARGS"
6655                 fi
6656         fi
6657 done
6658 echo "$ac_t""$cf_cv_src_modules" 1>&6
6659 TEST_ARGS="-L${LIB_DIR} -L\$(libdir) $TEST_ARGS"
6660
6661
6662
6663 PROG_ARGS="-L${LIB_DIR} -L\$(libdir) $PROG_ARGS"
6664
6665
6666 SRC_SUBDIRS="man include"
6667 for cf_dir in $cf_cv_src_modules
6668 do
6669         SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir"
6670 done
6671 SRC_SUBDIRS="$SRC_SUBDIRS misc test"
6672 test $cf_with_cxx_binding != no && SRC_SUBDIRS="$SRC_SUBDIRS c++"
6673
6674 ADA_SUBDIRS=
6675 if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then
6676    SRC_SUBDIRS="$SRC_SUBDIRS Ada95"
6677    ADA_SUBDIRS="gen src samples"
6678 fi
6679
6680 SUB_MAKEFILES=
6681 for cf_dir in $SRC_SUBDIRS
6682 do
6683         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
6684 done
6685
6686 if test -n "$ADA_SUBDIRS"; then
6687    for cf_dir in $ADA_SUBDIRS
6688    do
6689       SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile"
6690    done
6691    
6692 fi
6693
6694
6695 DIRS_TO_MAKE="lib"
6696 for cf_item in $cf_list_models
6697 do
6698         
6699         case $cf_item in
6700         normal)  cf_subdir='objects' ;;
6701         debug)   cf_subdir='obj_g' ;;
6702         profile) cf_subdir='obj_p' ;;
6703         shared)  cf_subdir='obj_s' ;;
6704         esac
6705
6706         DIRS_TO_MAKE="$DIRS_TO_MAKE $cf_subdir"
6707 done
6708 for cf_dir in $DIRS_TO_MAKE
6709 do
6710         test ! -d $cf_dir && mkdir $cf_dir
6711 done
6712
6713
6714
6715 ### Now that we're done running tests, add the compiler-warnings, if any
6716 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
6717
6718 ################################################################################
6719 trap '' 1 2 15
6720 cat > confcache <<\EOF
6721 # This file is a shell script that caches the results of configure
6722 # tests run on this system so they can be shared between configure
6723 # scripts and configure runs.  It is not useful on other systems.
6724 # If it contains results you don't want to keep, you may remove or edit it.
6725 #
6726 # By default, configure uses ./config.cache as the cache file,
6727 # creating it if it does not exist already.  You can give configure
6728 # the --cache-file=FILE option to use a different cache file; that is
6729 # what configure does when it calls configure scripts in
6730 # subdirectories, so they share the cache.
6731 # Giving --cache-file=/dev/null disables caching, for debugging configure.
6732 # config.status only pays attention to the cache file if you give it the
6733 # --recheck option to rerun configure.
6734 #
6735 EOF
6736 # The following way of writing the cache mishandles newlines in values,
6737 # but we know of no workaround that is simple, portable, and efficient.
6738 # So, don't put newlines in cache variables' values.
6739 # Ultrix sh set writes to stderr and can't be redirected directly,
6740 # and sets the high bit in the cache file unless we assign to the vars.
6741 (set) 2>&1 |
6742   case `(ac_space=' '; set | grep ac_space) 2>&1` in
6743   *ac_space=\ *)
6744     # `set' does not quote correctly, so add quotes (double-quote substitution
6745     # turns \\\\ into \\, and sed turns \\ into \).
6746     sed -n \
6747       -e "s/'/'\\\\''/g" \
6748       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
6749     ;;
6750   *)
6751     # `set' quotes correctly as required by POSIX, so do not add quotes.
6752     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
6753     ;;
6754   esac >> confcache
6755 if cmp -s $cache_file confcache; then
6756   :
6757 else
6758   if test -w $cache_file; then
6759     echo "updating cache $cache_file"
6760     cat confcache > $cache_file
6761   else
6762     echo "not updating unwritable cache $cache_file"
6763   fi
6764 fi
6765 rm -f confcache
6766
6767 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
6768
6769 test "x$prefix" = xNONE && prefix=$ac_default_prefix
6770 # Let make expand exec_prefix.
6771 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
6772
6773 # Any assignment to VPATH causes Sun make to only execute
6774 # the first set of double-colon rules, so remove it if not needed.
6775 # If there is a colon in the path, we need to keep it.
6776 if test "x$srcdir" = x.; then
6777   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
6778 fi
6779
6780 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
6781
6782 DEFS=-DHAVE_CONFIG_H
6783
6784 # Without the "./", some shells look in PATH for config.status.
6785 : ${CONFIG_STATUS=./config.status}
6786
6787 echo creating $CONFIG_STATUS
6788 rm -f $CONFIG_STATUS
6789 cat > $CONFIG_STATUS <<EOF
6790 #! /bin/sh
6791 # Generated automatically by configure.
6792 # Run this file to recreate the current configuration.
6793 # This directory was configured as follows,
6794 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6795 #
6796 # $0 $ac_configure_args
6797 #
6798 # Compiler output produced by configure, useful for debugging
6799 # configure, is in ./config.log if it exists.
6800
6801 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
6802 for ac_option
6803 do
6804   case "\$ac_option" in
6805   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
6806     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
6807     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
6808   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
6809     echo "$CONFIG_STATUS generated by autoconf version 2.13.19990117"
6810     exit 0 ;;
6811   -help | --help | --hel | --he | --h)
6812     echo "\$ac_cs_usage"; exit 0 ;;
6813   *) echo "\$ac_cs_usage"; exit 1 ;;
6814   esac
6815 done
6816
6817 ac_given_srcdir=$srcdir
6818 ac_given_INSTALL="$INSTALL"
6819
6820 trap 'rm -fr `echo "\
6821         include/MKterm.h.awk \
6822         include/curses.h \
6823         include/termcap.h \
6824         include/unctrl.h \
6825         $SUB_MAKEFILES \
6826         Makefile include/ncurses_cfg.h:include/ncurses_cfg.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
6827 EOF
6828 cat >> $CONFIG_STATUS <<EOF
6829
6830 # Protect against being on the right side of a sed subst in config.status.
6831 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
6832  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
6833 $ac_vpsub
6834 $extrasub
6835 s%@SHELL@%$SHELL%g
6836 s%@CFLAGS@%$CFLAGS%g
6837 s%@CPPFLAGS@%$CPPFLAGS%g
6838 s%@CXXFLAGS@%$CXXFLAGS%g
6839 s%@FFLAGS@%$FFLAGS%g
6840 s%@DEFS@%$DEFS%g
6841 s%@LDFLAGS@%$LDFLAGS%g
6842 s%@LIBS@%$LIBS%g
6843 s%@exec_prefix@%$exec_prefix%g
6844 s%@prefix@%$prefix%g
6845 s%@program_transform_name@%$program_transform_name%g
6846 s%@bindir@%$bindir%g
6847 s%@sbindir@%$sbindir%g
6848 s%@libexecdir@%$libexecdir%g
6849 s%@datadir@%$datadir%g
6850 s%@sysconfdir@%$sysconfdir%g
6851 s%@sharedstatedir@%$sharedstatedir%g
6852 s%@localstatedir@%$localstatedir%g
6853 s%@libdir@%$libdir%g
6854 s%@includedir@%$includedir%g
6855 s%@oldincludedir@%$oldincludedir%g
6856 s%@infodir@%$infodir%g
6857 s%@mandir@%$mandir%g
6858 s%@NCURSES_MAJOR@%$NCURSES_MAJOR%g
6859 s%@NCURSES_MINOR@%$NCURSES_MINOR%g
6860 s%@NCURSES_PATCH@%$NCURSES_PATCH%g
6861 s%@cf_cv_rel_version@%$cf_cv_rel_version%g
6862 s%@cf_cv_abi_version@%$cf_cv_abi_version%g
6863 s%@cf_cv_cc_bool_type@%$cf_cv_cc_bool_type%g
6864 s%@cf_cv_builtin_bool@%$cf_cv_builtin_bool%g
6865 s%@cf_cv_type_of_bool@%$cf_cv_type_of_bool%g
6866 s%@host@%$host%g
6867 s%@host_alias@%$host_alias%g
6868 s%@host_cpu@%$host_cpu%g
6869 s%@host_vendor@%$host_vendor%g
6870 s%@host_os@%$host_os%g
6871 s%@CC@%$CC%g
6872 s%@BUILD_CC@%$BUILD_CC%g
6873 s%@CPP@%$CPP%g
6874 s%@PROG_EXT@%$PROG_EXT%g
6875 s%@LDCONFIG@%$LDCONFIG%g
6876 s%@CXX@%$CXX%g
6877 s%@AWK@%$AWK%g
6878 s%@SET_MAKE@%$SET_MAKE%g
6879 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
6880 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
6881 s%@INSTALL_DATA@%$INSTALL_DATA%g
6882 s%@LN_S@%$LN_S%g
6883 s%@RANLIB@%$RANLIB%g
6884 s%@LINT@%$LINT%g
6885 s%@MAN@%$MAN%g
6886 s%@LINT_OPTS@%$LINT_OPTS%g
6887 s%@LD@%$LD%g
6888 s%@AR@%$AR%g
6889 s%@AR_OPTS@%$AR_OPTS%g
6890 s%@cf_cv_makeflags@%$cf_cv_makeflags%g
6891 s%@INSTALL_PREFIX@%$INSTALL_PREFIX%g
6892 s%@cf_list_models@%$cf_list_models%g
6893 s%@DFT_LWR_MODEL@%$DFT_LWR_MODEL%g
6894 s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
6895 s%@TINFO_NAME@%$TINFO_NAME%g
6896 s%@LIB_NAME@%$LIB_NAME%g
6897 s%@LIB_PREFIX@%$LIB_PREFIX%g
6898 s%@LIB_SUFFIX@%$LIB_SUFFIX%g
6899 s%@CC_G_OPT@%$CC_G_OPT%g
6900 s%@CXX_G_OPT@%$CXX_G_OPT%g
6901 s%@LD_MODEL@%$LD_MODEL%g
6902 s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
6903 s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
6904 s%@MK_SHARED_LIB@%$MK_SHARED_LIB%g
6905 s%@LINK_PROGS@%$LINK_PROGS%g
6906 s%@LINK_TESTS@%$LINK_TESTS%g
6907 s%@EXTRA_LDFLAGS@%$EXTRA_LDFLAGS%g
6908 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
6909 s%@LOCAL_LDFLAGS2@%$LOCAL_LDFLAGS2%g
6910 s%@INSTALL_LIB@%$INSTALL_LIB%g
6911 s%@FALLBACK_LIST@%$FALLBACK_LIST%g
6912 s%@TERMINFO_DIRS@%$TERMINFO_DIRS%g
6913 s%@NCURSES_CONST@%$NCURSES_CONST%g
6914 s%@NCURSES_XNAMES@%$NCURSES_XNAMES%g
6915 s%@ECHO_LINK@%$ECHO_LINK%g
6916 s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
6917 s%@MATH_LIB@%$MATH_LIB%g
6918 s%@cf_cv_typeof_chtype@%$cf_cv_typeof_chtype%g
6919 s%@cf_cv_1UL@%$cf_cv_1UL%g
6920 s%@cf_cv_shift_limit@%$cf_cv_shift_limit%g
6921 s%@cf_cv_widec_shift@%$cf_cv_widec_shift%g
6922 s%@OSPEED_TYPE@%$OSPEED_TYPE%g
6923 s%@OSPEED_INCLUDES@%$OSPEED_INCLUDES%g
6924 s%@CXXCPP@%$CXXCPP%g
6925 s%@CXXLDFLAGS@%$CXXLDFLAGS%g
6926 s%@CXXLIBS@%$CXXLIBS%g
6927 s%@gnat_exists@%$gnat_exists%g
6928 s%@m4_exists@%$m4_exists%g
6929 s%@cf_ada_make@%$cf_ada_make%g
6930 s%@cf_ada_compiler@%$cf_ada_compiler%g
6931 s%@cf_ada_package@%$cf_ada_package%g
6932 s%@ADAFLAGS@%$ADAFLAGS%g
6933 s%@cf_compile_generics@%$cf_compile_generics%g
6934 s%@cf_generic_objects@%$cf_generic_objects%g
6935 s%@ADA_INCLUDE@%$ADA_INCLUDE%g
6936 s%@ADA_OBJECTS@%$ADA_OBJECTS%g
6937 s%@ACPPFLAGS@%$ACPPFLAGS%g
6938 s%@DFT_ARG_SUFFIX@%$DFT_ARG_SUFFIX%g
6939 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
6940 s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
6941 s%@EXTRA_LIBS@%$EXTRA_LIBS%g
6942 s%@TINFO_LIST@%$TINFO_LIST%g
6943 s%@SHLIB_LIST@%$SHLIB_LIST%g
6944 s%@TEST_DEPS@%$TEST_DEPS%g
6945 s%@TEST_ARGS@%$TEST_ARGS%g
6946 s%@PROG_ARGS@%$PROG_ARGS%g
6947 s%@ADA_SUBDIRS@%$ADA_SUBDIRS%g
6948 s%@DIRS_TO_MAKE@%$DIRS_TO_MAKE%g
6949
6950 CEOF
6951 EOF
6952
6953 cat >> $CONFIG_STATUS <<\EOF
6954
6955 # Split the substitutions into bite-sized pieces for seds with
6956 # small command number limits, like on Digital OSF/1 and HP-UX.
6957 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
6958 ac_file=1 # Number of current file.
6959 ac_beg=1 # First line for current file.
6960 ac_end=$ac_max_sed_cmds # Line after last line for current file.
6961 ac_more_lines=:
6962 ac_sed_cmds=""
6963 while $ac_more_lines; do
6964   if test $ac_beg -gt 1; then
6965     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
6966   else
6967     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
6968   fi
6969   if test ! -s conftest.s$ac_file; then
6970     ac_more_lines=false
6971     rm -f conftest.s$ac_file
6972   else
6973     if test -z "$ac_sed_cmds"; then
6974       ac_sed_cmds="sed -f conftest.s$ac_file"
6975     else
6976       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
6977     fi
6978     ac_file=`expr $ac_file + 1`
6979     ac_beg=$ac_end
6980     ac_end=`expr $ac_end + $ac_max_sed_cmds`
6981   fi
6982 done
6983 if test -z "$ac_sed_cmds"; then
6984   ac_sed_cmds=cat
6985 fi
6986 EOF
6987
6988 cat >> $CONFIG_STATUS <<EOF
6989
6990 CONFIG_FILES=\${CONFIG_FILES-"\
6991         include/MKterm.h.awk \
6992         include/curses.h \
6993         include/termcap.h \
6994         include/unctrl.h \
6995         $SUB_MAKEFILES \
6996         Makefile"}
6997 EOF
6998 cat >> $CONFIG_STATUS <<\EOF
6999 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
7000   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7001   case "$ac_file" in
7002   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7003        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7004   *) ac_file_in="${ac_file}.in" ;;
7005   esac
7006
7007   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
7008
7009   # Remove last slash and all that follows it.  Not all systems have dirname.
7010   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7011   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7012     # The file is in a subdirectory.
7013     test ! -d "$ac_dir" && mkdir "$ac_dir"
7014     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
7015     # A "../" for each directory in $ac_dir_suffix.
7016     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
7017   else
7018     ac_dir_suffix= ac_dots=
7019   fi
7020
7021   case "$ac_given_srcdir" in
7022   .)  srcdir=.
7023       if test -z "$ac_dots"; then top_srcdir=.
7024       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
7025   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
7026   *) # Relative path.
7027     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
7028     top_srcdir="$ac_dots$ac_given_srcdir" ;;
7029   esac
7030
7031   case "$ac_given_INSTALL" in
7032   [/$]*) INSTALL="$ac_given_INSTALL" ;;
7033   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
7034   esac
7035
7036   echo creating "$ac_file"
7037   rm -f "$ac_file"
7038   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
7039   case "$ac_file" in
7040   *Makefile*) ac_comsub="1i\\
7041 # $configure_input" ;;
7042   *) ac_comsub= ;;
7043   esac
7044
7045   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7046   sed -e "$ac_comsub
7047 s%@configure_input@%$configure_input%g
7048 s%@srcdir@%$srcdir%g
7049 s%@top_srcdir@%$top_srcdir%g
7050 s%@INSTALL@%$INSTALL%g
7051 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
7052 fi; done
7053 rm -f conftest.s*
7054
7055 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
7056 # NAME is the cpp macro being defined and VALUE is the value it is being given.
7057 #
7058 # ac_d sets the value in "#define NAME VALUE" lines.
7059 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
7060 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
7061 ac_dC='\3'
7062 ac_dD='%g'
7063 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
7064 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7065 ac_uB='\([      ]\)%\1#\2define\3'
7066 ac_uC=' '
7067 ac_uD='\4%g'
7068 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
7069 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7070 ac_eB='$%\1#\2define\3'
7071 ac_eC=' '
7072 ac_eD='%g'
7073
7074 if test "${CONFIG_HEADERS+set}" != set; then
7075 EOF
7076 cat >> $CONFIG_STATUS <<EOF
7077   CONFIG_HEADERS="include/ncurses_cfg.h:include/ncurses_cfg.hin"
7078 EOF
7079 cat >> $CONFIG_STATUS <<\EOF
7080 fi
7081 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
7082   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7083   case "$ac_file" in
7084   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7085        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7086   *) ac_file_in="${ac_file}.in" ;;
7087   esac
7088
7089   echo creating $ac_file
7090
7091   rm -f conftest.frag conftest.in conftest.out
7092   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7093   cat $ac_file_inputs > conftest.in
7094
7095 EOF
7096
7097
7098 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
7099 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
7100 # be either 'cat' or 'sort'.
7101 sort confdefs.h >conftest.vals
7102
7103 # Break up conftest.vals because some shells have a limit on
7104 # the size of here documents, and old seds have small limits too.
7105
7106 rm -f conftest.tail
7107 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
7108 while :
7109 do
7110   ac_lines=`grep -c . conftest.vals`
7111   # grep -c gives empty output for an empty file on some AIX systems.
7112   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
7113   # Write chunks of a limited-size here document to conftest.frag.
7114   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
7115   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
7116   echo 'CEOF' >> $CONFIG_STATUS
7117   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
7118   rm -f conftest.vals
7119   mv conftest.tail conftest.vals
7120 done
7121 rm -f conftest.vals
7122
7123 # Run sed to substitute the contents of conftest.frag into conftest.in at the
7124 # marker @DEFS@.
7125 echo '  cat >> conftest.edit <<CEOF
7126 /@DEFS@/r conftest.frag
7127 /@DEFS@/d
7128 CEOF
7129 sed -f conftest.edit conftest.in > conftest.out
7130 rm -f conftest.in
7131 mv conftest.out conftest.in
7132 rm -f conftest.edit conftest.frag
7133 ' >> $CONFIG_STATUS
7134
7135
7136 cat >> $CONFIG_STATUS <<\EOF
7137   rm -f conftest.frag conftest.h
7138   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
7139   cat conftest.in >> conftest.h
7140   rm -f conftest.in
7141   if cmp -s $ac_file conftest.h 2>/dev/null; then
7142     echo "$ac_file is unchanged"
7143     rm -f conftest.h
7144   else
7145     # Remove last slash and all that follows it.  Not all systems have dirname.
7146       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7147       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7148       # The file is in a subdirectory.
7149       test ! -d "$ac_dir" && mkdir "$ac_dir"
7150     fi
7151     rm -f $ac_file
7152     mv conftest.h $ac_file
7153   fi
7154 fi; done
7155
7156 EOF
7157 cat >> $CONFIG_STATUS <<EOF
7158 # Extra initialization commands, if any
7159
7160 ### Special initialization commands, used to pass information from the
7161 ### configuration-run into config.status
7162
7163 AWK="$AWK"
7164 CF_LIST_MODELS="$cf_list_models"
7165 DFT_LWR_MODEL="$DFT_LWR_MODEL"
7166 LDCONFIG="$LDCONFIG"
7167 LIB_NAME="$LIB_NAME"
7168 LIB_SUFFIX="$LIB_SUFFIX"
7169 LIB_SUBSETS="$LIB_SUBSETS"
7170 LIB_TRACING="$LIB_TRACING"
7171 SRC_SUBDIRS="$SRC_SUBDIRS"
7172 TINFO_NAME="$TINFO_NAME"
7173 WITH_ECHO="$with_echo"
7174 WITH_OVERWRITE="$with_overwrite"
7175 cf_cv_abi_version="$cf_cv_abi_version"
7176 cf_cv_do_symlinks="$cf_cv_do_symlinks"
7177 cf_cv_rel_version="$cf_cv_rel_version"
7178 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
7179 cf_cv_system_name="$cf_cv_system_name"
7180 cf_with_cxx_binding="$cf_with_cxx_binding"
7181 cf_cv_shlib_version="$cf_cv_shlib_version"
7182 target="$target"
7183
7184
7185 EOF
7186 cat >> $CONFIG_STATUS <<\EOF
7187 # Extra commands, if any
7188
7189
7190
7191         case $cf_cv_system_name in
7192         os2)    LIB_PREFIX=''     ;;
7193         *)      LIB_PREFIX='lib'  ;;
7194         esac
7195 cf_prefix=$LIB_PREFIX
7196         
7197
7198
7199 for cf_dir in $SRC_SUBDIRS
7200 do
7201         if test -f $srcdir/$cf_dir/modules; then
7202
7203                 cf_libs_to_make=
7204                 for cf_item in $CF_LIST_MODELS
7205                 do
7206                         
7207         
7208         case $cf_item in
7209         normal)  cf_suffix='.a'   ;;
7210         debug)   cf_suffix='_g.a' ;;
7211         profile) cf_suffix='_p.a' ;;
7212         shared)
7213                 case $cf_cv_system_name in
7214                 hpux*)  cf_suffix='.sl'  ;;
7215                 *)      cf_suffix='.so'  ;;
7216                 esac
7217         esac
7218         test -n "$LIB_SUFFIX" && cf_suffix="${LIB_SUFFIX}${cf_suffix}"
7219
7220                         if test $cf_item = shared ; then
7221                         if test $cf_cv_do_symlinks = yes ; then
7222                                 case "$cf_cv_shlib_version" in #(vi
7223                                 rel) cf_suffix="$cf_suffix"'.$(REL_VERSION)' ;; #(vi
7224                                 abi) cf_suffix="$cf_suffix"'.$(ABI_VERSION)' ;;
7225                                 esac
7226                         fi
7227                         fi
7228                         cf_libs_to_make="$cf_libs_to_make ../lib/${cf_prefix}${cf_dir}${cf_suffix}"
7229                 done
7230
7231                 if test $cf_dir = ncurses ; then
7232                         case "$LIB_SUBSETS" in #(vi
7233                         termlib+*) #(vi
7234                                 ;;
7235                         *) #(vi
7236                                 cf_item=`echo $cf_libs_to_make |sed -e s/$LIB_NAME/$TINFO_NAME/g`
7237                                 cf_libs_to_make="$cf_item $cf_libs_to_make"
7238                                 ;;
7239                         esac
7240                 fi
7241
7242                 sed -e "s@\@LIBS_TO_MAKE\@@$cf_libs_to_make@" \
7243                         $cf_dir/Makefile >$cf_dir/Makefile.out
7244                 mv $cf_dir/Makefile.out $cf_dir/Makefile
7245
7246                 $AWK -f $srcdir/mk-0th.awk \
7247                         name=$cf_dir \
7248                         $srcdir/$cf_dir/modules >>$cf_dir/Makefile
7249
7250                 for cf_item in $CF_LIST_MODELS
7251                 do
7252                         echo 'Appending rules for '$cf_item' model ('$cf_dir')'
7253                         
7254 CF_ITEM=`echo $cf_item | tr '[a-z]' '[A-Z]'`
7255
7256                         
7257         
7258         case $cf_item in
7259         normal)  cf_suffix='.a'   ;;
7260         debug)   cf_suffix='_g.a' ;;
7261         profile) cf_suffix='_p.a' ;;
7262         shared)
7263                 case $cf_cv_system_name in
7264                 hpux*)  cf_suffix='.sl'  ;;
7265                 *)      cf_suffix='.so'  ;;
7266                 esac
7267         esac
7268         test -n "$LIB_SUFFIX" && cf_suffix="${LIB_SUFFIX}${cf_suffix}"
7269
7270                         
7271         case $cf_item in
7272         normal)  cf_subdir='objects' ;;
7273         debug)   cf_subdir='obj_g' ;;
7274         profile) cf_subdir='obj_p' ;;
7275         shared)  cf_subdir='obj_s' ;;
7276         esac
7277
7278
7279                         # These dependencies really are for development, not
7280                         # builds, but they are useful in porting, too.
7281                         cf_depend="../include/ncurses_cfg.h"
7282                         if test "$srcdir" = "."; then
7283                                 cf_reldir="."
7284                         else
7285                                 cf_reldir="\$(srcdir)"
7286                         fi
7287
7288                         if test -f $srcdir/$cf_dir/$cf_dir.priv.h; then
7289                                 cf_depend="$cf_depend $cf_reldir/$cf_dir.priv.h"
7290                         elif test -f $srcdir/$cf_dir/curses.priv.h; then
7291                                 cf_depend="$cf_depend $cf_reldir/curses.priv.h"
7292                         fi
7293
7294                         for cf_subset in $LIB_SUBSETS
7295                         do
7296                         $AWK -f $srcdir/mk-1st.awk \
7297                                 name=$cf_dir \
7298                                 traces=$LIB_TRACING \
7299                                 MODEL=$CF_ITEM \
7300                                 model=$cf_subdir \
7301                                 prefix=$cf_prefix \
7302                                 suffix=$cf_suffix \
7303                                 subset=$cf_subset \
7304                                 ShlibVer=$cf_cv_shlib_version \
7305                                 DoLinks=$cf_cv_do_symlinks \
7306                                 rmSoLocs=$cf_cv_rm_so_locs \
7307                                 ldconfig="$LDCONFIG" \
7308                                 overwrite=$WITH_OVERWRITE \
7309                                 depend="$cf_depend" \
7310                                 target="$target" \
7311                                 $srcdir/$cf_dir/modules >>$cf_dir/Makefile
7312                         test $cf_dir = ncurses && WITH_OVERWRITE=no
7313                         $AWK -f $srcdir/mk-2nd.awk \
7314                                 name=$cf_dir \
7315                                 traces=$LIB_TRACING \
7316                                 MODEL=$CF_ITEM \
7317                                 model=$cf_subdir \
7318                                 subset=$cf_subset \
7319                                 srcdir=$srcdir \
7320                                 echo=$WITH_ECHO \
7321                                 $srcdir/$cf_dir/modules >>$cf_dir/Makefile
7322                         done
7323                 done
7324         fi
7325
7326         echo '  cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) $@' >>Makefile
7327 done
7328
7329 for cf_dir in $SRC_SUBDIRS
7330 do
7331         if test -f $cf_dir/Makefile ; then
7332                 case "$cf_dir" in
7333                 Ada95) #(vi
7334                         echo 'libs \' >> Makefile
7335                         echo 'install.libs \' >> Makefile
7336                         echo 'uninstall.libs ::' >> Makefile
7337                         echo '  cd '$cf_dir' && $(MAKE) $(CF_MFLAGS) $@' >> Makefile
7338                         ;;
7339                 esac
7340         fi
7341
7342         if test -f $srcdir/$cf_dir/modules; then
7343                 echo >> Makefile
7344                 if test -f $srcdir/$cf_dir/headers; then
7345 cat >> Makefile <<CF_EOF
7346 install.includes \\
7347 uninstall.includes \\
7348 CF_EOF
7349                 fi
7350 if test "$cf_dir" != "c++" ; then
7351 echo 'lint \' >> Makefile
7352 fi
7353 cat >> Makefile <<CF_EOF
7354 libs \\
7355 lintlib \\
7356 install.libs \\
7357 uninstall.libs \\
7358 install.$cf_dir \\
7359 uninstall.$cf_dir ::
7360         cd $cf_dir && \$(MAKE) \$(CF_MFLAGS) \$@
7361 CF_EOF
7362         elif test -f $srcdir/$cf_dir/headers; then
7363 cat >> Makefile <<CF_EOF
7364
7365 libs \\
7366 install.libs \\
7367 uninstall.libs \\
7368 install.includes \\
7369 uninstall.includes ::
7370         cd $cf_dir && \$(MAKE) \$(CF_MFLAGS) \$@
7371 CF_EOF
7372 fi
7373 done
7374
7375 cat >> Makefile <<CF_EOF
7376
7377 install.data \
7378 uninstall.data ::
7379         cd misc && \$(MAKE) \$(CF_MFLAGS) \$@
7380
7381 install.man \
7382 uninstall.man ::
7383         cd man && \$(MAKE) \$(CF_MFLAGS) \$@
7384
7385 distclean ::
7386         rm -f config.cache config.log config.status Makefile include/ncurses_cfg.h
7387         rm -f headers.sh headers.sed
7388         rm -rf \$(DIRS_TO_MAKE)
7389 CF_EOF
7390
7391
7392 rm -f headers.sed headers.sh
7393
7394 echo creating headers.sh
7395 cat >headers.sh <<CF_EOF
7396 #! /bin/sh
7397 # This shell script is generated by the 'configure' script.  It is invoked in a
7398 # subdirectory of the build tree.  It generates a sed-script in the parent
7399 # directory that is used to adjust includes for header files that reside in a
7400 # subdirectory of /usr/include, etc.
7401 PRG=""
7402 while test \$# != 3
7403 do
7404 PRG="\$PRG \$1"; shift
7405 done
7406 DST=\$1
7407 REF=\$2
7408 SRC=\$3
7409 echo installing \$SRC in \$DST
7410 case \$DST in
7411 /*/include/*)
7412         TMPSRC=\${TMPDIR-/tmp}/\`basename \$SRC\`\$\$
7413         TMPSED=\${TMPDIR-/tmp}/headers.sed\$\$
7414         END=\`basename \$DST\`
7415         for i in \`cat \$REF/../*/headers |fgrep -v "#"\`
7416         do
7417                 NAME=\`basename \$i\`
7418                 echo "s/<\$NAME>/<\$END\/\$NAME>/" >> \$TMPSED
7419         done
7420         rm -f \$TMPSRC
7421         sed -f \$TMPSED \$SRC > \$TMPSRC
7422         eval \$PRG \$TMPSRC \$DST/\$SRC
7423         rm -f \$TMPSRC \$TMPSED
7424         ;;
7425 *)
7426         eval \$PRG \$SRC \$DST
7427         ;;
7428 esac
7429 CF_EOF
7430
7431 chmod 0755 headers.sh
7432
7433 for cf_dir in $SRC_SUBDIRS
7434 do
7435         if test -f $srcdir/$cf_dir/headers; then
7436         cat >>$cf_dir/Makefile <<CF_EOF
7437 \$(INSTALL_PREFIX)\$(includedir) :
7438         \$(srcdir)/../mkinstalldirs \$@
7439
7440 install \\
7441 install.libs \\
7442 install.includes :: \$(INSTALL_PREFIX)\$(includedir) \\
7443 CF_EOF
7444                 j=""
7445                 for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
7446                 do
7447                         test -n "$j" && echo "          $j \\" >>$cf_dir/Makefile
7448                         j=$i
7449                 done
7450                 echo "          $j" >>$cf_dir/Makefile
7451                 for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
7452                 do
7453                         echo "  @ (cd \$(INSTALL_PREFIX)\$(includedir) && rm -f `basename $i`) ; ../headers.sh \$(INSTALL_DATA) \$(INSTALL_PREFIX)\$(includedir) \$(srcdir) $i" >>$cf_dir/Makefile
7454                         test $i = curses.h && echo "    @ (cd \$(INSTALL_PREFIX)\$(includedir) && rm -f ncurses.h && \$(LN_S) curses.h ncurses.h)" >>$cf_dir/Makefile
7455                 done
7456
7457         cat >>$cf_dir/Makefile <<CF_EOF
7458
7459 uninstall \\
7460 uninstall.libs \\
7461 uninstall.includes ::
7462 CF_EOF
7463                 for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
7464                 do
7465                         i=`basename $i`
7466                         echo "  -@ (cd \$(INSTALL_PREFIX)\$(includedir) && rm -f $i)" >>$cf_dir/Makefile
7467                         test $i = curses.h && echo "    -@ (cd \$(INSTALL_PREFIX)\$(includedir) && rm -f ncurses.h)" >>$cf_dir/Makefile
7468                 done
7469         fi
7470 done
7471
7472
7473
7474 exit 0
7475 EOF
7476 chmod +x $CONFIG_STATUS
7477 rm -fr confdefs* $ac_clean_files
7478 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
7479 ${MAKE-make} preinstall