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