]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
9819eba781d21815aecaf63b55196f2199df695d
[ncurses.git] / test / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13.20030927 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14
15 # Initialize some variables set by options.
16 # The variables have the same names as the options, with
17 # dashes changed to underlines.
18 build=NONE
19 cache_file=./config.cache
20 exec_prefix=NONE
21 host=NONE
22 no_create=
23 nonopt=NONE
24 no_recursion=
25 prefix=NONE
26 program_prefix=NONE
27 program_suffix=NONE
28 program_transform_name=s,x,x,
29 silent=
30 site=
31 srcdir=
32 target=NONE
33 verbose=
34 x_includes=NONE
35 x_libraries=NONE
36 bindir='${exec_prefix}/bin'
37 sbindir='${exec_prefix}/sbin'
38 libexecdir='${exec_prefix}/libexec'
39 datadir='${prefix}/share'
40 sysconfdir='${prefix}/etc'
41 sharedstatedir='${prefix}/com'
42 localstatedir='${prefix}/var'
43 libdir='${exec_prefix}/lib'
44 includedir='${prefix}/include'
45 oldincludedir='/usr/include'
46 infodir='${prefix}/info'
47 mandir='${prefix}/man'
48
49 # Initialize some other variables.
50 subdirs=
51 MFLAGS= MAKEFLAGS=
52 SHELL=${CONFIG_SHELL-/bin/sh}
53 # Maximum number of lines to put in a shell here document.
54 ac_max_here_lines=12
55
56 ac_prev=
57 for ac_option
58 do
59
60   # If the previous option needs an argument, assign it.
61   if test -n "$ac_prev"; then
62     eval "$ac_prev=\$ac_option"
63     ac_prev=
64     continue
65   fi
66
67   case "$ac_option" in
68   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
69   *) ac_optarg= ;;
70   esac
71
72   # Accept the important Cygnus configure options, so we can diagnose typos.
73
74   case "$ac_option" in
75
76   -bindir | --bindir | --bindi | --bind | --bin | --bi)
77     ac_prev=bindir ;;
78   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
79     bindir="$ac_optarg" ;;
80
81   -build | --build | --buil | --bui | --bu)
82     ac_prev=build ;;
83   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
84     build="$ac_optarg" ;;
85
86   -cache-file | --cache-file | --cache-fil | --cache-fi \
87   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
88     ac_prev=cache_file ;;
89   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
90   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
91     cache_file="$ac_optarg" ;;
92
93   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
94     ac_prev=datadir ;;
95   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
96   | --da=*)
97     datadir="$ac_optarg" ;;
98
99   -disable-* | --disable-*)
100     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
101     # Reject names that are not valid shell variable names.
102     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
103       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
104     fi
105     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
106     eval "enable_${ac_feature}=no" ;;
107
108   -enable-* | --enable-*)
109     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
110     # Reject names that are not valid shell variable names.
111     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
112       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
113     fi
114     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
115     case "$ac_option" in
116       *=*) ;;
117       *) ac_optarg=yes ;;
118     esac
119     eval "enable_${ac_feature}='$ac_optarg'" ;;
120
121   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
122   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
123   | --exec | --exe | --ex)
124     ac_prev=exec_prefix ;;
125   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
126   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
127   | --exec=* | --exe=* | --ex=*)
128     exec_prefix="$ac_optarg" ;;
129
130   -gas | --gas | --ga | --g)
131     # Obsolete; use --with-gas.
132     with_gas=yes ;;
133
134   -help | --help | --hel | --he)
135     # Omit some internal or obsolete options to make the list less imposing.
136     # This message is too long to be a string in the A/UX 3.1 sh.
137     cat << EOF
138 Usage: configure [options] [host]
139 Options: [defaults in brackets after descriptions]
140 Configuration:
141   --cache-file=FILE       cache test results in FILE
142   --help                  print this message
143   --no-create             do not create output files
144   --quiet, --silent       do not print \`checking...' messages
145   --version               print the version of autoconf that created configure
146 Directory and file names:
147   --prefix=PREFIX         install architecture-independent files in PREFIX
148                           [$ac_default_prefix]
149   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
150                           [same as prefix]
151   --bindir=DIR            user executables in DIR [EPREFIX/bin]
152   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
153   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
154   --datadir=DIR           read-only architecture-independent data in DIR
155                           [PREFIX/share]
156   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
157   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
158                           [PREFIX/com]
159   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
160   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
161   --includedir=DIR        C header files in DIR [PREFIX/include]
162   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
163   --infodir=DIR           info documentation in DIR [PREFIX/info]
164   --mandir=DIR            man documentation in DIR [PREFIX/man]
165   --srcdir=DIR            find the sources in DIR [configure dir or ..]
166   --program-prefix=PREFIX prepend PREFIX to installed program names
167   --program-suffix=SUFFIX append SUFFIX to installed program names
168   --program-transform-name=PROGRAM
169                           run sed PROGRAM on installed program names
170 EOF
171     cat << EOF
172 Host type:
173   --build=BUILD           configure for building on BUILD [BUILD=HOST]
174   --host=HOST             configure for HOST [guessed]
175   --target=TARGET         configure for TARGET [TARGET=HOST]
176 Features and packages:
177   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
178   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
179   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
180   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
181   --x-includes=DIR        X include files are in DIR
182   --x-libraries=DIR       X library files are in DIR
183 EOF
184 cat <<\EOF
185 --enable and --with options recognized:
186   --disable-echo          display "compiling" commands
187   --enable-warnings       test: turn on gcc compiler warnings
188   --with-curses-dir=DIR   directory in which (n)curses is installed
189   --with-5lib             use SunOS sysv-libraries
190   --with-ncursesw         use wide ncurses-libraries (installed)
191   --with-ncurses          use ncurses-libraries (installed)
192   --with-pdcurses         compile/link with pdcurses X11 library
193   --with-Xaw3d            link with Xaw 3d library
194   --with-neXtaw           link with neXT Athena library
195   --with-XawPlus          link with Athena-Plus library
196   --with-pkg-config{=path} enable/disable use of pkg-config
197   --with-x                use the X Window System
198   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
199 EOF
200 cat <<\EOF
201 EOF
202     exit 0 ;;
203
204   -host | --host | --hos | --ho)
205     ac_prev=host ;;
206   -host=* | --host=* | --hos=* | --ho=*)
207     host="$ac_optarg" ;;
208
209   -includedir | --includedir | --includedi | --included | --include \
210   | --includ | --inclu | --incl | --inc)
211     ac_prev=includedir ;;
212   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
213   | --includ=* | --inclu=* | --incl=* | --inc=*)
214     includedir="$ac_optarg" ;;
215
216   -infodir | --infodir | --infodi | --infod | --info | --inf)
217     ac_prev=infodir ;;
218   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
219     infodir="$ac_optarg" ;;
220
221   -libdir | --libdir | --libdi | --libd)
222     ac_prev=libdir ;;
223   -libdir=* | --libdir=* | --libdi=* | --libd=*)
224     libdir="$ac_optarg" ;;
225
226   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
227   | --libexe | --libex | --libe)
228     ac_prev=libexecdir ;;
229   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
230   | --libexe=* | --libex=* | --libe=*)
231     libexecdir="$ac_optarg" ;;
232
233   -localstatedir | --localstatedir | --localstatedi | --localstated \
234   | --localstate | --localstat | --localsta | --localst \
235   | --locals | --local | --loca | --loc | --lo)
236     ac_prev=localstatedir ;;
237   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
238   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
239   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
240     localstatedir="$ac_optarg" ;;
241
242   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
243     ac_prev=mandir ;;
244   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
245     mandir="$ac_optarg" ;;
246
247   -nfp | --nfp | --nf)
248     # Obsolete; use --without-fp.
249     with_fp=no ;;
250
251   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
252   | --no-cr | --no-c)
253     no_create=yes ;;
254
255   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
256   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
257     no_recursion=yes ;;
258
259   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
260   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
261   | --oldin | --oldi | --old | --ol | --o)
262     ac_prev=oldincludedir ;;
263   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
264   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
265   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
266     oldincludedir="$ac_optarg" ;;
267
268   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
269     ac_prev=prefix ;;
270   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
271     prefix="$ac_optarg" ;;
272
273   -program-prefix | --program-prefix | --program-prefi | --program-pref \
274   | --program-pre | --program-pr | --program-p)
275     ac_prev=program_prefix ;;
276   -program-prefix=* | --program-prefix=* | --program-prefi=* \
277   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
278     program_prefix="$ac_optarg" ;;
279
280   -program-suffix | --program-suffix | --program-suffi | --program-suff \
281   | --program-suf | --program-su | --program-s)
282     ac_prev=program_suffix ;;
283   -program-suffix=* | --program-suffix=* | --program-suffi=* \
284   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
285     program_suffix="$ac_optarg" ;;
286
287   -program-transform-name | --program-transform-name \
288   | --program-transform-nam | --program-transform-na \
289   | --program-transform-n | --program-transform- \
290   | --program-transform | --program-transfor \
291   | --program-transfo | --program-transf \
292   | --program-trans | --program-tran \
293   | --progr-tra | --program-tr | --program-t)
294     ac_prev=program_transform_name ;;
295   -program-transform-name=* | --program-transform-name=* \
296   | --program-transform-nam=* | --program-transform-na=* \
297   | --program-transform-n=* | --program-transform-=* \
298   | --program-transform=* | --program-transfor=* \
299   | --program-transfo=* | --program-transf=* \
300   | --program-trans=* | --program-tran=* \
301   | --progr-tra=* | --program-tr=* | --program-t=*)
302     program_transform_name="$ac_optarg" ;;
303
304   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
305   | -silent | --silent | --silen | --sile | --sil)
306     silent=yes ;;
307
308   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
309     ac_prev=sbindir ;;
310   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
311   | --sbi=* | --sb=*)
312     sbindir="$ac_optarg" ;;
313
314   -sharedstatedir | --sharedstatedir | --sharedstatedi \
315   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
316   | --sharedst | --shareds | --shared | --share | --shar \
317   | --sha | --sh)
318     ac_prev=sharedstatedir ;;
319   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
320   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
321   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
322   | --sha=* | --sh=*)
323     sharedstatedir="$ac_optarg" ;;
324
325   -site | --site | --sit)
326     ac_prev=site ;;
327   -site=* | --site=* | --sit=*)
328     site="$ac_optarg" ;;
329
330   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
331     ac_prev=srcdir ;;
332   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
333     srcdir="$ac_optarg" ;;
334
335   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
336   | --syscon | --sysco | --sysc | --sys | --sy)
337     ac_prev=sysconfdir ;;
338   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
339   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
340     sysconfdir="$ac_optarg" ;;
341
342   -target | --target | --targe | --targ | --tar | --ta | --t)
343     ac_prev=target ;;
344   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
345     target="$ac_optarg" ;;
346
347   -v | -verbose | --verbose | --verbos | --verbo | --verb)
348     verbose=yes ;;
349
350   -version | --version | --versio | --versi | --vers)
351     echo "configure generated by autoconf version 2.13.20030927"
352     exit 0 ;;
353
354   -with-* | --with-*)
355     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
356     # Reject names that are not valid shell variable names.
357     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
358       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
359     fi
360     ac_package=`echo $ac_package| sed 's/-/_/g'`
361     case "$ac_option" in
362       *=*) ;;
363       *) ac_optarg=yes ;;
364     esac
365     eval "with_${ac_package}='$ac_optarg'" ;;
366
367   -without-* | --without-*)
368     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
369     # Reject names that are not valid shell variable names.
370     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
371       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
372     fi
373     ac_package=`echo $ac_package| sed 's/-/_/g'`
374     eval "with_${ac_package}=no" ;;
375
376   --x)
377     # Obsolete; use --with-x.
378     with_x=yes ;;
379
380   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
381   | --x-incl | --x-inc | --x-in | --x-i)
382     ac_prev=x_includes ;;
383   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
384   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
385     x_includes="$ac_optarg" ;;
386
387   -x-libraries | --x-libraries | --x-librarie | --x-librari \
388   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
389     ac_prev=x_libraries ;;
390   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
391   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
392     x_libraries="$ac_optarg" ;;
393
394   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
395     ;;
396
397   *)
398     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
399       echo "configure: warning: $ac_option: invalid host type" 1>&2
400     fi
401     if test "x$nonopt" != xNONE; then
402       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
403     fi
404     nonopt="$ac_option"
405     ;;
406
407   esac
408 done
409
410 if test -n "$ac_prev"; then
411   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
412 fi
413
414 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
415
416 # File descriptor usage:
417 # 0 standard input
418 # 1 file creation
419 # 2 errors and warnings
420 # 3 some systems may open it to /dev/tty
421 # 4 used on the Kubota Titan
422 # 6 checking for... messages and results
423 # 5 compiler messages saved in config.log
424 if test "$silent" = yes; then
425   exec 6>/dev/null
426 else
427   exec 6>&1
428 fi
429 exec 5>./config.log
430
431 echo "\
432 This file contains any messages produced by compilers while
433 running configure, to aid debugging if configure makes a mistake.
434 " 1>&5
435
436 # Strip out --no-create and --no-recursion so they do not pile up.
437 # Also quote any args containing shell metacharacters.
438 ac_configure_args=
439 for ac_arg
440 do
441   case "$ac_arg" in
442   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
443   | --no-cr | --no-c) ;;
444   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
445   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
446   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
447   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
448   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
449   esac
450 done
451
452 # NLS nuisances.
453 # Only set these to C if already set.  These must not be set unconditionally
454 # because not all systems understand e.g. LANG=C (notably SCO).
455 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
456 # Non-C LC_CTYPE values break the ctype check.
457 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
458 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
459 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
460 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
461
462 # confdefs.h avoids OS command line length limits that DEFS can exceed.
463 rm -rf conftest* confdefs.h
464 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
465 echo > confdefs.h
466
467 # A filename unique to this package, relative to the directory that
468 # configure is in, which we can look for to find out if srcdir is correct.
469 ac_unique_file=ncurses.c
470
471 # Find the source files, if location was not specified.
472 if test -z "$srcdir"; then
473   ac_srcdir_defaulted=yes
474   # Try the directory containing this script, then its parent.
475   ac_prog=$0
476   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
477   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
478   srcdir=$ac_confdir
479   if test ! -r $srcdir/$ac_unique_file; then
480     srcdir=..
481   fi
482 else
483   ac_srcdir_defaulted=no
484 fi
485 if test ! -r $srcdir/$ac_unique_file; then
486   if test "$ac_srcdir_defaulted" = yes; then
487     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
488   else
489     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
490   fi
491 fi
492 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
493
494 # Prefer explicitly selected file to automatically selected ones.
495 if test -z "$CONFIG_SITE"; then
496   if test "x$prefix" != xNONE; then
497     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
498   else
499     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
500   fi
501 fi
502 for ac_site_file in $CONFIG_SITE; do
503   if test -r "$ac_site_file"; then
504     echo "loading site script $ac_site_file"
505     . "$ac_site_file"
506   fi
507 done
508
509 if test -r "$cache_file"; then
510   echo "loading cache $cache_file"
511   . $cache_file
512 else
513   echo "creating cache $cache_file"
514   > $cache_file
515 fi
516
517 ac_ext=c
518 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
519 ac_cpp='$CPP $CPPFLAGS'
520 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
521 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
522 cross_compiling=$ac_cv_prog_cc_cross
523
524 ac_exeext=
525 ac_objext=o
526 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
527   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
528   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
529     ac_n= ac_c='
530 ' ac_t='        '
531   else
532     ac_n=-n ac_c= ac_t=
533   fi
534 else
535   ac_n= ac_c='\c' ac_t=
536 fi
537
538
539
540
541
542 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
543
544
545 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
546
547 ac_aux_dir=
548 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
549   if test -f $ac_dir/install-sh; then
550     ac_aux_dir=$ac_dir
551     ac_install_sh="$ac_aux_dir/install-sh -c"
552     break
553   elif test -f $ac_dir/install.sh; then
554     ac_aux_dir=$ac_dir
555     ac_install_sh="$ac_aux_dir/install.sh -c"
556     break
557   fi
558 done
559 if test -z "$ac_aux_dir"; then
560   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
561 fi
562 ac_config_guess=$ac_aux_dir/config.guess
563 ac_config_sub=$ac_aux_dir/config.sub
564 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
565
566
567 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
568         
569 # Make sure we can run config.sub.
570 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
571 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
572 fi
573
574 echo $ac_n "checking host system type""... $ac_c" 1>&6
575 echo "configure:576: checking host system type" >&5
576
577 host_alias=$host
578 case "$host_alias" in
579 NONE)
580   case $nonopt in
581   NONE)
582     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
583     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
584     fi ;;
585   *) host_alias=$nonopt ;;
586   esac ;;
587 esac
588
589 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
590 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
591 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
592 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
593 echo "$ac_t""$host" 1>&6
594
595         system_name="$host_os"
596 else
597         system_name="`(uname -s -r) 2>/dev/null`"
598         if test -z "$system_name" ; then
599                 system_name="`(hostname) 2>/dev/null`"
600         fi
601 fi
602 test -n "$system_name" && cat >> confdefs.h <<EOF
603 #define SYSTEM_NAME "$system_name"
604 EOF
605
606 if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
607   echo $ac_n "(cached) $ac_c" 1>&6
608 else
609   cf_cv_system_name="$system_name"
610 fi
611
612
613 test -z "$system_name" && system_name="$cf_cv_system_name"
614 test -n "$cf_cv_system_name" && echo "$ac_t""Configuring for $cf_cv_system_name" 1>&6
615
616 if test ".$system_name" != ".$cf_cv_system_name" ; then
617         echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
618         { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
619 fi
620
621
622 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
623 echo "configure:624: checking whether ${MAKE-make} sets \${MAKE}" >&5
624 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
625 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
626   echo $ac_n "(cached) $ac_c" 1>&6
627 else
628   cat > conftestmake <<\EOF
629 all:
630         @echo 'ac_maketemp="${MAKE}"'
631 EOF
632 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
633 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
634 if test -n "$ac_maketemp"; then
635   eval ac_cv_prog_make_${ac_make}_set=yes
636 else
637   eval ac_cv_prog_make_${ac_make}_set=no
638 fi
639 rm -f conftestmake
640 fi
641 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
642   echo "$ac_t""yes" 1>&6
643   SET_MAKE=
644 else
645   echo "$ac_t""no" 1>&6
646   SET_MAKE="MAKE=${MAKE-make}"
647 fi
648
649 # Extract the first word of "gcc", so it can be a program name with args.
650 set dummy gcc; ac_word=$2
651 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
652 echo "configure:653: checking for $ac_word" >&5
653 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
654   echo $ac_n "(cached) $ac_c" 1>&6
655 else
656   if test -n "$CC"; then
657   ac_cv_prog_CC="$CC" # Let the user override the test.
658 else
659   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
660   ac_dummy="$PATH"
661   for ac_dir in $ac_dummy; do
662     test -z "$ac_dir" && ac_dir=.
663     if test -f $ac_dir/$ac_word; then
664       ac_cv_prog_CC="gcc"
665       break
666     fi
667   done
668   IFS="$ac_save_ifs"
669 fi
670 fi
671 CC="$ac_cv_prog_CC"
672 if test -n "$CC"; then
673   echo "$ac_t""$CC" 1>&6
674 else
675   echo "$ac_t""no" 1>&6
676 fi
677
678 if test -z "$CC"; then
679   # Extract the first word of "cc", so it can be a program name with args.
680 set dummy cc; ac_word=$2
681 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
682 echo "configure:683: checking for $ac_word" >&5
683 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
684   echo $ac_n "(cached) $ac_c" 1>&6
685 else
686   if test -n "$CC"; then
687   ac_cv_prog_CC="$CC" # Let the user override the test.
688 else
689   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
690   ac_prog_rejected=no
691   ac_dummy="$PATH"
692   for ac_dir in $ac_dummy; do
693     test -z "$ac_dir" && ac_dir=.
694     if test -f $ac_dir/$ac_word; then
695       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
696         ac_prog_rejected=yes
697         continue
698       fi
699       ac_cv_prog_CC="cc"
700       break
701     fi
702   done
703   IFS="$ac_save_ifs"
704 if test $ac_prog_rejected = yes; then
705   # We found a bogon in the path, so make sure we never use it.
706   set dummy $ac_cv_prog_CC
707   shift
708   if test $# -gt 0; then
709     # We chose a different compiler from the bogus one.
710     # However, it has the same basename, so the bogon will be chosen
711     # first if we set CC to just the basename; use the full file name.
712     shift
713     set dummy "$ac_dir/$ac_word" "$@"
714     shift
715     ac_cv_prog_CC="$@"
716   fi
717 fi
718 fi
719 fi
720 CC="$ac_cv_prog_CC"
721 if test -n "$CC"; then
722   echo "$ac_t""$CC" 1>&6
723 else
724   echo "$ac_t""no" 1>&6
725 fi
726
727   if test -z "$CC"; then
728     case "`uname -s`" in
729     *win32* | *WIN32*)
730       # Extract the first word of "cl", so it can be a program name with args.
731 set dummy cl; ac_word=$2
732 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
733 echo "configure:734: checking for $ac_word" >&5
734 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
735   echo $ac_n "(cached) $ac_c" 1>&6
736 else
737   if test -n "$CC"; then
738   ac_cv_prog_CC="$CC" # Let the user override the test.
739 else
740   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
741   ac_dummy="$PATH"
742   for ac_dir in $ac_dummy; do
743     test -z "$ac_dir" && ac_dir=.
744     if test -f $ac_dir/$ac_word; then
745       ac_cv_prog_CC="cl"
746       break
747     fi
748   done
749   IFS="$ac_save_ifs"
750 fi
751 fi
752 CC="$ac_cv_prog_CC"
753 if test -n "$CC"; then
754   echo "$ac_t""$CC" 1>&6
755 else
756   echo "$ac_t""no" 1>&6
757 fi
758  ;;
759     esac
760   fi
761   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
762 fi
763
764 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
765 echo "configure:766: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
766
767 ac_ext=c
768 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
769 ac_cpp='$CPP $CPPFLAGS'
770 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
771 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
772 cross_compiling=$ac_cv_prog_cc_cross
773
774 cat > conftest.$ac_ext << EOF
775
776 #line 777 "configure"
777 #include "confdefs.h"
778
779 main(){return(0);}
780 EOF
781 if { (eval echo configure:782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
782   ac_cv_prog_cc_works=yes
783   # If we can't run a trivial program, we are probably using a cross compiler.
784   if (./conftest; exit) 2>/dev/null; then
785     ac_cv_prog_cc_cross=no
786   else
787     ac_cv_prog_cc_cross=yes
788   fi
789 else
790   echo "configure: failed program was:" >&5
791   cat conftest.$ac_ext >&5
792   ac_cv_prog_cc_works=no
793 fi
794 rm -fr conftest*
795 ac_ext=c
796 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
797 ac_cpp='$CPP $CPPFLAGS'
798 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
799 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
800 cross_compiling=$ac_cv_prog_cc_cross
801
802 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
803 if test $ac_cv_prog_cc_works = no; then
804   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
805 fi
806 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
807 echo "configure:808: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
808 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
809 cross_compiling=$ac_cv_prog_cc_cross
810
811 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
812 echo "configure:813: checking whether we are using GNU C" >&5
813 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
814   echo $ac_n "(cached) $ac_c" 1>&6
815 else
816   cat > conftest.c <<EOF
817 #ifdef __GNUC__
818   yes;
819 #endif
820 EOF
821 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
822   ac_cv_prog_gcc=yes
823 else
824   ac_cv_prog_gcc=no
825 fi
826 fi
827
828 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
829
830 if test $ac_cv_prog_gcc = yes; then
831   GCC=yes
832 else
833   GCC=
834 fi
835
836 ac_test_CFLAGS="${CFLAGS+set}"
837 ac_save_CFLAGS="$CFLAGS"
838 CFLAGS=
839 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
840 echo "configure:841: checking whether ${CC-cc} accepts -g" >&5
841 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
842   echo $ac_n "(cached) $ac_c" 1>&6
843 else
844   echo 'void f(){}' > conftest.c
845 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
846   ac_cv_prog_cc_g=yes
847 else
848   ac_cv_prog_cc_g=no
849 fi
850 rm -f conftest*
851
852 fi
853
854 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
855 if test "$ac_test_CFLAGS" = set; then
856   CFLAGS="$ac_save_CFLAGS"
857 elif test $ac_cv_prog_cc_g = yes; then
858   if test "$GCC" = yes; then
859     CFLAGS="-g -O2"
860   else
861     CFLAGS="-g"
862   fi
863 else
864   if test "$GCC" = yes; then
865     CFLAGS="-O2"
866   else
867     CFLAGS=
868   fi
869 fi
870
871 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
872 echo "configure:873: checking how to run the C preprocessor" >&5
873 # On Suns, sometimes $CPP names a directory.
874 if test -n "$CPP" && test -d "$CPP"; then
875   CPP=
876 fi
877 if test -z "$CPP"; then
878 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
879   echo $ac_n "(cached) $ac_c" 1>&6
880 else
881     # This must be in double quotes, not single quotes, because CPP may get
882   # substituted into the Makefile and "${CC-cc}" will confuse make.
883   CPP="${CC-cc} -E"
884   # On the NeXT, cc -E runs the code through the compiler's parser,
885   # not just through cpp.
886   cat > conftest.$ac_ext <<EOF
887 #line 888 "configure"
888 #include "confdefs.h"
889 #include <assert.h>
890 Syntax Error
891 EOF
892 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
893 { (eval echo configure:894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
894 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
895 if test -z "$ac_err"; then
896   :
897 else
898   echo "$ac_err" >&5
899   echo "configure: failed program was:" >&5
900   cat conftest.$ac_ext >&5
901   rm -rf conftest*
902   CPP="${CC-cc} -E -traditional-cpp"
903   cat > conftest.$ac_ext <<EOF
904 #line 905 "configure"
905 #include "confdefs.h"
906 #include <assert.h>
907 Syntax Error
908 EOF
909 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
910 { (eval echo configure:911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
911 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
912 if test -z "$ac_err"; then
913   :
914 else
915   echo "$ac_err" >&5
916   echo "configure: failed program was:" >&5
917   cat conftest.$ac_ext >&5
918   rm -rf conftest*
919   CPP="${CC-cc} -nologo -E"
920   cat > conftest.$ac_ext <<EOF
921 #line 922 "configure"
922 #include "confdefs.h"
923 #include <assert.h>
924 Syntax Error
925 EOF
926 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
927 { (eval echo configure:928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
928 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
929 if test -z "$ac_err"; then
930   :
931 else
932   echo "$ac_err" >&5
933   echo "configure: failed program was:" >&5
934   cat conftest.$ac_ext >&5
935   rm -rf conftest*
936   CPP=/lib/cpp
937 fi
938 rm -f conftest*
939 fi
940 rm -f conftest*
941 fi
942 rm -f conftest*
943   ac_cv_prog_CPP="$CPP"
944 fi
945   CPP="$ac_cv_prog_CPP"
946 else
947   ac_cv_prog_CPP="$CPP"
948 fi
949 echo "$ac_t""$CPP" 1>&6
950
951 for ac_prog in mawk gawk nawk awk
952 do
953 # Extract the first word of "$ac_prog", so it can be a program name with args.
954 set dummy $ac_prog; ac_word=$2
955 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
956 echo "configure:957: checking for $ac_word" >&5
957 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
958   echo $ac_n "(cached) $ac_c" 1>&6
959 else
960   if test -n "$AWK"; then
961   ac_cv_prog_AWK="$AWK" # Let the user override the test.
962 else
963   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
964   ac_dummy="$PATH"
965   for ac_dir in $ac_dummy; do
966     test -z "$ac_dir" && ac_dir=.
967     if test -f $ac_dir/$ac_word; then
968       ac_cv_prog_AWK="$ac_prog"
969       break
970     fi
971   done
972   IFS="$ac_save_ifs"
973 fi
974 fi
975 AWK="$ac_cv_prog_AWK"
976 if test -n "$AWK"; then
977   echo "$ac_t""$AWK" 1>&6
978 else
979   echo "$ac_t""no" 1>&6
980 fi
981
982 test -n "$AWK" && break
983 done
984
985
986 echo $ac_n "checking if filesystem supports mixed-case filenames""... $ac_c" 1>&6
987 echo "configure:988: checking if filesystem supports mixed-case filenames" >&5
988 if eval "test \"`echo '$''{'cf_cv_mixedcase'+set}'`\" = set"; then
989   echo $ac_n "(cached) $ac_c" 1>&6
990 else
991   
992 if test "$cross_compiling" = yes ; then
993         case $target_alias in #(vi
994         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
995                 cf_cv_mixedcase=no
996                 ;;
997         *)
998                 cf_cv_mixedcase=yes
999                 ;;
1000         esac
1001 else
1002         rm -f conftest CONFTEST
1003         echo test >conftest
1004         if test -f CONFTEST ; then
1005                 cf_cv_mixedcase=no
1006         else
1007                 cf_cv_mixedcase=yes
1008         fi
1009         rm -f conftest CONFTEST
1010 fi
1011
1012 fi
1013
1014 echo "$ac_t""$cf_cv_mixedcase" 1>&6
1015 test "$cf_cv_mixedcase" = yes && cat >> confdefs.h <<\EOF
1016 #define MIXEDCASE_FILENAMES 1
1017 EOF
1018
1019
1020
1021
1022
1023 for ac_prog in exctags ctags
1024 do
1025 # Extract the first word of "$ac_prog", so it can be a program name with args.
1026 set dummy $ac_prog; ac_word=$2
1027 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1028 echo "configure:1029: checking for $ac_word" >&5
1029 if eval "test \"`echo '$''{'ac_cv_prog_CTAGS'+set}'`\" = set"; then
1030   echo $ac_n "(cached) $ac_c" 1>&6
1031 else
1032   if test -n "$CTAGS"; then
1033   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
1034 else
1035   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1036   ac_dummy="$PATH"
1037   for ac_dir in $ac_dummy; do
1038     test -z "$ac_dir" && ac_dir=.
1039     if test -f $ac_dir/$ac_word; then
1040       ac_cv_prog_CTAGS="$ac_prog"
1041       break
1042     fi
1043   done
1044   IFS="$ac_save_ifs"
1045 fi
1046 fi
1047 CTAGS="$ac_cv_prog_CTAGS"
1048 if test -n "$CTAGS"; then
1049   echo "$ac_t""$CTAGS" 1>&6
1050 else
1051   echo "$ac_t""no" 1>&6
1052 fi
1053
1054 test -n "$CTAGS" && break
1055 done
1056
1057 for ac_prog in exetags etags
1058 do
1059 # Extract the first word of "$ac_prog", so it can be a program name with args.
1060 set dummy $ac_prog; ac_word=$2
1061 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1062 echo "configure:1063: checking for $ac_word" >&5
1063 if eval "test \"`echo '$''{'ac_cv_prog_ETAGS'+set}'`\" = set"; then
1064   echo $ac_n "(cached) $ac_c" 1>&6
1065 else
1066   if test -n "$ETAGS"; then
1067   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
1068 else
1069   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1070   ac_dummy="$PATH"
1071   for ac_dir in $ac_dummy; do
1072     test -z "$ac_dir" && ac_dir=.
1073     if test -f $ac_dir/$ac_word; then
1074       ac_cv_prog_ETAGS="$ac_prog"
1075       break
1076     fi
1077   done
1078   IFS="$ac_save_ifs"
1079 fi
1080 fi
1081 ETAGS="$ac_cv_prog_ETAGS"
1082 if test -n "$ETAGS"; then
1083   echo "$ac_t""$ETAGS" 1>&6
1084 else
1085   echo "$ac_t""no" 1>&6
1086 fi
1087
1088 test -n "$ETAGS" && break
1089 done
1090
1091
1092 # Extract the first word of "${CTAGS-ctags}", so it can be a program name with args.
1093 set dummy ${CTAGS-ctags}; ac_word=$2
1094 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1095 echo "configure:1096: checking for $ac_word" >&5
1096 if eval "test \"`echo '$''{'ac_cv_prog_MAKE_LOWER_TAGS'+set}'`\" = set"; then
1097   echo $ac_n "(cached) $ac_c" 1>&6
1098 else
1099   if test -n "$MAKE_LOWER_TAGS"; then
1100   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
1101 else
1102   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1103   ac_dummy="$PATH"
1104   for ac_dir in $ac_dummy; do
1105     test -z "$ac_dir" && ac_dir=.
1106     if test -f $ac_dir/$ac_word; then
1107       ac_cv_prog_MAKE_LOWER_TAGS="yes"
1108       break
1109     fi
1110   done
1111   IFS="$ac_save_ifs"
1112   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
1113 fi
1114 fi
1115 MAKE_LOWER_TAGS="$ac_cv_prog_MAKE_LOWER_TAGS"
1116 if test -n "$MAKE_LOWER_TAGS"; then
1117   echo "$ac_t""$MAKE_LOWER_TAGS" 1>&6
1118 else
1119   echo "$ac_t""no" 1>&6
1120 fi
1121
1122
1123 if test "$cf_cv_mixedcase" = yes ; then
1124         # Extract the first word of "${ETAGS-etags}", so it can be a program name with args.
1125 set dummy ${ETAGS-etags}; ac_word=$2
1126 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1127 echo "configure:1128: checking for $ac_word" >&5
1128 if eval "test \"`echo '$''{'ac_cv_prog_MAKE_UPPER_TAGS'+set}'`\" = set"; then
1129   echo $ac_n "(cached) $ac_c" 1>&6
1130 else
1131   if test -n "$MAKE_UPPER_TAGS"; then
1132   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
1133 else
1134   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1135   ac_dummy="$PATH"
1136   for ac_dir in $ac_dummy; do
1137     test -z "$ac_dir" && ac_dir=.
1138     if test -f $ac_dir/$ac_word; then
1139       ac_cv_prog_MAKE_UPPER_TAGS="yes"
1140       break
1141     fi
1142   done
1143   IFS="$ac_save_ifs"
1144   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
1145 fi
1146 fi
1147 MAKE_UPPER_TAGS="$ac_cv_prog_MAKE_UPPER_TAGS"
1148 if test -n "$MAKE_UPPER_TAGS"; then
1149   echo "$ac_t""$MAKE_UPPER_TAGS" 1>&6
1150 else
1151   echo "$ac_t""no" 1>&6
1152 fi
1153
1154 else
1155         MAKE_UPPER_TAGS=no
1156 fi
1157
1158 if test "$MAKE_UPPER_TAGS" = yes ; then
1159         MAKE_UPPER_TAGS=
1160 else
1161         MAKE_UPPER_TAGS="#"
1162 fi
1163
1164 if test "$MAKE_LOWER_TAGS" = yes ; then
1165         MAKE_LOWER_TAGS=
1166 else
1167         MAKE_LOWER_TAGS="#"
1168 fi
1169
1170
1171
1172
1173
1174
1175
1176
1177 CC_G_OPT="-g"                                   
1178 CC_SHARED_OPTS=unknown                  
1179 CPPFLAGS="$CPPFLAGS"                    
1180 DFT_DEP_SUFFIX=""                               
1181 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`    
1182 DFT_UPR_MODEL="NORMAL"                  
1183 LD="ld"                                                 
1184 LDFLAGS_SHARED=""                               
1185 LDFLAGS_STATIC=""                               
1186 LD_MODEL=""                                             
1187 LD_SHARED_OPTS=""                               
1188 LIBTOOL=""                                              
1189 LIB_CLEAN=""                                    
1190 LIB_COMPILE=""                                  
1191 LIB_LINK='${CC}'                                
1192 LINK_TESTS=""                                   
1193 LINT=lint                                               
1194 LINT_OPTS=""                                    
1195 LOCAL_LDFLAGS=""                                
1196 MATH_LIB="-lm"                                  
1197 PTHREAD="-lm"                                   
1198 TEST_ARGS=""                                    
1199 TEST_DEPS=""                                    
1200 TEST_LIBS=""                                    
1201 TINFO_ARGS='$(LIBS_CURSES)'             
1202 cf_cv_abi_version=""                    
1203 cf_cv_rel_version=""                    
1204
1205 cf_cv_screen=curses
1206 cf_cv_libtype=
1207
1208 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
1209 echo "configure:1210: checking for Cygwin environment" >&5
1210 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
1211   echo $ac_n "(cached) $ac_c" 1>&6
1212 else
1213   cat > conftest.$ac_ext <<EOF
1214 #line 1215 "configure"
1215 #include "confdefs.h"
1216
1217 int main() {
1218
1219 #ifndef __CYGWIN__
1220 #define __CYGWIN__ __CYGWIN32__
1221 #endif
1222 return __CYGWIN__;
1223 ; return 0; }
1224 EOF
1225 if { (eval echo configure:1226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1226   rm -rf conftest*
1227   ac_cv_cygwin=yes
1228 else
1229   echo "configure: failed program was:" >&5
1230   cat conftest.$ac_ext >&5
1231   rm -rf conftest*
1232   ac_cv_cygwin=no
1233 fi
1234 rm -f conftest*
1235 rm -f conftest*
1236 fi
1237
1238 echo "$ac_t""$ac_cv_cygwin" 1>&6
1239 CYGWIN=
1240 test "$ac_cv_cygwin" = yes && CYGWIN=yes
1241 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
1242 echo "configure:1243: checking for mingw32 environment" >&5
1243 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
1244   echo $ac_n "(cached) $ac_c" 1>&6
1245 else
1246   cat > conftest.$ac_ext <<EOF
1247 #line 1248 "configure"
1248 #include "confdefs.h"
1249
1250 int main() {
1251 return __MINGW32__;
1252 ; return 0; }
1253 EOF
1254 if { (eval echo configure:1255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1255   rm -rf conftest*
1256   ac_cv_mingw32=yes
1257 else
1258   echo "configure: failed program was:" >&5
1259   cat conftest.$ac_ext >&5
1260   rm -rf conftest*
1261   ac_cv_mingw32=no
1262 fi
1263 rm -f conftest*
1264 rm -f conftest*
1265 fi
1266
1267 echo "$ac_t""$ac_cv_mingw32" 1>&6
1268 MINGW32=
1269 test "$ac_cv_mingw32" = yes && MINGW32=yes
1270
1271
1272 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1273 echo "configure:1274: checking for executable suffix" >&5
1274 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
1275   echo $ac_n "(cached) $ac_c" 1>&6
1276 else
1277   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
1278   ac_cv_exeext=.exe
1279 else
1280   rm -f conftest*
1281   echo 'int main () { return 0; }' > conftest.$ac_ext
1282   ac_cv_exeext=
1283   if { (eval echo configure:1284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1284     for file in conftest.*; do
1285       case $file in
1286       *.c | *.o | *.obj) ;;
1287       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
1288       esac
1289     done
1290   else
1291     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
1292   fi
1293   rm -f conftest*
1294   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
1295 fi
1296 fi
1297
1298 EXEEXT=""
1299 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
1300 echo "$ac_t""${ac_cv_exeext}" 1>&6
1301 ac_exeext=$EXEEXT
1302
1303 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
1304 echo "configure:1305: checking for object suffix" >&5
1305 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
1306   echo $ac_n "(cached) $ac_c" 1>&6
1307 else
1308   rm -f conftest*
1309 echo 'int i = 1;' > conftest.$ac_ext
1310 if { (eval echo configure:1311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1311   for ac_file in conftest.*; do
1312     case $ac_file in
1313     *.c) ;;
1314     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
1315     esac
1316   done
1317 else
1318   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
1319 fi
1320 rm -f conftest*
1321 fi
1322
1323 echo "$ac_t""$ac_cv_objext" 1>&6
1324 OBJEXT=$ac_cv_objext
1325 ac_objext=$ac_cv_objext
1326
1327
1328
1329 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
1330 echo "configure:1331: checking for ${CC-cc} option to accept ANSI C" >&5
1331 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
1332   echo $ac_n "(cached) $ac_c" 1>&6
1333 else
1334   
1335 cf_cv_ansi_cc=no
1336 cf_save_CFLAGS="$CFLAGS"
1337 cf_save_CPPFLAGS="$CPPFLAGS"
1338 # Don't try gcc -ansi; that turns off useful extensions and
1339 # breaks some systems' header files.
1340 # AIX                   -qlanglvl=ansi
1341 # Ultrix and OSF/1      -std1
1342 # HP-UX                 -Aa -D_HPUX_SOURCE
1343 # SVR4                  -Xc
1344 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
1345 for cf_arg in "-DCC_HAS_PROTOS" \
1346         "" \
1347         -qlanglvl=ansi \
1348         -std1 \
1349         -Ae \
1350         "-Aa -D_HPUX_SOURCE" \
1351         -Xc
1352 do
1353         
1354 cf_fix_cppflags=no
1355 cf_new_cflags=
1356 cf_new_cppflags=
1357 cf_new_extra_cppflags=
1358
1359 for cf_add_cflags in $cf_arg
1360 do
1361 case $cf_fix_cppflags in
1362 no)
1363         case $cf_add_cflags in #(vi
1364         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1365                 case $cf_add_cflags in
1366                 -D*)
1367                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1368
1369                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1370                                 && test -z "${cf_tst_cflags}" \
1371                                 && cf_fix_cppflags=yes
1372
1373                         if test $cf_fix_cppflags = yes ; then
1374                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1375                                 continue
1376                         elif test "${cf_tst_cflags}" = "\"'" ; then
1377                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1378                                 continue
1379                         fi
1380                         ;;
1381                 esac
1382                 case "$CPPFLAGS" in
1383                 *$cf_add_cflags) #(vi
1384                         ;;
1385                 *) #(vi
1386                         case $cf_add_cflags in #(vi
1387                         -D*)
1388                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1389                                 
1390 CPPFLAGS=`echo "$CPPFLAGS" | \
1391         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1392                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1393
1394                                 ;;
1395                         esac
1396                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1397                         ;;
1398                 esac
1399                 ;;
1400         *)
1401                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1402                 ;;
1403         esac
1404         ;;
1405 yes)
1406         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1407
1408         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1409
1410         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1411                 && test -z "${cf_tst_cflags}" \
1412                 && cf_fix_cppflags=no
1413         ;;
1414 esac
1415 done
1416
1417 if test -n "$cf_new_cflags" ; then
1418         
1419         CFLAGS="$CFLAGS $cf_new_cflags"
1420 fi
1421
1422 if test -n "$cf_new_cppflags" ; then
1423         
1424         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1425 fi
1426
1427 if test -n "$cf_new_extra_cppflags" ; then
1428         
1429         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1430 fi
1431
1432
1433
1434
1435         cat > conftest.$ac_ext <<EOF
1436 #line 1437 "configure"
1437 #include "confdefs.h"
1438
1439 #ifndef CC_HAS_PROTOS
1440 #if !defined(__STDC__) || (__STDC__ != 1)
1441 choke me
1442 #endif
1443 #endif
1444
1445 int main() {
1446
1447         int test (int i, double x);
1448         struct s1 {int (*f) (int a);};
1449         struct s2 {int (*f) (double a);};
1450 ; return 0; }
1451 EOF
1452 if { (eval echo configure:1453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1453   rm -rf conftest*
1454   cf_cv_ansi_cc="$cf_arg"; break
1455 else
1456   echo "configure: failed program was:" >&5
1457   cat conftest.$ac_ext >&5
1458 fi
1459 rm -f conftest*
1460 done
1461 CFLAGS="$cf_save_CFLAGS"
1462 CPPFLAGS="$cf_save_CPPFLAGS"
1463
1464 fi
1465
1466 echo "$ac_t""$cf_cv_ansi_cc" 1>&6
1467
1468 if test "$cf_cv_ansi_cc" != "no"; then
1469 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
1470         
1471 cf_fix_cppflags=no
1472 cf_new_cflags=
1473 cf_new_cppflags=
1474 cf_new_extra_cppflags=
1475
1476 for cf_add_cflags in $cf_cv_ansi_cc
1477 do
1478 case $cf_fix_cppflags in
1479 no)
1480         case $cf_add_cflags in #(vi
1481         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1482                 case $cf_add_cflags in
1483                 -D*)
1484                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1485
1486                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1487                                 && test -z "${cf_tst_cflags}" \
1488                                 && cf_fix_cppflags=yes
1489
1490                         if test $cf_fix_cppflags = yes ; then
1491                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1492                                 continue
1493                         elif test "${cf_tst_cflags}" = "\"'" ; then
1494                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1495                                 continue
1496                         fi
1497                         ;;
1498                 esac
1499                 case "$CPPFLAGS" in
1500                 *$cf_add_cflags) #(vi
1501                         ;;
1502                 *) #(vi
1503                         case $cf_add_cflags in #(vi
1504                         -D*)
1505                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1506                                 
1507 CPPFLAGS=`echo "$CPPFLAGS" | \
1508         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1509                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1510
1511                                 ;;
1512                         esac
1513                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1514                         ;;
1515                 esac
1516                 ;;
1517         *)
1518                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1519                 ;;
1520         esac
1521         ;;
1522 yes)
1523         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1524
1525         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1526
1527         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1528                 && test -z "${cf_tst_cflags}" \
1529                 && cf_fix_cppflags=no
1530         ;;
1531 esac
1532 done
1533
1534 if test -n "$cf_new_cflags" ; then
1535         
1536         CFLAGS="$CFLAGS $cf_new_cflags"
1537 fi
1538
1539 if test -n "$cf_new_cppflags" ; then
1540         
1541         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1542 fi
1543
1544 if test -n "$cf_new_extra_cppflags" ; then
1545         
1546         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1547 fi
1548
1549
1550
1551
1552 else
1553         cat >> confdefs.h <<\EOF
1554 #define CC_HAS_PROTOS 1
1555 EOF
1556
1557 fi
1558 fi
1559
1560
1561 if test "$cf_cv_ansi_cc" = "no"; then
1562         { echo "configure: error: Your compiler does not appear to recognize prototypes.
1563 You have the following choices:
1564         a. adjust your compiler options
1565         b. get an up-to-date compiler
1566         c. use a wrapper such as unproto" 1>&2; exit 1; }
1567 fi
1568
1569
1570 if test "$GCC" = yes
1571 then
1572 cat > conftest.i <<EOF
1573 #ifndef GCC_PRINTF
1574 #define GCC_PRINTF 0
1575 #endif
1576 #ifndef GCC_SCANF
1577 #define GCC_SCANF 0
1578 #endif
1579 #ifndef GCC_NORETURN
1580 #define GCC_NORETURN /* nothing */
1581 #endif
1582 #ifndef GCC_UNUSED
1583 #define GCC_UNUSED /* nothing */
1584 #endif
1585 EOF
1586 if test "$GCC" = yes
1587 then
1588         echo "checking for $CC __attribute__ directives" 1>&6
1589 echo "configure:1590: checking for $CC __attribute__ directives" >&5
1590 cat > conftest.$ac_ext <<EOF
1591 #line 1592 "${as_me-configure}"
1592 #include "confdefs.h"
1593 #include "conftest.h"
1594 #include "conftest.i"
1595 #if     GCC_PRINTF
1596 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
1597 #else
1598 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
1599 #endif
1600 #if     GCC_SCANF
1601 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
1602 #else
1603 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
1604 #endif
1605 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
1606 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
1607 extern void foo(void) GCC_NORETURN;
1608 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
1609 EOF
1610         cf_printf_attribute=no
1611         cf_scanf_attribute=no
1612         for cf_attribute in scanf printf unused noreturn
1613         do
1614                 
1615 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1616
1617                 cf_directive="__attribute__(($cf_attribute))"
1618                 echo "checking for $CC $cf_directive" 1>&5
1619
1620                 case $cf_attribute in #(vi
1621                 printf) #(vi
1622                         cf_printf_attribute=yes
1623                         cat >conftest.h <<EOF
1624 #define GCC_$cf_ATTRIBUTE 1
1625 EOF
1626                         ;;
1627                 scanf) #(vi
1628                         cf_scanf_attribute=yes
1629                         cat >conftest.h <<EOF
1630 #define GCC_$cf_ATTRIBUTE 1
1631 EOF
1632                         ;;
1633                 *) #(vi
1634                         cat >conftest.h <<EOF
1635 #define GCC_$cf_ATTRIBUTE $cf_directive
1636 EOF
1637                         ;;
1638                 esac
1639
1640                 if { (eval echo configure:1641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1641                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
1642                         cat conftest.h >>confdefs.h
1643                         case $cf_attribute in #(vi
1644                         printf) #(vi
1645                                 if test "$cf_printf_attribute" = no ; then
1646                                         cat >>confdefs.h <<EOF
1647 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
1648 EOF
1649                                 else
1650                                         cat >>confdefs.h <<EOF
1651 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
1652 EOF
1653                                 fi
1654                                 ;;
1655                         scanf) #(vi
1656                                 if test "$cf_scanf_attribute" = no ; then
1657                                         cat >>confdefs.h <<EOF
1658 #define GCC_SCANFLIKE(fmt,var) /* nothing */
1659 EOF
1660                                 else
1661                                         cat >>confdefs.h <<EOF
1662 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
1663 EOF
1664                                 fi
1665                                 ;;
1666                         esac
1667                 fi
1668         done
1669 else
1670         fgrep define conftest.i >>confdefs.h
1671 fi
1672 rm -rf conftest*
1673 fi
1674
1675
1676
1677 cf_XOPEN_SOURCE=500
1678 cf_POSIX_C_SOURCE=199506L
1679 cf_xopen_source=
1680
1681 case $host_os in #(vi
1682 aix[456]*) #(vi
1683         cf_xopen_source="-D_ALL_SOURCE"
1684         ;;
1685 darwin[0-8].*) #(vi
1686         cf_xopen_source="-D_APPLE_C_SOURCE"
1687         ;;
1688 darwin*) #(vi
1689         cf_xopen_source="-D_DARWIN_C_SOURCE"
1690         ;;
1691 freebsd*|dragonfly*) #(vi
1692         # 5.x headers associate
1693         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
1694         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
1695         cf_POSIX_C_SOURCE=200112L
1696         cf_XOPEN_SOURCE=600
1697         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1698         ;;
1699 hpux11*) #(vi
1700         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
1701         ;;
1702 hpux*) #(vi
1703         cf_xopen_source="-D_HPUX_SOURCE"
1704         ;;
1705 irix[56].*) #(vi
1706         cf_xopen_source="-D_SGI_SOURCE"
1707         ;;
1708 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
1709         
1710 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
1711 echo "configure:1712: checking if we must define _GNU_SOURCE" >&5
1712 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
1713   echo $ac_n "(cached) $ac_c" 1>&6
1714 else
1715   
1716 cat > conftest.$ac_ext <<EOF
1717 #line 1718 "configure"
1718 #include "confdefs.h"
1719 #include <sys/types.h>
1720 int main() {
1721
1722 #ifndef _XOPEN_SOURCE
1723 make an error
1724 #endif
1725 ; return 0; }
1726 EOF
1727 if { (eval echo configure:1728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1728   rm -rf conftest*
1729   cf_cv_gnu_source=no
1730 else
1731   echo "configure: failed program was:" >&5
1732   cat conftest.$ac_ext >&5
1733   rm -rf conftest*
1734   cf_save="$CPPFLAGS"
1735          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1736          cat > conftest.$ac_ext <<EOF
1737 #line 1738 "configure"
1738 #include "confdefs.h"
1739 #include <sys/types.h>
1740 int main() {
1741
1742 #ifdef _XOPEN_SOURCE
1743 make an error
1744 #endif
1745 ; return 0; }
1746 EOF
1747 if { (eval echo configure:1748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1748   rm -rf conftest*
1749   cf_cv_gnu_source=no
1750 else
1751   echo "configure: failed program was:" >&5
1752   cat conftest.$ac_ext >&5
1753   rm -rf conftest*
1754   cf_cv_gnu_source=yes
1755 fi
1756 rm -f conftest*
1757         CPPFLAGS="$cf_save"
1758         
1759 fi
1760 rm -f conftest*
1761
1762 fi
1763
1764 echo "$ac_t""$cf_cv_gnu_source" 1>&6
1765 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1766
1767         ;;
1768 mirbsd*) #(vi
1769         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
1770         ;;
1771 netbsd*) #(vi
1772         # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
1773         ;;
1774 openbsd*) #(vi
1775         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
1776         ;;
1777 osf[45]*) #(vi
1778         cf_xopen_source="-D_OSF_SOURCE"
1779         ;;
1780 nto-qnx*) #(vi
1781         cf_xopen_source="-D_QNX_SOURCE"
1782         ;;
1783 sco*) #(vi
1784         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
1785         ;;
1786 solaris2.1[0-9]) #(vi
1787         cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1788         ;;
1789 solaris2.[1-9]) #(vi
1790         cf_xopen_source="-D__EXTENSIONS__"
1791         ;;
1792 *)
1793         echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
1794 echo "configure:1795: checking if we should define _XOPEN_SOURCE" >&5
1795 if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
1796   echo $ac_n "(cached) $ac_c" 1>&6
1797 else
1798   
1799         cat > conftest.$ac_ext <<EOF
1800 #line 1801 "configure"
1801 #include "confdefs.h"
1802 #include <sys/types.h>
1803 int main() {
1804
1805 #ifndef _XOPEN_SOURCE
1806 make an error
1807 #endif
1808 ; return 0; }
1809 EOF
1810 if { (eval echo configure:1811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1811   rm -rf conftest*
1812   cf_cv_xopen_source=no
1813 else
1814   echo "configure: failed program was:" >&5
1815   cat conftest.$ac_ext >&5
1816   rm -rf conftest*
1817   cf_save="$CPPFLAGS"
1818          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
1819          cat > conftest.$ac_ext <<EOF
1820 #line 1821 "configure"
1821 #include "confdefs.h"
1822 #include <sys/types.h>
1823 int main() {
1824
1825 #ifdef _XOPEN_SOURCE
1826 make an error
1827 #endif
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   cf_cv_xopen_source=no
1833 else
1834   echo "configure: failed program was:" >&5
1835   cat conftest.$ac_ext >&5
1836   rm -rf conftest*
1837   cf_cv_xopen_source=$cf_XOPEN_SOURCE
1838 fi
1839 rm -f conftest*
1840         CPPFLAGS="$cf_save"
1841         
1842 fi
1843 rm -f conftest*
1844
1845 fi
1846
1847 echo "$ac_t""$cf_cv_xopen_source" 1>&6
1848         if test "$cf_cv_xopen_source" != no ; then
1849                 
1850 CFLAGS=`echo "$CFLAGS" | \
1851         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
1852                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
1853
1854                 
1855 CPPFLAGS=`echo "$CPPFLAGS" | \
1856         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
1857                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
1858
1859                 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
1860                 
1861 cf_fix_cppflags=no
1862 cf_new_cflags=
1863 cf_new_cppflags=
1864 cf_new_extra_cppflags=
1865
1866 for cf_add_cflags in $cf_temp_xopen_source
1867 do
1868 case $cf_fix_cppflags in
1869 no)
1870         case $cf_add_cflags in #(vi
1871         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
1872                 case $cf_add_cflags in
1873                 -D*)
1874                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1875
1876                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1877                                 && test -z "${cf_tst_cflags}" \
1878                                 && cf_fix_cppflags=yes
1879
1880                         if test $cf_fix_cppflags = yes ; then
1881                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1882                                 continue
1883                         elif test "${cf_tst_cflags}" = "\"'" ; then
1884                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1885                                 continue
1886                         fi
1887                         ;;
1888                 esac
1889                 case "$CPPFLAGS" in
1890                 *$cf_add_cflags) #(vi
1891                         ;;
1892                 *) #(vi
1893                         case $cf_add_cflags in #(vi
1894                         -D*)
1895                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1896                                 
1897 CPPFLAGS=`echo "$CPPFLAGS" | \
1898         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1899                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1900
1901                                 ;;
1902                         esac
1903                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1904                         ;;
1905                 esac
1906                 ;;
1907         *)
1908                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1909                 ;;
1910         esac
1911         ;;
1912 yes)
1913         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1914
1915         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1916
1917         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
1918                 && test -z "${cf_tst_cflags}" \
1919                 && cf_fix_cppflags=no
1920         ;;
1921 esac
1922 done
1923
1924 if test -n "$cf_new_cflags" ; then
1925         
1926         CFLAGS="$CFLAGS $cf_new_cflags"
1927 fi
1928
1929 if test -n "$cf_new_cppflags" ; then
1930         
1931         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1932 fi
1933
1934 if test -n "$cf_new_extra_cppflags" ; then
1935         
1936         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1937 fi
1938
1939
1940
1941
1942         fi
1943         
1944 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
1945
1946 cf_save_CFLAGS="$CFLAGS"
1947 cf_save_CPPFLAGS="$CPPFLAGS"
1948
1949
1950 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
1951         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
1952                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
1953
1954
1955 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
1956         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
1957                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
1958
1959
1960 echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
1961 echo "configure:1962: checking if we should define _POSIX_C_SOURCE" >&5
1962 if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
1963   echo $ac_n "(cached) $ac_c" 1>&6
1964 else
1965   
1966         
1967 echo "${as_me-configure}:1968: testing if the symbol is already defined go no further ..." 1>&5
1968
1969         cat > conftest.$ac_ext <<EOF
1970 #line 1971 "configure"
1971 #include "confdefs.h"
1972 #include <sys/types.h>
1973 int main() {
1974
1975 #ifndef _POSIX_C_SOURCE
1976 make an error
1977 #endif
1978 ; return 0; }
1979 EOF
1980 if { (eval echo configure:1981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1981   rm -rf conftest*
1982   cf_cv_posix_c_source=no
1983 else
1984   echo "configure: failed program was:" >&5
1985   cat conftest.$ac_ext >&5
1986   rm -rf conftest*
1987   cf_want_posix_source=no
1988          case .$cf_POSIX_C_SOURCE in #(vi
1989          .[12]??*) #(vi
1990                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
1991                 ;;
1992          .2) #(vi
1993                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
1994                 cf_want_posix_source=yes
1995                 ;;
1996          .*)
1997                 cf_want_posix_source=yes
1998                 ;;
1999          esac
2000          if test "$cf_want_posix_source" = yes ; then
2001                 cat > conftest.$ac_ext <<EOF
2002 #line 2003 "configure"
2003 #include "confdefs.h"
2004 #include <sys/types.h>
2005 int main() {
2006
2007 #ifdef _POSIX_SOURCE
2008 make an error
2009 #endif
2010 ; return 0; }
2011 EOF
2012 if { (eval echo configure:2013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2013   :
2014 else
2015   echo "configure: failed program was:" >&5
2016   cat conftest.$ac_ext >&5
2017   rm -rf conftest*
2018   cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
2019 fi
2020 rm -f conftest*
2021          fi
2022          
2023 echo "${as_me-configure}:2024: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
2024
2025          CFLAGS="$cf_trim_CFLAGS"
2026          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
2027          
2028 echo "${as_me-configure}:2029: testing if the second compile does not leave our definition intact error ..." 1>&5
2029
2030          cat > conftest.$ac_ext <<EOF
2031 #line 2032 "configure"
2032 #include "confdefs.h"
2033 #include <sys/types.h>
2034 int main() {
2035
2036 #ifndef _POSIX_C_SOURCE
2037 make an error
2038 #endif
2039 ; return 0; }
2040 EOF
2041 if { (eval echo configure:2042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2042   :
2043 else
2044   echo "configure: failed program was:" >&5
2045   cat conftest.$ac_ext >&5
2046   rm -rf conftest*
2047   cf_cv_posix_c_source=no
2048 fi
2049 rm -f conftest*
2050          CFLAGS="$cf_save_CFLAGS"
2051          CPPFLAGS="$cf_save_CPPFLAGS"
2052         
2053 fi
2054 rm -f conftest*
2055
2056 fi
2057
2058 echo "$ac_t""$cf_cv_posix_c_source" 1>&6
2059
2060 if test "$cf_cv_posix_c_source" != no ; then
2061         CFLAGS="$cf_trim_CFLAGS"
2062         CPPFLAGS="$cf_trim_CPPFLAGS"
2063         
2064 cf_fix_cppflags=no
2065 cf_new_cflags=
2066 cf_new_cppflags=
2067 cf_new_extra_cppflags=
2068
2069 for cf_add_cflags in $cf_cv_posix_c_source
2070 do
2071 case $cf_fix_cppflags in
2072 no)
2073         case $cf_add_cflags in #(vi
2074         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2075                 case $cf_add_cflags in
2076                 -D*)
2077                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2078
2079                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2080                                 && test -z "${cf_tst_cflags}" \
2081                                 && cf_fix_cppflags=yes
2082
2083                         if test $cf_fix_cppflags = yes ; then
2084                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2085                                 continue
2086                         elif test "${cf_tst_cflags}" = "\"'" ; then
2087                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2088                                 continue
2089                         fi
2090                         ;;
2091                 esac
2092                 case "$CPPFLAGS" in
2093                 *$cf_add_cflags) #(vi
2094                         ;;
2095                 *) #(vi
2096                         case $cf_add_cflags in #(vi
2097                         -D*)
2098                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2099                                 
2100 CPPFLAGS=`echo "$CPPFLAGS" | \
2101         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2102                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2103
2104                                 ;;
2105                         esac
2106                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2107                         ;;
2108                 esac
2109                 ;;
2110         *)
2111                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2112                 ;;
2113         esac
2114         ;;
2115 yes)
2116         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2117
2118         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2119
2120         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2121                 && test -z "${cf_tst_cflags}" \
2122                 && cf_fix_cppflags=no
2123         ;;
2124 esac
2125 done
2126
2127 if test -n "$cf_new_cflags" ; then
2128         
2129         CFLAGS="$CFLAGS $cf_new_cflags"
2130 fi
2131
2132 if test -n "$cf_new_cppflags" ; then
2133         
2134         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2135 fi
2136
2137 if test -n "$cf_new_extra_cppflags" ; then
2138         
2139         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2140 fi
2141
2142
2143
2144
2145 fi
2146
2147
2148         ;;
2149 esac
2150
2151 if test -n "$cf_xopen_source" ; then
2152         
2153 cf_fix_cppflags=no
2154 cf_new_cflags=
2155 cf_new_cppflags=
2156 cf_new_extra_cppflags=
2157
2158 for cf_add_cflags in $cf_xopen_source
2159 do
2160 case $cf_fix_cppflags in
2161 no)
2162         case $cf_add_cflags in #(vi
2163         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2164                 case $cf_add_cflags in
2165                 -D*)
2166                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2167
2168                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2169                                 && test -z "${cf_tst_cflags}" \
2170                                 && cf_fix_cppflags=yes
2171
2172                         if test $cf_fix_cppflags = yes ; then
2173                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2174                                 continue
2175                         elif test "${cf_tst_cflags}" = "\"'" ; then
2176                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2177                                 continue
2178                         fi
2179                         ;;
2180                 esac
2181                 case "$CPPFLAGS" in
2182                 *$cf_add_cflags) #(vi
2183                         ;;
2184                 *) #(vi
2185                         case $cf_add_cflags in #(vi
2186                         -D*)
2187                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2188                                 
2189 CPPFLAGS=`echo "$CPPFLAGS" | \
2190         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2191                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2192
2193                                 ;;
2194                         esac
2195                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2196                         ;;
2197                 esac
2198                 ;;
2199         *)
2200                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2201                 ;;
2202         esac
2203         ;;
2204 yes)
2205         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2206
2207         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2208
2209         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2210                 && test -z "${cf_tst_cflags}" \
2211                 && cf_fix_cppflags=no
2212         ;;
2213 esac
2214 done
2215
2216 if test -n "$cf_new_cflags" ; then
2217         
2218         CFLAGS="$CFLAGS $cf_new_cflags"
2219 fi
2220
2221 if test -n "$cf_new_cppflags" ; then
2222         
2223         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2224 fi
2225
2226 if test -n "$cf_new_extra_cppflags" ; then
2227         
2228         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2229 fi
2230
2231
2232
2233
2234 fi
2235
2236 echo $ac_n "checking for working const""... $ac_c" 1>&6
2237 echo "configure:2238: checking for working const" >&5
2238 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
2239   echo $ac_n "(cached) $ac_c" 1>&6
2240 else
2241   cat > conftest.$ac_ext <<EOF
2242 #line 2243 "configure"
2243 #include "confdefs.h"
2244
2245 int main() {
2246
2247 /* Ultrix mips cc rejects this.  */
2248 typedef int charset[2]; const charset x;
2249 /* SunOS 4.1.1 cc rejects this.  */
2250 char const *const *ccp;
2251 char **p;
2252 /* NEC SVR4.0.2 mips cc rejects this.  */
2253 struct point {int x, y;};
2254 static struct point const zero = {0,0};
2255 /* AIX XL C 1.02.0.0 rejects this.
2256    It does not let you subtract one const X* pointer from another in an arm
2257    of an if-expression whose if-part is not a constant expression */
2258 const char *g = "string";
2259 ccp = &g + (g ? g-g : 0);
2260 /* HPUX 7.0 cc rejects these. */
2261 ++ccp;
2262 p = (char**) ccp;
2263 ccp = (char const *const *) p;
2264 { /* SCO 3.2v4 cc rejects this.  */
2265   char *t;
2266   char const *s = 0 ? (char *) 0 : (char const *) 0;
2267
2268   *t++ = 0;
2269 }
2270 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
2271   int x[] = {25, 17};
2272   const int *foo = &x[0];
2273   ++foo;
2274 }
2275 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
2276   typedef const int *iptr;
2277   iptr p = 0;
2278   ++p;
2279 }
2280 { /* AIX XL C 1.02.0.0 rejects this saying
2281      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
2282   struct s { int j; const int *ap[3]; };
2283   struct s *b; b->j = 5;
2284 }
2285 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
2286   const int foo = 10;
2287 }
2288
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   ac_cv_c_const=yes
2294 else
2295   echo "configure: failed program was:" >&5
2296   cat conftest.$ac_ext >&5
2297   rm -rf conftest*
2298   ac_cv_c_const=no
2299 fi
2300 rm -f conftest*
2301 fi
2302
2303 echo "$ac_t""$ac_cv_c_const" 1>&6
2304 if test $ac_cv_c_const = no; then
2305   cat >> confdefs.h <<\EOF
2306 #define const 
2307 EOF
2308
2309 fi
2310
2311
2312 echo $ac_n "checking for signal global datatype""... $ac_c" 1>&6
2313 echo "configure:2314: checking for signal global datatype" >&5
2314 if eval "test \"`echo '$''{'cf_cv_sig_atomic_t'+set}'`\" = set"; then
2315   echo $ac_n "(cached) $ac_c" 1>&6
2316 else
2317   
2318         for cf_type in \
2319                 "volatile sig_atomic_t" \
2320                 "sig_atomic_t" \
2321                 "int"
2322         do
2323         cat > conftest.$ac_ext <<EOF
2324 #line 2325 "configure"
2325 #include "confdefs.h"
2326
2327 #include <sys/types.h>
2328 #include <signal.h>
2329 #include <stdio.h>
2330
2331 extern $cf_type x;
2332 $cf_type x;
2333 static void handler(int sig)
2334 {
2335         x = 5;
2336 }
2337 int main() {
2338 signal(SIGINT, handler);
2339                  x = 1
2340 ; return 0; }
2341 EOF
2342 if { (eval echo configure:2343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2343   rm -rf conftest*
2344   cf_cv_sig_atomic_t=$cf_type
2345 else
2346   echo "configure: failed program was:" >&5
2347   cat conftest.$ac_ext >&5
2348   rm -rf conftest*
2349   cf_cv_sig_atomic_t=no
2350 fi
2351 rm -f conftest*
2352                 test "$cf_cv_sig_atomic_t" != no && break
2353         done
2354         
2355 fi
2356
2357 echo "$ac_t""$cf_cv_sig_atomic_t" 1>&6
2358 test "$cf_cv_sig_atomic_t" != no && cat >> confdefs.h <<EOF
2359 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
2360 EOF
2361
2362
2363
2364
2365 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
2366 echo "configure:2367: checking if you want to see long compiling messages" >&5
2367
2368 # Check whether --enable-echo or --disable-echo was given.
2369 if test "${enable_echo+set}" = set; then
2370   enableval="$enable_echo"
2371   test "$enableval" != no && enableval=yes
2372   if test "$enableval" != "yes" ; then
2373     
2374     ECHO_LT='--silent'
2375     ECHO_LD='@echo linking $@;'
2376     RULE_CC='@echo compiling $<'
2377     SHOW_CC='@echo compiling $@'
2378     ECHO_CC='@'
2379  
2380   else
2381     
2382     ECHO_LT=''
2383     ECHO_LD=''
2384     RULE_CC=''
2385     SHOW_CC=''
2386     ECHO_CC=''
2387
2388   fi
2389 else
2390   enableval=yes 
2391   
2392     ECHO_LT=''
2393     ECHO_LD=''
2394     RULE_CC=''
2395     SHOW_CC=''
2396     ECHO_CC=''
2397
2398   
2399 fi
2400
2401 echo "$ac_t""$enableval" 1>&6
2402
2403
2404
2405
2406
2407
2408
2409
2410 GCC_VERSION=none
2411 if test "$GCC" = yes ; then
2412         echo $ac_n "checking version of $CC""... $ac_c" 1>&6
2413 echo "configure:2414: checking version of $CC" >&5
2414         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
2415         test -z "$GCC_VERSION" && GCC_VERSION=unknown
2416         echo "$ac_t""$GCC_VERSION" 1>&6
2417 fi
2418
2419
2420 if ( test "$GCC" = yes || test "$GXX" = yes )
2421 then
2422 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
2423 echo "configure:2424: checking if you want to turn on gcc warnings" >&5
2424
2425 # Check whether --enable-warnings or --disable-warnings was given.
2426 if test "${enable_warnings+set}" = set; then
2427   enableval="$enable_warnings"
2428   test "$enableval" != yes && enableval=no
2429   if test "$enableval" != "no" ; then
2430     with_warnings=yes 
2431   else
2432     with_warnings=no
2433   fi
2434 else
2435   enableval=no 
2436   with_warnings=no
2437   
2438 fi
2439
2440 echo "$ac_t""$with_warnings" 1>&6
2441 if test "$with_warnings" = "yes"
2442 then
2443         
2444 if test "$GCC" = yes
2445 then
2446 cat > conftest.i <<EOF
2447 #ifndef GCC_PRINTF
2448 #define GCC_PRINTF 0
2449 #endif
2450 #ifndef GCC_SCANF
2451 #define GCC_SCANF 0
2452 #endif
2453 #ifndef GCC_NORETURN
2454 #define GCC_NORETURN /* nothing */
2455 #endif
2456 #ifndef GCC_UNUSED
2457 #define GCC_UNUSED /* nothing */
2458 #endif
2459 EOF
2460 if test "$GCC" = yes
2461 then
2462         echo "checking for $CC __attribute__ directives" 1>&6
2463 echo "configure:2464: checking for $CC __attribute__ directives" >&5
2464 cat > conftest.$ac_ext <<EOF
2465 #line 2466 "${as_me-configure}"
2466 #include "confdefs.h"
2467 #include "conftest.h"
2468 #include "conftest.i"
2469 #if     GCC_PRINTF
2470 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2471 #else
2472 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2473 #endif
2474 #if     GCC_SCANF
2475 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2476 #else
2477 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2478 #endif
2479 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2480 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2481 extern void foo(void) GCC_NORETURN;
2482 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2483 EOF
2484         cf_printf_attribute=no
2485         cf_scanf_attribute=no
2486         for cf_attribute in scanf printf unused noreturn
2487         do
2488                 
2489 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2490
2491                 cf_directive="__attribute__(($cf_attribute))"
2492                 echo "checking for $CC $cf_directive" 1>&5
2493
2494                 case $cf_attribute in #(vi
2495                 printf) #(vi
2496                         cf_printf_attribute=yes
2497                         cat >conftest.h <<EOF
2498 #define GCC_$cf_ATTRIBUTE 1
2499 EOF
2500                         ;;
2501                 scanf) #(vi
2502                         cf_scanf_attribute=yes
2503                         cat >conftest.h <<EOF
2504 #define GCC_$cf_ATTRIBUTE 1
2505 EOF
2506                         ;;
2507                 *) #(vi
2508                         cat >conftest.h <<EOF
2509 #define GCC_$cf_ATTRIBUTE $cf_directive
2510 EOF
2511                         ;;
2512                 esac
2513
2514                 if { (eval echo configure:2515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2515                         test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
2516                         cat conftest.h >>confdefs.h
2517                         case $cf_attribute in #(vi
2518                         printf) #(vi
2519                                 if test "$cf_printf_attribute" = no ; then
2520                                         cat >>confdefs.h <<EOF
2521 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
2522 EOF
2523                                 else
2524                                         cat >>confdefs.h <<EOF
2525 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2526 EOF
2527                                 fi
2528                                 ;;
2529                         scanf) #(vi
2530                                 if test "$cf_scanf_attribute" = no ; then
2531                                         cat >>confdefs.h <<EOF
2532 #define GCC_SCANFLIKE(fmt,var) /* nothing */
2533 EOF
2534                                 else
2535                                         cat >>confdefs.h <<EOF
2536 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2537 EOF
2538                                 fi
2539                                 ;;
2540                         esac
2541                 fi
2542         done
2543 else
2544         fgrep define conftest.i >>confdefs.h
2545 fi
2546 rm -rf conftest*
2547 fi
2548
2549         
2550
2551
2552 INTEL_COMPILER=no
2553
2554 if test "$GCC" = yes ; then
2555         case $host_os in
2556         linux*|gnu*)
2557                 echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
2558 echo "configure:2559: checking if this is really Intel C compiler" >&5
2559                 cf_save_CFLAGS="$CFLAGS"
2560                 CFLAGS="$CFLAGS -no-gcc"
2561                 cat > conftest.$ac_ext <<EOF
2562 #line 2563 "configure"
2563 #include "confdefs.h"
2564
2565 int main() {
2566
2567 #ifdef __INTEL_COMPILER
2568 #else
2569 make an error
2570 #endif
2571
2572 ; return 0; }
2573 EOF
2574 if { (eval echo configure:2575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2575   rm -rf conftest*
2576   INTEL_COMPILER=yes
2577 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
2578
2579 else
2580   echo "configure: failed program was:" >&5
2581   cat conftest.$ac_ext >&5
2582 fi
2583 rm -f conftest*
2584                 CFLAGS="$cf_save_CFLAGS"
2585                 echo "$ac_t""$INTEL_COMPILER" 1>&6
2586                 ;;
2587         esac
2588 fi
2589
2590
2591 cat > conftest.$ac_ext <<EOF
2592 #line 2593 "${as_me-configure}"
2593 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
2594 EOF
2595
2596 if test "$INTEL_COMPILER" = yes
2597 then
2598 # The "-wdXXX" options suppress warnings:
2599 # remark #1419: external declaration in primary source file
2600 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
2601 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
2602 # remark #193: zero used for undefined preprocessing identifier
2603 # remark #593: variable "curs_sb_left_arrow" was set but never used
2604 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
2605 # remark #869: parameter "tw" was never referenced
2606 # remark #981: operands are evaluated in unspecified order
2607 # warning #279: controlling expression is constant
2608
2609         echo "checking for $CC warning options" 1>&6
2610 echo "configure:2611: checking for $CC warning options" >&5
2611         cf_save_CFLAGS="$CFLAGS"
2612         EXTRA_CFLAGS="-Wall"
2613         for cf_opt in \
2614                 wd1419 \
2615                 wd1683 \
2616                 wd1684 \
2617                 wd193 \
2618                 wd593 \
2619                 wd279 \
2620                 wd810 \
2621                 wd869 \
2622                 wd981
2623         do
2624                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2625                 if { (eval echo configure:2626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2626                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
2627                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2628                 fi
2629         done
2630         CFLAGS="$cf_save_CFLAGS"
2631
2632 elif test "$GCC" = yes
2633 then
2634         echo "checking for $CC warning options" 1>&6
2635 echo "configure:2636: checking for $CC warning options" >&5
2636         cf_save_CFLAGS="$CFLAGS"
2637         EXTRA_CFLAGS=
2638         cf_warn_CONST=""
2639         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
2640         for cf_opt in W Wall \
2641                 Wbad-function-cast \
2642                 Wcast-align \
2643                 Wcast-qual \
2644                 Winline \
2645                 Wmissing-declarations \
2646                 Wmissing-prototypes \
2647                 Wnested-externs \
2648                 Wpointer-arith \
2649                 Wshadow \
2650                 Wstrict-prototypes \
2651                 Wundef $cf_warn_CONST 
2652         do
2653                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2654                 if { (eval echo configure:2655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2655                         test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
2656                         case $cf_opt in #(vi
2657                         Wcast-qual) #(vi
2658                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
2659                                 ;;
2660                         Winline) #(vi
2661                                 case $GCC_VERSION in
2662                                 [34].*)
2663                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
2664
2665 echo "${as_me-configure}:2666: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
2666
2667
2668                                         continue;;
2669                                 esac
2670                                 ;;
2671                         esac
2672                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2673                 fi
2674         done
2675         CFLAGS="$cf_save_CFLAGS"
2676 fi
2677 rm -f conftest*
2678
2679
2680
2681 fi
2682 fi
2683
2684
2685
2686
2687 # Check whether --with-curses-dir or --without-curses-dir was given.
2688 if test "${with_curses_dir+set}" = set; then
2689   withval="$with_curses_dir"
2690   
2691 if test "x$prefix" != xNONE; then
2692   cf_path_syntax="$prefix"
2693 else
2694   cf_path_syntax="$ac_default_prefix"
2695 fi
2696
2697 case ".$withval" in #(vi
2698 .\$\(*\)*|.\'*\'*) #(vi
2699   ;;
2700 ..|./*|.\\*) #(vi
2701   ;;
2702 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
2703   ;;
2704 .\${*prefix}*) #(vi
2705   eval withval="$withval"
2706   case ".$withval" in #(vi
2707   .NONE/*)
2708     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2709     ;;
2710   esac
2711   ;; #(vi
2712 .no|.NONE/*)
2713   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
2714   ;;
2715 *)
2716   { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
2717   ;;
2718 esac
2719
2720          cf_cv_curses_dir=$withval
2721 else
2722   cf_cv_curses_dir=no
2723 fi
2724
2725
2726
2727
2728 # Check whether --with-5lib or --without-5lib was given.
2729 if test "${with_5lib+set}" = set; then
2730   withval="$with_5lib"
2731   LIBS="-L/usr/5lib $LIBS"
2732          CPPFLAGS="$CPPFLAGS -I/usr/5include"
2733 fi
2734
2735
2736
2737 # Check whether --with-ncursesw or --without-ncursesw was given.
2738 if test "${with_ncursesw+set}" = set; then
2739   withval="$with_ncursesw"
2740   cf_cv_screen=ncursesw
2741 else
2742   
2743
2744
2745 # Check whether --with-ncurses or --without-ncurses was given.
2746 if test "${with_ncurses+set}" = set; then
2747   withval="$with_ncurses"
2748   cf_cv_screen=ncurses
2749 else
2750   
2751
2752
2753 # Check whether --with-pdcurses or --without-pdcurses was given.
2754 if test "${with_pdcurses+set}" = set; then
2755   withval="$with_pdcurses"
2756   cf_cv_screen=pdcurses
2757 fi
2758
2759 fi
2760
2761 fi
2762
2763
2764 case $cf_cv_screen in
2765 curses)
2766         
2767
2768
2769 echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
2770 echo "configure:2771: checking for extra include directories" >&5
2771 if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
2772   echo $ac_n "(cached) $ac_c" 1>&6
2773 else
2774   
2775 cf_cv_curses_incdir=no
2776 case $host_os in #(vi
2777 hpux10.*) #(vi
2778         test -d /usr/include/curses_colr && \
2779         cf_cv_curses_incdir="-I/usr/include/curses_colr"
2780         ;;
2781 sunos3*|sunos4*)
2782         test -d /usr/5lib && \
2783         test -d /usr/5include && \
2784         cf_cv_curses_incdir="-I/usr/5include"
2785         ;;
2786 esac
2787
2788 fi
2789
2790 echo "$ac_t""$cf_cv_curses_incdir" 1>&6
2791 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
2792
2793
2794 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
2795 echo "configure:2796: checking if we have identified curses headers" >&5
2796 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
2797   echo $ac_n "(cached) $ac_c" 1>&6
2798 else
2799   
2800 cf_cv_ncurses_header=none
2801 for cf_header in  \
2802         curses.h \
2803         ncurses.h ncurses/curses.h ncurses/ncurses.h
2804 do
2805 cat > conftest.$ac_ext <<EOF
2806 #line 2807 "configure"
2807 #include "confdefs.h"
2808 #include <${cf_header}>
2809 int main() {
2810 initscr(); tgoto("?", 0,0)
2811 ; return 0; }
2812 EOF
2813 if { (eval echo configure:2814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2814   rm -rf conftest*
2815   cf_cv_ncurses_header=$cf_header; break
2816 else
2817   echo "configure: failed program was:" >&5
2818   cat conftest.$ac_ext >&5
2819 fi
2820 rm -f conftest*
2821 done
2822
2823 fi
2824
2825 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
2826
2827 if test "$cf_cv_ncurses_header" = none ; then
2828         { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
2829 fi
2830
2831 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
2832 for ac_hdr in $cf_cv_ncurses_header
2833 do
2834 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2835 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2836 echo "configure:2837: checking for $ac_hdr" >&5
2837 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2838   echo $ac_n "(cached) $ac_c" 1>&6
2839 else
2840   cat > conftest.$ac_ext <<EOF
2841 #line 2842 "configure"
2842 #include "confdefs.h"
2843 #include <$ac_hdr>
2844 EOF
2845 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2846 { (eval echo configure:2847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2847 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2848 if test -z "$ac_err"; then
2849   rm -rf conftest*
2850   eval "ac_cv_header_$ac_safe=yes"
2851 else
2852   echo "$ac_err" >&5
2853   echo "configure: failed program was:" >&5
2854   cat conftest.$ac_ext >&5
2855   rm -rf conftest*
2856   eval "ac_cv_header_$ac_safe=no"
2857 fi
2858 rm -f conftest*
2859 fi
2860 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2861   echo "$ac_t""yes" 1>&6
2862     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2863   cat >> confdefs.h <<EOF
2864 #define $ac_tr_hdr 1
2865 EOF
2866  
2867 else
2868   echo "$ac_t""no" 1>&6
2869 fi
2870 done
2871
2872
2873
2874 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
2875 echo "configure:2876: checking for terminfo header" >&5
2876 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
2877   echo $ac_n "(cached) $ac_c" 1>&6
2878 else
2879   
2880 case ${cf_cv_ncurses_header} in #(vi
2881 */ncurses.h|*/ncursesw.h) #(vi
2882         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
2883         ;;
2884 *)
2885         cf_term_header=term.h
2886         ;;
2887 esac
2888
2889 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
2890 do
2891 cat > conftest.$ac_ext <<EOF
2892 #line 2893 "configure"
2893 #include "confdefs.h"
2894 #include <stdio.h>
2895 #include <${cf_cv_ncurses_header-curses.h}>
2896 #include <$cf_test>
2897
2898 int main() {
2899 int x = auto_left_margin
2900 ; return 0; }
2901 EOF
2902 if { (eval echo configure:2903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2903   rm -rf conftest*
2904   
2905         cf_cv_term_header="$cf_test"
2906 else
2907   echo "configure: failed program was:" >&5
2908   cat conftest.$ac_ext >&5
2909   rm -rf conftest*
2910   
2911         cf_cv_term_header=unknown
2912         
2913 fi
2914 rm -f conftest*
2915         test "$cf_cv_term_header" != unknown && break
2916 done
2917
2918 fi
2919
2920 echo "$ac_t""$cf_cv_term_header" 1>&6
2921
2922 # Set definitions to allow ifdef'ing to accommodate subdirectories
2923
2924 case $cf_cv_term_header in # (vi
2925 *term.h)
2926         cat >> confdefs.h <<\EOF
2927 #define HAVE_TERM_H 1
2928 EOF
2929
2930         ;;
2931 esac
2932
2933 case $cf_cv_term_header in # (vi
2934 ncurses/term.h) #(vi
2935         cat >> confdefs.h <<\EOF
2936 #define HAVE_NCURSES_TERM_H 1
2937 EOF
2938
2939         ;;
2940 ncursesw/term.h)
2941         cat >> confdefs.h <<\EOF
2942 #define HAVE_NCURSESW_TERM_H 1
2943 EOF
2944
2945         ;;
2946 esac
2947
2948
2949
2950 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
2951 echo "configure:2952: checking for ncurses version" >&5
2952 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
2953   echo $ac_n "(cached) $ac_c" 1>&6
2954 else
2955   
2956         cf_cv_ncurses_version=no
2957         cf_tempfile=out$$
2958         rm -f $cf_tempfile
2959         if test "$cross_compiling" = yes; then
2960   
2961
2962         # This will not work if the preprocessor splits the line after the
2963         # Autoconf token.  The 'unproto' program does that.
2964         cat > conftest.$ac_ext <<EOF
2965 #include <${cf_cv_ncurses_header-curses.h}>
2966 #undef Autoconf
2967 #ifdef NCURSES_VERSION
2968 Autoconf NCURSES_VERSION
2969 #else
2970 #ifdef __NCURSES_H
2971 Autoconf "old"
2972 #endif
2973 ;
2974 #endif
2975 EOF
2976         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
2977         { (eval echo configure:2978: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
2978         if test -f conftest.out ; then
2979                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
2980                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
2981                 rm -f conftest.out
2982         fi
2983
2984 else
2985   cat > conftest.$ac_ext <<EOF
2986 #line 2987 "configure"
2987 #include "confdefs.h"
2988
2989 #include <${cf_cv_ncurses_header-curses.h}>
2990 #include <stdio.h>
2991 int main()
2992 {
2993         FILE *fp = fopen("$cf_tempfile", "w");
2994 #ifdef NCURSES_VERSION
2995 # ifdef NCURSES_VERSION_PATCH
2996         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
2997 # else
2998         fprintf(fp, "%s\n", NCURSES_VERSION);
2999 # endif
3000 #else
3001 # ifdef __NCURSES_H
3002         fprintf(fp, "old\n");
3003 # else
3004         make an error
3005 # endif
3006 #endif
3007         ${cf_cv_main_return-return}(0);
3008 }
3009 EOF
3010 if { (eval echo configure:3011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3011 then
3012   
3013         cf_cv_ncurses_version=`cat $cf_tempfile`
3014 else
3015   echo "configure: failed program was:" >&5
3016   cat conftest.$ac_ext >&5
3017 fi
3018 rm -fr conftest*
3019 fi
3020
3021         rm -f $cf_tempfile
3022
3023 fi
3024
3025 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
3026 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
3027 #define NCURSES 1
3028 EOF
3029
3030
3031
3032
3033 echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
3034 echo "configure:3035: checking if we have identified curses libraries" >&5
3035 cat > conftest.$ac_ext <<EOF
3036 #line 3037 "configure"
3037 #include "confdefs.h"
3038 #include <${cf_cv_ncurses_header-curses.h}>
3039 int main() {
3040 initscr(); tgoto("?", 0,0)
3041 ; return 0; }
3042 EOF
3043 if { (eval echo configure:3044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3044   rm -rf conftest*
3045   cf_result=yes
3046 else
3047   echo "configure: failed program was:" >&5
3048   cat conftest.$ac_ext >&5
3049   rm -rf conftest*
3050   cf_result=no
3051 fi
3052 rm -f conftest*
3053 echo "$ac_t""$cf_result" 1>&6
3054
3055 if test "$cf_result" = no ; then
3056 case $host_os in #(vi
3057 freebsd*) #(vi
3058     echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
3059 echo "configure:3060: checking for tgoto in -lmytinfo" >&5
3060 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
3061 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3062   echo $ac_n "(cached) $ac_c" 1>&6
3063 else
3064   ac_save_LIBS="$LIBS"
3065 LIBS="-lmytinfo  $LIBS"
3066 cat > conftest.$ac_ext <<EOF
3067 #line 3068 "configure"
3068 #include "confdefs.h"
3069 /* Override any gcc2 internal prototype to avoid an error.  */
3070 /* We use char because int might match the return type of a gcc2
3071     builtin and then its argument prototype would still apply.  */
3072 char tgoto();
3073
3074 int main() {
3075 tgoto()
3076 ; return 0; }
3077 EOF
3078 if { (eval echo configure:3079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3079   rm -rf conftest*
3080   eval "ac_cv_lib_$ac_lib_var=yes"
3081 else
3082   echo "configure: failed program was:" >&5
3083   cat conftest.$ac_ext >&5
3084   rm -rf conftest*
3085   eval "ac_cv_lib_$ac_lib_var=no"
3086 fi
3087 rm -f conftest*
3088 LIBS="$ac_save_LIBS"
3089
3090 fi
3091 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3092   echo "$ac_t""yes" 1>&6
3093   LIBS="-lmytinfo $LIBS"
3094 else
3095   echo "$ac_t""no" 1>&6
3096 fi
3097
3098     ;;
3099 hpux10.*) #(vi
3100     echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
3101 echo "configure:3102: checking for initscr in -lcur_colr" >&5
3102 ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
3103 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3104   echo $ac_n "(cached) $ac_c" 1>&6
3105 else
3106   ac_save_LIBS="$LIBS"
3107 LIBS="-lcur_colr  $LIBS"
3108 cat > conftest.$ac_ext <<EOF
3109 #line 3110 "configure"
3110 #include "confdefs.h"
3111 /* Override any gcc2 internal prototype to avoid an error.  */
3112 /* We use char because int might match the return type of a gcc2
3113     builtin and then its argument prototype would still apply.  */
3114 char initscr();
3115
3116 int main() {
3117 initscr()
3118 ; return 0; }
3119 EOF
3120 if { (eval echo configure:3121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3121   rm -rf conftest*
3122   eval "ac_cv_lib_$ac_lib_var=yes"
3123 else
3124   echo "configure: failed program was:" >&5
3125   cat conftest.$ac_ext >&5
3126   rm -rf conftest*
3127   eval "ac_cv_lib_$ac_lib_var=no"
3128 fi
3129 rm -f conftest*
3130 LIBS="$ac_save_LIBS"
3131
3132 fi
3133 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3134   echo "$ac_t""yes" 1>&6
3135   
3136         LIBS="-lcur_colr $LIBS"
3137         ac_cv_func_initscr=yes
3138         
3139 else
3140   echo "$ac_t""no" 1>&6
3141
3142     echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
3143 echo "configure:3144: checking for initscr in -lHcurses" >&5
3144 ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
3145 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3146   echo $ac_n "(cached) $ac_c" 1>&6
3147 else
3148   ac_save_LIBS="$LIBS"
3149 LIBS="-lHcurses  $LIBS"
3150 cat > conftest.$ac_ext <<EOF
3151 #line 3152 "configure"
3152 #include "confdefs.h"
3153 /* Override any gcc2 internal prototype to avoid an error.  */
3154 /* We use char because int might match the return type of a gcc2
3155     builtin and then its argument prototype would still apply.  */
3156 char initscr();
3157
3158 int main() {
3159 initscr()
3160 ; return 0; }
3161 EOF
3162 if { (eval echo configure:3163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3163   rm -rf conftest*
3164   eval "ac_cv_lib_$ac_lib_var=yes"
3165 else
3166   echo "configure: failed program was:" >&5
3167   cat conftest.$ac_ext >&5
3168   rm -rf conftest*
3169   eval "ac_cv_lib_$ac_lib_var=no"
3170 fi
3171 rm -f conftest*
3172 LIBS="$ac_save_LIBS"
3173
3174 fi
3175 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3176   echo "$ac_t""yes" 1>&6
3177   
3178         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
3179         LIBS="-lHcurses $LIBS"
3180         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
3181         ac_cv_func_initscr=yes
3182         
3183 else
3184   echo "$ac_t""no" 1>&6
3185 fi
3186
3187 fi
3188
3189     ;;
3190 linux*) # Suse Linux does not follow /usr/lib convention
3191     
3192 if test -n "/lib" ; then
3193   for cf_add_libdir in /lib
3194   do
3195     if test $cf_add_libdir = /usr/lib ; then
3196       :
3197     elif test -d $cf_add_libdir
3198     then
3199       cf_have_libdir=no
3200       if test -n "$LDFLAGS$LIBS" ; then
3201         # a loop is needed to ensure we can add subdirs of existing dirs
3202         for cf_test_libdir in $LDFLAGS $LIBS ; do
3203           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3204             cf_have_libdir=yes; break
3205           fi
3206         done
3207       fi
3208       if test "$cf_have_libdir" = no ; then
3209         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3210
3211 echo "${as_me-configure}:3212: testing adding $cf_add_libdir to library-path ..." 1>&5
3212
3213
3214         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3215       fi
3216     fi
3217   done
3218 fi
3219
3220     ;;
3221 sunos3*|sunos4*)
3222     if test -d /usr/5lib ; then
3223       
3224 if test -n "/usr/5lib" ; then
3225   for cf_add_libdir in /usr/5lib
3226   do
3227     if test $cf_add_libdir = /usr/lib ; then
3228       :
3229     elif test -d $cf_add_libdir
3230     then
3231       cf_have_libdir=no
3232       if test -n "$LDFLAGS$LIBS" ; then
3233         # a loop is needed to ensure we can add subdirs of existing dirs
3234         for cf_test_libdir in $LDFLAGS $LIBS ; do
3235           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3236             cf_have_libdir=yes; break
3237           fi
3238         done
3239       fi
3240       if test "$cf_have_libdir" = no ; then
3241         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3242
3243 echo "${as_me-configure}:3244: testing adding $cf_add_libdir to library-path ..." 1>&5
3244
3245
3246         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3247       fi
3248     fi
3249   done
3250 fi
3251
3252       LIBS="$LIBS -lcurses -ltermcap"
3253     fi
3254     ac_cv_func_initscr=yes
3255     ;;
3256 esac
3257
3258 if test ".$ac_cv_func_initscr" != .yes ; then
3259     cf_save_LIBS="$LIBS"
3260     cf_term_lib=""
3261     cf_curs_lib=""
3262
3263     if test ".${cf_cv_ncurses_version-no}" != .no
3264     then
3265         cf_check_list="ncurses curses cursesX"
3266     else
3267         cf_check_list="cursesX curses ncurses"
3268     fi
3269
3270     # Check for library containing tgoto.  Do this before curses library
3271     # because it may be needed to link the test-case for initscr.
3272     echo $ac_n "checking for tgoto""... $ac_c" 1>&6
3273 echo "configure:3274: checking for tgoto" >&5
3274 if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
3275   echo $ac_n "(cached) $ac_c" 1>&6
3276 else
3277   cat > conftest.$ac_ext <<EOF
3278 #line 3279 "configure"
3279 #include "confdefs.h"
3280 /* System header to define __stub macros and hopefully few prototypes,
3281     which can conflict with char tgoto(); below.  */
3282 #include <assert.h>
3283 /* Override any gcc2 internal prototype to avoid an error.  */
3284 /* We use char because int might match the return type of a gcc2
3285     builtin and then its argument prototype would still apply.  */
3286 char tgoto();
3287
3288 int main() {
3289
3290 /* The GNU C library defines this for functions which it implements
3291     to always fail with ENOSYS.  Some functions are actually named
3292     something starting with __ and the normal name is an alias.  */
3293 #if defined (__stub_tgoto) || defined (__stub___tgoto)
3294 choke me
3295 #else
3296 tgoto();
3297 #endif
3298
3299 ; return 0; }
3300 EOF
3301 if { (eval echo configure:3302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3302   rm -rf conftest*
3303   eval "ac_cv_func_tgoto=yes"
3304 else
3305   echo "configure: failed program was:" >&5
3306   cat conftest.$ac_ext >&5
3307   rm -rf conftest*
3308   eval "ac_cv_func_tgoto=no"
3309 fi
3310 rm -f conftest*
3311 fi
3312
3313 if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
3314   echo "$ac_t""yes" 1>&6
3315   cf_term_lib=predefined
3316 else
3317   echo "$ac_t""no" 1>&6
3318
3319         for cf_term_lib in $cf_check_list termcap termlib unknown
3320         do
3321             echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
3322 echo "configure:3323: checking for tgoto in -l$cf_term_lib" >&5
3323 ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
3324 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3325   echo $ac_n "(cached) $ac_c" 1>&6
3326 else
3327   ac_save_LIBS="$LIBS"
3328 LIBS="-l$cf_term_lib  $LIBS"
3329 cat > conftest.$ac_ext <<EOF
3330 #line 3331 "configure"
3331 #include "confdefs.h"
3332 /* Override any gcc2 internal prototype to avoid an error.  */
3333 /* We use char because int might match the return type of a gcc2
3334     builtin and then its argument prototype would still apply.  */
3335 char tgoto();
3336
3337 int main() {
3338 tgoto()
3339 ; return 0; }
3340 EOF
3341 if { (eval echo configure:3342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3342   rm -rf conftest*
3343   eval "ac_cv_lib_$ac_lib_var=yes"
3344 else
3345   echo "configure: failed program was:" >&5
3346   cat conftest.$ac_ext >&5
3347   rm -rf conftest*
3348   eval "ac_cv_lib_$ac_lib_var=no"
3349 fi
3350 rm -f conftest*
3351 LIBS="$ac_save_LIBS"
3352
3353 fi
3354 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3355   echo "$ac_t""yes" 1>&6
3356   break
3357 else
3358   echo "$ac_t""no" 1>&6
3359 fi
3360
3361         done
3362     
3363 fi
3364
3365
3366     # Check for library containing initscr
3367     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
3368         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
3369     do
3370         echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
3371 echo "configure:3372: checking for initscr in -l$cf_curs_lib" >&5
3372 ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
3373 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3374   echo $ac_n "(cached) $ac_c" 1>&6
3375 else
3376   ac_save_LIBS="$LIBS"
3377 LIBS="-l$cf_curs_lib  $LIBS"
3378 cat > conftest.$ac_ext <<EOF
3379 #line 3380 "configure"
3380 #include "confdefs.h"
3381 /* Override any gcc2 internal prototype to avoid an error.  */
3382 /* We use char because int might match the return type of a gcc2
3383     builtin and then its argument prototype would still apply.  */
3384 char initscr();
3385
3386 int main() {
3387 initscr()
3388 ; return 0; }
3389 EOF
3390 if { (eval echo configure:3391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3391   rm -rf conftest*
3392   eval "ac_cv_lib_$ac_lib_var=yes"
3393 else
3394   echo "configure: failed program was:" >&5
3395   cat conftest.$ac_ext >&5
3396   rm -rf conftest*
3397   eval "ac_cv_lib_$ac_lib_var=no"
3398 fi
3399 rm -f conftest*
3400 LIBS="$ac_save_LIBS"
3401
3402 fi
3403 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3404   echo "$ac_t""yes" 1>&6
3405   break
3406 else
3407   echo "$ac_t""no" 1>&6
3408 fi
3409
3410     done
3411     test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
3412
3413     LIBS="-l$cf_curs_lib $cf_save_LIBS"
3414     if test "$cf_term_lib" = unknown ; then
3415         echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
3416 echo "configure:3417: checking if we can link with $cf_curs_lib library" >&5
3417         cat > conftest.$ac_ext <<EOF
3418 #line 3419 "configure"
3419 #include "confdefs.h"
3420 #include <${cf_cv_ncurses_header-curses.h}>
3421 int main() {
3422 initscr()
3423 ; return 0; }
3424 EOF
3425 if { (eval echo configure:3426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3426   rm -rf conftest*
3427   cf_result=yes
3428 else
3429   echo "configure: failed program was:" >&5
3430   cat conftest.$ac_ext >&5
3431   rm -rf conftest*
3432   cf_result=no
3433 fi
3434 rm -f conftest*
3435         echo "$ac_t""$cf_result" 1>&6
3436         test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
3437     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
3438         :
3439     elif test "$cf_term_lib" != predefined ; then
3440         echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
3441 echo "configure:3442: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
3442         cat > conftest.$ac_ext <<EOF
3443 #line 3444 "configure"
3444 #include "confdefs.h"
3445 #include <${cf_cv_ncurses_header-curses.h}>
3446 int main() {
3447 initscr(); tgoto((char *)0, 0, 0);
3448 ; return 0; }
3449 EOF
3450 if { (eval echo configure:3451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3451   rm -rf conftest*
3452   cf_result=no
3453 else
3454   echo "configure: failed program was:" >&5
3455   cat conftest.$ac_ext >&5
3456   rm -rf conftest*
3457   
3458             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
3459             cat > conftest.$ac_ext <<EOF
3460 #line 3461 "configure"
3461 #include "confdefs.h"
3462 #include <${cf_cv_ncurses_header-curses.h}>
3463 int main() {
3464 initscr()
3465 ; return 0; }
3466 EOF
3467 if { (eval echo configure:3468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3468   rm -rf conftest*
3469   cf_result=yes
3470 else
3471   echo "configure: failed program was:" >&5
3472   cat conftest.$ac_ext >&5
3473   rm -rf conftest*
3474   cf_result=error
3475 fi
3476 rm -f conftest*
3477             
3478 fi
3479 rm -f conftest*
3480         echo "$ac_t""$cf_result" 1>&6
3481     fi
3482 fi
3483 fi
3484
3485
3486
3487         ;;
3488 ncurses)
3489         
3490 cf_ncuconfig_root=ncurses
3491
3492 echo "Looking for ${cf_ncuconfig_root}-config"
3493 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3494 do
3495 # Extract the first word of "$ac_prog", so it can be a program name with args.
3496 set dummy $ac_prog; ac_word=$2
3497 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3498 echo "configure:3499: checking for $ac_word" >&5
3499 if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
3500   echo $ac_n "(cached) $ac_c" 1>&6
3501 else
3502   case "$NCURSES_CONFIG" in
3503   /*)
3504   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
3505   ;;
3506   ?:/*)                  
3507   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a dos path.
3508   ;;
3509   *)
3510   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3511   ac_dummy="$PATH"
3512   for ac_dir in $ac_dummy; do 
3513     test -z "$ac_dir" && ac_dir=.
3514     if test -f $ac_dir/$ac_word; then
3515       ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
3516       break
3517     fi
3518   done
3519   IFS="$ac_save_ifs"
3520   ;;
3521 esac
3522 fi
3523 NCURSES_CONFIG="$ac_cv_path_NCURSES_CONFIG"
3524 if test -n "$NCURSES_CONFIG"; then
3525   echo "$ac_t""$NCURSES_CONFIG" 1>&6
3526 else
3527   echo "$ac_t""no" 1>&6
3528 fi
3529
3530 test -n "$NCURSES_CONFIG" && break
3531 done
3532 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
3533
3534
3535 if test "$NCURSES_CONFIG" != none ; then
3536
3537 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
3538 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
3539
3540 # even with config script, some packages use no-override for curses.h
3541
3542 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
3543 echo "configure:3544: checking if we have identified curses headers" >&5
3544 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
3545   echo $ac_n "(cached) $ac_c" 1>&6
3546 else
3547   
3548 cf_cv_ncurses_header=none
3549 for cf_header in  \
3550     ncurses/curses.h \
3551         ncurses/ncurses.h \
3552         curses.h \
3553         ncurses.h 
3554 do
3555 cat > conftest.$ac_ext <<EOF
3556 #line 3557 "configure"
3557 #include "confdefs.h"
3558 #include <${cf_header}>
3559 int main() {
3560 initscr(); tgoto("?", 0,0)
3561 ; return 0; }
3562 EOF
3563 if { (eval echo configure:3564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3564   rm -rf conftest*
3565   cf_cv_ncurses_header=$cf_header; break
3566 else
3567   echo "configure: failed program was:" >&5
3568   cat conftest.$ac_ext >&5
3569 fi
3570 rm -f conftest*
3571 done
3572
3573 fi
3574
3575 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
3576
3577 if test "$cf_cv_ncurses_header" = none ; then
3578         { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
3579 fi
3580
3581 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
3582 for ac_hdr in $cf_cv_ncurses_header
3583 do
3584 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3585 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3586 echo "configure:3587: checking for $ac_hdr" >&5
3587 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3588   echo $ac_n "(cached) $ac_c" 1>&6
3589 else
3590   cat > conftest.$ac_ext <<EOF
3591 #line 3592 "configure"
3592 #include "confdefs.h"
3593 #include <$ac_hdr>
3594 EOF
3595 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3596 { (eval echo configure:3597: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3597 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3598 if test -z "$ac_err"; then
3599   rm -rf conftest*
3600   eval "ac_cv_header_$ac_safe=yes"
3601 else
3602   echo "$ac_err" >&5
3603   echo "configure: failed program was:" >&5
3604   cat conftest.$ac_ext >&5
3605   rm -rf conftest*
3606   eval "ac_cv_header_$ac_safe=no"
3607 fi
3608 rm -f conftest*
3609 fi
3610 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3611   echo "$ac_t""yes" 1>&6
3612     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3613   cat >> confdefs.h <<EOF
3614 #define $ac_tr_hdr 1
3615 EOF
3616  
3617 else
3618   echo "$ac_t""no" 1>&6
3619 fi
3620 done
3621
3622
3623
3624 cat >> confdefs.h <<\EOF
3625 #define NCURSES 1
3626 EOF
3627
3628
3629
3630 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3631
3632 cat >> confdefs.h <<EOF
3633 #define $cf_nculib_ROOT 1
3634 EOF
3635
3636
3637 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
3638
3639 else
3640
3641
3642
3643 cf_ncuhdr_root=ncurses
3644
3645 test -n "$cf_cv_curses_dir" && \
3646 test "$cf_cv_curses_dir" != "no" && { \
3647   
3648 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
3649   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
3650   do
3651         while test $cf_add_incdir != /usr/include
3652         do
3653           if test -d $cf_add_incdir
3654           then
3655                 cf_have_incdir=no
3656                 if test -n "$CFLAGS$CPPFLAGS" ; then
3657                   # a loop is needed to ensure we can add subdirs of existing dirs
3658                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3659                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3660                           cf_have_incdir=yes; break
3661                         fi
3662                   done
3663                 fi
3664
3665                 if test "$cf_have_incdir" = no ; then
3666                   if test "$cf_add_incdir" = /usr/local/include ; then
3667                         if test "$GCC" = yes
3668                         then
3669                           cf_save_CPPFLAGS=$CPPFLAGS
3670                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3671                           cat > conftest.$ac_ext <<EOF
3672 #line 3673 "configure"
3673 #include "confdefs.h"
3674 #include <stdio.h>
3675 int main() {
3676 printf("Hello")
3677 ; return 0; }
3678 EOF
3679 if { (eval echo configure:3680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3680   :
3681 else
3682   echo "configure: failed program was:" >&5
3683   cat conftest.$ac_ext >&5
3684   rm -rf conftest*
3685   cf_have_incdir=yes
3686 fi
3687 rm -f conftest*
3688                           CPPFLAGS=$cf_save_CPPFLAGS
3689                         fi
3690                   fi
3691                 fi
3692
3693                 if test "$cf_have_incdir" = no ; then
3694                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3695
3696 echo "${as_me-configure}:3697: testing adding $cf_add_incdir to include-path ..." 1>&5
3697
3698
3699                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3700
3701                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3702                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3703                   cf_add_incdir="$cf_top_incdir"
3704                 else
3705                   break
3706                 fi
3707           fi
3708         done
3709   done
3710 fi
3711
3712 }
3713
3714 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
3715 echo "configure:3716: checking for $cf_ncuhdr_root header in include-path" >&5
3716 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
3717   echo $ac_n "(cached) $ac_c" 1>&6
3718 else
3719   
3720         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
3721         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
3722         for cf_header in $cf_header_list
3723         do
3724                 
3725         cat > conftest.$ac_ext <<EOF
3726 #line 3727 "configure"
3727 #include "confdefs.h"
3728
3729
3730 #include <$cf_header>
3731 int main() {
3732
3733 #ifdef NCURSES_VERSION
3734
3735 printf("%s\n", NCURSES_VERSION);
3736 #else
3737 #ifdef __NCURSES_H
3738 printf("old\n");
3739 #else
3740         make an error
3741 #endif
3742 #endif
3743         
3744         
3745 ; return 0; }
3746 EOF
3747 if { (eval echo configure:3748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3748   rm -rf conftest*
3749   cf_cv_ncurses_h=$cf_header
3750         
3751 else
3752   echo "configure: failed program was:" >&5
3753   cat conftest.$ac_ext >&5
3754   rm -rf conftest*
3755   cf_cv_ncurses_h=no
3756 fi
3757 rm -f conftest*
3758
3759                 test "$cf_cv_ncurses_h" != no && break
3760         done
3761
3762 fi
3763
3764 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
3765
3766
3767
3768 if test "$cf_cv_ncurses_h" != no ; then
3769         cf_cv_ncurses_header=$cf_cv_ncurses_h
3770 else
3771
3772 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
3773 echo "configure:3774: checking for $cf_ncuhdr_root include-path" >&5
3774 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
3775   echo $ac_n "(cached) $ac_c" 1>&6
3776 else
3777   
3778         test -n "$verbose" && echo
3779         
3780 cf_search=
3781
3782 # collect the current set of include-directories from compiler flags
3783 cf_header_path_list=""
3784 if test -n "${CFLAGS}${CPPFLAGS}" ; then
3785         for cf_header_path in $CPPFLAGS $CFLAGS
3786         do
3787                 case $cf_header_path in #(vi
3788                 -I*)
3789                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
3790                         
3791 test "$cf_header_path" != "NONE" && \
3792 test -d "$cf_header_path" && \
3793  {
3794         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
3795         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
3796         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
3797         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
3798         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
3799         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3800 }
3801
3802                         cf_header_path_list="$cf_header_path_list $cf_search"
3803                         ;;
3804                 esac
3805         done
3806 fi
3807
3808 # add the variations for the package we are looking for
3809
3810 cf_search=
3811
3812
3813 test "/usr" != "$prefix" && \
3814 test -d "/usr" && \
3815 (test $prefix = NONE || test -d $prefix) && {
3816         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
3817         test -d /usr/include &&          cf_search="$cf_search /usr/include"
3818         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
3819         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
3820         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
3821         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3822 }
3823
3824
3825 test "$prefix" != "NONE" && \
3826 test -d "$prefix" && \
3827  {
3828         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
3829         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
3830         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
3831         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
3832         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
3833         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3834 }
3835
3836
3837 test "/usr/local" != "$prefix" && \
3838 test -d "/usr/local" && \
3839 (test $prefix = NONE || test -d $prefix) && {
3840         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
3841         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
3842         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
3843         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
3844         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
3845         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3846 }
3847
3848
3849 test "/opt" != "$prefix" && \
3850 test -d "/opt" && \
3851 (test $prefix = NONE || test -d $prefix) && {
3852         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
3853         test -d /opt/include &&          cf_search="$cf_search /opt/include"
3854         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
3855         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
3856         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
3857         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3858 }
3859
3860
3861 test "$HOME" != "$prefix" && \
3862 test -d "$HOME" && \
3863 (test $prefix = NONE || test -d $prefix) && {
3864         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
3865         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
3866         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
3867         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
3868         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
3869         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
3870 }
3871
3872
3873
3874 test "$includedir" != NONE && \
3875 test "$includedir" != "/usr/include" && \
3876 test -d "$includedir" && {
3877         test -d $includedir &&    cf_search="$cf_search $includedir"
3878         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
3879 }
3880
3881 test "$oldincludedir" != NONE && \
3882 test "$oldincludedir" != "/usr/include" && \
3883 test -d "$oldincludedir" && {
3884         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
3885         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
3886 }
3887
3888 cf_search="$cf_search $cf_header_path_list"
3889
3890         test -n "$verbose" && echo search path $cf_search
3891         cf_save2_CPPFLAGS="$CPPFLAGS"
3892         for cf_incdir in $cf_search
3893         do
3894                 
3895 if test -n "$cf_incdir" ; then
3896   for cf_add_incdir in $cf_incdir
3897   do
3898         while test $cf_add_incdir != /usr/include
3899         do
3900           if test -d $cf_add_incdir
3901           then
3902                 cf_have_incdir=no
3903                 if test -n "$CFLAGS$CPPFLAGS" ; then
3904                   # a loop is needed to ensure we can add subdirs of existing dirs
3905                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3906                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3907                           cf_have_incdir=yes; break
3908                         fi
3909                   done
3910                 fi
3911
3912                 if test "$cf_have_incdir" = no ; then
3913                   if test "$cf_add_incdir" = /usr/local/include ; then
3914                         if test "$GCC" = yes
3915                         then
3916                           cf_save_CPPFLAGS=$CPPFLAGS
3917                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3918                           cat > conftest.$ac_ext <<EOF
3919 #line 3920 "configure"
3920 #include "confdefs.h"
3921 #include <stdio.h>
3922 int main() {
3923 printf("Hello")
3924 ; return 0; }
3925 EOF
3926 if { (eval echo configure:3927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3927   :
3928 else
3929   echo "configure: failed program was:" >&5
3930   cat conftest.$ac_ext >&5
3931   rm -rf conftest*
3932   cf_have_incdir=yes
3933 fi
3934 rm -f conftest*
3935                           CPPFLAGS=$cf_save_CPPFLAGS
3936                         fi
3937                   fi
3938                 fi
3939
3940                 if test "$cf_have_incdir" = no ; then
3941                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3942
3943 echo "${as_me-configure}:3944: testing adding $cf_add_incdir to include-path ..." 1>&5
3944
3945
3946                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3947
3948                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3949                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3950                   cf_add_incdir="$cf_top_incdir"
3951                 else
3952                   break
3953                 fi
3954           fi
3955         done
3956   done
3957 fi
3958
3959                 for cf_header in \
3960                         ncurses.h \
3961                         curses.h
3962                 do
3963                         
3964         cat > conftest.$ac_ext <<EOF
3965 #line 3966 "configure"
3966 #include "confdefs.h"
3967
3968
3969 #include <$cf_header>
3970 int main() {
3971
3972 #ifdef NCURSES_VERSION
3973
3974 printf("%s\n", NCURSES_VERSION);
3975 #else
3976 #ifdef __NCURSES_H
3977 printf("old\n");
3978 #else
3979         make an error
3980 #endif
3981 #endif
3982         
3983         
3984 ; return 0; }
3985 EOF
3986 if { (eval echo configure:3987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3987   rm -rf conftest*
3988   cf_cv_ncurses_h2=$cf_header
3989         
3990 else
3991   echo "configure: failed program was:" >&5
3992   cat conftest.$ac_ext >&5
3993   rm -rf conftest*
3994   cf_cv_ncurses_h2=no
3995 fi
3996 rm -f conftest*
3997
3998                         if test "$cf_cv_ncurses_h2" != no ; then
3999                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4000                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4001                                 break
4002                         fi
4003                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4004                 done
4005                 CPPFLAGS="$cf_save2_CPPFLAGS"
4006                 test "$cf_cv_ncurses_h2" != no && break
4007         done
4008         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
4009         
4010 fi
4011
4012 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
4013
4014         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4015         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4016         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4017                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4018         fi
4019         
4020 if test -n "$cf_1st_incdir" ; then
4021   for cf_add_incdir in $cf_1st_incdir
4022   do
4023         while test $cf_add_incdir != /usr/include
4024         do
4025           if test -d $cf_add_incdir
4026           then
4027                 cf_have_incdir=no
4028                 if test -n "$CFLAGS$CPPFLAGS" ; then
4029                   # a loop is needed to ensure we can add subdirs of existing dirs
4030                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4031                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4032                           cf_have_incdir=yes; break
4033                         fi
4034                   done
4035                 fi
4036
4037                 if test "$cf_have_incdir" = no ; then
4038                   if test "$cf_add_incdir" = /usr/local/include ; then
4039                         if test "$GCC" = yes
4040                         then
4041                           cf_save_CPPFLAGS=$CPPFLAGS
4042                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4043                           cat > conftest.$ac_ext <<EOF
4044 #line 4045 "configure"
4045 #include "confdefs.h"
4046 #include <stdio.h>
4047 int main() {
4048 printf("Hello")
4049 ; return 0; }
4050 EOF
4051 if { (eval echo configure:4052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4052   :
4053 else
4054   echo "configure: failed program was:" >&5
4055   cat conftest.$ac_ext >&5
4056   rm -rf conftest*
4057   cf_have_incdir=yes
4058 fi
4059 rm -f conftest*
4060                           CPPFLAGS=$cf_save_CPPFLAGS
4061                         fi
4062                   fi
4063                 fi
4064
4065                 if test "$cf_have_incdir" = no ; then
4066                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4067
4068 echo "${as_me-configure}:4069: testing adding $cf_add_incdir to include-path ..." 1>&5
4069
4070
4071                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4072
4073                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4074                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4075                   cf_add_incdir="$cf_top_incdir"
4076                 else
4077                   break
4078                 fi
4079           fi
4080         done
4081   done
4082 fi
4083
4084
4085 fi
4086
4087 # Set definitions to allow ifdef'ing for ncurses.h
4088
4089 case $cf_cv_ncurses_header in # (vi
4090 *ncurses.h)
4091         cat >> confdefs.h <<\EOF
4092 #define HAVE_NCURSES_H 1
4093 EOF
4094
4095         ;;
4096 esac
4097
4098 case $cf_cv_ncurses_header in # (vi
4099 ncurses/curses.h|ncurses/ncurses.h)
4100         cat >> confdefs.h <<\EOF
4101 #define HAVE_NCURSES_NCURSES_H 1
4102 EOF
4103
4104         ;;
4105 ncursesw/curses.h|ncursesw/ncurses.h)
4106         cat >> confdefs.h <<\EOF
4107 #define HAVE_NCURSESW_NCURSES_H 1
4108 EOF
4109
4110         ;;
4111 esac
4112
4113
4114
4115 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
4116 echo "configure:4117: checking for terminfo header" >&5
4117 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
4118   echo $ac_n "(cached) $ac_c" 1>&6
4119 else
4120   
4121 case ${cf_cv_ncurses_header} in #(vi
4122 */ncurses.h|*/ncursesw.h) #(vi
4123         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4124         ;;
4125 *)
4126         cf_term_header=term.h
4127         ;;
4128 esac
4129
4130 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4131 do
4132 cat > conftest.$ac_ext <<EOF
4133 #line 4134 "configure"
4134 #include "confdefs.h"
4135 #include <stdio.h>
4136 #include <${cf_cv_ncurses_header-curses.h}>
4137 #include <$cf_test>
4138
4139 int main() {
4140 int x = auto_left_margin
4141 ; return 0; }
4142 EOF
4143 if { (eval echo configure:4144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4144   rm -rf conftest*
4145   
4146         cf_cv_term_header="$cf_test"
4147 else
4148   echo "configure: failed program was:" >&5
4149   cat conftest.$ac_ext >&5
4150   rm -rf conftest*
4151   
4152         cf_cv_term_header=unknown
4153         
4154 fi
4155 rm -f conftest*
4156         test "$cf_cv_term_header" != unknown && break
4157 done
4158
4159 fi
4160
4161 echo "$ac_t""$cf_cv_term_header" 1>&6
4162
4163 # Set definitions to allow ifdef'ing to accommodate subdirectories
4164
4165 case $cf_cv_term_header in # (vi
4166 *term.h)
4167         cat >> confdefs.h <<\EOF
4168 #define HAVE_TERM_H 1
4169 EOF
4170
4171         ;;
4172 esac
4173
4174 case $cf_cv_term_header in # (vi
4175 ncurses/term.h) #(vi
4176         cat >> confdefs.h <<\EOF
4177 #define HAVE_NCURSES_TERM_H 1
4178 EOF
4179
4180         ;;
4181 ncursesw/term.h)
4182         cat >> confdefs.h <<\EOF
4183 #define HAVE_NCURSESW_TERM_H 1
4184 EOF
4185
4186         ;;
4187 esac
4188
4189
4190 # some applications need this, but should check for NCURSES_VERSION
4191 cat >> confdefs.h <<\EOF
4192 #define NCURSES 1
4193 EOF
4194
4195
4196
4197 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
4198 echo "configure:4199: checking for ncurses version" >&5
4199 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
4200   echo $ac_n "(cached) $ac_c" 1>&6
4201 else
4202   
4203         cf_cv_ncurses_version=no
4204         cf_tempfile=out$$
4205         rm -f $cf_tempfile
4206         if test "$cross_compiling" = yes; then
4207   
4208
4209         # This will not work if the preprocessor splits the line after the
4210         # Autoconf token.  The 'unproto' program does that.
4211         cat > conftest.$ac_ext <<EOF
4212 #include <${cf_cv_ncurses_header-curses.h}>
4213 #undef Autoconf
4214 #ifdef NCURSES_VERSION
4215 Autoconf NCURSES_VERSION
4216 #else
4217 #ifdef __NCURSES_H
4218 Autoconf "old"
4219 #endif
4220 ;
4221 #endif
4222 EOF
4223         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4224         { (eval echo configure:4225: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
4225         if test -f conftest.out ; then
4226                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4227                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4228                 rm -f conftest.out
4229         fi
4230
4231 else
4232   cat > conftest.$ac_ext <<EOF
4233 #line 4234 "configure"
4234 #include "confdefs.h"
4235
4236 #include <${cf_cv_ncurses_header-curses.h}>
4237 #include <stdio.h>
4238 int main()
4239 {
4240         FILE *fp = fopen("$cf_tempfile", "w");
4241 #ifdef NCURSES_VERSION
4242 # ifdef NCURSES_VERSION_PATCH
4243         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4244 # else
4245         fprintf(fp, "%s\n", NCURSES_VERSION);
4246 # endif
4247 #else
4248 # ifdef __NCURSES_H
4249         fprintf(fp, "old\n");
4250 # else
4251         make an error
4252 # endif
4253 #endif
4254         ${cf_cv_main_return-return}(0);
4255 }
4256 EOF
4257 if { (eval echo configure:4258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4258 then
4259   
4260         cf_cv_ncurses_version=`cat $cf_tempfile`
4261 else
4262   echo "configure: failed program was:" >&5
4263   cat conftest.$ac_ext >&5
4264 fi
4265 rm -fr conftest*
4266 fi
4267
4268         rm -f $cf_tempfile
4269
4270 fi
4271
4272 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
4273 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
4274 #define NCURSES 1
4275 EOF
4276
4277
4278
4279
4280
4281 cf_nculib_root=ncurses
4282         # This works, except for the special case where we find gpm, but
4283         # ncurses is in a nonstandard location via $LIBS, and we really want
4284         # to link gpm.
4285 cf_ncurses_LIBS=""
4286 cf_ncurses_SAVE="$LIBS"
4287 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
4288 echo "configure:4289: checking for Gpm_Open in -lgpm" >&5
4289 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
4290 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4291   echo $ac_n "(cached) $ac_c" 1>&6
4292 else
4293   ac_save_LIBS="$LIBS"
4294 LIBS="-lgpm  $LIBS"
4295 cat > conftest.$ac_ext <<EOF
4296 #line 4297 "configure"
4297 #include "confdefs.h"
4298 /* Override any gcc2 internal prototype to avoid an error.  */
4299 /* We use char because int might match the return type of a gcc2
4300     builtin and then its argument prototype would still apply.  */
4301 char Gpm_Open();
4302
4303 int main() {
4304 Gpm_Open()
4305 ; return 0; }
4306 EOF
4307 if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4308   rm -rf conftest*
4309   eval "ac_cv_lib_$ac_lib_var=yes"
4310 else
4311   echo "configure: failed program was:" >&5
4312   cat conftest.$ac_ext >&5
4313   rm -rf conftest*
4314   eval "ac_cv_lib_$ac_lib_var=no"
4315 fi
4316 rm -f conftest*
4317 LIBS="$ac_save_LIBS"
4318
4319 fi
4320 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4321   echo "$ac_t""yes" 1>&6
4322   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
4323 echo "configure:4324: checking for initscr in -lgpm" >&5
4324 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
4325 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4326   echo $ac_n "(cached) $ac_c" 1>&6
4327 else
4328   ac_save_LIBS="$LIBS"
4329 LIBS="-lgpm  $LIBS"
4330 cat > conftest.$ac_ext <<EOF
4331 #line 4332 "configure"
4332 #include "confdefs.h"
4333 /* Override any gcc2 internal prototype to avoid an error.  */
4334 /* We use char because int might match the return type of a gcc2
4335     builtin and then its argument prototype would still apply.  */
4336 char initscr();
4337
4338 int main() {
4339 initscr()
4340 ; return 0; }
4341 EOF
4342 if { (eval echo configure:4343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4343   rm -rf conftest*
4344   eval "ac_cv_lib_$ac_lib_var=yes"
4345 else
4346   echo "configure: failed program was:" >&5
4347   cat conftest.$ac_ext >&5
4348   rm -rf conftest*
4349   eval "ac_cv_lib_$ac_lib_var=no"
4350 fi
4351 rm -f conftest*
4352 LIBS="$ac_save_LIBS"
4353
4354 fi
4355 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4356   echo "$ac_t""yes" 1>&6
4357   LIBS="$cf_ncurses_SAVE"
4358 else
4359   echo "$ac_t""no" 1>&6
4360 cf_ncurses_LIBS="-lgpm"
4361 fi
4362
4363 else
4364   echo "$ac_t""no" 1>&6
4365 fi
4366
4367
4368 case $host_os in #(vi
4369 freebsd*)
4370         # This is only necessary if you are linking against an obsolete
4371         # version of ncurses (but it should do no harm, since it's static).
4372         if test "$cf_nculib_root" = ncurses ; then
4373                 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
4374 echo "configure:4375: checking for tgoto in -lmytinfo" >&5
4375 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
4376 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4377   echo $ac_n "(cached) $ac_c" 1>&6
4378 else
4379   ac_save_LIBS="$LIBS"
4380 LIBS="-lmytinfo  $LIBS"
4381 cat > conftest.$ac_ext <<EOF
4382 #line 4383 "configure"
4383 #include "confdefs.h"
4384 /* Override any gcc2 internal prototype to avoid an error.  */
4385 /* We use char because int might match the return type of a gcc2
4386     builtin and then its argument prototype would still apply.  */
4387 char tgoto();
4388
4389 int main() {
4390 tgoto()
4391 ; return 0; }
4392 EOF
4393 if { (eval echo configure:4394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4394   rm -rf conftest*
4395   eval "ac_cv_lib_$ac_lib_var=yes"
4396 else
4397   echo "configure: failed program was:" >&5
4398   cat conftest.$ac_ext >&5
4399   rm -rf conftest*
4400   eval "ac_cv_lib_$ac_lib_var=no"
4401 fi
4402 rm -f conftest*
4403 LIBS="$ac_save_LIBS"
4404
4405 fi
4406 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4407   echo "$ac_t""yes" 1>&6
4408   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4409 else
4410   echo "$ac_t""no" 1>&6
4411 fi
4412
4413         fi
4414         ;;
4415 esac
4416
4417 LIBS="$cf_ncurses_LIBS $LIBS"
4418
4419 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4420 then
4421         
4422 if test -n "$cf_cv_curses_dir/lib" ; then
4423   for cf_add_libdir in $cf_cv_curses_dir/lib
4424   do
4425     if test $cf_add_libdir = /usr/lib ; then
4426       :
4427     elif test -d $cf_add_libdir
4428     then
4429       cf_have_libdir=no
4430       if test -n "$LDFLAGS$LIBS" ; then
4431         # a loop is needed to ensure we can add subdirs of existing dirs
4432         for cf_test_libdir in $LDFLAGS $LIBS ; do
4433           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4434             cf_have_libdir=yes; break
4435           fi
4436         done
4437       fi
4438       if test "$cf_have_libdir" = no ; then
4439         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4440
4441 echo "${as_me-configure}:4442: testing adding $cf_add_libdir to library-path ..." 1>&5
4442
4443
4444         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4445       fi
4446     fi
4447   done
4448 fi
4449
4450         LIBS="-l$cf_nculib_root $LIBS"
4451 else
4452         
4453         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4454         cf_libdir=""
4455         echo $ac_n "checking for initscr""... $ac_c" 1>&6
4456 echo "configure:4457: checking for initscr" >&5
4457 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
4458   echo $ac_n "(cached) $ac_c" 1>&6
4459 else
4460   cat > conftest.$ac_ext <<EOF
4461 #line 4462 "configure"
4462 #include "confdefs.h"
4463 /* System header to define __stub macros and hopefully few prototypes,
4464     which can conflict with char initscr(); below.  */
4465 #include <assert.h>
4466 /* Override any gcc2 internal prototype to avoid an error.  */
4467 /* We use char because int might match the return type of a gcc2
4468     builtin and then its argument prototype would still apply.  */
4469 char initscr();
4470
4471 int main() {
4472
4473 /* The GNU C library defines this for functions which it implements
4474     to always fail with ENOSYS.  Some functions are actually named
4475     something starting with __ and the normal name is an alias.  */
4476 #if defined (__stub_initscr) || defined (__stub___initscr)
4477 choke me
4478 #else
4479 initscr();
4480 #endif
4481
4482 ; return 0; }
4483 EOF
4484 if { (eval echo configure:4485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4485   rm -rf conftest*
4486   eval "ac_cv_func_initscr=yes"
4487 else
4488   echo "configure: failed program was:" >&5
4489   cat conftest.$ac_ext >&5
4490   rm -rf conftest*
4491   eval "ac_cv_func_initscr=no"
4492 fi
4493 rm -f conftest*
4494 fi
4495
4496 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
4497   echo "$ac_t""yes" 1>&6
4498   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4499 else
4500   echo "$ac_t""no" 1>&6
4501
4502                 cf_save_LIBS="$LIBS"
4503                 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
4504 echo "configure:4505: checking for initscr in -l$cf_nculib_root" >&5
4505                 LIBS="-l$cf_nculib_root $LIBS"
4506                 cat > conftest.$ac_ext <<EOF
4507 #line 4508 "configure"
4508 #include "confdefs.h"
4509 #include <${cf_cv_ncurses_header-curses.h}>
4510 int main() {
4511 initscr()
4512 ; return 0; }
4513 EOF
4514 if { (eval echo configure:4515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4515   rm -rf conftest*
4516   echo "$ac_t""yes" 1>&6
4517                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4518                         
4519 else
4520   echo "configure: failed program was:" >&5
4521   cat conftest.$ac_ext >&5
4522   rm -rf conftest*
4523   echo "$ac_t""no" 1>&6
4524                         
4525 cf_search=
4526 cf_library_path_list=""
4527 if test -n "${LDFLAGS}${LIBS}" ; then
4528         for cf_library_path in $LDFLAGS $LIBS
4529         do
4530                 case $cf_library_path in #(vi
4531                 -L*)
4532                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
4533                         
4534 test "$cf_library_path" != "NONE" && \
4535 test -d "$cf_library_path" && \
4536  {
4537         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
4538         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
4539         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
4540         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
4541         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
4542         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
4543 }
4544
4545                         cf_library_path_list="$cf_library_path_list $cf_search"
4546                         ;;
4547                 esac
4548         done
4549 fi
4550
4551
4552 cf_search=
4553
4554
4555 test "/usr" != "$prefix" && \
4556 test -d "/usr" && \
4557 (test $prefix = NONE || test -d $prefix) && {
4558         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
4559         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
4560         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
4561         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
4562         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
4563         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
4564 }
4565
4566
4567 test "$prefix" != "NONE" && \
4568 test -d "$prefix" && \
4569  {
4570         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
4571         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
4572         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
4573         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
4574         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
4575         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
4576 }
4577
4578
4579 test "/usr/local" != "$prefix" && \
4580 test -d "/usr/local" && \
4581 (test $prefix = NONE || test -d $prefix) && {
4582         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
4583         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
4584         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
4585         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
4586         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
4587         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
4588 }
4589
4590
4591 test "/opt" != "$prefix" && \
4592 test -d "/opt" && \
4593 (test $prefix = NONE || test -d $prefix) && {
4594         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
4595         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
4596         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
4597         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
4598         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
4599         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
4600 }
4601
4602
4603 test "$HOME" != "$prefix" && \
4604 test -d "$HOME" && \
4605 (test $prefix = NONE || test -d $prefix) && {
4606         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
4607         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
4608         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
4609         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
4610         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
4611         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
4612 }
4613
4614
4615
4616 cf_search="$cf_library_path_list $cf_search"
4617
4618                         for cf_libdir in $cf_search
4619                         do
4620                                 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
4621 echo "configure:4622: checking for -l$cf_nculib_root in $cf_libdir" >&5
4622                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
4623                                 cat > conftest.$ac_ext <<EOF
4624 #line 4625 "configure"
4625 #include "confdefs.h"
4626 #include <${cf_cv_ncurses_header-curses.h}>
4627 int main() {
4628 initscr()
4629 ; return 0; }
4630 EOF
4631 if { (eval echo configure:4632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4632   rm -rf conftest*
4633   echo "$ac_t""yes" 1>&6
4634                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
4635                                          break
4636 else
4637   echo "configure: failed program was:" >&5
4638   cat conftest.$ac_ext >&5
4639   rm -rf conftest*
4640   echo "$ac_t""no" 1>&6
4641                                          LIBS="$cf_save_LIBS"
4642 fi
4643 rm -f conftest*
4644                         done
4645                         
4646 fi
4647 rm -f conftest*
4648                 
4649 fi
4650
4651 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
4652
4653 if test $cf_found_library = no ; then
4654         { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
4655 fi
4656
4657
4658 fi
4659
4660 if test -n "$cf_ncurses_LIBS" ; then
4661         echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
4662 echo "configure:4663: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
4663         cf_ncurses_SAVE="$LIBS"
4664         for p in $cf_ncurses_LIBS ; do
4665                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
4666                 if test "$q" != "$LIBS" ; then
4667                         LIBS="$q"
4668                 fi
4669         done
4670         cat > conftest.$ac_ext <<EOF
4671 #line 4672 "configure"
4672 #include "confdefs.h"
4673 #include <${cf_cv_ncurses_header-curses.h}>
4674 int main() {
4675 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4676 ; return 0; }
4677 EOF
4678 if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4679   rm -rf conftest*
4680   echo "$ac_t""yes" 1>&6
4681 else
4682   echo "configure: failed program was:" >&5
4683   cat conftest.$ac_ext >&5
4684   rm -rf conftest*
4685   echo "$ac_t""no" 1>&6
4686                  LIBS="$cf_ncurses_SAVE"
4687 fi
4688 rm -f conftest*
4689 fi
4690
4691
4692 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4693
4694 cat >> confdefs.h <<EOF
4695 #define $cf_nculib_ROOT 1
4696 EOF
4697
4698
4699
4700 fi
4701
4702         ;;
4703 ncursesw)
4704         cf_cv_libtype=w
4705         
4706 echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6
4707 echo "configure:4708: checking for multibyte character support" >&5
4708 if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then
4709   echo $ac_n "(cached) $ac_c" 1>&6
4710 else
4711   
4712         cf_save_LIBS="$LIBS"
4713         cat > conftest.$ac_ext <<EOF
4714 #line 4715 "configure"
4715 #include "confdefs.h"
4716
4717 #include <stdlib.h>
4718 int main() {
4719 putwc(0,0);
4720 ; return 0; }
4721 EOF
4722 if { (eval echo configure:4723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4723   rm -rf conftest*
4724   cf_cv_utf8_lib=yes
4725 else
4726   echo "configure: failed program was:" >&5
4727   cat conftest.$ac_ext >&5
4728   rm -rf conftest*
4729   
4730
4731 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
4732 # will be set on completion of the AC_TRY_LINK below.
4733 cf_cv_header_path_utf8=
4734 cf_cv_library_path_utf8=
4735
4736
4737 echo "${as_me-configure}:4738: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
4738
4739
4740 cf_save_LIBS="$LIBS"
4741
4742 cat > conftest.$ac_ext <<EOF
4743 #line 4744 "configure"
4744 #include "confdefs.h"
4745
4746 #include <libutf8.h>
4747 int main() {
4748 putwc(0,0);
4749 ; return 0; }
4750 EOF
4751 if { (eval echo configure:4752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4752   rm -rf conftest*
4753   
4754         cf_cv_find_linkage_utf8=yes
4755         cf_cv_header_path_utf8=/usr/include
4756         cf_cv_library_path_utf8=/usr/lib
4757
4758 else
4759   echo "configure: failed program was:" >&5
4760   cat conftest.$ac_ext >&5
4761   rm -rf conftest*
4762   
4763
4764 LIBS="-lutf8  $cf_save_LIBS"
4765
4766 cat > conftest.$ac_ext <<EOF
4767 #line 4768 "configure"
4768 #include "confdefs.h"
4769
4770 #include <libutf8.h>
4771 int main() {
4772 putwc(0,0);
4773 ; return 0; }
4774 EOF
4775 if { (eval echo configure:4776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4776   rm -rf conftest*
4777   
4778         cf_cv_find_linkage_utf8=yes
4779         cf_cv_header_path_utf8=/usr/include
4780         cf_cv_library_path_utf8=/usr/lib
4781         cf_cv_library_file_utf8="-lutf8"
4782
4783 else
4784   echo "configure: failed program was:" >&5
4785   cat conftest.$ac_ext >&5
4786   rm -rf conftest*
4787   
4788         cf_cv_find_linkage_utf8=no
4789         LIBS="$cf_save_LIBS"
4790
4791     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
4792
4793 echo "${as_me-configure}:4794: testing find linkage for utf8 library ..." 1>&5
4794
4795
4796     
4797 echo "${as_me-configure}:4798: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
4798
4799
4800     cf_save_CPPFLAGS="$CPPFLAGS"
4801     cf_test_CPPFLAGS="$CPPFLAGS"
4802
4803     
4804 cf_search=
4805
4806 # collect the current set of include-directories from compiler flags
4807 cf_header_path_list=""
4808 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4809         for cf_header_path in $CPPFLAGS $CFLAGS
4810         do
4811                 case $cf_header_path in #(vi
4812                 -I*)
4813                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4814                         
4815 test "$cf_header_path" != "NONE" && \
4816 test -d "$cf_header_path" && \
4817  {
4818         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4819         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4820         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
4821         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
4822         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
4823         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
4824 }
4825
4826                         cf_header_path_list="$cf_header_path_list $cf_search"
4827                         ;;
4828                 esac
4829         done
4830 fi
4831
4832 # add the variations for the package we are looking for
4833
4834 cf_search=
4835
4836
4837 test "/usr" != "$prefix" && \
4838 test -d "/usr" && \
4839 (test $prefix = NONE || test -d $prefix) && {
4840         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
4841         test -d /usr/include &&          cf_search="$cf_search /usr/include"
4842         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
4843         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
4844         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
4845         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
4846 }
4847
4848
4849 test "$prefix" != "NONE" && \
4850 test -d "$prefix" && \
4851  {
4852         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4853         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4854         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
4855         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
4856         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
4857         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
4858 }
4859
4860
4861 test "/usr/local" != "$prefix" && \
4862 test -d "/usr/local" && \
4863 (test $prefix = NONE || test -d $prefix) && {
4864         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
4865         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
4866         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
4867         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
4868         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
4869         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
4870 }
4871
4872
4873 test "/opt" != "$prefix" && \
4874 test -d "/opt" && \
4875 (test $prefix = NONE || test -d $prefix) && {
4876         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
4877         test -d /opt/include &&          cf_search="$cf_search /opt/include"
4878         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
4879         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
4880         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
4881         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
4882 }
4883
4884
4885 test "$HOME" != "$prefix" && \
4886 test -d "$HOME" && \
4887 (test $prefix = NONE || test -d $prefix) && {
4888         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
4889         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
4890         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
4891         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
4892         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
4893         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
4894 }
4895
4896
4897
4898 test "$includedir" != NONE && \
4899 test "$includedir" != "/usr/include" && \
4900 test -d "$includedir" && {
4901         test -d $includedir &&    cf_search="$cf_search $includedir"
4902         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
4903 }
4904
4905 test "$oldincludedir" != NONE && \
4906 test "$oldincludedir" != "/usr/include" && \
4907 test -d "$oldincludedir" && {
4908         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4909         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
4910 }
4911
4912 cf_search="$cf_search $cf_header_path_list"
4913
4914     for cf_cv_header_path_utf8 in $cf_search
4915     do
4916       if test -d $cf_cv_header_path_utf8 ; then
4917         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
4918
4919 echo "${as_me-configure}:4920: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
4920
4921
4922         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
4923         cat > conftest.$ac_ext <<EOF
4924 #line 4925 "configure"
4925 #include "confdefs.h"
4926
4927 #include <libutf8.h>
4928 int main() {
4929 putwc(0,0);
4930 ; return 0; }
4931 EOF
4932 if { (eval echo configure:4933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4933   rm -rf conftest*
4934   
4935             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
4936
4937 echo "${as_me-configure}:4938: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
4938
4939
4940             cf_cv_find_linkage_utf8=maybe
4941             cf_test_CPPFLAGS="$CPPFLAGS"
4942             break
4943 else
4944   echo "configure: failed program was:" >&5
4945   cat conftest.$ac_ext >&5
4946   rm -rf conftest*
4947   
4948             CPPFLAGS="$cf_save_CPPFLAGS"
4949             
4950 fi
4951 rm -f conftest*
4952       fi
4953     done
4954
4955     if test "$cf_cv_find_linkage_utf8" = maybe ; then
4956
4957       
4958 echo "${as_me-configure}:4959: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
4959
4960
4961       cf_save_LIBS="$LIBS"
4962       cf_save_LDFLAGS="$LDFLAGS"
4963
4964       
4965
4966       if test "$cf_cv_find_linkage_utf8" != yes ; then
4967         
4968 cf_search=
4969 cf_library_path_list=""
4970 if test -n "${LDFLAGS}${LIBS}" ; then
4971         for cf_library_path in $LDFLAGS $LIBS
4972         do
4973                 case $cf_library_path in #(vi
4974                 -L*)
4975                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
4976                         
4977 test "$cf_library_path" != "NONE" && \
4978 test -d "$cf_library_path" && \
4979  {
4980         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
4981         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
4982         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
4983         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
4984         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
4985         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
4986 }
4987
4988                         cf_library_path_list="$cf_library_path_list $cf_search"
4989                         ;;
4990                 esac
4991         done
4992 fi
4993
4994
4995 cf_search=
4996
4997
4998 test "/usr" != "$prefix" && \
4999 test -d "/usr" && \
5000 (test $prefix = NONE || test -d $prefix) && {
5001         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
5002         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
5003         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
5004         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
5005         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
5006         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
5007 }
5008
5009
5010 test "$prefix" != "NONE" && \
5011 test -d "$prefix" && \
5012  {
5013         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5014         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5015         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5016         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5017         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5018         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5019 }
5020
5021
5022 test "/usr/local" != "$prefix" && \
5023 test -d "/usr/local" && \
5024 (test $prefix = NONE || test -d $prefix) && {
5025         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
5026         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
5027         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
5028         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
5029         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
5030         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
5031 }
5032
5033
5034 test "/opt" != "$prefix" && \
5035 test -d "/opt" && \
5036 (test $prefix = NONE || test -d $prefix) && {
5037         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
5038         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
5039         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
5040         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
5041         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
5042         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
5043 }
5044
5045
5046 test "$HOME" != "$prefix" && \
5047 test -d "$HOME" && \
5048 (test $prefix = NONE || test -d $prefix) && {
5049         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
5050         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
5051         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
5052         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
5053         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
5054         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
5055 }
5056
5057
5058
5059 cf_search="$cf_library_path_list $cf_search"
5060
5061         for cf_cv_library_path_utf8 in $cf_search
5062         do
5063           if test -d $cf_cv_library_path_utf8 ; then
5064             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
5065
5066 echo "${as_me-configure}:5067: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5067
5068
5069             CPPFLAGS="$cf_test_CPPFLAGS"
5070             LIBS="-lutf8  $cf_save_LIBS"
5071             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5072             cat > conftest.$ac_ext <<EOF
5073 #line 5074 "configure"
5074 #include "confdefs.h"
5075
5076 #include <libutf8.h>
5077 int main() {
5078 putwc(0,0);
5079 ; return 0; }
5080 EOF
5081 if { (eval echo configure:5082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5082   rm -rf conftest*
5083   
5084                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5085
5086 echo "${as_me-configure}:5087: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5087
5088
5089                 cf_cv_find_linkage_utf8=yes
5090                 cf_cv_library_file_utf8="-lutf8"
5091                 break
5092 else
5093   echo "configure: failed program was:" >&5
5094   cat conftest.$ac_ext >&5
5095   rm -rf conftest*
5096   
5097                 CPPFLAGS="$cf_save_CPPFLAGS"
5098                 LIBS="$cf_save_LIBS"
5099                 LDFLAGS="$cf_save_LDFLAGS"
5100                 
5101 fi
5102 rm -f conftest*
5103           fi
5104         done
5105         CPPFLAGS="$cf_save_CPPFLAGS"
5106         LDFLAGS="$cf_save_LDFLAGS"
5107       fi
5108
5109     else
5110       cf_cv_find_linkage_utf8=no
5111     fi
5112     
5113 fi
5114 rm -f conftest*
5115
5116 fi
5117 rm -f conftest*
5118
5119 LIBS="$cf_save_LIBS"
5120
5121 if test "$cf_cv_find_linkage_utf8" = yes ; then
5122 cf_cv_utf8_lib=add-on
5123 else
5124 cf_cv_utf8_lib=no
5125 fi
5126
5127
5128 fi
5129 rm -f conftest*
5130 fi
5131
5132 echo "$ac_t""$cf_cv_utf8_lib" 1>&6
5133
5134 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5135 # ncurses/ncursesw:
5136 if test "$cf_cv_utf8_lib" = "add-on" ; then
5137         cat >> confdefs.h <<\EOF
5138 #define HAVE_LIBUTF8_H 1
5139 EOF
5140
5141         
5142 if test -n "$cf_cv_header_path_utf8" ; then
5143   for cf_add_incdir in $cf_cv_header_path_utf8
5144   do
5145         while test $cf_add_incdir != /usr/include
5146         do
5147           if test -d $cf_add_incdir
5148           then
5149                 cf_have_incdir=no
5150                 if test -n "$CFLAGS$CPPFLAGS" ; then
5151                   # a loop is needed to ensure we can add subdirs of existing dirs
5152                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5153                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5154                           cf_have_incdir=yes; break
5155                         fi
5156                   done
5157                 fi
5158
5159                 if test "$cf_have_incdir" = no ; then
5160                   if test "$cf_add_incdir" = /usr/local/include ; then
5161                         if test "$GCC" = yes
5162                         then
5163                           cf_save_CPPFLAGS=$CPPFLAGS
5164                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5165                           cat > conftest.$ac_ext <<EOF
5166 #line 5167 "configure"
5167 #include "confdefs.h"
5168 #include <stdio.h>
5169 int main() {
5170 printf("Hello")
5171 ; return 0; }
5172 EOF
5173 if { (eval echo configure:5174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5174   :
5175 else
5176   echo "configure: failed program was:" >&5
5177   cat conftest.$ac_ext >&5
5178   rm -rf conftest*
5179   cf_have_incdir=yes
5180 fi
5181 rm -f conftest*
5182                           CPPFLAGS=$cf_save_CPPFLAGS
5183                         fi
5184                   fi
5185                 fi
5186
5187                 if test "$cf_have_incdir" = no ; then
5188                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5189
5190 echo "${as_me-configure}:5191: testing adding $cf_add_incdir to include-path ..." 1>&5
5191
5192
5193                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5194
5195                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5196                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5197                   cf_add_incdir="$cf_top_incdir"
5198                 else
5199                   break
5200                 fi
5201           fi
5202         done
5203   done
5204 fi
5205
5206         
5207 if test -n "$cf_cv_library_path_utf8" ; then
5208   for cf_add_libdir in $cf_cv_library_path_utf8
5209   do
5210     if test $cf_add_libdir = /usr/lib ; then
5211       :
5212     elif test -d $cf_add_libdir
5213     then
5214       cf_have_libdir=no
5215       if test -n "$LDFLAGS$LIBS" ; then
5216         # a loop is needed to ensure we can add subdirs of existing dirs
5217         for cf_test_libdir in $LDFLAGS $LIBS ; do
5218           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5219             cf_have_libdir=yes; break
5220           fi
5221         done
5222       fi
5223       if test "$cf_have_libdir" = no ; then
5224         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5225
5226 echo "${as_me-configure}:5227: testing adding $cf_add_libdir to library-path ..." 1>&5
5227
5228
5229         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5230       fi
5231     fi
5232   done
5233 fi
5234
5235         LIBS="$cf_cv_library_file_utf8 $LIBS"
5236 fi
5237
5238         
5239 cf_ncuconfig_root=ncursesw
5240
5241 echo "Looking for ${cf_ncuconfig_root}-config"
5242 for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5243 do
5244 # Extract the first word of "$ac_prog", so it can be a program name with args.
5245 set dummy $ac_prog; ac_word=$2
5246 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5247 echo "configure:5248: checking for $ac_word" >&5
5248 if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
5249   echo $ac_n "(cached) $ac_c" 1>&6
5250 else
5251   case "$NCURSES_CONFIG" in
5252   /*)
5253   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
5254   ;;
5255   ?:/*)                  
5256   ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a dos path.
5257   ;;
5258   *)
5259   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5260   ac_dummy="$PATH"
5261   for ac_dir in $ac_dummy; do 
5262     test -z "$ac_dir" && ac_dir=.
5263     if test -f $ac_dir/$ac_word; then
5264       ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
5265       break
5266     fi
5267   done
5268   IFS="$ac_save_ifs"
5269   ;;
5270 esac
5271 fi
5272 NCURSES_CONFIG="$ac_cv_path_NCURSES_CONFIG"
5273 if test -n "$NCURSES_CONFIG"; then
5274   echo "$ac_t""$NCURSES_CONFIG" 1>&6
5275 else
5276   echo "$ac_t""no" 1>&6
5277 fi
5278
5279 test -n "$NCURSES_CONFIG" && break
5280 done
5281 test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
5282
5283
5284 if test "$NCURSES_CONFIG" != none ; then
5285
5286 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5287 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
5288
5289 # even with config script, some packages use no-override for curses.h
5290
5291 echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
5292 echo "configure:5293: checking if we have identified curses headers" >&5
5293 if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
5294   echo $ac_n "(cached) $ac_c" 1>&6
5295 else
5296   
5297 cf_cv_ncurses_header=none
5298 for cf_header in  \
5299     ncursesw/curses.h \
5300         ncursesw/ncurses.h \
5301         curses.h \
5302         ncurses.h 
5303 do
5304 cat > conftest.$ac_ext <<EOF
5305 #line 5306 "configure"
5306 #include "confdefs.h"
5307 #include <${cf_header}>
5308 int main() {
5309 initscr(); tgoto("?", 0,0)
5310 ; return 0; }
5311 EOF
5312 if { (eval echo configure:5313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5313   rm -rf conftest*
5314   cf_cv_ncurses_header=$cf_header; break
5315 else
5316   echo "configure: failed program was:" >&5
5317   cat conftest.$ac_ext >&5
5318 fi
5319 rm -f conftest*
5320 done
5321
5322 fi
5323
5324 echo "$ac_t""$cf_cv_ncurses_header" 1>&6
5325
5326 if test "$cf_cv_ncurses_header" = none ; then
5327         { echo "configure: error: No curses header-files found" 1>&2; exit 1; }
5328 fi
5329
5330 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5331 for ac_hdr in $cf_cv_ncurses_header
5332 do
5333 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5334 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5335 echo "configure:5336: checking for $ac_hdr" >&5
5336 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5337   echo $ac_n "(cached) $ac_c" 1>&6
5338 else
5339   cat > conftest.$ac_ext <<EOF
5340 #line 5341 "configure"
5341 #include "confdefs.h"
5342 #include <$ac_hdr>
5343 EOF
5344 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5345 { (eval echo configure:5346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5346 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5347 if test -z "$ac_err"; then
5348   rm -rf conftest*
5349   eval "ac_cv_header_$ac_safe=yes"
5350 else
5351   echo "$ac_err" >&5
5352   echo "configure: failed program was:" >&5
5353   cat conftest.$ac_ext >&5
5354   rm -rf conftest*
5355   eval "ac_cv_header_$ac_safe=no"
5356 fi
5357 rm -f conftest*
5358 fi
5359 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5360   echo "$ac_t""yes" 1>&6
5361     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5362   cat >> confdefs.h <<EOF
5363 #define $ac_tr_hdr 1
5364 EOF
5365  
5366 else
5367   echo "$ac_t""no" 1>&6
5368 fi
5369 done
5370
5371
5372
5373 cat >> confdefs.h <<\EOF
5374 #define NCURSES 1
5375 EOF
5376
5377
5378
5379 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5380
5381 cat >> confdefs.h <<EOF
5382 #define $cf_nculib_ROOT 1
5383 EOF
5384
5385
5386 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5387
5388 else
5389
5390
5391
5392 cf_ncuhdr_root=ncursesw
5393
5394 test -n "$cf_cv_curses_dir" && \
5395 test "$cf_cv_curses_dir" != "no" && { \
5396   
5397 if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5398   for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
5399   do
5400         while test $cf_add_incdir != /usr/include
5401         do
5402           if test -d $cf_add_incdir
5403           then
5404                 cf_have_incdir=no
5405                 if test -n "$CFLAGS$CPPFLAGS" ; then
5406                   # a loop is needed to ensure we can add subdirs of existing dirs
5407                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5408                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5409                           cf_have_incdir=yes; break
5410                         fi
5411                   done
5412                 fi
5413
5414                 if test "$cf_have_incdir" = no ; then
5415                   if test "$cf_add_incdir" = /usr/local/include ; then
5416                         if test "$GCC" = yes
5417                         then
5418                           cf_save_CPPFLAGS=$CPPFLAGS
5419                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5420                           cat > conftest.$ac_ext <<EOF
5421 #line 5422 "configure"
5422 #include "confdefs.h"
5423 #include <stdio.h>
5424 int main() {
5425 printf("Hello")
5426 ; return 0; }
5427 EOF
5428 if { (eval echo configure:5429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5429   :
5430 else
5431   echo "configure: failed program was:" >&5
5432   cat conftest.$ac_ext >&5
5433   rm -rf conftest*
5434   cf_have_incdir=yes
5435 fi
5436 rm -f conftest*
5437                           CPPFLAGS=$cf_save_CPPFLAGS
5438                         fi
5439                   fi
5440                 fi
5441
5442                 if test "$cf_have_incdir" = no ; then
5443                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5444
5445 echo "${as_me-configure}:5446: testing adding $cf_add_incdir to include-path ..." 1>&5
5446
5447
5448                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5449
5450                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5451                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5452                   cf_add_incdir="$cf_top_incdir"
5453                 else
5454                   break
5455                 fi
5456           fi
5457         done
5458   done
5459 fi
5460
5461 }
5462
5463 echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
5464 echo "configure:5465: checking for $cf_ncuhdr_root header in include-path" >&5
5465 if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
5466   echo $ac_n "(cached) $ac_c" 1>&6
5467 else
5468   
5469         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5470         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5471         for cf_header in $cf_header_list
5472         do
5473                 
5474         cat > conftest.$ac_ext <<EOF
5475 #line 5476 "configure"
5476 #include "confdefs.h"
5477
5478
5479 #define _XOPEN_SOURCE_EXTENDED
5480 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
5481 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
5482
5483 #include <$cf_header>
5484 int main() {
5485
5486 #ifdef NCURSES_VERSION
5487
5488 #ifndef WACS_BSSB
5489         make an error
5490 #endif
5491
5492 printf("%s\n", NCURSES_VERSION);
5493 #else
5494 #ifdef __NCURSES_H
5495 printf("old\n");
5496 #else
5497         make an error
5498 #endif
5499 #endif
5500         
5501         
5502 ; return 0; }
5503 EOF
5504 if { (eval echo configure:5505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5505   rm -rf conftest*
5506   cf_cv_ncurses_h=$cf_header
5507         
5508 else
5509   echo "configure: failed program was:" >&5
5510   cat conftest.$ac_ext >&5
5511   rm -rf conftest*
5512   cf_cv_ncurses_h=no
5513 fi
5514 rm -f conftest*
5515
5516                 test "$cf_cv_ncurses_h" != no && break
5517         done
5518
5519 fi
5520
5521 echo "$ac_t""$cf_cv_ncurses_h" 1>&6
5522
5523
5524
5525 if test "$cf_cv_ncurses_h" != no ; then
5526         cf_cv_ncurses_header=$cf_cv_ncurses_h
5527 else
5528
5529 echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
5530 echo "configure:5531: checking for $cf_ncuhdr_root include-path" >&5
5531 if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
5532   echo $ac_n "(cached) $ac_c" 1>&6
5533 else
5534   
5535         test -n "$verbose" && echo
5536         
5537 cf_search=
5538
5539 # collect the current set of include-directories from compiler flags
5540 cf_header_path_list=""
5541 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5542         for cf_header_path in $CPPFLAGS $CFLAGS
5543         do
5544                 case $cf_header_path in #(vi
5545                 -I*)
5546                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5547                         
5548 test "$cf_header_path" != "NONE" && \
5549 test -d "$cf_header_path" && \
5550  {
5551         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5552         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5553         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5554         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5555         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5556         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5557 }
5558
5559                         cf_header_path_list="$cf_header_path_list $cf_search"
5560                         ;;
5561                 esac
5562         done
5563 fi
5564
5565 # add the variations for the package we are looking for
5566
5567 cf_search=
5568
5569
5570 test "/usr" != "$prefix" && \
5571 test -d "/usr" && \
5572 (test $prefix = NONE || test -d $prefix) && {
5573         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
5574         test -d /usr/include &&          cf_search="$cf_search /usr/include"
5575         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
5576         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
5577         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
5578         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5579 }
5580
5581
5582 test "$prefix" != "NONE" && \
5583 test -d "$prefix" && \
5584  {
5585         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5586         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5587         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5588         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5589         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5590         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5591 }
5592
5593
5594 test "/usr/local" != "$prefix" && \
5595 test -d "/usr/local" && \
5596 (test $prefix = NONE || test -d $prefix) && {
5597         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
5598         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
5599         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
5600         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
5601         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
5602         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5603 }
5604
5605
5606 test "/opt" != "$prefix" && \
5607 test -d "/opt" && \
5608 (test $prefix = NONE || test -d $prefix) && {
5609         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
5610         test -d /opt/include &&          cf_search="$cf_search /opt/include"
5611         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
5612         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
5613         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
5614         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5615 }
5616
5617
5618 test "$HOME" != "$prefix" && \
5619 test -d "$HOME" && \
5620 (test $prefix = NONE || test -d $prefix) && {
5621         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
5622         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
5623         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
5624         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
5625         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
5626         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5627 }
5628
5629
5630
5631 test "$includedir" != NONE && \
5632 test "$includedir" != "/usr/include" && \
5633 test -d "$includedir" && {
5634         test -d $includedir &&    cf_search="$cf_search $includedir"
5635         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5636 }
5637
5638 test "$oldincludedir" != NONE && \
5639 test "$oldincludedir" != "/usr/include" && \
5640 test -d "$oldincludedir" && {
5641         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5642         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5643 }
5644
5645 cf_search="$cf_search $cf_header_path_list"
5646
5647         test -n "$verbose" && echo search path $cf_search
5648         cf_save2_CPPFLAGS="$CPPFLAGS"
5649         for cf_incdir in $cf_search
5650         do
5651                 
5652 if test -n "$cf_incdir" ; then
5653   for cf_add_incdir in $cf_incdir
5654   do
5655         while test $cf_add_incdir != /usr/include
5656         do
5657           if test -d $cf_add_incdir
5658           then
5659                 cf_have_incdir=no
5660                 if test -n "$CFLAGS$CPPFLAGS" ; then
5661                   # a loop is needed to ensure we can add subdirs of existing dirs
5662                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5663                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5664                           cf_have_incdir=yes; break
5665                         fi
5666                   done
5667                 fi
5668
5669                 if test "$cf_have_incdir" = no ; then
5670                   if test "$cf_add_incdir" = /usr/local/include ; then
5671                         if test "$GCC" = yes
5672                         then
5673                           cf_save_CPPFLAGS=$CPPFLAGS
5674                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5675                           cat > conftest.$ac_ext <<EOF
5676 #line 5677 "configure"
5677 #include "confdefs.h"
5678 #include <stdio.h>
5679 int main() {
5680 printf("Hello")
5681 ; return 0; }
5682 EOF
5683 if { (eval echo configure:5684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5684   :
5685 else
5686   echo "configure: failed program was:" >&5
5687   cat conftest.$ac_ext >&5
5688   rm -rf conftest*
5689   cf_have_incdir=yes
5690 fi
5691 rm -f conftest*
5692                           CPPFLAGS=$cf_save_CPPFLAGS
5693                         fi
5694                   fi
5695                 fi
5696
5697                 if test "$cf_have_incdir" = no ; then
5698                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5699
5700 echo "${as_me-configure}:5701: testing adding $cf_add_incdir to include-path ..." 1>&5
5701
5702
5703                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5704
5705                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5706                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5707                   cf_add_incdir="$cf_top_incdir"
5708                 else
5709                   break
5710                 fi
5711           fi
5712         done
5713   done
5714 fi
5715
5716                 for cf_header in \
5717                         ncurses.h \
5718                         curses.h
5719                 do
5720                         
5721         cat > conftest.$ac_ext <<EOF
5722 #line 5723 "configure"
5723 #include "confdefs.h"
5724
5725
5726 #include <$cf_header>
5727 int main() {
5728
5729 #ifdef NCURSES_VERSION
5730
5731 printf("%s\n", NCURSES_VERSION);
5732 #else
5733 #ifdef __NCURSES_H
5734 printf("old\n");
5735 #else
5736         make an error
5737 #endif
5738 #endif
5739         
5740         
5741 ; return 0; }
5742 EOF
5743 if { (eval echo configure:5744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5744   rm -rf conftest*
5745   cf_cv_ncurses_h2=$cf_header
5746         
5747 else
5748   echo "configure: failed program was:" >&5
5749   cat conftest.$ac_ext >&5
5750   rm -rf conftest*
5751   cf_cv_ncurses_h2=no
5752 fi
5753 rm -f conftest*
5754
5755                         if test "$cf_cv_ncurses_h2" != no ; then
5756                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5757                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5758                                 break
5759                         fi
5760                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5761                 done
5762                 CPPFLAGS="$cf_save2_CPPFLAGS"
5763                 test "$cf_cv_ncurses_h2" != no && break
5764         done
5765         test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
5766         
5767 fi
5768
5769 echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
5770
5771         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5772         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5773         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5774                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5775         fi
5776         
5777 if test -n "$cf_1st_incdir" ; then
5778   for cf_add_incdir in $cf_1st_incdir
5779   do
5780         while test $cf_add_incdir != /usr/include
5781         do
5782           if test -d $cf_add_incdir
5783           then
5784                 cf_have_incdir=no
5785                 if test -n "$CFLAGS$CPPFLAGS" ; then
5786                   # a loop is needed to ensure we can add subdirs of existing dirs
5787                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5788                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5789                           cf_have_incdir=yes; break
5790                         fi
5791                   done
5792                 fi
5793
5794                 if test "$cf_have_incdir" = no ; then
5795                   if test "$cf_add_incdir" = /usr/local/include ; then
5796                         if test "$GCC" = yes
5797                         then
5798                           cf_save_CPPFLAGS=$CPPFLAGS
5799                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5800                           cat > conftest.$ac_ext <<EOF
5801 #line 5802 "configure"
5802 #include "confdefs.h"
5803 #include <stdio.h>
5804 int main() {
5805 printf("Hello")
5806 ; return 0; }
5807 EOF
5808 if { (eval echo configure:5809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5809   :
5810 else
5811   echo "configure: failed program was:" >&5
5812   cat conftest.$ac_ext >&5
5813   rm -rf conftest*
5814   cf_have_incdir=yes
5815 fi
5816 rm -f conftest*
5817                           CPPFLAGS=$cf_save_CPPFLAGS
5818                         fi
5819                   fi
5820                 fi
5821
5822                 if test "$cf_have_incdir" = no ; then
5823                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5824
5825 echo "${as_me-configure}:5826: testing adding $cf_add_incdir to include-path ..." 1>&5
5826
5827
5828                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5829
5830                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5831                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5832                   cf_add_incdir="$cf_top_incdir"
5833                 else
5834                   break
5835                 fi
5836           fi
5837         done
5838   done
5839 fi
5840
5841
5842 fi
5843
5844 # Set definitions to allow ifdef'ing for ncurses.h
5845
5846 case $cf_cv_ncurses_header in # (vi
5847 *ncurses.h)
5848         cat >> confdefs.h <<\EOF
5849 #define HAVE_NCURSES_H 1
5850 EOF
5851
5852         ;;
5853 esac
5854
5855 case $cf_cv_ncurses_header in # (vi
5856 ncurses/curses.h|ncurses/ncurses.h)
5857         cat >> confdefs.h <<\EOF
5858 #define HAVE_NCURSES_NCURSES_H 1
5859 EOF
5860
5861         ;;
5862 ncursesw/curses.h|ncursesw/ncurses.h)
5863         cat >> confdefs.h <<\EOF
5864 #define HAVE_NCURSESW_NCURSES_H 1
5865 EOF
5866
5867         ;;
5868 esac
5869
5870
5871
5872 echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
5873 echo "configure:5874: checking for terminfo header" >&5
5874 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
5875   echo $ac_n "(cached) $ac_c" 1>&6
5876 else
5877   
5878 case ${cf_cv_ncurses_header} in #(vi
5879 */ncurses.h|*/ncursesw.h) #(vi
5880         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5881         ;;
5882 *)
5883         cf_term_header=term.h
5884         ;;
5885 esac
5886
5887 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5888 do
5889 cat > conftest.$ac_ext <<EOF
5890 #line 5891 "configure"
5891 #include "confdefs.h"
5892 #include <stdio.h>
5893 #include <${cf_cv_ncurses_header-curses.h}>
5894 #include <$cf_test>
5895
5896 int main() {
5897 int x = auto_left_margin
5898 ; return 0; }
5899 EOF
5900 if { (eval echo configure:5901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5901   rm -rf conftest*
5902   
5903         cf_cv_term_header="$cf_test"
5904 else
5905   echo "configure: failed program was:" >&5
5906   cat conftest.$ac_ext >&5
5907   rm -rf conftest*
5908   
5909         cf_cv_term_header=unknown
5910         
5911 fi
5912 rm -f conftest*
5913         test "$cf_cv_term_header" != unknown && break
5914 done
5915
5916 fi
5917
5918 echo "$ac_t""$cf_cv_term_header" 1>&6
5919
5920 # Set definitions to allow ifdef'ing to accommodate subdirectories
5921
5922 case $cf_cv_term_header in # (vi
5923 *term.h)
5924         cat >> confdefs.h <<\EOF
5925 #define HAVE_TERM_H 1
5926 EOF
5927
5928         ;;
5929 esac
5930
5931 case $cf_cv_term_header in # (vi
5932 ncurses/term.h) #(vi
5933         cat >> confdefs.h <<\EOF
5934 #define HAVE_NCURSES_TERM_H 1
5935 EOF
5936
5937         ;;
5938 ncursesw/term.h)
5939         cat >> confdefs.h <<\EOF
5940 #define HAVE_NCURSESW_TERM_H 1
5941 EOF
5942
5943         ;;
5944 esac
5945
5946
5947 # some applications need this, but should check for NCURSES_VERSION
5948 cat >> confdefs.h <<\EOF
5949 #define NCURSES 1
5950 EOF
5951
5952
5953
5954 echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
5955 echo "configure:5956: checking for ncurses version" >&5
5956 if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
5957   echo $ac_n "(cached) $ac_c" 1>&6
5958 else
5959   
5960         cf_cv_ncurses_version=no
5961         cf_tempfile=out$$
5962         rm -f $cf_tempfile
5963         if test "$cross_compiling" = yes; then
5964   
5965
5966         # This will not work if the preprocessor splits the line after the
5967         # Autoconf token.  The 'unproto' program does that.
5968         cat > conftest.$ac_ext <<EOF
5969 #include <${cf_cv_ncurses_header-curses.h}>
5970 #undef Autoconf
5971 #ifdef NCURSES_VERSION
5972 Autoconf NCURSES_VERSION
5973 #else
5974 #ifdef __NCURSES_H
5975 Autoconf "old"
5976 #endif
5977 ;
5978 #endif
5979 EOF
5980         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5981         { (eval echo configure:5982: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
5982         if test -f conftest.out ; then
5983                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5984                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5985                 rm -f conftest.out
5986         fi
5987
5988 else
5989   cat > conftest.$ac_ext <<EOF
5990 #line 5991 "configure"
5991 #include "confdefs.h"
5992
5993 #include <${cf_cv_ncurses_header-curses.h}>
5994 #include <stdio.h>
5995 int main()
5996 {
5997         FILE *fp = fopen("$cf_tempfile", "w");
5998 #ifdef NCURSES_VERSION
5999 # ifdef NCURSES_VERSION_PATCH
6000         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6001 # else
6002         fprintf(fp, "%s\n", NCURSES_VERSION);
6003 # endif
6004 #else
6005 # ifdef __NCURSES_H
6006         fprintf(fp, "old\n");
6007 # else
6008         make an error
6009 # endif
6010 #endif
6011         ${cf_cv_main_return-return}(0);
6012 }
6013 EOF
6014 if { (eval echo configure:6015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6015 then
6016   
6017         cf_cv_ncurses_version=`cat $cf_tempfile`
6018 else
6019   echo "configure: failed program was:" >&5
6020   cat conftest.$ac_ext >&5
6021 fi
6022 rm -fr conftest*
6023 fi
6024
6025         rm -f $cf_tempfile
6026
6027 fi
6028
6029 echo "$ac_t""$cf_cv_ncurses_version" 1>&6
6030 test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
6031 #define NCURSES 1
6032 EOF
6033
6034
6035
6036
6037
6038 cf_nculib_root=ncursesw
6039         # This works, except for the special case where we find gpm, but
6040         # ncurses is in a nonstandard location via $LIBS, and we really want
6041         # to link gpm.
6042 cf_ncurses_LIBS=""
6043 cf_ncurses_SAVE="$LIBS"
6044 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
6045 echo "configure:6046: checking for Gpm_Open in -lgpm" >&5
6046 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
6047 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6048   echo $ac_n "(cached) $ac_c" 1>&6
6049 else
6050   ac_save_LIBS="$LIBS"
6051 LIBS="-lgpm  $LIBS"
6052 cat > conftest.$ac_ext <<EOF
6053 #line 6054 "configure"
6054 #include "confdefs.h"
6055 /* Override any gcc2 internal prototype to avoid an error.  */
6056 /* We use char because int might match the return type of a gcc2
6057     builtin and then its argument prototype would still apply.  */
6058 char Gpm_Open();
6059
6060 int main() {
6061 Gpm_Open()
6062 ; return 0; }
6063 EOF
6064 if { (eval echo configure:6065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6065   rm -rf conftest*
6066   eval "ac_cv_lib_$ac_lib_var=yes"
6067 else
6068   echo "configure: failed program was:" >&5
6069   cat conftest.$ac_ext >&5
6070   rm -rf conftest*
6071   eval "ac_cv_lib_$ac_lib_var=no"
6072 fi
6073 rm -f conftest*
6074 LIBS="$ac_save_LIBS"
6075
6076 fi
6077 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6078   echo "$ac_t""yes" 1>&6
6079   echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
6080 echo "configure:6081: checking for initscr in -lgpm" >&5
6081 ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
6082 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6083   echo $ac_n "(cached) $ac_c" 1>&6
6084 else
6085   ac_save_LIBS="$LIBS"
6086 LIBS="-lgpm  $LIBS"
6087 cat > conftest.$ac_ext <<EOF
6088 #line 6089 "configure"
6089 #include "confdefs.h"
6090 /* Override any gcc2 internal prototype to avoid an error.  */
6091 /* We use char because int might match the return type of a gcc2
6092     builtin and then its argument prototype would still apply.  */
6093 char initscr();
6094
6095 int main() {
6096 initscr()
6097 ; return 0; }
6098 EOF
6099 if { (eval echo configure:6100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6100   rm -rf conftest*
6101   eval "ac_cv_lib_$ac_lib_var=yes"
6102 else
6103   echo "configure: failed program was:" >&5
6104   cat conftest.$ac_ext >&5
6105   rm -rf conftest*
6106   eval "ac_cv_lib_$ac_lib_var=no"
6107 fi
6108 rm -f conftest*
6109 LIBS="$ac_save_LIBS"
6110
6111 fi
6112 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6113   echo "$ac_t""yes" 1>&6
6114   LIBS="$cf_ncurses_SAVE"
6115 else
6116   echo "$ac_t""no" 1>&6
6117 cf_ncurses_LIBS="-lgpm"
6118 fi
6119
6120 else
6121   echo "$ac_t""no" 1>&6
6122 fi
6123
6124
6125 case $host_os in #(vi
6126 freebsd*)
6127         # This is only necessary if you are linking against an obsolete
6128         # version of ncurses (but it should do no harm, since it's static).
6129         if test "$cf_nculib_root" = ncurses ; then
6130                 echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
6131 echo "configure:6132: checking for tgoto in -lmytinfo" >&5
6132 ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
6133 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6134   echo $ac_n "(cached) $ac_c" 1>&6
6135 else
6136   ac_save_LIBS="$LIBS"
6137 LIBS="-lmytinfo  $LIBS"
6138 cat > conftest.$ac_ext <<EOF
6139 #line 6140 "configure"
6140 #include "confdefs.h"
6141 /* Override any gcc2 internal prototype to avoid an error.  */
6142 /* We use char because int might match the return type of a gcc2
6143     builtin and then its argument prototype would still apply.  */
6144 char tgoto();
6145
6146 int main() {
6147 tgoto()
6148 ; return 0; }
6149 EOF
6150 if { (eval echo configure:6151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6151   rm -rf conftest*
6152   eval "ac_cv_lib_$ac_lib_var=yes"
6153 else
6154   echo "configure: failed program was:" >&5
6155   cat conftest.$ac_ext >&5
6156   rm -rf conftest*
6157   eval "ac_cv_lib_$ac_lib_var=no"
6158 fi
6159 rm -f conftest*
6160 LIBS="$ac_save_LIBS"
6161
6162 fi
6163 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6164   echo "$ac_t""yes" 1>&6
6165   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6166 else
6167   echo "$ac_t""no" 1>&6
6168 fi
6169
6170         fi
6171         ;;
6172 esac
6173
6174 LIBS="$cf_ncurses_LIBS $LIBS"
6175
6176 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
6177 then
6178         
6179 if test -n "$cf_cv_curses_dir/lib" ; then
6180   for cf_add_libdir in $cf_cv_curses_dir/lib
6181   do
6182     if test $cf_add_libdir = /usr/lib ; then
6183       :
6184     elif test -d $cf_add_libdir
6185     then
6186       cf_have_libdir=no
6187       if test -n "$LDFLAGS$LIBS" ; then
6188         # a loop is needed to ensure we can add subdirs of existing dirs
6189         for cf_test_libdir in $LDFLAGS $LIBS ; do
6190           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6191             cf_have_libdir=yes; break
6192           fi
6193         done
6194       fi
6195       if test "$cf_have_libdir" = no ; then
6196         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6197
6198 echo "${as_me-configure}:6199: testing adding $cf_add_libdir to library-path ..." 1>&5
6199
6200
6201         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6202       fi
6203     fi
6204   done
6205 fi
6206
6207         LIBS="-l$cf_nculib_root $LIBS"
6208 else
6209         
6210         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
6211         cf_libdir=""
6212         echo $ac_n "checking for initscr""... $ac_c" 1>&6
6213 echo "configure:6214: checking for initscr" >&5
6214 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
6215   echo $ac_n "(cached) $ac_c" 1>&6
6216 else
6217   cat > conftest.$ac_ext <<EOF
6218 #line 6219 "configure"
6219 #include "confdefs.h"
6220 /* System header to define __stub macros and hopefully few prototypes,
6221     which can conflict with char initscr(); below.  */
6222 #include <assert.h>
6223 /* Override any gcc2 internal prototype to avoid an error.  */
6224 /* We use char because int might match the return type of a gcc2
6225     builtin and then its argument prototype would still apply.  */
6226 char initscr();
6227
6228 int main() {
6229
6230 /* The GNU C library defines this for functions which it implements
6231     to always fail with ENOSYS.  Some functions are actually named
6232     something starting with __ and the normal name is an alias.  */
6233 #if defined (__stub_initscr) || defined (__stub___initscr)
6234 choke me
6235 #else
6236 initscr();
6237 #endif
6238
6239 ; return 0; }
6240 EOF
6241 if { (eval echo configure:6242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6242   rm -rf conftest*
6243   eval "ac_cv_func_initscr=yes"
6244 else
6245   echo "configure: failed program was:" >&5
6246   cat conftest.$ac_ext >&5
6247   rm -rf conftest*
6248   eval "ac_cv_func_initscr=no"
6249 fi
6250 rm -f conftest*
6251 fi
6252
6253 if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
6254   echo "$ac_t""yes" 1>&6
6255   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6256 else
6257   echo "$ac_t""no" 1>&6
6258
6259                 cf_save_LIBS="$LIBS"
6260                 echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
6261 echo "configure:6262: checking for initscr in -l$cf_nculib_root" >&5
6262                 LIBS="-l$cf_nculib_root $LIBS"
6263                 cat > conftest.$ac_ext <<EOF
6264 #line 6265 "configure"
6265 #include "confdefs.h"
6266 #include <${cf_cv_ncurses_header-curses.h}>
6267 int main() {
6268 initscr()
6269 ; return 0; }
6270 EOF
6271 if { (eval echo configure:6272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6272   rm -rf conftest*
6273   echo "$ac_t""yes" 1>&6
6274                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6275                         
6276 else
6277   echo "configure: failed program was:" >&5
6278   cat conftest.$ac_ext >&5
6279   rm -rf conftest*
6280   echo "$ac_t""no" 1>&6
6281                         
6282 cf_search=
6283 cf_library_path_list=""
6284 if test -n "${LDFLAGS}${LIBS}" ; then
6285         for cf_library_path in $LDFLAGS $LIBS
6286         do
6287                 case $cf_library_path in #(vi
6288                 -L*)
6289                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6290                         
6291 test "$cf_library_path" != "NONE" && \
6292 test -d "$cf_library_path" && \
6293  {
6294         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6295         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6296         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6297         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6298         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6299         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
6300 }
6301
6302                         cf_library_path_list="$cf_library_path_list $cf_search"
6303                         ;;
6304                 esac
6305         done
6306 fi
6307
6308
6309 cf_search=
6310
6311
6312 test "/usr" != "$prefix" && \
6313 test -d "/usr" && \
6314 (test $prefix = NONE || test -d $prefix) && {
6315         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
6316         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
6317         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
6318         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
6319         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
6320         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
6321 }
6322
6323
6324 test "$prefix" != "NONE" && \
6325 test -d "$prefix" && \
6326  {
6327         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6328         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6329         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6330         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6331         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6332         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6333 }
6334
6335
6336 test "/usr/local" != "$prefix" && \
6337 test -d "/usr/local" && \
6338 (test $prefix = NONE || test -d $prefix) && {
6339         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
6340         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
6341         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
6342         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
6343         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
6344         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
6345 }
6346
6347
6348 test "/opt" != "$prefix" && \
6349 test -d "/opt" && \
6350 (test $prefix = NONE || test -d $prefix) && {
6351         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
6352         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
6353         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
6354         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
6355         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
6356         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
6357 }
6358
6359
6360 test "$HOME" != "$prefix" && \
6361 test -d "$HOME" && \
6362 (test $prefix = NONE || test -d $prefix) && {
6363         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
6364         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
6365         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
6366         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
6367         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
6368         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
6369 }
6370
6371
6372
6373 cf_search="$cf_library_path_list $cf_search"
6374
6375                         for cf_libdir in $cf_search
6376                         do
6377                                 echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
6378 echo "configure:6379: checking for -l$cf_nculib_root in $cf_libdir" >&5
6379                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6380                                 cat > conftest.$ac_ext <<EOF
6381 #line 6382 "configure"
6382 #include "confdefs.h"
6383 #include <${cf_cv_ncurses_header-curses.h}>
6384 int main() {
6385 initscr()
6386 ; return 0; }
6387 EOF
6388 if { (eval echo configure:6389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6389   rm -rf conftest*
6390   echo "$ac_t""yes" 1>&6
6391                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6392                                          break
6393 else
6394   echo "configure: failed program was:" >&5
6395   cat conftest.$ac_ext >&5
6396   rm -rf conftest*
6397   echo "$ac_t""no" 1>&6
6398                                          LIBS="$cf_save_LIBS"
6399 fi
6400 rm -f conftest*
6401                         done
6402                         
6403 fi
6404 rm -f conftest*
6405                 
6406 fi
6407
6408 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6409
6410 if test $cf_found_library = no ; then
6411         { echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
6412 fi
6413
6414
6415 fi
6416
6417 if test -n "$cf_ncurses_LIBS" ; then
6418         echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
6419 echo "configure:6420: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6420         cf_ncurses_SAVE="$LIBS"
6421         for p in $cf_ncurses_LIBS ; do
6422                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6423                 if test "$q" != "$LIBS" ; then
6424                         LIBS="$q"
6425                 fi
6426         done
6427         cat > conftest.$ac_ext <<EOF
6428 #line 6429 "configure"
6429 #include "confdefs.h"
6430 #include <${cf_cv_ncurses_header-curses.h}>
6431 int main() {
6432 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6433 ; return 0; }
6434 EOF
6435 if { (eval echo configure:6436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6436   rm -rf conftest*
6437   echo "$ac_t""yes" 1>&6
6438 else
6439   echo "configure: failed program was:" >&5
6440   cat conftest.$ac_ext >&5
6441   rm -rf conftest*
6442   echo "$ac_t""no" 1>&6
6443                  LIBS="$cf_ncurses_SAVE"
6444 fi
6445 rm -f conftest*
6446 fi
6447
6448
6449 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6450
6451 cat >> confdefs.h <<EOF
6452 #define $cf_nculib_ROOT 1
6453 EOF
6454
6455
6456
6457 fi
6458
6459         ;;
6460 pdcurses) #(vi
6461         # If we find X, set shell vars x_includes and x_libraries to the
6462 # paths, otherwise set no_x=yes.
6463 # Uses ac_ vars as temps to allow command line to override cache and checks.
6464 # --without-x overrides everything else, but does not touch the cache.
6465 echo $ac_n "checking for X""... $ac_c" 1>&6
6466 echo "configure:6467: checking for X" >&5
6467
6468
6469 # Check whether --with-x or --without-x was given.
6470 if test "${with_x+set}" = set; then
6471   withval="$with_x"
6472   :
6473 fi
6474
6475 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
6476 if test "x$with_x" = xno; then
6477   # The user explicitly disabled X.
6478   have_x=disabled
6479 else
6480   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
6481     # Both variables are already set.
6482     have_x=yes
6483   else
6484 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
6485   echo $ac_n "(cached) $ac_c" 1>&6
6486 else
6487   # One or both of the vars are not set, and there is no cached value.
6488 ac_x_includes=NO ac_x_libraries=NO
6489 rm -fr conftestdir
6490 if mkdir conftestdir; then
6491   cd conftestdir
6492   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
6493   cat > Imakefile <<'EOF'
6494 acfindx:
6495         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
6496 EOF
6497   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
6498     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
6499     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
6500     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
6501     for ac_extension in a so sl; do
6502       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
6503         test -f $ac_im_libdir/libX11.$ac_extension; then
6504         ac_im_usrlibdir=$ac_im_libdir; break
6505       fi
6506     done
6507     # Screen out bogus values from the imake configuration.  They are
6508     # bogus both because they are the default anyway, and because
6509     # using them would break gcc on systems where it needs fixed includes.
6510     case "$ac_im_incroot" in
6511         /usr/include) ;;
6512         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
6513     esac
6514     case "$ac_im_usrlibdir" in
6515         /usr/lib | /lib) ;;
6516         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
6517     esac
6518   fi
6519   cd ..
6520   rm -fr conftestdir
6521 fi
6522
6523 if test "$ac_x_includes" = NO; then
6524   # Guess where to find include files, by looking for this one X11 .h file.
6525   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
6526
6527   # First, try using that file with no special directory specified.
6528 cat > conftest.$ac_ext <<EOF
6529 #line 6530 "configure"
6530 #include "confdefs.h"
6531 #include <$x_direct_test_include>
6532 EOF
6533 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6534 { (eval echo configure:6535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6535 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6536 if test -z "$ac_err"; then
6537   rm -rf conftest*
6538   # We can compile using X headers with no special include directory.
6539 ac_x_includes=
6540 else
6541   echo "$ac_err" >&5
6542   echo "configure: failed program was:" >&5
6543   cat conftest.$ac_ext >&5
6544   rm -rf conftest*
6545   # Look for the header file in a standard set of common directories.
6546 # Check X11 before X11Rn because it is often a symlink to the current release.
6547   for ac_dir in               \
6548     /usr/X11/include          \
6549     /usr/X11R6/include        \
6550     /usr/X11R5/include        \
6551     /usr/X11R4/include        \
6552                               \
6553     /usr/include/X11          \
6554     /usr/include/X11R6        \
6555     /usr/include/X11R5        \
6556     /usr/include/X11R4        \
6557                               \
6558     /usr/local/X11/include    \
6559     /usr/local/X11R6/include  \
6560     /usr/local/X11R5/include  \
6561     /usr/local/X11R4/include  \
6562                               \
6563     /usr/local/include/X11    \
6564     /usr/local/include/X11R6  \
6565     /usr/local/include/X11R5  \
6566     /usr/local/include/X11R4  \
6567                               \
6568     /usr/X386/include         \
6569     /usr/x386/include         \
6570     /usr/XFree86/include/X11  \
6571                               \
6572     /usr/include              \
6573     /usr/local/include        \
6574     /usr/unsupported/include  \
6575     /usr/athena/include       \
6576     /usr/local/x11r5/include  \
6577     /usr/lpp/Xamples/include  \
6578                               \
6579     /usr/openwin/include      \
6580     /usr/openwin/share/include \
6581     ; \
6582   do
6583     if test -r "$ac_dir/$x_direct_test_include"; then
6584       ac_x_includes=$ac_dir
6585       break
6586     fi
6587   done
6588 fi
6589 rm -f conftest*
6590 fi # $ac_x_includes = NO
6591
6592 if test "$ac_x_libraries" = NO; then
6593   # Check for the libraries.
6594
6595   test -z "$x_direct_test_library" && x_direct_test_library=Xt
6596   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
6597
6598   # See if we find them without any special options.
6599   # Don't add to $LIBS permanently.
6600   ac_save_LIBS="$LIBS"
6601   LIBS="-l$x_direct_test_library $LIBS"
6602 cat > conftest.$ac_ext <<EOF
6603 #line 6604 "configure"
6604 #include "confdefs.h"
6605
6606 int main() {
6607 ${x_direct_test_function}()
6608 ; return 0; }
6609 EOF
6610 if { (eval echo configure:6611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6611   rm -rf conftest*
6612   LIBS="$ac_save_LIBS"
6613 # We can link X programs with no special library path.
6614 ac_x_libraries=
6615 else
6616   echo "configure: failed program was:" >&5
6617   cat conftest.$ac_ext >&5
6618   rm -rf conftest*
6619   LIBS="$ac_save_LIBS"
6620 # First see if replacing the include by lib works.
6621 # Check X11 before X11Rn because it is often a symlink to the current release.
6622 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
6623     /usr/X11/lib          \
6624     /usr/X11R6/lib        \
6625     /usr/X11R5/lib        \
6626     /usr/X11R4/lib        \
6627                           \
6628     /usr/lib/X11          \
6629     /usr/lib/X11R6        \
6630     /usr/lib/X11R5        \
6631     /usr/lib/X11R4        \
6632                           \
6633     /usr/local/X11/lib    \
6634     /usr/local/X11R6/lib  \
6635     /usr/local/X11R5/lib  \
6636     /usr/local/X11R4/lib  \
6637                           \
6638     /usr/local/lib/X11    \
6639     /usr/local/lib/X11R6  \
6640     /usr/local/lib/X11R5  \
6641     /usr/local/lib/X11R4  \
6642                           \
6643     /usr/X386/lib         \
6644     /usr/x386/lib         \
6645     /usr/XFree86/lib/X11  \
6646                           \
6647     /usr/lib              \
6648     /usr/local/lib        \
6649     /usr/unsupported/lib  \
6650     /usr/athena/lib       \
6651     /usr/local/x11r5/lib  \
6652     /usr/lpp/Xamples/lib  \
6653     /lib/usr/lib/X11      \
6654                           \
6655     /usr/openwin/lib      \
6656     /usr/openwin/share/lib \
6657     ; \
6658 do
6659   for ac_extension in a so sl; do
6660     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
6661       ac_x_libraries=$ac_dir
6662       break 2
6663     fi
6664   done
6665 done
6666 fi
6667 rm -f conftest*
6668 fi # $ac_x_libraries = NO
6669
6670 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
6671   # Didn't find X anywhere.  Cache the known absence of X.
6672   ac_cv_have_x="have_x=no"
6673 else
6674   # Record where we found X for the cache.
6675   ac_cv_have_x="have_x=yes \
6676                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
6677 fi
6678 fi
6679   fi
6680   eval "$ac_cv_have_x"
6681 fi # $with_x != no
6682
6683 if test "$have_x" != yes; then
6684   echo "$ac_t""$have_x" 1>&6
6685   no_x=yes
6686 else
6687   # If each of the values was on the command line, it overrides each guess.
6688   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
6689   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
6690   # Update the cache value to reflect the command line values.
6691   ac_cv_have_x="have_x=yes \
6692                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
6693   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
6694 fi
6695
6696
6697 echo $ac_n "checking if you want to use pkg-config""... $ac_c" 1>&6
6698 echo "configure:6699: checking if you want to use pkg-config" >&5
6699
6700 # Check whether --with-pkg-config or --without-pkg-config was given.
6701 if test "${with_pkg_config+set}" = set; then
6702   withval="$with_pkg_config"
6703   cf_pkg_config=$withval
6704 else
6705   cf_pkg_config=yes
6706 fi
6707
6708 echo "$ac_t""$cf_pkg_config" 1>&6
6709
6710 case $cf_pkg_config in #(vi
6711 no) #(vi
6712         PKG_CONFIG=none
6713         ;;
6714 yes) #(vi
6715         # Extract the first word of "pkg-config", so it can be a program name with args.
6716 set dummy pkg-config; ac_word=$2
6717 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6718 echo "configure:6719: checking for $ac_word" >&5
6719 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
6720   echo $ac_n "(cached) $ac_c" 1>&6
6721 else
6722   case "$PKG_CONFIG" in
6723   /*)
6724   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
6725   ;;
6726   ?:/*)                  
6727   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
6728   ;;
6729   *)
6730   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6731   ac_dummy="$PATH"
6732   for ac_dir in $ac_dummy; do 
6733     test -z "$ac_dir" && ac_dir=.
6734     if test -f $ac_dir/$ac_word; then
6735       ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
6736       break
6737     fi
6738   done
6739   IFS="$ac_save_ifs"
6740   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
6741   ;;
6742 esac
6743 fi
6744 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
6745 if test -n "$PKG_CONFIG"; then
6746   echo "$ac_t""$PKG_CONFIG" 1>&6
6747 else
6748   echo "$ac_t""no" 1>&6
6749 fi
6750
6751         ;;
6752 *)
6753         PKG_CONFIG=$withval
6754         ;;
6755 esac
6756
6757 test -z "$PKG_CONFIG" && PKG_CONFIG=none
6758 if test "$PKG_CONFIG" != none ; then
6759         
6760 if test "x$prefix" != xNONE; then
6761   cf_path_syntax="$prefix"
6762 else
6763   cf_path_syntax="$ac_default_prefix"
6764 fi
6765
6766 case ".$PKG_CONFIG" in #(vi
6767 .\$\(*\)*|.\'*\'*) #(vi
6768   ;;
6769 ..|./*|.\\*) #(vi
6770   ;;
6771 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
6772   ;;
6773 .\${*prefix}*) #(vi
6774   eval PKG_CONFIG="$PKG_CONFIG"
6775   case ".$PKG_CONFIG" in #(vi
6776   .NONE/*)
6777     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
6778     ;;
6779   esac
6780   ;; #(vi
6781 .no|.NONE/*)
6782   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
6783   ;;
6784 *)
6785   { echo "configure: error: expected a pathname, not \"$PKG_CONFIG\"" 1>&2; exit 1; }
6786   ;;
6787 esac
6788
6789 fi
6790
6791
6792
6793 if test "$no_x" = yes; then
6794   # Not all programs may use this symbol, but it does not hurt to define it.
6795   cat >> confdefs.h <<\EOF
6796 #define X_DISPLAY_MISSING 1
6797 EOF
6798
6799   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
6800 else
6801   if test -n "$x_includes"; then
6802     X_CFLAGS="$X_CFLAGS -I$x_includes"
6803   fi
6804
6805   # It would also be nice to do this for all -L options, not just this one.
6806   if test -n "$x_libraries"; then
6807     X_LIBS="$X_LIBS -L$x_libraries"
6808     # For Solaris; some versions of Sun CC require a space after -R and
6809     # others require no space.  Words are not sufficient . . . .
6810     case "`(uname -sr) 2>/dev/null`" in
6811     "SunOS 5"*)
6812       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
6813 echo "configure:6814: checking whether -R must be followed by a space" >&5
6814       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
6815       cat > conftest.$ac_ext <<EOF
6816 #line 6817 "configure"
6817 #include "confdefs.h"
6818
6819 int main() {
6820
6821 ; return 0; }
6822 EOF
6823 if { (eval echo configure:6824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6824   rm -rf conftest*
6825   ac_R_nospace=yes
6826 else
6827   echo "configure: failed program was:" >&5
6828   cat conftest.$ac_ext >&5
6829   rm -rf conftest*
6830   ac_R_nospace=no
6831 fi
6832 rm -f conftest*
6833       if test $ac_R_nospace = yes; then
6834         echo "$ac_t""no" 1>&6
6835         X_LIBS="$X_LIBS -R$x_libraries"
6836       else
6837         LIBS="$ac_xsave_LIBS -R $x_libraries"
6838         cat > conftest.$ac_ext <<EOF
6839 #line 6840 "configure"
6840 #include "confdefs.h"
6841
6842 int main() {
6843
6844 ; return 0; }
6845 EOF
6846 if { (eval echo configure:6847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6847   rm -rf conftest*
6848   ac_R_space=yes
6849 else
6850   echo "configure: failed program was:" >&5
6851   cat conftest.$ac_ext >&5
6852   rm -rf conftest*
6853   ac_R_space=no
6854 fi
6855 rm -f conftest*
6856         if test $ac_R_space = yes; then
6857           echo "$ac_t""yes" 1>&6
6858           X_LIBS="$X_LIBS -R $x_libraries"
6859         else
6860           echo "$ac_t""neither works" 1>&6
6861         fi
6862       fi
6863       LIBS="$ac_xsave_LIBS"
6864     esac
6865   fi
6866
6867   # Check for system-dependent libraries X programs must link with.
6868   # Do this before checking for the system-independent R6 libraries
6869   # (-lICE), since we may need -lsocket or whatever for X linking.
6870
6871   if test "$ISC" = yes; then
6872     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
6873   else
6874     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
6875     # libraries were built with DECnet support.  And karl@cs.umb.edu says
6876     # the Alpha needs dnet_stub (dnet does not exist).
6877     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
6878 echo "configure:6879: checking for dnet_ntoa in -ldnet" >&5
6879 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
6880 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6881   echo $ac_n "(cached) $ac_c" 1>&6
6882 else
6883   ac_save_LIBS="$LIBS"
6884 LIBS="-ldnet  $LIBS"
6885 cat > conftest.$ac_ext <<EOF
6886 #line 6887 "configure"
6887 #include "confdefs.h"
6888 /* Override any gcc2 internal prototype to avoid an error.  */
6889 /* We use char because int might match the return type of a gcc2
6890     builtin and then its argument prototype would still apply.  */
6891 char dnet_ntoa();
6892
6893 int main() {
6894 dnet_ntoa()
6895 ; return 0; }
6896 EOF
6897 if { (eval echo configure:6898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6898   rm -rf conftest*
6899   eval "ac_cv_lib_$ac_lib_var=yes"
6900 else
6901   echo "configure: failed program was:" >&5
6902   cat conftest.$ac_ext >&5
6903   rm -rf conftest*
6904   eval "ac_cv_lib_$ac_lib_var=no"
6905 fi
6906 rm -f conftest*
6907 LIBS="$ac_save_LIBS"
6908
6909 fi
6910 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6911   echo "$ac_t""yes" 1>&6
6912   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
6913 else
6914   echo "$ac_t""no" 1>&6
6915 fi
6916
6917     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
6918       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
6919 echo "configure:6920: checking for dnet_ntoa in -ldnet_stub" >&5
6920 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
6921 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6922   echo $ac_n "(cached) $ac_c" 1>&6
6923 else
6924   ac_save_LIBS="$LIBS"
6925 LIBS="-ldnet_stub  $LIBS"
6926 cat > conftest.$ac_ext <<EOF
6927 #line 6928 "configure"
6928 #include "confdefs.h"
6929 /* Override any gcc2 internal prototype to avoid an error.  */
6930 /* We use char because int might match the return type of a gcc2
6931     builtin and then its argument prototype would still apply.  */
6932 char dnet_ntoa();
6933
6934 int main() {
6935 dnet_ntoa()
6936 ; return 0; }
6937 EOF
6938 if { (eval echo configure:6939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6939   rm -rf conftest*
6940   eval "ac_cv_lib_$ac_lib_var=yes"
6941 else
6942   echo "configure: failed program was:" >&5
6943   cat conftest.$ac_ext >&5
6944   rm -rf conftest*
6945   eval "ac_cv_lib_$ac_lib_var=no"
6946 fi
6947 rm -f conftest*
6948 LIBS="$ac_save_LIBS"
6949
6950 fi
6951 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6952   echo "$ac_t""yes" 1>&6
6953   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
6954 else
6955   echo "$ac_t""no" 1>&6
6956 fi
6957
6958     fi
6959
6960     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
6961     # to get the SysV transport functions.
6962     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
6963     # needs -lnsl.
6964     # The nsl library prevents programs from opening the X display
6965     # on Irix 5.2, according to dickey@clark.net.
6966     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
6967 echo "configure:6968: checking for gethostbyname" >&5
6968 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
6969   echo $ac_n "(cached) $ac_c" 1>&6
6970 else
6971   cat > conftest.$ac_ext <<EOF
6972 #line 6973 "configure"
6973 #include "confdefs.h"
6974 /* System header to define __stub macros and hopefully few prototypes,
6975     which can conflict with char gethostbyname(); below.  */
6976 #include <assert.h>
6977 /* Override any gcc2 internal prototype to avoid an error.  */
6978 /* We use char because int might match the return type of a gcc2
6979     builtin and then its argument prototype would still apply.  */
6980 char gethostbyname();
6981
6982 int main() {
6983
6984 /* The GNU C library defines this for functions which it implements
6985     to always fail with ENOSYS.  Some functions are actually named
6986     something starting with __ and the normal name is an alias.  */
6987 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
6988 choke me
6989 #else
6990 gethostbyname();
6991 #endif
6992
6993 ; return 0; }
6994 EOF
6995 if { (eval echo configure:6996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6996   rm -rf conftest*
6997   eval "ac_cv_func_gethostbyname=yes"
6998 else
6999   echo "configure: failed program was:" >&5
7000   cat conftest.$ac_ext >&5
7001   rm -rf conftest*
7002   eval "ac_cv_func_gethostbyname=no"
7003 fi
7004 rm -f conftest*
7005 fi
7006
7007 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
7008   echo "$ac_t""yes" 1>&6
7009   :
7010 else
7011   echo "$ac_t""no" 1>&6
7012 fi
7013
7014     if test $ac_cv_func_gethostbyname = no; then
7015       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
7016 echo "configure:7017: checking for gethostbyname in -lnsl" >&5
7017 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
7018 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7019   echo $ac_n "(cached) $ac_c" 1>&6
7020 else
7021   ac_save_LIBS="$LIBS"
7022 LIBS="-lnsl  $LIBS"
7023 cat > conftest.$ac_ext <<EOF
7024 #line 7025 "configure"
7025 #include "confdefs.h"
7026 /* Override any gcc2 internal prototype to avoid an error.  */
7027 /* We use char because int might match the return type of a gcc2
7028     builtin and then its argument prototype would still apply.  */
7029 char gethostbyname();
7030
7031 int main() {
7032 gethostbyname()
7033 ; return 0; }
7034 EOF
7035 if { (eval echo configure:7036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7036   rm -rf conftest*
7037   eval "ac_cv_lib_$ac_lib_var=yes"
7038 else
7039   echo "configure: failed program was:" >&5
7040   cat conftest.$ac_ext >&5
7041   rm -rf conftest*
7042   eval "ac_cv_lib_$ac_lib_var=no"
7043 fi
7044 rm -f conftest*
7045 LIBS="$ac_save_LIBS"
7046
7047 fi
7048 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7049   echo "$ac_t""yes" 1>&6
7050   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
7051 else
7052   echo "$ac_t""no" 1>&6
7053 fi
7054
7055     fi
7056
7057     # lieder@skyler.mavd.honeywell.com says without -lsocket,
7058     # socket/setsockopt and other routines are undefined under SCO ODT
7059     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
7060     # on later versions), says simon@lia.di.epfl.ch: it contains
7061     # gethostby* variants that don't use the nameserver (or something).
7062     # -lsocket must be given before -lnsl if both are needed.
7063     # We assume that if connect needs -lnsl, so does gethostbyname.
7064     echo $ac_n "checking for connect""... $ac_c" 1>&6
7065 echo "configure:7066: checking for connect" >&5
7066 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
7067   echo $ac_n "(cached) $ac_c" 1>&6
7068 else
7069   cat > conftest.$ac_ext <<EOF
7070 #line 7071 "configure"
7071 #include "confdefs.h"
7072 /* System header to define __stub macros and hopefully few prototypes,
7073     which can conflict with char connect(); below.  */
7074 #include <assert.h>
7075 /* Override any gcc2 internal prototype to avoid an error.  */
7076 /* We use char because int might match the return type of a gcc2
7077     builtin and then its argument prototype would still apply.  */
7078 char connect();
7079
7080 int main() {
7081
7082 /* The GNU C library defines this for functions which it implements
7083     to always fail with ENOSYS.  Some functions are actually named
7084     something starting with __ and the normal name is an alias.  */
7085 #if defined (__stub_connect) || defined (__stub___connect)
7086 choke me
7087 #else
7088 connect();
7089 #endif
7090
7091 ; return 0; }
7092 EOF
7093 if { (eval echo configure:7094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7094   rm -rf conftest*
7095   eval "ac_cv_func_connect=yes"
7096 else
7097   echo "configure: failed program was:" >&5
7098   cat conftest.$ac_ext >&5
7099   rm -rf conftest*
7100   eval "ac_cv_func_connect=no"
7101 fi
7102 rm -f conftest*
7103 fi
7104
7105 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
7106   echo "$ac_t""yes" 1>&6
7107   :
7108 else
7109   echo "$ac_t""no" 1>&6
7110 fi
7111
7112     if test $ac_cv_func_connect = no; then
7113       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
7114 echo "configure:7115: checking for connect in -lsocket" >&5
7115 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
7116 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7117   echo $ac_n "(cached) $ac_c" 1>&6
7118 else
7119   ac_save_LIBS="$LIBS"
7120 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
7121 cat > conftest.$ac_ext <<EOF
7122 #line 7123 "configure"
7123 #include "confdefs.h"
7124 /* Override any gcc2 internal prototype to avoid an error.  */
7125 /* We use char because int might match the return type of a gcc2
7126     builtin and then its argument prototype would still apply.  */
7127 char connect();
7128
7129 int main() {
7130 connect()
7131 ; return 0; }
7132 EOF
7133 if { (eval echo configure:7134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7134   rm -rf conftest*
7135   eval "ac_cv_lib_$ac_lib_var=yes"
7136 else
7137   echo "configure: failed program was:" >&5
7138   cat conftest.$ac_ext >&5
7139   rm -rf conftest*
7140   eval "ac_cv_lib_$ac_lib_var=no"
7141 fi
7142 rm -f conftest*
7143 LIBS="$ac_save_LIBS"
7144
7145 fi
7146 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7147   echo "$ac_t""yes" 1>&6
7148   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
7149 else
7150   echo "$ac_t""no" 1>&6
7151 fi
7152
7153     fi
7154
7155     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
7156     echo $ac_n "checking for remove""... $ac_c" 1>&6
7157 echo "configure:7158: checking for remove" >&5
7158 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
7159   echo $ac_n "(cached) $ac_c" 1>&6
7160 else
7161   cat > conftest.$ac_ext <<EOF
7162 #line 7163 "configure"
7163 #include "confdefs.h"
7164 /* System header to define __stub macros and hopefully few prototypes,
7165     which can conflict with char remove(); below.  */
7166 #include <assert.h>
7167 /* Override any gcc2 internal prototype to avoid an error.  */
7168 /* We use char because int might match the return type of a gcc2
7169     builtin and then its argument prototype would still apply.  */
7170 char remove();
7171
7172 int main() {
7173
7174 /* The GNU C library defines this for functions which it implements
7175     to always fail with ENOSYS.  Some functions are actually named
7176     something starting with __ and the normal name is an alias.  */
7177 #if defined (__stub_remove) || defined (__stub___remove)
7178 choke me
7179 #else
7180 remove();
7181 #endif
7182
7183 ; return 0; }
7184 EOF
7185 if { (eval echo configure:7186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7186   rm -rf conftest*
7187   eval "ac_cv_func_remove=yes"
7188 else
7189   echo "configure: failed program was:" >&5
7190   cat conftest.$ac_ext >&5
7191   rm -rf conftest*
7192   eval "ac_cv_func_remove=no"
7193 fi
7194 rm -f conftest*
7195 fi
7196
7197 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
7198   echo "$ac_t""yes" 1>&6
7199   :
7200 else
7201   echo "$ac_t""no" 1>&6
7202 fi
7203
7204     if test $ac_cv_func_remove = no; then
7205       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
7206 echo "configure:7207: checking for remove in -lposix" >&5
7207 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
7208 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7209   echo $ac_n "(cached) $ac_c" 1>&6
7210 else
7211   ac_save_LIBS="$LIBS"
7212 LIBS="-lposix  $LIBS"
7213 cat > conftest.$ac_ext <<EOF
7214 #line 7215 "configure"
7215 #include "confdefs.h"
7216 /* Override any gcc2 internal prototype to avoid an error.  */
7217 /* We use char because int might match the return type of a gcc2
7218     builtin and then its argument prototype would still apply.  */
7219 char remove();
7220
7221 int main() {
7222 remove()
7223 ; return 0; }
7224 EOF
7225 if { (eval echo configure:7226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7226   rm -rf conftest*
7227   eval "ac_cv_lib_$ac_lib_var=yes"
7228 else
7229   echo "configure: failed program was:" >&5
7230   cat conftest.$ac_ext >&5
7231   rm -rf conftest*
7232   eval "ac_cv_lib_$ac_lib_var=no"
7233 fi
7234 rm -f conftest*
7235 LIBS="$ac_save_LIBS"
7236
7237 fi
7238 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7239   echo "$ac_t""yes" 1>&6
7240   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
7241 else
7242   echo "$ac_t""no" 1>&6
7243 fi
7244
7245     fi
7246
7247     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
7248     echo $ac_n "checking for shmat""... $ac_c" 1>&6
7249 echo "configure:7250: checking for shmat" >&5
7250 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
7251   echo $ac_n "(cached) $ac_c" 1>&6
7252 else
7253   cat > conftest.$ac_ext <<EOF
7254 #line 7255 "configure"
7255 #include "confdefs.h"
7256 /* System header to define __stub macros and hopefully few prototypes,
7257     which can conflict with char shmat(); below.  */
7258 #include <assert.h>
7259 /* Override any gcc2 internal prototype to avoid an error.  */
7260 /* We use char because int might match the return type of a gcc2
7261     builtin and then its argument prototype would still apply.  */
7262 char shmat();
7263
7264 int main() {
7265
7266 /* The GNU C library defines this for functions which it implements
7267     to always fail with ENOSYS.  Some functions are actually named
7268     something starting with __ and the normal name is an alias.  */
7269 #if defined (__stub_shmat) || defined (__stub___shmat)
7270 choke me
7271 #else
7272 shmat();
7273 #endif
7274
7275 ; return 0; }
7276 EOF
7277 if { (eval echo configure:7278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7278   rm -rf conftest*
7279   eval "ac_cv_func_shmat=yes"
7280 else
7281   echo "configure: failed program was:" >&5
7282   cat conftest.$ac_ext >&5
7283   rm -rf conftest*
7284   eval "ac_cv_func_shmat=no"
7285 fi
7286 rm -f conftest*
7287 fi
7288
7289 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
7290   echo "$ac_t""yes" 1>&6
7291   :
7292 else
7293   echo "$ac_t""no" 1>&6
7294 fi
7295
7296     if test $ac_cv_func_shmat = no; then
7297       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
7298 echo "configure:7299: checking for shmat in -lipc" >&5
7299 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
7300 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7301   echo $ac_n "(cached) $ac_c" 1>&6
7302 else
7303   ac_save_LIBS="$LIBS"
7304 LIBS="-lipc  $LIBS"
7305 cat > conftest.$ac_ext <<EOF
7306 #line 7307 "configure"
7307 #include "confdefs.h"
7308 /* Override any gcc2 internal prototype to avoid an error.  */
7309 /* We use char because int might match the return type of a gcc2
7310     builtin and then its argument prototype would still apply.  */
7311 char shmat();
7312
7313 int main() {
7314 shmat()
7315 ; return 0; }
7316 EOF
7317 if { (eval echo configure:7318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7318   rm -rf conftest*
7319   eval "ac_cv_lib_$ac_lib_var=yes"
7320 else
7321   echo "configure: failed program was:" >&5
7322   cat conftest.$ac_ext >&5
7323   rm -rf conftest*
7324   eval "ac_cv_lib_$ac_lib_var=no"
7325 fi
7326 rm -f conftest*
7327 LIBS="$ac_save_LIBS"
7328
7329 fi
7330 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7331   echo "$ac_t""yes" 1>&6
7332   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
7333 else
7334   echo "$ac_t""no" 1>&6
7335 fi
7336
7337     fi
7338   fi
7339
7340   # Check for libraries that X11R6 Xt/Xaw programs need.
7341   ac_save_LDFLAGS="$LDFLAGS"
7342   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
7343   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
7344   # check for ICE first), but we must link in the order -lSM -lICE or
7345   # we get undefined symbols.  So assume we have SM if we have ICE.
7346   # These have to be linked with before -lX11, unlike the other
7347   # libraries we check for below, so use a different variable.
7348   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
7349   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
7350 echo "configure:7351: checking for IceConnectionNumber in -lICE" >&5
7351 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
7352 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7353   echo $ac_n "(cached) $ac_c" 1>&6
7354 else
7355   ac_save_LIBS="$LIBS"
7356 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
7357 cat > conftest.$ac_ext <<EOF
7358 #line 7359 "configure"
7359 #include "confdefs.h"
7360 /* Override any gcc2 internal prototype to avoid an error.  */
7361 /* We use char because int might match the return type of a gcc2
7362     builtin and then its argument prototype would still apply.  */
7363 char IceConnectionNumber();
7364
7365 int main() {
7366 IceConnectionNumber()
7367 ; return 0; }
7368 EOF
7369 if { (eval echo configure:7370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7370   rm -rf conftest*
7371   eval "ac_cv_lib_$ac_lib_var=yes"
7372 else
7373   echo "configure: failed program was:" >&5
7374   cat conftest.$ac_ext >&5
7375   rm -rf conftest*
7376   eval "ac_cv_lib_$ac_lib_var=no"
7377 fi
7378 rm -f conftest*
7379 LIBS="$ac_save_LIBS"
7380
7381 fi
7382 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7383   echo "$ac_t""yes" 1>&6
7384   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
7385 else
7386   echo "$ac_t""no" 1>&6
7387 fi
7388
7389   LDFLAGS="$ac_save_LDFLAGS"
7390
7391 fi
7392
7393
7394 cf_x_athena=${cf_x_athena-Xaw}
7395
7396 echo $ac_n "checking if you want to link with Xaw 3d library""... $ac_c" 1>&6
7397 echo "configure:7398: checking if you want to link with Xaw 3d library" >&5
7398 withval=
7399
7400 # Check whether --with-Xaw3d or --without-Xaw3d was given.
7401 if test "${with_Xaw3d+set}" = set; then
7402   withval="$with_Xaw3d"
7403   :
7404 fi
7405
7406 if test "$withval" = yes ; then
7407         cf_x_athena=Xaw3d
7408         echo "$ac_t""yes" 1>&6
7409 else
7410         echo "$ac_t""no" 1>&6
7411 fi
7412
7413 echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6
7414 echo "configure:7415: checking if you want to link with neXT Athena library" >&5
7415 withval=
7416
7417 # Check whether --with-neXtaw or --without-neXtaw was given.
7418 if test "${with_neXtaw+set}" = set; then
7419   withval="$with_neXtaw"
7420   :
7421 fi
7422
7423 if test "$withval" = yes ; then
7424         cf_x_athena=neXtaw
7425         echo "$ac_t""yes" 1>&6
7426 else
7427         echo "$ac_t""no" 1>&6
7428 fi
7429
7430 echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6
7431 echo "configure:7432: checking if you want to link with Athena-Plus library" >&5
7432 withval=
7433
7434 # Check whether --with-XawPlus or --without-XawPlus was given.
7435 if test "${with_XawPlus+set}" = set; then
7436   withval="$with_XawPlus"
7437   :
7438 fi
7439
7440 if test "$withval" = yes ; then
7441         cf_x_athena=XawPlus
7442         echo "$ac_t""yes" 1>&6
7443 else
7444         echo "$ac_t""no" 1>&6
7445 fi
7446
7447 cf_x_athena_lib=""
7448
7449 if test "$PKG_CONFIG" != none ; then
7450         cf_athena_list=
7451         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
7452         for cf_athena_pkg in \
7453                 $cf_athena_list \
7454                 ${cf_x_athena} \
7455                 ${cf_x_athena}-devel \
7456                 lib${cf_x_athena} \
7457                 lib${cf_x_athena}-devel
7458         do
7459                 if "$PKG_CONFIG" --exists $cf_athena_pkg; then
7460                         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
7461
7462 echo "${as_me-configure}:7463: testing found package $cf_athena_pkg ..." 1>&5
7463
7464
7465                         cf_x_athena_inc="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
7466                         cf_x_athena_lib="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
7467                         
7468 cf_fix_cppflags=no
7469 cf_new_cflags=
7470 cf_new_cppflags=
7471 cf_new_extra_cppflags=
7472
7473 for cf_add_cflags in $cf_x_athena_inc
7474 do
7475 case $cf_fix_cppflags in
7476 no)
7477         case $cf_add_cflags in #(vi
7478         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
7479                 case $cf_add_cflags in
7480                 -D*)
7481                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7482
7483                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7484                                 && test -z "${cf_tst_cflags}" \
7485                                 && cf_fix_cppflags=yes
7486
7487                         if test $cf_fix_cppflags = yes ; then
7488                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7489                                 continue
7490                         elif test "${cf_tst_cflags}" = "\"'" ; then
7491                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7492                                 continue
7493                         fi
7494                         ;;
7495                 esac
7496                 case "$CPPFLAGS" in
7497                 *$cf_add_cflags) #(vi
7498                         ;;
7499                 *) #(vi
7500                         case $cf_add_cflags in #(vi
7501                         -D*)
7502                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7503                                 
7504 CPPFLAGS=`echo "$CPPFLAGS" | \
7505         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7506                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7507
7508                                 ;;
7509                         esac
7510                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
7511                         ;;
7512                 esac
7513                 ;;
7514         *)
7515                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
7516                 ;;
7517         esac
7518         ;;
7519 yes)
7520         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7521
7522         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7523
7524         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7525                 && test -z "${cf_tst_cflags}" \
7526                 && cf_fix_cppflags=no
7527         ;;
7528 esac
7529 done
7530
7531 if test -n "$cf_new_cflags" ; then
7532         
7533         CFLAGS="$CFLAGS $cf_new_cflags"
7534 fi
7535
7536 if test -n "$cf_new_cppflags" ; then
7537         
7538         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
7539 fi
7540
7541 if test -n "$cf_new_extra_cppflags" ; then
7542         
7543         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
7544 fi
7545
7546
7547
7548
7549                         LIBS="$cf_x_athena_lib $LIBS"
7550
7551                         
7552 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7553
7554                         cat >> confdefs.h <<EOF
7555 #define $cf_x_athena_LIBS 1
7556 EOF
7557
7558                         break
7559                 fi
7560         done
7561 fi
7562
7563 if test -z "$cf_x_athena_lib" ; then
7564         
7565
7566
7567
7568 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
7569         test -n "$verbose" && echo "    found package Xext" 1>&6
7570
7571 echo "${as_me-configure}:7572: testing found package Xext ..." 1>&5
7572
7573
7574         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
7575         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
7576         
7577 cf_fix_cppflags=no
7578 cf_new_cflags=
7579 cf_new_cppflags=
7580 cf_new_extra_cppflags=
7581
7582 for cf_add_cflags in $cf_pkgconfig_incs
7583 do
7584 case $cf_fix_cppflags in
7585 no)
7586         case $cf_add_cflags in #(vi
7587         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
7588                 case $cf_add_cflags in
7589                 -D*)
7590                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7591
7592                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7593                                 && test -z "${cf_tst_cflags}" \
7594                                 && cf_fix_cppflags=yes
7595
7596                         if test $cf_fix_cppflags = yes ; then
7597                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7598                                 continue
7599                         elif test "${cf_tst_cflags}" = "\"'" ; then
7600                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7601                                 continue
7602                         fi
7603                         ;;
7604                 esac
7605                 case "$CPPFLAGS" in
7606                 *$cf_add_cflags) #(vi
7607                         ;;
7608                 *) #(vi
7609                         case $cf_add_cflags in #(vi
7610                         -D*)
7611                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7612                                 
7613 CPPFLAGS=`echo "$CPPFLAGS" | \
7614         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7615                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7616
7617                                 ;;
7618                         esac
7619                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
7620                         ;;
7621                 esac
7622                 ;;
7623         *)
7624                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
7625                 ;;
7626         esac
7627         ;;
7628 yes)
7629         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7630
7631         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7632
7633         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7634                 && test -z "${cf_tst_cflags}" \
7635                 && cf_fix_cppflags=no
7636         ;;
7637 esac
7638 done
7639
7640 if test -n "$cf_new_cflags" ; then
7641         
7642         CFLAGS="$CFLAGS $cf_new_cflags"
7643 fi
7644
7645 if test -n "$cf_new_cppflags" ; then
7646         
7647         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
7648 fi
7649
7650 if test -n "$cf_new_extra_cppflags" ; then
7651         
7652         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
7653 fi
7654
7655
7656
7657
7658         LIBS="$cf_pkgconfig_libs $LIBS"
7659         :
7660 else
7661         
7662         echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
7663 echo "configure:7664: checking for XextCreateExtension in -lXext" >&5
7664 ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'`
7665 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7666   echo $ac_n "(cached) $ac_c" 1>&6
7667 else
7668   ac_save_LIBS="$LIBS"
7669 LIBS="-lXext  $LIBS"
7670 cat > conftest.$ac_ext <<EOF
7671 #line 7672 "configure"
7672 #include "confdefs.h"
7673 /* Override any gcc2 internal prototype to avoid an error.  */
7674 /* We use char because int might match the return type of a gcc2
7675     builtin and then its argument prototype would still apply.  */
7676 char XextCreateExtension();
7677
7678 int main() {
7679 XextCreateExtension()
7680 ; return 0; }
7681 EOF
7682 if { (eval echo configure:7683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7683   rm -rf conftest*
7684   eval "ac_cv_lib_$ac_lib_var=yes"
7685 else
7686   echo "configure: failed program was:" >&5
7687   cat conftest.$ac_ext >&5
7688   rm -rf conftest*
7689   eval "ac_cv_lib_$ac_lib_var=no"
7690 fi
7691 rm -f conftest*
7692 LIBS="$ac_save_LIBS"
7693
7694 fi
7695 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7696   echo "$ac_t""yes" 1>&6
7697   LIBS="-lXext $LIBS"
7698 else
7699   echo "$ac_t""no" 1>&6
7700 fi
7701
7702 fi
7703
7704
7705         
7706
7707
7708
7709 cf_have_X_LIBS=no
7710
7711
7712
7713
7714 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
7715         test -n "$verbose" && echo "    found package xt" 1>&6
7716
7717 echo "${as_me-configure}:7718: testing found package xt ..." 1>&5
7718
7719
7720         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
7721         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
7722         
7723 cf_fix_cppflags=no
7724 cf_new_cflags=
7725 cf_new_cppflags=
7726 cf_new_extra_cppflags=
7727
7728 for cf_add_cflags in $cf_pkgconfig_incs
7729 do
7730 case $cf_fix_cppflags in
7731 no)
7732         case $cf_add_cflags in #(vi
7733         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
7734                 case $cf_add_cflags in
7735                 -D*)
7736                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7737
7738                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7739                                 && test -z "${cf_tst_cflags}" \
7740                                 && cf_fix_cppflags=yes
7741
7742                         if test $cf_fix_cppflags = yes ; then
7743                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7744                                 continue
7745                         elif test "${cf_tst_cflags}" = "\"'" ; then
7746                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7747                                 continue
7748                         fi
7749                         ;;
7750                 esac
7751                 case "$CPPFLAGS" in
7752                 *$cf_add_cflags) #(vi
7753                         ;;
7754                 *) #(vi
7755                         case $cf_add_cflags in #(vi
7756                         -D*)
7757                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7758                                 
7759 CPPFLAGS=`echo "$CPPFLAGS" | \
7760         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7761                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7762
7763                                 ;;
7764                         esac
7765                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
7766                         ;;
7767                 esac
7768                 ;;
7769         *)
7770                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
7771                 ;;
7772         esac
7773         ;;
7774 yes)
7775         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7776
7777         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7778
7779         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7780                 && test -z "${cf_tst_cflags}" \
7781                 && cf_fix_cppflags=no
7782         ;;
7783 esac
7784 done
7785
7786 if test -n "$cf_new_cflags" ; then
7787         
7788         CFLAGS="$CFLAGS $cf_new_cflags"
7789 fi
7790
7791 if test -n "$cf_new_cppflags" ; then
7792         
7793         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
7794 fi
7795
7796 if test -n "$cf_new_extra_cppflags" ; then
7797         
7798         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
7799 fi
7800
7801
7802
7803
7804         LIBS="$cf_pkgconfig_libs $LIBS"
7805         
7806         cf_have_X_LIBS=yes
7807
7808 else
7809         
7810
7811         LDFLAGS="$X_LIBS $LDFLAGS"
7812         
7813 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
7814
7815 echo "${as_me-configure}:7816: testing checking additions to CFLAGS ..." 1>&5
7816
7817
7818 cf_check_cflags="$CFLAGS"
7819 cf_check_cppflags="$CPPFLAGS"
7820
7821 cf_fix_cppflags=no
7822 cf_new_cflags=
7823 cf_new_cppflags=
7824 cf_new_extra_cppflags=
7825
7826 for cf_add_cflags in $X_CFLAGS
7827 do
7828 case $cf_fix_cppflags in
7829 no)
7830         case $cf_add_cflags in #(vi
7831         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
7832                 case $cf_add_cflags in
7833                 -D*)
7834                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7835
7836                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7837                                 && test -z "${cf_tst_cflags}" \
7838                                 && cf_fix_cppflags=yes
7839
7840                         if test $cf_fix_cppflags = yes ; then
7841                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7842                                 continue
7843                         elif test "${cf_tst_cflags}" = "\"'" ; then
7844                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7845                                 continue
7846                         fi
7847                         ;;
7848                 esac
7849                 case "$CPPFLAGS" in
7850                 *$cf_add_cflags) #(vi
7851                         ;;
7852                 *) #(vi
7853                         case $cf_add_cflags in #(vi
7854                         -D*)
7855                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7856                                 
7857 CPPFLAGS=`echo "$CPPFLAGS" | \
7858         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7859                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7860
7861                                 ;;
7862                         esac
7863                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
7864                         ;;
7865                 esac
7866                 ;;
7867         *)
7868                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
7869                 ;;
7870         esac
7871         ;;
7872 yes)
7873         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
7874
7875         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7876
7877         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
7878                 && test -z "${cf_tst_cflags}" \
7879                 && cf_fix_cppflags=no
7880         ;;
7881 esac
7882 done
7883
7884 if test -n "$cf_new_cflags" ; then
7885         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
7886
7887 echo "${as_me-configure}:7888: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
7888
7889
7890         CFLAGS="$CFLAGS $cf_new_cflags"
7891 fi
7892
7893 if test -n "$cf_new_cppflags" ; then
7894         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
7895
7896 echo "${as_me-configure}:7897: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
7897
7898
7899         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
7900 fi
7901
7902 if test -n "$cf_new_extra_cppflags" ; then
7903         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
7904
7905 echo "${as_me-configure}:7906: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
7906
7907
7908         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
7909 fi
7910
7911
7912
7913
7914 if test "$cf_check_cflags" != "$CFLAGS" ; then
7915 cat > conftest.$ac_ext <<EOF
7916 #line 7917 "configure"
7917 #include "confdefs.h"
7918 #include <stdio.h>
7919 int main() {
7920 printf("Hello world");
7921 ; return 0; }
7922 EOF
7923 if { (eval echo configure:7924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7924   :
7925 else
7926   echo "configure: failed program was:" >&5
7927   cat conftest.$ac_ext >&5
7928   rm -rf conftest*
7929   test -n "$verbose" && echo "  test-compile failed.  Undoing change to \$CFLAGS" 1>&6
7930
7931 echo "${as_me-configure}:7932: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
7932
7933
7934          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
7935                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
7936
7937 echo "${as_me-configure}:7938: testing but keeping change to \$CPPFLAGS ..." 1>&5
7938
7939
7940          fi
7941          CFLAGS="$cf_check_flags"
7942 fi
7943 rm -f conftest*
7944 fi
7945
7946
7947         echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6
7948 echo "configure:7949: checking for XOpenDisplay" >&5
7949 if eval "test \"`echo '$''{'ac_cv_func_XOpenDisplay'+set}'`\" = set"; then
7950   echo $ac_n "(cached) $ac_c" 1>&6
7951 else
7952   cat > conftest.$ac_ext <<EOF
7953 #line 7954 "configure"
7954 #include "confdefs.h"
7955 /* System header to define __stub macros and hopefully few prototypes,
7956     which can conflict with char XOpenDisplay(); below.  */
7957 #include <assert.h>
7958 /* Override any gcc2 internal prototype to avoid an error.  */
7959 /* We use char because int might match the return type of a gcc2
7960     builtin and then its argument prototype would still apply.  */
7961 char XOpenDisplay();
7962
7963 int main() {
7964
7965 /* The GNU C library defines this for functions which it implements
7966     to always fail with ENOSYS.  Some functions are actually named
7967     something starting with __ and the normal name is an alias.  */
7968 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
7969 choke me
7970 #else
7971 XOpenDisplay();
7972 #endif
7973
7974 ; return 0; }
7975 EOF
7976 if { (eval echo configure:7977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7977   rm -rf conftest*
7978   eval "ac_cv_func_XOpenDisplay=yes"
7979 else
7980   echo "configure: failed program was:" >&5
7981   cat conftest.$ac_ext >&5
7982   rm -rf conftest*
7983   eval "ac_cv_func_XOpenDisplay=no"
7984 fi
7985 rm -f conftest*
7986 fi
7987
7988 if eval "test \"`echo '$ac_cv_func_'XOpenDisplay`\" = yes"; then
7989   echo "$ac_t""yes" 1>&6
7990   :
7991 else
7992   echo "$ac_t""no" 1>&6
7993
7994         echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
7995 echo "configure:7996: checking for XOpenDisplay in -lX11" >&5
7996 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
7997 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7998   echo $ac_n "(cached) $ac_c" 1>&6
7999 else
8000   ac_save_LIBS="$LIBS"
8001 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
8002 cat > conftest.$ac_ext <<EOF
8003 #line 8004 "configure"
8004 #include "confdefs.h"
8005 /* Override any gcc2 internal prototype to avoid an error.  */
8006 /* We use char because int might match the return type of a gcc2
8007     builtin and then its argument prototype would still apply.  */
8008 char XOpenDisplay();
8009
8010 int main() {
8011 XOpenDisplay()
8012 ; return 0; }
8013 EOF
8014 if { (eval echo configure:8015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8015   rm -rf conftest*
8016   eval "ac_cv_lib_$ac_lib_var=yes"
8017 else
8018   echo "configure: failed program was:" >&5
8019   cat conftest.$ac_ext >&5
8020   rm -rf conftest*
8021   eval "ac_cv_lib_$ac_lib_var=no"
8022 fi
8023 rm -f conftest*
8024 LIBS="$ac_save_LIBS"
8025
8026 fi
8027 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8028   echo "$ac_t""yes" 1>&6
8029   LIBS="-lX11 $LIBS"
8030 else
8031   echo "$ac_t""no" 1>&6
8032 fi
8033
8034 fi
8035
8036
8037         echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6
8038 echo "configure:8039: checking for XtAppInitialize" >&5
8039 if eval "test \"`echo '$''{'ac_cv_func_XtAppInitialize'+set}'`\" = set"; then
8040   echo $ac_n "(cached) $ac_c" 1>&6
8041 else
8042   cat > conftest.$ac_ext <<EOF
8043 #line 8044 "configure"
8044 #include "confdefs.h"
8045 /* System header to define __stub macros and hopefully few prototypes,
8046     which can conflict with char XtAppInitialize(); below.  */
8047 #include <assert.h>
8048 /* Override any gcc2 internal prototype to avoid an error.  */
8049 /* We use char because int might match the return type of a gcc2
8050     builtin and then its argument prototype would still apply.  */
8051 char XtAppInitialize();
8052
8053 int main() {
8054
8055 /* The GNU C library defines this for functions which it implements
8056     to always fail with ENOSYS.  Some functions are actually named
8057     something starting with __ and the normal name is an alias.  */
8058 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
8059 choke me
8060 #else
8061 XtAppInitialize();
8062 #endif
8063
8064 ; return 0; }
8065 EOF
8066 if { (eval echo configure:8067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8067   rm -rf conftest*
8068   eval "ac_cv_func_XtAppInitialize=yes"
8069 else
8070   echo "configure: failed program was:" >&5
8071   cat conftest.$ac_ext >&5
8072   rm -rf conftest*
8073   eval "ac_cv_func_XtAppInitialize=no"
8074 fi
8075 rm -f conftest*
8076 fi
8077
8078 if eval "test \"`echo '$ac_cv_func_'XtAppInitialize`\" = yes"; then
8079   echo "$ac_t""yes" 1>&6
8080   :
8081 else
8082   echo "$ac_t""no" 1>&6
8083
8084         echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
8085 echo "configure:8086: checking for XtAppInitialize in -lXt" >&5
8086 ac_lib_var=`echo Xt'_'XtAppInitialize | sed 'y%./+-%__p_%'`
8087 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8088   echo $ac_n "(cached) $ac_c" 1>&6
8089 else
8090   ac_save_LIBS="$LIBS"
8091 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
8092 cat > conftest.$ac_ext <<EOF
8093 #line 8094 "configure"
8094 #include "confdefs.h"
8095 /* Override any gcc2 internal prototype to avoid an error.  */
8096 /* We use char because int might match the return type of a gcc2
8097     builtin and then its argument prototype would still apply.  */
8098 char XtAppInitialize();
8099
8100 int main() {
8101 XtAppInitialize()
8102 ; return 0; }
8103 EOF
8104 if { (eval echo configure:8105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8105   rm -rf conftest*
8106   eval "ac_cv_lib_$ac_lib_var=yes"
8107 else
8108   echo "configure: failed program was:" >&5
8109   cat conftest.$ac_ext >&5
8110   rm -rf conftest*
8111   eval "ac_cv_lib_$ac_lib_var=no"
8112 fi
8113 rm -f conftest*
8114 LIBS="$ac_save_LIBS"
8115
8116 fi
8117 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8118   echo "$ac_t""yes" 1>&6
8119   cat >> confdefs.h <<\EOF
8120 #define HAVE_LIBXT 1
8121 EOF
8122
8123                  cf_have_X_LIBS=Xt
8124                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
8125 else
8126   echo "$ac_t""no" 1>&6
8127 fi
8128
8129 fi
8130
8131
8132 fi
8133
8134
8135 if test $cf_have_X_LIBS = no ; then
8136         echo "configure: warning: Unable to successfully link X Toolkit library (-lXt) with
8137 test program.  You will have to check and add the proper libraries by hand
8138 to makefile." 1>&2
8139 fi
8140
8141         
8142 cf_x_athena_root=$cf_x_athena
8143 cf_x_athena_inc=""
8144
8145 for cf_path in default \
8146         /usr/contrib/X11R6 \
8147         /usr/contrib/X11R5 \
8148         /usr/lib/X11R5 \
8149         /usr/local
8150 do
8151         if test -z "$cf_x_athena_inc" ; then
8152                 cf_save="$CPPFLAGS"
8153                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
8154                 if test $cf_path != default ; then
8155                         CPPFLAGS="$cf_save -I$cf_path/include"
8156                         echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
8157 echo "configure:8158: checking for $cf_test in $cf_path" >&5
8158                 else
8159                         echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
8160 echo "configure:8161: checking for $cf_test" >&5
8161                 fi
8162                 cat > conftest.$ac_ext <<EOF
8163 #line 8164 "configure"
8164 #include "confdefs.h"
8165
8166 #include <X11/Intrinsic.h>
8167 #include <$cf_test>
8168 int main() {
8169
8170 ; return 0; }
8171 EOF
8172 if { (eval echo configure:8173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8173   rm -rf conftest*
8174   cf_result=yes
8175 else
8176   echo "configure: failed program was:" >&5
8177   cat conftest.$ac_ext >&5
8178   rm -rf conftest*
8179   cf_result=no
8180 fi
8181 rm -f conftest*
8182                 echo "$ac_t""$cf_result" 1>&6
8183                 if test "$cf_result" = yes ; then
8184                         cf_x_athena_inc=$cf_path
8185                         break
8186                 else
8187                         CPPFLAGS="$cf_save"
8188                 fi
8189         fi
8190 done
8191
8192 if test -z "$cf_x_athena_inc" ; then
8193         echo "configure: warning: Unable to successfully find Athena header files with test program" 1>&2
8194 elif test "$cf_x_athena_inc" != default ; then
8195         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
8196 fi
8197
8198         
8199 cf_x_athena_root=$cf_x_athena
8200 cf_x_athena_lib=""
8201
8202 for cf_path in default \
8203         /usr/contrib/X11R6 \
8204         /usr/contrib/X11R5 \
8205         /usr/lib/X11R5 \
8206         /usr/local
8207 do
8208         for cf_lib in \
8209                 "-l$cf_x_athena_root -lXmu" \
8210                 "-l$cf_x_athena_root -lXpm -lXmu" \
8211                 "-l${cf_x_athena_root}_s -lXmu_s"
8212         do
8213                 if test -z "$cf_x_athena_lib" ; then
8214                         cf_save="$LIBS"
8215                         cf_test=XawSimpleMenuAddGlobalActions
8216                         if test $cf_path != default ; then
8217                                 LIBS="-L$cf_path/lib $cf_lib $LIBS"
8218                                 echo $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6
8219 echo "configure:8220: checking for $cf_lib in $cf_path" >&5
8220                         else
8221                                 LIBS="$cf_lib $LIBS"
8222                                 echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6
8223 echo "configure:8224: checking for $cf_test in $cf_lib" >&5
8224                         fi
8225                         cat > conftest.$ac_ext <<EOF
8226 #line 8227 "configure"
8227 #include "confdefs.h"
8228
8229 int main() {
8230 $cf_test()
8231 ; return 0; }
8232 EOF
8233 if { (eval echo configure:8234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8234   rm -rf conftest*
8235   cf_result=yes
8236 else
8237   echo "configure: failed program was:" >&5
8238   cat conftest.$ac_ext >&5
8239   rm -rf conftest*
8240   cf_result=no
8241 fi
8242 rm -f conftest*
8243                         echo "$ac_t""$cf_result" 1>&6
8244                         if test "$cf_result" = yes ; then
8245                                 cf_x_athena_lib="$cf_lib"
8246                                 break
8247                         fi
8248                         LIBS="$cf_save"
8249                 fi
8250         done
8251 done
8252
8253 if test -z "$cf_x_athena_lib" ; then
8254         { echo "configure: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" 1>&2; exit 1; }
8255 fi
8256
8257
8258 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8259
8260 cat >> confdefs.h <<EOF
8261 #define $cf_x_athena_LIBS 1
8262 EOF
8263
8264
8265 fi
8266
8267
8268
8269
8270 for ac_prog in xcurses-config
8271 do
8272 # Extract the first word of "$ac_prog", so it can be a program name with args.
8273 set dummy $ac_prog; ac_word=$2
8274 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8275 echo "configure:8276: checking for $ac_word" >&5
8276 if eval "test \"`echo '$''{'ac_cv_path_XCURSES_CONFIG'+set}'`\" = set"; then
8277   echo $ac_n "(cached) $ac_c" 1>&6
8278 else
8279   case "$XCURSES_CONFIG" in
8280   /*)
8281   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
8282   ;;
8283   ?:/*)                  
8284   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a dos path.
8285   ;;
8286   *)
8287   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8288   ac_dummy="$PATH"
8289   for ac_dir in $ac_dummy; do 
8290     test -z "$ac_dir" && ac_dir=.
8291     if test -f $ac_dir/$ac_word; then
8292       ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
8293       break
8294     fi
8295   done
8296   IFS="$ac_save_ifs"
8297   ;;
8298 esac
8299 fi
8300 XCURSES_CONFIG="$ac_cv_path_XCURSES_CONFIG"
8301 if test -n "$XCURSES_CONFIG"; then
8302   echo "$ac_t""$XCURSES_CONFIG" 1>&6
8303 else
8304   echo "$ac_t""no" 1>&6
8305 fi
8306
8307 test -n "$XCURSES_CONFIG" && break
8308 done
8309 test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
8310
8311
8312 if test "$XCURSES_CONFIG" != none ; then
8313
8314 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
8315 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
8316
8317 cf_cv_lib_XCurses=yes
8318
8319 else
8320
8321 LDFLAGS="$LDFLAGS $X_LIBS"
8322
8323 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
8324
8325 echo "${as_me-configure}:8326: testing checking additions to CFLAGS ..." 1>&5
8326
8327
8328 cf_check_cflags="$CFLAGS"
8329 cf_check_cppflags="$CPPFLAGS"
8330
8331 cf_fix_cppflags=no
8332 cf_new_cflags=
8333 cf_new_cppflags=
8334 cf_new_extra_cppflags=
8335
8336 for cf_add_cflags in $X_CFLAGS
8337 do
8338 case $cf_fix_cppflags in
8339 no)
8340         case $cf_add_cflags in #(vi
8341         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
8342                 case $cf_add_cflags in
8343                 -D*)
8344                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8345
8346                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8347                                 && test -z "${cf_tst_cflags}" \
8348                                 && cf_fix_cppflags=yes
8349
8350                         if test $cf_fix_cppflags = yes ; then
8351                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8352                                 continue
8353                         elif test "${cf_tst_cflags}" = "\"'" ; then
8354                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8355                                 continue
8356                         fi
8357                         ;;
8358                 esac
8359                 case "$CPPFLAGS" in
8360                 *$cf_add_cflags) #(vi
8361                         ;;
8362                 *) #(vi
8363                         case $cf_add_cflags in #(vi
8364                         -D*)
8365                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8366                                 
8367 CPPFLAGS=`echo "$CPPFLAGS" | \
8368         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8369                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8370
8371                                 ;;
8372                         esac
8373                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
8374                         ;;
8375                 esac
8376                 ;;
8377         *)
8378                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
8379                 ;;
8380         esac
8381         ;;
8382 yes)
8383         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
8384
8385         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8386
8387         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
8388                 && test -z "${cf_tst_cflags}" \
8389                 && cf_fix_cppflags=no
8390         ;;
8391 esac
8392 done
8393
8394 if test -n "$cf_new_cflags" ; then
8395         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
8396
8397 echo "${as_me-configure}:8398: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
8398
8399
8400         CFLAGS="$CFLAGS $cf_new_cflags"
8401 fi
8402
8403 if test -n "$cf_new_cppflags" ; then
8404         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
8405
8406 echo "${as_me-configure}:8407: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
8407
8408
8409         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
8410 fi
8411
8412 if test -n "$cf_new_extra_cppflags" ; then
8413         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
8414
8415 echo "${as_me-configure}:8416: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
8416
8417
8418         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
8419 fi
8420
8421
8422
8423
8424 if test "$cf_check_cflags" != "$CFLAGS" ; then
8425 cat > conftest.$ac_ext <<EOF
8426 #line 8427 "configure"
8427 #include "confdefs.h"
8428 #include <stdio.h>
8429 int main() {
8430 printf("Hello world");
8431 ; return 0; }
8432 EOF
8433 if { (eval echo configure:8434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8434   :
8435 else
8436   echo "configure: failed program was:" >&5
8437   cat conftest.$ac_ext >&5
8438   rm -rf conftest*
8439   test -n "$verbose" && echo "  test-compile failed.  Undoing change to \$CFLAGS" 1>&6
8440
8441 echo "${as_me-configure}:8442: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
8442
8443
8444          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
8445                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
8446
8447 echo "${as_me-configure}:8448: testing but keeping change to \$CPPFLAGS ..." 1>&5
8448
8449
8450          fi
8451          CFLAGS="$cf_check_flags"
8452 fi
8453 rm -f conftest*
8454 fi
8455
8456 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
8457 echo "configure:8458: checking for XOpenDisplay in -lX11" >&5
8458 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
8459 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8460   echo $ac_n "(cached) $ac_c" 1>&6
8461 else
8462   ac_save_LIBS="$LIBS"
8463 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
8464 cat > conftest.$ac_ext <<EOF
8465 #line 8466 "configure"
8466 #include "confdefs.h"
8467 /* Override any gcc2 internal prototype to avoid an error.  */
8468 /* We use char because int might match the return type of a gcc2
8469     builtin and then its argument prototype would still apply.  */
8470 char XOpenDisplay();
8471
8472 int main() {
8473 XOpenDisplay()
8474 ; return 0; }
8475 EOF
8476 if { (eval echo configure:8477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8477   rm -rf conftest*
8478   eval "ac_cv_lib_$ac_lib_var=yes"
8479 else
8480   echo "configure: failed program was:" >&5
8481   cat conftest.$ac_ext >&5
8482   rm -rf conftest*
8483   eval "ac_cv_lib_$ac_lib_var=no"
8484 fi
8485 rm -f conftest*
8486 LIBS="$ac_save_LIBS"
8487
8488 fi
8489 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8490   echo "$ac_t""yes" 1>&6
8491   LIBS="-lX11 $LIBS"
8492 else
8493   echo "$ac_t""no" 1>&6
8494 fi
8495
8496 echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
8497 echo "configure:8498: checking for XCurses library" >&5
8498 if eval "test \"`echo '$''{'cf_cv_lib_XCurses'+set}'`\" = set"; then
8499   echo $ac_n "(cached) $ac_c" 1>&6
8500 else
8501   
8502 LIBS="-lXCurses $LIBS"
8503 cat > conftest.$ac_ext <<EOF
8504 #line 8505 "configure"
8505 #include "confdefs.h"
8506
8507 #include <xcurses.h>
8508 char *XCursesProgramName = "test";
8509
8510 int main() {
8511 XCursesExit();
8512 ; return 0; }
8513 EOF
8514 if { (eval echo configure:8515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8515   rm -rf conftest*
8516   cf_cv_lib_XCurses=yes
8517 else
8518   echo "configure: failed program was:" >&5
8519   cat conftest.$ac_ext >&5
8520   rm -rf conftest*
8521   cf_cv_lib_XCurses=no
8522 fi
8523 rm -f conftest*
8524
8525 fi
8526
8527 echo "$ac_t""$cf_cv_lib_XCurses" 1>&6
8528
8529 fi
8530
8531 if test $cf_cv_lib_XCurses = yes ; then
8532         cat >> confdefs.h <<\EOF
8533 #define UNIX 1
8534 EOF
8535
8536         cat >> confdefs.h <<\EOF
8537 #define XCURSES 1
8538 EOF
8539
8540         cat >> confdefs.h <<\EOF
8541 #define HAVE_XCURSES 1
8542 EOF
8543
8544 else
8545         { echo "configure: error: Cannot link with XCurses" 1>&2; exit 1; }
8546 fi
8547
8548         ;;
8549 esac
8550
8551
8552
8553 case $cf_cv_screen in #(vi
8554 pdcurses) #(vi
8555         ;;
8556 *)
8557         # look for curses-related libraries
8558         echo $ac_n "checking for new_panel in -lpanel$cf_cv_libtype""... $ac_c" 1>&6
8559 echo "configure:8560: checking for new_panel in -lpanel$cf_cv_libtype" >&5
8560 ac_lib_var=`echo panel$cf_cv_libtype'_'new_panel | sed 'y%./+-%__p_%'`
8561 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8562   echo $ac_n "(cached) $ac_c" 1>&6
8563 else
8564   ac_save_LIBS="$LIBS"
8565 LIBS="-lpanel$cf_cv_libtype  $LIBS"
8566 cat > conftest.$ac_ext <<EOF
8567 #line 8568 "configure"
8568 #include "confdefs.h"
8569 /* Override any gcc2 internal prototype to avoid an error.  */
8570 /* We use char because int might match the return type of a gcc2
8571     builtin and then its argument prototype would still apply.  */
8572 char new_panel();
8573
8574 int main() {
8575 new_panel()
8576 ; return 0; }
8577 EOF
8578 if { (eval echo configure:8579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8579   rm -rf conftest*
8580   eval "ac_cv_lib_$ac_lib_var=yes"
8581 else
8582   echo "configure: failed program was:" >&5
8583   cat conftest.$ac_ext >&5
8584   rm -rf conftest*
8585   eval "ac_cv_lib_$ac_lib_var=no"
8586 fi
8587 rm -f conftest*
8588 LIBS="$ac_save_LIBS"
8589
8590 fi
8591 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8592   echo "$ac_t""yes" 1>&6
8593     ac_tr_lib=HAVE_LIB`echo panel$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8594     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8595   cat >> confdefs.h <<EOF
8596 #define $ac_tr_lib 1
8597 EOF
8598
8599   LIBS="-lpanel$cf_cv_libtype $LIBS"
8600
8601 else
8602   echo "$ac_t""no" 1>&6
8603 fi
8604
8605         echo $ac_n "checking for menu_driver in -lmenu$cf_cv_libtype""... $ac_c" 1>&6
8606 echo "configure:8607: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
8607 ac_lib_var=`echo menu$cf_cv_libtype'_'menu_driver | sed 'y%./+-%__p_%'`
8608 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8609   echo $ac_n "(cached) $ac_c" 1>&6
8610 else
8611   ac_save_LIBS="$LIBS"
8612 LIBS="-lmenu$cf_cv_libtype  $LIBS"
8613 cat > conftest.$ac_ext <<EOF
8614 #line 8615 "configure"
8615 #include "confdefs.h"
8616 /* Override any gcc2 internal prototype to avoid an error.  */
8617 /* We use char because int might match the return type of a gcc2
8618     builtin and then its argument prototype would still apply.  */
8619 char menu_driver();
8620
8621 int main() {
8622 menu_driver()
8623 ; return 0; }
8624 EOF
8625 if { (eval echo configure:8626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8626   rm -rf conftest*
8627   eval "ac_cv_lib_$ac_lib_var=yes"
8628 else
8629   echo "configure: failed program was:" >&5
8630   cat conftest.$ac_ext >&5
8631   rm -rf conftest*
8632   eval "ac_cv_lib_$ac_lib_var=no"
8633 fi
8634 rm -f conftest*
8635 LIBS="$ac_save_LIBS"
8636
8637 fi
8638 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8639   echo "$ac_t""yes" 1>&6
8640     ac_tr_lib=HAVE_LIB`echo menu$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8641     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8642   cat >> confdefs.h <<EOF
8643 #define $ac_tr_lib 1
8644 EOF
8645
8646   LIBS="-lmenu$cf_cv_libtype $LIBS"
8647
8648 else
8649   echo "$ac_t""no" 1>&6
8650 fi
8651
8652         echo $ac_n "checking for form_driver in -lform$cf_cv_libtype""... $ac_c" 1>&6
8653 echo "configure:8654: checking for form_driver in -lform$cf_cv_libtype" >&5
8654 ac_lib_var=`echo form$cf_cv_libtype'_'form_driver | sed 'y%./+-%__p_%'`
8655 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8656   echo $ac_n "(cached) $ac_c" 1>&6
8657 else
8658   ac_save_LIBS="$LIBS"
8659 LIBS="-lform$cf_cv_libtype  $LIBS"
8660 cat > conftest.$ac_ext <<EOF
8661 #line 8662 "configure"
8662 #include "confdefs.h"
8663 /* Override any gcc2 internal prototype to avoid an error.  */
8664 /* We use char because int might match the return type of a gcc2
8665     builtin and then its argument prototype would still apply.  */
8666 char form_driver();
8667
8668 int main() {
8669 form_driver()
8670 ; return 0; }
8671 EOF
8672 if { (eval echo configure:8673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8673   rm -rf conftest*
8674   eval "ac_cv_lib_$ac_lib_var=yes"
8675 else
8676   echo "configure: failed program was:" >&5
8677   cat conftest.$ac_ext >&5
8678   rm -rf conftest*
8679   eval "ac_cv_lib_$ac_lib_var=no"
8680 fi
8681 rm -f conftest*
8682 LIBS="$ac_save_LIBS"
8683
8684 fi
8685 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8686   echo "$ac_t""yes" 1>&6
8687     ac_tr_lib=HAVE_LIB`echo form$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8688     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8689   cat >> confdefs.h <<EOF
8690 #define $ac_tr_lib 1
8691 EOF
8692
8693   LIBS="-lform$cf_cv_libtype $LIBS"
8694
8695 else
8696   echo "$ac_t""no" 1>&6
8697 fi
8698
8699
8700         # look for curses-related headers
8701         for ac_hdr in \
8702                 nc_alloc.h \
8703                 nomacros.h \
8704                 form.h \
8705                 menu.h \
8706                 panel.h \
8707                 
8708 do
8709 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8710 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8711 echo "configure:8712: checking for $ac_hdr" >&5
8712 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8713   echo $ac_n "(cached) $ac_c" 1>&6
8714 else
8715   cat > conftest.$ac_ext <<EOF
8716 #line 8717 "configure"
8717 #include "confdefs.h"
8718 #include <$ac_hdr>
8719 EOF
8720 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8721 { (eval echo configure:8722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8722 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8723 if test -z "$ac_err"; then
8724   rm -rf conftest*
8725   eval "ac_cv_header_$ac_safe=yes"
8726 else
8727   echo "$ac_err" >&5
8728   echo "configure: failed program was:" >&5
8729   cat conftest.$ac_ext >&5
8730   rm -rf conftest*
8731   eval "ac_cv_header_$ac_safe=no"
8732 fi
8733 rm -f conftest*
8734 fi
8735 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8736   echo "$ac_t""yes" 1>&6
8737     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8738   cat >> confdefs.h <<EOF
8739 #define $ac_tr_hdr 1
8740 EOF
8741  
8742 else
8743   echo "$ac_t""no" 1>&6
8744 fi
8745 done
8746
8747         ;;
8748 esac
8749
8750 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
8751 echo "configure:8752: checking return type of signal handlers" >&5
8752 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
8753   echo $ac_n "(cached) $ac_c" 1>&6
8754 else
8755   cat > conftest.$ac_ext <<EOF
8756 #line 8757 "configure"
8757 #include "confdefs.h"
8758 #include <sys/types.h>
8759 #include <signal.h>
8760 #ifdef signal
8761 #undef signal
8762 #endif
8763 #ifdef __cplusplus
8764 extern "C" void (*signal (int, void (*)(int)))(int);
8765 #else
8766 void (*signal ()) ();
8767 #endif
8768
8769 int main() {
8770 int i;
8771 ; return 0; }
8772 EOF
8773 if { (eval echo configure:8774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8774   rm -rf conftest*
8775   ac_cv_type_signal=void
8776 else
8777   echo "configure: failed program was:" >&5
8778   cat conftest.$ac_ext >&5
8779   rm -rf conftest*
8780   ac_cv_type_signal=int
8781 fi
8782 rm -f conftest*
8783 fi
8784
8785 echo "$ac_t""$ac_cv_type_signal" 1>&6
8786 cat >> confdefs.h <<EOF
8787 #define RETSIGTYPE $ac_cv_type_signal
8788 EOF
8789
8790
8791
8792 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8793 echo "configure:8794: checking for ANSI C header files" >&5
8794 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
8795   echo $ac_n "(cached) $ac_c" 1>&6
8796 else
8797   cat > conftest.$ac_ext <<EOF
8798 #line 8799 "configure"
8799 #include "confdefs.h"
8800 #include <stdlib.h>
8801 #include <stdarg.h>
8802 #include <string.h>
8803 #include <float.h>
8804 EOF
8805 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8806 { (eval echo configure:8807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8807 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8808 if test -z "$ac_err"; then
8809   rm -rf conftest*
8810   ac_cv_header_stdc=yes
8811 else
8812   echo "$ac_err" >&5
8813   echo "configure: failed program was:" >&5
8814   cat conftest.$ac_ext >&5
8815   rm -rf conftest*
8816   ac_cv_header_stdc=no
8817 fi
8818 rm -f conftest*
8819
8820 if test $ac_cv_header_stdc = yes; then
8821   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8822 cat > conftest.$ac_ext <<EOF
8823 #line 8824 "configure"
8824 #include "confdefs.h"
8825 #include <string.h>
8826 EOF
8827 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8828   egrep "memchr" >/dev/null 2>&1; then
8829   :
8830 else
8831   rm -rf conftest*
8832   ac_cv_header_stdc=no
8833 fi
8834 rm -f conftest*
8835
8836 fi
8837
8838 if test $ac_cv_header_stdc = yes; then
8839   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8840 cat > conftest.$ac_ext <<EOF
8841 #line 8842 "configure"
8842 #include "confdefs.h"
8843 #include <stdlib.h>
8844 EOF
8845 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8846   egrep "free" >/dev/null 2>&1; then
8847   :
8848 else
8849   rm -rf conftest*
8850   ac_cv_header_stdc=no
8851 fi
8852 rm -f conftest*
8853
8854 fi
8855
8856 if test $ac_cv_header_stdc = yes; then
8857   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8858 if test "$cross_compiling" = yes; then
8859   :
8860 else
8861   cat > conftest.$ac_ext <<EOF
8862 #line 8863 "configure"
8863 #include "confdefs.h"
8864 #include <ctype.h>
8865 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8866 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8867 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8868 int main () { int i; for (i = 0; i < 256; i++)
8869 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8870 exit (0); }
8871
8872 EOF
8873 if { (eval echo configure:8874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8874 then
8875   :
8876 else
8877   echo "configure: failed program was:" >&5
8878   cat conftest.$ac_ext >&5
8879   rm -fr conftest*
8880   ac_cv_header_stdc=no
8881 fi
8882 rm -fr conftest*
8883 fi
8884
8885 fi
8886 fi
8887
8888 echo "$ac_t""$ac_cv_header_stdc" 1>&6
8889 if test $ac_cv_header_stdc = yes; then
8890   cat >> confdefs.h <<\EOF
8891 #define STDC_HEADERS 1
8892 EOF
8893
8894 fi
8895
8896 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
8897 echo "configure:8898: checking whether time.h and sys/time.h may both be included" >&5
8898 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
8899   echo $ac_n "(cached) $ac_c" 1>&6
8900 else
8901   cat > conftest.$ac_ext <<EOF
8902 #line 8903 "configure"
8903 #include "confdefs.h"
8904 #include <sys/types.h>
8905 #include <sys/time.h>
8906 #include <time.h>
8907 int main() {
8908 struct tm *tp;
8909 ; return 0; }
8910 EOF
8911 if { (eval echo configure:8912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8912   rm -rf conftest*
8913   ac_cv_header_time=yes
8914 else
8915   echo "configure: failed program was:" >&5
8916   cat conftest.$ac_ext >&5
8917   rm -rf conftest*
8918   ac_cv_header_time=no
8919 fi
8920 rm -f conftest*
8921 fi
8922
8923 echo "$ac_t""$ac_cv_header_time" 1>&6
8924 if test $ac_cv_header_time = yes; then
8925   cat >> confdefs.h <<\EOF
8926 #define TIME_WITH_SYS_TIME 1
8927 EOF
8928
8929 fi
8930
8931 for ac_hdr in \
8932 getopt.h \
8933 locale.h \
8934 stdarg.h \
8935 sys/ioctl.h \
8936 sys/select.h \
8937 sys/time.h \
8938 termios.h \
8939 unistd.h \
8940
8941 do
8942 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8943 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8944 echo "configure:8945: checking for $ac_hdr" >&5
8945 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8946   echo $ac_n "(cached) $ac_c" 1>&6
8947 else
8948   cat > conftest.$ac_ext <<EOF
8949 #line 8950 "configure"
8950 #include "confdefs.h"
8951 #include <$ac_hdr>
8952 EOF
8953 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8954 { (eval echo configure:8955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8955 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8956 if test -z "$ac_err"; then
8957   rm -rf conftest*
8958   eval "ac_cv_header_$ac_safe=yes"
8959 else
8960   echo "$ac_err" >&5
8961   echo "configure: failed program was:" >&5
8962   cat conftest.$ac_ext >&5
8963   rm -rf conftest*
8964   eval "ac_cv_header_$ac_safe=no"
8965 fi
8966 rm -f conftest*
8967 fi
8968 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8969   echo "$ac_t""yes" 1>&6
8970     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8971   cat >> confdefs.h <<EOF
8972 #define $ac_tr_hdr 1
8973 EOF
8974  
8975 else
8976   echo "$ac_t""no" 1>&6
8977 fi
8978 done
8979
8980
8981 for ac_func in \
8982 gettimeofday \
8983 mblen \
8984 mbrlen \
8985 mbrtowc \
8986 mbsrtowcs \
8987 mbstowcs \
8988 mbtowc \
8989 strdup \
8990 wcsrtombs \
8991 wcstombs \
8992
8993 do
8994 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8995 echo "configure:8996: checking for $ac_func" >&5
8996 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8997   echo $ac_n "(cached) $ac_c" 1>&6
8998 else
8999   cat > conftest.$ac_ext <<EOF
9000 #line 9001 "configure"
9001 #include "confdefs.h"
9002 /* System header to define __stub macros and hopefully few prototypes,
9003     which can conflict with char $ac_func(); below.  */
9004 #include <assert.h>
9005 /* Override any gcc2 internal prototype to avoid an error.  */
9006 /* We use char because int might match the return type of a gcc2
9007     builtin and then its argument prototype would still apply.  */
9008 char $ac_func();
9009
9010 int main() {
9011
9012 /* The GNU C library defines this for functions which it implements
9013     to always fail with ENOSYS.  Some functions are actually named
9014     something starting with __ and the normal name is an alias.  */
9015 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9016 choke me
9017 #else
9018 $ac_func();
9019 #endif
9020
9021 ; return 0; }
9022 EOF
9023 if { (eval echo configure:9024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9024   rm -rf conftest*
9025   eval "ac_cv_func_$ac_func=yes"
9026 else
9027   echo "configure: failed program was:" >&5
9028   cat conftest.$ac_ext >&5
9029   rm -rf conftest*
9030   eval "ac_cv_func_$ac_func=no"
9031 fi
9032 rm -f conftest*
9033 fi
9034
9035 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9036   echo "$ac_t""yes" 1>&6
9037     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9038   cat >> confdefs.h <<EOF
9039 #define $ac_tr_func 1
9040 EOF
9041  
9042 else
9043   echo "$ac_t""no" 1>&6
9044 fi
9045 done
9046
9047
9048
9049 echo $ac_n "checking if we must define _XOPEN_SOURCE_EXTENDED""... $ac_c" 1>&6
9050 echo "configure:9051: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
9051 if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then
9052   echo $ac_n "(cached) $ac_c" 1>&6
9053 else
9054   
9055 cat > conftest.$ac_ext <<EOF
9056 #line 9057 "configure"
9057 #include "confdefs.h"
9058
9059 #include <stdlib.h>
9060 #include <${cf_cv_ncurses_header-curses.h}>
9061 int main() {
9062
9063 #if defined(NCURSES_VERSION_PATCH)
9064 if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
9065         make an error
9066 #endif
9067 #endif
9068         long x = winnstr(stdscr, "", 0);
9069         int x1, y1;
9070         getbegyx(stdscr, y1, x1)
9071 ; return 0; }
9072 EOF
9073 if { (eval echo configure:9074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9074   rm -rf conftest*
9075   cf_cv_need_xopen_extension=no
9076 else
9077   echo "configure: failed program was:" >&5
9078   cat conftest.$ac_ext >&5
9079   rm -rf conftest*
9080   cat > conftest.$ac_ext <<EOF
9081 #line 9082 "configure"
9082 #include "confdefs.h"
9083
9084 #define _XOPEN_SOURCE_EXTENDED
9085 #include <stdlib.h>
9086 #include <${cf_cv_ncurses_header-curses.h}>
9087 int main() {
9088
9089 #ifdef NCURSES_VERSION
9090         cchar_t check;
9091         int check2 = curs_set((int)sizeof(check));
9092 #endif
9093         long x = winnstr(stdscr, "", 0);
9094         int x1, y1;
9095         getbegyx(stdscr, y1, x1)
9096 ; return 0; }
9097 EOF
9098 if { (eval echo configure:9099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9099   rm -rf conftest*
9100   cf_cv_need_xopen_extension=yes
9101 else
9102   echo "configure: failed program was:" >&5
9103   cat conftest.$ac_ext >&5
9104   rm -rf conftest*
9105   cf_cv_need_xopen_extension=unknown
9106 fi
9107 rm -f conftest*
9108 fi
9109 rm -f conftest*
9110 fi
9111
9112 echo "$ac_t""$cf_cv_need_xopen_extension" 1>&6
9113 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
9114
9115
9116
9117 echo $ac_n "checking for term.h""... $ac_c" 1>&6
9118 echo "configure:9119: checking for term.h" >&5
9119 if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
9120   echo $ac_n "(cached) $ac_c" 1>&6
9121 else
9122   
9123
9124 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
9125 # for <term.h> if we do not find the variant.
9126 for cf_header in \
9127         `echo ${cf_cv_ncurses_header-curses.h} | sed -e 's%/.*%/%'`term.h \
9128         term.h
9129 do
9130         cat > conftest.$ac_ext <<EOF
9131 #line 9132 "configure"
9132 #include "confdefs.h"
9133
9134 #include <${cf_cv_ncurses_header-curses.h}>
9135 #include <${cf_header}>
9136 int main() {
9137 WINDOW *x
9138 ; return 0; }
9139 EOF
9140 if { (eval echo configure:9141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9141   rm -rf conftest*
9142   cf_cv_term_header=$cf_header
9143          break
9144 else
9145   echo "configure: failed program was:" >&5
9146   cat conftest.$ac_ext >&5
9147   rm -rf conftest*
9148   cf_cv_term_header=no
9149 fi
9150 rm -f conftest*
9151 done
9152
9153 case $cf_cv_term_header in #(vi
9154 no)
9155         # If curses is ncurses, some packagers still mess it up by trying to make
9156         # us use GNU termcap.  This handles the most common case.
9157         for cf_header in ncurses/term.h ncursesw/term.h
9158         do
9159                 cat > conftest.$ac_ext <<EOF
9160 #line 9161 "configure"
9161 #include "confdefs.h"
9162
9163 #include <${cf_cv_ncurses_header-curses.h}>
9164 #ifdef NCURSES_VERSION
9165 #include <${cf_header}>
9166 #else
9167 make an error
9168 #endif
9169 int main() {
9170 WINDOW *x
9171 ; return 0; }
9172 EOF
9173 if { (eval echo configure:9174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9174   rm -rf conftest*
9175   cf_cv_term_header=$cf_header
9176                          break
9177 else
9178   echo "configure: failed program was:" >&5
9179   cat conftest.$ac_ext >&5
9180   rm -rf conftest*
9181   cf_cv_term_header=no
9182 fi
9183 rm -f conftest*
9184         done
9185         ;;
9186 esac
9187
9188 fi
9189
9190 echo "$ac_t""$cf_cv_term_header" 1>&6
9191
9192 case $cf_cv_term_header in #(vi
9193 term.h) #(vi
9194         cat >> confdefs.h <<\EOF
9195 #define HAVE_TERM_H 1
9196 EOF
9197
9198         ;;
9199 ncurses/term.h) #(vi
9200         cat >> confdefs.h <<\EOF
9201 #define HAVE_NCURSES_TERM_H 1
9202 EOF
9203
9204         ;;
9205 ncursesw/term.h)
9206         cat >> confdefs.h <<\EOF
9207 #define HAVE_NCURSESW_TERM_H 1
9208 EOF
9209
9210         ;;
9211 esac
9212
9213
9214
9215
9216 for cf_func in \
9217 chgat \
9218 color_set \
9219 filter \
9220 getbegx \
9221 getcurx \
9222 getmaxx \
9223 getnstr \
9224 getparx \
9225 getwin \
9226 mvvline \
9227 mvwvline \
9228 napms \
9229 putwin \
9230 resize_term \
9231 resizeterm \
9232 ripoffline \
9233 setupterm \
9234 slk_color \
9235 slk_init \
9236 termattrs \
9237 tgetent \
9238 tigetnum \
9239 tigetstr \
9240 typeahead \
9241 use_default_colors \
9242 vw_printw \
9243 vsscanf \
9244 wchgat \
9245 winsstr \
9246 wresize \
9247
9248 do
9249         
9250 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9251
9252         echo $ac_n "checking for ${cf_func}""... $ac_c" 1>&6
9253 echo "configure:9254: checking for ${cf_func}" >&5
9254         
9255 echo "${as_me-configure}:9256: testing ${cf_func} ..." 1>&5
9256
9257         if eval "test \"`echo '$''{'cf_cv_func_$cf_func'+set}'`\" = set"; then
9258   echo $ac_n "(cached) $ac_c" 1>&6
9259 else
9260   
9261                 eval cf_result='$ac_cv_func_'$cf_func
9262                 if test ".$cf_result" != ".no"; then
9263                         cat > conftest.$ac_ext <<EOF
9264 #line 9265 "configure"
9265 #include "confdefs.h"
9266
9267 #ifdef HAVE_XCURSES
9268 #include <xcurses.h>
9269 char * XCursesProgramName = "test";
9270 #else
9271 #include <${cf_cv_ncurses_header-curses.h}>
9272 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
9273 #include <ncursesw/term.h>
9274 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
9275 #include <ncurses/term.h>
9276 #elif defined(HAVE_TERM_H)
9277 #include <term.h>
9278 #endif
9279 #endif
9280
9281 int main() {
9282
9283 #ifndef ${cf_func}
9284 long foo = (long)(&${cf_func});
9285 ${cf_cv_main_return-return}(foo == 0);
9286 #endif
9287                         
9288 ; return 0; }
9289 EOF
9290 if { (eval echo configure:9291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9291   rm -rf conftest*
9292   cf_result=yes
9293 else
9294   echo "configure: failed program was:" >&5
9295   cat conftest.$ac_ext >&5
9296   rm -rf conftest*
9297   cf_result=no
9298 fi
9299 rm -f conftest*
9300                 fi
9301                 eval 'cf_cv_func_'$cf_func'=$cf_result'
9302         
9303 fi
9304
9305         # use the computed/retrieved cache-value:
9306         eval 'cf_result=$cf_cv_func_'$cf_func
9307         echo "$ac_t""$cf_result" 1>&6
9308         if test $cf_result != no; then
9309                 cat >> confdefs.h <<EOF
9310 #define HAVE_${cf_tr_func} 1
9311 EOF
9312
9313         fi
9314 done
9315
9316
9317
9318 echo $ac_n "checking for ncurses extended functions""... $ac_c" 1>&6
9319 echo "configure:9320: checking for ncurses extended functions" >&5
9320 if eval "test \"`echo '$''{'cf_cv_ncurses_ext_funcs'+set}'`\" = set"; then
9321   echo $ac_n "(cached) $ac_c" 1>&6
9322 else
9323   
9324 cat > conftest.$ac_ext <<EOF
9325 #line 9326 "configure"
9326 #include "confdefs.h"
9327
9328 #include <${cf_cv_ncurses_header-curses.h}>
9329 int main() {
9330
9331 int x = NCURSES_EXT_FUNCS
9332
9333 ; return 0; }
9334 EOF
9335 if { (eval echo configure:9336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9336   rm -rf conftest*
9337   cf_cv_ncurses_ext_funcs=defined
9338 else
9339   echo "configure: failed program was:" >&5
9340   cat conftest.$ac_ext >&5
9341   rm -rf conftest*
9342   
9343 cat > conftest.$ac_ext <<EOF
9344 #line 9345 "configure"
9345 #include "confdefs.h"
9346
9347 #include <${cf_cv_ncurses_header-curses.h}>
9348 int main() {
9349
9350         (void) assume_default_colors (0, 0);
9351         (void) curses_version ();
9352         (void) define_key (0, 0);
9353         (void) is_term_resized (0, 0);
9354         (void) key_defined (0);
9355         (void) keybound (0, 0);
9356         (void) keyok (0, 0);
9357         (void) resize_term (0, 0);
9358         (void) resizeterm (0, 0);
9359         (void) use_default_colors ();
9360         (void) use_extended_names (0);
9361         (void) wresize (0, 0, 0);
9362 ; return 0; }
9363 EOF
9364 if { (eval echo configure:9365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9365   rm -rf conftest*
9366   cf_cv_ncurses_ext_funcs=yes
9367 else
9368   echo "configure: failed program was:" >&5
9369   cat conftest.$ac_ext >&5
9370   rm -rf conftest*
9371   cf_cv_ncurses_ext_funcs=no
9372 fi
9373 rm -f conftest*
9374
9375 fi
9376 rm -f conftest*
9377
9378 fi
9379
9380 echo "$ac_t""$cf_cv_ncurses_ext_funcs" 1>&6
9381 test "$cf_cv_ncurses_ext_funcs" == yes && cat >> confdefs.h <<\EOF
9382 #define NCURSES_EXT_FUNCS 1
9383 EOF
9384
9385
9386
9387 echo $ac_n "checking for wide-character functions""... $ac_c" 1>&6
9388 echo "configure:9389: checking for wide-character functions" >&5
9389 if eval "test \"`echo '$''{'cf_cv_widechar_funcs'+set}'`\" = set"; then
9390   echo $ac_n "(cached) $ac_c" 1>&6
9391 else
9392   
9393 cat > conftest.$ac_ext <<EOF
9394 #line 9395 "configure"
9395 #include "confdefs.h"
9396
9397 #include <${cf_cv_ncurses_header-curses.h}>
9398 int main() {
9399
9400         static wchar_t src_wchar[2];
9401         static cchar_t dst_cchar;
9402         setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
9403         
9404 ; return 0; }
9405 EOF
9406 if { (eval echo configure:9407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9407   rm -rf conftest*
9408   cf_cv_widechar_funcs=yes
9409 else
9410   echo "configure: failed program was:" >&5
9411   cat conftest.$ac_ext >&5
9412   rm -rf conftest*
9413   cf_cv_widechar_funcs=no
9414 fi
9415 rm -f conftest*
9416
9417 fi
9418
9419 echo "$ac_t""$cf_cv_widechar_funcs" 1>&6
9420 if test "$cf_cv_widechar_funcs" != no ; then
9421         cat >> confdefs.h <<\EOF
9422 #define USE_WIDEC_SUPPORT 1
9423 EOF
9424
9425 else
9426         cat >> confdefs.h <<\EOF
9427 #define USE_WIDEC_SUPPORT 0
9428 EOF
9429
9430 fi
9431
9432 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
9433 echo "configure:9434: checking for pid_t" >&5
9434 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
9435   echo $ac_n "(cached) $ac_c" 1>&6
9436 else
9437   cat > conftest.$ac_ext <<EOF
9438 #line 9439 "configure"
9439 #include "confdefs.h"
9440 #include <sys/types.h>
9441 #if STDC_HEADERS
9442 #include <stdlib.h>
9443 #include <stddef.h>
9444 #endif
9445 EOF
9446 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9447   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9448   rm -rf conftest*
9449   ac_cv_type_pid_t=yes
9450 else
9451   rm -rf conftest*
9452   ac_cv_type_pid_t=no
9453 fi
9454 rm -f conftest*
9455
9456 fi
9457 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
9458 if test $ac_cv_type_pid_t = no; then
9459   cat >> confdefs.h <<\EOF
9460 #define pid_t int
9461 EOF
9462
9463 fi
9464
9465 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
9466 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
9467 echo "configure:9468: checking for vfork.h" >&5
9468 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9469   echo $ac_n "(cached) $ac_c" 1>&6
9470 else
9471   cat > conftest.$ac_ext <<EOF
9472 #line 9473 "configure"
9473 #include "confdefs.h"
9474 #include <vfork.h>
9475 EOF
9476 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9477 { (eval echo configure:9478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9478 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9479 if test -z "$ac_err"; then
9480   rm -rf conftest*
9481   eval "ac_cv_header_$ac_safe=yes"
9482 else
9483   echo "$ac_err" >&5
9484   echo "configure: failed program was:" >&5
9485   cat conftest.$ac_ext >&5
9486   rm -rf conftest*
9487   eval "ac_cv_header_$ac_safe=no"
9488 fi
9489 rm -f conftest*
9490 fi
9491 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9492   echo "$ac_t""yes" 1>&6
9493   cat >> confdefs.h <<\EOF
9494 #define HAVE_VFORK_H 1
9495 EOF
9496
9497 else
9498   echo "$ac_t""no" 1>&6
9499 fi
9500
9501 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
9502 echo "configure:9503: checking for working vfork" >&5
9503 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
9504   echo $ac_n "(cached) $ac_c" 1>&6
9505 else
9506   if test "$cross_compiling" = yes; then
9507   echo $ac_n "checking for vfork""... $ac_c" 1>&6
9508 echo "configure:9509: checking for vfork" >&5
9509 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
9510   echo $ac_n "(cached) $ac_c" 1>&6
9511 else
9512   cat > conftest.$ac_ext <<EOF
9513 #line 9514 "configure"
9514 #include "confdefs.h"
9515 /* System header to define __stub macros and hopefully few prototypes,
9516     which can conflict with char vfork(); below.  */
9517 #include <assert.h>
9518 /* Override any gcc2 internal prototype to avoid an error.  */
9519 /* We use char because int might match the return type of a gcc2
9520     builtin and then its argument prototype would still apply.  */
9521 char vfork();
9522
9523 int main() {
9524
9525 /* The GNU C library defines this for functions which it implements
9526     to always fail with ENOSYS.  Some functions are actually named
9527     something starting with __ and the normal name is an alias.  */
9528 #if defined (__stub_vfork) || defined (__stub___vfork)
9529 choke me
9530 #else
9531 vfork();
9532 #endif
9533
9534 ; return 0; }
9535 EOF
9536 if { (eval echo configure:9537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9537   rm -rf conftest*
9538   eval "ac_cv_func_vfork=yes"
9539 else
9540   echo "configure: failed program was:" >&5
9541   cat conftest.$ac_ext >&5
9542   rm -rf conftest*
9543   eval "ac_cv_func_vfork=no"
9544 fi
9545 rm -f conftest*
9546 fi
9547
9548 if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
9549   echo "$ac_t""yes" 1>&6
9550   :
9551 else
9552   echo "$ac_t""no" 1>&6
9553 fi
9554
9555 ac_cv_func_vfork_works=$ac_cv_func_vfork
9556 else
9557   cat > conftest.$ac_ext <<EOF
9558 #line 9559 "configure"
9559 #include "confdefs.h"
9560 /* Thanks to Paul Eggert for this test.  */
9561 #include <stdio.h>
9562 #include <sys/types.h>
9563 #include <sys/stat.h>
9564 #ifdef HAVE_UNISTD_H
9565 #include <unistd.h>
9566 #endif
9567 #ifdef HAVE_VFORK_H
9568 #include <vfork.h>
9569 #endif
9570 /* On some sparc systems, changes by the child to local and incoming
9571    argument registers are propagated back to the parent.
9572    The compiler is told about this with #include <vfork.h>,
9573    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
9574    Test for this by using a static variable whose address
9575    is put into a register that is clobbered by the vfork.  */
9576 static
9577 #ifdef __cplusplus
9578 sparc_address_test (int arg)
9579 #else
9580 sparc_address_test (arg) int arg;
9581 #endif
9582 {
9583   static pid_t child;
9584   if (!child) {
9585     child = vfork ();
9586     if (child < 0) {
9587       perror ("vfork");
9588       _exit(2);
9589     }
9590     if (!child) {
9591       arg = getpid();
9592       write(-1, "", 0);
9593       _exit (arg);
9594     }
9595   }
9596 }
9597 main() {
9598   pid_t parent = getpid ();
9599   pid_t child;
9600
9601   sparc_address_test ();
9602
9603   child = vfork ();
9604
9605   if (child == 0) {
9606     /* Here is another test for sparc vfork register problems.
9607        This test uses lots of local variables, at least
9608        as many local variables as main has allocated so far
9609        including compiler temporaries.  4 locals are enough for
9610        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
9611        A buggy compiler should reuse the register of parent
9612        for one of the local variables, since it will think that
9613        parent can't possibly be used any more in this routine.
9614        Assigning to the local variable will thus munge parent
9615        in the parent process.  */
9616     pid_t
9617       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
9618       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
9619     /* Convince the compiler that p..p7 are live; otherwise, it might
9620        use the same hardware register for all 8 local variables.  */
9621     if (p != p1 || p != p2 || p != p3 || p != p4
9622         || p != p5 || p != p6 || p != p7)
9623       _exit(1);
9624
9625     /* On some systems (e.g. IRIX 3.3),
9626        vfork doesn't separate parent from child file descriptors.
9627        If the child closes a descriptor before it execs or exits,
9628        this munges the parent's descriptor as well.
9629        Test for this by closing stdout in the child.  */
9630     _exit(close(fileno(stdout)) != 0);
9631   } else {
9632     int status;
9633     struct stat st;
9634
9635     while (wait(&status) != child)
9636       ;
9637     exit(
9638          /* Was there some problem with vforking?  */
9639          child < 0
9640
9641          /* Did the child fail?  (This shouldn't happen.)  */
9642          || status
9643
9644          /* Did the vfork/compiler bug occur?  */
9645          || parent != getpid()
9646
9647          /* Did the file descriptor bug occur?  */
9648          || fstat(fileno(stdout), &st) != 0
9649          );
9650   }
9651 }
9652 EOF
9653 if { (eval echo configure:9654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9654 then
9655   ac_cv_func_vfork_works=yes
9656 else
9657   echo "configure: failed program was:" >&5
9658   cat conftest.$ac_ext >&5
9659   rm -fr conftest*
9660   ac_cv_func_vfork_works=no
9661 fi
9662 rm -fr conftest*
9663 fi
9664
9665 fi
9666
9667 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
9668 if test $ac_cv_func_vfork_works = no; then
9669   cat >> confdefs.h <<\EOF
9670 #define vfork fork
9671 EOF
9672
9673 fi
9674
9675
9676 echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
9677 echo "configure:9678: checking if sys/time.h works with sys/select.h" >&5
9678 if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
9679   echo $ac_n "(cached) $ac_c" 1>&6
9680 else
9681   
9682 cat > conftest.$ac_ext <<EOF
9683 #line 9684 "configure"
9684 #include "confdefs.h"
9685
9686 #include <sys/types.h>
9687 #ifdef HAVE_SYS_TIME_H
9688 #include <sys/time.h>
9689 #endif
9690 #ifdef HAVE_SYS_SELECT_H
9691 #include <sys/select.h>
9692 #endif
9693
9694 int main() {
9695
9696 ; return 0; }
9697 EOF
9698 if { (eval echo configure:9699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9699   rm -rf conftest*
9700   cf_cv_sys_time_select=yes
9701 else
9702   echo "configure: failed program was:" >&5
9703   cat conftest.$ac_ext >&5
9704   rm -rf conftest*
9705   cf_cv_sys_time_select=no
9706 fi
9707 rm -f conftest*
9708      
9709 fi
9710
9711 echo "$ac_t""$cf_cv_sys_time_select" 1>&6
9712 test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF
9713 #define HAVE_SYS_TIME_SELECT 1
9714 EOF
9715
9716
9717
9718 echo $ac_n "checking for function curses_version""... $ac_c" 1>&6
9719 echo "configure:9720: checking for function curses_version" >&5
9720 if eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then
9721   echo $ac_n "(cached) $ac_c" 1>&6
9722 else
9723   
9724 if test "$cross_compiling" = yes; then
9725   cf_cv_func_curses_version=unknown
9726 else
9727   cat > conftest.$ac_ext <<EOF
9728 #line 9729 "configure"
9729 #include "confdefs.h"
9730
9731 #include <${cf_cv_ncurses_header-curses.h}>
9732 int main()
9733 {
9734         char temp[1024];
9735         sprintf(temp, "%s\n", curses_version());
9736         ${cf_cv_main_return-return}(0);
9737 }
9738
9739 EOF
9740 if { (eval echo configure:9741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9741 then
9742   cf_cv_func_curses_version=yes
9743
9744 else
9745   echo "configure: failed program was:" >&5
9746   cat conftest.$ac_ext >&5
9747   rm -fr conftest*
9748   cf_cv_func_curses_version=no
9749
9750 fi
9751 rm -fr conftest*
9752 fi
9753
9754 rm -f core
9755 fi
9756
9757 echo "$ac_t""$cf_cv_func_curses_version" 1>&6
9758 test "$cf_cv_func_curses_version" = yes && cat >> confdefs.h <<\EOF
9759 #define HAVE_CURSES_VERSION 1
9760 EOF
9761
9762
9763
9764 echo $ac_n "checking for ncurses wrap-prefix""... $ac_c" 1>&6
9765 echo "configure:9766: checking for ncurses wrap-prefix" >&5
9766
9767 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
9768 if test "${with_ncurses_wrap_prefix+set}" = set; then
9769   withval="$with_ncurses_wrap_prefix"
9770   NCURSES_WRAP_PREFIX=$withval
9771 else
9772   NCURSES_WRAP_PREFIX=_nc_
9773 fi
9774
9775 echo "$ac_t""$NCURSES_WRAP_PREFIX" 1>&6
9776
9777
9778
9779
9780 echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6
9781 echo "configure:9782: checking for alternate character set array" >&5
9782 if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then
9783   echo $ac_n "(cached) $ac_c" 1>&6
9784 else
9785   
9786 cf_cv_curses_acs_map=unknown
9787 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
9788 do
9789 cat > conftest.$ac_ext <<EOF
9790 #line 9791 "configure"
9791 #include "confdefs.h"
9792
9793 #include <${cf_cv_ncurses_header-curses.h}>
9794
9795 int main() {
9796
9797 $name['k'] = ACS_PLUS
9798
9799 ; return 0; }
9800 EOF
9801 if { (eval echo configure:9802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9802   rm -rf conftest*
9803   cf_cv_curses_acs_map=$name; break
9804 else
9805   echo "configure: failed program was:" >&5
9806   cat conftest.$ac_ext >&5
9807 fi
9808 rm -f conftest*
9809 done
9810
9811 fi
9812
9813 echo "$ac_t""$cf_cv_curses_acs_map" 1>&6
9814
9815 test "$cf_cv_curses_acs_map" != unknown && cat >> confdefs.h <<EOF
9816 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
9817 EOF
9818
9819
9820
9821 echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6
9822 echo "configure:9823: checking for wide alternate character set array" >&5
9823 if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then
9824   echo $ac_n "(cached) $ac_c" 1>&6
9825 else
9826   
9827         cf_cv_curses_wacs_map=unknown
9828         for name in wacs_map _wacs_map __wacs_map _nc_wacs
9829         do
9830         cat > conftest.$ac_ext <<EOF
9831 #line 9832 "configure"
9832 #include "confdefs.h"
9833
9834 #ifndef _XOPEN_SOURCE_EXTENDED
9835 #define _XOPEN_SOURCE_EXTENDED
9836 #endif
9837 #include <${cf_cv_ncurses_header-curses.h}>
9838 int main() {
9839 $name['k'] = *WACS_PLUS
9840 ; return 0; }
9841 EOF
9842 if { (eval echo configure:9843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9843   rm -rf conftest*
9844   cf_cv_curses_wacs_map=$name
9845          break
9846 else
9847   echo "configure: failed program was:" >&5
9848   cat conftest.$ac_ext >&5
9849 fi
9850 rm -f conftest*
9851         done
9852 fi
9853
9854 echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6
9855
9856
9857
9858 echo $ac_n "checking for type attr_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
9859 echo "configure:9860: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5
9860 cat > conftest.$ac_ext <<EOF
9861 #line 9862 "configure"
9862 #include "confdefs.h"
9863
9864 #ifndef _XOPEN_SOURCE_EXTENDED
9865 #define _XOPEN_SOURCE_EXTENDED
9866 #endif
9867 #include <${cf_cv_ncurses_header-curses.h}>
9868 int main() {
9869
9870 attr_t foo
9871
9872 ; return 0; }
9873 EOF
9874 if { (eval echo configure:9875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9875   rm -rf conftest*
9876   cf_result=yes
9877 else
9878   echo "configure: failed program was:" >&5
9879   cat conftest.$ac_ext >&5
9880   rm -rf conftest*
9881   cf_result=no
9882 fi
9883 rm -f conftest*
9884 echo "$ac_t""$cf_result" 1>&6
9885 if test $cf_result = yes ; then
9886         
9887 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9888
9889         cat >> confdefs.h <<EOF
9890 #define $cf_result 1
9891 EOF
9892
9893 else
9894         cat >> confdefs.h <<EOF
9895 #define attr_t long
9896 EOF
9897
9898 fi
9899
9900
9901
9902 # This is needed on Tru64 5.0 to declare mbstate_t
9903 echo $ac_n "checking if we must include wchar.h to declare mbstate_t""... $ac_c" 1>&6
9904 echo "configure:9905: checking if we must include wchar.h to declare mbstate_t" >&5
9905 if eval "test \"`echo '$''{'cf_cv_mbstate_t'+set}'`\" = set"; then
9906   echo $ac_n "(cached) $ac_c" 1>&6
9907 else
9908   
9909 cat > conftest.$ac_ext <<EOF
9910 #line 9911 "configure"
9911 #include "confdefs.h"
9912
9913 #include <stdlib.h>
9914 #include <stdarg.h>
9915 #include <stdio.h>
9916 #ifdef HAVE_LIBUTF8_H
9917 #include <libutf8.h>
9918 #endif
9919 int main() {
9920 mbstate_t state
9921 ; return 0; }
9922 EOF
9923 if { (eval echo configure:9924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9924   rm -rf conftest*
9925   cf_cv_mbstate_t=no
9926 else
9927   echo "configure: failed program was:" >&5
9928   cat conftest.$ac_ext >&5
9929   rm -rf conftest*
9930   cat > conftest.$ac_ext <<EOF
9931 #line 9932 "configure"
9932 #include "confdefs.h"
9933
9934 #include <stdlib.h>
9935 #include <stdarg.h>
9936 #include <stdio.h>
9937 #include <wchar.h>
9938 #ifdef HAVE_LIBUTF8_H
9939 #include <libutf8.h>
9940 #endif
9941 int main() {
9942 mbstate_t value
9943 ; return 0; }
9944 EOF
9945 if { (eval echo configure:9946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9946   rm -rf conftest*
9947   cf_cv_mbstate_t=yes
9948 else
9949   echo "configure: failed program was:" >&5
9950   cat conftest.$ac_ext >&5
9951   rm -rf conftest*
9952   cf_cv_mbstate_t=unknown
9953 fi
9954 rm -f conftest*
9955 fi
9956 rm -f conftest*
9957 fi
9958
9959 echo "$ac_t""$cf_cv_mbstate_t" 1>&6
9960
9961 if test "$cf_cv_mbstate_t" = yes ; then
9962         cat >> confdefs.h <<\EOF
9963 #define NEED_WCHAR_H 1
9964 EOF
9965
9966         NEED_WCHAR_H=1
9967 fi
9968
9969
9970 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
9971 if test "$cf_cv_mbstate_t" = unknown ; then
9972         NCURSES_MBSTATE_T=1
9973 fi
9974
9975
9976 # if we find mbstate_t in either place, use substitution to provide a fallback.
9977 if test "$cf_cv_mbstate_t" != unknown ; then
9978         NCURSES_OK_MBSTATE_T=1
9979 fi
9980
9981
9982
9983 # This is needed on Tru64 5.0 to declare wchar_t
9984 echo $ac_n "checking if we must include wchar.h to declare wchar_t""... $ac_c" 1>&6
9985 echo "configure:9986: checking if we must include wchar.h to declare wchar_t" >&5
9986 if eval "test \"`echo '$''{'cf_cv_wchar_t'+set}'`\" = set"; then
9987   echo $ac_n "(cached) $ac_c" 1>&6
9988 else
9989   
9990 cat > conftest.$ac_ext <<EOF
9991 #line 9992 "configure"
9992 #include "confdefs.h"
9993
9994 #include <stdlib.h>
9995 #include <stdarg.h>
9996 #include <stdio.h>
9997 #ifdef HAVE_LIBUTF8_H
9998 #include <libutf8.h>
9999 #endif
10000 int main() {
10001 wchar_t state
10002 ; return 0; }
10003 EOF
10004 if { (eval echo configure:10005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10005   rm -rf conftest*
10006   cf_cv_wchar_t=no
10007 else
10008   echo "configure: failed program was:" >&5
10009   cat conftest.$ac_ext >&5
10010   rm -rf conftest*
10011   cat > conftest.$ac_ext <<EOF
10012 #line 10013 "configure"
10013 #include "confdefs.h"
10014
10015 #include <stdlib.h>
10016 #include <stdarg.h>
10017 #include <stdio.h>
10018 #include <wchar.h>
10019 #ifdef HAVE_LIBUTF8_H
10020 #include <libutf8.h>
10021 #endif
10022 int main() {
10023 wchar_t value
10024 ; return 0; }
10025 EOF
10026 if { (eval echo configure:10027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10027   rm -rf conftest*
10028   cf_cv_wchar_t=yes
10029 else
10030   echo "configure: failed program was:" >&5
10031   cat conftest.$ac_ext >&5
10032   rm -rf conftest*
10033   cf_cv_wchar_t=unknown
10034 fi
10035 rm -f conftest*
10036 fi
10037 rm -f conftest*
10038 fi
10039
10040 echo "$ac_t""$cf_cv_wchar_t" 1>&6
10041
10042 if test "$cf_cv_wchar_t" = yes ; then
10043         cat >> confdefs.h <<\EOF
10044 #define NEED_WCHAR_H 1
10045 EOF
10046
10047         NEED_WCHAR_H=1
10048 fi
10049
10050
10051 # if we do not find wchar_t in either place, use substitution to provide a fallback.
10052 if test "$cf_cv_wchar_t" = unknown ; then
10053         NCURSES_WCHAR_T=1
10054 fi
10055
10056
10057 # if we find wchar_t in either place, use substitution to provide a fallback.
10058 if test "$cf_cv_wchar_t" != unknown ; then
10059         NCURSES_OK_WCHAR_T=1
10060 fi
10061
10062
10063
10064 # This is needed on Tru64 5.0 to declare wint_t
10065 echo $ac_n "checking if we must include wchar.h to declare wint_t""... $ac_c" 1>&6
10066 echo "configure:10067: checking if we must include wchar.h to declare wint_t" >&5
10067 if eval "test \"`echo '$''{'cf_cv_wint_t'+set}'`\" = set"; then
10068   echo $ac_n "(cached) $ac_c" 1>&6
10069 else
10070   
10071 cat > conftest.$ac_ext <<EOF
10072 #line 10073 "configure"
10073 #include "confdefs.h"
10074
10075 #include <stdlib.h>
10076 #include <stdarg.h>
10077 #include <stdio.h>
10078 #ifdef HAVE_LIBUTF8_H
10079 #include <libutf8.h>
10080 #endif
10081 int main() {
10082 wint_t state
10083 ; return 0; }
10084 EOF
10085 if { (eval echo configure:10086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10086   rm -rf conftest*
10087   cf_cv_wint_t=no
10088 else
10089   echo "configure: failed program was:" >&5
10090   cat conftest.$ac_ext >&5
10091   rm -rf conftest*
10092   cat > conftest.$ac_ext <<EOF
10093 #line 10094 "configure"
10094 #include "confdefs.h"
10095
10096 #include <stdlib.h>
10097 #include <stdarg.h>
10098 #include <stdio.h>
10099 #include <wchar.h>
10100 #ifdef HAVE_LIBUTF8_H
10101 #include <libutf8.h>
10102 #endif
10103 int main() {
10104 wint_t value
10105 ; return 0; }
10106 EOF
10107 if { (eval echo configure:10108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10108   rm -rf conftest*
10109   cf_cv_wint_t=yes
10110 else
10111   echo "configure: failed program was:" >&5
10112   cat conftest.$ac_ext >&5
10113   rm -rf conftest*
10114   cf_cv_wint_t=unknown
10115 fi
10116 rm -f conftest*
10117 fi
10118 rm -f conftest*
10119 fi
10120
10121 echo "$ac_t""$cf_cv_wint_t" 1>&6
10122
10123 if test "$cf_cv_wint_t" = yes ; then
10124         cat >> confdefs.h <<\EOF
10125 #define NEED_WCHAR_H 1
10126 EOF
10127
10128         NEED_WCHAR_H=1
10129 fi
10130
10131
10132 # if we do not find wint_t in either place, use substitution to provide a fallback.
10133 if test "$cf_cv_wint_t" = unknown ; then
10134         NCURSES_WINT_T=1
10135 fi
10136
10137
10138 # if we find wint_t in either place, use substitution to provide a fallback.
10139 if test "$cf_cv_wint_t" != unknown ; then
10140         NCURSES_OK_WINT_T=1
10141 fi
10142
10143
10144
10145 if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
10146         
10147 echo $ac_n "checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
10148 echo "configure:10149: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5
10149 cat > conftest.$ac_ext <<EOF
10150 #line 10151 "configure"
10151 #include "confdefs.h"
10152
10153 #ifndef _XOPEN_SOURCE_EXTENDED
10154 #define _XOPEN_SOURCE_EXTENDED
10155 #endif
10156 #include <${cf_cv_ncurses_header-curses.h}>
10157 int main() {
10158
10159 mbstate_t foo
10160
10161 ; return 0; }
10162 EOF
10163 if { (eval echo configure:10164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10164   rm -rf conftest*
10165   cf_result=yes
10166 else
10167   echo "configure: failed program was:" >&5
10168   cat conftest.$ac_ext >&5
10169   rm -rf conftest*
10170   cf_result=no
10171 fi
10172 rm -f conftest*
10173 echo "$ac_t""$cf_result" 1>&6
10174 if test $cf_result = yes ; then
10175         
10176 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10177
10178         cat >> confdefs.h <<EOF
10179 #define $cf_result 1
10180 EOF
10181
10182 else
10183         cat >> confdefs.h <<EOF
10184 #define mbstate_t long
10185 EOF
10186
10187 fi
10188
10189 fi
10190
10191 if test "$NCURSES_OK_WCHAR_T" = 0 ; then
10192         
10193 echo $ac_n "checking for type wchar_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
10194 echo "configure:10195: checking for type wchar_t in ${cf_cv_ncurses_header-curses.h}" >&5
10195 cat > conftest.$ac_ext <<EOF
10196 #line 10197 "configure"
10197 #include "confdefs.h"
10198
10199 #ifndef _XOPEN_SOURCE_EXTENDED
10200 #define _XOPEN_SOURCE_EXTENDED
10201 #endif
10202 #include <${cf_cv_ncurses_header-curses.h}>
10203 int main() {
10204
10205 wchar_t foo
10206
10207 ; return 0; }
10208 EOF
10209 if { (eval echo configure:10210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10210   rm -rf conftest*
10211   cf_result=yes
10212 else
10213   echo "configure: failed program was:" >&5
10214   cat conftest.$ac_ext >&5
10215   rm -rf conftest*
10216   cf_result=no
10217 fi
10218 rm -f conftest*
10219 echo "$ac_t""$cf_result" 1>&6
10220 if test $cf_result = yes ; then
10221         
10222 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10223
10224         cat >> confdefs.h <<EOF
10225 #define $cf_result 1
10226 EOF
10227
10228 else
10229         cat >> confdefs.h <<EOF
10230 #define wchar_t long
10231 EOF
10232
10233 fi
10234
10235 fi
10236
10237 if test "$NCURSES_OK_WINT_T" = 0 ; then
10238         
10239 echo $ac_n "checking for type wint_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
10240 echo "configure:10241: checking for type wint_t in ${cf_cv_ncurses_header-curses.h}" >&5
10241 cat > conftest.$ac_ext <<EOF
10242 #line 10243 "configure"
10243 #include "confdefs.h"
10244
10245 #ifndef _XOPEN_SOURCE_EXTENDED
10246 #define _XOPEN_SOURCE_EXTENDED
10247 #endif
10248 #include <${cf_cv_ncurses_header-curses.h}>
10249 int main() {
10250
10251 wint_t foo
10252
10253 ; return 0; }
10254 EOF
10255 if { (eval echo configure:10256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10256   rm -rf conftest*
10257   cf_result=yes
10258 else
10259   echo "configure: failed program was:" >&5
10260   cat conftest.$ac_ext >&5
10261   rm -rf conftest*
10262   cf_result=no
10263 fi
10264 rm -f conftest*
10265 echo "$ac_t""$cf_result" 1>&6
10266 if test $cf_result = yes ; then
10267         
10268 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10269
10270         cat >> confdefs.h <<EOF
10271 #define $cf_result 1
10272 EOF
10273
10274 else
10275         cat >> confdefs.h <<EOF
10276 #define wint_t long
10277 EOF
10278
10279 fi
10280
10281 fi
10282
10283
10284 echo $ac_n "checking for data boolnames declaration in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
10285 echo "configure:10286: checking for data boolnames declaration in ${cf_cv_ncurses_header-curses.h}" >&5
10286 cat > conftest.$ac_ext <<EOF
10287 #line 10288 "configure"
10288 #include "confdefs.h"
10289
10290 #ifdef HAVE_XCURSES
10291 #include <xcurses.h>
10292 char * XCursesProgramName = "test";
10293 #else
10294 #include <${cf_cv_ncurses_header-curses.h}>
10295 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
10296 #include <ncursesw/term.h>
10297 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
10298 #include <ncurses/term.h>
10299 #elif defined(HAVE_TERM_H)
10300 #include <term.h>
10301 #endif
10302 #endif
10303
10304 int main() {
10305
10306 void *foo = &(boolnames)
10307
10308 ; return 0; }
10309 EOF
10310 if { (eval echo configure:10311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10311   rm -rf conftest*
10312   cf_result=yes
10313 else
10314   echo "configure: failed program was:" >&5
10315   cat conftest.$ac_ext >&5
10316   rm -rf conftest*
10317   cf_result=no
10318 fi
10319 rm -f conftest*
10320 echo "$ac_t""$cf_result" 1>&6
10321 if test $cf_result = yes ; then
10322         
10323 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10324
10325         cat >> confdefs.h <<EOF
10326 #define $cf_result 1
10327 EOF
10328
10329 else
10330         echo $ac_n "checking for data boolnames in library""... $ac_c" 1>&6
10331 echo "configure:10332: checking for data boolnames in library" >&5
10332         cat > conftest.$ac_ext <<EOF
10333 #line 10334 "configure"
10334 #include "confdefs.h"
10335
10336 #ifdef HAVE_XCURSES
10337 #include <xcurses.h>
10338 char * XCursesProgramName = "test";
10339 #else
10340 #include <${cf_cv_ncurses_header-curses.h}>
10341 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
10342 #include <ncursesw/term.h>
10343 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
10344 #include <ncurses/term.h>
10345 #elif defined(HAVE_TERM_H)
10346 #include <term.h>
10347 #endif
10348 #endif
10349
10350 extern char boolnames;
10351 int main() {
10352
10353         do {
10354                 void *foo = &(boolnames);
10355                 ${cf_cv_main_return-return}(foo == 0);
10356         } while (0)
10357
10358 ; return 0; }
10359 EOF
10360 if { (eval echo configure:10361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10361   rm -rf conftest*
10362   cf_result=yes
10363 else
10364   echo "configure: failed program was:" >&5
10365   cat conftest.$ac_ext >&5
10366   rm -rf conftest*
10367   cf_result=no
10368 fi
10369 rm -f conftest*
10370         echo "$ac_t""$cf_result" 1>&6
10371         if test $cf_result = yes ; then
10372                 
10373 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10374
10375                 cat >> confdefs.h <<EOF
10376 #define $cf_result 1
10377 EOF
10378
10379         fi
10380 fi
10381
10382
10383 echo $ac_n "checking for data boolfnames declaration in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
10384 echo "configure:10385: checking for data boolfnames declaration in ${cf_cv_ncurses_header-curses.h}" >&5
10385 cat > conftest.$ac_ext <<EOF
10386 #line 10387 "configure"
10387 #include "confdefs.h"
10388
10389 #ifdef HAVE_XCURSES
10390 #include <xcurses.h>
10391 char * XCursesProgramName = "test";
10392 #else
10393 #include <${cf_cv_ncurses_header-curses.h}>
10394 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
10395 #include <ncursesw/term.h>
10396 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
10397 #include <ncurses/term.h>
10398 #elif defined(HAVE_TERM_H)
10399 #include <term.h>
10400 #endif
10401 #endif
10402
10403 int main() {
10404
10405 void *foo = &(boolfnames)
10406
10407 ; return 0; }
10408 EOF
10409 if { (eval echo configure:10410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10410   rm -rf conftest*
10411   cf_result=yes
10412 else
10413   echo "configure: failed program was:" >&5
10414   cat conftest.$ac_ext >&5
10415   rm -rf conftest*
10416   cf_result=no
10417 fi
10418 rm -f conftest*
10419 echo "$ac_t""$cf_result" 1>&6
10420 if test $cf_result = yes ; then
10421         
10422 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10423
10424         cat >> confdefs.h <<EOF
10425 #define $cf_result 1
10426 EOF
10427
10428 else
10429         echo $ac_n "checking for data boolfnames in library""... $ac_c" 1>&6
10430 echo "configure:10431: checking for data boolfnames in library" >&5
10431         cat > conftest.$ac_ext <<EOF
10432 #line 10433 "configure"
10433 #include "confdefs.h"
10434
10435 #ifdef HAVE_XCURSES
10436 #include <xcurses.h>
10437 char * XCursesProgramName = "test";
10438 #else
10439 #include <${cf_cv_ncurses_header-curses.h}>
10440 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
10441 #include <ncursesw/term.h>
10442 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
10443 #include <ncurses/term.h>
10444 #elif defined(HAVE_TERM_H)
10445 #include <term.h>
10446 #endif
10447 #endif
10448
10449 extern char boolfnames;
10450 int main() {
10451
10452         do {
10453                 void *foo = &(boolfnames);
10454                 ${cf_cv_main_return-return}(foo == 0);
10455         } while (0)
10456
10457 ; return 0; }
10458 EOF
10459 if { (eval echo configure:10460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10460   rm -rf conftest*
10461   cf_result=yes
10462 else
10463   echo "configure: failed program was:" >&5
10464   cat conftest.$ac_ext >&5
10465   rm -rf conftest*
10466   cf_result=no
10467 fi
10468 rm -f conftest*
10469         echo "$ac_t""$cf_result" 1>&6
10470         if test $cf_result = yes ; then
10471                 
10472 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10473
10474                 cat >> confdefs.h <<EOF
10475 #define $cf_result 1
10476 EOF
10477
10478         fi
10479 fi
10480
10481
10482 TEST_ARGS="$LIBS"
10483 LIBS=
10484
10485
10486 trap '' 1 2 15
10487 cat > confcache <<\EOF
10488 # This file is a shell script that caches the results of configure
10489 # tests run on this system so they can be shared between configure
10490 # scripts and configure runs.  It is not useful on other systems.
10491 # If it contains results you don't want to keep, you may remove or edit it.
10492 #
10493 # By default, configure uses ./config.cache as the cache file,
10494 # creating it if it does not exist already.  You can give configure
10495 # the --cache-file=FILE option to use a different cache file; that is
10496 # what configure does when it calls configure scripts in
10497 # subdirectories, so they share the cache.
10498 # Giving --cache-file=/dev/null disables caching, for debugging configure.
10499 # config.status only pays attention to the cache file if you give it the
10500 # --recheck option to rerun configure.
10501 #
10502 EOF
10503 # The following way of writing the cache mishandles newlines in values,
10504 # but we know of no workaround that is simple, portable, and efficient.
10505 # So, don't put newlines in cache variables' values.
10506 # Ultrix sh set writes to stderr and can't be redirected directly,
10507 # and sets the high bit in the cache file unless we assign to the vars.
10508 (set) 2>&1 |
10509   case `(ac_space=' '; set | grep ac_space) 2>&1` in
10510   *ac_space=\ *)
10511     # `set' does not quote correctly, so add quotes (double-quote substitution
10512     # turns \\\\ into \\, and sed turns \\ into \).
10513     sed -n \
10514       -e "s/'/'\\\\''/g" \
10515       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
10516     ;;
10517   *)
10518     # `set' quotes correctly as required by POSIX, so do not add quotes.
10519     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
10520     ;;
10521   esac >> confcache
10522 if cmp -s $cache_file confcache; then
10523   :
10524 else
10525   if test -w $cache_file; then
10526     echo "updating cache $cache_file"
10527     cat confcache > $cache_file
10528   else
10529     echo "not updating unwritable cache $cache_file"
10530   fi
10531 fi
10532 rm -f confcache
10533
10534 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
10535
10536 test "x$prefix" = xNONE && prefix=$ac_default_prefix
10537 # Let make expand exec_prefix.
10538 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
10539
10540 # Any assignment to VPATH causes Sun make to only execute
10541 # the first set of double-colon rules, so remove it if not needed.
10542 # If there is a colon in the path, we need to keep it.
10543 if test "x$srcdir" = x.; then
10544   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
10545 fi
10546
10547 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
10548
10549 DEFS=-DHAVE_CONFIG_H
10550
10551 # Without the "./", some shells look in PATH for config.status.
10552 : ${CONFIG_STATUS=./config.status}
10553
10554 echo creating $CONFIG_STATUS
10555 rm -f $CONFIG_STATUS
10556 cat > $CONFIG_STATUS <<EOF
10557 #! /bin/sh
10558 # Generated automatically by configure.
10559 # Run this file to recreate the current configuration.
10560 # This directory was configured as follows,
10561 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10562 #
10563 # $0 $ac_configure_args
10564 #
10565 # Compiler output produced by configure, useful for debugging
10566 # configure, is in ./config.log if it exists.
10567
10568 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
10569 for ac_option
10570 do
10571   case "\$ac_option" in
10572   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
10573     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
10574     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
10575   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
10576     echo "$CONFIG_STATUS generated by autoconf version 2.13.20030927"
10577     exit 0 ;;
10578   -help | --help | --hel | --he | --h)
10579     echo "\$ac_cs_usage"; exit 0 ;;
10580   *) echo "\$ac_cs_usage"; exit 1 ;;
10581   esac
10582 done
10583
10584 ac_given_srcdir=$srcdir
10585
10586 trap 'rm -fr `echo "Makefile ncurses_cfg.h:ncurses_tst.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
10587 EOF
10588 cat >> $CONFIG_STATUS <<EOF
10589
10590 # Protect against being on the right side of a sed subst in config.status.
10591 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
10592  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
10593 $ac_vpsub
10594 $extrasub
10595 s%@SHELL@%$SHELL%g
10596 s%@CFLAGS@%$CFLAGS%g
10597 s%@CPPFLAGS@%$CPPFLAGS%g
10598 s%@CXXFLAGS@%$CXXFLAGS%g
10599 s%@FFLAGS@%$FFLAGS%g
10600 s%@DEFS@%$DEFS%g
10601 s%@LDFLAGS@%$LDFLAGS%g
10602 s%@LIBS@%$LIBS%g
10603 s%@exec_prefix@%$exec_prefix%g
10604 s%@prefix@%$prefix%g
10605 s%@program_transform_name@%$program_transform_name%g
10606 s%@bindir@%$bindir%g
10607 s%@sbindir@%$sbindir%g
10608 s%@libexecdir@%$libexecdir%g
10609 s%@datadir@%$datadir%g
10610 s%@sysconfdir@%$sysconfdir%g
10611 s%@sharedstatedir@%$sharedstatedir%g
10612 s%@localstatedir@%$localstatedir%g
10613 s%@libdir@%$libdir%g
10614 s%@includedir@%$includedir%g
10615 s%@oldincludedir@%$oldincludedir%g
10616 s%@infodir@%$infodir%g
10617 s%@mandir@%$mandir%g
10618 s%@host@%$host%g
10619 s%@host_alias@%$host_alias%g
10620 s%@host_cpu@%$host_cpu%g
10621 s%@host_vendor@%$host_vendor%g
10622 s%@host_os@%$host_os%g
10623 s%@SET_MAKE@%$SET_MAKE%g
10624 s%@CC@%$CC%g
10625 s%@CPP@%$CPP%g
10626 s%@AWK@%$AWK%g
10627 s%@CTAGS@%$CTAGS%g
10628 s%@ETAGS@%$ETAGS%g
10629 s%@MAKE_LOWER_TAGS@%$MAKE_LOWER_TAGS%g
10630 s%@MAKE_UPPER_TAGS@%$MAKE_UPPER_TAGS%g
10631 s%@CC_G_OPT@%$CC_G_OPT%g
10632 s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
10633 s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
10634 s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
10635 s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
10636 s%@LD@%$LD%g
10637 s%@LDFLAGS_SHARED@%$LDFLAGS_SHARED%g
10638 s%@LDFLAGS_STATIC@%$LDFLAGS_STATIC%g
10639 s%@LD_MODEL@%$LD_MODEL%g
10640 s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
10641 s%@LIBTOOL@%$LIBTOOL%g
10642 s%@LIB_CLEAN@%$LIB_CLEAN%g
10643 s%@LIB_COMPILE@%$LIB_COMPILE%g
10644 s%@LIB_LINK@%$LIB_LINK%g
10645 s%@LINK_TESTS@%$LINK_TESTS%g
10646 s%@LINT@%$LINT%g
10647 s%@LINT_OPTS@%$LINT_OPTS%g
10648 s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
10649 s%@MATH_LIB@%$MATH_LIB%g
10650 s%@PTHREAD@%$PTHREAD%g
10651 s%@TEST_ARGS@%$TEST_ARGS%g
10652 s%@TEST_DEPS@%$TEST_DEPS%g
10653 s%@TEST_LIBS@%$TEST_LIBS%g
10654 s%@TINFO_ARGS@%$TINFO_ARGS%g
10655 s%@cf_cv_abi_version@%$cf_cv_abi_version%g
10656 s%@cf_cv_rel_version@%$cf_cv_rel_version%g
10657 s%@EXEEXT@%$EXEEXT%g
10658 s%@OBJEXT@%$OBJEXT%g
10659 s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%g
10660 s%@ECHO_LT@%$ECHO_LT%g
10661 s%@ECHO_LD@%$ECHO_LD%g
10662 s%@RULE_CC@%$RULE_CC%g
10663 s%@SHOW_CC@%$SHOW_CC%g
10664 s%@ECHO_CC@%$ECHO_CC%g
10665 s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
10666 s%@NCURSES_CONFIG@%$NCURSES_CONFIG%g
10667 s%@PKG_CONFIG@%$PKG_CONFIG%g
10668 s%@X_CFLAGS@%$X_CFLAGS%g
10669 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
10670 s%@X_LIBS@%$X_LIBS%g
10671 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
10672 s%@XCURSES_CONFIG@%$XCURSES_CONFIG%g
10673 s%@NCURSES_WRAP_PREFIX@%$NCURSES_WRAP_PREFIX%g
10674
10675 CEOF
10676 EOF
10677
10678 cat >> $CONFIG_STATUS <<\EOF
10679
10680 # Split the substitutions into bite-sized pieces for seds with
10681 # small command number limits, like on Digital OSF/1 and HP-UX.
10682 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
10683 ac_file=1 # Number of current file.
10684 ac_beg=1 # First line for current file.
10685 ac_end=$ac_max_sed_cmds # Line after last line for current file.
10686 ac_more_lines=:
10687 ac_sed_cmds=""
10688 while $ac_more_lines; do
10689   if test $ac_beg -gt 1; then
10690     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
10691   else
10692     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
10693   fi
10694   if test ! -s conftest.s$ac_file; then
10695     ac_more_lines=false
10696     rm -f conftest.s$ac_file
10697   else
10698     if test -z "$ac_sed_cmds"; then
10699       ac_sed_cmds="sed -f conftest.s$ac_file"
10700     else
10701       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
10702     fi
10703     ac_file=`expr $ac_file + 1`
10704     ac_beg=$ac_end
10705     ac_end=`expr $ac_end + $ac_max_sed_cmds`
10706   fi
10707 done
10708 if test -z "$ac_sed_cmds"; then
10709   ac_sed_cmds=cat
10710 fi
10711 EOF
10712
10713 cat >> $CONFIG_STATUS <<EOF
10714
10715 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
10716 EOF
10717 cat >> $CONFIG_STATUS <<\EOF
10718 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
10719   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10720   case "$ac_file" in
10721   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10722        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10723   *) ac_file_in="${ac_file}.in" ;;
10724   esac
10725
10726   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
10727
10728   # Remove last slash and all that follows it.  Not all systems have dirname.
10729   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10730   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10731     # The file is in a subdirectory.
10732     test ! -d "$ac_dir" && mkdir "$ac_dir"
10733     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
10734     # A "../" for each directory in $ac_dir_suffix.
10735     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
10736   else
10737     ac_dir_suffix= ac_dots=
10738   fi
10739
10740   case "$ac_given_srcdir" in
10741   .)  srcdir=.
10742       if test -z "$ac_dots"; then top_srcdir=.
10743       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
10744   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
10745   *) # Relative path.
10746     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
10747     top_srcdir="$ac_dots$ac_given_srcdir" ;;
10748   esac
10749
10750
10751   echo creating "$ac_file"
10752   rm -f "$ac_file"
10753   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
10754   case "$ac_file" in
10755   *Makefile*) ac_comsub="1i\\
10756 # $configure_input" ;;
10757   *) ac_comsub= ;;
10758   esac
10759
10760   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10761   sed -e "$ac_comsub
10762 s%@configure_input@%$configure_input%g
10763 s%@srcdir@%$srcdir%g
10764 s%@top_srcdir@%$top_srcdir%g
10765 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
10766 fi; done
10767 rm -f conftest.s*
10768
10769 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
10770 # NAME is the cpp macro being defined and VALUE is the value it is being given.
10771 #
10772 # ac_d sets the value in "#define NAME VALUE" lines.
10773 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
10774 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
10775 ac_dC='\3'
10776 ac_dD='%g'
10777 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
10778 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10779 ac_uB='\([      ]\)%\1#\2define\3'
10780 ac_uC=' '
10781 ac_uD='\4%g'
10782 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
10783 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10784 ac_eB='$%\1#\2define\3'
10785 ac_eC=' '
10786 ac_eD='%g'
10787
10788 if test "${CONFIG_HEADERS+set}" != set; then
10789 EOF
10790 cat >> $CONFIG_STATUS <<EOF
10791   CONFIG_HEADERS="ncurses_cfg.h:ncurses_tst.hin"
10792 EOF
10793 cat >> $CONFIG_STATUS <<\EOF
10794 fi
10795 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
10796   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10797   case "$ac_file" in
10798   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10799        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10800   *) ac_file_in="${ac_file}.in" ;;
10801   esac
10802
10803   echo creating $ac_file
10804
10805   rm -f conftest.frag conftest.in conftest.out
10806   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10807   cat $ac_file_inputs > conftest.in
10808
10809 EOF
10810
10811
10812 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
10813 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
10814 # be either 'cat' or 'sort'.
10815 cat confdefs.h >conftest.vals
10816
10817 # Break up conftest.vals because some shells have a limit on
10818 # the size of here documents, and old seds have small limits too.
10819
10820 rm -f conftest.tail
10821 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
10822 while :
10823 do
10824   ac_lines=`grep -c . conftest.vals`
10825   # grep -c gives empty output for an empty file on some AIX systems.
10826   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
10827   # Write chunks of a limited-size here document to conftest.frag.
10828   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
10829   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
10830   echo 'CEOF' >> $CONFIG_STATUS
10831   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
10832   rm -f conftest.vals
10833   mv conftest.tail conftest.vals
10834 done
10835 rm -f conftest.vals
10836
10837 # Run sed to substitute the contents of conftest.frag into conftest.in at the
10838 # marker @DEFS@.
10839 echo '  cat >> conftest.edit <<CEOF
10840 /@DEFS@/r conftest.frag
10841 /@DEFS@/d
10842 CEOF
10843 sed -f conftest.edit conftest.in > conftest.out
10844 rm -f conftest.in
10845 mv conftest.out conftest.in
10846 rm -f conftest.edit conftest.frag
10847 ' >> $CONFIG_STATUS
10848
10849
10850 cat >> $CONFIG_STATUS <<\EOF
10851   rm -f conftest.frag conftest.h
10852   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
10853   cat conftest.in >> conftest.h
10854   rm -f conftest.in
10855   if cmp -s $ac_file conftest.h 2>/dev/null; then
10856     echo "$ac_file is unchanged"
10857     rm -f conftest.h
10858   else
10859     # Remove last slash and all that follows it.  Not all systems have dirname.
10860       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10861       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10862       # The file is in a subdirectory.
10863       test ! -d "$ac_dir" && mkdir "$ac_dir"
10864     fi
10865     rm -f $ac_file
10866     mv conftest.h $ac_file
10867   fi
10868 fi; done
10869
10870 EOF
10871 cat >> $CONFIG_STATUS <<EOF
10872 # Extra initialization commands, if any
10873
10874 AWK="$AWK"
10875 ECHO_LD="$ECHO_LD"
10876
10877 EOF
10878 cat >> $CONFIG_STATUS <<\EOF
10879 # Extra commands, if any
10880
10881
10882 for cf_dir in .
10883 do
10884         if test ! -d $srcdir/$cf_dir; then
10885                 continue
10886         elif test -f $srcdir/$cf_dir/programs; then
10887                 $AWK -f $srcdir/mk-test.awk ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
10888         fi
10889 done
10890
10891
10892         cat >>Makefile <<TEST_EOF
10893
10894 # These rules are generated so we do not rely on suffix rules, which do not
10895 # work consistently for different make-programs (the '\$(MODEL)/' confuses
10896 # some, and the '\$x' confuses others).
10897 TEST_EOF
10898 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
10899 for N in $LIST
10900 do
10901         cat >>Makefile <<TEST_EOF
10902
10903 \$(MODEL)/$N.o : $N.c \\
10904         test.priv.h \\
10905         ncurses_cfg.h
10906         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
10907 TEST_EOF
10908 done
10909
10910 exit 0
10911 EOF
10912 chmod +x $CONFIG_STATUS
10913 rm -fr confdefs* $ac_clean_files
10914 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
10915