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