]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.1 - patch 20190831
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20190828.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 runstatedir='${localstatedir}/run'
143 libdir='${exec_prefix}/lib'
144 includedir='${prefix}/include'
145 oldincludedir='/usr/include'
146 infodir='${datarootdir}/info'
147 mandir='${datarootdir}/man'
148
149 # Identity of this package.
150 PACKAGE_NAME=
151 PACKAGE_TARNAME=
152 PACKAGE_VERSION=
153 PACKAGE_STRING=
154 PACKAGE_BUGREPORT=
155
156 ac_prev=
157 for ac_option
158 do
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
167
168   # Accept the important Cygnus configure options, so we can diagnose typos.
169
170   case $ac_option in
171
172   -bindir | --bindir | --bindi | --bind | --bin | --bi)
173     ac_prev=bindir ;;
174   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
175     bindir=$ac_optarg ;;
176
177   -build | --build | --buil | --bui | --bu)
178     ac_prev=build_alias ;;
179   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
180     build_alias=$ac_optarg ;;
181
182   -cache-file | --cache-file | --cache-fil | --cache-fi \
183   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
184     ac_prev=cache_file ;;
185   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
186   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
187     cache_file=$ac_optarg ;;
188
189   --config-cache | -C)
190     cache_file=config.cache ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir=$ac_optarg ;;
197
198   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
199   | --dataroo | --dataro | --datar)
200     ac_prev=datarootdir ;;
201   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
202   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
203     datarootdir=$ac_optarg ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     eval "enable_$ac_feature=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
216     # Reject names that are not valid shell variable names.
217     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
218       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
219    { (exit 1); exit 1; }; }
220     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
221     case $ac_option in
222       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_$ac_feature='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix=$ac_optarg ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he | -h)
241     ac_init_help=long ;;
242   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
243     ac_init_help=recursive ;;
244   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
245     ac_init_help=short ;;
246
247   -host | --host | --hos | --ho)
248     ac_prev=host_alias ;;
249   -host=* | --host=* | --hos=* | --ho=*)
250     host_alias=$ac_optarg ;;
251
252   -includedir | --includedir | --includedi | --included | --include \
253   | --includ | --inclu | --incl | --inc)
254     ac_prev=includedir ;;
255   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
256   | --includ=* | --inclu=* | --incl=* | --inc=*)
257     includedir=$ac_optarg ;;
258
259   -infodir | --infodir | --infodi | --infod | --info | --inf)
260     ac_prev=infodir ;;
261   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
262     infodir=$ac_optarg ;;
263
264   -libdir | --libdir | --libdi | --libd)
265     ac_prev=libdir ;;
266   -libdir=* | --libdir=* | --libdi=* | --libd=*)
267     libdir=$ac_optarg ;;
268
269   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
270   | --libexe | --libex | --libe)
271     ac_prev=libexecdir ;;
272   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
273   | --libexe=* | --libex=* | --libe=*)
274     libexecdir=$ac_optarg ;;
275
276   -localstatedir | --localstatedir | --localstatedi | --localstated \
277   | --localstate | --localstat | --localsta | --localst \
278   | --locals | --local | --loca | --loc | --lo)
279     ac_prev=localstatedir ;;
280   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
281   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
282   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
283     localstatedir=$ac_optarg ;;
284
285   -runstatedir | --runstatedir | --runstatedi | --runstated \
286   | --runstate | --runstat | --runsta | --runst \
287   | --runs | --run | --ru)
288     ac_prev=runstatedir ;;
289   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
290   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
291   | --runs=* | --run=* | --ru=*)
292     runstatedir=$ac_optarg ;;
293
294   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
295     ac_prev=mandir ;;
296   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
297     mandir=$ac_optarg ;;
298
299   -nfp | --nfp | --nf)
300     # Obsolete; use --without-fp.
301     with_fp=no ;;
302
303   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
304   | --no-cr | --no-c)
305     no_create=yes ;;
306
307   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
308   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
309     no_recursion=yes ;;
310
311   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
312   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
313   | --oldin | --oldi | --old | --ol | --o)
314     ac_prev=oldincludedir ;;
315   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
316   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
317   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
318     oldincludedir=$ac_optarg ;;
319
320   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
321     ac_prev=prefix ;;
322   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
323     prefix=$ac_optarg ;;
324
325   -program-prefix | --program-prefix | --program-prefi | --program-pref \
326   | --program-pre | --program-pr | --program-p)
327     ac_prev=program_prefix ;;
328   -program-prefix=* | --program-prefix=* | --program-prefi=* \
329   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
330     program_prefix=$ac_optarg ;;
331
332   -program-suffix | --program-suffix | --program-suffi | --program-suff \
333   | --program-suf | --program-su | --program-s)
334     ac_prev=program_suffix ;;
335   -program-suffix=* | --program-suffix=* | --program-suffi=* \
336   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
337     program_suffix=$ac_optarg ;;
338
339   -program-transform-name | --program-transform-name \
340   | --program-transform-nam | --program-transform-na \
341   | --program-transform-n | --program-transform- \
342   | --program-transform | --program-transfor \
343   | --program-transfo | --program-transf \
344   | --program-trans | --program-tran \
345   | --progr-tra | --program-tr | --program-t)
346     ac_prev=program_transform_name ;;
347   -program-transform-name=* | --program-transform-name=* \
348   | --program-transform-nam=* | --program-transform-na=* \
349   | --program-transform-n=* | --program-transform-=* \
350   | --program-transform=* | --program-transfor=* \
351   | --program-transfo=* | --program-transf=* \
352   | --program-trans=* | --program-tran=* \
353   | --progr-tra=* | --program-tr=* | --program-t=*)
354     program_transform_name=$ac_optarg ;;
355
356   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
357   | -silent | --silent | --silen | --sile | --sil)
358     silent=yes ;;
359
360   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
361     ac_prev=sbindir ;;
362   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
363   | --sbi=* | --sb=*)
364     sbindir=$ac_optarg ;;
365
366   -sharedstatedir | --sharedstatedir | --sharedstatedi \
367   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
368   | --sharedst | --shareds | --shared | --share | --shar \
369   | --sha | --sh)
370     ac_prev=sharedstatedir ;;
371   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
372   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
373   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
374   | --sha=* | --sh=*)
375     sharedstatedir=$ac_optarg ;;
376
377   -site | --site | --sit)
378     ac_prev=site ;;
379   -site=* | --site=* | --sit=*)
380     site=$ac_optarg ;;
381
382   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
383     ac_prev=srcdir ;;
384   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
385     srcdir=$ac_optarg ;;
386
387   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
388   | --syscon | --sysco | --sysc | --sys | --sy)
389     ac_prev=sysconfdir ;;
390   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
391   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
392     sysconfdir=$ac_optarg ;;
393
394   -target | --target | --targe | --targ | --tar | --ta | --t)
395     ac_prev=target_alias ;;
396   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
397     target_alias=$ac_optarg ;;
398
399   -v | -verbose | --verbose | --verbos | --verbo | --verb)
400     verbose=yes ;;
401
402   -version | --version | --versio | --versi | --vers | -V)
403     ac_init_version=: ;;
404
405   -with-* | --with-*)
406     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
407     # Reject names that are not valid shell variable names.
408     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
409       { echo "$as_me: error: invalid package name: $ac_package" >&2
410    { (exit 1); exit 1; }; }
411     ac_package=`echo $ac_package| sed 's/-/_/g'`
412     case $ac_option in
413       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
414       *) ac_optarg=yes ;;
415     esac
416     eval "with_$ac_package='$ac_optarg'" ;;
417
418   -without-* | --without-*)
419     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
420     # Reject names that are not valid shell variable names.
421     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
422       { echo "$as_me: error: invalid package name: $ac_package" >&2
423    { (exit 1); exit 1; }; }
424     ac_package=`echo $ac_package | sed 's/-/_/g'`
425     eval "with_$ac_package=no" ;;
426
427   --x)
428     # Obsolete; use --with-x.
429     with_x=yes ;;
430
431   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
432   | --x-incl | --x-inc | --x-in | --x-i)
433     ac_prev=x_includes ;;
434   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
435   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
436     x_includes=$ac_optarg ;;
437
438   -x-libraries | --x-libraries | --x-librarie | --x-librari \
439   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
440     ac_prev=x_libraries ;;
441   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
442   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
443     x_libraries=$ac_optarg ;;
444
445   -*) { echo "$as_me: error: unrecognized option: $ac_option
446 Try \`$0 --help' for more information." >&2
447    { (exit 1); exit 1; }; }
448     ;;
449
450   *=*)
451     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
452     # Reject names that are not valid shell variable names.
453     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
454       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
455    { (exit 1); exit 1; }; }
456     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
457     eval "$ac_envvar='$ac_optarg'"
458     export $ac_envvar ;;
459
460   *)
461     # FIXME: should be removed in autoconf 3.0.
462     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
463     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
464       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
465     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
466     ;;
467
468   esac
469 done
470
471 if test -n "$ac_prev"; then
472   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
473   { echo "$as_me: error: missing argument to $ac_option" >&2
474    { (exit 1); exit 1; }; }
475 fi
476
477 # Be sure to have absolute paths.
478 for ac_var in exec_prefix prefix
479 do
480   eval ac_val=$`echo $ac_var`
481   case $ac_val in
482     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
483     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
484    { (exit 1); exit 1; }; };;
485   esac
486 done
487
488 # Be sure to have absolute paths.
489 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
490               localstatedir libdir includedir oldincludedir infodir mandir
491 do
492   eval ac_val=$`echo $ac_var`
493   case $ac_val in
494     [\\/$]* | ?:[\\/]* ) ;;
495     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
496    { (exit 1); exit 1; }; };;
497   esac
498 done
499
500 # There might be people who depend on the old broken behavior: `$host'
501 # used to hold the argument of --host etc.
502 build=$build_alias
503 host=$host_alias
504 target=$target_alias
505
506 # FIXME: should be removed in autoconf 3.0.
507 if test "x$host_alias" != x; then
508   if test "x$build_alias" = x; then
509     cross_compiling=maybe
510     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
511     If a cross compiler is detected then cross compile mode will be used." >&2
512   elif test "x$build_alias" != "x$host_alias"; then
513     cross_compiling=yes
514   fi
515 fi
516
517 ac_tool_prefix=
518 test -n "$host_alias" && ac_tool_prefix=$host_alias-
519
520 test "$silent" = yes && exec 6>/dev/null
521
522 # Find the source files, if location was not specified.
523 if test -z "$srcdir"; then
524   ac_srcdir_defaulted=yes
525   # Try the directory containing this script, then its parent.
526   ac_prog=$0
527   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
528   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
529   srcdir=$ac_confdir
530   if test ! -r $srcdir/$ac_unique_file; then
531     srcdir=..
532   fi
533 else
534   ac_srcdir_defaulted=no
535 fi
536 if test ! -r $srcdir/$ac_unique_file; then
537   if test "$ac_srcdir_defaulted" = yes; then
538     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
539    { (exit 1); exit 1; }; }
540   else
541     { echo "$as_me: error: cannot find sources in $srcdir" >&2
542    { (exit 1); exit 1; }; }
543   fi
544 fi
545 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
546 ac_env_build_alias_set=${build_alias+set}
547 ac_env_build_alias_value=$build_alias
548 ac_cv_env_build_alias_set=${build_alias+set}
549 ac_cv_env_build_alias_value=$build_alias
550 ac_env_host_alias_set=${host_alias+set}
551 ac_env_host_alias_value=$host_alias
552 ac_cv_env_host_alias_set=${host_alias+set}
553 ac_cv_env_host_alias_value=$host_alias
554 ac_env_target_alias_set=${target_alias+set}
555 ac_env_target_alias_value=$target_alias
556 ac_cv_env_target_alias_set=${target_alias+set}
557 ac_cv_env_target_alias_value=$target_alias
558 ac_env_CC_set=${CC+set}
559 ac_env_CC_value=$CC
560 ac_cv_env_CC_set=${CC+set}
561 ac_cv_env_CC_value=$CC
562 ac_env_CFLAGS_set=${CFLAGS+set}
563 ac_env_CFLAGS_value=$CFLAGS
564 ac_cv_env_CFLAGS_set=${CFLAGS+set}
565 ac_cv_env_CFLAGS_value=$CFLAGS
566 ac_env_LDFLAGS_set=${LDFLAGS+set}
567 ac_env_LDFLAGS_value=$LDFLAGS
568 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_cv_env_LDFLAGS_value=$LDFLAGS
570 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
571 ac_env_CPPFLAGS_value=$CPPFLAGS
572 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
574 ac_env_CPP_set=${CPP+set}
575 ac_env_CPP_value=$CPP
576 ac_cv_env_CPP_set=${CPP+set}
577 ac_cv_env_CPP_value=$CPP
578
579 #
580 # Report the --help message.
581 #
582 if test "$ac_init_help" = "long"; then
583   # Omit some internal or obsolete options to make the list less imposing.
584   # This message is too long to be a string in the A/UX 3.1 sh.
585   cat <<EOF
586 \`configure' configures this package to adapt to many kinds of systems.
587
588 Usage: $0 [OPTION]... [VAR=VALUE]...
589
590 To assign environment variables (e.g., CC, CFLAGS...), specify them as
591 VAR=VALUE.  See below for descriptions of some of the useful variables.
592
593 Defaults for the options are specified in brackets.
594
595 Configuration:
596   -h, --help              display this help and exit
597       --help=short        display options specific to this package
598       --help=recursive    display the short help of all the included packages
599   -V, --version           display version information and exit
600   -q, --quiet, --silent   do not print \`checking...' messages
601       --cache-file=FILE   cache test results in FILE [disabled]
602   -C, --config-cache      alias for \`--cache-file=config.cache'
603   -n, --no-create         do not create output files
604       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
605
606 EOF
607
608   cat <<EOF
609 Installation directories:
610   --prefix=PREFIX         install architecture-independent files in PREFIX
611                           [$ac_default_prefix]
612   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
613                           [PREFIX]
614
615 By default, \`make install' will install all the files in
616 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
617 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
618 for instance \`--prefix=\$HOME'.
619
620 For better control, use the options below.
621
622 Fine tuning of the installation directories:
623   --bindir=DIR            user executables [EPREFIX/bin]
624   --sbindir=DIR           system admin executables [EPREFIX/sbin]
625   --libexecdir=DIR        program executables [EPREFIX/libexec]
626   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
627   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
628   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
629   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
630   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
631   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
632   --libdir=DIR            object code libraries [EPREFIX/lib]
633   --includedir=DIR        C header files [PREFIX/include]
634   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
635   --infodir=DIR           info documentation [DATAROOTDIR/info]
636   --mandir=DIR            man documentation [DATAROOTDIR/man]
637 EOF
638
639   cat <<\EOF
640
641 Program names:
642   --program-prefix=PREFIX            prepend PREFIX to installed program names
643   --program-suffix=SUFFIX            append SUFFIX to installed program names
644   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
645
646 X features:
647   --x-includes=DIR    X include files are in DIR
648   --x-libraries=DIR   X library files are in DIR
649
650 System types:
651   --build=BUILD           configure for building on BUILD [guessed]
652   --host=HOST       build programs to run on HOST [BUILD]
653 EOF
654 fi
655
656 if test -n "$ac_init_help"; then
657
658   cat <<\EOF
659
660 Optional Features:
661   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
662   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
663
664 Optional Packages:
665   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
666   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
667
668 General Options:
669   --disable-stripping     do not strip (debug info) installed executables
670   --enable-string-hacks   work around bogus compiler/loader warnings
671   --with-pkg-config{=path} enable/disable use of pkg-config
672   --disable-echo          do not display "compiling" commands
673 Curses Version-dependent Options:
674   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
675   --disable-widec         disable checks for wide-character functions
676   --with-curses-dir=DIR   directory in which (n)curses is installed
677   --with-screen=XXX       use specified curses-libraries
678   --with-ncursesw         use wide ncurses-libraries
679   --with-ncurses          use ncurses-libraries
680   --with-pdcurses         compile/link with pdcurses X11 library
681   --with-curses-colr      compile/link with HPUX 10.x color-curses
682   --with-curses-5lib      compile/link with SunOS 5lib curses
683   --with-Xaw3d            link with Xaw 3d library
684   --with-Xaw3dxft         link with Xaw 3d xft library
685   --with-neXtaw           link with neXT Athena library
686   --with-XawPlus          link with Athena-Plus library
687   --with-x                use the X Window System
688   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
689   --disable-panel         disable checks for panel functions
690   --disable-menu          disable checks for menu functions
691   --disable-form          disable checks for form functions
692 Testing/development Options:
693   --enable-warnings       test: turn on gcc compiler warnings
694   --with-dmalloc          test: use Gray Watson's dmalloc library
695   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
696   --with-valgrind         test: use valgrind
697   --disable-leaks         test: free permanent memory, analyze leaks
698   --disable-rpath-hack    don't add rpath options for additional libraries
699
700 Some influential environment variables:
701   CC          C compiler command
702   CFLAGS      C compiler flags
703   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
704               nonstandard directory <lib dir>
705   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
706               headers in a nonstandard directory <include dir>
707   CPP         C preprocessor
708
709 Use these variables to override the choices made by `configure' or to help
710 it to find libraries and programs with nonstandard names/locations.
711
712 EOF
713 fi
714
715 if test "$ac_init_help" = "recursive"; then
716   # If there are subdirs, report their specific --help.
717   ac_popdir=`pwd`
718   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
719     cd $ac_subdir
720     # A "../" for each directory in /$ac_subdir.
721     ac_dots=`echo $ac_subdir |
722              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
723
724     case $srcdir in
725     .) # No --srcdir option.  We are building in place.
726       ac_sub_srcdir=$srcdir ;;
727     [\\/]* | ?:[\\/]* ) # Absolute path.
728       ac_sub_srcdir=$srcdir/$ac_subdir ;;
729     *) # Relative path.
730       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
731     esac
732
733     # Check for guested configure; otherwise get Cygnus style configure.
734     if test -f $ac_sub_srcdir/configure.gnu; then
735       echo
736       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
737     elif test -f $ac_sub_srcdir/configure; then
738       echo
739       $SHELL $ac_sub_srcdir/configure  --help=recursive
740     elif test -f $ac_sub_srcdir/configure.ac ||
741            test -f $ac_sub_srcdir/configure.in; then
742       echo
743       $ac_configure --help
744     else
745       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
746     fi
747     cd $ac_popdir
748   done
749 fi
750
751 test -n "$ac_init_help" && exit 0
752 if $ac_init_version; then
753   cat <<\EOF
754
755 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
756 Free Software Foundation, Inc.
757 This configure script is free software; the Free Software Foundation
758 gives unlimited permission to copy, distribute and modify it.
759 EOF
760   exit 0
761 fi
762 exec 5>config.log
763 cat >&5 <<EOF
764 This file contains any messages produced by compilers while
765 running configure, to aid debugging if configure makes a mistake.
766
767 It was created by $as_me, which was
768 generated by GNU Autoconf 2.52.20190828.  Invocation command line was
769
770   $ $0 $@
771
772 EOF
773 {
774 cat <<_ASUNAME
775 ## ---------- ##
776 ## Platform.  ##
777 ## ---------- ##
778
779 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
780 uname -m = `(uname -m) 2>/dev/null || echo unknown`
781 uname -r = `(uname -r) 2>/dev/null || echo unknown`
782 uname -s = `(uname -s) 2>/dev/null || echo unknown`
783 uname -v = `(uname -v) 2>/dev/null || echo unknown`
784
785 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
786 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
787
788 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
789 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
790 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
791 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
792 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
793 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
794 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
795
796 PATH = $PATH
797
798 _ASUNAME
799 } >&5
800
801 cat >&5 <<EOF
802 ## ------------ ##
803 ## Core tests.  ##
804 ## ------------ ##
805
806 EOF
807
808 # Keep a trace of the command line.
809 # Strip out --no-create and --no-recursion so they do not pile up.
810 # Also quote any args containing shell meta-characters.
811 ac_configure_args=
812 ac_sep=
813 for ac_arg
814 do
815   case $ac_arg in
816   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
817   | --no-cr | --no-c) ;;
818   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
819   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
820   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
821     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
822     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
823     ac_sep=" " ;;
824   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
825      ac_sep=" " ;;
826   esac
827   # Get rid of the leading space.
828 done
829
830 # When interrupted or exit'd, cleanup temporary files, and complete
831 # config.log.  We remove comments because anyway the quotes in there
832 # would cause problems or look ugly.
833 trap 'exit_status=$?
834   # Save into config.log some information that might help in debugging.
835   echo >&5
836   echo "## ----------------- ##" >&5
837   echo "## Cache variables.  ##" >&5
838   echo "## ----------------- ##" >&5
839   echo >&5
840   # The following way of writing the cache mishandles newlines in values,
841 {
842   (set) 2>&1 |
843     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
844     *ac_space=\ *)
845       sed -n \
846         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
847           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
848       ;;
849     *)
850       sed -n \
851         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
852       ;;
853     esac;
854 } >&5
855   sed "/^$/d" confdefs.h >conftest.log
856   if test -s conftest.log; then
857     echo >&5
858     echo "## ------------ ##" >&5
859     echo "## confdefs.h.  ##" >&5
860     echo "## ------------ ##" >&5
861     echo >&5
862     cat conftest.log >&5
863   fi
864   (echo; echo) >&5
865   test "$ac_signal" != 0 &&
866     echo "$as_me: caught signal $ac_signal" >&5
867   echo "$as_me: exit $exit_status" >&5
868   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
869     exit $exit_status
870      ' 0
871 for ac_signal in 1 2 13 15; do
872   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
873 done
874 ac_signal=0
875
876 # confdefs.h avoids OS command line length limits that DEFS can exceed.
877 rm -rf conftest* confdefs.h
878 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
879 echo >confdefs.h
880
881 # Let the site file select an alternate cache file if it wants to.
882 # Prefer explicitly selected file to automatically selected ones.
883 if test -z "$CONFIG_SITE"; then
884   if test "x$prefix" != xNONE; then
885     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
886   else
887     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
888   fi
889 fi
890 for ac_site_file in $CONFIG_SITE; do
891   if test -r "$ac_site_file"; then
892     { echo "$as_me:892: loading site script $ac_site_file" >&5
893 echo "$as_me: loading site script $ac_site_file" >&6;}
894     cat "$ac_site_file" >&5
895     . "$ac_site_file"
896   fi
897 done
898
899 if test -r "$cache_file"; then
900   # Some versions of bash will fail to source /dev/null (special
901   # files actually), so we avoid doing that.
902   if test -f "$cache_file"; then
903     { echo "$as_me:903: loading cache $cache_file" >&5
904 echo "$as_me: loading cache $cache_file" >&6;}
905     case $cache_file in
906       [\\/]* | ?:[\\/]* ) . $cache_file;;
907       *)                      . ./$cache_file;;
908     esac
909   fi
910 else
911   { echo "$as_me:911: creating cache $cache_file" >&5
912 echo "$as_me: creating cache $cache_file" >&6;}
913   >$cache_file
914 fi
915
916 # Check that the precious variables saved in the cache have kept the same
917 # value.
918 ac_cache_corrupted=false
919 for ac_var in `(set) 2>&1 |
920                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
921   eval ac_old_set=\$ac_cv_env_${ac_var}_set
922   eval ac_new_set=\$ac_env_${ac_var}_set
923   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
924   eval ac_new_val="\$ac_env_${ac_var}_value"
925   case $ac_old_set,$ac_new_set in
926     set,)
927       { echo "$as_me:927: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
928 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
929       ac_cache_corrupted=: ;;
930     ,set)
931       { echo "$as_me:931: error: \`$ac_var' was not set in the previous run" >&5
932 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
933       ac_cache_corrupted=: ;;
934     ,);;
935     *)
936       if test "x$ac_old_val" != "x$ac_new_val"; then
937         { echo "$as_me:937: error: \`$ac_var' has changed since the previous run:" >&5
938 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
939         { echo "$as_me:939:   former value:  $ac_old_val" >&5
940 echo "$as_me:   former value:  $ac_old_val" >&2;}
941         { echo "$as_me:941:   current value: $ac_new_val" >&5
942 echo "$as_me:   current value: $ac_new_val" >&2;}
943         ac_cache_corrupted=:
944       fi;;
945   esac
946   # Pass precious variables to config.status.  It doesn't matter if
947   # we pass some twice (in addition to the command line arguments).
948   if test "$ac_new_set" = set; then
949     case $ac_new_val in
950     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
951       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
952       ac_configure_args="$ac_configure_args '$ac_arg'"
953       ;;
954     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
955        ;;
956     esac
957   fi
958 done
959 if $ac_cache_corrupted; then
960   { echo "$as_me:960: error: changes in the environment can compromise the build" >&5
961 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
962   { { echo "$as_me:962: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
963 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
964    { (exit 1); exit 1; }; }
965 fi
966
967 ac_ext=c
968 ac_cpp='$CPP $CPPFLAGS'
969 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
970 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
971 ac_compiler_gnu=$ac_cv_c_compiler_gnu
972 ac_main_return=return
973
974 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
975   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
976                    ECHO_T='     ' ;;
977   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
978   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
979 esac
980 echo "#! $SHELL" >conftest.sh
981 echo  "exit 0"   >>conftest.sh
982 chmod +x conftest.sh
983 if { (echo "$as_me:983: PATH=\".;.\"; conftest.sh") >&5
984   (PATH=".;."; conftest.sh) 2>&5
985   ac_status=$?
986   echo "$as_me:986: \$? = $ac_status" >&5
987   (exit $ac_status); }; then
988   ac_path_separator=';'
989 else
990   ac_path_separator=:
991 fi
992 PATH_SEPARATOR="$ac_path_separator"
993 rm -f conftest.sh
994
995 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
996
997 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
998
999 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1000
1001 ac_aux_dir=
1002 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1003   if test -f $ac_dir/install-sh; then
1004     ac_aux_dir=$ac_dir
1005     ac_install_sh="$ac_aux_dir/install-sh -c"
1006     break
1007   elif test -f $ac_dir/install.sh; then
1008     ac_aux_dir=$ac_dir
1009     ac_install_sh="$ac_aux_dir/install.sh -c"
1010     break
1011   elif test -f $ac_dir/shtool; then
1012     ac_aux_dir=$ac_dir
1013     ac_install_sh="$ac_aux_dir/shtool install -c"
1014     break
1015   fi
1016 done
1017 if test -z "$ac_aux_dir"; then
1018   { { echo "$as_me:1018: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1019 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1020    { (exit 1); exit 1; }; }
1021 fi
1022 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1023 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1024 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1025
1026 # Make sure we can run config.sub.
1027 $ac_config_sub sun4 >/dev/null 2>&1 ||
1028   { { echo "$as_me:1028: error: cannot run $ac_config_sub" >&5
1029 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 echo "$as_me:1032: checking build system type" >&5
1033 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1034 if test "${ac_cv_build+set}" = set; then
1035   echo $ECHO_N "(cached) $ECHO_C" >&6
1036 else
1037   ac_cv_build_alias=$build_alias
1038 test -z "$ac_cv_build_alias" &&
1039   ac_cv_build_alias=`$ac_config_guess`
1040 test -z "$ac_cv_build_alias" &&
1041   { { echo "$as_me:1041: error: cannot guess build type; you must specify one" >&5
1042 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1043    { (exit 1); exit 1; }; }
1044 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1045   { { echo "$as_me:1045: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1046 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1047    { (exit 1); exit 1; }; }
1048
1049 fi
1050 echo "$as_me:1050: result: $ac_cv_build" >&5
1051 echo "${ECHO_T}$ac_cv_build" >&6
1052 build=$ac_cv_build
1053 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1054 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1055 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1056
1057 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1058         echo "$as_me:1058: checking host system type" >&5
1059 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1060 if test "${ac_cv_host+set}" = set; then
1061   echo $ECHO_N "(cached) $ECHO_C" >&6
1062 else
1063   ac_cv_host_alias=$host_alias
1064 test -z "$ac_cv_host_alias" &&
1065   ac_cv_host_alias=$ac_cv_build_alias
1066 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1067   { { echo "$as_me:1067: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1068 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 fi
1072 echo "$as_me:1072: result: $ac_cv_host" >&5
1073 echo "${ECHO_T}$ac_cv_host" >&6
1074 host=$ac_cv_host
1075 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1076 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1077 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1078
1079         system_name="$host_os"
1080 else
1081         system_name="`(uname -s -r) 2>/dev/null`"
1082         if test -z "$system_name" ; then
1083                 system_name="`(hostname) 2>/dev/null`"
1084         fi
1085 fi
1086 test -n "$system_name" &&
1087 cat >>confdefs.h <<EOF
1088 #define SYSTEM_NAME "$system_name"
1089 EOF
1090
1091 if test "${cf_cv_system_name+set}" = set; then
1092   echo $ECHO_N "(cached) $ECHO_C" >&6
1093 else
1094   cf_cv_system_name="$system_name"
1095 fi
1096
1097 test -z "$system_name" && system_name="$cf_cv_system_name"
1098 test -n "$cf_cv_system_name" && echo "$as_me:1098: result: Configuring for $cf_cv_system_name" >&5
1099 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1100
1101 if test ".$system_name" != ".$cf_cv_system_name" ; then
1102         echo "$as_me:1102: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1103 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1104         { { echo "$as_me:1104: error: \"Please remove config.cache and try again.\"" >&5
1105 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1106    { (exit 1); exit 1; }; }
1107 fi
1108
1109 test "$program_prefix" != NONE &&
1110   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1111 # Use a double $ so make ignores it.
1112 test "$program_suffix" != NONE &&
1113   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1114 # Double any \ or $.  echo might interpret backslashes.
1115 # By default was `s,x,x', remove it if useless.
1116 cat <<\_ACEOF >conftest.sed
1117 s/[\\$]/&&/g;s/;s,x,x,$//
1118 _ACEOF
1119 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1120 rm conftest.sed
1121
1122 echo "$as_me:1122: checking whether ${MAKE-make} sets \${MAKE}" >&5
1123 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1124 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1125 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1126   echo $ECHO_N "(cached) $ECHO_C" >&6
1127 else
1128   cat >conftest.make <<\EOF
1129 all:
1130         @echo 'ac_maketemp="${MAKE}"'
1131 EOF
1132 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1133 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1134 if test -n "$ac_maketemp"; then
1135   eval ac_cv_prog_make_${ac_make}_set=yes
1136 else
1137   eval ac_cv_prog_make_${ac_make}_set=no
1138 fi
1139 rm -f conftest.make
1140 fi
1141 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1142   echo "$as_me:1142: result: yes" >&5
1143 echo "${ECHO_T}yes" >&6
1144   SET_MAKE=
1145 else
1146   echo "$as_me:1146: result: no" >&5
1147 echo "${ECHO_T}no" >&6
1148   SET_MAKE="MAKE=${MAKE-make}"
1149 fi
1150
1151 ac_ext=c
1152 ac_cpp='$CPP $CPPFLAGS'
1153 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1154 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1155 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1156 ac_main_return=return
1157 if test -n "$ac_tool_prefix"; then
1158   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1159 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1160 echo "$as_me:1160: checking for $ac_word" >&5
1161 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1162 if test "${ac_cv_prog_CC+set}" = set; then
1163   echo $ECHO_N "(cached) $ECHO_C" >&6
1164 else
1165   if test -n "$CC"; then
1166   ac_cv_prog_CC="$CC" # Let the user override the test.
1167 else
1168   ac_save_IFS=$IFS; IFS=$ac_path_separator
1169 ac_dummy="$PATH"
1170 for ac_dir in $ac_dummy; do
1171   IFS=$ac_save_IFS
1172   test -z "$ac_dir" && ac_dir=.
1173   $as_executable_p "$ac_dir/$ac_word" || continue
1174 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1175 echo "$as_me:1175: found $ac_dir/$ac_word" >&5
1176 break
1177 done
1178
1179 fi
1180 fi
1181 CC=$ac_cv_prog_CC
1182 if test -n "$CC"; then
1183   echo "$as_me:1183: result: $CC" >&5
1184 echo "${ECHO_T}$CC" >&6
1185 else
1186   echo "$as_me:1186: result: no" >&5
1187 echo "${ECHO_T}no" >&6
1188 fi
1189
1190 fi
1191 if test -z "$ac_cv_prog_CC"; then
1192   ac_ct_CC=$CC
1193   # Extract the first word of "gcc", so it can be a program name with args.
1194 set dummy gcc; ac_word=$2
1195 echo "$as_me:1195: checking for $ac_word" >&5
1196 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1197 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1198   echo $ECHO_N "(cached) $ECHO_C" >&6
1199 else
1200   if test -n "$ac_ct_CC"; then
1201   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1202 else
1203   ac_save_IFS=$IFS; IFS=$ac_path_separator
1204 ac_dummy="$PATH"
1205 for ac_dir in $ac_dummy; do
1206   IFS=$ac_save_IFS
1207   test -z "$ac_dir" && ac_dir=.
1208   $as_executable_p "$ac_dir/$ac_word" || continue
1209 ac_cv_prog_ac_ct_CC="gcc"
1210 echo "$as_me:1210: found $ac_dir/$ac_word" >&5
1211 break
1212 done
1213
1214 fi
1215 fi
1216 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1217 if test -n "$ac_ct_CC"; then
1218   echo "$as_me:1218: result: $ac_ct_CC" >&5
1219 echo "${ECHO_T}$ac_ct_CC" >&6
1220 else
1221   echo "$as_me:1221: result: no" >&5
1222 echo "${ECHO_T}no" >&6
1223 fi
1224
1225   CC=$ac_ct_CC
1226 else
1227   CC="$ac_cv_prog_CC"
1228 fi
1229
1230 if test -z "$CC"; then
1231   if test -n "$ac_tool_prefix"; then
1232   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1233 set dummy ${ac_tool_prefix}cc; ac_word=$2
1234 echo "$as_me:1234: checking for $ac_word" >&5
1235 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1236 if test "${ac_cv_prog_CC+set}" = set; then
1237   echo $ECHO_N "(cached) $ECHO_C" >&6
1238 else
1239   if test -n "$CC"; then
1240   ac_cv_prog_CC="$CC" # Let the user override the test.
1241 else
1242   ac_save_IFS=$IFS; IFS=$ac_path_separator
1243 ac_dummy="$PATH"
1244 for ac_dir in $ac_dummy; do
1245   IFS=$ac_save_IFS
1246   test -z "$ac_dir" && ac_dir=.
1247   $as_executable_p "$ac_dir/$ac_word" || continue
1248 ac_cv_prog_CC="${ac_tool_prefix}cc"
1249 echo "$as_me:1249: found $ac_dir/$ac_word" >&5
1250 break
1251 done
1252
1253 fi
1254 fi
1255 CC=$ac_cv_prog_CC
1256 if test -n "$CC"; then
1257   echo "$as_me:1257: result: $CC" >&5
1258 echo "${ECHO_T}$CC" >&6
1259 else
1260   echo "$as_me:1260: result: no" >&5
1261 echo "${ECHO_T}no" >&6
1262 fi
1263
1264 fi
1265 if test -z "$ac_cv_prog_CC"; then
1266   ac_ct_CC=$CC
1267   # Extract the first word of "cc", so it can be a program name with args.
1268 set dummy cc; ac_word=$2
1269 echo "$as_me:1269: checking for $ac_word" >&5
1270 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1271 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1272   echo $ECHO_N "(cached) $ECHO_C" >&6
1273 else
1274   if test -n "$ac_ct_CC"; then
1275   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1276 else
1277   ac_save_IFS=$IFS; IFS=$ac_path_separator
1278 ac_dummy="$PATH"
1279 for ac_dir in $ac_dummy; do
1280   IFS=$ac_save_IFS
1281   test -z "$ac_dir" && ac_dir=.
1282   $as_executable_p "$ac_dir/$ac_word" || continue
1283 ac_cv_prog_ac_ct_CC="cc"
1284 echo "$as_me:1284: found $ac_dir/$ac_word" >&5
1285 break
1286 done
1287
1288 fi
1289 fi
1290 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1291 if test -n "$ac_ct_CC"; then
1292   echo "$as_me:1292: result: $ac_ct_CC" >&5
1293 echo "${ECHO_T}$ac_ct_CC" >&6
1294 else
1295   echo "$as_me:1295: result: no" >&5
1296 echo "${ECHO_T}no" >&6
1297 fi
1298
1299   CC=$ac_ct_CC
1300 else
1301   CC="$ac_cv_prog_CC"
1302 fi
1303
1304 fi
1305 if test -z "$CC"; then
1306   # Extract the first word of "cc", so it can be a program name with args.
1307 set dummy cc; ac_word=$2
1308 echo "$as_me:1308: checking for $ac_word" >&5
1309 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1310 if test "${ac_cv_prog_CC+set}" = set; then
1311   echo $ECHO_N "(cached) $ECHO_C" >&6
1312 else
1313   if test -n "$CC"; then
1314   ac_cv_prog_CC="$CC" # Let the user override the test.
1315 else
1316   ac_prog_rejected=no
1317   ac_save_IFS=$IFS; IFS=$ac_path_separator
1318 ac_dummy="$PATH"
1319 for ac_dir in $ac_dummy; do
1320   IFS=$ac_save_IFS
1321   test -z "$ac_dir" && ac_dir=.
1322   $as_executable_p "$ac_dir/$ac_word" || continue
1323 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1324   ac_prog_rejected=yes
1325   continue
1326 fi
1327 ac_cv_prog_CC="cc"
1328 echo "$as_me:1328: found $ac_dir/$ac_word" >&5
1329 break
1330 done
1331
1332 if test $ac_prog_rejected = yes; then
1333   # We found a bogon in the path, so make sure we never use it.
1334   set dummy $ac_cv_prog_CC
1335   shift
1336   if test $# != 0; then
1337     # We chose a different compiler from the bogus one.
1338     # However, it has the same basename, so the bogon will be chosen
1339     # first if we set CC to just the basename; use the full file name.
1340     shift
1341     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1342     shift
1343     ac_cv_prog_CC="$@"
1344   fi
1345 fi
1346 fi
1347 fi
1348 CC=$ac_cv_prog_CC
1349 if test -n "$CC"; then
1350   echo "$as_me:1350: result: $CC" >&5
1351 echo "${ECHO_T}$CC" >&6
1352 else
1353   echo "$as_me:1353: result: no" >&5
1354 echo "${ECHO_T}no" >&6
1355 fi
1356
1357 fi
1358 if test -z "$CC"; then
1359   if test -n "$ac_tool_prefix"; then
1360   for ac_prog in cl
1361   do
1362     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1363 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1364 echo "$as_me:1364: checking for $ac_word" >&5
1365 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1366 if test "${ac_cv_prog_CC+set}" = set; then
1367   echo $ECHO_N "(cached) $ECHO_C" >&6
1368 else
1369   if test -n "$CC"; then
1370   ac_cv_prog_CC="$CC" # Let the user override the test.
1371 else
1372   ac_save_IFS=$IFS; IFS=$ac_path_separator
1373 ac_dummy="$PATH"
1374 for ac_dir in $ac_dummy; do
1375   IFS=$ac_save_IFS
1376   test -z "$ac_dir" && ac_dir=.
1377   $as_executable_p "$ac_dir/$ac_word" || continue
1378 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1379 echo "$as_me:1379: found $ac_dir/$ac_word" >&5
1380 break
1381 done
1382
1383 fi
1384 fi
1385 CC=$ac_cv_prog_CC
1386 if test -n "$CC"; then
1387   echo "$as_me:1387: result: $CC" >&5
1388 echo "${ECHO_T}$CC" >&6
1389 else
1390   echo "$as_me:1390: result: no" >&5
1391 echo "${ECHO_T}no" >&6
1392 fi
1393
1394     test -n "$CC" && break
1395   done
1396 fi
1397 if test -z "$CC"; then
1398   ac_ct_CC=$CC
1399   for ac_prog in cl
1400 do
1401   # Extract the first word of "$ac_prog", so it can be a program name with args.
1402 set dummy $ac_prog; ac_word=$2
1403 echo "$as_me:1403: checking for $ac_word" >&5
1404 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1405 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1406   echo $ECHO_N "(cached) $ECHO_C" >&6
1407 else
1408   if test -n "$ac_ct_CC"; then
1409   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1410 else
1411   ac_save_IFS=$IFS; IFS=$ac_path_separator
1412 ac_dummy="$PATH"
1413 for ac_dir in $ac_dummy; do
1414   IFS=$ac_save_IFS
1415   test -z "$ac_dir" && ac_dir=.
1416   $as_executable_p "$ac_dir/$ac_word" || continue
1417 ac_cv_prog_ac_ct_CC="$ac_prog"
1418 echo "$as_me:1418: found $ac_dir/$ac_word" >&5
1419 break
1420 done
1421
1422 fi
1423 fi
1424 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1425 if test -n "$ac_ct_CC"; then
1426   echo "$as_me:1426: result: $ac_ct_CC" >&5
1427 echo "${ECHO_T}$ac_ct_CC" >&6
1428 else
1429   echo "$as_me:1429: result: no" >&5
1430 echo "${ECHO_T}no" >&6
1431 fi
1432
1433   test -n "$ac_ct_CC" && break
1434 done
1435
1436   CC=$ac_ct_CC
1437 fi
1438
1439 fi
1440
1441 test -z "$CC" && { { echo "$as_me:1441: error: no acceptable cc found in \$PATH" >&5
1442 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1443    { (exit 1); exit 1; }; }
1444
1445 # Provide some information about the compiler.
1446 echo "$as_me:1446:" \
1447      "checking for C compiler version" >&5
1448 ac_compiler=`set X $ac_compile; echo $2`
1449 { (eval echo "$as_me:1449: \"$ac_compiler --version </dev/null >&5\"") >&5
1450   (eval $ac_compiler --version </dev/null >&5) 2>&5
1451   ac_status=$?
1452   echo "$as_me:1452: \$? = $ac_status" >&5
1453   (exit $ac_status); }
1454 { (eval echo "$as_me:1454: \"$ac_compiler -v </dev/null >&5\"") >&5
1455   (eval $ac_compiler -v </dev/null >&5) 2>&5
1456   ac_status=$?
1457   echo "$as_me:1457: \$? = $ac_status" >&5
1458   (exit $ac_status); }
1459 { (eval echo "$as_me:1459: \"$ac_compiler -V </dev/null >&5\"") >&5
1460   (eval $ac_compiler -V </dev/null >&5) 2>&5
1461   ac_status=$?
1462   echo "$as_me:1462: \$? = $ac_status" >&5
1463   (exit $ac_status); }
1464
1465 cat >conftest.$ac_ext <<_ACEOF
1466 #line 1466 "configure"
1467 #include "confdefs.h"
1468
1469 int
1470 main (void)
1471 {
1472
1473   ;
1474   return 0;
1475 }
1476 _ACEOF
1477 ac_clean_files_save=$ac_clean_files
1478 ac_clean_files="$ac_clean_files a.out a.exe"
1479 # Try to create an executable without -o first, disregard a.out.
1480 # It will help us diagnose broken compilers, and finding out an intuition
1481 # of exeext.
1482 echo "$as_me:1482: checking for C compiler default output" >&5
1483 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1484 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1485 if { (eval echo "$as_me:1485: \"$ac_link_default\"") >&5
1486   (eval $ac_link_default) 2>&5
1487   ac_status=$?
1488   echo "$as_me:1488: \$? = $ac_status" >&5
1489   (exit $ac_status); }; then
1490   # Find the output, starting from the most likely.  This scheme is
1491 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1492 # resort.
1493 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1494                 ls a.out conftest 2>/dev/null;
1495                 ls a.* conftest.* 2>/dev/null`; do
1496   case $ac_file in
1497     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1498     a.out ) # We found the default executable, but exeext='' is most
1499             # certainly right.
1500             break;;
1501     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1502           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1503           export ac_cv_exeext
1504           break;;
1505     * ) break;;
1506   esac
1507 done
1508 else
1509   echo "$as_me: failed program was:" >&5
1510 cat conftest.$ac_ext >&5
1511 { { echo "$as_me:1511: error: C compiler cannot create executables" >&5
1512 echo "$as_me: error: C compiler cannot create executables" >&2;}
1513    { (exit 77); exit 77; }; }
1514 fi
1515
1516 ac_exeext=$ac_cv_exeext
1517 echo "$as_me:1517: result: $ac_file" >&5
1518 echo "${ECHO_T}$ac_file" >&6
1519
1520 # Check the compiler produces executables we can run.  If not, either
1521 # the compiler is broken, or we cross compile.
1522 echo "$as_me:1522: checking whether the C compiler works" >&5
1523 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1524 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1525 # If not cross compiling, check that we can run a simple program.
1526 if test "$cross_compiling" != yes; then
1527   if { ac_try='./$ac_file'
1528   { (eval echo "$as_me:1528: \"$ac_try\"") >&5
1529   (eval $ac_try) 2>&5
1530   ac_status=$?
1531   echo "$as_me:1531: \$? = $ac_status" >&5
1532   (exit $ac_status); }; }; then
1533     cross_compiling=no
1534   else
1535     if test "$cross_compiling" = maybe; then
1536         cross_compiling=yes
1537     else
1538         { { echo "$as_me:1538: error: cannot run C compiled programs.
1539 If you meant to cross compile, use \`--host'." >&5
1540 echo "$as_me: error: cannot run C compiled programs.
1541 If you meant to cross compile, use \`--host'." >&2;}
1542    { (exit 1); exit 1; }; }
1543     fi
1544   fi
1545 fi
1546 echo "$as_me:1546: result: yes" >&5
1547 echo "${ECHO_T}yes" >&6
1548
1549 rm -f a.out a.exe conftest$ac_cv_exeext
1550 ac_clean_files=$ac_clean_files_save
1551 # Check the compiler produces executables we can run.  If not, either
1552 # the compiler is broken, or we cross compile.
1553 echo "$as_me:1553: checking whether we are cross compiling" >&5
1554 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1555 echo "$as_me:1555: result: $cross_compiling" >&5
1556 echo "${ECHO_T}$cross_compiling" >&6
1557
1558 echo "$as_me:1558: checking for executable suffix" >&5
1559 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1560 if { (eval echo "$as_me:1560: \"$ac_link\"") >&5
1561   (eval $ac_link) 2>&5
1562   ac_status=$?
1563   echo "$as_me:1563: \$? = $ac_status" >&5
1564   (exit $ac_status); }; then
1565   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1566 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1567 # work properly (i.e., refer to `conftest.exe'), while it won't with
1568 # `rm'.
1569 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1570   case $ac_file in
1571     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1572     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1573           export ac_cv_exeext
1574           break;;
1575     * ) break;;
1576   esac
1577 done
1578 else
1579   { { echo "$as_me:1579: error: cannot compute EXEEXT: cannot compile and link" >&5
1580 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1581    { (exit 1); exit 1; }; }
1582 fi
1583
1584 rm -f conftest$ac_cv_exeext
1585 echo "$as_me:1585: result: $ac_cv_exeext" >&5
1586 echo "${ECHO_T}$ac_cv_exeext" >&6
1587
1588 rm -f conftest.$ac_ext
1589 EXEEXT=$ac_cv_exeext
1590 ac_exeext=$EXEEXT
1591 echo "$as_me:1591: checking for object suffix" >&5
1592 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1593 if test "${ac_cv_objext+set}" = set; then
1594   echo $ECHO_N "(cached) $ECHO_C" >&6
1595 else
1596   cat >conftest.$ac_ext <<_ACEOF
1597 #line 1597 "configure"
1598 #include "confdefs.h"
1599
1600 int
1601 main (void)
1602 {
1603
1604   ;
1605   return 0;
1606 }
1607 _ACEOF
1608 rm -f conftest.o conftest.obj
1609 if { (eval echo "$as_me:1609: \"$ac_compile\"") >&5
1610   (eval $ac_compile) 2>&5
1611   ac_status=$?
1612   echo "$as_me:1612: \$? = $ac_status" >&5
1613   (exit $ac_status); }; then
1614   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1615   case $ac_file in
1616     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1617     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1618        break;;
1619   esac
1620 done
1621 else
1622   echo "$as_me: failed program was:" >&5
1623 cat conftest.$ac_ext >&5
1624 { { echo "$as_me:1624: error: cannot compute OBJEXT: cannot compile" >&5
1625 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1626    { (exit 1); exit 1; }; }
1627 fi
1628
1629 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1630 fi
1631 echo "$as_me:1631: result: $ac_cv_objext" >&5
1632 echo "${ECHO_T}$ac_cv_objext" >&6
1633 OBJEXT=$ac_cv_objext
1634 ac_objext=$OBJEXT
1635 echo "$as_me:1635: checking whether we are using the GNU C compiler" >&5
1636 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1637 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1638   echo $ECHO_N "(cached) $ECHO_C" >&6
1639 else
1640   cat >conftest.$ac_ext <<_ACEOF
1641 #line 1641 "configure"
1642 #include "confdefs.h"
1643
1644 int
1645 main (void)
1646 {
1647 #ifndef __GNUC__
1648        choke me
1649 #endif
1650
1651   ;
1652   return 0;
1653 }
1654 _ACEOF
1655 rm -f conftest.$ac_objext
1656 if { (eval echo "$as_me:1656: \"$ac_compile\"") >&5
1657   (eval $ac_compile) 2>&5
1658   ac_status=$?
1659   echo "$as_me:1659: \$? = $ac_status" >&5
1660   (exit $ac_status); } &&
1661          { ac_try='test -s conftest.$ac_objext'
1662   { (eval echo "$as_me:1662: \"$ac_try\"") >&5
1663   (eval $ac_try) 2>&5
1664   ac_status=$?
1665   echo "$as_me:1665: \$? = $ac_status" >&5
1666   (exit $ac_status); }; }; then
1667   ac_compiler_gnu=yes
1668 else
1669   echo "$as_me: failed program was:" >&5
1670 cat conftest.$ac_ext >&5
1671 ac_compiler_gnu=no
1672 fi
1673 rm -f conftest.$ac_objext conftest.$ac_ext
1674 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1675
1676 fi
1677 echo "$as_me:1677: result: $ac_cv_c_compiler_gnu" >&5
1678 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1679 GCC=`test $ac_compiler_gnu = yes && echo yes`
1680 ac_test_CFLAGS=${CFLAGS+set}
1681 ac_save_CFLAGS=$CFLAGS
1682 CFLAGS="-g"
1683 echo "$as_me:1683: checking whether $CC accepts -g" >&5
1684 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1685 if test "${ac_cv_prog_cc_g+set}" = set; then
1686   echo $ECHO_N "(cached) $ECHO_C" >&6
1687 else
1688   cat >conftest.$ac_ext <<_ACEOF
1689 #line 1689 "configure"
1690 #include "confdefs.h"
1691
1692 int
1693 main (void)
1694 {
1695
1696   ;
1697   return 0;
1698 }
1699 _ACEOF
1700 rm -f conftest.$ac_objext
1701 if { (eval echo "$as_me:1701: \"$ac_compile\"") >&5
1702   (eval $ac_compile) 2>&5
1703   ac_status=$?
1704   echo "$as_me:1704: \$? = $ac_status" >&5
1705   (exit $ac_status); } &&
1706          { ac_try='test -s conftest.$ac_objext'
1707   { (eval echo "$as_me:1707: \"$ac_try\"") >&5
1708   (eval $ac_try) 2>&5
1709   ac_status=$?
1710   echo "$as_me:1710: \$? = $ac_status" >&5
1711   (exit $ac_status); }; }; then
1712   ac_cv_prog_cc_g=yes
1713 else
1714   echo "$as_me: failed program was:" >&5
1715 cat conftest.$ac_ext >&5
1716 ac_cv_prog_cc_g=no
1717 fi
1718 rm -f conftest.$ac_objext conftest.$ac_ext
1719 fi
1720 echo "$as_me:1720: result: $ac_cv_prog_cc_g" >&5
1721 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1722 if test "$ac_test_CFLAGS" = set; then
1723   CFLAGS=$ac_save_CFLAGS
1724 elif test $ac_cv_prog_cc_g = yes; then
1725   if test "$GCC" = yes; then
1726     CFLAGS="-g -O2"
1727   else
1728     CFLAGS="-g"
1729   fi
1730 else
1731   if test "$GCC" = yes; then
1732     CFLAGS="-O2"
1733   else
1734     CFLAGS=
1735   fi
1736 fi
1737 # Some people use a C++ compiler to compile C.  Since we use `exit',
1738 # in C++ we need to declare it.  In case someone uses the same compiler
1739 # for both compiling C and C++ we need to have the C++ compiler decide
1740 # the declaration of exit, since it's the most demanding environment.
1741 cat >conftest.$ac_ext <<_ACEOF
1742 #ifndef __cplusplus
1743   choke me
1744 #endif
1745 _ACEOF
1746 rm -f conftest.$ac_objext
1747 if { (eval echo "$as_me:1747: \"$ac_compile\"") >&5
1748   (eval $ac_compile) 2>&5
1749   ac_status=$?
1750   echo "$as_me:1750: \$? = $ac_status" >&5
1751   (exit $ac_status); } &&
1752          { ac_try='test -s conftest.$ac_objext'
1753   { (eval echo "$as_me:1753: \"$ac_try\"") >&5
1754   (eval $ac_try) 2>&5
1755   ac_status=$?
1756   echo "$as_me:1756: \$? = $ac_status" >&5
1757   (exit $ac_status); }; }; then
1758   for ac_declaration in \
1759    ''\
1760    '#include <stdlib.h>' \
1761    'extern "C" void std::exit (int) throw (); using std::exit;' \
1762    'extern "C" void std::exit (int); using std::exit;' \
1763    'extern "C" void exit (int) throw ();' \
1764    'extern "C" void exit (int);' \
1765    'void exit (int);'
1766 do
1767   cat >conftest.$ac_ext <<_ACEOF
1768 #line 1768 "configure"
1769 #include "confdefs.h"
1770 #include <stdlib.h>
1771 $ac_declaration
1772 int
1773 main (void)
1774 {
1775 exit (42);
1776   ;
1777   return 0;
1778 }
1779 _ACEOF
1780 rm -f conftest.$ac_objext
1781 if { (eval echo "$as_me:1781: \"$ac_compile\"") >&5
1782   (eval $ac_compile) 2>&5
1783   ac_status=$?
1784   echo "$as_me:1784: \$? = $ac_status" >&5
1785   (exit $ac_status); } &&
1786          { ac_try='test -s conftest.$ac_objext'
1787   { (eval echo "$as_me:1787: \"$ac_try\"") >&5
1788   (eval $ac_try) 2>&5
1789   ac_status=$?
1790   echo "$as_me:1790: \$? = $ac_status" >&5
1791   (exit $ac_status); }; }; then
1792   :
1793 else
1794   echo "$as_me: failed program was:" >&5
1795 cat conftest.$ac_ext >&5
1796 continue
1797 fi
1798 rm -f conftest.$ac_objext conftest.$ac_ext
1799   cat >conftest.$ac_ext <<_ACEOF
1800 #line 1800 "configure"
1801 #include "confdefs.h"
1802 $ac_declaration
1803 int
1804 main (void)
1805 {
1806 exit (42);
1807   ;
1808   return 0;
1809 }
1810 _ACEOF
1811 rm -f conftest.$ac_objext
1812 if { (eval echo "$as_me:1812: \"$ac_compile\"") >&5
1813   (eval $ac_compile) 2>&5
1814   ac_status=$?
1815   echo "$as_me:1815: \$? = $ac_status" >&5
1816   (exit $ac_status); } &&
1817          { ac_try='test -s conftest.$ac_objext'
1818   { (eval echo "$as_me:1818: \"$ac_try\"") >&5
1819   (eval $ac_try) 2>&5
1820   ac_status=$?
1821   echo "$as_me:1821: \$? = $ac_status" >&5
1822   (exit $ac_status); }; }; then
1823   break
1824 else
1825   echo "$as_me: failed program was:" >&5
1826 cat conftest.$ac_ext >&5
1827 fi
1828 rm -f conftest.$ac_objext conftest.$ac_ext
1829 done
1830 rm -rf conftest*
1831 if test -n "$ac_declaration"; then
1832   echo '#ifdef __cplusplus' >>confdefs.h
1833   echo $ac_declaration      >>confdefs.h
1834   echo '#endif'             >>confdefs.h
1835 fi
1836
1837 else
1838   echo "$as_me: failed program was:" >&5
1839 cat conftest.$ac_ext >&5
1840 fi
1841 rm -f conftest.$ac_objext conftest.$ac_ext
1842 ac_ext=c
1843 ac_cpp='$CPP $CPPFLAGS'
1844 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1845 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1846 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1847 ac_main_return=return
1848
1849 GCC_VERSION=none
1850 if test "$GCC" = yes ; then
1851         echo "$as_me:1851: checking version of $CC" >&5
1852 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1853         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1854         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1855         echo "$as_me:1855: result: $GCC_VERSION" >&5
1856 echo "${ECHO_T}$GCC_VERSION" >&6
1857 fi
1858
1859 echo "$as_me:1859: checking for $CC option to accept ANSI C" >&5
1860 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1861 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1862   echo $ECHO_N "(cached) $ECHO_C" >&6
1863 else
1864   ac_cv_prog_cc_stdc=no
1865 ac_save_CC=$CC
1866 cat >conftest.$ac_ext <<_ACEOF
1867 #line 1867 "configure"
1868 #include "confdefs.h"
1869 #include <stdarg.h>
1870 #include <stdio.h>
1871 #include <sys/types.h>
1872 #include <sys/stat.h>
1873 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1874 struct buf { int x; };
1875 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1876 static char *e (p, i)
1877      char **p;
1878      int i;
1879 {
1880   return p[i];
1881 }
1882 static char *f (char * (*g) (char **, int), char **p, ...)
1883 {
1884   char *s;
1885   va_list v;
1886   va_start (v,p);
1887   s = g (p, va_arg (v,int));
1888   va_end (v);
1889   return s;
1890 }
1891 int test (int i, double x);
1892 struct s1 {int (*f) (int a);};
1893 struct s2 {int (*f) (double a);};
1894 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1895 int argc;
1896 char **argv;
1897 int
1898 main (void)
1899 {
1900 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1901   ;
1902   return 0;
1903 }
1904 _ACEOF
1905 # Don't try gcc -ansi; that turns off useful extensions and
1906 # breaks some systems' header files.
1907 # AIX                   -qlanglvl=ansi
1908 # Ultrix and OSF/1      -std1
1909 # HP-UX 10.20 and later -Ae
1910 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1911 # SVR4                  -Xc -D__EXTENSIONS__
1912 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1913 do
1914   CC="$ac_save_CC $ac_arg"
1915   rm -f conftest.$ac_objext
1916 if { (eval echo "$as_me:1916: \"$ac_compile\"") >&5
1917   (eval $ac_compile) 2>&5
1918   ac_status=$?
1919   echo "$as_me:1919: \$? = $ac_status" >&5
1920   (exit $ac_status); } &&
1921          { ac_try='test -s conftest.$ac_objext'
1922   { (eval echo "$as_me:1922: \"$ac_try\"") >&5
1923   (eval $ac_try) 2>&5
1924   ac_status=$?
1925   echo "$as_me:1925: \$? = $ac_status" >&5
1926   (exit $ac_status); }; }; then
1927   ac_cv_prog_cc_stdc=$ac_arg
1928 break
1929 else
1930   echo "$as_me: failed program was:" >&5
1931 cat conftest.$ac_ext >&5
1932 fi
1933 rm -f conftest.$ac_objext
1934 done
1935 rm -f conftest.$ac_ext conftest.$ac_objext
1936 CC=$ac_save_CC
1937
1938 fi
1939
1940 case "x$ac_cv_prog_cc_stdc" in
1941   x|xno)
1942     echo "$as_me:1942: result: none needed" >&5
1943 echo "${ECHO_T}none needed" >&6 ;;
1944   *)
1945     echo "$as_me:1945: result: $ac_cv_prog_cc_stdc" >&5
1946 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1947     CC="$CC $ac_cv_prog_cc_stdc" ;;
1948 esac
1949
1950 # This should have been defined by AC_PROG_CC
1951 : ${CC:=cc}
1952
1953 echo "$as_me:1953: checking \$CFLAGS variable" >&5
1954 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
1955 case "x$CFLAGS" in
1956 (*-[IUD]*)
1957         echo "$as_me:1957: result: broken" >&5
1958 echo "${ECHO_T}broken" >&6
1959         { echo "$as_me:1959: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
1960 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
1961         cf_flags="$CFLAGS"
1962         CFLAGS=
1963         for cf_arg in $cf_flags
1964         do
1965
1966 cf_fix_cppflags=no
1967 cf_new_cflags=
1968 cf_new_cppflags=
1969 cf_new_extra_cppflags=
1970
1971 for cf_add_cflags in $cf_arg
1972 do
1973 case $cf_fix_cppflags in
1974 (no)
1975         case $cf_add_cflags in
1976         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1977                 case $cf_add_cflags in
1978                 (-D*)
1979                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1980
1981                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1982                                 && test -z "${cf_tst_cflags}" \
1983                                 && cf_fix_cppflags=yes
1984
1985                         if test $cf_fix_cppflags = yes ; then
1986
1987         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1988         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1989
1990                                 continue
1991                         elif test "${cf_tst_cflags}" = "\"'" ; then
1992
1993         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1994         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1995
1996                                 continue
1997                         fi
1998                         ;;
1999                 esac
2000                 case "$CPPFLAGS" in
2001                 (*$cf_add_cflags)
2002                         ;;
2003                 (*)
2004                         case $cf_add_cflags in
2005                         (-D*)
2006                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2007
2008 CPPFLAGS=`echo "$CPPFLAGS" | \
2009         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2010                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2011
2012                                 ;;
2013                         esac
2014
2015         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2016         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2017
2018                         ;;
2019                 esac
2020                 ;;
2021         (*)
2022
2023         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2024         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2025
2026                 ;;
2027         esac
2028         ;;
2029 (yes)
2030
2031         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2032         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2033
2034         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2035
2036         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2037                 && test -z "${cf_tst_cflags}" \
2038                 && cf_fix_cppflags=no
2039         ;;
2040 esac
2041 done
2042
2043 if test -n "$cf_new_cflags" ; then
2044
2045         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2046         CFLAGS="${CFLAGS}$cf_new_cflags"
2047
2048 fi
2049
2050 if test -n "$cf_new_cppflags" ; then
2051
2052         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2053         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2054
2055 fi
2056
2057 if test -n "$cf_new_extra_cppflags" ; then
2058
2059         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2060         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2061
2062 fi
2063
2064         done
2065         ;;
2066 (*)
2067         echo "$as_me:2067: result: ok" >&5
2068 echo "${ECHO_T}ok" >&6
2069         ;;
2070 esac
2071
2072 echo "$as_me:2072: checking \$CC variable" >&5
2073 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2074 case "$CC" in
2075 (*[\ \  ]-*)
2076         echo "$as_me:2076: result: broken" >&5
2077 echo "${ECHO_T}broken" >&6
2078         { echo "$as_me:2078: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2079 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2080         # humor him...
2081         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2082         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2083         CC="$cf_prog"
2084         for cf_arg in $cf_flags
2085         do
2086                 case "x$cf_arg" in
2087                 (x-[IUDfgOW]*)
2088
2089 cf_fix_cppflags=no
2090 cf_new_cflags=
2091 cf_new_cppflags=
2092 cf_new_extra_cppflags=
2093
2094 for cf_add_cflags in $cf_arg
2095 do
2096 case $cf_fix_cppflags in
2097 (no)
2098         case $cf_add_cflags in
2099         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2100                 case $cf_add_cflags in
2101                 (-D*)
2102                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2103
2104                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2105                                 && test -z "${cf_tst_cflags}" \
2106                                 && cf_fix_cppflags=yes
2107
2108                         if test $cf_fix_cppflags = yes ; then
2109
2110         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2111         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2112
2113                                 continue
2114                         elif test "${cf_tst_cflags}" = "\"'" ; then
2115
2116         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2117         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2118
2119                                 continue
2120                         fi
2121                         ;;
2122                 esac
2123                 case "$CPPFLAGS" in
2124                 (*$cf_add_cflags)
2125                         ;;
2126                 (*)
2127                         case $cf_add_cflags in
2128                         (-D*)
2129                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2130
2131 CPPFLAGS=`echo "$CPPFLAGS" | \
2132         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2133                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2134
2135                                 ;;
2136                         esac
2137
2138         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2139         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2140
2141                         ;;
2142                 esac
2143                 ;;
2144         (*)
2145
2146         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2147         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2148
2149                 ;;
2150         esac
2151         ;;
2152 (yes)
2153
2154         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2155         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2156
2157         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2158
2159         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                 && test -z "${cf_tst_cflags}" \
2161                 && cf_fix_cppflags=no
2162         ;;
2163 esac
2164 done
2165
2166 if test -n "$cf_new_cflags" ; then
2167
2168         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2169         CFLAGS="${CFLAGS}$cf_new_cflags"
2170
2171 fi
2172
2173 if test -n "$cf_new_cppflags" ; then
2174
2175         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2176         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2177
2178 fi
2179
2180 if test -n "$cf_new_extra_cppflags" ; then
2181
2182         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2183         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2184
2185 fi
2186
2187                         ;;
2188                 (*)
2189                         CC="$CC $cf_arg"
2190                         ;;
2191                 esac
2192         done
2193         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2194
2195 echo "${as_me:-configure}:2195: testing resulting CC: '$CC' ..." 1>&5
2196
2197         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2198
2199 echo "${as_me:-configure}:2199: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2200
2201         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2202
2203 echo "${as_me:-configure}:2203: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2204
2205         ;;
2206 (*)
2207         echo "$as_me:2207: result: ok" >&5
2208 echo "${ECHO_T}ok" >&6
2209         ;;
2210 esac
2211
2212 echo "$as_me:2212: checking for inline" >&5
2213 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2214 if test "${ac_cv_c_inline+set}" = set; then
2215   echo $ECHO_N "(cached) $ECHO_C" >&6
2216 else
2217   ac_cv_c_inline=no
2218 for ac_kw in inline __inline__ __inline; do
2219   cat >conftest.$ac_ext <<_ACEOF
2220 #line 2220 "configure"
2221 #include "confdefs.h"
2222 #ifndef __cplusplus
2223 static $ac_kw int static_foo () {return 0; }
2224 $ac_kw int foo () {return 0; }
2225 #endif
2226
2227 _ACEOF
2228 rm -f conftest.$ac_objext
2229 if { (eval echo "$as_me:2229: \"$ac_compile\"") >&5
2230   (eval $ac_compile) 2>&5
2231   ac_status=$?
2232   echo "$as_me:2232: \$? = $ac_status" >&5
2233   (exit $ac_status); } &&
2234          { ac_try='test -s conftest.$ac_objext'
2235   { (eval echo "$as_me:2235: \"$ac_try\"") >&5
2236   (eval $ac_try) 2>&5
2237   ac_status=$?
2238   echo "$as_me:2238: \$? = $ac_status" >&5
2239   (exit $ac_status); }; }; then
2240   ac_cv_c_inline=$ac_kw; break
2241 else
2242   echo "$as_me: failed program was:" >&5
2243 cat conftest.$ac_ext >&5
2244 fi
2245 rm -f conftest.$ac_objext conftest.$ac_ext
2246 done
2247
2248 fi
2249 echo "$as_me:2249: result: $ac_cv_c_inline" >&5
2250 echo "${ECHO_T}$ac_cv_c_inline" >&6
2251 case $ac_cv_c_inline in
2252   inline | yes) ;;
2253   no)
2254 cat >>confdefs.h <<\EOF
2255 #define inline
2256 EOF
2257  ;;
2258   *)  cat >>confdefs.h <<EOF
2259 #define inline $ac_cv_c_inline
2260 EOF
2261  ;;
2262 esac
2263
2264 ac_ext=c
2265 ac_cpp='$CPP $CPPFLAGS'
2266 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2267 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2268 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2269 ac_main_return=return
2270 echo "$as_me:2270: checking how to run the C preprocessor" >&5
2271 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2272 # On Suns, sometimes $CPP names a directory.
2273 if test -n "$CPP" && test -d "$CPP"; then
2274   CPP=
2275 fi
2276 if test -z "$CPP"; then
2277   if test "${ac_cv_prog_CPP+set}" = set; then
2278   echo $ECHO_N "(cached) $ECHO_C" >&6
2279 else
2280       # Double quotes because CPP needs to be expanded
2281     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2282     do
2283       ac_preproc_ok=false
2284 for ac_c_preproc_warn_flag in '' yes
2285 do
2286   # Use a header file that comes with gcc, so configuring glibc
2287   # with a fresh cross-compiler works.
2288   # On the NeXT, cc -E runs the code through the compiler's parser,
2289   # not just through cpp. "Syntax error" is here to catch this case.
2290   cat >conftest.$ac_ext <<_ACEOF
2291 #line 2291 "configure"
2292 #include "confdefs.h"
2293 #include <assert.h>
2294                      Syntax error
2295 _ACEOF
2296 if { (eval echo "$as_me:2296: \"$ac_cpp conftest.$ac_ext\"") >&5
2297   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2298   ac_status=$?
2299   egrep -v '^ *\+' conftest.er1 >conftest.err
2300   rm -f conftest.er1
2301   cat conftest.err >&5
2302   echo "$as_me:2302: \$? = $ac_status" >&5
2303   (exit $ac_status); } >/dev/null; then
2304   if test -s conftest.err; then
2305     ac_cpp_err=$ac_c_preproc_warn_flag
2306   else
2307     ac_cpp_err=
2308   fi
2309 else
2310   ac_cpp_err=yes
2311 fi
2312 if test -z "$ac_cpp_err"; then
2313   :
2314 else
2315   echo "$as_me: failed program was:" >&5
2316   cat conftest.$ac_ext >&5
2317   # Broken: fails on valid input.
2318 continue
2319 fi
2320 rm -f conftest.err conftest.$ac_ext
2321
2322   # OK, works on sane cases.  Now check whether non-existent headers
2323   # can be detected and how.
2324   cat >conftest.$ac_ext <<_ACEOF
2325 #line 2325 "configure"
2326 #include "confdefs.h"
2327 #include <ac_nonexistent.h>
2328 _ACEOF
2329 if { (eval echo "$as_me:2329: \"$ac_cpp conftest.$ac_ext\"") >&5
2330   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2331   ac_status=$?
2332   egrep -v '^ *\+' conftest.er1 >conftest.err
2333   rm -f conftest.er1
2334   cat conftest.err >&5
2335   echo "$as_me:2335: \$? = $ac_status" >&5
2336   (exit $ac_status); } >/dev/null; then
2337   if test -s conftest.err; then
2338     ac_cpp_err=$ac_c_preproc_warn_flag
2339   else
2340     ac_cpp_err=
2341   fi
2342 else
2343   ac_cpp_err=yes
2344 fi
2345 if test -z "$ac_cpp_err"; then
2346   # Broken: success on invalid input.
2347 continue
2348 else
2349   echo "$as_me: failed program was:" >&5
2350   cat conftest.$ac_ext >&5
2351   # Passes both tests.
2352 ac_preproc_ok=:
2353 break
2354 fi
2355 rm -f conftest.err conftest.$ac_ext
2356
2357 done
2358 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2359 rm -f conftest.err conftest.$ac_ext
2360 if $ac_preproc_ok; then
2361   break
2362 fi
2363
2364     done
2365     ac_cv_prog_CPP=$CPP
2366
2367 fi
2368   CPP=$ac_cv_prog_CPP
2369 else
2370   ac_cv_prog_CPP=$CPP
2371 fi
2372 echo "$as_me:2372: result: $CPP" >&5
2373 echo "${ECHO_T}$CPP" >&6
2374 ac_preproc_ok=false
2375 for ac_c_preproc_warn_flag in '' yes
2376 do
2377   # Use a header file that comes with gcc, so configuring glibc
2378   # with a fresh cross-compiler works.
2379   # On the NeXT, cc -E runs the code through the compiler's parser,
2380   # not just through cpp. "Syntax error" is here to catch this case.
2381   cat >conftest.$ac_ext <<_ACEOF
2382 #line 2382 "configure"
2383 #include "confdefs.h"
2384 #include <assert.h>
2385                      Syntax error
2386 _ACEOF
2387 if { (eval echo "$as_me:2387: \"$ac_cpp conftest.$ac_ext\"") >&5
2388   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2389   ac_status=$?
2390   egrep -v '^ *\+' conftest.er1 >conftest.err
2391   rm -f conftest.er1
2392   cat conftest.err >&5
2393   echo "$as_me:2393: \$? = $ac_status" >&5
2394   (exit $ac_status); } >/dev/null; then
2395   if test -s conftest.err; then
2396     ac_cpp_err=$ac_c_preproc_warn_flag
2397   else
2398     ac_cpp_err=
2399   fi
2400 else
2401   ac_cpp_err=yes
2402 fi
2403 if test -z "$ac_cpp_err"; then
2404   :
2405 else
2406   echo "$as_me: failed program was:" >&5
2407   cat conftest.$ac_ext >&5
2408   # Broken: fails on valid input.
2409 continue
2410 fi
2411 rm -f conftest.err conftest.$ac_ext
2412
2413   # OK, works on sane cases.  Now check whether non-existent headers
2414   # can be detected and how.
2415   cat >conftest.$ac_ext <<_ACEOF
2416 #line 2416 "configure"
2417 #include "confdefs.h"
2418 #include <ac_nonexistent.h>
2419 _ACEOF
2420 if { (eval echo "$as_me:2420: \"$ac_cpp conftest.$ac_ext\"") >&5
2421   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2422   ac_status=$?
2423   egrep -v '^ *\+' conftest.er1 >conftest.err
2424   rm -f conftest.er1
2425   cat conftest.err >&5
2426   echo "$as_me:2426: \$? = $ac_status" >&5
2427   (exit $ac_status); } >/dev/null; then
2428   if test -s conftest.err; then
2429     ac_cpp_err=$ac_c_preproc_warn_flag
2430   else
2431     ac_cpp_err=
2432   fi
2433 else
2434   ac_cpp_err=yes
2435 fi
2436 if test -z "$ac_cpp_err"; then
2437   # Broken: success on invalid input.
2438 continue
2439 else
2440   echo "$as_me: failed program was:" >&5
2441   cat conftest.$ac_ext >&5
2442   # Passes both tests.
2443 ac_preproc_ok=:
2444 break
2445 fi
2446 rm -f conftest.err conftest.$ac_ext
2447
2448 done
2449 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2450 rm -f conftest.err conftest.$ac_ext
2451 if $ac_preproc_ok; then
2452   :
2453 else
2454   { { echo "$as_me:2454: error: C preprocessor \"$CPP\" fails sanity check" >&5
2455 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2456    { (exit 1); exit 1; }; }
2457 fi
2458
2459 ac_ext=c
2460 ac_cpp='$CPP $CPPFLAGS'
2461 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2462 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2463 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2464 ac_main_return=return
2465
2466 for ac_prog in mawk gawk nawk awk
2467 do
2468   # Extract the first word of "$ac_prog", so it can be a program name with args.
2469 set dummy $ac_prog; ac_word=$2
2470 echo "$as_me:2470: checking for $ac_word" >&5
2471 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2472 if test "${ac_cv_prog_AWK+set}" = set; then
2473   echo $ECHO_N "(cached) $ECHO_C" >&6
2474 else
2475   if test -n "$AWK"; then
2476   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2477 else
2478   ac_save_IFS=$IFS; IFS=$ac_path_separator
2479 ac_dummy="$PATH"
2480 for ac_dir in $ac_dummy; do
2481   IFS=$ac_save_IFS
2482   test -z "$ac_dir" && ac_dir=.
2483   $as_executable_p "$ac_dir/$ac_word" || continue
2484 ac_cv_prog_AWK="$ac_prog"
2485 echo "$as_me:2485: found $ac_dir/$ac_word" >&5
2486 break
2487 done
2488
2489 fi
2490 fi
2491 AWK=$ac_cv_prog_AWK
2492 if test -n "$AWK"; then
2493   echo "$as_me:2493: result: $AWK" >&5
2494 echo "${ECHO_T}$AWK" >&6
2495 else
2496   echo "$as_me:2496: result: no" >&5
2497 echo "${ECHO_T}no" >&6
2498 fi
2499
2500   test -n "$AWK" && break
2501 done
2502
2503 # Find a good install program.  We prefer a C program (faster),
2504 # so one script is as good as another.  But avoid the broken or
2505 # incompatible versions:
2506 # SysV /etc/install, /usr/sbin/install
2507 # SunOS /usr/etc/install
2508 # IRIX /sbin/install
2509 # AIX /bin/install
2510 # AmigaOS /C/install, which installs bootblocks on floppy discs
2511 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2512 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2513 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2514 # ./install, which can be erroneously created by make from ./install.sh.
2515 echo "$as_me:2515: checking for a BSD compatible install" >&5
2516 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2517 if test -z "$INSTALL"; then
2518 if test "${ac_cv_path_install+set}" = set; then
2519   echo $ECHO_N "(cached) $ECHO_C" >&6
2520 else
2521     ac_save_IFS=$IFS; IFS=$ac_path_separator
2522   for ac_dir in $PATH; do
2523     IFS=$ac_save_IFS
2524     # Account for people who put trailing slashes in PATH elements.
2525     case $ac_dir/ in
2526     / | ./ | .// | /cC/* \
2527     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2528     | /usr/ucb/* ) ;;
2529     *)
2530       # OSF1 and SCO ODT 3.0 have their own names for install.
2531       # Don't use installbsd from OSF since it installs stuff as root
2532       # by default.
2533       for ac_prog in ginstall scoinst install; do
2534         if $as_executable_p "$ac_dir/$ac_prog"; then
2535           if test $ac_prog = install &&
2536             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2537             # AIX install.  It has an incompatible calling convention.
2538             :
2539           elif test $ac_prog = install &&
2540             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2541             # program-specific install script used by HP pwplus--don't use.
2542             :
2543           else
2544             ac_cv_path_install="$ac_dir/$ac_prog -c"
2545             break 2
2546           fi
2547         fi
2548       done
2549       ;;
2550     esac
2551   done
2552
2553 fi
2554   if test "${ac_cv_path_install+set}" = set; then
2555     INSTALL=$ac_cv_path_install
2556   else
2557     # As a last resort, use the slow shell script.  We don't cache a
2558     # path for INSTALL within a source directory, because that will
2559     # break other packages using the cache if that directory is
2560     # removed, or if the path is relative.
2561     INSTALL=$ac_install_sh
2562   fi
2563 fi
2564 echo "$as_me:2564: result: $INSTALL" >&5
2565 echo "${ECHO_T}$INSTALL" >&6
2566
2567 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2568 # It thinks the first close brace ends the variable substitution.
2569 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2570
2571 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2572
2573 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2574
2575 case $INSTALL in
2576 (/*)
2577         ;;
2578 (*)
2579         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2580         test -z "$cf_dir" && cf_dir=.
2581         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2582         ;;
2583 esac
2584
2585 echo "$as_me:2585: checking if you want to install stripped executables" >&5
2586 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2587
2588 # Check whether --enable-stripping or --disable-stripping was given.
2589 if test "${enable_stripping+set}" = set; then
2590   enableval="$enable_stripping"
2591   test "$enableval" != no && enableval=yes
2592         if test "$enableval" != "yes" ; then
2593     with_stripping=no
2594         else
2595                 with_stripping=yes
2596         fi
2597 else
2598   enableval=yes
2599         with_stripping=yes
2600
2601 fi;
2602 echo "$as_me:2602: result: $with_stripping" >&5
2603 echo "${ECHO_T}$with_stripping" >&6
2604
2605 if test "$with_stripping" = yes
2606 then
2607         INSTALL_OPT_S="-s"
2608 else
2609         INSTALL_OPT_S=
2610 fi
2611
2612 : ${INSTALL:=install}
2613 echo "$as_me:2613: checking if install accepts -p option" >&5
2614 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2615 if test "${cf_cv_install_p+set}" = set; then
2616   echo $ECHO_N "(cached) $ECHO_C" >&6
2617 else
2618
2619         rm -rf conftest*
2620         date >conftest.in
2621         mkdir conftest.out
2622         sleep 3
2623         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2624         then
2625                 if test -f conftest.out/conftest.in
2626                 then
2627                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2628                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2629                         if test -s conftest.err
2630                         then
2631                                 cf_cv_install_p=no
2632                         else
2633                                 cf_cv_install_p=yes
2634                         fi
2635                 else
2636                         cf_cv_install_p=no
2637                 fi
2638         else
2639                 cf_cv_install_p=no
2640         fi
2641         rm -rf conftest*
2642
2643 fi
2644 echo "$as_me:2644: result: $cf_cv_install_p" >&5
2645 echo "${ECHO_T}$cf_cv_install_p" >&6
2646
2647 echo "$as_me:2647: checking if install needs to be told about ownership" >&5
2648 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2649 case `$ac_config_guess` in
2650 (*minix)
2651         with_install_o=yes
2652         ;;
2653 (*)
2654         with_install_o=no
2655         ;;
2656 esac
2657
2658 echo "$as_me:2658: result: $with_install_o" >&5
2659 echo "${ECHO_T}$with_install_o" >&6
2660 if test "x$with_install_o" = xyes
2661 then
2662         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2663 else
2664         INSTALL_OPT_O=
2665 fi
2666
2667 for ac_prog in lint cppcheck splint
2668 do
2669   # Extract the first word of "$ac_prog", so it can be a program name with args.
2670 set dummy $ac_prog; ac_word=$2
2671 echo "$as_me:2671: checking for $ac_word" >&5
2672 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2673 if test "${ac_cv_prog_LINT+set}" = set; then
2674   echo $ECHO_N "(cached) $ECHO_C" >&6
2675 else
2676   if test -n "$LINT"; then
2677   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2678 else
2679   ac_save_IFS=$IFS; IFS=$ac_path_separator
2680 ac_dummy="$PATH"
2681 for ac_dir in $ac_dummy; do
2682   IFS=$ac_save_IFS
2683   test -z "$ac_dir" && ac_dir=.
2684   $as_executable_p "$ac_dir/$ac_word" || continue
2685 ac_cv_prog_LINT="$ac_prog"
2686 echo "$as_me:2686: found $ac_dir/$ac_word" >&5
2687 break
2688 done
2689
2690 fi
2691 fi
2692 LINT=$ac_cv_prog_LINT
2693 if test -n "$LINT"; then
2694   echo "$as_me:2694: result: $LINT" >&5
2695 echo "${ECHO_T}$LINT" >&6
2696 else
2697   echo "$as_me:2697: result: no" >&5
2698 echo "${ECHO_T}no" >&6
2699 fi
2700
2701   test -n "$LINT" && break
2702 done
2703
2704 echo "$as_me:2704: checking if filesystem supports mixed-case filenames" >&5
2705 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2706 if test "${cf_cv_mixedcase+set}" = set; then
2707   echo $ECHO_N "(cached) $ECHO_C" >&6
2708 else
2709
2710 if test "$cross_compiling" = yes ; then
2711         case $target_alias in
2712         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2713                 cf_cv_mixedcase=no
2714                 ;;
2715         (*)
2716                 cf_cv_mixedcase=yes
2717                 ;;
2718         esac
2719 else
2720         rm -f conftest CONFTEST
2721         echo test >conftest
2722         if test -f CONFTEST ; then
2723                 cf_cv_mixedcase=no
2724         else
2725                 cf_cv_mixedcase=yes
2726         fi
2727         rm -f conftest CONFTEST
2728 fi
2729
2730 fi
2731 echo "$as_me:2731: result: $cf_cv_mixedcase" >&5
2732 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2733 test "$cf_cv_mixedcase" = yes &&
2734 cat >>confdefs.h <<\EOF
2735 #define MIXEDCASE_FILENAMES 1
2736 EOF
2737
2738 for ac_prog in exctags ctags
2739 do
2740   # Extract the first word of "$ac_prog", so it can be a program name with args.
2741 set dummy $ac_prog; ac_word=$2
2742 echo "$as_me:2742: checking for $ac_word" >&5
2743 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2744 if test "${ac_cv_prog_CTAGS+set}" = set; then
2745   echo $ECHO_N "(cached) $ECHO_C" >&6
2746 else
2747   if test -n "$CTAGS"; then
2748   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2749 else
2750   ac_save_IFS=$IFS; IFS=$ac_path_separator
2751 ac_dummy="$PATH"
2752 for ac_dir in $ac_dummy; do
2753   IFS=$ac_save_IFS
2754   test -z "$ac_dir" && ac_dir=.
2755   $as_executable_p "$ac_dir/$ac_word" || continue
2756 ac_cv_prog_CTAGS="$ac_prog"
2757 echo "$as_me:2757: found $ac_dir/$ac_word" >&5
2758 break
2759 done
2760
2761 fi
2762 fi
2763 CTAGS=$ac_cv_prog_CTAGS
2764 if test -n "$CTAGS"; then
2765   echo "$as_me:2765: result: $CTAGS" >&5
2766 echo "${ECHO_T}$CTAGS" >&6
2767 else
2768   echo "$as_me:2768: result: no" >&5
2769 echo "${ECHO_T}no" >&6
2770 fi
2771
2772   test -n "$CTAGS" && break
2773 done
2774
2775 for ac_prog in exetags etags
2776 do
2777   # Extract the first word of "$ac_prog", so it can be a program name with args.
2778 set dummy $ac_prog; ac_word=$2
2779 echo "$as_me:2779: checking for $ac_word" >&5
2780 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2781 if test "${ac_cv_prog_ETAGS+set}" = set; then
2782   echo $ECHO_N "(cached) $ECHO_C" >&6
2783 else
2784   if test -n "$ETAGS"; then
2785   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2786 else
2787   ac_save_IFS=$IFS; IFS=$ac_path_separator
2788 ac_dummy="$PATH"
2789 for ac_dir in $ac_dummy; do
2790   IFS=$ac_save_IFS
2791   test -z "$ac_dir" && ac_dir=.
2792   $as_executable_p "$ac_dir/$ac_word" || continue
2793 ac_cv_prog_ETAGS="$ac_prog"
2794 echo "$as_me:2794: found $ac_dir/$ac_word" >&5
2795 break
2796 done
2797
2798 fi
2799 fi
2800 ETAGS=$ac_cv_prog_ETAGS
2801 if test -n "$ETAGS"; then
2802   echo "$as_me:2802: result: $ETAGS" >&5
2803 echo "${ECHO_T}$ETAGS" >&6
2804 else
2805   echo "$as_me:2805: result: no" >&5
2806 echo "${ECHO_T}no" >&6
2807 fi
2808
2809   test -n "$ETAGS" && break
2810 done
2811
2812 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2813 set dummy ${CTAGS:-ctags}; ac_word=$2
2814 echo "$as_me:2814: checking for $ac_word" >&5
2815 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2816 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2817   echo $ECHO_N "(cached) $ECHO_C" >&6
2818 else
2819   if test -n "$MAKE_LOWER_TAGS"; then
2820   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2821 else
2822   ac_save_IFS=$IFS; IFS=$ac_path_separator
2823 ac_dummy="$PATH"
2824 for ac_dir in $ac_dummy; do
2825   IFS=$ac_save_IFS
2826   test -z "$ac_dir" && ac_dir=.
2827   $as_executable_p "$ac_dir/$ac_word" || continue
2828 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2829 echo "$as_me:2829: found $ac_dir/$ac_word" >&5
2830 break
2831 done
2832
2833   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2834 fi
2835 fi
2836 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2837 if test -n "$MAKE_LOWER_TAGS"; then
2838   echo "$as_me:2838: result: $MAKE_LOWER_TAGS" >&5
2839 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2840 else
2841   echo "$as_me:2841: result: no" >&5
2842 echo "${ECHO_T}no" >&6
2843 fi
2844
2845 if test "$cf_cv_mixedcase" = yes ; then
2846         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2847 set dummy ${ETAGS:-etags}; ac_word=$2
2848 echo "$as_me:2848: checking for $ac_word" >&5
2849 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2850 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2851   echo $ECHO_N "(cached) $ECHO_C" >&6
2852 else
2853   if test -n "$MAKE_UPPER_TAGS"; then
2854   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2855 else
2856   ac_save_IFS=$IFS; IFS=$ac_path_separator
2857 ac_dummy="$PATH"
2858 for ac_dir in $ac_dummy; do
2859   IFS=$ac_save_IFS
2860   test -z "$ac_dir" && ac_dir=.
2861   $as_executable_p "$ac_dir/$ac_word" || continue
2862 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2863 echo "$as_me:2863: found $ac_dir/$ac_word" >&5
2864 break
2865 done
2866
2867   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2868 fi
2869 fi
2870 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2871 if test -n "$MAKE_UPPER_TAGS"; then
2872   echo "$as_me:2872: result: $MAKE_UPPER_TAGS" >&5
2873 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2874 else
2875   echo "$as_me:2875: result: no" >&5
2876 echo "${ECHO_T}no" >&6
2877 fi
2878
2879 else
2880         MAKE_UPPER_TAGS=no
2881 fi
2882
2883 if test "$MAKE_UPPER_TAGS" = yes ; then
2884         MAKE_UPPER_TAGS=
2885 else
2886         MAKE_UPPER_TAGS="#"
2887 fi
2888
2889 if test "$MAKE_LOWER_TAGS" = yes ; then
2890         MAKE_LOWER_TAGS=
2891 else
2892         MAKE_LOWER_TAGS="#"
2893 fi
2894
2895 echo "$as_me:2895: checking if -lm needed for math functions" >&5
2896 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2897 if test "${cf_cv_need_libm+set}" = set; then
2898   echo $ECHO_N "(cached) $ECHO_C" >&6
2899 else
2900
2901         cat >conftest.$ac_ext <<_ACEOF
2902 #line 2902 "configure"
2903 #include "confdefs.h"
2904
2905         #include <stdio.h>
2906         #include <stdlib.h>
2907         #include <math.h>
2908
2909 int
2910 main (void)
2911 {
2912 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2913   ;
2914   return 0;
2915 }
2916 _ACEOF
2917 rm -f conftest.$ac_objext conftest$ac_exeext
2918 if { (eval echo "$as_me:2918: \"$ac_link\"") >&5
2919   (eval $ac_link) 2>&5
2920   ac_status=$?
2921   echo "$as_me:2921: \$? = $ac_status" >&5
2922   (exit $ac_status); } &&
2923          { ac_try='test -s conftest$ac_exeext'
2924   { (eval echo "$as_me:2924: \"$ac_try\"") >&5
2925   (eval $ac_try) 2>&5
2926   ac_status=$?
2927   echo "$as_me:2927: \$? = $ac_status" >&5
2928   (exit $ac_status); }; }; then
2929   cf_cv_need_libm=no
2930 else
2931   echo "$as_me: failed program was:" >&5
2932 cat conftest.$ac_ext >&5
2933 cf_cv_need_libm=yes
2934 fi
2935 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2936 fi
2937 echo "$as_me:2937: result: $cf_cv_need_libm" >&5
2938 echo "${ECHO_T}$cf_cv_need_libm" >&6
2939 if test "$cf_cv_need_libm" = yes
2940 then
2941 MATH_LIB=-lm
2942 fi
2943
2944 top_builddir=`pwd`
2945
2946 CC_G_OPT="-g"
2947 CC_SHARED_OPTS=unknown
2948 CPPFLAGS="$CPPFLAGS"
2949 DFT_DEP_SUFFIX=""
2950 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2951 DFT_UPR_MODEL="NORMAL"
2952 LD="ld"
2953 LDFLAGS_SHARED=""
2954 LDFLAGS_STATIC=""
2955 LD_MODEL=""
2956 LD_SHARED_OPTS=""
2957 LIBTOOL=""
2958 LIBTOOL_OPTS=""
2959 LIB_CLEAN=""
2960 LIB_COMPILE=""
2961 LIB_LINK='${CC}'
2962 LINK_TESTS=""
2963 LOCAL_LDFLAGS=""
2964 PACKAGE="ncurses-examples"
2965 PTHREAD="-lm"
2966 TEST_ARGS=""
2967 TEST_DEPS=""
2968 TEST_LIBS=""
2969 TINFO_LDFLAGS=''
2970 TINFO_LIBS='$(LIBS_CURSES)'
2971 cf_cv_abi_version=""
2972 cf_cv_rel_version=""
2973 includesubdir=""
2974
2975 cf_cv_screen=curses
2976 cf_cv_libtype=
2977
2978 if test "$GCC" = yes
2979 then
2980 cat > conftest.i <<EOF
2981 #ifndef GCC_PRINTF
2982 #define GCC_PRINTF 0
2983 #endif
2984 #ifndef GCC_SCANF
2985 #define GCC_SCANF 0
2986 #endif
2987 #ifndef GCC_NORETURN
2988 #define GCC_NORETURN /* nothing */
2989 #endif
2990 #ifndef GCC_UNUSED
2991 #define GCC_UNUSED /* nothing */
2992 #endif
2993 EOF
2994 if test "$GCC" = yes
2995 then
2996         { echo "$as_me:2996: checking for $CC __attribute__ directives..." >&5
2997 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2998 cat > conftest.$ac_ext <<EOF
2999 #line 2999 "${as_me:-configure}"
3000 #include "confdefs.h"
3001 #include "conftest.h"
3002 #include "conftest.i"
3003 #if     GCC_PRINTF
3004 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3005 #else
3006 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3007 #endif
3008 #if     GCC_SCANF
3009 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3010 #else
3011 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3012 #endif
3013 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3014 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3015 extern void foo(void) GCC_NORETURN;
3016 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3017 EOF
3018         cf_printf_attribute=no
3019         cf_scanf_attribute=no
3020         for cf_attribute in scanf printf unused noreturn
3021         do
3022
3023 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3024
3025                 cf_directive="__attribute__(($cf_attribute))"
3026                 echo "checking for $CC $cf_directive" 1>&5
3027
3028                 case $cf_attribute in
3029                 (printf)
3030                         cf_printf_attribute=yes
3031                         cat >conftest.h <<EOF
3032 #define GCC_$cf_ATTRIBUTE 1
3033 EOF
3034                         ;;
3035                 (scanf)
3036                         cf_scanf_attribute=yes
3037                         cat >conftest.h <<EOF
3038 #define GCC_$cf_ATTRIBUTE 1
3039 EOF
3040                         ;;
3041                 (*)
3042                         cat >conftest.h <<EOF
3043 #define GCC_$cf_ATTRIBUTE $cf_directive
3044 EOF
3045                         ;;
3046                 esac
3047
3048                 if { (eval echo "$as_me:3048: \"$ac_compile\"") >&5
3049   (eval $ac_compile) 2>&5
3050   ac_status=$?
3051   echo "$as_me:3051: \$? = $ac_status" >&5
3052   (exit $ac_status); }; then
3053                         test -n "$verbose" && echo "$as_me:3053: result: ... $cf_attribute" >&5
3054 echo "${ECHO_T}... $cf_attribute" >&6
3055                         cat conftest.h >>confdefs.h
3056                         case $cf_attribute in
3057                         (noreturn)
3058
3059 cat >>confdefs.h <<EOF
3060 #define GCC_NORETURN $cf_directive
3061 EOF
3062
3063                                 ;;
3064                         (printf)
3065                                 cf_value='/* nothing */'
3066                                 if test "$cf_printf_attribute" != no ; then
3067                                         cf_value='__attribute__((format(printf,fmt,var)))'
3068
3069 cat >>confdefs.h <<\EOF
3070 #define GCC_PRINTF 1
3071 EOF
3072
3073                                 fi
3074
3075 cat >>confdefs.h <<EOF
3076 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3077 EOF
3078
3079                                 ;;
3080                         (scanf)
3081                                 cf_value='/* nothing */'
3082                                 if test "$cf_scanf_attribute" != no ; then
3083                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3084
3085 cat >>confdefs.h <<\EOF
3086 #define GCC_SCANF 1
3087 EOF
3088
3089                                 fi
3090
3091 cat >>confdefs.h <<EOF
3092 #define GCC_SCANFLIKE(fmt,var) $cf_value
3093 EOF
3094
3095                                 ;;
3096                         (unused)
3097
3098 cat >>confdefs.h <<EOF
3099 #define GCC_UNUSED $cf_directive
3100 EOF
3101
3102                                 ;;
3103                         esac
3104                 fi
3105         done
3106 else
3107         fgrep define conftest.i >>confdefs.h
3108 fi
3109 rm -rf conftest*
3110 fi
3111
3112 echo "$as_me:3112: checking if you want to work around bogus compiler/loader warnings" >&5
3113 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3114
3115 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3116 if test "${enable_string_hacks+set}" = set; then
3117   enableval="$enable_string_hacks"
3118   with_string_hacks=$enableval
3119 else
3120   with_string_hacks=no
3121 fi;
3122 echo "$as_me:3122: result: $with_string_hacks" >&5
3123 echo "${ECHO_T}$with_string_hacks" >&6
3124
3125 if test "x$with_string_hacks" = "xyes"; then
3126
3127 cat >>confdefs.h <<\EOF
3128 #define USE_STRING_HACKS 1
3129 EOF
3130
3131         { echo "$as_me:3131: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3132 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3133         echo "$as_me:3133: checking for strlcat" >&5
3134 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3135 if test "${ac_cv_func_strlcat+set}" = set; then
3136   echo $ECHO_N "(cached) $ECHO_C" >&6
3137 else
3138   cat >conftest.$ac_ext <<_ACEOF
3139 #line 3139 "configure"
3140 #include "confdefs.h"
3141 #define strlcat autoconf_temporary
3142 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3143 #undef strlcat
3144
3145 #ifdef __cplusplus
3146 extern "C"
3147 #endif
3148
3149 /* We use char because int might match the return type of a gcc2
3150    builtin and then its argument prototype would still apply.  */
3151 char strlcat (void);
3152
3153 int
3154 main (void)
3155 {
3156
3157 /* The GNU C library defines stubs for functions which it implements
3158     to always fail with ENOSYS.  Some functions are actually named
3159     something starting with __ and the normal name is an alias.  */
3160 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3161 #error found stub for strlcat
3162 #endif
3163
3164         return strlcat ();
3165   ;
3166   return 0;
3167 }
3168 _ACEOF
3169 rm -f conftest.$ac_objext conftest$ac_exeext
3170 if { (eval echo "$as_me:3170: \"$ac_link\"") >&5
3171   (eval $ac_link) 2>&5
3172   ac_status=$?
3173   echo "$as_me:3173: \$? = $ac_status" >&5
3174   (exit $ac_status); } &&
3175          { ac_try='test -s conftest$ac_exeext'
3176   { (eval echo "$as_me:3176: \"$ac_try\"") >&5
3177   (eval $ac_try) 2>&5
3178   ac_status=$?
3179   echo "$as_me:3179: \$? = $ac_status" >&5
3180   (exit $ac_status); }; }; then
3181   ac_cv_func_strlcat=yes
3182 else
3183   echo "$as_me: failed program was:" >&5
3184 cat conftest.$ac_ext >&5
3185 ac_cv_func_strlcat=no
3186 fi
3187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3188 fi
3189 echo "$as_me:3189: result: $ac_cv_func_strlcat" >&5
3190 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3191 if test $ac_cv_func_strlcat = yes; then
3192
3193 cat >>confdefs.h <<\EOF
3194 #define HAVE_STRLCAT 1
3195 EOF
3196
3197 else
3198
3199                 echo "$as_me:3199: checking for strlcat in -lbsd" >&5
3200 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3201 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3202   echo $ECHO_N "(cached) $ECHO_C" >&6
3203 else
3204   ac_check_lib_save_LIBS=$LIBS
3205 LIBS="-lbsd  $LIBS"
3206 cat >conftest.$ac_ext <<_ACEOF
3207 #line 3207 "configure"
3208 #include "confdefs.h"
3209
3210 /* Override any gcc2 internal prototype to avoid an error.  */
3211 #ifdef __cplusplus
3212 extern "C"
3213 #endif
3214 /* We use char because int might match the return type of a gcc2
3215    builtin and then its argument prototype would still apply.  */
3216 char strlcat ();
3217 int
3218 main (void)
3219 {
3220 strlcat ();
3221   ;
3222   return 0;
3223 }
3224 _ACEOF
3225 rm -f conftest.$ac_objext conftest$ac_exeext
3226 if { (eval echo "$as_me:3226: \"$ac_link\"") >&5
3227   (eval $ac_link) 2>&5
3228   ac_status=$?
3229   echo "$as_me:3229: \$? = $ac_status" >&5
3230   (exit $ac_status); } &&
3231          { ac_try='test -s conftest$ac_exeext'
3232   { (eval echo "$as_me:3232: \"$ac_try\"") >&5
3233   (eval $ac_try) 2>&5
3234   ac_status=$?
3235   echo "$as_me:3235: \$? = $ac_status" >&5
3236   (exit $ac_status); }; }; then
3237   ac_cv_lib_bsd_strlcat=yes
3238 else
3239   echo "$as_me: failed program was:" >&5
3240 cat conftest.$ac_ext >&5
3241 ac_cv_lib_bsd_strlcat=no
3242 fi
3243 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3244 LIBS=$ac_check_lib_save_LIBS
3245 fi
3246 echo "$as_me:3246: result: $ac_cv_lib_bsd_strlcat" >&5
3247 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3248 if test $ac_cv_lib_bsd_strlcat = yes; then
3249
3250 cf_add_libs="-lbsd"
3251 # Filter out duplicates - this happens with badly-designed ".pc" files...
3252 for cf_add_1lib in $LIBS
3253 do
3254         for cf_add_2lib in $cf_add_libs
3255         do
3256                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3257                 then
3258                         cf_add_1lib=
3259                         break
3260                 fi
3261         done
3262         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3263 done
3264 LIBS="$cf_add_libs"
3265
3266 for ac_header in bsd/string.h
3267 do
3268 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3269 echo "$as_me:3269: checking for $ac_header" >&5
3270 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3271 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3272   echo $ECHO_N "(cached) $ECHO_C" >&6
3273 else
3274   cat >conftest.$ac_ext <<_ACEOF
3275 #line 3275 "configure"
3276 #include "confdefs.h"
3277 #include <$ac_header>
3278 _ACEOF
3279 if { (eval echo "$as_me:3279: \"$ac_cpp conftest.$ac_ext\"") >&5
3280   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3281   ac_status=$?
3282   egrep -v '^ *\+' conftest.er1 >conftest.err
3283   rm -f conftest.er1
3284   cat conftest.err >&5
3285   echo "$as_me:3285: \$? = $ac_status" >&5
3286   (exit $ac_status); } >/dev/null; then
3287   if test -s conftest.err; then
3288     ac_cpp_err=$ac_c_preproc_warn_flag
3289   else
3290     ac_cpp_err=
3291   fi
3292 else
3293   ac_cpp_err=yes
3294 fi
3295 if test -z "$ac_cpp_err"; then
3296   eval "$as_ac_Header=yes"
3297 else
3298   echo "$as_me: failed program was:" >&5
3299   cat conftest.$ac_ext >&5
3300   eval "$as_ac_Header=no"
3301 fi
3302 rm -f conftest.err conftest.$ac_ext
3303 fi
3304 echo "$as_me:3304: result: `eval echo '${'$as_ac_Header'}'`" >&5
3305 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3306 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3307   cat >>confdefs.h <<EOF
3308 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3309 EOF
3310
3311 fi
3312 done
3313
3314 cat >>confdefs.h <<\EOF
3315 #define HAVE_STRLCAT 1
3316 EOF
3317
3318 fi
3319
3320 fi
3321
3322 for ac_func in strlcpy snprintf
3323 do
3324 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3325 echo "$as_me:3325: checking for $ac_func" >&5
3326 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3327 if eval "test \"\${$as_ac_var+set}\" = set"; then
3328   echo $ECHO_N "(cached) $ECHO_C" >&6
3329 else
3330   cat >conftest.$ac_ext <<_ACEOF
3331 #line 3331 "configure"
3332 #include "confdefs.h"
3333 #define $ac_func autoconf_temporary
3334 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3335 #undef $ac_func
3336
3337 #ifdef __cplusplus
3338 extern "C"
3339 #endif
3340
3341 /* We use char because int might match the return type of a gcc2
3342    builtin and then its argument prototype would still apply.  */
3343 char $ac_func (void);
3344
3345 int
3346 main (void)
3347 {
3348
3349 /* The GNU C library defines stubs for functions which it implements
3350     to always fail with ENOSYS.  Some functions are actually named
3351     something starting with __ and the normal name is an alias.  */
3352 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3353 #error found stub for $ac_func
3354 #endif
3355
3356         return $ac_func ();
3357   ;
3358   return 0;
3359 }
3360 _ACEOF
3361 rm -f conftest.$ac_objext conftest$ac_exeext
3362 if { (eval echo "$as_me:3362: \"$ac_link\"") >&5
3363   (eval $ac_link) 2>&5
3364   ac_status=$?
3365   echo "$as_me:3365: \$? = $ac_status" >&5
3366   (exit $ac_status); } &&
3367          { ac_try='test -s conftest$ac_exeext'
3368   { (eval echo "$as_me:3368: \"$ac_try\"") >&5
3369   (eval $ac_try) 2>&5
3370   ac_status=$?
3371   echo "$as_me:3371: \$? = $ac_status" >&5
3372   (exit $ac_status); }; }; then
3373   eval "$as_ac_var=yes"
3374 else
3375   echo "$as_me: failed program was:" >&5
3376 cat conftest.$ac_ext >&5
3377 eval "$as_ac_var=no"
3378 fi
3379 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3380 fi
3381 echo "$as_me:3381: result: `eval echo '${'$as_ac_var'}'`" >&5
3382 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3383 if test `eval echo '${'$as_ac_var'}'` = yes; then
3384   cat >>confdefs.h <<EOF
3385 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3386 EOF
3387
3388 fi
3389 done
3390
3391 fi
3392
3393 echo "$as_me:3393: checking if the POSIX test-macros are already defined" >&5
3394 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3395 if test "${cf_cv_posix_visible+set}" = set; then
3396   echo $ECHO_N "(cached) $ECHO_C" >&6
3397 else
3398
3399 cat >conftest.$ac_ext <<_ACEOF
3400 #line 3400 "configure"
3401 #include "confdefs.h"
3402 #include <stdio.h>
3403 int
3404 main (void)
3405 {
3406
3407 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3408         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3409         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3410         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3411 #error conflicting symbols found
3412 #endif
3413
3414   ;
3415   return 0;
3416 }
3417 _ACEOF
3418 rm -f conftest.$ac_objext
3419 if { (eval echo "$as_me:3419: \"$ac_compile\"") >&5
3420   (eval $ac_compile) 2>&5
3421   ac_status=$?
3422   echo "$as_me:3422: \$? = $ac_status" >&5
3423   (exit $ac_status); } &&
3424          { ac_try='test -s conftest.$ac_objext'
3425   { (eval echo "$as_me:3425: \"$ac_try\"") >&5
3426   (eval $ac_try) 2>&5
3427   ac_status=$?
3428   echo "$as_me:3428: \$? = $ac_status" >&5
3429   (exit $ac_status); }; }; then
3430   cf_cv_posix_visible=no
3431 else
3432   echo "$as_me: failed program was:" >&5
3433 cat conftest.$ac_ext >&5
3434 cf_cv_posix_visible=yes
3435 fi
3436 rm -f conftest.$ac_objext conftest.$ac_ext
3437
3438 fi
3439 echo "$as_me:3439: result: $cf_cv_posix_visible" >&5
3440 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3441
3442 if test "$cf_cv_posix_visible" = no; then
3443
3444 cf_XOPEN_SOURCE=600
3445 cf_POSIX_C_SOURCE=199506L
3446 cf_xopen_source=
3447
3448 case $host_os in
3449 (aix[4-7]*)
3450         cf_xopen_source="-D_ALL_SOURCE"
3451         ;;
3452 (msys)
3453         cf_XOPEN_SOURCE=600
3454         ;;
3455 (darwin[0-8].*)
3456         cf_xopen_source="-D_APPLE_C_SOURCE"
3457         ;;
3458 (darwin*)
3459         cf_xopen_source="-D_DARWIN_C_SOURCE"
3460         cf_XOPEN_SOURCE=
3461         ;;
3462 (freebsd*|dragonfly*|midnightbsd*)
3463         # 5.x headers associate
3464         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3465         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3466         cf_POSIX_C_SOURCE=200112L
3467         cf_XOPEN_SOURCE=600
3468         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3469         ;;
3470 (hpux11*)
3471         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3472         ;;
3473 (hpux*)
3474         cf_xopen_source="-D_HPUX_SOURCE"
3475         ;;
3476 (irix[56].*)
3477         cf_xopen_source="-D_SGI_SOURCE"
3478         cf_XOPEN_SOURCE=
3479         ;;
3480 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3481
3482 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3483
3484 echo "$as_me:3484: checking if this is the GNU C library" >&5
3485 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3486 if test "${cf_cv_gnu_library+set}" = set; then
3487   echo $ECHO_N "(cached) $ECHO_C" >&6
3488 else
3489
3490 cat >conftest.$ac_ext <<_ACEOF
3491 #line 3491 "configure"
3492 #include "confdefs.h"
3493 #include <sys/types.h>
3494 int
3495 main (void)
3496 {
3497
3498         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3499                 return 0;
3500         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3501                 return 0;
3502         #else
3503         #       error not GNU C library
3504         #endif
3505   ;
3506   return 0;
3507 }
3508 _ACEOF
3509 rm -f conftest.$ac_objext
3510 if { (eval echo "$as_me:3510: \"$ac_compile\"") >&5
3511   (eval $ac_compile) 2>&5
3512   ac_status=$?
3513   echo "$as_me:3513: \$? = $ac_status" >&5
3514   (exit $ac_status); } &&
3515          { ac_try='test -s conftest.$ac_objext'
3516   { (eval echo "$as_me:3516: \"$ac_try\"") >&5
3517   (eval $ac_try) 2>&5
3518   ac_status=$?
3519   echo "$as_me:3519: \$? = $ac_status" >&5
3520   (exit $ac_status); }; }; then
3521   cf_cv_gnu_library=yes
3522 else
3523   echo "$as_me: failed program was:" >&5
3524 cat conftest.$ac_ext >&5
3525 cf_cv_gnu_library=no
3526 fi
3527 rm -f conftest.$ac_objext conftest.$ac_ext
3528
3529 fi
3530 echo "$as_me:3530: result: $cf_cv_gnu_library" >&5
3531 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3532
3533 if test x$cf_cv_gnu_library = xyes; then
3534
3535         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3536         # was changed to help a little.  newlib incorporated the change about 4
3537         # years later.
3538         echo "$as_me:3538: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3539 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3540 if test "${cf_cv_gnu_library_219+set}" = set; then
3541   echo $ECHO_N "(cached) $ECHO_C" >&6
3542 else
3543
3544                 cf_save="$CPPFLAGS"
3545
3546         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3547         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3548
3549                 cat >conftest.$ac_ext <<_ACEOF
3550 #line 3550 "configure"
3551 #include "confdefs.h"
3552 #include <sys/types.h>
3553 int
3554 main (void)
3555 {
3556
3557                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3558                                 return 0;
3559                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3560                                 return 0;
3561                         #else
3562                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3563                         #endif
3564   ;
3565   return 0;
3566 }
3567 _ACEOF
3568 rm -f conftest.$ac_objext
3569 if { (eval echo "$as_me:3569: \"$ac_compile\"") >&5
3570   (eval $ac_compile) 2>&5
3571   ac_status=$?
3572   echo "$as_me:3572: \$? = $ac_status" >&5
3573   (exit $ac_status); } &&
3574          { ac_try='test -s conftest.$ac_objext'
3575   { (eval echo "$as_me:3575: \"$ac_try\"") >&5
3576   (eval $ac_try) 2>&5
3577   ac_status=$?
3578   echo "$as_me:3578: \$? = $ac_status" >&5
3579   (exit $ac_status); }; }; then
3580   cf_cv_gnu_library_219=yes
3581 else
3582   echo "$as_me: failed program was:" >&5
3583 cat conftest.$ac_ext >&5
3584 cf_cv_gnu_library_219=no
3585 fi
3586 rm -f conftest.$ac_objext conftest.$ac_ext
3587                 CPPFLAGS="$cf_save"
3588
3589 fi
3590 echo "$as_me:3590: result: $cf_cv_gnu_library_219" >&5
3591 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3592
3593         if test "x$cf_cv_gnu_library_219" = xyes; then
3594                 cf_save="$CPPFLAGS"
3595                 echo "$as_me:3595: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3596 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3597 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3598   echo $ECHO_N "(cached) $ECHO_C" >&6
3599 else
3600
3601 cf_fix_cppflags=no
3602 cf_new_cflags=
3603 cf_new_cppflags=
3604 cf_new_extra_cppflags=
3605
3606 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3607 do
3608 case $cf_fix_cppflags in
3609 (no)
3610         case $cf_add_cflags in
3611         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3612                 case $cf_add_cflags in
3613                 (-D*)
3614                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3615
3616                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3617                                 && test -z "${cf_tst_cflags}" \
3618                                 && cf_fix_cppflags=yes
3619
3620                         if test $cf_fix_cppflags = yes ; then
3621
3622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3624
3625                                 continue
3626                         elif test "${cf_tst_cflags}" = "\"'" ; then
3627
3628         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3629         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3630
3631                                 continue
3632                         fi
3633                         ;;
3634                 esac
3635                 case "$CPPFLAGS" in
3636                 (*$cf_add_cflags)
3637                         ;;
3638                 (*)
3639                         case $cf_add_cflags in
3640                         (-D*)
3641                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3642
3643 CPPFLAGS=`echo "$CPPFLAGS" | \
3644         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3645                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3646
3647                                 ;;
3648                         esac
3649
3650         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3651         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3652
3653                         ;;
3654                 esac
3655                 ;;
3656         (*)
3657
3658         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3659         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3660
3661                 ;;
3662         esac
3663         ;;
3664 (yes)
3665
3666         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3667         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3668
3669         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3670
3671         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3672                 && test -z "${cf_tst_cflags}" \
3673                 && cf_fix_cppflags=no
3674         ;;
3675 esac
3676 done
3677
3678 if test -n "$cf_new_cflags" ; then
3679
3680         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3681         CFLAGS="${CFLAGS}$cf_new_cflags"
3682
3683 fi
3684
3685 if test -n "$cf_new_cppflags" ; then
3686
3687         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3688         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3689
3690 fi
3691
3692 if test -n "$cf_new_extra_cppflags" ; then
3693
3694         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3695         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3696
3697 fi
3698
3699                         cat >conftest.$ac_ext <<_ACEOF
3700 #line 3700 "configure"
3701 #include "confdefs.h"
3702
3703                                 #include <limits.h>
3704                                 #include <sys/types.h>
3705
3706 int
3707 main (void)
3708 {
3709
3710                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3711                                         return 0;
3712                                 #else
3713                                 #       error GNU C library is too old
3714                                 #endif
3715   ;
3716   return 0;
3717 }
3718 _ACEOF
3719 rm -f conftest.$ac_objext
3720 if { (eval echo "$as_me:3720: \"$ac_compile\"") >&5
3721   (eval $ac_compile) 2>&5
3722   ac_status=$?
3723   echo "$as_me:3723: \$? = $ac_status" >&5
3724   (exit $ac_status); } &&
3725          { ac_try='test -s conftest.$ac_objext'
3726   { (eval echo "$as_me:3726: \"$ac_try\"") >&5
3727   (eval $ac_try) 2>&5
3728   ac_status=$?
3729   echo "$as_me:3729: \$? = $ac_status" >&5
3730   (exit $ac_status); }; }; then
3731   cf_cv_gnu_dftsrc_219=yes
3732 else
3733   echo "$as_me: failed program was:" >&5
3734 cat conftest.$ac_ext >&5
3735 cf_cv_gnu_dftsrc_219=no
3736 fi
3737 rm -f conftest.$ac_objext conftest.$ac_ext
3738
3739 fi
3740 echo "$as_me:3740: result: $cf_cv_gnu_dftsrc_219" >&5
3741 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3742                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3743         else
3744                 cf_cv_gnu_dftsrc_219=maybe
3745         fi
3746
3747         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3748
3749                 echo "$as_me:3749: checking if we must define _GNU_SOURCE" >&5
3750 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3751 if test "${cf_cv_gnu_source+set}" = set; then
3752   echo $ECHO_N "(cached) $ECHO_C" >&6
3753 else
3754
3755                 cat >conftest.$ac_ext <<_ACEOF
3756 #line 3756 "configure"
3757 #include "confdefs.h"
3758 #include <sys/types.h>
3759 int
3760 main (void)
3761 {
3762
3763                         #ifndef _XOPEN_SOURCE
3764                         #error  expected _XOPEN_SOURCE to be defined
3765                         #endif
3766   ;
3767   return 0;
3768 }
3769 _ACEOF
3770 rm -f conftest.$ac_objext
3771 if { (eval echo "$as_me:3771: \"$ac_compile\"") >&5
3772   (eval $ac_compile) 2>&5
3773   ac_status=$?
3774   echo "$as_me:3774: \$? = $ac_status" >&5
3775   (exit $ac_status); } &&
3776          { ac_try='test -s conftest.$ac_objext'
3777   { (eval echo "$as_me:3777: \"$ac_try\"") >&5
3778   (eval $ac_try) 2>&5
3779   ac_status=$?
3780   echo "$as_me:3780: \$? = $ac_status" >&5
3781   (exit $ac_status); }; }; then
3782   cf_cv_gnu_source=no
3783 else
3784   echo "$as_me: failed program was:" >&5
3785 cat conftest.$ac_ext >&5
3786 cf_save="$CPPFLAGS"
3787
3788 cf_fix_cppflags=no
3789 cf_new_cflags=
3790 cf_new_cppflags=
3791 cf_new_extra_cppflags=
3792
3793 for cf_add_cflags in -D_GNU_SOURCE
3794 do
3795 case $cf_fix_cppflags in
3796 (no)
3797         case $cf_add_cflags in
3798         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3799                 case $cf_add_cflags in
3800                 (-D*)
3801                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3802
3803                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3804                                 && test -z "${cf_tst_cflags}" \
3805                                 && cf_fix_cppflags=yes
3806
3807                         if test $cf_fix_cppflags = yes ; then
3808
3809         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3810         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3811
3812                                 continue
3813                         elif test "${cf_tst_cflags}" = "\"'" ; then
3814
3815         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3816         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3817
3818                                 continue
3819                         fi
3820                         ;;
3821                 esac
3822                 case "$CPPFLAGS" in
3823                 (*$cf_add_cflags)
3824                         ;;
3825                 (*)
3826                         case $cf_add_cflags in
3827                         (-D*)
3828                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3829
3830 CPPFLAGS=`echo "$CPPFLAGS" | \
3831         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3832                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3833
3834                                 ;;
3835                         esac
3836
3837         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3838         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3839
3840                         ;;
3841                 esac
3842                 ;;
3843         (*)
3844
3845         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3846         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3847
3848                 ;;
3849         esac
3850         ;;
3851 (yes)
3852
3853         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3854         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3855
3856         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3857
3858         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3859                 && test -z "${cf_tst_cflags}" \
3860                 && cf_fix_cppflags=no
3861         ;;
3862 esac
3863 done
3864
3865 if test -n "$cf_new_cflags" ; then
3866
3867         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3868         CFLAGS="${CFLAGS}$cf_new_cflags"
3869
3870 fi
3871
3872 if test -n "$cf_new_cppflags" ; then
3873
3874         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3875         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3876
3877 fi
3878
3879 if test -n "$cf_new_extra_cppflags" ; then
3880
3881         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3882         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3883
3884 fi
3885
3886                          cat >conftest.$ac_ext <<_ACEOF
3887 #line 3887 "configure"
3888 #include "confdefs.h"
3889 #include <sys/types.h>
3890 int
3891 main (void)
3892 {
3893
3894                                 #ifdef _XOPEN_SOURCE
3895                                 #error  expected _XOPEN_SOURCE to be undefined
3896                                 #endif
3897   ;
3898   return 0;
3899 }
3900 _ACEOF
3901 rm -f conftest.$ac_objext
3902 if { (eval echo "$as_me:3902: \"$ac_compile\"") >&5
3903   (eval $ac_compile) 2>&5
3904   ac_status=$?
3905   echo "$as_me:3905: \$? = $ac_status" >&5
3906   (exit $ac_status); } &&
3907          { ac_try='test -s conftest.$ac_objext'
3908   { (eval echo "$as_me:3908: \"$ac_try\"") >&5
3909   (eval $ac_try) 2>&5
3910   ac_status=$?
3911   echo "$as_me:3911: \$? = $ac_status" >&5
3912   (exit $ac_status); }; }; then
3913   cf_cv_gnu_source=no
3914 else
3915   echo "$as_me: failed program was:" >&5
3916 cat conftest.$ac_ext >&5
3917 cf_cv_gnu_source=yes
3918 fi
3919 rm -f conftest.$ac_objext conftest.$ac_ext
3920                         CPPFLAGS="$cf_save"
3921
3922 fi
3923 rm -f conftest.$ac_objext conftest.$ac_ext
3924
3925 fi
3926 echo "$as_me:3926: result: $cf_cv_gnu_source" >&5
3927 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3928
3929                 if test "$cf_cv_gnu_source" = yes
3930                 then
3931                 echo "$as_me:3931: checking if we should also define _DEFAULT_SOURCE" >&5
3932 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3933 if test "${cf_cv_default_source+set}" = set; then
3934   echo $ECHO_N "(cached) $ECHO_C" >&6
3935 else
3936
3937         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3938         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
3939
3940                         cat >conftest.$ac_ext <<_ACEOF
3941 #line 3941 "configure"
3942 #include "confdefs.h"
3943 #include <sys/types.h>
3944 int
3945 main (void)
3946 {
3947
3948                                 #ifdef _DEFAULT_SOURCE
3949                                 #error  expected _DEFAULT_SOURCE to be undefined
3950                                 #endif
3951   ;
3952   return 0;
3953 }
3954 _ACEOF
3955 rm -f conftest.$ac_objext
3956 if { (eval echo "$as_me:3956: \"$ac_compile\"") >&5
3957   (eval $ac_compile) 2>&5
3958   ac_status=$?
3959   echo "$as_me:3959: \$? = $ac_status" >&5
3960   (exit $ac_status); } &&
3961          { ac_try='test -s conftest.$ac_objext'
3962   { (eval echo "$as_me:3962: \"$ac_try\"") >&5
3963   (eval $ac_try) 2>&5
3964   ac_status=$?
3965   echo "$as_me:3965: \$? = $ac_status" >&5
3966   (exit $ac_status); }; }; then
3967   cf_cv_default_source=no
3968 else
3969   echo "$as_me: failed program was:" >&5
3970 cat conftest.$ac_ext >&5
3971 cf_cv_default_source=yes
3972 fi
3973 rm -f conftest.$ac_objext conftest.$ac_ext
3974
3975 fi
3976 echo "$as_me:3976: result: $cf_cv_default_source" >&5
3977 echo "${ECHO_T}$cf_cv_default_source" >&6
3978                         if test "$cf_cv_default_source" = yes
3979                         then
3980
3981         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3982         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3983
3984                         fi
3985                 fi
3986         fi
3987
3988 fi
3989
3990         ;;
3991 (minix*)
3992         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3993         ;;
3994 (mirbsd*)
3995         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3996         cf_XOPEN_SOURCE=
3997
3998 if test "$cf_cv_posix_visible" = no; then
3999
4000 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4001
4002 cf_save_CFLAGS="$CFLAGS"
4003 cf_save_CPPFLAGS="$CPPFLAGS"
4004
4005 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4006         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4007                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4008
4009 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4010         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4011                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4012
4013 echo "$as_me:4013: checking if we should define _POSIX_C_SOURCE" >&5
4014 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4015 if test "${cf_cv_posix_c_source+set}" = set; then
4016   echo $ECHO_N "(cached) $ECHO_C" >&6
4017 else
4018
4019 echo "${as_me:-configure}:4019: testing if the symbol is already defined go no further ..." 1>&5
4020
4021         cat >conftest.$ac_ext <<_ACEOF
4022 #line 4022 "configure"
4023 #include "confdefs.h"
4024 #include <sys/types.h>
4025 int
4026 main (void)
4027 {
4028
4029 #ifndef _POSIX_C_SOURCE
4030 make an error
4031 #endif
4032   ;
4033   return 0;
4034 }
4035 _ACEOF
4036 rm -f conftest.$ac_objext
4037 if { (eval echo "$as_me:4037: \"$ac_compile\"") >&5
4038   (eval $ac_compile) 2>&5
4039   ac_status=$?
4040   echo "$as_me:4040: \$? = $ac_status" >&5
4041   (exit $ac_status); } &&
4042          { ac_try='test -s conftest.$ac_objext'
4043   { (eval echo "$as_me:4043: \"$ac_try\"") >&5
4044   (eval $ac_try) 2>&5
4045   ac_status=$?
4046   echo "$as_me:4046: \$? = $ac_status" >&5
4047   (exit $ac_status); }; }; then
4048   cf_cv_posix_c_source=no
4049 else
4050   echo "$as_me: failed program was:" >&5
4051 cat conftest.$ac_ext >&5
4052 cf_want_posix_source=no
4053          case .$cf_POSIX_C_SOURCE in
4054          (.[12]??*)
4055                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4056                 ;;
4057          (.2)
4058                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4059                 cf_want_posix_source=yes
4060                 ;;
4061          (.*)
4062                 cf_want_posix_source=yes
4063                 ;;
4064          esac
4065          if test "$cf_want_posix_source" = yes ; then
4066                 cat >conftest.$ac_ext <<_ACEOF
4067 #line 4067 "configure"
4068 #include "confdefs.h"
4069 #include <sys/types.h>
4070 int
4071 main (void)
4072 {
4073
4074 #ifdef _POSIX_SOURCE
4075 make an error
4076 #endif
4077   ;
4078   return 0;
4079 }
4080 _ACEOF
4081 rm -f conftest.$ac_objext
4082 if { (eval echo "$as_me:4082: \"$ac_compile\"") >&5
4083   (eval $ac_compile) 2>&5
4084   ac_status=$?
4085   echo "$as_me:4085: \$? = $ac_status" >&5
4086   (exit $ac_status); } &&
4087          { ac_try='test -s conftest.$ac_objext'
4088   { (eval echo "$as_me:4088: \"$ac_try\"") >&5
4089   (eval $ac_try) 2>&5
4090   ac_status=$?
4091   echo "$as_me:4091: \$? = $ac_status" >&5
4092   (exit $ac_status); }; }; then
4093   :
4094 else
4095   echo "$as_me: failed program was:" >&5
4096 cat conftest.$ac_ext >&5
4097 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4098 fi
4099 rm -f conftest.$ac_objext conftest.$ac_ext
4100          fi
4101
4102 echo "${as_me:-configure}:4102: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4103
4104          CFLAGS="$cf_trim_CFLAGS"
4105          CPPFLAGS="$cf_trim_CPPFLAGS"
4106
4107         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4108         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4109
4110 echo "${as_me:-configure}:4110: testing if the second compile does not leave our definition intact error ..." 1>&5
4111
4112          cat >conftest.$ac_ext <<_ACEOF
4113 #line 4113 "configure"
4114 #include "confdefs.h"
4115 #include <sys/types.h>
4116 int
4117 main (void)
4118 {
4119
4120 #ifndef _POSIX_C_SOURCE
4121 make an error
4122 #endif
4123   ;
4124   return 0;
4125 }
4126 _ACEOF
4127 rm -f conftest.$ac_objext
4128 if { (eval echo "$as_me:4128: \"$ac_compile\"") >&5
4129   (eval $ac_compile) 2>&5
4130   ac_status=$?
4131   echo "$as_me:4131: \$? = $ac_status" >&5
4132   (exit $ac_status); } &&
4133          { ac_try='test -s conftest.$ac_objext'
4134   { (eval echo "$as_me:4134: \"$ac_try\"") >&5
4135   (eval $ac_try) 2>&5
4136   ac_status=$?
4137   echo "$as_me:4137: \$? = $ac_status" >&5
4138   (exit $ac_status); }; }; then
4139   :
4140 else
4141   echo "$as_me: failed program was:" >&5
4142 cat conftest.$ac_ext >&5
4143 cf_cv_posix_c_source=no
4144 fi
4145 rm -f conftest.$ac_objext conftest.$ac_ext
4146          CFLAGS="$cf_save_CFLAGS"
4147          CPPFLAGS="$cf_save_CPPFLAGS"
4148
4149 fi
4150 rm -f conftest.$ac_objext conftest.$ac_ext
4151
4152 fi
4153 echo "$as_me:4153: result: $cf_cv_posix_c_source" >&5
4154 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4155
4156 if test "$cf_cv_posix_c_source" != no ; then
4157         CFLAGS="$cf_trim_CFLAGS"
4158         CPPFLAGS="$cf_trim_CPPFLAGS"
4159
4160 cf_fix_cppflags=no
4161 cf_new_cflags=
4162 cf_new_cppflags=
4163 cf_new_extra_cppflags=
4164
4165 for cf_add_cflags in $cf_cv_posix_c_source
4166 do
4167 case $cf_fix_cppflags in
4168 (no)
4169         case $cf_add_cflags in
4170         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4171                 case $cf_add_cflags in
4172                 (-D*)
4173                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4174
4175                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4176                                 && test -z "${cf_tst_cflags}" \
4177                                 && cf_fix_cppflags=yes
4178
4179                         if test $cf_fix_cppflags = yes ; then
4180
4181         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4182         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4183
4184                                 continue
4185                         elif test "${cf_tst_cflags}" = "\"'" ; then
4186
4187         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4188         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4189
4190                                 continue
4191                         fi
4192                         ;;
4193                 esac
4194                 case "$CPPFLAGS" in
4195                 (*$cf_add_cflags)
4196                         ;;
4197                 (*)
4198                         case $cf_add_cflags in
4199                         (-D*)
4200                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4201
4202 CPPFLAGS=`echo "$CPPFLAGS" | \
4203         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4204                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4205
4206                                 ;;
4207                         esac
4208
4209         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4210         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4211
4212                         ;;
4213                 esac
4214                 ;;
4215         (*)
4216
4217         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4218         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4219
4220                 ;;
4221         esac
4222         ;;
4223 (yes)
4224
4225         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4226         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4227
4228         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4229
4230         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4231                 && test -z "${cf_tst_cflags}" \
4232                 && cf_fix_cppflags=no
4233         ;;
4234 esac
4235 done
4236
4237 if test -n "$cf_new_cflags" ; then
4238
4239         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4240         CFLAGS="${CFLAGS}$cf_new_cflags"
4241
4242 fi
4243
4244 if test -n "$cf_new_cppflags" ; then
4245
4246         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4247         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4248
4249 fi
4250
4251 if test -n "$cf_new_extra_cppflags" ; then
4252
4253         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4254         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4255
4256 fi
4257
4258 fi
4259
4260 fi # cf_cv_posix_visible
4261
4262         ;;
4263 (netbsd*)
4264         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4265         ;;
4266 (openbsd[4-9]*)
4267         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4268         cf_xopen_source="-D_BSD_SOURCE"
4269         cf_XOPEN_SOURCE=600
4270         ;;
4271 (openbsd*)
4272         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4273         ;;
4274 (osf[45]*)
4275         cf_xopen_source="-D_OSF_SOURCE"
4276         ;;
4277 (nto-qnx*)
4278         cf_xopen_source="-D_QNX_SOURCE"
4279         ;;
4280 (sco*)
4281         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4282         ;;
4283 (solaris2.*)
4284         cf_xopen_source="-D__EXTENSIONS__"
4285         cf_cv_xopen_source=broken
4286         ;;
4287 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4288         cf_XOPEN_SOURCE=
4289         cf_POSIX_C_SOURCE=
4290         ;;
4291 (*)
4292
4293 echo "$as_me:4293: checking if we should define _XOPEN_SOURCE" >&5
4294 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4295 if test "${cf_cv_xopen_source+set}" = set; then
4296   echo $ECHO_N "(cached) $ECHO_C" >&6
4297 else
4298
4299         cat >conftest.$ac_ext <<_ACEOF
4300 #line 4300 "configure"
4301 #include "confdefs.h"
4302
4303 #include <stdlib.h>
4304 #include <string.h>
4305 #include <sys/types.h>
4306
4307 int
4308 main (void)
4309 {
4310
4311 #ifndef _XOPEN_SOURCE
4312 make an error
4313 #endif
4314   ;
4315   return 0;
4316 }
4317 _ACEOF
4318 rm -f conftest.$ac_objext
4319 if { (eval echo "$as_me:4319: \"$ac_compile\"") >&5
4320   (eval $ac_compile) 2>&5
4321   ac_status=$?
4322   echo "$as_me:4322: \$? = $ac_status" >&5
4323   (exit $ac_status); } &&
4324          { ac_try='test -s conftest.$ac_objext'
4325   { (eval echo "$as_me:4325: \"$ac_try\"") >&5
4326   (eval $ac_try) 2>&5
4327   ac_status=$?
4328   echo "$as_me:4328: \$? = $ac_status" >&5
4329   (exit $ac_status); }; }; then
4330   cf_cv_xopen_source=no
4331 else
4332   echo "$as_me: failed program was:" >&5
4333 cat conftest.$ac_ext >&5
4334 cf_save="$CPPFLAGS"
4335
4336         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4337         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4338
4339          cat >conftest.$ac_ext <<_ACEOF
4340 #line 4340 "configure"
4341 #include "confdefs.h"
4342
4343 #include <stdlib.h>
4344 #include <string.h>
4345 #include <sys/types.h>
4346
4347 int
4348 main (void)
4349 {
4350
4351 #ifdef _XOPEN_SOURCE
4352 make an error
4353 #endif
4354   ;
4355   return 0;
4356 }
4357 _ACEOF
4358 rm -f conftest.$ac_objext
4359 if { (eval echo "$as_me:4359: \"$ac_compile\"") >&5
4360   (eval $ac_compile) 2>&5
4361   ac_status=$?
4362   echo "$as_me:4362: \$? = $ac_status" >&5
4363   (exit $ac_status); } &&
4364          { ac_try='test -s conftest.$ac_objext'
4365   { (eval echo "$as_me:4365: \"$ac_try\"") >&5
4366   (eval $ac_try) 2>&5
4367   ac_status=$?
4368   echo "$as_me:4368: \$? = $ac_status" >&5
4369   (exit $ac_status); }; }; then
4370   cf_cv_xopen_source=no
4371 else
4372   echo "$as_me: failed program was:" >&5
4373 cat conftest.$ac_ext >&5
4374 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4375 fi
4376 rm -f conftest.$ac_objext conftest.$ac_ext
4377         CPPFLAGS="$cf_save"
4378
4379 fi
4380 rm -f conftest.$ac_objext conftest.$ac_ext
4381
4382 fi
4383 echo "$as_me:4383: result: $cf_cv_xopen_source" >&5
4384 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4385
4386 if test "$cf_cv_xopen_source" != no ; then
4387
4388 CFLAGS=`echo "$CFLAGS" | \
4389         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4390                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4391
4392 CPPFLAGS=`echo "$CPPFLAGS" | \
4393         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4394                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4395
4396         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4397
4398 cf_fix_cppflags=no
4399 cf_new_cflags=
4400 cf_new_cppflags=
4401 cf_new_extra_cppflags=
4402
4403 for cf_add_cflags in $cf_temp_xopen_source
4404 do
4405 case $cf_fix_cppflags in
4406 (no)
4407         case $cf_add_cflags in
4408         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4409                 case $cf_add_cflags in
4410                 (-D*)
4411                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4412
4413                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4414                                 && test -z "${cf_tst_cflags}" \
4415                                 && cf_fix_cppflags=yes
4416
4417                         if test $cf_fix_cppflags = yes ; then
4418
4419         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4420         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4421
4422                                 continue
4423                         elif test "${cf_tst_cflags}" = "\"'" ; then
4424
4425         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4426         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4427
4428                                 continue
4429                         fi
4430                         ;;
4431                 esac
4432                 case "$CPPFLAGS" in
4433                 (*$cf_add_cflags)
4434                         ;;
4435                 (*)
4436                         case $cf_add_cflags in
4437                         (-D*)
4438                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4439
4440 CPPFLAGS=`echo "$CPPFLAGS" | \
4441         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4442                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4443
4444                                 ;;
4445                         esac
4446
4447         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4448         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4449
4450                         ;;
4451                 esac
4452                 ;;
4453         (*)
4454
4455         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4456         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4457
4458                 ;;
4459         esac
4460         ;;
4461 (yes)
4462
4463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4465
4466         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4467
4468         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4469                 && test -z "${cf_tst_cflags}" \
4470                 && cf_fix_cppflags=no
4471         ;;
4472 esac
4473 done
4474
4475 if test -n "$cf_new_cflags" ; then
4476
4477         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4478         CFLAGS="${CFLAGS}$cf_new_cflags"
4479
4480 fi
4481
4482 if test -n "$cf_new_cppflags" ; then
4483
4484         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4485         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4486
4487 fi
4488
4489 if test -n "$cf_new_extra_cppflags" ; then
4490
4491         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4492         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4493
4494 fi
4495
4496 fi
4497
4498 if test "$cf_cv_posix_visible" = no; then
4499
4500 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4501
4502 cf_save_CFLAGS="$CFLAGS"
4503 cf_save_CPPFLAGS="$CPPFLAGS"
4504
4505 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4506         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4507                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4508
4509 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4510         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4511                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4512
4513 echo "$as_me:4513: checking if we should define _POSIX_C_SOURCE" >&5
4514 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4515 if test "${cf_cv_posix_c_source+set}" = set; then
4516   echo $ECHO_N "(cached) $ECHO_C" >&6
4517 else
4518
4519 echo "${as_me:-configure}:4519: testing if the symbol is already defined go no further ..." 1>&5
4520
4521         cat >conftest.$ac_ext <<_ACEOF
4522 #line 4522 "configure"
4523 #include "confdefs.h"
4524 #include <sys/types.h>
4525 int
4526 main (void)
4527 {
4528
4529 #ifndef _POSIX_C_SOURCE
4530 make an error
4531 #endif
4532   ;
4533   return 0;
4534 }
4535 _ACEOF
4536 rm -f conftest.$ac_objext
4537 if { (eval echo "$as_me:4537: \"$ac_compile\"") >&5
4538   (eval $ac_compile) 2>&5
4539   ac_status=$?
4540   echo "$as_me:4540: \$? = $ac_status" >&5
4541   (exit $ac_status); } &&
4542          { ac_try='test -s conftest.$ac_objext'
4543   { (eval echo "$as_me:4543: \"$ac_try\"") >&5
4544   (eval $ac_try) 2>&5
4545   ac_status=$?
4546   echo "$as_me:4546: \$? = $ac_status" >&5
4547   (exit $ac_status); }; }; then
4548   cf_cv_posix_c_source=no
4549 else
4550   echo "$as_me: failed program was:" >&5
4551 cat conftest.$ac_ext >&5
4552 cf_want_posix_source=no
4553          case .$cf_POSIX_C_SOURCE in
4554          (.[12]??*)
4555                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4556                 ;;
4557          (.2)
4558                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4559                 cf_want_posix_source=yes
4560                 ;;
4561          (.*)
4562                 cf_want_posix_source=yes
4563                 ;;
4564          esac
4565          if test "$cf_want_posix_source" = yes ; then
4566                 cat >conftest.$ac_ext <<_ACEOF
4567 #line 4567 "configure"
4568 #include "confdefs.h"
4569 #include <sys/types.h>
4570 int
4571 main (void)
4572 {
4573
4574 #ifdef _POSIX_SOURCE
4575 make an error
4576 #endif
4577   ;
4578   return 0;
4579 }
4580 _ACEOF
4581 rm -f conftest.$ac_objext
4582 if { (eval echo "$as_me:4582: \"$ac_compile\"") >&5
4583   (eval $ac_compile) 2>&5
4584   ac_status=$?
4585   echo "$as_me:4585: \$? = $ac_status" >&5
4586   (exit $ac_status); } &&
4587          { ac_try='test -s conftest.$ac_objext'
4588   { (eval echo "$as_me:4588: \"$ac_try\"") >&5
4589   (eval $ac_try) 2>&5
4590   ac_status=$?
4591   echo "$as_me:4591: \$? = $ac_status" >&5
4592   (exit $ac_status); }; }; then
4593   :
4594 else
4595   echo "$as_me: failed program was:" >&5
4596 cat conftest.$ac_ext >&5
4597 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4598 fi
4599 rm -f conftest.$ac_objext conftest.$ac_ext
4600          fi
4601
4602 echo "${as_me:-configure}:4602: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4603
4604          CFLAGS="$cf_trim_CFLAGS"
4605          CPPFLAGS="$cf_trim_CPPFLAGS"
4606
4607         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4608         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4609
4610 echo "${as_me:-configure}:4610: testing if the second compile does not leave our definition intact error ..." 1>&5
4611
4612          cat >conftest.$ac_ext <<_ACEOF
4613 #line 4613 "configure"
4614 #include "confdefs.h"
4615 #include <sys/types.h>
4616 int
4617 main (void)
4618 {
4619
4620 #ifndef _POSIX_C_SOURCE
4621 make an error
4622 #endif
4623   ;
4624   return 0;
4625 }
4626 _ACEOF
4627 rm -f conftest.$ac_objext
4628 if { (eval echo "$as_me:4628: \"$ac_compile\"") >&5
4629   (eval $ac_compile) 2>&5
4630   ac_status=$?
4631   echo "$as_me:4631: \$? = $ac_status" >&5
4632   (exit $ac_status); } &&
4633          { ac_try='test -s conftest.$ac_objext'
4634   { (eval echo "$as_me:4634: \"$ac_try\"") >&5
4635   (eval $ac_try) 2>&5
4636   ac_status=$?
4637   echo "$as_me:4637: \$? = $ac_status" >&5
4638   (exit $ac_status); }; }; then
4639   :
4640 else
4641   echo "$as_me: failed program was:" >&5
4642 cat conftest.$ac_ext >&5
4643 cf_cv_posix_c_source=no
4644 fi
4645 rm -f conftest.$ac_objext conftest.$ac_ext
4646          CFLAGS="$cf_save_CFLAGS"
4647          CPPFLAGS="$cf_save_CPPFLAGS"
4648
4649 fi
4650 rm -f conftest.$ac_objext conftest.$ac_ext
4651
4652 fi
4653 echo "$as_me:4653: result: $cf_cv_posix_c_source" >&5
4654 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4655
4656 if test "$cf_cv_posix_c_source" != no ; then
4657         CFLAGS="$cf_trim_CFLAGS"
4658         CPPFLAGS="$cf_trim_CPPFLAGS"
4659
4660 cf_fix_cppflags=no
4661 cf_new_cflags=
4662 cf_new_cppflags=
4663 cf_new_extra_cppflags=
4664
4665 for cf_add_cflags in $cf_cv_posix_c_source
4666 do
4667 case $cf_fix_cppflags in
4668 (no)
4669         case $cf_add_cflags in
4670         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4671                 case $cf_add_cflags in
4672                 (-D*)
4673                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4674
4675                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4676                                 && test -z "${cf_tst_cflags}" \
4677                                 && cf_fix_cppflags=yes
4678
4679                         if test $cf_fix_cppflags = yes ; then
4680
4681         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4682         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4683
4684                                 continue
4685                         elif test "${cf_tst_cflags}" = "\"'" ; then
4686
4687         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4688         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4689
4690                                 continue
4691                         fi
4692                         ;;
4693                 esac
4694                 case "$CPPFLAGS" in
4695                 (*$cf_add_cflags)
4696                         ;;
4697                 (*)
4698                         case $cf_add_cflags in
4699                         (-D*)
4700                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4701
4702 CPPFLAGS=`echo "$CPPFLAGS" | \
4703         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4704                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4705
4706                                 ;;
4707                         esac
4708
4709         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4710         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4711
4712                         ;;
4713                 esac
4714                 ;;
4715         (*)
4716
4717         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4718         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4719
4720                 ;;
4721         esac
4722         ;;
4723 (yes)
4724
4725         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4726         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4727
4728         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4729
4730         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4731                 && test -z "${cf_tst_cflags}" \
4732                 && cf_fix_cppflags=no
4733         ;;
4734 esac
4735 done
4736
4737 if test -n "$cf_new_cflags" ; then
4738
4739         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4740         CFLAGS="${CFLAGS}$cf_new_cflags"
4741
4742 fi
4743
4744 if test -n "$cf_new_cppflags" ; then
4745
4746         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4747         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4748
4749 fi
4750
4751 if test -n "$cf_new_extra_cppflags" ; then
4752
4753         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4754         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4755
4756 fi
4757
4758 fi
4759
4760 fi # cf_cv_posix_visible
4761
4762         ;;
4763 esac
4764
4765 if test -n "$cf_xopen_source" ; then
4766
4767 cf_fix_cppflags=no
4768 cf_new_cflags=
4769 cf_new_cppflags=
4770 cf_new_extra_cppflags=
4771
4772 for cf_add_cflags in $cf_xopen_source
4773 do
4774 case $cf_fix_cppflags in
4775 (no)
4776         case $cf_add_cflags in
4777         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4778                 case $cf_add_cflags in
4779                 (-D*)
4780                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4781
4782                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4783                                 && test -z "${cf_tst_cflags}" \
4784                                 && cf_fix_cppflags=yes
4785
4786                         if test $cf_fix_cppflags = yes ; then
4787
4788         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4789         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4790
4791                                 continue
4792                         elif test "${cf_tst_cflags}" = "\"'" ; then
4793
4794         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4795         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4796
4797                                 continue
4798                         fi
4799                         ;;
4800                 esac
4801                 case "$CPPFLAGS" in
4802                 (*$cf_add_cflags)
4803                         ;;
4804                 (*)
4805                         case $cf_add_cflags in
4806                         (-D*)
4807                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4808
4809 CPPFLAGS=`echo "$CPPFLAGS" | \
4810         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4811                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4812
4813                                 ;;
4814                         esac
4815
4816         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4817         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4818
4819                         ;;
4820                 esac
4821                 ;;
4822         (*)
4823
4824         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4825         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4826
4827                 ;;
4828         esac
4829         ;;
4830 (yes)
4831
4832         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4833         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4834
4835         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4836
4837         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4838                 && test -z "${cf_tst_cflags}" \
4839                 && cf_fix_cppflags=no
4840         ;;
4841 esac
4842 done
4843
4844 if test -n "$cf_new_cflags" ; then
4845         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4846
4847 echo "${as_me:-configure}:4847: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4848
4849         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4850         CFLAGS="${CFLAGS}$cf_new_cflags"
4851
4852 fi
4853
4854 if test -n "$cf_new_cppflags" ; then
4855         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4856
4857 echo "${as_me:-configure}:4857: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4858
4859         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4860         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4861
4862 fi
4863
4864 if test -n "$cf_new_extra_cppflags" ; then
4865         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4866
4867 echo "${as_me:-configure}:4867: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4868
4869         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4870         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4871
4872 fi
4873
4874 fi
4875
4876 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4877         echo "$as_me:4877: checking if _XOPEN_SOURCE really is set" >&5
4878 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4879         cat >conftest.$ac_ext <<_ACEOF
4880 #line 4880 "configure"
4881 #include "confdefs.h"
4882 #include <stdlib.h>
4883 int
4884 main (void)
4885 {
4886
4887 #ifndef _XOPEN_SOURCE
4888 make an error
4889 #endif
4890   ;
4891   return 0;
4892 }
4893 _ACEOF
4894 rm -f conftest.$ac_objext
4895 if { (eval echo "$as_me:4895: \"$ac_compile\"") >&5
4896   (eval $ac_compile) 2>&5
4897   ac_status=$?
4898   echo "$as_me:4898: \$? = $ac_status" >&5
4899   (exit $ac_status); } &&
4900          { ac_try='test -s conftest.$ac_objext'
4901   { (eval echo "$as_me:4901: \"$ac_try\"") >&5
4902   (eval $ac_try) 2>&5
4903   ac_status=$?
4904   echo "$as_me:4904: \$? = $ac_status" >&5
4905   (exit $ac_status); }; }; then
4906   cf_XOPEN_SOURCE_set=yes
4907 else
4908   echo "$as_me: failed program was:" >&5
4909 cat conftest.$ac_ext >&5
4910 cf_XOPEN_SOURCE_set=no
4911 fi
4912 rm -f conftest.$ac_objext conftest.$ac_ext
4913         echo "$as_me:4913: result: $cf_XOPEN_SOURCE_set" >&5
4914 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4915         if test $cf_XOPEN_SOURCE_set = yes
4916         then
4917                 cat >conftest.$ac_ext <<_ACEOF
4918 #line 4918 "configure"
4919 #include "confdefs.h"
4920 #include <stdlib.h>
4921 int
4922 main (void)
4923 {
4924
4925 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4926 make an error
4927 #endif
4928   ;
4929   return 0;
4930 }
4931 _ACEOF
4932 rm -f conftest.$ac_objext
4933 if { (eval echo "$as_me:4933: \"$ac_compile\"") >&5
4934   (eval $ac_compile) 2>&5
4935   ac_status=$?
4936   echo "$as_me:4936: \$? = $ac_status" >&5
4937   (exit $ac_status); } &&
4938          { ac_try='test -s conftest.$ac_objext'
4939   { (eval echo "$as_me:4939: \"$ac_try\"") >&5
4940   (eval $ac_try) 2>&5
4941   ac_status=$?
4942   echo "$as_me:4942: \$? = $ac_status" >&5
4943   (exit $ac_status); }; }; then
4944   cf_XOPEN_SOURCE_set_ok=yes
4945 else
4946   echo "$as_me: failed program was:" >&5
4947 cat conftest.$ac_ext >&5
4948 cf_XOPEN_SOURCE_set_ok=no
4949 fi
4950 rm -f conftest.$ac_objext conftest.$ac_ext
4951                 if test $cf_XOPEN_SOURCE_set_ok = no
4952                 then
4953                         { echo "$as_me:4953: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4954 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4955                 fi
4956         else
4957
4958 echo "$as_me:4958: checking if we should define _XOPEN_SOURCE" >&5
4959 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4960 if test "${cf_cv_xopen_source+set}" = set; then
4961   echo $ECHO_N "(cached) $ECHO_C" >&6
4962 else
4963
4964         cat >conftest.$ac_ext <<_ACEOF
4965 #line 4965 "configure"
4966 #include "confdefs.h"
4967
4968 #include <stdlib.h>
4969 #include <string.h>
4970 #include <sys/types.h>
4971
4972 int
4973 main (void)
4974 {
4975
4976 #ifndef _XOPEN_SOURCE
4977 make an error
4978 #endif
4979   ;
4980   return 0;
4981 }
4982 _ACEOF
4983 rm -f conftest.$ac_objext
4984 if { (eval echo "$as_me:4984: \"$ac_compile\"") >&5
4985   (eval $ac_compile) 2>&5
4986   ac_status=$?
4987   echo "$as_me:4987: \$? = $ac_status" >&5
4988   (exit $ac_status); } &&
4989          { ac_try='test -s conftest.$ac_objext'
4990   { (eval echo "$as_me:4990: \"$ac_try\"") >&5
4991   (eval $ac_try) 2>&5
4992   ac_status=$?
4993   echo "$as_me:4993: \$? = $ac_status" >&5
4994   (exit $ac_status); }; }; then
4995   cf_cv_xopen_source=no
4996 else
4997   echo "$as_me: failed program was:" >&5
4998 cat conftest.$ac_ext >&5
4999 cf_save="$CPPFLAGS"
5000
5001         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5002         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5003
5004          cat >conftest.$ac_ext <<_ACEOF
5005 #line 5005 "configure"
5006 #include "confdefs.h"
5007
5008 #include <stdlib.h>
5009 #include <string.h>
5010 #include <sys/types.h>
5011
5012 int
5013 main (void)
5014 {
5015
5016 #ifdef _XOPEN_SOURCE
5017 make an error
5018 #endif
5019   ;
5020   return 0;
5021 }
5022 _ACEOF
5023 rm -f conftest.$ac_objext
5024 if { (eval echo "$as_me:5024: \"$ac_compile\"") >&5
5025   (eval $ac_compile) 2>&5
5026   ac_status=$?
5027   echo "$as_me:5027: \$? = $ac_status" >&5
5028   (exit $ac_status); } &&
5029          { ac_try='test -s conftest.$ac_objext'
5030   { (eval echo "$as_me:5030: \"$ac_try\"") >&5
5031   (eval $ac_try) 2>&5
5032   ac_status=$?
5033   echo "$as_me:5033: \$? = $ac_status" >&5
5034   (exit $ac_status); }; }; then
5035   cf_cv_xopen_source=no
5036 else
5037   echo "$as_me: failed program was:" >&5
5038 cat conftest.$ac_ext >&5
5039 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5040 fi
5041 rm -f conftest.$ac_objext conftest.$ac_ext
5042         CPPFLAGS="$cf_save"
5043
5044 fi
5045 rm -f conftest.$ac_objext conftest.$ac_ext
5046
5047 fi
5048 echo "$as_me:5048: result: $cf_cv_xopen_source" >&5
5049 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5050
5051 if test "$cf_cv_xopen_source" != no ; then
5052
5053 CFLAGS=`echo "$CFLAGS" | \
5054         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5055                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5056
5057 CPPFLAGS=`echo "$CPPFLAGS" | \
5058         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5059                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5060
5061         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5062
5063 cf_fix_cppflags=no
5064 cf_new_cflags=
5065 cf_new_cppflags=
5066 cf_new_extra_cppflags=
5067
5068 for cf_add_cflags in $cf_temp_xopen_source
5069 do
5070 case $cf_fix_cppflags in
5071 (no)
5072         case $cf_add_cflags in
5073         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5074                 case $cf_add_cflags in
5075                 (-D*)
5076                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5077
5078                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5079                                 && test -z "${cf_tst_cflags}" \
5080                                 && cf_fix_cppflags=yes
5081
5082                         if test $cf_fix_cppflags = yes ; then
5083
5084         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5085         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5086
5087                                 continue
5088                         elif test "${cf_tst_cflags}" = "\"'" ; then
5089
5090         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5091         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5092
5093                                 continue
5094                         fi
5095                         ;;
5096                 esac
5097                 case "$CPPFLAGS" in
5098                 (*$cf_add_cflags)
5099                         ;;
5100                 (*)
5101                         case $cf_add_cflags in
5102                         (-D*)
5103                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5104
5105 CPPFLAGS=`echo "$CPPFLAGS" | \
5106         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5107                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5108
5109                                 ;;
5110                         esac
5111
5112         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5113         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5114
5115                         ;;
5116                 esac
5117                 ;;
5118         (*)
5119
5120         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5121         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5122
5123                 ;;
5124         esac
5125         ;;
5126 (yes)
5127
5128         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5129         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5130
5131         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5132
5133         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5134                 && test -z "${cf_tst_cflags}" \
5135                 && cf_fix_cppflags=no
5136         ;;
5137 esac
5138 done
5139
5140 if test -n "$cf_new_cflags" ; then
5141
5142         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5143         CFLAGS="${CFLAGS}$cf_new_cflags"
5144
5145 fi
5146
5147 if test -n "$cf_new_cppflags" ; then
5148
5149         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5150         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5151
5152 fi
5153
5154 if test -n "$cf_new_extra_cppflags" ; then
5155
5156         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5157         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5158
5159 fi
5160
5161 fi
5162
5163         fi
5164 fi
5165 fi # cf_cv_posix_visible
5166
5167 echo "$as_me:5167: checking for signal global datatype" >&5
5168 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5169 if test "${cf_cv_sig_atomic_t+set}" = set; then
5170   echo $ECHO_N "(cached) $ECHO_C" >&6
5171 else
5172
5173         for cf_type in \
5174                 "volatile sig_atomic_t" \
5175                 "sig_atomic_t" \
5176                 "int"
5177         do
5178         cat >conftest.$ac_ext <<_ACEOF
5179 #line 5179 "configure"
5180 #include "confdefs.h"
5181
5182 #include <sys/types.h>
5183 #include <signal.h>
5184 #include <stdio.h>
5185
5186 extern $cf_type x;
5187 $cf_type x;
5188 static void handler(int sig)
5189 {
5190         x = 5;
5191 }
5192 int
5193 main (void)
5194 {
5195 signal(SIGINT, handler);
5196                  x = 1
5197   ;
5198   return 0;
5199 }
5200 _ACEOF
5201 rm -f conftest.$ac_objext
5202 if { (eval echo "$as_me:5202: \"$ac_compile\"") >&5
5203   (eval $ac_compile) 2>&5
5204   ac_status=$?
5205   echo "$as_me:5205: \$? = $ac_status" >&5
5206   (exit $ac_status); } &&
5207          { ac_try='test -s conftest.$ac_objext'
5208   { (eval echo "$as_me:5208: \"$ac_try\"") >&5
5209   (eval $ac_try) 2>&5
5210   ac_status=$?
5211   echo "$as_me:5211: \$? = $ac_status" >&5
5212   (exit $ac_status); }; }; then
5213   cf_cv_sig_atomic_t=$cf_type
5214 else
5215   echo "$as_me: failed program was:" >&5
5216 cat conftest.$ac_ext >&5
5217 cf_cv_sig_atomic_t=no
5218 fi
5219 rm -f conftest.$ac_objext conftest.$ac_ext
5220                 test "$cf_cv_sig_atomic_t" != no && break
5221         done
5222
5223 fi
5224
5225 echo "$as_me:5225: result: $cf_cv_sig_atomic_t" >&5
5226 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5227 test "$cf_cv_sig_atomic_t" != no &&
5228 cat >>confdefs.h <<EOF
5229 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5230 EOF
5231
5232 # Work around breakage on OS X
5233
5234 echo "$as_me:5234: checking if SIGWINCH is defined" >&5
5235 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5236 if test "${cf_cv_define_sigwinch+set}" = set; then
5237   echo $ECHO_N "(cached) $ECHO_C" >&6
5238 else
5239
5240         cat >conftest.$ac_ext <<_ACEOF
5241 #line 5241 "configure"
5242 #include "confdefs.h"
5243
5244 #include <sys/types.h>
5245 #include <sys/signal.h>
5246
5247 int
5248 main (void)
5249 {
5250 int x = SIGWINCH
5251   ;
5252   return 0;
5253 }
5254 _ACEOF
5255 rm -f conftest.$ac_objext
5256 if { (eval echo "$as_me:5256: \"$ac_compile\"") >&5
5257   (eval $ac_compile) 2>&5
5258   ac_status=$?
5259   echo "$as_me:5259: \$? = $ac_status" >&5
5260   (exit $ac_status); } &&
5261          { ac_try='test -s conftest.$ac_objext'
5262   { (eval echo "$as_me:5262: \"$ac_try\"") >&5
5263   (eval $ac_try) 2>&5
5264   ac_status=$?
5265   echo "$as_me:5265: \$? = $ac_status" >&5
5266   (exit $ac_status); }; }; then
5267   cf_cv_define_sigwinch=yes
5268 else
5269   echo "$as_me: failed program was:" >&5
5270 cat conftest.$ac_ext >&5
5271 cat >conftest.$ac_ext <<_ACEOF
5272 #line 5272 "configure"
5273 #include "confdefs.h"
5274
5275 #undef _XOPEN_SOURCE
5276 #undef _POSIX_SOURCE
5277 #undef _POSIX_C_SOURCE
5278 #include <sys/types.h>
5279 #include <sys/signal.h>
5280
5281 int
5282 main (void)
5283 {
5284 int x = SIGWINCH
5285   ;
5286   return 0;
5287 }
5288 _ACEOF
5289 rm -f conftest.$ac_objext
5290 if { (eval echo "$as_me:5290: \"$ac_compile\"") >&5
5291   (eval $ac_compile) 2>&5
5292   ac_status=$?
5293   echo "$as_me:5293: \$? = $ac_status" >&5
5294   (exit $ac_status); } &&
5295          { ac_try='test -s conftest.$ac_objext'
5296   { (eval echo "$as_me:5296: \"$ac_try\"") >&5
5297   (eval $ac_try) 2>&5
5298   ac_status=$?
5299   echo "$as_me:5299: \$? = $ac_status" >&5
5300   (exit $ac_status); }; }; then
5301   cf_cv_define_sigwinch=maybe
5302 else
5303   echo "$as_me: failed program was:" >&5
5304 cat conftest.$ac_ext >&5
5305 cf_cv_define_sigwinch=no
5306 fi
5307 rm -f conftest.$ac_objext conftest.$ac_ext
5308
5309 fi
5310 rm -f conftest.$ac_objext conftest.$ac_ext
5311
5312 fi
5313 echo "$as_me:5313: result: $cf_cv_define_sigwinch" >&5
5314 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5315
5316 if test "$cf_cv_define_sigwinch" = maybe ; then
5317 echo "$as_me:5317: checking for actual SIGWINCH definition" >&5
5318 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5319 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5320   echo $ECHO_N "(cached) $ECHO_C" >&6
5321 else
5322
5323 cf_cv_fixup_sigwinch=unknown
5324 cf_sigwinch=32
5325 while test $cf_sigwinch != 1
5326 do
5327         cat >conftest.$ac_ext <<_ACEOF
5328 #line 5328 "configure"
5329 #include "confdefs.h"
5330
5331 #undef _XOPEN_SOURCE
5332 #undef _POSIX_SOURCE
5333 #undef _POSIX_C_SOURCE
5334 #include <sys/types.h>
5335 #include <sys/signal.h>
5336
5337 int
5338 main (void)
5339 {
5340
5341 #if SIGWINCH != $cf_sigwinch
5342 make an error
5343 #endif
5344 int x = SIGWINCH
5345   ;
5346   return 0;
5347 }
5348 _ACEOF
5349 rm -f conftest.$ac_objext
5350 if { (eval echo "$as_me:5350: \"$ac_compile\"") >&5
5351   (eval $ac_compile) 2>&5
5352   ac_status=$?
5353   echo "$as_me:5353: \$? = $ac_status" >&5
5354   (exit $ac_status); } &&
5355          { ac_try='test -s conftest.$ac_objext'
5356   { (eval echo "$as_me:5356: \"$ac_try\"") >&5
5357   (eval $ac_try) 2>&5
5358   ac_status=$?
5359   echo "$as_me:5359: \$? = $ac_status" >&5
5360   (exit $ac_status); }; }; then
5361   cf_cv_fixup_sigwinch=$cf_sigwinch
5362          break
5363 else
5364   echo "$as_me: failed program was:" >&5
5365 cat conftest.$ac_ext >&5
5366 fi
5367 rm -f conftest.$ac_objext conftest.$ac_ext
5368
5369 cf_sigwinch=`expr $cf_sigwinch - 1`
5370 done
5371
5372 fi
5373 echo "$as_me:5373: result: $cf_cv_fixup_sigwinch" >&5
5374 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5375
5376         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5377                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5378         fi
5379 fi
5380
5381 # Checks for CODESET support.
5382
5383 echo "$as_me:5383: checking for nl_langinfo and CODESET" >&5
5384 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5385 if test "${am_cv_langinfo_codeset+set}" = set; then
5386   echo $ECHO_N "(cached) $ECHO_C" >&6
5387 else
5388   cat >conftest.$ac_ext <<_ACEOF
5389 #line 5389 "configure"
5390 #include "confdefs.h"
5391 #include <langinfo.h>
5392 int
5393 main (void)
5394 {
5395 char* cs = nl_langinfo(CODESET);
5396   ;
5397   return 0;
5398 }
5399 _ACEOF
5400 rm -f conftest.$ac_objext conftest$ac_exeext
5401 if { (eval echo "$as_me:5401: \"$ac_link\"") >&5
5402   (eval $ac_link) 2>&5
5403   ac_status=$?
5404   echo "$as_me:5404: \$? = $ac_status" >&5
5405   (exit $ac_status); } &&
5406          { ac_try='test -s conftest$ac_exeext'
5407   { (eval echo "$as_me:5407: \"$ac_try\"") >&5
5408   (eval $ac_try) 2>&5
5409   ac_status=$?
5410   echo "$as_me:5410: \$? = $ac_status" >&5
5411   (exit $ac_status); }; }; then
5412   am_cv_langinfo_codeset=yes
5413 else
5414   echo "$as_me: failed program was:" >&5
5415 cat conftest.$ac_ext >&5
5416 am_cv_langinfo_codeset=no
5417 fi
5418 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5419
5420 fi
5421 echo "$as_me:5421: result: $am_cv_langinfo_codeset" >&5
5422 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5423         if test $am_cv_langinfo_codeset = yes; then
5424
5425 cat >>confdefs.h <<\EOF
5426 #define HAVE_LANGINFO_CODESET 1
5427 EOF
5428
5429         fi
5430
5431 echo "$as_me:5431: checking if you want to use pkg-config" >&5
5432 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5433
5434 # Check whether --with-pkg-config or --without-pkg-config was given.
5435 if test "${with_pkg_config+set}" = set; then
5436   withval="$with_pkg_config"
5437   cf_pkg_config=$withval
5438 else
5439   cf_pkg_config=yes
5440 fi;
5441 echo "$as_me:5441: result: $cf_pkg_config" >&5
5442 echo "${ECHO_T}$cf_pkg_config" >&6
5443
5444 case $cf_pkg_config in
5445 (no)
5446         PKG_CONFIG=none
5447         ;;
5448 (yes)
5449
5450 if test -n "$ac_tool_prefix"; then
5451   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5452 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5453 echo "$as_me:5453: checking for $ac_word" >&5
5454 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5455 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5456   echo $ECHO_N "(cached) $ECHO_C" >&6
5457 else
5458   case $PKG_CONFIG in
5459   [\\/]* | ?:[\\/]*)
5460   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5461   ;;
5462   *)
5463   ac_save_IFS=$IFS; IFS=$ac_path_separator
5464 ac_dummy="$PATH"
5465 for ac_dir in $ac_dummy; do
5466   IFS=$ac_save_IFS
5467   test -z "$ac_dir" && ac_dir=.
5468   if $as_executable_p "$ac_dir/$ac_word"; then
5469    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5470    echo "$as_me:5470: found $ac_dir/$ac_word" >&5
5471    break
5472 fi
5473 done
5474
5475   ;;
5476 esac
5477 fi
5478 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5479
5480 if test -n "$PKG_CONFIG"; then
5481   echo "$as_me:5481: result: $PKG_CONFIG" >&5
5482 echo "${ECHO_T}$PKG_CONFIG" >&6
5483 else
5484   echo "$as_me:5484: result: no" >&5
5485 echo "${ECHO_T}no" >&6
5486 fi
5487
5488 fi
5489 if test -z "$ac_cv_path_PKG_CONFIG"; then
5490   ac_pt_PKG_CONFIG=$PKG_CONFIG
5491   # Extract the first word of "pkg-config", so it can be a program name with args.
5492 set dummy pkg-config; ac_word=$2
5493 echo "$as_me:5493: checking for $ac_word" >&5
5494 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5495 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5496   echo $ECHO_N "(cached) $ECHO_C" >&6
5497 else
5498   case $ac_pt_PKG_CONFIG in
5499   [\\/]* | ?:[\\/]*)
5500   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5501   ;;
5502   *)
5503   ac_save_IFS=$IFS; IFS=$ac_path_separator
5504 ac_dummy="$PATH"
5505 for ac_dir in $ac_dummy; do
5506   IFS=$ac_save_IFS
5507   test -z "$ac_dir" && ac_dir=.
5508   if $as_executable_p "$ac_dir/$ac_word"; then
5509    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5510    echo "$as_me:5510: found $ac_dir/$ac_word" >&5
5511    break
5512 fi
5513 done
5514
5515   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5516   ;;
5517 esac
5518 fi
5519 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5520
5521 if test -n "$ac_pt_PKG_CONFIG"; then
5522   echo "$as_me:5522: result: $ac_pt_PKG_CONFIG" >&5
5523 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5524 else
5525   echo "$as_me:5525: result: no" >&5
5526 echo "${ECHO_T}no" >&6
5527 fi
5528
5529   PKG_CONFIG=$ac_pt_PKG_CONFIG
5530 else
5531   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5532 fi
5533
5534         ;;
5535 (*)
5536         PKG_CONFIG=$withval
5537         ;;
5538 esac
5539
5540 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5541 if test "$PKG_CONFIG" != none ; then
5542
5543 if test "x$prefix" != xNONE; then
5544         cf_path_syntax="$prefix"
5545 else
5546         cf_path_syntax="$ac_default_prefix"
5547 fi
5548
5549 case ".$PKG_CONFIG" in
5550 (.\$\(*\)*|.\'*\'*)
5551         ;;
5552 (..|./*|.\\*)
5553         ;;
5554 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5555         ;;
5556 (.\${*prefix}*|.\${*dir}*)
5557         eval PKG_CONFIG="$PKG_CONFIG"
5558         case ".$PKG_CONFIG" in
5559         (.NONE/*)
5560                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5561                 ;;
5562         esac
5563         ;;
5564 (.no|.NONE/*)
5565         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5566         ;;
5567 (*)
5568         { { echo "$as_me:5568: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5569 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5570    { (exit 1); exit 1; }; }
5571         ;;
5572 esac
5573
5574 elif test "x$cf_pkg_config" != xno ; then
5575         { echo "$as_me:5575: WARNING: pkg-config is not installed" >&5
5576 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5577 fi
5578
5579 echo "$as_me:5579: checking if you want to see long compiling messages" >&5
5580 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5581
5582 # Check whether --enable-echo or --disable-echo was given.
5583 if test "${enable_echo+set}" = set; then
5584   enableval="$enable_echo"
5585   test "$enableval" != no && enableval=yes
5586         if test "$enableval" != "yes" ; then
5587
5588         ECHO_LT='--silent'
5589         ECHO_LD='@echo linking $@;'
5590         RULE_CC='@echo compiling $<'
5591         SHOW_CC='@echo compiling $@'
5592         ECHO_CC='@'
5593
5594         else
5595
5596         ECHO_LT=''
5597         ECHO_LD=''
5598         RULE_CC=''
5599         SHOW_CC=''
5600         ECHO_CC=''
5601
5602         fi
5603 else
5604   enableval=yes
5605
5606         ECHO_LT=''
5607         ECHO_LD=''
5608         RULE_CC=''
5609         SHOW_CC=''
5610         ECHO_CC=''
5611
5612 fi;
5613 echo "$as_me:5613: result: $enableval" >&5
5614 echo "${ECHO_T}$enableval" >&6
5615
5616 echo "$as_me:5616: checking for ncurses wrap-prefix" >&5
5617 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5618
5619 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5620 if test "${with_ncurses_wrap_prefix+set}" = set; then
5621   withval="$with_ncurses_wrap_prefix"
5622   NCURSES_WRAP_PREFIX=$withval
5623 else
5624   NCURSES_WRAP_PREFIX=_nc_
5625 fi;
5626 echo "$as_me:5626: result: $NCURSES_WRAP_PREFIX" >&5
5627 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5628
5629 echo "$as_me:5629: checking if you want to check for wide-character functions" >&5
5630 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5631
5632 # Check whether --enable-widec or --disable-widec was given.
5633 if test "${enable_widec+set}" = set; then
5634   enableval="$enable_widec"
5635   test "$enableval" != no && enableval=yes
5636         if test "$enableval" != "yes" ; then
5637     cf_enable_widec=no
5638         else
5639                 cf_enable_widec=yes
5640         fi
5641 else
5642   enableval=yes
5643         cf_enable_widec=yes
5644
5645 fi;
5646 echo "$as_me:5646: result: $cf_enable_widec" >&5
5647 echo "${ECHO_T}$cf_enable_widec" >&6
5648
5649 echo "$as_me:5649: checking for specific curses-directory" >&5
5650 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5651
5652 # Check whether --with-curses-dir or --without-curses-dir was given.
5653 if test "${with_curses_dir+set}" = set; then
5654   withval="$with_curses_dir"
5655   cf_cv_curses_dir=$withval
5656 else
5657   cf_cv_curses_dir=no
5658 fi;
5659 echo "$as_me:5659: result: $cf_cv_curses_dir" >&5
5660 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5661
5662 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5663 then
5664
5665 if test "x$prefix" != xNONE; then
5666         cf_path_syntax="$prefix"
5667 else
5668         cf_path_syntax="$ac_default_prefix"
5669 fi
5670
5671 case ".$withval" in
5672 (.\$\(*\)*|.\'*\'*)
5673         ;;
5674 (..|./*|.\\*)
5675         ;;
5676 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5677         ;;
5678 (.\${*prefix}*|.\${*dir}*)
5679         eval withval="$withval"
5680         case ".$withval" in
5681         (.NONE/*)
5682                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5683                 ;;
5684         esac
5685         ;;
5686 (.no|.NONE/*)
5687         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5688         ;;
5689 (*)
5690         { { echo "$as_me:5690: error: expected a pathname, not \"$withval\"" >&5
5691 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5692    { (exit 1); exit 1; }; }
5693         ;;
5694 esac
5695
5696         if test -d "$cf_cv_curses_dir"
5697         then
5698
5699 if test -n "$cf_cv_curses_dir/include" ; then
5700   for cf_add_incdir in $cf_cv_curses_dir/include
5701   do
5702         while test $cf_add_incdir != /usr/include
5703         do
5704           if test -d $cf_add_incdir
5705           then
5706                 cf_have_incdir=no
5707                 if test -n "$CFLAGS$CPPFLAGS" ; then
5708                   # a loop is needed to ensure we can add subdirs of existing dirs
5709                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5710                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5711                           cf_have_incdir=yes; break
5712                         fi
5713                   done
5714                 fi
5715
5716                 if test "$cf_have_incdir" = no ; then
5717                   if test "$cf_add_incdir" = /usr/local/include ; then
5718                         if test "$GCC" = yes
5719                         then
5720                           cf_save_CPPFLAGS=$CPPFLAGS
5721
5722         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5723         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5724
5725                           cat >conftest.$ac_ext <<_ACEOF
5726 #line 5726 "configure"
5727 #include "confdefs.h"
5728 #include <stdio.h>
5729 int
5730 main (void)
5731 {
5732 printf("Hello")
5733   ;
5734   return 0;
5735 }
5736 _ACEOF
5737 rm -f conftest.$ac_objext
5738 if { (eval echo "$as_me:5738: \"$ac_compile\"") >&5
5739   (eval $ac_compile) 2>&5
5740   ac_status=$?
5741   echo "$as_me:5741: \$? = $ac_status" >&5
5742   (exit $ac_status); } &&
5743          { ac_try='test -s conftest.$ac_objext'
5744   { (eval echo "$as_me:5744: \"$ac_try\"") >&5
5745   (eval $ac_try) 2>&5
5746   ac_status=$?
5747   echo "$as_me:5747: \$? = $ac_status" >&5
5748   (exit $ac_status); }; }; then
5749   :
5750 else
5751   echo "$as_me: failed program was:" >&5
5752 cat conftest.$ac_ext >&5
5753 cf_have_incdir=yes
5754 fi
5755 rm -f conftest.$ac_objext conftest.$ac_ext
5756                           CPPFLAGS=$cf_save_CPPFLAGS
5757                         fi
5758                   fi
5759                 fi
5760
5761                 if test "$cf_have_incdir" = no ; then
5762                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5763
5764 echo "${as_me:-configure}:5764: testing adding $cf_add_incdir to include-path ..." 1>&5
5765
5766                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5767
5768                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5769                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5770                   cf_add_incdir="$cf_top_incdir"
5771                 else
5772                   break
5773                 fi
5774           else
5775                 break
5776           fi
5777         done
5778   done
5779 fi
5780
5781 if test -n "$cf_cv_curses_dir/lib" ; then
5782         for cf_add_libdir in $cf_cv_curses_dir/lib
5783         do
5784                 if test $cf_add_libdir = /usr/lib ; then
5785                         :
5786                 elif test -d $cf_add_libdir
5787                 then
5788                         cf_have_libdir=no
5789                         if test -n "$LDFLAGS$LIBS" ; then
5790                                 # a loop is needed to ensure we can add subdirs of existing dirs
5791                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5792                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5793                                                 cf_have_libdir=yes; break
5794                                         fi
5795                                 done
5796                         fi
5797                         if test "$cf_have_libdir" = no ; then
5798                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5799
5800 echo "${as_me:-configure}:5800: testing adding $cf_add_libdir to library-path ..." 1>&5
5801
5802                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5803                         fi
5804                 fi
5805         done
5806 fi
5807
5808         fi
5809 fi
5810
5811 cf_cv_screen=curses
5812
5813 echo "$as_me:5813: checking for specified curses library type" >&5
5814 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5815
5816 # Check whether --with-screen or --without-screen was given.
5817 if test "${with_screen+set}" = set; then
5818   withval="$with_screen"
5819   cf_cv_screen=$withval
5820 else
5821
5822 # Check whether --with-ncursesw or --without-ncursesw was given.
5823 if test "${with_ncursesw+set}" = set; then
5824   withval="$with_ncursesw"
5825   cf_cv_screen=ncursesw
5826 else
5827
5828 # Check whether --with-ncurses or --without-ncurses was given.
5829 if test "${with_ncurses+set}" = set; then
5830   withval="$with_ncurses"
5831   cf_cv_screen=ncurses
5832 else
5833
5834 # Check whether --with-pdcurses or --without-pdcurses was given.
5835 if test "${with_pdcurses+set}" = set; then
5836   withval="$with_pdcurses"
5837   cf_cv_screen=pdcurses
5838 else
5839
5840 # Check whether --with-curses-colr or --without-curses-colr was given.
5841 if test "${with_curses_colr+set}" = set; then
5842   withval="$with_curses_colr"
5843   cf_cv_screen=curses_colr
5844 else
5845
5846 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5847 if test "${with_curses_5lib+set}" = set; then
5848   withval="$with_curses_5lib"
5849   cf_cv_screen=curses_5lib
5850 fi;
5851 fi;
5852 fi;
5853 fi;
5854 fi;
5855 fi;
5856
5857 echo "$as_me:5857: result: $cf_cv_screen" >&5
5858 echo "${ECHO_T}$cf_cv_screen" >&6
5859
5860 case $cf_cv_screen in
5861 (curses|curses_*)
5862
5863 echo "$as_me:5863: checking for extra include directories" >&5
5864 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5865 if test "${cf_cv_curses_incdir+set}" = set; then
5866   echo $ECHO_N "(cached) $ECHO_C" >&6
5867 else
5868
5869 cf_cv_curses_incdir=no
5870 case $host_os in
5871 (hpux10.*)
5872         if test "x$cf_cv_screen" = "xcurses_colr"
5873         then
5874                 test -d /usr/include/curses_colr && \
5875                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5876         fi
5877         ;;
5878 (sunos3*|sunos4*)
5879         if test "x$cf_cv_screen" = "xcurses_5lib"
5880         then
5881                 test -d /usr/5lib && \
5882                 test -d /usr/5include && \
5883                 cf_cv_curses_incdir="-I/usr/5include"
5884         fi
5885         ;;
5886 esac
5887
5888 fi
5889 echo "$as_me:5889: result: $cf_cv_curses_incdir" >&5
5890 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5891 if test "$cf_cv_curses_incdir" != no
5892 then
5893
5894         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5895         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
5896
5897 fi
5898
5899 echo "$as_me:5899: checking if we have identified curses headers" >&5
5900 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5901 if test "${cf_cv_ncurses_header+set}" = set; then
5902   echo $ECHO_N "(cached) $ECHO_C" >&6
5903 else
5904
5905 cf_cv_ncurses_header=none
5906 for cf_header in \
5907         ncurses.h  \
5908         curses.h  ncurses/ncurses.h ncurses/curses.h
5909 do
5910 cat >conftest.$ac_ext <<_ACEOF
5911 #line 5911 "configure"
5912 #include "confdefs.h"
5913 #include <${cf_header}>
5914 int
5915 main (void)
5916 {
5917 initscr(); tgoto("?", 0,0)
5918   ;
5919   return 0;
5920 }
5921 _ACEOF
5922 rm -f conftest.$ac_objext
5923 if { (eval echo "$as_me:5923: \"$ac_compile\"") >&5
5924   (eval $ac_compile) 2>&5
5925   ac_status=$?
5926   echo "$as_me:5926: \$? = $ac_status" >&5
5927   (exit $ac_status); } &&
5928          { ac_try='test -s conftest.$ac_objext'
5929   { (eval echo "$as_me:5929: \"$ac_try\"") >&5
5930   (eval $ac_try) 2>&5
5931   ac_status=$?
5932   echo "$as_me:5932: \$? = $ac_status" >&5
5933   (exit $ac_status); }; }; then
5934   cf_cv_ncurses_header=$cf_header; break
5935 else
5936   echo "$as_me: failed program was:" >&5
5937 cat conftest.$ac_ext >&5
5938 fi
5939 rm -f conftest.$ac_objext conftest.$ac_ext
5940 done
5941
5942 fi
5943 echo "$as_me:5943: result: $cf_cv_ncurses_header" >&5
5944 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5945
5946 if test "$cf_cv_ncurses_header" = none ; then
5947         { { echo "$as_me:5947: error: No curses header-files found" >&5
5948 echo "$as_me: error: No curses header-files found" >&2;}
5949    { (exit 1); exit 1; }; }
5950 fi
5951
5952 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5953
5954 for ac_header in $cf_cv_ncurses_header
5955 do
5956 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5957 echo "$as_me:5957: checking for $ac_header" >&5
5958 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5959 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5960   echo $ECHO_N "(cached) $ECHO_C" >&6
5961 else
5962   cat >conftest.$ac_ext <<_ACEOF
5963 #line 5963 "configure"
5964 #include "confdefs.h"
5965 #include <$ac_header>
5966 _ACEOF
5967 if { (eval echo "$as_me:5967: \"$ac_cpp conftest.$ac_ext\"") >&5
5968   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5969   ac_status=$?
5970   egrep -v '^ *\+' conftest.er1 >conftest.err
5971   rm -f conftest.er1
5972   cat conftest.err >&5
5973   echo "$as_me:5973: \$? = $ac_status" >&5
5974   (exit $ac_status); } >/dev/null; then
5975   if test -s conftest.err; then
5976     ac_cpp_err=$ac_c_preproc_warn_flag
5977   else
5978     ac_cpp_err=
5979   fi
5980 else
5981   ac_cpp_err=yes
5982 fi
5983 if test -z "$ac_cpp_err"; then
5984   eval "$as_ac_Header=yes"
5985 else
5986   echo "$as_me: failed program was:" >&5
5987   cat conftest.$ac_ext >&5
5988   eval "$as_ac_Header=no"
5989 fi
5990 rm -f conftest.err conftest.$ac_ext
5991 fi
5992 echo "$as_me:5992: result: `eval echo '${'$as_ac_Header'}'`" >&5
5993 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5994 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5995   cat >>confdefs.h <<EOF
5996 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5997 EOF
5998
5999 fi
6000 done
6001
6002 echo "$as_me:6002: checking for terminfo header" >&5
6003 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6004 if test "${cf_cv_term_header+set}" = set; then
6005   echo $ECHO_N "(cached) $ECHO_C" >&6
6006 else
6007
6008 case ${cf_cv_ncurses_header} in
6009 (*/ncurses.h|*/ncursesw.h)
6010         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6011         ;;
6012 (*)
6013         cf_term_header=term.h
6014         ;;
6015 esac
6016
6017 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6018 do
6019 cat >conftest.$ac_ext <<_ACEOF
6020 #line 6020 "configure"
6021 #include "confdefs.h"
6022 #include <stdio.h>
6023 #include <${cf_cv_ncurses_header:-curses.h}>
6024 #include <$cf_test>
6025
6026 int
6027 main (void)
6028 {
6029 int x = auto_left_margin
6030   ;
6031   return 0;
6032 }
6033 _ACEOF
6034 rm -f conftest.$ac_objext
6035 if { (eval echo "$as_me:6035: \"$ac_compile\"") >&5
6036   (eval $ac_compile) 2>&5
6037   ac_status=$?
6038   echo "$as_me:6038: \$? = $ac_status" >&5
6039   (exit $ac_status); } &&
6040          { ac_try='test -s conftest.$ac_objext'
6041   { (eval echo "$as_me:6041: \"$ac_try\"") >&5
6042   (eval $ac_try) 2>&5
6043   ac_status=$?
6044   echo "$as_me:6044: \$? = $ac_status" >&5
6045   (exit $ac_status); }; }; then
6046
6047         cf_cv_term_header="$cf_test"
6048 else
6049   echo "$as_me: failed program was:" >&5
6050 cat conftest.$ac_ext >&5
6051
6052         cf_cv_term_header=unknown
6053
6054 fi
6055 rm -f conftest.$ac_objext conftest.$ac_ext
6056         test "$cf_cv_term_header" != unknown && break
6057 done
6058
6059 fi
6060 echo "$as_me:6060: result: $cf_cv_term_header" >&5
6061 echo "${ECHO_T}$cf_cv_term_header" >&6
6062
6063 # Set definitions to allow ifdef'ing to accommodate subdirectories
6064
6065 case $cf_cv_term_header in
6066 (*term.h)
6067
6068 cat >>confdefs.h <<\EOF
6069 #define HAVE_TERM_H 1
6070 EOF
6071
6072         ;;
6073 esac
6074
6075 case $cf_cv_term_header in
6076 (ncurses/term.h)
6077
6078 cat >>confdefs.h <<\EOF
6079 #define HAVE_NCURSES_TERM_H 1
6080 EOF
6081
6082         ;;
6083 (ncursesw/term.h)
6084
6085 cat >>confdefs.h <<\EOF
6086 #define HAVE_NCURSESW_TERM_H 1
6087 EOF
6088
6089         ;;
6090 esac
6091
6092 echo "$as_me:6092: checking for ncurses version" >&5
6093 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6094 if test "${cf_cv_ncurses_version+set}" = set; then
6095   echo $ECHO_N "(cached) $ECHO_C" >&6
6096 else
6097
6098         cf_cv_ncurses_version=no
6099         cf_tempfile=out$$
6100         rm -f $cf_tempfile
6101         if test "$cross_compiling" = yes; then
6102
6103         # This will not work if the preprocessor splits the line after the
6104         # Autoconf token.  The 'unproto' program does that.
6105         cat > conftest.$ac_ext <<EOF
6106 #include <${cf_cv_ncurses_header:-curses.h}>
6107 #undef Autoconf
6108 #ifdef NCURSES_VERSION
6109 Autoconf NCURSES_VERSION
6110 #else
6111 #ifdef __NCURSES_H
6112 Autoconf "old"
6113 #endif
6114 ;
6115 #endif
6116 EOF
6117         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6118         { (eval echo "$as_me:6118: \"$cf_try\"") >&5
6119   (eval $cf_try) 2>&5
6120   ac_status=$?
6121   echo "$as_me:6121: \$? = $ac_status" >&5
6122   (exit $ac_status); }
6123         if test -f conftest.out ; then
6124                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6125                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6126                 rm -f conftest.out
6127         fi
6128
6129 else
6130   cat >conftest.$ac_ext <<_ACEOF
6131 #line 6131 "configure"
6132 #include "confdefs.h"
6133
6134 #include <${cf_cv_ncurses_header:-curses.h}>
6135 #include <stdio.h>
6136 int main(void)
6137 {
6138         FILE *fp = fopen("$cf_tempfile", "w");
6139 #ifdef NCURSES_VERSION
6140 # ifdef NCURSES_VERSION_PATCH
6141         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6142 # else
6143         fprintf(fp, "%s\n", NCURSES_VERSION);
6144 # endif
6145 #else
6146 # ifdef __NCURSES_H
6147         fprintf(fp, "old\n");
6148 # else
6149         make an error
6150 # endif
6151 #endif
6152         ${cf_cv_main_return:-return}(0);
6153 }
6154 _ACEOF
6155 rm -f conftest$ac_exeext
6156 if { (eval echo "$as_me:6156: \"$ac_link\"") >&5
6157   (eval $ac_link) 2>&5
6158   ac_status=$?
6159   echo "$as_me:6159: \$? = $ac_status" >&5
6160   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6161   { (eval echo "$as_me:6161: \"$ac_try\"") >&5
6162   (eval $ac_try) 2>&5
6163   ac_status=$?
6164   echo "$as_me:6164: \$? = $ac_status" >&5
6165   (exit $ac_status); }; }; then
6166
6167         cf_cv_ncurses_version=`cat $cf_tempfile`
6168 else
6169   echo "$as_me: program exited with status $ac_status" >&5
6170 echo "$as_me: failed program was:" >&5
6171 cat conftest.$ac_ext >&5
6172 fi
6173 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6174 fi
6175         rm -f $cf_tempfile
6176
6177 fi
6178 echo "$as_me:6178: result: $cf_cv_ncurses_version" >&5
6179 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6180 test "$cf_cv_ncurses_version" = no ||
6181 cat >>confdefs.h <<\EOF
6182 #define NCURSES 1
6183 EOF
6184
6185 echo "$as_me:6185: checking if we have identified curses libraries" >&5
6186 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6187 cat >conftest.$ac_ext <<_ACEOF
6188 #line 6188 "configure"
6189 #include "confdefs.h"
6190 #include <${cf_cv_ncurses_header:-curses.h}>
6191 int
6192 main (void)
6193 {
6194 initscr(); tgoto("?", 0,0)
6195   ;
6196   return 0;
6197 }
6198 _ACEOF
6199 rm -f conftest.$ac_objext conftest$ac_exeext
6200 if { (eval echo "$as_me:6200: \"$ac_link\"") >&5
6201   (eval $ac_link) 2>&5
6202   ac_status=$?
6203   echo "$as_me:6203: \$? = $ac_status" >&5
6204   (exit $ac_status); } &&
6205          { ac_try='test -s conftest$ac_exeext'
6206   { (eval echo "$as_me:6206: \"$ac_try\"") >&5
6207   (eval $ac_try) 2>&5
6208   ac_status=$?
6209   echo "$as_me:6209: \$? = $ac_status" >&5
6210   (exit $ac_status); }; }; then
6211   cf_result=yes
6212 else
6213   echo "$as_me: failed program was:" >&5
6214 cat conftest.$ac_ext >&5
6215 cf_result=no
6216 fi
6217 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6218 echo "$as_me:6218: result: $cf_result" >&5
6219 echo "${ECHO_T}$cf_result" >&6
6220
6221 if test "$cf_result" = no ; then
6222 case $host_os in
6223 (freebsd*)
6224         echo "$as_me:6224: checking for tgoto in -lmytinfo" >&5
6225 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6226 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6227   echo $ECHO_N "(cached) $ECHO_C" >&6
6228 else
6229   ac_check_lib_save_LIBS=$LIBS
6230 LIBS="-lmytinfo  $LIBS"
6231 cat >conftest.$ac_ext <<_ACEOF
6232 #line 6232 "configure"
6233 #include "confdefs.h"
6234
6235 /* Override any gcc2 internal prototype to avoid an error.  */
6236 #ifdef __cplusplus
6237 extern "C"
6238 #endif
6239 /* We use char because int might match the return type of a gcc2
6240    builtin and then its argument prototype would still apply.  */
6241 char tgoto ();
6242 int
6243 main (void)
6244 {
6245 tgoto ();
6246   ;
6247   return 0;
6248 }
6249 _ACEOF
6250 rm -f conftest.$ac_objext conftest$ac_exeext
6251 if { (eval echo "$as_me:6251: \"$ac_link\"") >&5
6252   (eval $ac_link) 2>&5
6253   ac_status=$?
6254   echo "$as_me:6254: \$? = $ac_status" >&5
6255   (exit $ac_status); } &&
6256          { ac_try='test -s conftest$ac_exeext'
6257   { (eval echo "$as_me:6257: \"$ac_try\"") >&5
6258   (eval $ac_try) 2>&5
6259   ac_status=$?
6260   echo "$as_me:6260: \$? = $ac_status" >&5
6261   (exit $ac_status); }; }; then
6262   ac_cv_lib_mytinfo_tgoto=yes
6263 else
6264   echo "$as_me: failed program was:" >&5
6265 cat conftest.$ac_ext >&5
6266 ac_cv_lib_mytinfo_tgoto=no
6267 fi
6268 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6269 LIBS=$ac_check_lib_save_LIBS
6270 fi
6271 echo "$as_me:6271: result: $ac_cv_lib_mytinfo_tgoto" >&5
6272 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6273 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6274
6275 cf_add_libs="-lmytinfo"
6276 # Filter out duplicates - this happens with badly-designed ".pc" files...
6277 for cf_add_1lib in $LIBS
6278 do
6279         for cf_add_2lib in $cf_add_libs
6280         do
6281                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6282                 then
6283                         cf_add_1lib=
6284                         break
6285                 fi
6286         done
6287         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6288 done
6289 LIBS="$cf_add_libs"
6290
6291 fi
6292
6293         ;;
6294 (hpux10.*)
6295         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6296         # next (1998), and xcurses "newer" (2000).  There is no header file for
6297         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6298         # term.h) for cur_colr
6299         if test "x$cf_cv_screen" = "xcurses_colr"
6300         then
6301                 echo "$as_me:6301: checking for initscr in -lcur_colr" >&5
6302 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6303 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6304   echo $ECHO_N "(cached) $ECHO_C" >&6
6305 else
6306   ac_check_lib_save_LIBS=$LIBS
6307 LIBS="-lcur_colr  $LIBS"
6308 cat >conftest.$ac_ext <<_ACEOF
6309 #line 6309 "configure"
6310 #include "confdefs.h"
6311
6312 /* Override any gcc2 internal prototype to avoid an error.  */
6313 #ifdef __cplusplus
6314 extern "C"
6315 #endif
6316 /* We use char because int might match the return type of a gcc2
6317    builtin and then its argument prototype would still apply.  */
6318 char initscr ();
6319 int
6320 main (void)
6321 {
6322 initscr ();
6323   ;
6324   return 0;
6325 }
6326 _ACEOF
6327 rm -f conftest.$ac_objext conftest$ac_exeext
6328 if { (eval echo "$as_me:6328: \"$ac_link\"") >&5
6329   (eval $ac_link) 2>&5
6330   ac_status=$?
6331   echo "$as_me:6331: \$? = $ac_status" >&5
6332   (exit $ac_status); } &&
6333          { ac_try='test -s conftest$ac_exeext'
6334   { (eval echo "$as_me:6334: \"$ac_try\"") >&5
6335   (eval $ac_try) 2>&5
6336   ac_status=$?
6337   echo "$as_me:6337: \$? = $ac_status" >&5
6338   (exit $ac_status); }; }; then
6339   ac_cv_lib_cur_colr_initscr=yes
6340 else
6341   echo "$as_me: failed program was:" >&5
6342 cat conftest.$ac_ext >&5
6343 ac_cv_lib_cur_colr_initscr=no
6344 fi
6345 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6346 LIBS=$ac_check_lib_save_LIBS
6347 fi
6348 echo "$as_me:6348: result: $ac_cv_lib_cur_colr_initscr" >&5
6349 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6350 if test $ac_cv_lib_cur_colr_initscr = yes; then
6351
6352 cf_add_libs="-lcur_colr"
6353 # Filter out duplicates - this happens with badly-designed ".pc" files...
6354 for cf_add_1lib in $LIBS
6355 do
6356         for cf_add_2lib in $cf_add_libs
6357         do
6358                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6359                 then
6360                         cf_add_1lib=
6361                         break
6362                 fi
6363         done
6364         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6365 done
6366 LIBS="$cf_add_libs"
6367
6368                         ac_cv_func_initscr=yes
6369
6370 else
6371
6372                 echo "$as_me:6372: checking for initscr in -lHcurses" >&5
6373 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6374 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6375   echo $ECHO_N "(cached) $ECHO_C" >&6
6376 else
6377   ac_check_lib_save_LIBS=$LIBS
6378 LIBS="-lHcurses  $LIBS"
6379 cat >conftest.$ac_ext <<_ACEOF
6380 #line 6380 "configure"
6381 #include "confdefs.h"
6382
6383 /* Override any gcc2 internal prototype to avoid an error.  */
6384 #ifdef __cplusplus
6385 extern "C"
6386 #endif
6387 /* We use char because int might match the return type of a gcc2
6388    builtin and then its argument prototype would still apply.  */
6389 char initscr ();
6390 int
6391 main (void)
6392 {
6393 initscr ();
6394   ;
6395   return 0;
6396 }
6397 _ACEOF
6398 rm -f conftest.$ac_objext conftest$ac_exeext
6399 if { (eval echo "$as_me:6399: \"$ac_link\"") >&5
6400   (eval $ac_link) 2>&5
6401   ac_status=$?
6402   echo "$as_me:6402: \$? = $ac_status" >&5
6403   (exit $ac_status); } &&
6404          { ac_try='test -s conftest$ac_exeext'
6405   { (eval echo "$as_me:6405: \"$ac_try\"") >&5
6406   (eval $ac_try) 2>&5
6407   ac_status=$?
6408   echo "$as_me:6408: \$? = $ac_status" >&5
6409   (exit $ac_status); }; }; then
6410   ac_cv_lib_Hcurses_initscr=yes
6411 else
6412   echo "$as_me: failed program was:" >&5
6413 cat conftest.$ac_ext >&5
6414 ac_cv_lib_Hcurses_initscr=no
6415 fi
6416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6417 LIBS=$ac_check_lib_save_LIBS
6418 fi
6419 echo "$as_me:6419: result: $ac_cv_lib_Hcurses_initscr" >&5
6420 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6421 if test $ac_cv_lib_Hcurses_initscr = yes; then
6422
6423                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6424
6425 cf_add_libs="-lHcurses"
6426 # Filter out duplicates - this happens with badly-designed ".pc" files...
6427 for cf_add_1lib in $LIBS
6428 do
6429         for cf_add_2lib in $cf_add_libs
6430         do
6431                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6432                 then
6433                         cf_add_1lib=
6434                         break
6435                 fi
6436         done
6437         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6438 done
6439 LIBS="$cf_add_libs"
6440
6441         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6442         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6443
6444                         ac_cv_func_initscr=yes
6445
6446 fi
6447
6448 fi
6449
6450         fi
6451         ;;
6452 (linux*)
6453         case `arch 2>/dev/null` in
6454         (x86_64)
6455                 if test -d /lib64
6456                 then
6457
6458 if test -n "/lib64" ; then
6459         for cf_add_libdir in /lib64
6460         do
6461                 if test $cf_add_libdir = /usr/lib ; then
6462                         :
6463                 elif test -d $cf_add_libdir
6464                 then
6465                         cf_have_libdir=no
6466                         if test -n "$LDFLAGS$LIBS" ; then
6467                                 # a loop is needed to ensure we can add subdirs of existing dirs
6468                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6469                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6470                                                 cf_have_libdir=yes; break
6471                                         fi
6472                                 done
6473                         fi
6474                         if test "$cf_have_libdir" = no ; then
6475                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6476
6477 echo "${as_me:-configure}:6477: testing adding $cf_add_libdir to library-path ..." 1>&5
6478
6479                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6480                         fi
6481                 fi
6482         done
6483 fi
6484
6485                 else
6486
6487 if test -n "/lib" ; then
6488         for cf_add_libdir in /lib
6489         do
6490                 if test $cf_add_libdir = /usr/lib ; then
6491                         :
6492                 elif test -d $cf_add_libdir
6493                 then
6494                         cf_have_libdir=no
6495                         if test -n "$LDFLAGS$LIBS" ; then
6496                                 # a loop is needed to ensure we can add subdirs of existing dirs
6497                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6498                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6499                                                 cf_have_libdir=yes; break
6500                                         fi
6501                                 done
6502                         fi
6503                         if test "$cf_have_libdir" = no ; then
6504                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6505
6506 echo "${as_me:-configure}:6506: testing adding $cf_add_libdir to library-path ..." 1>&5
6507
6508                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6509                         fi
6510                 fi
6511         done
6512 fi
6513
6514                 fi
6515                 ;;
6516         (*)
6517
6518 if test -n "/lib" ; then
6519         for cf_add_libdir in /lib
6520         do
6521                 if test $cf_add_libdir = /usr/lib ; then
6522                         :
6523                 elif test -d $cf_add_libdir
6524                 then
6525                         cf_have_libdir=no
6526                         if test -n "$LDFLAGS$LIBS" ; then
6527                                 # a loop is needed to ensure we can add subdirs of existing dirs
6528                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6529                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6530                                                 cf_have_libdir=yes; break
6531                                         fi
6532                                 done
6533                         fi
6534                         if test "$cf_have_libdir" = no ; then
6535                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6536
6537 echo "${as_me:-configure}:6537: testing adding $cf_add_libdir to library-path ..." 1>&5
6538
6539                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6540                         fi
6541                 fi
6542         done
6543 fi
6544
6545                 ;;
6546         esac
6547         ;;
6548 (sunos3*|sunos4*)
6549         if test "x$cf_cv_screen" = "xcurses_5lib"
6550         then
6551                 if test -d /usr/5lib ; then
6552
6553 if test -n "/usr/5lib" ; then
6554         for cf_add_libdir in /usr/5lib
6555         do
6556                 if test $cf_add_libdir = /usr/lib ; then
6557                         :
6558                 elif test -d $cf_add_libdir
6559                 then
6560                         cf_have_libdir=no
6561                         if test -n "$LDFLAGS$LIBS" ; then
6562                                 # a loop is needed to ensure we can add subdirs of existing dirs
6563                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6564                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6565                                                 cf_have_libdir=yes; break
6566                                         fi
6567                                 done
6568                         fi
6569                         if test "$cf_have_libdir" = no ; then
6570                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6571
6572 echo "${as_me:-configure}:6572: testing adding $cf_add_libdir to library-path ..." 1>&5
6573
6574                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6575                         fi
6576                 fi
6577         done
6578 fi
6579
6580 cf_add_libs="-lcurses -ltermcap"
6581 # Filter out duplicates - this happens with badly-designed ".pc" files...
6582 for cf_add_1lib in $LIBS
6583 do
6584         for cf_add_2lib in $cf_add_libs
6585         do
6586                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6587                 then
6588                         cf_add_1lib=
6589                         break
6590                 fi
6591         done
6592         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6593 done
6594 LIBS="$cf_add_libs"
6595
6596                 fi
6597         fi
6598         ac_cv_func_initscr=yes
6599         ;;
6600 esac
6601
6602 if test ".$ac_cv_func_initscr" != .yes ; then
6603         cf_save_LIBS="$LIBS"
6604
6605         if test ".${cf_cv_ncurses_version:-no}" != .no
6606         then
6607                 cf_check_list="ncurses curses cursesX"
6608         else
6609                 cf_check_list="cursesX curses ncurses"
6610         fi
6611
6612         # Check for library containing tgoto.  Do this before curses library
6613         # because it may be needed to link the test-case for initscr.
6614         if test "x$cf_term_lib" = x
6615         then
6616                 echo "$as_me:6616: checking for tgoto" >&5
6617 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6618 if test "${ac_cv_func_tgoto+set}" = set; then
6619   echo $ECHO_N "(cached) $ECHO_C" >&6
6620 else
6621   cat >conftest.$ac_ext <<_ACEOF
6622 #line 6622 "configure"
6623 #include "confdefs.h"
6624 #define tgoto autoconf_temporary
6625 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6626 #undef tgoto
6627
6628 #ifdef __cplusplus
6629 extern "C"
6630 #endif
6631
6632 /* We use char because int might match the return type of a gcc2
6633    builtin and then its argument prototype would still apply.  */
6634 char tgoto (void);
6635
6636 int
6637 main (void)
6638 {
6639
6640 /* The GNU C library defines stubs for functions which it implements
6641     to always fail with ENOSYS.  Some functions are actually named
6642     something starting with __ and the normal name is an alias.  */
6643 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6644 #error found stub for tgoto
6645 #endif
6646
6647         return tgoto ();
6648   ;
6649   return 0;
6650 }
6651 _ACEOF
6652 rm -f conftest.$ac_objext conftest$ac_exeext
6653 if { (eval echo "$as_me:6653: \"$ac_link\"") >&5
6654   (eval $ac_link) 2>&5
6655   ac_status=$?
6656   echo "$as_me:6656: \$? = $ac_status" >&5
6657   (exit $ac_status); } &&
6658          { ac_try='test -s conftest$ac_exeext'
6659   { (eval echo "$as_me:6659: \"$ac_try\"") >&5
6660   (eval $ac_try) 2>&5
6661   ac_status=$?
6662   echo "$as_me:6662: \$? = $ac_status" >&5
6663   (exit $ac_status); }; }; then
6664   ac_cv_func_tgoto=yes
6665 else
6666   echo "$as_me: failed program was:" >&5
6667 cat conftest.$ac_ext >&5
6668 ac_cv_func_tgoto=no
6669 fi
6670 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6671 fi
6672 echo "$as_me:6672: result: $ac_cv_func_tgoto" >&5
6673 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6674 if test $ac_cv_func_tgoto = yes; then
6675   cf_term_lib=predefined
6676 else
6677
6678                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6679                         do
6680                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6681 echo "$as_me:6681: checking for tgoto in -l$cf_term_lib" >&5
6682 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6683 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6684   echo $ECHO_N "(cached) $ECHO_C" >&6
6685 else
6686   ac_check_lib_save_LIBS=$LIBS
6687 LIBS="-l$cf_term_lib  $LIBS"
6688 cat >conftest.$ac_ext <<_ACEOF
6689 #line 6689 "configure"
6690 #include "confdefs.h"
6691
6692 /* Override any gcc2 internal prototype to avoid an error.  */
6693 #ifdef __cplusplus
6694 extern "C"
6695 #endif
6696 /* We use char because int might match the return type of a gcc2
6697    builtin and then its argument prototype would still apply.  */
6698 char tgoto ();
6699 int
6700 main (void)
6701 {
6702 tgoto ();
6703   ;
6704   return 0;
6705 }
6706 _ACEOF
6707 rm -f conftest.$ac_objext conftest$ac_exeext
6708 if { (eval echo "$as_me:6708: \"$ac_link\"") >&5
6709   (eval $ac_link) 2>&5
6710   ac_status=$?
6711   echo "$as_me:6711: \$? = $ac_status" >&5
6712   (exit $ac_status); } &&
6713          { ac_try='test -s conftest$ac_exeext'
6714   { (eval echo "$as_me:6714: \"$ac_try\"") >&5
6715   (eval $ac_try) 2>&5
6716   ac_status=$?
6717   echo "$as_me:6717: \$? = $ac_status" >&5
6718   (exit $ac_status); }; }; then
6719   eval "$as_ac_Lib=yes"
6720 else
6721   echo "$as_me: failed program was:" >&5
6722 cat conftest.$ac_ext >&5
6723 eval "$as_ac_Lib=no"
6724 fi
6725 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6726 LIBS=$ac_check_lib_save_LIBS
6727 fi
6728 echo "$as_me:6728: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6729 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6730 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6731
6732                                         : ${cf_nculib_root:=$cf_term_lib}
6733                                         break
6734
6735 fi
6736
6737                         done
6738
6739 fi
6740
6741         fi
6742
6743         # Check for library containing initscr
6744         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6745         if test "x$cf_curs_lib" = x
6746         then
6747                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6748                 do
6749                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6750                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6751                                 echo "$as_me:6751: checking if we can link with $cf_curs_lib library" >&5
6752 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6753                                 cat >conftest.$ac_ext <<_ACEOF
6754 #line 6754 "configure"
6755 #include "confdefs.h"
6756 #include <${cf_cv_ncurses_header:-curses.h}>
6757 int
6758 main (void)
6759 {
6760 initscr()
6761   ;
6762   return 0;
6763 }
6764 _ACEOF
6765 rm -f conftest.$ac_objext conftest$ac_exeext
6766 if { (eval echo "$as_me:6766: \"$ac_link\"") >&5
6767   (eval $ac_link) 2>&5
6768   ac_status=$?
6769   echo "$as_me:6769: \$? = $ac_status" >&5
6770   (exit $ac_status); } &&
6771          { ac_try='test -s conftest$ac_exeext'
6772   { (eval echo "$as_me:6772: \"$ac_try\"") >&5
6773   (eval $ac_try) 2>&5
6774   ac_status=$?
6775   echo "$as_me:6775: \$? = $ac_status" >&5
6776   (exit $ac_status); }; }; then
6777   cf_result=yes
6778 else
6779   echo "$as_me: failed program was:" >&5
6780 cat conftest.$ac_ext >&5
6781 cf_result=no
6782 fi
6783 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6784                                 echo "$as_me:6784: result: $cf_result" >&5
6785 echo "${ECHO_T}$cf_result" >&6
6786                                 test $cf_result = yes && break
6787                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6788                                 cf_result=no
6789                         elif test "$cf_term_lib" != predefined ; then
6790                                 echo "$as_me:6790: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6791 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6792                                 cat >conftest.$ac_ext <<_ACEOF
6793 #line 6793 "configure"
6794 #include "confdefs.h"
6795 #include <${cf_cv_ncurses_header:-curses.h}>
6796 int
6797 main (void)
6798 {
6799 initscr(); tgoto((char *)0, 0, 0);
6800   ;
6801   return 0;
6802 }
6803 _ACEOF
6804 rm -f conftest.$ac_objext conftest$ac_exeext
6805 if { (eval echo "$as_me:6805: \"$ac_link\"") >&5
6806   (eval $ac_link) 2>&5
6807   ac_status=$?
6808   echo "$as_me:6808: \$? = $ac_status" >&5
6809   (exit $ac_status); } &&
6810          { ac_try='test -s conftest$ac_exeext'
6811   { (eval echo "$as_me:6811: \"$ac_try\"") >&5
6812   (eval $ac_try) 2>&5
6813   ac_status=$?
6814   echo "$as_me:6814: \$? = $ac_status" >&5
6815   (exit $ac_status); }; }; then
6816   cf_result=no
6817 else
6818   echo "$as_me: failed program was:" >&5
6819 cat conftest.$ac_ext >&5
6820
6821                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6822                                         cat >conftest.$ac_ext <<_ACEOF
6823 #line 6823 "configure"
6824 #include "confdefs.h"
6825 #include <${cf_cv_ncurses_header:-curses.h}>
6826 int
6827 main (void)
6828 {
6829 initscr()
6830   ;
6831   return 0;
6832 }
6833 _ACEOF
6834 rm -f conftest.$ac_objext conftest$ac_exeext
6835 if { (eval echo "$as_me:6835: \"$ac_link\"") >&5
6836   (eval $ac_link) 2>&5
6837   ac_status=$?
6838   echo "$as_me:6838: \$? = $ac_status" >&5
6839   (exit $ac_status); } &&
6840          { ac_try='test -s conftest$ac_exeext'
6841   { (eval echo "$as_me:6841: \"$ac_try\"") >&5
6842   (eval $ac_try) 2>&5
6843   ac_status=$?
6844   echo "$as_me:6844: \$? = $ac_status" >&5
6845   (exit $ac_status); }; }; then
6846   cf_result=yes
6847 else
6848   echo "$as_me: failed program was:" >&5
6849 cat conftest.$ac_ext >&5
6850 cf_result=error
6851 fi
6852 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6853
6854 fi
6855 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6856                                 echo "$as_me:6856: result: $cf_result" >&5
6857 echo "${ECHO_T}$cf_result" >&6
6858                                 test $cf_result != error && break
6859                         fi
6860                 done
6861         fi
6862         test $cf_curs_lib = unknown && { { echo "$as_me:6862: error: no curses library found" >&5
6863 echo "$as_me: error: no curses library found" >&2;}
6864    { (exit 1); exit 1; }; }
6865 fi
6866 fi
6867
6868         ;;
6869 (ncursesw*)
6870
6871 echo "$as_me:6871: checking for multibyte character support" >&5
6872 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6873 if test "${cf_cv_utf8_lib+set}" = set; then
6874   echo $ECHO_N "(cached) $ECHO_C" >&6
6875 else
6876
6877         cf_save_LIBS="$LIBS"
6878         cat >conftest.$ac_ext <<_ACEOF
6879 #line 6879 "configure"
6880 #include "confdefs.h"
6881
6882 #include <stdlib.h>
6883 int
6884 main (void)
6885 {
6886 putwc(0,0);
6887   ;
6888   return 0;
6889 }
6890 _ACEOF
6891 rm -f conftest.$ac_objext conftest$ac_exeext
6892 if { (eval echo "$as_me:6892: \"$ac_link\"") >&5
6893   (eval $ac_link) 2>&5
6894   ac_status=$?
6895   echo "$as_me:6895: \$? = $ac_status" >&5
6896   (exit $ac_status); } &&
6897          { ac_try='test -s conftest$ac_exeext'
6898   { (eval echo "$as_me:6898: \"$ac_try\"") >&5
6899   (eval $ac_try) 2>&5
6900   ac_status=$?
6901   echo "$as_me:6901: \$? = $ac_status" >&5
6902   (exit $ac_status); }; }; then
6903   cf_cv_utf8_lib=yes
6904 else
6905   echo "$as_me: failed program was:" >&5
6906 cat conftest.$ac_ext >&5
6907
6908 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6909 # will be set on completion of the AC_TRY_LINK below.
6910 cf_cv_header_path_utf8=
6911 cf_cv_library_path_utf8=
6912
6913 echo "${as_me:-configure}:6913: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6914
6915 cf_save_LIBS="$LIBS"
6916
6917 cat >conftest.$ac_ext <<_ACEOF
6918 #line 6918 "configure"
6919 #include "confdefs.h"
6920
6921 #include <libutf8.h>
6922 int
6923 main (void)
6924 {
6925 putwc(0,0);
6926   ;
6927   return 0;
6928 }
6929 _ACEOF
6930 rm -f conftest.$ac_objext conftest$ac_exeext
6931 if { (eval echo "$as_me:6931: \"$ac_link\"") >&5
6932   (eval $ac_link) 2>&5
6933   ac_status=$?
6934   echo "$as_me:6934: \$? = $ac_status" >&5
6935   (exit $ac_status); } &&
6936          { ac_try='test -s conftest$ac_exeext'
6937   { (eval echo "$as_me:6937: \"$ac_try\"") >&5
6938   (eval $ac_try) 2>&5
6939   ac_status=$?
6940   echo "$as_me:6940: \$? = $ac_status" >&5
6941   (exit $ac_status); }; }; then
6942
6943         cf_cv_find_linkage_utf8=yes
6944         cf_cv_header_path_utf8=/usr/include
6945         cf_cv_library_path_utf8=/usr/lib
6946
6947 else
6948   echo "$as_me: failed program was:" >&5
6949 cat conftest.$ac_ext >&5
6950
6951 LIBS="-lutf8  $cf_save_LIBS"
6952
6953 cat >conftest.$ac_ext <<_ACEOF
6954 #line 6954 "configure"
6955 #include "confdefs.h"
6956
6957 #include <libutf8.h>
6958 int
6959 main (void)
6960 {
6961 putwc(0,0);
6962   ;
6963   return 0;
6964 }
6965 _ACEOF
6966 rm -f conftest.$ac_objext conftest$ac_exeext
6967 if { (eval echo "$as_me:6967: \"$ac_link\"") >&5
6968   (eval $ac_link) 2>&5
6969   ac_status=$?
6970   echo "$as_me:6970: \$? = $ac_status" >&5
6971   (exit $ac_status); } &&
6972          { ac_try='test -s conftest$ac_exeext'
6973   { (eval echo "$as_me:6973: \"$ac_try\"") >&5
6974   (eval $ac_try) 2>&5
6975   ac_status=$?
6976   echo "$as_me:6976: \$? = $ac_status" >&5
6977   (exit $ac_status); }; }; then
6978
6979         cf_cv_find_linkage_utf8=yes
6980         cf_cv_header_path_utf8=/usr/include
6981         cf_cv_library_path_utf8=/usr/lib
6982         cf_cv_library_file_utf8="-lutf8"
6983
6984 else
6985   echo "$as_me: failed program was:" >&5
6986 cat conftest.$ac_ext >&5
6987
6988         cf_cv_find_linkage_utf8=no
6989         LIBS="$cf_save_LIBS"
6990
6991         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6992
6993 echo "${as_me:-configure}:6993: testing find linkage for utf8 library ..." 1>&5
6994
6995 echo "${as_me:-configure}:6995: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6996
6997         cf_save_CPPFLAGS="$CPPFLAGS"
6998         cf_test_CPPFLAGS="$CPPFLAGS"
6999
7000 cf_search=
7001
7002 # collect the current set of include-directories from compiler flags
7003 cf_header_path_list=""
7004 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7005         for cf_header_path in $CPPFLAGS $CFLAGS
7006         do
7007                 case $cf_header_path in
7008                 (-I*)
7009                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7010
7011 test "x$cf_header_path" != "xNONE" && \
7012 test -d "$cf_header_path" && \
7013  {
7014         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7015         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7016         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7017         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7018         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7019         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7020 }
7021
7022                         cf_header_path_list="$cf_header_path_list $cf_search"
7023                         ;;
7024                 esac
7025         done
7026 fi
7027
7028 # add the variations for the package we are looking for
7029
7030 cf_search=
7031
7032 test "x$prefix" != "xNONE" && \
7033 test -d "$prefix" && \
7034  {
7035         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7036         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7037         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7038         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7039         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7040         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7041 }
7042
7043 for cf_subdir_prefix in \
7044         /usr \
7045         /usr/local \
7046         /usr/pkg \
7047         /opt \
7048         /opt/local \
7049         $HOME
7050 do
7051
7052 test "x$cf_subdir_prefix" != "x$prefix" && \
7053 test -d "$cf_subdir_prefix" && \
7054 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7055         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7056         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7057         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7058         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7059         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7060         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7061 }
7062
7063 done
7064
7065 test "$includedir" != NONE && \
7066 test "$includedir" != "/usr/include" && \
7067 test -d "$includedir" && {
7068         test -d $includedir &&    cf_search="$cf_search $includedir"
7069         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7070 }
7071
7072 test "$oldincludedir" != NONE && \
7073 test "$oldincludedir" != "/usr/include" && \
7074 test -d "$oldincludedir" && {
7075         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7076         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7077 }
7078
7079 cf_search="$cf_search $cf_header_path_list"
7080
7081         for cf_cv_header_path_utf8 in $cf_search
7082         do
7083                 if test -d $cf_cv_header_path_utf8 ; then
7084                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7085
7086 echo "${as_me:-configure}:7086: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7087
7088                         CPPFLAGS="$cf_save_CPPFLAGS"
7089
7090         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7091         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7092
7093                         cat >conftest.$ac_ext <<_ACEOF
7094 #line 7094 "configure"
7095 #include "confdefs.h"
7096
7097 #include <libutf8.h>
7098 int
7099 main (void)
7100 {
7101 putwc(0,0);
7102   ;
7103   return 0;
7104 }
7105 _ACEOF
7106 rm -f conftest.$ac_objext
7107 if { (eval echo "$as_me:7107: \"$ac_compile\"") >&5
7108   (eval $ac_compile) 2>&5
7109   ac_status=$?
7110   echo "$as_me:7110: \$? = $ac_status" >&5
7111   (exit $ac_status); } &&
7112          { ac_try='test -s conftest.$ac_objext'
7113   { (eval echo "$as_me:7113: \"$ac_try\"") >&5
7114   (eval $ac_try) 2>&5
7115   ac_status=$?
7116   echo "$as_me:7116: \$? = $ac_status" >&5
7117   (exit $ac_status); }; }; then
7118
7119                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7120
7121 echo "${as_me:-configure}:7121: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7122
7123                                 cf_cv_find_linkage_utf8=maybe
7124                                 cf_test_CPPFLAGS="$CPPFLAGS"
7125                                 break
7126 else
7127   echo "$as_me: failed program was:" >&5
7128 cat conftest.$ac_ext >&5
7129
7130                                 CPPFLAGS="$cf_save_CPPFLAGS"
7131
7132 fi
7133 rm -f conftest.$ac_objext conftest.$ac_ext
7134                 fi
7135         done
7136
7137         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7138
7139 echo "${as_me:-configure}:7139: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7140
7141                 cf_save_LIBS="$LIBS"
7142                 cf_save_LDFLAGS="$LDFLAGS"
7143
7144                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7145
7146 cf_search=
7147 cf_library_path_list=""
7148 if test -n "${LDFLAGS}${LIBS}" ; then
7149         for cf_library_path in $LDFLAGS $LIBS
7150         do
7151                 case $cf_library_path in
7152                 (-L*)
7153                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7154
7155 test "x$cf_library_path" != "xNONE" && \
7156 test -d "$cf_library_path" && \
7157  {
7158         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7159         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7160         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7161         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7162         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7163         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7164 }
7165
7166                         cf_library_path_list="$cf_library_path_list $cf_search"
7167                         ;;
7168                 esac
7169         done
7170 fi
7171
7172 cf_search=
7173
7174 test "x$prefix" != "xNONE" && \
7175 test -d "$prefix" && \
7176  {
7177         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7178         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7179         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7180         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7181         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7182         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7183 }
7184
7185 for cf_subdir_prefix in \
7186         /usr \
7187         /usr/local \
7188         /usr/pkg \
7189         /opt \
7190         /opt/local \
7191         $HOME
7192 do
7193
7194 test "x$cf_subdir_prefix" != "x$prefix" && \
7195 test -d "$cf_subdir_prefix" && \
7196 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7197         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7198         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7199         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7200         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7201         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7202         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7203 }
7204
7205 done
7206
7207 cf_search="$cf_library_path_list $cf_search"
7208
7209                         for cf_cv_library_path_utf8 in $cf_search
7210                         do
7211                                 if test -d $cf_cv_library_path_utf8 ; then
7212                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7213
7214 echo "${as_me:-configure}:7214: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7215
7216                                         CPPFLAGS="$cf_test_CPPFLAGS"
7217                                         LIBS="-lutf8  $cf_save_LIBS"
7218                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7219                                         cat >conftest.$ac_ext <<_ACEOF
7220 #line 7220 "configure"
7221 #include "confdefs.h"
7222
7223 #include <libutf8.h>
7224 int
7225 main (void)
7226 {
7227 putwc(0,0);
7228   ;
7229   return 0;
7230 }
7231 _ACEOF
7232 rm -f conftest.$ac_objext conftest$ac_exeext
7233 if { (eval echo "$as_me:7233: \"$ac_link\"") >&5
7234   (eval $ac_link) 2>&5
7235   ac_status=$?
7236   echo "$as_me:7236: \$? = $ac_status" >&5
7237   (exit $ac_status); } &&
7238          { ac_try='test -s conftest$ac_exeext'
7239   { (eval echo "$as_me:7239: \"$ac_try\"") >&5
7240   (eval $ac_try) 2>&5
7241   ac_status=$?
7242   echo "$as_me:7242: \$? = $ac_status" >&5
7243   (exit $ac_status); }; }; then
7244
7245                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7246
7247 echo "${as_me:-configure}:7247: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7248
7249                                         cf_cv_find_linkage_utf8=yes
7250                                         cf_cv_library_file_utf8="-lutf8"
7251                                         break
7252 else
7253   echo "$as_me: failed program was:" >&5
7254 cat conftest.$ac_ext >&5
7255
7256                                         CPPFLAGS="$cf_save_CPPFLAGS"
7257                                         LIBS="$cf_save_LIBS"
7258                                         LDFLAGS="$cf_save_LDFLAGS"
7259
7260 fi
7261 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7262                                 fi
7263                         done
7264                         CPPFLAGS="$cf_save_CPPFLAGS"
7265                         LDFLAGS="$cf_save_LDFLAGS"
7266                 fi
7267
7268         else
7269                 cf_cv_find_linkage_utf8=no
7270         fi
7271
7272 fi
7273 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7274
7275 fi
7276 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7277
7278 LIBS="$cf_save_LIBS"
7279
7280 if test "$cf_cv_find_linkage_utf8" = yes ; then
7281 cf_cv_utf8_lib=add-on
7282 else
7283 cf_cv_utf8_lib=no
7284 fi
7285
7286 fi
7287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7288 fi
7289 echo "$as_me:7289: result: $cf_cv_utf8_lib" >&5
7290 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7291
7292 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7293 # ncurses/ncursesw:
7294 if test "$cf_cv_utf8_lib" = "add-on" ; then
7295
7296 cat >>confdefs.h <<\EOF
7297 #define HAVE_LIBUTF8_H 1
7298 EOF
7299
7300 if test -n "$cf_cv_header_path_utf8" ; then
7301   for cf_add_incdir in $cf_cv_header_path_utf8
7302   do
7303         while test $cf_add_incdir != /usr/include
7304         do
7305           if test -d $cf_add_incdir
7306           then
7307                 cf_have_incdir=no
7308                 if test -n "$CFLAGS$CPPFLAGS" ; then
7309                   # a loop is needed to ensure we can add subdirs of existing dirs
7310                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7311                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7312                           cf_have_incdir=yes; break
7313                         fi
7314                   done
7315                 fi
7316
7317                 if test "$cf_have_incdir" = no ; then
7318                   if test "$cf_add_incdir" = /usr/local/include ; then
7319                         if test "$GCC" = yes
7320                         then
7321                           cf_save_CPPFLAGS=$CPPFLAGS
7322
7323         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7324         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7325
7326                           cat >conftest.$ac_ext <<_ACEOF
7327 #line 7327 "configure"
7328 #include "confdefs.h"
7329 #include <stdio.h>
7330 int
7331 main (void)
7332 {
7333 printf("Hello")
7334   ;
7335   return 0;
7336 }
7337 _ACEOF
7338 rm -f conftest.$ac_objext
7339 if { (eval echo "$as_me:7339: \"$ac_compile\"") >&5
7340   (eval $ac_compile) 2>&5
7341   ac_status=$?
7342   echo "$as_me:7342: \$? = $ac_status" >&5
7343   (exit $ac_status); } &&
7344          { ac_try='test -s conftest.$ac_objext'
7345   { (eval echo "$as_me:7345: \"$ac_try\"") >&5
7346   (eval $ac_try) 2>&5
7347   ac_status=$?
7348   echo "$as_me:7348: \$? = $ac_status" >&5
7349   (exit $ac_status); }; }; then
7350   :
7351 else
7352   echo "$as_me: failed program was:" >&5
7353 cat conftest.$ac_ext >&5
7354 cf_have_incdir=yes
7355 fi
7356 rm -f conftest.$ac_objext conftest.$ac_ext
7357                           CPPFLAGS=$cf_save_CPPFLAGS
7358                         fi
7359                   fi
7360                 fi
7361
7362                 if test "$cf_have_incdir" = no ; then
7363                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7364
7365 echo "${as_me:-configure}:7365: testing adding $cf_add_incdir to include-path ..." 1>&5
7366
7367                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7368
7369                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7370                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7371                   cf_add_incdir="$cf_top_incdir"
7372                 else
7373                   break
7374                 fi
7375           else
7376                 break
7377           fi
7378         done
7379   done
7380 fi
7381
7382 if test -n "$cf_cv_library_path_utf8" ; then
7383         for cf_add_libdir in $cf_cv_library_path_utf8
7384         do
7385                 if test $cf_add_libdir = /usr/lib ; then
7386                         :
7387                 elif test -d $cf_add_libdir
7388                 then
7389                         cf_have_libdir=no
7390                         if test -n "$LDFLAGS$LIBS" ; then
7391                                 # a loop is needed to ensure we can add subdirs of existing dirs
7392                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7393                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7394                                                 cf_have_libdir=yes; break
7395                                         fi
7396                                 done
7397                         fi
7398                         if test "$cf_have_libdir" = no ; then
7399                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7400
7401 echo "${as_me:-configure}:7401: testing adding $cf_add_libdir to library-path ..." 1>&5
7402
7403                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7404                         fi
7405                 fi
7406         done
7407 fi
7408
7409 cf_add_libs="$cf_cv_library_file_utf8"
7410 # Filter out duplicates - this happens with badly-designed ".pc" files...
7411 for cf_add_1lib in $LIBS
7412 do
7413         for cf_add_2lib in $cf_add_libs
7414         do
7415                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7416                 then
7417                         cf_add_1lib=
7418                         break
7419                 fi
7420         done
7421         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7422 done
7423 LIBS="$cf_add_libs"
7424
7425 fi
7426
7427 cf_ncuconfig_root=$cf_cv_screen
7428 cf_have_ncuconfig=no
7429
7430 if test "x${PKG_CONFIG:=none}" != xnone; then
7431         echo "$as_me:7431: checking pkg-config for $cf_ncuconfig_root" >&5
7432 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7433         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7434                 echo "$as_me:7434: result: yes" >&5
7435 echo "${ECHO_T}yes" >&6
7436
7437                 echo "$as_me:7437: checking if the $cf_ncuconfig_root package files work" >&5
7438 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7439                 cf_have_ncuconfig=unknown
7440
7441                 cf_save_CPPFLAGS="$CPPFLAGS"
7442                 cf_save_LIBS="$LIBS"
7443
7444 cf_fix_cppflags=no
7445 cf_new_cflags=
7446 cf_new_cppflags=
7447 cf_new_extra_cppflags=
7448
7449 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
7450 do
7451 case $cf_fix_cppflags in
7452 (no)
7453         case $cf_add_cflags in
7454         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7455                 case $cf_add_cflags in
7456                 (-D*)
7457                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7458
7459                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7460                                 && test -z "${cf_tst_cflags}" \
7461                                 && cf_fix_cppflags=yes
7462
7463                         if test $cf_fix_cppflags = yes ; then
7464
7465         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7466         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7467
7468                                 continue
7469                         elif test "${cf_tst_cflags}" = "\"'" ; then
7470
7471         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7472         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7473
7474                                 continue
7475                         fi
7476                         ;;
7477                 esac
7478                 case "$CPPFLAGS" in
7479                 (*$cf_add_cflags)
7480                         ;;
7481                 (*)
7482                         case $cf_add_cflags in
7483                         (-D*)
7484                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7485
7486 CPPFLAGS=`echo "$CPPFLAGS" | \
7487         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7488                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7489
7490                                 ;;
7491                         esac
7492
7493         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7494         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7495
7496                         ;;
7497                 esac
7498                 ;;
7499         (*)
7500
7501         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7502         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7503
7504                 ;;
7505         esac
7506         ;;
7507 (yes)
7508
7509         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7510         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7511
7512         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7513
7514         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7515                 && test -z "${cf_tst_cflags}" \
7516                 && cf_fix_cppflags=no
7517         ;;
7518 esac
7519 done
7520
7521 if test -n "$cf_new_cflags" ; then
7522
7523         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7524         CFLAGS="${CFLAGS}$cf_new_cflags"
7525
7526 fi
7527
7528 if test -n "$cf_new_cppflags" ; then
7529
7530         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7531         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7532
7533 fi
7534
7535 if test -n "$cf_new_extra_cppflags" ; then
7536
7537         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7538         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7539
7540 fi
7541
7542 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7543 # Filter out duplicates - this happens with badly-designed ".pc" files...
7544 for cf_add_1lib in $LIBS
7545 do
7546         for cf_add_2lib in $cf_add_libs
7547         do
7548                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7549                 then
7550                         cf_add_1lib=
7551                         break
7552                 fi
7553         done
7554         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7555 done
7556 LIBS="$cf_add_libs"
7557
7558                 cat >conftest.$ac_ext <<_ACEOF
7559 #line 7559 "configure"
7560 #include "confdefs.h"
7561 #include <${cf_cv_ncurses_header:-curses.h}>
7562 int
7563 main (void)
7564 {
7565 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7566   ;
7567   return 0;
7568 }
7569 _ACEOF
7570 rm -f conftest.$ac_objext conftest$ac_exeext
7571 if { (eval echo "$as_me:7571: \"$ac_link\"") >&5
7572   (eval $ac_link) 2>&5
7573   ac_status=$?
7574   echo "$as_me:7574: \$? = $ac_status" >&5
7575   (exit $ac_status); } &&
7576          { ac_try='test -s conftest$ac_exeext'
7577   { (eval echo "$as_me:7577: \"$ac_try\"") >&5
7578   (eval $ac_try) 2>&5
7579   ac_status=$?
7580   echo "$as_me:7580: \$? = $ac_status" >&5
7581   (exit $ac_status); }; }; then
7582   if test "$cross_compiling" = yes; then
7583   cf_have_ncuconfig=maybe
7584 else
7585   cat >conftest.$ac_ext <<_ACEOF
7586 #line 7586 "configure"
7587 #include "confdefs.h"
7588 #include <${cf_cv_ncurses_header:-curses.h}>
7589                                 int main(void)
7590                                 { char *xx = curses_version(); return (xx == 0); }
7591 _ACEOF
7592 rm -f conftest$ac_exeext
7593 if { (eval echo "$as_me:7593: \"$ac_link\"") >&5
7594   (eval $ac_link) 2>&5
7595   ac_status=$?
7596   echo "$as_me:7596: \$? = $ac_status" >&5
7597   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7598   { (eval echo "$as_me:7598: \"$ac_try\"") >&5
7599   (eval $ac_try) 2>&5
7600   ac_status=$?
7601   echo "$as_me:7601: \$? = $ac_status" >&5
7602   (exit $ac_status); }; }; then
7603   cf_have_ncuconfig=yes
7604 else
7605   echo "$as_me: program exited with status $ac_status" >&5
7606 echo "$as_me: failed program was:" >&5
7607 cat conftest.$ac_ext >&5
7608 cf_have_ncuconfig=no
7609 fi
7610 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7611 fi
7612 else
7613   echo "$as_me: failed program was:" >&5
7614 cat conftest.$ac_ext >&5
7615 cf_have_ncuconfig=no
7616 fi
7617 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7618                 echo "$as_me:7618: result: $cf_have_ncuconfig" >&5
7619 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7620                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7621                 if test "$cf_have_ncuconfig" != "yes"
7622                 then
7623                         CPPFLAGS="$cf_save_CPPFLAGS"
7624                         LIBS="$cf_save_LIBS"
7625                         NCURSES_CONFIG_PKG=none
7626                 else
7627
7628 cat >>confdefs.h <<\EOF
7629 #define NCURSES 1
7630 EOF
7631
7632                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7633
7634 echo "$as_me:7634: checking for terminfo header" >&5
7635 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7636 if test "${cf_cv_term_header+set}" = set; then
7637   echo $ECHO_N "(cached) $ECHO_C" >&6
7638 else
7639
7640 case ${cf_cv_ncurses_header} in
7641 (*/ncurses.h|*/ncursesw.h)
7642         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7643         ;;
7644 (*)
7645         cf_term_header=term.h
7646         ;;
7647 esac
7648
7649 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7650 do
7651 cat >conftest.$ac_ext <<_ACEOF
7652 #line 7652 "configure"
7653 #include "confdefs.h"
7654 #include <stdio.h>
7655 #include <${cf_cv_ncurses_header:-curses.h}>
7656 #include <$cf_test>
7657
7658 int
7659 main (void)
7660 {
7661 int x = auto_left_margin
7662   ;
7663   return 0;
7664 }
7665 _ACEOF
7666 rm -f conftest.$ac_objext
7667 if { (eval echo "$as_me:7667: \"$ac_compile\"") >&5
7668   (eval $ac_compile) 2>&5
7669   ac_status=$?
7670   echo "$as_me:7670: \$? = $ac_status" >&5
7671   (exit $ac_status); } &&
7672          { ac_try='test -s conftest.$ac_objext'
7673   { (eval echo "$as_me:7673: \"$ac_try\"") >&5
7674   (eval $ac_try) 2>&5
7675   ac_status=$?
7676   echo "$as_me:7676: \$? = $ac_status" >&5
7677   (exit $ac_status); }; }; then
7678
7679         cf_cv_term_header="$cf_test"
7680 else
7681   echo "$as_me: failed program was:" >&5
7682 cat conftest.$ac_ext >&5
7683
7684         cf_cv_term_header=unknown
7685
7686 fi
7687 rm -f conftest.$ac_objext conftest.$ac_ext
7688         test "$cf_cv_term_header" != unknown && break
7689 done
7690
7691 fi
7692 echo "$as_me:7692: result: $cf_cv_term_header" >&5
7693 echo "${ECHO_T}$cf_cv_term_header" >&6
7694
7695 # Set definitions to allow ifdef'ing to accommodate subdirectories
7696
7697 case $cf_cv_term_header in
7698 (*term.h)
7699
7700 cat >>confdefs.h <<\EOF
7701 #define HAVE_TERM_H 1
7702 EOF
7703
7704         ;;
7705 esac
7706
7707 case $cf_cv_term_header in
7708 (ncurses/term.h)
7709
7710 cat >>confdefs.h <<\EOF
7711 #define HAVE_NCURSES_TERM_H 1
7712 EOF
7713
7714         ;;
7715 (ncursesw/term.h)
7716
7717 cat >>confdefs.h <<\EOF
7718 #define HAVE_NCURSESW_TERM_H 1
7719 EOF
7720
7721         ;;
7722 esac
7723
7724                 fi
7725
7726         else
7727                 echo "$as_me:7727: result: no" >&5
7728 echo "${ECHO_T}no" >&6
7729                 NCURSES_CONFIG_PKG=none
7730         fi
7731 else
7732         NCURSES_CONFIG_PKG=none
7733 fi
7734
7735 if test "x$cf_have_ncuconfig" = "xno"; then
7736         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7737
7738 if test -n "$ac_tool_prefix"; then
7739   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7740   do
7741     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7742 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7743 echo "$as_me:7743: checking for $ac_word" >&5
7744 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7745 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7746   echo $ECHO_N "(cached) $ECHO_C" >&6
7747 else
7748   if test -n "$NCURSES_CONFIG"; then
7749   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7750 else
7751   ac_save_IFS=$IFS; IFS=$ac_path_separator
7752 ac_dummy="$PATH"
7753 for ac_dir in $ac_dummy; do
7754   IFS=$ac_save_IFS
7755   test -z "$ac_dir" && ac_dir=.
7756   $as_executable_p "$ac_dir/$ac_word" || continue
7757 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7758 echo "$as_me:7758: found $ac_dir/$ac_word" >&5
7759 break
7760 done
7761
7762 fi
7763 fi
7764 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7765 if test -n "$NCURSES_CONFIG"; then
7766   echo "$as_me:7766: result: $NCURSES_CONFIG" >&5
7767 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7768 else
7769   echo "$as_me:7769: result: no" >&5
7770 echo "${ECHO_T}no" >&6
7771 fi
7772
7773     test -n "$NCURSES_CONFIG" && break
7774   done
7775 fi
7776 if test -z "$NCURSES_CONFIG"; then
7777   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7778   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7779 do
7780   # Extract the first word of "$ac_prog", so it can be a program name with args.
7781 set dummy $ac_prog; ac_word=$2
7782 echo "$as_me:7782: checking for $ac_word" >&5
7783 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7784 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7785   echo $ECHO_N "(cached) $ECHO_C" >&6
7786 else
7787   if test -n "$ac_ct_NCURSES_CONFIG"; then
7788   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7789 else
7790   ac_save_IFS=$IFS; IFS=$ac_path_separator
7791 ac_dummy="$PATH"
7792 for ac_dir in $ac_dummy; do
7793   IFS=$ac_save_IFS
7794   test -z "$ac_dir" && ac_dir=.
7795   $as_executable_p "$ac_dir/$ac_word" || continue
7796 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7797 echo "$as_me:7797: found $ac_dir/$ac_word" >&5
7798 break
7799 done
7800
7801 fi
7802 fi
7803 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7804 if test -n "$ac_ct_NCURSES_CONFIG"; then
7805   echo "$as_me:7805: result: $ac_ct_NCURSES_CONFIG" >&5
7806 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7807 else
7808   echo "$as_me:7808: result: no" >&5
7809 echo "${ECHO_T}no" >&6
7810 fi
7811
7812   test -n "$ac_ct_NCURSES_CONFIG" && break
7813 done
7814 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7815
7816   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7817 fi
7818
7819         if test "$NCURSES_CONFIG" != none ; then
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 `$NCURSES_CONFIG --cflags`
7827 do
7828 case $cf_fix_cppflags in
7829 (no)
7830         case $cf_add_cflags in
7831         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7832                 case $cf_add_cflags in
7833                 (-D*)
7834                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7835
7836                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7837                                 && test -z "${cf_tst_cflags}" \
7838                                 && cf_fix_cppflags=yes
7839
7840                         if test $cf_fix_cppflags = yes ; then
7841
7842         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7843         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7844
7845                                 continue
7846                         elif test "${cf_tst_cflags}" = "\"'" ; then
7847
7848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7850
7851                                 continue
7852                         fi
7853                         ;;
7854                 esac
7855                 case "$CPPFLAGS" in
7856                 (*$cf_add_cflags)
7857                         ;;
7858                 (*)
7859                         case $cf_add_cflags in
7860                         (-D*)
7861                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7862
7863 CPPFLAGS=`echo "$CPPFLAGS" | \
7864         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7865                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7866
7867                                 ;;
7868                         esac
7869
7870         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7871         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7872
7873                         ;;
7874                 esac
7875                 ;;
7876         (*)
7877
7878         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7879         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7880
7881                 ;;
7882         esac
7883         ;;
7884 (yes)
7885
7886         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7887         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7888
7889         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7890
7891         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7892                 && test -z "${cf_tst_cflags}" \
7893                 && cf_fix_cppflags=no
7894         ;;
7895 esac
7896 done
7897
7898 if test -n "$cf_new_cflags" ; then
7899
7900         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7901         CFLAGS="${CFLAGS}$cf_new_cflags"
7902
7903 fi
7904
7905 if test -n "$cf_new_cppflags" ; then
7906
7907         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7908         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7909
7910 fi
7911
7912 if test -n "$cf_new_extra_cppflags" ; then
7913
7914         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7915         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7916
7917 fi
7918
7919 cf_add_libs="`$NCURSES_CONFIG --libs`"
7920 # Filter out duplicates - this happens with badly-designed ".pc" files...
7921 for cf_add_1lib in $LIBS
7922 do
7923         for cf_add_2lib in $cf_add_libs
7924         do
7925                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7926                 then
7927                         cf_add_1lib=
7928                         break
7929                 fi
7930         done
7931         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7932 done
7933 LIBS="$cf_add_libs"
7934
7935                 # even with config script, some packages use no-override for curses.h
7936
7937 echo "$as_me:7937: checking if we have identified curses headers" >&5
7938 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7939 if test "${cf_cv_ncurses_header+set}" = set; then
7940   echo $ECHO_N "(cached) $ECHO_C" >&6
7941 else
7942
7943 cf_cv_ncurses_header=none
7944 for cf_header in \
7945         ncurses.h $cf_cv_screen/ncurses.h \
7946         curses.h $cf_cv_screen/curses.h
7947 do
7948 cat >conftest.$ac_ext <<_ACEOF
7949 #line 7949 "configure"
7950 #include "confdefs.h"
7951 #include <${cf_header}>
7952 int
7953 main (void)
7954 {
7955 initscr(); tgoto("?", 0,0)
7956   ;
7957   return 0;
7958 }
7959 _ACEOF
7960 rm -f conftest.$ac_objext
7961 if { (eval echo "$as_me:7961: \"$ac_compile\"") >&5
7962   (eval $ac_compile) 2>&5
7963   ac_status=$?
7964   echo "$as_me:7964: \$? = $ac_status" >&5
7965   (exit $ac_status); } &&
7966          { ac_try='test -s conftest.$ac_objext'
7967   { (eval echo "$as_me:7967: \"$ac_try\"") >&5
7968   (eval $ac_try) 2>&5
7969   ac_status=$?
7970   echo "$as_me:7970: \$? = $ac_status" >&5
7971   (exit $ac_status); }; }; then
7972   cf_cv_ncurses_header=$cf_header; break
7973 else
7974   echo "$as_me: failed program was:" >&5
7975 cat conftest.$ac_ext >&5
7976 fi
7977 rm -f conftest.$ac_objext conftest.$ac_ext
7978 done
7979
7980 fi
7981 echo "$as_me:7981: result: $cf_cv_ncurses_header" >&5
7982 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7983
7984 if test "$cf_cv_ncurses_header" = none ; then
7985         { { echo "$as_me:7985: error: No curses header-files found" >&5
7986 echo "$as_me: error: No curses header-files found" >&2;}
7987    { (exit 1); exit 1; }; }
7988 fi
7989
7990 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7991
7992 for ac_header in $cf_cv_ncurses_header
7993 do
7994 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7995 echo "$as_me:7995: checking for $ac_header" >&5
7996 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7997 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7998   echo $ECHO_N "(cached) $ECHO_C" >&6
7999 else
8000   cat >conftest.$ac_ext <<_ACEOF
8001 #line 8001 "configure"
8002 #include "confdefs.h"
8003 #include <$ac_header>
8004 _ACEOF
8005 if { (eval echo "$as_me:8005: \"$ac_cpp conftest.$ac_ext\"") >&5
8006   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8007   ac_status=$?
8008   egrep -v '^ *\+' conftest.er1 >conftest.err
8009   rm -f conftest.er1
8010   cat conftest.err >&5
8011   echo "$as_me:8011: \$? = $ac_status" >&5
8012   (exit $ac_status); } >/dev/null; then
8013   if test -s conftest.err; then
8014     ac_cpp_err=$ac_c_preproc_warn_flag
8015   else
8016     ac_cpp_err=
8017   fi
8018 else
8019   ac_cpp_err=yes
8020 fi
8021 if test -z "$ac_cpp_err"; then
8022   eval "$as_ac_Header=yes"
8023 else
8024   echo "$as_me: failed program was:" >&5
8025   cat conftest.$ac_ext >&5
8026   eval "$as_ac_Header=no"
8027 fi
8028 rm -f conftest.err conftest.$ac_ext
8029 fi
8030 echo "$as_me:8030: result: `eval echo '${'$as_ac_Header'}'`" >&5
8031 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8032 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8033   cat >>confdefs.h <<EOF
8034 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8035 EOF
8036
8037 fi
8038 done
8039
8040 cat >>confdefs.h <<\EOF
8041 #define NCURSES 1
8042 EOF
8043
8044 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8045
8046                 cat >>confdefs.h <<EOF
8047 #define $cf_nculib_ROOT 1
8048 EOF
8049
8050                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8051
8052         else
8053
8054 cf_ncuhdr_root=$cf_cv_screen
8055
8056 test -n "$cf_cv_curses_dir" && \
8057 test "$cf_cv_curses_dir" != "no" && { \
8058
8059 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8060   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8061   do
8062         while test $cf_add_incdir != /usr/include
8063         do
8064           if test -d $cf_add_incdir
8065           then
8066                 cf_have_incdir=no
8067                 if test -n "$CFLAGS$CPPFLAGS" ; then
8068                   # a loop is needed to ensure we can add subdirs of existing dirs
8069                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8070                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8071                           cf_have_incdir=yes; break
8072                         fi
8073                   done
8074                 fi
8075
8076                 if test "$cf_have_incdir" = no ; then
8077                   if test "$cf_add_incdir" = /usr/local/include ; then
8078                         if test "$GCC" = yes
8079                         then
8080                           cf_save_CPPFLAGS=$CPPFLAGS
8081
8082         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8083         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8084
8085                           cat >conftest.$ac_ext <<_ACEOF
8086 #line 8086 "configure"
8087 #include "confdefs.h"
8088 #include <stdio.h>
8089 int
8090 main (void)
8091 {
8092 printf("Hello")
8093   ;
8094   return 0;
8095 }
8096 _ACEOF
8097 rm -f conftest.$ac_objext
8098 if { (eval echo "$as_me:8098: \"$ac_compile\"") >&5
8099   (eval $ac_compile) 2>&5
8100   ac_status=$?
8101   echo "$as_me:8101: \$? = $ac_status" >&5
8102   (exit $ac_status); } &&
8103          { ac_try='test -s conftest.$ac_objext'
8104   { (eval echo "$as_me:8104: \"$ac_try\"") >&5
8105   (eval $ac_try) 2>&5
8106   ac_status=$?
8107   echo "$as_me:8107: \$? = $ac_status" >&5
8108   (exit $ac_status); }; }; then
8109   :
8110 else
8111   echo "$as_me: failed program was:" >&5
8112 cat conftest.$ac_ext >&5
8113 cf_have_incdir=yes
8114 fi
8115 rm -f conftest.$ac_objext conftest.$ac_ext
8116                           CPPFLAGS=$cf_save_CPPFLAGS
8117                         fi
8118                   fi
8119                 fi
8120
8121                 if test "$cf_have_incdir" = no ; then
8122                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8123
8124 echo "${as_me:-configure}:8124: testing adding $cf_add_incdir to include-path ..." 1>&5
8125
8126                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8127
8128                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8129                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8130                   cf_add_incdir="$cf_top_incdir"
8131                 else
8132                   break
8133                 fi
8134           else
8135                 break
8136           fi
8137         done
8138   done
8139 fi
8140
8141 }
8142
8143 echo "$as_me:8143: checking for $cf_ncuhdr_root header in include-path" >&5
8144 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8145 if test "${cf_cv_ncurses_h+set}" = set; then
8146   echo $ECHO_N "(cached) $ECHO_C" >&6
8147 else
8148
8149         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8150         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8151         for cf_header in $cf_header_list
8152         do
8153
8154         cat >conftest.$ac_ext <<_ACEOF
8155 #line 8155 "configure"
8156 #include "confdefs.h"
8157
8158 #include <$cf_header>
8159 int
8160 main (void)
8161 {
8162
8163 #ifdef NCURSES_VERSION
8164
8165 printf("%s\n", NCURSES_VERSION);
8166 #else
8167 #ifdef __NCURSES_H
8168 printf("old\n");
8169 #else
8170         make an error
8171 #endif
8172 #endif
8173
8174   ;
8175   return 0;
8176 }
8177 _ACEOF
8178 rm -f conftest.$ac_objext
8179 if { (eval echo "$as_me:8179: \"$ac_compile\"") >&5
8180   (eval $ac_compile) 2>&5
8181   ac_status=$?
8182   echo "$as_me:8182: \$? = $ac_status" >&5
8183   (exit $ac_status); } &&
8184          { ac_try='test -s conftest.$ac_objext'
8185   { (eval echo "$as_me:8185: \"$ac_try\"") >&5
8186   (eval $ac_try) 2>&5
8187   ac_status=$?
8188   echo "$as_me:8188: \$? = $ac_status" >&5
8189   (exit $ac_status); }; }; then
8190   cf_cv_ncurses_h=$cf_header
8191
8192 else
8193   echo "$as_me: failed program was:" >&5
8194 cat conftest.$ac_ext >&5
8195 cf_cv_ncurses_h=no
8196 fi
8197 rm -f conftest.$ac_objext conftest.$ac_ext
8198
8199                 test "$cf_cv_ncurses_h" != no && break
8200         done
8201
8202 fi
8203 echo "$as_me:8203: result: $cf_cv_ncurses_h" >&5
8204 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8205
8206 if test "$cf_cv_ncurses_h" != no ; then
8207         cf_cv_ncurses_header=$cf_cv_ncurses_h
8208 else
8209
8210 echo "$as_me:8210: checking for $cf_ncuhdr_root include-path" >&5
8211 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8212 if test "${cf_cv_ncurses_h2+set}" = set; then
8213   echo $ECHO_N "(cached) $ECHO_C" >&6
8214 else
8215
8216         test -n "$verbose" && echo
8217
8218 cf_search=
8219
8220 # collect the current set of include-directories from compiler flags
8221 cf_header_path_list=""
8222 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8223         for cf_header_path in $CPPFLAGS $CFLAGS
8224         do
8225                 case $cf_header_path in
8226                 (-I*)
8227                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8228
8229 test "x$cf_header_path" != "xNONE" && \
8230 test -d "$cf_header_path" && \
8231  {
8232         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8233         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8234         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8235         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8236         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8237         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"
8238 }
8239
8240                         cf_header_path_list="$cf_header_path_list $cf_search"
8241                         ;;
8242                 esac
8243         done
8244 fi
8245
8246 # add the variations for the package we are looking for
8247
8248 cf_search=
8249
8250 test "x$prefix" != "xNONE" && \
8251 test -d "$prefix" && \
8252  {
8253         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8254         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8255         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8256         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8257         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8258         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8259 }
8260
8261 for cf_subdir_prefix in \
8262         /usr \
8263         /usr/local \
8264         /usr/pkg \
8265         /opt \
8266         /opt/local \
8267         $HOME
8268 do
8269
8270 test "x$cf_subdir_prefix" != "x$prefix" && \
8271 test -d "$cf_subdir_prefix" && \
8272 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8273         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8274         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8275         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8276         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8277         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8278         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8279 }
8280
8281 done
8282
8283 test "$includedir" != NONE && \
8284 test "$includedir" != "/usr/include" && \
8285 test -d "$includedir" && {
8286         test -d $includedir &&    cf_search="$cf_search $includedir"
8287         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8288 }
8289
8290 test "$oldincludedir" != NONE && \
8291 test "$oldincludedir" != "/usr/include" && \
8292 test -d "$oldincludedir" && {
8293         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8294         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8295 }
8296
8297 cf_search="$cf_search $cf_header_path_list"
8298
8299         test -n "$verbose" && echo search path $cf_search
8300         cf_save2_CPPFLAGS="$CPPFLAGS"
8301         for cf_incdir in $cf_search
8302         do
8303
8304 if test -n "$cf_incdir" ; then
8305   for cf_add_incdir in $cf_incdir
8306   do
8307         while test $cf_add_incdir != /usr/include
8308         do
8309           if test -d $cf_add_incdir
8310           then
8311                 cf_have_incdir=no
8312                 if test -n "$CFLAGS$CPPFLAGS" ; then
8313                   # a loop is needed to ensure we can add subdirs of existing dirs
8314                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8315                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8316                           cf_have_incdir=yes; break
8317                         fi
8318                   done
8319                 fi
8320
8321                 if test "$cf_have_incdir" = no ; then
8322                   if test "$cf_add_incdir" = /usr/local/include ; then
8323                         if test "$GCC" = yes
8324                         then
8325                           cf_save_CPPFLAGS=$CPPFLAGS
8326
8327         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8328         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8329
8330                           cat >conftest.$ac_ext <<_ACEOF
8331 #line 8331 "configure"
8332 #include "confdefs.h"
8333 #include <stdio.h>
8334 int
8335 main (void)
8336 {
8337 printf("Hello")
8338   ;
8339   return 0;
8340 }
8341 _ACEOF
8342 rm -f conftest.$ac_objext
8343 if { (eval echo "$as_me:8343: \"$ac_compile\"") >&5
8344   (eval $ac_compile) 2>&5
8345   ac_status=$?
8346   echo "$as_me:8346: \$? = $ac_status" >&5
8347   (exit $ac_status); } &&
8348          { ac_try='test -s conftest.$ac_objext'
8349   { (eval echo "$as_me:8349: \"$ac_try\"") >&5
8350   (eval $ac_try) 2>&5
8351   ac_status=$?
8352   echo "$as_me:8352: \$? = $ac_status" >&5
8353   (exit $ac_status); }; }; then
8354   :
8355 else
8356   echo "$as_me: failed program was:" >&5
8357 cat conftest.$ac_ext >&5
8358 cf_have_incdir=yes
8359 fi
8360 rm -f conftest.$ac_objext conftest.$ac_ext
8361                           CPPFLAGS=$cf_save_CPPFLAGS
8362                         fi
8363                   fi
8364                 fi
8365
8366                 if test "$cf_have_incdir" = no ; then
8367                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8368
8369 echo "${as_me:-configure}:8369: testing adding $cf_add_incdir to include-path ..." 1>&5
8370
8371                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8372
8373                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8374                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8375                   cf_add_incdir="$cf_top_incdir"
8376                 else
8377                   break
8378                 fi
8379           else
8380                 break
8381           fi
8382         done
8383   done
8384 fi
8385
8386                 for cf_header in \
8387                         ncurses.h \
8388                         curses.h
8389                 do
8390
8391         cat >conftest.$ac_ext <<_ACEOF
8392 #line 8392 "configure"
8393 #include "confdefs.h"
8394
8395 #include <$cf_header>
8396 int
8397 main (void)
8398 {
8399
8400 #ifdef NCURSES_VERSION
8401
8402 printf("%s\n", NCURSES_VERSION);
8403 #else
8404 #ifdef __NCURSES_H
8405 printf("old\n");
8406 #else
8407         make an error
8408 #endif
8409 #endif
8410
8411   ;
8412   return 0;
8413 }
8414 _ACEOF
8415 rm -f conftest.$ac_objext
8416 if { (eval echo "$as_me:8416: \"$ac_compile\"") >&5
8417   (eval $ac_compile) 2>&5
8418   ac_status=$?
8419   echo "$as_me:8419: \$? = $ac_status" >&5
8420   (exit $ac_status); } &&
8421          { ac_try='test -s conftest.$ac_objext'
8422   { (eval echo "$as_me:8422: \"$ac_try\"") >&5
8423   (eval $ac_try) 2>&5
8424   ac_status=$?
8425   echo "$as_me:8425: \$? = $ac_status" >&5
8426   (exit $ac_status); }; }; then
8427   cf_cv_ncurses_h2=$cf_header
8428
8429 else
8430   echo "$as_me: failed program was:" >&5
8431 cat conftest.$ac_ext >&5
8432 cf_cv_ncurses_h2=no
8433 fi
8434 rm -f conftest.$ac_objext conftest.$ac_ext
8435
8436                         if test "$cf_cv_ncurses_h2" != no ; then
8437                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8438                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8439                                 break
8440                         fi
8441                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8442                 done
8443                 CPPFLAGS="$cf_save2_CPPFLAGS"
8444                 test "$cf_cv_ncurses_h2" != no && break
8445         done
8446         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8446: error: not found" >&5
8447 echo "$as_me: error: not found" >&2;}
8448    { (exit 1); exit 1; }; }
8449
8450 fi
8451 echo "$as_me:8451: result: $cf_cv_ncurses_h2" >&5
8452 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8453
8454         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8455         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8456         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8457                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8458         fi
8459
8460 if test -n "$cf_1st_incdir" ; then
8461   for cf_add_incdir in $cf_1st_incdir
8462   do
8463         while test $cf_add_incdir != /usr/include
8464         do
8465           if test -d $cf_add_incdir
8466           then
8467                 cf_have_incdir=no
8468                 if test -n "$CFLAGS$CPPFLAGS" ; then
8469                   # a loop is needed to ensure we can add subdirs of existing dirs
8470                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8471                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8472                           cf_have_incdir=yes; break
8473                         fi
8474                   done
8475                 fi
8476
8477                 if test "$cf_have_incdir" = no ; then
8478                   if test "$cf_add_incdir" = /usr/local/include ; then
8479                         if test "$GCC" = yes
8480                         then
8481                           cf_save_CPPFLAGS=$CPPFLAGS
8482
8483         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8484         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8485
8486                           cat >conftest.$ac_ext <<_ACEOF
8487 #line 8487 "configure"
8488 #include "confdefs.h"
8489 #include <stdio.h>
8490 int
8491 main (void)
8492 {
8493 printf("Hello")
8494   ;
8495   return 0;
8496 }
8497 _ACEOF
8498 rm -f conftest.$ac_objext
8499 if { (eval echo "$as_me:8499: \"$ac_compile\"") >&5
8500   (eval $ac_compile) 2>&5
8501   ac_status=$?
8502   echo "$as_me:8502: \$? = $ac_status" >&5
8503   (exit $ac_status); } &&
8504          { ac_try='test -s conftest.$ac_objext'
8505   { (eval echo "$as_me:8505: \"$ac_try\"") >&5
8506   (eval $ac_try) 2>&5
8507   ac_status=$?
8508   echo "$as_me:8508: \$? = $ac_status" >&5
8509   (exit $ac_status); }; }; then
8510   :
8511 else
8512   echo "$as_me: failed program was:" >&5
8513 cat conftest.$ac_ext >&5
8514 cf_have_incdir=yes
8515 fi
8516 rm -f conftest.$ac_objext conftest.$ac_ext
8517                           CPPFLAGS=$cf_save_CPPFLAGS
8518                         fi
8519                   fi
8520                 fi
8521
8522                 if test "$cf_have_incdir" = no ; then
8523                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8524
8525 echo "${as_me:-configure}:8525: testing adding $cf_add_incdir to include-path ..." 1>&5
8526
8527                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8528
8529                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8530                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8531                   cf_add_incdir="$cf_top_incdir"
8532                 else
8533                   break
8534                 fi
8535           else
8536                 break
8537           fi
8538         done
8539   done
8540 fi
8541
8542 fi
8543
8544 # Set definitions to allow ifdef'ing for ncurses.h
8545
8546 case $cf_cv_ncurses_header in
8547 (*ncurses.h)
8548
8549 cat >>confdefs.h <<\EOF
8550 #define HAVE_NCURSES_H 1
8551 EOF
8552
8553         ;;
8554 esac
8555
8556 case $cf_cv_ncurses_header in
8557 (ncurses/curses.h|ncurses/ncurses.h)
8558
8559 cat >>confdefs.h <<\EOF
8560 #define HAVE_NCURSES_NCURSES_H 1
8561 EOF
8562
8563         ;;
8564 (ncursesw/curses.h|ncursesw/ncurses.h)
8565
8566 cat >>confdefs.h <<\EOF
8567 #define HAVE_NCURSESW_NCURSES_H 1
8568 EOF
8569
8570         ;;
8571 esac
8572
8573 echo "$as_me:8573: checking for terminfo header" >&5
8574 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8575 if test "${cf_cv_term_header+set}" = set; then
8576   echo $ECHO_N "(cached) $ECHO_C" >&6
8577 else
8578
8579 case ${cf_cv_ncurses_header} in
8580 (*/ncurses.h|*/ncursesw.h)
8581         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8582         ;;
8583 (*)
8584         cf_term_header=term.h
8585         ;;
8586 esac
8587
8588 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8589 do
8590 cat >conftest.$ac_ext <<_ACEOF
8591 #line 8591 "configure"
8592 #include "confdefs.h"
8593 #include <stdio.h>
8594 #include <${cf_cv_ncurses_header:-curses.h}>
8595 #include <$cf_test>
8596
8597 int
8598 main (void)
8599 {
8600 int x = auto_left_margin
8601   ;
8602   return 0;
8603 }
8604 _ACEOF
8605 rm -f conftest.$ac_objext
8606 if { (eval echo "$as_me:8606: \"$ac_compile\"") >&5
8607   (eval $ac_compile) 2>&5
8608   ac_status=$?
8609   echo "$as_me:8609: \$? = $ac_status" >&5
8610   (exit $ac_status); } &&
8611          { ac_try='test -s conftest.$ac_objext'
8612   { (eval echo "$as_me:8612: \"$ac_try\"") >&5
8613   (eval $ac_try) 2>&5
8614   ac_status=$?
8615   echo "$as_me:8615: \$? = $ac_status" >&5
8616   (exit $ac_status); }; }; then
8617
8618         cf_cv_term_header="$cf_test"
8619 else
8620   echo "$as_me: failed program was:" >&5
8621 cat conftest.$ac_ext >&5
8622
8623         cf_cv_term_header=unknown
8624
8625 fi
8626 rm -f conftest.$ac_objext conftest.$ac_ext
8627         test "$cf_cv_term_header" != unknown && break
8628 done
8629
8630 fi
8631 echo "$as_me:8631: result: $cf_cv_term_header" >&5
8632 echo "${ECHO_T}$cf_cv_term_header" >&6
8633
8634 # Set definitions to allow ifdef'ing to accommodate subdirectories
8635
8636 case $cf_cv_term_header in
8637 (*term.h)
8638
8639 cat >>confdefs.h <<\EOF
8640 #define HAVE_TERM_H 1
8641 EOF
8642
8643         ;;
8644 esac
8645
8646 case $cf_cv_term_header in
8647 (ncurses/term.h)
8648
8649 cat >>confdefs.h <<\EOF
8650 #define HAVE_NCURSES_TERM_H 1
8651 EOF
8652
8653         ;;
8654 (ncursesw/term.h)
8655
8656 cat >>confdefs.h <<\EOF
8657 #define HAVE_NCURSESW_TERM_H 1
8658 EOF
8659
8660         ;;
8661 esac
8662
8663 # some applications need this, but should check for NCURSES_VERSION
8664
8665 cat >>confdefs.h <<\EOF
8666 #define NCURSES 1
8667 EOF
8668
8669 echo "$as_me:8669: checking for ncurses version" >&5
8670 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8671 if test "${cf_cv_ncurses_version+set}" = set; then
8672   echo $ECHO_N "(cached) $ECHO_C" >&6
8673 else
8674
8675         cf_cv_ncurses_version=no
8676         cf_tempfile=out$$
8677         rm -f $cf_tempfile
8678         if test "$cross_compiling" = yes; then
8679
8680         # This will not work if the preprocessor splits the line after the
8681         # Autoconf token.  The 'unproto' program does that.
8682         cat > conftest.$ac_ext <<EOF
8683 #include <${cf_cv_ncurses_header:-curses.h}>
8684 #undef Autoconf
8685 #ifdef NCURSES_VERSION
8686 Autoconf NCURSES_VERSION
8687 #else
8688 #ifdef __NCURSES_H
8689 Autoconf "old"
8690 #endif
8691 ;
8692 #endif
8693 EOF
8694         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8695         { (eval echo "$as_me:8695: \"$cf_try\"") >&5
8696   (eval $cf_try) 2>&5
8697   ac_status=$?
8698   echo "$as_me:8698: \$? = $ac_status" >&5
8699   (exit $ac_status); }
8700         if test -f conftest.out ; then
8701                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8702                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8703                 rm -f conftest.out
8704         fi
8705
8706 else
8707   cat >conftest.$ac_ext <<_ACEOF
8708 #line 8708 "configure"
8709 #include "confdefs.h"
8710
8711 #include <${cf_cv_ncurses_header:-curses.h}>
8712 #include <stdio.h>
8713 int main(void)
8714 {
8715         FILE *fp = fopen("$cf_tempfile", "w");
8716 #ifdef NCURSES_VERSION
8717 # ifdef NCURSES_VERSION_PATCH
8718         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8719 # else
8720         fprintf(fp, "%s\n", NCURSES_VERSION);
8721 # endif
8722 #else
8723 # ifdef __NCURSES_H
8724         fprintf(fp, "old\n");
8725 # else
8726         make an error
8727 # endif
8728 #endif
8729         ${cf_cv_main_return:-return}(0);
8730 }
8731 _ACEOF
8732 rm -f conftest$ac_exeext
8733 if { (eval echo "$as_me:8733: \"$ac_link\"") >&5
8734   (eval $ac_link) 2>&5
8735   ac_status=$?
8736   echo "$as_me:8736: \$? = $ac_status" >&5
8737   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8738   { (eval echo "$as_me:8738: \"$ac_try\"") >&5
8739   (eval $ac_try) 2>&5
8740   ac_status=$?
8741   echo "$as_me:8741: \$? = $ac_status" >&5
8742   (exit $ac_status); }; }; then
8743
8744         cf_cv_ncurses_version=`cat $cf_tempfile`
8745 else
8746   echo "$as_me: program exited with status $ac_status" >&5
8747 echo "$as_me: failed program was:" >&5
8748 cat conftest.$ac_ext >&5
8749 fi
8750 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8751 fi
8752         rm -f $cf_tempfile
8753
8754 fi
8755 echo "$as_me:8755: result: $cf_cv_ncurses_version" >&5
8756 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8757 test "$cf_cv_ncurses_version" = no ||
8758 cat >>confdefs.h <<\EOF
8759 #define NCURSES 1
8760 EOF
8761
8762 cf_nculib_root=$cf_cv_screen
8763         # This works, except for the special case where we find gpm, but
8764         # ncurses is in a nonstandard location via $LIBS, and we really want
8765         # to link gpm.
8766 cf_ncurses_LIBS=""
8767 cf_ncurses_SAVE="$LIBS"
8768 echo "$as_me:8768: checking for Gpm_Open in -lgpm" >&5
8769 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8770 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8771   echo $ECHO_N "(cached) $ECHO_C" >&6
8772 else
8773   ac_check_lib_save_LIBS=$LIBS
8774 LIBS="-lgpm  $LIBS"
8775 cat >conftest.$ac_ext <<_ACEOF
8776 #line 8776 "configure"
8777 #include "confdefs.h"
8778
8779 /* Override any gcc2 internal prototype to avoid an error.  */
8780 #ifdef __cplusplus
8781 extern "C"
8782 #endif
8783 /* We use char because int might match the return type of a gcc2
8784    builtin and then its argument prototype would still apply.  */
8785 char Gpm_Open ();
8786 int
8787 main (void)
8788 {
8789 Gpm_Open ();
8790   ;
8791   return 0;
8792 }
8793 _ACEOF
8794 rm -f conftest.$ac_objext conftest$ac_exeext
8795 if { (eval echo "$as_me:8795: \"$ac_link\"") >&5
8796   (eval $ac_link) 2>&5
8797   ac_status=$?
8798   echo "$as_me:8798: \$? = $ac_status" >&5
8799   (exit $ac_status); } &&
8800          { ac_try='test -s conftest$ac_exeext'
8801   { (eval echo "$as_me:8801: \"$ac_try\"") >&5
8802   (eval $ac_try) 2>&5
8803   ac_status=$?
8804   echo "$as_me:8804: \$? = $ac_status" >&5
8805   (exit $ac_status); }; }; then
8806   ac_cv_lib_gpm_Gpm_Open=yes
8807 else
8808   echo "$as_me: failed program was:" >&5
8809 cat conftest.$ac_ext >&5
8810 ac_cv_lib_gpm_Gpm_Open=no
8811 fi
8812 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8813 LIBS=$ac_check_lib_save_LIBS
8814 fi
8815 echo "$as_me:8815: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8816 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8817 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8818   echo "$as_me:8818: checking for initscr in -lgpm" >&5
8819 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8820 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8821   echo $ECHO_N "(cached) $ECHO_C" >&6
8822 else
8823   ac_check_lib_save_LIBS=$LIBS
8824 LIBS="-lgpm  $LIBS"
8825 cat >conftest.$ac_ext <<_ACEOF
8826 #line 8826 "configure"
8827 #include "confdefs.h"
8828
8829 /* Override any gcc2 internal prototype to avoid an error.  */
8830 #ifdef __cplusplus
8831 extern "C"
8832 #endif
8833 /* We use char because int might match the return type of a gcc2
8834    builtin and then its argument prototype would still apply.  */
8835 char initscr ();
8836 int
8837 main (void)
8838 {
8839 initscr ();
8840   ;
8841   return 0;
8842 }
8843 _ACEOF
8844 rm -f conftest.$ac_objext conftest$ac_exeext
8845 if { (eval echo "$as_me:8845: \"$ac_link\"") >&5
8846   (eval $ac_link) 2>&5
8847   ac_status=$?
8848   echo "$as_me:8848: \$? = $ac_status" >&5
8849   (exit $ac_status); } &&
8850          { ac_try='test -s conftest$ac_exeext'
8851   { (eval echo "$as_me:8851: \"$ac_try\"") >&5
8852   (eval $ac_try) 2>&5
8853   ac_status=$?
8854   echo "$as_me:8854: \$? = $ac_status" >&5
8855   (exit $ac_status); }; }; then
8856   ac_cv_lib_gpm_initscr=yes
8857 else
8858   echo "$as_me: failed program was:" >&5
8859 cat conftest.$ac_ext >&5
8860 ac_cv_lib_gpm_initscr=no
8861 fi
8862 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8863 LIBS=$ac_check_lib_save_LIBS
8864 fi
8865 echo "$as_me:8865: result: $ac_cv_lib_gpm_initscr" >&5
8866 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8867 if test $ac_cv_lib_gpm_initscr = yes; then
8868   LIBS="$cf_ncurses_SAVE"
8869 else
8870   cf_ncurses_LIBS="-lgpm"
8871 fi
8872
8873 fi
8874
8875 case $host_os in
8876 (freebsd*)
8877         # This is only necessary if you are linking against an obsolete
8878         # version of ncurses (but it should do no harm, since it's static).
8879         if test "$cf_nculib_root" = ncurses ; then
8880                 echo "$as_me:8880: checking for tgoto in -lmytinfo" >&5
8881 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8882 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8883   echo $ECHO_N "(cached) $ECHO_C" >&6
8884 else
8885   ac_check_lib_save_LIBS=$LIBS
8886 LIBS="-lmytinfo  $LIBS"
8887 cat >conftest.$ac_ext <<_ACEOF
8888 #line 8888 "configure"
8889 #include "confdefs.h"
8890
8891 /* Override any gcc2 internal prototype to avoid an error.  */
8892 #ifdef __cplusplus
8893 extern "C"
8894 #endif
8895 /* We use char because int might match the return type of a gcc2
8896    builtin and then its argument prototype would still apply.  */
8897 char tgoto ();
8898 int
8899 main (void)
8900 {
8901 tgoto ();
8902   ;
8903   return 0;
8904 }
8905 _ACEOF
8906 rm -f conftest.$ac_objext conftest$ac_exeext
8907 if { (eval echo "$as_me:8907: \"$ac_link\"") >&5
8908   (eval $ac_link) 2>&5
8909   ac_status=$?
8910   echo "$as_me:8910: \$? = $ac_status" >&5
8911   (exit $ac_status); } &&
8912          { ac_try='test -s conftest$ac_exeext'
8913   { (eval echo "$as_me:8913: \"$ac_try\"") >&5
8914   (eval $ac_try) 2>&5
8915   ac_status=$?
8916   echo "$as_me:8916: \$? = $ac_status" >&5
8917   (exit $ac_status); }; }; then
8918   ac_cv_lib_mytinfo_tgoto=yes
8919 else
8920   echo "$as_me: failed program was:" >&5
8921 cat conftest.$ac_ext >&5
8922 ac_cv_lib_mytinfo_tgoto=no
8923 fi
8924 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8925 LIBS=$ac_check_lib_save_LIBS
8926 fi
8927 echo "$as_me:8927: result: $ac_cv_lib_mytinfo_tgoto" >&5
8928 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8929 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8930   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8931 fi
8932
8933         fi
8934         ;;
8935 esac
8936
8937 cf_add_libs="$cf_ncurses_LIBS"
8938 # Filter out duplicates - this happens with badly-designed ".pc" files...
8939 for cf_add_1lib in $LIBS
8940 do
8941         for cf_add_2lib in $cf_add_libs
8942         do
8943                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8944                 then
8945                         cf_add_1lib=
8946                         break
8947                 fi
8948         done
8949         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8950 done
8951 LIBS="$cf_add_libs"
8952
8953 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8954 then
8955
8956 cf_add_libs="-l$cf_nculib_root"
8957 # Filter out duplicates - this happens with badly-designed ".pc" files...
8958 for cf_add_1lib in $LIBS
8959 do
8960         for cf_add_2lib in $cf_add_libs
8961         do
8962                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8963                 then
8964                         cf_add_1lib=
8965                         break
8966                 fi
8967         done
8968         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8969 done
8970 LIBS="$cf_add_libs"
8971
8972 else
8973
8974         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8975         cf_libdir=""
8976         echo "$as_me:8976: checking for initscr" >&5
8977 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8978 if test "${ac_cv_func_initscr+set}" = set; then
8979   echo $ECHO_N "(cached) $ECHO_C" >&6
8980 else
8981   cat >conftest.$ac_ext <<_ACEOF
8982 #line 8982 "configure"
8983 #include "confdefs.h"
8984 #define initscr autoconf_temporary
8985 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8986 #undef initscr
8987
8988 #ifdef __cplusplus
8989 extern "C"
8990 #endif
8991
8992 /* We use char because int might match the return type of a gcc2
8993    builtin and then its argument prototype would still apply.  */
8994 char initscr (void);
8995
8996 int
8997 main (void)
8998 {
8999
9000 /* The GNU C library defines stubs for functions which it implements
9001     to always fail with ENOSYS.  Some functions are actually named
9002     something starting with __ and the normal name is an alias.  */
9003 #if defined (__stub_initscr) || defined (__stub___initscr)
9004 #error found stub for initscr
9005 #endif
9006
9007         return initscr ();
9008   ;
9009   return 0;
9010 }
9011 _ACEOF
9012 rm -f conftest.$ac_objext conftest$ac_exeext
9013 if { (eval echo "$as_me:9013: \"$ac_link\"") >&5
9014   (eval $ac_link) 2>&5
9015   ac_status=$?
9016   echo "$as_me:9016: \$? = $ac_status" >&5
9017   (exit $ac_status); } &&
9018          { ac_try='test -s conftest$ac_exeext'
9019   { (eval echo "$as_me:9019: \"$ac_try\"") >&5
9020   (eval $ac_try) 2>&5
9021   ac_status=$?
9022   echo "$as_me:9022: \$? = $ac_status" >&5
9023   (exit $ac_status); }; }; then
9024   ac_cv_func_initscr=yes
9025 else
9026   echo "$as_me: failed program was:" >&5
9027 cat conftest.$ac_ext >&5
9028 ac_cv_func_initscr=no
9029 fi
9030 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9031 fi
9032 echo "$as_me:9032: result: $ac_cv_func_initscr" >&5
9033 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9034 if test $ac_cv_func_initscr = yes; then
9035   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9036 else
9037
9038                 cf_save_LIBS="$LIBS"
9039                 echo "$as_me:9039: checking for initscr in -l$cf_nculib_root" >&5
9040 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9041                 LIBS="-l$cf_nculib_root $LIBS"
9042                 cat >conftest.$ac_ext <<_ACEOF
9043 #line 9043 "configure"
9044 #include "confdefs.h"
9045 #include <${cf_cv_ncurses_header:-curses.h}>
9046 int
9047 main (void)
9048 {
9049 initscr()
9050   ;
9051   return 0;
9052 }
9053 _ACEOF
9054 rm -f conftest.$ac_objext conftest$ac_exeext
9055 if { (eval echo "$as_me:9055: \"$ac_link\"") >&5
9056   (eval $ac_link) 2>&5
9057   ac_status=$?
9058   echo "$as_me:9058: \$? = $ac_status" >&5
9059   (exit $ac_status); } &&
9060          { ac_try='test -s conftest$ac_exeext'
9061   { (eval echo "$as_me:9061: \"$ac_try\"") >&5
9062   (eval $ac_try) 2>&5
9063   ac_status=$?
9064   echo "$as_me:9064: \$? = $ac_status" >&5
9065   (exit $ac_status); }; }; then
9066   echo "$as_me:9066: result: yes" >&5
9067 echo "${ECHO_T}yes" >&6
9068                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9069
9070 else
9071   echo "$as_me: failed program was:" >&5
9072 cat conftest.$ac_ext >&5
9073 echo "$as_me:9073: result: no" >&5
9074 echo "${ECHO_T}no" >&6
9075
9076 cf_search=
9077 cf_library_path_list=""
9078 if test -n "${LDFLAGS}${LIBS}" ; then
9079         for cf_library_path in $LDFLAGS $LIBS
9080         do
9081                 case $cf_library_path in
9082                 (-L*)
9083                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9084
9085 test "x$cf_library_path" != "xNONE" && \
9086 test -d "$cf_library_path" && \
9087  {
9088         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9089         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9090         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9091         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9092         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9093         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"
9094 }
9095
9096                         cf_library_path_list="$cf_library_path_list $cf_search"
9097                         ;;
9098                 esac
9099         done
9100 fi
9101
9102 cf_search=
9103
9104 test "x$prefix" != "xNONE" && \
9105 test -d "$prefix" && \
9106  {
9107         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9108         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9109         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9110         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9111         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9112         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9113 }
9114
9115 for cf_subdir_prefix in \
9116         /usr \
9117         /usr/local \
9118         /usr/pkg \
9119         /opt \
9120         /opt/local \
9121         $HOME
9122 do
9123
9124 test "x$cf_subdir_prefix" != "x$prefix" && \
9125 test -d "$cf_subdir_prefix" && \
9126 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9127         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9128         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9129         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9130         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9131         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9132         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
9133 }
9134
9135 done
9136
9137 cf_search="$cf_library_path_list $cf_search"
9138
9139                         for cf_libdir in $cf_search
9140                         do
9141                                 echo "$as_me:9141: checking for -l$cf_nculib_root in $cf_libdir" >&5
9142 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9143                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9144                                 cat >conftest.$ac_ext <<_ACEOF
9145 #line 9145 "configure"
9146 #include "confdefs.h"
9147 #include <${cf_cv_ncurses_header:-curses.h}>
9148 int
9149 main (void)
9150 {
9151 initscr()
9152   ;
9153   return 0;
9154 }
9155 _ACEOF
9156 rm -f conftest.$ac_objext conftest$ac_exeext
9157 if { (eval echo "$as_me:9157: \"$ac_link\"") >&5
9158   (eval $ac_link) 2>&5
9159   ac_status=$?
9160   echo "$as_me:9160: \$? = $ac_status" >&5
9161   (exit $ac_status); } &&
9162          { ac_try='test -s conftest$ac_exeext'
9163   { (eval echo "$as_me:9163: \"$ac_try\"") >&5
9164   (eval $ac_try) 2>&5
9165   ac_status=$?
9166   echo "$as_me:9166: \$? = $ac_status" >&5
9167   (exit $ac_status); }; }; then
9168   echo "$as_me:9168: result: yes" >&5
9169 echo "${ECHO_T}yes" >&6
9170                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9171                                          break
9172 else
9173   echo "$as_me: failed program was:" >&5
9174 cat conftest.$ac_ext >&5
9175 echo "$as_me:9175: result: no" >&5
9176 echo "${ECHO_T}no" >&6
9177                                          LIBS="$cf_save_LIBS"
9178 fi
9179 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9180                         done
9181
9182 fi
9183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9184
9185 fi
9186
9187 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9188
9189 if test $cf_found_library = no ; then
9190         { { echo "$as_me:9190: error: Cannot link $cf_nculib_root library" >&5
9191 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9192    { (exit 1); exit 1; }; }
9193 fi
9194
9195 fi
9196
9197 if test -n "$cf_ncurses_LIBS" ; then
9198         echo "$as_me:9198: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9199 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9200         cf_ncurses_SAVE="$LIBS"
9201         for p in $cf_ncurses_LIBS ; do
9202                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9203                 if test "$q" != "$LIBS" ; then
9204                         LIBS="$q"
9205                 fi
9206         done
9207         cat >conftest.$ac_ext <<_ACEOF
9208 #line 9208 "configure"
9209 #include "confdefs.h"
9210 #include <${cf_cv_ncurses_header:-curses.h}>
9211 int
9212 main (void)
9213 {
9214 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9215   ;
9216   return 0;
9217 }
9218 _ACEOF
9219 rm -f conftest.$ac_objext conftest$ac_exeext
9220 if { (eval echo "$as_me:9220: \"$ac_link\"") >&5
9221   (eval $ac_link) 2>&5
9222   ac_status=$?
9223   echo "$as_me:9223: \$? = $ac_status" >&5
9224   (exit $ac_status); } &&
9225          { ac_try='test -s conftest$ac_exeext'
9226   { (eval echo "$as_me:9226: \"$ac_try\"") >&5
9227   (eval $ac_try) 2>&5
9228   ac_status=$?
9229   echo "$as_me:9229: \$? = $ac_status" >&5
9230   (exit $ac_status); }; }; then
9231   echo "$as_me:9231: result: yes" >&5
9232 echo "${ECHO_T}yes" >&6
9233 else
9234   echo "$as_me: failed program was:" >&5
9235 cat conftest.$ac_ext >&5
9236 echo "$as_me:9236: result: no" >&5
9237 echo "${ECHO_T}no" >&6
9238                  LIBS="$cf_ncurses_SAVE"
9239 fi
9240 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9241 fi
9242
9243 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9244
9245 cat >>confdefs.h <<EOF
9246 #define $cf_nculib_ROOT 1
9247 EOF
9248
9249         fi
9250 else
9251         NCURSES_CONFIG=none
9252 fi
9253
9254         ;;
9255 (ncurses*)
9256
9257 cf_ncuconfig_root=$cf_cv_screen
9258 cf_have_ncuconfig=no
9259
9260 if test "x${PKG_CONFIG:=none}" != xnone; then
9261         echo "$as_me:9261: checking pkg-config for $cf_ncuconfig_root" >&5
9262 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9263         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9264                 echo "$as_me:9264: result: yes" >&5
9265 echo "${ECHO_T}yes" >&6
9266
9267                 echo "$as_me:9267: checking if the $cf_ncuconfig_root package files work" >&5
9268 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9269                 cf_have_ncuconfig=unknown
9270
9271                 cf_save_CPPFLAGS="$CPPFLAGS"
9272                 cf_save_LIBS="$LIBS"
9273
9274 cf_fix_cppflags=no
9275 cf_new_cflags=
9276 cf_new_cppflags=
9277 cf_new_extra_cppflags=
9278
9279 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
9280 do
9281 case $cf_fix_cppflags in
9282 (no)
9283         case $cf_add_cflags in
9284         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9285                 case $cf_add_cflags in
9286                 (-D*)
9287                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9288
9289                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9290                                 && test -z "${cf_tst_cflags}" \
9291                                 && cf_fix_cppflags=yes
9292
9293                         if test $cf_fix_cppflags = yes ; then
9294
9295         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9296         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9297
9298                                 continue
9299                         elif test "${cf_tst_cflags}" = "\"'" ; then
9300
9301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9303
9304                                 continue
9305                         fi
9306                         ;;
9307                 esac
9308                 case "$CPPFLAGS" in
9309                 (*$cf_add_cflags)
9310                         ;;
9311                 (*)
9312                         case $cf_add_cflags in
9313                         (-D*)
9314                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9315
9316 CPPFLAGS=`echo "$CPPFLAGS" | \
9317         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9318                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9319
9320                                 ;;
9321                         esac
9322
9323         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9324         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9325
9326                         ;;
9327                 esac
9328                 ;;
9329         (*)
9330
9331         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9332         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9333
9334                 ;;
9335         esac
9336         ;;
9337 (yes)
9338
9339         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9340         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9341
9342         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9343
9344         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9345                 && test -z "${cf_tst_cflags}" \
9346                 && cf_fix_cppflags=no
9347         ;;
9348 esac
9349 done
9350
9351 if test -n "$cf_new_cflags" ; then
9352
9353         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9354         CFLAGS="${CFLAGS}$cf_new_cflags"
9355
9356 fi
9357
9358 if test -n "$cf_new_cppflags" ; then
9359
9360         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9361         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9362
9363 fi
9364
9365 if test -n "$cf_new_extra_cppflags" ; then
9366
9367         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9368         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9369
9370 fi
9371
9372 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9373 # Filter out duplicates - this happens with badly-designed ".pc" files...
9374 for cf_add_1lib in $LIBS
9375 do
9376         for cf_add_2lib in $cf_add_libs
9377         do
9378                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9379                 then
9380                         cf_add_1lib=
9381                         break
9382                 fi
9383         done
9384         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9385 done
9386 LIBS="$cf_add_libs"
9387
9388                 cat >conftest.$ac_ext <<_ACEOF
9389 #line 9389 "configure"
9390 #include "confdefs.h"
9391 #include <${cf_cv_ncurses_header:-curses.h}>
9392 int
9393 main (void)
9394 {
9395 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9396   ;
9397   return 0;
9398 }
9399 _ACEOF
9400 rm -f conftest.$ac_objext conftest$ac_exeext
9401 if { (eval echo "$as_me:9401: \"$ac_link\"") >&5
9402   (eval $ac_link) 2>&5
9403   ac_status=$?
9404   echo "$as_me:9404: \$? = $ac_status" >&5
9405   (exit $ac_status); } &&
9406          { ac_try='test -s conftest$ac_exeext'
9407   { (eval echo "$as_me:9407: \"$ac_try\"") >&5
9408   (eval $ac_try) 2>&5
9409   ac_status=$?
9410   echo "$as_me:9410: \$? = $ac_status" >&5
9411   (exit $ac_status); }; }; then
9412   if test "$cross_compiling" = yes; then
9413   cf_have_ncuconfig=maybe
9414 else
9415   cat >conftest.$ac_ext <<_ACEOF
9416 #line 9416 "configure"
9417 #include "confdefs.h"
9418 #include <${cf_cv_ncurses_header:-curses.h}>
9419                                 int main(void)
9420                                 { char *xx = curses_version(); return (xx == 0); }
9421 _ACEOF
9422 rm -f conftest$ac_exeext
9423 if { (eval echo "$as_me:9423: \"$ac_link\"") >&5
9424   (eval $ac_link) 2>&5
9425   ac_status=$?
9426   echo "$as_me:9426: \$? = $ac_status" >&5
9427   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9428   { (eval echo "$as_me:9428: \"$ac_try\"") >&5
9429   (eval $ac_try) 2>&5
9430   ac_status=$?
9431   echo "$as_me:9431: \$? = $ac_status" >&5
9432   (exit $ac_status); }; }; then
9433   cf_have_ncuconfig=yes
9434 else
9435   echo "$as_me: program exited with status $ac_status" >&5
9436 echo "$as_me: failed program was:" >&5
9437 cat conftest.$ac_ext >&5
9438 cf_have_ncuconfig=no
9439 fi
9440 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9441 fi
9442 else
9443   echo "$as_me: failed program was:" >&5
9444 cat conftest.$ac_ext >&5
9445 cf_have_ncuconfig=no
9446 fi
9447 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9448                 echo "$as_me:9448: result: $cf_have_ncuconfig" >&5
9449 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9450                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9451                 if test "$cf_have_ncuconfig" != "yes"
9452                 then
9453                         CPPFLAGS="$cf_save_CPPFLAGS"
9454                         LIBS="$cf_save_LIBS"
9455                         NCURSES_CONFIG_PKG=none
9456                 else
9457
9458 cat >>confdefs.h <<\EOF
9459 #define NCURSES 1
9460 EOF
9461
9462                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9463
9464 echo "$as_me:9464: checking for terminfo header" >&5
9465 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9466 if test "${cf_cv_term_header+set}" = set; then
9467   echo $ECHO_N "(cached) $ECHO_C" >&6
9468 else
9469
9470 case ${cf_cv_ncurses_header} in
9471 (*/ncurses.h|*/ncursesw.h)
9472         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9473         ;;
9474 (*)
9475         cf_term_header=term.h
9476         ;;
9477 esac
9478
9479 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9480 do
9481 cat >conftest.$ac_ext <<_ACEOF
9482 #line 9482 "configure"
9483 #include "confdefs.h"
9484 #include <stdio.h>
9485 #include <${cf_cv_ncurses_header:-curses.h}>
9486 #include <$cf_test>
9487
9488 int
9489 main (void)
9490 {
9491 int x = auto_left_margin
9492   ;
9493   return 0;
9494 }
9495 _ACEOF
9496 rm -f conftest.$ac_objext
9497 if { (eval echo "$as_me:9497: \"$ac_compile\"") >&5
9498   (eval $ac_compile) 2>&5
9499   ac_status=$?
9500   echo "$as_me:9500: \$? = $ac_status" >&5
9501   (exit $ac_status); } &&
9502          { ac_try='test -s conftest.$ac_objext'
9503   { (eval echo "$as_me:9503: \"$ac_try\"") >&5
9504   (eval $ac_try) 2>&5
9505   ac_status=$?
9506   echo "$as_me:9506: \$? = $ac_status" >&5
9507   (exit $ac_status); }; }; then
9508
9509         cf_cv_term_header="$cf_test"
9510 else
9511   echo "$as_me: failed program was:" >&5
9512 cat conftest.$ac_ext >&5
9513
9514         cf_cv_term_header=unknown
9515
9516 fi
9517 rm -f conftest.$ac_objext conftest.$ac_ext
9518         test "$cf_cv_term_header" != unknown && break
9519 done
9520
9521 fi
9522 echo "$as_me:9522: result: $cf_cv_term_header" >&5
9523 echo "${ECHO_T}$cf_cv_term_header" >&6
9524
9525 # Set definitions to allow ifdef'ing to accommodate subdirectories
9526
9527 case $cf_cv_term_header in
9528 (*term.h)
9529
9530 cat >>confdefs.h <<\EOF
9531 #define HAVE_TERM_H 1
9532 EOF
9533
9534         ;;
9535 esac
9536
9537 case $cf_cv_term_header in
9538 (ncurses/term.h)
9539
9540 cat >>confdefs.h <<\EOF
9541 #define HAVE_NCURSES_TERM_H 1
9542 EOF
9543
9544         ;;
9545 (ncursesw/term.h)
9546
9547 cat >>confdefs.h <<\EOF
9548 #define HAVE_NCURSESW_TERM_H 1
9549 EOF
9550
9551         ;;
9552 esac
9553
9554                 fi
9555
9556         else
9557                 echo "$as_me:9557: result: no" >&5
9558 echo "${ECHO_T}no" >&6
9559                 NCURSES_CONFIG_PKG=none
9560         fi
9561 else
9562         NCURSES_CONFIG_PKG=none
9563 fi
9564
9565 if test "x$cf_have_ncuconfig" = "xno"; then
9566         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9567
9568 if test -n "$ac_tool_prefix"; then
9569   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9570   do
9571     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9572 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9573 echo "$as_me:9573: checking for $ac_word" >&5
9574 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9575 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9576   echo $ECHO_N "(cached) $ECHO_C" >&6
9577 else
9578   if test -n "$NCURSES_CONFIG"; then
9579   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9580 else
9581   ac_save_IFS=$IFS; IFS=$ac_path_separator
9582 ac_dummy="$PATH"
9583 for ac_dir in $ac_dummy; do
9584   IFS=$ac_save_IFS
9585   test -z "$ac_dir" && ac_dir=.
9586   $as_executable_p "$ac_dir/$ac_word" || continue
9587 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9588 echo "$as_me:9588: found $ac_dir/$ac_word" >&5
9589 break
9590 done
9591
9592 fi
9593 fi
9594 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9595 if test -n "$NCURSES_CONFIG"; then
9596   echo "$as_me:9596: result: $NCURSES_CONFIG" >&5
9597 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9598 else
9599   echo "$as_me:9599: result: no" >&5
9600 echo "${ECHO_T}no" >&6
9601 fi
9602
9603     test -n "$NCURSES_CONFIG" && break
9604   done
9605 fi
9606 if test -z "$NCURSES_CONFIG"; then
9607   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9608   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9609 do
9610   # Extract the first word of "$ac_prog", so it can be a program name with args.
9611 set dummy $ac_prog; ac_word=$2
9612 echo "$as_me:9612: checking for $ac_word" >&5
9613 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9614 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9615   echo $ECHO_N "(cached) $ECHO_C" >&6
9616 else
9617   if test -n "$ac_ct_NCURSES_CONFIG"; then
9618   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9619 else
9620   ac_save_IFS=$IFS; IFS=$ac_path_separator
9621 ac_dummy="$PATH"
9622 for ac_dir in $ac_dummy; do
9623   IFS=$ac_save_IFS
9624   test -z "$ac_dir" && ac_dir=.
9625   $as_executable_p "$ac_dir/$ac_word" || continue
9626 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9627 echo "$as_me:9627: found $ac_dir/$ac_word" >&5
9628 break
9629 done
9630
9631 fi
9632 fi
9633 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9634 if test -n "$ac_ct_NCURSES_CONFIG"; then
9635   echo "$as_me:9635: result: $ac_ct_NCURSES_CONFIG" >&5
9636 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9637 else
9638   echo "$as_me:9638: result: no" >&5
9639 echo "${ECHO_T}no" >&6
9640 fi
9641
9642   test -n "$ac_ct_NCURSES_CONFIG" && break
9643 done
9644 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9645
9646   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9647 fi
9648
9649         if test "$NCURSES_CONFIG" != none ; then
9650
9651 cf_fix_cppflags=no
9652 cf_new_cflags=
9653 cf_new_cppflags=
9654 cf_new_extra_cppflags=
9655
9656 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9657 do
9658 case $cf_fix_cppflags in
9659 (no)
9660         case $cf_add_cflags in
9661         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9662                 case $cf_add_cflags in
9663                 (-D*)
9664                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9665
9666                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9667                                 && test -z "${cf_tst_cflags}" \
9668                                 && cf_fix_cppflags=yes
9669
9670                         if test $cf_fix_cppflags = yes ; then
9671
9672         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9673         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9674
9675                                 continue
9676                         elif test "${cf_tst_cflags}" = "\"'" ; then
9677
9678         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9679         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9680
9681                                 continue
9682                         fi
9683                         ;;
9684                 esac
9685                 case "$CPPFLAGS" in
9686                 (*$cf_add_cflags)
9687                         ;;
9688                 (*)
9689                         case $cf_add_cflags in
9690                         (-D*)
9691                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9692
9693 CPPFLAGS=`echo "$CPPFLAGS" | \
9694         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9695                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9696
9697                                 ;;
9698                         esac
9699
9700         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9701         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9702
9703                         ;;
9704                 esac
9705                 ;;
9706         (*)
9707
9708         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9709         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9710
9711                 ;;
9712         esac
9713         ;;
9714 (yes)
9715
9716         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9717         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9718
9719         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9720
9721         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9722                 && test -z "${cf_tst_cflags}" \
9723                 && cf_fix_cppflags=no
9724         ;;
9725 esac
9726 done
9727
9728 if test -n "$cf_new_cflags" ; then
9729
9730         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9731         CFLAGS="${CFLAGS}$cf_new_cflags"
9732
9733 fi
9734
9735 if test -n "$cf_new_cppflags" ; then
9736
9737         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9738         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9739
9740 fi
9741
9742 if test -n "$cf_new_extra_cppflags" ; then
9743
9744         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9745         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9746
9747 fi
9748
9749 cf_add_libs="`$NCURSES_CONFIG --libs`"
9750 # Filter out duplicates - this happens with badly-designed ".pc" files...
9751 for cf_add_1lib in $LIBS
9752 do
9753         for cf_add_2lib in $cf_add_libs
9754         do
9755                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9756                 then
9757                         cf_add_1lib=
9758                         break
9759                 fi
9760         done
9761         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9762 done
9763 LIBS="$cf_add_libs"
9764
9765                 # even with config script, some packages use no-override for curses.h
9766
9767 echo "$as_me:9767: checking if we have identified curses headers" >&5
9768 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9769 if test "${cf_cv_ncurses_header+set}" = set; then
9770   echo $ECHO_N "(cached) $ECHO_C" >&6
9771 else
9772
9773 cf_cv_ncurses_header=none
9774 for cf_header in \
9775         ncurses.h $cf_cv_screen/ncurses.h \
9776         curses.h $cf_cv_screen/curses.h
9777 do
9778 cat >conftest.$ac_ext <<_ACEOF
9779 #line 9779 "configure"
9780 #include "confdefs.h"
9781 #include <${cf_header}>
9782 int
9783 main (void)
9784 {
9785 initscr(); tgoto("?", 0,0)
9786   ;
9787   return 0;
9788 }
9789 _ACEOF
9790 rm -f conftest.$ac_objext
9791 if { (eval echo "$as_me:9791: \"$ac_compile\"") >&5
9792   (eval $ac_compile) 2>&5
9793   ac_status=$?
9794   echo "$as_me:9794: \$? = $ac_status" >&5
9795   (exit $ac_status); } &&
9796          { ac_try='test -s conftest.$ac_objext'
9797   { (eval echo "$as_me:9797: \"$ac_try\"") >&5
9798   (eval $ac_try) 2>&5
9799   ac_status=$?
9800   echo "$as_me:9800: \$? = $ac_status" >&5
9801   (exit $ac_status); }; }; then
9802   cf_cv_ncurses_header=$cf_header; break
9803 else
9804   echo "$as_me: failed program was:" >&5
9805 cat conftest.$ac_ext >&5
9806 fi
9807 rm -f conftest.$ac_objext conftest.$ac_ext
9808 done
9809
9810 fi
9811 echo "$as_me:9811: result: $cf_cv_ncurses_header" >&5
9812 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9813
9814 if test "$cf_cv_ncurses_header" = none ; then
9815         { { echo "$as_me:9815: error: No curses header-files found" >&5
9816 echo "$as_me: error: No curses header-files found" >&2;}
9817    { (exit 1); exit 1; }; }
9818 fi
9819
9820 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9821
9822 for ac_header in $cf_cv_ncurses_header
9823 do
9824 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9825 echo "$as_me:9825: checking for $ac_header" >&5
9826 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9827 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9828   echo $ECHO_N "(cached) $ECHO_C" >&6
9829 else
9830   cat >conftest.$ac_ext <<_ACEOF
9831 #line 9831 "configure"
9832 #include "confdefs.h"
9833 #include <$ac_header>
9834 _ACEOF
9835 if { (eval echo "$as_me:9835: \"$ac_cpp conftest.$ac_ext\"") >&5
9836   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9837   ac_status=$?
9838   egrep -v '^ *\+' conftest.er1 >conftest.err
9839   rm -f conftest.er1
9840   cat conftest.err >&5
9841   echo "$as_me:9841: \$? = $ac_status" >&5
9842   (exit $ac_status); } >/dev/null; then
9843   if test -s conftest.err; then
9844     ac_cpp_err=$ac_c_preproc_warn_flag
9845   else
9846     ac_cpp_err=
9847   fi
9848 else
9849   ac_cpp_err=yes
9850 fi
9851 if test -z "$ac_cpp_err"; then
9852   eval "$as_ac_Header=yes"
9853 else
9854   echo "$as_me: failed program was:" >&5
9855   cat conftest.$ac_ext >&5
9856   eval "$as_ac_Header=no"
9857 fi
9858 rm -f conftest.err conftest.$ac_ext
9859 fi
9860 echo "$as_me:9860: result: `eval echo '${'$as_ac_Header'}'`" >&5
9861 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9862 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9863   cat >>confdefs.h <<EOF
9864 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9865 EOF
9866
9867 fi
9868 done
9869
9870 cat >>confdefs.h <<\EOF
9871 #define NCURSES 1
9872 EOF
9873
9874 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9875
9876                 cat >>confdefs.h <<EOF
9877 #define $cf_nculib_ROOT 1
9878 EOF
9879
9880                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9881
9882         else
9883
9884 cf_ncuhdr_root=$cf_cv_screen
9885
9886 test -n "$cf_cv_curses_dir" && \
9887 test "$cf_cv_curses_dir" != "no" && { \
9888
9889 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9890   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9891   do
9892         while test $cf_add_incdir != /usr/include
9893         do
9894           if test -d $cf_add_incdir
9895           then
9896                 cf_have_incdir=no
9897                 if test -n "$CFLAGS$CPPFLAGS" ; then
9898                   # a loop is needed to ensure we can add subdirs of existing dirs
9899                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9900                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9901                           cf_have_incdir=yes; break
9902                         fi
9903                   done
9904                 fi
9905
9906                 if test "$cf_have_incdir" = no ; then
9907                   if test "$cf_add_incdir" = /usr/local/include ; then
9908                         if test "$GCC" = yes
9909                         then
9910                           cf_save_CPPFLAGS=$CPPFLAGS
9911
9912         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9913         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9914
9915                           cat >conftest.$ac_ext <<_ACEOF
9916 #line 9916 "configure"
9917 #include "confdefs.h"
9918 #include <stdio.h>
9919 int
9920 main (void)
9921 {
9922 printf("Hello")
9923   ;
9924   return 0;
9925 }
9926 _ACEOF
9927 rm -f conftest.$ac_objext
9928 if { (eval echo "$as_me:9928: \"$ac_compile\"") >&5
9929   (eval $ac_compile) 2>&5
9930   ac_status=$?
9931   echo "$as_me:9931: \$? = $ac_status" >&5
9932   (exit $ac_status); } &&
9933          { ac_try='test -s conftest.$ac_objext'
9934   { (eval echo "$as_me:9934: \"$ac_try\"") >&5
9935   (eval $ac_try) 2>&5
9936   ac_status=$?
9937   echo "$as_me:9937: \$? = $ac_status" >&5
9938   (exit $ac_status); }; }; then
9939   :
9940 else
9941   echo "$as_me: failed program was:" >&5
9942 cat conftest.$ac_ext >&5
9943 cf_have_incdir=yes
9944 fi
9945 rm -f conftest.$ac_objext conftest.$ac_ext
9946                           CPPFLAGS=$cf_save_CPPFLAGS
9947                         fi
9948                   fi
9949                 fi
9950
9951                 if test "$cf_have_incdir" = no ; then
9952                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9953
9954 echo "${as_me:-configure}:9954: testing adding $cf_add_incdir to include-path ..." 1>&5
9955
9956                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9957
9958                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9959                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9960                   cf_add_incdir="$cf_top_incdir"
9961                 else
9962                   break
9963                 fi
9964           else
9965                 break
9966           fi
9967         done
9968   done
9969 fi
9970
9971 }
9972
9973 echo "$as_me:9973: checking for $cf_ncuhdr_root header in include-path" >&5
9974 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9975 if test "${cf_cv_ncurses_h+set}" = set; then
9976   echo $ECHO_N "(cached) $ECHO_C" >&6
9977 else
9978
9979         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9980         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9981         for cf_header in $cf_header_list
9982         do
9983
9984         cat >conftest.$ac_ext <<_ACEOF
9985 #line 9985 "configure"
9986 #include "confdefs.h"
9987
9988 #include <$cf_header>
9989 int
9990 main (void)
9991 {
9992
9993 #ifdef NCURSES_VERSION
9994
9995 printf("%s\n", NCURSES_VERSION);
9996 #else
9997 #ifdef __NCURSES_H
9998 printf("old\n");
9999 #else
10000         make an error
10001 #endif
10002 #endif
10003
10004   ;
10005   return 0;
10006 }
10007 _ACEOF
10008 rm -f conftest.$ac_objext
10009 if { (eval echo "$as_me:10009: \"$ac_compile\"") >&5
10010   (eval $ac_compile) 2>&5
10011   ac_status=$?
10012   echo "$as_me:10012: \$? = $ac_status" >&5
10013   (exit $ac_status); } &&
10014          { ac_try='test -s conftest.$ac_objext'
10015   { (eval echo "$as_me:10015: \"$ac_try\"") >&5
10016   (eval $ac_try) 2>&5
10017   ac_status=$?
10018   echo "$as_me:10018: \$? = $ac_status" >&5
10019   (exit $ac_status); }; }; then
10020   cf_cv_ncurses_h=$cf_header
10021
10022 else
10023   echo "$as_me: failed program was:" >&5
10024 cat conftest.$ac_ext >&5
10025 cf_cv_ncurses_h=no
10026 fi
10027 rm -f conftest.$ac_objext conftest.$ac_ext
10028
10029                 test "$cf_cv_ncurses_h" != no && break
10030         done
10031
10032 fi
10033 echo "$as_me:10033: result: $cf_cv_ncurses_h" >&5
10034 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10035
10036 if test "$cf_cv_ncurses_h" != no ; then
10037         cf_cv_ncurses_header=$cf_cv_ncurses_h
10038 else
10039
10040 echo "$as_me:10040: checking for $cf_ncuhdr_root include-path" >&5
10041 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10042 if test "${cf_cv_ncurses_h2+set}" = set; then
10043   echo $ECHO_N "(cached) $ECHO_C" >&6
10044 else
10045
10046         test -n "$verbose" && echo
10047
10048 cf_search=
10049
10050 # collect the current set of include-directories from compiler flags
10051 cf_header_path_list=""
10052 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10053         for cf_header_path in $CPPFLAGS $CFLAGS
10054         do
10055                 case $cf_header_path in
10056                 (-I*)
10057                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10058
10059 test "x$cf_header_path" != "xNONE" && \
10060 test -d "$cf_header_path" && \
10061  {
10062         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10063         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10064         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10065         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10066         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10067         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"
10068 }
10069
10070                         cf_header_path_list="$cf_header_path_list $cf_search"
10071                         ;;
10072                 esac
10073         done
10074 fi
10075
10076 # add the variations for the package we are looking for
10077
10078 cf_search=
10079
10080 test "x$prefix" != "xNONE" && \
10081 test -d "$prefix" && \
10082  {
10083         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10084         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10085         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10086         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10087         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10088         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10089 }
10090
10091 for cf_subdir_prefix in \
10092         /usr \
10093         /usr/local \
10094         /usr/pkg \
10095         /opt \
10096         /opt/local \
10097         $HOME
10098 do
10099
10100 test "x$cf_subdir_prefix" != "x$prefix" && \
10101 test -d "$cf_subdir_prefix" && \
10102 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10103         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10104         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10105         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10106         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10107         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10108         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10109 }
10110
10111 done
10112
10113 test "$includedir" != NONE && \
10114 test "$includedir" != "/usr/include" && \
10115 test -d "$includedir" && {
10116         test -d $includedir &&    cf_search="$cf_search $includedir"
10117         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10118 }
10119
10120 test "$oldincludedir" != NONE && \
10121 test "$oldincludedir" != "/usr/include" && \
10122 test -d "$oldincludedir" && {
10123         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10124         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10125 }
10126
10127 cf_search="$cf_search $cf_header_path_list"
10128
10129         test -n "$verbose" && echo search path $cf_search
10130         cf_save2_CPPFLAGS="$CPPFLAGS"
10131         for cf_incdir in $cf_search
10132         do
10133
10134 if test -n "$cf_incdir" ; then
10135   for cf_add_incdir in $cf_incdir
10136   do
10137         while test $cf_add_incdir != /usr/include
10138         do
10139           if test -d $cf_add_incdir
10140           then
10141                 cf_have_incdir=no
10142                 if test -n "$CFLAGS$CPPFLAGS" ; then
10143                   # a loop is needed to ensure we can add subdirs of existing dirs
10144                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10145                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10146                           cf_have_incdir=yes; break
10147                         fi
10148                   done
10149                 fi
10150
10151                 if test "$cf_have_incdir" = no ; then
10152                   if test "$cf_add_incdir" = /usr/local/include ; then
10153                         if test "$GCC" = yes
10154                         then
10155                           cf_save_CPPFLAGS=$CPPFLAGS
10156
10157         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10158         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10159
10160                           cat >conftest.$ac_ext <<_ACEOF
10161 #line 10161 "configure"
10162 #include "confdefs.h"
10163 #include <stdio.h>
10164 int
10165 main (void)
10166 {
10167 printf("Hello")
10168   ;
10169   return 0;
10170 }
10171 _ACEOF
10172 rm -f conftest.$ac_objext
10173 if { (eval echo "$as_me:10173: \"$ac_compile\"") >&5
10174   (eval $ac_compile) 2>&5
10175   ac_status=$?
10176   echo "$as_me:10176: \$? = $ac_status" >&5
10177   (exit $ac_status); } &&
10178          { ac_try='test -s conftest.$ac_objext'
10179   { (eval echo "$as_me:10179: \"$ac_try\"") >&5
10180   (eval $ac_try) 2>&5
10181   ac_status=$?
10182   echo "$as_me:10182: \$? = $ac_status" >&5
10183   (exit $ac_status); }; }; then
10184   :
10185 else
10186   echo "$as_me: failed program was:" >&5
10187 cat conftest.$ac_ext >&5
10188 cf_have_incdir=yes
10189 fi
10190 rm -f conftest.$ac_objext conftest.$ac_ext
10191                           CPPFLAGS=$cf_save_CPPFLAGS
10192                         fi
10193                   fi
10194                 fi
10195
10196                 if test "$cf_have_incdir" = no ; then
10197                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10198
10199 echo "${as_me:-configure}:10199: testing adding $cf_add_incdir to include-path ..." 1>&5
10200
10201                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10202
10203                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10204                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10205                   cf_add_incdir="$cf_top_incdir"
10206                 else
10207                   break
10208                 fi
10209           else
10210                 break
10211           fi
10212         done
10213   done
10214 fi
10215
10216                 for cf_header in \
10217                         ncurses.h \
10218                         curses.h
10219                 do
10220
10221         cat >conftest.$ac_ext <<_ACEOF
10222 #line 10222 "configure"
10223 #include "confdefs.h"
10224
10225 #include <$cf_header>
10226 int
10227 main (void)
10228 {
10229
10230 #ifdef NCURSES_VERSION
10231
10232 printf("%s\n", NCURSES_VERSION);
10233 #else
10234 #ifdef __NCURSES_H
10235 printf("old\n");
10236 #else
10237         make an error
10238 #endif
10239 #endif
10240
10241   ;
10242   return 0;
10243 }
10244 _ACEOF
10245 rm -f conftest.$ac_objext
10246 if { (eval echo "$as_me:10246: \"$ac_compile\"") >&5
10247   (eval $ac_compile) 2>&5
10248   ac_status=$?
10249   echo "$as_me:10249: \$? = $ac_status" >&5
10250   (exit $ac_status); } &&
10251          { ac_try='test -s conftest.$ac_objext'
10252   { (eval echo "$as_me:10252: \"$ac_try\"") >&5
10253   (eval $ac_try) 2>&5
10254   ac_status=$?
10255   echo "$as_me:10255: \$? = $ac_status" >&5
10256   (exit $ac_status); }; }; then
10257   cf_cv_ncurses_h2=$cf_header
10258
10259 else
10260   echo "$as_me: failed program was:" >&5
10261 cat conftest.$ac_ext >&5
10262 cf_cv_ncurses_h2=no
10263 fi
10264 rm -f conftest.$ac_objext conftest.$ac_ext
10265
10266                         if test "$cf_cv_ncurses_h2" != no ; then
10267                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10268                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10269                                 break
10270                         fi
10271                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10272                 done
10273                 CPPFLAGS="$cf_save2_CPPFLAGS"
10274                 test "$cf_cv_ncurses_h2" != no && break
10275         done
10276         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10276: error: not found" >&5
10277 echo "$as_me: error: not found" >&2;}
10278    { (exit 1); exit 1; }; }
10279
10280 fi
10281 echo "$as_me:10281: result: $cf_cv_ncurses_h2" >&5
10282 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10283
10284         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10285         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10286         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10287                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10288         fi
10289
10290 if test -n "$cf_1st_incdir" ; then
10291   for cf_add_incdir in $cf_1st_incdir
10292   do
10293         while test $cf_add_incdir != /usr/include
10294         do
10295           if test -d $cf_add_incdir
10296           then
10297                 cf_have_incdir=no
10298                 if test -n "$CFLAGS$CPPFLAGS" ; then
10299                   # a loop is needed to ensure we can add subdirs of existing dirs
10300                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10301                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10302                           cf_have_incdir=yes; break
10303                         fi
10304                   done
10305                 fi
10306
10307                 if test "$cf_have_incdir" = no ; then
10308                   if test "$cf_add_incdir" = /usr/local/include ; then
10309                         if test "$GCC" = yes
10310                         then
10311                           cf_save_CPPFLAGS=$CPPFLAGS
10312
10313         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10314         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10315
10316                           cat >conftest.$ac_ext <<_ACEOF
10317 #line 10317 "configure"
10318 #include "confdefs.h"
10319 #include <stdio.h>
10320 int
10321 main (void)
10322 {
10323 printf("Hello")
10324   ;
10325   return 0;
10326 }
10327 _ACEOF
10328 rm -f conftest.$ac_objext
10329 if { (eval echo "$as_me:10329: \"$ac_compile\"") >&5
10330   (eval $ac_compile) 2>&5
10331   ac_status=$?
10332   echo "$as_me:10332: \$? = $ac_status" >&5
10333   (exit $ac_status); } &&
10334          { ac_try='test -s conftest.$ac_objext'
10335   { (eval echo "$as_me:10335: \"$ac_try\"") >&5
10336   (eval $ac_try) 2>&5
10337   ac_status=$?
10338   echo "$as_me:10338: \$? = $ac_status" >&5
10339   (exit $ac_status); }; }; then
10340   :
10341 else
10342   echo "$as_me: failed program was:" >&5
10343 cat conftest.$ac_ext >&5
10344 cf_have_incdir=yes
10345 fi
10346 rm -f conftest.$ac_objext conftest.$ac_ext
10347                           CPPFLAGS=$cf_save_CPPFLAGS
10348                         fi
10349                   fi
10350                 fi
10351
10352                 if test "$cf_have_incdir" = no ; then
10353                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10354
10355 echo "${as_me:-configure}:10355: testing adding $cf_add_incdir to include-path ..." 1>&5
10356
10357                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10358
10359                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10360                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10361                   cf_add_incdir="$cf_top_incdir"
10362                 else
10363                   break
10364                 fi
10365           else
10366                 break
10367           fi
10368         done
10369   done
10370 fi
10371
10372 fi
10373
10374 # Set definitions to allow ifdef'ing for ncurses.h
10375
10376 case $cf_cv_ncurses_header in
10377 (*ncurses.h)
10378
10379 cat >>confdefs.h <<\EOF
10380 #define HAVE_NCURSES_H 1
10381 EOF
10382
10383         ;;
10384 esac
10385
10386 case $cf_cv_ncurses_header in
10387 (ncurses/curses.h|ncurses/ncurses.h)
10388
10389 cat >>confdefs.h <<\EOF
10390 #define HAVE_NCURSES_NCURSES_H 1
10391 EOF
10392
10393         ;;
10394 (ncursesw/curses.h|ncursesw/ncurses.h)
10395
10396 cat >>confdefs.h <<\EOF
10397 #define HAVE_NCURSESW_NCURSES_H 1
10398 EOF
10399
10400         ;;
10401 esac
10402
10403 echo "$as_me:10403: checking for terminfo header" >&5
10404 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10405 if test "${cf_cv_term_header+set}" = set; then
10406   echo $ECHO_N "(cached) $ECHO_C" >&6
10407 else
10408
10409 case ${cf_cv_ncurses_header} in
10410 (*/ncurses.h|*/ncursesw.h)
10411         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10412         ;;
10413 (*)
10414         cf_term_header=term.h
10415         ;;
10416 esac
10417
10418 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10419 do
10420 cat >conftest.$ac_ext <<_ACEOF
10421 #line 10421 "configure"
10422 #include "confdefs.h"
10423 #include <stdio.h>
10424 #include <${cf_cv_ncurses_header:-curses.h}>
10425 #include <$cf_test>
10426
10427 int
10428 main (void)
10429 {
10430 int x = auto_left_margin
10431   ;
10432   return 0;
10433 }
10434 _ACEOF
10435 rm -f conftest.$ac_objext
10436 if { (eval echo "$as_me:10436: \"$ac_compile\"") >&5
10437   (eval $ac_compile) 2>&5
10438   ac_status=$?
10439   echo "$as_me:10439: \$? = $ac_status" >&5
10440   (exit $ac_status); } &&
10441          { ac_try='test -s conftest.$ac_objext'
10442   { (eval echo "$as_me:10442: \"$ac_try\"") >&5
10443   (eval $ac_try) 2>&5
10444   ac_status=$?
10445   echo "$as_me:10445: \$? = $ac_status" >&5
10446   (exit $ac_status); }; }; then
10447
10448         cf_cv_term_header="$cf_test"
10449 else
10450   echo "$as_me: failed program was:" >&5
10451 cat conftest.$ac_ext >&5
10452
10453         cf_cv_term_header=unknown
10454
10455 fi
10456 rm -f conftest.$ac_objext conftest.$ac_ext
10457         test "$cf_cv_term_header" != unknown && break
10458 done
10459
10460 fi
10461 echo "$as_me:10461: result: $cf_cv_term_header" >&5
10462 echo "${ECHO_T}$cf_cv_term_header" >&6
10463
10464 # Set definitions to allow ifdef'ing to accommodate subdirectories
10465
10466 case $cf_cv_term_header in
10467 (*term.h)
10468
10469 cat >>confdefs.h <<\EOF
10470 #define HAVE_TERM_H 1
10471 EOF
10472
10473         ;;
10474 esac
10475
10476 case $cf_cv_term_header in
10477 (ncurses/term.h)
10478
10479 cat >>confdefs.h <<\EOF
10480 #define HAVE_NCURSES_TERM_H 1
10481 EOF
10482
10483         ;;
10484 (ncursesw/term.h)
10485
10486 cat >>confdefs.h <<\EOF
10487 #define HAVE_NCURSESW_TERM_H 1
10488 EOF
10489
10490         ;;
10491 esac
10492
10493 # some applications need this, but should check for NCURSES_VERSION
10494
10495 cat >>confdefs.h <<\EOF
10496 #define NCURSES 1
10497 EOF
10498
10499 echo "$as_me:10499: checking for ncurses version" >&5
10500 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10501 if test "${cf_cv_ncurses_version+set}" = set; then
10502   echo $ECHO_N "(cached) $ECHO_C" >&6
10503 else
10504
10505         cf_cv_ncurses_version=no
10506         cf_tempfile=out$$
10507         rm -f $cf_tempfile
10508         if test "$cross_compiling" = yes; then
10509
10510         # This will not work if the preprocessor splits the line after the
10511         # Autoconf token.  The 'unproto' program does that.
10512         cat > conftest.$ac_ext <<EOF
10513 #include <${cf_cv_ncurses_header:-curses.h}>
10514 #undef Autoconf
10515 #ifdef NCURSES_VERSION
10516 Autoconf NCURSES_VERSION
10517 #else
10518 #ifdef __NCURSES_H
10519 Autoconf "old"
10520 #endif
10521 ;
10522 #endif
10523 EOF
10524         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10525         { (eval echo "$as_me:10525: \"$cf_try\"") >&5
10526   (eval $cf_try) 2>&5
10527   ac_status=$?
10528   echo "$as_me:10528: \$? = $ac_status" >&5
10529   (exit $ac_status); }
10530         if test -f conftest.out ; then
10531                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10532                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10533                 rm -f conftest.out
10534         fi
10535
10536 else
10537   cat >conftest.$ac_ext <<_ACEOF
10538 #line 10538 "configure"
10539 #include "confdefs.h"
10540
10541 #include <${cf_cv_ncurses_header:-curses.h}>
10542 #include <stdio.h>
10543 int main(void)
10544 {
10545         FILE *fp = fopen("$cf_tempfile", "w");
10546 #ifdef NCURSES_VERSION
10547 # ifdef NCURSES_VERSION_PATCH
10548         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10549 # else
10550         fprintf(fp, "%s\n", NCURSES_VERSION);
10551 # endif
10552 #else
10553 # ifdef __NCURSES_H
10554         fprintf(fp, "old\n");
10555 # else
10556         make an error
10557 # endif
10558 #endif
10559         ${cf_cv_main_return:-return}(0);
10560 }
10561 _ACEOF
10562 rm -f conftest$ac_exeext
10563 if { (eval echo "$as_me:10563: \"$ac_link\"") >&5
10564   (eval $ac_link) 2>&5
10565   ac_status=$?
10566   echo "$as_me:10566: \$? = $ac_status" >&5
10567   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10568   { (eval echo "$as_me:10568: \"$ac_try\"") >&5
10569   (eval $ac_try) 2>&5
10570   ac_status=$?
10571   echo "$as_me:10571: \$? = $ac_status" >&5
10572   (exit $ac_status); }; }; then
10573
10574         cf_cv_ncurses_version=`cat $cf_tempfile`
10575 else
10576   echo "$as_me: program exited with status $ac_status" >&5
10577 echo "$as_me: failed program was:" >&5
10578 cat conftest.$ac_ext >&5
10579 fi
10580 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10581 fi
10582         rm -f $cf_tempfile
10583
10584 fi
10585 echo "$as_me:10585: result: $cf_cv_ncurses_version" >&5
10586 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10587 test "$cf_cv_ncurses_version" = no ||
10588 cat >>confdefs.h <<\EOF
10589 #define NCURSES 1
10590 EOF
10591
10592 cf_nculib_root=$cf_cv_screen
10593         # This works, except for the special case where we find gpm, but
10594         # ncurses is in a nonstandard location via $LIBS, and we really want
10595         # to link gpm.
10596 cf_ncurses_LIBS=""
10597 cf_ncurses_SAVE="$LIBS"
10598 echo "$as_me:10598: checking for Gpm_Open in -lgpm" >&5
10599 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10600 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10601   echo $ECHO_N "(cached) $ECHO_C" >&6
10602 else
10603   ac_check_lib_save_LIBS=$LIBS
10604 LIBS="-lgpm  $LIBS"
10605 cat >conftest.$ac_ext <<_ACEOF
10606 #line 10606 "configure"
10607 #include "confdefs.h"
10608
10609 /* Override any gcc2 internal prototype to avoid an error.  */
10610 #ifdef __cplusplus
10611 extern "C"
10612 #endif
10613 /* We use char because int might match the return type of a gcc2
10614    builtin and then its argument prototype would still apply.  */
10615 char Gpm_Open ();
10616 int
10617 main (void)
10618 {
10619 Gpm_Open ();
10620   ;
10621   return 0;
10622 }
10623 _ACEOF
10624 rm -f conftest.$ac_objext conftest$ac_exeext
10625 if { (eval echo "$as_me:10625: \"$ac_link\"") >&5
10626   (eval $ac_link) 2>&5
10627   ac_status=$?
10628   echo "$as_me:10628: \$? = $ac_status" >&5
10629   (exit $ac_status); } &&
10630          { ac_try='test -s conftest$ac_exeext'
10631   { (eval echo "$as_me:10631: \"$ac_try\"") >&5
10632   (eval $ac_try) 2>&5
10633   ac_status=$?
10634   echo "$as_me:10634: \$? = $ac_status" >&5
10635   (exit $ac_status); }; }; then
10636   ac_cv_lib_gpm_Gpm_Open=yes
10637 else
10638   echo "$as_me: failed program was:" >&5
10639 cat conftest.$ac_ext >&5
10640 ac_cv_lib_gpm_Gpm_Open=no
10641 fi
10642 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10643 LIBS=$ac_check_lib_save_LIBS
10644 fi
10645 echo "$as_me:10645: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10646 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10647 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10648   echo "$as_me:10648: checking for initscr in -lgpm" >&5
10649 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10650 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10651   echo $ECHO_N "(cached) $ECHO_C" >&6
10652 else
10653   ac_check_lib_save_LIBS=$LIBS
10654 LIBS="-lgpm  $LIBS"
10655 cat >conftest.$ac_ext <<_ACEOF
10656 #line 10656 "configure"
10657 #include "confdefs.h"
10658
10659 /* Override any gcc2 internal prototype to avoid an error.  */
10660 #ifdef __cplusplus
10661 extern "C"
10662 #endif
10663 /* We use char because int might match the return type of a gcc2
10664    builtin and then its argument prototype would still apply.  */
10665 char initscr ();
10666 int
10667 main (void)
10668 {
10669 initscr ();
10670   ;
10671   return 0;
10672 }
10673 _ACEOF
10674 rm -f conftest.$ac_objext conftest$ac_exeext
10675 if { (eval echo "$as_me:10675: \"$ac_link\"") >&5
10676   (eval $ac_link) 2>&5
10677   ac_status=$?
10678   echo "$as_me:10678: \$? = $ac_status" >&5
10679   (exit $ac_status); } &&
10680          { ac_try='test -s conftest$ac_exeext'
10681   { (eval echo "$as_me:10681: \"$ac_try\"") >&5
10682   (eval $ac_try) 2>&5
10683   ac_status=$?
10684   echo "$as_me:10684: \$? = $ac_status" >&5
10685   (exit $ac_status); }; }; then
10686   ac_cv_lib_gpm_initscr=yes
10687 else
10688   echo "$as_me: failed program was:" >&5
10689 cat conftest.$ac_ext >&5
10690 ac_cv_lib_gpm_initscr=no
10691 fi
10692 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10693 LIBS=$ac_check_lib_save_LIBS
10694 fi
10695 echo "$as_me:10695: result: $ac_cv_lib_gpm_initscr" >&5
10696 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10697 if test $ac_cv_lib_gpm_initscr = yes; then
10698   LIBS="$cf_ncurses_SAVE"
10699 else
10700   cf_ncurses_LIBS="-lgpm"
10701 fi
10702
10703 fi
10704
10705 case $host_os in
10706 (freebsd*)
10707         # This is only necessary if you are linking against an obsolete
10708         # version of ncurses (but it should do no harm, since it's static).
10709         if test "$cf_nculib_root" = ncurses ; then
10710                 echo "$as_me:10710: checking for tgoto in -lmytinfo" >&5
10711 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10712 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10713   echo $ECHO_N "(cached) $ECHO_C" >&6
10714 else
10715   ac_check_lib_save_LIBS=$LIBS
10716 LIBS="-lmytinfo  $LIBS"
10717 cat >conftest.$ac_ext <<_ACEOF
10718 #line 10718 "configure"
10719 #include "confdefs.h"
10720
10721 /* Override any gcc2 internal prototype to avoid an error.  */
10722 #ifdef __cplusplus
10723 extern "C"
10724 #endif
10725 /* We use char because int might match the return type of a gcc2
10726    builtin and then its argument prototype would still apply.  */
10727 char tgoto ();
10728 int
10729 main (void)
10730 {
10731 tgoto ();
10732   ;
10733   return 0;
10734 }
10735 _ACEOF
10736 rm -f conftest.$ac_objext conftest$ac_exeext
10737 if { (eval echo "$as_me:10737: \"$ac_link\"") >&5
10738   (eval $ac_link) 2>&5
10739   ac_status=$?
10740   echo "$as_me:10740: \$? = $ac_status" >&5
10741   (exit $ac_status); } &&
10742          { ac_try='test -s conftest$ac_exeext'
10743   { (eval echo "$as_me:10743: \"$ac_try\"") >&5
10744   (eval $ac_try) 2>&5
10745   ac_status=$?
10746   echo "$as_me:10746: \$? = $ac_status" >&5
10747   (exit $ac_status); }; }; then
10748   ac_cv_lib_mytinfo_tgoto=yes
10749 else
10750   echo "$as_me: failed program was:" >&5
10751 cat conftest.$ac_ext >&5
10752 ac_cv_lib_mytinfo_tgoto=no
10753 fi
10754 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10755 LIBS=$ac_check_lib_save_LIBS
10756 fi
10757 echo "$as_me:10757: result: $ac_cv_lib_mytinfo_tgoto" >&5
10758 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10759 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10760   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10761 fi
10762
10763         fi
10764         ;;
10765 esac
10766
10767 cf_add_libs="$cf_ncurses_LIBS"
10768 # Filter out duplicates - this happens with badly-designed ".pc" files...
10769 for cf_add_1lib in $LIBS
10770 do
10771         for cf_add_2lib in $cf_add_libs
10772         do
10773                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10774                 then
10775                         cf_add_1lib=
10776                         break
10777                 fi
10778         done
10779         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10780 done
10781 LIBS="$cf_add_libs"
10782
10783 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10784 then
10785
10786 cf_add_libs="-l$cf_nculib_root"
10787 # Filter out duplicates - this happens with badly-designed ".pc" files...
10788 for cf_add_1lib in $LIBS
10789 do
10790         for cf_add_2lib in $cf_add_libs
10791         do
10792                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10793                 then
10794                         cf_add_1lib=
10795                         break
10796                 fi
10797         done
10798         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10799 done
10800 LIBS="$cf_add_libs"
10801
10802 else
10803
10804         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10805         cf_libdir=""
10806         echo "$as_me:10806: checking for initscr" >&5
10807 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10808 if test "${ac_cv_func_initscr+set}" = set; then
10809   echo $ECHO_N "(cached) $ECHO_C" >&6
10810 else
10811   cat >conftest.$ac_ext <<_ACEOF
10812 #line 10812 "configure"
10813 #include "confdefs.h"
10814 #define initscr autoconf_temporary
10815 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10816 #undef initscr
10817
10818 #ifdef __cplusplus
10819 extern "C"
10820 #endif
10821
10822 /* We use char because int might match the return type of a gcc2
10823    builtin and then its argument prototype would still apply.  */
10824 char initscr (void);
10825
10826 int
10827 main (void)
10828 {
10829
10830 /* The GNU C library defines stubs for functions which it implements
10831     to always fail with ENOSYS.  Some functions are actually named
10832     something starting with __ and the normal name is an alias.  */
10833 #if defined (__stub_initscr) || defined (__stub___initscr)
10834 #error found stub for initscr
10835 #endif
10836
10837         return initscr ();
10838   ;
10839   return 0;
10840 }
10841 _ACEOF
10842 rm -f conftest.$ac_objext conftest$ac_exeext
10843 if { (eval echo "$as_me:10843: \"$ac_link\"") >&5
10844   (eval $ac_link) 2>&5
10845   ac_status=$?
10846   echo "$as_me:10846: \$? = $ac_status" >&5
10847   (exit $ac_status); } &&
10848          { ac_try='test -s conftest$ac_exeext'
10849   { (eval echo "$as_me:10849: \"$ac_try\"") >&5
10850   (eval $ac_try) 2>&5
10851   ac_status=$?
10852   echo "$as_me:10852: \$? = $ac_status" >&5
10853   (exit $ac_status); }; }; then
10854   ac_cv_func_initscr=yes
10855 else
10856   echo "$as_me: failed program was:" >&5
10857 cat conftest.$ac_ext >&5
10858 ac_cv_func_initscr=no
10859 fi
10860 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10861 fi
10862 echo "$as_me:10862: result: $ac_cv_func_initscr" >&5
10863 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10864 if test $ac_cv_func_initscr = yes; then
10865   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10866 else
10867
10868                 cf_save_LIBS="$LIBS"
10869                 echo "$as_me:10869: checking for initscr in -l$cf_nculib_root" >&5
10870 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10871                 LIBS="-l$cf_nculib_root $LIBS"
10872                 cat >conftest.$ac_ext <<_ACEOF
10873 #line 10873 "configure"
10874 #include "confdefs.h"
10875 #include <${cf_cv_ncurses_header:-curses.h}>
10876 int
10877 main (void)
10878 {
10879 initscr()
10880   ;
10881   return 0;
10882 }
10883 _ACEOF
10884 rm -f conftest.$ac_objext conftest$ac_exeext
10885 if { (eval echo "$as_me:10885: \"$ac_link\"") >&5
10886   (eval $ac_link) 2>&5
10887   ac_status=$?
10888   echo "$as_me:10888: \$? = $ac_status" >&5
10889   (exit $ac_status); } &&
10890          { ac_try='test -s conftest$ac_exeext'
10891   { (eval echo "$as_me:10891: \"$ac_try\"") >&5
10892   (eval $ac_try) 2>&5
10893   ac_status=$?
10894   echo "$as_me:10894: \$? = $ac_status" >&5
10895   (exit $ac_status); }; }; then
10896   echo "$as_me:10896: result: yes" >&5
10897 echo "${ECHO_T}yes" >&6
10898                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10899
10900 else
10901   echo "$as_me: failed program was:" >&5
10902 cat conftest.$ac_ext >&5
10903 echo "$as_me:10903: result: no" >&5
10904 echo "${ECHO_T}no" >&6
10905
10906 cf_search=
10907 cf_library_path_list=""
10908 if test -n "${LDFLAGS}${LIBS}" ; then
10909         for cf_library_path in $LDFLAGS $LIBS
10910         do
10911                 case $cf_library_path in
10912                 (-L*)
10913                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10914
10915 test "x$cf_library_path" != "xNONE" && \
10916 test -d "$cf_library_path" && \
10917  {
10918         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10919         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10920         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10921         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10922         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10923         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"
10924 }
10925
10926                         cf_library_path_list="$cf_library_path_list $cf_search"
10927                         ;;
10928                 esac
10929         done
10930 fi
10931
10932 cf_search=
10933
10934 test "x$prefix" != "xNONE" && \
10935 test -d "$prefix" && \
10936  {
10937         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10938         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10939         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10940         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10941         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10942         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10943 }
10944
10945 for cf_subdir_prefix in \
10946         /usr \
10947         /usr/local \
10948         /usr/pkg \
10949         /opt \
10950         /opt/local \
10951         $HOME
10952 do
10953
10954 test "x$cf_subdir_prefix" != "x$prefix" && \
10955 test -d "$cf_subdir_prefix" && \
10956 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10957         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10958         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10959         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10960         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10961         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10962         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
10963 }
10964
10965 done
10966
10967 cf_search="$cf_library_path_list $cf_search"
10968
10969                         for cf_libdir in $cf_search
10970                         do
10971                                 echo "$as_me:10971: checking for -l$cf_nculib_root in $cf_libdir" >&5
10972 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10973                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10974                                 cat >conftest.$ac_ext <<_ACEOF
10975 #line 10975 "configure"
10976 #include "confdefs.h"
10977 #include <${cf_cv_ncurses_header:-curses.h}>
10978 int
10979 main (void)
10980 {
10981 initscr()
10982   ;
10983   return 0;
10984 }
10985 _ACEOF
10986 rm -f conftest.$ac_objext conftest$ac_exeext
10987 if { (eval echo "$as_me:10987: \"$ac_link\"") >&5
10988   (eval $ac_link) 2>&5
10989   ac_status=$?
10990   echo "$as_me:10990: \$? = $ac_status" >&5
10991   (exit $ac_status); } &&
10992          { ac_try='test -s conftest$ac_exeext'
10993   { (eval echo "$as_me:10993: \"$ac_try\"") >&5
10994   (eval $ac_try) 2>&5
10995   ac_status=$?
10996   echo "$as_me:10996: \$? = $ac_status" >&5
10997   (exit $ac_status); }; }; then
10998   echo "$as_me:10998: result: yes" >&5
10999 echo "${ECHO_T}yes" >&6
11000                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11001                                          break
11002 else
11003   echo "$as_me: failed program was:" >&5
11004 cat conftest.$ac_ext >&5
11005 echo "$as_me:11005: result: no" >&5
11006 echo "${ECHO_T}no" >&6
11007                                          LIBS="$cf_save_LIBS"
11008 fi
11009 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11010                         done
11011
11012 fi
11013 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11014
11015 fi
11016
11017 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11018
11019 if test $cf_found_library = no ; then
11020         { { echo "$as_me:11020: error: Cannot link $cf_nculib_root library" >&5
11021 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11022    { (exit 1); exit 1; }; }
11023 fi
11024
11025 fi
11026
11027 if test -n "$cf_ncurses_LIBS" ; then
11028         echo "$as_me:11028: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11029 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11030         cf_ncurses_SAVE="$LIBS"
11031         for p in $cf_ncurses_LIBS ; do
11032                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11033                 if test "$q" != "$LIBS" ; then
11034                         LIBS="$q"
11035                 fi
11036         done
11037         cat >conftest.$ac_ext <<_ACEOF
11038 #line 11038 "configure"
11039 #include "confdefs.h"
11040 #include <${cf_cv_ncurses_header:-curses.h}>
11041 int
11042 main (void)
11043 {
11044 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11045   ;
11046   return 0;
11047 }
11048 _ACEOF
11049 rm -f conftest.$ac_objext conftest$ac_exeext
11050 if { (eval echo "$as_me:11050: \"$ac_link\"") >&5
11051   (eval $ac_link) 2>&5
11052   ac_status=$?
11053   echo "$as_me:11053: \$? = $ac_status" >&5
11054   (exit $ac_status); } &&
11055          { ac_try='test -s conftest$ac_exeext'
11056   { (eval echo "$as_me:11056: \"$ac_try\"") >&5
11057   (eval $ac_try) 2>&5
11058   ac_status=$?
11059   echo "$as_me:11059: \$? = $ac_status" >&5
11060   (exit $ac_status); }; }; then
11061   echo "$as_me:11061: result: yes" >&5
11062 echo "${ECHO_T}yes" >&6
11063 else
11064   echo "$as_me: failed program was:" >&5
11065 cat conftest.$ac_ext >&5
11066 echo "$as_me:11066: result: no" >&5
11067 echo "${ECHO_T}no" >&6
11068                  LIBS="$cf_ncurses_SAVE"
11069 fi
11070 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11071 fi
11072
11073 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11074
11075 cat >>confdefs.h <<EOF
11076 #define $cf_nculib_ROOT 1
11077 EOF
11078
11079         fi
11080 else
11081         NCURSES_CONFIG=none
11082 fi
11083
11084         ;;
11085 (pdcurses)
11086         echo "$as_me:11086: checking for X" >&5
11087 echo $ECHO_N "checking for X... $ECHO_C" >&6
11088
11089 # Check whether --with-x or --without-x was given.
11090 if test "${with_x+set}" = set; then
11091   withval="$with_x"
11092
11093 fi;
11094 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11095 if test "x$with_x" = xno; then
11096   # The user explicitly disabled X.
11097   have_x=disabled
11098 else
11099   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11100     # Both variables are already set.
11101     have_x=yes
11102   else
11103     if test "${ac_cv_have_x+set}" = set; then
11104   echo $ECHO_N "(cached) $ECHO_C" >&6
11105 else
11106   # One or both of the vars are not set, and there is no cached value.
11107 ac_x_includes=no ac_x_libraries=no
11108 rm -fr conftest.dir
11109 if mkdir conftest.dir; then
11110   cd conftest.dir
11111   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11112   cat >Imakefile <<'EOF'
11113 acfindx:
11114         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11115 EOF
11116   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11117     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11118     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11119     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11120     for ac_extension in a so sl dylib dll; do
11121       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11122          test -f $ac_im_libdir/libX11.$ac_extension; then
11123         ac_im_usrlibdir=$ac_im_libdir; break
11124       fi
11125     done
11126     # Screen out bogus values from the imake configuration.  They are
11127     # bogus both because they are the default anyway, and because
11128     # using them would break gcc on systems where it needs fixed includes.
11129     case $ac_im_incroot in
11130         /usr/include) ;;
11131         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11132     esac
11133     case $ac_im_usrlibdir in
11134         /usr/lib | /lib) ;;
11135         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11136     esac
11137   fi
11138   cd ..
11139   rm -fr conftest.dir
11140 fi
11141
11142 # Standard set of common directories for X headers.
11143 # Check X11 before X11Rn because it is often a symlink to the current release.
11144 ac_x_header_dirs='
11145 /usr/X11/include
11146 /usr/X11R7/include
11147 /usr/X11R6/include
11148 /usr/X11R5/include
11149 /usr/X11R4/include
11150
11151 /usr/include/X11
11152 /usr/include/X11R7
11153 /usr/include/X11R6
11154 /usr/include/X11R5
11155 /usr/include/X11R4
11156
11157 /usr/local/X11/include
11158 /usr/local/X11R7/include
11159 /usr/local/X11R6/include
11160 /usr/local/X11R5/include
11161 /usr/local/X11R4/include
11162
11163 /usr/local/include/X11
11164 /usr/local/include/X11R7
11165 /usr/local/include/X11R6
11166 /usr/local/include/X11R5
11167 /usr/local/include/X11R4
11168
11169 /usr/X386/include
11170 /usr/x386/include
11171 /usr/XFree86/include/X11
11172
11173 /usr/include
11174 /usr/local/include
11175 /usr/unsupported/include
11176 /usr/athena/include
11177 /usr/local/x11r5/include
11178 /usr/lpp/Xamples/include
11179
11180 /usr/openwin/include
11181 /usr/openwin/share/include'
11182
11183 if test "$ac_x_includes" = no; then
11184   # Guess where to find include files, by looking for Intrinsic.h.
11185   # First, try using that file with no special directory specified.
11186   cat >conftest.$ac_ext <<_ACEOF
11187 #line 11187 "configure"
11188 #include "confdefs.h"
11189 #include <X11/Intrinsic.h>
11190 _ACEOF
11191 if { (eval echo "$as_me:11191: \"$ac_cpp conftest.$ac_ext\"") >&5
11192   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11193   ac_status=$?
11194   egrep -v '^ *\+' conftest.er1 >conftest.err
11195   rm -f conftest.er1
11196   cat conftest.err >&5
11197   echo "$as_me:11197: \$? = $ac_status" >&5
11198   (exit $ac_status); } >/dev/null; then
11199   if test -s conftest.err; then
11200     ac_cpp_err=$ac_c_preproc_warn_flag
11201   else
11202     ac_cpp_err=
11203   fi
11204 else
11205   ac_cpp_err=yes
11206 fi
11207 if test -z "$ac_cpp_err"; then
11208   # We can compile using X headers with no special include directory.
11209 ac_x_includes=
11210 else
11211   echo "$as_me: failed program was:" >&5
11212   cat conftest.$ac_ext >&5
11213   for ac_dir in $ac_x_header_dirs; do
11214   if test -r "$ac_dir/X11/Intrinsic.h"; then
11215     ac_x_includes=$ac_dir
11216     break
11217   fi
11218 done
11219 fi
11220 rm -f conftest.err conftest.$ac_ext
11221 fi # $ac_x_includes = no
11222
11223 if test "$ac_x_libraries" = no; then
11224   # Check for the libraries.
11225   # See if we find them without any special options.
11226   # Don't add to $LIBS permanently.
11227   ac_save_LIBS=$LIBS
11228   LIBS="-lXt $LIBS"
11229   cat >conftest.$ac_ext <<_ACEOF
11230 #line 11230 "configure"
11231 #include "confdefs.h"
11232 #include <X11/Intrinsic.h>
11233 int
11234 main (void)
11235 {
11236 XtMalloc (0)
11237   ;
11238   return 0;
11239 }
11240 _ACEOF
11241 rm -f conftest.$ac_objext conftest$ac_exeext
11242 if { (eval echo "$as_me:11242: \"$ac_link\"") >&5
11243   (eval $ac_link) 2>&5
11244   ac_status=$?
11245   echo "$as_me:11245: \$? = $ac_status" >&5
11246   (exit $ac_status); } &&
11247          { ac_try='test -s conftest$ac_exeext'
11248   { (eval echo "$as_me:11248: \"$ac_try\"") >&5
11249   (eval $ac_try) 2>&5
11250   ac_status=$?
11251   echo "$as_me:11251: \$? = $ac_status" >&5
11252   (exit $ac_status); }; }; then
11253   LIBS=$ac_save_LIBS
11254 # We can link X programs with no special library path.
11255 ac_x_libraries=
11256 else
11257   echo "$as_me: failed program was:" >&5
11258 cat conftest.$ac_ext >&5
11259 LIBS=$ac_save_LIBS
11260 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11261 do
11262   # Don't even attempt the hair of trying to link an X program!
11263   for ac_extension in a so sl dylib dll; do
11264     if test -r $ac_dir/libXt.$ac_extension; then
11265       ac_x_libraries=$ac_dir
11266       break 2
11267     fi
11268   done
11269 done
11270 fi
11271 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11272 fi # $ac_x_libraries = no
11273
11274 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11275   # Didn't find X anywhere.  Cache the known absence of X.
11276   ac_cv_have_x="have_x=no"
11277 else
11278   # Record where we found X for the cache.
11279   ac_cv_have_x="have_x=yes \
11280                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11281 fi
11282 fi
11283
11284   fi
11285   eval "$ac_cv_have_x"
11286 fi # $with_x != no
11287
11288 if test "$have_x" != yes; then
11289   echo "$as_me:11289: result: $have_x" >&5
11290 echo "${ECHO_T}$have_x" >&6
11291   no_x=yes
11292 else
11293   # If each of the values was on the command line, it overrides each guess.
11294   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11295   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11296   # Update the cache value to reflect the command line values.
11297   ac_cv_have_x="have_x=yes \
11298                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11299   echo "$as_me:11299: result: libraries $x_libraries, headers $x_includes" >&5
11300 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11301 fi
11302
11303 if test "$no_x" = yes; then
11304   # Not all programs may use this symbol, but it does not hurt to define it.
11305
11306 cat >>confdefs.h <<\EOF
11307 #define X_DISPLAY_MISSING 1
11308 EOF
11309
11310   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11311 else
11312   if test -n "$x_includes"; then
11313     X_CFLAGS="$X_CFLAGS -I$x_includes"
11314   fi
11315
11316   # It would also be nice to do this for all -L options, not just this one.
11317   if test -n "$x_libraries"; then
11318     X_LIBS="$X_LIBS -L$x_libraries"
11319     # For Solaris; some versions of Sun CC require a space after -R and
11320     # others require no space.  Words are not sufficient . . . .
11321     case `(uname -sr) 2>/dev/null` in
11322     "SunOS 5"*)
11323       echo "$as_me:11323: checking whether -R must be followed by a space" >&5
11324 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11325       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11326       cat >conftest.$ac_ext <<_ACEOF
11327 #line 11327 "configure"
11328 #include "confdefs.h"
11329
11330 int
11331 main (void)
11332 {
11333
11334   ;
11335   return 0;
11336 }
11337 _ACEOF
11338 rm -f conftest.$ac_objext conftest$ac_exeext
11339 if { (eval echo "$as_me:11339: \"$ac_link\"") >&5
11340   (eval $ac_link) 2>&5
11341   ac_status=$?
11342   echo "$as_me:11342: \$? = $ac_status" >&5
11343   (exit $ac_status); } &&
11344          { ac_try='test -s conftest$ac_exeext'
11345   { (eval echo "$as_me:11345: \"$ac_try\"") >&5
11346   (eval $ac_try) 2>&5
11347   ac_status=$?
11348   echo "$as_me:11348: \$? = $ac_status" >&5
11349   (exit $ac_status); }; }; then
11350   ac_R_nospace=yes
11351 else
11352   echo "$as_me: failed program was:" >&5
11353 cat conftest.$ac_ext >&5
11354 ac_R_nospace=no
11355 fi
11356 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11357       if test $ac_R_nospace = yes; then
11358         echo "$as_me:11358: result: no" >&5
11359 echo "${ECHO_T}no" >&6
11360         X_LIBS="$X_LIBS -R$x_libraries"
11361       else
11362         LIBS="$ac_xsave_LIBS -R $x_libraries"
11363         cat >conftest.$ac_ext <<_ACEOF
11364 #line 11364 "configure"
11365 #include "confdefs.h"
11366
11367 int
11368 main (void)
11369 {
11370
11371   ;
11372   return 0;
11373 }
11374 _ACEOF
11375 rm -f conftest.$ac_objext conftest$ac_exeext
11376 if { (eval echo "$as_me:11376: \"$ac_link\"") >&5
11377   (eval $ac_link) 2>&5
11378   ac_status=$?
11379   echo "$as_me:11379: \$? = $ac_status" >&5
11380   (exit $ac_status); } &&
11381          { ac_try='test -s conftest$ac_exeext'
11382   { (eval echo "$as_me:11382: \"$ac_try\"") >&5
11383   (eval $ac_try) 2>&5
11384   ac_status=$?
11385   echo "$as_me:11385: \$? = $ac_status" >&5
11386   (exit $ac_status); }; }; then
11387   ac_R_space=yes
11388 else
11389   echo "$as_me: failed program was:" >&5
11390 cat conftest.$ac_ext >&5
11391 ac_R_space=no
11392 fi
11393 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11394         if test $ac_R_space = yes; then
11395           echo "$as_me:11395: result: yes" >&5
11396 echo "${ECHO_T}yes" >&6
11397           X_LIBS="$X_LIBS -R $x_libraries"
11398         else
11399           echo "$as_me:11399: result: neither works" >&5
11400 echo "${ECHO_T}neither works" >&6
11401         fi
11402       fi
11403       LIBS=$ac_xsave_LIBS
11404     esac
11405   fi
11406
11407   # Check for system-dependent libraries X programs must link with.
11408   # Do this before checking for the system-independent R6 libraries
11409   # (-lICE), since we may need -lsocket or whatever for X linking.
11410
11411   if test "$ISC" = yes; then
11412     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11413   else
11414     # Martyn Johnson says this is needed for Ultrix, if the X
11415     # libraries were built with DECnet support.  And Karl Berry says
11416     # the Alpha needs dnet_stub (dnet does not exist).
11417     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11418     cat >conftest.$ac_ext <<_ACEOF
11419 #line 11419 "configure"
11420 #include "confdefs.h"
11421
11422 /* Override any gcc2 internal prototype to avoid an error.  */
11423 #ifdef __cplusplus
11424 extern "C"
11425 #endif
11426 /* We use char because int might match the return type of a gcc2
11427    builtin and then its argument prototype would still apply.  */
11428 char XOpenDisplay ();
11429 int
11430 main (void)
11431 {
11432 XOpenDisplay ();
11433   ;
11434   return 0;
11435 }
11436 _ACEOF
11437 rm -f conftest.$ac_objext conftest$ac_exeext
11438 if { (eval echo "$as_me:11438: \"$ac_link\"") >&5
11439   (eval $ac_link) 2>&5
11440   ac_status=$?
11441   echo "$as_me:11441: \$? = $ac_status" >&5
11442   (exit $ac_status); } &&
11443          { ac_try='test -s conftest$ac_exeext'
11444   { (eval echo "$as_me:11444: \"$ac_try\"") >&5
11445   (eval $ac_try) 2>&5
11446   ac_status=$?
11447   echo "$as_me:11447: \$? = $ac_status" >&5
11448   (exit $ac_status); }; }; then
11449   :
11450 else
11451   echo "$as_me: failed program was:" >&5
11452 cat conftest.$ac_ext >&5
11453 echo "$as_me:11453: checking for dnet_ntoa in -ldnet" >&5
11454 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11455 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11456   echo $ECHO_N "(cached) $ECHO_C" >&6
11457 else
11458   ac_check_lib_save_LIBS=$LIBS
11459 LIBS="-ldnet  $LIBS"
11460 cat >conftest.$ac_ext <<_ACEOF
11461 #line 11461 "configure"
11462 #include "confdefs.h"
11463
11464 /* Override any gcc2 internal prototype to avoid an error.  */
11465 #ifdef __cplusplus
11466 extern "C"
11467 #endif
11468 /* We use char because int might match the return type of a gcc2
11469    builtin and then its argument prototype would still apply.  */
11470 char dnet_ntoa ();
11471 int
11472 main (void)
11473 {
11474 dnet_ntoa ();
11475   ;
11476   return 0;
11477 }
11478 _ACEOF
11479 rm -f conftest.$ac_objext conftest$ac_exeext
11480 if { (eval echo "$as_me:11480: \"$ac_link\"") >&5
11481   (eval $ac_link) 2>&5
11482   ac_status=$?
11483   echo "$as_me:11483: \$? = $ac_status" >&5
11484   (exit $ac_status); } &&
11485          { ac_try='test -s conftest$ac_exeext'
11486   { (eval echo "$as_me:11486: \"$ac_try\"") >&5
11487   (eval $ac_try) 2>&5
11488   ac_status=$?
11489   echo "$as_me:11489: \$? = $ac_status" >&5
11490   (exit $ac_status); }; }; then
11491   ac_cv_lib_dnet_dnet_ntoa=yes
11492 else
11493   echo "$as_me: failed program was:" >&5
11494 cat conftest.$ac_ext >&5
11495 ac_cv_lib_dnet_dnet_ntoa=no
11496 fi
11497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11498 LIBS=$ac_check_lib_save_LIBS
11499 fi
11500 echo "$as_me:11500: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
11501 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
11502 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
11503   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
11504 fi
11505
11506     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
11507       echo "$as_me:11507: checking for dnet_ntoa in -ldnet_stub" >&5
11508 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
11509 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
11510   echo $ECHO_N "(cached) $ECHO_C" >&6
11511 else
11512   ac_check_lib_save_LIBS=$LIBS
11513 LIBS="-ldnet_stub  $LIBS"
11514 cat >conftest.$ac_ext <<_ACEOF
11515 #line 11515 "configure"
11516 #include "confdefs.h"
11517
11518 /* Override any gcc2 internal prototype to avoid an error.  */
11519 #ifdef __cplusplus
11520 extern "C"
11521 #endif
11522 /* We use char because int might match the return type of a gcc2
11523    builtin and then its argument prototype would still apply.  */
11524 char dnet_ntoa ();
11525 int
11526 main (void)
11527 {
11528 dnet_ntoa ();
11529   ;
11530   return 0;
11531 }
11532 _ACEOF
11533 rm -f conftest.$ac_objext conftest$ac_exeext
11534 if { (eval echo "$as_me:11534: \"$ac_link\"") >&5
11535   (eval $ac_link) 2>&5
11536   ac_status=$?
11537   echo "$as_me:11537: \$? = $ac_status" >&5
11538   (exit $ac_status); } &&
11539          { ac_try='test -s conftest$ac_exeext'
11540   { (eval echo "$as_me:11540: \"$ac_try\"") >&5
11541   (eval $ac_try) 2>&5
11542   ac_status=$?
11543   echo "$as_me:11543: \$? = $ac_status" >&5
11544   (exit $ac_status); }; }; then
11545   ac_cv_lib_dnet_stub_dnet_ntoa=yes
11546 else
11547   echo "$as_me: failed program was:" >&5
11548 cat conftest.$ac_ext >&5
11549 ac_cv_lib_dnet_stub_dnet_ntoa=no
11550 fi
11551 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11552 LIBS=$ac_check_lib_save_LIBS
11553 fi
11554 echo "$as_me:11554: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
11555 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
11556 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
11557   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
11558 fi
11559
11560     fi
11561 fi
11562 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11563     LIBS="$ac_xsave_LIBS"
11564
11565     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
11566     # to get the SysV transport functions.
11567     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
11568     # needs -lnsl.
11569     # The nsl library prevents programs from opening the X display
11570     # on Irix 5.2, according to T.E. Dickey.
11571     # The functions gethostbyname, getservbyname, and inet_addr are
11572     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
11573     echo "$as_me:11573: checking for gethostbyname" >&5
11574 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
11575 if test "${ac_cv_func_gethostbyname+set}" = set; then
11576   echo $ECHO_N "(cached) $ECHO_C" >&6
11577 else
11578   cat >conftest.$ac_ext <<_ACEOF
11579 #line 11579 "configure"
11580 #include "confdefs.h"
11581 #define gethostbyname autoconf_temporary
11582 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11583 #undef gethostbyname
11584
11585 #ifdef __cplusplus
11586 extern "C"
11587 #endif
11588
11589 /* We use char because int might match the return type of a gcc2
11590    builtin and then its argument prototype would still apply.  */
11591 char gethostbyname (void);
11592
11593 int
11594 main (void)
11595 {
11596
11597 /* The GNU C library defines stubs for functions which it implements
11598     to always fail with ENOSYS.  Some functions are actually named
11599     something starting with __ and the normal name is an alias.  */
11600 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
11601 #error found stub for gethostbyname
11602 #endif
11603
11604         return gethostbyname ();
11605   ;
11606   return 0;
11607 }
11608 _ACEOF
11609 rm -f conftest.$ac_objext conftest$ac_exeext
11610 if { (eval echo "$as_me:11610: \"$ac_link\"") >&5
11611   (eval $ac_link) 2>&5
11612   ac_status=$?
11613   echo "$as_me:11613: \$? = $ac_status" >&5
11614   (exit $ac_status); } &&
11615          { ac_try='test -s conftest$ac_exeext'
11616   { (eval echo "$as_me:11616: \"$ac_try\"") >&5
11617   (eval $ac_try) 2>&5
11618   ac_status=$?
11619   echo "$as_me:11619: \$? = $ac_status" >&5
11620   (exit $ac_status); }; }; then
11621   ac_cv_func_gethostbyname=yes
11622 else
11623   echo "$as_me: failed program was:" >&5
11624 cat conftest.$ac_ext >&5
11625 ac_cv_func_gethostbyname=no
11626 fi
11627 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11628 fi
11629 echo "$as_me:11629: result: $ac_cv_func_gethostbyname" >&5
11630 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
11631
11632     if test $ac_cv_func_gethostbyname = no; then
11633       echo "$as_me:11633: checking for gethostbyname in -lnsl" >&5
11634 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
11635 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
11636   echo $ECHO_N "(cached) $ECHO_C" >&6
11637 else
11638   ac_check_lib_save_LIBS=$LIBS
11639 LIBS="-lnsl  $LIBS"
11640 cat >conftest.$ac_ext <<_ACEOF
11641 #line 11641 "configure"
11642 #include "confdefs.h"
11643
11644 /* Override any gcc2 internal prototype to avoid an error.  */
11645 #ifdef __cplusplus
11646 extern "C"
11647 #endif
11648 /* We use char because int might match the return type of a gcc2
11649    builtin and then its argument prototype would still apply.  */
11650 char gethostbyname ();
11651 int
11652 main (void)
11653 {
11654 gethostbyname ();
11655   ;
11656   return 0;
11657 }
11658 _ACEOF
11659 rm -f conftest.$ac_objext conftest$ac_exeext
11660 if { (eval echo "$as_me:11660: \"$ac_link\"") >&5
11661   (eval $ac_link) 2>&5
11662   ac_status=$?
11663   echo "$as_me:11663: \$? = $ac_status" >&5
11664   (exit $ac_status); } &&
11665          { ac_try='test -s conftest$ac_exeext'
11666   { (eval echo "$as_me:11666: \"$ac_try\"") >&5
11667   (eval $ac_try) 2>&5
11668   ac_status=$?
11669   echo "$as_me:11669: \$? = $ac_status" >&5
11670   (exit $ac_status); }; }; then
11671   ac_cv_lib_nsl_gethostbyname=yes
11672 else
11673   echo "$as_me: failed program was:" >&5
11674 cat conftest.$ac_ext >&5
11675 ac_cv_lib_nsl_gethostbyname=no
11676 fi
11677 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11678 LIBS=$ac_check_lib_save_LIBS
11679 fi
11680 echo "$as_me:11680: result: $ac_cv_lib_nsl_gethostbyname" >&5
11681 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
11682 if test $ac_cv_lib_nsl_gethostbyname = yes; then
11683   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
11684 fi
11685
11686       if test $ac_cv_lib_nsl_gethostbyname = no; then
11687         echo "$as_me:11687: checking for gethostbyname in -lbsd" >&5
11688 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
11689 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
11690   echo $ECHO_N "(cached) $ECHO_C" >&6
11691 else
11692   ac_check_lib_save_LIBS=$LIBS
11693 LIBS="-lbsd  $LIBS"
11694 cat >conftest.$ac_ext <<_ACEOF
11695 #line 11695 "configure"
11696 #include "confdefs.h"
11697
11698 /* Override any gcc2 internal prototype to avoid an error.  */
11699 #ifdef __cplusplus
11700 extern "C"
11701 #endif
11702 /* We use char because int might match the return type of a gcc2
11703    builtin and then its argument prototype would still apply.  */
11704 char gethostbyname ();
11705 int
11706 main (void)
11707 {
11708 gethostbyname ();
11709   ;
11710   return 0;
11711 }
11712 _ACEOF
11713 rm -f conftest.$ac_objext conftest$ac_exeext
11714 if { (eval echo "$as_me:11714: \"$ac_link\"") >&5
11715   (eval $ac_link) 2>&5
11716   ac_status=$?
11717   echo "$as_me:11717: \$? = $ac_status" >&5
11718   (exit $ac_status); } &&
11719          { ac_try='test -s conftest$ac_exeext'
11720   { (eval echo "$as_me:11720: \"$ac_try\"") >&5
11721   (eval $ac_try) 2>&5
11722   ac_status=$?
11723   echo "$as_me:11723: \$? = $ac_status" >&5
11724   (exit $ac_status); }; }; then
11725   ac_cv_lib_bsd_gethostbyname=yes
11726 else
11727   echo "$as_me: failed program was:" >&5
11728 cat conftest.$ac_ext >&5
11729 ac_cv_lib_bsd_gethostbyname=no
11730 fi
11731 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11732 LIBS=$ac_check_lib_save_LIBS
11733 fi
11734 echo "$as_me:11734: result: $ac_cv_lib_bsd_gethostbyname" >&5
11735 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
11736 if test $ac_cv_lib_bsd_gethostbyname = yes; then
11737   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
11738 fi
11739
11740       fi
11741     fi
11742
11743     # lieder@skyler.mavd.honeywell.com says without -lsocket,
11744     # socket/setsockopt and other routines are undefined under SCO ODT
11745     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
11746     # on later versions), says Simon Leinen: it contains gethostby*
11747     # variants that don't use the nameserver (or something).  -lsocket
11748     # must be given before -lnsl if both are needed.  We assume that
11749     # if connect needs -lnsl, so does gethostbyname.
11750     echo "$as_me:11750: checking for connect" >&5
11751 echo $ECHO_N "checking for connect... $ECHO_C" >&6
11752 if test "${ac_cv_func_connect+set}" = set; then
11753   echo $ECHO_N "(cached) $ECHO_C" >&6
11754 else
11755   cat >conftest.$ac_ext <<_ACEOF
11756 #line 11756 "configure"
11757 #include "confdefs.h"
11758 #define connect autoconf_temporary
11759 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11760 #undef connect
11761
11762 #ifdef __cplusplus
11763 extern "C"
11764 #endif
11765
11766 /* We use char because int might match the return type of a gcc2
11767    builtin and then its argument prototype would still apply.  */
11768 char connect (void);
11769
11770 int
11771 main (void)
11772 {
11773
11774 /* The GNU C library defines stubs for functions which it implements
11775     to always fail with ENOSYS.  Some functions are actually named
11776     something starting with __ and the normal name is an alias.  */
11777 #if defined (__stub_connect) || defined (__stub___connect)
11778 #error found stub for connect
11779 #endif
11780
11781         return connect ();
11782   ;
11783   return 0;
11784 }
11785 _ACEOF
11786 rm -f conftest.$ac_objext conftest$ac_exeext
11787 if { (eval echo "$as_me:11787: \"$ac_link\"") >&5
11788   (eval $ac_link) 2>&5
11789   ac_status=$?
11790   echo "$as_me:11790: \$? = $ac_status" >&5
11791   (exit $ac_status); } &&
11792          { ac_try='test -s conftest$ac_exeext'
11793   { (eval echo "$as_me:11793: \"$ac_try\"") >&5
11794   (eval $ac_try) 2>&5
11795   ac_status=$?
11796   echo "$as_me:11796: \$? = $ac_status" >&5
11797   (exit $ac_status); }; }; then
11798   ac_cv_func_connect=yes
11799 else
11800   echo "$as_me: failed program was:" >&5
11801 cat conftest.$ac_ext >&5
11802 ac_cv_func_connect=no
11803 fi
11804 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11805 fi
11806 echo "$as_me:11806: result: $ac_cv_func_connect" >&5
11807 echo "${ECHO_T}$ac_cv_func_connect" >&6
11808
11809     if test $ac_cv_func_connect = no; then
11810       echo "$as_me:11810: checking for connect in -lsocket" >&5
11811 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
11812 if test "${ac_cv_lib_socket_connect+set}" = set; then
11813   echo $ECHO_N "(cached) $ECHO_C" >&6
11814 else
11815   ac_check_lib_save_LIBS=$LIBS
11816 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
11817 cat >conftest.$ac_ext <<_ACEOF
11818 #line 11818 "configure"
11819 #include "confdefs.h"
11820
11821 /* Override any gcc2 internal prototype to avoid an error.  */
11822 #ifdef __cplusplus
11823 extern "C"
11824 #endif
11825 /* We use char because int might match the return type of a gcc2
11826    builtin and then its argument prototype would still apply.  */
11827 char connect ();
11828 int
11829 main (void)
11830 {
11831 connect ();
11832   ;
11833   return 0;
11834 }
11835 _ACEOF
11836 rm -f conftest.$ac_objext conftest$ac_exeext
11837 if { (eval echo "$as_me:11837: \"$ac_link\"") >&5
11838   (eval $ac_link) 2>&5
11839   ac_status=$?
11840   echo "$as_me:11840: \$? = $ac_status" >&5
11841   (exit $ac_status); } &&
11842          { ac_try='test -s conftest$ac_exeext'
11843   { (eval echo "$as_me:11843: \"$ac_try\"") >&5
11844   (eval $ac_try) 2>&5
11845   ac_status=$?
11846   echo "$as_me:11846: \$? = $ac_status" >&5
11847   (exit $ac_status); }; }; then
11848   ac_cv_lib_socket_connect=yes
11849 else
11850   echo "$as_me: failed program was:" >&5
11851 cat conftest.$ac_ext >&5
11852 ac_cv_lib_socket_connect=no
11853 fi
11854 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11855 LIBS=$ac_check_lib_save_LIBS
11856 fi
11857 echo "$as_me:11857: result: $ac_cv_lib_socket_connect" >&5
11858 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
11859 if test $ac_cv_lib_socket_connect = yes; then
11860   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
11861 fi
11862
11863     fi
11864
11865     # Guillermo Gomez says -lposix is necessary on A/UX.
11866     echo "$as_me:11866: checking for remove" >&5
11867 echo $ECHO_N "checking for remove... $ECHO_C" >&6
11868 if test "${ac_cv_func_remove+set}" = set; then
11869   echo $ECHO_N "(cached) $ECHO_C" >&6
11870 else
11871   cat >conftest.$ac_ext <<_ACEOF
11872 #line 11872 "configure"
11873 #include "confdefs.h"
11874 #define remove autoconf_temporary
11875 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11876 #undef remove
11877
11878 #ifdef __cplusplus
11879 extern "C"
11880 #endif
11881
11882 /* We use char because int might match the return type of a gcc2
11883    builtin and then its argument prototype would still apply.  */
11884 char remove (void);
11885
11886 int
11887 main (void)
11888 {
11889
11890 /* The GNU C library defines stubs for functions which it implements
11891     to always fail with ENOSYS.  Some functions are actually named
11892     something starting with __ and the normal name is an alias.  */
11893 #if defined (__stub_remove) || defined (__stub___remove)
11894 #error found stub for remove
11895 #endif
11896
11897         return remove ();
11898   ;
11899   return 0;
11900 }
11901 _ACEOF
11902 rm -f conftest.$ac_objext conftest$ac_exeext
11903 if { (eval echo "$as_me:11903: \"$ac_link\"") >&5
11904   (eval $ac_link) 2>&5
11905   ac_status=$?
11906   echo "$as_me:11906: \$? = $ac_status" >&5
11907   (exit $ac_status); } &&
11908          { ac_try='test -s conftest$ac_exeext'
11909   { (eval echo "$as_me:11909: \"$ac_try\"") >&5
11910   (eval $ac_try) 2>&5
11911   ac_status=$?
11912   echo "$as_me:11912: \$? = $ac_status" >&5
11913   (exit $ac_status); }; }; then
11914   ac_cv_func_remove=yes
11915 else
11916   echo "$as_me: failed program was:" >&5
11917 cat conftest.$ac_ext >&5
11918 ac_cv_func_remove=no
11919 fi
11920 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11921 fi
11922 echo "$as_me:11922: result: $ac_cv_func_remove" >&5
11923 echo "${ECHO_T}$ac_cv_func_remove" >&6
11924
11925     if test $ac_cv_func_remove = no; then
11926       echo "$as_me:11926: checking for remove in -lposix" >&5
11927 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
11928 if test "${ac_cv_lib_posix_remove+set}" = set; then
11929   echo $ECHO_N "(cached) $ECHO_C" >&6
11930 else
11931   ac_check_lib_save_LIBS=$LIBS
11932 LIBS="-lposix  $LIBS"
11933 cat >conftest.$ac_ext <<_ACEOF
11934 #line 11934 "configure"
11935 #include "confdefs.h"
11936
11937 /* Override any gcc2 internal prototype to avoid an error.  */
11938 #ifdef __cplusplus
11939 extern "C"
11940 #endif
11941 /* We use char because int might match the return type of a gcc2
11942    builtin and then its argument prototype would still apply.  */
11943 char remove ();
11944 int
11945 main (void)
11946 {
11947 remove ();
11948   ;
11949   return 0;
11950 }
11951 _ACEOF
11952 rm -f conftest.$ac_objext conftest$ac_exeext
11953 if { (eval echo "$as_me:11953: \"$ac_link\"") >&5
11954   (eval $ac_link) 2>&5
11955   ac_status=$?
11956   echo "$as_me:11956: \$? = $ac_status" >&5
11957   (exit $ac_status); } &&
11958          { ac_try='test -s conftest$ac_exeext'
11959   { (eval echo "$as_me:11959: \"$ac_try\"") >&5
11960   (eval $ac_try) 2>&5
11961   ac_status=$?
11962   echo "$as_me:11962: \$? = $ac_status" >&5
11963   (exit $ac_status); }; }; then
11964   ac_cv_lib_posix_remove=yes
11965 else
11966   echo "$as_me: failed program was:" >&5
11967 cat conftest.$ac_ext >&5
11968 ac_cv_lib_posix_remove=no
11969 fi
11970 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11971 LIBS=$ac_check_lib_save_LIBS
11972 fi
11973 echo "$as_me:11973: result: $ac_cv_lib_posix_remove" >&5
11974 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
11975 if test $ac_cv_lib_posix_remove = yes; then
11976   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
11977 fi
11978
11979     fi
11980
11981     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
11982     echo "$as_me:11982: checking for shmat" >&5
11983 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
11984 if test "${ac_cv_func_shmat+set}" = set; then
11985   echo $ECHO_N "(cached) $ECHO_C" >&6
11986 else
11987   cat >conftest.$ac_ext <<_ACEOF
11988 #line 11988 "configure"
11989 #include "confdefs.h"
11990 #define shmat autoconf_temporary
11991 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11992 #undef shmat
11993
11994 #ifdef __cplusplus
11995 extern "C"
11996 #endif
11997
11998 /* We use char because int might match the return type of a gcc2
11999    builtin and then its argument prototype would still apply.  */
12000 char shmat (void);
12001
12002 int
12003 main (void)
12004 {
12005
12006 /* The GNU C library defines stubs for functions which it implements
12007     to always fail with ENOSYS.  Some functions are actually named
12008     something starting with __ and the normal name is an alias.  */
12009 #if defined (__stub_shmat) || defined (__stub___shmat)
12010 #error found stub for shmat
12011 #endif
12012
12013         return shmat ();
12014   ;
12015   return 0;
12016 }
12017 _ACEOF
12018 rm -f conftest.$ac_objext conftest$ac_exeext
12019 if { (eval echo "$as_me:12019: \"$ac_link\"") >&5
12020   (eval $ac_link) 2>&5
12021   ac_status=$?
12022   echo "$as_me:12022: \$? = $ac_status" >&5
12023   (exit $ac_status); } &&
12024          { ac_try='test -s conftest$ac_exeext'
12025   { (eval echo "$as_me:12025: \"$ac_try\"") >&5
12026   (eval $ac_try) 2>&5
12027   ac_status=$?
12028   echo "$as_me:12028: \$? = $ac_status" >&5
12029   (exit $ac_status); }; }; then
12030   ac_cv_func_shmat=yes
12031 else
12032   echo "$as_me: failed program was:" >&5
12033 cat conftest.$ac_ext >&5
12034 ac_cv_func_shmat=no
12035 fi
12036 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12037 fi
12038 echo "$as_me:12038: result: $ac_cv_func_shmat" >&5
12039 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12040
12041     if test $ac_cv_func_shmat = no; then
12042       echo "$as_me:12042: checking for shmat in -lipc" >&5
12043 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12044 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12045   echo $ECHO_N "(cached) $ECHO_C" >&6
12046 else
12047   ac_check_lib_save_LIBS=$LIBS
12048 LIBS="-lipc  $LIBS"
12049 cat >conftest.$ac_ext <<_ACEOF
12050 #line 12050 "configure"
12051 #include "confdefs.h"
12052
12053 /* Override any gcc2 internal prototype to avoid an error.  */
12054 #ifdef __cplusplus
12055 extern "C"
12056 #endif
12057 /* We use char because int might match the return type of a gcc2
12058    builtin and then its argument prototype would still apply.  */
12059 char shmat ();
12060 int
12061 main (void)
12062 {
12063 shmat ();
12064   ;
12065   return 0;
12066 }
12067 _ACEOF
12068 rm -f conftest.$ac_objext conftest$ac_exeext
12069 if { (eval echo "$as_me:12069: \"$ac_link\"") >&5
12070   (eval $ac_link) 2>&5
12071   ac_status=$?
12072   echo "$as_me:12072: \$? = $ac_status" >&5
12073   (exit $ac_status); } &&
12074          { ac_try='test -s conftest$ac_exeext'
12075   { (eval echo "$as_me:12075: \"$ac_try\"") >&5
12076   (eval $ac_try) 2>&5
12077   ac_status=$?
12078   echo "$as_me:12078: \$? = $ac_status" >&5
12079   (exit $ac_status); }; }; then
12080   ac_cv_lib_ipc_shmat=yes
12081 else
12082   echo "$as_me: failed program was:" >&5
12083 cat conftest.$ac_ext >&5
12084 ac_cv_lib_ipc_shmat=no
12085 fi
12086 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12087 LIBS=$ac_check_lib_save_LIBS
12088 fi
12089 echo "$as_me:12089: result: $ac_cv_lib_ipc_shmat" >&5
12090 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12091 if test $ac_cv_lib_ipc_shmat = yes; then
12092   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12093 fi
12094
12095     fi
12096   fi
12097
12098   # Check for libraries that X11R6 Xt/Xaw programs need.
12099   ac_save_LDFLAGS=$LDFLAGS
12100   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12101   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12102   # check for ICE first), but we must link in the order -lSM -lICE or
12103   # we get undefined symbols.  So assume we have SM if we have ICE.
12104   # These have to be linked with before -lX11, unlike the other
12105   # libraries we check for below, so use a different variable.
12106   # John Interrante, Karl Berry
12107   echo "$as_me:12107: checking for IceConnectionNumber in -lICE" >&5
12108 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12109 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12110   echo $ECHO_N "(cached) $ECHO_C" >&6
12111 else
12112   ac_check_lib_save_LIBS=$LIBS
12113 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12114 cat >conftest.$ac_ext <<_ACEOF
12115 #line 12115 "configure"
12116 #include "confdefs.h"
12117
12118 /* Override any gcc2 internal prototype to avoid an error.  */
12119 #ifdef __cplusplus
12120 extern "C"
12121 #endif
12122 /* We use char because int might match the return type of a gcc2
12123    builtin and then its argument prototype would still apply.  */
12124 char IceConnectionNumber ();
12125 int
12126 main (void)
12127 {
12128 IceConnectionNumber ();
12129   ;
12130   return 0;
12131 }
12132 _ACEOF
12133 rm -f conftest.$ac_objext conftest$ac_exeext
12134 if { (eval echo "$as_me:12134: \"$ac_link\"") >&5
12135   (eval $ac_link) 2>&5
12136   ac_status=$?
12137   echo "$as_me:12137: \$? = $ac_status" >&5
12138   (exit $ac_status); } &&
12139          { ac_try='test -s conftest$ac_exeext'
12140   { (eval echo "$as_me:12140: \"$ac_try\"") >&5
12141   (eval $ac_try) 2>&5
12142   ac_status=$?
12143   echo "$as_me:12143: \$? = $ac_status" >&5
12144   (exit $ac_status); }; }; then
12145   ac_cv_lib_ICE_IceConnectionNumber=yes
12146 else
12147   echo "$as_me: failed program was:" >&5
12148 cat conftest.$ac_ext >&5
12149 ac_cv_lib_ICE_IceConnectionNumber=no
12150 fi
12151 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12152 LIBS=$ac_check_lib_save_LIBS
12153 fi
12154 echo "$as_me:12154: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12155 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12156 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12157   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12158 fi
12159
12160   LDFLAGS=$ac_save_LDFLAGS
12161
12162 fi
12163
12164 cf_x_athena=${cf_x_athena:-Xaw}
12165
12166 echo "$as_me:12166: checking if you want to link with Xaw 3d library" >&5
12167 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12168 withval=
12169
12170 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12171 if test "${with_Xaw3d+set}" = set; then
12172   withval="$with_Xaw3d"
12173
12174 fi;
12175 if test "$withval" = yes ; then
12176         cf_x_athena=Xaw3d
12177         echo "$as_me:12177: result: yes" >&5
12178 echo "${ECHO_T}yes" >&6
12179 else
12180         echo "$as_me:12180: result: no" >&5
12181 echo "${ECHO_T}no" >&6
12182 fi
12183
12184 echo "$as_me:12184: checking if you want to link with Xaw 3d xft library" >&5
12185 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12186 withval=
12187
12188 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12189 if test "${with_Xaw3dxft+set}" = set; then
12190   withval="$with_Xaw3dxft"
12191
12192 fi;
12193 if test "$withval" = yes ; then
12194         cf_x_athena=Xaw3dxft
12195         echo "$as_me:12195: result: yes" >&5
12196 echo "${ECHO_T}yes" >&6
12197 else
12198         echo "$as_me:12198: result: no" >&5
12199 echo "${ECHO_T}no" >&6
12200 fi
12201
12202 echo "$as_me:12202: checking if you want to link with neXT Athena library" >&5
12203 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12204 withval=
12205
12206 # Check whether --with-neXtaw or --without-neXtaw was given.
12207 if test "${with_neXtaw+set}" = set; then
12208   withval="$with_neXtaw"
12209
12210 fi;
12211 if test "$withval" = yes ; then
12212         cf_x_athena=neXtaw
12213         echo "$as_me:12213: result: yes" >&5
12214 echo "${ECHO_T}yes" >&6
12215 else
12216         echo "$as_me:12216: result: no" >&5
12217 echo "${ECHO_T}no" >&6
12218 fi
12219
12220 echo "$as_me:12220: checking if you want to link with Athena-Plus library" >&5
12221 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12222 withval=
12223
12224 # Check whether --with-XawPlus or --without-XawPlus was given.
12225 if test "${with_XawPlus+set}" = set; then
12226   withval="$with_XawPlus"
12227
12228 fi;
12229 if test "$withval" = yes ; then
12230         cf_x_athena=XawPlus
12231         echo "$as_me:12231: result: yes" >&5
12232 echo "${ECHO_T}yes" >&6
12233 else
12234         echo "$as_me:12234: result: no" >&5
12235 echo "${ECHO_T}no" >&6
12236 fi
12237
12238 cf_x_athena_lib=""
12239
12240 if test "$PKG_CONFIG" != none ; then
12241         cf_athena_list=
12242         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12243         for cf_athena_pkg in \
12244                 $cf_athena_list \
12245                 ${cf_x_athena} \
12246                 ${cf_x_athena}-devel \
12247                 lib${cf_x_athena} \
12248                 lib${cf_x_athena}-devel
12249         do
12250
12251 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12252         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12253
12254 echo "${as_me:-configure}:12254: testing found package $cf_athena_pkg ..." 1>&5
12255
12256         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12257         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12258         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12259
12260 echo "${as_me:-configure}:12260: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12261
12262         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12263
12264 echo "${as_me:-configure}:12264: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12265
12266 cf_fix_cppflags=no
12267 cf_new_cflags=
12268 cf_new_cppflags=
12269 cf_new_extra_cppflags=
12270
12271 for cf_add_cflags in $cf_pkgconfig_incs
12272 do
12273 case $cf_fix_cppflags in
12274 (no)
12275         case $cf_add_cflags in
12276         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12277                 case $cf_add_cflags in
12278                 (-D*)
12279                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12280
12281                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12282                                 && test -z "${cf_tst_cflags}" \
12283                                 && cf_fix_cppflags=yes
12284
12285                         if test $cf_fix_cppflags = yes ; then
12286
12287         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12288         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12289
12290                                 continue
12291                         elif test "${cf_tst_cflags}" = "\"'" ; then
12292
12293         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12294         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12295
12296                                 continue
12297                         fi
12298                         ;;
12299                 esac
12300                 case "$CPPFLAGS" in
12301                 (*$cf_add_cflags)
12302                         ;;
12303                 (*)
12304                         case $cf_add_cflags in
12305                         (-D*)
12306                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12307
12308 CPPFLAGS=`echo "$CPPFLAGS" | \
12309         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12310                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12311
12312                                 ;;
12313                         esac
12314
12315         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12316         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12317
12318                         ;;
12319                 esac
12320                 ;;
12321         (*)
12322
12323         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12324         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12325
12326                 ;;
12327         esac
12328         ;;
12329 (yes)
12330
12331         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12332         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12333
12334         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12335
12336         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12337                 && test -z "${cf_tst_cflags}" \
12338                 && cf_fix_cppflags=no
12339         ;;
12340 esac
12341 done
12342
12343 if test -n "$cf_new_cflags" ; then
12344
12345         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12346         CFLAGS="${CFLAGS}$cf_new_cflags"
12347
12348 fi
12349
12350 if test -n "$cf_new_cppflags" ; then
12351
12352         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12353         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12354
12355 fi
12356
12357 if test -n "$cf_new_extra_cppflags" ; then
12358
12359         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12360         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12361
12362 fi
12363
12364 cf_add_libs="$cf_pkgconfig_libs"
12365 # Filter out duplicates - this happens with badly-designed ".pc" files...
12366 for cf_add_1lib in $LIBS
12367 do
12368         for cf_add_2lib in $cf_add_libs
12369         do
12370                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12371                 then
12372                         cf_add_1lib=
12373                         break
12374                 fi
12375         done
12376         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12377 done
12378 LIBS="$cf_add_libs"
12379
12380                         cf_x_athena_lib="$cf_pkgconfig_libs"
12381
12382 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12383
12384                         cat >>confdefs.h <<EOF
12385 #define $cf_x_athena_LIBS 1
12386 EOF
12387
12388         for cf_trim_lib in Xmu Xt X11
12389         do
12390                 case "$LIBS" in
12391                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12392                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12393                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12394
12395 echo "${as_me:-configure}:12395: testing ..trimmed $LIBS ..." 1>&5
12396
12397                         ;;
12398                 esac
12399         done
12400
12401 echo "$as_me:12401: checking for usable $cf_x_athena/Xmu package" >&5
12402 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12403 if test "${cf_cv_xaw_compat+set}" = set; then
12404   echo $ECHO_N "(cached) $ECHO_C" >&6
12405 else
12406
12407 cat >conftest.$ac_ext <<_ACEOF
12408 #line 12408 "configure"
12409 #include "confdefs.h"
12410
12411 #include <X11/Xmu/CharSet.h>
12412
12413 int
12414 main (void)
12415 {
12416
12417 int check = XmuCompareISOLatin1("big", "small")
12418
12419   ;
12420   return 0;
12421 }
12422 _ACEOF
12423 rm -f conftest.$ac_objext conftest$ac_exeext
12424 if { (eval echo "$as_me:12424: \"$ac_link\"") >&5
12425   (eval $ac_link) 2>&5
12426   ac_status=$?
12427   echo "$as_me:12427: \$? = $ac_status" >&5
12428   (exit $ac_status); } &&
12429          { ac_try='test -s conftest$ac_exeext'
12430   { (eval echo "$as_me:12430: \"$ac_try\"") >&5
12431   (eval $ac_try) 2>&5
12432   ac_status=$?
12433   echo "$as_me:12433: \$? = $ac_status" >&5
12434   (exit $ac_status); }; }; then
12435   cf_cv_xaw_compat=yes
12436 else
12437   echo "$as_me: failed program was:" >&5
12438 cat conftest.$ac_ext >&5
12439 cf_cv_xaw_compat=no
12440 fi
12441 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12442 fi
12443 echo "$as_me:12443: result: $cf_cv_xaw_compat" >&5
12444 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12445
12446                         if test "$cf_cv_xaw_compat" = no
12447                         then
12448                                 # workaround for broken ".pc" files...
12449                                 case "$cf_x_athena_lib" in
12450                                 (*-lXmu*)
12451                                         ;;
12452                                 (*)
12453                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12454
12455 echo "${as_me:-configure}:12455: testing work around broken package ..." 1>&5
12456
12457                                         cf_save_xmu="$LIBS"
12458                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12459
12460 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12461         test -n "$verbose" && echo "    found package xmu" 1>&6
12462
12463 echo "${as_me:-configure}:12463: testing found package xmu ..." 1>&5
12464
12465         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12466         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12467         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12468
12469 echo "${as_me:-configure}:12469: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12470
12471         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12472
12473 echo "${as_me:-configure}:12473: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12474
12475 cf_fix_cppflags=no
12476 cf_new_cflags=
12477 cf_new_cppflags=
12478 cf_new_extra_cppflags=
12479
12480 for cf_add_cflags in $cf_pkgconfig_incs
12481 do
12482 case $cf_fix_cppflags in
12483 (no)
12484         case $cf_add_cflags in
12485         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12486                 case $cf_add_cflags in
12487                 (-D*)
12488                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12489
12490                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12491                                 && test -z "${cf_tst_cflags}" \
12492                                 && cf_fix_cppflags=yes
12493
12494                         if test $cf_fix_cppflags = yes ; then
12495
12496         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12497         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12498
12499                                 continue
12500                         elif test "${cf_tst_cflags}" = "\"'" ; then
12501
12502         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12503         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12504
12505                                 continue
12506                         fi
12507                         ;;
12508                 esac
12509                 case "$CPPFLAGS" in
12510                 (*$cf_add_cflags)
12511                         ;;
12512                 (*)
12513                         case $cf_add_cflags in
12514                         (-D*)
12515                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12516
12517 CPPFLAGS=`echo "$CPPFLAGS" | \
12518         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12519                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12520
12521                                 ;;
12522                         esac
12523
12524         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12525         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12526
12527                         ;;
12528                 esac
12529                 ;;
12530         (*)
12531
12532         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12533         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12534
12535                 ;;
12536         esac
12537         ;;
12538 (yes)
12539
12540         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12541         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12542
12543         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12544
12545         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12546                 && test -z "${cf_tst_cflags}" \
12547                 && cf_fix_cppflags=no
12548         ;;
12549 esac
12550 done
12551
12552 if test -n "$cf_new_cflags" ; then
12553
12554         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12555         CFLAGS="${CFLAGS}$cf_new_cflags"
12556
12557 fi
12558
12559 if test -n "$cf_new_cppflags" ; then
12560
12561         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12562         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12563
12564 fi
12565
12566 if test -n "$cf_new_extra_cppflags" ; then
12567
12568         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12569         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12570
12571 fi
12572
12573 cf_add_libs="$cf_pkgconfig_libs"
12574 # Filter out duplicates - this happens with badly-designed ".pc" files...
12575 for cf_add_1lib in $LIBS
12576 do
12577         for cf_add_2lib in $cf_add_libs
12578         do
12579                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12580                 then
12581                         cf_add_1lib=
12582                         break
12583                 fi
12584         done
12585         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12586 done
12587 LIBS="$cf_add_libs"
12588
12589                                                         LIBS="$cf_save_xmu"
12590
12591 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12592
12593 echo "${as_me:-configure}:12593: testing ...before $LIBS ..." 1>&5
12594
12595 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
12596 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12597
12598 echo "${as_me:-configure}:12598: testing ...after  $LIBS ..." 1>&5
12599
12600 else
12601         cf_pkgconfig_incs=
12602         cf_pkgconfig_libs=
12603
12604 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12605
12606 echo "${as_me:-configure}:12606: testing ...before $LIBS ..." 1>&5
12607
12608 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
12609 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12610
12611 echo "${as_me:-configure}:12611: testing ...after  $LIBS ..." 1>&5
12612
12613 fi
12614
12615         for cf_trim_lib in Xmu Xt X11
12616         do
12617                 case "$LIBS" in
12618                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12619                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12620                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12621
12622 echo "${as_me:-configure}:12622: testing ..trimmed $LIBS ..." 1>&5
12623
12624                         ;;
12625                 esac
12626         done
12627
12628                                         ;;
12629                                 esac
12630                         fi
12631
12632                         break
12633 else
12634         cf_pkgconfig_incs=
12635         cf_pkgconfig_libs=
12636         :
12637 fi
12638
12639         done
12640 fi
12641
12642 if test -z "$cf_x_athena_lib" ; then
12643
12644 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
12645         test -n "$verbose" && echo "    found package Xext" 1>&6
12646
12647 echo "${as_me:-configure}:12647: testing found package Xext ..." 1>&5
12648
12649         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
12650         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
12651         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
12652
12653 echo "${as_me:-configure}:12653: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12654
12655         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
12656
12657 echo "${as_me:-configure}:12657: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
12658
12659 cf_fix_cppflags=no
12660 cf_new_cflags=
12661 cf_new_cppflags=
12662 cf_new_extra_cppflags=
12663
12664 for cf_add_cflags in $cf_pkgconfig_incs
12665 do
12666 case $cf_fix_cppflags in
12667 (no)
12668         case $cf_add_cflags in
12669         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12670                 case $cf_add_cflags in
12671                 (-D*)
12672                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12673
12674                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12675                                 && test -z "${cf_tst_cflags}" \
12676                                 && cf_fix_cppflags=yes
12677
12678                         if test $cf_fix_cppflags = yes ; then
12679
12680         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12681         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12682
12683                                 continue
12684                         elif test "${cf_tst_cflags}" = "\"'" ; then
12685
12686         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12687         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12688
12689                                 continue
12690                         fi
12691                         ;;
12692                 esac
12693                 case "$CPPFLAGS" in
12694                 (*$cf_add_cflags)
12695                         ;;
12696                 (*)
12697                         case $cf_add_cflags in
12698                         (-D*)
12699                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12700
12701 CPPFLAGS=`echo "$CPPFLAGS" | \
12702         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12703                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12704
12705                                 ;;
12706                         esac
12707
12708         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12709         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12710
12711                         ;;
12712                 esac
12713                 ;;
12714         (*)
12715
12716         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12717         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12718
12719                 ;;
12720         esac
12721         ;;
12722 (yes)
12723
12724         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12725         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12726
12727         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12728
12729         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12730                 && test -z "${cf_tst_cflags}" \
12731                 && cf_fix_cppflags=no
12732         ;;
12733 esac
12734 done
12735
12736 if test -n "$cf_new_cflags" ; then
12737
12738         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12739         CFLAGS="${CFLAGS}$cf_new_cflags"
12740
12741 fi
12742
12743 if test -n "$cf_new_cppflags" ; then
12744
12745         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12746         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12747
12748 fi
12749
12750 if test -n "$cf_new_extra_cppflags" ; then
12751
12752         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12753         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12754
12755 fi
12756
12757 cf_add_libs="$cf_pkgconfig_libs"
12758 # Filter out duplicates - this happens with badly-designed ".pc" files...
12759 for cf_add_1lib in $LIBS
12760 do
12761         for cf_add_2lib in $cf_add_libs
12762         do
12763                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12764                 then
12765                         cf_add_1lib=
12766                         break
12767                 fi
12768         done
12769         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12770 done
12771 LIBS="$cf_add_libs"
12772
12773         :
12774 else
12775         cf_pkgconfig_incs=
12776         cf_pkgconfig_libs=
12777
12778         echo "$as_me:12778: checking for XextCreateExtension in -lXext" >&5
12779 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
12780 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
12781   echo $ECHO_N "(cached) $ECHO_C" >&6
12782 else
12783   ac_check_lib_save_LIBS=$LIBS
12784 LIBS="-lXext  $LIBS"
12785 cat >conftest.$ac_ext <<_ACEOF
12786 #line 12786 "configure"
12787 #include "confdefs.h"
12788
12789 /* Override any gcc2 internal prototype to avoid an error.  */
12790 #ifdef __cplusplus
12791 extern "C"
12792 #endif
12793 /* We use char because int might match the return type of a gcc2
12794    builtin and then its argument prototype would still apply.  */
12795 char XextCreateExtension ();
12796 int
12797 main (void)
12798 {
12799 XextCreateExtension ();
12800   ;
12801   return 0;
12802 }
12803 _ACEOF
12804 rm -f conftest.$ac_objext conftest$ac_exeext
12805 if { (eval echo "$as_me:12805: \"$ac_link\"") >&5
12806   (eval $ac_link) 2>&5
12807   ac_status=$?
12808   echo "$as_me:12808: \$? = $ac_status" >&5
12809   (exit $ac_status); } &&
12810          { ac_try='test -s conftest$ac_exeext'
12811   { (eval echo "$as_me:12811: \"$ac_try\"") >&5
12812   (eval $ac_try) 2>&5
12813   ac_status=$?
12814   echo "$as_me:12814: \$? = $ac_status" >&5
12815   (exit $ac_status); }; }; then
12816   ac_cv_lib_Xext_XextCreateExtension=yes
12817 else
12818   echo "$as_me: failed program was:" >&5
12819 cat conftest.$ac_ext >&5
12820 ac_cv_lib_Xext_XextCreateExtension=no
12821 fi
12822 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12823 LIBS=$ac_check_lib_save_LIBS
12824 fi
12825 echo "$as_me:12825: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
12826 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
12827 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
12828
12829 cf_add_libs="-lXext"
12830 # Filter out duplicates - this happens with badly-designed ".pc" files...
12831 for cf_add_1lib in $LIBS
12832 do
12833         for cf_add_2lib in $cf_add_libs
12834         do
12835                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12836                 then
12837                         cf_add_1lib=
12838                         break
12839                 fi
12840         done
12841         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12842 done
12843 LIBS="$cf_add_libs"
12844
12845 fi
12846
12847 fi
12848
12849 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
12850 # in some cases has installed dummy files in the former, other cases replaced
12851 # it with a link to the new location).  This complicates the configure script.
12852 # Check for that pitfall, and recover using pkg-config
12853 #
12854 # If none of these are set, the configuration is almost certainly broken.
12855 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
12856 then
12857
12858 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12859         test -n "$verbose" && echo "    found package x11" 1>&6
12860
12861 echo "${as_me:-configure}:12861: testing found package x11 ..." 1>&5
12862
12863         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12864         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12865         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12866
12867 echo "${as_me:-configure}:12867: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12868
12869         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12870
12871 echo "${as_me:-configure}:12871: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12872
12873 cf_fix_cppflags=no
12874 cf_new_cflags=
12875 cf_new_cppflags=
12876 cf_new_extra_cppflags=
12877
12878 for cf_add_cflags in $cf_pkgconfig_incs
12879 do
12880 case $cf_fix_cppflags in
12881 (no)
12882         case $cf_add_cflags in
12883         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12884                 case $cf_add_cflags in
12885                 (-D*)
12886                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12887
12888                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12889                                 && test -z "${cf_tst_cflags}" \
12890                                 && cf_fix_cppflags=yes
12891
12892                         if test $cf_fix_cppflags = yes ; then
12893
12894         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12895         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12896
12897                                 continue
12898                         elif test "${cf_tst_cflags}" = "\"'" ; then
12899
12900         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12901         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12902
12903                                 continue
12904                         fi
12905                         ;;
12906                 esac
12907                 case "$CPPFLAGS" in
12908                 (*$cf_add_cflags)
12909                         ;;
12910                 (*)
12911                         case $cf_add_cflags in
12912                         (-D*)
12913                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12914
12915 CPPFLAGS=`echo "$CPPFLAGS" | \
12916         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12917                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12918
12919                                 ;;
12920                         esac
12921
12922         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12923         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12924
12925                         ;;
12926                 esac
12927                 ;;
12928         (*)
12929
12930         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12931         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12932
12933                 ;;
12934         esac
12935         ;;
12936 (yes)
12937
12938         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12939         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12940
12941         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12942
12943         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12944                 && test -z "${cf_tst_cflags}" \
12945                 && cf_fix_cppflags=no
12946         ;;
12947 esac
12948 done
12949
12950 if test -n "$cf_new_cflags" ; then
12951
12952         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12953         CFLAGS="${CFLAGS}$cf_new_cflags"
12954
12955 fi
12956
12957 if test -n "$cf_new_cppflags" ; then
12958
12959         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12960         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12961
12962 fi
12963
12964 if test -n "$cf_new_extra_cppflags" ; then
12965
12966         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12967         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12968
12969 fi
12970
12971 cf_add_libs="$cf_pkgconfig_libs"
12972 # Filter out duplicates - this happens with badly-designed ".pc" files...
12973 for cf_add_1lib in $LIBS
12974 do
12975         for cf_add_2lib in $cf_add_libs
12976         do
12977                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12978                 then
12979                         cf_add_1lib=
12980                         break
12981                 fi
12982         done
12983         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12984 done
12985 LIBS="$cf_add_libs"
12986
12987         :
12988 else
12989         cf_pkgconfig_incs=
12990         cf_pkgconfig_libs=
12991         { echo "$as_me:12991: WARNING: unable to find X11 library" >&5
12992 echo "$as_me: WARNING: unable to find X11 library" >&2;}
12993 fi
12994
12995 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12996         test -n "$verbose" && echo "    found package ice" 1>&6
12997
12998 echo "${as_me:-configure}:12998: testing found package ice ..." 1>&5
12999
13000         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13001         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13002         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13003
13004 echo "${as_me:-configure}:13004: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13005
13006         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13007
13008 echo "${as_me:-configure}:13008: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13009
13010 cf_fix_cppflags=no
13011 cf_new_cflags=
13012 cf_new_cppflags=
13013 cf_new_extra_cppflags=
13014
13015 for cf_add_cflags in $cf_pkgconfig_incs
13016 do
13017 case $cf_fix_cppflags in
13018 (no)
13019         case $cf_add_cflags in
13020         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13021                 case $cf_add_cflags in
13022                 (-D*)
13023                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13024
13025                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13026                                 && test -z "${cf_tst_cflags}" \
13027                                 && cf_fix_cppflags=yes
13028
13029                         if test $cf_fix_cppflags = yes ; then
13030
13031         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13032         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13033
13034                                 continue
13035                         elif test "${cf_tst_cflags}" = "\"'" ; then
13036
13037         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13038         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13039
13040                                 continue
13041                         fi
13042                         ;;
13043                 esac
13044                 case "$CPPFLAGS" in
13045                 (*$cf_add_cflags)
13046                         ;;
13047                 (*)
13048                         case $cf_add_cflags in
13049                         (-D*)
13050                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13051
13052 CPPFLAGS=`echo "$CPPFLAGS" | \
13053         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13054                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13055
13056                                 ;;
13057                         esac
13058
13059         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13060         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13061
13062                         ;;
13063                 esac
13064                 ;;
13065         (*)
13066
13067         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13068         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13069
13070                 ;;
13071         esac
13072         ;;
13073 (yes)
13074
13075         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13076         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13077
13078         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13079
13080         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13081                 && test -z "${cf_tst_cflags}" \
13082                 && cf_fix_cppflags=no
13083         ;;
13084 esac
13085 done
13086
13087 if test -n "$cf_new_cflags" ; then
13088
13089         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13090         CFLAGS="${CFLAGS}$cf_new_cflags"
13091
13092 fi
13093
13094 if test -n "$cf_new_cppflags" ; then
13095
13096         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13097         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13098
13099 fi
13100
13101 if test -n "$cf_new_extra_cppflags" ; then
13102
13103         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13104         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13105
13106 fi
13107
13108 cf_add_libs="$cf_pkgconfig_libs"
13109 # Filter out duplicates - this happens with badly-designed ".pc" files...
13110 for cf_add_1lib in $LIBS
13111 do
13112         for cf_add_2lib in $cf_add_libs
13113         do
13114                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13115                 then
13116                         cf_add_1lib=
13117                         break
13118                 fi
13119         done
13120         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13121 done
13122 LIBS="$cf_add_libs"
13123
13124         :
13125 else
13126         cf_pkgconfig_incs=
13127         cf_pkgconfig_libs=
13128         { echo "$as_me:13128: WARNING: unable to find ICE library" >&5
13129 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13130 fi
13131
13132 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13133         test -n "$verbose" && echo "    found package sm" 1>&6
13134
13135 echo "${as_me:-configure}:13135: testing found package sm ..." 1>&5
13136
13137         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13138         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13139         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13140
13141 echo "${as_me:-configure}:13141: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13142
13143         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13144
13145 echo "${as_me:-configure}:13145: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13146
13147 cf_fix_cppflags=no
13148 cf_new_cflags=
13149 cf_new_cppflags=
13150 cf_new_extra_cppflags=
13151
13152 for cf_add_cflags in $cf_pkgconfig_incs
13153 do
13154 case $cf_fix_cppflags in
13155 (no)
13156         case $cf_add_cflags in
13157         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13158                 case $cf_add_cflags in
13159                 (-D*)
13160                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13161
13162                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13163                                 && test -z "${cf_tst_cflags}" \
13164                                 && cf_fix_cppflags=yes
13165
13166                         if test $cf_fix_cppflags = yes ; then
13167
13168         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13169         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13170
13171                                 continue
13172                         elif test "${cf_tst_cflags}" = "\"'" ; then
13173
13174         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13175         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13176
13177                                 continue
13178                         fi
13179                         ;;
13180                 esac
13181                 case "$CPPFLAGS" in
13182                 (*$cf_add_cflags)
13183                         ;;
13184                 (*)
13185                         case $cf_add_cflags in
13186                         (-D*)
13187                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13188
13189 CPPFLAGS=`echo "$CPPFLAGS" | \
13190         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13191                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13192
13193                                 ;;
13194                         esac
13195
13196         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13197         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13198
13199                         ;;
13200                 esac
13201                 ;;
13202         (*)
13203
13204         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13205         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13206
13207                 ;;
13208         esac
13209         ;;
13210 (yes)
13211
13212         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13213         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13214
13215         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13216
13217         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13218                 && test -z "${cf_tst_cflags}" \
13219                 && cf_fix_cppflags=no
13220         ;;
13221 esac
13222 done
13223
13224 if test -n "$cf_new_cflags" ; then
13225
13226         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13227         CFLAGS="${CFLAGS}$cf_new_cflags"
13228
13229 fi
13230
13231 if test -n "$cf_new_cppflags" ; then
13232
13233         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13234         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13235
13236 fi
13237
13238 if test -n "$cf_new_extra_cppflags" ; then
13239
13240         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13241         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13242
13243 fi
13244
13245 cf_add_libs="$cf_pkgconfig_libs"
13246 # Filter out duplicates - this happens with badly-designed ".pc" files...
13247 for cf_add_1lib in $LIBS
13248 do
13249         for cf_add_2lib in $cf_add_libs
13250         do
13251                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13252                 then
13253                         cf_add_1lib=
13254                         break
13255                 fi
13256         done
13257         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13258 done
13259 LIBS="$cf_add_libs"
13260
13261         :
13262 else
13263         cf_pkgconfig_incs=
13264         cf_pkgconfig_libs=
13265         { echo "$as_me:13265: WARNING: unable to find SM library" >&5
13266 echo "$as_me: WARNING: unable to find SM library" >&2;}
13267 fi
13268
13269 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13270         test -n "$verbose" && echo "    found package xt" 1>&6
13271
13272 echo "${as_me:-configure}:13272: testing found package xt ..." 1>&5
13273
13274         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13275         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13276         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13277
13278 echo "${as_me:-configure}:13278: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13279
13280         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13281
13282 echo "${as_me:-configure}:13282: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13283
13284 cf_fix_cppflags=no
13285 cf_new_cflags=
13286 cf_new_cppflags=
13287 cf_new_extra_cppflags=
13288
13289 for cf_add_cflags in $cf_pkgconfig_incs
13290 do
13291 case $cf_fix_cppflags in
13292 (no)
13293         case $cf_add_cflags in
13294         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13295                 case $cf_add_cflags in
13296                 (-D*)
13297                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13298
13299                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13300                                 && test -z "${cf_tst_cflags}" \
13301                                 && cf_fix_cppflags=yes
13302
13303                         if test $cf_fix_cppflags = yes ; then
13304
13305         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13306         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13307
13308                                 continue
13309                         elif test "${cf_tst_cflags}" = "\"'" ; then
13310
13311         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13312         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13313
13314                                 continue
13315                         fi
13316                         ;;
13317                 esac
13318                 case "$CPPFLAGS" in
13319                 (*$cf_add_cflags)
13320                         ;;
13321                 (*)
13322                         case $cf_add_cflags in
13323                         (-D*)
13324                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13325
13326 CPPFLAGS=`echo "$CPPFLAGS" | \
13327         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13328                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13329
13330                                 ;;
13331                         esac
13332
13333         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13334         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13335
13336                         ;;
13337                 esac
13338                 ;;
13339         (*)
13340
13341         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13342         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13343
13344                 ;;
13345         esac
13346         ;;
13347 (yes)
13348
13349         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13350         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13351
13352         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13353
13354         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13355                 && test -z "${cf_tst_cflags}" \
13356                 && cf_fix_cppflags=no
13357         ;;
13358 esac
13359 done
13360
13361 if test -n "$cf_new_cflags" ; then
13362
13363         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13364         CFLAGS="${CFLAGS}$cf_new_cflags"
13365
13366 fi
13367
13368 if test -n "$cf_new_cppflags" ; then
13369
13370         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13371         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13372
13373 fi
13374
13375 if test -n "$cf_new_extra_cppflags" ; then
13376
13377         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13378         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13379
13380 fi
13381
13382 cf_add_libs="$cf_pkgconfig_libs"
13383 # Filter out duplicates - this happens with badly-designed ".pc" files...
13384 for cf_add_1lib in $LIBS
13385 do
13386         for cf_add_2lib in $cf_add_libs
13387         do
13388                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13389                 then
13390                         cf_add_1lib=
13391                         break
13392                 fi
13393         done
13394         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13395 done
13396 LIBS="$cf_add_libs"
13397
13398         :
13399 else
13400         cf_pkgconfig_incs=
13401         cf_pkgconfig_libs=
13402         { echo "$as_me:13402: WARNING: unable to find Xt library" >&5
13403 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13404 fi
13405
13406 fi
13407
13408 cf_have_X_LIBS=no
13409
13410 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13411         test -n "$verbose" && echo "    found package xt" 1>&6
13412
13413 echo "${as_me:-configure}:13413: testing found package xt ..." 1>&5
13414
13415         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13416         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13417         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13418
13419 echo "${as_me:-configure}:13419: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13420
13421         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13422
13423 echo "${as_me:-configure}:13423: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13424
13425 cf_fix_cppflags=no
13426 cf_new_cflags=
13427 cf_new_cppflags=
13428 cf_new_extra_cppflags=
13429
13430 for cf_add_cflags in $cf_pkgconfig_incs
13431 do
13432 case $cf_fix_cppflags in
13433 (no)
13434         case $cf_add_cflags in
13435         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13436                 case $cf_add_cflags in
13437                 (-D*)
13438                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13439
13440                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13441                                 && test -z "${cf_tst_cflags}" \
13442                                 && cf_fix_cppflags=yes
13443
13444                         if test $cf_fix_cppflags = yes ; then
13445
13446         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13447         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13448
13449                                 continue
13450                         elif test "${cf_tst_cflags}" = "\"'" ; then
13451
13452         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13453         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13454
13455                                 continue
13456                         fi
13457                         ;;
13458                 esac
13459                 case "$CPPFLAGS" in
13460                 (*$cf_add_cflags)
13461                         ;;
13462                 (*)
13463                         case $cf_add_cflags in
13464                         (-D*)
13465                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13466
13467 CPPFLAGS=`echo "$CPPFLAGS" | \
13468         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13469                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13470
13471                                 ;;
13472                         esac
13473
13474         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13475         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13476
13477                         ;;
13478                 esac
13479                 ;;
13480         (*)
13481
13482         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13483         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13484
13485                 ;;
13486         esac
13487         ;;
13488 (yes)
13489
13490         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13491         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13492
13493         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13494
13495         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13496                 && test -z "${cf_tst_cflags}" \
13497                 && cf_fix_cppflags=no
13498         ;;
13499 esac
13500 done
13501
13502 if test -n "$cf_new_cflags" ; then
13503
13504         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13505         CFLAGS="${CFLAGS}$cf_new_cflags"
13506
13507 fi
13508
13509 if test -n "$cf_new_cppflags" ; then
13510
13511         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13512         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13513
13514 fi
13515
13516 if test -n "$cf_new_extra_cppflags" ; then
13517
13518         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13519         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13520
13521 fi
13522
13523 cf_add_libs="$cf_pkgconfig_libs"
13524 # Filter out duplicates - this happens with badly-designed ".pc" files...
13525 for cf_add_1lib in $LIBS
13526 do
13527         for cf_add_2lib in $cf_add_libs
13528         do
13529                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13530                 then
13531                         cf_add_1lib=
13532                         break
13533                 fi
13534         done
13535         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13536 done
13537 LIBS="$cf_add_libs"
13538
13539         case "x$LIBS" in
13540         (*-lX11*)
13541                 ;;
13542         (*)
13543 # we have an "xt" package, but it may omit Xt's dependency on X11
13544 echo "$as_me:13544: checking for usable X dependency" >&5
13545 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
13546 if test "${cf_cv_xt_x11_compat+set}" = set; then
13547   echo $ECHO_N "(cached) $ECHO_C" >&6
13548 else
13549
13550 cat >conftest.$ac_ext <<_ACEOF
13551 #line 13551 "configure"
13552 #include "confdefs.h"
13553
13554 #include <X11/Xlib.h>
13555
13556 int
13557 main (void)
13558 {
13559
13560         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
13561         int rc2 = XClearWindow((Display*) 0, (Window) 0);
13562         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
13563         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
13564
13565   ;
13566   return 0;
13567 }
13568 _ACEOF
13569 rm -f conftest.$ac_objext conftest$ac_exeext
13570 if { (eval echo "$as_me:13570: \"$ac_link\"") >&5
13571   (eval $ac_link) 2>&5
13572   ac_status=$?
13573   echo "$as_me:13573: \$? = $ac_status" >&5
13574   (exit $ac_status); } &&
13575          { ac_try='test -s conftest$ac_exeext'
13576   { (eval echo "$as_me:13576: \"$ac_try\"") >&5
13577   (eval $ac_try) 2>&5
13578   ac_status=$?
13579   echo "$as_me:13579: \$? = $ac_status" >&5
13580   (exit $ac_status); }; }; then
13581   cf_cv_xt_x11_compat=yes
13582 else
13583   echo "$as_me: failed program was:" >&5
13584 cat conftest.$ac_ext >&5
13585 cf_cv_xt_x11_compat=no
13586 fi
13587 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13588 fi
13589 echo "$as_me:13589: result: $cf_cv_xt_x11_compat" >&5
13590 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
13591                 if test "$cf_cv_xt_x11_compat" = no
13592                 then
13593                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
13594
13595 echo "${as_me:-configure}:13595: testing work around broken X11 dependency ..." 1>&5
13596
13597                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
13598
13599 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13600         test -n "$verbose" && echo "    found package x11" 1>&6
13601
13602 echo "${as_me:-configure}:13602: testing found package x11 ..." 1>&5
13603
13604         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13605         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13606         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13607
13608 echo "${as_me:-configure}:13608: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13609
13610         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13611
13612 echo "${as_me:-configure}:13612: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13613
13614 cf_fix_cppflags=no
13615 cf_new_cflags=
13616 cf_new_cppflags=
13617 cf_new_extra_cppflags=
13618
13619 for cf_add_cflags in $cf_pkgconfig_incs
13620 do
13621 case $cf_fix_cppflags in
13622 (no)
13623         case $cf_add_cflags in
13624         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13625                 case $cf_add_cflags in
13626                 (-D*)
13627                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13628
13629                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13630                                 && test -z "${cf_tst_cflags}" \
13631                                 && cf_fix_cppflags=yes
13632
13633                         if test $cf_fix_cppflags = yes ; then
13634
13635         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13636         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13637
13638                                 continue
13639                         elif test "${cf_tst_cflags}" = "\"'" ; then
13640
13641         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13642         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13643
13644                                 continue
13645                         fi
13646                         ;;
13647                 esac
13648                 case "$CPPFLAGS" in
13649                 (*$cf_add_cflags)
13650                         ;;
13651                 (*)
13652                         case $cf_add_cflags in
13653                         (-D*)
13654                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13655
13656 CPPFLAGS=`echo "$CPPFLAGS" | \
13657         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13658                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13659
13660                                 ;;
13661                         esac
13662
13663         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13664         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13665
13666                         ;;
13667                 esac
13668                 ;;
13669         (*)
13670
13671         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13672         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13673
13674                 ;;
13675         esac
13676         ;;
13677 (yes)
13678
13679         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13680         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13681
13682         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13683
13684         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13685                 && test -z "${cf_tst_cflags}" \
13686                 && cf_fix_cppflags=no
13687         ;;
13688 esac
13689 done
13690
13691 if test -n "$cf_new_cflags" ; then
13692
13693         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13694         CFLAGS="${CFLAGS}$cf_new_cflags"
13695
13696 fi
13697
13698 if test -n "$cf_new_cppflags" ; then
13699
13700         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13701         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13702
13703 fi
13704
13705 if test -n "$cf_new_extra_cppflags" ; then
13706
13707         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13708         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13709
13710 fi
13711
13712 cf_add_libs="$cf_pkgconfig_libs"
13713 # Filter out duplicates - this happens with badly-designed ".pc" files...
13714 for cf_add_1lib in $LIBS
13715 do
13716         for cf_add_2lib in $cf_add_libs
13717         do
13718                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13719                 then
13720                         cf_add_1lib=
13721                         break
13722                 fi
13723         done
13724         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13725 done
13726 LIBS="$cf_add_libs"
13727
13728         :
13729 else
13730         cf_pkgconfig_incs=
13731         cf_pkgconfig_libs=
13732
13733 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13734
13735 echo "${as_me:-configure}:13735: testing ...before $LIBS ..." 1>&5
13736
13737 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
13738 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13739
13740 echo "${as_me:-configure}:13740: testing ...after  $LIBS ..." 1>&5
13741
13742 fi
13743
13744                 fi
13745                 ;;
13746         esac
13747
13748 echo "$as_me:13748: checking for usable X Toolkit package" >&5
13749 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
13750 if test "${cf_cv_xt_ice_compat+set}" = set; then
13751   echo $ECHO_N "(cached) $ECHO_C" >&6
13752 else
13753
13754 cat >conftest.$ac_ext <<_ACEOF
13755 #line 13755 "configure"
13756 #include "confdefs.h"
13757
13758 #include <X11/Shell.h>
13759
13760 int
13761 main (void)
13762 {
13763 int num = IceConnectionNumber(0)
13764
13765   ;
13766   return 0;
13767 }
13768 _ACEOF
13769 rm -f conftest.$ac_objext conftest$ac_exeext
13770 if { (eval echo "$as_me:13770: \"$ac_link\"") >&5
13771   (eval $ac_link) 2>&5
13772   ac_status=$?
13773   echo "$as_me:13773: \$? = $ac_status" >&5
13774   (exit $ac_status); } &&
13775          { ac_try='test -s conftest$ac_exeext'
13776   { (eval echo "$as_me:13776: \"$ac_try\"") >&5
13777   (eval $ac_try) 2>&5
13778   ac_status=$?
13779   echo "$as_me:13779: \$? = $ac_status" >&5
13780   (exit $ac_status); }; }; then
13781   cf_cv_xt_ice_compat=yes
13782 else
13783   echo "$as_me: failed program was:" >&5
13784 cat conftest.$ac_ext >&5
13785 cf_cv_xt_ice_compat=no
13786 fi
13787 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13788 fi
13789 echo "$as_me:13789: result: $cf_cv_xt_ice_compat" >&5
13790 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
13791
13792         if test "$cf_cv_xt_ice_compat" = no
13793         then
13794                 # workaround for broken ".pc" files used for X Toolkit.
13795                 case "x$X_PRE_LIBS" in
13796                 (*-lICE*)
13797                         case "x$LIBS" in
13798                         (*-lICE*)
13799                                 ;;
13800                         (*)
13801                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
13802
13803 echo "${as_me:-configure}:13803: testing work around broken ICE dependency ..." 1>&5
13804
13805 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13806         test -n "$verbose" && echo "    found package ice" 1>&6
13807
13808 echo "${as_me:-configure}:13808: testing found package ice ..." 1>&5
13809
13810         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13811         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13812         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13813
13814 echo "${as_me:-configure}:13814: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13815
13816         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13817
13818 echo "${as_me:-configure}:13818: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13819
13820 cf_fix_cppflags=no
13821 cf_new_cflags=
13822 cf_new_cppflags=
13823 cf_new_extra_cppflags=
13824
13825 for cf_add_cflags in $cf_pkgconfig_incs
13826 do
13827 case $cf_fix_cppflags in
13828 (no)
13829         case $cf_add_cflags in
13830         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13831                 case $cf_add_cflags in
13832                 (-D*)
13833                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13834
13835                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13836                                 && test -z "${cf_tst_cflags}" \
13837                                 && cf_fix_cppflags=yes
13838
13839                         if test $cf_fix_cppflags = yes ; then
13840
13841         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13842         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13843
13844                                 continue
13845                         elif test "${cf_tst_cflags}" = "\"'" ; then
13846
13847         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13848         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13849
13850                                 continue
13851                         fi
13852                         ;;
13853                 esac
13854                 case "$CPPFLAGS" in
13855                 (*$cf_add_cflags)
13856                         ;;
13857                 (*)
13858                         case $cf_add_cflags in
13859                         (-D*)
13860                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13861
13862 CPPFLAGS=`echo "$CPPFLAGS" | \
13863         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13864                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13865
13866                                 ;;
13867                         esac
13868
13869         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13870         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13871
13872                         ;;
13873                 esac
13874                 ;;
13875         (*)
13876
13877         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13878         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13879
13880                 ;;
13881         esac
13882         ;;
13883 (yes)
13884
13885         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13886         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13887
13888         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13889
13890         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13891                 && test -z "${cf_tst_cflags}" \
13892                 && cf_fix_cppflags=no
13893         ;;
13894 esac
13895 done
13896
13897 if test -n "$cf_new_cflags" ; then
13898
13899         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13900         CFLAGS="${CFLAGS}$cf_new_cflags"
13901
13902 fi
13903
13904 if test -n "$cf_new_cppflags" ; then
13905
13906         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13907         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13908
13909 fi
13910
13911 if test -n "$cf_new_extra_cppflags" ; then
13912
13913         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13914         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13915
13916 fi
13917
13918 cf_add_libs="$cf_pkgconfig_libs"
13919 # Filter out duplicates - this happens with badly-designed ".pc" files...
13920 for cf_add_1lib in $LIBS
13921 do
13922         for cf_add_2lib in $cf_add_libs
13923         do
13924                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13925                 then
13926                         cf_add_1lib=
13927                         break
13928                 fi
13929         done
13930         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13931 done
13932 LIBS="$cf_add_libs"
13933
13934 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13935         test -n "$verbose" && echo "    found package sm" 1>&6
13936
13937 echo "${as_me:-configure}:13937: testing found package sm ..." 1>&5
13938
13939         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13940         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13941         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13942
13943 echo "${as_me:-configure}:13943: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13944
13945         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13946
13947 echo "${as_me:-configure}:13947: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13948
13949 cf_fix_cppflags=no
13950 cf_new_cflags=
13951 cf_new_cppflags=
13952 cf_new_extra_cppflags=
13953
13954 for cf_add_cflags in $cf_pkgconfig_incs
13955 do
13956 case $cf_fix_cppflags in
13957 (no)
13958         case $cf_add_cflags in
13959         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13960                 case $cf_add_cflags in
13961                 (-D*)
13962                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13963
13964                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13965                                 && test -z "${cf_tst_cflags}" \
13966                                 && cf_fix_cppflags=yes
13967
13968                         if test $cf_fix_cppflags = yes ; then
13969
13970         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13971         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13972
13973                                 continue
13974                         elif test "${cf_tst_cflags}" = "\"'" ; then
13975
13976         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13977         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13978
13979                                 continue
13980                         fi
13981                         ;;
13982                 esac
13983                 case "$CPPFLAGS" in
13984                 (*$cf_add_cflags)
13985                         ;;
13986                 (*)
13987                         case $cf_add_cflags in
13988                         (-D*)
13989                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13990
13991 CPPFLAGS=`echo "$CPPFLAGS" | \
13992         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13993                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13994
13995                                 ;;
13996                         esac
13997
13998         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13999         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14000
14001                         ;;
14002                 esac
14003                 ;;
14004         (*)
14005
14006         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14007         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14008
14009                 ;;
14010         esac
14011         ;;
14012 (yes)
14013
14014         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14015         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14016
14017         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14018
14019         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14020                 && test -z "${cf_tst_cflags}" \
14021                 && cf_fix_cppflags=no
14022         ;;
14023 esac
14024 done
14025
14026 if test -n "$cf_new_cflags" ; then
14027
14028         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14029         CFLAGS="${CFLAGS}$cf_new_cflags"
14030
14031 fi
14032
14033 if test -n "$cf_new_cppflags" ; then
14034
14035         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14036         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14037
14038 fi
14039
14040 if test -n "$cf_new_extra_cppflags" ; then
14041
14042         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14043         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14044
14045 fi
14046
14047 cf_add_libs="$cf_pkgconfig_libs"
14048 # Filter out duplicates - this happens with badly-designed ".pc" files...
14049 for cf_add_1lib in $LIBS
14050 do
14051         for cf_add_2lib in $cf_add_libs
14052         do
14053                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14054                 then
14055                         cf_add_1lib=
14056                         break
14057                 fi
14058         done
14059         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14060 done
14061 LIBS="$cf_add_libs"
14062
14063         :
14064 else
14065         cf_pkgconfig_incs=
14066         cf_pkgconfig_libs=
14067         :
14068 fi
14069
14070 else
14071         cf_pkgconfig_incs=
14072         cf_pkgconfig_libs=
14073
14074 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14075
14076 echo "${as_me:-configure}:14076: testing ...before $LIBS ..." 1>&5
14077
14078 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14079 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14080
14081 echo "${as_me:-configure}:14081: testing ...after  $LIBS ..." 1>&5
14082
14083 fi
14084
14085                                 ;;
14086                         esac
14087                         ;;
14088                 esac
14089         fi
14090
14091         cf_have_X_LIBS=yes
14092
14093 else
14094         cf_pkgconfig_incs=
14095         cf_pkgconfig_libs=
14096
14097         LDFLAGS="$X_LIBS $LDFLAGS"
14098
14099 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14100
14101 echo "${as_me:-configure}:14101: testing checking additions to CFLAGS ..." 1>&5
14102
14103 cf_check_cflags="$CFLAGS"
14104 cf_check_cppflags="$CPPFLAGS"
14105
14106 cf_fix_cppflags=no
14107 cf_new_cflags=
14108 cf_new_cppflags=
14109 cf_new_extra_cppflags=
14110
14111 for cf_add_cflags in $X_CFLAGS
14112 do
14113 case $cf_fix_cppflags in
14114 (no)
14115         case $cf_add_cflags in
14116         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14117                 case $cf_add_cflags in
14118                 (-D*)
14119                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14120
14121                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14122                                 && test -z "${cf_tst_cflags}" \
14123                                 && cf_fix_cppflags=yes
14124
14125                         if test $cf_fix_cppflags = yes ; then
14126
14127         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14128         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14129
14130                                 continue
14131                         elif test "${cf_tst_cflags}" = "\"'" ; then
14132
14133         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14134         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14135
14136                                 continue
14137                         fi
14138                         ;;
14139                 esac
14140                 case "$CPPFLAGS" in
14141                 (*$cf_add_cflags)
14142                         ;;
14143                 (*)
14144                         case $cf_add_cflags in
14145                         (-D*)
14146                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14147
14148 CPPFLAGS=`echo "$CPPFLAGS" | \
14149         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14150                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14151
14152                                 ;;
14153                         esac
14154
14155         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14156         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14157
14158                         ;;
14159                 esac
14160                 ;;
14161         (*)
14162
14163         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14164         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14165
14166                 ;;
14167         esac
14168         ;;
14169 (yes)
14170
14171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14173
14174         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14175
14176         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14177                 && test -z "${cf_tst_cflags}" \
14178                 && cf_fix_cppflags=no
14179         ;;
14180 esac
14181 done
14182
14183 if test -n "$cf_new_cflags" ; then
14184         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14185
14186 echo "${as_me:-configure}:14186: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14187
14188         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14189         CFLAGS="${CFLAGS}$cf_new_cflags"
14190
14191 fi
14192
14193 if test -n "$cf_new_cppflags" ; then
14194         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14195
14196 echo "${as_me:-configure}:14196: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14197
14198         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14199         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14200
14201 fi
14202
14203 if test -n "$cf_new_extra_cppflags" ; then
14204         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14205
14206 echo "${as_me:-configure}:14206: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14207
14208         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14209         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14210
14211 fi
14212
14213 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14214 cat >conftest.$ac_ext <<_ACEOF
14215 #line 14215 "configure"
14216 #include "confdefs.h"
14217 #include <stdio.h>
14218 int
14219 main (void)
14220 {
14221 printf("Hello world");
14222   ;
14223   return 0;
14224 }
14225 _ACEOF
14226 rm -f conftest.$ac_objext conftest$ac_exeext
14227 if { (eval echo "$as_me:14227: \"$ac_link\"") >&5
14228   (eval $ac_link) 2>&5
14229   ac_status=$?
14230   echo "$as_me:14230: \$? = $ac_status" >&5
14231   (exit $ac_status); } &&
14232          { ac_try='test -s conftest$ac_exeext'
14233   { (eval echo "$as_me:14233: \"$ac_try\"") >&5
14234   (eval $ac_try) 2>&5
14235   ac_status=$?
14236   echo "$as_me:14236: \$? = $ac_status" >&5
14237   (exit $ac_status); }; }; then
14238   :
14239 else
14240   echo "$as_me: failed program was:" >&5
14241 cat conftest.$ac_ext >&5
14242 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14243
14244 echo "${as_me:-configure}:14244: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14245
14246          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14247                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14248
14249 echo "${as_me:-configure}:14249: testing but keeping change to \$CPPFLAGS ..." 1>&5
14250
14251          fi
14252          CFLAGS="$cf_check_flags"
14253 fi
14254 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14255 fi
14256
14257         echo "$as_me:14257: checking for XOpenDisplay" >&5
14258 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14259 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14260   echo $ECHO_N "(cached) $ECHO_C" >&6
14261 else
14262   cat >conftest.$ac_ext <<_ACEOF
14263 #line 14263 "configure"
14264 #include "confdefs.h"
14265 #define XOpenDisplay autoconf_temporary
14266 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14267 #undef XOpenDisplay
14268
14269 #ifdef __cplusplus
14270 extern "C"
14271 #endif
14272
14273 /* We use char because int might match the return type of a gcc2
14274    builtin and then its argument prototype would still apply.  */
14275 char XOpenDisplay (void);
14276
14277 int
14278 main (void)
14279 {
14280
14281 /* The GNU C library defines stubs for functions which it implements
14282     to always fail with ENOSYS.  Some functions are actually named
14283     something starting with __ and the normal name is an alias.  */
14284 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14285 #error found stub for XOpenDisplay
14286 #endif
14287
14288         return XOpenDisplay ();
14289   ;
14290   return 0;
14291 }
14292 _ACEOF
14293 rm -f conftest.$ac_objext conftest$ac_exeext
14294 if { (eval echo "$as_me:14294: \"$ac_link\"") >&5
14295   (eval $ac_link) 2>&5
14296   ac_status=$?
14297   echo "$as_me:14297: \$? = $ac_status" >&5
14298   (exit $ac_status); } &&
14299          { ac_try='test -s conftest$ac_exeext'
14300   { (eval echo "$as_me:14300: \"$ac_try\"") >&5
14301   (eval $ac_try) 2>&5
14302   ac_status=$?
14303   echo "$as_me:14303: \$? = $ac_status" >&5
14304   (exit $ac_status); }; }; then
14305   ac_cv_func_XOpenDisplay=yes
14306 else
14307   echo "$as_me: failed program was:" >&5
14308 cat conftest.$ac_ext >&5
14309 ac_cv_func_XOpenDisplay=no
14310 fi
14311 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14312 fi
14313 echo "$as_me:14313: result: $ac_cv_func_XOpenDisplay" >&5
14314 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14315 if test $ac_cv_func_XOpenDisplay = yes; then
14316   :
14317 else
14318
14319         echo "$as_me:14319: checking for XOpenDisplay in -lX11" >&5
14320 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14321 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14322   echo $ECHO_N "(cached) $ECHO_C" >&6
14323 else
14324   ac_check_lib_save_LIBS=$LIBS
14325 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14326 cat >conftest.$ac_ext <<_ACEOF
14327 #line 14327 "configure"
14328 #include "confdefs.h"
14329
14330 /* Override any gcc2 internal prototype to avoid an error.  */
14331 #ifdef __cplusplus
14332 extern "C"
14333 #endif
14334 /* We use char because int might match the return type of a gcc2
14335    builtin and then its argument prototype would still apply.  */
14336 char XOpenDisplay ();
14337 int
14338 main (void)
14339 {
14340 XOpenDisplay ();
14341   ;
14342   return 0;
14343 }
14344 _ACEOF
14345 rm -f conftest.$ac_objext conftest$ac_exeext
14346 if { (eval echo "$as_me:14346: \"$ac_link\"") >&5
14347   (eval $ac_link) 2>&5
14348   ac_status=$?
14349   echo "$as_me:14349: \$? = $ac_status" >&5
14350   (exit $ac_status); } &&
14351          { ac_try='test -s conftest$ac_exeext'
14352   { (eval echo "$as_me:14352: \"$ac_try\"") >&5
14353   (eval $ac_try) 2>&5
14354   ac_status=$?
14355   echo "$as_me:14355: \$? = $ac_status" >&5
14356   (exit $ac_status); }; }; then
14357   ac_cv_lib_X11_XOpenDisplay=yes
14358 else
14359   echo "$as_me: failed program was:" >&5
14360 cat conftest.$ac_ext >&5
14361 ac_cv_lib_X11_XOpenDisplay=no
14362 fi
14363 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14364 LIBS=$ac_check_lib_save_LIBS
14365 fi
14366 echo "$as_me:14366: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14367 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14368 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14369
14370 cf_add_libs="-lX11"
14371 # Filter out duplicates - this happens with badly-designed ".pc" files...
14372 for cf_add_1lib in $LIBS
14373 do
14374         for cf_add_2lib in $cf_add_libs
14375         do
14376                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14377                 then
14378                         cf_add_1lib=
14379                         break
14380                 fi
14381         done
14382         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14383 done
14384 LIBS="$cf_add_libs"
14385
14386 fi
14387
14388 fi
14389
14390         echo "$as_me:14390: checking for XtAppInitialize" >&5
14391 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14392 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14393   echo $ECHO_N "(cached) $ECHO_C" >&6
14394 else
14395   cat >conftest.$ac_ext <<_ACEOF
14396 #line 14396 "configure"
14397 #include "confdefs.h"
14398 #define XtAppInitialize autoconf_temporary
14399 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14400 #undef XtAppInitialize
14401
14402 #ifdef __cplusplus
14403 extern "C"
14404 #endif
14405
14406 /* We use char because int might match the return type of a gcc2
14407    builtin and then its argument prototype would still apply.  */
14408 char XtAppInitialize (void);
14409
14410 int
14411 main (void)
14412 {
14413
14414 /* The GNU C library defines stubs for functions which it implements
14415     to always fail with ENOSYS.  Some functions are actually named
14416     something starting with __ and the normal name is an alias.  */
14417 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14418 #error found stub for XtAppInitialize
14419 #endif
14420
14421         return XtAppInitialize ();
14422   ;
14423   return 0;
14424 }
14425 _ACEOF
14426 rm -f conftest.$ac_objext conftest$ac_exeext
14427 if { (eval echo "$as_me:14427: \"$ac_link\"") >&5
14428   (eval $ac_link) 2>&5
14429   ac_status=$?
14430   echo "$as_me:14430: \$? = $ac_status" >&5
14431   (exit $ac_status); } &&
14432          { ac_try='test -s conftest$ac_exeext'
14433   { (eval echo "$as_me:14433: \"$ac_try\"") >&5
14434   (eval $ac_try) 2>&5
14435   ac_status=$?
14436   echo "$as_me:14436: \$? = $ac_status" >&5
14437   (exit $ac_status); }; }; then
14438   ac_cv_func_XtAppInitialize=yes
14439 else
14440   echo "$as_me: failed program was:" >&5
14441 cat conftest.$ac_ext >&5
14442 ac_cv_func_XtAppInitialize=no
14443 fi
14444 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14445 fi
14446 echo "$as_me:14446: result: $ac_cv_func_XtAppInitialize" >&5
14447 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14448 if test $ac_cv_func_XtAppInitialize = yes; then
14449   :
14450 else
14451
14452         echo "$as_me:14452: checking for XtAppInitialize in -lXt" >&5
14453 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14454 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14455   echo $ECHO_N "(cached) $ECHO_C" >&6
14456 else
14457   ac_check_lib_save_LIBS=$LIBS
14458 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14459 cat >conftest.$ac_ext <<_ACEOF
14460 #line 14460 "configure"
14461 #include "confdefs.h"
14462
14463 /* Override any gcc2 internal prototype to avoid an error.  */
14464 #ifdef __cplusplus
14465 extern "C"
14466 #endif
14467 /* We use char because int might match the return type of a gcc2
14468    builtin and then its argument prototype would still apply.  */
14469 char XtAppInitialize ();
14470 int
14471 main (void)
14472 {
14473 XtAppInitialize ();
14474   ;
14475   return 0;
14476 }
14477 _ACEOF
14478 rm -f conftest.$ac_objext conftest$ac_exeext
14479 if { (eval echo "$as_me:14479: \"$ac_link\"") >&5
14480   (eval $ac_link) 2>&5
14481   ac_status=$?
14482   echo "$as_me:14482: \$? = $ac_status" >&5
14483   (exit $ac_status); } &&
14484          { ac_try='test -s conftest$ac_exeext'
14485   { (eval echo "$as_me:14485: \"$ac_try\"") >&5
14486   (eval $ac_try) 2>&5
14487   ac_status=$?
14488   echo "$as_me:14488: \$? = $ac_status" >&5
14489   (exit $ac_status); }; }; then
14490   ac_cv_lib_Xt_XtAppInitialize=yes
14491 else
14492   echo "$as_me: failed program was:" >&5
14493 cat conftest.$ac_ext >&5
14494 ac_cv_lib_Xt_XtAppInitialize=no
14495 fi
14496 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14497 LIBS=$ac_check_lib_save_LIBS
14498 fi
14499 echo "$as_me:14499: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
14500 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
14501 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
14502
14503 cat >>confdefs.h <<\EOF
14504 #define HAVE_LIBXT 1
14505 EOF
14506
14507                  cf_have_X_LIBS=Xt
14508                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14509 fi
14510
14511 fi
14512
14513 fi
14514
14515 if test $cf_have_X_LIBS = no ; then
14516         { echo "$as_me:14516: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14517 test program.  You will have to check and add the proper libraries by hand
14518 to makefile." >&5
14519 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14520 test program.  You will have to check and add the proper libraries by hand
14521 to makefile." >&2;}
14522 fi
14523
14524 cf_x_athena_root=$cf_x_athena
14525 cf_x_athena_inc=""
14526
14527 for cf_path in default \
14528         /usr/contrib/X11R6 \
14529         /usr/contrib/X11R5 \
14530         /usr/lib/X11R5 \
14531         /usr/local
14532 do
14533         if test -z "$cf_x_athena_inc" ; then
14534                 cf_save="$CPPFLAGS"
14535                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
14536                 if test $cf_path != default ; then
14537                         CPPFLAGS="$cf_save"
14538
14539         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14540         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
14541
14542                         echo "$as_me:14542: checking for $cf_test in $cf_path" >&5
14543 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
14544                 else
14545                         echo "$as_me:14545: checking for $cf_test" >&5
14546 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
14547                 fi
14548                 cat >conftest.$ac_ext <<_ACEOF
14549 #line 14549 "configure"
14550 #include "confdefs.h"
14551
14552 #include <X11/Intrinsic.h>
14553 #include <$cf_test>
14554 int
14555 main (void)
14556 {
14557
14558   ;
14559   return 0;
14560 }
14561 _ACEOF
14562 rm -f conftest.$ac_objext
14563 if { (eval echo "$as_me:14563: \"$ac_compile\"") >&5
14564   (eval $ac_compile) 2>&5
14565   ac_status=$?
14566   echo "$as_me:14566: \$? = $ac_status" >&5
14567   (exit $ac_status); } &&
14568          { ac_try='test -s conftest.$ac_objext'
14569   { (eval echo "$as_me:14569: \"$ac_try\"") >&5
14570   (eval $ac_try) 2>&5
14571   ac_status=$?
14572   echo "$as_me:14572: \$? = $ac_status" >&5
14573   (exit $ac_status); }; }; then
14574   cf_result=yes
14575 else
14576   echo "$as_me: failed program was:" >&5
14577 cat conftest.$ac_ext >&5
14578 cf_result=no
14579 fi
14580 rm -f conftest.$ac_objext conftest.$ac_ext
14581                 echo "$as_me:14581: result: $cf_result" >&5
14582 echo "${ECHO_T}$cf_result" >&6
14583                 if test "$cf_result" = yes ; then
14584                         cf_x_athena_inc=$cf_path
14585                         break
14586                 else
14587                         CPPFLAGS="$cf_save"
14588                 fi
14589         fi
14590 done
14591
14592 if test -z "$cf_x_athena_inc" ; then
14593         { echo "$as_me:14593: WARNING: Unable to successfully find Athena header files with test program" >&5
14594 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
14595 elif test "$cf_x_athena_inc" != default ; then
14596
14597         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14598         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
14599
14600 fi
14601
14602 cf_x_athena_root=$cf_x_athena
14603 cf_x_athena_lib=""
14604
14605 for cf_path in default \
14606         /usr/contrib/X11R6 \
14607         /usr/contrib/X11R5 \
14608         /usr/lib/X11R5 \
14609         /usr/local
14610 do
14611         for cf_lib in \
14612                 ${cf_x_athena_root} \
14613                 ${cf_x_athena_root}7 \
14614                 ${cf_x_athena_root}6
14615         do
14616         for cf_libs in \
14617                 "-l$cf_lib -lXmu" \
14618                 "-l$cf_lib -lXpm -lXmu" \
14619                 "-l${cf_lib}_s -lXmu_s"
14620         do
14621                 if test -z "$cf_x_athena_lib" ; then
14622                         cf_save="$LIBS"
14623                         cf_test=XawSimpleMenuAddGlobalActions
14624                         if test $cf_path != default ; then
14625
14626 cf_add_libs="-L$cf_path/lib $cf_libs"
14627 # Filter out duplicates - this happens with badly-designed ".pc" files...
14628 for cf_add_1lib in $LIBS
14629 do
14630         for cf_add_2lib in $cf_add_libs
14631         do
14632                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14633                 then
14634                         cf_add_1lib=
14635                         break
14636                 fi
14637         done
14638         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14639 done
14640 LIBS="$cf_add_libs"
14641
14642                                 echo "$as_me:14642: checking for $cf_libs in $cf_path" >&5
14643 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
14644                         else
14645
14646 cf_add_libs="$cf_libs"
14647 # Filter out duplicates - this happens with badly-designed ".pc" files...
14648 for cf_add_1lib in $LIBS
14649 do
14650         for cf_add_2lib in $cf_add_libs
14651         do
14652                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14653                 then
14654                         cf_add_1lib=
14655                         break
14656                 fi
14657         done
14658         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14659 done
14660 LIBS="$cf_add_libs"
14661
14662                                 echo "$as_me:14662: checking for $cf_test in $cf_libs" >&5
14663 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
14664                         fi
14665                         cat >conftest.$ac_ext <<_ACEOF
14666 #line 14666 "configure"
14667 #include "confdefs.h"
14668
14669 #include <X11/Intrinsic.h>
14670 #include <X11/$cf_x_athena_root/SimpleMenu.h>
14671
14672 int
14673 main (void)
14674 {
14675
14676 $cf_test((XtAppContext) 0)
14677   ;
14678   return 0;
14679 }
14680 _ACEOF
14681 rm -f conftest.$ac_objext conftest$ac_exeext
14682 if { (eval echo "$as_me:14682: \"$ac_link\"") >&5
14683   (eval $ac_link) 2>&5
14684   ac_status=$?
14685   echo "$as_me:14685: \$? = $ac_status" >&5
14686   (exit $ac_status); } &&
14687          { ac_try='test -s conftest$ac_exeext'
14688   { (eval echo "$as_me:14688: \"$ac_try\"") >&5
14689   (eval $ac_try) 2>&5
14690   ac_status=$?
14691   echo "$as_me:14691: \$? = $ac_status" >&5
14692   (exit $ac_status); }; }; then
14693   cf_result=yes
14694 else
14695   echo "$as_me: failed program was:" >&5
14696 cat conftest.$ac_ext >&5
14697 cf_result=no
14698 fi
14699 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14700                         echo "$as_me:14700: result: $cf_result" >&5
14701 echo "${ECHO_T}$cf_result" >&6
14702                         if test "$cf_result" = yes ; then
14703                                 cf_x_athena_lib="$cf_libs"
14704                                 break
14705                         fi
14706                         LIBS="$cf_save"
14707                 fi
14708         done # cf_libs
14709                 test -n "$cf_x_athena_lib" && break
14710         done # cf_lib
14711 done
14712
14713 if test -z "$cf_x_athena_lib" ; then
14714         { { echo "$as_me:14714: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
14715 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
14716    { (exit 1); exit 1; }; }
14717 fi
14718
14719 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14720
14721 cat >>confdefs.h <<EOF
14722 #define $cf_x_athena_LIBS 1
14723 EOF
14724
14725 fi
14726
14727 if test -n "$ac_tool_prefix"; then
14728   for ac_prog in xcurses-config
14729   do
14730     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
14731 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
14732 echo "$as_me:14732: checking for $ac_word" >&5
14733 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14734 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
14735   echo $ECHO_N "(cached) $ECHO_C" >&6
14736 else
14737   if test -n "$XCURSES_CONFIG"; then
14738   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
14739 else
14740   ac_save_IFS=$IFS; IFS=$ac_path_separator
14741 ac_dummy="$PATH"
14742 for ac_dir in $ac_dummy; do
14743   IFS=$ac_save_IFS
14744   test -z "$ac_dir" && ac_dir=.
14745   $as_executable_p "$ac_dir/$ac_word" || continue
14746 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
14747 echo "$as_me:14747: found $ac_dir/$ac_word" >&5
14748 break
14749 done
14750
14751 fi
14752 fi
14753 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
14754 if test -n "$XCURSES_CONFIG"; then
14755   echo "$as_me:14755: result: $XCURSES_CONFIG" >&5
14756 echo "${ECHO_T}$XCURSES_CONFIG" >&6
14757 else
14758   echo "$as_me:14758: result: no" >&5
14759 echo "${ECHO_T}no" >&6
14760 fi
14761
14762     test -n "$XCURSES_CONFIG" && break
14763   done
14764 fi
14765 if test -z "$XCURSES_CONFIG"; then
14766   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
14767   for ac_prog in xcurses-config
14768 do
14769   # Extract the first word of "$ac_prog", so it can be a program name with args.
14770 set dummy $ac_prog; ac_word=$2
14771 echo "$as_me:14771: checking for $ac_word" >&5
14772 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14773 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
14774   echo $ECHO_N "(cached) $ECHO_C" >&6
14775 else
14776   if test -n "$ac_ct_XCURSES_CONFIG"; then
14777   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
14778 else
14779   ac_save_IFS=$IFS; IFS=$ac_path_separator
14780 ac_dummy="$PATH"
14781 for ac_dir in $ac_dummy; do
14782   IFS=$ac_save_IFS
14783   test -z "$ac_dir" && ac_dir=.
14784   $as_executable_p "$ac_dir/$ac_word" || continue
14785 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
14786 echo "$as_me:14786: found $ac_dir/$ac_word" >&5
14787 break
14788 done
14789
14790 fi
14791 fi
14792 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
14793 if test -n "$ac_ct_XCURSES_CONFIG"; then
14794   echo "$as_me:14794: result: $ac_ct_XCURSES_CONFIG" >&5
14795 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
14796 else
14797   echo "$as_me:14797: result: no" >&5
14798 echo "${ECHO_T}no" >&6
14799 fi
14800
14801   test -n "$ac_ct_XCURSES_CONFIG" && break
14802 done
14803 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
14804
14805   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
14806 fi
14807
14808 if test "$XCURSES_CONFIG" != none ; then
14809
14810 cf_fix_cppflags=no
14811 cf_new_cflags=
14812 cf_new_cppflags=
14813 cf_new_extra_cppflags=
14814
14815 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
14816 do
14817 case $cf_fix_cppflags in
14818 (no)
14819         case $cf_add_cflags in
14820         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14821                 case $cf_add_cflags in
14822                 (-D*)
14823                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14824
14825                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14826                                 && test -z "${cf_tst_cflags}" \
14827                                 && cf_fix_cppflags=yes
14828
14829                         if test $cf_fix_cppflags = yes ; then
14830
14831         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14832         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14833
14834                                 continue
14835                         elif test "${cf_tst_cflags}" = "\"'" ; then
14836
14837         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14838         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14839
14840                                 continue
14841                         fi
14842                         ;;
14843                 esac
14844                 case "$CPPFLAGS" in
14845                 (*$cf_add_cflags)
14846                         ;;
14847                 (*)
14848                         case $cf_add_cflags in
14849                         (-D*)
14850                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14851
14852 CPPFLAGS=`echo "$CPPFLAGS" | \
14853         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14854                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14855
14856                                 ;;
14857                         esac
14858
14859         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14860         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14861
14862                         ;;
14863                 esac
14864                 ;;
14865         (*)
14866
14867         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14868         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14869
14870                 ;;
14871         esac
14872         ;;
14873 (yes)
14874
14875         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14876         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14877
14878         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14879
14880         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14881                 && test -z "${cf_tst_cflags}" \
14882                 && cf_fix_cppflags=no
14883         ;;
14884 esac
14885 done
14886
14887 if test -n "$cf_new_cflags" ; then
14888
14889         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14890         CFLAGS="${CFLAGS}$cf_new_cflags"
14891
14892 fi
14893
14894 if test -n "$cf_new_cppflags" ; then
14895
14896         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14897         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14898
14899 fi
14900
14901 if test -n "$cf_new_extra_cppflags" ; then
14902
14903         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14904         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14905
14906 fi
14907
14908 cf_add_libs="`$XCURSES_CONFIG --libs`"
14909 # Filter out duplicates - this happens with badly-designed ".pc" files...
14910 for cf_add_1lib in $LIBS
14911 do
14912         for cf_add_2lib in $cf_add_libs
14913         do
14914                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14915                 then
14916                         cf_add_1lib=
14917                         break
14918                 fi
14919         done
14920         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14921 done
14922 LIBS="$cf_add_libs"
14923
14924 cf_cv_lib_XCurses=yes
14925
14926 else
14927
14928 LDFLAGS="$LDFLAGS $X_LIBS"
14929
14930 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14931
14932 echo "${as_me:-configure}:14932: testing checking additions to CFLAGS ..." 1>&5
14933
14934 cf_check_cflags="$CFLAGS"
14935 cf_check_cppflags="$CPPFLAGS"
14936
14937 cf_fix_cppflags=no
14938 cf_new_cflags=
14939 cf_new_cppflags=
14940 cf_new_extra_cppflags=
14941
14942 for cf_add_cflags in $X_CFLAGS
14943 do
14944 case $cf_fix_cppflags in
14945 (no)
14946         case $cf_add_cflags in
14947         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14948                 case $cf_add_cflags in
14949                 (-D*)
14950                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14951
14952                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14953                                 && test -z "${cf_tst_cflags}" \
14954                                 && cf_fix_cppflags=yes
14955
14956                         if test $cf_fix_cppflags = yes ; then
14957
14958         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14959         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14960
14961                                 continue
14962                         elif test "${cf_tst_cflags}" = "\"'" ; then
14963
14964         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14965         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14966
14967                                 continue
14968                         fi
14969                         ;;
14970                 esac
14971                 case "$CPPFLAGS" in
14972                 (*$cf_add_cflags)
14973                         ;;
14974                 (*)
14975                         case $cf_add_cflags in
14976                         (-D*)
14977                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14978
14979 CPPFLAGS=`echo "$CPPFLAGS" | \
14980         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14981                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14982
14983                                 ;;
14984                         esac
14985
14986         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14987         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14988
14989                         ;;
14990                 esac
14991                 ;;
14992         (*)
14993
14994         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14995         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14996
14997                 ;;
14998         esac
14999         ;;
15000 (yes)
15001
15002         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15003         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15004
15005         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15006
15007         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15008                 && test -z "${cf_tst_cflags}" \
15009                 && cf_fix_cppflags=no
15010         ;;
15011 esac
15012 done
15013
15014 if test -n "$cf_new_cflags" ; then
15015         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15016
15017 echo "${as_me:-configure}:15017: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15018
15019         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15020         CFLAGS="${CFLAGS}$cf_new_cflags"
15021
15022 fi
15023
15024 if test -n "$cf_new_cppflags" ; then
15025         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15026
15027 echo "${as_me:-configure}:15027: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15028
15029         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15030         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15031
15032 fi
15033
15034 if test -n "$cf_new_extra_cppflags" ; then
15035         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15036
15037 echo "${as_me:-configure}:15037: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15038
15039         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15040         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15041
15042 fi
15043
15044 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15045 cat >conftest.$ac_ext <<_ACEOF
15046 #line 15046 "configure"
15047 #include "confdefs.h"
15048 #include <stdio.h>
15049 int
15050 main (void)
15051 {
15052 printf("Hello world");
15053   ;
15054   return 0;
15055 }
15056 _ACEOF
15057 rm -f conftest.$ac_objext conftest$ac_exeext
15058 if { (eval echo "$as_me:15058: \"$ac_link\"") >&5
15059   (eval $ac_link) 2>&5
15060   ac_status=$?
15061   echo "$as_me:15061: \$? = $ac_status" >&5
15062   (exit $ac_status); } &&
15063          { ac_try='test -s conftest$ac_exeext'
15064   { (eval echo "$as_me:15064: \"$ac_try\"") >&5
15065   (eval $ac_try) 2>&5
15066   ac_status=$?
15067   echo "$as_me:15067: \$? = $ac_status" >&5
15068   (exit $ac_status); }; }; then
15069   :
15070 else
15071   echo "$as_me: failed program was:" >&5
15072 cat conftest.$ac_ext >&5
15073 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15074
15075 echo "${as_me:-configure}:15075: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15076
15077          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15078                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15079
15080 echo "${as_me:-configure}:15080: testing but keeping change to \$CPPFLAGS ..." 1>&5
15081
15082          fi
15083          CFLAGS="$cf_check_flags"
15084 fi
15085 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15086 fi
15087
15088 echo "$as_me:15088: checking for XOpenDisplay in -lX11" >&5
15089 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15090 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15091   echo $ECHO_N "(cached) $ECHO_C" >&6
15092 else
15093   ac_check_lib_save_LIBS=$LIBS
15094 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15095 cat >conftest.$ac_ext <<_ACEOF
15096 #line 15096 "configure"
15097 #include "confdefs.h"
15098
15099 /* Override any gcc2 internal prototype to avoid an error.  */
15100 #ifdef __cplusplus
15101 extern "C"
15102 #endif
15103 /* We use char because int might match the return type of a gcc2
15104    builtin and then its argument prototype would still apply.  */
15105 char XOpenDisplay ();
15106 int
15107 main (void)
15108 {
15109 XOpenDisplay ();
15110   ;
15111   return 0;
15112 }
15113 _ACEOF
15114 rm -f conftest.$ac_objext conftest$ac_exeext
15115 if { (eval echo "$as_me:15115: \"$ac_link\"") >&5
15116   (eval $ac_link) 2>&5
15117   ac_status=$?
15118   echo "$as_me:15118: \$? = $ac_status" >&5
15119   (exit $ac_status); } &&
15120          { ac_try='test -s conftest$ac_exeext'
15121   { (eval echo "$as_me:15121: \"$ac_try\"") >&5
15122   (eval $ac_try) 2>&5
15123   ac_status=$?
15124   echo "$as_me:15124: \$? = $ac_status" >&5
15125   (exit $ac_status); }; }; then
15126   ac_cv_lib_X11_XOpenDisplay=yes
15127 else
15128   echo "$as_me: failed program was:" >&5
15129 cat conftest.$ac_ext >&5
15130 ac_cv_lib_X11_XOpenDisplay=no
15131 fi
15132 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15133 LIBS=$ac_check_lib_save_LIBS
15134 fi
15135 echo "$as_me:15135: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15136 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15137 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15138
15139 cf_add_libs="-lX11"
15140 # Filter out duplicates - this happens with badly-designed ".pc" files...
15141 for cf_add_1lib in $LIBS
15142 do
15143         for cf_add_2lib in $cf_add_libs
15144         do
15145                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15146                 then
15147                         cf_add_1lib=
15148                         break
15149                 fi
15150         done
15151         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15152 done
15153 LIBS="$cf_add_libs"
15154
15155 fi
15156
15157 echo "$as_me:15157: checking for XCurses library" >&5
15158 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15159 if test "${cf_cv_lib_XCurses+set}" = set; then
15160   echo $ECHO_N "(cached) $ECHO_C" >&6
15161 else
15162
15163 cf_add_libs="-lXCurses"
15164 # Filter out duplicates - this happens with badly-designed ".pc" files...
15165 for cf_add_1lib in $LIBS
15166 do
15167         for cf_add_2lib in $cf_add_libs
15168         do
15169                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15170                 then
15171                         cf_add_1lib=
15172                         break
15173                 fi
15174         done
15175         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15176 done
15177 LIBS="$cf_add_libs"
15178
15179 cat >conftest.$ac_ext <<_ACEOF
15180 #line 15180 "configure"
15181 #include "confdefs.h"
15182
15183 #include <xcurses.h>
15184 char *XCursesProgramName = "test";
15185
15186 int
15187 main (void)
15188 {
15189 XCursesExit();
15190   ;
15191   return 0;
15192 }
15193 _ACEOF
15194 rm -f conftest.$ac_objext conftest$ac_exeext
15195 if { (eval echo "$as_me:15195: \"$ac_link\"") >&5
15196   (eval $ac_link) 2>&5
15197   ac_status=$?
15198   echo "$as_me:15198: \$? = $ac_status" >&5
15199   (exit $ac_status); } &&
15200          { ac_try='test -s conftest$ac_exeext'
15201   { (eval echo "$as_me:15201: \"$ac_try\"") >&5
15202   (eval $ac_try) 2>&5
15203   ac_status=$?
15204   echo "$as_me:15204: \$? = $ac_status" >&5
15205   (exit $ac_status); }; }; then
15206   cf_cv_lib_XCurses=yes
15207 else
15208   echo "$as_me: failed program was:" >&5
15209 cat conftest.$ac_ext >&5
15210 cf_cv_lib_XCurses=no
15211 fi
15212 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15213
15214 fi
15215 echo "$as_me:15215: result: $cf_cv_lib_XCurses" >&5
15216 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15217
15218 fi
15219
15220 if test $cf_cv_lib_XCurses = yes ; then
15221
15222 cat >>confdefs.h <<\EOF
15223 #define UNIX 1
15224 EOF
15225
15226 cat >>confdefs.h <<\EOF
15227 #define XCURSES 1
15228 EOF
15229
15230         echo "$as_me:15230: checking for xcurses.h" >&5
15231 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15232 if test "${ac_cv_header_xcurses_h+set}" = set; then
15233   echo $ECHO_N "(cached) $ECHO_C" >&6
15234 else
15235   cat >conftest.$ac_ext <<_ACEOF
15236 #line 15236 "configure"
15237 #include "confdefs.h"
15238 #include <xcurses.h>
15239 _ACEOF
15240 if { (eval echo "$as_me:15240: \"$ac_cpp conftest.$ac_ext\"") >&5
15241   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15242   ac_status=$?
15243   egrep -v '^ *\+' conftest.er1 >conftest.err
15244   rm -f conftest.er1
15245   cat conftest.err >&5
15246   echo "$as_me:15246: \$? = $ac_status" >&5
15247   (exit $ac_status); } >/dev/null; then
15248   if test -s conftest.err; then
15249     ac_cpp_err=$ac_c_preproc_warn_flag
15250   else
15251     ac_cpp_err=
15252   fi
15253 else
15254   ac_cpp_err=yes
15255 fi
15256 if test -z "$ac_cpp_err"; then
15257   ac_cv_header_xcurses_h=yes
15258 else
15259   echo "$as_me: failed program was:" >&5
15260   cat conftest.$ac_ext >&5
15261   ac_cv_header_xcurses_h=no
15262 fi
15263 rm -f conftest.err conftest.$ac_ext
15264 fi
15265 echo "$as_me:15265: result: $ac_cv_header_xcurses_h" >&5
15266 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15267 if test $ac_cv_header_xcurses_h = yes; then
15268
15269 cat >>confdefs.h <<\EOF
15270 #define HAVE_XCURSES 1
15271 EOF
15272
15273 fi
15274
15275 else
15276         { { echo "$as_me:15276: error: Cannot link with XCurses" >&5
15277 echo "$as_me: error: Cannot link with XCurses" >&2;}
15278    { (exit 1); exit 1; }; }
15279 fi
15280
15281         ;;
15282 (*)
15283         { { echo "$as_me:15283: error: unexpected screen-value: $cf_cv_screen" >&5
15284 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15285    { (exit 1); exit 1; }; }
15286         ;;
15287 esac
15288
15289 : ${cf_nculib_root:=$cf_cv_screen}
15290 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15291 echo "$as_me:15291: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15292 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15293 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15294   echo $ECHO_N "(cached) $ECHO_C" >&6
15295 else
15296   ac_check_lib_save_LIBS=$LIBS
15297 LIBS="-l$cf_nculib_root  $LIBS"
15298 cat >conftest.$ac_ext <<_ACEOF
15299 #line 15299 "configure"
15300 #include "confdefs.h"
15301
15302 /* Override any gcc2 internal prototype to avoid an error.  */
15303 #ifdef __cplusplus
15304 extern "C"
15305 #endif
15306 /* We use char because int might match the return type of a gcc2
15307    builtin and then its argument prototype would still apply.  */
15308 char _nc_init_pthreads ();
15309 int
15310 main (void)
15311 {
15312 _nc_init_pthreads ();
15313   ;
15314   return 0;
15315 }
15316 _ACEOF
15317 rm -f conftest.$ac_objext conftest$ac_exeext
15318 if { (eval echo "$as_me:15318: \"$ac_link\"") >&5
15319   (eval $ac_link) 2>&5
15320   ac_status=$?
15321   echo "$as_me:15321: \$? = $ac_status" >&5
15322   (exit $ac_status); } &&
15323          { ac_try='test -s conftest$ac_exeext'
15324   { (eval echo "$as_me:15324: \"$ac_try\"") >&5
15325   (eval $ac_try) 2>&5
15326   ac_status=$?
15327   echo "$as_me:15327: \$? = $ac_status" >&5
15328   (exit $ac_status); }; }; then
15329   eval "$as_ac_Lib=yes"
15330 else
15331   echo "$as_me: failed program was:" >&5
15332 cat conftest.$ac_ext >&5
15333 eval "$as_ac_Lib=no"
15334 fi
15335 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15336 LIBS=$ac_check_lib_save_LIBS
15337 fi
15338 echo "$as_me:15338: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15339 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15340 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15341   cf_cv_ncurses_pthreads=yes
15342 else
15343   cf_cv_ncurses_pthreads=no
15344 fi
15345
15346 if test "$cf_cv_ncurses_pthreads" = yes
15347 then
15348
15349 cf_add_libs="-lpthread"
15350 # Filter out duplicates - this happens with badly-designed ".pc" files...
15351 for cf_add_1lib in $LIBS
15352 do
15353         for cf_add_2lib in $cf_add_libs
15354         do
15355                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15356                 then
15357                         cf_add_1lib=
15358                         break
15359                 fi
15360         done
15361         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15362 done
15363 LIBS="$cf_add_libs"
15364
15365 fi
15366
15367 case $cf_cv_screen in
15368 (ncurses*)
15369         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15370         ;;
15371 esac
15372
15373 echo "$as_me:15373: checking for X11 rgb file" >&5
15374 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15375
15376 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15377 if test "${with_x11_rgb+set}" = set; then
15378   withval="$with_x11_rgb"
15379   RGB_PATH=$withval
15380 else
15381   RGB_PATH=auto
15382 fi;
15383
15384 if test "x$RGB_PATH" = xauto
15385 then
15386         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15387         for cf_path in \
15388                 /opt/local/share/X11/rgb.txt \
15389                 /opt/X11/share/X11/rgb.txt \
15390                 /usr/share/X11/rgb.txt \
15391                 /usr/X11/share/X11/rgb.txt \
15392                 /usr/X11/lib/X11/rgb.txt \
15393                 /usr/lib/X11/rgb.txt \
15394                 /etc/X11/rgb.txt \
15395                 /usr/pkg/lib/X11/rgb.txt \
15396                 /usr/X11R7/lib/X11/rgb.txt \
15397                 /usr/X11R6/lib/X11/rgb.txt \
15398                 /usr/X11R5/lib/X11/rgb.txt \
15399                 /usr/X11R4/lib/X11/rgb.txt \
15400                 /usr/local/lib/X11/rgb.txt \
15401                 /usr/local/share/X11/rgb.txt \
15402                 /usr/lib64/X11/rgb.txt
15403         do
15404                 if test -f "$cf_path" ; then
15405                         RGB_PATH="$cf_path"
15406                         break
15407                 fi
15408         done
15409 else
15410         cf_path=$RGB_PATH
15411
15412 if test "x$prefix" != xNONE; then
15413         cf_path_syntax="$prefix"
15414 else
15415         cf_path_syntax="$ac_default_prefix"
15416 fi
15417
15418 case ".$cf_path" in
15419 (.\$\(*\)*|.\'*\'*)
15420         ;;
15421 (..|./*|.\\*)
15422         ;;
15423 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15424         ;;
15425 (.\${*prefix}*|.\${*dir}*)
15426         eval cf_path="$cf_path"
15427         case ".$cf_path" in
15428         (.NONE/*)
15429                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15430                 ;;
15431         esac
15432         ;;
15433 (.no|.NONE/*)
15434         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15435         ;;
15436 (*)
15437         { { echo "$as_me:15437: error: expected a pathname, not \"$cf_path\"" >&5
15438 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15439    { (exit 1); exit 1; }; }
15440         ;;
15441 esac
15442
15443 fi
15444
15445 echo "$as_me:15445: result: $RGB_PATH" >&5
15446 echo "${ECHO_T}$RGB_PATH" >&6
15447
15448 cat >>confdefs.h <<EOF
15449 #define RGB_PATH "$cf_path"
15450 EOF
15451
15452 no_x11_rgb=
15453 if test "$RGB_PATH" = no
15454 then
15455         no_x11_rgb="#"
15456 fi
15457
15458 cf_curses_headers=
15459
15460 case $cf_cv_screen in
15461 (pdcurses)
15462         cf_default_panel=no
15463         cf_default_form=no
15464         cf_default_menu=no
15465         cf_default_tinfo=no
15466         ;;
15467 (xcurses|bsdcurses)
15468         cf_default_panel=no
15469         cf_default_form=no
15470         cf_default_menu=no
15471         cf_default_tinfo=yes
15472         ;;
15473 (*)
15474         cf_default_panel=yes
15475         cf_default_form=yes
15476         cf_default_menu=yes
15477         cf_default_tinfo=yes
15478         case $cf_cv_screen in
15479         (ncurses*)
15480                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
15481                 ;;
15482         esac
15483         ;;
15484 esac
15485
15486 echo "$as_me:15486: checking if you want to check for panel functions" >&5
15487 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
15488
15489 # Check whether --enable-panel or --disable-panel was given.
15490 if test "${enable_panel+set}" = set; then
15491   enableval="$enable_panel"
15492   test "$enableval" != no && enableval=yes
15493         if test "$enableval" != "yes" ; then
15494     cf_enable_panel=no
15495         else
15496                 cf_enable_panel=$cf_default_panel
15497         fi
15498 else
15499   enableval=yes
15500         cf_enable_panel=$cf_default_panel
15501
15502 fi;
15503 echo "$as_me:15503: result: $cf_enable_panel" >&5
15504 echo "${ECHO_T}$cf_enable_panel" >&6
15505 if test $cf_enable_panel = yes
15506 then
15507
15508 cf_have_curses_lib=no
15509
15510 : ${NCURSES_CONFIG_PKG:=none}
15511 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15512         :
15513 elif test "x${PKG_CONFIG:=none}" != xnone; then
15514         echo "$as_me:15514: checking pkg-config for panel$cf_cv_libtype" >&5
15515 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
15516         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
15517                 echo "$as_me:15517: result: yes" >&5
15518 echo "${ECHO_T}yes" >&6
15519
15520                 echo "$as_me:15520: checking if the panel$cf_cv_libtype package files work" >&5
15521 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
15522
15523                 cf_save_CPPFLAGS="$CPPFLAGS"
15524                 cf_save_LIBS="$LIBS"
15525
15526 cf_fix_cppflags=no
15527 cf_new_cflags=
15528 cf_new_cppflags=
15529 cf_new_extra_cppflags=
15530
15531 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
15532 do
15533 case $cf_fix_cppflags in
15534 (no)
15535         case $cf_add_cflags in
15536         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15537                 case $cf_add_cflags in
15538                 (-D*)
15539                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15540
15541                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15542                                 && test -z "${cf_tst_cflags}" \
15543                                 && cf_fix_cppflags=yes
15544
15545                         if test $cf_fix_cppflags = yes ; then
15546
15547         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15548         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15549
15550                                 continue
15551                         elif test "${cf_tst_cflags}" = "\"'" ; then
15552
15553         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15554         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15555
15556                                 continue
15557                         fi
15558                         ;;
15559                 esac
15560                 case "$CPPFLAGS" in
15561                 (*$cf_add_cflags)
15562                         ;;
15563                 (*)
15564                         case $cf_add_cflags in
15565                         (-D*)
15566                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15567
15568 CPPFLAGS=`echo "$CPPFLAGS" | \
15569         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15570                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15571
15572                                 ;;
15573                         esac
15574
15575         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15576         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15577
15578                         ;;
15579                 esac
15580                 ;;
15581         (*)
15582
15583         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15584         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15585
15586                 ;;
15587         esac
15588         ;;
15589 (yes)
15590
15591         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15592         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15593
15594         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15595
15596         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15597                 && test -z "${cf_tst_cflags}" \
15598                 && cf_fix_cppflags=no
15599         ;;
15600 esac
15601 done
15602
15603 if test -n "$cf_new_cflags" ; then
15604
15605         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15606         CFLAGS="${CFLAGS}$cf_new_cflags"
15607
15608 fi
15609
15610 if test -n "$cf_new_cppflags" ; then
15611
15612         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15613         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15614
15615 fi
15616
15617 if test -n "$cf_new_extra_cppflags" ; then
15618
15619         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15620         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15621
15622 fi
15623
15624 cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
15625 # Filter out duplicates - this happens with badly-designed ".pc" files...
15626 for cf_add_1lib in $LIBS
15627 do
15628         for cf_add_2lib in $cf_add_libs
15629         do
15630                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15631                 then
15632                         cf_add_1lib=
15633                         break
15634                 fi
15635         done
15636         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15637 done
15638 LIBS="$cf_add_libs"
15639
15640                 cat >conftest.$ac_ext <<_ACEOF
15641 #line 15641 "configure"
15642 #include "confdefs.h"
15643 #include <panel.h>
15644 int
15645 main (void)
15646 {
15647 (void) new_panel ( 0 );
15648   ;
15649   return 0;
15650 }
15651 _ACEOF
15652 rm -f conftest.$ac_objext conftest$ac_exeext
15653 if { (eval echo "$as_me:15653: \"$ac_link\"") >&5
15654   (eval $ac_link) 2>&5
15655   ac_status=$?
15656   echo "$as_me:15656: \$? = $ac_status" >&5
15657   (exit $ac_status); } &&
15658          { ac_try='test -s conftest$ac_exeext'
15659   { (eval echo "$as_me:15659: \"$ac_try\"") >&5
15660   (eval $ac_try) 2>&5
15661   ac_status=$?
15662   echo "$as_me:15662: \$? = $ac_status" >&5
15663   (exit $ac_status); }; }; then
15664   if test "$cross_compiling" = yes; then
15665   cf_have_curses_lib=maybe
15666 else
15667   cat >conftest.$ac_ext <<_ACEOF
15668 #line 15668 "configure"
15669 #include "confdefs.h"
15670 #include <panel.h>
15671                                 int main(void)
15672                                 { (void) new_panel ( 0 ); return 0; }
15673 _ACEOF
15674 rm -f conftest$ac_exeext
15675 if { (eval echo "$as_me:15675: \"$ac_link\"") >&5
15676   (eval $ac_link) 2>&5
15677   ac_status=$?
15678   echo "$as_me:15678: \$? = $ac_status" >&5
15679   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15680   { (eval echo "$as_me:15680: \"$ac_try\"") >&5
15681   (eval $ac_try) 2>&5
15682   ac_status=$?
15683   echo "$as_me:15683: \$? = $ac_status" >&5
15684   (exit $ac_status); }; }; then
15685   cf_have_curses_lib=yes
15686 else
15687   echo "$as_me: program exited with status $ac_status" >&5
15688 echo "$as_me: failed program was:" >&5
15689 cat conftest.$ac_ext >&5
15690 cf_have_curses_lib=no
15691 fi
15692 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15693 fi
15694 else
15695   echo "$as_me: failed program was:" >&5
15696 cat conftest.$ac_ext >&5
15697 cf_have_curses_lib=no
15698 fi
15699 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15700                 echo "$as_me:15700: result: $cf_have_curses_lib" >&5
15701 echo "${ECHO_T}$cf_have_curses_lib" >&6
15702                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15703                 if test "$cf_have_curses_lib" != "yes"
15704                 then
15705                         CPPFLAGS="$cf_save_CPPFLAGS"
15706                         LIBS="$cf_save_LIBS"
15707                 else
15708
15709 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15710
15711                         cat >>confdefs.h <<EOF
15712 #define $cf_upper 1
15713 EOF
15714
15715                 fi
15716         fi
15717 fi
15718 if test "$cf_have_curses_lib" = no; then
15719         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
15720 echo "$as_me:15720: checking for new_panel in -lpanel$cf_cv_libtype" >&5
15721 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
15722 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15723   echo $ECHO_N "(cached) $ECHO_C" >&6
15724 else
15725   ac_check_lib_save_LIBS=$LIBS
15726 LIBS="-lpanel$cf_cv_libtype  $LIBS"
15727 cat >conftest.$ac_ext <<_ACEOF
15728 #line 15728 "configure"
15729 #include "confdefs.h"
15730
15731 /* Override any gcc2 internal prototype to avoid an error.  */
15732 #ifdef __cplusplus
15733 extern "C"
15734 #endif
15735 /* We use char because int might match the return type of a gcc2
15736    builtin and then its argument prototype would still apply.  */
15737 char new_panel ();
15738 int
15739 main (void)
15740 {
15741 new_panel ();
15742   ;
15743   return 0;
15744 }
15745 _ACEOF
15746 rm -f conftest.$ac_objext conftest$ac_exeext
15747 if { (eval echo "$as_me:15747: \"$ac_link\"") >&5
15748   (eval $ac_link) 2>&5
15749   ac_status=$?
15750   echo "$as_me:15750: \$? = $ac_status" >&5
15751   (exit $ac_status); } &&
15752          { ac_try='test -s conftest$ac_exeext'
15753   { (eval echo "$as_me:15753: \"$ac_try\"") >&5
15754   (eval $ac_try) 2>&5
15755   ac_status=$?
15756   echo "$as_me:15756: \$? = $ac_status" >&5
15757   (exit $ac_status); }; }; then
15758   eval "$as_ac_Lib=yes"
15759 else
15760   echo "$as_me: failed program was:" >&5
15761 cat conftest.$ac_ext >&5
15762 eval "$as_ac_Lib=no"
15763 fi
15764 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15765 LIBS=$ac_check_lib_save_LIBS
15766 fi
15767 echo "$as_me:15767: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15768 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15769 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15770
15771 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15772
15773 cf_add_libs="-lpanel$cf_cv_libtype"
15774 # Filter out duplicates - this happens with badly-designed ".pc" files...
15775 for cf_add_1lib in $LIBS
15776 do
15777         for cf_add_2lib in $cf_add_libs
15778         do
15779                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15780                 then
15781                         cf_add_1lib=
15782                         break
15783                 fi
15784         done
15785         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15786 done
15787 LIBS="$cf_add_libs"
15788
15789                 cat >>confdefs.h <<EOF
15790 #define $cf_upper 1
15791 EOF
15792
15793 fi
15794
15795 fi
15796
15797         cf_curses_headers="$cf_curses_headers panel.h"
15798 fi
15799
15800 echo "$as_me:15800: checking if you want to check for menu functions" >&5
15801 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
15802
15803 # Check whether --enable-menu or --disable-menu was given.
15804 if test "${enable_menu+set}" = set; then
15805   enableval="$enable_menu"
15806   test "$enableval" != no && enableval=yes
15807         if test "$enableval" != "yes" ; then
15808     cf_enable_menu=no
15809         else
15810                 cf_enable_menu=$cf_default_menu
15811         fi
15812 else
15813   enableval=yes
15814         cf_enable_menu=$cf_default_menu
15815
15816 fi;
15817 echo "$as_me:15817: result: $cf_enable_menu" >&5
15818 echo "${ECHO_T}$cf_enable_menu" >&6
15819 if test $cf_enable_menu = yes
15820 then
15821         case $cf_cv_screen in
15822         (ncurses*)
15823                 ;;
15824         (curses*)
15825
15826 echo "$as_me:15826: checking for NetBSD menu.h" >&5
15827 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
15828 if test "${cf_cv_netbsd_menu_h+set}" = set; then
15829   echo $ECHO_N "(cached) $ECHO_C" >&6
15830 else
15831
15832 cat >conftest.$ac_ext <<_ACEOF
15833 #line 15833 "configure"
15834 #include "confdefs.h"
15835
15836 #include <${cf_cv_ncurses_header:-curses.h}>
15837 #include <menu.h>
15838
15839 int
15840 main (void)
15841 {
15842
15843         MENU *menu;
15844         int y = menu->max_item_width;
15845
15846   ;
15847   return 0;
15848 }
15849 _ACEOF
15850 rm -f conftest.$ac_objext
15851 if { (eval echo "$as_me:15851: \"$ac_compile\"") >&5
15852   (eval $ac_compile) 2>&5
15853   ac_status=$?
15854   echo "$as_me:15854: \$? = $ac_status" >&5
15855   (exit $ac_status); } &&
15856          { ac_try='test -s conftest.$ac_objext'
15857   { (eval echo "$as_me:15857: \"$ac_try\"") >&5
15858   (eval $ac_try) 2>&5
15859   ac_status=$?
15860   echo "$as_me:15860: \$? = $ac_status" >&5
15861   (exit $ac_status); }; }; then
15862   cf_cv_netbsd_menu_h=yes
15863
15864 else
15865   echo "$as_me: failed program was:" >&5
15866 cat conftest.$ac_ext >&5
15867 cf_cv_netbsd_menu_h=no
15868 fi
15869 rm -f conftest.$ac_objext conftest.$ac_ext
15870
15871 fi
15872 echo "$as_me:15872: result: $cf_cv_netbsd_menu_h" >&5
15873 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
15874
15875 test "$cf_cv_netbsd_menu_h" = yes &&
15876 cat >>confdefs.h <<\EOF
15877 #define HAVE_NETBSD_MENU_H 1
15878 EOF
15879
15880                 ;;
15881         esac
15882
15883 cf_have_curses_lib=no
15884
15885 : ${NCURSES_CONFIG_PKG:=none}
15886 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15887         :
15888 elif test "x${PKG_CONFIG:=none}" != xnone; then
15889         echo "$as_me:15889: checking pkg-config for menu$cf_cv_libtype" >&5
15890 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
15891         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
15892                 echo "$as_me:15892: result: yes" >&5
15893 echo "${ECHO_T}yes" >&6
15894
15895                 echo "$as_me:15895: checking if the menu$cf_cv_libtype package files work" >&5
15896 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
15897
15898                 cf_save_CPPFLAGS="$CPPFLAGS"
15899                 cf_save_LIBS="$LIBS"
15900
15901 cf_fix_cppflags=no
15902 cf_new_cflags=
15903 cf_new_cppflags=
15904 cf_new_extra_cppflags=
15905
15906 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
15907 do
15908 case $cf_fix_cppflags in
15909 (no)
15910         case $cf_add_cflags in
15911         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15912                 case $cf_add_cflags in
15913                 (-D*)
15914                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15915
15916                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15917                                 && test -z "${cf_tst_cflags}" \
15918                                 && cf_fix_cppflags=yes
15919
15920                         if test $cf_fix_cppflags = yes ; then
15921
15922         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15923         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15924
15925                                 continue
15926                         elif test "${cf_tst_cflags}" = "\"'" ; then
15927
15928         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15929         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15930
15931                                 continue
15932                         fi
15933                         ;;
15934                 esac
15935                 case "$CPPFLAGS" in
15936                 (*$cf_add_cflags)
15937                         ;;
15938                 (*)
15939                         case $cf_add_cflags in
15940                         (-D*)
15941                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15942
15943 CPPFLAGS=`echo "$CPPFLAGS" | \
15944         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15945                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15946
15947                                 ;;
15948                         esac
15949
15950         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15951         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15952
15953                         ;;
15954                 esac
15955                 ;;
15956         (*)
15957
15958         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15959         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15960
15961                 ;;
15962         esac
15963         ;;
15964 (yes)
15965
15966         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15967         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15968
15969         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15970
15971         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15972                 && test -z "${cf_tst_cflags}" \
15973                 && cf_fix_cppflags=no
15974         ;;
15975 esac
15976 done
15977
15978 if test -n "$cf_new_cflags" ; then
15979
15980         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15981         CFLAGS="${CFLAGS}$cf_new_cflags"
15982
15983 fi
15984
15985 if test -n "$cf_new_cppflags" ; then
15986
15987         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15988         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15989
15990 fi
15991
15992 if test -n "$cf_new_extra_cppflags" ; then
15993
15994         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15995         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15996
15997 fi
15998
15999 cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
16000 # Filter out duplicates - this happens with badly-designed ".pc" files...
16001 for cf_add_1lib in $LIBS
16002 do
16003         for cf_add_2lib in $cf_add_libs
16004         do
16005                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16006                 then
16007                         cf_add_1lib=
16008                         break
16009                 fi
16010         done
16011         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16012 done
16013 LIBS="$cf_add_libs"
16014
16015                 cat >conftest.$ac_ext <<_ACEOF
16016 #line 16016 "configure"
16017 #include "confdefs.h"
16018 #include <menu.h>
16019 int
16020 main (void)
16021 {
16022 (void) menu_driver ( 0,0 );
16023   ;
16024   return 0;
16025 }
16026 _ACEOF
16027 rm -f conftest.$ac_objext conftest$ac_exeext
16028 if { (eval echo "$as_me:16028: \"$ac_link\"") >&5
16029   (eval $ac_link) 2>&5
16030   ac_status=$?
16031   echo "$as_me:16031: \$? = $ac_status" >&5
16032   (exit $ac_status); } &&
16033          { ac_try='test -s conftest$ac_exeext'
16034   { (eval echo "$as_me:16034: \"$ac_try\"") >&5
16035   (eval $ac_try) 2>&5
16036   ac_status=$?
16037   echo "$as_me:16037: \$? = $ac_status" >&5
16038   (exit $ac_status); }; }; then
16039   if test "$cross_compiling" = yes; then
16040   cf_have_curses_lib=maybe
16041 else
16042   cat >conftest.$ac_ext <<_ACEOF
16043 #line 16043 "configure"
16044 #include "confdefs.h"
16045 #include <menu.h>
16046                                 int main(void)
16047                                 { (void) menu_driver ( 0,0 ); return 0; }
16048 _ACEOF
16049 rm -f conftest$ac_exeext
16050 if { (eval echo "$as_me:16050: \"$ac_link\"") >&5
16051   (eval $ac_link) 2>&5
16052   ac_status=$?
16053   echo "$as_me:16053: \$? = $ac_status" >&5
16054   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16055   { (eval echo "$as_me:16055: \"$ac_try\"") >&5
16056   (eval $ac_try) 2>&5
16057   ac_status=$?
16058   echo "$as_me:16058: \$? = $ac_status" >&5
16059   (exit $ac_status); }; }; then
16060   cf_have_curses_lib=yes
16061 else
16062   echo "$as_me: program exited with status $ac_status" >&5
16063 echo "$as_me: failed program was:" >&5
16064 cat conftest.$ac_ext >&5
16065 cf_have_curses_lib=no
16066 fi
16067 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16068 fi
16069 else
16070   echo "$as_me: failed program was:" >&5
16071 cat conftest.$ac_ext >&5
16072 cf_have_curses_lib=no
16073 fi
16074 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16075                 echo "$as_me:16075: result: $cf_have_curses_lib" >&5
16076 echo "${ECHO_T}$cf_have_curses_lib" >&6
16077                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16078                 if test "$cf_have_curses_lib" != "yes"
16079                 then
16080                         CPPFLAGS="$cf_save_CPPFLAGS"
16081                         LIBS="$cf_save_LIBS"
16082                 else
16083
16084 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16085
16086                         cat >>confdefs.h <<EOF
16087 #define $cf_upper 1
16088 EOF
16089
16090                 fi
16091         fi
16092 fi
16093 if test "$cf_have_curses_lib" = no; then
16094         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16095 echo "$as_me:16095: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
16096 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
16097 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16098   echo $ECHO_N "(cached) $ECHO_C" >&6
16099 else
16100   ac_check_lib_save_LIBS=$LIBS
16101 LIBS="-lmenu$cf_cv_libtype  $LIBS"
16102 cat >conftest.$ac_ext <<_ACEOF
16103 #line 16103 "configure"
16104 #include "confdefs.h"
16105
16106 /* Override any gcc2 internal prototype to avoid an error.  */
16107 #ifdef __cplusplus
16108 extern "C"
16109 #endif
16110 /* We use char because int might match the return type of a gcc2
16111    builtin and then its argument prototype would still apply.  */
16112 char menu_driver ();
16113 int
16114 main (void)
16115 {
16116 menu_driver ();
16117   ;
16118   return 0;
16119 }
16120 _ACEOF
16121 rm -f conftest.$ac_objext conftest$ac_exeext
16122 if { (eval echo "$as_me:16122: \"$ac_link\"") >&5
16123   (eval $ac_link) 2>&5
16124   ac_status=$?
16125   echo "$as_me:16125: \$? = $ac_status" >&5
16126   (exit $ac_status); } &&
16127          { ac_try='test -s conftest$ac_exeext'
16128   { (eval echo "$as_me:16128: \"$ac_try\"") >&5
16129   (eval $ac_try) 2>&5
16130   ac_status=$?
16131   echo "$as_me:16131: \$? = $ac_status" >&5
16132   (exit $ac_status); }; }; then
16133   eval "$as_ac_Lib=yes"
16134 else
16135   echo "$as_me: failed program was:" >&5
16136 cat conftest.$ac_ext >&5
16137 eval "$as_ac_Lib=no"
16138 fi
16139 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16140 LIBS=$ac_check_lib_save_LIBS
16141 fi
16142 echo "$as_me:16142: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16143 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16144 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16145
16146 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16147
16148 cf_add_libs="-lmenu$cf_cv_libtype"
16149 # Filter out duplicates - this happens with badly-designed ".pc" files...
16150 for cf_add_1lib in $LIBS
16151 do
16152         for cf_add_2lib in $cf_add_libs
16153         do
16154                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16155                 then
16156                         cf_add_1lib=
16157                         break
16158                 fi
16159         done
16160         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16161 done
16162 LIBS="$cf_add_libs"
16163
16164                 cat >>confdefs.h <<EOF
16165 #define $cf_upper 1
16166 EOF
16167
16168 fi
16169
16170 fi
16171
16172         cf_curses_headers="$cf_curses_headers menu.h"
16173 fi
16174
16175 echo "$as_me:16175: checking if you want to check for form functions" >&5
16176 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16177
16178 # Check whether --enable-form or --disable-form was given.
16179 if test "${enable_form+set}" = set; then
16180   enableval="$enable_form"
16181   test "$enableval" != no && enableval=yes
16182         if test "$enableval" != "yes" ; then
16183     cf_enable_form=no
16184         else
16185                 cf_enable_form=$cf_default_form
16186         fi
16187 else
16188   enableval=yes
16189         cf_enable_form=$cf_default_form
16190
16191 fi;
16192 echo "$as_me:16192: result: $cf_enable_form" >&5
16193 echo "${ECHO_T}$cf_enable_form" >&6
16194 if test $cf_enable_form = yes
16195 then
16196         case $cf_cv_screen in
16197         (ncurses*)
16198                 ;;
16199         (curses*)
16200
16201 echo "$as_me:16201: checking for NetBSD form.h" >&5
16202 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16203 if test "${cf_cv_netbsd_form_h+set}" = set; then
16204   echo $ECHO_N "(cached) $ECHO_C" >&6
16205 else
16206
16207 cat >conftest.$ac_ext <<_ACEOF
16208 #line 16208 "configure"
16209 #include "confdefs.h"
16210
16211 #include <${cf_cv_ncurses_header:-curses.h}>
16212 #include <form.h>
16213
16214 int
16215 main (void)
16216 {
16217
16218         FORM *form;
16219         int y = current_field(form)->cursor_ypos;
16220         int x = current_field(form)->cursor_xpos;
16221
16222   ;
16223   return 0;
16224 }
16225 _ACEOF
16226 rm -f conftest.$ac_objext
16227 if { (eval echo "$as_me:16227: \"$ac_compile\"") >&5
16228   (eval $ac_compile) 2>&5
16229   ac_status=$?
16230   echo "$as_me:16230: \$? = $ac_status" >&5
16231   (exit $ac_status); } &&
16232          { ac_try='test -s conftest.$ac_objext'
16233   { (eval echo "$as_me:16233: \"$ac_try\"") >&5
16234   (eval $ac_try) 2>&5
16235   ac_status=$?
16236   echo "$as_me:16236: \$? = $ac_status" >&5
16237   (exit $ac_status); }; }; then
16238   cf_cv_netbsd_form_h=yes
16239
16240 else
16241   echo "$as_me: failed program was:" >&5
16242 cat conftest.$ac_ext >&5
16243 cf_cv_netbsd_form_h=no
16244 fi
16245 rm -f conftest.$ac_objext conftest.$ac_ext
16246
16247 fi
16248 echo "$as_me:16248: result: $cf_cv_netbsd_form_h" >&5
16249 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16250
16251 test "$cf_cv_netbsd_form_h" = yes &&
16252 cat >>confdefs.h <<\EOF
16253 #define HAVE_NETBSD_FORM_H 1
16254 EOF
16255
16256                 ;;
16257         esac
16258
16259 cf_have_curses_lib=no
16260
16261 : ${NCURSES_CONFIG_PKG:=none}
16262 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16263         :
16264 elif test "x${PKG_CONFIG:=none}" != xnone; then
16265         echo "$as_me:16265: checking pkg-config for form$cf_cv_libtype" >&5
16266 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
16267         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
16268                 echo "$as_me:16268: result: yes" >&5
16269 echo "${ECHO_T}yes" >&6
16270
16271                 echo "$as_me:16271: checking if the form$cf_cv_libtype package files work" >&5
16272 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
16273
16274                 cf_save_CPPFLAGS="$CPPFLAGS"
16275                 cf_save_LIBS="$LIBS"
16276
16277 cf_fix_cppflags=no
16278 cf_new_cflags=
16279 cf_new_cppflags=
16280 cf_new_extra_cppflags=
16281
16282 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
16283 do
16284 case $cf_fix_cppflags in
16285 (no)
16286         case $cf_add_cflags in
16287         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16288                 case $cf_add_cflags in
16289                 (-D*)
16290                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16291
16292                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16293                                 && test -z "${cf_tst_cflags}" \
16294                                 && cf_fix_cppflags=yes
16295
16296                         if test $cf_fix_cppflags = yes ; then
16297
16298         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16299         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16300
16301                                 continue
16302                         elif test "${cf_tst_cflags}" = "\"'" ; then
16303
16304         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16305         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16306
16307                                 continue
16308                         fi
16309                         ;;
16310                 esac
16311                 case "$CPPFLAGS" in
16312                 (*$cf_add_cflags)
16313                         ;;
16314                 (*)
16315                         case $cf_add_cflags in
16316                         (-D*)
16317                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16318
16319 CPPFLAGS=`echo "$CPPFLAGS" | \
16320         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16321                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16322
16323                                 ;;
16324                         esac
16325
16326         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16327         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16328
16329                         ;;
16330                 esac
16331                 ;;
16332         (*)
16333
16334         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16335         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16336
16337                 ;;
16338         esac
16339         ;;
16340 (yes)
16341
16342         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16343         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16344
16345         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16346
16347         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16348                 && test -z "${cf_tst_cflags}" \
16349                 && cf_fix_cppflags=no
16350         ;;
16351 esac
16352 done
16353
16354 if test -n "$cf_new_cflags" ; then
16355
16356         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16357         CFLAGS="${CFLAGS}$cf_new_cflags"
16358
16359 fi
16360
16361 if test -n "$cf_new_cppflags" ; then
16362
16363         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16364         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16365
16366 fi
16367
16368 if test -n "$cf_new_extra_cppflags" ; then
16369
16370         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16371         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16372
16373 fi
16374
16375 cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
16376 # Filter out duplicates - this happens with badly-designed ".pc" files...
16377 for cf_add_1lib in $LIBS
16378 do
16379         for cf_add_2lib in $cf_add_libs
16380         do
16381                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16382                 then
16383                         cf_add_1lib=
16384                         break
16385                 fi
16386         done
16387         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16388 done
16389 LIBS="$cf_add_libs"
16390
16391                 cat >conftest.$ac_ext <<_ACEOF
16392 #line 16392 "configure"
16393 #include "confdefs.h"
16394 #include <form.h>
16395 int
16396 main (void)
16397 {
16398 (void) form_driver ( 0,0 );
16399   ;
16400   return 0;
16401 }
16402 _ACEOF
16403 rm -f conftest.$ac_objext conftest$ac_exeext
16404 if { (eval echo "$as_me:16404: \"$ac_link\"") >&5
16405   (eval $ac_link) 2>&5
16406   ac_status=$?
16407   echo "$as_me:16407: \$? = $ac_status" >&5
16408   (exit $ac_status); } &&
16409          { ac_try='test -s conftest$ac_exeext'
16410   { (eval echo "$as_me:16410: \"$ac_try\"") >&5
16411   (eval $ac_try) 2>&5
16412   ac_status=$?
16413   echo "$as_me:16413: \$? = $ac_status" >&5
16414   (exit $ac_status); }; }; then
16415   if test "$cross_compiling" = yes; then
16416   cf_have_curses_lib=maybe
16417 else
16418   cat >conftest.$ac_ext <<_ACEOF
16419 #line 16419 "configure"
16420 #include "confdefs.h"
16421 #include <form.h>
16422                                 int main(void)
16423                                 { (void) form_driver ( 0,0 ); return 0; }
16424 _ACEOF
16425 rm -f conftest$ac_exeext
16426 if { (eval echo "$as_me:16426: \"$ac_link\"") >&5
16427   (eval $ac_link) 2>&5
16428   ac_status=$?
16429   echo "$as_me:16429: \$? = $ac_status" >&5
16430   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16431   { (eval echo "$as_me:16431: \"$ac_try\"") >&5
16432   (eval $ac_try) 2>&5
16433   ac_status=$?
16434   echo "$as_me:16434: \$? = $ac_status" >&5
16435   (exit $ac_status); }; }; then
16436   cf_have_curses_lib=yes
16437 else
16438   echo "$as_me: program exited with status $ac_status" >&5
16439 echo "$as_me: failed program was:" >&5
16440 cat conftest.$ac_ext >&5
16441 cf_have_curses_lib=no
16442 fi
16443 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16444 fi
16445 else
16446   echo "$as_me: failed program was:" >&5
16447 cat conftest.$ac_ext >&5
16448 cf_have_curses_lib=no
16449 fi
16450 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16451                 echo "$as_me:16451: result: $cf_have_curses_lib" >&5
16452 echo "${ECHO_T}$cf_have_curses_lib" >&6
16453                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16454                 if test "$cf_have_curses_lib" != "yes"
16455                 then
16456                         CPPFLAGS="$cf_save_CPPFLAGS"
16457                         LIBS="$cf_save_LIBS"
16458                 else
16459
16460 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16461
16462                         cat >>confdefs.h <<EOF
16463 #define $cf_upper 1
16464 EOF
16465
16466                 fi
16467         fi
16468 fi
16469 if test "$cf_have_curses_lib" = no; then
16470         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
16471 echo "$as_me:16471: checking for form_driver in -lform$cf_cv_libtype" >&5
16472 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
16473 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16474   echo $ECHO_N "(cached) $ECHO_C" >&6
16475 else
16476   ac_check_lib_save_LIBS=$LIBS
16477 LIBS="-lform$cf_cv_libtype  $LIBS"
16478 cat >conftest.$ac_ext <<_ACEOF
16479 #line 16479 "configure"
16480 #include "confdefs.h"
16481
16482 /* Override any gcc2 internal prototype to avoid an error.  */
16483 #ifdef __cplusplus
16484 extern "C"
16485 #endif
16486 /* We use char because int might match the return type of a gcc2
16487    builtin and then its argument prototype would still apply.  */
16488 char form_driver ();
16489 int
16490 main (void)
16491 {
16492 form_driver ();
16493   ;
16494   return 0;
16495 }
16496 _ACEOF
16497 rm -f conftest.$ac_objext conftest$ac_exeext
16498 if { (eval echo "$as_me:16498: \"$ac_link\"") >&5
16499   (eval $ac_link) 2>&5
16500   ac_status=$?
16501   echo "$as_me:16501: \$? = $ac_status" >&5
16502   (exit $ac_status); } &&
16503          { ac_try='test -s conftest$ac_exeext'
16504   { (eval echo "$as_me:16504: \"$ac_try\"") >&5
16505   (eval $ac_try) 2>&5
16506   ac_status=$?
16507   echo "$as_me:16507: \$? = $ac_status" >&5
16508   (exit $ac_status); }; }; then
16509   eval "$as_ac_Lib=yes"
16510 else
16511   echo "$as_me: failed program was:" >&5
16512 cat conftest.$ac_ext >&5
16513 eval "$as_ac_Lib=no"
16514 fi
16515 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16516 LIBS=$ac_check_lib_save_LIBS
16517 fi
16518 echo "$as_me:16518: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16519 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16520 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16521
16522 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16523
16524 cf_add_libs="-lform$cf_cv_libtype"
16525 # Filter out duplicates - this happens with badly-designed ".pc" files...
16526 for cf_add_1lib in $LIBS
16527 do
16528         for cf_add_2lib in $cf_add_libs
16529         do
16530                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16531                 then
16532                         cf_add_1lib=
16533                         break
16534                 fi
16535         done
16536         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16537 done
16538 LIBS="$cf_add_libs"
16539
16540                 cat >>confdefs.h <<EOF
16541 #define $cf_upper 1
16542 EOF
16543
16544 fi
16545
16546 fi
16547
16548         cf_curses_headers="$cf_curses_headers form.h"
16549 fi
16550
16551 # look for curses-related headers
16552
16553 for ac_header in $cf_curses_headers
16554 do
16555 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16556 echo "$as_me:16556: checking for $ac_header" >&5
16557 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16558 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16559   echo $ECHO_N "(cached) $ECHO_C" >&6
16560 else
16561   cat >conftest.$ac_ext <<_ACEOF
16562 #line 16562 "configure"
16563 #include "confdefs.h"
16564 #include <$ac_header>
16565 _ACEOF
16566 if { (eval echo "$as_me:16566: \"$ac_cpp conftest.$ac_ext\"") >&5
16567   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16568   ac_status=$?
16569   egrep -v '^ *\+' conftest.er1 >conftest.err
16570   rm -f conftest.er1
16571   cat conftest.err >&5
16572   echo "$as_me:16572: \$? = $ac_status" >&5
16573   (exit $ac_status); } >/dev/null; then
16574   if test -s conftest.err; then
16575     ac_cpp_err=$ac_c_preproc_warn_flag
16576   else
16577     ac_cpp_err=
16578   fi
16579 else
16580   ac_cpp_err=yes
16581 fi
16582 if test -z "$ac_cpp_err"; then
16583   eval "$as_ac_Header=yes"
16584 else
16585   echo "$as_me: failed program was:" >&5
16586   cat conftest.$ac_ext >&5
16587   eval "$as_ac_Header=no"
16588 fi
16589 rm -f conftest.err conftest.$ac_ext
16590 fi
16591 echo "$as_me:16591: result: `eval echo '${'$as_ac_Header'}'`" >&5
16592 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16593 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16594   cat >>confdefs.h <<EOF
16595 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16596 EOF
16597
16598 fi
16599 done
16600
16601 echo "$as_me:16601: checking for ANSI C header files" >&5
16602 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16603 if test "${ac_cv_header_stdc+set}" = set; then
16604   echo $ECHO_N "(cached) $ECHO_C" >&6
16605 else
16606   cat >conftest.$ac_ext <<_ACEOF
16607 #line 16607 "configure"
16608 #include "confdefs.h"
16609 #include <stdlib.h>
16610 #include <stdarg.h>
16611 #include <string.h>
16612 #include <float.h>
16613
16614 _ACEOF
16615 if { (eval echo "$as_me:16615: \"$ac_cpp conftest.$ac_ext\"") >&5
16616   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16617   ac_status=$?
16618   egrep -v '^ *\+' conftest.er1 >conftest.err
16619   rm -f conftest.er1
16620   cat conftest.err >&5
16621   echo "$as_me:16621: \$? = $ac_status" >&5
16622   (exit $ac_status); } >/dev/null; then
16623   if test -s conftest.err; then
16624     ac_cpp_err=$ac_c_preproc_warn_flag
16625   else
16626     ac_cpp_err=
16627   fi
16628 else
16629   ac_cpp_err=yes
16630 fi
16631 if test -z "$ac_cpp_err"; then
16632   ac_cv_header_stdc=yes
16633 else
16634   echo "$as_me: failed program was:" >&5
16635   cat conftest.$ac_ext >&5
16636   ac_cv_header_stdc=no
16637 fi
16638 rm -f conftest.err conftest.$ac_ext
16639
16640 if test $ac_cv_header_stdc = yes; then
16641   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16642   cat >conftest.$ac_ext <<_ACEOF
16643 #line 16643 "configure"
16644 #include "confdefs.h"
16645 #include <string.h>
16646
16647 _ACEOF
16648 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16649   egrep "memchr" >/dev/null 2>&1; then
16650   :
16651 else
16652   ac_cv_header_stdc=no
16653 fi
16654 rm -rf conftest*
16655
16656 fi
16657
16658 if test $ac_cv_header_stdc = yes; then
16659   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16660   cat >conftest.$ac_ext <<_ACEOF
16661 #line 16661 "configure"
16662 #include "confdefs.h"
16663 #include <stdlib.h>
16664
16665 _ACEOF
16666 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16667   egrep "free" >/dev/null 2>&1; then
16668   :
16669 else
16670   ac_cv_header_stdc=no
16671 fi
16672 rm -rf conftest*
16673
16674 fi
16675
16676 if test $ac_cv_header_stdc = yes; then
16677   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16678   if test "$cross_compiling" = yes; then
16679   :
16680 else
16681   cat >conftest.$ac_ext <<_ACEOF
16682 #line 16682 "configure"
16683 #include "confdefs.h"
16684 #include <ctype.h>
16685 #if ((' ' & 0x0FF) == 0x020)
16686 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16687 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16688 #else
16689 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16690                      || ('j' <= (c) && (c) <= 'r') \
16691                      || ('s' <= (c) && (c) <= 'z'))
16692 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16693 #endif
16694
16695 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16696 int
16697 main (void)
16698 {
16699   int i;
16700   for (i = 0; i < 256; i++)
16701     if (XOR (islower (i), ISLOWER (i))
16702         || toupper (i) != TOUPPER (i))
16703       $ac_main_return(2);
16704   $ac_main_return (0);
16705 }
16706 _ACEOF
16707 rm -f conftest$ac_exeext
16708 if { (eval echo "$as_me:16708: \"$ac_link\"") >&5
16709   (eval $ac_link) 2>&5
16710   ac_status=$?
16711   echo "$as_me:16711: \$? = $ac_status" >&5
16712   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16713   { (eval echo "$as_me:16713: \"$ac_try\"") >&5
16714   (eval $ac_try) 2>&5
16715   ac_status=$?
16716   echo "$as_me:16716: \$? = $ac_status" >&5
16717   (exit $ac_status); }; }; then
16718   :
16719 else
16720   echo "$as_me: program exited with status $ac_status" >&5
16721 echo "$as_me: failed program was:" >&5
16722 cat conftest.$ac_ext >&5
16723 ac_cv_header_stdc=no
16724 fi
16725 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16726 fi
16727 fi
16728 fi
16729 echo "$as_me:16729: result: $ac_cv_header_stdc" >&5
16730 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16731 if test $ac_cv_header_stdc = yes; then
16732
16733 cat >>confdefs.h <<\EOF
16734 #define STDC_HEADERS 1
16735 EOF
16736
16737 fi
16738
16739 echo "$as_me:16739: checking whether time.h and sys/time.h may both be included" >&5
16740 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16741 if test "${ac_cv_header_time+set}" = set; then
16742   echo $ECHO_N "(cached) $ECHO_C" >&6
16743 else
16744   cat >conftest.$ac_ext <<_ACEOF
16745 #line 16745 "configure"
16746 #include "confdefs.h"
16747 #include <sys/types.h>
16748 #include <sys/time.h>
16749 #include <time.h>
16750
16751 int
16752 main (void)
16753 {
16754 if ((struct tm *) 0)
16755 return 0;
16756   ;
16757   return 0;
16758 }
16759 _ACEOF
16760 rm -f conftest.$ac_objext
16761 if { (eval echo "$as_me:16761: \"$ac_compile\"") >&5
16762   (eval $ac_compile) 2>&5
16763   ac_status=$?
16764   echo "$as_me:16764: \$? = $ac_status" >&5
16765   (exit $ac_status); } &&
16766          { ac_try='test -s conftest.$ac_objext'
16767   { (eval echo "$as_me:16767: \"$ac_try\"") >&5
16768   (eval $ac_try) 2>&5
16769   ac_status=$?
16770   echo "$as_me:16770: \$? = $ac_status" >&5
16771   (exit $ac_status); }; }; then
16772   ac_cv_header_time=yes
16773 else
16774   echo "$as_me: failed program was:" >&5
16775 cat conftest.$ac_ext >&5
16776 ac_cv_header_time=no
16777 fi
16778 rm -f conftest.$ac_objext conftest.$ac_ext
16779 fi
16780 echo "$as_me:16780: result: $ac_cv_header_time" >&5
16781 echo "${ECHO_T}$ac_cv_header_time" >&6
16782 if test $ac_cv_header_time = yes; then
16783
16784 cat >>confdefs.h <<\EOF
16785 #define TIME_WITH_SYS_TIME 1
16786 EOF
16787
16788 fi
16789
16790 for ac_header in \
16791 getopt.h \
16792 locale.h \
16793 math.h \
16794 stdarg.h \
16795 stdint.h \
16796 sys/ioctl.h \
16797 sys/select.h \
16798 sys/time.h \
16799 termios.h \
16800 unistd.h \
16801
16802 do
16803 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16804 echo "$as_me:16804: checking for $ac_header" >&5
16805 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16806 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16807   echo $ECHO_N "(cached) $ECHO_C" >&6
16808 else
16809   cat >conftest.$ac_ext <<_ACEOF
16810 #line 16810 "configure"
16811 #include "confdefs.h"
16812 #include <$ac_header>
16813 _ACEOF
16814 if { (eval echo "$as_me:16814: \"$ac_cpp conftest.$ac_ext\"") >&5
16815   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16816   ac_status=$?
16817   egrep -v '^ *\+' conftest.er1 >conftest.err
16818   rm -f conftest.er1
16819   cat conftest.err >&5
16820   echo "$as_me:16820: \$? = $ac_status" >&5
16821   (exit $ac_status); } >/dev/null; then
16822   if test -s conftest.err; then
16823     ac_cpp_err=$ac_c_preproc_warn_flag
16824   else
16825     ac_cpp_err=
16826   fi
16827 else
16828   ac_cpp_err=yes
16829 fi
16830 if test -z "$ac_cpp_err"; then
16831   eval "$as_ac_Header=yes"
16832 else
16833   echo "$as_me: failed program was:" >&5
16834   cat conftest.$ac_ext >&5
16835   eval "$as_ac_Header=no"
16836 fi
16837 rm -f conftest.err conftest.$ac_ext
16838 fi
16839 echo "$as_me:16839: result: `eval echo '${'$as_ac_Header'}'`" >&5
16840 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16841 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16842   cat >>confdefs.h <<EOF
16843 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16844 EOF
16845
16846 fi
16847 done
16848
16849 for ac_header in unistd.h getopt.h
16850 do
16851 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16852 echo "$as_me:16852: checking for $ac_header" >&5
16853 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16854 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16855   echo $ECHO_N "(cached) $ECHO_C" >&6
16856 else
16857   cat >conftest.$ac_ext <<_ACEOF
16858 #line 16858 "configure"
16859 #include "confdefs.h"
16860 #include <$ac_header>
16861 _ACEOF
16862 if { (eval echo "$as_me:16862: \"$ac_cpp conftest.$ac_ext\"") >&5
16863   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16864   ac_status=$?
16865   egrep -v '^ *\+' conftest.er1 >conftest.err
16866   rm -f conftest.er1
16867   cat conftest.err >&5
16868   echo "$as_me:16868: \$? = $ac_status" >&5
16869   (exit $ac_status); } >/dev/null; then
16870   if test -s conftest.err; then
16871     ac_cpp_err=$ac_c_preproc_warn_flag
16872   else
16873     ac_cpp_err=
16874   fi
16875 else
16876   ac_cpp_err=yes
16877 fi
16878 if test -z "$ac_cpp_err"; then
16879   eval "$as_ac_Header=yes"
16880 else
16881   echo "$as_me: failed program was:" >&5
16882   cat conftest.$ac_ext >&5
16883   eval "$as_ac_Header=no"
16884 fi
16885 rm -f conftest.err conftest.$ac_ext
16886 fi
16887 echo "$as_me:16887: result: `eval echo '${'$as_ac_Header'}'`" >&5
16888 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16889 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16890   cat >>confdefs.h <<EOF
16891 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16892 EOF
16893
16894 fi
16895 done
16896
16897 echo "$as_me:16897: checking for header declaring getopt variables" >&5
16898 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
16899 if test "${cf_cv_getopt_header+set}" = set; then
16900   echo $ECHO_N "(cached) $ECHO_C" >&6
16901 else
16902
16903 cf_cv_getopt_header=none
16904 for cf_header in stdio.h stdlib.h unistd.h getopt.h
16905 do
16906 cat >conftest.$ac_ext <<_ACEOF
16907 #line 16907 "configure"
16908 #include "confdefs.h"
16909
16910 #include <$cf_header>
16911 int
16912 main (void)
16913 {
16914 int x = optind; char *y = optarg
16915   ;
16916   return 0;
16917 }
16918 _ACEOF
16919 rm -f conftest.$ac_objext
16920 if { (eval echo "$as_me:16920: \"$ac_compile\"") >&5
16921   (eval $ac_compile) 2>&5
16922   ac_status=$?
16923   echo "$as_me:16923: \$? = $ac_status" >&5
16924   (exit $ac_status); } &&
16925          { ac_try='test -s conftest.$ac_objext'
16926   { (eval echo "$as_me:16926: \"$ac_try\"") >&5
16927   (eval $ac_try) 2>&5
16928   ac_status=$?
16929   echo "$as_me:16929: \$? = $ac_status" >&5
16930   (exit $ac_status); }; }; then
16931   cf_cv_getopt_header=$cf_header
16932  break
16933 else
16934   echo "$as_me: failed program was:" >&5
16935 cat conftest.$ac_ext >&5
16936 fi
16937 rm -f conftest.$ac_objext conftest.$ac_ext
16938 done
16939
16940 fi
16941 echo "$as_me:16941: result: $cf_cv_getopt_header" >&5
16942 echo "${ECHO_T}$cf_cv_getopt_header" >&6
16943 if test $cf_cv_getopt_header != none ; then
16944
16945 cat >>confdefs.h <<\EOF
16946 #define HAVE_GETOPT_HEADER 1
16947 EOF
16948
16949 fi
16950 if test $cf_cv_getopt_header = getopt.h ; then
16951
16952 cat >>confdefs.h <<\EOF
16953 #define NEED_GETOPT_H 1
16954 EOF
16955
16956 fi
16957
16958 for ac_func in \
16959 getopt \
16960 gettimeofday \
16961 strstr \
16962 tsearch \
16963
16964 do
16965 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16966 echo "$as_me:16966: checking for $ac_func" >&5
16967 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
16968 if eval "test \"\${$as_ac_var+set}\" = set"; then
16969   echo $ECHO_N "(cached) $ECHO_C" >&6
16970 else
16971   cat >conftest.$ac_ext <<_ACEOF
16972 #line 16972 "configure"
16973 #include "confdefs.h"
16974 #define $ac_func autoconf_temporary
16975 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16976 #undef $ac_func
16977
16978 #ifdef __cplusplus
16979 extern "C"
16980 #endif
16981
16982 /* We use char because int might match the return type of a gcc2
16983    builtin and then its argument prototype would still apply.  */
16984 char $ac_func (void);
16985
16986 int
16987 main (void)
16988 {
16989
16990 /* The GNU C library defines stubs for functions which it implements
16991     to always fail with ENOSYS.  Some functions are actually named
16992     something starting with __ and the normal name is an alias.  */
16993 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16994 #error found stub for $ac_func
16995 #endif
16996
16997         return $ac_func ();
16998   ;
16999   return 0;
17000 }
17001 _ACEOF
17002 rm -f conftest.$ac_objext conftest$ac_exeext
17003 if { (eval echo "$as_me:17003: \"$ac_link\"") >&5
17004   (eval $ac_link) 2>&5
17005   ac_status=$?
17006   echo "$as_me:17006: \$? = $ac_status" >&5
17007   (exit $ac_status); } &&
17008          { ac_try='test -s conftest$ac_exeext'
17009   { (eval echo "$as_me:17009: \"$ac_try\"") >&5
17010   (eval $ac_try) 2>&5
17011   ac_status=$?
17012   echo "$as_me:17012: \$? = $ac_status" >&5
17013   (exit $ac_status); }; }; then
17014   eval "$as_ac_var=yes"
17015 else
17016   echo "$as_me: failed program was:" >&5
17017 cat conftest.$ac_ext >&5
17018 eval "$as_ac_var=no"
17019 fi
17020 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17021 fi
17022 echo "$as_me:17022: result: `eval echo '${'$as_ac_var'}'`" >&5
17023 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17024 if test `eval echo '${'$as_ac_var'}'` = yes; then
17025   cat >>confdefs.h <<EOF
17026 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17027 EOF
17028
17029 fi
17030 done
17031
17032 # use a compile-check to work with ncurses*-config and subdirectory includes
17033 echo "$as_me:17033: checking if we can use termcap.h" >&5
17034 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17035 if test "${cf_cv_have_termcap_h+set}" = set; then
17036   echo $ECHO_N "(cached) $ECHO_C" >&6
17037 else
17038
17039         cat >conftest.$ac_ext <<_ACEOF
17040 #line 17040 "configure"
17041 #include "confdefs.h"
17042
17043 #include <curses.h>
17044 #ifdef NCURSES_VERSION
17045 #undef NCURSES_VERSION
17046 #endif
17047 #include <termcap.h>
17048 #ifndef NCURSES_VERSION
17049 #error wrong header
17050 #endif
17051
17052 int
17053 main (void)
17054 {
17055 return 0;
17056   ;
17057   return 0;
17058 }
17059 _ACEOF
17060 rm -f conftest.$ac_objext
17061 if { (eval echo "$as_me:17061: \"$ac_compile\"") >&5
17062   (eval $ac_compile) 2>&5
17063   ac_status=$?
17064   echo "$as_me:17064: \$? = $ac_status" >&5
17065   (exit $ac_status); } &&
17066          { ac_try='test -s conftest.$ac_objext'
17067   { (eval echo "$as_me:17067: \"$ac_try\"") >&5
17068   (eval $ac_try) 2>&5
17069   ac_status=$?
17070   echo "$as_me:17070: \$? = $ac_status" >&5
17071   (exit $ac_status); }; }; then
17072   cf_cv_have_termcap_h=yes
17073 else
17074   echo "$as_me: failed program was:" >&5
17075 cat conftest.$ac_ext >&5
17076 cf_cv_have_termcap_h=no
17077 fi
17078 rm -f conftest.$ac_objext conftest.$ac_ext
17079 fi
17080 echo "$as_me:17080: result: $cf_cv_have_termcap_h" >&5
17081 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17082 if test "x$cf_cv_have_termcap_h" = xyes
17083 then
17084         cat >>confdefs.h <<\EOF
17085 #define HAVE_TERMCAP_H 1
17086 EOF
17087
17088 else
17089 echo "$as_me:17089: checking if we can use ncurses/termcap.h" >&5
17090 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17091 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17092   echo $ECHO_N "(cached) $ECHO_C" >&6
17093 else
17094
17095         cat >conftest.$ac_ext <<_ACEOF
17096 #line 17096 "configure"
17097 #include "confdefs.h"
17098
17099 #include <ncurses/curses.h>
17100 #ifdef NCURSES_VERSION
17101 #undef NCURSES_VERSION
17102 #endif
17103 #include <ncurses/termcap.h>
17104 #ifndef NCURSES_VERSION
17105 #error wrong header
17106 #endif
17107
17108 int
17109 main (void)
17110 {
17111 return 0;
17112   ;
17113   return 0;
17114 }
17115 _ACEOF
17116 rm -f conftest.$ac_objext
17117 if { (eval echo "$as_me:17117: \"$ac_compile\"") >&5
17118   (eval $ac_compile) 2>&5
17119   ac_status=$?
17120   echo "$as_me:17120: \$? = $ac_status" >&5
17121   (exit $ac_status); } &&
17122          { ac_try='test -s conftest.$ac_objext'
17123   { (eval echo "$as_me:17123: \"$ac_try\"") >&5
17124   (eval $ac_try) 2>&5
17125   ac_status=$?
17126   echo "$as_me:17126: \$? = $ac_status" >&5
17127   (exit $ac_status); }; }; then
17128   cf_cv_have_ncurses_termcap_h=yes
17129 else
17130   echo "$as_me: failed program was:" >&5
17131 cat conftest.$ac_ext >&5
17132 cf_cv_have_ncurses_termcap_h=no
17133 fi
17134 rm -f conftest.$ac_objext conftest.$ac_ext
17135 fi
17136 echo "$as_me:17136: result: $cf_cv_have_ncurses_termcap_h" >&5
17137 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17138 test "x$cf_cv_have_ncurses_termcap_h" = xyes && cat >>confdefs.h <<\EOF
17139 #define HAVE_NCURSES_TERMCAP_H 1
17140 EOF
17141
17142 fi
17143
17144 if test "x$ac_cv_func_getopt" = xno; then
17145         { { echo "$as_me:17145: error: getopt is required for building programs" >&5
17146 echo "$as_me: error: getopt is required for building programs" >&2;}
17147    { (exit 1); exit 1; }; }
17148 fi
17149
17150 if test "$cf_enable_widec" = yes; then
17151
17152 for ac_func in \
17153 mblen \
17154 mbrlen \
17155 mbrtowc \
17156 mbsrtowcs \
17157 mbstowcs \
17158 mbtowc \
17159 wcsrtombs \
17160 wcstombs \
17161
17162 do
17163 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17164 echo "$as_me:17164: checking for $ac_func" >&5
17165 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17166 if eval "test \"\${$as_ac_var+set}\" = set"; then
17167   echo $ECHO_N "(cached) $ECHO_C" >&6
17168 else
17169   cat >conftest.$ac_ext <<_ACEOF
17170 #line 17170 "configure"
17171 #include "confdefs.h"
17172 #define $ac_func autoconf_temporary
17173 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17174 #undef $ac_func
17175
17176 #ifdef __cplusplus
17177 extern "C"
17178 #endif
17179
17180 /* We use char because int might match the return type of a gcc2
17181    builtin and then its argument prototype would still apply.  */
17182 char $ac_func (void);
17183
17184 int
17185 main (void)
17186 {
17187
17188 /* The GNU C library defines stubs for functions which it implements
17189     to always fail with ENOSYS.  Some functions are actually named
17190     something starting with __ and the normal name is an alias.  */
17191 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17192 #error found stub for $ac_func
17193 #endif
17194
17195         return $ac_func ();
17196   ;
17197   return 0;
17198 }
17199 _ACEOF
17200 rm -f conftest.$ac_objext conftest$ac_exeext
17201 if { (eval echo "$as_me:17201: \"$ac_link\"") >&5
17202   (eval $ac_link) 2>&5
17203   ac_status=$?
17204   echo "$as_me:17204: \$? = $ac_status" >&5
17205   (exit $ac_status); } &&
17206          { ac_try='test -s conftest$ac_exeext'
17207   { (eval echo "$as_me:17207: \"$ac_try\"") >&5
17208   (eval $ac_try) 2>&5
17209   ac_status=$?
17210   echo "$as_me:17210: \$? = $ac_status" >&5
17211   (exit $ac_status); }; }; then
17212   eval "$as_ac_var=yes"
17213 else
17214   echo "$as_me: failed program was:" >&5
17215 cat conftest.$ac_ext >&5
17216 eval "$as_ac_var=no"
17217 fi
17218 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17219 fi
17220 echo "$as_me:17220: result: `eval echo '${'$as_ac_var'}'`" >&5
17221 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17222 if test `eval echo '${'$as_ac_var'}'` = yes; then
17223   cat >>confdefs.h <<EOF
17224 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17225 EOF
17226
17227 fi
17228 done
17229
17230 fi
17231
17232 echo "$as_me:17232: checking definition to turn on extended curses functions" >&5
17233 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17234 if test "${cf_cv_need_xopen_extension+set}" = set; then
17235   echo $ECHO_N "(cached) $ECHO_C" >&6
17236 else
17237
17238 cf_cv_need_xopen_extension=unknown
17239 cat >conftest.$ac_ext <<_ACEOF
17240 #line 17240 "configure"
17241 #include "confdefs.h"
17242
17243 #include <stdlib.h>
17244 #include <${cf_cv_ncurses_header:-curses.h}>
17245 int
17246 main (void)
17247 {
17248
17249 #if defined(NCURSES_VERSION_PATCH)
17250 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17251         make an error
17252 #endif
17253 #endif
17254 #ifdef NCURSES_VERSION
17255         cchar_t check;
17256         int check2 = curs_set((int)sizeof(check));
17257 #endif
17258         long x = winnstr(stdscr, "", 0);
17259         int x1, y1;
17260         getbegyx(stdscr, y1, x1)
17261   ;
17262   return 0;
17263 }
17264 _ACEOF
17265 rm -f conftest.$ac_objext conftest$ac_exeext
17266 if { (eval echo "$as_me:17266: \"$ac_link\"") >&5
17267   (eval $ac_link) 2>&5
17268   ac_status=$?
17269   echo "$as_me:17269: \$? = $ac_status" >&5
17270   (exit $ac_status); } &&
17271          { ac_try='test -s conftest$ac_exeext'
17272   { (eval echo "$as_me:17272: \"$ac_try\"") >&5
17273   (eval $ac_try) 2>&5
17274   ac_status=$?
17275   echo "$as_me:17275: \$? = $ac_status" >&5
17276   (exit $ac_status); }; }; then
17277   cf_cv_need_xopen_extension=none
17278 else
17279   echo "$as_me: failed program was:" >&5
17280 cat conftest.$ac_ext >&5
17281
17282         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17283         do
17284                 cat >conftest.$ac_ext <<_ACEOF
17285 #line 17285 "configure"
17286 #include "confdefs.h"
17287
17288 #define $cf_try_xopen_extension 1
17289 #include <stdlib.h>
17290 #include <${cf_cv_ncurses_header:-curses.h}>
17291 int
17292 main (void)
17293 {
17294
17295 #ifdef NCURSES_VERSION
17296                 cchar_t check;
17297                 int check2 = curs_set((int)sizeof(check));
17298 #endif
17299                 long x = winnstr(stdscr, "", 0);
17300                 int x1, y1;
17301                 getbegyx(stdscr, y1, x1)
17302   ;
17303   return 0;
17304 }
17305 _ACEOF
17306 rm -f conftest.$ac_objext conftest$ac_exeext
17307 if { (eval echo "$as_me:17307: \"$ac_link\"") >&5
17308   (eval $ac_link) 2>&5
17309   ac_status=$?
17310   echo "$as_me:17310: \$? = $ac_status" >&5
17311   (exit $ac_status); } &&
17312          { ac_try='test -s conftest$ac_exeext'
17313   { (eval echo "$as_me:17313: \"$ac_try\"") >&5
17314   (eval $ac_try) 2>&5
17315   ac_status=$?
17316   echo "$as_me:17316: \$? = $ac_status" >&5
17317   (exit $ac_status); }; }; then
17318   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17319 else
17320   echo "$as_me: failed program was:" >&5
17321 cat conftest.$ac_ext >&5
17322 fi
17323 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17324         done
17325
17326 fi
17327 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17328
17329 fi
17330 echo "$as_me:17330: result: $cf_cv_need_xopen_extension" >&5
17331 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17332
17333 case $cf_cv_need_xopen_extension in
17334 (*_*)
17335
17336         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17337         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17338
17339         ;;
17340 esac
17341
17342 echo "$as_me:17342: checking for term.h" >&5
17343 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17344 if test "${cf_cv_term_header+set}" = set; then
17345   echo $ECHO_N "(cached) $ECHO_C" >&6
17346 else
17347
17348 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17349 # for <term.h> if we do not find the variant.
17350
17351 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17352
17353 case ${cf_cv_ncurses_header:-curses.h} in
17354 (*/*)
17355         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17356         cf_header_list="$cf_header_item $cf_header_list"
17357         ;;
17358 esac
17359
17360 for cf_header in $cf_header_list
17361 do
17362         cat >conftest.$ac_ext <<_ACEOF
17363 #line 17363 "configure"
17364 #include "confdefs.h"
17365
17366 #include <${cf_cv_ncurses_header:-curses.h}>
17367 #include <${cf_header}>
17368 int
17369 main (void)
17370 {
17371 WINDOW *x
17372   ;
17373   return 0;
17374 }
17375 _ACEOF
17376 rm -f conftest.$ac_objext
17377 if { (eval echo "$as_me:17377: \"$ac_compile\"") >&5
17378   (eval $ac_compile) 2>&5
17379   ac_status=$?
17380   echo "$as_me:17380: \$? = $ac_status" >&5
17381   (exit $ac_status); } &&
17382          { ac_try='test -s conftest.$ac_objext'
17383   { (eval echo "$as_me:17383: \"$ac_try\"") >&5
17384   (eval $ac_try) 2>&5
17385   ac_status=$?
17386   echo "$as_me:17386: \$? = $ac_status" >&5
17387   (exit $ac_status); }; }; then
17388   cf_cv_term_header=$cf_header
17389          break
17390 else
17391   echo "$as_me: failed program was:" >&5
17392 cat conftest.$ac_ext >&5
17393 cf_cv_term_header=no
17394 fi
17395 rm -f conftest.$ac_objext conftest.$ac_ext
17396 done
17397
17398 case $cf_cv_term_header in
17399 (no)
17400         # If curses is ncurses, some packagers still mess it up by trying to make
17401         # us use GNU termcap.  This handles the most common case.
17402         for cf_header in ncurses/term.h ncursesw/term.h
17403         do
17404                 cat >conftest.$ac_ext <<_ACEOF
17405 #line 17405 "configure"
17406 #include "confdefs.h"
17407
17408 #include <${cf_cv_ncurses_header:-curses.h}>
17409 #ifdef NCURSES_VERSION
17410 #include <${cf_header}>
17411 #else
17412 make an error
17413 #endif
17414 int
17415 main (void)
17416 {
17417 WINDOW *x
17418   ;
17419   return 0;
17420 }
17421 _ACEOF
17422 rm -f conftest.$ac_objext
17423 if { (eval echo "$as_me:17423: \"$ac_compile\"") >&5
17424   (eval $ac_compile) 2>&5
17425   ac_status=$?
17426   echo "$as_me:17426: \$? = $ac_status" >&5
17427   (exit $ac_status); } &&
17428          { ac_try='test -s conftest.$ac_objext'
17429   { (eval echo "$as_me:17429: \"$ac_try\"") >&5
17430   (eval $ac_try) 2>&5
17431   ac_status=$?
17432   echo "$as_me:17432: \$? = $ac_status" >&5
17433   (exit $ac_status); }; }; then
17434   cf_cv_term_header=$cf_header
17435                          break
17436 else
17437   echo "$as_me: failed program was:" >&5
17438 cat conftest.$ac_ext >&5
17439 cf_cv_term_header=no
17440 fi
17441 rm -f conftest.$ac_objext conftest.$ac_ext
17442         done
17443         ;;
17444 esac
17445
17446 fi
17447 echo "$as_me:17447: result: $cf_cv_term_header" >&5
17448 echo "${ECHO_T}$cf_cv_term_header" >&6
17449
17450 case $cf_cv_term_header in
17451 (term.h)
17452
17453 cat >>confdefs.h <<\EOF
17454 #define HAVE_TERM_H 1
17455 EOF
17456
17457         ;;
17458 (ncurses/term.h)
17459
17460 cat >>confdefs.h <<\EOF
17461 #define HAVE_NCURSES_TERM_H 1
17462 EOF
17463
17464         ;;
17465 (ncursesw/term.h)
17466
17467 cat >>confdefs.h <<\EOF
17468 #define HAVE_NCURSESW_TERM_H 1
17469 EOF
17470
17471         ;;
17472 esac
17473
17474 echo "$as_me:17474: checking for unctrl.h" >&5
17475 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
17476 if test "${cf_cv_unctrl_header+set}" = set; then
17477   echo $ECHO_N "(cached) $ECHO_C" >&6
17478 else
17479
17480 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
17481 # for <unctrl.h> if we do not find the variant.
17482
17483 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
17484
17485 case ${cf_cv_ncurses_header:-curses.h} in
17486 (*/*)
17487         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
17488         cf_header_list="$cf_header_item $cf_header_list"
17489         ;;
17490 esac
17491
17492 for cf_header in $cf_header_list
17493 do
17494         cat >conftest.$ac_ext <<_ACEOF
17495 #line 17495 "configure"
17496 #include "confdefs.h"
17497
17498 #include <${cf_cv_ncurses_header:-curses.h}>
17499 #include <${cf_header}>
17500 int
17501 main (void)
17502 {
17503 WINDOW *x
17504   ;
17505   return 0;
17506 }
17507 _ACEOF
17508 rm -f conftest.$ac_objext
17509 if { (eval echo "$as_me:17509: \"$ac_compile\"") >&5
17510   (eval $ac_compile) 2>&5
17511   ac_status=$?
17512   echo "$as_me:17512: \$? = $ac_status" >&5
17513   (exit $ac_status); } &&
17514          { ac_try='test -s conftest.$ac_objext'
17515   { (eval echo "$as_me:17515: \"$ac_try\"") >&5
17516   (eval $ac_try) 2>&5
17517   ac_status=$?
17518   echo "$as_me:17518: \$? = $ac_status" >&5
17519   (exit $ac_status); }; }; then
17520   cf_cv_unctrl_header=$cf_header
17521          break
17522 else
17523   echo "$as_me: failed program was:" >&5
17524 cat conftest.$ac_ext >&5
17525 cf_cv_unctrl_header=no
17526 fi
17527 rm -f conftest.$ac_objext conftest.$ac_ext
17528 done
17529
17530 fi
17531 echo "$as_me:17531: result: $cf_cv_unctrl_header" >&5
17532 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
17533
17534 case $cf_cv_unctrl_header in
17535 (no)
17536         { echo "$as_me:17536: WARNING: unctrl.h header not found" >&5
17537 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
17538         ;;
17539 esac
17540
17541 case $cf_cv_unctrl_header in
17542 (unctrl.h)
17543
17544 cat >>confdefs.h <<\EOF
17545 #define HAVE_UNCTRL_H 1
17546 EOF
17547
17548         ;;
17549 (ncurses/unctrl.h)
17550
17551 cat >>confdefs.h <<\EOF
17552 #define HAVE_NCURSES_UNCTRL_H 1
17553 EOF
17554
17555         ;;
17556 (ncursesw/unctrl.h)
17557
17558 cat >>confdefs.h <<\EOF
17559 #define HAVE_NCURSESW_UNCTRL_H 1
17560 EOF
17561
17562         ;;
17563 esac
17564
17565 for cf_func in \
17566 alloc_pair \
17567 assume_default_colors \
17568 chgat \
17569 color_content \
17570 color_set \
17571 copywin \
17572 delscreen \
17573 dupwin \
17574 filter \
17575 getbegx \
17576 getcurx \
17577 getmaxx \
17578 getnstr \
17579 getparx \
17580 getwin \
17581 halfdelay \
17582 init_extended_color \
17583 mvderwin \
17584 mvvline \
17585 mvwin \
17586 mvwvline \
17587 napms \
17588 newpad \
17589 putwin \
17590 reset_color_pairs \
17591 resize_term \
17592 resizeterm \
17593 restartterm \
17594 ripoffline \
17595 scr_dump \
17596 setupterm \
17597 slk_color \
17598 slk_init \
17599 termattrs \
17600 tgetent \
17601 tigetnum \
17602 tigetstr \
17603 tputs_sp \
17604 typeahead \
17605 use_default_colors \
17606 use_env \
17607 use_extended_names \
17608 use_screen \
17609 use_window \
17610 vid_puts \
17611 vidputs \
17612 vsscanf \
17613 vw_printw \
17614 wchgat \
17615 winsdelln \
17616 winsstr \
17617 wresize \
17618 wsyncdown \
17619 _tracef \
17620
17621 do
17622
17623 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17624
17625         echo "$as_me:17625: checking for ${cf_func}" >&5
17626 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17627
17628 echo "${as_me:-configure}:17628: testing ${cf_func} ..." 1>&5
17629
17630         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17631   echo $ECHO_N "(cached) $ECHO_C" >&6
17632 else
17633
17634                 eval cf_result='$ac_cv_func_'$cf_func
17635                 if test ".$cf_result" != ".no"; then
17636                         cat >conftest.$ac_ext <<_ACEOF
17637 #line 17637 "configure"
17638 #include "confdefs.h"
17639
17640 #ifdef HAVE_XCURSES
17641 #include <xcurses.h>
17642 char * XCursesProgramName = "test";
17643 #else
17644 #include <${cf_cv_ncurses_header:-curses.h}>
17645 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17646 #include <ncursesw/term.h>
17647 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17648 #include <ncurses/term.h>
17649 #elif defined(HAVE_TERM_H)
17650 #include <term.h>
17651 #endif
17652 #endif
17653
17654 int
17655 main (void)
17656 {
17657
17658 #ifndef ${cf_func}
17659 long foo = (long)(&${cf_func});
17660 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17661 if (foo + 1234L > 5678L)
17662         ${cf_cv_main_return:-return}(foo != 0);
17663 #endif
17664
17665   ;
17666   return 0;
17667 }
17668 _ACEOF
17669 rm -f conftest.$ac_objext conftest$ac_exeext
17670 if { (eval echo "$as_me:17670: \"$ac_link\"") >&5
17671   (eval $ac_link) 2>&5
17672   ac_status=$?
17673   echo "$as_me:17673: \$? = $ac_status" >&5
17674   (exit $ac_status); } &&
17675          { ac_try='test -s conftest$ac_exeext'
17676   { (eval echo "$as_me:17676: \"$ac_try\"") >&5
17677   (eval $ac_try) 2>&5
17678   ac_status=$?
17679   echo "$as_me:17679: \$? = $ac_status" >&5
17680   (exit $ac_status); }; }; then
17681   cf_result=yes
17682 else
17683   echo "$as_me: failed program was:" >&5
17684 cat conftest.$ac_ext >&5
17685 cf_result=no
17686 fi
17687 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17688                 fi
17689                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17690
17691 fi
17692
17693         # use the computed/retrieved cache-value:
17694         eval 'cf_result=$cf_cv_func_'$cf_func
17695         echo "$as_me:17695: result: $cf_result" >&5
17696 echo "${ECHO_T}$cf_result" >&6
17697         if test $cf_result != no; then
17698                 cat >>confdefs.h <<EOF
17699 #define HAVE_${cf_tr_func} 1
17700 EOF
17701
17702         fi
17703 done
17704
17705 for cf_func in tputs
17706 do
17707
17708 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17709
17710         echo "$as_me:17710: checking for ${cf_func}" >&5
17711 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17712
17713 echo "${as_me:-configure}:17713: testing ${cf_func} ..." 1>&5
17714
17715         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17716   echo $ECHO_N "(cached) $ECHO_C" >&6
17717 else
17718
17719                 eval cf_result='$ac_cv_func_'$cf_func
17720                 if test ".$cf_result" != ".no"; then
17721                         cat >conftest.$ac_ext <<_ACEOF
17722 #line 17722 "configure"
17723 #include "confdefs.h"
17724
17725 #ifdef HAVE_XCURSES
17726 #include <xcurses.h>
17727 char * XCursesProgramName = "test";
17728 #else
17729 #include <${cf_cv_ncurses_header:-curses.h}>
17730 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17731 #include <ncursesw/term.h>
17732 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17733 #include <ncurses/term.h>
17734 #elif defined(HAVE_TERM_H)
17735 #include <term.h>
17736 #endif
17737 #endif
17738
17739 int
17740 main (void)
17741 {
17742
17743 #ifndef ${cf_func}
17744 long foo = (long)(&${cf_func});
17745 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17746 if (foo + 1234L > 5678L)
17747         ${cf_cv_main_return:-return}(foo != 0);
17748 #endif
17749
17750   ;
17751   return 0;
17752 }
17753 _ACEOF
17754 rm -f conftest.$ac_objext conftest$ac_exeext
17755 if { (eval echo "$as_me:17755: \"$ac_link\"") >&5
17756   (eval $ac_link) 2>&5
17757   ac_status=$?
17758   echo "$as_me:17758: \$? = $ac_status" >&5
17759   (exit $ac_status); } &&
17760          { ac_try='test -s conftest$ac_exeext'
17761   { (eval echo "$as_me:17761: \"$ac_try\"") >&5
17762   (eval $ac_try) 2>&5
17763   ac_status=$?
17764   echo "$as_me:17764: \$? = $ac_status" >&5
17765   (exit $ac_status); }; }; then
17766   cf_result=yes
17767 else
17768   echo "$as_me: failed program was:" >&5
17769 cat conftest.$ac_ext >&5
17770 cf_result=no
17771 fi
17772 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17773                 fi
17774                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17775
17776 fi
17777
17778         # use the computed/retrieved cache-value:
17779         eval 'cf_result=$cf_cv_func_'$cf_func
17780         echo "$as_me:17780: result: $cf_result" >&5
17781 echo "${ECHO_T}$cf_result" >&6
17782         if test $cf_result != no; then
17783                 cat >>confdefs.h <<EOF
17784 #define HAVE_${cf_tr_func} 1
17785 EOF
17786
17787         fi
17788 done
17789
17790 if test x$cf_cv_func_tputs = xyes
17791 then
17792         cf_done=no
17793         for cf_arg in int char
17794         do
17795                 for cf_ret in int void
17796                 do
17797                         if test $cf_ret = void
17798                         then
17799                                 cf_return="/* nothing */"
17800                         else
17801                                 cf_return="return value"
17802                         fi
17803                         cat >conftest.$ac_ext <<_ACEOF
17804 #line 17804 "configure"
17805 #include "confdefs.h"
17806
17807 #include <${cf_cv_ncurses_header:-curses.h}>
17808 #include <$cf_cv_term_header>
17809
17810 static $cf_ret outc($cf_arg value) { $cf_return; }
17811
17812 int
17813 main (void)
17814 {
17815
17816         tputs("hello", 0, outc);
17817         ${cf_cv_main_return:-return}(0);
17818
17819   ;
17820   return 0;
17821 }
17822 _ACEOF
17823 rm -f conftest.$ac_objext
17824 if { (eval echo "$as_me:17824: \"$ac_compile\"") >&5
17825   (eval $ac_compile) 2>&5
17826   ac_status=$?
17827   echo "$as_me:17827: \$? = $ac_status" >&5
17828   (exit $ac_status); } &&
17829          { ac_try='test -s conftest.$ac_objext'
17830   { (eval echo "$as_me:17830: \"$ac_try\"") >&5
17831   (eval $ac_try) 2>&5
17832   ac_status=$?
17833   echo "$as_me:17833: \$? = $ac_status" >&5
17834   (exit $ac_status); }; }; then
17835
17836                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
17837
17838 echo "${as_me:-configure}:17838: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
17839
17840                 cat >>confdefs.h <<EOF
17841 #define TPUTS_ARG               $cf_arg
17842 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
17843 #define TPUTS_RETURN(value)     $cf_return
17844 EOF
17845                 cf_done=yes
17846                 break
17847
17848 else
17849   echo "$as_me: failed program was:" >&5
17850 cat conftest.$ac_ext >&5
17851 fi
17852 rm -f conftest.$ac_objext conftest.$ac_ext
17853                 done
17854                 test $cf_done = yes && break
17855         done
17856 fi
17857
17858 echo "$as_me:17858: checking for ncurses extended functions" >&5
17859 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
17860 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
17861   echo $ECHO_N "(cached) $ECHO_C" >&6
17862 else
17863
17864 cat >conftest.$ac_ext <<_ACEOF
17865 #line 17865 "configure"
17866 #include "confdefs.h"
17867
17868 #include <${cf_cv_ncurses_header:-curses.h}>
17869 int
17870 main (void)
17871 {
17872
17873 int x = NCURSES_EXT_FUNCS
17874
17875   ;
17876   return 0;
17877 }
17878 _ACEOF
17879 rm -f conftest.$ac_objext
17880 if { (eval echo "$as_me:17880: \"$ac_compile\"") >&5
17881   (eval $ac_compile) 2>&5
17882   ac_status=$?
17883   echo "$as_me:17883: \$? = $ac_status" >&5
17884   (exit $ac_status); } &&
17885          { ac_try='test -s conftest.$ac_objext'
17886   { (eval echo "$as_me:17886: \"$ac_try\"") >&5
17887   (eval $ac_try) 2>&5
17888   ac_status=$?
17889   echo "$as_me:17889: \$? = $ac_status" >&5
17890   (exit $ac_status); }; }; then
17891   cf_cv_ncurses_ext_funcs=defined
17892 else
17893   echo "$as_me: failed program was:" >&5
17894 cat conftest.$ac_ext >&5
17895
17896 cat >conftest.$ac_ext <<_ACEOF
17897 #line 17897 "configure"
17898 #include "confdefs.h"
17899
17900 #include <${cf_cv_ncurses_header:-curses.h}>
17901 int
17902 main (void)
17903 {
17904
17905         (void) assume_default_colors (0, 0);
17906         (void) curses_version ();
17907         (void) define_key (0, 0);
17908         (void) is_term_resized (0, 0);
17909         (void) key_defined (0);
17910         (void) keybound (0, 0);
17911         (void) keyok (0, 0);
17912         (void) resize_term (0, 0);
17913         (void) resizeterm (0, 0);
17914         (void) use_default_colors ();
17915         (void) use_extended_names (0);
17916         (void) wresize (0, 0, 0);
17917   ;
17918   return 0;
17919 }
17920 _ACEOF
17921 rm -f conftest.$ac_objext conftest$ac_exeext
17922 if { (eval echo "$as_me:17922: \"$ac_link\"") >&5
17923   (eval $ac_link) 2>&5
17924   ac_status=$?
17925   echo "$as_me:17925: \$? = $ac_status" >&5
17926   (exit $ac_status); } &&
17927          { ac_try='test -s conftest$ac_exeext'
17928   { (eval echo "$as_me:17928: \"$ac_try\"") >&5
17929   (eval $ac_try) 2>&5
17930   ac_status=$?
17931   echo "$as_me:17931: \$? = $ac_status" >&5
17932   (exit $ac_status); }; }; then
17933   cf_cv_ncurses_ext_funcs=yes
17934 else
17935   echo "$as_me: failed program was:" >&5
17936 cat conftest.$ac_ext >&5
17937 cf_cv_ncurses_ext_funcs=no
17938 fi
17939 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17940
17941 fi
17942 rm -f conftest.$ac_objext conftest.$ac_ext
17943
17944 fi
17945 echo "$as_me:17945: result: $cf_cv_ncurses_ext_funcs" >&5
17946 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
17947 test "$cf_cv_ncurses_ext_funcs" = yes &&
17948 cat >>confdefs.h <<\EOF
17949 #define NCURSES_EXT_FUNCS 1
17950 EOF
17951
17952 if test "$cf_enable_widec" = yes
17953 then
17954         # workaround for systems with ncurses before 20111029, due to change of
17955         # feature test macro from _XPG5 to _XOPEN_SOURCE
17956         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
17957         then
17958                 cf_define_xpg5=no
17959                 echo "$as_me:17959: checking if _XPG5 should be defined to enable wide-characters" >&5
17960 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
17961
17962                 cat >conftest.$ac_ext <<_ACEOF
17963 #line 17963 "configure"
17964 #include "confdefs.h"
17965
17966 #include <${cf_cv_ncurses_header:-curses.h}>
17967 int
17968 main (void)
17969 {
17970 int x = _XPG5
17971   ;
17972   return 0;
17973 }
17974 _ACEOF
17975 rm -f conftest.$ac_objext
17976 if { (eval echo "$as_me:17976: \"$ac_compile\"") >&5
17977   (eval $ac_compile) 2>&5
17978   ac_status=$?
17979   echo "$as_me:17979: \$? = $ac_status" >&5
17980   (exit $ac_status); } &&
17981          { ac_try='test -s conftest.$ac_objext'
17982   { (eval echo "$as_me:17982: \"$ac_try\"") >&5
17983   (eval $ac_try) 2>&5
17984   ac_status=$?
17985   echo "$as_me:17985: \$? = $ac_status" >&5
17986   (exit $ac_status); }; }; then
17987   :
17988 else
17989   echo "$as_me: failed program was:" >&5
17990 cat conftest.$ac_ext >&5
17991 cf_save_cppflags="$CPPFLAGS"
17992                          CPPFLAGS="$CPPFLAGS -D_XPG5"
17993                          cat >conftest.$ac_ext <<_ACEOF
17994 #line 17994 "configure"
17995 #include "confdefs.h"
17996
17997 #include <${cf_cv_ncurses_header:-curses.h}>
17998 int
17999 main (void)
18000 {
18001 int x = _XPG5
18002   ;
18003   return 0;
18004 }
18005 _ACEOF
18006 rm -f conftest.$ac_objext
18007 if { (eval echo "$as_me:18007: \"$ac_compile\"") >&5
18008   (eval $ac_compile) 2>&5
18009   ac_status=$?
18010   echo "$as_me:18010: \$? = $ac_status" >&5
18011   (exit $ac_status); } &&
18012          { ac_try='test -s conftest.$ac_objext'
18013   { (eval echo "$as_me:18013: \"$ac_try\"") >&5
18014   (eval $ac_try) 2>&5
18015   ac_status=$?
18016   echo "$as_me:18016: \$? = $ac_status" >&5
18017   (exit $ac_status); }; }; then
18018   cf_define_xpg5=yes
18019 else
18020   echo "$as_me: failed program was:" >&5
18021 cat conftest.$ac_ext >&5
18022 fi
18023 rm -f conftest.$ac_objext conftest.$ac_ext
18024                          CPPFLAGS="$cf_save_cppflags"
18025 fi
18026 rm -f conftest.$ac_objext conftest.$ac_ext
18027                 echo "$as_me:18027: result: $cf_define_xpg5" >&5
18028 echo "${ECHO_T}$cf_define_xpg5" >&6
18029
18030                 if test "$cf_define_xpg5" = yes
18031                 then
18032                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18033                 fi
18034         fi
18035
18036         echo "$as_me:18036: checking for wide-character functions" >&5
18037 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18038 if test "${cf_cv_widechar_funcs+set}" = set; then
18039   echo $ECHO_N "(cached) $ECHO_C" >&6
18040 else
18041
18042         cat >conftest.$ac_ext <<_ACEOF
18043 #line 18043 "configure"
18044 #include "confdefs.h"
18045
18046 #include <${cf_cv_ncurses_header:-curses.h}>
18047 int
18048 main (void)
18049 {
18050
18051                 static wchar_t src_wchar[2];
18052                 static cchar_t dst_cchar;
18053                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18054
18055   ;
18056   return 0;
18057 }
18058 _ACEOF
18059 rm -f conftest.$ac_objext conftest$ac_exeext
18060 if { (eval echo "$as_me:18060: \"$ac_link\"") >&5
18061   (eval $ac_link) 2>&5
18062   ac_status=$?
18063   echo "$as_me:18063: \$? = $ac_status" >&5
18064   (exit $ac_status); } &&
18065          { ac_try='test -s conftest$ac_exeext'
18066   { (eval echo "$as_me:18066: \"$ac_try\"") >&5
18067   (eval $ac_try) 2>&5
18068   ac_status=$?
18069   echo "$as_me:18069: \$? = $ac_status" >&5
18070   (exit $ac_status); }; }; then
18071   cf_cv_widechar_funcs=yes
18072 else
18073   echo "$as_me: failed program was:" >&5
18074 cat conftest.$ac_ext >&5
18075 cf_cv_widechar_funcs=no
18076 fi
18077 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18078
18079 fi
18080 echo "$as_me:18080: result: $cf_cv_widechar_funcs" >&5
18081 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18082         if test "$cf_cv_widechar_funcs" != no ; then
18083
18084 cat >>confdefs.h <<\EOF
18085 #define USE_WIDEC_SUPPORT 1
18086 EOF
18087
18088         else
18089                 cat >>confdefs.h <<\EOF
18090 #define USE_WIDEC_SUPPORT 0
18091 EOF
18092
18093         fi
18094 else
18095         cat >>confdefs.h <<\EOF
18096 #define USE_WIDEC_SUPPORT 0
18097 EOF
18098
18099 fi
18100
18101 echo "$as_me:18101: checking if $cf_cv_screen library uses pthreads" >&5
18102 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18103 if test "${cf_cv_use_pthreads+set}" = set; then
18104   echo $ECHO_N "(cached) $ECHO_C" >&6
18105 else
18106
18107 cat >conftest.$ac_ext <<_ACEOF
18108 #line 18108 "configure"
18109 #include "confdefs.h"
18110
18111 #include <${cf_cv_ncurses_header:-curses.h}>
18112 extern void _nc_init_pthreads(void);
18113
18114 int
18115 main (void)
18116 {
18117
18118         initscr();
18119         _nc_init_pthreads();
18120
18121   ;
18122   return 0;
18123 }
18124 _ACEOF
18125 rm -f conftest.$ac_objext conftest$ac_exeext
18126 if { (eval echo "$as_me:18126: \"$ac_link\"") >&5
18127   (eval $ac_link) 2>&5
18128   ac_status=$?
18129   echo "$as_me:18129: \$? = $ac_status" >&5
18130   (exit $ac_status); } &&
18131          { ac_try='test -s conftest$ac_exeext'
18132   { (eval echo "$as_me:18132: \"$ac_try\"") >&5
18133   (eval $ac_try) 2>&5
18134   ac_status=$?
18135   echo "$as_me:18135: \$? = $ac_status" >&5
18136   (exit $ac_status); }; }; then
18137   cf_cv_use_pthreads=yes
18138 else
18139   echo "$as_me: failed program was:" >&5
18140 cat conftest.$ac_ext >&5
18141 cf_cv_use_pthreads=no
18142 fi
18143 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18144
18145 fi
18146 echo "$as_me:18146: result: $cf_cv_use_pthreads" >&5
18147 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18148 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
18149 #define USE_PTHREADS 1
18150 EOF
18151
18152 echo "$as_me:18152: checking if sys/time.h works with sys/select.h" >&5
18153 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18154 if test "${cf_cv_sys_time_select+set}" = set; then
18155   echo $ECHO_N "(cached) $ECHO_C" >&6
18156 else
18157
18158 cat >conftest.$ac_ext <<_ACEOF
18159 #line 18159 "configure"
18160 #include "confdefs.h"
18161
18162 #include <sys/types.h>
18163 #ifdef HAVE_SYS_TIME_H
18164 #include <sys/time.h>
18165 #endif
18166 #ifdef HAVE_SYS_SELECT_H
18167 #include <sys/select.h>
18168 #endif
18169
18170 int
18171 main (void)
18172 {
18173
18174   ;
18175   return 0;
18176 }
18177 _ACEOF
18178 rm -f conftest.$ac_objext
18179 if { (eval echo "$as_me:18179: \"$ac_compile\"") >&5
18180   (eval $ac_compile) 2>&5
18181   ac_status=$?
18182   echo "$as_me:18182: \$? = $ac_status" >&5
18183   (exit $ac_status); } &&
18184          { ac_try='test -s conftest.$ac_objext'
18185   { (eval echo "$as_me:18185: \"$ac_try\"") >&5
18186   (eval $ac_try) 2>&5
18187   ac_status=$?
18188   echo "$as_me:18188: \$? = $ac_status" >&5
18189   (exit $ac_status); }; }; then
18190   cf_cv_sys_time_select=yes
18191 else
18192   echo "$as_me: failed program was:" >&5
18193 cat conftest.$ac_ext >&5
18194 cf_cv_sys_time_select=no
18195 fi
18196 rm -f conftest.$ac_objext conftest.$ac_ext
18197
18198 fi
18199
18200 echo "$as_me:18200: result: $cf_cv_sys_time_select" >&5
18201 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18202 test "$cf_cv_sys_time_select" = yes &&
18203 cat >>confdefs.h <<\EOF
18204 #define HAVE_SYS_TIME_SELECT 1
18205 EOF
18206
18207 # special check for test/ditto.c
18208
18209 echo "$as_me:18209: checking for openpty in -lutil" >&5
18210 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18211 if test "${ac_cv_lib_util_openpty+set}" = set; then
18212   echo $ECHO_N "(cached) $ECHO_C" >&6
18213 else
18214   ac_check_lib_save_LIBS=$LIBS
18215 LIBS="-lutil  $LIBS"
18216 cat >conftest.$ac_ext <<_ACEOF
18217 #line 18217 "configure"
18218 #include "confdefs.h"
18219
18220 /* Override any gcc2 internal prototype to avoid an error.  */
18221 #ifdef __cplusplus
18222 extern "C"
18223 #endif
18224 /* We use char because int might match the return type of a gcc2
18225    builtin and then its argument prototype would still apply.  */
18226 char openpty ();
18227 int
18228 main (void)
18229 {
18230 openpty ();
18231   ;
18232   return 0;
18233 }
18234 _ACEOF
18235 rm -f conftest.$ac_objext conftest$ac_exeext
18236 if { (eval echo "$as_me:18236: \"$ac_link\"") >&5
18237   (eval $ac_link) 2>&5
18238   ac_status=$?
18239   echo "$as_me:18239: \$? = $ac_status" >&5
18240   (exit $ac_status); } &&
18241          { ac_try='test -s conftest$ac_exeext'
18242   { (eval echo "$as_me:18242: \"$ac_try\"") >&5
18243   (eval $ac_try) 2>&5
18244   ac_status=$?
18245   echo "$as_me:18245: \$? = $ac_status" >&5
18246   (exit $ac_status); }; }; then
18247   ac_cv_lib_util_openpty=yes
18248 else
18249   echo "$as_me: failed program was:" >&5
18250 cat conftest.$ac_ext >&5
18251 ac_cv_lib_util_openpty=no
18252 fi
18253 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18254 LIBS=$ac_check_lib_save_LIBS
18255 fi
18256 echo "$as_me:18256: result: $ac_cv_lib_util_openpty" >&5
18257 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18258 if test $ac_cv_lib_util_openpty = yes; then
18259   cf_cv_lib_util=yes
18260 else
18261   cf_cv_lib_util=no
18262 fi
18263
18264 echo "$as_me:18264: checking for openpty header" >&5
18265 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18266 if test "${cf_cv_func_openpty+set}" = set; then
18267   echo $ECHO_N "(cached) $ECHO_C" >&6
18268 else
18269
18270         cf_save_LIBS="$LIBS"
18271         test $cf_cv_lib_util = yes && {
18272 cf_add_libs="-lutil"
18273 # Filter out duplicates - this happens with badly-designed ".pc" files...
18274 for cf_add_1lib in $LIBS
18275 do
18276         for cf_add_2lib in $cf_add_libs
18277         do
18278                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18279                 then
18280                         cf_add_1lib=
18281                         break
18282                 fi
18283         done
18284         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18285 done
18286 LIBS="$cf_add_libs"
18287  }
18288         for cf_header in pty.h libutil.h util.h
18289         do
18290         cat >conftest.$ac_ext <<_ACEOF
18291 #line 18291 "configure"
18292 #include "confdefs.h"
18293
18294 #include <$cf_header>
18295
18296 int
18297 main (void)
18298 {
18299
18300         int x = openpty((int *)0, (int *)0, (char *)0,
18301                                    (struct termios *)0, (struct winsize *)0);
18302
18303   ;
18304   return 0;
18305 }
18306 _ACEOF
18307 rm -f conftest.$ac_objext conftest$ac_exeext
18308 if { (eval echo "$as_me:18308: \"$ac_link\"") >&5
18309   (eval $ac_link) 2>&5
18310   ac_status=$?
18311   echo "$as_me:18311: \$? = $ac_status" >&5
18312   (exit $ac_status); } &&
18313          { ac_try='test -s conftest$ac_exeext'
18314   { (eval echo "$as_me:18314: \"$ac_try\"") >&5
18315   (eval $ac_try) 2>&5
18316   ac_status=$?
18317   echo "$as_me:18317: \$? = $ac_status" >&5
18318   (exit $ac_status); }; }; then
18319
18320                 cf_cv_func_openpty=$cf_header
18321                 break
18322
18323 else
18324   echo "$as_me: failed program was:" >&5
18325 cat conftest.$ac_ext >&5
18326
18327                 cf_cv_func_openpty=no
18328
18329 fi
18330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18331         done
18332         LIBS="$cf_save_LIBS"
18333
18334 fi
18335 echo "$as_me:18335: result: $cf_cv_func_openpty" >&5
18336 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18337
18338 if test "$cf_cv_func_openpty" != no ; then
18339
18340 cat >>confdefs.h <<EOF
18341 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18342 EOF
18343
18344 cat >>confdefs.h <<\EOF
18345 #define USE_XTERM_PTY 1
18346 EOF
18347
18348         if test "x$cf_cv_lib_util" = xyes ; then
18349
18350 cf_add_libs="-lutil"
18351 # Filter out duplicates - this happens with badly-designed ".pc" files...
18352 for cf_add_1lib in $TEST_LIBS
18353 do
18354         for cf_add_2lib in $cf_add_libs
18355         do
18356                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18357                 then
18358                         cf_add_1lib=
18359                         break
18360                 fi
18361         done
18362         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18363 done
18364 TEST_LIBS="$cf_add_libs"
18365
18366         fi
18367 fi
18368
18369 echo "$as_me:18369: checking for function curses_version" >&5
18370 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
18371 if test "${cf_cv_func_curses_version+set}" = set; then
18372   echo $ECHO_N "(cached) $ECHO_C" >&6
18373 else
18374
18375 if test "$cross_compiling" = yes; then
18376   cf_cv_func_curses_version=unknown
18377 else
18378   cat >conftest.$ac_ext <<_ACEOF
18379 #line 18379 "configure"
18380 #include "confdefs.h"
18381
18382 #include <${cf_cv_ncurses_header:-curses.h}>
18383 int main(void)
18384 {
18385         char temp[1024];
18386         sprintf(temp, "%s\n", curses_version());
18387         ${cf_cv_main_return:-return}(0);
18388 }
18389
18390 _ACEOF
18391 rm -f conftest$ac_exeext
18392 if { (eval echo "$as_me:18392: \"$ac_link\"") >&5
18393   (eval $ac_link) 2>&5
18394   ac_status=$?
18395   echo "$as_me:18395: \$? = $ac_status" >&5
18396   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18397   { (eval echo "$as_me:18397: \"$ac_try\"") >&5
18398   (eval $ac_try) 2>&5
18399   ac_status=$?
18400   echo "$as_me:18400: \$? = $ac_status" >&5
18401   (exit $ac_status); }; }; then
18402   cf_cv_func_curses_version=yes
18403
18404 else
18405   echo "$as_me: program exited with status $ac_status" >&5
18406 echo "$as_me: failed program was:" >&5
18407 cat conftest.$ac_ext >&5
18408 cf_cv_func_curses_version=no
18409
18410 fi
18411 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18412 fi
18413 rm -f core
18414 fi
18415 echo "$as_me:18415: result: $cf_cv_func_curses_version" >&5
18416 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
18417 test "$cf_cv_func_curses_version" = yes &&
18418 cat >>confdefs.h <<\EOF
18419 #define HAVE_CURSES_VERSION 1
18420 EOF
18421
18422 echo "$as_me:18422: checking for alternate character set array" >&5
18423 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
18424 if test "${cf_cv_curses_acs_map+set}" = set; then
18425   echo $ECHO_N "(cached) $ECHO_C" >&6
18426 else
18427
18428 cf_cv_curses_acs_map=unknown
18429 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
18430 do
18431 cat >conftest.$ac_ext <<_ACEOF
18432 #line 18432 "configure"
18433 #include "confdefs.h"
18434
18435 #include <${cf_cv_ncurses_header:-curses.h}>
18436
18437 int
18438 main (void)
18439 {
18440
18441 $name['k'] = ACS_PLUS
18442
18443   ;
18444   return 0;
18445 }
18446 _ACEOF
18447 rm -f conftest.$ac_objext conftest$ac_exeext
18448 if { (eval echo "$as_me:18448: \"$ac_link\"") >&5
18449   (eval $ac_link) 2>&5
18450   ac_status=$?
18451   echo "$as_me:18451: \$? = $ac_status" >&5
18452   (exit $ac_status); } &&
18453          { ac_try='test -s conftest$ac_exeext'
18454   { (eval echo "$as_me:18454: \"$ac_try\"") >&5
18455   (eval $ac_try) 2>&5
18456   ac_status=$?
18457   echo "$as_me:18457: \$? = $ac_status" >&5
18458   (exit $ac_status); }; }; then
18459   cf_cv_curses_acs_map=$name; break
18460 else
18461   echo "$as_me: failed program was:" >&5
18462 cat conftest.$ac_ext >&5
18463 fi
18464 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18465 done
18466
18467 fi
18468 echo "$as_me:18468: result: $cf_cv_curses_acs_map" >&5
18469 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
18470
18471 test "$cf_cv_curses_acs_map" != unknown &&
18472 cat >>confdefs.h <<EOF
18473 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
18474 EOF
18475
18476 if test "$cf_enable_widec" = yes; then
18477
18478 echo "$as_me:18478: checking for wide alternate character set array" >&5
18479 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
18480 if test "${cf_cv_curses_wacs_map+set}" = set; then
18481   echo $ECHO_N "(cached) $ECHO_C" >&6
18482 else
18483
18484         cf_cv_curses_wacs_map=unknown
18485         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
18486         do
18487         cat >conftest.$ac_ext <<_ACEOF
18488 #line 18488 "configure"
18489 #include "confdefs.h"
18490
18491 #ifndef _XOPEN_SOURCE_EXTENDED
18492 #define _XOPEN_SOURCE_EXTENDED
18493 #endif
18494 #include <${cf_cv_ncurses_header:-curses.h}>
18495 int
18496 main (void)
18497 {
18498 void *foo = &($name['k'])
18499   ;
18500   return 0;
18501 }
18502 _ACEOF
18503 rm -f conftest.$ac_objext conftest$ac_exeext
18504 if { (eval echo "$as_me:18504: \"$ac_link\"") >&5
18505   (eval $ac_link) 2>&5
18506   ac_status=$?
18507   echo "$as_me:18507: \$? = $ac_status" >&5
18508   (exit $ac_status); } &&
18509          { ac_try='test -s conftest$ac_exeext'
18510   { (eval echo "$as_me:18510: \"$ac_try\"") >&5
18511   (eval $ac_try) 2>&5
18512   ac_status=$?
18513   echo "$as_me:18513: \$? = $ac_status" >&5
18514   (exit $ac_status); }; }; then
18515   cf_cv_curses_wacs_map=$name
18516          break
18517 else
18518   echo "$as_me: failed program was:" >&5
18519 cat conftest.$ac_ext >&5
18520 fi
18521 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18522         done
18523 fi
18524 echo "$as_me:18524: result: $cf_cv_curses_wacs_map" >&5
18525 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
18526
18527 test "$cf_cv_curses_wacs_map" != unknown &&
18528 cat >>confdefs.h <<EOF
18529 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
18530 EOF
18531
18532 echo "$as_me:18532: checking for wide alternate character constants" >&5
18533 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
18534 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
18535   echo $ECHO_N "(cached) $ECHO_C" >&6
18536 else
18537
18538 cf_cv_curses_wacs_symbols=no
18539 if test "$cf_cv_curses_wacs_map" != unknown
18540 then
18541         cat >conftest.$ac_ext <<_ACEOF
18542 #line 18542 "configure"
18543 #include "confdefs.h"
18544
18545 #ifndef _XOPEN_SOURCE_EXTENDED
18546 #define _XOPEN_SOURCE_EXTENDED
18547 #endif
18548 #include <${cf_cv_ncurses_header:-curses.h}>
18549 int
18550 main (void)
18551 {
18552 cchar_t *foo = WACS_PLUS;
18553          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
18554   ;
18555   return 0;
18556 }
18557 _ACEOF
18558 rm -f conftest.$ac_objext conftest$ac_exeext
18559 if { (eval echo "$as_me:18559: \"$ac_link\"") >&5
18560   (eval $ac_link) 2>&5
18561   ac_status=$?
18562   echo "$as_me:18562: \$? = $ac_status" >&5
18563   (exit $ac_status); } &&
18564          { ac_try='test -s conftest$ac_exeext'
18565   { (eval echo "$as_me:18565: \"$ac_try\"") >&5
18566   (eval $ac_try) 2>&5
18567   ac_status=$?
18568   echo "$as_me:18568: \$? = $ac_status" >&5
18569   (exit $ac_status); }; }; then
18570   cf_cv_curses_wacs_symbols=yes
18571 else
18572   echo "$as_me: failed program was:" >&5
18573 cat conftest.$ac_ext >&5
18574 fi
18575 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18576 else
18577         cat >conftest.$ac_ext <<_ACEOF
18578 #line 18578 "configure"
18579 #include "confdefs.h"
18580
18581 #ifndef _XOPEN_SOURCE_EXTENDED
18582 #define _XOPEN_SOURCE_EXTENDED
18583 #endif
18584 #include <${cf_cv_ncurses_header:-curses.h}>
18585 int
18586 main (void)
18587 {
18588 cchar_t *foo = WACS_PLUS
18589   ;
18590   return 0;
18591 }
18592 _ACEOF
18593 rm -f conftest.$ac_objext conftest$ac_exeext
18594 if { (eval echo "$as_me:18594: \"$ac_link\"") >&5
18595   (eval $ac_link) 2>&5
18596   ac_status=$?
18597   echo "$as_me:18597: \$? = $ac_status" >&5
18598   (exit $ac_status); } &&
18599          { ac_try='test -s conftest$ac_exeext'
18600   { (eval echo "$as_me:18600: \"$ac_try\"") >&5
18601   (eval $ac_try) 2>&5
18602   ac_status=$?
18603   echo "$as_me:18603: \$? = $ac_status" >&5
18604   (exit $ac_status); }; }; then
18605   cf_cv_curses_wacs_symbols=yes
18606 else
18607   echo "$as_me: failed program was:" >&5
18608 cat conftest.$ac_ext >&5
18609 fi
18610 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18611 fi
18612
18613 fi
18614 echo "$as_me:18614: result: $cf_cv_curses_wacs_symbols" >&5
18615 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
18616
18617 test "$cf_cv_curses_wacs_symbols" != no &&
18618 cat >>confdefs.h <<\EOF
18619 #define CURSES_WACS_SYMBOLS 1
18620 EOF
18621
18622 fi
18623
18624 echo "$as_me:18624: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18625 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18626 cat >conftest.$ac_ext <<_ACEOF
18627 #line 18627 "configure"
18628 #include "confdefs.h"
18629
18630 #ifndef _XOPEN_SOURCE_EXTENDED
18631 #define _XOPEN_SOURCE_EXTENDED
18632 #endif
18633 #include <${cf_cv_ncurses_header:-curses.h}>
18634 int
18635 main (void)
18636 {
18637
18638 attr_t foo
18639
18640   ;
18641   return 0;
18642 }
18643 _ACEOF
18644 rm -f conftest.$ac_objext
18645 if { (eval echo "$as_me:18645: \"$ac_compile\"") >&5
18646   (eval $ac_compile) 2>&5
18647   ac_status=$?
18648   echo "$as_me:18648: \$? = $ac_status" >&5
18649   (exit $ac_status); } &&
18650          { ac_try='test -s conftest.$ac_objext'
18651   { (eval echo "$as_me:18651: \"$ac_try\"") >&5
18652   (eval $ac_try) 2>&5
18653   ac_status=$?
18654   echo "$as_me:18654: \$? = $ac_status" >&5
18655   (exit $ac_status); }; }; then
18656   cf_result=yes
18657 else
18658   echo "$as_me: failed program was:" >&5
18659 cat conftest.$ac_ext >&5
18660 cf_result=no
18661 fi
18662 rm -f conftest.$ac_objext conftest.$ac_ext
18663 echo "$as_me:18663: result: $cf_result" >&5
18664 echo "${ECHO_T}$cf_result" >&6
18665 if test $cf_result = yes ; then
18666
18667 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18668
18669 cat >>confdefs.h <<EOF
18670 #define $cf_result 1
18671 EOF
18672
18673 else
18674
18675 cat >>confdefs.h <<EOF
18676 #define attr_t long
18677 EOF
18678
18679 fi
18680
18681 if test "$cf_enable_widec" = yes; then
18682
18683 # This is needed on Tru64 5.0 to declare mbstate_t
18684 echo "$as_me:18684: checking if we must include wchar.h to declare mbstate_t" >&5
18685 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
18686 if test "${cf_cv_mbstate_t+set}" = set; then
18687   echo $ECHO_N "(cached) $ECHO_C" >&6
18688 else
18689
18690 cat >conftest.$ac_ext <<_ACEOF
18691 #line 18691 "configure"
18692 #include "confdefs.h"
18693
18694 #include <stdlib.h>
18695 #include <stdarg.h>
18696 #include <stdio.h>
18697 #ifdef HAVE_LIBUTF8_H
18698 #include <libutf8.h>
18699 #endif
18700 int
18701 main (void)
18702 {
18703 mbstate_t state
18704   ;
18705   return 0;
18706 }
18707 _ACEOF
18708 rm -f conftest.$ac_objext
18709 if { (eval echo "$as_me:18709: \"$ac_compile\"") >&5
18710   (eval $ac_compile) 2>&5
18711   ac_status=$?
18712   echo "$as_me:18712: \$? = $ac_status" >&5
18713   (exit $ac_status); } &&
18714          { ac_try='test -s conftest.$ac_objext'
18715   { (eval echo "$as_me:18715: \"$ac_try\"") >&5
18716   (eval $ac_try) 2>&5
18717   ac_status=$?
18718   echo "$as_me:18718: \$? = $ac_status" >&5
18719   (exit $ac_status); }; }; then
18720   cf_cv_mbstate_t=no
18721 else
18722   echo "$as_me: failed program was:" >&5
18723 cat conftest.$ac_ext >&5
18724 cat >conftest.$ac_ext <<_ACEOF
18725 #line 18725 "configure"
18726 #include "confdefs.h"
18727
18728 #include <stdlib.h>
18729 #include <stdarg.h>
18730 #include <stdio.h>
18731 #include <wchar.h>
18732 #ifdef HAVE_LIBUTF8_H
18733 #include <libutf8.h>
18734 #endif
18735 int
18736 main (void)
18737 {
18738 mbstate_t value
18739   ;
18740   return 0;
18741 }
18742 _ACEOF
18743 rm -f conftest.$ac_objext
18744 if { (eval echo "$as_me:18744: \"$ac_compile\"") >&5
18745   (eval $ac_compile) 2>&5
18746   ac_status=$?
18747   echo "$as_me:18747: \$? = $ac_status" >&5
18748   (exit $ac_status); } &&
18749          { ac_try='test -s conftest.$ac_objext'
18750   { (eval echo "$as_me:18750: \"$ac_try\"") >&5
18751   (eval $ac_try) 2>&5
18752   ac_status=$?
18753   echo "$as_me:18753: \$? = $ac_status" >&5
18754   (exit $ac_status); }; }; then
18755   cf_cv_mbstate_t=yes
18756 else
18757   echo "$as_me: failed program was:" >&5
18758 cat conftest.$ac_ext >&5
18759 cf_cv_mbstate_t=unknown
18760 fi
18761 rm -f conftest.$ac_objext conftest.$ac_ext
18762 fi
18763 rm -f conftest.$ac_objext conftest.$ac_ext
18764 fi
18765 echo "$as_me:18765: result: $cf_cv_mbstate_t" >&5
18766 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
18767
18768 if test "$cf_cv_mbstate_t" = yes ; then
18769
18770 cat >>confdefs.h <<\EOF
18771 #define NEED_WCHAR_H 1
18772 EOF
18773
18774         NEED_WCHAR_H=1
18775 fi
18776
18777 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
18778 if test "$cf_cv_mbstate_t" = unknown ; then
18779         NCURSES_MBSTATE_T=1
18780 fi
18781
18782 # if we find mbstate_t in either place, use substitution to provide a fallback.
18783 if test "$cf_cv_mbstate_t" != unknown ; then
18784         NCURSES_OK_MBSTATE_T=1
18785 fi
18786
18787 # This is needed on Tru64 5.0 to declare wchar_t
18788 echo "$as_me:18788: checking if we must include wchar.h to declare wchar_t" >&5
18789 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
18790 if test "${cf_cv_wchar_t+set}" = set; then
18791   echo $ECHO_N "(cached) $ECHO_C" >&6
18792 else
18793
18794 cat >conftest.$ac_ext <<_ACEOF
18795 #line 18795 "configure"
18796 #include "confdefs.h"
18797
18798 #include <stdlib.h>
18799 #include <stdarg.h>
18800 #include <stdio.h>
18801 #ifdef HAVE_LIBUTF8_H
18802 #include <libutf8.h>
18803 #endif
18804 int
18805 main (void)
18806 {
18807 wchar_t state
18808   ;
18809   return 0;
18810 }
18811 _ACEOF
18812 rm -f conftest.$ac_objext
18813 if { (eval echo "$as_me:18813: \"$ac_compile\"") >&5
18814   (eval $ac_compile) 2>&5
18815   ac_status=$?
18816   echo "$as_me:18816: \$? = $ac_status" >&5
18817   (exit $ac_status); } &&
18818          { ac_try='test -s conftest.$ac_objext'
18819   { (eval echo "$as_me:18819: \"$ac_try\"") >&5
18820   (eval $ac_try) 2>&5
18821   ac_status=$?
18822   echo "$as_me:18822: \$? = $ac_status" >&5
18823   (exit $ac_status); }; }; then
18824   cf_cv_wchar_t=no
18825 else
18826   echo "$as_me: failed program was:" >&5
18827 cat conftest.$ac_ext >&5
18828 cat >conftest.$ac_ext <<_ACEOF
18829 #line 18829 "configure"
18830 #include "confdefs.h"
18831
18832 #include <stdlib.h>
18833 #include <stdarg.h>
18834 #include <stdio.h>
18835 #include <wchar.h>
18836 #ifdef HAVE_LIBUTF8_H
18837 #include <libutf8.h>
18838 #endif
18839 int
18840 main (void)
18841 {
18842 wchar_t value
18843   ;
18844   return 0;
18845 }
18846 _ACEOF
18847 rm -f conftest.$ac_objext
18848 if { (eval echo "$as_me:18848: \"$ac_compile\"") >&5
18849   (eval $ac_compile) 2>&5
18850   ac_status=$?
18851   echo "$as_me:18851: \$? = $ac_status" >&5
18852   (exit $ac_status); } &&
18853          { ac_try='test -s conftest.$ac_objext'
18854   { (eval echo "$as_me:18854: \"$ac_try\"") >&5
18855   (eval $ac_try) 2>&5
18856   ac_status=$?
18857   echo "$as_me:18857: \$? = $ac_status" >&5
18858   (exit $ac_status); }; }; then
18859   cf_cv_wchar_t=yes
18860 else
18861   echo "$as_me: failed program was:" >&5
18862 cat conftest.$ac_ext >&5
18863 cf_cv_wchar_t=unknown
18864 fi
18865 rm -f conftest.$ac_objext conftest.$ac_ext
18866 fi
18867 rm -f conftest.$ac_objext conftest.$ac_ext
18868 fi
18869 echo "$as_me:18869: result: $cf_cv_wchar_t" >&5
18870 echo "${ECHO_T}$cf_cv_wchar_t" >&6
18871
18872 if test "$cf_cv_wchar_t" = yes ; then
18873
18874 cat >>confdefs.h <<\EOF
18875 #define NEED_WCHAR_H 1
18876 EOF
18877
18878         NEED_WCHAR_H=1
18879 fi
18880
18881 # if we do not find wchar_t in either place, use substitution to provide a fallback.
18882 if test "$cf_cv_wchar_t" = unknown ; then
18883         NCURSES_WCHAR_T=1
18884 fi
18885
18886 # if we find wchar_t in either place, use substitution to provide a fallback.
18887 if test "$cf_cv_wchar_t" != unknown ; then
18888         NCURSES_OK_WCHAR_T=1
18889 fi
18890
18891 # This is needed on Tru64 5.0 to declare wint_t
18892 echo "$as_me:18892: checking if we must include wchar.h to declare wint_t" >&5
18893 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
18894 if test "${cf_cv_wint_t+set}" = set; then
18895   echo $ECHO_N "(cached) $ECHO_C" >&6
18896 else
18897
18898 cat >conftest.$ac_ext <<_ACEOF
18899 #line 18899 "configure"
18900 #include "confdefs.h"
18901
18902 #include <stdlib.h>
18903 #include <stdarg.h>
18904 #include <stdio.h>
18905 #ifdef HAVE_LIBUTF8_H
18906 #include <libutf8.h>
18907 #endif
18908 int
18909 main (void)
18910 {
18911 wint_t state
18912   ;
18913   return 0;
18914 }
18915 _ACEOF
18916 rm -f conftest.$ac_objext
18917 if { (eval echo "$as_me:18917: \"$ac_compile\"") >&5
18918   (eval $ac_compile) 2>&5
18919   ac_status=$?
18920   echo "$as_me:18920: \$? = $ac_status" >&5
18921   (exit $ac_status); } &&
18922          { ac_try='test -s conftest.$ac_objext'
18923   { (eval echo "$as_me:18923: \"$ac_try\"") >&5
18924   (eval $ac_try) 2>&5
18925   ac_status=$?
18926   echo "$as_me:18926: \$? = $ac_status" >&5
18927   (exit $ac_status); }; }; then
18928   cf_cv_wint_t=no
18929 else
18930   echo "$as_me: failed program was:" >&5
18931 cat conftest.$ac_ext >&5
18932 cat >conftest.$ac_ext <<_ACEOF
18933 #line 18933 "configure"
18934 #include "confdefs.h"
18935
18936 #include <stdlib.h>
18937 #include <stdarg.h>
18938 #include <stdio.h>
18939 #include <wchar.h>
18940 #ifdef HAVE_LIBUTF8_H
18941 #include <libutf8.h>
18942 #endif
18943 int
18944 main (void)
18945 {
18946 wint_t value
18947   ;
18948   return 0;
18949 }
18950 _ACEOF
18951 rm -f conftest.$ac_objext
18952 if { (eval echo "$as_me:18952: \"$ac_compile\"") >&5
18953   (eval $ac_compile) 2>&5
18954   ac_status=$?
18955   echo "$as_me:18955: \$? = $ac_status" >&5
18956   (exit $ac_status); } &&
18957          { ac_try='test -s conftest.$ac_objext'
18958   { (eval echo "$as_me:18958: \"$ac_try\"") >&5
18959   (eval $ac_try) 2>&5
18960   ac_status=$?
18961   echo "$as_me:18961: \$? = $ac_status" >&5
18962   (exit $ac_status); }; }; then
18963   cf_cv_wint_t=yes
18964 else
18965   echo "$as_me: failed program was:" >&5
18966 cat conftest.$ac_ext >&5
18967 cf_cv_wint_t=unknown
18968 fi
18969 rm -f conftest.$ac_objext conftest.$ac_ext
18970 fi
18971 rm -f conftest.$ac_objext conftest.$ac_ext
18972 fi
18973 echo "$as_me:18973: result: $cf_cv_wint_t" >&5
18974 echo "${ECHO_T}$cf_cv_wint_t" >&6
18975
18976 if test "$cf_cv_wint_t" = yes ; then
18977
18978 cat >>confdefs.h <<\EOF
18979 #define NEED_WCHAR_H 1
18980 EOF
18981
18982         NEED_WCHAR_H=1
18983 fi
18984
18985 # if we do not find wint_t in either place, use substitution to provide a fallback.
18986 if test "$cf_cv_wint_t" = unknown ; then
18987         NCURSES_WINT_T=1
18988 fi
18989
18990 # if we find wint_t in either place, use substitution to provide a fallback.
18991 if test "$cf_cv_wint_t" != unknown ; then
18992         NCURSES_OK_WINT_T=1
18993 fi
18994
18995         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
18996
18997 echo "$as_me:18997: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18998 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18999 cat >conftest.$ac_ext <<_ACEOF
19000 #line 19000 "configure"
19001 #include "confdefs.h"
19002
19003 #ifndef _XOPEN_SOURCE_EXTENDED
19004 #define _XOPEN_SOURCE_EXTENDED
19005 #endif
19006 #include <${cf_cv_ncurses_header:-curses.h}>
19007 int
19008 main (void)
19009 {
19010
19011 mbstate_t foo
19012
19013   ;
19014   return 0;
19015 }
19016 _ACEOF
19017 rm -f conftest.$ac_objext
19018 if { (eval echo "$as_me:19018: \"$ac_compile\"") >&5
19019   (eval $ac_compile) 2>&5
19020   ac_status=$?
19021   echo "$as_me:19021: \$? = $ac_status" >&5
19022   (exit $ac_status); } &&
19023          { ac_try='test -s conftest.$ac_objext'
19024   { (eval echo "$as_me:19024: \"$ac_try\"") >&5
19025   (eval $ac_try) 2>&5
19026   ac_status=$?
19027   echo "$as_me:19027: \$? = $ac_status" >&5
19028   (exit $ac_status); }; }; then
19029   cf_result=yes
19030 else
19031   echo "$as_me: failed program was:" >&5
19032 cat conftest.$ac_ext >&5
19033 cf_result=no
19034 fi
19035 rm -f conftest.$ac_objext conftest.$ac_ext
19036 echo "$as_me:19036: result: $cf_result" >&5
19037 echo "${ECHO_T}$cf_result" >&6
19038 if test $cf_result = yes ; then
19039
19040 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19041
19042 cat >>confdefs.h <<EOF
19043 #define $cf_result 1
19044 EOF
19045
19046 else
19047
19048 cat >>confdefs.h <<EOF
19049 #define mbstate_t long
19050 EOF
19051
19052 fi
19053
19054         fi
19055
19056         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19057
19058 echo "$as_me:19058: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19059 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19060 cat >conftest.$ac_ext <<_ACEOF
19061 #line 19061 "configure"
19062 #include "confdefs.h"
19063
19064 #ifndef _XOPEN_SOURCE_EXTENDED
19065 #define _XOPEN_SOURCE_EXTENDED
19066 #endif
19067 #include <${cf_cv_ncurses_header:-curses.h}>
19068 int
19069 main (void)
19070 {
19071
19072 wchar_t foo
19073
19074   ;
19075   return 0;
19076 }
19077 _ACEOF
19078 rm -f conftest.$ac_objext
19079 if { (eval echo "$as_me:19079: \"$ac_compile\"") >&5
19080   (eval $ac_compile) 2>&5
19081   ac_status=$?
19082   echo "$as_me:19082: \$? = $ac_status" >&5
19083   (exit $ac_status); } &&
19084          { ac_try='test -s conftest.$ac_objext'
19085   { (eval echo "$as_me:19085: \"$ac_try\"") >&5
19086   (eval $ac_try) 2>&5
19087   ac_status=$?
19088   echo "$as_me:19088: \$? = $ac_status" >&5
19089   (exit $ac_status); }; }; then
19090   cf_result=yes
19091 else
19092   echo "$as_me: failed program was:" >&5
19093 cat conftest.$ac_ext >&5
19094 cf_result=no
19095 fi
19096 rm -f conftest.$ac_objext conftest.$ac_ext
19097 echo "$as_me:19097: result: $cf_result" >&5
19098 echo "${ECHO_T}$cf_result" >&6
19099 if test $cf_result = yes ; then
19100
19101 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19102
19103 cat >>confdefs.h <<EOF
19104 #define $cf_result 1
19105 EOF
19106
19107 else
19108
19109 cat >>confdefs.h <<EOF
19110 #define wchar_t long
19111 EOF
19112
19113 fi
19114
19115         fi
19116
19117         if test "$NCURSES_OK_WINT_T" = 0 ; then
19118
19119 echo "$as_me:19119: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19120 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19121 cat >conftest.$ac_ext <<_ACEOF
19122 #line 19122 "configure"
19123 #include "confdefs.h"
19124
19125 #ifndef _XOPEN_SOURCE_EXTENDED
19126 #define _XOPEN_SOURCE_EXTENDED
19127 #endif
19128 #include <${cf_cv_ncurses_header:-curses.h}>
19129 int
19130 main (void)
19131 {
19132
19133 wint_t foo
19134
19135   ;
19136   return 0;
19137 }
19138 _ACEOF
19139 rm -f conftest.$ac_objext
19140 if { (eval echo "$as_me:19140: \"$ac_compile\"") >&5
19141   (eval $ac_compile) 2>&5
19142   ac_status=$?
19143   echo "$as_me:19143: \$? = $ac_status" >&5
19144   (exit $ac_status); } &&
19145          { ac_try='test -s conftest.$ac_objext'
19146   { (eval echo "$as_me:19146: \"$ac_try\"") >&5
19147   (eval $ac_try) 2>&5
19148   ac_status=$?
19149   echo "$as_me:19149: \$? = $ac_status" >&5
19150   (exit $ac_status); }; }; then
19151   cf_result=yes
19152 else
19153   echo "$as_me: failed program was:" >&5
19154 cat conftest.$ac_ext >&5
19155 cf_result=no
19156 fi
19157 rm -f conftest.$ac_objext conftest.$ac_ext
19158 echo "$as_me:19158: result: $cf_result" >&5
19159 echo "${ECHO_T}$cf_result" >&6
19160 if test $cf_result = yes ; then
19161
19162 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19163
19164 cat >>confdefs.h <<EOF
19165 #define $cf_result 1
19166 EOF
19167
19168 else
19169
19170 cat >>confdefs.h <<EOF
19171 #define wint_t long
19172 EOF
19173
19174 fi
19175
19176         fi
19177 fi
19178
19179 for cf_data in \
19180 TABSIZE \
19181 curscr \
19182 ospeed \
19183 boolnames \
19184 boolfnames \
19185 ttytype
19186 do
19187 echo "$as_me:19187: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19188 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19189
19190 cat >conftest.$ac_ext <<_ACEOF
19191 #line 19191 "configure"
19192 #include "confdefs.h"
19193
19194 #ifdef HAVE_XCURSES
19195 #include <xcurses.h>
19196 char * XCursesProgramName = "test";
19197 #else
19198 #include <${cf_cv_ncurses_header:-curses.h}>
19199 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19200 #include <ncursesw/term.h>
19201 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19202 #include <ncurses/term.h>
19203 #elif defined(HAVE_TERM_H)
19204 #include <term.h>
19205 #endif
19206 #endif
19207
19208 int
19209 main (void)
19210 {
19211
19212 void *foo = &($cf_data)
19213
19214   ;
19215   return 0;
19216 }
19217 _ACEOF
19218 rm -f conftest.$ac_objext
19219 if { (eval echo "$as_me:19219: \"$ac_compile\"") >&5
19220   (eval $ac_compile) 2>&5
19221   ac_status=$?
19222   echo "$as_me:19222: \$? = $ac_status" >&5
19223   (exit $ac_status); } &&
19224          { ac_try='test -s conftest.$ac_objext'
19225   { (eval echo "$as_me:19225: \"$ac_try\"") >&5
19226   (eval $ac_try) 2>&5
19227   ac_status=$?
19228   echo "$as_me:19228: \$? = $ac_status" >&5
19229   (exit $ac_status); }; }; then
19230   cf_result=yes
19231
19232 else
19233   echo "$as_me: failed program was:" >&5
19234 cat conftest.$ac_ext >&5
19235 cf_result=no
19236 fi
19237 rm -f conftest.$ac_objext conftest.$ac_ext
19238 echo "$as_me:19238: result: $cf_result" >&5
19239 echo "${ECHO_T}$cf_result" >&6
19240
19241 if test $cf_result = yes ; then
19242
19243 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19244
19245         cat >>confdefs.h <<EOF
19246 #define $cf_result 1
19247 EOF
19248
19249 else
19250         echo "$as_me:19250: checking for data $cf_data in library" >&5
19251 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19252         # BSD linkers insist on making weak linkage, but resolve at runtime.
19253         if test "$cross_compiling" = yes; then
19254
19255         # cross-compiling
19256         cat >conftest.$ac_ext <<_ACEOF
19257 #line 19257 "configure"
19258 #include "confdefs.h"
19259
19260 #ifdef HAVE_XCURSES
19261 #include <xcurses.h>
19262 char * XCursesProgramName = "test";
19263 #else
19264 #include <${cf_cv_ncurses_header:-curses.h}>
19265 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19266 #include <ncursesw/term.h>
19267 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19268 #include <ncurses/term.h>
19269 #elif defined(HAVE_TERM_H)
19270 #include <term.h>
19271 #endif
19272 #endif
19273
19274 extern char $cf_data;
19275 int
19276 main (void)
19277 {
19278
19279         do {
19280                 void *foo = &($cf_data);
19281                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19282                 ${cf_cv_main_return:-return}(foo == 0);
19283         } while (0)
19284
19285   ;
19286   return 0;
19287 }
19288 _ACEOF
19289 rm -f conftest.$ac_objext conftest$ac_exeext
19290 if { (eval echo "$as_me:19290: \"$ac_link\"") >&5
19291   (eval $ac_link) 2>&5
19292   ac_status=$?
19293   echo "$as_me:19293: \$? = $ac_status" >&5
19294   (exit $ac_status); } &&
19295          { ac_try='test -s conftest$ac_exeext'
19296   { (eval echo "$as_me:19296: \"$ac_try\"") >&5
19297   (eval $ac_try) 2>&5
19298   ac_status=$?
19299   echo "$as_me:19299: \$? = $ac_status" >&5
19300   (exit $ac_status); }; }; then
19301   cf_result=yes
19302 else
19303   echo "$as_me: failed program was:" >&5
19304 cat conftest.$ac_ext >&5
19305 cf_result=no
19306 fi
19307 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19308
19309 else
19310   cat >conftest.$ac_ext <<_ACEOF
19311 #line 19311 "configure"
19312 #include "confdefs.h"
19313
19314 #ifdef HAVE_XCURSES
19315 #include <xcurses.h>
19316 char * XCursesProgramName = "test";
19317 #else
19318 #include <${cf_cv_ncurses_header:-curses.h}>
19319 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19320 #include <ncursesw/term.h>
19321 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19322 #include <ncurses/term.h>
19323 #elif defined(HAVE_TERM_H)
19324 #include <term.h>
19325 #endif
19326 #endif
19327
19328 extern char $cf_data;
19329 int main(void)
19330 {
19331         void *foo = &($cf_data);
19332         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19333         ${cf_cv_main_return:-return}(foo == 0);
19334 }
19335 _ACEOF
19336 rm -f conftest$ac_exeext
19337 if { (eval echo "$as_me:19337: \"$ac_link\"") >&5
19338   (eval $ac_link) 2>&5
19339   ac_status=$?
19340   echo "$as_me:19340: \$? = $ac_status" >&5
19341   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19342   { (eval echo "$as_me:19342: \"$ac_try\"") >&5
19343   (eval $ac_try) 2>&5
19344   ac_status=$?
19345   echo "$as_me:19345: \$? = $ac_status" >&5
19346   (exit $ac_status); }; }; then
19347   cf_result=yes
19348
19349 else
19350   echo "$as_me: program exited with status $ac_status" >&5
19351 echo "$as_me: failed program was:" >&5
19352 cat conftest.$ac_ext >&5
19353 cf_result=no
19354 fi
19355 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19356 fi
19357         echo "$as_me:19357: result: $cf_result" >&5
19358 echo "${ECHO_T}$cf_result" >&6
19359         if test $cf_result = yes ; then
19360
19361 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19362
19363                 cat >>confdefs.h <<EOF
19364 #define $cf_result 1
19365 EOF
19366
19367                 # do not exit loop here, since we prefer system's declarations
19368         fi
19369 fi
19370 done
19371
19372 if ( test "$GCC" = yes || test "$GXX" = yes )
19373 then
19374 echo "$as_me:19374: checking if you want to turn on gcc warnings" >&5
19375 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
19376
19377 # Check whether --enable-warnings or --disable-warnings was given.
19378 if test "${enable_warnings+set}" = set; then
19379   enableval="$enable_warnings"
19380   test "$enableval" != yes && enableval=no
19381         if test "$enableval" != "no" ; then
19382     with_warnings=yes
19383         else
19384                 with_warnings=no
19385         fi
19386 else
19387   enableval=no
19388         with_warnings=no
19389
19390 fi;
19391 echo "$as_me:19391: result: $with_warnings" >&5
19392 echo "${ECHO_T}$with_warnings" >&6
19393 if test "$with_warnings" = "yes"
19394 then
19395
19396 if test "$GCC" = yes
19397 then
19398 cat > conftest.i <<EOF
19399 #ifndef GCC_PRINTF
19400 #define GCC_PRINTF 0
19401 #endif
19402 #ifndef GCC_SCANF
19403 #define GCC_SCANF 0
19404 #endif
19405 #ifndef GCC_NORETURN
19406 #define GCC_NORETURN /* nothing */
19407 #endif
19408 #ifndef GCC_UNUSED
19409 #define GCC_UNUSED /* nothing */
19410 #endif
19411 EOF
19412 if test "$GCC" = yes
19413 then
19414         { echo "$as_me:19414: checking for $CC __attribute__ directives..." >&5
19415 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
19416 cat > conftest.$ac_ext <<EOF
19417 #line 19417 "${as_me:-configure}"
19418 #include "confdefs.h"
19419 #include "conftest.h"
19420 #include "conftest.i"
19421 #if     GCC_PRINTF
19422 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
19423 #else
19424 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
19425 #endif
19426 #if     GCC_SCANF
19427 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
19428 #else
19429 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
19430 #endif
19431 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
19432 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
19433 extern void foo(void) GCC_NORETURN;
19434 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
19435 EOF
19436         cf_printf_attribute=no
19437         cf_scanf_attribute=no
19438         for cf_attribute in scanf printf unused noreturn
19439         do
19440
19441 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19442
19443                 cf_directive="__attribute__(($cf_attribute))"
19444                 echo "checking for $CC $cf_directive" 1>&5
19445
19446                 case $cf_attribute in
19447                 (printf)
19448                         cf_printf_attribute=yes
19449                         cat >conftest.h <<EOF
19450 #define GCC_$cf_ATTRIBUTE 1
19451 EOF
19452                         ;;
19453                 (scanf)
19454                         cf_scanf_attribute=yes
19455                         cat >conftest.h <<EOF
19456 #define GCC_$cf_ATTRIBUTE 1
19457 EOF
19458                         ;;
19459                 (*)
19460                         cat >conftest.h <<EOF
19461 #define GCC_$cf_ATTRIBUTE $cf_directive
19462 EOF
19463                         ;;
19464                 esac
19465
19466                 if { (eval echo "$as_me:19466: \"$ac_compile\"") >&5
19467   (eval $ac_compile) 2>&5
19468   ac_status=$?
19469   echo "$as_me:19469: \$? = $ac_status" >&5
19470   (exit $ac_status); }; then
19471                         test -n "$verbose" && echo "$as_me:19471: result: ... $cf_attribute" >&5
19472 echo "${ECHO_T}... $cf_attribute" >&6
19473                         cat conftest.h >>confdefs.h
19474                         case $cf_attribute in
19475                         (noreturn)
19476
19477 cat >>confdefs.h <<EOF
19478 #define GCC_NORETURN $cf_directive
19479 EOF
19480
19481                                 ;;
19482                         (printf)
19483                                 cf_value='/* nothing */'
19484                                 if test "$cf_printf_attribute" != no ; then
19485                                         cf_value='__attribute__((format(printf,fmt,var)))'
19486
19487 cat >>confdefs.h <<\EOF
19488 #define GCC_PRINTF 1
19489 EOF
19490
19491                                 fi
19492
19493 cat >>confdefs.h <<EOF
19494 #define GCC_PRINTFLIKE(fmt,var) $cf_value
19495 EOF
19496
19497                                 ;;
19498                         (scanf)
19499                                 cf_value='/* nothing */'
19500                                 if test "$cf_scanf_attribute" != no ; then
19501                                         cf_value='__attribute__((format(scanf,fmt,var)))'
19502
19503 cat >>confdefs.h <<\EOF
19504 #define GCC_SCANF 1
19505 EOF
19506
19507                                 fi
19508
19509 cat >>confdefs.h <<EOF
19510 #define GCC_SCANFLIKE(fmt,var) $cf_value
19511 EOF
19512
19513                                 ;;
19514                         (unused)
19515
19516 cat >>confdefs.h <<EOF
19517 #define GCC_UNUSED $cf_directive
19518 EOF
19519
19520                                 ;;
19521                         esac
19522                 fi
19523         done
19524 else
19525         fgrep define conftest.i >>confdefs.h
19526 fi
19527 rm -rf conftest*
19528 fi
19529
19530 INTEL_COMPILER=no
19531
19532 if test "$GCC" = yes ; then
19533         case $host_os in
19534         (linux*|gnu*)
19535                 echo "$as_me:19535: checking if this is really Intel C compiler" >&5
19536 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
19537                 cf_save_CFLAGS="$CFLAGS"
19538                 CFLAGS="$CFLAGS -no-gcc"
19539                 cat >conftest.$ac_ext <<_ACEOF
19540 #line 19540 "configure"
19541 #include "confdefs.h"
19542
19543 int
19544 main (void)
19545 {
19546
19547 #ifdef __INTEL_COMPILER
19548 #else
19549 make an error
19550 #endif
19551
19552   ;
19553   return 0;
19554 }
19555 _ACEOF
19556 rm -f conftest.$ac_objext
19557 if { (eval echo "$as_me:19557: \"$ac_compile\"") >&5
19558   (eval $ac_compile) 2>&5
19559   ac_status=$?
19560   echo "$as_me:19560: \$? = $ac_status" >&5
19561   (exit $ac_status); } &&
19562          { ac_try='test -s conftest.$ac_objext'
19563   { (eval echo "$as_me:19563: \"$ac_try\"") >&5
19564   (eval $ac_try) 2>&5
19565   ac_status=$?
19566   echo "$as_me:19566: \$? = $ac_status" >&5
19567   (exit $ac_status); }; }; then
19568   INTEL_COMPILER=yes
19569 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
19570
19571 else
19572   echo "$as_me: failed program was:" >&5
19573 cat conftest.$ac_ext >&5
19574 fi
19575 rm -f conftest.$ac_objext conftest.$ac_ext
19576                 CFLAGS="$cf_save_CFLAGS"
19577                 echo "$as_me:19577: result: $INTEL_COMPILER" >&5
19578 echo "${ECHO_T}$INTEL_COMPILER" >&6
19579                 ;;
19580         esac
19581 fi
19582
19583 CLANG_COMPILER=no
19584
19585 if test "$GCC" = yes ; then
19586         echo "$as_me:19586: checking if this is really Clang C compiler" >&5
19587 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
19588         cf_save_CFLAGS="$CFLAGS"
19589         CFLAGS="$CFLAGS -Qunused-arguments"
19590         cat >conftest.$ac_ext <<_ACEOF
19591 #line 19591 "configure"
19592 #include "confdefs.h"
19593
19594 int
19595 main (void)
19596 {
19597
19598 #ifdef __clang__
19599 #else
19600 make an error
19601 #endif
19602
19603   ;
19604   return 0;
19605 }
19606 _ACEOF
19607 rm -f conftest.$ac_objext
19608 if { (eval echo "$as_me:19608: \"$ac_compile\"") >&5
19609   (eval $ac_compile) 2>&5
19610   ac_status=$?
19611   echo "$as_me:19611: \$? = $ac_status" >&5
19612   (exit $ac_status); } &&
19613          { ac_try='test -s conftest.$ac_objext'
19614   { (eval echo "$as_me:19614: \"$ac_try\"") >&5
19615   (eval $ac_try) 2>&5
19616   ac_status=$?
19617   echo "$as_me:19617: \$? = $ac_status" >&5
19618   (exit $ac_status); }; }; then
19619   CLANG_COMPILER=yes
19620 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
19621
19622 else
19623   echo "$as_me: failed program was:" >&5
19624 cat conftest.$ac_ext >&5
19625 fi
19626 rm -f conftest.$ac_objext conftest.$ac_ext
19627         CFLAGS="$cf_save_CFLAGS"
19628         echo "$as_me:19628: result: $CLANG_COMPILER" >&5
19629 echo "${ECHO_T}$CLANG_COMPILER" >&6
19630 fi
19631
19632 cat > conftest.$ac_ext <<EOF
19633 #line 19633 "${as_me:-configure}"
19634 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
19635 EOF
19636
19637 if test "$INTEL_COMPILER" = yes
19638 then
19639 # The "-wdXXX" options suppress warnings:
19640 # remark #1419: external declaration in primary source file
19641 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
19642 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
19643 # remark #193: zero used for undefined preprocessing identifier
19644 # remark #593: variable "curs_sb_left_arrow" was set but never used
19645 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
19646 # remark #869: parameter "tw" was never referenced
19647 # remark #981: operands are evaluated in unspecified order
19648 # warning #279: controlling expression is constant
19649
19650         { echo "$as_me:19650: checking for $CC warning options..." >&5
19651 echo "$as_me: checking for $CC warning options..." >&6;}
19652         cf_save_CFLAGS="$CFLAGS"
19653         EXTRA_CFLAGS="-Wall"
19654         for cf_opt in \
19655                 wd1419 \
19656                 wd1683 \
19657                 wd1684 \
19658                 wd193 \
19659                 wd593 \
19660                 wd279 \
19661                 wd810 \
19662                 wd869 \
19663                 wd981
19664         do
19665                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19666                 if { (eval echo "$as_me:19666: \"$ac_compile\"") >&5
19667   (eval $ac_compile) 2>&5
19668   ac_status=$?
19669   echo "$as_me:19669: \$? = $ac_status" >&5
19670   (exit $ac_status); }; then
19671                         test -n "$verbose" && echo "$as_me:19671: result: ... -$cf_opt" >&5
19672 echo "${ECHO_T}... -$cf_opt" >&6
19673                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19674                 fi
19675         done
19676         CFLAGS="$cf_save_CFLAGS"
19677
19678 elif test "$GCC" = yes
19679 then
19680         { echo "$as_me:19680: checking for $CC warning options..." >&5
19681 echo "$as_me: checking for $CC warning options..." >&6;}
19682         cf_save_CFLAGS="$CFLAGS"
19683         EXTRA_CFLAGS=
19684         cf_warn_CONST=""
19685         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
19686         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
19687         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
19688         for cf_opt in W Wall \
19689                 Wbad-function-cast \
19690                 Wcast-align \
19691                 Wcast-qual \
19692                 Wdeclaration-after-statement \
19693                 Wextra \
19694                 Winline \
19695                 Wmissing-declarations \
19696                 Wmissing-prototypes \
19697                 Wnested-externs \
19698                 Wpointer-arith \
19699                 Wshadow \
19700                 Wstrict-prototypes \
19701                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
19702         do
19703                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19704                 if { (eval echo "$as_me:19704: \"$ac_compile\"") >&5
19705   (eval $ac_compile) 2>&5
19706   ac_status=$?
19707   echo "$as_me:19707: \$? = $ac_status" >&5
19708   (exit $ac_status); }; then
19709                         test -n "$verbose" && echo "$as_me:19709: result: ... -$cf_opt" >&5
19710 echo "${ECHO_T}... -$cf_opt" >&6
19711                         case $cf_opt in
19712                         (Wcast-qual)
19713
19714         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19715         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
19716
19717                                 ;;
19718                         (Winline)
19719                                 case $GCC_VERSION in
19720                                 ([34].*)
19721                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19722
19723 echo "${as_me:-configure}:19723: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19724
19725                                         continue;;
19726                                 esac
19727                                 ;;
19728                         (Wpointer-arith)
19729                                 case $GCC_VERSION in
19730                                 ([12].*)
19731                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19732
19733 echo "${as_me:-configure}:19733: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19734
19735                                         continue;;
19736                                 esac
19737                                 ;;
19738                         esac
19739                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19740                 fi
19741         done
19742         CFLAGS="$cf_save_CFLAGS"
19743 fi
19744 rm -rf conftest*
19745
19746 fi
19747 fi
19748
19749 echo "$as_me:19749: checking if you want to use dmalloc for testing" >&5
19750 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
19751
19752 # Check whether --with-dmalloc or --without-dmalloc was given.
19753 if test "${with_dmalloc+set}" = set; then
19754   withval="$with_dmalloc"
19755
19756 cat >>confdefs.h <<EOF
19757 #define USE_DMALLOC 1
19758 EOF
19759
19760         : ${with_cflags:=-g}
19761         : ${with_no_leaks:=yes}
19762          with_dmalloc=yes
19763 else
19764   with_dmalloc=
19765 fi;
19766 echo "$as_me:19766: result: ${with_dmalloc:-no}" >&5
19767 echo "${ECHO_T}${with_dmalloc:-no}" >&6
19768
19769 case .$with_cflags in
19770 (.*-g*)
19771         case .$CFLAGS in
19772         (.*-g*)
19773                 ;;
19774         (*)
19775
19776 cf_fix_cppflags=no
19777 cf_new_cflags=
19778 cf_new_cppflags=
19779 cf_new_extra_cppflags=
19780
19781 for cf_add_cflags in -g
19782 do
19783 case $cf_fix_cppflags in
19784 (no)
19785         case $cf_add_cflags in
19786         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19787                 case $cf_add_cflags in
19788                 (-D*)
19789                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19790
19791                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19792                                 && test -z "${cf_tst_cflags}" \
19793                                 && cf_fix_cppflags=yes
19794
19795                         if test $cf_fix_cppflags = yes ; then
19796
19797         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19798         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19799
19800                                 continue
19801                         elif test "${cf_tst_cflags}" = "\"'" ; then
19802
19803         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19804         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19805
19806                                 continue
19807                         fi
19808                         ;;
19809                 esac
19810                 case "$CPPFLAGS" in
19811                 (*$cf_add_cflags)
19812                         ;;
19813                 (*)
19814                         case $cf_add_cflags in
19815                         (-D*)
19816                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19817
19818 CPPFLAGS=`echo "$CPPFLAGS" | \
19819         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19820                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19821
19822                                 ;;
19823                         esac
19824
19825         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19826         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19827
19828                         ;;
19829                 esac
19830                 ;;
19831         (*)
19832
19833         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19834         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19835
19836                 ;;
19837         esac
19838         ;;
19839 (yes)
19840
19841         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19842         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19843
19844         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19845
19846         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19847                 && test -z "${cf_tst_cflags}" \
19848                 && cf_fix_cppflags=no
19849         ;;
19850 esac
19851 done
19852
19853 if test -n "$cf_new_cflags" ; then
19854
19855         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19856         CFLAGS="${CFLAGS}$cf_new_cflags"
19857
19858 fi
19859
19860 if test -n "$cf_new_cppflags" ; then
19861
19862         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19863         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19864
19865 fi
19866
19867 if test -n "$cf_new_extra_cppflags" ; then
19868
19869         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19870         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19871
19872 fi
19873
19874                 ;;
19875         esac
19876         ;;
19877 esac
19878
19879 if test "$with_dmalloc" = yes ; then
19880         echo "$as_me:19880: checking for dmalloc.h" >&5
19881 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
19882 if test "${ac_cv_header_dmalloc_h+set}" = set; then
19883   echo $ECHO_N "(cached) $ECHO_C" >&6
19884 else
19885   cat >conftest.$ac_ext <<_ACEOF
19886 #line 19886 "configure"
19887 #include "confdefs.h"
19888 #include <dmalloc.h>
19889 _ACEOF
19890 if { (eval echo "$as_me:19890: \"$ac_cpp conftest.$ac_ext\"") >&5
19891   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19892   ac_status=$?
19893   egrep -v '^ *\+' conftest.er1 >conftest.err
19894   rm -f conftest.er1
19895   cat conftest.err >&5
19896   echo "$as_me:19896: \$? = $ac_status" >&5
19897   (exit $ac_status); } >/dev/null; then
19898   if test -s conftest.err; then
19899     ac_cpp_err=$ac_c_preproc_warn_flag
19900   else
19901     ac_cpp_err=
19902   fi
19903 else
19904   ac_cpp_err=yes
19905 fi
19906 if test -z "$ac_cpp_err"; then
19907   ac_cv_header_dmalloc_h=yes
19908 else
19909   echo "$as_me: failed program was:" >&5
19910   cat conftest.$ac_ext >&5
19911   ac_cv_header_dmalloc_h=no
19912 fi
19913 rm -f conftest.err conftest.$ac_ext
19914 fi
19915 echo "$as_me:19915: result: $ac_cv_header_dmalloc_h" >&5
19916 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
19917 if test $ac_cv_header_dmalloc_h = yes; then
19918
19919 echo "$as_me:19919: checking for dmalloc_debug in -ldmalloc" >&5
19920 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
19921 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
19922   echo $ECHO_N "(cached) $ECHO_C" >&6
19923 else
19924   ac_check_lib_save_LIBS=$LIBS
19925 LIBS="-ldmalloc  $LIBS"
19926 cat >conftest.$ac_ext <<_ACEOF
19927 #line 19927 "configure"
19928 #include "confdefs.h"
19929
19930 /* Override any gcc2 internal prototype to avoid an error.  */
19931 #ifdef __cplusplus
19932 extern "C"
19933 #endif
19934 /* We use char because int might match the return type of a gcc2
19935    builtin and then its argument prototype would still apply.  */
19936 char dmalloc_debug ();
19937 int
19938 main (void)
19939 {
19940 dmalloc_debug ();
19941   ;
19942   return 0;
19943 }
19944 _ACEOF
19945 rm -f conftest.$ac_objext conftest$ac_exeext
19946 if { (eval echo "$as_me:19946: \"$ac_link\"") >&5
19947   (eval $ac_link) 2>&5
19948   ac_status=$?
19949   echo "$as_me:19949: \$? = $ac_status" >&5
19950   (exit $ac_status); } &&
19951          { ac_try='test -s conftest$ac_exeext'
19952   { (eval echo "$as_me:19952: \"$ac_try\"") >&5
19953   (eval $ac_try) 2>&5
19954   ac_status=$?
19955   echo "$as_me:19955: \$? = $ac_status" >&5
19956   (exit $ac_status); }; }; then
19957   ac_cv_lib_dmalloc_dmalloc_debug=yes
19958 else
19959   echo "$as_me: failed program was:" >&5
19960 cat conftest.$ac_ext >&5
19961 ac_cv_lib_dmalloc_dmalloc_debug=no
19962 fi
19963 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19964 LIBS=$ac_check_lib_save_LIBS
19965 fi
19966 echo "$as_me:19966: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
19967 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
19968 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
19969   cat >>confdefs.h <<EOF
19970 #define HAVE_LIBDMALLOC 1
19971 EOF
19972
19973   LIBS="-ldmalloc $LIBS"
19974
19975 fi
19976
19977 fi
19978
19979 fi
19980
19981 echo "$as_me:19981: checking if you want to use dbmalloc for testing" >&5
19982 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
19983
19984 # Check whether --with-dbmalloc or --without-dbmalloc was given.
19985 if test "${with_dbmalloc+set}" = set; then
19986   withval="$with_dbmalloc"
19987
19988 cat >>confdefs.h <<EOF
19989 #define USE_DBMALLOC 1
19990 EOF
19991
19992         : ${with_cflags:=-g}
19993         : ${with_no_leaks:=yes}
19994          with_dbmalloc=yes
19995 else
19996   with_dbmalloc=
19997 fi;
19998 echo "$as_me:19998: result: ${with_dbmalloc:-no}" >&5
19999 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
20000
20001 case .$with_cflags in
20002 (.*-g*)
20003         case .$CFLAGS in
20004         (.*-g*)
20005                 ;;
20006         (*)
20007
20008 cf_fix_cppflags=no
20009 cf_new_cflags=
20010 cf_new_cppflags=
20011 cf_new_extra_cppflags=
20012
20013 for cf_add_cflags in -g
20014 do
20015 case $cf_fix_cppflags in
20016 (no)
20017         case $cf_add_cflags in
20018         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20019                 case $cf_add_cflags in
20020                 (-D*)
20021                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20022
20023                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20024                                 && test -z "${cf_tst_cflags}" \
20025                                 && cf_fix_cppflags=yes
20026
20027                         if test $cf_fix_cppflags = yes ; then
20028
20029         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20030         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20031
20032                                 continue
20033                         elif test "${cf_tst_cflags}" = "\"'" ; then
20034
20035         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20036         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20037
20038                                 continue
20039                         fi
20040                         ;;
20041                 esac
20042                 case "$CPPFLAGS" in
20043                 (*$cf_add_cflags)
20044                         ;;
20045                 (*)
20046                         case $cf_add_cflags in
20047                         (-D*)
20048                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20049
20050 CPPFLAGS=`echo "$CPPFLAGS" | \
20051         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20052                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20053
20054                                 ;;
20055                         esac
20056
20057         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20058         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20059
20060                         ;;
20061                 esac
20062                 ;;
20063         (*)
20064
20065         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20066         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20067
20068                 ;;
20069         esac
20070         ;;
20071 (yes)
20072
20073         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20074         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20075
20076         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20077
20078         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20079                 && test -z "${cf_tst_cflags}" \
20080                 && cf_fix_cppflags=no
20081         ;;
20082 esac
20083 done
20084
20085 if test -n "$cf_new_cflags" ; then
20086
20087         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20088         CFLAGS="${CFLAGS}$cf_new_cflags"
20089
20090 fi
20091
20092 if test -n "$cf_new_cppflags" ; then
20093
20094         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20095         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20096
20097 fi
20098
20099 if test -n "$cf_new_extra_cppflags" ; then
20100
20101         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20102         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20103
20104 fi
20105
20106                 ;;
20107         esac
20108         ;;
20109 esac
20110
20111 if test "$with_dbmalloc" = yes ; then
20112         echo "$as_me:20112: checking for dbmalloc.h" >&5
20113 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
20114 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
20115   echo $ECHO_N "(cached) $ECHO_C" >&6
20116 else
20117   cat >conftest.$ac_ext <<_ACEOF
20118 #line 20118 "configure"
20119 #include "confdefs.h"
20120 #include <dbmalloc.h>
20121 _ACEOF
20122 if { (eval echo "$as_me:20122: \"$ac_cpp conftest.$ac_ext\"") >&5
20123   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20124   ac_status=$?
20125   egrep -v '^ *\+' conftest.er1 >conftest.err
20126   rm -f conftest.er1
20127   cat conftest.err >&5
20128   echo "$as_me:20128: \$? = $ac_status" >&5
20129   (exit $ac_status); } >/dev/null; then
20130   if test -s conftest.err; then
20131     ac_cpp_err=$ac_c_preproc_warn_flag
20132   else
20133     ac_cpp_err=
20134   fi
20135 else
20136   ac_cpp_err=yes
20137 fi
20138 if test -z "$ac_cpp_err"; then
20139   ac_cv_header_dbmalloc_h=yes
20140 else
20141   echo "$as_me: failed program was:" >&5
20142   cat conftest.$ac_ext >&5
20143   ac_cv_header_dbmalloc_h=no
20144 fi
20145 rm -f conftest.err conftest.$ac_ext
20146 fi
20147 echo "$as_me:20147: result: $ac_cv_header_dbmalloc_h" >&5
20148 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
20149 if test $ac_cv_header_dbmalloc_h = yes; then
20150
20151 echo "$as_me:20151: checking for debug_malloc in -ldbmalloc" >&5
20152 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
20153 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
20154   echo $ECHO_N "(cached) $ECHO_C" >&6
20155 else
20156   ac_check_lib_save_LIBS=$LIBS
20157 LIBS="-ldbmalloc  $LIBS"
20158 cat >conftest.$ac_ext <<_ACEOF
20159 #line 20159 "configure"
20160 #include "confdefs.h"
20161
20162 /* Override any gcc2 internal prototype to avoid an error.  */
20163 #ifdef __cplusplus
20164 extern "C"
20165 #endif
20166 /* We use char because int might match the return type of a gcc2
20167    builtin and then its argument prototype would still apply.  */
20168 char debug_malloc ();
20169 int
20170 main (void)
20171 {
20172 debug_malloc ();
20173   ;
20174   return 0;
20175 }
20176 _ACEOF
20177 rm -f conftest.$ac_objext conftest$ac_exeext
20178 if { (eval echo "$as_me:20178: \"$ac_link\"") >&5
20179   (eval $ac_link) 2>&5
20180   ac_status=$?
20181   echo "$as_me:20181: \$? = $ac_status" >&5
20182   (exit $ac_status); } &&
20183          { ac_try='test -s conftest$ac_exeext'
20184   { (eval echo "$as_me:20184: \"$ac_try\"") >&5
20185   (eval $ac_try) 2>&5
20186   ac_status=$?
20187   echo "$as_me:20187: \$? = $ac_status" >&5
20188   (exit $ac_status); }; }; then
20189   ac_cv_lib_dbmalloc_debug_malloc=yes
20190 else
20191   echo "$as_me: failed program was:" >&5
20192 cat conftest.$ac_ext >&5
20193 ac_cv_lib_dbmalloc_debug_malloc=no
20194 fi
20195 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20196 LIBS=$ac_check_lib_save_LIBS
20197 fi
20198 echo "$as_me:20198: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
20199 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
20200 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
20201   cat >>confdefs.h <<EOF
20202 #define HAVE_LIBDBMALLOC 1
20203 EOF
20204
20205   LIBS="-ldbmalloc $LIBS"
20206
20207 fi
20208
20209 fi
20210
20211 fi
20212
20213 echo "$as_me:20213: checking if you want to use valgrind for testing" >&5
20214 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
20215
20216 # Check whether --with-valgrind or --without-valgrind was given.
20217 if test "${with_valgrind+set}" = set; then
20218   withval="$with_valgrind"
20219
20220 cat >>confdefs.h <<EOF
20221 #define USE_VALGRIND 1
20222 EOF
20223
20224         : ${with_cflags:=-g}
20225         : ${with_no_leaks:=yes}
20226          with_valgrind=yes
20227 else
20228   with_valgrind=
20229 fi;
20230 echo "$as_me:20230: result: ${with_valgrind:-no}" >&5
20231 echo "${ECHO_T}${with_valgrind:-no}" >&6
20232
20233 case .$with_cflags in
20234 (.*-g*)
20235         case .$CFLAGS in
20236         (.*-g*)
20237                 ;;
20238         (*)
20239
20240 cf_fix_cppflags=no
20241 cf_new_cflags=
20242 cf_new_cppflags=
20243 cf_new_extra_cppflags=
20244
20245 for cf_add_cflags in -g
20246 do
20247 case $cf_fix_cppflags in
20248 (no)
20249         case $cf_add_cflags in
20250         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20251                 case $cf_add_cflags in
20252                 (-D*)
20253                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20254
20255                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20256                                 && test -z "${cf_tst_cflags}" \
20257                                 && cf_fix_cppflags=yes
20258
20259                         if test $cf_fix_cppflags = yes ; then
20260
20261         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20262         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20263
20264                                 continue
20265                         elif test "${cf_tst_cflags}" = "\"'" ; then
20266
20267         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20268         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20269
20270                                 continue
20271                         fi
20272                         ;;
20273                 esac
20274                 case "$CPPFLAGS" in
20275                 (*$cf_add_cflags)
20276                         ;;
20277                 (*)
20278                         case $cf_add_cflags in
20279                         (-D*)
20280                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20281
20282 CPPFLAGS=`echo "$CPPFLAGS" | \
20283         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20284                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20285
20286                                 ;;
20287                         esac
20288
20289         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20290         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20291
20292                         ;;
20293                 esac
20294                 ;;
20295         (*)
20296
20297         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20298         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20299
20300                 ;;
20301         esac
20302         ;;
20303 (yes)
20304
20305         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20306         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20307
20308         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20309
20310         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20311                 && test -z "${cf_tst_cflags}" \
20312                 && cf_fix_cppflags=no
20313         ;;
20314 esac
20315 done
20316
20317 if test -n "$cf_new_cflags" ; then
20318
20319         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20320         CFLAGS="${CFLAGS}$cf_new_cflags"
20321
20322 fi
20323
20324 if test -n "$cf_new_cppflags" ; then
20325
20326         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20327         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20328
20329 fi
20330
20331 if test -n "$cf_new_extra_cppflags" ; then
20332
20333         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20334         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20335
20336 fi
20337
20338                 ;;
20339         esac
20340         ;;
20341 esac
20342
20343 echo "$as_me:20343: checking if you want to perform memory-leak testing" >&5
20344 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
20345
20346 # Check whether --enable-leaks or --disable-leaks was given.
20347 if test "${enable_leaks+set}" = set; then
20348   enableval="$enable_leaks"
20349   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
20350 else
20351   : ${with_no_leaks:=no}
20352 fi;
20353 echo "$as_me:20353: result: $with_no_leaks" >&5
20354 echo "${ECHO_T}$with_no_leaks" >&6
20355
20356 if test "$with_no_leaks" = yes ; then
20357
20358 cat >>confdefs.h <<\EOF
20359 #define NO_LEAKS 1
20360 EOF
20361
20362 cat >>confdefs.h <<\EOF
20363 #define YY_NO_LEAKS 1
20364 EOF
20365
20366 fi
20367
20368 LD_RPATH_OPT=
20369 if test "x$cf_cv_enable_rpath" != xno
20370 then
20371         echo "$as_me:20371: checking for an rpath option" >&5
20372 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
20373         case $cf_cv_system_name in
20374         (irix*)
20375                 if test "$GCC" = yes; then
20376                         LD_RPATH_OPT="-Wl,-rpath,"
20377                 else
20378                         LD_RPATH_OPT="-rpath "
20379                 fi
20380                 ;;
20381         (linux*|gnu*|k*bsd*-gnu|freebsd*)
20382                 LD_RPATH_OPT="-Wl,-rpath,"
20383                 ;;
20384         (openbsd[2-9].*|mirbsd*)
20385                 LD_RPATH_OPT="-Wl,-rpath,"
20386                 ;;
20387         (dragonfly*)
20388                 LD_RPATH_OPT="-rpath "
20389                 ;;
20390         (netbsd*)
20391                 LD_RPATH_OPT="-Wl,-rpath,"
20392                 ;;
20393         (osf*|mls+*)
20394                 LD_RPATH_OPT="-rpath "
20395                 ;;
20396         (solaris2*)
20397                 LD_RPATH_OPT="-R"
20398                 ;;
20399         (*)
20400                 ;;
20401         esac
20402         echo "$as_me:20402: result: $LD_RPATH_OPT" >&5
20403 echo "${ECHO_T}$LD_RPATH_OPT" >&6
20404
20405         case "x$LD_RPATH_OPT" in
20406         (x-R*)
20407                 echo "$as_me:20407: checking if we need a space after rpath option" >&5
20408 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
20409                 cf_save_LIBS="$LIBS"
20410
20411 cf_add_libs="${LD_RPATH_OPT}$libdir"
20412 # Filter out duplicates - this happens with badly-designed ".pc" files...
20413 for cf_add_1lib in $LIBS
20414 do
20415         for cf_add_2lib in $cf_add_libs
20416         do
20417                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
20418                 then
20419                         cf_add_1lib=
20420                         break
20421                 fi
20422         done
20423         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
20424 done
20425 LIBS="$cf_add_libs"
20426
20427                 cat >conftest.$ac_ext <<_ACEOF
20428 #line 20428 "configure"
20429 #include "confdefs.h"
20430
20431 int
20432 main (void)
20433 {
20434
20435   ;
20436   return 0;
20437 }
20438 _ACEOF
20439 rm -f conftest.$ac_objext conftest$ac_exeext
20440 if { (eval echo "$as_me:20440: \"$ac_link\"") >&5
20441   (eval $ac_link) 2>&5
20442   ac_status=$?
20443   echo "$as_me:20443: \$? = $ac_status" >&5
20444   (exit $ac_status); } &&
20445          { ac_try='test -s conftest$ac_exeext'
20446   { (eval echo "$as_me:20446: \"$ac_try\"") >&5
20447   (eval $ac_try) 2>&5
20448   ac_status=$?
20449   echo "$as_me:20449: \$? = $ac_status" >&5
20450   (exit $ac_status); }; }; then
20451   cf_rpath_space=no
20452 else
20453   echo "$as_me: failed program was:" >&5
20454 cat conftest.$ac_ext >&5
20455 cf_rpath_space=yes
20456 fi
20457 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20458                 LIBS="$cf_save_LIBS"
20459                 echo "$as_me:20459: result: $cf_rpath_space" >&5
20460 echo "${ECHO_T}$cf_rpath_space" >&6
20461                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
20462                 ;;
20463         esac
20464 fi
20465
20466 echo "$as_me:20466: checking if rpath-hack should be disabled" >&5
20467 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
20468
20469 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
20470 if test "${enable_rpath_hack+set}" = set; then
20471   enableval="$enable_rpath_hack"
20472   test "$enableval" != no && enableval=yes
20473         if test "$enableval" != "yes" ; then
20474     cf_disable_rpath_hack=yes
20475         else
20476                 cf_disable_rpath_hack=no
20477         fi
20478 else
20479   enableval=yes
20480         cf_disable_rpath_hack=no
20481
20482 fi;
20483 echo "$as_me:20483: result: $cf_disable_rpath_hack" >&5
20484 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
20485 if test "$cf_disable_rpath_hack" = no ; then
20486
20487 echo "$as_me:20487: checking for updated LDFLAGS" >&5
20488 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
20489 if test -n "$LD_RPATH_OPT" ; then
20490         echo "$as_me:20490: result: maybe" >&5
20491 echo "${ECHO_T}maybe" >&6
20492
20493         for ac_prog in ldd
20494 do
20495   # Extract the first word of "$ac_prog", so it can be a program name with args.
20496 set dummy $ac_prog; ac_word=$2
20497 echo "$as_me:20497: checking for $ac_word" >&5
20498 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
20499 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
20500   echo $ECHO_N "(cached) $ECHO_C" >&6
20501 else
20502   if test -n "$cf_ldd_prog"; then
20503   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
20504 else
20505   ac_save_IFS=$IFS; IFS=$ac_path_separator
20506 ac_dummy="$PATH"
20507 for ac_dir in $ac_dummy; do
20508   IFS=$ac_save_IFS
20509   test -z "$ac_dir" && ac_dir=.
20510   $as_executable_p "$ac_dir/$ac_word" || continue
20511 ac_cv_prog_cf_ldd_prog="$ac_prog"
20512 echo "$as_me:20512: found $ac_dir/$ac_word" >&5
20513 break
20514 done
20515
20516 fi
20517 fi
20518 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
20519 if test -n "$cf_ldd_prog"; then
20520   echo "$as_me:20520: result: $cf_ldd_prog" >&5
20521 echo "${ECHO_T}$cf_ldd_prog" >&6
20522 else
20523   echo "$as_me:20523: result: no" >&5
20524 echo "${ECHO_T}no" >&6
20525 fi
20526
20527   test -n "$cf_ldd_prog" && break
20528 done
20529 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
20530
20531         cf_rpath_list="/usr/lib /lib"
20532         if test "$cf_ldd_prog" != no
20533         then
20534                 cf_rpath_oops=
20535
20536 cat >conftest.$ac_ext <<_ACEOF
20537 #line 20537 "configure"
20538 #include "confdefs.h"
20539 #include <stdio.h>
20540 int
20541 main (void)
20542 {
20543 printf("Hello");
20544   ;
20545   return 0;
20546 }
20547 _ACEOF
20548 rm -f conftest.$ac_objext conftest$ac_exeext
20549 if { (eval echo "$as_me:20549: \"$ac_link\"") >&5
20550   (eval $ac_link) 2>&5
20551   ac_status=$?
20552   echo "$as_me:20552: \$? = $ac_status" >&5
20553   (exit $ac_status); } &&
20554          { ac_try='test -s conftest$ac_exeext'
20555   { (eval echo "$as_me:20555: \"$ac_try\"") >&5
20556   (eval $ac_try) 2>&5
20557   ac_status=$?
20558   echo "$as_me:20558: \$? = $ac_status" >&5
20559   (exit $ac_status); }; }; then
20560   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
20561                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
20562 else
20563   echo "$as_me: failed program was:" >&5
20564 cat conftest.$ac_ext >&5
20565 fi
20566 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20567
20568                 # If we passed the link-test, but get a "not found" on a given library,
20569                 # this could be due to inept reconfiguration of gcc to make it only
20570                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
20571                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
20572                 # /usr/local libraries.
20573                 if test -n "$cf_rpath_oops"
20574                 then
20575                         for cf_rpath_src in $cf_rpath_oops
20576                         do
20577                                 for cf_rpath_dir in \
20578                                         /usr/local \
20579                                         /usr/pkg \
20580                                         /opt/sfw
20581                                 do
20582                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
20583                                         then
20584                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
20585
20586 echo "${as_me:-configure}:20586: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
20587
20588                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
20589                                                 break
20590                                         fi
20591                                 done
20592                         done
20593                 fi
20594         fi
20595
20596         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20597
20598 echo "${as_me:-configure}:20598: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20599
20600 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
20601
20602 echo "${as_me:-configure}:20602: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
20603
20604 cf_rpath_dst=
20605 for cf_rpath_src in $LDFLAGS
20606 do
20607         case $cf_rpath_src in
20608         (-L*)
20609
20610                 # check if this refers to a directory which we will ignore
20611                 cf_rpath_skip=no
20612                 if test -n "$cf_rpath_list"
20613                 then
20614                         for cf_rpath_item in $cf_rpath_list
20615                         do
20616                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20617                                 then
20618                                         cf_rpath_skip=yes
20619                                         break
20620                                 fi
20621                         done
20622                 fi
20623
20624                 if test "$cf_rpath_skip" = no
20625                 then
20626                         # transform the option
20627                         if test "$LD_RPATH_OPT" = "-R " ; then
20628                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20629                         else
20630                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20631                         fi
20632
20633                         # if we have not already added this, add it now
20634                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20635                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20636                         then
20637                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20638
20639 echo "${as_me:-configure}:20639: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20640
20641                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20642                         fi
20643                 fi
20644                 ;;
20645         esac
20646         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20647 done
20648 LDFLAGS=$cf_rpath_dst
20649
20650 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
20651
20652 echo "${as_me:-configure}:20652: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
20653
20654 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
20655
20656 echo "${as_me:-configure}:20656: testing ...checking LIBS $LIBS ..." 1>&5
20657
20658 cf_rpath_dst=
20659 for cf_rpath_src in $LIBS
20660 do
20661         case $cf_rpath_src in
20662         (-L*)
20663
20664                 # check if this refers to a directory which we will ignore
20665                 cf_rpath_skip=no
20666                 if test -n "$cf_rpath_list"
20667                 then
20668                         for cf_rpath_item in $cf_rpath_list
20669                         do
20670                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20671                                 then
20672                                         cf_rpath_skip=yes
20673                                         break
20674                                 fi
20675                         done
20676                 fi
20677
20678                 if test "$cf_rpath_skip" = no
20679                 then
20680                         # transform the option
20681                         if test "$LD_RPATH_OPT" = "-R " ; then
20682                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20683                         else
20684                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20685                         fi
20686
20687                         # if we have not already added this, add it now
20688                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20689                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20690                         then
20691                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20692
20693 echo "${as_me:-configure}:20693: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20694
20695                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20696                         fi
20697                 fi
20698                 ;;
20699         esac
20700         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20701 done
20702 LIBS=$cf_rpath_dst
20703
20704 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
20705
20706 echo "${as_me:-configure}:20706: testing ...checked LIBS $LIBS ..." 1>&5
20707
20708         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20709
20710 echo "${as_me:-configure}:20710: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20711
20712 else
20713         echo "$as_me:20713: result: no" >&5
20714 echo "${ECHO_T}no" >&6
20715 fi
20716
20717 fi
20718
20719 TEST_ARGS="$LIBS"
20720 LIBS=
20721
20722 ac_config_files="$ac_config_files Makefile"
20723 ac_config_commands="$ac_config_commands default"
20724 cat >confcache <<\_ACEOF
20725 # This file is a shell script that caches the results of configure
20726 # tests run on this system so they can be shared between configure
20727 # scripts and configure runs, see configure's option --config-cache.
20728 # It is not useful on other systems.  If it contains results you don't
20729 # want to keep, you may remove or edit it.
20730 #
20731 # config.status only pays attention to the cache file if you give it
20732 # the --recheck option to rerun configure.
20733 #
20734 # `ac_cv_env_foo' variables (set or unset) will be overriden when
20735 # loading this file, other *unset* `ac_cv_foo' will be assigned the
20736 # following values.
20737
20738 _ACEOF
20739
20740 # The following way of writing the cache mishandles newlines in values,
20741 # but we know of no workaround that is simple, portable, and efficient.
20742 # So, don't put newlines in cache variables' values.
20743 # Ultrix sh set writes to stderr and can't be redirected directly,
20744 # and sets the high bit in the cache file unless we assign to the vars.
20745 {
20746   (set) 2>&1 |
20747     case `(ac_space=' '; set | grep ac_space) 2>&1` in
20748     *ac_space=\ *)
20749       # `set' does not quote correctly, so add quotes (double-quote
20750       # substitution turns \\\\ into \\, and sed turns \\ into \).
20751       sed -n \
20752         "s/'/'\\\\''/g;
20753           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
20754       ;;
20755     *)
20756       # `set' quotes correctly as required by POSIX, so do not add quotes.
20757       sed -n \
20758         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
20759       ;;
20760     esac;
20761 } |
20762   sed '
20763      t clear
20764      : clear
20765      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
20766      t end
20767      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
20768      : end' >>confcache
20769 if cmp -s $cache_file confcache; then :; else
20770   if test -w $cache_file; then
20771     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
20772     cat confcache >$cache_file
20773   else
20774     echo "not updating unwritable cache $cache_file"
20775   fi
20776 fi
20777 rm -f confcache
20778
20779 test "x$prefix" = xNONE && prefix=$ac_default_prefix
20780 # Let make expand exec_prefix.
20781 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
20782
20783 # VPATH may cause trouble with some makes, so we remove $(srcdir),
20784 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
20785 # trailing colons and then remove the whole line if VPATH becomes empty
20786 # (actually we leave an empty line to preserve line numbers).
20787 if test "x$srcdir" = x.; then
20788   ac_vpsub='/^[         ]*VPATH[        ]*=/{
20789 s/:*\$(srcdir):*/:/;
20790 s/:*\${srcdir}:*/:/;
20791 s/:*@srcdir@:*/:/;
20792 s/^\([^=]*=[    ]*\):*/\1/;
20793 s/:*$//;
20794 s/^[^=]*=[      ]*$//;
20795 }'
20796 fi
20797
20798 DEFS=-DHAVE_CONFIG_H
20799
20800 : ${CONFIG_STATUS=./config.status}
20801 ac_clean_files_save=$ac_clean_files
20802 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
20803 { echo "$as_me:20803: creating $CONFIG_STATUS" >&5
20804 echo "$as_me: creating $CONFIG_STATUS" >&6;}
20805 cat >$CONFIG_STATUS <<_ACEOF
20806 #! $SHELL
20807 # Generated automatically by configure.
20808 # Run this file to recreate the current configuration.
20809 # Compiler output produced by configure, useful for debugging
20810 # configure, is in config.log if it exists.
20811
20812 debug=false
20813 SHELL=\${CONFIG_SHELL-$SHELL}
20814 ac_cs_invocation="\$0 \$@"
20815
20816 _ACEOF
20817
20818 cat >>$CONFIG_STATUS <<\_ACEOF
20819 # Be Bourne compatible
20820 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
20821   emulate sh
20822   NULLCMD=:
20823 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
20824   set -o posix
20825 fi
20826
20827 # Name of the executable.
20828 as_me=`echo "$0" |sed 's,.*[\\/],,'`
20829
20830 if expr a : '\(a\)' >/dev/null 2>&1; then
20831   as_expr=expr
20832 else
20833   as_expr=false
20834 fi
20835
20836 rm -f conf$$ conf$$.exe conf$$.file
20837 echo >conf$$.file
20838 if ln -s conf$$.file conf$$ 2>/dev/null; then
20839   # We could just check for DJGPP; but this test a) works b) is more generic
20840   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
20841   if test -f conf$$.exe; then
20842     # Don't use ln at all; we don't have any links
20843     as_ln_s='cp -p'
20844   else
20845     as_ln_s='ln -s'
20846   fi
20847 elif ln conf$$.file conf$$ 2>/dev/null; then
20848   as_ln_s=ln
20849 else
20850   as_ln_s='cp -p'
20851 fi
20852 rm -f conf$$ conf$$.exe conf$$.file
20853
20854 as_executable_p="test -f"
20855
20856 # Support unset when possible.
20857 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
20858   as_unset=unset
20859 else
20860   as_unset=false
20861 fi
20862
20863 # NLS nuisances.
20864 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
20865 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
20866 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
20867 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
20868 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
20869 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
20870 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
20871 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
20872
20873 # IFS
20874 # We need space, tab and new line, in precisely that order.
20875 as_nl='
20876 '
20877 IFS="   $as_nl"
20878
20879 # CDPATH.
20880 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
20881
20882 exec 6>&1
20883
20884 _ACEOF
20885
20886 # Files that config.status was made for.
20887 if test -n "$ac_config_files"; then
20888   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
20889 fi
20890
20891 if test -n "$ac_config_headers"; then
20892   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
20893 fi
20894
20895 if test -n "$ac_config_links"; then
20896   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
20897 fi
20898
20899 if test -n "$ac_config_commands"; then
20900   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
20901 fi
20902
20903 cat >>$CONFIG_STATUS <<\EOF
20904
20905 ac_cs_usage="\
20906 \`$as_me' instantiates files from templates according to the
20907 current configuration.
20908
20909 Usage: $0 [OPTIONS] [FILE]...
20910
20911   -h, --help       print this help, then exit
20912   -V, --version    print version number, then exit
20913   -d, --debug      don't remove temporary files
20914       --recheck    update $as_me by reconfiguring in the same conditions
20915   --file=FILE[:TEMPLATE]
20916                    instantiate the configuration file FILE
20917   --header=FILE[:TEMPLATE]
20918                    instantiate the configuration header FILE
20919
20920 Configuration files:
20921 $config_files
20922
20923 Configuration headers:
20924 $config_headers
20925
20926 Configuration commands:
20927 $config_commands
20928
20929 Report bugs to <dickey@invisible-island.net>."
20930 EOF
20931
20932 cat >>$CONFIG_STATUS <<EOF
20933 ac_cs_version="\\
20934 config.status
20935 configured by $0, generated by GNU Autoconf 2.52.20190828,
20936   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
20937
20938 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
20939 Free Software Foundation, Inc.
20940 This config.status script is free software; the Free Software Foundation
20941 gives unlimited permission to copy, distribute and modify it."
20942 srcdir=$srcdir
20943 INSTALL="$INSTALL"
20944 EOF
20945
20946 cat >>$CONFIG_STATUS <<\EOF
20947 # If no file are specified by the user, then we need to provide default
20948 # value.  By we need to know if files were specified by the user.
20949 ac_need_defaults=:
20950 while test $# != 0
20951 do
20952   case $1 in
20953   --*=*)
20954     ac_option=`expr "x$1" : 'x\([^=]*\)='`
20955     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
20956     shift
20957     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
20958     shift
20959     ;;
20960   -*);;
20961   *) # This is not an option, so the user has probably given explicit
20962      # arguments.
20963      ac_need_defaults=false;;
20964   esac
20965
20966   case $1 in
20967   # Handling of the options.
20968 EOF
20969 cat >>$CONFIG_STATUS <<EOF
20970   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
20971     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
20972     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
20973 EOF
20974 cat >>$CONFIG_STATUS <<\EOF
20975   --version | --vers* | -V )
20976     echo "$ac_cs_version"; exit 0 ;;
20977   --he | --h)
20978     # Conflict between --help and --header
20979     { { echo "$as_me:20979: error: ambiguous option: $1
20980 Try \`$0 --help' for more information." >&5
20981 echo "$as_me: error: ambiguous option: $1
20982 Try \`$0 --help' for more information." >&2;}
20983    { (exit 1); exit 1; }; };;
20984   --help | --hel | -h )
20985     echo "$ac_cs_usage"; exit 0 ;;
20986   --debug | --d* | -d )
20987     debug=: ;;
20988   --file | --fil | --fi | --f )
20989     shift
20990     CONFIG_FILES="$CONFIG_FILES $1"
20991     ac_need_defaults=false;;
20992   --header | --heade | --head | --hea )
20993     shift
20994     CONFIG_HEADERS="$CONFIG_HEADERS $1"
20995     ac_need_defaults=false;;
20996
20997   # This is an error.
20998   -*) { { echo "$as_me:20998: error: unrecognized option: $1
20999 Try \`$0 --help' for more information." >&5
21000 echo "$as_me: error: unrecognized option: $1
21001 Try \`$0 --help' for more information." >&2;}
21002    { (exit 1); exit 1; }; } ;;
21003
21004   *) ac_config_targets="$ac_config_targets $1" ;;
21005
21006   esac
21007   shift
21008 done
21009
21010 exec 5>>config.log
21011 cat >&5 << _ACEOF
21012
21013 ## ----------------------- ##
21014 ## Running config.status.  ##
21015 ## ----------------------- ##
21016
21017 This file was extended by $as_me 2.52.20190828, executed with
21018   CONFIG_FILES    = $CONFIG_FILES
21019   CONFIG_HEADERS  = $CONFIG_HEADERS
21020   CONFIG_LINKS    = $CONFIG_LINKS
21021   CONFIG_COMMANDS = $CONFIG_COMMANDS
21022   > $ac_cs_invocation
21023 on `(hostname || uname -n) 2>/dev/null | sed 1q`
21024
21025 _ACEOF
21026 EOF
21027
21028 cat >>$CONFIG_STATUS <<EOF
21029 #
21030 # INIT-COMMANDS section.
21031 #
21032
21033 AWK="$AWK"
21034 ECHO_CC="$ECHO_CC"
21035 ECHO_LD="$ECHO_LD"
21036 SHOW_CC="$SHOW_LD"
21037
21038 EOF
21039
21040 cat >>$CONFIG_STATUS <<\EOF
21041 for ac_config_target in $ac_config_targets
21042 do
21043   case "$ac_config_target" in
21044   # Handling of arguments.
21045   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
21046   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
21047   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
21048   *) { { echo "$as_me:21048: error: invalid argument: $ac_config_target" >&5
21049 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
21050    { (exit 1); exit 1; }; };;
21051   esac
21052 done
21053
21054 # If the user did not use the arguments to specify the items to instantiate,
21055 # then the envvar interface is used.  Set only those that are not.
21056 # We use the long form for the default assignment because of an extremely
21057 # bizarre bug on SunOS 4.1.3.
21058 if $ac_need_defaults; then
21059   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
21060   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
21061   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
21062 fi
21063
21064 # Create a temporary directory, and hook for its removal unless debugging.
21065 $debug ||
21066 {
21067   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
21068   trap '{ (exit 1); exit 1; }' 1 2 13 15
21069 }
21070
21071 # Create a (secure) tmp directory for tmp files.
21072 : ${TMPDIR=/tmp}
21073 {
21074   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
21075   test -n "$tmp" && test -d "$tmp"
21076 }  ||
21077 {
21078   tmp=$TMPDIR/cs$$-$RANDOM
21079   (umask 077 && mkdir $tmp)
21080 } ||
21081 {
21082    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
21083    { (exit 1); exit 1; }
21084 }
21085
21086 EOF
21087
21088 cat >>$CONFIG_STATUS <<EOF
21089
21090 #
21091 # CONFIG_FILES section.
21092 #
21093
21094 # No need to generate the scripts if there are no CONFIG_FILES.
21095 # This happens for instance when ./config.status config.h
21096 if test -n "\$CONFIG_FILES"; then
21097   # Protect against being on the right side of a sed subst in config.status.
21098   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
21099    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
21100 s,@SHELL@,$SHELL,;t t
21101 s,@exec_prefix@,$exec_prefix,;t t
21102 s,@prefix@,$prefix,;t t
21103 s,@program_transform_name@,$program_transform_name,;t t
21104 s,@bindir@,$bindir,;t t
21105 s,@sbindir@,$sbindir,;t t
21106 s,@libexecdir@,$libexecdir,;t t
21107 s,@datarootdir@,$datarootdir,;t t
21108 s,@datadir@,$datadir,;t t
21109 s,@sysconfdir@,$sysconfdir,;t t
21110 s,@sharedstatedir@,$sharedstatedir,;t t
21111 s,@localstatedir@,$localstatedir,;t t
21112 s,@runstatedir@,$runstatedir,;t t
21113 s,@libdir@,$libdir,;t t
21114 s,@includedir@,$includedir,;t t
21115 s,@oldincludedir@,$oldincludedir,;t t
21116 s,@infodir@,$infodir,;t t
21117 s,@mandir@,$mandir,;t t
21118 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
21119 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
21120 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
21121 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
21122 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
21123 s,@build_alias@,$build_alias,;t t
21124 s,@host_alias@,$host_alias,;t t
21125 s,@target_alias@,$target_alias,;t t
21126 s,@ECHO_C@,$ECHO_C,;t t
21127 s,@ECHO_N@,$ECHO_N,;t t
21128 s,@ECHO_T@,$ECHO_T,;t t
21129 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
21130 s,@DEFS@,$DEFS,;t t
21131 s,@LIBS@,$LIBS,;t t
21132 s,@build@,$build,;t t
21133 s,@build_cpu@,$build_cpu,;t t
21134 s,@build_vendor@,$build_vendor,;t t
21135 s,@build_os@,$build_os,;t t
21136 s,@host@,$host,;t t
21137 s,@host_cpu@,$host_cpu,;t t
21138 s,@host_vendor@,$host_vendor,;t t
21139 s,@host_os@,$host_os,;t t
21140 s,@SET_MAKE@,$SET_MAKE,;t t
21141 s,@CC@,$CC,;t t
21142 s,@CFLAGS@,$CFLAGS,;t t
21143 s,@LDFLAGS@,$LDFLAGS,;t t
21144 s,@CPPFLAGS@,$CPPFLAGS,;t t
21145 s,@ac_ct_CC@,$ac_ct_CC,;t t
21146 s,@EXEEXT@,$EXEEXT,;t t
21147 s,@OBJEXT@,$OBJEXT,;t t
21148 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
21149 s,@CPP@,$CPP,;t t
21150 s,@AWK@,$AWK,;t t
21151 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
21152 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
21153 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
21154 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
21155 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
21156 s,@LINT@,$LINT,;t t
21157 s,@LINT_OPTS@,$LINT_OPTS,;t t
21158 s,@CTAGS@,$CTAGS,;t t
21159 s,@ETAGS@,$ETAGS,;t t
21160 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
21161 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
21162 s,@MATH_LIB@,$MATH_LIB,;t t
21163 s,@top_builddir@,$top_builddir,;t t
21164 s,@CC_G_OPT@,$CC_G_OPT,;t t
21165 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
21166 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
21167 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
21168 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
21169 s,@LD@,$LD,;t t
21170 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
21171 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
21172 s,@LD_MODEL@,$LD_MODEL,;t t
21173 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
21174 s,@LIBTOOL@,$LIBTOOL,;t t
21175 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
21176 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
21177 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
21178 s,@LIB_LINK@,$LIB_LINK,;t t
21179 s,@LINK_TESTS@,$LINK_TESTS,;t t
21180 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
21181 s,@PACKAGE@,$PACKAGE,;t t
21182 s,@PTHREAD@,$PTHREAD,;t t
21183 s,@TEST_ARGS@,$TEST_ARGS,;t t
21184 s,@TEST_DEPS@,$TEST_DEPS,;t t
21185 s,@TEST_LIBS@,$TEST_LIBS,;t t
21186 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
21187 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
21188 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
21189 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
21190 s,@includesubdir@,$includesubdir,;t t
21191 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
21192 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
21193 s,@ECHO_LT@,$ECHO_LT,;t t
21194 s,@ECHO_LD@,$ECHO_LD,;t t
21195 s,@RULE_CC@,$RULE_CC,;t t
21196 s,@SHOW_CC@,$SHOW_CC,;t t
21197 s,@ECHO_CC@,$ECHO_CC,;t t
21198 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
21199 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
21200 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
21201 s,@X_CFLAGS@,$X_CFLAGS,;t t
21202 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
21203 s,@X_LIBS@,$X_LIBS,;t t
21204 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
21205 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
21206 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
21207 s,@RGB_PATH@,$RGB_PATH,;t t
21208 s,@no_x11_rgb@,$no_x11_rgb,;t t
21209 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
21210 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
21211 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
21212 CEOF
21213
21214 EOF
21215
21216   cat >>$CONFIG_STATUS <<\EOF
21217   # Split the substitutions into bite-sized pieces for seds with
21218   # small command number limits, like on Digital OSF/1 and HP-UX.
21219   ac_max_sed_lines=48
21220   ac_sed_frag=1 # Number of current file.
21221   ac_beg=1 # First line for current file.
21222   ac_end=$ac_max_sed_lines # Line after last line for current file.
21223   ac_more_lines=:
21224   ac_sed_cmds=
21225   while $ac_more_lines; do
21226     if test $ac_beg -gt 1; then
21227       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21228     else
21229       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21230     fi
21231     if test ! -s $tmp/subs.frag; then
21232       ac_more_lines=false
21233     else
21234       # The purpose of the label and of the branching condition is to
21235       # speed up the sed processing (if there are no `@' at all, there
21236       # is no need to browse any of the substitutions).
21237       # These are the two extra sed commands mentioned above.
21238       (echo ':t
21239   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
21240       # It is possible to make a multiline substitution using escaped newlines.
21241       # Ensure that we do not split the substitution between script fragments.
21242       ac_BEG=$ac_end
21243       ac_END=`expr $ac_end + $ac_max_sed_lines`
21244       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
21245       if test -s $tmp/subs.next; then
21246         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
21247         if test ! -s $tmp/subs.edit; then
21248           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
21249           if test ! -s $tmp/subs.edit; then
21250             if test $ac_beg -gt 1; then
21251               ac_end=`expr $ac_end - 1`
21252               continue
21253             fi
21254           fi
21255         fi
21256       fi
21257
21258       if test -z "$ac_sed_cmds"; then
21259         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
21260       else
21261         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
21262       fi
21263       ac_sed_frag=`expr $ac_sed_frag + 1`
21264       ac_beg=$ac_end
21265       ac_end=`expr $ac_end + $ac_max_sed_lines`
21266     fi
21267   done
21268   if test -z "$ac_sed_cmds"; then
21269     ac_sed_cmds=cat
21270   fi
21271 fi # test -n "$CONFIG_FILES"
21272
21273 EOF
21274 cat >>$CONFIG_STATUS <<\EOF
21275 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
21276   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21277   case $ac_file in
21278   - | *:- | *:-:* ) # input from stdin
21279         cat >$tmp/stdin
21280         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21281         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21282   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21283         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21284   * )   ac_file_in=$ac_file.in ;;
21285   esac
21286
21287   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
21288   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21289          X"$ac_file" : 'X\(//\)[^/]' \| \
21290          X"$ac_file" : 'X\(//\)$' \| \
21291          X"$ac_file" : 'X\(/\)' \| \
21292          .     : '\(.\)' 2>/dev/null ||
21293 echo X"$ac_file" |
21294     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21295           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21296           /^X\(\/\/\)$/{ s//\1/; q; }
21297           /^X\(\/\).*/{ s//\1/; q; }
21298           s/.*/./; q'`
21299   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21300     { case "$ac_dir" in
21301   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21302   *)                      as_incr_dir=.;;
21303 esac
21304 as_dummy="$ac_dir"
21305 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21306   case $as_mkdir_dir in
21307     # Skip DOS drivespec
21308     ?:) as_incr_dir=$as_mkdir_dir ;;
21309     *)
21310       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21311       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21312     ;;
21313   esac
21314 done; }
21315
21316     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21317     # A "../" for each directory in $ac_dir_suffix.
21318     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21319   else
21320     ac_dir_suffix= ac_dots=
21321   fi
21322
21323   case $srcdir in
21324   .)  ac_srcdir=.
21325       if test -z "$ac_dots"; then
21326          ac_top_srcdir=.
21327       else
21328          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21329       fi ;;
21330   [\\/]* | ?:[\\/]* )
21331       ac_srcdir=$srcdir$ac_dir_suffix;
21332       ac_top_srcdir=$srcdir ;;
21333   *) # Relative path.
21334     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
21335     ac_top_srcdir=$ac_dots$srcdir ;;
21336   esac
21337
21338   case $INSTALL in
21339   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21340   *) ac_INSTALL=$ac_dots$INSTALL ;;
21341   esac
21342
21343   if test x"$ac_file" != x-; then
21344     { echo "$as_me:21344: creating $ac_file" >&5
21345 echo "$as_me: creating $ac_file" >&6;}
21346     rm -f "$ac_file"
21347   fi
21348   # Let's still pretend it is `configure' which instantiates (i.e., don't
21349   # use $as_me), people would be surprised to read:
21350   #    /* config.h.  Generated automatically by config.status.  */
21351   configure_input="Generated automatically from `echo $ac_file_in |
21352                                                  sed 's,.*/,,'` by configure."
21353
21354   # First look for the input files in the build tree, otherwise in the
21355   # src tree.
21356   ac_file_inputs=`IFS=:
21357     for f in $ac_file_in; do
21358       case $f in
21359       -) echo $tmp/stdin ;;
21360       [\\/$]*)
21361          # Absolute (can't be DOS-style, as IFS=:)
21362          test -f "$f" || { { echo "$as_me:21362: error: cannot find input file: $f" >&5
21363 echo "$as_me: error: cannot find input file: $f" >&2;}
21364    { (exit 1); exit 1; }; }
21365          echo $f;;
21366       *) # Relative
21367          if test -f "$f"; then
21368            # Build tree
21369            echo $f
21370          elif test -f "$srcdir/$f"; then
21371            # Source tree
21372            echo $srcdir/$f
21373          else
21374            # /dev/null tree
21375            { { echo "$as_me:21375: error: cannot find input file: $f" >&5
21376 echo "$as_me: error: cannot find input file: $f" >&2;}
21377    { (exit 1); exit 1; }; }
21378          fi;;
21379       esac
21380     done` || { (exit 1); exit 1; }
21381 EOF
21382 cat >>$CONFIG_STATUS <<\EOF
21383   ac_warn_datarootdir=no
21384   if test x"$ac_file" != x-; then
21385     for ac_item in $ac_file_inputs
21386     do
21387       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
21388       if test -n "$ac_seen"; then
21389         ac_used=`grep '@datarootdir@' $ac_item`
21390         if test -z "$ac_used"; then
21391           { echo "$as_me:21391: WARNING: datarootdir was used implicitly but not set:
21392 $ac_seen" >&5
21393 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
21394 $ac_seen" >&2;}
21395           ac_warn_datarootdir=yes
21396         fi
21397       fi
21398       ac_seen=`grep '${datarootdir}' $ac_item`
21399       if test -n "$ac_seen"; then
21400         { echo "$as_me:21400: WARNING: datarootdir was used explicitly but not set:
21401 $ac_seen" >&5
21402 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
21403 $ac_seen" >&2;}
21404         ac_warn_datarootdir=yes
21405       fi
21406     done
21407   fi
21408
21409 if test "x$ac_warn_datarootdir" = xyes; then
21410   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
21411 fi
21412
21413 EOF
21414 cat >>$CONFIG_STATUS <<EOF
21415   sed "$ac_vpsub
21416 $extrasub
21417 EOF
21418 cat >>$CONFIG_STATUS <<\EOF
21419 :t
21420 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
21421 s,@configure_input@,$configure_input,;t t
21422 s,@srcdir@,$ac_srcdir,;t t
21423 s,@top_srcdir@,$ac_top_srcdir,;t t
21424 s,@INSTALL@,$ac_INSTALL,;t t
21425 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
21426   rm -f $tmp/stdin
21427   if test x"$ac_file" != x-; then
21428     cp $tmp/out $ac_file
21429
21430     for ac_name in prefix exec_prefix datarootdir
21431     do
21432         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
21433         if test -n "$ac_seen"; then
21434             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
21435             if test -z "$ac_init"; then
21436               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
21437               { echo "$as_me:21437: WARNING: Variable $ac_name is used but was not set:
21438 $ac_seen" >&5
21439 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
21440 $ac_seen" >&2;}
21441             fi
21442         fi
21443     done
21444     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
21445     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
21446     if test -s $tmp/out; then
21447       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
21448       { echo "$as_me:21448: WARNING: Some variables may not be substituted:
21449 $ac_seen" >&5
21450 echo "$as_me: WARNING: Some variables may not be substituted:
21451 $ac_seen" >&2;}
21452     fi
21453   else
21454     cat $tmp/out
21455   fi
21456   rm -f $tmp/out
21457
21458 done
21459 EOF
21460 cat >>$CONFIG_STATUS <<\EOF
21461
21462 #
21463 # CONFIG_HEADER section.
21464 #
21465
21466 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
21467 # NAME is the cpp macro being defined and VALUE is the value it is being given.
21468 #
21469 # ac_d sets the value in "#define NAME VALUE" lines.
21470 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
21471 ac_dB='[        ].*$,\1#\2'
21472 ac_dC=' '
21473 ac_dD=',;t'
21474 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
21475 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21476 ac_iB='\([      ]\),\1#\2define\3'
21477 ac_iC=' '
21478 ac_iD='\4,;t'
21479 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
21480 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21481 ac_uB='$,\1#\2define\3'
21482 ac_uC=' '
21483 ac_uD=',;t'
21484
21485 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
21486   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21487   case $ac_file in
21488   - | *:- | *:-:* ) # input from stdin
21489         cat >$tmp/stdin
21490         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21491         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21492   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21493         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21494   * )   ac_file_in=$ac_file.in ;;
21495   esac
21496
21497   test x"$ac_file" != x- && { echo "$as_me:21497: creating $ac_file" >&5
21498 echo "$as_me: creating $ac_file" >&6;}
21499
21500   # First look for the input files in the build tree, otherwise in the
21501   # src tree.
21502   ac_file_inputs=`IFS=:
21503     for f in $ac_file_in; do
21504       case $f in
21505       -) echo $tmp/stdin ;;
21506       [\\/$]*)
21507          # Absolute (can't be DOS-style, as IFS=:)
21508          test -f "$f" || { { echo "$as_me:21508: error: cannot find input file: $f" >&5
21509 echo "$as_me: error: cannot find input file: $f" >&2;}
21510    { (exit 1); exit 1; }; }
21511          echo $f;;
21512       *) # Relative
21513          if test -f "$f"; then
21514            # Build tree
21515            echo $f
21516          elif test -f "$srcdir/$f"; then
21517            # Source tree
21518            echo $srcdir/$f
21519          else
21520            # /dev/null tree
21521            { { echo "$as_me:21521: error: cannot find input file: $f" >&5
21522 echo "$as_me: error: cannot find input file: $f" >&2;}
21523    { (exit 1); exit 1; }; }
21524          fi;;
21525       esac
21526     done` || { (exit 1); exit 1; }
21527   # Remove the trailing spaces.
21528   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
21529
21530 EOF
21531
21532 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
21533 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
21534 # be either 'cat' or 'sort'.
21535 cat confdefs.h | uniq >conftest.vals
21536
21537 # Break up conftest.vals because some shells have a limit on
21538 # the size of here documents, and old seds have small limits too.
21539
21540 rm -f conftest.tail
21541 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
21542 while grep . conftest.vals >/dev/null
21543 do
21544   # Write chunks of a limited-size here document to conftest.frag.
21545   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
21546   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
21547   echo 'CEOF' >> $CONFIG_STATUS
21548   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
21549   rm -f conftest.vals
21550   mv conftest.tail conftest.vals
21551 done
21552 rm -f conftest.vals
21553
21554 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
21555 # marker @DEFS@.
21556 echo '  cat >> conftest.edit <<CEOF
21557 /@DEFS@/r conftest.frag
21558 /@DEFS@/d
21559 CEOF
21560 sed -f conftest.edit $tmp/in > $tmp/out
21561 rm -f $tmp/in
21562 mv $tmp/out $tmp/in
21563 rm -f conftest.edit conftest.frag
21564 ' >> $CONFIG_STATUS
21565
21566 cat >>$CONFIG_STATUS <<\EOF
21567   # Let's still pretend it is `configure' which instantiates (i.e., don't
21568   # use $as_me), people would be surprised to read:
21569   #    /* config.h.  Generated automatically by config.status.  */
21570   if test x"$ac_file" = x-; then
21571     echo "/* Generated automatically by configure.  */" >$tmp/config.h
21572   else
21573     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
21574   fi
21575   cat $tmp/in >>$tmp/config.h
21576   rm -f $tmp/in
21577   if test x"$ac_file" != x-; then
21578     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
21579       { echo "$as_me:21579: $ac_file is unchanged" >&5
21580 echo "$as_me: $ac_file is unchanged" >&6;}
21581     else
21582       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21583          X"$ac_file" : 'X\(//\)[^/]' \| \
21584          X"$ac_file" : 'X\(//\)$' \| \
21585          X"$ac_file" : 'X\(/\)' \| \
21586          .     : '\(.\)' 2>/dev/null ||
21587 echo X"$ac_file" |
21588     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21589           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21590           /^X\(\/\/\)$/{ s//\1/; q; }
21591           /^X\(\/\).*/{ s//\1/; q; }
21592           s/.*/./; q'`
21593       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21594         { case "$ac_dir" in
21595   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21596   *)                      as_incr_dir=.;;
21597 esac
21598 as_dummy="$ac_dir"
21599 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21600   case $as_mkdir_dir in
21601     # Skip DOS drivespec
21602     ?:) as_incr_dir=$as_mkdir_dir ;;
21603     *)
21604       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21605       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21606     ;;
21607   esac
21608 done; }
21609
21610       fi
21611       rm -f $ac_file
21612       mv $tmp/config.h $ac_file
21613     fi
21614   else
21615     cat $tmp/config.h
21616     rm -f $tmp/config.h
21617   fi
21618 done
21619 EOF
21620 cat >>$CONFIG_STATUS <<\EOF
21621 #
21622 # CONFIG_COMMANDS section.
21623 #
21624 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
21625   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
21626   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
21627
21628   case $ac_dest in
21629     default )
21630
21631 for cf_dir in .
21632 do
21633         if test ! -d $srcdir/$cf_dir; then
21634                 continue
21635         elif test -f $srcdir/$cf_dir/programs; then
21636                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
21637         fi
21638 done
21639
21640         cat >>Makefile <<TEST_EOF
21641
21642 # These rules are generated so we do not rely on suffix rules, which do not
21643 # work consistently for different make-programs (the '\$(MODEL)/' confuses
21644 # some, and the '\$x' confuses others).
21645 TEST_EOF
21646
21647 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
21648 for N in $LIST
21649 do
21650         cat >>Makefile <<TEST_EOF
21651
21652 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
21653         \$(srcdir)/test.priv.h \\
21654         ncurses_cfg.h
21655         $SHOW_CC
21656         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
21657 TEST_EOF
21658 done
21659
21660 if test -f ../config.guess && test -f ../config.sub
21661 then
21662         cat >>Makefile <<TEST_EOF
21663
21664 # if we used CF_INHERIT for getting these files, we can remove them
21665 distclean::
21666         rm -f config.guess config.sub
21667 TEST_EOF
21668 fi
21669  ;;
21670   esac
21671 done
21672 EOF
21673
21674 cat >>$CONFIG_STATUS <<\EOF
21675
21676 { (exit 0); exit 0; }
21677 EOF
21678 chmod +x $CONFIG_STATUS
21679 ac_clean_files=$ac_clean_files_save
21680
21681 # configure is writing to config.log, and then calls config.status.
21682 # config.status does its own redirection, appending to config.log.
21683 # Unfortunately, on DOS this fails, as config.log is still kept open
21684 # by configure, so config.status won't be able to write to it; its
21685 # output is simply discarded.  So we exec the FD to /dev/null,
21686 # effectively closing config.log, so it can be properly (re)opened and
21687 # appended to by config.status.  When coming back to configure, we
21688 # need to make the FD available again.
21689 if test "$no_create" != yes; then
21690   ac_cs_success=:
21691   exec 5>/dev/null
21692   $SHELL $CONFIG_STATUS || ac_cs_success=false
21693   exec 5>>config.log
21694   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
21695   # would make configure fail if this is the last instruction.
21696   $ac_cs_success || { (exit 1); exit 1; }
21697 fi
21698