]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.6 - patch 20070203
[ncurses.git] / test / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13.20030927 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14
15 # Initialize some variables set by options.
16 # The variables have the same names as the options, with
17 # dashes changed to underlines.
18 build=NONE
19 cache_file=./config.cache
20 exec_prefix=NONE
21 host=NONE
22 no_create=
23 nonopt=NONE
24 no_recursion=
25 prefix=NONE
26 program_prefix=NONE
27 program_suffix=NONE
28 program_transform_name=s,x,x,
29 silent=
30 site=
31 srcdir=
32 target=NONE
33 verbose=
34 x_includes=NONE
35 x_libraries=NONE
36 bindir='${exec_prefix}/bin'
37 sbindir='${exec_prefix}/sbin'
38 libexecdir='${exec_prefix}/libexec'
39 datadir='${prefix}/share'
40 sysconfdir='${prefix}/etc'
41 sharedstatedir='${prefix}/com'
42 localstatedir='${prefix}/var'
43 libdir='${exec_prefix}/lib'
44 includedir='${prefix}/include'
45 oldincludedir='/usr/include'
46 infodir='${prefix}/info'
47 mandir='${prefix}/man'
48
49 # Initialize some other variables.
50 subdirs=
51 MFLAGS= MAKEFLAGS=
52 SHELL=${CONFIG_SHELL-/bin/sh}
53 # Maximum number of lines to put in a shell here document.
54 ac_max_here_lines=12
55
56 ac_prev=
57 for ac_option
58 do
59
60   # If the previous option needs an argument, assign it.
61   if test -n "$ac_prev"; then
62     eval "$ac_prev=\$ac_option"
63     ac_prev=
64     continue
65   fi
66
67   case "$ac_option" in
68   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
69   *) ac_optarg= ;;
70   esac
71
72   # Accept the important Cygnus configure options, so we can diagnose typos.
73
74   case "$ac_option" in
75
76   -bindir | --bindir | --bindi | --bind | --bin | --bi)
77     ac_prev=bindir ;;
78   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
79     bindir="$ac_optarg" ;;
80
81   -build | --build | --buil | --bui | --bu)
82     ac_prev=build ;;
83   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
84     build="$ac_optarg" ;;
85
86   -cache-file | --cache-file | --cache-fil | --cache-fi \
87   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
88     ac_prev=cache_file ;;
89   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
90   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
91     cache_file="$ac_optarg" ;;
92
93   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
94     ac_prev=datadir ;;
95   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
96   | --da=*)
97     datadir="$ac_optarg" ;;
98
99   -disable-* | --disable-*)
100     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
101     # Reject names that are not valid shell variable names.
102     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
103       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
104     fi
105     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
106     eval "enable_${ac_feature}=no" ;;
107
108   -enable-* | --enable-*)
109     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
110     # Reject names that are not valid shell variable names.
111     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
112       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
113     fi
114     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
115     case "$ac_option" in
116       *=*) ;;
117       *) ac_optarg=yes ;;
118     esac
119     eval "enable_${ac_feature}='$ac_optarg'" ;;
120
121   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
122   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
123   | --exec | --exe | --ex)
124     ac_prev=exec_prefix ;;
125   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
126   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
127   | --exec=* | --exe=* | --ex=*)
128     exec_prefix="$ac_optarg" ;;
129
130   -gas | --gas | --ga | --g)
131     # Obsolete; use --with-gas.
132     with_gas=yes ;;
133
134   -help | --help | --hel | --he)
135     # Omit some internal or obsolete options to make the list less imposing.
136     # This message is too long to be a string in the A/UX 3.1 sh.
137     cat << EOF
138 Usage: configure [options] [host]
139 Options: [defaults in brackets after descriptions]
140 Configuration:
141   --cache-file=FILE       cache test results in FILE
142   --help                  print this message
143   --no-create             do not create output files
144   --quiet, --silent       do not print \`checking...' messages
145   --version               print the version of autoconf that created configure
146 Directory and file names:
147   --prefix=PREFIX         install architecture-independent files in PREFIX
148                           [$ac_default_prefix]
149   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
150                           [same as prefix]
151   --bindir=DIR            user executables in DIR [EPREFIX/bin]
152   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
153   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
154   --datadir=DIR           read-only architecture-independent data in DIR
155                           [PREFIX/share]
156   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
157   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
158                           [PREFIX/com]
159   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
160   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
161   --includedir=DIR        C header files in DIR [PREFIX/include]
162   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
163   --infodir=DIR           info documentation in DIR [PREFIX/info]
164   --mandir=DIR            man documentation in DIR [PREFIX/man]
165   --srcdir=DIR            find the sources in DIR [configure dir or ..]
166   --program-prefix=PREFIX prepend PREFIX to installed program names
167   --program-suffix=SUFFIX append SUFFIX to installed program names
168   --program-transform-name=PROGRAM
169                           run sed PROGRAM on installed program names
170 EOF
171     cat << EOF
172 Host type:
173   --build=BUILD           configure for building on BUILD [BUILD=HOST]
174   --host=HOST             configure for HOST [guessed]
175   --target=TARGET         configure for TARGET [TARGET=HOST]
176 Features and packages:
177   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
178   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
179   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
180   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
181   --x-includes=DIR        X include files are in DIR
182   --x-libraries=DIR       X library files are in DIR
183 EOF
184 cat <<\EOF
185 --enable and --with options recognized:
186   --enable-warnings       test: turn on gcc compiler warnings
187   --with-curses-dir=DIR   directory in which (n)curses is installed
188   --with-5lib             use SunOS sysv-libraries
189   --with-ncursesw         use wide ncurses-libraries (installed)
190   --with-ncurses          use ncurses-libraries (installed)
191   --with-pdcurses         compile/link with pdcurses X11 library
192   --with-x                use the X Window System
193   --with-Xaw3d            link with Xaw 3d library
194   --with-neXtaw           link with neXT Athena library
195   --with-XawPlus          link with Athena-Plus library
196 EOF
197     exit 0 ;;
198
199   -host | --host | --hos | --ho)
200     ac_prev=host ;;
201   -host=* | --host=* | --hos=* | --ho=*)
202     host="$ac_optarg" ;;
203
204   -includedir | --includedir | --includedi | --included | --include \
205   | --includ | --inclu | --incl | --inc)
206     ac_prev=includedir ;;
207   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
208   | --includ=* | --inclu=* | --incl=* | --inc=*)
209     includedir="$ac_optarg" ;;
210
211   -infodir | --infodir | --infodi | --infod | --info | --inf)
212     ac_prev=infodir ;;
213   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
214     infodir="$ac_optarg" ;;
215
216   -libdir | --libdir | --libdi | --libd)
217     ac_prev=libdir ;;
218   -libdir=* | --libdir=* | --libdi=* | --libd=*)
219     libdir="$ac_optarg" ;;
220
221   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
222   | --libexe | --libex | --libe)
223     ac_prev=libexecdir ;;
224   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
225   | --libexe=* | --libex=* | --libe=*)
226     libexecdir="$ac_optarg" ;;
227
228   -localstatedir | --localstatedir | --localstatedi | --localstated \
229   | --localstate | --localstat | --localsta | --localst \
230   | --locals | --local | --loca | --loc | --lo)
231     ac_prev=localstatedir ;;
232   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
233   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
234   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
235     localstatedir="$ac_optarg" ;;
236
237   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
238     ac_prev=mandir ;;
239   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
240     mandir="$ac_optarg" ;;
241
242   -nfp | --nfp | --nf)
243     # Obsolete; use --without-fp.
244     with_fp=no ;;
245
246   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
247   | --no-cr | --no-c)
248     no_create=yes ;;
249
250   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
251   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
252     no_recursion=yes ;;
253
254   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
255   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
256   | --oldin | --oldi | --old | --ol | --o)
257     ac_prev=oldincludedir ;;
258   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
259   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
260   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
261     oldincludedir="$ac_optarg" ;;
262
263   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
264     ac_prev=prefix ;;
265   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
266     prefix="$ac_optarg" ;;
267
268   -program-prefix | --program-prefix | --program-prefi | --program-pref \
269   | --program-pre | --program-pr | --program-p)
270     ac_prev=program_prefix ;;
271   -program-prefix=* | --program-prefix=* | --program-prefi=* \
272   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
273     program_prefix="$ac_optarg" ;;
274
275   -program-suffix | --program-suffix | --program-suffi | --program-suff \
276   | --program-suf | --program-su | --program-s)
277     ac_prev=program_suffix ;;
278   -program-suffix=* | --program-suffix=* | --program-suffi=* \
279   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
280     program_suffix="$ac_optarg" ;;
281
282   -program-transform-name | --program-transform-name \
283   | --program-transform-nam | --program-transform-na \
284   | --program-transform-n | --program-transform- \
285   | --program-transform | --program-transfor \
286   | --program-transfo | --program-transf \
287   | --program-trans | --program-tran \
288   | --progr-tra | --program-tr | --program-t)
289     ac_prev=program_transform_name ;;
290   -program-transform-name=* | --program-transform-name=* \
291   | --program-transform-nam=* | --program-transform-na=* \
292   | --program-transform-n=* | --program-transform-=* \
293   | --program-transform=* | --program-transfor=* \
294   | --program-transfo=* | --program-transf=* \
295   | --program-trans=* | --program-tran=* \
296   | --progr-tra=* | --program-tr=* | --program-t=*)
297     program_transform_name="$ac_optarg" ;;
298
299   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
300   | -silent | --silent | --silen | --sile | --sil)
301     silent=yes ;;
302
303   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
304     ac_prev=sbindir ;;
305   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
306   | --sbi=* | --sb=*)
307     sbindir="$ac_optarg" ;;
308
309   -sharedstatedir | --sharedstatedir | --sharedstatedi \
310   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
311   | --sharedst | --shareds | --shared | --share | --shar \
312   | --sha | --sh)
313     ac_prev=sharedstatedir ;;
314   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
315   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
316   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
317   | --sha=* | --sh=*)
318     sharedstatedir="$ac_optarg" ;;
319
320   -site | --site | --sit)
321     ac_prev=site ;;
322   -site=* | --site=* | --sit=*)
323     site="$ac_optarg" ;;
324
325   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
326     ac_prev=srcdir ;;
327   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
328     srcdir="$ac_optarg" ;;
329
330   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
331   | --syscon | --sysco | --sysc | --sys | --sy)
332     ac_prev=sysconfdir ;;
333   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
334   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
335     sysconfdir="$ac_optarg" ;;
336
337   -target | --target | --targe | --targ | --tar | --ta | --t)
338     ac_prev=target ;;
339   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
340     target="$ac_optarg" ;;
341
342   -v | -verbose | --verbose | --verbos | --verbo | --verb)
343     verbose=yes ;;
344
345   -version | --version | --versio | --versi | --vers)
346     echo "configure generated by autoconf version 2.13.20030927"
347     exit 0 ;;
348
349   -with-* | --with-*)
350     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
351     # Reject names that are not valid shell variable names.
352     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
353       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
354     fi
355     ac_package=`echo $ac_package| sed 's/-/_/g'`
356     case "$ac_option" in
357       *=*) ;;
358       *) ac_optarg=yes ;;
359     esac
360     eval "with_${ac_package}='$ac_optarg'" ;;
361
362   -without-* | --without-*)
363     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
364     # Reject names that are not valid shell variable names.
365     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
366       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
367     fi
368     ac_package=`echo $ac_package| sed 's/-/_/g'`
369     eval "with_${ac_package}=no" ;;
370
371   --x)
372     # Obsolete; use --with-x.
373     with_x=yes ;;
374
375   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
376   | --x-incl | --x-inc | --x-in | --x-i)
377     ac_prev=x_includes ;;
378   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
379   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
380     x_includes="$ac_optarg" ;;
381
382   -x-libraries | --x-libraries | --x-librarie | --x-librari \
383   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
384     ac_prev=x_libraries ;;
385   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
386   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
387     x_libraries="$ac_optarg" ;;
388
389   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
390     ;;
391
392   *)
393     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
394       echo "configure: warning: $ac_option: invalid host type" 1>&2
395     fi
396     if test "x$nonopt" != xNONE; then
397       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
398     fi
399     nonopt="$ac_option"
400     ;;
401
402   esac
403 done
404
405 if test -n "$ac_prev"; then
406   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
407 fi
408
409 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
410
411 # File descriptor usage:
412 # 0 standard input
413 # 1 file creation
414 # 2 errors and warnings
415 # 3 some systems may open it to /dev/tty
416 # 4 used on the Kubota Titan
417 # 6 checking for... messages and results
418 # 5 compiler messages saved in config.log
419 if test "$silent" = yes; then
420   exec 6>/dev/null
421 else
422   exec 6>&1
423 fi
424 exec 5>./config.log
425
426 echo "\
427 This file contains any messages produced by compilers while
428 running configure, to aid debugging if configure makes a mistake.
429 " 1>&5
430
431 # Strip out --no-create and --no-recursion so they do not pile up.
432 # Also quote any args containing shell metacharacters.
433 ac_configure_args=
434 for ac_arg
435 do
436   case "$ac_arg" in
437   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
438   | --no-cr | --no-c) ;;
439   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
440   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
441   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
442   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
443   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
444   esac
445 done
446
447 # NLS nuisances.
448 # Only set these to C if already set.  These must not be set unconditionally
449 # because not all systems understand e.g. LANG=C (notably SCO).
450 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
451 # Non-C LC_CTYPE values break the ctype check.
452 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
453 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
454 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
455 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
456
457 # confdefs.h avoids OS command line length limits that DEFS can exceed.
458 rm -rf conftest* confdefs.h
459 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
460 echo > confdefs.h
461
462 # A filename unique to this package, relative to the directory that
463 # configure is in, which we can look for to find out if srcdir is correct.
464 ac_unique_file=ncurses.c
465
466 # Find the source files, if location was not specified.
467 if test -z "$srcdir"; then
468   ac_srcdir_defaulted=yes
469   # Try the directory containing this script, then its parent.
470   ac_prog=$0
471   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
472   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
473   srcdir=$ac_confdir
474   if test ! -r $srcdir/$ac_unique_file; then
475     srcdir=..
476   fi
477 else
478   ac_srcdir_defaulted=no
479 fi
480 if test ! -r $srcdir/$ac_unique_file; then
481   if test "$ac_srcdir_defaulted" = yes; then
482     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
483   else
484     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
485   fi
486 fi
487 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
488
489 # Prefer explicitly selected file to automatically selected ones.
490 if test -z "$CONFIG_SITE"; then
491   if test "x$prefix" != xNONE; then
492     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
493   else
494     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
495   fi
496 fi
497 for ac_site_file in $CONFIG_SITE; do
498   if test -r "$ac_site_file"; then
499     echo "loading site script $ac_site_file"
500     . "$ac_site_file"
501   fi
502 done
503
504 if test -r "$cache_file"; then
505   echo "loading cache $cache_file"
506   . $cache_file
507 else
508   echo "creating cache $cache_file"
509   > $cache_file
510 fi
511
512 ac_ext=c
513 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
514 ac_cpp='$CPP $CPPFLAGS'
515 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
516 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
517 cross_compiling=$ac_cv_prog_cc_cross
518
519 ac_exeext=
520 ac_objext=o
521 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
522   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
523   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
524     ac_n= ac_c='
525 ' ac_t='        '
526   else
527     ac_n=-n ac_c= ac_t=
528   fi
529 else
530   ac_n= ac_c='\c' ac_t=
531 fi
532
533 # If we find X, set shell vars x_includes and x_libraries to the
534 # paths, otherwise set no_x=yes.
535 # Uses ac_ vars as temps to allow command line to override cache and checks.
536 # --without-x overrides everything else, but does not touch the cache.
537 echo $ac_n "checking for X""... $ac_c" 1>&6
538 echo "configure:539: checking for X" >&5
539
540
541 # Check whether --with-x or --without-x was given.
542 if test "${with_x+set}" = set; then
543   withval="$with_x"
544   :
545 fi
546
547 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
548 if test "x$with_x" = xno; then
549   # The user explicitly disabled X.
550   have_x=disabled
551 else
552   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
553     # Both variables are already set.
554     have_x=yes
555   else
556 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
557   echo $ac_n "(cached) $ac_c" 1>&6
558 else
559   # One or both of the vars are not set, and there is no cached value.
560 ac_x_includes=NO ac_x_libraries=NO
561 rm -fr conftestdir
562 if mkdir conftestdir; then
563   cd conftestdir
564   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
565   cat > Imakefile <<'EOF'
566 acfindx:
567         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
568 EOF
569   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
570     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
571     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
572     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
573     for ac_extension in a so sl; do
574       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
575         test -f $ac_im_libdir/libX11.$ac_extension; then
576         ac_im_usrlibdir=$ac_im_libdir; break
577       fi
578     done
579     # Screen out bogus values from the imake configuration.  They are
580     # bogus both because they are the default anyway, and because
581     # using them would break gcc on systems where it needs fixed includes.
582     case "$ac_im_incroot" in
583         /usr/include) ;;
584         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
585     esac
586     case "$ac_im_usrlibdir" in
587         /usr/lib | /lib) ;;
588         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
589     esac
590   fi
591   cd ..
592   rm -fr conftestdir
593 fi
594
595 if test "$ac_x_includes" = NO; then
596   # Guess where to find include files, by looking for this one X11 .h file.
597   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
598
599   # First, try using that file with no special directory specified.
600 cat > conftest.$ac_ext <<EOF
601 #line 602 "configure"
602 #include "confdefs.h"
603 #include <$x_direct_test_include>
604 EOF
605 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
606 { (eval echo configure:607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
607 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
608 if test -z "$ac_err"; then
609   rm -rf conftest*
610   # We can compile using X headers with no special include directory.
611 ac_x_includes=
612 else
613   echo "$ac_err" >&5
614   echo "configure: failed program was:" >&5
615   cat conftest.$ac_ext >&5
616   rm -rf conftest*
617   # Look for the header file in a standard set of common directories.
618 # Check X11 before X11Rn because it is often a symlink to the current release.
619   for ac_dir in               \
620     /usr/X11/include          \
621     /usr/X11R6/include        \
622     /usr/X11R5/include        \
623     /usr/X11R4/include        \
624                               \
625     /usr/include/X11          \
626     /usr/include/X11R6        \
627     /usr/include/X11R5        \
628     /usr/include/X11R4        \
629                               \
630     /usr/local/X11/include    \
631     /usr/local/X11R6/include  \
632     /usr/local/X11R5/include  \
633     /usr/local/X11R4/include  \
634                               \
635     /usr/local/include/X11    \
636     /usr/local/include/X11R6  \
637     /usr/local/include/X11R5  \
638     /usr/local/include/X11R4  \
639                               \
640     /usr/X386/include         \
641     /usr/x386/include         \
642     /usr/XFree86/include/X11  \
643                               \
644     /usr/include              \
645     /usr/local/include        \
646     /usr/unsupported/include  \
647     /usr/athena/include       \
648     /usr/local/x11r5/include  \
649     /usr/lpp/Xamples/include  \
650                               \
651     /usr/openwin/include      \
652     /usr/openwin/share/include \
653     ; \
654   do
655     if test -r "$ac_dir/$x_direct_test_include"; then
656       ac_x_includes=$ac_dir
657       break
658     fi
659   done
660 fi
661 rm -f conftest*
662 fi # $ac_x_includes = NO
663
664 if test "$ac_x_libraries" = NO; then
665   # Check for the libraries.
666
667   test -z "$x_direct_test_library" && x_direct_test_library=Xt
668   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
669
670   # See if we find them without any special options.
671   # Don't add to $LIBS permanently.
672   ac_save_LIBS="$LIBS"
673   LIBS="-l$x_direct_test_library $LIBS"
674 cat > conftest.$ac_ext <<EOF
675 #line 676 "configure"
676 #include "confdefs.h"
677
678 int main() {
679 ${x_direct_test_function}()
680 ; return 0; }
681 EOF
682 if { (eval echo configure:683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
683   rm -rf conftest*
684   LIBS="$ac_save_LIBS"
685 # We can link X programs with no special library path.
686 ac_x_libraries=
687 else
688   echo "configure: failed program was:" >&5
689   cat conftest.$ac_ext >&5
690   rm -rf conftest*
691   LIBS="$ac_save_LIBS"
692 # First see if replacing the include by lib works.
693 # Check X11 before X11Rn because it is often a symlink to the current release.
694 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
695     /usr/X11/lib          \
696     /usr/X11R6/lib        \
697     /usr/X11R5/lib        \
698     /usr/X11R4/lib        \
699                           \
700     /usr/lib/X11          \
701     /usr/lib/X11R6        \
702     /usr/lib/X11R5        \
703     /usr/lib/X11R4        \
704                           \
705     /usr/local/X11/lib    \
706     /usr/local/X11R6/lib  \
707     /usr/local/X11R5/lib  \
708     /usr/local/X11R4/lib  \
709                           \
710     /usr/local/lib/X11    \
711     /usr/local/lib/X11R6  \
712     /usr/local/lib/X11R5  \
713     /usr/local/lib/X11R4  \
714                           \
715     /usr/X386/lib         \
716     /usr/x386/lib         \
717     /usr/XFree86/lib/X11  \
718                           \
719     /usr/lib              \
720     /usr/local/lib        \
721     /usr/unsupported/lib  \
722     /usr/athena/lib       \
723     /usr/local/x11r5/lib  \
724     /usr/lpp/Xamples/lib  \
725     /lib/usr/lib/X11      \
726                           \
727     /usr/openwin/lib      \
728     /usr/openwin/share/lib \
729     ; \
730 do
731   for ac_extension in a so sl; do
732     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
733       ac_x_libraries=$ac_dir
734       break 2
735     fi
736   done
737 done
738 fi
739 rm -f conftest*
740 fi # $ac_x_libraries = NO
741
742 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
743   # Didn't find X anywhere.  Cache the known absence of X.
744   ac_cv_have_x="have_x=no"
745 else
746   # Record where we found X for the cache.
747   ac_cv_have_x="have_x=yes \
748                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
749 fi
750 fi
751   fi
752   eval "$ac_cv_have_x"
753 fi # $with_x != no
754
755 if test "$have_x" != yes; then
756   echo "$ac_t""$have_x" 1>&6
757   no_x=yes
758 else
759   # If each of the values was on the command line, it overrides each guess.
760   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
761   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
762   # Update the cache value to reflect the command line values.
763   ac_cv_have_x="have_x=yes \
764                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
765   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
766 fi
767
768
769
770
771
772 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
773
774
775 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
776
777 ac_aux_dir=
778 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
779   if test -f $ac_dir/install-sh; then
780     ac_aux_dir=$ac_dir
781     ac_install_sh="$ac_aux_dir/install-sh -c"
782     break
783   elif test -f $ac_dir/install.sh; then
784     ac_aux_dir=$ac_dir
785     ac_install_sh="$ac_aux_dir/install.sh -c"
786     break
787   fi
788 done
789 if test -z "$ac_aux_dir"; then
790   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
791 fi
792 ac_config_guess=$ac_aux_dir/config.guess
793 ac_config_sub=$ac_aux_dir/config.sub
794 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
795
796
797 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
798         
799 # Make sure we can run config.sub.
800 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
801 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
802 fi
803
804 echo $ac_n "checking host system type""... $ac_c" 1>&6
805 echo "configure:806: checking host system type" >&5
806
807 host_alias=$host
808 case "$host_alias" in
809 NONE)
810   case $nonopt in
811   NONE)
812     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
813     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
814     fi ;;
815   *) host_alias=$nonopt ;;
816   esac ;;
817 esac
818
819 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
820 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
821 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
822 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
823 echo "$ac_t""$host" 1>&6
824
825         system_name="$host_os"
826 else
827         system_name="`(uname -s -r) 2>/dev/null`"
828         if test -z "$system_name" ; then
829                 system_name="`(hostname) 2>/dev/null`"
830         fi
831 fi
832 test -n "$system_name" && cat >> confdefs.h <<EOF
833 #define SYSTEM_NAME "$system_name"
834 EOF
835
836 if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
837   echo $ac_n "(cached) $ac_c" 1>&6
838 else
839   cf_cv_system_name="$system_name"
840 fi
841
842
843 test -z "$system_name" && system_name="$cf_cv_system_name"
844 test -n "$cf_cv_system_name" && echo "$ac_t""Configuring for $cf_cv_system_name" 1>&6
845
846 if test ".$system_name" != ".$cf_cv_system_name" ; then
847         echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
848         { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
849 fi
850
851
852 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
853 echo "configure:854: checking whether ${MAKE-make} sets \${MAKE}" >&5
854 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
855 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
856   echo $ac_n "(cached) $ac_c" 1>&6
857 else
858   cat > conftestmake <<\EOF
859 all:
860         @echo 'ac_maketemp="${MAKE}"'
861 EOF
862 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
863 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
864 if test -n "$ac_maketemp"; then
865   eval ac_cv_prog_make_${ac_make}_set=yes
866 else
867   eval ac_cv_prog_make_${ac_make}_set=no
868 fi
869 rm -f conftestmake
870 fi
871 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
872   echo "$ac_t""yes" 1>&6
873   SET_MAKE=
874 else
875   echo "$ac_t""no" 1>&6
876   SET_MAKE="MAKE=${MAKE-make}"
877 fi
878
879 # Extract the first word of "gcc", so it can be a program name with args.
880 set dummy gcc; ac_word=$2
881 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
882 echo "configure:883: checking for $ac_word" >&5
883 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
884   echo $ac_n "(cached) $ac_c" 1>&6
885 else
886   if test -n "$CC"; then
887   ac_cv_prog_CC="$CC" # Let the user override the test.
888 else
889   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
890   ac_dummy="$PATH"
891   for ac_dir in $ac_dummy; do
892     test -z "$ac_dir" && ac_dir=.
893     if test -f $ac_dir/$ac_word; then
894       ac_cv_prog_CC="gcc"
895       break
896     fi
897   done
898   IFS="$ac_save_ifs"
899 fi
900 fi
901 CC="$ac_cv_prog_CC"
902 if test -n "$CC"; then
903   echo "$ac_t""$CC" 1>&6
904 else
905   echo "$ac_t""no" 1>&6
906 fi
907
908 if test -z "$CC"; then
909   # Extract the first word of "cc", so it can be a program name with args.
910 set dummy cc; ac_word=$2
911 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
912 echo "configure:913: checking for $ac_word" >&5
913 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
914   echo $ac_n "(cached) $ac_c" 1>&6
915 else
916   if test -n "$CC"; then
917   ac_cv_prog_CC="$CC" # Let the user override the test.
918 else
919   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
920   ac_prog_rejected=no
921   ac_dummy="$PATH"
922   for ac_dir in $ac_dummy; do
923     test -z "$ac_dir" && ac_dir=.
924     if test -f $ac_dir/$ac_word; then
925       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
926         ac_prog_rejected=yes
927         continue
928       fi
929       ac_cv_prog_CC="cc"
930       break
931     fi
932   done
933   IFS="$ac_save_ifs"
934 if test $ac_prog_rejected = yes; then
935   # We found a bogon in the path, so make sure we never use it.
936   set dummy $ac_cv_prog_CC
937   shift
938   if test $# -gt 0; then
939     # We chose a different compiler from the bogus one.
940     # However, it has the same basename, so the bogon will be chosen
941     # first if we set CC to just the basename; use the full file name.
942     shift
943     set dummy "$ac_dir/$ac_word" "$@"
944     shift
945     ac_cv_prog_CC="$@"
946   fi
947 fi
948 fi
949 fi
950 CC="$ac_cv_prog_CC"
951 if test -n "$CC"; then
952   echo "$ac_t""$CC" 1>&6
953 else
954   echo "$ac_t""no" 1>&6
955 fi
956
957   if test -z "$CC"; then
958     case "`uname -s`" in
959     *win32* | *WIN32*)
960       # Extract the first word of "cl", so it can be a program name with args.
961 set dummy cl; ac_word=$2
962 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
963 echo "configure:964: checking for $ac_word" >&5
964 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
965   echo $ac_n "(cached) $ac_c" 1>&6
966 else
967   if test -n "$CC"; then
968   ac_cv_prog_CC="$CC" # Let the user override the test.
969 else
970   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
971   ac_dummy="$PATH"
972   for ac_dir in $ac_dummy; do
973     test -z "$ac_dir" && ac_dir=.
974     if test -f $ac_dir/$ac_word; then
975       ac_cv_prog_CC="cl"
976       break
977     fi
978   done
979   IFS="$ac_save_ifs"
980 fi
981 fi
982 CC="$ac_cv_prog_CC"
983 if test -n "$CC"; then
984   echo "$ac_t""$CC" 1>&6
985 else
986   echo "$ac_t""no" 1>&6
987 fi
988  ;;
989     esac
990   fi
991   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
992 fi
993
994 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
995 echo "configure:996: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
996
997 ac_ext=c
998 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
999 ac_cpp='$CPP $CPPFLAGS'
1000 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1001 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1002 cross_compiling=$ac_cv_prog_cc_cross
1003
1004 cat > conftest.$ac_ext << EOF
1005
1006 #line 1007 "configure"
1007 #include "confdefs.h"
1008
1009 main(){return(0);}
1010 EOF
1011 if { (eval echo configure:1012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1012   ac_cv_prog_cc_works=yes
1013   # If we can't run a trivial program, we are probably using a cross compiler.
1014   if (./conftest; exit) 2>/dev/null; then
1015     ac_cv_prog_cc_cross=no
1016   else
1017     ac_cv_prog_cc_cross=yes
1018   fi
1019 else
1020   echo "configure: failed program was:" >&5
1021   cat conftest.$ac_ext >&5
1022   ac_cv_prog_cc_works=no
1023 fi
1024 rm -fr conftest*
1025 ac_ext=c
1026 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1027 ac_cpp='$CPP $CPPFLAGS'
1028 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1029 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1030 cross_compiling=$ac_cv_prog_cc_cross
1031
1032 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1033 if test $ac_cv_prog_cc_works = no; then
1034   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1035 fi
1036 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1037 echo "configure:1038: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1038 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1039 cross_compiling=$ac_cv_prog_cc_cross
1040
1041 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1042 echo "configure:1043: checking whether we are using GNU C" >&5
1043 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1044   echo $ac_n "(cached) $ac_c" 1>&6
1045 else
1046   cat > conftest.c <<EOF
1047 #ifdef __GNUC__
1048   yes;
1049 #endif
1050 EOF
1051 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1052   ac_cv_prog_gcc=yes
1053 else
1054   ac_cv_prog_gcc=no
1055 fi
1056 fi
1057
1058 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1059
1060 if test $ac_cv_prog_gcc = yes; then
1061   GCC=yes
1062 else
1063   GCC=
1064 fi
1065
1066 ac_test_CFLAGS="${CFLAGS+set}"
1067 ac_save_CFLAGS="$CFLAGS"
1068 CFLAGS=
1069 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1070 echo "configure:1071: checking whether ${CC-cc} accepts -g" >&5
1071 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1072   echo $ac_n "(cached) $ac_c" 1>&6
1073 else
1074   echo 'void f(){}' > conftest.c
1075 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1076   ac_cv_prog_cc_g=yes
1077 else
1078   ac_cv_prog_cc_g=no
1079 fi
1080 rm -f conftest*
1081
1082 fi
1083
1084 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1085 if test "$ac_test_CFLAGS" = set; then
1086   CFLAGS="$ac_save_CFLAGS"
1087 elif test $ac_cv_prog_cc_g = yes; then
1088   if test "$GCC" = yes; then
1089     CFLAGS="-g -O2"
1090   else
1091     CFLAGS="-g"
1092   fi
1093 else
1094   if test "$GCC" = yes; then
1095     CFLAGS="-O2"
1096   else
1097     CFLAGS=
1098   fi
1099 fi
1100
1101 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1102 echo "configure:1103: checking how to run the C preprocessor" >&5
1103 # On Suns, sometimes $CPP names a directory.
1104 if test -n "$CPP" && test -d "$CPP"; then
1105   CPP=
1106 fi
1107 if test -z "$CPP"; then
1108 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1109   echo $ac_n "(cached) $ac_c" 1>&6
1110 else
1111     # This must be in double quotes, not single quotes, because CPP may get
1112   # substituted into the Makefile and "${CC-cc}" will confuse make.
1113   CPP="${CC-cc} -E"
1114   # On the NeXT, cc -E runs the code through the compiler's parser,
1115   # not just through cpp.
1116   cat > conftest.$ac_ext <<EOF
1117 #line 1118 "configure"
1118 #include "confdefs.h"
1119 #include <assert.h>
1120 Syntax Error
1121 EOF
1122 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1123 { (eval echo configure:1124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1124 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1125 if test -z "$ac_err"; then
1126   :
1127 else
1128   echo "$ac_err" >&5
1129   echo "configure: failed program was:" >&5
1130   cat conftest.$ac_ext >&5
1131   rm -rf conftest*
1132   CPP="${CC-cc} -E -traditional-cpp"
1133   cat > conftest.$ac_ext <<EOF
1134 #line 1135 "configure"
1135 #include "confdefs.h"
1136 #include <assert.h>
1137 Syntax Error
1138 EOF
1139 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1140 { (eval echo configure:1141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1141 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1142 if test -z "$ac_err"; then
1143   :
1144 else
1145   echo "$ac_err" >&5
1146   echo "configure: failed program was:" >&5
1147   cat conftest.$ac_ext >&5
1148   rm -rf conftest*
1149   CPP="${CC-cc} -nologo -E"
1150   cat > conftest.$ac_ext <<EOF
1151 #line 1152 "configure"
1152 #include "confdefs.h"
1153 #include <assert.h>
1154 Syntax Error
1155 EOF
1156 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1157 { (eval echo configure:1158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1158 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1159 if test -z "$ac_err"; then
1160   :
1161 else
1162   echo "$ac_err" >&5
1163   echo "configure: failed program was:" >&5
1164   cat conftest.$ac_ext >&5
1165   rm -rf conftest*
1166   CPP=/lib/cpp
1167 fi
1168 rm -f conftest*
1169 fi
1170 rm -f conftest*
1171 fi
1172 rm -f conftest*
1173   ac_cv_prog_CPP="$CPP"
1174 fi
1175   CPP="$ac_cv_prog_CPP"
1176 else
1177   ac_cv_prog_CPP="$CPP"
1178 fi
1179 echo "$ac_t""$CPP" 1>&6
1180
1181 for ac_prog in mawk gawk nawk awk
1182 do
1183 # Extract the first word of "$ac_prog", so it can be a program name with args.
1184 set dummy $ac_prog; ac_word=$2
1185 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1186 echo "configure:1187: checking for $ac_word" >&5
1187 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
1188   echo $ac_n "(cached) $ac_c" 1>&6
1189 else
1190   if test -n "$AWK"; then
1191   ac_cv_prog_AWK="$AWK" # Let the user override the test.
1192 else
1193   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1194   ac_dummy="$PATH"
1195   for ac_dir in $ac_dummy; do
1196     test -z "$ac_dir" && ac_dir=.
1197     if test -f $ac_dir/$ac_word; then
1198       ac_cv_prog_AWK="$ac_prog"
1199       break
1200     fi
1201   done
1202   IFS="$ac_save_ifs"
1203 fi
1204 fi
1205 AWK="$ac_cv_prog_AWK"
1206 if test -n "$AWK"; then
1207   echo "$ac_t""$AWK" 1>&6
1208 else
1209   echo "$ac_t""no" 1>&6
1210 fi
1211
1212 test -n "$AWK" && break
1213 done
1214
1215
1216 CC_G_OPT="-g"                           
1217 CC_SHARED_OPTS=unknown                  
1218 CPPFLAGS="$CPPFLAGS"                    
1219 DFT_DEP_SUFFIX=""                       
1220 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`    
1221 DFT_UPR_MODEL="NORMAL"                  
1222 ECHO_LINK='@ echo linking $@ ... ;'     
1223 LD="ld"                                 
1224 LDFLAGS_SHARED=""                       
1225 LD_MODEL=""                             
1226 LD_SHARED_OPTS=""                       
1227 LIBTOOL=""                              
1228 LIB_CLEAN=""                            
1229 LIB_COMPILE=""                          
1230 LIB_LINK=""                             
1231 LINK_TESTS=""                           
1232 LINT=lint                               
1233 LINT_OPTS=""                            
1234 LOCAL_LDFLAGS=""                        
1235 MATH_LIB="-lm"                          
1236 TEST_ARGS=""                            
1237 TEST_DEPS=""                            
1238 TINFO_ARGS='$(LIBS_CURSES)'             
1239 cf_cv_abi_version=""                    
1240 cf_cv_rel_version=""                    
1241
1242 cf_cv_screen=curses
1243 cf_cv_libtype=
1244
1245 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
1246 echo "configure:1247: checking for Cygwin environment" >&5
1247 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
1248   echo $ac_n "(cached) $ac_c" 1>&6
1249 else
1250   cat > conftest.$ac_ext <<EOF
1251 #line 1252 "configure"
1252 #include "confdefs.h"
1253
1254 int main() {
1255
1256 #ifndef __CYGWIN__
1257 #define __CYGWIN__ __CYGWIN32__
1258 #endif
1259 return __CYGWIN__;
1260 ; return 0; }
1261 EOF
1262 if { (eval echo configure:1263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1263   rm -rf conftest*
1264   ac_cv_cygwin=yes
1265 else
1266   echo "configure: failed program was:" >&5
1267   cat conftest.$ac_ext >&5
1268   rm -rf conftest*
1269   ac_cv_cygwin=no
1270 fi
1271 rm -f conftest*
1272 rm -f conftest*
1273 fi
1274
1275 echo "$ac_t""$ac_cv_cygwin" 1>&6
1276 CYGWIN=
1277 test "$ac_cv_cygwin" = yes && CYGWIN=yes
1278 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
1279 echo "configure:1280: checking for mingw32 environment" >&5
1280 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
1281   echo $ac_n "(cached) $ac_c" 1>&6
1282 else
1283   cat > conftest.$ac_ext <<EOF
1284 #line 1285 "configure"
1285 #include "confdefs.h"
1286
1287 int main() {
1288 return __MINGW32__;
1289 ; return 0; }
1290 EOF
1291 if { (eval echo configure:1292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1292   rm -rf conftest*
1293   ac_cv_mingw32=yes
1294 else
1295   echo "configure: failed program was:" >&5
1296   cat conftest.$ac_ext >&5
1297   rm -rf conftest*
1298   ac_cv_mingw32=no
1299 fi
1300 rm -f conftest*
1301 rm -f conftest*
1302 fi
1303
1304 echo "$ac_t""$ac_cv_mingw32" 1>&6
1305 MINGW32=
1306 test "$ac_cv_mingw32" = yes && MINGW32=yes
1307
1308
1309 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1310 echo "configure:1311: checking for executable suffix" >&5
1311 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
1312   echo $ac_n "(cached) $ac_c" 1>&6
1313 else
1314   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
1315   ac_cv_exeext=.exe
1316 else
1317   rm -f conftest*
1318   echo 'int main () { return 0; }' > conftest.$ac_ext
1319   ac_cv_exeext=
1320   if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1321     for file in conftest.*; do
1322       case $file in
1323       *.c | *.o | *.obj) ;;
1324       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
1325       esac
1326     done
1327   else
1328     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
1329   fi
1330   rm -f conftest*
1331   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
1332 fi
1333 fi
1334
1335 EXEEXT=""
1336 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
1337 echo "$ac_t""${ac_cv_exeext}" 1>&6
1338 ac_exeext=$EXEEXT
1339
1340 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
1341 echo "configure:1342: checking for object suffix" >&5
1342 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
1343   echo $ac_n "(cached) $ac_c" 1>&6
1344 else
1345   rm -f conftest*
1346 echo 'int i = 1;' > conftest.$ac_ext
1347 if { (eval echo configure:1348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1348   for ac_file in conftest.*; do
1349     case $ac_file in
1350     *.c) ;;
1351     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
1352     esac
1353   done
1354 else
1355   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
1356 fi
1357 rm -f conftest*
1358 fi
1359
1360 echo "$ac_t""$ac_cv_objext" 1>&6
1361 OBJEXT=$ac_cv_objext
1362 ac_objext=$ac_cv_objext
1363
1364
1365
1366 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1367 echo "configure:1368: checking for ${CC-cc} option to accept ANSI C" >&5
1368 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
1369   echo $ac_n "(cached) $ac_c" 1>&6
1370 else
1371   
1372 cf_cv_ansi_cc=no
1373 cf_save_CFLAGS="$CFLAGS"
1374 cf_save_CPPFLAGS="$CPPFLAGS"
1375 # Don't try gcc -ansi; that turns off useful extensions and
1376 # breaks some systems' header files.
1377 # AIX                   -qlanglvl=ansi
1378 # Ultrix and OSF/1      -std1
1379 # HP-UX                 -Aa -D_HPUX_SOURCE
1380 # SVR4                  -Xc
1381 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
1382 for cf_arg in "-DCC_HAS_PROTOS" \
1383         "" \
1384         -qlanglvl=ansi \
1385         -std1 \
1386         -Ae \
1387         "-Aa -D_HPUX_SOURCE" \
1388         -Xc
1389 do
1390         
1391 cf_fix_cppflags=no
1392 cf_new_cflags=
1393 cf_new_cppflags=
1394 cf_new_extra_cppflags=
1395
1396 for cf_add_cflags in $cf_arg
1397 do
1398 case $cf_fix_cppflags in
1399 no)
1400         case $cf_add_cflags in #(vi
1401         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1402                 case $cf_add_cflags in
1403                 -D*)
1404                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1405
1406                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1407                         && test -z "${cf_tst_cflags}" \
1408                         && cf_fix_cppflags=yes
1409
1410                         if test $cf_fix_cppflags = yes ; then
1411                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1412                                 continue
1413                         elif test "${cf_tst_cflags}" = "\"'" ; then
1414                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1415                                 continue
1416                         fi
1417                         ;;
1418                 esac
1419                 case "$CPPFLAGS" in
1420                 *$cf_add_cflags) #(vi
1421                         ;;
1422                 *) #(vi
1423                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1424                         ;;
1425                 esac
1426                 ;;
1427         *)
1428                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1429                 ;;
1430         esac
1431         ;;
1432 yes)
1433         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1434
1435         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1436
1437         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1438         && test -z "${cf_tst_cflags}" \
1439         && cf_fix_cppflags=no
1440         ;;
1441 esac
1442 done
1443
1444 if test -n "$cf_new_cflags" ; then
1445         
1446         CFLAGS="$CFLAGS $cf_new_cflags"
1447 fi
1448
1449 if test -n "$cf_new_cppflags" ; then
1450         
1451         CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
1452 fi
1453
1454 if test -n "$cf_new_extra_cppflags" ; then
1455         
1456         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1457 fi
1458
1459
1460
1461
1462         cat > conftest.$ac_ext <<EOF
1463 #line 1464 "configure"
1464 #include "confdefs.h"
1465
1466 #ifndef CC_HAS_PROTOS
1467 #if !defined(__STDC__) || (__STDC__ != 1)
1468 choke me
1469 #endif
1470 #endif
1471
1472 int main() {
1473
1474         int test (int i, double x);
1475         struct s1 {int (*f) (int a);};
1476         struct s2 {int (*f) (double a);};
1477 ; return 0; }
1478 EOF
1479 if { (eval echo configure:1480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1480   rm -rf conftest*
1481   cf_cv_ansi_cc="$cf_arg"; break
1482 else
1483   echo "configure: failed program was:" >&5
1484   cat conftest.$ac_ext >&5
1485 fi
1486 rm -f conftest*
1487 done
1488 CFLAGS="$cf_save_CFLAGS"
1489 CPPFLAGS="$cf_save_CPPFLAGS"
1490
1491 fi
1492
1493 echo "$ac_t""$cf_cv_ansi_cc" 1>&6
1494
1495 if test "$cf_cv_ansi_cc" != "no"; then
1496 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1497         
1498 cf_fix_cppflags=no
1499 cf_new_cflags=
1500 cf_new_cppflags=
1501 cf_new_extra_cppflags=
1502
1503 for cf_add_cflags in $cf_cv_ansi_cc
1504 do
1505 case $cf_fix_cppflags in
1506 no)
1507         case $cf_add_cflags in #(vi
1508         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1509                 case $cf_add_cflags in
1510                 -D*)
1511                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1512
1513                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1514                         && test -z "${cf_tst_cflags}" \
1515                         && cf_fix_cppflags=yes
1516
1517                         if test $cf_fix_cppflags = yes ; then
1518                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1519                                 continue
1520                         elif test "${cf_tst_cflags}" = "\"'" ; then
1521                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1522                                 continue
1523                         fi
1524                         ;;
1525                 esac
1526                 case "$CPPFLAGS" in
1527                 *$cf_add_cflags) #(vi
1528                         ;;
1529                 *) #(vi
1530                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1531                         ;;
1532                 esac
1533                 ;;
1534         *)
1535                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1536                 ;;
1537         esac
1538         ;;
1539 yes)
1540         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1541
1542         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1543
1544         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1545         && test -z "${cf_tst_cflags}" \
1546         && cf_fix_cppflags=no
1547         ;;
1548 esac
1549 done
1550
1551 if test -n "$cf_new_cflags" ; then
1552         
1553         CFLAGS="$CFLAGS $cf_new_cflags"
1554 fi
1555
1556 if test -n "$cf_new_cppflags" ; then
1557         
1558         CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
1559 fi
1560
1561 if test -n "$cf_new_extra_cppflags" ; then
1562         
1563         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1564 fi
1565
1566
1567
1568
1569 else
1570         cat >> confdefs.h <<\EOF
1571 #define CC_HAS_PROTOS 1
1572 EOF
1573
1574 fi
1575 fi
1576
1577
1578 if test "$cf_cv_ansi_cc" = "no"; then
1579         { echo "configure: error: Your compiler does not appear to recognize prototypes.
1580 You have the following choices:
1581         a. adjust your compiler options
1582         b. get an up-to-date compiler
1583         c. use a wrapper such as unproto" 1>&2; exit 1; }
1584 fi
1585
1586
1587
1588 GCC_VERSION=none
1589 if test "$GCC" = yes ; then
1590         echo $ac_n "checking version of $CC""... $ac_c" 1>&6
1591 echo "configure:1592: checking version of $CC" >&5
1592         GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1593         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1594         echo "$ac_t""$GCC_VERSION" 1>&6
1595 fi
1596
1597
1598 if ( test "$GCC" = yes || test "$GXX" = yes )
1599 then
1600 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
1601 echo "configure:1602: checking if you want to turn on gcc warnings" >&5
1602
1603 # Check whether --enable-warnings or --disable-warnings was given.
1604 if test "${enable_warnings+set}" = set; then
1605   enableval="$enable_warnings"
1606   test "$enableval" != yes && enableval=no
1607   if test "$enableval" != "no" ; then
1608     with_warnings=yes 
1609   else
1610     with_warnings=no
1611   fi
1612 else
1613   enableval=no 
1614   with_warnings=no
1615   
1616 fi
1617
1618 echo "$ac_t""$with_warnings" 1>&6
1619 if test "$with_warnings" = "yes"
1620 then
1621         
1622
1623
1624 INTEL_COMPILER=no
1625
1626 if test "$GCC" = yes ; then
1627         case $host_os in
1628         linux*|gnu*)
1629                 echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
1630 echo "configure:1631: checking if this is really Intel C compiler" >&5
1631                 cf_save_CFLAGS="$CFLAGS"
1632                 CFLAGS="$CFLAGS -no-gcc"
1633                 cat > conftest.$ac_ext <<EOF
1634 #line 1635 "configure"
1635 #include "confdefs.h"
1636
1637 int main() {
1638
1639 #ifdef __INTEL_COMPILER
1640 #else
1641 make an error
1642 #endif
1643
1644 ; return 0; }
1645 EOF
1646 if { (eval echo configure:1647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1647   rm -rf conftest*
1648   INTEL_COMPILER=yes
1649 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
1650
1651 else
1652   echo "configure: failed program was:" >&5
1653   cat conftest.$ac_ext >&5
1654 fi
1655 rm -f conftest*
1656                 CFLAGS="$cf_save_CFLAGS"
1657                 echo "$ac_t""$INTEL_COMPILER" 1>&6
1658                 ;;
1659         esac
1660 fi
1661
1662
1663 cat > conftest.$ac_ext <<EOF
1664 #line 1665 "configure"
1665 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
1666 EOF
1667
1668 if test "$INTEL_COMPILER" = yes
1669 then
1670 # The "-wdXXX" options suppress warnings:
1671 # remark #1419: external declaration in primary source file
1672 # remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
1673 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
1674 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
1675 # remark #193: zero used for undefined preprocessing identifier
1676 # remark #593: variable "curs_sb_left_arrow" was set but never used
1677 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
1678 # remark #869: parameter "tw" was never referenced
1679 # remark #981: operands are evaluated in unspecified order
1680 # warning #269: invalid format string conversion
1681
1682         echo "checking for $CC warning options" 1>&6
1683 echo "configure:1684: checking for $CC warning options" >&5
1684         cf_save_CFLAGS="$CFLAGS"
1685         EXTRA_CFLAGS="-Wall"
1686         for cf_opt in  \
1687                 wd1419 \
1688                 wd1682 \
1689                 wd1683 \
1690                 wd1684 \
1691                 wd193 \
1692                 wd279 \
1693                 wd593 \
1694                 wd810 \
1695                 wd869 \
1696                 wd981
1697         do
1698                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
1699                 if { (eval echo configure:1700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1700                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
1701                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
1702                 fi
1703         done
1704         CFLAGS="$cf_save_CFLAGS"
1705
1706 elif test "$GCC" = yes
1707 then
1708         echo "checking for $CC warning options" 1>&6
1709 echo "configure:1710: checking for $CC warning options" >&5
1710         cf_save_CFLAGS="$CFLAGS"
1711         EXTRA_CFLAGS="-W -Wall"
1712         cf_warn_CONST=""
1713         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
1714         for cf_opt in \
1715                 Wbad-function-cast \
1716                 Wcast-align \
1717                 Wcast-qual \
1718                 Winline \
1719                 Wmissing-declarations \
1720                 Wmissing-prototypes \
1721                 Wnested-externs \
1722                 Wpointer-arith \
1723                 Wshadow \
1724                 Wstrict-prototypes \
1725                 Wundef $cf_warn_CONST 
1726         do
1727                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
1728                 if { (eval echo configure:1729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1729                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
1730                         case $cf_opt in #(vi
1731                         Wcast-qual) #(vi
1732                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
1733                                 ;;
1734                         Winline) #(vi
1735                                 case $GCC_VERSION in
1736                                 3.3*)
1737                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
1738
1739                                         continue;;
1740                                 esac
1741                                 ;;
1742                         esac
1743                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
1744                 fi
1745         done
1746         CFLAGS="$cf_save_CFLAGS"
1747 fi
1748 rm -f conftest*
1749
1750
1751
1752 fi
1753 fi
1754
1755
1756 if test "$GCC" = yes
1757 then
1758 cat > conftest.i <<EOF
1759 #ifndef GCC_PRINTF
1760 #define GCC_PRINTF 0
1761 #endif
1762 #ifndef GCC_SCANF
1763 #define GCC_SCANF 0
1764 #endif
1765 #ifndef GCC_NORETURN
1766 #define GCC_NORETURN /* nothing */
1767 #endif
1768 #ifndef GCC_UNUSED
1769 #define GCC_UNUSED /* nothing */
1770 #endif
1771 EOF
1772 if test "$GCC" = yes
1773 then
1774         echo "checking for $CC __attribute__ directives" 1>&6
1775 echo "configure:1776: checking for $CC __attribute__ directives" >&5
1776 cat > conftest.$ac_ext <<EOF
1777 #line 1778 "configure"
1778 #include "confdefs.h"
1779 #include "conftest.h"
1780 #include "conftest.i"
1781 #if     GCC_PRINTF
1782 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
1783 #else
1784 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
1785 #endif
1786 #if     GCC_SCANF
1787 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
1788 #else
1789 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
1790 #endif
1791 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
1792 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
1793 extern void foo(void) GCC_NORETURN;
1794 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
1795 EOF
1796         for cf_attribute in scanf printf unused noreturn
1797         do
1798                 
1799 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1800
1801                 cf_directive="__attribute__(($cf_attribute))"
1802                 echo "checking for $CC $cf_directive" 1>&5
1803                 case $cf_attribute in
1804                 scanf|printf)
1805                 cat >conftest.h <<EOF
1806 #define GCC_$cf_ATTRIBUTE 1
1807 EOF
1808                         ;;
1809                 *)
1810                 cat >conftest.h <<EOF
1811 #define GCC_$cf_ATTRIBUTE $cf_directive
1812 EOF
1813                         ;;
1814                 esac
1815                 if { (eval echo configure:1816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1816                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
1817                         cat conftest.h >>confdefs.h
1818                 fi
1819         done
1820 else
1821         fgrep define conftest.i >>confdefs.h
1822 fi
1823 rm -rf conftest*
1824 fi
1825
1826
1827 echo $ac_n "checking if $CC -U and -D options work together""... $ac_c" 1>&6
1828 echo "configure:1829: checking if $CC -U and -D options work together" >&5
1829 if eval "test \"`echo '$''{'cf_cv_cc_u_d_options'+set}'`\" = set"; then
1830   echo $ac_n "(cached) $ac_c" 1>&6
1831 else
1832   
1833         cf_save_CPPFLAGS="$CPPFLAGS"
1834         CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
1835         cat > conftest.$ac_ext <<EOF
1836 #line 1837 "configure"
1837 #include "confdefs.h"
1838
1839 int main() {
1840
1841 #ifndef U_D_OPTIONS
1842 make an undefined-error
1843 #endif
1844 #ifdef  D_U_OPTIONS
1845 make a defined-error
1846 #endif
1847         
1848 ; return 0; }
1849 EOF
1850 if { (eval echo configure:1851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1851   rm -rf conftest*
1852   
1853         cf_cv_cc_u_d_options=yes
1854 else
1855   echo "configure: failed program was:" >&5
1856   cat conftest.$ac_ext >&5
1857   rm -rf conftest*
1858   
1859         cf_cv_cc_u_d_options=no
1860 fi
1861 rm -f conftest*
1862         CPPFLAGS="$cf_save_CPPFLAGS"
1863
1864 fi
1865
1866 echo "$ac_t""$cf_cv_cc_u_d_options" 1>&6
1867
1868
1869
1870
1871
1872 cf_XOPEN_SOURCE=500
1873 cf_POSIX_C_SOURCE=199506L
1874
1875 case $host_os in #(vi
1876 aix[45]*) #(vi
1877         CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
1878         ;;
1879 freebsd*) #(vi
1880         # 5.x headers associate
1881         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
1882         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
1883         cf_POSIX_C_SOURCE=200112L
1884         cf_XOPEN_SOURCE=600
1885         CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1886         ;;
1887 hpux*) #(vi
1888         CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
1889         ;;
1890 irix[56].*) #(vi
1891         CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
1892         ;;
1893 linux*|gnu*) #(vi
1894         
1895 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
1896 echo "configure:1897: checking if we must define _GNU_SOURCE" >&5
1897 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
1898   echo $ac_n "(cached) $ac_c" 1>&6
1899 else
1900   
1901 cat > conftest.$ac_ext <<EOF
1902 #line 1903 "configure"
1903 #include "confdefs.h"
1904 #include <sys/types.h>
1905 int main() {
1906
1907 #ifndef _XOPEN_SOURCE
1908 make an error
1909 #endif
1910 ; return 0; }
1911 EOF
1912 if { (eval echo configure:1913: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1913   rm -rf conftest*
1914   cf_cv_gnu_source=no
1915 else
1916   echo "configure: failed program was:" >&5
1917   cat conftest.$ac_ext >&5
1918   rm -rf conftest*
1919   cf_save="$CPPFLAGS"
1920          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1921          cat > conftest.$ac_ext <<EOF
1922 #line 1923 "configure"
1923 #include "confdefs.h"
1924 #include <sys/types.h>
1925 int main() {
1926
1927 #ifdef _XOPEN_SOURCE
1928 make an error
1929 #endif
1930 ; return 0; }
1931 EOF
1932 if { (eval echo configure:1933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1933   rm -rf conftest*
1934   cf_cv_gnu_source=no
1935 else
1936   echo "configure: failed program was:" >&5
1937   cat conftest.$ac_ext >&5
1938   rm -rf conftest*
1939   cf_cv_gnu_source=yes
1940 fi
1941 rm -f conftest*
1942         CPPFLAGS="$cf_save"
1943         
1944 fi
1945 rm -f conftest*
1946
1947 fi
1948
1949 echo "$ac_t""$cf_cv_gnu_source" 1>&6
1950 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1951
1952         ;;
1953 mirbsd*) #(vi
1954         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
1955         ;;
1956 netbsd*) #(vi
1957         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
1958         ;;
1959 openbsd*) #(vi
1960         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
1961         ;;
1962 osf[45]*) #(vi
1963         CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
1964         ;;
1965 nto-qnx*) #(vi
1966         CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
1967         ;;
1968 sco*) #(vi
1969         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
1970         ;;
1971 solaris*) #(vi
1972         CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
1973         ;;
1974 *)
1975         echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
1976 echo "configure:1977: checking if we should define _XOPEN_SOURCE" >&5
1977 if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
1978   echo $ac_n "(cached) $ac_c" 1>&6
1979 else
1980   
1981         cat > conftest.$ac_ext <<EOF
1982 #line 1983 "configure"
1983 #include "confdefs.h"
1984 #include <sys/types.h>
1985 int main() {
1986
1987 #ifndef _XOPEN_SOURCE
1988 make an error
1989 #endif
1990 ; return 0; }
1991 EOF
1992 if { (eval echo configure:1993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1993   rm -rf conftest*
1994   cf_cv_xopen_source=no
1995 else
1996   echo "configure: failed program was:" >&5
1997   cat conftest.$ac_ext >&5
1998   rm -rf conftest*
1999   cf_save="$CPPFLAGS"
2000          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2001          cat > conftest.$ac_ext <<EOF
2002 #line 2003 "configure"
2003 #include "confdefs.h"
2004 #include <sys/types.h>
2005 int main() {
2006
2007 #ifdef _XOPEN_SOURCE
2008 make an error
2009 #endif
2010 ; return 0; }
2011 EOF
2012 if { (eval echo configure:2013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2013   rm -rf conftest*
2014   cf_cv_xopen_source=no
2015 else
2016   echo "configure: failed program was:" >&5
2017   cat conftest.$ac_ext >&5
2018   rm -rf conftest*
2019   cf_cv_xopen_source=$cf_XOPEN_SOURCE
2020 fi
2021 rm -f conftest*
2022         CPPFLAGS="$cf_save"
2023         
2024 fi
2025 rm -f conftest*
2026
2027 fi
2028
2029 echo "$ac_t""$cf_cv_xopen_source" 1>&6
2030         if test "$cf_cv_xopen_source" != no ; then
2031                 
2032 # remove _XOPEN_SOURCE symbol from $CFLAGS
2033 CFLAGS=`echo "$CFLAGS" | \
2034         sed     -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?[         ]/ /g' \
2035                 -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?$//g'`
2036
2037                 
2038 # remove _XOPEN_SOURCE symbol from $CPPFLAGS
2039 CPPFLAGS=`echo "$CPPFLAGS" | \
2040         sed     -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?[         ]/ /g' \
2041                 -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?$//g'`
2042
2043                 test "$cf_cv_cc_u_d_options" = yes && \
2044                         CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
2045                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
2046         fi
2047         
2048 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2049
2050 cf_save_CFLAGS="$CFLAGS"
2051 cf_save_CPPFLAGS="$CPPFLAGS"
2052
2053
2054 # remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS
2055 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2056         sed     -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?[         ]/ /g' \
2057                 -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?$//g'`
2058
2059
2060 # remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS
2061 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2062         sed     -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?[         ]/ /g' \
2063                 -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?$//g'`
2064
2065
2066 echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
2067 echo "configure:2068: checking if we should define _POSIX_C_SOURCE" >&5
2068 if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
2069   echo $ac_n "(cached) $ac_c" 1>&6
2070 else
2071   
2072         
2073 echo "(line 2074) testing if the symbol is already defined go no further ..." 1>&5
2074
2075         cat > conftest.$ac_ext <<EOF
2076 #line 2077 "configure"
2077 #include "confdefs.h"
2078 #include <sys/types.h>
2079 int main() {
2080
2081 #ifndef _POSIX_C_SOURCE
2082 make an error
2083 #endif
2084 ; return 0; }
2085 EOF
2086 if { (eval echo configure:2087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2087   rm -rf conftest*
2088   cf_cv_posix_c_source=no
2089 else
2090   echo "configure: failed program was:" >&5
2091   cat conftest.$ac_ext >&5
2092   rm -rf conftest*
2093   cf_want_posix_source=no
2094          case .$cf_POSIX_C_SOURCE in #(vi
2095          .[12]??*) #(vi
2096                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2097                 ;;
2098          .2) #(vi
2099                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2100                 cf_want_posix_source=yes
2101                 ;;
2102          .*)
2103                 cf_want_posix_source=yes
2104                 ;;
2105          esac
2106          if test "$cf_want_posix_source" = yes ; then
2107                 cat > conftest.$ac_ext <<EOF
2108 #line 2109 "configure"
2109 #include "confdefs.h"
2110 #include <sys/types.h>
2111 int main() {
2112
2113 #ifdef _POSIX_SOURCE
2114 make an error
2115 #endif
2116 ; return 0; }
2117 EOF
2118 if { (eval echo configure:2119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2119   :
2120 else
2121   echo "configure: failed program was:" >&5
2122   cat conftest.$ac_ext >&5
2123   rm -rf conftest*
2124   cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
2125 fi
2126 rm -f conftest*
2127          fi
2128          
2129 echo "(line 2130) testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
2130
2131          CFLAGS="$cf_trim_CFLAGS"
2132          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
2133          
2134 echo "(line 2135) testing if the second compile does not leave our definition intact error ..." 1>&5
2135
2136          cat > conftest.$ac_ext <<EOF
2137 #line 2138 "configure"
2138 #include "confdefs.h"
2139 #include <sys/types.h>
2140 int main() {
2141
2142 #ifndef _POSIX_C_SOURCE
2143 make an error
2144 #endif
2145 ; return 0; }
2146 EOF
2147 if { (eval echo configure:2148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2148   :
2149 else
2150   echo "configure: failed program was:" >&5
2151   cat conftest.$ac_ext >&5
2152   rm -rf conftest*
2153   cf_cv_posix_c_source=no
2154 fi
2155 rm -f conftest*
2156          CFLAGS="$cf_save_CFLAGS"
2157          CPPFLAGS="$cf_save_CPPFLAGS"
2158         
2159 fi
2160 rm -f conftest*
2161
2162 fi
2163
2164 echo "$ac_t""$cf_cv_posix_c_source" 1>&6
2165
2166 if test "$cf_cv_posix_c_source" != no ; then
2167         CFLAGS="$cf_trim_CFLAGS"
2168         CPPFLAGS="$cf_trim_CPPFLAGS"
2169         if test "$cf_cv_cc_u_d_options" = yes ; then
2170                 cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
2171                                 sed -e 's/-D/-U/g' -e 's/=[^    ]*//g'`
2172                 CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
2173         fi
2174         CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
2175 fi
2176
2177
2178         ;;
2179 esac
2180
2181
2182
2183
2184 # Check whether --with-curses-dir or --without-curses-dir was given.
2185 if test "${with_curses_dir+set}" = set; then
2186   withval="$with_curses_dir"
2187   
2188 if test "x$prefix" != xNONE; then
2189   cf_path_syntax="$prefix"
2190 else
2191   cf_path_syntax="$ac_default_prefix"
2192 fi
2193
2194 case ".$withval" in #(vi
2195 .\$\(*\)*|.\'*\'*) #(vi
2196   ;;
2197 ..|./*|.\\*) #(vi
2198   ;;
2199 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2200   ;;
2201 .\${*prefix}*) #(vi
2202   eval withval="$withval"
2203   case ".$withval" in #(vi
2204   .NONE/*)
2205     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2206     ;;
2207   esac
2208   ;; #(vi
2209 .no|.NONE/*)
2210   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2211   ;;
2212 *)
2213   { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
2214   ;;
2215 esac
2216
2217          cf_cv_curses_dir=$withval
2218 else
2219   cf_cv_curses_dir=no
2220 fi
2221
2222
2223
2224
2225 # Check whether --with-5lib or --without-5lib was given.
2226 if test "${with_5lib+set}" = set; then
2227   withval="$with_5lib"
2228   LIBS="-L/usr/5lib $LIBS"
2229          CPPFLAGS="$CPPFLAGS -I/usr/5include"
2230 fi
2231
2232
2233
2234 # Check whether --with-ncursesw or --without-ncursesw was given.
2235 if test "${with_ncursesw+set}" = set; then
2236   withval="$with_ncursesw"
2237   cf_cv_screen=ncursesw
2238 else
2239   
2240
2241
2242 # Check whether --with-ncurses or --without-ncurses was given.
2243 if test "${with_ncurses+set}" = set; then
2244   withval="$with_ncurses"
2245   cf_cv_screen=ncurses
2246 else
2247   
2248
2249
2250 # Check whether --with-pdcurses or --without-pdcurses was given.
2251 if test "${with_pdcurses+set}" = set; then
2252   withval="$with_pdcurses"
2253   cf_cv_screen=pdcurses
2254 fi
2255
2256 fi
2257
2258 fi
2259
2260
2261 case $cf_cv_screen in
2262 curses)
2263         
2264
2265 echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
2266 echo "configure:2267: checking for extra include directories" >&5
2267 if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
2268   echo $ac_n "(cached) $ac_c" 1>&6
2269 else
2270   
2271 cf_cv_curses_incdir=no
2272 case $host_os in #(vi
2273 hpux10.*) #(vi
2274         test -d /usr/include/curses_colr && \
2275         cf_cv_curses_incdir="-I/usr/include/curses_colr"
2276         ;;
2277 sunos3*|sunos4*)
2278         test -d /usr/5lib && \
2279         test -d /usr/5include && \
2280         cf_cv_curses_incdir="-I/usr/5include"
2281         ;;
2282 esac
2283
2284 fi
2285
2286 echo "$ac_t""$cf_cv_curses_incdir" 1>&6
2287 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
2288
2289
2290 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
2291 echo "configure:2292: checking if we have identified curses headers" >&5
2292 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
2293   echo $ac_n "(cached) $ac_c" 1>&6
2294 else
2295   
2296 cf_cv_ncurses_header=none
2297 for cf_header in \
2298         curses.h \
2299         ncurses.h \
2300         ncurses/curses.h \
2301         ncurses/ncurses.h
2302 do
2303 cat > conftest.$ac_ext <<EOF
2304 #line 2305 "configure"
2305 #include "confdefs.h"
2306 #include <${cf_header}>
2307 int main() {
2308 initscr(); tgoto("?", 0,0)
2309 ; return 0; }
2310 EOF
2311 if { (eval echo configure:2312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2312   rm -rf conftest*
2313   cf_cv_ncurses_header=$cf_header; break
2314 else
2315   echo "configure: failed program was:" >&5
2316   cat conftest.$ac_ext >&5
2317 fi
2318 rm -f conftest*
2319 done
2320
2321 fi
2322
2323 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
2324
2325 if test "$cf_cv_ncurses_header" = none ; then
2326         { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
2327 fi
2328
2329 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
2330 for ac_hdr in $cf_cv_ncurses_header
2331 do
2332 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2333 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2334 echo "configure:2335: checking for $ac_hdr" >&5
2335 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2336   echo $ac_n "(cached) $ac_c" 1>&6
2337 else
2338   cat > conftest.$ac_ext <<EOF
2339 #line 2340 "configure"
2340 #include "confdefs.h"
2341 #include <$ac_hdr>
2342 EOF
2343 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2344 { (eval echo configure:2345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2345 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2346 if test -z "$ac_err"; then
2347   rm -rf conftest*
2348   eval "ac_cv_header_$ac_safe=yes"
2349 else
2350   echo "$ac_err" >&5
2351   echo "configure: failed program was:" >&5
2352   cat conftest.$ac_ext >&5
2353   rm -rf conftest*
2354   eval "ac_cv_header_$ac_safe=no"
2355 fi
2356 rm -f conftest*
2357 fi
2358 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2359   echo "$ac_t""yes" 1>&6
2360     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2361   cat >> confdefs.h <<EOF
2362 #define $ac_tr_hdr 1
2363 EOF
2364  
2365 else
2366   echo "$ac_t""no" 1>&6
2367 fi
2368 done
2369
2370
2371
2372 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
2373 echo "configure:2374: checking for terminfo header" >&5
2374 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
2375   echo $ac_n "(cached) $ac_c" 1>&6
2376 else
2377   
2378 case ${cf_cv_ncurses_header} in #(vi
2379 */ncurses.h|*/ncursesw.h) #(vi
2380         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
2381         ;;
2382 *)
2383         cf_term_header=term.h
2384         ;;
2385 esac
2386
2387 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
2388 do
2389 cat > conftest.$ac_ext <<EOF
2390 #line 2391 "configure"
2391 #include "confdefs.h"
2392 #include <stdio.h>
2393 #include <${cf_cv_ncurses_header-curses.h}>
2394 #include <$cf_test>
2395
2396 int main() {
2397 int x = auto_left_margin
2398 ; return 0; }
2399 EOF
2400 if { (eval echo configure:2401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2401   rm -rf conftest*
2402   
2403         cf_cv_term_header="$cf_test"
2404 else
2405   echo "configure: failed program was:" >&5
2406   cat conftest.$ac_ext >&5
2407   rm -rf conftest*
2408   
2409         cf_cv_term_header=unknown
2410         
2411 fi
2412 rm -f conftest*
2413         test "$cf_cv_term_header" != unknown && break
2414 done
2415
2416 fi
2417
2418 echo "$ac_t""$cf_cv_term_header" 1>&6
2419
2420 # Set definitions to allow ifdef'ing to accommodate subdirectories
2421
2422 case $cf_cv_term_header in # (vi
2423 *term.h)
2424         cat >> confdefs.h <<\EOF
2425 #define HAVE_TERM_H 1
2426 EOF
2427
2428         ;;
2429 esac
2430
2431 case $cf_cv_term_header in # (vi
2432 ncurses/term.h) #(vi
2433         cat >> confdefs.h <<\EOF
2434 #define HAVE_NCURSES_TERM_H 1
2435 EOF
2436
2437         ;;
2438 ncursesw/term.h)
2439         cat >> confdefs.h <<\EOF
2440 #define HAVE_NCURSESW_TERM_H 1
2441 EOF
2442
2443         ;;
2444 esac
2445
2446
2447         
2448 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
2449 echo "configure:2450: checking for ncurses version" >&5
2450 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
2451   echo $ac_n "(cached) $ac_c" 1>&6
2452 else
2453   
2454         cf_cv_ncurses_version=no
2455         cf_tempfile=out$$
2456         rm -f $cf_tempfile
2457         if test "$cross_compiling" = yes; then
2458   
2459
2460         # This will not work if the preprocessor splits the line after the
2461         # Autoconf token.  The 'unproto' program does that.
2462         cat > conftest.$ac_ext <<EOF
2463 #include <${cf_cv_ncurses_header-curses.h}>
2464 #undef Autoconf
2465 #ifdef NCURSES_VERSION
2466 Autoconf NCURSES_VERSION
2467 #else
2468 #ifdef __NCURSES_H
2469 Autoconf "old"
2470 #endif
2471 ;
2472 #endif
2473 EOF
2474         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
2475         { (eval echo configure:2476: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
2476         if test -f conftest.out ; then
2477                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
2478                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
2479                 rm -f conftest.out
2480         fi
2481
2482 else
2483   cat > conftest.$ac_ext <<EOF
2484 #line 2485 "configure"
2485 #include "confdefs.h"
2486
2487 #include <${cf_cv_ncurses_header-curses.h}>
2488 #include <stdio.h>
2489 int main()
2490 {
2491         FILE *fp = fopen("$cf_tempfile", "w");
2492 #ifdef NCURSES_VERSION
2493 # ifdef NCURSES_VERSION_PATCH
2494         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
2495 # else
2496         fprintf(fp, "%s\n", NCURSES_VERSION);
2497 # endif
2498 #else
2499 # ifdef __NCURSES_H
2500         fprintf(fp, "old\n");
2501 # else
2502         make an error
2503 # endif
2504 #endif
2505         exit(0);
2506 }
2507 EOF
2508 if { (eval echo configure:2509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2509 then
2510   
2511         cf_cv_ncurses_version=`cat $cf_tempfile`
2512 else
2513   echo "configure: failed program was:" >&5
2514   cat conftest.$ac_ext >&5
2515 fi
2516 rm -fr conftest*
2517 fi
2518
2519         rm -f $cf_tempfile
2520
2521 fi
2522
2523 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
2524 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
2525 #define NCURSES 1
2526 EOF
2527
2528
2529         
2530
2531 echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
2532 echo "configure:2533: checking if we have identified curses libraries" >&5
2533 cat > conftest.$ac_ext <<EOF
2534 #line 2535 "configure"
2535 #include "confdefs.h"
2536 #include <${cf_cv_ncurses_header-curses.h}>
2537 int main() {
2538 initscr(); tgoto("?", 0,0)
2539 ; return 0; }
2540 EOF
2541 if { (eval echo configure:2542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2542   rm -rf conftest*
2543   cf_result=yes
2544 else
2545   echo "configure: failed program was:" >&5
2546   cat conftest.$ac_ext >&5
2547   rm -rf conftest*
2548   cf_result=no
2549 fi
2550 rm -f conftest*
2551 echo "$ac_t""$cf_result" 1>&6
2552
2553 if test "$cf_result" = no ; then
2554 case $host_os in #(vi
2555 freebsd*) #(vi
2556         echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
2557 echo "configure:2558: checking for tgoto in -lmytinfo" >&5
2558 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
2559 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2560   echo $ac_n "(cached) $ac_c" 1>&6
2561 else
2562   ac_save_LIBS="$LIBS"
2563 LIBS="-lmytinfo  $LIBS"
2564 cat > conftest.$ac_ext <<EOF
2565 #line 2566 "configure"
2566 #include "confdefs.h"
2567 /* Override any gcc2 internal prototype to avoid an error.  */
2568 /* We use char because int might match the return type of a gcc2
2569     builtin and then its argument prototype would still apply.  */
2570 char tgoto();
2571
2572 int main() {
2573 tgoto()
2574 ; return 0; }
2575 EOF
2576 if { (eval echo configure:2577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2577   rm -rf conftest*
2578   eval "ac_cv_lib_$ac_lib_var=yes"
2579 else
2580   echo "configure: failed program was:" >&5
2581   cat conftest.$ac_ext >&5
2582   rm -rf conftest*
2583   eval "ac_cv_lib_$ac_lib_var=no"
2584 fi
2585 rm -f conftest*
2586 LIBS="$ac_save_LIBS"
2587
2588 fi
2589 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2590   echo "$ac_t""yes" 1>&6
2591   LIBS="-lmytinfo $LIBS"
2592 else
2593   echo "$ac_t""no" 1>&6
2594 fi
2595
2596         ;;
2597 hpux10.*) #(vi
2598         echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
2599 echo "configure:2600: checking for initscr in -lcur_colr" >&5
2600 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
2601 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2602   echo $ac_n "(cached) $ac_c" 1>&6
2603 else
2604   ac_save_LIBS="$LIBS"
2605 LIBS="-lcur_colr  $LIBS"
2606 cat > conftest.$ac_ext <<EOF
2607 #line 2608 "configure"
2608 #include "confdefs.h"
2609 /* Override any gcc2 internal prototype to avoid an error.  */
2610 /* We use char because int might match the return type of a gcc2
2611     builtin and then its argument prototype would still apply.  */
2612 char initscr();
2613
2614 int main() {
2615 initscr()
2616 ; return 0; }
2617 EOF
2618 if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2619   rm -rf conftest*
2620   eval "ac_cv_lib_$ac_lib_var=yes"
2621 else
2622   echo "configure: failed program was:" >&5
2623   cat conftest.$ac_ext >&5
2624   rm -rf conftest*
2625   eval "ac_cv_lib_$ac_lib_var=no"
2626 fi
2627 rm -f conftest*
2628 LIBS="$ac_save_LIBS"
2629
2630 fi
2631 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2632   echo "$ac_t""yes" 1>&6
2633   
2634                 LIBS="-lcur_colr $LIBS"
2635                 ac_cv_func_initscr=yes
2636                 
2637 else
2638   echo "$ac_t""no" 1>&6
2639
2640         echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
2641 echo "configure:2642: checking for initscr in -lHcurses" >&5
2642 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
2643 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2644   echo $ac_n "(cached) $ac_c" 1>&6
2645 else
2646   ac_save_LIBS="$LIBS"
2647 LIBS="-lHcurses  $LIBS"
2648 cat > conftest.$ac_ext <<EOF
2649 #line 2650 "configure"
2650 #include "confdefs.h"
2651 /* Override any gcc2 internal prototype to avoid an error.  */
2652 /* We use char because int might match the return type of a gcc2
2653     builtin and then its argument prototype would still apply.  */
2654 char initscr();
2655
2656 int main() {
2657 initscr()
2658 ; return 0; }
2659 EOF
2660 if { (eval echo configure:2661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2661   rm -rf conftest*
2662   eval "ac_cv_lib_$ac_lib_var=yes"
2663 else
2664   echo "configure: failed program was:" >&5
2665   cat conftest.$ac_ext >&5
2666   rm -rf conftest*
2667   eval "ac_cv_lib_$ac_lib_var=no"
2668 fi
2669 rm -f conftest*
2670 LIBS="$ac_save_LIBS"
2671
2672 fi
2673 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2674   echo "$ac_t""yes" 1>&6
2675   
2676                 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
2677                 LIBS="-lHcurses $LIBS"
2678                 CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
2679                 ac_cv_func_initscr=yes
2680                 
2681 else
2682   echo "$ac_t""no" 1>&6
2683 fi
2684
2685 fi
2686
2687         ;;
2688 linux*) # Suse Linux does not follow /usr/lib convention
2689         LIBS="$LIBS -L/lib"
2690         ;;
2691 sunos3*|sunos4*)
2692         test -d /usr/5lib && \
2693         LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
2694         ac_cv_func_initscr=yes
2695         ;;
2696 esac
2697
2698 if test ".$ac_cv_func_initscr" != .yes ; then
2699         cf_save_LIBS="$LIBS"
2700         cf_term_lib=""
2701         cf_curs_lib=""
2702
2703         if test ".${cf_cv_ncurses_version-no}" != .no
2704         then
2705                 cf_check_list="ncurses curses cursesX"
2706         else
2707                 cf_check_list="cursesX curses ncurses"
2708         fi
2709
2710         # Check for library containing tgoto.  Do this before curses library
2711         # because it may be needed to link the test-case for initscr.
2712         echo $ac_n "checking for tgoto""... $ac_c" 1>&6
2713 echo "configure:2714: checking for tgoto" >&5
2714 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
2715   echo $ac_n "(cached) $ac_c" 1>&6
2716 else
2717   cat > conftest.$ac_ext <<EOF
2718 #line 2719 "configure"
2719 #include "confdefs.h"
2720 /* System header to define __stub macros and hopefully few prototypes,
2721     which can conflict with char tgoto(); below.  */
2722 #include <assert.h>
2723 /* Override any gcc2 internal prototype to avoid an error.  */
2724 /* We use char because int might match the return type of a gcc2
2725     builtin and then its argument prototype would still apply.  */
2726 char tgoto();
2727
2728 int main() {
2729
2730 /* The GNU C library defines this for functions which it implements
2731     to always fail with ENOSYS.  Some functions are actually named
2732     something starting with __ and the normal name is an alias.  */
2733 #if defined (__stub_tgoto) || defined (__stub___tgoto)
2734 choke me
2735 #else
2736 tgoto();
2737 #endif
2738
2739 ; return 0; }
2740 EOF
2741 if { (eval echo configure:2742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2742   rm -rf conftest*
2743   eval "ac_cv_func_tgoto=yes"
2744 else
2745   echo "configure: failed program was:" >&5
2746   cat conftest.$ac_ext >&5
2747   rm -rf conftest*
2748   eval "ac_cv_func_tgoto=no"
2749 fi
2750 rm -f conftest*
2751 fi
2752
2753 if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
2754   echo "$ac_t""yes" 1>&6
2755   cf_term_lib=predefined
2756 else
2757   echo "$ac_t""no" 1>&6
2758
2759                 for cf_term_lib in $cf_check_list termcap termlib unknown
2760                 do
2761                         echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
2762 echo "configure:2763: checking for tgoto in -l$cf_term_lib" >&5
2763 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
2764 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2765   echo $ac_n "(cached) $ac_c" 1>&6
2766 else
2767   ac_save_LIBS="$LIBS"
2768 LIBS="-l$cf_term_lib  $LIBS"
2769 cat > conftest.$ac_ext <<EOF
2770 #line 2771 "configure"
2771 #include "confdefs.h"
2772 /* Override any gcc2 internal prototype to avoid an error.  */
2773 /* We use char because int might match the return type of a gcc2
2774     builtin and then its argument prototype would still apply.  */
2775 char tgoto();
2776
2777 int main() {
2778 tgoto()
2779 ; return 0; }
2780 EOF
2781 if { (eval echo configure:2782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2782   rm -rf conftest*
2783   eval "ac_cv_lib_$ac_lib_var=yes"
2784 else
2785   echo "configure: failed program was:" >&5
2786   cat conftest.$ac_ext >&5
2787   rm -rf conftest*
2788   eval "ac_cv_lib_$ac_lib_var=no"
2789 fi
2790 rm -f conftest*
2791 LIBS="$ac_save_LIBS"
2792
2793 fi
2794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2795   echo "$ac_t""yes" 1>&6
2796   break
2797 else
2798   echo "$ac_t""no" 1>&6
2799 fi
2800
2801                 done
2802         
2803 fi
2804
2805
2806         # Check for library containing initscr
2807         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
2808         for cf_curs_lib in $cf_check_list xcurses jcurses unknown
2809         do
2810                 echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
2811 echo "configure:2812: checking for initscr in -l$cf_curs_lib" >&5
2812 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
2813 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2814   echo $ac_n "(cached) $ac_c" 1>&6
2815 else
2816   ac_save_LIBS="$LIBS"
2817 LIBS="-l$cf_curs_lib  $LIBS"
2818 cat > conftest.$ac_ext <<EOF
2819 #line 2820 "configure"
2820 #include "confdefs.h"
2821 /* Override any gcc2 internal prototype to avoid an error.  */
2822 /* We use char because int might match the return type of a gcc2
2823     builtin and then its argument prototype would still apply.  */
2824 char initscr();
2825
2826 int main() {
2827 initscr()
2828 ; return 0; }
2829 EOF
2830 if { (eval echo configure:2831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2831   rm -rf conftest*
2832   eval "ac_cv_lib_$ac_lib_var=yes"
2833 else
2834   echo "configure: failed program was:" >&5
2835   cat conftest.$ac_ext >&5
2836   rm -rf conftest*
2837   eval "ac_cv_lib_$ac_lib_var=no"
2838 fi
2839 rm -f conftest*
2840 LIBS="$ac_save_LIBS"
2841
2842 fi
2843 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2844   echo "$ac_t""yes" 1>&6
2845   break
2846 else
2847   echo "$ac_t""no" 1>&6
2848 fi
2849
2850         done
2851         test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
2852
2853         LIBS="-l$cf_curs_lib $cf_save_LIBS"
2854         if test "$cf_term_lib" = unknown ; then
2855                 echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
2856 echo "configure:2857: checking if we can link with $cf_curs_lib library" >&5
2857                 cat > conftest.$ac_ext <<EOF
2858 #line 2859 "configure"
2859 #include "confdefs.h"
2860 #include <${cf_cv_ncurses_header-curses.h}>
2861 int main() {
2862 initscr()
2863 ; return 0; }
2864 EOF
2865 if { (eval echo configure:2866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2866   rm -rf conftest*
2867   cf_result=yes
2868 else
2869   echo "configure: failed program was:" >&5
2870   cat conftest.$ac_ext >&5
2871   rm -rf conftest*
2872   cf_result=no
2873 fi
2874 rm -f conftest*
2875                 echo "$ac_t""$cf_result" 1>&6
2876                 test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
2877         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
2878                 :
2879         elif test "$cf_term_lib" != predefined ; then
2880                 echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
2881 echo "configure:2882: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
2882                 cat > conftest.$ac_ext <<EOF
2883 #line 2884 "configure"
2884 #include "confdefs.h"
2885 #include <${cf_cv_ncurses_header-curses.h}>
2886 int main() {
2887 initscr(); tgoto((char *)0, 0, 0);
2888 ; return 0; }
2889 EOF
2890 if { (eval echo configure:2891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2891   rm -rf conftest*
2892   cf_result=no
2893 else
2894   echo "configure: failed program was:" >&5
2895   cat conftest.$ac_ext >&5
2896   rm -rf conftest*
2897   
2898                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
2899                         cat > conftest.$ac_ext <<EOF
2900 #line 2901 "configure"
2901 #include "confdefs.h"
2902 #include <${cf_cv_ncurses_header-curses.h}>
2903 int main() {
2904 initscr()
2905 ; return 0; }
2906 EOF
2907 if { (eval echo configure:2908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2908   rm -rf conftest*
2909   cf_result=yes
2910 else
2911   echo "configure: failed program was:" >&5
2912   cat conftest.$ac_ext >&5
2913   rm -rf conftest*
2914   cf_result=error
2915 fi
2916 rm -f conftest*
2917                         
2918 fi
2919 rm -f conftest*
2920                 echo "$ac_t""$cf_result" 1>&6
2921         fi
2922 fi
2923 fi
2924
2925
2926         ;;
2927 ncurses)
2928         
2929
2930 cf_ncuhdr_root=ncurses
2931
2932 test -n "$cf_cv_curses_dir" && \
2933 test "$cf_cv_curses_dir" != "no" && \
2934 CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
2935
2936 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
2937 echo "configure:2938: checking for $cf_ncuhdr_root header in include-path" >&5
2938 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
2939   echo $ac_n "(cached) $ac_c" 1>&6
2940 else
2941   
2942         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
2943         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
2944         for cf_header in $cf_header_list
2945         do
2946                 
2947         cat > conftest.$ac_ext <<EOF
2948 #line 2949 "configure"
2949 #include "confdefs.h"
2950
2951
2952 #include <$cf_header>
2953 int main() {
2954
2955 #ifdef NCURSES_VERSION
2956
2957 printf("%s\n", NCURSES_VERSION);
2958 #else
2959 #ifdef __NCURSES_H
2960 printf("old\n");
2961 #else
2962         make an error
2963 #endif
2964 #endif
2965         
2966         
2967 ; return 0; }
2968 EOF
2969 if { (eval echo configure:2970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2970   rm -rf conftest*
2971   cf_cv_ncurses_h=$cf_header
2972         
2973 else
2974   echo "configure: failed program was:" >&5
2975   cat conftest.$ac_ext >&5
2976   rm -rf conftest*
2977   cf_cv_ncurses_h=no
2978 fi
2979 rm -f conftest*
2980
2981                 test "$cf_cv_ncurses_h" != no && break
2982         done
2983
2984 fi
2985
2986 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
2987
2988
2989
2990 if test "$cf_cv_ncurses_h" != no ; then
2991         cf_cv_ncurses_header=$cf_cv_ncurses_h
2992 else
2993
2994 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
2995 echo "configure:2996: checking for $cf_ncuhdr_root include-path" >&5
2996 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
2997   echo $ac_n "(cached) $ac_c" 1>&6
2998 else
2999   
3000         test -n "$verbose" && echo
3001         cf_search=""
3002
3003 test -d "$HOME" && {
3004         test -n "$verbose" && echo "    ... testing include-directories under $HOME"
3005         test -d "$HOME/include" &&          cf_search="$cf_search $HOME/include"
3006         test -d "$HOME/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
3007         test -d "$HOME/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
3008 }
3009
3010 # For other stuff under the home directory, it should be sufficient to put
3011 # a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
3012 test -d "$HOME/$cf_ncuhdr_root" && {
3013         test -n "$verbose" && echo "    ... testing include-directories under $HOME/$cf_ncuhdr_root"
3014         test -d "$HOME/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
3015         test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3016 }
3017
3018 test "$prefix" != /usr/local && \
3019 test -d /usr/local && {
3020         test -n "$verbose" && echo "    ... testing include-directories under /usr/local"
3021         test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
3022         test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
3023         test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
3024         test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
3025         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3026 }
3027
3028 test "$prefix" != NONE && \
3029 test -d $prefix && {
3030         test -n "$verbose" && echo "    ... testing include-directories under $prefix"
3031         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3032         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
3033         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
3034         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
3035         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3036 }
3037
3038 test "$prefix" != /opt && \
3039 test -d /opt && {
3040         test -n "$verbose" && echo "    ... testing include-directories under /opt"
3041         test -d /opt/include &&             cf_search="$cf_search /opt/include"
3042         test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
3043         test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
3044         test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
3045         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3046 }
3047
3048 test "$prefix" != /usr && \
3049 test -d /usr && {
3050         test -n "$verbose" && echo "    ... testing include-directories under /usr"
3051         test -d /usr/include &&             cf_search="$cf_search /usr/include"
3052         test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
3053         test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
3054         test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
3055 }
3056
3057 test "$includedir" != NONE && \
3058 test "$includedir" != "/usr/include" && \
3059 test -d "$includedir" && {
3060         test -d $includedir &&    cf_search="$cf_search $includedir"
3061         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
3062 }
3063
3064 test "$oldincludedir" != NONE && \
3065 test "$oldincludedir" != "/usr/include" && \
3066 test -d "$oldincludedir" && {
3067         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3068         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
3069 }
3070
3071
3072         test -n "$verbose" && echo search path $cf_search
3073         cf_save2_CPPFLAGS="$CPPFLAGS"
3074         for cf_incdir in $cf_search
3075         do
3076                 
3077 for cf_add_incdir in $cf_incdir
3078 do
3079         while true
3080         do
3081                 case $cf_add_incdir in
3082                 /usr/include) # (vi
3083                         ;;
3084                 /usr/local/include) # (vi
3085                         if test "$GCC" = yes
3086                         then
3087                                 cf_save_CPPFLAGS="$CPPFLAGS"
3088                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3089                                 cat > conftest.$ac_ext <<EOF
3090 #line 3091 "configure"
3091 #include "confdefs.h"
3092 #include <stdio.h>
3093 int main() {
3094 printf("Hello")
3095 ; return 0; }
3096 EOF
3097 if { (eval echo configure:3098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3098   :
3099 else
3100   echo "configure: failed program was:" >&5
3101   cat conftest.$ac_ext >&5
3102   rm -rf conftest*
3103   CPPFLAGS="$cf_save_CPPFLAGS"
3104 fi
3105 rm -f conftest*
3106                         fi
3107                         ;;
3108                 *) # (vi
3109                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3110                         ;;
3111                 esac
3112                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3113                 test "$cf_top_incdir" = "$cf_add_incdir" && break
3114                 cf_add_incdir="$cf_top_incdir"
3115         done
3116 done
3117
3118                 for cf_header in \
3119                         ncurses.h \
3120                         curses.h
3121                 do
3122                         
3123         cat > conftest.$ac_ext <<EOF
3124 #line 3125 "configure"
3125 #include "confdefs.h"
3126
3127
3128 #include <$cf_header>
3129 int main() {
3130
3131 #ifdef NCURSES_VERSION
3132
3133 printf("%s\n", NCURSES_VERSION);
3134 #else
3135 #ifdef __NCURSES_H
3136 printf("old\n");
3137 #else
3138         make an error
3139 #endif
3140 #endif
3141         
3142         
3143 ; return 0; }
3144 EOF
3145 if { (eval echo configure:3146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3146   rm -rf conftest*
3147   cf_cv_ncurses_h2=$cf_header
3148         
3149 else
3150   echo "configure: failed program was:" >&5
3151   cat conftest.$ac_ext >&5
3152   rm -rf conftest*
3153   cf_cv_ncurses_h2=no
3154 fi
3155 rm -f conftest*
3156
3157                         if test "$cf_cv_ncurses_h2" != no ; then
3158                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
3159                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
3160                                 break
3161                         fi
3162                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
3163                 done
3164                 CPPFLAGS="$cf_save2_CPPFLAGS"
3165                 test "$cf_cv_ncurses_h2" != no && break
3166         done
3167         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
3168         
3169 fi
3170
3171 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
3172
3173         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
3174         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
3175         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
3176                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
3177         fi
3178         
3179 for cf_add_incdir in $cf_1st_incdir
3180 do
3181         while true
3182         do
3183                 case $cf_add_incdir in
3184                 /usr/include) # (vi
3185                         ;;
3186                 /usr/local/include) # (vi
3187                         if test "$GCC" = yes
3188                         then
3189                                 cf_save_CPPFLAGS="$CPPFLAGS"
3190                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3191                                 cat > conftest.$ac_ext <<EOF
3192 #line 3193 "configure"
3193 #include "confdefs.h"
3194 #include <stdio.h>
3195 int main() {
3196 printf("Hello")
3197 ; return 0; }
3198 EOF
3199 if { (eval echo configure:3200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3200   :
3201 else
3202   echo "configure: failed program was:" >&5
3203   cat conftest.$ac_ext >&5
3204   rm -rf conftest*
3205   CPPFLAGS="$cf_save_CPPFLAGS"
3206 fi
3207 rm -f conftest*
3208                         fi
3209                         ;;
3210                 *) # (vi
3211                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3212                         ;;
3213                 esac
3214                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3215                 test "$cf_top_incdir" = "$cf_add_incdir" && break
3216                 cf_add_incdir="$cf_top_incdir"
3217         done
3218 done
3219
3220
3221 fi
3222
3223 # Set definitions to allow ifdef'ing for ncurses.h
3224
3225 case $cf_cv_ncurses_header in # (vi
3226 *ncurses.h)
3227         cat >> confdefs.h <<\EOF
3228 #define HAVE_NCURSES_H 1
3229 EOF
3230
3231         ;;
3232 esac
3233
3234 case $cf_cv_ncurses_header in # (vi
3235 ncurses/curses.h|ncurses/ncurses.h)
3236         cat >> confdefs.h <<\EOF
3237 #define HAVE_NCURSES_NCURSES_H 1
3238 EOF
3239
3240         ;;
3241 ncursesw/curses.h|ncursesw/ncurses.h)
3242         cat >> confdefs.h <<\EOF
3243 #define HAVE_NCURSESW_NCURSES_H 1
3244 EOF
3245
3246         ;;
3247 esac
3248
3249
3250
3251 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
3252 echo "configure:3253: checking for terminfo header" >&5
3253 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
3254   echo $ac_n "(cached) $ac_c" 1>&6
3255 else
3256   
3257 case ${cf_cv_ncurses_header} in #(vi
3258 */ncurses.h|*/ncursesw.h) #(vi
3259         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
3260         ;;
3261 *)
3262         cf_term_header=term.h
3263         ;;
3264 esac
3265
3266 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
3267 do
3268 cat > conftest.$ac_ext <<EOF
3269 #line 3270 "configure"
3270 #include "confdefs.h"
3271 #include <stdio.h>
3272 #include <${cf_cv_ncurses_header-curses.h}>
3273 #include <$cf_test>
3274
3275 int main() {
3276 int x = auto_left_margin
3277 ; return 0; }
3278 EOF
3279 if { (eval echo configure:3280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3280   rm -rf conftest*
3281   
3282         cf_cv_term_header="$cf_test"
3283 else
3284   echo "configure: failed program was:" >&5
3285   cat conftest.$ac_ext >&5
3286   rm -rf conftest*
3287   
3288         cf_cv_term_header=unknown
3289         
3290 fi
3291 rm -f conftest*
3292         test "$cf_cv_term_header" != unknown && break
3293 done
3294
3295 fi
3296
3297 echo "$ac_t""$cf_cv_term_header" 1>&6
3298
3299 # Set definitions to allow ifdef'ing to accommodate subdirectories
3300
3301 case $cf_cv_term_header in # (vi
3302 *term.h)
3303         cat >> confdefs.h <<\EOF
3304 #define HAVE_TERM_H 1
3305 EOF
3306
3307         ;;
3308 esac
3309
3310 case $cf_cv_term_header in # (vi
3311 ncurses/term.h) #(vi
3312         cat >> confdefs.h <<\EOF
3313 #define HAVE_NCURSES_TERM_H 1
3314 EOF
3315
3316         ;;
3317 ncursesw/term.h)
3318         cat >> confdefs.h <<\EOF
3319 #define HAVE_NCURSESW_TERM_H 1
3320 EOF
3321
3322         ;;
3323 esac
3324
3325
3326 # some applications need this, but should check for NCURSES_VERSION
3327 cat >> confdefs.h <<\EOF
3328 #define NCURSES 1
3329 EOF
3330
3331
3332
3333 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
3334 echo "configure:3335: checking for ncurses version" >&5
3335 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
3336   echo $ac_n "(cached) $ac_c" 1>&6
3337 else
3338   
3339         cf_cv_ncurses_version=no
3340         cf_tempfile=out$$
3341         rm -f $cf_tempfile
3342         if test "$cross_compiling" = yes; then
3343   
3344
3345         # This will not work if the preprocessor splits the line after the
3346         # Autoconf token.  The 'unproto' program does that.
3347         cat > conftest.$ac_ext <<EOF
3348 #include <${cf_cv_ncurses_header-curses.h}>
3349 #undef Autoconf
3350 #ifdef NCURSES_VERSION
3351 Autoconf NCURSES_VERSION
3352 #else
3353 #ifdef __NCURSES_H
3354 Autoconf "old"
3355 #endif
3356 ;
3357 #endif
3358 EOF
3359         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
3360         { (eval echo configure:3361: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
3361         if test -f conftest.out ; then
3362                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
3363                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
3364                 rm -f conftest.out
3365         fi
3366
3367 else
3368   cat > conftest.$ac_ext <<EOF
3369 #line 3370 "configure"
3370 #include "confdefs.h"
3371
3372 #include <${cf_cv_ncurses_header-curses.h}>
3373 #include <stdio.h>
3374 int main()
3375 {
3376         FILE *fp = fopen("$cf_tempfile", "w");
3377 #ifdef NCURSES_VERSION
3378 # ifdef NCURSES_VERSION_PATCH
3379         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
3380 # else
3381         fprintf(fp, "%s\n", NCURSES_VERSION);
3382 # endif
3383 #else
3384 # ifdef __NCURSES_H
3385         fprintf(fp, "old\n");
3386 # else
3387         make an error
3388 # endif
3389 #endif
3390         exit(0);
3391 }
3392 EOF
3393 if { (eval echo configure:3394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3394 then
3395   
3396         cf_cv_ncurses_version=`cat $cf_tempfile`
3397 else
3398   echo "configure: failed program was:" >&5
3399   cat conftest.$ac_ext >&5
3400 fi
3401 rm -fr conftest*
3402 fi
3403
3404         rm -f $cf_tempfile
3405
3406 fi
3407
3408 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
3409 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
3410 #define NCURSES 1
3411 EOF
3412
3413
3414
3415         
3416
3417 cf_nculib_root=ncurses
3418         # This works, except for the special case where we find gpm, but
3419         # ncurses is in a nonstandard location via $LIBS, and we really want
3420         # to link gpm.
3421 cf_ncurses_LIBS=""
3422 cf_ncurses_SAVE="$LIBS"
3423 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
3424 echo "configure:3425: checking for Gpm_Open in -lgpm" >&5
3425 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
3426 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3427   echo $ac_n "(cached) $ac_c" 1>&6
3428 else
3429   ac_save_LIBS="$LIBS"
3430 LIBS="-lgpm  $LIBS"
3431 cat > conftest.$ac_ext <<EOF
3432 #line 3433 "configure"
3433 #include "confdefs.h"
3434 /* Override any gcc2 internal prototype to avoid an error.  */
3435 /* We use char because int might match the return type of a gcc2
3436     builtin and then its argument prototype would still apply.  */
3437 char Gpm_Open();
3438
3439 int main() {
3440 Gpm_Open()
3441 ; return 0; }
3442 EOF
3443 if { (eval echo configure:3444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3444   rm -rf conftest*
3445   eval "ac_cv_lib_$ac_lib_var=yes"
3446 else
3447   echo "configure: failed program was:" >&5
3448   cat conftest.$ac_ext >&5
3449   rm -rf conftest*
3450   eval "ac_cv_lib_$ac_lib_var=no"
3451 fi
3452 rm -f conftest*
3453 LIBS="$ac_save_LIBS"
3454
3455 fi
3456 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3457   echo "$ac_t""yes" 1>&6
3458   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
3459 echo "configure:3460: checking for initscr in -lgpm" >&5
3460 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
3461 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3462   echo $ac_n "(cached) $ac_c" 1>&6
3463 else
3464   ac_save_LIBS="$LIBS"
3465 LIBS="-lgpm  $LIBS"
3466 cat > conftest.$ac_ext <<EOF
3467 #line 3468 "configure"
3468 #include "confdefs.h"
3469 /* Override any gcc2 internal prototype to avoid an error.  */
3470 /* We use char because int might match the return type of a gcc2
3471     builtin and then its argument prototype would still apply.  */
3472 char initscr();
3473
3474 int main() {
3475 initscr()
3476 ; return 0; }
3477 EOF
3478 if { (eval echo configure:3479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3479   rm -rf conftest*
3480   eval "ac_cv_lib_$ac_lib_var=yes"
3481 else
3482   echo "configure: failed program was:" >&5
3483   cat conftest.$ac_ext >&5
3484   rm -rf conftest*
3485   eval "ac_cv_lib_$ac_lib_var=no"
3486 fi
3487 rm -f conftest*
3488 LIBS="$ac_save_LIBS"
3489
3490 fi
3491 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3492   echo "$ac_t""yes" 1>&6
3493   LIBS="$cf_ncurses_SAVE"
3494 else
3495   echo "$ac_t""no" 1>&6
3496 cf_ncurses_LIBS="-lgpm"
3497 fi
3498
3499 else
3500   echo "$ac_t""no" 1>&6
3501 fi
3502
3503
3504 case $host_os in #(vi
3505 freebsd*)
3506         # This is only necessary if you are linking against an obsolete
3507         # version of ncurses (but it should do no harm, since it's static).
3508         if test "$cf_nculib_root" = ncurses ; then
3509                 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
3510 echo "configure:3511: checking for tgoto in -lmytinfo" >&5
3511 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
3512 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3513   echo $ac_n "(cached) $ac_c" 1>&6
3514 else
3515   ac_save_LIBS="$LIBS"
3516 LIBS="-lmytinfo  $LIBS"
3517 cat > conftest.$ac_ext <<EOF
3518 #line 3519 "configure"
3519 #include "confdefs.h"
3520 /* Override any gcc2 internal prototype to avoid an error.  */
3521 /* We use char because int might match the return type of a gcc2
3522     builtin and then its argument prototype would still apply.  */
3523 char tgoto();
3524
3525 int main() {
3526 tgoto()
3527 ; return 0; }
3528 EOF
3529 if { (eval echo configure:3530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3530   rm -rf conftest*
3531   eval "ac_cv_lib_$ac_lib_var=yes"
3532 else
3533   echo "configure: failed program was:" >&5
3534   cat conftest.$ac_ext >&5
3535   rm -rf conftest*
3536   eval "ac_cv_lib_$ac_lib_var=no"
3537 fi
3538 rm -f conftest*
3539 LIBS="$ac_save_LIBS"
3540
3541 fi
3542 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3543   echo "$ac_t""yes" 1>&6
3544   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
3545 else
3546   echo "$ac_t""no" 1>&6
3547 fi
3548
3549         fi
3550         ;;
3551 esac
3552
3553 LIBS="$cf_ncurses_LIBS $LIBS"
3554
3555 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3556 then
3557         LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
3558 else
3559         
3560         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
3561         cf_libdir=""
3562         echo $ac_n "checking for initscr""... $ac_c" 1>&6
3563 echo "configure:3564: checking for initscr" >&5
3564 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
3565   echo $ac_n "(cached) $ac_c" 1>&6
3566 else
3567   cat > conftest.$ac_ext <<EOF
3568 #line 3569 "configure"
3569 #include "confdefs.h"
3570 /* System header to define __stub macros and hopefully few prototypes,
3571     which can conflict with char initscr(); below.  */
3572 #include <assert.h>
3573 /* Override any gcc2 internal prototype to avoid an error.  */
3574 /* We use char because int might match the return type of a gcc2
3575     builtin and then its argument prototype would still apply.  */
3576 char initscr();
3577
3578 int main() {
3579
3580 /* The GNU C library defines this for functions which it implements
3581     to always fail with ENOSYS.  Some functions are actually named
3582     something starting with __ and the normal name is an alias.  */
3583 #if defined (__stub_initscr) || defined (__stub___initscr)
3584 choke me
3585 #else
3586 initscr();
3587 #endif
3588
3589 ; return 0; }
3590 EOF
3591 if { (eval echo configure:3592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3592   rm -rf conftest*
3593   eval "ac_cv_func_initscr=yes"
3594 else
3595   echo "configure: failed program was:" >&5
3596   cat conftest.$ac_ext >&5
3597   rm -rf conftest*
3598   eval "ac_cv_func_initscr=no"
3599 fi
3600 rm -f conftest*
3601 fi
3602
3603 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
3604   echo "$ac_t""yes" 1>&6
3605   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
3606 else
3607   echo "$ac_t""no" 1>&6
3608
3609                 cf_save_LIBS="$LIBS"
3610                 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
3611 echo "configure:3612: checking for initscr in -l$cf_nculib_root" >&5
3612                 LIBS="-l$cf_nculib_root $LIBS"
3613                 cat > conftest.$ac_ext <<EOF
3614 #line 3615 "configure"
3615 #include "confdefs.h"
3616 #include <${cf_cv_ncurses_header-curses.h}>
3617 int main() {
3618 initscr()
3619 ; return 0; }
3620 EOF
3621 if { (eval echo configure:3622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3622   rm -rf conftest*
3623   echo "$ac_t""yes" 1>&6
3624                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
3625                         
3626 else
3627   echo "configure: failed program was:" >&5
3628   cat conftest.$ac_ext >&5
3629   rm -rf conftest*
3630   echo "$ac_t""no" 1>&6
3631                         cf_search=""
3632
3633 test -d "$HOME" && {
3634         test -n "$verbose" && echo "    ... testing lib-directories under $HOME"
3635         test -d "$HOME/lib" &&          cf_search="$cf_search $HOME/lib"
3636         test -d "$HOME/lib/$cf_nculib_root" &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
3637         test -d "$HOME/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
3638 }
3639
3640 # For other stuff under the home directory, it should be sufficient to put
3641 # a symbolic link for $HOME/$cf_nculib_root to the actual package location:
3642 test -d "$HOME/$cf_nculib_root" && {
3643         test -n "$verbose" && echo "    ... testing lib-directories under $HOME/$cf_nculib_root"
3644         test -d "$HOME/$cf_nculib_root/lib" &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
3645         test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
3646 }
3647
3648 test "$prefix" != /usr/local && \
3649 test -d /usr/local && {
3650         test -n "$verbose" && echo "    ... testing lib-directories under /usr/local"
3651         test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
3652         test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
3653         test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
3654         test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
3655         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
3656 }
3657
3658 test "$prefix" != NONE && \
3659 test -d $prefix && {
3660         test -n "$verbose" && echo "    ... testing lib-directories under $prefix"
3661         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
3662         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
3663         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
3664         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
3665         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
3666 }
3667
3668 test "$prefix" != /opt && \
3669 test -d /opt && {
3670         test -n "$verbose" && echo "    ... testing lib-directories under /opt"
3671         test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
3672         test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
3673         test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
3674         test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
3675         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
3676 }
3677
3678 test "$prefix" != /usr && \
3679 test -d /usr && {
3680         test -n "$verbose" && echo "    ... testing lib-directories under /usr"
3681         test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
3682         test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
3683         test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
3684         test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
3685 }
3686
3687                         for cf_libdir in $cf_search
3688                         do
3689                                 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
3690 echo "configure:3691: checking for -l$cf_nculib_root in $cf_libdir" >&5
3691                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
3692                                 cat > conftest.$ac_ext <<EOF
3693 #line 3694 "configure"
3694 #include "confdefs.h"
3695 #include <${cf_cv_ncurses_header-curses.h}>
3696 int main() {
3697 initscr()
3698 ; return 0; }
3699 EOF
3700 if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3701   rm -rf conftest*
3702   echo "$ac_t""yes" 1>&6
3703                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
3704                                          break
3705 else
3706   echo "configure: failed program was:" >&5
3707   cat conftest.$ac_ext >&5
3708   rm -rf conftest*
3709   echo "$ac_t""no" 1>&6
3710                                          LIBS="$cf_save_LIBS"
3711 fi
3712 rm -f conftest*
3713                         done
3714                         
3715 fi
3716 rm -f conftest*
3717                 
3718 fi
3719
3720 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
3721
3722 if test $cf_found_library = no ; then
3723         { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
3724 fi
3725
3726
3727 fi
3728
3729 if test -n "$cf_ncurses_LIBS" ; then
3730         echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
3731 echo "configure:3732: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
3732         cf_ncurses_SAVE="$LIBS"
3733         for p in $cf_ncurses_LIBS ; do
3734                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
3735                 if test "$q" != "$LIBS" ; then
3736                         LIBS="$q"
3737                 fi
3738         done
3739         cat > conftest.$ac_ext <<EOF
3740 #line 3741 "configure"
3741 #include "confdefs.h"
3742 #include <${cf_cv_ncurses_header-curses.h}>
3743 int main() {
3744 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3745 ; return 0; }
3746 EOF
3747 if { (eval echo configure:3748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3748   rm -rf conftest*
3749   echo "$ac_t""yes" 1>&6
3750 else
3751   echo "configure: failed program was:" >&5
3752   cat conftest.$ac_ext >&5
3753   rm -rf conftest*
3754   echo "$ac_t""no" 1>&6
3755                  LIBS="$cf_ncurses_SAVE"
3756 fi
3757 rm -f conftest*
3758 fi
3759
3760
3761 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3762
3763 cat >> confdefs.h <<EOF
3764 #define $cf_nculib_ROOT 1
3765 EOF
3766
3767
3768         ;;
3769 ncursesw)
3770         cf_cv_libtype=w
3771         
3772 echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6
3773 echo "configure:3774: checking for multibyte character support" >&5
3774 if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then
3775   echo $ac_n "(cached) $ac_c" 1>&6
3776 else
3777   
3778         cf_save_LIBS="$LIBS"
3779         cat > conftest.$ac_ext <<EOF
3780 #line 3781 "configure"
3781 #include "confdefs.h"
3782
3783 #include <stdlib.h>
3784 int main() {
3785 putwc(0,0);
3786 ; return 0; }
3787 EOF
3788 if { (eval echo configure:3789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3789   rm -rf conftest*
3790   cf_cv_utf8_lib=yes
3791 else
3792   echo "configure: failed program was:" >&5
3793   cat conftest.$ac_ext >&5
3794   rm -rf conftest*
3795   LIBS="-lutf8 $LIBS"
3796          cat > conftest.$ac_ext <<EOF
3797 #line 3798 "configure"
3798 #include "confdefs.h"
3799
3800 #include <libutf8.h>
3801 int main() {
3802 putwc(0,0);
3803 ; return 0; }
3804 EOF
3805 if { (eval echo configure:3806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3806   rm -rf conftest*
3807   cf_cv_utf8_lib=add-on
3808 else
3809   echo "configure: failed program was:" >&5
3810   cat conftest.$ac_ext >&5
3811   rm -rf conftest*
3812   cf_cv_utf8_lib=no
3813 fi
3814 rm -f conftest*
3815         LIBS="$cf_save_LIBS"
3816
3817 fi
3818 rm -f conftest*
3819 fi
3820
3821 echo "$ac_t""$cf_cv_utf8_lib" 1>&6
3822
3823 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
3824 # ncurses/ncursesw:
3825 if test "$cf_cv_utf8_lib" = "add-on" ; then
3826         cat >> confdefs.h <<\EOF
3827 #define HAVE_LIBUTF8_H 1
3828 EOF
3829
3830         LIBS="-lutf8 $LIBS"
3831 fi
3832
3833         
3834
3835 cf_ncuhdr_root=ncursesw
3836
3837 test -n "$cf_cv_curses_dir" && \
3838 test "$cf_cv_curses_dir" != "no" && \
3839 CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
3840
3841 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
3842 echo "configure:3843: checking for $cf_ncuhdr_root header in include-path" >&5
3843 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
3844   echo $ac_n "(cached) $ac_c" 1>&6
3845 else
3846   
3847         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
3848         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
3849         for cf_header in $cf_header_list
3850         do
3851                 
3852         cat > conftest.$ac_ext <<EOF
3853 #line 3854 "configure"
3854 #include "confdefs.h"
3855
3856
3857 #define _XOPEN_SOURCE_EXTENDED
3858 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
3859 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
3860
3861 #include <$cf_header>
3862 int main() {
3863
3864 #ifdef NCURSES_VERSION
3865
3866 #ifndef WACS_BSSB
3867         make an error
3868 #endif
3869
3870 printf("%s\n", NCURSES_VERSION);
3871 #else
3872 #ifdef __NCURSES_H
3873 printf("old\n");
3874 #else
3875         make an error
3876 #endif
3877 #endif
3878         
3879         
3880 ; return 0; }
3881 EOF
3882 if { (eval echo configure:3883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3883   rm -rf conftest*
3884   cf_cv_ncurses_h=$cf_header
3885         
3886 else
3887   echo "configure: failed program was:" >&5
3888   cat conftest.$ac_ext >&5
3889   rm -rf conftest*
3890   cf_cv_ncurses_h=no
3891 fi
3892 rm -f conftest*
3893
3894                 test "$cf_cv_ncurses_h" != no && break
3895         done
3896
3897 fi
3898
3899 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
3900
3901
3902
3903 if test "$cf_cv_ncurses_h" != no ; then
3904         cf_cv_ncurses_header=$cf_cv_ncurses_h
3905 else
3906
3907 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
3908 echo "configure:3909: checking for $cf_ncuhdr_root include-path" >&5
3909 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
3910   echo $ac_n "(cached) $ac_c" 1>&6
3911 else
3912   
3913         test -n "$verbose" && echo
3914         cf_search=""
3915
3916 test -d "$HOME" && {
3917         test -n "$verbose" && echo "    ... testing include-directories under $HOME"
3918         test -d "$HOME/include" &&          cf_search="$cf_search $HOME/include"
3919         test -d "$HOME/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
3920         test -d "$HOME/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
3921 }
3922
3923 # For other stuff under the home directory, it should be sufficient to put
3924 # a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
3925 test -d "$HOME/$cf_ncuhdr_root" && {
3926         test -n "$verbose" && echo "    ... testing include-directories under $HOME/$cf_ncuhdr_root"
3927         test -d "$HOME/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
3928         test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3929 }
3930
3931 test "$prefix" != /usr/local && \
3932 test -d /usr/local && {
3933         test -n "$verbose" && echo "    ... testing include-directories under /usr/local"
3934         test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
3935         test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
3936         test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
3937         test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
3938         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3939 }
3940
3941 test "$prefix" != NONE && \
3942 test -d $prefix && {
3943         test -n "$verbose" && echo "    ... testing include-directories under $prefix"
3944         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3945         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
3946         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
3947         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
3948         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3949 }
3950
3951 test "$prefix" != /opt && \
3952 test -d /opt && {
3953         test -n "$verbose" && echo "    ... testing include-directories under /opt"
3954         test -d /opt/include &&             cf_search="$cf_search /opt/include"
3955         test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
3956         test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
3957         test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
3958         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3959 }
3960
3961 test "$prefix" != /usr && \
3962 test -d /usr && {
3963         test -n "$verbose" && echo "    ... testing include-directories under /usr"
3964         test -d /usr/include &&             cf_search="$cf_search /usr/include"
3965         test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
3966         test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
3967         test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
3968 }
3969
3970 test "$includedir" != NONE && \
3971 test "$includedir" != "/usr/include" && \
3972 test -d "$includedir" && {
3973         test -d $includedir &&    cf_search="$cf_search $includedir"
3974         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
3975 }
3976
3977 test "$oldincludedir" != NONE && \
3978 test "$oldincludedir" != "/usr/include" && \
3979 test -d "$oldincludedir" && {
3980         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3981         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
3982 }
3983
3984
3985         test -n "$verbose" && echo search path $cf_search
3986         cf_save2_CPPFLAGS="$CPPFLAGS"
3987         for cf_incdir in $cf_search
3988         do
3989                 
3990 for cf_add_incdir in $cf_incdir
3991 do
3992         while true
3993         do
3994                 case $cf_add_incdir in
3995                 /usr/include) # (vi
3996                         ;;
3997                 /usr/local/include) # (vi
3998                         if test "$GCC" = yes
3999                         then
4000                                 cf_save_CPPFLAGS="$CPPFLAGS"
4001                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4002                                 cat > conftest.$ac_ext <<EOF
4003 #line 4004 "configure"
4004 #include "confdefs.h"
4005 #include <stdio.h>
4006 int main() {
4007 printf("Hello")
4008 ; return 0; }
4009 EOF
4010 if { (eval echo configure:4011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4011   :
4012 else
4013   echo "configure: failed program was:" >&5
4014   cat conftest.$ac_ext >&5
4015   rm -rf conftest*
4016   CPPFLAGS="$cf_save_CPPFLAGS"
4017 fi
4018 rm -f conftest*
4019                         fi
4020                         ;;
4021                 *) # (vi
4022                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4023                         ;;
4024                 esac
4025                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4026                 test "$cf_top_incdir" = "$cf_add_incdir" && break
4027                 cf_add_incdir="$cf_top_incdir"
4028         done
4029 done
4030
4031                 for cf_header in \
4032                         ncurses.h \
4033                         curses.h
4034                 do
4035                         
4036         cat > conftest.$ac_ext <<EOF
4037 #line 4038 "configure"
4038 #include "confdefs.h"
4039
4040
4041 #include <$cf_header>
4042 int main() {
4043
4044 #ifdef NCURSES_VERSION
4045
4046 printf("%s\n", NCURSES_VERSION);
4047 #else
4048 #ifdef __NCURSES_H
4049 printf("old\n");
4050 #else
4051         make an error
4052 #endif
4053 #endif
4054         
4055         
4056 ; return 0; }
4057 EOF
4058 if { (eval echo configure:4059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4059   rm -rf conftest*
4060   cf_cv_ncurses_h2=$cf_header
4061         
4062 else
4063   echo "configure: failed program was:" >&5
4064   cat conftest.$ac_ext >&5
4065   rm -rf conftest*
4066   cf_cv_ncurses_h2=no
4067 fi
4068 rm -f conftest*
4069
4070                         if test "$cf_cv_ncurses_h2" != no ; then
4071                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4072                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4073                                 break
4074                         fi
4075                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4076                 done
4077                 CPPFLAGS="$cf_save2_CPPFLAGS"
4078                 test "$cf_cv_ncurses_h2" != no && break
4079         done
4080         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
4081         
4082 fi
4083
4084 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
4085
4086         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4087         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4088         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4089                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4090         fi
4091         
4092 for cf_add_incdir in $cf_1st_incdir
4093 do
4094         while true
4095         do
4096                 case $cf_add_incdir in
4097                 /usr/include) # (vi
4098                         ;;
4099                 /usr/local/include) # (vi
4100                         if test "$GCC" = yes
4101                         then
4102                                 cf_save_CPPFLAGS="$CPPFLAGS"
4103                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4104                                 cat > conftest.$ac_ext <<EOF
4105 #line 4106 "configure"
4106 #include "confdefs.h"
4107 #include <stdio.h>
4108 int main() {
4109 printf("Hello")
4110 ; return 0; }
4111 EOF
4112 if { (eval echo configure:4113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4113   :
4114 else
4115   echo "configure: failed program was:" >&5
4116   cat conftest.$ac_ext >&5
4117   rm -rf conftest*
4118   CPPFLAGS="$cf_save_CPPFLAGS"
4119 fi
4120 rm -f conftest*
4121                         fi
4122                         ;;
4123                 *) # (vi
4124                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4125                         ;;
4126                 esac
4127                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4128                 test "$cf_top_incdir" = "$cf_add_incdir" && break
4129                 cf_add_incdir="$cf_top_incdir"
4130         done
4131 done
4132
4133
4134 fi
4135
4136 # Set definitions to allow ifdef'ing for ncurses.h
4137
4138 case $cf_cv_ncurses_header in # (vi
4139 *ncurses.h)
4140         cat >> confdefs.h <<\EOF
4141 #define HAVE_NCURSES_H 1
4142 EOF
4143
4144         ;;
4145 esac
4146
4147 case $cf_cv_ncurses_header in # (vi
4148 ncurses/curses.h|ncurses/ncurses.h)
4149         cat >> confdefs.h <<\EOF
4150 #define HAVE_NCURSES_NCURSES_H 1
4151 EOF
4152
4153         ;;
4154 ncursesw/curses.h|ncursesw/ncurses.h)
4155         cat >> confdefs.h <<\EOF
4156 #define HAVE_NCURSESW_NCURSES_H 1
4157 EOF
4158
4159         ;;
4160 esac
4161
4162
4163
4164 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
4165 echo "configure:4166: checking for terminfo header" >&5
4166 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
4167   echo $ac_n "(cached) $ac_c" 1>&6
4168 else
4169   
4170 case ${cf_cv_ncurses_header} in #(vi
4171 */ncurses.h|*/ncursesw.h) #(vi
4172         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4173         ;;
4174 *)
4175         cf_term_header=term.h
4176         ;;
4177 esac
4178
4179 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4180 do
4181 cat > conftest.$ac_ext <<EOF
4182 #line 4183 "configure"
4183 #include "confdefs.h"
4184 #include <stdio.h>
4185 #include <${cf_cv_ncurses_header-curses.h}>
4186 #include <$cf_test>
4187
4188 int main() {
4189 int x = auto_left_margin
4190 ; return 0; }
4191 EOF
4192 if { (eval echo configure:4193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4193   rm -rf conftest*
4194   
4195         cf_cv_term_header="$cf_test"
4196 else
4197   echo "configure: failed program was:" >&5
4198   cat conftest.$ac_ext >&5
4199   rm -rf conftest*
4200   
4201         cf_cv_term_header=unknown
4202         
4203 fi
4204 rm -f conftest*
4205         test "$cf_cv_term_header" != unknown && break
4206 done
4207
4208 fi
4209
4210 echo "$ac_t""$cf_cv_term_header" 1>&6
4211
4212 # Set definitions to allow ifdef'ing to accommodate subdirectories
4213
4214 case $cf_cv_term_header in # (vi
4215 *term.h)
4216         cat >> confdefs.h <<\EOF
4217 #define HAVE_TERM_H 1
4218 EOF
4219
4220         ;;
4221 esac
4222
4223 case $cf_cv_term_header in # (vi
4224 ncurses/term.h) #(vi
4225         cat >> confdefs.h <<\EOF
4226 #define HAVE_NCURSES_TERM_H 1
4227 EOF
4228
4229         ;;
4230 ncursesw/term.h)
4231         cat >> confdefs.h <<\EOF
4232 #define HAVE_NCURSESW_TERM_H 1
4233 EOF
4234
4235         ;;
4236 esac
4237
4238
4239 # some applications need this, but should check for NCURSES_VERSION
4240 cat >> confdefs.h <<\EOF
4241 #define NCURSES 1
4242 EOF
4243
4244
4245
4246 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
4247 echo "configure:4248: checking for ncurses version" >&5
4248 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
4249   echo $ac_n "(cached) $ac_c" 1>&6
4250 else
4251   
4252         cf_cv_ncurses_version=no
4253         cf_tempfile=out$$
4254         rm -f $cf_tempfile
4255         if test "$cross_compiling" = yes; then
4256   
4257
4258         # This will not work if the preprocessor splits the line after the
4259         # Autoconf token.  The 'unproto' program does that.
4260         cat > conftest.$ac_ext <<EOF
4261 #include <${cf_cv_ncurses_header-curses.h}>
4262 #undef Autoconf
4263 #ifdef NCURSES_VERSION
4264 Autoconf NCURSES_VERSION
4265 #else
4266 #ifdef __NCURSES_H
4267 Autoconf "old"
4268 #endif
4269 ;
4270 #endif
4271 EOF
4272         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4273         { (eval echo configure:4274: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
4274         if test -f conftest.out ; then
4275                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4276                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4277                 rm -f conftest.out
4278         fi
4279
4280 else
4281   cat > conftest.$ac_ext <<EOF
4282 #line 4283 "configure"
4283 #include "confdefs.h"
4284
4285 #include <${cf_cv_ncurses_header-curses.h}>
4286 #include <stdio.h>
4287 int main()
4288 {
4289         FILE *fp = fopen("$cf_tempfile", "w");
4290 #ifdef NCURSES_VERSION
4291 # ifdef NCURSES_VERSION_PATCH
4292         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4293 # else
4294         fprintf(fp, "%s\n", NCURSES_VERSION);
4295 # endif
4296 #else
4297 # ifdef __NCURSES_H
4298         fprintf(fp, "old\n");
4299 # else
4300         make an error
4301 # endif
4302 #endif
4303         exit(0);
4304 }
4305 EOF
4306 if { (eval echo configure:4307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4307 then
4308   
4309         cf_cv_ncurses_version=`cat $cf_tempfile`
4310 else
4311   echo "configure: failed program was:" >&5
4312   cat conftest.$ac_ext >&5
4313 fi
4314 rm -fr conftest*
4315 fi
4316
4317         rm -f $cf_tempfile
4318
4319 fi
4320
4321 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
4322 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
4323 #define NCURSES 1
4324 EOF
4325
4326
4327
4328         
4329
4330 cf_nculib_root=ncursesw
4331         # This works, except for the special case where we find gpm, but
4332         # ncurses is in a nonstandard location via $LIBS, and we really want
4333         # to link gpm.
4334 cf_ncurses_LIBS=""
4335 cf_ncurses_SAVE="$LIBS"
4336 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
4337 echo "configure:4338: checking for Gpm_Open in -lgpm" >&5
4338 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
4339 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4340   echo $ac_n "(cached) $ac_c" 1>&6
4341 else
4342   ac_save_LIBS="$LIBS"
4343 LIBS="-lgpm  $LIBS"
4344 cat > conftest.$ac_ext <<EOF
4345 #line 4346 "configure"
4346 #include "confdefs.h"
4347 /* Override any gcc2 internal prototype to avoid an error.  */
4348 /* We use char because int might match the return type of a gcc2
4349     builtin and then its argument prototype would still apply.  */
4350 char Gpm_Open();
4351
4352 int main() {
4353 Gpm_Open()
4354 ; return 0; }
4355 EOF
4356 if { (eval echo configure:4357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4357   rm -rf conftest*
4358   eval "ac_cv_lib_$ac_lib_var=yes"
4359 else
4360   echo "configure: failed program was:" >&5
4361   cat conftest.$ac_ext >&5
4362   rm -rf conftest*
4363   eval "ac_cv_lib_$ac_lib_var=no"
4364 fi
4365 rm -f conftest*
4366 LIBS="$ac_save_LIBS"
4367
4368 fi
4369 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4370   echo "$ac_t""yes" 1>&6
4371   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
4372 echo "configure:4373: checking for initscr in -lgpm" >&5
4373 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
4374 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4375   echo $ac_n "(cached) $ac_c" 1>&6
4376 else
4377   ac_save_LIBS="$LIBS"
4378 LIBS="-lgpm  $LIBS"
4379 cat > conftest.$ac_ext <<EOF
4380 #line 4381 "configure"
4381 #include "confdefs.h"
4382 /* Override any gcc2 internal prototype to avoid an error.  */
4383 /* We use char because int might match the return type of a gcc2
4384     builtin and then its argument prototype would still apply.  */
4385 char initscr();
4386
4387 int main() {
4388 initscr()
4389 ; return 0; }
4390 EOF
4391 if { (eval echo configure:4392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4392   rm -rf conftest*
4393   eval "ac_cv_lib_$ac_lib_var=yes"
4394 else
4395   echo "configure: failed program was:" >&5
4396   cat conftest.$ac_ext >&5
4397   rm -rf conftest*
4398   eval "ac_cv_lib_$ac_lib_var=no"
4399 fi
4400 rm -f conftest*
4401 LIBS="$ac_save_LIBS"
4402
4403 fi
4404 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4405   echo "$ac_t""yes" 1>&6
4406   LIBS="$cf_ncurses_SAVE"
4407 else
4408   echo "$ac_t""no" 1>&6
4409 cf_ncurses_LIBS="-lgpm"
4410 fi
4411
4412 else
4413   echo "$ac_t""no" 1>&6
4414 fi
4415
4416
4417 case $host_os in #(vi
4418 freebsd*)
4419         # This is only necessary if you are linking against an obsolete
4420         # version of ncurses (but it should do no harm, since it's static).
4421         if test "$cf_nculib_root" = ncurses ; then
4422                 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
4423 echo "configure:4424: checking for tgoto in -lmytinfo" >&5
4424 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
4425 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4426   echo $ac_n "(cached) $ac_c" 1>&6
4427 else
4428   ac_save_LIBS="$LIBS"
4429 LIBS="-lmytinfo  $LIBS"
4430 cat > conftest.$ac_ext <<EOF
4431 #line 4432 "configure"
4432 #include "confdefs.h"
4433 /* Override any gcc2 internal prototype to avoid an error.  */
4434 /* We use char because int might match the return type of a gcc2
4435     builtin and then its argument prototype would still apply.  */
4436 char tgoto();
4437
4438 int main() {
4439 tgoto()
4440 ; return 0; }
4441 EOF
4442 if { (eval echo configure:4443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4443   rm -rf conftest*
4444   eval "ac_cv_lib_$ac_lib_var=yes"
4445 else
4446   echo "configure: failed program was:" >&5
4447   cat conftest.$ac_ext >&5
4448   rm -rf conftest*
4449   eval "ac_cv_lib_$ac_lib_var=no"
4450 fi
4451 rm -f conftest*
4452 LIBS="$ac_save_LIBS"
4453
4454 fi
4455 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4456   echo "$ac_t""yes" 1>&6
4457   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4458 else
4459   echo "$ac_t""no" 1>&6
4460 fi
4461
4462         fi
4463         ;;
4464 esac
4465
4466 LIBS="$cf_ncurses_LIBS $LIBS"
4467
4468 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4469 then
4470         LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
4471 else
4472         
4473         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4474         cf_libdir=""
4475         echo $ac_n "checking for initscr""... $ac_c" 1>&6
4476 echo "configure:4477: checking for initscr" >&5
4477 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
4478   echo $ac_n "(cached) $ac_c" 1>&6
4479 else
4480   cat > conftest.$ac_ext <<EOF
4481 #line 4482 "configure"
4482 #include "confdefs.h"
4483 /* System header to define __stub macros and hopefully few prototypes,
4484     which can conflict with char initscr(); below.  */
4485 #include <assert.h>
4486 /* Override any gcc2 internal prototype to avoid an error.  */
4487 /* We use char because int might match the return type of a gcc2
4488     builtin and then its argument prototype would still apply.  */
4489 char initscr();
4490
4491 int main() {
4492
4493 /* The GNU C library defines this for functions which it implements
4494     to always fail with ENOSYS.  Some functions are actually named
4495     something starting with __ and the normal name is an alias.  */
4496 #if defined (__stub_initscr) || defined (__stub___initscr)
4497 choke me
4498 #else
4499 initscr();
4500 #endif
4501
4502 ; return 0; }
4503 EOF
4504 if { (eval echo configure:4505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4505   rm -rf conftest*
4506   eval "ac_cv_func_initscr=yes"
4507 else
4508   echo "configure: failed program was:" >&5
4509   cat conftest.$ac_ext >&5
4510   rm -rf conftest*
4511   eval "ac_cv_func_initscr=no"
4512 fi
4513 rm -f conftest*
4514 fi
4515
4516 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
4517   echo "$ac_t""yes" 1>&6
4518   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4519 else
4520   echo "$ac_t""no" 1>&6
4521
4522                 cf_save_LIBS="$LIBS"
4523                 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
4524 echo "configure:4525: checking for initscr in -l$cf_nculib_root" >&5
4525                 LIBS="-l$cf_nculib_root $LIBS"
4526                 cat > conftest.$ac_ext <<EOF
4527 #line 4528 "configure"
4528 #include "confdefs.h"
4529 #include <${cf_cv_ncurses_header-curses.h}>
4530 int main() {
4531 initscr()
4532 ; return 0; }
4533 EOF
4534 if { (eval echo configure:4535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4535   rm -rf conftest*
4536   echo "$ac_t""yes" 1>&6
4537                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4538                         
4539 else
4540   echo "configure: failed program was:" >&5
4541   cat conftest.$ac_ext >&5
4542   rm -rf conftest*
4543   echo "$ac_t""no" 1>&6
4544                         cf_search=""
4545
4546 test -d "$HOME" && {
4547         test -n "$verbose" && echo "    ... testing lib-directories under $HOME"
4548         test -d "$HOME/lib" &&          cf_search="$cf_search $HOME/lib"
4549         test -d "$HOME/lib/$cf_nculib_root" &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
4550         test -d "$HOME/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
4551 }
4552
4553 # For other stuff under the home directory, it should be sufficient to put
4554 # a symbolic link for $HOME/$cf_nculib_root to the actual package location:
4555 test -d "$HOME/$cf_nculib_root" && {
4556         test -n "$verbose" && echo "    ... testing lib-directories under $HOME/$cf_nculib_root"
4557         test -d "$HOME/$cf_nculib_root/lib" &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
4558         test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
4559 }
4560
4561 test "$prefix" != /usr/local && \
4562 test -d /usr/local && {
4563         test -n "$verbose" && echo "    ... testing lib-directories under /usr/local"
4564         test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
4565         test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
4566         test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
4567         test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
4568         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
4569 }
4570
4571 test "$prefix" != NONE && \
4572 test -d $prefix && {
4573         test -n "$verbose" && echo "    ... testing lib-directories under $prefix"
4574         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
4575         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
4576         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
4577         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
4578         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
4579 }
4580
4581 test "$prefix" != /opt && \
4582 test -d /opt && {
4583         test -n "$verbose" && echo "    ... testing lib-directories under /opt"
4584         test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
4585         test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
4586         test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
4587         test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
4588         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
4589 }
4590
4591 test "$prefix" != /usr && \
4592 test -d /usr && {
4593         test -n "$verbose" && echo "    ... testing lib-directories under /usr"
4594         test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
4595         test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
4596         test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
4597         test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
4598 }
4599
4600                         for cf_libdir in $cf_search
4601                         do
4602                                 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
4603 echo "configure:4604: checking for -l$cf_nculib_root in $cf_libdir" >&5
4604                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
4605                                 cat > conftest.$ac_ext <<EOF
4606 #line 4607 "configure"
4607 #include "confdefs.h"
4608 #include <${cf_cv_ncurses_header-curses.h}>
4609 int main() {
4610 initscr()
4611 ; return 0; }
4612 EOF
4613 if { (eval echo configure:4614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4614   rm -rf conftest*
4615   echo "$ac_t""yes" 1>&6
4616                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4617                                          break
4618 else
4619   echo "configure: failed program was:" >&5
4620   cat conftest.$ac_ext >&5
4621   rm -rf conftest*
4622   echo "$ac_t""no" 1>&6
4623                                          LIBS="$cf_save_LIBS"
4624 fi
4625 rm -f conftest*
4626                         done
4627                         
4628 fi
4629 rm -f conftest*
4630                 
4631 fi
4632
4633 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
4634
4635 if test $cf_found_library = no ; then
4636         { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
4637 fi
4638
4639
4640 fi
4641
4642 if test -n "$cf_ncurses_LIBS" ; then
4643         echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
4644 echo "configure:4645: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
4645         cf_ncurses_SAVE="$LIBS"
4646         for p in $cf_ncurses_LIBS ; do
4647                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
4648                 if test "$q" != "$LIBS" ; then
4649                         LIBS="$q"
4650                 fi
4651         done
4652         cat > conftest.$ac_ext <<EOF
4653 #line 4654 "configure"
4654 #include "confdefs.h"