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