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