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