]> ncurses.scripts.mit.edu Git - ncurses.git/blob - tack/configure
ncurses 5.6 - patch 20070128
[ncurses.git] / tack / 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 EOF
193     exit 0 ;;
194
195   -host | --host | --hos | --ho)
196     ac_prev=host ;;
197   -host=* | --host=* | --hos=* | --ho=*)
198     host="$ac_optarg" ;;
199
200   -includedir | --includedir | --includedi | --included | --include \
201   | --includ | --inclu | --incl | --inc)
202     ac_prev=includedir ;;
203   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
204   | --includ=* | --inclu=* | --incl=* | --inc=*)
205     includedir="$ac_optarg" ;;
206
207   -infodir | --infodir | --infodi | --infod | --info | --inf)
208     ac_prev=infodir ;;
209   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
210     infodir="$ac_optarg" ;;
211
212   -libdir | --libdir | --libdi | --libd)
213     ac_prev=libdir ;;
214   -libdir=* | --libdir=* | --libdi=* | --libd=*)
215     libdir="$ac_optarg" ;;
216
217   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
218   | --libexe | --libex | --libe)
219     ac_prev=libexecdir ;;
220   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
221   | --libexe=* | --libex=* | --libe=*)
222     libexecdir="$ac_optarg" ;;
223
224   -localstatedir | --localstatedir | --localstatedi | --localstated \
225   | --localstate | --localstat | --localsta | --localst \
226   | --locals | --local | --loca | --loc | --lo)
227     ac_prev=localstatedir ;;
228   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
229   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
230   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
231     localstatedir="$ac_optarg" ;;
232
233   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
234     ac_prev=mandir ;;
235   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
236     mandir="$ac_optarg" ;;
237
238   -nfp | --nfp | --nf)
239     # Obsolete; use --without-fp.
240     with_fp=no ;;
241
242   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
243   | --no-cr | --no-c)
244     no_create=yes ;;
245
246   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
247   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
248     no_recursion=yes ;;
249
250   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
251   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
252   | --oldin | --oldi | --old | --ol | --o)
253     ac_prev=oldincludedir ;;
254   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
255   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
256   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
257     oldincludedir="$ac_optarg" ;;
258
259   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
260     ac_prev=prefix ;;
261   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
262     prefix="$ac_optarg" ;;
263
264   -program-prefix | --program-prefix | --program-prefi | --program-pref \
265   | --program-pre | --program-pr | --program-p)
266     ac_prev=program_prefix ;;
267   -program-prefix=* | --program-prefix=* | --program-prefi=* \
268   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
269     program_prefix="$ac_optarg" ;;
270
271   -program-suffix | --program-suffix | --program-suffi | --program-suff \
272   | --program-suf | --program-su | --program-s)
273     ac_prev=program_suffix ;;
274   -program-suffix=* | --program-suffix=* | --program-suffi=* \
275   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
276     program_suffix="$ac_optarg" ;;
277
278   -program-transform-name | --program-transform-name \
279   | --program-transform-nam | --program-transform-na \
280   | --program-transform-n | --program-transform- \
281   | --program-transform | --program-transfor \
282   | --program-transfo | --program-transf \
283   | --program-trans | --program-tran \
284   | --progr-tra | --program-tr | --program-t)
285     ac_prev=program_transform_name ;;
286   -program-transform-name=* | --program-transform-name=* \
287   | --program-transform-nam=* | --program-transform-na=* \
288   | --program-transform-n=* | --program-transform-=* \
289   | --program-transform=* | --program-transfor=* \
290   | --program-transfo=* | --program-transf=* \
291   | --program-trans=* | --program-tran=* \
292   | --progr-tra=* | --program-tr=* | --program-t=*)
293     program_transform_name="$ac_optarg" ;;
294
295   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
296   | -silent | --silent | --silen | --sile | --sil)
297     silent=yes ;;
298
299   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
300     ac_prev=sbindir ;;
301   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
302   | --sbi=* | --sb=*)
303     sbindir="$ac_optarg" ;;
304
305   -sharedstatedir | --sharedstatedir | --sharedstatedi \
306   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
307   | --sharedst | --shareds | --shared | --share | --shar \
308   | --sha | --sh)
309     ac_prev=sharedstatedir ;;
310   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
311   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
312   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
313   | --sha=* | --sh=*)
314     sharedstatedir="$ac_optarg" ;;
315
316   -site | --site | --sit)
317     ac_prev=site ;;
318   -site=* | --site=* | --sit=*)
319     site="$ac_optarg" ;;
320
321   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
322     ac_prev=srcdir ;;
323   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
324     srcdir="$ac_optarg" ;;
325
326   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
327   | --syscon | --sysco | --sysc | --sys | --sy)
328     ac_prev=sysconfdir ;;
329   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
330   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
331     sysconfdir="$ac_optarg" ;;
332
333   -target | --target | --targe | --targ | --tar | --ta | --t)
334     ac_prev=target ;;
335   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
336     target="$ac_optarg" ;;
337
338   -v | -verbose | --verbose | --verbos | --verbo | --verb)
339     verbose=yes ;;
340
341   -version | --version | --versio | --versi | --vers)
342     echo "configure generated by autoconf version 2.13.20030927"
343     exit 0 ;;
344
345   -with-* | --with-*)
346     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
347     # Reject names that are not valid shell variable names.
348     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
349       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
350     fi
351     ac_package=`echo $ac_package| sed 's/-/_/g'`
352     case "$ac_option" in
353       *=*) ;;
354       *) ac_optarg=yes ;;
355     esac
356     eval "with_${ac_package}='$ac_optarg'" ;;
357
358   -without-* | --without-*)
359     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
360     # Reject names that are not valid shell variable names.
361     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
362       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
363     fi
364     ac_package=`echo $ac_package| sed 's/-/_/g'`
365     eval "with_${ac_package}=no" ;;
366
367   --x)
368     # Obsolete; use --with-x.
369     with_x=yes ;;
370
371   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
372   | --x-incl | --x-inc | --x-in | --x-i)
373     ac_prev=x_includes ;;
374   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
375   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
376     x_includes="$ac_optarg" ;;
377
378   -x-libraries | --x-libraries | --x-librarie | --x-librari \
379   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
380     ac_prev=x_libraries ;;
381   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
382   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
383     x_libraries="$ac_optarg" ;;
384
385   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
386     ;;
387
388   *)
389     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
390       echo "configure: warning: $ac_option: invalid host type" 1>&2
391     fi
392     if test "x$nonopt" != xNONE; then
393       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
394     fi
395     nonopt="$ac_option"
396     ;;
397
398   esac
399 done
400
401 if test -n "$ac_prev"; then
402   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
403 fi
404
405 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
406
407 # File descriptor usage:
408 # 0 standard input
409 # 1 file creation
410 # 2 errors and warnings
411 # 3 some systems may open it to /dev/tty
412 # 4 used on the Kubota Titan
413 # 6 checking for... messages and results
414 # 5 compiler messages saved in config.log
415 if test "$silent" = yes; then
416   exec 6>/dev/null
417 else
418   exec 6>&1
419 fi
420 exec 5>./config.log
421
422 echo "\
423 This file contains any messages produced by compilers while
424 running configure, to aid debugging if configure makes a mistake.
425 " 1>&5
426
427 # Strip out --no-create and --no-recursion so they do not pile up.
428 # Also quote any args containing shell metacharacters.
429 ac_configure_args=
430 for ac_arg
431 do
432   case "$ac_arg" in
433   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
434   | --no-cr | --no-c) ;;
435   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
436   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
437   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
438   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
439   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
440   esac
441 done
442
443 # NLS nuisances.
444 # Only set these to C if already set.  These must not be set unconditionally
445 # because not all systems understand e.g. LANG=C (notably SCO).
446 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
447 # Non-C LC_CTYPE values break the ctype check.
448 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
449 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
450 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
451 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
452
453 # confdefs.h avoids OS command line length limits that DEFS can exceed.
454 rm -rf conftest* confdefs.h
455 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
456 echo > confdefs.h
457
458 # A filename unique to this package, relative to the directory that
459 # configure is in, which we can look for to find out if srcdir is correct.
460 ac_unique_file=tack.c
461
462 # Find the source files, if location was not specified.
463 if test -z "$srcdir"; then
464   ac_srcdir_defaulted=yes
465   # Try the directory containing this script, then its parent.
466   ac_prog=$0
467   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
468   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
469   srcdir=$ac_confdir
470   if test ! -r $srcdir/$ac_unique_file; then
471     srcdir=..
472   fi
473 else
474   ac_srcdir_defaulted=no
475 fi
476 if test ! -r $srcdir/$ac_unique_file; then
477   if test "$ac_srcdir_defaulted" = yes; then
478     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
479   else
480     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
481   fi
482 fi
483 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
484
485 # Prefer explicitly selected file to automatically selected ones.
486 if test -z "$CONFIG_SITE"; then
487   if test "x$prefix" != xNONE; then
488     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
489   else
490     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
491   fi
492 fi
493 for ac_site_file in $CONFIG_SITE; do
494   if test -r "$ac_site_file"; then
495     echo "loading site script $ac_site_file"
496     . "$ac_site_file"
497   fi
498 done
499
500 if test -r "$cache_file"; then
501   echo "loading cache $cache_file"
502   . $cache_file
503 else
504   echo "creating cache $cache_file"
505   > $cache_file
506 fi
507
508 ac_ext=c
509 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
510 ac_cpp='$CPP $CPPFLAGS'
511 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
512 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
513 cross_compiling=$ac_cv_prog_cc_cross
514
515 ac_exeext=
516 ac_objext=o
517 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
518   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
519   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
520     ac_n= ac_c='
521 ' ac_t='        '
522   else
523     ac_n=-n ac_c= ac_t=
524   fi
525 else
526   ac_n= ac_c='\c' ac_t=
527 fi
528
529
530
531
532
533 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
534
535
536 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
537
538 ac_aux_dir=
539 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
540   if test -f $ac_dir/install-sh; then
541     ac_aux_dir=$ac_dir
542     ac_install_sh="$ac_aux_dir/install-sh -c"
543     break
544   elif test -f $ac_dir/install.sh; then
545     ac_aux_dir=$ac_dir
546     ac_install_sh="$ac_aux_dir/install.sh -c"
547     break
548   fi
549 done
550 if test -z "$ac_aux_dir"; then
551   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
552 fi
553 ac_config_guess=$ac_aux_dir/config.guess
554 ac_config_sub=$ac_aux_dir/config.sub
555 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
556
557
558 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
559         
560 # Make sure we can run config.sub.
561 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
562 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
563 fi
564
565 echo $ac_n "checking host system type""... $ac_c" 1>&6
566 echo "configure:567: checking host system type" >&5
567
568 host_alias=$host
569 case "$host_alias" in
570 NONE)
571   case $nonopt in
572   NONE)
573     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
574     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
575     fi ;;
576   *) host_alias=$nonopt ;;
577   esac ;;
578 esac
579
580 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
581 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
582 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
583 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
584 echo "$ac_t""$host" 1>&6
585
586         system_name="$host_os"
587 else
588         system_name="`(uname -s -r) 2>/dev/null`"
589         if test -z "$system_name" ; then
590                 system_name="`(hostname) 2>/dev/null`"
591         fi
592 fi
593 test -n "$system_name" && cat >> confdefs.h <<EOF
594 #define SYSTEM_NAME "$system_name"
595 EOF
596
597 if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
598   echo $ac_n "(cached) $ac_c" 1>&6
599 else
600   cf_cv_system_name="$system_name"
601 fi
602
603
604 test -z "$system_name" && system_name="$cf_cv_system_name"
605 test -n "$cf_cv_system_name" && echo "$ac_t""Configuring for $cf_cv_system_name" 1>&6
606
607 if test ".$system_name" != ".$cf_cv_system_name" ; then
608         echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
609         { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
610 fi
611
612
613 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
614 echo "configure:615: checking whether ${MAKE-make} sets \${MAKE}" >&5
615 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
616 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
617   echo $ac_n "(cached) $ac_c" 1>&6
618 else
619   cat > conftestmake <<\EOF
620 all:
621         @echo 'ac_maketemp="${MAKE}"'
622 EOF
623 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
624 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
625 if test -n "$ac_maketemp"; then
626   eval ac_cv_prog_make_${ac_make}_set=yes
627 else
628   eval ac_cv_prog_make_${ac_make}_set=no
629 fi
630 rm -f conftestmake
631 fi
632 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
633   echo "$ac_t""yes" 1>&6
634   SET_MAKE=
635 else
636   echo "$ac_t""no" 1>&6
637   SET_MAKE="MAKE=${MAKE-make}"
638 fi
639
640 # Extract the first word of "gcc", so it can be a program name with args.
641 set dummy gcc; ac_word=$2
642 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
643 echo "configure:644: checking for $ac_word" >&5
644 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
645   echo $ac_n "(cached) $ac_c" 1>&6
646 else
647   if test -n "$CC"; then
648   ac_cv_prog_CC="$CC" # Let the user override the test.
649 else
650   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
651   ac_dummy="$PATH"
652   for ac_dir in $ac_dummy; do
653     test -z "$ac_dir" && ac_dir=.
654     if test -f $ac_dir/$ac_word; then
655       ac_cv_prog_CC="gcc"
656       break
657     fi
658   done
659   IFS="$ac_save_ifs"
660 fi
661 fi
662 CC="$ac_cv_prog_CC"
663 if test -n "$CC"; then
664   echo "$ac_t""$CC" 1>&6
665 else
666   echo "$ac_t""no" 1>&6
667 fi
668
669 if test -z "$CC"; then
670   # Extract the first word of "cc", so it can be a program name with args.
671 set dummy cc; ac_word=$2
672 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
673 echo "configure:674: checking for $ac_word" >&5
674 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
675   echo $ac_n "(cached) $ac_c" 1>&6
676 else
677   if test -n "$CC"; then
678   ac_cv_prog_CC="$CC" # Let the user override the test.
679 else
680   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
681   ac_prog_rejected=no
682   ac_dummy="$PATH"
683   for ac_dir in $ac_dummy; do
684     test -z "$ac_dir" && ac_dir=.
685     if test -f $ac_dir/$ac_word; then
686       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
687         ac_prog_rejected=yes
688         continue
689       fi
690       ac_cv_prog_CC="cc"
691       break
692     fi
693   done
694   IFS="$ac_save_ifs"
695 if test $ac_prog_rejected = yes; then
696   # We found a bogon in the path, so make sure we never use it.
697   set dummy $ac_cv_prog_CC
698   shift
699   if test $# -gt 0; then
700     # We chose a different compiler from the bogus one.
701     # However, it has the same basename, so the bogon will be chosen
702     # first if we set CC to just the basename; use the full file name.
703     shift
704     set dummy "$ac_dir/$ac_word" "$@"
705     shift
706     ac_cv_prog_CC="$@"
707   fi
708 fi
709 fi
710 fi
711 CC="$ac_cv_prog_CC"
712 if test -n "$CC"; then
713   echo "$ac_t""$CC" 1>&6
714 else
715   echo "$ac_t""no" 1>&6
716 fi
717
718   if test -z "$CC"; then
719     case "`uname -s`" in
720     *win32* | *WIN32*)
721       # Extract the first word of "cl", so it can be a program name with args.
722 set dummy cl; ac_word=$2
723 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
724 echo "configure:725: checking for $ac_word" >&5
725 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
726   echo $ac_n "(cached) $ac_c" 1>&6
727 else
728   if test -n "$CC"; then
729   ac_cv_prog_CC="$CC" # Let the user override the test.
730 else
731   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
732   ac_dummy="$PATH"
733   for ac_dir in $ac_dummy; do
734     test -z "$ac_dir" && ac_dir=.
735     if test -f $ac_dir/$ac_word; then
736       ac_cv_prog_CC="cl"
737       break
738     fi
739   done
740   IFS="$ac_save_ifs"
741 fi
742 fi
743 CC="$ac_cv_prog_CC"
744 if test -n "$CC"; then
745   echo "$ac_t""$CC" 1>&6
746 else
747   echo "$ac_t""no" 1>&6
748 fi
749  ;;
750     esac
751   fi
752   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
753 fi
754
755 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
756 echo "configure:757: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
757
758 ac_ext=c
759 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
760 ac_cpp='$CPP $CPPFLAGS'
761 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
762 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
763 cross_compiling=$ac_cv_prog_cc_cross
764
765 cat > conftest.$ac_ext << EOF
766
767 #line 768 "configure"
768 #include "confdefs.h"
769
770 main(){return(0);}
771 EOF
772 if { (eval echo configure:773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
773   ac_cv_prog_cc_works=yes
774   # If we can't run a trivial program, we are probably using a cross compiler.
775   if (./conftest; exit) 2>/dev/null; then
776     ac_cv_prog_cc_cross=no
777   else
778     ac_cv_prog_cc_cross=yes
779   fi
780 else
781   echo "configure: failed program was:" >&5
782   cat conftest.$ac_ext >&5
783   ac_cv_prog_cc_works=no
784 fi
785 rm -fr conftest*
786 ac_ext=c
787 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
788 ac_cpp='$CPP $CPPFLAGS'
789 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
790 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
791 cross_compiling=$ac_cv_prog_cc_cross
792
793 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
794 if test $ac_cv_prog_cc_works = no; then
795   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
796 fi
797 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
798 echo "configure:799: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
799 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
800 cross_compiling=$ac_cv_prog_cc_cross
801
802 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
803 echo "configure:804: checking whether we are using GNU C" >&5
804 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
805   echo $ac_n "(cached) $ac_c" 1>&6
806 else
807   cat > conftest.c <<EOF
808 #ifdef __GNUC__
809   yes;
810 #endif
811 EOF
812 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
813   ac_cv_prog_gcc=yes
814 else
815   ac_cv_prog_gcc=no
816 fi
817 fi
818
819 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
820
821 if test $ac_cv_prog_gcc = yes; then
822   GCC=yes
823 else
824   GCC=
825 fi
826
827 ac_test_CFLAGS="${CFLAGS+set}"
828 ac_save_CFLAGS="$CFLAGS"
829 CFLAGS=
830 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
831 echo "configure:832: checking whether ${CC-cc} accepts -g" >&5
832 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
833   echo $ac_n "(cached) $ac_c" 1>&6
834 else
835   echo 'void f(){}' > conftest.c
836 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
837   ac_cv_prog_cc_g=yes
838 else
839   ac_cv_prog_cc_g=no
840 fi
841 rm -f conftest*
842
843 fi
844
845 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
846 if test "$ac_test_CFLAGS" = set; then
847   CFLAGS="$ac_save_CFLAGS"
848 elif test $ac_cv_prog_cc_g = yes; then
849   if test "$GCC" = yes; then
850     CFLAGS="-g -O2"
851   else
852     CFLAGS="-g"
853   fi
854 else
855   if test "$GCC" = yes; then
856     CFLAGS="-O2"
857   else
858     CFLAGS=
859   fi
860 fi
861
862 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
863 echo "configure:864: checking how to run the C preprocessor" >&5
864 # On Suns, sometimes $CPP names a directory.
865 if test -n "$CPP" && test -d "$CPP"; then
866   CPP=
867 fi
868 if test -z "$CPP"; then
869 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
870   echo $ac_n "(cached) $ac_c" 1>&6
871 else
872     # This must be in double quotes, not single quotes, because CPP may get
873   # substituted into the Makefile and "${CC-cc}" will confuse make.
874   CPP="${CC-cc} -E"
875   # On the NeXT, cc -E runs the code through the compiler's parser,
876   # not just through cpp.
877   cat > conftest.$ac_ext <<EOF
878 #line 879 "configure"
879 #include "confdefs.h"
880 #include <assert.h>
881 Syntax Error
882 EOF
883 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
884 { (eval echo configure:885: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
885 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
886 if test -z "$ac_err"; then
887   :
888 else
889   echo "$ac_err" >&5
890   echo "configure: failed program was:" >&5
891   cat conftest.$ac_ext >&5
892   rm -rf conftest*
893   CPP="${CC-cc} -E -traditional-cpp"
894   cat > conftest.$ac_ext <<EOF
895 #line 896 "configure"
896 #include "confdefs.h"
897 #include <assert.h>
898 Syntax Error
899 EOF
900 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
901 { (eval echo configure:902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
902 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
903 if test -z "$ac_err"; then
904   :
905 else
906   echo "$ac_err" >&5
907   echo "configure: failed program was:" >&5
908   cat conftest.$ac_ext >&5
909   rm -rf conftest*
910   CPP="${CC-cc} -nologo -E"
911   cat > conftest.$ac_ext <<EOF
912 #line 913 "configure"
913 #include "confdefs.h"
914 #include <assert.h>
915 Syntax Error
916 EOF
917 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
918 { (eval echo configure:919: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
919 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
920 if test -z "$ac_err"; then
921   :
922 else
923   echo "$ac_err" >&5
924   echo "configure: failed program was:" >&5
925   cat conftest.$ac_ext >&5
926   rm -rf conftest*
927   CPP=/lib/cpp
928 fi
929 rm -f conftest*
930 fi
931 rm -f conftest*
932 fi
933 rm -f conftest*
934   ac_cv_prog_CPP="$CPP"
935 fi
936   CPP="$ac_cv_prog_CPP"
937 else
938   ac_cv_prog_CPP="$CPP"
939 fi
940 echo "$ac_t""$CPP" 1>&6
941
942 for ac_prog in mawk gawk nawk awk
943 do
944 # Extract the first word of "$ac_prog", so it can be a program name with args.
945 set dummy $ac_prog; ac_word=$2
946 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
947 echo "configure:948: checking for $ac_word" >&5
948 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
949   echo $ac_n "(cached) $ac_c" 1>&6
950 else
951   if test -n "$AWK"; then
952   ac_cv_prog_AWK="$AWK" # Let the user override the test.
953 else
954   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
955   ac_dummy="$PATH"
956   for ac_dir in $ac_dummy; do
957     test -z "$ac_dir" && ac_dir=.
958     if test -f $ac_dir/$ac_word; then
959       ac_cv_prog_AWK="$ac_prog"
960       break
961     fi
962   done
963   IFS="$ac_save_ifs"
964 fi
965 fi
966 AWK="$ac_cv_prog_AWK"
967 if test -n "$AWK"; then
968   echo "$ac_t""$AWK" 1>&6
969 else
970   echo "$ac_t""no" 1>&6
971 fi
972
973 test -n "$AWK" && break
974 done
975
976 # Find a good install program.  We prefer a C program (faster),
977 # so one script is as good as another.  But avoid the broken or
978 # incompatible versions:
979 # SysV /etc/install, /usr/sbin/install
980 # SunOS /usr/etc/install
981 # IRIX /sbin/install
982 # AIX /bin/install
983 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
984 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
985 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
986 # ./install, which can be erroneously created by make from ./install.sh.
987 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
988 echo "configure:989: checking for a BSD compatible install" >&5
989 if test -z "$INSTALL"; then
990 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
991   echo $ac_n "(cached) $ac_c" 1>&6
992 else
993     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
994   for ac_dir in $PATH; do
995     # Account for people who put trailing slashes in PATH elements.
996     case "$ac_dir/" in
997     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
998     *)
999       # OSF1 and SCO ODT 3.0 have their own names for install.
1000       # Don't use installbsd from OSF since it installs stuff as root
1001       # by default.
1002       for ac_prog in ginstall scoinst install; do
1003         if test -f $ac_dir/$ac_prog; then
1004           if test $ac_prog = install &&
1005             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1006             # AIX install.  It has an incompatible calling convention.
1007             :
1008           else
1009             ac_cv_path_install="$ac_dir/$ac_prog -c"
1010             break 2
1011           fi
1012         fi
1013       done
1014       ;;
1015     esac
1016   done
1017   IFS="$ac_save_IFS"
1018
1019 fi
1020   if test "${ac_cv_path_install+set}" = set; then
1021     INSTALL="$ac_cv_path_install"
1022   else
1023     # As a last resort, use the slow shell script.  We don't cache a
1024     # path for INSTALL within a source directory, because that will
1025     # break other packages using the cache if that directory is
1026     # removed, or if the path is relative.
1027     INSTALL="$ac_install_sh"
1028   fi
1029 fi
1030 echo "$ac_t""$INSTALL" 1>&6
1031
1032 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1033 # It thinks the first close brace ends the variable substitution.
1034 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1035
1036 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1037
1038 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1039
1040 case $INSTALL in
1041 /*)
1042   ;;
1043 *)
1044   cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
1045   test -z "$cf_dir" && cf_dir=.
1046   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
1047   ;;
1048 esac
1049
1050 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1051 echo "configure:1052: checking whether ln -s works" >&5
1052 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1053   echo $ac_n "(cached) $ac_c" 1>&6
1054 else
1055   rm -f conftestdata
1056 if ln -s X conftestdata 2>/dev/null
1057 then
1058   rm -f conftestdata
1059   ac_cv_prog_LN_S="ln -s"
1060 else
1061   ac_cv_prog_LN_S=ln
1062 fi
1063 fi
1064 LN_S="$ac_cv_prog_LN_S"
1065 if test "$ac_cv_prog_LN_S" = "ln -s"; then
1066   echo "$ac_t""yes" 1>&6
1067 else
1068   echo "$ac_t""no" 1>&6
1069 fi
1070
1071
1072 echo $ac_n "checking if filesystem supports mixed-case filenames""... $ac_c" 1>&6
1073 echo "configure:1074: checking if filesystem supports mixed-case filenames" >&5
1074 if eval "test \"`echo '$''{'cf_cv_mixedcase'+set}'`\" = set"; then
1075   echo $ac_n "(cached) $ac_c" 1>&6
1076 else
1077   
1078 if test "$cross_compiling" = yes ; then
1079         case $target_alias in #(vi
1080         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
1081                 cf_cv_mixedcase=no
1082                 ;;
1083         *)
1084                 cf_cv_mixedcase=yes
1085                 ;;
1086         esac
1087 else
1088         rm -f conftest CONFTEST
1089         echo test >conftest
1090         if test -f CONFTEST ; then
1091                 cf_cv_mixedcase=no
1092         else
1093                 cf_cv_mixedcase=yes
1094         fi
1095         rm -f conftest CONFTEST
1096 fi
1097
1098 fi
1099
1100 echo "$ac_t""$cf_cv_mixedcase" 1>&6
1101 test "$cf_cv_mixedcase" = yes && cat >> confdefs.h <<\EOF
1102 #define MIXEDCASE_FILENAMES 1
1103 EOF
1104
1105
1106
1107
1108 # Extract the first word of "ctags", so it can be a program name with args.
1109 set dummy ctags; ac_word=$2
1110 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1111 echo "configure:1112: checking for $ac_word" >&5
1112 if eval "test \"`echo '$''{'ac_cv_prog_MAKE_LOWER_TAGS'+set}'`\" = set"; then
1113   echo $ac_n "(cached) $ac_c" 1>&6
1114 else
1115   if test -n "$MAKE_LOWER_TAGS"; then
1116   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
1117 else
1118   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1119   ac_dummy="$PATH"
1120   for ac_dir in $ac_dummy; do
1121     test -z "$ac_dir" && ac_dir=.
1122     if test -f $ac_dir/$ac_word; then
1123       ac_cv_prog_MAKE_LOWER_TAGS="yes"
1124       break
1125     fi
1126   done
1127   IFS="$ac_save_ifs"
1128   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
1129 fi
1130 fi
1131 MAKE_LOWER_TAGS="$ac_cv_prog_MAKE_LOWER_TAGS"
1132 if test -n "$MAKE_LOWER_TAGS"; then
1133   echo "$ac_t""$MAKE_LOWER_TAGS" 1>&6
1134 else
1135   echo "$ac_t""no" 1>&6
1136 fi
1137
1138
1139 if test "$cf_cv_mixedcase" = yes ; then
1140         # Extract the first word of "etags", so it can be a program name with args.
1141 set dummy etags; ac_word=$2
1142 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1143 echo "configure:1144: checking for $ac_word" >&5
1144 if eval "test \"`echo '$''{'ac_cv_prog_MAKE_UPPER_TAGS'+set}'`\" = set"; then
1145   echo $ac_n "(cached) $ac_c" 1>&6
1146 else
1147   if test -n "$MAKE_UPPER_TAGS"; then
1148   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
1149 else
1150   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1151   ac_dummy="$PATH"
1152   for ac_dir in $ac_dummy; do
1153     test -z "$ac_dir" && ac_dir=.
1154     if test -f $ac_dir/$ac_word; then
1155       ac_cv_prog_MAKE_UPPER_TAGS="yes"
1156       break
1157     fi
1158   done
1159   IFS="$ac_save_ifs"
1160   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
1161 fi
1162 fi
1163 MAKE_UPPER_TAGS="$ac_cv_prog_MAKE_UPPER_TAGS"
1164 if test -n "$MAKE_UPPER_TAGS"; then
1165   echo "$ac_t""$MAKE_UPPER_TAGS" 1>&6
1166 else
1167   echo "$ac_t""no" 1>&6
1168 fi
1169
1170 else
1171         MAKE_UPPER_TAGS=no
1172 fi
1173
1174 if test "$MAKE_UPPER_TAGS" = yes ; then
1175         MAKE_UPPER_TAGS=
1176 else
1177         MAKE_UPPER_TAGS="#"
1178 fi
1179
1180
1181 if test "$MAKE_LOWER_TAGS" = yes ; then
1182         MAKE_LOWER_TAGS=
1183 else
1184         MAKE_LOWER_TAGS="#"
1185 fi
1186
1187
1188
1189 CC_G_OPT="-g"                           
1190 CC_SHARED_OPTS=unknown                  
1191 CPPFLAGS="$CPPFLAGS"                    
1192 DESTDIR=""                              
1193 DFT_DEP_SUFFIX=""                       
1194 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`    
1195 DFT_UPR_MODEL="NORMAL"                  
1196 ECHO_LINK='@ echo linking $@ ... ;'     
1197 EXTRA_LDFLAGS=""                        
1198 LD="ld"                                 
1199 LDFLAGS_SHARED=""                       
1200 LD_MODEL=""                             
1201 LD_SHARED_OPTS=""                       
1202 LIBTOOL=""                              
1203 LIB_CLEAN=""                            
1204 LIB_COMPILE=""                          
1205 LIB_INSTALL=""                          
1206 LIB_LINK=""                             
1207 LIB_SUFFIX=""                           
1208 LIB_UNINSTALL=""                        
1209 LINK_PROGS=""                           
1210 LINT=lint                               
1211 LINT_OPTS=""                            
1212 LOCAL_LDFLAGS=""                        
1213 MATH_LIB="-lm"                          
1214 TICS_ARGS=""                            
1215 TINFO_ARGS='$(LIBS_CURSES)'             
1216 cf_cv_abi_version=""                    
1217 cf_cv_rel_version=""                    
1218
1219 NCURSES_TREE="#"
1220
1221
1222 cf_cv_screen=curses
1223 cf_cv_libtype=
1224
1225 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
1226 echo "configure:1227: checking for Cygwin environment" >&5
1227 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
1228   echo $ac_n "(cached) $ac_c" 1>&6
1229 else
1230   cat > conftest.$ac_ext <<EOF
1231 #line 1232 "configure"
1232 #include "confdefs.h"
1233
1234 int main() {
1235
1236 #ifndef __CYGWIN__
1237 #define __CYGWIN__ __CYGWIN32__
1238 #endif
1239 return __CYGWIN__;
1240 ; return 0; }
1241 EOF
1242 if { (eval echo configure:1243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1243   rm -rf conftest*
1244   ac_cv_cygwin=yes
1245 else
1246   echo "configure: failed program was:" >&5
1247   cat conftest.$ac_ext >&5
1248   rm -rf conftest*
1249   ac_cv_cygwin=no
1250 fi
1251 rm -f conftest*
1252 rm -f conftest*
1253 fi
1254
1255 echo "$ac_t""$ac_cv_cygwin" 1>&6
1256 CYGWIN=
1257 test "$ac_cv_cygwin" = yes && CYGWIN=yes
1258 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
1259 echo "configure:1260: checking for mingw32 environment" >&5
1260 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
1261   echo $ac_n "(cached) $ac_c" 1>&6
1262 else
1263   cat > conftest.$ac_ext <<EOF
1264 #line 1265 "configure"
1265 #include "confdefs.h"
1266
1267 int main() {
1268 return __MINGW32__;
1269 ; return 0; }
1270 EOF
1271 if { (eval echo configure:1272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1272   rm -rf conftest*
1273   ac_cv_mingw32=yes
1274 else
1275   echo "configure: failed program was:" >&5
1276   cat conftest.$ac_ext >&5
1277   rm -rf conftest*
1278   ac_cv_mingw32=no
1279 fi
1280 rm -f conftest*
1281 rm -f conftest*
1282 fi
1283
1284 echo "$ac_t""$ac_cv_mingw32" 1>&6
1285 MINGW32=
1286 test "$ac_cv_mingw32" = yes && MINGW32=yes
1287
1288
1289 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1290 echo "configure:1291: checking for executable suffix" >&5
1291 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
1292   echo $ac_n "(cached) $ac_c" 1>&6
1293 else
1294   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
1295   ac_cv_exeext=.exe
1296 else
1297   rm -f conftest*
1298   echo 'int main () { return 0; }' > conftest.$ac_ext
1299   ac_cv_exeext=
1300   if { (eval echo configure:1301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1301     for file in conftest.*; do
1302       case $file in
1303       *.c | *.o | *.obj) ;;
1304       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
1305       esac
1306     done
1307   else
1308     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
1309   fi
1310   rm -f conftest*
1311   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
1312 fi
1313 fi
1314
1315 EXEEXT=""
1316 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
1317 echo "$ac_t""${ac_cv_exeext}" 1>&6
1318 ac_exeext=$EXEEXT
1319
1320 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
1321 echo "configure:1322: checking for object suffix" >&5
1322 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
1323   echo $ac_n "(cached) $ac_c" 1>&6
1324 else
1325   rm -f conftest*
1326 echo 'int i = 1;' > conftest.$ac_ext
1327 if { (eval echo configure:1328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1328   for ac_file in conftest.*; do
1329     case $ac_file in
1330     *.c) ;;
1331     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
1332     esac
1333   done
1334 else
1335   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
1336 fi
1337 rm -f conftest*
1338 fi
1339
1340 echo "$ac_t""$ac_cv_objext" 1>&6
1341 OBJEXT=$ac_cv_objext
1342 ac_objext=$ac_cv_objext
1343
1344
1345
1346 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1347 echo "configure:1348: checking for ${CC-cc} option to accept ANSI C" >&5
1348 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
1349   echo $ac_n "(cached) $ac_c" 1>&6
1350 else
1351   
1352 cf_cv_ansi_cc=no
1353 cf_save_CFLAGS="$CFLAGS"
1354 cf_save_CPPFLAGS="$CPPFLAGS"
1355 # Don't try gcc -ansi; that turns off useful extensions and
1356 # breaks some systems' header files.
1357 # AIX                   -qlanglvl=ansi
1358 # Ultrix and OSF/1      -std1
1359 # HP-UX                 -Aa -D_HPUX_SOURCE
1360 # SVR4                  -Xc
1361 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
1362 for cf_arg in "-DCC_HAS_PROTOS" \
1363         "" \
1364         -qlanglvl=ansi \
1365         -std1 \
1366         -Ae \
1367         "-Aa -D_HPUX_SOURCE" \
1368         -Xc
1369 do
1370         
1371 cf_fix_cppflags=no
1372 cf_new_cflags=
1373 cf_new_cppflags=
1374 cf_new_extra_cppflags=
1375
1376 for cf_add_cflags in $cf_arg
1377 do
1378 case $cf_fix_cppflags in
1379 no)
1380         case $cf_add_cflags in #(vi
1381         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1382                 case $cf_add_cflags in
1383                 -D*)
1384                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1385
1386                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1387                         && test -z "${cf_tst_cflags}" \
1388                         && cf_fix_cppflags=yes
1389
1390                         if test $cf_fix_cppflags = yes ; then
1391                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1392                                 continue
1393                         elif test "${cf_tst_cflags}" = "\"'" ; then
1394                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1395                                 continue
1396                         fi
1397                         ;;
1398                 esac
1399                 case "$CPPFLAGS" in
1400                 *$cf_add_cflags) #(vi
1401                         ;;
1402                 *) #(vi
1403                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1404                         ;;
1405                 esac
1406                 ;;
1407         *)
1408                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1409                 ;;
1410         esac
1411         ;;
1412 yes)
1413         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1414
1415         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1416
1417         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1418         && test -z "${cf_tst_cflags}" \
1419         && cf_fix_cppflags=no
1420         ;;
1421 esac
1422 done
1423
1424 if test -n "$cf_new_cflags" ; then
1425         
1426         CFLAGS="$CFLAGS $cf_new_cflags"
1427 fi
1428
1429 if test -n "$cf_new_cppflags" ; then
1430         
1431         CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
1432 fi
1433
1434 if test -n "$cf_new_extra_cppflags" ; then
1435         
1436         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1437 fi
1438
1439
1440
1441
1442         cat > conftest.$ac_ext <<EOF
1443 #line 1444 "configure"
1444 #include "confdefs.h"
1445
1446 #ifndef CC_HAS_PROTOS
1447 #if !defined(__STDC__) || (__STDC__ != 1)
1448 choke me
1449 #endif
1450 #endif
1451
1452 int main() {
1453
1454         int test (int i, double x);
1455         struct s1 {int (*f) (int a);};
1456         struct s2 {int (*f) (double a);};
1457 ; return 0; }
1458 EOF
1459 if { (eval echo configure:1460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1460   rm -rf conftest*
1461   cf_cv_ansi_cc="$cf_arg"; break
1462 else
1463   echo "configure: failed program was:" >&5
1464   cat conftest.$ac_ext >&5
1465 fi
1466 rm -f conftest*
1467 done
1468 CFLAGS="$cf_save_CFLAGS"
1469 CPPFLAGS="$cf_save_CPPFLAGS"
1470
1471 fi
1472
1473 echo "$ac_t""$cf_cv_ansi_cc" 1>&6
1474
1475 if test "$cf_cv_ansi_cc" != "no"; then
1476 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1477         
1478 cf_fix_cppflags=no
1479 cf_new_cflags=
1480 cf_new_cppflags=
1481 cf_new_extra_cppflags=
1482
1483 for cf_add_cflags in $cf_cv_ansi_cc
1484 do
1485 case $cf_fix_cppflags in
1486 no)
1487         case $cf_add_cflags in #(vi
1488         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1489                 case $cf_add_cflags in
1490                 -D*)
1491                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1492
1493                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1494                         && test -z "${cf_tst_cflags}" \
1495                         && cf_fix_cppflags=yes
1496
1497                         if test $cf_fix_cppflags = yes ; then
1498                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1499                                 continue
1500                         elif test "${cf_tst_cflags}" = "\"'" ; then
1501                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1502                                 continue
1503                         fi
1504                         ;;
1505                 esac
1506                 case "$CPPFLAGS" in
1507                 *$cf_add_cflags) #(vi
1508                         ;;
1509                 *) #(vi
1510                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1511                         ;;
1512                 esac
1513                 ;;
1514         *)
1515                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1516                 ;;
1517         esac
1518         ;;
1519 yes)
1520         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1521
1522         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1523
1524         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1525         && test -z "${cf_tst_cflags}" \
1526         && cf_fix_cppflags=no
1527         ;;
1528 esac
1529 done
1530
1531 if test -n "$cf_new_cflags" ; then
1532         
1533         CFLAGS="$CFLAGS $cf_new_cflags"
1534 fi
1535
1536 if test -n "$cf_new_cppflags" ; then
1537         
1538         CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
1539 fi
1540
1541 if test -n "$cf_new_extra_cppflags" ; then
1542         
1543         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1544 fi
1545
1546
1547
1548
1549 else
1550         cat >> confdefs.h <<\EOF
1551 #define CC_HAS_PROTOS 1
1552 EOF
1553
1554 fi
1555 fi
1556
1557
1558 if test "$cf_cv_ansi_cc" = "no"; then
1559         { echo "configure: error: Your compiler does not appear to recognize prototypes.
1560 You have the following choices:
1561         a. adjust your compiler options
1562         b. get an up-to-date compiler
1563         c. use a wrapper such as unproto" 1>&2; exit 1; }
1564 fi
1565
1566
1567
1568 GCC_VERSION=none
1569 if test "$GCC" = yes ; then
1570         echo $ac_n "checking version of $CC""... $ac_c" 1>&6
1571 echo "configure:1572: checking version of $CC" >&5
1572         GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1573         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1574         echo "$ac_t""$GCC_VERSION" 1>&6
1575 fi
1576
1577
1578 if ( test "$GCC" = yes || test "$GXX" = yes )
1579 then
1580 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
1581 echo "configure:1582: checking if you want to turn on gcc warnings" >&5
1582
1583 # Check whether --enable-warnings or --disable-warnings was given.
1584 if test "${enable_warnings+set}" = set; then
1585   enableval="$enable_warnings"
1586   test "$enableval" != yes && enableval=no
1587   if test "$enableval" != "no" ; then
1588     with_warnings=yes 
1589   else
1590     with_warnings=no
1591   fi
1592 else
1593   enableval=no 
1594   with_warnings=no
1595   
1596 fi
1597
1598 echo "$ac_t""$with_warnings" 1>&6
1599 if test "$with_warnings" = "yes"
1600 then
1601         
1602
1603
1604 INTEL_COMPILER=no
1605
1606 if test "$GCC" = yes ; then
1607         case $host_os in
1608         linux*|gnu*)
1609                 echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
1610 echo "configure:1611: checking if this is really Intel C compiler" >&5
1611                 cf_save_CFLAGS="$CFLAGS"
1612                 CFLAGS="$CFLAGS -no-gcc"
1613                 cat > conftest.$ac_ext <<EOF
1614 #line 1615 "configure"
1615 #include "confdefs.h"
1616
1617 int main() {
1618
1619 #ifdef __INTEL_COMPILER
1620 #else
1621 make an error
1622 #endif
1623
1624 ; return 0; }
1625 EOF
1626 if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1627   rm -rf conftest*
1628   INTEL_COMPILER=yes
1629 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
1630
1631 else
1632   echo "configure: failed program was:" >&5
1633   cat conftest.$ac_ext >&5
1634 fi
1635 rm -f conftest*
1636                 CFLAGS="$cf_save_CFLAGS"
1637                 echo "$ac_t""$INTEL_COMPILER" 1>&6
1638                 ;;
1639         esac
1640 fi
1641
1642
1643 cat > conftest.$ac_ext <<EOF
1644 #line 1645 "configure"
1645 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
1646 EOF
1647
1648 if test "$INTEL_COMPILER" = yes
1649 then
1650 # The "-wdXXX" options suppress warnings:
1651 # remark #1419: external declaration in primary source file
1652 # remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
1653 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
1654 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
1655 # remark #193: zero used for undefined preprocessing identifier
1656 # remark #593: variable "curs_sb_left_arrow" was set but never used
1657 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
1658 # remark #869: parameter "tw" was never referenced
1659 # remark #981: operands are evaluated in unspecified order
1660 # warning #269: invalid format string conversion
1661
1662         echo "checking for $CC warning options" 1>&6
1663 echo "configure:1664: checking for $CC warning options" >&5
1664         cf_save_CFLAGS="$CFLAGS"
1665         EXTRA_CFLAGS="-Wall"
1666         for cf_opt in  \
1667                 wd1419 \
1668                 wd1682 \
1669                 wd1683 \
1670                 wd1684 \
1671                 wd193 \
1672                 wd279 \
1673                 wd593 \
1674                 wd810 \
1675                 wd869 \
1676                 wd981
1677         do
1678                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
1679                 if { (eval echo configure:1680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1680                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
1681                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
1682                 fi
1683         done
1684         CFLAGS="$cf_save_CFLAGS"
1685
1686 elif test "$GCC" = yes
1687 then
1688         echo "checking for $CC warning options" 1>&6
1689 echo "configure:1690: checking for $CC warning options" >&5
1690         cf_save_CFLAGS="$CFLAGS"
1691         EXTRA_CFLAGS="-W -Wall"
1692         cf_warn_CONST=""
1693         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
1694         for cf_opt in \
1695                 Wbad-function-cast \
1696                 Wcast-align \
1697                 Wcast-qual \
1698                 Winline \
1699                 Wmissing-declarations \
1700                 Wmissing-prototypes \
1701                 Wnested-externs \
1702                 Wpointer-arith \
1703                 Wshadow \
1704                 Wstrict-prototypes \
1705                 Wundef $cf_warn_CONST 
1706         do
1707                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
1708                 if { (eval echo configure:1709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1709                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
1710                         case $cf_opt in #(vi
1711                         Wcast-qual) #(vi
1712                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
1713                                 ;;
1714                         Winline) #(vi
1715                                 case $GCC_VERSION in
1716                                 3.3*)
1717                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
1718
1719                                         continue;;
1720                                 esac
1721                                 ;;
1722                         esac
1723                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
1724                 fi
1725         done
1726         CFLAGS="$cf_save_CFLAGS"
1727 fi
1728 rm -f conftest*
1729
1730
1731
1732 fi
1733 fi
1734
1735
1736 if test "$GCC" = yes
1737 then
1738 cat > conftest.i <<EOF
1739 #ifndef GCC_PRINTF
1740 #define GCC_PRINTF 0
1741 #endif
1742 #ifndef GCC_SCANF
1743 #define GCC_SCANF 0
1744 #endif
1745 #ifndef GCC_NORETURN
1746 #define GCC_NORETURN /* nothing */
1747 #endif
1748 #ifndef GCC_UNUSED
1749 #define GCC_UNUSED /* nothing */
1750 #endif
1751 EOF
1752 if test "$GCC" = yes
1753 then
1754         echo "checking for $CC __attribute__ directives" 1>&6
1755 echo "configure:1756: checking for $CC __attribute__ directives" >&5
1756 cat > conftest.$ac_ext <<EOF
1757 #line 1758 "configure"
1758 #include "confdefs.h"
1759 #include "conftest.h"
1760 #include "conftest.i"
1761 #if     GCC_PRINTF
1762 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
1763 #else
1764 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
1765 #endif
1766 #if     GCC_SCANF
1767 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
1768 #else
1769 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
1770 #endif
1771 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
1772 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
1773 extern void foo(void) GCC_NORETURN;
1774 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
1775 EOF
1776         for cf_attribute in scanf printf unused noreturn
1777         do
1778                 
1779 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1780
1781                 cf_directive="__attribute__(($cf_attribute))"
1782                 echo "checking for $CC $cf_directive" 1>&5
1783                 case $cf_attribute in
1784                 scanf|printf)
1785                 cat >conftest.h <<EOF
1786 #define GCC_$cf_ATTRIBUTE 1
1787 EOF
1788                         ;;
1789                 *)
1790                 cat >conftest.h <<EOF
1791 #define GCC_$cf_ATTRIBUTE $cf_directive
1792 EOF
1793                         ;;
1794                 esac
1795                 if { (eval echo configure:1796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1796                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
1797                         cat conftest.h >>confdefs.h
1798                 fi
1799         done
1800 else
1801         fgrep define conftest.i >>confdefs.h
1802 fi
1803 rm -rf conftest*
1804 fi
1805
1806
1807 echo $ac_n "checking if $CC -U and -D options work together""... $ac_c" 1>&6
1808 echo "configure:1809: checking if $CC -U and -D options work together" >&5
1809 if eval "test \"`echo '$''{'cf_cv_cc_u_d_options'+set}'`\" = set"; then
1810   echo $ac_n "(cached) $ac_c" 1>&6
1811 else
1812   
1813         cf_save_CPPFLAGS="$CPPFLAGS"
1814         CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
1815         cat > conftest.$ac_ext <<EOF
1816 #line 1817 "configure"
1817 #include "confdefs.h"
1818
1819 int main() {
1820
1821 #ifndef U_D_OPTIONS
1822 make an undefined-error
1823 #endif
1824 #ifdef  D_U_OPTIONS
1825 make a defined-error
1826 #endif
1827         
1828 ; return 0; }
1829 EOF
1830 if { (eval echo configure:1831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1831   rm -rf conftest*
1832   
1833         cf_cv_cc_u_d_options=yes
1834 else
1835   echo "configure: failed program was:" >&5
1836   cat conftest.$ac_ext >&5
1837   rm -rf conftest*
1838   
1839         cf_cv_cc_u_d_options=no
1840 fi
1841 rm -f conftest*
1842         CPPFLAGS="$cf_save_CPPFLAGS"
1843
1844 fi
1845
1846 echo "$ac_t""$cf_cv_cc_u_d_options" 1>&6
1847
1848
1849
1850
1851
1852 cf_XOPEN_SOURCE=500
1853 cf_POSIX_C_SOURCE=199506L
1854
1855 case $host_os in #(vi
1856 aix[45]*) #(vi
1857         CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
1858         ;;
1859 freebsd*) #(vi
1860         # 5.x headers associate
1861         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
1862         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
1863         cf_POSIX_C_SOURCE=200112L
1864         cf_XOPEN_SOURCE=600
1865         CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1866         ;;
1867 hpux*) #(vi
1868         CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
1869         ;;
1870 irix[56].*) #(vi
1871         CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
1872         ;;
1873 linux*|gnu*) #(vi
1874         
1875 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
1876 echo "configure:1877: checking if we must define _GNU_SOURCE" >&5
1877 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
1878   echo $ac_n "(cached) $ac_c" 1>&6
1879 else
1880   
1881 cat > conftest.$ac_ext <<EOF
1882 #line 1883 "configure"
1883 #include "confdefs.h"
1884 #include <sys/types.h>
1885 int main() {
1886
1887 #ifndef _XOPEN_SOURCE
1888 make an error
1889 #endif
1890 ; return 0; }
1891 EOF
1892 if { (eval echo configure:1893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1893   rm -rf conftest*
1894   cf_cv_gnu_source=no
1895 else
1896   echo "configure: failed program was:" >&5
1897   cat conftest.$ac_ext >&5
1898   rm -rf conftest*
1899   cf_save="$CPPFLAGS"
1900          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1901          cat > conftest.$ac_ext <<EOF
1902 #line 1903 "configure"
1903 #include "confdefs.h"
1904 #include <sys/types.h>
1905 int main() {
1906
1907 #ifdef _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_cv_gnu_source=yes
1920 fi
1921 rm -f conftest*
1922         CPPFLAGS="$cf_save"
1923         
1924 fi
1925 rm -f conftest*
1926
1927 fi
1928
1929 echo "$ac_t""$cf_cv_gnu_source" 1>&6
1930 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1931
1932         ;;
1933 mirbsd*) #(vi
1934         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
1935         ;;
1936 netbsd*) #(vi
1937         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
1938         ;;
1939 openbsd*) #(vi
1940         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
1941         ;;
1942 osf[45]*) #(vi
1943         CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
1944         ;;
1945 nto-qnx*) #(vi
1946         CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
1947         ;;
1948 sco*) #(vi
1949         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
1950         ;;
1951 solaris*) #(vi
1952         CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
1953         ;;
1954 *)
1955         echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
1956 echo "configure:1957: checking if we should define _XOPEN_SOURCE" >&5
1957 if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
1958   echo $ac_n "(cached) $ac_c" 1>&6
1959 else
1960   
1961         cat > conftest.$ac_ext <<EOF
1962 #line 1963 "configure"
1963 #include "confdefs.h"
1964 #include <sys/types.h>
1965 int main() {
1966
1967 #ifndef _XOPEN_SOURCE
1968 make an error
1969 #endif
1970 ; return 0; }
1971 EOF
1972 if { (eval echo configure:1973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1973   rm -rf conftest*
1974   cf_cv_xopen_source=no
1975 else
1976   echo "configure: failed program was:" >&5
1977   cat conftest.$ac_ext >&5
1978   rm -rf conftest*
1979   cf_save="$CPPFLAGS"
1980          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1981          cat > conftest.$ac_ext <<EOF
1982 #line 1983 "configure"
1983 #include "confdefs.h"
1984 #include <sys/types.h>
1985 int main() {
1986
1987 #ifdef _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_cv_xopen_source=$cf_XOPEN_SOURCE
2000 fi
2001 rm -f conftest*
2002         CPPFLAGS="$cf_save"
2003         
2004 fi
2005 rm -f conftest*
2006
2007 fi
2008
2009 echo "$ac_t""$cf_cv_xopen_source" 1>&6
2010         if test "$cf_cv_xopen_source" != no ; then
2011                 
2012 # remove _XOPEN_SOURCE symbol from $CFLAGS
2013 CFLAGS=`echo "$CFLAGS" | \
2014         sed     -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?[         ]/ /g' \
2015                 -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?$//g'`
2016
2017                 
2018 # remove _XOPEN_SOURCE symbol from $CPPFLAGS
2019 CPPFLAGS=`echo "$CPPFLAGS" | \
2020         sed     -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?[         ]/ /g' \
2021                 -e 's/-[UD]_XOPEN_SOURCE\(=[^   ]*\)\?$//g'`
2022
2023                 test "$cf_cv_cc_u_d_options" = yes && \
2024                         CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
2025                 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
2026         fi
2027         
2028 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2029
2030 cf_save_CFLAGS="$CFLAGS"
2031 cf_save_CPPFLAGS="$CPPFLAGS"
2032
2033
2034 # remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS
2035 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2036         sed     -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?[         ]/ /g' \
2037                 -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?$//g'`
2038
2039
2040 # remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS
2041 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2042         sed     -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?[         ]/ /g' \
2043                 -e 's/-[UD]_POSIX_C_SOURCE\(=[^         ]*\)\?$//g'`
2044
2045
2046 echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
2047 echo "configure:2048: checking if we should define _POSIX_C_SOURCE" >&5
2048 if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
2049   echo $ac_n "(cached) $ac_c" 1>&6
2050 else
2051   
2052         
2053 echo "(line 2054) testing if the symbol is already defined go no further ..." 1>&5
2054
2055         cat > conftest.$ac_ext <<EOF
2056 #line 2057 "configure"
2057 #include "confdefs.h"
2058 #include <sys/types.h>
2059 int main() {
2060
2061 #ifndef _POSIX_C_SOURCE
2062 make an error
2063 #endif
2064 ; return 0; }
2065 EOF
2066 if { (eval echo configure:2067: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2067   rm -rf conftest*
2068   cf_cv_posix_c_source=no
2069 else
2070   echo "configure: failed program was:" >&5
2071   cat conftest.$ac_ext >&5
2072   rm -rf conftest*
2073   cf_want_posix_source=no
2074          case .$cf_POSIX_C_SOURCE in #(vi
2075          .[12]??*) #(vi
2076                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2077                 ;;
2078          .2) #(vi
2079                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2080                 cf_want_posix_source=yes
2081                 ;;
2082          .*)
2083                 cf_want_posix_source=yes
2084                 ;;
2085          esac
2086          if test "$cf_want_posix_source" = yes ; then
2087                 cat > conftest.$ac_ext <<EOF
2088 #line 2089 "configure"
2089 #include "confdefs.h"
2090 #include <sys/types.h>
2091 int main() {
2092
2093 #ifdef _POSIX_SOURCE
2094 make an error
2095 #endif
2096 ; return 0; }
2097 EOF
2098 if { (eval echo configure:2099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2099   :
2100 else
2101   echo "configure: failed program was:" >&5
2102   cat conftest.$ac_ext >&5
2103   rm -rf conftest*
2104   cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
2105 fi
2106 rm -f conftest*
2107          fi
2108          
2109 echo "(line 2110) testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
2110
2111          CFLAGS="$cf_trim_CFLAGS"
2112          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
2113          
2114 echo "(line 2115) testing if the second compile does not leave our definition intact error ..." 1>&5
2115
2116          cat > conftest.$ac_ext <<EOF
2117 #line 2118 "configure"
2118 #include "confdefs.h"
2119 #include <sys/types.h>
2120 int main() {
2121
2122 #ifndef _POSIX_C_SOURCE
2123 make an error
2124 #endif
2125 ; return 0; }
2126 EOF
2127 if { (eval echo configure:2128: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2128   :
2129 else
2130   echo "configure: failed program was:" >&5
2131   cat conftest.$ac_ext >&5
2132   rm -rf conftest*
2133   cf_cv_posix_c_source=no
2134 fi
2135 rm -f conftest*
2136          CFLAGS="$cf_save_CFLAGS"
2137          CPPFLAGS="$cf_save_CPPFLAGS"
2138         
2139 fi
2140 rm -f conftest*
2141
2142 fi
2143
2144 echo "$ac_t""$cf_cv_posix_c_source" 1>&6
2145
2146 if test "$cf_cv_posix_c_source" != no ; then
2147         CFLAGS="$cf_trim_CFLAGS"
2148         CPPFLAGS="$cf_trim_CPPFLAGS"
2149         if test "$cf_cv_cc_u_d_options" = yes ; then
2150                 cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
2151                                 sed -e 's/-D/-U/g' -e 's/=[^    ]*//g'`
2152                 CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
2153         fi
2154         CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
2155 fi
2156
2157
2158         ;;
2159 esac
2160
2161
2162
2163
2164 # Check whether --with-curses-dir or --without-curses-dir was given.
2165 if test "${with_curses_dir+set}" = set; then
2166   withval="$with_curses_dir"
2167   
2168 if test "x$prefix" != xNONE; then
2169   cf_path_syntax="$prefix"
2170 else
2171   cf_path_syntax="$ac_default_prefix"
2172 fi
2173
2174 case ".$withval" in #(vi
2175 .\$\(*\)*|.\'*\'*) #(vi
2176   ;;
2177 ..|./*|.\\*) #(vi
2178   ;;
2179 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2180   ;;
2181 .\${*prefix}*) #(vi
2182   eval withval="$withval"
2183   case ".$withval" in #(vi
2184   .NONE/*)
2185     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2186     ;;
2187   esac
2188   ;; #(vi
2189 .no|.NONE/*)
2190   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2191   ;;
2192 *)
2193   { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
2194   ;;
2195 esac
2196
2197          cf_cv_curses_dir=$withval
2198 else
2199   cf_cv_curses_dir=no
2200 fi
2201
2202
2203
2204
2205 # Check whether --with-5lib or --without-5lib was given.
2206 if test "${with_5lib+set}" = set; then
2207   withval="$with_5lib"
2208   LIBS="-L/usr/5lib $LIBS"
2209          CPPFLAGS="$CPPFLAGS -I/usr/5include"
2210 fi
2211
2212
2213
2214 # Check whether --with-ncursesw or --without-ncursesw was given.
2215 if test "${with_ncursesw+set}" = set; then
2216   withval="$with_ncursesw"
2217   cf_cv_screen=ncursesw
2218 else
2219   
2220
2221
2222 # Check whether --with-ncurses or --without-ncurses was given.
2223 if test "${with_ncurses+set}" = set; then
2224   withval="$with_ncurses"
2225   cf_cv_screen=ncurses
2226 else
2227   
2228
2229
2230 # Check whether --with-pdcurses or --without-pdcurses was given.
2231 if test "${with_pdcurses+set}" = set; then
2232   withval="$with_pdcurses"
2233   cf_cv_screen=pdcurses
2234 fi
2235
2236 fi
2237
2238 fi
2239
2240
2241 case $cf_cv_screen in
2242 curses)
2243         
2244
2245 echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
2246 echo "configure:2247: checking for extra include directories" >&5
2247 if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
2248   echo $ac_n "(cached) $ac_c" 1>&6
2249 else
2250   
2251 cf_cv_curses_incdir=no
2252 case $host_os in #(vi
2253 hpux10.*) #(vi
2254         test -d /usr/include/curses_colr && \
2255         cf_cv_curses_incdir="-I/usr/include/curses_colr"
2256         ;;
2257 sunos3*|sunos4*)
2258         test -d /usr/5lib && \
2259         test -d /usr/5include && \
2260         cf_cv_curses_incdir="-I/usr/5include"
2261         ;;
2262 esac
2263
2264 fi
2265
2266 echo "$ac_t""$cf_cv_curses_incdir" 1>&6
2267 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
2268
2269
2270 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
2271 echo "configure:2272: checking if we have identified curses headers" >&5
2272 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
2273   echo $ac_n "(cached) $ac_c" 1>&6
2274 else
2275   
2276 cf_cv_ncurses_header=none
2277 for cf_header in \
2278         curses.h \
2279         ncurses.h \
2280         ncurses/curses.h \
2281         ncurses/ncurses.h
2282 do
2283 cat > conftest.$ac_ext <<EOF
2284 #line 2285 "configure"
2285 #include "confdefs.h"
2286 #include <${cf_header}>
2287 int main() {
2288 initscr(); tgoto("?", 0,0)
2289 ; return 0; }
2290 EOF
2291 if { (eval echo configure:2292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2292   rm -rf conftest*
2293   cf_cv_ncurses_header=$cf_header; break
2294 else
2295   echo "configure: failed program was:" >&5
2296   cat conftest.$ac_ext >&5
2297 fi
2298 rm -f conftest*
2299 done
2300
2301 fi
2302
2303 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
2304
2305 if test "$cf_cv_ncurses_header" = none ; then
2306         { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
2307 fi
2308
2309 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
2310 for ac_hdr in $cf_cv_ncurses_header
2311 do
2312 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2313 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2314 echo "configure:2315: checking for $ac_hdr" >&5
2315 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2316   echo $ac_n "(cached) $ac_c" 1>&6
2317 else
2318   cat > conftest.$ac_ext <<EOF
2319 #line 2320 "configure"
2320 #include "confdefs.h"
2321 #include <$ac_hdr>
2322 EOF
2323 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2324 { (eval echo configure:2325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2325 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2326 if test -z "$ac_err"; then
2327   rm -rf conftest*
2328   eval "ac_cv_header_$ac_safe=yes"
2329 else
2330   echo "$ac_err" >&5
2331   echo "configure: failed program was:" >&5
2332   cat conftest.$ac_ext >&5
2333   rm -rf conftest*
2334   eval "ac_cv_header_$ac_safe=no"
2335 fi
2336 rm -f conftest*
2337 fi
2338 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2339   echo "$ac_t""yes" 1>&6
2340     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2341   cat >> confdefs.h <<EOF
2342 #define $ac_tr_hdr 1
2343 EOF
2344  
2345 else
2346   echo "$ac_t""no" 1>&6
2347 fi
2348 done
2349
2350
2351
2352 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
2353 echo "configure:2354: checking for terminfo header" >&5
2354 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
2355   echo $ac_n "(cached) $ac_c" 1>&6
2356 else
2357   
2358 case ${cf_cv_ncurses_header} in #(vi
2359 */ncurses.h|*/ncursesw.h) #(vi
2360         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
2361         ;;
2362 *)
2363         cf_term_header=term.h
2364         ;;
2365 esac
2366
2367 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
2368 do
2369 cat > conftest.$ac_ext <<EOF
2370 #line 2371 "configure"
2371 #include "confdefs.h"
2372 #include <stdio.h>
2373 #include <${cf_cv_ncurses_header-curses.h}>
2374 #include <$cf_test>
2375
2376 int main() {
2377 int x = auto_left_margin
2378 ; return 0; }
2379 EOF
2380 if { (eval echo configure:2381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2381   rm -rf conftest*
2382   
2383         cf_cv_term_header="$cf_test"
2384 else
2385   echo "configure: failed program was:" >&5
2386   cat conftest.$ac_ext >&5
2387   rm -rf conftest*
2388   
2389         cf_cv_term_header=unknown
2390         
2391 fi
2392 rm -f conftest*
2393         test "$cf_cv_term_header" != unknown && break
2394 done
2395
2396 fi
2397
2398 echo "$ac_t""$cf_cv_term_header" 1>&6
2399
2400 # Set definitions to allow ifdef'ing to accommodate subdirectories
2401
2402 case $cf_cv_term_header in # (vi
2403 *term.h)
2404         cat >> confdefs.h <<\EOF
2405 #define HAVE_TERM_H 1
2406 EOF
2407
2408         ;;
2409 esac
2410
2411 case $cf_cv_term_header in # (vi
2412 ncurses/term.h) #(vi
2413         cat >> confdefs.h <<\EOF
2414 #define HAVE_NCURSES_TERM_H 1
2415 EOF
2416
2417         ;;
2418 ncursesw/term.h)
2419         cat >> confdefs.h <<\EOF
2420 #define HAVE_NCURSESW_TERM_H 1
2421 EOF
2422
2423         ;;
2424 esac
2425
2426
2427         
2428 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
2429 echo "configure:2430: checking for ncurses version" >&5
2430 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
2431   echo $ac_n "(cached) $ac_c" 1>&6
2432 else
2433   
2434         cf_cv_ncurses_version=no
2435         cf_tempfile=out$$
2436         rm -f $cf_tempfile
2437         if test "$cross_compiling" = yes; then
2438   
2439
2440         # This will not work if the preprocessor splits the line after the
2441         # Autoconf token.  The 'unproto' program does that.
2442         cat > conftest.$ac_ext <<EOF
2443 #include <${cf_cv_ncurses_header-curses.h}>
2444 #undef Autoconf
2445 #ifdef NCURSES_VERSION
2446 Autoconf NCURSES_VERSION
2447 #else
2448 #ifdef __NCURSES_H
2449 Autoconf "old"
2450 #endif
2451 ;
2452 #endif
2453 EOF
2454         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
2455         { (eval echo configure:2456: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
2456         if test -f conftest.out ; then
2457                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
2458                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
2459                 rm -f conftest.out
2460         fi
2461
2462 else
2463   cat > conftest.$ac_ext <<EOF
2464 #line 2465 "configure"
2465 #include "confdefs.h"
2466
2467 #include <${cf_cv_ncurses_header-curses.h}>
2468 #include <stdio.h>
2469 int main()
2470 {
2471         FILE *fp = fopen("$cf_tempfile", "w");
2472 #ifdef NCURSES_VERSION
2473 # ifdef NCURSES_VERSION_PATCH
2474         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
2475 # else
2476         fprintf(fp, "%s\n", NCURSES_VERSION);
2477 # endif
2478 #else
2479 # ifdef __NCURSES_H
2480         fprintf(fp, "old\n");
2481 # else
2482         make an error
2483 # endif
2484 #endif
2485         exit(0);
2486 }
2487 EOF
2488 if { (eval echo configure:2489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2489 then
2490   
2491         cf_cv_ncurses_version=`cat $cf_tempfile`
2492 else
2493   echo "configure: failed program was:" >&5
2494   cat conftest.$ac_ext >&5
2495 fi
2496 rm -fr conftest*
2497 fi
2498
2499         rm -f $cf_tempfile
2500
2501 fi
2502
2503 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
2504 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
2505 #define NCURSES 1
2506 EOF
2507
2508
2509         
2510
2511 echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
2512 echo "configure:2513: checking if we have identified curses libraries" >&5
2513 cat > conftest.$ac_ext <<EOF
2514 #line 2515 "configure"
2515 #include "confdefs.h"
2516 #include <${cf_cv_ncurses_header-curses.h}>
2517 int main() {
2518 initscr(); tgoto("?", 0,0)
2519 ; return 0; }
2520 EOF
2521 if { (eval echo configure:2522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2522   rm -rf conftest*
2523   cf_result=yes
2524 else
2525   echo "configure: failed program was:" >&5
2526   cat conftest.$ac_ext >&5
2527   rm -rf conftest*
2528   cf_result=no
2529 fi
2530 rm -f conftest*
2531 echo "$ac_t""$cf_result" 1>&6
2532
2533 if test "$cf_result" = no ; then
2534 case $host_os in #(vi
2535 freebsd*) #(vi
2536         echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
2537 echo "configure:2538: checking for tgoto in -lmytinfo" >&5
2538 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
2539 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2540   echo $ac_n "(cached) $ac_c" 1>&6
2541 else
2542   ac_save_LIBS="$LIBS"
2543 LIBS="-lmytinfo  $LIBS"
2544 cat > conftest.$ac_ext <<EOF
2545 #line 2546 "configure"
2546 #include "confdefs.h"
2547 /* Override any gcc2 internal prototype to avoid an error.  */
2548 /* We use char because int might match the return type of a gcc2
2549     builtin and then its argument prototype would still apply.  */
2550 char tgoto();
2551
2552 int main() {
2553 tgoto()
2554 ; return 0; }
2555 EOF
2556 if { (eval echo configure:2557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2557   rm -rf conftest*
2558   eval "ac_cv_lib_$ac_lib_var=yes"
2559 else
2560   echo "configure: failed program was:" >&5
2561   cat conftest.$ac_ext >&5
2562   rm -rf conftest*
2563   eval "ac_cv_lib_$ac_lib_var=no"
2564 fi
2565 rm -f conftest*
2566 LIBS="$ac_save_LIBS"
2567
2568 fi
2569 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2570   echo "$ac_t""yes" 1>&6
2571   LIBS="-lmytinfo $LIBS"
2572 else
2573   echo "$ac_t""no" 1>&6
2574 fi
2575
2576         ;;
2577 hpux10.*) #(vi
2578         echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
2579 echo "configure:2580: checking for initscr in -lcur_colr" >&5
2580 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
2581 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2582   echo $ac_n "(cached) $ac_c" 1>&6
2583 else
2584   ac_save_LIBS="$LIBS"
2585 LIBS="-lcur_colr  $LIBS"
2586 cat > conftest.$ac_ext <<EOF
2587 #line 2588 "configure"
2588 #include "confdefs.h"
2589 /* Override any gcc2 internal prototype to avoid an error.  */
2590 /* We use char because int might match the return type of a gcc2
2591     builtin and then its argument prototype would still apply.  */
2592 char initscr();
2593
2594 int main() {
2595 initscr()
2596 ; return 0; }
2597 EOF
2598 if { (eval echo configure:2599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2599   rm -rf conftest*
2600   eval "ac_cv_lib_$ac_lib_var=yes"
2601 else
2602   echo "configure: failed program was:" >&5
2603   cat conftest.$ac_ext >&5
2604   rm -rf conftest*
2605   eval "ac_cv_lib_$ac_lib_var=no"
2606 fi
2607 rm -f conftest*
2608 LIBS="$ac_save_LIBS"
2609
2610 fi
2611 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2612   echo "$ac_t""yes" 1>&6
2613   
2614                 LIBS="-lcur_colr $LIBS"
2615                 ac_cv_func_initscr=yes
2616                 
2617 else
2618   echo "$ac_t""no" 1>&6
2619
2620         echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
2621 echo "configure:2622: checking for initscr in -lHcurses" >&5
2622 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
2623 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2624   echo $ac_n "(cached) $ac_c" 1>&6
2625 else
2626   ac_save_LIBS="$LIBS"
2627 LIBS="-lHcurses  $LIBS"
2628 cat > conftest.$ac_ext <<EOF
2629 #line 2630 "configure"
2630 #include "confdefs.h"
2631 /* Override any gcc2 internal prototype to avoid an error.  */
2632 /* We use char because int might match the return type of a gcc2
2633     builtin and then its argument prototype would still apply.  */
2634 char initscr();
2635
2636 int main() {
2637 initscr()
2638 ; return 0; }
2639 EOF
2640 if { (eval echo configure:2641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2641   rm -rf conftest*
2642   eval "ac_cv_lib_$ac_lib_var=yes"
2643 else
2644   echo "configure: failed program was:" >&5
2645   cat conftest.$ac_ext >&5
2646   rm -rf conftest*
2647   eval "ac_cv_lib_$ac_lib_var=no"
2648 fi
2649 rm -f conftest*
2650 LIBS="$ac_save_LIBS"
2651
2652 fi
2653 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2654   echo "$ac_t""yes" 1>&6
2655   
2656                 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
2657                 LIBS="-lHcurses $LIBS"
2658                 CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
2659                 ac_cv_func_initscr=yes
2660                 
2661 else
2662   echo "$ac_t""no" 1>&6
2663 fi
2664
2665 fi
2666
2667         ;;
2668 linux*) # Suse Linux does not follow /usr/lib convention
2669         LIBS="$LIBS -L/lib"
2670         ;;
2671 sunos3*|sunos4*)
2672         test -d /usr/5lib && \
2673         LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
2674         ac_cv_func_initscr=yes
2675         ;;
2676 esac
2677
2678 if test ".$ac_cv_func_initscr" != .yes ; then
2679         cf_save_LIBS="$LIBS"
2680         cf_term_lib=""
2681         cf_curs_lib=""
2682
2683         if test ".${cf_cv_ncurses_version-no}" != .no
2684         then
2685                 cf_check_list="ncurses curses cursesX"
2686         else
2687                 cf_check_list="cursesX curses ncurses"
2688         fi
2689
2690         # Check for library containing tgoto.  Do this before curses library
2691         # because it may be needed to link the test-case for initscr.
2692         echo $ac_n "checking for tgoto""... $ac_c" 1>&6
2693 echo "configure:2694: checking for tgoto" >&5
2694 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
2695   echo $ac_n "(cached) $ac_c" 1>&6
2696 else
2697   cat > conftest.$ac_ext <<EOF
2698 #line 2699 "configure"
2699 #include "confdefs.h"
2700 /* System header to define __stub macros and hopefully few prototypes,
2701     which can conflict with char tgoto(); below.  */
2702 #include <assert.h>
2703 /* Override any gcc2 internal prototype to avoid an error.  */
2704 /* We use char because int might match the return type of a gcc2
2705     builtin and then its argument prototype would still apply.  */
2706 char tgoto();
2707
2708 int main() {
2709
2710 /* The GNU C library defines this for functions which it implements
2711     to always fail with ENOSYS.  Some functions are actually named
2712     something starting with __ and the normal name is an alias.  */
2713 #if defined (__stub_tgoto) || defined (__stub___tgoto)
2714 choke me
2715 #else
2716 tgoto();
2717 #endif
2718
2719 ; return 0; }
2720 EOF
2721 if { (eval echo configure:2722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2722   rm -rf conftest*
2723   eval "ac_cv_func_tgoto=yes"
2724 else
2725   echo "configure: failed program was:" >&5
2726   cat conftest.$ac_ext >&5
2727   rm -rf conftest*
2728   eval "ac_cv_func_tgoto=no"
2729 fi
2730 rm -f conftest*
2731 fi
2732
2733 if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
2734   echo "$ac_t""yes" 1>&6
2735   cf_term_lib=predefined
2736 else
2737   echo "$ac_t""no" 1>&6
2738
2739                 for cf_term_lib in $cf_check_list termcap termlib unknown
2740                 do
2741                         echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
2742 echo "configure:2743: checking for tgoto in -l$cf_term_lib" >&5
2743 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
2744 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2745   echo $ac_n "(cached) $ac_c" 1>&6
2746 else
2747   ac_save_LIBS="$LIBS"
2748 LIBS="-l$cf_term_lib  $LIBS"
2749 cat > conftest.$ac_ext <<EOF
2750 #line 2751 "configure"
2751 #include "confdefs.h"
2752 /* Override any gcc2 internal prototype to avoid an error.  */
2753 /* We use char because int might match the return type of a gcc2
2754     builtin and then its argument prototype would still apply.  */
2755 char tgoto();
2756
2757 int main() {
2758 tgoto()
2759 ; return 0; }
2760 EOF
2761 if { (eval echo configure:2762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2762   rm -rf conftest*
2763   eval "ac_cv_lib_$ac_lib_var=yes"
2764 else
2765   echo "configure: failed program was:" >&5
2766   cat conftest.$ac_ext >&5
2767   rm -rf conftest*
2768   eval "ac_cv_lib_$ac_lib_var=no"
2769 fi
2770 rm -f conftest*
2771 LIBS="$ac_save_LIBS"
2772
2773 fi
2774 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2775   echo "$ac_t""yes" 1>&6
2776   break
2777 else
2778   echo "$ac_t""no" 1>&6
2779 fi
2780
2781                 done
2782         
2783 fi
2784
2785
2786         # Check for library containing initscr
2787         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
2788         for cf_curs_lib in $cf_check_list xcurses jcurses unknown
2789         do
2790                 echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
2791 echo "configure:2792: checking for initscr in -l$cf_curs_lib" >&5
2792 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
2793 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2794   echo $ac_n "(cached) $ac_c" 1>&6
2795 else
2796   ac_save_LIBS="$LIBS"
2797 LIBS="-l$cf_curs_lib  $LIBS"
2798 cat > conftest.$ac_ext <<EOF
2799 #line 2800 "configure"
2800 #include "confdefs.h"
2801 /* Override any gcc2 internal prototype to avoid an error.  */
2802 /* We use char because int might match the return type of a gcc2
2803     builtin and then its argument prototype would still apply.  */
2804 char initscr();
2805
2806 int main() {
2807 initscr()
2808 ; return 0; }
2809 EOF
2810 if { (eval echo configure:2811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2811   rm -rf conftest*
2812   eval "ac_cv_lib_$ac_lib_var=yes"
2813 else
2814   echo "configure: failed program was:" >&5
2815   cat conftest.$ac_ext >&5
2816   rm -rf conftest*
2817   eval "ac_cv_lib_$ac_lib_var=no"
2818 fi
2819 rm -f conftest*
2820 LIBS="$ac_save_LIBS"
2821
2822 fi
2823 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2824   echo "$ac_t""yes" 1>&6
2825   break
2826 else
2827   echo "$ac_t""no" 1>&6
2828 fi
2829
2830         done
2831         test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
2832
2833         LIBS="-l$cf_curs_lib $cf_save_LIBS"
2834         if test "$cf_term_lib" = unknown ; then
2835                 echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
2836 echo "configure:2837: checking if we can link with $cf_curs_lib library" >&5
2837                 cat > conftest.$ac_ext <<EOF
2838 #line 2839 "configure"
2839 #include "confdefs.h"
2840 #include <${cf_cv_ncurses_header-curses.h}>
2841 int main() {
2842 initscr()
2843 ; return 0; }
2844 EOF
2845 if { (eval echo configure:2846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2846   rm -rf conftest*
2847   cf_result=yes
2848 else
2849   echo "configure: failed program was:" >&5
2850   cat conftest.$ac_ext >&5
2851   rm -rf conftest*
2852   cf_result=no
2853 fi
2854 rm -f conftest*
2855                 echo "$ac_t""$cf_result" 1>&6
2856                 test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
2857         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
2858                 :
2859         elif test "$cf_term_lib" != predefined ; then
2860                 echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
2861 echo "configure:2862: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
2862                 cat > conftest.$ac_ext <<EOF
2863 #line 2864 "configure"
2864 #include "confdefs.h"
2865 #include <${cf_cv_ncurses_header-curses.h}>
2866 int main() {
2867 initscr(); tgoto((char *)0, 0, 0);
2868 ; return 0; }
2869 EOF
2870 if { (eval echo configure:2871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2871   rm -rf conftest*
2872   cf_result=no
2873 else
2874   echo "configure: failed program was:" >&5
2875   cat conftest.$ac_ext >&5
2876   rm -rf conftest*
2877   
2878                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
2879                         cat > conftest.$ac_ext <<EOF
2880 #line 2881 "configure"
2881 #include "confdefs.h"
2882 #include <${cf_cv_ncurses_header-curses.h}>
2883 int main() {
2884 initscr()
2885 ; return 0; }
2886 EOF
2887 if { (eval echo configure:2888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2888   rm -rf conftest*
2889   cf_result=yes
2890 else
2891   echo "configure: failed program was:" >&5
2892   cat conftest.$ac_ext >&5
2893   rm -rf conftest*
2894   cf_result=error
2895 fi
2896 rm -f conftest*
2897                         
2898 fi
2899 rm -f conftest*
2900                 echo "$ac_t""$cf_result" 1>&6
2901         fi
2902 fi
2903 fi
2904
2905
2906         ;;
2907 ncurses)
2908         
2909
2910 cf_ncuhdr_root=ncurses
2911
2912 test -n "$cf_cv_curses_dir" && \
2913 test "$cf_cv_curses_dir" != "no" && \
2914 CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
2915
2916 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
2917 echo "configure:2918: checking for $cf_ncuhdr_root header in include-path" >&5
2918 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
2919   echo $ac_n "(cached) $ac_c" 1>&6
2920 else
2921   
2922         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
2923         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
2924         for cf_header in $cf_header_list
2925         do
2926                 
2927         cat > conftest.$ac_ext <<EOF
2928 #line 2929 "configure"
2929 #include "confdefs.h"
2930
2931
2932 #include <$cf_header>
2933 int main() {
2934
2935 #ifdef NCURSES_VERSION
2936
2937 printf("%s\n", NCURSES_VERSION);
2938 #else
2939 #ifdef __NCURSES_H
2940 printf("old\n");
2941 #else
2942         make an error
2943 #endif
2944 #endif
2945         
2946         
2947 ; return 0; }
2948 EOF
2949 if { (eval echo configure:2950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2950   rm -rf conftest*
2951   cf_cv_ncurses_h=$cf_header
2952         
2953 else
2954   echo "configure: failed program was:" >&5
2955   cat conftest.$ac_ext >&5
2956   rm -rf conftest*
2957   cf_cv_ncurses_h=no
2958 fi
2959 rm -f conftest*
2960
2961                 test "$cf_cv_ncurses_h" != no && break
2962         done
2963
2964 fi
2965
2966 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
2967
2968
2969
2970 if test "$cf_cv_ncurses_h" != no ; then
2971         cf_cv_ncurses_header=$cf_cv_ncurses_h
2972 else
2973
2974 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
2975 echo "configure:2976: checking for $cf_ncuhdr_root include-path" >&5
2976 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
2977   echo $ac_n "(cached) $ac_c" 1>&6
2978 else
2979   
2980         test -n "$verbose" && echo
2981         cf_search=""
2982
2983 test -d "$HOME" && {
2984         test -n "$verbose" && echo "    ... testing include-directories under $HOME"
2985         test -d "$HOME/include" &&          cf_search="$cf_search $HOME/include"
2986         test -d "$HOME/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
2987         test -d "$HOME/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
2988 }
2989
2990 # For other stuff under the home directory, it should be sufficient to put
2991 # a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
2992 test -d "$HOME/$cf_ncuhdr_root" && {
2993         test -n "$verbose" && echo "    ... testing include-directories under $HOME/$cf_ncuhdr_root"
2994         test -d "$HOME/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
2995         test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
2996 }
2997
2998 test "$prefix" != /usr/local && \
2999 test -d /usr/local && {
3000         test -n "$verbose" && echo "    ... testing include-directories under /usr/local"
3001         test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
3002         test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
3003         test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
3004         test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
3005         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3006 }
3007
3008 test "$prefix" != NONE && \
3009 test -d $prefix && {
3010         test -n "$verbose" && echo "    ... testing include-directories under $prefix"
3011         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3012         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
3013         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
3014         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
3015         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3016 }
3017
3018 test "$prefix" != /opt && \
3019 test -d /opt && {
3020         test -n "$verbose" && echo "    ... testing include-directories under /opt"
3021         test -d /opt/include &&             cf_search="$cf_search /opt/include"
3022         test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
3023         test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
3024         test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
3025         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3026 }
3027
3028 test "$prefix" != /usr && \
3029 test -d /usr && {
3030         test -n "$verbose" && echo "    ... testing include-directories under /usr"
3031         test -d /usr/include &&             cf_search="$cf_search /usr/include"
3032         test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
3033         test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
3034         test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
3035 }
3036
3037 test "$includedir" != NONE && \
3038 test "$includedir" != "/usr/include" && \
3039 test -d "$includedir" && {
3040         test -d $includedir &&    cf_search="$cf_search $includedir"
3041         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
3042 }
3043
3044 test "$oldincludedir" != NONE && \
3045 test "$oldincludedir" != "/usr/include" && \
3046 test -d "$oldincludedir" && {
3047         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3048         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
3049 }
3050
3051
3052         test -n "$verbose" && echo search path $cf_search
3053         cf_save2_CPPFLAGS="$CPPFLAGS"
3054         for cf_incdir in $cf_search
3055         do
3056                 
3057 for cf_add_incdir in $cf_incdir
3058 do
3059         while true
3060         do
3061                 case $cf_add_incdir in
3062                 /usr/include) # (vi
3063                         ;;
3064                 /usr/local/include) # (vi
3065                         if test "$GCC" = yes
3066                         then
3067                                 cf_save_CPPFLAGS="$CPPFLAGS"
3068                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3069                                 cat > conftest.$ac_ext <<EOF
3070 #line 3071 "configure"
3071 #include "confdefs.h"
3072 #include <stdio.h>
3073 int main() {
3074 printf("Hello")
3075 ; return 0; }
3076 EOF
3077 if { (eval echo configure:3078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3078   :
3079 else
3080   echo "configure: failed program was:" >&5
3081   cat conftest.$ac_ext >&5
3082   rm -rf conftest*
3083   CPPFLAGS="$cf_save_CPPFLAGS"
3084 fi
3085 rm -f conftest*
3086                         fi
3087                         ;;
3088                 *) # (vi
3089                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3090                         ;;
3091                 esac
3092                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3093                 test "$cf_top_incdir" = "$cf_add_incdir" && break
3094                 cf_add_incdir="$cf_top_incdir"
3095         done
3096 done
3097
3098                 for cf_header in \
3099                         ncurses.h \
3100                         curses.h
3101                 do
3102                         
3103         cat > conftest.$ac_ext <<EOF
3104 #line 3105 "configure"
3105 #include "confdefs.h"
3106
3107
3108 #include <$cf_header>
3109 int main() {
3110
3111 #ifdef NCURSES_VERSION
3112
3113 printf("%s\n", NCURSES_VERSION);
3114 #else
3115 #ifdef __NCURSES_H
3116 printf("old\n");
3117 #else
3118         make an error
3119 #endif
3120 #endif
3121         
3122         
3123 ; return 0; }
3124 EOF
3125 if { (eval echo configure:3126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3126   rm -rf conftest*
3127   cf_cv_ncurses_h2=$cf_header
3128         
3129 else
3130   echo "configure: failed program was:" >&5
3131   cat conftest.$ac_ext >&5
3132   rm -rf conftest*
3133   cf_cv_ncurses_h2=no
3134 fi
3135 rm -f conftest*
3136
3137                         if test "$cf_cv_ncurses_h2" != no ; then
3138                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
3139                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
3140                                 break
3141                         fi
3142                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
3143                 done
3144                 CPPFLAGS="$cf_save2_CPPFLAGS"
3145                 test "$cf_cv_ncurses_h2" != no && break
3146         done
3147         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
3148         
3149 fi
3150
3151 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
3152
3153         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
3154         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
3155         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
3156                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
3157         fi
3158         
3159 for cf_add_incdir in $cf_1st_incdir
3160 do
3161         while true
3162         do
3163                 case $cf_add_incdir in
3164                 /usr/include) # (vi
3165                         ;;
3166                 /usr/local/include) # (vi
3167                         if test "$GCC" = yes
3168                         then
3169                                 cf_save_CPPFLAGS="$CPPFLAGS"
3170                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3171                                 cat > conftest.$ac_ext <<EOF
3172 #line 3173 "configure"
3173 #include "confdefs.h"
3174 #include <stdio.h>
3175 int main() {
3176 printf("Hello")
3177 ; return 0; }
3178 EOF
3179 if { (eval echo configure:3180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3180   :
3181 else
3182   echo "configure: failed program was:" >&5
3183   cat conftest.$ac_ext >&5
3184   rm -rf conftest*
3185   CPPFLAGS="$cf_save_CPPFLAGS"
3186 fi
3187 rm -f conftest*
3188                         fi
3189                         ;;
3190                 *) # (vi
3191                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3192                         ;;
3193                 esac
3194                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3195                 test "$cf_top_incdir" = "$cf_add_incdir" && break
3196                 cf_add_incdir="$cf_top_incdir"
3197         done
3198 done
3199
3200
3201 fi
3202
3203 # Set definitions to allow ifdef'ing for ncurses.h
3204
3205 case $cf_cv_ncurses_header in # (vi
3206 *ncurses.h)
3207         cat >> confdefs.h <<\EOF
3208 #define HAVE_NCURSES_H 1
3209 EOF
3210
3211         ;;
3212 esac
3213
3214 case $cf_cv_ncurses_header in # (vi
3215 ncurses/curses.h|ncurses/ncurses.h)
3216         cat >> confdefs.h <<\EOF
3217 #define HAVE_NCURSES_NCURSES_H 1
3218 EOF
3219
3220         ;;
3221 ncursesw/curses.h|ncursesw/ncurses.h)
3222         cat >> confdefs.h <<\EOF
3223 #define HAVE_NCURSESW_NCURSES_H 1
3224 EOF
3225
3226         ;;
3227 esac
3228
3229
3230
3231 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
3232 echo "configure:3233: checking for terminfo header" >&5
3233 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
3234   echo $ac_n "(cached) $ac_c" 1>&6
3235 else
3236   
3237 case ${cf_cv_ncurses_header} in #(vi
3238 */ncurses.h|*/ncursesw.h) #(vi
3239         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
3240         ;;
3241 *)
3242         cf_term_header=term.h
3243         ;;
3244 esac
3245
3246 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
3247 do
3248 cat > conftest.$ac_ext <<EOF
3249 #line 3250 "configure"
3250 #include "confdefs.h"
3251 #include <stdio.h>
3252 #include <${cf_cv_ncurses_header-curses.h}>
3253 #include <$cf_test>
3254
3255 int main() {
3256 int x = auto_left_margin
3257 ; return 0; }
3258 EOF
3259 if { (eval echo configure:3260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3260   rm -rf conftest*
3261   
3262         cf_cv_term_header="$cf_test"
3263 else
3264   echo "configure: failed program was:" >&5
3265   cat conftest.$ac_ext >&5
3266   rm -rf conftest*
3267   
3268         cf_cv_term_header=unknown
3269         
3270 fi
3271 rm -f conftest*
3272         test "$cf_cv_term_header" != unknown && break
3273 done
3274
3275 fi
3276
3277 echo "$ac_t""$cf_cv_term_header" 1>&6
3278
3279 # Set definitions to allow ifdef'ing to accommodate subdirectories
3280
3281 case $cf_cv_term_header in # (vi
3282 *term.h)
3283         cat >> confdefs.h <<\EOF
3284 #define HAVE_TERM_H 1
3285 EOF
3286
3287         ;;
3288 esac
3289
3290 case $cf_cv_term_header in # (vi
3291 ncurses/term.h) #(vi
3292         cat >> confdefs.h <<\EOF
3293 #define HAVE_NCURSES_TERM_H 1
3294 EOF
3295
3296         ;;
3297 ncursesw/term.h)
3298         cat >> confdefs.h <<\EOF
3299 #define HAVE_NCURSESW_TERM_H 1
3300 EOF
3301
3302         ;;
3303 esac
3304
3305
3306 # some applications need this, but should check for NCURSES_VERSION
3307 cat >> confdefs.h <<\EOF
3308 #define NCURSES 1
3309 EOF
3310
3311
3312
3313 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
3314 echo "configure:3315: checking for ncurses version" >&5
3315 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
3316   echo $ac_n "(cached) $ac_c" 1>&6
3317 else
3318   
3319         cf_cv_ncurses_version=no
3320         cf_tempfile=out$$
3321         rm -f $cf_tempfile
3322         if test "$cross_compiling" = yes; then
3323   
3324
3325         # This will not work if the preprocessor splits the line after the
3326         # Autoconf token.  The 'unproto' program does that.
3327         cat > conftest.$ac_ext <<EOF
3328 #include <${cf_cv_ncurses_header-curses.h}>
3329 #undef Autoconf
3330 #ifdef NCURSES_VERSION
3331 Autoconf NCURSES_VERSION
3332 #else
3333 #ifdef __NCURSES_H
3334 Autoconf "old"
3335 #endif
3336 ;
3337 #endif
3338 EOF
3339         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
3340         { (eval echo configure:3341: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
3341         if test -f conftest.out ; then
3342                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
3343                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
3344                 rm -f conftest.out
3345         fi
3346
3347 else
3348   cat > conftest.$ac_ext <<EOF
3349 #line 3350 "configure"
3350 #include "confdefs.h"
3351
3352 #include <${cf_cv_ncurses_header-curses.h}>
3353 #include <stdio.h>
3354 int main()
3355 {
3356         FILE *fp = fopen("$cf_tempfile", "w");
3357 #ifdef NCURSES_VERSION
3358 # ifdef NCURSES_VERSION_PATCH
3359         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
3360 # else
3361         fprintf(fp, "%s\n", NCURSES_VERSION);
3362 # endif
3363 #else
3364 # ifdef __NCURSES_H
3365         fprintf(fp, "old\n");
3366 # else
3367         make an error
3368 # endif
3369 #endif
3370         exit(0);
3371 }
3372 EOF
3373 if { (eval echo configure:3374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3374 then
3375   
3376         cf_cv_ncurses_version=`cat $cf_tempfile`
3377 else
3378   echo "configure: failed program was:" >&5
3379   cat conftest.$ac_ext >&5
3380 fi
3381 rm -fr conftest*
3382 fi
3383
3384         rm -f $cf_tempfile
3385
3386 fi
3387
3388 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
3389 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
3390 #define NCURSES 1
3391 EOF
3392
3393
3394
3395         
3396
3397 cf_nculib_root=ncurses
3398         # This works, except for the special case where we find gpm, but
3399         # ncurses is in a nonstandard location via $LIBS, and we really want
3400         # to link gpm.
3401 cf_ncurses_LIBS=""
3402 cf_ncurses_SAVE="$LIBS"
3403 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
3404 echo "configure:3405: checking for Gpm_Open in -lgpm" >&5
3405 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
3406 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3407   echo $ac_n "(cached) $ac_c" 1>&6
3408 else
3409   ac_save_LIBS="$LIBS"
3410 LIBS="-lgpm  $LIBS"
3411 cat > conftest.$ac_ext <<EOF
3412 #line 3413 "configure"
3413 #include "confdefs.h"
3414 /* Override any gcc2 internal prototype to avoid an error.  */
3415 /* We use char because int might match the return type of a gcc2
3416     builtin and then its argument prototype would still apply.  */
3417 char Gpm_Open();
3418
3419 int main() {
3420 Gpm_Open()
3421 ; return 0; }
3422 EOF
3423 if { (eval echo configure:3424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3424   rm -rf conftest*
3425   eval "ac_cv_lib_$ac_lib_var=yes"
3426 else
3427   echo "configure: failed program was:" >&5
3428   cat conftest.$ac_ext >&5
3429   rm -rf conftest*
3430   eval "ac_cv_lib_$ac_lib_var=no"
3431 fi
3432 rm -f conftest*
3433 LIBS="$ac_save_LIBS"
3434
3435 fi
3436 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3437   echo "$ac_t""yes" 1>&6
3438   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
3439 echo "configure:3440: checking for initscr in -lgpm" >&5
3440 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
3441 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3442   echo $ac_n "(cached) $ac_c" 1>&6
3443 else
3444   ac_save_LIBS="$LIBS"
3445 LIBS="-lgpm  $LIBS"
3446 cat > conftest.$ac_ext <<EOF
3447 #line 3448 "configure"
3448 #include "confdefs.h"
3449 /* Override any gcc2 internal prototype to avoid an error.  */
3450 /* We use char because int might match the return type of a gcc2
3451     builtin and then its argument prototype would still apply.  */
3452 char initscr();
3453
3454 int main() {
3455 initscr()
3456 ; return 0; }
3457 EOF
3458 if { (eval echo configure:3459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3459   rm -rf conftest*
3460   eval "ac_cv_lib_$ac_lib_var=yes"
3461 else
3462   echo "configure: failed program was:" >&5
3463   cat conftest.$ac_ext >&5
3464   rm -rf conftest*
3465   eval "ac_cv_lib_$ac_lib_var=no"
3466 fi
3467 rm -f conftest*
3468 LIBS="$ac_save_LIBS"
3469
3470 fi
3471 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3472   echo "$ac_t""yes" 1>&6
3473   LIBS="$cf_ncurses_SAVE"
3474 else
3475   echo "$ac_t""no" 1>&6
3476 cf_ncurses_LIBS="-lgpm"
3477 fi
3478
3479 else
3480   echo "$ac_t""no" 1>&6
3481 fi
3482
3483
3484 case $host_os in #(vi
3485 freebsd*)
3486         # This is only necessary if you are linking against an obsolete
3487         # version of ncurses (but it should do no harm, since it's static).
3488         if test "$cf_nculib_root" = ncurses ; then
3489                 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
3490 echo "configure:3491: checking for tgoto in -lmytinfo" >&5
3491 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
3492 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3493   echo $ac_n "(cached) $ac_c" 1>&6
3494 else
3495   ac_save_LIBS="$LIBS"
3496 LIBS="-lmytinfo  $LIBS"
3497 cat > conftest.$ac_ext <<EOF
3498 #line 3499 "configure"
3499 #include "confdefs.h"
3500 /* Override any gcc2 internal prototype to avoid an error.  */
3501 /* We use char because int might match the return type of a gcc2
3502     builtin and then its argument prototype would still apply.  */
3503 char tgoto();
3504
3505 int main() {
3506 tgoto()
3507 ; return 0; }
3508 EOF
3509 if { (eval echo configure:3510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3510   rm -rf conftest*
3511   eval "ac_cv_lib_$ac_lib_var=yes"
3512 else
3513   echo "configure: failed program was:" >&5
3514   cat conftest.$ac_ext >&5
3515   rm -rf conftest*
3516   eval "ac_cv_lib_$ac_lib_var=no"
3517 fi
3518 rm -f conftest*
3519 LIBS="$ac_save_LIBS"
3520
3521 fi
3522 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3523   echo "$ac_t""yes" 1>&6
3524   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
3525 else
3526   echo "$ac_t""no" 1>&6
3527 fi
3528
3529         fi
3530         ;;
3531 esac
3532
3533 LIBS="$cf_ncurses_LIBS $LIBS"
3534
3535 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3536 then
3537         LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
3538 else
3539         
3540         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
3541         cf_libdir=""
3542         echo $ac_n "checking for initscr""... $ac_c" 1>&6
3543 echo "configure:3544: checking for initscr" >&5
3544 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
3545   echo $ac_n "(cached) $ac_c" 1>&6
3546 else
3547   cat > conftest.$ac_ext <<EOF
3548 #line 3549 "configure"
3549 #include "confdefs.h"
3550 /* System header to define __stub macros and hopefully few prototypes,
3551     which can conflict with char initscr(); below.  */
3552 #include <assert.h>
3553 /* Override any gcc2 internal prototype to avoid an error.  */
3554 /* We use char because int might match the return type of a gcc2
3555     builtin and then its argument prototype would still apply.  */
3556 char initscr();
3557
3558 int main() {
3559
3560 /* The GNU C library defines this for functions which it implements
3561     to always fail with ENOSYS.  Some functions are actually named
3562     something starting with __ and the normal name is an alias.  */
3563 #if defined (__stub_initscr) || defined (__stub___initscr)
3564 choke me
3565 #else
3566 initscr();
3567 #endif
3568
3569 ; return 0; }
3570 EOF
3571 if { (eval echo configure:3572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3572   rm -rf conftest*
3573   eval "ac_cv_func_initscr=yes"
3574 else
3575   echo "configure: failed program was:" >&5
3576   cat conftest.$ac_ext >&5
3577   rm -rf conftest*
3578   eval "ac_cv_func_initscr=no"
3579 fi
3580 rm -f conftest*
3581 fi
3582
3583 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
3584   echo "$ac_t""yes" 1>&6
3585   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
3586 else
3587   echo "$ac_t""no" 1>&6
3588
3589                 cf_save_LIBS="$LIBS"
3590                 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
3591 echo "configure:3592: checking for initscr in -l$cf_nculib_root" >&5
3592                 LIBS="-l$cf_nculib_root $LIBS"
3593                 cat > conftest.$ac_ext <<EOF
3594 #line 3595 "configure"
3595 #include "confdefs.h"
3596 #include <${cf_cv_ncurses_header-curses.h}>
3597 int main() {
3598 initscr()
3599 ; return 0; }
3600 EOF
3601 if { (eval echo configure:3602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3602   rm -rf conftest*
3603   echo "$ac_t""yes" 1>&6
3604                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
3605                         
3606 else
3607   echo "configure: failed program was:" >&5
3608   cat conftest.$ac_ext >&5
3609   rm -rf conftest*
3610   echo "$ac_t""no" 1>&6
3611                         cf_search=""
3612
3613 test -d "$HOME" && {
3614         test -n "$verbose" && echo "    ... testing lib-directories under $HOME"
3615         test -d "$HOME/lib" &&          cf_search="$cf_search $HOME/lib"
3616         test -d "$HOME/lib/$cf_nculib_root" &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
3617         test -d "$HOME/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
3618 }
3619
3620 # For other stuff under the home directory, it should be sufficient to put
3621 # a symbolic link for $HOME/$cf_nculib_root to the actual package location:
3622 test -d "$HOME/$cf_nculib_root" && {
3623         test -n "$verbose" && echo "    ... testing lib-directories under $HOME/$cf_nculib_root"
3624         test -d "$HOME/$cf_nculib_root/lib" &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
3625         test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
3626 }
3627
3628 test "$prefix" != /usr/local && \
3629 test -d /usr/local && {
3630         test -n "$verbose" && echo "    ... testing lib-directories under /usr/local"
3631         test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
3632         test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
3633         test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
3634         test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
3635         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
3636 }
3637
3638 test "$prefix" != NONE && \
3639 test -d $prefix && {
3640         test -n "$verbose" && echo "    ... testing lib-directories under $prefix"
3641         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
3642         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
3643         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
3644         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
3645         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
3646 }
3647
3648 test "$prefix" != /opt && \
3649 test -d /opt && {
3650         test -n "$verbose" && echo "    ... testing lib-directories under /opt"
3651         test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
3652         test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
3653         test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
3654         test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
3655         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
3656 }
3657
3658 test "$prefix" != /usr && \
3659 test -d /usr && {
3660         test -n "$verbose" && echo "    ... testing lib-directories under /usr"
3661         test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
3662         test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
3663         test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
3664         test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
3665 }
3666
3667                         for cf_libdir in $cf_search
3668                         do
3669                                 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
3670 echo "configure:3671: checking for -l$cf_nculib_root in $cf_libdir" >&5
3671                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
3672                                 cat > conftest.$ac_ext <<EOF
3673 #line 3674 "configure"
3674 #include "confdefs.h"
3675 #include <${cf_cv_ncurses_header-curses.h}>
3676 int main() {
3677 initscr()
3678 ; return 0; }
3679 EOF
3680 if { (eval echo configure:3681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3681   rm -rf conftest*
3682   echo "$ac_t""yes" 1>&6
3683                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
3684                                          break
3685 else
3686   echo "configure: failed program was:" >&5
3687   cat conftest.$ac_ext >&5
3688   rm -rf conftest*
3689   echo "$ac_t""no" 1>&6
3690                                          LIBS="$cf_save_LIBS"
3691 fi
3692 rm -f conftest*
3693                         done
3694                         
3695 fi
3696 rm -f conftest*
3697                 
3698 fi
3699
3700 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
3701
3702 if test $cf_found_library = no ; then
3703         { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
3704 fi
3705
3706
3707 fi
3708
3709 if test -n "$cf_ncurses_LIBS" ; then
3710         echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
3711 echo "configure:3712: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
3712         cf_ncurses_SAVE="$LIBS"
3713         for p in $cf_ncurses_LIBS ; do
3714                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
3715                 if test "$q" != "$LIBS" ; then
3716                         LIBS="$q"
3717                 fi
3718         done
3719         cat > conftest.$ac_ext <<EOF
3720 #line 3721 "configure"
3721 #include "confdefs.h"
3722 #include <${cf_cv_ncurses_header-curses.h}>
3723 int main() {
3724 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3725 ; return 0; }
3726 EOF
3727 if { (eval echo configure:3728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3728   rm -rf conftest*
3729   echo "$ac_t""yes" 1>&6
3730 else
3731   echo "configure: failed program was:" >&5
3732   cat conftest.$ac_ext >&5
3733   rm -rf conftest*
3734   echo "$ac_t""no" 1>&6
3735                  LIBS="$cf_ncurses_SAVE"
3736 fi
3737 rm -f conftest*
3738 fi
3739
3740
3741 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3742
3743 cat >> confdefs.h <<EOF
3744 #define $cf_nculib_ROOT 1
3745 EOF
3746
3747
3748         ;;
3749 ncursesw)
3750         cf_cv_libtype=w
3751         
3752
3753 cf_ncuhdr_root=ncursesw
3754
3755 test -n "$cf_cv_curses_dir" && \
3756 test "$cf_cv_curses_dir" != "no" && \
3757 CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
3758
3759 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
3760 echo "configure:3761: checking for $cf_ncuhdr_root header in include-path" >&5
3761 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
3762   echo $ac_n "(cached) $ac_c" 1>&6
3763 else
3764   
3765         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
3766         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
3767         for cf_header in $cf_header_list
3768         do
3769                 
3770         cat > conftest.$ac_ext <<EOF
3771 #line 3772 "configure"
3772 #include "confdefs.h"
3773
3774
3775 #define _XOPEN_SOURCE_EXTENDED
3776 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
3777 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
3778
3779 #include <$cf_header>
3780 int main() {
3781
3782 #ifdef NCURSES_VERSION
3783
3784 #ifndef WACS_BSSB
3785         make an error
3786 #endif
3787
3788 printf("%s\n", NCURSES_VERSION);
3789 #else
3790 #ifdef __NCURSES_H
3791 printf("old\n");
3792 #else
3793         make an error
3794 #endif
3795 #endif
3796         
3797         
3798 ; return 0; }
3799 EOF
3800 if { (eval echo configure:3801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3801   rm -rf conftest*
3802   cf_cv_ncurses_h=$cf_header
3803         
3804 else
3805   echo "configure: failed program was:" >&5
3806   cat conftest.$ac_ext >&5
3807   rm -rf conftest*
3808   cf_cv_ncurses_h=no
3809 fi
3810 rm -f conftest*
3811
3812                 test "$cf_cv_ncurses_h" != no && break
3813         done
3814
3815 fi
3816
3817 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
3818
3819
3820
3821 if test "$cf_cv_ncurses_h" != no ; then
3822         cf_cv_ncurses_header=$cf_cv_ncurses_h
3823 else
3824
3825 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
3826 echo "configure:3827: checking for $cf_ncuhdr_root include-path" >&5
3827 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
3828   echo $ac_n "(cached) $ac_c" 1>&6
3829 else
3830   
3831         test -n "$verbose" && echo
3832         cf_search=""
3833
3834 test -d "$HOME" && {
3835         test -n "$verbose" && echo "    ... testing include-directories under $HOME"
3836         test -d "$HOME/include" &&          cf_search="$cf_search $HOME/include"
3837         test -d "$HOME/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
3838         test -d "$HOME/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
3839 }
3840
3841 # For other stuff under the home directory, it should be sufficient to put
3842 # a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
3843 test -d "$HOME/$cf_ncuhdr_root" && {
3844         test -n "$verbose" && echo "    ... testing include-directories under $HOME/$cf_ncuhdr_root"
3845         test -d "$HOME/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
3846         test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3847 }
3848
3849 test "$prefix" != /usr/local && \
3850 test -d /usr/local && {
3851         test -n "$verbose" && echo "    ... testing include-directories under /usr/local"
3852         test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
3853         test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
3854         test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
3855         test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
3856         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3857 }
3858
3859 test "$prefix" != NONE && \
3860 test -d $prefix && {
3861         test -n "$verbose" && echo "    ... testing include-directories under $prefix"
3862         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3863         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
3864         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
3865         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
3866         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3867 }
3868
3869 test "$prefix" != /opt && \
3870 test -d /opt && {
3871         test -n "$verbose" && echo "    ... testing include-directories under /opt"
3872         test -d /opt/include &&             cf_search="$cf_search /opt/include"
3873         test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
3874         test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
3875         test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
3876         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3877 }
3878
3879 test "$prefix" != /usr && \
3880 test -d /usr && {
3881         test -n "$verbose" && echo "    ... testing include-directories under /usr"
3882         test -d /usr/include &&             cf_search="$cf_search /usr/include"
3883         test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
3884         test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
3885         test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
3886 }
3887
3888 test "$includedir" != NONE && \
3889 test "$includedir" != "/usr/include" && \
3890 test -d "$includedir" && {
3891         test -d $includedir &&    cf_search="$cf_search $includedir"
3892         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
3893 }
3894
3895 test "$oldincludedir" != NONE && \
3896 test "$oldincludedir" != "/usr/include" && \
3897 test -d "$oldincludedir" && {
3898         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3899         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
3900 }
3901
3902
3903         test -n "$verbose" && echo search path $cf_search
3904         cf_save2_CPPFLAGS="$CPPFLAGS"
3905         for cf_incdir in $cf_search
3906         do
3907                 
3908 for cf_add_incdir in $cf_incdir
3909 do
3910         while true
3911         do
3912                 case $cf_add_incdir in
3913                 /usr/include) # (vi
3914                         ;;
3915                 /usr/local/include) # (vi
3916                         if test "$GCC" = yes
3917                         then
3918                                 cf_save_CPPFLAGS="$CPPFLAGS"
3919                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3920                                 cat > conftest.$ac_ext <<EOF
3921 #line 3922 "configure"
3922 #include "confdefs.h"
3923 #include <stdio.h>
3924 int main() {
3925 printf("Hello")
3926 ; return 0; }
3927 EOF
3928 if { (eval echo configure:3929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3929   :
3930 else
3931   echo "configure: failed program was:" >&5
3932   cat conftest.$ac_ext >&5
3933   rm -rf conftest*
3934   CPPFLAGS="$cf_save_CPPFLAGS"
3935 fi
3936 rm -f conftest*
3937                         fi
3938                         ;;
3939                 *) # (vi
3940                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3941                         ;;
3942                 esac
3943                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3944                 test "$cf_top_incdir" = "$cf_add_incdir" && break
3945                 cf_add_incdir="$cf_top_incdir"
3946         done
3947 done
3948
3949                 for cf_header in \
3950                         ncurses.h \
3951                         curses.h
3952                 do
3953                         
3954         cat > conftest.$ac_ext <<EOF
3955 #line 3956 "configure"
3956 #include "confdefs.h"
3957
3958
3959 #include <$cf_header>
3960 int main() {
3961
3962 #ifdef NCURSES_VERSION
3963
3964 printf("%s\n", NCURSES_VERSION);
3965 #else
3966 #ifdef __NCURSES_H
3967 printf("old\n");
3968 #else
3969         make an error
3970 #endif
3971 #endif
3972         
3973         
3974 ; return 0; }
3975 EOF
3976 if { (eval echo configure:3977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3977   rm -rf conftest*
3978   cf_cv_ncurses_h2=$cf_header
3979         
3980 else
3981   echo "configure: failed program was:" >&5
3982   cat conftest.$ac_ext >&5
3983   rm -rf conftest*
3984   cf_cv_ncurses_h2=no
3985 fi
3986 rm -f conftest*
3987
3988                         if test "$cf_cv_ncurses_h2" != no ; then
3989                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
3990                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
3991                                 break
3992                         fi
3993                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
3994                 done
3995                 CPPFLAGS="$cf_save2_CPPFLAGS"
3996                 test "$cf_cv_ncurses_h2" != no && break
3997         done
3998         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
3999         
4000 fi
4001
4002 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
4003
4004         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4005         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4006         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4007                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4008         fi
4009         
4010 for cf_add_incdir in $cf_1st_incdir
4011 do
4012         while true
4013         do
4014                 case $cf_add_incdir in
4015                 /usr/include) # (vi
4016                         ;;
4017                 /usr/local/include) # (vi
4018                         if test "$GCC" = yes
4019                         then
4020                                 cf_save_CPPFLAGS="$CPPFLAGS"
4021                                 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4022                                 cat > conftest.$ac_ext <<EOF
4023 #line 4024 "configure"
4024 #include "confdefs.h"
4025 #include <stdio.h>
4026 int main() {
4027 printf("Hello")
4028 ; return 0; }
4029 EOF
4030 if { (eval echo configure:4031: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4031   :
4032 else
4033   echo "configure: failed program was:" >&5
4034   cat conftest.$ac_ext >&5
4035   rm -rf conftest*
4036   CPPFLAGS="$cf_save_CPPFLAGS"
4037 fi
4038 rm -f conftest*
4039                         fi
4040                         ;;
4041                 *) # (vi
4042                         CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4043                         ;;
4044                 esac
4045                 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4046                 test "$cf_top_incdir" = "$cf_add_incdir" && break
4047                 cf_add_incdir="$cf_top_incdir"
4048         done
4049 done
4050
4051
4052 fi
4053
4054 # Set definitions to allow ifdef'ing for ncurses.h
4055
4056 case $cf_cv_ncurses_header in # (vi
4057 *ncurses.h)
4058         cat >> confdefs.h <<\EOF
4059 #define HAVE_NCURSES_H 1
4060 EOF
4061
4062         ;;
4063 esac
4064
4065 case $cf_cv_ncurses_header in # (vi
4066 ncurses/curses.h|ncurses/ncurses.h)
4067         cat >> confdefs.h <<\EOF
4068 #define HAVE_NCURSES_NCURSES_H 1
4069 EOF
4070
4071         ;;
4072 ncursesw/curses.h|ncursesw/ncurses.h)
4073         cat >> confdefs.h <<\EOF
4074 #define HAVE_NCURSESW_NCURSES_H 1
4075 EOF
4076
4077         ;;
4078 esac
4079
4080
4081
4082 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
4083 echo "configure:4084: checking for terminfo header" >&5
4084 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
4085   echo $ac_n "(cached) $ac_c" 1>&6
4086 else
4087   
4088 case ${cf_cv_ncurses_header} in #(vi
4089 */ncurses.h|*/ncursesw.h) #(vi
4090         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4091         ;;
4092 *)
4093         cf_term_header=term.h
4094         ;;
4095 esac
4096
4097 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4098 do
4099 cat > conftest.$ac_ext <<EOF
4100 #line 4101 "configure"
4101 #include "confdefs.h"
4102 #include <stdio.h>
4103 #include <${cf_cv_ncurses_header-curses.h}>
4104 #include <$cf_test>
4105
4106 int main() {
4107 int x = auto_left_margin
4108 ; return 0; }
4109 EOF
4110 if { (eval echo configure:4111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4111   rm -rf conftest*
4112   
4113         cf_cv_term_header="$cf_test"
4114 else
4115   echo "configure: failed program was:" >&5
4116   cat conftest.$ac_ext >&5
4117   rm -rf conftest*
4118   
4119         cf_cv_term_header=unknown
4120         
4121 fi
4122 rm -f conftest*
4123         test "$cf_cv_term_header" != unknown && break
4124 done
4125
4126 fi
4127
4128 echo "$ac_t""$cf_cv_term_header" 1>&6
4129
4130 # Set definitions to allow ifdef'ing to accommodate subdirectories
4131
4132 case $cf_cv_term_header in # (vi
4133 *term.h)
4134         cat >> confdefs.h <<\EOF
4135 #define HAVE_TERM_H 1
4136 EOF
4137
4138         ;;
4139 esac
4140
4141 case $cf_cv_term_header in # (vi
4142 ncurses/term.h) #(vi
4143         cat >> confdefs.h <<\EOF
4144 #define HAVE_NCURSES_TERM_H 1
4145 EOF
4146
4147         ;;
4148 ncursesw/term.h)
4149         cat >> confdefs.h <<\EOF
4150 #define HAVE_NCURSESW_TERM_H 1
4151 EOF
4152
4153         ;;
4154 esac
4155
4156
4157 # some applications need this, but should check for NCURSES_VERSION
4158 cat >> confdefs.h <<\EOF
4159 #define NCURSES 1
4160 EOF
4161
4162
4163
4164 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
4165 echo "configure:4166: checking for ncurses version" >&5
4166 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
4167   echo $ac_n "(cached) $ac_c" 1>&6
4168 else
4169   
4170         cf_cv_ncurses_version=no
4171         cf_tempfile=out$$
4172         rm -f $cf_tempfile
4173         if test "$cross_compiling" = yes; then
4174   
4175
4176         # This will not work if the preprocessor splits the line after the
4177         # Autoconf token.  The 'unproto' program does that.
4178         cat > conftest.$ac_ext <<EOF
4179 #include <${cf_cv_ncurses_header-curses.h}>
4180 #undef Autoconf
4181 #ifdef NCURSES_VERSION
4182 Autoconf NCURSES_VERSION
4183 #else
4184 #ifdef __NCURSES_H
4185 Autoconf "old"
4186 #endif
4187 ;
4188 #endif
4189 EOF
4190         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4191         { (eval echo configure:4192: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
4192         if test -f conftest.out ; then
4193                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4194                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4195                 rm -f conftest.out
4196         fi
4197
4198 else
4199   cat > conftest.$ac_ext <<EOF
4200 #line 4201 "configure"
4201 #include "confdefs.h"
4202
4203 #include <${cf_cv_ncurses_header-curses.h}>
4204 #include <stdio.h>
4205 int main()
4206 {
4207         FILE *fp = fopen("$cf_tempfile", "w");
4208 #ifdef NCURSES_VERSION
4209 # ifdef NCURSES_VERSION_PATCH
4210         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4211 # else
4212         fprintf(fp, "%s\n", NCURSES_VERSION);
4213 # endif
4214 #else
4215 # ifdef __NCURSES_H
4216         fprintf(fp, "old\n");
4217 # else
4218         make an error
4219 # endif
4220 #endif
4221         exit(0);
4222 }
4223 EOF
4224 if { (eval echo configure:4225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4225 then
4226   
4227         cf_cv_ncurses_version=`cat $cf_tempfile`
4228 else
4229   echo "configure: failed program was:" >&5
4230   cat conftest.$ac_ext >&5
4231 fi
4232 rm -fr conftest*
4233 fi
4234
4235         rm -f $cf_tempfile
4236
4237 fi
4238
4239 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
4240 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
4241 #define NCURSES 1
4242 EOF
4243
4244
4245
4246         
4247
4248 cf_nculib_root=ncursesw
4249         # This works, except for the special case where we find gpm, but
4250         # ncurses is in a nonstandard location via $LIBS, and we really want
4251         # to link gpm.
4252 cf_ncurses_LIBS=""
4253 cf_ncurses_SAVE="$LIBS"
4254 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
4255 echo "configure:4256: checking for Gpm_Open in -lgpm" >&5
4256 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
4257 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4258   echo $ac_n "(cached) $ac_c" 1>&6
4259 else
4260   ac_save_LIBS="$LIBS"
4261 LIBS="-lgpm  $LIBS"
4262 cat > conftest.$ac_ext <<EOF
4263 #line 4264 "configure"
4264 #include "confdefs.h"
4265 /* Override any gcc2 internal prototype to avoid an error.  */
4266 /* We use char because int might match the return type of a gcc2
4267     builtin and then its argument prototype would still apply.  */
4268 char Gpm_Open();
4269
4270 int main() {
4271 Gpm_Open()
4272 ; return 0; }
4273 EOF
4274 if { (eval echo configure:4275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4275   rm -rf conftest*
4276   eval "ac_cv_lib_$ac_lib_var=yes"
4277 else
4278   echo "configure: failed program was:" >&5
4279   cat conftest.$ac_ext >&5
4280   rm -rf conftest*
4281   eval "ac_cv_lib_$ac_lib_var=no"
4282 fi
4283 rm -f conftest*
4284 LIBS="$ac_save_LIBS"
4285
4286 fi
4287 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4288   echo "$ac_t""yes" 1>&6
4289   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
4290 echo "configure:4291: checking for initscr in -lgpm" >&5
4291 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
4292 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4293   echo $ac_n "(cached) $ac_c" 1>&6
4294 else
4295   ac_save_LIBS="$LIBS"
4296 LIBS="-lgpm  $LIBS"
4297 cat > conftest.$ac_ext <<EOF
4298 #line 4299 "configure"
4299 #include "confdefs.h"
4300 /* Override any gcc2 internal prototype to avoid an error.  */
4301 /* We use char because int might match the return type of a gcc2
4302     builtin and then its argument prototype would still apply.  */
4303 char initscr();
4304
4305 int main() {
4306 initscr()
4307 ; return 0; }
4308 EOF
4309 if { (eval echo configure:4310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4310   rm -rf conftest*
4311   eval "ac_cv_lib_$ac_lib_var=yes"
4312 else
4313   echo "configure: failed program was:" >&5
4314   cat conftest.$ac_ext >&5
4315   rm -rf conftest*
4316   eval "ac_cv_lib_$ac_lib_var=no"
4317 fi
4318 rm -f conftest*
4319 LIBS="$ac_save_LIBS"
4320
4321 fi
4322 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4323   echo "$ac_t""yes" 1>&6
4324   LIBS="$cf_ncurses_SAVE"
4325 else
4326   echo "$ac_t""no" 1>&6
4327 cf_ncurses_LIBS="-lgpm"
4328 fi
4329
4330 else
4331   echo "$ac_t""no" 1>&6
4332 fi
4333
4334
4335 case $host_os in #(vi
4336 freebsd*)
4337         # This is only necessary if you are linking against an obsolete
4338         # version of ncurses (but it should do no harm, since it's static).
4339         if test "$cf_nculib_root" = ncurses ; then
4340                 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
4341 echo "configure:4342: checking for tgoto in -lmytinfo" >&5
4342 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
4343 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4344   echo $ac_n "(cached) $ac_c" 1>&6
4345 else
4346   ac_save_LIBS="$LIBS"
4347 LIBS="-lmytinfo  $LIBS"
4348 cat > conftest.$ac_ext <<EOF
4349 #line 4350 "configure"
4350 #include "confdefs.h"
4351 /* Override any gcc2 internal prototype to avoid an error.  */
4352 /* We use char because int might match the return type of a gcc2
4353     builtin and then its argument prototype would still apply.  */
4354 char tgoto();
4355
4356 int main() {
4357 tgoto()
4358 ; return 0; }
4359 EOF
4360 if { (eval echo configure:4361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4361   rm -rf conftest*
4362   eval "ac_cv_lib_$ac_lib_var=yes"
4363 else
4364   echo "configure: failed program was:" >&5
4365   cat conftest.$ac_ext >&5
4366   rm -rf conftest*
4367   eval "ac_cv_lib_$ac_lib_var=no"
4368 fi
4369 rm -f conftest*
4370 LIBS="$ac_save_LIBS"
4371
4372 fi
4373 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4374   echo "$ac_t""yes" 1>&6
4375   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4376 else
4377   echo "$ac_t""no" 1>&6
4378 fi
4379
4380         fi
4381         ;;
4382 esac
4383
4384 LIBS="$cf_ncurses_LIBS $LIBS"
4385
4386 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4387 then
4388         LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
4389 else
4390         
4391         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4392         cf_libdir=""
4393         echo $ac_n "checking for initscr""... $ac_c" 1>&6
4394 echo "configure:4395: checking for initscr" >&5
4395 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
4396   echo $ac_n "(cached) $ac_c" 1>&6
4397 else
4398   cat > conftest.$ac_ext <<EOF
4399 #line 4400 "configure"
4400 #include "confdefs.h"
4401 /* System header to define __stub macros and hopefully few prototypes,
4402     which can conflict with char initscr(); below.  */
4403 #include <assert.h>
4404 /* Override any gcc2 internal prototype to avoid an error.  */
4405 /* We use char because int might match the return type of a gcc2
4406     builtin and then its argument prototype would still apply.  */
4407 char initscr();
4408
4409 int main() {
4410
4411 /* The GNU C library defines this for functions which it implements
4412     to always fail with ENOSYS.  Some functions are actually named
4413     something starting with __ and the normal name is an alias.  */
4414 #if defined (__stub_initscr) || defined (__stub___initscr)
4415 choke me
4416 #else
4417 initscr();
4418 #endif
4419
4420 ; return 0; }
4421 EOF
4422 if { (eval echo configure:4423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4423   rm -rf conftest*
4424   eval "ac_cv_func_initscr=yes"
4425 else
4426   echo "configure: failed program was:" >&5
4427   cat conftest.$ac_ext >&5
4428   rm -rf conftest*
4429   eval "ac_cv_func_initscr=no"
4430 fi
4431 rm -f conftest*
4432 fi
4433
4434 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
4435   echo "$ac_t""yes" 1>&6
4436   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4437 else
4438   echo "$ac_t""no" 1>&6
4439
4440                 cf_save_LIBS="$LIBS"
4441                 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
4442 echo "configure:4443: checking for initscr in -l$cf_nculib_root" >&5
4443                 LIBS="-l$cf_nculib_root $LIBS"
4444                 cat > conftest.$ac_ext <<EOF
4445 #line 4446 "configure"
4446 #include "confdefs.h"
4447 #include <${cf_cv_ncurses_header-curses.h}>
4448 int main() {
4449 initscr()
4450 ; return 0; }
4451 EOF
4452 if { (eval echo configure:4453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4453   rm -rf conftest*
4454   echo "$ac_t""yes" 1>&6
4455                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4456                         
4457 else
4458   echo "configure: failed program was:" >&5
4459   cat conftest.$ac_ext >&5
4460   rm -rf conftest*
4461   echo "$ac_t""no" 1>&6
4462                         cf_search=""
4463
4464 test -d "$HOME" && {
4465         test -n "$verbose" && echo "    ... testing lib-directories under $HOME"
4466         test -d "$HOME/lib" &&          cf_search="$cf_search $HOME/lib"
4467         test -d "$HOME/lib/$cf_nculib_root" &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
4468         test -d "$HOME/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
4469 }
4470
4471 # For other stuff under the home directory, it should be sufficient to put
4472 # a symbolic link for $HOME/$cf_nculib_root to the actual package location:
4473 test -d "$HOME/$cf_nculib_root" && {
4474         test -n "$verbose" && echo "    ... testing lib-directories under $HOME/$cf_nculib_root"
4475         test -d "$HOME/$cf_nculib_root/lib" &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
4476         test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
4477 }
4478
4479 test "$prefix" != /usr/local && \
4480 test -d /usr/local && {
4481         test -n "$verbose" && echo "    ... testing lib-directories under /usr/local"
4482         test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
4483         test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
4484         test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
4485         test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
4486         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
4487 }
4488
4489 test "$prefix" != NONE && \
4490 test -d $prefix && {
4491         test -n "$verbose" && echo "    ... testing lib-directories under $prefix"
4492         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
4493         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
4494         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
4495         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
4496         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
4497 }
4498
4499 test "$prefix" != /opt && \
4500 test -d /opt && {
4501         test -n "$verbose" && echo "    ... testing lib-directories under /opt"
4502         test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
4503         test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
4504         test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
4505         test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
4506         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
4507 }
4508
4509 test "$prefix" != /usr && \
4510 test -d /usr && {
4511         test -n "$verbose" && echo "    ... testing lib-directories under /usr"
4512         test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
4513         test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
4514         test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
4515         test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
4516 }
4517
4518                         for cf_libdir in $cf_search
4519                         do
4520                                 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
4521 echo "configure:4522: checking for -l$cf_nculib_root in $cf_libdir" >&5
4522                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
4523                                 cat > conftest.$ac_ext <<EOF
4524 #line 4525 "configure"
4525 #include "confdefs.h"
4526 #include <${cf_cv_ncurses_header-curses.h}>
4527 int main() {
4528 initscr()
4529 ; return 0; }
4530 EOF
4531 if { (eval echo configure:4532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4532   rm -rf conftest*
4533   echo "$ac_t""yes" 1>&6
4534                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4535                                          break
4536 else
4537   echo "configure: failed program was:" >&5
4538   cat conftest.$ac_ext >&5
4539   rm -rf conftest*
4540   echo "$ac_t""no" 1>&6
4541                                          LIBS="$cf_save_LIBS"
4542 fi
4543 rm -f conftest*
4544                         done
4545                         
4546 fi
4547 rm -f conftest*
4548                 
4549 fi
4550
4551 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
4552
4553 if test $cf_found_library = no ; then
4554         { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
4555 fi
4556
4557
4558 fi
4559
4560 if test -n "$cf_ncurses_LIBS" ; then
4561         echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
4562 echo "configure:4563: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
4563         cf_ncurses_SAVE="$LIBS"
4564         for p in $cf_ncurses_LIBS ; do
4565                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
4566                 if test "$q" != "$LIBS" ; then
4567                         LIBS="$q"
4568                 fi
4569         done
4570         cat > conftest.$ac_ext <<EOF
4571 #line 4572 "configure"
4572 #include "confdefs.h"
4573 #include <${cf_cv_ncurses_header-curses.h}>
4574 int main() {
4575 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4576 ; return 0; }
4577 EOF
4578 if { (eval echo configure:4579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4579   rm -rf conftest*
4580   echo "$ac_t""yes" 1>&6
4581 else
4582   echo "configure: failed program was:" >&5
4583   cat conftest.$ac_ext >&5
4584   rm -rf conftest*
4585   echo "$ac_t""no" 1>&6
4586                  LIBS="$cf_ncurses_SAVE"
4587 fi
4588 rm -f conftest*
4589 fi
4590
4591
4592 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4593
4594 cat >> confdefs.h <<EOF
4595 #define $cf_nculib_ROOT 1
4596 EOF
4597
4598
4599         ;;
4600 esac
4601
4602
4603
4604 # look for curses-related headers
4605 for ac_hdr in \
4606         nc_alloc.h \
4607         nomacros.h \
4608         
4609 do
4610 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4611 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4612 echo "configure:4613: checking for $ac_hdr" >&5
4613 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4614   echo $ac_n "(cached) $ac_c" 1>&6
4615 else
4616   cat > conftest.$ac_ext <<EOF
4617 #line 4618 "configure"
4618 #include "confdefs.h"
4619 #include <$ac_hdr>
4620 EOF
4621 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4622 { (eval echo configure:4623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4623 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4624 if test -z "$ac_err"; then
4625   rm -rf conftest*
4626   eval "ac_cv_header_$ac_safe=yes"
4627 else
4628   echo "$ac_err" >&5
4629   echo "configure: failed program was:" >&5
4630   cat conftest.$ac_ext >&5
4631   rm -rf conftest*
4632   eval "ac_cv_header_$ac_safe=no"
4633 fi
4634 rm -f conftest*
4635 fi
4636 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4637   echo "$ac_t""yes" 1>&6
4638     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4639   cat >> confdefs.h <<EOF
4640 #define $ac_tr_hdr 1
4641 EOF
4642  
4643 else
4644   echo "$ac_t""no" 1>&6
4645 fi
4646 done
4647
4648
4649 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
4650 echo "configure:4651: checking return type of signal handlers" >&5
4651 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
4652   echo $ac_n "(cached) $ac_c" 1>&6
4653 else
4654   cat > conftest.$ac_ext <<EOF
4655 #line 4656 "configure"
4656 #include "confdefs.h"
4657 #include <sys/types.h>
4658 #include <signal.h>
4659 #ifdef signal
4660 #undef signal
4661 #endif
4662 #ifdef __cplusplus
4663 extern "C" void (*signal (int, void (*)(int)))(int);
4664 #else
4665 void (*signal ()) ();
4666 #endif
4667
4668 int main() {
4669 int i;
4670 ; return 0; }
4671 EOF
4672 if { (eval echo configure:4673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4673   rm -rf conftest*
4674   ac_cv_type_signal=void
4675 else
4676   echo "configure: failed program was:" >&5
4677   cat conftest.$ac_ext >&5
4678   rm -rf conftest*
4679   ac_cv_type_signal=int
4680 fi
4681 rm -f conftest*
4682 fi
4683
4684 echo "$ac_t""$ac_cv_type_signal" 1>&6
4685 cat >> confdefs.h <<EOF
4686 #define RETSIGTYPE $ac_cv_type_signal
4687 EOF
4688
4689
4690
4691 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4692 echo "configure:4693: checking for ANSI C header files" >&5
4693 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
4694   echo $ac_n "(cached) $ac_c" 1>&6
4695 else
4696   cat > conftest.$ac_ext <<EOF
4697 #line 4698 "configure"
4698 #include "confdefs.h"
4699 #include <stdlib.h>
4700 #include <stdarg.h>
4701 #include <string.h>
4702 #include <float.h>
4703 EOF
4704 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4705 { (eval echo configure:4706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4706 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4707 if test -z "$ac_err"; then
4708   rm -rf conftest*
4709   ac_cv_header_stdc=yes
4710 else
4711   echo "$ac_err" >&5
4712   echo "configure: failed program was:" >&5
4713   cat conftest.$ac_ext >&5
4714   rm -rf conftest*
4715   ac_cv_header_stdc=no
4716 fi
4717 rm -f conftest*
4718
4719 if test $ac_cv_header_stdc = yes; then
4720   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4721 cat > conftest.$ac_ext <<EOF
4722 #line 4723 "configure"
4723 #include "confdefs.h"
4724 #include <string.h>
4725 EOF
4726 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4727   egrep "memchr" >/dev/null 2>&1; then
4728   :
4729 else
4730   rm -rf conftest*
4731   ac_cv_header_stdc=no
4732 fi
4733 rm -f conftest*
4734
4735 fi
4736
4737 if test $ac_cv_header_stdc = yes; then
4738   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4739 cat > conftest.$ac_ext <<EOF
4740 #line 4741 "configure"
4741 #include "confdefs.h"
4742 #include <stdlib.h>
4743 EOF
4744 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4745   egrep "free" >/dev/null 2>&1; then
4746   :
4747 else
4748   rm -rf conftest*
4749   ac_cv_header_stdc=no
4750 fi
4751 rm -f conftest*
4752
4753 fi
4754
4755 if test $ac_cv_header_stdc = yes; then
4756   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4757 if test "$cross_compiling" = yes; then
4758   :
4759 else
4760   cat > conftest.$ac_ext <<EOF
4761 #line 4762 "configure"
4762 #include "confdefs.h"
4763 #include <ctype.h>
4764 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4765 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4766 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4767 int main () { int i; for (i = 0; i < 256; i++)
4768 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4769 exit (0); }
4770
4771 EOF
4772 if { (eval echo configure:4773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4773 then
4774   :
4775 else
4776   echo "configure: failed program was:" >&5
4777   cat conftest.$ac_ext >&5
4778   rm -fr conftest*
4779   ac_cv_header_stdc=no
4780 fi
4781 rm -fr conftest*
4782 fi
4783
4784 fi
4785 fi
4786
4787 echo "$ac_t""$ac_cv_header_stdc" 1>&6
4788 if test $ac_cv_header_stdc = yes; then
4789   cat >> confdefs.h <<\EOF
4790 #define STDC_HEADERS 1
4791 EOF
4792
4793 fi
4794
4795 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
4796 echo "configure:4797: checking whether time.h and sys/time.h may both be included" >&5
4797 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
4798   echo $ac_n "(cached) $ac_c" 1>&6
4799 else
4800   cat > conftest.$ac_ext <<EOF
4801 #line 4802 "configure"
4802 #include "confdefs.h"
4803 #include <sys/types.h>
4804 #include <sys/time.h>
4805 #include <time.h>
4806 int main() {
4807 struct tm *tp;
4808 ; return 0; }
4809 EOF
4810 if { (eval echo configure:4811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4811   rm -rf conftest*
4812   ac_cv_header_time=yes
4813 else
4814   echo "configure: failed program was:" >&5
4815   cat conftest.$ac_ext >&5
4816   rm -rf conftest*
4817   ac_cv_header_time=no
4818 fi
4819 rm -f conftest*
4820 fi
4821
4822 echo "$ac_t""$ac_cv_header_time" 1>&6
4823 if test $ac_cv_header_time = yes; then
4824   cat >> confdefs.h <<\EOF
4825 #define TIME_WITH_SYS_TIME 1
4826 EOF
4827
4828 fi
4829
4830 for ac_hdr in \
4831 getopt.h \
4832 locale.h \
4833 stdarg.h \
4834 sys/ioctl.h \
4835 sys/select.h \
4836 sys/time.h \
4837 termios.h \
4838 unistd.h \
4839
4840 do
4841 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4842 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4843 echo "configure:4844: checking for $ac_hdr" >&5
4844 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4845   echo $ac_n "(cached) $ac_c" 1>&6
4846 else
4847   cat > conftest.$ac_ext <<EOF
4848 #line 4849 "configure"
4849 #include "confdefs.h"
4850 #include <$ac_hdr>
4851 EOF
4852 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4853 { (eval echo configure:4854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4854 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4855 if test -z "$ac_err"; then
4856   rm -rf conftest*
4857   eval "ac_cv_header_$ac_safe=yes"
4858 else
4859   echo "$ac_err" >&5
4860   echo "configure: failed program was:" >&5
4861   cat conftest.$ac_ext >&5
4862   rm -rf conftest*
4863   eval "ac_cv_header_$ac_safe=no"
4864 fi
4865 rm -f conftest*
4866 fi
4867 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4868   echo "$ac_t""yes" 1>&6
4869     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4870   cat >> confdefs.h <<EOF
4871 #define $ac_tr_hdr 1
4872 EOF
4873  
4874 else
4875   echo "$ac_t""no" 1>&6
4876 fi
4877 done
4878
4879
4880 for ac_func in \
4881 tgetent \
4882 tigetnum \
4883 tigetstr \
4884 strstr \
4885
4886 do
4887 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4888 echo "configure:4889: checking for $ac_func" >&5
4889 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4890   echo $ac_n "(cached) $ac_c" 1>&6
4891 else
4892   cat > conftest.$ac_ext <<EOF
4893 #line 4894 "configure"
4894 #include "confdefs.h"
4895 /* System header to define __stub macros and hopefully few prototypes,
4896     which can conflict with char $ac_func(); below.  */
4897 #include <assert.h>
4898 /* Override any gcc2 internal prototype to avoid an error.  */
4899 /* We use char because int might match the return type of a gcc2
4900     builtin and then its argument prototype would still apply.  */
4901 char $ac_func();
4902
4903 int main() {
4904
4905 /* The GNU C library defines this for functions which it implements
4906     to always fail with ENOSYS.  Some functions are actually named
4907     something starting with __ and the normal name is an alias.  */
4908 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4909 choke me
4910 #else
4911 $ac_func();
4912 #endif
4913
4914 ; return 0; }
4915 EOF
4916 if { (eval echo configure:4917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4917   rm -rf conftest*
4918   eval "ac_cv_func_$ac_func=yes"
4919 else
4920   echo "configure: failed program was:" >&5
4921   cat conftest.$ac_ext >&5
4922   rm -rf conftest*
4923   eval "ac_cv_func_$ac_func=no"
4924 fi
4925 rm -f conftest*
4926 fi
4927
4928 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4929   echo "$ac_t""yes" 1>&6
4930     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4931   cat >> confdefs.h <<EOF
4932 #define $ac_tr_func 1
4933 EOF
4934  
4935 else
4936   echo "$ac_t""no" 1>&6
4937 fi
4938 done
4939
4940
4941
4942 echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
4943 echo "configure:4944: checking if sys/time.h works with sys/select.h" >&5
4944 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
4945   echo $ac_n "(cached) $ac_c" 1>&6
4946 else
4947   
4948 cat > conftest.$ac_ext <<EOF
4949 #line 4950 "configure"
4950 #include "confdefs.h"
4951
4952 #include <sys/types.h>
4953 #ifdef HAVE_SYS_TIME_H
4954 #include <sys/time.h>
4955 #endif
4956 #ifdef HAVE_SYS_SELECT_H
4957 #include <sys/select.h>
4958 #endif
4959
4960 int main() {
4961
4962 ; return 0; }
4963 EOF
4964 if { (eval echo configure:4965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4965   rm -rf conftest*
4966   cf_cv_sys_time_select=yes
4967 else
4968   echo "configure: failed program was:" >&5
4969   cat conftest.$ac_ext >&5
4970   rm -rf conftest*
4971   cf_cv_sys_time_select=no
4972 fi
4973 rm -f conftest*
4974      
4975 fi
4976
4977 echo "$ac_t""$cf_cv_sys_time_select" 1>&6
4978 test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF
4979 #define HAVE_SYS_TIME_SELECT 1
4980 EOF
4981
4982
4983
4984 TICS_ARGS="$LIBS"
4985 LIBS=
4986
4987
4988 trap '' 1 2 15
4989 cat > confcache <<\EOF
4990 # This file is a shell script that caches the results of configure
4991 # tests run on this system so they can be shared between configure
4992 # scripts and configure runs.  It is not useful on other systems.
4993 # If it contains results you don't want to keep, you may remove or edit it.
4994 #
4995 # By default, configure uses ./config.cache as the cache file,
4996 # creating it if it does not exist already.  You can give configure
4997 # the --cache-file=FILE option to use a different cache file; that is
4998 # what configure does when it calls configure scripts in
4999 # subdirectories, so they share the cache.
5000 # Giving --cache-file=/dev/null disables caching, for debugging configure.
5001 # config.status only pays attention to the cache file if you give it the
5002 # --recheck option to rerun configure.
5003 #
5004 EOF
5005 # The following way of writing the cache mishandles newlines in values,
5006 # but we know of no workaround that is simple, portable, and efficient.
5007 # So, don't put newlines in cache variables' values.
5008 # Ultrix sh set writes to stderr and can't be redirected directly,
5009 # and sets the high bit in the cache file unless we assign to the vars.
5010 (set) 2>&1 |
5011   case `(ac_space=' '; set | grep ac_space) 2>&1` in
5012   *ac_space=\ *)
5013     # `set' does not quote correctly, so add quotes (double-quote substitution
5014     # turns \\\\ into \\, and sed turns \\ into \).
5015     sed -n \
5016       -e "s/'/'\\\\''/g" \
5017       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
5018     ;;
5019   *)
5020     # `set' quotes correctly as required by POSIX, so do not add quotes.
5021     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
5022     ;;
5023   esac >> confcache
5024 if cmp -s $cache_file confcache; then
5025   :
5026 else
5027   if test -w $cache_file; then
5028     echo "updating cache $cache_file"
5029     cat confcache > $cache_file
5030   else
5031     echo "not updating unwritable cache $cache_file"
5032   fi
5033 fi
5034 rm -f confcache
5035
5036 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
5037
5038 test "x$prefix" = xNONE && prefix=$ac_default_prefix
5039 # Let make expand exec_prefix.
5040 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
5041
5042 # Any assignment to VPATH causes Sun make to only execute
5043 # the first set of double-colon rules, so remove it if not needed.
5044 # If there is a colon in the path, we need to keep it.
5045 if test "x$srcdir" = x.; then
5046   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
5047 fi
5048
5049 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
5050
5051 DEFS=-DHAVE_CONFIG_H
5052
5053 # Without the "./", some shells look in PATH for config.status.
5054 : ${CONFIG_STATUS=./config.status}
5055
5056 echo creating $CONFIG_STATUS
5057 rm -f $CONFIG_STATUS
5058 cat > $CONFIG_STATUS <<EOF
5059 #! /bin/sh
5060 # Generated automatically by configure.
5061 # Run this file to recreate the current configuration.
5062 # This directory was configured as follows,
5063 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
5064 #
5065 # $0 $ac_configure_args
5066 #
5067 # Compiler output produced by configure, useful for debugging
5068 # configure, is in ./config.log if it exists.
5069
5070 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
5071 for ac_option
5072 do
5073   case "\$ac_option" in
5074   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
5075     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
5076     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
5077   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
5078     echo "$CONFIG_STATUS generated by autoconf version 2.13.20030927"
5079     exit 0 ;;
5080   -help | --help | --hel | --he | --h)
5081     echo "\$ac_cs_usage"; exit 0 ;;
5082   *) echo "\$ac_cs_usage"; exit 1 ;;
5083   esac
5084 done
5085
5086 ac_given_srcdir=$srcdir
5087 ac_given_INSTALL="$INSTALL"
5088
5089 trap 'rm -fr `echo "Makefile ncurses_cfg.h:ncurses_tst.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
5090 EOF
5091 cat >> $CONFIG_STATUS <<EOF
5092
5093 # Protect against being on the right side of a sed subst in config.status.
5094 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
5095  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
5096 $ac_vpsub
5097 $extrasub
5098 s%@SHELL@%$SHELL%g
5099 s%@CFLAGS@%$CFLAGS%g
5100 s%@CPPFLAGS@%$CPPFLAGS%g
5101 s%@CXXFLAGS@%$CXXFLAGS%g
5102 s%@FFLAGS@%$FFLAGS%g
5103 s%@DEFS@%$DEFS%g
5104 s%@LDFLAGS@%$LDFLAGS%g
5105 s%@LIBS@%$LIBS%g
5106 s%@exec_prefix@%$exec_prefix%g
5107 s%@prefix@%$prefix%g
5108 s%@program_transform_name@%$program_transform_name%g
5109 s%@bindir@%$bindir%g
5110 s%@sbindir@%$sbindir%g
5111 s%@libexecdir@%$libexecdir%g
5112 s%@datadir@%$datadir%g
5113 s%@sysconfdir@%$sysconfdir%g
5114 s%@sharedstatedir@%$sharedstatedir%g
5115 s%@localstatedir@%$localstatedir%g
5116 s%@libdir@%$libdir%g
5117 s%@includedir@%$includedir%g
5118 s%@oldincludedir@%$oldincludedir%g
5119 s%@infodir@%$infodir%g
5120 s%@mandir@%$mandir%g
5121 s%@host@%$host%g
5122 s%@host_alias@%$host_alias%g
5123 s%@host_cpu@%$host_cpu%g
5124 s%@host_vendor@%$host_vendor%g
5125 s%@host_os@%$host_os%g
5126 s%@SET_MAKE@%$SET_MAKE%g
5127 s%@CC@%$CC%g
5128 s%@CPP@%$CPP%g
5129 s%@AWK@%$AWK%g
5130 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
5131 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
5132 s%@INSTALL_DATA@%$INSTALL_DATA%g
5133 s%@LN_S@%$LN_S%g
5134 s%@MAKE_LOWER_TAGS@%$MAKE_LOWER_TAGS%g
5135 s%@MAKE_UPPER_TAGS@%$MAKE_UPPER_TAGS%g
5136 s%@CC_G_OPT@%$CC_G_OPT%g
5137 s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
5138 s%@DESTDIR@%$DESTDIR%g
5139 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
5140 s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
5141 s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
5142 s%@ECHO_LINK@%$ECHO_LINK%g
5143 s%@EXTRA_LDFLAGS@%$EXTRA_LDFLAGS%g
5144 s%@LD@%$LD%g
5145 s%@LDFLAGS_SHARED@%$LDFLAGS_SHARED%g
5146 s%@LD_MODEL@%$LD_MODEL%g
5147 s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
5148 s%@LIBTOOL@%$LIBTOOL%g
5149 s%@LIB_CLEAN@%$LIB_CLEAN%g
5150 s%@LIB_COMPILE@%$LIB_COMPILE%g
5151 s%@LIB_INSTALL@%$LIB_INSTALL%g
5152 s%@LIB_LINK@%$LIB_LINK%g
5153 s%@LIB_SUFFIX@%$LIB_SUFFIX%g
5154 s%@LIB_UNINSTALL@%$LIB_UNINSTALL%g
5155 s%@LINK_PROGS@%$LINK_PROGS%g
5156 s%@LINT@%$LINT%g
5157 s%@LINT_OPTS@%$LINT_OPTS%g
5158 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
5159 s%@MATH_LIB@%$MATH_LIB%g
5160 s%@TICS_ARGS@%$TICS_ARGS%g
5161 s%@TINFO_ARGS@%$TINFO_ARGS%g
5162 s%@cf_cv_abi_version@%$cf_cv_abi_version%g
5163 s%@cf_cv_rel_version@%$cf_cv_rel_version%g
5164 s%@NCURSES_TREE@%$NCURSES_TREE%g
5165 s%@EXEEXT@%$EXEEXT%g
5166 s%@OBJEXT@%$OBJEXT%g
5167 s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%g
5168 s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
5169
5170 CEOF
5171 EOF
5172
5173 cat >> $CONFIG_STATUS <<\EOF
5174
5175 # Split the substitutions into bite-sized pieces for seds with
5176 # small command number limits, like on Digital OSF/1 and HP-UX.
5177 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
5178 ac_file=1 # Number of current file.
5179 ac_beg=1 # First line for current file.
5180 ac_end=$ac_max_sed_cmds # Line after last line for current file.
5181 ac_more_lines=:
5182 ac_sed_cmds=""
5183 while $ac_more_lines; do
5184   if test $ac_beg -gt 1; then
5185     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
5186   else
5187     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
5188   fi
5189   if test ! -s conftest.s$ac_file; then
5190     ac_more_lines=false
5191     rm -f conftest.s$ac_file
5192   else
5193     if test -z "$ac_sed_cmds"; then
5194       ac_sed_cmds="sed -f conftest.s$ac_file"
5195     else
5196       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
5197     fi
5198     ac_file=`expr $ac_file + 1`
5199     ac_beg=$ac_end
5200     ac_end=`expr $ac_end + $ac_max_sed_cmds`
5201   fi
5202 done
5203 if test -z "$ac_sed_cmds"; then
5204   ac_sed_cmds=cat
5205 fi
5206 EOF
5207
5208 cat >> $CONFIG_STATUS <<EOF
5209
5210 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
5211 EOF
5212 cat >> $CONFIG_STATUS <<\EOF
5213 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
5214   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5215   case "$ac_file" in
5216   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5217        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5218   *) ac_file_in="${ac_file}.in" ;;
5219   esac
5220
5221   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
5222
5223   # Remove last slash and all that follows it.  Not all systems have dirname.
5224   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5225   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5226     # The file is in a subdirectory.
5227     test ! -d "$ac_dir" && mkdir "$ac_dir"
5228     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
5229     # A "../" for each directory in $ac_dir_suffix.
5230     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
5231   else
5232     ac_dir_suffix= ac_dots=
5233   fi
5234
5235   case "$ac_given_srcdir" in
5236   .)  srcdir=.
5237       if test -z "$ac_dots"; then top_srcdir=.
5238       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
5239   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
5240   *) # Relative path.
5241     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
5242     top_srcdir="$ac_dots$ac_given_srcdir" ;;
5243   esac
5244
5245   case "$ac_given_INSTALL" in
5246   [/$]*) INSTALL="$ac_given_INSTALL" ;;
5247   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
5248   esac
5249
5250   echo creating "$ac_file"
5251   rm -f "$ac_file"
5252   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
5253   case "$ac_file" in
5254   *Makefile*) ac_comsub="1i\\
5255 # $configure_input" ;;
5256   *) ac_comsub= ;;
5257   esac
5258
5259   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5260   sed -e "$ac_comsub
5261 s%@configure_input@%$configure_input%g
5262 s%@srcdir@%$srcdir%g
5263 s%@top_srcdir@%$top_srcdir%g
5264 s%@INSTALL@%$INSTALL%g
5265 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
5266 fi; done
5267 rm -f conftest.s*
5268
5269 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
5270 # NAME is the cpp macro being defined and VALUE is the value it is being given.
5271 #
5272 # ac_d sets the value in "#define NAME VALUE" lines.
5273 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
5274 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
5275 ac_dC='\3'
5276 ac_dD='%g'
5277 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
5278 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5279 ac_uB='\([      ]\)%\1#\2define\3'
5280 ac_uC=' '
5281 ac_uD='\4%g'
5282 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
5283 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5284 ac_eB='$%\1#\2define\3'
5285 ac_eC=' '
5286 ac_eD='%g'
5287
5288 if test "${CONFIG_HEADERS+set}" != set; then
5289 EOF
5290 cat >> $CONFIG_STATUS <<EOF
5291   CONFIG_HEADERS="ncurses_cfg.h:ncurses_tst.hin"
5292 EOF
5293 cat >> $CONFIG_STATUS <<\EOF
5294 fi
5295 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
5296   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5297   case "$ac_file" in
5298   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5299        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5300   *) ac_file_in="${ac_file}.in" ;;
5301   esac
5302
5303   echo creating $ac_file
5304
5305   rm -f conftest.frag conftest.in conftest.out
5306   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5307   cat $ac_file_inputs > conftest.in
5308
5309 EOF
5310
5311
5312 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
5313 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
5314 # be either 'cat' or 'sort'.
5315 cat confdefs.h >conftest.vals
5316
5317 # Break up conftest.vals because some shells have a limit on
5318 # the size of here documents, and old seds have small limits too.
5319
5320 rm -f conftest.tail
5321 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
5322 while :
5323 do
5324   ac_lines=`grep -c . conftest.vals`
5325   # grep -c gives empty output for an empty file on some AIX systems.
5326   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
5327   # Write chunks of a limited-size here document to conftest.frag.
5328   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
5329   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
5330   echo 'CEOF' >> $CONFIG_STATUS
5331   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
5332   rm -f conftest.vals
5333   mv conftest.tail conftest.vals
5334 done
5335 rm -f conftest.vals
5336
5337 # Run sed to substitute the contents of conftest.frag into conftest.in at the
5338 # marker @DEFS@.
5339 echo '  cat >> conftest.edit <<CEOF
5340 /@DEFS@/r conftest.frag
5341 /@DEFS@/d
5342 CEOF
5343 sed -f conftest.edit conftest.in > conftest.out
5344 rm -f conftest.in
5345 mv conftest.out conftest.in
5346 rm -f conftest.edit conftest.frag
5347 ' >> $CONFIG_STATUS
5348
5349
5350 cat >> $CONFIG_STATUS <<\EOF
5351   rm -f conftest.frag conftest.h
5352   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
5353   cat conftest.in >> conftest.h
5354   rm -f conftest.in
5355   if cmp -s $ac_file conftest.h 2>/dev/null; then
5356     echo "$ac_file is unchanged"
5357     rm -f conftest.h
5358   else
5359     # Remove last slash and all that follows it.  Not all systems have dirname.
5360       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5361       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5362       # The file is in a subdirectory.
5363       test ! -d "$ac_dir" && mkdir "$ac_dir"
5364     fi
5365     rm -f $ac_file
5366     mv conftest.h $ac_file
5367   fi
5368 fi; done
5369
5370 EOF
5371 cat >> $CONFIG_STATUS <<EOF
5372 # Extra initialization commands, if any
5373
5374 AWK="$AWK"
5375
5376 EOF
5377 cat >> $CONFIG_STATUS <<\EOF
5378 # Extra commands, if any
5379
5380
5381 for cf_dir in .
5382 do
5383         if test ! -d $srcdir/$cf_dir; then
5384                 continue
5385         elif test -f $srcdir/$cf_dir/programs; then
5386                 $AWK -f $srcdir/mk-test.awk ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
5387         fi
5388 done
5389
5390
5391         cat >>Makefile <<TEST_EOF
5392
5393 # These rules are generated so we do not rely on suffix rules, which do not
5394 # work consistently for different make-programs (the '\$(MODEL)/' confuses
5395 # some, and the '\$x' confuses others).
5396 TEST_EOF
5397 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
5398 for N in $LIST
5399 do
5400         cat >>Makefile <<TEST_EOF
5401
5402 \$(MODEL)/$N.o : $N.c \\
5403         tack.h \\
5404         ncurses_cfg.h
5405         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
5406 TEST_EOF
5407 done
5408
5409 exit 0
5410 EOF
5411 chmod +x $CONFIG_STATUS
5412 rm -fr confdefs* $ac_clean_files
5413 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
5414