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