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