]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.7 - patch 20100522
[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   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
198 EOF
199     exit 0 ;;
200
201   -host | --host | --hos | --ho)
202     ac_prev=host ;;
203   -host=* | --host=* | --hos=* | --ho=*)
204     host="$ac_optarg" ;;
205
206   -includedir | --includedir | --includedi | --included | --include \
207   | --includ | --inclu | --incl | --inc)
208     ac_prev=includedir ;;
209   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
210   | --includ=* | --inclu=* | --incl=* | --inc=*)
211     includedir="$ac_optarg" ;;
212
213   -infodir | --infodir | --infodi | --infod | --info | --inf)
214     ac_prev=infodir ;;
215   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
216     infodir="$ac_optarg" ;;
217
218   -libdir | --libdir | --libdi | --libd)
219     ac_prev=libdir ;;
220   -libdir=* | --libdir=* | --libdi=* | --libd=*)
221     libdir="$ac_optarg" ;;
222
223   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
224   | --libexe | --libex | --libe)
225     ac_prev=libexecdir ;;
226   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
227   | --libexe=* | --libex=* | --libe=*)
228     libexecdir="$ac_optarg" ;;
229
230   -localstatedir | --localstatedir | --localstatedi | --localstated \
231   | --localstate | --localstat | --localsta | --localst \
232   | --locals | --local | --loca | --loc | --lo)
233     ac_prev=localstatedir ;;
234   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
235   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
236   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
237     localstatedir="$ac_optarg" ;;
238
239   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
240     ac_prev=mandir ;;
241   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
242     mandir="$ac_optarg" ;;
243
244   -nfp | --nfp | --nf)
245     # Obsolete; use --without-fp.
246     with_fp=no ;;
247
248   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
249   | --no-cr | --no-c)
250     no_create=yes ;;
251
252   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
253   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
254     no_recursion=yes ;;
255
256   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
257   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
258   | --oldin | --oldi | --old | --ol | --o)
259     ac_prev=oldincludedir ;;
260   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
261   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
262   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
263     oldincludedir="$ac_optarg" ;;
264
265   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
266     ac_prev=prefix ;;
267   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
268     prefix="$ac_optarg" ;;
269
270   -program-prefix | --program-prefix | --program-prefi | --program-pref \
271   | --program-pre | --program-pr | --program-p)
272     ac_prev=program_prefix ;;
273   -program-prefix=* | --program-prefix=* | --program-prefi=* \
274   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
275     program_prefix="$ac_optarg" ;;
276
277   -program-suffix | --program-suffix | --program-suffi | --program-suff \
278   | --program-suf | --program-su | --program-s)
279     ac_prev=program_suffix ;;
280   -program-suffix=* | --program-suffix=* | --program-suffi=* \
281   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
282     program_suffix="$ac_optarg" ;;
283
284   -program-transform-name | --program-transform-name \
285   | --program-transform-nam | --program-transform-na \
286   | --program-transform-n | --program-transform- \
287   | --program-transform | --program-transfor \
288   | --program-transfo | --program-transf \
289   | --program-trans | --program-tran \
290   | --progr-tra | --program-tr | --program-t)
291     ac_prev=program_transform_name ;;
292   -program-transform-name=* | --program-transform-name=* \
293   | --program-transform-nam=* | --program-transform-na=* \
294   | --program-transform-n=* | --program-transform-=* \
295   | --program-transform=* | --program-transfor=* \
296   | --program-transfo=* | --program-transf=* \
297   | --program-trans=* | --program-tran=* \
298   | --progr-tra=* | --program-tr=* | --program-t=*)
299     program_transform_name="$ac_optarg" ;;
300
301   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
302   | -silent | --silent | --silen | --sile | --sil)
303     silent=yes ;;
304
305   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
306     ac_prev=sbindir ;;
307   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
308   | --sbi=* | --sb=*)
309     sbindir="$ac_optarg" ;;
310
311   -sharedstatedir | --sharedstatedir | --sharedstatedi \
312   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
313   | --sharedst | --shareds | --shared | --share | --shar \
314   | --sha | --sh)
315     ac_prev=sharedstatedir ;;
316   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
317   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
318   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
319   | --sha=* | --sh=*)
320     sharedstatedir="$ac_optarg" ;;
321
322   -site | --site | --sit)
323     ac_prev=site ;;
324   -site=* | --site=* | --sit=*)
325     site="$ac_optarg" ;;
326
327   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
328     ac_prev=srcdir ;;
329   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
330     srcdir="$ac_optarg" ;;
331
332   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
333   | --syscon | --sysco | --sysc | --sys | --sy)
334     ac_prev=sysconfdir ;;
335   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
336   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
337     sysconfdir="$ac_optarg" ;;
338
339   -target | --target | --targe | --targ | --tar | --ta | --t)
340     ac_prev=target ;;
341   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
342     target="$ac_optarg" ;;
343
344   -v | -verbose | --verbose | --verbos | --verbo | --verb)
345     verbose=yes ;;
346
347   -version | --version | --versio | --versi | --vers)
348     echo "configure generated by autoconf version 2.13.20030927"
349     exit 0 ;;
350
351   -with-* | --with-*)
352     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
353     # Reject names that are not valid shell variable names.
354     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
355       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
356     fi
357     ac_package=`echo $ac_package| sed 's/-/_/g'`
358     case "$ac_option" in
359       *=*) ;;
360       *) ac_optarg=yes ;;
361     esac
362     eval "with_${ac_package}='$ac_optarg'" ;;
363
364   -without-* | --without-*)
365     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
366     # Reject names that are not valid shell variable names.
367     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
368       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
369     fi
370     ac_package=`echo $ac_package| sed 's/-/_/g'`
371     eval "with_${ac_package}=no" ;;
372
373   --x)
374     # Obsolete; use --with-x.
375     with_x=yes ;;
376
377   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
378   | --x-incl | --x-inc | --x-in | --x-i)
379     ac_prev=x_includes ;;
380   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
381   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
382     x_includes="$ac_optarg" ;;
383
384   -x-libraries | --x-libraries | --x-librarie | --x-librari \
385   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
386     ac_prev=x_libraries ;;
387   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
388   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
389     x_libraries="$ac_optarg" ;;
390
391   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
392     ;;
393
394   *)
395     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
396       echo "configure: warning: $ac_option: invalid host type" 1>&2
397     fi
398     if test "x$nonopt" != xNONE; then
399       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
400     fi
401     nonopt="$ac_option"
402     ;;
403
404   esac
405 done
406
407 if test -n "$ac_prev"; then
408   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
409 fi
410
411 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
412
413 # File descriptor usage:
414 # 0 standard input
415 # 1 file creation
416 # 2 errors and warnings
417 # 3 some systems may open it to /dev/tty
418 # 4 used on the Kubota Titan
419 # 6 checking for... messages and results
420 # 5 compiler messages saved in config.log
421 if test "$silent" = yes; then
422   exec 6>/dev/null
423 else
424   exec 6>&1
425 fi
426 exec 5>./config.log
427
428 echo "\
429 This file contains any messages produced by compilers while
430 running configure, to aid debugging if configure makes a mistake.
431 " 1>&5
432
433 # Strip out --no-create and --no-recursion so they do not pile up.
434 # Also quote any args containing shell metacharacters.
435 ac_configure_args=
436 for ac_arg
437 do
438   case "$ac_arg" in
439   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
440   | --no-cr | --no-c) ;;
441   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
442   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
443   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
444   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
445   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
446   esac
447 done
448
449 # NLS nuisances.
450 # Only set these to C if already set.  These must not be set unconditionally
451 # because not all systems understand e.g. LANG=C (notably SCO).
452 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
453 # Non-C LC_CTYPE values break the ctype check.
454 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
455 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
456 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
457 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
458
459 # confdefs.h avoids OS command line length limits that DEFS can exceed.
460 rm -rf conftest* confdefs.h
461 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
462 echo > confdefs.h
463
464 # A filename unique to this package, relative to the directory that
465 # configure is in, which we can look for to find out if srcdir is correct.
466 ac_unique_file=ncurses.c
467
468 # Find the source files, if location was not specified.
469 if test -z "$srcdir"; then
470   ac_srcdir_defaulted=yes
471   # Try the directory containing this script, then its parent.
472   ac_prog=$0
473   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
474   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
475   srcdir=$ac_confdir
476   if test ! -r $srcdir/$ac_unique_file; then
477     srcdir=..
478   fi
479 else
480   ac_srcdir_defaulted=no
481 fi
482 if test ! -r $srcdir/$ac_unique_file; then
483   if test "$ac_srcdir_defaulted" = yes; then
484     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
485   else
486     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
487   fi
488 fi
489 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
490
491 # Prefer explicitly selected file to automatically selected ones.
492 if test -z "$CONFIG_SITE"; then
493   if test "x$prefix" != xNONE; then
494     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
495   else
496     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
497   fi
498 fi
499 for ac_site_file in $CONFIG_SITE; do
500   if test -r "$ac_site_file"; then
501     echo "loading site script $ac_site_file"
502     . "$ac_site_file"
503   fi
504 done
505
506 if test -r "$cache_file"; then
507   echo "loading cache $cache_file"
508   . $cache_file
509 else
510   echo "creating cache $cache_file"
511   > $cache_file
512 fi
513
514 ac_ext=c
515 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
516 ac_cpp='$CPP $CPPFLAGS'
517 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
518 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
519 cross_compiling=$ac_cv_prog_cc_cross
520
521 ac_exeext=
522 ac_objext=o
523 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
524   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
525   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
526     ac_n= ac_c='
527 ' ac_t='        '
528   else
529     ac_n=-n ac_c= ac_t=
530   fi
531 else
532   ac_n= ac_c='\c' ac_t=
533 fi
534
535 # If we find X, set shell vars x_includes and x_libraries to the
536 # paths, otherwise set no_x=yes.
537 # Uses ac_ vars as temps to allow command line to override cache and checks.
538 # --without-x overrides everything else, but does not touch the cache.
539 echo $ac_n "checking for X""... $ac_c" 1>&6
540 echo "configure:541: checking for X" >&5
541
542
543 # Check whether --with-x or --without-x was given.
544 if test "${with_x+set}" = set; then
545   withval="$with_x"
546   :
547 fi
548
549 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
550 if test "x$with_x" = xno; then
551   # The user explicitly disabled X.
552   have_x=disabled
553 else
554   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
555     # Both variables are already set.
556     have_x=yes
557   else
558 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
559   echo $ac_n "(cached) $ac_c" 1>&6
560 else
561   # One or both of the vars are not set, and there is no cached value.
562 ac_x_includes=NO ac_x_libraries=NO
563 rm -fr conftestdir
564 if mkdir conftestdir; then
565   cd conftestdir
566   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
567   cat > Imakefile <<'EOF'
568 acfindx:
569         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
570 EOF
571   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
572     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
573     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
574     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
575     for ac_extension in a so sl; do
576       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
577         test -f $ac_im_libdir/libX11.$ac_extension; then
578         ac_im_usrlibdir=$ac_im_libdir; break
579       fi
580     done
581     # Screen out bogus values from the imake configuration.  They are
582     # bogus both because they are the default anyway, and because
583     # using them would break gcc on systems where it needs fixed includes.
584     case "$ac_im_incroot" in
585         /usr/include) ;;
586         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
587     esac
588     case "$ac_im_usrlibdir" in
589         /usr/lib | /lib) ;;
590         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
591     esac
592   fi
593   cd ..
594   rm -fr conftestdir
595 fi
596
597 if test "$ac_x_includes" = NO; then
598   # Guess where to find include files, by looking for this one X11 .h file.
599   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
600
601   # First, try using that file with no special directory specified.
602 cat > conftest.$ac_ext <<EOF
603 #line 604 "configure"
604 #include "confdefs.h"
605 #include <$x_direct_test_include>
606 EOF
607 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
608 { (eval echo configure:609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
609 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
610 if test -z "$ac_err"; then
611   rm -rf conftest*
612   # We can compile using X headers with no special include directory.
613 ac_x_includes=
614 else
615   echo "$ac_err" >&5
616   echo "configure: failed program was:" >&5
617   cat conftest.$ac_ext >&5
618   rm -rf conftest*
619   # Look for the header file in a standard set of common directories.
620 # Check X11 before X11Rn because it is often a symlink to the current release.
621   for ac_dir in               \
622     /usr/X11/include          \
623     /usr/X11R6/include        \
624     /usr/X11R5/include        \
625     /usr/X11R4/include        \
626                               \
627     /usr/include/X11          \
628     /usr/include/X11R6        \
629     /usr/include/X11R5        \
630     /usr/include/X11R4        \
631                               \
632     /usr/local/X11/include    \
633     /usr/local/X11R6/include  \
634     /usr/local/X11R5/include  \
635     /usr/local/X11R4/include  \
636                               \
637     /usr/local/include/X11    \
638     /usr/local/include/X11R6  \
639     /usr/local/include/X11R5  \
640     /usr/local/include/X11R4  \
641                               \
642     /usr/X386/include         \
643     /usr/x386/include         \
644     /usr/XFree86/include/X11  \
645                               \
646     /usr/include              \
647     /usr/local/include        \
648     /usr/unsupported/include  \
649     /usr/athena/include       \
650     /usr/local/x11r5/include  \
651     /usr/lpp/Xamples/include  \
652                               \
653     /usr/openwin/include      \
654     /usr/openwin/share/include \
655     ; \
656   do
657     if test -r "$ac_dir/$x_direct_test_include"; then
658       ac_x_includes=$ac_dir
659       break
660     fi
661   done
662 fi
663 rm -f conftest*
664 fi # $ac_x_includes = NO
665
666 if test "$ac_x_libraries" = NO; then
667   # Check for the libraries.
668
669   test -z "$x_direct_test_library" && x_direct_test_library=Xt
670   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
671
672   # See if we find them without any special options.
673   # Don't add to $LIBS permanently.
674   ac_save_LIBS="$LIBS"
675   LIBS="-l$x_direct_test_library $LIBS"
676 cat > conftest.$ac_ext <<EOF
677 #line 678 "configure"
678 #include "confdefs.h"
679
680 int main() {
681 ${x_direct_test_function}()
682 ; return 0; }
683 EOF
684 if { (eval echo configure:685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
685   rm -rf conftest*
686   LIBS="$ac_save_LIBS"
687 # We can link X programs with no special library path.
688 ac_x_libraries=
689 else
690   echo "configure: failed program was:" >&5
691   cat conftest.$ac_ext >&5
692   rm -rf conftest*
693   LIBS="$ac_save_LIBS"
694 # First see if replacing the include by lib works.
695 # Check X11 before X11Rn because it is often a symlink to the current release.
696 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
697     /usr/X11/lib          \
698     /usr/X11R6/lib        \
699     /usr/X11R5/lib        \
700     /usr/X11R4/lib        \
701                           \
702     /usr/lib/X11          \
703     /usr/lib/X11R6        \
704     /usr/lib/X11R5        \
705     /usr/lib/X11R4        \
706                           \
707     /usr/local/X11/lib    \
708     /usr/local/X11R6/lib  \
709     /usr/local/X11R5/lib  \
710     /usr/local/X11R4/lib  \
711                           \
712     /usr/local/lib/X11    \
713     /usr/local/lib/X11R6  \
714     /usr/local/lib/X11R5  \
715     /usr/local/lib/X11R4  \
716                           \
717     /usr/X386/lib         \
718     /usr/x386/lib         \
719     /usr/XFree86/lib/X11  \
720                           \
721     /usr/lib              \
722     /usr/local/lib        \
723     /usr/unsupported/lib  \
724     /usr/athena/lib       \
725     /usr/local/x11r5/lib  \
726     /usr/lpp/Xamples/lib  \
727     /lib/usr/lib/X11      \
728                           \
729     /usr/openwin/lib      \
730     /usr/openwin/share/lib \
731     ; \
732 do
733   for ac_extension in a so sl; do
734     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
735       ac_x_libraries=$ac_dir
736       break 2
737     fi
738   done
739 done
740 fi
741 rm -f conftest*
742 fi # $ac_x_libraries = NO
743
744 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
745   # Didn't find X anywhere.  Cache the known absence of X.
746   ac_cv_have_x="have_x=no"
747 else
748   # Record where we found X for the cache.
749   ac_cv_have_x="have_x=yes \
750                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
751 fi
752 fi
753   fi
754   eval "$ac_cv_have_x"
755 fi # $with_x != no
756
757 if test "$have_x" != yes; then
758   echo "$ac_t""$have_x" 1>&6
759   no_x=yes
760 else
761   # If each of the values was on the command line, it overrides each guess.
762   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
763   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
764   # Update the cache value to reflect the command line values.
765   ac_cv_have_x="have_x=yes \
766                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
767   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
768 fi
769
770
771
772
773
774 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
775
776
777 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
778
779 ac_aux_dir=
780 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
781   if test -f $ac_dir/install-sh; then
782     ac_aux_dir=$ac_dir
783     ac_install_sh="$ac_aux_dir/install-sh -c"
784     break
785   elif test -f $ac_dir/install.sh; then
786     ac_aux_dir=$ac_dir
787     ac_install_sh="$ac_aux_dir/install.sh -c"
788     break
789   fi
790 done
791 if test -z "$ac_aux_dir"; then
792   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
793 fi
794 ac_config_guess=$ac_aux_dir/config.guess
795 ac_config_sub=$ac_aux_dir/config.sub
796 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
797
798
799 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
800         
801 # Make sure we can run config.sub.
802 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
803 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
804 fi
805
806 echo $ac_n "checking host system type""... $ac_c" 1>&6
807 echo "configure:808: checking host system type" >&5
808
809 host_alias=$host
810 case "$host_alias" in
811 NONE)
812   case $nonopt in
813   NONE)
814     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
815     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
816     fi ;;
817   *) host_alias=$nonopt ;;
818   esac ;;
819 esac
820
821 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
822 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
823 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
824 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
825 echo "$ac_t""$host" 1>&6
826
827         system_name="$host_os"
828 else
829         system_name="`(uname -s -r) 2>/dev/null`"
830         if test -z "$system_name" ; then
831                 system_name="`(hostname) 2>/dev/null`"
832         fi
833 fi
834 test -n "$system_name" && cat >> confdefs.h <<EOF
835 #define SYSTEM_NAME "$system_name"
836 EOF
837
838 if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
839   echo $ac_n "(cached) $ac_c" 1>&6
840 else
841   cf_cv_system_name="$system_name"
842 fi
843
844
845 test -z "$system_name" && system_name="$cf_cv_system_name"
846 test -n "$cf_cv_system_name" && echo "$ac_t""Configuring for $cf_cv_system_name" 1>&6
847
848 if test ".$system_name" != ".$cf_cv_system_name" ; then
849         echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
850         { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
851 fi
852
853
854 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
855 echo "configure:856: checking whether ${MAKE-make} sets \${MAKE}" >&5
856 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
857 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
858   echo $ac_n "(cached) $ac_c" 1>&6
859 else
860   cat > conftestmake <<\EOF
861 all:
862         @echo 'ac_maketemp="${MAKE}"'
863 EOF
864 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
865 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
866 if test -n "$ac_maketemp"; then
867   eval ac_cv_prog_make_${ac_make}_set=yes
868 else
869   eval ac_cv_prog_make_${ac_make}_set=no
870 fi
871 rm -f conftestmake
872 fi
873 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
874   echo "$ac_t""yes" 1>&6
875   SET_MAKE=
876 else
877   echo "$ac_t""no" 1>&6
878   SET_MAKE="MAKE=${MAKE-make}"
879 fi
880
881 # Extract the first word of "gcc", so it can be a program name with args.
882 set dummy gcc; ac_word=$2
883 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
884 echo "configure:885: checking for $ac_word" >&5
885 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
886   echo $ac_n "(cached) $ac_c" 1>&6
887 else
888   if test -n "$CC"; then
889   ac_cv_prog_CC="$CC" # Let the user override the test.
890 else
891   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
892   ac_dummy="$PATH"
893   for ac_dir in $ac_dummy; do
894     test -z "$ac_dir" && ac_dir=.
895     if test -f $ac_dir/$ac_word; then
896       ac_cv_prog_CC="gcc"
897       break
898     fi
899   done
900   IFS="$ac_save_ifs"
901 fi
902 fi
903 CC="$ac_cv_prog_CC"
904 if test -n "$CC"; then
905   echo "$ac_t""$CC" 1>&6
906 else
907   echo "$ac_t""no" 1>&6
908 fi
909
910 if test -z "$CC"; then
911   # Extract the first word of "cc", so it can be a program name with args.
912 set dummy cc; ac_word=$2
913 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
914 echo "configure:915: checking for $ac_word" >&5
915 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
916   echo $ac_n "(cached) $ac_c" 1>&6
917 else
918   if test -n "$CC"; then
919   ac_cv_prog_CC="$CC" # Let the user override the test.
920 else
921   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
922   ac_prog_rejected=no
923   ac_dummy="$PATH"
924   for ac_dir in $ac_dummy; do
925     test -z "$ac_dir" && ac_dir=.
926     if test -f $ac_dir/$ac_word; then
927       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
928         ac_prog_rejected=yes
929         continue
930       fi
931       ac_cv_prog_CC="cc"
932       break
933     fi
934   done
935   IFS="$ac_save_ifs"
936 if test $ac_prog_rejected = yes; then
937   # We found a bogon in the path, so make sure we never use it.
938   set dummy $ac_cv_prog_CC
939   shift
940   if test $# -gt 0; then
941     # We chose a different compiler from the bogus one.
942     # However, it has the same basename, so the bogon will be chosen
943     # first if we set CC to just the basename; use the full file name.
944     shift
945     set dummy "$ac_dir/$ac_word" "$@"
946     shift
947     ac_cv_prog_CC="$@"
948   fi
949 fi
950 fi
951 fi
952 CC="$ac_cv_prog_CC"
953 if test -n "$CC"; then
954   echo "$ac_t""$CC" 1>&6
955 else
956   echo "$ac_t""no" 1>&6
957 fi
958
959   if test -z "$CC"; then
960     case "`uname -s`" in
961     *win32* | *WIN32*)
962       # Extract the first word of "cl", so it can be a program name with args.
963 set dummy cl; ac_word=$2
964 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
965 echo "configure:966: checking for $ac_word" >&5
966 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
967   echo $ac_n "(cached) $ac_c" 1>&6
968 else
969   if test -n "$CC"; then
970   ac_cv_prog_CC="$CC" # Let the user override the test.
971 else
972   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
973   ac_dummy="$PATH"
974   for ac_dir in $ac_dummy; do
975     test -z "$ac_dir" && ac_dir=.
976     if test -f $ac_dir/$ac_word; then
977       ac_cv_prog_CC="cl"
978       break
979     fi
980   done
981   IFS="$ac_save_ifs"
982 fi
983 fi
984 CC="$ac_cv_prog_CC"
985 if test -n "$CC"; then
986   echo "$ac_t""$CC" 1>&6
987 else
988   echo "$ac_t""no" 1>&6
989 fi
990  ;;
991     esac
992   fi
993   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
994 fi
995
996 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
997 echo "configure:998: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
998
999 ac_ext=c
1000 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1001 ac_cpp='$CPP $CPPFLAGS'
1002 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1003 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1004 cross_compiling=$ac_cv_prog_cc_cross
1005
1006 cat > conftest.$ac_ext << EOF
1007
1008 #line 1009 "configure"
1009 #include "confdefs.h"
1010
1011 main(){return(0);}
1012 EOF
1013 if { (eval echo configure:1014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1014   ac_cv_prog_cc_works=yes
1015   # If we can't run a trivial program, we are probably using a cross compiler.
1016   if (./conftest; exit) 2>/dev/null; then
1017     ac_cv_prog_cc_cross=no
1018   else
1019     ac_cv_prog_cc_cross=yes
1020   fi
1021 else
1022   echo "configure: failed program was:" >&5
1023   cat conftest.$ac_ext >&5
1024   ac_cv_prog_cc_works=no
1025 fi
1026 rm -fr conftest*
1027 ac_ext=c
1028 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1029 ac_cpp='$CPP $CPPFLAGS'
1030 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1031 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1032 cross_compiling=$ac_cv_prog_cc_cross
1033
1034 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1035 if test $ac_cv_prog_cc_works = no; then
1036   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1037 fi
1038 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1039 echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1040 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1041 cross_compiling=$ac_cv_prog_cc_cross
1042
1043 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1044 echo "configure:1045: checking whether we are using GNU C" >&5
1045 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1046   echo $ac_n "(cached) $ac_c" 1>&6
1047 else
1048   cat > conftest.c <<EOF
1049 #ifdef __GNUC__
1050   yes;
1051 #endif
1052 EOF
1053 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1054   ac_cv_prog_gcc=yes
1055 else
1056   ac_cv_prog_gcc=no
1057 fi
1058 fi
1059
1060 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1061
1062 if test $ac_cv_prog_gcc = yes; then
1063   GCC=yes
1064 else
1065   GCC=
1066 fi
1067
1068 ac_test_CFLAGS="${CFLAGS+set}"
1069 ac_save_CFLAGS="$CFLAGS"
1070 CFLAGS=
1071 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1072 echo "configure:1073: checking whether ${CC-cc} accepts -g" >&5
1073 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1074   echo $ac_n "(cached) $ac_c" 1>&6
1075 else
1076   echo 'void f(){}' > conftest.c
1077 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1078   ac_cv_prog_cc_g=yes
1079 else
1080   ac_cv_prog_cc_g=no
1081 fi
1082 rm -f conftest*
1083
1084 fi
1085
1086 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1087 if test "$ac_test_CFLAGS" = set; then
1088   CFLAGS="$ac_save_CFLAGS"
1089 elif test $ac_cv_prog_cc_g = yes; then
1090   if test "$GCC" = yes; then
1091     CFLAGS="-g -O2"
1092   else
1093     CFLAGS="-g"
1094   fi
1095 else
1096   if test "$GCC" = yes; then
1097     CFLAGS="-O2"
1098   else
1099     CFLAGS=
1100   fi
1101 fi
1102
1103 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1104 echo "configure:1105: checking how to run the C preprocessor" >&5
1105 # On Suns, sometimes $CPP names a directory.
1106 if test -n "$CPP" && test -d "$CPP"; then
1107   CPP=
1108 fi
1109 if test -z "$CPP"; then
1110 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1111   echo $ac_n "(cached) $ac_c" 1>&6
1112 else
1113     # This must be in double quotes, not single quotes, because CPP may get
1114   # substituted into the Makefile and "${CC-cc}" will confuse make.
1115   CPP="${CC-cc} -E"
1116   # On the NeXT, cc -E runs the code through the compiler's parser,
1117   # not just through cpp.
1118   cat > conftest.$ac_ext <<EOF
1119 #line 1120 "configure"
1120 #include "confdefs.h"
1121 #include <assert.h>
1122 Syntax Error
1123 EOF
1124 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1125 { (eval echo configure:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1126 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1127 if test -z "$ac_err"; then
1128   :
1129 else
1130   echo "$ac_err" >&5
1131   echo "configure: failed program was:" >&5
1132   cat conftest.$ac_ext >&5
1133   rm -rf conftest*
1134   CPP="${CC-cc} -E -traditional-cpp"
1135   cat > conftest.$ac_ext <<EOF
1136 #line 1137 "configure"
1137 #include "confdefs.h"
1138 #include <assert.h>
1139 Syntax Error
1140 EOF
1141 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1142 { (eval echo configure:1143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1143 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1144 if test -z "$ac_err"; then
1145   :
1146 else
1147   echo "$ac_err" >&5
1148   echo "configure: failed program was:" >&5
1149   cat conftest.$ac_ext >&5
1150   rm -rf conftest*
1151   CPP="${CC-cc} -nologo -E"
1152   cat > conftest.$ac_ext <<EOF
1153 #line 1154 "configure"
1154 #include "confdefs.h"
1155 #include <assert.h>
1156 Syntax Error
1157 EOF
1158 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1159 { (eval echo configure:1160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1160 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1161 if test -z "$ac_err"; then
1162   :
1163 else
1164   echo "$ac_err" >&5
1165   echo "configure: failed program was:" >&5
1166   cat conftest.$ac_ext >&5
1167   rm -rf conftest*
1168   CPP=/lib/cpp
1169 fi
1170 rm -f conftest*
1171 fi
1172 rm -f conftest*
1173 fi
1174 rm -f conftest*
1175   ac_cv_prog_CPP="$CPP"
1176 fi
1177   CPP="$ac_cv_prog_CPP"
1178 else
1179   ac_cv_prog_CPP="$CPP"
1180 fi
1181 echo "$ac_t""$CPP" 1>&6
1182
1183 for ac_prog in mawk gawk nawk awk
1184 do
1185 # Extract the first word of "$ac_prog", so it can be a program name with args.
1186 set dummy $ac_prog; ac_word=$2
1187 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1188 echo "configure:1189: checking for $ac_word" >&5
1189 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
1190   echo $ac_n "(cached) $ac_c" 1>&6
1191 else
1192   if test -n "$AWK"; then
1193   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1194 else
1195   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1196   ac_dummy="$PATH"
1197   for ac_dir in $ac_dummy; do
1198     test -z "$ac_dir" && ac_dir=.
1199     if test -f $ac_dir/$ac_word; then
1200       ac_cv_prog_AWK="$ac_prog"
1201       break
1202     fi
1203   done
1204   IFS="$ac_save_ifs"
1205 fi
1206 fi
1207 AWK="$ac_cv_prog_AWK"
1208 if test -n "$AWK"; then
1209   echo "$ac_t""$AWK" 1>&6
1210 else
1211   echo "$ac_t""no" 1>&6
1212 fi
1213
1214 test -n "$AWK" && break
1215 done
1216
1217
1218 echo $ac_n "checking if filesystem supports mixed-case filenames""... $ac_c" 1>&6
1219 echo "configure:1220: checking if filesystem supports mixed-case filenames" >&5
1220 if eval "test \"`echo '$''{'cf_cv_mixedcase'+set}'`\" = set"; then
1221   echo $ac_n "(cached) $ac_c" 1>&6
1222 else
1223   
1224 if test "$cross_compiling" = yes ; then
1225         case $target_alias in #(vi
1226         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
1227                 cf_cv_mixedcase=no
1228                 ;;
1229         *)
1230                 cf_cv_mixedcase=yes
1231                 ;;
1232         esac
1233 else
1234         rm -f conftest CONFTEST
1235         echo test >conftest
1236         if test -f CONFTEST ; then
1237                 cf_cv_mixedcase=no
1238         else
1239                 cf_cv_mixedcase=yes
1240         fi
1241         rm -f conftest CONFTEST
1242 fi
1243
1244 fi
1245
1246 echo "$ac_t""$cf_cv_mixedcase" 1>&6
1247 test "$cf_cv_mixedcase" = yes && cat >> confdefs.h <<\EOF
1248 #define MIXEDCASE_FILENAMES 1
1249 EOF
1250
1251
1252
1253
1254
1255 for ac_prog in exctags ctags
1256 do
1257 # Extract the first word of "$ac_prog", so it can be a program name with args.
1258 set dummy $ac_prog; ac_word=$2
1259 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1260 echo "configure:1261: checking for $ac_word" >&5
1261 if eval "test \"`echo '$''{'ac_cv_prog_CTAGS'+set}'`\" = set"; then
1262   echo $ac_n "(cached) $ac_c" 1>&6
1263 else
1264   if test -n "$CTAGS"; then
1265   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
1266 else
1267   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1268   ac_dummy="$PATH"
1269   for ac_dir in $ac_dummy; do
1270     test -z "$ac_dir" && ac_dir=.
1271     if test -f $ac_dir/$ac_word; then
1272       ac_cv_prog_CTAGS="$ac_prog"
1273       break
1274     fi
1275   done
1276   IFS="$ac_save_ifs"
1277 fi
1278 fi
1279 CTAGS="$ac_cv_prog_CTAGS"
1280 if test -n "$CTAGS"; then
1281   echo "$ac_t""$CTAGS" 1>&6
1282 else
1283   echo "$ac_t""no" 1>&6
1284 fi
1285
1286 test -n "$CTAGS" && break
1287 done
1288
1289 for ac_prog in exetags etags
1290 do
1291 # Extract the first word of "$ac_prog", so it can be a program name with args.
1292 set dummy $ac_prog; ac_word=$2
1293 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1294 echo "configure:1295: checking for $ac_word" >&5
1295 if eval "test \"`echo '$''{'ac_cv_prog_ETAGS'+set}'`\" = set"; then
1296   echo $ac_n "(cached) $ac_c" 1>&6
1297 else
1298   if test -n "$ETAGS"; then
1299   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
1300 else
1301   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1302   ac_dummy="$PATH"
1303   for ac_dir in $ac_dummy; do
1304     test -z "$ac_dir" && ac_dir=.
1305     if test -f $ac_dir/$ac_word; then
1306       ac_cv_prog_ETAGS="$ac_prog"
1307       break
1308     fi
1309   done
1310   IFS="$ac_save_ifs"
1311 fi
1312 fi
1313 ETAGS="$ac_cv_prog_ETAGS"
1314 if test -n "$ETAGS"; then
1315   echo "$ac_t""$ETAGS" 1>&6
1316 else
1317   echo "$ac_t""no" 1>&6
1318 fi
1319
1320 test -n "$ETAGS" && break
1321 done
1322
1323
1324 # Extract the first word of "${CTAGS-ctags}", so it can be a program name with args.
1325 set dummy ${CTAGS-ctags}; ac_word=$2
1326 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1327 echo "configure:1328: checking for $ac_word" >&5
1328 if eval "test \"`echo '$''{'ac_cv_prog_MAKE_LOWER_TAGS'+set}'`\" = set"; then
1329   echo $ac_n "(cached) $ac_c" 1>&6
1330 else
1331   if test -n "$MAKE_LOWER_TAGS"; then
1332   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
1333 else
1334   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1335   ac_dummy="$PATH"
1336   for ac_dir in $ac_dummy; do
1337     test -z "$ac_dir" && ac_dir=.
1338     if test -f $ac_dir/$ac_word; then
1339       ac_cv_prog_MAKE_LOWER_TAGS="yes"
1340       break
1341     fi
1342   done
1343   IFS="$ac_save_ifs"
1344   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
1345 fi
1346 fi
1347 MAKE_LOWER_TAGS="$ac_cv_prog_MAKE_LOWER_TAGS"
1348 if test -n "$MAKE_LOWER_TAGS"; then
1349   echo "$ac_t""$MAKE_LOWER_TAGS" 1>&6
1350 else
1351   echo "$ac_t""no" 1>&6
1352 fi
1353
1354
1355 if test "$cf_cv_mixedcase" = yes ; then
1356         # Extract the first word of "${ETAGS-etags}", so it can be a program name with args.
1357 set dummy ${ETAGS-etags}; ac_word=$2
1358 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1359 echo "configure:1360: checking for $ac_word" >&5
1360 if eval "test \"`echo '$''{'ac_cv_prog_MAKE_UPPER_TAGS'+set}'`\" = set"; then
1361   echo $ac_n "(cached) $ac_c" 1>&6
1362 else
1363   if test -n "$MAKE_UPPER_TAGS"; then
1364   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
1365 else
1366   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1367   ac_dummy="$PATH"
1368   for ac_dir in $ac_dummy; do
1369     test -z "$ac_dir" && ac_dir=.
1370     if test -f $ac_dir/$ac_word; then
1371       ac_cv_prog_MAKE_UPPER_TAGS="yes"
1372       break
1373     fi
1374   done
1375   IFS="$ac_save_ifs"
1376   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
1377 fi
1378 fi
1379 MAKE_UPPER_TAGS="$ac_cv_prog_MAKE_UPPER_TAGS"
1380 if test -n "$MAKE_UPPER_TAGS"; then
1381   echo "$ac_t""$MAKE_UPPER_TAGS" 1>&6
1382 else
1383   echo "$ac_t""no" 1>&6
1384 fi
1385
1386 else
1387         MAKE_UPPER_TAGS=no
1388 fi
1389
1390 if test "$MAKE_UPPER_TAGS" = yes ; then
1391         MAKE_UPPER_TAGS=
1392 else
1393         MAKE_UPPER_TAGS="#"
1394 fi
1395
1396 if test "$MAKE_LOWER_TAGS" = yes ; then
1397         MAKE_LOWER_TAGS=
1398 else
1399         MAKE_LOWER_TAGS="#"
1400 fi
1401
1402
1403
1404
1405
1406
1407
1408
1409 CC_G_OPT="-g"                                   
1410 CC_SHARED_OPTS=unknown                  
1411 CPPFLAGS="$CPPFLAGS"                    
1412 DFT_DEP_SUFFIX=""                               
1413 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`    
1414 DFT_UPR_MODEL="NORMAL"                  
1415 LD="ld"                                                 
1416 LDFLAGS_SHARED=""                               
1417 LDFLAGS_STATIC=""                               
1418 LD_MODEL=""                                             
1419 LD_SHARED_OPTS=""                               
1420 LIBTOOL=""                                              
1421 LIB_CLEAN=""                                    
1422 LIB_COMPILE=""                                  
1423 LIB_LINK='${CC}'                                
1424 LINK_TESTS=""                                   
1425 LINT=lint                                               
1426 LINT_OPTS=""                                    
1427 LOCAL_LDFLAGS=""                                
1428 MATH_LIB="-lm"                                  
1429 PTHREAD="-lm"                                   
1430 TEST_ARGS=""                                    
1431 TEST_DEPS=""                                    
1432 TEST_LIBS=""                                    
1433 TINFO_ARGS='$(LIBS_CURSES)'             
1434 cf_cv_abi_version=""                    
1435 cf_cv_rel_version=""                    
1436
1437 cf_cv_screen=curses
1438 cf_cv_libtype=
1439
1440 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
1441 echo "configure:1442: checking for Cygwin environment" >&5
1442 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
1443   echo $ac_n "(cached) $ac_c" 1>&6
1444 else
1445   cat > conftest.$ac_ext <<EOF
1446 #line 1447 "configure"
1447 #include "confdefs.h"
1448
1449 int main() {
1450
1451 #ifndef __CYGWIN__
1452 #define __CYGWIN__ __CYGWIN32__
1453 #endif
1454 return __CYGWIN__;
1455 ; return 0; }
1456 EOF
1457 if { (eval echo configure:1458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1458   rm -rf conftest*
1459   ac_cv_cygwin=yes
1460 else
1461   echo "configure: failed program was:" >&5
1462   cat conftest.$ac_ext >&5
1463   rm -rf conftest*
1464   ac_cv_cygwin=no
1465 fi
1466 rm -f conftest*
1467 rm -f conftest*
1468 fi
1469
1470 echo "$ac_t""$ac_cv_cygwin" 1>&6
1471 CYGWIN=
1472 test "$ac_cv_cygwin" = yes && CYGWIN=yes
1473 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
1474 echo "configure:1475: checking for mingw32 environment" >&5
1475 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
1476   echo $ac_n "(cached) $ac_c" 1>&6
1477 else
1478   cat > conftest.$ac_ext <<EOF
1479 #line 1480 "configure"
1480 #include "confdefs.h"
1481
1482 int main() {
1483 return __MINGW32__;
1484 ; return 0; }
1485 EOF
1486 if { (eval echo configure:1487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1487   rm -rf conftest*
1488   ac_cv_mingw32=yes
1489 else
1490   echo "configure: failed program was:" >&5
1491   cat conftest.$ac_ext >&5
1492   rm -rf conftest*
1493   ac_cv_mingw32=no
1494 fi
1495 rm -f conftest*
1496 rm -f conftest*
1497 fi
1498
1499 echo "$ac_t""$ac_cv_mingw32" 1>&6
1500 MINGW32=
1501 test "$ac_cv_mingw32" = yes && MINGW32=yes
1502
1503
1504 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1505 echo "configure:1506: checking for executable suffix" >&5
1506 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
1507   echo $ac_n "(cached) $ac_c" 1>&6
1508 else
1509   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
1510   ac_cv_exeext=.exe
1511 else
1512   rm -f conftest*
1513   echo 'int main () { return 0; }' > conftest.$ac_ext
1514   ac_cv_exeext=
1515   if { (eval echo configure:1516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1516     for file in conftest.*; do
1517       case $file in
1518       *.c | *.o | *.obj) ;;
1519       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
1520       esac
1521     done
1522   else
1523     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
1524   fi
1525   rm -f conftest*
1526   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
1527 fi
1528 fi
1529
1530 EXEEXT=""
1531 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
1532 echo "$ac_t""${ac_cv_exeext}" 1>&6
1533 ac_exeext=$EXEEXT
1534
1535 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
1536 echo "configure:1537: checking for object suffix" >&5
1537 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
1538   echo $ac_n "(cached) $ac_c" 1>&6
1539 else
1540   rm -f conftest*
1541 echo 'int i = 1;' > conftest.$ac_ext
1542 if { (eval echo configure:1543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1543   for ac_file in conftest.*; do
1544     case $ac_file in
1545     *.c) ;;
1546     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
1547     esac
1548   done
1549 else
1550   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
1551 fi
1552 rm -f conftest*
1553 fi
1554
1555 echo "$ac_t""$ac_cv_objext" 1>&6
1556 OBJEXT=$ac_cv_objext
1557 ac_objext=$ac_cv_objext
1558
1559
1560
1561 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1562 echo "configure:1563: checking for ${CC-cc} option to accept ANSI C" >&5
1563 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
1564   echo $ac_n "(cached) $ac_c" 1>&6
1565 else
1566   
1567 cf_cv_ansi_cc=no
1568 cf_save_CFLAGS="$CFLAGS"
1569 cf_save_CPPFLAGS="$CPPFLAGS"
1570 # Don't try gcc -ansi; that turns off useful extensions and
1571 # breaks some systems' header files.
1572 # AIX                   -qlanglvl=ansi
1573 # Ultrix and OSF/1      -std1
1574 # HP-UX                 -Aa -D_HPUX_SOURCE
1575 # SVR4                  -Xc
1576 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
1577 for cf_arg in "-DCC_HAS_PROTOS" \
1578         "" \
1579         -qlanglvl=ansi \
1580         -std1 \
1581         -Ae \
1582         "-Aa -D_HPUX_SOURCE" \
1583         -Xc
1584 do
1585         
1586 cf_fix_cppflags=no
1587 cf_new_cflags=
1588 cf_new_cppflags=
1589 cf_new_extra_cppflags=
1590
1591 for cf_add_cflags in $cf_arg
1592 do
1593 case $cf_fix_cppflags in
1594 no)
1595         case $cf_add_cflags in #(vi
1596         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1597                 case $cf_add_cflags in
1598                 -D*)
1599                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1600
1601                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1602                                 && test -z "${cf_tst_cflags}" \
1603                                 && cf_fix_cppflags=yes
1604
1605                         if test $cf_fix_cppflags = yes ; then
1606                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1607                                 continue
1608                         elif test "${cf_tst_cflags}" = "\"'" ; then
1609                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1610                                 continue
1611                         fi
1612                         ;;
1613                 esac
1614                 case "$CPPFLAGS" in
1615                 *$cf_add_cflags) #(vi
1616                         ;;
1617                 *) #(vi
1618                         case $cf_add_cflags in #(vi
1619                         -D*)
1620                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1621                                 
1622 CPPFLAGS=`echo "$CPPFLAGS" | \
1623         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1624                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1625
1626                                 ;;
1627                         esac
1628                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1629                         ;;
1630                 esac
1631                 ;;
1632         *)
1633                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1634                 ;;
1635         esac
1636         ;;
1637 yes)
1638         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1639
1640         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1641
1642         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1643                 && test -z "${cf_tst_cflags}" \
1644                 && cf_fix_cppflags=no
1645         ;;
1646 esac
1647 done
1648
1649 if test -n "$cf_new_cflags" ; then
1650         
1651         CFLAGS="$CFLAGS $cf_new_cflags"
1652 fi
1653
1654 if test -n "$cf_new_cppflags" ; then
1655         
1656         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1657 fi
1658
1659 if test -n "$cf_new_extra_cppflags" ; then
1660         
1661         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1662 fi
1663
1664
1665
1666
1667         cat > conftest.$ac_ext <<EOF
1668 #line 1669 "configure"
1669 #include "confdefs.h"
1670
1671 #ifndef CC_HAS_PROTOS
1672 #if !defined(__STDC__) || (__STDC__ != 1)
1673 choke me
1674 #endif
1675 #endif
1676
1677 int main() {
1678
1679         int test (int i, double x);
1680         struct s1 {int (*f) (int a);};
1681         struct s2 {int (*f) (double a);};
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   cf_cv_ansi_cc="$cf_arg"; break
1687 else
1688   echo "configure: failed program was:" >&5
1689   cat conftest.$ac_ext >&5
1690 fi
1691 rm -f conftest*
1692 done
1693 CFLAGS="$cf_save_CFLAGS"
1694 CPPFLAGS="$cf_save_CPPFLAGS"
1695
1696 fi
1697
1698 echo "$ac_t""$cf_cv_ansi_cc" 1>&6
1699
1700 if test "$cf_cv_ansi_cc" != "no"; then
1701 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1702         
1703 cf_fix_cppflags=no
1704 cf_new_cflags=
1705 cf_new_cppflags=
1706 cf_new_extra_cppflags=
1707
1708 for cf_add_cflags in $cf_cv_ansi_cc
1709 do
1710 case $cf_fix_cppflags in
1711 no)
1712         case $cf_add_cflags in #(vi
1713         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1714                 case $cf_add_cflags in
1715                 -D*)
1716                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1717
1718                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1719                                 && test -z "${cf_tst_cflags}" \
1720                                 && cf_fix_cppflags=yes
1721
1722                         if test $cf_fix_cppflags = yes ; then
1723                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1724                                 continue
1725                         elif test "${cf_tst_cflags}" = "\"'" ; then
1726                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1727                                 continue
1728                         fi
1729                         ;;
1730                 esac
1731                 case "$CPPFLAGS" in
1732                 *$cf_add_cflags) #(vi
1733                         ;;
1734                 *) #(vi
1735                         case $cf_add_cflags in #(vi
1736                         -D*)
1737                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1738                                 
1739 CPPFLAGS=`echo "$CPPFLAGS" | \
1740         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1741                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1742
1743                                 ;;
1744                         esac
1745                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1746                         ;;
1747                 esac
1748                 ;;
1749         *)
1750                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1751                 ;;
1752         esac
1753         ;;
1754 yes)
1755         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1756
1757         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1758
1759         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1760                 && test -z "${cf_tst_cflags}" \
1761                 && cf_fix_cppflags=no
1762         ;;
1763 esac
1764 done
1765
1766 if test -n "$cf_new_cflags" ; then
1767         
1768         CFLAGS="$CFLAGS $cf_new_cflags"
1769 fi
1770
1771 if test -n "$cf_new_cppflags" ; then
1772         
1773         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1774 fi
1775
1776 if test -n "$cf_new_extra_cppflags" ; then
1777         
1778         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1779 fi
1780
1781
1782
1783
1784 else
1785         cat >> confdefs.h <<\EOF
1786 #define CC_HAS_PROTOS 1
1787 EOF
1788
1789 fi
1790 fi
1791
1792
1793 if test "$cf_cv_ansi_cc" = "no"; then
1794         { echo "configure: error: Your compiler does not appear to recognize prototypes.
1795 You have the following choices:
1796         a. adjust your compiler options
1797         b. get an up-to-date compiler
1798         c. use a wrapper such as unproto" 1>&2; exit 1; }
1799 fi
1800
1801
1802 if test "$GCC" = yes
1803 then
1804 cat > conftest.i <<EOF
1805 #ifndef GCC_PRINTF
1806 #define GCC_PRINTF 0
1807 #endif
1808 #ifndef GCC_SCANF
1809 #define GCC_SCANF 0
1810 #endif
1811 #ifndef GCC_NORETURN
1812 #define GCC_NORETURN /* nothing */
1813 #endif
1814 #ifndef GCC_UNUSED
1815 #define GCC_UNUSED /* nothing */
1816 #endif
1817 EOF
1818 if test "$GCC" = yes
1819 then
1820         echo "checking for $CC __attribute__ directives" 1>&6
1821 echo "configure:1822: checking for $CC __attribute__ directives" >&5
1822 cat > conftest.$ac_ext <<EOF
1823 #line 1824 "${as_me-configure}"
1824 #include "confdefs.h"
1825 #include "conftest.h"
1826 #include "conftest.i"
1827 #if     GCC_PRINTF
1828 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
1829 #else
1830 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
1831 #endif
1832 #if     GCC_SCANF
1833 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
1834 #else
1835 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
1836 #endif
1837 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
1838 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
1839 extern void foo(void) GCC_NORETURN;
1840 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
1841 EOF
1842         cf_printf_attribute=no
1843         cf_scanf_attribute=no
1844         for cf_attribute in scanf printf unused noreturn
1845         do
1846                 
1847 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1848
1849                 cf_directive="__attribute__(($cf_attribute))"
1850                 echo "checking for $CC $cf_directive" 1>&5
1851
1852                 case $cf_attribute in #(vi
1853                 printf) #(vi
1854                         cf_printf_attribute=yes
1855                         cat >conftest.h <<EOF
1856 #define GCC_$cf_ATTRIBUTE 1
1857 EOF
1858                         ;;
1859                 scanf) #(vi
1860                         cf_scanf_attribute=yes
1861                         cat >conftest.h <<EOF
1862 #define GCC_$cf_ATTRIBUTE 1
1863 EOF
1864                         ;;
1865                 *) #(vi
1866                         cat >conftest.h <<EOF
1867 #define GCC_$cf_ATTRIBUTE $cf_directive
1868 EOF
1869                         ;;
1870                 esac
1871
1872                 if { (eval echo configure:1873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1873                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
1874                         cat conftest.h >>confdefs.h
1875                         case $cf_attribute in #(vi
1876                         printf) #(vi
1877                                 if test "$cf_printf_attribute" = no ; then
1878                                         cat >>confdefs.h <<EOF
1879 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
1880 EOF
1881                                 else
1882                                         cat >>confdefs.h <<EOF
1883 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
1884 EOF
1885                                 fi
1886                                 ;;
1887                         scanf) #(vi
1888                                 if test "$cf_scanf_attribute" = no ; then
1889                                         cat >>confdefs.h <<EOF
1890 #define GCC_SCANFLIKE(fmt,var) /* nothing */
1891 EOF
1892                                 else
1893                                         cat >>confdefs.h <<EOF
1894 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
1895 EOF
1896                                 fi
1897                                 ;;
1898                         esac
1899                 fi
1900         done
1901 else
1902         fgrep define conftest.i >>confdefs.h
1903 fi
1904 rm -rf conftest*
1905 fi
1906
1907
1908
1909 cf_XOPEN_SOURCE=500
1910 cf_POSIX_C_SOURCE=199506L
1911 cf_xopen_source=
1912
1913 case $host_os in #(vi
1914 aix[456]*) #(vi
1915         cf_xopen_source="-D_ALL_SOURCE"
1916         ;;
1917 darwin[0-8].*) #(vi
1918         cf_xopen_source="-D_APPLE_C_SOURCE"
1919         ;;
1920 darwin*) #(vi
1921         cf_xopen_source="-D_DARWIN_C_SOURCE"
1922         ;;
1923 freebsd*|dragonfly*) #(vi
1924         # 5.x headers associate
1925         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
1926         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
1927         cf_POSIX_C_SOURCE=200112L
1928         cf_XOPEN_SOURCE=600
1929         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1930         ;;
1931 hpux11*) #(vi
1932         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
1933         ;;
1934 hpux*) #(vi
1935         cf_xopen_source="-D_HPUX_SOURCE"
1936         ;;
1937 irix[56].*) #(vi
1938         cf_xopen_source="-D_SGI_SOURCE"
1939         ;;
1940 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
1941         
1942 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
1943 echo "configure:1944: checking if we must define _GNU_SOURCE" >&5
1944 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
1945   echo $ac_n "(cached) $ac_c" 1>&6
1946 else
1947   
1948 cat > conftest.$ac_ext <<EOF
1949 #line 1950 "configure"
1950 #include "confdefs.h"
1951 #include <sys/types.h>
1952 int main() {
1953
1954 #ifndef _XOPEN_SOURCE
1955 make an error
1956 #endif
1957 ; return 0; }
1958 EOF
1959 if { (eval echo configure:1960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1960   rm -rf conftest*
1961   cf_cv_gnu_source=no
1962 else
1963   echo "configure: failed program was:" >&5
1964   cat conftest.$ac_ext >&5
1965   rm -rf conftest*
1966   cf_save="$CPPFLAGS"
1967          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1968          cat > conftest.$ac_ext <<EOF
1969 #line 1970 "configure"
1970 #include "confdefs.h"
1971 #include <sys/types.h>
1972 int main() {
1973
1974 #ifdef _XOPEN_SOURCE
1975 make an error
1976 #endif
1977 ; return 0; }
1978 EOF
1979 if { (eval echo configure:1980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1980   rm -rf conftest*
1981   cf_cv_gnu_source=no
1982 else
1983   echo "configure: failed program was:" >&5
1984   cat conftest.$ac_ext >&5
1985   rm -rf conftest*
1986   cf_cv_gnu_source=yes
1987 fi
1988 rm -f conftest*
1989         CPPFLAGS="$cf_save"
1990         
1991 fi
1992 rm -f conftest*
1993
1994 fi
1995
1996 echo "$ac_t""$cf_cv_gnu_source" 1>&6
1997 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1998
1999         ;;
2000 mirbsd*) #(vi
2001         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
2002         ;;
2003 netbsd*) #(vi
2004         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
2005         ;;
2006 openbsd*) #(vi
2007         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
2008         ;;
2009 osf[45]*) #(vi
2010         cf_xopen_source="-D_OSF_SOURCE"
2011         ;;
2012 nto-qnx*) #(vi
2013         cf_xopen_source="-D_QNX_SOURCE"
2014         ;;
2015 sco*) #(vi
2016         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
2017         ;;
2018 solaris2.1[0-9]) #(vi
2019         cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2020         ;;
2021 solaris2.[1-9]) #(vi
2022         cf_xopen_source="-D__EXTENSIONS__"
2023         ;;
2024 *)
2025         echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
2026 echo "configure:2027: checking if we should define _XOPEN_SOURCE" >&5
2027 if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
2028   echo $ac_n "(cached) $ac_c" 1>&6
2029 else
2030   
2031         cat > conftest.$ac_ext <<EOF
2032 #line 2033 "configure"
2033 #include "confdefs.h"
2034 #include <sys/types.h>
2035 int main() {
2036
2037 #ifndef _XOPEN_SOURCE
2038 make an error
2039 #endif
2040 ; return 0; }
2041 EOF
2042 if { (eval echo configure:2043: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2043   rm -rf conftest*
2044   cf_cv_xopen_source=no
2045 else
2046   echo "configure: failed program was:" >&5
2047   cat conftest.$ac_ext >&5
2048   rm -rf conftest*
2049   cf_save="$CPPFLAGS"
2050          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2051          cat > conftest.$ac_ext <<EOF
2052 #line 2053 "configure"
2053 #include "confdefs.h"
2054 #include <sys/types.h>
2055 int main() {
2056
2057 #ifdef _XOPEN_SOURCE
2058 make an error
2059 #endif
2060 ; return 0; }
2061 EOF
2062 if { (eval echo configure:2063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2063   rm -rf conftest*
2064   cf_cv_xopen_source=no
2065 else
2066   echo "configure: failed program was:" >&5
2067   cat conftest.$ac_ext >&5
2068   rm -rf conftest*
2069   cf_cv_xopen_source=$cf_XOPEN_SOURCE
2070 fi
2071 rm -f conftest*
2072         CPPFLAGS="$cf_save"
2073         
2074 fi
2075 rm -f conftest*
2076
2077 fi
2078
2079 echo "$ac_t""$cf_cv_xopen_source" 1>&6
2080         if test "$cf_cv_xopen_source" != no ; then
2081                 
2082 CFLAGS=`echo "$CFLAGS" | \
2083         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
2084                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
2085
2086                 
2087 CPPFLAGS=`echo "$CPPFLAGS" | \
2088         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
2089                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
2090
2091                 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
2092                 
2093 cf_fix_cppflags=no
2094 cf_new_cflags=
2095 cf_new_cppflags=
2096 cf_new_extra_cppflags=
2097
2098 for cf_add_cflags in $cf_temp_xopen_source
2099 do
2100 case $cf_fix_cppflags in
2101 no)
2102         case $cf_add_cflags in #(vi
2103         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2104                 case $cf_add_cflags in
2105                 -D*)
2106                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2107
2108                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2109                                 && test -z "${cf_tst_cflags}" \
2110                                 && cf_fix_cppflags=yes
2111
2112                         if test $cf_fix_cppflags = yes ; then
2113                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2114                                 continue
2115                         elif test "${cf_tst_cflags}" = "\"'" ; then
2116                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2117                                 continue
2118                         fi
2119                         ;;
2120                 esac
2121                 case "$CPPFLAGS" in
2122                 *$cf_add_cflags) #(vi
2123                         ;;
2124                 *) #(vi
2125                         case $cf_add_cflags in #(vi
2126                         -D*)
2127                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2128                                 
2129 CPPFLAGS=`echo "$CPPFLAGS" | \
2130         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2131                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2132
2133                                 ;;
2134                         esac
2135                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2136                         ;;
2137                 esac
2138                 ;;
2139         *)
2140                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2141                 ;;
2142         esac
2143         ;;
2144 yes)
2145         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2146
2147         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2148
2149         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2150                 && test -z "${cf_tst_cflags}" \
2151                 && cf_fix_cppflags=no
2152         ;;
2153 esac
2154 done
2155
2156 if test -n "$cf_new_cflags" ; then
2157         
2158         CFLAGS="$CFLAGS $cf_new_cflags"
2159 fi
2160
2161 if test -n "$cf_new_cppflags" ; then
2162         
2163         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2164 fi
2165
2166 if test -n "$cf_new_extra_cppflags" ; then
2167         
2168         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2169 fi
2170
2171
2172
2173
2174         fi
2175         
2176 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2177
2178 cf_save_CFLAGS="$CFLAGS"
2179 cf_save_CPPFLAGS="$CPPFLAGS"
2180
2181
2182 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2183         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2184                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2185
2186
2187 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2188         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2189                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2190
2191
2192 echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
2193 echo "configure:2194: checking if we should define _POSIX_C_SOURCE" >&5
2194 if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
2195   echo $ac_n "(cached) $ac_c" 1>&6
2196 else
2197   
2198         
2199 echo "${as_me-configure}:2200: testing if the symbol is already defined go no further ..." 1>&5
2200
2201         cat > conftest.$ac_ext <<EOF
2202 #line 2203 "configure"
2203 #include "confdefs.h"
2204 #include <sys/types.h>
2205 int main() {
2206
2207 #ifndef _POSIX_C_SOURCE
2208 make an error
2209 #endif
2210 ; return 0; }
2211 EOF
2212 if { (eval echo configure:2213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2213   rm -rf conftest*
2214   cf_cv_posix_c_source=no
2215 else
2216   echo "configure: failed program was:" >&5
2217   cat conftest.$ac_ext >&5
2218   rm -rf conftest*
2219   cf_want_posix_source=no
2220          case .$cf_POSIX_C_SOURCE in #(vi
2221          .[12]??*) #(vi
2222                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2223                 ;;
2224          .2) #(vi
2225                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2226                 cf_want_posix_source=yes
2227                 ;;
2228          .*)
2229                 cf_want_posix_source=yes
2230                 ;;
2231          esac
2232          if test "$cf_want_posix_source" = yes ; then
2233                 cat > conftest.$ac_ext <<EOF
2234 #line 2235 "configure"
2235 #include "confdefs.h"
2236 #include <sys/types.h>
2237 int main() {
2238
2239 #ifdef _POSIX_SOURCE
2240 make an error
2241 #endif
2242 ; return 0; }
2243 EOF
2244 if { (eval echo configure:2245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2245   :
2246 else
2247   echo "configure: failed program was:" >&5
2248   cat conftest.$ac_ext >&5
2249   rm -rf conftest*
2250   cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
2251 fi
2252 rm -f conftest*
2253          fi
2254          
2255 echo "${as_me-configure}:2256: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
2256
2257          CFLAGS="$cf_trim_CFLAGS"
2258          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
2259          
2260 echo "${as_me-configure}:2261: testing if the second compile does not leave our definition intact error ..." 1>&5
2261
2262          cat > conftest.$ac_ext <<EOF
2263 #line 2264 "configure"
2264 #include "confdefs.h"
2265 #include <sys/types.h>
2266 int main() {
2267
2268 #ifndef _POSIX_C_SOURCE
2269 make an error
2270 #endif
2271 ; return 0; }
2272 EOF
2273 if { (eval echo configure:2274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2274   :
2275 else
2276   echo "configure: failed program was:" >&5
2277   cat conftest.$ac_ext >&5
2278   rm -rf conftest*
2279   cf_cv_posix_c_source=no
2280 fi
2281 rm -f conftest*
2282          CFLAGS="$cf_save_CFLAGS"
2283          CPPFLAGS="$cf_save_CPPFLAGS"
2284         
2285 fi
2286 rm -f conftest*
2287
2288 fi
2289
2290 echo "$ac_t""$cf_cv_posix_c_source" 1>&6
2291
2292 if test "$cf_cv_posix_c_source" != no ; then
2293         CFLAGS="$cf_trim_CFLAGS"
2294         CPPFLAGS="$cf_trim_CPPFLAGS"
2295         
2296 cf_fix_cppflags=no
2297 cf_new_cflags=
2298 cf_new_cppflags=
2299 cf_new_extra_cppflags=
2300
2301 for cf_add_cflags in $cf_cv_posix_c_source
2302 do
2303 case $cf_fix_cppflags in
2304 no)
2305         case $cf_add_cflags in #(vi
2306         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2307                 case $cf_add_cflags in
2308                 -D*)
2309                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2310
2311                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2312                                 && test -z "${cf_tst_cflags}" \
2313                                 && cf_fix_cppflags=yes
2314
2315                         if test $cf_fix_cppflags = yes ; then
2316                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2317                                 continue
2318                         elif test "${cf_tst_cflags}" = "\"'" ; then
2319                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2320                                 continue
2321                         fi
2322                         ;;
2323                 esac
2324                 case "$CPPFLAGS" in
2325                 *$cf_add_cflags) #(vi
2326                         ;;
2327                 *) #(vi
2328                         case $cf_add_cflags in #(vi
2329                         -D*)
2330                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2331                                 
2332 CPPFLAGS=`echo "$CPPFLAGS" | \
2333         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2334                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2335
2336                                 ;;
2337                         esac
2338                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2339                         ;;
2340                 esac
2341                 ;;
2342         *)
2343                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2344                 ;;
2345         esac
2346         ;;
2347 yes)
2348         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2349
2350         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2351
2352         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2353                 && test -z "${cf_tst_cflags}" \
2354                 && cf_fix_cppflags=no
2355         ;;
2356 esac
2357 done
2358
2359 if test -n "$cf_new_cflags" ; then
2360         
2361         CFLAGS="$CFLAGS $cf_new_cflags"
2362 fi
2363
2364 if test -n "$cf_new_cppflags" ; then
2365         
2366         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2367 fi
2368
2369 if test -n "$cf_new_extra_cppflags" ; then
2370         
2371         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2372 fi
2373
2374
2375
2376
2377 fi
2378
2379
2380         ;;
2381 esac
2382
2383 if test -n "$cf_xopen_source" ; then
2384         
2385 cf_fix_cppflags=no
2386 cf_new_cflags=
2387 cf_new_cppflags=
2388 cf_new_extra_cppflags=
2389
2390 for cf_add_cflags in $cf_xopen_source
2391 do
2392 case $cf_fix_cppflags in
2393 no)
2394         case $cf_add_cflags in #(vi
2395         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2396                 case $cf_add_cflags in
2397                 -D*)
2398                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2399
2400                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2401                                 && test -z "${cf_tst_cflags}" \
2402                                 && cf_fix_cppflags=yes
2403
2404                         if test $cf_fix_cppflags = yes ; then
2405                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2406                                 continue
2407                         elif test "${cf_tst_cflags}" = "\"'" ; then
2408                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2409                                 continue
2410                         fi
2411                         ;;
2412                 esac
2413                 case "$CPPFLAGS" in
2414                 *$cf_add_cflags) #(vi
2415                         ;;
2416                 *) #(vi
2417                         case $cf_add_cflags in #(vi
2418                         -D*)
2419                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2420                                 
2421 CPPFLAGS=`echo "$CPPFLAGS" | \
2422         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2423                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2424
2425                                 ;;
2426                         esac
2427                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2428                         ;;
2429                 esac
2430                 ;;
2431         *)
2432                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2433                 ;;
2434         esac
2435         ;;
2436 yes)
2437         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2438
2439         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2440
2441         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2442                 && test -z "${cf_tst_cflags}" \
2443                 && cf_fix_cppflags=no
2444         ;;
2445 esac
2446 done
2447
2448 if test -n "$cf_new_cflags" ; then
2449         
2450         CFLAGS="$CFLAGS $cf_new_cflags"
2451 fi
2452
2453 if test -n "$cf_new_cppflags" ; then
2454         
2455         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2456 fi
2457
2458 if test -n "$cf_new_extra_cppflags" ; then
2459         
2460         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2461 fi
2462
2463
2464
2465
2466 fi
2467
2468 echo $ac_n "checking for working const""... $ac_c" 1>&6
2469 echo "configure:2470: checking for working const" >&5
2470 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
2471   echo $ac_n "(cached) $ac_c" 1>&6
2472 else
2473   cat > conftest.$ac_ext <<EOF
2474 #line 2475 "configure"
2475 #include "confdefs.h"
2476
2477 int main() {
2478
2479 /* Ultrix mips cc rejects this.  */
2480 typedef int charset[2]; const charset x;
2481 /* SunOS 4.1.1 cc rejects this.  */
2482 char const *const *ccp;
2483 char **p;
2484 /* NEC SVR4.0.2 mips cc rejects this.  */
2485 struct point {int x, y;};
2486 static struct point const zero = {0,0};
2487 /* AIX XL C 1.02.0.0 rejects this.
2488    It does not let you subtract one const X* pointer from another in an arm
2489    of an if-expression whose if-part is not a constant expression */
2490 const char *g = "string";
2491 ccp = &g + (g ? g-g : 0);
2492 /* HPUX 7.0 cc rejects these. */
2493 ++ccp;
2494 p = (char**) ccp;
2495 ccp = (char const *const *) p;
2496 { /* SCO 3.2v4 cc rejects this.  */
2497   char *t;
2498   char const *s = 0 ? (char *) 0 : (char const *) 0;
2499
2500   *t++ = 0;
2501 }
2502 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
2503   int x[] = {25, 17};
2504   const int *foo = &x[0];
2505   ++foo;
2506 }
2507 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
2508   typedef const int *iptr;
2509   iptr p = 0;
2510   ++p;
2511 }
2512 { /* AIX XL C 1.02.0.0 rejects this saying
2513      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
2514   struct s { int j; const int *ap[3]; };
2515   struct s *b; b->j = 5;
2516 }
2517 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
2518   const int foo = 10;
2519 }
2520
2521 ; return 0; }
2522 EOF
2523 if { (eval echo configure:2524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2524   rm -rf conftest*
2525   ac_cv_c_const=yes
2526 else
2527   echo "configure: failed program was:" >&5
2528   cat conftest.$ac_ext >&5
2529   rm -rf conftest*
2530   ac_cv_c_const=no
2531 fi
2532 rm -f conftest*
2533 fi
2534
2535 echo "$ac_t""$ac_cv_c_const" 1>&6
2536 if test $ac_cv_c_const = no; then
2537   cat >> confdefs.h <<\EOF
2538 #define const 
2539 EOF
2540
2541 fi
2542
2543
2544 echo $ac_n "checking for signal global datatype""... $ac_c" 1>&6
2545 echo "configure:2546: checking for signal global datatype" >&5
2546 if eval "test \"`echo '$''{'cf_cv_sig_atomic_t'+set}'`\" = set"; then
2547   echo $ac_n "(cached) $ac_c" 1>&6
2548 else
2549   
2550         for cf_type in \
2551                 "volatile sig_atomic_t" \
2552                 "sig_atomic_t" \
2553                 "int"
2554         do
2555         cat > conftest.$ac_ext <<EOF
2556 #line 2557 "configure"
2557 #include "confdefs.h"
2558
2559 #include <sys/types.h>
2560 #include <signal.h>
2561 #include <stdio.h>
2562
2563 extern $cf_type x;
2564 $cf_type x;
2565 static void handler(int sig)
2566 {
2567         x = 5;
2568 }
2569 int main() {
2570 signal(SIGINT, handler);
2571                  x = 1
2572 ; return 0; }
2573 EOF
2574 if { (eval echo configure:2575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2575   rm -rf conftest*
2576   cf_cv_sig_atomic_t=$cf_type
2577 else
2578   echo "configure: failed program was:" >&5
2579   cat conftest.$ac_ext >&5
2580   rm -rf conftest*
2581   cf_cv_sig_atomic_t=no
2582 fi
2583 rm -f conftest*
2584                 test "$cf_cv_sig_atomic_t" != no && break
2585         done
2586         
2587 fi
2588
2589 echo "$ac_t""$cf_cv_sig_atomic_t" 1>&6
2590 test "$cf_cv_sig_atomic_t" != no && cat >> confdefs.h <<EOF
2591 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
2592 EOF
2593
2594
2595
2596
2597 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
2598 echo "configure:2599: checking if you want to see long compiling messages" >&5
2599
2600 # Check whether --enable-echo or --disable-echo was given.
2601 if test "${enable_echo+set}" = set; then
2602   enableval="$enable_echo"
2603   test "$enableval" != no && enableval=yes
2604   if test "$enableval" != "yes" ; then
2605     
2606     ECHO_LT='--silent'
2607     ECHO_LD='@echo linking $@;'
2608     RULE_CC='@echo compiling $<'
2609     SHOW_CC='@echo compiling $@'
2610     ECHO_CC='@'
2611  
2612   else
2613     
2614     ECHO_LT=''
2615     ECHO_LD=''
2616     RULE_CC=''
2617     SHOW_CC=''
2618     ECHO_CC=''
2619
2620   fi
2621 else
2622   enableval=yes 
2623   
2624     ECHO_LT=''
2625     ECHO_LD=''
2626     RULE_CC=''
2627     SHOW_CC=''
2628     ECHO_CC=''
2629
2630   
2631 fi
2632
2633 echo "$ac_t""$enableval" 1>&6
2634
2635
2636
2637
2638
2639
2640
2641
2642 GCC_VERSION=none
2643 if test "$GCC" = yes ; then
2644         echo $ac_n "checking version of $CC""... $ac_c" 1>&6
2645 echo "configure:2646: checking version of $CC" >&5
2646         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
2647         test -z "$GCC_VERSION" && GCC_VERSION=unknown
2648         echo "$ac_t""$GCC_VERSION" 1>&6
2649 fi
2650
2651
2652 if ( test "$GCC" = yes || test "$GXX" = yes )
2653 then
2654 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
2655 echo "configure:2656: checking if you want to turn on gcc warnings" >&5
2656
2657 # Check whether --enable-warnings or --disable-warnings was given.
2658 if test "${enable_warnings+set}" = set; then
2659   enableval="$enable_warnings"
2660   test "$enableval" != yes && enableval=no
2661   if test "$enableval" != "no" ; then
2662     with_warnings=yes 
2663   else
2664     with_warnings=no
2665   fi
2666 else
2667   enableval=no 
2668   with_warnings=no
2669   
2670 fi
2671
2672 echo "$ac_t""$with_warnings" 1>&6
2673 if test "$with_warnings" = "yes"
2674 then
2675         
2676 if test "$GCC" = yes
2677 then
2678 cat > conftest.i <<EOF
2679 #ifndef GCC_PRINTF
2680 #define GCC_PRINTF 0
2681 #endif
2682 #ifndef GCC_SCANF
2683 #define GCC_SCANF 0
2684 #endif
2685 #ifndef GCC_NORETURN
2686 #define GCC_NORETURN /* nothing */
2687 #endif
2688 #ifndef GCC_UNUSED
2689 #define GCC_UNUSED /* nothing */
2690 #endif
2691 EOF
2692 if test "$GCC" = yes
2693 then
2694         echo "checking for $CC __attribute__ directives" 1>&6
2695 echo "configure:2696: checking for $CC __attribute__ directives" >&5
2696 cat > conftest.$ac_ext <<EOF
2697 #line 2698 "${as_me-configure}"
2698 #include "confdefs.h"
2699 #include "conftest.h"
2700 #include "conftest.i"
2701 #if     GCC_PRINTF
2702 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2703 #else
2704 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2705 #endif
2706 #if     GCC_SCANF
2707 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2708 #else
2709 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2710 #endif
2711 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2712 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2713 extern void foo(void) GCC_NORETURN;
2714 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2715 EOF
2716         cf_printf_attribute=no
2717         cf_scanf_attribute=no
2718         for cf_attribute in scanf printf unused noreturn
2719         do
2720                 
2721 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2722
2723                 cf_directive="__attribute__(($cf_attribute))"
2724                 echo "checking for $CC $cf_directive" 1>&5
2725
2726                 case $cf_attribute in #(vi
2727                 printf) #(vi
2728                         cf_printf_attribute=yes
2729                         cat >conftest.h <<EOF
2730 #define GCC_$cf_ATTRIBUTE 1
2731 EOF
2732                         ;;
2733                 scanf) #(vi
2734                         cf_scanf_attribute=yes
2735                         cat >conftest.h <<EOF
2736 #define GCC_$cf_ATTRIBUTE 1
2737 EOF
2738                         ;;
2739                 *) #(vi
2740                         cat >conftest.h <<EOF
2741 #define GCC_$cf_ATTRIBUTE $cf_directive
2742 EOF
2743                         ;;
2744                 esac
2745
2746                 if { (eval echo configure:2747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2747                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
2748                         cat conftest.h >>confdefs.h
2749                         case $cf_attribute in #(vi
2750                         printf) #(vi
2751                                 if test "$cf_printf_attribute" = no ; then
2752                                         cat >>confdefs.h <<EOF
2753 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
2754 EOF
2755                                 else
2756                                         cat >>confdefs.h <<EOF
2757 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2758 EOF
2759                                 fi
2760                                 ;;
2761                         scanf) #(vi
2762                                 if test "$cf_scanf_attribute" = no ; then
2763                                         cat >>confdefs.h <<EOF
2764 #define GCC_SCANFLIKE(fmt,var) /* nothing */
2765 EOF
2766                                 else
2767                                         cat >>confdefs.h <<EOF
2768 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2769 EOF
2770                                 fi
2771                                 ;;
2772                         esac
2773                 fi
2774         done
2775 else
2776         fgrep define conftest.i >>confdefs.h
2777 fi
2778 rm -rf conftest*
2779 fi
2780
2781         
2782
2783
2784 INTEL_COMPILER=no
2785
2786 if test "$GCC" = yes ; then
2787         case $host_os in
2788         linux*|gnu*)
2789                 echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
2790 echo "configure:2791: checking if this is really Intel C compiler" >&5
2791                 cf_save_CFLAGS="$CFLAGS"
2792                 CFLAGS="$CFLAGS -no-gcc"
2793                 cat > conftest.$ac_ext <<EOF
2794 #line 2795 "configure"
2795 #include "confdefs.h"
2796
2797 int main() {
2798
2799 #ifdef __INTEL_COMPILER
2800 #else
2801 make an error
2802 #endif
2803
2804 ; return 0; }
2805 EOF
2806 if { (eval echo configure:2807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2807   rm -rf conftest*
2808   INTEL_COMPILER=yes
2809 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
2810
2811 else
2812   echo "configure: failed program was:" >&5
2813   cat conftest.$ac_ext >&5
2814 fi
2815 rm -f conftest*
2816                 CFLAGS="$cf_save_CFLAGS"
2817                 echo "$ac_t""$INTEL_COMPILER" 1>&6
2818                 ;;
2819         esac
2820 fi
2821
2822
2823 cat > conftest.$ac_ext <<EOF
2824 #line 2825 "${as_me-configure}"
2825 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
2826 EOF
2827
2828 if test "$INTEL_COMPILER" = yes
2829 then
2830 # The "-wdXXX" options suppress warnings:
2831 # remark #1419: external declaration in primary source file
2832 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
2833 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
2834 # remark #193: zero used for undefined preprocessing identifier
2835 # remark #593: variable "curs_sb_left_arrow" was set but never used
2836 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
2837 # remark #869: parameter "tw" was never referenced
2838 # remark #981: operands are evaluated in unspecified order
2839 # warning #279: controlling expression is constant
2840
2841         echo "checking for $CC warning options" 1>&6
2842 echo "configure:2843: checking for $CC warning options" >&5
2843         cf_save_CFLAGS="$CFLAGS"
2844         EXTRA_CFLAGS="-Wall"
2845         for cf_opt in \
2846                 wd1419 \
2847                 wd1683 \
2848                 wd1684 \
2849                 wd193 \
2850                 wd593 \
2851                 wd279 \
2852                 wd810 \
2853                 wd869 \
2854                 wd981
2855         do
2856                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2857                 if { (eval echo configure:2858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2858                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
2859                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2860                 fi
2861         done
2862         CFLAGS="$cf_save_CFLAGS"
2863
2864 elif test "$GCC" = yes
2865 then
2866         echo "checking for $CC warning options" 1>&6
2867 echo "configure:2868: checking for $CC warning options" >&5
2868         cf_save_CFLAGS="$CFLAGS"
2869         EXTRA_CFLAGS=
2870         cf_warn_CONST=""
2871         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
2872         for cf_opt in W Wall \
2873                 Wbad-function-cast \
2874                 Wcast-align \
2875                 Wcast-qual \
2876                 Winline \
2877                 Wmissing-declarations \
2878                 Wmissing-prototypes \
2879                 Wnested-externs \
2880                 Wpointer-arith \
2881                 Wshadow \
2882                 Wstrict-prototypes \
2883                 Wundef $cf_warn_CONST 
2884         do
2885                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2886                 if { (eval echo configure:2887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2887                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
2888                         case $cf_opt in #(vi
2889                         Wcast-qual) #(vi
2890                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
2891                                 ;;
2892                         Winline) #(vi
2893                                 case $GCC_VERSION in
2894                                 [34].*)
2895                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
2896
2897 echo "${as_me-configure}:2898: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
2898
2899
2900                                         continue;;
2901                                 esac
2902                                 ;;
2903                         esac
2904                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2905                 fi
2906         done
2907         CFLAGS="$cf_save_CFLAGS"
2908 fi
2909 rm -f conftest*
2910
2911
2912
2913 fi
2914 fi
2915
2916
2917
2918
2919 # Check whether --with-curses-dir or --without-curses-dir was given.
2920 if test "${with_curses_dir+set}" = set; then
2921   withval="$with_curses_dir"
2922   
2923 if test "x$prefix" != xNONE; then
2924   cf_path_syntax="$prefix"
2925 else
2926   cf_path_syntax="$ac_default_prefix"
2927 fi
2928
2929 case ".$withval" in #(vi
2930 .\$\(*\)*|.\'*\'*) #(vi
2931   ;;
2932 ..|./*|.\\*) #(vi
2933   ;;
2934 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2935   ;;
2936 .\${*prefix}*) #(vi
2937   eval withval="$withval"
2938   case ".$withval" in #(vi
2939   .NONE/*)
2940     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2941     ;;
2942   esac
2943   ;; #(vi
2944 .no|.NONE/*)
2945   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2946   ;;
2947 *)
2948   { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
2949   ;;
2950 esac
2951
2952          cf_cv_curses_dir=$withval
2953 else
2954   cf_cv_curses_dir=no
2955 fi
2956
2957
2958
2959
2960 # Check whether --with-5lib or --without-5lib was given.
2961 if test "${with_5lib+set}" = set; then
2962   withval="$with_5lib"
2963   LIBS="-L/usr/5lib $LIBS"
2964          CPPFLAGS="$CPPFLAGS -I/usr/5include"
2965 fi
2966
2967
2968
2969 # Check whether --with-ncursesw or --without-ncursesw was given.
2970 if test "${with_ncursesw+set}" = set; then
2971   withval="$with_ncursesw"
2972   cf_cv_screen=ncursesw
2973 else
2974   
2975
2976
2977 # Check whether --with-ncurses or --without-ncurses was given.
2978 if test "${with_ncurses+set}" = set; then
2979   withval="$with_ncurses"
2980   cf_cv_screen=ncurses
2981 else
2982   
2983
2984
2985 # Check whether --with-pdcurses or --without-pdcurses was given.
2986 if test "${with_pdcurses+set}" = set; then
2987   withval="$with_pdcurses"
2988   cf_cv_screen=pdcurses
2989 fi
2990
2991 fi
2992
2993 fi
2994
2995
2996 case $cf_cv_screen in
2997 curses)
2998         
2999
3000
3001 echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
3002 echo "configure:3003: checking for extra include directories" >&5
3003 if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
3004   echo $ac_n "(cached) $ac_c" 1>&6
3005 else
3006   
3007 cf_cv_curses_incdir=no
3008 case $host_os in #(vi
3009 hpux10.*) #(vi
3010         test -d /usr/include/curses_colr && \
3011         cf_cv_curses_incdir="-I/usr/include/curses_colr"
3012         ;;
3013 sunos3*|sunos4*)
3014         test -d /usr/5lib && \
3015         test -d /usr/5include && \
3016         cf_cv_curses_incdir="-I/usr/5include"
3017         ;;
3018 esac
3019
3020 fi
3021
3022 echo "$ac_t""$cf_cv_curses_incdir" 1>&6
3023 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
3024
3025
3026 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
3027 echo "configure:3028: checking if we have identified curses headers" >&5
3028 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
3029   echo $ac_n "(cached) $ac_c" 1>&6
3030 else
3031   
3032 cf_cv_ncurses_header=none
3033 for cf_header in  \
3034         curses.h \
3035         ncurses.h ncurses/curses.h ncurses/ncurses.h
3036 do
3037 cat > conftest.$ac_ext <<EOF
3038 #line 3039 "configure"
3039 #include "confdefs.h"
3040 #include <${cf_header}>
3041 int main() {
3042 initscr(); tgoto("?", 0,0)
3043 ; return 0; }
3044 EOF
3045 if { (eval echo configure:3046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3046   rm -rf conftest*
3047   cf_cv_ncurses_header=$cf_header; break
3048 else
3049   echo "configure: failed program was:" >&5
3050   cat conftest.$ac_ext >&5
3051 fi
3052 rm -f conftest*
3053 done
3054
3055 fi
3056
3057 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
3058
3059 if test "$cf_cv_ncurses_header" = none ; then
3060         { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
3061 fi
3062
3063 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
3064 for ac_hdr in $cf_cv_ncurses_header
3065 do
3066 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3067 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3068 echo "configure:3069: checking for $ac_hdr" >&5
3069 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3070   echo $ac_n "(cached) $ac_c" 1>&6
3071 else
3072   cat > conftest.$ac_ext <<EOF
3073 #line 3074 "configure"
3074 #include "confdefs.h"
3075 #include <$ac_hdr>
3076 EOF
3077 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3078 { (eval echo configure:3079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3079 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3080 if test -z "$ac_err"; then
3081   rm -rf conftest*
3082   eval "ac_cv_header_$ac_safe=yes"
3083 else
3084   echo "$ac_err" >&5
3085   echo "configure: failed program was:" >&5
3086   cat conftest.$ac_ext >&5
3087   rm -rf conftest*
3088   eval "ac_cv_header_$ac_safe=no"
3089 fi
3090 rm -f conftest*
3091 fi
3092 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3093   echo "$ac_t""yes" 1>&6
3094     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3095   cat >> confdefs.h <<EOF
3096 #define $ac_tr_hdr 1
3097 EOF
3098  
3099 else
3100   echo "$ac_t""no" 1>&6
3101 fi
3102 done
3103
3104
3105
3106 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
3107 echo "configure:3108: checking for terminfo header" >&5
3108 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
3109   echo $ac_n "(cached) $ac_c" 1>&6
3110 else
3111   
3112 case ${cf_cv_ncurses_header} in #(vi
3113 */ncurses.h|*/ncursesw.h) #(vi
3114         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
3115         ;;
3116 *)
3117         cf_term_header=term.h
3118         ;;
3119 esac
3120
3121 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
3122 do
3123 cat > conftest.$ac_ext <<EOF
3124 #line 3125 "configure"
3125 #include "confdefs.h"
3126 #include <stdio.h>
3127 #include <${cf_cv_ncurses_header-curses.h}>
3128 #include <$cf_test>
3129
3130 int main() {
3131 int x = auto_left_margin
3132 ; return 0; }
3133 EOF
3134 if { (eval echo configure:3135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3135   rm -rf conftest*
3136   
3137         cf_cv_term_header="$cf_test"
3138 else
3139   echo "configure: failed program was:" >&5
3140   cat conftest.$ac_ext >&5
3141   rm -rf conftest*
3142   
3143         cf_cv_term_header=unknown
3144         
3145 fi
3146 rm -f conftest*
3147         test "$cf_cv_term_header" != unknown && break
3148 done
3149
3150 fi
3151
3152 echo "$ac_t""$cf_cv_term_header" 1>&6
3153
3154 # Set definitions to allow ifdef'ing to accommodate subdirectories
3155
3156 case $cf_cv_term_header in # (vi
3157 *term.h)
3158         cat >> confdefs.h <<\EOF
3159 #define HAVE_TERM_H 1
3160 EOF
3161
3162         ;;
3163 esac
3164
3165 case $cf_cv_term_header in # (vi
3166 ncurses/term.h) #(vi
3167         cat >> confdefs.h <<\EOF
3168 #define HAVE_NCURSES_TERM_H 1
3169 EOF
3170
3171         ;;
3172 ncursesw/term.h)
3173         cat >> confdefs.h <<\EOF
3174 #define HAVE_NCURSESW_TERM_H 1
3175 EOF
3176
3177         ;;
3178 esac
3179
3180
3181
3182 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
3183 echo "configure:3184: checking for ncurses version" >&5
3184 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
3185   echo $ac_n "(cached) $ac_c" 1>&6
3186 else
3187   
3188         cf_cv_ncurses_version=no
3189         cf_tempfile=out$$
3190         rm -f $cf_tempfile
3191         if test "$cross_compiling" = yes; then
3192   
3193
3194         # This will not work if the preprocessor splits the line after the
3195         # Autoconf token.  The 'unproto' program does that.
3196         cat > conftest.$ac_ext <<EOF
3197 #include <${cf_cv_ncurses_header-curses.h}>
3198 #undef Autoconf
3199 #ifdef NCURSES_VERSION
3200 Autoconf NCURSES_VERSION
3201 #else
3202 #ifdef __NCURSES_H
3203 Autoconf "old"
3204 #endif
3205 ;
3206 #endif
3207 EOF
3208         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
3209         { (eval echo configure:3210: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
3210         if test -f conftest.out ; then
3211                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
3212                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
3213                 rm -f conftest.out
3214         fi
3215
3216 else
3217   cat > conftest.$ac_ext <<EOF
3218 #line 3219 "configure"
3219 #include "confdefs.h"
3220
3221 #include <${cf_cv_ncurses_header-curses.h}>
3222 #include <stdio.h>
3223 int main()
3224 {
3225         FILE *fp = fopen("$cf_tempfile", "w");
3226 #ifdef NCURSES_VERSION
3227 # ifdef NCURSES_VERSION_PATCH
3228         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
3229 # else
3230         fprintf(fp, "%s\n", NCURSES_VERSION);
3231 # endif
3232 #else
3233 # ifdef __NCURSES_H
3234         fprintf(fp, "old\n");
3235 # else
3236         make an error
3237 # endif
3238 #endif
3239         ${cf_cv_main_return-return}(0);
3240 }
3241 EOF
3242 if { (eval echo configure:3243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3243 then
3244   
3245         cf_cv_ncurses_version=`cat $cf_tempfile`
3246 else
3247   echo "configure: failed program was:" >&5
3248   cat conftest.$ac_ext >&5
3249 fi
3250 rm -fr conftest*
3251 fi
3252
3253         rm -f $cf_tempfile
3254
3255 fi
3256
3257 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
3258 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
3259 #define NCURSES 1
3260 EOF
3261
3262
3263
3264
3265 echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
3266 echo "configure:3267: checking if we have identified curses libraries" >&5
3267 cat > conftest.$ac_ext <<EOF
3268 #line 3269 "configure"
3269 #include "confdefs.h"
3270 #include <${cf_cv_ncurses_header-curses.h}>
3271 int main() {
3272 initscr(); tgoto("?", 0,0)
3273 ; return 0; }
3274 EOF
3275 if { (eval echo configure:3276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3276   rm -rf conftest*
3277   cf_result=yes
3278 else
3279   echo "configure: failed program was:" >&5
3280   cat conftest.$ac_ext >&5
3281   rm -rf conftest*
3282   cf_result=no
3283 fi
3284 rm -f conftest*
3285 echo "$ac_t""$cf_result" 1>&6
3286
3287 if test "$cf_result" = no ; then
3288 case $host_os in #(vi
3289 freebsd*) #(vi
3290     echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
3291 echo "configure:3292: checking for tgoto in -lmytinfo" >&5
3292 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
3293 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3294   echo $ac_n "(cached) $ac_c" 1>&6
3295 else
3296   ac_save_LIBS="$LIBS"
3297 LIBS="-lmytinfo  $LIBS"
3298 cat > conftest.$ac_ext <<EOF
3299 #line 3300 "configure"
3300 #include "confdefs.h"
3301 /* Override any gcc2 internal prototype to avoid an error.  */
3302 /* We use char because int might match the return type of a gcc2
3303     builtin and then its argument prototype would still apply.  */
3304 char tgoto();
3305
3306 int main() {
3307 tgoto()
3308 ; return 0; }
3309 EOF
3310 if { (eval echo configure:3311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3311   rm -rf conftest*
3312   eval "ac_cv_lib_$ac_lib_var=yes"
3313 else
3314   echo "configure: failed program was:" >&5
3315   cat conftest.$ac_ext >&5
3316   rm -rf conftest*
3317   eval "ac_cv_lib_$ac_lib_var=no"
3318 fi
3319 rm -f conftest*
3320 LIBS="$ac_save_LIBS"
3321
3322 fi
3323 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3324   echo "$ac_t""yes" 1>&6
3325   LIBS="-lmytinfo $LIBS"
3326 else
3327   echo "$ac_t""no" 1>&6
3328 fi
3329
3330     ;;
3331 hpux10.*) #(vi
3332     echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
3333 echo "configure:3334: checking for initscr in -lcur_colr" >&5
3334 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
3335 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3336   echo $ac_n "(cached) $ac_c" 1>&6
3337 else
3338   ac_save_LIBS="$LIBS"
3339 LIBS="-lcur_colr  $LIBS"
3340 cat > conftest.$ac_ext <<EOF
3341 #line 3342 "configure"
3342 #include "confdefs.h"
3343 /* Override any gcc2 internal prototype to avoid an error.  */
3344 /* We use char because int might match the return type of a gcc2
3345     builtin and then its argument prototype would still apply.  */
3346 char initscr();
3347
3348 int main() {
3349 initscr()
3350 ; return 0; }
3351 EOF
3352 if { (eval echo configure:3353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3353   rm -rf conftest*
3354   eval "ac_cv_lib_$ac_lib_var=yes"
3355 else
3356   echo "configure: failed program was:" >&5
3357   cat conftest.$ac_ext >&5
3358   rm -rf conftest*
3359   eval "ac_cv_lib_$ac_lib_var=no"
3360 fi
3361 rm -f conftest*
3362 LIBS="$ac_save_LIBS"
3363
3364 fi
3365 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3366   echo "$ac_t""yes" 1>&6
3367   
3368         LIBS="-lcur_colr $LIBS"
3369         ac_cv_func_initscr=yes
3370         
3371 else
3372   echo "$ac_t""no" 1>&6
3373
3374     echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
3375 echo "configure:3376: checking for initscr in -lHcurses" >&5
3376 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
3377 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3378   echo $ac_n "(cached) $ac_c" 1>&6
3379 else
3380   ac_save_LIBS="$LIBS"
3381 LIBS="-lHcurses  $LIBS"
3382 cat > conftest.$ac_ext <<EOF
3383 #line 3384 "configure"
3384 #include "confdefs.h"
3385 /* Override any gcc2 internal prototype to avoid an error.  */
3386 /* We use char because int might match the return type of a gcc2
3387     builtin and then its argument prototype would still apply.  */
3388 char initscr();
3389
3390 int main() {
3391 initscr()
3392 ; return 0; }
3393 EOF
3394 if { (eval echo configure:3395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3395   rm -rf conftest*
3396   eval "ac_cv_lib_$ac_lib_var=yes"
3397 else
3398   echo "configure: failed program was:" >&5
3399   cat conftest.$ac_ext >&5
3400   rm -rf conftest*
3401   eval "ac_cv_lib_$ac_lib_var=no"
3402 fi
3403 rm -f conftest*
3404 LIBS="$ac_save_LIBS"
3405
3406 fi
3407 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3408   echo "$ac_t""yes" 1>&6
3409   
3410         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
3411         LIBS="-lHcurses $LIBS"
3412         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
3413         ac_cv_func_initscr=yes
3414         
3415 else
3416   echo "$ac_t""no" 1>&6
3417 fi
3418
3419 fi
3420
3421     ;;
3422 linux*) # Suse Linux does not follow /usr/lib convention
3423     
3424 if test -n "/lib" ; then
3425   for cf_add_libdir in /lib
3426   do
3427     if test $cf_add_libdir = /usr/lib ; then
3428       :
3429     elif test -d $cf_add_libdir
3430     then
3431       cf_have_libdir=no
3432       if test -n "$LDFLAGS$LIBS" ; then
3433         # a loop is needed to ensure we can add subdirs of existing dirs
3434         for cf_test_libdir in $LDFLAGS $LIBS ; do
3435           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3436             cf_have_libdir=yes; break
3437           fi
3438         done
3439       fi
3440       if test "$cf_have_libdir" = no ; then
3441         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3442
3443 echo "${as_me-configure}:3444: testing adding $cf_add_libdir to library-path ..." 1>&5
3444
3445
3446         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3447       fi
3448     fi
3449   done
3450 fi
3451
3452     ;;
3453 sunos3*|sunos4*)
3454     if test -d /usr/5lib ; then
3455       
3456 if test -n "/usr/5lib" ; then
3457   for cf_add_libdir in /usr/5lib
3458   do
3459     if test $cf_add_libdir = /usr/lib ; then
3460       :
3461     elif test -d $cf_add_libdir
3462     then
3463       cf_have_libdir=no
3464       if test -n "$LDFLAGS$LIBS" ; then
3465         # a loop is needed to ensure we can add subdirs of existing dirs
3466         for cf_test_libdir in $LDFLAGS $LIBS ; do
3467           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3468             cf_have_libdir=yes; break
3469           fi
3470         done
3471       fi
3472       if test "$cf_have_libdir" = no ; then
3473         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3474
3475 echo "${as_me-configure}:3476: testing adding $cf_add_libdir to library-path ..." 1>&5
3476
3477
3478         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3479       fi
3480     fi
3481   done
3482 fi
3483
3484       LIBS="$LIBS -lcurses -ltermcap"
3485     fi
3486     ac_cv_func_initscr=yes
3487     ;;
3488 esac
3489
3490 if test ".$ac_cv_func_initscr" != .yes ; then
3491     cf_save_LIBS="$LIBS"
3492     cf_term_lib=""
3493     cf_curs_lib=""
3494
3495     if test ".${cf_cv_ncurses_version-no}" != .no
3496     then
3497         cf_check_list="ncurses curses cursesX"
3498     else
3499         cf_check_list="cursesX curses ncurses"
3500     fi
3501
3502     # Check for library containing tgoto.  Do this before curses library
3503     # because it may be needed to link the test-case for initscr.
3504     echo $ac_n "checking for tgoto""... $ac_c" 1>&6
3505 echo "configure:3506: checking for tgoto" >&5
3506 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
3507   echo $ac_n "(cached) $ac_c" 1>&6
3508 else
3509   cat > conftest.$ac_ext <<EOF
3510 #line 3511 "configure"
3511 #include "confdefs.h"
3512 /* System header to define __stub macros and hopefully few prototypes,
3513     which can conflict with char tgoto(); below.  */
3514 #include <assert.h>
3515 /* Override any gcc2 internal prototype to avoid an error.  */
3516 /* We use char because int might match the return type of a gcc2
3517     builtin and then its argument prototype would still apply.  */
3518 char tgoto();
3519
3520 int main() {
3521
3522 /* The GNU C library defines this for functions which it implements
3523     to always fail with ENOSYS.  Some functions are actually named
3524     something starting with __ and the normal name is an alias.  */
3525 #if defined (__stub_tgoto) || defined (__stub___tgoto)
3526 choke me
3527 #else
3528 tgoto();
3529 #endif
3530
3531 ; return 0; }
3532 EOF
3533 if { (eval echo configure:3534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3534   rm -rf conftest*
3535   eval "ac_cv_func_tgoto=yes"
3536 else
3537   echo "configure: failed program was:" >&5
3538   cat conftest.$ac_ext >&5
3539   rm -rf conftest*
3540   eval "ac_cv_func_tgoto=no"
3541 fi
3542 rm -f conftest*
3543 fi
3544
3545 if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
3546   echo "$ac_t""yes" 1>&6
3547   cf_term_lib=predefined
3548 else
3549   echo "$ac_t""no" 1>&6
3550
3551         for cf_term_lib in $cf_check_list termcap termlib unknown
3552         do
3553             echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
3554 echo "configure:3555: checking for tgoto in -l$cf_term_lib" >&5
3555 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
3556 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3557   echo $ac_n "(cached) $ac_c" 1>&6
3558 else
3559   ac_save_LIBS="$LIBS"
3560 LIBS="-l$cf_term_lib  $LIBS"
3561 cat > conftest.$ac_ext <<EOF
3562 #line 3563 "configure"
3563 #include "confdefs.h"
3564 /* Override any gcc2 internal prototype to avoid an error.  */
3565 /* We use char because int might match the return type of a gcc2
3566     builtin and then its argument prototype would still apply.  */
3567 char tgoto();
3568
3569 int main() {
3570 tgoto()
3571 ; return 0; }
3572 EOF
3573 if { (eval echo configure:3574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3574   rm -rf conftest*
3575   eval "ac_cv_lib_$ac_lib_var=yes"
3576 else
3577   echo "configure: failed program was:" >&5
3578   cat conftest.$ac_ext >&5
3579   rm -rf conftest*
3580   eval "ac_cv_lib_$ac_lib_var=no"
3581 fi
3582 rm -f conftest*
3583 LIBS="$ac_save_LIBS"
3584
3585 fi
3586 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3587   echo "$ac_t""yes" 1>&6
3588   break
3589 else
3590   echo "$ac_t""no" 1>&6
3591 fi
3592
3593         done
3594     
3595 fi
3596
3597
3598     # Check for library containing initscr
3599     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
3600         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
3601     do
3602         echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
3603 echo "configure:3604: checking for initscr in -l$cf_curs_lib" >&5
3604 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
3605 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3606   echo $ac_n "(cached) $ac_c" 1>&6
3607 else
3608   ac_save_LIBS="$LIBS"
3609 LIBS="-l$cf_curs_lib  $LIBS"
3610 cat > conftest.$ac_ext <<EOF
3611 #line 3612 "configure"
3612 #include "confdefs.h"
3613 /* Override any gcc2 internal prototype to avoid an error.  */
3614 /* We use char because int might match the return type of a gcc2
3615     builtin and then its argument prototype would still apply.  */
3616 char initscr();
3617
3618 int main() {
3619 initscr()
3620 ; return 0; }
3621 EOF
3622 if { (eval echo configure:3623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3623   rm -rf conftest*
3624   eval "ac_cv_lib_$ac_lib_var=yes"
3625 else
3626   echo "configure: failed program was:" >&5
3627   cat conftest.$ac_ext >&5
3628   rm -rf conftest*
3629   eval "ac_cv_lib_$ac_lib_var=no"
3630 fi
3631 rm -f conftest*
3632 LIBS="$ac_save_LIBS"
3633
3634 fi
3635 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3636   echo "$ac_t""yes" 1>&6
3637   break
3638 else
3639   echo "$ac_t""no" 1>&6
3640 fi
3641
3642     done
3643     test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
3644
3645     LIBS="-l$cf_curs_lib $cf_save_LIBS"
3646     if test "$cf_term_lib" = unknown ; then
3647         echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
3648 echo "configure:3649: checking if we can link with $cf_curs_lib library" >&5
3649         cat > conftest.$ac_ext <<EOF
3650 #line 3651 "configure"
3651 #include "confdefs.h"
3652 #include <${cf_cv_ncurses_header-curses.h}>
3653 int main() {
3654 initscr()
3655 ; return 0; }
3656 EOF
3657 if { (eval echo configure:3658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3658   rm -rf conftest*
3659   cf_result=yes
3660 else
3661   echo "configure: failed program was:" >&5
3662   cat conftest.$ac_ext >&5
3663   rm -rf conftest*
3664   cf_result=no
3665 fi
3666 rm -f conftest*
3667         echo "$ac_t""$cf_result" 1>&6
3668         test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
3669     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
3670         :
3671     elif test "$cf_term_lib" != predefined ; then
3672         echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
3673 echo "configure:3674: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
3674         cat > conftest.$ac_ext <<EOF
3675 #line 3676 "configure"
3676 #include "confdefs.h"
3677 #include <${cf_cv_ncurses_header-curses.h}>
3678 int main() {
3679 initscr(); tgoto((char *)0, 0, 0);
3680 ; return 0; }
3681 EOF
3682 if { (eval echo configure:3683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3683   rm -rf conftest*
3684   cf_result=no
3685 else
3686   echo "configure: failed program was:" >&5
3687   cat conftest.$ac_ext >&5
3688   rm -rf conftest*
3689   
3690             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
3691             cat > conftest.$ac_ext <<EOF
3692 #line 3693 "configure"
3693 #include "confdefs.h"
3694 #include <${cf_cv_ncurses_header-curses.h}>
3695 int main() {
3696 initscr()
3697 ; return 0; }
3698 EOF
3699 if { (eval echo configure:3700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3700   rm -rf conftest*
3701   cf_result=yes
3702 else
3703   echo "configure: failed program was:" >&5
3704   cat conftest.$ac_ext >&5
3705   rm -rf conftest*
3706   cf_result=error
3707 fi
3708 rm -f conftest*
3709             
3710 fi
3711 rm -f conftest*
3712         echo "$ac_t""$cf_result" 1>&6
3713     fi
3714 fi
3715 fi
3716
3717
3718
3719         ;;
3720 ncurses)
3721         
3722 cf_ncuconfig_root=ncurses
3723
3724 echo "Looking for ${cf_ncuconfig_root}-config"
3725 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3726 do
3727 # Extract the first word of "$ac_prog", so it can be a program name with args.
3728 set dummy $ac_prog; ac_word=$2
3729 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3730 echo "configure:3731: checking for $ac_word" >&5
3731 if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
3732   echo $ac_n "(cached) $ac_c" 1>&6
3733 else
3734   case "$NCURSES_CONFIG" in
3735   /*)
3736   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
3737   ;;
3738   ?:/*)                  
3739   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a dos path.
3740   ;;
3741   *)
3742   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3743   ac_dummy="$PATH"
3744   for ac_dir in $ac_dummy; do 
3745     test -z "$ac_dir" && ac_dir=.
3746     if test -f $ac_dir/$ac_word; then
3747       ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
3748       break
3749     fi
3750   done
3751   IFS="$ac_save_ifs"
3752   ;;
3753 esac
3754 fi
3755 NCURSES_CONFIG="$ac_cv_path_NCURSES_CONFIG"
3756 if test -n "$NCURSES_CONFIG"; then
3757   echo "$ac_t""$NCURSES_CONFIG" 1>&6
3758 else
3759   echo "$ac_t""no" 1>&6
3760 fi
3761
3762 test -n "$NCURSES_CONFIG" && break
3763 done
3764 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
3765
3766
3767 if test "$NCURSES_CONFIG" != none ; then
3768
3769 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
3770 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
3771
3772 # even with config script, some packages use no-override for curses.h
3773
3774 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
3775 echo "configure:3776: checking if we have identified curses headers" >&5
3776 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
3777   echo $ac_n "(cached) $ac_c" 1>&6
3778 else
3779   
3780 cf_cv_ncurses_header=none
3781 for cf_header in  \
3782     ncurses/curses.h \
3783         ncurses/ncurses.h \
3784         curses.h \
3785         ncurses.h 
3786 do
3787 cat > conftest.$ac_ext <<EOF
3788 #line 3789 "configure"
3789 #include "confdefs.h"
3790 #include <${cf_header}>
3791 int main() {
3792 initscr(); tgoto("?", 0,0)
3793 ; return 0; }
3794 EOF
3795 if { (eval echo configure:3796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3796   rm -rf conftest*
3797   cf_cv_ncurses_header=$cf_header; break
3798 else
3799   echo "configure: failed program was:" >&5
3800   cat conftest.$ac_ext >&5
3801 fi
3802 rm -f conftest*
3803 done
3804
3805 fi
3806
3807 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
3808
3809 if test "$cf_cv_ncurses_header" = none ; then
3810         { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
3811 fi
3812
3813 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
3814 for ac_hdr in $cf_cv_ncurses_header
3815 do
3816 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3817 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3818 echo "configure:3819: checking for $ac_hdr" >&5
3819 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3820   echo $ac_n "(cached) $ac_c" 1>&6
3821 else
3822   cat > conftest.$ac_ext <<EOF
3823 #line 3824 "configure"
3824 #include "confdefs.h"
3825 #include <$ac_hdr>
3826 EOF
3827 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3828 { (eval echo configure:3829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3829 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3830 if test -z "$ac_err"; then
3831   rm -rf conftest*
3832   eval "ac_cv_header_$ac_safe=yes"
3833 else
3834   echo "$ac_err" >&5
3835   echo "configure: failed program was:" >&5
3836   cat conftest.$ac_ext >&5
3837   rm -rf conftest*
3838   eval "ac_cv_header_$ac_safe=no"
3839 fi
3840 rm -f conftest*
3841 fi
3842 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3843   echo "$ac_t""yes" 1>&6
3844     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3845   cat >> confdefs.h <<EOF
3846 #define $ac_tr_hdr 1
3847 EOF
3848  
3849 else
3850   echo "$ac_t""no" 1>&6
3851 fi
3852 done
3853
3854
3855
3856 cat >> confdefs.h <<\EOF
3857 #define NCURSES 1
3858 EOF
3859
3860
3861
3862 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3863
3864 cat >> confdefs.h <<EOF
3865 #define $cf_nculib_ROOT 1
3866 EOF
3867
3868
3869 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
3870
3871 else
3872
3873
3874
3875 cf_ncuhdr_root=ncurses
3876
3877 test -n "$cf_cv_curses_dir" && \
3878 test "$cf_cv_curses_dir" != "no" && { \
3879   
3880 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
3881   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
3882   do
3883         while test $cf_add_incdir != /usr/include
3884         do
3885           if test -d $cf_add_incdir
3886           then
3887                 cf_have_incdir=no
3888                 if test -n "$CFLAGS$CPPFLAGS" ; then
3889                   # a loop is needed to ensure we can add subdirs of existing dirs
3890                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3891                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3892                           cf_have_incdir=yes; break
3893                         fi
3894                   done
3895                 fi
3896
3897                 if test "$cf_have_incdir" = no ; then
3898                   if test "$cf_add_incdir" = /usr/local/include ; then
3899                         if test "$GCC" = yes
3900                         then
3901                           cf_save_CPPFLAGS=$CPPFLAGS
3902                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3903                           cat > conftest.$ac_ext <<EOF
3904 #line 3905 "configure"
3905 #include "confdefs.h"
3906 #include <stdio.h>
3907 int main() {
3908 printf("Hello")
3909 ; return 0; }
3910 EOF
3911 if { (eval echo configure:3912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3912   :
3913 else
3914   echo "configure: failed program was:" >&5
3915   cat conftest.$ac_ext >&5
3916   rm -rf conftest*
3917   cf_have_incdir=yes
3918 fi
3919 rm -f conftest*
3920                           CPPFLAGS=$cf_save_CPPFLAGS
3921                         fi
3922                   fi
3923                 fi
3924
3925                 if test "$cf_have_incdir" = no ; then
3926                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3927
3928 echo "${as_me-configure}:3929: testing adding $cf_add_incdir to include-path ..." 1>&5
3929
3930
3931                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3932
3933                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3934                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3935                   cf_add_incdir="$cf_top_incdir"
3936                 else
3937                   break
3938                 fi
3939           fi
3940         done
3941   done
3942 fi
3943
3944 }
3945
3946 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
3947 echo "configure:3948: checking for $cf_ncuhdr_root header in include-path" >&5
3948 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
3949   echo $ac_n "(cached) $ac_c" 1>&6
3950 else
3951   
3952         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
3953         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
3954         for cf_header in $cf_header_list
3955         do
3956                 
3957         cat > conftest.$ac_ext <<EOF
3958 #line 3959 "configure"
3959 #include "confdefs.h"
3960
3961
3962 #include <$cf_header>
3963 int main() {
3964
3965 #ifdef NCURSES_VERSION
3966
3967 printf("%s\n", NCURSES_VERSION);
3968 #else
3969 #ifdef __NCURSES_H
3970 printf("old\n");
3971 #else
3972         make an error
3973 #endif
3974 #endif
3975         
3976         
3977 ; return 0; }
3978 EOF
3979 if { (eval echo configure:3980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3980   rm -rf conftest*
3981   cf_cv_ncurses_h=$cf_header
3982         
3983 else
3984   echo "configure: failed program was:" >&5
3985   cat conftest.$ac_ext >&5
3986   rm -rf conftest*
3987   cf_cv_ncurses_h=no
3988 fi
3989 rm -f conftest*
3990
3991                 test "$cf_cv_ncurses_h" != no && break
3992         done
3993
3994 fi
3995
3996 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
3997
3998
3999
4000 if test "$cf_cv_ncurses_h" != no ; then
4001         cf_cv_ncurses_header=$cf_cv_ncurses_h
4002 else
4003
4004 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
4005 echo "configure:4006: checking for $cf_ncuhdr_root include-path" >&5
4006 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
4007   echo $ac_n "(cached) $ac_c" 1>&6
4008 else
4009   
4010         test -n "$verbose" && echo
4011         
4012 cf_search=
4013
4014 # collect the current set of include-directories from compiler flags
4015 cf_header_path_list=""
4016 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4017         for cf_header_path in $CPPFLAGS $CFLAGS
4018         do
4019                 case $cf_header_path in #(vi
4020                 -I*)
4021                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4022                         
4023 test "$cf_header_path" != "NONE" && \
4024 test -d "$cf_header_path" && \
4025  {
4026         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4027         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4028         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4029         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4030         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4031         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4032 }
4033
4034                         cf_header_path_list="$cf_header_path_list $cf_search"
4035                         ;;
4036                 esac
4037         done
4038 fi
4039
4040 # add the variations for the package we are looking for
4041
4042 cf_search=
4043
4044
4045 test "/usr" != "$prefix" && \
4046 test -d "/usr" && \
4047 (test $prefix = NONE || test -d $prefix) && {
4048         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
4049         test -d /usr/include &&          cf_search="$cf_search /usr/include"
4050         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
4051         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
4052         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
4053         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4054 }
4055
4056
4057 test "$prefix" != "NONE" && \
4058 test -d "$prefix" && \
4059  {
4060         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4061         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4062         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4063         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4064         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4065         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4066 }
4067
4068
4069 test "/usr/local" != "$prefix" && \
4070 test -d "/usr/local" && \
4071 (test $prefix = NONE || test -d $prefix) && {
4072         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
4073         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
4074         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
4075         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
4076         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
4077         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4078 }
4079
4080
4081 test "/opt" != "$prefix" && \
4082 test -d "/opt" && \
4083 (test $prefix = NONE || test -d $prefix) && {
4084         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
4085         test -d /opt/include &&          cf_search="$cf_search /opt/include"
4086         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
4087         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
4088         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
4089         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4090 }
4091
4092
4093 test "$HOME" != "$prefix" && \
4094 test -d "$HOME" && \
4095 (test $prefix = NONE || test -d $prefix) && {
4096         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
4097         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
4098         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
4099         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
4100         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
4101         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4102 }
4103
4104
4105
4106 test "$includedir" != NONE && \
4107 test "$includedir" != "/usr/include" && \
4108 test -d "$includedir" && {
4109         test -d $includedir &&    cf_search="$cf_search $includedir"
4110         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4111 }
4112
4113 test "$oldincludedir" != NONE && \
4114 test "$oldincludedir" != "/usr/include" && \
4115 test -d "$oldincludedir" && {
4116         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4117         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4118 }
4119
4120 cf_search="$cf_search $cf_header_path_list"
4121
4122         test -n "$verbose" && echo search path $cf_search
4123         cf_save2_CPPFLAGS="$CPPFLAGS"
4124         for cf_incdir in $cf_search
4125         do
4126                 
4127 if test -n "$cf_incdir" ; then
4128   for cf_add_incdir in $cf_incdir
4129   do
4130         while test $cf_add_incdir != /usr/include
4131         do
4132           if test -d $cf_add_incdir
4133           then
4134                 cf_have_incdir=no
4135                 if test -n "$CFLAGS$CPPFLAGS" ; then
4136                   # a loop is needed to ensure we can add subdirs of existing dirs
4137                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4138                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4139                           cf_have_incdir=yes; break
4140                         fi
4141                   done
4142                 fi
4143
4144                 if test "$cf_have_incdir" = no ; then
4145                   if test "$cf_add_incdir" = /usr/local/include ; then
4146                         if test "$GCC" = yes
4147                         then
4148                           cf_save_CPPFLAGS=$CPPFLAGS
4149                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4150                           cat > conftest.$ac_ext <<EOF
4151 #line 4152 "configure"
4152 #include "confdefs.h"
4153 #include <stdio.h>
4154 int main() {
4155 printf("Hello")
4156 ; return 0; }
4157 EOF
4158 if { (eval echo configure:4159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4159   :
4160 else
4161   echo "configure: failed program was:" >&5
4162   cat conftest.$ac_ext >&5
4163   rm -rf conftest*
4164   cf_have_incdir=yes
4165 fi
4166 rm -f conftest*
4167                           CPPFLAGS=$cf_save_CPPFLAGS
4168                         fi
4169                   fi
4170                 fi
4171
4172                 if test "$cf_have_incdir" = no ; then
4173                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4174
4175 echo "${as_me-configure}:4176: testing adding $cf_add_incdir to include-path ..." 1>&5
4176
4177
4178                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4179
4180                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4181                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4182                   cf_add_incdir="$cf_top_incdir"
4183                 else
4184                   break
4185                 fi
4186           fi
4187         done
4188   done
4189 fi
4190
4191                 for cf_header in \
4192                         ncurses.h \
4193                         curses.h
4194                 do
4195                         
4196         cat > conftest.$ac_ext <<EOF
4197 #line 4198 "configure"
4198 #include "confdefs.h"
4199
4200
4201 #include <$cf_header>
4202 int main() {
4203
4204 #ifdef NCURSES_VERSION
4205
4206 printf("%s\n", NCURSES_VERSION);
4207 #else
4208 #ifdef __NCURSES_H
4209 printf("old\n");
4210 #else
4211         make an error
4212 #endif
4213 #endif
4214         
4215         
4216 ; return 0; }
4217 EOF
4218 if { (eval echo configure:4219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4219   rm -rf conftest*
4220   cf_cv_ncurses_h2=$cf_header
4221         
4222 else
4223   echo "configure: failed program was:" >&5
4224   cat conftest.$ac_ext >&5
4225   rm -rf conftest*
4226   cf_cv_ncurses_h2=no
4227 fi
4228 rm -f conftest*
4229
4230                         if test "$cf_cv_ncurses_h2" != no ; then
4231                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4232                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4233                                 break
4234                         fi
4235                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4236                 done
4237                 CPPFLAGS="$cf_save2_CPPFLAGS"
4238                 test "$cf_cv_ncurses_h2" != no && break
4239         done
4240         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
4241         
4242 fi
4243
4244 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
4245
4246         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4247         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4248         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4249                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4250         fi
4251         
4252 if test -n "$cf_1st_incdir" ; then
4253   for cf_add_incdir in $cf_1st_incdir
4254   do
4255         while test $cf_add_incdir != /usr/include
4256         do
4257           if test -d $cf_add_incdir
4258           then
4259                 cf_have_incdir=no
4260                 if test -n "$CFLAGS$CPPFLAGS" ; then
4261                   # a loop is needed to ensure we can add subdirs of existing dirs
4262                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4263                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4264                           cf_have_incdir=yes; break
4265                         fi
4266                   done
4267                 fi
4268
4269                 if test "$cf_have_incdir" = no ; then
4270                   if test "$cf_add_incdir" = /usr/local/include ; then
4271                         if test "$GCC" = yes
4272                         then
4273                           cf_save_CPPFLAGS=$CPPFLAGS
4274                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4275                           cat > conftest.$ac_ext <<EOF
4276 #line 4277 "configure"
4277 #include "confdefs.h"
4278 #include <stdio.h>
4279 int main() {
4280 printf("Hello")
4281 ; return 0; }
4282 EOF
4283 if { (eval echo configure:4284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4284   :
4285 else
4286   echo "configure: failed program was:" >&5
4287   cat conftest.$ac_ext >&5
4288   rm -rf conftest*
4289   cf_have_incdir=yes
4290 fi
4291 rm -f conftest*
4292                           CPPFLAGS=$cf_save_CPPFLAGS
4293                         fi
4294                   fi
4295                 fi
4296
4297                 if test "$cf_have_incdir" = no ; then
4298                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4299
4300 echo "${as_me-configure}:4301: testing adding $cf_add_incdir to include-path ..." 1>&5
4301
4302
4303                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4304
4305                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4306                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4307                   cf_add_incdir="$cf_top_incdir"
4308                 else
4309                   break
4310                 fi
4311           fi
4312         done
4313   done
4314 fi
4315
4316
4317 fi
4318
4319 # Set definitions to allow ifdef'ing for ncurses.h
4320
4321 case $cf_cv_ncurses_header in # (vi
4322 *ncurses.h)
4323         cat >> confdefs.h <<\EOF
4324 #define HAVE_NCURSES_H 1
4325 EOF
4326
4327         ;;
4328 esac
4329
4330 case $cf_cv_ncurses_header in # (vi
4331 ncurses/curses.h|ncurses/ncurses.h)
4332         cat >> confdefs.h <<\EOF
4333 #define HAVE_NCURSES_NCURSES_H 1
4334 EOF
4335
4336         ;;
4337 ncursesw/curses.h|ncursesw/ncurses.h)
4338         cat >> confdefs.h <<\EOF
4339 #define HAVE_NCURSESW_NCURSES_H 1
4340 EOF
4341
4342         ;;
4343 esac
4344
4345
4346
4347 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
4348 echo "configure:4349: checking for terminfo header" >&5
4349 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
4350   echo $ac_n "(cached) $ac_c" 1>&6
4351 else
4352   
4353 case ${cf_cv_ncurses_header} in #(vi
4354 */ncurses.h|*/ncursesw.h) #(vi
4355         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4356         ;;
4357 *)
4358         cf_term_header=term.h
4359         ;;
4360 esac
4361
4362 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4363 do
4364 cat > conftest.$ac_ext <<EOF
4365 #line 4366 "configure"
4366 #include "confdefs.h"
4367 #include <stdio.h>
4368 #include <${cf_cv_ncurses_header-curses.h}>
4369 #include <$cf_test>
4370
4371 int main() {
4372 int x = auto_left_margin
4373 ; return 0; }
4374 EOF
4375 if { (eval echo configure:4376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4376   rm -rf conftest*
4377   
4378         cf_cv_term_header="$cf_test"
4379 else
4380   echo "configure: failed program was:" >&5
4381   cat conftest.$ac_ext >&5
4382   rm -rf conftest*
4383   
4384         cf_cv_term_header=unknown
4385         
4386 fi
4387 rm -f conftest*
4388         test "$cf_cv_term_header" != unknown && break
4389 done
4390
4391 fi
4392
4393 echo "$ac_t""$cf_cv_term_header" 1>&6
4394
4395 # Set definitions to allow ifdef'ing to accommodate subdirectories
4396
4397 case $cf_cv_term_header in # (vi
4398 *term.h)
4399         cat >> confdefs.h <<\EOF
4400 #define HAVE_TERM_H 1
4401 EOF
4402
4403         ;;
4404 esac
4405
4406 case $cf_cv_term_header in # (vi
4407 ncurses/term.h) #(vi
4408         cat >> confdefs.h <<\EOF
4409 #define HAVE_NCURSES_TERM_H 1
4410 EOF
4411
4412         ;;
4413 ncursesw/term.h)
4414         cat >> confdefs.h <<\EOF
4415 #define HAVE_NCURSESW_TERM_H 1
4416 EOF
4417
4418         ;;
4419 esac
4420
4421
4422 # some applications need this, but should check for NCURSES_VERSION
4423 cat >> confdefs.h <<\EOF
4424 #define NCURSES 1
4425 EOF
4426
4427
4428
4429 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
4430 echo "configure:4431: checking for ncurses version" >&5
4431 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
4432   echo $ac_n "(cached) $ac_c" 1>&6
4433 else
4434   
4435         cf_cv_ncurses_version=no
4436         cf_tempfile=out$$
4437         rm -f $cf_tempfile
4438         if test "$cross_compiling" = yes; then
4439   
4440
4441         # This will not work if the preprocessor splits the line after the
4442         # Autoconf token.  The 'unproto' program does that.
4443         cat > conftest.$ac_ext <<EOF
4444 #include <${cf_cv_ncurses_header-curses.h}>
4445 #undef Autoconf
4446 #ifdef NCURSES_VERSION
4447 Autoconf NCURSES_VERSION
4448 #else
4449 #ifdef __NCURSES_H
4450 Autoconf "old"
4451 #endif
4452 ;
4453 #endif
4454 EOF
4455         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4456         { (eval echo configure:4457: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
4457         if test -f conftest.out ; then
4458                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4459                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4460                 rm -f conftest.out
4461         fi
4462
4463 else
4464   cat > conftest.$ac_ext <<EOF
4465 #line 4466 "configure"
4466 #include "confdefs.h"
4467
4468 #include <${cf_cv_ncurses_header-curses.h}>
4469 #include <stdio.h>
4470 int main()
4471 {
4472         FILE *fp = fopen("$cf_tempfile", "w");
4473 #ifdef NCURSES_VERSION
4474 # ifdef NCURSES_VERSION_PATCH
4475         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4476 # else
4477         fprintf(fp, "%s\n", NCURSES_VERSION);
4478 # endif
4479 #else
4480 # ifdef __NCURSES_H
4481         fprintf(fp, "old\n");
4482 # else
4483         make an error
4484 # endif
4485 #endif
4486         ${cf_cv_main_return-return}(0);
4487 }
4488 EOF
4489 if { (eval echo configure:4490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4490 then
4491   
4492         cf_cv_ncurses_version=`cat $cf_tempfile`
4493 else
4494   echo "configure: failed program was:" >&5
4495   cat conftest.$ac_ext >&5
4496 fi
4497 rm -fr conftest*
4498 fi
4499
4500         rm -f $cf_tempfile
4501
4502 fi
4503
4504 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
4505 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
4506 #define NCURSES 1
4507 EOF
4508
4509
4510
4511
4512
4513 cf_nculib_root=ncurses
4514         # This works, except for the special case where we find gpm, but
4515         # ncurses is in a nonstandard location via $LIBS, and we really want
4516         # to link gpm.
4517 cf_ncurses_LIBS=""
4518 cf_ncurses_SAVE="$LIBS"
4519 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
4520 echo "configure:4521: checking for Gpm_Open in -lgpm" >&5
4521 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
4522 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4523   echo $ac_n "(cached) $ac_c" 1>&6
4524 else
4525   ac_save_LIBS="$LIBS"
4526 LIBS="-lgpm  $LIBS"
4527 cat > conftest.$ac_ext <<EOF
4528 #line 4529 "configure"
4529 #include "confdefs.h"
4530 /* Override any gcc2 internal prototype to avoid an error.  */
4531 /* We use char because int might match the return type of a gcc2
4532     builtin and then its argument prototype would still apply.  */
4533 char Gpm_Open();
4534
4535 int main() {
4536 Gpm_Open()
4537 ; return 0; }
4538 EOF
4539 if { (eval echo configure:4540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4540   rm -rf conftest*
4541   eval "ac_cv_lib_$ac_lib_var=yes"
4542 else
4543   echo "configure: failed program was:" >&5
4544   cat conftest.$ac_ext >&5
4545   rm -rf conftest*
4546   eval "ac_cv_lib_$ac_lib_var=no"
4547 fi
4548 rm -f conftest*
4549 LIBS="$ac_save_LIBS"
4550
4551 fi
4552 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4553   echo "$ac_t""yes" 1>&6
4554   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
4555 echo "configure:4556: checking for initscr in -lgpm" >&5
4556 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
4557 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4558   echo $ac_n "(cached) $ac_c" 1>&6
4559 else
4560   ac_save_LIBS="$LIBS"
4561 LIBS="-lgpm  $LIBS"
4562 cat > conftest.$ac_ext <<EOF
4563 #line 4564 "configure"
4564 #include "confdefs.h"
4565 /* Override any gcc2 internal prototype to avoid an error.  */
4566 /* We use char because int might match the return type of a gcc2
4567     builtin and then its argument prototype would still apply.  */
4568 char initscr();
4569
4570 int main() {
4571 initscr()
4572 ; return 0; }
4573 EOF
4574 if { (eval echo configure:4575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4575   rm -rf conftest*
4576   eval "ac_cv_lib_$ac_lib_var=yes"
4577 else
4578   echo "configure: failed program was:" >&5
4579   cat conftest.$ac_ext >&5
4580   rm -rf conftest*
4581   eval "ac_cv_lib_$ac_lib_var=no"
4582 fi
4583 rm -f conftest*
4584 LIBS="$ac_save_LIBS"
4585
4586 fi
4587 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4588   echo "$ac_t""yes" 1>&6
4589   LIBS="$cf_ncurses_SAVE"
4590 else
4591   echo "$ac_t""no" 1>&6
4592 cf_ncurses_LIBS="-lgpm"
4593 fi
4594
4595 else
4596   echo "$ac_t""no" 1>&6
4597 fi
4598
4599
4600 case $host_os in #(vi
4601 freebsd*)
4602         # This is only necessary if you are linking against an obsolete
4603         # version of ncurses (but it should do no harm, since it's static).
4604         if test "$cf_nculib_root" = ncurses ; then
4605                 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
4606 echo "configure:4607: checking for tgoto in -lmytinfo" >&5
4607 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
4608 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4609   echo $ac_n "(cached) $ac_c" 1>&6
4610 else
4611   ac_save_LIBS="$LIBS"
4612 LIBS="-lmytinfo  $LIBS"
4613 cat > conftest.$ac_ext <<EOF
4614 #line 4615 "configure"
4615 #include "confdefs.h"
4616 /* Override any gcc2 internal prototype to avoid an error.  */
4617 /* We use char because int might match the return type of a gcc2
4618     builtin and then its argument prototype would still apply.  */
4619 char tgoto();
4620
4621 int main() {
4622 tgoto()
4623 ; return 0; }
4624 EOF
4625 if { (eval echo configure:4626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4626   rm -rf conftest*
4627   eval "ac_cv_lib_$ac_lib_var=yes"
4628 else
4629   echo "configure: failed program was:" >&5
4630   cat conftest.$ac_ext >&5
4631   rm -rf conftest*
4632   eval "ac_cv_lib_$ac_lib_var=no"
4633 fi
4634 rm -f conftest*
4635 LIBS="$ac_save_LIBS"
4636
4637 fi
4638 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4639   echo "$ac_t""yes" 1>&6
4640   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4641 else
4642   echo "$ac_t""no" 1>&6
4643 fi
4644
4645         fi
4646         ;;
4647 esac
4648
4649 LIBS="$cf_ncurses_LIBS $LIBS"
4650
4651 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4652 then
4653         
4654 if test -n "$cf_cv_curses_dir/lib" ; then
4655   for cf_add_libdir in $cf_cv_curses_dir/lib
4656   do
4657     if test $cf_add_libdir = /usr/lib ; then
4658       :
4659     elif test -d $cf_add_libdir
4660     then
4661       cf_have_libdir=no
4662       if test -n "$LDFLAGS$LIBS" ; then
4663         # a loop is needed to ensure we can add subdirs of existing dirs
4664         for cf_test_libdir in $LDFLAGS $LIBS ; do
4665           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4666             cf_have_libdir=yes; break
4667           fi
4668         done
4669       fi
4670       if test "$cf_have_libdir" = no ; then
4671         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4672
4673 echo "${as_me-configure}:4674: testing adding $cf_add_libdir to library-path ..." 1>&5
4674
4675
4676         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4677       fi
4678     fi
4679   done
4680 fi
4681
4682         LIBS="-l$cf_nculib_root $LIBS"
4683 else
4684         
4685         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4686         cf_libdir=""
4687         echo $ac_n "checking for initscr""... $ac_c" 1>&6
4688 echo "configure:4689: checking for initscr" >&5
4689 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
4690   echo $ac_n "(cached) $ac_c" 1>&6
4691 else
4692   cat > conftest.$ac_ext <<EOF
4693 #line 4694 "configure"
4694 #include "confdefs.h"
4695 /* System header to define __stub macros and hopefully few prototypes,
4696     which can conflict with char initscr(); below.  */
4697 #include <assert.h>
4698 /* Override any gcc2 internal prototype to avoid an error.  */
4699 /* We use char because int might match the return type of a gcc2
4700     builtin and then its argument prototype would still apply.  */
4701 char initscr();
4702
4703 int main() {
4704
4705 /* The GNU C library defines this for functions which it implements
4706     to always fail with ENOSYS.  Some functions are actually named
4707     something starting with __ and the normal name is an alias.  */
4708 #if defined (__stub_initscr) || defined (__stub___initscr)
4709 choke me
4710 #else
4711 initscr();
4712 #endif
4713
4714 ; return 0; }
4715 EOF
4716 if { (eval echo configure:4717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4717   rm -rf conftest*
4718   eval "ac_cv_func_initscr=yes"
4719 else
4720   echo "configure: failed program was:" >&5
4721   cat conftest.$ac_ext >&5
4722   rm -rf conftest*
4723   eval "ac_cv_func_initscr=no"
4724 fi
4725 rm -f conftest*
4726 fi
4727
4728 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
4729   echo "$ac_t""yes" 1>&6
4730   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4731 else
4732   echo "$ac_t""no" 1>&6
4733
4734                 cf_save_LIBS="$LIBS"
4735                 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
4736 echo "configure:4737: checking for initscr in -l$cf_nculib_root" >&5
4737                 LIBS="-l$cf_nculib_root $LIBS"
4738                 cat > conftest.$ac_ext <<EOF
4739 #line 4740 "configure"
4740 #include "confdefs.h"
4741 #include <${cf_cv_ncurses_header-curses.h}>
4742 int main() {
4743 initscr()
4744 ; return 0; }
4745 EOF
4746 if { (eval echo configure:4747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4747   rm -rf conftest*
4748   echo "$ac_t""yes" 1>&6
4749                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4750                         
4751 else
4752   echo "configure: failed program was:" >&5
4753   cat conftest.$ac_ext >&5
4754   rm -rf conftest*
4755   echo "$ac_t""no" 1>&6
4756                         
4757 cf_search=
4758 cf_library_path_list=""
4759 if test -n "${LDFLAGS}${LIBS}" ; then
4760         for cf_library_path in $LDFLAGS $LIBS
4761         do
4762                 case $cf_library_path in #(vi
4763                 -L*)
4764                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
4765                         
4766 test "$cf_library_path" != "NONE" && \
4767 test -d "$cf_library_path" && \
4768  {
4769         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
4770         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
4771         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
4772         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
4773         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
4774         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
4775 }
4776
4777                         cf_library_path_list="$cf_library_path_list $cf_search"
4778                         ;;
4779                 esac
4780         done
4781 fi
4782
4783
4784 cf_search=
4785
4786
4787 test "/usr" != "$prefix" && \
4788 test -d "/usr" && \
4789 (test $prefix = NONE || test -d $prefix) && {
4790         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
4791         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
4792         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
4793         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
4794         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
4795         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
4796 }
4797
4798
4799 test "$prefix" != "NONE" && \
4800 test -d "$prefix" && \
4801  {
4802         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
4803         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
4804         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
4805         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
4806         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
4807         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
4808 }
4809
4810
4811 test "/usr/local" != "$prefix" && \
4812 test -d "/usr/local" && \
4813 (test $prefix = NONE || test -d $prefix) && {
4814         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
4815         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
4816         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
4817         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
4818         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
4819         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
4820 }
4821
4822
4823 test "/opt" != "$prefix" && \
4824 test -d "/opt" && \
4825 (test $prefix = NONE || test -d $prefix) && {
4826         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
4827         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
4828         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
4829         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
4830         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
4831         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
4832 }
4833
4834
4835 test "$HOME" != "$prefix" && \
4836 test -d "$HOME" && \
4837 (test $prefix = NONE || test -d $prefix) && {
4838         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
4839         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
4840         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
4841         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
4842         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
4843         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
4844 }
4845
4846
4847
4848 cf_search="$cf_library_path_list $cf_search"
4849
4850                         for cf_libdir in $cf_search
4851                         do
4852                                 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
4853 echo "configure:4854: checking for -l$cf_nculib_root in $cf_libdir" >&5
4854                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
4855                                 cat > conftest.$ac_ext <<EOF
4856 #line 4857 "configure"
4857 #include "confdefs.h"
4858 #include <${cf_cv_ncurses_header-curses.h}>
4859 int main() {
4860 initscr()
4861 ; return 0; }
4862 EOF
4863 if { (eval echo configure:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4864   rm -rf conftest*
4865   echo "$ac_t""yes" 1>&6
4866                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4867                                          break
4868 else
4869   echo "configure: failed program was:" >&5
4870   cat conftest.$ac_ext >&5
4871   rm -rf conftest*
4872   echo "$ac_t""no" 1>&6
4873                                          LIBS="$cf_save_LIBS"
4874 fi
4875 rm -f conftest*
4876                         done
4877                         
4878 fi
4879 rm -f conftest*
4880                 
4881 fi
4882
4883 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
4884
4885 if test $cf_found_library = no ; then
4886         { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
4887 fi
4888
4889
4890 fi
4891
4892 if test -n "$cf_ncurses_LIBS" ; then
4893         echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
4894 echo "configure:4895: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
4895         cf_ncurses_SAVE="$LIBS"
4896         for p in $cf_ncurses_LIBS ; do
4897                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
4898                 if test "$q" != "$LIBS" ; then
4899                         LIBS="$q"
4900                 fi
4901         done
4902         cat > conftest.$ac_ext <<EOF
4903 #line 4904 "configure"
4904 #include "confdefs.h"
4905 #include <${cf_cv_ncurses_header-curses.h}>
4906 int main() {
4907 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4908 ; return 0; }
4909 EOF
4910 if { (eval echo configure:4911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4911   rm -rf conftest*
4912   echo "$ac_t""yes" 1>&6
4913 else
4914   echo "configure: failed program was:" >&5
4915   cat conftest.$ac_ext >&5
4916   rm -rf conftest*
4917   echo "$ac_t""no" 1>&6
4918                  LIBS="$cf_ncurses_SAVE"
4919 fi
4920 rm -f conftest*
4921 fi
4922
4923
4924 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4925
4926 cat >> confdefs.h <<EOF
4927 #define $cf_nculib_ROOT 1
4928 EOF
4929
4930
4931
4932 fi
4933
4934         ;;
4935 ncursesw)
4936         cf_cv_libtype=w
4937         
4938 echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6
4939 echo "configure:4940: checking for multibyte character support" >&5
4940 if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then
4941   echo $ac_n "(cached) $ac_c" 1>&6
4942 else
4943   
4944         cf_save_LIBS="$LIBS"
4945         cat > conftest.$ac_ext <<EOF
4946 #line 4947 "configure"
4947 #include "confdefs.h"
4948
4949 #include <stdlib.h>
4950 int main() {
4951 putwc(0,0);
4952 ; return 0; }
4953 EOF
4954 if { (eval echo configure:4955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4955   rm -rf conftest*
4956   cf_cv_utf8_lib=yes
4957 else
4958   echo "configure: failed program was:" >&5
4959   cat conftest.$ac_ext >&5
4960   rm -rf conftest*
4961   
4962
4963 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
4964 # will be set on completion of the AC_TRY_LINK below.
4965 cf_cv_header_path_utf8=
4966 cf_cv_library_path_utf8=
4967
4968
4969 echo "${as_me-configure}:4970: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
4970
4971
4972 cf_save_LIBS="$LIBS"
4973
4974 cat > conftest.$ac_ext <<EOF
4975 #line 4976 "configure"
4976 #include "confdefs.h"
4977
4978 #include <libutf8.h>
4979 int main() {
4980 putwc(0,0);
4981 ; return 0; }
4982 EOF
4983 if { (eval echo configure:4984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4984   rm -rf conftest*
4985   
4986         cf_cv_find_linkage_utf8=yes
4987         cf_cv_header_path_utf8=/usr/include
4988         cf_cv_library_path_utf8=/usr/lib
4989
4990 else
4991   echo "configure: failed program was:" >&5
4992   cat conftest.$ac_ext >&5
4993   rm -rf conftest*
4994   
4995
4996 LIBS="-lutf8  $cf_save_LIBS"
4997
4998 cat > conftest.$ac_ext <<EOF
4999 #line 5000 "configure"
5000 #include "confdefs.h"
5001
5002 #include <libutf8.h>
5003 int main() {
5004 putwc(0,0);
5005 ; return 0; }
5006 EOF
5007 if { (eval echo configure:5008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5008   rm -rf conftest*
5009   
5010         cf_cv_find_linkage_utf8=yes
5011         cf_cv_header_path_utf8=/usr/include
5012         cf_cv_library_path_utf8=/usr/lib
5013         cf_cv_library_file_utf8="-lutf8"
5014
5015 else
5016   echo "configure: failed program was:" >&5
5017   cat conftest.$ac_ext >&5
5018   rm -rf conftest*
5019   
5020         cf_cv_find_linkage_utf8=no
5021         LIBS="$cf_save_LIBS"
5022
5023     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
5024
5025 echo "${as_me-configure}:5026: testing find linkage for utf8 library ..." 1>&5
5026
5027
5028     
5029 echo "${as_me-configure}:5030: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5030
5031
5032     cf_save_CPPFLAGS="$CPPFLAGS"
5033     cf_test_CPPFLAGS="$CPPFLAGS"
5034
5035     
5036 cf_search=
5037
5038 # collect the current set of include-directories from compiler flags
5039 cf_header_path_list=""
5040 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5041         for cf_header_path in $CPPFLAGS $CFLAGS
5042         do
5043                 case $cf_header_path in #(vi
5044                 -I*)
5045                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5046                         
5047 test "$cf_header_path" != "NONE" && \
5048 test -d "$cf_header_path" && \
5049  {
5050         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5051         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5052         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5053         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5054         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5055         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5056 }
5057
5058                         cf_header_path_list="$cf_header_path_list $cf_search"
5059                         ;;
5060                 esac
5061         done
5062 fi
5063
5064 # add the variations for the package we are looking for
5065
5066 cf_search=
5067
5068
5069 test "/usr" != "$prefix" && \
5070 test -d "/usr" && \
5071 (test $prefix = NONE || test -d $prefix) && {
5072         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5073         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5074         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
5075         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
5076         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
5077         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
5078 }
5079
5080
5081 test "$prefix" != "NONE" && \
5082 test -d "$prefix" && \
5083  {
5084         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5085         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5086         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5087         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5088         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5089         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5090 }
5091
5092
5093 test "/usr/local" != "$prefix" && \
5094 test -d "/usr/local" && \
5095 (test $prefix = NONE || test -d $prefix) && {
5096         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5097         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5098         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
5099         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
5100         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
5101         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
5102 }
5103
5104
5105 test "/opt" != "$prefix" && \
5106 test -d "/opt" && \
5107 (test $prefix = NONE || test -d $prefix) && {
5108         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5109         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5110         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
5111         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
5112         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
5113         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
5114 }
5115
5116
5117 test "$HOME" != "$prefix" && \
5118 test -d "$HOME" && \
5119 (test $prefix = NONE || test -d $prefix) && {
5120         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5121         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5122         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
5123         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
5124         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
5125         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
5126 }
5127
5128
5129
5130 test "$includedir" != NONE && \
5131 test "$includedir" != "/usr/include" && \
5132 test -d "$includedir" && {
5133         test -d $includedir &&    cf_search="$cf_search $includedir"
5134         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5135 }
5136
5137 test "$oldincludedir" != NONE && \
5138 test "$oldincludedir" != "/usr/include" && \
5139 test -d "$oldincludedir" && {
5140         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5141         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5142 }
5143
5144 cf_search="$cf_search $cf_header_path_list"
5145
5146     for cf_cv_header_path_utf8 in $cf_search
5147     do
5148       if test -d $cf_cv_header_path_utf8 ; then
5149         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5150
5151 echo "${as_me-configure}:5152: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5152
5153
5154         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5155         cat > conftest.$ac_ext <<EOF
5156 #line 5157 "configure"
5157 #include "confdefs.h"
5158
5159 #include <libutf8.h>
5160 int main() {
5161 putwc(0,0);
5162 ; return 0; }
5163 EOF
5164 if { (eval echo configure:5165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5165   rm -rf conftest*
5166   
5167             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5168
5169 echo "${as_me-configure}:5170: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5170
5171
5172             cf_cv_find_linkage_utf8=maybe
5173             cf_test_CPPFLAGS="$CPPFLAGS"
5174             break
5175 else
5176   echo "configure: failed program was:" >&5
5177   cat conftest.$ac_ext >&5
5178   rm -rf conftest*
5179   
5180             CPPFLAGS="$cf_save_CPPFLAGS"
5181             
5182 fi
5183 rm -f conftest*
5184       fi
5185     done
5186
5187     if test "$cf_cv_find_linkage_utf8" = maybe ; then
5188
5189       
5190 echo "${as_me-configure}:5191: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5191
5192
5193       cf_save_LIBS="$LIBS"
5194       cf_save_LDFLAGS="$LDFLAGS"
5195
5196       
5197
5198       if test "$cf_cv_find_linkage_utf8" != yes ; then
5199         
5200 cf_search=
5201 cf_library_path_list=""
5202 if test -n "${LDFLAGS}${LIBS}" ; then
5203         for cf_library_path in $LDFLAGS $LIBS
5204         do
5205                 case $cf_library_path in #(vi
5206                 -L*)
5207                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5208                         
5209 test "$cf_library_path" != "NONE" && \
5210 test -d "$cf_library_path" && \
5211  {
5212         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5213         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5214         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5215         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5216         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5217         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5218 }
5219
5220                         cf_library_path_list="$cf_library_path_list $cf_search"
5221                         ;;
5222                 esac
5223         done
5224 fi
5225
5226
5227 cf_search=
5228
5229
5230 test "/usr" != "$prefix" && \
5231 test -d "/usr" && \
5232 (test $prefix = NONE || test -d $prefix) && {
5233         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
5234         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
5235         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
5236         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
5237         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
5238         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
5239 }
5240
5241
5242 test "$prefix" != "NONE" && \
5243 test -d "$prefix" && \
5244  {
5245         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5246         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5247         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5248         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5249         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5250         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5251 }
5252
5253
5254 test "/usr/local" != "$prefix" && \
5255 test -d "/usr/local" && \
5256 (test $prefix = NONE || test -d $prefix) && {
5257         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
5258         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
5259         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
5260         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
5261         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
5262         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
5263 }
5264
5265
5266 test "/opt" != "$prefix" && \
5267 test -d "/opt" && \
5268 (test $prefix = NONE || test -d $prefix) && {
5269         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
5270         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
5271         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
5272         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
5273         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
5274         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
5275 }
5276
5277
5278 test "$HOME" != "$prefix" && \
5279 test -d "$HOME" && \
5280 (test $prefix = NONE || test -d $prefix) && {
5281         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
5282         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
5283         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
5284         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
5285         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
5286         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
5287 }
5288
5289
5290
5291 cf_search="$cf_library_path_list $cf_search"
5292
5293         for cf_cv_library_path_utf8 in $cf_search
5294         do
5295           if test -d $cf_cv_library_path_utf8 ; then
5296             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
5297
5298 echo "${as_me-configure}:5299: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5299
5300
5301             CPPFLAGS="$cf_test_CPPFLAGS"
5302             LIBS="-lutf8  $cf_save_LIBS"
5303             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5304             cat > conftest.$ac_ext <<EOF
5305 #line 5306 "configure"
5306 #include "confdefs.h"
5307
5308 #include <libutf8.h>
5309 int main() {
5310 putwc(0,0);
5311 ; return 0; }
5312 EOF
5313 if { (eval echo configure:5314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5314   rm -rf conftest*
5315   
5316                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5317
5318 echo "${as_me-configure}:5319: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5319
5320
5321                 cf_cv_find_linkage_utf8=yes
5322                 cf_cv_library_file_utf8="-lutf8"
5323                 break
5324 else
5325   echo "configure: failed program was:" >&5
5326   cat conftest.$ac_ext >&5
5327   rm -rf conftest*
5328   
5329                 CPPFLAGS="$cf_save_CPPFLAGS"
5330                 LIBS="$cf_save_LIBS"
5331                 LDFLAGS="$cf_save_LDFLAGS"
5332                 
5333 fi
5334 rm -f conftest*
5335           fi
5336         done
5337         CPPFLAGS="$cf_save_CPPFLAGS"
5338         LDFLAGS="$cf_save_LDFLAGS"
5339       fi
5340
5341     else
5342       cf_cv_find_linkage_utf8=no
5343     fi
5344     
5345 fi
5346 rm -f conftest*
5347
5348 fi
5349 rm -f conftest*
5350
5351 LIBS="$cf_save_LIBS"
5352
5353 if test "$cf_cv_find_linkage_utf8" = yes ; then
5354 cf_cv_utf8_lib=add-on
5355 else
5356 cf_cv_utf8_lib=no
5357 fi
5358
5359
5360 fi
5361 rm -f conftest*
5362 fi
5363
5364 echo "$ac_t""$cf_cv_utf8_lib" 1>&6
5365
5366 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5367 # ncurses/ncursesw:
5368 if test "$cf_cv_utf8_lib" = "add-on" ; then
5369         cat >> confdefs.h <<\EOF
5370 #define HAVE_LIBUTF8_H 1
5371 EOF
5372
5373         
5374 if test -n "$cf_cv_header_path_utf8" ; then
5375   for cf_add_incdir in $cf_cv_header_path_utf8
5376   do
5377         while test $cf_add_incdir != /usr/include
5378         do
5379           if test -d $cf_add_incdir
5380           then
5381                 cf_have_incdir=no
5382                 if test -n "$CFLAGS$CPPFLAGS" ; then
5383                   # a loop is needed to ensure we can add subdirs of existing dirs
5384                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5385                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5386                           cf_have_incdir=yes; break
5387                         fi
5388                   done
5389                 fi
5390
5391                 if test "$cf_have_incdir" = no ; then
5392                   if test "$cf_add_incdir" = /usr/local/include ; then
5393                         if test "$GCC" = yes
5394                         then
5395                           cf_save_CPPFLAGS=$CPPFLAGS
5396                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5397                           cat > conftest.$ac_ext <<EOF
5398 #line 5399 "configure"
5399 #include "confdefs.h"
5400 #include <stdio.h>
5401 int main() {
5402 printf("Hello")
5403 ; return 0; }
5404 EOF
5405 if { (eval echo configure:5406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5406   :
5407 else
5408   echo "configure: failed program was:" >&5
5409   cat conftest.$ac_ext >&5
5410   rm -rf conftest*
5411   cf_have_incdir=yes
5412 fi
5413 rm -f conftest*
5414                           CPPFLAGS=$cf_save_CPPFLAGS
5415                         fi
5416                   fi
5417                 fi
5418
5419                 if test "$cf_have_incdir" = no ; then
5420                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5421
5422 echo "${as_me-configure}:5423: testing adding $cf_add_incdir to include-path ..." 1>&5
5423
5424
5425                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5426
5427                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5428                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5429                   cf_add_incdir="$cf_top_incdir"
5430                 else
5431                   break
5432                 fi
5433           fi
5434         done
5435   done
5436 fi
5437
5438         
5439 if test -n "$cf_cv_library_path_utf8" ; then
5440   for cf_add_libdir in $cf_cv_library_path_utf8
5441   do
5442     if test $cf_add_libdir = /usr/lib ; then
5443       :
5444     elif test -d $cf_add_libdir
5445     then
5446       cf_have_libdir=no
5447       if test -n "$LDFLAGS$LIBS" ; then
5448         # a loop is needed to ensure we can add subdirs of existing dirs
5449         for cf_test_libdir in $LDFLAGS $LIBS ; do
5450           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5451             cf_have_libdir=yes; break
5452           fi
5453         done
5454       fi
5455       if test "$cf_have_libdir" = no ; then
5456         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5457
5458 echo "${as_me-configure}:5459: testing adding $cf_add_libdir to library-path ..." 1>&5
5459
5460
5461         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5462       fi
5463     fi
5464   done
5465 fi
5466
5467         LIBS="$cf_cv_library_file_utf8 $LIBS"
5468 fi
5469
5470         
5471 cf_ncuconfig_root=ncursesw
5472
5473 echo "Looking for ${cf_ncuconfig_root}-config"
5474 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5475 do
5476 # Extract the first word of "$ac_prog", so it can be a program name with args.
5477 set dummy $ac_prog; ac_word=$2
5478 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5479 echo "configure:5480: checking for $ac_word" >&5
5480 if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
5481   echo $ac_n "(cached) $ac_c" 1>&6
5482 else
5483   case "$NCURSES_CONFIG" in
5484   /*)
5485   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
5486   ;;
5487   ?:/*)                  
5488   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a dos path.
5489   ;;
5490   *)
5491   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5492   ac_dummy="$PATH"
5493   for ac_dir in $ac_dummy; do 
5494     test -z "$ac_dir" && ac_dir=.
5495     if test -f $ac_dir/$ac_word; then
5496       ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
5497       break
5498     fi
5499   done
5500   IFS="$ac_save_ifs"
5501   ;;
5502 esac
5503 fi
5504 NCURSES_CONFIG="$ac_cv_path_NCURSES_CONFIG"
5505 if test -n "$NCURSES_CONFIG"; then
5506   echo "$ac_t""$NCURSES_CONFIG" 1>&6
5507 else
5508   echo "$ac_t""no" 1>&6
5509 fi
5510
5511 test -n "$NCURSES_CONFIG" && break
5512 done
5513 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
5514
5515
5516 if test "$NCURSES_CONFIG" != none ; then
5517
5518 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5519 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5520
5521 # even with config script, some packages use no-override for curses.h
5522
5523 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
5524 echo "configure:5525: checking if we have identified curses headers" >&5
5525 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
5526   echo $ac_n "(cached) $ac_c" 1>&6
5527 else
5528   
5529 cf_cv_ncurses_header=none
5530 for cf_header in  \
5531     ncursesw/curses.h \
5532         ncursesw/ncurses.h \
5533         curses.h \
5534         ncurses.h 
5535 do
5536 cat > conftest.$ac_ext <<EOF
5537 #line 5538 "configure"
5538 #include "confdefs.h"
5539 #include <${cf_header}>
5540 int main() {
5541 initscr(); tgoto("?", 0,0)
5542 ; return 0; }
5543 EOF
5544 if { (eval echo configure:5545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5545   rm -rf conftest*
5546   cf_cv_ncurses_header=$cf_header; break
5547 else
5548   echo "configure: failed program was:" >&5
5549   cat conftest.$ac_ext >&5
5550 fi
5551 rm -f conftest*
5552 done
5553
5554 fi
5555
5556 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
5557
5558 if test "$cf_cv_ncurses_header" = none ; then
5559         { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
5560 fi
5561
5562 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5563 for ac_hdr in $cf_cv_ncurses_header
5564 do
5565 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5566 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5567 echo "configure:5568: checking for $ac_hdr" >&5
5568 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5569   echo $ac_n "(cached) $ac_c" 1>&6
5570 else
5571   cat > conftest.$ac_ext <<EOF
5572 #line 5573 "configure"
5573 #include "confdefs.h"
5574 #include <$ac_hdr>
5575 EOF
5576 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5577 { (eval echo configure:5578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5578 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5579 if test -z "$ac_err"; then
5580   rm -rf conftest*
5581   eval "ac_cv_header_$ac_safe=yes"
5582 else
5583   echo "$ac_err" >&5
5584   echo "configure: failed program was:" >&5
5585   cat conftest.$ac_ext >&5
5586   rm -rf conftest*
5587   eval "ac_cv_header_$ac_safe=no"
5588 fi
5589 rm -f conftest*
5590 fi
5591 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5592   echo "$ac_t""yes" 1>&6
5593     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5594   cat >> confdefs.h <<EOF
5595 #define $ac_tr_hdr 1
5596 EOF
5597  
5598 else
5599   echo "$ac_t""no" 1>&6
5600 fi
5601 done
5602
5603
5604
5605 cat >> confdefs.h <<\EOF
5606 #define NCURSES 1
5607 EOF
5608
5609
5610
5611 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5612
5613 cat >> confdefs.h <<EOF
5614 #define $cf_nculib_ROOT 1
5615 EOF
5616
5617
5618 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5619
5620 else
5621
5622
5623
5624 cf_ncuhdr_root=ncursesw
5625
5626 test -n "$cf_cv_curses_dir" && \
5627 test "$cf_cv_curses_dir" != "no" && { \
5628   
5629 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5630   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
5631   do
5632         while test $cf_add_incdir != /usr/include
5633         do
5634           if test -d $cf_add_incdir
5635           then
5636                 cf_have_incdir=no
5637                 if test -n "$CFLAGS$CPPFLAGS" ; then
5638                   # a loop is needed to ensure we can add subdirs of existing dirs
5639                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5640                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5641                           cf_have_incdir=yes; break
5642                         fi
5643                   done
5644                 fi
5645
5646                 if test "$cf_have_incdir" = no ; then
5647                   if test "$cf_add_incdir" = /usr/local/include ; then
5648                         if test "$GCC" = yes
5649                         then
5650                           cf_save_CPPFLAGS=$CPPFLAGS
5651                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5652                           cat > conftest.$ac_ext <<EOF
5653 #line 5654 "configure"
5654 #include "confdefs.h"
5655 #include <stdio.h>
5656 int main() {
5657 printf("Hello")
5658 ; return 0; }
5659 EOF
5660 if { (eval echo configure:5661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5661   :
5662 else
5663   echo "configure: failed program was:" >&5
5664   cat conftest.$ac_ext >&5
5665   rm -rf conftest*
5666   cf_have_incdir=yes
5667 fi
5668 rm -f conftest*
5669                           CPPFLAGS=$cf_save_CPPFLAGS
5670                         fi
5671                   fi
5672                 fi
5673
5674                 if test "$cf_have_incdir" = no ; then
5675                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5676
5677 echo "${as_me-configure}:5678: testing adding $cf_add_incdir to include-path ..." 1>&5
5678
5679
5680                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5681
5682                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5683                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5684                   cf_add_incdir="$cf_top_incdir"
5685                 else
5686                   break
5687                 fi
5688           fi
5689         done
5690   done
5691 fi
5692
5693 }
5694
5695 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
5696 echo "configure:5697: checking for $cf_ncuhdr_root header in include-path" >&5
5697 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
5698   echo $ac_n "(cached) $ac_c" 1>&6
5699 else
5700   
5701         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5702         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5703         for cf_header in $cf_header_list
5704         do
5705                 
5706         cat > conftest.$ac_ext <<EOF
5707 #line 5708 "configure"
5708 #include "confdefs.h"
5709
5710
5711 #define _XOPEN_SOURCE_EXTENDED
5712 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
5713 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
5714
5715 #include <$cf_header>
5716 int main() {
5717
5718 #ifdef NCURSES_VERSION
5719
5720 #ifndef WACS_BSSB
5721         make an error
5722 #endif
5723
5724 printf("%s\n", NCURSES_VERSION);
5725 #else
5726 #ifdef __NCURSES_H
5727 printf("old\n");
5728 #else
5729         make an error
5730 #endif
5731 #endif
5732         
5733         
5734 ; return 0; }
5735 EOF
5736 if { (eval echo configure:5737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5737   rm -rf conftest*
5738   cf_cv_ncurses_h=$cf_header
5739         
5740 else
5741   echo "configure: failed program was:" >&5
5742   cat conftest.$ac_ext >&5
5743   rm -rf conftest*
5744   cf_cv_ncurses_h=no
5745 fi
5746 rm -f conftest*
5747
5748                 test "$cf_cv_ncurses_h" != no && break
5749         done
5750
5751 fi
5752
5753 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
5754
5755
5756
5757 if test "$cf_cv_ncurses_h" != no ; then
5758         cf_cv_ncurses_header=$cf_cv_ncurses_h
5759 else
5760
5761 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
5762 echo "configure:5763: checking for $cf_ncuhdr_root include-path" >&5
5763 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
5764   echo $ac_n "(cached) $ac_c" 1>&6
5765 else
5766   
5767         test -n "$verbose" && echo
5768         
5769 cf_search=
5770
5771 # collect the current set of include-directories from compiler flags
5772 cf_header_path_list=""
5773 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5774         for cf_header_path in $CPPFLAGS $CFLAGS
5775         do
5776                 case $cf_header_path in #(vi
5777                 -I*)
5778                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5779                         
5780 test "$cf_header_path" != "NONE" && \
5781 test -d "$cf_header_path" && \
5782  {
5783         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5784         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5785         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5786         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5787         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5788         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5789 }
5790
5791                         cf_header_path_list="$cf_header_path_list $cf_search"
5792                         ;;
5793                 esac
5794         done
5795 fi
5796
5797 # add the variations for the package we are looking for
5798
5799 cf_search=
5800
5801
5802 test "/usr" != "$prefix" && \
5803 test -d "/usr" && \
5804 (test $prefix = NONE || test -d $prefix) && {
5805         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5806         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5807         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
5808         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
5809         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
5810         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5811 }
5812
5813
5814 test "$prefix" != "NONE" && \
5815 test -d "$prefix" && \
5816  {
5817         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5818         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5819         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5820         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5821         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5822         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5823 }
5824
5825
5826 test "/usr/local" != "$prefix" && \
5827 test -d "/usr/local" && \
5828 (test $prefix = NONE || test -d $prefix) && {
5829         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5830         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5831         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
5832         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
5833         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
5834         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5835 }
5836
5837
5838 test "/opt" != "$prefix" && \
5839 test -d "/opt" && \
5840 (test $prefix = NONE || test -d $prefix) && {
5841         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5842         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5843         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
5844         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
5845         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
5846         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5847 }
5848
5849
5850 test "$HOME" != "$prefix" && \
5851 test -d "$HOME" && \
5852 (test $prefix = NONE || test -d $prefix) && {
5853         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5854         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5855         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
5856         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
5857         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
5858         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5859 }
5860
5861
5862
5863 test "$includedir" != NONE && \
5864 test "$includedir" != "/usr/include" && \
5865 test -d "$includedir" && {
5866         test -d $includedir &&    cf_search="$cf_search $includedir"
5867         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5868 }
5869
5870 test "$oldincludedir" != NONE && \
5871 test "$oldincludedir" != "/usr/include" && \
5872 test -d "$oldincludedir" && {
5873         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5874         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5875 }
5876
5877 cf_search="$cf_search $cf_header_path_list"
5878
5879         test -n "$verbose" && echo search path $cf_search
5880         cf_save2_CPPFLAGS="$CPPFLAGS"
5881         for cf_incdir in $cf_search
5882         do
5883                 
5884 if test -n "$cf_incdir" ; then
5885   for cf_add_incdir in $cf_incdir
5886   do
5887         while test $cf_add_incdir != /usr/include
5888         do
5889           if test -d $cf_add_incdir
5890           then
5891                 cf_have_incdir=no
5892                 if test -n "$CFLAGS$CPPFLAGS" ; then
5893                   # a loop is needed to ensure we can add subdirs of existing dirs
5894                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5895                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5896                           cf_have_incdir=yes; break
5897                         fi
5898                   done
5899                 fi
5900
5901                 if test "$cf_have_incdir" = no ; then
5902                   if test "$cf_add_incdir" = /usr/local/include ; then
5903                         if test "$GCC" = yes
5904                         then
5905                           cf_save_CPPFLAGS=$CPPFLAGS
5906                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5907                           cat > conftest.$ac_ext <<EOF
5908 #line 5909 "configure"
5909 #include "confdefs.h"
5910 #include <stdio.h>
5911 int main() {
5912 printf("Hello")
5913 ; return 0; }
5914 EOF
5915 if { (eval echo configure:5916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5916   :
5917 else
5918   echo "configure: failed program was:" >&5
5919   cat conftest.$ac_ext >&5
5920   rm -rf conftest*
5921   cf_have_incdir=yes
5922 fi
5923 rm -f conftest*
5924                           CPPFLAGS=$cf_save_CPPFLAGS
5925                         fi
5926                   fi
5927                 fi
5928
5929                 if test "$cf_have_incdir" = no ; then
5930                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5931
5932 echo "${as_me-configure}:5933: testing adding $cf_add_incdir to include-path ..." 1>&5
5933
5934
5935                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5936
5937                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5938                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5939                   cf_add_incdir="$cf_top_incdir"
5940                 else
5941                   break
5942                 fi
5943           fi
5944         done
5945   done
5946 fi
5947
5948                 for cf_header in \
5949                         ncurses.h \
5950                         curses.h
5951                 do
5952                         
5953         cat > conftest.$ac_ext <<EOF
5954 #line 5955 "configure"
5955 #include "confdefs.h"
5956
5957
5958 #include <$cf_header>
5959 int main() {
5960
5961 #ifdef NCURSES_VERSION
5962
5963 printf("%s\n", NCURSES_VERSION);
5964 #else
5965 #ifdef __NCURSES_H
5966 printf("old\n");
5967 #else
5968         make an error
5969 #endif
5970 #endif
5971         
5972         
5973 ; return 0; }
5974 EOF
5975 if { (eval echo configure:5976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5976   rm -rf conftest*
5977   cf_cv_ncurses_h2=$cf_header
5978         
5979 else
5980   echo "configure: failed program was:" >&5
5981   cat conftest.$ac_ext >&5
5982   rm -rf conftest*
5983   cf_cv_ncurses_h2=no
5984 fi
5985 rm -f conftest*
5986
5987                         if test "$cf_cv_ncurses_h2" != no ; then
5988                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5989                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5990                                 break
5991                         fi
5992                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5993                 done
5994                 CPPFLAGS="$cf_save2_CPPFLAGS"
5995                 test "$cf_cv_ncurses_h2" != no && break
5996         done
5997         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
5998         
5999 fi
6000
6001 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
6002
6003         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6004         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6005         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6006                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6007         fi
6008         
6009 if test -n "$cf_1st_incdir" ; then
6010   for cf_add_incdir in $cf_1st_incdir
6011   do
6012         while test $cf_add_incdir != /usr/include
6013         do
6014           if test -d $cf_add_incdir
6015           then
6016                 cf_have_incdir=no
6017                 if test -n "$CFLAGS$CPPFLAGS" ; then
6018                   # a loop is needed to ensure we can add subdirs of existing dirs
6019                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6020                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6021                           cf_have_incdir=yes; break
6022                         fi
6023                   done
6024                 fi
6025
6026                 if test "$cf_have_incdir" = no ; then
6027                   if test "$cf_add_incdir" = /usr/local/include ; then
6028                         if test "$GCC" = yes
6029                         then
6030                           cf_save_CPPFLAGS=$CPPFLAGS
6031                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6032                           cat > conftest.$ac_ext <<EOF
6033 #line 6034 "configure"
6034 #include "confdefs.h"
6035 #include <stdio.h>
6036 int main() {
6037 printf("Hello")
6038 ; return 0; }
6039 EOF
6040 if { (eval echo configure:6041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6041   :
6042 else
6043   echo "configure: failed program was:" >&5
6044   cat conftest.$ac_ext >&5
6045   rm -rf conftest*
6046   cf_have_incdir=yes
6047 fi
6048 rm -f conftest*
6049                           CPPFLAGS=$cf_save_CPPFLAGS
6050                         fi
6051                   fi
6052                 fi
6053
6054                 if test "$cf_have_incdir" = no ; then
6055                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6056
6057 echo "${as_me-configure}:6058: testing adding $cf_add_incdir to include-path ..." 1>&5
6058
6059
6060                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6061
6062                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6063                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6064                   cf_add_incdir="$cf_top_incdir"
6065                 else
6066                   break
6067                 fi
6068           fi
6069         done
6070   done
6071 fi
6072
6073
6074 fi
6075
6076 # Set definitions to allow ifdef'ing for ncurses.h
6077
6078 case $cf_cv_ncurses_header in # (vi
6079 *ncurses.h)
6080         cat >> confdefs.h <<\EOF
6081 #define HAVE_NCURSES_H 1
6082 EOF
6083
6084         ;;
6085 esac
6086
6087 case $cf_cv_ncurses_header in # (vi
6088 ncurses/curses.h|ncurses/ncurses.h)
6089         cat >> confdefs.h <<\EOF
6090 #define HAVE_NCURSES_NCURSES_H 1
6091 EOF
6092
6093         ;;
6094 ncursesw/curses.h|ncursesw/ncurses.h)
6095         cat >> confdefs.h <<\EOF
6096 #define HAVE_NCURSESW_NCURSES_H 1
6097 EOF
6098
6099         ;;
6100 esac
6101
6102
6103
6104 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
6105 echo "configure:6106: checking for terminfo header" >&5
6106 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
6107   echo $ac_n "(cached) $ac_c" 1>&6
6108 else
6109   
6110 case ${cf_cv_ncurses_header} in #(vi
6111 */ncurses.h|*/ncursesw.h) #(vi
6112         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6113         ;;
6114 *)
6115         cf_term_header=term.h
6116         ;;
6117 esac
6118
6119 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6120 do
6121 cat > conftest.$ac_ext <<EOF
6122 #line 6123 "configure"
6123 #include "confdefs.h"
6124 #include <stdio.h>
6125 #include <${cf_cv_ncurses_header-curses.h}>
6126 #include <$cf_test>
6127
6128 int main() {
6129 int x = auto_left_margin
6130 ; return 0; }
6131 EOF
6132 if { (eval echo configure:6133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6133   rm -rf conftest*
6134   
6135         cf_cv_term_header="$cf_test"
6136 else
6137   echo "configure: failed program was:" >&5
6138   cat conftest.$ac_ext >&5
6139   rm -rf conftest*
6140   
6141         cf_cv_term_header=unknown
6142         
6143 fi
6144 rm -f conftest*
6145         test "$cf_cv_term_header" != unknown && break
6146 done
6147
6148 fi
6149
6150 echo "$ac_t""$cf_cv_term_header" 1>&6
6151
6152 # Set definitions to allow ifdef'ing to accommodate subdirectories
6153
6154 case $cf_cv_term_header in # (vi
6155 *term.h)
6156         cat >> confdefs.h <<\EOF
6157 #define HAVE_TERM_H 1
6158 EOF
6159
6160         ;;
6161 esac
6162
6163 case $cf_cv_term_header in # (vi
6164 ncurses/term.h) #(vi
6165         cat >> confdefs.h <<\EOF
6166 #define HAVE_NCURSES_TERM_H 1
6167 EOF
6168
6169         ;;
6170 ncursesw/term.h)
6171         cat >> confdefs.h <<\EOF
6172 #define HAVE_NCURSESW_TERM_H 1
6173 EOF
6174
6175         ;;
6176 esac
6177
6178
6179 # some applications need this, but should check for NCURSES_VERSION
6180 cat >> confdefs.h <<\EOF
6181 #define NCURSES 1
6182 EOF
6183
6184
6185
6186 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
6187 echo "configure:6188: checking for ncurses version" >&5
6188 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
6189   echo $ac_n "(cached) $ac_c" 1>&6
6190 else
6191   
6192         cf_cv_ncurses_version=no
6193         cf_tempfile=out$$
6194         rm -f $cf_tempfile
6195         if test "$cross_compiling" = yes; then
6196   
6197
6198         # This will not work if the preprocessor splits the line after the
6199         # Autoconf token.  The 'unproto' program does that.
6200         cat > conftest.$ac_ext <<EOF
6201 #include <${cf_cv_ncurses_header-curses.h}>
6202 #undef Autoconf
6203 #ifdef NCURSES_VERSION
6204 Autoconf NCURSES_VERSION
6205 #else
6206 #ifdef __NCURSES_H
6207 Autoconf "old"
6208 #endif
6209 ;
6210 #endif
6211 EOF
6212         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6213         { (eval echo configure:6214: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
6214         if test -f conftest.out ; then
6215                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6216                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6217                 rm -f conftest.out
6218         fi
6219
6220 else
6221   cat > conftest.$ac_ext <<EOF
6222 #line 6223 "configure"
6223 #include "confdefs.h"
6224
6225 #include <${cf_cv_ncurses_header-curses.h}>
6226 #include <stdio.h>
6227 int main()
6228 {
6229         FILE *fp = fopen("$cf_tempfile", "w");
6230 #ifdef NCURSES_VERSION
6231 # ifdef NCURSES_VERSION_PATCH
6232         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6233 # else
6234         fprintf(fp, "%s\n", NCURSES_VERSION);
6235 # endif
6236 #else
6237 # ifdef __NCURSES_H
6238         fprintf(fp, "old\n");
6239 # else
6240         make an error
6241 # endif
6242 #endif
6243         ${cf_cv_main_return-return}(0);
6244 }
6245 EOF
6246 if { (eval echo configure:6247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6247 then
6248   
6249         cf_cv_ncurses_version=`cat $cf_tempfile`
6250 else
6251   echo "configure: failed program was:" >&5
6252   cat conftest.$ac_ext >&5
6253 fi
6254 rm -fr conftest*
6255 fi
6256
6257         rm -f $cf_tempfile
6258
6259 fi
6260
6261 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
6262 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
6263 #define NCURSES 1
6264 EOF
6265
6266
6267
6268
6269
6270 cf_nculib_root=ncursesw
6271         # This works, except for the special case where we find gpm, but
6272         # ncurses is in a nonstandard location via $LIBS, and we really want
6273         # to link gpm.
6274 cf_ncurses_LIBS=""
6275 cf_ncurses_SAVE="$LIBS"
6276 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
6277 echo "configure:6278: checking for Gpm_Open in -lgpm" >&5
6278 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
6279 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6280   echo $ac_n "(cached) $ac_c" 1>&6
6281 else
6282   ac_save_LIBS="$LIBS"
6283 LIBS="-lgpm  $LIBS"
6284 cat > conftest.$ac_ext <<EOF
6285 #line 6286 "configure"
6286 #include "confdefs.h"
6287 /* Override any gcc2 internal prototype to avoid an error.  */
6288 /* We use char because int might match the return type of a gcc2
6289     builtin and then its argument prototype would still apply.  */
6290 char Gpm_Open();
6291
6292 int main() {
6293 Gpm_Open()
6294 ; return 0; }
6295 EOF
6296 if { (eval echo configure:6297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6297   rm -rf conftest*
6298   eval "ac_cv_lib_$ac_lib_var=yes"
6299 else
6300   echo "configure: failed program was:" >&5
6301   cat conftest.$ac_ext >&5
6302   rm -rf conftest*
6303   eval "ac_cv_lib_$ac_lib_var=no"
6304 fi
6305 rm -f conftest*
6306 LIBS="$ac_save_LIBS"
6307
6308 fi
6309 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6310   echo "$ac_t""yes" 1>&6
6311   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
6312 echo "configure:6313: checking for initscr in -lgpm" >&5
6313 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
6314 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6315   echo $ac_n "(cached) $ac_c" 1>&6
6316 else
6317   ac_save_LIBS="$LIBS"
6318 LIBS="-lgpm  $LIBS"
6319 cat > conftest.$ac_ext <<EOF
6320 #line 6321 "configure"
6321 #include "confdefs.h"
6322 /* Override any gcc2 internal prototype to avoid an error.  */
6323 /* We use char because int might match the return type of a gcc2
6324     builtin and then its argument prototype would still apply.  */
6325 char initscr();
6326
6327 int main() {
6328 initscr()
6329 ; return 0; }
6330 EOF
6331 if { (eval echo configure:6332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6332   rm -rf conftest*
6333   eval "ac_cv_lib_$ac_lib_var=yes"
6334 else
6335   echo "configure: failed program was:" >&5
6336   cat conftest.$ac_ext >&5
6337   rm -rf conftest*
6338   eval "ac_cv_lib_$ac_lib_var=no"
6339 fi
6340 rm -f conftest*
6341 LIBS="$ac_save_LIBS"
6342
6343 fi
6344 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6345   echo "$ac_t""yes" 1>&6
6346   LIBS="$cf_ncurses_SAVE"
6347 else
6348   echo "$ac_t""no" 1>&6
6349 cf_ncurses_LIBS="-lgpm"
6350 fi
6351
6352 else
6353   echo "$ac_t""no" 1>&6
6354 fi
6355
6356
6357 case $host_os in #(vi
6358 freebsd*)
6359         # This is only necessary if you are linking against an obsolete
6360         # version of ncurses (but it should do no harm, since it's static).
6361         if test "$cf_nculib_root" = ncurses ; then
6362                 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
6363 echo "configure:6364: checking for tgoto in -lmytinfo" >&5
6364 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
6365 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6366   echo $ac_n "(cached) $ac_c" 1>&6
6367 else
6368   ac_save_LIBS="$LIBS"
6369 LIBS="-lmytinfo  $LIBS"
6370 cat > conftest.$ac_ext <<EOF
6371 #line 6372 "configure"
6372 #include "confdefs.h"
6373 /* Override any gcc2 internal prototype to avoid an error.  */
6374 /* We use char because int might match the return type of a gcc2
6375     builtin and then its argument prototype would still apply.  */
6376 char tgoto();
6377
6378 int main() {
6379 tgoto()
6380 ; return 0; }
6381 EOF
6382 if { (eval echo configure:6383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6383   rm -rf conftest*
6384   eval "ac_cv_lib_$ac_lib_var=yes"
6385 else
6386   echo "configure: failed program was:" >&5
6387   cat conftest.$ac_ext >&5
6388   rm -rf conftest*
6389   eval "ac_cv_lib_$ac_lib_var=no"
6390 fi
6391 rm -f conftest*
6392 LIBS="$ac_save_LIBS"
6393
6394 fi
6395 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6396   echo "$ac_t""yes" 1>&6
6397   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6398 else
6399   echo "$ac_t""no" 1>&6
6400 fi
6401
6402         fi
6403         ;;
6404 esac
6405
6406 LIBS="$cf_ncurses_LIBS $LIBS"
6407
6408 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6409 then
6410         
6411 if test -n "$cf_cv_curses_dir/lib" ; then
6412   for cf_add_libdir in $cf_cv_curses_dir/lib
6413   do
6414     if test $cf_add_libdir = /usr/lib ; then
6415       :
6416     elif test -d $cf_add_libdir
6417     then
6418       cf_have_libdir=no
6419       if test -n "$LDFLAGS$LIBS" ; then
6420         # a loop is needed to ensure we can add subdirs of existing dirs
6421         for cf_test_libdir in $LDFLAGS $LIBS ; do
6422           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6423             cf_have_libdir=yes; break
6424           fi
6425         done
6426       fi
6427       if test "$cf_have_libdir" = no ; then
6428         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6429
6430 echo "${as_me-configure}:6431: testing adding $cf_add_libdir to library-path ..." 1>&5
6431
6432
6433         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6434       fi
6435     fi
6436   done
6437 fi
6438
6439         LIBS="-l$cf_nculib_root $LIBS"
6440 else
6441         
6442         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6443         cf_libdir=""
6444         echo $ac_n "checking for initscr""... $ac_c" 1>&6
6445 echo "configure:6446: checking for initscr" >&5
6446 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
6447   echo $ac_n "(cached) $ac_c" 1>&6
6448 else
6449   cat > conftest.$ac_ext <<EOF
6450 #line 6451 "configure"
6451 #include "confdefs.h"
6452 /* System header to define __stub macros and hopefully few prototypes,
6453     which can conflict with char initscr(); below.  */
6454 #include <assert.h>
6455 /* Override any gcc2 internal prototype to avoid an error.  */
6456 /* We use char because int might match the return type of a gcc2
6457     builtin and then its argument prototype would still apply.  */
6458 char initscr();
6459
6460 int main() {
6461
6462 /* The GNU C library defines this for functions which it implements
6463     to always fail with ENOSYS.  Some functions are actually named
6464     something starting with __ and the normal name is an alias.  */
6465 #if defined (__stub_initscr) || defined (__stub___initscr)
6466 choke me
6467 #else
6468 initscr();
6469 #endif
6470
6471 ; return 0; }
6472 EOF
6473 if { (eval echo configure:6474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6474   rm -rf conftest*
6475   eval "ac_cv_func_initscr=yes"
6476 else
6477   echo "configure: failed program was:" >&5
6478   cat conftest.$ac_ext >&5
6479   rm -rf conftest*
6480   eval "ac_cv_func_initscr=no"
6481 fi
6482 rm -f conftest*
6483 fi
6484
6485 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
6486   echo "$ac_t""yes" 1>&6
6487   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6488 else
6489   echo "$ac_t""no" 1>&6
6490
6491                 cf_save_LIBS="$LIBS"
6492                 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
6493 echo "configure:6494: checking for initscr in -l$cf_nculib_root" >&5
6494                 LIBS="-l$cf_nculib_root $LIBS"
6495                 cat > conftest.$ac_ext <<EOF
6496 #line 6497 "configure"
6497 #include "confdefs.h"
6498 #include <${cf_cv_ncurses_header-curses.h}>
6499 int main() {
6500 initscr()
6501 ; return 0; }
6502 EOF
6503 if { (eval echo configure:6504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6504   rm -rf conftest*
6505   echo "$ac_t""yes" 1>&6
6506                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6507                         
6508 else
6509   echo "configure: failed program was:" >&5
6510   cat conftest.$ac_ext >&5
6511   rm -rf conftest*
6512   echo "$ac_t""no" 1>&6
6513                         
6514 cf_search=
6515 cf_library_path_list=""
6516 if test -n "${LDFLAGS}${LIBS}" ; then
6517         for cf_library_path in $LDFLAGS $LIBS
6518         do
6519                 case $cf_library_path in #(vi
6520                 -L*)
6521                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6522                         
6523 test "$cf_library_path" != "NONE" && \
6524 test -d "$cf_library_path" && \
6525  {
6526         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6527         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6528         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6529         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6530         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6531         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
6532 }
6533
6534                         cf_library_path_list="$cf_library_path_list $cf_search"
6535                         ;;
6536                 esac
6537         done
6538 fi
6539
6540
6541 cf_search=
6542
6543
6544 test "/usr" != "$prefix" && \
6545 test -d "/usr" && \
6546 (test $prefix = NONE || test -d $prefix) && {
6547         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6548         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6549         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6550         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6551         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6552         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6553 }
6554
6555
6556 test "$prefix" != "NONE" && \
6557 test -d "$prefix" && \
6558  {
6559         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6560         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6561         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6562         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6563         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6564         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6565 }
6566
6567
6568 test "/usr/local" != "$prefix" && \
6569 test -d "/usr/local" && \
6570 (test $prefix = NONE || test -d $prefix) && {
6571         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6572         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6573         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6574         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6575         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6576         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6577 }
6578
6579
6580 test "/opt" != "$prefix" && \
6581 test -d "/opt" && \
6582 (test $prefix = NONE || test -d $prefix) && {
6583         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6584         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6585         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6586         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6587         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6588         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6589 }
6590
6591
6592 test "$HOME" != "$prefix" && \
6593 test -d "$HOME" && \
6594 (test $prefix = NONE || test -d $prefix) && {
6595         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6596         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6597         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6598         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6599         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6600         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6601 }
6602
6603
6604
6605 cf_search="$cf_library_path_list $cf_search"
6606
6607                         for cf_libdir in $cf_search
6608                         do
6609                                 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
6610 echo "configure:6611: checking for -l$cf_nculib_root in $cf_libdir" >&5
6611                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6612                                 cat > conftest.$ac_ext <<EOF
6613 #line 6614 "configure"
6614 #include "confdefs.h"
6615 #include <${cf_cv_ncurses_header-curses.h}>
6616 int main() {
6617 initscr()
6618 ; return 0; }
6619 EOF
6620 if { (eval echo configure:6621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6621   rm -rf conftest*
6622   echo "$ac_t""yes" 1>&6
6623                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6624                                          break
6625 else
6626   echo "configure: failed program was:" >&5
6627   cat conftest.$ac_ext >&5
6628   rm -rf conftest*
6629   echo "$ac_t""no" 1>&6
6630                                          LIBS="$cf_save_LIBS"
6631 fi
6632 rm -f conftest*
6633                         done
6634                         
6635 fi
6636 rm -f conftest*
6637                 
6638 fi
6639
6640 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6641
6642 if test $cf_found_library = no ; then
6643         { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
6644 fi
6645
6646
6647 fi
6648
6649 if test -n "$cf_ncurses_LIBS" ; then
6650         echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
6651 echo "configure:6652: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6652         cf_ncurses_SAVE="$LIBS"
6653         for p in $cf_ncurses_LIBS ; do
6654                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6655                 if test "$q" != "$LIBS" ; then
6656                         LIBS="$q"
6657                 fi
6658         done
6659         cat > conftest.$ac_ext <<EOF
6660 #line 6661 "configure"
6661 #include "confdefs.h"
6662 #include <${cf_cv_ncurses_header-curses.h}>
6663 int main() {
6664 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6665 ; return 0; }
6666 EOF
6667 if { (eval echo configure:6668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6668   rm -rf conftest*
6669   echo "$ac_t""yes" 1>&6
6670 else
6671   echo "configure: failed program was:" >&5
6672   cat conftest.$ac_ext >&5
6673   rm -rf conftest*
6674   echo "$ac_t""no" 1>&6
6675                  LIBS="$cf_ncurses_SAVE"
6676 fi
6677 rm -f conftest*
6678 fi
6679
6680
6681 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6682
6683 cat >> confdefs.h <<EOF
6684 #define $cf_nculib_ROOT 1
6685 EOF
6686
6687
6688
6689 fi
6690
6691         ;;
6692 pdcurses) #(vi
6693         if test "$no_x" = yes; then
6694   # Not all programs may use this symbol, but it does not hurt to define it.
6695   cat >> confdefs.h <<\EOF
6696 #define X_DISPLAY_MISSING 1
6697 EOF
6698
6699   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
6700 else
6701   if test -n "$x_includes"; then
6702     X_CFLAGS="$X_CFLAGS -I$x_includes"
6703   fi
6704
6705   # It would also be nice to do this for all -L options, not just this one.
6706   if test -n "$x_libraries"; then
6707     X_LIBS="$X_LIBS -L$x_libraries"
6708     # For Solaris; some versions of Sun CC require a space after -R and
6709     # others require no space.  Words are not sufficient . . . .
6710     case "`(uname -sr) 2>/dev/null`" in
6711     "SunOS 5"*)
6712       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
6713 echo "configure:6714: checking whether -R must be followed by a space" >&5
6714       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
6715       cat > conftest.$ac_ext <<EOF
6716 #line 6717 "configure"
6717 #include "confdefs.h"
6718
6719 int main() {
6720
6721 ; return 0; }
6722 EOF
6723 if { (eval echo configure:6724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6724   rm -rf conftest*
6725   ac_R_nospace=yes
6726 else
6727   echo "configure: failed program was:" >&5
6728   cat conftest.$ac_ext >&5
6729   rm -rf conftest*
6730   ac_R_nospace=no
6731 fi
6732 rm -f conftest*
6733       if test $ac_R_nospace = yes; then
6734         echo "$ac_t""no" 1>&6
6735         X_LIBS="$X_LIBS -R$x_libraries"
6736       else
6737         LIBS="$ac_xsave_LIBS -R $x_libraries"
6738         cat > conftest.$ac_ext <<EOF
6739 #line 6740 "configure"
6740 #include "confdefs.h"
6741
6742 int main() {
6743
6744 ; return 0; }
6745 EOF
6746 if { (eval echo configure:6747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6747   rm -rf conftest*
6748   ac_R_space=yes
6749 else
6750   echo "configure: failed program was:" >&5
6751   cat conftest.$ac_ext >&5
6752   rm -rf conftest*
6753   ac_R_space=no
6754 fi
6755 rm -f conftest*
6756         if test $ac_R_space = yes; then
6757           echo "$ac_t""yes" 1>&6
6758           X_LIBS="$X_LIBS -R $x_libraries"
6759         else
6760           echo "$ac_t""neither works" 1>&6
6761         fi
6762       fi
6763       LIBS="$ac_xsave_LIBS"
6764     esac
6765   fi
6766
6767   # Check for system-dependent libraries X programs must link with.
6768   # Do this before checking for the system-independent R6 libraries
6769   # (-lICE), since we may need -lsocket or whatever for X linking.
6770
6771   if test "$ISC" = yes; then
6772     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
6773   else
6774     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
6775     # libraries were built with DECnet support.  And karl@cs.umb.edu says
6776     # the Alpha needs dnet_stub (dnet does not exist).
6777     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
6778 echo "configure:6779: checking for dnet_ntoa in -ldnet" >&5
6779 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
6780 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6781   echo $ac_n "(cached) $ac_c" 1>&6
6782 else
6783   ac_save_LIBS="$LIBS"
6784 LIBS="-ldnet  $LIBS"
6785 cat > conftest.$ac_ext <<EOF
6786 #line 6787 "configure"
6787 #include "confdefs.h"
6788 /* Override any gcc2 internal prototype to avoid an error.  */
6789 /* We use char because int might match the return type of a gcc2
6790     builtin and then its argument prototype would still apply.  */
6791 char dnet_ntoa();
6792
6793 int main() {
6794 dnet_ntoa()
6795 ; return 0; }
6796 EOF
6797 if { (eval echo configure:6798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6798   rm -rf conftest*
6799   eval "ac_cv_lib_$ac_lib_var=yes"
6800 else
6801   echo "configure: failed program was:" >&5
6802   cat conftest.$ac_ext >&5
6803   rm -rf conftest*
6804   eval "ac_cv_lib_$ac_lib_var=no"
6805 fi
6806 rm -f conftest*
6807 LIBS="$ac_save_LIBS"
6808
6809 fi
6810 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6811   echo "$ac_t""yes" 1>&6
6812   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
6813 else
6814   echo "$ac_t""no" 1>&6
6815 fi
6816
6817     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
6818       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
6819 echo "configure:6820: checking for dnet_ntoa in -ldnet_stub" >&5
6820 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
6821 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6822   echo $ac_n "(cached) $ac_c" 1>&6
6823 else
6824   ac_save_LIBS="$LIBS"
6825 LIBS="-ldnet_stub  $LIBS"
6826 cat > conftest.$ac_ext <<EOF
6827 #line 6828 "configure"
6828 #include "confdefs.h"
6829 /* Override any gcc2 internal prototype to avoid an error.  */
6830 /* We use char because int might match the return type of a gcc2
6831     builtin and then its argument prototype would still apply.  */
6832 char dnet_ntoa();
6833
6834 int main() {
6835 dnet_ntoa()
6836 ; return 0; }
6837 EOF
6838 if { (eval echo configure:6839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6839   rm -rf conftest*
6840   eval "ac_cv_lib_$ac_lib_var=yes"
6841 else
6842   echo "configure: failed program was:" >&5
6843   cat conftest.$ac_ext >&5
6844   rm -rf conftest*
6845   eval "ac_cv_lib_$ac_lib_var=no"
6846 fi
6847 rm -f conftest*
6848 LIBS="$ac_save_LIBS"
6849
6850 fi
6851 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6852   echo "$ac_t""yes" 1>&6
6853   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
6854 else
6855   echo "$ac_t""no" 1>&6
6856 fi
6857
6858     fi
6859
6860     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
6861     # to get the SysV transport functions.
6862     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
6863     # needs -lnsl.
6864     # The nsl library prevents programs from opening the X display
6865     # on Irix 5.2, according to dickey@clark.net.
6866     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
6867 echo "configure:6868: checking for gethostbyname" >&5
6868 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
6869   echo $ac_n "(cached) $ac_c" 1>&6
6870 else
6871   cat > conftest.$ac_ext <<EOF
6872 #line 6873 "configure"
6873 #include "confdefs.h"
6874 /* System header to define __stub macros and hopefully few prototypes,
6875     which can conflict with char gethostbyname(); below.  */
6876 #include <assert.h>
6877 /* Override any gcc2 internal prototype to avoid an error.  */
6878 /* We use char because int might match the return type of a gcc2
6879     builtin and then its argument prototype would still apply.  */
6880 char gethostbyname();
6881
6882 int main() {
6883
6884 /* The GNU C library defines this for functions which it implements
6885     to always fail with ENOSYS.  Some functions are actually named
6886     something starting with __ and the normal name is an alias.  */
6887 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
6888 choke me
6889 #else
6890 gethostbyname();
6891 #endif
6892
6893 ; return 0; }
6894 EOF
6895 if { (eval echo configure:6896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6896   rm -rf conftest*
6897   eval "ac_cv_func_gethostbyname=yes"
6898 else
6899   echo "configure: failed program was:" >&5
6900   cat conftest.$ac_ext >&5
6901   rm -rf conftest*
6902   eval "ac_cv_func_gethostbyname=no"
6903 fi
6904 rm -f conftest*
6905 fi
6906
6907 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
6908   echo "$ac_t""yes" 1>&6
6909   :
6910 else
6911   echo "$ac_t""no" 1>&6
6912 fi
6913
6914     if test $ac_cv_func_gethostbyname = no; then
6915       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
6916 echo "configure:6917: checking for gethostbyname in -lnsl" >&5
6917 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
6918 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6919   echo $ac_n "(cached) $ac_c" 1>&6
6920 else
6921   ac_save_LIBS="$LIBS"
6922 LIBS="-lnsl  $LIBS"
6923 cat > conftest.$ac_ext <<EOF
6924 #line 6925 "configure"
6925 #include "confdefs.h"
6926 /* Override any gcc2 internal prototype to avoid an error.  */
6927 /* We use char because int might match the return type of a gcc2
6928     builtin and then its argument prototype would still apply.  */
6929 char gethostbyname();
6930
6931 int main() {
6932 gethostbyname()
6933 ; return 0; }
6934 EOF
6935 if { (eval echo configure:6936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6936   rm -rf conftest*
6937   eval "ac_cv_lib_$ac_lib_var=yes"
6938 else
6939   echo "configure: failed program was:" >&5
6940   cat conftest.$ac_ext >&5
6941   rm -rf conftest*
6942   eval "ac_cv_lib_$ac_lib_var=no"
6943 fi
6944 rm -f conftest*
6945 LIBS="$ac_save_LIBS"
6946
6947 fi
6948 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6949   echo "$ac_t""yes" 1>&6
6950   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
6951 else
6952   echo "$ac_t""no" 1>&6
6953 fi
6954
6955     fi
6956
6957     # lieder@skyler.mavd.honeywell.com says without -lsocket,
6958     # socket/setsockopt and other routines are undefined under SCO ODT
6959     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
6960     # on later versions), says simon@lia.di.epfl.ch: it contains
6961     # gethostby* variants that don't use the nameserver (or something).
6962     # -lsocket must be given before -lnsl if both are needed.
6963     # We assume that if connect needs -lnsl, so does gethostbyname.
6964     echo $ac_n "checking for connect""... $ac_c" 1>&6
6965 echo "configure:6966: checking for connect" >&5
6966 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
6967   echo $ac_n "(cached) $ac_c" 1>&6
6968 else
6969   cat > conftest.$ac_ext <<EOF
6970 #line 6971 "configure"
6971 #include "confdefs.h"
6972 /* System header to define __stub macros and hopefully few prototypes,
6973     which can conflict with char connect(); below.  */
6974 #include <assert.h>
6975 /* Override any gcc2 internal prototype to avoid an error.  */
6976 /* We use char because int might match the return type of a gcc2
6977     builtin and then its argument prototype would still apply.  */
6978 char connect();
6979
6980 int main() {
6981
6982 /* The GNU C library defines this for functions which it implements
6983     to always fail with ENOSYS.  Some functions are actually named
6984     something starting with __ and the normal name is an alias.  */
6985 #if defined (__stub_connect) || defined (__stub___connect)
6986 choke me
6987 #else
6988 connect();
6989 #endif
6990
6991 ; return 0; }
6992 EOF
6993 if { (eval echo configure:6994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6994   rm -rf conftest*
6995   eval "ac_cv_func_connect=yes"
6996 else
6997   echo "configure: failed program was:" >&5
6998   cat conftest.$ac_ext >&5
6999   rm -rf conftest*
7000   eval "ac_cv_func_connect=no"
7001 fi
7002 rm -f conftest*
7003 fi
7004
7005 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
7006   echo "$ac_t""yes" 1>&6
7007   :
7008 else
7009   echo "$ac_t""no" 1>&6
7010 fi
7011
7012     if test $ac_cv_func_connect = no; then
7013       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
7014 echo "configure:7015: checking for connect in -lsocket" >&5
7015 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
7016 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7017   echo $ac_n "(cached) $ac_c" 1>&6
7018 else
7019   ac_save_LIBS="$LIBS"
7020 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
7021 cat > conftest.$ac_ext <<EOF
7022 #line 7023 "configure"
7023 #include "confdefs.h"
7024 /* Override any gcc2 internal prototype to avoid an error.  */
7025 /* We use char because int might match the return type of a gcc2
7026     builtin and then its argument prototype would still apply.  */
7027 char connect();
7028
7029 int main() {
7030 connect()
7031 ; return 0; }
7032 EOF
7033 if { (eval echo configure:7034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7034   rm -rf conftest*
7035   eval "ac_cv_lib_$ac_lib_var=yes"
7036 else
7037   echo "configure: failed program was:" >&5
7038   cat conftest.$ac_ext >&5
7039   rm -rf conftest*
7040   eval "ac_cv_lib_$ac_lib_var=no"
7041 fi
7042 rm -f conftest*
7043 LIBS="$ac_save_LIBS"
7044
7045 fi
7046 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7047   echo "$ac_t""yes" 1>&6
7048   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
7049 else
7050   echo "$ac_t""no" 1>&6
7051 fi
7052
7053     fi
7054
7055     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
7056     echo $ac_n "checking for remove""... $ac_c" 1>&6
7057 echo "configure:7058: checking for remove" >&5
7058 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
7059   echo $ac_n "(cached) $ac_c" 1>&6
7060 else
7061   cat > conftest.$ac_ext <<EOF
7062 #line 7063 "configure"
7063 #include "confdefs.h"
7064 /* System header to define __stub macros and hopefully few prototypes,
7065     which can conflict with char remove(); below.  */
7066 #include <assert.h>
7067 /* Override any gcc2 internal prototype to avoid an error.  */
7068 /* We use char because int might match the return type of a gcc2
7069     builtin and then its argument prototype would still apply.  */
7070 char remove();
7071
7072 int main() {
7073
7074 /* The GNU C library defines this for functions which it implements
7075     to always fail with ENOSYS.  Some functions are actually named
7076     something starting with __ and the normal name is an alias.  */
7077 #if defined (__stub_remove) || defined (__stub___remove)
7078 choke me
7079 #else
7080 remove();
7081 #endif
7082
7083 ; return 0; }
7084 EOF
7085 if { (eval echo configure:7086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7086   rm -rf conftest*
7087   eval "ac_cv_func_remove=yes"
7088 else
7089   echo "configure: failed program was:" >&5
7090   cat conftest.$ac_ext >&5
7091   rm -rf conftest*
7092   eval "ac_cv_func_remove=no"
7093 fi
7094 rm -f conftest*
7095 fi
7096
7097 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
7098   echo "$ac_t""yes" 1>&6
7099   :
7100 else
7101   echo "$ac_t""no" 1>&6
7102 fi
7103
7104     if test $ac_cv_func_remove = no; then
7105       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
7106 echo "configure:7107: checking for remove in -lposix" >&5
7107 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
7108 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7109   echo $ac_n "(cached) $ac_c" 1>&6
7110 else
7111   ac_save_LIBS="$LIBS"
7112 LIBS="-lposix  $LIBS"
7113 cat > conftest.$ac_ext <<EOF
7114 #line 7115 "configure"
7115 #include "confdefs.h"
7116 /* Override any gcc2 internal prototype to avoid an error.  */
7117 /* We use char because int might match the return type of a gcc2
7118     builtin and then its argument prototype would still apply.  */
7119 char remove();
7120
7121 int main() {
7122 remove()
7123 ; return 0; }
7124 EOF
7125 if { (eval echo configure:7126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7126   rm -rf conftest*
7127   eval "ac_cv_lib_$ac_lib_var=yes"
7128 else
7129   echo "configure: failed program was:" >&5
7130   cat conftest.$ac_ext >&5
7131   rm -rf conftest*
7132   eval "ac_cv_lib_$ac_lib_var=no"
7133 fi
7134 rm -f conftest*
7135 LIBS="$ac_save_LIBS"
7136
7137 fi
7138 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7139   echo "$ac_t""yes" 1>&6
7140   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
7141 else
7142   echo "$ac_t""no" 1>&6
7143 fi
7144
7145     fi
7146
7147     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
7148     echo $ac_n "checking for shmat""... $ac_c" 1>&6
7149 echo "configure:7150: checking for shmat" >&5
7150 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
7151   echo $ac_n "(cached) $ac_c" 1>&6
7152 else
7153   cat > conftest.$ac_ext <<EOF
7154 #line 7155 "configure"
7155 #include "confdefs.h"
7156 /* System header to define __stub macros and hopefully few prototypes,
7157     which can conflict with char shmat(); below.  */
7158 #include <assert.h>
7159 /* Override any gcc2 internal prototype to avoid an error.  */
7160 /* We use char because int might match the return type of a gcc2
7161     builtin and then its argument prototype would still apply.  */
7162 char shmat();
7163
7164 int main() {
7165
7166 /* The GNU C library defines this for functions which it implements
7167     to always fail with ENOSYS.  Some functions are actually named
7168     something starting with __ and the normal name is an alias.  */
7169 #if defined (__stub_shmat) || defined (__stub___shmat)
7170 choke me
7171 #else
7172 shmat();
7173 #endif
7174
7175 ; return 0; }
7176 EOF
7177 if { (eval echo configure:7178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7178   rm -rf conftest*
7179   eval "ac_cv_func_shmat=yes"
7180 else
7181   echo "configure: failed program was:" >&5
7182   cat conftest.$ac_ext >&5
7183   rm -rf conftest*
7184   eval "ac_cv_func_shmat=no"
7185 fi
7186 rm -f conftest*
7187 fi
7188
7189 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
7190   echo "$ac_t""yes" 1>&6
7191   :
7192 else
7193   echo "$ac_t""no" 1>&6
7194 fi
7195
7196     if test $ac_cv_func_shmat = no; then
7197       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
7198 echo "configure:7199: checking for shmat in -lipc" >&5
7199 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
7200 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7201   echo $ac_n "(cached) $ac_c" 1>&6
7202 else
7203   ac_save_LIBS="$LIBS"
7204 LIBS="-lipc  $LIBS"
7205 cat > conftest.$ac_ext <<EOF
7206 #line 7207 "configure"
7207 #include "confdefs.h"
7208 /* Override any gcc2 internal prototype to avoid an error.  */
7209 /* We use char because int might match the return type of a gcc2
7210     builtin and then its argument prototype would still apply.  */
7211 char shmat();
7212
7213 int main() {
7214 shmat()
7215 ; return 0; }
7216 EOF
7217 if { (eval echo configure:7218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7218   rm -rf conftest*
7219   eval "ac_cv_lib_$ac_lib_var=yes"
7220 else
7221   echo "configure: failed program was:" >&5
7222   cat conftest.$ac_ext >&5
7223   rm -rf conftest*
7224   eval "ac_cv_lib_$ac_lib_var=no"
7225 fi
7226 rm -f conftest*
7227 LIBS="$ac_save_LIBS"
7228
7229 fi
7230 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7231   echo "$ac_t""yes" 1>&6
7232   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
7233 else
7234   echo "$ac_t""no" 1>&6
7235 fi
7236
7237     fi
7238   fi
7239
7240   # Check for libraries that X11R6 Xt/Xaw programs need.
7241   ac_save_LDFLAGS="$LDFLAGS"
7242   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
7243   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
7244   # check for ICE first), but we must link in the order -lSM -lICE or
7245   # we get undefined symbols.  So assume we have SM if we have ICE.
7246   # These have to be linked with before -lX11, unlike the other
7247   # libraries we check for below, so use a different variable.
7248   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
7249   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
7250 echo "configure:7251: checking for IceConnectionNumber in -lICE" >&5
7251 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
7252 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7253   echo $ac_n "(cached) $ac_c" 1>&6
7254 else
7255   ac_save_LIBS="$LIBS"
7256 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
7257 cat > conftest.$ac_ext <<EOF
7258 #line 7259 "configure"
7259 #include "confdefs.h"
7260 /* Override any gcc2 internal prototype to avoid an error.  */
7261 /* We use char because int might match the return type of a gcc2
7262     builtin and then its argument prototype would still apply.  */
7263 char IceConnectionNumber();
7264
7265 int main() {
7266 IceConnectionNumber()
7267 ; return 0; }
7268 EOF
7269 if { (eval echo configure:7270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7270   rm -rf conftest*
7271   eval "ac_cv_lib_$ac_lib_var=yes"
7272 else
7273   echo "configure: failed program was:" >&5
7274   cat conftest.$ac_ext >&5
7275   rm -rf conftest*
7276   eval "ac_cv_lib_$ac_lib_var=no"
7277 fi
7278 rm -f conftest*
7279 LIBS="$ac_save_LIBS"
7280
7281 fi
7282 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7283   echo "$ac_t""yes" 1>&6
7284   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
7285 else
7286   echo "$ac_t""no" 1>&6
7287 fi
7288
7289   LDFLAGS="$ac_save_LDFLAGS"
7290
7291 fi
7292
7293
7294
7295
7296
7297 # SYSTEM_NAME=`echo "$cf_cv_system_name"|tr ' ' -`
7298
7299 cf_have_X_LIBS=no
7300
7301 LDFLAGS="$X_LIBS $LDFLAGS"
7302
7303 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
7304
7305 echo "${as_me-configure}:7306: testing checking additions to CFLAGS ..." 1>&5
7306
7307
7308 cf_check_cflags="$CFLAGS"
7309 cf_check_cppflags="$CPPFLAGS"
7310
7311 cf_fix_cppflags=no
7312 cf_new_cflags=
7313 cf_new_cppflags=
7314 cf_new_extra_cppflags=
7315
7316 for cf_add_cflags in $X_CFLAGS
7317 do
7318 case $cf_fix_cppflags in
7319 no)
7320         case $cf_add_cflags in #(vi
7321         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
7322                 case $cf_add_cflags in
7323                 -D*)
7324                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7325
7326                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7327                                 && test -z "${cf_tst_cflags}" \
7328                                 && cf_fix_cppflags=yes
7329
7330                         if test $cf_fix_cppflags = yes ; then
7331                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7332                                 continue
7333                         elif test "${cf_tst_cflags}" = "\"'" ; then
7334                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7335                                 continue
7336                         fi
7337                         ;;
7338                 esac
7339                 case "$CPPFLAGS" in
7340                 *$cf_add_cflags) #(vi
7341                         ;;
7342                 *) #(vi
7343                         case $cf_add_cflags in #(vi
7344                         -D*)
7345                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7346                                 
7347 CPPFLAGS=`echo "$CPPFLAGS" | \
7348         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7349                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7350
7351                                 ;;
7352                         esac
7353                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
7354                         ;;
7355                 esac
7356                 ;;
7357         *)
7358                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
7359                 ;;
7360         esac
7361         ;;
7362 yes)
7363         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7364
7365         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7366
7367         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7368                 && test -z "${cf_tst_cflags}" \
7369                 && cf_fix_cppflags=no
7370         ;;
7371 esac
7372 done
7373
7374 if test -n "$cf_new_cflags" ; then
7375         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
7376
7377 echo "${as_me-configure}:7378: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
7378
7379
7380         CFLAGS="$CFLAGS $cf_new_cflags"
7381 fi
7382
7383 if test -n "$cf_new_cppflags" ; then
7384         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
7385
7386 echo "${as_me-configure}:7387: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
7387
7388
7389         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
7390 fi
7391
7392 if test -n "$cf_new_extra_cppflags" ; then
7393         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
7394
7395 echo "${as_me-configure}:7396: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
7396
7397
7398         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
7399 fi
7400
7401
7402
7403
7404 if test "$cf_check_cflags" != "$CFLAGS" ; then
7405 cat > conftest.$ac_ext <<EOF
7406 #line 7407 "configure"
7407 #include "confdefs.h"
7408 #include <stdio.h>
7409 int main() {
7410 printf("Hello world");
7411 ; return 0; }
7412 EOF
7413 if { (eval echo configure:7414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7414   :
7415 else
7416   echo "configure: failed program was:" >&5
7417   cat conftest.$ac_ext >&5
7418   rm -rf conftest*
7419   test -n "$verbose" && echo "  test-compile failed.  Undoing change to \$CFLAGS" 1>&6
7420
7421 echo "${as_me-configure}:7422: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
7422
7423
7424          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
7425                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
7426
7427 echo "${as_me-configure}:7428: testing but keeping change to \$CPPFLAGS ..." 1>&5
7428
7429
7430          fi
7431          CFLAGS="$cf_check_flags"
7432 fi
7433 rm -f conftest*
7434 fi
7435
7436
7437 echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6
7438 echo "configure:7439: checking for XOpenDisplay" >&5
7439 if eval "test \"`echo '$''{'ac_cv_func_XOpenDisplay'+set}'`\" = set"; then
7440   echo $ac_n "(cached) $ac_c" 1>&6
7441 else
7442   cat > conftest.$ac_ext <<EOF
7443 #line 7444 "configure"
7444 #include "confdefs.h"
7445 /* System header to define __stub macros and hopefully few prototypes,
7446     which can conflict with char XOpenDisplay(); below.  */
7447 #include <assert.h>
7448 /* Override any gcc2 internal prototype to avoid an error.  */
7449 /* We use char because int might match the return type of a gcc2
7450     builtin and then its argument prototype would still apply.  */
7451 char XOpenDisplay();
7452
7453 int main() {
7454
7455 /* The GNU C library defines this for functions which it implements
7456     to always fail with ENOSYS.  Some functions are actually named
7457     something starting with __ and the normal name is an alias.  */
7458 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
7459 choke me
7460 #else
7461 XOpenDisplay();
7462 #endif
7463
7464 ; return 0; }
7465 EOF
7466 if { (eval echo configure:7467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7467   rm -rf conftest*
7468   eval "ac_cv_func_XOpenDisplay=yes"
7469 else
7470   echo "configure: failed program was:" >&5
7471   cat conftest.$ac_ext >&5
7472   rm -rf conftest*
7473   eval "ac_cv_func_XOpenDisplay=no"
7474 fi
7475 rm -f conftest*
7476 fi
7477
7478 if eval "test \"`echo '$ac_cv_func_'XOpenDisplay`\" = yes"; then
7479   echo "$ac_t""yes" 1>&6
7480   :
7481 else
7482   echo "$ac_t""no" 1>&6
7483
7484 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
7485 echo "configure:7486: checking for XOpenDisplay in -lX11" >&5
7486 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
7487 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7488   echo $ac_n "(cached) $ac_c" 1>&6
7489 else
7490   ac_save_LIBS="$LIBS"
7491 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
7492 cat > conftest.$ac_ext <<EOF
7493 #line 7494 "configure"
7494 #include "confdefs.h"
7495 /* Override any gcc2 internal prototype to avoid an error.  */
7496 /* We use char because int might match the return type of a gcc2
7497     builtin and then its argument prototype would still apply.  */
7498 char XOpenDisplay();
7499
7500 int main() {
7501 XOpenDisplay()
7502 ; return 0; }
7503 EOF
7504 if { (eval echo configure:7505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7505   rm -rf conftest*
7506   eval "ac_cv_lib_$ac_lib_var=yes"
7507 else
7508   echo "configure: failed program was:" >&5
7509   cat conftest.$ac_ext >&5
7510   rm -rf conftest*
7511   eval "ac_cv_lib_$ac_lib_var=no"
7512 fi
7513 rm -f conftest*
7514 LIBS="$ac_save_LIBS"
7515
7516 fi
7517 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7518   echo "$ac_t""yes" 1>&6
7519   LIBS="-lX11 $LIBS"
7520 else
7521   echo "$ac_t""no" 1>&6
7522 fi
7523
7524 fi
7525
7526
7527 echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6
7528 echo "configure:7529: checking for XtAppInitialize" >&5
7529 if eval "test \"`echo '$''{'ac_cv_func_XtAppInitialize'+set}'`\" = set"; then
7530   echo $ac_n "(cached) $ac_c" 1>&6
7531 else
7532   cat > conftest.$ac_ext <<EOF
7533 #line 7534 "configure"
7534 #include "confdefs.h"
7535 /* System header to define __stub macros and hopefully few prototypes,
7536     which can conflict with char XtAppInitialize(); below.  */
7537 #include <assert.h>
7538 /* Override any gcc2 internal prototype to avoid an error.  */
7539 /* We use char because int might match the return type of a gcc2
7540     builtin and then its argument prototype would still apply.  */
7541 char XtAppInitialize();
7542
7543 int main() {
7544
7545 /* The GNU C library defines this for functions which it implements
7546     to always fail with ENOSYS.  Some functions are actually named
7547     something starting with __ and the normal name is an alias.  */
7548 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
7549 choke me
7550 #else
7551 XtAppInitialize();
7552 #endif
7553
7554 ; return 0; }
7555 EOF
7556 if { (eval echo configure:7557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7557   rm -rf conftest*
7558   eval "ac_cv_func_XtAppInitialize=yes"
7559 else
7560   echo "configure: failed program was:" >&5
7561   cat conftest.$ac_ext >&5
7562   rm -rf conftest*
7563   eval "ac_cv_func_XtAppInitialize=no"
7564 fi
7565 rm -f conftest*
7566 fi
7567
7568 if eval "test \"`echo '$ac_cv_func_'XtAppInitialize`\" = yes"; then
7569   echo "$ac_t""yes" 1>&6
7570   :
7571 else
7572   echo "$ac_t""no" 1>&6
7573
7574 echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
7575 echo "configure:7576: checking for XtAppInitialize in -lXt" >&5
7576 ac_lib_var=`echo Xt'_'XtAppInitialize | sed 'y%./+-%__p_%'`
7577 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7578   echo $ac_n "(cached) $ac_c" 1>&6
7579 else
7580   ac_save_LIBS="$LIBS"
7581 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
7582 cat > conftest.$ac_ext <<EOF
7583 #line 7584 "configure"
7584 #include "confdefs.h"
7585 /* Override any gcc2 internal prototype to avoid an error.  */
7586 /* We use char because int might match the return type of a gcc2
7587     builtin and then its argument prototype would still apply.  */
7588 char XtAppInitialize();
7589
7590 int main() {
7591 XtAppInitialize()
7592 ; return 0; }
7593 EOF
7594 if { (eval echo configure:7595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7595   rm -rf conftest*
7596   eval "ac_cv_lib_$ac_lib_var=yes"
7597 else
7598   echo "configure: failed program was:" >&5
7599   cat conftest.$ac_ext >&5
7600   rm -rf conftest*
7601   eval "ac_cv_lib_$ac_lib_var=no"
7602 fi
7603 rm -f conftest*
7604 LIBS="$ac_save_LIBS"
7605
7606 fi
7607 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7608   echo "$ac_t""yes" 1>&6
7609   cat >> confdefs.h <<\EOF
7610 #define HAVE_LIBXT 1
7611 EOF
7612
7613          cf_have_X_LIBS=Xt
7614          LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
7615 else
7616   echo "$ac_t""no" 1>&6
7617 fi
7618
7619 fi
7620
7621
7622 if test $cf_have_X_LIBS = no ; then
7623         echo "configure: warning: Unable to successfully link X Toolkit library (-lXt) with
7624 test program.  You will have to check and add the proper libraries by hand
7625 to makefile." 1>&2
7626 fi
7627
7628
7629 cf_x_athena=${cf_x_athena-Xaw}
7630
7631 echo $ac_n "checking if you want to link with Xaw 3d library""... $ac_c" 1>&6
7632 echo "configure:7633: checking if you want to link with Xaw 3d library" >&5
7633 withval=
7634
7635 # Check whether --with-Xaw3d or --without-Xaw3d was given.
7636 if test "${with_Xaw3d+set}" = set; then
7637   withval="$with_Xaw3d"
7638   :
7639 fi
7640
7641 if test "$withval" = yes ; then
7642         cf_x_athena=Xaw3d
7643         echo "$ac_t""yes" 1>&6
7644 else
7645         echo "$ac_t""no" 1>&6
7646 fi
7647
7648 echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6
7649 echo "configure:7650: checking if you want to link with neXT Athena library" >&5
7650 withval=
7651
7652 # Check whether --with-neXtaw or --without-neXtaw was given.
7653 if test "${with_neXtaw+set}" = set; then
7654   withval="$with_neXtaw"
7655   :
7656 fi
7657
7658 if test "$withval" = yes ; then
7659         cf_x_athena=neXtaw
7660         echo "$ac_t""yes" 1>&6
7661 else
7662         echo "$ac_t""no" 1>&6
7663 fi
7664
7665 echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6
7666 echo "configure:7667: checking if you want to link with Athena-Plus library" >&5
7667 withval=
7668
7669 # Check whether --with-XawPlus or --without-XawPlus was given.
7670 if test "${with_XawPlus+set}" = set; then
7671   withval="$with_XawPlus"
7672   :
7673 fi
7674
7675 if test "$withval" = yes ; then
7676         cf_x_athena=XawPlus
7677         echo "$ac_t""yes" 1>&6
7678 else
7679         echo "$ac_t""no" 1>&6
7680 fi
7681
7682 echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
7683 echo "configure:7684: checking for XextCreateExtension in -lXext" >&5
7684 ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'`
7685 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7686   echo $ac_n "(cached) $ac_c" 1>&6
7687 else
7688   ac_save_LIBS="$LIBS"
7689 LIBS="-lXext  $LIBS"
7690 cat > conftest.$ac_ext <<EOF
7691 #line 7692 "configure"
7692 #include "confdefs.h"
7693 /* Override any gcc2 internal prototype to avoid an error.  */
7694 /* We use char because int might match the return type of a gcc2
7695     builtin and then its argument prototype would still apply.  */
7696 char XextCreateExtension();
7697
7698 int main() {
7699 XextCreateExtension()
7700 ; return 0; }
7701 EOF
7702 if { (eval echo configure:7703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7703   rm -rf conftest*
7704   eval "ac_cv_lib_$ac_lib_var=yes"
7705 else
7706   echo "configure: failed program was:" >&5
7707   cat conftest.$ac_ext >&5
7708   rm -rf conftest*
7709   eval "ac_cv_lib_$ac_lib_var=no"
7710 fi
7711 rm -f conftest*
7712 LIBS="$ac_save_LIBS"
7713
7714 fi
7715 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7716   echo "$ac_t""yes" 1>&6
7717   LIBS="-lXext $LIBS"
7718 else
7719   echo "$ac_t""no" 1>&6
7720 fi
7721
7722
7723 cf_x_athena_lib=""
7724
7725
7726 cf_x_athena_root=$cf_x_athena
7727 cf_x_athena_include=""
7728
7729 for cf_path in default \
7730         /usr/contrib/X11R6 \
7731         /usr/contrib/X11R5 \
7732         /usr/lib/X11R5 \
7733         /usr/local
7734 do
7735         if test -z "$cf_x_athena_include" ; then
7736                 cf_save="$CPPFLAGS"
7737                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
7738                 if test $cf_path != default ; then
7739                         CPPFLAGS="$cf_save -I$cf_path/include"
7740                         echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
7741 echo "configure:7742: checking for $cf_test in $cf_path" >&5
7742                 else
7743                         echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
7744 echo "configure:7745: checking for $cf_test" >&5
7745                 fi
7746                 cat > conftest.$ac_ext <<EOF
7747 #line 7748 "configure"
7748 #include "confdefs.h"
7749
7750 #include <X11/Intrinsic.h>
7751 #include <$cf_test>
7752 int main() {
7753
7754 ; return 0; }
7755 EOF
7756 if { (eval echo configure:7757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7757   rm -rf conftest*
7758   cf_result=yes
7759 else
7760   echo "configure: failed program was:" >&5
7761   cat conftest.$ac_ext >&5
7762   rm -rf conftest*
7763   cf_result=no
7764 fi
7765 rm -f conftest*
7766                 echo "$ac_t""$cf_result" 1>&6
7767                 if test "$cf_result" = yes ; then
7768                         cf_x_athena_include=$cf_path
7769                         break
7770                 else
7771                         CPPFLAGS="$cf_save"
7772                 fi
7773         fi
7774 done
7775
7776 if test -z "$cf_x_athena_include" ; then
7777         echo "configure: warning: Unable to successfully find Athena header files with test program" 1>&2
7778 elif test "$cf_x_athena_include" != default ; then
7779         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_include"
7780 fi
7781
7782
7783 cf_x_athena_root=$cf_x_athena
7784 cf_x_athena_lib=""
7785
7786 for cf_path in default \
7787         /usr/contrib/X11R6 \
7788         /usr/contrib/X11R5 \
7789         /usr/lib/X11R5 \
7790         /usr/local
7791 do
7792         for cf_lib in \
7793                 "-l$cf_x_athena_root -lXmu" \
7794                 "-l$cf_x_athena_root -lXpm -lXmu" \
7795                 "-l${cf_x_athena_root}_s -lXmu_s"
7796         do
7797                 if test -z "$cf_x_athena_lib" ; then
7798                         cf_save="$LIBS"
7799                         cf_test=XawSimpleMenuAddGlobalActions
7800                         if test $cf_path != default ; then
7801                                 LIBS="-L$cf_path/lib $cf_lib $LIBS"
7802                                 echo $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6
7803 echo "configure:7804: checking for $cf_lib in $cf_path" >&5
7804                         else
7805                                 LIBS="$cf_lib $LIBS"
7806                                 echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6
7807 echo "configure:7808: checking for $cf_test in $cf_lib" >&5
7808                         fi
7809                         cat > conftest.$ac_ext <<EOF
7810 #line 7811 "configure"
7811 #include "confdefs.h"
7812
7813 int main() {
7814 $cf_test()
7815 ; return 0; }
7816 EOF
7817 if { (eval echo configure:7818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7818   rm -rf conftest*
7819   cf_result=yes
7820 else
7821   echo "configure: failed program was:" >&5
7822   cat conftest.$ac_ext >&5
7823   rm -rf conftest*
7824   cf_result=no
7825 fi
7826 rm -f conftest*
7827                         echo "$ac_t""$cf_result" 1>&6
7828                         if test "$cf_result" = yes ; then
7829                                 cf_x_athena_lib="$cf_lib"
7830                                 break
7831                         fi
7832                         LIBS="$cf_save"
7833                 fi
7834         done
7835 done
7836
7837 if test -z "$cf_x_athena_lib" ; then
7838         { echo "configure: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" 1>&2; exit 1; }
7839 fi
7840
7841
7842 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7843
7844 cat >> confdefs.h <<EOF
7845 #define $cf_x_athena_LIBS 1
7846 EOF
7847
7848
7849
7850
7851
7852
7853 for ac_prog in xcurses-config
7854 do
7855 # Extract the first word of "$ac_prog", so it can be a program name with args.
7856 set dummy $ac_prog; ac_word=$2
7857 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7858 echo "configure:7859: checking for $ac_word" >&5
7859 if eval "test \"`echo '$''{'ac_cv_path_XCURSES_CONFIG'+set}'`\" = set"; then
7860   echo $ac_n "(cached) $ac_c" 1>&6
7861 else
7862   case "$XCURSES_CONFIG" in
7863   /*)
7864   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
7865   ;;
7866   ?:/*)                  
7867   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a dos path.
7868   ;;
7869   *)
7870   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7871   ac_dummy="$PATH"
7872   for ac_dir in $ac_dummy; do 
7873     test -z "$ac_dir" && ac_dir=.
7874     if test -f $ac_dir/$ac_word; then
7875       ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
7876       break
7877     fi
7878   done
7879   IFS="$ac_save_ifs"
7880   ;;
7881 esac
7882 fi
7883 XCURSES_CONFIG="$ac_cv_path_XCURSES_CONFIG"
7884 if test -n "$XCURSES_CONFIG"; then
7885   echo "$ac_t""$XCURSES_CONFIG" 1>&6
7886 else
7887   echo "$ac_t""no" 1>&6
7888 fi
7889
7890 test -n "$XCURSES_CONFIG" && break
7891 done
7892 test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
7893
7894
7895 if test "$XCURSES_CONFIG" != none ; then
7896
7897 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
7898 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
7899
7900 cf_cv_lib_XCurses=yes
7901
7902 else
7903
7904 LDFLAGS="$LDFLAGS $X_LIBS"
7905
7906 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
7907
7908 echo "${as_me-configure}:7909: testing checking additions to CFLAGS ..." 1>&5
7909
7910
7911 cf_check_cflags="$CFLAGS"
7912 cf_check_cppflags="$CPPFLAGS"
7913
7914 cf_fix_cppflags=no
7915 cf_new_cflags=
7916 cf_new_cppflags=
7917 cf_new_extra_cppflags=
7918
7919 for cf_add_cflags in $X_CFLAGS
7920 do
7921 case $cf_fix_cppflags in
7922 no)
7923         case $cf_add_cflags in #(vi
7924         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
7925                 case $cf_add_cflags in
7926                 -D*)
7927                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7928
7929                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7930                                 && test -z "${cf_tst_cflags}" \
7931                                 && cf_fix_cppflags=yes
7932
7933                         if test $cf_fix_cppflags = yes ; then
7934                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7935                                 continue
7936                         elif test "${cf_tst_cflags}" = "\"'" ; then
7937                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7938                                 continue
7939                         fi
7940                         ;;
7941                 esac
7942                 case "$CPPFLAGS" in
7943                 *$cf_add_cflags) #(vi
7944                         ;;
7945                 *) #(vi
7946                         case $cf_add_cflags in #(vi
7947                         -D*)
7948                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7949                                 
7950 CPPFLAGS=`echo "$CPPFLAGS" | \
7951         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7952                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7953
7954                                 ;;
7955                         esac
7956                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
7957                         ;;
7958                 esac
7959                 ;;
7960         *)
7961                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
7962                 ;;
7963         esac
7964         ;;
7965 yes)
7966         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7967
7968         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7969
7970         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7971                 && test -z "${cf_tst_cflags}" \
7972                 && cf_fix_cppflags=no
7973         ;;
7974 esac
7975 done
7976
7977 if test -n "$cf_new_cflags" ; then
7978         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
7979
7980 echo "${as_me-configure}:7981: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
7981
7982
7983         CFLAGS="$CFLAGS $cf_new_cflags"
7984 fi
7985
7986 if test -n "$cf_new_cppflags" ; then
7987         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
7988
7989 echo "${as_me-configure}:7990: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
7990
7991
7992         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
7993 fi
7994
7995 if test -n "$cf_new_extra_cppflags" ; then
7996         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
7997
7998 echo "${as_me-configure}:7999: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
7999
8000
8001         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8002 fi
8003
8004
8005
8006
8007 if test "$cf_check_cflags" != "$CFLAGS" ; then
8008 cat > conftest.$ac_ext <<EOF
8009 #line 8010 "configure"
8010 #include "confdefs.h"
8011 #include <stdio.h>
8012 int main() {
8013 printf("Hello world");
8014 ; return 0; }
8015 EOF
8016 if { (eval echo configure:8017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8017   :
8018 else
8019   echo "configure: failed program was:" >&5
8020   cat conftest.$ac_ext >&5
8021   rm -rf conftest*
8022   test -n "$verbose" && echo "  test-compile failed.  Undoing change to \$CFLAGS" 1>&6
8023
8024 echo "${as_me-configure}:8025: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
8025
8026
8027          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
8028                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
8029
8030 echo "${as_me-configure}:8031: testing but keeping change to \$CPPFLAGS ..." 1>&5
8031
8032
8033          fi
8034          CFLAGS="$cf_check_flags"
8035 fi
8036 rm -f conftest*
8037 fi
8038
8039 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
8040 echo "configure:8041: checking for XOpenDisplay in -lX11" >&5
8041 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
8042 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8043   echo $ac_n "(cached) $ac_c" 1>&6
8044 else
8045   ac_save_LIBS="$LIBS"
8046 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
8047 cat > conftest.$ac_ext <<EOF
8048 #line 8049 "configure"
8049 #include "confdefs.h"
8050 /* Override any gcc2 internal prototype to avoid an error.  */
8051 /* We use char because int might match the return type of a gcc2
8052     builtin and then its argument prototype would still apply.  */
8053 char XOpenDisplay();
8054
8055 int main() {
8056 XOpenDisplay()
8057 ; return 0; }
8058 EOF
8059 if { (eval echo configure:8060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8060   rm -rf conftest*
8061   eval "ac_cv_lib_$ac_lib_var=yes"
8062 else
8063   echo "configure: failed program was:" >&5
8064   cat conftest.$ac_ext >&5
8065   rm -rf conftest*
8066   eval "ac_cv_lib_$ac_lib_var=no"
8067 fi
8068 rm -f conftest*
8069 LIBS="$ac_save_LIBS"
8070
8071 fi
8072 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8073   echo "$ac_t""yes" 1>&6
8074   LIBS="-lX11 $LIBS"
8075 else
8076   echo "$ac_t""no" 1>&6
8077 fi
8078
8079 echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
8080 echo "configure:8081: checking for XCurses library" >&5
8081 if eval "test \"`echo '$''{'cf_cv_lib_XCurses'+set}'`\" = set"; then
8082   echo $ac_n "(cached) $ac_c" 1>&6
8083 else
8084   
8085 LIBS="-lXCurses $LIBS"
8086 cat > conftest.$ac_ext <<EOF
8087 #line 8088 "configure"
8088 #include "confdefs.h"
8089
8090 #include <xcurses.h>
8091 char *XCursesProgramName = "test";
8092
8093 int main() {
8094 XCursesExit();
8095 ; return 0; }
8096 EOF
8097 if { (eval echo configure:8098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8098   rm -rf conftest*
8099   cf_cv_lib_XCurses=yes
8100 else
8101   echo "configure: failed program was:" >&5
8102   cat conftest.$ac_ext >&5
8103   rm -rf conftest*
8104   cf_cv_lib_XCurses=no
8105 fi
8106 rm -f conftest*
8107
8108 fi
8109
8110 echo "$ac_t""$cf_cv_lib_XCurses" 1>&6
8111
8112 fi
8113
8114 if test $cf_cv_lib_XCurses = yes ; then
8115         cat >> confdefs.h <<\EOF
8116 #define UNIX 1
8117 EOF
8118
8119         cat >> confdefs.h <<\EOF
8120 #define XCURSES 1
8121 EOF
8122
8123         cat >> confdefs.h <<\EOF
8124 #define HAVE_XCURSES 1
8125 EOF
8126
8127 else
8128         { echo "configure: error: Cannot link with XCurses" 1>&2; exit 1; }
8129 fi
8130
8131         ;;
8132 esac
8133
8134
8135
8136 case $cf_cv_screen in #(vi
8137 pdcurses) #(vi
8138         ;;
8139 *)
8140         # look for curses-related libraries
8141         echo $ac_n "checking for new_panel in -lpanel$cf_cv_libtype""... $ac_c" 1>&6
8142 echo "configure:8143: checking for new_panel in -lpanel$cf_cv_libtype" >&5
8143 ac_lib_var=`echo panel$cf_cv_libtype'_'new_panel | sed 'y%./+-%__p_%'`
8144 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8145   echo $ac_n "(cached) $ac_c" 1>&6
8146 else
8147   ac_save_LIBS="$LIBS"
8148 LIBS="-lpanel$cf_cv_libtype  $LIBS"
8149 cat > conftest.$ac_ext <<EOF
8150 #line 8151 "configure"
8151 #include "confdefs.h"
8152 /* Override any gcc2 internal prototype to avoid an error.  */
8153 /* We use char because int might match the return type of a gcc2
8154     builtin and then its argument prototype would still apply.  */
8155 char new_panel();
8156
8157 int main() {
8158 new_panel()
8159 ; return 0; }
8160 EOF
8161 if { (eval echo configure:8162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8162   rm -rf conftest*
8163   eval "ac_cv_lib_$ac_lib_var=yes"
8164 else
8165   echo "configure: failed program was:" >&5
8166   cat conftest.$ac_ext >&5
8167   rm -rf conftest*
8168   eval "ac_cv_lib_$ac_lib_var=no"
8169 fi
8170 rm -f conftest*
8171 LIBS="$ac_save_LIBS"
8172
8173 fi
8174 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8175   echo "$ac_t""yes" 1>&6
8176     ac_tr_lib=HAVE_LIB`echo panel$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8177     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8178   cat >> confdefs.h <<EOF
8179 #define $ac_tr_lib 1
8180 EOF
8181
8182   LIBS="-lpanel$cf_cv_libtype $LIBS"
8183
8184 else
8185   echo "$ac_t""no" 1>&6
8186 fi
8187
8188         echo $ac_n "checking for menu_driver in -lmenu$cf_cv_libtype""... $ac_c" 1>&6
8189 echo "configure:8190: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
8190 ac_lib_var=`echo menu$cf_cv_libtype'_'menu_driver | sed 'y%./+-%__p_%'`
8191 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8192   echo $ac_n "(cached) $ac_c" 1>&6
8193 else
8194   ac_save_LIBS="$LIBS"
8195 LIBS="-lmenu$cf_cv_libtype  $LIBS"
8196 cat > conftest.$ac_ext <<EOF
8197 #line 8198 "configure"
8198 #include "confdefs.h"
8199 /* Override any gcc2 internal prototype to avoid an error.  */
8200 /* We use char because int might match the return type of a gcc2
8201     builtin and then its argument prototype would still apply.  */
8202 char menu_driver();
8203
8204 int main() {
8205 menu_driver()
8206 ; return 0; }
8207 EOF
8208 if { (eval echo configure:8209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8209   rm -rf conftest*
8210   eval "ac_cv_lib_$ac_lib_var=yes"
8211 else
8212   echo "configure: failed program was:" >&5
8213   cat conftest.$ac_ext >&5
8214   rm -rf conftest*
8215   eval "ac_cv_lib_$ac_lib_var=no"
8216 fi
8217 rm -f conftest*
8218 LIBS="$ac_save_LIBS"
8219
8220 fi
8221 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8222   echo "$ac_t""yes" 1>&6
8223     ac_tr_lib=HAVE_LIB`echo menu$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8224     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8225   cat >> confdefs.h <<EOF
8226 #define $ac_tr_lib 1
8227 EOF
8228
8229   LIBS="-lmenu$cf_cv_libtype $LIBS"
8230
8231 else
8232   echo "$ac_t""no" 1>&6
8233 fi
8234
8235         echo $ac_n "checking for form_driver in -lform$cf_cv_libtype""... $ac_c" 1>&6
8236 echo "configure:8237: checking for form_driver in -lform$cf_cv_libtype" >&5
8237 ac_lib_var=`echo form$cf_cv_libtype'_'form_driver | sed 'y%./+-%__p_%'`
8238 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8239   echo $ac_n "(cached) $ac_c" 1>&6
8240 else
8241   ac_save_LIBS="$LIBS"
8242 LIBS="-lform$cf_cv_libtype  $LIBS"
8243 cat > conftest.$ac_ext <<EOF
8244 #line 8245 "configure"
8245 #include "confdefs.h"
8246 /* Override any gcc2 internal prototype to avoid an error.  */
8247 /* We use char because int might match the return type of a gcc2
8248     builtin and then its argument prototype would still apply.  */
8249 char form_driver();
8250
8251 int main() {
8252 form_driver()
8253 ; return 0; }
8254 EOF
8255 if { (eval echo configure:8256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8256   rm -rf conftest*
8257   eval "ac_cv_lib_$ac_lib_var=yes"
8258 else
8259   echo "configure: failed program was:" >&5
8260   cat conftest.$ac_ext >&5
8261   rm -rf conftest*
8262   eval "ac_cv_lib_$ac_lib_var=no"
8263 fi
8264 rm -f conftest*
8265 LIBS="$ac_save_LIBS"
8266
8267 fi
8268 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8269   echo "$ac_t""yes" 1>&6
8270     ac_tr_lib=HAVE_LIB`echo form$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8271     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8272   cat >> confdefs.h <<EOF
8273 #define $ac_tr_lib 1
8274 EOF
8275
8276   LIBS="-lform$cf_cv_libtype $LIBS"
8277
8278 else
8279   echo "$ac_t""no" 1>&6
8280 fi
8281
8282
8283         # look for curses-related headers
8284         for ac_hdr in \
8285                 nc_alloc.h \
8286                 nomacros.h \
8287                 form.h \
8288                 menu.h \
8289                 panel.h \
8290                 
8291 do
8292 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8293 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8294 echo "configure:8295: checking for $ac_hdr" >&5
8295 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8296   echo $ac_n "(cached) $ac_c" 1>&6
8297 else
8298   cat > conftest.$ac_ext <<EOF
8299 #line 8300 "configure"
8300 #include "confdefs.h"
8301 #include <$ac_hdr>
8302 EOF
8303 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8304 { (eval echo configure:8305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8305 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8306 if test -z "$ac_err"; then
8307   rm -rf conftest*
8308   eval "ac_cv_header_$ac_safe=yes"
8309 else
8310   echo "$ac_err" >&5
8311   echo "configure: failed program was:" >&5
8312   cat conftest.$ac_ext >&5
8313   rm -rf conftest*
8314   eval "ac_cv_header_$ac_safe=no"
8315 fi
8316 rm -f conftest*
8317 fi
8318 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8319   echo "$ac_t""yes" 1>&6
8320     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8321   cat >> confdefs.h <<EOF
8322 #define $ac_tr_hdr 1
8323 EOF
8324  
8325 else
8326   echo "$ac_t""no" 1>&6
8327 fi
8328 done
8329
8330         ;;
8331 esac
8332
8333 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
8334 echo "configure:8335: checking return type of signal handlers" >&5
8335 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
8336   echo $ac_n "(cached) $ac_c" 1>&6
8337 else
8338   cat > conftest.$ac_ext <<EOF
8339 #line 8340 "configure"
8340 #include "confdefs.h"
8341 #include <sys/types.h>
8342 #include <signal.h>
8343 #ifdef signal
8344 #undef signal
8345 #endif
8346 #ifdef __cplusplus
8347 extern "C" void (*signal (int, void (*)(int)))(int);
8348 #else
8349 void (*signal ()) ();
8350 #endif
8351
8352 int main() {
8353 int i;
8354 ; return 0; }
8355 EOF
8356 if { (eval echo configure:8357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8357   rm -rf conftest*
8358   ac_cv_type_signal=void
8359 else
8360   echo "configure: failed program was:" >&5
8361   cat conftest.$ac_ext >&5
8362   rm -rf conftest*
8363   ac_cv_type_signal=int
8364 fi
8365 rm -f conftest*
8366 fi
8367
8368 echo "$ac_t""$ac_cv_type_signal" 1>&6
8369 cat >> confdefs.h <<EOF
8370 #define RETSIGTYPE $ac_cv_type_signal
8371 EOF
8372
8373
8374
8375 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8376 echo "configure:8377: checking for ANSI C header files" >&5
8377 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
8378   echo $ac_n "(cached) $ac_c" 1>&6
8379 else
8380   cat > conftest.$ac_ext <<EOF
8381 #line 8382 "configure"
8382 #include "confdefs.h"
8383 #include <stdlib.h>
8384 #include <stdarg.h>
8385 #include <string.h>
8386 #include <float.h>
8387 EOF
8388 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8389 { (eval echo configure:8390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8390 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8391 if test -z "$ac_err"; then
8392   rm -rf conftest*
8393   ac_cv_header_stdc=yes
8394 else
8395   echo "$ac_err" >&5
8396   echo "configure: failed program was:" >&5
8397   cat conftest.$ac_ext >&5
8398   rm -rf conftest*
8399   ac_cv_header_stdc=no
8400 fi
8401 rm -f conftest*
8402
8403 if test $ac_cv_header_stdc = yes; then
8404   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8405 cat > conftest.$ac_ext <<EOF
8406 #line 8407 "configure"
8407 #include "confdefs.h"
8408 #include <string.h>
8409 EOF
8410 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8411   egrep "memchr" >/dev/null 2>&1; then
8412   :
8413 else
8414   rm -rf conftest*
8415   ac_cv_header_stdc=no
8416 fi
8417 rm -f conftest*
8418
8419 fi
8420
8421 if test $ac_cv_header_stdc = yes; then
8422   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8423 cat > conftest.$ac_ext <<EOF
8424 #line 8425 "configure"
8425 #include "confdefs.h"
8426 #include <stdlib.h>
8427 EOF
8428 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8429   egrep "free" >/dev/null 2>&1; then
8430   :
8431 else
8432   rm -rf conftest*
8433   ac_cv_header_stdc=no
8434 fi
8435 rm -f conftest*
8436
8437 fi
8438
8439 if test $ac_cv_header_stdc = yes; then
8440   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8441 if test "$cross_compiling" = yes; then
8442   :
8443 else
8444   cat > conftest.$ac_ext <<EOF
8445 #line 8446 "configure"
8446 #include "confdefs.h"
8447 #include <ctype.h>
8448 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8449 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8450 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8451 int main () { int i; for (i = 0; i < 256; i++)
8452 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8453 exit (0); }
8454
8455 EOF
8456 if { (eval echo configure:8457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8457 then
8458   :
8459 else
8460   echo "configure: failed program was:" >&5
8461   cat conftest.$ac_ext >&5
8462   rm -fr conftest*
8463   ac_cv_header_stdc=no
8464 fi
8465 rm -fr conftest*
8466 fi
8467
8468 fi
8469 fi
8470
8471 echo "$ac_t""$ac_cv_header_stdc" 1>&6
8472 if test $ac_cv_header_stdc = yes; then
8473   cat >> confdefs.h <<\EOF
8474 #define STDC_HEADERS 1
8475 EOF
8476
8477 fi
8478
8479 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
8480 echo "configure:8481: checking whether time.h and sys/time.h may both be included" >&5
8481 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
8482   echo $ac_n "(cached) $ac_c" 1>&6
8483 else
8484   cat > conftest.$ac_ext <<EOF
8485 #line 8486 "configure"
8486 #include "confdefs.h"
8487 #include <sys/types.h>
8488 #include <sys/time.h>
8489 #include <time.h>
8490 int main() {
8491 struct tm *tp;
8492 ; return 0; }
8493 EOF
8494 if { (eval echo configure:8495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8495   rm -rf conftest*
8496   ac_cv_header_time=yes
8497 else
8498   echo "configure: failed program was:" >&5
8499   cat conftest.$ac_ext >&5
8500   rm -rf conftest*
8501   ac_cv_header_time=no
8502 fi
8503 rm -f conftest*
8504 fi
8505
8506 echo "$ac_t""$ac_cv_header_time" 1>&6
8507 if test $ac_cv_header_time = yes; then
8508   cat >> confdefs.h <<\EOF
8509 #define TIME_WITH_SYS_TIME 1
8510 EOF
8511
8512 fi
8513
8514 for ac_hdr in \
8515 getopt.h \
8516 locale.h \
8517 stdarg.h \
8518 sys/ioctl.h \
8519 sys/select.h \
8520 sys/time.h \
8521 termios.h \
8522 unistd.h \
8523
8524 do
8525 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8526 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8527 echo "configure:8528: checking for $ac_hdr" >&5
8528 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8529   echo $ac_n "(cached) $ac_c" 1>&6
8530 else
8531   cat > conftest.$ac_ext <<EOF
8532 #line 8533 "configure"
8533 #include "confdefs.h"
8534 #include <$ac_hdr>
8535 EOF
8536 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8537 { (eval echo configure:8538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8538 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8539 if test -z "$ac_err"; then
8540   rm -rf conftest*
8541   eval "ac_cv_header_$ac_safe=yes"
8542 else
8543   echo "$ac_err" >&5
8544   echo "configure: failed program was:" >&5
8545   cat conftest.$ac_ext >&5
8546   rm -rf conftest*
8547   eval "ac_cv_header_$ac_safe=no"
8548 fi
8549 rm -f conftest*
8550 fi
8551 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8552   echo "$ac_t""yes" 1>&6
8553     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8554   cat >> confdefs.h <<EOF
8555 #define $ac_tr_hdr 1
8556 EOF
8557  
8558 else
8559   echo "$ac_t""no" 1>&6
8560 fi
8561 done
8562
8563
8564 for ac_func in \
8565 gettimeofday \
8566 mblen \
8567 mbrlen \
8568 mbrtowc \
8569 mbsrtowcs \
8570 mbstowcs \
8571 mbtowc \
8572 strdup \
8573 wcsrtombs \
8574 wcstombs \
8575
8576 do
8577 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8578 echo "configure:8579: checking for $ac_func" >&5
8579 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8580   echo $ac_n "(cached) $ac_c" 1>&6
8581 else
8582   cat > conftest.$ac_ext <<EOF
8583 #line 8584 "configure"
8584 #include "confdefs.h"
8585 /* System header to define __stub macros and hopefully few prototypes,
8586     which can conflict with char $ac_func(); below.  */
8587 #include <assert.h>
8588 /* Override any gcc2 internal prototype to avoid an error.  */
8589 /* We use char because int might match the return type of a gcc2
8590     builtin and then its argument prototype would still apply.  */
8591 char $ac_func();
8592
8593 int main() {
8594
8595 /* The GNU C library defines this for functions which it implements
8596     to always fail with ENOSYS.  Some functions are actually named
8597     something starting with __ and the normal name is an alias.  */
8598 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8599 choke me
8600 #else
8601 $ac_func();
8602 #endif
8603
8604 ; return 0; }
8605 EOF
8606 if { (eval echo configure:8607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8607   rm -rf conftest*
8608   eval "ac_cv_func_$ac_func=yes"
8609 else
8610   echo "configure: failed program was:" >&5
8611   cat conftest.$ac_ext >&5
8612   rm -rf conftest*
8613   eval "ac_cv_func_$ac_func=no"
8614 fi
8615 rm -f conftest*
8616 fi
8617
8618 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8619   echo "$ac_t""yes" 1>&6
8620     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8621   cat >> confdefs.h <<EOF
8622 #define $ac_tr_func 1
8623 EOF
8624  
8625 else
8626   echo "$ac_t""no" 1>&6
8627 fi
8628 done
8629
8630
8631
8632 echo $ac_n "checking if we must define _XOPEN_SOURCE_EXTENDED""... $ac_c" 1>&6
8633 echo "configure:8634: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
8634 if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then
8635   echo $ac_n "(cached) $ac_c" 1>&6
8636 else
8637   
8638 cat > conftest.$ac_ext <<EOF
8639 #line 8640 "configure"
8640 #include "confdefs.h"
8641
8642 #include <stdlib.h>
8643 #include <${cf_cv_ncurses_header-curses.h}>
8644 int main() {
8645
8646 #if defined(NCURSES_VERSION_PATCH)
8647 if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
8648         make an error
8649 #endif
8650 #endif
8651         long x = winnstr(stdscr, "", 0);
8652         int x1, y1;
8653         getbegyx(stdscr, y1, x1)
8654 ; return 0; }
8655 EOF
8656 if { (eval echo configure:8657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8657   rm -rf conftest*
8658   cf_cv_need_xopen_extension=no
8659 else
8660   echo "configure: failed program was:" >&5
8661   cat conftest.$ac_ext >&5
8662   rm -rf conftest*
8663   cat > conftest.$ac_ext <<EOF
8664 #line 8665 "configure"
8665 #include "confdefs.h"
8666
8667 #define _XOPEN_SOURCE_EXTENDED
8668 #include <stdlib.h>
8669 #include <${cf_cv_ncurses_header-curses.h}>
8670 int main() {
8671
8672 #ifdef NCURSES_VERSION
8673         cchar_t check;
8674         int check2 = curs_set((int)sizeof(check));
8675 #endif
8676         long x = winnstr(stdscr, "", 0);
8677         int x1, y1;
8678         getbegyx(stdscr, y1, x1)
8679 ; return 0; }
8680 EOF
8681 if { (eval echo configure:8682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8682   rm -rf conftest*
8683   cf_cv_need_xopen_extension=yes
8684 else
8685   echo "configure: failed program was:" >&5
8686   cat conftest.$ac_ext >&5
8687   rm -rf conftest*
8688   cf_cv_need_xopen_extension=unknown
8689 fi
8690 rm -f conftest*
8691 fi
8692 rm -f conftest*
8693 fi
8694
8695 echo "$ac_t""$cf_cv_need_xopen_extension" 1>&6
8696 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
8697
8698
8699
8700 echo $ac_n "checking for term.h""... $ac_c" 1>&6
8701 echo "configure:8702: checking for term.h" >&5
8702 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
8703   echo $ac_n "(cached) $ac_c" 1>&6
8704 else
8705   
8706
8707 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
8708 # for <term.h> if we do not find the variant.
8709 for cf_header in \
8710         `echo ${cf_cv_ncurses_header-curses.h} | sed -e 's%/.*%/%'`term.h \
8711         term.h
8712 do
8713         cat > conftest.$ac_ext <<EOF
8714 #line 8715 "configure"
8715 #include "confdefs.h"
8716
8717 #include <${cf_cv_ncurses_header-curses.h}>
8718 #include <${cf_header}>
8719 int main() {
8720 WINDOW *x
8721 ; return 0; }
8722 EOF
8723 if { (eval echo configure:8724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8724   rm -rf conftest*
8725   cf_cv_term_header=$cf_header
8726          break
8727 else
8728   echo "configure: failed program was:" >&5
8729   cat conftest.$ac_ext >&5
8730   rm -rf conftest*
8731   cf_cv_term_header=no
8732 fi
8733 rm -f conftest*
8734 done
8735
8736 case $cf_cv_term_header in #(vi
8737 no)
8738         # If curses is ncurses, some packagers still mess it up by trying to make
8739         # us use GNU termcap.  This handles the most common case.
8740         for cf_header in ncurses/term.h ncursesw/term.h
8741         do
8742                 cat > conftest.$ac_ext <<EOF
8743 #line 8744 "configure"
8744 #include "confdefs.h"
8745
8746 #include <${cf_cv_ncurses_header-curses.h}>
8747 #ifdef NCURSES_VERSION
8748 #include <${cf_header}>
8749 #else
8750 make an error
8751 #endif
8752 int main() {
8753 WINDOW *x
8754 ; return 0; }
8755 EOF
8756 if { (eval echo configure:8757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8757   rm -rf conftest*
8758   cf_cv_term_header=$cf_header
8759                          break
8760 else
8761   echo "configure: failed program was:" >&5
8762   cat conftest.$ac_ext >&5
8763   rm -rf conftest*
8764   cf_cv_term_header=no
8765 fi
8766 rm -f conftest*
8767         done
8768         ;;
8769 esac
8770
8771 fi
8772
8773 echo "$ac_t""$cf_cv_term_header" 1>&6
8774
8775 case $cf_cv_term_header in #(vi
8776 term.h) #(vi
8777         cat >> confdefs.h <<\EOF
8778 #define HAVE_TERM_H 1
8779 EOF
8780
8781         ;;
8782 ncurses/term.h) #(vi
8783         cat >> confdefs.h <<\EOF
8784 #define HAVE_NCURSES_TERM_H 1
8785 EOF
8786
8787         ;;
8788 ncursesw/term.h)
8789         cat >> confdefs.h <<\EOF
8790 #define HAVE_NCURSESW_TERM_H 1
8791 EOF
8792
8793         ;;
8794 esac
8795
8796
8797
8798
8799 for cf_func in \
8800 chgat \
8801 color_set \
8802 filter \
8803 getbegx \
8804 getcurx \
8805 getmaxx \
8806 getnstr \
8807 getparx \
8808 getwin \
8809 mvvline \
8810 mvwvline \
8811 napms \
8812 putwin \
8813 resize_term \
8814 resizeterm \
8815 ripoffline \
8816 setupterm \
8817 slk_color \
8818 slk_init \
8819 termattrs \
8820 tgetent \
8821 tigetnum \
8822 tigetstr \
8823 typeahead \
8824 use_default_colors \
8825 vw_printw \
8826 vsscanf \
8827 wchgat \
8828 winsstr \
8829 wresize \
8830
8831 do
8832         
8833 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8834
8835         echo $ac_n "checking for ${cf_func}""... $ac_c" 1>&6
8836 echo "configure:8837: checking for ${cf_func}" >&5
8837         
8838 echo "${as_me-configure}:8839: testing ${cf_func} ..." 1>&5
8839
8840         if eval "test \"`echo '$''{'cf_cv_func_$cf_func'+set}'`\" = set"; then
8841   echo $ac_n "(cached) $ac_c" 1>&6
8842 else
8843   
8844                 eval cf_result='$ac_cv_func_'$cf_func
8845                 if test ".$cf_result" != ".no"; then
8846                         cat > conftest.$ac_ext <<EOF
8847 #line 8848 "configure"
8848 #include "confdefs.h"
8849
8850 #ifdef HAVE_XCURSES
8851 #include <xcurses.h>
8852 char * XCursesProgramName = "test";
8853 #else
8854 #include <${cf_cv_ncurses_header-curses.h}>
8855 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
8856 #include <ncursesw/term.h>
8857 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
8858 #include <ncurses/term.h>
8859 #elif defined(HAVE_TERM_H)
8860 #include <term.h>
8861 #endif
8862 #endif
8863
8864 int main() {
8865
8866 #ifndef ${cf_func}
8867 long foo = (long)(&${cf_func});
8868 ${cf_cv_main_return-return}(foo == 0);
8869 #endif
8870                         
8871 ; return 0; }
8872 EOF
8873 if { (eval echo configure:8874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8874   rm -rf conftest*
8875   cf_result=yes
8876 else
8877   echo "configure: failed program was:" >&5
8878   cat conftest.$ac_ext >&5
8879   rm -rf conftest*
8880   cf_result=no
8881 fi
8882 rm -f conftest*
8883                 fi
8884                 eval 'cf_cv_func_'$cf_func'=$cf_result'
8885         
8886 fi
8887
8888         # use the computed/retrieved cache-value:
8889         eval 'cf_result=$cf_cv_func_'$cf_func
8890         echo "$ac_t""$cf_result" 1>&6
8891         if test $cf_result != no; then
8892                 cat >> confdefs.h <<EOF
8893 #define HAVE_${cf_tr_func} 1
8894 EOF
8895
8896         fi
8897 done
8898
8899
8900
8901 echo $ac_n "checking for ncurses extended functions""... $ac_c" 1>&6
8902 echo "configure:8903: checking for ncurses extended functions" >&5
8903 if eval "test \"`echo '$''{'cf_cv_ncurses_ext_funcs'+set}'`\" = set"; then
8904   echo $ac_n "(cached) $ac_c" 1>&6
8905 else
8906   
8907 cat > conftest.$ac_ext <<EOF
8908 #line 8909 "configure"
8909 #include "confdefs.h"
8910
8911 #include <${cf_cv_ncurses_header-curses.h}>
8912 int main() {
8913
8914 int x = NCURSES_EXT_FUNCS
8915
8916 ; return 0; }
8917 EOF
8918 if { (eval echo configure:8919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8919   rm -rf conftest*
8920   cf_cv_ncurses_ext_funcs=defined
8921 else
8922   echo "configure: failed program was:" >&5
8923   cat conftest.$ac_ext >&5
8924   rm -rf conftest*
8925   
8926 cat > conftest.$ac_ext <<EOF
8927 #line 8928 "configure"
8928 #include "confdefs.h"
8929
8930 #include <${cf_cv_ncurses_header-curses.h}>
8931 int main() {
8932
8933         (void) assume_default_colors (0, 0);
8934         (void) curses_version ();
8935         (void) define_key (0, 0);
8936         (void) is_term_resized (0, 0);
8937         (void) key_defined (0);
8938         (void) keybound (0, 0);
8939         (void) keyok (0, 0);
8940         (void) resize_term (0, 0);
8941         (void) resizeterm (0, 0);
8942         (void) use_default_colors ();
8943         (void) use_extended_names (0);
8944         (void) wresize (0, 0, 0);
8945 ; return 0; }
8946 EOF
8947 if { (eval echo configure:8948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8948   rm -rf conftest*
8949   cf_cv_ncurses_ext_funcs=yes
8950 else
8951   echo "configure: failed program was:" >&5
8952   cat conftest.$ac_ext >&5
8953   rm -rf conftest*
8954   cf_cv_ncurses_ext_funcs=no
8955 fi
8956 rm -f conftest*
8957
8958 fi
8959 rm -f conftest*
8960
8961 fi
8962
8963 echo "$ac_t""$cf_cv_ncurses_ext_funcs" 1>&6
8964 test "$cf_cv_ncurses_ext_funcs" == yes && cat >> confdefs.h <<\EOF
8965 #define NCURSES_EXT_FUNCS 1
8966 EOF
8967
8968
8969
8970 echo $ac_n "checking for wide-character functions""... $ac_c" 1>&6
8971 echo "configure:8972: checking for wide-character functions" >&5
8972 if eval "test \"`echo '$''{'cf_cv_widechar_funcs'+set}'`\" = set"; then
8973   echo $ac_n "(cached) $ac_c" 1>&6
8974 else
8975   
8976 cat > conftest.$ac_ext <<EOF
8977 #line 8978 "configure"
8978 #include "confdefs.h"
8979
8980 #include <${cf_cv_ncurses_header-curses.h}>
8981 int main() {
8982
8983         static wchar_t src_wchar[2];
8984         static cchar_t dst_cchar;
8985         setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
8986         
8987 ; return 0; }
8988 EOF
8989 if { (eval echo configure:8990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8990   rm -rf conftest*
8991   cf_cv_widechar_funcs=yes
8992 else
8993   echo "configure: failed program was:" >&5
8994   cat conftest.$ac_ext >&5
8995   rm -rf conftest*
8996   cf_cv_widechar_funcs=no
8997 fi
8998 rm -f conftest*
8999
9000 fi
9001
9002 echo "$ac_t""$cf_cv_widechar_funcs" 1>&6
9003 if test "$cf_cv_widechar_funcs" != no ; then
9004         cat >> confdefs.h <<\EOF
9005 #define USE_WIDEC_SUPPORT 1
9006 EOF
9007
9008 else
9009         cat >> confdefs.h <<\EOF
9010 #define USE_WIDEC_SUPPORT 0
9011 EOF
9012
9013 fi
9014
9015 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
9016 echo "configure:9017: checking for pid_t" >&5
9017 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
9018   echo $ac_n "(cached) $ac_c" 1>&6
9019 else
9020   cat > conftest.$ac_ext <<EOF
9021 #line 9022 "configure"
9022 #include "confdefs.h"
9023 #include <sys/types.h>
9024 #if STDC_HEADERS
9025 #include <stdlib.h>
9026 #include <stddef.h>
9027 #endif
9028 EOF
9029 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9030   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9031   rm -rf conftest*
9032   ac_cv_type_pid_t=yes
9033 else
9034   rm -rf conftest*
9035   ac_cv_type_pid_t=no
9036 fi
9037 rm -f conftest*
9038
9039 fi
9040 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
9041 if test $ac_cv_type_pid_t = no; then
9042   cat >> confdefs.h <<\EOF
9043 #define pid_t int
9044 EOF
9045
9046 fi
9047
9048 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9049 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9050 echo "configure:9051: checking for vfork.h" >&5
9051 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9052   echo $ac_n "(cached) $ac_c" 1>&6
9053 else
9054   cat > conftest.$ac_ext <<EOF
9055 #line 9056 "configure"
9056 #include "confdefs.h"
9057 #include <vfork.h>
9058 EOF
9059 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9060 { (eval echo configure:9061: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9061 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9062 if test -z "$ac_err"; then
9063   rm -rf conftest*
9064   eval "ac_cv_header_$ac_safe=yes"
9065 else
9066   echo "$ac_err" >&5
9067   echo "configure: failed program was:" >&5
9068   cat conftest.$ac_ext >&5
9069   rm -rf conftest*
9070   eval "ac_cv_header_$ac_safe=no"
9071 fi
9072 rm -f conftest*
9073 fi
9074 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9075   echo "$ac_t""yes" 1>&6
9076   cat >> confdefs.h <<\EOF
9077 #define HAVE_VFORK_H 1
9078 EOF
9079
9080 else
9081   echo "$ac_t""no" 1>&6
9082 fi
9083
9084 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9085 echo "configure:9086: checking for working vfork" >&5
9086 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
9087   echo $ac_n "(cached) $ac_c" 1>&6
9088 else
9089   if test "$cross_compiling" = yes; then
9090   echo $ac_n "checking for vfork""... $ac_c" 1>&6
9091 echo "configure:9092: checking for vfork" >&5
9092 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
9093   echo $ac_n "(cached) $ac_c" 1>&6
9094 else
9095   cat > conftest.$ac_ext <<EOF
9096 #line 9097 "configure"
9097 #include "confdefs.h"
9098 /* System header to define __stub macros and hopefully few prototypes,
9099     which can conflict with char vfork(); below.  */
9100 #include <assert.h>
9101 /* Override any gcc2 internal prototype to avoid an error.  */
9102 /* We use char because int might match the return type of a gcc2
9103     builtin and then its argument prototype would still apply.  */
9104 char vfork();
9105
9106 int main() {
9107
9108 /* The GNU C library defines this for functions which it implements
9109     to always fail with ENOSYS.  Some functions are actually named
9110     something starting with __ and the normal name is an alias.  */
9111 #if defined (__stub_vfork) || defined (__stub___vfork)
9112 choke me
9113 #else
9114 vfork();
9115 #endif
9116
9117 ; return 0; }
9118 EOF
9119 if { (eval echo configure:9120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9120   rm -rf conftest*
9121   eval "ac_cv_func_vfork=yes"
9122 else
9123   echo "configure: failed program was:" >&5
9124   cat conftest.$ac_ext >&5
9125   rm -rf conftest*
9126   eval "ac_cv_func_vfork=no"
9127 fi
9128 rm -f conftest*
9129 fi
9130
9131 if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
9132   echo "$ac_t""yes" 1>&6
9133   :
9134 else
9135   echo "$ac_t""no" 1>&6
9136 fi
9137
9138 ac_cv_func_vfork_works=$ac_cv_func_vfork
9139 else
9140   cat > conftest.$ac_ext <<EOF
9141 #line 9142 "configure"
9142 #include "confdefs.h"
9143 /* Thanks to Paul Eggert for this test.  */
9144 #include <stdio.h>
9145 #include <sys/types.h>
9146 #include <sys/stat.h>
9147 #ifdef HAVE_UNISTD_H
9148 #include <unistd.h>
9149 #endif
9150 #ifdef HAVE_VFORK_H
9151 #include <vfork.h>
9152 #endif
9153 /* On some sparc systems, changes by the child to local and incoming
9154    argument registers are propagated back to the parent.
9155    The compiler is told about this with #include <vfork.h>,
9156    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9157    Test for this by using a static variable whose address
9158    is put into a register that is clobbered by the vfork.  */
9159 static
9160 #ifdef __cplusplus
9161 sparc_address_test (int arg)
9162 #else
9163 sparc_address_test (arg) int arg;
9164 #endif
9165 {
9166   static pid_t child;
9167   if (!child) {
9168     child = vfork ();
9169     if (child < 0) {
9170       perror ("vfork");
9171       _exit(2);
9172     }
9173     if (!child) {
9174       arg = getpid();
9175       write(-1, "", 0);
9176       _exit (arg);
9177     }
9178   }
9179 }
9180 main() {
9181   pid_t parent = getpid ();
9182   pid_t child;
9183
9184   sparc_address_test ();
9185
9186   child = vfork ();
9187
9188   if (child == 0) {
9189     /* Here is another test for sparc vfork register problems.
9190        This test uses lots of local variables, at least
9191        as many local variables as main has allocated so far
9192        including compiler temporaries.  4 locals are enough for
9193        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9194        A buggy compiler should reuse the register of parent
9195        for one of the local variables, since it will think that
9196        parent can't possibly be used any more in this routine.
9197        Assigning to the local variable will thus munge parent
9198        in the parent process.  */
9199     pid_t
9200       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9201       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9202     /* Convince the compiler that p..p7 are live; otherwise, it might
9203        use the same hardware register for all 8 local variables.  */
9204     if (p != p1 || p != p2 || p != p3 || p != p4
9205         || p != p5 || p != p6 || p != p7)
9206       _exit(1);
9207
9208     /* On some systems (e.g. IRIX 3.3),
9209        vfork doesn't separate parent from child file descriptors.
9210        If the child closes a descriptor before it execs or exits,
9211        this munges the parent's descriptor as well.
9212        Test for this by closing stdout in the child.  */
9213     _exit(close(fileno(stdout)) != 0);
9214   } else {
9215     int status;
9216     struct stat st;
9217
9218     while (wait(&status) != child)
9219       ;
9220     exit(
9221          /* Was there some problem with vforking?  */
9222          child < 0
9223
9224          /* Did the child fail?  (This shouldn't happen.)  */
9225          || status
9226
9227          /* Did the vfork/compiler bug occur?  */
9228          || parent != getpid()
9229
9230          /* Did the file descriptor bug occur?  */
9231          || fstat(fileno(stdout), &st) != 0
9232          );
9233   }
9234 }
9235 EOF
9236 if { (eval echo configure:9237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9237 then
9238   ac_cv_func_vfork_works=yes
9239 else
9240   echo "configure: failed program was:" >&5
9241   cat conftest.$ac_ext >&5
9242   rm -fr conftest*
9243   ac_cv_func_vfork_works=no
9244 fi
9245 rm -fr conftest*
9246 fi
9247
9248 fi
9249
9250 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9251 if test $ac_cv_func_vfork_works = no; then
9252   cat >> confdefs.h <<\EOF
9253 #define vfork fork
9254 EOF
9255
9256 fi
9257
9258
9259 echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
9260 echo "configure:9261: checking if sys/time.h works with sys/select.h" >&5
9261 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
9262   echo $ac_n "(cached) $ac_c" 1>&6
9263 else
9264   
9265 cat > conftest.$ac_ext <<EOF
9266 #line 9267 "configure"
9267 #include "confdefs.h"
9268
9269 #include <sys/types.h>
9270 #ifdef HAVE_SYS_TIME_H
9271 #include <sys/time.h>
9272 #endif
9273 #ifdef HAVE_SYS_SELECT_H
9274 #include <sys/select.h>
9275 #endif
9276
9277 int main() {
9278
9279 ; return 0; }
9280 EOF
9281 if { (eval echo configure:9282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9282   rm -rf conftest*
9283   cf_cv_sys_time_select=yes
9284 else
9285   echo "configure: failed program was:" >&5
9286   cat conftest.$ac_ext >&5
9287   rm -rf conftest*
9288   cf_cv_sys_time_select=no
9289 fi
9290 rm -f conftest*
9291      
9292 fi
9293
9294 echo "$ac_t""$cf_cv_sys_time_select" 1>&6
9295 test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF
9296 #define HAVE_SYS_TIME_SELECT 1
9297 EOF
9298
9299
9300
9301 echo $ac_n "checking for function curses_version""... $ac_c" 1>&6
9302 echo "configure:9303: checking for function curses_version" >&5
9303 if eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then
9304   echo $ac_n "(cached) $ac_c" 1>&6
9305 else
9306   
9307 if test "$cross_compiling" = yes; then
9308   cf_cv_func_curses_version=unknown
9309 else
9310   cat > conftest.$ac_ext <<EOF
9311 #line 9312 "configure"
9312 #include "confdefs.h"
9313
9314 #include <${cf_cv_ncurses_header-curses.h}>
9315 int main()
9316 {
9317         char temp[1024];
9318         sprintf(temp, "%s\n", curses_version());
9319         ${cf_cv_main_return-return}(0);
9320 }
9321
9322 EOF
9323 if { (eval echo configure:9324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9324 then
9325   cf_cv_func_curses_version=yes
9326
9327 else
9328   echo "configure: failed program was:" >&5
9329   cat conftest.$ac_ext >&5
9330   rm -fr conftest*
9331   cf_cv_func_curses_version=no
9332
9333 fi
9334 rm -fr conftest*
9335 fi
9336
9337 rm -f core
9338 fi
9339
9340 echo "$ac_t""$cf_cv_func_curses_version" 1>&6
9341 test "$cf_cv_func_curses_version" = yes && cat >> confdefs.h <<\EOF
9342 #define HAVE_CURSES_VERSION 1
9343 EOF
9344
9345
9346
9347 echo $ac_n "checking for ncurses wrap-prefix""... $ac_c" 1>&6
9348 echo "configure:9349: checking for ncurses wrap-prefix" >&5
9349
9350 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
9351 if test "${with_ncurses_wrap_prefix+set}" = set; then
9352   withval="$with_ncurses_wrap_prefix"
9353   NCURSES_WRAP_PREFIX=$withval
9354 else
9355   NCURSES_WRAP_PREFIX=_nc_
9356 fi
9357
9358 echo "$ac_t""$NCURSES_WRAP_PREFIX" 1>&6
9359
9360
9361
9362
9363 echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6
9364 echo "configure:9365: checking for alternate character set array" >&5
9365 if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then
9366   echo $ac_n "(cached) $ac_c" 1>&6
9367 else
9368   
9369 cf_cv_curses_acs_map=unknown
9370 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
9371 do
9372 cat > conftest.$ac_ext <<EOF
9373 #line 9374 "configure"
9374 #include "confdefs.h"
9375
9376 #include <${cf_cv_ncurses_header-curses.h}>
9377
9378 int main() {
9379
9380 $name['k'] = ACS_PLUS
9381
9382 ; return 0; }
9383 EOF
9384 if { (eval echo configure:9385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9385   rm -rf conftest*
9386   cf_cv_curses_acs_map=$name; break
9387 else
9388   echo "configure: failed program was:" >&5
9389   cat conftest.$ac_ext >&5
9390 fi
9391 rm -f conftest*
9392 done
9393
9394 fi
9395
9396 echo "$ac_t""$cf_cv_curses_acs_map" 1>&6
9397
9398 test "$cf_cv_curses_acs_map" != unknown && cat >> confdefs.h <<EOF
9399 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
9400 EOF
9401
9402
9403
9404 echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6
9405 echo "configure:9406: checking for wide alternate character set array" >&5
9406 if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then
9407   echo $ac_n "(cached) $ac_c" 1>&6
9408 else
9409   
9410         cf_cv_curses_wacs_map=unknown
9411         for name in wacs_map _wacs_map __wacs_map _nc_wacs
9412         do
9413         cat > conftest.$ac_ext <<EOF
9414 #line 9415 "configure"
9415 #include "confdefs.h"
9416
9417 #ifndef _XOPEN_SOURCE_EXTENDED
9418 #define _XOPEN_SOURCE_EXTENDED
9419 #endif
9420 #include <${cf_cv_ncurses_header-curses.h}>
9421 int main() {
9422 $name['k'] = *WACS_PLUS
9423 ; return 0; }
9424 EOF
9425 if { (eval echo configure:9426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9426   rm -rf conftest*
9427   cf_cv_curses_wacs_map=$name
9428          break
9429 else
9430   echo "configure: failed program was:" >&5
9431   cat conftest.$ac_ext >&5
9432 fi
9433 rm -f conftest*
9434         done
9435 fi
9436
9437 echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6
9438
9439
9440
9441 echo $ac_n "checking for type attr_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
9442 echo "configure:9443: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5
9443 cat > conftest.$ac_ext <<EOF
9444 #line 9445 "configure"
9445 #include "confdefs.h"
9446
9447 #ifndef _XOPEN_SOURCE_EXTENDED
9448 #define _XOPEN_SOURCE_EXTENDED
9449 #endif
9450 #include <${cf_cv_ncurses_header-curses.h}>
9451 int main() {
9452
9453 attr_t foo
9454
9455 ; return 0; }
9456 EOF
9457 if { (eval echo configure:9458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9458   rm -rf conftest*
9459   cf_result=yes
9460 else
9461   echo "configure: failed program was:" >&5
9462   cat conftest.$ac_ext >&5
9463   rm -rf conftest*
9464   cf_result=no
9465 fi
9466 rm -f conftest*
9467 echo "$ac_t""$cf_result" 1>&6
9468 if test $cf_result = yes ; then
9469         
9470 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9471
9472         cat >> confdefs.h <<EOF
9473 #define $cf_result 1
9474 EOF
9475
9476 else
9477         cat >> confdefs.h <<EOF
9478 #define attr_t long
9479 EOF
9480
9481 fi
9482
9483
9484
9485 # This is needed on Tru64 5.0 to declare mbstate_t
9486 echo $ac_n "checking if we must include wchar.h to declare mbstate_t""... $ac_c" 1>&6
9487 echo "configure:9488: checking if we must include wchar.h to declare mbstate_t" >&5
9488 if eval "test \"`echo '$''{'cf_cv_mbstate_t'+set}'`\" = set"; then
9489   echo $ac_n "(cached) $ac_c" 1>&6
9490 else
9491   
9492 cat > conftest.$ac_ext <<EOF
9493 #line 9494 "configure"
9494 #include "confdefs.h"
9495
9496 #include <stdlib.h>
9497 #include <stdarg.h>
9498 #include <stdio.h>
9499 #ifdef HAVE_LIBUTF8_H
9500 #include <libutf8.h>
9501 #endif
9502 int main() {
9503 mbstate_t state
9504 ; return 0; }
9505 EOF
9506 if { (eval echo configure:9507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9507   rm -rf conftest*
9508   cf_cv_mbstate_t=no
9509 else
9510   echo "configure: failed program was:" >&5
9511   cat conftest.$ac_ext >&5
9512   rm -rf conftest*
9513   cat > conftest.$ac_ext <<EOF
9514 #line 9515 "configure"
9515 #include "confdefs.h"
9516
9517 #include <stdlib.h>
9518 #include <stdarg.h>
9519 #include <stdio.h>
9520 #include <wchar.h>
9521 #ifdef HAVE_LIBUTF8_H
9522 #include <libutf8.h>
9523 #endif
9524 int main() {
9525 mbstate_t value
9526 ; return 0; }
9527 EOF
9528 if { (eval echo configure:9529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9529   rm -rf conftest*
9530   cf_cv_mbstate_t=yes
9531 else
9532   echo "configure: failed program was:" >&5
9533   cat conftest.$ac_ext >&5
9534   rm -rf conftest*
9535   cf_cv_mbstate_t=unknown
9536 fi
9537 rm -f conftest*
9538 fi
9539 rm -f conftest*
9540 fi
9541
9542 echo "$ac_t""$cf_cv_mbstate_t" 1>&6
9543
9544 if test "$cf_cv_mbstate_t" = yes ; then
9545         cat >> confdefs.h <<\EOF
9546 #define NEED_WCHAR_H 1
9547 EOF
9548
9549         NEED_WCHAR_H=1
9550 fi
9551
9552
9553 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
9554 if test "$cf_cv_mbstate_t" = unknown ; then
9555         NCURSES_MBSTATE_T=1
9556 fi
9557
9558
9559 # if we find mbstate_t in either place, use substitution to provide a fallback.
9560 if test "$cf_cv_mbstate_t" != unknown ; then
9561         NCURSES_OK_MBSTATE_T=1
9562 fi
9563
9564
9565
9566 # This is needed on Tru64 5.0 to declare wchar_t
9567 echo $ac_n "checking if we must include wchar.h to declare wchar_t""... $ac_c" 1>&6
9568 echo "configure:9569: checking if we must include wchar.h to declare wchar_t" >&5
9569 if eval "test \"`echo '$''{'cf_cv_wchar_t'+set}'`\" = set"; then
9570   echo $ac_n "(cached) $ac_c" 1>&6
9571 else
9572   
9573 cat > conftest.$ac_ext <<EOF
9574 #line 9575 "configure"
9575 #include "confdefs.h"
9576
9577 #include <stdlib.h>
9578 #include <stdarg.h>
9579 #include <stdio.h>
9580 #ifdef HAVE_LIBUTF8_H
9581 #include <libutf8.h>
9582 #endif
9583 int main() {
9584 wchar_t state
9585 ; return 0; }
9586 EOF
9587 if { (eval echo configure:9588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9588   rm -rf conftest*
9589   cf_cv_wchar_t=no
9590 else
9591   echo "configure: failed program was:" >&5
9592   cat conftest.$ac_ext >&5
9593   rm -rf conftest*
9594   cat > conftest.$ac_ext <<EOF
9595 #line 9596 "configure"
9596 #include "confdefs.h"
9597
9598 #include <stdlib.h>
9599 #include <stdarg.h>
9600 #include <stdio.h>
9601 #include <wchar.h>
9602 #ifdef HAVE_LIBUTF8_H
9603 #include <libutf8.h>
9604 #endif
9605 int main() {
9606 wchar_t value
9607 ; return 0; }
9608 EOF
9609 if { (eval echo configure:9610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9610   rm -rf conftest*
9611   cf_cv_wchar_t=yes
9612 else
9613   echo "configure: failed program was:" >&5
9614   cat conftest.$ac_ext >&5
9615   rm -rf conftest*
9616   cf_cv_wchar_t=unknown
9617 fi
9618 rm -f conftest*
9619 fi
9620 rm -f conftest*
9621 fi
9622
9623 echo "$ac_t""$cf_cv_wchar_t" 1>&6
9624
9625 if test "$cf_cv_wchar_t" = yes ; then
9626         cat >> confdefs.h <<\EOF
9627 #define NEED_WCHAR_H 1
9628 EOF
9629
9630         NEED_WCHAR_H=1
9631 fi
9632
9633
9634 # if we do not find wchar_t in either place, use substitution to provide a fallback.
9635 if test "$cf_cv_wchar_t" = unknown ; then
9636         NCURSES_WCHAR_T=1
9637 fi
9638
9639
9640 # if we find wchar_t in either place, use substitution to provide a fallback.
9641 if test "$cf_cv_wchar_t" != unknown ; then
9642         NCURSES_OK_WCHAR_T=1
9643 fi
9644
9645
9646
9647 # This is needed on Tru64 5.0 to declare wint_t
9648 echo $ac_n "checking if we must include wchar.h to declare wint_t""... $ac_c" 1>&6
9649 echo "configure:9650: checking if we must include wchar.h to declare wint_t" >&5
9650 if eval "test \"`echo '$''{'cf_cv_wint_t'+set}'`\" = set"; then
9651   echo $ac_n "(cached) $ac_c" 1>&6
9652 else
9653   
9654 cat > conftest.$ac_ext <<EOF
9655 #line 9656 "configure"
9656 #include "confdefs.h"
9657
9658 #include <stdlib.h>
9659 #include <stdarg.h>
9660 #include <stdio.h>
9661 #ifdef HAVE_LIBUTF8_H
9662 #include <libutf8.h>
9663 #endif
9664 int main() {
9665 wint_t state
9666 ; return 0; }
9667 EOF
9668 if { (eval echo configure:9669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9669   rm -rf conftest*
9670   cf_cv_wint_t=no
9671 else
9672   echo "configure: failed program was:" >&5
9673   cat conftest.$ac_ext >&5
9674   rm -rf conftest*
9675   cat > conftest.$ac_ext <<EOF
9676 #line 9677 "configure"
9677 #include "confdefs.h"
9678
9679 #include <stdlib.h>
9680 #include <stdarg.h>
9681 #include <stdio.h>
9682 #include <wchar.h>
9683 #ifdef HAVE_LIBUTF8_H
9684 #include <libutf8.h>
9685 #endif
9686 int main() {
9687 wint_t value
9688 ; return 0; }
9689 EOF
9690 if { (eval echo configure:9691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9691   rm -rf conftest*
9692   cf_cv_wint_t=yes
9693 else
9694   echo "configure: failed program was:" >&5
9695   cat conftest.$ac_ext >&5
9696   rm -rf conftest*
9697   cf_cv_wint_t=unknown
9698 fi
9699 rm -f conftest*
9700 fi
9701 rm -f conftest*
9702 fi
9703
9704 echo "$ac_t""$cf_cv_wint_t" 1>&6
9705
9706 if test "$cf_cv_wint_t" = yes ; then
9707         cat >> confdefs.h <<\EOF
9708 #define NEED_WCHAR_H 1
9709 EOF
9710
9711         NEED_WCHAR_H=1
9712 fi
9713
9714
9715 # if we do not find wint_t in either place, use substitution to provide a fallback.
9716 if test "$cf_cv_wint_t" = unknown ; then
9717         NCURSES_WINT_T=1
9718 fi
9719
9720
9721 # if we find wint_t in either place, use substitution to provide a fallback.
9722 if test "$cf_cv_wint_t" != unknown ; then
9723         NCURSES_OK_WINT_T=1
9724 fi
9725
9726
9727
9728 if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
9729         
9730 echo $ac_n "checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
9731 echo "configure:9732: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5
9732 cat > conftest.$ac_ext <<EOF
9733 #line 9734 "configure"
9734 #include "confdefs.h"
9735
9736 #ifndef _XOPEN_SOURCE_EXTENDED
9737 #define _XOPEN_SOURCE_EXTENDED
9738 #endif
9739 #include <${cf_cv_ncurses_header-curses.h}>
9740 int main() {
9741
9742 mbstate_t foo
9743
9744 ; return 0; }
9745 EOF
9746 if { (eval echo configure:9747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9747   rm -rf conftest*
9748   cf_result=yes
9749 else
9750   echo "configure: failed program was:" >&5
9751   cat conftest.$ac_ext >&5
9752   rm -rf conftest*
9753   cf_result=no
9754 fi
9755 rm -f conftest*
9756 echo "$ac_t""$cf_result" 1>&6
9757 if test $cf_result = yes ; then
9758         
9759 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9760
9761         cat >> confdefs.h <<EOF
9762 #define $cf_result 1
9763 EOF
9764
9765 else
9766         cat >> confdefs.h <<EOF
9767 #define mbstate_t long
9768 EOF
9769
9770 fi
9771
9772 fi
9773
9774 if test "$NCURSES_OK_WCHAR_T" = 0 ; then
9775         
9776 echo $ac_n "checking for type wchar_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
9777 echo "configure:9778: checking for type wchar_t in ${cf_cv_ncurses_header-curses.h}" >&5
9778 cat > conftest.$ac_ext <<EOF
9779 #line 9780 "configure"
9780 #include "confdefs.h"
9781
9782 #ifndef _XOPEN_SOURCE_EXTENDED
9783 #define _XOPEN_SOURCE_EXTENDED
9784 #endif
9785 #include <${cf_cv_ncurses_header-curses.h}>
9786 int main() {
9787
9788 wchar_t foo
9789
9790 ; return 0; }
9791 EOF
9792 if { (eval echo configure:9793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9793   rm -rf conftest*
9794   cf_result=yes
9795 else
9796   echo "configure: failed program was:" >&5
9797   cat conftest.$ac_ext >&5
9798   rm -rf conftest*
9799   cf_result=no
9800 fi
9801 rm -f conftest*
9802 echo "$ac_t""$cf_result" 1>&6
9803 if test $cf_result = yes ; then
9804         
9805 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9806
9807         cat >> confdefs.h <<EOF
9808 #define $cf_result 1
9809 EOF
9810
9811 else
9812         cat >> confdefs.h <<EOF
9813 #define wchar_t long
9814 EOF
9815
9816 fi
9817
9818 fi
9819
9820 if test "$NCURSES_OK_WINT_T" = 0 ; then
9821         
9822 echo $ac_n "checking for type wint_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
9823 echo "configure:9824: checking for type wint_t in ${cf_cv_ncurses_header-curses.h}" >&5
9824 cat > conftest.$ac_ext <<EOF
9825 #line 9826 "configure"
9826 #include "confdefs.h"
9827
9828 #ifndef _XOPEN_SOURCE_EXTENDED
9829 #define _XOPEN_SOURCE_EXTENDED
9830 #endif
9831 #include <${cf_cv_ncurses_header-curses.h}>
9832 int main() {
9833
9834 wint_t foo
9835
9836 ; return 0; }
9837 EOF
9838 if { (eval echo configure:9839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9839   rm -rf conftest*
9840   cf_result=yes
9841 else
9842   echo "configure: failed program was:" >&5
9843   cat conftest.$ac_ext >&5
9844   rm -rf conftest*
9845   cf_result=no
9846 fi
9847 rm -f conftest*
9848 echo "$ac_t""$cf_result" 1>&6
9849 if test $cf_result = yes ; then
9850         
9851 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9852
9853         cat >> confdefs.h <<EOF
9854 #define $cf_result 1
9855 EOF
9856
9857 else
9858         cat >> confdefs.h <<EOF
9859 #define wint_t long
9860 EOF
9861
9862 fi
9863
9864 fi
9865
9866
9867 echo $ac_n "checking for data boolnames declaration in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
9868 echo "configure:9869: checking for data boolnames declaration in ${cf_cv_ncurses_header-curses.h}" >&5
9869 cat > conftest.$ac_ext <<EOF
9870 #line 9871 "configure"
9871 #include "confdefs.h"
9872
9873 #ifdef HAVE_XCURSES
9874 #include <xcurses.h>
9875 char * XCursesProgramName = "test";
9876 #else
9877 #include <${cf_cv_ncurses_header-curses.h}>
9878 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
9879 #include <ncursesw/term.h>
9880 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
9881 #include <ncurses/term.h>
9882 #elif defined(HAVE_TERM_H)
9883 #include <term.h>
9884 #endif
9885 #endif
9886
9887 int main() {
9888
9889 void *foo = &(boolnames)
9890
9891 ; return 0; }
9892 EOF
9893 if { (eval echo configure:9894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9894   rm -rf conftest*
9895   cf_result=yes
9896 else
9897   echo "configure: failed program was:" >&5
9898   cat conftest.$ac_ext >&5
9899   rm -rf conftest*
9900   cf_result=no
9901 fi
9902 rm -f conftest*
9903 echo "$ac_t""$cf_result" 1>&6
9904 if test $cf_result = yes ; then
9905         
9906 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9907
9908         cat >> confdefs.h <<EOF
9909 #define $cf_result 1
9910 EOF
9911
9912 else
9913         echo $ac_n "checking for data boolnames in library""... $ac_c" 1>&6
9914 echo "configure:9915: checking for data boolnames in library" >&5
9915         cat > conftest.$ac_ext <<EOF
9916 #line 9917 "configure"
9917 #include "confdefs.h"
9918
9919 #ifdef HAVE_XCURSES
9920 #include <xcurses.h>
9921 char * XCursesProgramName = "test";
9922 #else
9923 #include <${cf_cv_ncurses_header-curses.h}>
9924 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
9925 #include <ncursesw/term.h>
9926 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
9927 #include <ncurses/term.h>
9928 #elif defined(HAVE_TERM_H)
9929 #include <term.h>
9930 #endif
9931 #endif
9932
9933 extern char boolnames;
9934 int main() {
9935
9936         do {
9937                 void *foo = &(boolnames);
9938                 ${cf_cv_main_return-return}(foo == 0);
9939         } while (0)
9940
9941 ; return 0; }
9942 EOF
9943 if { (eval echo configure:9944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9944   rm -rf conftest*
9945   cf_result=yes
9946 else
9947   echo "configure: failed program was:" >&5
9948   cat conftest.$ac_ext >&5
9949   rm -rf conftest*
9950   cf_result=no
9951 fi
9952 rm -f conftest*
9953         echo "$ac_t""$cf_result" 1>&6
9954         if test $cf_result = yes ; then
9955                 
9956 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9957
9958                 cat >> confdefs.h <<EOF
9959 #define $cf_result 1
9960 EOF
9961
9962         fi
9963 fi
9964
9965
9966 echo $ac_n "checking for data boolfnames declaration in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
9967 echo "configure:9968: checking for data boolfnames declaration in ${cf_cv_ncurses_header-curses.h}" >&5
9968 cat > conftest.$ac_ext <<EOF
9969 #line 9970 "configure"
9970 #include "confdefs.h"
9971
9972 #ifdef HAVE_XCURSES
9973 #include <xcurses.h>
9974 char * XCursesProgramName = "test";
9975 #else
9976 #include <${cf_cv_ncurses_header-curses.h}>
9977 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
9978 #include <ncursesw/term.h>
9979 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
9980 #include <ncurses/term.h>
9981 #elif defined(HAVE_TERM_H)
9982 #include <term.h>
9983 #endif
9984 #endif
9985
9986 int main() {
9987
9988 void *foo = &(boolfnames)
9989
9990 ; return 0; }
9991 EOF
9992 if { (eval echo configure:9993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9993   rm -rf conftest*
9994   cf_result=yes
9995 else
9996   echo "configure: failed program was:" >&5
9997   cat conftest.$ac_ext >&5
9998   rm -rf conftest*
9999   cf_result=no
10000 fi
10001 rm -f conftest*
10002 echo "$ac_t""$cf_result" 1>&6
10003 if test $cf_result = yes ; then
10004         
10005 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10006
10007         cat >> confdefs.h <<EOF
10008 #define $cf_result 1
10009 EOF
10010
10011 else
10012         echo $ac_n "checking for data boolfnames in library""... $ac_c" 1>&6
10013 echo "configure:10014: checking for data boolfnames in library" >&5
10014         cat > conftest.$ac_ext <<EOF
10015 #line 10016 "configure"
10016 #include "confdefs.h"
10017
10018 #ifdef HAVE_XCURSES
10019 #include <xcurses.h>
10020 char * XCursesProgramName = "test";
10021 #else
10022 #include <${cf_cv_ncurses_header-curses.h}>
10023 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
10024 #include <ncursesw/term.h>
10025 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
10026 #include <ncurses/term.h>
10027 #elif defined(HAVE_TERM_H)
10028 #include <term.h>
10029 #endif
10030 #endif
10031
10032 extern char boolfnames;
10033 int main() {
10034
10035         do {
10036                 void *foo = &(boolfnames);
10037                 ${cf_cv_main_return-return}(foo == 0);
10038         } while (0)
10039
10040 ; return 0; }
10041 EOF
10042 if { (eval echo configure:10043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10043   rm -rf conftest*
10044   cf_result=yes
10045 else
10046   echo "configure: failed program was:" >&5
10047   cat conftest.$ac_ext >&5
10048   rm -rf conftest*
10049   cf_result=no
10050 fi
10051 rm -f conftest*
10052         echo "$ac_t""$cf_result" 1>&6
10053         if test $cf_result = yes ; then
10054                 
10055 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10056
10057                 cat >> confdefs.h <<EOF
10058 #define $cf_result 1
10059 EOF
10060
10061         fi
10062 fi
10063
10064
10065 TEST_ARGS="$LIBS"
10066 LIBS=
10067
10068
10069 trap '' 1 2 15
10070 cat > confcache <<\EOF
10071 # This file is a shell script that caches the results of configure
10072 # tests run on this system so they can be shared between configure
10073 # scripts and configure runs.  It is not useful on other systems.
10074 # If it contains results you don't want to keep, you may remove or edit it.
10075 #
10076 # By default, configure uses ./config.cache as the cache file,
10077 # creating it if it does not exist already.  You can give configure
10078 # the --cache-file=FILE option to use a different cache file; that is
10079 # what configure does when it calls configure scripts in
10080 # subdirectories, so they share the cache.
10081 # Giving --cache-file=/dev/null disables caching, for debugging configure.
10082 # config.status only pays attention to the cache file if you give it the
10083 # --recheck option to rerun configure.
10084 #
10085 EOF
10086 # The following way of writing the cache mishandles newlines in values,
10087 # but we know of no workaround that is simple, portable, and efficient.
10088 # So, don't put newlines in cache variables' values.
10089 # Ultrix sh set writes to stderr and can't be redirected directly,
10090 # and sets the high bit in the cache file unless we assign to the vars.
10091 (set) 2>&1 |
10092   case `(ac_space=' '; set | grep ac_space) 2>&1` in
10093   *ac_space=\ *)
10094     # `set' does not quote correctly, so add quotes (double-quote substitution
10095     # turns \\\\ into \\, and sed turns \\ into \).
10096     sed -n \
10097       -e "s/'/'\\\\''/g" \
10098       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
10099     ;;
10100   *)
10101     # `set' quotes correctly as required by POSIX, so do not add quotes.
10102     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
10103     ;;
10104   esac >> confcache
10105 if cmp -s $cache_file confcache; then
10106   :
10107 else
10108   if test -w $cache_file; then
10109     echo "updating cache $cache_file"
10110     cat confcache > $cache_file
10111   else
10112     echo "not updating unwritable cache $cache_file"
10113   fi
10114 fi
10115 rm -f confcache
10116
10117 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
10118
10119 test "x$prefix" = xNONE && prefix=$ac_default_prefix
10120 # Let make expand exec_prefix.
10121 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
10122
10123 # Any assignment to VPATH causes Sun make to only execute
10124 # the first set of double-colon rules, so remove it if not needed.
10125 # If there is a colon in the path, we need to keep it.
10126 if test "x$srcdir" = x.; then
10127   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
10128 fi
10129
10130 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
10131
10132 DEFS=-DHAVE_CONFIG_H
10133
10134 # Without the "./", some shells look in PATH for config.status.
10135 : ${CONFIG_STATUS=./config.status}
10136
10137 echo creating $CONFIG_STATUS
10138 rm -f $CONFIG_STATUS
10139 cat > $CONFIG_STATUS <<EOF
10140 #! /bin/sh
10141 # Generated automatically by configure.
10142 # Run this file to recreate the current configuration.
10143 # This directory was configured as follows,
10144 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10145 #
10146 # $0 $ac_configure_args
10147 #
10148 # Compiler output produced by configure, useful for debugging
10149 # configure, is in ./config.log if it exists.
10150
10151 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
10152 for ac_option
10153 do
10154   case "\$ac_option" in
10155   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
10156     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
10157     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
10158   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
10159     echo "$CONFIG_STATUS generated by autoconf version 2.13.20030927"
10160     exit 0 ;;
10161   -help | --help | --hel | --he | --h)
10162     echo "\$ac_cs_usage"; exit 0 ;;
10163   *) echo "\$ac_cs_usage"; exit 1 ;;
10164   esac
10165 done
10166
10167 ac_given_srcdir=$srcdir
10168
10169 trap 'rm -fr `echo "Makefile ncurses_cfg.h:ncurses_tst.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
10170 EOF
10171 cat >> $CONFIG_STATUS <<EOF
10172
10173 # Protect against being on the right side of a sed subst in config.status.
10174 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
10175  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
10176 $ac_vpsub
10177 $extrasub
10178 s%@SHELL@%$SHELL%g
10179 s%@CFLAGS@%$CFLAGS%g
10180 s%@CPPFLAGS@%$CPPFLAGS%g
10181 s%@CXXFLAGS@%$CXXFLAGS%g
10182 s%@FFLAGS@%$FFLAGS%g
10183 s%@DEFS@%$DEFS%g
10184 s%@LDFLAGS@%$LDFLAGS%g
10185 s%@LIBS@%$LIBS%g
10186 s%@exec_prefix@%$exec_prefix%g
10187 s%@prefix@%$prefix%g
10188 s%@program_transform_name@%$program_transform_name%g
10189 s%@bindir@%$bindir%g
10190 s%@sbindir@%$sbindir%g
10191 s%@libexecdir@%$libexecdir%g
10192 s%@datadir@%$datadir%g
10193 s%@sysconfdir@%$sysconfdir%g
10194 s%@sharedstatedir@%$sharedstatedir%g
10195 s%@localstatedir@%$localstatedir%g
10196 s%@libdir@%$libdir%g
10197 s%@includedir@%$includedir%g
10198 s%@oldincludedir@%$oldincludedir%g
10199 s%@infodir@%$infodir%g
10200 s%@mandir@%$mandir%g
10201 s%@host@%$host%g
10202 s%@host_alias@%$host_alias%g
10203 s%@host_cpu@%$host_cpu%g
10204 s%@host_vendor@%$host_vendor%g
10205 s%@host_os@%$host_os%g
10206 s%@SET_MAKE@%$SET_MAKE%g
10207 s%@CC@%$CC%g
10208 s%@CPP@%$CPP%g
10209 s%@AWK@%$AWK%g
10210 s%@CTAGS@%$CTAGS%g
10211 s%@ETAGS@%$ETAGS%g
10212 s%@MAKE_LOWER_TAGS@%$MAKE_LOWER_TAGS%g
10213 s%@MAKE_UPPER_TAGS@%$MAKE_UPPER_TAGS%g
10214 s%@CC_G_OPT@%$CC_G_OPT%g
10215 s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
10216 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
10217 s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
10218 s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
10219 s%@LD@%$LD%g
10220 s%@LDFLAGS_SHARED@%$LDFLAGS_SHARED%g
10221 s%@LDFLAGS_STATIC@%$LDFLAGS_STATIC%g
10222 s%@LD_MODEL@%$LD_MODEL%g
10223 s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
10224 s%@LIBTOOL@%$LIBTOOL%g
10225 s%@LIB_CLEAN@%$LIB_CLEAN%g
10226 s%@LIB_COMPILE@%$LIB_COMPILE%g
10227 s%@LIB_LINK@%$LIB_LINK%g
10228 s%@LINK_TESTS@%$LINK_TESTS%g
10229 s%@LINT@%$LINT%g
10230 s%@LINT_OPTS@%$LINT_OPTS%g
10231 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
10232 s%@MATH_LIB@%$MATH_LIB%g
10233 s%@PTHREAD@%$PTHREAD%g
10234 s%@TEST_ARGS@%$TEST_ARGS%g
10235 s%@TEST_DEPS@%$TEST_DEPS%g
10236 s%@TEST_LIBS@%$TEST_LIBS%g
10237 s%@TINFO_ARGS@%$TINFO_ARGS%g
10238 s%@cf_cv_abi_version@%$cf_cv_abi_version%g
10239 s%@cf_cv_rel_version@%$cf_cv_rel_version%g
10240 s%@EXEEXT@%$EXEEXT%g
10241 s%@OBJEXT@%$OBJEXT%g
10242 s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%g
10243 s%@ECHO_LT@%$ECHO_LT%g
10244 s%@ECHO_LD@%$ECHO_LD%g
10245 s%@RULE_CC@%$RULE_CC%g
10246 s%@SHOW_CC@%$SHOW_CC%g
10247 s%@ECHO_CC@%$ECHO_CC%g
10248 s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
10249 s%@NCURSES_CONFIG@%$NCURSES_CONFIG%g
10250 s%@X_CFLAGS@%$X_CFLAGS%g
10251 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
10252 s%@X_LIBS@%$X_LIBS%g
10253 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
10254 s%@XCURSES_CONFIG@%$XCURSES_CONFIG%g
10255 s%@NCURSES_WRAP_PREFIX@%$NCURSES_WRAP_PREFIX%g
10256
10257 CEOF
10258 EOF
10259
10260 cat >> $CONFIG_STATUS <<\EOF
10261
10262 # Split the substitutions into bite-sized pieces for seds with
10263 # small command number limits, like on Digital OSF/1 and HP-UX.
10264 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
10265 ac_file=1 # Number of current file.
10266 ac_beg=1 # First line for current file.
10267 ac_end=$ac_max_sed_cmds # Line after last line for current file.
10268 ac_more_lines=:
10269 ac_sed_cmds=""
10270 while $ac_more_lines; do
10271   if test $ac_beg -gt 1; then
10272     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
10273   else
10274     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
10275   fi
10276   if test ! -s conftest.s$ac_file; then
10277     ac_more_lines=false
10278     rm -f conftest.s$ac_file
10279   else
10280     if test -z "$ac_sed_cmds"; then
10281       ac_sed_cmds="sed -f conftest.s$ac_file"
10282     else
10283       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
10284     fi
10285     ac_file=`expr $ac_file + 1`
10286     ac_beg=$ac_end
10287     ac_end=`expr $ac_end + $ac_max_sed_cmds`
10288   fi
10289 done
10290 if test -z "$ac_sed_cmds"; then
10291   ac_sed_cmds=cat
10292 fi
10293 EOF
10294
10295 cat >> $CONFIG_STATUS <<EOF
10296
10297 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
10298 EOF
10299 cat >> $CONFIG_STATUS <<\EOF
10300 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
10301   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10302   case "$ac_file" in
10303   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10304        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10305   *) ac_file_in="${ac_file}.in" ;;
10306   esac
10307
10308   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
10309
10310   # Remove last slash and all that follows it.  Not all systems have dirname.
10311   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10312   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10313     # The file is in a subdirectory.
10314     test ! -d "$ac_dir" && mkdir "$ac_dir"
10315     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
10316     # A "../" for each directory in $ac_dir_suffix.
10317     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
10318   else
10319     ac_dir_suffix= ac_dots=
10320   fi
10321
10322   case "$ac_given_srcdir" in
10323   .)  srcdir=.
10324       if test -z "$ac_dots"; then top_srcdir=.
10325       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
10326   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
10327   *) # Relative path.
10328     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
10329     top_srcdir="$ac_dots$ac_given_srcdir" ;;
10330   esac
10331
10332
10333   echo creating "$ac_file"
10334   rm -f "$ac_file"
10335   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
10336   case "$ac_file" in
10337   *Makefile*) ac_comsub="1i\\
10338 # $configure_input" ;;
10339   *) ac_comsub= ;;
10340   esac
10341
10342   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10343   sed -e "$ac_comsub
10344 s%@configure_input@%$configure_input%g
10345 s%@srcdir@%$srcdir%g
10346 s%@top_srcdir@%$top_srcdir%g
10347 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
10348 fi; done
10349 rm -f conftest.s*
10350
10351 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
10352 # NAME is the cpp macro being defined and VALUE is the value it is being given.
10353 #
10354 # ac_d sets the value in "#define NAME VALUE" lines.
10355 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
10356 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
10357 ac_dC='\3'
10358 ac_dD='%g'
10359 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
10360 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10361 ac_uB='\([      ]\)%\1#\2define\3'
10362 ac_uC=' '
10363 ac_uD='\4%g'
10364 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
10365 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10366 ac_eB='$%\1#\2define\3'
10367 ac_eC=' '
10368 ac_eD='%g'
10369
10370 if test "${CONFIG_HEADERS+set}" != set; then
10371 EOF
10372 cat >> $CONFIG_STATUS <<EOF
10373   CONFIG_HEADERS="ncurses_cfg.h:ncurses_tst.hin"
10374 EOF
10375 cat >> $CONFIG_STATUS <<\EOF
10376 fi
10377 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
10378   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10379   case "$ac_file" in
10380   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10381        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10382   *) ac_file_in="${ac_file}.in" ;;
10383   esac
10384
10385   echo creating $ac_file
10386
10387   rm -f conftest.frag conftest.in conftest.out
10388   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10389   cat $ac_file_inputs > conftest.in
10390
10391 EOF
10392
10393
10394 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
10395 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
10396 # be either 'cat' or 'sort'.
10397 cat confdefs.h >conftest.vals
10398
10399 # Break up conftest.vals because some shells have a limit on
10400 # the size of here documents, and old seds have small limits too.
10401
10402 rm -f conftest.tail
10403 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
10404 while :
10405 do
10406   ac_lines=`grep -c . conftest.vals`
10407   # grep -c gives empty output for an empty file on some AIX systems.
10408   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
10409   # Write chunks of a limited-size here document to conftest.frag.
10410   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
10411   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
10412   echo 'CEOF' >> $CONFIG_STATUS
10413   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
10414   rm -f conftest.vals
10415   mv conftest.tail conftest.vals
10416 done
10417 rm -f conftest.vals
10418
10419 # Run sed to substitute the contents of conftest.frag into conftest.in at the
10420 # marker @DEFS@.
10421 echo '  cat >> conftest.edit <<CEOF
10422 /@DEFS@/r conftest.frag
10423 /@DEFS@/d
10424 CEOF
10425 sed -f conftest.edit conftest.in > conftest.out
10426 rm -f conftest.in
10427 mv conftest.out conftest.in
10428 rm -f conftest.edit conftest.frag
10429 ' >> $CONFIG_STATUS
10430
10431
10432 cat >> $CONFIG_STATUS <<\EOF
10433   rm -f conftest.frag conftest.h
10434   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
10435   cat conftest.in >> conftest.h
10436   rm -f conftest.in
10437   if cmp -s $ac_file conftest.h 2>/dev/null; then
10438     echo "$ac_file is unchanged"
10439     rm -f conftest.h
10440   else
10441     # Remove last slash and all that follows it.  Not all systems have dirname.
10442       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10443       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10444       # The file is in a subdirectory.
10445       test ! -d "$ac_dir" && mkdir "$ac_dir"
10446     fi
10447     rm -f $ac_file
10448     mv conftest.h $ac_file
10449   fi
10450 fi; done
10451
10452 EOF
10453 cat >> $CONFIG_STATUS <<EOF
10454 # Extra initialization commands, if any
10455
10456 AWK="$AWK"
10457 ECHO_LD="$ECHO_LD"
10458
10459 EOF
10460 cat >> $CONFIG_STATUS <<\EOF
10461 # Extra commands, if any
10462
10463
10464 for cf_dir in .
10465 do
10466         if test ! -d $srcdir/$cf_dir; then
10467                 continue
10468         elif test -f $srcdir/$cf_dir/programs; then
10469                 $AWK -f $srcdir/mk-test.awk ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
10470         fi
10471 done
10472
10473
10474         cat >>Makefile <<TEST_EOF
10475
10476 # These rules are generated so we do not rely on suffix rules, which do not
10477 # work consistently for different make-programs (the '\$(MODEL)/' confuses
10478 # some, and the '\$x' confuses others).
10479 TEST_EOF
10480 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
10481 for N in $LIST
10482 do
10483         cat >>Makefile <<TEST_EOF
10484
10485 \$(MODEL)/$N.o : $N.c \\
10486         test.priv.h \\
10487         ncurses_cfg.h
10488         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
10489 TEST_EOF
10490 done
10491
10492 exit 0
10493 EOF
10494 chmod +x $CONFIG_STATUS
10495 rm -fr confdefs* $ac_clean_files
10496 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
10497