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