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