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