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