]> ncurses.scripts.mit.edu Git - ncurses.git/blob - configure
ncurses 4.1
[ncurses.git] / configure
1 #! /bin/sh
2
3 # From configure.in Revision: 1.64 
4
5
6 # Guess values for system-dependent variables and create Makefiles.
7 # Generated automatically using autoconf version 2.12.970309 
8 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
9 #
10 # This configure script is free software; the Free Software Foundation
11 # gives unlimited permission to copy, distribute and modify it.
12
13 # Defaults:
14 ac_help=
15 ac_default_prefix=/usr/local
16 # Any additions from configure.in:
17 ac_help="$ac_help
18   --enable-add-ons=DIR... used to check if we are a glibc add-on."
19 ac_help="$ac_help
20   --without-cxx           suppress check for C++"
21 ac_help="$ac_help
22   --with-install-prefix   prefixes actual install-location"
23 ac_help="$ac_help
24   --with-shared           generate shared-libraries"
25 ac_help="$ac_help
26   --with-normal           generate normal-libraries (default)"
27 ac_help="$ac_help
28   --with-debug            generate debug-libraries (default)"
29 ac_help="$ac_help
30   --with-profile          generate profile-libraries"
31 ac_help="$ac_help
32   --with-dbmalloc         test: use Conor Cahill's dbmalloc library"
33 ac_help="$ac_help
34   --with-dmalloc          test: use Gray Watson's dmalloc library"
35 ac_help="$ac_help
36   --with-gpm              use Alessandro Rubini's GPM library"
37 ac_help="$ac_help
38   --disable-overwrite     leave out the link to -lcurses"
39 ac_help="$ac_help
40   --enable-big-core       assume machine has lots of memory"
41 ac_help="$ac_help
42   --enable-termcap        compile in termcap fallback support"
43 ac_help="$ac_help
44   --enable-getcap         fast termcap load, no xrefs to terminfo"
45 ac_help="$ac_help
46   --enable-getcap-cache   cache translated termcaps in ~/.terminfo"
47 ac_help="$ac_help
48   --enable-symlinks       make tic use symbolic links not hard links"
49 ac_help="$ac_help
50   --enable-bsdpad         recognize BSD-style prefix padding"
51 ac_help="$ac_help
52   --enable-const          compile with extra/non-standard const"
53 ac_help="$ac_help
54   --with-rcs-ids          build: compile-in RCS identifiers"
55 ac_help="$ac_help
56   --enable-echo           build: display \"compiling\" commands (default)"
57 ac_help="$ac_help
58   --enable-warnings       build: turn on GCC compiler warnings"
59 ac_help="$ac_help
60   --enable-assertions     test: turn on generation of assertion code"
61 ac_help="$ac_help
62   --disable-leaks         test: suppress permanent memory-leaks"
63 ac_help="$ac_help
64   --enable-expanded       test: generate functions for certain macros"
65 ac_help="$ac_help
66   --disable-macros        test: use functions rather than macros"
67
68 # Initialize some variables set by options.
69 # The variables have the same names as the options, with
70 # dashes changed to underlines.
71 build=NONE
72 cache_file=./config.cache
73 exec_prefix=NONE
74 host=NONE
75 no_create=
76 nonopt=NONE
77 no_recursion=
78 prefix=NONE
79 program_prefix=NONE
80 program_suffix=NONE
81 program_transform_name=s,x,x,
82 silent=
83 site=
84 srcdir=
85 target=NONE
86 verbose=
87 x_includes=NONE
88 x_libraries=NONE
89 bindir='${exec_prefix}/bin'
90 sbindir='${exec_prefix}/sbin'
91 libexecdir='${exec_prefix}/libexec'
92 datadir='${prefix}/share'
93 sysconfdir='${prefix}/etc'
94 sharedstatedir='${prefix}/com'
95 localstatedir='${prefix}/var'
96 libdir='${exec_prefix}/lib'
97 includedir='${prefix}/include'
98 oldincludedir='/usr/include'
99 infodir='${prefix}/info'
100 mandir='${prefix}/man'
101
102 # Initialize some other variables.
103 subdirs=
104 MFLAGS= MAKEFLAGS=
105 # Maximum number of lines to put in a shell here document.
106 ac_max_here_lines=12
107
108 ac_prev=
109 for ac_option
110 do
111
112   # If the previous option needs an argument, assign it.
113   if test -n "$ac_prev"; then
114     eval "$ac_prev=\$ac_option"
115     ac_prev=
116     continue
117   fi
118
119   case "$ac_option" in
120   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
121   *) ac_optarg= ;;
122   esac
123
124   # Accept the important Cygnus configure options, so we can diagnose typos.
125
126   case "$ac_option" in
127
128   -bindir | --bindir | --bindi | --bind | --bin | --bi)
129     ac_prev=bindir ;;
130   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
131     bindir="$ac_optarg" ;;
132
133   -build | --build | --buil | --bui | --bu)
134     ac_prev=build ;;
135   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
136     build="$ac_optarg" ;;
137
138   -cache-file | --cache-file | --cache-fil | --cache-fi \
139   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
140     ac_prev=cache_file ;;
141   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
142   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
143     cache_file="$ac_optarg" ;;
144
145   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
146     ac_prev=datadir ;;
147   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
148   | --da=*)
149     datadir="$ac_optarg" ;;
150
151   -disable-* | --disable-*)
152     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
153     # Reject names that are not valid shell variable names.
154     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
155       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
156     fi
157     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
158     eval "enable_${ac_feature}=no" ;;
159
160   -enable-* | --enable-*)
161     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
162     # Reject names that are not valid shell variable names.
163     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
164       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
165     fi
166     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
167     case "$ac_option" in
168       *=*) ;;
169       *) ac_optarg=yes ;;
170     esac
171     eval "enable_${ac_feature}='$ac_optarg'" ;;
172
173   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
174   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
175   | --exec | --exe | --ex)
176     ac_prev=exec_prefix ;;
177   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
178   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
179   | --exec=* | --exe=* | --ex=*)
180     exec_prefix="$ac_optarg" ;;
181
182   -gas | --gas | --ga | --g)
183     # Obsolete; use --with-gas.
184     with_gas=yes ;;
185
186   -help | --help | --hel | --he)
187     # Omit some internal or obsolete options to make the list less imposing.
188     # This message is too long to be a string in the A/UX 3.1 sh.
189     cat << EOF
190 Usage: configure [options] [host]
191 Options: [defaults in brackets after descriptions]
192 Configuration:
193   --cache-file=FILE       cache test results in FILE
194   --help                  print this message
195   --no-create             do not create output files
196   --quiet, --silent       do not print \`checking...' messages
197   --version               print the version of autoconf that created configure
198 Directory and file names:
199   --prefix=PREFIX         install architecture-independent files in PREFIX
200                           [$ac_default_prefix]
201   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
202                           [same as prefix]
203   --bindir=DIR            user executables in DIR [EPREFIX/bin]
204   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
205   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
206   --datadir=DIR           read-only architecture-independent data in DIR
207                           [PREFIX/share]
208   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
209   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
210                           [PREFIX/com]
211   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
212   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
213   --includedir=DIR        C header files in DIR [PREFIX/include]
214   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
215   --infodir=DIR           info documentation in DIR [PREFIX/info]
216   --mandir=DIR            man documentation in DIR [PREFIX/man]
217   --srcdir=DIR            find the sources in DIR [configure dir or ..]
218   --program-prefix=PREFIX prepend PREFIX to installed program names
219   --program-suffix=SUFFIX append SUFFIX to installed program names
220   --program-transform-name=PROGRAM
221                           run sed PROGRAM on installed program names
222 EOF
223     cat << EOF
224 Host type:
225   --build=BUILD           configure for building on BUILD [BUILD=HOST]
226   --host=HOST             configure for HOST [guessed]
227   --target=TARGET         configure for TARGET [TARGET=HOST]
228 Features and packages:
229   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
230   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
231   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
232   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
233   --x-includes=DIR        X include files are in DIR
234   --x-libraries=DIR       X library files are in DIR
235 EOF
236     if test -n "$ac_help"; then
237       echo "--enable and --with options recognized:$ac_help"
238     fi
239     exit 0 ;;
240
241   -host | --host | --hos | --ho)
242     ac_prev=host ;;
243   -host=* | --host=* | --hos=* | --ho=*)
244     host="$ac_optarg" ;;
245
246   -includedir | --includedir | --includedi | --included | --include \
247   | --includ | --inclu | --incl | --inc)
248     ac_prev=includedir ;;
249   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
250   | --includ=* | --inclu=* | --incl=* | --inc=*)
251     includedir="$ac_optarg" ;;
252
253   -infodir | --infodir | --infodi | --infod | --info | --inf)
254     ac_prev=infodir ;;
255   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
256     infodir="$ac_optarg" ;;
257
258   -libdir | --libdir | --libdi | --libd)
259     ac_prev=libdir ;;
260   -libdir=* | --libdir=* | --libdi=* | --libd=*)
261     libdir="$ac_optarg" ;;
262
263   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
264   | --libexe | --libex | --libe)
265     ac_prev=libexecdir ;;
266   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
267   | --libexe=* | --libex=* | --libe=*)
268     libexecdir="$ac_optarg" ;;
269
270   -localstatedir | --localstatedir | --localstatedi | --localstated \
271   | --localstate | --localstat | --localsta | --localst \
272   | --locals | --local | --loca | --loc | --lo)
273     ac_prev=localstatedir ;;
274   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
275   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
276   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
277     localstatedir="$ac_optarg" ;;
278
279   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
280     ac_prev=mandir ;;
281   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
282     mandir="$ac_optarg" ;;
283
284   -nfp | --nfp | --nf)
285     # Obsolete; use --without-fp.
286     with_fp=no ;;
287
288   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
289   | --no-cr | --no-c)
290     no_create=yes ;;
291
292   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
293   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
294     no_recursion=yes ;;
295
296   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
297   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
298   | --oldin | --oldi | --old | --ol | --o)
299     ac_prev=oldincludedir ;;
300   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
301   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
302   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
303     oldincludedir="$ac_optarg" ;;
304
305   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
306     ac_prev=prefix ;;
307   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
308     prefix="$ac_optarg" ;;
309
310   -program-prefix | --program-prefix | --program-prefi | --program-pref \
311   | --program-pre | --program-pr | --program-p)
312     ac_prev=program_prefix ;;
313   -program-prefix=* | --program-prefix=* | --program-prefi=* \
314   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
315     program_prefix="$ac_optarg" ;;
316
317   -program-suffix | --program-suffix | --program-suffi | --program-suff \
318   | --program-suf | --program-su | --program-s)
319     ac_prev=program_suffix ;;
320   -program-suffix=* | --program-suffix=* | --program-suffi=* \
321   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
322     program_suffix="$ac_optarg" ;;
323
324   -program-transform-name | --program-transform-name \
325   | --program-transform-nam | --program-transform-na \
326   | --program-transform-n | --program-transform- \
327   | --program-transform | --program-transfor \
328   | --program-transfo | --program-transf \
329   | --program-trans | --program-tran \
330   | --progr-tra | --program-tr | --program-t)
331     ac_prev=program_transform_name ;;
332   -program-transform-name=* | --program-transform-name=* \
333   | --program-transform-nam=* | --program-transform-na=* \
334   | --program-transform-n=* | --program-transform-=* \
335   | --program-transform=* | --program-transfor=* \
336   | --program-transfo=* | --program-transf=* \
337   | --program-trans=* | --program-tran=* \
338   | --progr-tra=* | --program-tr=* | --program-t=*)
339     program_transform_name="$ac_optarg" ;;
340
341   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
342   | -silent | --silent | --silen | --sile | --sil)
343     silent=yes ;;
344
345   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
346     ac_prev=sbindir ;;
347   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
348   | --sbi=* | --sb=*)
349     sbindir="$ac_optarg" ;;
350
351   -sharedstatedir | --sharedstatedir | --sharedstatedi \
352   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
353   | --sharedst | --shareds | --shared | --share | --shar \
354   | --sha | --sh)
355     ac_prev=sharedstatedir ;;
356   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
357   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
358   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
359   | --sha=* | --sh=*)
360     sharedstatedir="$ac_optarg" ;;
361
362   -site | --site | --sit)
363     ac_prev=site ;;
364   -site=* | --site=* | --sit=*)
365     site="$ac_optarg" ;;
366
367   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
368     ac_prev=srcdir ;;
369   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
370     srcdir="$ac_optarg" ;;
371
372   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
373   | --syscon | --sysco | --sysc | --sys | --sy)
374     ac_prev=sysconfdir ;;
375   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
376   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
377     sysconfdir="$ac_optarg" ;;
378
379   -target | --target | --targe | --targ | --tar | --ta | --t)
380     ac_prev=target ;;
381   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
382     target="$ac_optarg" ;;
383
384   -v | -verbose | --verbose | --verbos | --verbo | --verb)
385     verbose=yes ;;
386
387   -version | --version | --versio | --versi | --vers)
388     echo "configure generated by autoconf version 2.12.970309"
389     exit 0 ;;
390
391   -with-* | --with-*)
392     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
393     # Reject names that are not valid shell variable names.
394     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
395       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
396     fi
397     ac_package=`echo $ac_package| sed 's/-/_/g'`
398     case "$ac_option" in
399       *=*) ;;
400       *) ac_optarg=yes ;;
401     esac
402     eval "with_${ac_package}='$ac_optarg'" ;;
403
404   -without-* | --without-*)
405     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
406     # Reject names that are not valid shell variable names.
407     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
408       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
409     fi
410     ac_package=`echo $ac_package| sed 's/-/_/g'`
411     eval "with_${ac_package}=no" ;;
412
413   --x)
414     # Obsolete; use --with-x.
415     with_x=yes ;;
416
417   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
418   | --x-incl | --x-inc | --x-in | --x-i)
419     ac_prev=x_includes ;;
420   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
421   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
422     x_includes="$ac_optarg" ;;
423
424   -x-libraries | --x-libraries | --x-librarie | --x-librari \
425   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
426     ac_prev=x_libraries ;;
427   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
428   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
429     x_libraries="$ac_optarg" ;;
430
431   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
432     ;;
433
434   *)
435     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
436       echo "configure: warning: $ac_option: invalid host type" 1>&2
437     fi
438     if test "x$nonopt" != xNONE; then
439       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
440     fi
441     nonopt="$ac_option"
442     ;;
443
444   esac
445 done
446
447 if test -n "$ac_prev"; then
448   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
449 fi
450
451 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
452
453 # File descriptor usage:
454 # 0 standard input
455 # 1 file creation
456 # 2 errors and warnings
457 # 3 some systems may open it to /dev/tty
458 # 4 used on the Kubota Titan
459 # 6 checking for... messages and results
460 # 5 compiler messages saved in config.log
461 if test "$silent" = yes; then
462   exec 6>/dev/null
463 else
464   exec 6>&1
465 fi
466 exec 5>./config.log
467
468 echo "\
469 This file contains any messages produced by compilers while
470 running configure, to aid debugging if configure makes a mistake.
471 " 1>&5
472
473 # Strip out --no-create and --no-recursion so they do not pile up.
474 # Also quote any args containing shell metacharacters.
475 ac_configure_args=
476 for ac_arg
477 do
478   case "$ac_arg" in
479   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
480   | --no-cr | --no-c) ;;
481   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
482   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
483   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
484   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
485   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
486   esac
487 done
488
489 # NLS nuisances.
490 # Only set these to C if already set.  These must not be set unconditionally
491 # because not all systems understand e.g. LANG=C (notably SCO).
492 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
493 # Non-C LC_CTYPE values break the ctype check.
494 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
495 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
496 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
497 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
498
499 # confdefs.h avoids OS command line length limits that DEFS can exceed.
500 rm -rf conftest* confdefs.h
501 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
502 echo > confdefs.h
503
504 # A filename unique to this package, relative to the directory that
505 # configure is in, which we can look for to find out if srcdir is correct.
506 ac_unique_file=ncurses/lib_initscr.c
507
508 # Find the source files, if location was not specified.
509 if test -z "$srcdir"; then
510   ac_srcdir_defaulted=yes
511   # Try the directory containing this script, then its parent.
512   ac_prog=$0
513   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
514   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
515   srcdir=$ac_confdir
516   if test ! -r $srcdir/$ac_unique_file; then
517     srcdir=..
518   fi
519 else
520   ac_srcdir_defaulted=no
521 fi
522 if test ! -r $srcdir/$ac_unique_file; then
523   if test "$ac_srcdir_defaulted" = yes; then
524     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
525   else
526     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
527   fi
528 fi
529 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
530
531 # Prefer explicitly selected file to automatically selected ones.
532 if test -z "$CONFIG_SITE"; then
533   if test "x$prefix" != xNONE; then
534     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
535   else
536     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
537   fi
538 fi
539 for ac_site_file in $CONFIG_SITE; do
540   if test -r "$ac_site_file"; then
541     echo "loading site script $ac_site_file"
542     . "$ac_site_file"
543   fi
544 done
545
546 if test -r "$cache_file"; then
547   echo "loading cache $cache_file"
548   . $cache_file
549 else
550   echo "creating cache $cache_file"
551   > $cache_file
552 fi
553
554 ac_ext=c
555 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
556 ac_cpp='$CPP $CPPFLAGS'
557 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
558 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
559 cross_compiling=$ac_cv_prog_cc_cross
560
561 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
562   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
563   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
564     ac_n= ac_c='
565 ' ac_t='        '
566   else
567     ac_n=-n ac_c= ac_t=
568   fi
569 else
570   ac_n= ac_c='\c' ac_t=
571 fi
572
573
574
575
576 NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
577 NCURSES_MINOR="`egrep '^NCURSES_MINOR[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
578 NCURSES_PATCH="`egrep '^NCURSES_PATCH[  ]*=' $srcdir/dist.mk | sed -e 's/^[^0-9]*//'`"
579 nc_cv_abi_version=${NCURSES_MAJOR}
580 nc_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
581 echo "$ac_t""Configuring NCURSES $nc_cv_rel_version ABI $nc_cv_abi_version (`date`)" 1>&6
582
583
584
585
586
587
588
589
590
591 if eval "test \"`echo '$''{'nc_cv_systype'+set}'`\" = set"; then
592   echo $ac_n "(cached) $ac_c" 1>&6
593 else
594   
595 nc_cv_systype="`(uname -s || hostname || echo unknown) 2>/dev/null |sed -e s'/[:\/.-]/_/'g  | sed 1q`"
596 if test -z "$nc_cv_systype"; then nc_cv_systype=unknown;fi
597
598 fi
599
600 echo "$ac_t""System type is $nc_cv_systype" 1>&6
601
602
603 # We need a configure script only when compiling as part of GNU C library.
604 # Here we have to generate one of the files we need while compiling.
605 #
606 # The only problem is that users of the package might think they have to
607 # run configure themself and find it irritating when nothing happens.
608 #
609 # So we try here to find out whether we are called from the glibc configure
610 # or by a user.
611 #
612 # Check whether --enable-add-ons or --disable-add-ons was given.
613 if test "${enable_add_ons+set}" = set; then
614   enableval="$enable_add_ons"
615   glibc_add_on=yes
616 else
617   glibc_add_on=
618 fi
619
620
621 if test x"$glibc_add_on" = "xyes" ; then
622 if test -f $srcdir/../glibcbug.in; then
623   rm -f $srcdir/Banner
624   # We are in glibc.
625   rm -f $srcdir/Makefile
626   cp $srcdir/Makefile.glibc $srcdir/Makefile
627   echo "ncurses `grep \"^[      ]*ncurses-version[      ]*=.*$\" \
628                 $srcdir/Makefile | sed -e \
629                 's/^[   ]*ncurses-version[      ]*=[    ]*\([^  ^ ]*\)[         ]*$/\1/'`" > $srcdir/Banner
630   exit 0
631 fi
632 fi
633
634 ###     Save the given $CFLAGS to allow user-override.
635 nc_user_CFLAGS="$CFLAGS"
636
637 ###     Derive the system name, as a check for reusing the autoconf cache
638 system_name="`(uname -s -r || hostname || echo unknown) 2>/dev/null`"
639 if test -n "$system_name" ; then
640         cat >> confdefs.h <<EOF
641 #define SYSTEM_NAME "$system_name"
642 EOF
643
644 else
645         system_name="`(hostname) 2>/dev/null`"
646 fi
647 if eval "test \"`echo '$''{'nc_cv_system_name'+set}'`\" = set"; then
648   echo $ac_n "(cached) $ac_c" 1>&6
649 else
650   nc_cv_system_name="$system_name"
651 fi
652
653 test -z "$system_name" && system_name="$nc_cv_system_name"
654 test -n "$nc_cv_system_name" && echo "$ac_t"""Configuring for $nc_cv_system_name"" 1>&6
655
656 if test ".$system_name" != ".$nc_cv_system_name" ; then
657         echo "$ac_t"""Cached system name does not agree with actual"" 1>&6
658         { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
659 fi
660
661 ###     Default install-location
662
663 echo $ac_n "checking for prefix""... $ac_c" 1>&6
664 echo "configure:665: checking for prefix" >&5
665 if test "x$prefix" = "xNONE" ; then
666         case "$nc_cv_systype" in
667                 # non-vendor systems don't have a conflict
668         NetBSD|FreeBSD|Linux)   prefix=/usr
669                 ;;
670         *)      prefix=$ac_default_prefix
671                 ;;
672         esac
673 fi
674 echo "$ac_t""$prefix" 1>&6
675 echo $ac_n "checking for default include-directory""... $ac_c" 1>&6
676 echo "configure:677: checking for default include-directory" >&5
677 test -n "$verbose" && echo 1>&6
678 for nc_symbol in \
679         $includedir \
680         $includedir/ncurses \
681         $prefix/include \
682         $prefix/include/ncurses \
683         /usr/local/include \
684         /usr/local/include/ncurses \
685         /usr/include \
686         /usr/include/ncurses
687 do
688         nc_dir=`eval echo $nc_symbol`
689         if test -f $nc_dir/curses.h ; then
690         if ( fgrep NCURSES_VERSION $nc_dir/curses.h 2>&1 >/dev/null ) ; then
691                 includedir="$nc_symbol"
692                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
693                 break
694         fi
695         fi
696         test -n "$verbose"  && echo "   tested $nc_dir" 1>&6
697 done
698 echo "$ac_t""$includedir" 1>&6
699
700
701 ###     Checks for programs.
702 # Extract the first word of "gcc", so it can be a program name with args.
703 set dummy gcc; ac_word=$2
704 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
705 echo "configure:706: checking for $ac_word" >&5
706 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
707   echo $ac_n "(cached) $ac_c" 1>&6
708 else
709   if test -n "$CC"; then
710   ac_cv_prog_CC="$CC" # Let the user override the test.
711 else
712   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
713   for ac_dir in $PATH; do
714     test -z "$ac_dir" && ac_dir=.
715     if test -f $ac_dir/$ac_word; then
716       ac_cv_prog_CC="gcc"
717       break
718     fi
719   done
720   IFS="$ac_save_ifs"
721 fi
722 fi
723 CC="$ac_cv_prog_CC"
724 if test -n "$CC"; then
725   echo "$ac_t""$CC" 1>&6
726 else
727   echo "$ac_t""no" 1>&6
728 fi
729
730 if test -z "$CC"; then
731   # Extract the first word of "cc", so it can be a program name with args.
732 set dummy cc; ac_word=$2
733 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
734 echo "configure:735: checking for $ac_word" >&5
735 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
736   echo $ac_n "(cached) $ac_c" 1>&6
737 else
738   if test -n "$CC"; then
739   ac_cv_prog_CC="$CC" # Let the user override the test.
740 else
741   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
742   ac_prog_rejected=no
743   for ac_dir in $PATH; do
744     test -z "$ac_dir" && ac_dir=.
745     if test -f $ac_dir/$ac_word; then
746       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
747         ac_prog_rejected=yes
748         continue
749       fi
750       ac_cv_prog_CC="cc"
751       break
752     fi
753   done
754   IFS="$ac_save_ifs"
755 if test $ac_prog_rejected = yes; then
756   # We found a bogon in the path, so make sure we never use it.
757   set dummy $ac_cv_prog_CC
758   shift
759   if test $# -gt 0; then
760     # We chose a different compiler from the bogus one.
761     # However, it has the same basename, so the bogon will be chosen
762     # first if we set CC to just the basename; use the full file name.
763     shift
764     set dummy "$ac_dir/$ac_word" "$@"
765     shift
766     ac_cv_prog_CC="$@"
767   fi
768 fi
769 fi
770 fi
771 CC="$ac_cv_prog_CC"
772 if test -n "$CC"; then
773   echo "$ac_t""$CC" 1>&6
774 else
775   echo "$ac_t""no" 1>&6
776 fi
777
778   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
779 fi
780
781 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
782 echo "configure:783: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
783
784 ac_ext=c
785 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
786 ac_cpp='$CPP $CPPFLAGS'
787 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
788 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
789 cross_compiling=$ac_cv_prog_cc_cross
790
791 cat > conftest.$ac_ext <<EOF
792 #line 793 "configure"
793 #include "confdefs.h"
794 main(){return(0);}
795 EOF
796 if { (eval echo configure:797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
797   ac_cv_prog_cc_works=yes
798   # If we can't run a trivial program, we are probably using a cross compiler.
799   if (./conftest; exit) 2>/dev/null; then
800     ac_cv_prog_cc_cross=no
801   else
802     ac_cv_prog_cc_cross=yes
803   fi
804 else
805   echo "configure: failed program was:" >&5
806   cat conftest.$ac_ext >&5
807   ac_cv_prog_cc_works=no
808 fi
809 rm -fr conftest*
810
811 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
812 if test $ac_cv_prog_cc_works = no; then
813   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
814 fi
815 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
816 echo "configure:817: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
817 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
818 cross_compiling=$ac_cv_prog_cc_cross
819
820 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
821 echo "configure:822: checking whether we are using GNU C" >&5
822 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
823   echo $ac_n "(cached) $ac_c" 1>&6
824 else
825   cat > conftest.c <<EOF
826 #ifdef __GNUC__
827   yes;
828 #endif
829 EOF
830 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
831   ac_cv_prog_gcc=yes
832 else
833   ac_cv_prog_gcc=no
834 fi
835 fi
836
837 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
838
839 if test $ac_cv_prog_gcc = yes; then
840   GCC=yes
841   ac_test_CFLAGS="${CFLAGS+set}"
842   ac_save_CFLAGS="$CFLAGS"
843   CFLAGS=
844   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
845 echo "configure:846: checking whether ${CC-cc} accepts -g" >&5
846 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
847   echo $ac_n "(cached) $ac_c" 1>&6
848 else
849   echo 'void f(){}' > conftest.c
850 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
851   ac_cv_prog_cc_g=yes
852 else
853   ac_cv_prog_cc_g=no
854 fi
855 rm -f conftest*
856
857 fi
858
859 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
860   if test "$ac_test_CFLAGS" = set; then
861     CFLAGS="$ac_save_CFLAGS"
862   elif test $ac_cv_prog_cc_g = yes; then
863     CFLAGS="-g -O2"
864   else
865     CFLAGS="-O2"
866   fi
867 else
868   GCC=
869   test "${CFLAGS+set}" = set || CFLAGS="-g"
870 fi
871
872 if test -n "$GCC" ; then
873 echo $ac_n "checking version of gcc""... $ac_c" 1>&6
874 echo "configure:875: checking version of gcc" >&5
875 eval "$CC --version"
876 fi
877 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
878 echo "configure:879: checking how to run the C preprocessor" >&5
879 # On Suns, sometimes $CPP names a directory.
880 if test -n "$CPP" && test -d "$CPP"; then
881   CPP=
882 fi
883 if test -z "$CPP"; then
884 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
885   echo $ac_n "(cached) $ac_c" 1>&6
886 else
887     # This must be in double quotes, not single quotes, because CPP may get
888   # substituted into the Makefile and "${CC-cc}" will confuse make.
889   CPP="${CC-cc} -E"
890   # On the NeXT, cc -E runs the code through the compiler's parser,
891   # not just through cpp.
892   cat > conftest.$ac_ext <<EOF
893 #line 894 "configure"
894 #include "confdefs.h"
895 #include <assert.h>
896 Syntax Error
897 EOF
898 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
899 { (eval echo configure:900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
900 ac_err=`grep -v '^ *+' conftest.out`
901 if test -z "$ac_err"; then
902   :
903 else
904   echo "$ac_err" >&5
905   echo "configure: failed program was:" >&5
906   cat conftest.$ac_ext >&5
907   rm -rf conftest*
908   CPP="${CC-cc} -E -traditional-cpp"
909   cat > conftest.$ac_ext <<EOF
910 #line 911 "configure"
911 #include "confdefs.h"
912 #include <assert.h>
913 Syntax Error
914 EOF
915 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
916 { (eval echo configure:917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
917 ac_err=`grep -v '^ *+' conftest.out`
918 if test -z "$ac_err"; then
919   :
920 else
921   echo "$ac_err" >&5
922   echo "configure: failed program was:" >&5
923   cat conftest.$ac_ext >&5
924   rm -rf conftest*
925   CPP=/lib/cpp
926 fi
927 rm -f conftest*
928 fi
929 rm -f conftest*
930   ac_cv_prog_CPP="$CPP"
931 fi
932   CPP="$ac_cv_prog_CPP"
933 else
934   ac_cv_prog_CPP="$CPP"
935 fi
936 echo "$ac_t""$CPP" 1>&6
937
938 if test $ac_cv_prog_gcc = yes; then
939     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
940 echo "configure:941: checking whether ${CC-cc} needs -traditional" >&5
941 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
942   echo $ac_n "(cached) $ac_c" 1>&6
943 else
944     ac_pattern="Autoconf.*'x'"
945   cat > conftest.$ac_ext <<EOF
946 #line 947 "configure"
947 #include "confdefs.h"
948 #include <sgtty.h>
949 Autoconf TIOCGETP
950 EOF
951 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
952   egrep "$ac_pattern" >/dev/null 2>&1; then
953   rm -rf conftest*
954   ac_cv_prog_gcc_traditional=yes
955 else
956   rm -rf conftest*
957   ac_cv_prog_gcc_traditional=no
958 fi
959 rm -f conftest*
960
961
962   if test $ac_cv_prog_gcc_traditional = no; then
963     cat > conftest.$ac_ext <<EOF
964 #line 965 "configure"
965 #include "confdefs.h"
966 #include <termio.h>
967 Autoconf TCGETA
968 EOF
969 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
970   egrep "$ac_pattern" >/dev/null 2>&1; then
971   rm -rf conftest*
972   ac_cv_prog_gcc_traditional=yes
973 fi
974 rm -f conftest*
975
976   fi
977 fi
978
979 echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
980   if test $ac_cv_prog_gcc_traditional = yes; then
981     CC="$CC -traditional"
982   fi
983 fi
984
985 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
986 echo "configure:987: checking for POSIXized ISC" >&5
987 if test -d /etc/conf/kconfig.d &&
988   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
989 then
990   echo "$ac_t""yes" 1>&6
991   ISC=yes # If later tests want to check for ISC.
992   cat >> confdefs.h <<\EOF
993 #define _POSIX_SOURCE 1
994 EOF
995
996   if test "$GCC" = yes; then
997     CC="$CC -posix"
998   else
999     CC="$CC -Xp"
1000   fi
1001 else
1002   echo "$ac_t""no" 1>&6
1003   ISC=
1004 fi
1005
1006
1007 # Check whether --with-cxx or --without-cxx was given.
1008 if test "${with_cxx+set}" = set; then
1009   withval="$with_cxx"
1010   :
1011 fi
1012
1013 if test "X$withval" != Xno ; then
1014 for ac_prog in $CCC c++ g++ gcc CC cxx cc++
1015 do
1016 # Extract the first word of "$ac_prog", so it can be a program name with args.
1017 set dummy $ac_prog; ac_word=$2
1018 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1019 echo "configure:1020: checking for $ac_word" >&5
1020 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
1021   echo $ac_n "(cached) $ac_c" 1>&6
1022 else
1023   if test -n "$CXX"; then
1024   ac_cv_prog_CXX="$CXX" # Let the user override the test.
1025 else
1026   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1027   for ac_dir in $PATH; do
1028     test -z "$ac_dir" && ac_dir=.
1029     if test -f $ac_dir/$ac_word; then
1030       ac_cv_prog_CXX="$ac_prog"
1031       break
1032     fi
1033   done
1034   IFS="$ac_save_ifs"
1035 fi
1036 fi
1037 CXX="$ac_cv_prog_CXX"
1038 if test -n "$CXX"; then
1039   echo "$ac_t""$CXX" 1>&6
1040 else
1041   echo "$ac_t""no" 1>&6
1042 fi
1043
1044 test -n "$CXX" && break
1045 done
1046 test -n "$CXX" || CXX="gcc"
1047
1048
1049 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1050 echo "configure:1051: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
1051
1052 ac_ext=C
1053 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1054 ac_cpp='$CXXCPP $CPPFLAGS'
1055 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1056 ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1057 cross_compiling=$ac_cv_prog_cxx_cross
1058
1059 cat > conftest.$ac_ext <<EOF
1060 #line 1061 "configure"
1061 #include "confdefs.h"
1062 main(){return(0);}
1063 EOF
1064 if { (eval echo configure:1065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1065   ac_cv_prog_cxx_works=yes
1066   # If we can't run a trivial program, we are probably using a cross compiler.
1067   if (./conftest; exit) 2>/dev/null; then
1068     ac_cv_prog_cxx_cross=no
1069   else
1070     ac_cv_prog_cxx_cross=yes
1071   fi
1072 else
1073   echo "configure: failed program was:" >&5
1074   cat conftest.$ac_ext >&5
1075   ac_cv_prog_cxx_works=no
1076 fi
1077 rm -fr conftest*
1078 ac_ext=c
1079 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1080 ac_cpp='$CPP $CPPFLAGS'
1081 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1082 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1083 cross_compiling=$ac_cv_prog_cc_cross
1084
1085 echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
1086 if test $ac_cv_prog_cxx_works = no; then
1087   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
1088 fi
1089 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1090 echo "configure:1091: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
1091 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
1092 cross_compiling=$ac_cv_prog_cxx_cross
1093
1094 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
1095 echo "configure:1096: checking whether we are using GNU C++" >&5
1096 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
1097   echo $ac_n "(cached) $ac_c" 1>&6
1098 else
1099   cat > conftest.C <<EOF
1100 #ifdef __GNUC__
1101   yes;
1102 #endif
1103 EOF
1104 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1105   ac_cv_prog_gxx=yes
1106 else
1107   ac_cv_prog_gxx=no
1108 fi
1109 fi
1110
1111 echo "$ac_t""$ac_cv_prog_gxx" 1>&6
1112
1113 if test $ac_cv_prog_gxx = yes; then
1114   GXX=yes
1115   ac_test_CXXFLAGS="${CXXFLAGS+set}"
1116   ac_save_CXXFLAGS="$CXXFLAGS"
1117   CXXFLAGS=
1118   echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
1119 echo "configure:1120: checking whether ${CXX-g++} accepts -g" >&5
1120 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
1121   echo $ac_n "(cached) $ac_c" 1>&6
1122 else
1123   echo 'void f(){}' > conftest.cc
1124 if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
1125   ac_cv_prog_cxx_g=yes
1126 else
1127   ac_cv_prog_cxx_g=no
1128 fi
1129 rm -f conftest*
1130
1131 fi
1132
1133 echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
1134   if test "$ac_test_CXXFLAGS" = set; then
1135     CXXFLAGS="$ac_save_CXXFLAGS"
1136   elif test $ac_cv_prog_cxx_g = yes; then
1137     CXXFLAGS="-g -O2"
1138   else
1139     CXXFLAGS="-O2"
1140   fi
1141 else
1142   GXX=
1143   test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
1144 fi
1145
1146 fi
1147 if test -n "$GXX" ; then case "`${CXX-g++} --version`" in 1*|2.[0-6]*) GXX=""; CXX=""; ac_cv_prog_gxx=no; nc_cxx_library=no ; echo No: templates do not work;; esac; fi
1148 for ac_prog in mawk gawk nawk awk
1149 do
1150 # Extract the first word of "$ac_prog", so it can be a program name with args.
1151 set dummy $ac_prog; ac_word=$2
1152 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1153 echo "configure:1154: checking for $ac_word" >&5
1154 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
1155   echo $ac_n "(cached) $ac_c" 1>&6
1156 else
1157   if test -n "$AWK"; then
1158   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1159 else
1160   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1161   for ac_dir in $PATH; do
1162     test -z "$ac_dir" && ac_dir=.
1163     if test -f $ac_dir/$ac_word; then
1164       ac_cv_prog_AWK="$ac_prog"
1165       break
1166     fi
1167   done
1168   IFS="$ac_save_ifs"
1169 fi
1170 fi
1171 AWK="$ac_cv_prog_AWK"
1172 if test -n "$AWK"; then
1173   echo "$ac_t""$AWK" 1>&6
1174 else
1175   echo "$ac_t""no" 1>&6
1176 fi
1177
1178 test -n "$AWK" && break
1179 done
1180
1181 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1182 echo "configure:1183: checking whether ${MAKE-make} sets \${MAKE}" >&5
1183 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1184 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1185   echo $ac_n "(cached) $ac_c" 1>&6
1186 else
1187   cat > conftestmake <<\EOF
1188 all:
1189         @echo 'ac_maketemp="${MAKE}"'
1190 EOF
1191 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1192 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1193 if test -n "$ac_maketemp"; then
1194   eval ac_cv_prog_make_${ac_make}_set=yes
1195 else
1196   eval ac_cv_prog_make_${ac_make}_set=no
1197 fi
1198 rm -f conftestmake
1199 fi
1200 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1201   echo "$ac_t""yes" 1>&6
1202   SET_MAKE=
1203 else
1204   echo "$ac_t""no" 1>&6
1205   SET_MAKE="MAKE=${MAKE-make}"
1206 fi
1207
1208 ac_aux_dir=
1209 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1210   if test -f $ac_dir/install-sh; then
1211     ac_aux_dir=$ac_dir
1212     ac_install_sh="$ac_aux_dir/install-sh -c"
1213     break
1214   elif test -f $ac_dir/install.sh; then
1215     ac_aux_dir=$ac_dir
1216     ac_install_sh="$ac_aux_dir/install.sh -c"
1217     break
1218   fi
1219 done
1220 if test -z "$ac_aux_dir"; then
1221   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
1222 fi
1223 ac_config_guess=$ac_aux_dir/config.guess
1224 ac_config_sub=$ac_aux_dir/config.sub
1225 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
1226
1227 # Find a good install program.  We prefer a C program (faster),
1228 # so one script is as good as another.  But avoid the broken or
1229 # incompatible versions:
1230 # SysV /etc/install, /usr/sbin/install
1231 # SunOS /usr/etc/install
1232 # IRIX /sbin/install
1233 # AIX /bin/install
1234 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1235 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1236 # ./install, which can be erroneously created by make from ./install.sh.
1237 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1238 echo "configure:1239: checking for a BSD compatible install" >&5
1239 if test -z "$INSTALL"; then
1240 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1241   echo $ac_n "(cached) $ac_c" 1>&6
1242 else
1243     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
1244   for ac_dir in $PATH; do
1245     # Account for people who put trailing slashes in PATH elements.
1246     case "$ac_dir/" in
1247     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1248     *)
1249       # OSF1 and SCO ODT 3.0 have their own names for install.
1250       for ac_prog in ginstall installbsd scoinst install; do
1251         if test -f $ac_dir/$ac_prog; then
1252           if test $ac_prog = install &&
1253             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1254             # AIX install.  It has an incompatible calling convention.
1255             # OSF/1 installbsd also uses dspmsg, but is usable.
1256             :
1257           else
1258             ac_cv_path_install="$ac_dir/$ac_prog -c"
1259             break 2
1260           fi
1261         fi
1262       done
1263       ;;
1264     esac
1265   done
1266   IFS="$ac_save_IFS"
1267
1268 fi
1269   if test "${ac_cv_path_install+set}" = set; then
1270     INSTALL="$ac_cv_path_install"
1271   else
1272     # As a last resort, use the slow shell script.  We don't cache a
1273     # path for INSTALL within a source directory, because that will
1274     # break other packages using the cache if that directory is
1275     # removed, or if the path is relative.
1276     INSTALL="$ac_install_sh"
1277   fi
1278 fi
1279 echo "$ac_t""$INSTALL" 1>&6
1280
1281 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1282 # It thinks the first close brace ends the variable substitution.
1283 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1284
1285 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1286
1287 case $INSTALL in
1288 /*)
1289   ;;
1290 *)
1291   nc_dir=`echo $INSTALL|sed -e 's%/[^/]*$%%'`
1292   test -z "$nc_dir" && nc_dir=.
1293   INSTALL=`cd $nc_dir;pwd`/`echo $INSTALL | sed -e 's:^.*/::'`
1294   ;;
1295 esac
1296
1297 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1298 echo "configure:1299: checking whether ln -s works" >&5
1299 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1300   echo $ac_n "(cached) $ac_c" 1>&6
1301 else
1302   rm -f conftestdata
1303 if ln -s X conftestdata 2>/dev/null
1304 then
1305   rm -f conftestdata
1306   ac_cv_prog_LN_S="ln -s"
1307 else
1308   ac_cv_prog_LN_S=ln
1309 fi
1310 fi
1311 LN_S="$ac_cv_prog_LN_S"
1312 if test "$ac_cv_prog_LN_S" = "ln -s"; then
1313   echo "$ac_t""yes" 1>&6
1314 else
1315   echo "$ac_t""no" 1>&6
1316 fi
1317
1318 # Extract the first word of "ranlib", so it can be a program name with args.
1319 set dummy ranlib; ac_word=$2
1320 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1321 echo "configure:1322: checking for $ac_word" >&5
1322 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1323   echo $ac_n "(cached) $ac_c" 1>&6
1324 else
1325   if test -n "$RANLIB"; then
1326   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1327 else
1328   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1329   for ac_dir in $PATH; do
1330     test -z "$ac_dir" && ac_dir=.
1331     if test -f $ac_dir/$ac_word; then
1332       ac_cv_prog_RANLIB="ranlib"
1333       break
1334     fi
1335   done
1336   IFS="$ac_save_ifs"
1337   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1338 fi
1339 fi
1340 RANLIB="$ac_cv_prog_RANLIB"
1341 if test -n "$RANLIB"; then
1342   echo "$ac_t""$RANLIB" 1>&6
1343 else
1344   echo "$ac_t""no" 1>&6
1345 fi
1346
1347 for ac_prog in tdlint lint alint
1348 do
1349 # Extract the first word of "$ac_prog", so it can be a program name with args.
1350 set dummy $ac_prog; ac_word=$2
1351 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1352 echo "configure:1353: checking for $ac_word" >&5
1353 if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then
1354   echo $ac_n "(cached) $ac_c" 1>&6
1355 else
1356   if test -n "$LINT"; then
1357   ac_cv_prog_LINT="$LINT" # Let the user override the test.
1358 else
1359   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1360   for ac_dir in $PATH; do
1361     test -z "$ac_dir" && ac_dir=.
1362     if test -f $ac_dir/$ac_word; then
1363       ac_cv_prog_LINT="$ac_prog"
1364       break
1365     fi
1366   done
1367   IFS="$ac_save_ifs"
1368 fi
1369 fi
1370 LINT="$ac_cv_prog_LINT"
1371 if test -n "$LINT"; then
1372   echo "$ac_t""$LINT" 1>&6
1373 else
1374   echo "$ac_t""no" 1>&6
1375 fi
1376
1377 test -n "$LINT" && break
1378 done
1379
1380 for ac_prog in man man_db
1381 do
1382 # Extract the first word of "$ac_prog", so it can be a program name with args.
1383 set dummy $ac_prog; ac_word=$2
1384 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1385 echo "configure:1386: checking for $ac_word" >&5
1386 if eval "test \"`echo '$''{'ac_cv_prog_MAN'+set}'`\" = set"; then
1387   echo $ac_n "(cached) $ac_c" 1>&6
1388 else
1389   if test -n "$MAN"; then
1390   ac_cv_prog_MAN="$MAN" # Let the user override the test.
1391 else
1392   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1393   for ac_dir in $PATH; do
1394     test -z "$ac_dir" && ac_dir=.
1395     if test -f $ac_dir/$ac_word; then
1396       ac_cv_prog_MAN="$ac_prog"
1397       break
1398     fi
1399   done
1400   IFS="$ac_save_ifs"
1401 fi
1402 fi
1403 MAN="$ac_cv_prog_MAN"
1404 if test -n "$MAN"; then
1405   echo "$ac_t""$MAN" 1>&6
1406 else
1407   echo "$ac_t""no" 1>&6
1408 fi
1409
1410 test -n "$MAN" && break
1411 done
1412
1413
1414
1415 if eval "test \"`echo '$''{'nc_cv_subst_LD'+set}'`\" = set"; then
1416   echo $ac_n "(cached) $ac_c" 1>&6
1417 else
1418   
1419 echo $ac_n "checking for loader (symbol LD)""... $ac_c" 1>&6
1420 echo "configure:1421: checking for loader (symbol LD)" >&5
1421 test -z "$LD" && LD=ld
1422 echo "$ac_t""$LD" 1>&6
1423
1424 nc_cv_subst_LD=$LD
1425 fi
1426
1427 LD=${nc_cv_subst_LD}
1428
1429 if eval "test \"`echo '$''{'nc_cv_subst_AR'+set}'`\" = set"; then
1430   echo $ac_n "(cached) $ac_c" 1>&6
1431 else
1432   
1433 echo $ac_n "checking for archiver (symbol AR)""... $ac_c" 1>&6
1434 echo "configure:1435: checking for archiver (symbol AR)" >&5
1435 test -z "$AR" && AR=ar
1436 echo "$ac_t""$AR" 1>&6
1437
1438 nc_cv_subst_AR=$AR
1439 fi
1440
1441 AR=${nc_cv_subst_AR}
1442
1443 if eval "test \"`echo '$''{'nc_cv_subst_AR_OPTS'+set}'`\" = set"; then
1444   echo $ac_n "(cached) $ac_c" 1>&6
1445 else
1446   
1447 echo $ac_n "checking for archiver options (symbol AR_OPTS)""... $ac_c" 1>&6
1448 echo "configure:1449: checking for archiver options (symbol AR_OPTS)" >&5
1449 test -z "$AR_OPTS" && AR_OPTS=rv
1450 echo "$ac_t""$AR_OPTS" 1>&6
1451
1452 nc_cv_subst_AR_OPTS=$AR_OPTS
1453 fi
1454
1455 AR_OPTS=${nc_cv_subst_AR_OPTS}
1456
1457
1458
1459 echo $ac_n "checking for makeflags variable""... $ac_c" 1>&6
1460 echo "configure:1461: checking for makeflags variable" >&5
1461 if eval "test \"`echo '$''{'nc_cv_makeflags'+set}'`\" = set"; then
1462   echo $ac_n "(cached) $ac_c" 1>&6
1463 else
1464   
1465         nc_cv_makeflags=''
1466         for nc_option in '$(MFLAGS)' '-$(MAKEFLAGS)'
1467         do
1468                 cat >ncurses.tmp <<NC_EOF
1469 all :
1470         echo '.$nc_option'
1471 NC_EOF
1472                 set nc_result=`${MAKE-make} -f ncurses.tmp 2>/dev/null`
1473                 if test "$nc_result" != "."
1474                 then
1475                         nc_cv_makeflags=$nc_option
1476                         break
1477                 fi
1478         done
1479         rm -f ncurses.tmp
1480         
1481 fi
1482
1483 echo "$ac_t""$nc_cv_makeflags" 1>&6
1484
1485
1486 echo $ac_n "checking format of man-pages""... $ac_c" 1>&6
1487 echo "configure:1488: checking format of man-pages" >&5
1488   if test -z "$MANPATH" ; then
1489     MANPATH="/usr/man:/usr/share/man"
1490   fi
1491   # look for the 'date' man-page (it's most likely to be installed!)
1492   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1493   nc_form=unknown
1494   for nc_dir in $MANPATH; do
1495     test -z "$nc_dir" && nc_dir=/usr/man
1496     nc_rename=""
1497     nc_format=no
1498     for nc_name in $nc_dir/*/date.[01]* $nc_dir/*/date
1499     do
1500        nc_test=`echo $nc_name | sed -e 's/*//'`
1501        if test "x$nc_test" = "x$nc_name" ; then
1502           case "$nc_name" in
1503           *.gz) nc_form=gzip;     nc_name=`basename $nc_name .gz`;;
1504           *.Z)  nc_form=compress; nc_name=`basename $nc_name .Z`;;
1505           *.0)  nc_form=BSDI; nc_format=yes;;
1506           *)    nc_form=cat;;
1507           esac
1508           break
1509        fi
1510     done
1511     if test "$nc_form" != "unknown" ; then
1512        break
1513     fi
1514   done
1515   IFS="$ac_save_ifs"
1516   if test "$prefix" = "NONE" ; then
1517      nc_prefix="$ac_default_prefix"
1518   else
1519      nc_prefix="$prefix"
1520   fi
1521
1522   # Debian 'man' program?
1523   test -f /etc/debian_version && \
1524   nc_rename=`cd $srcdir;pwd`/man/man_db.renames
1525
1526   test ! -d man && mkdir man
1527
1528   # Construct a sed-script to perform renaming within man-pages
1529   if test -n "$nc_rename" ; then
1530     fgrep -v \# $nc_rename | \
1531     sed -e 's/^/s\//' \
1532         -e 's/\./\\./' \
1533         -e 's/  / /g' \
1534         -e 's/ \+/\//' \
1535         -e s/\$/\\\/g/ >man/edit_man.sed
1536   fi
1537   if test $nc_format = yes ; then
1538     nc_subdir='$mandir/cat'
1539   else
1540     nc_subdir='$mandir/man'
1541   fi
1542
1543 cat >man/edit_man.sh <<NC_EOF
1544 #!/bin/sh
1545 # this script is generated by the configure-script
1546 prefix="$nc_prefix"
1547 datadir="$datadir"
1548 MKDIRS="`cd $srcdir;pwd`/mkinstalldirs"
1549 INSTALL="$INSTALL"
1550 INSTALL_DATA="$INSTALL_DATA"
1551 TMP=\${TMPDIR-/tmp}/man\$\$
1552 trap "rm -f \$TMP" 0 1 2 5 15
1553
1554 mandir=\$1
1555 shift
1556
1557 for i in \$*
1558 do
1559 case \$i in
1560 *.[0-9]*)
1561         section=\`expr "\$i" : '.*\\.\\([0-9]\\)[xm]*'\`;
1562         if [ ! -d $nc_subdir\${section} ]; then
1563                 \$MKDIRS $nc_subdir\$section
1564         fi
1565         source=\`basename \$i\`
1566 NC_EOF
1567 if test -z "$nc_rename" ; then
1568 cat >>man/edit_man.sh <<NC_EOF
1569         target=$nc_subdir\${section}/\$source
1570         sed -e "s,@DATADIR@,\$datadir," < \$i >\$TMP
1571 NC_EOF
1572 else
1573 cat >>man/edit_man.sh <<NC_EOF
1574         target=\`grep "^\$source" $nc_rename | $AWK '{print \$2}'\`
1575         if test -z "\$target" ; then
1576                 echo '? missing rename for '\$source
1577                 target="\$source"
1578         fi
1579         target="$nc_subdir\$section/\$target"
1580         sed -e 's,@DATADIR@,\$datadir,' < \$i | sed -f edit_man.sed >\$TMP
1581 NC_EOF
1582 fi
1583 if test $nc_format = yes ; then
1584 cat >>man/edit_man.sh <<NC_EOF
1585         nroff -man \$TMP >\$TMP.out
1586         mv \$TMP.out \$TMP
1587 NC_EOF
1588 fi
1589 case "$nc_form" in
1590 compress)
1591 cat >>man/edit_man.sh <<NC_EOF
1592         if ( compress -f \$TMP )
1593         then
1594                 mv \$TMP.Z \$TMP
1595                 target="\$target.Z"
1596         fi
1597 NC_EOF
1598   ;;
1599 gzip)
1600 cat >>man/edit_man.sh <<NC_EOF
1601         if ( gzip -f \$TMP )
1602         then
1603                 mv \$TMP.gz \$TMP
1604                 target="\$target.gz"
1605         fi
1606 NC_EOF
1607   ;;
1608 BSDI)
1609 cat >>man/edit_man.sh <<NC_EOF
1610         # BSDI installs only .0 suffixes in the cat directories
1611         target="\`echo \$target|sed -e 's/\.[1-9]\+.\?/.0/'\`"
1612 NC_EOF
1613   ;;
1614 esac
1615 cat >>man/edit_man.sh <<NC_EOF
1616         echo installing \$target
1617         \$INSTALL_DATA \$TMP \$target
1618         ;;
1619 esac
1620 done 
1621 NC_EOF
1622 chmod 755 man/edit_man.sh
1623 echo "$ac_t""$nc_form" 1>&6
1624
1625
1626 # Check whether --with-install-prefix or --without-install-prefix was given.
1627 if test "${with_install_prefix+set}" = set; then
1628   withval="$with_install_prefix"
1629   case "$withval" in #(vi
1630         yes|no) #(vi
1631                 ;;
1632         *)      INSTALL_PREFIX="$withval"
1633                 ;;
1634         esac
1635 fi
1636
1637
1638
1639 ### Options to allow the user to specify the set of libraries which are used.
1640 ### Use "--without-normal --with-shared" to allow the default model to be
1641 ### shared, for example.
1642 nc_list_models=""
1643 # Check whether --with-shared or --without-shared was given.
1644 if test "${with_shared+set}" = set; then
1645   withval="$with_shared"
1646   test "$withval" = "yes" && nc_list_models="$nc_list_models shared"
1647 fi
1648
1649 # Check whether --with-normal or --without-normal was given.
1650 if test "${with_normal+set}" = set; then
1651   withval="$with_normal"
1652   test "$withval" = "yes" && nc_list_models="$nc_list_models normal"
1653 else
1654   nc_list_models="$nc_list_models normal"
1655 fi
1656
1657 # Check whether --with-debug or --without-debug was given.
1658 if test "${with_debug+set}" = set; then
1659   withval="$with_debug"
1660   test "$withval" = "yes" && nc_list_models="$nc_list_models debug"
1661 else
1662   nc_list_models="$nc_list_models debug"
1663 fi
1664
1665 # Check whether --with-profile or --without-profile was given.
1666 if test "${with_profile+set}" = set; then
1667   withval="$with_profile"
1668   test "$withval" = "yes" && nc_list_models="$nc_list_models profile"
1669 fi
1670
1671
1672 ### Checks for special libraries, must be done up-front.
1673 # Check whether --with-dbmalloc or --without-dbmalloc was given.
1674 if test "${with_dbmalloc+set}" = set; then
1675   withval="$with_dbmalloc"
1676   echo $ac_n "checking for debug_malloc in -ldbmalloc""... $ac_c" 1>&6
1677 echo "configure:1678: checking for debug_malloc in -ldbmalloc" >&5
1678 ac_lib_var=`echo dbmalloc'_'debug_malloc | sed 'y%./+-%__p_%'`
1679 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1680   echo $ac_n "(cached) $ac_c" 1>&6
1681 else
1682   ac_save_LIBS="$LIBS"
1683 LIBS="-ldbmalloc  $LIBS"
1684 cat > conftest.$ac_ext <<EOF
1685 #line 1686 "configure"
1686 #include "confdefs.h"
1687 /* Override any gcc2 internal prototype to avoid an error.  */
1688 /* We use char because int might match the return type of a gcc2
1689     builtin and then its argument prototype would still apply.  */
1690 char debug_malloc();
1691
1692 int main() {
1693 debug_malloc()
1694 ; return 0; }
1695 EOF
1696 if { (eval echo configure:1697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1697   rm -rf conftest*
1698   eval "ac_cv_lib_$ac_lib_var=yes"
1699 else
1700   echo "configure: failed program was:" >&5
1701   cat conftest.$ac_ext >&5
1702   rm -rf conftest*
1703   eval "ac_cv_lib_$ac_lib_var=no"
1704 fi
1705 rm -f conftest*
1706 LIBS="$ac_save_LIBS"
1707
1708 fi
1709 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1710   echo "$ac_t""yes" 1>&6
1711     ac_tr_lib=HAVE_LIB`echo dbmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1712     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1713   cat >> confdefs.h <<EOF
1714 #define $ac_tr_lib 1
1715 EOF
1716
1717   LIBS="-ldbmalloc $LIBS"
1718
1719 else
1720   echo "$ac_t""no" 1>&6
1721 fi
1722
1723 fi
1724
1725 # Check whether --with-dmalloc or --without-dmalloc was given.
1726 if test "${with_dmalloc+set}" = set; then
1727   withval="$with_dmalloc"
1728   echo $ac_n "checking for dmalloc_debug in -ldmalloc""... $ac_c" 1>&6
1729 echo "configure:1730: checking for dmalloc_debug in -ldmalloc" >&5
1730 ac_lib_var=`echo dmalloc'_'dmalloc_debug | sed 'y%./+-%__p_%'`
1731 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1732   echo $ac_n "(cached) $ac_c" 1>&6
1733 else
1734   ac_save_LIBS="$LIBS"
1735 LIBS="-ldmalloc  $LIBS"
1736 cat > conftest.$ac_ext <<EOF
1737 #line 1738 "configure"
1738 #include "confdefs.h"
1739 /* Override any gcc2 internal prototype to avoid an error.  */
1740 /* We use char because int might match the return type of a gcc2
1741     builtin and then its argument prototype would still apply.  */
1742 char dmalloc_debug();
1743
1744 int main() {
1745 dmalloc_debug()
1746 ; return 0; }
1747 EOF
1748 if { (eval echo configure:1749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1749   rm -rf conftest*
1750   eval "ac_cv_lib_$ac_lib_var=yes"
1751 else
1752   echo "configure: failed program was:" >&5
1753   cat conftest.$ac_ext >&5
1754   rm -rf conftest*
1755   eval "ac_cv_lib_$ac_lib_var=no"
1756 fi
1757 rm -f conftest*
1758 LIBS="$ac_save_LIBS"
1759
1760 fi
1761 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1762   echo "$ac_t""yes" 1>&6
1763     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1764     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1765   cat >> confdefs.h <<EOF
1766 #define $ac_tr_lib 1
1767 EOF
1768
1769   LIBS="-ldmalloc $LIBS"
1770
1771 else
1772   echo "$ac_t""no" 1>&6
1773 fi
1774
1775 fi
1776
1777 # Check whether --with-gpm or --without-gpm was given.
1778 if test "${with_gpm+set}" = set; then
1779   withval="$with_gpm"
1780   echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
1781 echo "configure:1782: checking for Gpm_Open in -lgpm" >&5
1782 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
1783 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1784   echo $ac_n "(cached) $ac_c" 1>&6
1785 else
1786   ac_save_LIBS="$LIBS"
1787 LIBS="-lgpm -lcurses -ltermcap $LIBS"
1788 cat > conftest.$ac_ext <<EOF
1789 #line 1790 "configure"
1790 #include "confdefs.h"
1791 /* Override any gcc2 internal prototype to avoid an error.  */
1792 /* We use char because int might match the return type of a gcc2
1793     builtin and then its argument prototype would still apply.  */
1794 char Gpm_Open();
1795
1796 int main() {
1797 Gpm_Open()
1798 ; return 0; }
1799 EOF
1800 if { (eval echo configure:1801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1801   rm -rf conftest*
1802   eval "ac_cv_lib_$ac_lib_var=yes"
1803 else
1804   echo "configure: failed program was:" >&5
1805   cat conftest.$ac_ext >&5
1806   rm -rf conftest*
1807   eval "ac_cv_lib_$ac_lib_var=no"
1808 fi
1809 rm -f conftest*
1810 LIBS="$ac_save_LIBS"
1811
1812 fi
1813 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1814   echo "$ac_t""yes" 1>&6
1815   
1816                 EXTRA_LIBS="$EXTRA_LIBS -lgpm -lncurses"
1817                 cat >> confdefs.h <<\EOF
1818 #define HAVE_LIBGPM 1
1819 EOF
1820
1821                 for ac_hdr in gpm.h
1822 do
1823 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1824 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1825 echo "configure:1826: checking for $ac_hdr" >&5
1826 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1827   echo $ac_n "(cached) $ac_c" 1>&6
1828 else
1829   cat > conftest.$ac_ext <<EOF
1830 #line 1831 "configure"
1831 #include "confdefs.h"
1832 #include <$ac_hdr>
1833 EOF
1834 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1835 { (eval echo configure:1836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1836 ac_err=`grep -v '^ *+' conftest.out`
1837 if test -z "$ac_err"; then
1838   rm -rf conftest*
1839   eval "ac_cv_header_$ac_safe=yes"
1840 else
1841   echo "$ac_err" >&5
1842   echo "configure: failed program was:" >&5
1843   cat conftest.$ac_ext >&5
1844   rm -rf conftest*
1845   eval "ac_cv_header_$ac_safe=no"
1846 fi
1847 rm -f conftest*
1848 fi
1849 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1850   echo "$ac_t""yes" 1>&6
1851     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1852   cat >> confdefs.h <<EOF
1853 #define $ac_tr_hdr 1
1854 EOF
1855  
1856 else
1857   echo "$ac_t""no" 1>&6
1858 fi
1859 done
1860
1861         
1862 else
1863   echo "$ac_t""no" 1>&6
1864 fi
1865
1866 fi
1867
1868
1869
1870
1871 echo $ac_n "checking for specified models""... $ac_c" 1>&6
1872 echo "configure:1873: checking for specified models" >&5
1873 test -z "$nc_list_models" && nc_list_models=normal
1874 echo "$ac_t""$nc_list_models" 1>&6
1875
1876 ### Use the first model as the default, and save its suffix for use in building
1877 ### up test-applications.
1878 DFT_LWR_MODEL=`echo $nc_list_models | $AWK '{print $1}'`
1879
1880 DFT_UPR_MODEL=`echo $DFT_LWR_MODEL |tr '[a-z]' '[A-Z]'`
1881
1882         
1883         
1884         case $DFT_LWR_MODEL in
1885         normal)  DFT_DEP_SUFFIX='.a'   ;;
1886         debug)   DFT_DEP_SUFFIX='_g.a' ;;
1887         profile) DFT_DEP_SUFFIX='_p.a' ;;
1888         shared)
1889                 case $nc_cv_systype in
1890                 NetBSD|FreeBSD)
1891                         DFT_DEP_SUFFIX='.so.$(ABI_VERSION)' ;;
1892                 HP_UX)  DFT_DEP_SUFFIX='.sl'  ;;
1893                 *)      DFT_DEP_SUFFIX='.so'  ;;
1894                 esac
1895         esac
1896
1897         case $DFT_LWR_MODEL in
1898         normal)  DFT_ARG_SUFFIX=''   ;;
1899         debug)   DFT_ARG_SUFFIX='_g' ;;
1900         profile) DFT_ARG_SUFFIX='_p' ;;
1901         shared)  DFT_ARG_SUFFIX=''   ;;
1902         esac
1903
1904         case $DFT_LWR_MODEL in
1905         normal)  DFT_OBJ_SUBDIR='objects' ;;
1906         debug)   DFT_OBJ_SUBDIR='obj_g' ;;
1907         profile) DFT_OBJ_SUBDIR='obj_p' ;;
1908         shared)  DFT_OBJ_SUBDIR='obj_s' ;;
1909         esac
1910
1911 LIB_NAME=ncurses
1912
1913
1914 LIB_DIR=../lib
1915 LIB_PREFIX=$LIB_DIR/lib
1916
1917
1918
1919 if test X"$CC_G_OPT" = X"" ; then
1920         CC_G_OPT='-g'
1921         test -n "$GCC" && test "${ac_cv_prog_cc_g}${ac_cv_prog_gcc_g}" != yes && CC_G_OPT=''
1922 fi
1923
1924
1925 if test X"$CXX_G_OPT" = X"" ; then
1926         CXX_G_OPT='-g'
1927         test -n "$GXX" && test "${ac_cv_prog_cxx_g}${ac_cv_prog_gxx_g}" != yes && CXX_G_OPT=''
1928 fi
1929
1930
1931 case $DFT_LWR_MODEL in
1932 normal)  LD_MODEL=''   ;;
1933 debug)   LD_MODEL=$CC_G_OPT ;;
1934 profile) LD_MODEL='-pg';;
1935 shared)  LD_MODEL=''   ;;
1936 esac
1937
1938         
1939         
1940         LOCAL_LDFLAGS=
1941         LOCAL_LDFLAGS2=
1942
1943         nc_cv_do_symlinks=no
1944         nc_cv_rm_so_locs=no
1945
1946         case $nc_cv_systype in
1947         HP_UX)
1948                 # (tested with gcc 2.7.2 -- I don't have c89)
1949                 if test "${CC}" = "gcc"; then
1950                         CC_SHARED_OPTS='-fPIC'
1951                 else
1952                         CC_SHARED_OPTS='+Z'
1953                 fi
1954                 MK_SHARED_LIB='$(LD) -b -o $@'
1955                 ;;
1956         IRIX*)
1957                 # tested with IRIX 5.2 and 'cc'.
1958                 if test "${CC}" = "gcc"; then
1959                         CC_SHARED_OPTS='-fPIC'
1960                 else
1961                         CC_SHARED_OPTS='-KPIC'
1962                 fi
1963                 MK_SHARED_LIB='$(LD) -shared -rdata_shared -soname `basename $@` -o $@'
1964                 nc_cv_rm_so_locs=yes
1965                 ;;
1966         Linux)
1967                 # tested with Linux 1.2.8 and gcc 2.7.0 (ELF)
1968                 CC_SHARED_OPTS='-fPIC'
1969                 MK_SHARED_LIB='gcc -o $@.$(REL_VERSION) -shared -Wl,-soname,`basename $@.$(ABI_VERSION)`,-stats'
1970                 if test $DFT_LWR_MODEL = "shared" ; then
1971                         LOCAL_LDFLAGS='-Wl,-rpath,../lib'
1972                         LOCAL_LDFLAGS2='-Wl,-rpath,../../lib'
1973                 fi
1974                 nc_cv_do_symlinks=yes
1975                 ;;
1976         NetBSD|FreeBSD)
1977                 CC_SHARED_OPTS='-fpic -DPIC'
1978                 MK_SHARED_LIB='$(LD) -Bshareable -o $@'
1979                 ;;
1980         OSF1|MLS+)
1981                 # tested with OSF/1 V3.2 and 'cc'
1982                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
1983                 # link with shared libs).
1984                 CC_SHARED_OPTS=''
1985                 MK_SHARED_LIB='$(LD) -o $@.$(REL_VERSION) -shared -soname `basename $@.$(ABI_VERSION)`'
1986                 if test $DFT_LWR_MODEL = "shared" ; then
1987                         LOCAL_LDFLAGS='-Wl,-rpath,../lib'
1988                         LOCAL_LDFLAGS2='-Wl,-rpath,../../lib'
1989                 fi
1990                 nc_cv_do_symlinks=yes
1991                 nc_cv_rm_so_locs=yes
1992                 ;;
1993         SunOS)
1994                 # tested with SunOS 4.1.1 and gcc 2.7.0
1995                 # tested with SunOS 5.3 (solaris 2.3) and gcc 2.7.0
1996                 if test $ac_cv_prog_gcc = yes; then
1997                         CC_SHARED_OPTS='-fpic'
1998                 else
1999                         CC_SHARED_OPTS='-KPIC'
2000                 fi
2001                 case `uname -r` in
2002                 4.*)
2003                         MK_SHARED_LIB='$(LD) -assert pure-text -o $@.$(REL_VERSION)'
2004                         ;;
2005                 5.*)
2006                         MK_SHARED_LIB='$(LD) -d y -G -h `basename $@.$(ABI_VERSION)` -o $@.$(REL_VERSION)'
2007                         ;;
2008                 esac
2009                 nc_cv_do_symlinks=yes
2010                 ;;
2011         UNIX_SV)
2012                 # tested with UnixWare 1.1.2
2013                 CC_SHARED_OPTS='-KPIC'
2014                 MK_SHARED_LIB='$(LD) -d y -G -o $@'
2015                 ;;
2016         *)
2017                 CC_SHARED_OPTS='unknown'
2018                 MK_SHARED_LIB='echo unknown'
2019                 ;;
2020         esac
2021         
2022         
2023         
2024         
2025
2026
2027 if test "$CC_SHARED_OPTS" = "unknown"; then
2028         for model in $nc_list_models; do
2029                 if test "$model" = "shared"; then
2030                         echo '** Shared libraries are not supported in this version'
2031                         exit 1
2032                 fi
2033         done
2034 fi
2035
2036 ###     use option --disable-overwrite to leave out the link to -lcurses
2037 echo $ac_n "checking include directory""... $ac_c" 1>&6
2038 echo "configure:2039: checking include directory" >&5
2039 # Check whether --enable-overwrite or --disable-overwrite was given.
2040 if test "${enable_overwrite+set}" = set; then
2041   enableval="$enable_overwrite"
2042   with_overwrite=$enableval
2043          test "$with_overwrite" = no && \
2044          test "x$includedir" = 'x${prefix}/include' && \
2045                 includedir='$(prefix)/include/ncurses'
2046         
2047 else
2048   with_overwrite=yes
2049 fi
2050
2051 echo "$ac_t""$includedir" 1>&6
2052
2053 ###     use option --enable-big-core to make tic run faster on big machines
2054 echo $ac_n "checking if big-core option selected""... $ac_c" 1>&6
2055 echo "configure:2056: checking if big-core option selected" >&5
2056 # Check whether --enable-big-core or --disable-big-core was given.
2057 if test "${enable_big_core+set}" = set; then
2058   enableval="$enable_big_core"
2059   with_big_core=$enableval
2060 else
2061   with_big_core=no
2062 fi
2063
2064 echo "$ac_t""$with_big_core" 1>&6
2065 test "$with_big_core" = "yes" && cat >> confdefs.h <<\EOF
2066 #define HAVE_BIG_CORE 1
2067 EOF
2068
2069
2070 ###     use option --enable-termcap to compile in the termcap fallback support
2071 echo $ac_n "checking if termcap-fallback support is needed""... $ac_c" 1>&6
2072 echo "configure:2073: checking if termcap-fallback support is needed" >&5
2073 # Check whether --enable-termcap or --disable-termcap was given.
2074 if test "${enable_termcap+set}" = set; then
2075   enableval="$enable_termcap"
2076   with_termcap=$enableval
2077 else
2078   with_termcap=no
2079 fi
2080
2081 echo "$ac_t""$with_termcap" 1>&6
2082
2083 if test "$with_termcap" != "yes" ; then
2084         cat >> confdefs.h <<\EOF
2085 #define PURE_TERMINFO 1
2086 EOF
2087
2088 else
2089
2090 ###     use option --enable-getcap to use a hacked getcap for reading termcaps
2091 echo $ac_n "checking if fast termcap-loader is needed""... $ac_c" 1>&6
2092 echo "configure:2093: checking if fast termcap-loader is needed" >&5
2093 # Check whether --enable-getcap or --disable-getcap was given.
2094 if test "${enable_getcap+set}" = set; then
2095   enableval="$enable_getcap"
2096   with_getcap=$enableval
2097 else
2098   with_getcap=no
2099 fi
2100
2101 echo "$ac_t""$with_getcap" 1>&6
2102 test "$with_getcap" = "yes" && cat >> confdefs.h <<\EOF
2103 #define USE_GETCAP 1
2104 EOF
2105
2106
2107 echo $ac_n "checking if translated termcaps will be cached in ~/.terminfo""... $ac_c" 1>&6
2108 echo "configure:2109: checking if translated termcaps will be cached in ~/.terminfo" >&5
2109 # Check whether --enable-getcap-cache or --disable-getcap-cache was given.
2110 if test "${enable_getcap_cache+set}" = set; then
2111   enableval="$enable_getcap_cache"
2112   with_getcap_cache=$enableval
2113 else
2114   with_getcap_cache=no
2115 fi
2116
2117 echo "$ac_t""$with_getcap_cache" 1>&6
2118 test "$with_getcap_cache" = "yes" && cat >> confdefs.h <<\EOF
2119 #define USE_GETCAP_CACHE 1
2120 EOF
2121
2122
2123 fi
2124
2125 ###   use option --enable-symlinks to make tic use symlinks, not hard links
2126 echo $ac_n "checking if tic should use symbolic links""... $ac_c" 1>&6
2127 echo "configure:2128: checking if tic should use symbolic links" >&5
2128 # Check whether --enable-symlinks or --disable-symlinks was given.
2129 if test "${enable_symlinks+set}" = set; then
2130   enableval="$enable_symlinks"
2131   with_symlinks=$enableval
2132 else
2133   with_symlinks=no
2134 fi
2135
2136 echo "$ac_t""$with_symlinks" 1>&6
2137 test "$with_symlinks" = yes && cat >> confdefs.h <<\EOF
2138 #define USE_SYMLINKS 1
2139 EOF
2140
2141
2142 ###   use option --enable-bsdpad to have tputs process BSD-style prefix padding
2143 echo $ac_n "checking if tputs should process BSD-style prefix padding""... $ac_c" 1>&6
2144 echo "configure:2145: checking if tputs should process BSD-style prefix padding" >&5
2145 # Check whether --enable-bsdpad or --disable-bsdpad was given.
2146 if test "${enable_bsdpad+set}" = set; then
2147   enableval="$enable_bsdpad"
2148   with_bsdpad=$enableval
2149 else
2150   with_bsdpad=no
2151 fi
2152
2153 echo "$ac_t""$with_bsdpad" 1>&6
2154 test "$with_bsdpad" = yes && cat >> confdefs.h <<\EOF
2155 #define BSD_TPUTS 1
2156 EOF
2157
2158
2159 ###   use option --enable-const to turn on use of const beyond that in XSI.
2160 echo $ac_n "checking for extended use of const keyword""... $ac_c" 1>&6
2161 echo "configure:2162: checking for extended use of const keyword" >&5
2162 # Check whether --enable-const or --disable-const was given.
2163 if test "${enable_const+set}" = set; then
2164   enableval="$enable_const"
2165   with_ext_const=$enableval
2166 else
2167   with_ext_const=no
2168 fi
2169
2170 echo "$ac_t""$with_ext_const" 1>&6
2171 test "$with_ext_const" = yes && cat >> confdefs.h <<\EOF
2172 #define NCURSES_CONST const
2173 EOF
2174
2175
2176 ### Enable compiling-in rcs id's
2177 echo $ac_n "checking if RCS identifiers should be compiled-in""... $ac_c" 1>&6
2178 echo "configure:2179: checking if RCS identifiers should be compiled-in" >&5
2179 # Check whether --with-rcs-ids or --without-rcs-ids was given.
2180 if test "${with_rcs_ids+set}" = set; then
2181   withval="$with_rcs_ids"
2182   with_rcs_ids=$enableval
2183 else
2184   with_rcs_ids=no
2185 fi
2186
2187 echo "$ac_t""$with_rcs_ids" 1>&6
2188 test "$with_rcs_ids" = yes && cat >> confdefs.h <<\EOF
2189 #define USE_RCS_IDS 1
2190 EOF
2191
2192
2193 ###     use option --disable-echo to suppress full display compiling commands
2194 # Check whether --enable-echo or --disable-echo was given.
2195 if test "${enable_echo+set}" = set; then
2196   enableval="$enable_echo"
2197   with_echo=$enableval
2198 else
2199   with_echo=yes
2200 fi
2201
2202 if test "$with_echo" = yes; then
2203         ECHO_LINK=
2204 else
2205         ECHO_LINK='@ echo linking $@ ... ;'
2206 fi
2207
2208
2209 ###     use option --enable-warnings to turn on all gcc warnings
2210 # Check whether --enable-warnings or --disable-warnings was given.
2211 if test "${enable_warnings+set}" = set; then
2212   enableval="$enable_warnings"
2213   with_warnings=$enableval
2214 fi
2215
2216 if test -n "$with_warnings"; then
2217         ADAFLAGS="$ADAFLAGS -gnatg"
2218         nc_warn_CFLAGS=""
2219 if test -n "$GCC"
2220 then
2221                 cat > conftest.$ac_ext <<EOF
2222 #line 2223 "configure"
2223 int main(int argc, char *argv[]) { return argv[argc-1] == 0; }
2224 EOF
2225                 echo "checking for gcc warning options" 1>&6
2226 echo "configure:2227: checking for gcc warning options" >&5
2227         nc_save_CFLAGS="$CFLAGS"
2228         nc_warn_CFLAGS="-W -Wall"
2229         nc_warn_CONST=""
2230         test "$with_ext_const" = yes && nc_warn_CONST="Wwrite-strings"
2231         for nc_opt in \
2232                 Wbad-function-cast \
2233                 Wcast-align \
2234                 Wcast-qual \
2235                 Winline \
2236                 Wmissing-declarations \
2237                 Wmissing-prototypes \
2238                 Wnested-externs \
2239                 Wpointer-arith \
2240                 Wshadow \
2241                 Wstrict-prototypes $nc_warn_CONST
2242         do
2243                 CFLAGS="$nc_save_CFLAGS $nc_warn_CFLAGS -$nc_opt"
2244                 if { (eval echo configure:2245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2245                         test -n "$verbose" && echo "$ac_t""... -$nc_opt" 1>&6
2246                         nc_warn_CFLAGS="$nc_warn_CFLAGS -$nc_opt"
2247                 fi
2248         done
2249         rm -f conftest*
2250         CFLAGS="$nc_save_CFLAGS"
2251 fi
2252
2253 fi
2254 cat > conftest.i <<EOF
2255 #ifndef GCC_PRINTF
2256 #define GCC_PRINTF 0
2257 #endif
2258 #ifndef GCC_SCANF
2259 #define GCC_SCANF 0
2260 #endif
2261 #ifndef GCC_NORETURN
2262 #define GCC_NORETURN /* nothing */
2263 #endif
2264 #ifndef GCC_UNUSED
2265 #define GCC_UNUSED /* nothing */
2266 #endif
2267 EOF
2268 if test -n "$GCC"
2269 then
2270         echo "checking for gcc __attribute__ directives" 1>&6
2271 echo "configure:2272: checking for gcc __attribute__ directives" >&5
2272         cat > conftest.$ac_ext <<EOF
2273 #line 2274 "configure"
2274 #include "confdefs.h"
2275 #include "conftest.h"
2276 #include "conftest.i"
2277 #if     GCC_PRINTF
2278 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2279 #else
2280 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2281 #endif
2282 #if     GCC_SCANF
2283 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2284 #else
2285 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2286 #endif
2287 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2288 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2289 extern void foo(void) GCC_NORETURN;
2290 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2291 EOF
2292                 for nc_attribute in scanf printf unused noreturn
2293         do
2294                 
2295 NC_ATTRIBUTE=`echo $nc_attribute |tr '[a-z]' '[A-Z]'`
2296
2297                 nc_directive="__attribute__(($nc_attribute))"
2298                 echo "checking for gcc $nc_directive" 1>&5
2299                 case $nc_attribute in
2300                 scanf|printf)
2301                 cat >conftest.h <<EOF
2302 #define GCC_$NC_ATTRIBUTE 1
2303 EOF
2304                         ;;
2305                 *)
2306                 cat >conftest.h <<EOF
2307 #define GCC_$NC_ATTRIBUTE $nc_directive
2308 EOF
2309                         ;;
2310                 esac
2311                 if { (eval echo configure:2312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2312                         test -n "$verbose" && echo "$ac_t""... $nc_attribute" 1>&6
2313                         cat conftest.h >>confdefs.h
2314 #               else
2315 #                       sed -e 's/__attr.*/\/*nothing*\//' conftest.h >>confdefs.h
2316                 fi
2317         done
2318 else
2319         fgrep define conftest.i >>confdefs.h
2320 fi
2321 rm -rf conftest*
2322
2323
2324
2325 ###     use option --enable-assertions to turn on generation of assertion code
2326 # Check whether --enable-assertions or --disable-assertions was given.
2327 if test "${enable_assertions+set}" = set; then
2328   enableval="$enable_assertions"
2329   with_assertions=$enableval
2330 fi
2331
2332 if test -n "$GCC"
2333 then
2334         if test -z "$with_assertions"
2335         then
2336                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
2337         else
2338                 ADAFLAGS="$ADAFLAGS -gnata"
2339         fi
2340 fi
2341
2342 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
2343 # Check whether --enable-leaks or --disable-leaks was given.
2344 if test "${enable_leaks+set}" = set; then
2345   enableval="$enable_leaks"
2346   test $enableval = no && cat >> confdefs.h <<\EOF
2347 #define NO_LEAKS 1
2348 EOF
2349
2350 fi
2351
2352 cat >> confdefs.h <<\EOF
2353 #define HAVE_NC_ALLOC_H 1
2354 EOF
2355
2356
2357 ###     use option --enable-expanded to generate certain macros as functions
2358 # Check whether --enable-expanded or --disable-expanded was given.
2359 if test "${enable_expanded+set}" = set; then
2360   enableval="$enable_expanded"
2361   test $enableval = yes && cat >> confdefs.h <<\EOF
2362 #define NCURSES_EXPANDED 1
2363 EOF
2364
2365 fi
2366
2367
2368 ###     use option --disable-macros to suppress macros in favor of functions
2369 # Check whether --enable-macros or --disable-macros was given.
2370 if test "${enable_macros+set}" = set; then
2371   enableval="$enable_macros"
2372   test $enableval = no && cat >> confdefs.h <<\EOF
2373 #define NCURSES_NOMACROS 1
2374 EOF
2375
2376 fi
2377
2378
2379 ###     Checks for libraries.
2380 echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6
2381 echo "configure:2382: checking for gettimeofday" >&5
2382 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then
2383   echo $ac_n "(cached) $ac_c" 1>&6
2384 else
2385   cat > conftest.$ac_ext <<EOF
2386 #line 2387 "configure"
2387 #include "confdefs.h"
2388 /* System header to define __stub macros and hopefully few prototypes,
2389     which can conflict with char gettimeofday(); below.  */
2390 #include <assert.h>
2391 /* Override any gcc2 internal prototype to avoid an error.  */
2392 /* We use char because int might match the return type of a gcc2
2393     builtin and then its argument prototype would still apply.  */
2394 char gettimeofday();
2395
2396 int main() {
2397
2398 /* The GNU C library defines this for functions which it implements
2399     to always fail with ENOSYS.  Some functions are actually named
2400     something starting with __ and the normal name is an alias.  */
2401 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
2402 choke me
2403 #else
2404 gettimeofday();
2405 #endif
2406
2407 ; return 0; }
2408 EOF
2409 if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2410   rm -rf conftest*
2411   eval "ac_cv_func_gettimeofday=yes"
2412 else
2413   echo "configure: failed program was:" >&5
2414   cat conftest.$ac_ext >&5
2415   rm -rf conftest*
2416   eval "ac_cv_func_gettimeofday=no"
2417 fi
2418 rm -f conftest*
2419 fi
2420
2421 if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then
2422   echo "$ac_t""yes" 1>&6
2423   cat >> confdefs.h <<\EOF
2424 #define HAVE_GETTIMEOFDAY 1
2425 EOF
2426
2427 else
2428   echo "$ac_t""no" 1>&6
2429
2430 echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
2431 echo "configure:2432: checking for gettimeofday in -lbsd" >&5
2432 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
2433 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2434   echo $ac_n "(cached) $ac_c" 1>&6
2435 else
2436   ac_save_LIBS="$LIBS"
2437 LIBS="-lbsd  $LIBS"
2438 cat > conftest.$ac_ext <<EOF
2439 #line 2440 "configure"
2440 #include "confdefs.h"
2441 /* Override any gcc2 internal prototype to avoid an error.  */
2442 /* We use char because int might match the return type of a gcc2
2443     builtin and then its argument prototype would still apply.  */
2444 char gettimeofday();
2445
2446 int main() {
2447 gettimeofday()
2448 ; return 0; }
2449 EOF
2450 if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2451   rm -rf conftest*
2452   eval "ac_cv_lib_$ac_lib_var=yes"
2453 else
2454   echo "configure: failed program was:" >&5
2455   cat conftest.$ac_ext >&5
2456   rm -rf conftest*
2457   eval "ac_cv_lib_$ac_lib_var=no"
2458 fi
2459 rm -f conftest*
2460 LIBS="$ac_save_LIBS"
2461
2462 fi
2463 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2464   echo "$ac_t""yes" 1>&6
2465   cat >> confdefs.h <<\EOF
2466 #define HAVE_GETTIMEOFDAY 1
2467 EOF
2468
2469         LIBS="$LIBS -lbsd"
2470 else
2471   echo "$ac_t""no" 1>&6
2472 fi
2473
2474 fi
2475
2476 ###     Checks for header files.
2477 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
2478 echo "configure:2479: checking for ANSI C header files" >&5
2479 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
2480   echo $ac_n "(cached) $ac_c" 1>&6
2481 else
2482   cat > conftest.$ac_ext <<EOF
2483 #line 2484 "configure"
2484 #include "confdefs.h"
2485 #include <stdlib.h>
2486 #include <stdarg.h>
2487 #include <string.h>
2488 #include <float.h>
2489 EOF
2490 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2491 { (eval echo configure:2492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2492 ac_err=`grep -v '^ *+' conftest.out`
2493 if test -z "$ac_err"; then
2494   rm -rf conftest*
2495   ac_cv_header_stdc=yes
2496 else
2497   echo "$ac_err" >&5
2498   echo "configure: failed program was:" >&5
2499   cat conftest.$ac_ext >&5
2500   rm -rf conftest*
2501   ac_cv_header_stdc=no
2502 fi
2503 rm -f conftest*
2504
2505 if test $ac_cv_header_stdc = yes; then
2506   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
2507 cat > conftest.$ac_ext <<EOF
2508 #line 2509 "configure"
2509 #include "confdefs.h"
2510 #include <string.h>
2511 EOF
2512 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2513   egrep "memchr" >/dev/null 2>&1; then
2514   :
2515 else
2516   rm -rf conftest*
2517   ac_cv_header_stdc=no
2518 fi
2519 rm -f conftest*
2520
2521 fi
2522
2523 if test $ac_cv_header_stdc = yes; then
2524   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
2525 cat > conftest.$ac_ext <<EOF
2526 #line 2527 "configure"
2527 #include "confdefs.h"
2528 #include <stdlib.h>
2529 EOF
2530 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2531   egrep "free" >/dev/null 2>&1; then
2532   :
2533 else
2534   rm -rf conftest*
2535   ac_cv_header_stdc=no
2536 fi
2537 rm -f conftest*
2538
2539 fi
2540
2541 if test $ac_cv_header_stdc = yes; then
2542   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
2543 if test "$cross_compiling" = yes; then
2544   :
2545 else
2546   cat > conftest.$ac_ext <<EOF
2547 #line 2548 "configure"
2548 #include "confdefs.h"
2549 #include <ctype.h>
2550 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
2551 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
2552 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
2553 int main () { int i; for (i = 0; i < 256; i++)
2554 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
2555 exit (0); }
2556
2557 EOF
2558 if { (eval echo configure:2559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2559 then
2560   :
2561 else
2562   echo "configure: failed program was:" >&5
2563   cat conftest.$ac_ext >&5
2564   rm -fr conftest*
2565   ac_cv_header_stdc=no
2566 fi
2567 rm -fr conftest*
2568 fi
2569
2570 fi
2571 fi
2572
2573 echo "$ac_t""$ac_cv_header_stdc" 1>&6
2574 if test $ac_cv_header_stdc = yes; then
2575   cat >> confdefs.h <<\EOF
2576 #define STDC_HEADERS 1
2577 EOF
2578
2579 fi
2580
2581 ac_header_dirent=no
2582 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
2583 do
2584 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2585 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
2586 echo "configure:2587: checking for $ac_hdr that defines DIR" >&5
2587 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
2588   echo $ac_n "(cached) $ac_c" 1>&6
2589 else
2590   cat > conftest.$ac_ext <<EOF
2591 #line 2592 "configure"
2592 #include "confdefs.h"
2593 #include <sys/types.h>
2594 #include <$ac_hdr>
2595 int main() {
2596 DIR *dirp = 0;
2597 ; return 0; }
2598 EOF
2599 if { (eval echo configure:2600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2600   rm -rf conftest*
2601   eval "ac_cv_header_dirent_$ac_safe=yes"
2602 else
2603   echo "configure: failed program was:" >&5
2604   cat conftest.$ac_ext >&5
2605   rm -rf conftest*
2606   eval "ac_cv_header_dirent_$ac_safe=no"
2607 fi
2608 rm -f conftest*
2609 fi
2610 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
2611   echo "$ac_t""yes" 1>&6
2612     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2613   cat >> confdefs.h <<EOF
2614 #define $ac_tr_hdr 1
2615 EOF
2616  ac_header_dirent=$ac_hdr; break
2617 else
2618   echo "$ac_t""no" 1>&6
2619 fi
2620 done
2621 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
2622 if test $ac_header_dirent = dirent.h; then
2623 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
2624 echo "configure:2625: checking for opendir in -ldir" >&5
2625 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
2626 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2627   echo $ac_n "(cached) $ac_c" 1>&6
2628 else
2629   ac_save_LIBS="$LIBS"
2630 LIBS="-ldir  $LIBS"
2631 cat > conftest.$ac_ext <<EOF
2632 #line 2633 "configure"
2633 #include "confdefs.h"
2634 /* Override any gcc2 internal prototype to avoid an error.  */
2635 /* We use char because int might match the return type of a gcc2
2636     builtin and then its argument prototype would still apply.  */
2637 char opendir();
2638
2639 int main() {
2640 opendir()
2641 ; return 0; }
2642 EOF
2643 if { (eval echo configure:2644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2644   rm -rf conftest*
2645   eval "ac_cv_lib_$ac_lib_var=yes"
2646 else
2647   echo "configure: failed program was:" >&5
2648   cat conftest.$ac_ext >&5
2649   rm -rf conftest*
2650   eval "ac_cv_lib_$ac_lib_var=no"
2651 fi
2652 rm -f conftest*
2653 LIBS="$ac_save_LIBS"
2654
2655 fi
2656 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2657   echo "$ac_t""yes" 1>&6
2658   LIBS="$LIBS -ldir"
2659 else
2660   echo "$ac_t""no" 1>&6
2661 fi
2662
2663 else
2664 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
2665 echo "configure:2666: checking for opendir in -lx" >&5
2666 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
2667 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2668   echo $ac_n "(cached) $ac_c" 1>&6
2669 else
2670   ac_save_LIBS="$LIBS"
2671 LIBS="-lx  $LIBS"
2672 cat > conftest.$ac_ext <<EOF
2673 #line 2674 "configure"
2674 #include "confdefs.h"
2675 /* Override any gcc2 internal prototype to avoid an error.  */
2676 /* We use char because int might match the return type of a gcc2
2677     builtin and then its argument prototype would still apply.  */
2678 char opendir();
2679
2680 int main() {
2681 opendir()
2682 ; return 0; }
2683 EOF
2684 if { (eval echo configure:2685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2685   rm -rf conftest*
2686   eval "ac_cv_lib_$ac_lib_var=yes"
2687 else
2688   echo "configure: failed program was:" >&5
2689   cat conftest.$ac_ext >&5
2690   rm -rf conftest*
2691   eval "ac_cv_lib_$ac_lib_var=no"
2692 fi
2693 rm -f conftest*
2694 LIBS="$ac_save_LIBS"
2695
2696 fi
2697 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2698   echo "$ac_t""yes" 1>&6
2699   LIBS="$LIBS -lx"
2700 else
2701   echo "$ac_t""no" 1>&6
2702 fi
2703
2704 fi
2705
2706
2707 echo $ac_n "checking for regular-expression headers""... $ac_c" 1>&6
2708 echo "configure:2709: checking for regular-expression headers" >&5
2709 if eval "test \"`echo '$''{'nc_cv_regex'+set}'`\" = set"; then
2710   echo $ac_n "(cached) $ac_c" 1>&6
2711 else
2712   
2713 cat > conftest.$ac_ext <<EOF
2714 #line 2715 "configure"
2715 #include "confdefs.h"
2716 #include <sys/types.h>
2717 #include <regex.h>
2718 int main() {
2719
2720         regex_t *p;
2721         int x = regcomp(p, "", 0);
2722         int y = regexec(p, "", 0, 0, 0);
2723         regfree(p);
2724         
2725 ; return 0; }
2726 EOF
2727 if { (eval echo configure:2728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2728   rm -rf conftest*
2729   nc_cv_regex="regex.h"
2730 else
2731   echo "configure: failed program was:" >&5
2732   cat conftest.$ac_ext >&5
2733   rm -rf conftest*
2734   
2735         cat > conftest.$ac_ext <<EOF
2736 #line 2737 "configure"
2737 #include "confdefs.h"
2738 #include <regexp.h>
2739 int main() {
2740
2741                 char *p = compile("", "", "", 0);
2742                 int x = step("", "");
2743         
2744 ; return 0; }
2745 EOF
2746 if { (eval echo configure:2747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2747   rm -rf conftest*
2748   nc_cv_regex="regexp.h"
2749 else
2750   echo "configure: failed program was:" >&5
2751   cat conftest.$ac_ext >&5
2752   rm -rf conftest*
2753   
2754                 cat > conftest.$ac_ext <<EOF
2755 #line 2756 "configure"
2756 #include "confdefs.h"
2757 #include <regexpr.h>
2758 int main() {
2759
2760                         char *p = compile("", "", "");
2761                         int x = step("", "");
2762                 
2763 ; return 0; }
2764 EOF
2765 if { (eval echo configure:2766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2766   rm -rf conftest*
2767   nc_cv_regex="regexpr.h"
2768 else
2769   echo "configure: failed program was:" >&5
2770   cat conftest.$ac_ext >&5
2771 fi
2772 rm -f conftest*
2773 fi
2774 rm -f conftest*
2775 fi
2776 rm -f conftest*
2777
2778 fi
2779
2780 echo "$ac_t""$nc_cv_regex" 1>&6
2781 case $nc_cv_regex in
2782         regex.h)   cat >> confdefs.h <<\EOF
2783 #define HAVE_REGEX_H 1
2784 EOF
2785  ;;
2786         regexp.h)  cat >> confdefs.h <<\EOF
2787 #define HAVE_REGEXP_H 1
2788 EOF
2789  ;;
2790         regexpr.h) cat >> confdefs.h <<\EOF
2791 #define HAVE_REGEXPR_H 1
2792 EOF
2793  ;;
2794 esac
2795
2796
2797 for ac_hdr in \
2798 fcntl.h \
2799 getopt.h \
2800 libc.h \
2801 limits.h \
2802 locale.h \
2803 sys/bsdtypes.h \
2804 sys/ioctl.h \
2805 sys/param.h \
2806 poll.h \
2807 sys/select.h \
2808 sys/stropts.h \
2809 sys/time.h \
2810 sys/times.h \
2811 termio.h \
2812 termios.h \
2813 ttyent.h \
2814 unistd.h \
2815 values.h \
2816
2817 do
2818 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2819 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2820 echo "configure:2821: checking for $ac_hdr" >&5
2821 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2822   echo $ac_n "(cached) $ac_c" 1>&6
2823 else
2824   cat > conftest.$ac_ext <<EOF
2825 #line 2826 "configure"
2826 #include "confdefs.h"
2827 #include <$ac_hdr>
2828 EOF
2829 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2830 { (eval echo configure:2831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2831 ac_err=`grep -v '^ *+' conftest.out`
2832 if test -z "$ac_err"; then
2833   rm -rf conftest*
2834   eval "ac_cv_header_$ac_safe=yes"
2835 else
2836   echo "$ac_err" >&5
2837   echo "configure: failed program was:" >&5
2838   cat conftest.$ac_ext >&5
2839   rm -rf conftest*
2840   eval "ac_cv_header_$ac_safe=no"
2841 fi
2842 rm -f conftest*
2843 fi
2844 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2845   echo "$ac_t""yes" 1>&6
2846     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2847   cat >> confdefs.h <<EOF
2848 #define $ac_tr_hdr 1
2849 EOF
2850  
2851 else
2852   echo "$ac_t""no" 1>&6
2853 fi
2854 done
2855
2856
2857 # check for HPUX's ANSI compiler
2858 if test $nc_cv_systype = HP_UX; then
2859 if test -z "$GCC"; then
2860         echo $ac_n "checking for HP/UX ANSI compiler""... $ac_c" 1>&6
2861 echo "configure:2862: checking for HP/UX ANSI compiler" >&5
2862         nc_save_CFLAGS="$CFLAGS"
2863         CFLAGS="$CFLAGS -Aa"
2864         cat > conftest.$ac_ext <<EOF
2865 #line 2866 "configure"
2866 #include "confdefs.h"
2867
2868 int main() {
2869 void (*f)(void)=0
2870 ; return 0; }
2871 EOF
2872 if { (eval echo configure:2873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2873   rm -rf conftest*
2874   nc_hpux_cc=yes
2875 else
2876   echo "configure: failed program was:" >&5
2877   cat conftest.$ac_ext >&5
2878   rm -rf conftest*
2879   nc_hpux_cc=no
2880 fi
2881 rm -f conftest*
2882         echo "$ac_t""$nc_hpux_cc" 1>&6
2883         if test $nc_hpux_cc = yes; then
2884                 cat >> confdefs.h <<\EOF
2885 #define _HPUX_SOURCE 1
2886 EOF
2887
2888         else
2889                 CFLAGS="$nc_save_CFLAGS"
2890         fi
2891 fi;fi
2892
2893 # check for ISC (this may also define _POSIX_SOURCE)
2894 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
2895 if test "$ISC" = yes ; then
2896         echo $ac_n "checking for main in -lcposix""... $ac_c" 1>&6
2897 echo "configure:2898: checking for main in -lcposix" >&5
2898 ac_lib_var=`echo cposix'_'main | sed 'y%./+-%__p_%'`
2899 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2900   echo $ac_n "(cached) $ac_c" 1>&6
2901 else
2902   ac_save_LIBS="$LIBS"
2903 LIBS="-lcposix  $LIBS"
2904 cat > conftest.$ac_ext <<EOF
2905 #line 2906 "configure"
2906 #include "confdefs.h"
2907
2908 int main() {
2909 main()
2910 ; return 0; }
2911 EOF
2912 if { (eval echo configure:2913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2913   rm -rf conftest*
2914   eval "ac_cv_lib_$ac_lib_var=yes"
2915 else
2916   echo "configure: failed program was:" >&5
2917   cat conftest.$ac_ext >&5
2918   rm -rf conftest*
2919   eval "ac_cv_lib_$ac_lib_var=no"
2920 fi
2921 rm -f conftest*
2922 LIBS="$ac_save_LIBS"
2923
2924 fi
2925 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2926   echo "$ac_t""yes" 1>&6
2927     ac_tr_lib=HAVE_LIB`echo cposix | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2928     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2929   cat >> confdefs.h <<EOF
2930 #define $ac_tr_lib 1
2931 EOF
2932
2933   LIBS="-lcposix $LIBS"
2934
2935 else
2936   echo "$ac_t""no" 1>&6
2937 fi
2938
2939         echo $ac_n "checking for bzero in -linet""... $ac_c" 1>&6
2940 echo "configure:2941: checking for bzero in -linet" >&5
2941 ac_lib_var=`echo inet'_'bzero | sed 'y%./+-%__p_%'`
2942 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2943   echo $ac_n "(cached) $ac_c" 1>&6
2944 else
2945   ac_save_LIBS="$LIBS"
2946 LIBS="-linet  $LIBS"
2947 cat > conftest.$ac_ext <<EOF
2948 #line 2949 "configure"
2949 #include "confdefs.h"
2950 /* Override any gcc2 internal prototype to avoid an error.  */
2951 /* We use char because int might match the return type of a gcc2
2952     builtin and then its argument prototype would still apply.  */
2953 char bzero();
2954
2955 int main() {
2956 bzero()
2957 ; return 0; }
2958 EOF
2959 if { (eval echo configure:2960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2960   rm -rf conftest*
2961   eval "ac_cv_lib_$ac_lib_var=yes"
2962 else
2963   echo "configure: failed program was:" >&5
2964   cat conftest.$ac_ext >&5
2965   rm -rf conftest*
2966   eval "ac_cv_lib_$ac_lib_var=no"
2967 fi
2968 rm -f conftest*
2969 LIBS="$ac_save_LIBS"
2970
2971 fi
2972 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2973   echo "$ac_t""yes" 1>&6
2974   LIBS="$LIBS -linet"
2975 else
2976   echo "$ac_t""no" 1>&6
2977 fi
2978         for ac_hdr in sys/termio.h 
2979 do
2980 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2981 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2982 echo "configure:2983: checking for $ac_hdr" >&5
2983 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2984   echo $ac_n "(cached) $ac_c" 1>&6
2985 else
2986   cat > conftest.$ac_ext <<EOF
2987 #line 2988 "configure"
2988 #include "confdefs.h"
2989 #include <$ac_hdr>
2990 EOF
2991 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2992 { (eval echo configure:2993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2993 ac_err=`grep -v '^ *+' conftest.out`
2994 if test -z "$ac_err"; then
2995   rm -rf conftest*
2996   eval "ac_cv_header_$ac_safe=yes"
2997 else
2998   echo "$ac_err" >&5
2999   echo "configure: failed program was:" >&5
3000   cat conftest.$ac_ext >&5
3001   rm -rf conftest*
3002   eval "ac_cv_header_$ac_safe=no"
3003 fi
3004 rm -f conftest*
3005 fi
3006 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3007   echo "$ac_t""yes" 1>&6
3008     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3009   cat >> confdefs.h <<EOF
3010 #define $ac_tr_hdr 1
3011 EOF
3012  
3013 else
3014   echo "$ac_t""no" 1>&6
3015 fi
3016 done
3017
3018 fi
3019
3020 # check for SCO.  this is a hack, and should be split into individual
3021 # features -- the sys/time.h and select.h conflict, and the need for
3022 # ptem.h due to winsize struct.
3023 echo "checking for SCO by checking on /usr/bin/scosh" 1>&6
3024 echo "configure:3025: checking for SCO by checking on /usr/bin/scosh" >&5
3025 # Extract the first word of "scosh", so it can be a program name with args.
3026 set dummy scosh; ac_word=$2
3027 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3028 echo "configure:3029: checking for $ac_word" >&5
3029 if eval "test \"`echo '$''{'ac_cv_prog_COULD_BE_SCO'+set}'`\" = set"; then
3030   echo $ac_n "(cached) $ac_c" 1>&6
3031 else
3032   if test -n "$COULD_BE_SCO"; then
3033   ac_cv_prog_COULD_BE_SCO="$COULD_BE_SCO" # Let the user override the test.
3034 else
3035   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3036   for ac_dir in $PATH; do
3037     test -z "$ac_dir" && ac_dir=.
3038     if test -f $ac_dir/$ac_word; then
3039       ac_cv_prog_COULD_BE_SCO="maybe"
3040       break
3041     fi
3042   done
3043   IFS="$ac_save_ifs"
3044   test -z "$ac_cv_prog_COULD_BE_SCO" && ac_cv_prog_COULD_BE_SCO="maybenot"
3045 fi
3046 fi
3047 COULD_BE_SCO="$ac_cv_prog_COULD_BE_SCO"
3048 if test -n "$COULD_BE_SCO"; then
3049   echo "$ac_t""$COULD_BE_SCO" 1>&6
3050 else
3051   echo "$ac_t""no" 1>&6
3052 fi
3053
3054 if test "$COULD_BE_SCO" = "maybe"
3055 then
3056         cat >> confdefs.h <<\EOF
3057 #define SYSTEM_LOOKS_LIKE_SCO 1
3058 EOF
3059
3060 fi
3061
3062 ###     checks for compiler characteristics
3063 ac_ext=c
3064 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3065 ac_cpp='$CPP $CPPFLAGS'
3066 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3067 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3068 cross_compiling=$ac_cv_prog_cc_cross
3069
3070 echo $ac_n "checking for working const""... $ac_c" 1>&6
3071 echo "configure:3072: checking for working const" >&5
3072 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
3073   echo $ac_n "(cached) $ac_c" 1>&6
3074 else
3075   cat > conftest.$ac_ext <<EOF
3076 #line 3077 "configure"
3077 #include "confdefs.h"
3078
3079 int main() {
3080
3081 /* Ultrix mips cc rejects this.  */
3082 typedef int charset[2]; const charset x;
3083 /* SunOS 4.1.1 cc rejects this.  */
3084 char const *const *ccp;
3085 char **p;
3086 /* NEC SVR4.0.2 mips cc rejects this.  */
3087 struct point {int x, y;};
3088 static struct point const zero = {0,0};
3089 /* AIX XL C 1.02.0.0 rejects this.
3090    It does not let you subtract one const X* pointer from another in an arm
3091    of an if-expression whose if-part is not a constant expression */
3092 const char *g = "string";
3093 ccp = &g + (g ? g-g : 0);
3094 /* HPUX 7.0 cc rejects these. */
3095 ++ccp;
3096 p = (char**) ccp;
3097 ccp = (char const *const *) p;
3098 { /* SCO 3.2v4 cc rejects this.  */
3099   char *t;
3100   char const *s = 0 ? (char *) 0 : (char const *) 0;
3101
3102   *t++ = 0;
3103 }
3104 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3105   int x[] = {25, 17};
3106   const int *foo = &x[0];
3107   ++foo;
3108 }
3109 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3110   typedef const int *iptr;
3111   iptr p = 0;
3112   ++p;
3113 }
3114 { /* AIX XL C 1.02.0.0 rejects this saying
3115      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3116   struct s { int j; const int *ap[3]; };
3117   struct s *b; b->j = 5;
3118 }
3119 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3120   const int foo = 10;
3121 }
3122
3123 ; return 0; }
3124 EOF
3125 if { (eval echo configure:3126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3126   rm -rf conftest*
3127   ac_cv_c_const=yes
3128 else
3129   echo "configure: failed program was:" >&5
3130   cat conftest.$ac_ext >&5
3131   rm -rf conftest*
3132   ac_cv_c_const=no
3133 fi
3134 rm -f conftest*
3135 fi
3136
3137 echo "$ac_t""$ac_cv_c_const" 1>&6
3138 if test $ac_cv_c_const = no; then
3139   cat >> confdefs.h <<\EOF
3140 #define const 
3141 EOF
3142
3143 fi
3144
3145 echo $ac_n "checking for inline""... $ac_c" 1>&6
3146 echo "configure:3147: checking for inline" >&5
3147 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
3148   echo $ac_n "(cached) $ac_c" 1>&6
3149 else
3150   ac_cv_c_inline=no
3151 for ac_kw in inline __inline__ __inline; do
3152   cat > conftest.$ac_ext <<EOF
3153 #line 3154 "configure"
3154 #include "confdefs.h"
3155
3156 int main() {
3157 } $ac_kw foo() {
3158 ; return 0; }
3159 EOF
3160 if { (eval echo configure:3161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3161   rm -rf conftest*
3162   ac_cv_c_inline=$ac_kw; break
3163 else
3164   echo "configure: failed program was:" >&5
3165   cat conftest.$ac_ext >&5
3166 fi
3167 rm -f conftest*
3168 done
3169
3170 fi
3171
3172 echo "$ac_t""$ac_cv_c_inline" 1>&6
3173 case "$ac_cv_c_inline" in
3174   inline | yes) ;;
3175   no) cat >> confdefs.h <<\EOF
3176 #define inline 
3177 EOF
3178  ;;
3179   *)  cat >> confdefs.h <<EOF
3180 #define inline $ac_cv_c_inline
3181 EOF
3182  ;;
3183 esac
3184
3185 test $ac_cv_c_inline != no && cat >> confdefs.h <<\EOF
3186 #define CC_HAS_INLINE_FUNCS 1
3187 EOF
3188
3189
3190 ###     Checks for external-data
3191
3192 echo $ac_n "checking for errno external decl""... $ac_c" 1>&6
3193 echo "configure:3194: checking for errno external decl" >&5
3194 if eval "test \"`echo '$''{'nc_cv_extern_errno'+set}'`\" = set"; then
3195   echo $ac_n "(cached) $ac_c" 1>&6
3196 else
3197   
3198         cat > conftest.$ac_ext <<EOF
3199 #line 3200 "configure"
3200 #include "confdefs.h"
3201
3202 #include <errno.h>
3203 int main() {
3204 int x = errno
3205 ; return 0; }
3206 EOF
3207 if { (eval echo configure:3208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3208   rm -rf conftest*
3209   nc_cv_extern_errno=yes
3210 else
3211   echo "configure: failed program was:" >&5
3212   cat conftest.$ac_ext >&5
3213   rm -rf conftest*
3214   nc_cv_extern_errno=no
3215 fi
3216 rm -f conftest*
3217         
3218 fi
3219
3220 echo "$ac_t""$nc_cv_extern_errno" 1>&6
3221 test $nc_cv_extern_errno = yes && cat >> confdefs.h <<\EOF
3222 #define HAVE_EXTERN_ERRNO 1
3223 EOF
3224
3225
3226
3227 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
3228 echo "configure:3229: checking declaration of sys_errlist" >&5
3229 if eval "test \"`echo '$''{'nc_cv_dcl_sys_errlist'+set}'`\" = set"; then
3230   echo $ac_n "(cached) $ac_c" 1>&6
3231 else
3232   
3233         cat > conftest.$ac_ext <<EOF
3234 #line 3235 "configure"
3235 #include "confdefs.h"
3236
3237 #include <stdio.h>
3238 #include <sys/types.h>
3239 #include <errno.h> 
3240 int main() {
3241  char *c = (char *) *sys_errlist; 
3242 ; return 0; }
3243 EOF
3244 if { (eval echo configure:3245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3245   rm -rf conftest*
3246   nc_cv_dcl_sys_errlist=yes
3247 else
3248   echo "configure: failed program was:" >&5
3249   cat conftest.$ac_ext >&5
3250   rm -rf conftest*
3251   nc_cv_dcl_sys_errlist=no
3252 fi
3253 rm -f conftest*
3254         
3255 fi
3256
3257 echo "$ac_t""$nc_cv_dcl_sys_errlist" 1>&6
3258 test $nc_cv_dcl_sys_errlist = yes && cat >> confdefs.h <<\EOF
3259 #define HAVE_EXTERN_SYS_ERRLIST 1
3260 EOF
3261
3262
3263
3264 echo $ac_n "checking if data-only library module links""... $ac_c" 1>&6
3265 echo "configure:3266: checking if data-only library module links" >&5
3266 if eval "test \"`echo '$''{'nc_cv_link_dataonly'+set}'`\" = set"; then
3267   echo $ac_n "(cached) $ac_c" 1>&6
3268 else
3269   
3270         rm -f conftest.a
3271                 cat >conftest.$ac_ext <<EOF
3272 #line 3273 "configure"
3273 int     testdata[3] = { 123, 456, 789 };
3274 EOF
3275                 if { (eval echo configure:3276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } ; then
3276                 mv conftest.o data.o && \
3277                 ( $AR $AR_OPTS conftest.a data.o ) 2>&5 1>/dev/null
3278         fi
3279         rm -f conftest.$ac_ext data.o
3280                 cat >conftest.$ac_ext <<EOF
3281 #line 3282 "configure"
3282 int     testfunc()
3283 {
3284 #if defined(NeXT)
3285         exit(1);        /* I'm told this linker is broken */
3286 #else
3287         extern int testdata[3];
3288         return testdata[0] == 123
3289            &&  testdata[1] == 456
3290            &&  testdata[2] == 789;
3291 #endif
3292 }
3293 EOF
3294                 if { (eval echo configure:3295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3295                 mv conftest.o func.o && \
3296                 ( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null
3297         fi
3298         rm -f conftest.$ac_ext func.o
3299         ( eval $ac_cv_prog_RANLIB conftest.a ) 2>&5 >/dev/null
3300         nc_saveLIBS="$LIBS"
3301         LIBS="conftest.a $LIBS"
3302         if test "$cross_compiling" = yes; then
3303   nc_cv_link_dataonly=unknown
3304 else
3305   cat > conftest.$ac_ext <<EOF
3306 #line 3307 "configure"
3307 #include "confdefs.h"
3308
3309         int main()
3310         {
3311                 extern int testfunc();
3312                 exit (!testfunc());
3313         }
3314         
3315 EOF
3316 if { (eval echo configure:3317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3317 then
3318   nc_cv_link_dataonly=yes
3319 else
3320   echo "configure: failed program was:" >&5
3321   cat conftest.$ac_ext >&5
3322   rm -fr conftest*
3323   nc_cv_link_dataonly=no
3324 fi
3325 rm -fr conftest*
3326 fi
3327
3328         LIBS="$nc_saveLIBS"
3329         
3330 fi
3331
3332 echo "$ac_t""$nc_cv_link_dataonly" 1>&6
3333 test $nc_cv_link_dataonly = no && cat >> confdefs.h <<\EOF
3334 #define BROKEN_LINKER 1
3335 EOF
3336
3337
3338
3339 echo $ac_n "checking for speed_t""... $ac_c" 1>&6
3340 echo "configure:3341: checking for speed_t" >&5
3341 if eval "test \"`echo '$''{'nc_cv_type_speed_t'+set}'`\" = set"; then
3342   echo $ac_n "(cached) $ac_c" 1>&6
3343 else
3344   
3345         cat > conftest.$ac_ext <<EOF
3346 #line 3347 "configure"
3347 #include "confdefs.h"
3348
3349 #include <sys/types.h>
3350 #if HAVE_TERMIOS_H
3351 #include <termios.h>
3352 #endif
3353 int main() {
3354 speed_t x = 0
3355 ; return 0; }
3356 EOF
3357 if { (eval echo configure:3358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3358   rm -rf conftest*
3359   nc_cv_type_speed_t=yes
3360 else
3361   echo "configure: failed program was:" >&5
3362   cat conftest.$ac_ext >&5
3363   rm -rf conftest*
3364   nc_cv_type_speed_t=no
3365 fi
3366 rm -f conftest*
3367         
3368 fi
3369
3370 echo "$ac_t""$nc_cv_type_speed_t" 1>&6
3371 test $nc_cv_type_speed_t != yes && cat >> confdefs.h <<\EOF
3372 #define speed_t unsigned
3373 EOF
3374
3375
3376
3377 ###     Checks for library functions.
3378 for ac_func in \
3379 getttynam \
3380 memccpy \
3381 poll \
3382 select \
3383 setbuf \
3384 setbuffer \
3385 setvbuf \
3386 sigaction \
3387 sigvec \
3388 strdup \
3389 tcgetattr \
3390 times \
3391 usleep \
3392 vfscanf \
3393 vsscanf \
3394
3395 do
3396 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3397 echo "configure:3398: checking for $ac_func" >&5
3398 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3399   echo $ac_n "(cached) $ac_c" 1>&6
3400 else
3401   cat > conftest.$ac_ext <<EOF
3402 #line 3403 "configure"
3403 #include "confdefs.h"
3404 /* System header to define __stub macros and hopefully few prototypes,
3405     which can conflict with char $ac_func(); below.  */
3406 #include <assert.h>
3407 /* Override any gcc2 internal prototype to avoid an error.  */
3408 /* We use char because int might match the return type of a gcc2
3409     builtin and then its argument prototype would still apply.  */
3410 char $ac_func();
3411
3412 int main() {
3413
3414 /* The GNU C library defines this for functions which it implements
3415     to always fail with ENOSYS.  Some functions are actually named
3416     something starting with __ and the normal name is an alias.  */
3417 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3418 choke me
3419 #else
3420 $ac_func();
3421 #endif
3422
3423 ; return 0; }
3424 EOF
3425 if { (eval echo configure:3426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3426   rm -rf conftest*
3427   eval "ac_cv_func_$ac_func=yes"
3428 else
3429   echo "configure: failed program was:" >&5
3430   cat conftest.$ac_ext >&5
3431   rm -rf conftest*
3432   eval "ac_cv_func_$ac_func=no"
3433 fi
3434 rm -f conftest*
3435 fi
3436
3437 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3438   echo "$ac_t""yes" 1>&6
3439     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3440   cat >> confdefs.h <<EOF
3441 #define $ac_tr_func 1
3442 EOF
3443  
3444 else
3445   echo "$ac_t""no" 1>&6
3446 fi
3447 done
3448
3449
3450 if test $ac_cv_func_sigaction = yes; then
3451 echo $ac_n "checking whether sigaction needs _POSIX_SOURCE""... $ac_c" 1>&6
3452 echo "configure:3453: checking whether sigaction needs _POSIX_SOURCE" >&5
3453 cat > conftest.$ac_ext <<EOF
3454 #line 3455 "configure"
3455 #include "confdefs.h"
3456 #include <sys/types.h>
3457 #include <signal.h>
3458 int main() {
3459 struct sigaction act;
3460 ; return 0; }
3461 EOF
3462 if { (eval echo configure:3463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3463   rm -rf conftest*
3464   sigact_bad=no
3465 else
3466   echo "configure: failed program was:" >&5
3467   cat conftest.$ac_ext >&5
3468   rm -rf conftest*
3469   sigact_bad=yes cat >> confdefs.h <<\EOF
3470 #define SVR4_ACTION 1
3471 EOF
3472
3473 fi
3474 rm -f conftest*
3475 echo "$ac_t""$sigact_bad" 1>&6
3476 fi
3477
3478 # some machines require _POSIX_SOURCE to completely define struct termios
3479 if test $ac_cv_header_termios_h = yes ; then
3480         case "$CFLAGS" in
3481         *-D_POSIX_SOURCE*)
3482                 termios_bad=dunno ;;
3483         *)      termios_bad=maybe ;;
3484         esac
3485         if test $termios_bad = maybe ; then
3486         echo $ac_n "checking whether termios.h needs _POSIX_SOURCE""... $ac_c" 1>&6
3487 echo "configure:3488: checking whether termios.h needs _POSIX_SOURCE" >&5
3488         cat > conftest.$ac_ext <<EOF
3489 #line 3490 "configure"
3490 #include "confdefs.h"
3491 #include <termios.h>
3492 int main() {
3493 struct termios foo; int x = foo.c_iflag
3494 ; return 0; }
3495 EOF
3496 if { (eval echo configure:3497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3497   rm -rf conftest*
3498   termios_bad=no
3499 else
3500   echo "configure: failed program was:" >&5
3501   cat conftest.$ac_ext >&5
3502   rm -rf conftest*
3503   
3504                 cat > conftest.$ac_ext <<EOF
3505 #line 3506 "configure"
3506 #include "confdefs.h"
3507
3508 #define _POSIX_SOURCE
3509 #include <termios.h>
3510 int main() {
3511 struct termios foo; int x = foo.c_iflag
3512 ; return 0; }
3513 EOF
3514 if { (eval echo configure:3515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3515   rm -rf conftest*
3516   termios_bad=unknown
3517 else
3518   echo "configure: failed program was:" >&5
3519   cat conftest.$ac_ext >&5
3520   rm -rf conftest*
3521   termios_bad=yes cat >> confdefs.h <<\EOF
3522 #define SVR4_TERMIO 1
3523 EOF
3524
3525 fi
3526 rm -f conftest*
3527                         
3528 fi
3529 rm -f conftest*
3530         echo "$ac_t""$termios_bad" 1>&6
3531         fi
3532 fi
3533
3534 if test "$cross_compiling" = yes ; then
3535         echo "configure: warning: cross compiling: assume setvbuf params not reversed" 1>&2
3536 else
3537         echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
3538 echo "configure:3539: checking whether setvbuf arguments are reversed" >&5
3539 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then
3540   echo $ac_n "(cached) $ac_c" 1>&6
3541 else
3542   if test "$cross_compiling" = yes; then
3543     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
3544 else
3545   cat > conftest.$ac_ext <<EOF
3546 #line 3547 "configure"
3547 #include "confdefs.h"
3548 #include <stdio.h>
3549 /* If setvbuf has the reversed format, exit 0. */
3550 main () {
3551   /* This call has the arguments reversed.
3552      A reversed system may check and see that the address of main
3553      is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
3554   if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
3555     exit(1);
3556   putc('\r', stdout);
3557   exit(0);                      /* Non-reversed systems segv here.  */
3558 }
3559 EOF
3560 if { (eval echo configure:3561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3561 then
3562   ac_cv_func_setvbuf_reversed=yes
3563 else
3564   echo "configure: failed program was:" >&5
3565   cat conftest.$ac_ext >&5
3566   rm -fr conftest*
3567   ac_cv_func_setvbuf_reversed=no
3568 fi
3569 rm -fr conftest*
3570 fi
3571
3572 rm -f core core.* *.core
3573 fi
3574
3575 echo "$ac_t""$ac_cv_func_setvbuf_reversed" 1>&6
3576 if test $ac_cv_func_setvbuf_reversed = yes; then
3577   cat >> confdefs.h <<\EOF
3578 #define SETVBUF_REVERSED 1
3579 EOF
3580
3581 fi
3582
3583 fi
3584 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3585 echo "configure:3586: checking return type of signal handlers" >&5
3586 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
3587   echo $ac_n "(cached) $ac_c" 1>&6
3588 else
3589   cat > conftest.$ac_ext <<EOF
3590 #line 3591 "configure"
3591 #include "confdefs.h"
3592 #include <sys/types.h>
3593 #include <signal.h>
3594 #ifdef signal
3595 #undef signal
3596 #endif
3597 #ifdef __cplusplus
3598 extern "C" void (*signal (int, void (*)(int)))(int);
3599 #else
3600 void (*signal ()) ();
3601 #endif
3602
3603 int main() {
3604 int i;
3605 ; return 0; }
3606 EOF
3607 if { (eval echo configure:3608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3608   rm -rf conftest*
3609   ac_cv_type_signal=void
3610 else
3611   echo "configure: failed program was:" >&5
3612   cat conftest.$ac_ext >&5
3613   rm -rf conftest*
3614   ac_cv_type_signal=int
3615 fi
3616 rm -f conftest*
3617 fi
3618
3619 echo "$ac_t""$ac_cv_type_signal" 1>&6
3620 cat >> confdefs.h <<EOF
3621 #define RETSIGTYPE $ac_cv_type_signal
3622 EOF
3623
3624
3625
3626 echo $ac_n "checking for type sigaction_t""... $ac_c" 1>&6
3627 echo "configure:3628: checking for type sigaction_t" >&5
3628 if eval "test \"`echo '$''{'nc_cv_type_sigaction'+set}'`\" = set"; then
3629   echo $ac_n "(cached) $ac_c" 1>&6
3630 else
3631   
3632         cat > conftest.$ac_ext <<EOF
3633 #line 3634 "configure"
3634 #include "confdefs.h"
3635
3636 #include <signal.h>
3637 int main() {
3638 sigaction_t x
3639 ; return 0; }
3640 EOF
3641 if { (eval echo configure:3642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3642   rm -rf conftest*
3643   nc_cv_type_sigaction=yes
3644 else
3645   echo "configure: failed program was:" >&5
3646   cat conftest.$ac_ext >&5
3647   rm -rf conftest*
3648   nc_cv_type_sigaction=no
3649 fi
3650 rm -f conftest*
3651         
3652 fi
3653
3654 echo "$ac_t""$nc_cv_type_sigaction" 1>&6
3655 test $nc_cv_type_sigaction = yes && cat >> confdefs.h <<\EOF
3656 #define HAVE_TYPE_SIGACTION 1
3657 EOF
3658
3659
3660
3661 echo $ac_n "checking for working TIOCGWINSZ""... $ac_c" 1>&6
3662 echo "configure:3663: checking for working TIOCGWINSZ" >&5
3663 if eval "test \"`echo '$''{'nc_cv_use_tiocgwinsz'+set}'`\" = set"; then
3664   echo $ac_n "(cached) $ac_c" 1>&6
3665 else
3666   
3667         if test "$cross_compiling" = yes; then
3668   nc_cv_use_tiocgwinsz=unknown
3669 else
3670   cat > conftest.$ac_ext <<EOF
3671 #line 3672 "configure"
3672 #include "confdefs.h"
3673
3674 #if HAVE_TERMIOS_H
3675 #include <termios.h>
3676 #endif
3677 #if SYSTEM_LOOKS_LIKE_SCO
3678 /* they neglected to define struct winsize in termios.h -- it's only
3679    in termio.h  */
3680 #include        <sys/stream.h>
3681 #include        <sys/ptem.h>
3682 #endif
3683 #if !defined(sun) || !defined(HAVE_TERMIOS_H)
3684 #include <sys/ioctl.h>
3685 #endif
3686 int main()
3687 {
3688         static  struct winsize size;
3689         int fd;
3690         for (fd = 0; fd <= 2; fd++) {   /* try in/out/err in case redirected */
3691                 if (ioctl(0, TIOCGWINSZ, &size) == 0
3692                  && size.ws_row > 0
3693                  && size.ws_col > 0)
3694                         exit(0);
3695         }
3696         exit(0);        /* in either case, it compiles & links ... */
3697 }
3698                 
3699 EOF
3700 if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3701 then
3702   nc_cv_use_tiocgwinsz=yes
3703 else
3704   echo "configure: failed program was:" >&5
3705   cat conftest.$ac_ext >&5
3706   rm -fr conftest*
3707   nc_cv_use_tiocgwinsz=no
3708 fi
3709 rm -fr conftest*
3710 fi
3711
3712         
3713 fi
3714
3715 echo "$ac_t""$nc_cv_use_tiocgwinsz" 1>&6
3716 test $nc_cv_use_tiocgwinsz != yes && cat >> confdefs.h <<\EOF
3717 #define BROKEN_TIOCGWINSZ 1
3718 EOF
3719
3720
3721
3722 case "$nc_cv_systype" in
3723 Linux)
3724         cat >> confdefs.h <<\EOF
3725 #define GOOD_SELECT 1
3726 EOF
3727
3728         ;;
3729 esac
3730
3731 if test -z "$nc_user_CFLAGS" ; then
3732         CFLAGS=`echo ${CFLAGS} | sed -e 's/-g //' -e 's/-g$//'`
3733         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's/-g //' -e 's/-g$//'`
3734 fi
3735
3736 if test -n "$CXX" ; then
3737         # Extract the first word of "$CXX", so it can be a program name with args.
3738 set dummy $CXX; ac_word=$2
3739 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3740 echo "configure:3741: checking for $ac_word" >&5
3741 if eval "test \"`echo '$''{'ac_cv_prog_CXX_EXISTS'+set}'`\" = set"; then
3742   echo $ac_n "(cached) $ac_c" 1>&6
3743 else
3744   if test -n "$CXX_EXISTS"; then
3745   ac_cv_prog_CXX_EXISTS="$CXX_EXISTS" # Let the user override the test.
3746 else
3747   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3748   for ac_dir in $PATH; do
3749     test -z "$ac_dir" && ac_dir=.
3750     if test -f $ac_dir/$ac_word; then
3751       ac_cv_prog_CXX_EXISTS="yes"
3752       break
3753     fi
3754   done
3755   IFS="$ac_save_ifs"
3756   test -z "$ac_cv_prog_CXX_EXISTS" && ac_cv_prog_CXX_EXISTS="no"
3757 fi
3758 fi
3759 CXX_EXISTS="$ac_cv_prog_CXX_EXISTS"
3760 if test -n "$CXX_EXISTS"; then
3761   echo "$ac_t""$CXX_EXISTS" 1>&6
3762 else
3763   echo "$ac_t""no" 1>&6
3764 fi
3765
3766 else
3767         ac_cv_prog_CXX_EXISTS=no
3768 fi
3769 if test "$ac_cv_prog_CXX_EXISTS" = yes; then
3770         ac_ext=C
3771 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3772 ac_cpp='$CXXCPP $CPPFLAGS'
3773 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3774 ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3775 cross_compiling=$ac_cv_prog_cxx_cross
3776
3777         
3778 nc_cxx_library=unknown
3779 if test $ac_cv_prog_gxx = yes; then
3780         echo $ac_n "checking for libg++""... $ac_c" 1>&6
3781 echo "configure:3782: checking for libg++" >&5
3782         nc_save="$LIBS"
3783         LIBS="$LIBS -lg++ -lm"
3784         cat > conftest.$ac_ext <<EOF
3785 #line 3786 "configure"
3786 #include "confdefs.h"
3787
3788 #include <builtin.h>
3789         
3790 int main() {
3791 float foo=abs(1.0)
3792 ; return 0; }
3793 EOF
3794 if { (eval echo configure:3795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3795   rm -rf conftest*
3796   nc_cxx_library=yes
3797          CXXLIBS="$CXXLIBS -lg++ -lm"
3798 else
3799   echo "configure: failed program was:" >&5
3800   cat conftest.$ac_ext >&5
3801   rm -rf conftest*
3802   nc_cxx_library=no
3803 fi
3804 rm -f conftest*
3805         LIBS="$nc_save"
3806         echo "$ac_t""$nc_cxx_library" 1>&6
3807 fi
3808
3809         echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
3810 echo "configure:3811: checking how to run the C++ preprocessor" >&5
3811 if test -z "$CXXCPP"; then
3812 if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
3813   echo $ac_n "(cached) $ac_c" 1>&6
3814 else
3815   ac_ext=C
3816 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3817 ac_cpp='$CXXCPP $CPPFLAGS'
3818 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3819 ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3820 cross_compiling=$ac_cv_prog_cxx_cross
3821   CXXCPP="${CXX-g++} -E"
3822   cat > conftest.$ac_ext <<EOF
3823 #line 3824 "configure"
3824 #include "confdefs.h"
3825 #include <stdlib.h>
3826 EOF
3827 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3828 { (eval echo configure:3829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3829 ac_err=`grep -v '^ *+' conftest.out`
3830 if test -z "$ac_err"; then
3831   :
3832 else
3833   echo "$ac_err" >&5
3834   echo "configure: failed program was:" >&5
3835   cat conftest.$ac_ext >&5
3836   rm -rf conftest*
3837   CXXCPP=/lib/cpp
3838 fi
3839 rm -f conftest*
3840   ac_cv_prog_CXXCPP="$CXXCPP"
3841 fi
3842 fi
3843 CXXCPP="$ac_cv_prog_CXXCPP"
3844 echo "$ac_t""$CXXCPP" 1>&6
3845
3846 for ac_hdr in builtin.h typeinfo
3847 do
3848 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3849 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3850 echo "configure:3851: checking for $ac_hdr" >&5
3851 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3852   echo $ac_n "(cached) $ac_c" 1>&6
3853 else
3854   cat > conftest.$ac_ext <<EOF
3855 #line 3856 "configure"
3856 #include "confdefs.h"
3857 #include <$ac_hdr>
3858 EOF
3859 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3860 { (eval echo configure:3861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3861 ac_err=`grep -v '^ *+' conftest.out`
3862 if test -z "$ac_err"; then
3863   rm -rf conftest*
3864   eval "ac_cv_header_$ac_safe=yes"
3865 else
3866   echo "$ac_err" >&5
3867   echo "configure: failed program was:" >&5
3868   cat conftest.$ac_ext >&5
3869   rm -rf conftest*
3870   eval "ac_cv_header_$ac_safe=no"
3871 fi
3872 rm -f conftest*
3873 fi
3874 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3875   echo "$ac_t""yes" 1>&6
3876     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3877   cat >> confdefs.h <<EOF
3878 #define $ac_tr_hdr 1
3879 EOF
3880  
3881 else
3882   echo "$ac_t""no" 1>&6
3883 fi
3884 done
3885
3886         
3887 echo $ac_n "checking for builtin c++ bool type""... $ac_c" 1>&6
3888 echo "configure:3889: checking for builtin c++ bool type" >&5
3889 if eval "test \"`echo '$''{'nc_cv_builtin_bool'+set}'`\" = set"; then
3890   echo $ac_n "(cached) $ac_c" 1>&6
3891 else
3892   
3893         cat > conftest.$ac_ext <<EOF
3894 #line 3895 "configure"
3895 #include "confdefs.h"
3896
3897 int main() {
3898 bool x = false
3899 ; return 0; }
3900 EOF
3901 if { (eval echo configure:3902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3902   rm -rf conftest*
3903   nc_cv_builtin_bool=1
3904 else
3905   echo "configure: failed program was:" >&5
3906   cat conftest.$ac_ext >&5
3907   rm -rf conftest*
3908   nc_cv_builtin_bool=0
3909 fi
3910 rm -f conftest*
3911         
3912 fi
3913
3914 if test $nc_cv_builtin_bool = 1
3915 then    echo "$ac_t""yes" 1>&6
3916 else    echo "$ac_t""no" 1>&6
3917 fi
3918
3919         
3920 echo $ac_n "checking for size of c++ bool""... $ac_c" 1>&6
3921 echo "configure:3922: checking for size of c++ bool" >&5
3922 if eval "test \"`echo '$''{'nc_cv_type_of_bool'+set}'`\" = set"; then
3923   echo $ac_n "(cached) $ac_c" 1>&6
3924 else
3925   
3926         rm -f nc_test.out
3927         if test "$cross_compiling" = yes; then
3928   nc_cv_type_of_bool=unknown
3929 else
3930   cat > conftest.$ac_ext <<EOF
3931 #line 3932 "configure"
3932 #include "confdefs.h"
3933 #ifdef __cplusplus
3934 extern "C" void exit(int);
3935 #endif
3936
3937 #include <stdlib.h>
3938 #include <stdio.h>
3939 #if HAVE_BUILTIN_H
3940 #include <builtin.h>
3941 #endif
3942 main()
3943 {
3944         FILE *fp = fopen("nc_test.out", "w");
3945         if (fp != 0) {
3946                 bool x = false;
3947                 if (sizeof(x) == sizeof(int))       fputs("int",  fp);
3948                 else if (sizeof(x) == sizeof(char)) fputs("char", fp);
3949                 else if (sizeof(x) == sizeof(short))fputs("short",fp);
3950                 else if (sizeof(x) == sizeof(long)) fputs("long", fp);
3951                 fclose(fp);
3952         }
3953         exit(0);
3954 }
3955                 
3956 EOF
3957 if { (eval echo configure:3958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3958 then
3959   nc_cv_type_of_bool=`cat nc_test.out`
3960 else
3961   echo "configure: failed program was:" >&5
3962   cat conftest.$ac_ext >&5
3963   rm -fr conftest*
3964   nc_cv_type_of_bool=unknown
3965 fi
3966 rm -fr conftest*
3967 fi
3968
3969         
3970 fi
3971
3972         rm -f nc_test.out
3973 echo "$ac_t""$nc_cv_type_of_bool" 1>&6
3974 if test $nc_cv_type_of_bool = unknown ; then
3975         echo "configure: warning: Assuming unsigned for type of bool" 1>&2
3976         nc_cv_type_of_bool=unsigned
3977 fi
3978
3979 else
3980         nc_cxx_library=no
3981         if eval "test \"`echo '$''{'nc_cv_builtin_bool'+set}'`\" = set"; then
3982   echo $ac_n "(cached) $ac_c" 1>&6
3983 else
3984   nc_cv_builtin_bool=0
3985 fi
3986
3987         if eval "test \"`echo '$''{'nc_cv_sizeof_bool'+set}'`\" = set"; then
3988   echo $ac_n "(cached) $ac_c" 1>&6
3989 else
3990   nc_cv_sizeof_bool=int
3991 fi
3992
3993 fi
3994
3995
3996 nc_ada_make=gnatmake
3997 # Extract the first word of "$nc_ada_make", so it can be a program name with args.
3998 set dummy $nc_ada_make; ac_word=$2
3999 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4000 echo "configure:4001: checking for $ac_word" >&5
4001 if eval "test \"`echo '$''{'ac_cv_prog_gnat_exists'+set}'`\" = set"; then
4002   echo $ac_n "(cached) $ac_c" 1>&6
4003 else
4004   if test -n "$gnat_exists"; then
4005   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
4006 else
4007   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4008   for ac_dir in $PATH; do
4009     test -z "$ac_dir" && ac_dir=.
4010     if test -f $ac_dir/$ac_word; then
4011       ac_cv_prog_gnat_exists="yes"
4012       break
4013     fi
4014   done
4015   IFS="$ac_save_ifs"
4016   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
4017 fi
4018 fi
4019 gnat_exists="$ac_cv_prog_gnat_exists"
4020 if test -n "$gnat_exists"; then
4021   echo "$ac_t""$gnat_exists" 1>&6
4022 else
4023   echo "$ac_t""no" 1>&6
4024 fi
4025
4026 if test "$ac_cv_prog_gnat_exists" = no; then
4027    nc_ada_make=
4028 else
4029    
4030 nc_cv_gnat_version=`$nc_ada_make -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\
4031   sed -e 's/[^0-9 \.]//g' | $AWK '{print $1;}'`
4032 case $nc_cv_gnat_version in
4033   3.0[5-9]|3.[1-9]*|[4-9].*)
4034     ac_cv_prog_gnat_correct=yes
4035     ;;
4036   *) echo Unsupported GNAT version $nc_cv_gnat_version. Disabling Ada95 binding.
4037      ac_cv_prog_gnat_correct=no
4038      ;;
4039 esac
4040
4041    # Extract the first word of "m4", so it can be a program name with args.
4042 set dummy m4; ac_word=$2
4043 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4044 echo "configure:4045: checking for $ac_word" >&5
4045 if eval "test \"`echo '$''{'ac_cv_prog_m4_exists'+set}'`\" = set"; then
4046   echo $ac_n "(cached) $ac_c" 1>&6
4047 else
4048   if test -n "$m4_exists"; then
4049   ac_cv_prog_m4_exists="$m4_exists" # Let the user override the test.
4050 else
4051   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4052   for ac_dir in $PATH; do
4053     test -z "$ac_dir" && ac_dir=.
4054     if test -f $ac_dir/$ac_word; then
4055       ac_cv_prog_m4_exists="yes"
4056       break
4057     fi
4058   done
4059   IFS="$ac_save_ifs"
4060   test -z "$ac_cv_prog_m4_exists" && ac_cv_prog_m4_exists="no"
4061 fi
4062 fi
4063 m4_exists="$ac_cv_prog_m4_exists"
4064 if test -n "$m4_exists"; then
4065   echo "$ac_t""$m4_exists" 1>&6
4066 else
4067   echo "$ac_t""no" 1>&6
4068 fi
4069
4070    if test "$ac_cv_prog_m4_exists" = no; then
4071       ac_cv_prog_gnat_correct=no
4072       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
4073    fi
4074 fi
4075 if test "$ac_cv_prog_gnat_correct" = yes; then
4076    nc_ada_compiler=gcc
4077    nc_ada_package=terminal_interface
4078    
4079    
4080    
4081    
4082 fi
4083
4084 ### It's not possible to appease gcc 2.6.3's conversion-warnings if we're
4085 ### using a 'char' for bools.  gcc 2.7.0's conversion-warnings are broken too
4086 ### badly to consider using for development purposes, but 2.5.8 is okay.
4087 if test -n "$with_warnings"; then
4088         if test -n "$GCC"; then
4089                 case "`$CC --version`" in
4090                 2.6.3)
4091                         if test "$nc_cv_sizeof_bool" != "char"; then
4092                                 nc_warn_CFLAGS="$nc_warn_CFLAGS -Wconversion"
4093                         fi
4094                         ;;
4095                 2.5*)
4096                         nc_warn_CFLAGS="$nc_warn_CFLAGS -Wconversion"
4097                         ;;
4098                 esac
4099         fi
4100 fi
4101
4102 ### Construct the list of include-directories to be generated
4103
4104 CPPFLAGS="$CPPFLAGS -I. -I../include"
4105 if test "$srcdir" != "."; then
4106         CPPFLAGS="$CPPFLAGS -I\$(srcdir)/../include"
4107 fi
4108 if test -z "$GCC"; then
4109         CPPFLAGS="$CPPFLAGS -I\$(includedir)"
4110 elif test "$includedir" != "/usr/include"; then
4111         if test "$includedir" = '${prefix}/include' ; then
4112                 if test $prefix != /usr ; then
4113                         CPPFLAGS="$CPPFLAGS -I\$(includedir)"
4114                 fi
4115         else
4116                 CPPFLAGS="$CPPFLAGS -I\$(includedir)"
4117         fi
4118 fi
4119
4120
4121
4122 ACPPFLAGS="$ACPPFLAGS -I. -I../../include"
4123 if test "$srcdir" != "."; then
4124         ACPPFLAGS="$ACPPFLAGS -I\$(srcdir)/../../include"
4125 fi
4126 if test -z "$GCC"; then
4127         ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
4128 elif test "$includedir" != "/usr/include"; then
4129         if test "$includedir" = '${prefix}/include' ; then
4130                 if test $prefix != /usr ; then
4131                         ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
4132                 fi
4133         else
4134                 ACPPFLAGS="$ACPPFLAGS -I\$(includedir)"
4135         fi
4136 fi
4137
4138
4139
4140 ### Construct the list of subdirectories for which we'll customize makefiles
4141 ### with the appropriate compile-rules.
4142
4143 echo $ac_n "checking for src modules""... $ac_c" 1>&6
4144 echo "configure:4145: checking for src modules" >&5
4145 TEST_DEPS="${LIB_PREFIX}${LIB_NAME}${DFT_DEP_SUFFIX}"
4146 TEST_ARGS="-l${LIB_NAME}${DFT_ARG_SUFFIX}"
4147 nc_cv_src_modules=
4148 for nc_dir in ncurses progs panel menu form
4149 do
4150         if test -f $srcdir/$nc_dir/modules; then
4151                 if test -z "$nc_cv_src_modules"; then
4152                         nc_cv_src_modules=$nc_dir
4153                 else
4154                         nc_cv_src_modules="$nc_cv_src_modules $nc_dir"
4155                 fi
4156                 # Make the ncurses_cfg.h file record the library interface files as
4157                 # well.  These are header files that are the same name as their
4158                 # directory.  Ncurses is the only library that does not follow
4159                 # that pattern.
4160                 if test -f $srcdir/${nc_dir}/${nc_dir}.h; then
4161                         
4162 nc_have_include=`echo $nc_dir |tr '[a-z]' '[A-Z]'`
4163
4164                         cat >> confdefs.h <<EOF
4165 #define HAVE_${nc_have_include}_H 1
4166 EOF
4167
4168                         cat >> confdefs.h <<EOF
4169 #define HAVE_LIB${nc_have_include} 1
4170 EOF
4171
4172                         TEST_DEPS="${LIB_PREFIX}${nc_dir}${DFT_DEP_SUFFIX} $TEST_DEPS"
4173                         TEST_ARGS="-l${nc_dir}${DFT_ARG_SUFFIX} $TEST_ARGS"
4174                 fi
4175         fi
4176 done
4177 echo "$ac_t""$nc_cv_src_modules" 1>&6
4178 TEST_ARGS="-L${LIB_DIR} $TEST_ARGS"
4179
4180
4181
4182 SRC_SUBDIRS="man include"
4183 for nc_dir in $nc_cv_src_modules
4184 do
4185         SRC_SUBDIRS="$SRC_SUBDIRS $nc_dir"
4186 done
4187 SRC_SUBDIRS="$SRC_SUBDIRS misc test"
4188 test $nc_cxx_library != no && SRC_SUBDIRS="$SRC_SUBDIRS c++"
4189
4190 ADA_SUBDIRS=
4191 if test "$ac_cv_prog_gnat_correct" = yes && test -d $srcdir/Ada95; then
4192    SRC_SUBDIRS="$SRC_SUBDIRS Ada95"
4193    ADA_SUBDIRS="gen ada_include samples"
4194 fi
4195
4196 SUB_MAKEFILES=
4197 for nc_dir in $SRC_SUBDIRS
4198 do
4199         SUB_MAKEFILES="$SUB_MAKEFILES $nc_dir/Makefile"
4200 done
4201
4202 if test -n "$ADA_SUBDIRS"; then
4203    for nc_dir in $ADA_SUBDIRS
4204    do   
4205       SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$nc_dir/Makefile"
4206    done
4207    
4208 fi
4209
4210
4211 DIRS_TO_MAKE="lib"
4212 for nc_item in $nc_list_models
4213 do
4214         
4215         case $nc_item in
4216         normal)  nc_subdir='objects' ;;
4217         debug)   nc_subdir='obj_g' ;;
4218         profile) nc_subdir='obj_p' ;;
4219         shared)  nc_subdir='obj_s' ;;
4220         esac
4221
4222         DIRS_TO_MAKE="$DIRS_TO_MAKE $nc_subdir"
4223 done
4224 for nc_dir in $DIRS_TO_MAKE
4225 do
4226         test ! -d $nc_dir && mkdir $nc_dir
4227 done
4228
4229
4230
4231 ### Now that we're done running tests, add the compiler-warnings, if any
4232 CFLAGS="$CFLAGS $nc_warn_CFLAGS"
4233
4234 ################################################################################
4235 trap '' 1 2 15
4236 cat > confcache <<\EOF
4237 # This file is a shell script that caches the results of configure
4238 # tests run on this system so they can be shared between configure
4239 # scripts and configure runs.  It is not useful on other systems.
4240 # If it contains results you don't want to keep, you may remove or edit it.
4241 #
4242 # By default, configure uses ./config.cache as the cache file,
4243 # creating it if it does not exist already.  You can give configure
4244 # the --cache-file=FILE option to use a different cache file; that is
4245 # what configure does when it calls configure scripts in
4246 # subdirectories, so they share the cache.
4247 # Giving --cache-file=/dev/null disables caching, for debugging configure.
4248 # config.status only pays attention to the cache file if you give it the
4249 # --recheck option to rerun configure.
4250 #
4251 EOF
4252 # The following way of writing the cache mishandles newlines in values,
4253 # but we know of no workaround that is simple, portable, and efficient.
4254 # So, don't put newlines in cache variables' values.
4255 # Ultrix sh set writes to stderr and can't be redirected directly,
4256 # and sets the high bit in the cache file unless we assign to the vars.
4257 (set) 2>&1 |
4258   case `(ac_space=' '; set) 2>&1 | grep '^ac_space='` in
4259   *ac_space=\ *)
4260     # `set' does not quote correctly, so add quotes (double-quote substitution
4261     # turns \\\\ into \\, and sed turns \\ into \).
4262     sed -n \
4263       -e "s/'/'\\\\''/g" \
4264       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
4265     ;;
4266   *)
4267     # `set' quotes correctly as required by POSIX, so do not add quotes.
4268     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
4269     ;;
4270   esac >> confcache
4271 if cmp -s $cache_file confcache; then
4272   :
4273 else
4274   if test -w $cache_file; then
4275     echo "updating cache $cache_file"
4276     cat confcache > $cache_file
4277   else
4278     echo "not updating unwritable cache $cache_file"
4279   fi
4280 fi
4281 rm -f confcache
4282
4283 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
4284
4285 test "x$prefix" = xNONE && prefix=$ac_default_prefix
4286 # Let make expand exec_prefix.
4287 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
4288
4289 # Any assignment to VPATH causes Sun make to only execute
4290 # the first set of double-colon rules, so remove it if not needed.
4291 # If there is a colon in the path, we need to keep it.
4292 if test "x$srcdir" = x.; then
4293   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
4294 fi
4295
4296 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
4297
4298 # Transform confdefs.h into DEFS.
4299 # Protect against shell expansion while executing Makefile rules.
4300 # Protect against Makefile macro expansion.
4301 cat > conftest.defs <<\EOF
4302 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
4303 s%[     `~#$^&*(){}\\|;'"<>?]%\\&%g
4304 s%\[%\\&%g
4305 s%\]%\\&%g
4306 s%\$%$$%g
4307 EOF
4308 DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
4309 rm -f conftest.defs
4310
4311
4312 # Without the "./", some shells look in PATH for config.status.
4313 : ${CONFIG_STATUS=./config.status}
4314
4315 echo creating $CONFIG_STATUS
4316 rm -f $CONFIG_STATUS
4317 cat > $CONFIG_STATUS <<EOF
4318 #! /bin/sh
4319 # Generated automatically by configure.
4320 # Run this file to recreate the current configuration.
4321 # This directory was configured as follows,
4322 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4323 #
4324 # $0 $ac_configure_args
4325 #
4326 # Compiler output produced by configure, useful for debugging
4327 # configure, is in ./config.log if it exists.
4328
4329 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
4330 for ac_option
4331 do
4332   case "\$ac_option" in
4333   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
4334     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
4335     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
4336   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
4337     echo "$CONFIG_STATUS generated by autoconf version 2.12.970309"
4338     exit 0 ;;
4339   -help | --help | --hel | --he | --h)
4340     echo "\$ac_cs_usage"; exit 0 ;;
4341   *) echo "\$ac_cs_usage"; exit 1 ;;
4342   esac
4343 done
4344
4345 ac_given_srcdir=$srcdir
4346 ac_given_INSTALL="$INSTALL"
4347
4348 trap 'rm -fr `echo "include/config_h \
4349         include/MKterm.h.awk \
4350         include/curses.h \
4351         include/termcap.h \
4352         include/unctrl.h \
4353         $SUB_MAKEFILES \
4354         Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
4355 EOF
4356 cat >> $CONFIG_STATUS <<EOF
4357
4358 # Protect against being on the right side of a sed subst in config.status.
4359 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
4360  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
4361 $ac_vpsub
4362 $extrasub
4363 s%@CFLAGS@%$CFLAGS%g
4364 s%@CPPFLAGS@%$CPPFLAGS%g
4365 s%@CXXFLAGS@%$CXXFLAGS%g
4366 s%@DEFS@%$DEFS%g
4367 s%@LDFLAGS@%$LDFLAGS%g
4368 s%@LIBS@%$LIBS%g
4369 s%@exec_prefix@%$exec_prefix%g
4370 s%@prefix@%$prefix%g
4371 s%@program_transform_name@%$program_transform_name%g
4372 s%@bindir@%$bindir%g
4373 s%@sbindir@%$sbindir%g
4374 s%@libexecdir@%$libexecdir%g
4375 s%@datadir@%$datadir%g
4376 s%@sysconfdir@%$sysconfdir%g
4377 s%@sharedstatedir@%$sharedstatedir%g
4378 s%@localstatedir@%$localstatedir%g
4379 s%@libdir@%$libdir%g
4380 s%@includedir@%$includedir%g
4381 s%@oldincludedir@%$oldincludedir%g
4382 s%@infodir@%$infodir%g
4383 s%@mandir@%$mandir%g
4384 s%@NCURSES_MAJOR@%$NCURSES_MAJOR%g
4385 s%@NCURSES_MINOR@%$NCURSES_MINOR%g
4386 s%@NCURSES_PATCH@%$NCURSES_PATCH%g
4387 s%@nc_cv_rel_version@%$nc_cv_rel_version%g
4388 s%@nc_cv_abi_version@%$nc_cv_abi_version%g
4389 s%@nc_cv_builtin_bool@%$nc_cv_builtin_bool%g
4390 s%@nc_cv_type_of_bool@%$nc_cv_type_of_bool%g
4391 s%@CC@%$CC%g
4392 s%@CPP@%$CPP%g
4393 s%@CXX@%$CXX%g
4394 s%@AWK@%$AWK%g
4395 s%@SET_MAKE@%$SET_MAKE%g
4396 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
4397 s%@INSTALL_DATA@%$INSTALL_DATA%g
4398 s%@LN_S@%$LN_S%g
4399 s%@RANLIB@%$RANLIB%g
4400 s%@LINT@%$LINT%g
4401 s%@MAN@%$MAN%g
4402 s%@LINT_OPTS@%$LINT_OPTS%g
4403 s%@LD@%$LD%g
4404 s%@AR@%$AR%g
4405 s%@AR_OPTS@%$AR_OPTS%g
4406 s%@nc_cv_makeflags@%$nc_cv_makeflags%g
4407 s%@INSTALL_PREFIX@%$INSTALL_PREFIX%g
4408 s%@EXTRA_LIBS@%$EXTRA_LIBS%g
4409 s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
4410 s%@DFT_LWR_MODEL@%$DFT_LWR_MODEL%g
4411 s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
4412 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
4413 s%@DFT_ARG_SUFFIX@%$DFT_ARG_SUFFIX%g
4414 s%@nc_list_models@%$nc_list_models%g
4415 s%@LIB_NAME@%$LIB_NAME%g
4416 s%@LIB_PREFIX@%$LIB_PREFIX%g
4417 s%@CC_G_OPT@%$CC_G_OPT%g
4418 s%@CXX_G_OPT@%$CXX_G_OPT%g
4419 s%@LD_MODEL@%$LD_MODEL%g
4420 s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
4421 s%@MK_SHARED_LIB@%$MK_SHARED_LIB%g
4422 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
4423 s%@LOCAL_LDFLAGS2@%$LOCAL_LDFLAGS2%g
4424 s%@ECHO_LINK@%$ECHO_LINK%g
4425 s%@COULD_BE_SCO@%$COULD_BE_SCO%g
4426 s%@CXX_EXISTS@%$CXX_EXISTS%g
4427 s%@CXXCPP@%$CXXCPP%g
4428 s%@CXXLIBS@%$CXXLIBS%g
4429 s%@gnat_exists@%$gnat_exists%g
4430 s%@m4_exists@%$m4_exists%g
4431 s%@nc_ada_make@%$nc_ada_make%g
4432 s%@nc_ada_compiler@%$nc_ada_compiler%g
4433 s%@nc_ada_package@%$nc_ada_package%g
4434 s%@ADAFLAGS@%$ADAFLAGS%g
4435 s%@ACPPFLAGS@%$ACPPFLAGS%g
4436 s%@TEST_DEPS@%$TEST_DEPS%g
4437 s%@TEST_ARGS@%$TEST_ARGS%g
4438 s%@ADA_SUBDIRS@%$ADA_SUBDIRS%g
4439 s%@DIRS_TO_MAKE@%$DIRS_TO_MAKE%g
4440
4441 CEOF
4442 EOF
4443
4444 cat >> $CONFIG_STATUS <<\EOF
4445
4446 # Split the substitutions into bite-sized pieces for seds with
4447 # small command number limits, like on Digital OSF/1 and HP-UX.
4448 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
4449 ac_file=1 # Number of current file.
4450 ac_beg=1 # First line for current file.
4451 ac_end=$ac_max_sed_cmds # Line after last line for current file.
4452 ac_more_lines=:
4453 ac_sed_cmds=""
4454 while $ac_more_lines; do
4455   if test $ac_beg -gt 1; then
4456     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
4457   else
4458     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
4459   fi
4460   if test ! -s conftest.s$ac_file; then
4461     ac_more_lines=false
4462     rm -f conftest.s$ac_file
4463   else
4464     if test -z "$ac_sed_cmds"; then
4465       ac_sed_cmds="sed -f conftest.s$ac_file"
4466     else
4467       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
4468     fi
4469     ac_file=`expr $ac_file + 1`
4470     ac_beg=$ac_end
4471     ac_end=`expr $ac_end + $ac_max_sed_cmds`
4472   fi
4473 done
4474 if test -z "$ac_sed_cmds"; then
4475   ac_sed_cmds=cat
4476 fi
4477 EOF
4478
4479 cat >> $CONFIG_STATUS <<EOF
4480
4481 CONFIG_FILES=\${CONFIG_FILES-"include/config_h \
4482         include/MKterm.h.awk \
4483         include/curses.h \
4484         include/termcap.h \
4485         include/unctrl.h \
4486         $SUB_MAKEFILES \
4487         Makefile"}
4488 EOF
4489 cat >> $CONFIG_STATUS <<\EOF
4490 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
4491   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
4492   case "$ac_file" in
4493   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
4494        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
4495   *) ac_file_in="${ac_file}.in" ;;
4496   esac
4497
4498   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
4499
4500   # Remove last slash and all that follows it.  Not all systems have dirname.
4501   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
4502   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
4503     # The file is in a subdirectory.
4504     test ! -d "$ac_dir" && mkdir "$ac_dir"
4505     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
4506     # A "../" for each directory in $ac_dir_suffix.
4507     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
4508   else
4509     ac_dir_suffix= ac_dots=
4510   fi
4511
4512   case "$ac_given_srcdir" in
4513   .)  srcdir=.
4514       if test -z "$ac_dots"; then top_srcdir=.
4515       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
4516   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
4517   *) # Relative path.
4518     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
4519     top_srcdir="$ac_dots$ac_given_srcdir" ;;
4520   esac
4521
4522   case "$ac_given_INSTALL" in
4523   [/$]*) INSTALL="$ac_given_INSTALL" ;;
4524   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
4525   esac
4526
4527   echo creating "$ac_file"
4528   rm -f "$ac_file"
4529   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
4530   case "$ac_file" in
4531   *Makefile*) ac_comsub="1i\\
4532 # $configure_input" ;;
4533   *) ac_comsub= ;;
4534   esac
4535
4536   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
4537   sed -e "$ac_comsub
4538 s%@configure_input@%$configure_input%g
4539 s%@srcdir@%$srcdir%g
4540 s%@top_srcdir@%$top_srcdir%g
4541 s%@INSTALL@%$INSTALL%g
4542 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
4543 fi; done
4544 rm -f conftest.s*
4545
4546 EOF
4547 cat >> $CONFIG_STATUS <<EOF
4548
4549 ### Special initialization commands, used to pass information from the
4550 ### configuration-run into config.status
4551
4552 SYS_NAME="`(uname -a || hostname) 2>/dev/null | sed 1q`"
4553 if test -z "\$SYS_NAME"; then SYS_NAME=unknown;fi
4554
4555 AWK=$AWK
4556 DFT_LWR_MODEL="$DFT_LWR_MODEL"
4557 NC_LIST_MODELS="$nc_list_models"
4558 WITH_ECHO="$with_echo"
4559 WITH_OVERWRITE="$with_overwrite"
4560 SRC_SUBDIRS="$SRC_SUBDIRS"
4561 nc_cxx_library="$nc_cxx_library"
4562 nc_cv_systype="$nc_cv_systype"
4563 nc_cv_rel_version="$nc_cv_rel_version"
4564 nc_cv_abi_version="$nc_cv_abi_version"
4565 nc_cv_do_symlinks="$nc_cv_do_symlinks"
4566 nc_cv_rm_so_locs="$nc_cv_rm_so_locs"
4567
4568
4569 EOF
4570 cat >> $CONFIG_STATUS <<\EOF
4571
4572
4573
4574
4575
4576 for nc_dir in $SRC_SUBDIRS
4577 do
4578         if test -f $srcdir/$nc_dir/modules; then
4579
4580                 nc_libs_to_make=
4581                 for nc_item in $NC_LIST_MODELS
4582                 do
4583                         
4584         
4585         
4586         case $nc_item in
4587         normal)  nc_suffix='.a'   ;;
4588         debug)   nc_suffix='_g.a' ;;
4589         profile) nc_suffix='_p.a' ;;
4590         shared)
4591                 case $nc_cv_systype in
4592                 NetBSD|FreeBSD)
4593                         nc_suffix='.so.$(ABI_VERSION)' ;;
4594                 HP_UX)  nc_suffix='.sl'  ;;
4595                 *)      nc_suffix='.so'  ;;
4596                 esac
4597         esac
4598
4599                         nc_libs_to_make="$nc_libs_to_make ../lib/lib${nc_dir}${nc_suffix}"
4600                 done
4601
4602                 sed -e "s@\@LIBS_TO_MAKE\@@$nc_libs_to_make@" \
4603                         $nc_dir/Makefile >$nc_dir/Makefile.out
4604                 mv $nc_dir/Makefile.out $nc_dir/Makefile
4605
4606                 $AWK -f $srcdir/mk-0th.awk \
4607                         name=$nc_dir \
4608                         $srcdir/$nc_dir/modules >>$nc_dir/Makefile
4609
4610                 for nc_item in $NC_LIST_MODELS
4611                 do
4612                         echo 'Appending rules for '$nc_item' model ('$nc_dir')'
4613                         
4614 NC_ITEM=`echo $nc_item |tr '[a-z]' '[A-Z]'`
4615
4616                         
4617         
4618         
4619         case $nc_item in
4620         normal)  nc_suffix='.a'   ;;
4621         debug)   nc_suffix='_g.a' ;;
4622         profile) nc_suffix='_p.a' ;;
4623         shared)
4624                 case $nc_cv_systype in
4625                 NetBSD|FreeBSD)
4626                         nc_suffix='.so.$(ABI_VERSION)' ;;
4627                 HP_UX)  nc_suffix='.sl'  ;;
4628                 *)      nc_suffix='.so'  ;;
4629                 esac
4630         esac
4631
4632                         
4633         case $nc_item in
4634         normal)  nc_subdir='objects' ;;
4635         debug)   nc_subdir='obj_g' ;;
4636         profile) nc_subdir='obj_p' ;;
4637         shared)  nc_subdir='obj_s' ;;
4638         esac
4639
4640
4641                         # These dependencies really are for development, not
4642                         # builds, but they are useful in porting, too.
4643                         nc_depend="../include/ncurses_cfg.h"
4644                         if test "$srcdir" = "."; then
4645                                 nc_reldir="."
4646                         else
4647                                 nc_reldir="\$(srcdir)"
4648                         fi
4649                         if test -f $srcdir/$nc_dir/$nc_dir.priv.h; then
4650                                 nc_depend="$nc_depend $nc_reldir/$nc_dir.priv.h"
4651                         elif test -f $srcdir/$nc_dir/curses.priv.h; then
4652                                 nc_depend="$nc_depend $nc_reldir/curses.priv.h"
4653                         fi
4654                         $AWK -f $srcdir/mk-1st.awk \
4655                                 name=$nc_dir \
4656                                 MODEL=$NC_ITEM \
4657                                 model=$nc_subdir \
4658                                 suffix=$nc_suffix \
4659                                 DoLinks=$nc_cv_do_symlinks \
4660                                 rmSoLocs=$nc_cv_rm_so_locs \
4661                                 overwrite=$WITH_OVERWRITE \
4662                                 depend="$nc_depend" \
4663                                 $srcdir/$nc_dir/modules >>$nc_dir/Makefile
4664                         test $nc_dir = ncurses && WITH_OVERWRITE=no
4665                         $AWK -f $srcdir/mk-2nd.awk \
4666                                 name=$nc_dir \
4667                                 MODEL=$NC_ITEM \
4668                                 model=$nc_subdir \
4669                                 srcdir=$srcdir \
4670                                 echo=$WITH_ECHO \
4671                                 $srcdir/$nc_dir/modules >>$nc_dir/Makefile
4672                 done
4673         fi
4674
4675         echo '  cd '$nc_dir'; $(MAKE) $(NC_MFLAGS) $@' >>Makefile
4676 done
4677
4678 for nc_dir in $SRC_SUBDIRS
4679 do
4680         if test -f $srcdir/$nc_dir/modules; then
4681                 echo >> Makefile
4682                 if test -f $srcdir/$nc_dir/headers; then
4683 cat >> Makefile <<NC_EOF
4684 install.includes \\
4685 NC_EOF
4686                 fi
4687 if test "$nc_dir" != "c++" ; then
4688 echo 'lint \' >> Makefile
4689 fi
4690 cat >> Makefile <<NC_EOF
4691 lintlib \\
4692 install.libs \\
4693 install.$nc_dir ::
4694         cd $nc_dir; \$(MAKE) \$(NC_MFLAGS) \$@
4695 NC_EOF
4696         elif test -f $srcdir/$nc_dir/headers; then
4697 cat >> Makefile <<NC_EOF
4698
4699 install.libs \\
4700 install.includes ::
4701         cd $nc_dir; \$(MAKE) \$(NC_MFLAGS) \$@
4702 NC_EOF
4703 fi
4704 done
4705
4706 cat >> Makefile <<NC_EOF
4707
4708 install.data ::
4709         cd misc; \$(MAKE) \$(NC_MFLAGS) \$@
4710
4711 install.man ::
4712         cd man; \$(MAKE) \$(NC_MFLAGS) \$@
4713
4714 distclean ::
4715         rm -f config.cache config.log config.status Makefile include/ncurses_cfg.h
4716         rm -f headers.sh headers.sed
4717         rm -rf \$(DIRS_TO_MAKE)
4718 NC_EOF
4719
4720
4721 rm -f headers.sed headers.sh
4722
4723 echo creating headers.sh
4724 cat >headers.sh <<NC_EOF
4725 #!/bin/sh
4726 # This shell script is generated by the 'configure' script.  It is invoked in a
4727 # subdirectory of the build tree.  It generates a sed-script in the parent
4728 # directory that is used to adjust includes for header files that reside in a
4729 # subdirectory of /usr/include, etc.
4730 PRG=""
4731 while test \$# != 3
4732 do
4733 PRG="\$PRG \$1"; shift
4734 done
4735 DST=\$1
4736 REF=\$2
4737 SRC=\$3
4738 echo installing \$SRC in \$DST
4739 case \$DST in
4740 /*/include/*)
4741         TMP=\${TMPDIR-/tmp}/\`basename \$SRC\`
4742         if test ! -f ../headers.sed ; then
4743                 END=\`basename \$DST\`
4744                 for i in \`cat \$REF/../*/headers |fgrep -v "#"\`
4745                 do
4746                         NAME=\`basename \$i\`
4747                         echo "s/<\$NAME>/<\$END\/\$NAME>/" >> ../headers.sed
4748                 done
4749         fi
4750         rm -f \$TMP
4751         sed -f ../headers.sed \$SRC > \$TMP
4752         eval \$PRG \$TMP \$DST
4753         rm -f \$TMP
4754         ;;
4755 *)
4756         eval \$PRG \$SRC \$DST
4757         ;;
4758 esac
4759 NC_EOF
4760
4761 chmod 0755 headers.sh
4762
4763 for nc_dir in $SRC_SUBDIRS
4764 do
4765         if test -f $srcdir/$nc_dir/headers; then
4766         cat >>$nc_dir/Makefile <<NC_EOF
4767 \$(INSTALL_PREFIX)\$(includedir) :
4768         \$(srcdir)/../mkinstalldirs \$@
4769
4770 install \\
4771 install.libs \\
4772 install.includes :: \$(INSTALL_PREFIX)\$(includedir) \\
4773 NC_EOF
4774                 j=""
4775                 for i in `cat $srcdir/$nc_dir/headers |fgrep -v "#"`
4776                 do
4777                         test -n "$j" && echo "          $j \\" >>$nc_dir/Makefile
4778                         j=$i
4779                 done
4780                 echo "          $j" >>$nc_dir/Makefile
4781                 for i in `cat $srcdir/$nc_dir/headers |fgrep -v "#"`
4782                 do
4783                         echo "  @ ../headers.sh \$(INSTALL_DATA) \$(INSTALL_PREFIX)\$(includedir) \$(srcdir) $i" >>$nc_dir/Makefile
4784                 done
4785         fi
4786 done
4787
4788
4789
4790 ### Special editing.  We generate ncurses_cfg.h directly to allow all filenames
4791 ### to be MSDOS-compatible, as well as to make the list of definitions be
4792 ### dynamically determined by the configuration script -- a consideration when
4793 ### doing type-clean development testing.
4794
4795 echo creating include/ncurses_cfg.h
4796 rm -f include/ncurses_cfg.h
4797 echo "/* generated by configure-script
4798  * On host: $SYS_NAME
4799  */
4800 #ifndef NC_CONFIG_H
4801 #define NC_CONFIG_H" >include/ncurses_cfg.h
4802 sed     -e '/^ -D/!d' \
4803         -e 's/ -D/\
4804 #define /g' \
4805         -e 's/\(#define [A-Za-z_][A-Za-z0-9_]*\)=/\1    /g' \
4806         -e 's/\\//g' \
4807         include/config_h | sort >>include/ncurses_cfg.h
4808 echo "
4809         /* The C compiler may not treat these properly, but C++ has to */
4810 #ifdef __cplusplus
4811 #undef const
4812 #undef inline
4813 #else
4814 #if defined(lint) || defined(TRACE)
4815 #undef inline
4816 #define inline /* nothing */
4817 #endif
4818 #endif
4819
4820 #endif /* NC_CONFIG_H */" >> include/ncurses_cfg.h
4821 echo removing include/config_h
4822 rm include/config_h
4823
4824 exit 0
4825 EOF
4826 chmod +x $CONFIG_STATUS
4827 rm -fr confdefs* $ac_clean_files
4828 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
4829 make preinstall