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