]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
fba2ae16ea5e068ef24fbf93679cc32db9a1ddcc
[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 TINFO_ARGS='$(LIBS_CURSES)'             
1239 cf_cv_abi_version=""                    
1240 cf_cv_rel_version=""                    
1241
1242 cf_cv_screen=curses
1243 cf_cv_libtype=
1244
1245 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
1246 echo "configure:1247: checking for Cygwin environment" >&5
1247 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
1248   echo $ac_n "(cached) $ac_c" 1>&6
1249 else
1250   cat > conftest.$ac_ext <<EOF
1251 #line 1252 "configure"
1252 #include "confdefs.h"
1253
1254 int main() {
1255
1256 #ifndef __CYGWIN__
1257 #define __CYGWIN__ __CYGWIN32__
1258 #endif
1259 return __CYGWIN__;
1260 ; return 0; }
1261 EOF
1262 if { (eval echo configure:1263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1263   rm -rf conftest*
1264   ac_cv_cygwin=yes
1265 else
1266   echo "configure: failed program was:" >&5
1267   cat conftest.$ac_ext >&5
1268   rm -rf conftest*
1269   ac_cv_cygwin=no
1270 fi
1271 rm -f conftest*
1272 rm -f conftest*
1273 fi
1274
1275 echo "$ac_t""$ac_cv_cygwin" 1>&6
1276 CYGWIN=
1277 test "$ac_cv_cygwin" = yes && CYGWIN=yes
1278 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
1279 echo "configure:1280: checking for mingw32 environment" >&5
1280 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
1281   echo $ac_n "(cached) $ac_c" 1>&6
1282 else
1283   cat > conftest.$ac_ext <<EOF
1284 #line 1285 "configure"
1285 #include "confdefs.h"
1286
1287 int main() {
1288 return __MINGW32__;
1289 ; return 0; }
1290 EOF
1291 if { (eval echo configure:1292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1292   rm -rf conftest*
1293   ac_cv_mingw32=yes
1294 else
1295   echo "configure: failed program was:" >&5
1296   cat conftest.$ac_ext >&5
1297   rm -rf conftest*
1298   ac_cv_mingw32=no
1299 fi
1300 rm -f conftest*
1301 rm -f conftest*
1302 fi
1303
1304 echo "$ac_t""$ac_cv_mingw32" 1>&6
1305 MINGW32=
1306 test "$ac_cv_mingw32" = yes && MINGW32=yes
1307
1308
1309 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1310 echo "configure:1311: checking for executable suffix" >&5
1311 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
1312   echo $ac_n "(cached) $ac_c" 1>&6
1313 else
1314   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
1315   ac_cv_exeext=.exe
1316 else
1317   rm -f conftest*
1318   echo 'int main () { return 0; }' > conftest.$ac_ext
1319   ac_cv_exeext=
1320   if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1321     for file in conftest.*; do
1322       case $file in
1323       *.c | *.o | *.obj) ;;
1324       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
1325       esac
1326     done
1327   else
1328     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
1329   fi
1330   rm -f conftest*
1331   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
1332 fi
1333 fi
1334
1335 EXEEXT=""
1336 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
1337 echo "$ac_t""${ac_cv_exeext}" 1>&6
1338 ac_exeext=$EXEEXT
1339
1340 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
1341 echo "configure:1342: checking for object suffix" >&5
1342 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
1343   echo $ac_n "(cached) $ac_c" 1>&6
1344 else
1345   rm -f conftest*
1346 echo 'int i = 1;' > conftest.$ac_ext
1347 if { (eval echo configure:1348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1348   for ac_file in conftest.*; do
1349     case $ac_file in
1350     *.c) ;;
1351     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
1352     esac
1353   done
1354 else
1355   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
1356 fi
1357 rm -f conftest*
1358 fi
1359
1360 echo "$ac_t""$ac_cv_objext" 1>&6
1361 OBJEXT=$ac_cv_objext
1362 ac_objext=$ac_cv_objext
1363
1364
1365
1366 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1367 echo "configure:1368: checking for ${CC-cc} option to accept ANSI C" >&5
1368 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
1369   echo $ac_n "(cached) $ac_c" 1>&6
1370 else
1371   
1372 cf_cv_ansi_cc=no
1373 cf_save_CFLAGS="$CFLAGS"
1374 cf_save_CPPFLAGS="$CPPFLAGS"
1375 # Don't try gcc -ansi; that turns off useful extensions and
1376 # breaks some systems' header files.
1377 # AIX                   -qlanglvl=ansi
1378 # Ultrix and OSF/1      -std1
1379 # HP-UX                 -Aa -D_HPUX_SOURCE
1380 # SVR4                  -Xc
1381 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
1382 for cf_arg in "-DCC_HAS_PROTOS" \
1383         "" \
1384         -qlanglvl=ansi \
1385         -std1 \
1386         -Ae \
1387         "-Aa -D_HPUX_SOURCE" \
1388         -Xc
1389 do
1390         
1391 cf_fix_cppflags=no
1392 cf_new_cflags=
1393 cf_new_cppflags=
1394 cf_new_extra_cppflags=
1395
1396 for cf_add_cflags in $cf_arg
1397 do
1398 case $cf_fix_cppflags in
1399 no)
1400         case $cf_add_cflags in #(vi
1401         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1402                 case $cf_add_cflags in
1403                 -D*)
1404                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1405
1406                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1407                         && test -z "${cf_tst_cflags}" \
1408                         && cf_fix_cppflags=yes
1409
1410                         if test $cf_fix_cppflags = yes ; then
1411                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1412                                 continue
1413                         elif test "${cf_tst_cflags}" = "\"'" ; then
1414                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1415                                 continue
1416                         fi
1417                         ;;
1418                 esac
1419                 case "$CPPFLAGS" in
1420                 *$cf_add_cflags) #(vi
1421                         ;;
1422                 *) #(vi
1423                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1424                         ;;
1425                 esac
1426                 ;;
1427         *)
1428                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1429                 ;;
1430         esac
1431         ;;
1432 yes)
1433         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1434
1435         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1436
1437         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1438         && test -z "${cf_tst_cflags}" \
1439         && cf_fix_cppflags=no
1440         ;;
1441 esac
1442 done
1443
1444 if test -n "$cf_new_cflags" ; then
1445         
1446         CFLAGS="$CFLAGS $cf_new_cflags"
1447 fi
1448
1449 if test -n "$cf_new_cppflags" ; then
1450         
1451         CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
1452 fi
1453
1454 if test -n "$cf_new_extra_cppflags" ; then
1455         
1456         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1457 fi
1458
1459
1460
1461
1462         cat > conftest.$ac_ext <<EOF
1463 #line 1464 "configure"
1464 #include "confdefs.h"
1465
1466 #ifndef CC_HAS_PROTOS
1467 #if !defined(__STDC__) || (__STDC__ != 1)
1468 choke me
1469 #endif
1470 #endif
1471
1472 int main() {
1473
1474         int test (int i, double x);
1475         struct s1 {int (*f) (int a);};
1476         struct s2 {int (*f) (double a);};
1477 ; return 0; }
1478 EOF
1479 if { (eval echo configure:1480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1480   rm -rf conftest*
1481   cf_cv_ansi_cc="$cf_arg"; break
1482 else
1483   echo "configure: failed program was:" >&5
1484   cat conftest.$ac_ext >&5
1485 fi
1486 rm -f conftest*
1487 done
1488 CFLAGS="$cf_save_CFLAGS"
1489 CPPFLAGS="$cf_save_CPPFLAGS"
1490
1491 fi
1492
1493 echo "$ac_t""$cf_cv_ansi_cc" 1>&6
1494
1495 if test "$cf_cv_ansi_cc" != "no"; then
1496 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1497         
1498 cf_fix_cppflags=no
1499 cf_new_cflags=
1500 cf_new_cppflags=
1501 cf_new_extra_cppflags=
1502
1503 for cf_add_cflags in $cf_cv_ansi_cc
1504 do
1505 case $cf_fix_cppflags in
1506 no)
1507         case $cf_add_cflags in #(vi
1508         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1509                 case $cf_add_cflags in
1510                 -D*)
1511                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1512
1513                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1514                         && test -z "${cf_tst_cflags}" \
1515                         && cf_fix_cppflags=yes
1516
1517                         if test $cf_fix_cppflags = yes ; then
1518                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1519                                 continue
1520                         elif test "${cf_tst_cflags}" = "\"'" ; then
1521                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1522                                 continue
1523                         fi
1524                         ;;
1525                 esac
1526                 case "$CPPFLAGS" in
1527                 *$cf_add_cflags) #(vi
1528                         ;;
1529                 *) #(vi
1530                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1531                         ;;
1532                 esac
1533                 ;;
1534         *)
1535                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1536                 ;;
1537         esac
1538         ;;
1539 yes)
1540         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1541
1542         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1543
1544         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1545         && test -z "${cf_tst_cflags}" \
1546         && cf_fix_cppflags=no
1547         ;;
1548 esac
1549 done
1550
1551 if test -n "$cf_new_cflags" ; then
1552         
1553         CFLAGS="$CFLAGS $cf_new_cflags"
1554 fi
1555
1556 if test -n "$cf_new_cppflags" ; then
1557         
1558         CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
1559 fi
1560
1561 if test -n "$cf_new_extra_cppflags" ; then
1562         
1563         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1564 fi
1565
1566
1567
1568
1569 else
1570         cat >> confdefs.h <<\EOF
1571 #define CC_HAS_PROTOS 1
1572 EOF
1573
1574 fi
1575 fi
1576
1577
1578 if test "$cf_cv_ansi_cc" = "no"; then
1579         { echo "configure: error: Your compiler does not appear to recognize prototypes.
1580 You have the following choices:
1581         a. adjust your compiler options
1582         b. get an up-to-date compiler
1583         c. use a wrapper such as unproto" 1>&2; exit 1; }
1584 fi
1585
1586
1587
1588 GCC_VERSION=none
1589 if test "$GCC" = yes ; then
1590         echo $ac_n "checking version of $CC""... $ac_c" 1>&6
1591 echo "configure:1592: checking version of $CC" >&5
1592         GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1593         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1594         echo "$ac_t""$GCC_VERSION" 1>&6
1595 fi
1596
1597
1598 if ( test "$GCC" = yes || test "$GXX" = yes )
1599 then
1600 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
1601 echo "configure:1602: checking if you want to turn on gcc warnings" >&5
1602
1603 # Check whether --enable-warnings or --disable-warnings was given.
1604 if test "${enable_warnings+set}" = set; then
1605   enableval="$enable_warnings"
1606   test "$enableval" != yes && enableval=no
1607   if test "$enableval" != "no" ; then
1608     with_warnings=yes 
1609   else
1610     with_warnings=no
1611   fi
1612 else
1613   enableval=no 
1614   with_warnings=no
1615   
1616 fi
1617
1618 echo "$ac_t""$with_warnings" 1>&6
1619 if test "$with_warnings" = "yes"
1620 then
1621         
1622
1623
1624 INTEL_COMPILER=no
1625
1626 if test "$GCC" = yes ; then
1627         case $host_os in
1628         linux*|gnu*)
1629                 echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
1630 echo "configure:1631: checking if this is really Intel C compiler" >&5
1631                 cf_save_CFLAGS="$CFLAGS"
1632                 CFLAGS="$CFLAGS -no-gcc"
1633                 cat > conftest.$ac_ext <<EOF
1634 #line 1635 "configure"
1635 #include "confdefs.h"
1636
1637 int main() {
1638
1639 #ifdef __INTEL_COMPILER
1640 #else
1641 make an error
1642 #endif
1643
1644 ; return 0; }
1645 EOF
1646 if { (eval echo configure:1647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1647   rm -rf conftest*
1648   INTEL_COMPILER=yes
1649 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
1650
1651 else
1652   echo "configure: failed program was:" >&5
1653   cat conftest.$ac_ext >&5
1654 fi
1655 rm -f conftest*
1656                 CFLAGS="$cf_save_CFLAGS"
1657                 echo "$ac_t""$INTEL_COMPILER" 1>&6
1658                 ;;
1659         esac
1660 fi
1661
1662
1663 cat > conftest.$ac_ext <<EOF
1664 #line 1665 "configure"
1665 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
1666 EOF
1667
1668 if test "$INTEL_COMPILER" = yes
1669 then
1670 # The "-wdXXX" options suppress warnings:
1671 # remark #1419: external declaration in primary source file
1672 # remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
1673 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
1674 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
1675 # remark #193: zero used for undefined preprocessing identifier
1676 # remark #593: variable "curs_sb_left_arrow" was set but never used
1677 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
1678 # remark #869: parameter "tw" was never referenced
1679 # remark #981: operands are evaluated in unspecified order
1680 # warning #269: invalid format string conversion
1681
1682         echo "checking for $CC warning options" 1>&6
1683 echo "configure:1684: checking for $CC warning options" >&5
1684         cf_save_CFLAGS="$CFLAGS"
1685         EXTRA_CFLAGS="-Wall"
1686         for cf_opt in  \
1687                 wd1419 \
1688                 wd1682 \
1689                 wd1683 \
1690                 wd1684 \
1691                 wd193 \
1692                 wd279 \
1693                 wd593 \
1694                 wd810 \
1695                 wd869 \
1696                 wd981
1697         do
1698                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
1699                 if { (eval echo configure:1700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1700                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
1701                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
1702                 fi
1703         done
1704         CFLAGS="$cf_save_CFLAGS"
1705
1706 elif test "$GCC" = yes
1707 then
1708         echo "checking for $CC warning options" 1>&6
1709 echo "configure:1710: checking for $CC warning options" >&5
1710         cf_save_CFLAGS="$CFLAGS"
1711         EXTRA_CFLAGS="-W -Wall"
1712         cf_warn_CONST=""
1713         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
1714         for cf_opt in \
1715                 Wbad-function-cast \
1716                 Wcast-align \
1717                 Wcast-qual \
1718                 Winline \
1719                 Wmissing-declarations \
1720                 Wmissing-prototypes \
1721                 Wnested-externs \
1722                 Wpointer-arith \
1723                 Wshadow \
1724                 Wstrict-prototypes \
1725                 Wundef $cf_warn_CONST 
1726         do
1727                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
1728                 if { (eval echo configure:1729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1729                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
1730                         case $cf_opt in #(vi
1731                         Wcast-qual) #(vi
1732                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
1733                                 ;;
1734                         Winline) #(vi
1735                                 case $GCC_VERSION in
1736                                 3.3*)
1737                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
1738
1739                                         continue;;
1740                                 esac
1741                                 ;;
1742                         esac
1743                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
1744                 fi
1745         done
1746         CFLAGS="$cf_save_CFLAGS"
1747 fi
1748 rm -f conftest*
1749
1750
1751
1752 fi
1753 fi
1754
1755
1756 if test "$GCC" = yes
1757 then
1758 cat > conftest.i <<EOF
1759 #ifndef GCC_PRINTF
1760 #define GCC_PRINTF 0
1761 #endif
1762 #ifndef GCC_SCANF
1763 #define GCC_SCANF 0
1764 #endif
1765 #ifndef GCC_NORETURN
1766 #define GCC_NORETURN /* nothing */
1767 #endif
1768 #ifndef GCC_UNUSED
1769 #define GCC_UNUSED /* nothing */
1770 #endif
1771 EOF
1772 if test "$GCC" = yes
1773 then
1774         echo "checking for $CC __attribute__ directives" 1>&6
1775 echo "configure:1776: checking for $CC __attribute__ directives" >&5
1776 cat > conftest.$ac_ext <<EOF
1777 #line 1778 "configure"
1778 #include "confdefs.h"
1779 #include "conftest.h"
1780 #include "conftest.i"
1781 #if     GCC_PRINTF
1782 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
1783 #else
1784 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
1785 #endif
1786 #if     GCC_SCANF
1787 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
1788 #else
1789 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
1790 #endif
1791 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
1792 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
1793 extern void foo(void) GCC_NORETURN;
1794 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
1795 EOF
1796         for cf_attribute in scanf printf unused noreturn
1797         do
1798                 
1799 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1800
1801                 cf_directive="__attribute__(($cf_attribute))"
1802                 echo "checking for $CC $cf_directive" 1>&5
1803                 case $cf_attribute in
1804                 scanf|printf)
1805                 cat >conftest.h <<EOF
1806 #define GCC_$cf_ATTRIBUTE 1
1807 EOF
1808                         ;;
1809                 *)
1810                 cat >conftest.h <<EOF
1811 #define GCC_$cf_ATTRIBUTE $cf_directive
1812 EOF
1813                         ;;
1814                 esac
1815                 if { (eval echo configure:1816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1816                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
1817                         cat conftest.h >>confdefs.h
1818                 fi
1819         done
1820 else
1821         fgrep define conftest.i >>confdefs.h
1822 fi
1823 rm -rf conftest*
1824 fi
1825
1826
1827 echo $ac_n "checking if $CC -U and -D options work together""... $ac_c" 1>&6
1828 echo "configure:1829: checking if $CC -U and -D options work together" >&5
1829 if eval "test \"`echo '$''{'cf_cv_cc_u_d_options'+set}'`\" = set"; then
1830   echo $ac_n "(cached) $ac_c" 1>&6
1831 else
1832   
1833         cf_save_CPPFLAGS="$CPPFLAGS"
1834         CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
1835         cat > conftest.$ac_ext <<EOF
1836 #line 1837 "configure"
1837 #include "confdefs.h"
1838
1839 int main() {
1840
1841 #ifndef U_D_OPTIONS
1842 make an undefined-error
1843 #endif
1844 #ifdef  D_U_OPTIONS
1845 make a defined-error
1846 #endif
1847         
1848 ; return 0; }
1849 EOF
1850 if { (eval echo configure:1851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1851   rm -rf conftest*
1852   
1853         cf_cv_cc_u_d_options=yes
1854 else
1855   echo "configure: failed program was:" >&5
1856   cat conftest.$ac_ext >&5
1857   rm -rf conftest*
1858   
1859         cf_cv_cc_u_d_options=no
1860 fi
1861 rm -f conftest*
1862         CPPFLAGS="$cf_save_CPPFLAGS"
1863
1864 fi
1865
1866 echo "$ac_t""$cf_cv_cc_u_d_options" 1>&6
1867
1868
1869
1870
1871
1872 cf_XOPEN_SOURCE=500
1873 cf_POSIX_C_SOURCE=199506L
1874
1875 case $host_os in #(vi
1876 aix[45]*) #(vi
1877         CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
1878         ;;
1879 freebsd*) #(vi
1880         # 5.x headers associate
1881         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
1882         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
1883         cf_POSIX_C_SOURCE=200112L
1884         cf_XOPEN_SOURCE=600
1885         CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1886         ;;
1887 hpux*) #(vi
1888         CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
1889         ;;
1890 irix[56].*) #(vi
1891         CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
1892         ;;
1893 linux*|gnu*) #(vi
1894         
1895 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
1896 echo "configure:1897: checking if we must define _GNU_SOURCE" >&5
1897 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
1898   echo $ac_n "(cached) $ac_c" 1>&6
1899 else
1900   
1901 cat > conftest.$ac_ext <<EOF
1902 #line 1903 "configure"
1903 #include "confdefs.h"
1904 #include <sys/types.h>
1905 int main() {
1906
1907 #ifndef _XOPEN_SOURCE
1908 make an error
1909 #endif
1910 ; return 0; }
1911 EOF
1912 if { (eval echo configure:1913: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1913   rm -rf conftest*
1914   cf_cv_gnu_source=no
1915 else
1916   echo "configure: failed program was:" >&5
1917   cat conftest.$ac_ext >&5
1918   rm -rf conftest*
1919   cf_save="$CPPFLAGS"
1920          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1921          cat > conftest.$ac_ext <<EOF
1922 #line 1923 "configure"
1923 #include "confdefs.h"
1924 #include <sys/types.h>
1925 int main() {
1926
1927 #ifdef _XOPEN_SOURCE
1928 make an error
1929 #endif
1930 ; return 0; }
1931 EOF
1932 if { (eval echo configure:1933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1933   rm -rf conftest*
1934   cf_cv_gnu_source=no
1935 else
1936   echo "configure: failed program was:" >&5
1937   cat conftest.$ac_ext >&5
1938   rm -rf conftest*
1939   cf_cv_gnu_source=yes
1940 fi
1941 rm -f conftest*
1942         CPPFLAGS="$cf_save"
1943         
1944 fi
1945 rm -f conftest*
1946
1947 fi
1948
1949 echo "$ac_t""$cf_cv_gnu_source" 1>&6
1950 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1951
1952         ;;
1953 mirbsd*) #(vi
1954         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
1955         ;;
1956 netbsd*) #(vi
1957         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
1958         ;;
1959 openbsd*) #(vi
1960         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
1961         ;;
1962 osf[45]*) #(vi
1963         CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
1964         ;;
1965 nto-qnx*) #(vi
1966         CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
1967         ;;
1968 sco*) #(vi
1969         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
1970         ;;
1971 solaris*) #(vi
1972         CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
1973         ;;
1974 *)
1975         echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
1976 echo "configure:1977: checking if we should define _XOPEN_SOURCE" >&5
1977 if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
1978   echo $ac_n "(cached) $ac_c" 1>&6
1979 else
1980   
1981         cat > conftest.$ac_ext <<EOF
1982 #line 1983 "configure"
1983 #include "confdefs.h"
1984 #include <sys/types.h>
1985 int main() {
1986
1987 #ifndef _XOPEN_SOURCE
1988 make an error
1989 #endif
1990 ; return 0; }
1991 EOF
1992 if { (eval echo configure:1993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1993   rm -rf conftest*
1994   cf_cv_xopen_source=no
1995 else
1996   echo "configure: failed program was:" >&5
1997   cat conftest.$ac_ext >&5
1998   rm -rf conftest*
1999   cf_save="$CPPFLAGS"
2000          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2001          cat > conftest.$ac_ext <<EOF
2002 #line 2003 "configure"
2003 #include "confdefs.h"
2004 #include <sys/types.h>
2005 int main() {
2006
2007 #ifdef _XOPEN_SOURCE
2008 make an error
2009 #endif
2010 ; return 0; }
2011 EOF
2012 if { (eval echo configure:2013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2013   rm -rf conftest*
2014   cf_cv_xopen_source=no
2015 else
2016   echo "configure: failed program was:" >&5
2017   cat conftest.$ac_ext >&5
2018   rm -rf conftest*
2019   cf_cv_xopen_source=$cf_XOPEN_SOURCE
2020 fi
2021 rm -f conftest*
2022         CPPFLAGS="$cf_save"
2023         
2024 fi
2025 rm -f conftest*
2026
2027 fi
2028
2029 echo "$ac_t""$cf_cv_xopen_source" 1>&6
2030         if test "$cf_cv_xopen_source" != no ; then
2031                 
2032 # remove _XOPEN_SOURCE symbol from $CFLAGS
2033 CFLAGS=`echo "$CFLAGS" | \
2034         sed     -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?[         ]/ /g' \
2035                 -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?$//g'`
2036
2037                 
2038 # remove _XOPEN_SOURCE symbol from $CPPFLAGS
2039 CPPFLAGS=`echo "$CPPFLAGS" | \
2040         sed     -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?[         ]/ /g' \
2041                 -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?$//g'`
2042
2043                 test "$cf_cv_cc_u_d_options" = yes && \
2044                         CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
2045                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
2046         fi
2047         
2048 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2049
2050 cf_save_CFLAGS="$CFLAGS"
2051 cf_save_CPPFLAGS="$CPPFLAGS"
2052
2053
2054 # remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS
2055 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2056         sed     -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?[         ]/ /g' \
2057                 -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?$//g'`
2058
2059
2060 # remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS
2061 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2062         sed     -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?[         ]/ /g' \
2063                 -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?$//g'`
2064
2065
2066 echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
2067 echo "configure:2068: checking if we should define _POSIX_C_SOURCE" >&5
2068 if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
2069   echo $ac_n "(cached) $ac_c" 1>&6
2070 else
2071   
2072         
2073 echo "(line 2074) testing if the symbol is already defined go no further ..." 1>&5
2074
2075         cat > conftest.$ac_ext <<EOF
2076 #line 2077 "configure"
2077 #include "confdefs.h"
2078 #include <sys/types.h>
2079 int main() {
2080
2081 #ifndef _POSIX_C_SOURCE
2082 make an error
2083 #endif
2084 ; return 0; }
2085 EOF
2086 if { (eval echo configure:2087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2087   rm -rf conftest*
2088   cf_cv_posix_c_source=no
2089 else
2090   echo "configure: failed program was:" >&5
2091   cat conftest.$ac_ext >&5
2092   rm -rf conftest*
2093   cf_want_posix_source=no
2094          case .$cf_POSIX_C_SOURCE in #(vi
2095          .[12]??*) #(vi
2096                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2097                 ;;
2098          .2) #(vi
2099                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2100                 cf_want_posix_source=yes
2101                 ;;
2102          .*)
2103                 cf_want_posix_source=yes
2104                 ;;
2105          esac
2106          if test "$cf_want_posix_source" = yes ; then
2107                 cat > conftest.$ac_ext <<EOF
2108 #line 2109 "configure"
2109 #include "confdefs.h"
2110 #include <sys/types.h>
2111 int main() {
2112
2113 #ifdef _POSIX_SOURCE
2114 make an error
2115 #endif
2116 ; return 0; }
2117 EOF
2118 if { (eval echo configure:2119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2119   :
2120 else
2121   echo "configure: failed program was:" >&5
2122   cat conftest.$ac_ext >&5
2123   rm -rf conftest*
2124   cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
2125 fi
2126 rm -f conftest*
2127          fi
2128          
2129 echo "(line 2130) testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
2130
2131          CFLAGS="$cf_trim_CFLAGS"
2132          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
2133          
2134 echo "(line 2135) testing if the second compile does not leave our definition intact error ..." 1>&5
2135
2136          cat > conftest.$ac_ext <<EOF
2137 #line 2138 "configure"
2138 #include "confdefs.h"
2139 #include <sys/types.h>
2140 int main() {
2141
2142 #ifndef _POSIX_C_SOURCE
2143 make an error
2144 #endif
2145 ; return 0; }
2146 EOF
2147 if { (eval echo configure:2148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2148   :
2149 else
2150   echo "configure: failed program was:" >&5
2151   cat conftest.$ac_ext >&5
2152   rm -rf conftest*
2153   cf_cv_posix_c_source=no
2154 fi
2155 rm -f conftest*
2156          CFLAGS="$cf_save_CFLAGS"
2157          CPPFLAGS="$cf_save_CPPFLAGS"
2158         
2159 fi
2160 rm -f conftest*
2161
2162 fi
2163
2164 echo "$ac_t""$cf_cv_posix_c_source" 1>&6
2165
2166 if test "$cf_cv_posix_c_source" != no ; then
2167         CFLAGS="$cf_trim_CFLAGS"
2168         CPPFLAGS="$cf_trim_CPPFLAGS"
2169         if test "$cf_cv_cc_u_d_options" = yes ; then
2170                 cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
2171                                 sed -e 's/-D/-U/g' -e 's/=[^    ]*//g'`
2172                 CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
2173         fi
2174         CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
2175 fi
2176
2177
2178         ;;
2179 esac
2180
2181
2182
2183
2184 # Check whether --with-curses-dir or --without-curses-dir was given.
2185 if test "${with_curses_dir+set}" = set; then
2186   withval="$with_curses_dir"
2187   
2188 if test "x$prefix" != xNONE; then
2189   cf_path_syntax="$prefix"
2190 else
2191   cf_path_syntax="$ac_default_prefix"
2192 fi
2193
2194 case ".$withval" in #(vi
2195 .\$\(*\)*|.\'*\'*) #(vi
2196   ;;
2197 ..|./*|.\\*) #(vi
2198   ;;
2199 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2200   ;;
2201 .\${*prefix}*) #(vi
2202   eval withval="$withval"
2203   case ".$withval" in #(vi
2204   .NONE/*)
2205     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2206     ;;
2207   esac
2208   ;; #(vi
2209 .no|.NONE/*)
2210   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2211   ;;
2212 *)
2213   { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
2214   ;;
2215 esac
2216
2217          cf_cv_curses_dir=$withval
2218 else
2219   cf_cv_curses_dir=no
2220 fi
2221
2222
2223
2224
2225 # Check whether --with-5lib or --without-5lib was given.
2226 if test "${with_5lib+set}" = set; then
2227   withval="$with_5lib"
2228   LIBS="-L/usr/5lib $LIBS"
2229          CPPFLAGS="$CPPFLAGS -I/usr/5include"
2230 fi
2231
2232
2233
2234 # Check whether --with-ncursesw or --without-ncursesw was given.
2235 if test "${with_ncursesw+set}" = set; then
2236   withval="$with_ncursesw"
2237   cf_cv_screen=ncursesw
2238 else
2239   
2240
2241
2242 # Check whether --with-ncurses or --without-ncurses was given.
2243 if test "${with_ncurses+set}" = set; then
2244   withval="$with_ncurses"
2245   cf_cv_screen=ncurses
2246 else
2247   
2248
2249
2250 # Check whether --with-pdcurses or --without-pdcurses was given.
2251 if test "${with_pdcurses+set}" = set; then
2252   withval="$with_pdcurses"
2253   cf_cv_screen=pdcurses
2254 fi
2255
2256 fi
2257
2258 fi
2259
2260
2261 case $cf_cv_screen in
2262 curses)
2263         
2264
2265 echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
2266 echo "configure:2267: checking for extra include directories" >&5
2267 if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
2268   echo $ac_n "(cached) $ac_c" 1>&6
2269 else
2270   
2271 cf_cv_curses_incdir=no
2272 case $host_os in #(vi
2273 hpux10.*) #(vi
2274         test -d /usr/include/curses_colr && \
2275         cf_cv_curses_incdir="-I/usr/include/curses_colr"
2276         ;;
2277 sunos3*|sunos4*)
2278         test -d /usr/5lib && \
2279         test -d /usr/5include && \
2280         cf_cv_curses_incdir="-I/usr/5include"
2281         ;;
2282 esac
2283
2284 fi
2285
2286 echo "$ac_t""$cf_cv_curses_incdir" 1>&6
2287 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
2288
2289
2290 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
2291 echo "configure:2292: checking if we have identified curses headers" >&5
2292 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
2293   echo $ac_n "(cached) $ac_c" 1>&6
2294 else
2295   
2296 cf_cv_ncurses_header=none
2297 for cf_header in \
2298         curses.h \
2299         ncurses.h \
2300         ncurses/curses.h \
2301         ncurses/ncurses.h
2302 do
2303 cat > conftest.$ac_ext <<EOF
2304 #line 2305 "configure"
2305 #include "confdefs.h"
2306 #include <${cf_header}>
2307 int main() {
2308 initscr(); tgoto("?", 0,0)
2309 ; return 0; }
2310 EOF
2311 if { (eval echo configure:2312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2312   rm -rf conftest*
2313   cf_cv_ncurses_header=$cf_header; break
2314 else
2315   echo "configure: failed program was:" >&5
2316   cat conftest.$ac_ext >&5
2317 fi
2318 rm -f conftest*
2319 done
2320
2321 fi
2322
2323 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
2324
2325 if test "$cf_cv_ncurses_header" = none ; then
2326         { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
2327 fi
2328
2329 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
2330 for ac_hdr in $cf_cv_ncurses_header
2331 do
2332 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2333 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2334 echo "configure:2335: checking for $ac_hdr" >&5
2335 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2336   echo $ac_n "(cached) $ac_c" 1>&6
2337 else
2338   cat > conftest.$ac_ext <<EOF
2339 #line 2340 "configure"
2340 #include "confdefs.h"
2341 #include <$ac_hdr>
2342 EOF
2343 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2344 { (eval echo configure:2345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2345 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2346 if test -z "$ac_err"; then
2347   rm -rf conftest*
2348   eval "ac_cv_header_$ac_safe=yes"
2349 else
2350   echo "$ac_err" >&5
2351   echo "configure: failed program was:" >&5
2352   cat conftest.$ac_ext >&5
2353   rm -rf conftest*
2354   eval "ac_cv_header_$ac_safe=no"
2355 fi
2356 rm -f conftest*
2357 fi
2358 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2359   echo "$ac_t""yes" 1>&6
2360     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2361   cat >> confdefs.h <<EOF
2362 #define $ac_tr_hdr 1
2363 EOF
2364  
2365 else
2366   echo "$ac_t""no" 1>&6
2367 fi
2368 done
2369
2370
2371
2372 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
2373 echo "configure:2374: checking for terminfo header" >&5
2374 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
2375   echo $ac_n "(cached) $ac_c" 1>&6
2376 else
2377   
2378 case ${cf_cv_ncurses_header} in #(vi
2379 */ncurses.h|*/ncursesw.h) #(vi
2380         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
2381         ;;
2382 *)
2383         cf_term_header=term.h
2384         ;;
2385 esac
2386
2387 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
2388 do
2389 cat > conftest.$ac_ext <<EOF
2390 #line 2391 "configure"
2391 #include "confdefs.h"
2392 #include <stdio.h>
2393 #include <${cf_cv_ncurses_header-curses.h}>
2394 #include <$cf_test>
2395
2396 int main() {
2397 int x = auto_left_margin
2398 ; return 0; }
2399 EOF
2400 if { (eval echo configure:2401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2401   rm -rf conftest*
2402   
2403         cf_cv_term_header="$cf_test"
2404 else
2405   echo "configure: failed program was:" >&5
2406   cat conftest.$ac_ext >&5
2407   rm -rf conftest*
2408   
2409         cf_cv_term_header=unknown
2410         
2411 fi
2412 rm -f conftest*
2413         test "$cf_cv_term_header" != unknown && break
2414 done
2415
2416 fi
2417
2418 echo "$ac_t""$cf_cv_term_header" 1>&6
2419
2420 # Set definitions to allow ifdef'ing to accommodate subdirectories
2421
2422 case $cf_cv_term_header in # (vi
2423 *term.h)
2424         cat >> confdefs.h <<\EOF
2425 #define HAVE_TERM_H 1
2426 EOF
2427
2428         ;;
2429 esac
2430
2431 case $cf_cv_term_header in # (vi
2432 ncurses/term.h) #(vi
2433         cat >> confdefs.h <<\EOF
2434 #define HAVE_NCURSES_TERM_H 1
2435 EOF
2436
2437         ;;
2438 ncursesw/term.h)
2439         cat >> confdefs.h <<\EOF
2440 #define HAVE_NCURSESW_TERM_H 1
2441 EOF
2442
2443         ;;
2444 esac
2445
2446
2447         
2448 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
2449 echo "configure:2450: checking for ncurses version" >&5
2450 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
2451   echo $ac_n "(cached) $ac_c" 1>&6
2452 else
2453   
2454         cf_cv_ncurses_version=no
2455         cf_tempfile=out$$
2456         rm -f $cf_tempfile
2457         if test "$cross_compiling" = yes; then
2458   
2459
2460         # This will not work if the preprocessor splits the line after the
2461         # Autoconf token.  The 'unproto' program does that.
2462         cat > conftest.$ac_ext <<EOF
2463 #include <${cf_cv_ncurses_header-curses.h}>
2464 #undef Autoconf
2465 #ifdef NCURSES_VERSION
2466 Autoconf NCURSES_VERSION
2467 #else
2468 #ifdef __NCURSES_H
2469 Autoconf "old"
2470 #endif
2471 ;
2472 #endif
2473 EOF
2474         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
2475         { (eval echo configure:2476: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
2476         if test -f conftest.out ; then
2477                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
2478                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
2479                 rm -f conftest.out
2480         fi
2481
2482 else
2483   cat > conftest.$ac_ext <<EOF
2484 #line 2485 "configure"
2485 #include "confdefs.h"
2486
2487 #include <${cf_cv_ncurses_header-curses.h}>
2488 #include <stdio.h>
2489 int main()
2490 {
2491         FILE *fp = fopen("$cf_tempfile", "w");
2492 #ifdef NCURSES_VERSION
2493 # ifdef NCURSES_VERSION_PATCH
2494         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
2495 # else
2496         fprintf(fp, "%s\n", NCURSES_VERSION);
2497 # endif
2498 #else
2499 # ifdef __NCURSES_H
2500         fprintf(fp, "old\n");
2501 # else
2502         make an error
2503 # endif
2504 #endif
2505         exit(0);
2506 }
2507 EOF
2508 if { (eval echo configure:2509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2509 then
2510   
2511         cf_cv_ncurses_version=`cat $cf_tempfile`
2512 else
2513   echo "configure: failed program was:" >&5
2514   cat conftest.$ac_ext >&5
2515 fi
2516 rm -fr conftest*
2517 fi
2518
2519         rm -f $cf_tempfile
2520
2521 fi
2522
2523 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
2524 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
2525 #define NCURSES 1
2526 EOF
2527
2528
2529         
2530
2531 echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
2532 echo "configure:2533: checking if we have identified curses libraries" >&5
2533 cat > conftest.$ac_ext <<EOF
2534 #line 2535 "configure"
2535 #include "confdefs.h"
2536 #include <${cf_cv_ncurses_header-curses.h}>
2537 int main() {
2538 initscr(); tgoto("?", 0,0)
2539 ; return 0; }
2540 EOF
2541 if { (eval echo configure:2542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2542   rm -rf conftest*
2543   cf_result=yes
2544 else
2545   echo "configure: failed program was:" >&5
2546   cat conftest.$ac_ext >&5
2547   rm -rf conftest*
2548   cf_result=no
2549 fi
2550 rm -f conftest*
2551 echo "$ac_t""$cf_result" 1>&6
2552
2553 if test "$cf_result" = no ; then
2554 case $host_os in #(vi
2555 freebsd*) #(vi
2556         echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
2557 echo "configure:2558: checking for tgoto in -lmytinfo" >&5
2558 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
2559 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2560   echo $ac_n "(cached) $ac_c" 1>&6
2561 else
2562   ac_save_LIBS="$LIBS"
2563 LIBS="-lmytinfo  $LIBS"
2564 cat > conftest.$ac_ext <<EOF
2565 #line 2566 "configure"
2566 #include "confdefs.h"
2567 /* Override any gcc2 internal prototype to avoid an error.  */
2568 /* We use char because int might match the return type of a gcc2
2569     builtin and then its argument prototype would still apply.  */
2570 char tgoto();
2571
2572 int main() {
2573 tgoto()
2574 ; return 0; }
2575 EOF
2576 if { (eval echo configure:2577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2577   rm -rf conftest*
2578   eval "ac_cv_lib_$ac_lib_var=yes"
2579 else
2580   echo "configure: failed program was:" >&5
2581   cat conftest.$ac_ext >&5
2582   rm -rf conftest*
2583   eval "ac_cv_lib_$ac_lib_var=no"
2584 fi
2585 rm -f conftest*
2586 LIBS="$ac_save_LIBS"
2587
2588 fi
2589 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2590   echo "$ac_t""yes" 1>&6
2591   LIBS="-lmytinfo $LIBS"
2592 else
2593   echo "$ac_t""no" 1>&6
2594 fi
2595
2596         ;;
2597 hpux10.*) #(vi
2598         echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
2599 echo "configure:2600: checking for initscr in -lcur_colr" >&5
2600 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
2601 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2602   echo $ac_n "(cached) $ac_c" 1>&6
2603 else
2604   ac_save_LIBS="$LIBS"
2605 LIBS="-lcur_colr  $LIBS"
2606 cat > conftest.$ac_ext <<EOF
2607 #line 2608 "configure"
2608 #include "confdefs.h"
2609 /* Override any gcc2 internal prototype to avoid an error.  */
2610 /* We use char because int might match the return type of a gcc2
2611     builtin and then its argument prototype would still apply.  */
2612 char initscr();
2613
2614 int main() {
2615 initscr()
2616 ; return 0; }
2617 EOF
2618 if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2619   rm -rf conftest*
2620   eval "ac_cv_lib_$ac_lib_var=yes"
2621 else
2622   echo "configure: failed program was:" >&5
2623   cat conftest.$ac_ext >&5
2624   rm -rf conftest*
2625   eval "ac_cv_lib_$ac_lib_var=no"
2626 fi
2627 rm -f conftest*
2628 LIBS="$ac_save_LIBS"
2629
2630 fi
2631 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2632   echo "$ac_t""yes" 1>&6
2633   
2634                 LIBS="-lcur_colr $LIBS"
2635                 ac_cv_func_initscr=yes
2636                 
2637 else
2638   echo "$ac_t""no" 1>&6
2639
2640         echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
2641 echo "configure:2642: checking for initscr in -lHcurses" >&5
2642 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
2643 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2644   echo $ac_n "(cached) $ac_c" 1>&6
2645 else
2646   ac_save_LIBS="$LIBS"
2647 LIBS="-lHcurses  $LIBS"
2648 cat > conftest.$ac_ext <<EOF
2649 #line 2650 "configure"
2650 #include "confdefs.h"
2651 /* Override any gcc2 internal prototype to avoid an error.  */
2652 /* We use char because int might match the return type of a gcc2
2653     builtin and then its argument prototype would still apply.  */
2654 char initscr();
2655
2656 int main() {
2657 initscr()
2658 ; return 0; }
2659 EOF
2660 if { (eval echo configure:2661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2661   rm -rf conftest*
2662   eval "ac_cv_lib_$ac_lib_var=yes"
2663 else
2664   echo "configure: failed program was:" >&5
2665   cat conftest.$ac_ext >&5
2666   rm -rf conftest*
2667   eval "ac_cv_lib_$ac_lib_var=no"
2668 fi
2669 rm -f conftest*
2670 LIBS="$ac_save_LIBS"
2671
2672 fi
2673 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2674   echo "$ac_t""yes" 1>&6
2675   
2676                 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
2677                 LIBS="-lHcurses $LIBS"
2678                 CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
2679                 ac_cv_func_initscr=yes
2680                 
2681 else
2682   echo "$ac_t""no" 1>&6
2683 fi
2684
2685 fi
2686
2687         ;;
2688 linux*) # Suse Linux does not follow /usr/lib convention
2689         LIBS="$LIBS -L/lib"
2690         ;;
2691 sunos3*|sunos4*)
2692         test -d /usr/5lib && \
2693         LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
2694         ac_cv_func_initscr=yes
2695         ;;
2696 esac
2697
2698 if test ".$ac_cv_func_initscr" != .yes ; then
2699         cf_save_LIBS="$LIBS"
2700         cf_term_lib=""
2701         cf_curs_lib=""
2702
2703         if test ".${cf_cv_ncurses_version-no}" != .no
2704         then
2705                 cf_check_list="ncurses curses cursesX"
2706         else
2707                 cf_check_list="cursesX curses ncurses"
2708         fi
2709
2710         # Check for library containing tgoto.  Do this before curses library
2711         # because it may be needed to link the test-case for initscr.
2712         echo $ac_n "checking for tgoto""... $ac_c" 1>&6
2713 echo "configure:2714: checking for tgoto" >&5
2714 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
2715   echo $ac_n "(cached) $ac_c" 1>&6
2716 else
2717   cat > conftest.$ac_ext <<EOF
2718 #line 2719 "configure"
2719 #include "confdefs.h"
2720 /* System header to define __stub macros and hopefully few prototypes,
2721     which can conflict with char tgoto(); below.  */
2722 #include <assert.h>
2723 /* Override any gcc2 internal prototype to avoid an error.  */
2724 /* We use char because int might match the return type of a gcc2
2725     builtin and then its argument prototype would still apply.  */
2726 char tgoto();
2727
2728 int main() {
2729
2730 /* The GNU C library defines this for functions which it implements
2731     to always fail with ENOSYS.  Some functions are actually named
2732     something starting with __ and the normal name is an alias.  */
2733 #if defined (__stub_tgoto) || defined (__stub___tgoto)
2734 choke me
2735 #else
2736 tgoto();
2737 #endif
2738
2739 ; return 0; }
2740 EOF
2741 if { (eval echo configure:2742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2742   rm -rf conftest*
2743   eval "ac_cv_func_tgoto=yes"
2744 else
2745   echo "configure: failed program was:" >&5
2746   cat conftest.$ac_ext >&5
2747   rm -rf conftest*
2748   eval "ac_cv_func_tgoto=no"
2749 fi
2750 rm -f conftest*
2751 fi
2752
2753 if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
2754   echo "$ac_t""yes" 1>&6
2755   cf_term_lib=predefined
2756 else
2757   echo "$ac_t""no" 1>&6
2758
2759                 for cf_term_lib in $cf_check_list termcap termlib unknown
2760                 do
2761                         echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
2762 echo "configure:2763: checking for tgoto in -l$cf_term_lib" >&5
2763 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
2764 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2765   echo $ac_n "(cached) $ac_c" 1>&6
2766 else
2767   ac_save_LIBS="$LIBS"
2768 LIBS="-l$cf_term_lib  $LIBS"
2769 cat > conftest.$ac_ext <<EOF
2770 #line 2771 "configure"
2771 #include "confdefs.h"
2772 /* Override any gcc2 internal prototype to avoid an error.  */
2773 /* We use char because int might match the return type of a gcc2
2774     builtin and then its argument prototype would still apply.  */
2775 char tgoto();
2776
2777 int main() {
2778 tgoto()
2779 ; return 0; }
2780 EOF
2781 if { (eval echo configure:2782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2782   rm -rf conftest*
2783   eval "ac_cv_lib_$ac_lib_var=yes"
2784 else
2785   echo "configure: failed program was:" >&5
2786   cat conftest.$ac_ext >&5
2787   rm -rf conftest*
2788   eval "ac_cv_lib_$ac_lib_var=no"
2789 fi
2790 rm -f conftest*
2791 LIBS="$ac_save_LIBS"
2792
2793 fi
2794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2795   echo "$ac_t""yes" 1>&6
2796   break
2797 else
2798   echo "$ac_t""no" 1>&6
2799 fi
2800
2801                 done
2802         
2803 fi
2804
2805
2806         # Check for library containing initscr
2807         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
2808         for cf_curs_lib in $cf_check_list xcurses jcurses unknown
2809         do
2810                 echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
2811 echo "configure:2812: checking for initscr in -l$cf_curs_lib" >&5
2812 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
2813 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2814   echo $ac_n "(cached) $ac_c" 1>&6
2815 else
2816   ac_save_LIBS="$LIBS"
2817 LIBS="-l$cf_curs_lib  $LIBS"
2818 cat > conftest.$ac_ext <<EOF
2819 #line 2820 "configure"
2820 #include "confdefs.h"
2821 /* Override any gcc2 internal prototype to avoid an error.  */
2822 /* We use char because int might match the return type of a gcc2
2823     builtin and then its argument prototype would still apply.  */
2824 char initscr();
2825
2826 int main() {
2827 initscr()
2828 ; return 0; }
2829 EOF
2830 if { (eval echo configure:2831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2831   rm -rf conftest*
2832   eval "ac_cv_lib_$ac_lib_var=yes"
2833 else
2834   echo "configure: failed program was:" >&5
2835   cat conftest.$ac_ext >&5
2836   rm -rf conftest*
2837   eval "ac_cv_lib_$ac_lib_var=no"
2838 fi
2839 rm -f conftest*
2840 LIBS="$ac_save_LIBS"
2841
2842 fi
2843 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2844   echo "$ac_t""yes" 1>&6
2845   break
2846 else
2847   echo "$ac_t""no" 1>&6
2848 fi
2849
2850         done
2851         test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
2852
2853         LIBS="-l$cf_curs_lib $cf_save_LIBS"
2854         if test "$cf_term_lib" = unknown ; then
2855                 echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
2856 echo "configure:2857: checking if we can link with $cf_curs_lib library" >&5
2857                 cat > conftest.$ac_ext <<EOF
2858 #line 2859 "configure"
2859 #include "confdefs.h"
2860 #include <${cf_cv_ncurses_header-curses.h}>
2861 int main() {
2862 initscr()
2863 ; return 0; }
2864 EOF
2865 if { (eval echo configure:2866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2866   rm -rf conftest*
2867   cf_result=yes
2868 else
2869   echo "configure: failed program was:" >&5
2870   cat conftest.$ac_ext >&5
2871   rm -rf conftest*
2872   cf_result=no
2873 fi
2874 rm -f conftest*
2875                 echo "$ac_t""$cf_result" 1>&6
2876                 test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
2877         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
2878                 :
2879         elif test "$cf_term_lib" != predefined ; then
2880                 echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
2881 echo "configure:2882: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
2882                 cat > conftest.$ac_ext <<EOF
2883 #line 2884 "configure"
2884 #include "confdefs.h"
2885 #include <${cf_cv_ncurses_header-curses.h}>
2886 int main() {
2887 initscr(); tgoto((char *)0, 0, 0);
2888 ; return 0; }
2889 EOF
2890 if { (eval echo configure:2891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2891   rm -rf conftest*
2892   cf_result=no
2893 else
2894   echo "configure: failed program was:" >&5
2895   cat conftest.$ac_ext >&5
2896   rm -rf conftest*
2897   
2898                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
2899                         cat > conftest.$ac_ext <<EOF
2900 #line 2901 "configure"
2901 #include "confdefs.h"
2902 #include <${cf_cv_ncurses_header-curses.h}>
2903 int main() {
2904 initscr()
2905 ; return 0; }
2906 EOF
2907 if { (eval echo configure:2908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2908   rm -rf conftest*
2909   cf_result=yes
2910 else
2911   echo "configure: failed program was:" >&5
2912   cat conftest.$ac_ext >&5
2913   rm -rf conftest*
2914   cf_result=error
2915 fi
2916 rm -f conftest*
2917                         
2918 fi
2919 rm -f conftest*
2920                 echo "$ac_t""$cf_result" 1>&6
2921         fi
2922 fi
2923 fi
2924
2925
2926         ;;
2927 ncurses)
2928         
2929
2930 cf_ncuhdr_root=ncurses
2931
2932 test -n "$cf_cv_curses_dir" && \
2933 test "$cf_cv_curses_dir" != "no" && \
2934 CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
2935
2936 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
2937 echo "configure:2938: checking for $cf_ncuhdr_root header in include-path" >&5
2938 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
2939   echo $ac_n "(cached) $ac_c" 1>&6
2940 else
2941   
2942         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
2943         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
2944         for cf_header in $cf_header_list
2945         do
2946                 
2947         cat > conftest.$ac_ext <<EOF
2948 #line 2949 "configure"
2949 #include "confdefs.h"
2950
2951
2952 #include <$cf_header>
2953 int main() {
2954
2955 #ifdef NCURSES_VERSION
2956
2957 printf("%s\n", NCURSES_VERSION);
2958 #else
2959 #ifdef __NCURSES_H
2960 printf("old\n");
2961 #else
2962         make an error
2963 #endif
2964 #endif
2965         
2966         
2967 ; return 0; }
2968 EOF
2969 if { (eval echo configure:2970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2970   rm -rf conftest*
2971   cf_cv_ncurses_h=$cf_header
2972         
2973 else
2974   echo "configure: failed program was:" >&5
2975   cat conftest.$ac_ext >&5
2976   rm -rf conftest*
2977   cf_cv_ncurses_h=no
2978 fi
2979 rm -f conftest*
2980
2981                 test "$cf_cv_ncurses_h" != no && break
2982         done
2983
2984 fi
2985
2986 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
2987
2988
2989
2990 if test "$cf_cv_ncurses_h" != no ; then
2991         cf_cv_ncurses_header=$cf_cv_ncurses_h
2992 else
2993
2994 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
2995 echo "configure:2996: checking for $cf_ncuhdr_root include-path" >&5
2996 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
2997   echo $ac_n "(cached) $ac_c" 1>&6
2998 else
2999   
3000         test -n "$verbose" && echo
3001         cf_search=""
3002
3003 test -d "$HOME" && {
3004         test -n "$verbose" && echo "    ... testing include-directories under $HOME"
3005         test -d "$HOME/include" &&          cf_search="$cf_search $HOME/include"
3006         test -d "$HOME/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
3007         test -d "$HOME/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
3008 }
3009
3010 # For other stuff under the home directory, it should be sufficient to put
3011 # a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
3012 test -d "$HOME/$cf_ncuhdr_root" && {
3013         test -n "$verbose" && echo "    ... testing include-directories under $HOME/$cf_ncuhdr_root"
3014         test -d "$HOME/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
3015         test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3016 }
3017
3018 test "$prefix" != /usr/local && \
3019 test -d /usr/local && {
3020         test -n "$verbose" && echo "    ... testing include-directories under /usr/local"
3021         test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
3022         test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
3023         test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
3024         test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
3025         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3026 }
3027
3028 test "$prefix" != NONE && \
3029 test -d $prefix && {
3030         test -n "$verbose" && echo "    ... testing include-directories under $prefix"
3031         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3032         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
3033         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
3034         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
3035         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3036 }
3037
3038 test "$prefix" != /opt && \
3039 test -d /opt && {
3040         test -n "$verbose" && echo "    ... testing include-directories under /opt"
3041         test -d /opt/include &&             cf_search="$cf_search /opt/include"
3042         test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
3043         test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
3044         test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
3045         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3046 }
3047
3048 test "$prefix" != /usr && \
3049 test -d /usr && {
3050         test -n "$verbose" && echo "    ... testing include-directories under /usr"
3051         test -d /usr/include &&             cf_search="$cf_search /usr/include"
3052         test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
3053         test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
3054         test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
3055 }
3056
3057 test "$includedir" != NONE && \
3058 test "$includedir" != "/usr/include" && \
3059 test -d "$includedir" && {
3060         test -d $includedir &&    cf_search="$cf_search $includedir"
3061         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
3062 }
3063
3064 test "$oldincludedir" != NONE && \
3065 test "$oldincludedir" != "/usr/include" && \
3066 test -d "$oldincludedir" && {
3067         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3068         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
3069 }
3070
3071
3072         test -n "$verbose" && echo search path $cf_search
3073         cf_save2_CPPFLAGS="$CPPFLAGS"
3074         for cf_incdir in $cf_search
3075         do
3076                 
3077 for cf_add_incdir in $cf_incdir
3078 do
3079         while true
3080         do
3081                 case $cf_add_incdir in
3082                 /usr/include) # (vi
3083                         ;;
3084                 /usr/local/include) # (vi
3085                         if test "$GCC" = yes
3086                         then
3087                                 cf_save_CPPFLAGS="$CPPFLAGS"
3088                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3089                                 cat > conftest.$ac_ext <<EOF
3090 #line 3091 "configure"
3091 #include "confdefs.h"
3092 #include <stdio.h>
3093 int main() {
3094 printf("Hello")
3095 ; return 0; }
3096 EOF
3097 if { (eval echo configure:3098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3098   :
3099 else
3100   echo "configure: failed program was:" >&5
3101   cat conftest.$ac_ext >&5
3102   rm -rf conftest*
3103   CPPFLAGS="$cf_save_CPPFLAGS"
3104 fi
3105 rm -f conftest*
3106                         fi
3107                         ;;
3108                 *) # (vi
3109                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3110                         ;;
3111                 esac
3112                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3113                 test "$cf_top_incdir" = "$cf_add_incdir" && break
3114                 cf_add_incdir="$cf_top_incdir"
3115         done
3116 done
3117
3118                 for cf_header in \
3119                         ncurses.h \
3120                         curses.h
3121                 do
3122                         
3123         cat > conftest.$ac_ext <<EOF
3124 #line 3125 "configure"
3125 #include "confdefs.h"
3126
3127
3128 #include <$cf_header>
3129 int main() {
3130
3131 #ifdef NCURSES_VERSION
3132
3133 printf("%s\n", NCURSES_VERSION);
3134 #else
3135 #ifdef __NCURSES_H
3136 printf("old\n");
3137 #else
3138         make an error
3139 #endif
3140 #endif
3141         
3142         
3143 ; return 0; }
3144 EOF
3145 if { (eval echo configure:3146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3146   rm -rf conftest*
3147   cf_cv_ncurses_h2=$cf_header
3148         
3149 else
3150   echo "configure: failed program was:" >&5
3151   cat conftest.$ac_ext >&5
3152   rm -rf conftest*
3153   cf_cv_ncurses_h2=no
3154 fi
3155 rm -f conftest*
3156
3157                         if test "$cf_cv_ncurses_h2" != no ; then
3158                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
3159                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
3160                                 break
3161                         fi
3162                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
3163                 done
3164                 CPPFLAGS="$cf_save2_CPPFLAGS"
3165                 test "$cf_cv_ncurses_h2" != no && break
3166         done
3167         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
3168         
3169 fi
3170
3171 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
3172
3173         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
3174         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
3175         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
3176                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
3177         fi
3178         
3179 for cf_add_incdir in $cf_1st_incdir
3180 do
3181         while true
3182         do
3183                 case $cf_add_incdir in
3184                 /usr/include) # (vi
3185                         ;;
3186                 /usr/local/include) # (vi
3187                         if test "$GCC" = yes
3188                         then
3189                                 cf_save_CPPFLAGS="$CPPFLAGS"
3190                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3191                                 cat > conftest.$ac_ext <<EOF
3192 #line 3193 "configure"
3193 #include "confdefs.h"
3194 #include <stdio.h>
3195 int main() {
3196 printf("Hello")
3197 ; return 0; }
3198 EOF
3199 if { (eval echo configure:3200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3200   :
3201 else
3202   echo "configure: failed program was:" >&5
3203   cat conftest.$ac_ext >&5
3204   rm -rf conftest*
3205   CPPFLAGS="$cf_save_CPPFLAGS"
3206 fi
3207 rm -f conftest*
3208                         fi
3209                         ;;
3210                 *) # (vi
3211                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3212                         ;;
3213                 esac
3214                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3215                 test "$cf_top_incdir" = "$cf_add_incdir" && break
3216                 cf_add_incdir="$cf_top_incdir"
3217         done
3218 done
3219
3220
3221 fi
3222
3223 # Set definitions to allow ifdef'ing for ncurses.h
3224
3225 case $cf_cv_ncurses_header in # (vi
3226 *ncurses.h)
3227         cat >> confdefs.h <<\EOF
3228 #define HAVE_NCURSES_H 1
3229 EOF
3230
3231         ;;
3232 esac
3233
3234 case $cf_cv_ncurses_header in # (vi
3235 ncurses/curses.h|ncurses/ncurses.h)
3236         cat >> confdefs.h <<\EOF
3237 #define HAVE_NCURSES_NCURSES_H 1
3238 EOF
3239
3240         ;;
3241 ncursesw/curses.h|ncursesw/ncurses.h)
3242         cat >> confdefs.h <<\EOF
3243 #define HAVE_NCURSESW_NCURSES_H 1
3244 EOF
3245
3246         ;;
3247 esac
3248
3249
3250
3251 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
3252 echo "configure:3253: checking for terminfo header" >&5
3253 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
3254   echo $ac_n "(cached) $ac_c" 1>&6
3255 else
3256   
3257 case ${cf_cv_ncurses_header} in #(vi
3258 */ncurses.h|*/ncursesw.h) #(vi
3259         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
3260         ;;
3261 *)
3262         cf_term_header=term.h
3263         ;;
3264 esac
3265
3266 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
3267 do
3268 cat > conftest.$ac_ext <<EOF
3269 #line 3270 "configure"
3270 #include "confdefs.h"
3271 #include <stdio.h>
3272 #include <${cf_cv_ncurses_header-curses.h}>
3273 #include <$cf_test>
3274
3275 int main() {
3276 int x = auto_left_margin
3277 ; return 0; }
3278 EOF
3279 if { (eval echo configure:3280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3280   rm -rf conftest*
3281   
3282         cf_cv_term_header="$cf_test"
3283 else
3284   echo "configure: failed program was:" >&5
3285   cat conftest.$ac_ext >&5
3286   rm -rf conftest*
3287   
3288         cf_cv_term_header=unknown
3289         
3290 fi
3291 rm -f conftest*
3292         test "$cf_cv_term_header" != unknown && break
3293 done
3294
3295 fi
3296
3297 echo "$ac_t""$cf_cv_term_header" 1>&6
3298
3299 # Set definitions to allow ifdef'ing to accommodate subdirectories
3300
3301 case $cf_cv_term_header in # (vi
3302 *term.h)
3303         cat >> confdefs.h <<\EOF
3304 #define HAVE_TERM_H 1
3305 EOF
3306
3307         ;;
3308 esac
3309
3310 case $cf_cv_term_header in # (vi
3311 ncurses/term.h) #(vi
3312         cat >> confdefs.h <<\EOF
3313 #define HAVE_NCURSES_TERM_H 1
3314 EOF
3315
3316         ;;
3317 ncursesw/term.h)
3318         cat >> confdefs.h <<\EOF
3319 #define HAVE_NCURSESW_TERM_H 1
3320 EOF
3321
3322         ;;
3323 esac
3324
3325
3326 # some applications need this, but should check for NCURSES_VERSION
3327 cat >> confdefs.h <<\EOF
3328 #define NCURSES 1
3329 EOF
3330
3331
3332
3333 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
3334 echo "configure:3335: checking for ncurses version" >&5
3335 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
3336   echo $ac_n "(cached) $ac_c" 1>&6
3337 else
3338   
3339         cf_cv_ncurses_version=no
3340         cf_tempfile=out$$
3341         rm -f $cf_tempfile
3342         if test "$cross_compiling" = yes; then
3343   
3344
3345         # This will not work if the preprocessor splits the line after the
3346         # Autoconf token.  The 'unproto' program does that.
3347         cat > conftest.$ac_ext <<EOF
3348 #include <${cf_cv_ncurses_header-curses.h}>
3349 #undef Autoconf
3350 #ifdef NCURSES_VERSION
3351 Autoconf NCURSES_VERSION
3352 #else
3353 #ifdef __NCURSES_H
3354 Autoconf "old"
3355 #endif
3356 ;
3357 #endif
3358 EOF
3359         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
3360         { (eval echo configure:3361: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
3361         if test -f conftest.out ; then
3362                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
3363                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
3364                 rm -f conftest.out
3365         fi
3366
3367 else
3368   cat > conftest.$ac_ext <<EOF
3369 #line 3370 "configure"
3370 #include "confdefs.h"
3371
3372 #include <${cf_cv_ncurses_header-curses.h}>
3373 #include <stdio.h>
3374 int main()
3375 {
3376         FILE *fp = fopen("$cf_tempfile", "w");
3377 #ifdef NCURSES_VERSION
3378 # ifdef NCURSES_VERSION_PATCH
3379         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
3380 # else
3381         fprintf(fp, "%s\n", NCURSES_VERSION);
3382 # endif
3383 #else
3384 # ifdef __NCURSES_H
3385         fprintf(fp, "old\n");
3386 # else
3387         make an error
3388 # endif
3389 #endif
3390         exit(0);
3391 }
3392 EOF
3393 if { (eval echo configure:3394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3394 then
3395   
3396         cf_cv_ncurses_version=`cat $cf_tempfile`
3397 else
3398   echo "configure: failed program was:" >&5
3399   cat conftest.$ac_ext >&5
3400 fi
3401 rm -fr conftest*
3402 fi
3403
3404         rm -f $cf_tempfile
3405
3406 fi
3407
3408 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
3409 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
3410 #define NCURSES 1
3411 EOF
3412
3413
3414
3415         
3416
3417 cf_nculib_root=ncurses
3418         # This works, except for the special case where we find gpm, but
3419         # ncurses is in a nonstandard location via $LIBS, and we really want
3420         # to link gpm.
3421 cf_ncurses_LIBS=""
3422 cf_ncurses_SAVE="$LIBS"
3423 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
3424 echo "configure:3425: checking for Gpm_Open in -lgpm" >&5
3425 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
3426 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3427   echo $ac_n "(cached) $ac_c" 1>&6
3428 else
3429   ac_save_LIBS="$LIBS"
3430 LIBS="-lgpm  $LIBS"
3431 cat > conftest.$ac_ext <<EOF
3432 #line 3433 "configure"
3433 #include "confdefs.h"
3434 /* Override any gcc2 internal prototype to avoid an error.  */
3435 /* We use char because int might match the return type of a gcc2
3436     builtin and then its argument prototype would still apply.  */
3437 char Gpm_Open();
3438
3439 int main() {
3440 Gpm_Open()
3441 ; return 0; }
3442 EOF
3443 if { (eval echo configure:3444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3444   rm -rf conftest*
3445   eval "ac_cv_lib_$ac_lib_var=yes"
3446 else
3447   echo "configure: failed program was:" >&5
3448   cat conftest.$ac_ext >&5
3449   rm -rf conftest*
3450   eval "ac_cv_lib_$ac_lib_var=no"
3451 fi
3452 rm -f conftest*
3453 LIBS="$ac_save_LIBS"
3454
3455 fi
3456 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3457   echo "$ac_t""yes" 1>&6
3458   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
3459 echo "configure:3460: checking for initscr in -lgpm" >&5
3460 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
3461 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3462   echo $ac_n "(cached) $ac_c" 1>&6
3463 else
3464   ac_save_LIBS="$LIBS"
3465 LIBS="-lgpm  $LIBS"
3466 cat > conftest.$ac_ext <<EOF
3467 #line 3468 "configure"
3468 #include "confdefs.h"
3469 /* Override any gcc2 internal prototype to avoid an error.  */
3470 /* We use char because int might match the return type of a gcc2
3471     builtin and then its argument prototype would still apply.  */
3472 char initscr();
3473
3474 int main() {
3475 initscr()
3476 ; return 0; }
3477 EOF
3478 if { (eval echo configure:3479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3479   rm -rf conftest*
3480   eval "ac_cv_lib_$ac_lib_var=yes"
3481 else
3482   echo "configure: failed program was:" >&5
3483   cat conftest.$ac_ext >&5
3484   rm -rf conftest*
3485   eval "ac_cv_lib_$ac_lib_var=no"
3486 fi
3487 rm -f conftest*
3488 LIBS="$ac_save_LIBS"
3489
3490 fi
3491 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3492   echo "$ac_t""yes" 1>&6
3493   LIBS="$cf_ncurses_SAVE"
3494 else
3495   echo "$ac_t""no" 1>&6
3496 cf_ncurses_LIBS="-lgpm"
3497 fi
3498
3499 else
3500   echo "$ac_t""no" 1>&6
3501 fi
3502
3503
3504 case $host_os in #(vi
3505 freebsd*)
3506         # This is only necessary if you are linking against an obsolete
3507         # version of ncurses (but it should do no harm, since it's static).
3508         if test "$cf_nculib_root" = ncurses ; then
3509                 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
3510 echo "configure:3511: checking for tgoto in -lmytinfo" >&5
3511 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
3512 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3513   echo $ac_n "(cached) $ac_c" 1>&6
3514 else
3515   ac_save_LIBS="$LIBS"
3516 LIBS="-lmytinfo  $LIBS"
3517 cat > conftest.$ac_ext <<EOF
3518 #line 3519 "configure"
3519 #include "confdefs.h"
3520 /* Override any gcc2 internal prototype to avoid an error.  */
3521 /* We use char because int might match the return type of a gcc2
3522     builtin and then its argument prototype would still apply.  */
3523 char tgoto();
3524
3525 int main() {
3526 tgoto()
3527 ; return 0; }
3528 EOF
3529 if { (eval echo configure:3530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3530   rm -rf conftest*
3531   eval "ac_cv_lib_$ac_lib_var=yes"
3532 else
3533   echo "configure: failed program was:" >&5
3534   cat conftest.$ac_ext >&5
3535   rm -rf conftest*
3536   eval "ac_cv_lib_$ac_lib_var=no"
3537 fi
3538 rm -f conftest*
3539 LIBS="$ac_save_LIBS"
3540
3541 fi
3542 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3543   echo "$ac_t""yes" 1>&6
3544   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
3545 else
3546   echo "$ac_t""no" 1>&6
3547 fi
3548
3549         fi
3550         ;;
3551 esac
3552
3553 LIBS="$cf_ncurses_LIBS $LIBS"
3554
3555 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3556 then
3557         LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
3558 else
3559         
3560         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
3561         cf_libdir=""
3562         echo $ac_n "checking for initscr""... $ac_c" 1>&6
3563 echo "configure:3564: checking for initscr" >&5
3564 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
3565   echo $ac_n "(cached) $ac_c" 1>&6
3566 else
3567   cat > conftest.$ac_ext <<EOF
3568 #line 3569 "configure"
3569 #include "confdefs.h"
3570 /* System header to define __stub macros and hopefully few prototypes,
3571     which can conflict with char initscr(); below.  */
3572 #include <assert.h>
3573 /* Override any gcc2 internal prototype to avoid an error.  */
3574 /* We use char because int might match the return type of a gcc2
3575     builtin and then its argument prototype would still apply.  */
3576 char initscr();
3577
3578 int main() {
3579
3580 /* The GNU C library defines this for functions which it implements
3581     to always fail with ENOSYS.  Some functions are actually named
3582     something starting with __ and the normal name is an alias.  */
3583 #if defined (__stub_initscr) || defined (__stub___initscr)
3584 choke me
3585 #else
3586 initscr();
3587 #endif
3588
3589 ; return 0; }
3590 EOF
3591 if { (eval echo configure:3592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3592   rm -rf conftest*
3593   eval "ac_cv_func_initscr=yes"
3594 else
3595   echo "configure: failed program was:" >&5
3596   cat conftest.$ac_ext >&5
3597   rm -rf conftest*
3598   eval "ac_cv_func_initscr=no"
3599 fi
3600 rm -f conftest*
3601 fi
3602
3603 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
3604   echo "$ac_t""yes" 1>&6
3605   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
3606 else
3607   echo "$ac_t""no" 1>&6
3608
3609                 cf_save_LIBS="$LIBS"
3610                 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
3611 echo "configure:3612: checking for initscr in -l$cf_nculib_root" >&5
3612                 LIBS="-l$cf_nculib_root $LIBS"
3613                 cat > conftest.$ac_ext <<EOF
3614 #line 3615 "configure"
3615 #include "confdefs.h"
3616 #include <${cf_cv_ncurses_header-curses.h}>
3617 int main() {
3618 initscr()
3619 ; return 0; }
3620 EOF
3621 if { (eval echo configure:3622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3622   rm -rf conftest*
3623   echo "$ac_t""yes" 1>&6
3624                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
3625                         
3626 else
3627   echo "configure: failed program was:" >&5
3628   cat conftest.$ac_ext >&5
3629   rm -rf conftest*
3630   echo "$ac_t""no" 1>&6
3631                         cf_search=""
3632
3633 test -d "$HOME" && {
3634         test -n "$verbose" && echo "    ... testing lib-directories under $HOME"
3635         test -d "$HOME/lib" &&          cf_search="$cf_search $HOME/lib"
3636         test -d "$HOME/lib/$cf_nculib_root" &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
3637         test -d "$HOME/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
3638 }
3639
3640 # For other stuff under the home directory, it should be sufficient to put
3641 # a symbolic link for $HOME/$cf_nculib_root to the actual package location:
3642 test -d "$HOME/$cf_nculib_root" && {
3643         test -n "$verbose" && echo "    ... testing lib-directories under $HOME/$cf_nculib_root"
3644         test -d "$HOME/$cf_nculib_root/lib" &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
3645         test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
3646 }
3647
3648 test "$prefix" != /usr/local && \
3649 test -d /usr/local && {
3650         test -n "$verbose" && echo "    ... testing lib-directories under /usr/local"
3651         test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
3652         test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
3653         test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
3654         test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
3655         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
3656 }
3657
3658 test "$prefix" != NONE && \
3659 test -d $prefix && {
3660         test -n "$verbose" && echo "    ... testing lib-directories under $prefix"
3661         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
3662         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
3663         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
3664         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
3665         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
3666 }
3667
3668 test "$prefix" != /opt && \
3669 test -d /opt && {
3670         test -n "$verbose" && echo "    ... testing lib-directories under /opt"
3671         test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
3672         test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
3673         test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
3674         test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
3675         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
3676 }
3677
3678 test "$prefix" != /usr && \
3679 test -d /usr && {
3680         test -n "$verbose" && echo "    ... testing lib-directories under /usr"
3681         test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
3682         test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
3683         test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
3684         test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
3685 }
3686
3687                         for cf_libdir in $cf_search
3688                         do
3689                                 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
3690 echo "configure:3691: checking for -l$cf_nculib_root in $cf_libdir" >&5
3691                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
3692                                 cat > conftest.$ac_ext <<EOF
3693 #line 3694 "configure"
3694 #include "confdefs.h"
3695 #include <${cf_cv_ncurses_header-curses.h}>
3696 int main() {
3697 initscr()
3698 ; return 0; }
3699 EOF
3700 if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3701   rm -rf conftest*
3702   echo "$ac_t""yes" 1>&6
3703                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
3704                                          break
3705 else
3706   echo "configure: failed program was:" >&5
3707   cat conftest.$ac_ext >&5
3708   rm -rf conftest*
3709   echo "$ac_t""no" 1>&6
3710                                          LIBS="$cf_save_LIBS"
3711 fi
3712 rm -f conftest*
3713                         done
3714                         
3715 fi
3716 rm -f conftest*
3717                 
3718 fi
3719
3720 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
3721
3722 if test $cf_found_library = no ; then
3723         { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
3724 fi
3725
3726
3727 fi
3728
3729 if test -n "$cf_ncurses_LIBS" ; then
3730         echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
3731 echo "configure:3732: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
3732         cf_ncurses_SAVE="$LIBS"
3733         for p in $cf_ncurses_LIBS ; do
3734                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
3735                 if test "$q" != "$LIBS" ; then
3736                         LIBS="$q"
3737                 fi
3738         done
3739         cat > conftest.$ac_ext <<EOF
3740 #line 3741 "configure"
3741 #include "confdefs.h"
3742 #include <${cf_cv_ncurses_header-curses.h}>
3743 int main() {
3744 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3745 ; return 0; }
3746 EOF
3747 if { (eval echo configure:3748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3748   rm -rf conftest*
3749   echo "$ac_t""yes" 1>&6
3750 else
3751   echo "configure: failed program was:" >&5
3752   cat conftest.$ac_ext >&5
3753   rm -rf conftest*
3754   echo "$ac_t""no" 1>&6
3755                  LIBS="$cf_ncurses_SAVE"
3756 fi
3757 rm -f conftest*
3758 fi
3759
3760
3761 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3762
3763 cat >> confdefs.h <<EOF
3764 #define $cf_nculib_ROOT 1
3765 EOF
3766
3767
3768         ;;
3769 ncursesw)
3770         cf_cv_libtype=w
3771         
3772 echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6
3773 echo "configure:3774: checking for multibyte character support" >&5
3774 if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then
3775   echo $ac_n "(cached) $ac_c" 1>&6
3776 else
3777   
3778         cf_save_LIBS="$LIBS"
3779         cat > conftest.$ac_ext <<EOF
3780 #line 3781 "configure"
3781 #include "confdefs.h"
3782
3783 #include <stdlib.h>
3784 int main() {
3785 putwc(0,0);
3786 ; return 0; }
3787 EOF
3788 if { (eval echo configure:3789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3789   rm -rf conftest*
3790   cf_cv_utf8_lib=yes
3791 else
3792   echo "configure: failed program was:" >&5
3793   cat conftest.$ac_ext >&5
3794   rm -rf conftest*
3795   LIBS="-lutf8 $LIBS"
3796          cat > conftest.$ac_ext <<EOF
3797 #line 3798 "configure"
3798 #include "confdefs.h"
3799
3800 #include <libutf8.h>
3801 int main() {
3802 putwc(0,0);
3803 ; return 0; }
3804 EOF
3805 if { (eval echo configure:3806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3806   rm -rf conftest*
3807   cf_cv_utf8_lib=add-on
3808 else
3809   echo "configure: failed program was:" >&5
3810   cat conftest.$ac_ext >&5
3811   rm -rf conftest*
3812   cf_cv_utf8_lib=no
3813 fi
3814 rm -f conftest*
3815         LIBS="$cf_save_LIBS"
3816
3817 fi
3818 rm -f conftest*
3819 fi
3820
3821 echo "$ac_t""$cf_cv_utf8_lib" 1>&6
3822
3823 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
3824 # ncurses/ncursesw:
3825 if test "$cf_cv_utf8_lib" = "add-on" ; then
3826         cat >> confdefs.h <<\EOF
3827 #define HAVE_LIBUTF8_H 1
3828 EOF
3829
3830         LIBS="-lutf8 $LIBS"
3831 fi
3832
3833         
3834
3835 cf_ncuhdr_root=ncursesw
3836
3837 test -n "$cf_cv_curses_dir" && \
3838 test "$cf_cv_curses_dir" != "no" && \
3839 CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
3840
3841 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
3842 echo "configure:3843: checking for $cf_ncuhdr_root header in include-path" >&5
3843 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
3844   echo $ac_n "(cached) $ac_c" 1>&6
3845 else
3846   
3847         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
3848         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
3849         for cf_header in $cf_header_list
3850         do
3851                 
3852         cat > conftest.$ac_ext <<EOF
3853 #line 3854 "configure"
3854 #include "confdefs.h"
3855
3856
3857 #define _XOPEN_SOURCE_EXTENDED
3858 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
3859 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
3860
3861 #include <$cf_header>
3862 int main() {
3863
3864 #ifdef NCURSES_VERSION
3865
3866 #ifndef WACS_BSSB
3867         make an error
3868 #endif
3869
3870 printf("%s\n", NCURSES_VERSION);
3871 #else
3872 #ifdef __NCURSES_H
3873 printf("old\n");
3874 #else
3875         make an error
3876 #endif
3877 #endif
3878         
3879         
3880 ; return 0; }
3881 EOF
3882 if { (eval echo configure:3883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3883   rm -rf conftest*
3884   cf_cv_ncurses_h=$cf_header
3885         
3886 else
3887   echo "configure: failed program was:" >&5
3888   cat conftest.$ac_ext >&5
3889   rm -rf conftest*
3890   cf_cv_ncurses_h=no
3891 fi
3892 rm -f conftest*
3893
3894                 test "$cf_cv_ncurses_h" != no && break
3895         done
3896
3897 fi
3898
3899 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
3900
3901
3902
3903 if test "$cf_cv_ncurses_h" != no ; then
3904         cf_cv_ncurses_header=$cf_cv_ncurses_h
3905 else
3906
3907 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
3908 echo "configure:3909: checking for $cf_ncuhdr_root include-path" >&5
3909 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
3910   echo $ac_n "(cached) $ac_c" 1>&6
3911 else
3912   
3913         test -n "$verbose" && echo
3914         cf_search=""
3915
3916 test -d "$HOME" && {
3917         test -n "$verbose" && echo "    ... testing include-directories under $HOME"
3918         test -d "$HOME/include" &&          cf_search="$cf_search $HOME/include"
3919         test -d "$HOME/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
3920         test -d "$HOME/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
3921 }
3922
3923 # For other stuff under the home directory, it should be sufficient to put
3924 # a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
3925 test -d "$HOME/$cf_ncuhdr_root" && {
3926         test -n "$verbose" && echo "    ... testing include-directories under $HOME/$cf_ncuhdr_root"
3927         test -d "$HOME/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
3928         test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3929 }
3930
3931 test "$prefix" != /usr/local && \
3932 test -d /usr/local && {
3933         test -n "$verbose" && echo "    ... testing include-directories under /usr/local"
3934         test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
3935         test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
3936         test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
3937         test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
3938         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3939 }
3940
3941 test "$prefix" != NONE && \
3942 test -d $prefix && {
3943         test -n "$verbose" && echo "    ... testing include-directories under $prefix"
3944         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3945         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
3946         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
3947         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
3948         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3949 }
3950
3951 test "$prefix" != /opt && \
3952 test -d /opt && {
3953         test -n "$verbose" && echo "    ... testing include-directories under /opt"
3954         test -d /opt/include &&             cf_search="$cf_search /opt/include"
3955         test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
3956         test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
3957         test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
3958         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3959 }
3960
3961 test "$prefix" != /usr && \
3962 test -d /usr && {
3963         test -n "$verbose" && echo "    ... testing include-directories under /usr"
3964         test -d /usr/include &&             cf_search="$cf_search /usr/include"
3965         test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
3966         test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
3967         test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
3968 }
3969
3970 test "$includedir" != NONE && \
3971 test "$includedir" != "/usr/include" && \
3972 test -d "$includedir" && {
3973         test -d $includedir &&    cf_search="$cf_search $includedir"
3974         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
3975 }
3976
3977 test "$oldincludedir" != NONE && \
3978 test "$oldincludedir" != "/usr/include" && \
3979 test -d "$oldincludedir" && {
3980         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3981         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
3982 }
3983
3984
3985         test -n "$verbose" && echo search path $cf_search
3986         cf_save2_CPPFLAGS="$CPPFLAGS"
3987         for cf_incdir in $cf_search
3988         do
3989                 
3990 for cf_add_incdir in $cf_incdir
3991 do
3992         while true
3993         do
3994                 case $cf_add_incdir in
3995                 /usr/include) # (vi
3996                         ;;
3997                 /usr/local/include) # (vi
3998                         if test "$GCC" = yes
3999                         then
4000                                 cf_save_CPPFLAGS="$CPPFLAGS"
4001                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4002                                 cat > conftest.$ac_ext <<EOF
4003 #line 4004 "configure"
4004 #include "confdefs.h"
4005 #include <stdio.h>
4006 int main() {
4007 printf("Hello")
4008 ; return 0; }
4009 EOF
4010 if { (eval echo configure:4011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4011   :
4012 else
4013   echo "configure: failed program was:" >&5
4014   cat conftest.$ac_ext >&5
4015   rm -rf conftest*
4016   CPPFLAGS="$cf_save_CPPFLAGS"
4017 fi
4018 rm -f conftest*
4019                         fi
4020                         ;;
4021                 *) # (vi
4022                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4023                         ;;
4024                 esac
4025                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4026                 test "$cf_top_incdir" = "$cf_add_incdir" && break
4027                 cf_add_incdir="$cf_top_incdir"
4028         done
4029 done
4030
4031                 for cf_header in \
4032                         ncurses.h \
4033                         curses.h
4034                 do
4035                         
4036         cat > conftest.$ac_ext <<EOF
4037 #line 4038 "configure"
4038 #include "confdefs.h"
4039
4040
4041 #include <$cf_header>
4042 int main() {
4043
4044 #ifdef NCURSES_VERSION
4045
4046 printf("%s\n", NCURSES_VERSION);
4047 #else
4048 #ifdef __NCURSES_H
4049 printf("old\n");
4050 #else
4051         make an error
4052 #endif
4053 #endif
4054         
4055         
4056 ; return 0; }
4057 EOF
4058 if { (eval echo configure:4059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4059   rm -rf conftest*
4060   cf_cv_ncurses_h2=$cf_header
4061         
4062 else
4063   echo "configure: failed program was:" >&5
4064   cat conftest.$ac_ext >&5
4065   rm -rf conftest*
4066   cf_cv_ncurses_h2=no
4067 fi
4068 rm -f conftest*
4069
4070                         if test "$cf_cv_ncurses_h2" != no ; then
4071                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4072                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4073                                 break
4074                         fi
4075                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4076                 done
4077                 CPPFLAGS="$cf_save2_CPPFLAGS"
4078                 test "$cf_cv_ncurses_h2" != no && break
4079         done
4080         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
4081         
4082 fi
4083
4084 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
4085
4086         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4087         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4088         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4089                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4090         fi
4091         
4092 for cf_add_incdir in $cf_1st_incdir
4093 do
4094         while true
4095         do
4096                 case $cf_add_incdir in
4097                 /usr/include) # (vi
4098                         ;;
4099                 /usr/local/include) # (vi
4100                         if test "$GCC" = yes
4101                         then
4102                                 cf_save_CPPFLAGS="$CPPFLAGS"
4103                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4104                                 cat > conftest.$ac_ext <<EOF
4105 #line 4106 "configure"
4106 #include "confdefs.h"
4107 #include <stdio.h>
4108 int main() {
4109 printf("Hello")
4110 ; return 0; }
4111 EOF
4112 if { (eval echo configure:4113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4113   :
4114 else
4115   echo "configure: failed program was:" >&5
4116   cat conftest.$ac_ext >&5
4117   rm -rf conftest*
4118   CPPFLAGS="$cf_save_CPPFLAGS"
4119 fi
4120 rm -f conftest*
4121                         fi
4122                         ;;
4123                 *) # (vi
4124                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4125                         ;;
4126                 esac
4127                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4128                 test "$cf_top_incdir" = "$cf_add_incdir" && break
4129                 cf_add_incdir="$cf_top_incdir"
4130         done
4131 done
4132
4133
4134 fi
4135
4136 # Set definitions to allow ifdef'ing for ncurses.h
4137
4138 case $cf_cv_ncurses_header in # (vi
4139 *ncurses.h)
4140         cat >> confdefs.h <<\EOF
4141 #define HAVE_NCURSES_H 1
4142 EOF
4143
4144         ;;
4145 esac
4146
4147 case $cf_cv_ncurses_header in # (vi
4148 ncurses/curses.h|ncurses/ncurses.h)
4149         cat >> confdefs.h <<\EOF
4150 #define HAVE_NCURSES_NCURSES_H 1
4151 EOF
4152
4153         ;;
4154 ncursesw/curses.h|ncursesw/ncurses.h)
4155         cat >> confdefs.h <<\EOF
4156 #define HAVE_NCURSESW_NCURSES_H 1
4157 EOF
4158
4159         ;;
4160 esac
4161
4162
4163
4164 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
4165 echo "configure:4166: checking for terminfo header" >&5
4166 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
4167   echo $ac_n "(cached) $ac_c" 1>&6
4168 else
4169   
4170 case ${cf_cv_ncurses_header} in #(vi
4171 */ncurses.h|*/ncursesw.h) #(vi
4172         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4173         ;;
4174 *)
4175         cf_term_header=term.h
4176         ;;
4177 esac
4178
4179 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4180 do
4181 cat > conftest.$ac_ext <<EOF
4182 #line 4183 "configure"
4183 #include "confdefs.h"
4184 #include <stdio.h>
4185 #include <${cf_cv_ncurses_header-curses.h}>
4186 #include <$cf_test>
4187
4188 int main() {
4189 int x = auto_left_margin
4190 ; return 0; }
4191 EOF
4192 if { (eval echo configure:4193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4193   rm -rf conftest*
4194   
4195         cf_cv_term_header="$cf_test"
4196 else
4197   echo "configure: failed program was:" >&5
4198   cat conftest.$ac_ext >&5
4199   rm -rf conftest*
4200   
4201         cf_cv_term_header=unknown
4202         
4203 fi
4204 rm -f conftest*
4205         test "$cf_cv_term_header" != unknown && break
4206 done
4207
4208 fi
4209
4210 echo "$ac_t""$cf_cv_term_header" 1>&6
4211
4212 # Set definitions to allow ifdef'ing to accommodate subdirectories
4213
4214 case $cf_cv_term_header in # (vi
4215 *term.h)
4216         cat >> confdefs.h <<\EOF
4217 #define HAVE_TERM_H 1
4218 EOF
4219
4220         ;;
4221 esac
4222
4223 case $cf_cv_term_header in # (vi
4224 ncurses/term.h) #(vi
4225         cat >> confdefs.h <<\EOF
4226 #define HAVE_NCURSES_TERM_H 1
4227 EOF
4228
4229         ;;
4230 ncursesw/term.h)
4231         cat >> confdefs.h <<\EOF
4232 #define HAVE_NCURSESW_TERM_H 1
4233 EOF
4234
4235         ;;
4236 esac
4237
4238
4239 # some applications need this, but should check for NCURSES_VERSION
4240 cat >> confdefs.h <<\EOF
4241 #define NCURSES 1
4242 EOF
4243
4244
4245
4246 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
4247 echo "configure:4248: checking for ncurses version" >&5
4248 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
4249   echo $ac_n "(cached) $ac_c" 1>&6
4250 else
4251   
4252         cf_cv_ncurses_version=no
4253         cf_tempfile=out$$
4254         rm -f $cf_tempfile
4255         if test "$cross_compiling" = yes; then
4256   
4257
4258         # This will not work if the preprocessor splits the line after the
4259         # Autoconf token.  The 'unproto' program does that.
4260         cat > conftest.$ac_ext <<EOF
4261 #include <${cf_cv_ncurses_header-curses.h}>
4262 #undef Autoconf
4263 #ifdef NCURSES_VERSION
4264 Autoconf NCURSES_VERSION
4265 #else
4266 #ifdef __NCURSES_H
4267 Autoconf "old"
4268 #endif
4269 ;
4270 #endif
4271 EOF
4272         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4273         { (eval echo configure:4274: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
4274         if test -f conftest.out ; then
4275                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4276                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4277                 rm -f conftest.out
4278         fi
4279
4280 else
4281   cat > conftest.$ac_ext <<EOF
4282 #line 4283 "configure"
4283 #include "confdefs.h"
4284
4285 #include <${cf_cv_ncurses_header-curses.h}>
4286 #include <stdio.h>
4287 int main()
4288 {
4289         FILE *fp = fopen("$cf_tempfile", "w");
4290 #ifdef NCURSES_VERSION
4291 # ifdef NCURSES_VERSION_PATCH
4292         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4293 # else
4294         fprintf(fp, "%s\n", NCURSES_VERSION);
4295 # endif
4296 #else
4297 # ifdef __NCURSES_H
4298         fprintf(fp, "old\n");
4299 # else
4300         make an error
4301 # endif
4302 #endif
4303         exit(0);
4304 }
4305 EOF
4306 if { (eval echo configure:4307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4307 then
4308   
4309         cf_cv_ncurses_version=`cat $cf_tempfile`
4310 else
4311   echo "configure: failed program was:" >&5
4312   cat conftest.$ac_ext >&5
4313 fi
4314 rm -fr conftest*
4315 fi
4316
4317         rm -f $cf_tempfile
4318
4319 fi
4320
4321 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
4322 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
4323 #define NCURSES 1
4324 EOF
4325
4326
4327
4328         
4329
4330 cf_nculib_root=ncursesw
4331         # This works, except for the special case where we find gpm, but
4332         # ncurses is in a nonstandard location via $LIBS, and we really want
4333         # to link gpm.
4334 cf_ncurses_LIBS=""
4335 cf_ncurses_SAVE="$LIBS"
4336 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
4337 echo "configure:4338: checking for Gpm_Open in -lgpm" >&5
4338 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
4339 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4340   echo $ac_n "(cached) $ac_c" 1>&6
4341 else
4342   ac_save_LIBS="$LIBS"
4343 LIBS="-lgpm  $LIBS"
4344 cat > conftest.$ac_ext <<EOF
4345 #line 4346 "configure"
4346 #include "confdefs.h"
4347 /* Override any gcc2 internal prototype to avoid an error.  */
4348 /* We use char because int might match the return type of a gcc2
4349     builtin and then its argument prototype would still apply.  */
4350 char Gpm_Open();
4351
4352 int main() {
4353 Gpm_Open()
4354 ; return 0; }
4355 EOF
4356 if { (eval echo configure:4357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4357   rm -rf conftest*
4358   eval "ac_cv_lib_$ac_lib_var=yes"
4359 else
4360   echo "configure: failed program was:" >&5
4361   cat conftest.$ac_ext >&5
4362   rm -rf conftest*
4363   eval "ac_cv_lib_$ac_lib_var=no"
4364 fi
4365 rm -f conftest*
4366 LIBS="$ac_save_LIBS"
4367
4368 fi
4369 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4370   echo "$ac_t""yes" 1>&6
4371   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
4372 echo "configure:4373: checking for initscr in -lgpm" >&5
4373 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
4374 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4375   echo $ac_n "(cached) $ac_c" 1>&6
4376 else
4377   ac_save_LIBS="$LIBS"
4378 LIBS="-lgpm  $LIBS"
4379 cat > conftest.$ac_ext <<EOF
4380 #line 4381 "configure"
4381 #include "confdefs.h"
4382 /* Override any gcc2 internal prototype to avoid an error.  */
4383 /* We use char because int might match the return type of a gcc2
4384     builtin and then its argument prototype would still apply.  */
4385 char initscr();
4386
4387 int main() {
4388 initscr()
4389 ; return 0; }
4390 EOF
4391 if { (eval echo configure:4392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4392   rm -rf conftest*
4393   eval "ac_cv_lib_$ac_lib_var=yes"
4394 else
4395   echo "configure: failed program was:" >&5
4396   cat conftest.$ac_ext >&5
4397   rm -rf conftest*
4398   eval "ac_cv_lib_$ac_lib_var=no"
4399 fi
4400 rm -f conftest*
4401 LIBS="$ac_save_LIBS"
4402
4403 fi
4404 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4405   echo "$ac_t""yes" 1>&6
4406   LIBS="$cf_ncurses_SAVE"
4407 else
4408   echo "$ac_t""no" 1>&6
4409 cf_ncurses_LIBS="-lgpm"
4410 fi
4411
4412 else
4413   echo "$ac_t""no" 1>&6
4414 fi
4415
4416
4417 case $host_os in #(vi
4418 freebsd*)
4419         # This is only necessary if you are linking against an obsolete
4420         # version of ncurses (but it should do no harm, since it's static).
4421         if test "$cf_nculib_root" = ncurses ; then
4422                 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
4423 echo "configure:4424: checking for tgoto in -lmytinfo" >&5
4424 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
4425 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4426   echo $ac_n "(cached) $ac_c" 1>&6
4427 else
4428   ac_save_LIBS="$LIBS"
4429 LIBS="-lmytinfo  $LIBS"
4430 cat > conftest.$ac_ext <<EOF
4431 #line 4432 "configure"
4432 #include "confdefs.h"
4433 /* Override any gcc2 internal prototype to avoid an error.  */
4434 /* We use char because int might match the return type of a gcc2
4435     builtin and then its argument prototype would still apply.  */
4436 char tgoto();
4437
4438 int main() {
4439 tgoto()
4440 ; return 0; }
4441 EOF
4442 if { (eval echo configure:4443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4443   rm -rf conftest*
4444   eval "ac_cv_lib_$ac_lib_var=yes"
4445 else
4446   echo "configure: failed program was:" >&5
4447   cat conftest.$ac_ext >&5
4448   rm -rf conftest*
4449   eval "ac_cv_lib_$ac_lib_var=no"
4450 fi
4451 rm -f conftest*
4452 LIBS="$ac_save_LIBS"
4453
4454 fi
4455 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4456   echo "$ac_t""yes" 1>&6
4457   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4458 else
4459   echo "$ac_t""no" 1>&6
4460 fi
4461
4462         fi
4463         ;;
4464 esac
4465
4466 LIBS="$cf_ncurses_LIBS $LIBS"
4467
4468 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4469 then
4470         LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
4471 else
4472         
4473         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4474         cf_libdir=""
4475         echo $ac_n "checking for initscr""... $ac_c" 1>&6
4476 echo "configure:4477: checking for initscr" >&5
4477 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
4478   echo $ac_n "(cached) $ac_c" 1>&6
4479 else
4480   cat > conftest.$ac_ext <<EOF
4481 #line 4482 "configure"
4482 #include "confdefs.h"
4483 /* System header to define __stub macros and hopefully few prototypes,
4484     which can conflict with char initscr(); below.  */
4485 #include <assert.h>
4486 /* Override any gcc2 internal prototype to avoid an error.  */
4487 /* We use char because int might match the return type of a gcc2
4488     builtin and then its argument prototype would still apply.  */
4489 char initscr();
4490
4491 int main() {
4492
4493 /* The GNU C library defines this for functions which it implements
4494     to always fail with ENOSYS.  Some functions are actually named
4495     something starting with __ and the normal name is an alias.  */
4496 #if defined (__stub_initscr) || defined (__stub___initscr)
4497 choke me
4498 #else
4499 initscr();
4500 #endif
4501
4502 ; return 0; }
4503 EOF
4504 if { (eval echo configure:4505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4505   rm -rf conftest*
4506   eval "ac_cv_func_initscr=yes"
4507 else
4508   echo "configure: failed program was:" >&5
4509   cat conftest.$ac_ext >&5
4510   rm -rf conftest*
4511   eval "ac_cv_func_initscr=no"
4512 fi
4513 rm -f conftest*
4514 fi
4515
4516 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
4517   echo "$ac_t""yes" 1>&6
4518   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4519 else
4520   echo "$ac_t""no" 1>&6
4521
4522                 cf_save_LIBS="$LIBS"
4523                 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
4524 echo "configure:4525: checking for initscr in -l$cf_nculib_root" >&5
4525                 LIBS="-l$cf_nculib_root $LIBS"
4526                 cat > conftest.$ac_ext <<EOF
4527 #line 4528 "configure"
4528 #include "confdefs.h"
4529 #include <${cf_cv_ncurses_header-curses.h}>
4530 int main() {
4531 initscr()
4532 ; return 0; }
4533 EOF
4534 if { (eval echo configure:4535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4535   rm -rf conftest*
4536   echo "$ac_t""yes" 1>&6
4537                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4538                         
4539 else
4540   echo "configure: failed program was:" >&5
4541   cat conftest.$ac_ext >&5
4542   rm -rf conftest*
4543   echo "$ac_t""no" 1>&6
4544                         cf_search=""
4545
4546 test -d "$HOME" && {
4547         test -n "$verbose" && echo "    ... testing lib-directories under $HOME"
4548         test -d "$HOME/lib" &&          cf_search="$cf_search $HOME/lib"
4549         test -d "$HOME/lib/$cf_nculib_root" &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
4550         test -d "$HOME/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
4551 }
4552
4553 # For other stuff under the home directory, it should be sufficient to put
4554 # a symbolic link for $HOME/$cf_nculib_root to the actual package location:
4555 test -d "$HOME/$cf_nculib_root" && {
4556         test -n "$verbose" && echo "    ... testing lib-directories under $HOME/$cf_nculib_root"
4557         test -d "$HOME/$cf_nculib_root/lib" &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
4558         test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
4559 }
4560
4561 test "$prefix" != /usr/local && \
4562 test -d /usr/local && {
4563         test -n "$verbose" && echo "    ... testing lib-directories under /usr/local"
4564         test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
4565         test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
4566         test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
4567         test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
4568         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
4569 }
4570
4571 test "$prefix" != NONE && \
4572 test -d $prefix && {
4573         test -n "$verbose" && echo "    ... testing lib-directories under $prefix"
4574         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
4575         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
4576         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
4577         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
4578         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
4579 }
4580
4581 test "$prefix" != /opt && \
4582 test -d /opt && {
4583         test -n "$verbose" && echo "    ... testing lib-directories under /opt"
4584         test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
4585         test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
4586         test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
4587         test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
4588         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
4589 }
4590
4591 test "$prefix" != /usr && \
4592 test -d /usr && {
4593         test -n "$verbose" && echo "    ... testing lib-directories under /usr"
4594         test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
4595         test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
4596         test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
4597         test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
4598 }
4599
4600                         for cf_libdir in $cf_search
4601                         do
4602                                 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
4603 echo "configure:4604: checking for -l$cf_nculib_root in $cf_libdir" >&5
4604                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
4605                                 cat > conftest.$ac_ext <<EOF
4606 #line 4607 "configure"
4607 #include "confdefs.h"
4608 #include <${cf_cv_ncurses_header-curses.h}>
4609 int main() {
4610 initscr()
4611 ; return 0; }
4612 EOF
4613 if { (eval echo configure:4614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4614   rm -rf conftest*
4615   echo "$ac_t""yes" 1>&6
4616                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4617                                          break
4618 else
4619   echo "configure: failed program was:" >&5
4620   cat conftest.$ac_ext >&5
4621   rm -rf conftest*
4622   echo "$ac_t""no" 1>&6
4623                                          LIBS="$cf_save_LIBS"
4624 fi
4625 rm -f conftest*
4626                         done
4627                         
4628 fi
4629 rm -f conftest*
4630                 
4631 fi
4632
4633 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
4634
4635 if test $cf_found_library = no ; then
4636         { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
4637 fi
4638
4639
4640 fi
4641
4642 if test -n "$cf_ncurses_LIBS" ; then
4643         echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
4644 echo "configure:4645: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
4645         cf_ncurses_SAVE="$LIBS"
4646         for p in $cf_ncurses_LIBS ; do
4647                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
4648                 if test "$q" != "$LIBS" ; then
4649                         LIBS="$q"
4650                 fi
4651         done
4652         cat > conftest.$ac_ext <<EOF
4653 #line 4654 "configure"
4654 #include "confdefs.h"
4655 #include <${cf_cv_ncurses_header-curses.h}>
4656 int main() {
4657 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4658 ; return 0; }
4659 EOF
4660 if { (eval echo configure:4661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4661   rm -rf conftest*
4662   echo "$ac_t""yes" 1>&6
4663 else
4664   echo "configure: failed program was:" >&5
4665   cat conftest.$ac_ext >&5
4666   rm -rf conftest*
4667   echo "$ac_t""no" 1>&6
4668                  LIBS="$cf_ncurses_SAVE"
4669 fi
4670 rm -f conftest*
4671 fi
4672
4673
4674 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4675
4676 cat >> confdefs.h <<EOF
4677 #define $cf_nculib_ROOT 1
4678 EOF
4679
4680
4681         ;;
4682 pdcurses) #(vi
4683         if test "$no_x" = yes; then
4684   # Not all programs may use this symbol, but it does not hurt to define it.
4685   cat >> confdefs.h <<\EOF
4686 #define X_DISPLAY_MISSING 1
4687 EOF
4688
4689   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4690 else
4691   if test -n "$x_includes"; then
4692     X_CFLAGS="$X_CFLAGS -I$x_includes"
4693   fi
4694
4695   # It would also be nice to do this for all -L options, not just this one.
4696   if test -n "$x_libraries"; then
4697     X_LIBS="$X_LIBS -L$x_libraries"
4698     # For Solaris; some versions of Sun CC require a space after -R and
4699     # others require no space.  Words are not sufficient . . . .
4700     case "`(uname -sr) 2>/dev/null`" in
4701     "SunOS 5"*)
4702       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
4703 echo "configure:4704: checking whether -R must be followed by a space" >&5
4704       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
4705       cat > conftest.$ac_ext <<EOF
4706 #line 4707 "configure"
4707 #include "confdefs.h"
4708
4709 int main() {
4710
4711 ; return 0; }
4712 EOF
4713 if { (eval echo configure:4714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4714   rm -rf conftest*
4715   ac_R_nospace=yes
4716 else
4717   echo "configure: failed program was:" >&5
4718   cat conftest.$ac_ext >&5
4719   rm -rf conftest*
4720   ac_R_nospace=no
4721 fi
4722 rm -f conftest*
4723       if test $ac_R_nospace = yes; then
4724         echo "$ac_t""no" 1>&6
4725         X_LIBS="$X_LIBS -R$x_libraries"
4726       else
4727         LIBS="$ac_xsave_LIBS -R $x_libraries"
4728         cat > conftest.$ac_ext <<EOF
4729 #line 4730 "configure"
4730 #include "confdefs.h"
4731
4732 int main() {
4733
4734 ; return 0; }
4735 EOF
4736 if { (eval echo configure:4737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4737   rm -rf conftest*
4738   ac_R_space=yes
4739 else
4740   echo "configure: failed program was:" >&5
4741   cat conftest.$ac_ext >&5
4742   rm -rf conftest*
4743   ac_R_space=no
4744 fi
4745 rm -f conftest*
4746         if test $ac_R_space = yes; then
4747           echo "$ac_t""yes" 1>&6
4748           X_LIBS="$X_LIBS -R $x_libraries"
4749         else
4750           echo "$ac_t""neither works" 1>&6
4751         fi
4752       fi
4753       LIBS="$ac_xsave_LIBS"
4754     esac
4755   fi
4756
4757   # Check for system-dependent libraries X programs must link with.
4758   # Do this before checking for the system-independent R6 libraries
4759   # (-lICE), since we may need -lsocket or whatever for X linking.
4760
4761   if test "$ISC" = yes; then
4762     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4763   else
4764     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
4765     # libraries were built with DECnet support.  And karl@cs.umb.edu says
4766     # the Alpha needs dnet_stub (dnet does not exist).
4767     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
4768 echo "configure:4769: checking for dnet_ntoa in -ldnet" >&5
4769 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4770 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4771   echo $ac_n "(cached) $ac_c" 1>&6
4772 else
4773   ac_save_LIBS="$LIBS"
4774 LIBS="-ldnet  $LIBS"
4775 cat > conftest.$ac_ext <<EOF
4776 #line 4777 "configure"
4777 #include "confdefs.h"
4778 /* Override any gcc2 internal prototype to avoid an error.  */
4779 /* We use char because int might match the return type of a gcc2
4780     builtin and then its argument prototype would still apply.  */
4781 char dnet_ntoa();
4782
4783 int main() {
4784 dnet_ntoa()
4785 ; return 0; }
4786 EOF
4787 if { (eval echo configure:4788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4788   rm -rf conftest*
4789   eval "ac_cv_lib_$ac_lib_var=yes"
4790 else
4791   echo "configure: failed program was:" >&5
4792   cat conftest.$ac_ext >&5
4793   rm -rf conftest*
4794   eval "ac_cv_lib_$ac_lib_var=no"
4795 fi
4796 rm -f conftest*
4797 LIBS="$ac_save_LIBS"
4798
4799 fi
4800 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4801   echo "$ac_t""yes" 1>&6
4802   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4803 else
4804   echo "$ac_t""no" 1>&6
4805 fi
4806
4807     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4808       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
4809 echo "configure:4810: checking for dnet_ntoa in -ldnet_stub" >&5
4810 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
4811 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4812   echo $ac_n "(cached) $ac_c" 1>&6
4813 else
4814   ac_save_LIBS="$LIBS"
4815 LIBS="-ldnet_stub  $LIBS"
4816 cat > conftest.$ac_ext <<EOF
4817 #line 4818 "configure"
4818 #include "confdefs.h"
4819 /* Override any gcc2 internal prototype to avoid an error.  */
4820 /* We use char because int might match the return type of a gcc2
4821     builtin and then its argument prototype would still apply.  */
4822 char dnet_ntoa();
4823
4824 int main() {
4825 dnet_ntoa()
4826 ; return 0; }
4827 EOF
4828 if { (eval echo configure:4829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4829   rm -rf conftest*
4830   eval "ac_cv_lib_$ac_lib_var=yes"
4831 else
4832   echo "configure: failed program was:" >&5
4833   cat conftest.$ac_ext >&5
4834   rm -rf conftest*
4835   eval "ac_cv_lib_$ac_lib_var=no"
4836 fi
4837 rm -f conftest*
4838 LIBS="$ac_save_LIBS"
4839
4840 fi
4841 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4842   echo "$ac_t""yes" 1>&6
4843   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4844 else
4845   echo "$ac_t""no" 1>&6
4846 fi
4847
4848     fi
4849
4850     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4851     # to get the SysV transport functions.
4852     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
4853     # needs -lnsl.
4854     # The nsl library prevents programs from opening the X display
4855     # on Irix 5.2, according to dickey@clark.net.
4856     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
4857 echo "configure:4858: checking for gethostbyname" >&5
4858 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
4859   echo $ac_n "(cached) $ac_c" 1>&6
4860 else
4861   cat > conftest.$ac_ext <<EOF
4862 #line 4863 "configure"
4863 #include "confdefs.h"
4864 /* System header to define __stub macros and hopefully few prototypes,
4865     which can conflict with char gethostbyname(); below.  */
4866 #include <assert.h>
4867 /* Override any gcc2 internal prototype to avoid an error.  */
4868 /* We use char because int might match the return type of a gcc2
4869     builtin and then its argument prototype would still apply.  */
4870 char gethostbyname();
4871
4872 int main() {
4873
4874 /* The GNU C library defines this for functions which it implements
4875     to always fail with ENOSYS.  Some functions are actually named
4876     something starting with __ and the normal name is an alias.  */
4877 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
4878 choke me
4879 #else
4880 gethostbyname();
4881 #endif
4882
4883 ; return 0; }
4884 EOF
4885 if { (eval echo configure:4886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4886   rm -rf conftest*
4887   eval "ac_cv_func_gethostbyname=yes"
4888 else
4889   echo "configure: failed program was:" >&5
4890   cat conftest.$ac_ext >&5
4891   rm -rf conftest*
4892   eval "ac_cv_func_gethostbyname=no"
4893 fi
4894 rm -f conftest*
4895 fi
4896
4897 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
4898   echo "$ac_t""yes" 1>&6
4899   :
4900 else
4901   echo "$ac_t""no" 1>&6
4902 fi
4903
4904     if test $ac_cv_func_gethostbyname = no; then
4905       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
4906 echo "configure:4907: checking for gethostbyname in -lnsl" >&5
4907 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
4908 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4909   echo $ac_n "(cached) $ac_c" 1>&6
4910 else
4911   ac_save_LIBS="$LIBS"
4912 LIBS="-lnsl  $LIBS"
4913 cat > conftest.$ac_ext <<EOF
4914 #line 4915 "configure"
4915 #include "confdefs.h"
4916 /* Override any gcc2 internal prototype to avoid an error.  */
4917 /* We use char because int might match the return type of a gcc2
4918     builtin and then its argument prototype would still apply.  */
4919 char gethostbyname();
4920
4921 int main() {
4922 gethostbyname()
4923 ; return 0; }
4924 EOF
4925 if { (eval echo configure:4926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4926   rm -rf conftest*
4927   eval "ac_cv_lib_$ac_lib_var=yes"
4928 else
4929   echo "configure: failed program was:" >&5
4930   cat conftest.$ac_ext >&5
4931   rm -rf conftest*
4932   eval "ac_cv_lib_$ac_lib_var=no"
4933 fi
4934 rm -f conftest*
4935 LIBS="$ac_save_LIBS"
4936
4937 fi
4938 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4939   echo "$ac_t""yes" 1>&6
4940   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4941 else
4942   echo "$ac_t""no" 1>&6
4943 fi
4944
4945     fi
4946
4947     # lieder@skyler.mavd.honeywell.com says without -lsocket,
4948     # socket/setsockopt and other routines are undefined under SCO ODT
4949     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
4950     # on later versions), says simon@lia.di.epfl.ch: it contains
4951     # gethostby* variants that don't use the nameserver (or something).
4952     # -lsocket must be given before -lnsl if both are needed.
4953     # We assume that if connect needs -lnsl, so does gethostbyname.
4954     echo $ac_n "checking for connect""... $ac_c" 1>&6
4955 echo "configure:4956: checking for connect" >&5
4956 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
4957   echo $ac_n "(cached) $ac_c" 1>&6
4958 else
4959   cat > conftest.$ac_ext <<EOF
4960 #line 4961 "configure"
4961 #include "confdefs.h"
4962 /* System header to define __stub macros and hopefully few prototypes,
4963     which can conflict with char connect(); below.  */
4964 #include <assert.h>
4965 /* Override any gcc2 internal prototype to avoid an error.  */
4966 /* We use char because int might match the return type of a gcc2
4967     builtin and then its argument prototype would still apply.  */
4968 char connect();
4969
4970 int main() {
4971
4972 /* The GNU C library defines this for functions which it implements
4973     to always fail with ENOSYS.  Some functions are actually named
4974     something starting with __ and the normal name is an alias.  */
4975 #if defined (__stub_connect) || defined (__stub___connect)
4976 choke me
4977 #else
4978 connect();
4979 #endif
4980
4981 ; return 0; }
4982 EOF
4983 if { (eval echo configure:4984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4984   rm -rf conftest*
4985   eval "ac_cv_func_connect=yes"
4986 else
4987   echo "configure: failed program was:" >&5
4988   cat conftest.$ac_ext >&5
4989   rm -rf conftest*
4990   eval "ac_cv_func_connect=no"
4991 fi
4992 rm -f conftest*
4993 fi
4994
4995 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
4996   echo "$ac_t""yes" 1>&6
4997   :
4998 else
4999   echo "$ac_t""no" 1>&6
5000 fi
5001
5002     if test $ac_cv_func_connect = no; then
5003       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
5004 echo "configure:5005: checking for connect in -lsocket" >&5
5005 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
5006 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5007   echo $ac_n "(cached) $ac_c" 1>&6
5008 else
5009   ac_save_LIBS="$LIBS"
5010 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
5011 cat > conftest.$ac_ext <<EOF
5012 #line 5013 "configure"
5013 #include "confdefs.h"
5014 /* Override any gcc2 internal prototype to avoid an error.  */
5015 /* We use char because int might match the return type of a gcc2
5016     builtin and then its argument prototype would still apply.  */
5017 char connect();
5018
5019 int main() {
5020 connect()
5021 ; return 0; }
5022 EOF
5023 if { (eval echo configure:5024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5024   rm -rf conftest*
5025   eval "ac_cv_lib_$ac_lib_var=yes"
5026 else
5027   echo "configure: failed program was:" >&5
5028   cat conftest.$ac_ext >&5
5029   rm -rf conftest*
5030   eval "ac_cv_lib_$ac_lib_var=no"
5031 fi
5032 rm -f conftest*
5033 LIBS="$ac_save_LIBS"
5034
5035 fi
5036 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5037   echo "$ac_t""yes" 1>&6
5038   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
5039 else
5040   echo "$ac_t""no" 1>&6
5041 fi
5042
5043     fi
5044
5045     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
5046     echo $ac_n "checking for remove""... $ac_c" 1>&6
5047 echo "configure:5048: checking for remove" >&5
5048 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
5049   echo $ac_n "(cached) $ac_c" 1>&6
5050 else
5051   cat > conftest.$ac_ext <<EOF
5052 #line 5053 "configure"
5053 #include "confdefs.h"
5054 /* System header to define __stub macros and hopefully few prototypes,
5055     which can conflict with char remove(); below.  */
5056 #include <assert.h>
5057 /* Override any gcc2 internal prototype to avoid an error.  */
5058 /* We use char because int might match the return type of a gcc2
5059     builtin and then its argument prototype would still apply.  */
5060 char remove();
5061
5062 int main() {
5063
5064 /* The GNU C library defines this for functions which it implements
5065     to always fail with ENOSYS.  Some functions are actually named
5066     something starting with __ and the normal name is an alias.  */
5067 #if defined (__stub_remove) || defined (__stub___remove)
5068 choke me
5069 #else
5070 remove();
5071 #endif
5072
5073 ; return 0; }
5074 EOF
5075 if { (eval echo configure:5076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5076   rm -rf conftest*
5077   eval "ac_cv_func_remove=yes"
5078 else
5079   echo "configure: failed program was:" >&5
5080   cat conftest.$ac_ext >&5
5081   rm -rf conftest*
5082   eval "ac_cv_func_remove=no"
5083 fi
5084 rm -f conftest*
5085 fi
5086
5087 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
5088   echo "$ac_t""yes" 1>&6
5089   :
5090 else
5091   echo "$ac_t""no" 1>&6
5092 fi
5093
5094     if test $ac_cv_func_remove = no; then
5095       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
5096 echo "configure:5097: checking for remove in -lposix" >&5
5097 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
5098 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5099   echo $ac_n "(cached) $ac_c" 1>&6
5100 else
5101   ac_save_LIBS="$LIBS"
5102 LIBS="-lposix  $LIBS"
5103 cat > conftest.$ac_ext <<EOF
5104 #line 5105 "configure"
5105 #include "confdefs.h"
5106 /* Override any gcc2 internal prototype to avoid an error.  */
5107 /* We use char because int might match the return type of a gcc2
5108     builtin and then its argument prototype would still apply.  */
5109 char remove();
5110
5111 int main() {
5112 remove()
5113 ; return 0; }
5114 EOF
5115 if { (eval echo configure:5116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5116   rm -rf conftest*
5117   eval "ac_cv_lib_$ac_lib_var=yes"
5118 else
5119   echo "configure: failed program was:" >&5
5120   cat conftest.$ac_ext >&5
5121   rm -rf conftest*
5122   eval "ac_cv_lib_$ac_lib_var=no"
5123 fi
5124 rm -f conftest*
5125 LIBS="$ac_save_LIBS"
5126
5127 fi
5128 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5129   echo "$ac_t""yes" 1>&6
5130   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5131 else
5132   echo "$ac_t""no" 1>&6
5133 fi
5134
5135     fi
5136
5137     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5138     echo $ac_n "checking for shmat""... $ac_c" 1>&6
5139 echo "configure:5140: checking for shmat" >&5
5140 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
5141   echo $ac_n "(cached) $ac_c" 1>&6
5142 else
5143   cat > conftest.$ac_ext <<EOF
5144 #line 5145 "configure"
5145 #include "confdefs.h"
5146 /* System header to define __stub macros and hopefully few prototypes,
5147     which can conflict with char shmat(); below.  */
5148 #include <assert.h>
5149 /* Override any gcc2 internal prototype to avoid an error.  */
5150 /* We use char because int might match the return type of a gcc2
5151     builtin and then its argument prototype would still apply.  */
5152 char shmat();
5153
5154 int main() {
5155
5156 /* The GNU C library defines this for functions which it implements
5157     to always fail with ENOSYS.  Some functions are actually named
5158     something starting with __ and the normal name is an alias.  */
5159 #if defined (__stub_shmat) || defined (__stub___shmat)
5160 choke me
5161 #else
5162 shmat();
5163 #endif
5164
5165 ; return 0; }
5166 EOF
5167 if { (eval echo configure:5168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5168   rm -rf conftest*
5169   eval "ac_cv_func_shmat=yes"
5170 else
5171   echo "configure: failed program was:" >&5
5172   cat conftest.$ac_ext >&5
5173   rm -rf conftest*
5174   eval "ac_cv_func_shmat=no"
5175 fi
5176 rm -f conftest*
5177 fi
5178
5179 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
5180   echo "$ac_t""yes" 1>&6
5181   :
5182 else
5183   echo "$ac_t""no" 1>&6
5184 fi
5185
5186     if test $ac_cv_func_shmat = no; then
5187       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
5188 echo "configure:5189: checking for shmat in -lipc" >&5
5189 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
5190 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5191   echo $ac_n "(cached) $ac_c" 1>&6
5192 else
5193   ac_save_LIBS="$LIBS"
5194 LIBS="-lipc  $LIBS"
5195 cat > conftest.$ac_ext <<EOF
5196 #line 5197 "configure"
5197 #include "confdefs.h"
5198 /* Override any gcc2 internal prototype to avoid an error.  */
5199 /* We use char because int might match the return type of a gcc2
5200     builtin and then its argument prototype would still apply.  */
5201 char shmat();
5202
5203 int main() {
5204 shmat()
5205 ; return 0; }
5206 EOF
5207 if { (eval echo configure:5208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5208   rm -rf conftest*
5209   eval "ac_cv_lib_$ac_lib_var=yes"
5210 else
5211   echo "configure: failed program was:" >&5
5212   cat conftest.$ac_ext >&5
5213   rm -rf conftest*
5214   eval "ac_cv_lib_$ac_lib_var=no"
5215 fi
5216 rm -f conftest*
5217 LIBS="$ac_save_LIBS"
5218
5219 fi
5220 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5221   echo "$ac_t""yes" 1>&6
5222   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5223 else
5224   echo "$ac_t""no" 1>&6
5225 fi
5226
5227     fi
5228   fi
5229
5230   # Check for libraries that X11R6 Xt/Xaw programs need.
5231   ac_save_LDFLAGS="$LDFLAGS"
5232   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5233   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5234   # check for ICE first), but we must link in the order -lSM -lICE or
5235   # we get undefined symbols.  So assume we have SM if we have ICE.
5236   # These have to be linked with before -lX11, unlike the other
5237   # libraries we check for below, so use a different variable.
5238   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
5239   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
5240 echo "configure:5241: checking for IceConnectionNumber in -lICE" >&5
5241 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
5242 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5243   echo $ac_n "(cached) $ac_c" 1>&6
5244 else
5245   ac_save_LIBS="$LIBS"
5246 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
5247 cat > conftest.$ac_ext <<EOF
5248 #line 5249 "configure"
5249 #include "confdefs.h"
5250 /* Override any gcc2 internal prototype to avoid an error.  */
5251 /* We use char because int might match the return type of a gcc2
5252     builtin and then its argument prototype would still apply.  */
5253 char IceConnectionNumber();
5254
5255 int main() {
5256 IceConnectionNumber()
5257 ; return 0; }
5258 EOF
5259 if { (eval echo configure:5260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5260   rm -rf conftest*
5261   eval "ac_cv_lib_$ac_lib_var=yes"
5262 else
5263   echo "configure: failed program was:" >&5
5264   cat conftest.$ac_ext >&5
5265   rm -rf conftest*
5266   eval "ac_cv_lib_$ac_lib_var=no"
5267 fi
5268 rm -f conftest*
5269 LIBS="$ac_save_LIBS"
5270
5271 fi
5272 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5273   echo "$ac_t""yes" 1>&6
5274   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5275 else
5276   echo "$ac_t""no" 1>&6
5277 fi
5278
5279   LDFLAGS="$ac_save_LDFLAGS"
5280
5281 fi
5282
5283
5284
5285
5286
5287 # SYSTEM_NAME=`echo "$cf_cv_system_name"|tr ' ' -`
5288
5289 cf_have_X_LIBS=no
5290
5291 LDFLAGS="$X_LIBS $LDFLAGS"
5292
5293 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
5294
5295 cf_check_cflags="$CFLAGS"
5296 cf_check_cppflags="$CPPFLAGS"
5297
5298 cf_fix_cppflags=no
5299 cf_new_cflags=
5300 cf_new_cppflags=
5301 cf_new_extra_cppflags=
5302
5303 for cf_add_cflags in $X_CFLAGS
5304 do
5305 case $cf_fix_cppflags in
5306 no)
5307         case $cf_add_cflags in #(vi
5308         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
5309                 case $cf_add_cflags in
5310                 -D*)
5311                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5312
5313                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5314                         && test -z "${cf_tst_cflags}" \
5315                         && cf_fix_cppflags=yes
5316
5317                         if test $cf_fix_cppflags = yes ; then
5318                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5319                                 continue
5320                         elif test "${cf_tst_cflags}" = "\"'" ; then
5321                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5322                                 continue
5323                         fi
5324                         ;;
5325                 esac
5326                 case "$CPPFLAGS" in
5327                 *$cf_add_cflags) #(vi
5328                         ;;
5329                 *) #(vi
5330                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
5331                         ;;
5332                 esac
5333                 ;;
5334         *)
5335                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
5336                 ;;
5337         esac
5338         ;;
5339 yes)
5340         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5341
5342         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5343
5344         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5345         && test -z "${cf_tst_cflags}" \
5346         && cf_fix_cppflags=no
5347         ;;
5348 esac
5349 done
5350
5351 if test -n "$cf_new_cflags" ; then
5352         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5353
5354         CFLAGS="$CFLAGS $cf_new_cflags"
5355 fi
5356
5357 if test -n "$cf_new_cppflags" ; then
5358         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5359
5360         CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
5361 fi
5362
5363 if test -n "$cf_new_extra_cppflags" ; then
5364         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5365
5366         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
5367 fi
5368
5369
5370
5371
5372 if test "$cf_check_cflags" != "$CFLAGS" ; then
5373 cat > conftest.$ac_ext <<EOF
5374 #line 5375 "configure"
5375 #include "confdefs.h"
5376 #include <stdio.h>
5377 int main() {
5378 printf("Hello world");
5379 ; return 0; }
5380 EOF
5381 if { (eval echo configure:5382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5382   :
5383 else
5384   echo "configure: failed program was:" >&5
5385   cat conftest.$ac_ext >&5
5386   rm -rf conftest*
5387   test -n "$verbose" && echo "  test-compile failed.  Undoing change to \$CFLAGS" 1>&6
5388
5389          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
5390                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
5391
5392          fi
5393          CFLAGS="$cf_check_flags"
5394 fi
5395 rm -f conftest*
5396 fi
5397
5398
5399 echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6
5400 echo "configure:5401: checking for XOpenDisplay" >&5
5401 if eval "test \"`echo '$''{'ac_cv_func_XOpenDisplay'+set}'`\" = set"; then
5402   echo $ac_n "(cached) $ac_c" 1>&6
5403 else
5404   cat > conftest.$ac_ext <<EOF
5405 #line 5406 "configure"
5406 #include "confdefs.h"
5407 /* System header to define __stub macros and hopefully few prototypes,
5408     which can conflict with char XOpenDisplay(); below.  */
5409 #include <assert.h>
5410 /* Override any gcc2 internal prototype to avoid an error.  */
5411 /* We use char because int might match the return type of a gcc2
5412     builtin and then its argument prototype would still apply.  */
5413 char XOpenDisplay();
5414
5415 int main() {
5416
5417 /* The GNU C library defines this for functions which it implements
5418     to always fail with ENOSYS.  Some functions are actually named
5419     something starting with __ and the normal name is an alias.  */
5420 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
5421 choke me
5422 #else
5423 XOpenDisplay();
5424 #endif
5425
5426 ; return 0; }
5427 EOF
5428 if { (eval echo configure:5429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5429   rm -rf conftest*
5430   eval "ac_cv_func_XOpenDisplay=yes"
5431 else
5432   echo "configure: failed program was:" >&5
5433   cat conftest.$ac_ext >&5
5434   rm -rf conftest*
5435   eval "ac_cv_func_XOpenDisplay=no"
5436 fi
5437 rm -f conftest*
5438 fi
5439
5440 if eval "test \"`echo '$ac_cv_func_'XOpenDisplay`\" = yes"; then
5441   echo "$ac_t""yes" 1>&6
5442   :
5443 else
5444   echo "$ac_t""no" 1>&6
5445
5446 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5447 echo "configure:5448: checking for XOpenDisplay in -lX11" >&5
5448 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5449 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5450   echo $ac_n "(cached) $ac_c" 1>&6
5451 else
5452   ac_save_LIBS="$LIBS"
5453 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
5454 cat > conftest.$ac_ext <<EOF
5455 #line 5456 "configure"
5456 #include "confdefs.h"
5457 /* Override any gcc2 internal prototype to avoid an error.  */
5458 /* We use char because int might match the return type of a gcc2
5459     builtin and then its argument prototype would still apply.  */
5460 char XOpenDisplay();
5461
5462 int main() {
5463 XOpenDisplay()
5464 ; return 0; }
5465 EOF
5466 if { (eval echo configure:5467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5467   rm -rf conftest*
5468   eval "ac_cv_lib_$ac_lib_var=yes"
5469 else
5470   echo "configure: failed program was:" >&5
5471   cat conftest.$ac_ext >&5
5472   rm -rf conftest*
5473   eval "ac_cv_lib_$ac_lib_var=no"
5474 fi
5475 rm -f conftest*
5476 LIBS="$ac_save_LIBS"
5477
5478 fi
5479 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5480   echo "$ac_t""yes" 1>&6
5481   LIBS="-lX11 $LIBS"
5482 else
5483   echo "$ac_t""no" 1>&6
5484 fi
5485
5486 fi
5487
5488
5489 echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6
5490 echo "configure:5491: checking for XtAppInitialize" >&5
5491 if eval "test \"`echo '$''{'ac_cv_func_XtAppInitialize'+set}'`\" = set"; then
5492   echo $ac_n "(cached) $ac_c" 1>&6
5493 else
5494   cat > conftest.$ac_ext <<EOF
5495 #line 5496 "configure"
5496 #include "confdefs.h"
5497 /* System header to define __stub macros and hopefully few prototypes,
5498     which can conflict with char XtAppInitialize(); below.  */
5499 #include <assert.h>
5500 /* Override any gcc2 internal prototype to avoid an error.  */
5501 /* We use char because int might match the return type of a gcc2
5502     builtin and then its argument prototype would still apply.  */
5503 char XtAppInitialize();
5504
5505 int main() {
5506
5507 /* The GNU C library defines this for functions which it implements
5508     to always fail with ENOSYS.  Some functions are actually named
5509     something starting with __ and the normal name is an alias.  */
5510 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
5511 choke me
5512 #else
5513 XtAppInitialize();
5514 #endif
5515
5516 ; return 0; }
5517 EOF
5518 if { (eval echo configure:5519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5519   rm -rf conftest*
5520   eval "ac_cv_func_XtAppInitialize=yes"
5521 else
5522   echo "configure: failed program was:" >&5
5523   cat conftest.$ac_ext >&5
5524   rm -rf conftest*
5525   eval "ac_cv_func_XtAppInitialize=no"
5526 fi
5527 rm -f conftest*
5528 fi
5529
5530 if eval "test \"`echo '$ac_cv_func_'XtAppInitialize`\" = yes"; then
5531   echo "$ac_t""yes" 1>&6
5532   :
5533 else
5534   echo "$ac_t""no" 1>&6
5535
5536 echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
5537 echo "configure:5538: checking for XtAppInitialize in -lXt" >&5
5538 ac_lib_var=`echo Xt'_'XtAppInitialize | sed 'y%./+-%__p_%'`
5539 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5540   echo $ac_n "(cached) $ac_c" 1>&6
5541 else
5542   ac_save_LIBS="$LIBS"
5543 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
5544 cat > conftest.$ac_ext <<EOF
5545 #line 5546 "configure"
5546 #include "confdefs.h"
5547 /* Override any gcc2 internal prototype to avoid an error.  */
5548 /* We use char because int might match the return type of a gcc2
5549     builtin and then its argument prototype would still apply.  */
5550 char XtAppInitialize();
5551
5552 int main() {
5553 XtAppInitialize()
5554 ; return 0; }
5555 EOF
5556 if { (eval echo configure:5557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5557   rm -rf conftest*
5558   eval "ac_cv_lib_$ac_lib_var=yes"
5559 else
5560   echo "configure: failed program was:" >&5
5561   cat conftest.$ac_ext >&5
5562   rm -rf conftest*
5563   eval "ac_cv_lib_$ac_lib_var=no"
5564 fi
5565 rm -f conftest*
5566 LIBS="$ac_save_LIBS"
5567
5568 fi
5569 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5570   echo "$ac_t""yes" 1>&6
5571   cat >> confdefs.h <<\EOF
5572 #define HAVE_LIBXT 1
5573 EOF
5574
5575          cf_have_X_LIBS=Xt
5576          LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
5577 else
5578   echo "$ac_t""no" 1>&6
5579 fi
5580
5581 fi
5582
5583
5584 if test $cf_have_X_LIBS = no ; then
5585         echo "configure: warning: Unable to successfully link X Toolkit library (-lXt) with
5586 test program.  You will have to check and add the proper libraries by hand
5587 to makefile." 1>&2
5588 fi
5589
5590
5591 cf_x_athena=${cf_x_athena-Xaw}
5592
5593 echo $ac_n "checking if you want to link with Xaw 3d library""... $ac_c" 1>&6
5594 echo "configure:5595: checking if you want to link with Xaw 3d library" >&5
5595 withval=
5596
5597 # Check whether --with-Xaw3d or --without-Xaw3d was given.
5598 if test "${with_Xaw3d+set}" = set; then
5599   withval="$with_Xaw3d"
5600   :
5601 fi
5602
5603 if test "$withval" = yes ; then
5604         cf_x_athena=Xaw3d
5605         echo "$ac_t""yes" 1>&6
5606 else
5607         echo "$ac_t""no" 1>&6
5608 fi
5609
5610 echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6
5611 echo "configure:5612: checking if you want to link with neXT Athena library" >&5
5612 withval=
5613
5614 # Check whether --with-neXtaw or --without-neXtaw was given.
5615 if test "${with_neXtaw+set}" = set; then
5616   withval="$with_neXtaw"
5617   :
5618 fi
5619
5620 if test "$withval" = yes ; then
5621         cf_x_athena=neXtaw
5622         echo "$ac_t""yes" 1>&6
5623 else
5624         echo "$ac_t""no" 1>&6
5625 fi
5626
5627 echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6
5628 echo "configure:5629: checking if you want to link with Athena-Plus library" >&5
5629 withval=
5630
5631 # Check whether --with-XawPlus or --without-XawPlus was given.
5632 if test "${with_XawPlus+set}" = set; then
5633   withval="$with_XawPlus"
5634   :
5635 fi
5636
5637 if test "$withval" = yes ; then
5638         cf_x_athena=XawPlus
5639         echo "$ac_t""yes" 1>&6
5640 else
5641         echo "$ac_t""no" 1>&6
5642 fi
5643
5644 echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
5645 echo "configure:5646: checking for XextCreateExtension in -lXext" >&5
5646 ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'`
5647 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5648   echo $ac_n "(cached) $ac_c" 1>&6
5649 else
5650   ac_save_LIBS="$LIBS"
5651 LIBS="-lXext  $LIBS"
5652 cat > conftest.$ac_ext <<EOF
5653 #line 5654 "configure"
5654 #include "confdefs.h"
5655 /* Override any gcc2 internal prototype to avoid an error.  */
5656 /* We use char because int might match the return type of a gcc2
5657     builtin and then its argument prototype would still apply.  */
5658 char XextCreateExtension();
5659
5660 int main() {
5661 XextCreateExtension()
5662 ; return 0; }
5663 EOF
5664 if { (eval echo configure:5665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5665   rm -rf conftest*
5666   eval "ac_cv_lib_$ac_lib_var=yes"
5667 else
5668   echo "configure: failed program was:" >&5
5669   cat conftest.$ac_ext >&5
5670   rm -rf conftest*
5671   eval "ac_cv_lib_$ac_lib_var=no"
5672 fi
5673 rm -f conftest*
5674 LIBS="$ac_save_LIBS"
5675
5676 fi
5677 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5678   echo "$ac_t""yes" 1>&6
5679   LIBS="-lXext $LIBS"
5680 else
5681   echo "$ac_t""no" 1>&6
5682 fi
5683
5684
5685 cf_x_athena_lib=""
5686
5687
5688 cf_x_athena_root=$cf_x_athena
5689 cf_x_athena_include=""
5690
5691 for cf_path in default \
5692         /usr/contrib/X11R6 \
5693         /usr/contrib/X11R5 \
5694         /usr/lib/X11R5 \
5695         /usr/local
5696 do
5697         if test -z "$cf_x_athena_include" ; then
5698                 cf_save="$CPPFLAGS"
5699                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
5700                 if test $cf_path != default ; then
5701                         CPPFLAGS="-I$cf_path/include $cf_save"
5702                         echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
5703 echo "configure:5704: checking for $cf_test in $cf_path" >&5
5704                 else
5705                         echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
5706 echo "configure:5707: checking for $cf_test" >&5
5707                 fi
5708                 cat > conftest.$ac_ext <<EOF
5709 #line 5710 "configure"
5710 #include "confdefs.h"
5711
5712 #include <X11/Intrinsic.h>
5713 #include <$cf_test>
5714 int main() {
5715
5716 ; return 0; }
5717 EOF
5718 if { (eval echo configure:5719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5719   rm -rf conftest*
5720   cf_result=yes
5721 else
5722   echo "configure: failed program was:" >&5
5723   cat conftest.$ac_ext >&5
5724   rm -rf conftest*
5725   cf_result=no
5726 fi
5727 rm -f conftest*
5728                 echo "$ac_t""$cf_result" 1>&6
5729                 if test "$cf_result" = yes ; then
5730                         cf_x_athena_include=$cf_path
5731                         break
5732                 else
5733                         CPPFLAGS="$cf_save"
5734                 fi
5735         fi
5736 done
5737
5738 if test -z "$cf_x_athena_include" ; then
5739         echo "configure: warning: Unable to successfully find Athena header files with test program" 1>&2
5740 elif test "$cf_x_athena_include" != default ; then
5741         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_include"
5742 fi
5743
5744
5745 cf_x_athena_root=$cf_x_athena
5746 cf_x_athena_lib=""
5747
5748 for cf_path in default \
5749         /usr/contrib/X11R6 \
5750         /usr/contrib/X11R5 \
5751         /usr/lib/X11R5 \
5752         /usr/local
5753 do
5754         for cf_lib in \
5755                 "-l$cf_x_athena_root -lXmu" \
5756                 "-l$cf_x_athena_root -lXpm -lXmu" \
5757                 "-l${cf_x_athena_root}_s -lXmu_s"
5758         do
5759                 if test -z "$cf_x_athena_lib" ; then
5760                         cf_save="$LIBS"
5761                         cf_test=XawSimpleMenuAddGlobalActions
5762                         if test $cf_path != default ; then
5763                                 LIBS="-L$cf_path/lib $cf_lib $LIBS"
5764                                 echo $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6
5765 echo "configure:5766: checking for $cf_lib in $cf_path" >&5
5766                         else
5767                                 LIBS="$cf_lib $LIBS"
5768                                 echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6
5769 echo "configure:5770: checking for $cf_test in $cf_lib" >&5
5770                         fi
5771                         cat > conftest.$ac_ext <<EOF
5772 #line 5773 "configure"
5773 #include "confdefs.h"
5774
5775 int main() {
5776 $cf_test()
5777 ; return 0; }
5778 EOF
5779 if { (eval echo configure:5780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5780   rm -rf conftest*
5781   cf_result=yes
5782 else
5783   echo "configure: failed program was:" >&5
5784   cat conftest.$ac_ext >&5
5785   rm -rf conftest*
5786   cf_result=no
5787 fi
5788 rm -f conftest*
5789                         echo "$ac_t""$cf_result" 1>&6
5790                         if test "$cf_result" = yes ; then
5791                                 cf_x_athena_lib="$cf_lib"
5792                                 break
5793                         fi
5794                         LIBS="$cf_save"
5795                 fi
5796         done
5797 done
5798
5799 if test -z "$cf_x_athena_lib" ; then
5800         { echo "configure: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" 1>&2; exit 1; }
5801 fi
5802
5803
5804 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5805
5806 cat >> confdefs.h <<EOF
5807 #define $cf_x_athena_LIBS 1
5808 EOF
5809
5810
5811
5812
5813
5814
5815 for ac_prog in xcurses-config
5816 do
5817 # Extract the first word of "$ac_prog", so it can be a program name with args.
5818 set dummy $ac_prog; ac_word=$2
5819 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5820 echo "configure:5821: checking for $ac_word" >&5
5821 if eval "test \"`echo '$''{'ac_cv_path_XCURSES_CONFIG'+set}'`\" = set"; then
5822   echo $ac_n "(cached) $ac_c" 1>&6
5823 else
5824   case "$XCURSES_CONFIG" in
5825   /*)
5826   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
5827   ;;
5828   ?:/*)                  
5829   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a dos path.
5830   ;;
5831   *)
5832   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5833   ac_dummy="$PATH"
5834   for ac_dir in $ac_dummy; do 
5835     test -z "$ac_dir" && ac_dir=.
5836     if test -f $ac_dir/$ac_word; then
5837       ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
5838       break
5839     fi
5840   done
5841   IFS="$ac_save_ifs"
5842   ;;
5843 esac
5844 fi
5845 XCURSES_CONFIG="$ac_cv_path_XCURSES_CONFIG"
5846 if test -n "$XCURSES_CONFIG"; then
5847   echo "$ac_t""$XCURSES_CONFIG" 1>&6
5848 else
5849   echo "$ac_t""no" 1>&6
5850 fi
5851
5852 test -n "$XCURSES_CONFIG" && break
5853 done
5854 test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
5855
5856
5857 if test "$XCURSES_CONFIG" != none ; then
5858
5859 CPPFLAGS="`$XCURSES_CONFIG --cflags` $CPPFLAGS"
5860 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
5861
5862 cf_cv_lib_XCurses=yes
5863
5864 else
5865
5866 LDFLAGS="$LDFLAGS $X_LIBS"
5867
5868 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
5869
5870 cf_check_cflags="$CFLAGS"
5871 cf_check_cppflags="$CPPFLAGS"
5872
5873 cf_fix_cppflags=no
5874 cf_new_cflags=
5875 cf_new_cppflags=
5876 cf_new_extra_cppflags=
5877
5878 for cf_add_cflags in $X_CFLAGS
5879 do
5880 case $cf_fix_cppflags in
5881 no)
5882         case $cf_add_cflags in #(vi
5883         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
5884                 case $cf_add_cflags in
5885                 -D*)
5886                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5887
5888                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5889                         && test -z "${cf_tst_cflags}" \
5890                         && cf_fix_cppflags=yes
5891
5892                         if test $cf_fix_cppflags = yes ; then
5893                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5894                                 continue
5895                         elif test "${cf_tst_cflags}" = "\"'" ; then
5896                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5897                                 continue
5898                         fi
5899                         ;;
5900                 esac
5901                 case "$CPPFLAGS" in
5902                 *$cf_add_cflags) #(vi
5903                         ;;
5904                 *) #(vi
5905                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
5906                         ;;
5907                 esac
5908                 ;;
5909         *)
5910                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
5911                 ;;
5912         esac
5913         ;;
5914 yes)
5915         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5916
5917         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5918
5919         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5920         && test -z "${cf_tst_cflags}" \
5921         && cf_fix_cppflags=no
5922         ;;
5923 esac
5924 done
5925
5926 if test -n "$cf_new_cflags" ; then
5927         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5928
5929         CFLAGS="$CFLAGS $cf_new_cflags"
5930 fi
5931
5932 if test -n "$cf_new_cppflags" ; then
5933         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5934
5935         CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
5936 fi
5937
5938 if test -n "$cf_new_extra_cppflags" ; then
5939         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5940
5941         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
5942 fi
5943
5944
5945
5946
5947 if test "$cf_check_cflags" != "$CFLAGS" ; then
5948 cat > conftest.$ac_ext <<EOF
5949 #line 5950 "configure"
5950 #include "confdefs.h"
5951 #include <stdio.h>
5952 int main() {
5953 printf("Hello world");
5954 ; return 0; }
5955 EOF
5956 if { (eval echo configure:5957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5957   :
5958 else
5959   echo "configure: failed program was:" >&5
5960   cat conftest.$ac_ext >&5
5961   rm -rf conftest*
5962   test -n "$verbose" && echo "  test-compile failed.  Undoing change to \$CFLAGS" 1>&6
5963
5964          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
5965                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
5966
5967          fi
5968          CFLAGS="$cf_check_flags"
5969 fi
5970 rm -f conftest*
5971 fi
5972
5973 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
5974 echo "configure:5975: checking for XOpenDisplay in -lX11" >&5
5975 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
5976 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5977   echo $ac_n "(cached) $ac_c" 1>&6
5978 else
5979   ac_save_LIBS="$LIBS"
5980 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
5981 cat > conftest.$ac_ext <<EOF
5982 #line 5983 "configure"
5983 #include "confdefs.h"
5984 /* Override any gcc2 internal prototype to avoid an error.  */
5985 /* We use char because int might match the return type of a gcc2
5986     builtin and then its argument prototype would still apply.  */
5987 char XOpenDisplay();
5988
5989 int main() {
5990 XOpenDisplay()
5991 ; return 0; }
5992 EOF
5993 if { (eval echo configure:5994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5994   rm -rf conftest*
5995   eval "ac_cv_lib_$ac_lib_var=yes"
5996 else
5997   echo "configure: failed program was:" >&5
5998   cat conftest.$ac_ext >&5
5999   rm -rf conftest*
6000   eval "ac_cv_lib_$ac_lib_var=no"
6001 fi
6002 rm -f conftest*
6003 LIBS="$ac_save_LIBS"
6004
6005 fi
6006 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6007   echo "$ac_t""yes" 1>&6
6008   LIBS="-lX11 $LIBS"
6009 else
6010   echo "$ac_t""no" 1>&6
6011 fi
6012
6013 echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
6014 echo "configure:6015: checking for XCurses library" >&5
6015 if eval "test \"`echo '$''{'cf_cv_lib_XCurses'+set}'`\" = set"; then
6016   echo $ac_n "(cached) $ac_c" 1>&6
6017 else
6018   
6019 LIBS="-lXCurses $LIBS"
6020 cat > conftest.$ac_ext <<EOF
6021 #line 6022 "configure"
6022 #include "confdefs.h"
6023
6024 #include <xcurses.h>
6025 char *XCursesProgramName = "test";
6026
6027 int main() {
6028 XCursesExit();
6029 ; return 0; }
6030 EOF
6031 if { (eval echo configure:6032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6032   rm -rf conftest*
6033   cf_cv_lib_XCurses=yes
6034 else
6035   echo "configure: failed program was:" >&5
6036   cat conftest.$ac_ext >&5
6037   rm -rf conftest*
6038   cf_cv_lib_XCurses=no
6039 fi
6040 rm -f conftest*
6041
6042 fi
6043
6044 echo "$ac_t""$cf_cv_lib_XCurses" 1>&6
6045
6046 fi
6047
6048 if test $cf_cv_lib_XCurses = yes ; then
6049         cat >> confdefs.h <<\EOF
6050 #define UNIX 1
6051 EOF
6052
6053         cat >> confdefs.h <<\EOF
6054 #define XCURSES 1
6055 EOF
6056
6057         cat >> confdefs.h <<\EOF
6058 #define HAVE_XCURSES 1
6059 EOF
6060
6061 else
6062         { echo "configure: error: Cannot link with XCurses" 1>&2; exit 1; }
6063 fi
6064
6065         ;;
6066 esac
6067
6068
6069
6070 case $cf_cv_screen in #(vi
6071 pdcurses) #(vi
6072         ;;
6073 *)
6074         # look for curses-related libraries
6075         echo $ac_n "checking for new_panel in -lpanel$cf_cv_libtype""... $ac_c" 1>&6
6076 echo "configure:6077: checking for new_panel in -lpanel$cf_cv_libtype" >&5
6077 ac_lib_var=`echo panel$cf_cv_libtype'_'new_panel | sed 'y%./+-%__p_%'`
6078 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6079   echo $ac_n "(cached) $ac_c" 1>&6
6080 else
6081   ac_save_LIBS="$LIBS"
6082 LIBS="-lpanel$cf_cv_libtype  $LIBS"
6083 cat > conftest.$ac_ext <<EOF
6084 #line 6085 "configure"
6085 #include "confdefs.h"
6086 /* Override any gcc2 internal prototype to avoid an error.  */
6087 /* We use char because int might match the return type of a gcc2
6088     builtin and then its argument prototype would still apply.  */
6089 char new_panel();
6090
6091 int main() {
6092 new_panel()
6093 ; return 0; }
6094 EOF
6095 if { (eval echo configure:6096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6096   rm -rf conftest*
6097   eval "ac_cv_lib_$ac_lib_var=yes"
6098 else
6099   echo "configure: failed program was:" >&5
6100   cat conftest.$ac_ext >&5
6101   rm -rf conftest*
6102   eval "ac_cv_lib_$ac_lib_var=no"
6103 fi
6104 rm -f conftest*
6105 LIBS="$ac_save_LIBS"
6106
6107 fi
6108 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6109   echo "$ac_t""yes" 1>&6
6110     ac_tr_lib=HAVE_LIB`echo panel$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6111     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6112   cat >> confdefs.h <<EOF
6113 #define $ac_tr_lib 1
6114 EOF
6115
6116   LIBS="-lpanel$cf_cv_libtype $LIBS"
6117
6118 else
6119   echo "$ac_t""no" 1>&6
6120 fi
6121
6122         echo $ac_n "checking for menu_driver in -lmenu$cf_cv_libtype""... $ac_c" 1>&6
6123 echo "configure:6124: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
6124 ac_lib_var=`echo menu$cf_cv_libtype'_'menu_driver | sed 'y%./+-%__p_%'`
6125 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6126   echo $ac_n "(cached) $ac_c" 1>&6
6127 else
6128   ac_save_LIBS="$LIBS"
6129 LIBS="-lmenu$cf_cv_libtype  $LIBS"
6130 cat > conftest.$ac_ext <<EOF
6131 #line 6132 "configure"
6132 #include "confdefs.h"
6133 /* Override any gcc2 internal prototype to avoid an error.  */
6134 /* We use char because int might match the return type of a gcc2
6135     builtin and then its argument prototype would still apply.  */
6136 char menu_driver();
6137
6138 int main() {
6139 menu_driver()
6140 ; return 0; }
6141 EOF
6142 if { (eval echo configure:6143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6143   rm -rf conftest*
6144   eval "ac_cv_lib_$ac_lib_var=yes"
6145 else
6146   echo "configure: failed program was:" >&5
6147   cat conftest.$ac_ext >&5
6148   rm -rf conftest*
6149   eval "ac_cv_lib_$ac_lib_var=no"
6150 fi
6151 rm -f conftest*
6152 LIBS="$ac_save_LIBS"
6153
6154 fi
6155 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6156   echo "$ac_t""yes" 1>&6
6157     ac_tr_lib=HAVE_LIB`echo menu$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6158     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6159   cat >> confdefs.h <<EOF
6160 #define $ac_tr_lib 1
6161 EOF
6162
6163   LIBS="-lmenu$cf_cv_libtype $LIBS"
6164
6165 else
6166   echo "$ac_t""no" 1>&6
6167 fi
6168
6169         echo $ac_n "checking for form_driver in -lform$cf_cv_libtype""... $ac_c" 1>&6
6170 echo "configure:6171: checking for form_driver in -lform$cf_cv_libtype" >&5
6171 ac_lib_var=`echo form$cf_cv_libtype'_'form_driver | sed 'y%./+-%__p_%'`
6172 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6173   echo $ac_n "(cached) $ac_c" 1>&6
6174 else
6175   ac_save_LIBS="$LIBS"
6176 LIBS="-lform$cf_cv_libtype  $LIBS"
6177 cat > conftest.$ac_ext <<EOF
6178 #line 6179 "configure"
6179 #include "confdefs.h"
6180 /* Override any gcc2 internal prototype to avoid an error.  */
6181 /* We use char because int might match the return type of a gcc2
6182     builtin and then its argument prototype would still apply.  */
6183 char form_driver();
6184
6185 int main() {
6186 form_driver()
6187 ; return 0; }
6188 EOF
6189 if { (eval echo configure:6190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6190   rm -rf conftest*
6191   eval "ac_cv_lib_$ac_lib_var=yes"
6192 else
6193   echo "configure: failed program was:" >&5
6194   cat conftest.$ac_ext >&5
6195   rm -rf conftest*
6196   eval "ac_cv_lib_$ac_lib_var=no"
6197 fi
6198 rm -f conftest*
6199 LIBS="$ac_save_LIBS"
6200
6201 fi
6202 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6203   echo "$ac_t""yes" 1>&6
6204     ac_tr_lib=HAVE_LIB`echo form$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6205     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6206   cat >> confdefs.h <<EOF
6207 #define $ac_tr_lib 1
6208 EOF
6209
6210   LIBS="-lform$cf_cv_libtype $LIBS"
6211
6212 else
6213   echo "$ac_t""no" 1>&6
6214 fi
6215
6216
6217         # look for curses-related headers
6218         for ac_hdr in \
6219                 nc_alloc.h \
6220                 nomacros.h \
6221                 form.h \
6222                 menu.h \
6223                 panel.h \
6224                 
6225 do
6226 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6227 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6228 echo "configure:6229: checking for $ac_hdr" >&5
6229 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6230   echo $ac_n "(cached) $ac_c" 1>&6
6231 else
6232   cat > conftest.$ac_ext <<EOF
6233 #line 6234 "configure"
6234 #include "confdefs.h"
6235 #include <$ac_hdr>
6236 EOF
6237 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6238 { (eval echo configure:6239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6239 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6240 if test -z "$ac_err"; then
6241   rm -rf conftest*
6242   eval "ac_cv_header_$ac_safe=yes"
6243 else
6244   echo "$ac_err" >&5
6245   echo "configure: failed program was:" >&5
6246   cat conftest.$ac_ext >&5
6247   rm -rf conftest*
6248   eval "ac_cv_header_$ac_safe=no"
6249 fi
6250 rm -f conftest*
6251 fi
6252 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6253   echo "$ac_t""yes" 1>&6
6254     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6255   cat >> confdefs.h <<EOF
6256 #define $ac_tr_hdr 1
6257 EOF
6258  
6259 else
6260   echo "$ac_t""no" 1>&6
6261 fi
6262 done
6263
6264         ;;
6265 esac
6266
6267 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
6268 echo "configure:6269: checking return type of signal handlers" >&5
6269 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
6270   echo $ac_n "(cached) $ac_c" 1>&6
6271 else
6272   cat > conftest.$ac_ext <<EOF
6273 #line 6274 "configure"
6274 #include "confdefs.h"
6275 #include <sys/types.h>
6276 #include <signal.h>
6277 #ifdef signal
6278 #undef signal
6279 #endif
6280 #ifdef __cplusplus
6281 extern "C" void (*signal (int, void (*)(int)))(int);
6282 #else
6283 void (*signal ()) ();
6284 #endif
6285
6286 int main() {
6287 int i;
6288 ; return 0; }
6289 EOF
6290 if { (eval echo configure:6291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6291   rm -rf conftest*
6292   ac_cv_type_signal=void
6293 else
6294   echo "configure: failed program was:" >&5
6295   cat conftest.$ac_ext >&5
6296   rm -rf conftest*
6297   ac_cv_type_signal=int
6298 fi
6299 rm -f conftest*
6300 fi
6301
6302 echo "$ac_t""$ac_cv_type_signal" 1>&6
6303 cat >> confdefs.h <<EOF
6304 #define RETSIGTYPE $ac_cv_type_signal
6305 EOF
6306
6307
6308
6309 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
6310 echo "configure:6311: checking for ANSI C header files" >&5
6311 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
6312   echo $ac_n "(cached) $ac_c" 1>&6
6313 else
6314   cat > conftest.$ac_ext <<EOF
6315 #line 6316 "configure"
6316 #include "confdefs.h"
6317 #include <stdlib.h>
6318 #include <stdarg.h>
6319 #include <string.h>
6320 #include <float.h>
6321 EOF
6322 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6323 { (eval echo configure:6324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6324 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6325 if test -z "$ac_err"; then
6326   rm -rf conftest*
6327   ac_cv_header_stdc=yes
6328 else
6329   echo "$ac_err" >&5
6330   echo "configure: failed program was:" >&5
6331   cat conftest.$ac_ext >&5
6332   rm -rf conftest*
6333   ac_cv_header_stdc=no
6334 fi
6335 rm -f conftest*
6336
6337 if test $ac_cv_header_stdc = yes; then
6338   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6339 cat > conftest.$ac_ext <<EOF
6340 #line 6341 "configure"
6341 #include "confdefs.h"
6342 #include <string.h>
6343 EOF
6344 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6345   egrep "memchr" >/dev/null 2>&1; then
6346   :
6347 else
6348   rm -rf conftest*
6349   ac_cv_header_stdc=no
6350 fi
6351 rm -f conftest*
6352
6353 fi
6354
6355 if test $ac_cv_header_stdc = yes; then
6356   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6357 cat > conftest.$ac_ext <<EOF
6358 #line 6359 "configure"
6359 #include "confdefs.h"
6360 #include <stdlib.h>
6361 EOF
6362 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6363   egrep "free" >/dev/null 2>&1; then
6364   :
6365 else
6366   rm -rf conftest*
6367   ac_cv_header_stdc=no
6368 fi
6369 rm -f conftest*
6370
6371 fi
6372
6373 if test $ac_cv_header_stdc = yes; then
6374   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
6375 if test "$cross_compiling" = yes; then
6376   :
6377 else
6378   cat > conftest.$ac_ext <<EOF
6379 #line 6380 "configure"
6380 #include "confdefs.h"
6381 #include <ctype.h>
6382 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
6383 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
6384 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
6385 int main () { int i; for (i = 0; i < 256; i++)
6386 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
6387 exit (0); }
6388
6389 EOF
6390 if { (eval echo configure:6391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6391 then
6392   :
6393 else
6394   echo "configure: failed program was:" >&5
6395   cat conftest.$ac_ext >&5
6396   rm -fr conftest*
6397   ac_cv_header_stdc=no
6398 fi
6399 rm -fr conftest*
6400 fi
6401
6402 fi
6403 fi
6404
6405 echo "$ac_t""$ac_cv_header_stdc" 1>&6
6406 if test $ac_cv_header_stdc = yes; then
6407   cat >> confdefs.h <<\EOF
6408 #define STDC_HEADERS 1
6409 EOF
6410
6411 fi
6412
6413 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
6414 echo "configure:6415: checking whether time.h and sys/time.h may both be included" >&5
6415 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
6416   echo $ac_n "(cached) $ac_c" 1>&6
6417 else
6418   cat > conftest.$ac_ext <<EOF
6419 #line 6420 "configure"
6420 #include "confdefs.h"
6421 #include <sys/types.h>
6422 #include <sys/time.h>
6423 #include <time.h>
6424 int main() {
6425 struct tm *tp;
6426 ; return 0; }
6427 EOF
6428 if { (eval echo configure:6429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6429   rm -rf conftest*
6430   ac_cv_header_time=yes
6431 else
6432   echo "configure: failed program was:" >&5
6433   cat conftest.$ac_ext >&5
6434   rm -rf conftest*
6435   ac_cv_header_time=no
6436 fi
6437 rm -f conftest*
6438 fi
6439
6440 echo "$ac_t""$ac_cv_header_time" 1>&6
6441 if test $ac_cv_header_time = yes; then
6442   cat >> confdefs.h <<\EOF
6443 #define TIME_WITH_SYS_TIME 1
6444 EOF
6445
6446 fi
6447
6448 for ac_hdr in \
6449 getopt.h \
6450 locale.h \
6451 stdarg.h \
6452 sys/ioctl.h \
6453 sys/select.h \
6454 sys/time.h \
6455 termios.h \
6456 unistd.h \
6457
6458 do
6459 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6460 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6461 echo "configure:6462: checking for $ac_hdr" >&5
6462 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6463   echo $ac_n "(cached) $ac_c" 1>&6
6464 else
6465   cat > conftest.$ac_ext <<EOF
6466 #line 6467 "configure"
6467 #include "confdefs.h"
6468 #include <$ac_hdr>
6469 EOF
6470 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6471 { (eval echo configure:6472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6472 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6473 if test -z "$ac_err"; then
6474   rm -rf conftest*
6475   eval "ac_cv_header_$ac_safe=yes"
6476 else
6477   echo "$ac_err" >&5
6478   echo "configure: failed program was:" >&5
6479   cat conftest.$ac_ext >&5
6480   rm -rf conftest*
6481   eval "ac_cv_header_$ac_safe=no"
6482 fi
6483 rm -f conftest*
6484 fi
6485 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6486   echo "$ac_t""yes" 1>&6
6487     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6488   cat >> confdefs.h <<EOF
6489 #define $ac_tr_hdr 1
6490 EOF
6491  
6492 else
6493   echo "$ac_t""no" 1>&6
6494 fi
6495 done
6496
6497
6498 for ac_func in \
6499 chgat \
6500 color_set \
6501 filter \
6502 getbegx \
6503 getcurx \
6504 getmaxx \
6505 getnstr \
6506 gettimeofday \
6507 getwin \
6508 mvvline \
6509 mvwvline \
6510 napms \
6511 putwin \
6512 resize_term \
6513 resizeterm \
6514 ripoffline \
6515 setupterm \
6516 slk_color \
6517 slk_init \
6518 strdup \
6519 termattrs \
6520 tgetent \
6521 tigetnum \
6522 tigetstr \
6523 typeahead \
6524 use_default_colors \
6525 vsscanf \
6526 wchgat \
6527 winsstr \
6528 wresize \
6529
6530 do
6531 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6532 echo "configure:6533: checking for $ac_func" >&5
6533 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6534   echo $ac_n "(cached) $ac_c" 1>&6
6535 else
6536   cat > conftest.$ac_ext <<EOF
6537 #line 6538 "configure"
6538 #include "confdefs.h"
6539 /* System header to define __stub macros and hopefully few prototypes,
6540     which can conflict with char $ac_func(); below.  */
6541 #include <assert.h>
6542 /* Override any gcc2 internal prototype to avoid an error.  */
6543 /* We use char because int might match the return type of a gcc2
6544     builtin and then its argument prototype would still apply.  */
6545 char $ac_func();
6546
6547 int main() {
6548
6549 /* The GNU C library defines this for functions which it implements
6550     to always fail with ENOSYS.  Some functions are actually named
6551     something starting with __ and the normal name is an alias.  */
6552 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6553 choke me
6554 #else
6555 $ac_func();
6556 #endif
6557
6558 ; return 0; }
6559 EOF
6560 if { (eval echo configure:6561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6561   rm -rf conftest*
6562   eval "ac_cv_func_$ac_func=yes"
6563 else
6564   echo "configure: failed program was:" >&5
6565   cat conftest.$ac_ext >&5
6566   rm -rf conftest*
6567   eval "ac_cv_func_$ac_func=no"
6568 fi
6569 rm -f conftest*
6570 fi
6571
6572 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6573   echo "$ac_t""yes" 1>&6
6574     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6575   cat >> confdefs.h <<EOF
6576 #define $ac_tr_func 1
6577 EOF
6578  
6579 else
6580   echo "$ac_t""no" 1>&6
6581 fi
6582 done
6583
6584
6585 echo $ac_n "checking for ncurses extended functions""... $ac_c" 1>&6
6586 echo "configure:6587: checking for ncurses extended functions" >&5
6587 if eval "test \"`echo '$''{'cf_cv_ncurses_ext_funcs'+set}'`\" = set"; then
6588   echo $ac_n "(cached) $ac_c" 1>&6
6589 else
6590   
6591 cat > conftest.$ac_ext <<EOF
6592 #line 6593 "configure"
6593 #include "confdefs.h"
6594
6595 #include <${cf_cv_ncurses_header-curses.h}>
6596 int main() {
6597
6598         (void) assume_default_colors (0, 0);
6599         (void) curses_version ();
6600         (void) define_key (0, 0);
6601         (void) is_term_resized (0, 0);
6602         (void) key_defined (0);
6603         (void) keybound (0, 0);
6604         (void) keyok (0, 0);
6605         (void) resize_term (0, 0);
6606         (void) resizeterm (0, 0);
6607         (void) use_default_colors ();
6608         (void) use_extended_names (0);
6609         (void) wresize (0, 0, 0);
6610 ; return 0; }
6611 EOF
6612 if { (eval echo configure:6613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6613   rm -rf conftest*
6614   cf_cv_ncurses_ext_funcs=yes
6615 else
6616   echo "configure: failed program was:" >&5
6617   cat conftest.$ac_ext >&5
6618   rm -rf conftest*
6619   cf_cv_ncurses_ext_funcs=no
6620 fi
6621 rm -f conftest*
6622
6623 fi
6624
6625 echo "$ac_t""$cf_cv_ncurses_ext_funcs" 1>&6
6626 test "$cf_cv_ncurses_ext_funcs" != no && cat >> confdefs.h <<\EOF
6627 #define NCURSES_EXT_FUNCS 1
6628 EOF
6629
6630
6631 echo $ac_n "checking for wide-character functions""... $ac_c" 1>&6
6632 echo "configure:6633: checking for wide-character functions" >&5
6633 if eval "test \"`echo '$''{'cf_cv_widechar_funcs'+set}'`\" = set"; then
6634   echo $ac_n "(cached) $ac_c" 1>&6
6635 else
6636   
6637 cat > conftest.$ac_ext <<EOF
6638 #line 6639 "configure"
6639 #include "confdefs.h"
6640
6641 #include <${cf_cv_ncurses_header-curses.h}>
6642 int main() {
6643
6644         static wchar_t src_wchar[2];
6645         static cchar_t dst_cchar;
6646         setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
6647         
6648 ; return 0; }
6649 EOF
6650 if { (eval echo configure:6651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6651   rm -rf conftest*
6652   cf_cv_widechar_funcs=yes
6653 else
6654   echo "configure: failed program was:" >&5
6655   cat conftest.$ac_ext >&5
6656   rm -rf conftest*
6657   cf_cv_widechar_funcs=no
6658 fi
6659 rm -f conftest*
6660
6661 fi
6662
6663 echo "$ac_t""$cf_cv_widechar_funcs" 1>&6
6664 if test "$cf_cv_widechar_funcs" != no ; then
6665         cat >> confdefs.h <<\EOF
6666 #define USE_WIDEC_SUPPORT 1
6667 EOF
6668
6669 else
6670         cat >> confdefs.h <<\EOF
6671 #define USE_WIDEC_SUPPORT 0
6672 EOF
6673
6674 fi
6675
6676
6677 echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
6678 echo "configure:6679: checking if sys/time.h works with sys/select.h" >&5
6679 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
6680   echo $ac_n "(cached) $ac_c" 1>&6
6681 else
6682   
6683 cat > conftest.$ac_ext <<EOF
6684 #line 6685 "configure"
6685 #include "confdefs.h"
6686
6687 #include <sys/types.h>
6688 #ifdef HAVE_SYS_TIME_H
6689 #include <sys/time.h>
6690 #endif
6691 #ifdef HAVE_SYS_SELECT_H
6692 #include <sys/select.h>
6693 #endif
6694
6695 int main() {
6696
6697 ; return 0; }
6698 EOF
6699 if { (eval echo configure:6700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6700   rm -rf conftest*
6701   cf_cv_sys_time_select=yes
6702 else
6703   echo "configure: failed program was:" >&5
6704   cat conftest.$ac_ext >&5
6705   rm -rf conftest*
6706   cf_cv_sys_time_select=no
6707 fi
6708 rm -f conftest*
6709      
6710 fi
6711
6712 echo "$ac_t""$cf_cv_sys_time_select" 1>&6
6713 test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF
6714 #define HAVE_SYS_TIME_SELECT 1
6715 EOF
6716
6717
6718
6719 echo $ac_n "checking for function curses_version""... $ac_c" 1>&6
6720 echo "configure:6721: checking for function curses_version" >&5
6721 if eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then
6722   echo $ac_n "(cached) $ac_c" 1>&6
6723 else
6724   
6725 if test "$cross_compiling" = yes; then
6726   cf_cv_func_curses_version=unknown
6727 else
6728   cat > conftest.$ac_ext <<EOF
6729 #line 6730 "configure"
6730 #include "confdefs.h"
6731
6732 #include <${cf_cv_ncurses_header-curses.h}>
6733 int main()
6734 {
6735         char temp[1024];
6736         sprintf(temp, "%s\n", curses_version());
6737         exit(0);
6738 }
6739
6740 EOF
6741 if { (eval echo configure:6742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6742 then
6743   cf_cv_func_curses_version=yes
6744
6745 else
6746   echo "configure: failed program was:" >&5
6747   cat conftest.$ac_ext >&5
6748   rm -fr conftest*
6749   cf_cv_func_curses_version=no
6750
6751 fi
6752 rm -fr conftest*
6753 fi
6754
6755 rm -f core
6756 fi
6757
6758 echo "$ac_t""$cf_cv_func_curses_version" 1>&6
6759 test "$cf_cv_func_curses_version" = yes && cat >> confdefs.h <<\EOF
6760 #define HAVE_CURSES_VERSION 1
6761 EOF
6762
6763
6764
6765 echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6
6766 echo "configure:6767: checking for alternate character set array" >&5
6767 if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then
6768   echo $ac_n "(cached) $ac_c" 1>&6
6769 else
6770   
6771 cf_cv_curses_acs_map=unknown
6772 for name in acs_map _acs_map __acs_map _nc_acs_map
6773 do
6774 cat > conftest.$ac_ext <<EOF
6775 #line 6776 "configure"
6776 #include "confdefs.h"
6777
6778 #include <${cf_cv_ncurses_header-curses.h}>
6779
6780 int main() {
6781
6782 $name['k'] = ACS_PLUS
6783
6784 ; return 0; }
6785 EOF
6786 if { (eval echo configure:6787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6787   rm -rf conftest*
6788   cf_cv_curses_acs_map=$name; break
6789 else
6790   echo "configure: failed program was:" >&5
6791   cat conftest.$ac_ext >&5
6792 fi
6793 rm -f conftest*
6794 done
6795
6796 fi
6797
6798 echo "$ac_t""$cf_cv_curses_acs_map" 1>&6
6799
6800 test "$cf_cv_curses_acs_map" != unknown && cat >> confdefs.h <<EOF
6801 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
6802 EOF
6803
6804
6805
6806 echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6
6807 echo "configure:6808: checking for wide alternate character set array" >&5
6808 if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then
6809   echo $ac_n "(cached) $ac_c" 1>&6
6810 else
6811   
6812         cf_cv_curses_wacs_map=unknown
6813         for name in wacs_map _wacs_map __wacs_map _nc_wacs
6814         do
6815         cat > conftest.$ac_ext <<EOF
6816 #line 6817 "configure"
6817 #include "confdefs.h"
6818
6819 #ifndef _XOPEN_SOURCE_EXTENDED
6820 #define _XOPEN_SOURCE_EXTENDED
6821 #endif
6822 #include <${cf_cv_ncurses_header-curses.h}>
6823 int main() {
6824 $name['k'] = *WACS_PLUS
6825 ; return 0; }
6826 EOF
6827 if { (eval echo configure:6828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6828   rm -rf conftest*
6829   cf_cv_curses_wacs_map=$name
6830          break
6831 else
6832   echo "configure: failed program was:" >&5
6833   cat conftest.$ac_ext >&5
6834 fi
6835 rm -f conftest*
6836         done
6837 fi
6838
6839 echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6
6840
6841
6842 echo $ac_n "checking for type attr_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
6843 echo "configure:6844: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5
6844 cat > conftest.$ac_ext <<EOF
6845 #line 6846 "configure"
6846 #include "confdefs.h"
6847
6848 #ifndef _XOPEN_SOURCE_EXTENDED
6849 #define _XOPEN_SOURCE_EXTENDED
6850 #endif
6851 #include <${cf_cv_ncurses_header-curses.h}>
6852 int main() {
6853
6854 attr_t foo
6855
6856 ; return 0; }
6857 EOF
6858 if { (eval echo configure:6859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6859   rm -rf conftest*
6860   cf_result=yes
6861 else
6862   echo "configure: failed program was:" >&5
6863   cat conftest.$ac_ext >&5
6864   rm -rf conftest*
6865   cf_result=no
6866 fi
6867 rm -f conftest*
6868 echo "$ac_t""$cf_result" 1>&6
6869 if test $cf_result = yes ; then
6870         
6871 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6872
6873         cat >> confdefs.h <<EOF
6874 #define $cf_result 1
6875 EOF
6876
6877 else
6878         cat >> confdefs.h <<EOF
6879 #define attr_t long
6880 EOF
6881
6882 fi
6883
6884
6885 echo $ac_n "checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
6886 echo "configure:6887: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5
6887 cat > conftest.$ac_ext <<EOF
6888 #line 6889 "configure"
6889 #include "confdefs.h"
6890
6891 #ifndef _XOPEN_SOURCE_EXTENDED
6892 #define _XOPEN_SOURCE_EXTENDED
6893 #endif
6894 #include <${cf_cv_ncurses_header-curses.h}>
6895 int main() {
6896
6897 mbstate_t foo
6898
6899 ; return 0; }
6900 EOF
6901 if { (eval echo configure:6902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6902   rm -rf conftest*
6903   cf_result=yes
6904 else
6905   echo "configure: failed program was:" >&5
6906   cat conftest.$ac_ext >&5
6907   rm -rf conftest*
6908   cf_result=no
6909 fi
6910 rm -f conftest*
6911 echo "$ac_t""$cf_result" 1>&6
6912 if test $cf_result = yes ; then
6913         
6914 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6915
6916         cat >> confdefs.h <<EOF
6917 #define $cf_result 1
6918 EOF
6919
6920 else
6921         cat >> confdefs.h <<EOF
6922 #define mbstate_t long
6923 EOF
6924
6925 fi
6926
6927
6928 TEST_ARGS="$LIBS"
6929 LIBS=
6930
6931
6932 trap '' 1 2 15
6933 cat > confcache <<\EOF
6934 # This file is a shell script that caches the results of configure
6935 # tests run on this system so they can be shared between configure
6936 # scripts and configure runs.  It is not useful on other systems.
6937 # If it contains results you don't want to keep, you may remove or edit it.
6938 #
6939 # By default, configure uses ./config.cache as the cache file,
6940 # creating it if it does not exist already.  You can give configure
6941 # the --cache-file=FILE option to use a different cache file; that is
6942 # what configure does when it calls configure scripts in
6943 # subdirectories, so they share the cache.
6944 # Giving --cache-file=/dev/null disables caching, for debugging configure.
6945 # config.status only pays attention to the cache file if you give it the
6946 # --recheck option to rerun configure.
6947 #
6948 EOF
6949 # The following way of writing the cache mishandles newlines in values,
6950 # but we know of no workaround that is simple, portable, and efficient.
6951 # So, don't put newlines in cache variables' values.
6952 # Ultrix sh set writes to stderr and can't be redirected directly,
6953 # and sets the high bit in the cache file unless we assign to the vars.
6954 (set) 2>&1 |
6955   case `(ac_space=' '; set | grep ac_space) 2>&1` in
6956   *ac_space=\ *)
6957     # `set' does not quote correctly, so add quotes (double-quote substitution
6958     # turns \\\\ into \\, and sed turns \\ into \).
6959     sed -n \
6960       -e "s/'/'\\\\''/g" \
6961       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
6962     ;;
6963   *)
6964     # `set' quotes correctly as required by POSIX, so do not add quotes.
6965     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
6966     ;;
6967   esac >> confcache
6968 if cmp -s $cache_file confcache; then
6969   :
6970 else
6971   if test -w $cache_file; then
6972     echo "updating cache $cache_file"
6973     cat confcache > $cache_file
6974   else
6975     echo "not updating unwritable cache $cache_file"
6976   fi
6977 fi
6978 rm -f confcache
6979
6980 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
6981
6982 test "x$prefix" = xNONE && prefix=$ac_default_prefix
6983 # Let make expand exec_prefix.
6984 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
6985
6986 # Any assignment to VPATH causes Sun make to only execute
6987 # the first set of double-colon rules, so remove it if not needed.
6988 # If there is a colon in the path, we need to keep it.
6989 if test "x$srcdir" = x.; then
6990   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
6991 fi
6992
6993 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
6994
6995 DEFS=-DHAVE_CONFIG_H
6996
6997 # Without the "./", some shells look in PATH for config.status.
6998 : ${CONFIG_STATUS=./config.status}
6999
7000 echo creating $CONFIG_STATUS
7001 rm -f $CONFIG_STATUS
7002 cat > $CONFIG_STATUS <<EOF
7003 #! /bin/sh
7004 # Generated automatically by configure.
7005 # Run this file to recreate the current configuration.
7006 # This directory was configured as follows,
7007 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7008 #
7009 # $0 $ac_configure_args
7010 #
7011 # Compiler output produced by configure, useful for debugging
7012 # configure, is in ./config.log if it exists.
7013
7014 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
7015 for ac_option
7016 do
7017   case "\$ac_option" in
7018   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
7019     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
7020     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
7021   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
7022     echo "$CONFIG_STATUS generated by autoconf version 2.13.20030927"
7023     exit 0 ;;
7024   -help | --help | --hel | --he | --h)
7025     echo "\$ac_cs_usage"; exit 0 ;;
7026   *) echo "\$ac_cs_usage"; exit 1 ;;
7027   esac
7028 done
7029
7030 ac_given_srcdir=$srcdir
7031
7032 trap 'rm -fr `echo "Makefile ncurses_cfg.h:ncurses_tst.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
7033 EOF
7034 cat >> $CONFIG_STATUS <<EOF
7035
7036 # Protect against being on the right side of a sed subst in config.status.
7037 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
7038  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
7039 $ac_vpsub
7040 $extrasub
7041 s%@SHELL@%$SHELL%g
7042 s%@CFLAGS@%$CFLAGS%g
7043 s%@CPPFLAGS@%$CPPFLAGS%g
7044 s%@CXXFLAGS@%$CXXFLAGS%g
7045 s%@FFLAGS@%$FFLAGS%g
7046 s%@DEFS@%$DEFS%g
7047 s%@LDFLAGS@%$LDFLAGS%g
7048 s%@LIBS@%$LIBS%g
7049 s%@exec_prefix@%$exec_prefix%g
7050 s%@prefix@%$prefix%g
7051 s%@program_transform_name@%$program_transform_name%g
7052 s%@bindir@%$bindir%g
7053 s%@sbindir@%$sbindir%g
7054 s%@libexecdir@%$libexecdir%g
7055 s%@datadir@%$datadir%g
7056 s%@sysconfdir@%$sysconfdir%g
7057 s%@sharedstatedir@%$sharedstatedir%g
7058 s%@localstatedir@%$localstatedir%g
7059 s%@libdir@%$libdir%g
7060 s%@includedir@%$includedir%g
7061 s%@oldincludedir@%$oldincludedir%g
7062 s%@infodir@%$infodir%g
7063 s%@mandir@%$mandir%g
7064 s%@host@%$host%g
7065 s%@host_alias@%$host_alias%g
7066 s%@host_cpu@%$host_cpu%g
7067 s%@host_vendor@%$host_vendor%g
7068 s%@host_os@%$host_os%g
7069 s%@SET_MAKE@%$SET_MAKE%g
7070 s%@CC@%$CC%g
7071 s%@CPP@%$CPP%g
7072 s%@AWK@%$AWK%g
7073 s%@CC_G_OPT@%$CC_G_OPT%g
7074 s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
7075 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
7076 s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
7077 s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
7078 s%@ECHO_LINK@%$ECHO_LINK%g
7079 s%@LD@%$LD%g
7080 s%@LDFLAGS_SHARED@%$LDFLAGS_SHARED%g
7081 s%@LD_MODEL@%$LD_MODEL%g
7082 s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
7083 s%@LIBTOOL@%$LIBTOOL%g
7084 s%@LIB_CLEAN@%$LIB_CLEAN%g
7085 s%@LIB_COMPILE@%$LIB_COMPILE%g
7086 s%@LIB_LINK@%$LIB_LINK%g
7087 s%@LINK_TESTS@%$LINK_TESTS%g
7088 s%@LINT@%$LINT%g
7089 s%@LINT_OPTS@%$LINT_OPTS%g
7090 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
7091 s%@MATH_LIB@%$MATH_LIB%g
7092 s%@TEST_ARGS@%$TEST_ARGS%g
7093 s%@TEST_DEPS@%$TEST_DEPS%g
7094 s%@TINFO_ARGS@%$TINFO_ARGS%g
7095 s%@cf_cv_abi_version@%$cf_cv_abi_version%g
7096 s%@cf_cv_rel_version@%$cf_cv_rel_version%g
7097 s%@EXEEXT@%$EXEEXT%g
7098 s%@OBJEXT@%$OBJEXT%g
7099 s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%g
7100 s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
7101 s%@X_CFLAGS@%$X_CFLAGS%g
7102 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
7103 s%@X_LIBS@%$X_LIBS%g
7104 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
7105 s%@XCURSES_CONFIG@%$XCURSES_CONFIG%g
7106
7107 CEOF
7108 EOF
7109
7110 cat >> $CONFIG_STATUS <<\EOF
7111
7112 # Split the substitutions into bite-sized pieces for seds with
7113 # small command number limits, like on Digital OSF/1 and HP-UX.
7114 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
7115 ac_file=1 # Number of current file.
7116 ac_beg=1 # First line for current file.
7117 ac_end=$ac_max_sed_cmds # Line after last line for current file.
7118 ac_more_lines=:
7119 ac_sed_cmds=""
7120 while $ac_more_lines; do
7121   if test $ac_beg -gt 1; then
7122     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
7123   else
7124     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
7125   fi
7126   if test ! -s conftest.s$ac_file; then
7127     ac_more_lines=false
7128     rm -f conftest.s$ac_file
7129   else
7130     if test -z "$ac_sed_cmds"; then
7131       ac_sed_cmds="sed -f conftest.s$ac_file"
7132     else
7133       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
7134     fi
7135     ac_file=`expr $ac_file + 1`
7136     ac_beg=$ac_end
7137     ac_end=`expr $ac_end + $ac_max_sed_cmds`
7138   fi
7139 done
7140 if test -z "$ac_sed_cmds"; then
7141   ac_sed_cmds=cat
7142 fi
7143 EOF
7144
7145 cat >> $CONFIG_STATUS <<EOF
7146
7147 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
7148 EOF
7149 cat >> $CONFIG_STATUS <<\EOF
7150 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
7151   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7152   case "$ac_file" in
7153   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7154        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7155   *) ac_file_in="${ac_file}.in" ;;
7156   esac
7157
7158   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
7159
7160   # Remove last slash and all that follows it.  Not all systems have dirname.
7161   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7162   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7163     # The file is in a subdirectory.
7164     test ! -d "$ac_dir" && mkdir "$ac_dir"
7165     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
7166     # A "../" for each directory in $ac_dir_suffix.
7167     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
7168   else
7169     ac_dir_suffix= ac_dots=
7170   fi
7171
7172   case "$ac_given_srcdir" in
7173   .)  srcdir=.
7174       if test -z "$ac_dots"; then top_srcdir=.
7175       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
7176   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
7177   *) # Relative path.
7178     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
7179     top_srcdir="$ac_dots$ac_given_srcdir" ;;
7180   esac
7181
7182
7183   echo creating "$ac_file"
7184   rm -f "$ac_file"
7185   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
7186   case "$ac_file" in
7187   *Makefile*) ac_comsub="1i\\
7188 # $configure_input" ;;
7189   *) ac_comsub= ;;
7190   esac
7191
7192   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7193   sed -e "$ac_comsub
7194 s%@configure_input@%$configure_input%g
7195 s%@srcdir@%$srcdir%g
7196 s%@top_srcdir@%$top_srcdir%g
7197 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
7198 fi; done
7199 rm -f conftest.s*
7200
7201 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
7202 # NAME is the cpp macro being defined and VALUE is the value it is being given.
7203 #
7204 # ac_d sets the value in "#define NAME VALUE" lines.
7205 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
7206 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
7207 ac_dC='\3'
7208 ac_dD='%g'
7209 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
7210 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7211 ac_uB='\([      ]\)%\1#\2define\3'
7212 ac_uC=' '
7213 ac_uD='\4%g'
7214 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
7215 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7216 ac_eB='$%\1#\2define\3'
7217 ac_eC=' '
7218 ac_eD='%g'
7219
7220 if test "${CONFIG_HEADERS+set}" != set; then
7221 EOF
7222 cat >> $CONFIG_STATUS <<EOF
7223   CONFIG_HEADERS="ncurses_cfg.h:ncurses_tst.hin"
7224 EOF
7225 cat >> $CONFIG_STATUS <<\EOF
7226 fi
7227 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
7228   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7229   case "$ac_file" in
7230   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7231        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7232   *) ac_file_in="${ac_file}.in" ;;
7233   esac
7234
7235   echo creating $ac_file
7236
7237   rm -f conftest.frag conftest.in conftest.out
7238   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7239   cat $ac_file_inputs > conftest.in
7240
7241 EOF
7242
7243
7244 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
7245 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
7246 # be either 'cat' or 'sort'.
7247 cat confdefs.h >conftest.vals
7248
7249 # Break up conftest.vals because some shells have a limit on
7250 # the size of here documents, and old seds have small limits too.
7251
7252 rm -f conftest.tail
7253 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
7254 while :
7255 do
7256   ac_lines=`grep -c . conftest.vals`
7257   # grep -c gives empty output for an empty file on some AIX systems.
7258   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
7259   # Write chunks of a limited-size here document to conftest.frag.
7260   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
7261   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
7262   echo 'CEOF' >> $CONFIG_STATUS
7263   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
7264   rm -f conftest.vals
7265   mv conftest.tail conftest.vals
7266 done
7267 rm -f conftest.vals
7268
7269 # Run sed to substitute the contents of conftest.frag into conftest.in at the
7270 # marker @DEFS@.
7271 echo '  cat >> conftest.edit <<CEOF
7272 /@DEFS@/r conftest.frag
7273 /@DEFS@/d
7274 CEOF
7275 sed -f conftest.edit conftest.in > conftest.out
7276 rm -f conftest.in
7277 mv conftest.out conftest.in
7278 rm -f conftest.edit conftest.frag
7279 ' >> $CONFIG_STATUS
7280
7281
7282 cat >> $CONFIG_STATUS <<\EOF
7283   rm -f conftest.frag conftest.h
7284   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
7285   cat conftest.in >> conftest.h
7286   rm -f conftest.in
7287   if cmp -s $ac_file conftest.h 2>/dev/null; then
7288     echo "$ac_file is unchanged"
7289     rm -f conftest.h
7290   else
7291     # Remove last slash and all that follows it.  Not all systems have dirname.
7292       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7293       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7294       # The file is in a subdirectory.
7295       test ! -d "$ac_dir" && mkdir "$ac_dir"
7296     fi
7297     rm -f $ac_file
7298     mv conftest.h $ac_file
7299   fi
7300 fi; done
7301
7302 EOF
7303 cat >> $CONFIG_STATUS <<EOF
7304 # Extra initialization commands, if any
7305
7306 AWK="$AWK"
7307
7308 EOF
7309 cat >> $CONFIG_STATUS <<\EOF
7310 # Extra commands, if any
7311
7312
7313 for cf_dir in .
7314 do
7315         if test ! -d $srcdir/$cf_dir; then
7316                 continue
7317         elif test -f $srcdir/$cf_dir/programs; then
7318                 $AWK -f $srcdir/mk-test.awk ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
7319         fi
7320 done
7321
7322
7323         cat >>Makefile <<TEST_EOF
7324
7325 # These rules are generated so we do not rely on suffix rules, which do not
7326 # work consistently for different make-programs (the '\$(MODEL)/' confuses
7327 # some, and the '\$x' confuses others).
7328 TEST_EOF
7329 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
7330 for N in $LIST
7331 do
7332         cat >>Makefile <<TEST_EOF
7333
7334 \$(MODEL)/$N.o : $N.c \\
7335         test.priv.h \\
7336         ncurses_cfg.h
7337         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
7338 TEST_EOF
7339 done
7340
7341 exit 0
7342 EOF
7343 chmod +x $CONFIG_STATUS
7344 rm -fr confdefs* $ac_clean_files
7345 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
7346