]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20200523
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20200111.
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   --with-form-libname=XXX override form basename of library
690   --with-menu-libname=XXX override menu basename of library
691   --with-panel-libname=XXX override panel basename of library
692   --disable-panel         disable checks for panel functions
693   --disable-menu          disable checks for menu functions
694   --disable-form          disable checks for form functions
695 Testing/development Options:
696   --enable-warnings       test: turn on gcc compiler warnings
697   --with-dmalloc          test: use Gray Watson's dmalloc library
698   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
699   --with-valgrind         test: use valgrind
700   --disable-leaks         test: free permanent memory, analyze leaks
701   --disable-rpath-hack    don't add rpath options for additional libraries
702
703 Some influential environment variables:
704   CC          C compiler command
705   CFLAGS      C compiler flags
706   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
707               nonstandard directory <lib dir>
708   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
709               headers in a nonstandard directory <include dir>
710   CPP         C preprocessor
711
712 Use these variables to override the choices made by `configure' or to help
713 it to find libraries and programs with nonstandard names/locations.
714
715 EOF
716 fi
717
718 if test "$ac_init_help" = "recursive"; then
719   # If there are subdirs, report their specific --help.
720   ac_popdir=`pwd`
721   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
722     cd $ac_subdir
723     # A "../" for each directory in /$ac_subdir.
724     ac_dots=`echo $ac_subdir |
725              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
726
727     case $srcdir in
728     .) # No --srcdir option.  We are building in place.
729       ac_sub_srcdir=$srcdir ;;
730     [\\/]* | ?:[\\/]* ) # Absolute path.
731       ac_sub_srcdir=$srcdir/$ac_subdir ;;
732     *) # Relative path.
733       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
734     esac
735
736     # Check for guested configure; otherwise get Cygnus style configure.
737     if test -f $ac_sub_srcdir/configure.gnu; then
738       echo
739       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
740     elif test -f $ac_sub_srcdir/configure; then
741       echo
742       $SHELL $ac_sub_srcdir/configure  --help=recursive
743     elif test -f $ac_sub_srcdir/configure.ac ||
744            test -f $ac_sub_srcdir/configure.in; then
745       echo
746       $ac_configure --help
747     else
748       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
749     fi
750     cd $ac_popdir
751   done
752 fi
753
754 test -n "$ac_init_help" && exit 0
755 if $ac_init_version; then
756   cat <<\EOF
757
758 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
759 Free Software Foundation, Inc.
760 This configure script is free software; the Free Software Foundation
761 gives unlimited permission to copy, distribute and modify it.
762 EOF
763   exit 0
764 fi
765 exec 5>config.log
766 cat >&5 <<EOF
767 This file contains any messages produced by compilers while
768 running configure, to aid debugging if configure makes a mistake.
769
770 It was created by $as_me, which was
771 generated by GNU Autoconf 2.52.20200111.  Invocation command line was
772
773   $ $0 $@
774
775 EOF
776 {
777 cat <<_ASUNAME
778 ## ---------- ##
779 ## Platform.  ##
780 ## ---------- ##
781
782 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
783 uname -m = `(uname -m) 2>/dev/null || echo unknown`
784 uname -r = `(uname -r) 2>/dev/null || echo unknown`
785 uname -s = `(uname -s) 2>/dev/null || echo unknown`
786 uname -v = `(uname -v) 2>/dev/null || echo unknown`
787
788 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
789 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
790
791 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
792 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
793 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
794 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
795 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
796 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
797 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
798
799 PATH = $PATH
800
801 _ASUNAME
802 } >&5
803
804 cat >&5 <<EOF
805 ## ------------ ##
806 ## Core tests.  ##
807 ## ------------ ##
808
809 EOF
810
811 # Keep a trace of the command line.
812 # Strip out --no-create and --no-recursion so they do not pile up.
813 # Also quote any args containing shell meta-characters.
814 ac_configure_args=
815 ac_sep=
816 for ac_arg
817 do
818   case $ac_arg in
819   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
820   | --no-cr | --no-c) ;;
821   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
822   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
823   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
824     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
825     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
826     ac_sep=" " ;;
827   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
828      ac_sep=" " ;;
829   esac
830   # Get rid of the leading space.
831 done
832
833 # When interrupted or exit'd, cleanup temporary files, and complete
834 # config.log.  We remove comments because anyway the quotes in there
835 # would cause problems or look ugly.
836 trap 'exit_status=$?
837   # Save into config.log some information that might help in debugging.
838   echo >&5
839   echo "## ----------------- ##" >&5
840   echo "## Cache variables.  ##" >&5
841   echo "## ----------------- ##" >&5
842   echo >&5
843   # The following way of writing the cache mishandles newlines in values,
844 {
845   (set) 2>&1 |
846     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
847     *ac_space=\ *)
848       sed -n \
849         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
850           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
851       ;;
852     *)
853       sed -n \
854         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
855       ;;
856     esac;
857 } >&5
858   sed "/^$/d" confdefs.h >conftest.log
859   if test -s conftest.log; then
860     echo >&5
861     echo "## ------------ ##" >&5
862     echo "## confdefs.h.  ##" >&5
863     echo "## ------------ ##" >&5
864     echo >&5
865     cat conftest.log >&5
866   fi
867   (echo; echo) >&5
868   test "$ac_signal" != 0 &&
869     echo "$as_me: caught signal $ac_signal" >&5
870   echo "$as_me: exit $exit_status" >&5
871   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
872     exit $exit_status
873      ' 0
874 for ac_signal in 1 2 13 15; do
875   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
876 done
877 ac_signal=0
878
879 # confdefs.h avoids OS command line length limits that DEFS can exceed.
880 rm -rf conftest* confdefs.h
881 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
882 echo >confdefs.h
883
884 # Let the site file select an alternate cache file if it wants to.
885 # Prefer explicitly selected file to automatically selected ones.
886 if test -z "$CONFIG_SITE"; then
887   if test "x$prefix" != xNONE; then
888     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
889   else
890     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
891   fi
892 fi
893 for ac_site_file in $CONFIG_SITE; do
894   if test -r "$ac_site_file"; then
895     { echo "$as_me:895: loading site script $ac_site_file" >&5
896 echo "$as_me: loading site script $ac_site_file" >&6;}
897     cat "$ac_site_file" >&5
898     . "$ac_site_file"
899   fi
900 done
901
902 if test -r "$cache_file"; then
903   # Some versions of bash will fail to source /dev/null (special
904   # files actually), so we avoid doing that.
905   if test -f "$cache_file"; then
906     { echo "$as_me:906: loading cache $cache_file" >&5
907 echo "$as_me: loading cache $cache_file" >&6;}
908     case $cache_file in
909       [\\/]* | ?:[\\/]* ) . $cache_file;;
910       *)                      . ./$cache_file;;
911     esac
912   fi
913 else
914   { echo "$as_me:914: creating cache $cache_file" >&5
915 echo "$as_me: creating cache $cache_file" >&6;}
916   >$cache_file
917 fi
918
919 # Check that the precious variables saved in the cache have kept the same
920 # value.
921 ac_cache_corrupted=false
922 for ac_var in `(set) 2>&1 |
923                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
924   eval ac_old_set=\$ac_cv_env_${ac_var}_set
925   eval ac_new_set=\$ac_env_${ac_var}_set
926   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
927   eval ac_new_val="\$ac_env_${ac_var}_value"
928   case $ac_old_set,$ac_new_set in
929     set,)
930       { echo "$as_me:930: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
931 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
932       ac_cache_corrupted=: ;;
933     ,set)
934       { echo "$as_me:934: error: \`$ac_var' was not set in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,);;
938     *)
939       if test "x$ac_old_val" != "x$ac_new_val"; then
940         { echo "$as_me:940: error: \`$ac_var' has changed since the previous run:" >&5
941 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
942         { echo "$as_me:942:   former value:  $ac_old_val" >&5
943 echo "$as_me:   former value:  $ac_old_val" >&2;}
944         { echo "$as_me:944:   current value: $ac_new_val" >&5
945 echo "$as_me:   current value: $ac_new_val" >&2;}
946         ac_cache_corrupted=:
947       fi;;
948   esac
949   # Pass precious variables to config.status.  It doesn't matter if
950   # we pass some twice (in addition to the command line arguments).
951   if test "$ac_new_set" = set; then
952     case $ac_new_val in
953     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
954       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
955       ac_configure_args="$ac_configure_args '$ac_arg'"
956       ;;
957     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
958        ;;
959     esac
960   fi
961 done
962 if $ac_cache_corrupted; then
963   { echo "$as_me:963: error: changes in the environment can compromise the build" >&5
964 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
965   { { echo "$as_me:965: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
966 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
967    { (exit 1); exit 1; }; }
968 fi
969
970 ac_ext=c
971 ac_cpp='$CPP $CPPFLAGS'
972 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
973 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
974 ac_compiler_gnu=$ac_cv_c_compiler_gnu
975 ac_main_return=return
976
977 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
978   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
979                    ECHO_T='     ' ;;
980   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
981   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
982 esac
983 echo "#! $SHELL" >conftest.sh
984 echo  "exit 0"   >>conftest.sh
985 chmod +x conftest.sh
986 if { (echo "$as_me:986: PATH=\".;.\"; conftest.sh") >&5
987   (PATH=".;."; conftest.sh) 2>&5
988   ac_status=$?
989   echo "$as_me:989: \$? = $ac_status" >&5
990   (exit $ac_status); }; then
991   ac_path_separator=';'
992 else
993   ac_path_separator=:
994 fi
995 PATH_SEPARATOR="$ac_path_separator"
996 rm -f conftest.sh
997
998 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
999
1000 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1001
1002 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1003
1004 ac_aux_dir=
1005 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1006   if test -f $ac_dir/install-sh; then
1007     ac_aux_dir=$ac_dir
1008     ac_install_sh="$ac_aux_dir/install-sh -c"
1009     break
1010   elif test -f $ac_dir/install.sh; then
1011     ac_aux_dir=$ac_dir
1012     ac_install_sh="$ac_aux_dir/install.sh -c"
1013     break
1014   elif test -f $ac_dir/shtool; then
1015     ac_aux_dir=$ac_dir
1016     ac_install_sh="$ac_aux_dir/shtool install -c"
1017     break
1018   fi
1019 done
1020 if test -z "$ac_aux_dir"; then
1021   { { echo "$as_me:1021: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1022 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1023    { (exit 1); exit 1; }; }
1024 fi
1025 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1026 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1027 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1028
1029 # Make sure we can run config.sub.
1030 $ac_config_sub sun4 >/dev/null 2>&1 ||
1031   { { echo "$as_me:1031: error: cannot run $ac_config_sub" >&5
1032 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1033    { (exit 1); exit 1; }; }
1034
1035 echo "$as_me:1035: checking build system type" >&5
1036 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1037 if test "${ac_cv_build+set}" = set; then
1038   echo $ECHO_N "(cached) $ECHO_C" >&6
1039 else
1040   ac_cv_build_alias=$build_alias
1041 test -z "$ac_cv_build_alias" &&
1042   ac_cv_build_alias=`$ac_config_guess`
1043 test -z "$ac_cv_build_alias" &&
1044   { { echo "$as_me:1044: error: cannot guess build type; you must specify one" >&5
1045 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1046    { (exit 1); exit 1; }; }
1047 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1048   { { echo "$as_me:1048: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1049 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1050    { (exit 1); exit 1; }; }
1051
1052 fi
1053 echo "$as_me:1053: result: $ac_cv_build" >&5
1054 echo "${ECHO_T}$ac_cv_build" >&6
1055 build=$ac_cv_build
1056 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1057 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1058 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1059
1060 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1061         echo "$as_me:1061: checking host system type" >&5
1062 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1063 if test "${ac_cv_host+set}" = set; then
1064   echo $ECHO_N "(cached) $ECHO_C" >&6
1065 else
1066   ac_cv_host_alias=$host_alias
1067 test -z "$ac_cv_host_alias" &&
1068   ac_cv_host_alias=$ac_cv_build_alias
1069 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1070   { { echo "$as_me:1070: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1071 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1072    { (exit 1); exit 1; }; }
1073
1074 fi
1075 echo "$as_me:1075: result: $ac_cv_host" >&5
1076 echo "${ECHO_T}$ac_cv_host" >&6
1077 host=$ac_cv_host
1078 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1079 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1080 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1081
1082         system_name="$host_os"
1083 else
1084         system_name="`(uname -s -r) 2>/dev/null`"
1085         if test -z "$system_name" ; then
1086                 system_name="`(hostname) 2>/dev/null`"
1087         fi
1088 fi
1089 test -n "$system_name" &&
1090 cat >>confdefs.h <<EOF
1091 #define SYSTEM_NAME "$system_name"
1092 EOF
1093
1094 if test "${cf_cv_system_name+set}" = set; then
1095   echo $ECHO_N "(cached) $ECHO_C" >&6
1096 else
1097   cf_cv_system_name="$system_name"
1098 fi
1099
1100 test -z "$system_name" && system_name="$cf_cv_system_name"
1101 test -n "$cf_cv_system_name" && echo "$as_me:1101: result: Configuring for $cf_cv_system_name" >&5
1102 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1103
1104 if test ".$system_name" != ".$cf_cv_system_name" ; then
1105         echo "$as_me:1105: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1106 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1107         { { echo "$as_me:1107: error: \"Please remove config.cache and try again.\"" >&5
1108 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1109    { (exit 1); exit 1; }; }
1110 fi
1111
1112 test "$program_prefix" != NONE &&
1113   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1114 # Use a double $ so make ignores it.
1115 test "$program_suffix" != NONE &&
1116   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1117 # Double any \ or $.  echo might interpret backslashes.
1118 # By default was `s,x,x', remove it if useless.
1119 cat <<\_ACEOF >conftest.sed
1120 s/[\\$]/&&/g;s/;s,x,x,$//
1121 _ACEOF
1122 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1123 rm conftest.sed
1124
1125 echo "$as_me:1125: checking whether ${MAKE-make} sets \${MAKE}" >&5
1126 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1127 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1128 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1129   echo $ECHO_N "(cached) $ECHO_C" >&6
1130 else
1131   cat >conftest.make <<\EOF
1132 all:
1133         @echo 'ac_maketemp="${MAKE}"'
1134 EOF
1135 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1136 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1137 if test -n "$ac_maketemp"; then
1138   eval ac_cv_prog_make_${ac_make}_set=yes
1139 else
1140   eval ac_cv_prog_make_${ac_make}_set=no
1141 fi
1142 rm -f conftest.make
1143 fi
1144 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1145   echo "$as_me:1145: result: yes" >&5
1146 echo "${ECHO_T}yes" >&6
1147   SET_MAKE=
1148 else
1149   echo "$as_me:1149: result: no" >&5
1150 echo "${ECHO_T}no" >&6
1151   SET_MAKE="MAKE=${MAKE-make}"
1152 fi
1153
1154 ac_ext=c
1155 ac_cpp='$CPP $CPPFLAGS'
1156 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1157 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1158 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1159 ac_main_return=return
1160 if test -n "$ac_tool_prefix"; then
1161   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1162 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1163 echo "$as_me:1163: checking for $ac_word" >&5
1164 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1165 if test "${ac_cv_prog_CC+set}" = set; then
1166   echo $ECHO_N "(cached) $ECHO_C" >&6
1167 else
1168   if test -n "$CC"; then
1169   ac_cv_prog_CC="$CC" # Let the user override the test.
1170 else
1171   ac_save_IFS=$IFS; IFS=$ac_path_separator
1172 ac_dummy="$PATH"
1173 for ac_dir in $ac_dummy; do
1174   IFS=$ac_save_IFS
1175   test -z "$ac_dir" && ac_dir=.
1176   $as_executable_p "$ac_dir/$ac_word" || continue
1177 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1178 echo "$as_me:1178: found $ac_dir/$ac_word" >&5
1179 break
1180 done
1181
1182 fi
1183 fi
1184 CC=$ac_cv_prog_CC
1185 if test -n "$CC"; then
1186   echo "$as_me:1186: result: $CC" >&5
1187 echo "${ECHO_T}$CC" >&6
1188 else
1189   echo "$as_me:1189: result: no" >&5
1190 echo "${ECHO_T}no" >&6
1191 fi
1192
1193 fi
1194 if test -z "$ac_cv_prog_CC"; then
1195   ac_ct_CC=$CC
1196   # Extract the first word of "gcc", so it can be a program name with args.
1197 set dummy gcc; ac_word=$2
1198 echo "$as_me:1198: checking for $ac_word" >&5
1199 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1200 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1201   echo $ECHO_N "(cached) $ECHO_C" >&6
1202 else
1203   if test -n "$ac_ct_CC"; then
1204   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1205 else
1206   ac_save_IFS=$IFS; IFS=$ac_path_separator
1207 ac_dummy="$PATH"
1208 for ac_dir in $ac_dummy; do
1209   IFS=$ac_save_IFS
1210   test -z "$ac_dir" && ac_dir=.
1211   $as_executable_p "$ac_dir/$ac_word" || continue
1212 ac_cv_prog_ac_ct_CC="gcc"
1213 echo "$as_me:1213: found $ac_dir/$ac_word" >&5
1214 break
1215 done
1216
1217 fi
1218 fi
1219 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1220 if test -n "$ac_ct_CC"; then
1221   echo "$as_me:1221: result: $ac_ct_CC" >&5
1222 echo "${ECHO_T}$ac_ct_CC" >&6
1223 else
1224   echo "$as_me:1224: result: no" >&5
1225 echo "${ECHO_T}no" >&6
1226 fi
1227
1228   CC=$ac_ct_CC
1229 else
1230   CC="$ac_cv_prog_CC"
1231 fi
1232
1233 if test -z "$CC"; then
1234   if test -n "$ac_tool_prefix"; then
1235   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1236 set dummy ${ac_tool_prefix}cc; ac_word=$2
1237 echo "$as_me:1237: checking for $ac_word" >&5
1238 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1239 if test "${ac_cv_prog_CC+set}" = set; then
1240   echo $ECHO_N "(cached) $ECHO_C" >&6
1241 else
1242   if test -n "$CC"; then
1243   ac_cv_prog_CC="$CC" # Let the user override the test.
1244 else
1245   ac_save_IFS=$IFS; IFS=$ac_path_separator
1246 ac_dummy="$PATH"
1247 for ac_dir in $ac_dummy; do
1248   IFS=$ac_save_IFS
1249   test -z "$ac_dir" && ac_dir=.
1250   $as_executable_p "$ac_dir/$ac_word" || continue
1251 ac_cv_prog_CC="${ac_tool_prefix}cc"
1252 echo "$as_me:1252: found $ac_dir/$ac_word" >&5
1253 break
1254 done
1255
1256 fi
1257 fi
1258 CC=$ac_cv_prog_CC
1259 if test -n "$CC"; then
1260   echo "$as_me:1260: result: $CC" >&5
1261 echo "${ECHO_T}$CC" >&6
1262 else
1263   echo "$as_me:1263: result: no" >&5
1264 echo "${ECHO_T}no" >&6
1265 fi
1266
1267 fi
1268 if test -z "$ac_cv_prog_CC"; then
1269   ac_ct_CC=$CC
1270   # Extract the first word of "cc", so it can be a program name with args.
1271 set dummy cc; ac_word=$2
1272 echo "$as_me:1272: checking for $ac_word" >&5
1273 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1274 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1275   echo $ECHO_N "(cached) $ECHO_C" >&6
1276 else
1277   if test -n "$ac_ct_CC"; then
1278   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1279 else
1280   ac_save_IFS=$IFS; IFS=$ac_path_separator
1281 ac_dummy="$PATH"
1282 for ac_dir in $ac_dummy; do
1283   IFS=$ac_save_IFS
1284   test -z "$ac_dir" && ac_dir=.
1285   $as_executable_p "$ac_dir/$ac_word" || continue
1286 ac_cv_prog_ac_ct_CC="cc"
1287 echo "$as_me:1287: found $ac_dir/$ac_word" >&5
1288 break
1289 done
1290
1291 fi
1292 fi
1293 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1294 if test -n "$ac_ct_CC"; then
1295   echo "$as_me:1295: result: $ac_ct_CC" >&5
1296 echo "${ECHO_T}$ac_ct_CC" >&6
1297 else
1298   echo "$as_me:1298: result: no" >&5
1299 echo "${ECHO_T}no" >&6
1300 fi
1301
1302   CC=$ac_ct_CC
1303 else
1304   CC="$ac_cv_prog_CC"
1305 fi
1306
1307 fi
1308 if test -z "$CC"; then
1309   # Extract the first word of "cc", so it can be a program name with args.
1310 set dummy cc; ac_word=$2
1311 echo "$as_me:1311: checking for $ac_word" >&5
1312 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1313 if test "${ac_cv_prog_CC+set}" = set; then
1314   echo $ECHO_N "(cached) $ECHO_C" >&6
1315 else
1316   if test -n "$CC"; then
1317   ac_cv_prog_CC="$CC" # Let the user override the test.
1318 else
1319   ac_prog_rejected=no
1320   ac_save_IFS=$IFS; IFS=$ac_path_separator
1321 ac_dummy="$PATH"
1322 for ac_dir in $ac_dummy; do
1323   IFS=$ac_save_IFS
1324   test -z "$ac_dir" && ac_dir=.
1325   $as_executable_p "$ac_dir/$ac_word" || continue
1326 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1327   ac_prog_rejected=yes
1328   continue
1329 fi
1330 ac_cv_prog_CC="cc"
1331 echo "$as_me:1331: found $ac_dir/$ac_word" >&5
1332 break
1333 done
1334
1335 if test $ac_prog_rejected = yes; then
1336   # We found a bogon in the path, so make sure we never use it.
1337   set dummy $ac_cv_prog_CC
1338   shift
1339   if test $# != 0; then
1340     # We chose a different compiler from the bogus one.
1341     # However, it has the same basename, so the bogon will be chosen
1342     # first if we set CC to just the basename; use the full file name.
1343     shift
1344     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1345     shift
1346     ac_cv_prog_CC="$@"
1347   fi
1348 fi
1349 fi
1350 fi
1351 CC=$ac_cv_prog_CC
1352 if test -n "$CC"; then
1353   echo "$as_me:1353: result: $CC" >&5
1354 echo "${ECHO_T}$CC" >&6
1355 else
1356   echo "$as_me:1356: result: no" >&5
1357 echo "${ECHO_T}no" >&6
1358 fi
1359
1360 fi
1361 if test -z "$CC"; then
1362   if test -n "$ac_tool_prefix"; then
1363   for ac_prog in cl
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in cl
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 fi
1443
1444 test -z "$CC" && { { echo "$as_me:1444: error: no acceptable cc found in \$PATH" >&5
1445 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1446    { (exit 1); exit 1; }; }
1447
1448 # Provide some information about the compiler.
1449 echo "$as_me:1449:" \
1450      "checking for C compiler version" >&5
1451 ac_compiler=`set X $ac_compile; echo $2`
1452 { (eval echo "$as_me:1452: \"$ac_compiler --version </dev/null >&5\"") >&5
1453   (eval $ac_compiler --version </dev/null >&5) 2>&5
1454   ac_status=$?
1455   echo "$as_me:1455: \$? = $ac_status" >&5
1456   (exit $ac_status); }
1457 { (eval echo "$as_me:1457: \"$ac_compiler -v </dev/null >&5\"") >&5
1458   (eval $ac_compiler -v </dev/null >&5) 2>&5
1459   ac_status=$?
1460   echo "$as_me:1460: \$? = $ac_status" >&5
1461   (exit $ac_status); }
1462 { (eval echo "$as_me:1462: \"$ac_compiler -V </dev/null >&5\"") >&5
1463   (eval $ac_compiler -V </dev/null >&5) 2>&5
1464   ac_status=$?
1465   echo "$as_me:1465: \$? = $ac_status" >&5
1466   (exit $ac_status); }
1467
1468 cat >conftest.$ac_ext <<_ACEOF
1469 #line 1469 "configure"
1470 #include "confdefs.h"
1471
1472 int
1473 main (void)
1474 {
1475
1476   ;
1477   return 0;
1478 }
1479 _ACEOF
1480 ac_clean_files_save=$ac_clean_files
1481 ac_clean_files="$ac_clean_files a.out a.exe"
1482 # Try to create an executable without -o first, disregard a.out.
1483 # It will help us diagnose broken compilers, and finding out an intuition
1484 # of exeext.
1485 echo "$as_me:1485: checking for C compiler default output" >&5
1486 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1487 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1488 if { (eval echo "$as_me:1488: \"$ac_link_default\"") >&5
1489   (eval $ac_link_default) 2>&5
1490   ac_status=$?
1491   echo "$as_me:1491: \$? = $ac_status" >&5
1492   (exit $ac_status); }; then
1493   # Find the output, starting from the most likely.  This scheme is
1494 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1495 # resort.
1496 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1497                 ls a.out conftest 2>/dev/null;
1498                 ls a.* conftest.* 2>/dev/null`; do
1499   case $ac_file in
1500     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1501     a.out ) # We found the default executable, but exeext='' is most
1502             # certainly right.
1503             break;;
1504     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1505           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1506           export ac_cv_exeext
1507           break;;
1508     * ) break;;
1509   esac
1510 done
1511 else
1512   echo "$as_me: failed program was:" >&5
1513 cat conftest.$ac_ext >&5
1514 { { echo "$as_me:1514: error: C compiler cannot create executables" >&5
1515 echo "$as_me: error: C compiler cannot create executables" >&2;}
1516    { (exit 77); exit 77; }; }
1517 fi
1518
1519 ac_exeext=$ac_cv_exeext
1520 echo "$as_me:1520: result: $ac_file" >&5
1521 echo "${ECHO_T}$ac_file" >&6
1522
1523 # Check the compiler produces executables we can run.  If not, either
1524 # the compiler is broken, or we cross compile.
1525 echo "$as_me:1525: checking whether the C compiler works" >&5
1526 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1527 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1528 # If not cross compiling, check that we can run a simple program.
1529 if test "$cross_compiling" != yes; then
1530   if { ac_try='./$ac_file'
1531   { (eval echo "$as_me:1531: \"$ac_try\"") >&5
1532   (eval $ac_try) 2>&5
1533   ac_status=$?
1534   echo "$as_me:1534: \$? = $ac_status" >&5
1535   (exit $ac_status); }; }; then
1536     cross_compiling=no
1537   else
1538     if test "$cross_compiling" = maybe; then
1539         cross_compiling=yes
1540     else
1541         { { echo "$as_me:1541: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&5
1543 echo "$as_me: error: cannot run C compiled programs.
1544 If you meant to cross compile, use \`--host'." >&2;}
1545    { (exit 1); exit 1; }; }
1546     fi
1547   fi
1548 fi
1549 echo "$as_me:1549: result: yes" >&5
1550 echo "${ECHO_T}yes" >&6
1551
1552 rm -f a.out a.exe conftest$ac_cv_exeext
1553 ac_clean_files=$ac_clean_files_save
1554 # Check the compiler produces executables we can run.  If not, either
1555 # the compiler is broken, or we cross compile.
1556 echo "$as_me:1556: checking whether we are cross compiling" >&5
1557 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1558 echo "$as_me:1558: result: $cross_compiling" >&5
1559 echo "${ECHO_T}$cross_compiling" >&6
1560
1561 echo "$as_me:1561: checking for executable suffix" >&5
1562 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1563 if { (eval echo "$as_me:1563: \"$ac_link\"") >&5
1564   (eval $ac_link) 2>&5
1565   ac_status=$?
1566   echo "$as_me:1566: \$? = $ac_status" >&5
1567   (exit $ac_status); }; then
1568   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1569 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1570 # work properly (i.e., refer to `conftest.exe'), while it won't with
1571 # `rm'.
1572 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1573   case $ac_file in
1574     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1575     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1576           export ac_cv_exeext
1577           break;;
1578     * ) break;;
1579   esac
1580 done
1581 else
1582   { { echo "$as_me:1582: error: cannot compute EXEEXT: cannot compile and link" >&5
1583 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1584    { (exit 1); exit 1; }; }
1585 fi
1586
1587 rm -f conftest$ac_cv_exeext
1588 echo "$as_me:1588: result: $ac_cv_exeext" >&5
1589 echo "${ECHO_T}$ac_cv_exeext" >&6
1590
1591 rm -f conftest.$ac_ext
1592 EXEEXT=$ac_cv_exeext
1593 ac_exeext=$EXEEXT
1594 echo "$as_me:1594: checking for object suffix" >&5
1595 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1596 if test "${ac_cv_objext+set}" = set; then
1597   echo $ECHO_N "(cached) $ECHO_C" >&6
1598 else
1599   cat >conftest.$ac_ext <<_ACEOF
1600 #line 1600 "configure"
1601 #include "confdefs.h"
1602
1603 int
1604 main (void)
1605 {
1606
1607   ;
1608   return 0;
1609 }
1610 _ACEOF
1611 rm -f conftest.o conftest.obj
1612 if { (eval echo "$as_me:1612: \"$ac_compile\"") >&5
1613   (eval $ac_compile) 2>&5
1614   ac_status=$?
1615   echo "$as_me:1615: \$? = $ac_status" >&5
1616   (exit $ac_status); }; then
1617   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1618   case $ac_file in
1619     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1620     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1621        break;;
1622   esac
1623 done
1624 else
1625   echo "$as_me: failed program was:" >&5
1626 cat conftest.$ac_ext >&5
1627 { { echo "$as_me:1627: error: cannot compute OBJEXT: cannot compile" >&5
1628 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1629    { (exit 1); exit 1; }; }
1630 fi
1631
1632 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1633 fi
1634 echo "$as_me:1634: result: $ac_cv_objext" >&5
1635 echo "${ECHO_T}$ac_cv_objext" >&6
1636 OBJEXT=$ac_cv_objext
1637 ac_objext=$OBJEXT
1638 echo "$as_me:1638: checking whether we are using the GNU C compiler" >&5
1639 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1640 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1641   echo $ECHO_N "(cached) $ECHO_C" >&6
1642 else
1643   cat >conftest.$ac_ext <<_ACEOF
1644 #line 1644 "configure"
1645 #include "confdefs.h"
1646
1647 int
1648 main (void)
1649 {
1650 #ifndef __GNUC__
1651        choke me
1652 #endif
1653
1654   ;
1655   return 0;
1656 }
1657 _ACEOF
1658 rm -f conftest.$ac_objext
1659 if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5
1660   (eval $ac_compile) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit $ac_status); } &&
1664          { ac_try='test -s conftest.$ac_objext'
1665   { (eval echo "$as_me:1665: \"$ac_try\"") >&5
1666   (eval $ac_try) 2>&5
1667   ac_status=$?
1668   echo "$as_me:1668: \$? = $ac_status" >&5
1669   (exit $ac_status); }; }; then
1670   ac_compiler_gnu=yes
1671 else
1672   echo "$as_me: failed program was:" >&5
1673 cat conftest.$ac_ext >&5
1674 ac_compiler_gnu=no
1675 fi
1676 rm -f conftest.$ac_objext conftest.$ac_ext
1677 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1678
1679 fi
1680 echo "$as_me:1680: result: $ac_cv_c_compiler_gnu" >&5
1681 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1682 GCC=`test $ac_compiler_gnu = yes && echo yes`
1683 ac_test_CFLAGS=${CFLAGS+set}
1684 ac_save_CFLAGS=$CFLAGS
1685 CFLAGS="-g"
1686 echo "$as_me:1686: checking whether $CC accepts -g" >&5
1687 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1688 if test "${ac_cv_prog_cc_g+set}" = set; then
1689   echo $ECHO_N "(cached) $ECHO_C" >&6
1690 else
1691   cat >conftest.$ac_ext <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694
1695 int
1696 main (void)
1697 {
1698
1699   ;
1700   return 0;
1701 }
1702 _ACEOF
1703 rm -f conftest.$ac_objext
1704 if { (eval echo "$as_me:1704: \"$ac_compile\"") >&5
1705   (eval $ac_compile) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit $ac_status); } &&
1709          { ac_try='test -s conftest.$ac_objext'
1710   { (eval echo "$as_me:1710: \"$ac_try\"") >&5
1711   (eval $ac_try) 2>&5
1712   ac_status=$?
1713   echo "$as_me:1713: \$? = $ac_status" >&5
1714   (exit $ac_status); }; }; then
1715   ac_cv_prog_cc_g=yes
1716 else
1717   echo "$as_me: failed program was:" >&5
1718 cat conftest.$ac_ext >&5
1719 ac_cv_prog_cc_g=no
1720 fi
1721 rm -f conftest.$ac_objext conftest.$ac_ext
1722 fi
1723 echo "$as_me:1723: result: $ac_cv_prog_cc_g" >&5
1724 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1725 if test "$ac_test_CFLAGS" = set; then
1726   CFLAGS=$ac_save_CFLAGS
1727 elif test $ac_cv_prog_cc_g = yes; then
1728   if test "$GCC" = yes; then
1729     CFLAGS="-g -O2"
1730   else
1731     CFLAGS="-g"
1732   fi
1733 else
1734   if test "$GCC" = yes; then
1735     CFLAGS="-O2"
1736   else
1737     CFLAGS=
1738   fi
1739 fi
1740 # Some people use a C++ compiler to compile C.  Since we use `exit',
1741 # in C++ we need to declare it.  In case someone uses the same compiler
1742 # for both compiling C and C++ we need to have the C++ compiler decide
1743 # the declaration of exit, since it's the most demanding environment.
1744 cat >conftest.$ac_ext <<_ACEOF
1745 #ifndef __cplusplus
1746   choke me
1747 #endif
1748 _ACEOF
1749 rm -f conftest.$ac_objext
1750 if { (eval echo "$as_me:1750: \"$ac_compile\"") >&5
1751   (eval $ac_compile) 2>&5
1752   ac_status=$?
1753   echo "$as_me:1753: \$? = $ac_status" >&5
1754   (exit $ac_status); } &&
1755          { ac_try='test -s conftest.$ac_objext'
1756   { (eval echo "$as_me:1756: \"$ac_try\"") >&5
1757   (eval $ac_try) 2>&5
1758   ac_status=$?
1759   echo "$as_me:1759: \$? = $ac_status" >&5
1760   (exit $ac_status); }; }; then
1761   for ac_declaration in \
1762    ''\
1763    '#include <stdlib.h>' \
1764    'extern "C" void std::exit (int) throw (); using std::exit;' \
1765    'extern "C" void std::exit (int); using std::exit;' \
1766    'extern "C" void exit (int) throw ();' \
1767    'extern "C" void exit (int);' \
1768    'void exit (int);'
1769 do
1770   cat >conftest.$ac_ext <<_ACEOF
1771 #line 1771 "configure"
1772 #include "confdefs.h"
1773 #include <stdlib.h>
1774 $ac_declaration
1775 int
1776 main (void)
1777 {
1778 exit (42);
1779   ;
1780   return 0;
1781 }
1782 _ACEOF
1783 rm -f conftest.$ac_objext
1784 if { (eval echo "$as_me:1784: \"$ac_compile\"") >&5
1785   (eval $ac_compile) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit $ac_status); } &&
1789          { ac_try='test -s conftest.$ac_objext'
1790   { (eval echo "$as_me:1790: \"$ac_try\"") >&5
1791   (eval $ac_try) 2>&5
1792   ac_status=$?
1793   echo "$as_me:1793: \$? = $ac_status" >&5
1794   (exit $ac_status); }; }; then
1795   :
1796 else
1797   echo "$as_me: failed program was:" >&5
1798 cat conftest.$ac_ext >&5
1799 continue
1800 fi
1801 rm -f conftest.$ac_objext conftest.$ac_ext
1802   cat >conftest.$ac_ext <<_ACEOF
1803 #line 1803 "configure"
1804 #include "confdefs.h"
1805 $ac_declaration
1806 int
1807 main (void)
1808 {
1809 exit (42);
1810   ;
1811   return 0;
1812 }
1813 _ACEOF
1814 rm -f conftest.$ac_objext
1815 if { (eval echo "$as_me:1815: \"$ac_compile\"") >&5
1816   (eval $ac_compile) 2>&5
1817   ac_status=$?
1818   echo "$as_me:1818: \$? = $ac_status" >&5
1819   (exit $ac_status); } &&
1820          { ac_try='test -s conftest.$ac_objext'
1821   { (eval echo "$as_me:1821: \"$ac_try\"") >&5
1822   (eval $ac_try) 2>&5
1823   ac_status=$?
1824   echo "$as_me:1824: \$? = $ac_status" >&5
1825   (exit $ac_status); }; }; then
1826   break
1827 else
1828   echo "$as_me: failed program was:" >&5
1829 cat conftest.$ac_ext >&5
1830 fi
1831 rm -f conftest.$ac_objext conftest.$ac_ext
1832 done
1833 rm -rf conftest*
1834 if test -n "$ac_declaration"; then
1835   echo '#ifdef __cplusplus' >>confdefs.h
1836   echo $ac_declaration      >>confdefs.h
1837   echo '#endif'             >>confdefs.h
1838 fi
1839
1840 else
1841   echo "$as_me: failed program was:" >&5
1842 cat conftest.$ac_ext >&5
1843 fi
1844 rm -f conftest.$ac_objext conftest.$ac_ext
1845 ac_ext=c
1846 ac_cpp='$CPP $CPPFLAGS'
1847 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1848 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1849 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1850 ac_main_return=return
1851
1852 GCC_VERSION=none
1853 if test "$GCC" = yes ; then
1854         echo "$as_me:1854: checking version of $CC" >&5
1855 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1856         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.].*//'`"
1857         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1858         echo "$as_me:1858: result: $GCC_VERSION" >&5
1859 echo "${ECHO_T}$GCC_VERSION" >&6
1860 fi
1861
1862 INTEL_COMPILER=no
1863
1864 if test "$GCC" = yes ; then
1865         case $host_os in
1866         (linux*|gnu*)
1867                 echo "$as_me:1867: checking if this is really Intel C compiler" >&5
1868 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1869                 cf_save_CFLAGS="$CFLAGS"
1870                 CFLAGS="$CFLAGS -no-gcc"
1871                 cat >conftest.$ac_ext <<_ACEOF
1872 #line 1872 "configure"
1873 #include "confdefs.h"
1874
1875 int
1876 main (void)
1877 {
1878
1879 #ifdef __INTEL_COMPILER
1880 #else
1881 make an error
1882 #endif
1883
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 rm -f conftest.$ac_objext
1889 if { (eval echo "$as_me:1889: \"$ac_compile\"") >&5
1890   (eval $ac_compile) 2>&5
1891   ac_status=$?
1892   echo "$as_me:1892: \$? = $ac_status" >&5
1893   (exit $ac_status); } &&
1894          { ac_try='test -s conftest.$ac_objext'
1895   { (eval echo "$as_me:1895: \"$ac_try\"") >&5
1896   (eval $ac_try) 2>&5
1897   ac_status=$?
1898   echo "$as_me:1898: \$? = $ac_status" >&5
1899   (exit $ac_status); }; }; then
1900   INTEL_COMPILER=yes
1901 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1902
1903 else
1904   echo "$as_me: failed program was:" >&5
1905 cat conftest.$ac_ext >&5
1906 fi
1907 rm -f conftest.$ac_objext conftest.$ac_ext
1908                 CFLAGS="$cf_save_CFLAGS"
1909                 echo "$as_me:1909: result: $INTEL_COMPILER" >&5
1910 echo "${ECHO_T}$INTEL_COMPILER" >&6
1911                 ;;
1912         esac
1913 fi
1914
1915 CLANG_COMPILER=no
1916
1917 if test "$GCC" = yes ; then
1918         echo "$as_me:1918: checking if this is really Clang C compiler" >&5
1919 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1920         cf_save_CFLAGS="$CFLAGS"
1921         CFLAGS="$CFLAGS -Qunused-arguments"
1922         cat >conftest.$ac_ext <<_ACEOF
1923 #line 1923 "configure"
1924 #include "confdefs.h"
1925
1926 int
1927 main (void)
1928 {
1929
1930 #ifdef __clang__
1931 #else
1932 make an error
1933 #endif
1934
1935   ;
1936   return 0;
1937 }
1938 _ACEOF
1939 rm -f conftest.$ac_objext
1940 if { (eval echo "$as_me:1940: \"$ac_compile\"") >&5
1941   (eval $ac_compile) 2>&5
1942   ac_status=$?
1943   echo "$as_me:1943: \$? = $ac_status" >&5
1944   (exit $ac_status); } &&
1945          { ac_try='test -s conftest.$ac_objext'
1946   { (eval echo "$as_me:1946: \"$ac_try\"") >&5
1947   (eval $ac_try) 2>&5
1948   ac_status=$?
1949   echo "$as_me:1949: \$? = $ac_status" >&5
1950   (exit $ac_status); }; }; then
1951   CLANG_COMPILER=yes
1952 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
1953
1954 else
1955   echo "$as_me: failed program was:" >&5
1956 cat conftest.$ac_ext >&5
1957 fi
1958 rm -f conftest.$ac_objext conftest.$ac_ext
1959         CFLAGS="$cf_save_CFLAGS"
1960         echo "$as_me:1960: result: $CLANG_COMPILER" >&5
1961 echo "${ECHO_T}$CLANG_COMPILER" >&6
1962 fi
1963
1964 echo "$as_me:1964: checking for $CC option to accept ANSI C" >&5
1965 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1966 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1967   echo $ECHO_N "(cached) $ECHO_C" >&6
1968 else
1969   ac_cv_prog_cc_stdc=no
1970 ac_save_CC=$CC
1971 cat >conftest.$ac_ext <<_ACEOF
1972 #line 1972 "configure"
1973 #include "confdefs.h"
1974 #include <stdarg.h>
1975 #include <stdio.h>
1976 #include <sys/types.h>
1977 #include <sys/stat.h>
1978 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1979 struct buf { int x; };
1980 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1981 static char *e (p, i)
1982      char **p;
1983      int i;
1984 {
1985   return p[i];
1986 }
1987 static char *f (char * (*g) (char **, int), char **p, ...)
1988 {
1989   char *s;
1990   va_list v;
1991   va_start (v,p);
1992   s = g (p, va_arg (v,int));
1993   va_end (v);
1994   return s;
1995 }
1996 int test (int i, double x);
1997 struct s1 {int (*f) (int a);};
1998 struct s2 {int (*f) (double a);};
1999 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2000 int argc;
2001 char **argv;
2002 int
2003 main (void)
2004 {
2005 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2006   ;
2007   return 0;
2008 }
2009 _ACEOF
2010 # Don't try gcc -ansi; that turns off useful extensions and
2011 # breaks some systems' header files.
2012 # AIX                   -qlanglvl=ansi
2013 # Ultrix and OSF/1      -std1
2014 # HP-UX 10.20 and later -Ae
2015 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2016 # SVR4                  -Xc -D__EXTENSIONS__
2017 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2018 do
2019   CC="$ac_save_CC $ac_arg"
2020   rm -f conftest.$ac_objext
2021 if { (eval echo "$as_me:2021: \"$ac_compile\"") >&5
2022   (eval $ac_compile) 2>&5
2023   ac_status=$?
2024   echo "$as_me:2024: \$? = $ac_status" >&5
2025   (exit $ac_status); } &&
2026          { ac_try='test -s conftest.$ac_objext'
2027   { (eval echo "$as_me:2027: \"$ac_try\"") >&5
2028   (eval $ac_try) 2>&5
2029   ac_status=$?
2030   echo "$as_me:2030: \$? = $ac_status" >&5
2031   (exit $ac_status); }; }; then
2032   ac_cv_prog_cc_stdc=$ac_arg
2033 break
2034 else
2035   echo "$as_me: failed program was:" >&5
2036 cat conftest.$ac_ext >&5
2037 fi
2038 rm -f conftest.$ac_objext
2039 done
2040 rm -f conftest.$ac_ext conftest.$ac_objext
2041 CC=$ac_save_CC
2042
2043 fi
2044
2045 case "x$ac_cv_prog_cc_stdc" in
2046   x|xno)
2047     echo "$as_me:2047: result: none needed" >&5
2048 echo "${ECHO_T}none needed" >&6 ;;
2049   *)
2050     echo "$as_me:2050: result: $ac_cv_prog_cc_stdc" >&5
2051 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2052     CC="$CC $ac_cv_prog_cc_stdc" ;;
2053 esac
2054
2055 # This should have been defined by AC_PROG_CC
2056 : ${CC:=cc}
2057
2058 echo "$as_me:2058: checking \$CFLAGS variable" >&5
2059 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2060 case "x$CFLAGS" in
2061 (*-[IUD]*)
2062         echo "$as_me:2062: result: broken" >&5
2063 echo "${ECHO_T}broken" >&6
2064         { echo "$as_me:2064: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2065 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2066         cf_flags="$CFLAGS"
2067         CFLAGS=
2068         for cf_arg in $cf_flags
2069         do
2070
2071 cf_fix_cppflags=no
2072 cf_new_cflags=
2073 cf_new_cppflags=
2074 cf_new_extra_cppflags=
2075
2076 for cf_add_cflags in $cf_arg
2077 do
2078 case $cf_fix_cppflags in
2079 (no)
2080         case $cf_add_cflags in
2081         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2082                 case $cf_add_cflags in
2083                 (-D*)
2084                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2085
2086                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2087                                 && test -z "${cf_tst_cflags}" \
2088                                 && cf_fix_cppflags=yes
2089
2090                         if test $cf_fix_cppflags = yes ; then
2091
2092         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2093         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2094
2095                                 continue
2096                         elif test "${cf_tst_cflags}" = "\"'" ; then
2097
2098         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2099         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2100
2101                                 continue
2102                         fi
2103                         ;;
2104                 esac
2105                 case "$CPPFLAGS" in
2106                 (*$cf_add_cflags)
2107                         ;;
2108                 (*)
2109                         case $cf_add_cflags in
2110                         (-D*)
2111                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2112
2113 CPPFLAGS=`echo "$CPPFLAGS" | \
2114         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2115                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2116
2117                                 ;;
2118                         esac
2119
2120         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2121         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2122
2123                         ;;
2124                 esac
2125                 ;;
2126         (*)
2127
2128         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2129         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2130
2131                 ;;
2132         esac
2133         ;;
2134 (yes)
2135
2136         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2137         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2138
2139         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2140
2141         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2142                 && test -z "${cf_tst_cflags}" \
2143                 && cf_fix_cppflags=no
2144         ;;
2145 esac
2146 done
2147
2148 if test -n "$cf_new_cflags" ; then
2149
2150         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2151         CFLAGS="${CFLAGS}$cf_new_cflags"
2152
2153 fi
2154
2155 if test -n "$cf_new_cppflags" ; then
2156
2157         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2158         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2159
2160 fi
2161
2162 if test -n "$cf_new_extra_cppflags" ; then
2163
2164         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2165         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2166
2167 fi
2168
2169         done
2170         ;;
2171 (*)
2172         echo "$as_me:2172: result: ok" >&5
2173 echo "${ECHO_T}ok" >&6
2174         ;;
2175 esac
2176
2177 echo "$as_me:2177: checking \$CC variable" >&5
2178 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2179 case "$CC" in
2180 (*[\ \  ]-*)
2181         echo "$as_me:2181: result: broken" >&5
2182 echo "${ECHO_T}broken" >&6
2183         { echo "$as_me:2183: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2184 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2185         # humor him...
2186         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2187         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2188         CC="$cf_prog"
2189         for cf_arg in $cf_flags
2190         do
2191                 case "x$cf_arg" in
2192                 (x-[IUDfgOW]*)
2193
2194 cf_fix_cppflags=no
2195 cf_new_cflags=
2196 cf_new_cppflags=
2197 cf_new_extra_cppflags=
2198
2199 for cf_add_cflags in $cf_arg
2200 do
2201 case $cf_fix_cppflags in
2202 (no)
2203         case $cf_add_cflags in
2204         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2205                 case $cf_add_cflags in
2206                 (-D*)
2207                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2208
2209                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2210                                 && test -z "${cf_tst_cflags}" \
2211                                 && cf_fix_cppflags=yes
2212
2213                         if test $cf_fix_cppflags = yes ; then
2214
2215         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2216         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2217
2218                                 continue
2219                         elif test "${cf_tst_cflags}" = "\"'" ; then
2220
2221         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2222         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2223
2224                                 continue
2225                         fi
2226                         ;;
2227                 esac
2228                 case "$CPPFLAGS" in
2229                 (*$cf_add_cflags)
2230                         ;;
2231                 (*)
2232                         case $cf_add_cflags in
2233                         (-D*)
2234                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2235
2236 CPPFLAGS=`echo "$CPPFLAGS" | \
2237         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2238                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2239
2240                                 ;;
2241                         esac
2242
2243         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2244         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2245
2246                         ;;
2247                 esac
2248                 ;;
2249         (*)
2250
2251         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2252         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2253
2254                 ;;
2255         esac
2256         ;;
2257 (yes)
2258
2259         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2260         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2261
2262         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2263
2264         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2265                 && test -z "${cf_tst_cflags}" \
2266                 && cf_fix_cppflags=no
2267         ;;
2268 esac
2269 done
2270
2271 if test -n "$cf_new_cflags" ; then
2272
2273         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2274         CFLAGS="${CFLAGS}$cf_new_cflags"
2275
2276 fi
2277
2278 if test -n "$cf_new_cppflags" ; then
2279
2280         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2281         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2282
2283 fi
2284
2285 if test -n "$cf_new_extra_cppflags" ; then
2286
2287         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2288         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2289
2290 fi
2291
2292                         ;;
2293                 (*)
2294                         CC="$CC $cf_arg"
2295                         ;;
2296                 esac
2297         done
2298         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2299
2300 echo "${as_me:-configure}:2300: testing resulting CC: '$CC' ..." 1>&5
2301
2302         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2303
2304 echo "${as_me:-configure}:2304: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2305
2306         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2307
2308 echo "${as_me:-configure}:2308: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2309
2310         ;;
2311 (*)
2312         echo "$as_me:2312: result: ok" >&5
2313 echo "${ECHO_T}ok" >&6
2314         ;;
2315 esac
2316
2317 echo "$as_me:2317: checking for inline" >&5
2318 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2319 if test "${ac_cv_c_inline+set}" = set; then
2320   echo $ECHO_N "(cached) $ECHO_C" >&6
2321 else
2322   ac_cv_c_inline=no
2323 for ac_kw in inline __inline__ __inline; do
2324   cat >conftest.$ac_ext <<_ACEOF
2325 #line 2325 "configure"
2326 #include "confdefs.h"
2327 #ifndef __cplusplus
2328 static $ac_kw int static_foo () {return 0; }
2329 $ac_kw int foo () {return 0; }
2330 #endif
2331
2332 _ACEOF
2333 rm -f conftest.$ac_objext
2334 if { (eval echo "$as_me:2334: \"$ac_compile\"") >&5
2335   (eval $ac_compile) 2>&5
2336   ac_status=$?
2337   echo "$as_me:2337: \$? = $ac_status" >&5
2338   (exit $ac_status); } &&
2339          { ac_try='test -s conftest.$ac_objext'
2340   { (eval echo "$as_me:2340: \"$ac_try\"") >&5
2341   (eval $ac_try) 2>&5
2342   ac_status=$?
2343   echo "$as_me:2343: \$? = $ac_status" >&5
2344   (exit $ac_status); }; }; then
2345   ac_cv_c_inline=$ac_kw; break
2346 else
2347   echo "$as_me: failed program was:" >&5
2348 cat conftest.$ac_ext >&5
2349 fi
2350 rm -f conftest.$ac_objext conftest.$ac_ext
2351 done
2352
2353 fi
2354 echo "$as_me:2354: result: $ac_cv_c_inline" >&5
2355 echo "${ECHO_T}$ac_cv_c_inline" >&6
2356 case $ac_cv_c_inline in
2357   inline | yes) ;;
2358   no)
2359 cat >>confdefs.h <<\EOF
2360 #define inline
2361 EOF
2362  ;;
2363   *)  cat >>confdefs.h <<EOF
2364 #define inline $ac_cv_c_inline
2365 EOF
2366  ;;
2367 esac
2368
2369 ac_ext=c
2370 ac_cpp='$CPP $CPPFLAGS'
2371 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2372 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2373 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2374 ac_main_return=return
2375 echo "$as_me:2375: checking how to run the C preprocessor" >&5
2376 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2377 # On Suns, sometimes $CPP names a directory.
2378 if test -n "$CPP" && test -d "$CPP"; then
2379   CPP=
2380 fi
2381 if test -z "$CPP"; then
2382   if test "${ac_cv_prog_CPP+set}" = set; then
2383   echo $ECHO_N "(cached) $ECHO_C" >&6
2384 else
2385       # Double quotes because CPP needs to be expanded
2386     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2387     do
2388       ac_preproc_ok=false
2389 for ac_c_preproc_warn_flag in '' yes
2390 do
2391   # Use a header file that comes with gcc, so configuring glibc
2392   # with a fresh cross-compiler works.
2393   # On the NeXT, cc -E runs the code through the compiler's parser,
2394   # not just through cpp. "Syntax error" is here to catch this case.
2395   cat >conftest.$ac_ext <<_ACEOF
2396 #line 2396 "configure"
2397 #include "confdefs.h"
2398 #include <assert.h>
2399                      Syntax error
2400 _ACEOF
2401 if { (eval echo "$as_me:2401: \"$ac_cpp conftest.$ac_ext\"") >&5
2402   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2403   ac_status=$?
2404   egrep -v '^ *\+' conftest.er1 >conftest.err
2405   rm -f conftest.er1
2406   cat conftest.err >&5
2407   echo "$as_me:2407: \$? = $ac_status" >&5
2408   (exit $ac_status); } >/dev/null; then
2409   if test -s conftest.err; then
2410     ac_cpp_err=$ac_c_preproc_warn_flag
2411   else
2412     ac_cpp_err=
2413   fi
2414 else
2415   ac_cpp_err=yes
2416 fi
2417 if test -z "$ac_cpp_err"; then
2418   :
2419 else
2420   echo "$as_me: failed program was:" >&5
2421   cat conftest.$ac_ext >&5
2422   # Broken: fails on valid input.
2423 continue
2424 fi
2425 rm -f conftest.err conftest.$ac_ext
2426
2427   # OK, works on sane cases.  Now check whether non-existent headers
2428   # can be detected and how.
2429   cat >conftest.$ac_ext <<_ACEOF
2430 #line 2430 "configure"
2431 #include "confdefs.h"
2432 #include <ac_nonexistent.h>
2433 _ACEOF
2434 if { (eval echo "$as_me:2434: \"$ac_cpp conftest.$ac_ext\"") >&5
2435   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2436   ac_status=$?
2437   egrep -v '^ *\+' conftest.er1 >conftest.err
2438   rm -f conftest.er1
2439   cat conftest.err >&5
2440   echo "$as_me:2440: \$? = $ac_status" >&5
2441   (exit $ac_status); } >/dev/null; then
2442   if test -s conftest.err; then
2443     ac_cpp_err=$ac_c_preproc_warn_flag
2444   else
2445     ac_cpp_err=
2446   fi
2447 else
2448   ac_cpp_err=yes
2449 fi
2450 if test -z "$ac_cpp_err"; then
2451   # Broken: success on invalid input.
2452 continue
2453 else
2454   echo "$as_me: failed program was:" >&5
2455   cat conftest.$ac_ext >&5
2456   # Passes both tests.
2457 ac_preproc_ok=:
2458 break
2459 fi
2460 rm -f conftest.err conftest.$ac_ext
2461
2462 done
2463 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2464 rm -f conftest.err conftest.$ac_ext
2465 if $ac_preproc_ok; then
2466   break
2467 fi
2468
2469     done
2470     ac_cv_prog_CPP=$CPP
2471
2472 fi
2473   CPP=$ac_cv_prog_CPP
2474 else
2475   ac_cv_prog_CPP=$CPP
2476 fi
2477 echo "$as_me:2477: result: $CPP" >&5
2478 echo "${ECHO_T}$CPP" >&6
2479 ac_preproc_ok=false
2480 for ac_c_preproc_warn_flag in '' yes
2481 do
2482   # Use a header file that comes with gcc, so configuring glibc
2483   # with a fresh cross-compiler works.
2484   # On the NeXT, cc -E runs the code through the compiler's parser,
2485   # not just through cpp. "Syntax error" is here to catch this case.
2486   cat >conftest.$ac_ext <<_ACEOF
2487 #line 2487 "configure"
2488 #include "confdefs.h"
2489 #include <assert.h>
2490                      Syntax error
2491 _ACEOF
2492 if { (eval echo "$as_me:2492: \"$ac_cpp conftest.$ac_ext\"") >&5
2493   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2494   ac_status=$?
2495   egrep -v '^ *\+' conftest.er1 >conftest.err
2496   rm -f conftest.er1
2497   cat conftest.err >&5
2498   echo "$as_me:2498: \$? = $ac_status" >&5
2499   (exit $ac_status); } >/dev/null; then
2500   if test -s conftest.err; then
2501     ac_cpp_err=$ac_c_preproc_warn_flag
2502   else
2503     ac_cpp_err=
2504   fi
2505 else
2506   ac_cpp_err=yes
2507 fi
2508 if test -z "$ac_cpp_err"; then
2509   :
2510 else
2511   echo "$as_me: failed program was:" >&5
2512   cat conftest.$ac_ext >&5
2513   # Broken: fails on valid input.
2514 continue
2515 fi
2516 rm -f conftest.err conftest.$ac_ext
2517
2518   # OK, works on sane cases.  Now check whether non-existent headers
2519   # can be detected and how.
2520   cat >conftest.$ac_ext <<_ACEOF
2521 #line 2521 "configure"
2522 #include "confdefs.h"
2523 #include <ac_nonexistent.h>
2524 _ACEOF
2525 if { (eval echo "$as_me:2525: \"$ac_cpp conftest.$ac_ext\"") >&5
2526   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2527   ac_status=$?
2528   egrep -v '^ *\+' conftest.er1 >conftest.err
2529   rm -f conftest.er1
2530   cat conftest.err >&5
2531   echo "$as_me:2531: \$? = $ac_status" >&5
2532   (exit $ac_status); } >/dev/null; then
2533   if test -s conftest.err; then
2534     ac_cpp_err=$ac_c_preproc_warn_flag
2535   else
2536     ac_cpp_err=
2537   fi
2538 else
2539   ac_cpp_err=yes
2540 fi
2541 if test -z "$ac_cpp_err"; then
2542   # Broken: success on invalid input.
2543 continue
2544 else
2545   echo "$as_me: failed program was:" >&5
2546   cat conftest.$ac_ext >&5
2547   # Passes both tests.
2548 ac_preproc_ok=:
2549 break
2550 fi
2551 rm -f conftest.err conftest.$ac_ext
2552
2553 done
2554 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2555 rm -f conftest.err conftest.$ac_ext
2556 if $ac_preproc_ok; then
2557   :
2558 else
2559   { { echo "$as_me:2559: error: C preprocessor \"$CPP\" fails sanity check" >&5
2560 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2561    { (exit 1); exit 1; }; }
2562 fi
2563
2564 ac_ext=c
2565 ac_cpp='$CPP $CPPFLAGS'
2566 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2567 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2568 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2569 ac_main_return=return
2570
2571 for ac_prog in mawk gawk nawk awk
2572 do
2573   # Extract the first word of "$ac_prog", so it can be a program name with args.
2574 set dummy $ac_prog; ac_word=$2
2575 echo "$as_me:2575: checking for $ac_word" >&5
2576 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2577 if test "${ac_cv_prog_AWK+set}" = set; then
2578   echo $ECHO_N "(cached) $ECHO_C" >&6
2579 else
2580   if test -n "$AWK"; then
2581   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2582 else
2583   ac_save_IFS=$IFS; IFS=$ac_path_separator
2584 ac_dummy="$PATH"
2585 for ac_dir in $ac_dummy; do
2586   IFS=$ac_save_IFS
2587   test -z "$ac_dir" && ac_dir=.
2588   $as_executable_p "$ac_dir/$ac_word" || continue
2589 ac_cv_prog_AWK="$ac_prog"
2590 echo "$as_me:2590: found $ac_dir/$ac_word" >&5
2591 break
2592 done
2593
2594 fi
2595 fi
2596 AWK=$ac_cv_prog_AWK
2597 if test -n "$AWK"; then
2598   echo "$as_me:2598: result: $AWK" >&5
2599 echo "${ECHO_T}$AWK" >&6
2600 else
2601   echo "$as_me:2601: result: no" >&5
2602 echo "${ECHO_T}no" >&6
2603 fi
2604
2605   test -n "$AWK" && break
2606 done
2607
2608 # Find a good install program.  We prefer a C program (faster),
2609 # so one script is as good as another.  But avoid the broken or
2610 # incompatible versions:
2611 # SysV /etc/install, /usr/sbin/install
2612 # SunOS /usr/etc/install
2613 # IRIX /sbin/install
2614 # AIX /bin/install
2615 # AmigaOS /C/install, which installs bootblocks on floppy discs
2616 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2617 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2618 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2619 # ./install, which can be erroneously created by make from ./install.sh.
2620 echo "$as_me:2620: checking for a BSD compatible install" >&5
2621 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2622 if test -z "$INSTALL"; then
2623 if test "${ac_cv_path_install+set}" = set; then
2624   echo $ECHO_N "(cached) $ECHO_C" >&6
2625 else
2626     ac_save_IFS=$IFS; IFS=$ac_path_separator
2627   for ac_dir in $PATH; do
2628     IFS=$ac_save_IFS
2629     # Account for people who put trailing slashes in PATH elements.
2630     case $ac_dir/ in
2631     / | ./ | .// | /cC/* \
2632     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2633     | /usr/ucb/* ) ;;
2634     *)
2635       # OSF1 and SCO ODT 3.0 have their own names for install.
2636       # Don't use installbsd from OSF since it installs stuff as root
2637       # by default.
2638       for ac_prog in ginstall scoinst install; do
2639         if $as_executable_p "$ac_dir/$ac_prog"; then
2640           if test $ac_prog = install &&
2641             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2642             # AIX install.  It has an incompatible calling convention.
2643             :
2644           elif test $ac_prog = install &&
2645             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2646             # program-specific install script used by HP pwplus--don't use.
2647             :
2648           else
2649             ac_cv_path_install="$ac_dir/$ac_prog -c"
2650             break 2
2651           fi
2652         fi
2653       done
2654       ;;
2655     esac
2656   done
2657
2658 fi
2659   if test "${ac_cv_path_install+set}" = set; then
2660     INSTALL=$ac_cv_path_install
2661   else
2662     # As a last resort, use the slow shell script.  We don't cache a
2663     # path for INSTALL within a source directory, because that will
2664     # break other packages using the cache if that directory is
2665     # removed, or if the path is relative.
2666     INSTALL=$ac_install_sh
2667   fi
2668 fi
2669 echo "$as_me:2669: result: $INSTALL" >&5
2670 echo "${ECHO_T}$INSTALL" >&6
2671
2672 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2673 # It thinks the first close brace ends the variable substitution.
2674 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2675
2676 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2677
2678 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2679
2680 case $INSTALL in
2681 (/*)
2682         ;;
2683 (*)
2684         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2685         test -z "$cf_dir" && cf_dir=.
2686         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2687         ;;
2688 esac
2689
2690 echo "$as_me:2690: checking if you want to install stripped executables" >&5
2691 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2692
2693 # Check whether --enable-stripping or --disable-stripping was given.
2694 if test "${enable_stripping+set}" = set; then
2695   enableval="$enable_stripping"
2696   test "$enableval" != no && enableval=yes
2697         if test "$enableval" != "yes" ; then
2698     with_stripping=no
2699         else
2700                 with_stripping=yes
2701         fi
2702 else
2703   enableval=yes
2704         with_stripping=yes
2705
2706 fi;
2707 echo "$as_me:2707: result: $with_stripping" >&5
2708 echo "${ECHO_T}$with_stripping" >&6
2709
2710 if test "$with_stripping" = yes
2711 then
2712         INSTALL_OPT_S="-s"
2713 else
2714         INSTALL_OPT_S=
2715 fi
2716
2717 : ${INSTALL:=install}
2718 echo "$as_me:2718: checking if install accepts -p option" >&5
2719 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2720 if test "${cf_cv_install_p+set}" = set; then
2721   echo $ECHO_N "(cached) $ECHO_C" >&6
2722 else
2723
2724         rm -rf conftest*
2725         date >conftest.in
2726         mkdir conftest.out
2727         sleep 3
2728         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2729         then
2730                 if test -f conftest.out/conftest.in
2731                 then
2732                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2733                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2734                         if test -s conftest.err
2735                         then
2736                                 cf_cv_install_p=no
2737                         else
2738                                 cf_cv_install_p=yes
2739                         fi
2740                 else
2741                         cf_cv_install_p=no
2742                 fi
2743         else
2744                 cf_cv_install_p=no
2745         fi
2746         rm -rf conftest*
2747
2748 fi
2749 echo "$as_me:2749: result: $cf_cv_install_p" >&5
2750 echo "${ECHO_T}$cf_cv_install_p" >&6
2751
2752 echo "$as_me:2752: checking if install needs to be told about ownership" >&5
2753 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2754 case `$ac_config_guess` in
2755 (*minix)
2756         with_install_o=yes
2757         ;;
2758 (*)
2759         with_install_o=no
2760         ;;
2761 esac
2762
2763 echo "$as_me:2763: result: $with_install_o" >&5
2764 echo "${ECHO_T}$with_install_o" >&6
2765 if test "x$with_install_o" = xyes
2766 then
2767         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'`
2768 else
2769         INSTALL_OPT_O=
2770 fi
2771
2772 for ac_prog in lint cppcheck splint
2773 do
2774   # Extract the first word of "$ac_prog", so it can be a program name with args.
2775 set dummy $ac_prog; ac_word=$2
2776 echo "$as_me:2776: checking for $ac_word" >&5
2777 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2778 if test "${ac_cv_prog_LINT+set}" = set; then
2779   echo $ECHO_N "(cached) $ECHO_C" >&6
2780 else
2781   if test -n "$LINT"; then
2782   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2783 else
2784   ac_save_IFS=$IFS; IFS=$ac_path_separator
2785 ac_dummy="$PATH"
2786 for ac_dir in $ac_dummy; do
2787   IFS=$ac_save_IFS
2788   test -z "$ac_dir" && ac_dir=.
2789   $as_executable_p "$ac_dir/$ac_word" || continue
2790 ac_cv_prog_LINT="$ac_prog"
2791 echo "$as_me:2791: found $ac_dir/$ac_word" >&5
2792 break
2793 done
2794
2795 fi
2796 fi
2797 LINT=$ac_cv_prog_LINT
2798 if test -n "$LINT"; then
2799   echo "$as_me:2799: result: $LINT" >&5
2800 echo "${ECHO_T}$LINT" >&6
2801 else
2802   echo "$as_me:2802: result: no" >&5
2803 echo "${ECHO_T}no" >&6
2804 fi
2805
2806   test -n "$LINT" && break
2807 done
2808
2809 case "x$LINT" in
2810 (xcppcheck|x*/cppcheck)
2811         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2812         ;;
2813 esac
2814
2815 echo "$as_me:2815: checking if filesystem supports mixed-case filenames" >&5
2816 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2817 if test "${cf_cv_mixedcase+set}" = set; then
2818   echo $ECHO_N "(cached) $ECHO_C" >&6
2819 else
2820
2821 if test "$cross_compiling" = yes ; then
2822         case $target_alias in
2823         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2824                 cf_cv_mixedcase=no
2825                 ;;
2826         (*)
2827                 cf_cv_mixedcase=yes
2828                 ;;
2829         esac
2830 else
2831         rm -f conftest CONFTEST
2832         echo test >conftest
2833         if test -f CONFTEST ; then
2834                 cf_cv_mixedcase=no
2835         else
2836                 cf_cv_mixedcase=yes
2837         fi
2838         rm -f conftest CONFTEST
2839 fi
2840
2841 fi
2842 echo "$as_me:2842: result: $cf_cv_mixedcase" >&5
2843 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2844 test "$cf_cv_mixedcase" = yes &&
2845 cat >>confdefs.h <<\EOF
2846 #define MIXEDCASE_FILENAMES 1
2847 EOF
2848
2849 for ac_prog in exctags ctags
2850 do
2851   # Extract the first word of "$ac_prog", so it can be a program name with args.
2852 set dummy $ac_prog; ac_word=$2
2853 echo "$as_me:2853: checking for $ac_word" >&5
2854 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2855 if test "${ac_cv_prog_CTAGS+set}" = set; then
2856   echo $ECHO_N "(cached) $ECHO_C" >&6
2857 else
2858   if test -n "$CTAGS"; then
2859   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2860 else
2861   ac_save_IFS=$IFS; IFS=$ac_path_separator
2862 ac_dummy="$PATH"
2863 for ac_dir in $ac_dummy; do
2864   IFS=$ac_save_IFS
2865   test -z "$ac_dir" && ac_dir=.
2866   $as_executable_p "$ac_dir/$ac_word" || continue
2867 ac_cv_prog_CTAGS="$ac_prog"
2868 echo "$as_me:2868: found $ac_dir/$ac_word" >&5
2869 break
2870 done
2871
2872 fi
2873 fi
2874 CTAGS=$ac_cv_prog_CTAGS
2875 if test -n "$CTAGS"; then
2876   echo "$as_me:2876: result: $CTAGS" >&5
2877 echo "${ECHO_T}$CTAGS" >&6
2878 else
2879   echo "$as_me:2879: result: no" >&5
2880 echo "${ECHO_T}no" >&6
2881 fi
2882
2883   test -n "$CTAGS" && break
2884 done
2885
2886 for ac_prog in exetags etags
2887 do
2888   # Extract the first word of "$ac_prog", so it can be a program name with args.
2889 set dummy $ac_prog; ac_word=$2
2890 echo "$as_me:2890: checking for $ac_word" >&5
2891 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2892 if test "${ac_cv_prog_ETAGS+set}" = set; then
2893   echo $ECHO_N "(cached) $ECHO_C" >&6
2894 else
2895   if test -n "$ETAGS"; then
2896   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2897 else
2898   ac_save_IFS=$IFS; IFS=$ac_path_separator
2899 ac_dummy="$PATH"
2900 for ac_dir in $ac_dummy; do
2901   IFS=$ac_save_IFS
2902   test -z "$ac_dir" && ac_dir=.
2903   $as_executable_p "$ac_dir/$ac_word" || continue
2904 ac_cv_prog_ETAGS="$ac_prog"
2905 echo "$as_me:2905: found $ac_dir/$ac_word" >&5
2906 break
2907 done
2908
2909 fi
2910 fi
2911 ETAGS=$ac_cv_prog_ETAGS
2912 if test -n "$ETAGS"; then
2913   echo "$as_me:2913: result: $ETAGS" >&5
2914 echo "${ECHO_T}$ETAGS" >&6
2915 else
2916   echo "$as_me:2916: result: no" >&5
2917 echo "${ECHO_T}no" >&6
2918 fi
2919
2920   test -n "$ETAGS" && break
2921 done
2922
2923 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2924 set dummy ${CTAGS:-ctags}; ac_word=$2
2925 echo "$as_me:2925: checking for $ac_word" >&5
2926 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2927 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2928   echo $ECHO_N "(cached) $ECHO_C" >&6
2929 else
2930   if test -n "$MAKE_LOWER_TAGS"; then
2931   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2932 else
2933   ac_save_IFS=$IFS; IFS=$ac_path_separator
2934 ac_dummy="$PATH"
2935 for ac_dir in $ac_dummy; do
2936   IFS=$ac_save_IFS
2937   test -z "$ac_dir" && ac_dir=.
2938   $as_executable_p "$ac_dir/$ac_word" || continue
2939 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2940 echo "$as_me:2940: found $ac_dir/$ac_word" >&5
2941 break
2942 done
2943
2944   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2945 fi
2946 fi
2947 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2948 if test -n "$MAKE_LOWER_TAGS"; then
2949   echo "$as_me:2949: result: $MAKE_LOWER_TAGS" >&5
2950 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2951 else
2952   echo "$as_me:2952: result: no" >&5
2953 echo "${ECHO_T}no" >&6
2954 fi
2955
2956 if test "$cf_cv_mixedcase" = yes ; then
2957         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2958 set dummy ${ETAGS:-etags}; ac_word=$2
2959 echo "$as_me:2959: checking for $ac_word" >&5
2960 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2961 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2962   echo $ECHO_N "(cached) $ECHO_C" >&6
2963 else
2964   if test -n "$MAKE_UPPER_TAGS"; then
2965   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2966 else
2967   ac_save_IFS=$IFS; IFS=$ac_path_separator
2968 ac_dummy="$PATH"
2969 for ac_dir in $ac_dummy; do
2970   IFS=$ac_save_IFS
2971   test -z "$ac_dir" && ac_dir=.
2972   $as_executable_p "$ac_dir/$ac_word" || continue
2973 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2974 echo "$as_me:2974: found $ac_dir/$ac_word" >&5
2975 break
2976 done
2977
2978   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2979 fi
2980 fi
2981 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2982 if test -n "$MAKE_UPPER_TAGS"; then
2983   echo "$as_me:2983: result: $MAKE_UPPER_TAGS" >&5
2984 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2985 else
2986   echo "$as_me:2986: result: no" >&5
2987 echo "${ECHO_T}no" >&6
2988 fi
2989
2990 else
2991         MAKE_UPPER_TAGS=no
2992 fi
2993
2994 if test "$MAKE_UPPER_TAGS" = yes ; then
2995         MAKE_UPPER_TAGS=
2996 else
2997         MAKE_UPPER_TAGS="#"
2998 fi
2999
3000 if test "$MAKE_LOWER_TAGS" = yes ; then
3001         MAKE_LOWER_TAGS=
3002 else
3003         MAKE_LOWER_TAGS="#"
3004 fi
3005
3006 echo "$as_me:3006: checking if -lm needed for math functions" >&5
3007 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3008 if test "${cf_cv_need_libm+set}" = set; then
3009   echo $ECHO_N "(cached) $ECHO_C" >&6
3010 else
3011
3012         cat >conftest.$ac_ext <<_ACEOF
3013 #line 3013 "configure"
3014 #include "confdefs.h"
3015
3016         #include <stdio.h>
3017         #include <stdlib.h>
3018         #include <math.h>
3019
3020 int
3021 main (void)
3022 {
3023 double x = rand(); printf("result = %g\n", pow(sin(x),x))
3024   ;
3025   return 0;
3026 }
3027 _ACEOF
3028 rm -f conftest.$ac_objext conftest$ac_exeext
3029 if { (eval echo "$as_me:3029: \"$ac_link\"") >&5
3030   (eval $ac_link) 2>&5
3031   ac_status=$?
3032   echo "$as_me:3032: \$? = $ac_status" >&5
3033   (exit $ac_status); } &&
3034          { ac_try='test -s conftest$ac_exeext'
3035   { (eval echo "$as_me:3035: \"$ac_try\"") >&5
3036   (eval $ac_try) 2>&5
3037   ac_status=$?
3038   echo "$as_me:3038: \$? = $ac_status" >&5
3039   (exit $ac_status); }; }; then
3040   cf_cv_need_libm=no
3041 else
3042   echo "$as_me: failed program was:" >&5
3043 cat conftest.$ac_ext >&5
3044 cf_cv_need_libm=yes
3045 fi
3046 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3047 fi
3048 echo "$as_me:3048: result: $cf_cv_need_libm" >&5
3049 echo "${ECHO_T}$cf_cv_need_libm" >&6
3050 if test "$cf_cv_need_libm" = yes
3051 then
3052 MATH_LIB=-lm
3053 fi
3054
3055 top_builddir=`pwd`
3056
3057 CC_G_OPT="-g"
3058 CC_SHARED_OPTS=unknown
3059 CPPFLAGS="$CPPFLAGS"
3060 DFT_DEP_SUFFIX=""
3061 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3062 DFT_UPR_MODEL="NORMAL"
3063 LD="ld"
3064 LDFLAGS_SHARED=""
3065 LDFLAGS_STATIC=""
3066 LD_MODEL=""
3067 LD_SHARED_OPTS=""
3068 LIBTOOL=""
3069 LIBTOOL_OPTS=""
3070 LIB_CLEAN=""
3071 LIB_COMPILE=""
3072 LIB_LINK='${CC}'
3073 LINK_TESTS=""
3074 LOCAL_LDFLAGS=""
3075 PACKAGE="ncurses-examples"
3076 PTHREAD="-lm"
3077 TEST_ARGS=""
3078 TEST_DEPS=""
3079 TEST_LIBS=""
3080 TINFO_LDFLAGS=''
3081 TINFO_LIBS='$(LIBS_CURSES)'
3082 cf_cv_abi_version=""
3083 cf_cv_rel_version=""
3084 includesubdir=""
3085
3086 cf_cv_screen=curses
3087 cf_cv_libtype=
3088
3089 if test "$GCC" = yes
3090 then
3091 cat > conftest.i <<EOF
3092 #ifndef GCC_PRINTF
3093 #define GCC_PRINTF 0
3094 #endif
3095 #ifndef GCC_SCANF
3096 #define GCC_SCANF 0
3097 #endif
3098 #ifndef GCC_NORETURN
3099 #define GCC_NORETURN /* nothing */
3100 #endif
3101 #ifndef GCC_UNUSED
3102 #define GCC_UNUSED /* nothing */
3103 #endif
3104 EOF
3105 if test "$GCC" = yes
3106 then
3107         { echo "$as_me:3107: checking for $CC __attribute__ directives..." >&5
3108 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3109 cat > conftest.$ac_ext <<EOF
3110 #line 3110 "${as_me:-configure}"
3111 #include "confdefs.h"
3112 #include "conftest.h"
3113 #include "conftest.i"
3114 #if     GCC_PRINTF
3115 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3116 #else
3117 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3118 #endif
3119 #if     GCC_SCANF
3120 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3121 #else
3122 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3123 #endif
3124 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3125 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3126 extern void foo(void) GCC_NORETURN;
3127 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3128 EOF
3129         cf_printf_attribute=no
3130         cf_scanf_attribute=no
3131         for cf_attribute in scanf printf unused noreturn
3132         do
3133
3134 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3135
3136                 cf_directive="__attribute__(($cf_attribute))"
3137                 echo "checking for $CC $cf_directive" 1>&5
3138
3139                 case $cf_attribute in
3140                 (printf)
3141                         cf_printf_attribute=yes
3142                         cat >conftest.h <<EOF
3143 #define GCC_$cf_ATTRIBUTE 1
3144 EOF
3145                         ;;
3146                 (scanf)
3147                         cf_scanf_attribute=yes
3148                         cat >conftest.h <<EOF
3149 #define GCC_$cf_ATTRIBUTE 1
3150 EOF
3151                         ;;
3152                 (*)
3153                         cat >conftest.h <<EOF
3154 #define GCC_$cf_ATTRIBUTE $cf_directive
3155 EOF
3156                         ;;
3157                 esac
3158
3159                 if { (eval echo "$as_me:3159: \"$ac_compile\"") >&5
3160   (eval $ac_compile) 2>&5
3161   ac_status=$?
3162   echo "$as_me:3162: \$? = $ac_status" >&5
3163   (exit $ac_status); }; then
3164                         test -n "$verbose" && echo "$as_me:3164: result: ... $cf_attribute" >&5
3165 echo "${ECHO_T}... $cf_attribute" >&6
3166                         cat conftest.h >>confdefs.h
3167                         case $cf_attribute in
3168                         (noreturn)
3169
3170 cat >>confdefs.h <<EOF
3171 #define GCC_NORETURN $cf_directive
3172 EOF
3173
3174                                 ;;
3175                         (printf)
3176                                 cf_value='/* nothing */'
3177                                 if test "$cf_printf_attribute" != no ; then
3178                                         cf_value='__attribute__((format(printf,fmt,var)))'
3179
3180 cat >>confdefs.h <<\EOF
3181 #define GCC_PRINTF 1
3182 EOF
3183
3184                                 fi
3185
3186 cat >>confdefs.h <<EOF
3187 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3188 EOF
3189
3190                                 ;;
3191                         (scanf)
3192                                 cf_value='/* nothing */'
3193                                 if test "$cf_scanf_attribute" != no ; then
3194                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3195
3196 cat >>confdefs.h <<\EOF
3197 #define GCC_SCANF 1
3198 EOF
3199
3200                                 fi
3201
3202 cat >>confdefs.h <<EOF
3203 #define GCC_SCANFLIKE(fmt,var) $cf_value
3204 EOF
3205
3206                                 ;;
3207                         (unused)
3208
3209 cat >>confdefs.h <<EOF
3210 #define GCC_UNUSED $cf_directive
3211 EOF
3212
3213                                 ;;
3214                         esac
3215                 fi
3216         done
3217 else
3218         fgrep define conftest.i >>confdefs.h
3219 fi
3220 rm -rf conftest*
3221 fi
3222
3223 echo "$as_me:3223: checking if you want to work around bogus compiler/loader warnings" >&5
3224 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3225
3226 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3227 if test "${enable_string_hacks+set}" = set; then
3228   enableval="$enable_string_hacks"
3229   with_string_hacks=$enableval
3230 else
3231   with_string_hacks=no
3232 fi;
3233 echo "$as_me:3233: result: $with_string_hacks" >&5
3234 echo "${ECHO_T}$with_string_hacks" >&6
3235
3236 if test "x$with_string_hacks" = "xyes"; then
3237
3238 cat >>confdefs.h <<\EOF
3239 #define USE_STRING_HACKS 1
3240 EOF
3241
3242         { echo "$as_me:3242: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3243 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3244         echo "$as_me:3244: checking for strlcat" >&5
3245 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3246 if test "${ac_cv_func_strlcat+set}" = set; then
3247   echo $ECHO_N "(cached) $ECHO_C" >&6
3248 else
3249   cat >conftest.$ac_ext <<_ACEOF
3250 #line 3250 "configure"
3251 #include "confdefs.h"
3252 #define strlcat autoconf_temporary
3253 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3254 #undef strlcat
3255
3256 #ifdef __cplusplus
3257 extern "C"
3258 #endif
3259
3260 /* We use char because int might match the return type of a gcc2
3261    builtin and then its argument prototype would still apply.  */
3262 char strlcat (void);
3263
3264 int
3265 main (void)
3266 {
3267
3268 /* The GNU C library defines stubs for functions which it implements
3269     to always fail with ENOSYS.  Some functions are actually named
3270     something starting with __ and the normal name is an alias.  */
3271 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3272 #error found stub for strlcat
3273 #endif
3274
3275         return strlcat ();
3276   ;
3277   return 0;
3278 }
3279 _ACEOF
3280 rm -f conftest.$ac_objext conftest$ac_exeext
3281 if { (eval echo "$as_me:3281: \"$ac_link\"") >&5
3282   (eval $ac_link) 2>&5
3283   ac_status=$?
3284   echo "$as_me:3284: \$? = $ac_status" >&5
3285   (exit $ac_status); } &&
3286          { ac_try='test -s conftest$ac_exeext'
3287   { (eval echo "$as_me:3287: \"$ac_try\"") >&5
3288   (eval $ac_try) 2>&5
3289   ac_status=$?
3290   echo "$as_me:3290: \$? = $ac_status" >&5
3291   (exit $ac_status); }; }; then
3292   ac_cv_func_strlcat=yes
3293 else
3294   echo "$as_me: failed program was:" >&5
3295 cat conftest.$ac_ext >&5
3296 ac_cv_func_strlcat=no
3297 fi
3298 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3299 fi
3300 echo "$as_me:3300: result: $ac_cv_func_strlcat" >&5
3301 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3302 if test $ac_cv_func_strlcat = yes; then
3303
3304 cat >>confdefs.h <<\EOF
3305 #define HAVE_STRLCAT 1
3306 EOF
3307
3308 else
3309
3310                 echo "$as_me:3310: checking for strlcat in -lbsd" >&5
3311 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3312 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3313   echo $ECHO_N "(cached) $ECHO_C" >&6
3314 else
3315   ac_check_lib_save_LIBS=$LIBS
3316 LIBS="-lbsd  $LIBS"
3317 cat >conftest.$ac_ext <<_ACEOF
3318 #line 3318 "configure"
3319 #include "confdefs.h"
3320
3321 /* Override any gcc2 internal prototype to avoid an error.  */
3322 #ifdef __cplusplus
3323 extern "C"
3324 #endif
3325 /* We use char because int might match the return type of a gcc2
3326    builtin and then its argument prototype would still apply.  */
3327 char strlcat ();
3328 int
3329 main (void)
3330 {
3331 strlcat ();
3332   ;
3333   return 0;
3334 }
3335 _ACEOF
3336 rm -f conftest.$ac_objext conftest$ac_exeext
3337 if { (eval echo "$as_me:3337: \"$ac_link\"") >&5
3338   (eval $ac_link) 2>&5
3339   ac_status=$?
3340   echo "$as_me:3340: \$? = $ac_status" >&5
3341   (exit $ac_status); } &&
3342          { ac_try='test -s conftest$ac_exeext'
3343   { (eval echo "$as_me:3343: \"$ac_try\"") >&5
3344   (eval $ac_try) 2>&5
3345   ac_status=$?
3346   echo "$as_me:3346: \$? = $ac_status" >&5
3347   (exit $ac_status); }; }; then
3348   ac_cv_lib_bsd_strlcat=yes
3349 else
3350   echo "$as_me: failed program was:" >&5
3351 cat conftest.$ac_ext >&5
3352 ac_cv_lib_bsd_strlcat=no
3353 fi
3354 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3355 LIBS=$ac_check_lib_save_LIBS
3356 fi
3357 echo "$as_me:3357: result: $ac_cv_lib_bsd_strlcat" >&5
3358 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3359 if test $ac_cv_lib_bsd_strlcat = yes; then
3360
3361 cf_add_libs="$LIBS"
3362 # reverse order
3363 cf_add_0lib=
3364 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3365 # filter duplicates
3366 for cf_add_1lib in $cf_add_0lib; do
3367         for cf_add_2lib in $cf_add_libs; do
3368                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3369                         cf_add_1lib=
3370                         break
3371                 fi
3372         done
3373         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3374 done
3375 LIBS="$cf_add_libs"
3376
3377 for ac_header in bsd/string.h
3378 do
3379 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3380 echo "$as_me:3380: checking for $ac_header" >&5
3381 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3382 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3383   echo $ECHO_N "(cached) $ECHO_C" >&6
3384 else
3385   cat >conftest.$ac_ext <<_ACEOF
3386 #line 3386 "configure"
3387 #include "confdefs.h"
3388 #include <$ac_header>
3389 _ACEOF
3390 if { (eval echo "$as_me:3390: \"$ac_cpp conftest.$ac_ext\"") >&5
3391   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3392   ac_status=$?
3393   egrep -v '^ *\+' conftest.er1 >conftest.err
3394   rm -f conftest.er1
3395   cat conftest.err >&5
3396   echo "$as_me:3396: \$? = $ac_status" >&5
3397   (exit $ac_status); } >/dev/null; then
3398   if test -s conftest.err; then
3399     ac_cpp_err=$ac_c_preproc_warn_flag
3400   else
3401     ac_cpp_err=
3402   fi
3403 else
3404   ac_cpp_err=yes
3405 fi
3406 if test -z "$ac_cpp_err"; then
3407   eval "$as_ac_Header=yes"
3408 else
3409   echo "$as_me: failed program was:" >&5
3410   cat conftest.$ac_ext >&5
3411   eval "$as_ac_Header=no"
3412 fi
3413 rm -f conftest.err conftest.$ac_ext
3414 fi
3415 echo "$as_me:3415: result: `eval echo '${'$as_ac_Header'}'`" >&5
3416 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3417 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3418   cat >>confdefs.h <<EOF
3419 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3420 EOF
3421
3422 fi
3423 done
3424
3425 cat >>confdefs.h <<\EOF
3426 #define HAVE_STRLCAT 1
3427 EOF
3428
3429 fi
3430
3431 fi
3432
3433 for ac_func in strlcpy snprintf
3434 do
3435 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3436 echo "$as_me:3436: checking for $ac_func" >&5
3437 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3438 if eval "test \"\${$as_ac_var+set}\" = set"; then
3439   echo $ECHO_N "(cached) $ECHO_C" >&6
3440 else
3441   cat >conftest.$ac_ext <<_ACEOF
3442 #line 3442 "configure"
3443 #include "confdefs.h"
3444 #define $ac_func autoconf_temporary
3445 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3446 #undef $ac_func
3447
3448 #ifdef __cplusplus
3449 extern "C"
3450 #endif
3451
3452 /* We use char because int might match the return type of a gcc2
3453    builtin and then its argument prototype would still apply.  */
3454 char $ac_func (void);
3455
3456 int
3457 main (void)
3458 {
3459
3460 /* The GNU C library defines stubs for functions which it implements
3461     to always fail with ENOSYS.  Some functions are actually named
3462     something starting with __ and the normal name is an alias.  */
3463 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3464 #error found stub for $ac_func
3465 #endif
3466
3467         return $ac_func ();
3468   ;
3469   return 0;
3470 }
3471 _ACEOF
3472 rm -f conftest.$ac_objext conftest$ac_exeext
3473 if { (eval echo "$as_me:3473: \"$ac_link\"") >&5
3474   (eval $ac_link) 2>&5
3475   ac_status=$?
3476   echo "$as_me:3476: \$? = $ac_status" >&5
3477   (exit $ac_status); } &&
3478          { ac_try='test -s conftest$ac_exeext'
3479   { (eval echo "$as_me:3479: \"$ac_try\"") >&5
3480   (eval $ac_try) 2>&5
3481   ac_status=$?
3482   echo "$as_me:3482: \$? = $ac_status" >&5
3483   (exit $ac_status); }; }; then
3484   eval "$as_ac_var=yes"
3485 else
3486   echo "$as_me: failed program was:" >&5
3487 cat conftest.$ac_ext >&5
3488 eval "$as_ac_var=no"
3489 fi
3490 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3491 fi
3492 echo "$as_me:3492: result: `eval echo '${'$as_ac_var'}'`" >&5
3493 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3494 if test `eval echo '${'$as_ac_var'}'` = yes; then
3495   cat >>confdefs.h <<EOF
3496 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3497 EOF
3498
3499 fi
3500 done
3501
3502 fi
3503
3504 echo "$as_me:3504: checking if the POSIX test-macros are already defined" >&5
3505 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3506 if test "${cf_cv_posix_visible+set}" = set; then
3507   echo $ECHO_N "(cached) $ECHO_C" >&6
3508 else
3509
3510 cat >conftest.$ac_ext <<_ACEOF
3511 #line 3511 "configure"
3512 #include "confdefs.h"
3513 #include <stdio.h>
3514 int
3515 main (void)
3516 {
3517
3518 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3519         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3520         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3521         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3522 #error conflicting symbols found
3523 #endif
3524
3525   ;
3526   return 0;
3527 }
3528 _ACEOF
3529 rm -f conftest.$ac_objext
3530 if { (eval echo "$as_me:3530: \"$ac_compile\"") >&5
3531   (eval $ac_compile) 2>&5
3532   ac_status=$?
3533   echo "$as_me:3533: \$? = $ac_status" >&5
3534   (exit $ac_status); } &&
3535          { ac_try='test -s conftest.$ac_objext'
3536   { (eval echo "$as_me:3536: \"$ac_try\"") >&5
3537   (eval $ac_try) 2>&5
3538   ac_status=$?
3539   echo "$as_me:3539: \$? = $ac_status" >&5
3540   (exit $ac_status); }; }; then
3541   cf_cv_posix_visible=no
3542 else
3543   echo "$as_me: failed program was:" >&5
3544 cat conftest.$ac_ext >&5
3545 cf_cv_posix_visible=yes
3546 fi
3547 rm -f conftest.$ac_objext conftest.$ac_ext
3548
3549 fi
3550 echo "$as_me:3550: result: $cf_cv_posix_visible" >&5
3551 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3552
3553 if test "$cf_cv_posix_visible" = no; then
3554
3555 cf_XOPEN_SOURCE=600
3556 cf_POSIX_C_SOURCE=199506L
3557 cf_xopen_source=
3558
3559 case $host_os in
3560 (aix[4-7]*)
3561         cf_xopen_source="-D_ALL_SOURCE"
3562         ;;
3563 (msys)
3564         cf_XOPEN_SOURCE=600
3565         ;;
3566 (darwin[0-8].*)
3567         cf_xopen_source="-D_APPLE_C_SOURCE"
3568         ;;
3569 (darwin*)
3570         cf_xopen_source="-D_DARWIN_C_SOURCE"
3571         cf_XOPEN_SOURCE=
3572         ;;
3573 (freebsd*|dragonfly*|midnightbsd*)
3574         # 5.x headers associate
3575         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3576         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3577         cf_POSIX_C_SOURCE=200112L
3578         cf_XOPEN_SOURCE=600
3579         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3580         ;;
3581 (hpux11*)
3582         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3583         ;;
3584 (hpux*)
3585         cf_xopen_source="-D_HPUX_SOURCE"
3586         ;;
3587 (irix[56].*)
3588         cf_xopen_source="-D_SGI_SOURCE"
3589         cf_XOPEN_SOURCE=
3590         ;;
3591 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3592
3593 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3594
3595 echo "$as_me:3595: checking if this is the GNU C library" >&5
3596 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3597 if test "${cf_cv_gnu_library+set}" = set; then
3598   echo $ECHO_N "(cached) $ECHO_C" >&6
3599 else
3600
3601 cat >conftest.$ac_ext <<_ACEOF
3602 #line 3602 "configure"
3603 #include "confdefs.h"
3604 #include <sys/types.h>
3605 int
3606 main (void)
3607 {
3608
3609         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3610                 return 0;
3611         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3612                 return 0;
3613         #else
3614         #       error not GNU C library
3615         #endif
3616   ;
3617   return 0;
3618 }
3619 _ACEOF
3620 rm -f conftest.$ac_objext
3621 if { (eval echo "$as_me:3621: \"$ac_compile\"") >&5
3622   (eval $ac_compile) 2>&5
3623   ac_status=$?
3624   echo "$as_me:3624: \$? = $ac_status" >&5
3625   (exit $ac_status); } &&
3626          { ac_try='test -s conftest.$ac_objext'
3627   { (eval echo "$as_me:3627: \"$ac_try\"") >&5
3628   (eval $ac_try) 2>&5
3629   ac_status=$?
3630   echo "$as_me:3630: \$? = $ac_status" >&5
3631   (exit $ac_status); }; }; then
3632   cf_cv_gnu_library=yes
3633 else
3634   echo "$as_me: failed program was:" >&5
3635 cat conftest.$ac_ext >&5
3636 cf_cv_gnu_library=no
3637 fi
3638 rm -f conftest.$ac_objext conftest.$ac_ext
3639
3640 fi
3641 echo "$as_me:3641: result: $cf_cv_gnu_library" >&5
3642 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3643
3644 if test x$cf_cv_gnu_library = xyes; then
3645
3646         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3647         # was changed to help a little.  newlib incorporated the change about 4
3648         # years later.
3649         echo "$as_me:3649: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3650 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3651 if test "${cf_cv_gnu_library_219+set}" = set; then
3652   echo $ECHO_N "(cached) $ECHO_C" >&6
3653 else
3654
3655                 cf_save="$CPPFLAGS"
3656
3657         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3658         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3659
3660                 cat >conftest.$ac_ext <<_ACEOF
3661 #line 3661 "configure"
3662 #include "confdefs.h"
3663 #include <sys/types.h>
3664 int
3665 main (void)
3666 {
3667
3668                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3669                                 return 0;
3670                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3671                                 return 0;
3672                         #else
3673                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3674                         #endif
3675   ;
3676   return 0;
3677 }
3678 _ACEOF
3679 rm -f conftest.$ac_objext
3680 if { (eval echo "$as_me:3680: \"$ac_compile\"") >&5
3681   (eval $ac_compile) 2>&5
3682   ac_status=$?
3683   echo "$as_me:3683: \$? = $ac_status" >&5
3684   (exit $ac_status); } &&
3685          { ac_try='test -s conftest.$ac_objext'
3686   { (eval echo "$as_me:3686: \"$ac_try\"") >&5
3687   (eval $ac_try) 2>&5
3688   ac_status=$?
3689   echo "$as_me:3689: \$? = $ac_status" >&5
3690   (exit $ac_status); }; }; then
3691   cf_cv_gnu_library_219=yes
3692 else
3693   echo "$as_me: failed program was:" >&5
3694 cat conftest.$ac_ext >&5
3695 cf_cv_gnu_library_219=no
3696 fi
3697 rm -f conftest.$ac_objext conftest.$ac_ext
3698                 CPPFLAGS="$cf_save"
3699
3700 fi
3701 echo "$as_me:3701: result: $cf_cv_gnu_library_219" >&5
3702 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3703
3704         if test "x$cf_cv_gnu_library_219" = xyes; then
3705                 cf_save="$CPPFLAGS"
3706                 echo "$as_me:3706: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3707 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3708 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3709   echo $ECHO_N "(cached) $ECHO_C" >&6
3710 else
3711
3712 cf_fix_cppflags=no
3713 cf_new_cflags=
3714 cf_new_cppflags=
3715 cf_new_extra_cppflags=
3716
3717 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3718 do
3719 case $cf_fix_cppflags in
3720 (no)
3721         case $cf_add_cflags in
3722         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3723                 case $cf_add_cflags in
3724                 (-D*)
3725                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3726
3727                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3728                                 && test -z "${cf_tst_cflags}" \
3729                                 && cf_fix_cppflags=yes
3730
3731                         if test $cf_fix_cppflags = yes ; then
3732
3733         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3734         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3735
3736                                 continue
3737                         elif test "${cf_tst_cflags}" = "\"'" ; then
3738
3739         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3740         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3741
3742                                 continue
3743                         fi
3744                         ;;
3745                 esac
3746                 case "$CPPFLAGS" in
3747                 (*$cf_add_cflags)
3748                         ;;
3749                 (*)
3750                         case $cf_add_cflags in
3751                         (-D*)
3752                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3753
3754 CPPFLAGS=`echo "$CPPFLAGS" | \
3755         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3756                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3757
3758                                 ;;
3759                         esac
3760
3761         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3762         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3763
3764                         ;;
3765                 esac
3766                 ;;
3767         (*)
3768
3769         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3770         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3771
3772                 ;;
3773         esac
3774         ;;
3775 (yes)
3776
3777         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3778         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3779
3780         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3781
3782         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3783                 && test -z "${cf_tst_cflags}" \
3784                 && cf_fix_cppflags=no
3785         ;;
3786 esac
3787 done
3788
3789 if test -n "$cf_new_cflags" ; then
3790
3791         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3792         CFLAGS="${CFLAGS}$cf_new_cflags"
3793
3794 fi
3795
3796 if test -n "$cf_new_cppflags" ; then
3797
3798         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3799         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3800
3801 fi
3802
3803 if test -n "$cf_new_extra_cppflags" ; then
3804
3805         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3806         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3807
3808 fi
3809
3810                         cat >conftest.$ac_ext <<_ACEOF
3811 #line 3811 "configure"
3812 #include "confdefs.h"
3813
3814                                 #include <limits.h>
3815                                 #include <sys/types.h>
3816
3817 int
3818 main (void)
3819 {
3820
3821                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3822                                         return 0;
3823                                 #else
3824                                 #       error GNU C library is too old
3825                                 #endif
3826   ;
3827   return 0;
3828 }
3829 _ACEOF
3830 rm -f conftest.$ac_objext
3831 if { (eval echo "$as_me:3831: \"$ac_compile\"") >&5
3832   (eval $ac_compile) 2>&5
3833   ac_status=$?
3834   echo "$as_me:3834: \$? = $ac_status" >&5
3835   (exit $ac_status); } &&
3836          { ac_try='test -s conftest.$ac_objext'
3837   { (eval echo "$as_me:3837: \"$ac_try\"") >&5
3838   (eval $ac_try) 2>&5
3839   ac_status=$?
3840   echo "$as_me:3840: \$? = $ac_status" >&5
3841   (exit $ac_status); }; }; then
3842   cf_cv_gnu_dftsrc_219=yes
3843 else
3844   echo "$as_me: failed program was:" >&5
3845 cat conftest.$ac_ext >&5
3846 cf_cv_gnu_dftsrc_219=no
3847 fi
3848 rm -f conftest.$ac_objext conftest.$ac_ext
3849
3850 fi
3851 echo "$as_me:3851: result: $cf_cv_gnu_dftsrc_219" >&5
3852 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3853                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3854         else
3855                 cf_cv_gnu_dftsrc_219=maybe
3856         fi
3857
3858         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3859
3860                 echo "$as_me:3860: checking if we must define _GNU_SOURCE" >&5
3861 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3862 if test "${cf_cv_gnu_source+set}" = set; then
3863   echo $ECHO_N "(cached) $ECHO_C" >&6
3864 else
3865
3866                 cat >conftest.$ac_ext <<_ACEOF
3867 #line 3867 "configure"
3868 #include "confdefs.h"
3869 #include <sys/types.h>
3870 int
3871 main (void)
3872 {
3873
3874                         #ifndef _XOPEN_SOURCE
3875                         #error  expected _XOPEN_SOURCE to be defined
3876                         #endif
3877   ;
3878   return 0;
3879 }
3880 _ACEOF
3881 rm -f conftest.$ac_objext
3882 if { (eval echo "$as_me:3882: \"$ac_compile\"") >&5
3883   (eval $ac_compile) 2>&5
3884   ac_status=$?
3885   echo "$as_me:3885: \$? = $ac_status" >&5
3886   (exit $ac_status); } &&
3887          { ac_try='test -s conftest.$ac_objext'
3888   { (eval echo "$as_me:3888: \"$ac_try\"") >&5
3889   (eval $ac_try) 2>&5
3890   ac_status=$?
3891   echo "$as_me:3891: \$? = $ac_status" >&5
3892   (exit $ac_status); }; }; then
3893   cf_cv_gnu_source=no
3894 else
3895   echo "$as_me: failed program was:" >&5
3896 cat conftest.$ac_ext >&5
3897 cf_save="$CPPFLAGS"
3898
3899 cf_fix_cppflags=no
3900 cf_new_cflags=
3901 cf_new_cppflags=
3902 cf_new_extra_cppflags=
3903
3904 for cf_add_cflags in -D_GNU_SOURCE
3905 do
3906 case $cf_fix_cppflags in
3907 (no)
3908         case $cf_add_cflags in
3909         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3910                 case $cf_add_cflags in
3911                 (-D*)
3912                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3913
3914                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3915                                 && test -z "${cf_tst_cflags}" \
3916                                 && cf_fix_cppflags=yes
3917
3918                         if test $cf_fix_cppflags = yes ; then
3919
3920         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3921         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3922
3923                                 continue
3924                         elif test "${cf_tst_cflags}" = "\"'" ; then
3925
3926         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3927         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3928
3929                                 continue
3930                         fi
3931                         ;;
3932                 esac
3933                 case "$CPPFLAGS" in
3934                 (*$cf_add_cflags)
3935                         ;;
3936                 (*)
3937                         case $cf_add_cflags in
3938                         (-D*)
3939                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3940
3941 CPPFLAGS=`echo "$CPPFLAGS" | \
3942         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3943                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3944
3945                                 ;;
3946                         esac
3947
3948         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3949         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3950
3951                         ;;
3952                 esac
3953                 ;;
3954         (*)
3955
3956         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3957         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3958
3959                 ;;
3960         esac
3961         ;;
3962 (yes)
3963
3964         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3965         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3966
3967         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3968
3969         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3970                 && test -z "${cf_tst_cflags}" \
3971                 && cf_fix_cppflags=no
3972         ;;
3973 esac
3974 done
3975
3976 if test -n "$cf_new_cflags" ; then
3977
3978         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3979         CFLAGS="${CFLAGS}$cf_new_cflags"
3980
3981 fi
3982
3983 if test -n "$cf_new_cppflags" ; then
3984
3985         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3986         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3987
3988 fi
3989
3990 if test -n "$cf_new_extra_cppflags" ; then
3991
3992         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3993         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3994
3995 fi
3996
3997                          cat >conftest.$ac_ext <<_ACEOF
3998 #line 3998 "configure"
3999 #include "confdefs.h"
4000 #include <sys/types.h>
4001 int
4002 main (void)
4003 {
4004
4005                                 #ifdef _XOPEN_SOURCE
4006                                 #error  expected _XOPEN_SOURCE to be undefined
4007                                 #endif
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f conftest.$ac_objext
4013 if { (eval echo "$as_me:4013: \"$ac_compile\"") >&5
4014   (eval $ac_compile) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); } &&
4018          { ac_try='test -s conftest.$ac_objext'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit $ac_status); }; }; then
4024   cf_cv_gnu_source=no
4025 else
4026   echo "$as_me: failed program was:" >&5
4027 cat conftest.$ac_ext >&5
4028 cf_cv_gnu_source=yes
4029 fi
4030 rm -f conftest.$ac_objext conftest.$ac_ext
4031                         CPPFLAGS="$cf_save"
4032
4033 fi
4034 rm -f conftest.$ac_objext conftest.$ac_ext
4035
4036 fi
4037 echo "$as_me:4037: result: $cf_cv_gnu_source" >&5
4038 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4039
4040                 if test "$cf_cv_gnu_source" = yes
4041                 then
4042                 echo "$as_me:4042: checking if we should also define _DEFAULT_SOURCE" >&5
4043 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4044 if test "${cf_cv_default_source+set}" = set; then
4045   echo $ECHO_N "(cached) $ECHO_C" >&6
4046 else
4047
4048         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4049         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4050
4051                         cat >conftest.$ac_ext <<_ACEOF
4052 #line 4052 "configure"
4053 #include "confdefs.h"
4054 #include <sys/types.h>
4055 int
4056 main (void)
4057 {
4058
4059                                 #ifdef _DEFAULT_SOURCE
4060                                 #error  expected _DEFAULT_SOURCE to be undefined
4061                                 #endif
4062   ;
4063   return 0;
4064 }
4065 _ACEOF
4066 rm -f conftest.$ac_objext
4067 if { (eval echo "$as_me:4067: \"$ac_compile\"") >&5
4068   (eval $ac_compile) 2>&5
4069   ac_status=$?
4070   echo "$as_me:4070: \$? = $ac_status" >&5
4071   (exit $ac_status); } &&
4072          { ac_try='test -s conftest.$ac_objext'
4073   { (eval echo "$as_me:4073: \"$ac_try\"") >&5
4074   (eval $ac_try) 2>&5
4075   ac_status=$?
4076   echo "$as_me:4076: \$? = $ac_status" >&5
4077   (exit $ac_status); }; }; then
4078   cf_cv_default_source=no
4079 else
4080   echo "$as_me: failed program was:" >&5
4081 cat conftest.$ac_ext >&5
4082 cf_cv_default_source=yes
4083 fi
4084 rm -f conftest.$ac_objext conftest.$ac_ext
4085
4086 fi
4087 echo "$as_me:4087: result: $cf_cv_default_source" >&5
4088 echo "${ECHO_T}$cf_cv_default_source" >&6
4089                         if test "$cf_cv_default_source" = yes
4090                         then
4091
4092         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4093         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4094
4095                         fi
4096                 fi
4097         fi
4098
4099 fi
4100
4101         ;;
4102 (minix*)
4103         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4104         ;;
4105 (mirbsd*)
4106         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4107         cf_XOPEN_SOURCE=
4108
4109 if test "$cf_cv_posix_visible" = no; then
4110
4111 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4112
4113 cf_save_CFLAGS="$CFLAGS"
4114 cf_save_CPPFLAGS="$CPPFLAGS"
4115
4116 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4117         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4118                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4119
4120 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4121         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4122                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4123
4124 echo "$as_me:4124: checking if we should define _POSIX_C_SOURCE" >&5
4125 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4126 if test "${cf_cv_posix_c_source+set}" = set; then
4127   echo $ECHO_N "(cached) $ECHO_C" >&6
4128 else
4129
4130 echo "${as_me:-configure}:4130: testing if the symbol is already defined go no further ..." 1>&5
4131
4132         cat >conftest.$ac_ext <<_ACEOF
4133 #line 4133 "configure"
4134 #include "confdefs.h"
4135 #include <sys/types.h>
4136 int
4137 main (void)
4138 {
4139
4140 #ifndef _POSIX_C_SOURCE
4141 make an error
4142 #endif
4143   ;
4144   return 0;
4145 }
4146 _ACEOF
4147 rm -f conftest.$ac_objext
4148 if { (eval echo "$as_me:4148: \"$ac_compile\"") >&5
4149   (eval $ac_compile) 2>&5
4150   ac_status=$?
4151   echo "$as_me:4151: \$? = $ac_status" >&5
4152   (exit $ac_status); } &&
4153          { ac_try='test -s conftest.$ac_objext'
4154   { (eval echo "$as_me:4154: \"$ac_try\"") >&5
4155   (eval $ac_try) 2>&5
4156   ac_status=$?
4157   echo "$as_me:4157: \$? = $ac_status" >&5
4158   (exit $ac_status); }; }; then
4159   cf_cv_posix_c_source=no
4160 else
4161   echo "$as_me: failed program was:" >&5
4162 cat conftest.$ac_ext >&5
4163 cf_want_posix_source=no
4164          case .$cf_POSIX_C_SOURCE in
4165          (.[12]??*)
4166                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4167                 ;;
4168          (.2)
4169                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4170                 cf_want_posix_source=yes
4171                 ;;
4172          (.*)
4173                 cf_want_posix_source=yes
4174                 ;;
4175          esac
4176          if test "$cf_want_posix_source" = yes ; then
4177                 cat >conftest.$ac_ext <<_ACEOF
4178 #line 4178 "configure"
4179 #include "confdefs.h"
4180 #include <sys/types.h>
4181 int
4182 main (void)
4183 {
4184
4185 #ifdef _POSIX_SOURCE
4186 make an error
4187 #endif
4188   ;
4189   return 0;
4190 }
4191 _ACEOF
4192 rm -f conftest.$ac_objext
4193 if { (eval echo "$as_me:4193: \"$ac_compile\"") >&5
4194   (eval $ac_compile) 2>&5
4195   ac_status=$?
4196   echo "$as_me:4196: \$? = $ac_status" >&5
4197   (exit $ac_status); } &&
4198          { ac_try='test -s conftest.$ac_objext'
4199   { (eval echo "$as_me:4199: \"$ac_try\"") >&5
4200   (eval $ac_try) 2>&5
4201   ac_status=$?
4202   echo "$as_me:4202: \$? = $ac_status" >&5
4203   (exit $ac_status); }; }; then
4204   :
4205 else
4206   echo "$as_me: failed program was:" >&5
4207 cat conftest.$ac_ext >&5
4208 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4209 fi
4210 rm -f conftest.$ac_objext conftest.$ac_ext
4211          fi
4212
4213 echo "${as_me:-configure}:4213: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4214
4215          CFLAGS="$cf_trim_CFLAGS"
4216          CPPFLAGS="$cf_trim_CPPFLAGS"
4217
4218         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4219         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4220
4221 echo "${as_me:-configure}:4221: testing if the second compile does not leave our definition intact error ..." 1>&5
4222
4223          cat >conftest.$ac_ext <<_ACEOF
4224 #line 4224 "configure"
4225 #include "confdefs.h"
4226 #include <sys/types.h>
4227 int
4228 main (void)
4229 {
4230
4231 #ifndef _POSIX_C_SOURCE
4232 make an error
4233 #endif
4234   ;
4235   return 0;
4236 }
4237 _ACEOF
4238 rm -f conftest.$ac_objext
4239 if { (eval echo "$as_me:4239: \"$ac_compile\"") >&5
4240   (eval $ac_compile) 2>&5
4241   ac_status=$?
4242   echo "$as_me:4242: \$? = $ac_status" >&5
4243   (exit $ac_status); } &&
4244          { ac_try='test -s conftest.$ac_objext'
4245   { (eval echo "$as_me:4245: \"$ac_try\"") >&5
4246   (eval $ac_try) 2>&5
4247   ac_status=$?
4248   echo "$as_me:4248: \$? = $ac_status" >&5
4249   (exit $ac_status); }; }; then
4250   :
4251 else
4252   echo "$as_me: failed program was:" >&5
4253 cat conftest.$ac_ext >&5
4254 cf_cv_posix_c_source=no
4255 fi
4256 rm -f conftest.$ac_objext conftest.$ac_ext
4257          CFLAGS="$cf_save_CFLAGS"
4258          CPPFLAGS="$cf_save_CPPFLAGS"
4259
4260 fi
4261 rm -f conftest.$ac_objext conftest.$ac_ext
4262
4263 fi
4264 echo "$as_me:4264: result: $cf_cv_posix_c_source" >&5
4265 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4266
4267 if test "$cf_cv_posix_c_source" != no ; then
4268         CFLAGS="$cf_trim_CFLAGS"
4269         CPPFLAGS="$cf_trim_CPPFLAGS"
4270
4271 cf_fix_cppflags=no
4272 cf_new_cflags=
4273 cf_new_cppflags=
4274 cf_new_extra_cppflags=
4275
4276 for cf_add_cflags in $cf_cv_posix_c_source
4277 do
4278 case $cf_fix_cppflags in
4279 (no)
4280         case $cf_add_cflags in
4281         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4282                 case $cf_add_cflags in
4283                 (-D*)
4284                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4285
4286                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4287                                 && test -z "${cf_tst_cflags}" \
4288                                 && cf_fix_cppflags=yes
4289
4290                         if test $cf_fix_cppflags = yes ; then
4291
4292         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4293         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4294
4295                                 continue
4296                         elif test "${cf_tst_cflags}" = "\"'" ; then
4297
4298         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4299         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4300
4301                                 continue
4302                         fi
4303                         ;;
4304                 esac
4305                 case "$CPPFLAGS" in
4306                 (*$cf_add_cflags)
4307                         ;;
4308                 (*)
4309                         case $cf_add_cflags in
4310                         (-D*)
4311                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4312
4313 CPPFLAGS=`echo "$CPPFLAGS" | \
4314         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4315                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4316
4317                                 ;;
4318                         esac
4319
4320         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4321         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4322
4323                         ;;
4324                 esac
4325                 ;;
4326         (*)
4327
4328         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4329         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4330
4331                 ;;
4332         esac
4333         ;;
4334 (yes)
4335
4336         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4337         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4338
4339         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4340
4341         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4342                 && test -z "${cf_tst_cflags}" \
4343                 && cf_fix_cppflags=no
4344         ;;
4345 esac
4346 done
4347
4348 if test -n "$cf_new_cflags" ; then
4349
4350         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4351         CFLAGS="${CFLAGS}$cf_new_cflags"
4352
4353 fi
4354
4355 if test -n "$cf_new_cppflags" ; then
4356
4357         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4358         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4359
4360 fi
4361
4362 if test -n "$cf_new_extra_cppflags" ; then
4363
4364         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4365         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4366
4367 fi
4368
4369 fi
4370
4371 fi # cf_cv_posix_visible
4372
4373         ;;
4374 (netbsd*)
4375         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4376         ;;
4377 (openbsd[4-9]*)
4378         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4379         cf_xopen_source="-D_BSD_SOURCE"
4380         cf_XOPEN_SOURCE=600
4381         ;;
4382 (openbsd*)
4383         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4384         ;;
4385 (osf[45]*)
4386         cf_xopen_source="-D_OSF_SOURCE"
4387         ;;
4388 (nto-qnx*)
4389         cf_xopen_source="-D_QNX_SOURCE"
4390         ;;
4391 (sco*)
4392         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4393         ;;
4394 (solaris2.*)
4395         cf_xopen_source="-D__EXTENSIONS__"
4396         cf_cv_xopen_source=broken
4397         ;;
4398 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4399         cf_XOPEN_SOURCE=
4400         cf_POSIX_C_SOURCE=
4401         ;;
4402 (*)
4403
4404 echo "$as_me:4404: checking if we should define _XOPEN_SOURCE" >&5
4405 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4406 if test "${cf_cv_xopen_source+set}" = set; then
4407   echo $ECHO_N "(cached) $ECHO_C" >&6
4408 else
4409
4410         cat >conftest.$ac_ext <<_ACEOF
4411 #line 4411 "configure"
4412 #include "confdefs.h"
4413
4414 #include <stdlib.h>
4415 #include <string.h>
4416 #include <sys/types.h>
4417
4418 int
4419 main (void)
4420 {
4421
4422 #ifndef _XOPEN_SOURCE
4423 make an error
4424 #endif
4425   ;
4426   return 0;
4427 }
4428 _ACEOF
4429 rm -f conftest.$ac_objext
4430 if { (eval echo "$as_me:4430: \"$ac_compile\"") >&5
4431   (eval $ac_compile) 2>&5
4432   ac_status=$?
4433   echo "$as_me:4433: \$? = $ac_status" >&5
4434   (exit $ac_status); } &&
4435          { ac_try='test -s conftest.$ac_objext'
4436   { (eval echo "$as_me:4436: \"$ac_try\"") >&5
4437   (eval $ac_try) 2>&5
4438   ac_status=$?
4439   echo "$as_me:4439: \$? = $ac_status" >&5
4440   (exit $ac_status); }; }; then
4441   cf_cv_xopen_source=no
4442 else
4443   echo "$as_me: failed program was:" >&5
4444 cat conftest.$ac_ext >&5
4445 cf_save="$CPPFLAGS"
4446
4447         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4448         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4449
4450          cat >conftest.$ac_ext <<_ACEOF
4451 #line 4451 "configure"
4452 #include "confdefs.h"
4453
4454 #include <stdlib.h>
4455 #include <string.h>
4456 #include <sys/types.h>
4457
4458 int
4459 main (void)
4460 {
4461
4462 #ifdef _XOPEN_SOURCE
4463 make an error
4464 #endif
4465   ;
4466   return 0;
4467 }
4468 _ACEOF
4469 rm -f conftest.$ac_objext
4470 if { (eval echo "$as_me:4470: \"$ac_compile\"") >&5
4471   (eval $ac_compile) 2>&5
4472   ac_status=$?
4473   echo "$as_me:4473: \$? = $ac_status" >&5
4474   (exit $ac_status); } &&
4475          { ac_try='test -s conftest.$ac_objext'
4476   { (eval echo "$as_me:4476: \"$ac_try\"") >&5
4477   (eval $ac_try) 2>&5
4478   ac_status=$?
4479   echo "$as_me:4479: \$? = $ac_status" >&5
4480   (exit $ac_status); }; }; then
4481   cf_cv_xopen_source=no
4482 else
4483   echo "$as_me: failed program was:" >&5
4484 cat conftest.$ac_ext >&5
4485 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4486 fi
4487 rm -f conftest.$ac_objext conftest.$ac_ext
4488         CPPFLAGS="$cf_save"
4489
4490 fi
4491 rm -f conftest.$ac_objext conftest.$ac_ext
4492
4493 fi
4494 echo "$as_me:4494: result: $cf_cv_xopen_source" >&5
4495 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4496
4497 if test "$cf_cv_xopen_source" != no ; then
4498
4499 CFLAGS=`echo "$CFLAGS" | \
4500         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4501                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4502
4503 CPPFLAGS=`echo "$CPPFLAGS" | \
4504         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4505                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4506
4507         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4508
4509 cf_fix_cppflags=no
4510 cf_new_cflags=
4511 cf_new_cppflags=
4512 cf_new_extra_cppflags=
4513
4514 for cf_add_cflags in $cf_temp_xopen_source
4515 do
4516 case $cf_fix_cppflags in
4517 (no)
4518         case $cf_add_cflags in
4519         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4520                 case $cf_add_cflags in
4521                 (-D*)
4522                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4523
4524                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4525                                 && test -z "${cf_tst_cflags}" \
4526                                 && cf_fix_cppflags=yes
4527
4528                         if test $cf_fix_cppflags = yes ; then
4529
4530         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4531         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4532
4533                                 continue
4534                         elif test "${cf_tst_cflags}" = "\"'" ; then
4535
4536         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4537         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4538
4539                                 continue
4540                         fi
4541                         ;;
4542                 esac
4543                 case "$CPPFLAGS" in
4544                 (*$cf_add_cflags)
4545                         ;;
4546                 (*)
4547                         case $cf_add_cflags in
4548                         (-D*)
4549                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4550
4551 CPPFLAGS=`echo "$CPPFLAGS" | \
4552         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4553                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4554
4555                                 ;;
4556                         esac
4557
4558         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4559         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4560
4561                         ;;
4562                 esac
4563                 ;;
4564         (*)
4565
4566         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4567         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4568
4569                 ;;
4570         esac
4571         ;;
4572 (yes)
4573
4574         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4575         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4576
4577         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4578
4579         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4580                 && test -z "${cf_tst_cflags}" \
4581                 && cf_fix_cppflags=no
4582         ;;
4583 esac
4584 done
4585
4586 if test -n "$cf_new_cflags" ; then
4587
4588         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4589         CFLAGS="${CFLAGS}$cf_new_cflags"
4590
4591 fi
4592
4593 if test -n "$cf_new_cppflags" ; then
4594
4595         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4596         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4597
4598 fi
4599
4600 if test -n "$cf_new_extra_cppflags" ; then
4601
4602         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4603         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4604
4605 fi
4606
4607 fi
4608
4609 if test "$cf_cv_posix_visible" = no; then
4610
4611 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4612
4613 cf_save_CFLAGS="$CFLAGS"
4614 cf_save_CPPFLAGS="$CPPFLAGS"
4615
4616 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4617         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4618                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4619
4620 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4621         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4622                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4623
4624 echo "$as_me:4624: checking if we should define _POSIX_C_SOURCE" >&5
4625 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4626 if test "${cf_cv_posix_c_source+set}" = set; then
4627   echo $ECHO_N "(cached) $ECHO_C" >&6
4628 else
4629
4630 echo "${as_me:-configure}:4630: testing if the symbol is already defined go no further ..." 1>&5
4631
4632         cat >conftest.$ac_ext <<_ACEOF
4633 #line 4633 "configure"
4634 #include "confdefs.h"
4635 #include <sys/types.h>
4636 int
4637 main (void)
4638 {
4639
4640 #ifndef _POSIX_C_SOURCE
4641 make an error
4642 #endif
4643   ;
4644   return 0;
4645 }
4646 _ACEOF
4647 rm -f conftest.$ac_objext
4648 if { (eval echo "$as_me:4648: \"$ac_compile\"") >&5
4649   (eval $ac_compile) 2>&5
4650   ac_status=$?
4651   echo "$as_me:4651: \$? = $ac_status" >&5
4652   (exit $ac_status); } &&
4653          { ac_try='test -s conftest.$ac_objext'
4654   { (eval echo "$as_me:4654: \"$ac_try\"") >&5
4655   (eval $ac_try) 2>&5
4656   ac_status=$?
4657   echo "$as_me:4657: \$? = $ac_status" >&5
4658   (exit $ac_status); }; }; then
4659   cf_cv_posix_c_source=no
4660 else
4661   echo "$as_me: failed program was:" >&5
4662 cat conftest.$ac_ext >&5
4663 cf_want_posix_source=no
4664          case .$cf_POSIX_C_SOURCE in
4665          (.[12]??*)
4666                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4667                 ;;
4668          (.2)
4669                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4670                 cf_want_posix_source=yes
4671                 ;;
4672          (.*)
4673                 cf_want_posix_source=yes
4674                 ;;
4675          esac
4676          if test "$cf_want_posix_source" = yes ; then
4677                 cat >conftest.$ac_ext <<_ACEOF
4678 #line 4678 "configure"
4679 #include "confdefs.h"
4680 #include <sys/types.h>
4681 int
4682 main (void)
4683 {
4684
4685 #ifdef _POSIX_SOURCE
4686 make an error
4687 #endif
4688   ;
4689   return 0;
4690 }
4691 _ACEOF
4692 rm -f conftest.$ac_objext
4693 if { (eval echo "$as_me:4693: \"$ac_compile\"") >&5
4694   (eval $ac_compile) 2>&5
4695   ac_status=$?
4696   echo "$as_me:4696: \$? = $ac_status" >&5
4697   (exit $ac_status); } &&
4698          { ac_try='test -s conftest.$ac_objext'
4699   { (eval echo "$as_me:4699: \"$ac_try\"") >&5
4700   (eval $ac_try) 2>&5
4701   ac_status=$?
4702   echo "$as_me:4702: \$? = $ac_status" >&5
4703   (exit $ac_status); }; }; then
4704   :
4705 else
4706   echo "$as_me: failed program was:" >&5
4707 cat conftest.$ac_ext >&5
4708 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4709 fi
4710 rm -f conftest.$ac_objext conftest.$ac_ext
4711          fi
4712
4713 echo "${as_me:-configure}:4713: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4714
4715          CFLAGS="$cf_trim_CFLAGS"
4716          CPPFLAGS="$cf_trim_CPPFLAGS"
4717
4718         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4719         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4720
4721 echo "${as_me:-configure}:4721: testing if the second compile does not leave our definition intact error ..." 1>&5
4722
4723          cat >conftest.$ac_ext <<_ACEOF
4724 #line 4724 "configure"
4725 #include "confdefs.h"
4726 #include <sys/types.h>
4727 int
4728 main (void)
4729 {
4730
4731 #ifndef _POSIX_C_SOURCE
4732 make an error
4733 #endif
4734   ;
4735   return 0;
4736 }
4737 _ACEOF
4738 rm -f conftest.$ac_objext
4739 if { (eval echo "$as_me:4739: \"$ac_compile\"") >&5
4740   (eval $ac_compile) 2>&5
4741   ac_status=$?
4742   echo "$as_me:4742: \$? = $ac_status" >&5
4743   (exit $ac_status); } &&
4744          { ac_try='test -s conftest.$ac_objext'
4745   { (eval echo "$as_me:4745: \"$ac_try\"") >&5
4746   (eval $ac_try) 2>&5
4747   ac_status=$?
4748   echo "$as_me:4748: \$? = $ac_status" >&5
4749   (exit $ac_status); }; }; then
4750   :
4751 else
4752   echo "$as_me: failed program was:" >&5
4753 cat conftest.$ac_ext >&5
4754 cf_cv_posix_c_source=no
4755 fi
4756 rm -f conftest.$ac_objext conftest.$ac_ext
4757          CFLAGS="$cf_save_CFLAGS"
4758          CPPFLAGS="$cf_save_CPPFLAGS"
4759
4760 fi
4761 rm -f conftest.$ac_objext conftest.$ac_ext
4762
4763 fi
4764 echo "$as_me:4764: result: $cf_cv_posix_c_source" >&5
4765 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4766
4767 if test "$cf_cv_posix_c_source" != no ; then
4768         CFLAGS="$cf_trim_CFLAGS"
4769         CPPFLAGS="$cf_trim_CPPFLAGS"
4770
4771 cf_fix_cppflags=no
4772 cf_new_cflags=
4773 cf_new_cppflags=
4774 cf_new_extra_cppflags=
4775
4776 for cf_add_cflags in $cf_cv_posix_c_source
4777 do
4778 case $cf_fix_cppflags in
4779 (no)
4780         case $cf_add_cflags in
4781         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4782                 case $cf_add_cflags in
4783                 (-D*)
4784                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4785
4786                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4787                                 && test -z "${cf_tst_cflags}" \
4788                                 && cf_fix_cppflags=yes
4789
4790                         if test $cf_fix_cppflags = yes ; then
4791
4792         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4793         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4794
4795                                 continue
4796                         elif test "${cf_tst_cflags}" = "\"'" ; then
4797
4798         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4799         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4800
4801                                 continue
4802                         fi
4803                         ;;
4804                 esac
4805                 case "$CPPFLAGS" in
4806                 (*$cf_add_cflags)
4807                         ;;
4808                 (*)
4809                         case $cf_add_cflags in
4810                         (-D*)
4811                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4812
4813 CPPFLAGS=`echo "$CPPFLAGS" | \
4814         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4815                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4816
4817                                 ;;
4818                         esac
4819
4820         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4821         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4822
4823                         ;;
4824                 esac
4825                 ;;
4826         (*)
4827
4828         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4829         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4830
4831                 ;;
4832         esac
4833         ;;
4834 (yes)
4835
4836         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4837         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4838
4839         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4840
4841         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4842                 && test -z "${cf_tst_cflags}" \
4843                 && cf_fix_cppflags=no
4844         ;;
4845 esac
4846 done
4847
4848 if test -n "$cf_new_cflags" ; then
4849
4850         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4851         CFLAGS="${CFLAGS}$cf_new_cflags"
4852
4853 fi
4854
4855 if test -n "$cf_new_cppflags" ; then
4856
4857         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4858         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4859
4860 fi
4861
4862 if test -n "$cf_new_extra_cppflags" ; then
4863
4864         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4865         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4866
4867 fi
4868
4869 fi
4870
4871 fi # cf_cv_posix_visible
4872
4873         ;;
4874 esac
4875
4876 if test -n "$cf_xopen_source" ; then
4877
4878 cf_fix_cppflags=no
4879 cf_new_cflags=
4880 cf_new_cppflags=
4881 cf_new_extra_cppflags=
4882
4883 for cf_add_cflags in $cf_xopen_source
4884 do
4885 case $cf_fix_cppflags in
4886 (no)
4887         case $cf_add_cflags in
4888         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4889                 case $cf_add_cflags in
4890                 (-D*)
4891                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4892
4893                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4894                                 && test -z "${cf_tst_cflags}" \
4895                                 && cf_fix_cppflags=yes
4896
4897                         if test $cf_fix_cppflags = yes ; then
4898
4899         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4900         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4901
4902                                 continue
4903                         elif test "${cf_tst_cflags}" = "\"'" ; then
4904
4905         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4906         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4907
4908                                 continue
4909                         fi
4910                         ;;
4911                 esac
4912                 case "$CPPFLAGS" in
4913                 (*$cf_add_cflags)
4914                         ;;
4915                 (*)
4916                         case $cf_add_cflags in
4917                         (-D*)
4918                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4919
4920 CPPFLAGS=`echo "$CPPFLAGS" | \
4921         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4922                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4923
4924                                 ;;
4925                         esac
4926
4927         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4928         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4929
4930                         ;;
4931                 esac
4932                 ;;
4933         (*)
4934
4935         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4936         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4937
4938                 ;;
4939         esac
4940         ;;
4941 (yes)
4942
4943         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4944         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4945
4946         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4947
4948         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4949                 && test -z "${cf_tst_cflags}" \
4950                 && cf_fix_cppflags=no
4951         ;;
4952 esac
4953 done
4954
4955 if test -n "$cf_new_cflags" ; then
4956         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4957
4958 echo "${as_me:-configure}:4958: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4959
4960         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4961         CFLAGS="${CFLAGS}$cf_new_cflags"
4962
4963 fi
4964
4965 if test -n "$cf_new_cppflags" ; then
4966         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4967
4968 echo "${as_me:-configure}:4968: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4969
4970         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4971         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4972
4973 fi
4974
4975 if test -n "$cf_new_extra_cppflags" ; then
4976         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4977
4978 echo "${as_me:-configure}:4978: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4979
4980         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4981         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4982
4983 fi
4984
4985 fi
4986
4987 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4988         echo "$as_me:4988: checking if _XOPEN_SOURCE really is set" >&5
4989 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4990         cat >conftest.$ac_ext <<_ACEOF
4991 #line 4991 "configure"
4992 #include "confdefs.h"
4993 #include <stdlib.h>
4994 int
4995 main (void)
4996 {
4997
4998 #ifndef _XOPEN_SOURCE
4999 make an error
5000 #endif
5001   ;
5002   return 0;
5003 }
5004 _ACEOF
5005 rm -f conftest.$ac_objext
5006 if { (eval echo "$as_me:5006: \"$ac_compile\"") >&5
5007   (eval $ac_compile) 2>&5
5008   ac_status=$?
5009   echo "$as_me:5009: \$? = $ac_status" >&5
5010   (exit $ac_status); } &&
5011          { ac_try='test -s conftest.$ac_objext'
5012   { (eval echo "$as_me:5012: \"$ac_try\"") >&5
5013   (eval $ac_try) 2>&5
5014   ac_status=$?
5015   echo "$as_me:5015: \$? = $ac_status" >&5
5016   (exit $ac_status); }; }; then
5017   cf_XOPEN_SOURCE_set=yes
5018 else
5019   echo "$as_me: failed program was:" >&5
5020 cat conftest.$ac_ext >&5
5021 cf_XOPEN_SOURCE_set=no
5022 fi
5023 rm -f conftest.$ac_objext conftest.$ac_ext
5024         echo "$as_me:5024: result: $cf_XOPEN_SOURCE_set" >&5
5025 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5026         if test $cf_XOPEN_SOURCE_set = yes
5027         then
5028                 cat >conftest.$ac_ext <<_ACEOF
5029 #line 5029 "configure"
5030 #include "confdefs.h"
5031 #include <stdlib.h>
5032 int
5033 main (void)
5034 {
5035
5036 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5037 make an error
5038 #endif
5039   ;
5040   return 0;
5041 }
5042 _ACEOF
5043 rm -f conftest.$ac_objext
5044 if { (eval echo "$as_me:5044: \"$ac_compile\"") >&5
5045   (eval $ac_compile) 2>&5
5046   ac_status=$?
5047   echo "$as_me:5047: \$? = $ac_status" >&5
5048   (exit $ac_status); } &&
5049          { ac_try='test -s conftest.$ac_objext'
5050   { (eval echo "$as_me:5050: \"$ac_try\"") >&5
5051   (eval $ac_try) 2>&5
5052   ac_status=$?
5053   echo "$as_me:5053: \$? = $ac_status" >&5
5054   (exit $ac_status); }; }; then
5055   cf_XOPEN_SOURCE_set_ok=yes
5056 else
5057   echo "$as_me: failed program was:" >&5
5058 cat conftest.$ac_ext >&5
5059 cf_XOPEN_SOURCE_set_ok=no
5060 fi
5061 rm -f conftest.$ac_objext conftest.$ac_ext
5062                 if test $cf_XOPEN_SOURCE_set_ok = no
5063                 then
5064                         { echo "$as_me:5064: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5065 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5066                 fi
5067         else
5068
5069 echo "$as_me:5069: checking if we should define _XOPEN_SOURCE" >&5
5070 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5071 if test "${cf_cv_xopen_source+set}" = set; then
5072   echo $ECHO_N "(cached) $ECHO_C" >&6
5073 else
5074
5075         cat >conftest.$ac_ext <<_ACEOF
5076 #line 5076 "configure"
5077 #include "confdefs.h"
5078
5079 #include <stdlib.h>
5080 #include <string.h>
5081 #include <sys/types.h>
5082
5083 int
5084 main (void)
5085 {
5086
5087 #ifndef _XOPEN_SOURCE
5088 make an error
5089 #endif
5090   ;
5091   return 0;
5092 }
5093 _ACEOF
5094 rm -f conftest.$ac_objext
5095 if { (eval echo "$as_me:5095: \"$ac_compile\"") >&5
5096   (eval $ac_compile) 2>&5
5097   ac_status=$?
5098   echo "$as_me:5098: \$? = $ac_status" >&5
5099   (exit $ac_status); } &&
5100          { ac_try='test -s conftest.$ac_objext'
5101   { (eval echo "$as_me:5101: \"$ac_try\"") >&5
5102   (eval $ac_try) 2>&5
5103   ac_status=$?
5104   echo "$as_me:5104: \$? = $ac_status" >&5
5105   (exit $ac_status); }; }; then
5106   cf_cv_xopen_source=no
5107 else
5108   echo "$as_me: failed program was:" >&5
5109 cat conftest.$ac_ext >&5
5110 cf_save="$CPPFLAGS"
5111
5112         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5113         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5114
5115          cat >conftest.$ac_ext <<_ACEOF
5116 #line 5116 "configure"
5117 #include "confdefs.h"
5118
5119 #include <stdlib.h>
5120 #include <string.h>
5121 #include <sys/types.h>
5122
5123 int
5124 main (void)
5125 {
5126
5127 #ifdef _XOPEN_SOURCE
5128 make an error
5129 #endif
5130   ;
5131   return 0;
5132 }
5133 _ACEOF
5134 rm -f conftest.$ac_objext
5135 if { (eval echo "$as_me:5135: \"$ac_compile\"") >&5
5136   (eval $ac_compile) 2>&5
5137   ac_status=$?
5138   echo "$as_me:5138: \$? = $ac_status" >&5
5139   (exit $ac_status); } &&
5140          { ac_try='test -s conftest.$ac_objext'
5141   { (eval echo "$as_me:5141: \"$ac_try\"") >&5
5142   (eval $ac_try) 2>&5
5143   ac_status=$?
5144   echo "$as_me:5144: \$? = $ac_status" >&5
5145   (exit $ac_status); }; }; then
5146   cf_cv_xopen_source=no
5147 else
5148   echo "$as_me: failed program was:" >&5
5149 cat conftest.$ac_ext >&5
5150 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5151 fi
5152 rm -f conftest.$ac_objext conftest.$ac_ext
5153         CPPFLAGS="$cf_save"
5154
5155 fi
5156 rm -f conftest.$ac_objext conftest.$ac_ext
5157
5158 fi
5159 echo "$as_me:5159: result: $cf_cv_xopen_source" >&5
5160 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5161
5162 if test "$cf_cv_xopen_source" != no ; then
5163
5164 CFLAGS=`echo "$CFLAGS" | \
5165         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5166                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5167
5168 CPPFLAGS=`echo "$CPPFLAGS" | \
5169         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5170                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5171
5172         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5173
5174 cf_fix_cppflags=no
5175 cf_new_cflags=
5176 cf_new_cppflags=
5177 cf_new_extra_cppflags=
5178
5179 for cf_add_cflags in $cf_temp_xopen_source
5180 do
5181 case $cf_fix_cppflags in
5182 (no)
5183         case $cf_add_cflags in
5184         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5185                 case $cf_add_cflags in
5186                 (-D*)
5187                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5188
5189                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5190                                 && test -z "${cf_tst_cflags}" \
5191                                 && cf_fix_cppflags=yes
5192
5193                         if test $cf_fix_cppflags = yes ; then
5194
5195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5197
5198                                 continue
5199                         elif test "${cf_tst_cflags}" = "\"'" ; then
5200
5201         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5202         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5203
5204                                 continue
5205                         fi
5206                         ;;
5207                 esac
5208                 case "$CPPFLAGS" in
5209                 (*$cf_add_cflags)
5210                         ;;
5211                 (*)
5212                         case $cf_add_cflags in
5213                         (-D*)
5214                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5215
5216 CPPFLAGS=`echo "$CPPFLAGS" | \
5217         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5218                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5219
5220                                 ;;
5221                         esac
5222
5223         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5224         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5225
5226                         ;;
5227                 esac
5228                 ;;
5229         (*)
5230
5231         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5232         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5233
5234                 ;;
5235         esac
5236         ;;
5237 (yes)
5238
5239         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5240         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5241
5242         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5243
5244         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5245                 && test -z "${cf_tst_cflags}" \
5246                 && cf_fix_cppflags=no
5247         ;;
5248 esac
5249 done
5250
5251 if test -n "$cf_new_cflags" ; then
5252
5253         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5254         CFLAGS="${CFLAGS}$cf_new_cflags"
5255
5256 fi
5257
5258 if test -n "$cf_new_cppflags" ; then
5259
5260         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5261         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5262
5263 fi
5264
5265 if test -n "$cf_new_extra_cppflags" ; then
5266
5267         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5268         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5269
5270 fi
5271
5272 fi
5273
5274         fi
5275 fi
5276 fi # cf_cv_posix_visible
5277
5278 echo "$as_me:5278: checking for signal global datatype" >&5
5279 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5280 if test "${cf_cv_sig_atomic_t+set}" = set; then
5281   echo $ECHO_N "(cached) $ECHO_C" >&6
5282 else
5283
5284         for cf_type in \
5285                 "volatile sig_atomic_t" \
5286                 "sig_atomic_t" \
5287                 "int"
5288         do
5289         cat >conftest.$ac_ext <<_ACEOF
5290 #line 5290 "configure"
5291 #include "confdefs.h"
5292
5293 #include <sys/types.h>
5294 #include <signal.h>
5295 #include <stdio.h>
5296
5297 extern $cf_type x;
5298 $cf_type x;
5299 static void handler(int sig)
5300 {
5301         (void)sig;
5302         x = 5;
5303 }
5304 int
5305 main (void)
5306 {
5307 signal(SIGINT, handler);
5308                  x = 1
5309   ;
5310   return 0;
5311 }
5312 _ACEOF
5313 rm -f conftest.$ac_objext
5314 if { (eval echo "$as_me:5314: \"$ac_compile\"") >&5
5315   (eval $ac_compile) 2>&5
5316   ac_status=$?
5317   echo "$as_me:5317: \$? = $ac_status" >&5
5318   (exit $ac_status); } &&
5319          { ac_try='test -s conftest.$ac_objext'
5320   { (eval echo "$as_me:5320: \"$ac_try\"") >&5
5321   (eval $ac_try) 2>&5
5322   ac_status=$?
5323   echo "$as_me:5323: \$? = $ac_status" >&5
5324   (exit $ac_status); }; }; then
5325   cf_cv_sig_atomic_t=$cf_type
5326 else
5327   echo "$as_me: failed program was:" >&5
5328 cat conftest.$ac_ext >&5
5329 cf_cv_sig_atomic_t=no
5330 fi
5331 rm -f conftest.$ac_objext conftest.$ac_ext
5332                 test "$cf_cv_sig_atomic_t" != no && break
5333         done
5334
5335 fi
5336
5337 echo "$as_me:5337: result: $cf_cv_sig_atomic_t" >&5
5338 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5339 test "$cf_cv_sig_atomic_t" != no &&
5340 cat >>confdefs.h <<EOF
5341 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5342 EOF
5343
5344 # Work around breakage on OS X
5345
5346 echo "$as_me:5346: checking if SIGWINCH is defined" >&5
5347 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5348 if test "${cf_cv_define_sigwinch+set}" = set; then
5349   echo $ECHO_N "(cached) $ECHO_C" >&6
5350 else
5351
5352         cat >conftest.$ac_ext <<_ACEOF
5353 #line 5353 "configure"
5354 #include "confdefs.h"
5355
5356 #include <sys/types.h>
5357 #include <sys/signal.h>
5358
5359 int
5360 main (void)
5361 {
5362 int x = SIGWINCH; (void)x
5363   ;
5364   return 0;
5365 }
5366 _ACEOF
5367 rm -f conftest.$ac_objext
5368 if { (eval echo "$as_me:5368: \"$ac_compile\"") >&5
5369   (eval $ac_compile) 2>&5
5370   ac_status=$?
5371   echo "$as_me:5371: \$? = $ac_status" >&5
5372   (exit $ac_status); } &&
5373          { ac_try='test -s conftest.$ac_objext'
5374   { (eval echo "$as_me:5374: \"$ac_try\"") >&5
5375   (eval $ac_try) 2>&5
5376   ac_status=$?
5377   echo "$as_me:5377: \$? = $ac_status" >&5
5378   (exit $ac_status); }; }; then
5379   cf_cv_define_sigwinch=yes
5380 else
5381   echo "$as_me: failed program was:" >&5
5382 cat conftest.$ac_ext >&5
5383 cat >conftest.$ac_ext <<_ACEOF
5384 #line 5384 "configure"
5385 #include "confdefs.h"
5386
5387 #undef _XOPEN_SOURCE
5388 #undef _POSIX_SOURCE
5389 #undef _POSIX_C_SOURCE
5390 #include <sys/types.h>
5391 #include <sys/signal.h>
5392
5393 int
5394 main (void)
5395 {
5396 int x = SIGWINCH; (void)x
5397   ;
5398   return 0;
5399 }
5400 _ACEOF
5401 rm -f conftest.$ac_objext
5402 if { (eval echo "$as_me:5402: \"$ac_compile\"") >&5
5403   (eval $ac_compile) 2>&5
5404   ac_status=$?
5405   echo "$as_me:5405: \$? = $ac_status" >&5
5406   (exit $ac_status); } &&
5407          { ac_try='test -s conftest.$ac_objext'
5408   { (eval echo "$as_me:5408: \"$ac_try\"") >&5
5409   (eval $ac_try) 2>&5
5410   ac_status=$?
5411   echo "$as_me:5411: \$? = $ac_status" >&5
5412   (exit $ac_status); }; }; then
5413   cf_cv_define_sigwinch=maybe
5414 else
5415   echo "$as_me: failed program was:" >&5
5416 cat conftest.$ac_ext >&5
5417 cf_cv_define_sigwinch=no
5418 fi
5419 rm -f conftest.$ac_objext conftest.$ac_ext
5420
5421 fi
5422 rm -f conftest.$ac_objext conftest.$ac_ext
5423
5424 fi
5425 echo "$as_me:5425: result: $cf_cv_define_sigwinch" >&5
5426 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5427
5428 if test "$cf_cv_define_sigwinch" = maybe ; then
5429 echo "$as_me:5429: checking for actual SIGWINCH definition" >&5
5430 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5431 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5432   echo $ECHO_N "(cached) $ECHO_C" >&6
5433 else
5434
5435 cf_cv_fixup_sigwinch=unknown
5436 cf_sigwinch=32
5437 while test $cf_sigwinch != 1
5438 do
5439         cat >conftest.$ac_ext <<_ACEOF
5440 #line 5440 "configure"
5441 #include "confdefs.h"
5442
5443 #undef _XOPEN_SOURCE
5444 #undef _POSIX_SOURCE
5445 #undef _POSIX_C_SOURCE
5446 #include <sys/types.h>
5447 #include <sys/signal.h>
5448
5449 int
5450 main (void)
5451 {
5452
5453 #if SIGWINCH != $cf_sigwinch
5454 make an error
5455 #endif
5456 int x = SIGWINCH; (void)x
5457   ;
5458   return 0;
5459 }
5460 _ACEOF
5461 rm -f conftest.$ac_objext
5462 if { (eval echo "$as_me:5462: \"$ac_compile\"") >&5
5463   (eval $ac_compile) 2>&5
5464   ac_status=$?
5465   echo "$as_me:5465: \$? = $ac_status" >&5
5466   (exit $ac_status); } &&
5467          { ac_try='test -s conftest.$ac_objext'
5468   { (eval echo "$as_me:5468: \"$ac_try\"") >&5
5469   (eval $ac_try) 2>&5
5470   ac_status=$?
5471   echo "$as_me:5471: \$? = $ac_status" >&5
5472   (exit $ac_status); }; }; then
5473   cf_cv_fixup_sigwinch=$cf_sigwinch
5474          break
5475 else
5476   echo "$as_me: failed program was:" >&5
5477 cat conftest.$ac_ext >&5
5478 fi
5479 rm -f conftest.$ac_objext conftest.$ac_ext
5480
5481 cf_sigwinch=`expr $cf_sigwinch - 1`
5482 done
5483
5484 fi
5485 echo "$as_me:5485: result: $cf_cv_fixup_sigwinch" >&5
5486 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5487
5488         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5489                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5490         fi
5491 fi
5492
5493 # Checks for CODESET support.
5494
5495 echo "$as_me:5495: checking for nl_langinfo and CODESET" >&5
5496 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5497 if test "${am_cv_langinfo_codeset+set}" = set; then
5498   echo $ECHO_N "(cached) $ECHO_C" >&6
5499 else
5500   cat >conftest.$ac_ext <<_ACEOF
5501 #line 5501 "configure"
5502 #include "confdefs.h"
5503 #include <langinfo.h>
5504 int
5505 main (void)
5506 {
5507 char* cs = nl_langinfo(CODESET); (void)cs
5508   ;
5509   return 0;
5510 }
5511 _ACEOF
5512 rm -f conftest.$ac_objext conftest$ac_exeext
5513 if { (eval echo "$as_me:5513: \"$ac_link\"") >&5
5514   (eval $ac_link) 2>&5
5515   ac_status=$?
5516   echo "$as_me:5516: \$? = $ac_status" >&5
5517   (exit $ac_status); } &&
5518          { ac_try='test -s conftest$ac_exeext'
5519   { (eval echo "$as_me:5519: \"$ac_try\"") >&5
5520   (eval $ac_try) 2>&5
5521   ac_status=$?
5522   echo "$as_me:5522: \$? = $ac_status" >&5
5523   (exit $ac_status); }; }; then
5524   am_cv_langinfo_codeset=yes
5525 else
5526   echo "$as_me: failed program was:" >&5
5527 cat conftest.$ac_ext >&5
5528 am_cv_langinfo_codeset=no
5529 fi
5530 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5531
5532 fi
5533 echo "$as_me:5533: result: $am_cv_langinfo_codeset" >&5
5534 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5535         if test $am_cv_langinfo_codeset = yes; then
5536
5537 cat >>confdefs.h <<\EOF
5538 #define HAVE_LANGINFO_CODESET 1
5539 EOF
5540
5541         fi
5542
5543 echo "$as_me:5543: checking if you want to use pkg-config" >&5
5544 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5545
5546 # Check whether --with-pkg-config or --without-pkg-config was given.
5547 if test "${with_pkg_config+set}" = set; then
5548   withval="$with_pkg_config"
5549   cf_pkg_config=$withval
5550 else
5551   cf_pkg_config=yes
5552 fi;
5553 echo "$as_me:5553: result: $cf_pkg_config" >&5
5554 echo "${ECHO_T}$cf_pkg_config" >&6
5555
5556 case $cf_pkg_config in
5557 (no)
5558         PKG_CONFIG=none
5559         ;;
5560 (yes)
5561
5562 if test -n "$ac_tool_prefix"; then
5563   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5564 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5565 echo "$as_me:5565: checking for $ac_word" >&5
5566 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5567 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5568   echo $ECHO_N "(cached) $ECHO_C" >&6
5569 else
5570   case $PKG_CONFIG in
5571   [\\/]* | ?:[\\/]*)
5572   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5573   ;;
5574   *)
5575   ac_save_IFS=$IFS; IFS=$ac_path_separator
5576 ac_dummy="$PATH"
5577 for ac_dir in $ac_dummy; do
5578   IFS=$ac_save_IFS
5579   test -z "$ac_dir" && ac_dir=.
5580   if $as_executable_p "$ac_dir/$ac_word"; then
5581    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5582    echo "$as_me:5582: found $ac_dir/$ac_word" >&5
5583    break
5584 fi
5585 done
5586
5587   ;;
5588 esac
5589 fi
5590 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5591
5592 if test -n "$PKG_CONFIG"; then
5593   echo "$as_me:5593: result: $PKG_CONFIG" >&5
5594 echo "${ECHO_T}$PKG_CONFIG" >&6
5595 else
5596   echo "$as_me:5596: result: no" >&5
5597 echo "${ECHO_T}no" >&6
5598 fi
5599
5600 fi
5601 if test -z "$ac_cv_path_PKG_CONFIG"; then
5602   ac_pt_PKG_CONFIG=$PKG_CONFIG
5603   # Extract the first word of "pkg-config", so it can be a program name with args.
5604 set dummy pkg-config; ac_word=$2
5605 echo "$as_me:5605: checking for $ac_word" >&5
5606 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5607 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5608   echo $ECHO_N "(cached) $ECHO_C" >&6
5609 else
5610   case $ac_pt_PKG_CONFIG in
5611   [\\/]* | ?:[\\/]*)
5612   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5613   ;;
5614   *)
5615   ac_save_IFS=$IFS; IFS=$ac_path_separator
5616 ac_dummy="$PATH"
5617 for ac_dir in $ac_dummy; do
5618   IFS=$ac_save_IFS
5619   test -z "$ac_dir" && ac_dir=.
5620   if $as_executable_p "$ac_dir/$ac_word"; then
5621    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5622    echo "$as_me:5622: found $ac_dir/$ac_word" >&5
5623    break
5624 fi
5625 done
5626
5627   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5628   ;;
5629 esac
5630 fi
5631 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5632
5633 if test -n "$ac_pt_PKG_CONFIG"; then
5634   echo "$as_me:5634: result: $ac_pt_PKG_CONFIG" >&5
5635 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5636 else
5637   echo "$as_me:5637: result: no" >&5
5638 echo "${ECHO_T}no" >&6
5639 fi
5640
5641   PKG_CONFIG=$ac_pt_PKG_CONFIG
5642 else
5643   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5644 fi
5645
5646         ;;
5647 (*)
5648         PKG_CONFIG=$withval
5649         ;;
5650 esac
5651
5652 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5653 if test "$PKG_CONFIG" != none ; then
5654
5655 if test "x$prefix" != xNONE; then
5656         cf_path_syntax="$prefix"
5657 else
5658         cf_path_syntax="$ac_default_prefix"
5659 fi
5660
5661 case ".$PKG_CONFIG" in
5662 (.\$\(*\)*|.\'*\'*)
5663         ;;
5664 (..|./*|.\\*)
5665         ;;
5666 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5667         ;;
5668 (.\${*prefix}*|.\${*dir}*)
5669         eval PKG_CONFIG="$PKG_CONFIG"
5670         case ".$PKG_CONFIG" in
5671         (.NONE/*)
5672                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5673                 ;;
5674         esac
5675         ;;
5676 (.no|.NONE/*)
5677         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5678         ;;
5679 (*)
5680         { { echo "$as_me:5680: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5681 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5682    { (exit 1); exit 1; }; }
5683         ;;
5684 esac
5685
5686 elif test "x$cf_pkg_config" != xno ; then
5687         { echo "$as_me:5687: WARNING: pkg-config is not installed" >&5
5688 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5689 fi
5690
5691 echo "$as_me:5691: checking if you want to see long compiling messages" >&5
5692 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5693
5694 # Check whether --enable-echo or --disable-echo was given.
5695 if test "${enable_echo+set}" = set; then
5696   enableval="$enable_echo"
5697   test "$enableval" != no && enableval=yes
5698         if test "$enableval" != "yes" ; then
5699
5700         ECHO_LT='--silent'
5701         ECHO_LD='@echo linking $@;'
5702         RULE_CC='@echo compiling $<'
5703         SHOW_CC='@echo compiling $@'
5704         ECHO_CC='@'
5705
5706         else
5707
5708         ECHO_LT=''
5709         ECHO_LD=''
5710         RULE_CC=''
5711         SHOW_CC=''
5712         ECHO_CC=''
5713
5714         fi
5715 else
5716   enableval=yes
5717
5718         ECHO_LT=''
5719         ECHO_LD=''
5720         RULE_CC=''
5721         SHOW_CC=''
5722         ECHO_CC=''
5723
5724 fi;
5725 echo "$as_me:5725: result: $enableval" >&5
5726 echo "${ECHO_T}$enableval" >&6
5727
5728 echo "$as_me:5728: checking for ncurses wrap-prefix" >&5
5729 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5730
5731 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5732 if test "${with_ncurses_wrap_prefix+set}" = set; then
5733   withval="$with_ncurses_wrap_prefix"
5734   NCURSES_WRAP_PREFIX=$withval
5735 else
5736   NCURSES_WRAP_PREFIX=_nc_
5737 fi;
5738 echo "$as_me:5738: result: $NCURSES_WRAP_PREFIX" >&5
5739 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5740
5741 echo "$as_me:5741: checking if you want to check for wide-character functions" >&5
5742 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5743
5744 # Check whether --enable-widec or --disable-widec was given.
5745 if test "${enable_widec+set}" = set; then
5746   enableval="$enable_widec"
5747   test "$enableval" != no && enableval=yes
5748         if test "$enableval" != "yes" ; then
5749     cf_enable_widec=no
5750         else
5751                 cf_enable_widec=yes
5752         fi
5753 else
5754   enableval=yes
5755         cf_enable_widec=yes
5756
5757 fi;
5758 echo "$as_me:5758: result: $cf_enable_widec" >&5
5759 echo "${ECHO_T}$cf_enable_widec" >&6
5760
5761 echo "$as_me:5761: checking for specific curses-directory" >&5
5762 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5763
5764 # Check whether --with-curses-dir or --without-curses-dir was given.
5765 if test "${with_curses_dir+set}" = set; then
5766   withval="$with_curses_dir"
5767   cf_cv_curses_dir=$withval
5768 else
5769   cf_cv_curses_dir=no
5770 fi;
5771 echo "$as_me:5771: result: $cf_cv_curses_dir" >&5
5772 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5773
5774 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5775 then
5776
5777 if test "x$prefix" != xNONE; then
5778         cf_path_syntax="$prefix"
5779 else
5780         cf_path_syntax="$ac_default_prefix"
5781 fi
5782
5783 case ".$withval" in
5784 (.\$\(*\)*|.\'*\'*)
5785         ;;
5786 (..|./*|.\\*)
5787         ;;
5788 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5789         ;;
5790 (.\${*prefix}*|.\${*dir}*)
5791         eval withval="$withval"
5792         case ".$withval" in
5793         (.NONE/*)
5794                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5795                 ;;
5796         esac
5797         ;;
5798 (.no|.NONE/*)
5799         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5800         ;;
5801 (*)
5802         { { echo "$as_me:5802: error: expected a pathname, not \"$withval\"" >&5
5803 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5804    { (exit 1); exit 1; }; }
5805         ;;
5806 esac
5807
5808         if test -d "$cf_cv_curses_dir"
5809         then
5810
5811 if test -n "$cf_cv_curses_dir/include" ; then
5812   for cf_add_incdir in $cf_cv_curses_dir/include
5813   do
5814         while test $cf_add_incdir != /usr/include
5815         do
5816           if test -d $cf_add_incdir
5817           then
5818                 cf_have_incdir=no
5819                 if test -n "$CFLAGS$CPPFLAGS" ; then
5820                   # a loop is needed to ensure we can add subdirs of existing dirs
5821                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5822                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5823                           cf_have_incdir=yes; break
5824                         fi
5825                   done
5826                 fi
5827
5828                 if test "$cf_have_incdir" = no ; then
5829                   if test "$cf_add_incdir" = /usr/local/include ; then
5830                         if test "$GCC" = yes
5831                         then
5832                           cf_save_CPPFLAGS=$CPPFLAGS
5833
5834         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5835         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5836
5837                           cat >conftest.$ac_ext <<_ACEOF
5838 #line 5838 "configure"
5839 #include "confdefs.h"
5840 #include <stdio.h>
5841 int
5842 main (void)
5843 {
5844 printf("Hello")
5845   ;
5846   return 0;
5847 }
5848 _ACEOF
5849 rm -f conftest.$ac_objext
5850 if { (eval echo "$as_me:5850: \"$ac_compile\"") >&5
5851   (eval $ac_compile) 2>&5
5852   ac_status=$?
5853   echo "$as_me:5853: \$? = $ac_status" >&5
5854   (exit $ac_status); } &&
5855          { ac_try='test -s conftest.$ac_objext'
5856   { (eval echo "$as_me:5856: \"$ac_try\"") >&5
5857   (eval $ac_try) 2>&5
5858   ac_status=$?
5859   echo "$as_me:5859: \$? = $ac_status" >&5
5860   (exit $ac_status); }; }; then
5861   :
5862 else
5863   echo "$as_me: failed program was:" >&5
5864 cat conftest.$ac_ext >&5
5865 cf_have_incdir=yes
5866 fi
5867 rm -f conftest.$ac_objext conftest.$ac_ext
5868                           CPPFLAGS=$cf_save_CPPFLAGS
5869                         fi
5870                   fi
5871                 fi
5872
5873                 if test "$cf_have_incdir" = no ; then
5874                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5875
5876 echo "${as_me:-configure}:5876: testing adding $cf_add_incdir to include-path ..." 1>&5
5877
5878                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5879
5880                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5881                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5882                   cf_add_incdir="$cf_top_incdir"
5883                 else
5884                   break
5885                 fi
5886           else
5887                 break
5888           fi
5889         done
5890   done
5891 fi
5892
5893 if test -n "$cf_cv_curses_dir/lib" ; then
5894         for cf_add_libdir in $cf_cv_curses_dir/lib
5895         do
5896                 if test $cf_add_libdir = /usr/lib ; then
5897                         :
5898                 elif test -d $cf_add_libdir
5899                 then
5900                         cf_have_libdir=no
5901                         if test -n "$LDFLAGS$LIBS" ; then
5902                                 # a loop is needed to ensure we can add subdirs of existing dirs
5903                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5904                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5905                                                 cf_have_libdir=yes; break
5906                                         fi
5907                                 done
5908                         fi
5909                         if test "$cf_have_libdir" = no ; then
5910                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5911
5912 echo "${as_me:-configure}:5912: testing adding $cf_add_libdir to library-path ..." 1>&5
5913
5914                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5915                         fi
5916                 fi
5917         done
5918 fi
5919
5920         fi
5921 fi
5922
5923 cf_cv_screen=curses
5924
5925 echo "$as_me:5925: checking for specified curses library type" >&5
5926 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5927
5928 # Check whether --with-screen or --without-screen was given.
5929 if test "${with_screen+set}" = set; then
5930   withval="$with_screen"
5931   cf_cv_screen=$withval
5932 else
5933
5934 # Check whether --with-ncursesw or --without-ncursesw was given.
5935 if test "${with_ncursesw+set}" = set; then
5936   withval="$with_ncursesw"
5937   cf_cv_screen=ncursesw
5938 else
5939
5940 # Check whether --with-ncurses or --without-ncurses was given.
5941 if test "${with_ncurses+set}" = set; then
5942   withval="$with_ncurses"
5943   cf_cv_screen=ncurses
5944 else
5945
5946 # Check whether --with-pdcurses or --without-pdcurses was given.
5947 if test "${with_pdcurses+set}" = set; then
5948   withval="$with_pdcurses"
5949   cf_cv_screen=pdcurses
5950 else
5951
5952 # Check whether --with-curses-colr or --without-curses-colr was given.
5953 if test "${with_curses_colr+set}" = set; then
5954   withval="$with_curses_colr"
5955   cf_cv_screen=curses_colr
5956 else
5957
5958 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5959 if test "${with_curses_5lib+set}" = set; then
5960   withval="$with_curses_5lib"
5961   cf_cv_screen=curses_5lib
5962 fi;
5963 fi;
5964 fi;
5965 fi;
5966 fi;
5967 fi;
5968
5969 echo "$as_me:5969: result: $cf_cv_screen" >&5
5970 echo "${ECHO_T}$cf_cv_screen" >&6
5971
5972 case $cf_cv_screen in
5973 (curses|curses_*)
5974
5975 echo "$as_me:5975: checking for extra include directories" >&5
5976 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5977 if test "${cf_cv_curses_incdir+set}" = set; then
5978   echo $ECHO_N "(cached) $ECHO_C" >&6
5979 else
5980
5981 cf_cv_curses_incdir=no
5982 case $host_os in
5983 (hpux10.*)
5984         if test "x$cf_cv_screen" = "xcurses_colr"
5985         then
5986                 test -d /usr/include/curses_colr && \
5987                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5988         fi
5989         ;;
5990 (sunos3*|sunos4*)
5991         if test "x$cf_cv_screen" = "xcurses_5lib"
5992         then
5993                 test -d /usr/5lib && \
5994                 test -d /usr/5include && \
5995                 cf_cv_curses_incdir="-I/usr/5include"
5996         fi
5997         ;;
5998 esac
5999
6000 fi
6001 echo "$as_me:6001: result: $cf_cv_curses_incdir" >&5
6002 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6003 if test "$cf_cv_curses_incdir" != no
6004 then
6005
6006         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6007         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6008
6009 fi
6010
6011 echo "$as_me:6011: checking if we have identified curses headers" >&5
6012 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6013 if test "${cf_cv_ncurses_header+set}" = set; then
6014   echo $ECHO_N "(cached) $ECHO_C" >&6
6015 else
6016
6017 cf_cv_ncurses_header=none
6018 for cf_header in \
6019         ncurses.h  \
6020         curses.h  ncurses/ncurses.h ncurses/curses.h
6021 do
6022 cat >conftest.$ac_ext <<_ACEOF
6023 #line 6023 "configure"
6024 #include "confdefs.h"
6025 #include <${cf_header}>
6026 int
6027 main (void)
6028 {
6029 initscr(); tgoto("?", 0,0)
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   cf_cv_ncurses_header=$cf_header; break
6047 else
6048   echo "$as_me: failed program was:" >&5
6049 cat conftest.$ac_ext >&5
6050 fi
6051 rm -f conftest.$ac_objext conftest.$ac_ext
6052 done
6053
6054 fi
6055 echo "$as_me:6055: result: $cf_cv_ncurses_header" >&5
6056 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6057
6058 if test "$cf_cv_ncurses_header" = none ; then
6059         { { echo "$as_me:6059: error: No curses header-files found" >&5
6060 echo "$as_me: error: No curses header-files found" >&2;}
6061    { (exit 1); exit 1; }; }
6062 fi
6063
6064 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6065
6066 for ac_header in $cf_cv_ncurses_header
6067 do
6068 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6069 echo "$as_me:6069: checking for $ac_header" >&5
6070 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6071 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6072   echo $ECHO_N "(cached) $ECHO_C" >&6
6073 else
6074   cat >conftest.$ac_ext <<_ACEOF
6075 #line 6075 "configure"
6076 #include "confdefs.h"
6077 #include <$ac_header>
6078 _ACEOF
6079 if { (eval echo "$as_me:6079: \"$ac_cpp conftest.$ac_ext\"") >&5
6080   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6081   ac_status=$?
6082   egrep -v '^ *\+' conftest.er1 >conftest.err
6083   rm -f conftest.er1
6084   cat conftest.err >&5
6085   echo "$as_me:6085: \$? = $ac_status" >&5
6086   (exit $ac_status); } >/dev/null; then
6087   if test -s conftest.err; then
6088     ac_cpp_err=$ac_c_preproc_warn_flag
6089   else
6090     ac_cpp_err=
6091   fi
6092 else
6093   ac_cpp_err=yes
6094 fi
6095 if test -z "$ac_cpp_err"; then
6096   eval "$as_ac_Header=yes"
6097 else
6098   echo "$as_me: failed program was:" >&5
6099   cat conftest.$ac_ext >&5
6100   eval "$as_ac_Header=no"
6101 fi
6102 rm -f conftest.err conftest.$ac_ext
6103 fi
6104 echo "$as_me:6104: result: `eval echo '${'$as_ac_Header'}'`" >&5
6105 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6106 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6107   cat >>confdefs.h <<EOF
6108 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6109 EOF
6110
6111 fi
6112 done
6113
6114 echo "$as_me:6114: checking for terminfo header" >&5
6115 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6116 if test "${cf_cv_term_header+set}" = set; then
6117   echo $ECHO_N "(cached) $ECHO_C" >&6
6118 else
6119
6120 case ${cf_cv_ncurses_header} in
6121 (*/ncurses.h|*/ncursesw.h)
6122         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6123         ;;
6124 (*)
6125         cf_term_header=term.h
6126         ;;
6127 esac
6128
6129 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6130 do
6131 cat >conftest.$ac_ext <<_ACEOF
6132 #line 6132 "configure"
6133 #include "confdefs.h"
6134 #include <stdio.h>
6135 #include <${cf_cv_ncurses_header:-curses.h}>
6136 #include <$cf_test>
6137
6138 int
6139 main (void)
6140 {
6141 int x = auto_left_margin; (void)x
6142   ;
6143   return 0;
6144 }
6145 _ACEOF
6146 rm -f conftest.$ac_objext
6147 if { (eval echo "$as_me:6147: \"$ac_compile\"") >&5
6148   (eval $ac_compile) 2>&5
6149   ac_status=$?
6150   echo "$as_me:6150: \$? = $ac_status" >&5
6151   (exit $ac_status); } &&
6152          { ac_try='test -s conftest.$ac_objext'
6153   { (eval echo "$as_me:6153: \"$ac_try\"") >&5
6154   (eval $ac_try) 2>&5
6155   ac_status=$?
6156   echo "$as_me:6156: \$? = $ac_status" >&5
6157   (exit $ac_status); }; }; then
6158
6159         cf_cv_term_header="$cf_test"
6160 else
6161   echo "$as_me: failed program was:" >&5
6162 cat conftest.$ac_ext >&5
6163
6164         cf_cv_term_header=unknown
6165
6166 fi
6167 rm -f conftest.$ac_objext conftest.$ac_ext
6168         test "$cf_cv_term_header" != unknown && break
6169 done
6170
6171 fi
6172 echo "$as_me:6172: result: $cf_cv_term_header" >&5
6173 echo "${ECHO_T}$cf_cv_term_header" >&6
6174
6175 # Set definitions to allow ifdef'ing to accommodate subdirectories
6176
6177 case $cf_cv_term_header in
6178 (*term.h)
6179
6180 cat >>confdefs.h <<\EOF
6181 #define HAVE_TERM_H 1
6182 EOF
6183
6184         ;;
6185 esac
6186
6187 case $cf_cv_term_header in
6188 (ncurses/term.h)
6189
6190 cat >>confdefs.h <<\EOF
6191 #define HAVE_NCURSES_TERM_H 1
6192 EOF
6193
6194         ;;
6195 (ncursesw/term.h)
6196
6197 cat >>confdefs.h <<\EOF
6198 #define HAVE_NCURSESW_TERM_H 1
6199 EOF
6200
6201         ;;
6202 esac
6203
6204 echo "$as_me:6204: checking for ncurses version" >&5
6205 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6206 if test "${cf_cv_ncurses_version+set}" = set; then
6207   echo $ECHO_N "(cached) $ECHO_C" >&6
6208 else
6209
6210         cf_cv_ncurses_version=no
6211         cf_tempfile=out$$
6212         rm -f $cf_tempfile
6213         if test "$cross_compiling" = yes; then
6214
6215         # This will not work if the preprocessor splits the line after the
6216         # Autoconf token.  The 'unproto' program does that.
6217         cat > conftest.$ac_ext <<EOF
6218 #include <${cf_cv_ncurses_header:-curses.h}>
6219 #undef Autoconf
6220 #ifdef NCURSES_VERSION
6221 Autoconf NCURSES_VERSION
6222 #else
6223 #ifdef __NCURSES_H
6224 Autoconf "old"
6225 #endif
6226 ;
6227 #endif
6228 EOF
6229         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6230         { (eval echo "$as_me:6230: \"$cf_try\"") >&5
6231   (eval $cf_try) 2>&5
6232   ac_status=$?
6233   echo "$as_me:6233: \$? = $ac_status" >&5
6234   (exit $ac_status); }
6235         if test -f conftest.out ; then
6236                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6237                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6238                 rm -f conftest.out
6239         fi
6240
6241 else
6242   cat >conftest.$ac_ext <<_ACEOF
6243 #line 6243 "configure"
6244 #include "confdefs.h"
6245
6246 #include <${cf_cv_ncurses_header:-curses.h}>
6247 #include <stdio.h>
6248 int main(void)
6249 {
6250         FILE *fp = fopen("$cf_tempfile", "w");
6251 #ifdef NCURSES_VERSION
6252 # ifdef NCURSES_VERSION_PATCH
6253         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6254 # else
6255         fprintf(fp, "%s\n", NCURSES_VERSION);
6256 # endif
6257 #else
6258 # ifdef __NCURSES_H
6259         fprintf(fp, "old\n");
6260 # else
6261         make an error
6262 # endif
6263 #endif
6264         ${cf_cv_main_return:-return}(0);
6265 }
6266 _ACEOF
6267 rm -f conftest$ac_exeext
6268 if { (eval echo "$as_me:6268: \"$ac_link\"") >&5
6269   (eval $ac_link) 2>&5
6270   ac_status=$?
6271   echo "$as_me:6271: \$? = $ac_status" >&5
6272   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6273   { (eval echo "$as_me:6273: \"$ac_try\"") >&5
6274   (eval $ac_try) 2>&5
6275   ac_status=$?
6276   echo "$as_me:6276: \$? = $ac_status" >&5
6277   (exit $ac_status); }; }; then
6278
6279         cf_cv_ncurses_version=`cat $cf_tempfile`
6280 else
6281   echo "$as_me: program exited with status $ac_status" >&5
6282 echo "$as_me: failed program was:" >&5
6283 cat conftest.$ac_ext >&5
6284 fi
6285 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6286 fi
6287         rm -f $cf_tempfile
6288
6289 fi
6290 echo "$as_me:6290: result: $cf_cv_ncurses_version" >&5
6291 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6292 test "$cf_cv_ncurses_version" = no ||
6293 cat >>confdefs.h <<\EOF
6294 #define NCURSES 1
6295 EOF
6296
6297 echo "$as_me:6297: checking if we have identified curses libraries" >&5
6298 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6299 cat >conftest.$ac_ext <<_ACEOF
6300 #line 6300 "configure"
6301 #include "confdefs.h"
6302 #include <${cf_cv_ncurses_header:-curses.h}>
6303 int
6304 main (void)
6305 {
6306 initscr(); tgoto("?", 0,0)
6307   ;
6308   return 0;
6309 }
6310 _ACEOF
6311 rm -f conftest.$ac_objext conftest$ac_exeext
6312 if { (eval echo "$as_me:6312: \"$ac_link\"") >&5
6313   (eval $ac_link) 2>&5
6314   ac_status=$?
6315   echo "$as_me:6315: \$? = $ac_status" >&5
6316   (exit $ac_status); } &&
6317          { ac_try='test -s conftest$ac_exeext'
6318   { (eval echo "$as_me:6318: \"$ac_try\"") >&5
6319   (eval $ac_try) 2>&5
6320   ac_status=$?
6321   echo "$as_me:6321: \$? = $ac_status" >&5
6322   (exit $ac_status); }; }; then
6323   cf_result=yes
6324 else
6325   echo "$as_me: failed program was:" >&5
6326 cat conftest.$ac_ext >&5
6327 cf_result=no
6328 fi
6329 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6330 echo "$as_me:6330: result: $cf_result" >&5
6331 echo "${ECHO_T}$cf_result" >&6
6332
6333 if test "$cf_result" = no ; then
6334 case $host_os in
6335 (freebsd*)
6336         echo "$as_me:6336: checking for tgoto in -lmytinfo" >&5
6337 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6338 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6339   echo $ECHO_N "(cached) $ECHO_C" >&6
6340 else
6341   ac_check_lib_save_LIBS=$LIBS
6342 LIBS="-lmytinfo  $LIBS"
6343 cat >conftest.$ac_ext <<_ACEOF
6344 #line 6344 "configure"
6345 #include "confdefs.h"
6346
6347 /* Override any gcc2 internal prototype to avoid an error.  */
6348 #ifdef __cplusplus
6349 extern "C"
6350 #endif
6351 /* We use char because int might match the return type of a gcc2
6352    builtin and then its argument prototype would still apply.  */
6353 char tgoto ();
6354 int
6355 main (void)
6356 {
6357 tgoto ();
6358   ;
6359   return 0;
6360 }
6361 _ACEOF
6362 rm -f conftest.$ac_objext conftest$ac_exeext
6363 if { (eval echo "$as_me:6363: \"$ac_link\"") >&5
6364   (eval $ac_link) 2>&5
6365   ac_status=$?
6366   echo "$as_me:6366: \$? = $ac_status" >&5
6367   (exit $ac_status); } &&
6368          { ac_try='test -s conftest$ac_exeext'
6369   { (eval echo "$as_me:6369: \"$ac_try\"") >&5
6370   (eval $ac_try) 2>&5
6371   ac_status=$?
6372   echo "$as_me:6372: \$? = $ac_status" >&5
6373   (exit $ac_status); }; }; then
6374   ac_cv_lib_mytinfo_tgoto=yes
6375 else
6376   echo "$as_me: failed program was:" >&5
6377 cat conftest.$ac_ext >&5
6378 ac_cv_lib_mytinfo_tgoto=no
6379 fi
6380 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6381 LIBS=$ac_check_lib_save_LIBS
6382 fi
6383 echo "$as_me:6383: result: $ac_cv_lib_mytinfo_tgoto" >&5
6384 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6385 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6386
6387 cf_add_libs="$LIBS"
6388 # reverse order
6389 cf_add_0lib=
6390 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6391 # filter duplicates
6392 for cf_add_1lib in $cf_add_0lib; do
6393         for cf_add_2lib in $cf_add_libs; do
6394                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6395                         cf_add_1lib=
6396                         break
6397                 fi
6398         done
6399         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6400 done
6401 LIBS="$cf_add_libs"
6402
6403 fi
6404
6405         ;;
6406 (hpux10.*)
6407         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6408         # next (1998), and xcurses "newer" (2000).  There is no header file for
6409         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6410         # term.h) for cur_colr
6411         if test "x$cf_cv_screen" = "xcurses_colr"
6412         then
6413                 echo "$as_me:6413: checking for initscr in -lcur_colr" >&5
6414 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6415 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6416   echo $ECHO_N "(cached) $ECHO_C" >&6
6417 else
6418   ac_check_lib_save_LIBS=$LIBS
6419 LIBS="-lcur_colr  $LIBS"
6420 cat >conftest.$ac_ext <<_ACEOF
6421 #line 6421 "configure"
6422 #include "confdefs.h"
6423
6424 /* Override any gcc2 internal prototype to avoid an error.  */
6425 #ifdef __cplusplus
6426 extern "C"
6427 #endif
6428 /* We use char because int might match the return type of a gcc2
6429    builtin and then its argument prototype would still apply.  */
6430 char initscr ();
6431 int
6432 main (void)
6433 {
6434 initscr ();
6435   ;
6436   return 0;
6437 }
6438 _ACEOF
6439 rm -f conftest.$ac_objext conftest$ac_exeext
6440 if { (eval echo "$as_me:6440: \"$ac_link\"") >&5
6441   (eval $ac_link) 2>&5
6442   ac_status=$?
6443   echo "$as_me:6443: \$? = $ac_status" >&5
6444   (exit $ac_status); } &&
6445          { ac_try='test -s conftest$ac_exeext'
6446   { (eval echo "$as_me:6446: \"$ac_try\"") >&5
6447   (eval $ac_try) 2>&5
6448   ac_status=$?
6449   echo "$as_me:6449: \$? = $ac_status" >&5
6450   (exit $ac_status); }; }; then
6451   ac_cv_lib_cur_colr_initscr=yes
6452 else
6453   echo "$as_me: failed program was:" >&5
6454 cat conftest.$ac_ext >&5
6455 ac_cv_lib_cur_colr_initscr=no
6456 fi
6457 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6458 LIBS=$ac_check_lib_save_LIBS
6459 fi
6460 echo "$as_me:6460: result: $ac_cv_lib_cur_colr_initscr" >&5
6461 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6462 if test $ac_cv_lib_cur_colr_initscr = yes; then
6463
6464 cf_add_libs="$LIBS"
6465 # reverse order
6466 cf_add_0lib=
6467 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6468 # filter duplicates
6469 for cf_add_1lib in $cf_add_0lib; do
6470         for cf_add_2lib in $cf_add_libs; do
6471                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6472                         cf_add_1lib=
6473                         break
6474                 fi
6475         done
6476         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6477 done
6478 LIBS="$cf_add_libs"
6479
6480                         ac_cv_func_initscr=yes
6481
6482 else
6483
6484                 echo "$as_me:6484: checking for initscr in -lHcurses" >&5
6485 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6486 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6487   echo $ECHO_N "(cached) $ECHO_C" >&6
6488 else
6489   ac_check_lib_save_LIBS=$LIBS
6490 LIBS="-lHcurses  $LIBS"
6491 cat >conftest.$ac_ext <<_ACEOF
6492 #line 6492 "configure"
6493 #include "confdefs.h"
6494
6495 /* Override any gcc2 internal prototype to avoid an error.  */
6496 #ifdef __cplusplus
6497 extern "C"
6498 #endif
6499 /* We use char because int might match the return type of a gcc2
6500    builtin and then its argument prototype would still apply.  */
6501 char initscr ();
6502 int
6503 main (void)
6504 {
6505 initscr ();
6506   ;
6507   return 0;
6508 }
6509 _ACEOF
6510 rm -f conftest.$ac_objext conftest$ac_exeext
6511 if { (eval echo "$as_me:6511: \"$ac_link\"") >&5
6512   (eval $ac_link) 2>&5
6513   ac_status=$?
6514   echo "$as_me:6514: \$? = $ac_status" >&5
6515   (exit $ac_status); } &&
6516          { ac_try='test -s conftest$ac_exeext'
6517   { (eval echo "$as_me:6517: \"$ac_try\"") >&5
6518   (eval $ac_try) 2>&5
6519   ac_status=$?
6520   echo "$as_me:6520: \$? = $ac_status" >&5
6521   (exit $ac_status); }; }; then
6522   ac_cv_lib_Hcurses_initscr=yes
6523 else
6524   echo "$as_me: failed program was:" >&5
6525 cat conftest.$ac_ext >&5
6526 ac_cv_lib_Hcurses_initscr=no
6527 fi
6528 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6529 LIBS=$ac_check_lib_save_LIBS
6530 fi
6531 echo "$as_me:6531: result: $ac_cv_lib_Hcurses_initscr" >&5
6532 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6533 if test $ac_cv_lib_Hcurses_initscr = yes; then
6534
6535                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6536
6537 cf_add_libs="$LIBS"
6538 # reverse order
6539 cf_add_0lib=
6540 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6541 # filter duplicates
6542 for cf_add_1lib in $cf_add_0lib; do
6543         for cf_add_2lib in $cf_add_libs; do
6544                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6545                         cf_add_1lib=
6546                         break
6547                 fi
6548         done
6549         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6550 done
6551 LIBS="$cf_add_libs"
6552
6553         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6554         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6555
6556                         ac_cv_func_initscr=yes
6557
6558 fi
6559
6560 fi
6561
6562         fi
6563         ;;
6564 (linux*)
6565         case `arch 2>/dev/null` in
6566         (x86_64)
6567                 if test -d /lib64
6568                 then
6569
6570 if test -n "/lib64" ; then
6571         for cf_add_libdir in /lib64
6572         do
6573                 if test $cf_add_libdir = /usr/lib ; then
6574                         :
6575                 elif test -d $cf_add_libdir
6576                 then
6577                         cf_have_libdir=no
6578                         if test -n "$LDFLAGS$LIBS" ; then
6579                                 # a loop is needed to ensure we can add subdirs of existing dirs
6580                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6581                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6582                                                 cf_have_libdir=yes; break
6583                                         fi
6584                                 done
6585                         fi
6586                         if test "$cf_have_libdir" = no ; then
6587                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6588
6589 echo "${as_me:-configure}:6589: testing adding $cf_add_libdir to library-path ..." 1>&5
6590
6591                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6592                         fi
6593                 fi
6594         done
6595 fi
6596
6597                 else
6598
6599 if test -n "/lib" ; then
6600         for cf_add_libdir in /lib
6601         do
6602                 if test $cf_add_libdir = /usr/lib ; then
6603                         :
6604                 elif test -d $cf_add_libdir
6605                 then
6606                         cf_have_libdir=no
6607                         if test -n "$LDFLAGS$LIBS" ; then
6608                                 # a loop is needed to ensure we can add subdirs of existing dirs
6609                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6610                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6611                                                 cf_have_libdir=yes; break
6612                                         fi
6613                                 done
6614                         fi
6615                         if test "$cf_have_libdir" = no ; then
6616                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6617
6618 echo "${as_me:-configure}:6618: testing adding $cf_add_libdir to library-path ..." 1>&5
6619
6620                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6621                         fi
6622                 fi
6623         done
6624 fi
6625
6626                 fi
6627                 ;;
6628         (*)
6629
6630 if test -n "/lib" ; then
6631         for cf_add_libdir in /lib
6632         do
6633                 if test $cf_add_libdir = /usr/lib ; then
6634                         :
6635                 elif test -d $cf_add_libdir
6636                 then
6637                         cf_have_libdir=no
6638                         if test -n "$LDFLAGS$LIBS" ; then
6639                                 # a loop is needed to ensure we can add subdirs of existing dirs
6640                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6641                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6642                                                 cf_have_libdir=yes; break
6643                                         fi
6644                                 done
6645                         fi
6646                         if test "$cf_have_libdir" = no ; then
6647                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6648
6649 echo "${as_me:-configure}:6649: testing adding $cf_add_libdir to library-path ..." 1>&5
6650
6651                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6652                         fi
6653                 fi
6654         done
6655 fi
6656
6657                 ;;
6658         esac
6659         ;;
6660 (sunos3*|sunos4*)
6661         if test "x$cf_cv_screen" = "xcurses_5lib"
6662         then
6663                 if test -d /usr/5lib ; then
6664
6665 if test -n "/usr/5lib" ; then
6666         for cf_add_libdir in /usr/5lib
6667         do
6668                 if test $cf_add_libdir = /usr/lib ; then
6669                         :
6670                 elif test -d $cf_add_libdir
6671                 then
6672                         cf_have_libdir=no
6673                         if test -n "$LDFLAGS$LIBS" ; then
6674                                 # a loop is needed to ensure we can add subdirs of existing dirs
6675                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6676                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6677                                                 cf_have_libdir=yes; break
6678                                         fi
6679                                 done
6680                         fi
6681                         if test "$cf_have_libdir" = no ; then
6682                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6683
6684 echo "${as_me:-configure}:6684: testing adding $cf_add_libdir to library-path ..." 1>&5
6685
6686                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6687                         fi
6688                 fi
6689         done
6690 fi
6691
6692 cf_add_libs="$LIBS"
6693 # reverse order
6694 cf_add_0lib=
6695 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6696 # filter duplicates
6697 for cf_add_1lib in $cf_add_0lib; do
6698         for cf_add_2lib in $cf_add_libs; do
6699                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6700                         cf_add_1lib=
6701                         break
6702                 fi
6703         done
6704         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6705 done
6706 LIBS="$cf_add_libs"
6707
6708                 fi
6709         fi
6710         ac_cv_func_initscr=yes
6711         ;;
6712 esac
6713
6714 if test ".$ac_cv_func_initscr" != .yes ; then
6715         cf_save_LIBS="$LIBS"
6716
6717         if test ".${cf_cv_ncurses_version:-no}" != .no
6718         then
6719                 cf_check_list="ncurses curses cursesX"
6720         else
6721                 cf_check_list="cursesX curses ncurses"
6722         fi
6723
6724         # Check for library containing tgoto.  Do this before curses library
6725         # because it may be needed to link the test-case for initscr.
6726         if test "x$cf_term_lib" = x
6727         then
6728                 echo "$as_me:6728: checking for tgoto" >&5
6729 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6730 if test "${ac_cv_func_tgoto+set}" = set; then
6731   echo $ECHO_N "(cached) $ECHO_C" >&6
6732 else
6733   cat >conftest.$ac_ext <<_ACEOF
6734 #line 6734 "configure"
6735 #include "confdefs.h"
6736 #define tgoto autoconf_temporary
6737 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6738 #undef tgoto
6739
6740 #ifdef __cplusplus
6741 extern "C"
6742 #endif
6743
6744 /* We use char because int might match the return type of a gcc2
6745    builtin and then its argument prototype would still apply.  */
6746 char tgoto (void);
6747
6748 int
6749 main (void)
6750 {
6751
6752 /* The GNU C library defines stubs for functions which it implements
6753     to always fail with ENOSYS.  Some functions are actually named
6754     something starting with __ and the normal name is an alias.  */
6755 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6756 #error found stub for tgoto
6757 #endif
6758
6759         return tgoto ();
6760   ;
6761   return 0;
6762 }
6763 _ACEOF
6764 rm -f conftest.$ac_objext conftest$ac_exeext
6765 if { (eval echo "$as_me:6765: \"$ac_link\"") >&5
6766   (eval $ac_link) 2>&5
6767   ac_status=$?
6768   echo "$as_me:6768: \$? = $ac_status" >&5
6769   (exit $ac_status); } &&
6770          { ac_try='test -s conftest$ac_exeext'
6771   { (eval echo "$as_me:6771: \"$ac_try\"") >&5
6772   (eval $ac_try) 2>&5
6773   ac_status=$?
6774   echo "$as_me:6774: \$? = $ac_status" >&5
6775   (exit $ac_status); }; }; then
6776   ac_cv_func_tgoto=yes
6777 else
6778   echo "$as_me: failed program was:" >&5
6779 cat conftest.$ac_ext >&5
6780 ac_cv_func_tgoto=no
6781 fi
6782 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6783 fi
6784 echo "$as_me:6784: result: $ac_cv_func_tgoto" >&5
6785 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6786 if test $ac_cv_func_tgoto = yes; then
6787   cf_term_lib=predefined
6788 else
6789
6790                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6791                         do
6792                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6793 echo "$as_me:6793: checking for tgoto in -l$cf_term_lib" >&5
6794 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6795 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6796   echo $ECHO_N "(cached) $ECHO_C" >&6
6797 else
6798   ac_check_lib_save_LIBS=$LIBS
6799 LIBS="-l$cf_term_lib  $LIBS"
6800 cat >conftest.$ac_ext <<_ACEOF
6801 #line 6801 "configure"
6802 #include "confdefs.h"
6803
6804 /* Override any gcc2 internal prototype to avoid an error.  */
6805 #ifdef __cplusplus
6806 extern "C"
6807 #endif
6808 /* We use char because int might match the return type of a gcc2
6809    builtin and then its argument prototype would still apply.  */
6810 char tgoto ();
6811 int
6812 main (void)
6813 {
6814 tgoto ();
6815   ;
6816   return 0;
6817 }
6818 _ACEOF
6819 rm -f conftest.$ac_objext conftest$ac_exeext
6820 if { (eval echo "$as_me:6820: \"$ac_link\"") >&5
6821   (eval $ac_link) 2>&5
6822   ac_status=$?
6823   echo "$as_me:6823: \$? = $ac_status" >&5
6824   (exit $ac_status); } &&
6825          { ac_try='test -s conftest$ac_exeext'
6826   { (eval echo "$as_me:6826: \"$ac_try\"") >&5
6827   (eval $ac_try) 2>&5
6828   ac_status=$?
6829   echo "$as_me:6829: \$? = $ac_status" >&5
6830   (exit $ac_status); }; }; then
6831   eval "$as_ac_Lib=yes"
6832 else
6833   echo "$as_me: failed program was:" >&5
6834 cat conftest.$ac_ext >&5
6835 eval "$as_ac_Lib=no"
6836 fi
6837 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6838 LIBS=$ac_check_lib_save_LIBS
6839 fi
6840 echo "$as_me:6840: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6841 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6842 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6843
6844                                         : ${cf_nculib_root:=$cf_term_lib}
6845                                         break
6846
6847 fi
6848
6849                         done
6850
6851 fi
6852
6853         fi
6854
6855         # Check for library containing initscr
6856         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6857         if test "x$cf_curs_lib" = x
6858         then
6859                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6860                 do
6861                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6862                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6863                                 echo "$as_me:6863: checking if we can link with $cf_curs_lib library" >&5
6864 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6865                                 cat >conftest.$ac_ext <<_ACEOF
6866 #line 6866 "configure"
6867 #include "confdefs.h"
6868 #include <${cf_cv_ncurses_header:-curses.h}>
6869 int
6870 main (void)
6871 {
6872 initscr()
6873   ;
6874   return 0;
6875 }
6876 _ACEOF
6877 rm -f conftest.$ac_objext conftest$ac_exeext
6878 if { (eval echo "$as_me:6878: \"$ac_link\"") >&5
6879   (eval $ac_link) 2>&5
6880   ac_status=$?
6881   echo "$as_me:6881: \$? = $ac_status" >&5
6882   (exit $ac_status); } &&
6883          { ac_try='test -s conftest$ac_exeext'
6884   { (eval echo "$as_me:6884: \"$ac_try\"") >&5
6885   (eval $ac_try) 2>&5
6886   ac_status=$?
6887   echo "$as_me:6887: \$? = $ac_status" >&5
6888   (exit $ac_status); }; }; then
6889   cf_result=yes
6890 else
6891   echo "$as_me: failed program was:" >&5
6892 cat conftest.$ac_ext >&5
6893 cf_result=no
6894 fi
6895 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6896                                 echo "$as_me:6896: result: $cf_result" >&5
6897 echo "${ECHO_T}$cf_result" >&6
6898                                 test $cf_result = yes && break
6899                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6900                                 cf_result=no
6901                         elif test "$cf_term_lib" != predefined ; then
6902                                 echo "$as_me:6902: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6903 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6904                                 cat >conftest.$ac_ext <<_ACEOF
6905 #line 6905 "configure"
6906 #include "confdefs.h"
6907 #include <${cf_cv_ncurses_header:-curses.h}>
6908 int
6909 main (void)
6910 {
6911 initscr(); tgoto((char *)0, 0, 0);
6912   ;
6913   return 0;
6914 }
6915 _ACEOF
6916 rm -f conftest.$ac_objext conftest$ac_exeext
6917 if { (eval echo "$as_me:6917: \"$ac_link\"") >&5
6918   (eval $ac_link) 2>&5
6919   ac_status=$?
6920   echo "$as_me:6920: \$? = $ac_status" >&5
6921   (exit $ac_status); } &&
6922          { ac_try='test -s conftest$ac_exeext'
6923   { (eval echo "$as_me:6923: \"$ac_try\"") >&5
6924   (eval $ac_try) 2>&5
6925   ac_status=$?
6926   echo "$as_me:6926: \$? = $ac_status" >&5
6927   (exit $ac_status); }; }; then
6928   cf_result=no
6929 else
6930   echo "$as_me: failed program was:" >&5
6931 cat conftest.$ac_ext >&5
6932
6933                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6934                                         cat >conftest.$ac_ext <<_ACEOF
6935 #line 6935 "configure"
6936 #include "confdefs.h"
6937 #include <${cf_cv_ncurses_header:-curses.h}>
6938 int
6939 main (void)
6940 {
6941 initscr()
6942   ;
6943   return 0;
6944 }
6945 _ACEOF
6946 rm -f conftest.$ac_objext conftest$ac_exeext
6947 if { (eval echo "$as_me:6947: \"$ac_link\"") >&5
6948   (eval $ac_link) 2>&5
6949   ac_status=$?
6950   echo "$as_me:6950: \$? = $ac_status" >&5
6951   (exit $ac_status); } &&
6952          { ac_try='test -s conftest$ac_exeext'
6953   { (eval echo "$as_me:6953: \"$ac_try\"") >&5
6954   (eval $ac_try) 2>&5
6955   ac_status=$?
6956   echo "$as_me:6956: \$? = $ac_status" >&5
6957   (exit $ac_status); }; }; then
6958   cf_result=yes
6959 else
6960   echo "$as_me: failed program was:" >&5
6961 cat conftest.$ac_ext >&5
6962 cf_result=error
6963 fi
6964 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6965
6966 fi
6967 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6968                                 echo "$as_me:6968: result: $cf_result" >&5
6969 echo "${ECHO_T}$cf_result" >&6
6970                                 test $cf_result != error && break
6971                         fi
6972                 done
6973         fi
6974         test $cf_curs_lib = unknown && { { echo "$as_me:6974: error: no curses library found" >&5
6975 echo "$as_me: error: no curses library found" >&2;}
6976    { (exit 1); exit 1; }; }
6977 fi
6978 fi
6979
6980         ;;
6981 (ncursesw*)
6982
6983 echo "$as_me:6983: checking for multibyte character support" >&5
6984 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6985 if test "${cf_cv_utf8_lib+set}" = set; then
6986   echo $ECHO_N "(cached) $ECHO_C" >&6
6987 else
6988
6989         cf_save_LIBS="$LIBS"
6990         cat >conftest.$ac_ext <<_ACEOF
6991 #line 6991 "configure"
6992 #include "confdefs.h"
6993
6994 #include <stdlib.h>
6995 int
6996 main (void)
6997 {
6998 putwc(0,0);
6999   ;
7000   return 0;
7001 }
7002 _ACEOF
7003 rm -f conftest.$ac_objext conftest$ac_exeext
7004 if { (eval echo "$as_me:7004: \"$ac_link\"") >&5
7005   (eval $ac_link) 2>&5
7006   ac_status=$?
7007   echo "$as_me:7007: \$? = $ac_status" >&5
7008   (exit $ac_status); } &&
7009          { ac_try='test -s conftest$ac_exeext'
7010   { (eval echo "$as_me:7010: \"$ac_try\"") >&5
7011   (eval $ac_try) 2>&5
7012   ac_status=$?
7013   echo "$as_me:7013: \$? = $ac_status" >&5
7014   (exit $ac_status); }; }; then
7015   cf_cv_utf8_lib=yes
7016 else
7017   echo "$as_me: failed program was:" >&5
7018 cat conftest.$ac_ext >&5
7019
7020 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7021 # will be set on completion of the AC_TRY_LINK below.
7022 cf_cv_header_path_utf8=
7023 cf_cv_library_path_utf8=
7024
7025 echo "${as_me:-configure}:7025: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7026
7027 cf_save_LIBS="$LIBS"
7028
7029 cat >conftest.$ac_ext <<_ACEOF
7030 #line 7030 "configure"
7031 #include "confdefs.h"
7032
7033 #include <libutf8.h>
7034 int
7035 main (void)
7036 {
7037 putwc(0,0);
7038   ;
7039   return 0;
7040 }
7041 _ACEOF
7042 rm -f conftest.$ac_objext conftest$ac_exeext
7043 if { (eval echo "$as_me:7043: \"$ac_link\"") >&5
7044   (eval $ac_link) 2>&5
7045   ac_status=$?
7046   echo "$as_me:7046: \$? = $ac_status" >&5
7047   (exit $ac_status); } &&
7048          { ac_try='test -s conftest$ac_exeext'
7049   { (eval echo "$as_me:7049: \"$ac_try\"") >&5
7050   (eval $ac_try) 2>&5
7051   ac_status=$?
7052   echo "$as_me:7052: \$? = $ac_status" >&5
7053   (exit $ac_status); }; }; then
7054
7055         cf_cv_find_linkage_utf8=yes
7056         cf_cv_header_path_utf8=/usr/include
7057         cf_cv_library_path_utf8=/usr/lib
7058
7059 else
7060   echo "$as_me: failed program was:" >&5
7061 cat conftest.$ac_ext >&5
7062
7063 LIBS="-lutf8  $cf_save_LIBS"
7064
7065 cat >conftest.$ac_ext <<_ACEOF
7066 #line 7066 "configure"
7067 #include "confdefs.h"
7068
7069 #include <libutf8.h>
7070 int
7071 main (void)
7072 {
7073 putwc(0,0);
7074   ;
7075   return 0;
7076 }
7077 _ACEOF
7078 rm -f conftest.$ac_objext conftest$ac_exeext
7079 if { (eval echo "$as_me:7079: \"$ac_link\"") >&5
7080   (eval $ac_link) 2>&5
7081   ac_status=$?
7082   echo "$as_me:7082: \$? = $ac_status" >&5
7083   (exit $ac_status); } &&
7084          { ac_try='test -s conftest$ac_exeext'
7085   { (eval echo "$as_me:7085: \"$ac_try\"") >&5
7086   (eval $ac_try) 2>&5
7087   ac_status=$?
7088   echo "$as_me:7088: \$? = $ac_status" >&5
7089   (exit $ac_status); }; }; then
7090
7091         cf_cv_find_linkage_utf8=yes
7092         cf_cv_header_path_utf8=/usr/include
7093         cf_cv_library_path_utf8=/usr/lib
7094         cf_cv_library_file_utf8="-lutf8"
7095
7096 else
7097   echo "$as_me: failed program was:" >&5
7098 cat conftest.$ac_ext >&5
7099
7100         cf_cv_find_linkage_utf8=no
7101         LIBS="$cf_save_LIBS"
7102
7103         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7104
7105 echo "${as_me:-configure}:7105: testing find linkage for utf8 library ..." 1>&5
7106
7107 echo "${as_me:-configure}:7107: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7108
7109         cf_save_CPPFLAGS="$CPPFLAGS"
7110         cf_test_CPPFLAGS="$CPPFLAGS"
7111
7112 cf_search=
7113
7114 # collect the current set of include-directories from compiler flags
7115 cf_header_path_list=""
7116 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7117         for cf_header_path in $CPPFLAGS $CFLAGS
7118         do
7119                 case $cf_header_path in
7120                 (-I*)
7121                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7122
7123 test "x$cf_header_path" != "xNONE" && \
7124 test -d "$cf_header_path" && \
7125  {
7126         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7127         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7128         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7129         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7130         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7131         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7132 }
7133
7134                         cf_header_path_list="$cf_header_path_list $cf_search"
7135                         ;;
7136                 esac
7137         done
7138 fi
7139
7140 # add the variations for the package we are looking for
7141
7142 cf_search=
7143
7144 test "x$prefix" != "xNONE" && \
7145 test -d "$prefix" && \
7146  {
7147         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7148         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7149         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7150         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7151         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7152         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7153 }
7154
7155 for cf_subdir_prefix in \
7156         /usr \
7157         /usr/local \
7158         /usr/pkg \
7159         /opt \
7160         /opt/local \
7161         $HOME
7162 do
7163
7164 test "x$cf_subdir_prefix" != "x$prefix" && \
7165 test -d "$cf_subdir_prefix" && \
7166 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7167         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7168         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7169         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7170         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7171         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7172         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7173 }
7174
7175 done
7176
7177 test "$includedir" != NONE && \
7178 test "$includedir" != "/usr/include" && \
7179 test -d "$includedir" && {
7180         test -d $includedir &&    cf_search="$cf_search $includedir"
7181         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7182 }
7183
7184 test "$oldincludedir" != NONE && \
7185 test "$oldincludedir" != "/usr/include" && \
7186 test -d "$oldincludedir" && {
7187         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7188         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7189 }
7190
7191 cf_search="$cf_search $cf_header_path_list"
7192
7193         for cf_cv_header_path_utf8 in $cf_search
7194         do
7195                 if test -d $cf_cv_header_path_utf8 ; then
7196                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7197
7198 echo "${as_me:-configure}:7198: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7199
7200                         CPPFLAGS="$cf_save_CPPFLAGS"
7201
7202         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7203         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7204
7205                         cat >conftest.$ac_ext <<_ACEOF
7206 #line 7206 "configure"
7207 #include "confdefs.h"
7208
7209 #include <libutf8.h>
7210 int
7211 main (void)
7212 {
7213 putwc(0,0);
7214   ;
7215   return 0;
7216 }
7217 _ACEOF
7218 rm -f conftest.$ac_objext
7219 if { (eval echo "$as_me:7219: \"$ac_compile\"") >&5
7220   (eval $ac_compile) 2>&5
7221   ac_status=$?
7222   echo "$as_me:7222: \$? = $ac_status" >&5
7223   (exit $ac_status); } &&
7224          { ac_try='test -s conftest.$ac_objext'
7225   { (eval echo "$as_me:7225: \"$ac_try\"") >&5
7226   (eval $ac_try) 2>&5
7227   ac_status=$?
7228   echo "$as_me:7228: \$? = $ac_status" >&5
7229   (exit $ac_status); }; }; then
7230
7231                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7232
7233 echo "${as_me:-configure}:7233: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7234
7235                                 cf_cv_find_linkage_utf8=maybe
7236                                 cf_test_CPPFLAGS="$CPPFLAGS"
7237                                 break
7238 else
7239   echo "$as_me: failed program was:" >&5
7240 cat conftest.$ac_ext >&5
7241
7242                                 CPPFLAGS="$cf_save_CPPFLAGS"
7243
7244 fi
7245 rm -f conftest.$ac_objext conftest.$ac_ext
7246                 fi
7247         done
7248
7249         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7250
7251 echo "${as_me:-configure}:7251: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7252
7253                 cf_save_LIBS="$LIBS"
7254                 cf_save_LDFLAGS="$LDFLAGS"
7255
7256                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7257
7258 cf_search=
7259 cf_library_path_list=""
7260 if test -n "${LDFLAGS}${LIBS}" ; then
7261         for cf_library_path in $LDFLAGS $LIBS
7262         do
7263                 case $cf_library_path in
7264                 (-L*)
7265                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7266
7267 test "x$cf_library_path" != "xNONE" && \
7268 test -d "$cf_library_path" && \
7269  {
7270         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7271         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7272         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7273         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7274         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7275         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7276 }
7277
7278                         cf_library_path_list="$cf_library_path_list $cf_search"
7279                         ;;
7280                 esac
7281         done
7282 fi
7283
7284 cf_search=
7285
7286 test "x$prefix" != "xNONE" && \
7287 test -d "$prefix" && \
7288  {
7289         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7290         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7291         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7292         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7293         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7294         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7295 }
7296
7297 for cf_subdir_prefix in \
7298         /usr \
7299         /usr/local \
7300         /usr/pkg \
7301         /opt \
7302         /opt/local \
7303         $HOME
7304 do
7305
7306 test "x$cf_subdir_prefix" != "x$prefix" && \
7307 test -d "$cf_subdir_prefix" && \
7308 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7309         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7310         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7311         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7312         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7313         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7314         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7315 }
7316
7317 done
7318
7319 cf_search="$cf_library_path_list $cf_search"
7320
7321                         for cf_cv_library_path_utf8 in $cf_search
7322                         do
7323                                 if test -d $cf_cv_library_path_utf8 ; then
7324                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7325
7326 echo "${as_me:-configure}:7326: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7327
7328                                         CPPFLAGS="$cf_test_CPPFLAGS"
7329                                         LIBS="-lutf8  $cf_save_LIBS"
7330                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7331                                         cat >conftest.$ac_ext <<_ACEOF
7332 #line 7332 "configure"
7333 #include "confdefs.h"
7334
7335 #include <libutf8.h>
7336 int
7337 main (void)
7338 {
7339 putwc(0,0);
7340   ;
7341   return 0;
7342 }
7343 _ACEOF
7344 rm -f conftest.$ac_objext conftest$ac_exeext
7345 if { (eval echo "$as_me:7345: \"$ac_link\"") >&5
7346   (eval $ac_link) 2>&5
7347   ac_status=$?
7348   echo "$as_me:7348: \$? = $ac_status" >&5
7349   (exit $ac_status); } &&
7350          { ac_try='test -s conftest$ac_exeext'
7351   { (eval echo "$as_me:7351: \"$ac_try\"") >&5
7352   (eval $ac_try) 2>&5
7353   ac_status=$?
7354   echo "$as_me:7354: \$? = $ac_status" >&5
7355   (exit $ac_status); }; }; then
7356
7357                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7358
7359 echo "${as_me:-configure}:7359: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7360
7361                                         cf_cv_find_linkage_utf8=yes
7362                                         cf_cv_library_file_utf8="-lutf8"
7363                                         break
7364 else
7365   echo "$as_me: failed program was:" >&5
7366 cat conftest.$ac_ext >&5
7367
7368                                         CPPFLAGS="$cf_save_CPPFLAGS"
7369                                         LIBS="$cf_save_LIBS"
7370                                         LDFLAGS="$cf_save_LDFLAGS"
7371
7372 fi
7373 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7374                                 fi
7375                         done
7376                         CPPFLAGS="$cf_save_CPPFLAGS"
7377                         LDFLAGS="$cf_save_LDFLAGS"
7378                 fi
7379
7380         else
7381                 cf_cv_find_linkage_utf8=no
7382         fi
7383
7384 fi
7385 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7386
7387 fi
7388 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7389
7390 LIBS="$cf_save_LIBS"
7391
7392 if test "$cf_cv_find_linkage_utf8" = yes ; then
7393 cf_cv_utf8_lib=add-on
7394 else
7395 cf_cv_utf8_lib=no
7396 fi
7397
7398 fi
7399 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7400 fi
7401 echo "$as_me:7401: result: $cf_cv_utf8_lib" >&5
7402 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7403
7404 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7405 # ncurses/ncursesw:
7406 if test "$cf_cv_utf8_lib" = "add-on" ; then
7407
7408 cat >>confdefs.h <<\EOF
7409 #define HAVE_LIBUTF8_H 1
7410 EOF
7411
7412 if test -n "$cf_cv_header_path_utf8" ; then
7413   for cf_add_incdir in $cf_cv_header_path_utf8
7414   do
7415         while test $cf_add_incdir != /usr/include
7416         do
7417           if test -d $cf_add_incdir
7418           then
7419                 cf_have_incdir=no
7420                 if test -n "$CFLAGS$CPPFLAGS" ; then
7421                   # a loop is needed to ensure we can add subdirs of existing dirs
7422                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7423                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7424                           cf_have_incdir=yes; break
7425                         fi
7426                   done
7427                 fi
7428
7429                 if test "$cf_have_incdir" = no ; then
7430                   if test "$cf_add_incdir" = /usr/local/include ; then
7431                         if test "$GCC" = yes
7432                         then
7433                           cf_save_CPPFLAGS=$CPPFLAGS
7434
7435         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7436         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7437
7438                           cat >conftest.$ac_ext <<_ACEOF
7439 #line 7439 "configure"
7440 #include "confdefs.h"
7441 #include <stdio.h>
7442 int
7443 main (void)
7444 {
7445 printf("Hello")
7446   ;
7447   return 0;
7448 }
7449 _ACEOF
7450 rm -f conftest.$ac_objext
7451 if { (eval echo "$as_me:7451: \"$ac_compile\"") >&5
7452   (eval $ac_compile) 2>&5
7453   ac_status=$?
7454   echo "$as_me:7454: \$? = $ac_status" >&5
7455   (exit $ac_status); } &&
7456          { ac_try='test -s conftest.$ac_objext'
7457   { (eval echo "$as_me:7457: \"$ac_try\"") >&5
7458   (eval $ac_try) 2>&5
7459   ac_status=$?
7460   echo "$as_me:7460: \$? = $ac_status" >&5
7461   (exit $ac_status); }; }; then
7462   :
7463 else
7464   echo "$as_me: failed program was:" >&5
7465 cat conftest.$ac_ext >&5
7466 cf_have_incdir=yes
7467 fi
7468 rm -f conftest.$ac_objext conftest.$ac_ext
7469                           CPPFLAGS=$cf_save_CPPFLAGS
7470                         fi
7471                   fi
7472                 fi
7473
7474                 if test "$cf_have_incdir" = no ; then
7475                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7476
7477 echo "${as_me:-configure}:7477: testing adding $cf_add_incdir to include-path ..." 1>&5
7478
7479                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7480
7481                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7482                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7483                   cf_add_incdir="$cf_top_incdir"
7484                 else
7485                   break
7486                 fi
7487           else
7488                 break
7489           fi
7490         done
7491   done
7492 fi
7493
7494 if test -n "$cf_cv_library_path_utf8" ; then
7495         for cf_add_libdir in $cf_cv_library_path_utf8
7496         do
7497                 if test $cf_add_libdir = /usr/lib ; then
7498                         :
7499                 elif test -d $cf_add_libdir
7500                 then
7501                         cf_have_libdir=no
7502                         if test -n "$LDFLAGS$LIBS" ; then
7503                                 # a loop is needed to ensure we can add subdirs of existing dirs
7504                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7505                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7506                                                 cf_have_libdir=yes; break
7507                                         fi
7508                                 done
7509                         fi
7510                         if test "$cf_have_libdir" = no ; then
7511                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7512
7513 echo "${as_me:-configure}:7513: testing adding $cf_add_libdir to library-path ..." 1>&5
7514
7515                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7516                         fi
7517                 fi
7518         done
7519 fi
7520
7521 cf_add_libs="$LIBS"
7522 # reverse order
7523 cf_add_0lib=
7524 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7525 # filter duplicates
7526 for cf_add_1lib in $cf_add_0lib; do
7527         for cf_add_2lib in $cf_add_libs; do
7528                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7529                         cf_add_1lib=
7530                         break
7531                 fi
7532         done
7533         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7534 done
7535 LIBS="$cf_add_libs"
7536
7537 fi
7538
7539 cf_ncuconfig_root=$cf_cv_screen
7540 cf_have_ncuconfig=no
7541
7542 if test "x${PKG_CONFIG:=none}" != xnone; then
7543         echo "$as_me:7543: checking pkg-config for $cf_ncuconfig_root" >&5
7544 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7545         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7546                 echo "$as_me:7546: result: yes" >&5
7547 echo "${ECHO_T}yes" >&6
7548
7549                 echo "$as_me:7549: checking if the $cf_ncuconfig_root package files work" >&5
7550 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7551                 cf_have_ncuconfig=unknown
7552
7553                 cf_save_CFLAGS="$CFLAGS"
7554                 cf_save_CPPFLAGS="$CPPFLAGS"
7555                 cf_save_LIBS="$LIBS"
7556
7557                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
7558                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
7559
7560                 # while -W for passing linker flags is prevalent, it is not "standard".
7561                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7562                 # incompatible _and_ non-standard -W option which gives an error.  Work
7563                 # around that pitfall.
7564                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7565                 (x*c[89]9@@*-W*)
7566
7567 cf_fix_cppflags=no
7568 cf_new_cflags=
7569 cf_new_cppflags=
7570 cf_new_extra_cppflags=
7571
7572 for cf_add_cflags in $cf_pkg_cflags
7573 do
7574 case $cf_fix_cppflags in
7575 (no)
7576         case $cf_add_cflags in
7577         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7578                 case $cf_add_cflags in
7579                 (-D*)
7580                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7581
7582                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7583                                 && test -z "${cf_tst_cflags}" \
7584                                 && cf_fix_cppflags=yes
7585
7586                         if test $cf_fix_cppflags = yes ; then
7587
7588         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7589         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7590
7591                                 continue
7592                         elif test "${cf_tst_cflags}" = "\"'" ; then
7593
7594         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7595         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7596
7597                                 continue
7598                         fi
7599                         ;;
7600                 esac
7601                 case "$CPPFLAGS" in
7602                 (*$cf_add_cflags)
7603                         ;;
7604                 (*)
7605                         case $cf_add_cflags in
7606                         (-D*)
7607                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7608
7609 CPPFLAGS=`echo "$CPPFLAGS" | \
7610         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7611                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7612
7613                                 ;;
7614                         esac
7615
7616         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7617         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7618
7619                         ;;
7620                 esac
7621                 ;;
7622         (*)
7623
7624         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7625         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7626
7627                 ;;
7628         esac
7629         ;;
7630 (yes)
7631
7632         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7633         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7634
7635         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7636
7637         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7638                 && test -z "${cf_tst_cflags}" \
7639                 && cf_fix_cppflags=no
7640         ;;
7641 esac
7642 done
7643
7644 if test -n "$cf_new_cflags" ; then
7645
7646         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7647         CFLAGS="${CFLAGS}$cf_new_cflags"
7648
7649 fi
7650
7651 if test -n "$cf_new_cppflags" ; then
7652
7653         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7654         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7655
7656 fi
7657
7658 if test -n "$cf_new_extra_cppflags" ; then
7659
7660         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7661         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7662
7663 fi
7664
7665 cf_add_libs="$LIBS"
7666 # reverse order
7667 cf_add_0lib=
7668 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7669 # filter duplicates
7670 for cf_add_1lib in $cf_add_0lib; do
7671         for cf_add_2lib in $cf_add_libs; do
7672                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7673                         cf_add_1lib=
7674                         break
7675                 fi
7676         done
7677         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7678 done
7679 LIBS="$cf_add_libs"
7680
7681                         cat >conftest.$ac_ext <<_ACEOF
7682 #line 7682 "configure"
7683 #include "confdefs.h"
7684 #include <${cf_cv_ncurses_header:-curses.h}>
7685 int
7686 main (void)
7687 {
7688 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7689   ;
7690   return 0;
7691 }
7692 _ACEOF
7693 rm -f conftest.$ac_objext conftest$ac_exeext
7694 if { (eval echo "$as_me:7694: \"$ac_link\"") >&5
7695   (eval $ac_link) 2>&5
7696   ac_status=$?
7697   echo "$as_me:7697: \$? = $ac_status" >&5
7698   (exit $ac_status); } &&
7699          { ac_try='test -s conftest$ac_exeext'
7700   { (eval echo "$as_me:7700: \"$ac_try\"") >&5
7701   (eval $ac_try) 2>&5
7702   ac_status=$?
7703   echo "$as_me:7703: \$? = $ac_status" >&5
7704   (exit $ac_status); }; }; then
7705   if test "$cross_compiling" = yes; then
7706   cf_test_ncuconfig=maybe
7707 else
7708   cat >conftest.$ac_ext <<_ACEOF
7709 #line 7709 "configure"
7710 #include "confdefs.h"
7711 #include <${cf_cv_ncurses_header:-curses.h}>
7712                                         int main(void)
7713                                         { char *xx = curses_version(); return (xx == 0); }
7714 _ACEOF
7715 rm -f conftest$ac_exeext
7716 if { (eval echo "$as_me:7716: \"$ac_link\"") >&5
7717   (eval $ac_link) 2>&5
7718   ac_status=$?
7719   echo "$as_me:7719: \$? = $ac_status" >&5
7720   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7721   { (eval echo "$as_me:7721: \"$ac_try\"") >&5
7722   (eval $ac_try) 2>&5
7723   ac_status=$?
7724   echo "$as_me:7724: \$? = $ac_status" >&5
7725   (exit $ac_status); }; }; then
7726   cf_test_ncuconfig=yes
7727 else
7728   echo "$as_me: program exited with status $ac_status" >&5
7729 echo "$as_me: failed program was:" >&5
7730 cat conftest.$ac_ext >&5
7731 cf_test_ncuconfig=no
7732 fi
7733 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7734 fi
7735 else
7736   echo "$as_me: failed program was:" >&5
7737 cat conftest.$ac_ext >&5
7738 cf_test_ncuconfig=no
7739 fi
7740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7741
7742                         CFLAGS="$cf_save_CFLAGS"
7743                         CPPFLAGS="$cf_save_CPPFLAGS"
7744                         LIBS="$cf_save_LIBS"
7745
7746                         if test "x$cf_test_ncuconfig" != xyes; then
7747                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7748                                 cf_pkg_cflags="$cf_temp"
7749                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7750                                 cf_pkg_libs="$cf_temp"
7751                         fi
7752                         ;;
7753                 esac
7754
7755 cf_fix_cppflags=no
7756 cf_new_cflags=
7757 cf_new_cppflags=
7758 cf_new_extra_cppflags=
7759
7760 for cf_add_cflags in $cf_pkg_cflags
7761 do
7762 case $cf_fix_cppflags in
7763 (no)
7764         case $cf_add_cflags in
7765         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7766                 case $cf_add_cflags in
7767                 (-D*)
7768                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7769
7770                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7771                                 && test -z "${cf_tst_cflags}" \
7772                                 && cf_fix_cppflags=yes
7773
7774                         if test $cf_fix_cppflags = yes ; then
7775
7776         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7777         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7778
7779                                 continue
7780                         elif test "${cf_tst_cflags}" = "\"'" ; then
7781
7782         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7783         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7784
7785                                 continue
7786                         fi
7787                         ;;
7788                 esac
7789                 case "$CPPFLAGS" in
7790                 (*$cf_add_cflags)
7791                         ;;
7792                 (*)
7793                         case $cf_add_cflags in
7794                         (-D*)
7795                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7796
7797 CPPFLAGS=`echo "$CPPFLAGS" | \
7798         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7799                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7800
7801                                 ;;
7802                         esac
7803
7804         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7805         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7806
7807                         ;;
7808                 esac
7809                 ;;
7810         (*)
7811
7812         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7813         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7814
7815                 ;;
7816         esac
7817         ;;
7818 (yes)
7819
7820         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7821         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7822
7823         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7824
7825         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7826                 && test -z "${cf_tst_cflags}" \
7827                 && cf_fix_cppflags=no
7828         ;;
7829 esac
7830 done
7831
7832 if test -n "$cf_new_cflags" ; then
7833
7834         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7835         CFLAGS="${CFLAGS}$cf_new_cflags"
7836
7837 fi
7838
7839 if test -n "$cf_new_cppflags" ; then
7840
7841         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7842         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7843
7844 fi
7845
7846 if test -n "$cf_new_extra_cppflags" ; then
7847
7848         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7849         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7850
7851 fi
7852
7853 cf_add_libs="$LIBS"
7854 # reverse order
7855 cf_add_0lib=
7856 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7857 # filter duplicates
7858 for cf_add_1lib in $cf_add_0lib; do
7859         for cf_add_2lib in $cf_add_libs; do
7860                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7861                         cf_add_1lib=
7862                         break
7863                 fi
7864         done
7865         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7866 done
7867 LIBS="$cf_add_libs"
7868
7869                 cat >conftest.$ac_ext <<_ACEOF
7870 #line 7870 "configure"
7871 #include "confdefs.h"
7872 #include <${cf_cv_ncurses_header:-curses.h}>
7873 int
7874 main (void)
7875 {
7876 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7877   ;
7878   return 0;
7879 }
7880 _ACEOF
7881 rm -f conftest.$ac_objext conftest$ac_exeext
7882 if { (eval echo "$as_me:7882: \"$ac_link\"") >&5
7883   (eval $ac_link) 2>&5
7884   ac_status=$?
7885   echo "$as_me:7885: \$? = $ac_status" >&5
7886   (exit $ac_status); } &&
7887          { ac_try='test -s conftest$ac_exeext'
7888   { (eval echo "$as_me:7888: \"$ac_try\"") >&5
7889   (eval $ac_try) 2>&5
7890   ac_status=$?
7891   echo "$as_me:7891: \$? = $ac_status" >&5
7892   (exit $ac_status); }; }; then
7893   if test "$cross_compiling" = yes; then
7894   cf_have_ncuconfig=maybe
7895 else
7896   cat >conftest.$ac_ext <<_ACEOF
7897 #line 7897 "configure"
7898 #include "confdefs.h"
7899 #include <${cf_cv_ncurses_header:-curses.h}>
7900                                 int main(void)
7901                                 { char *xx = curses_version(); return (xx == 0); }
7902 _ACEOF
7903 rm -f conftest$ac_exeext
7904 if { (eval echo "$as_me:7904: \"$ac_link\"") >&5
7905   (eval $ac_link) 2>&5
7906   ac_status=$?
7907   echo "$as_me:7907: \$? = $ac_status" >&5
7908   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7909   { (eval echo "$as_me:7909: \"$ac_try\"") >&5
7910   (eval $ac_try) 2>&5
7911   ac_status=$?
7912   echo "$as_me:7912: \$? = $ac_status" >&5
7913   (exit $ac_status); }; }; then
7914   cf_have_ncuconfig=yes
7915 else
7916   echo "$as_me: program exited with status $ac_status" >&5
7917 echo "$as_me: failed program was:" >&5
7918 cat conftest.$ac_ext >&5
7919 cf_have_ncuconfig=no
7920 fi
7921 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7922 fi
7923 else
7924   echo "$as_me: failed program was:" >&5
7925 cat conftest.$ac_ext >&5
7926 cf_have_ncuconfig=no
7927 fi
7928 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7929                 echo "$as_me:7929: result: $cf_have_ncuconfig" >&5
7930 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7931                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7932                 if test "$cf_have_ncuconfig" != "yes"
7933                 then
7934                         CPPFLAGS="$cf_save_CPPFLAGS"
7935                         LIBS="$cf_save_LIBS"
7936                         NCURSES_CONFIG_PKG=none
7937                 else
7938
7939 cat >>confdefs.h <<\EOF
7940 #define NCURSES 1
7941 EOF
7942
7943                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7944
7945 echo "$as_me:7945: checking for terminfo header" >&5
7946 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7947 if test "${cf_cv_term_header+set}" = set; then
7948   echo $ECHO_N "(cached) $ECHO_C" >&6
7949 else
7950
7951 case ${cf_cv_ncurses_header} in
7952 (*/ncurses.h|*/ncursesw.h)
7953         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7954         ;;
7955 (*)
7956         cf_term_header=term.h
7957         ;;
7958 esac
7959
7960 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7961 do
7962 cat >conftest.$ac_ext <<_ACEOF
7963 #line 7963 "configure"
7964 #include "confdefs.h"
7965 #include <stdio.h>
7966 #include <${cf_cv_ncurses_header:-curses.h}>
7967 #include <$cf_test>
7968
7969 int
7970 main (void)
7971 {
7972 int x = auto_left_margin; (void)x
7973   ;
7974   return 0;
7975 }
7976 _ACEOF
7977 rm -f conftest.$ac_objext
7978 if { (eval echo "$as_me:7978: \"$ac_compile\"") >&5
7979   (eval $ac_compile) 2>&5
7980   ac_status=$?
7981   echo "$as_me:7981: \$? = $ac_status" >&5
7982   (exit $ac_status); } &&
7983          { ac_try='test -s conftest.$ac_objext'
7984   { (eval echo "$as_me:7984: \"$ac_try\"") >&5
7985   (eval $ac_try) 2>&5
7986   ac_status=$?
7987   echo "$as_me:7987: \$? = $ac_status" >&5
7988   (exit $ac_status); }; }; then
7989
7990         cf_cv_term_header="$cf_test"
7991 else
7992   echo "$as_me: failed program was:" >&5
7993 cat conftest.$ac_ext >&5
7994
7995         cf_cv_term_header=unknown
7996
7997 fi
7998 rm -f conftest.$ac_objext conftest.$ac_ext
7999         test "$cf_cv_term_header" != unknown && break
8000 done
8001
8002 fi
8003 echo "$as_me:8003: result: $cf_cv_term_header" >&5
8004 echo "${ECHO_T}$cf_cv_term_header" >&6
8005
8006 # Set definitions to allow ifdef'ing to accommodate subdirectories
8007
8008 case $cf_cv_term_header in
8009 (*term.h)
8010
8011 cat >>confdefs.h <<\EOF
8012 #define HAVE_TERM_H 1
8013 EOF
8014
8015         ;;
8016 esac
8017
8018 case $cf_cv_term_header in
8019 (ncurses/term.h)
8020
8021 cat >>confdefs.h <<\EOF
8022 #define HAVE_NCURSES_TERM_H 1
8023 EOF
8024
8025         ;;
8026 (ncursesw/term.h)
8027
8028 cat >>confdefs.h <<\EOF
8029 #define HAVE_NCURSESW_TERM_H 1
8030 EOF
8031
8032         ;;
8033 esac
8034
8035                 fi
8036
8037         else
8038                 echo "$as_me:8038: result: no" >&5
8039 echo "${ECHO_T}no" >&6
8040                 NCURSES_CONFIG_PKG=none
8041         fi
8042 else
8043         NCURSES_CONFIG_PKG=none
8044 fi
8045
8046 if test "x$cf_have_ncuconfig" = "xno"; then
8047         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8048
8049 if test -n "$ac_tool_prefix"; then
8050   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8051   do
8052     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8053 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8054 echo "$as_me:8054: checking for $ac_word" >&5
8055 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8056 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8057   echo $ECHO_N "(cached) $ECHO_C" >&6
8058 else
8059   if test -n "$NCURSES_CONFIG"; then
8060   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8061 else
8062   ac_save_IFS=$IFS; IFS=$ac_path_separator
8063 ac_dummy="$PATH"
8064 for ac_dir in $ac_dummy; do
8065   IFS=$ac_save_IFS
8066   test -z "$ac_dir" && ac_dir=.
8067   $as_executable_p "$ac_dir/$ac_word" || continue
8068 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8069 echo "$as_me:8069: found $ac_dir/$ac_word" >&5
8070 break
8071 done
8072
8073 fi
8074 fi
8075 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8076 if test -n "$NCURSES_CONFIG"; then
8077   echo "$as_me:8077: result: $NCURSES_CONFIG" >&5
8078 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8079 else
8080   echo "$as_me:8080: result: no" >&5
8081 echo "${ECHO_T}no" >&6
8082 fi
8083
8084     test -n "$NCURSES_CONFIG" && break
8085   done
8086 fi
8087 if test -z "$NCURSES_CONFIG"; then
8088   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8089   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8090 do
8091   # Extract the first word of "$ac_prog", so it can be a program name with args.
8092 set dummy $ac_prog; ac_word=$2
8093 echo "$as_me:8093: checking for $ac_word" >&5
8094 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8095 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8096   echo $ECHO_N "(cached) $ECHO_C" >&6
8097 else
8098   if test -n "$ac_ct_NCURSES_CONFIG"; then
8099   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8100 else
8101   ac_save_IFS=$IFS; IFS=$ac_path_separator
8102 ac_dummy="$PATH"
8103 for ac_dir in $ac_dummy; do
8104   IFS=$ac_save_IFS
8105   test -z "$ac_dir" && ac_dir=.
8106   $as_executable_p "$ac_dir/$ac_word" || continue
8107 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8108 echo "$as_me:8108: found $ac_dir/$ac_word" >&5
8109 break
8110 done
8111
8112 fi
8113 fi
8114 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8115 if test -n "$ac_ct_NCURSES_CONFIG"; then
8116   echo "$as_me:8116: result: $ac_ct_NCURSES_CONFIG" >&5
8117 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8118 else
8119   echo "$as_me:8119: result: no" >&5
8120 echo "${ECHO_T}no" >&6
8121 fi
8122
8123   test -n "$ac_ct_NCURSES_CONFIG" && break
8124 done
8125 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8126
8127   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8128 fi
8129
8130         if test "$NCURSES_CONFIG" != none ; then
8131
8132 cf_fix_cppflags=no
8133 cf_new_cflags=
8134 cf_new_cppflags=
8135 cf_new_extra_cppflags=
8136
8137 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8138 do
8139 case $cf_fix_cppflags in
8140 (no)
8141         case $cf_add_cflags in
8142         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8143                 case $cf_add_cflags in
8144                 (-D*)
8145                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8146
8147                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8148                                 && test -z "${cf_tst_cflags}" \
8149                                 && cf_fix_cppflags=yes
8150
8151                         if test $cf_fix_cppflags = yes ; then
8152
8153         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8154         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8155
8156                                 continue
8157                         elif test "${cf_tst_cflags}" = "\"'" ; then
8158
8159         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8160         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8161
8162                                 continue
8163                         fi
8164                         ;;
8165                 esac
8166                 case "$CPPFLAGS" in
8167                 (*$cf_add_cflags)
8168                         ;;
8169                 (*)
8170                         case $cf_add_cflags in
8171                         (-D*)
8172                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8173
8174 CPPFLAGS=`echo "$CPPFLAGS" | \
8175         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8176                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8177
8178                                 ;;
8179                         esac
8180
8181         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8182         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8183
8184                         ;;
8185                 esac
8186                 ;;
8187         (*)
8188
8189         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8190         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8191
8192                 ;;
8193         esac
8194         ;;
8195 (yes)
8196
8197         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8198         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8199
8200         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8201
8202         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8203                 && test -z "${cf_tst_cflags}" \
8204                 && cf_fix_cppflags=no
8205         ;;
8206 esac
8207 done
8208
8209 if test -n "$cf_new_cflags" ; then
8210
8211         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8212         CFLAGS="${CFLAGS}$cf_new_cflags"
8213
8214 fi
8215
8216 if test -n "$cf_new_cppflags" ; then
8217
8218         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8219         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8220
8221 fi
8222
8223 if test -n "$cf_new_extra_cppflags" ; then
8224
8225         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8226         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8227
8228 fi
8229
8230 cf_add_libs="$LIBS"
8231 # reverse order
8232 cf_add_0lib=
8233 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8234 # filter duplicates
8235 for cf_add_1lib in $cf_add_0lib; do
8236         for cf_add_2lib in $cf_add_libs; do
8237                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8238                         cf_add_1lib=
8239                         break
8240                 fi
8241         done
8242         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8243 done
8244 LIBS="$cf_add_libs"
8245
8246                 # even with config script, some packages use no-override for curses.h
8247
8248 echo "$as_me:8248: checking if we have identified curses headers" >&5
8249 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8250 if test "${cf_cv_ncurses_header+set}" = set; then
8251   echo $ECHO_N "(cached) $ECHO_C" >&6
8252 else
8253
8254 cf_cv_ncurses_header=none
8255 for cf_header in \
8256         ncurses.h $cf_cv_screen/ncurses.h \
8257         curses.h $cf_cv_screen/curses.h
8258 do
8259 cat >conftest.$ac_ext <<_ACEOF
8260 #line 8260 "configure"
8261 #include "confdefs.h"
8262 #include <${cf_header}>
8263 int
8264 main (void)
8265 {
8266 initscr(); tgoto("?", 0,0)
8267   ;
8268   return 0;
8269 }
8270 _ACEOF
8271 rm -f conftest.$ac_objext
8272 if { (eval echo "$as_me:8272: \"$ac_compile\"") >&5
8273   (eval $ac_compile) 2>&5
8274   ac_status=$?
8275   echo "$as_me:8275: \$? = $ac_status" >&5
8276   (exit $ac_status); } &&
8277          { ac_try='test -s conftest.$ac_objext'
8278   { (eval echo "$as_me:8278: \"$ac_try\"") >&5
8279   (eval $ac_try) 2>&5
8280   ac_status=$?
8281   echo "$as_me:8281: \$? = $ac_status" >&5
8282   (exit $ac_status); }; }; then
8283   cf_cv_ncurses_header=$cf_header; break
8284 else
8285   echo "$as_me: failed program was:" >&5
8286 cat conftest.$ac_ext >&5
8287 fi
8288 rm -f conftest.$ac_objext conftest.$ac_ext
8289 done
8290
8291 fi
8292 echo "$as_me:8292: result: $cf_cv_ncurses_header" >&5
8293 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8294
8295 if test "$cf_cv_ncurses_header" = none ; then
8296         { { echo "$as_me:8296: error: No curses header-files found" >&5
8297 echo "$as_me: error: No curses header-files found" >&2;}
8298    { (exit 1); exit 1; }; }
8299 fi
8300
8301 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8302
8303 for ac_header in $cf_cv_ncurses_header
8304 do
8305 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8306 echo "$as_me:8306: checking for $ac_header" >&5
8307 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8308 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8309   echo $ECHO_N "(cached) $ECHO_C" >&6
8310 else
8311   cat >conftest.$ac_ext <<_ACEOF
8312 #line 8312 "configure"
8313 #include "confdefs.h"
8314 #include <$ac_header>
8315 _ACEOF
8316 if { (eval echo "$as_me:8316: \"$ac_cpp conftest.$ac_ext\"") >&5
8317   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8318   ac_status=$?
8319   egrep -v '^ *\+' conftest.er1 >conftest.err
8320   rm -f conftest.er1
8321   cat conftest.err >&5
8322   echo "$as_me:8322: \$? = $ac_status" >&5
8323   (exit $ac_status); } >/dev/null; then
8324   if test -s conftest.err; then
8325     ac_cpp_err=$ac_c_preproc_warn_flag
8326   else
8327     ac_cpp_err=
8328   fi
8329 else
8330   ac_cpp_err=yes
8331 fi
8332 if test -z "$ac_cpp_err"; then
8333   eval "$as_ac_Header=yes"
8334 else
8335   echo "$as_me: failed program was:" >&5
8336   cat conftest.$ac_ext >&5
8337   eval "$as_ac_Header=no"
8338 fi
8339 rm -f conftest.err conftest.$ac_ext
8340 fi
8341 echo "$as_me:8341: result: `eval echo '${'$as_ac_Header'}'`" >&5
8342 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8343 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8344   cat >>confdefs.h <<EOF
8345 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8346 EOF
8347
8348 fi
8349 done
8350
8351 cat >>confdefs.h <<\EOF
8352 #define NCURSES 1
8353 EOF
8354
8355 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8356
8357                 cat >>confdefs.h <<EOF
8358 #define $cf_nculib_ROOT 1
8359 EOF
8360
8361                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8362
8363         else
8364
8365 cf_ncuhdr_root=$cf_cv_screen
8366
8367 test -n "$cf_cv_curses_dir" && \
8368 test "$cf_cv_curses_dir" != "no" && { \
8369
8370 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8371   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8372   do
8373         while test $cf_add_incdir != /usr/include
8374         do
8375           if test -d $cf_add_incdir
8376           then
8377                 cf_have_incdir=no
8378                 if test -n "$CFLAGS$CPPFLAGS" ; then
8379                   # a loop is needed to ensure we can add subdirs of existing dirs
8380                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8381                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8382                           cf_have_incdir=yes; break
8383                         fi
8384                   done
8385                 fi
8386
8387                 if test "$cf_have_incdir" = no ; then
8388                   if test "$cf_add_incdir" = /usr/local/include ; then
8389                         if test "$GCC" = yes
8390                         then
8391                           cf_save_CPPFLAGS=$CPPFLAGS
8392
8393         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8394         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8395
8396                           cat >conftest.$ac_ext <<_ACEOF
8397 #line 8397 "configure"
8398 #include "confdefs.h"
8399 #include <stdio.h>
8400 int
8401 main (void)
8402 {
8403 printf("Hello")
8404   ;
8405   return 0;
8406 }
8407 _ACEOF
8408 rm -f conftest.$ac_objext
8409 if { (eval echo "$as_me:8409: \"$ac_compile\"") >&5
8410   (eval $ac_compile) 2>&5
8411   ac_status=$?
8412   echo "$as_me:8412: \$? = $ac_status" >&5
8413   (exit $ac_status); } &&
8414          { ac_try='test -s conftest.$ac_objext'
8415   { (eval echo "$as_me:8415: \"$ac_try\"") >&5
8416   (eval $ac_try) 2>&5
8417   ac_status=$?
8418   echo "$as_me:8418: \$? = $ac_status" >&5
8419   (exit $ac_status); }; }; then
8420   :
8421 else
8422   echo "$as_me: failed program was:" >&5
8423 cat conftest.$ac_ext >&5
8424 cf_have_incdir=yes
8425 fi
8426 rm -f conftest.$ac_objext conftest.$ac_ext
8427                           CPPFLAGS=$cf_save_CPPFLAGS
8428                         fi
8429                   fi
8430                 fi
8431
8432                 if test "$cf_have_incdir" = no ; then
8433                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8434
8435 echo "${as_me:-configure}:8435: testing adding $cf_add_incdir to include-path ..." 1>&5
8436
8437                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8438
8439                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8440                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8441                   cf_add_incdir="$cf_top_incdir"
8442                 else
8443                   break
8444                 fi
8445           else
8446                 break
8447           fi
8448         done
8449   done
8450 fi
8451
8452 }
8453
8454 echo "$as_me:8454: checking for $cf_ncuhdr_root header in include-path" >&5
8455 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8456 if test "${cf_cv_ncurses_h+set}" = set; then
8457   echo $ECHO_N "(cached) $ECHO_C" >&6
8458 else
8459
8460         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8461         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8462         for cf_header in $cf_header_list
8463         do
8464
8465         cat >conftest.$ac_ext <<_ACEOF
8466 #line 8466 "configure"
8467 #include "confdefs.h"
8468
8469 #include <$cf_header>
8470 int
8471 main (void)
8472 {
8473
8474 #ifdef NCURSES_VERSION
8475
8476 printf("%s\n", NCURSES_VERSION);
8477 #else
8478 #ifdef __NCURSES_H
8479 printf("old\n");
8480 #else
8481         make an error
8482 #endif
8483 #endif
8484
8485   ;
8486   return 0;
8487 }
8488 _ACEOF
8489 rm -f conftest.$ac_objext
8490 if { (eval echo "$as_me:8490: \"$ac_compile\"") >&5
8491   (eval $ac_compile) 2>&5
8492   ac_status=$?
8493   echo "$as_me:8493: \$? = $ac_status" >&5
8494   (exit $ac_status); } &&
8495          { ac_try='test -s conftest.$ac_objext'
8496   { (eval echo "$as_me:8496: \"$ac_try\"") >&5
8497   (eval $ac_try) 2>&5
8498   ac_status=$?
8499   echo "$as_me:8499: \$? = $ac_status" >&5
8500   (exit $ac_status); }; }; then
8501   cf_cv_ncurses_h=$cf_header
8502
8503 else
8504   echo "$as_me: failed program was:" >&5
8505 cat conftest.$ac_ext >&5
8506 cf_cv_ncurses_h=no
8507 fi
8508 rm -f conftest.$ac_objext conftest.$ac_ext
8509
8510                 test "$cf_cv_ncurses_h" != no && break
8511         done
8512
8513 fi
8514 echo "$as_me:8514: result: $cf_cv_ncurses_h" >&5
8515 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8516
8517 if test "$cf_cv_ncurses_h" != no ; then
8518         cf_cv_ncurses_header=$cf_cv_ncurses_h
8519 else
8520
8521 echo "$as_me:8521: checking for $cf_ncuhdr_root include-path" >&5
8522 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8523 if test "${cf_cv_ncurses_h2+set}" = set; then
8524   echo $ECHO_N "(cached) $ECHO_C" >&6
8525 else
8526
8527         test -n "$verbose" && echo
8528
8529 cf_search=
8530
8531 # collect the current set of include-directories from compiler flags
8532 cf_header_path_list=""
8533 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8534         for cf_header_path in $CPPFLAGS $CFLAGS
8535         do
8536                 case $cf_header_path in
8537                 (-I*)
8538                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8539
8540 test "x$cf_header_path" != "xNONE" && \
8541 test -d "$cf_header_path" && \
8542  {
8543         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8544         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8545         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8546         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8547         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8548         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"
8549 }
8550
8551                         cf_header_path_list="$cf_header_path_list $cf_search"
8552                         ;;
8553                 esac
8554         done
8555 fi
8556
8557 # add the variations for the package we are looking for
8558
8559 cf_search=
8560
8561 test "x$prefix" != "xNONE" && \
8562 test -d "$prefix" && \
8563  {
8564         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8565         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8566         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8567         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8568         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8569         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8570 }
8571
8572 for cf_subdir_prefix in \
8573         /usr \
8574         /usr/local \
8575         /usr/pkg \
8576         /opt \
8577         /opt/local \
8578         $HOME
8579 do
8580
8581 test "x$cf_subdir_prefix" != "x$prefix" && \
8582 test -d "$cf_subdir_prefix" && \
8583 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8584         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8585         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8586         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8587         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8588         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8589         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"
8590 }
8591
8592 done
8593
8594 test "$includedir" != NONE && \
8595 test "$includedir" != "/usr/include" && \
8596 test -d "$includedir" && {
8597         test -d $includedir &&    cf_search="$cf_search $includedir"
8598         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8599 }
8600
8601 test "$oldincludedir" != NONE && \
8602 test "$oldincludedir" != "/usr/include" && \
8603 test -d "$oldincludedir" && {
8604         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8605         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8606 }
8607
8608 cf_search="$cf_search $cf_header_path_list"
8609
8610         test -n "$verbose" && echo search path $cf_search
8611         cf_save2_CPPFLAGS="$CPPFLAGS"
8612         for cf_incdir in $cf_search
8613         do
8614
8615 if test -n "$cf_incdir" ; then
8616   for cf_add_incdir in $cf_incdir
8617   do
8618         while test $cf_add_incdir != /usr/include
8619         do
8620           if test -d $cf_add_incdir
8621           then
8622                 cf_have_incdir=no
8623                 if test -n "$CFLAGS$CPPFLAGS" ; then
8624                   # a loop is needed to ensure we can add subdirs of existing dirs
8625                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8626                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8627                           cf_have_incdir=yes; break
8628                         fi
8629                   done
8630                 fi
8631
8632                 if test "$cf_have_incdir" = no ; then
8633                   if test "$cf_add_incdir" = /usr/local/include ; then
8634                         if test "$GCC" = yes
8635                         then
8636                           cf_save_CPPFLAGS=$CPPFLAGS
8637
8638         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8639         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8640
8641                           cat >conftest.$ac_ext <<_ACEOF
8642 #line 8642 "configure"
8643 #include "confdefs.h"
8644 #include <stdio.h>
8645 int
8646 main (void)
8647 {
8648 printf("Hello")
8649   ;
8650   return 0;
8651 }
8652 _ACEOF
8653 rm -f conftest.$ac_objext
8654 if { (eval echo "$as_me:8654: \"$ac_compile\"") >&5
8655   (eval $ac_compile) 2>&5
8656   ac_status=$?
8657   echo "$as_me:8657: \$? = $ac_status" >&5
8658   (exit $ac_status); } &&
8659          { ac_try='test -s conftest.$ac_objext'
8660   { (eval echo "$as_me:8660: \"$ac_try\"") >&5
8661   (eval $ac_try) 2>&5
8662   ac_status=$?
8663   echo "$as_me:8663: \$? = $ac_status" >&5
8664   (exit $ac_status); }; }; then
8665   :
8666 else
8667   echo "$as_me: failed program was:" >&5
8668 cat conftest.$ac_ext >&5
8669 cf_have_incdir=yes
8670 fi
8671 rm -f conftest.$ac_objext conftest.$ac_ext
8672                           CPPFLAGS=$cf_save_CPPFLAGS
8673                         fi
8674                   fi
8675                 fi
8676
8677                 if test "$cf_have_incdir" = no ; then
8678                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8679
8680 echo "${as_me:-configure}:8680: testing adding $cf_add_incdir to include-path ..." 1>&5
8681
8682                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8683
8684                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8685                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8686                   cf_add_incdir="$cf_top_incdir"
8687                 else
8688                   break
8689                 fi
8690           else
8691                 break
8692           fi
8693         done
8694   done
8695 fi
8696
8697                 for cf_header in \
8698                         ncurses.h \
8699                         curses.h
8700                 do
8701
8702         cat >conftest.$ac_ext <<_ACEOF
8703 #line 8703 "configure"
8704 #include "confdefs.h"
8705
8706 #include <$cf_header>
8707 int
8708 main (void)
8709 {
8710
8711 #ifdef NCURSES_VERSION
8712
8713 printf("%s\n", NCURSES_VERSION);
8714 #else
8715 #ifdef __NCURSES_H
8716 printf("old\n");
8717 #else
8718         make an error
8719 #endif
8720 #endif
8721
8722   ;
8723   return 0;
8724 }
8725 _ACEOF
8726 rm -f conftest.$ac_objext
8727 if { (eval echo "$as_me:8727: \"$ac_compile\"") >&5
8728   (eval $ac_compile) 2>&5
8729   ac_status=$?
8730   echo "$as_me:8730: \$? = $ac_status" >&5
8731   (exit $ac_status); } &&
8732          { ac_try='test -s conftest.$ac_objext'
8733   { (eval echo "$as_me:8733: \"$ac_try\"") >&5
8734   (eval $ac_try) 2>&5
8735   ac_status=$?
8736   echo "$as_me:8736: \$? = $ac_status" >&5
8737   (exit $ac_status); }; }; then
8738   cf_cv_ncurses_h2=$cf_header
8739
8740 else
8741   echo "$as_me: failed program was:" >&5
8742 cat conftest.$ac_ext >&5
8743 cf_cv_ncurses_h2=no
8744 fi
8745 rm -f conftest.$ac_objext conftest.$ac_ext
8746
8747                         if test "$cf_cv_ncurses_h2" != no ; then
8748                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8749                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8750                                 break
8751                         fi
8752                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8753                 done
8754                 CPPFLAGS="$cf_save2_CPPFLAGS"
8755                 test "$cf_cv_ncurses_h2" != no && break
8756         done
8757         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8757: error: not found" >&5
8758 echo "$as_me: error: not found" >&2;}
8759    { (exit 1); exit 1; }; }
8760
8761 fi
8762 echo "$as_me:8762: result: $cf_cv_ncurses_h2" >&5
8763 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8764
8765         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8766         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8767         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8768                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8769         fi
8770
8771 if test -n "$cf_1st_incdir" ; then
8772   for cf_add_incdir in $cf_1st_incdir
8773   do
8774         while test $cf_add_incdir != /usr/include
8775         do
8776           if test -d $cf_add_incdir
8777           then
8778                 cf_have_incdir=no
8779                 if test -n "$CFLAGS$CPPFLAGS" ; then
8780                   # a loop is needed to ensure we can add subdirs of existing dirs
8781                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8782                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8783                           cf_have_incdir=yes; break
8784                         fi
8785                   done
8786                 fi
8787
8788                 if test "$cf_have_incdir" = no ; then
8789                   if test "$cf_add_incdir" = /usr/local/include ; then
8790                         if test "$GCC" = yes
8791                         then
8792                           cf_save_CPPFLAGS=$CPPFLAGS
8793
8794         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8795         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8796
8797                           cat >conftest.$ac_ext <<_ACEOF
8798 #line 8798 "configure"
8799 #include "confdefs.h"
8800 #include <stdio.h>
8801 int
8802 main (void)
8803 {
8804 printf("Hello")
8805   ;
8806   return 0;
8807 }
8808 _ACEOF
8809 rm -f conftest.$ac_objext
8810 if { (eval echo "$as_me:8810: \"$ac_compile\"") >&5
8811   (eval $ac_compile) 2>&5
8812   ac_status=$?
8813   echo "$as_me:8813: \$? = $ac_status" >&5
8814   (exit $ac_status); } &&
8815          { ac_try='test -s conftest.$ac_objext'
8816   { (eval echo "$as_me:8816: \"$ac_try\"") >&5
8817   (eval $ac_try) 2>&5
8818   ac_status=$?
8819   echo "$as_me:8819: \$? = $ac_status" >&5
8820   (exit $ac_status); }; }; then
8821   :
8822 else
8823   echo "$as_me: failed program was:" >&5
8824 cat conftest.$ac_ext >&5
8825 cf_have_incdir=yes
8826 fi
8827 rm -f conftest.$ac_objext conftest.$ac_ext
8828                           CPPFLAGS=$cf_save_CPPFLAGS
8829                         fi
8830                   fi
8831                 fi
8832
8833                 if test "$cf_have_incdir" = no ; then
8834                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8835
8836 echo "${as_me:-configure}:8836: testing adding $cf_add_incdir to include-path ..." 1>&5
8837
8838                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8839
8840                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8841                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8842                   cf_add_incdir="$cf_top_incdir"
8843                 else
8844                   break
8845                 fi
8846           else
8847                 break
8848           fi
8849         done
8850   done
8851 fi
8852
8853 fi
8854
8855 # Set definitions to allow ifdef'ing for ncurses.h
8856
8857 case $cf_cv_ncurses_header in
8858 (*ncurses.h)
8859
8860 cat >>confdefs.h <<\EOF
8861 #define HAVE_NCURSES_H 1
8862 EOF
8863
8864         ;;
8865 esac
8866
8867 case $cf_cv_ncurses_header in
8868 (ncurses/curses.h|ncurses/ncurses.h)
8869
8870 cat >>confdefs.h <<\EOF
8871 #define HAVE_NCURSES_NCURSES_H 1
8872 EOF
8873
8874         ;;
8875 (ncursesw/curses.h|ncursesw/ncurses.h)
8876
8877 cat >>confdefs.h <<\EOF
8878 #define HAVE_NCURSESW_NCURSES_H 1
8879 EOF
8880
8881         ;;
8882 esac
8883
8884 echo "$as_me:8884: checking for terminfo header" >&5
8885 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8886 if test "${cf_cv_term_header+set}" = set; then
8887   echo $ECHO_N "(cached) $ECHO_C" >&6
8888 else
8889
8890 case ${cf_cv_ncurses_header} in
8891 (*/ncurses.h|*/ncursesw.h)
8892         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8893         ;;
8894 (*)
8895         cf_term_header=term.h
8896         ;;
8897 esac
8898
8899 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8900 do
8901 cat >conftest.$ac_ext <<_ACEOF
8902 #line 8902 "configure"
8903 #include "confdefs.h"
8904 #include <stdio.h>
8905 #include <${cf_cv_ncurses_header:-curses.h}>
8906 #include <$cf_test>
8907
8908 int
8909 main (void)
8910 {
8911 int x = auto_left_margin; (void)x
8912   ;
8913   return 0;
8914 }
8915 _ACEOF
8916 rm -f conftest.$ac_objext
8917 if { (eval echo "$as_me:8917: \"$ac_compile\"") >&5
8918   (eval $ac_compile) 2>&5
8919   ac_status=$?
8920   echo "$as_me:8920: \$? = $ac_status" >&5
8921   (exit $ac_status); } &&
8922          { ac_try='test -s conftest.$ac_objext'
8923   { (eval echo "$as_me:8923: \"$ac_try\"") >&5
8924   (eval $ac_try) 2>&5
8925   ac_status=$?
8926   echo "$as_me:8926: \$? = $ac_status" >&5
8927   (exit $ac_status); }; }; then
8928
8929         cf_cv_term_header="$cf_test"
8930 else
8931   echo "$as_me: failed program was:" >&5
8932 cat conftest.$ac_ext >&5
8933
8934         cf_cv_term_header=unknown
8935
8936 fi
8937 rm -f conftest.$ac_objext conftest.$ac_ext
8938         test "$cf_cv_term_header" != unknown && break
8939 done
8940
8941 fi
8942 echo "$as_me:8942: result: $cf_cv_term_header" >&5
8943 echo "${ECHO_T}$cf_cv_term_header" >&6
8944
8945 # Set definitions to allow ifdef'ing to accommodate subdirectories
8946
8947 case $cf_cv_term_header in
8948 (*term.h)
8949
8950 cat >>confdefs.h <<\EOF
8951 #define HAVE_TERM_H 1
8952 EOF
8953
8954         ;;
8955 esac
8956
8957 case $cf_cv_term_header in
8958 (ncurses/term.h)
8959
8960 cat >>confdefs.h <<\EOF
8961 #define HAVE_NCURSES_TERM_H 1
8962 EOF
8963
8964         ;;
8965 (ncursesw/term.h)
8966
8967 cat >>confdefs.h <<\EOF
8968 #define HAVE_NCURSESW_TERM_H 1
8969 EOF
8970
8971         ;;
8972 esac
8973
8974 # some applications need this, but should check for NCURSES_VERSION
8975
8976 cat >>confdefs.h <<\EOF
8977 #define NCURSES 1
8978 EOF
8979
8980 echo "$as_me:8980: checking for ncurses version" >&5
8981 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8982 if test "${cf_cv_ncurses_version+set}" = set; then
8983   echo $ECHO_N "(cached) $ECHO_C" >&6
8984 else
8985
8986         cf_cv_ncurses_version=no
8987         cf_tempfile=out$$
8988         rm -f $cf_tempfile
8989         if test "$cross_compiling" = yes; then
8990
8991         # This will not work if the preprocessor splits the line after the
8992         # Autoconf token.  The 'unproto' program does that.
8993         cat > conftest.$ac_ext <<EOF
8994 #include <${cf_cv_ncurses_header:-curses.h}>
8995 #undef Autoconf
8996 #ifdef NCURSES_VERSION
8997 Autoconf NCURSES_VERSION
8998 #else
8999 #ifdef __NCURSES_H
9000 Autoconf "old"
9001 #endif
9002 ;
9003 #endif
9004 EOF
9005         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9006         { (eval echo "$as_me:9006: \"$cf_try\"") >&5
9007   (eval $cf_try) 2>&5
9008   ac_status=$?
9009   echo "$as_me:9009: \$? = $ac_status" >&5
9010   (exit $ac_status); }
9011         if test -f conftest.out ; then
9012                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9013                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9014                 rm -f conftest.out
9015         fi
9016
9017 else
9018   cat >conftest.$ac_ext <<_ACEOF
9019 #line 9019 "configure"
9020 #include "confdefs.h"
9021
9022 #include <${cf_cv_ncurses_header:-curses.h}>
9023 #include <stdio.h>
9024 int main(void)
9025 {
9026         FILE *fp = fopen("$cf_tempfile", "w");
9027 #ifdef NCURSES_VERSION
9028 # ifdef NCURSES_VERSION_PATCH
9029         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9030 # else
9031         fprintf(fp, "%s\n", NCURSES_VERSION);
9032 # endif
9033 #else
9034 # ifdef __NCURSES_H
9035         fprintf(fp, "old\n");
9036 # else
9037         make an error
9038 # endif
9039 #endif
9040         ${cf_cv_main_return:-return}(0);
9041 }
9042 _ACEOF
9043 rm -f conftest$ac_exeext
9044 if { (eval echo "$as_me:9044: \"$ac_link\"") >&5
9045   (eval $ac_link) 2>&5
9046   ac_status=$?
9047   echo "$as_me:9047: \$? = $ac_status" >&5
9048   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9049   { (eval echo "$as_me:9049: \"$ac_try\"") >&5
9050   (eval $ac_try) 2>&5
9051   ac_status=$?
9052   echo "$as_me:9052: \$? = $ac_status" >&5
9053   (exit $ac_status); }; }; then
9054
9055         cf_cv_ncurses_version=`cat $cf_tempfile`
9056 else
9057   echo "$as_me: program exited with status $ac_status" >&5
9058 echo "$as_me: failed program was:" >&5
9059 cat conftest.$ac_ext >&5
9060 fi
9061 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9062 fi
9063         rm -f $cf_tempfile
9064
9065 fi
9066 echo "$as_me:9066: result: $cf_cv_ncurses_version" >&5
9067 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9068 test "$cf_cv_ncurses_version" = no ||
9069 cat >>confdefs.h <<\EOF
9070 #define NCURSES 1
9071 EOF
9072
9073 cf_nculib_root=$cf_cv_screen
9074         # This works, except for the special case where we find gpm, but
9075         # ncurses is in a nonstandard location via $LIBS, and we really want
9076         # to link gpm.
9077 cf_ncurses_LIBS=""
9078 cf_ncurses_SAVE="$LIBS"
9079 echo "$as_me:9079: checking for Gpm_Open in -lgpm" >&5
9080 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9081 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9082   echo $ECHO_N "(cached) $ECHO_C" >&6
9083 else
9084   ac_check_lib_save_LIBS=$LIBS
9085 LIBS="-lgpm  $LIBS"
9086 cat >conftest.$ac_ext <<_ACEOF
9087 #line 9087 "configure"
9088 #include "confdefs.h"
9089
9090 /* Override any gcc2 internal prototype to avoid an error.  */
9091 #ifdef __cplusplus
9092 extern "C"
9093 #endif
9094 /* We use char because int might match the return type of a gcc2
9095    builtin and then its argument prototype would still apply.  */
9096 char Gpm_Open ();
9097 int
9098 main (void)
9099 {
9100 Gpm_Open ();
9101   ;
9102   return 0;
9103 }
9104 _ACEOF
9105 rm -f conftest.$ac_objext conftest$ac_exeext
9106 if { (eval echo "$as_me:9106: \"$ac_link\"") >&5
9107   (eval $ac_link) 2>&5
9108   ac_status=$?
9109   echo "$as_me:9109: \$? = $ac_status" >&5
9110   (exit $ac_status); } &&
9111          { ac_try='test -s conftest$ac_exeext'
9112   { (eval echo "$as_me:9112: \"$ac_try\"") >&5
9113   (eval $ac_try) 2>&5
9114   ac_status=$?
9115   echo "$as_me:9115: \$? = $ac_status" >&5
9116   (exit $ac_status); }; }; then
9117   ac_cv_lib_gpm_Gpm_Open=yes
9118 else
9119   echo "$as_me: failed program was:" >&5
9120 cat conftest.$ac_ext >&5
9121 ac_cv_lib_gpm_Gpm_Open=no
9122 fi
9123 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9124 LIBS=$ac_check_lib_save_LIBS
9125 fi
9126 echo "$as_me:9126: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9127 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9128 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9129   echo "$as_me:9129: checking for initscr in -lgpm" >&5
9130 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9131 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9132   echo $ECHO_N "(cached) $ECHO_C" >&6
9133 else
9134   ac_check_lib_save_LIBS=$LIBS
9135 LIBS="-lgpm  $LIBS"
9136 cat >conftest.$ac_ext <<_ACEOF
9137 #line 9137 "configure"
9138 #include "confdefs.h"
9139
9140 /* Override any gcc2 internal prototype to avoid an error.  */
9141 #ifdef __cplusplus
9142 extern "C"
9143 #endif
9144 /* We use char because int might match the return type of a gcc2
9145    builtin and then its argument prototype would still apply.  */
9146 char initscr ();
9147 int
9148 main (void)
9149 {
9150 initscr ();
9151   ;
9152   return 0;
9153 }
9154 _ACEOF
9155 rm -f conftest.$ac_objext conftest$ac_exeext
9156 if { (eval echo "$as_me:9156: \"$ac_link\"") >&5
9157   (eval $ac_link) 2>&5
9158   ac_status=$?
9159   echo "$as_me:9159: \$? = $ac_status" >&5
9160   (exit $ac_status); } &&
9161          { ac_try='test -s conftest$ac_exeext'
9162   { (eval echo "$as_me:9162: \"$ac_try\"") >&5
9163   (eval $ac_try) 2>&5
9164   ac_status=$?
9165   echo "$as_me:9165: \$? = $ac_status" >&5
9166   (exit $ac_status); }; }; then
9167   ac_cv_lib_gpm_initscr=yes
9168 else
9169   echo "$as_me: failed program was:" >&5
9170 cat conftest.$ac_ext >&5
9171 ac_cv_lib_gpm_initscr=no
9172 fi
9173 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9174 LIBS=$ac_check_lib_save_LIBS
9175 fi
9176 echo "$as_me:9176: result: $ac_cv_lib_gpm_initscr" >&5
9177 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9178 if test $ac_cv_lib_gpm_initscr = yes; then
9179   LIBS="$cf_ncurses_SAVE"
9180 else
9181   cf_ncurses_LIBS="-lgpm"
9182 fi
9183
9184 fi
9185
9186 case $host_os in
9187 (freebsd*)
9188         # This is only necessary if you are linking against an obsolete
9189         # version of ncurses (but it should do no harm, since it's static).
9190         if test "$cf_nculib_root" = ncurses ; then
9191                 echo "$as_me:9191: checking for tgoto in -lmytinfo" >&5
9192 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9193 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9194   echo $ECHO_N "(cached) $ECHO_C" >&6
9195 else
9196   ac_check_lib_save_LIBS=$LIBS
9197 LIBS="-lmytinfo  $LIBS"
9198 cat >conftest.$ac_ext <<_ACEOF
9199 #line 9199 "configure"
9200 #include "confdefs.h"
9201
9202 /* Override any gcc2 internal prototype to avoid an error.  */
9203 #ifdef __cplusplus
9204 extern "C"
9205 #endif
9206 /* We use char because int might match the return type of a gcc2
9207    builtin and then its argument prototype would still apply.  */
9208 char tgoto ();
9209 int
9210 main (void)
9211 {
9212 tgoto ();
9213   ;
9214   return 0;
9215 }
9216 _ACEOF
9217 rm -f conftest.$ac_objext conftest$ac_exeext
9218 if { (eval echo "$as_me:9218: \"$ac_link\"") >&5
9219   (eval $ac_link) 2>&5
9220   ac_status=$?
9221   echo "$as_me:9221: \$? = $ac_status" >&5
9222   (exit $ac_status); } &&
9223          { ac_try='test -s conftest$ac_exeext'
9224   { (eval echo "$as_me:9224: \"$ac_try\"") >&5
9225   (eval $ac_try) 2>&5
9226   ac_status=$?
9227   echo "$as_me:9227: \$? = $ac_status" >&5
9228   (exit $ac_status); }; }; then
9229   ac_cv_lib_mytinfo_tgoto=yes
9230 else
9231   echo "$as_me: failed program was:" >&5
9232 cat conftest.$ac_ext >&5
9233 ac_cv_lib_mytinfo_tgoto=no
9234 fi
9235 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9236 LIBS=$ac_check_lib_save_LIBS
9237 fi
9238 echo "$as_me:9238: result: $ac_cv_lib_mytinfo_tgoto" >&5
9239 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9240 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9241   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9242 fi
9243
9244         fi
9245         ;;
9246 esac
9247
9248 cf_add_libs="$LIBS"
9249 # reverse order
9250 cf_add_0lib=
9251 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9252 # filter duplicates
9253 for cf_add_1lib in $cf_add_0lib; do
9254         for cf_add_2lib in $cf_add_libs; do
9255                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9256                         cf_add_1lib=
9257                         break
9258                 fi
9259         done
9260         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9261 done
9262 LIBS="$cf_add_libs"
9263
9264 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9265 then
9266
9267 cf_add_libs="$LIBS"
9268 # reverse order
9269 cf_add_0lib=
9270 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9271 # filter duplicates
9272 for cf_add_1lib in $cf_add_0lib; do
9273         for cf_add_2lib in $cf_add_libs; do
9274                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9275                         cf_add_1lib=
9276                         break
9277                 fi
9278         done
9279         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9280 done
9281 LIBS="$cf_add_libs"
9282
9283 else
9284
9285         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9286         cf_libdir=""
9287         echo "$as_me:9287: checking for initscr" >&5
9288 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9289 if test "${ac_cv_func_initscr+set}" = set; then
9290   echo $ECHO_N "(cached) $ECHO_C" >&6
9291 else
9292   cat >conftest.$ac_ext <<_ACEOF
9293 #line 9293 "configure"
9294 #include "confdefs.h"
9295 #define initscr autoconf_temporary
9296 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9297 #undef initscr
9298
9299 #ifdef __cplusplus
9300 extern "C"
9301 #endif
9302
9303 /* We use char because int might match the return type of a gcc2
9304    builtin and then its argument prototype would still apply.  */
9305 char initscr (void);
9306
9307 int
9308 main (void)
9309 {
9310
9311 /* The GNU C library defines stubs for functions which it implements
9312     to always fail with ENOSYS.  Some functions are actually named
9313     something starting with __ and the normal name is an alias.  */
9314 #if defined (__stub_initscr) || defined (__stub___initscr)
9315 #error found stub for initscr
9316 #endif
9317
9318         return initscr ();
9319   ;
9320   return 0;
9321 }
9322 _ACEOF
9323 rm -f conftest.$ac_objext conftest$ac_exeext
9324 if { (eval echo "$as_me:9324: \"$ac_link\"") >&5
9325   (eval $ac_link) 2>&5
9326   ac_status=$?
9327   echo "$as_me:9327: \$? = $ac_status" >&5
9328   (exit $ac_status); } &&
9329          { ac_try='test -s conftest$ac_exeext'
9330   { (eval echo "$as_me:9330: \"$ac_try\"") >&5
9331   (eval $ac_try) 2>&5
9332   ac_status=$?
9333   echo "$as_me:9333: \$? = $ac_status" >&5
9334   (exit $ac_status); }; }; then
9335   ac_cv_func_initscr=yes
9336 else
9337   echo "$as_me: failed program was:" >&5
9338 cat conftest.$ac_ext >&5
9339 ac_cv_func_initscr=no
9340 fi
9341 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9342 fi
9343 echo "$as_me:9343: result: $ac_cv_func_initscr" >&5
9344 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9345 if test $ac_cv_func_initscr = yes; then
9346   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9347 else
9348
9349                 cf_save_LIBS="$LIBS"
9350                 echo "$as_me:9350: checking for initscr in -l$cf_nculib_root" >&5
9351 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9352                 LIBS="-l$cf_nculib_root $LIBS"
9353                 cat >conftest.$ac_ext <<_ACEOF
9354 #line 9354 "configure"
9355 #include "confdefs.h"
9356 #include <${cf_cv_ncurses_header:-curses.h}>
9357 int
9358 main (void)
9359 {
9360 initscr()
9361   ;
9362   return 0;
9363 }
9364 _ACEOF
9365 rm -f conftest.$ac_objext conftest$ac_exeext
9366 if { (eval echo "$as_me:9366: \"$ac_link\"") >&5
9367   (eval $ac_link) 2>&5
9368   ac_status=$?
9369   echo "$as_me:9369: \$? = $ac_status" >&5
9370   (exit $ac_status); } &&
9371          { ac_try='test -s conftest$ac_exeext'
9372   { (eval echo "$as_me:9372: \"$ac_try\"") >&5
9373   (eval $ac_try) 2>&5
9374   ac_status=$?
9375   echo "$as_me:9375: \$? = $ac_status" >&5
9376   (exit $ac_status); }; }; then
9377   echo "$as_me:9377: result: yes" >&5
9378 echo "${ECHO_T}yes" >&6
9379                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9380
9381 else
9382   echo "$as_me: failed program was:" >&5
9383 cat conftest.$ac_ext >&5
9384 echo "$as_me:9384: result: no" >&5
9385 echo "${ECHO_T}no" >&6
9386
9387 cf_search=
9388 cf_library_path_list=""
9389 if test -n "${LDFLAGS}${LIBS}" ; then
9390         for cf_library_path in $LDFLAGS $LIBS
9391         do
9392                 case $cf_library_path in
9393                 (-L*)
9394                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9395
9396 test "x$cf_library_path" != "xNONE" && \
9397 test -d "$cf_library_path" && \
9398  {
9399         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9400         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9401         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9402         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9403         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9404         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"
9405 }
9406
9407                         cf_library_path_list="$cf_library_path_list $cf_search"
9408                         ;;
9409                 esac
9410         done
9411 fi
9412
9413 cf_search=
9414
9415 test "x$prefix" != "xNONE" && \
9416 test -d "$prefix" && \
9417  {
9418         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9419         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9420         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9421         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9422         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9423         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9424 }
9425
9426 for cf_subdir_prefix in \
9427         /usr \
9428         /usr/local \
9429         /usr/pkg \
9430         /opt \
9431         /opt/local \
9432         $HOME
9433 do
9434
9435 test "x$cf_subdir_prefix" != "x$prefix" && \
9436 test -d "$cf_subdir_prefix" && \
9437 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9438         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9439         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9440         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9441         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9442         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9443         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"
9444 }
9445
9446 done
9447
9448 cf_search="$cf_library_path_list $cf_search"
9449
9450                         for cf_libdir in $cf_search
9451                         do
9452                                 echo "$as_me:9452: checking for -l$cf_nculib_root in $cf_libdir" >&5
9453 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9454                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9455                                 cat >conftest.$ac_ext <<_ACEOF
9456 #line 9456 "configure"
9457 #include "confdefs.h"
9458 #include <${cf_cv_ncurses_header:-curses.h}>
9459 int
9460 main (void)
9461 {
9462 initscr()
9463   ;
9464   return 0;
9465 }
9466 _ACEOF
9467 rm -f conftest.$ac_objext conftest$ac_exeext
9468 if { (eval echo "$as_me:9468: \"$ac_link\"") >&5
9469   (eval $ac_link) 2>&5
9470   ac_status=$?
9471   echo "$as_me:9471: \$? = $ac_status" >&5
9472   (exit $ac_status); } &&
9473          { ac_try='test -s conftest$ac_exeext'
9474   { (eval echo "$as_me:9474: \"$ac_try\"") >&5
9475   (eval $ac_try) 2>&5
9476   ac_status=$?
9477   echo "$as_me:9477: \$? = $ac_status" >&5
9478   (exit $ac_status); }; }; then
9479   echo "$as_me:9479: result: yes" >&5
9480 echo "${ECHO_T}yes" >&6
9481                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9482                                          break
9483 else
9484   echo "$as_me: failed program was:" >&5
9485 cat conftest.$ac_ext >&5
9486 echo "$as_me:9486: result: no" >&5
9487 echo "${ECHO_T}no" >&6
9488                                          LIBS="$cf_save_LIBS"
9489 fi
9490 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9491                         done
9492
9493 fi
9494 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9495
9496 fi
9497
9498 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9499
9500 if test $cf_found_library = no ; then
9501         { { echo "$as_me:9501: error: Cannot link $cf_nculib_root library" >&5
9502 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9503    { (exit 1); exit 1; }; }
9504 fi
9505
9506 fi
9507
9508 if test -n "$cf_ncurses_LIBS" ; then
9509         echo "$as_me:9509: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9510 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9511         cf_ncurses_SAVE="$LIBS"
9512         for p in $cf_ncurses_LIBS ; do
9513                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9514                 if test "$q" != "$LIBS" ; then
9515                         LIBS="$q"
9516                 fi
9517         done
9518         cat >conftest.$ac_ext <<_ACEOF
9519 #line 9519 "configure"
9520 #include "confdefs.h"
9521 #include <${cf_cv_ncurses_header:-curses.h}>
9522 int
9523 main (void)
9524 {
9525 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9526   ;
9527   return 0;
9528 }
9529 _ACEOF
9530 rm -f conftest.$ac_objext conftest$ac_exeext
9531 if { (eval echo "$as_me:9531: \"$ac_link\"") >&5
9532   (eval $ac_link) 2>&5
9533   ac_status=$?
9534   echo "$as_me:9534: \$? = $ac_status" >&5
9535   (exit $ac_status); } &&
9536          { ac_try='test -s conftest$ac_exeext'
9537   { (eval echo "$as_me:9537: \"$ac_try\"") >&5
9538   (eval $ac_try) 2>&5
9539   ac_status=$?
9540   echo "$as_me:9540: \$? = $ac_status" >&5
9541   (exit $ac_status); }; }; then
9542   echo "$as_me:9542: result: yes" >&5
9543 echo "${ECHO_T}yes" >&6
9544 else
9545   echo "$as_me: failed program was:" >&5
9546 cat conftest.$ac_ext >&5
9547 echo "$as_me:9547: result: no" >&5
9548 echo "${ECHO_T}no" >&6
9549                  LIBS="$cf_ncurses_SAVE"
9550 fi
9551 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9552 fi
9553
9554 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9555
9556 cat >>confdefs.h <<EOF
9557 #define $cf_nculib_ROOT 1
9558 EOF
9559
9560         fi
9561 else
9562         NCURSES_CONFIG=none
9563 fi
9564
9565         ;;
9566 (ncurses*)
9567
9568 cf_ncuconfig_root=$cf_cv_screen
9569 cf_have_ncuconfig=no
9570
9571 if test "x${PKG_CONFIG:=none}" != xnone; then
9572         echo "$as_me:9572: checking pkg-config for $cf_ncuconfig_root" >&5
9573 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9574         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9575                 echo "$as_me:9575: result: yes" >&5
9576 echo "${ECHO_T}yes" >&6
9577
9578                 echo "$as_me:9578: checking if the $cf_ncuconfig_root package files work" >&5
9579 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9580                 cf_have_ncuconfig=unknown
9581
9582                 cf_save_CFLAGS="$CFLAGS"
9583                 cf_save_CPPFLAGS="$CPPFLAGS"
9584                 cf_save_LIBS="$LIBS"
9585
9586                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
9587                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
9588
9589                 # while -W for passing linker flags is prevalent, it is not "standard".
9590                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9591                 # incompatible _and_ non-standard -W option which gives an error.  Work
9592                 # around that pitfall.
9593                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9594                 (x*c[89]9@@*-W*)
9595
9596 cf_fix_cppflags=no
9597 cf_new_cflags=
9598 cf_new_cppflags=
9599 cf_new_extra_cppflags=
9600
9601 for cf_add_cflags in $cf_pkg_cflags
9602 do
9603 case $cf_fix_cppflags in
9604 (no)
9605         case $cf_add_cflags in
9606         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9607                 case $cf_add_cflags in
9608                 (-D*)
9609                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9610
9611                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9612                                 && test -z "${cf_tst_cflags}" \
9613                                 && cf_fix_cppflags=yes
9614
9615                         if test $cf_fix_cppflags = yes ; then
9616
9617         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9618         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9619
9620                                 continue
9621                         elif test "${cf_tst_cflags}" = "\"'" ; then
9622
9623         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9624         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9625
9626                                 continue
9627                         fi
9628                         ;;
9629                 esac
9630                 case "$CPPFLAGS" in
9631                 (*$cf_add_cflags)
9632                         ;;
9633                 (*)
9634                         case $cf_add_cflags in
9635                         (-D*)
9636                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9637
9638 CPPFLAGS=`echo "$CPPFLAGS" | \
9639         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9640                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9641
9642                                 ;;
9643                         esac
9644
9645         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9646         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9647
9648                         ;;
9649                 esac
9650                 ;;
9651         (*)
9652
9653         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9654         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9655
9656                 ;;
9657         esac
9658         ;;
9659 (yes)
9660
9661         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9662         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9663
9664         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9665
9666         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9667                 && test -z "${cf_tst_cflags}" \
9668                 && cf_fix_cppflags=no
9669         ;;
9670 esac
9671 done
9672
9673 if test -n "$cf_new_cflags" ; then
9674
9675         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9676         CFLAGS="${CFLAGS}$cf_new_cflags"
9677
9678 fi
9679
9680 if test -n "$cf_new_cppflags" ; then
9681
9682         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9683         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9684
9685 fi
9686
9687 if test -n "$cf_new_extra_cppflags" ; then
9688
9689         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9690         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9691
9692 fi
9693
9694 cf_add_libs="$LIBS"
9695 # reverse order
9696 cf_add_0lib=
9697 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9698 # filter duplicates
9699 for cf_add_1lib in $cf_add_0lib; do
9700         for cf_add_2lib in $cf_add_libs; do
9701                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9702                         cf_add_1lib=
9703                         break
9704                 fi
9705         done
9706         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9707 done
9708 LIBS="$cf_add_libs"
9709
9710                         cat >conftest.$ac_ext <<_ACEOF
9711 #line 9711 "configure"
9712 #include "confdefs.h"
9713 #include <${cf_cv_ncurses_header:-curses.h}>
9714 int
9715 main (void)
9716 {
9717 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9718   ;
9719   return 0;
9720 }
9721 _ACEOF
9722 rm -f conftest.$ac_objext conftest$ac_exeext
9723 if { (eval echo "$as_me:9723: \"$ac_link\"") >&5
9724   (eval $ac_link) 2>&5
9725   ac_status=$?
9726   echo "$as_me:9726: \$? = $ac_status" >&5
9727   (exit $ac_status); } &&
9728          { ac_try='test -s conftest$ac_exeext'
9729   { (eval echo "$as_me:9729: \"$ac_try\"") >&5
9730   (eval $ac_try) 2>&5
9731   ac_status=$?
9732   echo "$as_me:9732: \$? = $ac_status" >&5
9733   (exit $ac_status); }; }; then
9734   if test "$cross_compiling" = yes; then
9735   cf_test_ncuconfig=maybe
9736 else
9737   cat >conftest.$ac_ext <<_ACEOF
9738 #line 9738 "configure"
9739 #include "confdefs.h"
9740 #include <${cf_cv_ncurses_header:-curses.h}>
9741                                         int main(void)
9742                                         { char *xx = curses_version(); return (xx == 0); }
9743 _ACEOF
9744 rm -f conftest$ac_exeext
9745 if { (eval echo "$as_me:9745: \"$ac_link\"") >&5
9746   (eval $ac_link) 2>&5
9747   ac_status=$?
9748   echo "$as_me:9748: \$? = $ac_status" >&5
9749   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9750   { (eval echo "$as_me:9750: \"$ac_try\"") >&5
9751   (eval $ac_try) 2>&5
9752   ac_status=$?
9753   echo "$as_me:9753: \$? = $ac_status" >&5
9754   (exit $ac_status); }; }; then
9755   cf_test_ncuconfig=yes
9756 else
9757   echo "$as_me: program exited with status $ac_status" >&5
9758 echo "$as_me: failed program was:" >&5
9759 cat conftest.$ac_ext >&5
9760 cf_test_ncuconfig=no
9761 fi
9762 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9763 fi
9764 else
9765   echo "$as_me: failed program was:" >&5
9766 cat conftest.$ac_ext >&5
9767 cf_test_ncuconfig=no
9768 fi
9769 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9770
9771                         CFLAGS="$cf_save_CFLAGS"
9772                         CPPFLAGS="$cf_save_CPPFLAGS"
9773                         LIBS="$cf_save_LIBS"
9774
9775                         if test "x$cf_test_ncuconfig" != xyes; then
9776                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9777                                 cf_pkg_cflags="$cf_temp"
9778                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9779                                 cf_pkg_libs="$cf_temp"
9780                         fi
9781                         ;;
9782                 esac
9783
9784 cf_fix_cppflags=no
9785 cf_new_cflags=
9786 cf_new_cppflags=
9787 cf_new_extra_cppflags=
9788
9789 for cf_add_cflags in $cf_pkg_cflags
9790 do
9791 case $cf_fix_cppflags in
9792 (no)
9793         case $cf_add_cflags in
9794         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9795                 case $cf_add_cflags in
9796                 (-D*)
9797                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9798
9799                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9800                                 && test -z "${cf_tst_cflags}" \
9801                                 && cf_fix_cppflags=yes
9802
9803                         if test $cf_fix_cppflags = yes ; then
9804
9805         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9806         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9807
9808                                 continue
9809                         elif test "${cf_tst_cflags}" = "\"'" ; then
9810
9811         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9812         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9813
9814                                 continue
9815                         fi
9816                         ;;
9817                 esac
9818                 case "$CPPFLAGS" in
9819                 (*$cf_add_cflags)
9820                         ;;
9821                 (*)
9822                         case $cf_add_cflags in
9823                         (-D*)
9824                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9825
9826 CPPFLAGS=`echo "$CPPFLAGS" | \
9827         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9828                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9829
9830                                 ;;
9831                         esac
9832
9833         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9834         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9835
9836                         ;;
9837                 esac
9838                 ;;
9839         (*)
9840
9841         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9842         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9843
9844                 ;;
9845         esac
9846         ;;
9847 (yes)
9848
9849         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9850         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9851
9852         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9853
9854         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9855                 && test -z "${cf_tst_cflags}" \
9856                 && cf_fix_cppflags=no
9857         ;;
9858 esac
9859 done
9860
9861 if test -n "$cf_new_cflags" ; then
9862
9863         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9864         CFLAGS="${CFLAGS}$cf_new_cflags"
9865
9866 fi
9867
9868 if test -n "$cf_new_cppflags" ; then
9869
9870         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9871         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9872
9873 fi
9874
9875 if test -n "$cf_new_extra_cppflags" ; then
9876
9877         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9878         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9879
9880 fi
9881
9882 cf_add_libs="$LIBS"
9883 # reverse order
9884 cf_add_0lib=
9885 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9886 # filter duplicates
9887 for cf_add_1lib in $cf_add_0lib; do
9888         for cf_add_2lib in $cf_add_libs; do
9889                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9890                         cf_add_1lib=
9891                         break
9892                 fi
9893         done
9894         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9895 done
9896 LIBS="$cf_add_libs"
9897
9898                 cat >conftest.$ac_ext <<_ACEOF
9899 #line 9899 "configure"
9900 #include "confdefs.h"
9901 #include <${cf_cv_ncurses_header:-curses.h}>
9902 int
9903 main (void)
9904 {
9905 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9906   ;
9907   return 0;
9908 }
9909 _ACEOF
9910 rm -f conftest.$ac_objext conftest$ac_exeext
9911 if { (eval echo "$as_me:9911: \"$ac_link\"") >&5
9912   (eval $ac_link) 2>&5
9913   ac_status=$?
9914   echo "$as_me:9914: \$? = $ac_status" >&5
9915   (exit $ac_status); } &&
9916          { ac_try='test -s conftest$ac_exeext'
9917   { (eval echo "$as_me:9917: \"$ac_try\"") >&5
9918   (eval $ac_try) 2>&5
9919   ac_status=$?
9920   echo "$as_me:9920: \$? = $ac_status" >&5
9921   (exit $ac_status); }; }; then
9922   if test "$cross_compiling" = yes; then
9923   cf_have_ncuconfig=maybe
9924 else
9925   cat >conftest.$ac_ext <<_ACEOF
9926 #line 9926 "configure"
9927 #include "confdefs.h"
9928 #include <${cf_cv_ncurses_header:-curses.h}>
9929                                 int main(void)
9930                                 { char *xx = curses_version(); return (xx == 0); }
9931 _ACEOF
9932 rm -f conftest$ac_exeext
9933 if { (eval echo "$as_me:9933: \"$ac_link\"") >&5
9934   (eval $ac_link) 2>&5
9935   ac_status=$?
9936   echo "$as_me:9936: \$? = $ac_status" >&5
9937   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9938   { (eval echo "$as_me:9938: \"$ac_try\"") >&5
9939   (eval $ac_try) 2>&5
9940   ac_status=$?
9941   echo "$as_me:9941: \$? = $ac_status" >&5
9942   (exit $ac_status); }; }; then
9943   cf_have_ncuconfig=yes
9944 else
9945   echo "$as_me: program exited with status $ac_status" >&5
9946 echo "$as_me: failed program was:" >&5
9947 cat conftest.$ac_ext >&5
9948 cf_have_ncuconfig=no
9949 fi
9950 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9951 fi
9952 else
9953   echo "$as_me: failed program was:" >&5
9954 cat conftest.$ac_ext >&5
9955 cf_have_ncuconfig=no
9956 fi
9957 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9958                 echo "$as_me:9958: result: $cf_have_ncuconfig" >&5
9959 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9960                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9961                 if test "$cf_have_ncuconfig" != "yes"
9962                 then
9963                         CPPFLAGS="$cf_save_CPPFLAGS"
9964                         LIBS="$cf_save_LIBS"
9965                         NCURSES_CONFIG_PKG=none
9966                 else
9967
9968 cat >>confdefs.h <<\EOF
9969 #define NCURSES 1
9970 EOF
9971
9972                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9973
9974 echo "$as_me:9974: checking for terminfo header" >&5
9975 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9976 if test "${cf_cv_term_header+set}" = set; then
9977   echo $ECHO_N "(cached) $ECHO_C" >&6
9978 else
9979
9980 case ${cf_cv_ncurses_header} in
9981 (*/ncurses.h|*/ncursesw.h)
9982         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9983         ;;
9984 (*)
9985         cf_term_header=term.h
9986         ;;
9987 esac
9988
9989 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9990 do
9991 cat >conftest.$ac_ext <<_ACEOF
9992 #line 9992 "configure"
9993 #include "confdefs.h"
9994 #include <stdio.h>
9995 #include <${cf_cv_ncurses_header:-curses.h}>
9996 #include <$cf_test>
9997
9998 int
9999 main (void)
10000 {
10001 int x = auto_left_margin; (void)x
10002   ;
10003   return 0;
10004 }
10005 _ACEOF
10006 rm -f conftest.$ac_objext
10007 if { (eval echo "$as_me:10007: \"$ac_compile\"") >&5
10008   (eval $ac_compile) 2>&5
10009   ac_status=$?
10010   echo "$as_me:10010: \$? = $ac_status" >&5
10011   (exit $ac_status); } &&
10012          { ac_try='test -s conftest.$ac_objext'
10013   { (eval echo "$as_me:10013: \"$ac_try\"") >&5
10014   (eval $ac_try) 2>&5
10015   ac_status=$?
10016   echo "$as_me:10016: \$? = $ac_status" >&5
10017   (exit $ac_status); }; }; then
10018
10019         cf_cv_term_header="$cf_test"
10020 else
10021   echo "$as_me: failed program was:" >&5
10022 cat conftest.$ac_ext >&5
10023
10024         cf_cv_term_header=unknown
10025
10026 fi
10027 rm -f conftest.$ac_objext conftest.$ac_ext
10028         test "$cf_cv_term_header" != unknown && break
10029 done
10030
10031 fi
10032 echo "$as_me:10032: result: $cf_cv_term_header" >&5
10033 echo "${ECHO_T}$cf_cv_term_header" >&6
10034
10035 # Set definitions to allow ifdef'ing to accommodate subdirectories
10036
10037 case $cf_cv_term_header in
10038 (*term.h)
10039
10040 cat >>confdefs.h <<\EOF
10041 #define HAVE_TERM_H 1
10042 EOF
10043
10044         ;;
10045 esac
10046
10047 case $cf_cv_term_header in
10048 (ncurses/term.h)
10049
10050 cat >>confdefs.h <<\EOF
10051 #define HAVE_NCURSES_TERM_H 1
10052 EOF
10053
10054         ;;
10055 (ncursesw/term.h)
10056
10057 cat >>confdefs.h <<\EOF
10058 #define HAVE_NCURSESW_TERM_H 1
10059 EOF
10060
10061         ;;
10062 esac
10063
10064                 fi
10065
10066         else
10067                 echo "$as_me:10067: result: no" >&5
10068 echo "${ECHO_T}no" >&6
10069                 NCURSES_CONFIG_PKG=none
10070         fi
10071 else
10072         NCURSES_CONFIG_PKG=none
10073 fi
10074
10075 if test "x$cf_have_ncuconfig" = "xno"; then
10076         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10077
10078 if test -n "$ac_tool_prefix"; then
10079   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10080   do
10081     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10082 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10083 echo "$as_me:10083: checking for $ac_word" >&5
10084 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10085 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10086   echo $ECHO_N "(cached) $ECHO_C" >&6
10087 else
10088   if test -n "$NCURSES_CONFIG"; then
10089   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10090 else
10091   ac_save_IFS=$IFS; IFS=$ac_path_separator
10092 ac_dummy="$PATH"
10093 for ac_dir in $ac_dummy; do
10094   IFS=$ac_save_IFS
10095   test -z "$ac_dir" && ac_dir=.
10096   $as_executable_p "$ac_dir/$ac_word" || continue
10097 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10098 echo "$as_me:10098: found $ac_dir/$ac_word" >&5
10099 break
10100 done
10101
10102 fi
10103 fi
10104 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10105 if test -n "$NCURSES_CONFIG"; then
10106   echo "$as_me:10106: result: $NCURSES_CONFIG" >&5
10107 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10108 else
10109   echo "$as_me:10109: result: no" >&5
10110 echo "${ECHO_T}no" >&6
10111 fi
10112
10113     test -n "$NCURSES_CONFIG" && break
10114   done
10115 fi
10116 if test -z "$NCURSES_CONFIG"; then
10117   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10118   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10119 do
10120   # Extract the first word of "$ac_prog", so it can be a program name with args.
10121 set dummy $ac_prog; ac_word=$2
10122 echo "$as_me:10122: checking for $ac_word" >&5
10123 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10124 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10125   echo $ECHO_N "(cached) $ECHO_C" >&6
10126 else
10127   if test -n "$ac_ct_NCURSES_CONFIG"; then
10128   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10129 else
10130   ac_save_IFS=$IFS; IFS=$ac_path_separator
10131 ac_dummy="$PATH"
10132 for ac_dir in $ac_dummy; do
10133   IFS=$ac_save_IFS
10134   test -z "$ac_dir" && ac_dir=.
10135   $as_executable_p "$ac_dir/$ac_word" || continue
10136 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10137 echo "$as_me:10137: found $ac_dir/$ac_word" >&5
10138 break
10139 done
10140
10141 fi
10142 fi
10143 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10144 if test -n "$ac_ct_NCURSES_CONFIG"; then
10145   echo "$as_me:10145: result: $ac_ct_NCURSES_CONFIG" >&5
10146 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10147 else
10148   echo "$as_me:10148: result: no" >&5
10149 echo "${ECHO_T}no" >&6
10150 fi
10151
10152   test -n "$ac_ct_NCURSES_CONFIG" && break
10153 done
10154 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10155
10156   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10157 fi
10158
10159         if test "$NCURSES_CONFIG" != none ; then
10160
10161 cf_fix_cppflags=no
10162 cf_new_cflags=
10163 cf_new_cppflags=
10164 cf_new_extra_cppflags=
10165
10166 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10167 do
10168 case $cf_fix_cppflags in
10169 (no)
10170         case $cf_add_cflags in
10171         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10172                 case $cf_add_cflags in
10173                 (-D*)
10174                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10175
10176                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10177                                 && test -z "${cf_tst_cflags}" \
10178                                 && cf_fix_cppflags=yes
10179
10180                         if test $cf_fix_cppflags = yes ; then
10181
10182         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10183         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10184
10185                                 continue
10186                         elif test "${cf_tst_cflags}" = "\"'" ; then
10187
10188         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10189         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10190
10191                                 continue
10192                         fi
10193                         ;;
10194                 esac
10195                 case "$CPPFLAGS" in
10196                 (*$cf_add_cflags)
10197                         ;;
10198                 (*)
10199                         case $cf_add_cflags in
10200                         (-D*)
10201                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10202
10203 CPPFLAGS=`echo "$CPPFLAGS" | \
10204         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10205                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10206
10207                                 ;;
10208                         esac
10209
10210         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10211         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10212
10213                         ;;
10214                 esac
10215                 ;;
10216         (*)
10217
10218         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10219         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10220
10221                 ;;
10222         esac
10223         ;;
10224 (yes)
10225
10226         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10227         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10228
10229         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10230
10231         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10232                 && test -z "${cf_tst_cflags}" \
10233                 && cf_fix_cppflags=no
10234         ;;
10235 esac
10236 done
10237
10238 if test -n "$cf_new_cflags" ; then
10239
10240         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10241         CFLAGS="${CFLAGS}$cf_new_cflags"
10242
10243 fi
10244
10245 if test -n "$cf_new_cppflags" ; then
10246
10247         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10248         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10249
10250 fi
10251
10252 if test -n "$cf_new_extra_cppflags" ; then
10253
10254         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10255         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10256
10257 fi
10258
10259 cf_add_libs="$LIBS"
10260 # reverse order
10261 cf_add_0lib=
10262 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10263 # filter duplicates
10264 for cf_add_1lib in $cf_add_0lib; do
10265         for cf_add_2lib in $cf_add_libs; do
10266                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10267                         cf_add_1lib=
10268                         break
10269                 fi
10270         done
10271         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10272 done
10273 LIBS="$cf_add_libs"
10274
10275                 # even with config script, some packages use no-override for curses.h
10276
10277 echo "$as_me:10277: checking if we have identified curses headers" >&5
10278 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10279 if test "${cf_cv_ncurses_header+set}" = set; then
10280   echo $ECHO_N "(cached) $ECHO_C" >&6
10281 else
10282
10283 cf_cv_ncurses_header=none
10284 for cf_header in \
10285         ncurses.h $cf_cv_screen/ncurses.h \
10286         curses.h $cf_cv_screen/curses.h
10287 do
10288 cat >conftest.$ac_ext <<_ACEOF
10289 #line 10289 "configure"
10290 #include "confdefs.h"
10291 #include <${cf_header}>
10292 int
10293 main (void)
10294 {
10295 initscr(); tgoto("?", 0,0)
10296   ;
10297   return 0;
10298 }
10299 _ACEOF
10300 rm -f conftest.$ac_objext
10301 if { (eval echo "$as_me:10301: \"$ac_compile\"") >&5
10302   (eval $ac_compile) 2>&5
10303   ac_status=$?
10304   echo "$as_me:10304: \$? = $ac_status" >&5
10305   (exit $ac_status); } &&
10306          { ac_try='test -s conftest.$ac_objext'
10307   { (eval echo "$as_me:10307: \"$ac_try\"") >&5
10308   (eval $ac_try) 2>&5
10309   ac_status=$?
10310   echo "$as_me:10310: \$? = $ac_status" >&5
10311   (exit $ac_status); }; }; then
10312   cf_cv_ncurses_header=$cf_header; break
10313 else
10314   echo "$as_me: failed program was:" >&5
10315 cat conftest.$ac_ext >&5
10316 fi
10317 rm -f conftest.$ac_objext conftest.$ac_ext
10318 done
10319
10320 fi
10321 echo "$as_me:10321: result: $cf_cv_ncurses_header" >&5
10322 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10323
10324 if test "$cf_cv_ncurses_header" = none ; then
10325         { { echo "$as_me:10325: error: No curses header-files found" >&5
10326 echo "$as_me: error: No curses header-files found" >&2;}
10327    { (exit 1); exit 1; }; }
10328 fi
10329
10330 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10331
10332 for ac_header in $cf_cv_ncurses_header
10333 do
10334 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10335 echo "$as_me:10335: checking for $ac_header" >&5
10336 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10337 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10338   echo $ECHO_N "(cached) $ECHO_C" >&6
10339 else
10340   cat >conftest.$ac_ext <<_ACEOF
10341 #line 10341 "configure"
10342 #include "confdefs.h"
10343 #include <$ac_header>
10344 _ACEOF
10345 if { (eval echo "$as_me:10345: \"$ac_cpp conftest.$ac_ext\"") >&5
10346   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10347   ac_status=$?
10348   egrep -v '^ *\+' conftest.er1 >conftest.err
10349   rm -f conftest.er1
10350   cat conftest.err >&5
10351   echo "$as_me:10351: \$? = $ac_status" >&5
10352   (exit $ac_status); } >/dev/null; then
10353   if test -s conftest.err; then
10354     ac_cpp_err=$ac_c_preproc_warn_flag
10355   else
10356     ac_cpp_err=
10357   fi
10358 else
10359   ac_cpp_err=yes
10360 fi
10361 if test -z "$ac_cpp_err"; then
10362   eval "$as_ac_Header=yes"
10363 else
10364   echo "$as_me: failed program was:" >&5
10365   cat conftest.$ac_ext >&5
10366   eval "$as_ac_Header=no"
10367 fi
10368 rm -f conftest.err conftest.$ac_ext
10369 fi
10370 echo "$as_me:10370: result: `eval echo '${'$as_ac_Header'}'`" >&5
10371 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10372 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10373   cat >>confdefs.h <<EOF
10374 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10375 EOF
10376
10377 fi
10378 done
10379
10380 cat >>confdefs.h <<\EOF
10381 #define NCURSES 1
10382 EOF
10383
10384 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10385
10386                 cat >>confdefs.h <<EOF
10387 #define $cf_nculib_ROOT 1
10388 EOF
10389
10390                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
10391
10392         else
10393
10394 cf_ncuhdr_root=$cf_cv_screen
10395
10396 test -n "$cf_cv_curses_dir" && \
10397 test "$cf_cv_curses_dir" != "no" && { \
10398
10399 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10400   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10401   do
10402         while test $cf_add_incdir != /usr/include
10403         do
10404           if test -d $cf_add_incdir
10405           then
10406                 cf_have_incdir=no
10407                 if test -n "$CFLAGS$CPPFLAGS" ; then
10408                   # a loop is needed to ensure we can add subdirs of existing dirs
10409                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10410                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10411                           cf_have_incdir=yes; break
10412                         fi
10413                   done
10414                 fi
10415
10416                 if test "$cf_have_incdir" = no ; then
10417                   if test "$cf_add_incdir" = /usr/local/include ; then
10418                         if test "$GCC" = yes
10419                         then
10420                           cf_save_CPPFLAGS=$CPPFLAGS
10421
10422         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10423         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10424
10425                           cat >conftest.$ac_ext <<_ACEOF
10426 #line 10426 "configure"
10427 #include "confdefs.h"
10428 #include <stdio.h>
10429 int
10430 main (void)
10431 {
10432 printf("Hello")
10433   ;
10434   return 0;
10435 }
10436 _ACEOF
10437 rm -f conftest.$ac_objext
10438 if { (eval echo "$as_me:10438: \"$ac_compile\"") >&5
10439   (eval $ac_compile) 2>&5
10440   ac_status=$?
10441   echo "$as_me:10441: \$? = $ac_status" >&5
10442   (exit $ac_status); } &&
10443          { ac_try='test -s conftest.$ac_objext'
10444   { (eval echo "$as_me:10444: \"$ac_try\"") >&5
10445   (eval $ac_try) 2>&5
10446   ac_status=$?
10447   echo "$as_me:10447: \$? = $ac_status" >&5
10448   (exit $ac_status); }; }; then
10449   :
10450 else
10451   echo "$as_me: failed program was:" >&5
10452 cat conftest.$ac_ext >&5
10453 cf_have_incdir=yes
10454 fi
10455 rm -f conftest.$ac_objext conftest.$ac_ext
10456                           CPPFLAGS=$cf_save_CPPFLAGS
10457                         fi
10458                   fi
10459                 fi
10460
10461                 if test "$cf_have_incdir" = no ; then
10462                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10463
10464 echo "${as_me:-configure}:10464: testing adding $cf_add_incdir to include-path ..." 1>&5
10465
10466                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10467
10468                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10469                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10470                   cf_add_incdir="$cf_top_incdir"
10471                 else
10472                   break
10473                 fi
10474           else
10475                 break
10476           fi
10477         done
10478   done
10479 fi
10480
10481 }
10482
10483 echo "$as_me:10483: checking for $cf_ncuhdr_root header in include-path" >&5
10484 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10485 if test "${cf_cv_ncurses_h+set}" = set; then
10486   echo $ECHO_N "(cached) $ECHO_C" >&6
10487 else
10488
10489         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10490         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
10491         for cf_header in $cf_header_list
10492         do
10493
10494         cat >conftest.$ac_ext <<_ACEOF
10495 #line 10495 "configure"
10496 #include "confdefs.h"
10497
10498 #include <$cf_header>
10499 int
10500 main (void)
10501 {
10502
10503 #ifdef NCURSES_VERSION
10504
10505 printf("%s\n", NCURSES_VERSION);
10506 #else
10507 #ifdef __NCURSES_H
10508 printf("old\n");
10509 #else
10510         make an error
10511 #endif
10512 #endif
10513
10514   ;
10515   return 0;
10516 }
10517 _ACEOF
10518 rm -f conftest.$ac_objext
10519 if { (eval echo "$as_me:10519: \"$ac_compile\"") >&5
10520   (eval $ac_compile) 2>&5
10521   ac_status=$?
10522   echo "$as_me:10522: \$? = $ac_status" >&5
10523   (exit $ac_status); } &&
10524          { ac_try='test -s conftest.$ac_objext'
10525   { (eval echo "$as_me:10525: \"$ac_try\"") >&5
10526   (eval $ac_try) 2>&5
10527   ac_status=$?
10528   echo "$as_me:10528: \$? = $ac_status" >&5
10529   (exit $ac_status); }; }; then
10530   cf_cv_ncurses_h=$cf_header
10531
10532 else
10533   echo "$as_me: failed program was:" >&5
10534 cat conftest.$ac_ext >&5
10535 cf_cv_ncurses_h=no
10536 fi
10537 rm -f conftest.$ac_objext conftest.$ac_ext
10538
10539                 test "$cf_cv_ncurses_h" != no && break
10540         done
10541
10542 fi
10543 echo "$as_me:10543: result: $cf_cv_ncurses_h" >&5
10544 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10545
10546 if test "$cf_cv_ncurses_h" != no ; then
10547         cf_cv_ncurses_header=$cf_cv_ncurses_h
10548 else
10549
10550 echo "$as_me:10550: checking for $cf_ncuhdr_root include-path" >&5
10551 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10552 if test "${cf_cv_ncurses_h2+set}" = set; then
10553   echo $ECHO_N "(cached) $ECHO_C" >&6
10554 else
10555
10556         test -n "$verbose" && echo
10557
10558 cf_search=
10559
10560 # collect the current set of include-directories from compiler flags
10561 cf_header_path_list=""
10562 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10563         for cf_header_path in $CPPFLAGS $CFLAGS
10564         do
10565                 case $cf_header_path in
10566                 (-I*)
10567                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10568
10569 test "x$cf_header_path" != "xNONE" && \
10570 test -d "$cf_header_path" && \
10571  {
10572         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10573         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10574         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10575         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10576         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10577         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"
10578 }
10579
10580                         cf_header_path_list="$cf_header_path_list $cf_search"
10581                         ;;
10582                 esac
10583         done
10584 fi
10585
10586 # add the variations for the package we are looking for
10587
10588 cf_search=
10589
10590 test "x$prefix" != "xNONE" && \
10591 test -d "$prefix" && \
10592  {
10593         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10594         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10595         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10596         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10597         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10598         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10599 }
10600
10601 for cf_subdir_prefix in \
10602         /usr \
10603         /usr/local \
10604         /usr/pkg \
10605         /opt \
10606         /opt/local \
10607         $HOME
10608 do
10609
10610 test "x$cf_subdir_prefix" != "x$prefix" && \
10611 test -d "$cf_subdir_prefix" && \
10612 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10613         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10614         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10615         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10616         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10617         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10618         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"
10619 }
10620
10621 done
10622
10623 test "$includedir" != NONE && \
10624 test "$includedir" != "/usr/include" && \
10625 test -d "$includedir" && {
10626         test -d $includedir &&    cf_search="$cf_search $includedir"
10627         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10628 }
10629
10630 test "$oldincludedir" != NONE && \
10631 test "$oldincludedir" != "/usr/include" && \
10632 test -d "$oldincludedir" && {
10633         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10634         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10635 }
10636
10637 cf_search="$cf_search $cf_header_path_list"
10638
10639         test -n "$verbose" && echo search path $cf_search
10640         cf_save2_CPPFLAGS="$CPPFLAGS"
10641         for cf_incdir in $cf_search
10642         do
10643
10644 if test -n "$cf_incdir" ; then
10645   for cf_add_incdir in $cf_incdir
10646   do
10647         while test $cf_add_incdir != /usr/include
10648         do
10649           if test -d $cf_add_incdir
10650           then
10651                 cf_have_incdir=no
10652                 if test -n "$CFLAGS$CPPFLAGS" ; then
10653                   # a loop is needed to ensure we can add subdirs of existing dirs
10654                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10655                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10656                           cf_have_incdir=yes; break
10657                         fi
10658                   done
10659                 fi
10660
10661                 if test "$cf_have_incdir" = no ; then
10662                   if test "$cf_add_incdir" = /usr/local/include ; then
10663                         if test "$GCC" = yes
10664                         then
10665                           cf_save_CPPFLAGS=$CPPFLAGS
10666
10667         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10668         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10669
10670                           cat >conftest.$ac_ext <<_ACEOF
10671 #line 10671 "configure"
10672 #include "confdefs.h"
10673 #include <stdio.h>
10674 int
10675 main (void)
10676 {
10677 printf("Hello")
10678   ;
10679   return 0;
10680 }
10681 _ACEOF
10682 rm -f conftest.$ac_objext
10683 if { (eval echo "$as_me:10683: \"$ac_compile\"") >&5
10684   (eval $ac_compile) 2>&5
10685   ac_status=$?
10686   echo "$as_me:10686: \$? = $ac_status" >&5
10687   (exit $ac_status); } &&
10688          { ac_try='test -s conftest.$ac_objext'
10689   { (eval echo "$as_me:10689: \"$ac_try\"") >&5
10690   (eval $ac_try) 2>&5
10691   ac_status=$?
10692   echo "$as_me:10692: \$? = $ac_status" >&5
10693   (exit $ac_status); }; }; then
10694   :
10695 else
10696   echo "$as_me: failed program was:" >&5
10697 cat conftest.$ac_ext >&5
10698 cf_have_incdir=yes
10699 fi
10700 rm -f conftest.$ac_objext conftest.$ac_ext
10701                           CPPFLAGS=$cf_save_CPPFLAGS
10702                         fi
10703                   fi
10704                 fi
10705
10706                 if test "$cf_have_incdir" = no ; then
10707                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10708
10709 echo "${as_me:-configure}:10709: testing adding $cf_add_incdir to include-path ..." 1>&5
10710
10711                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10712
10713                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10714                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10715                   cf_add_incdir="$cf_top_incdir"
10716                 else
10717                   break
10718                 fi
10719           else
10720                 break
10721           fi
10722         done
10723   done
10724 fi
10725
10726                 for cf_header in \
10727                         ncurses.h \
10728                         curses.h
10729                 do
10730
10731         cat >conftest.$ac_ext <<_ACEOF
10732 #line 10732 "configure"
10733 #include "confdefs.h"
10734
10735 #include <$cf_header>
10736 int
10737 main (void)
10738 {
10739
10740 #ifdef NCURSES_VERSION
10741
10742 printf("%s\n", NCURSES_VERSION);
10743 #else
10744 #ifdef __NCURSES_H
10745 printf("old\n");
10746 #else
10747         make an error
10748 #endif
10749 #endif
10750
10751   ;
10752   return 0;
10753 }
10754 _ACEOF
10755 rm -f conftest.$ac_objext
10756 if { (eval echo "$as_me:10756: \"$ac_compile\"") >&5
10757   (eval $ac_compile) 2>&5
10758   ac_status=$?
10759   echo "$as_me:10759: \$? = $ac_status" >&5
10760   (exit $ac_status); } &&
10761          { ac_try='test -s conftest.$ac_objext'
10762   { (eval echo "$as_me:10762: \"$ac_try\"") >&5
10763   (eval $ac_try) 2>&5
10764   ac_status=$?
10765   echo "$as_me:10765: \$? = $ac_status" >&5
10766   (exit $ac_status); }; }; then
10767   cf_cv_ncurses_h2=$cf_header
10768
10769 else
10770   echo "$as_me: failed program was:" >&5
10771 cat conftest.$ac_ext >&5
10772 cf_cv_ncurses_h2=no
10773 fi
10774 rm -f conftest.$ac_objext conftest.$ac_ext
10775
10776                         if test "$cf_cv_ncurses_h2" != no ; then
10777                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10778                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10779                                 break
10780                         fi
10781                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10782                 done
10783                 CPPFLAGS="$cf_save2_CPPFLAGS"
10784                 test "$cf_cv_ncurses_h2" != no && break
10785         done
10786         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10786: error: not found" >&5
10787 echo "$as_me: error: not found" >&2;}
10788    { (exit 1); exit 1; }; }
10789
10790 fi
10791 echo "$as_me:10791: result: $cf_cv_ncurses_h2" >&5
10792 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10793
10794         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10795         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10796         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10797                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10798         fi
10799
10800 if test -n "$cf_1st_incdir" ; then
10801   for cf_add_incdir in $cf_1st_incdir
10802   do
10803         while test $cf_add_incdir != /usr/include
10804         do
10805           if test -d $cf_add_incdir
10806           then
10807                 cf_have_incdir=no
10808                 if test -n "$CFLAGS$CPPFLAGS" ; then
10809                   # a loop is needed to ensure we can add subdirs of existing dirs
10810                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10811                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10812                           cf_have_incdir=yes; break
10813                         fi
10814                   done
10815                 fi
10816
10817                 if test "$cf_have_incdir" = no ; then
10818                   if test "$cf_add_incdir" = /usr/local/include ; then
10819                         if test "$GCC" = yes
10820                         then
10821                           cf_save_CPPFLAGS=$CPPFLAGS
10822
10823         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10824         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10825
10826                           cat >conftest.$ac_ext <<_ACEOF
10827 #line 10827 "configure"
10828 #include "confdefs.h"
10829 #include <stdio.h>
10830 int
10831 main (void)
10832 {
10833 printf("Hello")
10834   ;
10835   return 0;
10836 }
10837 _ACEOF
10838 rm -f conftest.$ac_objext
10839 if { (eval echo "$as_me:10839: \"$ac_compile\"") >&5
10840   (eval $ac_compile) 2>&5
10841   ac_status=$?
10842   echo "$as_me:10842: \$? = $ac_status" >&5
10843   (exit $ac_status); } &&
10844          { ac_try='test -s conftest.$ac_objext'
10845   { (eval echo "$as_me:10845: \"$ac_try\"") >&5
10846   (eval $ac_try) 2>&5
10847   ac_status=$?
10848   echo "$as_me:10848: \$? = $ac_status" >&5
10849   (exit $ac_status); }; }; then
10850   :
10851 else
10852   echo "$as_me: failed program was:" >&5
10853 cat conftest.$ac_ext >&5
10854 cf_have_incdir=yes
10855 fi
10856 rm -f conftest.$ac_objext conftest.$ac_ext
10857                           CPPFLAGS=$cf_save_CPPFLAGS
10858                         fi
10859                   fi
10860                 fi
10861
10862                 if test "$cf_have_incdir" = no ; then
10863                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10864
10865 echo "${as_me:-configure}:10865: testing adding $cf_add_incdir to include-path ..." 1>&5
10866
10867                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10868
10869                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10870                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10871                   cf_add_incdir="$cf_top_incdir"
10872                 else
10873                   break
10874                 fi
10875           else
10876                 break
10877           fi
10878         done
10879   done
10880 fi
10881
10882 fi
10883
10884 # Set definitions to allow ifdef'ing for ncurses.h
10885
10886 case $cf_cv_ncurses_header in
10887 (*ncurses.h)
10888
10889 cat >>confdefs.h <<\EOF
10890 #define HAVE_NCURSES_H 1
10891 EOF
10892
10893         ;;
10894 esac
10895
10896 case $cf_cv_ncurses_header in
10897 (ncurses/curses.h|ncurses/ncurses.h)
10898
10899 cat >>confdefs.h <<\EOF
10900 #define HAVE_NCURSES_NCURSES_H 1
10901 EOF
10902
10903         ;;
10904 (ncursesw/curses.h|ncursesw/ncurses.h)
10905
10906 cat >>confdefs.h <<\EOF
10907 #define HAVE_NCURSESW_NCURSES_H 1
10908 EOF
10909
10910         ;;
10911 esac
10912
10913 echo "$as_me:10913: checking for terminfo header" >&5
10914 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10915 if test "${cf_cv_term_header+set}" = set; then
10916   echo $ECHO_N "(cached) $ECHO_C" >&6
10917 else
10918
10919 case ${cf_cv_ncurses_header} in
10920 (*/ncurses.h|*/ncursesw.h)
10921         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10922         ;;
10923 (*)
10924         cf_term_header=term.h
10925         ;;
10926 esac
10927
10928 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10929 do
10930 cat >conftest.$ac_ext <<_ACEOF
10931 #line 10931 "configure"
10932 #include "confdefs.h"
10933 #include <stdio.h>
10934 #include <${cf_cv_ncurses_header:-curses.h}>
10935 #include <$cf_test>
10936
10937 int
10938 main (void)
10939 {
10940 int x = auto_left_margin; (void)x
10941   ;
10942   return 0;
10943 }
10944 _ACEOF
10945 rm -f conftest.$ac_objext
10946 if { (eval echo "$as_me:10946: \"$ac_compile\"") >&5
10947   (eval $ac_compile) 2>&5
10948   ac_status=$?
10949   echo "$as_me:10949: \$? = $ac_status" >&5
10950   (exit $ac_status); } &&
10951          { ac_try='test -s conftest.$ac_objext'
10952   { (eval echo "$as_me:10952: \"$ac_try\"") >&5
10953   (eval $ac_try) 2>&5
10954   ac_status=$?
10955   echo "$as_me:10955: \$? = $ac_status" >&5
10956   (exit $ac_status); }; }; then
10957
10958         cf_cv_term_header="$cf_test"
10959 else
10960   echo "$as_me: failed program was:" >&5
10961 cat conftest.$ac_ext >&5
10962
10963         cf_cv_term_header=unknown
10964
10965 fi
10966 rm -f conftest.$ac_objext conftest.$ac_ext
10967         test "$cf_cv_term_header" != unknown && break
10968 done
10969
10970 fi
10971 echo "$as_me:10971: result: $cf_cv_term_header" >&5
10972 echo "${ECHO_T}$cf_cv_term_header" >&6
10973
10974 # Set definitions to allow ifdef'ing to accommodate subdirectories
10975
10976 case $cf_cv_term_header in
10977 (*term.h)
10978
10979 cat >>confdefs.h <<\EOF
10980 #define HAVE_TERM_H 1
10981 EOF
10982
10983         ;;
10984 esac
10985
10986 case $cf_cv_term_header in
10987 (ncurses/term.h)
10988
10989 cat >>confdefs.h <<\EOF
10990 #define HAVE_NCURSES_TERM_H 1
10991 EOF
10992
10993         ;;
10994 (ncursesw/term.h)
10995
10996 cat >>confdefs.h <<\EOF
10997 #define HAVE_NCURSESW_TERM_H 1
10998 EOF
10999
11000         ;;
11001 esac
11002
11003 # some applications need this, but should check for NCURSES_VERSION
11004
11005 cat >>confdefs.h <<\EOF
11006 #define NCURSES 1
11007 EOF
11008
11009 echo "$as_me:11009: checking for ncurses version" >&5
11010 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11011 if test "${cf_cv_ncurses_version+set}" = set; then
11012   echo $ECHO_N "(cached) $ECHO_C" >&6
11013 else
11014
11015         cf_cv_ncurses_version=no
11016         cf_tempfile=out$$
11017         rm -f $cf_tempfile
11018         if test "$cross_compiling" = yes; then
11019
11020         # This will not work if the preprocessor splits the line after the
11021         # Autoconf token.  The 'unproto' program does that.
11022         cat > conftest.$ac_ext <<EOF
11023 #include <${cf_cv_ncurses_header:-curses.h}>
11024 #undef Autoconf
11025 #ifdef NCURSES_VERSION
11026 Autoconf NCURSES_VERSION
11027 #else
11028 #ifdef __NCURSES_H
11029 Autoconf "old"
11030 #endif
11031 ;
11032 #endif
11033 EOF
11034         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11035         { (eval echo "$as_me:11035: \"$cf_try\"") >&5
11036   (eval $cf_try) 2>&5
11037   ac_status=$?
11038   echo "$as_me:11038: \$? = $ac_status" >&5
11039   (exit $ac_status); }
11040         if test -f conftest.out ; then
11041                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
11042                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11043                 rm -f conftest.out
11044         fi
11045
11046 else
11047   cat >conftest.$ac_ext <<_ACEOF
11048 #line 11048 "configure"
11049 #include "confdefs.h"
11050
11051 #include <${cf_cv_ncurses_header:-curses.h}>
11052 #include <stdio.h>
11053 int main(void)
11054 {
11055         FILE *fp = fopen("$cf_tempfile", "w");
11056 #ifdef NCURSES_VERSION
11057 # ifdef NCURSES_VERSION_PATCH
11058         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11059 # else
11060         fprintf(fp, "%s\n", NCURSES_VERSION);
11061 # endif
11062 #else
11063 # ifdef __NCURSES_H
11064         fprintf(fp, "old\n");
11065 # else
11066         make an error
11067 # endif
11068 #endif
11069         ${cf_cv_main_return:-return}(0);
11070 }
11071 _ACEOF
11072 rm -f conftest$ac_exeext
11073 if { (eval echo "$as_me:11073: \"$ac_link\"") >&5
11074   (eval $ac_link) 2>&5
11075   ac_status=$?
11076   echo "$as_me:11076: \$? = $ac_status" >&5
11077   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11078   { (eval echo "$as_me:11078: \"$ac_try\"") >&5
11079   (eval $ac_try) 2>&5
11080   ac_status=$?
11081   echo "$as_me:11081: \$? = $ac_status" >&5
11082   (exit $ac_status); }; }; then
11083
11084         cf_cv_ncurses_version=`cat $cf_tempfile`
11085 else
11086   echo "$as_me: program exited with status $ac_status" >&5
11087 echo "$as_me: failed program was:" >&5
11088 cat conftest.$ac_ext >&5
11089 fi
11090 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11091 fi
11092         rm -f $cf_tempfile
11093
11094 fi
11095 echo "$as_me:11095: result: $cf_cv_ncurses_version" >&5
11096 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11097 test "$cf_cv_ncurses_version" = no ||
11098 cat >>confdefs.h <<\EOF
11099 #define NCURSES 1
11100 EOF
11101
11102 cf_nculib_root=$cf_cv_screen
11103         # This works, except for the special case where we find gpm, but
11104         # ncurses is in a nonstandard location via $LIBS, and we really want
11105         # to link gpm.
11106 cf_ncurses_LIBS=""
11107 cf_ncurses_SAVE="$LIBS"
11108 echo "$as_me:11108: checking for Gpm_Open in -lgpm" >&5
11109 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11110 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11111   echo $ECHO_N "(cached) $ECHO_C" >&6
11112 else
11113   ac_check_lib_save_LIBS=$LIBS
11114 LIBS="-lgpm  $LIBS"
11115 cat >conftest.$ac_ext <<_ACEOF
11116 #line 11116 "configure"
11117 #include "confdefs.h"
11118
11119 /* Override any gcc2 internal prototype to avoid an error.  */
11120 #ifdef __cplusplus
11121 extern "C"
11122 #endif
11123 /* We use char because int might match the return type of a gcc2
11124    builtin and then its argument prototype would still apply.  */
11125 char Gpm_Open ();
11126 int
11127 main (void)
11128 {
11129 Gpm_Open ();
11130   ;
11131   return 0;
11132 }
11133 _ACEOF
11134 rm -f conftest.$ac_objext conftest$ac_exeext
11135 if { (eval echo "$as_me:11135: \"$ac_link\"") >&5
11136   (eval $ac_link) 2>&5
11137   ac_status=$?
11138   echo "$as_me:11138: \$? = $ac_status" >&5
11139   (exit $ac_status); } &&
11140          { ac_try='test -s conftest$ac_exeext'
11141   { (eval echo "$as_me:11141: \"$ac_try\"") >&5
11142   (eval $ac_try) 2>&5
11143   ac_status=$?
11144   echo "$as_me:11144: \$? = $ac_status" >&5
11145   (exit $ac_status); }; }; then
11146   ac_cv_lib_gpm_Gpm_Open=yes
11147 else
11148   echo "$as_me: failed program was:" >&5
11149 cat conftest.$ac_ext >&5
11150 ac_cv_lib_gpm_Gpm_Open=no
11151 fi
11152 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11153 LIBS=$ac_check_lib_save_LIBS
11154 fi
11155 echo "$as_me:11155: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11156 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11157 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
11158   echo "$as_me:11158: checking for initscr in -lgpm" >&5
11159 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11160 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11161   echo $ECHO_N "(cached) $ECHO_C" >&6
11162 else
11163   ac_check_lib_save_LIBS=$LIBS
11164 LIBS="-lgpm  $LIBS"
11165 cat >conftest.$ac_ext <<_ACEOF
11166 #line 11166 "configure"
11167 #include "confdefs.h"
11168
11169 /* Override any gcc2 internal prototype to avoid an error.  */
11170 #ifdef __cplusplus
11171 extern "C"
11172 #endif
11173 /* We use char because int might match the return type of a gcc2
11174    builtin and then its argument prototype would still apply.  */
11175 char initscr ();
11176 int
11177 main (void)
11178 {
11179 initscr ();
11180   ;
11181   return 0;
11182 }
11183 _ACEOF
11184 rm -f conftest.$ac_objext conftest$ac_exeext
11185 if { (eval echo "$as_me:11185: \"$ac_link\"") >&5
11186   (eval $ac_link) 2>&5
11187   ac_status=$?
11188   echo "$as_me:11188: \$? = $ac_status" >&5
11189   (exit $ac_status); } &&
11190          { ac_try='test -s conftest$ac_exeext'
11191   { (eval echo "$as_me:11191: \"$ac_try\"") >&5
11192   (eval $ac_try) 2>&5
11193   ac_status=$?
11194   echo "$as_me:11194: \$? = $ac_status" >&5
11195   (exit $ac_status); }; }; then
11196   ac_cv_lib_gpm_initscr=yes
11197 else
11198   echo "$as_me: failed program was:" >&5
11199 cat conftest.$ac_ext >&5
11200 ac_cv_lib_gpm_initscr=no
11201 fi
11202 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11203 LIBS=$ac_check_lib_save_LIBS
11204 fi
11205 echo "$as_me:11205: result: $ac_cv_lib_gpm_initscr" >&5
11206 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11207 if test $ac_cv_lib_gpm_initscr = yes; then
11208   LIBS="$cf_ncurses_SAVE"
11209 else
11210   cf_ncurses_LIBS="-lgpm"
11211 fi
11212
11213 fi
11214
11215 case $host_os in
11216 (freebsd*)
11217         # This is only necessary if you are linking against an obsolete
11218         # version of ncurses (but it should do no harm, since it's static).
11219         if test "$cf_nculib_root" = ncurses ; then
11220                 echo "$as_me:11220: checking for tgoto in -lmytinfo" >&5
11221 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11222 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11223   echo $ECHO_N "(cached) $ECHO_C" >&6
11224 else
11225   ac_check_lib_save_LIBS=$LIBS
11226 LIBS="-lmytinfo  $LIBS"
11227 cat >conftest.$ac_ext <<_ACEOF
11228 #line 11228 "configure"
11229 #include "confdefs.h"
11230
11231 /* Override any gcc2 internal prototype to avoid an error.  */
11232 #ifdef __cplusplus
11233 extern "C"
11234 #endif
11235 /* We use char because int might match the return type of a gcc2
11236    builtin and then its argument prototype would still apply.  */
11237 char tgoto ();
11238 int
11239 main (void)
11240 {
11241 tgoto ();
11242   ;
11243   return 0;
11244 }
11245 _ACEOF
11246 rm -f conftest.$ac_objext conftest$ac_exeext
11247 if { (eval echo "$as_me:11247: \"$ac_link\"") >&5
11248   (eval $ac_link) 2>&5
11249   ac_status=$?
11250   echo "$as_me:11250: \$? = $ac_status" >&5
11251   (exit $ac_status); } &&
11252          { ac_try='test -s conftest$ac_exeext'
11253   { (eval echo "$as_me:11253: \"$ac_try\"") >&5
11254   (eval $ac_try) 2>&5
11255   ac_status=$?
11256   echo "$as_me:11256: \$? = $ac_status" >&5
11257   (exit $ac_status); }; }; then
11258   ac_cv_lib_mytinfo_tgoto=yes
11259 else
11260   echo "$as_me: failed program was:" >&5
11261 cat conftest.$ac_ext >&5
11262 ac_cv_lib_mytinfo_tgoto=no
11263 fi
11264 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11265 LIBS=$ac_check_lib_save_LIBS
11266 fi
11267 echo "$as_me:11267: result: $ac_cv_lib_mytinfo_tgoto" >&5
11268 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11269 if test $ac_cv_lib_mytinfo_tgoto = yes; then
11270   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11271 fi
11272
11273         fi
11274         ;;
11275 esac
11276
11277 cf_add_libs="$LIBS"
11278 # reverse order
11279 cf_add_0lib=
11280 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11281 # filter duplicates
11282 for cf_add_1lib in $cf_add_0lib; do
11283         for cf_add_2lib in $cf_add_libs; do
11284                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11285                         cf_add_1lib=
11286                         break
11287                 fi
11288         done
11289         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11290 done
11291 LIBS="$cf_add_libs"
11292
11293 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
11294 then
11295
11296 cf_add_libs="$LIBS"
11297 # reverse order
11298 cf_add_0lib=
11299 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11300 # filter duplicates
11301 for cf_add_1lib in $cf_add_0lib; do
11302         for cf_add_2lib in $cf_add_libs; do
11303                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11304                         cf_add_1lib=
11305                         break
11306                 fi
11307         done
11308         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11309 done
11310 LIBS="$cf_add_libs"
11311
11312 else
11313
11314         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
11315         cf_libdir=""
11316         echo "$as_me:11316: checking for initscr" >&5
11317 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11318 if test "${ac_cv_func_initscr+set}" = set; then
11319   echo $ECHO_N "(cached) $ECHO_C" >&6
11320 else
11321   cat >conftest.$ac_ext <<_ACEOF
11322 #line 11322 "configure"
11323 #include "confdefs.h"
11324 #define initscr autoconf_temporary
11325 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11326 #undef initscr
11327
11328 #ifdef __cplusplus
11329 extern "C"
11330 #endif
11331
11332 /* We use char because int might match the return type of a gcc2
11333    builtin and then its argument prototype would still apply.  */
11334 char initscr (void);
11335
11336 int
11337 main (void)
11338 {
11339
11340 /* The GNU C library defines stubs for functions which it implements
11341     to always fail with ENOSYS.  Some functions are actually named
11342     something starting with __ and the normal name is an alias.  */
11343 #if defined (__stub_initscr) || defined (__stub___initscr)
11344 #error found stub for initscr
11345 #endif
11346
11347         return initscr ();
11348   ;
11349   return 0;
11350 }
11351 _ACEOF
11352 rm -f conftest.$ac_objext conftest$ac_exeext
11353 if { (eval echo "$as_me:11353: \"$ac_link\"") >&5
11354   (eval $ac_link) 2>&5
11355   ac_status=$?
11356   echo "$as_me:11356: \$? = $ac_status" >&5
11357   (exit $ac_status); } &&
11358          { ac_try='test -s conftest$ac_exeext'
11359   { (eval echo "$as_me:11359: \"$ac_try\"") >&5
11360   (eval $ac_try) 2>&5
11361   ac_status=$?
11362   echo "$as_me:11362: \$? = $ac_status" >&5
11363   (exit $ac_status); }; }; then
11364   ac_cv_func_initscr=yes
11365 else
11366   echo "$as_me: failed program was:" >&5
11367 cat conftest.$ac_ext >&5
11368 ac_cv_func_initscr=no
11369 fi
11370 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11371 fi
11372 echo "$as_me:11372: result: $ac_cv_func_initscr" >&5
11373 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11374 if test $ac_cv_func_initscr = yes; then
11375   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11376 else
11377
11378                 cf_save_LIBS="$LIBS"
11379                 echo "$as_me:11379: checking for initscr in -l$cf_nculib_root" >&5
11380 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11381                 LIBS="-l$cf_nculib_root $LIBS"
11382                 cat >conftest.$ac_ext <<_ACEOF
11383 #line 11383 "configure"
11384 #include "confdefs.h"
11385 #include <${cf_cv_ncurses_header:-curses.h}>
11386 int
11387 main (void)
11388 {
11389 initscr()
11390   ;
11391   return 0;
11392 }
11393 _ACEOF
11394 rm -f conftest.$ac_objext conftest$ac_exeext
11395 if { (eval echo "$as_me:11395: \"$ac_link\"") >&5
11396   (eval $ac_link) 2>&5
11397   ac_status=$?
11398   echo "$as_me:11398: \$? = $ac_status" >&5
11399   (exit $ac_status); } &&
11400          { ac_try='test -s conftest$ac_exeext'
11401   { (eval echo "$as_me:11401: \"$ac_try\"") >&5
11402   (eval $ac_try) 2>&5
11403   ac_status=$?
11404   echo "$as_me:11404: \$? = $ac_status" >&5
11405   (exit $ac_status); }; }; then
11406   echo "$as_me:11406: result: yes" >&5
11407 echo "${ECHO_T}yes" >&6
11408                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11409
11410 else
11411   echo "$as_me: failed program was:" >&5
11412 cat conftest.$ac_ext >&5
11413 echo "$as_me:11413: result: no" >&5
11414 echo "${ECHO_T}no" >&6
11415
11416 cf_search=
11417 cf_library_path_list=""
11418 if test -n "${LDFLAGS}${LIBS}" ; then
11419         for cf_library_path in $LDFLAGS $LIBS
11420         do
11421                 case $cf_library_path in
11422                 (-L*)
11423                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11424
11425 test "x$cf_library_path" != "xNONE" && \
11426 test -d "$cf_library_path" && \
11427  {
11428         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11429         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
11430         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11431         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11432         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11433         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"
11434 }
11435
11436                         cf_library_path_list="$cf_library_path_list $cf_search"
11437                         ;;
11438                 esac
11439         done
11440 fi
11441
11442 cf_search=
11443
11444 test "x$prefix" != "xNONE" && \
11445 test -d "$prefix" && \
11446  {
11447         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11448         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
11449         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11450         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11451         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11452         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11453 }
11454
11455 for cf_subdir_prefix in \
11456         /usr \
11457         /usr/local \
11458         /usr/pkg \
11459         /opt \
11460         /opt/local \
11461         $HOME
11462 do
11463
11464 test "x$cf_subdir_prefix" != "x$prefix" && \
11465 test -d "$cf_subdir_prefix" && \
11466 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
11467         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11468         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11469         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11470         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11471         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11472         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"
11473 }
11474
11475 done
11476
11477 cf_search="$cf_library_path_list $cf_search"
11478
11479                         for cf_libdir in $cf_search
11480                         do
11481                                 echo "$as_me:11481: checking for -l$cf_nculib_root in $cf_libdir" >&5
11482 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11483                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11484                                 cat >conftest.$ac_ext <<_ACEOF
11485 #line 11485 "configure"
11486 #include "confdefs.h"
11487 #include <${cf_cv_ncurses_header:-curses.h}>
11488 int
11489 main (void)
11490 {
11491 initscr()
11492   ;
11493   return 0;
11494 }
11495 _ACEOF
11496 rm -f conftest.$ac_objext conftest$ac_exeext
11497 if { (eval echo "$as_me:11497: \"$ac_link\"") >&5
11498   (eval $ac_link) 2>&5
11499   ac_status=$?
11500   echo "$as_me:11500: \$? = $ac_status" >&5
11501   (exit $ac_status); } &&
11502          { ac_try='test -s conftest$ac_exeext'
11503   { (eval echo "$as_me:11503: \"$ac_try\"") >&5
11504   (eval $ac_try) 2>&5
11505   ac_status=$?
11506   echo "$as_me:11506: \$? = $ac_status" >&5
11507   (exit $ac_status); }; }; then
11508   echo "$as_me:11508: result: yes" >&5
11509 echo "${ECHO_T}yes" >&6
11510                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11511                                          break
11512 else
11513   echo "$as_me: failed program was:" >&5
11514 cat conftest.$ac_ext >&5
11515 echo "$as_me:11515: result: no" >&5
11516 echo "${ECHO_T}no" >&6
11517                                          LIBS="$cf_save_LIBS"
11518 fi
11519 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11520                         done
11521
11522 fi
11523 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11524
11525 fi
11526
11527 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11528
11529 if test $cf_found_library = no ; then
11530         { { echo "$as_me:11530: error: Cannot link $cf_nculib_root library" >&5
11531 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11532    { (exit 1); exit 1; }; }
11533 fi
11534
11535 fi
11536
11537 if test -n "$cf_ncurses_LIBS" ; then
11538         echo "$as_me:11538: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11539 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11540         cf_ncurses_SAVE="$LIBS"
11541         for p in $cf_ncurses_LIBS ; do
11542                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11543                 if test "$q" != "$LIBS" ; then
11544                         LIBS="$q"
11545                 fi
11546         done
11547         cat >conftest.$ac_ext <<_ACEOF
11548 #line 11548 "configure"
11549 #include "confdefs.h"
11550 #include <${cf_cv_ncurses_header:-curses.h}>
11551 int
11552 main (void)
11553 {
11554 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11555   ;
11556   return 0;
11557 }
11558 _ACEOF
11559 rm -f conftest.$ac_objext conftest$ac_exeext
11560 if { (eval echo "$as_me:11560: \"$ac_link\"") >&5
11561   (eval $ac_link) 2>&5
11562   ac_status=$?
11563   echo "$as_me:11563: \$? = $ac_status" >&5
11564   (exit $ac_status); } &&
11565          { ac_try='test -s conftest$ac_exeext'
11566   { (eval echo "$as_me:11566: \"$ac_try\"") >&5
11567   (eval $ac_try) 2>&5
11568   ac_status=$?
11569   echo "$as_me:11569: \$? = $ac_status" >&5
11570   (exit $ac_status); }; }; then
11571   echo "$as_me:11571: result: yes" >&5
11572 echo "${ECHO_T}yes" >&6
11573 else
11574   echo "$as_me: failed program was:" >&5
11575 cat conftest.$ac_ext >&5
11576 echo "$as_me:11576: result: no" >&5
11577 echo "${ECHO_T}no" >&6
11578                  LIBS="$cf_ncurses_SAVE"
11579 fi
11580 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11581 fi
11582
11583 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11584
11585 cat >>confdefs.h <<EOF
11586 #define $cf_nculib_ROOT 1
11587 EOF
11588
11589         fi
11590 else
11591         NCURSES_CONFIG=none
11592 fi
11593
11594         ;;
11595 (pdcurses)
11596         echo "$as_me:11596: checking for X" >&5
11597 echo $ECHO_N "checking for X... $ECHO_C" >&6
11598
11599 # Check whether --with-x or --without-x was given.
11600 if test "${with_x+set}" = set; then
11601   withval="$with_x"
11602
11603 fi;
11604 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11605 if test "x$with_x" = xno; then
11606   # The user explicitly disabled X.
11607   have_x=disabled
11608 else
11609   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11610     # Both variables are already set.
11611     have_x=yes
11612   else
11613     if test "${ac_cv_have_x+set}" = set; then
11614   echo $ECHO_N "(cached) $ECHO_C" >&6
11615 else
11616   # One or both of the vars are not set, and there is no cached value.
11617 ac_x_includes=no ac_x_libraries=no
11618 rm -fr conftest.dir
11619 if mkdir conftest.dir; then
11620   cd conftest.dir
11621   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11622   cat >Imakefile <<'EOF'
11623 acfindx:
11624         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11625 EOF
11626   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11627     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11628     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11629     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11630     for ac_extension in a so sl dylib dll; do
11631       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11632          test -f $ac_im_libdir/libX11.$ac_extension; then
11633         ac_im_usrlibdir=$ac_im_libdir; break
11634       fi
11635     done
11636     # Screen out bogus values from the imake configuration.  They are
11637     # bogus both because they are the default anyway, and because
11638     # using them would break gcc on systems where it needs fixed includes.
11639     case $ac_im_incroot in
11640         /usr/include) ;;
11641         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11642     esac
11643     case $ac_im_usrlibdir in
11644         /usr/lib | /lib) ;;
11645         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11646     esac
11647   fi
11648   cd ..
11649   rm -fr conftest.dir
11650 fi
11651
11652 # Standard set of common directories for X headers.
11653 # Check X11 before X11Rn because it is often a symlink to the current release.
11654 ac_x_header_dirs='
11655 /usr/X11/include
11656 /usr/X11R7/include
11657 /usr/X11R6/include
11658 /usr/X11R5/include
11659 /usr/X11R4/include
11660
11661 /opt/local/include
11662 /opt/X11/include
11663
11664 /usr/include/X11
11665 /usr/include/X11R7
11666 /usr/include/X11R6
11667 /usr/include/X11R5
11668 /usr/include/X11R4
11669
11670 /usr/local/X11/include
11671 /usr/local/X11R7/include
11672 /usr/local/X11R6/include
11673 /usr/local/X11R5/include
11674 /usr/local/X11R4/include
11675
11676 /usr/local/include/X11
11677 /usr/local/include/X11R7
11678 /usr/local/include/X11R6
11679 /usr/local/include/X11R5
11680 /usr/local/include/X11R4
11681
11682 /usr/X386/include
11683 /usr/x386/include
11684 /usr/XFree86/include/X11
11685
11686 /usr/include
11687 /usr/local/include
11688 /usr/unsupported/include
11689 /usr/athena/include
11690 /usr/local/x11r5/include
11691 /usr/lpp/Xamples/include
11692
11693 /usr/openwin/include
11694 /usr/openwin/share/include'
11695
11696 if test "$ac_x_includes" = no; then
11697   # Guess where to find include files, by looking for Intrinsic.h.
11698   # First, try using that file with no special directory specified.
11699   cat >conftest.$ac_ext <<_ACEOF
11700 #line 11700 "configure"
11701 #include "confdefs.h"
11702 #include <X11/Intrinsic.h>
11703 _ACEOF
11704 if { (eval echo "$as_me:11704: \"$ac_cpp conftest.$ac_ext\"") >&5
11705   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11706   ac_status=$?
11707   egrep -v '^ *\+' conftest.er1 >conftest.err
11708   rm -f conftest.er1
11709   cat conftest.err >&5
11710   echo "$as_me:11710: \$? = $ac_status" >&5
11711   (exit $ac_status); } >/dev/null; then
11712   if test -s conftest.err; then
11713     ac_cpp_err=$ac_c_preproc_warn_flag
11714   else
11715     ac_cpp_err=
11716   fi
11717 else
11718   ac_cpp_err=yes
11719 fi
11720 if test -z "$ac_cpp_err"; then
11721   # We can compile using X headers with no special include directory.
11722 ac_x_includes=
11723 else
11724   echo "$as_me: failed program was:" >&5
11725   cat conftest.$ac_ext >&5
11726   for ac_dir in $ac_x_header_dirs; do
11727   if test -r "$ac_dir/X11/Intrinsic.h"; then
11728     ac_x_includes=$ac_dir
11729     break
11730   fi
11731 done
11732 fi
11733 rm -f conftest.err conftest.$ac_ext
11734 fi # $ac_x_includes = no
11735
11736 if test "$ac_x_libraries" = no; then
11737   # Check for the libraries.
11738   # See if we find them without any special options.
11739   # Don't add to $LIBS permanently.
11740   ac_save_LIBS=$LIBS
11741   LIBS="-lXt $LIBS"
11742   cat >conftest.$ac_ext <<_ACEOF
11743 #line 11743 "configure"
11744 #include "confdefs.h"
11745 #include <X11/Intrinsic.h>
11746 int
11747 main (void)
11748 {
11749 XtMalloc (0)
11750   ;
11751   return 0;
11752 }
11753 _ACEOF
11754 rm -f conftest.$ac_objext conftest$ac_exeext
11755 if { (eval echo "$as_me:11755: \"$ac_link\"") >&5
11756   (eval $ac_link) 2>&5
11757   ac_status=$?
11758   echo "$as_me:11758: \$? = $ac_status" >&5
11759   (exit $ac_status); } &&
11760          { ac_try='test -s conftest$ac_exeext'
11761   { (eval echo "$as_me:11761: \"$ac_try\"") >&5
11762   (eval $ac_try) 2>&5
11763   ac_status=$?
11764   echo "$as_me:11764: \$? = $ac_status" >&5
11765   (exit $ac_status); }; }; then
11766   LIBS=$ac_save_LIBS
11767 # We can link X programs with no special library path.
11768 ac_x_libraries=
11769 else
11770   echo "$as_me: failed program was:" >&5
11771 cat conftest.$ac_ext >&5
11772 LIBS=$ac_save_LIBS
11773 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11774 do
11775   # Don't even attempt the hair of trying to link an X program!
11776   for ac_extension in a so sl dylib dll; do
11777     if test -r $ac_dir/libXt.$ac_extension; then
11778       ac_x_libraries=$ac_dir
11779       break 2
11780     fi
11781   done
11782 done
11783 fi
11784 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11785 fi # $ac_x_libraries = no
11786
11787 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11788   # Didn't find X anywhere.  Cache the known absence of X.
11789   ac_cv_have_x="have_x=no"
11790 else
11791   # Record where we found X for the cache.
11792   ac_cv_have_x="have_x=yes \
11793                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11794 fi
11795 fi
11796
11797   fi
11798   eval "$ac_cv_have_x"
11799 fi # $with_x != no
11800
11801 if test "$have_x" != yes; then
11802   echo "$as_me:11802: result: $have_x" >&5
11803 echo "${ECHO_T}$have_x" >&6
11804   no_x=yes
11805 else
11806   # If each of the values was on the command line, it overrides each guess.
11807   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11808   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11809   # Update the cache value to reflect the command line values.
11810   ac_cv_have_x="have_x=yes \
11811                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11812   echo "$as_me:11812: result: libraries $x_libraries, headers $x_includes" >&5
11813 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11814 fi
11815
11816 if test "$no_x" = yes; then
11817   # Not all programs may use this symbol, but it does not hurt to define it.
11818
11819 cat >>confdefs.h <<\EOF
11820 #define X_DISPLAY_MISSING 1
11821 EOF
11822
11823   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11824 else
11825   if test -n "$x_includes"; then
11826     X_CFLAGS="$X_CFLAGS -I$x_includes"
11827   fi
11828
11829   # It would also be nice to do this for all -L options, not just this one.
11830   if test -n "$x_libraries"; then
11831     X_LIBS="$X_LIBS -L$x_libraries"
11832     # For Solaris; some versions of Sun CC require a space after -R and
11833     # others require no space.  Words are not sufficient . . . .
11834     case `(uname -sr) 2>/dev/null` in
11835     "SunOS 5"*)
11836       echo "$as_me:11836: checking whether -R must be followed by a space" >&5
11837 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11838       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11839       cat >conftest.$ac_ext <<_ACEOF
11840 #line 11840 "configure"
11841 #include "confdefs.h"
11842
11843 int
11844 main (void)
11845 {
11846
11847   ;
11848   return 0;
11849 }
11850 _ACEOF
11851 rm -f conftest.$ac_objext conftest$ac_exeext
11852 if { (eval echo "$as_me:11852: \"$ac_link\"") >&5
11853   (eval $ac_link) 2>&5
11854   ac_status=$?
11855   echo "$as_me:11855: \$? = $ac_status" >&5
11856   (exit $ac_status); } &&
11857          { ac_try='test -s conftest$ac_exeext'
11858   { (eval echo "$as_me:11858: \"$ac_try\"") >&5
11859   (eval $ac_try) 2>&5
11860   ac_status=$?
11861   echo "$as_me:11861: \$? = $ac_status" >&5
11862   (exit $ac_status); }; }; then
11863   ac_R_nospace=yes
11864 else
11865   echo "$as_me: failed program was:" >&5
11866 cat conftest.$ac_ext >&5
11867 ac_R_nospace=no
11868 fi
11869 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11870       if test $ac_R_nospace = yes; then
11871         echo "$as_me:11871: result: no" >&5
11872 echo "${ECHO_T}no" >&6
11873         X_LIBS="$X_LIBS -R$x_libraries"
11874       else
11875         LIBS="$ac_xsave_LIBS -R $x_libraries"
11876         cat >conftest.$ac_ext <<_ACEOF
11877 #line 11877 "configure"
11878 #include "confdefs.h"
11879
11880 int
11881 main (void)
11882 {
11883
11884   ;
11885   return 0;
11886 }
11887 _ACEOF
11888 rm -f conftest.$ac_objext conftest$ac_exeext
11889 if { (eval echo "$as_me:11889: \"$ac_link\"") >&5
11890   (eval $ac_link) 2>&5
11891   ac_status=$?
11892   echo "$as_me:11892: \$? = $ac_status" >&5
11893   (exit $ac_status); } &&
11894          { ac_try='test -s conftest$ac_exeext'
11895   { (eval echo "$as_me:11895: \"$ac_try\"") >&5
11896   (eval $ac_try) 2>&5
11897   ac_status=$?
11898   echo "$as_me:11898: \$? = $ac_status" >&5
11899   (exit $ac_status); }; }; then
11900   ac_R_space=yes
11901 else
11902   echo "$as_me: failed program was:" >&5
11903 cat conftest.$ac_ext >&5
11904 ac_R_space=no
11905 fi
11906 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11907         if test $ac_R_space = yes; then
11908           echo "$as_me:11908: result: yes" >&5
11909 echo "${ECHO_T}yes" >&6
11910           X_LIBS="$X_LIBS -R $x_libraries"
11911         else
11912           echo "$as_me:11912: result: neither works" >&5
11913 echo "${ECHO_T}neither works" >&6
11914         fi
11915       fi
11916       LIBS=$ac_xsave_LIBS
11917     esac
11918   fi
11919
11920   # Check for system-dependent libraries X programs must link with.
11921   # Do this before checking for the system-independent R6 libraries
11922   # (-lICE), since we may need -lsocket or whatever for X linking.
11923
11924   if test "$ISC" = yes; then
11925     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11926   else
11927     # Martyn Johnson says this is needed for Ultrix, if the X
11928     # libraries were built with DECnet support.  And Karl Berry says
11929     # the Alpha needs dnet_stub (dnet does not exist).
11930     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11931     cat >conftest.$ac_ext <<_ACEOF
11932 #line 11932 "configure"
11933 #include "confdefs.h"
11934
11935 /* Override any gcc2 internal prototype to avoid an error.  */
11936 #ifdef __cplusplus
11937 extern "C"
11938 #endif
11939 /* We use char because int might match the return type of a gcc2
11940    builtin and then its argument prototype would still apply.  */
11941 char XOpenDisplay ();
11942 int
11943 main (void)
11944 {
11945 XOpenDisplay ();
11946   ;
11947   return 0;
11948 }
11949 _ACEOF
11950 rm -f conftest.$ac_objext conftest$ac_exeext
11951 if { (eval echo "$as_me:11951: \"$ac_link\"") >&5
11952   (eval $ac_link) 2>&5
11953   ac_status=$?
11954   echo "$as_me:11954: \$? = $ac_status" >&5
11955   (exit $ac_status); } &&
11956          { ac_try='test -s conftest$ac_exeext'
11957   { (eval echo "$as_me:11957: \"$ac_try\"") >&5
11958   (eval $ac_try) 2>&5
11959   ac_status=$?
11960   echo "$as_me:11960: \$? = $ac_status" >&5
11961   (exit $ac_status); }; }; then
11962   :
11963 else
11964   echo "$as_me: failed program was:" >&5
11965 cat conftest.$ac_ext >&5
11966 echo "$as_me:11966: checking for dnet_ntoa in -ldnet" >&5
11967 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11968 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11969   echo $ECHO_N "(cached) $ECHO_C" >&6
11970 else
11971   ac_check_lib_save_LIBS=$LIBS
11972 LIBS="-ldnet  $LIBS"
11973 cat >conftest.$ac_ext <<_ACEOF
11974 #line 11974 "configure"
11975 #include "confdefs.h"
11976
11977 /* Override any gcc2 internal prototype to avoid an error.  */
11978 #ifdef __cplusplus
11979 extern "C"
11980 #endif
11981 /* We use char because int might match the return type of a gcc2
11982    builtin and then its argument prototype would still apply.  */
11983 char dnet_ntoa ();
11984 int
11985 main (void)
11986 {
11987 dnet_ntoa ();
11988   ;
11989   return 0;
11990 }
11991 _ACEOF
11992 rm -f conftest.$ac_objext conftest$ac_exeext
11993 if { (eval echo "$as_me:11993: \"$ac_link\"") >&5
11994   (eval $ac_link) 2>&5
11995   ac_status=$?
11996   echo "$as_me:11996: \$? = $ac_status" >&5
11997   (exit $ac_status); } &&
11998          { ac_try='test -s conftest$ac_exeext'
11999   { (eval echo "$as_me:11999: \"$ac_try\"") >&5
12000   (eval $ac_try) 2>&5
12001   ac_status=$?
12002   echo "$as_me:12002: \$? = $ac_status" >&5
12003   (exit $ac_status); }; }; then
12004   ac_cv_lib_dnet_dnet_ntoa=yes
12005 else
12006   echo "$as_me: failed program was:" >&5
12007 cat conftest.$ac_ext >&5
12008 ac_cv_lib_dnet_dnet_ntoa=no
12009 fi
12010 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12011 LIBS=$ac_check_lib_save_LIBS
12012 fi
12013 echo "$as_me:12013: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12014 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12015 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
12016   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12017 fi
12018
12019     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12020       echo "$as_me:12020: checking for dnet_ntoa in -ldnet_stub" >&5
12021 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12022 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12023   echo $ECHO_N "(cached) $ECHO_C" >&6
12024 else
12025   ac_check_lib_save_LIBS=$LIBS
12026 LIBS="-ldnet_stub  $LIBS"
12027 cat >conftest.$ac_ext <<_ACEOF
12028 #line 12028 "configure"
12029 #include "confdefs.h"
12030
12031 /* Override any gcc2 internal prototype to avoid an error.  */
12032 #ifdef __cplusplus
12033 extern "C"
12034 #endif
12035 /* We use char because int might match the return type of a gcc2
12036    builtin and then its argument prototype would still apply.  */
12037 char dnet_ntoa ();
12038 int
12039 main (void)
12040 {
12041 dnet_ntoa ();
12042   ;
12043   return 0;
12044 }
12045 _ACEOF
12046 rm -f conftest.$ac_objext conftest$ac_exeext
12047 if { (eval echo "$as_me:12047: \"$ac_link\"") >&5
12048   (eval $ac_link) 2>&5
12049   ac_status=$?
12050   echo "$as_me:12050: \$? = $ac_status" >&5
12051   (exit $ac_status); } &&
12052          { ac_try='test -s conftest$ac_exeext'
12053   { (eval echo "$as_me:12053: \"$ac_try\"") >&5
12054   (eval $ac_try) 2>&5
12055   ac_status=$?
12056   echo "$as_me:12056: \$? = $ac_status" >&5
12057   (exit $ac_status); }; }; then
12058   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12059 else
12060   echo "$as_me: failed program was:" >&5
12061 cat conftest.$ac_ext >&5
12062 ac_cv_lib_dnet_stub_dnet_ntoa=no
12063 fi
12064 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12065 LIBS=$ac_check_lib_save_LIBS
12066 fi
12067 echo "$as_me:12067: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12068 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12069 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
12070   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12071 fi
12072
12073     fi
12074 fi
12075 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12076     LIBS="$ac_xsave_LIBS"
12077
12078     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12079     # to get the SysV transport functions.
12080     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12081     # needs -lnsl.
12082     # The nsl library prevents programs from opening the X display
12083     # on Irix 5.2, according to T.E. Dickey.
12084     # The functions gethostbyname, getservbyname, and inet_addr are
12085     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12086     echo "$as_me:12086: checking for gethostbyname" >&5
12087 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12088 if test "${ac_cv_func_gethostbyname+set}" = set; then
12089   echo $ECHO_N "(cached) $ECHO_C" >&6
12090 else
12091   cat >conftest.$ac_ext <<_ACEOF
12092 #line 12092 "configure"
12093 #include "confdefs.h"
12094 #define gethostbyname autoconf_temporary
12095 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12096 #undef gethostbyname
12097
12098 #ifdef __cplusplus
12099 extern "C"
12100 #endif
12101
12102 /* We use char because int might match the return type of a gcc2
12103    builtin and then its argument prototype would still apply.  */
12104 char gethostbyname (void);
12105
12106 int
12107 main (void)
12108 {
12109
12110 /* The GNU C library defines stubs for functions which it implements
12111     to always fail with ENOSYS.  Some functions are actually named
12112     something starting with __ and the normal name is an alias.  */
12113 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12114 #error found stub for gethostbyname
12115 #endif
12116
12117         return gethostbyname ();
12118   ;
12119   return 0;
12120 }
12121 _ACEOF
12122 rm -f conftest.$ac_objext conftest$ac_exeext
12123 if { (eval echo "$as_me:12123: \"$ac_link\"") >&5
12124   (eval $ac_link) 2>&5
12125   ac_status=$?
12126   echo "$as_me:12126: \$? = $ac_status" >&5
12127   (exit $ac_status); } &&
12128          { ac_try='test -s conftest$ac_exeext'
12129   { (eval echo "$as_me:12129: \"$ac_try\"") >&5
12130   (eval $ac_try) 2>&5
12131   ac_status=$?
12132   echo "$as_me:12132: \$? = $ac_status" >&5
12133   (exit $ac_status); }; }; then
12134   ac_cv_func_gethostbyname=yes
12135 else
12136   echo "$as_me: failed program was:" >&5
12137 cat conftest.$ac_ext >&5
12138 ac_cv_func_gethostbyname=no
12139 fi
12140 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12141 fi
12142 echo "$as_me:12142: result: $ac_cv_func_gethostbyname" >&5
12143 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12144
12145     if test $ac_cv_func_gethostbyname = no; then
12146       echo "$as_me:12146: checking for gethostbyname in -lnsl" >&5
12147 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12148 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12149   echo $ECHO_N "(cached) $ECHO_C" >&6
12150 else
12151   ac_check_lib_save_LIBS=$LIBS
12152 LIBS="-lnsl  $LIBS"
12153 cat >conftest.$ac_ext <<_ACEOF
12154 #line 12154 "configure"
12155 #include "confdefs.h"
12156
12157 /* Override any gcc2 internal prototype to avoid an error.  */
12158 #ifdef __cplusplus
12159 extern "C"
12160 #endif
12161 /* We use char because int might match the return type of a gcc2
12162    builtin and then its argument prototype would still apply.  */
12163 char gethostbyname ();
12164 int
12165 main (void)
12166 {
12167 gethostbyname ();
12168   ;
12169   return 0;
12170 }
12171 _ACEOF
12172 rm -f conftest.$ac_objext conftest$ac_exeext
12173 if { (eval echo "$as_me:12173: \"$ac_link\"") >&5
12174   (eval $ac_link) 2>&5
12175   ac_status=$?
12176   echo "$as_me:12176: \$? = $ac_status" >&5
12177   (exit $ac_status); } &&
12178          { ac_try='test -s conftest$ac_exeext'
12179   { (eval echo "$as_me:12179: \"$ac_try\"") >&5
12180   (eval $ac_try) 2>&5
12181   ac_status=$?
12182   echo "$as_me:12182: \$? = $ac_status" >&5
12183   (exit $ac_status); }; }; then
12184   ac_cv_lib_nsl_gethostbyname=yes
12185 else
12186   echo "$as_me: failed program was:" >&5
12187 cat conftest.$ac_ext >&5
12188 ac_cv_lib_nsl_gethostbyname=no
12189 fi
12190 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12191 LIBS=$ac_check_lib_save_LIBS
12192 fi
12193 echo "$as_me:12193: result: $ac_cv_lib_nsl_gethostbyname" >&5
12194 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12195 if test $ac_cv_lib_nsl_gethostbyname = yes; then
12196   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12197 fi
12198
12199       if test $ac_cv_lib_nsl_gethostbyname = no; then
12200         echo "$as_me:12200: checking for gethostbyname in -lbsd" >&5
12201 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12202 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12203   echo $ECHO_N "(cached) $ECHO_C" >&6
12204 else
12205   ac_check_lib_save_LIBS=$LIBS
12206 LIBS="-lbsd  $LIBS"
12207 cat >conftest.$ac_ext <<_ACEOF
12208 #line 12208 "configure"
12209 #include "confdefs.h"
12210
12211 /* Override any gcc2 internal prototype to avoid an error.  */
12212 #ifdef __cplusplus
12213 extern "C"
12214 #endif
12215 /* We use char because int might match the return type of a gcc2
12216    builtin and then its argument prototype would still apply.  */
12217 char gethostbyname ();
12218 int
12219 main (void)
12220 {
12221 gethostbyname ();
12222   ;
12223   return 0;
12224 }
12225 _ACEOF
12226 rm -f conftest.$ac_objext conftest$ac_exeext
12227 if { (eval echo "$as_me:12227: \"$ac_link\"") >&5
12228   (eval $ac_link) 2>&5
12229   ac_status=$?
12230   echo "$as_me:12230: \$? = $ac_status" >&5
12231   (exit $ac_status); } &&
12232          { ac_try='test -s conftest$ac_exeext'
12233   { (eval echo "$as_me:12233: \"$ac_try\"") >&5
12234   (eval $ac_try) 2>&5
12235   ac_status=$?
12236   echo "$as_me:12236: \$? = $ac_status" >&5
12237   (exit $ac_status); }; }; then
12238   ac_cv_lib_bsd_gethostbyname=yes
12239 else
12240   echo "$as_me: failed program was:" >&5
12241 cat conftest.$ac_ext >&5
12242 ac_cv_lib_bsd_gethostbyname=no
12243 fi
12244 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12245 LIBS=$ac_check_lib_save_LIBS
12246 fi
12247 echo "$as_me:12247: result: $ac_cv_lib_bsd_gethostbyname" >&5
12248 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12249 if test $ac_cv_lib_bsd_gethostbyname = yes; then
12250   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12251 fi
12252
12253       fi
12254     fi
12255
12256     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12257     # socket/setsockopt and other routines are undefined under SCO ODT
12258     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12259     # on later versions), says Simon Leinen: it contains gethostby*
12260     # variants that don't use the nameserver (or something).  -lsocket
12261     # must be given before -lnsl if both are needed.  We assume that
12262     # if connect needs -lnsl, so does gethostbyname.
12263     echo "$as_me:12263: checking for connect" >&5
12264 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12265 if test "${ac_cv_func_connect+set}" = set; then
12266   echo $ECHO_N "(cached) $ECHO_C" >&6
12267 else
12268   cat >conftest.$ac_ext <<_ACEOF
12269 #line 12269 "configure"
12270 #include "confdefs.h"
12271 #define connect autoconf_temporary
12272 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12273 #undef connect
12274
12275 #ifdef __cplusplus
12276 extern "C"
12277 #endif
12278
12279 /* We use char because int might match the return type of a gcc2
12280    builtin and then its argument prototype would still apply.  */
12281 char connect (void);
12282
12283 int
12284 main (void)
12285 {
12286
12287 /* The GNU C library defines stubs for functions which it implements
12288     to always fail with ENOSYS.  Some functions are actually named
12289     something starting with __ and the normal name is an alias.  */
12290 #if defined (__stub_connect) || defined (__stub___connect)
12291 #error found stub for connect
12292 #endif
12293
12294         return connect ();
12295   ;
12296   return 0;
12297 }
12298 _ACEOF
12299 rm -f conftest.$ac_objext conftest$ac_exeext
12300 if { (eval echo "$as_me:12300: \"$ac_link\"") >&5
12301   (eval $ac_link) 2>&5
12302   ac_status=$?
12303   echo "$as_me:12303: \$? = $ac_status" >&5
12304   (exit $ac_status); } &&
12305          { ac_try='test -s conftest$ac_exeext'
12306   { (eval echo "$as_me:12306: \"$ac_try\"") >&5
12307   (eval $ac_try) 2>&5
12308   ac_status=$?
12309   echo "$as_me:12309: \$? = $ac_status" >&5
12310   (exit $ac_status); }; }; then
12311   ac_cv_func_connect=yes
12312 else
12313   echo "$as_me: failed program was:" >&5
12314 cat conftest.$ac_ext >&5
12315 ac_cv_func_connect=no
12316 fi
12317 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12318 fi
12319 echo "$as_me:12319: result: $ac_cv_func_connect" >&5
12320 echo "${ECHO_T}$ac_cv_func_connect" >&6
12321
12322     if test $ac_cv_func_connect = no; then
12323       echo "$as_me:12323: checking for connect in -lsocket" >&5
12324 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12325 if test "${ac_cv_lib_socket_connect+set}" = set; then
12326   echo $ECHO_N "(cached) $ECHO_C" >&6
12327 else
12328   ac_check_lib_save_LIBS=$LIBS
12329 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12330 cat >conftest.$ac_ext <<_ACEOF
12331 #line 12331 "configure"
12332 #include "confdefs.h"
12333
12334 /* Override any gcc2 internal prototype to avoid an error.  */
12335 #ifdef __cplusplus
12336 extern "C"
12337 #endif
12338 /* We use char because int might match the return type of a gcc2
12339    builtin and then its argument prototype would still apply.  */
12340 char connect ();
12341 int
12342 main (void)
12343 {
12344 connect ();
12345   ;
12346   return 0;
12347 }
12348 _ACEOF
12349 rm -f conftest.$ac_objext conftest$ac_exeext
12350 if { (eval echo "$as_me:12350: \"$ac_link\"") >&5
12351   (eval $ac_link) 2>&5
12352   ac_status=$?
12353   echo "$as_me:12353: \$? = $ac_status" >&5
12354   (exit $ac_status); } &&
12355          { ac_try='test -s conftest$ac_exeext'
12356   { (eval echo "$as_me:12356: \"$ac_try\"") >&5
12357   (eval $ac_try) 2>&5
12358   ac_status=$?
12359   echo "$as_me:12359: \$? = $ac_status" >&5
12360   (exit $ac_status); }; }; then
12361   ac_cv_lib_socket_connect=yes
12362 else
12363   echo "$as_me: failed program was:" >&5
12364 cat conftest.$ac_ext >&5
12365 ac_cv_lib_socket_connect=no
12366 fi
12367 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12368 LIBS=$ac_check_lib_save_LIBS
12369 fi
12370 echo "$as_me:12370: result: $ac_cv_lib_socket_connect" >&5
12371 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12372 if test $ac_cv_lib_socket_connect = yes; then
12373   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12374 fi
12375
12376     fi
12377
12378     # Guillermo Gomez says -lposix is necessary on A/UX.
12379     echo "$as_me:12379: checking for remove" >&5
12380 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12381 if test "${ac_cv_func_remove+set}" = set; then
12382   echo $ECHO_N "(cached) $ECHO_C" >&6
12383 else
12384   cat >conftest.$ac_ext <<_ACEOF
12385 #line 12385 "configure"
12386 #include "confdefs.h"
12387 #define remove autoconf_temporary
12388 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12389 #undef remove
12390
12391 #ifdef __cplusplus
12392 extern "C"
12393 #endif
12394
12395 /* We use char because int might match the return type of a gcc2
12396    builtin and then its argument prototype would still apply.  */
12397 char remove (void);
12398
12399 int
12400 main (void)
12401 {
12402
12403 /* The GNU C library defines stubs for functions which it implements
12404     to always fail with ENOSYS.  Some functions are actually named
12405     something starting with __ and the normal name is an alias.  */
12406 #if defined (__stub_remove) || defined (__stub___remove)
12407 #error found stub for remove
12408 #endif
12409
12410         return remove ();
12411   ;
12412   return 0;
12413 }
12414 _ACEOF
12415 rm -f conftest.$ac_objext conftest$ac_exeext
12416 if { (eval echo "$as_me:12416: \"$ac_link\"") >&5
12417   (eval $ac_link) 2>&5
12418   ac_status=$?
12419   echo "$as_me:12419: \$? = $ac_status" >&5
12420   (exit $ac_status); } &&
12421          { ac_try='test -s conftest$ac_exeext'
12422   { (eval echo "$as_me:12422: \"$ac_try\"") >&5
12423   (eval $ac_try) 2>&5
12424   ac_status=$?
12425   echo "$as_me:12425: \$? = $ac_status" >&5
12426   (exit $ac_status); }; }; then
12427   ac_cv_func_remove=yes
12428 else
12429   echo "$as_me: failed program was:" >&5
12430 cat conftest.$ac_ext >&5
12431 ac_cv_func_remove=no
12432 fi
12433 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12434 fi
12435 echo "$as_me:12435: result: $ac_cv_func_remove" >&5
12436 echo "${ECHO_T}$ac_cv_func_remove" >&6
12437
12438     if test $ac_cv_func_remove = no; then
12439       echo "$as_me:12439: checking for remove in -lposix" >&5
12440 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12441 if test "${ac_cv_lib_posix_remove+set}" = set; then
12442   echo $ECHO_N "(cached) $ECHO_C" >&6
12443 else
12444   ac_check_lib_save_LIBS=$LIBS
12445 LIBS="-lposix  $LIBS"
12446 cat >conftest.$ac_ext <<_ACEOF
12447 #line 12447 "configure"
12448 #include "confdefs.h"
12449
12450 /* Override any gcc2 internal prototype to avoid an error.  */
12451 #ifdef __cplusplus
12452 extern "C"
12453 #endif
12454 /* We use char because int might match the return type of a gcc2
12455    builtin and then its argument prototype would still apply.  */
12456 char remove ();
12457 int
12458 main (void)
12459 {
12460 remove ();
12461   ;
12462   return 0;
12463 }
12464 _ACEOF
12465 rm -f conftest.$ac_objext conftest$ac_exeext
12466 if { (eval echo "$as_me:12466: \"$ac_link\"") >&5
12467   (eval $ac_link) 2>&5
12468   ac_status=$?
12469   echo "$as_me:12469: \$? = $ac_status" >&5
12470   (exit $ac_status); } &&
12471          { ac_try='test -s conftest$ac_exeext'
12472   { (eval echo "$as_me:12472: \"$ac_try\"") >&5
12473   (eval $ac_try) 2>&5
12474   ac_status=$?
12475   echo "$as_me:12475: \$? = $ac_status" >&5
12476   (exit $ac_status); }; }; then
12477   ac_cv_lib_posix_remove=yes
12478 else
12479   echo "$as_me: failed program was:" >&5
12480 cat conftest.$ac_ext >&5
12481 ac_cv_lib_posix_remove=no
12482 fi
12483 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12484 LIBS=$ac_check_lib_save_LIBS
12485 fi
12486 echo "$as_me:12486: result: $ac_cv_lib_posix_remove" >&5
12487 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12488 if test $ac_cv_lib_posix_remove = yes; then
12489   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12490 fi
12491
12492     fi
12493
12494     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12495     echo "$as_me:12495: checking for shmat" >&5
12496 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12497 if test "${ac_cv_func_shmat+set}" = set; then
12498   echo $ECHO_N "(cached) $ECHO_C" >&6
12499 else
12500   cat >conftest.$ac_ext <<_ACEOF
12501 #line 12501 "configure"
12502 #include "confdefs.h"
12503 #define shmat autoconf_temporary
12504 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12505 #undef shmat
12506
12507 #ifdef __cplusplus
12508 extern "C"
12509 #endif
12510
12511 /* We use char because int might match the return type of a gcc2
12512    builtin and then its argument prototype would still apply.  */
12513 char shmat (void);
12514
12515 int
12516 main (void)
12517 {
12518
12519 /* The GNU C library defines stubs for functions which it implements
12520     to always fail with ENOSYS.  Some functions are actually named
12521     something starting with __ and the normal name is an alias.  */
12522 #if defined (__stub_shmat) || defined (__stub___shmat)
12523 #error found stub for shmat
12524 #endif
12525
12526         return shmat ();
12527   ;
12528   return 0;
12529 }
12530 _ACEOF
12531 rm -f conftest.$ac_objext conftest$ac_exeext
12532 if { (eval echo "$as_me:12532: \"$ac_link\"") >&5
12533   (eval $ac_link) 2>&5
12534   ac_status=$?
12535   echo "$as_me:12535: \$? = $ac_status" >&5
12536   (exit $ac_status); } &&
12537          { ac_try='test -s conftest$ac_exeext'
12538   { (eval echo "$as_me:12538: \"$ac_try\"") >&5
12539   (eval $ac_try) 2>&5
12540   ac_status=$?
12541   echo "$as_me:12541: \$? = $ac_status" >&5
12542   (exit $ac_status); }; }; then
12543   ac_cv_func_shmat=yes
12544 else
12545   echo "$as_me: failed program was:" >&5
12546 cat conftest.$ac_ext >&5
12547 ac_cv_func_shmat=no
12548 fi
12549 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12550 fi
12551 echo "$as_me:12551: result: $ac_cv_func_shmat" >&5
12552 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12553
12554     if test $ac_cv_func_shmat = no; then
12555       echo "$as_me:12555: checking for shmat in -lipc" >&5
12556 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12557 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12558   echo $ECHO_N "(cached) $ECHO_C" >&6
12559 else
12560   ac_check_lib_save_LIBS=$LIBS
12561 LIBS="-lipc  $LIBS"
12562 cat >conftest.$ac_ext <<_ACEOF
12563 #line 12563 "configure"
12564 #include "confdefs.h"
12565
12566 /* Override any gcc2 internal prototype to avoid an error.  */
12567 #ifdef __cplusplus
12568 extern "C"
12569 #endif
12570 /* We use char because int might match the return type of a gcc2
12571    builtin and then its argument prototype would still apply.  */
12572 char shmat ();
12573 int
12574 main (void)
12575 {
12576 shmat ();
12577   ;
12578   return 0;
12579 }
12580 _ACEOF
12581 rm -f conftest.$ac_objext conftest$ac_exeext
12582 if { (eval echo "$as_me:12582: \"$ac_link\"") >&5
12583   (eval $ac_link) 2>&5
12584   ac_status=$?
12585   echo "$as_me:12585: \$? = $ac_status" >&5
12586   (exit $ac_status); } &&
12587          { ac_try='test -s conftest$ac_exeext'
12588   { (eval echo "$as_me:12588: \"$ac_try\"") >&5
12589   (eval $ac_try) 2>&5
12590   ac_status=$?
12591   echo "$as_me:12591: \$? = $ac_status" >&5
12592   (exit $ac_status); }; }; then
12593   ac_cv_lib_ipc_shmat=yes
12594 else
12595   echo "$as_me: failed program was:" >&5
12596 cat conftest.$ac_ext >&5
12597 ac_cv_lib_ipc_shmat=no
12598 fi
12599 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12600 LIBS=$ac_check_lib_save_LIBS
12601 fi
12602 echo "$as_me:12602: result: $ac_cv_lib_ipc_shmat" >&5
12603 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12604 if test $ac_cv_lib_ipc_shmat = yes; then
12605   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12606 fi
12607
12608     fi
12609   fi
12610
12611   # Check for libraries that X11R6 Xt/Xaw programs need.
12612   ac_save_LDFLAGS=$LDFLAGS
12613   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12614   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12615   # check for ICE first), but we must link in the order -lSM -lICE or
12616   # we get undefined symbols.  So assume we have SM if we have ICE.
12617   # These have to be linked with before -lX11, unlike the other
12618   # libraries we check for below, so use a different variable.
12619   # John Interrante, Karl Berry
12620   echo "$as_me:12620: checking for IceConnectionNumber in -lICE" >&5
12621 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12622 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12623   echo $ECHO_N "(cached) $ECHO_C" >&6
12624 else
12625   ac_check_lib_save_LIBS=$LIBS
12626 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12627 cat >conftest.$ac_ext <<_ACEOF
12628 #line 12628 "configure"
12629 #include "confdefs.h"
12630
12631 /* Override any gcc2 internal prototype to avoid an error.  */
12632 #ifdef __cplusplus
12633 extern "C"
12634 #endif
12635 /* We use char because int might match the return type of a gcc2
12636    builtin and then its argument prototype would still apply.  */
12637 char IceConnectionNumber ();
12638 int
12639 main (void)
12640 {
12641 IceConnectionNumber ();
12642   ;
12643   return 0;
12644 }
12645 _ACEOF
12646 rm -f conftest.$ac_objext conftest$ac_exeext
12647 if { (eval echo "$as_me:12647: \"$ac_link\"") >&5
12648   (eval $ac_link) 2>&5
12649   ac_status=$?
12650   echo "$as_me:12650: \$? = $ac_status" >&5
12651   (exit $ac_status); } &&
12652          { ac_try='test -s conftest$ac_exeext'
12653   { (eval echo "$as_me:12653: \"$ac_try\"") >&5
12654   (eval $ac_try) 2>&5
12655   ac_status=$?
12656   echo "$as_me:12656: \$? = $ac_status" >&5
12657   (exit $ac_status); }; }; then
12658   ac_cv_lib_ICE_IceConnectionNumber=yes
12659 else
12660   echo "$as_me: failed program was:" >&5
12661 cat conftest.$ac_ext >&5
12662 ac_cv_lib_ICE_IceConnectionNumber=no
12663 fi
12664 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12665 LIBS=$ac_check_lib_save_LIBS
12666 fi
12667 echo "$as_me:12667: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12668 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12669 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12670   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12671 fi
12672
12673   LDFLAGS=$ac_save_LDFLAGS
12674
12675 fi
12676
12677 cf_x_athena=${cf_x_athena:-Xaw}
12678
12679 echo "$as_me:12679: checking if you want to link with Xaw 3d library" >&5
12680 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12681 withval=
12682
12683 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12684 if test "${with_Xaw3d+set}" = set; then
12685   withval="$with_Xaw3d"
12686
12687 fi;
12688 if test "$withval" = yes ; then
12689         cf_x_athena=Xaw3d
12690         echo "$as_me:12690: result: yes" >&5
12691 echo "${ECHO_T}yes" >&6
12692 else
12693         echo "$as_me:12693: result: no" >&5
12694 echo "${ECHO_T}no" >&6
12695 fi
12696
12697 echo "$as_me:12697: checking if you want to link with Xaw 3d xft library" >&5
12698 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12699 withval=
12700
12701 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12702 if test "${with_Xaw3dxft+set}" = set; then
12703   withval="$with_Xaw3dxft"
12704
12705 fi;
12706 if test "$withval" = yes ; then
12707         cf_x_athena=Xaw3dxft
12708         echo "$as_me:12708: result: yes" >&5
12709 echo "${ECHO_T}yes" >&6
12710 else
12711         echo "$as_me:12711: result: no" >&5
12712 echo "${ECHO_T}no" >&6
12713 fi
12714
12715 echo "$as_me:12715: checking if you want to link with neXT Athena library" >&5
12716 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12717 withval=
12718
12719 # Check whether --with-neXtaw or --without-neXtaw was given.
12720 if test "${with_neXtaw+set}" = set; then
12721   withval="$with_neXtaw"
12722
12723 fi;
12724 if test "$withval" = yes ; then
12725         cf_x_athena=neXtaw
12726         echo "$as_me:12726: result: yes" >&5
12727 echo "${ECHO_T}yes" >&6
12728 else
12729         echo "$as_me:12729: result: no" >&5
12730 echo "${ECHO_T}no" >&6
12731 fi
12732
12733 echo "$as_me:12733: checking if you want to link with Athena-Plus library" >&5
12734 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12735 withval=
12736
12737 # Check whether --with-XawPlus or --without-XawPlus was given.
12738 if test "${with_XawPlus+set}" = set; then
12739   withval="$with_XawPlus"
12740
12741 fi;
12742 if test "$withval" = yes ; then
12743         cf_x_athena=XawPlus
12744         echo "$as_me:12744: result: yes" >&5
12745 echo "${ECHO_T}yes" >&6
12746 else
12747         echo "$as_me:12747: result: no" >&5
12748 echo "${ECHO_T}no" >&6
12749 fi
12750
12751 cf_x_athena_lib=""
12752
12753 if test "$PKG_CONFIG" != none ; then
12754         cf_athena_list=
12755         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12756         for cf_athena_pkg in \
12757                 $cf_athena_list \
12758                 ${cf_x_athena} \
12759                 ${cf_x_athena}-devel \
12760                 lib${cf_x_athena} \
12761                 lib${cf_x_athena}-devel
12762         do
12763
12764 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12765         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12766
12767 echo "${as_me:-configure}:12767: testing found package $cf_athena_pkg ..." 1>&5
12768
12769         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12770         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12771         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12772
12773 echo "${as_me:-configure}:12773: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12774
12775         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12776
12777 echo "${as_me:-configure}:12777: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12778
12779 cf_fix_cppflags=no
12780 cf_new_cflags=
12781 cf_new_cppflags=
12782 cf_new_extra_cppflags=
12783
12784 for cf_add_cflags in $cf_pkgconfig_incs
12785 do
12786 case $cf_fix_cppflags in
12787 (no)
12788         case $cf_add_cflags in
12789         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12790                 case $cf_add_cflags in
12791                 (-D*)
12792                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12793
12794                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12795                                 && test -z "${cf_tst_cflags}" \
12796                                 && cf_fix_cppflags=yes
12797
12798                         if test $cf_fix_cppflags = yes ; then
12799
12800         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12801         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12802
12803                                 continue
12804                         elif test "${cf_tst_cflags}" = "\"'" ; then
12805
12806         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12807         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12808
12809                                 continue
12810                         fi
12811                         ;;
12812                 esac
12813                 case "$CPPFLAGS" in
12814                 (*$cf_add_cflags)
12815                         ;;
12816                 (*)
12817                         case $cf_add_cflags in
12818                         (-D*)
12819                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12820
12821 CPPFLAGS=`echo "$CPPFLAGS" | \
12822         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12823                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12824
12825                                 ;;
12826                         esac
12827
12828         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12829         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12830
12831                         ;;
12832                 esac
12833                 ;;
12834         (*)
12835
12836         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12837         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12838
12839                 ;;
12840         esac
12841         ;;
12842 (yes)
12843
12844         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12845         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12846
12847         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12848
12849         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12850                 && test -z "${cf_tst_cflags}" \
12851                 && cf_fix_cppflags=no
12852         ;;
12853 esac
12854 done
12855
12856 if test -n "$cf_new_cflags" ; then
12857
12858         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12859         CFLAGS="${CFLAGS}$cf_new_cflags"
12860
12861 fi
12862
12863 if test -n "$cf_new_cppflags" ; then
12864
12865         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12866         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12867
12868 fi
12869
12870 if test -n "$cf_new_extra_cppflags" ; then
12871
12872         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12873         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12874
12875 fi
12876
12877 cf_add_libs="$LIBS"
12878 # reverse order
12879 cf_add_0lib=
12880 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12881 # filter duplicates
12882 for cf_add_1lib in $cf_add_0lib; do
12883         for cf_add_2lib in $cf_add_libs; do
12884                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12885                         cf_add_1lib=
12886                         break
12887                 fi
12888         done
12889         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12890 done
12891 LIBS="$cf_add_libs"
12892
12893                         cf_x_athena_lib="$cf_pkgconfig_libs"
12894
12895 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12896
12897                         cat >>confdefs.h <<EOF
12898 #define $cf_x_athena_LIBS 1
12899 EOF
12900
12901         for cf_trim_lib in Xmu Xt X11
12902         do
12903                 case "$LIBS" in
12904                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12905                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12906                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12907
12908 echo "${as_me:-configure}:12908: testing ..trimmed $LIBS ..." 1>&5
12909
12910                         ;;
12911                 esac
12912         done
12913
12914 echo "$as_me:12914: checking for usable $cf_x_athena/Xmu package" >&5
12915 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12916 if test "${cf_cv_xaw_compat+set}" = set; then
12917   echo $ECHO_N "(cached) $ECHO_C" >&6
12918 else
12919
12920 cat >conftest.$ac_ext <<_ACEOF
12921 #line 12921 "configure"
12922 #include "confdefs.h"
12923
12924 #include <X11/Xmu/CharSet.h>
12925
12926 int
12927 main (void)
12928 {
12929
12930 int check = XmuCompareISOLatin1("big", "small");
12931 (void)check;
12932
12933   ;
12934   return 0;
12935 }
12936 _ACEOF
12937 rm -f conftest.$ac_objext conftest$ac_exeext
12938 if { (eval echo "$as_me:12938: \"$ac_link\"") >&5
12939   (eval $ac_link) 2>&5
12940   ac_status=$?
12941   echo "$as_me:12941: \$? = $ac_status" >&5
12942   (exit $ac_status); } &&
12943          { ac_try='test -s conftest$ac_exeext'
12944   { (eval echo "$as_me:12944: \"$ac_try\"") >&5
12945   (eval $ac_try) 2>&5
12946   ac_status=$?
12947   echo "$as_me:12947: \$? = $ac_status" >&5
12948   (exit $ac_status); }; }; then
12949   cf_cv_xaw_compat=yes
12950 else
12951   echo "$as_me: failed program was:" >&5
12952 cat conftest.$ac_ext >&5
12953 cf_cv_xaw_compat=no
12954 fi
12955 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12956 fi
12957 echo "$as_me:12957: result: $cf_cv_xaw_compat" >&5
12958 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12959
12960                         if test "$cf_cv_xaw_compat" = no
12961                         then
12962                                 # workaround for broken ".pc" files...
12963                                 case "$cf_x_athena_lib" in
12964                                 (*-lXmu*)
12965                                         ;;
12966                                 (*)
12967                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12968
12969 echo "${as_me:-configure}:12969: testing work around broken package ..." 1>&5
12970
12971                                         cf_save_xmu="$LIBS"
12972                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12973
12974 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12975         test -n "$verbose" && echo "    found package xmu" 1>&6
12976
12977 echo "${as_me:-configure}:12977: testing found package xmu ..." 1>&5
12978
12979         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12980         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12981         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12982
12983 echo "${as_me:-configure}:12983: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12984
12985         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12986
12987 echo "${as_me:-configure}:12987: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12988
12989 cf_fix_cppflags=no
12990 cf_new_cflags=
12991 cf_new_cppflags=
12992 cf_new_extra_cppflags=
12993
12994 for cf_add_cflags in $cf_pkgconfig_incs
12995 do
12996 case $cf_fix_cppflags in
12997 (no)
12998         case $cf_add_cflags in
12999         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13000                 case $cf_add_cflags in
13001                 (-D*)
13002                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13003
13004                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13005                                 && test -z "${cf_tst_cflags}" \
13006                                 && cf_fix_cppflags=yes
13007
13008                         if test $cf_fix_cppflags = yes ; then
13009
13010         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13011         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13012
13013                                 continue
13014                         elif test "${cf_tst_cflags}" = "\"'" ; then
13015
13016         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13017         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13018
13019                                 continue
13020                         fi
13021                         ;;
13022                 esac
13023                 case "$CPPFLAGS" in
13024                 (*$cf_add_cflags)
13025                         ;;
13026                 (*)
13027                         case $cf_add_cflags in
13028                         (-D*)
13029                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13030
13031 CPPFLAGS=`echo "$CPPFLAGS" | \
13032         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13033                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13034
13035                                 ;;
13036                         esac
13037
13038         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13039         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13040
13041                         ;;
13042                 esac
13043                 ;;
13044         (*)
13045
13046         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13047         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13048
13049                 ;;
13050         esac
13051         ;;
13052 (yes)
13053
13054         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13055         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13056
13057         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13058
13059         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13060                 && test -z "${cf_tst_cflags}" \
13061                 && cf_fix_cppflags=no
13062         ;;
13063 esac
13064 done
13065
13066 if test -n "$cf_new_cflags" ; then
13067
13068         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13069         CFLAGS="${CFLAGS}$cf_new_cflags"
13070
13071 fi
13072
13073 if test -n "$cf_new_cppflags" ; then
13074
13075         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13076         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13077
13078 fi
13079
13080 if test -n "$cf_new_extra_cppflags" ; then
13081
13082         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13083         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13084
13085 fi
13086
13087 cf_add_libs="$LIBS"
13088 # reverse order
13089 cf_add_0lib=
13090 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13091 # filter duplicates
13092 for cf_add_1lib in $cf_add_0lib; do
13093         for cf_add_2lib in $cf_add_libs; do
13094                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13095                         cf_add_1lib=
13096                         break
13097                 fi
13098         done
13099         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13100 done
13101 LIBS="$cf_add_libs"
13102
13103                                                         LIBS="$cf_save_xmu"
13104
13105 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13106
13107 echo "${as_me:-configure}:13107: testing ...before $LIBS ..." 1>&5
13108
13109 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13110 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13111
13112 echo "${as_me:-configure}:13112: testing ...after  $LIBS ..." 1>&5
13113
13114 else
13115         cf_pkgconfig_incs=
13116         cf_pkgconfig_libs=
13117
13118 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13119
13120 echo "${as_me:-configure}:13120: testing ...before $LIBS ..." 1>&5
13121
13122 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13123 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13124
13125 echo "${as_me:-configure}:13125: testing ...after  $LIBS ..." 1>&5
13126
13127 fi
13128
13129         for cf_trim_lib in Xmu Xt X11
13130         do
13131                 case "$LIBS" in
13132                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13133                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13134                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13135
13136 echo "${as_me:-configure}:13136: testing ..trimmed $LIBS ..." 1>&5
13137
13138                         ;;
13139                 esac
13140         done
13141
13142                                         ;;
13143                                 esac
13144                         fi
13145
13146                         break
13147 else
13148         cf_pkgconfig_incs=
13149         cf_pkgconfig_libs=
13150         :
13151 fi
13152
13153         done
13154 fi
13155
13156 if test -z "$cf_x_athena_lib" ; then
13157
13158 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
13159         test -n "$verbose" && echo "    found package Xext" 1>&6
13160
13161 echo "${as_me:-configure}:13161: testing found package Xext ..." 1>&5
13162
13163         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
13164         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
13165         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13166
13167 echo "${as_me:-configure}:13167: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13168
13169         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13170
13171 echo "${as_me:-configure}:13171: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13172
13173 cf_fix_cppflags=no
13174 cf_new_cflags=
13175 cf_new_cppflags=
13176 cf_new_extra_cppflags=
13177
13178 for cf_add_cflags in $cf_pkgconfig_incs
13179 do
13180 case $cf_fix_cppflags in
13181 (no)
13182         case $cf_add_cflags in
13183         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13184                 case $cf_add_cflags in
13185                 (-D*)
13186                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13187
13188                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13189                                 && test -z "${cf_tst_cflags}" \
13190                                 && cf_fix_cppflags=yes
13191
13192                         if test $cf_fix_cppflags = yes ; then
13193
13194         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13195         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13196
13197                                 continue
13198                         elif test "${cf_tst_cflags}" = "\"'" ; then
13199
13200         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13201         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13202
13203                                 continue
13204                         fi
13205                         ;;
13206                 esac
13207                 case "$CPPFLAGS" in
13208                 (*$cf_add_cflags)
13209                         ;;
13210                 (*)
13211                         case $cf_add_cflags in
13212                         (-D*)
13213                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13214
13215 CPPFLAGS=`echo "$CPPFLAGS" | \
13216         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13217                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13218
13219                                 ;;
13220                         esac
13221
13222         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13223         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13224
13225                         ;;
13226                 esac
13227                 ;;
13228         (*)
13229
13230         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13231         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13232
13233                 ;;
13234         esac
13235         ;;
13236 (yes)
13237
13238         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13239         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13240
13241         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13242
13243         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13244                 && test -z "${cf_tst_cflags}" \
13245                 && cf_fix_cppflags=no
13246         ;;
13247 esac
13248 done
13249
13250 if test -n "$cf_new_cflags" ; then
13251
13252         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13253         CFLAGS="${CFLAGS}$cf_new_cflags"
13254
13255 fi
13256
13257 if test -n "$cf_new_cppflags" ; then
13258
13259         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13260         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13261
13262 fi
13263
13264 if test -n "$cf_new_extra_cppflags" ; then
13265
13266         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13267         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13268
13269 fi
13270
13271 cf_add_libs="$LIBS"
13272 # reverse order
13273 cf_add_0lib=
13274 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13275 # filter duplicates
13276 for cf_add_1lib in $cf_add_0lib; do
13277         for cf_add_2lib in $cf_add_libs; do
13278                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13279                         cf_add_1lib=
13280                         break
13281                 fi
13282         done
13283         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13284 done
13285 LIBS="$cf_add_libs"
13286
13287         :
13288 else
13289         cf_pkgconfig_incs=
13290         cf_pkgconfig_libs=
13291
13292         echo "$as_me:13292: checking for XextCreateExtension in -lXext" >&5
13293 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13294 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13295   echo $ECHO_N "(cached) $ECHO_C" >&6
13296 else
13297   ac_check_lib_save_LIBS=$LIBS
13298 LIBS="-lXext  $LIBS"
13299 cat >conftest.$ac_ext <<_ACEOF
13300 #line 13300 "configure"
13301 #include "confdefs.h"
13302
13303 /* Override any gcc2 internal prototype to avoid an error.  */
13304 #ifdef __cplusplus
13305 extern "C"
13306 #endif
13307 /* We use char because int might match the return type of a gcc2
13308    builtin and then its argument prototype would still apply.  */
13309 char XextCreateExtension ();
13310 int
13311 main (void)
13312 {
13313 XextCreateExtension ();
13314   ;
13315   return 0;
13316 }
13317 _ACEOF
13318 rm -f conftest.$ac_objext conftest$ac_exeext
13319 if { (eval echo "$as_me:13319: \"$ac_link\"") >&5
13320   (eval $ac_link) 2>&5
13321   ac_status=$?
13322   echo "$as_me:13322: \$? = $ac_status" >&5
13323   (exit $ac_status); } &&
13324          { ac_try='test -s conftest$ac_exeext'
13325   { (eval echo "$as_me:13325: \"$ac_try\"") >&5
13326   (eval $ac_try) 2>&5
13327   ac_status=$?
13328   echo "$as_me:13328: \$? = $ac_status" >&5
13329   (exit $ac_status); }; }; then
13330   ac_cv_lib_Xext_XextCreateExtension=yes
13331 else
13332   echo "$as_me: failed program was:" >&5
13333 cat conftest.$ac_ext >&5
13334 ac_cv_lib_Xext_XextCreateExtension=no
13335 fi
13336 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13337 LIBS=$ac_check_lib_save_LIBS
13338 fi
13339 echo "$as_me:13339: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13340 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13341 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
13342
13343 cf_add_libs="$LIBS"
13344 # reverse order
13345 cf_add_0lib=
13346 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13347 # filter duplicates
13348 for cf_add_1lib in $cf_add_0lib; do
13349         for cf_add_2lib in $cf_add_libs; do
13350                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13351                         cf_add_1lib=
13352                         break
13353                 fi
13354         done
13355         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13356 done
13357 LIBS="$cf_add_libs"
13358
13359 fi
13360
13361 fi
13362
13363 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13364 # in some cases has installed dummy files in the former, other cases replaced
13365 # it with a link to the new location).  This complicates the configure script.
13366 # Check for that pitfall, and recover using pkg-config
13367 #
13368 # If none of these are set, the configuration is almost certainly broken.
13369 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13370 then
13371
13372 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13373         test -n "$verbose" && echo "    found package x11" 1>&6
13374
13375 echo "${as_me:-configure}:13375: testing found package x11 ..." 1>&5
13376
13377         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13378         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13379         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13380
13381 echo "${as_me:-configure}:13381: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13382
13383         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13384
13385 echo "${as_me:-configure}:13385: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13386
13387 cf_fix_cppflags=no
13388 cf_new_cflags=
13389 cf_new_cppflags=
13390 cf_new_extra_cppflags=
13391
13392 for cf_add_cflags in $cf_pkgconfig_incs
13393 do
13394 case $cf_fix_cppflags in
13395 (no)
13396         case $cf_add_cflags in
13397         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13398                 case $cf_add_cflags in
13399                 (-D*)
13400                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13401
13402                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13403                                 && test -z "${cf_tst_cflags}" \
13404                                 && cf_fix_cppflags=yes
13405
13406                         if test $cf_fix_cppflags = yes ; then
13407
13408         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13409         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13410
13411                                 continue
13412                         elif test "${cf_tst_cflags}" = "\"'" ; then
13413
13414         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13415         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13416
13417                                 continue
13418                         fi
13419                         ;;
13420                 esac
13421                 case "$CPPFLAGS" in
13422                 (*$cf_add_cflags)
13423                         ;;
13424                 (*)
13425                         case $cf_add_cflags in
13426                         (-D*)
13427                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13428
13429 CPPFLAGS=`echo "$CPPFLAGS" | \
13430         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13431                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13432
13433                                 ;;
13434                         esac
13435
13436         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13437         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13438
13439                         ;;
13440                 esac
13441                 ;;
13442         (*)
13443
13444         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13445         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13446
13447                 ;;
13448         esac
13449         ;;
13450 (yes)
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         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13456
13457         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13458                 && test -z "${cf_tst_cflags}" \
13459                 && cf_fix_cppflags=no
13460         ;;
13461 esac
13462 done
13463
13464 if test -n "$cf_new_cflags" ; then
13465
13466         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13467         CFLAGS="${CFLAGS}$cf_new_cflags"
13468
13469 fi
13470
13471 if test -n "$cf_new_cppflags" ; then
13472
13473         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13474         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13475
13476 fi
13477
13478 if test -n "$cf_new_extra_cppflags" ; then
13479
13480         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13481         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13482
13483 fi
13484
13485 cf_add_libs="$LIBS"
13486 # reverse order
13487 cf_add_0lib=
13488 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13489 # filter duplicates
13490 for cf_add_1lib in $cf_add_0lib; do
13491         for cf_add_2lib in $cf_add_libs; do
13492                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13493                         cf_add_1lib=
13494                         break
13495                 fi
13496         done
13497         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13498 done
13499 LIBS="$cf_add_libs"
13500
13501         :
13502 else
13503         cf_pkgconfig_incs=
13504         cf_pkgconfig_libs=
13505         { echo "$as_me:13505: WARNING: unable to find X11 library" >&5
13506 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13507 fi
13508
13509 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13510         test -n "$verbose" && echo "    found package ice" 1>&6
13511
13512 echo "${as_me:-configure}:13512: testing found package ice ..." 1>&5
13513
13514         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13515         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13516         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13517
13518 echo "${as_me:-configure}:13518: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13519
13520         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13521
13522 echo "${as_me:-configure}:13522: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13523
13524 cf_fix_cppflags=no
13525 cf_new_cflags=
13526 cf_new_cppflags=
13527 cf_new_extra_cppflags=
13528
13529 for cf_add_cflags in $cf_pkgconfig_incs
13530 do
13531 case $cf_fix_cppflags in
13532 (no)
13533         case $cf_add_cflags in
13534         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13535                 case $cf_add_cflags in
13536                 (-D*)
13537                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13538
13539                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13540                                 && test -z "${cf_tst_cflags}" \
13541                                 && cf_fix_cppflags=yes
13542
13543                         if test $cf_fix_cppflags = yes ; then
13544
13545         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13546         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13547
13548                                 continue
13549                         elif test "${cf_tst_cflags}" = "\"'" ; then
13550
13551         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13552         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13553
13554                                 continue
13555                         fi
13556                         ;;
13557                 esac
13558                 case "$CPPFLAGS" in
13559                 (*$cf_add_cflags)
13560                         ;;
13561                 (*)
13562                         case $cf_add_cflags in
13563                         (-D*)
13564                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13565
13566 CPPFLAGS=`echo "$CPPFLAGS" | \
13567         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13568                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13569
13570                                 ;;
13571                         esac
13572
13573         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13574         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13575
13576                         ;;
13577                 esac
13578                 ;;
13579         (*)
13580
13581         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13582         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13583
13584                 ;;
13585         esac
13586         ;;
13587 (yes)
13588
13589         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13590         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13591
13592         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13593
13594         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13595                 && test -z "${cf_tst_cflags}" \
13596                 && cf_fix_cppflags=no
13597         ;;
13598 esac
13599 done
13600
13601 if test -n "$cf_new_cflags" ; then
13602
13603         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13604         CFLAGS="${CFLAGS}$cf_new_cflags"
13605
13606 fi
13607
13608 if test -n "$cf_new_cppflags" ; then
13609
13610         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13611         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13612
13613 fi
13614
13615 if test -n "$cf_new_extra_cppflags" ; then
13616
13617         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13618         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13619
13620 fi
13621
13622 cf_add_libs="$LIBS"
13623 # reverse order
13624 cf_add_0lib=
13625 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13626 # filter duplicates
13627 for cf_add_1lib in $cf_add_0lib; do
13628         for cf_add_2lib in $cf_add_libs; do
13629                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13630                         cf_add_1lib=
13631                         break
13632                 fi
13633         done
13634         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13635 done
13636 LIBS="$cf_add_libs"
13637
13638         :
13639 else
13640         cf_pkgconfig_incs=
13641         cf_pkgconfig_libs=
13642         { echo "$as_me:13642: WARNING: unable to find ICE library" >&5
13643 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13644 fi
13645
13646 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13647         test -n "$verbose" && echo "    found package sm" 1>&6
13648
13649 echo "${as_me:-configure}:13649: testing found package sm ..." 1>&5
13650
13651         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13652         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13653         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13654
13655 echo "${as_me:-configure}:13655: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13656
13657         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13658
13659 echo "${as_me:-configure}:13659: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13660
13661 cf_fix_cppflags=no
13662 cf_new_cflags=
13663 cf_new_cppflags=
13664 cf_new_extra_cppflags=
13665
13666 for cf_add_cflags in $cf_pkgconfig_incs
13667 do
13668 case $cf_fix_cppflags in
13669 (no)
13670         case $cf_add_cflags in
13671         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13672                 case $cf_add_cflags in
13673                 (-D*)
13674                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13675
13676                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13677                                 && test -z "${cf_tst_cflags}" \
13678                                 && cf_fix_cppflags=yes
13679
13680                         if test $cf_fix_cppflags = yes ; then
13681
13682         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13683         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13684
13685                                 continue
13686                         elif test "${cf_tst_cflags}" = "\"'" ; then
13687
13688         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13689         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13690
13691                                 continue
13692                         fi
13693                         ;;
13694                 esac
13695                 case "$CPPFLAGS" in
13696                 (*$cf_add_cflags)
13697                         ;;
13698                 (*)
13699                         case $cf_add_cflags in
13700                         (-D*)
13701                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13702
13703 CPPFLAGS=`echo "$CPPFLAGS" | \
13704         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13705                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13706
13707                                 ;;
13708                         esac
13709
13710         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13711         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13712
13713                         ;;
13714                 esac
13715                 ;;
13716         (*)
13717
13718         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13719         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13720
13721                 ;;
13722         esac
13723         ;;
13724 (yes)
13725
13726         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13727         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13728
13729         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13730
13731         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13732                 && test -z "${cf_tst_cflags}" \
13733                 && cf_fix_cppflags=no
13734         ;;
13735 esac
13736 done
13737
13738 if test -n "$cf_new_cflags" ; then
13739
13740         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13741         CFLAGS="${CFLAGS}$cf_new_cflags"
13742
13743 fi
13744
13745 if test -n "$cf_new_cppflags" ; then
13746
13747         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13748         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13749
13750 fi
13751
13752 if test -n "$cf_new_extra_cppflags" ; then
13753
13754         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13755         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13756
13757 fi
13758
13759 cf_add_libs="$LIBS"
13760 # reverse order
13761 cf_add_0lib=
13762 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13763 # filter duplicates
13764 for cf_add_1lib in $cf_add_0lib; do
13765         for cf_add_2lib in $cf_add_libs; do
13766                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13767                         cf_add_1lib=
13768                         break
13769                 fi
13770         done
13771         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13772 done
13773 LIBS="$cf_add_libs"
13774
13775         :
13776 else
13777         cf_pkgconfig_incs=
13778         cf_pkgconfig_libs=
13779         { echo "$as_me:13779: WARNING: unable to find SM library" >&5
13780 echo "$as_me: WARNING: unable to find SM library" >&2;}
13781 fi
13782
13783 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13784         test -n "$verbose" && echo "    found package xt" 1>&6
13785
13786 echo "${as_me:-configure}:13786: testing found package xt ..." 1>&5
13787
13788         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13789         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13790         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13791
13792 echo "${as_me:-configure}:13792: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13793
13794         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13795
13796 echo "${as_me:-configure}:13796: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13797
13798 cf_fix_cppflags=no
13799 cf_new_cflags=
13800 cf_new_cppflags=
13801 cf_new_extra_cppflags=
13802
13803 for cf_add_cflags in $cf_pkgconfig_incs
13804 do
13805 case $cf_fix_cppflags in
13806 (no)
13807         case $cf_add_cflags in
13808         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13809                 case $cf_add_cflags in
13810                 (-D*)
13811                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13812
13813                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13814                                 && test -z "${cf_tst_cflags}" \
13815                                 && cf_fix_cppflags=yes
13816
13817                         if test $cf_fix_cppflags = yes ; then
13818
13819         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13820         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13821
13822                                 continue
13823                         elif test "${cf_tst_cflags}" = "\"'" ; then
13824
13825         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13826         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13827
13828                                 continue
13829                         fi
13830                         ;;
13831                 esac
13832                 case "$CPPFLAGS" in
13833                 (*$cf_add_cflags)
13834                         ;;
13835                 (*)
13836                         case $cf_add_cflags in
13837                         (-D*)
13838                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13839
13840 CPPFLAGS=`echo "$CPPFLAGS" | \
13841         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13842                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13843
13844                                 ;;
13845                         esac
13846
13847         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13848         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13849
13850                         ;;
13851                 esac
13852                 ;;
13853         (*)
13854
13855         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13856         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13857
13858                 ;;
13859         esac
13860         ;;
13861 (yes)
13862
13863         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13864         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13865
13866         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13867
13868         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13869                 && test -z "${cf_tst_cflags}" \
13870                 && cf_fix_cppflags=no
13871         ;;
13872 esac
13873 done
13874
13875 if test -n "$cf_new_cflags" ; then
13876
13877         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13878         CFLAGS="${CFLAGS}$cf_new_cflags"
13879
13880 fi
13881
13882 if test -n "$cf_new_cppflags" ; then
13883
13884         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13885         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13886
13887 fi
13888
13889 if test -n "$cf_new_extra_cppflags" ; then
13890
13891         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13892         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13893
13894 fi
13895
13896 cf_add_libs="$LIBS"
13897 # reverse order
13898 cf_add_0lib=
13899 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13900 # filter duplicates
13901 for cf_add_1lib in $cf_add_0lib; do
13902         for cf_add_2lib in $cf_add_libs; do
13903                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13904                         cf_add_1lib=
13905                         break
13906                 fi
13907         done
13908         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13909 done
13910 LIBS="$cf_add_libs"
13911
13912         :
13913 else
13914         cf_pkgconfig_incs=
13915         cf_pkgconfig_libs=
13916         { echo "$as_me:13916: WARNING: unable to find Xt library" >&5
13917 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13918 fi
13919
13920 else
13921         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13922 fi
13923
13924 cf_have_X_LIBS=no
13925
13926 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13927         test -n "$verbose" && echo "    found package xt" 1>&6
13928
13929 echo "${as_me:-configure}:13929: testing found package xt ..." 1>&5
13930
13931         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13932         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13933         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13934
13935 echo "${as_me:-configure}:13935: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13936
13937         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13938
13939 echo "${as_me:-configure}:13939: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13940
13941 cf_fix_cppflags=no
13942 cf_new_cflags=
13943 cf_new_cppflags=
13944 cf_new_extra_cppflags=
13945
13946 for cf_add_cflags in $cf_pkgconfig_incs
13947 do
13948 case $cf_fix_cppflags in
13949 (no)
13950         case $cf_add_cflags in
13951         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13952                 case $cf_add_cflags in
13953                 (-D*)
13954                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13955
13956                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13957                                 && test -z "${cf_tst_cflags}" \
13958                                 && cf_fix_cppflags=yes
13959
13960                         if test $cf_fix_cppflags = yes ; then
13961
13962         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13963         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13964
13965                                 continue
13966                         elif test "${cf_tst_cflags}" = "\"'" ; then
13967
13968         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13969         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13970
13971                                 continue
13972                         fi
13973                         ;;
13974                 esac
13975                 case "$CPPFLAGS" in
13976                 (*$cf_add_cflags)
13977                         ;;
13978                 (*)
13979                         case $cf_add_cflags in
13980                         (-D*)
13981                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13982
13983 CPPFLAGS=`echo "$CPPFLAGS" | \
13984         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13985                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13986
13987                                 ;;
13988                         esac
13989
13990         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13991         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13992
13993                         ;;
13994                 esac
13995                 ;;
13996         (*)
13997
13998         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13999         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14000
14001                 ;;
14002         esac
14003         ;;
14004 (yes)
14005
14006         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14007         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14008
14009         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14010
14011         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14012                 && test -z "${cf_tst_cflags}" \
14013                 && cf_fix_cppflags=no
14014         ;;
14015 esac
14016 done
14017
14018 if test -n "$cf_new_cflags" ; then
14019
14020         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14021         CFLAGS="${CFLAGS}$cf_new_cflags"
14022
14023 fi
14024
14025 if test -n "$cf_new_cppflags" ; then
14026
14027         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14028         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14029
14030 fi
14031
14032 if test -n "$cf_new_extra_cppflags" ; then
14033
14034         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14035         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14036
14037 fi
14038
14039 cf_add_libs="$LIBS"
14040 # reverse order
14041 cf_add_0lib=
14042 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14043 # filter duplicates
14044 for cf_add_1lib in $cf_add_0lib; do
14045         for cf_add_2lib in $cf_add_libs; do
14046                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14047                         cf_add_1lib=
14048                         break
14049                 fi
14050         done
14051         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14052 done
14053 LIBS="$cf_add_libs"
14054
14055         case "x$LIBS" in
14056         (*-lX11*)
14057                 ;;
14058         (*)
14059 # we have an "xt" package, but it may omit Xt's dependency on X11
14060 echo "$as_me:14060: checking for usable X dependency" >&5
14061 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14062 if test "${cf_cv_xt_x11_compat+set}" = set; then
14063   echo $ECHO_N "(cached) $ECHO_C" >&6
14064 else
14065
14066 cat >conftest.$ac_ext <<_ACEOF
14067 #line 14067 "configure"
14068 #include "confdefs.h"
14069
14070 #include <X11/Xlib.h>
14071
14072 int
14073 main (void)
14074 {
14075
14076         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14077         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14078         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14079         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14080
14081   ;
14082   return 0;
14083 }
14084 _ACEOF
14085 rm -f conftest.$ac_objext conftest$ac_exeext
14086 if { (eval echo "$as_me:14086: \"$ac_link\"") >&5
14087   (eval $ac_link) 2>&5
14088   ac_status=$?
14089   echo "$as_me:14089: \$? = $ac_status" >&5
14090   (exit $ac_status); } &&
14091          { ac_try='test -s conftest$ac_exeext'
14092   { (eval echo "$as_me:14092: \"$ac_try\"") >&5
14093   (eval $ac_try) 2>&5
14094   ac_status=$?
14095   echo "$as_me:14095: \$? = $ac_status" >&5
14096   (exit $ac_status); }; }; then
14097   cf_cv_xt_x11_compat=yes
14098 else
14099   echo "$as_me: failed program was:" >&5
14100 cat conftest.$ac_ext >&5
14101 cf_cv_xt_x11_compat=no
14102 fi
14103 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14104 fi
14105 echo "$as_me:14105: result: $cf_cv_xt_x11_compat" >&5
14106 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14107                 if test "$cf_cv_xt_x11_compat" = no
14108                 then
14109                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14110
14111 echo "${as_me:-configure}:14111: testing work around broken X11 dependency ..." 1>&5
14112
14113                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14114
14115 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
14116         test -n "$verbose" && echo "    found package x11" 1>&6
14117
14118 echo "${as_me:-configure}:14118: testing found package x11 ..." 1>&5
14119
14120         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
14121         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
14122         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14123
14124 echo "${as_me:-configure}:14124: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14125
14126         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14127
14128 echo "${as_me:-configure}:14128: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14129
14130 cf_fix_cppflags=no
14131 cf_new_cflags=
14132 cf_new_cppflags=
14133 cf_new_extra_cppflags=
14134
14135 for cf_add_cflags in $cf_pkgconfig_incs
14136 do
14137 case $cf_fix_cppflags in
14138 (no)
14139         case $cf_add_cflags in
14140         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14141                 case $cf_add_cflags in
14142                 (-D*)
14143                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14144
14145                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14146                                 && test -z "${cf_tst_cflags}" \
14147                                 && cf_fix_cppflags=yes
14148
14149                         if test $cf_fix_cppflags = yes ; then
14150
14151         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14152         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14153
14154                                 continue
14155                         elif test "${cf_tst_cflags}" = "\"'" ; then
14156
14157         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14158         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14159
14160                                 continue
14161                         fi
14162                         ;;
14163                 esac
14164                 case "$CPPFLAGS" in
14165                 (*$cf_add_cflags)
14166                         ;;
14167                 (*)
14168                         case $cf_add_cflags in
14169                         (-D*)
14170                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14171
14172 CPPFLAGS=`echo "$CPPFLAGS" | \
14173         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14174                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14175
14176                                 ;;
14177                         esac
14178
14179         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14180         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14181
14182                         ;;
14183                 esac
14184                 ;;
14185         (*)
14186
14187         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14188         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14189
14190                 ;;
14191         esac
14192         ;;
14193 (yes)
14194
14195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14197
14198         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14199
14200         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14201                 && test -z "${cf_tst_cflags}" \
14202                 && cf_fix_cppflags=no
14203         ;;
14204 esac
14205 done
14206
14207 if test -n "$cf_new_cflags" ; then
14208
14209         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14210         CFLAGS="${CFLAGS}$cf_new_cflags"
14211
14212 fi
14213
14214 if test -n "$cf_new_cppflags" ; then
14215
14216         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14217         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14218
14219 fi
14220
14221 if test -n "$cf_new_extra_cppflags" ; then
14222
14223         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14224         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14225
14226 fi
14227
14228 cf_add_libs="$LIBS"
14229 # reverse order
14230 cf_add_0lib=
14231 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14232 # filter duplicates
14233 for cf_add_1lib in $cf_add_0lib; do
14234         for cf_add_2lib in $cf_add_libs; do
14235                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14236                         cf_add_1lib=
14237                         break
14238                 fi
14239         done
14240         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14241 done
14242 LIBS="$cf_add_libs"
14243
14244         :
14245 else
14246         cf_pkgconfig_incs=
14247         cf_pkgconfig_libs=
14248
14249 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14250
14251 echo "${as_me:-configure}:14251: testing ...before $LIBS ..." 1>&5
14252
14253 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14254 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14255
14256 echo "${as_me:-configure}:14256: testing ...after  $LIBS ..." 1>&5
14257
14258 fi
14259
14260                 fi
14261                 ;;
14262         esac
14263
14264 echo "$as_me:14264: checking for usable X Toolkit package" >&5
14265 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14266 if test "${cf_cv_xt_ice_compat+set}" = set; then
14267   echo $ECHO_N "(cached) $ECHO_C" >&6
14268 else
14269
14270 cat >conftest.$ac_ext <<_ACEOF
14271 #line 14271 "configure"
14272 #include "confdefs.h"
14273
14274 #include <X11/Shell.h>
14275
14276 int
14277 main (void)
14278 {
14279 int num = IceConnectionNumber(0); (void) num
14280
14281   ;
14282   return 0;
14283 }
14284 _ACEOF
14285 rm -f conftest.$ac_objext conftest$ac_exeext
14286 if { (eval echo "$as_me:14286: \"$ac_link\"") >&5
14287   (eval $ac_link) 2>&5
14288   ac_status=$?
14289   echo "$as_me:14289: \$? = $ac_status" >&5
14290   (exit $ac_status); } &&
14291          { ac_try='test -s conftest$ac_exeext'
14292   { (eval echo "$as_me:14292: \"$ac_try\"") >&5
14293   (eval $ac_try) 2>&5
14294   ac_status=$?
14295   echo "$as_me:14295: \$? = $ac_status" >&5
14296   (exit $ac_status); }; }; then
14297   cf_cv_xt_ice_compat=yes
14298 else
14299   echo "$as_me: failed program was:" >&5
14300 cat conftest.$ac_ext >&5
14301 cf_cv_xt_ice_compat=no
14302 fi
14303 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14304 fi
14305 echo "$as_me:14305: result: $cf_cv_xt_ice_compat" >&5
14306 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14307
14308         if test "$cf_cv_xt_ice_compat" = no
14309         then
14310                 # workaround for broken ".pc" files used for X Toolkit.
14311                 case "x$X_PRE_LIBS" in
14312                 (*-lICE*)
14313                         case "x$LIBS" in
14314                         (*-lICE*)
14315                                 ;;
14316                         (*)
14317                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14318
14319 echo "${as_me:-configure}:14319: testing work around broken ICE dependency ..." 1>&5
14320
14321 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
14322         test -n "$verbose" && echo "    found package ice" 1>&6
14323
14324 echo "${as_me:-configure}:14324: testing found package ice ..." 1>&5
14325
14326         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
14327         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
14328         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14329
14330 echo "${as_me:-configure}:14330: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14331
14332         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14333
14334 echo "${as_me:-configure}:14334: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14335
14336 cf_fix_cppflags=no
14337 cf_new_cflags=
14338 cf_new_cppflags=
14339 cf_new_extra_cppflags=
14340
14341 for cf_add_cflags in $cf_pkgconfig_incs
14342 do
14343 case $cf_fix_cppflags in
14344 (no)
14345         case $cf_add_cflags in
14346         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14347                 case $cf_add_cflags in
14348                 (-D*)
14349                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14350
14351                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14352                                 && test -z "${cf_tst_cflags}" \
14353                                 && cf_fix_cppflags=yes
14354
14355                         if test $cf_fix_cppflags = yes ; then
14356
14357         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14358         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14359
14360                                 continue
14361                         elif test "${cf_tst_cflags}" = "\"'" ; then
14362
14363         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14364         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14365
14366                                 continue
14367                         fi
14368                         ;;
14369                 esac
14370                 case "$CPPFLAGS" in
14371                 (*$cf_add_cflags)
14372                         ;;
14373                 (*)
14374                         case $cf_add_cflags in
14375                         (-D*)
14376                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14377
14378 CPPFLAGS=`echo "$CPPFLAGS" | \
14379         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14380                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14381
14382                                 ;;
14383                         esac
14384
14385         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14386         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14387
14388                         ;;
14389                 esac
14390                 ;;
14391         (*)
14392
14393         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14394         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14395
14396                 ;;
14397         esac
14398         ;;
14399 (yes)
14400
14401         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14402         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14403
14404         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14405
14406         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14407                 && test -z "${cf_tst_cflags}" \
14408                 && cf_fix_cppflags=no
14409         ;;
14410 esac
14411 done
14412
14413 if test -n "$cf_new_cflags" ; then
14414
14415         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14416         CFLAGS="${CFLAGS}$cf_new_cflags"
14417
14418 fi
14419
14420 if test -n "$cf_new_cppflags" ; then
14421
14422         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14423         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14424
14425 fi
14426
14427 if test -n "$cf_new_extra_cppflags" ; then
14428
14429         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14430         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14431
14432 fi
14433
14434 cf_add_libs="$LIBS"
14435 # reverse order
14436 cf_add_0lib=
14437 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14438 # filter duplicates
14439 for cf_add_1lib in $cf_add_0lib; do
14440         for cf_add_2lib in $cf_add_libs; do
14441                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14442                         cf_add_1lib=
14443                         break
14444                 fi
14445         done
14446         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14447 done
14448 LIBS="$cf_add_libs"
14449
14450 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
14451         test -n "$verbose" && echo "    found package sm" 1>&6
14452
14453 echo "${as_me:-configure}:14453: testing found package sm ..." 1>&5
14454
14455         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
14456         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
14457         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14458
14459 echo "${as_me:-configure}:14459: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14460
14461         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14462
14463 echo "${as_me:-configure}:14463: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14464
14465 cf_fix_cppflags=no
14466 cf_new_cflags=
14467 cf_new_cppflags=
14468 cf_new_extra_cppflags=
14469
14470 for cf_add_cflags in $cf_pkgconfig_incs
14471 do
14472 case $cf_fix_cppflags in
14473 (no)
14474         case $cf_add_cflags in
14475         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14476                 case $cf_add_cflags in
14477                 (-D*)
14478                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14479
14480                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14481                                 && test -z "${cf_tst_cflags}" \
14482                                 && cf_fix_cppflags=yes
14483
14484                         if test $cf_fix_cppflags = yes ; then
14485
14486         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14487         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14488
14489                                 continue
14490                         elif test "${cf_tst_cflags}" = "\"'" ; then
14491
14492         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14493         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14494
14495                                 continue
14496                         fi
14497                         ;;
14498                 esac
14499                 case "$CPPFLAGS" in
14500                 (*$cf_add_cflags)
14501                         ;;
14502                 (*)
14503                         case $cf_add_cflags in
14504                         (-D*)
14505                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14506
14507 CPPFLAGS=`echo "$CPPFLAGS" | \
14508         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14509                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14510
14511                                 ;;
14512                         esac
14513
14514         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14515         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14516
14517                         ;;
14518                 esac
14519                 ;;
14520         (*)
14521
14522         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14523         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14524
14525                 ;;
14526         esac
14527         ;;
14528 (yes)
14529
14530         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14531         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14532
14533         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14534
14535         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14536                 && test -z "${cf_tst_cflags}" \
14537                 && cf_fix_cppflags=no
14538         ;;
14539 esac
14540 done
14541
14542 if test -n "$cf_new_cflags" ; then
14543
14544         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14545         CFLAGS="${CFLAGS}$cf_new_cflags"
14546
14547 fi
14548
14549 if test -n "$cf_new_cppflags" ; then
14550
14551         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14552         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14553
14554 fi
14555
14556 if test -n "$cf_new_extra_cppflags" ; then
14557
14558         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14559         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14560
14561 fi
14562
14563 cf_add_libs="$LIBS"
14564 # reverse order
14565 cf_add_0lib=
14566 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14567 # filter duplicates
14568 for cf_add_1lib in $cf_add_0lib; do
14569         for cf_add_2lib in $cf_add_libs; do
14570                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14571                         cf_add_1lib=
14572                         break
14573                 fi
14574         done
14575         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14576 done
14577 LIBS="$cf_add_libs"
14578
14579         :
14580 else
14581         cf_pkgconfig_incs=
14582         cf_pkgconfig_libs=
14583         :
14584 fi
14585
14586 else
14587         cf_pkgconfig_incs=
14588         cf_pkgconfig_libs=
14589
14590 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14591
14592 echo "${as_me:-configure}:14592: testing ...before $LIBS ..." 1>&5
14593
14594 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14595 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14596
14597 echo "${as_me:-configure}:14597: testing ...after  $LIBS ..." 1>&5
14598
14599 fi
14600
14601                                 ;;
14602                         esac
14603                         ;;
14604                 esac
14605         fi
14606
14607         cf_have_X_LIBS=yes
14608
14609 else
14610         cf_pkgconfig_incs=
14611         cf_pkgconfig_libs=
14612
14613         LDFLAGS="$X_LIBS $LDFLAGS"
14614
14615 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14616
14617 echo "${as_me:-configure}:14617: testing checking additions to CFLAGS ..." 1>&5
14618
14619 cf_check_cflags="$CFLAGS"
14620 cf_check_cppflags="$CPPFLAGS"
14621
14622 cf_fix_cppflags=no
14623 cf_new_cflags=
14624 cf_new_cppflags=
14625 cf_new_extra_cppflags=
14626
14627 for cf_add_cflags in $X_CFLAGS
14628 do
14629 case $cf_fix_cppflags in
14630 (no)
14631         case $cf_add_cflags in
14632         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14633                 case $cf_add_cflags in
14634                 (-D*)
14635                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14636
14637                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14638                                 && test -z "${cf_tst_cflags}" \
14639                                 && cf_fix_cppflags=yes
14640
14641                         if test $cf_fix_cppflags = yes ; then
14642
14643         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14644         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14645
14646                                 continue
14647                         elif test "${cf_tst_cflags}" = "\"'" ; then
14648
14649         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14650         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14651
14652                                 continue
14653                         fi
14654                         ;;
14655                 esac
14656                 case "$CPPFLAGS" in
14657                 (*$cf_add_cflags)
14658                         ;;
14659                 (*)
14660                         case $cf_add_cflags in
14661                         (-D*)
14662                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14663
14664 CPPFLAGS=`echo "$CPPFLAGS" | \
14665         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14666                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14667
14668                                 ;;
14669                         esac
14670
14671         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14672         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14673
14674                         ;;
14675                 esac
14676                 ;;
14677         (*)
14678
14679         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14680         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14681
14682                 ;;
14683         esac
14684         ;;
14685 (yes)
14686
14687         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14688         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14689
14690         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14691
14692         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14693                 && test -z "${cf_tst_cflags}" \
14694                 && cf_fix_cppflags=no
14695         ;;
14696 esac
14697 done
14698
14699 if test -n "$cf_new_cflags" ; then
14700         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14701
14702 echo "${as_me:-configure}:14702: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14703
14704         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14705         CFLAGS="${CFLAGS}$cf_new_cflags"
14706
14707 fi
14708
14709 if test -n "$cf_new_cppflags" ; then
14710         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14711
14712 echo "${as_me:-configure}:14712: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14713
14714         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14715         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14716
14717 fi
14718
14719 if test -n "$cf_new_extra_cppflags" ; then
14720         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14721
14722 echo "${as_me:-configure}:14722: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14723
14724         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14725         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14726
14727 fi
14728
14729 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14730 cat >conftest.$ac_ext <<_ACEOF
14731 #line 14731 "configure"
14732 #include "confdefs.h"
14733 #include <stdio.h>
14734 int
14735 main (void)
14736 {
14737 printf("Hello world");
14738   ;
14739   return 0;
14740 }
14741 _ACEOF
14742 rm -f conftest.$ac_objext conftest$ac_exeext
14743 if { (eval echo "$as_me:14743: \"$ac_link\"") >&5
14744   (eval $ac_link) 2>&5
14745   ac_status=$?
14746   echo "$as_me:14746: \$? = $ac_status" >&5
14747   (exit $ac_status); } &&
14748          { ac_try='test -s conftest$ac_exeext'
14749   { (eval echo "$as_me:14749: \"$ac_try\"") >&5
14750   (eval $ac_try) 2>&5
14751   ac_status=$?
14752   echo "$as_me:14752: \$? = $ac_status" >&5
14753   (exit $ac_status); }; }; then
14754   :
14755 else
14756   echo "$as_me: failed program was:" >&5
14757 cat conftest.$ac_ext >&5
14758 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14759
14760 echo "${as_me:-configure}:14760: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14761
14762          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14763                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14764
14765 echo "${as_me:-configure}:14765: testing but keeping change to \$CPPFLAGS ..." 1>&5
14766
14767          fi
14768          CFLAGS="$cf_check_flags"
14769 fi
14770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14771 fi
14772
14773         echo "$as_me:14773: checking for XOpenDisplay" >&5
14774 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14775 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14776   echo $ECHO_N "(cached) $ECHO_C" >&6
14777 else
14778   cat >conftest.$ac_ext <<_ACEOF
14779 #line 14779 "configure"
14780 #include "confdefs.h"
14781 #define XOpenDisplay autoconf_temporary
14782 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14783 #undef XOpenDisplay
14784
14785 #ifdef __cplusplus
14786 extern "C"
14787 #endif
14788
14789 /* We use char because int might match the return type of a gcc2
14790    builtin and then its argument prototype would still apply.  */
14791 char XOpenDisplay (void);
14792
14793 int
14794 main (void)
14795 {
14796
14797 /* The GNU C library defines stubs for functions which it implements
14798     to always fail with ENOSYS.  Some functions are actually named
14799     something starting with __ and the normal name is an alias.  */
14800 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14801 #error found stub for XOpenDisplay
14802 #endif
14803
14804         return XOpenDisplay ();
14805   ;
14806   return 0;
14807 }
14808 _ACEOF
14809 rm -f conftest.$ac_objext conftest$ac_exeext
14810 if { (eval echo "$as_me:14810: \"$ac_link\"") >&5
14811   (eval $ac_link) 2>&5
14812   ac_status=$?
14813   echo "$as_me:14813: \$? = $ac_status" >&5
14814   (exit $ac_status); } &&
14815          { ac_try='test -s conftest$ac_exeext'
14816   { (eval echo "$as_me:14816: \"$ac_try\"") >&5
14817   (eval $ac_try) 2>&5
14818   ac_status=$?
14819   echo "$as_me:14819: \$? = $ac_status" >&5
14820   (exit $ac_status); }; }; then
14821   ac_cv_func_XOpenDisplay=yes
14822 else
14823   echo "$as_me: failed program was:" >&5
14824 cat conftest.$ac_ext >&5
14825 ac_cv_func_XOpenDisplay=no
14826 fi
14827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14828 fi
14829 echo "$as_me:14829: result: $ac_cv_func_XOpenDisplay" >&5
14830 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14831 if test $ac_cv_func_XOpenDisplay = yes; then
14832   :
14833 else
14834
14835         echo "$as_me:14835: checking for XOpenDisplay in -lX11" >&5
14836 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14837 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14838   echo $ECHO_N "(cached) $ECHO_C" >&6
14839 else
14840   ac_check_lib_save_LIBS=$LIBS
14841 LIBS="-lX11  $LIBS"
14842 cat >conftest.$ac_ext <<_ACEOF
14843 #line 14843 "configure"
14844 #include "confdefs.h"
14845
14846 /* Override any gcc2 internal prototype to avoid an error.  */
14847 #ifdef __cplusplus
14848 extern "C"
14849 #endif
14850 /* We use char because int might match the return type of a gcc2
14851    builtin and then its argument prototype would still apply.  */
14852 char XOpenDisplay ();
14853 int
14854 main (void)
14855 {
14856 XOpenDisplay ();
14857   ;
14858   return 0;
14859 }
14860 _ACEOF
14861 rm -f conftest.$ac_objext conftest$ac_exeext
14862 if { (eval echo "$as_me:14862: \"$ac_link\"") >&5
14863   (eval $ac_link) 2>&5
14864   ac_status=$?
14865   echo "$as_me:14865: \$? = $ac_status" >&5
14866   (exit $ac_status); } &&
14867          { ac_try='test -s conftest$ac_exeext'
14868   { (eval echo "$as_me:14868: \"$ac_try\"") >&5
14869   (eval $ac_try) 2>&5
14870   ac_status=$?
14871   echo "$as_me:14871: \$? = $ac_status" >&5
14872   (exit $ac_status); }; }; then
14873   ac_cv_lib_X11_XOpenDisplay=yes
14874 else
14875   echo "$as_me: failed program was:" >&5
14876 cat conftest.$ac_ext >&5
14877 ac_cv_lib_X11_XOpenDisplay=no
14878 fi
14879 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14880 LIBS=$ac_check_lib_save_LIBS
14881 fi
14882 echo "$as_me:14882: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14883 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14884 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14885
14886 cf_add_libs="$LIBS"
14887 # reverse order
14888 cf_add_0lib=
14889 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14890 # filter duplicates
14891 for cf_add_1lib in $cf_add_0lib; do
14892         for cf_add_2lib in $cf_add_libs; do
14893                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14894                         cf_add_1lib=
14895                         break
14896                 fi
14897         done
14898         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14899 done
14900 LIBS="$cf_add_libs"
14901
14902 fi
14903
14904 fi
14905
14906         echo "$as_me:14906: checking for XtAppInitialize" >&5
14907 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14908 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14909   echo $ECHO_N "(cached) $ECHO_C" >&6
14910 else
14911   cat >conftest.$ac_ext <<_ACEOF
14912 #line 14912 "configure"
14913 #include "confdefs.h"
14914 #define XtAppInitialize autoconf_temporary
14915 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14916 #undef XtAppInitialize
14917
14918 #ifdef __cplusplus
14919 extern "C"
14920 #endif
14921
14922 /* We use char because int might match the return type of a gcc2
14923    builtin and then its argument prototype would still apply.  */
14924 char XtAppInitialize (void);
14925
14926 int
14927 main (void)
14928 {
14929
14930 /* The GNU C library defines stubs for functions which it implements
14931     to always fail with ENOSYS.  Some functions are actually named
14932     something starting with __ and the normal name is an alias.  */
14933 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14934 #error found stub for XtAppInitialize
14935 #endif
14936
14937         return XtAppInitialize ();
14938   ;
14939   return 0;
14940 }
14941 _ACEOF
14942 rm -f conftest.$ac_objext conftest$ac_exeext
14943 if { (eval echo "$as_me:14943: \"$ac_link\"") >&5
14944   (eval $ac_link) 2>&5
14945   ac_status=$?
14946   echo "$as_me:14946: \$? = $ac_status" >&5
14947   (exit $ac_status); } &&
14948          { ac_try='test -s conftest$ac_exeext'
14949   { (eval echo "$as_me:14949: \"$ac_try\"") >&5
14950   (eval $ac_try) 2>&5
14951   ac_status=$?
14952   echo "$as_me:14952: \$? = $ac_status" >&5
14953   (exit $ac_status); }; }; then
14954   ac_cv_func_XtAppInitialize=yes
14955 else
14956   echo "$as_me: failed program was:" >&5
14957 cat conftest.$ac_ext >&5
14958 ac_cv_func_XtAppInitialize=no
14959 fi
14960 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14961 fi
14962 echo "$as_me:14962: result: $ac_cv_func_XtAppInitialize" >&5
14963 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14964 if test $ac_cv_func_XtAppInitialize = yes; then
14965   :
14966 else
14967
14968         echo "$as_me:14968: checking for XtAppInitialize in -lXt" >&5
14969 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14970 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14971   echo $ECHO_N "(cached) $ECHO_C" >&6
14972 else
14973   ac_check_lib_save_LIBS=$LIBS
14974 LIBS="-lXt  $LIBS"
14975 cat >conftest.$ac_ext <<_ACEOF
14976 #line 14976 "configure"
14977 #include "confdefs.h"
14978
14979 /* Override any gcc2 internal prototype to avoid an error.  */
14980 #ifdef __cplusplus
14981 extern "C"
14982 #endif
14983 /* We use char because int might match the return type of a gcc2
14984    builtin and then its argument prototype would still apply.  */
14985 char XtAppInitialize ();
14986 int
14987 main (void)
14988 {
14989 XtAppInitialize ();
14990   ;
14991   return 0;
14992 }
14993 _ACEOF
14994 rm -f conftest.$ac_objext conftest$ac_exeext
14995 if { (eval echo "$as_me:14995: \"$ac_link\"") >&5
14996   (eval $ac_link) 2>&5
14997   ac_status=$?
14998   echo "$as_me:14998: \$? = $ac_status" >&5
14999   (exit $ac_status); } &&
15000          { ac_try='test -s conftest$ac_exeext'
15001   { (eval echo "$as_me:15001: \"$ac_try\"") >&5
15002   (eval $ac_try) 2>&5
15003   ac_status=$?
15004   echo "$as_me:15004: \$? = $ac_status" >&5
15005   (exit $ac_status); }; }; then
15006   ac_cv_lib_Xt_XtAppInitialize=yes
15007 else
15008   echo "$as_me: failed program was:" >&5
15009 cat conftest.$ac_ext >&5
15010 ac_cv_lib_Xt_XtAppInitialize=no
15011 fi
15012 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15013 LIBS=$ac_check_lib_save_LIBS
15014 fi
15015 echo "$as_me:15015: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15016 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15017 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
15018
15019 cat >>confdefs.h <<\EOF
15020 #define HAVE_LIBXT 1
15021 EOF
15022
15023                  cf_have_X_LIBS=Xt
15024                  LIBS="-lXt $LIBS"
15025 fi
15026
15027 fi
15028
15029 fi
15030
15031 if test $cf_have_X_LIBS = no ; then
15032         { echo "$as_me:15032: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15033 test program.  You will have to check and add the proper libraries by hand
15034 to makefile." >&5
15035 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15036 test program.  You will have to check and add the proper libraries by hand
15037 to makefile." >&2;}
15038 fi
15039
15040 cf_x_athena_root=$cf_x_athena
15041 cf_x_athena_inc=""
15042
15043 for cf_path in default \
15044         /usr/contrib/X11R6 \
15045         /usr/contrib/X11R5 \
15046         /usr/lib/X11R5 \
15047         /usr/local
15048 do
15049         if test -z "$cf_x_athena_inc" ; then
15050
15051 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15052 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15053 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15054 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15055 for cf_X_CFLAGS in $X_CFLAGS
15056 do
15057         case "x$cf_X_CFLAGS" in
15058         x-[IUD]*)
15059                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15060                 ;;
15061         *)
15062                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15063                 ;;
15064         esac
15065 done
15066
15067                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15068                 if test $cf_path != default ; then
15069
15070         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15071         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15072
15073                         echo "$as_me:15073: checking for $cf_test in $cf_path" >&5
15074 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15075                 else
15076                         echo "$as_me:15076: checking for $cf_test" >&5
15077 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15078                 fi
15079                 cat >conftest.$ac_ext <<_ACEOF
15080 #line 15080 "configure"
15081 #include "confdefs.h"
15082
15083 #include <X11/Intrinsic.h>
15084 #include <$cf_test>
15085 int
15086 main (void)
15087 {
15088
15089   ;
15090   return 0;
15091 }
15092 _ACEOF
15093 rm -f conftest.$ac_objext
15094 if { (eval echo "$as_me:15094: \"$ac_compile\"") >&5
15095   (eval $ac_compile) 2>&5
15096   ac_status=$?
15097   echo "$as_me:15097: \$? = $ac_status" >&5
15098   (exit $ac_status); } &&
15099          { ac_try='test -s conftest.$ac_objext'
15100   { (eval echo "$as_me:15100: \"$ac_try\"") >&5
15101   (eval $ac_try) 2>&5
15102   ac_status=$?
15103   echo "$as_me:15103: \$? = $ac_status" >&5
15104   (exit $ac_status); }; }; then
15105   cf_result=yes
15106 else
15107   echo "$as_me: failed program was:" >&5
15108 cat conftest.$ac_ext >&5
15109 cf_result=no
15110 fi
15111 rm -f conftest.$ac_objext conftest.$ac_ext
15112                 echo "$as_me:15112: result: $cf_result" >&5
15113 echo "${ECHO_T}$cf_result" >&6
15114
15115 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15116 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15117 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15118
15119                 if test "$cf_result" = yes ; then
15120                         test "$cf_path"  = default && cf_x_athena_inc=default
15121                         test "$cf_path" != default && cf_x_athena_inc=$cf_path/include
15122                         break
15123                 fi
15124         fi
15125 done
15126
15127 if test -z "$cf_x_athena_inc" ; then
15128         { echo "$as_me:15128: WARNING: Unable to find Athena header files" >&5
15129 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15130 elif test "$cf_x_athena_inc" != default ; then
15131
15132         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15133         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15134
15135 fi
15136
15137 cf_x_athena_root=$cf_x_athena
15138 cf_x_athena_lib=""
15139
15140 for cf_path in default \
15141         /usr/contrib/X11R6 \
15142         /usr/contrib/X11R5 \
15143         /usr/lib/X11R5 \
15144         /usr/local
15145 do
15146         for cf_lib in \
15147                 ${cf_x_athena_root} \
15148                 ${cf_x_athena_root}7 \
15149                 ${cf_x_athena_root}6
15150         do
15151         for cf_libs in \
15152                 "-l$cf_lib -lXmu" \
15153                 "-l$cf_lib -lXpm -lXmu" \
15154                 "-l${cf_lib}_s -lXmu_s"
15155         do
15156                 test -n "$cf_x_athena_lib" && break
15157
15158 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15159 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15160 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15161 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15162 for cf_X_CFLAGS in $X_CFLAGS
15163 do
15164         case "x$cf_X_CFLAGS" in
15165         x-[IUD]*)
15166                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15167                 ;;
15168         *)
15169                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15170                 ;;
15171         esac
15172 done
15173
15174                 cf_test=XawSimpleMenuAddGlobalActions
15175                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15176
15177 cf_add_libs="$LIBS"
15178 # reverse order
15179 cf_add_0lib=
15180 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15181 # filter duplicates
15182 for cf_add_1lib in $cf_add_0lib; do
15183         for cf_add_2lib in $cf_add_libs; do
15184                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15185                         cf_add_1lib=
15186                         break
15187                 fi
15188         done
15189         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15190 done
15191 LIBS="$cf_add_libs"
15192
15193                 echo "$as_me:15193: checking for $cf_test in $cf_libs" >&5
15194 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15195                 cat >conftest.$ac_ext <<_ACEOF
15196 #line 15196 "configure"
15197 #include "confdefs.h"
15198
15199 #include <X11/Intrinsic.h>
15200 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15201
15202 int
15203 main (void)
15204 {
15205
15206 $cf_test((XtAppContext) 0)
15207   ;
15208   return 0;
15209 }
15210 _ACEOF
15211 rm -f conftest.$ac_objext conftest$ac_exeext
15212 if { (eval echo "$as_me:15212: \"$ac_link\"") >&5
15213   (eval $ac_link) 2>&5
15214   ac_status=$?
15215   echo "$as_me:15215: \$? = $ac_status" >&5
15216   (exit $ac_status); } &&
15217          { ac_try='test -s conftest$ac_exeext'
15218   { (eval echo "$as_me:15218: \"$ac_try\"") >&5
15219   (eval $ac_try) 2>&5
15220   ac_status=$?
15221   echo "$as_me:15221: \$? = $ac_status" >&5
15222   (exit $ac_status); }; }; then
15223   cf_result=yes
15224 else
15225   echo "$as_me: failed program was:" >&5
15226 cat conftest.$ac_ext >&5
15227 cf_result=no
15228 fi
15229 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15230                 echo "$as_me:15230: result: $cf_result" >&5
15231 echo "${ECHO_T}$cf_result" >&6
15232
15233 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15234 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15235 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15236
15237                 if test "$cf_result" = yes ; then
15238                         cf_x_athena_lib="$cf_libs"
15239                         break
15240                 fi
15241         done # cf_libs
15242                 test -n "$cf_x_athena_lib" && break
15243         done # cf_lib
15244 done
15245
15246 if test -z "$cf_x_athena_lib" ; then
15247         { { echo "$as_me:15247: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15248 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15249    { (exit 1); exit 1; }; }
15250 fi
15251
15252 cf_add_libs="$LIBS"
15253 # reverse order
15254 cf_add_0lib=
15255 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15256 # filter duplicates
15257 for cf_add_1lib in $cf_add_0lib; do
15258         for cf_add_2lib in $cf_add_libs; do
15259                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15260                         cf_add_1lib=
15261                         break
15262                 fi
15263         done
15264         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15265 done
15266 LIBS="$cf_add_libs"
15267
15268 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15269
15270 cat >>confdefs.h <<EOF
15271 #define $cf_x_athena_LIBS 1
15272 EOF
15273
15274 fi
15275
15276 if test -n "$ac_tool_prefix"; then
15277   for ac_prog in xcurses-config
15278   do
15279     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15280 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15281 echo "$as_me:15281: checking for $ac_word" >&5
15282 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15283 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15284   echo $ECHO_N "(cached) $ECHO_C" >&6
15285 else
15286   if test -n "$XCURSES_CONFIG"; then
15287   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15288 else
15289   ac_save_IFS=$IFS; IFS=$ac_path_separator
15290 ac_dummy="$PATH"
15291 for ac_dir in $ac_dummy; do
15292   IFS=$ac_save_IFS
15293   test -z "$ac_dir" && ac_dir=.
15294   $as_executable_p "$ac_dir/$ac_word" || continue
15295 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15296 echo "$as_me:15296: found $ac_dir/$ac_word" >&5
15297 break
15298 done
15299
15300 fi
15301 fi
15302 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15303 if test -n "$XCURSES_CONFIG"; then
15304   echo "$as_me:15304: result: $XCURSES_CONFIG" >&5
15305 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15306 else
15307   echo "$as_me:15307: result: no" >&5
15308 echo "${ECHO_T}no" >&6
15309 fi
15310
15311     test -n "$XCURSES_CONFIG" && break
15312   done
15313 fi
15314 if test -z "$XCURSES_CONFIG"; then
15315   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15316   for ac_prog in xcurses-config
15317 do
15318   # Extract the first word of "$ac_prog", so it can be a program name with args.
15319 set dummy $ac_prog; ac_word=$2
15320 echo "$as_me:15320: checking for $ac_word" >&5
15321 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15322 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15323   echo $ECHO_N "(cached) $ECHO_C" >&6
15324 else
15325   if test -n "$ac_ct_XCURSES_CONFIG"; then
15326   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15327 else
15328   ac_save_IFS=$IFS; IFS=$ac_path_separator
15329 ac_dummy="$PATH"
15330 for ac_dir in $ac_dummy; do
15331   IFS=$ac_save_IFS
15332   test -z "$ac_dir" && ac_dir=.
15333   $as_executable_p "$ac_dir/$ac_word" || continue
15334 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15335 echo "$as_me:15335: found $ac_dir/$ac_word" >&5
15336 break
15337 done
15338
15339 fi
15340 fi
15341 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15342 if test -n "$ac_ct_XCURSES_CONFIG"; then
15343   echo "$as_me:15343: result: $ac_ct_XCURSES_CONFIG" >&5
15344 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15345 else
15346   echo "$as_me:15346: result: no" >&5
15347 echo "${ECHO_T}no" >&6
15348 fi
15349
15350   test -n "$ac_ct_XCURSES_CONFIG" && break
15351 done
15352 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15353
15354   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15355 fi
15356
15357 if test "$XCURSES_CONFIG" != none ; then
15358
15359 cf_fix_cppflags=no
15360 cf_new_cflags=
15361 cf_new_cppflags=
15362 cf_new_extra_cppflags=
15363
15364 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15365 do
15366 case $cf_fix_cppflags in
15367 (no)
15368         case $cf_add_cflags in
15369         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15370                 case $cf_add_cflags in
15371                 (-D*)
15372                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15373
15374                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15375                                 && test -z "${cf_tst_cflags}" \
15376                                 && cf_fix_cppflags=yes
15377
15378                         if test $cf_fix_cppflags = yes ; then
15379
15380         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15381         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15382
15383                                 continue
15384                         elif test "${cf_tst_cflags}" = "\"'" ; then
15385
15386         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15387         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15388
15389                                 continue
15390                         fi
15391                         ;;
15392                 esac
15393                 case "$CPPFLAGS" in
15394                 (*$cf_add_cflags)
15395                         ;;
15396                 (*)
15397                         case $cf_add_cflags in
15398                         (-D*)
15399                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15400
15401 CPPFLAGS=`echo "$CPPFLAGS" | \
15402         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15403                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15404
15405                                 ;;
15406                         esac
15407
15408         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15409         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15410
15411                         ;;
15412                 esac
15413                 ;;
15414         (*)
15415
15416         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15417         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15418
15419                 ;;
15420         esac
15421         ;;
15422 (yes)
15423
15424         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15425         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15426
15427         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15428
15429         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15430                 && test -z "${cf_tst_cflags}" \
15431                 && cf_fix_cppflags=no
15432         ;;
15433 esac
15434 done
15435
15436 if test -n "$cf_new_cflags" ; then
15437
15438         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15439         CFLAGS="${CFLAGS}$cf_new_cflags"
15440
15441 fi
15442
15443 if test -n "$cf_new_cppflags" ; then
15444
15445         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15446         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15447
15448 fi
15449
15450 if test -n "$cf_new_extra_cppflags" ; then
15451
15452         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15453         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15454
15455 fi
15456
15457 cf_add_libs="$LIBS"
15458 # reverse order
15459 cf_add_0lib=
15460 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15461 # filter duplicates
15462 for cf_add_1lib in $cf_add_0lib; do
15463         for cf_add_2lib in $cf_add_libs; do
15464                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15465                         cf_add_1lib=
15466                         break
15467                 fi
15468         done
15469         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15470 done
15471 LIBS="$cf_add_libs"
15472
15473 cf_cv_lib_XCurses=yes
15474
15475 else
15476
15477 LDFLAGS="$LDFLAGS $X_LIBS"
15478
15479 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15480
15481 echo "${as_me:-configure}:15481: testing checking additions to CFLAGS ..." 1>&5
15482
15483 cf_check_cflags="$CFLAGS"
15484 cf_check_cppflags="$CPPFLAGS"
15485
15486 cf_fix_cppflags=no
15487 cf_new_cflags=
15488 cf_new_cppflags=
15489 cf_new_extra_cppflags=
15490
15491 for cf_add_cflags in $X_CFLAGS
15492 do
15493 case $cf_fix_cppflags in
15494 (no)
15495         case $cf_add_cflags in
15496         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15497                 case $cf_add_cflags in
15498                 (-D*)
15499                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15500
15501                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15502                                 && test -z "${cf_tst_cflags}" \
15503                                 && cf_fix_cppflags=yes
15504
15505                         if test $cf_fix_cppflags = yes ; then
15506
15507         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15508         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15509
15510                                 continue
15511                         elif test "${cf_tst_cflags}" = "\"'" ; then
15512
15513         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15514         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15515
15516                                 continue
15517                         fi
15518                         ;;
15519                 esac
15520                 case "$CPPFLAGS" in
15521                 (*$cf_add_cflags)
15522                         ;;
15523                 (*)
15524                         case $cf_add_cflags in
15525                         (-D*)
15526                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15527
15528 CPPFLAGS=`echo "$CPPFLAGS" | \
15529         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15530                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15531
15532                                 ;;
15533                         esac
15534
15535         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15536         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15537
15538                         ;;
15539                 esac
15540                 ;;
15541         (*)
15542
15543         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15544         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15545
15546                 ;;
15547         esac
15548         ;;
15549 (yes)
15550
15551         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15552         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15553
15554         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15555
15556         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15557                 && test -z "${cf_tst_cflags}" \
15558                 && cf_fix_cppflags=no
15559         ;;
15560 esac
15561 done
15562
15563 if test -n "$cf_new_cflags" ; then
15564         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15565
15566 echo "${as_me:-configure}:15566: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15567
15568         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15569         CFLAGS="${CFLAGS}$cf_new_cflags"
15570
15571 fi
15572
15573 if test -n "$cf_new_cppflags" ; then
15574         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15575
15576 echo "${as_me:-configure}:15576: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15577
15578         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15579         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15580
15581 fi
15582
15583 if test -n "$cf_new_extra_cppflags" ; then
15584         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15585
15586 echo "${as_me:-configure}:15586: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15587
15588         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15589         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15590
15591 fi
15592
15593 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15594 cat >conftest.$ac_ext <<_ACEOF
15595 #line 15595 "configure"
15596 #include "confdefs.h"
15597 #include <stdio.h>
15598 int
15599 main (void)
15600 {
15601 printf("Hello world");
15602   ;
15603   return 0;
15604 }
15605 _ACEOF
15606 rm -f conftest.$ac_objext conftest$ac_exeext
15607 if { (eval echo "$as_me:15607: \"$ac_link\"") >&5
15608   (eval $ac_link) 2>&5
15609   ac_status=$?
15610   echo "$as_me:15610: \$? = $ac_status" >&5
15611   (exit $ac_status); } &&
15612          { ac_try='test -s conftest$ac_exeext'
15613   { (eval echo "$as_me:15613: \"$ac_try\"") >&5
15614   (eval $ac_try) 2>&5
15615   ac_status=$?
15616   echo "$as_me:15616: \$? = $ac_status" >&5
15617   (exit $ac_status); }; }; then
15618   :
15619 else
15620   echo "$as_me: failed program was:" >&5
15621 cat conftest.$ac_ext >&5
15622 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15623
15624 echo "${as_me:-configure}:15624: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15625
15626          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15627                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15628
15629 echo "${as_me:-configure}:15629: testing but keeping change to \$CPPFLAGS ..." 1>&5
15630
15631          fi
15632          CFLAGS="$cf_check_flags"
15633 fi
15634 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15635 fi
15636
15637 echo "$as_me:15637: checking for XOpenDisplay in -lX11" >&5
15638 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15639 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15640   echo $ECHO_N "(cached) $ECHO_C" >&6
15641 else
15642   ac_check_lib_save_LIBS=$LIBS
15643 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15644 cat >conftest.$ac_ext <<_ACEOF
15645 #line 15645 "configure"
15646 #include "confdefs.h"
15647
15648 /* Override any gcc2 internal prototype to avoid an error.  */
15649 #ifdef __cplusplus
15650 extern "C"
15651 #endif
15652 /* We use char because int might match the return type of a gcc2
15653    builtin and then its argument prototype would still apply.  */
15654 char XOpenDisplay ();
15655 int
15656 main (void)
15657 {
15658 XOpenDisplay ();
15659   ;
15660   return 0;
15661 }
15662 _ACEOF
15663 rm -f conftest.$ac_objext conftest$ac_exeext
15664 if { (eval echo "$as_me:15664: \"$ac_link\"") >&5
15665   (eval $ac_link) 2>&5
15666   ac_status=$?
15667   echo "$as_me:15667: \$? = $ac_status" >&5
15668   (exit $ac_status); } &&
15669          { ac_try='test -s conftest$ac_exeext'
15670   { (eval echo "$as_me:15670: \"$ac_try\"") >&5
15671   (eval $ac_try) 2>&5
15672   ac_status=$?
15673   echo "$as_me:15673: \$? = $ac_status" >&5
15674   (exit $ac_status); }; }; then
15675   ac_cv_lib_X11_XOpenDisplay=yes
15676 else
15677   echo "$as_me: failed program was:" >&5
15678 cat conftest.$ac_ext >&5
15679 ac_cv_lib_X11_XOpenDisplay=no
15680 fi
15681 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15682 LIBS=$ac_check_lib_save_LIBS
15683 fi
15684 echo "$as_me:15684: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15685 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15686 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15687
15688 cf_add_libs="$LIBS"
15689 # reverse order
15690 cf_add_0lib=
15691 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15692 # filter duplicates
15693 for cf_add_1lib in $cf_add_0lib; do
15694         for cf_add_2lib in $cf_add_libs; do
15695                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15696                         cf_add_1lib=
15697                         break
15698                 fi
15699         done
15700         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15701 done
15702 LIBS="$cf_add_libs"
15703
15704 fi
15705
15706 echo "$as_me:15706: checking for XCurses library" >&5
15707 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15708 if test "${cf_cv_lib_XCurses+set}" = set; then
15709   echo $ECHO_N "(cached) $ECHO_C" >&6
15710 else
15711
15712 cf_add_libs="$LIBS"
15713 # reverse order
15714 cf_add_0lib=
15715 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15716 # filter duplicates
15717 for cf_add_1lib in $cf_add_0lib; do
15718         for cf_add_2lib in $cf_add_libs; do
15719                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15720                         cf_add_1lib=
15721                         break
15722                 fi
15723         done
15724         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15725 done
15726 LIBS="$cf_add_libs"
15727
15728 cat >conftest.$ac_ext <<_ACEOF
15729 #line 15729 "configure"
15730 #include "confdefs.h"
15731
15732 #include <xcurses.h>
15733 char *XCursesProgramName = "test";
15734
15735 int
15736 main (void)
15737 {
15738 XCursesExit();
15739   ;
15740   return 0;
15741 }
15742 _ACEOF
15743 rm -f conftest.$ac_objext conftest$ac_exeext
15744 if { (eval echo "$as_me:15744: \"$ac_link\"") >&5
15745   (eval $ac_link) 2>&5
15746   ac_status=$?
15747   echo "$as_me:15747: \$? = $ac_status" >&5
15748   (exit $ac_status); } &&
15749          { ac_try='test -s conftest$ac_exeext'
15750   { (eval echo "$as_me:15750: \"$ac_try\"") >&5
15751   (eval $ac_try) 2>&5
15752   ac_status=$?
15753   echo "$as_me:15753: \$? = $ac_status" >&5
15754   (exit $ac_status); }; }; then
15755   cf_cv_lib_XCurses=yes
15756 else
15757   echo "$as_me: failed program was:" >&5
15758 cat conftest.$ac_ext >&5
15759 cf_cv_lib_XCurses=no
15760 fi
15761 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15762
15763 fi
15764 echo "$as_me:15764: result: $cf_cv_lib_XCurses" >&5
15765 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15766
15767 fi
15768
15769 if test $cf_cv_lib_XCurses = yes ; then
15770
15771 cat >>confdefs.h <<\EOF
15772 #define UNIX 1
15773 EOF
15774
15775 cat >>confdefs.h <<\EOF
15776 #define XCURSES 1
15777 EOF
15778
15779         echo "$as_me:15779: checking for xcurses.h" >&5
15780 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15781 if test "${ac_cv_header_xcurses_h+set}" = set; then
15782   echo $ECHO_N "(cached) $ECHO_C" >&6
15783 else
15784   cat >conftest.$ac_ext <<_ACEOF
15785 #line 15785 "configure"
15786 #include "confdefs.h"
15787 #include <xcurses.h>
15788 _ACEOF
15789 if { (eval echo "$as_me:15789: \"$ac_cpp conftest.$ac_ext\"") >&5
15790   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15791   ac_status=$?
15792   egrep -v '^ *\+' conftest.er1 >conftest.err
15793   rm -f conftest.er1
15794   cat conftest.err >&5
15795   echo "$as_me:15795: \$? = $ac_status" >&5
15796   (exit $ac_status); } >/dev/null; then
15797   if test -s conftest.err; then
15798     ac_cpp_err=$ac_c_preproc_warn_flag
15799   else
15800     ac_cpp_err=
15801   fi
15802 else
15803   ac_cpp_err=yes
15804 fi
15805 if test -z "$ac_cpp_err"; then
15806   ac_cv_header_xcurses_h=yes
15807 else
15808   echo "$as_me: failed program was:" >&5
15809   cat conftest.$ac_ext >&5
15810   ac_cv_header_xcurses_h=no
15811 fi
15812 rm -f conftest.err conftest.$ac_ext
15813 fi
15814 echo "$as_me:15814: result: $ac_cv_header_xcurses_h" >&5
15815 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15816 if test $ac_cv_header_xcurses_h = yes; then
15817
15818 cat >>confdefs.h <<\EOF
15819 #define HAVE_XCURSES 1
15820 EOF
15821
15822 fi
15823
15824 else
15825         { { echo "$as_me:15825: error: Cannot link with XCurses" >&5
15826 echo "$as_me: error: Cannot link with XCurses" >&2;}
15827    { (exit 1); exit 1; }; }
15828 fi
15829
15830         ;;
15831 (*)
15832         { { echo "$as_me:15832: error: unexpected screen-value: $cf_cv_screen" >&5
15833 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15834    { (exit 1); exit 1; }; }
15835         ;;
15836 esac
15837
15838 : ${cf_nculib_root:=$cf_cv_screen}
15839 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15840 echo "$as_me:15840: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15841 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15842 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15843   echo $ECHO_N "(cached) $ECHO_C" >&6
15844 else
15845   ac_check_lib_save_LIBS=$LIBS
15846 LIBS="-l$cf_nculib_root  $LIBS"
15847 cat >conftest.$ac_ext <<_ACEOF
15848 #line 15848 "configure"
15849 #include "confdefs.h"
15850
15851 /* Override any gcc2 internal prototype to avoid an error.  */
15852 #ifdef __cplusplus
15853 extern "C"
15854 #endif
15855 /* We use char because int might match the return type of a gcc2
15856    builtin and then its argument prototype would still apply.  */
15857 char _nc_init_pthreads ();
15858 int
15859 main (void)
15860 {
15861 _nc_init_pthreads ();
15862   ;
15863   return 0;
15864 }
15865 _ACEOF
15866 rm -f conftest.$ac_objext conftest$ac_exeext
15867 if { (eval echo "$as_me:15867: \"$ac_link\"") >&5
15868   (eval $ac_link) 2>&5
15869   ac_status=$?
15870   echo "$as_me:15870: \$? = $ac_status" >&5
15871   (exit $ac_status); } &&
15872          { ac_try='test -s conftest$ac_exeext'
15873   { (eval echo "$as_me:15873: \"$ac_try\"") >&5
15874   (eval $ac_try) 2>&5
15875   ac_status=$?
15876   echo "$as_me:15876: \$? = $ac_status" >&5
15877   (exit $ac_status); }; }; then
15878   eval "$as_ac_Lib=yes"
15879 else
15880   echo "$as_me: failed program was:" >&5
15881 cat conftest.$ac_ext >&5
15882 eval "$as_ac_Lib=no"
15883 fi
15884 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15885 LIBS=$ac_check_lib_save_LIBS
15886 fi
15887 echo "$as_me:15887: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15888 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15889 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15890   cf_cv_ncurses_pthreads=yes
15891 else
15892   cf_cv_ncurses_pthreads=no
15893 fi
15894
15895 if test "$cf_cv_ncurses_pthreads" = yes
15896 then
15897
15898 cf_add_libs="$LIBS"
15899 # reverse order
15900 cf_add_0lib=
15901 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15902 # filter duplicates
15903 for cf_add_1lib in $cf_add_0lib; do
15904         for cf_add_2lib in $cf_add_libs; do
15905                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15906                         cf_add_1lib=
15907                         break
15908                 fi
15909         done
15910         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15911 done
15912 LIBS="$cf_add_libs"
15913
15914 fi
15915
15916 case $cf_cv_screen in
15917 (ncurses*)
15918         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15919         ;;
15920 esac
15921
15922 echo "$as_me:15922: checking for X11 rgb file" >&5
15923 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15924
15925 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15926 if test "${with_x11_rgb+set}" = set; then
15927   withval="$with_x11_rgb"
15928   RGB_PATH=$withval
15929 else
15930   RGB_PATH=auto
15931 fi;
15932
15933 if test "x$RGB_PATH" = xauto
15934 then
15935         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15936         for cf_path in \
15937                 /opt/local/share/X11/rgb.txt \
15938                 /opt/X11/share/X11/rgb.txt \
15939                 /usr/share/X11/rgb.txt \
15940                 /usr/X11/share/X11/rgb.txt \
15941                 /usr/X11/lib/X11/rgb.txt \
15942                 /usr/lib/X11/rgb.txt \
15943                 /etc/X11/rgb.txt \
15944                 /usr/pkg/lib/X11/rgb.txt \
15945                 /usr/X11R7/lib/X11/rgb.txt \
15946                 /usr/X11R6/lib/X11/rgb.txt \
15947                 /usr/X11R5/lib/X11/rgb.txt \
15948                 /usr/X11R4/lib/X11/rgb.txt \
15949                 /usr/local/lib/X11/rgb.txt \
15950                 /usr/local/share/X11/rgb.txt \
15951                 /usr/lib64/X11/rgb.txt
15952         do
15953                 if test -f "$cf_path" ; then
15954                         RGB_PATH="$cf_path"
15955                         break
15956                 fi
15957         done
15958 else
15959         cf_path=$RGB_PATH
15960
15961 if test "x$prefix" != xNONE; then
15962         cf_path_syntax="$prefix"
15963 else
15964         cf_path_syntax="$ac_default_prefix"
15965 fi
15966
15967 case ".$cf_path" in
15968 (.\$\(*\)*|.\'*\'*)
15969         ;;
15970 (..|./*|.\\*)
15971         ;;
15972 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15973         ;;
15974 (.\${*prefix}*|.\${*dir}*)
15975         eval cf_path="$cf_path"
15976         case ".$cf_path" in
15977         (.NONE/*)
15978                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15979                 ;;
15980         esac
15981         ;;
15982 (.no|.NONE/*)
15983         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15984         ;;
15985 (*)
15986         { { echo "$as_me:15986: error: expected a pathname, not \"$cf_path\"" >&5
15987 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15988    { (exit 1); exit 1; }; }
15989         ;;
15990 esac
15991
15992 fi
15993
15994 echo "$as_me:15994: result: $RGB_PATH" >&5
15995 echo "${ECHO_T}$RGB_PATH" >&6
15996
15997 cat >>confdefs.h <<EOF
15998 #define RGB_PATH "$cf_path"
15999 EOF
16000
16001 no_x11_rgb=
16002 if test "$RGB_PATH" = no
16003 then
16004         no_x11_rgb="#"
16005 fi
16006
16007 cf_curses_headers=
16008
16009 case $cf_cv_screen in
16010 (pdcurses)
16011         cf_default_panel=no
16012         cf_default_form=no
16013         cf_default_menu=no
16014         cf_default_tinfo=no
16015         ;;
16016 (xcurses|bsdcurses)
16017         cf_default_panel=no
16018         cf_default_form=no
16019         cf_default_menu=no
16020         cf_default_tinfo=yes
16021         ;;
16022 (*)
16023         cf_default_panel=yes
16024         cf_default_form=yes
16025         cf_default_menu=yes
16026         cf_default_tinfo=yes
16027         case $cf_cv_screen in
16028         (ncurses*)
16029                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16030                 ;;
16031         esac
16032         ;;
16033 esac
16034
16035 echo "$as_me:16035: checking for desired basename for form library" >&5
16036 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16037
16038 # Check whether --with-form-libname or --without-form-libname was given.
16039 if test "${with_form_libname+set}" = set; then
16040   withval="$with_form_libname"
16041   with_lib_basename=$withval
16042 else
16043   with_lib_basename=form
16044 fi;
16045 FORM_NAME="$with_lib_basename"
16046
16047 case "x$FORM_NAME" in
16048 (x|xno|xnone|xyes)
16049         FORM_NAME=form
16050         ;;
16051 (*)
16052         ;;
16053 esac
16054
16055 echo "$as_me:16055: result: $FORM_NAME" >&5
16056 echo "${ECHO_T}$FORM_NAME" >&6
16057
16058 echo "$as_me:16058: checking for desired basename for menu library" >&5
16059 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16060
16061 # Check whether --with-menu-libname or --without-menu-libname was given.
16062 if test "${with_menu_libname+set}" = set; then
16063   withval="$with_menu_libname"
16064   with_lib_basename=$withval
16065 else
16066   with_lib_basename=menu
16067 fi;
16068 MENU_NAME="$with_lib_basename"
16069
16070 case "x$MENU_NAME" in
16071 (x|xno|xnone|xyes)
16072         MENU_NAME=menu
16073         ;;
16074 (*)
16075         ;;
16076 esac
16077
16078 echo "$as_me:16078: result: $MENU_NAME" >&5
16079 echo "${ECHO_T}$MENU_NAME" >&6
16080
16081 echo "$as_me:16081: checking for desired basename for panel library" >&5
16082 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16083
16084 # Check whether --with-panel-libname or --without-panel-libname was given.
16085 if test "${with_panel_libname+set}" = set; then
16086   withval="$with_panel_libname"
16087   with_lib_basename=$withval
16088 else
16089   with_lib_basename=panel
16090 fi;
16091 PANEL_NAME="$with_lib_basename"
16092
16093 case "x$PANEL_NAME" in
16094 (x|xno|xnone|xyes)
16095         PANEL_NAME=panel
16096         ;;
16097 (*)
16098         ;;
16099 esac
16100
16101 echo "$as_me:16101: result: $PANEL_NAME" >&5
16102 echo "${ECHO_T}$PANEL_NAME" >&6
16103
16104 echo "$as_me:16104: checking if you want to check for panel functions" >&5
16105 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16106
16107 # Check whether --enable-panel or --disable-panel was given.
16108 if test "${enable_panel+set}" = set; then
16109   enableval="$enable_panel"
16110   test "$enableval" != no && enableval=yes
16111         if test "$enableval" != "yes" ; then
16112     cf_enable_panel=no
16113         else
16114                 cf_enable_panel=$cf_default_panel
16115         fi
16116 else
16117   enableval=yes
16118         cf_enable_panel=$cf_default_panel
16119
16120 fi;
16121 echo "$as_me:16121: result: $cf_enable_panel" >&5
16122 echo "${ECHO_T}$cf_enable_panel" >&6
16123 if test $cf_enable_panel = yes
16124 then
16125
16126 cf_have_curses_lib=no
16127
16128 : ${NCURSES_CONFIG_PKG:=none}
16129 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16130         :
16131 elif test "x${PKG_CONFIG:=none}" != xnone; then
16132         echo "$as_me:16132: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16133 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16134         if "$PKG_CONFIG" --exists $PANEL_NAME$cf_cv_libtype ; then
16135                 echo "$as_me:16135: result: yes" >&5
16136 echo "${ECHO_T}yes" >&6
16137
16138                 echo "$as_me:16138: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16139 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16140
16141                 cf_save_CPPFLAGS="$CPPFLAGS"
16142                 cf_save_LIBS="$LIBS"
16143
16144 cf_fix_cppflags=no
16145 cf_new_cflags=
16146 cf_new_cppflags=
16147 cf_new_extra_cppflags=
16148
16149 for cf_add_cflags in `$PKG_CONFIG --cflags $PANEL_NAME$cf_cv_libtype`
16150 do
16151 case $cf_fix_cppflags in
16152 (no)
16153         case $cf_add_cflags in
16154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16155                 case $cf_add_cflags in
16156                 (-D*)
16157                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16158
16159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16160                                 && test -z "${cf_tst_cflags}" \
16161                                 && cf_fix_cppflags=yes
16162
16163                         if test $cf_fix_cppflags = yes ; then
16164
16165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16167
16168                                 continue
16169                         elif test "${cf_tst_cflags}" = "\"'" ; then
16170
16171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16173
16174                                 continue
16175                         fi
16176                         ;;
16177                 esac
16178                 case "$CPPFLAGS" in
16179                 (*$cf_add_cflags)
16180                         ;;
16181                 (*)
16182                         case $cf_add_cflags in
16183                         (-D*)
16184                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16185
16186 CPPFLAGS=`echo "$CPPFLAGS" | \
16187         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16188                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16189
16190                                 ;;
16191                         esac
16192
16193         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16194         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16195
16196                         ;;
16197                 esac
16198                 ;;
16199         (*)
16200
16201         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16202         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16203
16204                 ;;
16205         esac
16206         ;;
16207 (yes)
16208
16209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16211
16212         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16213
16214         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16215                 && test -z "${cf_tst_cflags}" \
16216                 && cf_fix_cppflags=no
16217         ;;
16218 esac
16219 done
16220
16221 if test -n "$cf_new_cflags" ; then
16222
16223         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16224         CFLAGS="${CFLAGS}$cf_new_cflags"
16225
16226 fi
16227
16228 if test -n "$cf_new_cppflags" ; then
16229
16230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16231         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16232
16233 fi
16234
16235 if test -n "$cf_new_extra_cppflags" ; then
16236
16237         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16238         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16239
16240 fi
16241
16242 cf_add_libs="$LIBS"
16243 # reverse order
16244 cf_add_0lib=
16245 for cf_add_1lib in `$PKG_CONFIG --libs $PANEL_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16246 # filter duplicates
16247 for cf_add_1lib in $cf_add_0lib; do
16248         for cf_add_2lib in $cf_add_libs; do
16249                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16250                         cf_add_1lib=
16251                         break
16252                 fi
16253         done
16254         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16255 done
16256 LIBS="$cf_add_libs"
16257
16258                 cat >conftest.$ac_ext <<_ACEOF
16259 #line 16259 "configure"
16260 #include "confdefs.h"
16261 #include <$PANEL_NAME.h>
16262 int
16263 main (void)
16264 {
16265 (void) new_panel ( 0 );
16266   ;
16267   return 0;
16268 }
16269 _ACEOF
16270 rm -f conftest.$ac_objext conftest$ac_exeext
16271 if { (eval echo "$as_me:16271: \"$ac_link\"") >&5
16272   (eval $ac_link) 2>&5
16273   ac_status=$?
16274   echo "$as_me:16274: \$? = $ac_status" >&5
16275   (exit $ac_status); } &&
16276          { ac_try='test -s conftest$ac_exeext'
16277   { (eval echo "$as_me:16277: \"$ac_try\"") >&5
16278   (eval $ac_try) 2>&5
16279   ac_status=$?
16280   echo "$as_me:16280: \$? = $ac_status" >&5
16281   (exit $ac_status); }; }; then
16282   if test "$cross_compiling" = yes; then
16283   cf_have_curses_lib=maybe
16284 else
16285   cat >conftest.$ac_ext <<_ACEOF
16286 #line 16286 "configure"
16287 #include "confdefs.h"
16288 #include <$PANEL_NAME.h>
16289                                 int main(void)
16290                                 { (void) new_panel ( 0 ); return 0; }
16291 _ACEOF
16292 rm -f conftest$ac_exeext
16293 if { (eval echo "$as_me:16293: \"$ac_link\"") >&5
16294   (eval $ac_link) 2>&5
16295   ac_status=$?
16296   echo "$as_me:16296: \$? = $ac_status" >&5
16297   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16298   { (eval echo "$as_me:16298: \"$ac_try\"") >&5
16299   (eval $ac_try) 2>&5
16300   ac_status=$?
16301   echo "$as_me:16301: \$? = $ac_status" >&5
16302   (exit $ac_status); }; }; then
16303   cf_have_curses_lib=yes
16304 else
16305   echo "$as_me: program exited with status $ac_status" >&5
16306 echo "$as_me: failed program was:" >&5
16307 cat conftest.$ac_ext >&5
16308 cf_have_curses_lib=no
16309 fi
16310 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16311 fi
16312 else
16313   echo "$as_me: failed program was:" >&5
16314 cat conftest.$ac_ext >&5
16315 cf_have_curses_lib=no
16316 fi
16317 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16318                 echo "$as_me:16318: result: $cf_have_curses_lib" >&5
16319 echo "${ECHO_T}$cf_have_curses_lib" >&6
16320                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16321                 if test "$cf_have_curses_lib" != "yes"
16322                 then
16323                         CPPFLAGS="$cf_save_CPPFLAGS"
16324                         LIBS="$cf_save_LIBS"
16325                 else
16326
16327 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16328
16329                         cat >>confdefs.h <<EOF
16330 #define $cf_upper 1
16331 EOF
16332
16333                 fi
16334         fi
16335 fi
16336 if test "$cf_have_curses_lib" = no; then
16337         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16338 echo "$as_me:16338: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16339 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16340 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16341   echo $ECHO_N "(cached) $ECHO_C" >&6
16342 else
16343   ac_check_lib_save_LIBS=$LIBS
16344 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16345 cat >conftest.$ac_ext <<_ACEOF
16346 #line 16346 "configure"
16347 #include "confdefs.h"
16348
16349 /* Override any gcc2 internal prototype to avoid an error.  */
16350 #ifdef __cplusplus
16351 extern "C"
16352 #endif
16353 /* We use char because int might match the return type of a gcc2
16354    builtin and then its argument prototype would still apply.  */
16355 char new_panel ();
16356 int
16357 main (void)
16358 {
16359 new_panel ();
16360   ;
16361   return 0;
16362 }
16363 _ACEOF
16364 rm -f conftest.$ac_objext conftest$ac_exeext
16365 if { (eval echo "$as_me:16365: \"$ac_link\"") >&5
16366   (eval $ac_link) 2>&5
16367   ac_status=$?
16368   echo "$as_me:16368: \$? = $ac_status" >&5
16369   (exit $ac_status); } &&
16370          { ac_try='test -s conftest$ac_exeext'
16371   { (eval echo "$as_me:16371: \"$ac_try\"") >&5
16372   (eval $ac_try) 2>&5
16373   ac_status=$?
16374   echo "$as_me:16374: \$? = $ac_status" >&5
16375   (exit $ac_status); }; }; then
16376   eval "$as_ac_Lib=yes"
16377 else
16378   echo "$as_me: failed program was:" >&5
16379 cat conftest.$ac_ext >&5
16380 eval "$as_ac_Lib=no"
16381 fi
16382 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16383 LIBS=$ac_check_lib_save_LIBS
16384 fi
16385 echo "$as_me:16385: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16386 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16387 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16388
16389 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16390
16391 cf_add_libs="$LIBS"
16392 # reverse order
16393 cf_add_0lib=
16394 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16395 # filter duplicates
16396 for cf_add_1lib in $cf_add_0lib; do
16397         for cf_add_2lib in $cf_add_libs; do
16398                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16399                         cf_add_1lib=
16400                         break
16401                 fi
16402         done
16403         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16404 done
16405 LIBS="$cf_add_libs"
16406
16407                 cat >>confdefs.h <<EOF
16408 #define $cf_upper 1
16409 EOF
16410
16411 fi
16412
16413 fi
16414
16415         cf_curses_headers="$cf_curses_headers panel.h"
16416 fi
16417
16418 echo "$as_me:16418: checking if you want to check for menu functions" >&5
16419 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16420
16421 # Check whether --enable-menu or --disable-menu was given.
16422 if test "${enable_menu+set}" = set; then
16423   enableval="$enable_menu"
16424   test "$enableval" != no && enableval=yes
16425         if test "$enableval" != "yes" ; then
16426     cf_enable_menu=no
16427         else
16428                 cf_enable_menu=$cf_default_menu
16429         fi
16430 else
16431   enableval=yes
16432         cf_enable_menu=$cf_default_menu
16433
16434 fi;
16435 echo "$as_me:16435: result: $cf_enable_menu" >&5
16436 echo "${ECHO_T}$cf_enable_menu" >&6
16437 if test $cf_enable_menu = yes
16438 then
16439         case $cf_cv_screen in
16440         (ncurses*)
16441                 ;;
16442         (curses*)
16443
16444 echo "$as_me:16444: checking for NetBSD menu.h" >&5
16445 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16446 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16447   echo $ECHO_N "(cached) $ECHO_C" >&6
16448 else
16449
16450 cat >conftest.$ac_ext <<_ACEOF
16451 #line 16451 "configure"
16452 #include "confdefs.h"
16453
16454 #include <${cf_cv_ncurses_header:-curses.h}>
16455 #include <menu.h>
16456
16457 int
16458 main (void)
16459 {
16460
16461         MENU *menu;
16462         int y = menu->max_item_width;
16463
16464   ;
16465   return 0;
16466 }
16467 _ACEOF
16468 rm -f conftest.$ac_objext
16469 if { (eval echo "$as_me:16469: \"$ac_compile\"") >&5
16470   (eval $ac_compile) 2>&5
16471   ac_status=$?
16472   echo "$as_me:16472: \$? = $ac_status" >&5
16473   (exit $ac_status); } &&
16474          { ac_try='test -s conftest.$ac_objext'
16475   { (eval echo "$as_me:16475: \"$ac_try\"") >&5
16476   (eval $ac_try) 2>&5
16477   ac_status=$?
16478   echo "$as_me:16478: \$? = $ac_status" >&5
16479   (exit $ac_status); }; }; then
16480   cf_cv_netbsd_menu_h=yes
16481
16482 else
16483   echo "$as_me: failed program was:" >&5
16484 cat conftest.$ac_ext >&5
16485 cf_cv_netbsd_menu_h=no
16486 fi
16487 rm -f conftest.$ac_objext conftest.$ac_ext
16488
16489 fi
16490 echo "$as_me:16490: result: $cf_cv_netbsd_menu_h" >&5
16491 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16492
16493 test "$cf_cv_netbsd_menu_h" = yes &&
16494 cat >>confdefs.h <<\EOF
16495 #define HAVE_NETBSD_MENU_H 1
16496 EOF
16497
16498                 ;;
16499         esac
16500
16501 cf_have_curses_lib=no
16502
16503 : ${NCURSES_CONFIG_PKG:=none}
16504 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16505         :
16506 elif test "x${PKG_CONFIG:=none}" != xnone; then
16507         echo "$as_me:16507: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16508 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16509         if "$PKG_CONFIG" --exists $MENU_NAME$cf_cv_libtype ; then
16510                 echo "$as_me:16510: result: yes" >&5
16511 echo "${ECHO_T}yes" >&6
16512
16513                 echo "$as_me:16513: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16514 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16515
16516                 cf_save_CPPFLAGS="$CPPFLAGS"
16517                 cf_save_LIBS="$LIBS"
16518
16519 cf_fix_cppflags=no
16520 cf_new_cflags=
16521 cf_new_cppflags=
16522 cf_new_extra_cppflags=
16523
16524 for cf_add_cflags in `$PKG_CONFIG --cflags $MENU_NAME$cf_cv_libtype`
16525 do
16526 case $cf_fix_cppflags in
16527 (no)
16528         case $cf_add_cflags in
16529         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16530                 case $cf_add_cflags in
16531                 (-D*)
16532                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16533
16534                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16535                                 && test -z "${cf_tst_cflags}" \
16536                                 && cf_fix_cppflags=yes
16537
16538                         if test $cf_fix_cppflags = yes ; then
16539
16540         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16541         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16542
16543                                 continue
16544                         elif test "${cf_tst_cflags}" = "\"'" ; then
16545
16546         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16547         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16548
16549                                 continue
16550                         fi
16551                         ;;
16552                 esac
16553                 case "$CPPFLAGS" in
16554                 (*$cf_add_cflags)
16555                         ;;
16556                 (*)
16557                         case $cf_add_cflags in
16558                         (-D*)
16559                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16560
16561 CPPFLAGS=`echo "$CPPFLAGS" | \
16562         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16563                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16564
16565                                 ;;
16566                         esac
16567
16568         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16569         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16570
16571                         ;;
16572                 esac
16573                 ;;
16574         (*)
16575
16576         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16577         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16578
16579                 ;;
16580         esac
16581         ;;
16582 (yes)
16583
16584         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16585         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16586
16587         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16588
16589         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16590                 && test -z "${cf_tst_cflags}" \
16591                 && cf_fix_cppflags=no
16592         ;;
16593 esac
16594 done
16595
16596 if test -n "$cf_new_cflags" ; then
16597
16598         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16599         CFLAGS="${CFLAGS}$cf_new_cflags"
16600
16601 fi
16602
16603 if test -n "$cf_new_cppflags" ; then
16604
16605         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16606         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16607
16608 fi
16609
16610 if test -n "$cf_new_extra_cppflags" ; then
16611
16612         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16613         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16614
16615 fi
16616
16617 cf_add_libs="$LIBS"
16618 # reverse order
16619 cf_add_0lib=
16620 for cf_add_1lib in `$PKG_CONFIG --libs $MENU_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16621 # filter duplicates
16622 for cf_add_1lib in $cf_add_0lib; do
16623         for cf_add_2lib in $cf_add_libs; do
16624                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16625                         cf_add_1lib=
16626                         break
16627                 fi
16628         done
16629         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16630 done
16631 LIBS="$cf_add_libs"
16632
16633                 cat >conftest.$ac_ext <<_ACEOF
16634 #line 16634 "configure"
16635 #include "confdefs.h"
16636 #include <$MENU_NAME.h>
16637 int
16638 main (void)
16639 {
16640 (void) menu_driver ( 0,0 );
16641   ;
16642   return 0;
16643 }
16644 _ACEOF
16645 rm -f conftest.$ac_objext conftest$ac_exeext
16646 if { (eval echo "$as_me:16646: \"$ac_link\"") >&5
16647   (eval $ac_link) 2>&5
16648   ac_status=$?
16649   echo "$as_me:16649: \$? = $ac_status" >&5
16650   (exit $ac_status); } &&
16651          { ac_try='test -s conftest$ac_exeext'
16652   { (eval echo "$as_me:16652: \"$ac_try\"") >&5
16653   (eval $ac_try) 2>&5
16654   ac_status=$?
16655   echo "$as_me:16655: \$? = $ac_status" >&5
16656   (exit $ac_status); }; }; then
16657   if test "$cross_compiling" = yes; then
16658   cf_have_curses_lib=maybe
16659 else
16660   cat >conftest.$ac_ext <<_ACEOF
16661 #line 16661 "configure"
16662 #include "confdefs.h"
16663 #include <$MENU_NAME.h>
16664                                 int main(void)
16665                                 { (void) menu_driver ( 0,0 ); return 0; }
16666 _ACEOF
16667 rm -f conftest$ac_exeext
16668 if { (eval echo "$as_me:16668: \"$ac_link\"") >&5
16669   (eval $ac_link) 2>&5
16670   ac_status=$?
16671   echo "$as_me:16671: \$? = $ac_status" >&5
16672   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16673   { (eval echo "$as_me:16673: \"$ac_try\"") >&5
16674   (eval $ac_try) 2>&5
16675   ac_status=$?
16676   echo "$as_me:16676: \$? = $ac_status" >&5
16677   (exit $ac_status); }; }; then
16678   cf_have_curses_lib=yes
16679 else
16680   echo "$as_me: program exited with status $ac_status" >&5
16681 echo "$as_me: failed program was:" >&5
16682 cat conftest.$ac_ext >&5
16683 cf_have_curses_lib=no
16684 fi
16685 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16686 fi
16687 else
16688   echo "$as_me: failed program was:" >&5
16689 cat conftest.$ac_ext >&5
16690 cf_have_curses_lib=no
16691 fi
16692 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16693                 echo "$as_me:16693: result: $cf_have_curses_lib" >&5
16694 echo "${ECHO_T}$cf_have_curses_lib" >&6
16695                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16696                 if test "$cf_have_curses_lib" != "yes"
16697                 then
16698                         CPPFLAGS="$cf_save_CPPFLAGS"
16699                         LIBS="$cf_save_LIBS"
16700                 else
16701
16702 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16703
16704                         cat >>confdefs.h <<EOF
16705 #define $cf_upper 1
16706 EOF
16707
16708                 fi
16709         fi
16710 fi
16711 if test "$cf_have_curses_lib" = no; then
16712         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16713 echo "$as_me:16713: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
16714 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16715 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16716   echo $ECHO_N "(cached) $ECHO_C" >&6
16717 else
16718   ac_check_lib_save_LIBS=$LIBS
16719 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
16720 cat >conftest.$ac_ext <<_ACEOF
16721 #line 16721 "configure"
16722 #include "confdefs.h"
16723
16724 /* Override any gcc2 internal prototype to avoid an error.  */
16725 #ifdef __cplusplus
16726 extern "C"
16727 #endif
16728 /* We use char because int might match the return type of a gcc2
16729    builtin and then its argument prototype would still apply.  */
16730 char menu_driver ();
16731 int
16732 main (void)
16733 {
16734 menu_driver ();
16735   ;
16736   return 0;
16737 }
16738 _ACEOF
16739 rm -f conftest.$ac_objext conftest$ac_exeext
16740 if { (eval echo "$as_me:16740: \"$ac_link\"") >&5
16741   (eval $ac_link) 2>&5
16742   ac_status=$?
16743   echo "$as_me:16743: \$? = $ac_status" >&5
16744   (exit $ac_status); } &&
16745          { ac_try='test -s conftest$ac_exeext'
16746   { (eval echo "$as_me:16746: \"$ac_try\"") >&5
16747   (eval $ac_try) 2>&5
16748   ac_status=$?
16749   echo "$as_me:16749: \$? = $ac_status" >&5
16750   (exit $ac_status); }; }; then
16751   eval "$as_ac_Lib=yes"
16752 else
16753   echo "$as_me: failed program was:" >&5
16754 cat conftest.$ac_ext >&5
16755 eval "$as_ac_Lib=no"
16756 fi
16757 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16758 LIBS=$ac_check_lib_save_LIBS
16759 fi
16760 echo "$as_me:16760: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16761 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16762 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16763
16764 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16765
16766 cf_add_libs="$LIBS"
16767 # reverse order
16768 cf_add_0lib=
16769 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16770 # filter duplicates
16771 for cf_add_1lib in $cf_add_0lib; do
16772         for cf_add_2lib in $cf_add_libs; do
16773                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16774                         cf_add_1lib=
16775                         break
16776                 fi
16777         done
16778         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16779 done
16780 LIBS="$cf_add_libs"
16781
16782                 cat >>confdefs.h <<EOF
16783 #define $cf_upper 1
16784 EOF
16785
16786 fi
16787
16788 fi
16789
16790         cf_curses_headers="$cf_curses_headers menu.h"
16791 fi
16792
16793 echo "$as_me:16793: checking if you want to check for form functions" >&5
16794 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16795
16796 # Check whether --enable-form or --disable-form was given.
16797 if test "${enable_form+set}" = set; then
16798   enableval="$enable_form"
16799   test "$enableval" != no && enableval=yes
16800         if test "$enableval" != "yes" ; then
16801     cf_enable_form=no
16802         else
16803                 cf_enable_form=$cf_default_form
16804         fi
16805 else
16806   enableval=yes
16807         cf_enable_form=$cf_default_form
16808
16809 fi;
16810 echo "$as_me:16810: result: $cf_enable_form" >&5
16811 echo "${ECHO_T}$cf_enable_form" >&6
16812 if test $cf_enable_form = yes
16813 then
16814         case $cf_cv_screen in
16815         (ncurses*)
16816                 ;;
16817         (curses*)
16818
16819 echo "$as_me:16819: checking for NetBSD form.h" >&5
16820 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16821 if test "${cf_cv_netbsd_form_h+set}" = set; then
16822   echo $ECHO_N "(cached) $ECHO_C" >&6
16823 else
16824
16825 cat >conftest.$ac_ext <<_ACEOF
16826 #line 16826 "configure"
16827 #include "confdefs.h"
16828
16829 #include <${cf_cv_ncurses_header:-curses.h}>
16830 #include <form.h>
16831
16832 int
16833 main (void)
16834 {
16835
16836         FORM *form;
16837         int y = current_field(form)->cursor_ypos;
16838         int x = current_field(form)->cursor_xpos;
16839
16840   ;
16841   return 0;
16842 }
16843 _ACEOF
16844 rm -f conftest.$ac_objext
16845 if { (eval echo "$as_me:16845: \"$ac_compile\"") >&5
16846   (eval $ac_compile) 2>&5
16847   ac_status=$?
16848   echo "$as_me:16848: \$? = $ac_status" >&5
16849   (exit $ac_status); } &&
16850          { ac_try='test -s conftest.$ac_objext'
16851   { (eval echo "$as_me:16851: \"$ac_try\"") >&5
16852   (eval $ac_try) 2>&5
16853   ac_status=$?
16854   echo "$as_me:16854: \$? = $ac_status" >&5
16855   (exit $ac_status); }; }; then
16856   cf_cv_netbsd_form_h=yes
16857
16858 else
16859   echo "$as_me: failed program was:" >&5
16860 cat conftest.$ac_ext >&5
16861 cf_cv_netbsd_form_h=no
16862 fi
16863 rm -f conftest.$ac_objext conftest.$ac_ext
16864
16865 fi
16866 echo "$as_me:16866: result: $cf_cv_netbsd_form_h" >&5
16867 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16868
16869 test "$cf_cv_netbsd_form_h" = yes &&
16870 cat >>confdefs.h <<\EOF
16871 #define HAVE_NETBSD_FORM_H 1
16872 EOF
16873
16874                 ;;
16875         esac
16876
16877 cf_have_curses_lib=no
16878
16879 : ${NCURSES_CONFIG_PKG:=none}
16880 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16881         :
16882 elif test "x${PKG_CONFIG:=none}" != xnone; then
16883         echo "$as_me:16883: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
16884 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
16885         if "$PKG_CONFIG" --exists $FORM_NAME$cf_cv_libtype ; then
16886                 echo "$as_me:16886: result: yes" >&5
16887 echo "${ECHO_T}yes" >&6
16888
16889                 echo "$as_me:16889: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
16890 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16891
16892                 cf_save_CPPFLAGS="$CPPFLAGS"
16893                 cf_save_LIBS="$LIBS"
16894
16895 cf_fix_cppflags=no
16896 cf_new_cflags=
16897 cf_new_cppflags=
16898 cf_new_extra_cppflags=
16899
16900 for cf_add_cflags in `$PKG_CONFIG --cflags $FORM_NAME$cf_cv_libtype`
16901 do
16902 case $cf_fix_cppflags in
16903 (no)
16904         case $cf_add_cflags in
16905         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16906                 case $cf_add_cflags in
16907                 (-D*)
16908                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16909
16910                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16911                                 && test -z "${cf_tst_cflags}" \
16912                                 && cf_fix_cppflags=yes
16913
16914                         if test $cf_fix_cppflags = yes ; then
16915
16916         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16917         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16918
16919                                 continue
16920                         elif test "${cf_tst_cflags}" = "\"'" ; then
16921
16922         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16923         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16924
16925                                 continue
16926                         fi
16927                         ;;
16928                 esac
16929                 case "$CPPFLAGS" in
16930                 (*$cf_add_cflags)
16931                         ;;
16932                 (*)
16933                         case $cf_add_cflags in
16934                         (-D*)
16935                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16936
16937 CPPFLAGS=`echo "$CPPFLAGS" | \
16938         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16939                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16940
16941                                 ;;
16942                         esac
16943
16944         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16945         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16946
16947                         ;;
16948                 esac
16949                 ;;
16950         (*)
16951
16952         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16953         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16954
16955                 ;;
16956         esac
16957         ;;
16958 (yes)
16959
16960         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16961         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16962
16963         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16964
16965         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16966                 && test -z "${cf_tst_cflags}" \
16967                 && cf_fix_cppflags=no
16968         ;;
16969 esac
16970 done
16971
16972 if test -n "$cf_new_cflags" ; then
16973
16974         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16975         CFLAGS="${CFLAGS}$cf_new_cflags"
16976
16977 fi
16978
16979 if test -n "$cf_new_cppflags" ; then
16980
16981         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16982         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16983
16984 fi
16985
16986 if test -n "$cf_new_extra_cppflags" ; then
16987
16988         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16989         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16990
16991 fi
16992
16993 cf_add_libs="$LIBS"
16994 # reverse order
16995 cf_add_0lib=
16996 for cf_add_1lib in `$PKG_CONFIG --libs $FORM_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16997 # filter duplicates
16998 for cf_add_1lib in $cf_add_0lib; do
16999         for cf_add_2lib in $cf_add_libs; do
17000                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17001                         cf_add_1lib=
17002                         break
17003                 fi
17004         done
17005         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17006 done
17007 LIBS="$cf_add_libs"
17008
17009                 cat >conftest.$ac_ext <<_ACEOF
17010 #line 17010 "configure"
17011 #include "confdefs.h"
17012 #include <$FORM_NAME.h>
17013 int
17014 main (void)
17015 {
17016 (void) form_driver ( 0,0 );
17017   ;
17018   return 0;
17019 }
17020 _ACEOF
17021 rm -f conftest.$ac_objext conftest$ac_exeext
17022 if { (eval echo "$as_me:17022: \"$ac_link\"") >&5
17023   (eval $ac_link) 2>&5
17024   ac_status=$?
17025   echo "$as_me:17025: \$? = $ac_status" >&5
17026   (exit $ac_status); } &&
17027          { ac_try='test -s conftest$ac_exeext'
17028   { (eval echo "$as_me:17028: \"$ac_try\"") >&5
17029   (eval $ac_try) 2>&5
17030   ac_status=$?
17031   echo "$as_me:17031: \$? = $ac_status" >&5
17032   (exit $ac_status); }; }; then
17033   if test "$cross_compiling" = yes; then
17034   cf_have_curses_lib=maybe
17035 else
17036   cat >conftest.$ac_ext <<_ACEOF
17037 #line 17037 "configure"
17038 #include "confdefs.h"
17039 #include <$FORM_NAME.h>
17040                                 int main(void)
17041                                 { (void) form_driver ( 0,0 ); return 0; }
17042 _ACEOF
17043 rm -f conftest$ac_exeext
17044 if { (eval echo "$as_me:17044: \"$ac_link\"") >&5
17045   (eval $ac_link) 2>&5
17046   ac_status=$?
17047   echo "$as_me:17047: \$? = $ac_status" >&5
17048   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17049   { (eval echo "$as_me:17049: \"$ac_try\"") >&5
17050   (eval $ac_try) 2>&5
17051   ac_status=$?
17052   echo "$as_me:17052: \$? = $ac_status" >&5
17053   (exit $ac_status); }; }; then
17054   cf_have_curses_lib=yes
17055 else
17056   echo "$as_me: program exited with status $ac_status" >&5
17057 echo "$as_me: failed program was:" >&5
17058 cat conftest.$ac_ext >&5
17059 cf_have_curses_lib=no
17060 fi
17061 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17062 fi
17063 else
17064   echo "$as_me: failed program was:" >&5
17065 cat conftest.$ac_ext >&5
17066 cf_have_curses_lib=no
17067 fi
17068 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17069                 echo "$as_me:17069: result: $cf_have_curses_lib" >&5
17070 echo "${ECHO_T}$cf_have_curses_lib" >&6
17071                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17072                 if test "$cf_have_curses_lib" != "yes"
17073                 then
17074                         CPPFLAGS="$cf_save_CPPFLAGS"
17075                         LIBS="$cf_save_LIBS"
17076                 else
17077
17078 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17079
17080                         cat >>confdefs.h <<EOF
17081 #define $cf_upper 1
17082 EOF
17083
17084                 fi
17085         fi
17086 fi
17087 if test "$cf_have_curses_lib" = no; then
17088         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17089 echo "$as_me:17089: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17090 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17091 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17092   echo $ECHO_N "(cached) $ECHO_C" >&6
17093 else
17094   ac_check_lib_save_LIBS=$LIBS
17095 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17096 cat >conftest.$ac_ext <<_ACEOF
17097 #line 17097 "configure"
17098 #include "confdefs.h"
17099
17100 /* Override any gcc2 internal prototype to avoid an error.  */
17101 #ifdef __cplusplus
17102 extern "C"
17103 #endif
17104 /* We use char because int might match the return type of a gcc2
17105    builtin and then its argument prototype would still apply.  */
17106 char form_driver ();
17107 int
17108 main (void)
17109 {
17110 form_driver ();
17111   ;
17112   return 0;
17113 }
17114 _ACEOF
17115 rm -f conftest.$ac_objext conftest$ac_exeext
17116 if { (eval echo "$as_me:17116: \"$ac_link\"") >&5
17117   (eval $ac_link) 2>&5
17118   ac_status=$?
17119   echo "$as_me:17119: \$? = $ac_status" >&5
17120   (exit $ac_status); } &&
17121          { ac_try='test -s conftest$ac_exeext'
17122   { (eval echo "$as_me:17122: \"$ac_try\"") >&5
17123   (eval $ac_try) 2>&5
17124   ac_status=$?
17125   echo "$as_me:17125: \$? = $ac_status" >&5
17126   (exit $ac_status); }; }; then
17127   eval "$as_ac_Lib=yes"
17128 else
17129   echo "$as_me: failed program was:" >&5
17130 cat conftest.$ac_ext >&5
17131 eval "$as_ac_Lib=no"
17132 fi
17133 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17134 LIBS=$ac_check_lib_save_LIBS
17135 fi
17136 echo "$as_me:17136: result: `eval echo '${'$as_ac_Lib'}'`" >&5
17137 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
17138 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
17139
17140 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17141
17142 cf_add_libs="$LIBS"
17143 # reverse order
17144 cf_add_0lib=
17145 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17146 # filter duplicates
17147 for cf_add_1lib in $cf_add_0lib; do
17148         for cf_add_2lib in $cf_add_libs; do
17149                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17150                         cf_add_1lib=
17151                         break
17152                 fi
17153         done
17154         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17155 done
17156 LIBS="$cf_add_libs"
17157
17158                 cat >>confdefs.h <<EOF
17159 #define $cf_upper 1
17160 EOF
17161
17162 fi
17163
17164 fi
17165
17166         cf_curses_headers="$cf_curses_headers form.h"
17167 fi
17168
17169 # look for curses-related headers
17170
17171 for ac_header in $cf_curses_headers
17172 do
17173 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17174 echo "$as_me:17174: checking for $ac_header" >&5
17175 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17176 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17177   echo $ECHO_N "(cached) $ECHO_C" >&6
17178 else
17179   cat >conftest.$ac_ext <<_ACEOF
17180 #line 17180 "configure"
17181 #include "confdefs.h"
17182 #include <$ac_header>
17183 _ACEOF
17184 if { (eval echo "$as_me:17184: \"$ac_cpp conftest.$ac_ext\"") >&5
17185   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17186   ac_status=$?
17187   egrep -v '^ *\+' conftest.er1 >conftest.err
17188   rm -f conftest.er1
17189   cat conftest.err >&5
17190   echo "$as_me:17190: \$? = $ac_status" >&5
17191   (exit $ac_status); } >/dev/null; then
17192   if test -s conftest.err; then
17193     ac_cpp_err=$ac_c_preproc_warn_flag
17194   else
17195     ac_cpp_err=
17196   fi
17197 else
17198   ac_cpp_err=yes
17199 fi
17200 if test -z "$ac_cpp_err"; then
17201   eval "$as_ac_Header=yes"
17202 else
17203   echo "$as_me: failed program was:" >&5
17204   cat conftest.$ac_ext >&5
17205   eval "$as_ac_Header=no"
17206 fi
17207 rm -f conftest.err conftest.$ac_ext
17208 fi
17209 echo "$as_me:17209: result: `eval echo '${'$as_ac_Header'}'`" >&5
17210 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17211 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17212   cat >>confdefs.h <<EOF
17213 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17214 EOF
17215
17216 fi
17217 done
17218
17219 echo "$as_me:17219: checking for ANSI C header files" >&5
17220 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17221 if test "${ac_cv_header_stdc+set}" = set; then
17222   echo $ECHO_N "(cached) $ECHO_C" >&6
17223 else
17224   cat >conftest.$ac_ext <<_ACEOF
17225 #line 17225 "configure"
17226 #include "confdefs.h"
17227 #include <stdlib.h>
17228 #include <stdarg.h>
17229 #include <string.h>
17230 #include <float.h>
17231
17232 _ACEOF
17233 if { (eval echo "$as_me:17233: \"$ac_cpp conftest.$ac_ext\"") >&5
17234   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17235   ac_status=$?
17236   egrep -v '^ *\+' conftest.er1 >conftest.err
17237   rm -f conftest.er1
17238   cat conftest.err >&5
17239   echo "$as_me:17239: \$? = $ac_status" >&5
17240   (exit $ac_status); } >/dev/null; then
17241   if test -s conftest.err; then
17242     ac_cpp_err=$ac_c_preproc_warn_flag
17243   else
17244     ac_cpp_err=
17245   fi
17246 else
17247   ac_cpp_err=yes
17248 fi
17249 if test -z "$ac_cpp_err"; then
17250   ac_cv_header_stdc=yes
17251 else
17252   echo "$as_me: failed program was:" >&5
17253   cat conftest.$ac_ext >&5
17254   ac_cv_header_stdc=no
17255 fi
17256 rm -f conftest.err conftest.$ac_ext
17257
17258 if test $ac_cv_header_stdc = yes; then
17259   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17260   cat >conftest.$ac_ext <<_ACEOF
17261 #line 17261 "configure"
17262 #include "confdefs.h"
17263 #include <string.h>
17264
17265 _ACEOF
17266 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17267   egrep "memchr" >/dev/null 2>&1; then
17268   :
17269 else
17270   ac_cv_header_stdc=no
17271 fi
17272 rm -rf conftest*
17273
17274 fi
17275
17276 if test $ac_cv_header_stdc = yes; then
17277   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17278   cat >conftest.$ac_ext <<_ACEOF
17279 #line 17279 "configure"
17280 #include "confdefs.h"
17281 #include <stdlib.h>
17282
17283 _ACEOF
17284 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17285   egrep "free" >/dev/null 2>&1; then
17286   :
17287 else
17288   ac_cv_header_stdc=no
17289 fi
17290 rm -rf conftest*
17291
17292 fi
17293
17294 if test $ac_cv_header_stdc = yes; then
17295   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17296   if test "$cross_compiling" = yes; then
17297   :
17298 else
17299   cat >conftest.$ac_ext <<_ACEOF
17300 #line 17300 "configure"
17301 #include "confdefs.h"
17302 #include <ctype.h>
17303 #if ((' ' & 0x0FF) == 0x020)
17304 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17305 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17306 #else
17307 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17308                      || ('j' <= (c) && (c) <= 'r') \
17309                      || ('s' <= (c) && (c) <= 'z'))
17310 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17311 #endif
17312
17313 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17314 int
17315 main (void)
17316 {
17317   int i;
17318   for (i = 0; i < 256; i++)
17319     if (XOR (islower (i), ISLOWER (i))
17320         || toupper (i) != TOUPPER (i))
17321       $ac_main_return(2);
17322   $ac_main_return (0);
17323 }
17324 _ACEOF
17325 rm -f conftest$ac_exeext
17326 if { (eval echo "$as_me:17326: \"$ac_link\"") >&5
17327   (eval $ac_link) 2>&5
17328   ac_status=$?
17329   echo "$as_me:17329: \$? = $ac_status" >&5
17330   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17331   { (eval echo "$as_me:17331: \"$ac_try\"") >&5
17332   (eval $ac_try) 2>&5
17333   ac_status=$?
17334   echo "$as_me:17334: \$? = $ac_status" >&5
17335   (exit $ac_status); }; }; then
17336   :
17337 else
17338   echo "$as_me: program exited with status $ac_status" >&5
17339 echo "$as_me: failed program was:" >&5
17340 cat conftest.$ac_ext >&5
17341 ac_cv_header_stdc=no
17342 fi
17343 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17344 fi
17345 fi
17346 fi
17347 echo "$as_me:17347: result: $ac_cv_header_stdc" >&5
17348 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17349 if test $ac_cv_header_stdc = yes; then
17350
17351 cat >>confdefs.h <<\EOF
17352 #define STDC_HEADERS 1
17353 EOF
17354
17355 fi
17356
17357 echo "$as_me:17357: checking whether time.h and sys/time.h may both be included" >&5
17358 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17359 if test "${ac_cv_header_time+set}" = set; then
17360   echo $ECHO_N "(cached) $ECHO_C" >&6
17361 else
17362   cat >conftest.$ac_ext <<_ACEOF
17363 #line 17363 "configure"
17364 #include "confdefs.h"
17365 #include <sys/types.h>
17366 #include <sys/time.h>
17367 #include <time.h>
17368
17369 int
17370 main (void)
17371 {
17372 if ((struct tm *) 0)
17373 return 0;
17374   ;
17375   return 0;
17376 }
17377 _ACEOF
17378 rm -f conftest.$ac_objext
17379 if { (eval echo "$as_me:17379: \"$ac_compile\"") >&5
17380   (eval $ac_compile) 2>&5
17381   ac_status=$?
17382   echo "$as_me:17382: \$? = $ac_status" >&5
17383   (exit $ac_status); } &&
17384          { ac_try='test -s conftest.$ac_objext'
17385   { (eval echo "$as_me:17385: \"$ac_try\"") >&5
17386   (eval $ac_try) 2>&5
17387   ac_status=$?
17388   echo "$as_me:17388: \$? = $ac_status" >&5
17389   (exit $ac_status); }; }; then
17390   ac_cv_header_time=yes
17391 else
17392   echo "$as_me: failed program was:" >&5
17393 cat conftest.$ac_ext >&5
17394 ac_cv_header_time=no
17395 fi
17396 rm -f conftest.$ac_objext conftest.$ac_ext
17397 fi
17398 echo "$as_me:17398: result: $ac_cv_header_time" >&5
17399 echo "${ECHO_T}$ac_cv_header_time" >&6
17400 if test $ac_cv_header_time = yes; then
17401
17402 cat >>confdefs.h <<\EOF
17403 #define TIME_WITH_SYS_TIME 1
17404 EOF
17405
17406 fi
17407
17408 for ac_header in \
17409 getopt.h \
17410 locale.h \
17411 math.h \
17412 stdarg.h \
17413 stdint.h \
17414 sys/ioctl.h \
17415 sys/select.h \
17416 sys/time.h \
17417 termios.h \
17418 unistd.h \
17419
17420 do
17421 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17422 echo "$as_me:17422: checking for $ac_header" >&5
17423 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17424 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17425   echo $ECHO_N "(cached) $ECHO_C" >&6
17426 else
17427   cat >conftest.$ac_ext <<_ACEOF
17428 #line 17428 "configure"
17429 #include "confdefs.h"
17430 #include <$ac_header>
17431 _ACEOF
17432 if { (eval echo "$as_me:17432: \"$ac_cpp conftest.$ac_ext\"") >&5
17433   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17434   ac_status=$?
17435   egrep -v '^ *\+' conftest.er1 >conftest.err
17436   rm -f conftest.er1
17437   cat conftest.err >&5
17438   echo "$as_me:17438: \$? = $ac_status" >&5
17439   (exit $ac_status); } >/dev/null; then
17440   if test -s conftest.err; then
17441     ac_cpp_err=$ac_c_preproc_warn_flag
17442   else
17443     ac_cpp_err=
17444   fi
17445 else
17446   ac_cpp_err=yes
17447 fi
17448 if test -z "$ac_cpp_err"; then
17449   eval "$as_ac_Header=yes"
17450 else
17451   echo "$as_me: failed program was:" >&5
17452   cat conftest.$ac_ext >&5
17453   eval "$as_ac_Header=no"
17454 fi
17455 rm -f conftest.err conftest.$ac_ext
17456 fi
17457 echo "$as_me:17457: result: `eval echo '${'$as_ac_Header'}'`" >&5
17458 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17459 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17460   cat >>confdefs.h <<EOF
17461 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17462 EOF
17463
17464 fi
17465 done
17466
17467 for ac_header in unistd.h getopt.h
17468 do
17469 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17470 echo "$as_me:17470: checking for $ac_header" >&5
17471 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17472 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17473   echo $ECHO_N "(cached) $ECHO_C" >&6
17474 else
17475   cat >conftest.$ac_ext <<_ACEOF
17476 #line 17476 "configure"
17477 #include "confdefs.h"
17478 #include <$ac_header>
17479 _ACEOF
17480 if { (eval echo "$as_me:17480: \"$ac_cpp conftest.$ac_ext\"") >&5
17481   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17482   ac_status=$?
17483   egrep -v '^ *\+' conftest.er1 >conftest.err
17484   rm -f conftest.er1
17485   cat conftest.err >&5
17486   echo "$as_me:17486: \$? = $ac_status" >&5
17487   (exit $ac_status); } >/dev/null; then
17488   if test -s conftest.err; then
17489     ac_cpp_err=$ac_c_preproc_warn_flag
17490   else
17491     ac_cpp_err=
17492   fi
17493 else
17494   ac_cpp_err=yes
17495 fi
17496 if test -z "$ac_cpp_err"; then
17497   eval "$as_ac_Header=yes"
17498 else
17499   echo "$as_me: failed program was:" >&5
17500   cat conftest.$ac_ext >&5
17501   eval "$as_ac_Header=no"
17502 fi
17503 rm -f conftest.err conftest.$ac_ext
17504 fi
17505 echo "$as_me:17505: result: `eval echo '${'$as_ac_Header'}'`" >&5
17506 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17507 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17508   cat >>confdefs.h <<EOF
17509 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17510 EOF
17511
17512 fi
17513 done
17514
17515 echo "$as_me:17515: checking for header declaring getopt variables" >&5
17516 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17517 if test "${cf_cv_getopt_header+set}" = set; then
17518   echo $ECHO_N "(cached) $ECHO_C" >&6
17519 else
17520
17521 cf_cv_getopt_header=none
17522 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17523 do
17524 cat >conftest.$ac_ext <<_ACEOF
17525 #line 17525 "configure"
17526 #include "confdefs.h"
17527
17528 #include <$cf_header>
17529 int
17530 main (void)
17531 {
17532 int x = optind; char *y = optarg
17533   ;
17534   return 0;
17535 }
17536 _ACEOF
17537 rm -f conftest.$ac_objext
17538 if { (eval echo "$as_me:17538: \"$ac_compile\"") >&5
17539   (eval $ac_compile) 2>&5
17540   ac_status=$?
17541   echo "$as_me:17541: \$? = $ac_status" >&5
17542   (exit $ac_status); } &&
17543          { ac_try='test -s conftest.$ac_objext'
17544   { (eval echo "$as_me:17544: \"$ac_try\"") >&5
17545   (eval $ac_try) 2>&5
17546   ac_status=$?
17547   echo "$as_me:17547: \$? = $ac_status" >&5
17548   (exit $ac_status); }; }; then
17549   cf_cv_getopt_header=$cf_header
17550  break
17551 else
17552   echo "$as_me: failed program was:" >&5
17553 cat conftest.$ac_ext >&5
17554 fi
17555 rm -f conftest.$ac_objext conftest.$ac_ext
17556 done
17557
17558 fi
17559 echo "$as_me:17559: result: $cf_cv_getopt_header" >&5
17560 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17561 if test $cf_cv_getopt_header != none ; then
17562
17563 cat >>confdefs.h <<\EOF
17564 #define HAVE_GETOPT_HEADER 1
17565 EOF
17566
17567 fi
17568 if test $cf_cv_getopt_header = getopt.h ; then
17569
17570 cat >>confdefs.h <<\EOF
17571 #define NEED_GETOPT_H 1
17572 EOF
17573
17574 fi
17575
17576 for ac_func in \
17577 getopt \
17578 gettimeofday \
17579 strstr \
17580 tsearch \
17581
17582 do
17583 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17584 echo "$as_me:17584: checking for $ac_func" >&5
17585 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17586 if eval "test \"\${$as_ac_var+set}\" = set"; then
17587   echo $ECHO_N "(cached) $ECHO_C" >&6
17588 else
17589   cat >conftest.$ac_ext <<_ACEOF
17590 #line 17590 "configure"
17591 #include "confdefs.h"
17592 #define $ac_func autoconf_temporary
17593 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17594 #undef $ac_func
17595
17596 #ifdef __cplusplus
17597 extern "C"
17598 #endif
17599
17600 /* We use char because int might match the return type of a gcc2
17601    builtin and then its argument prototype would still apply.  */
17602 char $ac_func (void);
17603
17604 int
17605 main (void)
17606 {
17607
17608 /* The GNU C library defines stubs for functions which it implements
17609     to always fail with ENOSYS.  Some functions are actually named
17610     something starting with __ and the normal name is an alias.  */
17611 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17612 #error found stub for $ac_func
17613 #endif
17614
17615         return $ac_func ();
17616   ;
17617   return 0;
17618 }
17619 _ACEOF
17620 rm -f conftest.$ac_objext conftest$ac_exeext
17621 if { (eval echo "$as_me:17621: \"$ac_link\"") >&5
17622   (eval $ac_link) 2>&5
17623   ac_status=$?
17624   echo "$as_me:17624: \$? = $ac_status" >&5
17625   (exit $ac_status); } &&
17626          { ac_try='test -s conftest$ac_exeext'
17627   { (eval echo "$as_me:17627: \"$ac_try\"") >&5
17628   (eval $ac_try) 2>&5
17629   ac_status=$?
17630   echo "$as_me:17630: \$? = $ac_status" >&5
17631   (exit $ac_status); }; }; then
17632   eval "$as_ac_var=yes"
17633 else
17634   echo "$as_me: failed program was:" >&5
17635 cat conftest.$ac_ext >&5
17636 eval "$as_ac_var=no"
17637 fi
17638 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17639 fi
17640 echo "$as_me:17640: result: `eval echo '${'$as_ac_var'}'`" >&5
17641 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17642 if test `eval echo '${'$as_ac_var'}'` = yes; then
17643   cat >>confdefs.h <<EOF
17644 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17645 EOF
17646
17647 fi
17648 done
17649
17650 # use a compile-check to work with ncurses*-config and subdirectory includes
17651 echo "$as_me:17651: checking if we can use termcap.h" >&5
17652 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17653 if test "${cf_cv_have_termcap_h+set}" = set; then
17654   echo $ECHO_N "(cached) $ECHO_C" >&6
17655 else
17656
17657         cat >conftest.$ac_ext <<_ACEOF
17658 #line 17658 "configure"
17659 #include "confdefs.h"
17660
17661 #include <curses.h>
17662 #ifdef NCURSES_VERSION
17663 #undef NCURSES_VERSION
17664 #endif
17665 #include <termcap.h>
17666 #ifndef NCURSES_VERSION
17667 #error wrong header
17668 #endif
17669
17670 int
17671 main (void)
17672 {
17673 return 0;
17674   ;
17675   return 0;
17676 }
17677 _ACEOF
17678 rm -f conftest.$ac_objext
17679 if { (eval echo "$as_me:17679: \"$ac_compile\"") >&5
17680   (eval $ac_compile) 2>&5
17681   ac_status=$?
17682   echo "$as_me:17682: \$? = $ac_status" >&5
17683   (exit $ac_status); } &&
17684          { ac_try='test -s conftest.$ac_objext'
17685   { (eval echo "$as_me:17685: \"$ac_try\"") >&5
17686   (eval $ac_try) 2>&5
17687   ac_status=$?
17688   echo "$as_me:17688: \$? = $ac_status" >&5
17689   (exit $ac_status); }; }; then
17690   cf_cv_have_termcap_h=yes
17691 else
17692   echo "$as_me: failed program was:" >&5
17693 cat conftest.$ac_ext >&5
17694 cf_cv_have_termcap_h=no
17695 fi
17696 rm -f conftest.$ac_objext conftest.$ac_ext
17697 fi
17698 echo "$as_me:17698: result: $cf_cv_have_termcap_h" >&5
17699 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17700 if test "x$cf_cv_have_termcap_h" = xyes
17701 then
17702
17703 cat >>confdefs.h <<\EOF
17704 #define HAVE_TERMCAP_H 1
17705 EOF
17706
17707 else
17708 echo "$as_me:17708: checking if we can use ncurses/termcap.h" >&5
17709 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17710 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17711   echo $ECHO_N "(cached) $ECHO_C" >&6
17712 else
17713
17714         cat >conftest.$ac_ext <<_ACEOF
17715 #line 17715 "configure"
17716 #include "confdefs.h"
17717
17718 #include <ncurses/curses.h>
17719 #ifdef NCURSES_VERSION
17720 #undef NCURSES_VERSION
17721 #endif
17722 #include <ncurses/termcap.h>
17723 #ifndef NCURSES_VERSION
17724 #error wrong header
17725 #endif
17726
17727 int
17728 main (void)
17729 {
17730 return 0;
17731   ;
17732   return 0;
17733 }
17734 _ACEOF
17735 rm -f conftest.$ac_objext
17736 if { (eval echo "$as_me:17736: \"$ac_compile\"") >&5
17737   (eval $ac_compile) 2>&5
17738   ac_status=$?
17739   echo "$as_me:17739: \$? = $ac_status" >&5
17740   (exit $ac_status); } &&
17741          { ac_try='test -s conftest.$ac_objext'
17742   { (eval echo "$as_me:17742: \"$ac_try\"") >&5
17743   (eval $ac_try) 2>&5
17744   ac_status=$?
17745   echo "$as_me:17745: \$? = $ac_status" >&5
17746   (exit $ac_status); }; }; then
17747   cf_cv_have_ncurses_termcap_h=yes
17748 else
17749   echo "$as_me: failed program was:" >&5
17750 cat conftest.$ac_ext >&5
17751 cf_cv_have_ncurses_termcap_h=no
17752 fi
17753 rm -f conftest.$ac_objext conftest.$ac_ext
17754 fi
17755 echo "$as_me:17755: result: $cf_cv_have_ncurses_termcap_h" >&5
17756 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17757 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
17758 cat >>confdefs.h <<\EOF
17759 #define HAVE_NCURSES_TERMCAP_H 1
17760 EOF
17761
17762 fi
17763
17764 if test "x$ac_cv_func_getopt" = xno; then
17765         { { echo "$as_me:17765: error: getopt is required for building programs" >&5
17766 echo "$as_me: error: getopt is required for building programs" >&2;}
17767    { (exit 1); exit 1; }; }
17768 fi
17769
17770 if test "$cf_enable_widec" = yes; then
17771
17772 for ac_func in \
17773 mblen \
17774 mbrlen \
17775 mbrtowc \
17776 mbsrtowcs \
17777 mbstowcs \
17778 mbtowc \
17779 wcsrtombs \
17780 wcstombs \
17781
17782 do
17783 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17784 echo "$as_me:17784: checking for $ac_func" >&5
17785 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17786 if eval "test \"\${$as_ac_var+set}\" = set"; then
17787   echo $ECHO_N "(cached) $ECHO_C" >&6
17788 else
17789   cat >conftest.$ac_ext <<_ACEOF
17790 #line 17790 "configure"
17791 #include "confdefs.h"
17792 #define $ac_func autoconf_temporary
17793 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17794 #undef $ac_func
17795
17796 #ifdef __cplusplus
17797 extern "C"
17798 #endif
17799
17800 /* We use char because int might match the return type of a gcc2
17801    builtin and then its argument prototype would still apply.  */
17802 char $ac_func (void);
17803
17804 int
17805 main (void)
17806 {
17807
17808 /* The GNU C library defines stubs for functions which it implements
17809     to always fail with ENOSYS.  Some functions are actually named
17810     something starting with __ and the normal name is an alias.  */
17811 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17812 #error found stub for $ac_func
17813 #endif
17814
17815         return $ac_func ();
17816   ;
17817   return 0;
17818 }
17819 _ACEOF
17820 rm -f conftest.$ac_objext conftest$ac_exeext
17821 if { (eval echo "$as_me:17821: \"$ac_link\"") >&5
17822   (eval $ac_link) 2>&5
17823   ac_status=$?
17824   echo "$as_me:17824: \$? = $ac_status" >&5
17825   (exit $ac_status); } &&
17826          { ac_try='test -s conftest$ac_exeext'
17827   { (eval echo "$as_me:17827: \"$ac_try\"") >&5
17828   (eval $ac_try) 2>&5
17829   ac_status=$?
17830   echo "$as_me:17830: \$? = $ac_status" >&5
17831   (exit $ac_status); }; }; then
17832   eval "$as_ac_var=yes"
17833 else
17834   echo "$as_me: failed program was:" >&5
17835 cat conftest.$ac_ext >&5
17836 eval "$as_ac_var=no"
17837 fi
17838 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17839 fi
17840 echo "$as_me:17840: result: `eval echo '${'$as_ac_var'}'`" >&5
17841 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17842 if test `eval echo '${'$as_ac_var'}'` = yes; then
17843   cat >>confdefs.h <<EOF
17844 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17845 EOF
17846
17847 fi
17848 done
17849
17850 fi
17851
17852 echo "$as_me:17852: checking definition to turn on extended curses functions" >&5
17853 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17854 if test "${cf_cv_need_xopen_extension+set}" = set; then
17855   echo $ECHO_N "(cached) $ECHO_C" >&6
17856 else
17857
17858 cf_cv_need_xopen_extension=unknown
17859 cat >conftest.$ac_ext <<_ACEOF
17860 #line 17860 "configure"
17861 #include "confdefs.h"
17862
17863 #include <stdlib.h>
17864 #include <${cf_cv_ncurses_header:-curses.h}>
17865 int
17866 main (void)
17867 {
17868
17869 #if defined(NCURSES_VERSION_PATCH)
17870 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17871         make an error
17872 #endif
17873 #endif
17874 #ifdef NCURSES_VERSION
17875         cchar_t check;
17876         int check2 = curs_set((int)sizeof(check));
17877 #endif
17878         long x = winnstr(stdscr, "", 0);
17879         int x1, y1;
17880 #ifdef NCURSES_VERSION
17881         (void)check2;
17882 #endif
17883         getbegyx(stdscr, y1, x1);
17884         (void)x;
17885         (void)y1;
17886         (void)x1;
17887
17888   ;
17889   return 0;
17890 }
17891 _ACEOF
17892 rm -f conftest.$ac_objext conftest$ac_exeext
17893 if { (eval echo "$as_me:17893: \"$ac_link\"") >&5
17894   (eval $ac_link) 2>&5
17895   ac_status=$?
17896   echo "$as_me:17896: \$? = $ac_status" >&5
17897   (exit $ac_status); } &&
17898          { ac_try='test -s conftest$ac_exeext'
17899   { (eval echo "$as_me:17899: \"$ac_try\"") >&5
17900   (eval $ac_try) 2>&5
17901   ac_status=$?
17902   echo "$as_me:17902: \$? = $ac_status" >&5
17903   (exit $ac_status); }; }; then
17904   cf_cv_need_xopen_extension=none
17905 else
17906   echo "$as_me: failed program was:" >&5
17907 cat conftest.$ac_ext >&5
17908
17909         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17910         do
17911                 cat >conftest.$ac_ext <<_ACEOF
17912 #line 17912 "configure"
17913 #include "confdefs.h"
17914
17915 #define $cf_try_xopen_extension 1
17916 #include <stdlib.h>
17917 #include <${cf_cv_ncurses_header:-curses.h}>
17918 int
17919 main (void)
17920 {
17921
17922 #ifdef NCURSES_VERSION
17923                 cchar_t check;
17924                 int check2 = curs_set((int)sizeof(check));
17925 #endif
17926                 long x = winnstr(stdscr, "", 0);
17927                 int x1, y1;
17928                 getbegyx(stdscr, y1, x1);
17929 #ifdef NCURSES_VERSION
17930                 (void)check2;
17931 #endif
17932                 (void)x;
17933                 (void)y1;
17934                 (void)x1;
17935
17936   ;
17937   return 0;
17938 }
17939 _ACEOF
17940 rm -f conftest.$ac_objext conftest$ac_exeext
17941 if { (eval echo "$as_me:17941: \"$ac_link\"") >&5
17942   (eval $ac_link) 2>&5
17943   ac_status=$?
17944   echo "$as_me:17944: \$? = $ac_status" >&5
17945   (exit $ac_status); } &&
17946          { ac_try='test -s conftest$ac_exeext'
17947   { (eval echo "$as_me:17947: \"$ac_try\"") >&5
17948   (eval $ac_try) 2>&5
17949   ac_status=$?
17950   echo "$as_me:17950: \$? = $ac_status" >&5
17951   (exit $ac_status); }; }; then
17952   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17953 else
17954   echo "$as_me: failed program was:" >&5
17955 cat conftest.$ac_ext >&5
17956 fi
17957 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17958         done
17959
17960 fi
17961 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17962
17963 fi
17964 echo "$as_me:17964: result: $cf_cv_need_xopen_extension" >&5
17965 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17966
17967 case $cf_cv_need_xopen_extension in
17968 (*_*)
17969
17970         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17971         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17972
17973         ;;
17974 esac
17975
17976 echo "$as_me:17976: checking for term.h" >&5
17977 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17978 if test "${cf_cv_term_header+set}" = set; then
17979   echo $ECHO_N "(cached) $ECHO_C" >&6
17980 else
17981
17982 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17983 # for <term.h> if we do not find the variant.
17984
17985 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17986
17987 case ${cf_cv_ncurses_header:-curses.h} in
17988 (*/*)
17989         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17990         cf_header_list="$cf_header_item $cf_header_list"
17991         ;;
17992 esac
17993
17994 for cf_header in $cf_header_list
17995 do
17996         cat >conftest.$ac_ext <<_ACEOF
17997 #line 17997 "configure"
17998 #include "confdefs.h"
17999
18000 #include <${cf_cv_ncurses_header:-curses.h}>
18001 #include <${cf_header}>
18002 int
18003 main (void)
18004 {
18005 WINDOW *x; (void)x
18006   ;
18007   return 0;
18008 }
18009 _ACEOF
18010 rm -f conftest.$ac_objext
18011 if { (eval echo "$as_me:18011: \"$ac_compile\"") >&5
18012   (eval $ac_compile) 2>&5
18013   ac_status=$?
18014   echo "$as_me:18014: \$? = $ac_status" >&5
18015   (exit $ac_status); } &&
18016          { ac_try='test -s conftest.$ac_objext'
18017   { (eval echo "$as_me:18017: \"$ac_try\"") >&5
18018   (eval $ac_try) 2>&5
18019   ac_status=$?
18020   echo "$as_me:18020: \$? = $ac_status" >&5
18021   (exit $ac_status); }; }; then
18022   cf_cv_term_header=$cf_header
18023          break
18024 else
18025   echo "$as_me: failed program was:" >&5
18026 cat conftest.$ac_ext >&5
18027 cf_cv_term_header=no
18028 fi
18029 rm -f conftest.$ac_objext conftest.$ac_ext
18030 done
18031
18032 case $cf_cv_term_header in
18033 (no)
18034         # If curses is ncurses, some packagers still mess it up by trying to make
18035         # us use GNU termcap.  This handles the most common case.
18036         for cf_header in ncurses/term.h ncursesw/term.h
18037         do
18038                 cat >conftest.$ac_ext <<_ACEOF
18039 #line 18039 "configure"
18040 #include "confdefs.h"
18041
18042 #include <${cf_cv_ncurses_header:-curses.h}>
18043 #ifdef NCURSES_VERSION
18044 #include <${cf_header}>
18045 #else
18046 make an error
18047 #endif
18048 int
18049 main (void)
18050 {
18051 WINDOW *x; (void)x
18052   ;
18053   return 0;
18054 }
18055 _ACEOF
18056 rm -f conftest.$ac_objext
18057 if { (eval echo "$as_me:18057: \"$ac_compile\"") >&5
18058   (eval $ac_compile) 2>&5
18059   ac_status=$?
18060   echo "$as_me:18060: \$? = $ac_status" >&5
18061   (exit $ac_status); } &&
18062          { ac_try='test -s conftest.$ac_objext'
18063   { (eval echo "$as_me:18063: \"$ac_try\"") >&5
18064   (eval $ac_try) 2>&5
18065   ac_status=$?
18066   echo "$as_me:18066: \$? = $ac_status" >&5
18067   (exit $ac_status); }; }; then
18068   cf_cv_term_header=$cf_header
18069                          break
18070 else
18071   echo "$as_me: failed program was:" >&5
18072 cat conftest.$ac_ext >&5
18073 cf_cv_term_header=no
18074 fi
18075 rm -f conftest.$ac_objext conftest.$ac_ext
18076         done
18077         ;;
18078 esac
18079
18080 fi
18081 echo "$as_me:18081: result: $cf_cv_term_header" >&5
18082 echo "${ECHO_T}$cf_cv_term_header" >&6
18083
18084 case $cf_cv_term_header in
18085 (term.h)
18086
18087 cat >>confdefs.h <<\EOF
18088 #define HAVE_TERM_H 1
18089 EOF
18090
18091         ;;
18092 (ncurses/term.h)
18093
18094 cat >>confdefs.h <<\EOF
18095 #define HAVE_NCURSES_TERM_H 1
18096 EOF
18097
18098         ;;
18099 (ncursesw/term.h)
18100
18101 cat >>confdefs.h <<\EOF
18102 #define HAVE_NCURSESW_TERM_H 1
18103 EOF
18104
18105         ;;
18106 esac
18107
18108 echo "$as_me:18108: checking for unctrl.h" >&5
18109 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18110 if test "${cf_cv_unctrl_header+set}" = set; then
18111   echo $ECHO_N "(cached) $ECHO_C" >&6
18112 else
18113
18114 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18115 # for <unctrl.h> if we do not find the variant.
18116
18117 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18118
18119 case ${cf_cv_ncurses_header:-curses.h} in
18120 (*/*)
18121         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18122         cf_header_list="$cf_header_item $cf_header_list"
18123         ;;
18124 esac
18125
18126 for cf_header in $cf_header_list
18127 do
18128         cat >conftest.$ac_ext <<_ACEOF
18129 #line 18129 "configure"
18130 #include "confdefs.h"
18131
18132 #include <${cf_cv_ncurses_header:-curses.h}>
18133 #include <${cf_header}>
18134 int
18135 main (void)
18136 {
18137 WINDOW *x; (void)x
18138   ;
18139   return 0;
18140 }
18141 _ACEOF
18142 rm -f conftest.$ac_objext
18143 if { (eval echo "$as_me:18143: \"$ac_compile\"") >&5
18144   (eval $ac_compile) 2>&5
18145   ac_status=$?
18146   echo "$as_me:18146: \$? = $ac_status" >&5
18147   (exit $ac_status); } &&
18148          { ac_try='test -s conftest.$ac_objext'
18149   { (eval echo "$as_me:18149: \"$ac_try\"") >&5
18150   (eval $ac_try) 2>&5
18151   ac_status=$?
18152   echo "$as_me:18152: \$? = $ac_status" >&5
18153   (exit $ac_status); }; }; then
18154   cf_cv_unctrl_header=$cf_header
18155          break
18156 else
18157   echo "$as_me: failed program was:" >&5
18158 cat conftest.$ac_ext >&5
18159 cf_cv_unctrl_header=no
18160 fi
18161 rm -f conftest.$ac_objext conftest.$ac_ext
18162 done
18163
18164 fi
18165 echo "$as_me:18165: result: $cf_cv_unctrl_header" >&5
18166 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18167
18168 case $cf_cv_unctrl_header in
18169 (no)
18170         { echo "$as_me:18170: WARNING: unctrl.h header not found" >&5
18171 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18172         ;;
18173 esac
18174
18175 case $cf_cv_unctrl_header in
18176 (unctrl.h)
18177
18178 cat >>confdefs.h <<\EOF
18179 #define HAVE_UNCTRL_H 1
18180 EOF
18181
18182         ;;
18183 (ncurses/unctrl.h)
18184
18185 cat >>confdefs.h <<\EOF
18186 #define HAVE_NCURSES_UNCTRL_H 1
18187 EOF
18188
18189         ;;
18190 (ncursesw/unctrl.h)
18191
18192 cat >>confdefs.h <<\EOF
18193 #define HAVE_NCURSESW_UNCTRL_H 1
18194 EOF
18195
18196         ;;
18197 esac
18198
18199 for cf_func in \
18200 alloc_pair \
18201 assume_default_colors \
18202 chgat \
18203 color_content \
18204 color_set \
18205 copywin \
18206 delscreen \
18207 dupwin \
18208 filter \
18209 getbegx \
18210 getcurx \
18211 getmaxx \
18212 getnstr \
18213 getparx \
18214 getwin \
18215 halfdelay \
18216 init_extended_color \
18217 mvderwin \
18218 mvvline \
18219 mvwin \
18220 mvwvline \
18221 napms \
18222 newpad \
18223 putwin \
18224 reset_color_pairs \
18225 resize_term \
18226 resizeterm \
18227 restartterm \
18228 ripoffline \
18229 scr_dump \
18230 setupterm \
18231 slk_color \
18232 slk_init \
18233 termattrs \
18234 tgetent \
18235 tigetnum \
18236 tigetstr \
18237 tputs_sp \
18238 typeahead \
18239 use_default_colors \
18240 use_env \
18241 use_extended_names \
18242 use_screen \
18243 use_window \
18244 vid_puts \
18245 vidputs \
18246 vsscanf \
18247 vw_printw \
18248 wchgat \
18249 winsdelln \
18250 winsstr \
18251 wresize \
18252 wsyncdown \
18253 _tracef \
18254
18255 do
18256
18257 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18258
18259         echo "$as_me:18259: checking for ${cf_func}" >&5
18260 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18261
18262 echo "${as_me:-configure}:18262: testing ${cf_func} ..." 1>&5
18263
18264         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18265   echo $ECHO_N "(cached) $ECHO_C" >&6
18266 else
18267
18268                 eval cf_result='$ac_cv_func_'$cf_func
18269                 if test ".$cf_result" != ".no"; then
18270                         cat >conftest.$ac_ext <<_ACEOF
18271 #line 18271 "configure"
18272 #include "confdefs.h"
18273
18274 #ifdef HAVE_XCURSES
18275 #include <xcurses.h>
18276 char * XCursesProgramName = "test";
18277 #else
18278 #include <${cf_cv_ncurses_header:-curses.h}>
18279 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18280 #include <ncursesw/term.h>
18281 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18282 #include <ncurses/term.h>
18283 #elif defined(HAVE_TERM_H)
18284 #include <term.h>
18285 #endif
18286 #endif
18287
18288 int
18289 main (void)
18290 {
18291
18292 #ifndef ${cf_func}
18293 long foo = (long)(&${cf_func});
18294 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18295 if (foo + 1234L > 5678L)
18296         ${cf_cv_main_return:-return}(foo != 0);
18297 #endif
18298
18299   ;
18300   return 0;
18301 }
18302 _ACEOF
18303 rm -f conftest.$ac_objext conftest$ac_exeext
18304 if { (eval echo "$as_me:18304: \"$ac_link\"") >&5
18305   (eval $ac_link) 2>&5
18306   ac_status=$?
18307   echo "$as_me:18307: \$? = $ac_status" >&5
18308   (exit $ac_status); } &&
18309          { ac_try='test -s conftest$ac_exeext'
18310   { (eval echo "$as_me:18310: \"$ac_try\"") >&5
18311   (eval $ac_try) 2>&5
18312   ac_status=$?
18313   echo "$as_me:18313: \$? = $ac_status" >&5
18314   (exit $ac_status); }; }; then
18315   cf_result=yes
18316 else
18317   echo "$as_me: failed program was:" >&5
18318 cat conftest.$ac_ext >&5
18319 cf_result=no
18320 fi
18321 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18322                 fi
18323                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18324
18325 fi
18326
18327         # use the computed/retrieved cache-value:
18328         eval 'cf_result=$cf_cv_func_'$cf_func
18329         echo "$as_me:18329: result: $cf_result" >&5
18330 echo "${ECHO_T}$cf_result" >&6
18331         if test $cf_result != no; then
18332                 cat >>confdefs.h <<EOF
18333 #define HAVE_${cf_tr_func} 1
18334 EOF
18335
18336         fi
18337 done
18338
18339 for cf_func in tputs
18340 do
18341
18342 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18343
18344         echo "$as_me:18344: checking for ${cf_func}" >&5
18345 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18346
18347 echo "${as_me:-configure}:18347: testing ${cf_func} ..." 1>&5
18348
18349         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18350   echo $ECHO_N "(cached) $ECHO_C" >&6
18351 else
18352
18353                 eval cf_result='$ac_cv_func_'$cf_func
18354                 if test ".$cf_result" != ".no"; then
18355                         cat >conftest.$ac_ext <<_ACEOF
18356 #line 18356 "configure"
18357 #include "confdefs.h"
18358
18359 #ifdef HAVE_XCURSES
18360 #include <xcurses.h>
18361 char * XCursesProgramName = "test";
18362 #else
18363 #include <${cf_cv_ncurses_header:-curses.h}>
18364 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18365 #include <ncursesw/term.h>
18366 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18367 #include <ncurses/term.h>
18368 #elif defined(HAVE_TERM_H)
18369 #include <term.h>
18370 #endif
18371 #endif
18372
18373 int
18374 main (void)
18375 {
18376
18377 #ifndef ${cf_func}
18378 long foo = (long)(&${cf_func});
18379 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18380 if (foo + 1234L > 5678L)
18381         ${cf_cv_main_return:-return}(foo != 0);
18382 #endif
18383
18384   ;
18385   return 0;
18386 }
18387 _ACEOF
18388 rm -f conftest.$ac_objext conftest$ac_exeext
18389 if { (eval echo "$as_me:18389: \"$ac_link\"") >&5
18390   (eval $ac_link) 2>&5
18391   ac_status=$?
18392   echo "$as_me:18392: \$? = $ac_status" >&5
18393   (exit $ac_status); } &&
18394          { ac_try='test -s conftest$ac_exeext'
18395   { (eval echo "$as_me:18395: \"$ac_try\"") >&5
18396   (eval $ac_try) 2>&5
18397   ac_status=$?
18398   echo "$as_me:18398: \$? = $ac_status" >&5
18399   (exit $ac_status); }; }; then
18400   cf_result=yes
18401 else
18402   echo "$as_me: failed program was:" >&5
18403 cat conftest.$ac_ext >&5
18404 cf_result=no
18405 fi
18406 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18407                 fi
18408                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18409
18410 fi
18411
18412         # use the computed/retrieved cache-value:
18413         eval 'cf_result=$cf_cv_func_'$cf_func
18414         echo "$as_me:18414: result: $cf_result" >&5
18415 echo "${ECHO_T}$cf_result" >&6
18416         if test $cf_result != no; then
18417                 cat >>confdefs.h <<EOF
18418 #define HAVE_${cf_tr_func} 1
18419 EOF
18420
18421         fi
18422 done
18423
18424 if test x$cf_cv_func_tputs = xyes
18425 then
18426         cf_done=no
18427         for cf_arg in int char
18428         do
18429                 for cf_ret in int void
18430                 do
18431                         if test $cf_ret = void
18432                         then
18433                                 cf_return="/* nothing */"
18434                         else
18435                                 cf_return="return value"
18436                         fi
18437                         cat >conftest.$ac_ext <<_ACEOF
18438 #line 18438 "configure"
18439 #include "confdefs.h"
18440
18441 #include <${cf_cv_ncurses_header:-curses.h}>
18442 #include <$cf_cv_term_header>
18443
18444 static $cf_ret outc($cf_arg value) { $cf_return; }
18445
18446 int
18447 main (void)
18448 {
18449
18450         tputs("hello", 0, outc);
18451         ${cf_cv_main_return:-return}(0);
18452
18453   ;
18454   return 0;
18455 }
18456 _ACEOF
18457 rm -f conftest.$ac_objext
18458 if { (eval echo "$as_me:18458: \"$ac_compile\"") >&5
18459   (eval $ac_compile) 2>&5
18460   ac_status=$?
18461   echo "$as_me:18461: \$? = $ac_status" >&5
18462   (exit $ac_status); } &&
18463          { ac_try='test -s conftest.$ac_objext'
18464   { (eval echo "$as_me:18464: \"$ac_try\"") >&5
18465   (eval $ac_try) 2>&5
18466   ac_status=$?
18467   echo "$as_me:18467: \$? = $ac_status" >&5
18468   (exit $ac_status); }; }; then
18469
18470                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18471
18472 echo "${as_me:-configure}:18472: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18473
18474                 cat >>confdefs.h <<EOF
18475 #define TPUTS_ARG               $cf_arg
18476 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18477 #define TPUTS_RETURN(value)     $cf_return
18478 EOF
18479                 cf_done=yes
18480                 break
18481
18482 else
18483   echo "$as_me: failed program was:" >&5
18484 cat conftest.$ac_ext >&5
18485 fi
18486 rm -f conftest.$ac_objext conftest.$ac_ext
18487                 done
18488                 test $cf_done = yes && break
18489         done
18490 fi
18491
18492 echo "$as_me:18492: checking for ncurses extended functions" >&5
18493 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18494 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18495   echo $ECHO_N "(cached) $ECHO_C" >&6
18496 else
18497
18498 cat >conftest.$ac_ext <<_ACEOF
18499 #line 18499 "configure"
18500 #include "confdefs.h"
18501
18502 #include <${cf_cv_ncurses_header:-curses.h}>
18503 int
18504 main (void)
18505 {
18506
18507 int x = NCURSES_EXT_FUNCS
18508
18509   ;
18510   return 0;
18511 }
18512 _ACEOF
18513 rm -f conftest.$ac_objext
18514 if { (eval echo "$as_me:18514: \"$ac_compile\"") >&5
18515   (eval $ac_compile) 2>&5
18516   ac_status=$?
18517   echo "$as_me:18517: \$? = $ac_status" >&5
18518   (exit $ac_status); } &&
18519          { ac_try='test -s conftest.$ac_objext'
18520   { (eval echo "$as_me:18520: \"$ac_try\"") >&5
18521   (eval $ac_try) 2>&5
18522   ac_status=$?
18523   echo "$as_me:18523: \$? = $ac_status" >&5
18524   (exit $ac_status); }; }; then
18525   cf_cv_ncurses_ext_funcs=defined
18526 else
18527   echo "$as_me: failed program was:" >&5
18528 cat conftest.$ac_ext >&5
18529
18530 cat >conftest.$ac_ext <<_ACEOF
18531 #line 18531 "configure"
18532 #include "confdefs.h"
18533
18534 #include <${cf_cv_ncurses_header:-curses.h}>
18535 int
18536 main (void)
18537 {
18538
18539         (void) assume_default_colors (0, 0);
18540         (void) curses_version ();
18541         (void) define_key (0, 0);
18542         (void) is_term_resized (0, 0);
18543         (void) key_defined (0);
18544         (void) keybound (0, 0);
18545         (void) keyok (0, 0);
18546         (void) resize_term (0, 0);
18547         (void) resizeterm (0, 0);
18548         (void) use_default_colors ();
18549         (void) use_extended_names (0);
18550         (void) wresize (0, 0, 0);
18551   ;
18552   return 0;
18553 }
18554 _ACEOF
18555 rm -f conftest.$ac_objext conftest$ac_exeext
18556 if { (eval echo "$as_me:18556: \"$ac_link\"") >&5
18557   (eval $ac_link) 2>&5
18558   ac_status=$?
18559   echo "$as_me:18559: \$? = $ac_status" >&5
18560   (exit $ac_status); } &&
18561          { ac_try='test -s conftest$ac_exeext'
18562   { (eval echo "$as_me:18562: \"$ac_try\"") >&5
18563   (eval $ac_try) 2>&5
18564   ac_status=$?
18565   echo "$as_me:18565: \$? = $ac_status" >&5
18566   (exit $ac_status); }; }; then
18567   cf_cv_ncurses_ext_funcs=yes
18568 else
18569   echo "$as_me: failed program was:" >&5
18570 cat conftest.$ac_ext >&5
18571 cf_cv_ncurses_ext_funcs=no
18572 fi
18573 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18574
18575 fi
18576 rm -f conftest.$ac_objext conftest.$ac_ext
18577
18578 fi
18579 echo "$as_me:18579: result: $cf_cv_ncurses_ext_funcs" >&5
18580 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18581 test "$cf_cv_ncurses_ext_funcs" = yes &&
18582 cat >>confdefs.h <<\EOF
18583 #define NCURSES_EXT_FUNCS 1
18584 EOF
18585
18586 if test "$cf_enable_widec" = yes
18587 then
18588         # workaround for systems with ncurses before 20111029, due to change of
18589         # feature test macro from _XPG5 to _XOPEN_SOURCE
18590         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18591         then
18592                 cf_define_xpg5=no
18593                 echo "$as_me:18593: checking if _XPG5 should be defined to enable wide-characters" >&5
18594 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18595
18596                 cat >conftest.$ac_ext <<_ACEOF
18597 #line 18597 "configure"
18598 #include "confdefs.h"
18599
18600 #include <${cf_cv_ncurses_header:-curses.h}>
18601 int
18602 main (void)
18603 {
18604 int x = _XPG5
18605   ;
18606   return 0;
18607 }
18608 _ACEOF
18609 rm -f conftest.$ac_objext
18610 if { (eval echo "$as_me:18610: \"$ac_compile\"") >&5
18611   (eval $ac_compile) 2>&5
18612   ac_status=$?
18613   echo "$as_me:18613: \$? = $ac_status" >&5
18614   (exit $ac_status); } &&
18615          { ac_try='test -s conftest.$ac_objext'
18616   { (eval echo "$as_me:18616: \"$ac_try\"") >&5
18617   (eval $ac_try) 2>&5
18618   ac_status=$?
18619   echo "$as_me:18619: \$? = $ac_status" >&5
18620   (exit $ac_status); }; }; then
18621   :
18622 else
18623   echo "$as_me: failed program was:" >&5
18624 cat conftest.$ac_ext >&5
18625 cf_save_cppflags="$CPPFLAGS"
18626                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18627                          cat >conftest.$ac_ext <<_ACEOF
18628 #line 18628 "configure"
18629 #include "confdefs.h"
18630
18631 #include <${cf_cv_ncurses_header:-curses.h}>
18632 int
18633 main (void)
18634 {
18635 int x = _XPG5
18636   ;
18637   return 0;
18638 }
18639 _ACEOF
18640 rm -f conftest.$ac_objext
18641 if { (eval echo "$as_me:18641: \"$ac_compile\"") >&5
18642   (eval $ac_compile) 2>&5
18643   ac_status=$?
18644   echo "$as_me:18644: \$? = $ac_status" >&5
18645   (exit $ac_status); } &&
18646          { ac_try='test -s conftest.$ac_objext'
18647   { (eval echo "$as_me:18647: \"$ac_try\"") >&5
18648   (eval $ac_try) 2>&5
18649   ac_status=$?
18650   echo "$as_me:18650: \$? = $ac_status" >&5
18651   (exit $ac_status); }; }; then
18652   cf_define_xpg5=yes
18653 else
18654   echo "$as_me: failed program was:" >&5
18655 cat conftest.$ac_ext >&5
18656 fi
18657 rm -f conftest.$ac_objext conftest.$ac_ext
18658                          CPPFLAGS="$cf_save_cppflags"
18659 fi
18660 rm -f conftest.$ac_objext conftest.$ac_ext
18661                 echo "$as_me:18661: result: $cf_define_xpg5" >&5
18662 echo "${ECHO_T}$cf_define_xpg5" >&6
18663
18664                 if test "$cf_define_xpg5" = yes
18665                 then
18666                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18667                 fi
18668         fi
18669
18670         echo "$as_me:18670: checking for wide-character functions" >&5
18671 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18672 if test "${cf_cv_widechar_funcs+set}" = set; then
18673   echo $ECHO_N "(cached) $ECHO_C" >&6
18674 else
18675
18676         cat >conftest.$ac_ext <<_ACEOF
18677 #line 18677 "configure"
18678 #include "confdefs.h"
18679
18680 #include <${cf_cv_ncurses_header:-curses.h}>
18681 int
18682 main (void)
18683 {
18684
18685                 static wchar_t src_wchar[2];
18686                 static cchar_t dst_cchar;
18687                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18688
18689   ;
18690   return 0;
18691 }
18692 _ACEOF
18693 rm -f conftest.$ac_objext conftest$ac_exeext
18694 if { (eval echo "$as_me:18694: \"$ac_link\"") >&5
18695   (eval $ac_link) 2>&5
18696   ac_status=$?
18697   echo "$as_me:18697: \$? = $ac_status" >&5
18698   (exit $ac_status); } &&
18699          { ac_try='test -s conftest$ac_exeext'
18700   { (eval echo "$as_me:18700: \"$ac_try\"") >&5
18701   (eval $ac_try) 2>&5
18702   ac_status=$?
18703   echo "$as_me:18703: \$? = $ac_status" >&5
18704   (exit $ac_status); }; }; then
18705   cf_cv_widechar_funcs=yes
18706 else
18707   echo "$as_me: failed program was:" >&5
18708 cat conftest.$ac_ext >&5
18709 cf_cv_widechar_funcs=no
18710 fi
18711 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18712
18713 fi
18714 echo "$as_me:18714: result: $cf_cv_widechar_funcs" >&5
18715 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18716         if test "$cf_cv_widechar_funcs" != no ; then
18717
18718 cat >>confdefs.h <<\EOF
18719 #define USE_WIDEC_SUPPORT 1
18720 EOF
18721
18722         else
18723                 cat >>confdefs.h <<\EOF
18724 #define USE_WIDEC_SUPPORT 0
18725 EOF
18726
18727         fi
18728 else
18729         cat >>confdefs.h <<\EOF
18730 #define USE_WIDEC_SUPPORT 0
18731 EOF
18732
18733 fi
18734
18735 echo "$as_me:18735: checking if $cf_cv_screen library uses pthreads" >&5
18736 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18737 if test "${cf_cv_use_pthreads+set}" = set; then
18738   echo $ECHO_N "(cached) $ECHO_C" >&6
18739 else
18740
18741 cat >conftest.$ac_ext <<_ACEOF
18742 #line 18742 "configure"
18743 #include "confdefs.h"
18744
18745 #include <${cf_cv_ncurses_header:-curses.h}>
18746 extern void _nc_init_pthreads(void);
18747
18748 int
18749 main (void)
18750 {
18751
18752         initscr();
18753         _nc_init_pthreads();
18754
18755   ;
18756   return 0;
18757 }
18758 _ACEOF
18759 rm -f conftest.$ac_objext conftest$ac_exeext
18760 if { (eval echo "$as_me:18760: \"$ac_link\"") >&5
18761   (eval $ac_link) 2>&5
18762   ac_status=$?
18763   echo "$as_me:18763: \$? = $ac_status" >&5
18764   (exit $ac_status); } &&
18765          { ac_try='test -s conftest$ac_exeext'
18766   { (eval echo "$as_me:18766: \"$ac_try\"") >&5
18767   (eval $ac_try) 2>&5
18768   ac_status=$?
18769   echo "$as_me:18769: \$? = $ac_status" >&5
18770   (exit $ac_status); }; }; then
18771   cf_cv_use_pthreads=yes
18772 else
18773   echo "$as_me: failed program was:" >&5
18774 cat conftest.$ac_ext >&5
18775 cf_cv_use_pthreads=no
18776 fi
18777 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18778
18779 fi
18780 echo "$as_me:18780: result: $cf_cv_use_pthreads" >&5
18781 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18782 test $cf_cv_use_pthreads = yes &&
18783 cat >>confdefs.h <<\EOF
18784 #define USE_PTHREADS 1
18785 EOF
18786
18787 echo "$as_me:18787: checking if sys/time.h works with sys/select.h" >&5
18788 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18789 if test "${cf_cv_sys_time_select+set}" = set; then
18790   echo $ECHO_N "(cached) $ECHO_C" >&6
18791 else
18792
18793 cat >conftest.$ac_ext <<_ACEOF
18794 #line 18794 "configure"
18795 #include "confdefs.h"
18796
18797 #include <sys/types.h>
18798 #ifdef HAVE_SYS_TIME_H
18799 #include <sys/time.h>
18800 #endif
18801 #ifdef HAVE_SYS_SELECT_H
18802 #include <sys/select.h>
18803 #endif
18804
18805 int
18806 main (void)
18807 {
18808
18809   ;
18810   return 0;
18811 }
18812 _ACEOF
18813 rm -f conftest.$ac_objext
18814 if { (eval echo "$as_me:18814: \"$ac_compile\"") >&5
18815   (eval $ac_compile) 2>&5
18816   ac_status=$?
18817   echo "$as_me:18817: \$? = $ac_status" >&5
18818   (exit $ac_status); } &&
18819          { ac_try='test -s conftest.$ac_objext'
18820   { (eval echo "$as_me:18820: \"$ac_try\"") >&5
18821   (eval $ac_try) 2>&5
18822   ac_status=$?
18823   echo "$as_me:18823: \$? = $ac_status" >&5
18824   (exit $ac_status); }; }; then
18825   cf_cv_sys_time_select=yes
18826 else
18827   echo "$as_me: failed program was:" >&5
18828 cat conftest.$ac_ext >&5
18829 cf_cv_sys_time_select=no
18830 fi
18831 rm -f conftest.$ac_objext conftest.$ac_ext
18832
18833 fi
18834
18835 echo "$as_me:18835: result: $cf_cv_sys_time_select" >&5
18836 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18837 test "$cf_cv_sys_time_select" = yes &&
18838 cat >>confdefs.h <<\EOF
18839 #define HAVE_SYS_TIME_SELECT 1
18840 EOF
18841
18842 # special check for test/ditto.c
18843
18844 echo "$as_me:18844: checking for openpty in -lutil" >&5
18845 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18846 if test "${ac_cv_lib_util_openpty+set}" = set; then
18847   echo $ECHO_N "(cached) $ECHO_C" >&6
18848 else
18849   ac_check_lib_save_LIBS=$LIBS
18850 LIBS="-lutil  $LIBS"
18851 cat >conftest.$ac_ext <<_ACEOF
18852 #line 18852 "configure"
18853 #include "confdefs.h"
18854
18855 /* Override any gcc2 internal prototype to avoid an error.  */
18856 #ifdef __cplusplus
18857 extern "C"
18858 #endif
18859 /* We use char because int might match the return type of a gcc2
18860    builtin and then its argument prototype would still apply.  */
18861 char openpty ();
18862 int
18863 main (void)
18864 {
18865 openpty ();
18866   ;
18867   return 0;
18868 }
18869 _ACEOF
18870 rm -f conftest.$ac_objext conftest$ac_exeext
18871 if { (eval echo "$as_me:18871: \"$ac_link\"") >&5
18872   (eval $ac_link) 2>&5
18873   ac_status=$?
18874   echo "$as_me:18874: \$? = $ac_status" >&5
18875   (exit $ac_status); } &&
18876          { ac_try='test -s conftest$ac_exeext'
18877   { (eval echo "$as_me:18877: \"$ac_try\"") >&5
18878   (eval $ac_try) 2>&5
18879   ac_status=$?
18880   echo "$as_me:18880: \$? = $ac_status" >&5
18881   (exit $ac_status); }; }; then
18882   ac_cv_lib_util_openpty=yes
18883 else
18884   echo "$as_me: failed program was:" >&5
18885 cat conftest.$ac_ext >&5
18886 ac_cv_lib_util_openpty=no
18887 fi
18888 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18889 LIBS=$ac_check_lib_save_LIBS
18890 fi
18891 echo "$as_me:18891: result: $ac_cv_lib_util_openpty" >&5
18892 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18893 if test $ac_cv_lib_util_openpty = yes; then
18894   cf_cv_lib_util=yes
18895 else
18896   cf_cv_lib_util=no
18897 fi
18898
18899 echo "$as_me:18899: checking for openpty header" >&5
18900 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18901 if test "${cf_cv_func_openpty+set}" = set; then
18902   echo $ECHO_N "(cached) $ECHO_C" >&6
18903 else
18904
18905         cf_save_LIBS="$LIBS"
18906         test $cf_cv_lib_util = yes && {
18907 cf_add_libs="$LIBS"
18908 # reverse order
18909 cf_add_0lib=
18910 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18911 # filter duplicates
18912 for cf_add_1lib in $cf_add_0lib; do
18913         for cf_add_2lib in $cf_add_libs; do
18914                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18915                         cf_add_1lib=
18916                         break
18917                 fi
18918         done
18919         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18920 done
18921 LIBS="$cf_add_libs"
18922  }
18923         for cf_header in pty.h libutil.h util.h
18924         do
18925         cat >conftest.$ac_ext <<_ACEOF
18926 #line 18926 "configure"
18927 #include "confdefs.h"
18928
18929 #include <$cf_header>
18930
18931 int
18932 main (void)
18933 {
18934
18935         int x = openpty((int *)0, (int *)0, (char *)0,
18936                                    (struct termios *)0, (struct winsize *)0);
18937
18938   ;
18939   return 0;
18940 }
18941 _ACEOF
18942 rm -f conftest.$ac_objext conftest$ac_exeext
18943 if { (eval echo "$as_me:18943: \"$ac_link\"") >&5
18944   (eval $ac_link) 2>&5
18945   ac_status=$?
18946   echo "$as_me:18946: \$? = $ac_status" >&5
18947   (exit $ac_status); } &&
18948          { ac_try='test -s conftest$ac_exeext'
18949   { (eval echo "$as_me:18949: \"$ac_try\"") >&5
18950   (eval $ac_try) 2>&5
18951   ac_status=$?
18952   echo "$as_me:18952: \$? = $ac_status" >&5
18953   (exit $ac_status); }; }; then
18954
18955                 cf_cv_func_openpty=$cf_header
18956                 break
18957
18958 else
18959   echo "$as_me: failed program was:" >&5
18960 cat conftest.$ac_ext >&5
18961
18962                 cf_cv_func_openpty=no
18963
18964 fi
18965 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18966         done
18967         LIBS="$cf_save_LIBS"
18968
18969 fi
18970 echo "$as_me:18970: result: $cf_cv_func_openpty" >&5
18971 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18972
18973 if test "$cf_cv_func_openpty" != no ; then
18974
18975 cat >>confdefs.h <<EOF
18976 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18977 EOF
18978
18979 cat >>confdefs.h <<\EOF
18980 #define USE_XTERM_PTY 1
18981 EOF
18982
18983         if test "x$cf_cv_lib_util" = xyes ; then
18984
18985 cf_add_libs="$TEST_LIBS"
18986 # reverse order
18987 cf_add_0lib=
18988 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18989 # filter duplicates
18990 for cf_add_1lib in $cf_add_0lib; do
18991         for cf_add_2lib in $cf_add_libs; do
18992                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18993                         cf_add_1lib=
18994                         break
18995                 fi
18996         done
18997         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18998 done
18999 TEST_LIBS="$cf_add_libs"
19000
19001         fi
19002 fi
19003
19004 echo "$as_me:19004: checking for function curses_version" >&5
19005 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19006 if test "${cf_cv_func_curses_version+set}" = set; then
19007   echo $ECHO_N "(cached) $ECHO_C" >&6
19008 else
19009
19010 if test "$cross_compiling" = yes; then
19011   cf_cv_func_curses_version=unknown
19012 else
19013   cat >conftest.$ac_ext <<_ACEOF
19014 #line 19014 "configure"
19015 #include "confdefs.h"
19016
19017 #include <${cf_cv_ncurses_header:-curses.h}>
19018 int main(void)
19019 {
19020         char temp[1024];
19021         sprintf(temp, "%s\n", curses_version());
19022         ${cf_cv_main_return:-return}(0);
19023 }
19024
19025 _ACEOF
19026 rm -f conftest$ac_exeext
19027 if { (eval echo "$as_me:19027: \"$ac_link\"") >&5
19028   (eval $ac_link) 2>&5
19029   ac_status=$?
19030   echo "$as_me:19030: \$? = $ac_status" >&5
19031   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19032   { (eval echo "$as_me:19032: \"$ac_try\"") >&5
19033   (eval $ac_try) 2>&5
19034   ac_status=$?
19035   echo "$as_me:19035: \$? = $ac_status" >&5
19036   (exit $ac_status); }; }; then
19037   cf_cv_func_curses_version=yes
19038
19039 else
19040   echo "$as_me: program exited with status $ac_status" >&5
19041 echo "$as_me: failed program was:" >&5
19042 cat conftest.$ac_ext >&5
19043 cf_cv_func_curses_version=no
19044
19045 fi
19046 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19047 fi
19048 rm -f core
19049 fi
19050 echo "$as_me:19050: result: $cf_cv_func_curses_version" >&5
19051 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19052 test "$cf_cv_func_curses_version" = yes &&
19053 cat >>confdefs.h <<\EOF
19054 #define HAVE_CURSES_VERSION 1
19055 EOF
19056
19057 echo "$as_me:19057: checking for alternate character set array" >&5
19058 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19059 if test "${cf_cv_curses_acs_map+set}" = set; then
19060   echo $ECHO_N "(cached) $ECHO_C" >&6
19061 else
19062
19063 cf_cv_curses_acs_map=unknown
19064 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19065 do
19066 cat >conftest.$ac_ext <<_ACEOF
19067 #line 19067 "configure"
19068 #include "confdefs.h"
19069
19070 #include <${cf_cv_ncurses_header:-curses.h}>
19071
19072 int
19073 main (void)
19074 {
19075
19076 $name['k'] = ACS_PLUS
19077
19078   ;
19079   return 0;
19080 }
19081 _ACEOF
19082 rm -f conftest.$ac_objext conftest$ac_exeext
19083 if { (eval echo "$as_me:19083: \"$ac_link\"") >&5
19084   (eval $ac_link) 2>&5
19085   ac_status=$?
19086   echo "$as_me:19086: \$? = $ac_status" >&5
19087   (exit $ac_status); } &&
19088          { ac_try='test -s conftest$ac_exeext'
19089   { (eval echo "$as_me:19089: \"$ac_try\"") >&5
19090   (eval $ac_try) 2>&5
19091   ac_status=$?
19092   echo "$as_me:19092: \$? = $ac_status" >&5
19093   (exit $ac_status); }; }; then
19094   cf_cv_curses_acs_map=$name; break
19095 else
19096   echo "$as_me: failed program was:" >&5
19097 cat conftest.$ac_ext >&5
19098 fi
19099 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19100 done
19101
19102 fi
19103 echo "$as_me:19103: result: $cf_cv_curses_acs_map" >&5
19104 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19105
19106 test "$cf_cv_curses_acs_map" != unknown &&
19107 cat >>confdefs.h <<EOF
19108 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19109 EOF
19110
19111 if test "$cf_enable_widec" = yes; then
19112
19113 echo "$as_me:19113: checking for wide alternate character set array" >&5
19114 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19115 if test "${cf_cv_curses_wacs_map+set}" = set; then
19116   echo $ECHO_N "(cached) $ECHO_C" >&6
19117 else
19118
19119         cf_cv_curses_wacs_map=unknown
19120         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19121         do
19122         cat >conftest.$ac_ext <<_ACEOF
19123 #line 19123 "configure"
19124 #include "confdefs.h"
19125
19126 #ifndef _XOPEN_SOURCE_EXTENDED
19127 #define _XOPEN_SOURCE_EXTENDED
19128 #endif
19129 #include <${cf_cv_ncurses_header:-curses.h}>
19130 int
19131 main (void)
19132 {
19133 void *foo = &($name['k']); (void)foo
19134   ;
19135   return 0;
19136 }
19137 _ACEOF
19138 rm -f conftest.$ac_objext conftest$ac_exeext
19139 if { (eval echo "$as_me:19139: \"$ac_link\"") >&5
19140   (eval $ac_link) 2>&5
19141   ac_status=$?
19142   echo "$as_me:19142: \$? = $ac_status" >&5
19143   (exit $ac_status); } &&
19144          { ac_try='test -s conftest$ac_exeext'
19145   { (eval echo "$as_me:19145: \"$ac_try\"") >&5
19146   (eval $ac_try) 2>&5
19147   ac_status=$?
19148   echo "$as_me:19148: \$? = $ac_status" >&5
19149   (exit $ac_status); }; }; then
19150   cf_cv_curses_wacs_map=$name
19151          break
19152 else
19153   echo "$as_me: failed program was:" >&5
19154 cat conftest.$ac_ext >&5
19155 fi
19156 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19157         done
19158 fi
19159 echo "$as_me:19159: result: $cf_cv_curses_wacs_map" >&5
19160 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19161
19162 test "$cf_cv_curses_wacs_map" != unknown &&
19163 cat >>confdefs.h <<EOF
19164 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19165 EOF
19166
19167 echo "$as_me:19167: checking for wide alternate character constants" >&5
19168 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19169 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19170   echo $ECHO_N "(cached) $ECHO_C" >&6
19171 else
19172
19173 cf_cv_curses_wacs_symbols=no
19174 if test "$cf_cv_curses_wacs_map" != unknown
19175 then
19176         cat >conftest.$ac_ext <<_ACEOF
19177 #line 19177 "configure"
19178 #include "confdefs.h"
19179
19180 #ifndef _XOPEN_SOURCE_EXTENDED
19181 #define _XOPEN_SOURCE_EXTENDED
19182 #endif
19183 #include <${cf_cv_ncurses_header:-curses.h}>
19184 int
19185 main (void)
19186 {
19187 cchar_t *foo = WACS_PLUS;
19188          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS; (void)foo
19189   ;
19190   return 0;
19191 }
19192 _ACEOF
19193 rm -f conftest.$ac_objext conftest$ac_exeext
19194 if { (eval echo "$as_me:19194: \"$ac_link\"") >&5
19195   (eval $ac_link) 2>&5
19196   ac_status=$?
19197   echo "$as_me:19197: \$? = $ac_status" >&5
19198   (exit $ac_status); } &&
19199          { ac_try='test -s conftest$ac_exeext'
19200   { (eval echo "$as_me:19200: \"$ac_try\"") >&5
19201   (eval $ac_try) 2>&5
19202   ac_status=$?
19203   echo "$as_me:19203: \$? = $ac_status" >&5
19204   (exit $ac_status); }; }; then
19205   cf_cv_curses_wacs_symbols=yes
19206 else
19207   echo "$as_me: failed program was:" >&5
19208 cat conftest.$ac_ext >&5
19209 fi
19210 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19211 else
19212         cat >conftest.$ac_ext <<_ACEOF
19213 #line 19213 "configure"
19214 #include "confdefs.h"
19215
19216 #ifndef _XOPEN_SOURCE_EXTENDED
19217 #define _XOPEN_SOURCE_EXTENDED
19218 #endif
19219 #include <${cf_cv_ncurses_header:-curses.h}>
19220 int
19221 main (void)
19222 {
19223 cchar_t *foo = WACS_PLUS; (void)foo
19224   ;
19225   return 0;
19226 }
19227 _ACEOF
19228 rm -f conftest.$ac_objext conftest$ac_exeext
19229 if { (eval echo "$as_me:19229: \"$ac_link\"") >&5
19230   (eval $ac_link) 2>&5
19231   ac_status=$?
19232   echo "$as_me:19232: \$? = $ac_status" >&5
19233   (exit $ac_status); } &&
19234          { ac_try='test -s conftest$ac_exeext'
19235   { (eval echo "$as_me:19235: \"$ac_try\"") >&5
19236   (eval $ac_try) 2>&5
19237   ac_status=$?
19238   echo "$as_me:19238: \$? = $ac_status" >&5
19239   (exit $ac_status); }; }; then
19240   cf_cv_curses_wacs_symbols=yes
19241 else
19242   echo "$as_me: failed program was:" >&5
19243 cat conftest.$ac_ext >&5
19244 fi
19245 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19246 fi
19247
19248 fi
19249 echo "$as_me:19249: result: $cf_cv_curses_wacs_symbols" >&5
19250 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19251
19252 test "$cf_cv_curses_wacs_symbols" != no &&
19253 cat >>confdefs.h <<\EOF
19254 #define CURSES_WACS_SYMBOLS 1
19255 EOF
19256
19257 fi
19258
19259 echo "$as_me:19259: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19260 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19261 cat >conftest.$ac_ext <<_ACEOF
19262 #line 19262 "configure"
19263 #include "confdefs.h"
19264
19265 #ifndef _XOPEN_SOURCE_EXTENDED
19266 #define _XOPEN_SOURCE_EXTENDED
19267 #endif
19268 #include <${cf_cv_ncurses_header:-curses.h}>
19269 int
19270 main (void)
19271 {
19272
19273 attr_t foo
19274
19275   ;
19276   return 0;
19277 }
19278 _ACEOF
19279 rm -f conftest.$ac_objext
19280 if { (eval echo "$as_me:19280: \"$ac_compile\"") >&5
19281   (eval $ac_compile) 2>&5
19282   ac_status=$?
19283   echo "$as_me:19283: \$? = $ac_status" >&5
19284   (exit $ac_status); } &&
19285          { ac_try='test -s conftest.$ac_objext'
19286   { (eval echo "$as_me:19286: \"$ac_try\"") >&5
19287   (eval $ac_try) 2>&5
19288   ac_status=$?
19289   echo "$as_me:19289: \$? = $ac_status" >&5
19290   (exit $ac_status); }; }; then
19291   cf_result=yes
19292 else
19293   echo "$as_me: failed program was:" >&5
19294 cat conftest.$ac_ext >&5
19295 cf_result=no
19296 fi
19297 rm -f conftest.$ac_objext conftest.$ac_ext
19298 echo "$as_me:19298: result: $cf_result" >&5
19299 echo "${ECHO_T}$cf_result" >&6
19300 if test $cf_result = yes ; then
19301
19302 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19303
19304 cat >>confdefs.h <<EOF
19305 #define $cf_result 1
19306 EOF
19307
19308 else
19309
19310 cat >>confdefs.h <<EOF
19311 #define attr_t long
19312 EOF
19313
19314 fi
19315
19316 if test "$cf_enable_widec" = yes; then
19317
19318 # This is needed on Tru64 5.0 to declare mbstate_t
19319 echo "$as_me:19319: checking if we must include wchar.h to declare mbstate_t" >&5
19320 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19321 if test "${cf_cv_mbstate_t+set}" = set; then
19322   echo $ECHO_N "(cached) $ECHO_C" >&6
19323 else
19324
19325 cat >conftest.$ac_ext <<_ACEOF
19326 #line 19326 "configure"
19327 #include "confdefs.h"
19328
19329 #include <stdlib.h>
19330 #include <stdarg.h>
19331 #include <stdio.h>
19332 #ifdef HAVE_LIBUTF8_H
19333 #include <libutf8.h>
19334 #endif
19335 int
19336 main (void)
19337 {
19338 mbstate_t state
19339   ;
19340   return 0;
19341 }
19342 _ACEOF
19343 rm -f conftest.$ac_objext
19344 if { (eval echo "$as_me:19344: \"$ac_compile\"") >&5
19345   (eval $ac_compile) 2>&5
19346   ac_status=$?
19347   echo "$as_me:19347: \$? = $ac_status" >&5
19348   (exit $ac_status); } &&
19349          { ac_try='test -s conftest.$ac_objext'
19350   { (eval echo "$as_me:19350: \"$ac_try\"") >&5
19351   (eval $ac_try) 2>&5
19352   ac_status=$?
19353   echo "$as_me:19353: \$? = $ac_status" >&5
19354   (exit $ac_status); }; }; then
19355   cf_cv_mbstate_t=no
19356 else
19357   echo "$as_me: failed program was:" >&5
19358 cat conftest.$ac_ext >&5
19359 cat >conftest.$ac_ext <<_ACEOF
19360 #line 19360 "configure"
19361 #include "confdefs.h"
19362
19363 #include <stdlib.h>
19364 #include <stdarg.h>
19365 #include <stdio.h>
19366 #include <wchar.h>
19367 #ifdef HAVE_LIBUTF8_H
19368 #include <libutf8.h>
19369 #endif
19370 int
19371 main (void)
19372 {
19373 mbstate_t value
19374   ;
19375   return 0;
19376 }
19377 _ACEOF
19378 rm -f conftest.$ac_objext
19379 if { (eval echo "$as_me:19379: \"$ac_compile\"") >&5
19380   (eval $ac_compile) 2>&5
19381   ac_status=$?
19382   echo "$as_me:19382: \$? = $ac_status" >&5
19383   (exit $ac_status); } &&
19384          { ac_try='test -s conftest.$ac_objext'
19385   { (eval echo "$as_me:19385: \"$ac_try\"") >&5
19386   (eval $ac_try) 2>&5
19387   ac_status=$?
19388   echo "$as_me:19388: \$? = $ac_status" >&5
19389   (exit $ac_status); }; }; then
19390   cf_cv_mbstate_t=yes
19391 else
19392   echo "$as_me: failed program was:" >&5
19393 cat conftest.$ac_ext >&5
19394 cf_cv_mbstate_t=unknown
19395 fi
19396 rm -f conftest.$ac_objext conftest.$ac_ext
19397 fi
19398 rm -f conftest.$ac_objext conftest.$ac_ext
19399 fi
19400 echo "$as_me:19400: result: $cf_cv_mbstate_t" >&5
19401 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19402
19403 if test "$cf_cv_mbstate_t" = yes ; then
19404
19405 cat >>confdefs.h <<\EOF
19406 #define NEED_WCHAR_H 1
19407 EOF
19408
19409         NEED_WCHAR_H=1
19410 fi
19411
19412 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19413 if test "$cf_cv_mbstate_t" = unknown ; then
19414         NCURSES_MBSTATE_T=1
19415 fi
19416
19417 # if we find mbstate_t in either place, use substitution to provide a fallback.
19418 if test "$cf_cv_mbstate_t" != unknown ; then
19419         NCURSES_OK_MBSTATE_T=1
19420 fi
19421
19422 # This is needed on Tru64 5.0 to declare wchar_t
19423 echo "$as_me:19423: checking if we must include wchar.h to declare wchar_t" >&5
19424 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19425 if test "${cf_cv_wchar_t+set}" = set; then
19426   echo $ECHO_N "(cached) $ECHO_C" >&6
19427 else
19428
19429 cat >conftest.$ac_ext <<_ACEOF
19430 #line 19430 "configure"
19431 #include "confdefs.h"
19432
19433 #include <stdlib.h>
19434 #include <stdarg.h>
19435 #include <stdio.h>
19436 #ifdef HAVE_LIBUTF8_H
19437 #include <libutf8.h>
19438 #endif
19439 int
19440 main (void)
19441 {
19442 wchar_t state
19443   ;
19444   return 0;
19445 }
19446 _ACEOF
19447 rm -f conftest.$ac_objext
19448 if { (eval echo "$as_me:19448: \"$ac_compile\"") >&5
19449   (eval $ac_compile) 2>&5
19450   ac_status=$?
19451   echo "$as_me:19451: \$? = $ac_status" >&5
19452   (exit $ac_status); } &&
19453          { ac_try='test -s conftest.$ac_objext'
19454   { (eval echo "$as_me:19454: \"$ac_try\"") >&5
19455   (eval $ac_try) 2>&5
19456   ac_status=$?
19457   echo "$as_me:19457: \$? = $ac_status" >&5
19458   (exit $ac_status); }; }; then
19459   cf_cv_wchar_t=no
19460 else
19461   echo "$as_me: failed program was:" >&5
19462 cat conftest.$ac_ext >&5
19463 cat >conftest.$ac_ext <<_ACEOF
19464 #line 19464 "configure"
19465 #include "confdefs.h"
19466
19467 #include <stdlib.h>
19468 #include <stdarg.h>
19469 #include <stdio.h>
19470 #include <wchar.h>
19471 #ifdef HAVE_LIBUTF8_H
19472 #include <libutf8.h>
19473 #endif
19474 int
19475 main (void)
19476 {
19477 wchar_t value
19478   ;
19479   return 0;
19480 }
19481 _ACEOF
19482 rm -f conftest.$ac_objext
19483 if { (eval echo "$as_me:19483: \"$ac_compile\"") >&5
19484   (eval $ac_compile) 2>&5
19485   ac_status=$?
19486   echo "$as_me:19486: \$? = $ac_status" >&5
19487   (exit $ac_status); } &&
19488          { ac_try='test -s conftest.$ac_objext'
19489   { (eval echo "$as_me:19489: \"$ac_try\"") >&5
19490   (eval $ac_try) 2>&5
19491   ac_status=$?
19492   echo "$as_me:19492: \$? = $ac_status" >&5
19493   (exit $ac_status); }; }; then
19494   cf_cv_wchar_t=yes
19495 else
19496   echo "$as_me: failed program was:" >&5
19497 cat conftest.$ac_ext >&5
19498 cf_cv_wchar_t=unknown
19499 fi
19500 rm -f conftest.$ac_objext conftest.$ac_ext
19501 fi
19502 rm -f conftest.$ac_objext conftest.$ac_ext
19503 fi
19504 echo "$as_me:19504: result: $cf_cv_wchar_t" >&5
19505 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19506
19507 if test "$cf_cv_wchar_t" = yes ; then
19508
19509 cat >>confdefs.h <<\EOF
19510 #define NEED_WCHAR_H 1
19511 EOF
19512
19513         NEED_WCHAR_H=1
19514 fi
19515
19516 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19517 if test "$cf_cv_wchar_t" = unknown ; then
19518         NCURSES_WCHAR_T=1
19519 fi
19520
19521 # if we find wchar_t in either place, use substitution to provide a fallback.
19522 if test "$cf_cv_wchar_t" != unknown ; then
19523         NCURSES_OK_WCHAR_T=1
19524 fi
19525
19526 # This is needed on Tru64 5.0 to declare wint_t
19527 echo "$as_me:19527: checking if we must include wchar.h to declare wint_t" >&5
19528 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19529 if test "${cf_cv_wint_t+set}" = set; then
19530   echo $ECHO_N "(cached) $ECHO_C" >&6
19531 else
19532
19533 cat >conftest.$ac_ext <<_ACEOF
19534 #line 19534 "configure"
19535 #include "confdefs.h"
19536
19537 #include <stdlib.h>
19538 #include <stdarg.h>
19539 #include <stdio.h>
19540 #ifdef HAVE_LIBUTF8_H
19541 #include <libutf8.h>
19542 #endif
19543 int
19544 main (void)
19545 {
19546 wint_t state
19547   ;
19548   return 0;
19549 }
19550 _ACEOF
19551 rm -f conftest.$ac_objext
19552 if { (eval echo "$as_me:19552: \"$ac_compile\"") >&5
19553   (eval $ac_compile) 2>&5
19554   ac_status=$?
19555   echo "$as_me:19555: \$? = $ac_status" >&5
19556   (exit $ac_status); } &&
19557          { ac_try='test -s conftest.$ac_objext'
19558   { (eval echo "$as_me:19558: \"$ac_try\"") >&5
19559   (eval $ac_try) 2>&5
19560   ac_status=$?
19561   echo "$as_me:19561: \$? = $ac_status" >&5
19562   (exit $ac_status); }; }; then
19563   cf_cv_wint_t=no
19564 else
19565   echo "$as_me: failed program was:" >&5
19566 cat conftest.$ac_ext >&5
19567 cat >conftest.$ac_ext <<_ACEOF
19568 #line 19568 "configure"
19569 #include "confdefs.h"
19570
19571 #include <stdlib.h>
19572 #include <stdarg.h>
19573 #include <stdio.h>
19574 #include <wchar.h>
19575 #ifdef HAVE_LIBUTF8_H
19576 #include <libutf8.h>
19577 #endif
19578 int
19579 main (void)
19580 {
19581 wint_t value
19582   ;
19583   return 0;
19584 }
19585 _ACEOF
19586 rm -f conftest.$ac_objext
19587 if { (eval echo "$as_me:19587: \"$ac_compile\"") >&5
19588   (eval $ac_compile) 2>&5
19589   ac_status=$?
19590   echo "$as_me:19590: \$? = $ac_status" >&5
19591   (exit $ac_status); } &&
19592          { ac_try='test -s conftest.$ac_objext'
19593   { (eval echo "$as_me:19593: \"$ac_try\"") >&5
19594   (eval $ac_try) 2>&5
19595   ac_status=$?
19596   echo "$as_me:19596: \$? = $ac_status" >&5
19597   (exit $ac_status); }; }; then
19598   cf_cv_wint_t=yes
19599 else
19600   echo "$as_me: failed program was:" >&5
19601 cat conftest.$ac_ext >&5
19602 cf_cv_wint_t=unknown
19603 fi
19604 rm -f conftest.$ac_objext conftest.$ac_ext
19605 fi
19606 rm -f conftest.$ac_objext conftest.$ac_ext
19607 fi
19608 echo "$as_me:19608: result: $cf_cv_wint_t" >&5
19609 echo "${ECHO_T}$cf_cv_wint_t" >&6
19610
19611 if test "$cf_cv_wint_t" = yes ; then
19612
19613 cat >>confdefs.h <<\EOF
19614 #define NEED_WCHAR_H 1
19615 EOF
19616
19617         NEED_WCHAR_H=1
19618 fi
19619
19620 # if we do not find wint_t in either place, use substitution to provide a fallback.
19621 if test "$cf_cv_wint_t" = unknown ; then
19622         NCURSES_WINT_T=1
19623 fi
19624
19625 # if we find wint_t in either place, use substitution to provide a fallback.
19626 if test "$cf_cv_wint_t" != unknown ; then
19627         NCURSES_OK_WINT_T=1
19628 fi
19629
19630         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19631
19632 echo "$as_me:19632: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19633 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19634 cat >conftest.$ac_ext <<_ACEOF
19635 #line 19635 "configure"
19636 #include "confdefs.h"
19637
19638 #ifndef _XOPEN_SOURCE_EXTENDED
19639 #define _XOPEN_SOURCE_EXTENDED
19640 #endif
19641 #include <${cf_cv_ncurses_header:-curses.h}>
19642 int
19643 main (void)
19644 {
19645
19646 mbstate_t foo
19647
19648   ;
19649   return 0;
19650 }
19651 _ACEOF
19652 rm -f conftest.$ac_objext
19653 if { (eval echo "$as_me:19653: \"$ac_compile\"") >&5
19654   (eval $ac_compile) 2>&5
19655   ac_status=$?
19656   echo "$as_me:19656: \$? = $ac_status" >&5
19657   (exit $ac_status); } &&
19658          { ac_try='test -s conftest.$ac_objext'
19659   { (eval echo "$as_me:19659: \"$ac_try\"") >&5
19660   (eval $ac_try) 2>&5
19661   ac_status=$?
19662   echo "$as_me:19662: \$? = $ac_status" >&5
19663   (exit $ac_status); }; }; then
19664   cf_result=yes
19665 else
19666   echo "$as_me: failed program was:" >&5
19667 cat conftest.$ac_ext >&5
19668 cf_result=no
19669 fi
19670 rm -f conftest.$ac_objext conftest.$ac_ext
19671 echo "$as_me:19671: result: $cf_result" >&5
19672 echo "${ECHO_T}$cf_result" >&6
19673 if test $cf_result = yes ; then
19674
19675 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19676
19677 cat >>confdefs.h <<EOF
19678 #define $cf_result 1
19679 EOF
19680
19681 else
19682
19683 cat >>confdefs.h <<EOF
19684 #define mbstate_t long
19685 EOF
19686
19687 fi
19688
19689         fi
19690
19691         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19692
19693 echo "$as_me:19693: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19694 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19695 cat >conftest.$ac_ext <<_ACEOF
19696 #line 19696 "configure"
19697 #include "confdefs.h"
19698
19699 #ifndef _XOPEN_SOURCE_EXTENDED
19700 #define _XOPEN_SOURCE_EXTENDED
19701 #endif
19702 #include <${cf_cv_ncurses_header:-curses.h}>
19703 int
19704 main (void)
19705 {
19706
19707 wchar_t foo
19708
19709   ;
19710   return 0;
19711 }
19712 _ACEOF
19713 rm -f conftest.$ac_objext
19714 if { (eval echo "$as_me:19714: \"$ac_compile\"") >&5
19715   (eval $ac_compile) 2>&5
19716   ac_status=$?
19717   echo "$as_me:19717: \$? = $ac_status" >&5
19718   (exit $ac_status); } &&
19719          { ac_try='test -s conftest.$ac_objext'
19720   { (eval echo "$as_me:19720: \"$ac_try\"") >&5
19721   (eval $ac_try) 2>&5
19722   ac_status=$?
19723   echo "$as_me:19723: \$? = $ac_status" >&5
19724   (exit $ac_status); }; }; then
19725   cf_result=yes
19726 else
19727   echo "$as_me: failed program was:" >&5
19728 cat conftest.$ac_ext >&5
19729 cf_result=no
19730 fi
19731 rm -f conftest.$ac_objext conftest.$ac_ext
19732 echo "$as_me:19732: result: $cf_result" >&5
19733 echo "${ECHO_T}$cf_result" >&6
19734 if test $cf_result = yes ; then
19735
19736 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19737
19738 cat >>confdefs.h <<EOF
19739 #define $cf_result 1
19740 EOF
19741
19742 else
19743
19744 cat >>confdefs.h <<EOF
19745 #define wchar_t long
19746 EOF
19747
19748 fi
19749
19750         fi
19751
19752         if test "$NCURSES_OK_WINT_T" = 0 ; then
19753
19754 echo "$as_me:19754: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19755 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19756 cat >conftest.$ac_ext <<_ACEOF
19757 #line 19757 "configure"
19758 #include "confdefs.h"
19759
19760 #ifndef _XOPEN_SOURCE_EXTENDED
19761 #define _XOPEN_SOURCE_EXTENDED
19762 #endif
19763 #include <${cf_cv_ncurses_header:-curses.h}>
19764 int
19765 main (void)
19766 {
19767
19768 wint_t foo
19769
19770   ;
19771   return 0;
19772 }
19773 _ACEOF
19774 rm -f conftest.$ac_objext
19775 if { (eval echo "$as_me:19775: \"$ac_compile\"") >&5
19776   (eval $ac_compile) 2>&5
19777   ac_status=$?
19778   echo "$as_me:19778: \$? = $ac_status" >&5
19779   (exit $ac_status); } &&
19780          { ac_try='test -s conftest.$ac_objext'
19781   { (eval echo "$as_me:19781: \"$ac_try\"") >&5
19782   (eval $ac_try) 2>&5
19783   ac_status=$?
19784   echo "$as_me:19784: \$? = $ac_status" >&5
19785   (exit $ac_status); }; }; then
19786   cf_result=yes
19787 else
19788   echo "$as_me: failed program was:" >&5
19789 cat conftest.$ac_ext >&5
19790 cf_result=no
19791 fi
19792 rm -f conftest.$ac_objext conftest.$ac_ext
19793 echo "$as_me:19793: result: $cf_result" >&5
19794 echo "${ECHO_T}$cf_result" >&6
19795 if test $cf_result = yes ; then
19796
19797 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19798
19799 cat >>confdefs.h <<EOF
19800 #define $cf_result 1
19801 EOF
19802
19803 else
19804
19805 cat >>confdefs.h <<EOF
19806 #define wint_t long
19807 EOF
19808
19809 fi
19810
19811         fi
19812 fi
19813
19814 for cf_data in \
19815 TABSIZE \
19816 curscr \
19817 ospeed \
19818 boolnames \
19819 boolfnames \
19820 ttytype
19821 do
19822 echo "$as_me:19822: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19823 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19824
19825 cat >conftest.$ac_ext <<_ACEOF
19826 #line 19826 "configure"
19827 #include "confdefs.h"
19828
19829 #ifdef HAVE_XCURSES
19830 #include <xcurses.h>
19831 char * XCursesProgramName = "test";
19832 #else
19833 #include <${cf_cv_ncurses_header:-curses.h}>
19834 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19835 #include <ncursesw/term.h>
19836 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19837 #include <ncurses/term.h>
19838 #elif defined(HAVE_TERM_H)
19839 #include <term.h>
19840 #endif
19841 #endif
19842
19843 int
19844 main (void)
19845 {
19846
19847 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19848         const void *foo = (const void *)($cf_data);
19849 #else
19850         const void *foo = &($cf_data);
19851 #endif
19852         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19853
19854   ;
19855   return 0;
19856 }
19857 _ACEOF
19858 rm -f conftest.$ac_objext
19859 if { (eval echo "$as_me:19859: \"$ac_compile\"") >&5
19860   (eval $ac_compile) 2>&5
19861   ac_status=$?
19862   echo "$as_me:19862: \$? = $ac_status" >&5
19863   (exit $ac_status); } &&
19864          { ac_try='test -s conftest.$ac_objext'
19865   { (eval echo "$as_me:19865: \"$ac_try\"") >&5
19866   (eval $ac_try) 2>&5
19867   ac_status=$?
19868   echo "$as_me:19868: \$? = $ac_status" >&5
19869   (exit $ac_status); }; }; then
19870   cf_result=yes
19871
19872 else
19873   echo "$as_me: failed program was:" >&5
19874 cat conftest.$ac_ext >&5
19875 cf_result=no
19876 fi
19877 rm -f conftest.$ac_objext conftest.$ac_ext
19878 echo "$as_me:19878: result: $cf_result" >&5
19879 echo "${ECHO_T}$cf_result" >&6
19880
19881 if test $cf_result = yes ; then
19882
19883 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19884
19885         cat >>confdefs.h <<EOF
19886 #define $cf_result 1
19887 EOF
19888
19889 else
19890         echo "$as_me:19890: checking for data $cf_data in library" >&5
19891 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19892         # BSD linkers insist on making weak linkage, but resolve at runtime.
19893         if test "$cross_compiling" = yes; then
19894
19895         # cross-compiling
19896         cat >conftest.$ac_ext <<_ACEOF
19897 #line 19897 "configure"
19898 #include "confdefs.h"
19899
19900 #ifdef HAVE_XCURSES
19901 #include <xcurses.h>
19902 char * XCursesProgramName = "test";
19903 #else
19904 #include <${cf_cv_ncurses_header:-curses.h}>
19905 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19906 #include <ncursesw/term.h>
19907 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19908 #include <ncurses/term.h>
19909 #elif defined(HAVE_TERM_H)
19910 #include <term.h>
19911 #endif
19912 #endif
19913
19914 extern char $cf_data;
19915 int
19916 main (void)
19917 {
19918
19919         do {
19920
19921 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19922         const void *foo = (const void *)($cf_data);
19923 #else
19924         const void *foo = &($cf_data);
19925 #endif
19926         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19927
19928                 ${cf_cv_main_return:-return}(foo == 0);
19929         } while (0)
19930
19931   ;
19932   return 0;
19933 }
19934 _ACEOF
19935 rm -f conftest.$ac_objext conftest$ac_exeext
19936 if { (eval echo "$as_me:19936: \"$ac_link\"") >&5
19937   (eval $ac_link) 2>&5
19938   ac_status=$?
19939   echo "$as_me:19939: \$? = $ac_status" >&5
19940   (exit $ac_status); } &&
19941          { ac_try='test -s conftest$ac_exeext'
19942   { (eval echo "$as_me:19942: \"$ac_try\"") >&5
19943   (eval $ac_try) 2>&5
19944   ac_status=$?
19945   echo "$as_me:19945: \$? = $ac_status" >&5
19946   (exit $ac_status); }; }; then
19947   cf_result=yes
19948 else
19949   echo "$as_me: failed program was:" >&5
19950 cat conftest.$ac_ext >&5
19951 cf_result=no
19952 fi
19953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19954
19955 else
19956   cat >conftest.$ac_ext <<_ACEOF
19957 #line 19957 "configure"
19958 #include "confdefs.h"
19959
19960 #ifdef HAVE_XCURSES
19961 #include <xcurses.h>
19962 char * XCursesProgramName = "test";
19963 #else
19964 #include <${cf_cv_ncurses_header:-curses.h}>
19965 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19966 #include <ncursesw/term.h>
19967 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19968 #include <ncurses/term.h>
19969 #elif defined(HAVE_TERM_H)
19970 #include <term.h>
19971 #endif
19972 #endif
19973
19974 extern char $cf_data;
19975 int main(void)
19976 {
19977
19978 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19979         const void *foo = (const void *)($cf_data);
19980 #else
19981         const void *foo = &($cf_data);
19982 #endif
19983         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19984
19985         ${cf_cv_main_return:-return}(foo == 0);
19986 }
19987 _ACEOF
19988 rm -f conftest$ac_exeext
19989 if { (eval echo "$as_me:19989: \"$ac_link\"") >&5
19990   (eval $ac_link) 2>&5
19991   ac_status=$?
19992   echo "$as_me:19992: \$? = $ac_status" >&5
19993   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19994   { (eval echo "$as_me:19994: \"$ac_try\"") >&5
19995   (eval $ac_try) 2>&5
19996   ac_status=$?
19997   echo "$as_me:19997: \$? = $ac_status" >&5
19998   (exit $ac_status); }; }; then
19999   cf_result=yes
20000
20001 else
20002   echo "$as_me: program exited with status $ac_status" >&5
20003 echo "$as_me: failed program was:" >&5
20004 cat conftest.$ac_ext >&5
20005 cf_result=no
20006 fi
20007 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
20008 fi
20009         echo "$as_me:20009: result: $cf_result" >&5
20010 echo "${ECHO_T}$cf_result" >&6
20011         if test $cf_result = yes ; then
20012
20013 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20014
20015                 cat >>confdefs.h <<EOF
20016 #define $cf_result 1
20017 EOF
20018
20019                 # do not exit loop here, since we prefer system's declarations
20020         fi
20021 fi
20022 done
20023
20024 if ( test "$GCC" = yes || test "$GXX" = yes )
20025 then
20026 echo "$as_me:20026: checking if you want to turn on gcc warnings" >&5
20027 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
20028
20029 # Check whether --enable-warnings or --disable-warnings was given.
20030 if test "${enable_warnings+set}" = set; then
20031   enableval="$enable_warnings"
20032   test "$enableval" != yes && enableval=no
20033         if test "$enableval" != "no" ; then
20034     with_warnings=yes
20035         else
20036                 with_warnings=no
20037         fi
20038 else
20039   enableval=no
20040         with_warnings=no
20041
20042 fi;
20043 echo "$as_me:20043: result: $with_warnings" >&5
20044 echo "${ECHO_T}$with_warnings" >&6
20045 if test "$with_warnings" = "yes"
20046 then
20047
20048 if test "$GCC" = yes
20049 then
20050 cat > conftest.i <<EOF
20051 #ifndef GCC_PRINTF
20052 #define GCC_PRINTF 0
20053 #endif
20054 #ifndef GCC_SCANF
20055 #define GCC_SCANF 0
20056 #endif
20057 #ifndef GCC_NORETURN
20058 #define GCC_NORETURN /* nothing */
20059 #endif
20060 #ifndef GCC_UNUSED
20061 #define GCC_UNUSED /* nothing */
20062 #endif
20063 EOF
20064 if test "$GCC" = yes
20065 then
20066         { echo "$as_me:20066: checking for $CC __attribute__ directives..." >&5
20067 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
20068 cat > conftest.$ac_ext <<EOF
20069 #line 20069 "${as_me:-configure}"
20070 #include "confdefs.h"
20071 #include "conftest.h"
20072 #include "conftest.i"
20073 #if     GCC_PRINTF
20074 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
20075 #else
20076 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
20077 #endif
20078 #if     GCC_SCANF
20079 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
20080 #else
20081 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
20082 #endif
20083 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
20084 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
20085 extern void foo(void) GCC_NORETURN;
20086 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
20087 EOF
20088         cf_printf_attribute=no
20089         cf_scanf_attribute=no
20090         for cf_attribute in scanf printf unused noreturn
20091         do
20092
20093 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20094
20095                 cf_directive="__attribute__(($cf_attribute))"
20096                 echo "checking for $CC $cf_directive" 1>&5
20097
20098                 case $cf_attribute in
20099                 (printf)
20100                         cf_printf_attribute=yes
20101                         cat >conftest.h <<EOF
20102 #define GCC_$cf_ATTRIBUTE 1
20103 EOF
20104                         ;;
20105                 (scanf)
20106                         cf_scanf_attribute=yes
20107                         cat >conftest.h <<EOF
20108 #define GCC_$cf_ATTRIBUTE 1
20109 EOF
20110                         ;;
20111                 (*)
20112                         cat >conftest.h <<EOF
20113 #define GCC_$cf_ATTRIBUTE $cf_directive
20114 EOF
20115                         ;;
20116                 esac
20117
20118                 if { (eval echo "$as_me:20118: \"$ac_compile\"") >&5
20119   (eval $ac_compile) 2>&5
20120   ac_status=$?
20121   echo "$as_me:20121: \$? = $ac_status" >&5
20122   (exit $ac_status); }; then
20123                         test -n "$verbose" && echo "$as_me:20123: result: ... $cf_attribute" >&5
20124 echo "${ECHO_T}... $cf_attribute" >&6
20125                         cat conftest.h >>confdefs.h
20126                         case $cf_attribute in
20127                         (noreturn)
20128
20129 cat >>confdefs.h <<EOF
20130 #define GCC_NORETURN $cf_directive
20131 EOF
20132
20133                                 ;;
20134                         (printf)
20135                                 cf_value='/* nothing */'
20136                                 if test "$cf_printf_attribute" != no ; then
20137                                         cf_value='__attribute__((format(printf,fmt,var)))'
20138
20139 cat >>confdefs.h <<\EOF
20140 #define GCC_PRINTF 1
20141 EOF
20142
20143                                 fi
20144
20145 cat >>confdefs.h <<EOF
20146 #define GCC_PRINTFLIKE(fmt,var) $cf_value
20147 EOF
20148
20149                                 ;;
20150                         (scanf)
20151                                 cf_value='/* nothing */'
20152                                 if test "$cf_scanf_attribute" != no ; then
20153                                         cf_value='__attribute__((format(scanf,fmt,var)))'
20154
20155 cat >>confdefs.h <<\EOF
20156 #define GCC_SCANF 1
20157 EOF
20158
20159                                 fi
20160
20161 cat >>confdefs.h <<EOF
20162 #define GCC_SCANFLIKE(fmt,var) $cf_value
20163 EOF
20164
20165                                 ;;
20166                         (unused)
20167
20168 cat >>confdefs.h <<EOF
20169 #define GCC_UNUSED $cf_directive
20170 EOF
20171
20172                                 ;;
20173                         esac
20174                 fi
20175         done
20176 else
20177         fgrep define conftest.i >>confdefs.h
20178 fi
20179 rm -rf conftest*
20180 fi
20181
20182 if test "x$have_x" = xyes; then
20183
20184 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
20185 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
20186 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
20187 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
20188 for cf_X_CFLAGS in $X_CFLAGS
20189 do
20190         case "x$cf_X_CFLAGS" in
20191         x-[IUD]*)
20192                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
20193                 ;;
20194         *)
20195                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
20196                 ;;
20197         esac
20198 done
20199
20200 cat >conftest.$ac_ext <<_ACEOF
20201 #line 20201 "configure"
20202 #include "confdefs.h"
20203
20204 #include <stdlib.h>
20205 #include <X11/Intrinsic.h>
20206
20207 int
20208 main (void)
20209 {
20210 String foo = malloc(1); (void)foo
20211   ;
20212   return 0;
20213 }
20214 _ACEOF
20215 rm -f conftest.$ac_objext
20216 if { (eval echo "$as_me:20216: \"$ac_compile\"") >&5
20217   (eval $ac_compile) 2>&5
20218   ac_status=$?
20219   echo "$as_me:20219: \$? = $ac_status" >&5
20220   (exit $ac_status); } &&
20221          { ac_try='test -s conftest.$ac_objext'
20222   { (eval echo "$as_me:20222: \"$ac_try\"") >&5
20223   (eval $ac_try) 2>&5
20224   ac_status=$?
20225   echo "$as_me:20225: \$? = $ac_status" >&5
20226   (exit $ac_status); }; }; then
20227
20228 echo "$as_me:20228: checking for X11/Xt const-feature" >&5
20229 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
20230 if test "${cf_cv_const_x_string+set}" = set; then
20231   echo $ECHO_N "(cached) $ECHO_C" >&6
20232 else
20233
20234         cat >conftest.$ac_ext <<_ACEOF
20235 #line 20235 "configure"
20236 #include "confdefs.h"
20237
20238 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
20239 #undef  XTSTRINGDEFINES /* X11R5 and later */
20240 #include <stdlib.h>
20241 #include <X11/Intrinsic.h>
20242
20243 int
20244 main (void)
20245 {
20246 String foo = malloc(1); *foo = 0
20247   ;
20248   return 0;
20249 }
20250 _ACEOF
20251 rm -f conftest.$ac_objext
20252 if { (eval echo "$as_me:20252: \"$ac_compile\"") >&5
20253   (eval $ac_compile) 2>&5
20254   ac_status=$?
20255   echo "$as_me:20255: \$? = $ac_status" >&5
20256   (exit $ac_status); } &&
20257          { ac_try='test -s conftest.$ac_objext'
20258   { (eval echo "$as_me:20258: \"$ac_try\"") >&5
20259   (eval $ac_try) 2>&5
20260   ac_status=$?
20261   echo "$as_me:20261: \$? = $ac_status" >&5
20262   (exit $ac_status); }; }; then
20263
20264                         cf_cv_const_x_string=no
20265
20266 else
20267   echo "$as_me: failed program was:" >&5
20268 cat conftest.$ac_ext >&5
20269
20270                         cf_cv_const_x_string=yes
20271
20272 fi
20273 rm -f conftest.$ac_objext conftest.$ac_ext
20274
20275 fi
20276 echo "$as_me:20276: result: $cf_cv_const_x_string" >&5
20277 echo "${ECHO_T}$cf_cv_const_x_string" >&6
20278
20279 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
20280 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
20281 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
20282
20283 case $cf_cv_const_x_string in
20284 (no)
20285
20286         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20287         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
20288
20289         ;;
20290 (*)
20291
20292         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20293         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
20294
20295         ;;
20296 esac
20297
20298 else
20299   echo "$as_me: failed program was:" >&5
20300 cat conftest.$ac_ext >&5
20301 fi
20302 rm -f conftest.$ac_objext conftest.$ac_ext
20303  fi
20304 cat > conftest.$ac_ext <<EOF
20305 #line 20305 "${as_me:-configure}"
20306 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
20307 EOF
20308 if test "$INTEL_COMPILER" = yes
20309 then
20310 # The "-wdXXX" options suppress warnings:
20311 # remark #1419: external declaration in primary source file
20312 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
20313 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
20314 # remark #193: zero used for undefined preprocessing identifier
20315 # remark #593: variable "curs_sb_left_arrow" was set but never used
20316 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
20317 # remark #869: parameter "tw" was never referenced
20318 # remark #981: operands are evaluated in unspecified order
20319 # warning #279: controlling expression is constant
20320
20321         { echo "$as_me:20321: checking for $CC warning options..." >&5
20322 echo "$as_me: checking for $CC warning options..." >&6;}
20323         cf_save_CFLAGS="$CFLAGS"
20324         EXTRA_CFLAGS="-Wall"
20325         for cf_opt in \
20326                 wd1419 \
20327                 wd1683 \
20328                 wd1684 \
20329                 wd193 \
20330                 wd593 \
20331                 wd279 \
20332                 wd810 \
20333                 wd869 \
20334                 wd981
20335         do
20336                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
20337                 if { (eval echo "$as_me:20337: \"$ac_compile\"") >&5
20338   (eval $ac_compile) 2>&5
20339   ac_status=$?
20340   echo "$as_me:20340: \$? = $ac_status" >&5
20341   (exit $ac_status); }; then
20342                         test -n "$verbose" && echo "$as_me:20342: result: ... -$cf_opt" >&5
20343 echo "${ECHO_T}... -$cf_opt" >&6
20344                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
20345                 fi
20346         done
20347         CFLAGS="$cf_save_CFLAGS"
20348 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
20349 then
20350         { echo "$as_me:20350: checking for $CC warning options..." >&5
20351 echo "$as_me: checking for $CC warning options..." >&6;}
20352         cf_save_CFLAGS="$CFLAGS"
20353         EXTRA_CFLAGS=
20354         cf_warn_CONST=""
20355         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
20356         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
20357         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
20358         for cf_opt in W Wall \
20359                 Wbad-function-cast \
20360                 Wcast-align \
20361                 Wcast-qual \
20362                 Wdeclaration-after-statement \
20363                 Wextra \
20364                 Winline \
20365                 Wmissing-declarations \
20366                 Wmissing-prototypes \
20367                 Wnested-externs \
20368                 Wpointer-arith \
20369                 Wshadow \
20370                 Wstrict-prototypes \
20371                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
20372         do
20373                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
20374                 if { (eval echo "$as_me:20374: \"$ac_compile\"") >&5
20375   (eval $ac_compile) 2>&5
20376   ac_status=$?
20377   echo "$as_me:20377: \$? = $ac_status" >&5
20378   (exit $ac_status); }; then
20379                         test -n "$verbose" && echo "$as_me:20379: result: ... -$cf_opt" >&5
20380 echo "${ECHO_T}... -$cf_opt" >&6
20381                         case $cf_opt in
20382                         (Winline)
20383                                 case $GCC_VERSION in
20384                                 ([34].*)
20385                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
20386
20387 echo "${as_me:-configure}:20387: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
20388
20389                                         continue;;
20390                                 esac
20391                                 ;;
20392                         (Wpointer-arith)
20393                                 case $GCC_VERSION in
20394                                 ([12].*)
20395                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
20396
20397 echo "${as_me:-configure}:20397: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
20398
20399                                         continue;;
20400                                 esac
20401                                 ;;
20402                         esac
20403                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
20404                 fi
20405         done
20406         CFLAGS="$cf_save_CFLAGS"
20407 fi
20408 rm -rf conftest*
20409
20410 fi
20411 fi
20412
20413 echo "$as_me:20413: checking if you want to use dmalloc for testing" >&5
20414 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
20415
20416 # Check whether --with-dmalloc or --without-dmalloc was given.
20417 if test "${with_dmalloc+set}" = set; then
20418   withval="$with_dmalloc"
20419
20420 cat >>confdefs.h <<EOF
20421 #define USE_DMALLOC 1
20422 EOF
20423
20424         : ${with_cflags:=-g}
20425         : ${with_no_leaks:=yes}
20426          with_dmalloc=yes
20427 else
20428   with_dmalloc=
20429 fi;
20430 echo "$as_me:20430: result: ${with_dmalloc:-no}" >&5
20431 echo "${ECHO_T}${with_dmalloc:-no}" >&6
20432
20433 case .$with_cflags in
20434 (.*-g*)
20435         case .$CFLAGS in
20436         (.*-g*)
20437                 ;;
20438         (*)
20439
20440 cf_fix_cppflags=no
20441 cf_new_cflags=
20442 cf_new_cppflags=
20443 cf_new_extra_cppflags=
20444
20445 for cf_add_cflags in -g
20446 do
20447 case $cf_fix_cppflags in
20448 (no)
20449         case $cf_add_cflags in
20450         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20451                 case $cf_add_cflags in
20452                 (-D*)
20453                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20454
20455                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20456                                 && test -z "${cf_tst_cflags}" \
20457                                 && cf_fix_cppflags=yes
20458
20459                         if test $cf_fix_cppflags = yes ; then
20460
20461         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20462         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20463
20464                                 continue
20465                         elif test "${cf_tst_cflags}" = "\"'" ; then
20466
20467         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20468         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20469
20470                                 continue
20471                         fi
20472                         ;;
20473                 esac
20474                 case "$CPPFLAGS" in
20475                 (*$cf_add_cflags)
20476                         ;;
20477                 (*)
20478                         case $cf_add_cflags in
20479                         (-D*)
20480                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20481
20482 CPPFLAGS=`echo "$CPPFLAGS" | \
20483         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20484                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20485
20486                                 ;;
20487                         esac
20488
20489         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20490         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20491
20492                         ;;
20493                 esac
20494                 ;;
20495         (*)
20496
20497         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20498         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20499
20500                 ;;
20501         esac
20502         ;;
20503 (yes)
20504
20505         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20506         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20507
20508         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20509
20510         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20511                 && test -z "${cf_tst_cflags}" \
20512                 && cf_fix_cppflags=no
20513         ;;
20514 esac
20515 done
20516
20517 if test -n "$cf_new_cflags" ; then
20518
20519         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20520         CFLAGS="${CFLAGS}$cf_new_cflags"
20521
20522 fi
20523
20524 if test -n "$cf_new_cppflags" ; then
20525
20526         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20527         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20528
20529 fi
20530
20531 if test -n "$cf_new_extra_cppflags" ; then
20532
20533         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20534         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20535
20536 fi
20537
20538                 ;;
20539         esac
20540         ;;
20541 esac
20542
20543 if test "$with_dmalloc" = yes ; then
20544         echo "$as_me:20544: checking for dmalloc.h" >&5
20545 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
20546 if test "${ac_cv_header_dmalloc_h+set}" = set; then
20547   echo $ECHO_N "(cached) $ECHO_C" >&6
20548 else
20549   cat >conftest.$ac_ext <<_ACEOF
20550 #line 20550 "configure"
20551 #include "confdefs.h"
20552 #include <dmalloc.h>
20553 _ACEOF
20554 if { (eval echo "$as_me:20554: \"$ac_cpp conftest.$ac_ext\"") >&5
20555   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20556   ac_status=$?
20557   egrep -v '^ *\+' conftest.er1 >conftest.err
20558   rm -f conftest.er1
20559   cat conftest.err >&5
20560   echo "$as_me:20560: \$? = $ac_status" >&5
20561   (exit $ac_status); } >/dev/null; then
20562   if test -s conftest.err; then
20563     ac_cpp_err=$ac_c_preproc_warn_flag
20564   else
20565     ac_cpp_err=
20566   fi
20567 else
20568   ac_cpp_err=yes
20569 fi
20570 if test -z "$ac_cpp_err"; then
20571   ac_cv_header_dmalloc_h=yes
20572 else
20573   echo "$as_me: failed program was:" >&5
20574   cat conftest.$ac_ext >&5
20575   ac_cv_header_dmalloc_h=no
20576 fi
20577 rm -f conftest.err conftest.$ac_ext
20578 fi
20579 echo "$as_me:20579: result: $ac_cv_header_dmalloc_h" >&5
20580 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
20581 if test $ac_cv_header_dmalloc_h = yes; then
20582
20583 echo "$as_me:20583: checking for dmalloc_debug in -ldmalloc" >&5
20584 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
20585 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
20586   echo $ECHO_N "(cached) $ECHO_C" >&6
20587 else
20588   ac_check_lib_save_LIBS=$LIBS
20589 LIBS="-ldmalloc  $LIBS"
20590 cat >conftest.$ac_ext <<_ACEOF
20591 #line 20591 "configure"
20592 #include "confdefs.h"
20593
20594 /* Override any gcc2 internal prototype to avoid an error.  */
20595 #ifdef __cplusplus
20596 extern "C"
20597 #endif
20598 /* We use char because int might match the return type of a gcc2
20599    builtin and then its argument prototype would still apply.  */
20600 char dmalloc_debug ();
20601 int
20602 main (void)
20603 {
20604 dmalloc_debug ();
20605   ;
20606   return 0;
20607 }
20608 _ACEOF
20609 rm -f conftest.$ac_objext conftest$ac_exeext
20610 if { (eval echo "$as_me:20610: \"$ac_link\"") >&5
20611   (eval $ac_link) 2>&5
20612   ac_status=$?
20613   echo "$as_me:20613: \$? = $ac_status" >&5
20614   (exit $ac_status); } &&
20615          { ac_try='test -s conftest$ac_exeext'
20616   { (eval echo "$as_me:20616: \"$ac_try\"") >&5
20617   (eval $ac_try) 2>&5
20618   ac_status=$?
20619   echo "$as_me:20619: \$? = $ac_status" >&5
20620   (exit $ac_status); }; }; then
20621   ac_cv_lib_dmalloc_dmalloc_debug=yes
20622 else
20623   echo "$as_me: failed program was:" >&5
20624 cat conftest.$ac_ext >&5
20625 ac_cv_lib_dmalloc_dmalloc_debug=no
20626 fi
20627 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20628 LIBS=$ac_check_lib_save_LIBS
20629 fi
20630 echo "$as_me:20630: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
20631 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
20632 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
20633   cat >>confdefs.h <<EOF
20634 #define HAVE_LIBDMALLOC 1
20635 EOF
20636
20637   LIBS="-ldmalloc $LIBS"
20638
20639 fi
20640
20641 fi
20642
20643 fi
20644
20645 echo "$as_me:20645: checking if you want to use dbmalloc for testing" >&5
20646 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
20647
20648 # Check whether --with-dbmalloc or --without-dbmalloc was given.
20649 if test "${with_dbmalloc+set}" = set; then
20650   withval="$with_dbmalloc"
20651
20652 cat >>confdefs.h <<EOF
20653 #define USE_DBMALLOC 1
20654 EOF
20655
20656         : ${with_cflags:=-g}
20657         : ${with_no_leaks:=yes}
20658          with_dbmalloc=yes
20659 else
20660   with_dbmalloc=
20661 fi;
20662 echo "$as_me:20662: result: ${with_dbmalloc:-no}" >&5
20663 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
20664
20665 case .$with_cflags in
20666 (.*-g*)
20667         case .$CFLAGS in
20668         (.*-g*)
20669                 ;;
20670         (*)
20671
20672 cf_fix_cppflags=no
20673 cf_new_cflags=
20674 cf_new_cppflags=
20675 cf_new_extra_cppflags=
20676
20677 for cf_add_cflags in -g
20678 do
20679 case $cf_fix_cppflags in
20680 (no)
20681         case $cf_add_cflags in
20682         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20683                 case $cf_add_cflags in
20684                 (-D*)
20685                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20686
20687                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20688                                 && test -z "${cf_tst_cflags}" \
20689                                 && cf_fix_cppflags=yes
20690
20691                         if test $cf_fix_cppflags = yes ; then
20692
20693         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20694         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20695
20696                                 continue
20697                         elif test "${cf_tst_cflags}" = "\"'" ; then
20698
20699         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20700         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20701
20702                                 continue
20703                         fi
20704                         ;;
20705                 esac
20706                 case "$CPPFLAGS" in
20707                 (*$cf_add_cflags)
20708                         ;;
20709                 (*)
20710                         case $cf_add_cflags in
20711                         (-D*)
20712                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20713
20714 CPPFLAGS=`echo "$CPPFLAGS" | \
20715         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20716                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20717
20718                                 ;;
20719                         esac
20720
20721         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20722         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20723
20724                         ;;
20725                 esac
20726                 ;;
20727         (*)
20728
20729         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20730         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20731
20732                 ;;
20733         esac
20734         ;;
20735 (yes)
20736
20737         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20738         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20739
20740         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20741
20742         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20743                 && test -z "${cf_tst_cflags}" \
20744                 && cf_fix_cppflags=no
20745         ;;
20746 esac
20747 done
20748
20749 if test -n "$cf_new_cflags" ; then
20750
20751         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20752         CFLAGS="${CFLAGS}$cf_new_cflags"
20753
20754 fi
20755
20756 if test -n "$cf_new_cppflags" ; then
20757
20758         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20759         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20760
20761 fi
20762
20763 if test -n "$cf_new_extra_cppflags" ; then
20764
20765         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20766         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20767
20768 fi
20769
20770                 ;;
20771         esac
20772         ;;
20773 esac
20774
20775 if test "$with_dbmalloc" = yes ; then
20776         echo "$as_me:20776: checking for dbmalloc.h" >&5
20777 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
20778 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
20779   echo $ECHO_N "(cached) $ECHO_C" >&6
20780 else
20781   cat >conftest.$ac_ext <<_ACEOF
20782 #line 20782 "configure"
20783 #include "confdefs.h"
20784 #include <dbmalloc.h>
20785 _ACEOF
20786 if { (eval echo "$as_me:20786: \"$ac_cpp conftest.$ac_ext\"") >&5
20787   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20788   ac_status=$?
20789   egrep -v '^ *\+' conftest.er1 >conftest.err
20790   rm -f conftest.er1
20791   cat conftest.err >&5
20792   echo "$as_me:20792: \$? = $ac_status" >&5
20793   (exit $ac_status); } >/dev/null; then
20794   if test -s conftest.err; then
20795     ac_cpp_err=$ac_c_preproc_warn_flag
20796   else
20797     ac_cpp_err=
20798   fi
20799 else
20800   ac_cpp_err=yes
20801 fi
20802 if test -z "$ac_cpp_err"; then
20803   ac_cv_header_dbmalloc_h=yes
20804 else
20805   echo "$as_me: failed program was:" >&5
20806   cat conftest.$ac_ext >&5
20807   ac_cv_header_dbmalloc_h=no
20808 fi
20809 rm -f conftest.err conftest.$ac_ext
20810 fi
20811 echo "$as_me:20811: result: $ac_cv_header_dbmalloc_h" >&5
20812 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
20813 if test $ac_cv_header_dbmalloc_h = yes; then
20814
20815 echo "$as_me:20815: checking for debug_malloc in -ldbmalloc" >&5
20816 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
20817 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
20818   echo $ECHO_N "(cached) $ECHO_C" >&6
20819 else
20820   ac_check_lib_save_LIBS=$LIBS
20821 LIBS="-ldbmalloc  $LIBS"
20822 cat >conftest.$ac_ext <<_ACEOF
20823 #line 20823 "configure"
20824 #include "confdefs.h"
20825
20826 /* Override any gcc2 internal prototype to avoid an error.  */
20827 #ifdef __cplusplus
20828 extern "C"
20829 #endif
20830 /* We use char because int might match the return type of a gcc2
20831    builtin and then its argument prototype would still apply.  */
20832 char debug_malloc ();
20833 int
20834 main (void)
20835 {
20836 debug_malloc ();
20837   ;
20838   return 0;
20839 }
20840 _ACEOF
20841 rm -f conftest.$ac_objext conftest$ac_exeext
20842 if { (eval echo "$as_me:20842: \"$ac_link\"") >&5
20843   (eval $ac_link) 2>&5
20844   ac_status=$?
20845   echo "$as_me:20845: \$? = $ac_status" >&5
20846   (exit $ac_status); } &&
20847          { ac_try='test -s conftest$ac_exeext'
20848   { (eval echo "$as_me:20848: \"$ac_try\"") >&5
20849   (eval $ac_try) 2>&5
20850   ac_status=$?
20851   echo "$as_me:20851: \$? = $ac_status" >&5
20852   (exit $ac_status); }; }; then
20853   ac_cv_lib_dbmalloc_debug_malloc=yes
20854 else
20855   echo "$as_me: failed program was:" >&5
20856 cat conftest.$ac_ext >&5
20857 ac_cv_lib_dbmalloc_debug_malloc=no
20858 fi
20859 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20860 LIBS=$ac_check_lib_save_LIBS
20861 fi
20862 echo "$as_me:20862: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
20863 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
20864 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
20865   cat >>confdefs.h <<EOF
20866 #define HAVE_LIBDBMALLOC 1
20867 EOF
20868
20869   LIBS="-ldbmalloc $LIBS"
20870
20871 fi
20872
20873 fi
20874
20875 fi
20876
20877 echo "$as_me:20877: checking if you want to use valgrind for testing" >&5
20878 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
20879
20880 # Check whether --with-valgrind or --without-valgrind was given.
20881 if test "${with_valgrind+set}" = set; then
20882   withval="$with_valgrind"
20883
20884 cat >>confdefs.h <<EOF
20885 #define USE_VALGRIND 1
20886 EOF
20887
20888         : ${with_cflags:=-g}
20889         : ${with_no_leaks:=yes}
20890          with_valgrind=yes
20891 else
20892   with_valgrind=
20893 fi;
20894 echo "$as_me:20894: result: ${with_valgrind:-no}" >&5
20895 echo "${ECHO_T}${with_valgrind:-no}" >&6
20896
20897 case .$with_cflags in
20898 (.*-g*)
20899         case .$CFLAGS in
20900         (.*-g*)
20901                 ;;
20902         (*)
20903
20904 cf_fix_cppflags=no
20905 cf_new_cflags=
20906 cf_new_cppflags=
20907 cf_new_extra_cppflags=
20908
20909 for cf_add_cflags in -g
20910 do
20911 case $cf_fix_cppflags in
20912 (no)
20913         case $cf_add_cflags in
20914         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20915                 case $cf_add_cflags in
20916                 (-D*)
20917                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20918
20919                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20920                                 && test -z "${cf_tst_cflags}" \
20921                                 && cf_fix_cppflags=yes
20922
20923                         if test $cf_fix_cppflags = yes ; then
20924
20925         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20926         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20927
20928                                 continue
20929                         elif test "${cf_tst_cflags}" = "\"'" ; then
20930
20931         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20932         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20933
20934                                 continue
20935                         fi
20936                         ;;
20937                 esac
20938                 case "$CPPFLAGS" in
20939                 (*$cf_add_cflags)
20940                         ;;
20941                 (*)
20942                         case $cf_add_cflags in
20943                         (-D*)
20944                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20945
20946 CPPFLAGS=`echo "$CPPFLAGS" | \
20947         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20948                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20949
20950                                 ;;
20951                         esac
20952
20953         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20954         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20955
20956                         ;;
20957                 esac
20958                 ;;
20959         (*)
20960
20961         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20962         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20963
20964                 ;;
20965         esac
20966         ;;
20967 (yes)
20968
20969         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20970         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20971
20972         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20973
20974         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20975                 && test -z "${cf_tst_cflags}" \
20976                 && cf_fix_cppflags=no
20977         ;;
20978 esac
20979 done
20980
20981 if test -n "$cf_new_cflags" ; then
20982
20983         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20984         CFLAGS="${CFLAGS}$cf_new_cflags"
20985
20986 fi
20987
20988 if test -n "$cf_new_cppflags" ; then
20989
20990         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20991         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20992
20993 fi
20994
20995 if test -n "$cf_new_extra_cppflags" ; then
20996
20997         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20998         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20999
21000 fi
21001
21002                 ;;
21003         esac
21004         ;;
21005 esac
21006
21007 echo "$as_me:21007: checking if you want to perform memory-leak testing" >&5
21008 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
21009
21010 # Check whether --enable-leaks or --disable-leaks was given.
21011 if test "${enable_leaks+set}" = set; then
21012   enableval="$enable_leaks"
21013   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
21014 else
21015   : ${with_no_leaks:=no}
21016 fi;
21017 echo "$as_me:21017: result: $with_no_leaks" >&5
21018 echo "${ECHO_T}$with_no_leaks" >&6
21019
21020 if test "$with_no_leaks" = yes ; then
21021
21022 cat >>confdefs.h <<\EOF
21023 #define NO_LEAKS 1
21024 EOF
21025
21026 cat >>confdefs.h <<\EOF
21027 #define YY_NO_LEAKS 1
21028 EOF
21029
21030 fi
21031
21032 LD_RPATH_OPT=
21033 if test "x$cf_cv_enable_rpath" != xno
21034 then
21035         echo "$as_me:21035: checking for an rpath option" >&5
21036 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
21037         case $cf_cv_system_name in
21038         (irix*)
21039                 if test "$GCC" = yes; then
21040                         LD_RPATH_OPT="-Wl,-rpath,"
21041                 else
21042                         LD_RPATH_OPT="-rpath "
21043                 fi
21044                 ;;
21045         (linux*|gnu*|k*bsd*-gnu|freebsd*)
21046                 LD_RPATH_OPT="-Wl,-rpath,"
21047                 ;;
21048         (openbsd[2-9].*|mirbsd*)
21049                 LD_RPATH_OPT="-Wl,-rpath,"
21050                 ;;
21051         (dragonfly*)
21052                 LD_RPATH_OPT="-rpath "
21053                 ;;
21054         (netbsd*)
21055                 LD_RPATH_OPT="-Wl,-rpath,"
21056                 ;;
21057         (osf*|mls+*)
21058                 LD_RPATH_OPT="-rpath "
21059                 ;;
21060         (solaris2*)
21061                 LD_RPATH_OPT="-R"
21062                 ;;
21063         (*)
21064                 ;;
21065         esac
21066         echo "$as_me:21066: result: $LD_RPATH_OPT" >&5
21067 echo "${ECHO_T}$LD_RPATH_OPT" >&6
21068
21069         case "x$LD_RPATH_OPT" in
21070         (x-R*)
21071                 echo "$as_me:21071: checking if we need a space after rpath option" >&5
21072 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
21073                 cf_save_LIBS="$LIBS"
21074
21075 cf_add_libs="$LIBS"
21076 # reverse order
21077 cf_add_0lib=
21078 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
21079 # filter duplicates
21080 for cf_add_1lib in $cf_add_0lib; do
21081         for cf_add_2lib in $cf_add_libs; do
21082                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
21083                         cf_add_1lib=
21084                         break
21085                 fi
21086         done
21087         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
21088 done
21089 LIBS="$cf_add_libs"
21090
21091                 cat >conftest.$ac_ext <<_ACEOF
21092 #line 21092 "configure"
21093 #include "confdefs.h"
21094
21095 int
21096 main (void)
21097 {
21098
21099   ;
21100   return 0;
21101 }
21102 _ACEOF
21103 rm -f conftest.$ac_objext conftest$ac_exeext
21104 if { (eval echo "$as_me:21104: \"$ac_link\"") >&5
21105   (eval $ac_link) 2>&5
21106   ac_status=$?
21107   echo "$as_me:21107: \$? = $ac_status" >&5
21108   (exit $ac_status); } &&
21109          { ac_try='test -s conftest$ac_exeext'
21110   { (eval echo "$as_me:21110: \"$ac_try\"") >&5
21111   (eval $ac_try) 2>&5
21112   ac_status=$?
21113   echo "$as_me:21113: \$? = $ac_status" >&5
21114   (exit $ac_status); }; }; then
21115   cf_rpath_space=no
21116 else
21117   echo "$as_me: failed program was:" >&5
21118 cat conftest.$ac_ext >&5
21119 cf_rpath_space=yes
21120 fi
21121 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21122                 LIBS="$cf_save_LIBS"
21123                 echo "$as_me:21123: result: $cf_rpath_space" >&5
21124 echo "${ECHO_T}$cf_rpath_space" >&6
21125                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
21126                 ;;
21127         esac
21128 fi
21129
21130 echo "$as_me:21130: checking if rpath-hack should be disabled" >&5
21131 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
21132
21133 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
21134 if test "${enable_rpath_hack+set}" = set; then
21135   enableval="$enable_rpath_hack"
21136   test "$enableval" != no && enableval=yes
21137         if test "$enableval" != "yes" ; then
21138     cf_disable_rpath_hack=yes
21139         else
21140                 cf_disable_rpath_hack=no
21141         fi
21142 else
21143   enableval=yes
21144         cf_disable_rpath_hack=no
21145
21146 fi;
21147 echo "$as_me:21147: result: $cf_disable_rpath_hack" >&5
21148 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
21149 if test "$cf_disable_rpath_hack" = no ; then
21150
21151 echo "$as_me:21151: checking for updated LDFLAGS" >&5
21152 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
21153 if test -n "$LD_RPATH_OPT" ; then
21154         echo "$as_me:21154: result: maybe" >&5
21155 echo "${ECHO_T}maybe" >&6
21156
21157         for ac_prog in ldd
21158 do
21159   # Extract the first word of "$ac_prog", so it can be a program name with args.
21160 set dummy $ac_prog; ac_word=$2
21161 echo "$as_me:21161: checking for $ac_word" >&5
21162 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
21163 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
21164   echo $ECHO_N "(cached) $ECHO_C" >&6
21165 else
21166   if test -n "$cf_ldd_prog"; then
21167   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
21168 else
21169   ac_save_IFS=$IFS; IFS=$ac_path_separator
21170 ac_dummy="$PATH"
21171 for ac_dir in $ac_dummy; do
21172   IFS=$ac_save_IFS
21173   test -z "$ac_dir" && ac_dir=.
21174   $as_executable_p "$ac_dir/$ac_word" || continue
21175 ac_cv_prog_cf_ldd_prog="$ac_prog"
21176 echo "$as_me:21176: found $ac_dir/$ac_word" >&5
21177 break
21178 done
21179
21180 fi
21181 fi
21182 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
21183 if test -n "$cf_ldd_prog"; then
21184   echo "$as_me:21184: result: $cf_ldd_prog" >&5
21185 echo "${ECHO_T}$cf_ldd_prog" >&6
21186 else
21187   echo "$as_me:21187: result: no" >&5
21188 echo "${ECHO_T}no" >&6
21189 fi
21190
21191   test -n "$cf_ldd_prog" && break
21192 done
21193 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
21194
21195         cf_rpath_list="/usr/lib /lib"
21196         if test "$cf_ldd_prog" != no
21197         then
21198                 cf_rpath_oops=
21199
21200 cat >conftest.$ac_ext <<_ACEOF
21201 #line 21201 "configure"
21202 #include "confdefs.h"
21203 #include <stdio.h>
21204 int
21205 main (void)
21206 {
21207 printf("Hello");
21208   ;
21209   return 0;
21210 }
21211 _ACEOF
21212 rm -f conftest.$ac_objext conftest$ac_exeext
21213 if { (eval echo "$as_me:21213: \"$ac_link\"") >&5
21214   (eval $ac_link) 2>&5
21215   ac_status=$?
21216   echo "$as_me:21216: \$? = $ac_status" >&5
21217   (exit $ac_status); } &&
21218          { ac_try='test -s conftest$ac_exeext'
21219   { (eval echo "$as_me:21219: \"$ac_try\"") >&5
21220   (eval $ac_try) 2>&5
21221   ac_status=$?
21222   echo "$as_me:21222: \$? = $ac_status" >&5
21223   (exit $ac_status); }; }; then
21224   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
21225                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
21226 else
21227   echo "$as_me: failed program was:" >&5
21228 cat conftest.$ac_ext >&5
21229 fi
21230 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21231
21232                 # If we passed the link-test, but get a "not found" on a given library,
21233                 # this could be due to inept reconfiguration of gcc to make it only
21234                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
21235                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
21236                 # /usr/local libraries.
21237                 if test -n "$cf_rpath_oops"
21238                 then
21239                         for cf_rpath_src in $cf_rpath_oops
21240                         do
21241                                 for cf_rpath_dir in \
21242                                         /usr/local \
21243                                         /usr/pkg \
21244                                         /opt/sfw
21245                                 do
21246                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
21247                                         then
21248                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
21249
21250 echo "${as_me:-configure}:21250: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
21251
21252                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
21253                                                 break
21254                                         fi
21255                                 done
21256                         done
21257                 fi
21258         fi
21259
21260         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
21261
21262 echo "${as_me:-configure}:21262: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
21263
21264 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
21265
21266 echo "${as_me:-configure}:21266: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
21267
21268 cf_rpath_dst=
21269 for cf_rpath_src in $LDFLAGS
21270 do
21271         case $cf_rpath_src in
21272         (-L*)
21273
21274                 # check if this refers to a directory which we will ignore
21275                 cf_rpath_skip=no
21276                 if test -n "$cf_rpath_list"
21277                 then
21278                         for cf_rpath_item in $cf_rpath_list
21279                         do
21280                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
21281                                 then
21282                                         cf_rpath_skip=yes
21283                                         break
21284                                 fi
21285                         done
21286                 fi
21287
21288                 if test "$cf_rpath_skip" = no
21289                 then
21290                         # transform the option
21291                         if test "$LD_RPATH_OPT" = "-R " ; then
21292                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
21293                         else
21294                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
21295                         fi
21296
21297                         # if we have not already added this, add it now
21298                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
21299                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
21300                         then
21301                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
21302
21303 echo "${as_me:-configure}:21303: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
21304
21305                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
21306                         fi
21307                 fi
21308                 ;;
21309         esac
21310         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
21311 done
21312 LDFLAGS=$cf_rpath_dst
21313
21314 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
21315
21316 echo "${as_me:-configure}:21316: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
21317
21318 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
21319
21320 echo "${as_me:-configure}:21320: testing ...checking LIBS $LIBS ..." 1>&5
21321
21322 cf_rpath_dst=
21323 for cf_rpath_src in $LIBS
21324 do
21325         case $cf_rpath_src in
21326         (-L*)
21327
21328                 # check if this refers to a directory which we will ignore
21329                 cf_rpath_skip=no
21330                 if test -n "$cf_rpath_list"
21331                 then
21332                         for cf_rpath_item in $cf_rpath_list
21333                         do
21334                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
21335                                 then
21336                                         cf_rpath_skip=yes
21337                                         break
21338                                 fi
21339                         done
21340                 fi
21341
21342                 if test "$cf_rpath_skip" = no
21343                 then
21344                         # transform the option
21345                         if test "$LD_RPATH_OPT" = "-R " ; then
21346                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
21347                         else
21348                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
21349                         fi
21350
21351                         # if we have not already added this, add it now
21352                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
21353                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
21354                         then
21355                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
21356
21357 echo "${as_me:-configure}:21357: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
21358
21359                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
21360                         fi
21361                 fi
21362                 ;;
21363         esac
21364         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
21365 done
21366 LIBS=$cf_rpath_dst
21367
21368 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
21369
21370 echo "${as_me:-configure}:21370: testing ...checked LIBS $LIBS ..." 1>&5
21371
21372         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
21373
21374 echo "${as_me:-configure}:21374: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
21375
21376 else
21377         echo "$as_me:21377: result: no" >&5
21378 echo "${ECHO_T}no" >&6
21379 fi
21380
21381 fi
21382
21383 TEST_ARGS="$LIBS"
21384 LIBS=
21385
21386 ac_config_files="$ac_config_files Makefile"
21387 ac_config_commands="$ac_config_commands default"
21388 cat >confcache <<\_ACEOF
21389 # This file is a shell script that caches the results of configure
21390 # tests run on this system so they can be shared between configure
21391 # scripts and configure runs, see configure's option --config-cache.
21392 # It is not useful on other systems.  If it contains results you don't
21393 # want to keep, you may remove or edit it.
21394 #
21395 # config.status only pays attention to the cache file if you give it
21396 # the --recheck option to rerun configure.
21397 #
21398 # `ac_cv_env_foo' variables (set or unset) will be overriden when
21399 # loading this file, other *unset* `ac_cv_foo' will be assigned the
21400 # following values.
21401
21402 _ACEOF
21403
21404 # The following way of writing the cache mishandles newlines in values,
21405 # but we know of no workaround that is simple, portable, and efficient.
21406 # So, don't put newlines in cache variables' values.
21407 # Ultrix sh set writes to stderr and can't be redirected directly,
21408 # and sets the high bit in the cache file unless we assign to the vars.
21409 {
21410   (set) 2>&1 |
21411     case `(ac_space=' '; set | grep ac_space) 2>&1` in
21412     *ac_space=\ *)
21413       # `set' does not quote correctly, so add quotes (double-quote
21414       # substitution turns \\\\ into \\, and sed turns \\ into \).
21415       sed -n \
21416         "s/'/'\\\\''/g;
21417           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
21418       ;;
21419     *)
21420       # `set' quotes correctly as required by POSIX, so do not add quotes.
21421       sed -n \
21422         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
21423       ;;
21424     esac;
21425 } |
21426   sed '
21427      t clear
21428      : clear
21429      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
21430      t end
21431      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
21432      : end' >>confcache
21433 if cmp -s $cache_file confcache; then :; else
21434   if test -w $cache_file; then
21435     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
21436     cat confcache >$cache_file
21437   else
21438     echo "not updating unwritable cache $cache_file"
21439   fi
21440 fi
21441 rm -f confcache
21442
21443 test "x$prefix" = xNONE && prefix=$ac_default_prefix
21444 # Let make expand exec_prefix.
21445 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
21446
21447 # VPATH may cause trouble with some makes, so we remove $(srcdir),
21448 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
21449 # trailing colons and then remove the whole line if VPATH becomes empty
21450 # (actually we leave an empty line to preserve line numbers).
21451 if test "x$srcdir" = x.; then
21452   ac_vpsub='/^[         ]*VPATH[        ]*=/{
21453 s/:*\$(srcdir):*/:/;
21454 s/:*\${srcdir}:*/:/;
21455 s/:*@srcdir@:*/:/;
21456 s/^\([^=]*=[    ]*\):*/\1/;
21457 s/:*$//;
21458 s/^[^=]*=[      ]*$//;
21459 }'
21460 fi
21461
21462 DEFS=-DHAVE_CONFIG_H
21463
21464 : ${CONFIG_STATUS=./config.status}
21465 ac_clean_files_save=$ac_clean_files
21466 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
21467 { echo "$as_me:21467: creating $CONFIG_STATUS" >&5
21468 echo "$as_me: creating $CONFIG_STATUS" >&6;}
21469 cat >$CONFIG_STATUS <<_ACEOF
21470 #! $SHELL
21471 # Generated automatically by configure.
21472 # Run this file to recreate the current configuration.
21473 # Compiler output produced by configure, useful for debugging
21474 # configure, is in config.log if it exists.
21475
21476 debug=false
21477 SHELL=\${CONFIG_SHELL-$SHELL}
21478 ac_cs_invocation="\$0 \$@"
21479
21480 _ACEOF
21481
21482 cat >>$CONFIG_STATUS <<\_ACEOF
21483 # Be Bourne compatible
21484 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
21485   emulate sh
21486   NULLCMD=:
21487 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
21488   set -o posix
21489 fi
21490
21491 # Name of the executable.
21492 as_me=`echo "$0" |sed 's,.*[\\/],,'`
21493
21494 if expr a : '\(a\)' >/dev/null 2>&1; then
21495   as_expr=expr
21496 else
21497   as_expr=false
21498 fi
21499
21500 rm -f conf$$ conf$$.exe conf$$.file
21501 echo >conf$$.file
21502 if ln -s conf$$.file conf$$ 2>/dev/null; then
21503   # We could just check for DJGPP; but this test a) works b) is more generic
21504   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
21505   if test -f conf$$.exe; then
21506     # Don't use ln at all; we don't have any links
21507     as_ln_s='cp -p'
21508   else
21509     as_ln_s='ln -s'
21510   fi
21511 elif ln conf$$.file conf$$ 2>/dev/null; then
21512   as_ln_s=ln
21513 else
21514   as_ln_s='cp -p'
21515 fi
21516 rm -f conf$$ conf$$.exe conf$$.file
21517
21518 as_executable_p="test -f"
21519
21520 # Support unset when possible.
21521 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
21522   as_unset=unset
21523 else
21524   as_unset=false
21525 fi
21526
21527 # NLS nuisances.
21528 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
21529 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
21530 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
21531 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
21532 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
21533 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
21534 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
21535 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
21536
21537 # IFS
21538 # We need space, tab and new line, in precisely that order.
21539 as_nl='
21540 '
21541 IFS="   $as_nl"
21542
21543 # CDPATH.
21544 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
21545
21546 exec 6>&1
21547
21548 _ACEOF
21549
21550 # Files that config.status was made for.
21551 if test -n "$ac_config_files"; then
21552   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
21553 fi
21554
21555 if test -n "$ac_config_headers"; then
21556   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
21557 fi
21558
21559 if test -n "$ac_config_links"; then
21560   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
21561 fi
21562
21563 if test -n "$ac_config_commands"; then
21564   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
21565 fi
21566
21567 cat >>$CONFIG_STATUS <<\EOF
21568
21569 ac_cs_usage="\
21570 \`$as_me' instantiates files from templates according to the
21571 current configuration.
21572
21573 Usage: $0 [OPTIONS] [FILE]...
21574
21575   -h, --help       print this help, then exit
21576   -V, --version    print version number, then exit
21577   -d, --debug      don't remove temporary files
21578       --recheck    update $as_me by reconfiguring in the same conditions
21579   --file=FILE[:TEMPLATE]
21580                    instantiate the configuration file FILE
21581   --header=FILE[:TEMPLATE]
21582                    instantiate the configuration header FILE
21583
21584 Configuration files:
21585 $config_files
21586
21587 Configuration headers:
21588 $config_headers
21589
21590 Configuration commands:
21591 $config_commands
21592
21593 Report bugs to <dickey@invisible-island.net>."
21594 EOF
21595
21596 cat >>$CONFIG_STATUS <<EOF
21597 ac_cs_version="\\
21598 config.status
21599 configured by $0, generated by GNU Autoconf 2.52.20200111,
21600   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
21601
21602 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
21603 Free Software Foundation, Inc.
21604 This config.status script is free software; the Free Software Foundation
21605 gives unlimited permission to copy, distribute and modify it."
21606 srcdir=$srcdir
21607 INSTALL="$INSTALL"
21608 EOF
21609
21610 cat >>$CONFIG_STATUS <<\EOF
21611 # If no file are specified by the user, then we need to provide default
21612 # value.  By we need to know if files were specified by the user.
21613 ac_need_defaults=:
21614 while test $# != 0
21615 do
21616   case $1 in
21617   --*=*)
21618     ac_option=`expr "x$1" : 'x\([^=]*\)='`
21619     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
21620     shift
21621     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
21622     shift
21623     ;;
21624   -*);;
21625   *) # This is not an option, so the user has probably given explicit
21626      # arguments.
21627      ac_need_defaults=false;;
21628   esac
21629
21630   case $1 in
21631   # Handling of the options.
21632 EOF
21633 cat >>$CONFIG_STATUS <<EOF
21634   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
21635     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
21636     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
21637 EOF
21638 cat >>$CONFIG_STATUS <<\EOF
21639   --version | --vers* | -V )
21640     echo "$ac_cs_version"; exit 0 ;;
21641   --he | --h)
21642     # Conflict between --help and --header
21643     { { echo "$as_me:21643: error: ambiguous option: $1
21644 Try \`$0 --help' for more information." >&5
21645 echo "$as_me: error: ambiguous option: $1
21646 Try \`$0 --help' for more information." >&2;}
21647    { (exit 1); exit 1; }; };;
21648   --help | --hel | -h )
21649     echo "$ac_cs_usage"; exit 0 ;;
21650   --debug | --d* | -d )
21651     debug=: ;;
21652   --file | --fil | --fi | --f )
21653     shift
21654     CONFIG_FILES="$CONFIG_FILES $1"
21655     ac_need_defaults=false;;
21656   --header | --heade | --head | --hea )
21657     shift
21658     CONFIG_HEADERS="$CONFIG_HEADERS $1"
21659     ac_need_defaults=false;;
21660
21661   # This is an error.
21662   -*) { { echo "$as_me:21662: error: unrecognized option: $1
21663 Try \`$0 --help' for more information." >&5
21664 echo "$as_me: error: unrecognized option: $1
21665 Try \`$0 --help' for more information." >&2;}
21666    { (exit 1); exit 1; }; } ;;
21667
21668   *) ac_config_targets="$ac_config_targets $1" ;;
21669
21670   esac
21671   shift
21672 done
21673
21674 exec 5>>config.log
21675 cat >&5 << _ACEOF
21676
21677 ## ----------------------- ##
21678 ## Running config.status.  ##
21679 ## ----------------------- ##
21680
21681 This file was extended by $as_me 2.52.20200111, executed with
21682   CONFIG_FILES    = $CONFIG_FILES
21683   CONFIG_HEADERS  = $CONFIG_HEADERS
21684   CONFIG_LINKS    = $CONFIG_LINKS
21685   CONFIG_COMMANDS = $CONFIG_COMMANDS
21686   > $ac_cs_invocation
21687 on `(hostname || uname -n) 2>/dev/null | sed 1q`
21688
21689 _ACEOF
21690 EOF
21691
21692 cat >>$CONFIG_STATUS <<EOF
21693 #
21694 # INIT-COMMANDS section.
21695 #
21696
21697 AWK="$AWK"
21698 ECHO_CC="$ECHO_CC"
21699 ECHO_LD="$ECHO_LD"
21700 SHOW_CC="$SHOW_LD"
21701
21702 EOF
21703
21704 cat >>$CONFIG_STATUS <<\EOF
21705 for ac_config_target in $ac_config_targets
21706 do
21707   case "$ac_config_target" in
21708   # Handling of arguments.
21709   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
21710   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
21711   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
21712   *) { { echo "$as_me:21712: error: invalid argument: $ac_config_target" >&5
21713 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
21714    { (exit 1); exit 1; }; };;
21715   esac
21716 done
21717
21718 # If the user did not use the arguments to specify the items to instantiate,
21719 # then the envvar interface is used.  Set only those that are not.
21720 # We use the long form for the default assignment because of an extremely
21721 # bizarre bug on SunOS 4.1.3.
21722 if $ac_need_defaults; then
21723   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
21724   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
21725   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
21726 fi
21727
21728 # Create a temporary directory, and hook for its removal unless debugging.
21729 $debug ||
21730 {
21731   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
21732   trap '{ (exit 1); exit 1; }' 1 2 13 15
21733 }
21734
21735 # Create a (secure) tmp directory for tmp files.
21736 : ${TMPDIR=/tmp}
21737 {
21738   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
21739   test -n "$tmp" && test -d "$tmp"
21740 }  ||
21741 {
21742   tmp=$TMPDIR/cs$$-$RANDOM
21743   (umask 077 && mkdir $tmp)
21744 } ||
21745 {
21746    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
21747    { (exit 1); exit 1; }
21748 }
21749
21750 EOF
21751
21752 cat >>$CONFIG_STATUS <<EOF
21753
21754 #
21755 # CONFIG_FILES section.
21756 #
21757
21758 # No need to generate the scripts if there are no CONFIG_FILES.
21759 # This happens for instance when ./config.status config.h
21760 if test -n "\$CONFIG_FILES"; then
21761   # Protect against being on the right side of a sed subst in config.status.
21762   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
21763    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
21764 s,@SHELL@,$SHELL,;t t
21765 s,@exec_prefix@,$exec_prefix,;t t
21766 s,@prefix@,$prefix,;t t
21767 s,@program_transform_name@,$program_transform_name,;t t
21768 s,@bindir@,$bindir,;t t
21769 s,@sbindir@,$sbindir,;t t
21770 s,@libexecdir@,$libexecdir,;t t
21771 s,@datarootdir@,$datarootdir,;t t
21772 s,@datadir@,$datadir,;t t
21773 s,@sysconfdir@,$sysconfdir,;t t
21774 s,@sharedstatedir@,$sharedstatedir,;t t
21775 s,@localstatedir@,$localstatedir,;t t
21776 s,@runstatedir@,$runstatedir,;t t
21777 s,@libdir@,$libdir,;t t
21778 s,@includedir@,$includedir,;t t
21779 s,@oldincludedir@,$oldincludedir,;t t
21780 s,@infodir@,$infodir,;t t
21781 s,@mandir@,$mandir,;t t
21782 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
21783 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
21784 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
21785 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
21786 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
21787 s,@build_alias@,$build_alias,;t t
21788 s,@host_alias@,$host_alias,;t t
21789 s,@target_alias@,$target_alias,;t t
21790 s,@ECHO_C@,$ECHO_C,;t t
21791 s,@ECHO_N@,$ECHO_N,;t t
21792 s,@ECHO_T@,$ECHO_T,;t t
21793 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
21794 s,@DEFS@,$DEFS,;t t
21795 s,@LIBS@,$LIBS,;t t
21796 s,@build@,$build,;t t
21797 s,@build_cpu@,$build_cpu,;t t
21798 s,@build_vendor@,$build_vendor,;t t
21799 s,@build_os@,$build_os,;t t
21800 s,@host@,$host,;t t
21801 s,@host_cpu@,$host_cpu,;t t
21802 s,@host_vendor@,$host_vendor,;t t
21803 s,@host_os@,$host_os,;t t
21804 s,@SET_MAKE@,$SET_MAKE,;t t
21805 s,@CC@,$CC,;t t
21806 s,@CFLAGS@,$CFLAGS,;t t
21807 s,@LDFLAGS@,$LDFLAGS,;t t
21808 s,@CPPFLAGS@,$CPPFLAGS,;t t
21809 s,@ac_ct_CC@,$ac_ct_CC,;t t
21810 s,@EXEEXT@,$EXEEXT,;t t
21811 s,@OBJEXT@,$OBJEXT,;t t
21812 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
21813 s,@CPP@,$CPP,;t t
21814 s,@AWK@,$AWK,;t t
21815 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
21816 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
21817 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
21818 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
21819 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
21820 s,@LINT@,$LINT,;t t
21821 s,@LINT_OPTS@,$LINT_OPTS,;t t
21822 s,@CTAGS@,$CTAGS,;t t
21823 s,@ETAGS@,$ETAGS,;t t
21824 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
21825 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
21826 s,@MATH_LIB@,$MATH_LIB,;t t
21827 s,@top_builddir@,$top_builddir,;t t
21828 s,@CC_G_OPT@,$CC_G_OPT,;t t
21829 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
21830 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
21831 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
21832 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
21833 s,@LD@,$LD,;t t
21834 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
21835 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
21836 s,@LD_MODEL@,$LD_MODEL,;t t
21837 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
21838 s,@LIBTOOL@,$LIBTOOL,;t t
21839 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
21840 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
21841 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
21842 s,@LIB_LINK@,$LIB_LINK,;t t
21843 s,@LINK_TESTS@,$LINK_TESTS,;t t
21844 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
21845 s,@PACKAGE@,$PACKAGE,;t t
21846 s,@PTHREAD@,$PTHREAD,;t t
21847 s,@TEST_ARGS@,$TEST_ARGS,;t t
21848 s,@TEST_DEPS@,$TEST_DEPS,;t t
21849 s,@TEST_LIBS@,$TEST_LIBS,;t t
21850 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
21851 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
21852 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
21853 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
21854 s,@includesubdir@,$includesubdir,;t t
21855 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
21856 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
21857 s,@ECHO_LT@,$ECHO_LT,;t t
21858 s,@ECHO_LD@,$ECHO_LD,;t t
21859 s,@RULE_CC@,$RULE_CC,;t t
21860 s,@SHOW_CC@,$SHOW_CC,;t t
21861 s,@ECHO_CC@,$ECHO_CC,;t t
21862 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
21863 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
21864 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
21865 s,@X_CFLAGS@,$X_CFLAGS,;t t
21866 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
21867 s,@X_LIBS@,$X_LIBS,;t t
21868 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
21869 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
21870 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
21871 s,@RGB_PATH@,$RGB_PATH,;t t
21872 s,@no_x11_rgb@,$no_x11_rgb,;t t
21873 s,@FORM_NAME@,$FORM_NAME,;t t
21874 s,@MENU_NAME@,$MENU_NAME,;t t
21875 s,@PANEL_NAME@,$PANEL_NAME,;t t
21876 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
21877 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
21878 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
21879 CEOF
21880
21881 EOF
21882
21883   cat >>$CONFIG_STATUS <<\EOF
21884   # Split the substitutions into bite-sized pieces for seds with
21885   # small command number limits, like on Digital OSF/1 and HP-UX.
21886   ac_max_sed_lines=48
21887   ac_sed_frag=1 # Number of current file.
21888   ac_beg=1 # First line for current file.
21889   ac_end=$ac_max_sed_lines # Line after last line for current file.
21890   ac_more_lines=:
21891   ac_sed_cmds=
21892   while $ac_more_lines; do
21893     if test $ac_beg -gt 1; then
21894       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21895     else
21896       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21897     fi
21898     if test ! -s $tmp/subs.frag; then
21899       ac_more_lines=false
21900     else
21901       # The purpose of the label and of the branching condition is to
21902       # speed up the sed processing (if there are no `@' at all, there
21903       # is no need to browse any of the substitutions).
21904       # These are the two extra sed commands mentioned above.
21905       (echo ':t
21906   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
21907       # It is possible to make a multiline substitution using escaped newlines.
21908       # Ensure that we do not split the substitution between script fragments.
21909       ac_BEG=$ac_end
21910       ac_END=`expr $ac_end + $ac_max_sed_lines`
21911       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
21912       if test -s $tmp/subs.next; then
21913         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
21914         if test ! -s $tmp/subs.edit; then
21915           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
21916           if test ! -s $tmp/subs.edit; then
21917             if test $ac_beg -gt 1; then
21918               ac_end=`expr $ac_end - 1`
21919               continue
21920             fi
21921           fi
21922         fi
21923       fi
21924
21925       if test -z "$ac_sed_cmds"; then
21926         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
21927       else
21928         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
21929       fi
21930       ac_sed_frag=`expr $ac_sed_frag + 1`
21931       ac_beg=$ac_end
21932       ac_end=`expr $ac_end + $ac_max_sed_lines`
21933     fi
21934   done
21935   if test -z "$ac_sed_cmds"; then
21936     ac_sed_cmds=cat
21937   fi
21938 fi # test -n "$CONFIG_FILES"
21939
21940 EOF
21941 cat >>$CONFIG_STATUS <<\EOF
21942 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
21943   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21944   case $ac_file in
21945   - | *:- | *:-:* ) # input from stdin
21946         cat >$tmp/stdin
21947         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21948         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21949   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21950         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21951   * )   ac_file_in=$ac_file.in ;;
21952   esac
21953
21954   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
21955   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21956          X"$ac_file" : 'X\(//\)[^/]' \| \
21957          X"$ac_file" : 'X\(//\)$' \| \
21958          X"$ac_file" : 'X\(/\)' \| \
21959          .     : '\(.\)' 2>/dev/null ||
21960 echo X"$ac_file" |
21961     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21962           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21963           /^X\(\/\/\)$/{ s//\1/; q; }
21964           /^X\(\/\).*/{ s//\1/; q; }
21965           s/.*/./; q'`
21966   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21967     { case "$ac_dir" in
21968   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21969   *)                      as_incr_dir=.;;
21970 esac
21971 as_dummy="$ac_dir"
21972 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21973   case $as_mkdir_dir in
21974     # Skip DOS drivespec
21975     ?:) as_incr_dir=$as_mkdir_dir ;;
21976     *)
21977       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21978       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21979     ;;
21980   esac
21981 done; }
21982
21983     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21984     # A "../" for each directory in $ac_dir_suffix.
21985     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21986   else
21987     ac_dir_suffix= ac_dots=
21988   fi
21989
21990   case $srcdir in
21991   .)  ac_srcdir=.
21992       if test -z "$ac_dots"; then
21993          ac_top_srcdir=.
21994       else
21995          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21996       fi ;;
21997   [\\/]* | ?:[\\/]* )
21998       ac_srcdir=$srcdir$ac_dir_suffix;
21999       ac_top_srcdir=$srcdir ;;
22000   *) # Relative path.
22001     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
22002     ac_top_srcdir=$ac_dots$srcdir ;;
22003   esac
22004
22005   case $INSTALL in
22006   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
22007   *) ac_INSTALL=$ac_dots$INSTALL ;;
22008   esac
22009
22010   if test x"$ac_file" != x-; then
22011     { echo "$as_me:22011: creating $ac_file" >&5
22012 echo "$as_me: creating $ac_file" >&6;}
22013     rm -f "$ac_file"
22014   fi
22015   # Let's still pretend it is `configure' which instantiates (i.e., don't
22016   # use $as_me), people would be surprised to read:
22017   #    /* config.h.  Generated automatically by config.status.  */
22018   configure_input="Generated automatically from `echo $ac_file_in |
22019                                                  sed 's,.*/,,'` by configure."
22020
22021   # First look for the input files in the build tree, otherwise in the
22022   # src tree.
22023   ac_file_inputs=`IFS=:
22024     for f in $ac_file_in; do
22025       case $f in
22026       -) echo $tmp/stdin ;;
22027       [\\/$]*)
22028          # Absolute (can't be DOS-style, as IFS=:)
22029          test -f "$f" || { { echo "$as_me:22029: error: cannot find input file: $f" >&5
22030 echo "$as_me: error: cannot find input file: $f" >&2;}
22031    { (exit 1); exit 1; }; }
22032          echo $f;;
22033       *) # Relative
22034          if test -f "$f"; then
22035            # Build tree
22036            echo $f
22037          elif test -f "$srcdir/$f"; then
22038            # Source tree
22039            echo $srcdir/$f
22040          else
22041            # /dev/null tree
22042            { { echo "$as_me:22042: error: cannot find input file: $f" >&5
22043 echo "$as_me: error: cannot find input file: $f" >&2;}
22044    { (exit 1); exit 1; }; }
22045          fi;;
22046       esac
22047     done` || { (exit 1); exit 1; }
22048 EOF
22049 cat >>$CONFIG_STATUS <<\EOF
22050   ac_warn_datarootdir=no
22051   if test x"$ac_file" != x-; then
22052     for ac_item in $ac_file_inputs
22053     do
22054       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
22055       if test -n "$ac_seen"; then
22056         ac_used=`grep '@datarootdir@' $ac_item`
22057         if test -z "$ac_used"; then
22058           { echo "$as_me:22058: WARNING: datarootdir was used implicitly but not set:
22059 $ac_seen" >&5
22060 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
22061 $ac_seen" >&2;}
22062           ac_warn_datarootdir=yes
22063         fi
22064       fi
22065       ac_seen=`grep '${datarootdir}' $ac_item`
22066       if test -n "$ac_seen"; then
22067         { echo "$as_me:22067: WARNING: datarootdir was used explicitly but not set:
22068 $ac_seen" >&5
22069 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
22070 $ac_seen" >&2;}
22071         ac_warn_datarootdir=yes
22072       fi
22073     done
22074   fi
22075
22076 if test "x$ac_warn_datarootdir" = xyes; then
22077   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
22078 fi
22079
22080 EOF
22081 cat >>$CONFIG_STATUS <<EOF
22082   sed "$ac_vpsub
22083 $extrasub
22084 EOF
22085 cat >>$CONFIG_STATUS <<\EOF
22086 :t
22087 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
22088 s,@configure_input@,$configure_input,;t t
22089 s,@srcdir@,$ac_srcdir,;t t
22090 s,@top_srcdir@,$ac_top_srcdir,;t t
22091 s,@INSTALL@,$ac_INSTALL,;t t
22092 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
22093   rm -f $tmp/stdin
22094   if test x"$ac_file" != x-; then
22095     cp $tmp/out $ac_file
22096
22097     for ac_name in prefix exec_prefix datarootdir
22098     do
22099         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
22100         if test -n "$ac_seen"; then
22101             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
22102             if test -z "$ac_init"; then
22103               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
22104               { echo "$as_me:22104: WARNING: Variable $ac_name is used but was not set:
22105 $ac_seen" >&5
22106 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
22107 $ac_seen" >&2;}
22108             fi
22109         fi
22110     done
22111     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
22112     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
22113     if test -s $tmp/out; then
22114       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
22115       { echo "$as_me:22115: WARNING: Some variables may not be substituted:
22116 $ac_seen" >&5
22117 echo "$as_me: WARNING: Some variables may not be substituted:
22118 $ac_seen" >&2;}
22119     fi
22120   else
22121     cat $tmp/out
22122   fi
22123   rm -f $tmp/out
22124
22125 done
22126 EOF
22127 cat >>$CONFIG_STATUS <<\EOF
22128
22129 #
22130 # CONFIG_HEADER section.
22131 #
22132
22133 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
22134 # NAME is the cpp macro being defined and VALUE is the value it is being given.
22135 #
22136 # ac_d sets the value in "#define NAME VALUE" lines.
22137 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
22138 ac_dB='[        ].*$,\1#\2'
22139 ac_dC=' '
22140 ac_dD=',;t'
22141 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
22142 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
22143 ac_iB='\([      ]\),\1#\2define\3'
22144 ac_iC=' '
22145 ac_iD='\4,;t'
22146 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
22147 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
22148 ac_uB='$,\1#\2define\3'
22149 ac_uC=' '
22150 ac_uD=',;t'
22151
22152 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
22153   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
22154   case $ac_file in
22155   - | *:- | *:-:* ) # input from stdin
22156         cat >$tmp/stdin
22157         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
22158         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
22159   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
22160         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
22161   * )   ac_file_in=$ac_file.in ;;
22162   esac
22163
22164   test x"$ac_file" != x- && { echo "$as_me:22164: creating $ac_file" >&5
22165 echo "$as_me: creating $ac_file" >&6;}
22166
22167   # First look for the input files in the build tree, otherwise in the
22168   # src tree.
22169   ac_file_inputs=`IFS=:
22170     for f in $ac_file_in; do
22171       case $f in
22172       -) echo $tmp/stdin ;;
22173       [\\/$]*)
22174          # Absolute (can't be DOS-style, as IFS=:)
22175          test -f "$f" || { { echo "$as_me:22175: error: cannot find input file: $f" >&5
22176 echo "$as_me: error: cannot find input file: $f" >&2;}
22177    { (exit 1); exit 1; }; }
22178          echo $f;;
22179       *) # Relative
22180          if test -f "$f"; then
22181            # Build tree
22182            echo $f
22183          elif test -f "$srcdir/$f"; then
22184            # Source tree
22185            echo $srcdir/$f
22186          else
22187            # /dev/null tree
22188            { { echo "$as_me:22188: error: cannot find input file: $f" >&5
22189 echo "$as_me: error: cannot find input file: $f" >&2;}
22190    { (exit 1); exit 1; }; }
22191          fi;;
22192       esac
22193     done` || { (exit 1); exit 1; }
22194   # Remove the trailing spaces.
22195   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
22196
22197 EOF
22198
22199 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
22200 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
22201 # be either 'cat' or 'sort'.
22202 cat confdefs.h | uniq >conftest.vals
22203
22204 # Break up conftest.vals because some shells have a limit on
22205 # the size of here documents, and old seds have small limits too.
22206
22207 rm -f conftest.tail
22208 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
22209 while grep . conftest.vals >/dev/null
22210 do
22211   # Write chunks of a limited-size here document to conftest.frag.
22212   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
22213   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
22214   echo 'CEOF' >> $CONFIG_STATUS
22215   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
22216   rm -f conftest.vals
22217   mv conftest.tail conftest.vals
22218 done
22219 rm -f conftest.vals
22220
22221 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
22222 # marker @DEFS@.
22223 echo '  cat >> conftest.edit <<CEOF
22224 /@DEFS@/r conftest.frag
22225 /@DEFS@/d
22226 CEOF
22227 sed -f conftest.edit $tmp/in > $tmp/out
22228 rm -f $tmp/in
22229 mv $tmp/out $tmp/in
22230 rm -f conftest.edit conftest.frag
22231 ' >> $CONFIG_STATUS
22232
22233 cat >>$CONFIG_STATUS <<\EOF
22234   # Let's still pretend it is `configure' which instantiates (i.e., don't
22235   # use $as_me), people would be surprised to read:
22236   #    /* config.h.  Generated automatically by config.status.  */
22237   if test x"$ac_file" = x-; then
22238     echo "/* Generated automatically by configure.  */" >$tmp/config.h
22239   else
22240     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
22241   fi
22242   cat $tmp/in >>$tmp/config.h
22243   rm -f $tmp/in
22244   if test x"$ac_file" != x-; then
22245     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
22246       { echo "$as_me:22246: $ac_file is unchanged" >&5
22247 echo "$as_me: $ac_file is unchanged" >&6;}
22248     else
22249       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
22250          X"$ac_file" : 'X\(//\)[^/]' \| \
22251          X"$ac_file" : 'X\(//\)$' \| \
22252          X"$ac_file" : 'X\(/\)' \| \
22253          .     : '\(.\)' 2>/dev/null ||
22254 echo X"$ac_file" |
22255     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
22256           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
22257           /^X\(\/\/\)$/{ s//\1/; q; }
22258           /^X\(\/\).*/{ s//\1/; q; }
22259           s/.*/./; q'`
22260       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
22261         { case "$ac_dir" in
22262   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
22263   *)                      as_incr_dir=.;;
22264 esac
22265 as_dummy="$ac_dir"
22266 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
22267   case $as_mkdir_dir in
22268     # Skip DOS drivespec
22269     ?:) as_incr_dir=$as_mkdir_dir ;;
22270     *)
22271       as_incr_dir=$as_incr_dir/$as_mkdir_dir
22272       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
22273     ;;
22274   esac
22275 done; }
22276
22277       fi
22278       rm -f $ac_file
22279       mv $tmp/config.h $ac_file
22280     fi
22281   else
22282     cat $tmp/config.h
22283     rm -f $tmp/config.h
22284   fi
22285 done
22286 EOF
22287 cat >>$CONFIG_STATUS <<\EOF
22288 #
22289 # CONFIG_COMMANDS section.
22290 #
22291 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
22292   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
22293   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
22294
22295   case $ac_dest in
22296     default )
22297
22298 for cf_dir in .
22299 do
22300         if test ! -d $srcdir/$cf_dir; then
22301                 continue
22302         elif test -f $srcdir/$cf_dir/programs; then
22303                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
22304         fi
22305 done
22306
22307         cat >>Makefile <<TEST_EOF
22308
22309 # These rules are generated so we do not rely on suffix rules, which do not
22310 # work consistently for different make-programs (the '\$(MODEL)/' confuses
22311 # some, and the '\$x' confuses others).
22312 TEST_EOF
22313
22314 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
22315 for N in $LIST
22316 do
22317         cat >>Makefile <<TEST_EOF
22318
22319 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
22320         \$(srcdir)/test.priv.h \\
22321         ncurses_cfg.h
22322         $SHOW_CC
22323         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
22324 TEST_EOF
22325 done
22326
22327 if test -f ../config.guess && test -f ../config.sub
22328 then
22329         cat >>Makefile <<TEST_EOF
22330
22331 # if we used CF_INHERIT for getting these files, we can remove them
22332 distclean::
22333         rm -f config.guess config.sub
22334 TEST_EOF
22335 fi
22336  ;;
22337   esac
22338 done
22339 EOF
22340
22341 cat >>$CONFIG_STATUS <<\EOF
22342
22343 { (exit 0); exit 0; }
22344 EOF
22345 chmod +x $CONFIG_STATUS
22346 ac_clean_files=$ac_clean_files_save
22347
22348 # configure is writing to config.log, and then calls config.status.
22349 # config.status does its own redirection, appending to config.log.
22350 # Unfortunately, on DOS this fails, as config.log is still kept open
22351 # by configure, so config.status won't be able to write to it; its
22352 # output is simply discarded.  So we exec the FD to /dev/null,
22353 # effectively closing config.log, so it can be properly (re)opened and
22354 # appended to by config.status.  When coming back to configure, we
22355 # need to make the FD available again.
22356 if test "$no_create" != yes; then
22357   ac_cs_success=:
22358   exec 5>/dev/null
22359   $SHELL $CONFIG_STATUS || ac_cs_success=false
22360   exec 5>>config.log
22361   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
22362   # would make configure fail if this is the last instruction.
22363   $ac_cs_success || { (exit 1); exit 1; }
22364 fi
22365