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