]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
f95bd28ab745d1269c74d267a09858221f7cba18
[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   --disable-panel         disable checks for panel functions
690   --disable-menu          disable checks for menu functions
691   --disable-form          disable checks for form functions
692 Testing/development Options:
693   --enable-warnings       test: turn on gcc compiler warnings
694   --with-dmalloc          test: use Gray Watson's dmalloc library
695   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
696   --with-valgrind         test: use valgrind
697   --disable-leaks         test: free permanent memory, analyze leaks
698   --disable-rpath-hack    don't add rpath options for additional libraries
699
700 Some influential environment variables:
701   CC          C compiler command
702   CFLAGS      C compiler flags
703   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
704               nonstandard directory <lib dir>
705   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
706               headers in a nonstandard directory <include dir>
707   CPP         C preprocessor
708
709 Use these variables to override the choices made by `configure' or to help
710 it to find libraries and programs with nonstandard names/locations.
711
712 EOF
713 fi
714
715 if test "$ac_init_help" = "recursive"; then
716   # If there are subdirs, report their specific --help.
717   ac_popdir=`pwd`
718   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
719     cd $ac_subdir
720     # A "../" for each directory in /$ac_subdir.
721     ac_dots=`echo $ac_subdir |
722              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
723
724     case $srcdir in
725     .) # No --srcdir option.  We are building in place.
726       ac_sub_srcdir=$srcdir ;;
727     [\\/]* | ?:[\\/]* ) # Absolute path.
728       ac_sub_srcdir=$srcdir/$ac_subdir ;;
729     *) # Relative path.
730       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
731     esac
732
733     # Check for guested configure; otherwise get Cygnus style configure.
734     if test -f $ac_sub_srcdir/configure.gnu; then
735       echo
736       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
737     elif test -f $ac_sub_srcdir/configure; then
738       echo
739       $SHELL $ac_sub_srcdir/configure  --help=recursive
740     elif test -f $ac_sub_srcdir/configure.ac ||
741            test -f $ac_sub_srcdir/configure.in; then
742       echo
743       $ac_configure --help
744     else
745       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
746     fi
747     cd $ac_popdir
748   done
749 fi
750
751 test -n "$ac_init_help" && exit 0
752 if $ac_init_version; then
753   cat <<\EOF
754
755 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
756 Free Software Foundation, Inc.
757 This configure script is free software; the Free Software Foundation
758 gives unlimited permission to copy, distribute and modify it.
759 EOF
760   exit 0
761 fi
762 exec 5>config.log
763 cat >&5 <<EOF
764 This file contains any messages produced by compilers while
765 running configure, to aid debugging if configure makes a mistake.
766
767 It was created by $as_me, which was
768 generated by GNU Autoconf 2.52.20200111.  Invocation command line was
769
770   $ $0 $@
771
772 EOF
773 {
774 cat <<_ASUNAME
775 ## ---------- ##
776 ## Platform.  ##
777 ## ---------- ##
778
779 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
780 uname -m = `(uname -m) 2>/dev/null || echo unknown`
781 uname -r = `(uname -r) 2>/dev/null || echo unknown`
782 uname -s = `(uname -s) 2>/dev/null || echo unknown`
783 uname -v = `(uname -v) 2>/dev/null || echo unknown`
784
785 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
786 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
787
788 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
789 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
790 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
791 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
792 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
793 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
794 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
795
796 PATH = $PATH
797
798 _ASUNAME
799 } >&5
800
801 cat >&5 <<EOF
802 ## ------------ ##
803 ## Core tests.  ##
804 ## ------------ ##
805
806 EOF
807
808 # Keep a trace of the command line.
809 # Strip out --no-create and --no-recursion so they do not pile up.
810 # Also quote any args containing shell meta-characters.
811 ac_configure_args=
812 ac_sep=
813 for ac_arg
814 do
815   case $ac_arg in
816   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
817   | --no-cr | --no-c) ;;
818   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
819   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
820   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
821     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
822     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
823     ac_sep=" " ;;
824   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
825      ac_sep=" " ;;
826   esac
827   # Get rid of the leading space.
828 done
829
830 # When interrupted or exit'd, cleanup temporary files, and complete
831 # config.log.  We remove comments because anyway the quotes in there
832 # would cause problems or look ugly.
833 trap 'exit_status=$?
834   # Save into config.log some information that might help in debugging.
835   echo >&5
836   echo "## ----------------- ##" >&5
837   echo "## Cache variables.  ##" >&5
838   echo "## ----------------- ##" >&5
839   echo >&5
840   # The following way of writing the cache mishandles newlines in values,
841 {
842   (set) 2>&1 |
843     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
844     *ac_space=\ *)
845       sed -n \
846         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
847           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
848       ;;
849     *)
850       sed -n \
851         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
852       ;;
853     esac;
854 } >&5
855   sed "/^$/d" confdefs.h >conftest.log
856   if test -s conftest.log; then
857     echo >&5
858     echo "## ------------ ##" >&5
859     echo "## confdefs.h.  ##" >&5
860     echo "## ------------ ##" >&5
861     echo >&5
862     cat conftest.log >&5
863   fi
864   (echo; echo) >&5
865   test "$ac_signal" != 0 &&
866     echo "$as_me: caught signal $ac_signal" >&5
867   echo "$as_me: exit $exit_status" >&5
868   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
869     exit $exit_status
870      ' 0
871 for ac_signal in 1 2 13 15; do
872   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
873 done
874 ac_signal=0
875
876 # confdefs.h avoids OS command line length limits that DEFS can exceed.
877 rm -rf conftest* confdefs.h
878 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
879 echo >confdefs.h
880
881 # Let the site file select an alternate cache file if it wants to.
882 # Prefer explicitly selected file to automatically selected ones.
883 if test -z "$CONFIG_SITE"; then
884   if test "x$prefix" != xNONE; then
885     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
886   else
887     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
888   fi
889 fi
890 for ac_site_file in $CONFIG_SITE; do
891   if test -r "$ac_site_file"; then
892     { echo "$as_me:892: loading site script $ac_site_file" >&5
893 echo "$as_me: loading site script $ac_site_file" >&6;}
894     cat "$ac_site_file" >&5
895     . "$ac_site_file"
896   fi
897 done
898
899 if test -r "$cache_file"; then
900   # Some versions of bash will fail to source /dev/null (special
901   # files actually), so we avoid doing that.
902   if test -f "$cache_file"; then
903     { echo "$as_me:903: loading cache $cache_file" >&5
904 echo "$as_me: loading cache $cache_file" >&6;}
905     case $cache_file in
906       [\\/]* | ?:[\\/]* ) . $cache_file;;
907       *)                      . ./$cache_file;;
908     esac
909   fi
910 else
911   { echo "$as_me:911: creating cache $cache_file" >&5
912 echo "$as_me: creating cache $cache_file" >&6;}
913   >$cache_file
914 fi
915
916 # Check that the precious variables saved in the cache have kept the same
917 # value.
918 ac_cache_corrupted=false
919 for ac_var in `(set) 2>&1 |
920                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
921   eval ac_old_set=\$ac_cv_env_${ac_var}_set
922   eval ac_new_set=\$ac_env_${ac_var}_set
923   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
924   eval ac_new_val="\$ac_env_${ac_var}_value"
925   case $ac_old_set,$ac_new_set in
926     set,)
927       { echo "$as_me:927: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
928 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
929       ac_cache_corrupted=: ;;
930     ,set)
931       { echo "$as_me:931: error: \`$ac_var' was not set in the previous run" >&5
932 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
933       ac_cache_corrupted=: ;;
934     ,);;
935     *)
936       if test "x$ac_old_val" != "x$ac_new_val"; then
937         { echo "$as_me:937: error: \`$ac_var' has changed since the previous run:" >&5
938 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
939         { echo "$as_me:939:   former value:  $ac_old_val" >&5
940 echo "$as_me:   former value:  $ac_old_val" >&2;}
941         { echo "$as_me:941:   current value: $ac_new_val" >&5
942 echo "$as_me:   current value: $ac_new_val" >&2;}
943         ac_cache_corrupted=:
944       fi;;
945   esac
946   # Pass precious variables to config.status.  It doesn't matter if
947   # we pass some twice (in addition to the command line arguments).
948   if test "$ac_new_set" = set; then
949     case $ac_new_val in
950     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
951       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
952       ac_configure_args="$ac_configure_args '$ac_arg'"
953       ;;
954     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
955        ;;
956     esac
957   fi
958 done
959 if $ac_cache_corrupted; then
960   { echo "$as_me:960: error: changes in the environment can compromise the build" >&5
961 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
962   { { echo "$as_me:962: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
963 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
964    { (exit 1); exit 1; }; }
965 fi
966
967 ac_ext=c
968 ac_cpp='$CPP $CPPFLAGS'
969 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
970 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
971 ac_compiler_gnu=$ac_cv_c_compiler_gnu
972 ac_main_return=return
973
974 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
975   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
976                    ECHO_T='     ' ;;
977   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
978   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
979 esac
980 echo "#! $SHELL" >conftest.sh
981 echo  "exit 0"   >>conftest.sh
982 chmod +x conftest.sh
983 if { (echo "$as_me:983: PATH=\".;.\"; conftest.sh") >&5
984   (PATH=".;."; conftest.sh) 2>&5
985   ac_status=$?
986   echo "$as_me:986: \$? = $ac_status" >&5
987   (exit $ac_status); }; then
988   ac_path_separator=';'
989 else
990   ac_path_separator=:
991 fi
992 PATH_SEPARATOR="$ac_path_separator"
993 rm -f conftest.sh
994
995 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
996
997 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
998
999 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1000
1001 ac_aux_dir=
1002 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1003   if test -f $ac_dir/install-sh; then
1004     ac_aux_dir=$ac_dir
1005     ac_install_sh="$ac_aux_dir/install-sh -c"
1006     break
1007   elif test -f $ac_dir/install.sh; then
1008     ac_aux_dir=$ac_dir
1009     ac_install_sh="$ac_aux_dir/install.sh -c"
1010     break
1011   elif test -f $ac_dir/shtool; then
1012     ac_aux_dir=$ac_dir
1013     ac_install_sh="$ac_aux_dir/shtool install -c"
1014     break
1015   fi
1016 done
1017 if test -z "$ac_aux_dir"; then
1018   { { echo "$as_me:1018: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1019 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1020    { (exit 1); exit 1; }; }
1021 fi
1022 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1023 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1024 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1025
1026 # Make sure we can run config.sub.
1027 $ac_config_sub sun4 >/dev/null 2>&1 ||
1028   { { echo "$as_me:1028: error: cannot run $ac_config_sub" >&5
1029 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 echo "$as_me:1032: checking build system type" >&5
1033 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1034 if test "${ac_cv_build+set}" = set; then
1035   echo $ECHO_N "(cached) $ECHO_C" >&6
1036 else
1037   ac_cv_build_alias=$build_alias
1038 test -z "$ac_cv_build_alias" &&
1039   ac_cv_build_alias=`$ac_config_guess`
1040 test -z "$ac_cv_build_alias" &&
1041   { { echo "$as_me:1041: error: cannot guess build type; you must specify one" >&5
1042 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1043    { (exit 1); exit 1; }; }
1044 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1045   { { echo "$as_me:1045: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1046 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1047    { (exit 1); exit 1; }; }
1048
1049 fi
1050 echo "$as_me:1050: result: $ac_cv_build" >&5
1051 echo "${ECHO_T}$ac_cv_build" >&6
1052 build=$ac_cv_build
1053 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1054 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1055 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1056
1057 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1058         echo "$as_me:1058: checking host system type" >&5
1059 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1060 if test "${ac_cv_host+set}" = set; then
1061   echo $ECHO_N "(cached) $ECHO_C" >&6
1062 else
1063   ac_cv_host_alias=$host_alias
1064 test -z "$ac_cv_host_alias" &&
1065   ac_cv_host_alias=$ac_cv_build_alias
1066 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1067   { { echo "$as_me:1067: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1068 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 fi
1072 echo "$as_me:1072: result: $ac_cv_host" >&5
1073 echo "${ECHO_T}$ac_cv_host" >&6
1074 host=$ac_cv_host
1075 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1076 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1077 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1078
1079         system_name="$host_os"
1080 else
1081         system_name="`(uname -s -r) 2>/dev/null`"
1082         if test -z "$system_name" ; then
1083                 system_name="`(hostname) 2>/dev/null`"
1084         fi
1085 fi
1086 test -n "$system_name" &&
1087 cat >>confdefs.h <<EOF
1088 #define SYSTEM_NAME "$system_name"
1089 EOF
1090
1091 if test "${cf_cv_system_name+set}" = set; then
1092   echo $ECHO_N "(cached) $ECHO_C" >&6
1093 else
1094   cf_cv_system_name="$system_name"
1095 fi
1096
1097 test -z "$system_name" && system_name="$cf_cv_system_name"
1098 test -n "$cf_cv_system_name" && echo "$as_me:1098: result: Configuring for $cf_cv_system_name" >&5
1099 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1100
1101 if test ".$system_name" != ".$cf_cv_system_name" ; then
1102         echo "$as_me:1102: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1103 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1104         { { echo "$as_me:1104: error: \"Please remove config.cache and try again.\"" >&5
1105 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1106    { (exit 1); exit 1; }; }
1107 fi
1108
1109 test "$program_prefix" != NONE &&
1110   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1111 # Use a double $ so make ignores it.
1112 test "$program_suffix" != NONE &&
1113   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1114 # Double any \ or $.  echo might interpret backslashes.
1115 # By default was `s,x,x', remove it if useless.
1116 cat <<\_ACEOF >conftest.sed
1117 s/[\\$]/&&/g;s/;s,x,x,$//
1118 _ACEOF
1119 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1120 rm conftest.sed
1121
1122 echo "$as_me:1122: checking whether ${MAKE-make} sets \${MAKE}" >&5
1123 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1124 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1125 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1126   echo $ECHO_N "(cached) $ECHO_C" >&6
1127 else
1128   cat >conftest.make <<\EOF
1129 all:
1130         @echo 'ac_maketemp="${MAKE}"'
1131 EOF
1132 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1133 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1134 if test -n "$ac_maketemp"; then
1135   eval ac_cv_prog_make_${ac_make}_set=yes
1136 else
1137   eval ac_cv_prog_make_${ac_make}_set=no
1138 fi
1139 rm -f conftest.make
1140 fi
1141 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1142   echo "$as_me:1142: result: yes" >&5
1143 echo "${ECHO_T}yes" >&6
1144   SET_MAKE=
1145 else
1146   echo "$as_me:1146: result: no" >&5
1147 echo "${ECHO_T}no" >&6
1148   SET_MAKE="MAKE=${MAKE-make}"
1149 fi
1150
1151 ac_ext=c
1152 ac_cpp='$CPP $CPPFLAGS'
1153 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1154 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1155 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1156 ac_main_return=return
1157 if test -n "$ac_tool_prefix"; then
1158   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1159 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1160 echo "$as_me:1160: checking for $ac_word" >&5
1161 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1162 if test "${ac_cv_prog_CC+set}" = set; then
1163   echo $ECHO_N "(cached) $ECHO_C" >&6
1164 else
1165   if test -n "$CC"; then
1166   ac_cv_prog_CC="$CC" # Let the user override the test.
1167 else
1168   ac_save_IFS=$IFS; IFS=$ac_path_separator
1169 ac_dummy="$PATH"
1170 for ac_dir in $ac_dummy; do
1171   IFS=$ac_save_IFS
1172   test -z "$ac_dir" && ac_dir=.
1173   $as_executable_p "$ac_dir/$ac_word" || continue
1174 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1175 echo "$as_me:1175: found $ac_dir/$ac_word" >&5
1176 break
1177 done
1178
1179 fi
1180 fi
1181 CC=$ac_cv_prog_CC
1182 if test -n "$CC"; then
1183   echo "$as_me:1183: result: $CC" >&5
1184 echo "${ECHO_T}$CC" >&6
1185 else
1186   echo "$as_me:1186: result: no" >&5
1187 echo "${ECHO_T}no" >&6
1188 fi
1189
1190 fi
1191 if test -z "$ac_cv_prog_CC"; then
1192   ac_ct_CC=$CC
1193   # Extract the first word of "gcc", so it can be a program name with args.
1194 set dummy gcc; ac_word=$2
1195 echo "$as_me:1195: checking for $ac_word" >&5
1196 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1197 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1198   echo $ECHO_N "(cached) $ECHO_C" >&6
1199 else
1200   if test -n "$ac_ct_CC"; then
1201   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1202 else
1203   ac_save_IFS=$IFS; IFS=$ac_path_separator
1204 ac_dummy="$PATH"
1205 for ac_dir in $ac_dummy; do
1206   IFS=$ac_save_IFS
1207   test -z "$ac_dir" && ac_dir=.
1208   $as_executable_p "$ac_dir/$ac_word" || continue
1209 ac_cv_prog_ac_ct_CC="gcc"
1210 echo "$as_me:1210: found $ac_dir/$ac_word" >&5
1211 break
1212 done
1213
1214 fi
1215 fi
1216 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1217 if test -n "$ac_ct_CC"; then
1218   echo "$as_me:1218: result: $ac_ct_CC" >&5
1219 echo "${ECHO_T}$ac_ct_CC" >&6
1220 else
1221   echo "$as_me:1221: result: no" >&5
1222 echo "${ECHO_T}no" >&6
1223 fi
1224
1225   CC=$ac_ct_CC
1226 else
1227   CC="$ac_cv_prog_CC"
1228 fi
1229
1230 if test -z "$CC"; then
1231   if test -n "$ac_tool_prefix"; then
1232   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1233 set dummy ${ac_tool_prefix}cc; ac_word=$2
1234 echo "$as_me:1234: checking for $ac_word" >&5
1235 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1236 if test "${ac_cv_prog_CC+set}" = set; then
1237   echo $ECHO_N "(cached) $ECHO_C" >&6
1238 else
1239   if test -n "$CC"; then
1240   ac_cv_prog_CC="$CC" # Let the user override the test.
1241 else
1242   ac_save_IFS=$IFS; IFS=$ac_path_separator
1243 ac_dummy="$PATH"
1244 for ac_dir in $ac_dummy; do
1245   IFS=$ac_save_IFS
1246   test -z "$ac_dir" && ac_dir=.
1247   $as_executable_p "$ac_dir/$ac_word" || continue
1248 ac_cv_prog_CC="${ac_tool_prefix}cc"
1249 echo "$as_me:1249: found $ac_dir/$ac_word" >&5
1250 break
1251 done
1252
1253 fi
1254 fi
1255 CC=$ac_cv_prog_CC
1256 if test -n "$CC"; then
1257   echo "$as_me:1257: result: $CC" >&5
1258 echo "${ECHO_T}$CC" >&6
1259 else
1260   echo "$as_me:1260: result: no" >&5
1261 echo "${ECHO_T}no" >&6
1262 fi
1263
1264 fi
1265 if test -z "$ac_cv_prog_CC"; then
1266   ac_ct_CC=$CC
1267   # Extract the first word of "cc", so it can be a program name with args.
1268 set dummy cc; ac_word=$2
1269 echo "$as_me:1269: checking for $ac_word" >&5
1270 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1271 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1272   echo $ECHO_N "(cached) $ECHO_C" >&6
1273 else
1274   if test -n "$ac_ct_CC"; then
1275   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1276 else
1277   ac_save_IFS=$IFS; IFS=$ac_path_separator
1278 ac_dummy="$PATH"
1279 for ac_dir in $ac_dummy; do
1280   IFS=$ac_save_IFS
1281   test -z "$ac_dir" && ac_dir=.
1282   $as_executable_p "$ac_dir/$ac_word" || continue
1283 ac_cv_prog_ac_ct_CC="cc"
1284 echo "$as_me:1284: found $ac_dir/$ac_word" >&5
1285 break
1286 done
1287
1288 fi
1289 fi
1290 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1291 if test -n "$ac_ct_CC"; then
1292   echo "$as_me:1292: result: $ac_ct_CC" >&5
1293 echo "${ECHO_T}$ac_ct_CC" >&6
1294 else
1295   echo "$as_me:1295: result: no" >&5
1296 echo "${ECHO_T}no" >&6
1297 fi
1298
1299   CC=$ac_ct_CC
1300 else
1301   CC="$ac_cv_prog_CC"
1302 fi
1303
1304 fi
1305 if test -z "$CC"; then
1306   # Extract the first word of "cc", so it can be a program name with args.
1307 set dummy cc; ac_word=$2
1308 echo "$as_me:1308: checking for $ac_word" >&5
1309 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1310 if test "${ac_cv_prog_CC+set}" = set; then
1311   echo $ECHO_N "(cached) $ECHO_C" >&6
1312 else
1313   if test -n "$CC"; then
1314   ac_cv_prog_CC="$CC" # Let the user override the test.
1315 else
1316   ac_prog_rejected=no
1317   ac_save_IFS=$IFS; IFS=$ac_path_separator
1318 ac_dummy="$PATH"
1319 for ac_dir in $ac_dummy; do
1320   IFS=$ac_save_IFS
1321   test -z "$ac_dir" && ac_dir=.
1322   $as_executable_p "$ac_dir/$ac_word" || continue
1323 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1324   ac_prog_rejected=yes
1325   continue
1326 fi
1327 ac_cv_prog_CC="cc"
1328 echo "$as_me:1328: found $ac_dir/$ac_word" >&5
1329 break
1330 done
1331
1332 if test $ac_prog_rejected = yes; then
1333   # We found a bogon in the path, so make sure we never use it.
1334   set dummy $ac_cv_prog_CC
1335   shift
1336   if test $# != 0; then
1337     # We chose a different compiler from the bogus one.
1338     # However, it has the same basename, so the bogon will be chosen
1339     # first if we set CC to just the basename; use the full file name.
1340     shift
1341     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1342     shift
1343     ac_cv_prog_CC="$@"
1344   fi
1345 fi
1346 fi
1347 fi
1348 CC=$ac_cv_prog_CC
1349 if test -n "$CC"; then
1350   echo "$as_me:1350: result: $CC" >&5
1351 echo "${ECHO_T}$CC" >&6
1352 else
1353   echo "$as_me:1353: result: no" >&5
1354 echo "${ECHO_T}no" >&6
1355 fi
1356
1357 fi
1358 if test -z "$CC"; then
1359   if test -n "$ac_tool_prefix"; then
1360   for ac_prog in cl
1361   do
1362     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1363 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1364 echo "$as_me:1364: checking for $ac_word" >&5
1365 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1366 if test "${ac_cv_prog_CC+set}" = set; then
1367   echo $ECHO_N "(cached) $ECHO_C" >&6
1368 else
1369   if test -n "$CC"; then
1370   ac_cv_prog_CC="$CC" # Let the user override the test.
1371 else
1372   ac_save_IFS=$IFS; IFS=$ac_path_separator
1373 ac_dummy="$PATH"
1374 for ac_dir in $ac_dummy; do
1375   IFS=$ac_save_IFS
1376   test -z "$ac_dir" && ac_dir=.
1377   $as_executable_p "$ac_dir/$ac_word" || continue
1378 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1379 echo "$as_me:1379: found $ac_dir/$ac_word" >&5
1380 break
1381 done
1382
1383 fi
1384 fi
1385 CC=$ac_cv_prog_CC
1386 if test -n "$CC"; then
1387   echo "$as_me:1387: result: $CC" >&5
1388 echo "${ECHO_T}$CC" >&6
1389 else
1390   echo "$as_me:1390: result: no" >&5
1391 echo "${ECHO_T}no" >&6
1392 fi
1393
1394     test -n "$CC" && break
1395   done
1396 fi
1397 if test -z "$CC"; then
1398   ac_ct_CC=$CC
1399   for ac_prog in cl
1400 do
1401   # Extract the first word of "$ac_prog", so it can be a program name with args.
1402 set dummy $ac_prog; ac_word=$2
1403 echo "$as_me:1403: checking for $ac_word" >&5
1404 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1405 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1406   echo $ECHO_N "(cached) $ECHO_C" >&6
1407 else
1408   if test -n "$ac_ct_CC"; then
1409   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1410 else
1411   ac_save_IFS=$IFS; IFS=$ac_path_separator
1412 ac_dummy="$PATH"
1413 for ac_dir in $ac_dummy; do
1414   IFS=$ac_save_IFS
1415   test -z "$ac_dir" && ac_dir=.
1416   $as_executable_p "$ac_dir/$ac_word" || continue
1417 ac_cv_prog_ac_ct_CC="$ac_prog"
1418 echo "$as_me:1418: found $ac_dir/$ac_word" >&5
1419 break
1420 done
1421
1422 fi
1423 fi
1424 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1425 if test -n "$ac_ct_CC"; then
1426   echo "$as_me:1426: result: $ac_ct_CC" >&5
1427 echo "${ECHO_T}$ac_ct_CC" >&6
1428 else
1429   echo "$as_me:1429: result: no" >&5
1430 echo "${ECHO_T}no" >&6
1431 fi
1432
1433   test -n "$ac_ct_CC" && break
1434 done
1435
1436   CC=$ac_ct_CC
1437 fi
1438
1439 fi
1440
1441 test -z "$CC" && { { echo "$as_me:1441: error: no acceptable cc found in \$PATH" >&5
1442 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1443    { (exit 1); exit 1; }; }
1444
1445 # Provide some information about the compiler.
1446 echo "$as_me:1446:" \
1447      "checking for C compiler version" >&5
1448 ac_compiler=`set X $ac_compile; echo $2`
1449 { (eval echo "$as_me:1449: \"$ac_compiler --version </dev/null >&5\"") >&5
1450   (eval $ac_compiler --version </dev/null >&5) 2>&5
1451   ac_status=$?
1452   echo "$as_me:1452: \$? = $ac_status" >&5
1453   (exit $ac_status); }
1454 { (eval echo "$as_me:1454: \"$ac_compiler -v </dev/null >&5\"") >&5
1455   (eval $ac_compiler -v </dev/null >&5) 2>&5
1456   ac_status=$?
1457   echo "$as_me:1457: \$? = $ac_status" >&5
1458   (exit $ac_status); }
1459 { (eval echo "$as_me:1459: \"$ac_compiler -V </dev/null >&5\"") >&5
1460   (eval $ac_compiler -V </dev/null >&5) 2>&5
1461   ac_status=$?
1462   echo "$as_me:1462: \$? = $ac_status" >&5
1463   (exit $ac_status); }
1464
1465 cat >conftest.$ac_ext <<_ACEOF
1466 #line 1466 "configure"
1467 #include "confdefs.h"
1468
1469 int
1470 main (void)
1471 {
1472
1473   ;
1474   return 0;
1475 }
1476 _ACEOF
1477 ac_clean_files_save=$ac_clean_files
1478 ac_clean_files="$ac_clean_files a.out a.exe"
1479 # Try to create an executable without -o first, disregard a.out.
1480 # It will help us diagnose broken compilers, and finding out an intuition
1481 # of exeext.
1482 echo "$as_me:1482: checking for C compiler default output" >&5
1483 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1484 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1485 if { (eval echo "$as_me:1485: \"$ac_link_default\"") >&5
1486   (eval $ac_link_default) 2>&5
1487   ac_status=$?
1488   echo "$as_me:1488: \$? = $ac_status" >&5
1489   (exit $ac_status); }; then
1490   # Find the output, starting from the most likely.  This scheme is
1491 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1492 # resort.
1493 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1494                 ls a.out conftest 2>/dev/null;
1495                 ls a.* conftest.* 2>/dev/null`; do
1496   case $ac_file in
1497     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1498     a.out ) # We found the default executable, but exeext='' is most
1499             # certainly right.
1500             break;;
1501     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1502           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1503           export ac_cv_exeext
1504           break;;
1505     * ) break;;
1506   esac
1507 done
1508 else
1509   echo "$as_me: failed program was:" >&5
1510 cat conftest.$ac_ext >&5
1511 { { echo "$as_me:1511: error: C compiler cannot create executables" >&5
1512 echo "$as_me: error: C compiler cannot create executables" >&2;}
1513    { (exit 77); exit 77; }; }
1514 fi
1515
1516 ac_exeext=$ac_cv_exeext
1517 echo "$as_me:1517: result: $ac_file" >&5
1518 echo "${ECHO_T}$ac_file" >&6
1519
1520 # Check the compiler produces executables we can run.  If not, either
1521 # the compiler is broken, or we cross compile.
1522 echo "$as_me:1522: checking whether the C compiler works" >&5
1523 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1524 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1525 # If not cross compiling, check that we can run a simple program.
1526 if test "$cross_compiling" != yes; then
1527   if { ac_try='./$ac_file'
1528   { (eval echo "$as_me:1528: \"$ac_try\"") >&5
1529   (eval $ac_try) 2>&5
1530   ac_status=$?
1531   echo "$as_me:1531: \$? = $ac_status" >&5
1532   (exit $ac_status); }; }; then
1533     cross_compiling=no
1534   else
1535     if test "$cross_compiling" = maybe; then
1536         cross_compiling=yes
1537     else
1538         { { echo "$as_me:1538: error: cannot run C compiled programs.
1539 If you meant to cross compile, use \`--host'." >&5
1540 echo "$as_me: error: cannot run C compiled programs.
1541 If you meant to cross compile, use \`--host'." >&2;}
1542    { (exit 1); exit 1; }; }
1543     fi
1544   fi
1545 fi
1546 echo "$as_me:1546: result: yes" >&5
1547 echo "${ECHO_T}yes" >&6
1548
1549 rm -f a.out a.exe conftest$ac_cv_exeext
1550 ac_clean_files=$ac_clean_files_save
1551 # Check the compiler produces executables we can run.  If not, either
1552 # the compiler is broken, or we cross compile.
1553 echo "$as_me:1553: checking whether we are cross compiling" >&5
1554 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1555 echo "$as_me:1555: result: $cross_compiling" >&5
1556 echo "${ECHO_T}$cross_compiling" >&6
1557
1558 echo "$as_me:1558: checking for executable suffix" >&5
1559 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1560 if { (eval echo "$as_me:1560: \"$ac_link\"") >&5
1561   (eval $ac_link) 2>&5
1562   ac_status=$?
1563   echo "$as_me:1563: \$? = $ac_status" >&5
1564   (exit $ac_status); }; then
1565   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1566 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1567 # work properly (i.e., refer to `conftest.exe'), while it won't with
1568 # `rm'.
1569 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1570   case $ac_file in
1571     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1572     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1573           export ac_cv_exeext
1574           break;;
1575     * ) break;;
1576   esac
1577 done
1578 else
1579   { { echo "$as_me:1579: error: cannot compute EXEEXT: cannot compile and link" >&5
1580 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1581    { (exit 1); exit 1; }; }
1582 fi
1583
1584 rm -f conftest$ac_cv_exeext
1585 echo "$as_me:1585: result: $ac_cv_exeext" >&5
1586 echo "${ECHO_T}$ac_cv_exeext" >&6
1587
1588 rm -f conftest.$ac_ext
1589 EXEEXT=$ac_cv_exeext
1590 ac_exeext=$EXEEXT
1591 echo "$as_me:1591: checking for object suffix" >&5
1592 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1593 if test "${ac_cv_objext+set}" = set; then
1594   echo $ECHO_N "(cached) $ECHO_C" >&6
1595 else
1596   cat >conftest.$ac_ext <<_ACEOF
1597 #line 1597 "configure"
1598 #include "confdefs.h"
1599
1600 int
1601 main (void)
1602 {
1603
1604   ;
1605   return 0;
1606 }
1607 _ACEOF
1608 rm -f conftest.o conftest.obj
1609 if { (eval echo "$as_me:1609: \"$ac_compile\"") >&5
1610   (eval $ac_compile) 2>&5
1611   ac_status=$?
1612   echo "$as_me:1612: \$? = $ac_status" >&5
1613   (exit $ac_status); }; then
1614   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1615   case $ac_file in
1616     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1617     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1618        break;;
1619   esac
1620 done
1621 else
1622   echo "$as_me: failed program was:" >&5
1623 cat conftest.$ac_ext >&5
1624 { { echo "$as_me:1624: error: cannot compute OBJEXT: cannot compile" >&5
1625 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1626    { (exit 1); exit 1; }; }
1627 fi
1628
1629 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1630 fi
1631 echo "$as_me:1631: result: $ac_cv_objext" >&5
1632 echo "${ECHO_T}$ac_cv_objext" >&6
1633 OBJEXT=$ac_cv_objext
1634 ac_objext=$OBJEXT
1635 echo "$as_me:1635: checking whether we are using the GNU C compiler" >&5
1636 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1637 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1638   echo $ECHO_N "(cached) $ECHO_C" >&6
1639 else
1640   cat >conftest.$ac_ext <<_ACEOF
1641 #line 1641 "configure"
1642 #include "confdefs.h"
1643
1644 int
1645 main (void)
1646 {
1647 #ifndef __GNUC__
1648        choke me
1649 #endif
1650
1651   ;
1652   return 0;
1653 }
1654 _ACEOF
1655 rm -f conftest.$ac_objext
1656 if { (eval echo "$as_me:1656: \"$ac_compile\"") >&5
1657   (eval $ac_compile) 2>&5
1658   ac_status=$?
1659   echo "$as_me:1659: \$? = $ac_status" >&5
1660   (exit $ac_status); } &&
1661          { ac_try='test -s conftest.$ac_objext'
1662   { (eval echo "$as_me:1662: \"$ac_try\"") >&5
1663   (eval $ac_try) 2>&5
1664   ac_status=$?
1665   echo "$as_me:1665: \$? = $ac_status" >&5
1666   (exit $ac_status); }; }; then
1667   ac_compiler_gnu=yes
1668 else
1669   echo "$as_me: failed program was:" >&5
1670 cat conftest.$ac_ext >&5
1671 ac_compiler_gnu=no
1672 fi
1673 rm -f conftest.$ac_objext conftest.$ac_ext
1674 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1675
1676 fi
1677 echo "$as_me:1677: result: $ac_cv_c_compiler_gnu" >&5
1678 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1679 GCC=`test $ac_compiler_gnu = yes && echo yes`
1680 ac_test_CFLAGS=${CFLAGS+set}
1681 ac_save_CFLAGS=$CFLAGS
1682 CFLAGS="-g"
1683 echo "$as_me:1683: checking whether $CC accepts -g" >&5
1684 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1685 if test "${ac_cv_prog_cc_g+set}" = set; then
1686   echo $ECHO_N "(cached) $ECHO_C" >&6
1687 else
1688   cat >conftest.$ac_ext <<_ACEOF
1689 #line 1689 "configure"
1690 #include "confdefs.h"
1691
1692 int
1693 main (void)
1694 {
1695
1696   ;
1697   return 0;
1698 }
1699 _ACEOF
1700 rm -f conftest.$ac_objext
1701 if { (eval echo "$as_me:1701: \"$ac_compile\"") >&5
1702   (eval $ac_compile) 2>&5
1703   ac_status=$?
1704   echo "$as_me:1704: \$? = $ac_status" >&5
1705   (exit $ac_status); } &&
1706          { ac_try='test -s conftest.$ac_objext'
1707   { (eval echo "$as_me:1707: \"$ac_try\"") >&5
1708   (eval $ac_try) 2>&5
1709   ac_status=$?
1710   echo "$as_me:1710: \$? = $ac_status" >&5
1711   (exit $ac_status); }; }; then
1712   ac_cv_prog_cc_g=yes
1713 else
1714   echo "$as_me: failed program was:" >&5
1715 cat conftest.$ac_ext >&5
1716 ac_cv_prog_cc_g=no
1717 fi
1718 rm -f conftest.$ac_objext conftest.$ac_ext
1719 fi
1720 echo "$as_me:1720: result: $ac_cv_prog_cc_g" >&5
1721 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1722 if test "$ac_test_CFLAGS" = set; then
1723   CFLAGS=$ac_save_CFLAGS
1724 elif test $ac_cv_prog_cc_g = yes; then
1725   if test "$GCC" = yes; then
1726     CFLAGS="-g -O2"
1727   else
1728     CFLAGS="-g"
1729   fi
1730 else
1731   if test "$GCC" = yes; then
1732     CFLAGS="-O2"
1733   else
1734     CFLAGS=
1735   fi
1736 fi
1737 # Some people use a C++ compiler to compile C.  Since we use `exit',
1738 # in C++ we need to declare it.  In case someone uses the same compiler
1739 # for both compiling C and C++ we need to have the C++ compiler decide
1740 # the declaration of exit, since it's the most demanding environment.
1741 cat >conftest.$ac_ext <<_ACEOF
1742 #ifndef __cplusplus
1743   choke me
1744 #endif
1745 _ACEOF
1746 rm -f conftest.$ac_objext
1747 if { (eval echo "$as_me:1747: \"$ac_compile\"") >&5
1748   (eval $ac_compile) 2>&5
1749   ac_status=$?
1750   echo "$as_me:1750: \$? = $ac_status" >&5
1751   (exit $ac_status); } &&
1752          { ac_try='test -s conftest.$ac_objext'
1753   { (eval echo "$as_me:1753: \"$ac_try\"") >&5
1754   (eval $ac_try) 2>&5
1755   ac_status=$?
1756   echo "$as_me:1756: \$? = $ac_status" >&5
1757   (exit $ac_status); }; }; then
1758   for ac_declaration in \
1759    ''\
1760    '#include <stdlib.h>' \
1761    'extern "C" void std::exit (int) throw (); using std::exit;' \
1762    'extern "C" void std::exit (int); using std::exit;' \
1763    'extern "C" void exit (int) throw ();' \
1764    'extern "C" void exit (int);' \
1765    'void exit (int);'
1766 do
1767   cat >conftest.$ac_ext <<_ACEOF
1768 #line 1768 "configure"
1769 #include "confdefs.h"
1770 #include <stdlib.h>
1771 $ac_declaration
1772 int
1773 main (void)
1774 {
1775 exit (42);
1776   ;
1777   return 0;
1778 }
1779 _ACEOF
1780 rm -f conftest.$ac_objext
1781 if { (eval echo "$as_me:1781: \"$ac_compile\"") >&5
1782   (eval $ac_compile) 2>&5
1783   ac_status=$?
1784   echo "$as_me:1784: \$? = $ac_status" >&5
1785   (exit $ac_status); } &&
1786          { ac_try='test -s conftest.$ac_objext'
1787   { (eval echo "$as_me:1787: \"$ac_try\"") >&5
1788   (eval $ac_try) 2>&5
1789   ac_status=$?
1790   echo "$as_me:1790: \$? = $ac_status" >&5
1791   (exit $ac_status); }; }; then
1792   :
1793 else
1794   echo "$as_me: failed program was:" >&5
1795 cat conftest.$ac_ext >&5
1796 continue
1797 fi
1798 rm -f conftest.$ac_objext conftest.$ac_ext
1799   cat >conftest.$ac_ext <<_ACEOF
1800 #line 1800 "configure"
1801 #include "confdefs.h"
1802 $ac_declaration
1803 int
1804 main (void)
1805 {
1806 exit (42);
1807   ;
1808   return 0;
1809 }
1810 _ACEOF
1811 rm -f conftest.$ac_objext
1812 if { (eval echo "$as_me:1812: \"$ac_compile\"") >&5
1813   (eval $ac_compile) 2>&5
1814   ac_status=$?
1815   echo "$as_me:1815: \$? = $ac_status" >&5
1816   (exit $ac_status); } &&
1817          { ac_try='test -s conftest.$ac_objext'
1818   { (eval echo "$as_me:1818: \"$ac_try\"") >&5
1819   (eval $ac_try) 2>&5
1820   ac_status=$?
1821   echo "$as_me:1821: \$? = $ac_status" >&5
1822   (exit $ac_status); }; }; then
1823   break
1824 else
1825   echo "$as_me: failed program was:" >&5
1826 cat conftest.$ac_ext >&5
1827 fi
1828 rm -f conftest.$ac_objext conftest.$ac_ext
1829 done
1830 rm -rf conftest*
1831 if test -n "$ac_declaration"; then
1832   echo '#ifdef __cplusplus' >>confdefs.h
1833   echo $ac_declaration      >>confdefs.h
1834   echo '#endif'             >>confdefs.h
1835 fi
1836
1837 else
1838   echo "$as_me: failed program was:" >&5
1839 cat conftest.$ac_ext >&5
1840 fi
1841 rm -f conftest.$ac_objext conftest.$ac_ext
1842 ac_ext=c
1843 ac_cpp='$CPP $CPPFLAGS'
1844 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1845 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1846 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1847 ac_main_return=return
1848
1849 GCC_VERSION=none
1850 if test "$GCC" = yes ; then
1851         echo "$as_me:1851: checking version of $CC" >&5
1852 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1853         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1854         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1855         echo "$as_me:1855: result: $GCC_VERSION" >&5
1856 echo "${ECHO_T}$GCC_VERSION" >&6
1857 fi
1858
1859 INTEL_COMPILER=no
1860
1861 if test "$GCC" = yes ; then
1862         case $host_os in
1863         (linux*|gnu*)
1864                 echo "$as_me:1864: checking if this is really Intel C compiler" >&5
1865 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1866                 cf_save_CFLAGS="$CFLAGS"
1867                 CFLAGS="$CFLAGS -no-gcc"
1868                 cat >conftest.$ac_ext <<_ACEOF
1869 #line 1869 "configure"
1870 #include "confdefs.h"
1871
1872 int
1873 main (void)
1874 {
1875
1876 #ifdef __INTEL_COMPILER
1877 #else
1878 make an error
1879 #endif
1880
1881   ;
1882   return 0;
1883 }
1884 _ACEOF
1885 rm -f conftest.$ac_objext
1886 if { (eval echo "$as_me:1886: \"$ac_compile\"") >&5
1887   (eval $ac_compile) 2>&5
1888   ac_status=$?
1889   echo "$as_me:1889: \$? = $ac_status" >&5
1890   (exit $ac_status); } &&
1891          { ac_try='test -s conftest.$ac_objext'
1892   { (eval echo "$as_me:1892: \"$ac_try\"") >&5
1893   (eval $ac_try) 2>&5
1894   ac_status=$?
1895   echo "$as_me:1895: \$? = $ac_status" >&5
1896   (exit $ac_status); }; }; then
1897   INTEL_COMPILER=yes
1898 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1899
1900 else
1901   echo "$as_me: failed program was:" >&5
1902 cat conftest.$ac_ext >&5
1903 fi
1904 rm -f conftest.$ac_objext conftest.$ac_ext
1905                 CFLAGS="$cf_save_CFLAGS"
1906                 echo "$as_me:1906: result: $INTEL_COMPILER" >&5
1907 echo "${ECHO_T}$INTEL_COMPILER" >&6
1908                 ;;
1909         esac
1910 fi
1911
1912 CLANG_COMPILER=no
1913
1914 if test "$GCC" = yes ; then
1915         echo "$as_me:1915: checking if this is really Clang C compiler" >&5
1916 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1917         cf_save_CFLAGS="$CFLAGS"
1918         CFLAGS="$CFLAGS -Qunused-arguments"
1919         cat >conftest.$ac_ext <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __clang__
1928 #else
1929 make an error
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f conftest.$ac_objext
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit $ac_status); } &&
1942          { ac_try='test -s conftest.$ac_objext'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit $ac_status); }; }; then
1948   CLANG_COMPILER=yes
1949 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
1950
1951 else
1952   echo "$as_me: failed program was:" >&5
1953 cat conftest.$ac_ext >&5
1954 fi
1955 rm -f conftest.$ac_objext conftest.$ac_ext
1956         CFLAGS="$cf_save_CFLAGS"
1957         echo "$as_me:1957: result: $CLANG_COMPILER" >&5
1958 echo "${ECHO_T}$CLANG_COMPILER" >&6
1959 fi
1960
1961 echo "$as_me:1961: checking for $CC option to accept ANSI C" >&5
1962 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1963 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1964   echo $ECHO_N "(cached) $ECHO_C" >&6
1965 else
1966   ac_cv_prog_cc_stdc=no
1967 ac_save_CC=$CC
1968 cat >conftest.$ac_ext <<_ACEOF
1969 #line 1969 "configure"
1970 #include "confdefs.h"
1971 #include <stdarg.h>
1972 #include <stdio.h>
1973 #include <sys/types.h>
1974 #include <sys/stat.h>
1975 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1976 struct buf { int x; };
1977 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1978 static char *e (p, i)
1979      char **p;
1980      int i;
1981 {
1982   return p[i];
1983 }
1984 static char *f (char * (*g) (char **, int), char **p, ...)
1985 {
1986   char *s;
1987   va_list v;
1988   va_start (v,p);
1989   s = g (p, va_arg (v,int));
1990   va_end (v);
1991   return s;
1992 }
1993 int test (int i, double x);
1994 struct s1 {int (*f) (int a);};
1995 struct s2 {int (*f) (double a);};
1996 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1997 int argc;
1998 char **argv;
1999 int
2000 main (void)
2001 {
2002 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2003   ;
2004   return 0;
2005 }
2006 _ACEOF
2007 # Don't try gcc -ansi; that turns off useful extensions and
2008 # breaks some systems' header files.
2009 # AIX                   -qlanglvl=ansi
2010 # Ultrix and OSF/1      -std1
2011 # HP-UX 10.20 and later -Ae
2012 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2013 # SVR4                  -Xc -D__EXTENSIONS__
2014 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2015 do
2016   CC="$ac_save_CC $ac_arg"
2017   rm -f conftest.$ac_objext
2018 if { (eval echo "$as_me:2018: \"$ac_compile\"") >&5
2019   (eval $ac_compile) 2>&5
2020   ac_status=$?
2021   echo "$as_me:2021: \$? = $ac_status" >&5
2022   (exit $ac_status); } &&
2023          { ac_try='test -s conftest.$ac_objext'
2024   { (eval echo "$as_me:2024: \"$ac_try\"") >&5
2025   (eval $ac_try) 2>&5
2026   ac_status=$?
2027   echo "$as_me:2027: \$? = $ac_status" >&5
2028   (exit $ac_status); }; }; then
2029   ac_cv_prog_cc_stdc=$ac_arg
2030 break
2031 else
2032   echo "$as_me: failed program was:" >&5
2033 cat conftest.$ac_ext >&5
2034 fi
2035 rm -f conftest.$ac_objext
2036 done
2037 rm -f conftest.$ac_ext conftest.$ac_objext
2038 CC=$ac_save_CC
2039
2040 fi
2041
2042 case "x$ac_cv_prog_cc_stdc" in
2043   x|xno)
2044     echo "$as_me:2044: result: none needed" >&5
2045 echo "${ECHO_T}none needed" >&6 ;;
2046   *)
2047     echo "$as_me:2047: result: $ac_cv_prog_cc_stdc" >&5
2048 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2049     CC="$CC $ac_cv_prog_cc_stdc" ;;
2050 esac
2051
2052 # This should have been defined by AC_PROG_CC
2053 : ${CC:=cc}
2054
2055 echo "$as_me:2055: checking \$CFLAGS variable" >&5
2056 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2057 case "x$CFLAGS" in
2058 (*-[IUD]*)
2059         echo "$as_me:2059: result: broken" >&5
2060 echo "${ECHO_T}broken" >&6
2061         { echo "$as_me:2061: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2062 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2063         cf_flags="$CFLAGS"
2064         CFLAGS=
2065         for cf_arg in $cf_flags
2066         do
2067
2068 cf_fix_cppflags=no
2069 cf_new_cflags=
2070 cf_new_cppflags=
2071 cf_new_extra_cppflags=
2072
2073 for cf_add_cflags in $cf_arg
2074 do
2075 case $cf_fix_cppflags in
2076 (no)
2077         case $cf_add_cflags in
2078         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2079                 case $cf_add_cflags in
2080                 (-D*)
2081                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2082
2083                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2084                                 && test -z "${cf_tst_cflags}" \
2085                                 && cf_fix_cppflags=yes
2086
2087                         if test $cf_fix_cppflags = yes ; then
2088
2089         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2090         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2091
2092                                 continue
2093                         elif test "${cf_tst_cflags}" = "\"'" ; then
2094
2095         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2096         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2097
2098                                 continue
2099                         fi
2100                         ;;
2101                 esac
2102                 case "$CPPFLAGS" in
2103                 (*$cf_add_cflags)
2104                         ;;
2105                 (*)
2106                         case $cf_add_cflags in
2107                         (-D*)
2108                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2109
2110 CPPFLAGS=`echo "$CPPFLAGS" | \
2111         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2112                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2113
2114                                 ;;
2115                         esac
2116
2117         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2118         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2119
2120                         ;;
2121                 esac
2122                 ;;
2123         (*)
2124
2125         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2126         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2127
2128                 ;;
2129         esac
2130         ;;
2131 (yes)
2132
2133         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2134         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2135
2136         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2137
2138         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2139                 && test -z "${cf_tst_cflags}" \
2140                 && cf_fix_cppflags=no
2141         ;;
2142 esac
2143 done
2144
2145 if test -n "$cf_new_cflags" ; then
2146
2147         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2148         CFLAGS="${CFLAGS}$cf_new_cflags"
2149
2150 fi
2151
2152 if test -n "$cf_new_cppflags" ; then
2153
2154         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2155         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2156
2157 fi
2158
2159 if test -n "$cf_new_extra_cppflags" ; then
2160
2161         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2162         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2163
2164 fi
2165
2166         done
2167         ;;
2168 (*)
2169         echo "$as_me:2169: result: ok" >&5
2170 echo "${ECHO_T}ok" >&6
2171         ;;
2172 esac
2173
2174 echo "$as_me:2174: checking \$CC variable" >&5
2175 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2176 case "$CC" in
2177 (*[\ \  ]-*)
2178         echo "$as_me:2178: result: broken" >&5
2179 echo "${ECHO_T}broken" >&6
2180         { echo "$as_me:2180: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2181 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2182         # humor him...
2183         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2184         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2185         CC="$cf_prog"
2186         for cf_arg in $cf_flags
2187         do
2188                 case "x$cf_arg" in
2189                 (x-[IUDfgOW]*)
2190
2191 cf_fix_cppflags=no
2192 cf_new_cflags=
2193 cf_new_cppflags=
2194 cf_new_extra_cppflags=
2195
2196 for cf_add_cflags in $cf_arg
2197 do
2198 case $cf_fix_cppflags in
2199 (no)
2200         case $cf_add_cflags in
2201         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2202                 case $cf_add_cflags in
2203                 (-D*)
2204                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2205
2206                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2207                                 && test -z "${cf_tst_cflags}" \
2208                                 && cf_fix_cppflags=yes
2209
2210                         if test $cf_fix_cppflags = yes ; then
2211
2212         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2213         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2214
2215                                 continue
2216                         elif test "${cf_tst_cflags}" = "\"'" ; then
2217
2218         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2219         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2220
2221                                 continue
2222                         fi
2223                         ;;
2224                 esac
2225                 case "$CPPFLAGS" in
2226                 (*$cf_add_cflags)
2227                         ;;
2228                 (*)
2229                         case $cf_add_cflags in
2230                         (-D*)
2231                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2232
2233 CPPFLAGS=`echo "$CPPFLAGS" | \
2234         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2235                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2236
2237                                 ;;
2238                         esac
2239
2240         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2241         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2242
2243                         ;;
2244                 esac
2245                 ;;
2246         (*)
2247
2248         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2249         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2250
2251                 ;;
2252         esac
2253         ;;
2254 (yes)
2255
2256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2258
2259         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2260
2261         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2262                 && test -z "${cf_tst_cflags}" \
2263                 && cf_fix_cppflags=no
2264         ;;
2265 esac
2266 done
2267
2268 if test -n "$cf_new_cflags" ; then
2269
2270         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2271         CFLAGS="${CFLAGS}$cf_new_cflags"
2272
2273 fi
2274
2275 if test -n "$cf_new_cppflags" ; then
2276
2277         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2278         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2279
2280 fi
2281
2282 if test -n "$cf_new_extra_cppflags" ; then
2283
2284         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2285         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2286
2287 fi
2288
2289                         ;;
2290                 (*)
2291                         CC="$CC $cf_arg"
2292                         ;;
2293                 esac
2294         done
2295         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2296
2297 echo "${as_me:-configure}:2297: testing resulting CC: '$CC' ..." 1>&5
2298
2299         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2300
2301 echo "${as_me:-configure}:2301: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2302
2303         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2304
2305 echo "${as_me:-configure}:2305: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2306
2307         ;;
2308 (*)
2309         echo "$as_me:2309: result: ok" >&5
2310 echo "${ECHO_T}ok" >&6
2311         ;;
2312 esac
2313
2314 echo "$as_me:2314: checking for inline" >&5
2315 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2316 if test "${ac_cv_c_inline+set}" = set; then
2317   echo $ECHO_N "(cached) $ECHO_C" >&6
2318 else
2319   ac_cv_c_inline=no
2320 for ac_kw in inline __inline__ __inline; do
2321   cat >conftest.$ac_ext <<_ACEOF
2322 #line 2322 "configure"
2323 #include "confdefs.h"
2324 #ifndef __cplusplus
2325 static $ac_kw int static_foo () {return 0; }
2326 $ac_kw int foo () {return 0; }
2327 #endif
2328
2329 _ACEOF
2330 rm -f conftest.$ac_objext
2331 if { (eval echo "$as_me:2331: \"$ac_compile\"") >&5
2332   (eval $ac_compile) 2>&5
2333   ac_status=$?
2334   echo "$as_me:2334: \$? = $ac_status" >&5
2335   (exit $ac_status); } &&
2336          { ac_try='test -s conftest.$ac_objext'
2337   { (eval echo "$as_me:2337: \"$ac_try\"") >&5
2338   (eval $ac_try) 2>&5
2339   ac_status=$?
2340   echo "$as_me:2340: \$? = $ac_status" >&5
2341   (exit $ac_status); }; }; then
2342   ac_cv_c_inline=$ac_kw; break
2343 else
2344   echo "$as_me: failed program was:" >&5
2345 cat conftest.$ac_ext >&5
2346 fi
2347 rm -f conftest.$ac_objext conftest.$ac_ext
2348 done
2349
2350 fi
2351 echo "$as_me:2351: result: $ac_cv_c_inline" >&5
2352 echo "${ECHO_T}$ac_cv_c_inline" >&6
2353 case $ac_cv_c_inline in
2354   inline | yes) ;;
2355   no)
2356 cat >>confdefs.h <<\EOF
2357 #define inline
2358 EOF
2359  ;;
2360   *)  cat >>confdefs.h <<EOF
2361 #define inline $ac_cv_c_inline
2362 EOF
2363  ;;
2364 esac
2365
2366 ac_ext=c
2367 ac_cpp='$CPP $CPPFLAGS'
2368 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2369 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2370 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2371 ac_main_return=return
2372 echo "$as_me:2372: checking how to run the C preprocessor" >&5
2373 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2374 # On Suns, sometimes $CPP names a directory.
2375 if test -n "$CPP" && test -d "$CPP"; then
2376   CPP=
2377 fi
2378 if test -z "$CPP"; then
2379   if test "${ac_cv_prog_CPP+set}" = set; then
2380   echo $ECHO_N "(cached) $ECHO_C" >&6
2381 else
2382       # Double quotes because CPP needs to be expanded
2383     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2384     do
2385       ac_preproc_ok=false
2386 for ac_c_preproc_warn_flag in '' yes
2387 do
2388   # Use a header file that comes with gcc, so configuring glibc
2389   # with a fresh cross-compiler works.
2390   # On the NeXT, cc -E runs the code through the compiler's parser,
2391   # not just through cpp. "Syntax error" is here to catch this case.
2392   cat >conftest.$ac_ext <<_ACEOF
2393 #line 2393 "configure"
2394 #include "confdefs.h"
2395 #include <assert.h>
2396                      Syntax error
2397 _ACEOF
2398 if { (eval echo "$as_me:2398: \"$ac_cpp conftest.$ac_ext\"") >&5
2399   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2400   ac_status=$?
2401   egrep -v '^ *\+' conftest.er1 >conftest.err
2402   rm -f conftest.er1
2403   cat conftest.err >&5
2404   echo "$as_me:2404: \$? = $ac_status" >&5
2405   (exit $ac_status); } >/dev/null; then
2406   if test -s conftest.err; then
2407     ac_cpp_err=$ac_c_preproc_warn_flag
2408   else
2409     ac_cpp_err=
2410   fi
2411 else
2412   ac_cpp_err=yes
2413 fi
2414 if test -z "$ac_cpp_err"; then
2415   :
2416 else
2417   echo "$as_me: failed program was:" >&5
2418   cat conftest.$ac_ext >&5
2419   # Broken: fails on valid input.
2420 continue
2421 fi
2422 rm -f conftest.err conftest.$ac_ext
2423
2424   # OK, works on sane cases.  Now check whether non-existent headers
2425   # can be detected and how.
2426   cat >conftest.$ac_ext <<_ACEOF
2427 #line 2427 "configure"
2428 #include "confdefs.h"
2429 #include <ac_nonexistent.h>
2430 _ACEOF
2431 if { (eval echo "$as_me:2431: \"$ac_cpp conftest.$ac_ext\"") >&5
2432   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2433   ac_status=$?
2434   egrep -v '^ *\+' conftest.er1 >conftest.err
2435   rm -f conftest.er1
2436   cat conftest.err >&5
2437   echo "$as_me:2437: \$? = $ac_status" >&5
2438   (exit $ac_status); } >/dev/null; then
2439   if test -s conftest.err; then
2440     ac_cpp_err=$ac_c_preproc_warn_flag
2441   else
2442     ac_cpp_err=
2443   fi
2444 else
2445   ac_cpp_err=yes
2446 fi
2447 if test -z "$ac_cpp_err"; then
2448   # Broken: success on invalid input.
2449 continue
2450 else
2451   echo "$as_me: failed program was:" >&5
2452   cat conftest.$ac_ext >&5
2453   # Passes both tests.
2454 ac_preproc_ok=:
2455 break
2456 fi
2457 rm -f conftest.err conftest.$ac_ext
2458
2459 done
2460 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2461 rm -f conftest.err conftest.$ac_ext
2462 if $ac_preproc_ok; then
2463   break
2464 fi
2465
2466     done
2467     ac_cv_prog_CPP=$CPP
2468
2469 fi
2470   CPP=$ac_cv_prog_CPP
2471 else
2472   ac_cv_prog_CPP=$CPP
2473 fi
2474 echo "$as_me:2474: result: $CPP" >&5
2475 echo "${ECHO_T}$CPP" >&6
2476 ac_preproc_ok=false
2477 for ac_c_preproc_warn_flag in '' yes
2478 do
2479   # Use a header file that comes with gcc, so configuring glibc
2480   # with a fresh cross-compiler works.
2481   # On the NeXT, cc -E runs the code through the compiler's parser,
2482   # not just through cpp. "Syntax error" is here to catch this case.
2483   cat >conftest.$ac_ext <<_ACEOF
2484 #line 2484 "configure"
2485 #include "confdefs.h"
2486 #include <assert.h>
2487                      Syntax error
2488 _ACEOF
2489 if { (eval echo "$as_me:2489: \"$ac_cpp conftest.$ac_ext\"") >&5
2490   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2491   ac_status=$?
2492   egrep -v '^ *\+' conftest.er1 >conftest.err
2493   rm -f conftest.er1
2494   cat conftest.err >&5
2495   echo "$as_me:2495: \$? = $ac_status" >&5
2496   (exit $ac_status); } >/dev/null; then
2497   if test -s conftest.err; then
2498     ac_cpp_err=$ac_c_preproc_warn_flag
2499   else
2500     ac_cpp_err=
2501   fi
2502 else
2503   ac_cpp_err=yes
2504 fi
2505 if test -z "$ac_cpp_err"; then
2506   :
2507 else
2508   echo "$as_me: failed program was:" >&5
2509   cat conftest.$ac_ext >&5
2510   # Broken: fails on valid input.
2511 continue
2512 fi
2513 rm -f conftest.err conftest.$ac_ext
2514
2515   # OK, works on sane cases.  Now check whether non-existent headers
2516   # can be detected and how.
2517   cat >conftest.$ac_ext <<_ACEOF
2518 #line 2518 "configure"
2519 #include "confdefs.h"
2520 #include <ac_nonexistent.h>
2521 _ACEOF
2522 if { (eval echo "$as_me:2522: \"$ac_cpp conftest.$ac_ext\"") >&5
2523   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2524   ac_status=$?
2525   egrep -v '^ *\+' conftest.er1 >conftest.err
2526   rm -f conftest.er1
2527   cat conftest.err >&5
2528   echo "$as_me:2528: \$? = $ac_status" >&5
2529   (exit $ac_status); } >/dev/null; then
2530   if test -s conftest.err; then
2531     ac_cpp_err=$ac_c_preproc_warn_flag
2532   else
2533     ac_cpp_err=
2534   fi
2535 else
2536   ac_cpp_err=yes
2537 fi
2538 if test -z "$ac_cpp_err"; then
2539   # Broken: success on invalid input.
2540 continue
2541 else
2542   echo "$as_me: failed program was:" >&5
2543   cat conftest.$ac_ext >&5
2544   # Passes both tests.
2545 ac_preproc_ok=:
2546 break
2547 fi
2548 rm -f conftest.err conftest.$ac_ext
2549
2550 done
2551 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2552 rm -f conftest.err conftest.$ac_ext
2553 if $ac_preproc_ok; then
2554   :
2555 else
2556   { { echo "$as_me:2556: error: C preprocessor \"$CPP\" fails sanity check" >&5
2557 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2558    { (exit 1); exit 1; }; }
2559 fi
2560
2561 ac_ext=c
2562 ac_cpp='$CPP $CPPFLAGS'
2563 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2564 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2565 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2566 ac_main_return=return
2567
2568 for ac_prog in mawk gawk nawk awk
2569 do
2570   # Extract the first word of "$ac_prog", so it can be a program name with args.
2571 set dummy $ac_prog; ac_word=$2
2572 echo "$as_me:2572: checking for $ac_word" >&5
2573 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2574 if test "${ac_cv_prog_AWK+set}" = set; then
2575   echo $ECHO_N "(cached) $ECHO_C" >&6
2576 else
2577   if test -n "$AWK"; then
2578   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2579 else
2580   ac_save_IFS=$IFS; IFS=$ac_path_separator
2581 ac_dummy="$PATH"
2582 for ac_dir in $ac_dummy; do
2583   IFS=$ac_save_IFS
2584   test -z "$ac_dir" && ac_dir=.
2585   $as_executable_p "$ac_dir/$ac_word" || continue
2586 ac_cv_prog_AWK="$ac_prog"
2587 echo "$as_me:2587: found $ac_dir/$ac_word" >&5
2588 break
2589 done
2590
2591 fi
2592 fi
2593 AWK=$ac_cv_prog_AWK
2594 if test -n "$AWK"; then
2595   echo "$as_me:2595: result: $AWK" >&5
2596 echo "${ECHO_T}$AWK" >&6
2597 else
2598   echo "$as_me:2598: result: no" >&5
2599 echo "${ECHO_T}no" >&6
2600 fi
2601
2602   test -n "$AWK" && break
2603 done
2604
2605 # Find a good install program.  We prefer a C program (faster),
2606 # so one script is as good as another.  But avoid the broken or
2607 # incompatible versions:
2608 # SysV /etc/install, /usr/sbin/install
2609 # SunOS /usr/etc/install
2610 # IRIX /sbin/install
2611 # AIX /bin/install
2612 # AmigaOS /C/install, which installs bootblocks on floppy discs
2613 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2614 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2615 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2616 # ./install, which can be erroneously created by make from ./install.sh.
2617 echo "$as_me:2617: checking for a BSD compatible install" >&5
2618 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2619 if test -z "$INSTALL"; then
2620 if test "${ac_cv_path_install+set}" = set; then
2621   echo $ECHO_N "(cached) $ECHO_C" >&6
2622 else
2623     ac_save_IFS=$IFS; IFS=$ac_path_separator
2624   for ac_dir in $PATH; do
2625     IFS=$ac_save_IFS
2626     # Account for people who put trailing slashes in PATH elements.
2627     case $ac_dir/ in
2628     / | ./ | .// | /cC/* \
2629     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2630     | /usr/ucb/* ) ;;
2631     *)
2632       # OSF1 and SCO ODT 3.0 have their own names for install.
2633       # Don't use installbsd from OSF since it installs stuff as root
2634       # by default.
2635       for ac_prog in ginstall scoinst install; do
2636         if $as_executable_p "$ac_dir/$ac_prog"; then
2637           if test $ac_prog = install &&
2638             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2639             # AIX install.  It has an incompatible calling convention.
2640             :
2641           elif test $ac_prog = install &&
2642             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2643             # program-specific install script used by HP pwplus--don't use.
2644             :
2645           else
2646             ac_cv_path_install="$ac_dir/$ac_prog -c"
2647             break 2
2648           fi
2649         fi
2650       done
2651       ;;
2652     esac
2653   done
2654
2655 fi
2656   if test "${ac_cv_path_install+set}" = set; then
2657     INSTALL=$ac_cv_path_install
2658   else
2659     # As a last resort, use the slow shell script.  We don't cache a
2660     # path for INSTALL within a source directory, because that will
2661     # break other packages using the cache if that directory is
2662     # removed, or if the path is relative.
2663     INSTALL=$ac_install_sh
2664   fi
2665 fi
2666 echo "$as_me:2666: result: $INSTALL" >&5
2667 echo "${ECHO_T}$INSTALL" >&6
2668
2669 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2670 # It thinks the first close brace ends the variable substitution.
2671 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2672
2673 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2674
2675 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2676
2677 case $INSTALL in
2678 (/*)
2679         ;;
2680 (*)
2681         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2682         test -z "$cf_dir" && cf_dir=.
2683         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2684         ;;
2685 esac
2686
2687 echo "$as_me:2687: checking if you want to install stripped executables" >&5
2688 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2689
2690 # Check whether --enable-stripping or --disable-stripping was given.
2691 if test "${enable_stripping+set}" = set; then
2692   enableval="$enable_stripping"
2693   test "$enableval" != no && enableval=yes
2694         if test "$enableval" != "yes" ; then
2695     with_stripping=no
2696         else
2697                 with_stripping=yes
2698         fi
2699 else
2700   enableval=yes
2701         with_stripping=yes
2702
2703 fi;
2704 echo "$as_me:2704: result: $with_stripping" >&5
2705 echo "${ECHO_T}$with_stripping" >&6
2706
2707 if test "$with_stripping" = yes
2708 then
2709         INSTALL_OPT_S="-s"
2710 else
2711         INSTALL_OPT_S=
2712 fi
2713
2714 : ${INSTALL:=install}
2715 echo "$as_me:2715: checking if install accepts -p option" >&5
2716 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2717 if test "${cf_cv_install_p+set}" = set; then
2718   echo $ECHO_N "(cached) $ECHO_C" >&6
2719 else
2720
2721         rm -rf conftest*
2722         date >conftest.in
2723         mkdir conftest.out
2724         sleep 3
2725         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2726         then
2727                 if test -f conftest.out/conftest.in
2728                 then
2729                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2730                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2731                         if test -s conftest.err
2732                         then
2733                                 cf_cv_install_p=no
2734                         else
2735                                 cf_cv_install_p=yes
2736                         fi
2737                 else
2738                         cf_cv_install_p=no
2739                 fi
2740         else
2741                 cf_cv_install_p=no
2742         fi
2743         rm -rf conftest*
2744
2745 fi
2746 echo "$as_me:2746: result: $cf_cv_install_p" >&5
2747 echo "${ECHO_T}$cf_cv_install_p" >&6
2748
2749 echo "$as_me:2749: checking if install needs to be told about ownership" >&5
2750 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2751 case `$ac_config_guess` in
2752 (*minix)
2753         with_install_o=yes
2754         ;;
2755 (*)
2756         with_install_o=no
2757         ;;
2758 esac
2759
2760 echo "$as_me:2760: result: $with_install_o" >&5
2761 echo "${ECHO_T}$with_install_o" >&6
2762 if test "x$with_install_o" = xyes
2763 then
2764         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'`
2765 else
2766         INSTALL_OPT_O=
2767 fi
2768
2769 for ac_prog in lint cppcheck splint
2770 do
2771   # Extract the first word of "$ac_prog", so it can be a program name with args.
2772 set dummy $ac_prog; ac_word=$2
2773 echo "$as_me:2773: checking for $ac_word" >&5
2774 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2775 if test "${ac_cv_prog_LINT+set}" = set; then
2776   echo $ECHO_N "(cached) $ECHO_C" >&6
2777 else
2778   if test -n "$LINT"; then
2779   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2780 else
2781   ac_save_IFS=$IFS; IFS=$ac_path_separator
2782 ac_dummy="$PATH"
2783 for ac_dir in $ac_dummy; do
2784   IFS=$ac_save_IFS
2785   test -z "$ac_dir" && ac_dir=.
2786   $as_executable_p "$ac_dir/$ac_word" || continue
2787 ac_cv_prog_LINT="$ac_prog"
2788 echo "$as_me:2788: found $ac_dir/$ac_word" >&5
2789 break
2790 done
2791
2792 fi
2793 fi
2794 LINT=$ac_cv_prog_LINT
2795 if test -n "$LINT"; then
2796   echo "$as_me:2796: result: $LINT" >&5
2797 echo "${ECHO_T}$LINT" >&6
2798 else
2799   echo "$as_me:2799: result: no" >&5
2800 echo "${ECHO_T}no" >&6
2801 fi
2802
2803   test -n "$LINT" && break
2804 done
2805
2806 case "x$LINT" in
2807 (xcppcheck|x*/cppcheck)
2808         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2809         ;;
2810 esac
2811
2812 echo "$as_me:2812: checking if filesystem supports mixed-case filenames" >&5
2813 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2814 if test "${cf_cv_mixedcase+set}" = set; then
2815   echo $ECHO_N "(cached) $ECHO_C" >&6
2816 else
2817
2818 if test "$cross_compiling" = yes ; then
2819         case $target_alias in
2820         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2821                 cf_cv_mixedcase=no
2822                 ;;
2823         (*)
2824                 cf_cv_mixedcase=yes
2825                 ;;
2826         esac
2827 else
2828         rm -f conftest CONFTEST
2829         echo test >conftest
2830         if test -f CONFTEST ; then
2831                 cf_cv_mixedcase=no
2832         else
2833                 cf_cv_mixedcase=yes
2834         fi
2835         rm -f conftest CONFTEST
2836 fi
2837
2838 fi
2839 echo "$as_me:2839: result: $cf_cv_mixedcase" >&5
2840 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2841 test "$cf_cv_mixedcase" = yes &&
2842 cat >>confdefs.h <<\EOF
2843 #define MIXEDCASE_FILENAMES 1
2844 EOF
2845
2846 for ac_prog in exctags ctags
2847 do
2848   # Extract the first word of "$ac_prog", so it can be a program name with args.
2849 set dummy $ac_prog; ac_word=$2
2850 echo "$as_me:2850: checking for $ac_word" >&5
2851 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2852 if test "${ac_cv_prog_CTAGS+set}" = set; then
2853   echo $ECHO_N "(cached) $ECHO_C" >&6
2854 else
2855   if test -n "$CTAGS"; then
2856   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2857 else
2858   ac_save_IFS=$IFS; IFS=$ac_path_separator
2859 ac_dummy="$PATH"
2860 for ac_dir in $ac_dummy; do
2861   IFS=$ac_save_IFS
2862   test -z "$ac_dir" && ac_dir=.
2863   $as_executable_p "$ac_dir/$ac_word" || continue
2864 ac_cv_prog_CTAGS="$ac_prog"
2865 echo "$as_me:2865: found $ac_dir/$ac_word" >&5
2866 break
2867 done
2868
2869 fi
2870 fi
2871 CTAGS=$ac_cv_prog_CTAGS
2872 if test -n "$CTAGS"; then
2873   echo "$as_me:2873: result: $CTAGS" >&5
2874 echo "${ECHO_T}$CTAGS" >&6
2875 else
2876   echo "$as_me:2876: result: no" >&5
2877 echo "${ECHO_T}no" >&6
2878 fi
2879
2880   test -n "$CTAGS" && break
2881 done
2882
2883 for ac_prog in exetags etags
2884 do
2885   # Extract the first word of "$ac_prog", so it can be a program name with args.
2886 set dummy $ac_prog; ac_word=$2
2887 echo "$as_me:2887: checking for $ac_word" >&5
2888 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2889 if test "${ac_cv_prog_ETAGS+set}" = set; then
2890   echo $ECHO_N "(cached) $ECHO_C" >&6
2891 else
2892   if test -n "$ETAGS"; then
2893   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2894 else
2895   ac_save_IFS=$IFS; IFS=$ac_path_separator
2896 ac_dummy="$PATH"
2897 for ac_dir in $ac_dummy; do
2898   IFS=$ac_save_IFS
2899   test -z "$ac_dir" && ac_dir=.
2900   $as_executable_p "$ac_dir/$ac_word" || continue
2901 ac_cv_prog_ETAGS="$ac_prog"
2902 echo "$as_me:2902: found $ac_dir/$ac_word" >&5
2903 break
2904 done
2905
2906 fi
2907 fi
2908 ETAGS=$ac_cv_prog_ETAGS
2909 if test -n "$ETAGS"; then
2910   echo "$as_me:2910: result: $ETAGS" >&5
2911 echo "${ECHO_T}$ETAGS" >&6
2912 else
2913   echo "$as_me:2913: result: no" >&5
2914 echo "${ECHO_T}no" >&6
2915 fi
2916
2917   test -n "$ETAGS" && break
2918 done
2919
2920 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2921 set dummy ${CTAGS:-ctags}; ac_word=$2
2922 echo "$as_me:2922: checking for $ac_word" >&5
2923 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2924 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2925   echo $ECHO_N "(cached) $ECHO_C" >&6
2926 else
2927   if test -n "$MAKE_LOWER_TAGS"; then
2928   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2929 else
2930   ac_save_IFS=$IFS; IFS=$ac_path_separator
2931 ac_dummy="$PATH"
2932 for ac_dir in $ac_dummy; do
2933   IFS=$ac_save_IFS
2934   test -z "$ac_dir" && ac_dir=.
2935   $as_executable_p "$ac_dir/$ac_word" || continue
2936 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2937 echo "$as_me:2937: found $ac_dir/$ac_word" >&5
2938 break
2939 done
2940
2941   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2942 fi
2943 fi
2944 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2945 if test -n "$MAKE_LOWER_TAGS"; then
2946   echo "$as_me:2946: result: $MAKE_LOWER_TAGS" >&5
2947 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2948 else
2949   echo "$as_me:2949: result: no" >&5
2950 echo "${ECHO_T}no" >&6
2951 fi
2952
2953 if test "$cf_cv_mixedcase" = yes ; then
2954         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2955 set dummy ${ETAGS:-etags}; ac_word=$2
2956 echo "$as_me:2956: checking for $ac_word" >&5
2957 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2958 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2959   echo $ECHO_N "(cached) $ECHO_C" >&6
2960 else
2961   if test -n "$MAKE_UPPER_TAGS"; then
2962   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2963 else
2964   ac_save_IFS=$IFS; IFS=$ac_path_separator
2965 ac_dummy="$PATH"
2966 for ac_dir in $ac_dummy; do
2967   IFS=$ac_save_IFS
2968   test -z "$ac_dir" && ac_dir=.
2969   $as_executable_p "$ac_dir/$ac_word" || continue
2970 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2971 echo "$as_me:2971: found $ac_dir/$ac_word" >&5
2972 break
2973 done
2974
2975   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2976 fi
2977 fi
2978 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2979 if test -n "$MAKE_UPPER_TAGS"; then
2980   echo "$as_me:2980: result: $MAKE_UPPER_TAGS" >&5
2981 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2982 else
2983   echo "$as_me:2983: result: no" >&5
2984 echo "${ECHO_T}no" >&6
2985 fi
2986
2987 else
2988         MAKE_UPPER_TAGS=no
2989 fi
2990
2991 if test "$MAKE_UPPER_TAGS" = yes ; then
2992         MAKE_UPPER_TAGS=
2993 else
2994         MAKE_UPPER_TAGS="#"
2995 fi
2996
2997 if test "$MAKE_LOWER_TAGS" = yes ; then
2998         MAKE_LOWER_TAGS=
2999 else
3000         MAKE_LOWER_TAGS="#"
3001 fi
3002
3003 echo "$as_me:3003: checking if -lm needed for math functions" >&5
3004 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3005 if test "${cf_cv_need_libm+set}" = set; then
3006   echo $ECHO_N "(cached) $ECHO_C" >&6
3007 else
3008
3009         cat >conftest.$ac_ext <<_ACEOF
3010 #line 3010 "configure"
3011 #include "confdefs.h"
3012
3013         #include <stdio.h>
3014         #include <stdlib.h>
3015         #include <math.h>
3016
3017 int
3018 main (void)
3019 {
3020 double x = rand(); printf("result = %g\n", pow(sin(x),x))
3021   ;
3022   return 0;
3023 }
3024 _ACEOF
3025 rm -f conftest.$ac_objext conftest$ac_exeext
3026 if { (eval echo "$as_me:3026: \"$ac_link\"") >&5
3027   (eval $ac_link) 2>&5
3028   ac_status=$?
3029   echo "$as_me:3029: \$? = $ac_status" >&5
3030   (exit $ac_status); } &&
3031          { ac_try='test -s conftest$ac_exeext'
3032   { (eval echo "$as_me:3032: \"$ac_try\"") >&5
3033   (eval $ac_try) 2>&5
3034   ac_status=$?
3035   echo "$as_me:3035: \$? = $ac_status" >&5
3036   (exit $ac_status); }; }; then
3037   cf_cv_need_libm=no
3038 else
3039   echo "$as_me: failed program was:" >&5
3040 cat conftest.$ac_ext >&5
3041 cf_cv_need_libm=yes
3042 fi
3043 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3044 fi
3045 echo "$as_me:3045: result: $cf_cv_need_libm" >&5
3046 echo "${ECHO_T}$cf_cv_need_libm" >&6
3047 if test "$cf_cv_need_libm" = yes
3048 then
3049 MATH_LIB=-lm
3050 fi
3051
3052 top_builddir=`pwd`
3053
3054 CC_G_OPT="-g"
3055 CC_SHARED_OPTS=unknown
3056 CPPFLAGS="$CPPFLAGS"
3057 DFT_DEP_SUFFIX=""
3058 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3059 DFT_UPR_MODEL="NORMAL"
3060 LD="ld"
3061 LDFLAGS_SHARED=""
3062 LDFLAGS_STATIC=""
3063 LD_MODEL=""
3064 LD_SHARED_OPTS=""
3065 LIBTOOL=""
3066 LIBTOOL_OPTS=""
3067 LIB_CLEAN=""
3068 LIB_COMPILE=""
3069 LIB_LINK='${CC}'
3070 LINK_TESTS=""
3071 LOCAL_LDFLAGS=""
3072 PACKAGE="ncurses-examples"
3073 PTHREAD="-lm"
3074 TEST_ARGS=""
3075 TEST_DEPS=""
3076 TEST_LIBS=""
3077 TINFO_LDFLAGS=''
3078 TINFO_LIBS='$(LIBS_CURSES)'
3079 cf_cv_abi_version=""
3080 cf_cv_rel_version=""
3081 includesubdir=""
3082
3083 cf_cv_screen=curses
3084 cf_cv_libtype=
3085
3086 if test "$GCC" = yes
3087 then
3088 cat > conftest.i <<EOF
3089 #ifndef GCC_PRINTF
3090 #define GCC_PRINTF 0
3091 #endif
3092 #ifndef GCC_SCANF
3093 #define GCC_SCANF 0
3094 #endif
3095 #ifndef GCC_NORETURN
3096 #define GCC_NORETURN /* nothing */
3097 #endif
3098 #ifndef GCC_UNUSED
3099 #define GCC_UNUSED /* nothing */
3100 #endif
3101 EOF
3102 if test "$GCC" = yes
3103 then
3104         { echo "$as_me:3104: checking for $CC __attribute__ directives..." >&5
3105 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3106 cat > conftest.$ac_ext <<EOF
3107 #line 3107 "${as_me:-configure}"
3108 #include "confdefs.h"
3109 #include "conftest.h"
3110 #include "conftest.i"
3111 #if     GCC_PRINTF
3112 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3113 #else
3114 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3115 #endif
3116 #if     GCC_SCANF
3117 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3118 #else
3119 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3120 #endif
3121 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3122 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3123 extern void foo(void) GCC_NORETURN;
3124 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3125 EOF
3126         cf_printf_attribute=no
3127         cf_scanf_attribute=no
3128         for cf_attribute in scanf printf unused noreturn
3129         do
3130
3131 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3132
3133                 cf_directive="__attribute__(($cf_attribute))"
3134                 echo "checking for $CC $cf_directive" 1>&5
3135
3136                 case $cf_attribute in
3137                 (printf)
3138                         cf_printf_attribute=yes
3139                         cat >conftest.h <<EOF
3140 #define GCC_$cf_ATTRIBUTE 1
3141 EOF
3142                         ;;
3143                 (scanf)
3144                         cf_scanf_attribute=yes
3145                         cat >conftest.h <<EOF
3146 #define GCC_$cf_ATTRIBUTE 1
3147 EOF
3148                         ;;
3149                 (*)
3150                         cat >conftest.h <<EOF
3151 #define GCC_$cf_ATTRIBUTE $cf_directive
3152 EOF
3153                         ;;
3154                 esac
3155
3156                 if { (eval echo "$as_me:3156: \"$ac_compile\"") >&5
3157   (eval $ac_compile) 2>&5
3158   ac_status=$?
3159   echo "$as_me:3159: \$? = $ac_status" >&5
3160   (exit $ac_status); }; then
3161                         test -n "$verbose" && echo "$as_me:3161: result: ... $cf_attribute" >&5
3162 echo "${ECHO_T}... $cf_attribute" >&6
3163                         cat conftest.h >>confdefs.h
3164                         case $cf_attribute in
3165                         (noreturn)
3166
3167 cat >>confdefs.h <<EOF
3168 #define GCC_NORETURN $cf_directive
3169 EOF
3170
3171                                 ;;
3172                         (printf)
3173                                 cf_value='/* nothing */'
3174                                 if test "$cf_printf_attribute" != no ; then
3175                                         cf_value='__attribute__((format(printf,fmt,var)))'
3176
3177 cat >>confdefs.h <<\EOF
3178 #define GCC_PRINTF 1
3179 EOF
3180
3181                                 fi
3182
3183 cat >>confdefs.h <<EOF
3184 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3185 EOF
3186
3187                                 ;;
3188                         (scanf)
3189                                 cf_value='/* nothing */'
3190                                 if test "$cf_scanf_attribute" != no ; then
3191                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3192
3193 cat >>confdefs.h <<\EOF
3194 #define GCC_SCANF 1
3195 EOF
3196
3197                                 fi
3198
3199 cat >>confdefs.h <<EOF
3200 #define GCC_SCANFLIKE(fmt,var) $cf_value
3201 EOF
3202
3203                                 ;;
3204                         (unused)
3205
3206 cat >>confdefs.h <<EOF
3207 #define GCC_UNUSED $cf_directive
3208 EOF
3209
3210                                 ;;
3211                         esac
3212                 fi
3213         done
3214 else
3215         fgrep define conftest.i >>confdefs.h
3216 fi
3217 rm -rf conftest*
3218 fi
3219
3220 echo "$as_me:3220: checking if you want to work around bogus compiler/loader warnings" >&5
3221 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3222
3223 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3224 if test "${enable_string_hacks+set}" = set; then
3225   enableval="$enable_string_hacks"
3226   with_string_hacks=$enableval
3227 else
3228   with_string_hacks=no
3229 fi;
3230 echo "$as_me:3230: result: $with_string_hacks" >&5
3231 echo "${ECHO_T}$with_string_hacks" >&6
3232
3233 if test "x$with_string_hacks" = "xyes"; then
3234
3235 cat >>confdefs.h <<\EOF
3236 #define USE_STRING_HACKS 1
3237 EOF
3238
3239         { echo "$as_me:3239: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3240 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3241         echo "$as_me:3241: checking for strlcat" >&5
3242 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3243 if test "${ac_cv_func_strlcat+set}" = set; then
3244   echo $ECHO_N "(cached) $ECHO_C" >&6
3245 else
3246   cat >conftest.$ac_ext <<_ACEOF
3247 #line 3247 "configure"
3248 #include "confdefs.h"
3249 #define strlcat autoconf_temporary
3250 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3251 #undef strlcat
3252
3253 #ifdef __cplusplus
3254 extern "C"
3255 #endif
3256
3257 /* We use char because int might match the return type of a gcc2
3258    builtin and then its argument prototype would still apply.  */
3259 char strlcat (void);
3260
3261 int
3262 main (void)
3263 {
3264
3265 /* The GNU C library defines stubs for functions which it implements
3266     to always fail with ENOSYS.  Some functions are actually named
3267     something starting with __ and the normal name is an alias.  */
3268 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3269 #error found stub for strlcat
3270 #endif
3271
3272         return strlcat ();
3273   ;
3274   return 0;
3275 }
3276 _ACEOF
3277 rm -f conftest.$ac_objext conftest$ac_exeext
3278 if { (eval echo "$as_me:3278: \"$ac_link\"") >&5
3279   (eval $ac_link) 2>&5
3280   ac_status=$?
3281   echo "$as_me:3281: \$? = $ac_status" >&5
3282   (exit $ac_status); } &&
3283          { ac_try='test -s conftest$ac_exeext'
3284   { (eval echo "$as_me:3284: \"$ac_try\"") >&5
3285   (eval $ac_try) 2>&5
3286   ac_status=$?
3287   echo "$as_me:3287: \$? = $ac_status" >&5
3288   (exit $ac_status); }; }; then
3289   ac_cv_func_strlcat=yes
3290 else
3291   echo "$as_me: failed program was:" >&5
3292 cat conftest.$ac_ext >&5
3293 ac_cv_func_strlcat=no
3294 fi
3295 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3296 fi
3297 echo "$as_me:3297: result: $ac_cv_func_strlcat" >&5
3298 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3299 if test $ac_cv_func_strlcat = yes; then
3300
3301 cat >>confdefs.h <<\EOF
3302 #define HAVE_STRLCAT 1
3303 EOF
3304
3305 else
3306
3307                 echo "$as_me:3307: checking for strlcat in -lbsd" >&5
3308 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3309 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3310   echo $ECHO_N "(cached) $ECHO_C" >&6
3311 else
3312   ac_check_lib_save_LIBS=$LIBS
3313 LIBS="-lbsd  $LIBS"
3314 cat >conftest.$ac_ext <<_ACEOF
3315 #line 3315 "configure"
3316 #include "confdefs.h"
3317
3318 /* Override any gcc2 internal prototype to avoid an error.  */
3319 #ifdef __cplusplus
3320 extern "C"
3321 #endif
3322 /* We use char because int might match the return type of a gcc2
3323    builtin and then its argument prototype would still apply.  */
3324 char strlcat ();
3325 int
3326 main (void)
3327 {
3328 strlcat ();
3329   ;
3330   return 0;
3331 }
3332 _ACEOF
3333 rm -f conftest.$ac_objext conftest$ac_exeext
3334 if { (eval echo "$as_me:3334: \"$ac_link\"") >&5
3335   (eval $ac_link) 2>&5
3336   ac_status=$?
3337   echo "$as_me:3337: \$? = $ac_status" >&5
3338   (exit $ac_status); } &&
3339          { ac_try='test -s conftest$ac_exeext'
3340   { (eval echo "$as_me:3340: \"$ac_try\"") >&5
3341   (eval $ac_try) 2>&5
3342   ac_status=$?
3343   echo "$as_me:3343: \$? = $ac_status" >&5
3344   (exit $ac_status); }; }; then
3345   ac_cv_lib_bsd_strlcat=yes
3346 else
3347   echo "$as_me: failed program was:" >&5
3348 cat conftest.$ac_ext >&5
3349 ac_cv_lib_bsd_strlcat=no
3350 fi
3351 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3352 LIBS=$ac_check_lib_save_LIBS
3353 fi
3354 echo "$as_me:3354: result: $ac_cv_lib_bsd_strlcat" >&5
3355 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3356 if test $ac_cv_lib_bsd_strlcat = yes; then
3357
3358 cf_add_libs="$LIBS"
3359 # reverse order
3360 cf_add_0lib=
3361 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3362 # filter duplicates
3363 for cf_add_1lib in $cf_add_0lib; do
3364         for cf_add_2lib in $cf_add_libs; do
3365                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3366                         cf_add_1lib=
3367                         break
3368                 fi
3369         done
3370         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3371 done
3372 LIBS="$cf_add_libs"
3373
3374 for ac_header in bsd/string.h
3375 do
3376 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3377 echo "$as_me:3377: checking for $ac_header" >&5
3378 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3379 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3380   echo $ECHO_N "(cached) $ECHO_C" >&6
3381 else
3382   cat >conftest.$ac_ext <<_ACEOF
3383 #line 3383 "configure"
3384 #include "confdefs.h"
3385 #include <$ac_header>
3386 _ACEOF
3387 if { (eval echo "$as_me:3387: \"$ac_cpp conftest.$ac_ext\"") >&5
3388   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3389   ac_status=$?
3390   egrep -v '^ *\+' conftest.er1 >conftest.err
3391   rm -f conftest.er1
3392   cat conftest.err >&5
3393   echo "$as_me:3393: \$? = $ac_status" >&5
3394   (exit $ac_status); } >/dev/null; then
3395   if test -s conftest.err; then
3396     ac_cpp_err=$ac_c_preproc_warn_flag
3397   else
3398     ac_cpp_err=
3399   fi
3400 else
3401   ac_cpp_err=yes
3402 fi
3403 if test -z "$ac_cpp_err"; then
3404   eval "$as_ac_Header=yes"
3405 else
3406   echo "$as_me: failed program was:" >&5
3407   cat conftest.$ac_ext >&5
3408   eval "$as_ac_Header=no"
3409 fi
3410 rm -f conftest.err conftest.$ac_ext
3411 fi
3412 echo "$as_me:3412: result: `eval echo '${'$as_ac_Header'}'`" >&5
3413 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3414 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3415   cat >>confdefs.h <<EOF
3416 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3417 EOF
3418
3419 fi
3420 done
3421
3422 cat >>confdefs.h <<\EOF
3423 #define HAVE_STRLCAT 1
3424 EOF
3425
3426 fi
3427
3428 fi
3429
3430 for ac_func in strlcpy snprintf
3431 do
3432 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3433 echo "$as_me:3433: checking for $ac_func" >&5
3434 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3435 if eval "test \"\${$as_ac_var+set}\" = set"; then
3436   echo $ECHO_N "(cached) $ECHO_C" >&6
3437 else
3438   cat >conftest.$ac_ext <<_ACEOF
3439 #line 3439 "configure"
3440 #include "confdefs.h"
3441 #define $ac_func autoconf_temporary
3442 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3443 #undef $ac_func
3444
3445 #ifdef __cplusplus
3446 extern "C"
3447 #endif
3448
3449 /* We use char because int might match the return type of a gcc2
3450    builtin and then its argument prototype would still apply.  */
3451 char $ac_func (void);
3452
3453 int
3454 main (void)
3455 {
3456
3457 /* The GNU C library defines stubs for functions which it implements
3458     to always fail with ENOSYS.  Some functions are actually named
3459     something starting with __ and the normal name is an alias.  */
3460 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3461 #error found stub for $ac_func
3462 #endif
3463
3464         return $ac_func ();
3465   ;
3466   return 0;
3467 }
3468 _ACEOF
3469 rm -f conftest.$ac_objext conftest$ac_exeext
3470 if { (eval echo "$as_me:3470: \"$ac_link\"") >&5
3471   (eval $ac_link) 2>&5
3472   ac_status=$?
3473   echo "$as_me:3473: \$? = $ac_status" >&5
3474   (exit $ac_status); } &&
3475          { ac_try='test -s conftest$ac_exeext'
3476   { (eval echo "$as_me:3476: \"$ac_try\"") >&5
3477   (eval $ac_try) 2>&5
3478   ac_status=$?
3479   echo "$as_me:3479: \$? = $ac_status" >&5
3480   (exit $ac_status); }; }; then
3481   eval "$as_ac_var=yes"
3482 else
3483   echo "$as_me: failed program was:" >&5
3484 cat conftest.$ac_ext >&5
3485 eval "$as_ac_var=no"
3486 fi
3487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3488 fi
3489 echo "$as_me:3489: result: `eval echo '${'$as_ac_var'}'`" >&5
3490 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3491 if test `eval echo '${'$as_ac_var'}'` = yes; then
3492   cat >>confdefs.h <<EOF
3493 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3494 EOF
3495
3496 fi
3497 done
3498
3499 fi
3500
3501 echo "$as_me:3501: checking if the POSIX test-macros are already defined" >&5
3502 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3503 if test "${cf_cv_posix_visible+set}" = set; then
3504   echo $ECHO_N "(cached) $ECHO_C" >&6
3505 else
3506
3507 cat >conftest.$ac_ext <<_ACEOF
3508 #line 3508 "configure"
3509 #include "confdefs.h"
3510 #include <stdio.h>
3511 int
3512 main (void)
3513 {
3514
3515 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3516         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3517         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3518         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3519 #error conflicting symbols found
3520 #endif
3521
3522   ;
3523   return 0;
3524 }
3525 _ACEOF
3526 rm -f conftest.$ac_objext
3527 if { (eval echo "$as_me:3527: \"$ac_compile\"") >&5
3528   (eval $ac_compile) 2>&5
3529   ac_status=$?
3530   echo "$as_me:3530: \$? = $ac_status" >&5
3531   (exit $ac_status); } &&
3532          { ac_try='test -s conftest.$ac_objext'
3533   { (eval echo "$as_me:3533: \"$ac_try\"") >&5
3534   (eval $ac_try) 2>&5
3535   ac_status=$?
3536   echo "$as_me:3536: \$? = $ac_status" >&5
3537   (exit $ac_status); }; }; then
3538   cf_cv_posix_visible=no
3539 else
3540   echo "$as_me: failed program was:" >&5
3541 cat conftest.$ac_ext >&5
3542 cf_cv_posix_visible=yes
3543 fi
3544 rm -f conftest.$ac_objext conftest.$ac_ext
3545
3546 fi
3547 echo "$as_me:3547: result: $cf_cv_posix_visible" >&5
3548 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3549
3550 if test "$cf_cv_posix_visible" = no; then
3551
3552 cf_XOPEN_SOURCE=600
3553 cf_POSIX_C_SOURCE=199506L
3554 cf_xopen_source=
3555
3556 case $host_os in
3557 (aix[4-7]*)
3558         cf_xopen_source="-D_ALL_SOURCE"
3559         ;;
3560 (msys)
3561         cf_XOPEN_SOURCE=600
3562         ;;
3563 (darwin[0-8].*)
3564         cf_xopen_source="-D_APPLE_C_SOURCE"
3565         ;;
3566 (darwin*)
3567         cf_xopen_source="-D_DARWIN_C_SOURCE"
3568         cf_XOPEN_SOURCE=
3569         ;;
3570 (freebsd*|dragonfly*|midnightbsd*)
3571         # 5.x headers associate
3572         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3573         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3574         cf_POSIX_C_SOURCE=200112L
3575         cf_XOPEN_SOURCE=600
3576         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3577         ;;
3578 (hpux11*)
3579         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3580         ;;
3581 (hpux*)
3582         cf_xopen_source="-D_HPUX_SOURCE"
3583         ;;
3584 (irix[56].*)
3585         cf_xopen_source="-D_SGI_SOURCE"
3586         cf_XOPEN_SOURCE=
3587         ;;
3588 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3589
3590 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3591
3592 echo "$as_me:3592: checking if this is the GNU C library" >&5
3593 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3594 if test "${cf_cv_gnu_library+set}" = set; then
3595   echo $ECHO_N "(cached) $ECHO_C" >&6
3596 else
3597
3598 cat >conftest.$ac_ext <<_ACEOF
3599 #line 3599 "configure"
3600 #include "confdefs.h"
3601 #include <sys/types.h>
3602 int
3603 main (void)
3604 {
3605
3606         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3607                 return 0;
3608         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3609                 return 0;
3610         #else
3611         #       error not GNU C library
3612         #endif
3613   ;
3614   return 0;
3615 }
3616 _ACEOF
3617 rm -f conftest.$ac_objext
3618 if { (eval echo "$as_me:3618: \"$ac_compile\"") >&5
3619   (eval $ac_compile) 2>&5
3620   ac_status=$?
3621   echo "$as_me:3621: \$? = $ac_status" >&5
3622   (exit $ac_status); } &&
3623          { ac_try='test -s conftest.$ac_objext'
3624   { (eval echo "$as_me:3624: \"$ac_try\"") >&5
3625   (eval $ac_try) 2>&5
3626   ac_status=$?
3627   echo "$as_me:3627: \$? = $ac_status" >&5
3628   (exit $ac_status); }; }; then
3629   cf_cv_gnu_library=yes
3630 else
3631   echo "$as_me: failed program was:" >&5
3632 cat conftest.$ac_ext >&5
3633 cf_cv_gnu_library=no
3634 fi
3635 rm -f conftest.$ac_objext conftest.$ac_ext
3636
3637 fi
3638 echo "$as_me:3638: result: $cf_cv_gnu_library" >&5
3639 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3640
3641 if test x$cf_cv_gnu_library = xyes; then
3642
3643         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3644         # was changed to help a little.  newlib incorporated the change about 4
3645         # years later.
3646         echo "$as_me:3646: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3647 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3648 if test "${cf_cv_gnu_library_219+set}" = set; then
3649   echo $ECHO_N "(cached) $ECHO_C" >&6
3650 else
3651
3652                 cf_save="$CPPFLAGS"
3653
3654         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3655         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3656
3657                 cat >conftest.$ac_ext <<_ACEOF
3658 #line 3658 "configure"
3659 #include "confdefs.h"
3660 #include <sys/types.h>
3661 int
3662 main (void)
3663 {
3664
3665                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3666                                 return 0;
3667                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3668                                 return 0;
3669                         #else
3670                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3671                         #endif
3672   ;
3673   return 0;
3674 }
3675 _ACEOF
3676 rm -f conftest.$ac_objext
3677 if { (eval echo "$as_me:3677: \"$ac_compile\"") >&5
3678   (eval $ac_compile) 2>&5
3679   ac_status=$?
3680   echo "$as_me:3680: \$? = $ac_status" >&5
3681   (exit $ac_status); } &&
3682          { ac_try='test -s conftest.$ac_objext'
3683   { (eval echo "$as_me:3683: \"$ac_try\"") >&5
3684   (eval $ac_try) 2>&5
3685   ac_status=$?
3686   echo "$as_me:3686: \$? = $ac_status" >&5
3687   (exit $ac_status); }; }; then
3688   cf_cv_gnu_library_219=yes
3689 else
3690   echo "$as_me: failed program was:" >&5
3691 cat conftest.$ac_ext >&5
3692 cf_cv_gnu_library_219=no
3693 fi
3694 rm -f conftest.$ac_objext conftest.$ac_ext
3695                 CPPFLAGS="$cf_save"
3696
3697 fi
3698 echo "$as_me:3698: result: $cf_cv_gnu_library_219" >&5
3699 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3700
3701         if test "x$cf_cv_gnu_library_219" = xyes; then
3702                 cf_save="$CPPFLAGS"
3703                 echo "$as_me:3703: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3704 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3705 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3706   echo $ECHO_N "(cached) $ECHO_C" >&6
3707 else
3708
3709 cf_fix_cppflags=no
3710 cf_new_cflags=
3711 cf_new_cppflags=
3712 cf_new_extra_cppflags=
3713
3714 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3715 do
3716 case $cf_fix_cppflags in
3717 (no)
3718         case $cf_add_cflags in
3719         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3720                 case $cf_add_cflags in
3721                 (-D*)
3722                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3723
3724                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3725                                 && test -z "${cf_tst_cflags}" \
3726                                 && cf_fix_cppflags=yes
3727
3728                         if test $cf_fix_cppflags = yes ; then
3729
3730         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3731         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3732
3733                                 continue
3734                         elif test "${cf_tst_cflags}" = "\"'" ; then
3735
3736         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3737         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3738
3739                                 continue
3740                         fi
3741                         ;;
3742                 esac
3743                 case "$CPPFLAGS" in
3744                 (*$cf_add_cflags)
3745                         ;;
3746                 (*)
3747                         case $cf_add_cflags in
3748                         (-D*)
3749                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3750
3751 CPPFLAGS=`echo "$CPPFLAGS" | \
3752         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3753                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3754
3755                                 ;;
3756                         esac
3757
3758         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3759         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3760
3761                         ;;
3762                 esac
3763                 ;;
3764         (*)
3765
3766         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3767         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3768
3769                 ;;
3770         esac
3771         ;;
3772 (yes)
3773
3774         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3775         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3776
3777         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3778
3779         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3780                 && test -z "${cf_tst_cflags}" \
3781                 && cf_fix_cppflags=no
3782         ;;
3783 esac
3784 done
3785
3786 if test -n "$cf_new_cflags" ; then
3787
3788         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3789         CFLAGS="${CFLAGS}$cf_new_cflags"
3790
3791 fi
3792
3793 if test -n "$cf_new_cppflags" ; then
3794
3795         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3796         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3797
3798 fi
3799
3800 if test -n "$cf_new_extra_cppflags" ; then
3801
3802         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3803         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3804
3805 fi
3806
3807                         cat >conftest.$ac_ext <<_ACEOF
3808 #line 3808 "configure"
3809 #include "confdefs.h"
3810
3811                                 #include <limits.h>
3812                                 #include <sys/types.h>
3813
3814 int
3815 main (void)
3816 {
3817
3818                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3819                                         return 0;
3820                                 #else
3821                                 #       error GNU C library is too old
3822                                 #endif
3823   ;
3824   return 0;
3825 }
3826 _ACEOF
3827 rm -f conftest.$ac_objext
3828 if { (eval echo "$as_me:3828: \"$ac_compile\"") >&5
3829   (eval $ac_compile) 2>&5
3830   ac_status=$?
3831   echo "$as_me:3831: \$? = $ac_status" >&5
3832   (exit $ac_status); } &&
3833          { ac_try='test -s conftest.$ac_objext'
3834   { (eval echo "$as_me:3834: \"$ac_try\"") >&5
3835   (eval $ac_try) 2>&5
3836   ac_status=$?
3837   echo "$as_me:3837: \$? = $ac_status" >&5
3838   (exit $ac_status); }; }; then
3839   cf_cv_gnu_dftsrc_219=yes
3840 else
3841   echo "$as_me: failed program was:" >&5
3842 cat conftest.$ac_ext >&5
3843 cf_cv_gnu_dftsrc_219=no
3844 fi
3845 rm -f conftest.$ac_objext conftest.$ac_ext
3846
3847 fi
3848 echo "$as_me:3848: result: $cf_cv_gnu_dftsrc_219" >&5
3849 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3850                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3851         else
3852                 cf_cv_gnu_dftsrc_219=maybe
3853         fi
3854
3855         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3856
3857                 echo "$as_me:3857: checking if we must define _GNU_SOURCE" >&5
3858 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3859 if test "${cf_cv_gnu_source+set}" = set; then
3860   echo $ECHO_N "(cached) $ECHO_C" >&6
3861 else
3862
3863                 cat >conftest.$ac_ext <<_ACEOF
3864 #line 3864 "configure"
3865 #include "confdefs.h"
3866 #include <sys/types.h>
3867 int
3868 main (void)
3869 {
3870
3871                         #ifndef _XOPEN_SOURCE
3872                         #error  expected _XOPEN_SOURCE to be defined
3873                         #endif
3874   ;
3875   return 0;
3876 }
3877 _ACEOF
3878 rm -f conftest.$ac_objext
3879 if { (eval echo "$as_me:3879: \"$ac_compile\"") >&5
3880   (eval $ac_compile) 2>&5
3881   ac_status=$?
3882   echo "$as_me:3882: \$? = $ac_status" >&5
3883   (exit $ac_status); } &&
3884          { ac_try='test -s conftest.$ac_objext'
3885   { (eval echo "$as_me:3885: \"$ac_try\"") >&5
3886   (eval $ac_try) 2>&5
3887   ac_status=$?
3888   echo "$as_me:3888: \$? = $ac_status" >&5
3889   (exit $ac_status); }; }; then
3890   cf_cv_gnu_source=no
3891 else
3892   echo "$as_me: failed program was:" >&5
3893 cat conftest.$ac_ext >&5
3894 cf_save="$CPPFLAGS"
3895
3896 cf_fix_cppflags=no
3897 cf_new_cflags=
3898 cf_new_cppflags=
3899 cf_new_extra_cppflags=
3900
3901 for cf_add_cflags in -D_GNU_SOURCE
3902 do
3903 case $cf_fix_cppflags in
3904 (no)
3905         case $cf_add_cflags in
3906         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3907                 case $cf_add_cflags in
3908                 (-D*)
3909                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3910
3911                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3912                                 && test -z "${cf_tst_cflags}" \
3913                                 && cf_fix_cppflags=yes
3914
3915                         if test $cf_fix_cppflags = yes ; then
3916
3917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3919
3920                                 continue
3921                         elif test "${cf_tst_cflags}" = "\"'" ; then
3922
3923         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3924         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3925
3926                                 continue
3927                         fi
3928                         ;;
3929                 esac
3930                 case "$CPPFLAGS" in
3931                 (*$cf_add_cflags)
3932                         ;;
3933                 (*)
3934                         case $cf_add_cflags in
3935                         (-D*)
3936                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3937
3938 CPPFLAGS=`echo "$CPPFLAGS" | \
3939         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3940                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3941
3942                                 ;;
3943                         esac
3944
3945         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3946         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3947
3948                         ;;
3949                 esac
3950                 ;;
3951         (*)
3952
3953         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3954         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3955
3956                 ;;
3957         esac
3958         ;;
3959 (yes)
3960
3961         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3962         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3963
3964         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3965
3966         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3967                 && test -z "${cf_tst_cflags}" \
3968                 && cf_fix_cppflags=no
3969         ;;
3970 esac
3971 done
3972
3973 if test -n "$cf_new_cflags" ; then
3974
3975         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3976         CFLAGS="${CFLAGS}$cf_new_cflags"
3977
3978 fi
3979
3980 if test -n "$cf_new_cppflags" ; then
3981
3982         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3983         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3984
3985 fi
3986
3987 if test -n "$cf_new_extra_cppflags" ; then
3988
3989         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3990         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3991
3992 fi
3993
3994                          cat >conftest.$ac_ext <<_ACEOF
3995 #line 3995 "configure"
3996 #include "confdefs.h"
3997 #include <sys/types.h>
3998 int
3999 main (void)
4000 {
4001
4002                                 #ifdef _XOPEN_SOURCE
4003                                 #error  expected _XOPEN_SOURCE to be undefined
4004                                 #endif
4005   ;
4006   return 0;
4007 }
4008 _ACEOF
4009 rm -f conftest.$ac_objext
4010 if { (eval echo "$as_me:4010: \"$ac_compile\"") >&5
4011   (eval $ac_compile) 2>&5
4012   ac_status=$?
4013   echo "$as_me:4013: \$? = $ac_status" >&5
4014   (exit $ac_status); } &&
4015          { ac_try='test -s conftest.$ac_objext'
4016   { (eval echo "$as_me:4016: \"$ac_try\"") >&5
4017   (eval $ac_try) 2>&5
4018   ac_status=$?
4019   echo "$as_me:4019: \$? = $ac_status" >&5
4020   (exit $ac_status); }; }; then
4021   cf_cv_gnu_source=no
4022 else
4023   echo "$as_me: failed program was:" >&5
4024 cat conftest.$ac_ext >&5
4025 cf_cv_gnu_source=yes
4026 fi
4027 rm -f conftest.$ac_objext conftest.$ac_ext
4028                         CPPFLAGS="$cf_save"
4029
4030 fi
4031 rm -f conftest.$ac_objext conftest.$ac_ext
4032
4033 fi
4034 echo "$as_me:4034: result: $cf_cv_gnu_source" >&5
4035 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4036
4037                 if test "$cf_cv_gnu_source" = yes
4038                 then
4039                 echo "$as_me:4039: checking if we should also define _DEFAULT_SOURCE" >&5
4040 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4041 if test "${cf_cv_default_source+set}" = set; then
4042   echo $ECHO_N "(cached) $ECHO_C" >&6
4043 else
4044
4045         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4046         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4047
4048                         cat >conftest.$ac_ext <<_ACEOF
4049 #line 4049 "configure"
4050 #include "confdefs.h"
4051 #include <sys/types.h>
4052 int
4053 main (void)
4054 {
4055
4056                                 #ifdef _DEFAULT_SOURCE
4057                                 #error  expected _DEFAULT_SOURCE to be undefined
4058                                 #endif
4059   ;
4060   return 0;
4061 }
4062 _ACEOF
4063 rm -f conftest.$ac_objext
4064 if { (eval echo "$as_me:4064: \"$ac_compile\"") >&5
4065   (eval $ac_compile) 2>&5
4066   ac_status=$?
4067   echo "$as_me:4067: \$? = $ac_status" >&5
4068   (exit $ac_status); } &&
4069          { ac_try='test -s conftest.$ac_objext'
4070   { (eval echo "$as_me:4070: \"$ac_try\"") >&5
4071   (eval $ac_try) 2>&5
4072   ac_status=$?
4073   echo "$as_me:4073: \$? = $ac_status" >&5
4074   (exit $ac_status); }; }; then
4075   cf_cv_default_source=no
4076 else
4077   echo "$as_me: failed program was:" >&5
4078 cat conftest.$ac_ext >&5
4079 cf_cv_default_source=yes
4080 fi
4081 rm -f conftest.$ac_objext conftest.$ac_ext
4082
4083 fi
4084 echo "$as_me:4084: result: $cf_cv_default_source" >&5
4085 echo "${ECHO_T}$cf_cv_default_source" >&6
4086                         if test "$cf_cv_default_source" = yes
4087                         then
4088
4089         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4090         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4091
4092                         fi
4093                 fi
4094         fi
4095
4096 fi
4097
4098         ;;
4099 (minix*)
4100         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4101         ;;
4102 (mirbsd*)
4103         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4104         cf_XOPEN_SOURCE=
4105
4106 if test "$cf_cv_posix_visible" = no; then
4107
4108 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4109
4110 cf_save_CFLAGS="$CFLAGS"
4111 cf_save_CPPFLAGS="$CPPFLAGS"
4112
4113 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4114         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4115                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4116
4117 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4118         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4119                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4120
4121 echo "$as_me:4121: checking if we should define _POSIX_C_SOURCE" >&5
4122 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4123 if test "${cf_cv_posix_c_source+set}" = set; then
4124   echo $ECHO_N "(cached) $ECHO_C" >&6
4125 else
4126
4127 echo "${as_me:-configure}:4127: testing if the symbol is already defined go no further ..." 1>&5
4128
4129         cat >conftest.$ac_ext <<_ACEOF
4130 #line 4130 "configure"
4131 #include "confdefs.h"
4132 #include <sys/types.h>
4133 int
4134 main (void)
4135 {
4136
4137 #ifndef _POSIX_C_SOURCE
4138 make an error
4139 #endif
4140   ;
4141   return 0;
4142 }
4143 _ACEOF
4144 rm -f conftest.$ac_objext
4145 if { (eval echo "$as_me:4145: \"$ac_compile\"") >&5
4146   (eval $ac_compile) 2>&5
4147   ac_status=$?
4148   echo "$as_me:4148: \$? = $ac_status" >&5
4149   (exit $ac_status); } &&
4150          { ac_try='test -s conftest.$ac_objext'
4151   { (eval echo "$as_me:4151: \"$ac_try\"") >&5
4152   (eval $ac_try) 2>&5
4153   ac_status=$?
4154   echo "$as_me:4154: \$? = $ac_status" >&5
4155   (exit $ac_status); }; }; then
4156   cf_cv_posix_c_source=no
4157 else
4158   echo "$as_me: failed program was:" >&5
4159 cat conftest.$ac_ext >&5
4160 cf_want_posix_source=no
4161          case .$cf_POSIX_C_SOURCE in
4162          (.[12]??*)
4163                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4164                 ;;
4165          (.2)
4166                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4167                 cf_want_posix_source=yes
4168                 ;;
4169          (.*)
4170                 cf_want_posix_source=yes
4171                 ;;
4172          esac
4173          if test "$cf_want_posix_source" = yes ; then
4174                 cat >conftest.$ac_ext <<_ACEOF
4175 #line 4175 "configure"
4176 #include "confdefs.h"
4177 #include <sys/types.h>
4178 int
4179 main (void)
4180 {
4181
4182 #ifdef _POSIX_SOURCE
4183 make an error
4184 #endif
4185   ;
4186   return 0;
4187 }
4188 _ACEOF
4189 rm -f conftest.$ac_objext
4190 if { (eval echo "$as_me:4190: \"$ac_compile\"") >&5
4191   (eval $ac_compile) 2>&5
4192   ac_status=$?
4193   echo "$as_me:4193: \$? = $ac_status" >&5
4194   (exit $ac_status); } &&
4195          { ac_try='test -s conftest.$ac_objext'
4196   { (eval echo "$as_me:4196: \"$ac_try\"") >&5
4197   (eval $ac_try) 2>&5
4198   ac_status=$?
4199   echo "$as_me:4199: \$? = $ac_status" >&5
4200   (exit $ac_status); }; }; then
4201   :
4202 else
4203   echo "$as_me: failed program was:" >&5
4204 cat conftest.$ac_ext >&5
4205 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4206 fi
4207 rm -f conftest.$ac_objext conftest.$ac_ext
4208          fi
4209
4210 echo "${as_me:-configure}:4210: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4211
4212          CFLAGS="$cf_trim_CFLAGS"
4213          CPPFLAGS="$cf_trim_CPPFLAGS"
4214
4215         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4216         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4217
4218 echo "${as_me:-configure}:4218: testing if the second compile does not leave our definition intact error ..." 1>&5
4219
4220          cat >conftest.$ac_ext <<_ACEOF
4221 #line 4221 "configure"
4222 #include "confdefs.h"
4223 #include <sys/types.h>
4224 int
4225 main (void)
4226 {
4227
4228 #ifndef _POSIX_C_SOURCE
4229 make an error
4230 #endif
4231   ;
4232   return 0;
4233 }
4234 _ACEOF
4235 rm -f conftest.$ac_objext
4236 if { (eval echo "$as_me:4236: \"$ac_compile\"") >&5
4237   (eval $ac_compile) 2>&5
4238   ac_status=$?
4239   echo "$as_me:4239: \$? = $ac_status" >&5
4240   (exit $ac_status); } &&
4241          { ac_try='test -s conftest.$ac_objext'
4242   { (eval echo "$as_me:4242: \"$ac_try\"") >&5
4243   (eval $ac_try) 2>&5
4244   ac_status=$?
4245   echo "$as_me:4245: \$? = $ac_status" >&5
4246   (exit $ac_status); }; }; then
4247   :
4248 else
4249   echo "$as_me: failed program was:" >&5
4250 cat conftest.$ac_ext >&5
4251 cf_cv_posix_c_source=no
4252 fi
4253 rm -f conftest.$ac_objext conftest.$ac_ext
4254          CFLAGS="$cf_save_CFLAGS"
4255          CPPFLAGS="$cf_save_CPPFLAGS"
4256
4257 fi
4258 rm -f conftest.$ac_objext conftest.$ac_ext
4259
4260 fi
4261 echo "$as_me:4261: result: $cf_cv_posix_c_source" >&5
4262 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4263
4264 if test "$cf_cv_posix_c_source" != no ; then
4265         CFLAGS="$cf_trim_CFLAGS"
4266         CPPFLAGS="$cf_trim_CPPFLAGS"
4267
4268 cf_fix_cppflags=no
4269 cf_new_cflags=
4270 cf_new_cppflags=
4271 cf_new_extra_cppflags=
4272
4273 for cf_add_cflags in $cf_cv_posix_c_source
4274 do
4275 case $cf_fix_cppflags in
4276 (no)
4277         case $cf_add_cflags in
4278         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4279                 case $cf_add_cflags in
4280                 (-D*)
4281                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4282
4283                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4284                                 && test -z "${cf_tst_cflags}" \
4285                                 && cf_fix_cppflags=yes
4286
4287                         if test $cf_fix_cppflags = yes ; then
4288
4289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4291
4292                                 continue
4293                         elif test "${cf_tst_cflags}" = "\"'" ; then
4294
4295         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4296         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4297
4298                                 continue
4299                         fi
4300                         ;;
4301                 esac
4302                 case "$CPPFLAGS" in
4303                 (*$cf_add_cflags)
4304                         ;;
4305                 (*)
4306                         case $cf_add_cflags in
4307                         (-D*)
4308                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4309
4310 CPPFLAGS=`echo "$CPPFLAGS" | \
4311         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4312                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4313
4314                                 ;;
4315                         esac
4316
4317         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4318         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4319
4320                         ;;
4321                 esac
4322                 ;;
4323         (*)
4324
4325         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4326         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4327
4328                 ;;
4329         esac
4330         ;;
4331 (yes)
4332
4333         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4334         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4335
4336         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4337
4338         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4339                 && test -z "${cf_tst_cflags}" \
4340                 && cf_fix_cppflags=no
4341         ;;
4342 esac
4343 done
4344
4345 if test -n "$cf_new_cflags" ; then
4346
4347         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4348         CFLAGS="${CFLAGS}$cf_new_cflags"
4349
4350 fi
4351
4352 if test -n "$cf_new_cppflags" ; then
4353
4354         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4355         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4356
4357 fi
4358
4359 if test -n "$cf_new_extra_cppflags" ; then
4360
4361         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4362         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4363
4364 fi
4365
4366 fi
4367
4368 fi # cf_cv_posix_visible
4369
4370         ;;
4371 (netbsd*)
4372         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4373         ;;
4374 (openbsd[4-9]*)
4375         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4376         cf_xopen_source="-D_BSD_SOURCE"
4377         cf_XOPEN_SOURCE=600
4378         ;;
4379 (openbsd*)
4380         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4381         ;;
4382 (osf[45]*)
4383         cf_xopen_source="-D_OSF_SOURCE"
4384         ;;
4385 (nto-qnx*)
4386         cf_xopen_source="-D_QNX_SOURCE"
4387         ;;
4388 (sco*)
4389         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4390         ;;
4391 (solaris2.*)
4392         cf_xopen_source="-D__EXTENSIONS__"
4393         cf_cv_xopen_source=broken
4394         ;;
4395 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4396         cf_XOPEN_SOURCE=
4397         cf_POSIX_C_SOURCE=
4398         ;;
4399 (*)
4400
4401 echo "$as_me:4401: checking if we should define _XOPEN_SOURCE" >&5
4402 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4403 if test "${cf_cv_xopen_source+set}" = set; then
4404   echo $ECHO_N "(cached) $ECHO_C" >&6
4405 else
4406
4407         cat >conftest.$ac_ext <<_ACEOF
4408 #line 4408 "configure"
4409 #include "confdefs.h"
4410
4411 #include <stdlib.h>
4412 #include <string.h>
4413 #include <sys/types.h>
4414
4415 int
4416 main (void)
4417 {
4418
4419 #ifndef _XOPEN_SOURCE
4420 make an error
4421 #endif
4422   ;
4423   return 0;
4424 }
4425 _ACEOF
4426 rm -f conftest.$ac_objext
4427 if { (eval echo "$as_me:4427: \"$ac_compile\"") >&5
4428   (eval $ac_compile) 2>&5
4429   ac_status=$?
4430   echo "$as_me:4430: \$? = $ac_status" >&5
4431   (exit $ac_status); } &&
4432          { ac_try='test -s conftest.$ac_objext'
4433   { (eval echo "$as_me:4433: \"$ac_try\"") >&5
4434   (eval $ac_try) 2>&5
4435   ac_status=$?
4436   echo "$as_me:4436: \$? = $ac_status" >&5
4437   (exit $ac_status); }; }; then
4438   cf_cv_xopen_source=no
4439 else
4440   echo "$as_me: failed program was:" >&5
4441 cat conftest.$ac_ext >&5
4442 cf_save="$CPPFLAGS"
4443
4444         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4445         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4446
4447          cat >conftest.$ac_ext <<_ACEOF
4448 #line 4448 "configure"
4449 #include "confdefs.h"
4450
4451 #include <stdlib.h>
4452 #include <string.h>
4453 #include <sys/types.h>
4454
4455 int
4456 main (void)
4457 {
4458
4459 #ifdef _XOPEN_SOURCE
4460 make an error
4461 #endif
4462   ;
4463   return 0;
4464 }
4465 _ACEOF
4466 rm -f conftest.$ac_objext
4467 if { (eval echo "$as_me:4467: \"$ac_compile\"") >&5
4468   (eval $ac_compile) 2>&5
4469   ac_status=$?
4470   echo "$as_me:4470: \$? = $ac_status" >&5
4471   (exit $ac_status); } &&
4472          { ac_try='test -s conftest.$ac_objext'
4473   { (eval echo "$as_me:4473: \"$ac_try\"") >&5
4474   (eval $ac_try) 2>&5
4475   ac_status=$?
4476   echo "$as_me:4476: \$? = $ac_status" >&5
4477   (exit $ac_status); }; }; then
4478   cf_cv_xopen_source=no
4479 else
4480   echo "$as_me: failed program was:" >&5
4481 cat conftest.$ac_ext >&5
4482 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4483 fi
4484 rm -f conftest.$ac_objext conftest.$ac_ext
4485         CPPFLAGS="$cf_save"
4486
4487 fi
4488 rm -f conftest.$ac_objext conftest.$ac_ext
4489
4490 fi
4491 echo "$as_me:4491: result: $cf_cv_xopen_source" >&5
4492 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4493
4494 if test "$cf_cv_xopen_source" != no ; then
4495
4496 CFLAGS=`echo "$CFLAGS" | \
4497         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4498                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4499
4500 CPPFLAGS=`echo "$CPPFLAGS" | \
4501         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4502                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4503
4504         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4505
4506 cf_fix_cppflags=no
4507 cf_new_cflags=
4508 cf_new_cppflags=
4509 cf_new_extra_cppflags=
4510
4511 for cf_add_cflags in $cf_temp_xopen_source
4512 do
4513 case $cf_fix_cppflags in
4514 (no)
4515         case $cf_add_cflags in
4516         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4517                 case $cf_add_cflags in
4518                 (-D*)
4519                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4520
4521                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4522                                 && test -z "${cf_tst_cflags}" \
4523                                 && cf_fix_cppflags=yes
4524
4525                         if test $cf_fix_cppflags = yes ; then
4526
4527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4529
4530                                 continue
4531                         elif test "${cf_tst_cflags}" = "\"'" ; then
4532
4533         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4534         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4535
4536                                 continue
4537                         fi
4538                         ;;
4539                 esac
4540                 case "$CPPFLAGS" in
4541                 (*$cf_add_cflags)
4542                         ;;
4543                 (*)
4544                         case $cf_add_cflags in
4545                         (-D*)
4546                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4547
4548 CPPFLAGS=`echo "$CPPFLAGS" | \
4549         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4550                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4551
4552                                 ;;
4553                         esac
4554
4555         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4556         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4557
4558                         ;;
4559                 esac
4560                 ;;
4561         (*)
4562
4563         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4564         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4565
4566                 ;;
4567         esac
4568         ;;
4569 (yes)
4570
4571         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4572         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4573
4574         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4575
4576         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4577                 && test -z "${cf_tst_cflags}" \
4578                 && cf_fix_cppflags=no
4579         ;;
4580 esac
4581 done
4582
4583 if test -n "$cf_new_cflags" ; then
4584
4585         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4586         CFLAGS="${CFLAGS}$cf_new_cflags"
4587
4588 fi
4589
4590 if test -n "$cf_new_cppflags" ; then
4591
4592         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4593         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4594
4595 fi
4596
4597 if test -n "$cf_new_extra_cppflags" ; then
4598
4599         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4600         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4601
4602 fi
4603
4604 fi
4605
4606 if test "$cf_cv_posix_visible" = no; then
4607
4608 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4609
4610 cf_save_CFLAGS="$CFLAGS"
4611 cf_save_CPPFLAGS="$CPPFLAGS"
4612
4613 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4614         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4615                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4616
4617 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4618         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4619                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4620
4621 echo "$as_me:4621: checking if we should define _POSIX_C_SOURCE" >&5
4622 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4623 if test "${cf_cv_posix_c_source+set}" = set; then
4624   echo $ECHO_N "(cached) $ECHO_C" >&6
4625 else
4626
4627 echo "${as_me:-configure}:4627: testing if the symbol is already defined go no further ..." 1>&5
4628
4629         cat >conftest.$ac_ext <<_ACEOF
4630 #line 4630 "configure"
4631 #include "confdefs.h"
4632 #include <sys/types.h>
4633 int
4634 main (void)
4635 {
4636
4637 #ifndef _POSIX_C_SOURCE
4638 make an error
4639 #endif
4640   ;
4641   return 0;
4642 }
4643 _ACEOF
4644 rm -f conftest.$ac_objext
4645 if { (eval echo "$as_me:4645: \"$ac_compile\"") >&5
4646   (eval $ac_compile) 2>&5
4647   ac_status=$?
4648   echo "$as_me:4648: \$? = $ac_status" >&5
4649   (exit $ac_status); } &&
4650          { ac_try='test -s conftest.$ac_objext'
4651   { (eval echo "$as_me:4651: \"$ac_try\"") >&5
4652   (eval $ac_try) 2>&5
4653   ac_status=$?
4654   echo "$as_me:4654: \$? = $ac_status" >&5
4655   (exit $ac_status); }; }; then
4656   cf_cv_posix_c_source=no
4657 else
4658   echo "$as_me: failed program was:" >&5
4659 cat conftest.$ac_ext >&5
4660 cf_want_posix_source=no
4661          case .$cf_POSIX_C_SOURCE in
4662          (.[12]??*)
4663                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4664                 ;;
4665          (.2)
4666                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4667                 cf_want_posix_source=yes
4668                 ;;
4669          (.*)
4670                 cf_want_posix_source=yes
4671                 ;;
4672          esac
4673          if test "$cf_want_posix_source" = yes ; then
4674                 cat >conftest.$ac_ext <<_ACEOF
4675 #line 4675 "configure"
4676 #include "confdefs.h"
4677 #include <sys/types.h>
4678 int
4679 main (void)
4680 {
4681
4682 #ifdef _POSIX_SOURCE
4683 make an error
4684 #endif
4685   ;
4686   return 0;
4687 }
4688 _ACEOF
4689 rm -f conftest.$ac_objext
4690 if { (eval echo "$as_me:4690: \"$ac_compile\"") >&5
4691   (eval $ac_compile) 2>&5
4692   ac_status=$?
4693   echo "$as_me:4693: \$? = $ac_status" >&5
4694   (exit $ac_status); } &&
4695          { ac_try='test -s conftest.$ac_objext'
4696   { (eval echo "$as_me:4696: \"$ac_try\"") >&5
4697   (eval $ac_try) 2>&5
4698   ac_status=$?
4699   echo "$as_me:4699: \$? = $ac_status" >&5
4700   (exit $ac_status); }; }; then
4701   :
4702 else
4703   echo "$as_me: failed program was:" >&5
4704 cat conftest.$ac_ext >&5
4705 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4706 fi
4707 rm -f conftest.$ac_objext conftest.$ac_ext
4708          fi
4709
4710 echo "${as_me:-configure}:4710: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4711
4712          CFLAGS="$cf_trim_CFLAGS"
4713          CPPFLAGS="$cf_trim_CPPFLAGS"
4714
4715         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4716         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4717
4718 echo "${as_me:-configure}:4718: testing if the second compile does not leave our definition intact error ..." 1>&5
4719
4720          cat >conftest.$ac_ext <<_ACEOF
4721 #line 4721 "configure"
4722 #include "confdefs.h"
4723 #include <sys/types.h>
4724 int
4725 main (void)
4726 {
4727
4728 #ifndef _POSIX_C_SOURCE
4729 make an error
4730 #endif
4731   ;
4732   return 0;
4733 }
4734 _ACEOF
4735 rm -f conftest.$ac_objext
4736 if { (eval echo "$as_me:4736: \"$ac_compile\"") >&5
4737   (eval $ac_compile) 2>&5
4738   ac_status=$?
4739   echo "$as_me:4739: \$? = $ac_status" >&5
4740   (exit $ac_status); } &&
4741          { ac_try='test -s conftest.$ac_objext'
4742   { (eval echo "$as_me:4742: \"$ac_try\"") >&5
4743   (eval $ac_try) 2>&5
4744   ac_status=$?
4745   echo "$as_me:4745: \$? = $ac_status" >&5
4746   (exit $ac_status); }; }; then
4747   :
4748 else
4749   echo "$as_me: failed program was:" >&5
4750 cat conftest.$ac_ext >&5
4751 cf_cv_posix_c_source=no
4752 fi
4753 rm -f conftest.$ac_objext conftest.$ac_ext
4754          CFLAGS="$cf_save_CFLAGS"
4755          CPPFLAGS="$cf_save_CPPFLAGS"
4756
4757 fi
4758 rm -f conftest.$ac_objext conftest.$ac_ext
4759
4760 fi
4761 echo "$as_me:4761: result: $cf_cv_posix_c_source" >&5
4762 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4763
4764 if test "$cf_cv_posix_c_source" != no ; then
4765         CFLAGS="$cf_trim_CFLAGS"
4766         CPPFLAGS="$cf_trim_CPPFLAGS"
4767
4768 cf_fix_cppflags=no
4769 cf_new_cflags=
4770 cf_new_cppflags=
4771 cf_new_extra_cppflags=
4772
4773 for cf_add_cflags in $cf_cv_posix_c_source
4774 do
4775 case $cf_fix_cppflags in
4776 (no)
4777         case $cf_add_cflags in
4778         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4779                 case $cf_add_cflags in
4780                 (-D*)
4781                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4782
4783                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4784                                 && test -z "${cf_tst_cflags}" \
4785                                 && cf_fix_cppflags=yes
4786
4787                         if test $cf_fix_cppflags = yes ; then
4788
4789         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4790         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4791
4792                                 continue
4793                         elif test "${cf_tst_cflags}" = "\"'" ; then
4794
4795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4797
4798                                 continue
4799                         fi
4800                         ;;
4801                 esac
4802                 case "$CPPFLAGS" in
4803                 (*$cf_add_cflags)
4804                         ;;
4805                 (*)
4806                         case $cf_add_cflags in
4807                         (-D*)
4808                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4809
4810 CPPFLAGS=`echo "$CPPFLAGS" | \
4811         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4812                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4813
4814                                 ;;
4815                         esac
4816
4817         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4818         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4819
4820                         ;;
4821                 esac
4822                 ;;
4823         (*)
4824
4825         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4826         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4827
4828                 ;;
4829         esac
4830         ;;
4831 (yes)
4832
4833         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4834         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4835
4836         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4837
4838         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4839                 && test -z "${cf_tst_cflags}" \
4840                 && cf_fix_cppflags=no
4841         ;;
4842 esac
4843 done
4844
4845 if test -n "$cf_new_cflags" ; then
4846
4847         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4848         CFLAGS="${CFLAGS}$cf_new_cflags"
4849
4850 fi
4851
4852 if test -n "$cf_new_cppflags" ; then
4853
4854         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4855         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4856
4857 fi
4858
4859 if test -n "$cf_new_extra_cppflags" ; then
4860
4861         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4862         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4863
4864 fi
4865
4866 fi
4867
4868 fi # cf_cv_posix_visible
4869
4870         ;;
4871 esac
4872
4873 if test -n "$cf_xopen_source" ; then
4874
4875 cf_fix_cppflags=no
4876 cf_new_cflags=
4877 cf_new_cppflags=
4878 cf_new_extra_cppflags=
4879
4880 for cf_add_cflags in $cf_xopen_source
4881 do
4882 case $cf_fix_cppflags in
4883 (no)
4884         case $cf_add_cflags in
4885         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4886                 case $cf_add_cflags in
4887                 (-D*)
4888                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4889
4890                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4891                                 && test -z "${cf_tst_cflags}" \
4892                                 && cf_fix_cppflags=yes
4893
4894                         if test $cf_fix_cppflags = yes ; then
4895
4896         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4897         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4898
4899                                 continue
4900                         elif test "${cf_tst_cflags}" = "\"'" ; then
4901
4902         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4903         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4904
4905                                 continue
4906                         fi
4907                         ;;
4908                 esac
4909                 case "$CPPFLAGS" in
4910                 (*$cf_add_cflags)
4911                         ;;
4912                 (*)
4913                         case $cf_add_cflags in
4914                         (-D*)
4915                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4916
4917 CPPFLAGS=`echo "$CPPFLAGS" | \
4918         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4919                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4920
4921                                 ;;
4922                         esac
4923
4924         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4925         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4926
4927                         ;;
4928                 esac
4929                 ;;
4930         (*)
4931
4932         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4933         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4934
4935                 ;;
4936         esac
4937         ;;
4938 (yes)
4939
4940         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4941         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4942
4943         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4944
4945         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4946                 && test -z "${cf_tst_cflags}" \
4947                 && cf_fix_cppflags=no
4948         ;;
4949 esac
4950 done
4951
4952 if test -n "$cf_new_cflags" ; then
4953         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4954
4955 echo "${as_me:-configure}:4955: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4956
4957         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4958         CFLAGS="${CFLAGS}$cf_new_cflags"
4959
4960 fi
4961
4962 if test -n "$cf_new_cppflags" ; then
4963         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4964
4965 echo "${as_me:-configure}:4965: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4966
4967         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4968         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4969
4970 fi
4971
4972 if test -n "$cf_new_extra_cppflags" ; then
4973         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4974
4975 echo "${as_me:-configure}:4975: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4976
4977         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4978         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4979
4980 fi
4981
4982 fi
4983
4984 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4985         echo "$as_me:4985: checking if _XOPEN_SOURCE really is set" >&5
4986 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4987         cat >conftest.$ac_ext <<_ACEOF
4988 #line 4988 "configure"
4989 #include "confdefs.h"
4990 #include <stdlib.h>
4991 int
4992 main (void)
4993 {
4994
4995 #ifndef _XOPEN_SOURCE
4996 make an error
4997 #endif
4998   ;
4999   return 0;
5000 }
5001 _ACEOF
5002 rm -f conftest.$ac_objext
5003 if { (eval echo "$as_me:5003: \"$ac_compile\"") >&5
5004   (eval $ac_compile) 2>&5
5005   ac_status=$?
5006   echo "$as_me:5006: \$? = $ac_status" >&5
5007   (exit $ac_status); } &&
5008          { ac_try='test -s conftest.$ac_objext'
5009   { (eval echo "$as_me:5009: \"$ac_try\"") >&5
5010   (eval $ac_try) 2>&5
5011   ac_status=$?
5012   echo "$as_me:5012: \$? = $ac_status" >&5
5013   (exit $ac_status); }; }; then
5014   cf_XOPEN_SOURCE_set=yes
5015 else
5016   echo "$as_me: failed program was:" >&5
5017 cat conftest.$ac_ext >&5
5018 cf_XOPEN_SOURCE_set=no
5019 fi
5020 rm -f conftest.$ac_objext conftest.$ac_ext
5021         echo "$as_me:5021: result: $cf_XOPEN_SOURCE_set" >&5
5022 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5023         if test $cf_XOPEN_SOURCE_set = yes
5024         then
5025                 cat >conftest.$ac_ext <<_ACEOF
5026 #line 5026 "configure"
5027 #include "confdefs.h"
5028 #include <stdlib.h>
5029 int
5030 main (void)
5031 {
5032
5033 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5034 make an error
5035 #endif
5036   ;
5037   return 0;
5038 }
5039 _ACEOF
5040 rm -f conftest.$ac_objext
5041 if { (eval echo "$as_me:5041: \"$ac_compile\"") >&5
5042   (eval $ac_compile) 2>&5
5043   ac_status=$?
5044   echo "$as_me:5044: \$? = $ac_status" >&5
5045   (exit $ac_status); } &&
5046          { ac_try='test -s conftest.$ac_objext'
5047   { (eval echo "$as_me:5047: \"$ac_try\"") >&5
5048   (eval $ac_try) 2>&5
5049   ac_status=$?
5050   echo "$as_me:5050: \$? = $ac_status" >&5
5051   (exit $ac_status); }; }; then
5052   cf_XOPEN_SOURCE_set_ok=yes
5053 else
5054   echo "$as_me: failed program was:" >&5
5055 cat conftest.$ac_ext >&5
5056 cf_XOPEN_SOURCE_set_ok=no
5057 fi
5058 rm -f conftest.$ac_objext conftest.$ac_ext
5059                 if test $cf_XOPEN_SOURCE_set_ok = no
5060                 then
5061                         { echo "$as_me:5061: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5062 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5063                 fi
5064         else
5065
5066 echo "$as_me:5066: checking if we should define _XOPEN_SOURCE" >&5
5067 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5068 if test "${cf_cv_xopen_source+set}" = set; then
5069   echo $ECHO_N "(cached) $ECHO_C" >&6
5070 else
5071
5072         cat >conftest.$ac_ext <<_ACEOF
5073 #line 5073 "configure"
5074 #include "confdefs.h"
5075
5076 #include <stdlib.h>
5077 #include <string.h>
5078 #include <sys/types.h>
5079
5080 int
5081 main (void)
5082 {
5083
5084 #ifndef _XOPEN_SOURCE
5085 make an error
5086 #endif
5087   ;
5088   return 0;
5089 }
5090 _ACEOF
5091 rm -f conftest.$ac_objext
5092 if { (eval echo "$as_me:5092: \"$ac_compile\"") >&5
5093   (eval $ac_compile) 2>&5
5094   ac_status=$?
5095   echo "$as_me:5095: \$? = $ac_status" >&5
5096   (exit $ac_status); } &&
5097          { ac_try='test -s conftest.$ac_objext'
5098   { (eval echo "$as_me:5098: \"$ac_try\"") >&5
5099   (eval $ac_try) 2>&5
5100   ac_status=$?
5101   echo "$as_me:5101: \$? = $ac_status" >&5
5102   (exit $ac_status); }; }; then
5103   cf_cv_xopen_source=no
5104 else
5105   echo "$as_me: failed program was:" >&5
5106 cat conftest.$ac_ext >&5
5107 cf_save="$CPPFLAGS"
5108
5109         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5110         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5111
5112          cat >conftest.$ac_ext <<_ACEOF
5113 #line 5113 "configure"
5114 #include "confdefs.h"
5115
5116 #include <stdlib.h>
5117 #include <string.h>
5118 #include <sys/types.h>
5119
5120 int
5121 main (void)
5122 {
5123
5124 #ifdef _XOPEN_SOURCE
5125 make an error
5126 #endif
5127   ;
5128   return 0;
5129 }
5130 _ACEOF
5131 rm -f conftest.$ac_objext
5132 if { (eval echo "$as_me:5132: \"$ac_compile\"") >&5
5133   (eval $ac_compile) 2>&5
5134   ac_status=$?
5135   echo "$as_me:5135: \$? = $ac_status" >&5
5136   (exit $ac_status); } &&
5137          { ac_try='test -s conftest.$ac_objext'
5138   { (eval echo "$as_me:5138: \"$ac_try\"") >&5
5139   (eval $ac_try) 2>&5
5140   ac_status=$?
5141   echo "$as_me:5141: \$? = $ac_status" >&5
5142   (exit $ac_status); }; }; then
5143   cf_cv_xopen_source=no
5144 else
5145   echo "$as_me: failed program was:" >&5
5146 cat conftest.$ac_ext >&5
5147 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5148 fi
5149 rm -f conftest.$ac_objext conftest.$ac_ext
5150         CPPFLAGS="$cf_save"
5151
5152 fi
5153 rm -f conftest.$ac_objext conftest.$ac_ext
5154
5155 fi
5156 echo "$as_me:5156: result: $cf_cv_xopen_source" >&5
5157 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5158
5159 if test "$cf_cv_xopen_source" != no ; then
5160
5161 CFLAGS=`echo "$CFLAGS" | \
5162         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5163                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5164
5165 CPPFLAGS=`echo "$CPPFLAGS" | \
5166         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5167                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5168
5169         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5170
5171 cf_fix_cppflags=no
5172 cf_new_cflags=
5173 cf_new_cppflags=
5174 cf_new_extra_cppflags=
5175
5176 for cf_add_cflags in $cf_temp_xopen_source
5177 do
5178 case $cf_fix_cppflags in
5179 (no)
5180         case $cf_add_cflags in
5181         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5182                 case $cf_add_cflags in
5183                 (-D*)
5184                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5185
5186                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5187                                 && test -z "${cf_tst_cflags}" \
5188                                 && cf_fix_cppflags=yes
5189
5190                         if test $cf_fix_cppflags = yes ; then
5191
5192         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5193         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5194
5195                                 continue
5196                         elif test "${cf_tst_cflags}" = "\"'" ; then
5197
5198         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5199         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5200
5201                                 continue
5202                         fi
5203                         ;;
5204                 esac
5205                 case "$CPPFLAGS" in
5206                 (*$cf_add_cflags)
5207                         ;;
5208                 (*)
5209                         case $cf_add_cflags in
5210                         (-D*)
5211                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5212
5213 CPPFLAGS=`echo "$CPPFLAGS" | \
5214         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5215                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5216
5217                                 ;;
5218                         esac
5219
5220         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5221         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5222
5223                         ;;
5224                 esac
5225                 ;;
5226         (*)
5227
5228         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5229         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5230
5231                 ;;
5232         esac
5233         ;;
5234 (yes)
5235
5236         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5237         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5238
5239         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5240
5241         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5242                 && test -z "${cf_tst_cflags}" \
5243                 && cf_fix_cppflags=no
5244         ;;
5245 esac
5246 done
5247
5248 if test -n "$cf_new_cflags" ; then
5249
5250         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5251         CFLAGS="${CFLAGS}$cf_new_cflags"
5252
5253 fi
5254
5255 if test -n "$cf_new_cppflags" ; then
5256
5257         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5258         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5259
5260 fi
5261
5262 if test -n "$cf_new_extra_cppflags" ; then
5263
5264         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5265         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5266
5267 fi
5268
5269 fi
5270
5271         fi
5272 fi
5273 fi # cf_cv_posix_visible
5274
5275 echo "$as_me:5275: checking for signal global datatype" >&5
5276 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5277 if test "${cf_cv_sig_atomic_t+set}" = set; then
5278   echo $ECHO_N "(cached) $ECHO_C" >&6
5279 else
5280
5281         for cf_type in \
5282                 "volatile sig_atomic_t" \
5283                 "sig_atomic_t" \
5284                 "int"
5285         do
5286         cat >conftest.$ac_ext <<_ACEOF
5287 #line 5287 "configure"
5288 #include "confdefs.h"
5289
5290 #include <sys/types.h>
5291 #include <signal.h>
5292 #include <stdio.h>
5293
5294 extern $cf_type x;
5295 $cf_type x;
5296 static void handler(int sig)
5297 {
5298         x = 5;
5299 }
5300 int
5301 main (void)
5302 {
5303 signal(SIGINT, handler);
5304                  x = 1
5305   ;
5306   return 0;
5307 }
5308 _ACEOF
5309 rm -f conftest.$ac_objext
5310 if { (eval echo "$as_me:5310: \"$ac_compile\"") >&5
5311   (eval $ac_compile) 2>&5
5312   ac_status=$?
5313   echo "$as_me:5313: \$? = $ac_status" >&5
5314   (exit $ac_status); } &&
5315          { ac_try='test -s conftest.$ac_objext'
5316   { (eval echo "$as_me:5316: \"$ac_try\"") >&5
5317   (eval $ac_try) 2>&5
5318   ac_status=$?
5319   echo "$as_me:5319: \$? = $ac_status" >&5
5320   (exit $ac_status); }; }; then
5321   cf_cv_sig_atomic_t=$cf_type
5322 else
5323   echo "$as_me: failed program was:" >&5
5324 cat conftest.$ac_ext >&5
5325 cf_cv_sig_atomic_t=no
5326 fi
5327 rm -f conftest.$ac_objext conftest.$ac_ext
5328                 test "$cf_cv_sig_atomic_t" != no && break
5329         done
5330
5331 fi
5332
5333 echo "$as_me:5333: result: $cf_cv_sig_atomic_t" >&5
5334 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5335 test "$cf_cv_sig_atomic_t" != no &&
5336 cat >>confdefs.h <<EOF
5337 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5338 EOF
5339
5340 # Work around breakage on OS X
5341
5342 echo "$as_me:5342: checking if SIGWINCH is defined" >&5
5343 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5344 if test "${cf_cv_define_sigwinch+set}" = set; then
5345   echo $ECHO_N "(cached) $ECHO_C" >&6
5346 else
5347
5348         cat >conftest.$ac_ext <<_ACEOF
5349 #line 5349 "configure"
5350 #include "confdefs.h"
5351
5352 #include <sys/types.h>
5353 #include <sys/signal.h>
5354
5355 int
5356 main (void)
5357 {
5358 int x = SIGWINCH
5359   ;
5360   return 0;
5361 }
5362 _ACEOF
5363 rm -f conftest.$ac_objext
5364 if { (eval echo "$as_me:5364: \"$ac_compile\"") >&5
5365   (eval $ac_compile) 2>&5
5366   ac_status=$?
5367   echo "$as_me:5367: \$? = $ac_status" >&5
5368   (exit $ac_status); } &&
5369          { ac_try='test -s conftest.$ac_objext'
5370   { (eval echo "$as_me:5370: \"$ac_try\"") >&5
5371   (eval $ac_try) 2>&5
5372   ac_status=$?
5373   echo "$as_me:5373: \$? = $ac_status" >&5
5374   (exit $ac_status); }; }; then
5375   cf_cv_define_sigwinch=yes
5376 else
5377   echo "$as_me: failed program was:" >&5
5378 cat conftest.$ac_ext >&5
5379 cat >conftest.$ac_ext <<_ACEOF
5380 #line 5380 "configure"
5381 #include "confdefs.h"
5382
5383 #undef _XOPEN_SOURCE
5384 #undef _POSIX_SOURCE
5385 #undef _POSIX_C_SOURCE
5386 #include <sys/types.h>
5387 #include <sys/signal.h>
5388
5389 int
5390 main (void)
5391 {
5392 int x = SIGWINCH
5393   ;
5394   return 0;
5395 }
5396 _ACEOF
5397 rm -f conftest.$ac_objext
5398 if { (eval echo "$as_me:5398: \"$ac_compile\"") >&5
5399   (eval $ac_compile) 2>&5
5400   ac_status=$?
5401   echo "$as_me:5401: \$? = $ac_status" >&5
5402   (exit $ac_status); } &&
5403          { ac_try='test -s conftest.$ac_objext'
5404   { (eval echo "$as_me:5404: \"$ac_try\"") >&5
5405   (eval $ac_try) 2>&5
5406   ac_status=$?
5407   echo "$as_me:5407: \$? = $ac_status" >&5
5408   (exit $ac_status); }; }; then
5409   cf_cv_define_sigwinch=maybe
5410 else
5411   echo "$as_me: failed program was:" >&5
5412 cat conftest.$ac_ext >&5
5413 cf_cv_define_sigwinch=no
5414 fi
5415 rm -f conftest.$ac_objext conftest.$ac_ext
5416
5417 fi
5418 rm -f conftest.$ac_objext conftest.$ac_ext
5419
5420 fi
5421 echo "$as_me:5421: result: $cf_cv_define_sigwinch" >&5
5422 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5423
5424 if test "$cf_cv_define_sigwinch" = maybe ; then
5425 echo "$as_me:5425: checking for actual SIGWINCH definition" >&5
5426 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5427 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5428   echo $ECHO_N "(cached) $ECHO_C" >&6
5429 else
5430
5431 cf_cv_fixup_sigwinch=unknown
5432 cf_sigwinch=32
5433 while test $cf_sigwinch != 1
5434 do
5435         cat >conftest.$ac_ext <<_ACEOF
5436 #line 5436 "configure"
5437 #include "confdefs.h"
5438
5439 #undef _XOPEN_SOURCE
5440 #undef _POSIX_SOURCE
5441 #undef _POSIX_C_SOURCE
5442 #include <sys/types.h>
5443 #include <sys/signal.h>
5444
5445 int
5446 main (void)
5447 {
5448
5449 #if SIGWINCH != $cf_sigwinch
5450 make an error
5451 #endif
5452 int x = SIGWINCH
5453   ;
5454   return 0;
5455 }
5456 _ACEOF
5457 rm -f conftest.$ac_objext
5458 if { (eval echo "$as_me:5458: \"$ac_compile\"") >&5
5459   (eval $ac_compile) 2>&5
5460   ac_status=$?
5461   echo "$as_me:5461: \$? = $ac_status" >&5
5462   (exit $ac_status); } &&
5463          { ac_try='test -s conftest.$ac_objext'
5464   { (eval echo "$as_me:5464: \"$ac_try\"") >&5
5465   (eval $ac_try) 2>&5
5466   ac_status=$?
5467   echo "$as_me:5467: \$? = $ac_status" >&5
5468   (exit $ac_status); }; }; then
5469   cf_cv_fixup_sigwinch=$cf_sigwinch
5470          break
5471 else
5472   echo "$as_me: failed program was:" >&5
5473 cat conftest.$ac_ext >&5
5474 fi
5475 rm -f conftest.$ac_objext conftest.$ac_ext
5476
5477 cf_sigwinch=`expr $cf_sigwinch - 1`
5478 done
5479
5480 fi
5481 echo "$as_me:5481: result: $cf_cv_fixup_sigwinch" >&5
5482 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5483
5484         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5485                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5486         fi
5487 fi
5488
5489 # Checks for CODESET support.
5490
5491 echo "$as_me:5491: checking for nl_langinfo and CODESET" >&5
5492 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5493 if test "${am_cv_langinfo_codeset+set}" = set; then
5494   echo $ECHO_N "(cached) $ECHO_C" >&6
5495 else
5496   cat >conftest.$ac_ext <<_ACEOF
5497 #line 5497 "configure"
5498 #include "confdefs.h"
5499 #include <langinfo.h>
5500 int
5501 main (void)
5502 {
5503 char* cs = nl_langinfo(CODESET);
5504   ;
5505   return 0;
5506 }
5507 _ACEOF
5508 rm -f conftest.$ac_objext conftest$ac_exeext
5509 if { (eval echo "$as_me:5509: \"$ac_link\"") >&5
5510   (eval $ac_link) 2>&5
5511   ac_status=$?
5512   echo "$as_me:5512: \$? = $ac_status" >&5
5513   (exit $ac_status); } &&
5514          { ac_try='test -s conftest$ac_exeext'
5515   { (eval echo "$as_me:5515: \"$ac_try\"") >&5
5516   (eval $ac_try) 2>&5
5517   ac_status=$?
5518   echo "$as_me:5518: \$? = $ac_status" >&5
5519   (exit $ac_status); }; }; then
5520   am_cv_langinfo_codeset=yes
5521 else
5522   echo "$as_me: failed program was:" >&5
5523 cat conftest.$ac_ext >&5
5524 am_cv_langinfo_codeset=no
5525 fi
5526 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5527
5528 fi
5529 echo "$as_me:5529: result: $am_cv_langinfo_codeset" >&5
5530 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5531         if test $am_cv_langinfo_codeset = yes; then
5532
5533 cat >>confdefs.h <<\EOF
5534 #define HAVE_LANGINFO_CODESET 1
5535 EOF
5536
5537         fi
5538
5539 echo "$as_me:5539: checking if you want to use pkg-config" >&5
5540 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5541
5542 # Check whether --with-pkg-config or --without-pkg-config was given.
5543 if test "${with_pkg_config+set}" = set; then
5544   withval="$with_pkg_config"
5545   cf_pkg_config=$withval
5546 else
5547   cf_pkg_config=yes
5548 fi;
5549 echo "$as_me:5549: result: $cf_pkg_config" >&5
5550 echo "${ECHO_T}$cf_pkg_config" >&6
5551
5552 case $cf_pkg_config in
5553 (no)
5554         PKG_CONFIG=none
5555         ;;
5556 (yes)
5557
5558 if test -n "$ac_tool_prefix"; then
5559   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5560 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5561 echo "$as_me:5561: checking for $ac_word" >&5
5562 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5563 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5564   echo $ECHO_N "(cached) $ECHO_C" >&6
5565 else
5566   case $PKG_CONFIG in
5567   [\\/]* | ?:[\\/]*)
5568   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5569   ;;
5570   *)
5571   ac_save_IFS=$IFS; IFS=$ac_path_separator
5572 ac_dummy="$PATH"
5573 for ac_dir in $ac_dummy; do
5574   IFS=$ac_save_IFS
5575   test -z "$ac_dir" && ac_dir=.
5576   if $as_executable_p "$ac_dir/$ac_word"; then
5577    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5578    echo "$as_me:5578: found $ac_dir/$ac_word" >&5
5579    break
5580 fi
5581 done
5582
5583   ;;
5584 esac
5585 fi
5586 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5587
5588 if test -n "$PKG_CONFIG"; then
5589   echo "$as_me:5589: result: $PKG_CONFIG" >&5
5590 echo "${ECHO_T}$PKG_CONFIG" >&6
5591 else
5592   echo "$as_me:5592: result: no" >&5
5593 echo "${ECHO_T}no" >&6
5594 fi
5595
5596 fi
5597 if test -z "$ac_cv_path_PKG_CONFIG"; then
5598   ac_pt_PKG_CONFIG=$PKG_CONFIG
5599   # Extract the first word of "pkg-config", so it can be a program name with args.
5600 set dummy pkg-config; ac_word=$2
5601 echo "$as_me:5601: checking for $ac_word" >&5
5602 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5603 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5604   echo $ECHO_N "(cached) $ECHO_C" >&6
5605 else
5606   case $ac_pt_PKG_CONFIG in
5607   [\\/]* | ?:[\\/]*)
5608   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5609   ;;
5610   *)
5611   ac_save_IFS=$IFS; IFS=$ac_path_separator
5612 ac_dummy="$PATH"
5613 for ac_dir in $ac_dummy; do
5614   IFS=$ac_save_IFS
5615   test -z "$ac_dir" && ac_dir=.
5616   if $as_executable_p "$ac_dir/$ac_word"; then
5617    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5618    echo "$as_me:5618: found $ac_dir/$ac_word" >&5
5619    break
5620 fi
5621 done
5622
5623   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5624   ;;
5625 esac
5626 fi
5627 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5628
5629 if test -n "$ac_pt_PKG_CONFIG"; then
5630   echo "$as_me:5630: result: $ac_pt_PKG_CONFIG" >&5
5631 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5632 else
5633   echo "$as_me:5633: result: no" >&5
5634 echo "${ECHO_T}no" >&6
5635 fi
5636
5637   PKG_CONFIG=$ac_pt_PKG_CONFIG
5638 else
5639   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5640 fi
5641
5642         ;;
5643 (*)
5644         PKG_CONFIG=$withval
5645         ;;
5646 esac
5647
5648 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5649 if test "$PKG_CONFIG" != none ; then
5650
5651 if test "x$prefix" != xNONE; then
5652         cf_path_syntax="$prefix"
5653 else
5654         cf_path_syntax="$ac_default_prefix"
5655 fi
5656
5657 case ".$PKG_CONFIG" in
5658 (.\$\(*\)*|.\'*\'*)
5659         ;;
5660 (..|./*|.\\*)
5661         ;;
5662 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5663         ;;
5664 (.\${*prefix}*|.\${*dir}*)
5665         eval PKG_CONFIG="$PKG_CONFIG"
5666         case ".$PKG_CONFIG" in
5667         (.NONE/*)
5668                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5669                 ;;
5670         esac
5671         ;;
5672 (.no|.NONE/*)
5673         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5674         ;;
5675 (*)
5676         { { echo "$as_me:5676: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5677 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5678    { (exit 1); exit 1; }; }
5679         ;;
5680 esac
5681
5682 elif test "x$cf_pkg_config" != xno ; then
5683         { echo "$as_me:5683: WARNING: pkg-config is not installed" >&5
5684 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5685 fi
5686
5687 echo "$as_me:5687: checking if you want to see long compiling messages" >&5
5688 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5689
5690 # Check whether --enable-echo or --disable-echo was given.
5691 if test "${enable_echo+set}" = set; then
5692   enableval="$enable_echo"
5693   test "$enableval" != no && enableval=yes
5694         if test "$enableval" != "yes" ; then
5695
5696         ECHO_LT='--silent'
5697         ECHO_LD='@echo linking $@;'
5698         RULE_CC='@echo compiling $<'
5699         SHOW_CC='@echo compiling $@'
5700         ECHO_CC='@'
5701
5702         else
5703
5704         ECHO_LT=''
5705         ECHO_LD=''
5706         RULE_CC=''
5707         SHOW_CC=''
5708         ECHO_CC=''
5709
5710         fi
5711 else
5712   enableval=yes
5713
5714         ECHO_LT=''
5715         ECHO_LD=''
5716         RULE_CC=''
5717         SHOW_CC=''
5718         ECHO_CC=''
5719
5720 fi;
5721 echo "$as_me:5721: result: $enableval" >&5
5722 echo "${ECHO_T}$enableval" >&6
5723
5724 echo "$as_me:5724: checking for ncurses wrap-prefix" >&5
5725 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5726
5727 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5728 if test "${with_ncurses_wrap_prefix+set}" = set; then
5729   withval="$with_ncurses_wrap_prefix"
5730   NCURSES_WRAP_PREFIX=$withval
5731 else
5732   NCURSES_WRAP_PREFIX=_nc_
5733 fi;
5734 echo "$as_me:5734: result: $NCURSES_WRAP_PREFIX" >&5
5735 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5736
5737 echo "$as_me:5737: checking if you want to check for wide-character functions" >&5
5738 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5739
5740 # Check whether --enable-widec or --disable-widec was given.
5741 if test "${enable_widec+set}" = set; then
5742   enableval="$enable_widec"
5743   test "$enableval" != no && enableval=yes
5744         if test "$enableval" != "yes" ; then
5745     cf_enable_widec=no
5746         else
5747                 cf_enable_widec=yes
5748         fi
5749 else
5750   enableval=yes
5751         cf_enable_widec=yes
5752
5753 fi;
5754 echo "$as_me:5754: result: $cf_enable_widec" >&5
5755 echo "${ECHO_T}$cf_enable_widec" >&6
5756
5757 echo "$as_me:5757: checking for specific curses-directory" >&5
5758 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5759
5760 # Check whether --with-curses-dir or --without-curses-dir was given.
5761 if test "${with_curses_dir+set}" = set; then
5762   withval="$with_curses_dir"
5763   cf_cv_curses_dir=$withval
5764 else
5765   cf_cv_curses_dir=no
5766 fi;
5767 echo "$as_me:5767: result: $cf_cv_curses_dir" >&5
5768 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5769
5770 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5771 then
5772
5773 if test "x$prefix" != xNONE; then
5774         cf_path_syntax="$prefix"
5775 else
5776         cf_path_syntax="$ac_default_prefix"
5777 fi
5778
5779 case ".$withval" in
5780 (.\$\(*\)*|.\'*\'*)
5781         ;;
5782 (..|./*|.\\*)
5783         ;;
5784 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5785         ;;
5786 (.\${*prefix}*|.\${*dir}*)
5787         eval withval="$withval"
5788         case ".$withval" in
5789         (.NONE/*)
5790                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5791                 ;;
5792         esac
5793         ;;
5794 (.no|.NONE/*)
5795         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5796         ;;
5797 (*)
5798         { { echo "$as_me:5798: error: expected a pathname, not \"$withval\"" >&5
5799 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5800    { (exit 1); exit 1; }; }
5801         ;;
5802 esac
5803
5804         if test -d "$cf_cv_curses_dir"
5805         then
5806
5807 if test -n "$cf_cv_curses_dir/include" ; then
5808   for cf_add_incdir in $cf_cv_curses_dir/include
5809   do
5810         while test $cf_add_incdir != /usr/include
5811         do
5812           if test -d $cf_add_incdir
5813           then
5814                 cf_have_incdir=no
5815                 if test -n "$CFLAGS$CPPFLAGS" ; then
5816                   # a loop is needed to ensure we can add subdirs of existing dirs
5817                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5818                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5819                           cf_have_incdir=yes; break
5820                         fi
5821                   done
5822                 fi
5823
5824                 if test "$cf_have_incdir" = no ; then
5825                   if test "$cf_add_incdir" = /usr/local/include ; then
5826                         if test "$GCC" = yes
5827                         then
5828                           cf_save_CPPFLAGS=$CPPFLAGS
5829
5830         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5831         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5832
5833                           cat >conftest.$ac_ext <<_ACEOF
5834 #line 5834 "configure"
5835 #include "confdefs.h"
5836 #include <stdio.h>
5837 int
5838 main (void)
5839 {
5840 printf("Hello")
5841   ;
5842   return 0;
5843 }
5844 _ACEOF
5845 rm -f conftest.$ac_objext
5846 if { (eval echo "$as_me:5846: \"$ac_compile\"") >&5
5847   (eval $ac_compile) 2>&5
5848   ac_status=$?
5849   echo "$as_me:5849: \$? = $ac_status" >&5
5850   (exit $ac_status); } &&
5851          { ac_try='test -s conftest.$ac_objext'
5852   { (eval echo "$as_me:5852: \"$ac_try\"") >&5
5853   (eval $ac_try) 2>&5
5854   ac_status=$?
5855   echo "$as_me:5855: \$? = $ac_status" >&5
5856   (exit $ac_status); }; }; then
5857   :
5858 else
5859   echo "$as_me: failed program was:" >&5
5860 cat conftest.$ac_ext >&5
5861 cf_have_incdir=yes
5862 fi
5863 rm -f conftest.$ac_objext conftest.$ac_ext
5864                           CPPFLAGS=$cf_save_CPPFLAGS
5865                         fi
5866                   fi
5867                 fi
5868
5869                 if test "$cf_have_incdir" = no ; then
5870                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5871
5872 echo "${as_me:-configure}:5872: testing adding $cf_add_incdir to include-path ..." 1>&5
5873
5874                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5875
5876                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5877                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5878                   cf_add_incdir="$cf_top_incdir"
5879                 else
5880                   break
5881                 fi
5882           else
5883                 break
5884           fi
5885         done
5886   done
5887 fi
5888
5889 if test -n "$cf_cv_curses_dir/lib" ; then
5890         for cf_add_libdir in $cf_cv_curses_dir/lib
5891         do
5892                 if test $cf_add_libdir = /usr/lib ; then
5893                         :
5894                 elif test -d $cf_add_libdir
5895                 then
5896                         cf_have_libdir=no
5897                         if test -n "$LDFLAGS$LIBS" ; then
5898                                 # a loop is needed to ensure we can add subdirs of existing dirs
5899                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5900                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5901                                                 cf_have_libdir=yes; break
5902                                         fi
5903                                 done
5904                         fi
5905                         if test "$cf_have_libdir" = no ; then
5906                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5907
5908 echo "${as_me:-configure}:5908: testing adding $cf_add_libdir to library-path ..." 1>&5
5909
5910                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5911                         fi
5912                 fi
5913         done
5914 fi
5915
5916         fi
5917 fi
5918
5919 cf_cv_screen=curses
5920
5921 echo "$as_me:5921: checking for specified curses library type" >&5
5922 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5923
5924 # Check whether --with-screen or --without-screen was given.
5925 if test "${with_screen+set}" = set; then
5926   withval="$with_screen"
5927   cf_cv_screen=$withval
5928 else
5929
5930 # Check whether --with-ncursesw or --without-ncursesw was given.
5931 if test "${with_ncursesw+set}" = set; then
5932   withval="$with_ncursesw"
5933   cf_cv_screen=ncursesw
5934 else
5935
5936 # Check whether --with-ncurses or --without-ncurses was given.
5937 if test "${with_ncurses+set}" = set; then
5938   withval="$with_ncurses"
5939   cf_cv_screen=ncurses
5940 else
5941
5942 # Check whether --with-pdcurses or --without-pdcurses was given.
5943 if test "${with_pdcurses+set}" = set; then
5944   withval="$with_pdcurses"
5945   cf_cv_screen=pdcurses
5946 else
5947
5948 # Check whether --with-curses-colr or --without-curses-colr was given.
5949 if test "${with_curses_colr+set}" = set; then
5950   withval="$with_curses_colr"
5951   cf_cv_screen=curses_colr
5952 else
5953
5954 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5955 if test "${with_curses_5lib+set}" = set; then
5956   withval="$with_curses_5lib"
5957   cf_cv_screen=curses_5lib
5958 fi;
5959 fi;
5960 fi;
5961 fi;
5962 fi;
5963 fi;
5964
5965 echo "$as_me:5965: result: $cf_cv_screen" >&5
5966 echo "${ECHO_T}$cf_cv_screen" >&6
5967
5968 case $cf_cv_screen in
5969 (curses|curses_*)
5970
5971 echo "$as_me:5971: checking for extra include directories" >&5
5972 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5973 if test "${cf_cv_curses_incdir+set}" = set; then
5974   echo $ECHO_N "(cached) $ECHO_C" >&6
5975 else
5976
5977 cf_cv_curses_incdir=no
5978 case $host_os in
5979 (hpux10.*)
5980         if test "x$cf_cv_screen" = "xcurses_colr"
5981         then
5982                 test -d /usr/include/curses_colr && \
5983                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5984         fi
5985         ;;
5986 (sunos3*|sunos4*)
5987         if test "x$cf_cv_screen" = "xcurses_5lib"
5988         then
5989                 test -d /usr/5lib && \
5990                 test -d /usr/5include && \
5991                 cf_cv_curses_incdir="-I/usr/5include"
5992         fi
5993         ;;
5994 esac
5995
5996 fi
5997 echo "$as_me:5997: result: $cf_cv_curses_incdir" >&5
5998 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5999 if test "$cf_cv_curses_incdir" != no
6000 then
6001
6002         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6003         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6004
6005 fi
6006
6007 echo "$as_me:6007: checking if we have identified curses headers" >&5
6008 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6009 if test "${cf_cv_ncurses_header+set}" = set; then
6010   echo $ECHO_N "(cached) $ECHO_C" >&6
6011 else
6012
6013 cf_cv_ncurses_header=none
6014 for cf_header in \
6015         ncurses.h  \
6016         curses.h  ncurses/ncurses.h ncurses/curses.h
6017 do
6018 cat >conftest.$ac_ext <<_ACEOF
6019 #line 6019 "configure"
6020 #include "confdefs.h"
6021 #include <${cf_header}>
6022 int
6023 main (void)
6024 {
6025 initscr(); tgoto("?", 0,0)
6026   ;
6027   return 0;
6028 }
6029 _ACEOF
6030 rm -f conftest.$ac_objext
6031 if { (eval echo "$as_me:6031: \"$ac_compile\"") >&5
6032   (eval $ac_compile) 2>&5
6033   ac_status=$?
6034   echo "$as_me:6034: \$? = $ac_status" >&5
6035   (exit $ac_status); } &&
6036          { ac_try='test -s conftest.$ac_objext'
6037   { (eval echo "$as_me:6037: \"$ac_try\"") >&5
6038   (eval $ac_try) 2>&5
6039   ac_status=$?
6040   echo "$as_me:6040: \$? = $ac_status" >&5
6041   (exit $ac_status); }; }; then
6042   cf_cv_ncurses_header=$cf_header; break
6043 else
6044   echo "$as_me: failed program was:" >&5
6045 cat conftest.$ac_ext >&5
6046 fi
6047 rm -f conftest.$ac_objext conftest.$ac_ext
6048 done
6049
6050 fi
6051 echo "$as_me:6051: result: $cf_cv_ncurses_header" >&5
6052 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6053
6054 if test "$cf_cv_ncurses_header" = none ; then
6055         { { echo "$as_me:6055: error: No curses header-files found" >&5
6056 echo "$as_me: error: No curses header-files found" >&2;}
6057    { (exit 1); exit 1; }; }
6058 fi
6059
6060 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6061
6062 for ac_header in $cf_cv_ncurses_header
6063 do
6064 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6065 echo "$as_me:6065: checking for $ac_header" >&5
6066 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6067 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6068   echo $ECHO_N "(cached) $ECHO_C" >&6
6069 else
6070   cat >conftest.$ac_ext <<_ACEOF
6071 #line 6071 "configure"
6072 #include "confdefs.h"
6073 #include <$ac_header>
6074 _ACEOF
6075 if { (eval echo "$as_me:6075: \"$ac_cpp conftest.$ac_ext\"") >&5
6076   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6077   ac_status=$?
6078   egrep -v '^ *\+' conftest.er1 >conftest.err
6079   rm -f conftest.er1
6080   cat conftest.err >&5
6081   echo "$as_me:6081: \$? = $ac_status" >&5
6082   (exit $ac_status); } >/dev/null; then
6083   if test -s conftest.err; then
6084     ac_cpp_err=$ac_c_preproc_warn_flag
6085   else
6086     ac_cpp_err=
6087   fi
6088 else
6089   ac_cpp_err=yes
6090 fi
6091 if test -z "$ac_cpp_err"; then
6092   eval "$as_ac_Header=yes"
6093 else
6094   echo "$as_me: failed program was:" >&5
6095   cat conftest.$ac_ext >&5
6096   eval "$as_ac_Header=no"
6097 fi
6098 rm -f conftest.err conftest.$ac_ext
6099 fi
6100 echo "$as_me:6100: result: `eval echo '${'$as_ac_Header'}'`" >&5
6101 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6102 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6103   cat >>confdefs.h <<EOF
6104 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6105 EOF
6106
6107 fi
6108 done
6109
6110 echo "$as_me:6110: checking for terminfo header" >&5
6111 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6112 if test "${cf_cv_term_header+set}" = set; then
6113   echo $ECHO_N "(cached) $ECHO_C" >&6
6114 else
6115
6116 case ${cf_cv_ncurses_header} in
6117 (*/ncurses.h|*/ncursesw.h)
6118         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6119         ;;
6120 (*)
6121         cf_term_header=term.h
6122         ;;
6123 esac
6124
6125 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6126 do
6127 cat >conftest.$ac_ext <<_ACEOF
6128 #line 6128 "configure"
6129 #include "confdefs.h"
6130 #include <stdio.h>
6131 #include <${cf_cv_ncurses_header:-curses.h}>
6132 #include <$cf_test>
6133
6134 int
6135 main (void)
6136 {
6137 int x = auto_left_margin
6138   ;
6139   return 0;
6140 }
6141 _ACEOF
6142 rm -f conftest.$ac_objext
6143 if { (eval echo "$as_me:6143: \"$ac_compile\"") >&5
6144   (eval $ac_compile) 2>&5
6145   ac_status=$?
6146   echo "$as_me:6146: \$? = $ac_status" >&5
6147   (exit $ac_status); } &&
6148          { ac_try='test -s conftest.$ac_objext'
6149   { (eval echo "$as_me:6149: \"$ac_try\"") >&5
6150   (eval $ac_try) 2>&5
6151   ac_status=$?
6152   echo "$as_me:6152: \$? = $ac_status" >&5
6153   (exit $ac_status); }; }; then
6154
6155         cf_cv_term_header="$cf_test"
6156 else
6157   echo "$as_me: failed program was:" >&5
6158 cat conftest.$ac_ext >&5
6159
6160         cf_cv_term_header=unknown
6161
6162 fi
6163 rm -f conftest.$ac_objext conftest.$ac_ext
6164         test "$cf_cv_term_header" != unknown && break
6165 done
6166
6167 fi
6168 echo "$as_me:6168: result: $cf_cv_term_header" >&5
6169 echo "${ECHO_T}$cf_cv_term_header" >&6
6170
6171 # Set definitions to allow ifdef'ing to accommodate subdirectories
6172
6173 case $cf_cv_term_header in
6174 (*term.h)
6175
6176 cat >>confdefs.h <<\EOF
6177 #define HAVE_TERM_H 1
6178 EOF
6179
6180         ;;
6181 esac
6182
6183 case $cf_cv_term_header in
6184 (ncurses/term.h)
6185
6186 cat >>confdefs.h <<\EOF
6187 #define HAVE_NCURSES_TERM_H 1
6188 EOF
6189
6190         ;;
6191 (ncursesw/term.h)
6192
6193 cat >>confdefs.h <<\EOF
6194 #define HAVE_NCURSESW_TERM_H 1
6195 EOF
6196
6197         ;;
6198 esac
6199
6200 echo "$as_me:6200: checking for ncurses version" >&5
6201 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6202 if test "${cf_cv_ncurses_version+set}" = set; then
6203   echo $ECHO_N "(cached) $ECHO_C" >&6
6204 else
6205
6206         cf_cv_ncurses_version=no
6207         cf_tempfile=out$$
6208         rm -f $cf_tempfile
6209         if test "$cross_compiling" = yes; then
6210
6211         # This will not work if the preprocessor splits the line after the
6212         # Autoconf token.  The 'unproto' program does that.
6213         cat > conftest.$ac_ext <<EOF
6214 #include <${cf_cv_ncurses_header:-curses.h}>
6215 #undef Autoconf
6216 #ifdef NCURSES_VERSION
6217 Autoconf NCURSES_VERSION
6218 #else
6219 #ifdef __NCURSES_H
6220 Autoconf "old"
6221 #endif
6222 ;
6223 #endif
6224 EOF
6225         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6226         { (eval echo "$as_me:6226: \"$cf_try\"") >&5
6227   (eval $cf_try) 2>&5
6228   ac_status=$?
6229   echo "$as_me:6229: \$? = $ac_status" >&5
6230   (exit $ac_status); }
6231         if test -f conftest.out ; then
6232                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6233                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6234                 rm -f conftest.out
6235         fi
6236
6237 else
6238   cat >conftest.$ac_ext <<_ACEOF
6239 #line 6239 "configure"
6240 #include "confdefs.h"
6241
6242 #include <${cf_cv_ncurses_header:-curses.h}>
6243 #include <stdio.h>
6244 int main(void)
6245 {
6246         FILE *fp = fopen("$cf_tempfile", "w");
6247 #ifdef NCURSES_VERSION
6248 # ifdef NCURSES_VERSION_PATCH
6249         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6250 # else
6251         fprintf(fp, "%s\n", NCURSES_VERSION);
6252 # endif
6253 #else
6254 # ifdef __NCURSES_H
6255         fprintf(fp, "old\n");
6256 # else
6257         make an error
6258 # endif
6259 #endif
6260         ${cf_cv_main_return:-return}(0);
6261 }
6262 _ACEOF
6263 rm -f conftest$ac_exeext
6264 if { (eval echo "$as_me:6264: \"$ac_link\"") >&5
6265   (eval $ac_link) 2>&5
6266   ac_status=$?
6267   echo "$as_me:6267: \$? = $ac_status" >&5
6268   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6269   { (eval echo "$as_me:6269: \"$ac_try\"") >&5
6270   (eval $ac_try) 2>&5
6271   ac_status=$?
6272   echo "$as_me:6272: \$? = $ac_status" >&5
6273   (exit $ac_status); }; }; then
6274
6275         cf_cv_ncurses_version=`cat $cf_tempfile`
6276 else
6277   echo "$as_me: program exited with status $ac_status" >&5
6278 echo "$as_me: failed program was:" >&5
6279 cat conftest.$ac_ext >&5
6280 fi
6281 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6282 fi
6283         rm -f $cf_tempfile
6284
6285 fi
6286 echo "$as_me:6286: result: $cf_cv_ncurses_version" >&5
6287 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6288 test "$cf_cv_ncurses_version" = no ||
6289 cat >>confdefs.h <<\EOF
6290 #define NCURSES 1
6291 EOF
6292
6293 echo "$as_me:6293: checking if we have identified curses libraries" >&5
6294 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6295 cat >conftest.$ac_ext <<_ACEOF
6296 #line 6296 "configure"
6297 #include "confdefs.h"
6298 #include <${cf_cv_ncurses_header:-curses.h}>
6299 int
6300 main (void)
6301 {
6302 initscr(); tgoto("?", 0,0)
6303   ;
6304   return 0;
6305 }
6306 _ACEOF
6307 rm -f conftest.$ac_objext conftest$ac_exeext
6308 if { (eval echo "$as_me:6308: \"$ac_link\"") >&5
6309   (eval $ac_link) 2>&5
6310   ac_status=$?
6311   echo "$as_me:6311: \$? = $ac_status" >&5
6312   (exit $ac_status); } &&
6313          { ac_try='test -s conftest$ac_exeext'
6314   { (eval echo "$as_me:6314: \"$ac_try\"") >&5
6315   (eval $ac_try) 2>&5
6316   ac_status=$?
6317   echo "$as_me:6317: \$? = $ac_status" >&5
6318   (exit $ac_status); }; }; then
6319   cf_result=yes
6320 else
6321   echo "$as_me: failed program was:" >&5
6322 cat conftest.$ac_ext >&5
6323 cf_result=no
6324 fi
6325 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6326 echo "$as_me:6326: result: $cf_result" >&5
6327 echo "${ECHO_T}$cf_result" >&6
6328
6329 if test "$cf_result" = no ; then
6330 case $host_os in
6331 (freebsd*)
6332         echo "$as_me:6332: checking for tgoto in -lmytinfo" >&5
6333 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6334 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6335   echo $ECHO_N "(cached) $ECHO_C" >&6
6336 else
6337   ac_check_lib_save_LIBS=$LIBS
6338 LIBS="-lmytinfo  $LIBS"
6339 cat >conftest.$ac_ext <<_ACEOF
6340 #line 6340 "configure"
6341 #include "confdefs.h"
6342
6343 /* Override any gcc2 internal prototype to avoid an error.  */
6344 #ifdef __cplusplus
6345 extern "C"
6346 #endif
6347 /* We use char because int might match the return type of a gcc2
6348    builtin and then its argument prototype would still apply.  */
6349 char tgoto ();
6350 int
6351 main (void)
6352 {
6353 tgoto ();
6354   ;
6355   return 0;
6356 }
6357 _ACEOF
6358 rm -f conftest.$ac_objext conftest$ac_exeext
6359 if { (eval echo "$as_me:6359: \"$ac_link\"") >&5
6360   (eval $ac_link) 2>&5
6361   ac_status=$?
6362   echo "$as_me:6362: \$? = $ac_status" >&5
6363   (exit $ac_status); } &&
6364          { ac_try='test -s conftest$ac_exeext'
6365   { (eval echo "$as_me:6365: \"$ac_try\"") >&5
6366   (eval $ac_try) 2>&5
6367   ac_status=$?
6368   echo "$as_me:6368: \$? = $ac_status" >&5
6369   (exit $ac_status); }; }; then
6370   ac_cv_lib_mytinfo_tgoto=yes
6371 else
6372   echo "$as_me: failed program was:" >&5
6373 cat conftest.$ac_ext >&5
6374 ac_cv_lib_mytinfo_tgoto=no
6375 fi
6376 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6377 LIBS=$ac_check_lib_save_LIBS
6378 fi
6379 echo "$as_me:6379: result: $ac_cv_lib_mytinfo_tgoto" >&5
6380 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6381 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6382
6383 cf_add_libs="$LIBS"
6384 # reverse order
6385 cf_add_0lib=
6386 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6387 # filter duplicates
6388 for cf_add_1lib in $cf_add_0lib; do
6389         for cf_add_2lib in $cf_add_libs; do
6390                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6391                         cf_add_1lib=
6392                         break
6393                 fi
6394         done
6395         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6396 done
6397 LIBS="$cf_add_libs"
6398
6399 fi
6400
6401         ;;
6402 (hpux10.*)
6403         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6404         # next (1998), and xcurses "newer" (2000).  There is no header file for
6405         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6406         # term.h) for cur_colr
6407         if test "x$cf_cv_screen" = "xcurses_colr"
6408         then
6409                 echo "$as_me:6409: checking for initscr in -lcur_colr" >&5
6410 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6411 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6412   echo $ECHO_N "(cached) $ECHO_C" >&6
6413 else
6414   ac_check_lib_save_LIBS=$LIBS
6415 LIBS="-lcur_colr  $LIBS"
6416 cat >conftest.$ac_ext <<_ACEOF
6417 #line 6417 "configure"
6418 #include "confdefs.h"
6419
6420 /* Override any gcc2 internal prototype to avoid an error.  */
6421 #ifdef __cplusplus
6422 extern "C"
6423 #endif
6424 /* We use char because int might match the return type of a gcc2
6425    builtin and then its argument prototype would still apply.  */
6426 char initscr ();
6427 int
6428 main (void)
6429 {
6430 initscr ();
6431   ;
6432   return 0;
6433 }
6434 _ACEOF
6435 rm -f conftest.$ac_objext conftest$ac_exeext
6436 if { (eval echo "$as_me:6436: \"$ac_link\"") >&5
6437   (eval $ac_link) 2>&5
6438   ac_status=$?
6439   echo "$as_me:6439: \$? = $ac_status" >&5
6440   (exit $ac_status); } &&
6441          { ac_try='test -s conftest$ac_exeext'
6442   { (eval echo "$as_me:6442: \"$ac_try\"") >&5
6443   (eval $ac_try) 2>&5
6444   ac_status=$?
6445   echo "$as_me:6445: \$? = $ac_status" >&5
6446   (exit $ac_status); }; }; then
6447   ac_cv_lib_cur_colr_initscr=yes
6448 else
6449   echo "$as_me: failed program was:" >&5
6450 cat conftest.$ac_ext >&5
6451 ac_cv_lib_cur_colr_initscr=no
6452 fi
6453 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6454 LIBS=$ac_check_lib_save_LIBS
6455 fi
6456 echo "$as_me:6456: result: $ac_cv_lib_cur_colr_initscr" >&5
6457 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6458 if test $ac_cv_lib_cur_colr_initscr = yes; then
6459
6460 cf_add_libs="$LIBS"
6461 # reverse order
6462 cf_add_0lib=
6463 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6464 # filter duplicates
6465 for cf_add_1lib in $cf_add_0lib; do
6466         for cf_add_2lib in $cf_add_libs; do
6467                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6468                         cf_add_1lib=
6469                         break
6470                 fi
6471         done
6472         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6473 done
6474 LIBS="$cf_add_libs"
6475
6476                         ac_cv_func_initscr=yes
6477
6478 else
6479
6480                 echo "$as_me:6480: checking for initscr in -lHcurses" >&5
6481 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6482 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6483   echo $ECHO_N "(cached) $ECHO_C" >&6
6484 else
6485   ac_check_lib_save_LIBS=$LIBS
6486 LIBS="-lHcurses  $LIBS"
6487 cat >conftest.$ac_ext <<_ACEOF
6488 #line 6488 "configure"
6489 #include "confdefs.h"
6490
6491 /* Override any gcc2 internal prototype to avoid an error.  */
6492 #ifdef __cplusplus
6493 extern "C"
6494 #endif
6495 /* We use char because int might match the return type of a gcc2
6496    builtin and then its argument prototype would still apply.  */
6497 char initscr ();
6498 int
6499 main (void)
6500 {
6501 initscr ();
6502   ;
6503   return 0;
6504 }
6505 _ACEOF
6506 rm -f conftest.$ac_objext conftest$ac_exeext
6507 if { (eval echo "$as_me:6507: \"$ac_link\"") >&5
6508   (eval $ac_link) 2>&5
6509   ac_status=$?
6510   echo "$as_me:6510: \$? = $ac_status" >&5
6511   (exit $ac_status); } &&
6512          { ac_try='test -s conftest$ac_exeext'
6513   { (eval echo "$as_me:6513: \"$ac_try\"") >&5
6514   (eval $ac_try) 2>&5
6515   ac_status=$?
6516   echo "$as_me:6516: \$? = $ac_status" >&5
6517   (exit $ac_status); }; }; then
6518   ac_cv_lib_Hcurses_initscr=yes
6519 else
6520   echo "$as_me: failed program was:" >&5
6521 cat conftest.$ac_ext >&5
6522 ac_cv_lib_Hcurses_initscr=no
6523 fi
6524 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6525 LIBS=$ac_check_lib_save_LIBS
6526 fi
6527 echo "$as_me:6527: result: $ac_cv_lib_Hcurses_initscr" >&5
6528 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6529 if test $ac_cv_lib_Hcurses_initscr = yes; then
6530
6531                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6532
6533 cf_add_libs="$LIBS"
6534 # reverse order
6535 cf_add_0lib=
6536 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6537 # filter duplicates
6538 for cf_add_1lib in $cf_add_0lib; do
6539         for cf_add_2lib in $cf_add_libs; do
6540                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6541                         cf_add_1lib=
6542                         break
6543                 fi
6544         done
6545         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6546 done
6547 LIBS="$cf_add_libs"
6548
6549         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6550         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6551
6552                         ac_cv_func_initscr=yes
6553
6554 fi
6555
6556 fi
6557
6558         fi
6559         ;;
6560 (linux*)
6561         case `arch 2>/dev/null` in
6562         (x86_64)
6563                 if test -d /lib64
6564                 then
6565
6566 if test -n "/lib64" ; then
6567         for cf_add_libdir in /lib64
6568         do
6569                 if test $cf_add_libdir = /usr/lib ; then
6570                         :
6571                 elif test -d $cf_add_libdir
6572                 then
6573                         cf_have_libdir=no
6574                         if test -n "$LDFLAGS$LIBS" ; then
6575                                 # a loop is needed to ensure we can add subdirs of existing dirs
6576                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6577                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6578                                                 cf_have_libdir=yes; break
6579                                         fi
6580                                 done
6581                         fi
6582                         if test "$cf_have_libdir" = no ; then
6583                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6584
6585 echo "${as_me:-configure}:6585: testing adding $cf_add_libdir to library-path ..." 1>&5
6586
6587                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6588                         fi
6589                 fi
6590         done
6591 fi
6592
6593                 else
6594
6595 if test -n "/lib" ; then
6596         for cf_add_libdir in /lib
6597         do
6598                 if test $cf_add_libdir = /usr/lib ; then
6599                         :
6600                 elif test -d $cf_add_libdir
6601                 then
6602                         cf_have_libdir=no
6603                         if test -n "$LDFLAGS$LIBS" ; then
6604                                 # a loop is needed to ensure we can add subdirs of existing dirs
6605                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6606                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6607                                                 cf_have_libdir=yes; break
6608                                         fi
6609                                 done
6610                         fi
6611                         if test "$cf_have_libdir" = no ; then
6612                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6613
6614 echo "${as_me:-configure}:6614: testing adding $cf_add_libdir to library-path ..." 1>&5
6615
6616                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6617                         fi
6618                 fi
6619         done
6620 fi
6621
6622                 fi
6623                 ;;
6624         (*)
6625
6626 if test -n "/lib" ; then
6627         for cf_add_libdir in /lib
6628         do
6629                 if test $cf_add_libdir = /usr/lib ; then
6630                         :
6631                 elif test -d $cf_add_libdir
6632                 then
6633                         cf_have_libdir=no
6634                         if test -n "$LDFLAGS$LIBS" ; then
6635                                 # a loop is needed to ensure we can add subdirs of existing dirs
6636                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6637                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6638                                                 cf_have_libdir=yes; break
6639                                         fi
6640                                 done
6641                         fi
6642                         if test "$cf_have_libdir" = no ; then
6643                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6644
6645 echo "${as_me:-configure}:6645: testing adding $cf_add_libdir to library-path ..." 1>&5
6646
6647                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6648                         fi
6649                 fi
6650         done
6651 fi
6652
6653                 ;;
6654         esac
6655         ;;
6656 (sunos3*|sunos4*)
6657         if test "x$cf_cv_screen" = "xcurses_5lib"
6658         then
6659                 if test -d /usr/5lib ; then
6660
6661 if test -n "/usr/5lib" ; then
6662         for cf_add_libdir in /usr/5lib
6663         do
6664                 if test $cf_add_libdir = /usr/lib ; then
6665                         :
6666                 elif test -d $cf_add_libdir
6667                 then
6668                         cf_have_libdir=no
6669                         if test -n "$LDFLAGS$LIBS" ; then
6670                                 # a loop is needed to ensure we can add subdirs of existing dirs
6671                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6672                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6673                                                 cf_have_libdir=yes; break
6674                                         fi
6675                                 done
6676                         fi
6677                         if test "$cf_have_libdir" = no ; then
6678                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6679
6680 echo "${as_me:-configure}:6680: testing adding $cf_add_libdir to library-path ..." 1>&5
6681
6682                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6683                         fi
6684                 fi
6685         done
6686 fi
6687
6688 cf_add_libs="$LIBS"
6689 # reverse order
6690 cf_add_0lib=
6691 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6692 # filter duplicates
6693 for cf_add_1lib in $cf_add_0lib; do
6694         for cf_add_2lib in $cf_add_libs; do
6695                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6696                         cf_add_1lib=
6697                         break
6698                 fi
6699         done
6700         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6701 done
6702 LIBS="$cf_add_libs"
6703
6704                 fi
6705         fi
6706         ac_cv_func_initscr=yes
6707         ;;
6708 esac
6709
6710 if test ".$ac_cv_func_initscr" != .yes ; then
6711         cf_save_LIBS="$LIBS"
6712
6713         if test ".${cf_cv_ncurses_version:-no}" != .no
6714         then
6715                 cf_check_list="ncurses curses cursesX"
6716         else
6717                 cf_check_list="cursesX curses ncurses"
6718         fi
6719
6720         # Check for library containing tgoto.  Do this before curses library
6721         # because it may be needed to link the test-case for initscr.
6722         if test "x$cf_term_lib" = x
6723         then
6724                 echo "$as_me:6724: checking for tgoto" >&5
6725 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6726 if test "${ac_cv_func_tgoto+set}" = set; then
6727   echo $ECHO_N "(cached) $ECHO_C" >&6
6728 else
6729   cat >conftest.$ac_ext <<_ACEOF
6730 #line 6730 "configure"
6731 #include "confdefs.h"
6732 #define tgoto autoconf_temporary
6733 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6734 #undef tgoto
6735
6736 #ifdef __cplusplus
6737 extern "C"
6738 #endif
6739
6740 /* We use char because int might match the return type of a gcc2
6741    builtin and then its argument prototype would still apply.  */
6742 char tgoto (void);
6743
6744 int
6745 main (void)
6746 {
6747
6748 /* The GNU C library defines stubs for functions which it implements
6749     to always fail with ENOSYS.  Some functions are actually named
6750     something starting with __ and the normal name is an alias.  */
6751 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6752 #error found stub for tgoto
6753 #endif
6754
6755         return tgoto ();
6756   ;
6757   return 0;
6758 }
6759 _ACEOF
6760 rm -f conftest.$ac_objext conftest$ac_exeext
6761 if { (eval echo "$as_me:6761: \"$ac_link\"") >&5
6762   (eval $ac_link) 2>&5
6763   ac_status=$?
6764   echo "$as_me:6764: \$? = $ac_status" >&5
6765   (exit $ac_status); } &&
6766          { ac_try='test -s conftest$ac_exeext'
6767   { (eval echo "$as_me:6767: \"$ac_try\"") >&5
6768   (eval $ac_try) 2>&5
6769   ac_status=$?
6770   echo "$as_me:6770: \$? = $ac_status" >&5
6771   (exit $ac_status); }; }; then
6772   ac_cv_func_tgoto=yes
6773 else
6774   echo "$as_me: failed program was:" >&5
6775 cat conftest.$ac_ext >&5
6776 ac_cv_func_tgoto=no
6777 fi
6778 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6779 fi
6780 echo "$as_me:6780: result: $ac_cv_func_tgoto" >&5
6781 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6782 if test $ac_cv_func_tgoto = yes; then
6783   cf_term_lib=predefined
6784 else
6785
6786                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6787                         do
6788                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6789 echo "$as_me:6789: checking for tgoto in -l$cf_term_lib" >&5
6790 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6791 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6792   echo $ECHO_N "(cached) $ECHO_C" >&6
6793 else
6794   ac_check_lib_save_LIBS=$LIBS
6795 LIBS="-l$cf_term_lib  $LIBS"
6796 cat >conftest.$ac_ext <<_ACEOF
6797 #line 6797 "configure"
6798 #include "confdefs.h"
6799
6800 /* Override any gcc2 internal prototype to avoid an error.  */
6801 #ifdef __cplusplus
6802 extern "C"
6803 #endif
6804 /* We use char because int might match the return type of a gcc2
6805    builtin and then its argument prototype would still apply.  */
6806 char tgoto ();
6807 int
6808 main (void)
6809 {
6810 tgoto ();
6811   ;
6812   return 0;
6813 }
6814 _ACEOF
6815 rm -f conftest.$ac_objext conftest$ac_exeext
6816 if { (eval echo "$as_me:6816: \"$ac_link\"") >&5
6817   (eval $ac_link) 2>&5
6818   ac_status=$?
6819   echo "$as_me:6819: \$? = $ac_status" >&5
6820   (exit $ac_status); } &&
6821          { ac_try='test -s conftest$ac_exeext'
6822   { (eval echo "$as_me:6822: \"$ac_try\"") >&5
6823   (eval $ac_try) 2>&5
6824   ac_status=$?
6825   echo "$as_me:6825: \$? = $ac_status" >&5
6826   (exit $ac_status); }; }; then
6827   eval "$as_ac_Lib=yes"
6828 else
6829   echo "$as_me: failed program was:" >&5
6830 cat conftest.$ac_ext >&5
6831 eval "$as_ac_Lib=no"
6832 fi
6833 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6834 LIBS=$ac_check_lib_save_LIBS
6835 fi
6836 echo "$as_me:6836: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6837 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6838 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6839
6840                                         : ${cf_nculib_root:=$cf_term_lib}
6841                                         break
6842
6843 fi
6844
6845                         done
6846
6847 fi
6848
6849         fi
6850
6851         # Check for library containing initscr
6852         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6853         if test "x$cf_curs_lib" = x
6854         then
6855                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6856                 do
6857                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6858                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6859                                 echo "$as_me:6859: checking if we can link with $cf_curs_lib library" >&5
6860 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6861                                 cat >conftest.$ac_ext <<_ACEOF
6862 #line 6862 "configure"
6863 #include "confdefs.h"
6864 #include <${cf_cv_ncurses_header:-curses.h}>
6865 int
6866 main (void)
6867 {
6868 initscr()
6869   ;
6870   return 0;
6871 }
6872 _ACEOF
6873 rm -f conftest.$ac_objext conftest$ac_exeext
6874 if { (eval echo "$as_me:6874: \"$ac_link\"") >&5
6875   (eval $ac_link) 2>&5
6876   ac_status=$?
6877   echo "$as_me:6877: \$? = $ac_status" >&5
6878   (exit $ac_status); } &&
6879          { ac_try='test -s conftest$ac_exeext'
6880   { (eval echo "$as_me:6880: \"$ac_try\"") >&5
6881   (eval $ac_try) 2>&5
6882   ac_status=$?
6883   echo "$as_me:6883: \$? = $ac_status" >&5
6884   (exit $ac_status); }; }; then
6885   cf_result=yes
6886 else
6887   echo "$as_me: failed program was:" >&5
6888 cat conftest.$ac_ext >&5
6889 cf_result=no
6890 fi
6891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6892                                 echo "$as_me:6892: result: $cf_result" >&5
6893 echo "${ECHO_T}$cf_result" >&6
6894                                 test $cf_result = yes && break
6895                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6896                                 cf_result=no
6897                         elif test "$cf_term_lib" != predefined ; then
6898                                 echo "$as_me:6898: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6899 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6900                                 cat >conftest.$ac_ext <<_ACEOF
6901 #line 6901 "configure"
6902 #include "confdefs.h"
6903 #include <${cf_cv_ncurses_header:-curses.h}>
6904 int
6905 main (void)
6906 {
6907 initscr(); tgoto((char *)0, 0, 0);
6908   ;
6909   return 0;
6910 }
6911 _ACEOF
6912 rm -f conftest.$ac_objext conftest$ac_exeext
6913 if { (eval echo "$as_me:6913: \"$ac_link\"") >&5
6914   (eval $ac_link) 2>&5
6915   ac_status=$?
6916   echo "$as_me:6916: \$? = $ac_status" >&5
6917   (exit $ac_status); } &&
6918          { ac_try='test -s conftest$ac_exeext'
6919   { (eval echo "$as_me:6919: \"$ac_try\"") >&5
6920   (eval $ac_try) 2>&5
6921   ac_status=$?
6922   echo "$as_me:6922: \$? = $ac_status" >&5
6923   (exit $ac_status); }; }; then
6924   cf_result=no
6925 else
6926   echo "$as_me: failed program was:" >&5
6927 cat conftest.$ac_ext >&5
6928
6929                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6930                                         cat >conftest.$ac_ext <<_ACEOF
6931 #line 6931 "configure"
6932 #include "confdefs.h"
6933 #include <${cf_cv_ncurses_header:-curses.h}>
6934 int
6935 main (void)
6936 {
6937 initscr()
6938   ;
6939   return 0;
6940 }
6941 _ACEOF
6942 rm -f conftest.$ac_objext conftest$ac_exeext
6943 if { (eval echo "$as_me:6943: \"$ac_link\"") >&5
6944   (eval $ac_link) 2>&5
6945   ac_status=$?
6946   echo "$as_me:6946: \$? = $ac_status" >&5
6947   (exit $ac_status); } &&
6948          { ac_try='test -s conftest$ac_exeext'
6949   { (eval echo "$as_me:6949: \"$ac_try\"") >&5
6950   (eval $ac_try) 2>&5
6951   ac_status=$?
6952   echo "$as_me:6952: \$? = $ac_status" >&5
6953   (exit $ac_status); }; }; then
6954   cf_result=yes
6955 else
6956   echo "$as_me: failed program was:" >&5
6957 cat conftest.$ac_ext >&5
6958 cf_result=error
6959 fi
6960 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6961
6962 fi
6963 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6964                                 echo "$as_me:6964: result: $cf_result" >&5
6965 echo "${ECHO_T}$cf_result" >&6
6966                                 test $cf_result != error && break
6967                         fi
6968                 done
6969         fi
6970         test $cf_curs_lib = unknown && { { echo "$as_me:6970: error: no curses library found" >&5
6971 echo "$as_me: error: no curses library found" >&2;}
6972    { (exit 1); exit 1; }; }
6973 fi
6974 fi
6975
6976         ;;
6977 (ncursesw*)
6978
6979 echo "$as_me:6979: checking for multibyte character support" >&5
6980 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6981 if test "${cf_cv_utf8_lib+set}" = set; then
6982   echo $ECHO_N "(cached) $ECHO_C" >&6
6983 else
6984
6985         cf_save_LIBS="$LIBS"
6986         cat >conftest.$ac_ext <<_ACEOF
6987 #line 6987 "configure"
6988 #include "confdefs.h"
6989
6990 #include <stdlib.h>
6991 int
6992 main (void)
6993 {
6994 putwc(0,0);
6995   ;
6996   return 0;
6997 }
6998 _ACEOF
6999 rm -f conftest.$ac_objext conftest$ac_exeext
7000 if { (eval echo "$as_me:7000: \"$ac_link\"") >&5
7001   (eval $ac_link) 2>&5
7002   ac_status=$?
7003   echo "$as_me:7003: \$? = $ac_status" >&5
7004   (exit $ac_status); } &&
7005          { ac_try='test -s conftest$ac_exeext'
7006   { (eval echo "$as_me:7006: \"$ac_try\"") >&5
7007   (eval $ac_try) 2>&5
7008   ac_status=$?
7009   echo "$as_me:7009: \$? = $ac_status" >&5
7010   (exit $ac_status); }; }; then
7011   cf_cv_utf8_lib=yes
7012 else
7013   echo "$as_me: failed program was:" >&5
7014 cat conftest.$ac_ext >&5
7015
7016 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7017 # will be set on completion of the AC_TRY_LINK below.
7018 cf_cv_header_path_utf8=
7019 cf_cv_library_path_utf8=
7020
7021 echo "${as_me:-configure}:7021: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7022
7023 cf_save_LIBS="$LIBS"
7024
7025 cat >conftest.$ac_ext <<_ACEOF
7026 #line 7026 "configure"
7027 #include "confdefs.h"
7028
7029 #include <libutf8.h>
7030 int
7031 main (void)
7032 {
7033 putwc(0,0);
7034   ;
7035   return 0;
7036 }
7037 _ACEOF
7038 rm -f conftest.$ac_objext conftest$ac_exeext
7039 if { (eval echo "$as_me:7039: \"$ac_link\"") >&5
7040   (eval $ac_link) 2>&5
7041   ac_status=$?
7042   echo "$as_me:7042: \$? = $ac_status" >&5
7043   (exit $ac_status); } &&
7044          { ac_try='test -s conftest$ac_exeext'
7045   { (eval echo "$as_me:7045: \"$ac_try\"") >&5
7046   (eval $ac_try) 2>&5
7047   ac_status=$?
7048   echo "$as_me:7048: \$? = $ac_status" >&5
7049   (exit $ac_status); }; }; then
7050
7051         cf_cv_find_linkage_utf8=yes
7052         cf_cv_header_path_utf8=/usr/include
7053         cf_cv_library_path_utf8=/usr/lib
7054
7055 else
7056   echo "$as_me: failed program was:" >&5
7057 cat conftest.$ac_ext >&5
7058
7059 LIBS="-lutf8  $cf_save_LIBS"
7060
7061 cat >conftest.$ac_ext <<_ACEOF
7062 #line 7062 "configure"
7063 #include "confdefs.h"
7064
7065 #include <libutf8.h>
7066 int
7067 main (void)
7068 {
7069 putwc(0,0);
7070   ;
7071   return 0;
7072 }
7073 _ACEOF
7074 rm -f conftest.$ac_objext conftest$ac_exeext
7075 if { (eval echo "$as_me:7075: \"$ac_link\"") >&5
7076   (eval $ac_link) 2>&5
7077   ac_status=$?
7078   echo "$as_me:7078: \$? = $ac_status" >&5
7079   (exit $ac_status); } &&
7080          { ac_try='test -s conftest$ac_exeext'
7081   { (eval echo "$as_me:7081: \"$ac_try\"") >&5
7082   (eval $ac_try) 2>&5
7083   ac_status=$?
7084   echo "$as_me:7084: \$? = $ac_status" >&5
7085   (exit $ac_status); }; }; then
7086
7087         cf_cv_find_linkage_utf8=yes
7088         cf_cv_header_path_utf8=/usr/include
7089         cf_cv_library_path_utf8=/usr/lib
7090         cf_cv_library_file_utf8="-lutf8"
7091
7092 else
7093   echo "$as_me: failed program was:" >&5
7094 cat conftest.$ac_ext >&5
7095
7096         cf_cv_find_linkage_utf8=no
7097         LIBS="$cf_save_LIBS"
7098
7099         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7100
7101 echo "${as_me:-configure}:7101: testing find linkage for utf8 library ..." 1>&5
7102
7103 echo "${as_me:-configure}:7103: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7104
7105         cf_save_CPPFLAGS="$CPPFLAGS"
7106         cf_test_CPPFLAGS="$CPPFLAGS"
7107
7108 cf_search=
7109
7110 # collect the current set of include-directories from compiler flags
7111 cf_header_path_list=""
7112 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7113         for cf_header_path in $CPPFLAGS $CFLAGS
7114         do
7115                 case $cf_header_path in
7116                 (-I*)
7117                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7118
7119 test "x$cf_header_path" != "xNONE" && \
7120 test -d "$cf_header_path" && \
7121  {
7122         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7123         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7124         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7125         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7126         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7127         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7128 }
7129
7130                         cf_header_path_list="$cf_header_path_list $cf_search"
7131                         ;;
7132                 esac
7133         done
7134 fi
7135
7136 # add the variations for the package we are looking for
7137
7138 cf_search=
7139
7140 test "x$prefix" != "xNONE" && \
7141 test -d "$prefix" && \
7142  {
7143         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7144         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7145         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7146         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7147         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7148         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7149 }
7150
7151 for cf_subdir_prefix in \
7152         /usr \
7153         /usr/local \
7154         /usr/pkg \
7155         /opt \
7156         /opt/local \
7157         $HOME
7158 do
7159
7160 test "x$cf_subdir_prefix" != "x$prefix" && \
7161 test -d "$cf_subdir_prefix" && \
7162 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7163         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7164         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7165         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7166         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7167         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7168         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7169 }
7170
7171 done
7172
7173 test "$includedir" != NONE && \
7174 test "$includedir" != "/usr/include" && \
7175 test -d "$includedir" && {
7176         test -d $includedir &&    cf_search="$cf_search $includedir"
7177         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7178 }
7179
7180 test "$oldincludedir" != NONE && \
7181 test "$oldincludedir" != "/usr/include" && \
7182 test -d "$oldincludedir" && {
7183         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7184         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7185 }
7186
7187 cf_search="$cf_search $cf_header_path_list"
7188
7189         for cf_cv_header_path_utf8 in $cf_search
7190         do
7191                 if test -d $cf_cv_header_path_utf8 ; then
7192                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7193
7194 echo "${as_me:-configure}:7194: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7195
7196                         CPPFLAGS="$cf_save_CPPFLAGS"
7197
7198         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7199         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7200
7201                         cat >conftest.$ac_ext <<_ACEOF
7202 #line 7202 "configure"
7203 #include "confdefs.h"
7204
7205 #include <libutf8.h>
7206 int
7207 main (void)
7208 {
7209 putwc(0,0);
7210   ;
7211   return 0;
7212 }
7213 _ACEOF
7214 rm -f conftest.$ac_objext
7215 if { (eval echo "$as_me:7215: \"$ac_compile\"") >&5
7216   (eval $ac_compile) 2>&5
7217   ac_status=$?
7218   echo "$as_me:7218: \$? = $ac_status" >&5
7219   (exit $ac_status); } &&
7220          { ac_try='test -s conftest.$ac_objext'
7221   { (eval echo "$as_me:7221: \"$ac_try\"") >&5
7222   (eval $ac_try) 2>&5
7223   ac_status=$?
7224   echo "$as_me:7224: \$? = $ac_status" >&5
7225   (exit $ac_status); }; }; then
7226
7227                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7228
7229 echo "${as_me:-configure}:7229: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7230
7231                                 cf_cv_find_linkage_utf8=maybe
7232                                 cf_test_CPPFLAGS="$CPPFLAGS"
7233                                 break
7234 else
7235   echo "$as_me: failed program was:" >&5
7236 cat conftest.$ac_ext >&5
7237
7238                                 CPPFLAGS="$cf_save_CPPFLAGS"
7239
7240 fi
7241 rm -f conftest.$ac_objext conftest.$ac_ext
7242                 fi
7243         done
7244
7245         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7246
7247 echo "${as_me:-configure}:7247: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7248
7249                 cf_save_LIBS="$LIBS"
7250                 cf_save_LDFLAGS="$LDFLAGS"
7251
7252                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7253
7254 cf_search=
7255 cf_library_path_list=""
7256 if test -n "${LDFLAGS}${LIBS}" ; then
7257         for cf_library_path in $LDFLAGS $LIBS
7258         do
7259                 case $cf_library_path in
7260                 (-L*)
7261                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7262
7263 test "x$cf_library_path" != "xNONE" && \
7264 test -d "$cf_library_path" && \
7265  {
7266         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7267         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7268         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7269         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7270         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7271         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7272 }
7273
7274                         cf_library_path_list="$cf_library_path_list $cf_search"
7275                         ;;
7276                 esac
7277         done
7278 fi
7279
7280 cf_search=
7281
7282 test "x$prefix" != "xNONE" && \
7283 test -d "$prefix" && \
7284  {
7285         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7286         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7287         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7288         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7289         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7290         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7291 }
7292
7293 for cf_subdir_prefix in \
7294         /usr \
7295         /usr/local \
7296         /usr/pkg \
7297         /opt \
7298         /opt/local \
7299         $HOME
7300 do
7301
7302 test "x$cf_subdir_prefix" != "x$prefix" && \
7303 test -d "$cf_subdir_prefix" && \
7304 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7305         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7306         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7307         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7308         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7309         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7310         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7311 }
7312
7313 done
7314
7315 cf_search="$cf_library_path_list $cf_search"
7316
7317                         for cf_cv_library_path_utf8 in $cf_search
7318                         do
7319                                 if test -d $cf_cv_library_path_utf8 ; then
7320                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7321
7322 echo "${as_me:-configure}:7322: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7323
7324                                         CPPFLAGS="$cf_test_CPPFLAGS"
7325                                         LIBS="-lutf8  $cf_save_LIBS"
7326                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7327                                         cat >conftest.$ac_ext <<_ACEOF
7328 #line 7328 "configure"
7329 #include "confdefs.h"
7330
7331 #include <libutf8.h>
7332 int
7333 main (void)
7334 {
7335 putwc(0,0);
7336   ;
7337   return 0;
7338 }
7339 _ACEOF
7340 rm -f conftest.$ac_objext conftest$ac_exeext
7341 if { (eval echo "$as_me:7341: \"$ac_link\"") >&5
7342   (eval $ac_link) 2>&5
7343   ac_status=$?
7344   echo "$as_me:7344: \$? = $ac_status" >&5
7345   (exit $ac_status); } &&
7346          { ac_try='test -s conftest$ac_exeext'
7347   { (eval echo "$as_me:7347: \"$ac_try\"") >&5
7348   (eval $ac_try) 2>&5
7349   ac_status=$?
7350   echo "$as_me:7350: \$? = $ac_status" >&5
7351   (exit $ac_status); }; }; then
7352
7353                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7354
7355 echo "${as_me:-configure}:7355: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7356
7357                                         cf_cv_find_linkage_utf8=yes
7358                                         cf_cv_library_file_utf8="-lutf8"
7359                                         break
7360 else
7361   echo "$as_me: failed program was:" >&5
7362 cat conftest.$ac_ext >&5
7363
7364                                         CPPFLAGS="$cf_save_CPPFLAGS"
7365                                         LIBS="$cf_save_LIBS"
7366                                         LDFLAGS="$cf_save_LDFLAGS"
7367
7368 fi
7369 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7370                                 fi
7371                         done
7372                         CPPFLAGS="$cf_save_CPPFLAGS"
7373                         LDFLAGS="$cf_save_LDFLAGS"
7374                 fi
7375
7376         else
7377                 cf_cv_find_linkage_utf8=no
7378         fi
7379
7380 fi
7381 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7382
7383 fi
7384 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7385
7386 LIBS="$cf_save_LIBS"
7387
7388 if test "$cf_cv_find_linkage_utf8" = yes ; then
7389 cf_cv_utf8_lib=add-on
7390 else
7391 cf_cv_utf8_lib=no
7392 fi
7393
7394 fi
7395 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7396 fi
7397 echo "$as_me:7397: result: $cf_cv_utf8_lib" >&5
7398 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7399
7400 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7401 # ncurses/ncursesw:
7402 if test "$cf_cv_utf8_lib" = "add-on" ; then
7403
7404 cat >>confdefs.h <<\EOF
7405 #define HAVE_LIBUTF8_H 1
7406 EOF
7407
7408 if test -n "$cf_cv_header_path_utf8" ; then
7409   for cf_add_incdir in $cf_cv_header_path_utf8
7410   do
7411         while test $cf_add_incdir != /usr/include
7412         do
7413           if test -d $cf_add_incdir
7414           then
7415                 cf_have_incdir=no
7416                 if test -n "$CFLAGS$CPPFLAGS" ; then
7417                   # a loop is needed to ensure we can add subdirs of existing dirs
7418                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7419                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7420                           cf_have_incdir=yes; break
7421                         fi
7422                   done
7423                 fi
7424
7425                 if test "$cf_have_incdir" = no ; then
7426                   if test "$cf_add_incdir" = /usr/local/include ; then
7427                         if test "$GCC" = yes
7428                         then
7429                           cf_save_CPPFLAGS=$CPPFLAGS
7430
7431         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7432         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7433
7434                           cat >conftest.$ac_ext <<_ACEOF
7435 #line 7435 "configure"
7436 #include "confdefs.h"
7437 #include <stdio.h>
7438 int
7439 main (void)
7440 {
7441 printf("Hello")
7442   ;
7443   return 0;
7444 }
7445 _ACEOF
7446 rm -f conftest.$ac_objext
7447 if { (eval echo "$as_me:7447: \"$ac_compile\"") >&5
7448   (eval $ac_compile) 2>&5
7449   ac_status=$?
7450   echo "$as_me:7450: \$? = $ac_status" >&5
7451   (exit $ac_status); } &&
7452          { ac_try='test -s conftest.$ac_objext'
7453   { (eval echo "$as_me:7453: \"$ac_try\"") >&5
7454   (eval $ac_try) 2>&5
7455   ac_status=$?
7456   echo "$as_me:7456: \$? = $ac_status" >&5
7457   (exit $ac_status); }; }; then
7458   :
7459 else
7460   echo "$as_me: failed program was:" >&5
7461 cat conftest.$ac_ext >&5
7462 cf_have_incdir=yes
7463 fi
7464 rm -f conftest.$ac_objext conftest.$ac_ext
7465                           CPPFLAGS=$cf_save_CPPFLAGS
7466                         fi
7467                   fi
7468                 fi
7469
7470                 if test "$cf_have_incdir" = no ; then
7471                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7472
7473 echo "${as_me:-configure}:7473: testing adding $cf_add_incdir to include-path ..." 1>&5
7474
7475                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7476
7477                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7478                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7479                   cf_add_incdir="$cf_top_incdir"
7480                 else
7481                   break
7482                 fi
7483           else
7484                 break
7485           fi
7486         done
7487   done
7488 fi
7489
7490 if test -n "$cf_cv_library_path_utf8" ; then
7491         for cf_add_libdir in $cf_cv_library_path_utf8
7492         do
7493                 if test $cf_add_libdir = /usr/lib ; then
7494                         :
7495                 elif test -d $cf_add_libdir
7496                 then
7497                         cf_have_libdir=no
7498                         if test -n "$LDFLAGS$LIBS" ; then
7499                                 # a loop is needed to ensure we can add subdirs of existing dirs
7500                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7501                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7502                                                 cf_have_libdir=yes; break
7503                                         fi
7504                                 done
7505                         fi
7506                         if test "$cf_have_libdir" = no ; then
7507                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7508
7509 echo "${as_me:-configure}:7509: testing adding $cf_add_libdir to library-path ..." 1>&5
7510
7511                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7512                         fi
7513                 fi
7514         done
7515 fi
7516
7517 cf_add_libs="$LIBS"
7518 # reverse order
7519 cf_add_0lib=
7520 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7521 # filter duplicates
7522 for cf_add_1lib in $cf_add_0lib; do
7523         for cf_add_2lib in $cf_add_libs; do
7524                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7525                         cf_add_1lib=
7526                         break
7527                 fi
7528         done
7529         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7530 done
7531 LIBS="$cf_add_libs"
7532
7533 fi
7534
7535 cf_ncuconfig_root=$cf_cv_screen
7536 cf_have_ncuconfig=no
7537
7538 if test "x${PKG_CONFIG:=none}" != xnone; then
7539         echo "$as_me:7539: checking pkg-config for $cf_ncuconfig_root" >&5
7540 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7541         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7542                 echo "$as_me:7542: result: yes" >&5
7543 echo "${ECHO_T}yes" >&6
7544
7545                 echo "$as_me:7545: checking if the $cf_ncuconfig_root package files work" >&5
7546 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7547                 cf_have_ncuconfig=unknown
7548
7549                 cf_save_CPPFLAGS="$CPPFLAGS"
7550                 cf_save_LIBS="$LIBS"
7551
7552 cf_fix_cppflags=no
7553 cf_new_cflags=
7554 cf_new_cppflags=
7555 cf_new_extra_cppflags=
7556
7557 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
7558 do
7559 case $cf_fix_cppflags in
7560 (no)
7561         case $cf_add_cflags in
7562         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7563                 case $cf_add_cflags in
7564                 (-D*)
7565                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7566
7567                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7568                                 && test -z "${cf_tst_cflags}" \
7569                                 && cf_fix_cppflags=yes
7570
7571                         if test $cf_fix_cppflags = yes ; then
7572
7573         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7574         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7575
7576                                 continue
7577                         elif test "${cf_tst_cflags}" = "\"'" ; then
7578
7579         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7580         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7581
7582                                 continue
7583                         fi
7584                         ;;
7585                 esac
7586                 case "$CPPFLAGS" in
7587                 (*$cf_add_cflags)
7588                         ;;
7589                 (*)
7590                         case $cf_add_cflags in
7591                         (-D*)
7592                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7593
7594 CPPFLAGS=`echo "$CPPFLAGS" | \
7595         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7596                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7597
7598                                 ;;
7599                         esac
7600
7601         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7602         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7603
7604                         ;;
7605                 esac
7606                 ;;
7607         (*)
7608
7609         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7610         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7611
7612                 ;;
7613         esac
7614         ;;
7615 (yes)
7616
7617         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7618         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7619
7620         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7621
7622         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7623                 && test -z "${cf_tst_cflags}" \
7624                 && cf_fix_cppflags=no
7625         ;;
7626 esac
7627 done
7628
7629 if test -n "$cf_new_cflags" ; then
7630
7631         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7632         CFLAGS="${CFLAGS}$cf_new_cflags"
7633
7634 fi
7635
7636 if test -n "$cf_new_cppflags" ; then
7637
7638         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7639         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7640
7641 fi
7642
7643 if test -n "$cf_new_extra_cppflags" ; then
7644
7645         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7646         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7647
7648 fi
7649
7650 cf_add_libs="$LIBS"
7651 # reverse order
7652 cf_add_0lib=
7653 for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7654 # filter duplicates
7655 for cf_add_1lib in $cf_add_0lib; do
7656         for cf_add_2lib in $cf_add_libs; do
7657                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7658                         cf_add_1lib=
7659                         break
7660                 fi
7661         done
7662         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7663 done
7664 LIBS="$cf_add_libs"
7665
7666                 cat >conftest.$ac_ext <<_ACEOF
7667 #line 7667 "configure"
7668 #include "confdefs.h"
7669 #include <${cf_cv_ncurses_header:-curses.h}>
7670 int
7671 main (void)
7672 {
7673 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7674   ;
7675   return 0;
7676 }
7677 _ACEOF
7678 rm -f conftest.$ac_objext conftest$ac_exeext
7679 if { (eval echo "$as_me:7679: \"$ac_link\"") >&5
7680   (eval $ac_link) 2>&5
7681   ac_status=$?
7682   echo "$as_me:7682: \$? = $ac_status" >&5
7683   (exit $ac_status); } &&
7684          { ac_try='test -s conftest$ac_exeext'
7685   { (eval echo "$as_me:7685: \"$ac_try\"") >&5
7686   (eval $ac_try) 2>&5
7687   ac_status=$?
7688   echo "$as_me:7688: \$? = $ac_status" >&5
7689   (exit $ac_status); }; }; then
7690   if test "$cross_compiling" = yes; then
7691   cf_have_ncuconfig=maybe
7692 else
7693   cat >conftest.$ac_ext <<_ACEOF
7694 #line 7694 "configure"
7695 #include "confdefs.h"
7696 #include <${cf_cv_ncurses_header:-curses.h}>
7697                                 int main(void)
7698                                 { char *xx = curses_version(); return (xx == 0); }
7699 _ACEOF
7700 rm -f conftest$ac_exeext
7701 if { (eval echo "$as_me:7701: \"$ac_link\"") >&5
7702   (eval $ac_link) 2>&5
7703   ac_status=$?
7704   echo "$as_me:7704: \$? = $ac_status" >&5
7705   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7706   { (eval echo "$as_me:7706: \"$ac_try\"") >&5
7707   (eval $ac_try) 2>&5
7708   ac_status=$?
7709   echo "$as_me:7709: \$? = $ac_status" >&5
7710   (exit $ac_status); }; }; then
7711   cf_have_ncuconfig=yes
7712 else
7713   echo "$as_me: program exited with status $ac_status" >&5
7714 echo "$as_me: failed program was:" >&5
7715 cat conftest.$ac_ext >&5
7716 cf_have_ncuconfig=no
7717 fi
7718 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7719 fi
7720 else
7721   echo "$as_me: failed program was:" >&5
7722 cat conftest.$ac_ext >&5
7723 cf_have_ncuconfig=no
7724 fi
7725 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7726                 echo "$as_me:7726: result: $cf_have_ncuconfig" >&5
7727 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7728                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7729                 if test "$cf_have_ncuconfig" != "yes"
7730                 then
7731                         CPPFLAGS="$cf_save_CPPFLAGS"
7732                         LIBS="$cf_save_LIBS"
7733                         NCURSES_CONFIG_PKG=none
7734                 else
7735
7736 cat >>confdefs.h <<\EOF
7737 #define NCURSES 1
7738 EOF
7739
7740                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7741
7742 echo "$as_me:7742: checking for terminfo header" >&5
7743 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7744 if test "${cf_cv_term_header+set}" = set; then
7745   echo $ECHO_N "(cached) $ECHO_C" >&6
7746 else
7747
7748 case ${cf_cv_ncurses_header} in
7749 (*/ncurses.h|*/ncursesw.h)
7750         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7751         ;;
7752 (*)
7753         cf_term_header=term.h
7754         ;;
7755 esac
7756
7757 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7758 do
7759 cat >conftest.$ac_ext <<_ACEOF
7760 #line 7760 "configure"
7761 #include "confdefs.h"
7762 #include <stdio.h>
7763 #include <${cf_cv_ncurses_header:-curses.h}>
7764 #include <$cf_test>
7765
7766 int
7767 main (void)
7768 {
7769 int x = auto_left_margin
7770   ;
7771   return 0;
7772 }
7773 _ACEOF
7774 rm -f conftest.$ac_objext
7775 if { (eval echo "$as_me:7775: \"$ac_compile\"") >&5
7776   (eval $ac_compile) 2>&5
7777   ac_status=$?
7778   echo "$as_me:7778: \$? = $ac_status" >&5
7779   (exit $ac_status); } &&
7780          { ac_try='test -s conftest.$ac_objext'
7781   { (eval echo "$as_me:7781: \"$ac_try\"") >&5
7782   (eval $ac_try) 2>&5
7783   ac_status=$?
7784   echo "$as_me:7784: \$? = $ac_status" >&5
7785   (exit $ac_status); }; }; then
7786
7787         cf_cv_term_header="$cf_test"
7788 else
7789   echo "$as_me: failed program was:" >&5
7790 cat conftest.$ac_ext >&5
7791
7792         cf_cv_term_header=unknown
7793
7794 fi
7795 rm -f conftest.$ac_objext conftest.$ac_ext
7796         test "$cf_cv_term_header" != unknown && break
7797 done
7798
7799 fi
7800 echo "$as_me:7800: result: $cf_cv_term_header" >&5
7801 echo "${ECHO_T}$cf_cv_term_header" >&6
7802
7803 # Set definitions to allow ifdef'ing to accommodate subdirectories
7804
7805 case $cf_cv_term_header in
7806 (*term.h)
7807
7808 cat >>confdefs.h <<\EOF
7809 #define HAVE_TERM_H 1
7810 EOF
7811
7812         ;;
7813 esac
7814
7815 case $cf_cv_term_header in
7816 (ncurses/term.h)
7817
7818 cat >>confdefs.h <<\EOF
7819 #define HAVE_NCURSES_TERM_H 1
7820 EOF
7821
7822         ;;
7823 (ncursesw/term.h)
7824
7825 cat >>confdefs.h <<\EOF
7826 #define HAVE_NCURSESW_TERM_H 1
7827 EOF
7828
7829         ;;
7830 esac
7831
7832                 fi
7833
7834         else
7835                 echo "$as_me:7835: result: no" >&5
7836 echo "${ECHO_T}no" >&6
7837                 NCURSES_CONFIG_PKG=none
7838         fi
7839 else
7840         NCURSES_CONFIG_PKG=none
7841 fi
7842
7843 if test "x$cf_have_ncuconfig" = "xno"; then
7844         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7845
7846 if test -n "$ac_tool_prefix"; then
7847   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7848   do
7849     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7850 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7851 echo "$as_me:7851: checking for $ac_word" >&5
7852 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7853 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7854   echo $ECHO_N "(cached) $ECHO_C" >&6
7855 else
7856   if test -n "$NCURSES_CONFIG"; then
7857   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7858 else
7859   ac_save_IFS=$IFS; IFS=$ac_path_separator
7860 ac_dummy="$PATH"
7861 for ac_dir in $ac_dummy; do
7862   IFS=$ac_save_IFS
7863   test -z "$ac_dir" && ac_dir=.
7864   $as_executable_p "$ac_dir/$ac_word" || continue
7865 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7866 echo "$as_me:7866: found $ac_dir/$ac_word" >&5
7867 break
7868 done
7869
7870 fi
7871 fi
7872 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7873 if test -n "$NCURSES_CONFIG"; then
7874   echo "$as_me:7874: result: $NCURSES_CONFIG" >&5
7875 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7876 else
7877   echo "$as_me:7877: result: no" >&5
7878 echo "${ECHO_T}no" >&6
7879 fi
7880
7881     test -n "$NCURSES_CONFIG" && break
7882   done
7883 fi
7884 if test -z "$NCURSES_CONFIG"; then
7885   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7886   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7887 do
7888   # Extract the first word of "$ac_prog", so it can be a program name with args.
7889 set dummy $ac_prog; ac_word=$2
7890 echo "$as_me:7890: checking for $ac_word" >&5
7891 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7892 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7893   echo $ECHO_N "(cached) $ECHO_C" >&6
7894 else
7895   if test -n "$ac_ct_NCURSES_CONFIG"; then
7896   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7897 else
7898   ac_save_IFS=$IFS; IFS=$ac_path_separator
7899 ac_dummy="$PATH"
7900 for ac_dir in $ac_dummy; do
7901   IFS=$ac_save_IFS
7902   test -z "$ac_dir" && ac_dir=.
7903   $as_executable_p "$ac_dir/$ac_word" || continue
7904 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7905 echo "$as_me:7905: found $ac_dir/$ac_word" >&5
7906 break
7907 done
7908
7909 fi
7910 fi
7911 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7912 if test -n "$ac_ct_NCURSES_CONFIG"; then
7913   echo "$as_me:7913: result: $ac_ct_NCURSES_CONFIG" >&5
7914 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7915 else
7916   echo "$as_me:7916: result: no" >&5
7917 echo "${ECHO_T}no" >&6
7918 fi
7919
7920   test -n "$ac_ct_NCURSES_CONFIG" && break
7921 done
7922 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7923
7924   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7925 fi
7926
7927         if test "$NCURSES_CONFIG" != none ; then
7928
7929 cf_fix_cppflags=no
7930 cf_new_cflags=
7931 cf_new_cppflags=
7932 cf_new_extra_cppflags=
7933
7934 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7935 do
7936 case $cf_fix_cppflags in
7937 (no)
7938         case $cf_add_cflags in
7939         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7940                 case $cf_add_cflags in
7941                 (-D*)
7942                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7943
7944                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7945                                 && test -z "${cf_tst_cflags}" \
7946                                 && cf_fix_cppflags=yes
7947
7948                         if test $cf_fix_cppflags = yes ; then
7949
7950         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7951         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7952
7953                                 continue
7954                         elif test "${cf_tst_cflags}" = "\"'" ; then
7955
7956         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7957         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7958
7959                                 continue
7960                         fi
7961                         ;;
7962                 esac
7963                 case "$CPPFLAGS" in
7964                 (*$cf_add_cflags)
7965                         ;;
7966                 (*)
7967                         case $cf_add_cflags in
7968                         (-D*)
7969                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7970
7971 CPPFLAGS=`echo "$CPPFLAGS" | \
7972         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7973                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7974
7975                                 ;;
7976                         esac
7977
7978         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7979         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7980
7981                         ;;
7982                 esac
7983                 ;;
7984         (*)
7985
7986         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7987         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7988
7989                 ;;
7990         esac
7991         ;;
7992 (yes)
7993
7994         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7995         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7996
7997         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7998
7999         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8000                 && test -z "${cf_tst_cflags}" \
8001                 && cf_fix_cppflags=no
8002         ;;
8003 esac
8004 done
8005
8006 if test -n "$cf_new_cflags" ; then
8007
8008         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8009         CFLAGS="${CFLAGS}$cf_new_cflags"
8010
8011 fi
8012
8013 if test -n "$cf_new_cppflags" ; then
8014
8015         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8016         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8017
8018 fi
8019
8020 if test -n "$cf_new_extra_cppflags" ; then
8021
8022         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8023         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8024
8025 fi
8026
8027 cf_add_libs="$LIBS"
8028 # reverse order
8029 cf_add_0lib=
8030 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8031 # filter duplicates
8032 for cf_add_1lib in $cf_add_0lib; do
8033         for cf_add_2lib in $cf_add_libs; do
8034                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8035                         cf_add_1lib=
8036                         break
8037                 fi
8038         done
8039         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8040 done
8041 LIBS="$cf_add_libs"
8042
8043                 # even with config script, some packages use no-override for curses.h
8044
8045 echo "$as_me:8045: checking if we have identified curses headers" >&5
8046 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8047 if test "${cf_cv_ncurses_header+set}" = set; then
8048   echo $ECHO_N "(cached) $ECHO_C" >&6
8049 else
8050
8051 cf_cv_ncurses_header=none
8052 for cf_header in \
8053         ncurses.h $cf_cv_screen/ncurses.h \
8054         curses.h $cf_cv_screen/curses.h
8055 do
8056 cat >conftest.$ac_ext <<_ACEOF
8057 #line 8057 "configure"
8058 #include "confdefs.h"
8059 #include <${cf_header}>
8060 int
8061 main (void)
8062 {
8063 initscr(); tgoto("?", 0,0)
8064   ;
8065   return 0;
8066 }
8067 _ACEOF
8068 rm -f conftest.$ac_objext
8069 if { (eval echo "$as_me:8069: \"$ac_compile\"") >&5
8070   (eval $ac_compile) 2>&5
8071   ac_status=$?
8072   echo "$as_me:8072: \$? = $ac_status" >&5
8073   (exit $ac_status); } &&
8074          { ac_try='test -s conftest.$ac_objext'
8075   { (eval echo "$as_me:8075: \"$ac_try\"") >&5
8076   (eval $ac_try) 2>&5
8077   ac_status=$?
8078   echo "$as_me:8078: \$? = $ac_status" >&5
8079   (exit $ac_status); }; }; then
8080   cf_cv_ncurses_header=$cf_header; break
8081 else
8082   echo "$as_me: failed program was:" >&5
8083 cat conftest.$ac_ext >&5
8084 fi
8085 rm -f conftest.$ac_objext conftest.$ac_ext
8086 done
8087
8088 fi
8089 echo "$as_me:8089: result: $cf_cv_ncurses_header" >&5
8090 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8091
8092 if test "$cf_cv_ncurses_header" = none ; then
8093         { { echo "$as_me:8093: error: No curses header-files found" >&5
8094 echo "$as_me: error: No curses header-files found" >&2;}
8095    { (exit 1); exit 1; }; }
8096 fi
8097
8098 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8099
8100 for ac_header in $cf_cv_ncurses_header
8101 do
8102 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8103 echo "$as_me:8103: checking for $ac_header" >&5
8104 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8105 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8106   echo $ECHO_N "(cached) $ECHO_C" >&6
8107 else
8108   cat >conftest.$ac_ext <<_ACEOF
8109 #line 8109 "configure"
8110 #include "confdefs.h"
8111 #include <$ac_header>
8112 _ACEOF
8113 if { (eval echo "$as_me:8113: \"$ac_cpp conftest.$ac_ext\"") >&5
8114   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8115   ac_status=$?
8116   egrep -v '^ *\+' conftest.er1 >conftest.err
8117   rm -f conftest.er1
8118   cat conftest.err >&5
8119   echo "$as_me:8119: \$? = $ac_status" >&5
8120   (exit $ac_status); } >/dev/null; then
8121   if test -s conftest.err; then
8122     ac_cpp_err=$ac_c_preproc_warn_flag
8123   else
8124     ac_cpp_err=
8125   fi
8126 else
8127   ac_cpp_err=yes
8128 fi
8129 if test -z "$ac_cpp_err"; then
8130   eval "$as_ac_Header=yes"
8131 else
8132   echo "$as_me: failed program was:" >&5
8133   cat conftest.$ac_ext >&5
8134   eval "$as_ac_Header=no"
8135 fi
8136 rm -f conftest.err conftest.$ac_ext
8137 fi
8138 echo "$as_me:8138: result: `eval echo '${'$as_ac_Header'}'`" >&5
8139 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8140 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8141   cat >>confdefs.h <<EOF
8142 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8143 EOF
8144
8145 fi
8146 done
8147
8148 cat >>confdefs.h <<\EOF
8149 #define NCURSES 1
8150 EOF
8151
8152 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8153
8154                 cat >>confdefs.h <<EOF
8155 #define $cf_nculib_ROOT 1
8156 EOF
8157
8158                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8159
8160         else
8161
8162 cf_ncuhdr_root=$cf_cv_screen
8163
8164 test -n "$cf_cv_curses_dir" && \
8165 test "$cf_cv_curses_dir" != "no" && { \
8166
8167 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8168   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8169   do
8170         while test $cf_add_incdir != /usr/include
8171         do
8172           if test -d $cf_add_incdir
8173           then
8174                 cf_have_incdir=no
8175                 if test -n "$CFLAGS$CPPFLAGS" ; then
8176                   # a loop is needed to ensure we can add subdirs of existing dirs
8177                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8178                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8179                           cf_have_incdir=yes; break
8180                         fi
8181                   done
8182                 fi
8183
8184                 if test "$cf_have_incdir" = no ; then
8185                   if test "$cf_add_incdir" = /usr/local/include ; then
8186                         if test "$GCC" = yes
8187                         then
8188                           cf_save_CPPFLAGS=$CPPFLAGS
8189
8190         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8191         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8192
8193                           cat >conftest.$ac_ext <<_ACEOF
8194 #line 8194 "configure"
8195 #include "confdefs.h"
8196 #include <stdio.h>
8197 int
8198 main (void)
8199 {
8200 printf("Hello")
8201   ;
8202   return 0;
8203 }
8204 _ACEOF
8205 rm -f conftest.$ac_objext
8206 if { (eval echo "$as_me:8206: \"$ac_compile\"") >&5
8207   (eval $ac_compile) 2>&5
8208   ac_status=$?
8209   echo "$as_me:8209: \$? = $ac_status" >&5
8210   (exit $ac_status); } &&
8211          { ac_try='test -s conftest.$ac_objext'
8212   { (eval echo "$as_me:8212: \"$ac_try\"") >&5
8213   (eval $ac_try) 2>&5
8214   ac_status=$?
8215   echo "$as_me:8215: \$? = $ac_status" >&5
8216   (exit $ac_status); }; }; then
8217   :
8218 else
8219   echo "$as_me: failed program was:" >&5
8220 cat conftest.$ac_ext >&5
8221 cf_have_incdir=yes
8222 fi
8223 rm -f conftest.$ac_objext conftest.$ac_ext
8224                           CPPFLAGS=$cf_save_CPPFLAGS
8225                         fi
8226                   fi
8227                 fi
8228
8229                 if test "$cf_have_incdir" = no ; then
8230                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8231
8232 echo "${as_me:-configure}:8232: testing adding $cf_add_incdir to include-path ..." 1>&5
8233
8234                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8235
8236                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8237                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8238                   cf_add_incdir="$cf_top_incdir"
8239                 else
8240                   break
8241                 fi
8242           else
8243                 break
8244           fi
8245         done
8246   done
8247 fi
8248
8249 }
8250
8251 echo "$as_me:8251: checking for $cf_ncuhdr_root header in include-path" >&5
8252 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8253 if test "${cf_cv_ncurses_h+set}" = set; then
8254   echo $ECHO_N "(cached) $ECHO_C" >&6
8255 else
8256
8257         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8258         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8259         for cf_header in $cf_header_list
8260         do
8261
8262         cat >conftest.$ac_ext <<_ACEOF
8263 #line 8263 "configure"
8264 #include "confdefs.h"
8265
8266 #include <$cf_header>
8267 int
8268 main (void)
8269 {
8270
8271 #ifdef NCURSES_VERSION
8272
8273 printf("%s\n", NCURSES_VERSION);
8274 #else
8275 #ifdef __NCURSES_H
8276 printf("old\n");
8277 #else
8278         make an error
8279 #endif
8280 #endif
8281
8282   ;
8283   return 0;
8284 }
8285 _ACEOF
8286 rm -f conftest.$ac_objext
8287 if { (eval echo "$as_me:8287: \"$ac_compile\"") >&5
8288   (eval $ac_compile) 2>&5
8289   ac_status=$?
8290   echo "$as_me:8290: \$? = $ac_status" >&5
8291   (exit $ac_status); } &&
8292          { ac_try='test -s conftest.$ac_objext'
8293   { (eval echo "$as_me:8293: \"$ac_try\"") >&5
8294   (eval $ac_try) 2>&5
8295   ac_status=$?
8296   echo "$as_me:8296: \$? = $ac_status" >&5
8297   (exit $ac_status); }; }; then
8298   cf_cv_ncurses_h=$cf_header
8299
8300 else
8301   echo "$as_me: failed program was:" >&5
8302 cat conftest.$ac_ext >&5
8303 cf_cv_ncurses_h=no
8304 fi
8305 rm -f conftest.$ac_objext conftest.$ac_ext
8306
8307                 test "$cf_cv_ncurses_h" != no && break
8308         done
8309
8310 fi
8311 echo "$as_me:8311: result: $cf_cv_ncurses_h" >&5
8312 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8313
8314 if test "$cf_cv_ncurses_h" != no ; then
8315         cf_cv_ncurses_header=$cf_cv_ncurses_h
8316 else
8317
8318 echo "$as_me:8318: checking for $cf_ncuhdr_root include-path" >&5
8319 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8320 if test "${cf_cv_ncurses_h2+set}" = set; then
8321   echo $ECHO_N "(cached) $ECHO_C" >&6
8322 else
8323
8324         test -n "$verbose" && echo
8325
8326 cf_search=
8327
8328 # collect the current set of include-directories from compiler flags
8329 cf_header_path_list=""
8330 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8331         for cf_header_path in $CPPFLAGS $CFLAGS
8332         do
8333                 case $cf_header_path in
8334                 (-I*)
8335                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8336
8337 test "x$cf_header_path" != "xNONE" && \
8338 test -d "$cf_header_path" && \
8339  {
8340         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8341         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8342         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8343         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8344         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8345         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"
8346 }
8347
8348                         cf_header_path_list="$cf_header_path_list $cf_search"
8349                         ;;
8350                 esac
8351         done
8352 fi
8353
8354 # add the variations for the package we are looking for
8355
8356 cf_search=
8357
8358 test "x$prefix" != "xNONE" && \
8359 test -d "$prefix" && \
8360  {
8361         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8362         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8363         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8364         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8365         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8366         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8367 }
8368
8369 for cf_subdir_prefix in \
8370         /usr \
8371         /usr/local \
8372         /usr/pkg \
8373         /opt \
8374         /opt/local \
8375         $HOME
8376 do
8377
8378 test "x$cf_subdir_prefix" != "x$prefix" && \
8379 test -d "$cf_subdir_prefix" && \
8380 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8381         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8382         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8383         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8384         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8385         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8386         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"
8387 }
8388
8389 done
8390
8391 test "$includedir" != NONE && \
8392 test "$includedir" != "/usr/include" && \
8393 test -d "$includedir" && {
8394         test -d $includedir &&    cf_search="$cf_search $includedir"
8395         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8396 }
8397
8398 test "$oldincludedir" != NONE && \
8399 test "$oldincludedir" != "/usr/include" && \
8400 test -d "$oldincludedir" && {
8401         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8402         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8403 }
8404
8405 cf_search="$cf_search $cf_header_path_list"
8406
8407         test -n "$verbose" && echo search path $cf_search
8408         cf_save2_CPPFLAGS="$CPPFLAGS"
8409         for cf_incdir in $cf_search
8410         do
8411
8412 if test -n "$cf_incdir" ; then
8413   for cf_add_incdir in $cf_incdir
8414   do
8415         while test $cf_add_incdir != /usr/include
8416         do
8417           if test -d $cf_add_incdir
8418           then
8419                 cf_have_incdir=no
8420                 if test -n "$CFLAGS$CPPFLAGS" ; then
8421                   # a loop is needed to ensure we can add subdirs of existing dirs
8422                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8423                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8424                           cf_have_incdir=yes; break
8425                         fi
8426                   done
8427                 fi
8428
8429                 if test "$cf_have_incdir" = no ; then
8430                   if test "$cf_add_incdir" = /usr/local/include ; then
8431                         if test "$GCC" = yes
8432                         then
8433                           cf_save_CPPFLAGS=$CPPFLAGS
8434
8435         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8436         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8437
8438                           cat >conftest.$ac_ext <<_ACEOF
8439 #line 8439 "configure"
8440 #include "confdefs.h"
8441 #include <stdio.h>
8442 int
8443 main (void)
8444 {
8445 printf("Hello")
8446   ;
8447   return 0;
8448 }
8449 _ACEOF
8450 rm -f conftest.$ac_objext
8451 if { (eval echo "$as_me:8451: \"$ac_compile\"") >&5
8452   (eval $ac_compile) 2>&5
8453   ac_status=$?
8454   echo "$as_me:8454: \$? = $ac_status" >&5
8455   (exit $ac_status); } &&
8456          { ac_try='test -s conftest.$ac_objext'
8457   { (eval echo "$as_me:8457: \"$ac_try\"") >&5
8458   (eval $ac_try) 2>&5
8459   ac_status=$?
8460   echo "$as_me:8460: \$? = $ac_status" >&5
8461   (exit $ac_status); }; }; then
8462   :
8463 else
8464   echo "$as_me: failed program was:" >&5
8465 cat conftest.$ac_ext >&5
8466 cf_have_incdir=yes
8467 fi
8468 rm -f conftest.$ac_objext conftest.$ac_ext
8469                           CPPFLAGS=$cf_save_CPPFLAGS
8470                         fi
8471                   fi
8472                 fi
8473
8474                 if test "$cf_have_incdir" = no ; then
8475                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8476
8477 echo "${as_me:-configure}:8477: testing adding $cf_add_incdir to include-path ..." 1>&5
8478
8479                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8480
8481                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8482                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8483                   cf_add_incdir="$cf_top_incdir"
8484                 else
8485                   break
8486                 fi
8487           else
8488                 break
8489           fi
8490         done
8491   done
8492 fi
8493
8494                 for cf_header in \
8495                         ncurses.h \
8496                         curses.h
8497                 do
8498
8499         cat >conftest.$ac_ext <<_ACEOF
8500 #line 8500 "configure"
8501 #include "confdefs.h"
8502
8503 #include <$cf_header>
8504 int
8505 main (void)
8506 {
8507
8508 #ifdef NCURSES_VERSION
8509
8510 printf("%s\n", NCURSES_VERSION);
8511 #else
8512 #ifdef __NCURSES_H
8513 printf("old\n");
8514 #else
8515         make an error
8516 #endif
8517 #endif
8518
8519   ;
8520   return 0;
8521 }
8522 _ACEOF
8523 rm -f conftest.$ac_objext
8524 if { (eval echo "$as_me:8524: \"$ac_compile\"") >&5
8525   (eval $ac_compile) 2>&5
8526   ac_status=$?
8527   echo "$as_me:8527: \$? = $ac_status" >&5
8528   (exit $ac_status); } &&
8529          { ac_try='test -s conftest.$ac_objext'
8530   { (eval echo "$as_me:8530: \"$ac_try\"") >&5
8531   (eval $ac_try) 2>&5
8532   ac_status=$?
8533   echo "$as_me:8533: \$? = $ac_status" >&5
8534   (exit $ac_status); }; }; then
8535   cf_cv_ncurses_h2=$cf_header
8536
8537 else
8538   echo "$as_me: failed program was:" >&5
8539 cat conftest.$ac_ext >&5
8540 cf_cv_ncurses_h2=no
8541 fi
8542 rm -f conftest.$ac_objext conftest.$ac_ext
8543
8544                         if test "$cf_cv_ncurses_h2" != no ; then
8545                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8546                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8547                                 break
8548                         fi
8549                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8550                 done
8551                 CPPFLAGS="$cf_save2_CPPFLAGS"
8552                 test "$cf_cv_ncurses_h2" != no && break
8553         done
8554         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8554: error: not found" >&5
8555 echo "$as_me: error: not found" >&2;}
8556    { (exit 1); exit 1; }; }
8557
8558 fi
8559 echo "$as_me:8559: result: $cf_cv_ncurses_h2" >&5
8560 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8561
8562         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8563         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8564         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8565                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8566         fi
8567
8568 if test -n "$cf_1st_incdir" ; then
8569   for cf_add_incdir in $cf_1st_incdir
8570   do
8571         while test $cf_add_incdir != /usr/include
8572         do
8573           if test -d $cf_add_incdir
8574           then
8575                 cf_have_incdir=no
8576                 if test -n "$CFLAGS$CPPFLAGS" ; then
8577                   # a loop is needed to ensure we can add subdirs of existing dirs
8578                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8579                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8580                           cf_have_incdir=yes; break
8581                         fi
8582                   done
8583                 fi
8584
8585                 if test "$cf_have_incdir" = no ; then
8586                   if test "$cf_add_incdir" = /usr/local/include ; then
8587                         if test "$GCC" = yes
8588                         then
8589                           cf_save_CPPFLAGS=$CPPFLAGS
8590
8591         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8592         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8593
8594                           cat >conftest.$ac_ext <<_ACEOF
8595 #line 8595 "configure"
8596 #include "confdefs.h"
8597 #include <stdio.h>
8598 int
8599 main (void)
8600 {
8601 printf("Hello")
8602   ;
8603   return 0;
8604 }
8605 _ACEOF
8606 rm -f conftest.$ac_objext
8607 if { (eval echo "$as_me:8607: \"$ac_compile\"") >&5
8608   (eval $ac_compile) 2>&5
8609   ac_status=$?
8610   echo "$as_me:8610: \$? = $ac_status" >&5
8611   (exit $ac_status); } &&
8612          { ac_try='test -s conftest.$ac_objext'
8613   { (eval echo "$as_me:8613: \"$ac_try\"") >&5
8614   (eval $ac_try) 2>&5
8615   ac_status=$?
8616   echo "$as_me:8616: \$? = $ac_status" >&5
8617   (exit $ac_status); }; }; then
8618   :
8619 else
8620   echo "$as_me: failed program was:" >&5
8621 cat conftest.$ac_ext >&5
8622 cf_have_incdir=yes
8623 fi
8624 rm -f conftest.$ac_objext conftest.$ac_ext
8625                           CPPFLAGS=$cf_save_CPPFLAGS
8626                         fi
8627                   fi
8628                 fi
8629
8630                 if test "$cf_have_incdir" = no ; then
8631                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8632
8633 echo "${as_me:-configure}:8633: testing adding $cf_add_incdir to include-path ..." 1>&5
8634
8635                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8636
8637                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8638                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8639                   cf_add_incdir="$cf_top_incdir"
8640                 else
8641                   break
8642                 fi
8643           else
8644                 break
8645           fi
8646         done
8647   done
8648 fi
8649
8650 fi
8651
8652 # Set definitions to allow ifdef'ing for ncurses.h
8653
8654 case $cf_cv_ncurses_header in
8655 (*ncurses.h)
8656
8657 cat >>confdefs.h <<\EOF
8658 #define HAVE_NCURSES_H 1
8659 EOF
8660
8661         ;;
8662 esac
8663
8664 case $cf_cv_ncurses_header in
8665 (ncurses/curses.h|ncurses/ncurses.h)
8666
8667 cat >>confdefs.h <<\EOF
8668 #define HAVE_NCURSES_NCURSES_H 1
8669 EOF
8670
8671         ;;
8672 (ncursesw/curses.h|ncursesw/ncurses.h)
8673
8674 cat >>confdefs.h <<\EOF
8675 #define HAVE_NCURSESW_NCURSES_H 1
8676 EOF
8677
8678         ;;
8679 esac
8680
8681 echo "$as_me:8681: checking for terminfo header" >&5
8682 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8683 if test "${cf_cv_term_header+set}" = set; then
8684   echo $ECHO_N "(cached) $ECHO_C" >&6
8685 else
8686
8687 case ${cf_cv_ncurses_header} in
8688 (*/ncurses.h|*/ncursesw.h)
8689         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8690         ;;
8691 (*)
8692         cf_term_header=term.h
8693         ;;
8694 esac
8695
8696 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8697 do
8698 cat >conftest.$ac_ext <<_ACEOF
8699 #line 8699 "configure"
8700 #include "confdefs.h"
8701 #include <stdio.h>
8702 #include <${cf_cv_ncurses_header:-curses.h}>
8703 #include <$cf_test>
8704
8705 int
8706 main (void)
8707 {
8708 int x = auto_left_margin
8709   ;
8710   return 0;
8711 }
8712 _ACEOF
8713 rm -f conftest.$ac_objext
8714 if { (eval echo "$as_me:8714: \"$ac_compile\"") >&5
8715   (eval $ac_compile) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit $ac_status); } &&
8719          { ac_try='test -s conftest.$ac_objext'
8720   { (eval echo "$as_me:8720: \"$ac_try\"") >&5
8721   (eval $ac_try) 2>&5
8722   ac_status=$?
8723   echo "$as_me:8723: \$? = $ac_status" >&5
8724   (exit $ac_status); }; }; then
8725
8726         cf_cv_term_header="$cf_test"
8727 else
8728   echo "$as_me: failed program was:" >&5
8729 cat conftest.$ac_ext >&5
8730
8731         cf_cv_term_header=unknown
8732
8733 fi
8734 rm -f conftest.$ac_objext conftest.$ac_ext
8735         test "$cf_cv_term_header" != unknown && break
8736 done
8737
8738 fi
8739 echo "$as_me:8739: result: $cf_cv_term_header" >&5
8740 echo "${ECHO_T}$cf_cv_term_header" >&6
8741
8742 # Set definitions to allow ifdef'ing to accommodate subdirectories
8743
8744 case $cf_cv_term_header in
8745 (*term.h)
8746
8747 cat >>confdefs.h <<\EOF
8748 #define HAVE_TERM_H 1
8749 EOF
8750
8751         ;;
8752 esac
8753
8754 case $cf_cv_term_header in
8755 (ncurses/term.h)
8756
8757 cat >>confdefs.h <<\EOF
8758 #define HAVE_NCURSES_TERM_H 1
8759 EOF
8760
8761         ;;
8762 (ncursesw/term.h)
8763
8764 cat >>confdefs.h <<\EOF
8765 #define HAVE_NCURSESW_TERM_H 1
8766 EOF
8767
8768         ;;
8769 esac
8770
8771 # some applications need this, but should check for NCURSES_VERSION
8772
8773 cat >>confdefs.h <<\EOF
8774 #define NCURSES 1
8775 EOF
8776
8777 echo "$as_me:8777: checking for ncurses version" >&5
8778 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8779 if test "${cf_cv_ncurses_version+set}" = set; then
8780   echo $ECHO_N "(cached) $ECHO_C" >&6
8781 else
8782
8783         cf_cv_ncurses_version=no
8784         cf_tempfile=out$$
8785         rm -f $cf_tempfile
8786         if test "$cross_compiling" = yes; then
8787
8788         # This will not work if the preprocessor splits the line after the
8789         # Autoconf token.  The 'unproto' program does that.
8790         cat > conftest.$ac_ext <<EOF
8791 #include <${cf_cv_ncurses_header:-curses.h}>
8792 #undef Autoconf
8793 #ifdef NCURSES_VERSION
8794 Autoconf NCURSES_VERSION
8795 #else
8796 #ifdef __NCURSES_H
8797 Autoconf "old"
8798 #endif
8799 ;
8800 #endif
8801 EOF
8802         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8803         { (eval echo "$as_me:8803: \"$cf_try\"") >&5
8804   (eval $cf_try) 2>&5
8805   ac_status=$?
8806   echo "$as_me:8806: \$? = $ac_status" >&5
8807   (exit $ac_status); }
8808         if test -f conftest.out ; then
8809                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8810                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8811                 rm -f conftest.out
8812         fi
8813
8814 else
8815   cat >conftest.$ac_ext <<_ACEOF
8816 #line 8816 "configure"
8817 #include "confdefs.h"
8818
8819 #include <${cf_cv_ncurses_header:-curses.h}>
8820 #include <stdio.h>
8821 int main(void)
8822 {
8823         FILE *fp = fopen("$cf_tempfile", "w");
8824 #ifdef NCURSES_VERSION
8825 # ifdef NCURSES_VERSION_PATCH
8826         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8827 # else
8828         fprintf(fp, "%s\n", NCURSES_VERSION);
8829 # endif
8830 #else
8831 # ifdef __NCURSES_H
8832         fprintf(fp, "old\n");
8833 # else
8834         make an error
8835 # endif
8836 #endif
8837         ${cf_cv_main_return:-return}(0);
8838 }
8839 _ACEOF
8840 rm -f conftest$ac_exeext
8841 if { (eval echo "$as_me:8841: \"$ac_link\"") >&5
8842   (eval $ac_link) 2>&5
8843   ac_status=$?
8844   echo "$as_me:8844: \$? = $ac_status" >&5
8845   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8846   { (eval echo "$as_me:8846: \"$ac_try\"") >&5
8847   (eval $ac_try) 2>&5
8848   ac_status=$?
8849   echo "$as_me:8849: \$? = $ac_status" >&5
8850   (exit $ac_status); }; }; then
8851
8852         cf_cv_ncurses_version=`cat $cf_tempfile`
8853 else
8854   echo "$as_me: program exited with status $ac_status" >&5
8855 echo "$as_me: failed program was:" >&5
8856 cat conftest.$ac_ext >&5
8857 fi
8858 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8859 fi
8860         rm -f $cf_tempfile
8861
8862 fi
8863 echo "$as_me:8863: result: $cf_cv_ncurses_version" >&5
8864 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8865 test "$cf_cv_ncurses_version" = no ||
8866 cat >>confdefs.h <<\EOF
8867 #define NCURSES 1
8868 EOF
8869
8870 cf_nculib_root=$cf_cv_screen
8871         # This works, except for the special case where we find gpm, but
8872         # ncurses is in a nonstandard location via $LIBS, and we really want
8873         # to link gpm.
8874 cf_ncurses_LIBS=""
8875 cf_ncurses_SAVE="$LIBS"
8876 echo "$as_me:8876: checking for Gpm_Open in -lgpm" >&5
8877 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8878 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8879   echo $ECHO_N "(cached) $ECHO_C" >&6
8880 else
8881   ac_check_lib_save_LIBS=$LIBS
8882 LIBS="-lgpm  $LIBS"
8883 cat >conftest.$ac_ext <<_ACEOF
8884 #line 8884 "configure"
8885 #include "confdefs.h"
8886
8887 /* Override any gcc2 internal prototype to avoid an error.  */
8888 #ifdef __cplusplus
8889 extern "C"
8890 #endif
8891 /* We use char because int might match the return type of a gcc2
8892    builtin and then its argument prototype would still apply.  */
8893 char Gpm_Open ();
8894 int
8895 main (void)
8896 {
8897 Gpm_Open ();
8898   ;
8899   return 0;
8900 }
8901 _ACEOF
8902 rm -f conftest.$ac_objext conftest$ac_exeext
8903 if { (eval echo "$as_me:8903: \"$ac_link\"") >&5
8904   (eval $ac_link) 2>&5
8905   ac_status=$?
8906   echo "$as_me:8906: \$? = $ac_status" >&5
8907   (exit $ac_status); } &&
8908          { ac_try='test -s conftest$ac_exeext'
8909   { (eval echo "$as_me:8909: \"$ac_try\"") >&5
8910   (eval $ac_try) 2>&5
8911   ac_status=$?
8912   echo "$as_me:8912: \$? = $ac_status" >&5
8913   (exit $ac_status); }; }; then
8914   ac_cv_lib_gpm_Gpm_Open=yes
8915 else
8916   echo "$as_me: failed program was:" >&5
8917 cat conftest.$ac_ext >&5
8918 ac_cv_lib_gpm_Gpm_Open=no
8919 fi
8920 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8921 LIBS=$ac_check_lib_save_LIBS
8922 fi
8923 echo "$as_me:8923: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8924 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8925 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8926   echo "$as_me:8926: checking for initscr in -lgpm" >&5
8927 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8928 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8929   echo $ECHO_N "(cached) $ECHO_C" >&6
8930 else
8931   ac_check_lib_save_LIBS=$LIBS
8932 LIBS="-lgpm  $LIBS"
8933 cat >conftest.$ac_ext <<_ACEOF
8934 #line 8934 "configure"
8935 #include "confdefs.h"
8936
8937 /* Override any gcc2 internal prototype to avoid an error.  */
8938 #ifdef __cplusplus
8939 extern "C"
8940 #endif
8941 /* We use char because int might match the return type of a gcc2
8942    builtin and then its argument prototype would still apply.  */
8943 char initscr ();
8944 int
8945 main (void)
8946 {
8947 initscr ();
8948   ;
8949   return 0;
8950 }
8951 _ACEOF
8952 rm -f conftest.$ac_objext conftest$ac_exeext
8953 if { (eval echo "$as_me:8953: \"$ac_link\"") >&5
8954   (eval $ac_link) 2>&5
8955   ac_status=$?
8956   echo "$as_me:8956: \$? = $ac_status" >&5
8957   (exit $ac_status); } &&
8958          { ac_try='test -s conftest$ac_exeext'
8959   { (eval echo "$as_me:8959: \"$ac_try\"") >&5
8960   (eval $ac_try) 2>&5
8961   ac_status=$?
8962   echo "$as_me:8962: \$? = $ac_status" >&5
8963   (exit $ac_status); }; }; then
8964   ac_cv_lib_gpm_initscr=yes
8965 else
8966   echo "$as_me: failed program was:" >&5
8967 cat conftest.$ac_ext >&5
8968 ac_cv_lib_gpm_initscr=no
8969 fi
8970 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8971 LIBS=$ac_check_lib_save_LIBS
8972 fi
8973 echo "$as_me:8973: result: $ac_cv_lib_gpm_initscr" >&5
8974 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8975 if test $ac_cv_lib_gpm_initscr = yes; then
8976   LIBS="$cf_ncurses_SAVE"
8977 else
8978   cf_ncurses_LIBS="-lgpm"
8979 fi
8980
8981 fi
8982
8983 case $host_os in
8984 (freebsd*)
8985         # This is only necessary if you are linking against an obsolete
8986         # version of ncurses (but it should do no harm, since it's static).
8987         if test "$cf_nculib_root" = ncurses ; then
8988                 echo "$as_me:8988: checking for tgoto in -lmytinfo" >&5
8989 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8990 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8991   echo $ECHO_N "(cached) $ECHO_C" >&6
8992 else
8993   ac_check_lib_save_LIBS=$LIBS
8994 LIBS="-lmytinfo  $LIBS"
8995 cat >conftest.$ac_ext <<_ACEOF
8996 #line 8996 "configure"
8997 #include "confdefs.h"
8998
8999 /* Override any gcc2 internal prototype to avoid an error.  */
9000 #ifdef __cplusplus
9001 extern "C"
9002 #endif
9003 /* We use char because int might match the return type of a gcc2
9004    builtin and then its argument prototype would still apply.  */
9005 char tgoto ();
9006 int
9007 main (void)
9008 {
9009 tgoto ();
9010   ;
9011   return 0;
9012 }
9013 _ACEOF
9014 rm -f conftest.$ac_objext conftest$ac_exeext
9015 if { (eval echo "$as_me:9015: \"$ac_link\"") >&5
9016   (eval $ac_link) 2>&5
9017   ac_status=$?
9018   echo "$as_me:9018: \$? = $ac_status" >&5
9019   (exit $ac_status); } &&
9020          { ac_try='test -s conftest$ac_exeext'
9021   { (eval echo "$as_me:9021: \"$ac_try\"") >&5
9022   (eval $ac_try) 2>&5
9023   ac_status=$?
9024   echo "$as_me:9024: \$? = $ac_status" >&5
9025   (exit $ac_status); }; }; then
9026   ac_cv_lib_mytinfo_tgoto=yes
9027 else
9028   echo "$as_me: failed program was:" >&5
9029 cat conftest.$ac_ext >&5
9030 ac_cv_lib_mytinfo_tgoto=no
9031 fi
9032 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9033 LIBS=$ac_check_lib_save_LIBS
9034 fi
9035 echo "$as_me:9035: result: $ac_cv_lib_mytinfo_tgoto" >&5
9036 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9037 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9038   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9039 fi
9040
9041         fi
9042         ;;
9043 esac
9044
9045 cf_add_libs="$LIBS"
9046 # reverse order
9047 cf_add_0lib=
9048 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9049 # filter duplicates
9050 for cf_add_1lib in $cf_add_0lib; do
9051         for cf_add_2lib in $cf_add_libs; do
9052                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9053                         cf_add_1lib=
9054                         break
9055                 fi
9056         done
9057         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9058 done
9059 LIBS="$cf_add_libs"
9060
9061 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9062 then
9063
9064 cf_add_libs="$LIBS"
9065 # reverse order
9066 cf_add_0lib=
9067 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9068 # filter duplicates
9069 for cf_add_1lib in $cf_add_0lib; do
9070         for cf_add_2lib in $cf_add_libs; do
9071                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9072                         cf_add_1lib=
9073                         break
9074                 fi
9075         done
9076         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9077 done
9078 LIBS="$cf_add_libs"
9079
9080 else
9081
9082         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9083         cf_libdir=""
9084         echo "$as_me:9084: checking for initscr" >&5
9085 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9086 if test "${ac_cv_func_initscr+set}" = set; then
9087   echo $ECHO_N "(cached) $ECHO_C" >&6
9088 else
9089   cat >conftest.$ac_ext <<_ACEOF
9090 #line 9090 "configure"
9091 #include "confdefs.h"
9092 #define initscr autoconf_temporary
9093 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9094 #undef initscr
9095
9096 #ifdef __cplusplus
9097 extern "C"
9098 #endif
9099
9100 /* We use char because int might match the return type of a gcc2
9101    builtin and then its argument prototype would still apply.  */
9102 char initscr (void);
9103
9104 int
9105 main (void)
9106 {
9107
9108 /* The GNU C library defines stubs for functions which it implements
9109     to always fail with ENOSYS.  Some functions are actually named
9110     something starting with __ and the normal name is an alias.  */
9111 #if defined (__stub_initscr) || defined (__stub___initscr)
9112 #error found stub for initscr
9113 #endif
9114
9115         return initscr ();
9116   ;
9117   return 0;
9118 }
9119 _ACEOF
9120 rm -f conftest.$ac_objext conftest$ac_exeext
9121 if { (eval echo "$as_me:9121: \"$ac_link\"") >&5
9122   (eval $ac_link) 2>&5
9123   ac_status=$?
9124   echo "$as_me:9124: \$? = $ac_status" >&5
9125   (exit $ac_status); } &&
9126          { ac_try='test -s conftest$ac_exeext'
9127   { (eval echo "$as_me:9127: \"$ac_try\"") >&5
9128   (eval $ac_try) 2>&5
9129   ac_status=$?
9130   echo "$as_me:9130: \$? = $ac_status" >&5
9131   (exit $ac_status); }; }; then
9132   ac_cv_func_initscr=yes
9133 else
9134   echo "$as_me: failed program was:" >&5
9135 cat conftest.$ac_ext >&5
9136 ac_cv_func_initscr=no
9137 fi
9138 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9139 fi
9140 echo "$as_me:9140: result: $ac_cv_func_initscr" >&5
9141 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9142 if test $ac_cv_func_initscr = yes; then
9143   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9144 else
9145
9146                 cf_save_LIBS="$LIBS"
9147                 echo "$as_me:9147: checking for initscr in -l$cf_nculib_root" >&5
9148 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9149                 LIBS="-l$cf_nculib_root $LIBS"
9150                 cat >conftest.$ac_ext <<_ACEOF
9151 #line 9151 "configure"
9152 #include "confdefs.h"
9153 #include <${cf_cv_ncurses_header:-curses.h}>
9154 int
9155 main (void)
9156 {
9157 initscr()
9158   ;
9159   return 0;
9160 }
9161 _ACEOF
9162 rm -f conftest.$ac_objext conftest$ac_exeext
9163 if { (eval echo "$as_me:9163: \"$ac_link\"") >&5
9164   (eval $ac_link) 2>&5
9165   ac_status=$?
9166   echo "$as_me:9166: \$? = $ac_status" >&5
9167   (exit $ac_status); } &&
9168          { ac_try='test -s conftest$ac_exeext'
9169   { (eval echo "$as_me:9169: \"$ac_try\"") >&5
9170   (eval $ac_try) 2>&5
9171   ac_status=$?
9172   echo "$as_me:9172: \$? = $ac_status" >&5
9173   (exit $ac_status); }; }; then
9174   echo "$as_me:9174: result: yes" >&5
9175 echo "${ECHO_T}yes" >&6
9176                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9177
9178 else
9179   echo "$as_me: failed program was:" >&5
9180 cat conftest.$ac_ext >&5
9181 echo "$as_me:9181: result: no" >&5
9182 echo "${ECHO_T}no" >&6
9183
9184 cf_search=
9185 cf_library_path_list=""
9186 if test -n "${LDFLAGS}${LIBS}" ; then
9187         for cf_library_path in $LDFLAGS $LIBS
9188         do
9189                 case $cf_library_path in
9190                 (-L*)
9191                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9192
9193 test "x$cf_library_path" != "xNONE" && \
9194 test -d "$cf_library_path" && \
9195  {
9196         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9197         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9198         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9199         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9200         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9201         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"
9202 }
9203
9204                         cf_library_path_list="$cf_library_path_list $cf_search"
9205                         ;;
9206                 esac
9207         done
9208 fi
9209
9210 cf_search=
9211
9212 test "x$prefix" != "xNONE" && \
9213 test -d "$prefix" && \
9214  {
9215         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9216         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9217         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9218         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9219         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9220         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9221 }
9222
9223 for cf_subdir_prefix in \
9224         /usr \
9225         /usr/local \
9226         /usr/pkg \
9227         /opt \
9228         /opt/local \
9229         $HOME
9230 do
9231
9232 test "x$cf_subdir_prefix" != "x$prefix" && \
9233 test -d "$cf_subdir_prefix" && \
9234 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9235         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9236         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9237         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9238         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9239         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9240         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"
9241 }
9242
9243 done
9244
9245 cf_search="$cf_library_path_list $cf_search"
9246
9247                         for cf_libdir in $cf_search
9248                         do
9249                                 echo "$as_me:9249: checking for -l$cf_nculib_root in $cf_libdir" >&5
9250 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9251                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9252                                 cat >conftest.$ac_ext <<_ACEOF
9253 #line 9253 "configure"
9254 #include "confdefs.h"
9255 #include <${cf_cv_ncurses_header:-curses.h}>
9256 int
9257 main (void)
9258 {
9259 initscr()
9260   ;
9261   return 0;
9262 }
9263 _ACEOF
9264 rm -f conftest.$ac_objext conftest$ac_exeext
9265 if { (eval echo "$as_me:9265: \"$ac_link\"") >&5
9266   (eval $ac_link) 2>&5
9267   ac_status=$?
9268   echo "$as_me:9268: \$? = $ac_status" >&5
9269   (exit $ac_status); } &&
9270          { ac_try='test -s conftest$ac_exeext'
9271   { (eval echo "$as_me:9271: \"$ac_try\"") >&5
9272   (eval $ac_try) 2>&5
9273   ac_status=$?
9274   echo "$as_me:9274: \$? = $ac_status" >&5
9275   (exit $ac_status); }; }; then
9276   echo "$as_me:9276: result: yes" >&5
9277 echo "${ECHO_T}yes" >&6
9278                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9279                                          break
9280 else
9281   echo "$as_me: failed program was:" >&5
9282 cat conftest.$ac_ext >&5
9283 echo "$as_me:9283: result: no" >&5
9284 echo "${ECHO_T}no" >&6
9285                                          LIBS="$cf_save_LIBS"
9286 fi
9287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9288                         done
9289
9290 fi
9291 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9292
9293 fi
9294
9295 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9296
9297 if test $cf_found_library = no ; then
9298         { { echo "$as_me:9298: error: Cannot link $cf_nculib_root library" >&5
9299 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9300    { (exit 1); exit 1; }; }
9301 fi
9302
9303 fi
9304
9305 if test -n "$cf_ncurses_LIBS" ; then
9306         echo "$as_me:9306: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9307 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9308         cf_ncurses_SAVE="$LIBS"
9309         for p in $cf_ncurses_LIBS ; do
9310                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9311                 if test "$q" != "$LIBS" ; then
9312                         LIBS="$q"
9313                 fi
9314         done
9315         cat >conftest.$ac_ext <<_ACEOF
9316 #line 9316 "configure"
9317 #include "confdefs.h"
9318 #include <${cf_cv_ncurses_header:-curses.h}>
9319 int
9320 main (void)
9321 {
9322 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9323   ;
9324   return 0;
9325 }
9326 _ACEOF
9327 rm -f conftest.$ac_objext conftest$ac_exeext
9328 if { (eval echo "$as_me:9328: \"$ac_link\"") >&5
9329   (eval $ac_link) 2>&5
9330   ac_status=$?
9331   echo "$as_me:9331: \$? = $ac_status" >&5
9332   (exit $ac_status); } &&
9333          { ac_try='test -s conftest$ac_exeext'
9334   { (eval echo "$as_me:9334: \"$ac_try\"") >&5
9335   (eval $ac_try) 2>&5
9336   ac_status=$?
9337   echo "$as_me:9337: \$? = $ac_status" >&5
9338   (exit $ac_status); }; }; then
9339   echo "$as_me:9339: result: yes" >&5
9340 echo "${ECHO_T}yes" >&6
9341 else
9342   echo "$as_me: failed program was:" >&5
9343 cat conftest.$ac_ext >&5
9344 echo "$as_me:9344: result: no" >&5
9345 echo "${ECHO_T}no" >&6
9346                  LIBS="$cf_ncurses_SAVE"
9347 fi
9348 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9349 fi
9350
9351 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9352
9353 cat >>confdefs.h <<EOF
9354 #define $cf_nculib_ROOT 1
9355 EOF
9356
9357         fi
9358 else
9359         NCURSES_CONFIG=none
9360 fi
9361
9362         ;;
9363 (ncurses*)
9364
9365 cf_ncuconfig_root=$cf_cv_screen
9366 cf_have_ncuconfig=no
9367
9368 if test "x${PKG_CONFIG:=none}" != xnone; then
9369         echo "$as_me:9369: checking pkg-config for $cf_ncuconfig_root" >&5
9370 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9371         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9372                 echo "$as_me:9372: result: yes" >&5
9373 echo "${ECHO_T}yes" >&6
9374
9375                 echo "$as_me:9375: checking if the $cf_ncuconfig_root package files work" >&5
9376 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9377                 cf_have_ncuconfig=unknown
9378
9379                 cf_save_CPPFLAGS="$CPPFLAGS"
9380                 cf_save_LIBS="$LIBS"
9381
9382 cf_fix_cppflags=no
9383 cf_new_cflags=
9384 cf_new_cppflags=
9385 cf_new_extra_cppflags=
9386
9387 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
9388 do
9389 case $cf_fix_cppflags in
9390 (no)
9391         case $cf_add_cflags in
9392         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9393                 case $cf_add_cflags in
9394                 (-D*)
9395                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9396
9397                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9398                                 && test -z "${cf_tst_cflags}" \
9399                                 && cf_fix_cppflags=yes
9400
9401                         if test $cf_fix_cppflags = yes ; then
9402
9403         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9404         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9405
9406                                 continue
9407                         elif test "${cf_tst_cflags}" = "\"'" ; then
9408
9409         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9410         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9411
9412                                 continue
9413                         fi
9414                         ;;
9415                 esac
9416                 case "$CPPFLAGS" in
9417                 (*$cf_add_cflags)
9418                         ;;
9419                 (*)
9420                         case $cf_add_cflags in
9421                         (-D*)
9422                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9423
9424 CPPFLAGS=`echo "$CPPFLAGS" | \
9425         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9426                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9427
9428                                 ;;
9429                         esac
9430
9431         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9432         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9433
9434                         ;;
9435                 esac
9436                 ;;
9437         (*)
9438
9439         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9440         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9441
9442                 ;;
9443         esac
9444         ;;
9445 (yes)
9446
9447         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9448         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9449
9450         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9451
9452         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9453                 && test -z "${cf_tst_cflags}" \
9454                 && cf_fix_cppflags=no
9455         ;;
9456 esac
9457 done
9458
9459 if test -n "$cf_new_cflags" ; then
9460
9461         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9462         CFLAGS="${CFLAGS}$cf_new_cflags"
9463
9464 fi
9465
9466 if test -n "$cf_new_cppflags" ; then
9467
9468         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9469         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9470
9471 fi
9472
9473 if test -n "$cf_new_extra_cppflags" ; then
9474
9475         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9476         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9477
9478 fi
9479
9480 cf_add_libs="$LIBS"
9481 # reverse order
9482 cf_add_0lib=
9483 for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9484 # filter duplicates
9485 for cf_add_1lib in $cf_add_0lib; do
9486         for cf_add_2lib in $cf_add_libs; do
9487                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9488                         cf_add_1lib=
9489                         break
9490                 fi
9491         done
9492         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9493 done
9494 LIBS="$cf_add_libs"
9495
9496                 cat >conftest.$ac_ext <<_ACEOF
9497 #line 9497 "configure"
9498 #include "confdefs.h"
9499 #include <${cf_cv_ncurses_header:-curses.h}>
9500 int
9501 main (void)
9502 {
9503 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9504   ;
9505   return 0;
9506 }
9507 _ACEOF
9508 rm -f conftest.$ac_objext conftest$ac_exeext
9509 if { (eval echo "$as_me:9509: \"$ac_link\"") >&5
9510   (eval $ac_link) 2>&5
9511   ac_status=$?
9512   echo "$as_me:9512: \$? = $ac_status" >&5
9513   (exit $ac_status); } &&
9514          { ac_try='test -s conftest$ac_exeext'
9515   { (eval echo "$as_me:9515: \"$ac_try\"") >&5
9516   (eval $ac_try) 2>&5
9517   ac_status=$?
9518   echo "$as_me:9518: \$? = $ac_status" >&5
9519   (exit $ac_status); }; }; then
9520   if test "$cross_compiling" = yes; then
9521   cf_have_ncuconfig=maybe
9522 else
9523   cat >conftest.$ac_ext <<_ACEOF
9524 #line 9524 "configure"
9525 #include "confdefs.h"
9526 #include <${cf_cv_ncurses_header:-curses.h}>
9527                                 int main(void)
9528                                 { char *xx = curses_version(); return (xx == 0); }
9529 _ACEOF
9530 rm -f 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); } && { ac_try='./conftest$ac_exeext'
9536   { (eval echo "$as_me:9536: \"$ac_try\"") >&5
9537   (eval $ac_try) 2>&5
9538   ac_status=$?
9539   echo "$as_me:9539: \$? = $ac_status" >&5
9540   (exit $ac_status); }; }; then
9541   cf_have_ncuconfig=yes
9542 else
9543   echo "$as_me: program exited with status $ac_status" >&5
9544 echo "$as_me: failed program was:" >&5
9545 cat conftest.$ac_ext >&5
9546 cf_have_ncuconfig=no
9547 fi
9548 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9549 fi
9550 else
9551   echo "$as_me: failed program was:" >&5
9552 cat conftest.$ac_ext >&5
9553 cf_have_ncuconfig=no
9554 fi
9555 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9556                 echo "$as_me:9556: result: $cf_have_ncuconfig" >&5
9557 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9558                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9559                 if test "$cf_have_ncuconfig" != "yes"
9560                 then
9561                         CPPFLAGS="$cf_save_CPPFLAGS"
9562                         LIBS="$cf_save_LIBS"
9563                         NCURSES_CONFIG_PKG=none
9564                 else
9565
9566 cat >>confdefs.h <<\EOF
9567 #define NCURSES 1
9568 EOF
9569
9570                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9571
9572 echo "$as_me:9572: checking for terminfo header" >&5
9573 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9574 if test "${cf_cv_term_header+set}" = set; then
9575   echo $ECHO_N "(cached) $ECHO_C" >&6
9576 else
9577
9578 case ${cf_cv_ncurses_header} in
9579 (*/ncurses.h|*/ncursesw.h)
9580         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9581         ;;
9582 (*)
9583         cf_term_header=term.h
9584         ;;
9585 esac
9586
9587 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9588 do
9589 cat >conftest.$ac_ext <<_ACEOF
9590 #line 9590 "configure"
9591 #include "confdefs.h"
9592 #include <stdio.h>
9593 #include <${cf_cv_ncurses_header:-curses.h}>
9594 #include <$cf_test>
9595
9596 int
9597 main (void)
9598 {
9599 int x = auto_left_margin
9600   ;
9601   return 0;
9602 }
9603 _ACEOF
9604 rm -f conftest.$ac_objext
9605 if { (eval echo "$as_me:9605: \"$ac_compile\"") >&5
9606   (eval $ac_compile) 2>&5
9607   ac_status=$?
9608   echo "$as_me:9608: \$? = $ac_status" >&5
9609   (exit $ac_status); } &&
9610          { ac_try='test -s conftest.$ac_objext'
9611   { (eval echo "$as_me:9611: \"$ac_try\"") >&5
9612   (eval $ac_try) 2>&5
9613   ac_status=$?
9614   echo "$as_me:9614: \$? = $ac_status" >&5
9615   (exit $ac_status); }; }; then
9616
9617         cf_cv_term_header="$cf_test"
9618 else
9619   echo "$as_me: failed program was:" >&5
9620 cat conftest.$ac_ext >&5
9621
9622         cf_cv_term_header=unknown
9623
9624 fi
9625 rm -f conftest.$ac_objext conftest.$ac_ext
9626         test "$cf_cv_term_header" != unknown && break
9627 done
9628
9629 fi
9630 echo "$as_me:9630: result: $cf_cv_term_header" >&5
9631 echo "${ECHO_T}$cf_cv_term_header" >&6
9632
9633 # Set definitions to allow ifdef'ing to accommodate subdirectories
9634
9635 case $cf_cv_term_header in
9636 (*term.h)
9637
9638 cat >>confdefs.h <<\EOF
9639 #define HAVE_TERM_H 1
9640 EOF
9641
9642         ;;
9643 esac
9644
9645 case $cf_cv_term_header in
9646 (ncurses/term.h)
9647
9648 cat >>confdefs.h <<\EOF
9649 #define HAVE_NCURSES_TERM_H 1
9650 EOF
9651
9652         ;;
9653 (ncursesw/term.h)
9654
9655 cat >>confdefs.h <<\EOF
9656 #define HAVE_NCURSESW_TERM_H 1
9657 EOF
9658
9659         ;;
9660 esac
9661
9662                 fi
9663
9664         else
9665                 echo "$as_me:9665: result: no" >&5
9666 echo "${ECHO_T}no" >&6
9667                 NCURSES_CONFIG_PKG=none
9668         fi
9669 else
9670         NCURSES_CONFIG_PKG=none
9671 fi
9672
9673 if test "x$cf_have_ncuconfig" = "xno"; then
9674         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9675
9676 if test -n "$ac_tool_prefix"; then
9677   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9678   do
9679     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9680 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9681 echo "$as_me:9681: checking for $ac_word" >&5
9682 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9683 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9684   echo $ECHO_N "(cached) $ECHO_C" >&6
9685 else
9686   if test -n "$NCURSES_CONFIG"; then
9687   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9688 else
9689   ac_save_IFS=$IFS; IFS=$ac_path_separator
9690 ac_dummy="$PATH"
9691 for ac_dir in $ac_dummy; do
9692   IFS=$ac_save_IFS
9693   test -z "$ac_dir" && ac_dir=.
9694   $as_executable_p "$ac_dir/$ac_word" || continue
9695 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9696 echo "$as_me:9696: found $ac_dir/$ac_word" >&5
9697 break
9698 done
9699
9700 fi
9701 fi
9702 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9703 if test -n "$NCURSES_CONFIG"; then
9704   echo "$as_me:9704: result: $NCURSES_CONFIG" >&5
9705 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9706 else
9707   echo "$as_me:9707: result: no" >&5
9708 echo "${ECHO_T}no" >&6
9709 fi
9710
9711     test -n "$NCURSES_CONFIG" && break
9712   done
9713 fi
9714 if test -z "$NCURSES_CONFIG"; then
9715   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9716   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9717 do
9718   # Extract the first word of "$ac_prog", so it can be a program name with args.
9719 set dummy $ac_prog; ac_word=$2
9720 echo "$as_me:9720: checking for $ac_word" >&5
9721 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9722 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9723   echo $ECHO_N "(cached) $ECHO_C" >&6
9724 else
9725   if test -n "$ac_ct_NCURSES_CONFIG"; then
9726   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9727 else
9728   ac_save_IFS=$IFS; IFS=$ac_path_separator
9729 ac_dummy="$PATH"
9730 for ac_dir in $ac_dummy; do
9731   IFS=$ac_save_IFS
9732   test -z "$ac_dir" && ac_dir=.
9733   $as_executable_p "$ac_dir/$ac_word" || continue
9734 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9735 echo "$as_me:9735: found $ac_dir/$ac_word" >&5
9736 break
9737 done
9738
9739 fi
9740 fi
9741 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9742 if test -n "$ac_ct_NCURSES_CONFIG"; then
9743   echo "$as_me:9743: result: $ac_ct_NCURSES_CONFIG" >&5
9744 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9745 else
9746   echo "$as_me:9746: result: no" >&5
9747 echo "${ECHO_T}no" >&6
9748 fi
9749
9750   test -n "$ac_ct_NCURSES_CONFIG" && break
9751 done
9752 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9753
9754   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9755 fi
9756
9757         if test "$NCURSES_CONFIG" != none ; then
9758
9759 cf_fix_cppflags=no
9760 cf_new_cflags=
9761 cf_new_cppflags=
9762 cf_new_extra_cppflags=
9763
9764 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9765 do
9766 case $cf_fix_cppflags in
9767 (no)
9768         case $cf_add_cflags in
9769         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9770                 case $cf_add_cflags in
9771                 (-D*)
9772                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9773
9774                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9775                                 && test -z "${cf_tst_cflags}" \
9776                                 && cf_fix_cppflags=yes
9777
9778                         if test $cf_fix_cppflags = yes ; then
9779
9780         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9781         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9782
9783                                 continue
9784                         elif test "${cf_tst_cflags}" = "\"'" ; then
9785
9786         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9787         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9788
9789                                 continue
9790                         fi
9791                         ;;
9792                 esac
9793                 case "$CPPFLAGS" in
9794                 (*$cf_add_cflags)
9795                         ;;
9796                 (*)
9797                         case $cf_add_cflags in
9798                         (-D*)
9799                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9800
9801 CPPFLAGS=`echo "$CPPFLAGS" | \
9802         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9803                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9804
9805                                 ;;
9806                         esac
9807
9808         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9809         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9810
9811                         ;;
9812                 esac
9813                 ;;
9814         (*)
9815
9816         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9817         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9818
9819                 ;;
9820         esac
9821         ;;
9822 (yes)
9823
9824         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9825         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9826
9827         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9828
9829         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9830                 && test -z "${cf_tst_cflags}" \
9831                 && cf_fix_cppflags=no
9832         ;;
9833 esac
9834 done
9835
9836 if test -n "$cf_new_cflags" ; then
9837
9838         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9839         CFLAGS="${CFLAGS}$cf_new_cflags"
9840
9841 fi
9842
9843 if test -n "$cf_new_cppflags" ; then
9844
9845         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9846         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9847
9848 fi
9849
9850 if test -n "$cf_new_extra_cppflags" ; then
9851
9852         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9853         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9854
9855 fi
9856
9857 cf_add_libs="$LIBS"
9858 # reverse order
9859 cf_add_0lib=
9860 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9861 # filter duplicates
9862 for cf_add_1lib in $cf_add_0lib; do
9863         for cf_add_2lib in $cf_add_libs; do
9864                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9865                         cf_add_1lib=
9866                         break
9867                 fi
9868         done
9869         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9870 done
9871 LIBS="$cf_add_libs"
9872
9873                 # even with config script, some packages use no-override for curses.h
9874
9875 echo "$as_me:9875: checking if we have identified curses headers" >&5
9876 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9877 if test "${cf_cv_ncurses_header+set}" = set; then
9878   echo $ECHO_N "(cached) $ECHO_C" >&6
9879 else
9880
9881 cf_cv_ncurses_header=none
9882 for cf_header in \
9883         ncurses.h $cf_cv_screen/ncurses.h \
9884         curses.h $cf_cv_screen/curses.h
9885 do
9886 cat >conftest.$ac_ext <<_ACEOF
9887 #line 9887 "configure"
9888 #include "confdefs.h"
9889 #include <${cf_header}>
9890 int
9891 main (void)
9892 {
9893 initscr(); tgoto("?", 0,0)
9894   ;
9895   return 0;
9896 }
9897 _ACEOF
9898 rm -f conftest.$ac_objext
9899 if { (eval echo "$as_me:9899: \"$ac_compile\"") >&5
9900   (eval $ac_compile) 2>&5
9901   ac_status=$?
9902   echo "$as_me:9902: \$? = $ac_status" >&5
9903   (exit $ac_status); } &&
9904          { ac_try='test -s conftest.$ac_objext'
9905   { (eval echo "$as_me:9905: \"$ac_try\"") >&5
9906   (eval $ac_try) 2>&5
9907   ac_status=$?
9908   echo "$as_me:9908: \$? = $ac_status" >&5
9909   (exit $ac_status); }; }; then
9910   cf_cv_ncurses_header=$cf_header; break
9911 else
9912   echo "$as_me: failed program was:" >&5
9913 cat conftest.$ac_ext >&5
9914 fi
9915 rm -f conftest.$ac_objext conftest.$ac_ext
9916 done
9917
9918 fi
9919 echo "$as_me:9919: result: $cf_cv_ncurses_header" >&5
9920 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9921
9922 if test "$cf_cv_ncurses_header" = none ; then
9923         { { echo "$as_me:9923: error: No curses header-files found" >&5
9924 echo "$as_me: error: No curses header-files found" >&2;}
9925    { (exit 1); exit 1; }; }
9926 fi
9927
9928 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9929
9930 for ac_header in $cf_cv_ncurses_header
9931 do
9932 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9933 echo "$as_me:9933: checking for $ac_header" >&5
9934 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9935 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9936   echo $ECHO_N "(cached) $ECHO_C" >&6
9937 else
9938   cat >conftest.$ac_ext <<_ACEOF
9939 #line 9939 "configure"
9940 #include "confdefs.h"
9941 #include <$ac_header>
9942 _ACEOF
9943 if { (eval echo "$as_me:9943: \"$ac_cpp conftest.$ac_ext\"") >&5
9944   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9945   ac_status=$?
9946   egrep -v '^ *\+' conftest.er1 >conftest.err
9947   rm -f conftest.er1
9948   cat conftest.err >&5
9949   echo "$as_me:9949: \$? = $ac_status" >&5
9950   (exit $ac_status); } >/dev/null; then
9951   if test -s conftest.err; then
9952     ac_cpp_err=$ac_c_preproc_warn_flag
9953   else
9954     ac_cpp_err=
9955   fi
9956 else
9957   ac_cpp_err=yes
9958 fi
9959 if test -z "$ac_cpp_err"; then
9960   eval "$as_ac_Header=yes"
9961 else
9962   echo "$as_me: failed program was:" >&5
9963   cat conftest.$ac_ext >&5
9964   eval "$as_ac_Header=no"
9965 fi
9966 rm -f conftest.err conftest.$ac_ext
9967 fi
9968 echo "$as_me:9968: result: `eval echo '${'$as_ac_Header'}'`" >&5
9969 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9970 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9971   cat >>confdefs.h <<EOF
9972 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9973 EOF
9974
9975 fi
9976 done
9977
9978 cat >>confdefs.h <<\EOF
9979 #define NCURSES 1
9980 EOF
9981
9982 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9983
9984                 cat >>confdefs.h <<EOF
9985 #define $cf_nculib_ROOT 1
9986 EOF
9987
9988                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9989
9990         else
9991
9992 cf_ncuhdr_root=$cf_cv_screen
9993
9994 test -n "$cf_cv_curses_dir" && \
9995 test "$cf_cv_curses_dir" != "no" && { \
9996
9997 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9998   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9999   do
10000         while test $cf_add_incdir != /usr/include
10001         do
10002           if test -d $cf_add_incdir
10003           then
10004                 cf_have_incdir=no
10005                 if test -n "$CFLAGS$CPPFLAGS" ; then
10006                   # a loop is needed to ensure we can add subdirs of existing dirs
10007                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10008                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10009                           cf_have_incdir=yes; break
10010                         fi
10011                   done
10012                 fi
10013
10014                 if test "$cf_have_incdir" = no ; then
10015                   if test "$cf_add_incdir" = /usr/local/include ; then
10016                         if test "$GCC" = yes
10017                         then
10018                           cf_save_CPPFLAGS=$CPPFLAGS
10019
10020         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10021         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10022
10023                           cat >conftest.$ac_ext <<_ACEOF
10024 #line 10024 "configure"
10025 #include "confdefs.h"
10026 #include <stdio.h>
10027 int
10028 main (void)
10029 {
10030 printf("Hello")
10031   ;
10032   return 0;
10033 }
10034 _ACEOF
10035 rm -f conftest.$ac_objext
10036 if { (eval echo "$as_me:10036: \"$ac_compile\"") >&5
10037   (eval $ac_compile) 2>&5
10038   ac_status=$?
10039   echo "$as_me:10039: \$? = $ac_status" >&5
10040   (exit $ac_status); } &&
10041          { ac_try='test -s conftest.$ac_objext'
10042   { (eval echo "$as_me:10042: \"$ac_try\"") >&5
10043   (eval $ac_try) 2>&5
10044   ac_status=$?
10045   echo "$as_me:10045: \$? = $ac_status" >&5
10046   (exit $ac_status); }; }; then
10047   :
10048 else
10049   echo "$as_me: failed program was:" >&5
10050 cat conftest.$ac_ext >&5
10051 cf_have_incdir=yes
10052 fi
10053 rm -f conftest.$ac_objext conftest.$ac_ext
10054                           CPPFLAGS=$cf_save_CPPFLAGS
10055                         fi
10056                   fi
10057                 fi
10058
10059                 if test "$cf_have_incdir" = no ; then
10060                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10061
10062 echo "${as_me:-configure}:10062: testing adding $cf_add_incdir to include-path ..." 1>&5
10063
10064                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10065
10066                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10067                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10068                   cf_add_incdir="$cf_top_incdir"
10069                 else
10070                   break
10071                 fi
10072           else
10073                 break
10074           fi
10075         done
10076   done
10077 fi
10078
10079 }
10080
10081 echo "$as_me:10081: checking for $cf_ncuhdr_root header in include-path" >&5
10082 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10083 if test "${cf_cv_ncurses_h+set}" = set; then
10084   echo $ECHO_N "(cached) $ECHO_C" >&6
10085 else
10086
10087         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10088         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
10089         for cf_header in $cf_header_list
10090         do
10091
10092         cat >conftest.$ac_ext <<_ACEOF
10093 #line 10093 "configure"
10094 #include "confdefs.h"
10095
10096 #include <$cf_header>
10097 int
10098 main (void)
10099 {
10100
10101 #ifdef NCURSES_VERSION
10102
10103 printf("%s\n", NCURSES_VERSION);
10104 #else
10105 #ifdef __NCURSES_H
10106 printf("old\n");
10107 #else
10108         make an error
10109 #endif
10110 #endif
10111
10112   ;
10113   return 0;
10114 }
10115 _ACEOF
10116 rm -f conftest.$ac_objext
10117 if { (eval echo "$as_me:10117: \"$ac_compile\"") >&5
10118   (eval $ac_compile) 2>&5
10119   ac_status=$?
10120   echo "$as_me:10120: \$? = $ac_status" >&5
10121   (exit $ac_status); } &&
10122          { ac_try='test -s conftest.$ac_objext'
10123   { (eval echo "$as_me:10123: \"$ac_try\"") >&5
10124   (eval $ac_try) 2>&5
10125   ac_status=$?
10126   echo "$as_me:10126: \$? = $ac_status" >&5
10127   (exit $ac_status); }; }; then
10128   cf_cv_ncurses_h=$cf_header
10129
10130 else
10131   echo "$as_me: failed program was:" >&5
10132 cat conftest.$ac_ext >&5
10133 cf_cv_ncurses_h=no
10134 fi
10135 rm -f conftest.$ac_objext conftest.$ac_ext
10136
10137                 test "$cf_cv_ncurses_h" != no && break
10138         done
10139
10140 fi
10141 echo "$as_me:10141: result: $cf_cv_ncurses_h" >&5
10142 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10143
10144 if test "$cf_cv_ncurses_h" != no ; then
10145         cf_cv_ncurses_header=$cf_cv_ncurses_h
10146 else
10147
10148 echo "$as_me:10148: checking for $cf_ncuhdr_root include-path" >&5
10149 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10150 if test "${cf_cv_ncurses_h2+set}" = set; then
10151   echo $ECHO_N "(cached) $ECHO_C" >&6
10152 else
10153
10154         test -n "$verbose" && echo
10155
10156 cf_search=
10157
10158 # collect the current set of include-directories from compiler flags
10159 cf_header_path_list=""
10160 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10161         for cf_header_path in $CPPFLAGS $CFLAGS
10162         do
10163                 case $cf_header_path in
10164                 (-I*)
10165                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10166
10167 test "x$cf_header_path" != "xNONE" && \
10168 test -d "$cf_header_path" && \
10169  {
10170         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10171         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10172         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10173         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10174         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10175         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"
10176 }
10177
10178                         cf_header_path_list="$cf_header_path_list $cf_search"
10179                         ;;
10180                 esac
10181         done
10182 fi
10183
10184 # add the variations for the package we are looking for
10185
10186 cf_search=
10187
10188 test "x$prefix" != "xNONE" && \
10189 test -d "$prefix" && \
10190  {
10191         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10192         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10193         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10194         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10195         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10196         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10197 }
10198
10199 for cf_subdir_prefix in \
10200         /usr \
10201         /usr/local \
10202         /usr/pkg \
10203         /opt \
10204         /opt/local \
10205         $HOME
10206 do
10207
10208 test "x$cf_subdir_prefix" != "x$prefix" && \
10209 test -d "$cf_subdir_prefix" && \
10210 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10211         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10212         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10213         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10214         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10215         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10216         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"
10217 }
10218
10219 done
10220
10221 test "$includedir" != NONE && \
10222 test "$includedir" != "/usr/include" && \
10223 test -d "$includedir" && {
10224         test -d $includedir &&    cf_search="$cf_search $includedir"
10225         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10226 }
10227
10228 test "$oldincludedir" != NONE && \
10229 test "$oldincludedir" != "/usr/include" && \
10230 test -d "$oldincludedir" && {
10231         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10232         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10233 }
10234
10235 cf_search="$cf_search $cf_header_path_list"
10236
10237         test -n "$verbose" && echo search path $cf_search
10238         cf_save2_CPPFLAGS="$CPPFLAGS"
10239         for cf_incdir in $cf_search
10240         do
10241
10242 if test -n "$cf_incdir" ; then
10243   for cf_add_incdir in $cf_incdir
10244   do
10245         while test $cf_add_incdir != /usr/include
10246         do
10247           if test -d $cf_add_incdir
10248           then
10249                 cf_have_incdir=no
10250                 if test -n "$CFLAGS$CPPFLAGS" ; then
10251                   # a loop is needed to ensure we can add subdirs of existing dirs
10252                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10253                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10254                           cf_have_incdir=yes; break
10255                         fi
10256                   done
10257                 fi
10258
10259                 if test "$cf_have_incdir" = no ; then
10260                   if test "$cf_add_incdir" = /usr/local/include ; then
10261                         if test "$GCC" = yes
10262                         then
10263                           cf_save_CPPFLAGS=$CPPFLAGS
10264
10265         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10266         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10267
10268                           cat >conftest.$ac_ext <<_ACEOF
10269 #line 10269 "configure"
10270 #include "confdefs.h"
10271 #include <stdio.h>
10272 int
10273 main (void)
10274 {
10275 printf("Hello")
10276   ;
10277   return 0;
10278 }
10279 _ACEOF
10280 rm -f conftest.$ac_objext
10281 if { (eval echo "$as_me:10281: \"$ac_compile\"") >&5
10282   (eval $ac_compile) 2>&5
10283   ac_status=$?
10284   echo "$as_me:10284: \$? = $ac_status" >&5
10285   (exit $ac_status); } &&
10286          { ac_try='test -s conftest.$ac_objext'
10287   { (eval echo "$as_me:10287: \"$ac_try\"") >&5
10288   (eval $ac_try) 2>&5
10289   ac_status=$?
10290   echo "$as_me:10290: \$? = $ac_status" >&5
10291   (exit $ac_status); }; }; then
10292   :
10293 else
10294   echo "$as_me: failed program was:" >&5
10295 cat conftest.$ac_ext >&5
10296 cf_have_incdir=yes
10297 fi
10298 rm -f conftest.$ac_objext conftest.$ac_ext
10299                           CPPFLAGS=$cf_save_CPPFLAGS
10300                         fi
10301                   fi
10302                 fi
10303
10304                 if test "$cf_have_incdir" = no ; then
10305                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10306
10307 echo "${as_me:-configure}:10307: testing adding $cf_add_incdir to include-path ..." 1>&5
10308
10309                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10310
10311                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10312                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10313                   cf_add_incdir="$cf_top_incdir"
10314                 else
10315                   break
10316                 fi
10317           else
10318                 break
10319           fi
10320         done
10321   done
10322 fi
10323
10324                 for cf_header in \
10325                         ncurses.h \
10326                         curses.h
10327                 do
10328
10329         cat >conftest.$ac_ext <<_ACEOF
10330 #line 10330 "configure"
10331 #include "confdefs.h"
10332
10333 #include <$cf_header>
10334 int
10335 main (void)
10336 {
10337
10338 #ifdef NCURSES_VERSION
10339
10340 printf("%s\n", NCURSES_VERSION);
10341 #else
10342 #ifdef __NCURSES_H
10343 printf("old\n");
10344 #else
10345         make an error
10346 #endif
10347 #endif
10348
10349   ;
10350   return 0;
10351 }
10352 _ACEOF
10353 rm -f conftest.$ac_objext
10354 if { (eval echo "$as_me:10354: \"$ac_compile\"") >&5
10355   (eval $ac_compile) 2>&5
10356   ac_status=$?
10357   echo "$as_me:10357: \$? = $ac_status" >&5
10358   (exit $ac_status); } &&
10359          { ac_try='test -s conftest.$ac_objext'
10360   { (eval echo "$as_me:10360: \"$ac_try\"") >&5
10361   (eval $ac_try) 2>&5
10362   ac_status=$?
10363   echo "$as_me:10363: \$? = $ac_status" >&5
10364   (exit $ac_status); }; }; then
10365   cf_cv_ncurses_h2=$cf_header
10366
10367 else
10368   echo "$as_me: failed program was:" >&5
10369 cat conftest.$ac_ext >&5
10370 cf_cv_ncurses_h2=no
10371 fi
10372 rm -f conftest.$ac_objext conftest.$ac_ext
10373
10374                         if test "$cf_cv_ncurses_h2" != no ; then
10375                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10376                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10377                                 break
10378                         fi
10379                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10380                 done
10381                 CPPFLAGS="$cf_save2_CPPFLAGS"
10382                 test "$cf_cv_ncurses_h2" != no && break
10383         done
10384         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10384: error: not found" >&5
10385 echo "$as_me: error: not found" >&2;}
10386    { (exit 1); exit 1; }; }
10387
10388 fi
10389 echo "$as_me:10389: result: $cf_cv_ncurses_h2" >&5
10390 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10391
10392         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10393         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10394         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10395                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10396         fi
10397
10398 if test -n "$cf_1st_incdir" ; then
10399   for cf_add_incdir in $cf_1st_incdir
10400   do
10401         while test $cf_add_incdir != /usr/include
10402         do
10403           if test -d $cf_add_incdir
10404           then
10405                 cf_have_incdir=no
10406                 if test -n "$CFLAGS$CPPFLAGS" ; then
10407                   # a loop is needed to ensure we can add subdirs of existing dirs
10408                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10409                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10410                           cf_have_incdir=yes; break
10411                         fi
10412                   done
10413                 fi
10414
10415                 if test "$cf_have_incdir" = no ; then
10416                   if test "$cf_add_incdir" = /usr/local/include ; then
10417                         if test "$GCC" = yes
10418                         then
10419                           cf_save_CPPFLAGS=$CPPFLAGS
10420
10421         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10422         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10423
10424                           cat >conftest.$ac_ext <<_ACEOF
10425 #line 10425 "configure"
10426 #include "confdefs.h"
10427 #include <stdio.h>
10428 int
10429 main (void)
10430 {
10431 printf("Hello")
10432   ;
10433   return 0;
10434 }
10435 _ACEOF
10436 rm -f conftest.$ac_objext
10437 if { (eval echo "$as_me:10437: \"$ac_compile\"") >&5
10438   (eval $ac_compile) 2>&5
10439   ac_status=$?
10440   echo "$as_me:10440: \$? = $ac_status" >&5
10441   (exit $ac_status); } &&
10442          { ac_try='test -s conftest.$ac_objext'
10443   { (eval echo "$as_me:10443: \"$ac_try\"") >&5
10444   (eval $ac_try) 2>&5
10445   ac_status=$?
10446   echo "$as_me:10446: \$? = $ac_status" >&5
10447   (exit $ac_status); }; }; then
10448   :
10449 else
10450   echo "$as_me: failed program was:" >&5
10451 cat conftest.$ac_ext >&5
10452 cf_have_incdir=yes
10453 fi
10454 rm -f conftest.$ac_objext conftest.$ac_ext
10455                           CPPFLAGS=$cf_save_CPPFLAGS
10456                         fi
10457                   fi
10458                 fi
10459
10460                 if test "$cf_have_incdir" = no ; then
10461                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10462
10463 echo "${as_me:-configure}:10463: testing adding $cf_add_incdir to include-path ..." 1>&5
10464
10465                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10466
10467                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10468                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10469                   cf_add_incdir="$cf_top_incdir"
10470                 else
10471                   break
10472                 fi
10473           else
10474                 break
10475           fi
10476         done
10477   done
10478 fi
10479
10480 fi
10481
10482 # Set definitions to allow ifdef'ing for ncurses.h
10483
10484 case $cf_cv_ncurses_header in
10485 (*ncurses.h)
10486
10487 cat >>confdefs.h <<\EOF
10488 #define HAVE_NCURSES_H 1
10489 EOF
10490
10491         ;;
10492 esac
10493
10494 case $cf_cv_ncurses_header in
10495 (ncurses/curses.h|ncurses/ncurses.h)
10496
10497 cat >>confdefs.h <<\EOF
10498 #define HAVE_NCURSES_NCURSES_H 1
10499 EOF
10500
10501         ;;
10502 (ncursesw/curses.h|ncursesw/ncurses.h)
10503
10504 cat >>confdefs.h <<\EOF
10505 #define HAVE_NCURSESW_NCURSES_H 1
10506 EOF
10507
10508         ;;
10509 esac
10510
10511 echo "$as_me:10511: checking for terminfo header" >&5
10512 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10513 if test "${cf_cv_term_header+set}" = set; then
10514   echo $ECHO_N "(cached) $ECHO_C" >&6
10515 else
10516
10517 case ${cf_cv_ncurses_header} in
10518 (*/ncurses.h|*/ncursesw.h)
10519         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10520         ;;
10521 (*)
10522         cf_term_header=term.h
10523         ;;
10524 esac
10525
10526 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10527 do
10528 cat >conftest.$ac_ext <<_ACEOF
10529 #line 10529 "configure"
10530 #include "confdefs.h"
10531 #include <stdio.h>
10532 #include <${cf_cv_ncurses_header:-curses.h}>
10533 #include <$cf_test>
10534
10535 int
10536 main (void)
10537 {
10538 int x = auto_left_margin
10539   ;
10540   return 0;
10541 }
10542 _ACEOF
10543 rm -f conftest.$ac_objext
10544 if { (eval echo "$as_me:10544: \"$ac_compile\"") >&5
10545   (eval $ac_compile) 2>&5
10546   ac_status=$?
10547   echo "$as_me:10547: \$? = $ac_status" >&5
10548   (exit $ac_status); } &&
10549          { ac_try='test -s conftest.$ac_objext'
10550   { (eval echo "$as_me:10550: \"$ac_try\"") >&5
10551   (eval $ac_try) 2>&5
10552   ac_status=$?
10553   echo "$as_me:10553: \$? = $ac_status" >&5
10554   (exit $ac_status); }; }; then
10555
10556         cf_cv_term_header="$cf_test"
10557 else
10558   echo "$as_me: failed program was:" >&5
10559 cat conftest.$ac_ext >&5
10560
10561         cf_cv_term_header=unknown
10562
10563 fi
10564 rm -f conftest.$ac_objext conftest.$ac_ext
10565         test "$cf_cv_term_header" != unknown && break
10566 done
10567
10568 fi
10569 echo "$as_me:10569: result: $cf_cv_term_header" >&5
10570 echo "${ECHO_T}$cf_cv_term_header" >&6
10571
10572 # Set definitions to allow ifdef'ing to accommodate subdirectories
10573
10574 case $cf_cv_term_header in
10575 (*term.h)
10576
10577 cat >>confdefs.h <<\EOF
10578 #define HAVE_TERM_H 1
10579 EOF
10580
10581         ;;
10582 esac
10583
10584 case $cf_cv_term_header in
10585 (ncurses/term.h)
10586
10587 cat >>confdefs.h <<\EOF
10588 #define HAVE_NCURSES_TERM_H 1
10589 EOF
10590
10591         ;;
10592 (ncursesw/term.h)
10593
10594 cat >>confdefs.h <<\EOF
10595 #define HAVE_NCURSESW_TERM_H 1
10596 EOF
10597
10598         ;;
10599 esac
10600
10601 # some applications need this, but should check for NCURSES_VERSION
10602
10603 cat >>confdefs.h <<\EOF
10604 #define NCURSES 1
10605 EOF
10606
10607 echo "$as_me:10607: checking for ncurses version" >&5
10608 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10609 if test "${cf_cv_ncurses_version+set}" = set; then
10610   echo $ECHO_N "(cached) $ECHO_C" >&6
10611 else
10612
10613         cf_cv_ncurses_version=no
10614         cf_tempfile=out$$
10615         rm -f $cf_tempfile
10616         if test "$cross_compiling" = yes; then
10617
10618         # This will not work if the preprocessor splits the line after the
10619         # Autoconf token.  The 'unproto' program does that.
10620         cat > conftest.$ac_ext <<EOF
10621 #include <${cf_cv_ncurses_header:-curses.h}>
10622 #undef Autoconf
10623 #ifdef NCURSES_VERSION
10624 Autoconf NCURSES_VERSION
10625 #else
10626 #ifdef __NCURSES_H
10627 Autoconf "old"
10628 #endif
10629 ;
10630 #endif
10631 EOF
10632         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10633         { (eval echo "$as_me:10633: \"$cf_try\"") >&5
10634   (eval $cf_try) 2>&5
10635   ac_status=$?
10636   echo "$as_me:10636: \$? = $ac_status" >&5
10637   (exit $ac_status); }
10638         if test -f conftest.out ; then
10639                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10640                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10641                 rm -f conftest.out
10642         fi
10643
10644 else
10645   cat >conftest.$ac_ext <<_ACEOF
10646 #line 10646 "configure"
10647 #include "confdefs.h"
10648
10649 #include <${cf_cv_ncurses_header:-curses.h}>
10650 #include <stdio.h>
10651 int main(void)
10652 {
10653         FILE *fp = fopen("$cf_tempfile", "w");
10654 #ifdef NCURSES_VERSION
10655 # ifdef NCURSES_VERSION_PATCH
10656         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10657 # else
10658         fprintf(fp, "%s\n", NCURSES_VERSION);
10659 # endif
10660 #else
10661 # ifdef __NCURSES_H
10662         fprintf(fp, "old\n");
10663 # else
10664         make an error
10665 # endif
10666 #endif
10667         ${cf_cv_main_return:-return}(0);
10668 }
10669 _ACEOF
10670 rm -f conftest$ac_exeext
10671 if { (eval echo "$as_me:10671: \"$ac_link\"") >&5
10672   (eval $ac_link) 2>&5
10673   ac_status=$?
10674   echo "$as_me:10674: \$? = $ac_status" >&5
10675   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10676   { (eval echo "$as_me:10676: \"$ac_try\"") >&5
10677   (eval $ac_try) 2>&5
10678   ac_status=$?
10679   echo "$as_me:10679: \$? = $ac_status" >&5
10680   (exit $ac_status); }; }; then
10681
10682         cf_cv_ncurses_version=`cat $cf_tempfile`
10683 else
10684   echo "$as_me: program exited with status $ac_status" >&5
10685 echo "$as_me: failed program was:" >&5
10686 cat conftest.$ac_ext >&5
10687 fi
10688 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10689 fi
10690         rm -f $cf_tempfile
10691
10692 fi
10693 echo "$as_me:10693: result: $cf_cv_ncurses_version" >&5
10694 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10695 test "$cf_cv_ncurses_version" = no ||
10696 cat >>confdefs.h <<\EOF
10697 #define NCURSES 1
10698 EOF
10699
10700 cf_nculib_root=$cf_cv_screen
10701         # This works, except for the special case where we find gpm, but
10702         # ncurses is in a nonstandard location via $LIBS, and we really want
10703         # to link gpm.
10704 cf_ncurses_LIBS=""
10705 cf_ncurses_SAVE="$LIBS"
10706 echo "$as_me:10706: checking for Gpm_Open in -lgpm" >&5
10707 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10708 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10709   echo $ECHO_N "(cached) $ECHO_C" >&6
10710 else
10711   ac_check_lib_save_LIBS=$LIBS
10712 LIBS="-lgpm  $LIBS"
10713 cat >conftest.$ac_ext <<_ACEOF
10714 #line 10714 "configure"
10715 #include "confdefs.h"
10716
10717 /* Override any gcc2 internal prototype to avoid an error.  */
10718 #ifdef __cplusplus
10719 extern "C"
10720 #endif
10721 /* We use char because int might match the return type of a gcc2
10722    builtin and then its argument prototype would still apply.  */
10723 char Gpm_Open ();
10724 int
10725 main (void)
10726 {
10727 Gpm_Open ();
10728   ;
10729   return 0;
10730 }
10731 _ACEOF
10732 rm -f conftest.$ac_objext conftest$ac_exeext
10733 if { (eval echo "$as_me:10733: \"$ac_link\"") >&5
10734   (eval $ac_link) 2>&5
10735   ac_status=$?
10736   echo "$as_me:10736: \$? = $ac_status" >&5
10737   (exit $ac_status); } &&
10738          { ac_try='test -s conftest$ac_exeext'
10739   { (eval echo "$as_me:10739: \"$ac_try\"") >&5
10740   (eval $ac_try) 2>&5
10741   ac_status=$?
10742   echo "$as_me:10742: \$? = $ac_status" >&5
10743   (exit $ac_status); }; }; then
10744   ac_cv_lib_gpm_Gpm_Open=yes
10745 else
10746   echo "$as_me: failed program was:" >&5
10747 cat conftest.$ac_ext >&5
10748 ac_cv_lib_gpm_Gpm_Open=no
10749 fi
10750 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10751 LIBS=$ac_check_lib_save_LIBS
10752 fi
10753 echo "$as_me:10753: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10754 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10755 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10756   echo "$as_me:10756: checking for initscr in -lgpm" >&5
10757 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10758 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10759   echo $ECHO_N "(cached) $ECHO_C" >&6
10760 else
10761   ac_check_lib_save_LIBS=$LIBS
10762 LIBS="-lgpm  $LIBS"
10763 cat >conftest.$ac_ext <<_ACEOF
10764 #line 10764 "configure"
10765 #include "confdefs.h"
10766
10767 /* Override any gcc2 internal prototype to avoid an error.  */
10768 #ifdef __cplusplus
10769 extern "C"
10770 #endif
10771 /* We use char because int might match the return type of a gcc2
10772    builtin and then its argument prototype would still apply.  */
10773 char initscr ();
10774 int
10775 main (void)
10776 {
10777 initscr ();
10778   ;
10779   return 0;
10780 }
10781 _ACEOF
10782 rm -f conftest.$ac_objext conftest$ac_exeext
10783 if { (eval echo "$as_me:10783: \"$ac_link\"") >&5
10784   (eval $ac_link) 2>&5
10785   ac_status=$?
10786   echo "$as_me:10786: \$? = $ac_status" >&5
10787   (exit $ac_status); } &&
10788          { ac_try='test -s conftest$ac_exeext'
10789   { (eval echo "$as_me:10789: \"$ac_try\"") >&5
10790   (eval $ac_try) 2>&5
10791   ac_status=$?
10792   echo "$as_me:10792: \$? = $ac_status" >&5
10793   (exit $ac_status); }; }; then
10794   ac_cv_lib_gpm_initscr=yes
10795 else
10796   echo "$as_me: failed program was:" >&5
10797 cat conftest.$ac_ext >&5
10798 ac_cv_lib_gpm_initscr=no
10799 fi
10800 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10801 LIBS=$ac_check_lib_save_LIBS
10802 fi
10803 echo "$as_me:10803: result: $ac_cv_lib_gpm_initscr" >&5
10804 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10805 if test $ac_cv_lib_gpm_initscr = yes; then
10806   LIBS="$cf_ncurses_SAVE"
10807 else
10808   cf_ncurses_LIBS="-lgpm"
10809 fi
10810
10811 fi
10812
10813 case $host_os in
10814 (freebsd*)
10815         # This is only necessary if you are linking against an obsolete
10816         # version of ncurses (but it should do no harm, since it's static).
10817         if test "$cf_nculib_root" = ncurses ; then
10818                 echo "$as_me:10818: checking for tgoto in -lmytinfo" >&5
10819 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10820 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10821   echo $ECHO_N "(cached) $ECHO_C" >&6
10822 else
10823   ac_check_lib_save_LIBS=$LIBS
10824 LIBS="-lmytinfo  $LIBS"
10825 cat >conftest.$ac_ext <<_ACEOF
10826 #line 10826 "configure"
10827 #include "confdefs.h"
10828
10829 /* Override any gcc2 internal prototype to avoid an error.  */
10830 #ifdef __cplusplus
10831 extern "C"
10832 #endif
10833 /* We use char because int might match the return type of a gcc2
10834    builtin and then its argument prototype would still apply.  */
10835 char tgoto ();
10836 int
10837 main (void)
10838 {
10839 tgoto ();
10840   ;
10841   return 0;
10842 }
10843 _ACEOF
10844 rm -f conftest.$ac_objext conftest$ac_exeext
10845 if { (eval echo "$as_me:10845: \"$ac_link\"") >&5
10846   (eval $ac_link) 2>&5
10847   ac_status=$?
10848   echo "$as_me:10848: \$? = $ac_status" >&5
10849   (exit $ac_status); } &&
10850          { ac_try='test -s conftest$ac_exeext'
10851   { (eval echo "$as_me:10851: \"$ac_try\"") >&5
10852   (eval $ac_try) 2>&5
10853   ac_status=$?
10854   echo "$as_me:10854: \$? = $ac_status" >&5
10855   (exit $ac_status); }; }; then
10856   ac_cv_lib_mytinfo_tgoto=yes
10857 else
10858   echo "$as_me: failed program was:" >&5
10859 cat conftest.$ac_ext >&5
10860 ac_cv_lib_mytinfo_tgoto=no
10861 fi
10862 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10863 LIBS=$ac_check_lib_save_LIBS
10864 fi
10865 echo "$as_me:10865: result: $ac_cv_lib_mytinfo_tgoto" >&5
10866 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10867 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10868   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10869 fi
10870
10871         fi
10872         ;;
10873 esac
10874
10875 cf_add_libs="$LIBS"
10876 # reverse order
10877 cf_add_0lib=
10878 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10879 # filter duplicates
10880 for cf_add_1lib in $cf_add_0lib; do
10881         for cf_add_2lib in $cf_add_libs; do
10882                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10883                         cf_add_1lib=
10884                         break
10885                 fi
10886         done
10887         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10888 done
10889 LIBS="$cf_add_libs"
10890
10891 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10892 then
10893
10894 cf_add_libs="$LIBS"
10895 # reverse order
10896 cf_add_0lib=
10897 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10898 # filter duplicates
10899 for cf_add_1lib in $cf_add_0lib; do
10900         for cf_add_2lib in $cf_add_libs; do
10901                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10902                         cf_add_1lib=
10903                         break
10904                 fi
10905         done
10906         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10907 done
10908 LIBS="$cf_add_libs"
10909
10910 else
10911
10912         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10913         cf_libdir=""
10914         echo "$as_me:10914: checking for initscr" >&5
10915 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10916 if test "${ac_cv_func_initscr+set}" = set; then
10917   echo $ECHO_N "(cached) $ECHO_C" >&6
10918 else
10919   cat >conftest.$ac_ext <<_ACEOF
10920 #line 10920 "configure"
10921 #include "confdefs.h"
10922 #define initscr autoconf_temporary
10923 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10924 #undef initscr
10925
10926 #ifdef __cplusplus
10927 extern "C"
10928 #endif
10929
10930 /* We use char because int might match the return type of a gcc2
10931    builtin and then its argument prototype would still apply.  */
10932 char initscr (void);
10933
10934 int
10935 main (void)
10936 {
10937
10938 /* The GNU C library defines stubs for functions which it implements
10939     to always fail with ENOSYS.  Some functions are actually named
10940     something starting with __ and the normal name is an alias.  */
10941 #if defined (__stub_initscr) || defined (__stub___initscr)
10942 #error found stub for initscr
10943 #endif
10944
10945         return initscr ();
10946   ;
10947   return 0;
10948 }
10949 _ACEOF
10950 rm -f conftest.$ac_objext conftest$ac_exeext
10951 if { (eval echo "$as_me:10951: \"$ac_link\"") >&5
10952   (eval $ac_link) 2>&5
10953   ac_status=$?
10954   echo "$as_me:10954: \$? = $ac_status" >&5
10955   (exit $ac_status); } &&
10956          { ac_try='test -s conftest$ac_exeext'
10957   { (eval echo "$as_me:10957: \"$ac_try\"") >&5
10958   (eval $ac_try) 2>&5
10959   ac_status=$?
10960   echo "$as_me:10960: \$? = $ac_status" >&5
10961   (exit $ac_status); }; }; then
10962   ac_cv_func_initscr=yes
10963 else
10964   echo "$as_me: failed program was:" >&5
10965 cat conftest.$ac_ext >&5
10966 ac_cv_func_initscr=no
10967 fi
10968 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10969 fi
10970 echo "$as_me:10970: result: $ac_cv_func_initscr" >&5
10971 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10972 if test $ac_cv_func_initscr = yes; then
10973   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10974 else
10975
10976                 cf_save_LIBS="$LIBS"
10977                 echo "$as_me:10977: checking for initscr in -l$cf_nculib_root" >&5
10978 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10979                 LIBS="-l$cf_nculib_root $LIBS"
10980                 cat >conftest.$ac_ext <<_ACEOF
10981 #line 10981 "configure"
10982 #include "confdefs.h"
10983 #include <${cf_cv_ncurses_header:-curses.h}>
10984 int
10985 main (void)
10986 {
10987 initscr()
10988   ;
10989   return 0;
10990 }
10991 _ACEOF
10992 rm -f conftest.$ac_objext conftest$ac_exeext
10993 if { (eval echo "$as_me:10993: \"$ac_link\"") >&5
10994   (eval $ac_link) 2>&5
10995   ac_status=$?
10996   echo "$as_me:10996: \$? = $ac_status" >&5
10997   (exit $ac_status); } &&
10998          { ac_try='test -s conftest$ac_exeext'
10999   { (eval echo "$as_me:10999: \"$ac_try\"") >&5
11000   (eval $ac_try) 2>&5
11001   ac_status=$?
11002   echo "$as_me:11002: \$? = $ac_status" >&5
11003   (exit $ac_status); }; }; then
11004   echo "$as_me:11004: result: yes" >&5
11005 echo "${ECHO_T}yes" >&6
11006                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11007
11008 else
11009   echo "$as_me: failed program was:" >&5
11010 cat conftest.$ac_ext >&5
11011 echo "$as_me:11011: result: no" >&5
11012 echo "${ECHO_T}no" >&6
11013
11014 cf_search=
11015 cf_library_path_list=""
11016 if test -n "${LDFLAGS}${LIBS}" ; then
11017         for cf_library_path in $LDFLAGS $LIBS
11018         do
11019                 case $cf_library_path in
11020                 (-L*)
11021                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11022
11023 test "x$cf_library_path" != "xNONE" && \
11024 test -d "$cf_library_path" && \
11025  {
11026         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11027         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
11028         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11029         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11030         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11031         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"
11032 }
11033
11034                         cf_library_path_list="$cf_library_path_list $cf_search"
11035                         ;;
11036                 esac
11037         done
11038 fi
11039
11040 cf_search=
11041
11042 test "x$prefix" != "xNONE" && \
11043 test -d "$prefix" && \
11044  {
11045         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11046         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
11047         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11048         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11049         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11050         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11051 }
11052
11053 for cf_subdir_prefix in \
11054         /usr \
11055         /usr/local \
11056         /usr/pkg \
11057         /opt \
11058         /opt/local \
11059         $HOME
11060 do
11061
11062 test "x$cf_subdir_prefix" != "x$prefix" && \
11063 test -d "$cf_subdir_prefix" && \
11064 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
11065         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11066         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11067         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11068         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11069         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11070         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"
11071 }
11072
11073 done
11074
11075 cf_search="$cf_library_path_list $cf_search"
11076
11077                         for cf_libdir in $cf_search
11078                         do
11079                                 echo "$as_me:11079: checking for -l$cf_nculib_root in $cf_libdir" >&5
11080 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11081                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11082                                 cat >conftest.$ac_ext <<_ACEOF
11083 #line 11083 "configure"
11084 #include "confdefs.h"
11085 #include <${cf_cv_ncurses_header:-curses.h}>
11086 int
11087 main (void)
11088 {
11089 initscr()
11090   ;
11091   return 0;
11092 }
11093 _ACEOF
11094 rm -f conftest.$ac_objext conftest$ac_exeext
11095 if { (eval echo "$as_me:11095: \"$ac_link\"") >&5
11096   (eval $ac_link) 2>&5
11097   ac_status=$?
11098   echo "$as_me:11098: \$? = $ac_status" >&5
11099   (exit $ac_status); } &&
11100          { ac_try='test -s conftest$ac_exeext'
11101   { (eval echo "$as_me:11101: \"$ac_try\"") >&5
11102   (eval $ac_try) 2>&5
11103   ac_status=$?
11104   echo "$as_me:11104: \$? = $ac_status" >&5
11105   (exit $ac_status); }; }; then
11106   echo "$as_me:11106: result: yes" >&5
11107 echo "${ECHO_T}yes" >&6
11108                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11109                                          break
11110 else
11111   echo "$as_me: failed program was:" >&5
11112 cat conftest.$ac_ext >&5
11113 echo "$as_me:11113: result: no" >&5
11114 echo "${ECHO_T}no" >&6
11115                                          LIBS="$cf_save_LIBS"
11116 fi
11117 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11118                         done
11119
11120 fi
11121 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11122
11123 fi
11124
11125 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11126
11127 if test $cf_found_library = no ; then
11128         { { echo "$as_me:11128: error: Cannot link $cf_nculib_root library" >&5
11129 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11130    { (exit 1); exit 1; }; }
11131 fi
11132
11133 fi
11134
11135 if test -n "$cf_ncurses_LIBS" ; then
11136         echo "$as_me:11136: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11137 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11138         cf_ncurses_SAVE="$LIBS"
11139         for p in $cf_ncurses_LIBS ; do
11140                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11141                 if test "$q" != "$LIBS" ; then
11142                         LIBS="$q"
11143                 fi
11144         done
11145         cat >conftest.$ac_ext <<_ACEOF
11146 #line 11146 "configure"
11147 #include "confdefs.h"
11148 #include <${cf_cv_ncurses_header:-curses.h}>
11149 int
11150 main (void)
11151 {
11152 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11153   ;
11154   return 0;
11155 }
11156 _ACEOF
11157 rm -f conftest.$ac_objext conftest$ac_exeext
11158 if { (eval echo "$as_me:11158: \"$ac_link\"") >&5
11159   (eval $ac_link) 2>&5
11160   ac_status=$?
11161   echo "$as_me:11161: \$? = $ac_status" >&5
11162   (exit $ac_status); } &&
11163          { ac_try='test -s conftest$ac_exeext'
11164   { (eval echo "$as_me:11164: \"$ac_try\"") >&5
11165   (eval $ac_try) 2>&5
11166   ac_status=$?
11167   echo "$as_me:11167: \$? = $ac_status" >&5
11168   (exit $ac_status); }; }; then
11169   echo "$as_me:11169: result: yes" >&5
11170 echo "${ECHO_T}yes" >&6
11171 else
11172   echo "$as_me: failed program was:" >&5
11173 cat conftest.$ac_ext >&5
11174 echo "$as_me:11174: result: no" >&5
11175 echo "${ECHO_T}no" >&6
11176                  LIBS="$cf_ncurses_SAVE"
11177 fi
11178 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11179 fi
11180
11181 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11182
11183 cat >>confdefs.h <<EOF
11184 #define $cf_nculib_ROOT 1
11185 EOF
11186
11187         fi
11188 else
11189         NCURSES_CONFIG=none
11190 fi
11191
11192         ;;
11193 (pdcurses)
11194         echo "$as_me:11194: checking for X" >&5
11195 echo $ECHO_N "checking for X... $ECHO_C" >&6
11196
11197 # Check whether --with-x or --without-x was given.
11198 if test "${with_x+set}" = set; then
11199   withval="$with_x"
11200
11201 fi;
11202 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11203 if test "x$with_x" = xno; then
11204   # The user explicitly disabled X.
11205   have_x=disabled
11206 else
11207   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11208     # Both variables are already set.
11209     have_x=yes
11210   else
11211     if test "${ac_cv_have_x+set}" = set; then
11212   echo $ECHO_N "(cached) $ECHO_C" >&6
11213 else
11214   # One or both of the vars are not set, and there is no cached value.
11215 ac_x_includes=no ac_x_libraries=no
11216 rm -fr conftest.dir
11217 if mkdir conftest.dir; then
11218   cd conftest.dir
11219   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11220   cat >Imakefile <<'EOF'
11221 acfindx:
11222         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11223 EOF
11224   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11225     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11226     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11227     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11228     for ac_extension in a so sl dylib dll; do
11229       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11230          test -f $ac_im_libdir/libX11.$ac_extension; then
11231         ac_im_usrlibdir=$ac_im_libdir; break
11232       fi
11233     done
11234     # Screen out bogus values from the imake configuration.  They are
11235     # bogus both because they are the default anyway, and because
11236     # using them would break gcc on systems where it needs fixed includes.
11237     case $ac_im_incroot in
11238         /usr/include) ;;
11239         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11240     esac
11241     case $ac_im_usrlibdir in
11242         /usr/lib | /lib) ;;
11243         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11244     esac
11245   fi
11246   cd ..
11247   rm -fr conftest.dir
11248 fi
11249
11250 # Standard set of common directories for X headers.
11251 # Check X11 before X11Rn because it is often a symlink to the current release.
11252 ac_x_header_dirs='
11253 /usr/X11/include
11254 /usr/X11R7/include
11255 /usr/X11R6/include
11256 /usr/X11R5/include
11257 /usr/X11R4/include
11258
11259 /opt/local/include
11260 /opt/X11/include
11261
11262 /usr/include/X11
11263 /usr/include/X11R7
11264 /usr/include/X11R6
11265 /usr/include/X11R5
11266 /usr/include/X11R4
11267
11268 /usr/local/X11/include
11269 /usr/local/X11R7/include
11270 /usr/local/X11R6/include
11271 /usr/local/X11R5/include
11272 /usr/local/X11R4/include
11273
11274 /usr/local/include/X11
11275 /usr/local/include/X11R7
11276 /usr/local/include/X11R6
11277 /usr/local/include/X11R5
11278 /usr/local/include/X11R4
11279
11280 /usr/X386/include
11281 /usr/x386/include
11282 /usr/XFree86/include/X11
11283
11284 /usr/include
11285 /usr/local/include
11286 /usr/unsupported/include
11287 /usr/athena/include
11288 /usr/local/x11r5/include
11289 /usr/lpp/Xamples/include
11290
11291 /usr/openwin/include
11292 /usr/openwin/share/include'
11293
11294 if test "$ac_x_includes" = no; then
11295   # Guess where to find include files, by looking for Intrinsic.h.
11296   # First, try using that file with no special directory specified.
11297   cat >conftest.$ac_ext <<_ACEOF
11298 #line 11298 "configure"
11299 #include "confdefs.h"
11300 #include <X11/Intrinsic.h>
11301 _ACEOF
11302 if { (eval echo "$as_me:11302: \"$ac_cpp conftest.$ac_ext\"") >&5
11303   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11304   ac_status=$?
11305   egrep -v '^ *\+' conftest.er1 >conftest.err
11306   rm -f conftest.er1
11307   cat conftest.err >&5
11308   echo "$as_me:11308: \$? = $ac_status" >&5
11309   (exit $ac_status); } >/dev/null; then
11310   if test -s conftest.err; then
11311     ac_cpp_err=$ac_c_preproc_warn_flag
11312   else
11313     ac_cpp_err=
11314   fi
11315 else
11316   ac_cpp_err=yes
11317 fi
11318 if test -z "$ac_cpp_err"; then
11319   # We can compile using X headers with no special include directory.
11320 ac_x_includes=
11321 else
11322   echo "$as_me: failed program was:" >&5
11323   cat conftest.$ac_ext >&5
11324   for ac_dir in $ac_x_header_dirs; do
11325   if test -r "$ac_dir/X11/Intrinsic.h"; then
11326     ac_x_includes=$ac_dir
11327     break
11328   fi
11329 done
11330 fi
11331 rm -f conftest.err conftest.$ac_ext
11332 fi # $ac_x_includes = no
11333
11334 if test "$ac_x_libraries" = no; then
11335   # Check for the libraries.
11336   # See if we find them without any special options.
11337   # Don't add to $LIBS permanently.
11338   ac_save_LIBS=$LIBS
11339   LIBS="-lXt $LIBS"
11340   cat >conftest.$ac_ext <<_ACEOF
11341 #line 11341 "configure"
11342 #include "confdefs.h"
11343 #include <X11/Intrinsic.h>
11344 int
11345 main (void)
11346 {
11347 XtMalloc (0)
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   LIBS=$ac_save_LIBS
11365 # We can link X programs with no special library path.
11366 ac_x_libraries=
11367 else
11368   echo "$as_me: failed program was:" >&5
11369 cat conftest.$ac_ext >&5
11370 LIBS=$ac_save_LIBS
11371 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11372 do
11373   # Don't even attempt the hair of trying to link an X program!
11374   for ac_extension in a so sl dylib dll; do
11375     if test -r $ac_dir/libXt.$ac_extension; then
11376       ac_x_libraries=$ac_dir
11377       break 2
11378     fi
11379   done
11380 done
11381 fi
11382 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11383 fi # $ac_x_libraries = no
11384
11385 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11386   # Didn't find X anywhere.  Cache the known absence of X.
11387   ac_cv_have_x="have_x=no"
11388 else
11389   # Record where we found X for the cache.
11390   ac_cv_have_x="have_x=yes \
11391                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11392 fi
11393 fi
11394
11395   fi
11396   eval "$ac_cv_have_x"
11397 fi # $with_x != no
11398
11399 if test "$have_x" != yes; then
11400   echo "$as_me:11400: result: $have_x" >&5
11401 echo "${ECHO_T}$have_x" >&6
11402   no_x=yes
11403 else
11404   # If each of the values was on the command line, it overrides each guess.
11405   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11406   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11407   # Update the cache value to reflect the command line values.
11408   ac_cv_have_x="have_x=yes \
11409                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11410   echo "$as_me:11410: result: libraries $x_libraries, headers $x_includes" >&5
11411 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11412 fi
11413
11414 if test "$no_x" = yes; then
11415   # Not all programs may use this symbol, but it does not hurt to define it.
11416
11417 cat >>confdefs.h <<\EOF
11418 #define X_DISPLAY_MISSING 1
11419 EOF
11420
11421   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11422 else
11423   if test -n "$x_includes"; then
11424     X_CFLAGS="$X_CFLAGS -I$x_includes"
11425   fi
11426
11427   # It would also be nice to do this for all -L options, not just this one.
11428   if test -n "$x_libraries"; then
11429     X_LIBS="$X_LIBS -L$x_libraries"
11430     # For Solaris; some versions of Sun CC require a space after -R and
11431     # others require no space.  Words are not sufficient . . . .
11432     case `(uname -sr) 2>/dev/null` in
11433     "SunOS 5"*)
11434       echo "$as_me:11434: checking whether -R must be followed by a space" >&5
11435 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11436       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11437       cat >conftest.$ac_ext <<_ACEOF
11438 #line 11438 "configure"
11439 #include "confdefs.h"
11440
11441 int
11442 main (void)
11443 {
11444
11445   ;
11446   return 0;
11447 }
11448 _ACEOF
11449 rm -f conftest.$ac_objext conftest$ac_exeext
11450 if { (eval echo "$as_me:11450: \"$ac_link\"") >&5
11451   (eval $ac_link) 2>&5
11452   ac_status=$?
11453   echo "$as_me:11453: \$? = $ac_status" >&5
11454   (exit $ac_status); } &&
11455          { ac_try='test -s conftest$ac_exeext'
11456   { (eval echo "$as_me:11456: \"$ac_try\"") >&5
11457   (eval $ac_try) 2>&5
11458   ac_status=$?
11459   echo "$as_me:11459: \$? = $ac_status" >&5
11460   (exit $ac_status); }; }; then
11461   ac_R_nospace=yes
11462 else
11463   echo "$as_me: failed program was:" >&5
11464 cat conftest.$ac_ext >&5
11465 ac_R_nospace=no
11466 fi
11467 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11468       if test $ac_R_nospace = yes; then
11469         echo "$as_me:11469: result: no" >&5
11470 echo "${ECHO_T}no" >&6
11471         X_LIBS="$X_LIBS -R$x_libraries"
11472       else
11473         LIBS="$ac_xsave_LIBS -R $x_libraries"
11474         cat >conftest.$ac_ext <<_ACEOF
11475 #line 11475 "configure"
11476 #include "confdefs.h"
11477
11478 int
11479 main (void)
11480 {
11481
11482   ;
11483   return 0;
11484 }
11485 _ACEOF
11486 rm -f conftest.$ac_objext conftest$ac_exeext
11487 if { (eval echo "$as_me:11487: \"$ac_link\"") >&5
11488   (eval $ac_link) 2>&5
11489   ac_status=$?
11490   echo "$as_me:11490: \$? = $ac_status" >&5
11491   (exit $ac_status); } &&
11492          { ac_try='test -s conftest$ac_exeext'
11493   { (eval echo "$as_me:11493: \"$ac_try\"") >&5
11494   (eval $ac_try) 2>&5
11495   ac_status=$?
11496   echo "$as_me:11496: \$? = $ac_status" >&5
11497   (exit $ac_status); }; }; then
11498   ac_R_space=yes
11499 else
11500   echo "$as_me: failed program was:" >&5
11501 cat conftest.$ac_ext >&5
11502 ac_R_space=no
11503 fi
11504 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11505         if test $ac_R_space = yes; then
11506           echo "$as_me:11506: result: yes" >&5
11507 echo "${ECHO_T}yes" >&6
11508           X_LIBS="$X_LIBS -R $x_libraries"
11509         else
11510           echo "$as_me:11510: result: neither works" >&5
11511 echo "${ECHO_T}neither works" >&6
11512         fi
11513       fi
11514       LIBS=$ac_xsave_LIBS
11515     esac
11516   fi
11517
11518   # Check for system-dependent libraries X programs must link with.
11519   # Do this before checking for the system-independent R6 libraries
11520   # (-lICE), since we may need -lsocket or whatever for X linking.
11521
11522   if test "$ISC" = yes; then
11523     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11524   else
11525     # Martyn Johnson says this is needed for Ultrix, if the X
11526     # libraries were built with DECnet support.  And Karl Berry says
11527     # the Alpha needs dnet_stub (dnet does not exist).
11528     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11529     cat >conftest.$ac_ext <<_ACEOF
11530 #line 11530 "configure"
11531 #include "confdefs.h"
11532
11533 /* Override any gcc2 internal prototype to avoid an error.  */
11534 #ifdef __cplusplus
11535 extern "C"
11536 #endif
11537 /* We use char because int might match the return type of a gcc2
11538    builtin and then its argument prototype would still apply.  */
11539 char XOpenDisplay ();
11540 int
11541 main (void)
11542 {
11543 XOpenDisplay ();
11544   ;
11545   return 0;
11546 }
11547 _ACEOF
11548 rm -f conftest.$ac_objext conftest$ac_exeext
11549 if { (eval echo "$as_me:11549: \"$ac_link\"") >&5
11550   (eval $ac_link) 2>&5
11551   ac_status=$?
11552   echo "$as_me:11552: \$? = $ac_status" >&5
11553   (exit $ac_status); } &&
11554          { ac_try='test -s conftest$ac_exeext'
11555   { (eval echo "$as_me:11555: \"$ac_try\"") >&5
11556   (eval $ac_try) 2>&5
11557   ac_status=$?
11558   echo "$as_me:11558: \$? = $ac_status" >&5
11559   (exit $ac_status); }; }; then
11560   :
11561 else
11562   echo "$as_me: failed program was:" >&5
11563 cat conftest.$ac_ext >&5
11564 echo "$as_me:11564: checking for dnet_ntoa in -ldnet" >&5
11565 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11566 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11567   echo $ECHO_N "(cached) $ECHO_C" >&6
11568 else
11569   ac_check_lib_save_LIBS=$LIBS
11570 LIBS="-ldnet  $LIBS"
11571 cat >conftest.$ac_ext <<_ACEOF
11572 #line 11572 "configure"
11573 #include "confdefs.h"
11574
11575 /* Override any gcc2 internal prototype to avoid an error.  */
11576 #ifdef __cplusplus
11577 extern "C"
11578 #endif
11579 /* We use char because int might match the return type of a gcc2
11580    builtin and then its argument prototype would still apply.  */
11581 char dnet_ntoa ();
11582 int
11583 main (void)
11584 {
11585 dnet_ntoa ();
11586   ;
11587   return 0;
11588 }
11589 _ACEOF
11590 rm -f conftest.$ac_objext conftest$ac_exeext
11591 if { (eval echo "$as_me:11591: \"$ac_link\"") >&5
11592   (eval $ac_link) 2>&5
11593   ac_status=$?
11594   echo "$as_me:11594: \$? = $ac_status" >&5
11595   (exit $ac_status); } &&
11596          { ac_try='test -s conftest$ac_exeext'
11597   { (eval echo "$as_me:11597: \"$ac_try\"") >&5
11598   (eval $ac_try) 2>&5
11599   ac_status=$?
11600   echo "$as_me:11600: \$? = $ac_status" >&5
11601   (exit $ac_status); }; }; then
11602   ac_cv_lib_dnet_dnet_ntoa=yes
11603 else
11604   echo "$as_me: failed program was:" >&5
11605 cat conftest.$ac_ext >&5
11606 ac_cv_lib_dnet_dnet_ntoa=no
11607 fi
11608 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11609 LIBS=$ac_check_lib_save_LIBS
11610 fi
11611 echo "$as_me:11611: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
11612 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
11613 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
11614   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
11615 fi
11616
11617     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
11618       echo "$as_me:11618: checking for dnet_ntoa in -ldnet_stub" >&5
11619 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
11620 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
11621   echo $ECHO_N "(cached) $ECHO_C" >&6
11622 else
11623   ac_check_lib_save_LIBS=$LIBS
11624 LIBS="-ldnet_stub  $LIBS"
11625 cat >conftest.$ac_ext <<_ACEOF
11626 #line 11626 "configure"
11627 #include "confdefs.h"
11628
11629 /* Override any gcc2 internal prototype to avoid an error.  */
11630 #ifdef __cplusplus
11631 extern "C"
11632 #endif
11633 /* We use char because int might match the return type of a gcc2
11634    builtin and then its argument prototype would still apply.  */
11635 char dnet_ntoa ();
11636 int
11637 main (void)
11638 {
11639 dnet_ntoa ();
11640   ;
11641   return 0;
11642 }
11643 _ACEOF
11644 rm -f conftest.$ac_objext conftest$ac_exeext
11645 if { (eval echo "$as_me:11645: \"$ac_link\"") >&5
11646   (eval $ac_link) 2>&5
11647   ac_status=$?
11648   echo "$as_me:11648: \$? = $ac_status" >&5
11649   (exit $ac_status); } &&
11650          { ac_try='test -s conftest$ac_exeext'
11651   { (eval echo "$as_me:11651: \"$ac_try\"") >&5
11652   (eval $ac_try) 2>&5
11653   ac_status=$?
11654   echo "$as_me:11654: \$? = $ac_status" >&5
11655   (exit $ac_status); }; }; then
11656   ac_cv_lib_dnet_stub_dnet_ntoa=yes
11657 else
11658   echo "$as_me: failed program was:" >&5
11659 cat conftest.$ac_ext >&5
11660 ac_cv_lib_dnet_stub_dnet_ntoa=no
11661 fi
11662 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11663 LIBS=$ac_check_lib_save_LIBS
11664 fi
11665 echo "$as_me:11665: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
11666 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
11667 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
11668   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
11669 fi
11670
11671     fi
11672 fi
11673 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11674     LIBS="$ac_xsave_LIBS"
11675
11676     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
11677     # to get the SysV transport functions.
11678     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
11679     # needs -lnsl.
11680     # The nsl library prevents programs from opening the X display
11681     # on Irix 5.2, according to T.E. Dickey.
11682     # The functions gethostbyname, getservbyname, and inet_addr are
11683     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
11684     echo "$as_me:11684: checking for gethostbyname" >&5
11685 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
11686 if test "${ac_cv_func_gethostbyname+set}" = set; then
11687   echo $ECHO_N "(cached) $ECHO_C" >&6
11688 else
11689   cat >conftest.$ac_ext <<_ACEOF
11690 #line 11690 "configure"
11691 #include "confdefs.h"
11692 #define gethostbyname autoconf_temporary
11693 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11694 #undef gethostbyname
11695
11696 #ifdef __cplusplus
11697 extern "C"
11698 #endif
11699
11700 /* We use char because int might match the return type of a gcc2
11701    builtin and then its argument prototype would still apply.  */
11702 char gethostbyname (void);
11703
11704 int
11705 main (void)
11706 {
11707
11708 /* The GNU C library defines stubs for functions which it implements
11709     to always fail with ENOSYS.  Some functions are actually named
11710     something starting with __ and the normal name is an alias.  */
11711 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
11712 #error found stub for gethostbyname
11713 #endif
11714
11715         return gethostbyname ();
11716   ;
11717   return 0;
11718 }
11719 _ACEOF
11720 rm -f conftest.$ac_objext conftest$ac_exeext
11721 if { (eval echo "$as_me:11721: \"$ac_link\"") >&5
11722   (eval $ac_link) 2>&5
11723   ac_status=$?
11724   echo "$as_me:11724: \$? = $ac_status" >&5
11725   (exit $ac_status); } &&
11726          { ac_try='test -s conftest$ac_exeext'
11727   { (eval echo "$as_me:11727: \"$ac_try\"") >&5
11728   (eval $ac_try) 2>&5
11729   ac_status=$?
11730   echo "$as_me:11730: \$? = $ac_status" >&5
11731   (exit $ac_status); }; }; then
11732   ac_cv_func_gethostbyname=yes
11733 else
11734   echo "$as_me: failed program was:" >&5
11735 cat conftest.$ac_ext >&5
11736 ac_cv_func_gethostbyname=no
11737 fi
11738 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11739 fi
11740 echo "$as_me:11740: result: $ac_cv_func_gethostbyname" >&5
11741 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
11742
11743     if test $ac_cv_func_gethostbyname = no; then
11744       echo "$as_me:11744: checking for gethostbyname in -lnsl" >&5
11745 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
11746 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
11747   echo $ECHO_N "(cached) $ECHO_C" >&6
11748 else
11749   ac_check_lib_save_LIBS=$LIBS
11750 LIBS="-lnsl  $LIBS"
11751 cat >conftest.$ac_ext <<_ACEOF
11752 #line 11752 "configure"
11753 #include "confdefs.h"
11754
11755 /* Override any gcc2 internal prototype to avoid an error.  */
11756 #ifdef __cplusplus
11757 extern "C"
11758 #endif
11759 /* We use char because int might match the return type of a gcc2
11760    builtin and then its argument prototype would still apply.  */
11761 char gethostbyname ();
11762 int
11763 main (void)
11764 {
11765 gethostbyname ();
11766   ;
11767   return 0;
11768 }
11769 _ACEOF
11770 rm -f conftest.$ac_objext conftest$ac_exeext
11771 if { (eval echo "$as_me:11771: \"$ac_link\"") >&5
11772   (eval $ac_link) 2>&5
11773   ac_status=$?
11774   echo "$as_me:11774: \$? = $ac_status" >&5
11775   (exit $ac_status); } &&
11776          { ac_try='test -s conftest$ac_exeext'
11777   { (eval echo "$as_me:11777: \"$ac_try\"") >&5
11778   (eval $ac_try) 2>&5
11779   ac_status=$?
11780   echo "$as_me:11780: \$? = $ac_status" >&5
11781   (exit $ac_status); }; }; then
11782   ac_cv_lib_nsl_gethostbyname=yes
11783 else
11784   echo "$as_me: failed program was:" >&5
11785 cat conftest.$ac_ext >&5
11786 ac_cv_lib_nsl_gethostbyname=no
11787 fi
11788 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11789 LIBS=$ac_check_lib_save_LIBS
11790 fi
11791 echo "$as_me:11791: result: $ac_cv_lib_nsl_gethostbyname" >&5
11792 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
11793 if test $ac_cv_lib_nsl_gethostbyname = yes; then
11794   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
11795 fi
11796
11797       if test $ac_cv_lib_nsl_gethostbyname = no; then
11798         echo "$as_me:11798: checking for gethostbyname in -lbsd" >&5
11799 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
11800 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
11801   echo $ECHO_N "(cached) $ECHO_C" >&6
11802 else
11803   ac_check_lib_save_LIBS=$LIBS
11804 LIBS="-lbsd  $LIBS"
11805 cat >conftest.$ac_ext <<_ACEOF
11806 #line 11806 "configure"
11807 #include "confdefs.h"
11808
11809 /* Override any gcc2 internal prototype to avoid an error.  */
11810 #ifdef __cplusplus
11811 extern "C"
11812 #endif
11813 /* We use char because int might match the return type of a gcc2
11814    builtin and then its argument prototype would still apply.  */
11815 char gethostbyname ();
11816 int
11817 main (void)
11818 {
11819 gethostbyname ();
11820   ;
11821   return 0;
11822 }
11823 _ACEOF
11824 rm -f conftest.$ac_objext conftest$ac_exeext
11825 if { (eval echo "$as_me:11825: \"$ac_link\"") >&5
11826   (eval $ac_link) 2>&5
11827   ac_status=$?
11828   echo "$as_me:11828: \$? = $ac_status" >&5
11829   (exit $ac_status); } &&
11830          { ac_try='test -s conftest$ac_exeext'
11831   { (eval echo "$as_me:11831: \"$ac_try\"") >&5
11832   (eval $ac_try) 2>&5
11833   ac_status=$?
11834   echo "$as_me:11834: \$? = $ac_status" >&5
11835   (exit $ac_status); }; }; then
11836   ac_cv_lib_bsd_gethostbyname=yes
11837 else
11838   echo "$as_me: failed program was:" >&5
11839 cat conftest.$ac_ext >&5
11840 ac_cv_lib_bsd_gethostbyname=no
11841 fi
11842 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11843 LIBS=$ac_check_lib_save_LIBS
11844 fi
11845 echo "$as_me:11845: result: $ac_cv_lib_bsd_gethostbyname" >&5
11846 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
11847 if test $ac_cv_lib_bsd_gethostbyname = yes; then
11848   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
11849 fi
11850
11851       fi
11852     fi
11853
11854     # lieder@skyler.mavd.honeywell.com says without -lsocket,
11855     # socket/setsockopt and other routines are undefined under SCO ODT
11856     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
11857     # on later versions), says Simon Leinen: it contains gethostby*
11858     # variants that don't use the nameserver (or something).  -lsocket
11859     # must be given before -lnsl if both are needed.  We assume that
11860     # if connect needs -lnsl, so does gethostbyname.
11861     echo "$as_me:11861: checking for connect" >&5
11862 echo $ECHO_N "checking for connect... $ECHO_C" >&6
11863 if test "${ac_cv_func_connect+set}" = set; then
11864   echo $ECHO_N "(cached) $ECHO_C" >&6
11865 else
11866   cat >conftest.$ac_ext <<_ACEOF
11867 #line 11867 "configure"
11868 #include "confdefs.h"
11869 #define connect autoconf_temporary
11870 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11871 #undef connect
11872
11873 #ifdef __cplusplus
11874 extern "C"
11875 #endif
11876
11877 /* We use char because int might match the return type of a gcc2
11878    builtin and then its argument prototype would still apply.  */
11879 char connect (void);
11880
11881 int
11882 main (void)
11883 {
11884
11885 /* The GNU C library defines stubs for functions which it implements
11886     to always fail with ENOSYS.  Some functions are actually named
11887     something starting with __ and the normal name is an alias.  */
11888 #if defined (__stub_connect) || defined (__stub___connect)
11889 #error found stub for connect
11890 #endif
11891
11892         return connect ();
11893   ;
11894   return 0;
11895 }
11896 _ACEOF
11897 rm -f conftest.$ac_objext conftest$ac_exeext
11898 if { (eval echo "$as_me:11898: \"$ac_link\"") >&5
11899   (eval $ac_link) 2>&5
11900   ac_status=$?
11901   echo "$as_me:11901: \$? = $ac_status" >&5
11902   (exit $ac_status); } &&
11903          { ac_try='test -s conftest$ac_exeext'
11904   { (eval echo "$as_me:11904: \"$ac_try\"") >&5
11905   (eval $ac_try) 2>&5
11906   ac_status=$?
11907   echo "$as_me:11907: \$? = $ac_status" >&5
11908   (exit $ac_status); }; }; then
11909   ac_cv_func_connect=yes
11910 else
11911   echo "$as_me: failed program was:" >&5
11912 cat conftest.$ac_ext >&5
11913 ac_cv_func_connect=no
11914 fi
11915 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11916 fi
11917 echo "$as_me:11917: result: $ac_cv_func_connect" >&5
11918 echo "${ECHO_T}$ac_cv_func_connect" >&6
11919
11920     if test $ac_cv_func_connect = no; then
11921       echo "$as_me:11921: checking for connect in -lsocket" >&5
11922 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
11923 if test "${ac_cv_lib_socket_connect+set}" = set; then
11924   echo $ECHO_N "(cached) $ECHO_C" >&6
11925 else
11926   ac_check_lib_save_LIBS=$LIBS
11927 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
11928 cat >conftest.$ac_ext <<_ACEOF
11929 #line 11929 "configure"
11930 #include "confdefs.h"
11931
11932 /* Override any gcc2 internal prototype to avoid an error.  */
11933 #ifdef __cplusplus
11934 extern "C"
11935 #endif
11936 /* We use char because int might match the return type of a gcc2
11937    builtin and then its argument prototype would still apply.  */
11938 char connect ();
11939 int
11940 main (void)
11941 {
11942 connect ();
11943   ;
11944   return 0;
11945 }
11946 _ACEOF
11947 rm -f conftest.$ac_objext conftest$ac_exeext
11948 if { (eval echo "$as_me:11948: \"$ac_link\"") >&5
11949   (eval $ac_link) 2>&5
11950   ac_status=$?
11951   echo "$as_me:11951: \$? = $ac_status" >&5
11952   (exit $ac_status); } &&
11953          { ac_try='test -s conftest$ac_exeext'
11954   { (eval echo "$as_me:11954: \"$ac_try\"") >&5
11955   (eval $ac_try) 2>&5
11956   ac_status=$?
11957   echo "$as_me:11957: \$? = $ac_status" >&5
11958   (exit $ac_status); }; }; then
11959   ac_cv_lib_socket_connect=yes
11960 else
11961   echo "$as_me: failed program was:" >&5
11962 cat conftest.$ac_ext >&5
11963 ac_cv_lib_socket_connect=no
11964 fi
11965 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11966 LIBS=$ac_check_lib_save_LIBS
11967 fi
11968 echo "$as_me:11968: result: $ac_cv_lib_socket_connect" >&5
11969 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
11970 if test $ac_cv_lib_socket_connect = yes; then
11971   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
11972 fi
11973
11974     fi
11975
11976     # Guillermo Gomez says -lposix is necessary on A/UX.
11977     echo "$as_me:11977: checking for remove" >&5
11978 echo $ECHO_N "checking for remove... $ECHO_C" >&6
11979 if test "${ac_cv_func_remove+set}" = set; then
11980   echo $ECHO_N "(cached) $ECHO_C" >&6
11981 else
11982   cat >conftest.$ac_ext <<_ACEOF
11983 #line 11983 "configure"
11984 #include "confdefs.h"
11985 #define remove autoconf_temporary
11986 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11987 #undef remove
11988
11989 #ifdef __cplusplus
11990 extern "C"
11991 #endif
11992
11993 /* We use char because int might match the return type of a gcc2
11994    builtin and then its argument prototype would still apply.  */
11995 char remove (void);
11996
11997 int
11998 main (void)
11999 {
12000
12001 /* The GNU C library defines stubs for functions which it implements
12002     to always fail with ENOSYS.  Some functions are actually named
12003     something starting with __ and the normal name is an alias.  */
12004 #if defined (__stub_remove) || defined (__stub___remove)
12005 #error found stub for remove
12006 #endif
12007
12008         return remove ();
12009   ;
12010   return 0;
12011 }
12012 _ACEOF
12013 rm -f conftest.$ac_objext conftest$ac_exeext
12014 if { (eval echo "$as_me:12014: \"$ac_link\"") >&5
12015   (eval $ac_link) 2>&5
12016   ac_status=$?
12017   echo "$as_me:12017: \$? = $ac_status" >&5
12018   (exit $ac_status); } &&
12019          { ac_try='test -s conftest$ac_exeext'
12020   { (eval echo "$as_me:12020: \"$ac_try\"") >&5
12021   (eval $ac_try) 2>&5
12022   ac_status=$?
12023   echo "$as_me:12023: \$? = $ac_status" >&5
12024   (exit $ac_status); }; }; then
12025   ac_cv_func_remove=yes
12026 else
12027   echo "$as_me: failed program was:" >&5
12028 cat conftest.$ac_ext >&5
12029 ac_cv_func_remove=no
12030 fi
12031 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12032 fi
12033 echo "$as_me:12033: result: $ac_cv_func_remove" >&5
12034 echo "${ECHO_T}$ac_cv_func_remove" >&6
12035
12036     if test $ac_cv_func_remove = no; then
12037       echo "$as_me:12037: checking for remove in -lposix" >&5
12038 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12039 if test "${ac_cv_lib_posix_remove+set}" = set; then
12040   echo $ECHO_N "(cached) $ECHO_C" >&6
12041 else
12042   ac_check_lib_save_LIBS=$LIBS
12043 LIBS="-lposix  $LIBS"
12044 cat >conftest.$ac_ext <<_ACEOF
12045 #line 12045 "configure"
12046 #include "confdefs.h"
12047
12048 /* Override any gcc2 internal prototype to avoid an error.  */
12049 #ifdef __cplusplus
12050 extern "C"
12051 #endif
12052 /* We use char because int might match the return type of a gcc2
12053    builtin and then its argument prototype would still apply.  */
12054 char remove ();
12055 int
12056 main (void)
12057 {
12058 remove ();
12059   ;
12060   return 0;
12061 }
12062 _ACEOF
12063 rm -f conftest.$ac_objext conftest$ac_exeext
12064 if { (eval echo "$as_me:12064: \"$ac_link\"") >&5
12065   (eval $ac_link) 2>&5
12066   ac_status=$?
12067   echo "$as_me:12067: \$? = $ac_status" >&5
12068   (exit $ac_status); } &&
12069          { ac_try='test -s conftest$ac_exeext'
12070   { (eval echo "$as_me:12070: \"$ac_try\"") >&5
12071   (eval $ac_try) 2>&5
12072   ac_status=$?
12073   echo "$as_me:12073: \$? = $ac_status" >&5
12074   (exit $ac_status); }; }; then
12075   ac_cv_lib_posix_remove=yes
12076 else
12077   echo "$as_me: failed program was:" >&5
12078 cat conftest.$ac_ext >&5
12079 ac_cv_lib_posix_remove=no
12080 fi
12081 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12082 LIBS=$ac_check_lib_save_LIBS
12083 fi
12084 echo "$as_me:12084: result: $ac_cv_lib_posix_remove" >&5
12085 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12086 if test $ac_cv_lib_posix_remove = yes; then
12087   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12088 fi
12089
12090     fi
12091
12092     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12093     echo "$as_me:12093: checking for shmat" >&5
12094 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12095 if test "${ac_cv_func_shmat+set}" = set; then
12096   echo $ECHO_N "(cached) $ECHO_C" >&6
12097 else
12098   cat >conftest.$ac_ext <<_ACEOF
12099 #line 12099 "configure"
12100 #include "confdefs.h"
12101 #define shmat autoconf_temporary
12102 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12103 #undef shmat
12104
12105 #ifdef __cplusplus
12106 extern "C"
12107 #endif
12108
12109 /* We use char because int might match the return type of a gcc2
12110    builtin and then its argument prototype would still apply.  */
12111 char shmat (void);
12112
12113 int
12114 main (void)
12115 {
12116
12117 /* The GNU C library defines stubs for functions which it implements
12118     to always fail with ENOSYS.  Some functions are actually named
12119     something starting with __ and the normal name is an alias.  */
12120 #if defined (__stub_shmat) || defined (__stub___shmat)
12121 #error found stub for shmat
12122 #endif
12123
12124         return shmat ();
12125   ;
12126   return 0;
12127 }
12128 _ACEOF
12129 rm -f conftest.$ac_objext conftest$ac_exeext
12130 if { (eval echo "$as_me:12130: \"$ac_link\"") >&5
12131   (eval $ac_link) 2>&5
12132   ac_status=$?
12133   echo "$as_me:12133: \$? = $ac_status" >&5
12134   (exit $ac_status); } &&
12135          { ac_try='test -s conftest$ac_exeext'
12136   { (eval echo "$as_me:12136: \"$ac_try\"") >&5
12137   (eval $ac_try) 2>&5
12138   ac_status=$?
12139   echo "$as_me:12139: \$? = $ac_status" >&5
12140   (exit $ac_status); }; }; then
12141   ac_cv_func_shmat=yes
12142 else
12143   echo "$as_me: failed program was:" >&5
12144 cat conftest.$ac_ext >&5
12145 ac_cv_func_shmat=no
12146 fi
12147 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12148 fi
12149 echo "$as_me:12149: result: $ac_cv_func_shmat" >&5
12150 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12151
12152     if test $ac_cv_func_shmat = no; then
12153       echo "$as_me:12153: checking for shmat in -lipc" >&5
12154 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12155 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12156   echo $ECHO_N "(cached) $ECHO_C" >&6
12157 else
12158   ac_check_lib_save_LIBS=$LIBS
12159 LIBS="-lipc  $LIBS"
12160 cat >conftest.$ac_ext <<_ACEOF
12161 #line 12161 "configure"
12162 #include "confdefs.h"
12163
12164 /* Override any gcc2 internal prototype to avoid an error.  */
12165 #ifdef __cplusplus
12166 extern "C"
12167 #endif
12168 /* We use char because int might match the return type of a gcc2
12169    builtin and then its argument prototype would still apply.  */
12170 char shmat ();
12171 int
12172 main (void)
12173 {
12174 shmat ();
12175   ;
12176   return 0;
12177 }
12178 _ACEOF
12179 rm -f conftest.$ac_objext conftest$ac_exeext
12180 if { (eval echo "$as_me:12180: \"$ac_link\"") >&5
12181   (eval $ac_link) 2>&5
12182   ac_status=$?
12183   echo "$as_me:12183: \$? = $ac_status" >&5
12184   (exit $ac_status); } &&
12185          { ac_try='test -s conftest$ac_exeext'
12186   { (eval echo "$as_me:12186: \"$ac_try\"") >&5
12187   (eval $ac_try) 2>&5
12188   ac_status=$?
12189   echo "$as_me:12189: \$? = $ac_status" >&5
12190   (exit $ac_status); }; }; then
12191   ac_cv_lib_ipc_shmat=yes
12192 else
12193   echo "$as_me: failed program was:" >&5
12194 cat conftest.$ac_ext >&5
12195 ac_cv_lib_ipc_shmat=no
12196 fi
12197 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12198 LIBS=$ac_check_lib_save_LIBS
12199 fi
12200 echo "$as_me:12200: result: $ac_cv_lib_ipc_shmat" >&5
12201 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12202 if test $ac_cv_lib_ipc_shmat = yes; then
12203   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12204 fi
12205
12206     fi
12207   fi
12208
12209   # Check for libraries that X11R6 Xt/Xaw programs need.
12210   ac_save_LDFLAGS=$LDFLAGS
12211   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12212   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12213   # check for ICE first), but we must link in the order -lSM -lICE or
12214   # we get undefined symbols.  So assume we have SM if we have ICE.
12215   # These have to be linked with before -lX11, unlike the other
12216   # libraries we check for below, so use a different variable.
12217   # John Interrante, Karl Berry
12218   echo "$as_me:12218: checking for IceConnectionNumber in -lICE" >&5
12219 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12220 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12221   echo $ECHO_N "(cached) $ECHO_C" >&6
12222 else
12223   ac_check_lib_save_LIBS=$LIBS
12224 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12225 cat >conftest.$ac_ext <<_ACEOF
12226 #line 12226 "configure"
12227 #include "confdefs.h"
12228
12229 /* Override any gcc2 internal prototype to avoid an error.  */
12230 #ifdef __cplusplus
12231 extern "C"
12232 #endif
12233 /* We use char because int might match the return type of a gcc2
12234    builtin and then its argument prototype would still apply.  */
12235 char IceConnectionNumber ();
12236 int
12237 main (void)
12238 {
12239 IceConnectionNumber ();
12240   ;
12241   return 0;
12242 }
12243 _ACEOF
12244 rm -f conftest.$ac_objext conftest$ac_exeext
12245 if { (eval echo "$as_me:12245: \"$ac_link\"") >&5
12246   (eval $ac_link) 2>&5
12247   ac_status=$?
12248   echo "$as_me:12248: \$? = $ac_status" >&5
12249   (exit $ac_status); } &&
12250          { ac_try='test -s conftest$ac_exeext'
12251   { (eval echo "$as_me:12251: \"$ac_try\"") >&5
12252   (eval $ac_try) 2>&5
12253   ac_status=$?
12254   echo "$as_me:12254: \$? = $ac_status" >&5
12255   (exit $ac_status); }; }; then
12256   ac_cv_lib_ICE_IceConnectionNumber=yes
12257 else
12258   echo "$as_me: failed program was:" >&5
12259 cat conftest.$ac_ext >&5
12260 ac_cv_lib_ICE_IceConnectionNumber=no
12261 fi
12262 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12263 LIBS=$ac_check_lib_save_LIBS
12264 fi
12265 echo "$as_me:12265: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12266 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12267 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12268   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12269 fi
12270
12271   LDFLAGS=$ac_save_LDFLAGS
12272
12273 fi
12274
12275 cf_x_athena=${cf_x_athena:-Xaw}
12276
12277 echo "$as_me:12277: checking if you want to link with Xaw 3d library" >&5
12278 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12279 withval=
12280
12281 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12282 if test "${with_Xaw3d+set}" = set; then
12283   withval="$with_Xaw3d"
12284
12285 fi;
12286 if test "$withval" = yes ; then
12287         cf_x_athena=Xaw3d
12288         echo "$as_me:12288: result: yes" >&5
12289 echo "${ECHO_T}yes" >&6
12290 else
12291         echo "$as_me:12291: result: no" >&5
12292 echo "${ECHO_T}no" >&6
12293 fi
12294
12295 echo "$as_me:12295: checking if you want to link with Xaw 3d xft library" >&5
12296 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12297 withval=
12298
12299 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12300 if test "${with_Xaw3dxft+set}" = set; then
12301   withval="$with_Xaw3dxft"
12302
12303 fi;
12304 if test "$withval" = yes ; then
12305         cf_x_athena=Xaw3dxft
12306         echo "$as_me:12306: result: yes" >&5
12307 echo "${ECHO_T}yes" >&6
12308 else
12309         echo "$as_me:12309: result: no" >&5
12310 echo "${ECHO_T}no" >&6
12311 fi
12312
12313 echo "$as_me:12313: checking if you want to link with neXT Athena library" >&5
12314 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12315 withval=
12316
12317 # Check whether --with-neXtaw or --without-neXtaw was given.
12318 if test "${with_neXtaw+set}" = set; then
12319   withval="$with_neXtaw"
12320
12321 fi;
12322 if test "$withval" = yes ; then
12323         cf_x_athena=neXtaw
12324         echo "$as_me:12324: result: yes" >&5
12325 echo "${ECHO_T}yes" >&6
12326 else
12327         echo "$as_me:12327: result: no" >&5
12328 echo "${ECHO_T}no" >&6
12329 fi
12330
12331 echo "$as_me:12331: checking if you want to link with Athena-Plus library" >&5
12332 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12333 withval=
12334
12335 # Check whether --with-XawPlus or --without-XawPlus was given.
12336 if test "${with_XawPlus+set}" = set; then
12337   withval="$with_XawPlus"
12338
12339 fi;
12340 if test "$withval" = yes ; then
12341         cf_x_athena=XawPlus
12342         echo "$as_me:12342: result: yes" >&5
12343 echo "${ECHO_T}yes" >&6
12344 else
12345         echo "$as_me:12345: result: no" >&5
12346 echo "${ECHO_T}no" >&6
12347 fi
12348
12349 cf_x_athena_lib=""
12350
12351 if test "$PKG_CONFIG" != none ; then
12352         cf_athena_list=
12353         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12354         for cf_athena_pkg in \
12355                 $cf_athena_list \
12356                 ${cf_x_athena} \
12357                 ${cf_x_athena}-devel \
12358                 lib${cf_x_athena} \
12359                 lib${cf_x_athena}-devel
12360         do
12361
12362 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12363         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12364
12365 echo "${as_me:-configure}:12365: testing found package $cf_athena_pkg ..." 1>&5
12366
12367         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12368         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12369         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12370
12371 echo "${as_me:-configure}:12371: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12372
12373         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12374
12375 echo "${as_me:-configure}:12375: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12376
12377 cf_fix_cppflags=no
12378 cf_new_cflags=
12379 cf_new_cppflags=
12380 cf_new_extra_cppflags=
12381
12382 for cf_add_cflags in $cf_pkgconfig_incs
12383 do
12384 case $cf_fix_cppflags in
12385 (no)
12386         case $cf_add_cflags in
12387         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12388                 case $cf_add_cflags in
12389                 (-D*)
12390                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12391
12392                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12393                                 && test -z "${cf_tst_cflags}" \
12394                                 && cf_fix_cppflags=yes
12395
12396                         if test $cf_fix_cppflags = yes ; then
12397
12398         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12399         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12400
12401                                 continue
12402                         elif test "${cf_tst_cflags}" = "\"'" ; then
12403
12404         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12405         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12406
12407                                 continue
12408                         fi
12409                         ;;
12410                 esac
12411                 case "$CPPFLAGS" in
12412                 (*$cf_add_cflags)
12413                         ;;
12414                 (*)
12415                         case $cf_add_cflags in
12416                         (-D*)
12417                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12418
12419 CPPFLAGS=`echo "$CPPFLAGS" | \
12420         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12421                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12422
12423                                 ;;
12424                         esac
12425
12426         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12427         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12428
12429                         ;;
12430                 esac
12431                 ;;
12432         (*)
12433
12434         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12435         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12436
12437                 ;;
12438         esac
12439         ;;
12440 (yes)
12441
12442         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12443         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12444
12445         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12446
12447         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12448                 && test -z "${cf_tst_cflags}" \
12449                 && cf_fix_cppflags=no
12450         ;;
12451 esac
12452 done
12453
12454 if test -n "$cf_new_cflags" ; then
12455
12456         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12457         CFLAGS="${CFLAGS}$cf_new_cflags"
12458
12459 fi
12460
12461 if test -n "$cf_new_cppflags" ; then
12462
12463         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12464         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12465
12466 fi
12467
12468 if test -n "$cf_new_extra_cppflags" ; then
12469
12470         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12471         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12472
12473 fi
12474
12475 cf_add_libs="$LIBS"
12476 # reverse order
12477 cf_add_0lib=
12478 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12479 # filter duplicates
12480 for cf_add_1lib in $cf_add_0lib; do
12481         for cf_add_2lib in $cf_add_libs; do
12482                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12483                         cf_add_1lib=
12484                         break
12485                 fi
12486         done
12487         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12488 done
12489 LIBS="$cf_add_libs"
12490
12491                         cf_x_athena_lib="$cf_pkgconfig_libs"
12492
12493 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12494
12495                         cat >>confdefs.h <<EOF
12496 #define $cf_x_athena_LIBS 1
12497 EOF
12498
12499         for cf_trim_lib in Xmu Xt X11
12500         do
12501                 case "$LIBS" in
12502                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12503                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12504                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12505
12506 echo "${as_me:-configure}:12506: testing ..trimmed $LIBS ..." 1>&5
12507
12508                         ;;
12509                 esac
12510         done
12511
12512 echo "$as_me:12512: checking for usable $cf_x_athena/Xmu package" >&5
12513 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12514 if test "${cf_cv_xaw_compat+set}" = set; then
12515   echo $ECHO_N "(cached) $ECHO_C" >&6
12516 else
12517
12518 cat >conftest.$ac_ext <<_ACEOF
12519 #line 12519 "configure"
12520 #include "confdefs.h"
12521
12522 #include <X11/Xmu/CharSet.h>
12523
12524 int
12525 main (void)
12526 {
12527
12528 int check = XmuCompareISOLatin1("big", "small")
12529
12530   ;
12531   return 0;
12532 }
12533 _ACEOF
12534 rm -f conftest.$ac_objext conftest$ac_exeext
12535 if { (eval echo "$as_me:12535: \"$ac_link\"") >&5
12536   (eval $ac_link) 2>&5
12537   ac_status=$?
12538   echo "$as_me:12538: \$? = $ac_status" >&5
12539   (exit $ac_status); } &&
12540          { ac_try='test -s conftest$ac_exeext'
12541   { (eval echo "$as_me:12541: \"$ac_try\"") >&5
12542   (eval $ac_try) 2>&5
12543   ac_status=$?
12544   echo "$as_me:12544: \$? = $ac_status" >&5
12545   (exit $ac_status); }; }; then
12546   cf_cv_xaw_compat=yes
12547 else
12548   echo "$as_me: failed program was:" >&5
12549 cat conftest.$ac_ext >&5
12550 cf_cv_xaw_compat=no
12551 fi
12552 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12553 fi
12554 echo "$as_me:12554: result: $cf_cv_xaw_compat" >&5
12555 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12556
12557                         if test "$cf_cv_xaw_compat" = no
12558                         then
12559                                 # workaround for broken ".pc" files...
12560                                 case "$cf_x_athena_lib" in
12561                                 (*-lXmu*)
12562                                         ;;
12563                                 (*)
12564                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12565
12566 echo "${as_me:-configure}:12566: testing work around broken package ..." 1>&5
12567
12568                                         cf_save_xmu="$LIBS"
12569                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12570
12571 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12572         test -n "$verbose" && echo "    found package xmu" 1>&6
12573
12574 echo "${as_me:-configure}:12574: testing found package xmu ..." 1>&5
12575
12576         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12577         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12578         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12579
12580 echo "${as_me:-configure}:12580: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12581
12582         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12583
12584 echo "${as_me:-configure}:12584: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12585
12586 cf_fix_cppflags=no
12587 cf_new_cflags=
12588 cf_new_cppflags=
12589 cf_new_extra_cppflags=
12590
12591 for cf_add_cflags in $cf_pkgconfig_incs
12592 do
12593 case $cf_fix_cppflags in
12594 (no)
12595         case $cf_add_cflags in
12596         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12597                 case $cf_add_cflags in
12598                 (-D*)
12599                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12600
12601                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12602                                 && test -z "${cf_tst_cflags}" \
12603                                 && cf_fix_cppflags=yes
12604
12605                         if test $cf_fix_cppflags = yes ; then
12606
12607         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12608         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12609
12610                                 continue
12611                         elif test "${cf_tst_cflags}" = "\"'" ; then
12612
12613         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12614         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12615
12616                                 continue
12617                         fi
12618                         ;;
12619                 esac
12620                 case "$CPPFLAGS" in
12621                 (*$cf_add_cflags)
12622                         ;;
12623                 (*)
12624                         case $cf_add_cflags in
12625                         (-D*)
12626                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12627
12628 CPPFLAGS=`echo "$CPPFLAGS" | \
12629         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12630                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12631
12632                                 ;;
12633                         esac
12634
12635         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12636         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12637
12638                         ;;
12639                 esac
12640                 ;;
12641         (*)
12642
12643         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12644         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12645
12646                 ;;
12647         esac
12648         ;;
12649 (yes)
12650
12651         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12652         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12653
12654         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12655
12656         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12657                 && test -z "${cf_tst_cflags}" \
12658                 && cf_fix_cppflags=no
12659         ;;
12660 esac
12661 done
12662
12663 if test -n "$cf_new_cflags" ; then
12664
12665         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12666         CFLAGS="${CFLAGS}$cf_new_cflags"
12667
12668 fi
12669
12670 if test -n "$cf_new_cppflags" ; then
12671
12672         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12673         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12674
12675 fi
12676
12677 if test -n "$cf_new_extra_cppflags" ; then
12678
12679         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12680         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12681
12682 fi
12683
12684 cf_add_libs="$LIBS"
12685 # reverse order
12686 cf_add_0lib=
12687 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12688 # filter duplicates
12689 for cf_add_1lib in $cf_add_0lib; do
12690         for cf_add_2lib in $cf_add_libs; do
12691                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12692                         cf_add_1lib=
12693                         break
12694                 fi
12695         done
12696         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12697 done
12698 LIBS="$cf_add_libs"
12699
12700                                                         LIBS="$cf_save_xmu"
12701
12702 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12703
12704 echo "${as_me:-configure}:12704: testing ...before $LIBS ..." 1>&5
12705
12706 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
12707 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12708
12709 echo "${as_me:-configure}:12709: testing ...after  $LIBS ..." 1>&5
12710
12711 else
12712         cf_pkgconfig_incs=
12713         cf_pkgconfig_libs=
12714
12715 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12716
12717 echo "${as_me:-configure}:12717: testing ...before $LIBS ..." 1>&5
12718
12719 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
12720 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12721
12722 echo "${as_me:-configure}:12722: testing ...after  $LIBS ..." 1>&5
12723
12724 fi
12725
12726         for cf_trim_lib in Xmu Xt X11
12727         do
12728                 case "$LIBS" in
12729                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12730                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12731                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12732
12733 echo "${as_me:-configure}:12733: testing ..trimmed $LIBS ..." 1>&5
12734
12735                         ;;
12736                 esac
12737         done
12738
12739                                         ;;
12740                                 esac
12741                         fi
12742
12743                         break
12744 else
12745         cf_pkgconfig_incs=
12746         cf_pkgconfig_libs=
12747         :
12748 fi
12749
12750         done
12751 fi
12752
12753 if test -z "$cf_x_athena_lib" ; then
12754
12755 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
12756         test -n "$verbose" && echo "    found package Xext" 1>&6
12757
12758 echo "${as_me:-configure}:12758: testing found package Xext ..." 1>&5
12759
12760         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
12761         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
12762         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
12763
12764 echo "${as_me:-configure}:12764: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12765
12766         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
12767
12768 echo "${as_me:-configure}:12768: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
12769
12770 cf_fix_cppflags=no
12771 cf_new_cflags=
12772 cf_new_cppflags=
12773 cf_new_extra_cppflags=
12774
12775 for cf_add_cflags in $cf_pkgconfig_incs
12776 do
12777 case $cf_fix_cppflags in
12778 (no)
12779         case $cf_add_cflags in
12780         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12781                 case $cf_add_cflags in
12782                 (-D*)
12783                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12784
12785                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12786                                 && test -z "${cf_tst_cflags}" \
12787                                 && cf_fix_cppflags=yes
12788
12789                         if test $cf_fix_cppflags = yes ; then
12790
12791         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12792         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12793
12794                                 continue
12795                         elif test "${cf_tst_cflags}" = "\"'" ; then
12796
12797         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12798         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12799
12800                                 continue
12801                         fi
12802                         ;;
12803                 esac
12804                 case "$CPPFLAGS" in
12805                 (*$cf_add_cflags)
12806                         ;;
12807                 (*)
12808                         case $cf_add_cflags in
12809                         (-D*)
12810                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12811
12812 CPPFLAGS=`echo "$CPPFLAGS" | \
12813         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12814                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12815
12816                                 ;;
12817                         esac
12818
12819         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12820         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12821
12822                         ;;
12823                 esac
12824                 ;;
12825         (*)
12826
12827         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12828         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12829
12830                 ;;
12831         esac
12832         ;;
12833 (yes)
12834
12835         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12836         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12837
12838         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12839
12840         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12841                 && test -z "${cf_tst_cflags}" \
12842                 && cf_fix_cppflags=no
12843         ;;
12844 esac
12845 done
12846
12847 if test -n "$cf_new_cflags" ; then
12848
12849         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12850         CFLAGS="${CFLAGS}$cf_new_cflags"
12851
12852 fi
12853
12854 if test -n "$cf_new_cppflags" ; then
12855
12856         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12857         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12858
12859 fi
12860
12861 if test -n "$cf_new_extra_cppflags" ; then
12862
12863         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12864         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12865
12866 fi
12867
12868 cf_add_libs="$LIBS"
12869 # reverse order
12870 cf_add_0lib=
12871 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12872 # filter duplicates
12873 for cf_add_1lib in $cf_add_0lib; do
12874         for cf_add_2lib in $cf_add_libs; do
12875                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12876                         cf_add_1lib=
12877                         break
12878                 fi
12879         done
12880         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12881 done
12882 LIBS="$cf_add_libs"
12883
12884         :
12885 else
12886         cf_pkgconfig_incs=
12887         cf_pkgconfig_libs=
12888
12889         echo "$as_me:12889: checking for XextCreateExtension in -lXext" >&5
12890 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
12891 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
12892   echo $ECHO_N "(cached) $ECHO_C" >&6
12893 else
12894   ac_check_lib_save_LIBS=$LIBS
12895 LIBS="-lXext  $LIBS"
12896 cat >conftest.$ac_ext <<_ACEOF
12897 #line 12897 "configure"
12898 #include "confdefs.h"
12899
12900 /* Override any gcc2 internal prototype to avoid an error.  */
12901 #ifdef __cplusplus
12902 extern "C"
12903 #endif
12904 /* We use char because int might match the return type of a gcc2
12905    builtin and then its argument prototype would still apply.  */
12906 char XextCreateExtension ();
12907 int
12908 main (void)
12909 {
12910 XextCreateExtension ();
12911   ;
12912   return 0;
12913 }
12914 _ACEOF
12915 rm -f conftest.$ac_objext conftest$ac_exeext
12916 if { (eval echo "$as_me:12916: \"$ac_link\"") >&5
12917   (eval $ac_link) 2>&5
12918   ac_status=$?
12919   echo "$as_me:12919: \$? = $ac_status" >&5
12920   (exit $ac_status); } &&
12921          { ac_try='test -s conftest$ac_exeext'
12922   { (eval echo "$as_me:12922: \"$ac_try\"") >&5
12923   (eval $ac_try) 2>&5
12924   ac_status=$?
12925   echo "$as_me:12925: \$? = $ac_status" >&5
12926   (exit $ac_status); }; }; then
12927   ac_cv_lib_Xext_XextCreateExtension=yes
12928 else
12929   echo "$as_me: failed program was:" >&5
12930 cat conftest.$ac_ext >&5
12931 ac_cv_lib_Xext_XextCreateExtension=no
12932 fi
12933 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12934 LIBS=$ac_check_lib_save_LIBS
12935 fi
12936 echo "$as_me:12936: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
12937 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
12938 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
12939
12940 cf_add_libs="$LIBS"
12941 # reverse order
12942 cf_add_0lib=
12943 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12944 # filter duplicates
12945 for cf_add_1lib in $cf_add_0lib; do
12946         for cf_add_2lib in $cf_add_libs; do
12947                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12948                         cf_add_1lib=
12949                         break
12950                 fi
12951         done
12952         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12953 done
12954 LIBS="$cf_add_libs"
12955
12956 fi
12957
12958 fi
12959
12960 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
12961 # in some cases has installed dummy files in the former, other cases replaced
12962 # it with a link to the new location).  This complicates the configure script.
12963 # Check for that pitfall, and recover using pkg-config
12964 #
12965 # If none of these are set, the configuration is almost certainly broken.
12966 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
12967 then
12968
12969 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12970         test -n "$verbose" && echo "    found package x11" 1>&6
12971
12972 echo "${as_me:-configure}:12972: testing found package x11 ..." 1>&5
12973
12974         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12975         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12976         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12977
12978 echo "${as_me:-configure}:12978: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12979
12980         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12981
12982 echo "${as_me:-configure}:12982: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12983
12984 cf_fix_cppflags=no
12985 cf_new_cflags=
12986 cf_new_cppflags=
12987 cf_new_extra_cppflags=
12988
12989 for cf_add_cflags in $cf_pkgconfig_incs
12990 do
12991 case $cf_fix_cppflags in
12992 (no)
12993         case $cf_add_cflags in
12994         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12995                 case $cf_add_cflags in
12996                 (-D*)
12997                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12998
12999                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13000                                 && test -z "${cf_tst_cflags}" \
13001                                 && cf_fix_cppflags=yes
13002
13003                         if test $cf_fix_cppflags = yes ; then
13004
13005         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13006         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13007
13008                                 continue
13009                         elif test "${cf_tst_cflags}" = "\"'" ; then
13010
13011         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13012         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13013
13014                                 continue
13015                         fi
13016                         ;;
13017                 esac
13018                 case "$CPPFLAGS" in
13019                 (*$cf_add_cflags)
13020                         ;;
13021                 (*)
13022                         case $cf_add_cflags in
13023                         (-D*)
13024                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13025
13026 CPPFLAGS=`echo "$CPPFLAGS" | \
13027         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13028                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13029
13030                                 ;;
13031                         esac
13032
13033         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13034         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13035
13036                         ;;
13037                 esac
13038                 ;;
13039         (*)
13040
13041         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13042         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13043
13044                 ;;
13045         esac
13046         ;;
13047 (yes)
13048
13049         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13050         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13051
13052         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13053
13054         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13055                 && test -z "${cf_tst_cflags}" \
13056                 && cf_fix_cppflags=no
13057         ;;
13058 esac
13059 done
13060
13061 if test -n "$cf_new_cflags" ; then
13062
13063         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13064         CFLAGS="${CFLAGS}$cf_new_cflags"
13065
13066 fi
13067
13068 if test -n "$cf_new_cppflags" ; then
13069
13070         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13071         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13072
13073 fi
13074
13075 if test -n "$cf_new_extra_cppflags" ; then
13076
13077         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13078         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13079
13080 fi
13081
13082 cf_add_libs="$LIBS"
13083 # reverse order
13084 cf_add_0lib=
13085 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13086 # filter duplicates
13087 for cf_add_1lib in $cf_add_0lib; do
13088         for cf_add_2lib in $cf_add_libs; do
13089                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13090                         cf_add_1lib=
13091                         break
13092                 fi
13093         done
13094         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13095 done
13096 LIBS="$cf_add_libs"
13097
13098         :
13099 else
13100         cf_pkgconfig_incs=
13101         cf_pkgconfig_libs=
13102         { echo "$as_me:13102: WARNING: unable to find X11 library" >&5
13103 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13104 fi
13105
13106 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13107         test -n "$verbose" && echo "    found package ice" 1>&6
13108
13109 echo "${as_me:-configure}:13109: testing found package ice ..." 1>&5
13110
13111         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13112         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13113         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13114
13115 echo "${as_me:-configure}:13115: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13116
13117         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13118
13119 echo "${as_me:-configure}:13119: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13120
13121 cf_fix_cppflags=no
13122 cf_new_cflags=
13123 cf_new_cppflags=
13124 cf_new_extra_cppflags=
13125
13126 for cf_add_cflags in $cf_pkgconfig_incs
13127 do
13128 case $cf_fix_cppflags in
13129 (no)
13130         case $cf_add_cflags in
13131         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13132                 case $cf_add_cflags in
13133                 (-D*)
13134                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13135
13136                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13137                                 && test -z "${cf_tst_cflags}" \
13138                                 && cf_fix_cppflags=yes
13139
13140                         if test $cf_fix_cppflags = yes ; then
13141
13142         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13143         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13144
13145                                 continue
13146                         elif test "${cf_tst_cflags}" = "\"'" ; then
13147
13148         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13149         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13150
13151                                 continue
13152                         fi
13153                         ;;
13154                 esac
13155                 case "$CPPFLAGS" in
13156                 (*$cf_add_cflags)
13157                         ;;
13158                 (*)
13159                         case $cf_add_cflags in
13160                         (-D*)
13161                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13162
13163 CPPFLAGS=`echo "$CPPFLAGS" | \
13164         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13165                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13166
13167                                 ;;
13168                         esac
13169
13170         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13171         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13172
13173                         ;;
13174                 esac
13175                 ;;
13176         (*)
13177
13178         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13179         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13180
13181                 ;;
13182         esac
13183         ;;
13184 (yes)
13185
13186         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13187         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13188
13189         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13190
13191         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13192                 && test -z "${cf_tst_cflags}" \
13193                 && cf_fix_cppflags=no
13194         ;;
13195 esac
13196 done
13197
13198 if test -n "$cf_new_cflags" ; then
13199
13200         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13201         CFLAGS="${CFLAGS}$cf_new_cflags"
13202
13203 fi
13204
13205 if test -n "$cf_new_cppflags" ; then
13206
13207         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13208         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13209
13210 fi
13211
13212 if test -n "$cf_new_extra_cppflags" ; then
13213
13214         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13215         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13216
13217 fi
13218
13219 cf_add_libs="$LIBS"
13220 # reverse order
13221 cf_add_0lib=
13222 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13223 # filter duplicates
13224 for cf_add_1lib in $cf_add_0lib; do
13225         for cf_add_2lib in $cf_add_libs; do
13226                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13227                         cf_add_1lib=
13228                         break
13229                 fi
13230         done
13231         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13232 done
13233 LIBS="$cf_add_libs"
13234
13235         :
13236 else
13237         cf_pkgconfig_incs=
13238         cf_pkgconfig_libs=
13239         { echo "$as_me:13239: WARNING: unable to find ICE library" >&5
13240 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13241 fi
13242
13243 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13244         test -n "$verbose" && echo "    found package sm" 1>&6
13245
13246 echo "${as_me:-configure}:13246: testing found package sm ..." 1>&5
13247
13248         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13249         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13250         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13251
13252 echo "${as_me:-configure}:13252: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13253
13254         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13255
13256 echo "${as_me:-configure}:13256: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13257
13258 cf_fix_cppflags=no
13259 cf_new_cflags=
13260 cf_new_cppflags=
13261 cf_new_extra_cppflags=
13262
13263 for cf_add_cflags in $cf_pkgconfig_incs
13264 do
13265 case $cf_fix_cppflags in
13266 (no)
13267         case $cf_add_cflags in
13268         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13269                 case $cf_add_cflags in
13270                 (-D*)
13271                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13272
13273                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13274                                 && test -z "${cf_tst_cflags}" \
13275                                 && cf_fix_cppflags=yes
13276
13277                         if test $cf_fix_cppflags = yes ; then
13278
13279         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13280         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13281
13282                                 continue
13283                         elif test "${cf_tst_cflags}" = "\"'" ; then
13284
13285         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13286         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13287
13288                                 continue
13289                         fi
13290                         ;;
13291                 esac
13292                 case "$CPPFLAGS" in
13293                 (*$cf_add_cflags)
13294                         ;;
13295                 (*)
13296                         case $cf_add_cflags in
13297                         (-D*)
13298                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13299
13300 CPPFLAGS=`echo "$CPPFLAGS" | \
13301         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13302                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13303
13304                                 ;;
13305                         esac
13306
13307         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13308         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13309
13310                         ;;
13311                 esac
13312                 ;;
13313         (*)
13314
13315         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13316         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13317
13318                 ;;
13319         esac
13320         ;;
13321 (yes)
13322
13323         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13324         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13325
13326         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13327
13328         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13329                 && test -z "${cf_tst_cflags}" \
13330                 && cf_fix_cppflags=no
13331         ;;
13332 esac
13333 done
13334
13335 if test -n "$cf_new_cflags" ; then
13336
13337         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13338         CFLAGS="${CFLAGS}$cf_new_cflags"
13339
13340 fi
13341
13342 if test -n "$cf_new_cppflags" ; then
13343
13344         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13345         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13346
13347 fi
13348
13349 if test -n "$cf_new_extra_cppflags" ; then
13350
13351         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13352         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13353
13354 fi
13355
13356 cf_add_libs="$LIBS"
13357 # reverse order
13358 cf_add_0lib=
13359 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13360 # filter duplicates
13361 for cf_add_1lib in $cf_add_0lib; do
13362         for cf_add_2lib in $cf_add_libs; do
13363                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13364                         cf_add_1lib=
13365                         break
13366                 fi
13367         done
13368         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13369 done
13370 LIBS="$cf_add_libs"
13371
13372         :
13373 else
13374         cf_pkgconfig_incs=
13375         cf_pkgconfig_libs=
13376         { echo "$as_me:13376: WARNING: unable to find SM library" >&5
13377 echo "$as_me: WARNING: unable to find SM library" >&2;}
13378 fi
13379
13380 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13381         test -n "$verbose" && echo "    found package xt" 1>&6
13382
13383 echo "${as_me:-configure}:13383: testing found package xt ..." 1>&5
13384
13385         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13386         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13387         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13388
13389 echo "${as_me:-configure}:13389: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13390
13391         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13392
13393 echo "${as_me:-configure}:13393: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13394
13395 cf_fix_cppflags=no
13396 cf_new_cflags=
13397 cf_new_cppflags=
13398 cf_new_extra_cppflags=
13399
13400 for cf_add_cflags in $cf_pkgconfig_incs
13401 do
13402 case $cf_fix_cppflags in
13403 (no)
13404         case $cf_add_cflags in
13405         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13406                 case $cf_add_cflags in
13407                 (-D*)
13408                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13409
13410                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13411                                 && test -z "${cf_tst_cflags}" \
13412                                 && cf_fix_cppflags=yes
13413
13414                         if test $cf_fix_cppflags = yes ; then
13415
13416         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13417         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13418
13419                                 continue
13420                         elif test "${cf_tst_cflags}" = "\"'" ; then
13421
13422         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13423         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13424
13425                                 continue
13426                         fi
13427                         ;;
13428                 esac
13429                 case "$CPPFLAGS" in
13430                 (*$cf_add_cflags)
13431                         ;;
13432                 (*)
13433                         case $cf_add_cflags in
13434                         (-D*)
13435                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13436
13437 CPPFLAGS=`echo "$CPPFLAGS" | \
13438         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13439                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13440
13441                                 ;;
13442                         esac
13443
13444         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13445         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13446
13447                         ;;
13448                 esac
13449                 ;;
13450         (*)
13451
13452         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13453         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13454
13455                 ;;
13456         esac
13457         ;;
13458 (yes)
13459
13460         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13461         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13462
13463         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13464
13465         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13466                 && test -z "${cf_tst_cflags}" \
13467                 && cf_fix_cppflags=no
13468         ;;
13469 esac
13470 done
13471
13472 if test -n "$cf_new_cflags" ; then
13473
13474         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13475         CFLAGS="${CFLAGS}$cf_new_cflags"
13476
13477 fi
13478
13479 if test -n "$cf_new_cppflags" ; then
13480
13481         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13482         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13483
13484 fi
13485
13486 if test -n "$cf_new_extra_cppflags" ; then
13487
13488         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13489         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13490
13491 fi
13492
13493 cf_add_libs="$LIBS"
13494 # reverse order
13495 cf_add_0lib=
13496 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13497 # filter duplicates
13498 for cf_add_1lib in $cf_add_0lib; do
13499         for cf_add_2lib in $cf_add_libs; do
13500                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13501                         cf_add_1lib=
13502                         break
13503                 fi
13504         done
13505         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13506 done
13507 LIBS="$cf_add_libs"
13508
13509         :
13510 else
13511         cf_pkgconfig_incs=
13512         cf_pkgconfig_libs=
13513         { echo "$as_me:13513: WARNING: unable to find Xt library" >&5
13514 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13515 fi
13516
13517 fi
13518
13519 cf_have_X_LIBS=no
13520
13521 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13522         test -n "$verbose" && echo "    found package xt" 1>&6
13523
13524 echo "${as_me:-configure}:13524: testing found package xt ..." 1>&5
13525
13526         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13527         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13528         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13529
13530 echo "${as_me:-configure}:13530: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13531
13532         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13533
13534 echo "${as_me:-configure}:13534: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13535
13536 cf_fix_cppflags=no
13537 cf_new_cflags=
13538 cf_new_cppflags=
13539 cf_new_extra_cppflags=
13540
13541 for cf_add_cflags in $cf_pkgconfig_incs
13542 do
13543 case $cf_fix_cppflags in
13544 (no)
13545         case $cf_add_cflags in
13546         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13547                 case $cf_add_cflags in
13548                 (-D*)
13549                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13550
13551                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13552                                 && test -z "${cf_tst_cflags}" \
13553                                 && cf_fix_cppflags=yes
13554
13555                         if test $cf_fix_cppflags = yes ; then
13556
13557         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13558         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13559
13560                                 continue
13561                         elif test "${cf_tst_cflags}" = "\"'" ; then
13562
13563         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13564         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13565
13566                                 continue
13567                         fi
13568                         ;;
13569                 esac
13570                 case "$CPPFLAGS" in
13571                 (*$cf_add_cflags)
13572                         ;;
13573                 (*)
13574                         case $cf_add_cflags in
13575                         (-D*)
13576                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13577
13578 CPPFLAGS=`echo "$CPPFLAGS" | \
13579         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13580                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13581
13582                                 ;;
13583                         esac
13584
13585         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13586         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13587
13588                         ;;
13589                 esac
13590                 ;;
13591         (*)
13592
13593         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13594         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13595
13596                 ;;
13597         esac
13598         ;;
13599 (yes)
13600
13601         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13602         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13603
13604         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13605
13606         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13607                 && test -z "${cf_tst_cflags}" \
13608                 && cf_fix_cppflags=no
13609         ;;
13610 esac
13611 done
13612
13613 if test -n "$cf_new_cflags" ; then
13614
13615         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13616         CFLAGS="${CFLAGS}$cf_new_cflags"
13617
13618 fi
13619
13620 if test -n "$cf_new_cppflags" ; then
13621
13622         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13623         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13624
13625 fi
13626
13627 if test -n "$cf_new_extra_cppflags" ; then
13628
13629         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13630         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13631
13632 fi
13633
13634 cf_add_libs="$LIBS"
13635 # reverse order
13636 cf_add_0lib=
13637 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13638 # filter duplicates
13639 for cf_add_1lib in $cf_add_0lib; do
13640         for cf_add_2lib in $cf_add_libs; do
13641                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13642                         cf_add_1lib=
13643                         break
13644                 fi
13645         done
13646         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13647 done
13648 LIBS="$cf_add_libs"
13649
13650         case "x$LIBS" in
13651         (*-lX11*)
13652                 ;;
13653         (*)
13654 # we have an "xt" package, but it may omit Xt's dependency on X11
13655 echo "$as_me:13655: checking for usable X dependency" >&5
13656 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
13657 if test "${cf_cv_xt_x11_compat+set}" = set; then
13658   echo $ECHO_N "(cached) $ECHO_C" >&6
13659 else
13660
13661 cat >conftest.$ac_ext <<_ACEOF
13662 #line 13662 "configure"
13663 #include "confdefs.h"
13664
13665 #include <X11/Xlib.h>
13666
13667 int
13668 main (void)
13669 {
13670
13671         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
13672         int rc2 = XClearWindow((Display*) 0, (Window) 0);
13673         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
13674         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
13675
13676   ;
13677   return 0;
13678 }
13679 _ACEOF
13680 rm -f conftest.$ac_objext conftest$ac_exeext
13681 if { (eval echo "$as_me:13681: \"$ac_link\"") >&5
13682   (eval $ac_link) 2>&5
13683   ac_status=$?
13684   echo "$as_me:13684: \$? = $ac_status" >&5
13685   (exit $ac_status); } &&
13686          { ac_try='test -s conftest$ac_exeext'
13687   { (eval echo "$as_me:13687: \"$ac_try\"") >&5
13688   (eval $ac_try) 2>&5
13689   ac_status=$?
13690   echo "$as_me:13690: \$? = $ac_status" >&5
13691   (exit $ac_status); }; }; then
13692   cf_cv_xt_x11_compat=yes
13693 else
13694   echo "$as_me: failed program was:" >&5
13695 cat conftest.$ac_ext >&5
13696 cf_cv_xt_x11_compat=no
13697 fi
13698 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13699 fi
13700 echo "$as_me:13700: result: $cf_cv_xt_x11_compat" >&5
13701 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
13702                 if test "$cf_cv_xt_x11_compat" = no
13703                 then
13704                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
13705
13706 echo "${as_me:-configure}:13706: testing work around broken X11 dependency ..." 1>&5
13707
13708                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
13709
13710 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13711         test -n "$verbose" && echo "    found package x11" 1>&6
13712
13713 echo "${as_me:-configure}:13713: testing found package x11 ..." 1>&5
13714
13715         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13716         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13717         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13718
13719 echo "${as_me:-configure}:13719: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13720
13721         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13722
13723 echo "${as_me:-configure}:13723: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13724
13725 cf_fix_cppflags=no
13726 cf_new_cflags=
13727 cf_new_cppflags=
13728 cf_new_extra_cppflags=
13729
13730 for cf_add_cflags in $cf_pkgconfig_incs
13731 do
13732 case $cf_fix_cppflags in
13733 (no)
13734         case $cf_add_cflags in
13735         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13736                 case $cf_add_cflags in
13737                 (-D*)
13738                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13739
13740                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13741                                 && test -z "${cf_tst_cflags}" \
13742                                 && cf_fix_cppflags=yes
13743
13744                         if test $cf_fix_cppflags = yes ; then
13745
13746         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13747         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13748
13749                                 continue
13750                         elif test "${cf_tst_cflags}" = "\"'" ; then
13751
13752         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13753         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13754
13755                                 continue
13756                         fi
13757                         ;;
13758                 esac
13759                 case "$CPPFLAGS" in
13760                 (*$cf_add_cflags)
13761                         ;;
13762                 (*)
13763                         case $cf_add_cflags in
13764                         (-D*)
13765                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13766
13767 CPPFLAGS=`echo "$CPPFLAGS" | \
13768         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13769                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13770
13771                                 ;;
13772                         esac
13773
13774         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13775         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13776
13777                         ;;
13778                 esac
13779                 ;;
13780         (*)
13781
13782         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13783         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13784
13785                 ;;
13786         esac
13787         ;;
13788 (yes)
13789
13790         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13791         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13792
13793         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13794
13795         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13796                 && test -z "${cf_tst_cflags}" \
13797                 && cf_fix_cppflags=no
13798         ;;
13799 esac
13800 done
13801
13802 if test -n "$cf_new_cflags" ; then
13803
13804         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13805         CFLAGS="${CFLAGS}$cf_new_cflags"
13806
13807 fi
13808
13809 if test -n "$cf_new_cppflags" ; then
13810
13811         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13812         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13813
13814 fi
13815
13816 if test -n "$cf_new_extra_cppflags" ; then
13817
13818         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13819         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13820
13821 fi
13822
13823 cf_add_libs="$LIBS"
13824 # reverse order
13825 cf_add_0lib=
13826 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13827 # filter duplicates
13828 for cf_add_1lib in $cf_add_0lib; do
13829         for cf_add_2lib in $cf_add_libs; do
13830                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13831                         cf_add_1lib=
13832                         break
13833                 fi
13834         done
13835         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13836 done
13837 LIBS="$cf_add_libs"
13838
13839         :
13840 else
13841         cf_pkgconfig_incs=
13842         cf_pkgconfig_libs=
13843
13844 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13845
13846 echo "${as_me:-configure}:13846: testing ...before $LIBS ..." 1>&5
13847
13848 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
13849 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13850
13851 echo "${as_me:-configure}:13851: testing ...after  $LIBS ..." 1>&5
13852
13853 fi
13854
13855                 fi
13856                 ;;
13857         esac
13858
13859 echo "$as_me:13859: checking for usable X Toolkit package" >&5
13860 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
13861 if test "${cf_cv_xt_ice_compat+set}" = set; then
13862   echo $ECHO_N "(cached) $ECHO_C" >&6
13863 else
13864
13865 cat >conftest.$ac_ext <<_ACEOF
13866 #line 13866 "configure"
13867 #include "confdefs.h"
13868
13869 #include <X11/Shell.h>
13870
13871 int
13872 main (void)
13873 {
13874 int num = IceConnectionNumber(0)
13875
13876   ;
13877   return 0;
13878 }
13879 _ACEOF
13880 rm -f conftest.$ac_objext conftest$ac_exeext
13881 if { (eval echo "$as_me:13881: \"$ac_link\"") >&5
13882   (eval $ac_link) 2>&5
13883   ac_status=$?
13884   echo "$as_me:13884: \$? = $ac_status" >&5
13885   (exit $ac_status); } &&
13886          { ac_try='test -s conftest$ac_exeext'
13887   { (eval echo "$as_me:13887: \"$ac_try\"") >&5
13888   (eval $ac_try) 2>&5
13889   ac_status=$?
13890   echo "$as_me:13890: \$? = $ac_status" >&5
13891   (exit $ac_status); }; }; then
13892   cf_cv_xt_ice_compat=yes
13893 else
13894   echo "$as_me: failed program was:" >&5
13895 cat conftest.$ac_ext >&5
13896 cf_cv_xt_ice_compat=no
13897 fi
13898 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13899 fi
13900 echo "$as_me:13900: result: $cf_cv_xt_ice_compat" >&5
13901 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
13902
13903         if test "$cf_cv_xt_ice_compat" = no
13904         then
13905                 # workaround for broken ".pc" files used for X Toolkit.
13906                 case "x$X_PRE_LIBS" in
13907                 (*-lICE*)
13908                         case "x$LIBS" in
13909                         (*-lICE*)
13910                                 ;;
13911                         (*)
13912                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
13913
13914 echo "${as_me:-configure}:13914: testing work around broken ICE dependency ..." 1>&5
13915
13916 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13917         test -n "$verbose" && echo "    found package ice" 1>&6
13918
13919 echo "${as_me:-configure}:13919: testing found package ice ..." 1>&5
13920
13921         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13922         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13923         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13924
13925 echo "${as_me:-configure}:13925: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13926
13927         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13928
13929 echo "${as_me:-configure}:13929: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13930
13931 cf_fix_cppflags=no
13932 cf_new_cflags=
13933 cf_new_cppflags=
13934 cf_new_extra_cppflags=
13935
13936 for cf_add_cflags in $cf_pkgconfig_incs
13937 do
13938 case $cf_fix_cppflags in
13939 (no)
13940         case $cf_add_cflags in
13941         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13942                 case $cf_add_cflags in
13943                 (-D*)
13944                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13945
13946                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13947                                 && test -z "${cf_tst_cflags}" \
13948                                 && cf_fix_cppflags=yes
13949
13950                         if test $cf_fix_cppflags = yes ; then
13951
13952         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13953         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13954
13955                                 continue
13956                         elif test "${cf_tst_cflags}" = "\"'" ; then
13957
13958         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13959         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13960
13961                                 continue
13962                         fi
13963                         ;;
13964                 esac
13965                 case "$CPPFLAGS" in
13966                 (*$cf_add_cflags)
13967                         ;;
13968                 (*)
13969                         case $cf_add_cflags in
13970                         (-D*)
13971                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13972
13973 CPPFLAGS=`echo "$CPPFLAGS" | \
13974         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13975                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13976
13977                                 ;;
13978                         esac
13979
13980         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13981         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13982
13983                         ;;
13984                 esac
13985                 ;;
13986         (*)
13987
13988         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13989         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13990
13991                 ;;
13992         esac
13993         ;;
13994 (yes)
13995
13996         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13997         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13998
13999         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14000
14001         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14002                 && test -z "${cf_tst_cflags}" \
14003                 && cf_fix_cppflags=no
14004         ;;
14005 esac
14006 done
14007
14008 if test -n "$cf_new_cflags" ; then
14009
14010         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14011         CFLAGS="${CFLAGS}$cf_new_cflags"
14012
14013 fi
14014
14015 if test -n "$cf_new_cppflags" ; then
14016
14017         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14018         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14019
14020 fi
14021
14022 if test -n "$cf_new_extra_cppflags" ; then
14023
14024         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14025         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14026
14027 fi
14028
14029 cf_add_libs="$LIBS"
14030 # reverse order
14031 cf_add_0lib=
14032 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14033 # filter duplicates
14034 for cf_add_1lib in $cf_add_0lib; do
14035         for cf_add_2lib in $cf_add_libs; do
14036                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14037                         cf_add_1lib=
14038                         break
14039                 fi
14040         done
14041         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14042 done
14043 LIBS="$cf_add_libs"
14044
14045 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
14046         test -n "$verbose" && echo "    found package sm" 1>&6
14047
14048 echo "${as_me:-configure}:14048: testing found package sm ..." 1>&5
14049
14050         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
14051         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
14052         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14053
14054 echo "${as_me:-configure}:14054: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14055
14056         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14057
14058 echo "${as_me:-configure}:14058: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14059
14060 cf_fix_cppflags=no
14061 cf_new_cflags=
14062 cf_new_cppflags=
14063 cf_new_extra_cppflags=
14064
14065 for cf_add_cflags in $cf_pkgconfig_incs
14066 do
14067 case $cf_fix_cppflags in
14068 (no)
14069         case $cf_add_cflags in
14070         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14071                 case $cf_add_cflags in
14072                 (-D*)
14073                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14074
14075                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14076                                 && test -z "${cf_tst_cflags}" \
14077                                 && cf_fix_cppflags=yes
14078
14079                         if test $cf_fix_cppflags = yes ; then
14080
14081         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14082         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14083
14084                                 continue
14085                         elif test "${cf_tst_cflags}" = "\"'" ; then
14086
14087         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14088         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14089
14090                                 continue
14091                         fi
14092                         ;;
14093                 esac
14094                 case "$CPPFLAGS" in
14095                 (*$cf_add_cflags)
14096                         ;;
14097                 (*)
14098                         case $cf_add_cflags in
14099                         (-D*)
14100                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14101
14102 CPPFLAGS=`echo "$CPPFLAGS" | \
14103         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14104                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14105
14106                                 ;;
14107                         esac
14108
14109         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14110         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14111
14112                         ;;
14113                 esac
14114                 ;;
14115         (*)
14116
14117         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14118         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14119
14120                 ;;
14121         esac
14122         ;;
14123 (yes)
14124
14125         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14126         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14127
14128         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14129
14130         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14131                 && test -z "${cf_tst_cflags}" \
14132                 && cf_fix_cppflags=no
14133         ;;
14134 esac
14135 done
14136
14137 if test -n "$cf_new_cflags" ; then
14138
14139         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14140         CFLAGS="${CFLAGS}$cf_new_cflags"
14141
14142 fi
14143
14144 if test -n "$cf_new_cppflags" ; then
14145
14146         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14147         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14148
14149 fi
14150
14151 if test -n "$cf_new_extra_cppflags" ; then
14152
14153         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14154         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14155
14156 fi
14157
14158 cf_add_libs="$LIBS"
14159 # reverse order
14160 cf_add_0lib=
14161 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14162 # filter duplicates
14163 for cf_add_1lib in $cf_add_0lib; do
14164         for cf_add_2lib in $cf_add_libs; do
14165                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14166                         cf_add_1lib=
14167                         break
14168                 fi
14169         done
14170         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14171 done
14172 LIBS="$cf_add_libs"
14173
14174         :
14175 else
14176         cf_pkgconfig_incs=
14177         cf_pkgconfig_libs=
14178         :
14179 fi
14180
14181 else
14182         cf_pkgconfig_incs=
14183         cf_pkgconfig_libs=
14184
14185 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14186
14187 echo "${as_me:-configure}:14187: testing ...before $LIBS ..." 1>&5
14188
14189 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14190 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14191
14192 echo "${as_me:-configure}:14192: testing ...after  $LIBS ..." 1>&5
14193
14194 fi
14195
14196                                 ;;
14197                         esac
14198                         ;;
14199                 esac
14200         fi
14201
14202         cf_have_X_LIBS=yes
14203
14204 else
14205         cf_pkgconfig_incs=
14206         cf_pkgconfig_libs=
14207
14208         LDFLAGS="$X_LIBS $LDFLAGS"
14209
14210 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14211
14212 echo "${as_me:-configure}:14212: testing checking additions to CFLAGS ..." 1>&5
14213
14214 cf_check_cflags="$CFLAGS"
14215 cf_check_cppflags="$CPPFLAGS"
14216
14217 cf_fix_cppflags=no
14218 cf_new_cflags=
14219 cf_new_cppflags=
14220 cf_new_extra_cppflags=
14221
14222 for cf_add_cflags in $X_CFLAGS
14223 do
14224 case $cf_fix_cppflags in
14225 (no)
14226         case $cf_add_cflags in
14227         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14228                 case $cf_add_cflags in
14229                 (-D*)
14230                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14231
14232                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14233                                 && test -z "${cf_tst_cflags}" \
14234                                 && cf_fix_cppflags=yes
14235
14236                         if test $cf_fix_cppflags = yes ; then
14237
14238         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14239         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14240
14241                                 continue
14242                         elif test "${cf_tst_cflags}" = "\"'" ; then
14243
14244         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14245         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14246
14247                                 continue
14248                         fi
14249                         ;;
14250                 esac
14251                 case "$CPPFLAGS" in
14252                 (*$cf_add_cflags)
14253                         ;;
14254                 (*)
14255                         case $cf_add_cflags in
14256                         (-D*)
14257                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14258
14259 CPPFLAGS=`echo "$CPPFLAGS" | \
14260         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14261                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14262
14263                                 ;;
14264                         esac
14265
14266         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14267         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14268
14269                         ;;
14270                 esac
14271                 ;;
14272         (*)
14273
14274         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14275         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14276
14277                 ;;
14278         esac
14279         ;;
14280 (yes)
14281
14282         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14283         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14284
14285         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14286
14287         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14288                 && test -z "${cf_tst_cflags}" \
14289                 && cf_fix_cppflags=no
14290         ;;
14291 esac
14292 done
14293
14294 if test -n "$cf_new_cflags" ; then
14295         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14296
14297 echo "${as_me:-configure}:14297: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14298
14299         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14300         CFLAGS="${CFLAGS}$cf_new_cflags"
14301
14302 fi
14303
14304 if test -n "$cf_new_cppflags" ; then
14305         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14306
14307 echo "${as_me:-configure}:14307: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14308
14309         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14310         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14311
14312 fi
14313
14314 if test -n "$cf_new_extra_cppflags" ; then
14315         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14316
14317 echo "${as_me:-configure}:14317: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14318
14319         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14320         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14321
14322 fi
14323
14324 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14325 cat >conftest.$ac_ext <<_ACEOF
14326 #line 14326 "configure"
14327 #include "confdefs.h"
14328 #include <stdio.h>
14329 int
14330 main (void)
14331 {
14332 printf("Hello world");
14333   ;
14334   return 0;
14335 }
14336 _ACEOF
14337 rm -f conftest.$ac_objext conftest$ac_exeext
14338 if { (eval echo "$as_me:14338: \"$ac_link\"") >&5
14339   (eval $ac_link) 2>&5
14340   ac_status=$?
14341   echo "$as_me:14341: \$? = $ac_status" >&5
14342   (exit $ac_status); } &&
14343          { ac_try='test -s conftest$ac_exeext'
14344   { (eval echo "$as_me:14344: \"$ac_try\"") >&5
14345   (eval $ac_try) 2>&5
14346   ac_status=$?
14347   echo "$as_me:14347: \$? = $ac_status" >&5
14348   (exit $ac_status); }; }; then
14349   :
14350 else
14351   echo "$as_me: failed program was:" >&5
14352 cat conftest.$ac_ext >&5
14353 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14354
14355 echo "${as_me:-configure}:14355: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14356
14357          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14358                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14359
14360 echo "${as_me:-configure}:14360: testing but keeping change to \$CPPFLAGS ..." 1>&5
14361
14362          fi
14363          CFLAGS="$cf_check_flags"
14364 fi
14365 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14366 fi
14367
14368         echo "$as_me:14368: checking for XOpenDisplay" >&5
14369 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14370 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14371   echo $ECHO_N "(cached) $ECHO_C" >&6
14372 else
14373   cat >conftest.$ac_ext <<_ACEOF
14374 #line 14374 "configure"
14375 #include "confdefs.h"
14376 #define XOpenDisplay autoconf_temporary
14377 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14378 #undef XOpenDisplay
14379
14380 #ifdef __cplusplus
14381 extern "C"
14382 #endif
14383
14384 /* We use char because int might match the return type of a gcc2
14385    builtin and then its argument prototype would still apply.  */
14386 char XOpenDisplay (void);
14387
14388 int
14389 main (void)
14390 {
14391
14392 /* The GNU C library defines stubs for functions which it implements
14393     to always fail with ENOSYS.  Some functions are actually named
14394     something starting with __ and the normal name is an alias.  */
14395 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14396 #error found stub for XOpenDisplay
14397 #endif
14398
14399         return XOpenDisplay ();
14400   ;
14401   return 0;
14402 }
14403 _ACEOF
14404 rm -f conftest.$ac_objext conftest$ac_exeext
14405 if { (eval echo "$as_me:14405: \"$ac_link\"") >&5
14406   (eval $ac_link) 2>&5
14407   ac_status=$?
14408   echo "$as_me:14408: \$? = $ac_status" >&5
14409   (exit $ac_status); } &&
14410          { ac_try='test -s conftest$ac_exeext'
14411   { (eval echo "$as_me:14411: \"$ac_try\"") >&5
14412   (eval $ac_try) 2>&5
14413   ac_status=$?
14414   echo "$as_me:14414: \$? = $ac_status" >&5
14415   (exit $ac_status); }; }; then
14416   ac_cv_func_XOpenDisplay=yes
14417 else
14418   echo "$as_me: failed program was:" >&5
14419 cat conftest.$ac_ext >&5
14420 ac_cv_func_XOpenDisplay=no
14421 fi
14422 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14423 fi
14424 echo "$as_me:14424: result: $ac_cv_func_XOpenDisplay" >&5
14425 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14426 if test $ac_cv_func_XOpenDisplay = yes; then
14427   :
14428 else
14429
14430         echo "$as_me:14430: checking for XOpenDisplay in -lX11" >&5
14431 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14432 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14433   echo $ECHO_N "(cached) $ECHO_C" >&6
14434 else
14435   ac_check_lib_save_LIBS=$LIBS
14436 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14437 cat >conftest.$ac_ext <<_ACEOF
14438 #line 14438 "configure"
14439 #include "confdefs.h"
14440
14441 /* Override any gcc2 internal prototype to avoid an error.  */
14442 #ifdef __cplusplus
14443 extern "C"
14444 #endif
14445 /* We use char because int might match the return type of a gcc2
14446    builtin and then its argument prototype would still apply.  */
14447 char XOpenDisplay ();
14448 int
14449 main (void)
14450 {
14451 XOpenDisplay ();
14452   ;
14453   return 0;
14454 }
14455 _ACEOF
14456 rm -f conftest.$ac_objext conftest$ac_exeext
14457 if { (eval echo "$as_me:14457: \"$ac_link\"") >&5
14458   (eval $ac_link) 2>&5
14459   ac_status=$?
14460   echo "$as_me:14460: \$? = $ac_status" >&5
14461   (exit $ac_status); } &&
14462          { ac_try='test -s conftest$ac_exeext'
14463   { (eval echo "$as_me:14463: \"$ac_try\"") >&5
14464   (eval $ac_try) 2>&5
14465   ac_status=$?
14466   echo "$as_me:14466: \$? = $ac_status" >&5
14467   (exit $ac_status); }; }; then
14468   ac_cv_lib_X11_XOpenDisplay=yes
14469 else
14470   echo "$as_me: failed program was:" >&5
14471 cat conftest.$ac_ext >&5
14472 ac_cv_lib_X11_XOpenDisplay=no
14473 fi
14474 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14475 LIBS=$ac_check_lib_save_LIBS
14476 fi
14477 echo "$as_me:14477: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14478 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14479 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14480
14481 cf_add_libs="$LIBS"
14482 # reverse order
14483 cf_add_0lib=
14484 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14485 # filter duplicates
14486 for cf_add_1lib in $cf_add_0lib; do
14487         for cf_add_2lib in $cf_add_libs; do
14488                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14489                         cf_add_1lib=
14490                         break
14491                 fi
14492         done
14493         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14494 done
14495 LIBS="$cf_add_libs"
14496
14497 fi
14498
14499 fi
14500
14501         echo "$as_me:14501: checking for XtAppInitialize" >&5
14502 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14503 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14504   echo $ECHO_N "(cached) $ECHO_C" >&6
14505 else
14506   cat >conftest.$ac_ext <<_ACEOF
14507 #line 14507 "configure"
14508 #include "confdefs.h"
14509 #define XtAppInitialize autoconf_temporary
14510 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14511 #undef XtAppInitialize
14512
14513 #ifdef __cplusplus
14514 extern "C"
14515 #endif
14516
14517 /* We use char because int might match the return type of a gcc2
14518    builtin and then its argument prototype would still apply.  */
14519 char XtAppInitialize (void);
14520
14521 int
14522 main (void)
14523 {
14524
14525 /* The GNU C library defines stubs for functions which it implements
14526     to always fail with ENOSYS.  Some functions are actually named
14527     something starting with __ and the normal name is an alias.  */
14528 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14529 #error found stub for XtAppInitialize
14530 #endif
14531
14532         return XtAppInitialize ();
14533   ;
14534   return 0;
14535 }
14536 _ACEOF
14537 rm -f conftest.$ac_objext conftest$ac_exeext
14538 if { (eval echo "$as_me:14538: \"$ac_link\"") >&5
14539   (eval $ac_link) 2>&5
14540   ac_status=$?
14541   echo "$as_me:14541: \$? = $ac_status" >&5
14542   (exit $ac_status); } &&
14543          { ac_try='test -s conftest$ac_exeext'
14544   { (eval echo "$as_me:14544: \"$ac_try\"") >&5
14545   (eval $ac_try) 2>&5
14546   ac_status=$?
14547   echo "$as_me:14547: \$? = $ac_status" >&5
14548   (exit $ac_status); }; }; then
14549   ac_cv_func_XtAppInitialize=yes
14550 else
14551   echo "$as_me: failed program was:" >&5
14552 cat conftest.$ac_ext >&5
14553 ac_cv_func_XtAppInitialize=no
14554 fi
14555 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14556 fi
14557 echo "$as_me:14557: result: $ac_cv_func_XtAppInitialize" >&5
14558 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14559 if test $ac_cv_func_XtAppInitialize = yes; then
14560   :
14561 else
14562
14563         echo "$as_me:14563: checking for XtAppInitialize in -lXt" >&5
14564 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14565 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14566   echo $ECHO_N "(cached) $ECHO_C" >&6
14567 else
14568   ac_check_lib_save_LIBS=$LIBS
14569 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14570 cat >conftest.$ac_ext <<_ACEOF
14571 #line 14571 "configure"
14572 #include "confdefs.h"
14573
14574 /* Override any gcc2 internal prototype to avoid an error.  */
14575 #ifdef __cplusplus
14576 extern "C"
14577 #endif
14578 /* We use char because int might match the return type of a gcc2
14579    builtin and then its argument prototype would still apply.  */
14580 char XtAppInitialize ();
14581 int
14582 main (void)
14583 {
14584 XtAppInitialize ();
14585   ;
14586   return 0;
14587 }
14588 _ACEOF
14589 rm -f conftest.$ac_objext conftest$ac_exeext
14590 if { (eval echo "$as_me:14590: \"$ac_link\"") >&5
14591   (eval $ac_link) 2>&5
14592   ac_status=$?
14593   echo "$as_me:14593: \$? = $ac_status" >&5
14594   (exit $ac_status); } &&
14595          { ac_try='test -s conftest$ac_exeext'
14596   { (eval echo "$as_me:14596: \"$ac_try\"") >&5
14597   (eval $ac_try) 2>&5
14598   ac_status=$?
14599   echo "$as_me:14599: \$? = $ac_status" >&5
14600   (exit $ac_status); }; }; then
14601   ac_cv_lib_Xt_XtAppInitialize=yes
14602 else
14603   echo "$as_me: failed program was:" >&5
14604 cat conftest.$ac_ext >&5
14605 ac_cv_lib_Xt_XtAppInitialize=no
14606 fi
14607 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14608 LIBS=$ac_check_lib_save_LIBS
14609 fi
14610 echo "$as_me:14610: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
14611 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
14612 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
14613
14614 cat >>confdefs.h <<\EOF
14615 #define HAVE_LIBXT 1
14616 EOF
14617
14618                  cf_have_X_LIBS=Xt
14619                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14620 fi
14621
14622 fi
14623
14624 fi
14625
14626 if test $cf_have_X_LIBS = no ; then
14627         { echo "$as_me:14627: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14628 test program.  You will have to check and add the proper libraries by hand
14629 to makefile." >&5
14630 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14631 test program.  You will have to check and add the proper libraries by hand
14632 to makefile." >&2;}
14633 fi
14634
14635 cf_x_athena_root=$cf_x_athena
14636 cf_x_athena_inc=""
14637
14638 for cf_path in default \
14639         /usr/contrib/X11R6 \
14640         /usr/contrib/X11R5 \
14641         /usr/lib/X11R5 \
14642         /usr/local
14643 do
14644         if test -z "$cf_x_athena_inc" ; then
14645
14646 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
14647 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
14648 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
14649 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
14650 for cf_X_CFLAGS in $X_CFLAGS
14651 do
14652         case "x$cf_X_CFLAGS" in
14653         x-[IUD]*)
14654                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
14655                 ;;
14656         *)
14657                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
14658                 ;;
14659         esac
14660 done
14661
14662                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
14663                 if test $cf_path != default ; then
14664
14665         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14666         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
14667
14668                         echo "$as_me:14668: checking for $cf_test in $cf_path" >&5
14669 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
14670                 else
14671                         echo "$as_me:14671: checking for $cf_test" >&5
14672 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
14673                 fi
14674                 cat >conftest.$ac_ext <<_ACEOF
14675 #line 14675 "configure"
14676 #include "confdefs.h"
14677
14678 #include <X11/Intrinsic.h>
14679 #include <$cf_test>
14680 int
14681 main (void)
14682 {
14683
14684   ;
14685   return 0;
14686 }
14687 _ACEOF
14688 rm -f conftest.$ac_objext
14689 if { (eval echo "$as_me:14689: \"$ac_compile\"") >&5
14690   (eval $ac_compile) 2>&5
14691   ac_status=$?
14692   echo "$as_me:14692: \$? = $ac_status" >&5
14693   (exit $ac_status); } &&
14694          { ac_try='test -s conftest.$ac_objext'
14695   { (eval echo "$as_me:14695: \"$ac_try\"") >&5
14696   (eval $ac_try) 2>&5
14697   ac_status=$?
14698   echo "$as_me:14698: \$? = $ac_status" >&5
14699   (exit $ac_status); }; }; then
14700   cf_result=yes
14701 else
14702   echo "$as_me: failed program was:" >&5
14703 cat conftest.$ac_ext >&5
14704 cf_result=no
14705 fi
14706 rm -f conftest.$ac_objext conftest.$ac_ext
14707                 echo "$as_me:14707: result: $cf_result" >&5
14708 echo "${ECHO_T}$cf_result" >&6
14709
14710 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
14711 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
14712 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
14713
14714                 if test "$cf_result" = yes ; then
14715                         cf_x_athena_inc=$cf_path
14716                         break
14717                 fi
14718         fi
14719 done
14720
14721 if test -z "$cf_x_athena_inc" ; then
14722         { echo "$as_me:14722: WARNING: Unable to successfully find Athena header files with test program" >&5
14723 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
14724 elif test "$cf_x_athena_inc" != default ; then
14725
14726         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14727         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
14728
14729 fi
14730
14731 cf_x_athena_root=$cf_x_athena
14732 cf_x_athena_lib=""
14733
14734 for cf_path in default \
14735         /usr/contrib/X11R6 \
14736         /usr/contrib/X11R5 \
14737         /usr/lib/X11R5 \
14738         /usr/local
14739 do
14740         for cf_lib in \
14741                 ${cf_x_athena_root} \
14742                 ${cf_x_athena_root}7 \
14743                 ${cf_x_athena_root}6
14744         do
14745         for cf_libs in \
14746                 "-l$cf_lib -lXmu" \
14747                 "-l$cf_lib -lXpm -lXmu" \
14748                 "-l${cf_lib}_s -lXmu_s"
14749         do
14750                 test -n "$cf_x_athena_lib" && break
14751
14752 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
14753 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
14754 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
14755 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
14756 for cf_X_CFLAGS in $X_CFLAGS
14757 do
14758         case "x$cf_X_CFLAGS" in
14759         x-[IUD]*)
14760                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
14761                 ;;
14762         *)
14763                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
14764                 ;;
14765         esac
14766 done
14767
14768                 cf_test=XawSimpleMenuAddGlobalActions
14769                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
14770
14771 cf_add_libs="$LIBS"
14772 # reverse order
14773 cf_add_0lib=
14774 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14775 # filter duplicates
14776 for cf_add_1lib in $cf_add_0lib; do
14777         for cf_add_2lib in $cf_add_libs; do
14778                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14779                         cf_add_1lib=
14780                         break
14781                 fi
14782         done
14783         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14784 done
14785 LIBS="$cf_add_libs"
14786
14787                 echo "$as_me:14787: checking for $cf_test in $cf_libs" >&5
14788 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
14789                 cat >conftest.$ac_ext <<_ACEOF
14790 #line 14790 "configure"
14791 #include "confdefs.h"
14792
14793 #include <X11/Intrinsic.h>
14794 #include <X11/$cf_x_athena_root/SimpleMenu.h>
14795
14796 int
14797 main (void)
14798 {
14799
14800 $cf_test((XtAppContext) 0)
14801   ;
14802   return 0;
14803 }
14804 _ACEOF
14805 rm -f conftest.$ac_objext conftest$ac_exeext
14806 if { (eval echo "$as_me:14806: \"$ac_link\"") >&5
14807   (eval $ac_link) 2>&5
14808   ac_status=$?
14809   echo "$as_me:14809: \$? = $ac_status" >&5
14810   (exit $ac_status); } &&
14811          { ac_try='test -s conftest$ac_exeext'
14812   { (eval echo "$as_me:14812: \"$ac_try\"") >&5
14813   (eval $ac_try) 2>&5
14814   ac_status=$?
14815   echo "$as_me:14815: \$? = $ac_status" >&5
14816   (exit $ac_status); }; }; then
14817   cf_result=yes
14818 else
14819   echo "$as_me: failed program was:" >&5
14820 cat conftest.$ac_ext >&5
14821 cf_result=no
14822 fi
14823 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14824                 echo "$as_me:14824: result: $cf_result" >&5
14825 echo "${ECHO_T}$cf_result" >&6
14826
14827 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
14828 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
14829 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
14830
14831                 if test "$cf_result" = yes ; then
14832                         cf_x_athena_lib="$cf_libs"
14833                         break
14834                 fi
14835         done # cf_libs
14836                 test -n "$cf_x_athena_lib" && break
14837         done # cf_lib
14838 done
14839
14840 if test -z "$cf_x_athena_lib" ; then
14841         { { echo "$as_me:14841: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
14842 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
14843    { (exit 1); exit 1; }; }
14844 fi
14845
14846 cf_add_libs="$LIBS"
14847 # reverse order
14848 cf_add_0lib=
14849 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14850 # filter duplicates
14851 for cf_add_1lib in $cf_add_0lib; do
14852         for cf_add_2lib in $cf_add_libs; do
14853                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14854                         cf_add_1lib=
14855                         break
14856                 fi
14857         done
14858         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14859 done
14860 LIBS="$cf_add_libs"
14861
14862 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14863
14864 cat >>confdefs.h <<EOF
14865 #define $cf_x_athena_LIBS 1
14866 EOF
14867
14868 fi
14869
14870 if test -n "$ac_tool_prefix"; then
14871   for ac_prog in xcurses-config
14872   do
14873     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
14874 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
14875 echo "$as_me:14875: checking for $ac_word" >&5
14876 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14877 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
14878   echo $ECHO_N "(cached) $ECHO_C" >&6
14879 else
14880   if test -n "$XCURSES_CONFIG"; then
14881   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
14882 else
14883   ac_save_IFS=$IFS; IFS=$ac_path_separator
14884 ac_dummy="$PATH"
14885 for ac_dir in $ac_dummy; do
14886   IFS=$ac_save_IFS
14887   test -z "$ac_dir" && ac_dir=.
14888   $as_executable_p "$ac_dir/$ac_word" || continue
14889 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
14890 echo "$as_me:14890: found $ac_dir/$ac_word" >&5
14891 break
14892 done
14893
14894 fi
14895 fi
14896 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
14897 if test -n "$XCURSES_CONFIG"; then
14898   echo "$as_me:14898: result: $XCURSES_CONFIG" >&5
14899 echo "${ECHO_T}$XCURSES_CONFIG" >&6
14900 else
14901   echo "$as_me:14901: result: no" >&5
14902 echo "${ECHO_T}no" >&6
14903 fi
14904
14905     test -n "$XCURSES_CONFIG" && break
14906   done
14907 fi
14908 if test -z "$XCURSES_CONFIG"; then
14909   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
14910   for ac_prog in xcurses-config
14911 do
14912   # Extract the first word of "$ac_prog", so it can be a program name with args.
14913 set dummy $ac_prog; ac_word=$2
14914 echo "$as_me:14914: checking for $ac_word" >&5
14915 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14916 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
14917   echo $ECHO_N "(cached) $ECHO_C" >&6
14918 else
14919   if test -n "$ac_ct_XCURSES_CONFIG"; then
14920   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
14921 else
14922   ac_save_IFS=$IFS; IFS=$ac_path_separator
14923 ac_dummy="$PATH"
14924 for ac_dir in $ac_dummy; do
14925   IFS=$ac_save_IFS
14926   test -z "$ac_dir" && ac_dir=.
14927   $as_executable_p "$ac_dir/$ac_word" || continue
14928 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
14929 echo "$as_me:14929: found $ac_dir/$ac_word" >&5
14930 break
14931 done
14932
14933 fi
14934 fi
14935 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
14936 if test -n "$ac_ct_XCURSES_CONFIG"; then
14937   echo "$as_me:14937: result: $ac_ct_XCURSES_CONFIG" >&5
14938 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
14939 else
14940   echo "$as_me:14940: result: no" >&5
14941 echo "${ECHO_T}no" >&6
14942 fi
14943
14944   test -n "$ac_ct_XCURSES_CONFIG" && break
14945 done
14946 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
14947
14948   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
14949 fi
14950
14951 if test "$XCURSES_CONFIG" != none ; then
14952
14953 cf_fix_cppflags=no
14954 cf_new_cflags=
14955 cf_new_cppflags=
14956 cf_new_extra_cppflags=
14957
14958 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
14959 do
14960 case $cf_fix_cppflags in
14961 (no)
14962         case $cf_add_cflags in
14963         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14964                 case $cf_add_cflags in
14965                 (-D*)
14966                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14967
14968                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14969                                 && test -z "${cf_tst_cflags}" \
14970                                 && cf_fix_cppflags=yes
14971
14972                         if test $cf_fix_cppflags = yes ; then
14973
14974         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14975         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14976
14977                                 continue
14978                         elif test "${cf_tst_cflags}" = "\"'" ; then
14979
14980         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14981         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14982
14983                                 continue
14984                         fi
14985                         ;;
14986                 esac
14987                 case "$CPPFLAGS" in
14988                 (*$cf_add_cflags)
14989                         ;;
14990                 (*)
14991                         case $cf_add_cflags in
14992                         (-D*)
14993                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14994
14995 CPPFLAGS=`echo "$CPPFLAGS" | \
14996         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14997                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14998
14999                                 ;;
15000                         esac
15001
15002         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15003         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15004
15005                         ;;
15006                 esac
15007                 ;;
15008         (*)
15009
15010         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15011         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15012
15013                 ;;
15014         esac
15015         ;;
15016 (yes)
15017
15018         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15019         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15020
15021         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15022
15023         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15024                 && test -z "${cf_tst_cflags}" \
15025                 && cf_fix_cppflags=no
15026         ;;
15027 esac
15028 done
15029
15030 if test -n "$cf_new_cflags" ; then
15031
15032         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15033         CFLAGS="${CFLAGS}$cf_new_cflags"
15034
15035 fi
15036
15037 if test -n "$cf_new_cppflags" ; then
15038
15039         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15040         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15041
15042 fi
15043
15044 if test -n "$cf_new_extra_cppflags" ; then
15045
15046         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15047         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15048
15049 fi
15050
15051 cf_add_libs="$LIBS"
15052 # reverse order
15053 cf_add_0lib=
15054 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15055 # filter duplicates
15056 for cf_add_1lib in $cf_add_0lib; do
15057         for cf_add_2lib in $cf_add_libs; do
15058                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15059                         cf_add_1lib=
15060                         break
15061                 fi
15062         done
15063         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15064 done
15065 LIBS="$cf_add_libs"
15066
15067 cf_cv_lib_XCurses=yes
15068
15069 else
15070
15071 LDFLAGS="$LDFLAGS $X_LIBS"
15072
15073 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15074
15075 echo "${as_me:-configure}:15075: testing checking additions to CFLAGS ..." 1>&5
15076
15077 cf_check_cflags="$CFLAGS"
15078 cf_check_cppflags="$CPPFLAGS"
15079
15080 cf_fix_cppflags=no
15081 cf_new_cflags=
15082 cf_new_cppflags=
15083 cf_new_extra_cppflags=
15084
15085 for cf_add_cflags in $X_CFLAGS
15086 do
15087 case $cf_fix_cppflags in
15088 (no)
15089         case $cf_add_cflags in
15090         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15091                 case $cf_add_cflags in
15092                 (-D*)
15093                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15094
15095                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15096                                 && test -z "${cf_tst_cflags}" \
15097                                 && cf_fix_cppflags=yes
15098
15099                         if test $cf_fix_cppflags = yes ; then
15100
15101         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15102         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15103
15104                                 continue
15105                         elif test "${cf_tst_cflags}" = "\"'" ; then
15106
15107         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15108         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15109
15110                                 continue
15111                         fi
15112                         ;;
15113                 esac
15114                 case "$CPPFLAGS" in
15115                 (*$cf_add_cflags)
15116                         ;;
15117                 (*)
15118                         case $cf_add_cflags in
15119                         (-D*)
15120                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15121
15122 CPPFLAGS=`echo "$CPPFLAGS" | \
15123         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15124                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15125
15126                                 ;;
15127                         esac
15128
15129         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15130         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15131
15132                         ;;
15133                 esac
15134                 ;;
15135         (*)
15136
15137         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15138         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15139
15140                 ;;
15141         esac
15142         ;;
15143 (yes)
15144
15145         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15146         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15147
15148         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15149
15150         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15151                 && test -z "${cf_tst_cflags}" \
15152                 && cf_fix_cppflags=no
15153         ;;
15154 esac
15155 done
15156
15157 if test -n "$cf_new_cflags" ; then
15158         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15159
15160 echo "${as_me:-configure}:15160: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15161
15162         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15163         CFLAGS="${CFLAGS}$cf_new_cflags"
15164
15165 fi
15166
15167 if test -n "$cf_new_cppflags" ; then
15168         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15169
15170 echo "${as_me:-configure}:15170: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15171
15172         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15173         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15174
15175 fi
15176
15177 if test -n "$cf_new_extra_cppflags" ; then
15178         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15179
15180 echo "${as_me:-configure}:15180: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15181
15182         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15183         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15184
15185 fi
15186
15187 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15188 cat >conftest.$ac_ext <<_ACEOF
15189 #line 15189 "configure"
15190 #include "confdefs.h"
15191 #include <stdio.h>
15192 int
15193 main (void)
15194 {
15195 printf("Hello world");
15196   ;
15197   return 0;
15198 }
15199 _ACEOF
15200 rm -f conftest.$ac_objext conftest$ac_exeext
15201 if { (eval echo "$as_me:15201: \"$ac_link\"") >&5
15202   (eval $ac_link) 2>&5
15203   ac_status=$?
15204   echo "$as_me:15204: \$? = $ac_status" >&5
15205   (exit $ac_status); } &&
15206          { ac_try='test -s conftest$ac_exeext'
15207   { (eval echo "$as_me:15207: \"$ac_try\"") >&5
15208   (eval $ac_try) 2>&5
15209   ac_status=$?
15210   echo "$as_me:15210: \$? = $ac_status" >&5
15211   (exit $ac_status); }; }; then
15212   :
15213 else
15214   echo "$as_me: failed program was:" >&5
15215 cat conftest.$ac_ext >&5
15216 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15217
15218 echo "${as_me:-configure}:15218: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15219
15220          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15221                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15222
15223 echo "${as_me:-configure}:15223: testing but keeping change to \$CPPFLAGS ..." 1>&5
15224
15225          fi
15226          CFLAGS="$cf_check_flags"
15227 fi
15228 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15229 fi
15230
15231 echo "$as_me:15231: checking for XOpenDisplay in -lX11" >&5
15232 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15233 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15234   echo $ECHO_N "(cached) $ECHO_C" >&6
15235 else
15236   ac_check_lib_save_LIBS=$LIBS
15237 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15238 cat >conftest.$ac_ext <<_ACEOF
15239 #line 15239 "configure"
15240 #include "confdefs.h"
15241
15242 /* Override any gcc2 internal prototype to avoid an error.  */
15243 #ifdef __cplusplus
15244 extern "C"
15245 #endif
15246 /* We use char because int might match the return type of a gcc2
15247    builtin and then its argument prototype would still apply.  */
15248 char XOpenDisplay ();
15249 int
15250 main (void)
15251 {
15252 XOpenDisplay ();
15253   ;
15254   return 0;
15255 }
15256 _ACEOF
15257 rm -f conftest.$ac_objext conftest$ac_exeext
15258 if { (eval echo "$as_me:15258: \"$ac_link\"") >&5
15259   (eval $ac_link) 2>&5
15260   ac_status=$?
15261   echo "$as_me:15261: \$? = $ac_status" >&5
15262   (exit $ac_status); } &&
15263          { ac_try='test -s conftest$ac_exeext'
15264   { (eval echo "$as_me:15264: \"$ac_try\"") >&5
15265   (eval $ac_try) 2>&5
15266   ac_status=$?
15267   echo "$as_me:15267: \$? = $ac_status" >&5
15268   (exit $ac_status); }; }; then
15269   ac_cv_lib_X11_XOpenDisplay=yes
15270 else
15271   echo "$as_me: failed program was:" >&5
15272 cat conftest.$ac_ext >&5
15273 ac_cv_lib_X11_XOpenDisplay=no
15274 fi
15275 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15276 LIBS=$ac_check_lib_save_LIBS
15277 fi
15278 echo "$as_me:15278: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15279 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15280 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15281
15282 cf_add_libs="$LIBS"
15283 # reverse order
15284 cf_add_0lib=
15285 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15286 # filter duplicates
15287 for cf_add_1lib in $cf_add_0lib; do
15288         for cf_add_2lib in $cf_add_libs; do
15289                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15290                         cf_add_1lib=
15291                         break
15292                 fi
15293         done
15294         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15295 done
15296 LIBS="$cf_add_libs"
15297
15298 fi
15299
15300 echo "$as_me:15300: checking for XCurses library" >&5
15301 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15302 if test "${cf_cv_lib_XCurses+set}" = set; then
15303   echo $ECHO_N "(cached) $ECHO_C" >&6
15304 else
15305
15306 cf_add_libs="$LIBS"
15307 # reverse order
15308 cf_add_0lib=
15309 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15310 # filter duplicates
15311 for cf_add_1lib in $cf_add_0lib; do
15312         for cf_add_2lib in $cf_add_libs; do
15313                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15314                         cf_add_1lib=
15315                         break
15316                 fi
15317         done
15318         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15319 done
15320 LIBS="$cf_add_libs"
15321
15322 cat >conftest.$ac_ext <<_ACEOF
15323 #line 15323 "configure"
15324 #include "confdefs.h"
15325
15326 #include <xcurses.h>
15327 char *XCursesProgramName = "test";
15328
15329 int
15330 main (void)
15331 {
15332 XCursesExit();
15333   ;
15334   return 0;
15335 }
15336 _ACEOF
15337 rm -f conftest.$ac_objext conftest$ac_exeext
15338 if { (eval echo "$as_me:15338: \"$ac_link\"") >&5
15339   (eval $ac_link) 2>&5
15340   ac_status=$?
15341   echo "$as_me:15341: \$? = $ac_status" >&5
15342   (exit $ac_status); } &&
15343          { ac_try='test -s conftest$ac_exeext'
15344   { (eval echo "$as_me:15344: \"$ac_try\"") >&5
15345   (eval $ac_try) 2>&5
15346   ac_status=$?
15347   echo "$as_me:15347: \$? = $ac_status" >&5
15348   (exit $ac_status); }; }; then
15349   cf_cv_lib_XCurses=yes
15350 else
15351   echo "$as_me: failed program was:" >&5
15352 cat conftest.$ac_ext >&5
15353 cf_cv_lib_XCurses=no
15354 fi
15355 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15356
15357 fi
15358 echo "$as_me:15358: result: $cf_cv_lib_XCurses" >&5
15359 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15360
15361 fi
15362
15363 if test $cf_cv_lib_XCurses = yes ; then
15364
15365 cat >>confdefs.h <<\EOF
15366 #define UNIX 1
15367 EOF
15368
15369 cat >>confdefs.h <<\EOF
15370 #define XCURSES 1
15371 EOF
15372
15373         echo "$as_me:15373: checking for xcurses.h" >&5
15374 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15375 if test "${ac_cv_header_xcurses_h+set}" = set; then
15376   echo $ECHO_N "(cached) $ECHO_C" >&6
15377 else
15378   cat >conftest.$ac_ext <<_ACEOF
15379 #line 15379 "configure"
15380 #include "confdefs.h"
15381 #include <xcurses.h>
15382 _ACEOF
15383 if { (eval echo "$as_me:15383: \"$ac_cpp conftest.$ac_ext\"") >&5
15384   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15385   ac_status=$?
15386   egrep -v '^ *\+' conftest.er1 >conftest.err
15387   rm -f conftest.er1
15388   cat conftest.err >&5
15389   echo "$as_me:15389: \$? = $ac_status" >&5
15390   (exit $ac_status); } >/dev/null; then
15391   if test -s conftest.err; then
15392     ac_cpp_err=$ac_c_preproc_warn_flag
15393   else
15394     ac_cpp_err=
15395   fi
15396 else
15397   ac_cpp_err=yes
15398 fi
15399 if test -z "$ac_cpp_err"; then
15400   ac_cv_header_xcurses_h=yes
15401 else
15402   echo "$as_me: failed program was:" >&5
15403   cat conftest.$ac_ext >&5
15404   ac_cv_header_xcurses_h=no
15405 fi
15406 rm -f conftest.err conftest.$ac_ext
15407 fi
15408 echo "$as_me:15408: result: $ac_cv_header_xcurses_h" >&5
15409 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15410 if test $ac_cv_header_xcurses_h = yes; then
15411
15412 cat >>confdefs.h <<\EOF
15413 #define HAVE_XCURSES 1
15414 EOF
15415
15416 fi
15417
15418 else
15419         { { echo "$as_me:15419: error: Cannot link with XCurses" >&5
15420 echo "$as_me: error: Cannot link with XCurses" >&2;}
15421    { (exit 1); exit 1; }; }
15422 fi
15423
15424         ;;
15425 (*)
15426         { { echo "$as_me:15426: error: unexpected screen-value: $cf_cv_screen" >&5
15427 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15428    { (exit 1); exit 1; }; }
15429         ;;
15430 esac
15431
15432 : ${cf_nculib_root:=$cf_cv_screen}
15433 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15434 echo "$as_me:15434: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15435 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15436 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15437   echo $ECHO_N "(cached) $ECHO_C" >&6
15438 else
15439   ac_check_lib_save_LIBS=$LIBS
15440 LIBS="-l$cf_nculib_root  $LIBS"
15441 cat >conftest.$ac_ext <<_ACEOF
15442 #line 15442 "configure"
15443 #include "confdefs.h"
15444
15445 /* Override any gcc2 internal prototype to avoid an error.  */
15446 #ifdef __cplusplus
15447 extern "C"
15448 #endif
15449 /* We use char because int might match the return type of a gcc2
15450    builtin and then its argument prototype would still apply.  */
15451 char _nc_init_pthreads ();
15452 int
15453 main (void)
15454 {
15455 _nc_init_pthreads ();
15456   ;
15457   return 0;
15458 }
15459 _ACEOF
15460 rm -f conftest.$ac_objext conftest$ac_exeext
15461 if { (eval echo "$as_me:15461: \"$ac_link\"") >&5
15462   (eval $ac_link) 2>&5
15463   ac_status=$?
15464   echo "$as_me:15464: \$? = $ac_status" >&5
15465   (exit $ac_status); } &&
15466          { ac_try='test -s conftest$ac_exeext'
15467   { (eval echo "$as_me:15467: \"$ac_try\"") >&5
15468   (eval $ac_try) 2>&5
15469   ac_status=$?
15470   echo "$as_me:15470: \$? = $ac_status" >&5
15471   (exit $ac_status); }; }; then
15472   eval "$as_ac_Lib=yes"
15473 else
15474   echo "$as_me: failed program was:" >&5
15475 cat conftest.$ac_ext >&5
15476 eval "$as_ac_Lib=no"
15477 fi
15478 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15479 LIBS=$ac_check_lib_save_LIBS
15480 fi
15481 echo "$as_me:15481: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15482 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15483 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15484   cf_cv_ncurses_pthreads=yes
15485 else
15486   cf_cv_ncurses_pthreads=no
15487 fi
15488
15489 if test "$cf_cv_ncurses_pthreads" = yes
15490 then
15491
15492 cf_add_libs="$LIBS"
15493 # reverse order
15494 cf_add_0lib=
15495 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15496 # filter duplicates
15497 for cf_add_1lib in $cf_add_0lib; do
15498         for cf_add_2lib in $cf_add_libs; do
15499                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15500                         cf_add_1lib=
15501                         break
15502                 fi
15503         done
15504         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15505 done
15506 LIBS="$cf_add_libs"
15507
15508 fi
15509
15510 case $cf_cv_screen in
15511 (ncurses*)
15512         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15513         ;;
15514 esac
15515
15516 echo "$as_me:15516: checking for X11 rgb file" >&5
15517 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15518
15519 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15520 if test "${with_x11_rgb+set}" = set; then
15521   withval="$with_x11_rgb"
15522   RGB_PATH=$withval
15523 else
15524   RGB_PATH=auto
15525 fi;
15526
15527 if test "x$RGB_PATH" = xauto
15528 then
15529         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15530         for cf_path in \
15531                 /opt/local/share/X11/rgb.txt \
15532                 /opt/X11/share/X11/rgb.txt \
15533                 /usr/share/X11/rgb.txt \
15534                 /usr/X11/share/X11/rgb.txt \
15535                 /usr/X11/lib/X11/rgb.txt \
15536                 /usr/lib/X11/rgb.txt \
15537                 /etc/X11/rgb.txt \
15538                 /usr/pkg/lib/X11/rgb.txt \
15539                 /usr/X11R7/lib/X11/rgb.txt \
15540                 /usr/X11R6/lib/X11/rgb.txt \
15541                 /usr/X11R5/lib/X11/rgb.txt \
15542                 /usr/X11R4/lib/X11/rgb.txt \
15543                 /usr/local/lib/X11/rgb.txt \
15544                 /usr/local/share/X11/rgb.txt \
15545                 /usr/lib64/X11/rgb.txt
15546         do
15547                 if test -f "$cf_path" ; then
15548                         RGB_PATH="$cf_path"
15549                         break
15550                 fi
15551         done
15552 else
15553         cf_path=$RGB_PATH
15554
15555 if test "x$prefix" != xNONE; then
15556         cf_path_syntax="$prefix"
15557 else
15558         cf_path_syntax="$ac_default_prefix"
15559 fi
15560
15561 case ".$cf_path" in
15562 (.\$\(*\)*|.\'*\'*)
15563         ;;
15564 (..|./*|.\\*)
15565         ;;
15566 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15567         ;;
15568 (.\${*prefix}*|.\${*dir}*)
15569         eval cf_path="$cf_path"
15570         case ".$cf_path" in
15571         (.NONE/*)
15572                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15573                 ;;
15574         esac
15575         ;;
15576 (.no|.NONE/*)
15577         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15578         ;;
15579 (*)
15580         { { echo "$as_me:15580: error: expected a pathname, not \"$cf_path\"" >&5
15581 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15582    { (exit 1); exit 1; }; }
15583         ;;
15584 esac
15585
15586 fi
15587
15588 echo "$as_me:15588: result: $RGB_PATH" >&5
15589 echo "${ECHO_T}$RGB_PATH" >&6
15590
15591 cat >>confdefs.h <<EOF
15592 #define RGB_PATH "$cf_path"
15593 EOF
15594
15595 no_x11_rgb=
15596 if test "$RGB_PATH" = no
15597 then
15598         no_x11_rgb="#"
15599 fi
15600
15601 cf_curses_headers=
15602
15603 case $cf_cv_screen in
15604 (pdcurses)
15605         cf_default_panel=no
15606         cf_default_form=no
15607         cf_default_menu=no
15608         cf_default_tinfo=no
15609         ;;
15610 (xcurses|bsdcurses)
15611         cf_default_panel=no
15612         cf_default_form=no
15613         cf_default_menu=no
15614         cf_default_tinfo=yes
15615         ;;
15616 (*)
15617         cf_default_panel=yes
15618         cf_default_form=yes
15619         cf_default_menu=yes
15620         cf_default_tinfo=yes
15621         case $cf_cv_screen in
15622         (ncurses*)
15623                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
15624                 ;;
15625         esac
15626         ;;
15627 esac
15628
15629 echo "$as_me:15629: checking if you want to check for panel functions" >&5
15630 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
15631
15632 # Check whether --enable-panel or --disable-panel was given.
15633 if test "${enable_panel+set}" = set; then
15634   enableval="$enable_panel"
15635   test "$enableval" != no && enableval=yes
15636         if test "$enableval" != "yes" ; then
15637     cf_enable_panel=no
15638         else
15639                 cf_enable_panel=$cf_default_panel
15640         fi
15641 else
15642   enableval=yes
15643         cf_enable_panel=$cf_default_panel
15644
15645 fi;
15646 echo "$as_me:15646: result: $cf_enable_panel" >&5
15647 echo "${ECHO_T}$cf_enable_panel" >&6
15648 if test $cf_enable_panel = yes
15649 then
15650
15651 cf_have_curses_lib=no
15652
15653 : ${NCURSES_CONFIG_PKG:=none}
15654 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15655         :
15656 elif test "x${PKG_CONFIG:=none}" != xnone; then
15657         echo "$as_me:15657: checking pkg-config for panel$cf_cv_libtype" >&5
15658 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
15659         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
15660                 echo "$as_me:15660: result: yes" >&5
15661 echo "${ECHO_T}yes" >&6
15662
15663                 echo "$as_me:15663: checking if the panel$cf_cv_libtype package files work" >&5
15664 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
15665
15666                 cf_save_CPPFLAGS="$CPPFLAGS"
15667                 cf_save_LIBS="$LIBS"
15668
15669 cf_fix_cppflags=no
15670 cf_new_cflags=
15671 cf_new_cppflags=
15672 cf_new_extra_cppflags=
15673
15674 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
15675 do
15676 case $cf_fix_cppflags in
15677 (no)
15678         case $cf_add_cflags in
15679         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15680                 case $cf_add_cflags in
15681                 (-D*)
15682                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15683
15684                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15685                                 && test -z "${cf_tst_cflags}" \
15686                                 && cf_fix_cppflags=yes
15687
15688                         if test $cf_fix_cppflags = yes ; then
15689
15690         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15691         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15692
15693                                 continue
15694                         elif test "${cf_tst_cflags}" = "\"'" ; then
15695
15696         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15697         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15698
15699                                 continue
15700                         fi
15701                         ;;
15702                 esac
15703                 case "$CPPFLAGS" in
15704                 (*$cf_add_cflags)
15705                         ;;
15706                 (*)
15707                         case $cf_add_cflags in
15708                         (-D*)
15709                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15710
15711 CPPFLAGS=`echo "$CPPFLAGS" | \
15712         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15713                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15714
15715                                 ;;
15716                         esac
15717
15718         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15719         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15720
15721                         ;;
15722                 esac
15723                 ;;
15724         (*)
15725
15726         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15727         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15728
15729                 ;;
15730         esac
15731         ;;
15732 (yes)
15733
15734         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15735         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15736
15737         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15738
15739         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15740                 && test -z "${cf_tst_cflags}" \
15741                 && cf_fix_cppflags=no
15742         ;;
15743 esac
15744 done
15745
15746 if test -n "$cf_new_cflags" ; then
15747
15748         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15749         CFLAGS="${CFLAGS}$cf_new_cflags"
15750
15751 fi
15752
15753 if test -n "$cf_new_cppflags" ; then
15754
15755         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15756         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15757
15758 fi
15759
15760 if test -n "$cf_new_extra_cppflags" ; then
15761
15762         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15763         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15764
15765 fi
15766
15767 cf_add_libs="$LIBS"
15768 # reverse order
15769 cf_add_0lib=
15770 for cf_add_1lib in `$PKG_CONFIG --libs panel$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15771 # filter duplicates
15772 for cf_add_1lib in $cf_add_0lib; do
15773         for cf_add_2lib in $cf_add_libs; do
15774                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15775                         cf_add_1lib=
15776                         break
15777                 fi
15778         done
15779         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15780 done
15781 LIBS="$cf_add_libs"
15782
15783                 cat >conftest.$ac_ext <<_ACEOF
15784 #line 15784 "configure"
15785 #include "confdefs.h"
15786 #include <panel.h>
15787 int
15788 main (void)
15789 {
15790 (void) new_panel ( 0 );
15791   ;
15792   return 0;
15793 }
15794 _ACEOF
15795 rm -f conftest.$ac_objext conftest$ac_exeext
15796 if { (eval echo "$as_me:15796: \"$ac_link\"") >&5
15797   (eval $ac_link) 2>&5
15798   ac_status=$?
15799   echo "$as_me:15799: \$? = $ac_status" >&5
15800   (exit $ac_status); } &&
15801          { ac_try='test -s conftest$ac_exeext'
15802   { (eval echo "$as_me:15802: \"$ac_try\"") >&5
15803   (eval $ac_try) 2>&5
15804   ac_status=$?
15805   echo "$as_me:15805: \$? = $ac_status" >&5
15806   (exit $ac_status); }; }; then
15807   if test "$cross_compiling" = yes; then
15808   cf_have_curses_lib=maybe
15809 else
15810   cat >conftest.$ac_ext <<_ACEOF
15811 #line 15811 "configure"
15812 #include "confdefs.h"
15813 #include <panel.h>
15814                                 int main(void)
15815                                 { (void) new_panel ( 0 ); return 0; }
15816 _ACEOF
15817 rm -f conftest$ac_exeext
15818 if { (eval echo "$as_me:15818: \"$ac_link\"") >&5
15819   (eval $ac_link) 2>&5
15820   ac_status=$?
15821   echo "$as_me:15821: \$? = $ac_status" >&5
15822   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15823   { (eval echo "$as_me:15823: \"$ac_try\"") >&5
15824   (eval $ac_try) 2>&5
15825   ac_status=$?
15826   echo "$as_me:15826: \$? = $ac_status" >&5
15827   (exit $ac_status); }; }; then
15828   cf_have_curses_lib=yes
15829 else
15830   echo "$as_me: program exited with status $ac_status" >&5
15831 echo "$as_me: failed program was:" >&5
15832 cat conftest.$ac_ext >&5
15833 cf_have_curses_lib=no
15834 fi
15835 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15836 fi
15837 else
15838   echo "$as_me: failed program was:" >&5
15839 cat conftest.$ac_ext >&5
15840 cf_have_curses_lib=no
15841 fi
15842 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15843                 echo "$as_me:15843: result: $cf_have_curses_lib" >&5
15844 echo "${ECHO_T}$cf_have_curses_lib" >&6
15845                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15846                 if test "$cf_have_curses_lib" != "yes"
15847                 then
15848                         CPPFLAGS="$cf_save_CPPFLAGS"
15849                         LIBS="$cf_save_LIBS"
15850                 else
15851
15852 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15853
15854                         cat >>confdefs.h <<EOF
15855 #define $cf_upper 1
15856 EOF
15857
15858                 fi
15859         fi
15860 fi
15861 if test "$cf_have_curses_lib" = no; then
15862         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
15863 echo "$as_me:15863: checking for new_panel in -lpanel$cf_cv_libtype" >&5
15864 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
15865 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15866   echo $ECHO_N "(cached) $ECHO_C" >&6
15867 else
15868   ac_check_lib_save_LIBS=$LIBS
15869 LIBS="-lpanel$cf_cv_libtype  $LIBS"
15870 cat >conftest.$ac_ext <<_ACEOF
15871 #line 15871 "configure"
15872 #include "confdefs.h"
15873
15874 /* Override any gcc2 internal prototype to avoid an error.  */
15875 #ifdef __cplusplus
15876 extern "C"
15877 #endif
15878 /* We use char because int might match the return type of a gcc2
15879    builtin and then its argument prototype would still apply.  */
15880 char new_panel ();
15881 int
15882 main (void)
15883 {
15884 new_panel ();
15885   ;
15886   return 0;
15887 }
15888 _ACEOF
15889 rm -f conftest.$ac_objext conftest$ac_exeext
15890 if { (eval echo "$as_me:15890: \"$ac_link\"") >&5
15891   (eval $ac_link) 2>&5
15892   ac_status=$?
15893   echo "$as_me:15893: \$? = $ac_status" >&5
15894   (exit $ac_status); } &&
15895          { ac_try='test -s conftest$ac_exeext'
15896   { (eval echo "$as_me:15896: \"$ac_try\"") >&5
15897   (eval $ac_try) 2>&5
15898   ac_status=$?
15899   echo "$as_me:15899: \$? = $ac_status" >&5
15900   (exit $ac_status); }; }; then
15901   eval "$as_ac_Lib=yes"
15902 else
15903   echo "$as_me: failed program was:" >&5
15904 cat conftest.$ac_ext >&5
15905 eval "$as_ac_Lib=no"
15906 fi
15907 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15908 LIBS=$ac_check_lib_save_LIBS
15909 fi
15910 echo "$as_me:15910: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15911 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15912 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15913
15914 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15915
15916 cf_add_libs="$LIBS"
15917 # reverse order
15918 cf_add_0lib=
15919 for cf_add_1lib in -lpanel$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15920 # filter duplicates
15921 for cf_add_1lib in $cf_add_0lib; do
15922         for cf_add_2lib in $cf_add_libs; do
15923                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15924                         cf_add_1lib=
15925                         break
15926                 fi
15927         done
15928         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15929 done
15930 LIBS="$cf_add_libs"
15931
15932                 cat >>confdefs.h <<EOF
15933 #define $cf_upper 1
15934 EOF
15935
15936 fi
15937
15938 fi
15939
15940         cf_curses_headers="$cf_curses_headers panel.h"
15941 fi
15942
15943 echo "$as_me:15943: checking if you want to check for menu functions" >&5
15944 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
15945
15946 # Check whether --enable-menu or --disable-menu was given.
15947 if test "${enable_menu+set}" = set; then
15948   enableval="$enable_menu"
15949   test "$enableval" != no && enableval=yes
15950         if test "$enableval" != "yes" ; then
15951     cf_enable_menu=no
15952         else
15953                 cf_enable_menu=$cf_default_menu
15954         fi
15955 else
15956   enableval=yes
15957         cf_enable_menu=$cf_default_menu
15958
15959 fi;
15960 echo "$as_me:15960: result: $cf_enable_menu" >&5
15961 echo "${ECHO_T}$cf_enable_menu" >&6
15962 if test $cf_enable_menu = yes
15963 then
15964         case $cf_cv_screen in
15965         (ncurses*)
15966                 ;;
15967         (curses*)
15968
15969 echo "$as_me:15969: checking for NetBSD menu.h" >&5
15970 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
15971 if test "${cf_cv_netbsd_menu_h+set}" = set; then
15972   echo $ECHO_N "(cached) $ECHO_C" >&6
15973 else
15974
15975 cat >conftest.$ac_ext <<_ACEOF
15976 #line 15976 "configure"
15977 #include "confdefs.h"
15978
15979 #include <${cf_cv_ncurses_header:-curses.h}>
15980 #include <menu.h>
15981
15982 int
15983 main (void)
15984 {
15985
15986         MENU *menu;
15987         int y = menu->max_item_width;
15988
15989   ;
15990   return 0;
15991 }
15992 _ACEOF
15993 rm -f conftest.$ac_objext
15994 if { (eval echo "$as_me:15994: \"$ac_compile\"") >&5
15995   (eval $ac_compile) 2>&5
15996   ac_status=$?
15997   echo "$as_me:15997: \$? = $ac_status" >&5
15998   (exit $ac_status); } &&
15999          { ac_try='test -s conftest.$ac_objext'
16000   { (eval echo "$as_me:16000: \"$ac_try\"") >&5
16001   (eval $ac_try) 2>&5
16002   ac_status=$?
16003   echo "$as_me:16003: \$? = $ac_status" >&5
16004   (exit $ac_status); }; }; then
16005   cf_cv_netbsd_menu_h=yes
16006
16007 else
16008   echo "$as_me: failed program was:" >&5
16009 cat conftest.$ac_ext >&5
16010 cf_cv_netbsd_menu_h=no
16011 fi
16012 rm -f conftest.$ac_objext conftest.$ac_ext
16013
16014 fi
16015 echo "$as_me:16015: result: $cf_cv_netbsd_menu_h" >&5
16016 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16017
16018 test "$cf_cv_netbsd_menu_h" = yes &&
16019 cat >>confdefs.h <<\EOF
16020 #define HAVE_NETBSD_MENU_H 1
16021 EOF
16022
16023                 ;;
16024         esac
16025
16026 cf_have_curses_lib=no
16027
16028 : ${NCURSES_CONFIG_PKG:=none}
16029 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16030         :
16031 elif test "x${PKG_CONFIG:=none}" != xnone; then
16032         echo "$as_me:16032: checking pkg-config for menu$cf_cv_libtype" >&5
16033 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
16034         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
16035                 echo "$as_me:16035: result: yes" >&5
16036 echo "${ECHO_T}yes" >&6
16037
16038                 echo "$as_me:16038: checking if the menu$cf_cv_libtype package files work" >&5
16039 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
16040
16041                 cf_save_CPPFLAGS="$CPPFLAGS"
16042                 cf_save_LIBS="$LIBS"
16043
16044 cf_fix_cppflags=no
16045 cf_new_cflags=
16046 cf_new_cppflags=
16047 cf_new_extra_cppflags=
16048
16049 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
16050 do
16051 case $cf_fix_cppflags in
16052 (no)
16053         case $cf_add_cflags in
16054         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16055                 case $cf_add_cflags in
16056                 (-D*)
16057                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16058
16059                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16060                                 && test -z "${cf_tst_cflags}" \
16061                                 && cf_fix_cppflags=yes
16062
16063                         if test $cf_fix_cppflags = yes ; then
16064
16065         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16066         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16067
16068                                 continue
16069                         elif test "${cf_tst_cflags}" = "\"'" ; then
16070
16071         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16072         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16073
16074                                 continue
16075                         fi
16076                         ;;
16077                 esac
16078                 case "$CPPFLAGS" in
16079                 (*$cf_add_cflags)
16080                         ;;
16081                 (*)
16082                         case $cf_add_cflags in
16083                         (-D*)
16084                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16085
16086 CPPFLAGS=`echo "$CPPFLAGS" | \
16087         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16088                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16089
16090                                 ;;
16091                         esac
16092
16093         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16094         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16095
16096                         ;;
16097                 esac
16098                 ;;
16099         (*)
16100
16101         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16102         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16103
16104                 ;;
16105         esac
16106         ;;
16107 (yes)
16108
16109         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16110         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16111
16112         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16113
16114         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16115                 && test -z "${cf_tst_cflags}" \
16116                 && cf_fix_cppflags=no
16117         ;;
16118 esac
16119 done
16120
16121 if test -n "$cf_new_cflags" ; then
16122
16123         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16124         CFLAGS="${CFLAGS}$cf_new_cflags"
16125
16126 fi
16127
16128 if test -n "$cf_new_cppflags" ; then
16129
16130         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16131         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16132
16133 fi
16134
16135 if test -n "$cf_new_extra_cppflags" ; then
16136
16137         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16138         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16139
16140 fi
16141
16142 cf_add_libs="$LIBS"
16143 # reverse order
16144 cf_add_0lib=
16145 for cf_add_1lib in `$PKG_CONFIG --libs menu$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16146 # filter duplicates
16147 for cf_add_1lib in $cf_add_0lib; do
16148         for cf_add_2lib in $cf_add_libs; do
16149                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16150                         cf_add_1lib=
16151                         break
16152                 fi
16153         done
16154         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16155 done
16156 LIBS="$cf_add_libs"
16157
16158                 cat >conftest.$ac_ext <<_ACEOF
16159 #line 16159 "configure"
16160 #include "confdefs.h"
16161 #include <menu.h>
16162 int
16163 main (void)
16164 {
16165 (void) menu_driver ( 0,0 );
16166   ;
16167   return 0;
16168 }
16169 _ACEOF
16170 rm -f conftest.$ac_objext conftest$ac_exeext
16171 if { (eval echo "$as_me:16171: \"$ac_link\"") >&5
16172   (eval $ac_link) 2>&5
16173   ac_status=$?
16174   echo "$as_me:16174: \$? = $ac_status" >&5
16175   (exit $ac_status); } &&
16176          { ac_try='test -s conftest$ac_exeext'
16177   { (eval echo "$as_me:16177: \"$ac_try\"") >&5
16178   (eval $ac_try) 2>&5
16179   ac_status=$?
16180   echo "$as_me:16180: \$? = $ac_status" >&5
16181   (exit $ac_status); }; }; then
16182   if test "$cross_compiling" = yes; then
16183   cf_have_curses_lib=maybe
16184 else
16185   cat >conftest.$ac_ext <<_ACEOF
16186 #line 16186 "configure"
16187 #include "confdefs.h"
16188 #include <menu.h>
16189                                 int main(void)
16190                                 { (void) menu_driver ( 0,0 ); return 0; }
16191 _ACEOF
16192 rm -f conftest$ac_exeext
16193 if { (eval echo "$as_me:16193: \"$ac_link\"") >&5
16194   (eval $ac_link) 2>&5
16195   ac_status=$?
16196   echo "$as_me:16196: \$? = $ac_status" >&5
16197   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16198   { (eval echo "$as_me:16198: \"$ac_try\"") >&5
16199   (eval $ac_try) 2>&5
16200   ac_status=$?
16201   echo "$as_me:16201: \$? = $ac_status" >&5
16202   (exit $ac_status); }; }; then
16203   cf_have_curses_lib=yes
16204 else
16205   echo "$as_me: program exited with status $ac_status" >&5
16206 echo "$as_me: failed program was:" >&5
16207 cat conftest.$ac_ext >&5
16208 cf_have_curses_lib=no
16209 fi
16210 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16211 fi
16212 else
16213   echo "$as_me: failed program was:" >&5
16214 cat conftest.$ac_ext >&5
16215 cf_have_curses_lib=no
16216 fi
16217 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16218                 echo "$as_me:16218: result: $cf_have_curses_lib" >&5
16219 echo "${ECHO_T}$cf_have_curses_lib" >&6
16220                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16221                 if test "$cf_have_curses_lib" != "yes"
16222                 then
16223                         CPPFLAGS="$cf_save_CPPFLAGS"
16224                         LIBS="$cf_save_LIBS"
16225                 else
16226
16227 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16228
16229                         cat >>confdefs.h <<EOF
16230 #define $cf_upper 1
16231 EOF
16232
16233                 fi
16234         fi
16235 fi
16236 if test "$cf_have_curses_lib" = no; then
16237         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16238 echo "$as_me:16238: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
16239 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
16240 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16241   echo $ECHO_N "(cached) $ECHO_C" >&6
16242 else
16243   ac_check_lib_save_LIBS=$LIBS
16244 LIBS="-lmenu$cf_cv_libtype  $LIBS"
16245 cat >conftest.$ac_ext <<_ACEOF
16246 #line 16246 "configure"
16247 #include "confdefs.h"
16248
16249 /* Override any gcc2 internal prototype to avoid an error.  */
16250 #ifdef __cplusplus
16251 extern "C"
16252 #endif
16253 /* We use char because int might match the return type of a gcc2
16254    builtin and then its argument prototype would still apply.  */
16255 char menu_driver ();
16256 int
16257 main (void)
16258 {
16259 menu_driver ();
16260   ;
16261   return 0;
16262 }
16263 _ACEOF
16264 rm -f conftest.$ac_objext conftest$ac_exeext
16265 if { (eval echo "$as_me:16265: \"$ac_link\"") >&5
16266   (eval $ac_link) 2>&5
16267   ac_status=$?
16268   echo "$as_me:16268: \$? = $ac_status" >&5
16269   (exit $ac_status); } &&
16270          { ac_try='test -s conftest$ac_exeext'
16271   { (eval echo "$as_me:16271: \"$ac_try\"") >&5
16272   (eval $ac_try) 2>&5
16273   ac_status=$?
16274   echo "$as_me:16274: \$? = $ac_status" >&5
16275   (exit $ac_status); }; }; then
16276   eval "$as_ac_Lib=yes"
16277 else
16278   echo "$as_me: failed program was:" >&5
16279 cat conftest.$ac_ext >&5
16280 eval "$as_ac_Lib=no"
16281 fi
16282 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16283 LIBS=$ac_check_lib_save_LIBS
16284 fi
16285 echo "$as_me:16285: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16286 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16287 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16288
16289 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16290
16291 cf_add_libs="$LIBS"
16292 # reverse order
16293 cf_add_0lib=
16294 for cf_add_1lib in -lmenu$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16295 # filter duplicates
16296 for cf_add_1lib in $cf_add_0lib; do
16297         for cf_add_2lib in $cf_add_libs; do
16298                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16299                         cf_add_1lib=
16300                         break
16301                 fi
16302         done
16303         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16304 done
16305 LIBS="$cf_add_libs"
16306
16307                 cat >>confdefs.h <<EOF
16308 #define $cf_upper 1
16309 EOF
16310
16311 fi
16312
16313 fi
16314
16315         cf_curses_headers="$cf_curses_headers menu.h"
16316 fi
16317
16318 echo "$as_me:16318: checking if you want to check for form functions" >&5
16319 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16320
16321 # Check whether --enable-form or --disable-form was given.
16322 if test "${enable_form+set}" = set; then
16323   enableval="$enable_form"
16324   test "$enableval" != no && enableval=yes
16325         if test "$enableval" != "yes" ; then
16326     cf_enable_form=no
16327         else
16328                 cf_enable_form=$cf_default_form
16329         fi
16330 else
16331   enableval=yes
16332         cf_enable_form=$cf_default_form
16333
16334 fi;
16335 echo "$as_me:16335: result: $cf_enable_form" >&5
16336 echo "${ECHO_T}$cf_enable_form" >&6
16337 if test $cf_enable_form = yes
16338 then
16339         case $cf_cv_screen in
16340         (ncurses*)
16341                 ;;
16342         (curses*)
16343
16344 echo "$as_me:16344: checking for NetBSD form.h" >&5
16345 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16346 if test "${cf_cv_netbsd_form_h+set}" = set; then
16347   echo $ECHO_N "(cached) $ECHO_C" >&6
16348 else
16349
16350 cat >conftest.$ac_ext <<_ACEOF
16351 #line 16351 "configure"
16352 #include "confdefs.h"
16353
16354 #include <${cf_cv_ncurses_header:-curses.h}>
16355 #include <form.h>
16356
16357 int
16358 main (void)
16359 {
16360
16361         FORM *form;
16362         int y = current_field(form)->cursor_ypos;
16363         int x = current_field(form)->cursor_xpos;
16364
16365   ;
16366   return 0;
16367 }
16368 _ACEOF
16369 rm -f conftest.$ac_objext
16370 if { (eval echo "$as_me:16370: \"$ac_compile\"") >&5
16371   (eval $ac_compile) 2>&5
16372   ac_status=$?
16373   echo "$as_me:16373: \$? = $ac_status" >&5
16374   (exit $ac_status); } &&
16375          { ac_try='test -s conftest.$ac_objext'
16376   { (eval echo "$as_me:16376: \"$ac_try\"") >&5
16377   (eval $ac_try) 2>&5
16378   ac_status=$?
16379   echo "$as_me:16379: \$? = $ac_status" >&5
16380   (exit $ac_status); }; }; then
16381   cf_cv_netbsd_form_h=yes
16382
16383 else
16384   echo "$as_me: failed program was:" >&5
16385 cat conftest.$ac_ext >&5
16386 cf_cv_netbsd_form_h=no
16387 fi
16388 rm -f conftest.$ac_objext conftest.$ac_ext
16389
16390 fi
16391 echo "$as_me:16391: result: $cf_cv_netbsd_form_h" >&5
16392 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16393
16394 test "$cf_cv_netbsd_form_h" = yes &&
16395 cat >>confdefs.h <<\EOF
16396 #define HAVE_NETBSD_FORM_H 1
16397 EOF
16398
16399                 ;;
16400         esac
16401
16402 cf_have_curses_lib=no
16403
16404 : ${NCURSES_CONFIG_PKG:=none}
16405 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16406         :
16407 elif test "x${PKG_CONFIG:=none}" != xnone; then
16408         echo "$as_me:16408: checking pkg-config for form$cf_cv_libtype" >&5
16409 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
16410         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
16411                 echo "$as_me:16411: result: yes" >&5
16412 echo "${ECHO_T}yes" >&6
16413
16414                 echo "$as_me:16414: checking if the form$cf_cv_libtype package files work" >&5
16415 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
16416
16417                 cf_save_CPPFLAGS="$CPPFLAGS"
16418                 cf_save_LIBS="$LIBS"
16419
16420 cf_fix_cppflags=no
16421 cf_new_cflags=
16422 cf_new_cppflags=
16423 cf_new_extra_cppflags=
16424
16425 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
16426 do
16427 case $cf_fix_cppflags in
16428 (no)
16429         case $cf_add_cflags in
16430         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16431                 case $cf_add_cflags in
16432                 (-D*)
16433                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16434
16435                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16436                                 && test -z "${cf_tst_cflags}" \
16437                                 && cf_fix_cppflags=yes
16438
16439                         if test $cf_fix_cppflags = yes ; then
16440
16441         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16442         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16443
16444                                 continue
16445                         elif test "${cf_tst_cflags}" = "\"'" ; then
16446
16447         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16448         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16449
16450                                 continue
16451                         fi
16452                         ;;
16453                 esac
16454                 case "$CPPFLAGS" in
16455                 (*$cf_add_cflags)
16456                         ;;
16457                 (*)
16458                         case $cf_add_cflags in
16459                         (-D*)
16460                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16461
16462 CPPFLAGS=`echo "$CPPFLAGS" | \
16463         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16464                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16465
16466                                 ;;
16467                         esac
16468
16469         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16470         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16471
16472                         ;;
16473                 esac
16474                 ;;
16475         (*)
16476
16477         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16478         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16479
16480                 ;;
16481         esac
16482         ;;
16483 (yes)
16484
16485         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16486         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16487
16488         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16489
16490         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16491                 && test -z "${cf_tst_cflags}" \
16492                 && cf_fix_cppflags=no
16493         ;;
16494 esac
16495 done
16496
16497 if test -n "$cf_new_cflags" ; then
16498
16499         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16500         CFLAGS="${CFLAGS}$cf_new_cflags"
16501
16502 fi
16503
16504 if test -n "$cf_new_cppflags" ; then
16505
16506         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16507         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16508
16509 fi
16510
16511 if test -n "$cf_new_extra_cppflags" ; then
16512
16513         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16514         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16515
16516 fi
16517
16518 cf_add_libs="$LIBS"
16519 # reverse order
16520 cf_add_0lib=
16521 for cf_add_1lib in `$PKG_CONFIG --libs form$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16522 # filter duplicates
16523 for cf_add_1lib in $cf_add_0lib; do
16524         for cf_add_2lib in $cf_add_libs; do
16525                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16526                         cf_add_1lib=
16527                         break
16528                 fi
16529         done
16530         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16531 done
16532 LIBS="$cf_add_libs"
16533
16534                 cat >conftest.$ac_ext <<_ACEOF
16535 #line 16535 "configure"
16536 #include "confdefs.h"
16537 #include <form.h>
16538 int
16539 main (void)
16540 {
16541 (void) form_driver ( 0,0 );
16542   ;
16543   return 0;
16544 }
16545 _ACEOF
16546 rm -f conftest.$ac_objext conftest$ac_exeext
16547 if { (eval echo "$as_me:16547: \"$ac_link\"") >&5
16548   (eval $ac_link) 2>&5
16549   ac_status=$?
16550   echo "$as_me:16550: \$? = $ac_status" >&5
16551   (exit $ac_status); } &&
16552          { ac_try='test -s conftest$ac_exeext'
16553   { (eval echo "$as_me:16553: \"$ac_try\"") >&5
16554   (eval $ac_try) 2>&5
16555   ac_status=$?
16556   echo "$as_me:16556: \$? = $ac_status" >&5
16557   (exit $ac_status); }; }; then
16558   if test "$cross_compiling" = yes; then
16559   cf_have_curses_lib=maybe
16560 else
16561   cat >conftest.$ac_ext <<_ACEOF
16562 #line 16562 "configure"
16563 #include "confdefs.h"
16564 #include <form.h>
16565                                 int main(void)
16566                                 { (void) form_driver ( 0,0 ); return 0; }
16567 _ACEOF
16568 rm -f conftest$ac_exeext
16569 if { (eval echo "$as_me:16569: \"$ac_link\"") >&5
16570   (eval $ac_link) 2>&5
16571   ac_status=$?
16572   echo "$as_me:16572: \$? = $ac_status" >&5
16573   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16574   { (eval echo "$as_me:16574: \"$ac_try\"") >&5
16575   (eval $ac_try) 2>&5
16576   ac_status=$?
16577   echo "$as_me:16577: \$? = $ac_status" >&5
16578   (exit $ac_status); }; }; then
16579   cf_have_curses_lib=yes
16580 else
16581   echo "$as_me: program exited with status $ac_status" >&5
16582 echo "$as_me: failed program was:" >&5
16583 cat conftest.$ac_ext >&5
16584 cf_have_curses_lib=no
16585 fi
16586 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16587 fi
16588 else
16589   echo "$as_me: failed program was:" >&5
16590 cat conftest.$ac_ext >&5
16591 cf_have_curses_lib=no
16592 fi
16593 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16594                 echo "$as_me:16594: result: $cf_have_curses_lib" >&5
16595 echo "${ECHO_T}$cf_have_curses_lib" >&6
16596                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16597                 if test "$cf_have_curses_lib" != "yes"
16598                 then
16599                         CPPFLAGS="$cf_save_CPPFLAGS"
16600                         LIBS="$cf_save_LIBS"
16601                 else
16602
16603 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16604
16605                         cat >>confdefs.h <<EOF
16606 #define $cf_upper 1
16607 EOF
16608
16609                 fi
16610         fi
16611 fi
16612 if test "$cf_have_curses_lib" = no; then
16613         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
16614 echo "$as_me:16614: checking for form_driver in -lform$cf_cv_libtype" >&5
16615 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
16616 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16617   echo $ECHO_N "(cached) $ECHO_C" >&6
16618 else
16619   ac_check_lib_save_LIBS=$LIBS
16620 LIBS="-lform$cf_cv_libtype  $LIBS"
16621 cat >conftest.$ac_ext <<_ACEOF
16622 #line 16622 "configure"
16623 #include "confdefs.h"
16624
16625 /* Override any gcc2 internal prototype to avoid an error.  */
16626 #ifdef __cplusplus
16627 extern "C"
16628 #endif
16629 /* We use char because int might match the return type of a gcc2
16630    builtin and then its argument prototype would still apply.  */
16631 char form_driver ();
16632 int
16633 main (void)
16634 {
16635 form_driver ();
16636   ;
16637   return 0;
16638 }
16639 _ACEOF
16640 rm -f conftest.$ac_objext conftest$ac_exeext
16641 if { (eval echo "$as_me:16641: \"$ac_link\"") >&5
16642   (eval $ac_link) 2>&5
16643   ac_status=$?
16644   echo "$as_me:16644: \$? = $ac_status" >&5
16645   (exit $ac_status); } &&
16646          { ac_try='test -s conftest$ac_exeext'
16647   { (eval echo "$as_me:16647: \"$ac_try\"") >&5
16648   (eval $ac_try) 2>&5
16649   ac_status=$?
16650   echo "$as_me:16650: \$? = $ac_status" >&5
16651   (exit $ac_status); }; }; then
16652   eval "$as_ac_Lib=yes"
16653 else
16654   echo "$as_me: failed program was:" >&5
16655 cat conftest.$ac_ext >&5
16656 eval "$as_ac_Lib=no"
16657 fi
16658 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16659 LIBS=$ac_check_lib_save_LIBS
16660 fi
16661 echo "$as_me:16661: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16662 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16663 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16664
16665 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16666
16667 cf_add_libs="$LIBS"
16668 # reverse order
16669 cf_add_0lib=
16670 for cf_add_1lib in -lform$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16671 # filter duplicates
16672 for cf_add_1lib in $cf_add_0lib; do
16673         for cf_add_2lib in $cf_add_libs; do
16674                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16675                         cf_add_1lib=
16676                         break
16677                 fi
16678         done
16679         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16680 done
16681 LIBS="$cf_add_libs"
16682
16683                 cat >>confdefs.h <<EOF
16684 #define $cf_upper 1
16685 EOF
16686
16687 fi
16688
16689 fi
16690
16691         cf_curses_headers="$cf_curses_headers form.h"
16692 fi
16693
16694 # look for curses-related headers
16695
16696 for ac_header in $cf_curses_headers
16697 do
16698 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16699 echo "$as_me:16699: checking for $ac_header" >&5
16700 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16701 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16702   echo $ECHO_N "(cached) $ECHO_C" >&6
16703 else
16704   cat >conftest.$ac_ext <<_ACEOF
16705 #line 16705 "configure"
16706 #include "confdefs.h"
16707 #include <$ac_header>
16708 _ACEOF
16709 if { (eval echo "$as_me:16709: \"$ac_cpp conftest.$ac_ext\"") >&5
16710   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16711   ac_status=$?
16712   egrep -v '^ *\+' conftest.er1 >conftest.err
16713   rm -f conftest.er1
16714   cat conftest.err >&5
16715   echo "$as_me:16715: \$? = $ac_status" >&5
16716   (exit $ac_status); } >/dev/null; then
16717   if test -s conftest.err; then
16718     ac_cpp_err=$ac_c_preproc_warn_flag
16719   else
16720     ac_cpp_err=
16721   fi
16722 else
16723   ac_cpp_err=yes
16724 fi
16725 if test -z "$ac_cpp_err"; then
16726   eval "$as_ac_Header=yes"
16727 else
16728   echo "$as_me: failed program was:" >&5
16729   cat conftest.$ac_ext >&5
16730   eval "$as_ac_Header=no"
16731 fi
16732 rm -f conftest.err conftest.$ac_ext
16733 fi
16734 echo "$as_me:16734: result: `eval echo '${'$as_ac_Header'}'`" >&5
16735 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16736 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16737   cat >>confdefs.h <<EOF
16738 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16739 EOF
16740
16741 fi
16742 done
16743
16744 echo "$as_me:16744: checking for ANSI C header files" >&5
16745 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16746 if test "${ac_cv_header_stdc+set}" = set; then
16747   echo $ECHO_N "(cached) $ECHO_C" >&6
16748 else
16749   cat >conftest.$ac_ext <<_ACEOF
16750 #line 16750 "configure"
16751 #include "confdefs.h"
16752 #include <stdlib.h>
16753 #include <stdarg.h>
16754 #include <string.h>
16755 #include <float.h>
16756
16757 _ACEOF
16758 if { (eval echo "$as_me:16758: \"$ac_cpp conftest.$ac_ext\"") >&5
16759   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16760   ac_status=$?
16761   egrep -v '^ *\+' conftest.er1 >conftest.err
16762   rm -f conftest.er1
16763   cat conftest.err >&5
16764   echo "$as_me:16764: \$? = $ac_status" >&5
16765   (exit $ac_status); } >/dev/null; then
16766   if test -s conftest.err; then
16767     ac_cpp_err=$ac_c_preproc_warn_flag
16768   else
16769     ac_cpp_err=
16770   fi
16771 else
16772   ac_cpp_err=yes
16773 fi
16774 if test -z "$ac_cpp_err"; then
16775   ac_cv_header_stdc=yes
16776 else
16777   echo "$as_me: failed program was:" >&5
16778   cat conftest.$ac_ext >&5
16779   ac_cv_header_stdc=no
16780 fi
16781 rm -f conftest.err conftest.$ac_ext
16782
16783 if test $ac_cv_header_stdc = yes; then
16784   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16785   cat >conftest.$ac_ext <<_ACEOF
16786 #line 16786 "configure"
16787 #include "confdefs.h"
16788 #include <string.h>
16789
16790 _ACEOF
16791 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16792   egrep "memchr" >/dev/null 2>&1; then
16793   :
16794 else
16795   ac_cv_header_stdc=no
16796 fi
16797 rm -rf conftest*
16798
16799 fi
16800
16801 if test $ac_cv_header_stdc = yes; then
16802   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16803   cat >conftest.$ac_ext <<_ACEOF
16804 #line 16804 "configure"
16805 #include "confdefs.h"
16806 #include <stdlib.h>
16807
16808 _ACEOF
16809 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16810   egrep "free" >/dev/null 2>&1; then
16811   :
16812 else
16813   ac_cv_header_stdc=no
16814 fi
16815 rm -rf conftest*
16816
16817 fi
16818
16819 if test $ac_cv_header_stdc = yes; then
16820   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16821   if test "$cross_compiling" = yes; then
16822   :
16823 else
16824   cat >conftest.$ac_ext <<_ACEOF
16825 #line 16825 "configure"
16826 #include "confdefs.h"
16827 #include <ctype.h>
16828 #if ((' ' & 0x0FF) == 0x020)
16829 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16830 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16831 #else
16832 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16833                      || ('j' <= (c) && (c) <= 'r') \
16834                      || ('s' <= (c) && (c) <= 'z'))
16835 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16836 #endif
16837
16838 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16839 int
16840 main (void)
16841 {
16842   int i;
16843   for (i = 0; i < 256; i++)
16844     if (XOR (islower (i), ISLOWER (i))
16845         || toupper (i) != TOUPPER (i))
16846       $ac_main_return(2);
16847   $ac_main_return (0);
16848 }
16849 _ACEOF
16850 rm -f conftest$ac_exeext
16851 if { (eval echo "$as_me:16851: \"$ac_link\"") >&5
16852   (eval $ac_link) 2>&5
16853   ac_status=$?
16854   echo "$as_me:16854: \$? = $ac_status" >&5
16855   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16856   { (eval echo "$as_me:16856: \"$ac_try\"") >&5
16857   (eval $ac_try) 2>&5
16858   ac_status=$?
16859   echo "$as_me:16859: \$? = $ac_status" >&5
16860   (exit $ac_status); }; }; then
16861   :
16862 else
16863   echo "$as_me: program exited with status $ac_status" >&5
16864 echo "$as_me: failed program was:" >&5
16865 cat conftest.$ac_ext >&5
16866 ac_cv_header_stdc=no
16867 fi
16868 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16869 fi
16870 fi
16871 fi
16872 echo "$as_me:16872: result: $ac_cv_header_stdc" >&5
16873 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16874 if test $ac_cv_header_stdc = yes; then
16875
16876 cat >>confdefs.h <<\EOF
16877 #define STDC_HEADERS 1
16878 EOF
16879
16880 fi
16881
16882 echo "$as_me:16882: checking whether time.h and sys/time.h may both be included" >&5
16883 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16884 if test "${ac_cv_header_time+set}" = set; then
16885   echo $ECHO_N "(cached) $ECHO_C" >&6
16886 else
16887   cat >conftest.$ac_ext <<_ACEOF
16888 #line 16888 "configure"
16889 #include "confdefs.h"
16890 #include <sys/types.h>
16891 #include <sys/time.h>
16892 #include <time.h>
16893
16894 int
16895 main (void)
16896 {
16897 if ((struct tm *) 0)
16898 return 0;
16899   ;
16900   return 0;
16901 }
16902 _ACEOF
16903 rm -f conftest.$ac_objext
16904 if { (eval echo "$as_me:16904: \"$ac_compile\"") >&5
16905   (eval $ac_compile) 2>&5
16906   ac_status=$?
16907   echo "$as_me:16907: \$? = $ac_status" >&5
16908   (exit $ac_status); } &&
16909          { ac_try='test -s conftest.$ac_objext'
16910   { (eval echo "$as_me:16910: \"$ac_try\"") >&5
16911   (eval $ac_try) 2>&5
16912   ac_status=$?
16913   echo "$as_me:16913: \$? = $ac_status" >&5
16914   (exit $ac_status); }; }; then
16915   ac_cv_header_time=yes
16916 else
16917   echo "$as_me: failed program was:" >&5
16918 cat conftest.$ac_ext >&5
16919 ac_cv_header_time=no
16920 fi
16921 rm -f conftest.$ac_objext conftest.$ac_ext
16922 fi
16923 echo "$as_me:16923: result: $ac_cv_header_time" >&5
16924 echo "${ECHO_T}$ac_cv_header_time" >&6
16925 if test $ac_cv_header_time = yes; then
16926
16927 cat >>confdefs.h <<\EOF
16928 #define TIME_WITH_SYS_TIME 1
16929 EOF
16930
16931 fi
16932
16933 for ac_header in \
16934 getopt.h \
16935 locale.h \
16936 math.h \
16937 stdarg.h \
16938 stdint.h \
16939 sys/ioctl.h \
16940 sys/select.h \
16941 sys/time.h \
16942 termios.h \
16943 unistd.h \
16944
16945 do
16946 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16947 echo "$as_me:16947: checking for $ac_header" >&5
16948 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16949 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16950   echo $ECHO_N "(cached) $ECHO_C" >&6
16951 else
16952   cat >conftest.$ac_ext <<_ACEOF
16953 #line 16953 "configure"
16954 #include "confdefs.h"
16955 #include <$ac_header>
16956 _ACEOF
16957 if { (eval echo "$as_me:16957: \"$ac_cpp conftest.$ac_ext\"") >&5
16958   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16959   ac_status=$?
16960   egrep -v '^ *\+' conftest.er1 >conftest.err
16961   rm -f conftest.er1
16962   cat conftest.err >&5
16963   echo "$as_me:16963: \$? = $ac_status" >&5
16964   (exit $ac_status); } >/dev/null; then
16965   if test -s conftest.err; then
16966     ac_cpp_err=$ac_c_preproc_warn_flag
16967   else
16968     ac_cpp_err=
16969   fi
16970 else
16971   ac_cpp_err=yes
16972 fi
16973 if test -z "$ac_cpp_err"; then
16974   eval "$as_ac_Header=yes"
16975 else
16976   echo "$as_me: failed program was:" >&5
16977   cat conftest.$ac_ext >&5
16978   eval "$as_ac_Header=no"
16979 fi
16980 rm -f conftest.err conftest.$ac_ext
16981 fi
16982 echo "$as_me:16982: result: `eval echo '${'$as_ac_Header'}'`" >&5
16983 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16984 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16985   cat >>confdefs.h <<EOF
16986 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16987 EOF
16988
16989 fi
16990 done
16991
16992 for ac_header in unistd.h getopt.h
16993 do
16994 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16995 echo "$as_me:16995: checking for $ac_header" >&5
16996 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16997 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16998   echo $ECHO_N "(cached) $ECHO_C" >&6
16999 else
17000   cat >conftest.$ac_ext <<_ACEOF
17001 #line 17001 "configure"
17002 #include "confdefs.h"
17003 #include <$ac_header>
17004 _ACEOF
17005 if { (eval echo "$as_me:17005: \"$ac_cpp conftest.$ac_ext\"") >&5
17006   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17007   ac_status=$?
17008   egrep -v '^ *\+' conftest.er1 >conftest.err
17009   rm -f conftest.er1
17010   cat conftest.err >&5
17011   echo "$as_me:17011: \$? = $ac_status" >&5
17012   (exit $ac_status); } >/dev/null; then
17013   if test -s conftest.err; then
17014     ac_cpp_err=$ac_c_preproc_warn_flag
17015   else
17016     ac_cpp_err=
17017   fi
17018 else
17019   ac_cpp_err=yes
17020 fi
17021 if test -z "$ac_cpp_err"; then
17022   eval "$as_ac_Header=yes"
17023 else
17024   echo "$as_me: failed program was:" >&5
17025   cat conftest.$ac_ext >&5
17026   eval "$as_ac_Header=no"
17027 fi
17028 rm -f conftest.err conftest.$ac_ext
17029 fi
17030 echo "$as_me:17030: result: `eval echo '${'$as_ac_Header'}'`" >&5
17031 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17032 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17033   cat >>confdefs.h <<EOF
17034 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17035 EOF
17036
17037 fi
17038 done
17039
17040 echo "$as_me:17040: checking for header declaring getopt variables" >&5
17041 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17042 if test "${cf_cv_getopt_header+set}" = set; then
17043   echo $ECHO_N "(cached) $ECHO_C" >&6
17044 else
17045
17046 cf_cv_getopt_header=none
17047 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17048 do
17049 cat >conftest.$ac_ext <<_ACEOF
17050 #line 17050 "configure"
17051 #include "confdefs.h"
17052
17053 #include <$cf_header>
17054 int
17055 main (void)
17056 {
17057 int x = optind; char *y = optarg
17058   ;
17059   return 0;
17060 }
17061 _ACEOF
17062 rm -f conftest.$ac_objext
17063 if { (eval echo "$as_me:17063: \"$ac_compile\"") >&5
17064   (eval $ac_compile) 2>&5
17065   ac_status=$?
17066   echo "$as_me:17066: \$? = $ac_status" >&5
17067   (exit $ac_status); } &&
17068          { ac_try='test -s conftest.$ac_objext'
17069   { (eval echo "$as_me:17069: \"$ac_try\"") >&5
17070   (eval $ac_try) 2>&5
17071   ac_status=$?
17072   echo "$as_me:17072: \$? = $ac_status" >&5
17073   (exit $ac_status); }; }; then
17074   cf_cv_getopt_header=$cf_header
17075  break
17076 else
17077   echo "$as_me: failed program was:" >&5
17078 cat conftest.$ac_ext >&5
17079 fi
17080 rm -f conftest.$ac_objext conftest.$ac_ext
17081 done
17082
17083 fi
17084 echo "$as_me:17084: result: $cf_cv_getopt_header" >&5
17085 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17086 if test $cf_cv_getopt_header != none ; then
17087
17088 cat >>confdefs.h <<\EOF
17089 #define HAVE_GETOPT_HEADER 1
17090 EOF
17091
17092 fi
17093 if test $cf_cv_getopt_header = getopt.h ; then
17094
17095 cat >>confdefs.h <<\EOF
17096 #define NEED_GETOPT_H 1
17097 EOF
17098
17099 fi
17100
17101 for ac_func in \
17102 getopt \
17103 gettimeofday \
17104 strstr \
17105 tsearch \
17106
17107 do
17108 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17109 echo "$as_me:17109: checking for $ac_func" >&5
17110 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17111 if eval "test \"\${$as_ac_var+set}\" = set"; then
17112   echo $ECHO_N "(cached) $ECHO_C" >&6
17113 else
17114   cat >conftest.$ac_ext <<_ACEOF
17115 #line 17115 "configure"
17116 #include "confdefs.h"
17117 #define $ac_func autoconf_temporary
17118 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17119 #undef $ac_func
17120
17121 #ifdef __cplusplus
17122 extern "C"
17123 #endif
17124
17125 /* We use char because int might match the return type of a gcc2
17126    builtin and then its argument prototype would still apply.  */
17127 char $ac_func (void);
17128
17129 int
17130 main (void)
17131 {
17132
17133 /* The GNU C library defines stubs for functions which it implements
17134     to always fail with ENOSYS.  Some functions are actually named
17135     something starting with __ and the normal name is an alias.  */
17136 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17137 #error found stub for $ac_func
17138 #endif
17139
17140         return $ac_func ();
17141   ;
17142   return 0;
17143 }
17144 _ACEOF
17145 rm -f conftest.$ac_objext conftest$ac_exeext
17146 if { (eval echo "$as_me:17146: \"$ac_link\"") >&5
17147   (eval $ac_link) 2>&5
17148   ac_status=$?
17149   echo "$as_me:17149: \$? = $ac_status" >&5
17150   (exit $ac_status); } &&
17151          { ac_try='test -s conftest$ac_exeext'
17152   { (eval echo "$as_me:17152: \"$ac_try\"") >&5
17153   (eval $ac_try) 2>&5
17154   ac_status=$?
17155   echo "$as_me:17155: \$? = $ac_status" >&5
17156   (exit $ac_status); }; }; then
17157   eval "$as_ac_var=yes"
17158 else
17159   echo "$as_me: failed program was:" >&5
17160 cat conftest.$ac_ext >&5
17161 eval "$as_ac_var=no"
17162 fi
17163 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17164 fi
17165 echo "$as_me:17165: result: `eval echo '${'$as_ac_var'}'`" >&5
17166 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17167 if test `eval echo '${'$as_ac_var'}'` = yes; then
17168   cat >>confdefs.h <<EOF
17169 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17170 EOF
17171
17172 fi
17173 done
17174
17175 # use a compile-check to work with ncurses*-config and subdirectory includes
17176 echo "$as_me:17176: checking if we can use termcap.h" >&5
17177 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17178 if test "${cf_cv_have_termcap_h+set}" = set; then
17179   echo $ECHO_N "(cached) $ECHO_C" >&6
17180 else
17181
17182         cat >conftest.$ac_ext <<_ACEOF
17183 #line 17183 "configure"
17184 #include "confdefs.h"
17185
17186 #include <curses.h>
17187 #ifdef NCURSES_VERSION
17188 #undef NCURSES_VERSION
17189 #endif
17190 #include <termcap.h>
17191 #ifndef NCURSES_VERSION
17192 #error wrong header
17193 #endif
17194
17195 int
17196 main (void)
17197 {
17198 return 0;
17199   ;
17200   return 0;
17201 }
17202 _ACEOF
17203 rm -f conftest.$ac_objext
17204 if { (eval echo "$as_me:17204: \"$ac_compile\"") >&5
17205   (eval $ac_compile) 2>&5
17206   ac_status=$?
17207   echo "$as_me:17207: \$? = $ac_status" >&5
17208   (exit $ac_status); } &&
17209          { ac_try='test -s conftest.$ac_objext'
17210   { (eval echo "$as_me:17210: \"$ac_try\"") >&5
17211   (eval $ac_try) 2>&5
17212   ac_status=$?
17213   echo "$as_me:17213: \$? = $ac_status" >&5
17214   (exit $ac_status); }; }; then
17215   cf_cv_have_termcap_h=yes
17216 else
17217   echo "$as_me: failed program was:" >&5
17218 cat conftest.$ac_ext >&5
17219 cf_cv_have_termcap_h=no
17220 fi
17221 rm -f conftest.$ac_objext conftest.$ac_ext
17222 fi
17223 echo "$as_me:17223: result: $cf_cv_have_termcap_h" >&5
17224 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17225 if test "x$cf_cv_have_termcap_h" = xyes
17226 then
17227
17228 cat >>confdefs.h <<\EOF
17229 #define HAVE_TERMCAP_H 1
17230 EOF
17231
17232 else
17233 echo "$as_me:17233: checking if we can use ncurses/termcap.h" >&5
17234 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17235 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17236   echo $ECHO_N "(cached) $ECHO_C" >&6
17237 else
17238
17239         cat >conftest.$ac_ext <<_ACEOF
17240 #line 17240 "configure"
17241 #include "confdefs.h"
17242
17243 #include <ncurses/curses.h>
17244 #ifdef NCURSES_VERSION
17245 #undef NCURSES_VERSION
17246 #endif
17247 #include <ncurses/termcap.h>
17248 #ifndef NCURSES_VERSION
17249 #error wrong header
17250 #endif
17251
17252 int
17253 main (void)
17254 {
17255 return 0;
17256   ;
17257   return 0;
17258 }
17259 _ACEOF
17260 rm -f conftest.$ac_objext
17261 if { (eval echo "$as_me:17261: \"$ac_compile\"") >&5
17262   (eval $ac_compile) 2>&5
17263   ac_status=$?
17264   echo "$as_me:17264: \$? = $ac_status" >&5
17265   (exit $ac_status); } &&
17266          { ac_try='test -s conftest.$ac_objext'
17267   { (eval echo "$as_me:17267: \"$ac_try\"") >&5
17268   (eval $ac_try) 2>&5
17269   ac_status=$?
17270   echo "$as_me:17270: \$? = $ac_status" >&5
17271   (exit $ac_status); }; }; then
17272   cf_cv_have_ncurses_termcap_h=yes
17273 else
17274   echo "$as_me: failed program was:" >&5
17275 cat conftest.$ac_ext >&5
17276 cf_cv_have_ncurses_termcap_h=no
17277 fi
17278 rm -f conftest.$ac_objext conftest.$ac_ext
17279 fi
17280 echo "$as_me:17280: result: $cf_cv_have_ncurses_termcap_h" >&5
17281 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17282 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
17283 cat >>confdefs.h <<\EOF
17284 #define HAVE_NCURSES_TERMCAP_H 1
17285 EOF
17286
17287 fi
17288
17289 if test "x$ac_cv_func_getopt" = xno; then
17290         { { echo "$as_me:17290: error: getopt is required for building programs" >&5
17291 echo "$as_me: error: getopt is required for building programs" >&2;}
17292    { (exit 1); exit 1; }; }
17293 fi
17294
17295 if test "$cf_enable_widec" = yes; then
17296
17297 for ac_func in \
17298 mblen \
17299 mbrlen \
17300 mbrtowc \
17301 mbsrtowcs \
17302 mbstowcs \
17303 mbtowc \
17304 wcsrtombs \
17305 wcstombs \
17306
17307 do
17308 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17309 echo "$as_me:17309: checking for $ac_func" >&5
17310 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17311 if eval "test \"\${$as_ac_var+set}\" = set"; then
17312   echo $ECHO_N "(cached) $ECHO_C" >&6
17313 else
17314   cat >conftest.$ac_ext <<_ACEOF
17315 #line 17315 "configure"
17316 #include "confdefs.h"
17317 #define $ac_func autoconf_temporary
17318 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17319 #undef $ac_func
17320
17321 #ifdef __cplusplus
17322 extern "C"
17323 #endif
17324
17325 /* We use char because int might match the return type of a gcc2
17326    builtin and then its argument prototype would still apply.  */
17327 char $ac_func (void);
17328
17329 int
17330 main (void)
17331 {
17332
17333 /* The GNU C library defines stubs for functions which it implements
17334     to always fail with ENOSYS.  Some functions are actually named
17335     something starting with __ and the normal name is an alias.  */
17336 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17337 #error found stub for $ac_func
17338 #endif
17339
17340         return $ac_func ();
17341   ;
17342   return 0;
17343 }
17344 _ACEOF
17345 rm -f conftest.$ac_objext conftest$ac_exeext
17346 if { (eval echo "$as_me:17346: \"$ac_link\"") >&5
17347   (eval $ac_link) 2>&5
17348   ac_status=$?
17349   echo "$as_me:17349: \$? = $ac_status" >&5
17350   (exit $ac_status); } &&
17351          { ac_try='test -s conftest$ac_exeext'
17352   { (eval echo "$as_me:17352: \"$ac_try\"") >&5
17353   (eval $ac_try) 2>&5
17354   ac_status=$?
17355   echo "$as_me:17355: \$? = $ac_status" >&5
17356   (exit $ac_status); }; }; then
17357   eval "$as_ac_var=yes"
17358 else
17359   echo "$as_me: failed program was:" >&5
17360 cat conftest.$ac_ext >&5
17361 eval "$as_ac_var=no"
17362 fi
17363 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17364 fi
17365 echo "$as_me:17365: result: `eval echo '${'$as_ac_var'}'`" >&5
17366 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17367 if test `eval echo '${'$as_ac_var'}'` = yes; then
17368   cat >>confdefs.h <<EOF
17369 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17370 EOF
17371
17372 fi
17373 done
17374
17375 fi
17376
17377 echo "$as_me:17377: checking definition to turn on extended curses functions" >&5
17378 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17379 if test "${cf_cv_need_xopen_extension+set}" = set; then
17380   echo $ECHO_N "(cached) $ECHO_C" >&6
17381 else
17382
17383 cf_cv_need_xopen_extension=unknown
17384 cat >conftest.$ac_ext <<_ACEOF
17385 #line 17385 "configure"
17386 #include "confdefs.h"
17387
17388 #include <stdlib.h>
17389 #include <${cf_cv_ncurses_header:-curses.h}>
17390 int
17391 main (void)
17392 {
17393
17394 #if defined(NCURSES_VERSION_PATCH)
17395 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17396         make an error
17397 #endif
17398 #endif
17399 #ifdef NCURSES_VERSION
17400         cchar_t check;
17401         int check2 = curs_set((int)sizeof(check));
17402 #endif
17403         long x = winnstr(stdscr, "", 0);
17404         int x1, y1;
17405         getbegyx(stdscr, y1, x1)
17406   ;
17407   return 0;
17408 }
17409 _ACEOF
17410 rm -f conftest.$ac_objext conftest$ac_exeext
17411 if { (eval echo "$as_me:17411: \"$ac_link\"") >&5
17412   (eval $ac_link) 2>&5
17413   ac_status=$?
17414   echo "$as_me:17414: \$? = $ac_status" >&5
17415   (exit $ac_status); } &&
17416          { ac_try='test -s conftest$ac_exeext'
17417   { (eval echo "$as_me:17417: \"$ac_try\"") >&5
17418   (eval $ac_try) 2>&5
17419   ac_status=$?
17420   echo "$as_me:17420: \$? = $ac_status" >&5
17421   (exit $ac_status); }; }; then
17422   cf_cv_need_xopen_extension=none
17423 else
17424   echo "$as_me: failed program was:" >&5
17425 cat conftest.$ac_ext >&5
17426
17427         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17428         do
17429                 cat >conftest.$ac_ext <<_ACEOF
17430 #line 17430 "configure"
17431 #include "confdefs.h"
17432
17433 #define $cf_try_xopen_extension 1
17434 #include <stdlib.h>
17435 #include <${cf_cv_ncurses_header:-curses.h}>
17436 int
17437 main (void)
17438 {
17439
17440 #ifdef NCURSES_VERSION
17441                 cchar_t check;
17442                 int check2 = curs_set((int)sizeof(check));
17443 #endif
17444                 long x = winnstr(stdscr, "", 0);
17445                 int x1, y1;
17446                 getbegyx(stdscr, y1, x1)
17447   ;
17448   return 0;
17449 }
17450 _ACEOF
17451 rm -f conftest.$ac_objext conftest$ac_exeext
17452 if { (eval echo "$as_me:17452: \"$ac_link\"") >&5
17453   (eval $ac_link) 2>&5
17454   ac_status=$?
17455   echo "$as_me:17455: \$? = $ac_status" >&5
17456   (exit $ac_status); } &&
17457          { ac_try='test -s conftest$ac_exeext'
17458   { (eval echo "$as_me:17458: \"$ac_try\"") >&5
17459   (eval $ac_try) 2>&5
17460   ac_status=$?
17461   echo "$as_me:17461: \$? = $ac_status" >&5
17462   (exit $ac_status); }; }; then
17463   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17464 else
17465   echo "$as_me: failed program was:" >&5
17466 cat conftest.$ac_ext >&5
17467 fi
17468 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17469         done
17470
17471 fi
17472 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17473
17474 fi
17475 echo "$as_me:17475: result: $cf_cv_need_xopen_extension" >&5
17476 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17477
17478 case $cf_cv_need_xopen_extension in
17479 (*_*)
17480
17481         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17482         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17483
17484         ;;
17485 esac
17486
17487 echo "$as_me:17487: checking for term.h" >&5
17488 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17489 if test "${cf_cv_term_header+set}" = set; then
17490   echo $ECHO_N "(cached) $ECHO_C" >&6
17491 else
17492
17493 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17494 # for <term.h> if we do not find the variant.
17495
17496 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17497
17498 case ${cf_cv_ncurses_header:-curses.h} in
17499 (*/*)
17500         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17501         cf_header_list="$cf_header_item $cf_header_list"
17502         ;;
17503 esac
17504
17505 for cf_header in $cf_header_list
17506 do
17507         cat >conftest.$ac_ext <<_ACEOF
17508 #line 17508 "configure"
17509 #include "confdefs.h"
17510
17511 #include <${cf_cv_ncurses_header:-curses.h}>
17512 #include <${cf_header}>
17513 int
17514 main (void)
17515 {
17516 WINDOW *x
17517   ;
17518   return 0;
17519 }
17520 _ACEOF
17521 rm -f conftest.$ac_objext
17522 if { (eval echo "$as_me:17522: \"$ac_compile\"") >&5
17523   (eval $ac_compile) 2>&5
17524   ac_status=$?
17525   echo "$as_me:17525: \$? = $ac_status" >&5
17526   (exit $ac_status); } &&
17527          { ac_try='test -s conftest.$ac_objext'
17528   { (eval echo "$as_me:17528: \"$ac_try\"") >&5
17529   (eval $ac_try) 2>&5
17530   ac_status=$?
17531   echo "$as_me:17531: \$? = $ac_status" >&5
17532   (exit $ac_status); }; }; then
17533   cf_cv_term_header=$cf_header
17534          break
17535 else
17536   echo "$as_me: failed program was:" >&5
17537 cat conftest.$ac_ext >&5
17538 cf_cv_term_header=no
17539 fi
17540 rm -f conftest.$ac_objext conftest.$ac_ext
17541 done
17542
17543 case $cf_cv_term_header in
17544 (no)
17545         # If curses is ncurses, some packagers still mess it up by trying to make
17546         # us use GNU termcap.  This handles the most common case.
17547         for cf_header in ncurses/term.h ncursesw/term.h
17548         do
17549                 cat >conftest.$ac_ext <<_ACEOF
17550 #line 17550 "configure"
17551 #include "confdefs.h"
17552
17553 #include <${cf_cv_ncurses_header:-curses.h}>
17554 #ifdef NCURSES_VERSION
17555 #include <${cf_header}>
17556 #else
17557 make an error
17558 #endif
17559 int
17560 main (void)
17561 {
17562 WINDOW *x
17563   ;
17564   return 0;
17565 }
17566 _ACEOF
17567 rm -f conftest.$ac_objext
17568 if { (eval echo "$as_me:17568: \"$ac_compile\"") >&5
17569   (eval $ac_compile) 2>&5
17570   ac_status=$?
17571   echo "$as_me:17571: \$? = $ac_status" >&5
17572   (exit $ac_status); } &&
17573          { ac_try='test -s conftest.$ac_objext'
17574   { (eval echo "$as_me:17574: \"$ac_try\"") >&5
17575   (eval $ac_try) 2>&5
17576   ac_status=$?
17577   echo "$as_me:17577: \$? = $ac_status" >&5
17578   (exit $ac_status); }; }; then
17579   cf_cv_term_header=$cf_header
17580                          break
17581 else
17582   echo "$as_me: failed program was:" >&5
17583 cat conftest.$ac_ext >&5
17584 cf_cv_term_header=no
17585 fi
17586 rm -f conftest.$ac_objext conftest.$ac_ext
17587         done
17588         ;;
17589 esac
17590
17591 fi
17592 echo "$as_me:17592: result: $cf_cv_term_header" >&5
17593 echo "${ECHO_T}$cf_cv_term_header" >&6
17594
17595 case $cf_cv_term_header in
17596 (term.h)
17597
17598 cat >>confdefs.h <<\EOF
17599 #define HAVE_TERM_H 1
17600 EOF
17601
17602         ;;
17603 (ncurses/term.h)
17604
17605 cat >>confdefs.h <<\EOF
17606 #define HAVE_NCURSES_TERM_H 1
17607 EOF
17608
17609         ;;
17610 (ncursesw/term.h)
17611
17612 cat >>confdefs.h <<\EOF
17613 #define HAVE_NCURSESW_TERM_H 1
17614 EOF
17615
17616         ;;
17617 esac
17618
17619 echo "$as_me:17619: checking for unctrl.h" >&5
17620 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
17621 if test "${cf_cv_unctrl_header+set}" = set; then
17622   echo $ECHO_N "(cached) $ECHO_C" >&6
17623 else
17624
17625 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
17626 # for <unctrl.h> if we do not find the variant.
17627
17628 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
17629
17630 case ${cf_cv_ncurses_header:-curses.h} in
17631 (*/*)
17632         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
17633         cf_header_list="$cf_header_item $cf_header_list"
17634         ;;
17635 esac
17636
17637 for cf_header in $cf_header_list
17638 do
17639         cat >conftest.$ac_ext <<_ACEOF
17640 #line 17640 "configure"
17641 #include "confdefs.h"
17642
17643 #include <${cf_cv_ncurses_header:-curses.h}>
17644 #include <${cf_header}>
17645 int
17646 main (void)
17647 {
17648 WINDOW *x
17649   ;
17650   return 0;
17651 }
17652 _ACEOF
17653 rm -f conftest.$ac_objext
17654 if { (eval echo "$as_me:17654: \"$ac_compile\"") >&5
17655   (eval $ac_compile) 2>&5
17656   ac_status=$?
17657   echo "$as_me:17657: \$? = $ac_status" >&5
17658   (exit $ac_status); } &&
17659          { ac_try='test -s conftest.$ac_objext'
17660   { (eval echo "$as_me:17660: \"$ac_try\"") >&5
17661   (eval $ac_try) 2>&5
17662   ac_status=$?
17663   echo "$as_me:17663: \$? = $ac_status" >&5
17664   (exit $ac_status); }; }; then
17665   cf_cv_unctrl_header=$cf_header
17666          break
17667 else
17668   echo "$as_me: failed program was:" >&5
17669 cat conftest.$ac_ext >&5
17670 cf_cv_unctrl_header=no
17671 fi
17672 rm -f conftest.$ac_objext conftest.$ac_ext
17673 done
17674
17675 fi
17676 echo "$as_me:17676: result: $cf_cv_unctrl_header" >&5
17677 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
17678
17679 case $cf_cv_unctrl_header in
17680 (no)
17681         { echo "$as_me:17681: WARNING: unctrl.h header not found" >&5
17682 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
17683         ;;
17684 esac
17685
17686 case $cf_cv_unctrl_header in
17687 (unctrl.h)
17688
17689 cat >>confdefs.h <<\EOF
17690 #define HAVE_UNCTRL_H 1
17691 EOF
17692
17693         ;;
17694 (ncurses/unctrl.h)
17695
17696 cat >>confdefs.h <<\EOF
17697 #define HAVE_NCURSES_UNCTRL_H 1
17698 EOF
17699
17700         ;;
17701 (ncursesw/unctrl.h)
17702
17703 cat >>confdefs.h <<\EOF
17704 #define HAVE_NCURSESW_UNCTRL_H 1
17705 EOF
17706
17707         ;;
17708 esac
17709
17710 for cf_func in \
17711 alloc_pair \
17712 assume_default_colors \
17713 chgat \
17714 color_content \
17715 color_set \
17716 copywin \
17717 delscreen \
17718 dupwin \
17719 filter \
17720 getbegx \
17721 getcurx \
17722 getmaxx \
17723 getnstr \
17724 getparx \
17725 getwin \
17726 halfdelay \
17727 init_extended_color \
17728 mvderwin \
17729 mvvline \
17730 mvwin \
17731 mvwvline \
17732 napms \
17733 newpad \
17734 putwin \
17735 reset_color_pairs \
17736 resize_term \
17737 resizeterm \
17738 restartterm \
17739 ripoffline \
17740 scr_dump \
17741 setupterm \
17742 slk_color \
17743 slk_init \
17744 termattrs \
17745 tgetent \
17746 tigetnum \
17747 tigetstr \
17748 tputs_sp \
17749 typeahead \
17750 use_default_colors \
17751 use_env \
17752 use_extended_names \
17753 use_screen \
17754 use_window \
17755 vid_puts \
17756 vidputs \
17757 vsscanf \
17758 vw_printw \
17759 wchgat \
17760 winsdelln \
17761 winsstr \
17762 wresize \
17763 wsyncdown \
17764 _tracef \
17765
17766 do
17767
17768 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17769
17770         echo "$as_me:17770: checking for ${cf_func}" >&5
17771 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17772
17773 echo "${as_me:-configure}:17773: testing ${cf_func} ..." 1>&5
17774
17775         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17776   echo $ECHO_N "(cached) $ECHO_C" >&6
17777 else
17778
17779                 eval cf_result='$ac_cv_func_'$cf_func
17780                 if test ".$cf_result" != ".no"; then
17781                         cat >conftest.$ac_ext <<_ACEOF
17782 #line 17782 "configure"
17783 #include "confdefs.h"
17784
17785 #ifdef HAVE_XCURSES
17786 #include <xcurses.h>
17787 char * XCursesProgramName = "test";
17788 #else
17789 #include <${cf_cv_ncurses_header:-curses.h}>
17790 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17791 #include <ncursesw/term.h>
17792 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17793 #include <ncurses/term.h>
17794 #elif defined(HAVE_TERM_H)
17795 #include <term.h>
17796 #endif
17797 #endif
17798
17799 int
17800 main (void)
17801 {
17802
17803 #ifndef ${cf_func}
17804 long foo = (long)(&${cf_func});
17805 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17806 if (foo + 1234L > 5678L)
17807         ${cf_cv_main_return:-return}(foo != 0);
17808 #endif
17809
17810   ;
17811   return 0;
17812 }
17813 _ACEOF
17814 rm -f conftest.$ac_objext conftest$ac_exeext
17815 if { (eval echo "$as_me:17815: \"$ac_link\"") >&5
17816   (eval $ac_link) 2>&5
17817   ac_status=$?
17818   echo "$as_me:17818: \$? = $ac_status" >&5
17819   (exit $ac_status); } &&
17820          { ac_try='test -s conftest$ac_exeext'
17821   { (eval echo "$as_me:17821: \"$ac_try\"") >&5
17822   (eval $ac_try) 2>&5
17823   ac_status=$?
17824   echo "$as_me:17824: \$? = $ac_status" >&5
17825   (exit $ac_status); }; }; then
17826   cf_result=yes
17827 else
17828   echo "$as_me: failed program was:" >&5
17829 cat conftest.$ac_ext >&5
17830 cf_result=no
17831 fi
17832 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17833                 fi
17834                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17835
17836 fi
17837
17838         # use the computed/retrieved cache-value:
17839         eval 'cf_result=$cf_cv_func_'$cf_func
17840         echo "$as_me:17840: result: $cf_result" >&5
17841 echo "${ECHO_T}$cf_result" >&6
17842         if test $cf_result != no; then
17843                 cat >>confdefs.h <<EOF
17844 #define HAVE_${cf_tr_func} 1
17845 EOF
17846
17847         fi
17848 done
17849
17850 for cf_func in tputs
17851 do
17852
17853 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17854
17855         echo "$as_me:17855: checking for ${cf_func}" >&5
17856 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17857
17858 echo "${as_me:-configure}:17858: testing ${cf_func} ..." 1>&5
17859
17860         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17861   echo $ECHO_N "(cached) $ECHO_C" >&6
17862 else
17863
17864                 eval cf_result='$ac_cv_func_'$cf_func
17865                 if test ".$cf_result" != ".no"; then
17866                         cat >conftest.$ac_ext <<_ACEOF
17867 #line 17867 "configure"
17868 #include "confdefs.h"
17869
17870 #ifdef HAVE_XCURSES
17871 #include <xcurses.h>
17872 char * XCursesProgramName = "test";
17873 #else
17874 #include <${cf_cv_ncurses_header:-curses.h}>
17875 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17876 #include <ncursesw/term.h>
17877 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17878 #include <ncurses/term.h>
17879 #elif defined(HAVE_TERM_H)
17880 #include <term.h>
17881 #endif
17882 #endif
17883
17884 int
17885 main (void)
17886 {
17887
17888 #ifndef ${cf_func}
17889 long foo = (long)(&${cf_func});
17890 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17891 if (foo + 1234L > 5678L)
17892         ${cf_cv_main_return:-return}(foo != 0);
17893 #endif
17894
17895   ;
17896   return 0;
17897 }
17898 _ACEOF
17899 rm -f conftest.$ac_objext conftest$ac_exeext
17900 if { (eval echo "$as_me:17900: \"$ac_link\"") >&5
17901   (eval $ac_link) 2>&5
17902   ac_status=$?
17903   echo "$as_me:17903: \$? = $ac_status" >&5
17904   (exit $ac_status); } &&
17905          { ac_try='test -s conftest$ac_exeext'
17906   { (eval echo "$as_me:17906: \"$ac_try\"") >&5
17907   (eval $ac_try) 2>&5
17908   ac_status=$?
17909   echo "$as_me:17909: \$? = $ac_status" >&5
17910   (exit $ac_status); }; }; then
17911   cf_result=yes
17912 else
17913   echo "$as_me: failed program was:" >&5
17914 cat conftest.$ac_ext >&5
17915 cf_result=no
17916 fi
17917 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17918                 fi
17919                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17920
17921 fi
17922
17923         # use the computed/retrieved cache-value:
17924         eval 'cf_result=$cf_cv_func_'$cf_func
17925         echo "$as_me:17925: result: $cf_result" >&5
17926 echo "${ECHO_T}$cf_result" >&6
17927         if test $cf_result != no; then
17928                 cat >>confdefs.h <<EOF
17929 #define HAVE_${cf_tr_func} 1
17930 EOF
17931
17932         fi
17933 done
17934
17935 if test x$cf_cv_func_tputs = xyes
17936 then
17937         cf_done=no
17938         for cf_arg in int char
17939         do
17940                 for cf_ret in int void
17941                 do
17942                         if test $cf_ret = void
17943                         then
17944                                 cf_return="/* nothing */"
17945                         else
17946                                 cf_return="return value"
17947                         fi
17948                         cat >conftest.$ac_ext <<_ACEOF
17949 #line 17949 "configure"
17950 #include "confdefs.h"
17951
17952 #include <${cf_cv_ncurses_header:-curses.h}>
17953 #include <$cf_cv_term_header>
17954
17955 static $cf_ret outc($cf_arg value) { $cf_return; }
17956
17957 int
17958 main (void)
17959 {
17960
17961         tputs("hello", 0, outc);
17962         ${cf_cv_main_return:-return}(0);
17963
17964   ;
17965   return 0;
17966 }
17967 _ACEOF
17968 rm -f conftest.$ac_objext
17969 if { (eval echo "$as_me:17969: \"$ac_compile\"") >&5
17970   (eval $ac_compile) 2>&5
17971   ac_status=$?
17972   echo "$as_me:17972: \$? = $ac_status" >&5
17973   (exit $ac_status); } &&
17974          { ac_try='test -s conftest.$ac_objext'
17975   { (eval echo "$as_me:17975: \"$ac_try\"") >&5
17976   (eval $ac_try) 2>&5
17977   ac_status=$?
17978   echo "$as_me:17978: \$? = $ac_status" >&5
17979   (exit $ac_status); }; }; then
17980
17981                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
17982
17983 echo "${as_me:-configure}:17983: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
17984
17985                 cat >>confdefs.h <<EOF
17986 #define TPUTS_ARG               $cf_arg
17987 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
17988 #define TPUTS_RETURN(value)     $cf_return
17989 EOF
17990                 cf_done=yes
17991                 break
17992
17993 else
17994   echo "$as_me: failed program was:" >&5
17995 cat conftest.$ac_ext >&5
17996 fi
17997 rm -f conftest.$ac_objext conftest.$ac_ext
17998                 done
17999                 test $cf_done = yes && break
18000         done
18001 fi
18002
18003 echo "$as_me:18003: checking for ncurses extended functions" >&5
18004 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18005 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18006   echo $ECHO_N "(cached) $ECHO_C" >&6
18007 else
18008
18009 cat >conftest.$ac_ext <<_ACEOF
18010 #line 18010 "configure"
18011 #include "confdefs.h"
18012
18013 #include <${cf_cv_ncurses_header:-curses.h}>
18014 int
18015 main (void)
18016 {
18017
18018 int x = NCURSES_EXT_FUNCS
18019
18020   ;
18021   return 0;
18022 }
18023 _ACEOF
18024 rm -f conftest.$ac_objext
18025 if { (eval echo "$as_me:18025: \"$ac_compile\"") >&5
18026   (eval $ac_compile) 2>&5
18027   ac_status=$?
18028   echo "$as_me:18028: \$? = $ac_status" >&5
18029   (exit $ac_status); } &&
18030          { ac_try='test -s conftest.$ac_objext'
18031   { (eval echo "$as_me:18031: \"$ac_try\"") >&5
18032   (eval $ac_try) 2>&5
18033   ac_status=$?
18034   echo "$as_me:18034: \$? = $ac_status" >&5
18035   (exit $ac_status); }; }; then
18036   cf_cv_ncurses_ext_funcs=defined
18037 else
18038   echo "$as_me: failed program was:" >&5
18039 cat conftest.$ac_ext >&5
18040
18041 cat >conftest.$ac_ext <<_ACEOF
18042 #line 18042 "configure"
18043 #include "confdefs.h"
18044
18045 #include <${cf_cv_ncurses_header:-curses.h}>
18046 int
18047 main (void)
18048 {
18049
18050         (void) assume_default_colors (0, 0);
18051         (void) curses_version ();
18052         (void) define_key (0, 0);
18053         (void) is_term_resized (0, 0);
18054         (void) key_defined (0);
18055         (void) keybound (0, 0);
18056         (void) keyok (0, 0);
18057         (void) resize_term (0, 0);
18058         (void) resizeterm (0, 0);
18059         (void) use_default_colors ();
18060         (void) use_extended_names (0);
18061         (void) wresize (0, 0, 0);
18062   ;
18063   return 0;
18064 }
18065 _ACEOF
18066 rm -f conftest.$ac_objext conftest$ac_exeext
18067 if { (eval echo "$as_me:18067: \"$ac_link\"") >&5
18068   (eval $ac_link) 2>&5
18069   ac_status=$?
18070   echo "$as_me:18070: \$? = $ac_status" >&5
18071   (exit $ac_status); } &&
18072          { ac_try='test -s conftest$ac_exeext'
18073   { (eval echo "$as_me:18073: \"$ac_try\"") >&5
18074   (eval $ac_try) 2>&5
18075   ac_status=$?
18076   echo "$as_me:18076: \$? = $ac_status" >&5
18077   (exit $ac_status); }; }; then
18078   cf_cv_ncurses_ext_funcs=yes
18079 else
18080   echo "$as_me: failed program was:" >&5
18081 cat conftest.$ac_ext >&5
18082 cf_cv_ncurses_ext_funcs=no
18083 fi
18084 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18085
18086 fi
18087 rm -f conftest.$ac_objext conftest.$ac_ext
18088
18089 fi
18090 echo "$as_me:18090: result: $cf_cv_ncurses_ext_funcs" >&5
18091 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18092 test "$cf_cv_ncurses_ext_funcs" = yes &&
18093 cat >>confdefs.h <<\EOF
18094 #define NCURSES_EXT_FUNCS 1
18095 EOF
18096
18097 if test "$cf_enable_widec" = yes
18098 then
18099         # workaround for systems with ncurses before 20111029, due to change of
18100         # feature test macro from _XPG5 to _XOPEN_SOURCE
18101         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18102         then
18103                 cf_define_xpg5=no
18104                 echo "$as_me:18104: checking if _XPG5 should be defined to enable wide-characters" >&5
18105 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18106
18107                 cat >conftest.$ac_ext <<_ACEOF
18108 #line 18108 "configure"
18109 #include "confdefs.h"
18110
18111 #include <${cf_cv_ncurses_header:-curses.h}>
18112 int
18113 main (void)
18114 {
18115 int x = _XPG5
18116   ;
18117   return 0;
18118 }
18119 _ACEOF
18120 rm -f conftest.$ac_objext
18121 if { (eval echo "$as_me:18121: \"$ac_compile\"") >&5
18122   (eval $ac_compile) 2>&5
18123   ac_status=$?
18124   echo "$as_me:18124: \$? = $ac_status" >&5
18125   (exit $ac_status); } &&
18126          { ac_try='test -s conftest.$ac_objext'
18127   { (eval echo "$as_me:18127: \"$ac_try\"") >&5
18128   (eval $ac_try) 2>&5
18129   ac_status=$?
18130   echo "$as_me:18130: \$? = $ac_status" >&5
18131   (exit $ac_status); }; }; then
18132   :
18133 else
18134   echo "$as_me: failed program was:" >&5
18135 cat conftest.$ac_ext >&5
18136 cf_save_cppflags="$CPPFLAGS"
18137                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18138                          cat >conftest.$ac_ext <<_ACEOF
18139 #line 18139 "configure"
18140 #include "confdefs.h"
18141
18142 #include <${cf_cv_ncurses_header:-curses.h}>
18143 int
18144 main (void)
18145 {
18146 int x = _XPG5
18147   ;
18148   return 0;
18149 }
18150 _ACEOF
18151 rm -f conftest.$ac_objext
18152 if { (eval echo "$as_me:18152: \"$ac_compile\"") >&5
18153   (eval $ac_compile) 2>&5
18154   ac_status=$?
18155   echo "$as_me:18155: \$? = $ac_status" >&5
18156   (exit $ac_status); } &&
18157          { ac_try='test -s conftest.$ac_objext'
18158   { (eval echo "$as_me:18158: \"$ac_try\"") >&5
18159   (eval $ac_try) 2>&5
18160   ac_status=$?
18161   echo "$as_me:18161: \$? = $ac_status" >&5
18162   (exit $ac_status); }; }; then
18163   cf_define_xpg5=yes
18164 else
18165   echo "$as_me: failed program was:" >&5
18166 cat conftest.$ac_ext >&5
18167 fi
18168 rm -f conftest.$ac_objext conftest.$ac_ext
18169                          CPPFLAGS="$cf_save_cppflags"
18170 fi
18171 rm -f conftest.$ac_objext conftest.$ac_ext
18172                 echo "$as_me:18172: result: $cf_define_xpg5" >&5
18173 echo "${ECHO_T}$cf_define_xpg5" >&6
18174
18175                 if test "$cf_define_xpg5" = yes
18176                 then
18177                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18178                 fi
18179         fi
18180
18181         echo "$as_me:18181: checking for wide-character functions" >&5
18182 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18183 if test "${cf_cv_widechar_funcs+set}" = set; then
18184   echo $ECHO_N "(cached) $ECHO_C" >&6
18185 else
18186
18187         cat >conftest.$ac_ext <<_ACEOF
18188 #line 18188 "configure"
18189 #include "confdefs.h"
18190
18191 #include <${cf_cv_ncurses_header:-curses.h}>
18192 int
18193 main (void)
18194 {
18195
18196                 static wchar_t src_wchar[2];
18197                 static cchar_t dst_cchar;
18198                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18199
18200   ;
18201   return 0;
18202 }
18203 _ACEOF
18204 rm -f conftest.$ac_objext conftest$ac_exeext
18205 if { (eval echo "$as_me:18205: \"$ac_link\"") >&5
18206   (eval $ac_link) 2>&5
18207   ac_status=$?
18208   echo "$as_me:18208: \$? = $ac_status" >&5
18209   (exit $ac_status); } &&
18210          { ac_try='test -s conftest$ac_exeext'
18211   { (eval echo "$as_me:18211: \"$ac_try\"") >&5
18212   (eval $ac_try) 2>&5
18213   ac_status=$?
18214   echo "$as_me:18214: \$? = $ac_status" >&5
18215   (exit $ac_status); }; }; then
18216   cf_cv_widechar_funcs=yes
18217 else
18218   echo "$as_me: failed program was:" >&5
18219 cat conftest.$ac_ext >&5
18220 cf_cv_widechar_funcs=no
18221 fi
18222 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18223
18224 fi
18225 echo "$as_me:18225: result: $cf_cv_widechar_funcs" >&5
18226 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18227         if test "$cf_cv_widechar_funcs" != no ; then
18228
18229 cat >>confdefs.h <<\EOF
18230 #define USE_WIDEC_SUPPORT 1
18231 EOF
18232
18233         else
18234                 cat >>confdefs.h <<\EOF
18235 #define USE_WIDEC_SUPPORT 0
18236 EOF
18237
18238         fi
18239 else
18240         cat >>confdefs.h <<\EOF
18241 #define USE_WIDEC_SUPPORT 0
18242 EOF
18243
18244 fi
18245
18246 echo "$as_me:18246: checking if $cf_cv_screen library uses pthreads" >&5
18247 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18248 if test "${cf_cv_use_pthreads+set}" = set; then
18249   echo $ECHO_N "(cached) $ECHO_C" >&6
18250 else
18251
18252 cat >conftest.$ac_ext <<_ACEOF
18253 #line 18253 "configure"
18254 #include "confdefs.h"
18255
18256 #include <${cf_cv_ncurses_header:-curses.h}>
18257 extern void _nc_init_pthreads(void);
18258
18259 int
18260 main (void)
18261 {
18262
18263         initscr();
18264         _nc_init_pthreads();
18265
18266   ;
18267   return 0;
18268 }
18269 _ACEOF
18270 rm -f conftest.$ac_objext conftest$ac_exeext
18271 if { (eval echo "$as_me:18271: \"$ac_link\"") >&5
18272   (eval $ac_link) 2>&5
18273   ac_status=$?
18274   echo "$as_me:18274: \$? = $ac_status" >&5
18275   (exit $ac_status); } &&
18276          { ac_try='test -s conftest$ac_exeext'
18277   { (eval echo "$as_me:18277: \"$ac_try\"") >&5
18278   (eval $ac_try) 2>&5
18279   ac_status=$?
18280   echo "$as_me:18280: \$? = $ac_status" >&5
18281   (exit $ac_status); }; }; then
18282   cf_cv_use_pthreads=yes
18283 else
18284   echo "$as_me: failed program was:" >&5
18285 cat conftest.$ac_ext >&5
18286 cf_cv_use_pthreads=no
18287 fi
18288 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18289
18290 fi
18291 echo "$as_me:18291: result: $cf_cv_use_pthreads" >&5
18292 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18293 test $cf_cv_use_pthreads = yes &&
18294 cat >>confdefs.h <<\EOF
18295 #define USE_PTHREADS 1
18296 EOF
18297
18298 echo "$as_me:18298: checking if sys/time.h works with sys/select.h" >&5
18299 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18300 if test "${cf_cv_sys_time_select+set}" = set; then
18301   echo $ECHO_N "(cached) $ECHO_C" >&6
18302 else
18303
18304 cat >conftest.$ac_ext <<_ACEOF
18305 #line 18305 "configure"
18306 #include "confdefs.h"
18307
18308 #include <sys/types.h>
18309 #ifdef HAVE_SYS_TIME_H
18310 #include <sys/time.h>
18311 #endif
18312 #ifdef HAVE_SYS_SELECT_H
18313 #include <sys/select.h>
18314 #endif
18315
18316 int
18317 main (void)
18318 {
18319
18320   ;
18321   return 0;
18322 }
18323 _ACEOF
18324 rm -f conftest.$ac_objext
18325 if { (eval echo "$as_me:18325: \"$ac_compile\"") >&5
18326   (eval $ac_compile) 2>&5
18327   ac_status=$?
18328   echo "$as_me:18328: \$? = $ac_status" >&5
18329   (exit $ac_status); } &&
18330          { ac_try='test -s conftest.$ac_objext'
18331   { (eval echo "$as_me:18331: \"$ac_try\"") >&5
18332   (eval $ac_try) 2>&5
18333   ac_status=$?
18334   echo "$as_me:18334: \$? = $ac_status" >&5
18335   (exit $ac_status); }; }; then
18336   cf_cv_sys_time_select=yes
18337 else
18338   echo "$as_me: failed program was:" >&5
18339 cat conftest.$ac_ext >&5
18340 cf_cv_sys_time_select=no
18341 fi
18342 rm -f conftest.$ac_objext conftest.$ac_ext
18343
18344 fi
18345
18346 echo "$as_me:18346: result: $cf_cv_sys_time_select" >&5
18347 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18348 test "$cf_cv_sys_time_select" = yes &&
18349 cat >>confdefs.h <<\EOF
18350 #define HAVE_SYS_TIME_SELECT 1
18351 EOF
18352
18353 # special check for test/ditto.c
18354
18355 echo "$as_me:18355: checking for openpty in -lutil" >&5
18356 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18357 if test "${ac_cv_lib_util_openpty+set}" = set; then
18358   echo $ECHO_N "(cached) $ECHO_C" >&6
18359 else
18360   ac_check_lib_save_LIBS=$LIBS
18361 LIBS="-lutil  $LIBS"
18362 cat >conftest.$ac_ext <<_ACEOF
18363 #line 18363 "configure"
18364 #include "confdefs.h"
18365
18366 /* Override any gcc2 internal prototype to avoid an error.  */
18367 #ifdef __cplusplus
18368 extern "C"
18369 #endif
18370 /* We use char because int might match the return type of a gcc2
18371    builtin and then its argument prototype would still apply.  */
18372 char openpty ();
18373 int
18374 main (void)
18375 {
18376 openpty ();
18377   ;
18378   return 0;
18379 }
18380 _ACEOF
18381 rm -f conftest.$ac_objext conftest$ac_exeext
18382 if { (eval echo "$as_me:18382: \"$ac_link\"") >&5
18383   (eval $ac_link) 2>&5
18384   ac_status=$?
18385   echo "$as_me:18385: \$? = $ac_status" >&5
18386   (exit $ac_status); } &&
18387          { ac_try='test -s conftest$ac_exeext'
18388   { (eval echo "$as_me:18388: \"$ac_try\"") >&5
18389   (eval $ac_try) 2>&5
18390   ac_status=$?
18391   echo "$as_me:18391: \$? = $ac_status" >&5
18392   (exit $ac_status); }; }; then
18393   ac_cv_lib_util_openpty=yes
18394 else
18395   echo "$as_me: failed program was:" >&5
18396 cat conftest.$ac_ext >&5
18397 ac_cv_lib_util_openpty=no
18398 fi
18399 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18400 LIBS=$ac_check_lib_save_LIBS
18401 fi
18402 echo "$as_me:18402: result: $ac_cv_lib_util_openpty" >&5
18403 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18404 if test $ac_cv_lib_util_openpty = yes; then
18405   cf_cv_lib_util=yes
18406 else
18407   cf_cv_lib_util=no
18408 fi
18409
18410 echo "$as_me:18410: checking for openpty header" >&5
18411 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18412 if test "${cf_cv_func_openpty+set}" = set; then
18413   echo $ECHO_N "(cached) $ECHO_C" >&6
18414 else
18415
18416         cf_save_LIBS="$LIBS"
18417         test $cf_cv_lib_util = yes && {
18418 cf_add_libs="$LIBS"
18419 # reverse order
18420 cf_add_0lib=
18421 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18422 # filter duplicates
18423 for cf_add_1lib in $cf_add_0lib; do
18424         for cf_add_2lib in $cf_add_libs; do
18425                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18426                         cf_add_1lib=
18427                         break
18428                 fi
18429         done
18430         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18431 done
18432 LIBS="$cf_add_libs"
18433  }
18434         for cf_header in pty.h libutil.h util.h
18435         do
18436         cat >conftest.$ac_ext <<_ACEOF
18437 #line 18437 "configure"
18438 #include "confdefs.h"
18439
18440 #include <$cf_header>
18441
18442 int
18443 main (void)
18444 {
18445
18446         int x = openpty((int *)0, (int *)0, (char *)0,
18447                                    (struct termios *)0, (struct winsize *)0);
18448
18449   ;
18450   return 0;
18451 }
18452 _ACEOF
18453 rm -f conftest.$ac_objext conftest$ac_exeext
18454 if { (eval echo "$as_me:18454: \"$ac_link\"") >&5
18455   (eval $ac_link) 2>&5
18456   ac_status=$?
18457   echo "$as_me:18457: \$? = $ac_status" >&5
18458   (exit $ac_status); } &&
18459          { ac_try='test -s conftest$ac_exeext'
18460   { (eval echo "$as_me:18460: \"$ac_try\"") >&5
18461   (eval $ac_try) 2>&5
18462   ac_status=$?
18463   echo "$as_me:18463: \$? = $ac_status" >&5
18464   (exit $ac_status); }; }; then
18465
18466                 cf_cv_func_openpty=$cf_header
18467                 break
18468
18469 else
18470   echo "$as_me: failed program was:" >&5
18471 cat conftest.$ac_ext >&5
18472
18473                 cf_cv_func_openpty=no
18474
18475 fi
18476 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18477         done
18478         LIBS="$cf_save_LIBS"
18479
18480 fi
18481 echo "$as_me:18481: result: $cf_cv_func_openpty" >&5
18482 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18483
18484 if test "$cf_cv_func_openpty" != no ; then
18485
18486 cat >>confdefs.h <<EOF
18487 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18488 EOF
18489
18490 cat >>confdefs.h <<\EOF
18491 #define USE_XTERM_PTY 1
18492 EOF
18493
18494         if test "x$cf_cv_lib_util" = xyes ; then
18495
18496 cf_add_libs="$TEST_LIBS"
18497 # reverse order
18498 cf_add_0lib=
18499 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18500 # filter duplicates
18501 for cf_add_1lib in $cf_add_0lib; do
18502         for cf_add_2lib in $cf_add_libs; do
18503                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18504                         cf_add_1lib=
18505                         break
18506                 fi
18507         done
18508         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18509 done
18510 TEST_LIBS="$cf_add_libs"
18511
18512         fi
18513 fi
18514
18515 echo "$as_me:18515: checking for function curses_version" >&5
18516 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
18517 if test "${cf_cv_func_curses_version+set}" = set; then
18518   echo $ECHO_N "(cached) $ECHO_C" >&6
18519 else
18520
18521 if test "$cross_compiling" = yes; then
18522   cf_cv_func_curses_version=unknown
18523 else
18524   cat >conftest.$ac_ext <<_ACEOF
18525 #line 18525 "configure"
18526 #include "confdefs.h"
18527
18528 #include <${cf_cv_ncurses_header:-curses.h}>
18529 int main(void)
18530 {
18531         char temp[1024];
18532         sprintf(temp, "%s\n", curses_version());
18533         ${cf_cv_main_return:-return}(0);
18534 }
18535
18536 _ACEOF
18537 rm -f conftest$ac_exeext
18538 if { (eval echo "$as_me:18538: \"$ac_link\"") >&5
18539   (eval $ac_link) 2>&5
18540   ac_status=$?
18541   echo "$as_me:18541: \$? = $ac_status" >&5
18542   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18543   { (eval echo "$as_me:18543: \"$ac_try\"") >&5
18544   (eval $ac_try) 2>&5
18545   ac_status=$?
18546   echo "$as_me:18546: \$? = $ac_status" >&5
18547   (exit $ac_status); }; }; then
18548   cf_cv_func_curses_version=yes
18549
18550 else
18551   echo "$as_me: program exited with status $ac_status" >&5
18552 echo "$as_me: failed program was:" >&5
18553 cat conftest.$ac_ext >&5
18554 cf_cv_func_curses_version=no
18555
18556 fi
18557 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18558 fi
18559 rm -f core
18560 fi
18561 echo "$as_me:18561: result: $cf_cv_func_curses_version" >&5
18562 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
18563 test "$cf_cv_func_curses_version" = yes &&
18564 cat >>confdefs.h <<\EOF
18565 #define HAVE_CURSES_VERSION 1
18566 EOF
18567
18568 echo "$as_me:18568: checking for alternate character set array" >&5
18569 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
18570 if test "${cf_cv_curses_acs_map+set}" = set; then
18571   echo $ECHO_N "(cached) $ECHO_C" >&6
18572 else
18573
18574 cf_cv_curses_acs_map=unknown
18575 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
18576 do
18577 cat >conftest.$ac_ext <<_ACEOF
18578 #line 18578 "configure"
18579 #include "confdefs.h"
18580
18581 #include <${cf_cv_ncurses_header:-curses.h}>
18582
18583 int
18584 main (void)
18585 {
18586
18587 $name['k'] = ACS_PLUS
18588
18589   ;
18590   return 0;
18591 }
18592 _ACEOF
18593 rm -f conftest.$ac_objext conftest$ac_exeext
18594 if { (eval echo "$as_me:18594: \"$ac_link\"") >&5
18595   (eval $ac_link) 2>&5
18596   ac_status=$?
18597   echo "$as_me:18597: \$? = $ac_status" >&5
18598   (exit $ac_status); } &&
18599          { ac_try='test -s conftest$ac_exeext'
18600   { (eval echo "$as_me:18600: \"$ac_try\"") >&5
18601   (eval $ac_try) 2>&5
18602   ac_status=$?
18603   echo "$as_me:18603: \$? = $ac_status" >&5
18604   (exit $ac_status); }; }; then
18605   cf_cv_curses_acs_map=$name; break
18606 else
18607   echo "$as_me: failed program was:" >&5
18608 cat conftest.$ac_ext >&5
18609 fi
18610 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18611 done
18612
18613 fi
18614 echo "$as_me:18614: result: $cf_cv_curses_acs_map" >&5
18615 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
18616
18617 test "$cf_cv_curses_acs_map" != unknown &&
18618 cat >>confdefs.h <<EOF
18619 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
18620 EOF
18621
18622 if test "$cf_enable_widec" = yes; then
18623
18624 echo "$as_me:18624: checking for wide alternate character set array" >&5
18625 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
18626 if test "${cf_cv_curses_wacs_map+set}" = set; then
18627   echo $ECHO_N "(cached) $ECHO_C" >&6
18628 else
18629
18630         cf_cv_curses_wacs_map=unknown
18631         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
18632         do
18633         cat >conftest.$ac_ext <<_ACEOF
18634 #line 18634 "configure"
18635 #include "confdefs.h"
18636
18637 #ifndef _XOPEN_SOURCE_EXTENDED
18638 #define _XOPEN_SOURCE_EXTENDED
18639 #endif
18640 #include <${cf_cv_ncurses_header:-curses.h}>
18641 int
18642 main (void)
18643 {
18644 void *foo = &($name['k'])
18645   ;
18646   return 0;
18647 }
18648 _ACEOF
18649 rm -f conftest.$ac_objext conftest$ac_exeext
18650 if { (eval echo "$as_me:18650: \"$ac_link\"") >&5
18651   (eval $ac_link) 2>&5
18652   ac_status=$?
18653   echo "$as_me:18653: \$? = $ac_status" >&5
18654   (exit $ac_status); } &&
18655          { ac_try='test -s conftest$ac_exeext'
18656   { (eval echo "$as_me:18656: \"$ac_try\"") >&5
18657   (eval $ac_try) 2>&5
18658   ac_status=$?
18659   echo "$as_me:18659: \$? = $ac_status" >&5
18660   (exit $ac_status); }; }; then
18661   cf_cv_curses_wacs_map=$name
18662          break
18663 else
18664   echo "$as_me: failed program was:" >&5
18665 cat conftest.$ac_ext >&5
18666 fi
18667 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18668         done
18669 fi
18670 echo "$as_me:18670: result: $cf_cv_curses_wacs_map" >&5
18671 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
18672
18673 test "$cf_cv_curses_wacs_map" != unknown &&
18674 cat >>confdefs.h <<EOF
18675 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
18676 EOF
18677
18678 echo "$as_me:18678: checking for wide alternate character constants" >&5
18679 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
18680 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
18681   echo $ECHO_N "(cached) $ECHO_C" >&6
18682 else
18683
18684 cf_cv_curses_wacs_symbols=no
18685 if test "$cf_cv_curses_wacs_map" != unknown
18686 then
18687         cat >conftest.$ac_ext <<_ACEOF
18688 #line 18688 "configure"
18689 #include "confdefs.h"
18690
18691 #ifndef _XOPEN_SOURCE_EXTENDED
18692 #define _XOPEN_SOURCE_EXTENDED
18693 #endif
18694 #include <${cf_cv_ncurses_header:-curses.h}>
18695 int
18696 main (void)
18697 {
18698 cchar_t *foo = WACS_PLUS;
18699          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
18700   ;
18701   return 0;
18702 }
18703 _ACEOF
18704 rm -f conftest.$ac_objext conftest$ac_exeext
18705 if { (eval echo "$as_me:18705: \"$ac_link\"") >&5
18706   (eval $ac_link) 2>&5
18707   ac_status=$?
18708   echo "$as_me:18708: \$? = $ac_status" >&5
18709   (exit $ac_status); } &&
18710          { ac_try='test -s conftest$ac_exeext'
18711   { (eval echo "$as_me:18711: \"$ac_try\"") >&5
18712   (eval $ac_try) 2>&5
18713   ac_status=$?
18714   echo "$as_me:18714: \$? = $ac_status" >&5
18715   (exit $ac_status); }; }; then
18716   cf_cv_curses_wacs_symbols=yes
18717 else
18718   echo "$as_me: failed program was:" >&5
18719 cat conftest.$ac_ext >&5
18720 fi
18721 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18722 else
18723         cat >conftest.$ac_ext <<_ACEOF
18724 #line 18724 "configure"
18725 #include "confdefs.h"
18726
18727 #ifndef _XOPEN_SOURCE_EXTENDED
18728 #define _XOPEN_SOURCE_EXTENDED
18729 #endif
18730 #include <${cf_cv_ncurses_header:-curses.h}>
18731 int
18732 main (void)
18733 {
18734 cchar_t *foo = WACS_PLUS
18735   ;
18736   return 0;
18737 }
18738 _ACEOF
18739 rm -f conftest.$ac_objext conftest$ac_exeext
18740 if { (eval echo "$as_me:18740: \"$ac_link\"") >&5
18741   (eval $ac_link) 2>&5
18742   ac_status=$?
18743   echo "$as_me:18743: \$? = $ac_status" >&5
18744   (exit $ac_status); } &&
18745          { ac_try='test -s conftest$ac_exeext'
18746   { (eval echo "$as_me:18746: \"$ac_try\"") >&5
18747   (eval $ac_try) 2>&5
18748   ac_status=$?
18749   echo "$as_me:18749: \$? = $ac_status" >&5
18750   (exit $ac_status); }; }; then
18751   cf_cv_curses_wacs_symbols=yes
18752 else
18753   echo "$as_me: failed program was:" >&5
18754 cat conftest.$ac_ext >&5
18755 fi
18756 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18757 fi
18758
18759 fi
18760 echo "$as_me:18760: result: $cf_cv_curses_wacs_symbols" >&5
18761 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
18762
18763 test "$cf_cv_curses_wacs_symbols" != no &&
18764 cat >>confdefs.h <<\EOF
18765 #define CURSES_WACS_SYMBOLS 1
18766 EOF
18767
18768 fi
18769
18770 echo "$as_me:18770: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18771 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18772 cat >conftest.$ac_ext <<_ACEOF
18773 #line 18773 "configure"
18774 #include "confdefs.h"
18775
18776 #ifndef _XOPEN_SOURCE_EXTENDED
18777 #define _XOPEN_SOURCE_EXTENDED
18778 #endif
18779 #include <${cf_cv_ncurses_header:-curses.h}>
18780 int
18781 main (void)
18782 {
18783
18784 attr_t foo
18785
18786   ;
18787   return 0;
18788 }
18789 _ACEOF
18790 rm -f conftest.$ac_objext
18791 if { (eval echo "$as_me:18791: \"$ac_compile\"") >&5
18792   (eval $ac_compile) 2>&5
18793   ac_status=$?
18794   echo "$as_me:18794: \$? = $ac_status" >&5
18795   (exit $ac_status); } &&
18796          { ac_try='test -s conftest.$ac_objext'
18797   { (eval echo "$as_me:18797: \"$ac_try\"") >&5
18798   (eval $ac_try) 2>&5
18799   ac_status=$?
18800   echo "$as_me:18800: \$? = $ac_status" >&5
18801   (exit $ac_status); }; }; then
18802   cf_result=yes
18803 else
18804   echo "$as_me: failed program was:" >&5
18805 cat conftest.$ac_ext >&5
18806 cf_result=no
18807 fi
18808 rm -f conftest.$ac_objext conftest.$ac_ext
18809 echo "$as_me:18809: result: $cf_result" >&5
18810 echo "${ECHO_T}$cf_result" >&6
18811 if test $cf_result = yes ; then
18812
18813 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18814
18815 cat >>confdefs.h <<EOF
18816 #define $cf_result 1
18817 EOF
18818
18819 else
18820
18821 cat >>confdefs.h <<EOF
18822 #define attr_t long
18823 EOF
18824
18825 fi
18826
18827 if test "$cf_enable_widec" = yes; then
18828
18829 # This is needed on Tru64 5.0 to declare mbstate_t
18830 echo "$as_me:18830: checking if we must include wchar.h to declare mbstate_t" >&5
18831 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
18832 if test "${cf_cv_mbstate_t+set}" = set; then
18833   echo $ECHO_N "(cached) $ECHO_C" >&6
18834 else
18835
18836 cat >conftest.$ac_ext <<_ACEOF
18837 #line 18837 "configure"
18838 #include "confdefs.h"
18839
18840 #include <stdlib.h>
18841 #include <stdarg.h>
18842 #include <stdio.h>
18843 #ifdef HAVE_LIBUTF8_H
18844 #include <libutf8.h>
18845 #endif
18846 int
18847 main (void)
18848 {
18849 mbstate_t state
18850   ;
18851   return 0;
18852 }
18853 _ACEOF
18854 rm -f conftest.$ac_objext
18855 if { (eval echo "$as_me:18855: \"$ac_compile\"") >&5
18856   (eval $ac_compile) 2>&5
18857   ac_status=$?
18858   echo "$as_me:18858: \$? = $ac_status" >&5
18859   (exit $ac_status); } &&
18860          { ac_try='test -s conftest.$ac_objext'
18861   { (eval echo "$as_me:18861: \"$ac_try\"") >&5
18862   (eval $ac_try) 2>&5
18863   ac_status=$?
18864   echo "$as_me:18864: \$? = $ac_status" >&5
18865   (exit $ac_status); }; }; then
18866   cf_cv_mbstate_t=no
18867 else
18868   echo "$as_me: failed program was:" >&5
18869 cat conftest.$ac_ext >&5
18870 cat >conftest.$ac_ext <<_ACEOF
18871 #line 18871 "configure"
18872 #include "confdefs.h"
18873
18874 #include <stdlib.h>
18875 #include <stdarg.h>
18876 #include <stdio.h>
18877 #include <wchar.h>
18878 #ifdef HAVE_LIBUTF8_H
18879 #include <libutf8.h>
18880 #endif
18881 int
18882 main (void)
18883 {
18884 mbstate_t value
18885   ;
18886   return 0;
18887 }
18888 _ACEOF
18889 rm -f conftest.$ac_objext
18890 if { (eval echo "$as_me:18890: \"$ac_compile\"") >&5
18891   (eval $ac_compile) 2>&5
18892   ac_status=$?
18893   echo "$as_me:18893: \$? = $ac_status" >&5
18894   (exit $ac_status); } &&
18895          { ac_try='test -s conftest.$ac_objext'
18896   { (eval echo "$as_me:18896: \"$ac_try\"") >&5
18897   (eval $ac_try) 2>&5
18898   ac_status=$?
18899   echo "$as_me:18899: \$? = $ac_status" >&5
18900   (exit $ac_status); }; }; then
18901   cf_cv_mbstate_t=yes
18902 else
18903   echo "$as_me: failed program was:" >&5
18904 cat conftest.$ac_ext >&5
18905 cf_cv_mbstate_t=unknown
18906 fi
18907 rm -f conftest.$ac_objext conftest.$ac_ext
18908 fi
18909 rm -f conftest.$ac_objext conftest.$ac_ext
18910 fi
18911 echo "$as_me:18911: result: $cf_cv_mbstate_t" >&5
18912 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
18913
18914 if test "$cf_cv_mbstate_t" = yes ; then
18915
18916 cat >>confdefs.h <<\EOF
18917 #define NEED_WCHAR_H 1
18918 EOF
18919
18920         NEED_WCHAR_H=1
18921 fi
18922
18923 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
18924 if test "$cf_cv_mbstate_t" = unknown ; then
18925         NCURSES_MBSTATE_T=1
18926 fi
18927
18928 # if we find mbstate_t in either place, use substitution to provide a fallback.
18929 if test "$cf_cv_mbstate_t" != unknown ; then
18930         NCURSES_OK_MBSTATE_T=1
18931 fi
18932
18933 # This is needed on Tru64 5.0 to declare wchar_t
18934 echo "$as_me:18934: checking if we must include wchar.h to declare wchar_t" >&5
18935 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
18936 if test "${cf_cv_wchar_t+set}" = set; then
18937   echo $ECHO_N "(cached) $ECHO_C" >&6
18938 else
18939
18940 cat >conftest.$ac_ext <<_ACEOF
18941 #line 18941 "configure"
18942 #include "confdefs.h"
18943
18944 #include <stdlib.h>
18945 #include <stdarg.h>
18946 #include <stdio.h>
18947 #ifdef HAVE_LIBUTF8_H
18948 #include <libutf8.h>
18949 #endif
18950 int
18951 main (void)
18952 {
18953 wchar_t state
18954   ;
18955   return 0;
18956 }
18957 _ACEOF
18958 rm -f conftest.$ac_objext
18959 if { (eval echo "$as_me:18959: \"$ac_compile\"") >&5
18960   (eval $ac_compile) 2>&5
18961   ac_status=$?
18962   echo "$as_me:18962: \$? = $ac_status" >&5
18963   (exit $ac_status); } &&
18964          { ac_try='test -s conftest.$ac_objext'
18965   { (eval echo "$as_me:18965: \"$ac_try\"") >&5
18966   (eval $ac_try) 2>&5
18967   ac_status=$?
18968   echo "$as_me:18968: \$? = $ac_status" >&5
18969   (exit $ac_status); }; }; then
18970   cf_cv_wchar_t=no
18971 else
18972   echo "$as_me: failed program was:" >&5
18973 cat conftest.$ac_ext >&5
18974 cat >conftest.$ac_ext <<_ACEOF
18975 #line 18975 "configure"
18976 #include "confdefs.h"
18977
18978 #include <stdlib.h>
18979 #include <stdarg.h>
18980 #include <stdio.h>
18981 #include <wchar.h>
18982 #ifdef HAVE_LIBUTF8_H
18983 #include <libutf8.h>
18984 #endif
18985 int
18986 main (void)
18987 {
18988 wchar_t value
18989   ;
18990   return 0;
18991 }
18992 _ACEOF
18993 rm -f conftest.$ac_objext
18994 if { (eval echo "$as_me:18994: \"$ac_compile\"") >&5
18995   (eval $ac_compile) 2>&5
18996   ac_status=$?
18997   echo "$as_me:18997: \$? = $ac_status" >&5
18998   (exit $ac_status); } &&
18999          { ac_try='test -s conftest.$ac_objext'
19000   { (eval echo "$as_me:19000: \"$ac_try\"") >&5
19001   (eval $ac_try) 2>&5
19002   ac_status=$?
19003   echo "$as_me:19003: \$? = $ac_status" >&5
19004   (exit $ac_status); }; }; then
19005   cf_cv_wchar_t=yes
19006 else
19007   echo "$as_me: failed program was:" >&5
19008 cat conftest.$ac_ext >&5
19009 cf_cv_wchar_t=unknown
19010 fi
19011 rm -f conftest.$ac_objext conftest.$ac_ext
19012 fi
19013 rm -f conftest.$ac_objext conftest.$ac_ext
19014 fi
19015 echo "$as_me:19015: result: $cf_cv_wchar_t" >&5
19016 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19017
19018 if test "$cf_cv_wchar_t" = yes ; then
19019
19020 cat >>confdefs.h <<\EOF
19021 #define NEED_WCHAR_H 1
19022 EOF
19023
19024         NEED_WCHAR_H=1
19025 fi
19026
19027 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19028 if test "$cf_cv_wchar_t" = unknown ; then
19029         NCURSES_WCHAR_T=1
19030 fi
19031
19032 # if we find wchar_t in either place, use substitution to provide a fallback.
19033 if test "$cf_cv_wchar_t" != unknown ; then
19034         NCURSES_OK_WCHAR_T=1
19035 fi
19036
19037 # This is needed on Tru64 5.0 to declare wint_t
19038 echo "$as_me:19038: checking if we must include wchar.h to declare wint_t" >&5
19039 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19040 if test "${cf_cv_wint_t+set}" = set; then
19041   echo $ECHO_N "(cached) $ECHO_C" >&6
19042 else
19043
19044 cat >conftest.$ac_ext <<_ACEOF
19045 #line 19045 "configure"
19046 #include "confdefs.h"
19047
19048 #include <stdlib.h>
19049 #include <stdarg.h>
19050 #include <stdio.h>
19051 #ifdef HAVE_LIBUTF8_H
19052 #include <libutf8.h>
19053 #endif
19054 int
19055 main (void)
19056 {
19057 wint_t state
19058   ;
19059   return 0;
19060 }
19061 _ACEOF
19062 rm -f conftest.$ac_objext
19063 if { (eval echo "$as_me:19063: \"$ac_compile\"") >&5
19064   (eval $ac_compile) 2>&5
19065   ac_status=$?
19066   echo "$as_me:19066: \$? = $ac_status" >&5
19067   (exit $ac_status); } &&
19068          { ac_try='test -s conftest.$ac_objext'
19069   { (eval echo "$as_me:19069: \"$ac_try\"") >&5
19070   (eval $ac_try) 2>&5
19071   ac_status=$?
19072   echo "$as_me:19072: \$? = $ac_status" >&5
19073   (exit $ac_status); }; }; then
19074   cf_cv_wint_t=no
19075 else
19076   echo "$as_me: failed program was:" >&5
19077 cat conftest.$ac_ext >&5
19078 cat >conftest.$ac_ext <<_ACEOF
19079 #line 19079 "configure"
19080 #include "confdefs.h"
19081
19082 #include <stdlib.h>
19083 #include <stdarg.h>
19084 #include <stdio.h>
19085 #include <wchar.h>
19086 #ifdef HAVE_LIBUTF8_H
19087 #include <libutf8.h>
19088 #endif
19089 int
19090 main (void)
19091 {
19092 wint_t value
19093   ;
19094   return 0;
19095 }
19096 _ACEOF
19097 rm -f conftest.$ac_objext
19098 if { (eval echo "$as_me:19098: \"$ac_compile\"") >&5
19099   (eval $ac_compile) 2>&5
19100   ac_status=$?
19101   echo "$as_me:19101: \$? = $ac_status" >&5
19102   (exit $ac_status); } &&
19103          { ac_try='test -s conftest.$ac_objext'
19104   { (eval echo "$as_me:19104: \"$ac_try\"") >&5
19105   (eval $ac_try) 2>&5
19106   ac_status=$?
19107   echo "$as_me:19107: \$? = $ac_status" >&5
19108   (exit $ac_status); }; }; then
19109   cf_cv_wint_t=yes
19110 else
19111   echo "$as_me: failed program was:" >&5
19112 cat conftest.$ac_ext >&5
19113 cf_cv_wint_t=unknown
19114 fi
19115 rm -f conftest.$ac_objext conftest.$ac_ext
19116 fi
19117 rm -f conftest.$ac_objext conftest.$ac_ext
19118 fi
19119 echo "$as_me:19119: result: $cf_cv_wint_t" >&5
19120 echo "${ECHO_T}$cf_cv_wint_t" >&6
19121
19122 if test "$cf_cv_wint_t" = yes ; then
19123
19124 cat >>confdefs.h <<\EOF
19125 #define NEED_WCHAR_H 1
19126 EOF
19127
19128         NEED_WCHAR_H=1
19129 fi
19130
19131 # if we do not find wint_t in either place, use substitution to provide a fallback.
19132 if test "$cf_cv_wint_t" = unknown ; then
19133         NCURSES_WINT_T=1
19134 fi
19135
19136 # if we find wint_t in either place, use substitution to provide a fallback.
19137 if test "$cf_cv_wint_t" != unknown ; then
19138         NCURSES_OK_WINT_T=1
19139 fi
19140
19141         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19142
19143 echo "$as_me:19143: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19144 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19145 cat >conftest.$ac_ext <<_ACEOF
19146 #line 19146 "configure"
19147 #include "confdefs.h"
19148
19149 #ifndef _XOPEN_SOURCE_EXTENDED
19150 #define _XOPEN_SOURCE_EXTENDED
19151 #endif
19152 #include <${cf_cv_ncurses_header:-curses.h}>
19153 int
19154 main (void)
19155 {
19156
19157 mbstate_t foo
19158
19159   ;
19160   return 0;
19161 }
19162 _ACEOF
19163 rm -f conftest.$ac_objext
19164 if { (eval echo "$as_me:19164: \"$ac_compile\"") >&5
19165   (eval $ac_compile) 2>&5
19166   ac_status=$?
19167   echo "$as_me:19167: \$? = $ac_status" >&5
19168   (exit $ac_status); } &&
19169          { ac_try='test -s conftest.$ac_objext'
19170   { (eval echo "$as_me:19170: \"$ac_try\"") >&5
19171   (eval $ac_try) 2>&5
19172   ac_status=$?
19173   echo "$as_me:19173: \$? = $ac_status" >&5
19174   (exit $ac_status); }; }; then
19175   cf_result=yes
19176 else
19177   echo "$as_me: failed program was:" >&5
19178 cat conftest.$ac_ext >&5
19179 cf_result=no
19180 fi
19181 rm -f conftest.$ac_objext conftest.$ac_ext
19182 echo "$as_me:19182: result: $cf_result" >&5
19183 echo "${ECHO_T}$cf_result" >&6
19184 if test $cf_result = yes ; then
19185
19186 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19187
19188 cat >>confdefs.h <<EOF
19189 #define $cf_result 1
19190 EOF
19191
19192 else
19193
19194 cat >>confdefs.h <<EOF
19195 #define mbstate_t long
19196 EOF
19197
19198 fi
19199
19200         fi
19201
19202         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19203
19204 echo "$as_me:19204: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19205 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19206 cat >conftest.$ac_ext <<_ACEOF
19207 #line 19207 "configure"
19208 #include "confdefs.h"
19209
19210 #ifndef _XOPEN_SOURCE_EXTENDED
19211 #define _XOPEN_SOURCE_EXTENDED
19212 #endif
19213 #include <${cf_cv_ncurses_header:-curses.h}>
19214 int
19215 main (void)
19216 {
19217
19218 wchar_t foo
19219
19220   ;
19221   return 0;
19222 }
19223 _ACEOF
19224 rm -f conftest.$ac_objext
19225 if { (eval echo "$as_me:19225: \"$ac_compile\"") >&5
19226   (eval $ac_compile) 2>&5
19227   ac_status=$?
19228   echo "$as_me:19228: \$? = $ac_status" >&5
19229   (exit $ac_status); } &&
19230          { ac_try='test -s conftest.$ac_objext'
19231   { (eval echo "$as_me:19231: \"$ac_try\"") >&5
19232   (eval $ac_try) 2>&5
19233   ac_status=$?
19234   echo "$as_me:19234: \$? = $ac_status" >&5
19235   (exit $ac_status); }; }; then
19236   cf_result=yes
19237 else
19238   echo "$as_me: failed program was:" >&5
19239 cat conftest.$ac_ext >&5
19240 cf_result=no
19241 fi
19242 rm -f conftest.$ac_objext conftest.$ac_ext
19243 echo "$as_me:19243: result: $cf_result" >&5
19244 echo "${ECHO_T}$cf_result" >&6
19245 if test $cf_result = yes ; then
19246
19247 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19248
19249 cat >>confdefs.h <<EOF
19250 #define $cf_result 1
19251 EOF
19252
19253 else
19254
19255 cat >>confdefs.h <<EOF
19256 #define wchar_t long
19257 EOF
19258
19259 fi
19260
19261         fi
19262
19263         if test "$NCURSES_OK_WINT_T" = 0 ; then
19264
19265 echo "$as_me:19265: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19266 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19267 cat >conftest.$ac_ext <<_ACEOF
19268 #line 19268 "configure"
19269 #include "confdefs.h"
19270
19271 #ifndef _XOPEN_SOURCE_EXTENDED
19272 #define _XOPEN_SOURCE_EXTENDED
19273 #endif
19274 #include <${cf_cv_ncurses_header:-curses.h}>
19275 int
19276 main (void)
19277 {
19278
19279 wint_t foo
19280
19281   ;
19282   return 0;
19283 }
19284 _ACEOF
19285 rm -f conftest.$ac_objext
19286 if { (eval echo "$as_me:19286: \"$ac_compile\"") >&5
19287   (eval $ac_compile) 2>&5
19288   ac_status=$?
19289   echo "$as_me:19289: \$? = $ac_status" >&5
19290   (exit $ac_status); } &&
19291          { ac_try='test -s conftest.$ac_objext'
19292   { (eval echo "$as_me:19292: \"$ac_try\"") >&5
19293   (eval $ac_try) 2>&5
19294   ac_status=$?
19295   echo "$as_me:19295: \$? = $ac_status" >&5
19296   (exit $ac_status); }; }; then
19297   cf_result=yes
19298 else
19299   echo "$as_me: failed program was:" >&5
19300 cat conftest.$ac_ext >&5
19301 cf_result=no
19302 fi
19303 rm -f conftest.$ac_objext conftest.$ac_ext
19304 echo "$as_me:19304: result: $cf_result" >&5
19305 echo "${ECHO_T}$cf_result" >&6
19306 if test $cf_result = yes ; then
19307
19308 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19309
19310 cat >>confdefs.h <<EOF
19311 #define $cf_result 1
19312 EOF
19313
19314 else
19315
19316 cat >>confdefs.h <<EOF
19317 #define wint_t long
19318 EOF
19319
19320 fi
19321
19322         fi
19323 fi
19324
19325 for cf_data in \
19326 TABSIZE \
19327 curscr \
19328 ospeed \
19329 boolnames \
19330 boolfnames \
19331 ttytype
19332 do
19333 echo "$as_me:19333: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19334 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19335
19336 cat >conftest.$ac_ext <<_ACEOF
19337 #line 19337 "configure"
19338 #include "confdefs.h"
19339
19340 #ifdef HAVE_XCURSES
19341 #include <xcurses.h>
19342 char * XCursesProgramName = "test";
19343 #else
19344 #include <${cf_cv_ncurses_header:-curses.h}>
19345 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19346 #include <ncursesw/term.h>
19347 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19348 #include <ncurses/term.h>
19349 #elif defined(HAVE_TERM_H)
19350 #include <term.h>
19351 #endif
19352 #endif
19353
19354 int
19355 main (void)
19356 {
19357
19358 void *foo = &($cf_data)
19359
19360   ;
19361   return 0;
19362 }
19363 _ACEOF
19364 rm -f conftest.$ac_objext
19365 if { (eval echo "$as_me:19365: \"$ac_compile\"") >&5
19366   (eval $ac_compile) 2>&5
19367   ac_status=$?
19368   echo "$as_me:19368: \$? = $ac_status" >&5
19369   (exit $ac_status); } &&
19370          { ac_try='test -s conftest.$ac_objext'
19371   { (eval echo "$as_me:19371: \"$ac_try\"") >&5
19372   (eval $ac_try) 2>&5
19373   ac_status=$?
19374   echo "$as_me:19374: \$? = $ac_status" >&5
19375   (exit $ac_status); }; }; then
19376   cf_result=yes
19377
19378 else
19379   echo "$as_me: failed program was:" >&5
19380 cat conftest.$ac_ext >&5
19381 cf_result=no
19382 fi
19383 rm -f conftest.$ac_objext conftest.$ac_ext
19384 echo "$as_me:19384: result: $cf_result" >&5
19385 echo "${ECHO_T}$cf_result" >&6
19386
19387 if test $cf_result = yes ; then
19388
19389 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19390
19391         cat >>confdefs.h <<EOF
19392 #define $cf_result 1
19393 EOF
19394
19395 else
19396         echo "$as_me:19396: checking for data $cf_data in library" >&5
19397 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19398         # BSD linkers insist on making weak linkage, but resolve at runtime.
19399         if test "$cross_compiling" = yes; then
19400
19401         # cross-compiling
19402         cat >conftest.$ac_ext <<_ACEOF
19403 #line 19403 "configure"
19404 #include "confdefs.h"
19405
19406 #ifdef HAVE_XCURSES
19407 #include <xcurses.h>
19408 char * XCursesProgramName = "test";
19409 #else
19410 #include <${cf_cv_ncurses_header:-curses.h}>
19411 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19412 #include <ncursesw/term.h>
19413 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19414 #include <ncurses/term.h>
19415 #elif defined(HAVE_TERM_H)
19416 #include <term.h>
19417 #endif
19418 #endif
19419
19420 extern char $cf_data;
19421 int
19422 main (void)
19423 {
19424
19425         do {
19426                 void *foo = &($cf_data);
19427                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19428                 ${cf_cv_main_return:-return}(foo == 0);
19429         } while (0)
19430
19431   ;
19432   return 0;
19433 }
19434 _ACEOF
19435 rm -f conftest.$ac_objext conftest$ac_exeext
19436 if { (eval echo "$as_me:19436: \"$ac_link\"") >&5
19437   (eval $ac_link) 2>&5
19438   ac_status=$?
19439   echo "$as_me:19439: \$? = $ac_status" >&5
19440   (exit $ac_status); } &&
19441          { ac_try='test -s conftest$ac_exeext'
19442   { (eval echo "$as_me:19442: \"$ac_try\"") >&5
19443   (eval $ac_try) 2>&5
19444   ac_status=$?
19445   echo "$as_me:19445: \$? = $ac_status" >&5
19446   (exit $ac_status); }; }; then
19447   cf_result=yes
19448 else
19449   echo "$as_me: failed program was:" >&5
19450 cat conftest.$ac_ext >&5
19451 cf_result=no
19452 fi
19453 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19454
19455 else
19456   cat >conftest.$ac_ext <<_ACEOF
19457 #line 19457 "configure"
19458 #include "confdefs.h"
19459
19460 #ifdef HAVE_XCURSES
19461 #include <xcurses.h>
19462 char * XCursesProgramName = "test";
19463 #else
19464 #include <${cf_cv_ncurses_header:-curses.h}>
19465 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19466 #include <ncursesw/term.h>
19467 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19468 #include <ncurses/term.h>
19469 #elif defined(HAVE_TERM_H)
19470 #include <term.h>
19471 #endif
19472 #endif
19473
19474 extern char $cf_data;
19475 int main(void)
19476 {
19477         void *foo = &($cf_data);
19478         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19479         ${cf_cv_main_return:-return}(foo == 0);
19480 }
19481 _ACEOF
19482 rm -f conftest$ac_exeext
19483 if { (eval echo "$as_me:19483: \"$ac_link\"") >&5
19484   (eval $ac_link) 2>&5
19485   ac_status=$?
19486   echo "$as_me:19486: \$? = $ac_status" >&5
19487   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19488   { (eval echo "$as_me:19488: \"$ac_try\"") >&5
19489   (eval $ac_try) 2>&5
19490   ac_status=$?
19491   echo "$as_me:19491: \$? = $ac_status" >&5
19492   (exit $ac_status); }; }; then
19493   cf_result=yes
19494
19495 else
19496   echo "$as_me: program exited with status $ac_status" >&5
19497 echo "$as_me: failed program was:" >&5
19498 cat conftest.$ac_ext >&5
19499 cf_result=no
19500 fi
19501 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19502 fi
19503         echo "$as_me:19503: result: $cf_result" >&5
19504 echo "${ECHO_T}$cf_result" >&6
19505         if test $cf_result = yes ; then
19506
19507 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19508
19509                 cat >>confdefs.h <<EOF
19510 #define $cf_result 1
19511 EOF
19512
19513                 # do not exit loop here, since we prefer system's declarations
19514         fi
19515 fi
19516 done
19517
19518 if ( test "$GCC" = yes || test "$GXX" = yes )
19519 then
19520 echo "$as_me:19520: checking if you want to turn on gcc warnings" >&5
19521 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
19522
19523 # Check whether --enable-warnings or --disable-warnings was given.
19524 if test "${enable_warnings+set}" = set; then
19525   enableval="$enable_warnings"
19526   test "$enableval" != yes && enableval=no
19527         if test "$enableval" != "no" ; then
19528     with_warnings=yes
19529         else
19530                 with_warnings=no
19531         fi
19532 else
19533   enableval=no
19534         with_warnings=no
19535
19536 fi;
19537 echo "$as_me:19537: result: $with_warnings" >&5
19538 echo "${ECHO_T}$with_warnings" >&6
19539 if test "$with_warnings" = "yes"
19540 then
19541
19542 if test "$GCC" = yes
19543 then
19544 cat > conftest.i <<EOF
19545 #ifndef GCC_PRINTF
19546 #define GCC_PRINTF 0
19547 #endif
19548 #ifndef GCC_SCANF
19549 #define GCC_SCANF 0
19550 #endif
19551 #ifndef GCC_NORETURN
19552 #define GCC_NORETURN /* nothing */
19553 #endif
19554 #ifndef GCC_UNUSED
19555 #define GCC_UNUSED /* nothing */
19556 #endif
19557 EOF
19558 if test "$GCC" = yes
19559 then
19560         { echo "$as_me:19560: checking for $CC __attribute__ directives..." >&5
19561 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
19562 cat > conftest.$ac_ext <<EOF
19563 #line 19563 "${as_me:-configure}"
19564 #include "confdefs.h"
19565 #include "conftest.h"
19566 #include "conftest.i"
19567 #if     GCC_PRINTF
19568 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
19569 #else
19570 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
19571 #endif
19572 #if     GCC_SCANF
19573 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
19574 #else
19575 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
19576 #endif
19577 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
19578 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
19579 extern void foo(void) GCC_NORETURN;
19580 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
19581 EOF
19582         cf_printf_attribute=no
19583         cf_scanf_attribute=no
19584         for cf_attribute in scanf printf unused noreturn
19585         do
19586
19587 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19588
19589                 cf_directive="__attribute__(($cf_attribute))"
19590                 echo "checking for $CC $cf_directive" 1>&5
19591
19592                 case $cf_attribute in
19593                 (printf)
19594                         cf_printf_attribute=yes
19595                         cat >conftest.h <<EOF
19596 #define GCC_$cf_ATTRIBUTE 1
19597 EOF
19598                         ;;
19599                 (scanf)
19600                         cf_scanf_attribute=yes
19601                         cat >conftest.h <<EOF
19602 #define GCC_$cf_ATTRIBUTE 1
19603 EOF
19604                         ;;
19605                 (*)
19606                         cat >conftest.h <<EOF
19607 #define GCC_$cf_ATTRIBUTE $cf_directive
19608 EOF
19609                         ;;
19610                 esac
19611
19612                 if { (eval echo "$as_me:19612: \"$ac_compile\"") >&5
19613   (eval $ac_compile) 2>&5
19614   ac_status=$?
19615   echo "$as_me:19615: \$? = $ac_status" >&5
19616   (exit $ac_status); }; then
19617                         test -n "$verbose" && echo "$as_me:19617: result: ... $cf_attribute" >&5
19618 echo "${ECHO_T}... $cf_attribute" >&6
19619                         cat conftest.h >>confdefs.h
19620                         case $cf_attribute in
19621                         (noreturn)
19622
19623 cat >>confdefs.h <<EOF
19624 #define GCC_NORETURN $cf_directive
19625 EOF
19626
19627                                 ;;
19628                         (printf)
19629                                 cf_value='/* nothing */'
19630                                 if test "$cf_printf_attribute" != no ; then
19631                                         cf_value='__attribute__((format(printf,fmt,var)))'
19632
19633 cat >>confdefs.h <<\EOF
19634 #define GCC_PRINTF 1
19635 EOF
19636
19637                                 fi
19638
19639 cat >>confdefs.h <<EOF
19640 #define GCC_PRINTFLIKE(fmt,var) $cf_value
19641 EOF
19642
19643                                 ;;
19644                         (scanf)
19645                                 cf_value='/* nothing */'
19646                                 if test "$cf_scanf_attribute" != no ; then
19647                                         cf_value='__attribute__((format(scanf,fmt,var)))'
19648
19649 cat >>confdefs.h <<\EOF
19650 #define GCC_SCANF 1
19651 EOF
19652
19653                                 fi
19654
19655 cat >>confdefs.h <<EOF
19656 #define GCC_SCANFLIKE(fmt,var) $cf_value
19657 EOF
19658
19659                                 ;;
19660                         (unused)
19661
19662 cat >>confdefs.h <<EOF
19663 #define GCC_UNUSED $cf_directive
19664 EOF
19665
19666                                 ;;
19667                         esac
19668                 fi
19669         done
19670 else
19671         fgrep define conftest.i >>confdefs.h
19672 fi
19673 rm -rf conftest*
19674 fi
19675
19676 if test "x$have_x" = xyes; then
19677
19678 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
19679 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
19680 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
19681 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
19682 for cf_X_CFLAGS in $X_CFLAGS
19683 do
19684         case "x$cf_X_CFLAGS" in
19685         x-[IUD]*)
19686                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
19687                 ;;
19688         *)
19689                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
19690                 ;;
19691         esac
19692 done
19693
19694 cat >conftest.$ac_ext <<_ACEOF
19695 #line 19695 "configure"
19696 #include "confdefs.h"
19697
19698 #include <stdlib.h>
19699 #include <X11/Intrinsic.h>
19700
19701 int
19702 main (void)
19703 {
19704 String foo = malloc(1)
19705   ;
19706   return 0;
19707 }
19708 _ACEOF
19709 rm -f conftest.$ac_objext
19710 if { (eval echo "$as_me:19710: \"$ac_compile\"") >&5
19711   (eval $ac_compile) 2>&5
19712   ac_status=$?
19713   echo "$as_me:19713: \$? = $ac_status" >&5
19714   (exit $ac_status); } &&
19715          { ac_try='test -s conftest.$ac_objext'
19716   { (eval echo "$as_me:19716: \"$ac_try\"") >&5
19717   (eval $ac_try) 2>&5
19718   ac_status=$?
19719   echo "$as_me:19719: \$? = $ac_status" >&5
19720   (exit $ac_status); }; }; then
19721
19722 echo "$as_me:19722: checking for X11/Xt const-feature" >&5
19723 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
19724 if test "${cf_cv_const_x_string+set}" = set; then
19725   echo $ECHO_N "(cached) $ECHO_C" >&6
19726 else
19727
19728         cat >conftest.$ac_ext <<_ACEOF
19729 #line 19729 "configure"
19730 #include "confdefs.h"
19731
19732 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
19733 #undef  XTSTRINGDEFINES /* X11R5 and later */
19734 #include <stdlib.h>
19735 #include <X11/Intrinsic.h>
19736
19737 int
19738 main (void)
19739 {
19740 String foo = malloc(1); *foo = 0
19741   ;
19742   return 0;
19743 }
19744 _ACEOF
19745 rm -f conftest.$ac_objext
19746 if { (eval echo "$as_me:19746: \"$ac_compile\"") >&5
19747   (eval $ac_compile) 2>&5
19748   ac_status=$?
19749   echo "$as_me:19749: \$? = $ac_status" >&5
19750   (exit $ac_status); } &&
19751          { ac_try='test -s conftest.$ac_objext'
19752   { (eval echo "$as_me:19752: \"$ac_try\"") >&5
19753   (eval $ac_try) 2>&5
19754   ac_status=$?
19755   echo "$as_me:19755: \$? = $ac_status" >&5
19756   (exit $ac_status); }; }; then
19757
19758                         cf_cv_const_x_string=no
19759
19760 else
19761   echo "$as_me: failed program was:" >&5
19762 cat conftest.$ac_ext >&5
19763
19764                         cf_cv_const_x_string=yes
19765
19766 fi
19767 rm -f conftest.$ac_objext conftest.$ac_ext
19768
19769 fi
19770 echo "$as_me:19770: result: $cf_cv_const_x_string" >&5
19771 echo "${ECHO_T}$cf_cv_const_x_string" >&6
19772
19773 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
19774 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
19775 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
19776
19777 case $cf_cv_const_x_string in
19778 (no)
19779
19780         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19781         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
19782
19783         ;;
19784 (*)
19785
19786         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19787         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
19788
19789         ;;
19790 esac
19791
19792 else
19793   echo "$as_me: failed program was:" >&5
19794 cat conftest.$ac_ext >&5
19795 fi
19796 rm -f conftest.$ac_objext conftest.$ac_ext
19797  fi
19798 cat > conftest.$ac_ext <<EOF
19799 #line 19799 "${as_me:-configure}"
19800 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
19801 EOF
19802 if test "$INTEL_COMPILER" = yes
19803 then
19804 # The "-wdXXX" options suppress warnings:
19805 # remark #1419: external declaration in primary source file
19806 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
19807 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
19808 # remark #193: zero used for undefined preprocessing identifier
19809 # remark #593: variable "curs_sb_left_arrow" was set but never used
19810 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
19811 # remark #869: parameter "tw" was never referenced
19812 # remark #981: operands are evaluated in unspecified order
19813 # warning #279: controlling expression is constant
19814
19815         { echo "$as_me:19815: checking for $CC warning options..." >&5
19816 echo "$as_me: checking for $CC warning options..." >&6;}
19817         cf_save_CFLAGS="$CFLAGS"
19818         EXTRA_CFLAGS="-Wall"
19819         for cf_opt in \
19820                 wd1419 \
19821                 wd1683 \
19822                 wd1684 \
19823                 wd193 \
19824                 wd593 \
19825                 wd279 \
19826                 wd810 \
19827                 wd869 \
19828                 wd981
19829         do
19830                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19831                 if { (eval echo "$as_me:19831: \"$ac_compile\"") >&5
19832   (eval $ac_compile) 2>&5
19833   ac_status=$?
19834   echo "$as_me:19834: \$? = $ac_status" >&5
19835   (exit $ac_status); }; then
19836                         test -n "$verbose" && echo "$as_me:19836: result: ... -$cf_opt" >&5
19837 echo "${ECHO_T}... -$cf_opt" >&6
19838                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19839                 fi
19840         done
19841         CFLAGS="$cf_save_CFLAGS"
19842 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
19843 then
19844         { echo "$as_me:19844: checking for $CC warning options..." >&5
19845 echo "$as_me: checking for $CC warning options..." >&6;}
19846         cf_save_CFLAGS="$CFLAGS"
19847         EXTRA_CFLAGS=
19848         cf_warn_CONST=""
19849         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
19850         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
19851         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
19852         for cf_opt in W Wall \
19853                 Wbad-function-cast \
19854                 Wcast-align \
19855                 Wcast-qual \
19856                 Wdeclaration-after-statement \
19857                 Wextra \
19858                 Winline \
19859                 Wmissing-declarations \
19860                 Wmissing-prototypes \
19861                 Wnested-externs \
19862                 Wpointer-arith \
19863                 Wshadow \
19864                 Wstrict-prototypes \
19865                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
19866         do
19867                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19868                 if { (eval echo "$as_me:19868: \"$ac_compile\"") >&5
19869   (eval $ac_compile) 2>&5
19870   ac_status=$?
19871   echo "$as_me:19871: \$? = $ac_status" >&5
19872   (exit $ac_status); }; then
19873                         test -n "$verbose" && echo "$as_me:19873: result: ... -$cf_opt" >&5
19874 echo "${ECHO_T}... -$cf_opt" >&6
19875                         case $cf_opt in
19876                         (Winline)
19877                                 case $GCC_VERSION in
19878                                 ([34].*)
19879                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19880
19881 echo "${as_me:-configure}:19881: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19882
19883                                         continue;;
19884                                 esac
19885                                 ;;
19886                         (Wpointer-arith)
19887                                 case $GCC_VERSION in
19888                                 ([12].*)
19889                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19890
19891 echo "${as_me:-configure}:19891: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19892
19893                                         continue;;
19894                                 esac
19895                                 ;;
19896                         esac
19897                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19898                 fi
19899         done
19900         CFLAGS="$cf_save_CFLAGS"
19901 fi
19902 rm -rf conftest*
19903
19904 fi
19905 fi
19906
19907 echo "$as_me:19907: checking if you want to use dmalloc for testing" >&5
19908 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
19909
19910 # Check whether --with-dmalloc or --without-dmalloc was given.
19911 if test "${with_dmalloc+set}" = set; then
19912   withval="$with_dmalloc"
19913
19914 cat >>confdefs.h <<EOF
19915 #define USE_DMALLOC 1
19916 EOF
19917
19918         : ${with_cflags:=-g}
19919         : ${with_no_leaks:=yes}
19920          with_dmalloc=yes
19921 else
19922   with_dmalloc=
19923 fi;
19924 echo "$as_me:19924: result: ${with_dmalloc:-no}" >&5
19925 echo "${ECHO_T}${with_dmalloc:-no}" >&6
19926
19927 case .$with_cflags in
19928 (.*-g*)
19929         case .$CFLAGS in
19930         (.*-g*)
19931                 ;;
19932         (*)
19933
19934 cf_fix_cppflags=no
19935 cf_new_cflags=
19936 cf_new_cppflags=
19937 cf_new_extra_cppflags=
19938
19939 for cf_add_cflags in -g
19940 do
19941 case $cf_fix_cppflags in
19942 (no)
19943         case $cf_add_cflags in
19944         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19945                 case $cf_add_cflags in
19946                 (-D*)
19947                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19948
19949                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19950                                 && test -z "${cf_tst_cflags}" \
19951                                 && cf_fix_cppflags=yes
19952
19953                         if test $cf_fix_cppflags = yes ; then
19954
19955         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19956         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19957
19958                                 continue
19959                         elif test "${cf_tst_cflags}" = "\"'" ; then
19960
19961         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19962         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19963
19964                                 continue
19965                         fi
19966                         ;;
19967                 esac
19968                 case "$CPPFLAGS" in
19969                 (*$cf_add_cflags)
19970                         ;;
19971                 (*)
19972                         case $cf_add_cflags in
19973                         (-D*)
19974                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19975
19976 CPPFLAGS=`echo "$CPPFLAGS" | \
19977         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19978                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19979
19980                                 ;;
19981                         esac
19982
19983         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19984         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19985
19986                         ;;
19987                 esac
19988                 ;;
19989         (*)
19990
19991         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19992         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19993
19994                 ;;
19995         esac
19996         ;;
19997 (yes)
19998
19999         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20000         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20001
20002         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20003
20004         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20005                 && test -z "${cf_tst_cflags}" \
20006                 && cf_fix_cppflags=no
20007         ;;
20008 esac
20009 done
20010
20011 if test -n "$cf_new_cflags" ; then
20012
20013         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20014         CFLAGS="${CFLAGS}$cf_new_cflags"
20015
20016 fi
20017
20018 if test -n "$cf_new_cppflags" ; then
20019
20020         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20021         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20022
20023 fi
20024
20025 if test -n "$cf_new_extra_cppflags" ; then
20026
20027         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20028         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20029
20030 fi
20031
20032                 ;;
20033         esac
20034         ;;
20035 esac
20036
20037 if test "$with_dmalloc" = yes ; then
20038         echo "$as_me:20038: checking for dmalloc.h" >&5
20039 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
20040 if test "${ac_cv_header_dmalloc_h+set}" = set; then
20041   echo $ECHO_N "(cached) $ECHO_C" >&6
20042 else
20043   cat >conftest.$ac_ext <<_ACEOF
20044 #line 20044 "configure"
20045 #include "confdefs.h"
20046 #include <dmalloc.h>
20047 _ACEOF
20048 if { (eval echo "$as_me:20048: \"$ac_cpp conftest.$ac_ext\"") >&5
20049   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20050   ac_status=$?
20051   egrep -v '^ *\+' conftest.er1 >conftest.err
20052   rm -f conftest.er1
20053   cat conftest.err >&5
20054   echo "$as_me:20054: \$? = $ac_status" >&5
20055   (exit $ac_status); } >/dev/null; then
20056   if test -s conftest.err; then
20057     ac_cpp_err=$ac_c_preproc_warn_flag
20058   else
20059     ac_cpp_err=
20060   fi
20061 else
20062   ac_cpp_err=yes
20063 fi
20064 if test -z "$ac_cpp_err"; then
20065   ac_cv_header_dmalloc_h=yes
20066 else
20067   echo "$as_me: failed program was:" >&5
20068   cat conftest.$ac_ext >&5
20069   ac_cv_header_dmalloc_h=no
20070 fi
20071 rm -f conftest.err conftest.$ac_ext
20072 fi
20073 echo "$as_me:20073: result: $ac_cv_header_dmalloc_h" >&5
20074 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
20075 if test $ac_cv_header_dmalloc_h = yes; then
20076
20077 echo "$as_me:20077: checking for dmalloc_debug in -ldmalloc" >&5
20078 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
20079 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
20080   echo $ECHO_N "(cached) $ECHO_C" >&6
20081 else
20082   ac_check_lib_save_LIBS=$LIBS
20083 LIBS="-ldmalloc  $LIBS"
20084 cat >conftest.$ac_ext <<_ACEOF
20085 #line 20085 "configure"
20086 #include "confdefs.h"
20087
20088 /* Override any gcc2 internal prototype to avoid an error.  */
20089 #ifdef __cplusplus
20090 extern "C"
20091 #endif
20092 /* We use char because int might match the return type of a gcc2
20093    builtin and then its argument prototype would still apply.  */
20094 char dmalloc_debug ();
20095 int
20096 main (void)
20097 {
20098 dmalloc_debug ();
20099   ;
20100   return 0;
20101 }
20102 _ACEOF
20103 rm -f conftest.$ac_objext conftest$ac_exeext
20104 if { (eval echo "$as_me:20104: \"$ac_link\"") >&5
20105   (eval $ac_link) 2>&5
20106   ac_status=$?
20107   echo "$as_me:20107: \$? = $ac_status" >&5
20108   (exit $ac_status); } &&
20109          { ac_try='test -s conftest$ac_exeext'
20110   { (eval echo "$as_me:20110: \"$ac_try\"") >&5
20111   (eval $ac_try) 2>&5
20112   ac_status=$?
20113   echo "$as_me:20113: \$? = $ac_status" >&5
20114   (exit $ac_status); }; }; then
20115   ac_cv_lib_dmalloc_dmalloc_debug=yes
20116 else
20117   echo "$as_me: failed program was:" >&5
20118 cat conftest.$ac_ext >&5
20119 ac_cv_lib_dmalloc_dmalloc_debug=no
20120 fi
20121 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20122 LIBS=$ac_check_lib_save_LIBS
20123 fi
20124 echo "$as_me:20124: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
20125 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
20126 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
20127   cat >>confdefs.h <<EOF
20128 #define HAVE_LIBDMALLOC 1
20129 EOF
20130
20131   LIBS="-ldmalloc $LIBS"
20132
20133 fi
20134
20135 fi
20136
20137 fi
20138
20139 echo "$as_me:20139: checking if you want to use dbmalloc for testing" >&5
20140 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
20141
20142 # Check whether --with-dbmalloc or --without-dbmalloc was given.
20143 if test "${with_dbmalloc+set}" = set; then
20144   withval="$with_dbmalloc"
20145
20146 cat >>confdefs.h <<EOF
20147 #define USE_DBMALLOC 1
20148 EOF
20149
20150         : ${with_cflags:=-g}
20151         : ${with_no_leaks:=yes}
20152          with_dbmalloc=yes
20153 else
20154   with_dbmalloc=
20155 fi;
20156 echo "$as_me:20156: result: ${with_dbmalloc:-no}" >&5
20157 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
20158
20159 case .$with_cflags in
20160 (.*-g*)
20161         case .$CFLAGS in
20162         (.*-g*)
20163                 ;;
20164         (*)
20165
20166 cf_fix_cppflags=no
20167 cf_new_cflags=
20168 cf_new_cppflags=
20169 cf_new_extra_cppflags=
20170
20171 for cf_add_cflags in -g
20172 do
20173 case $cf_fix_cppflags in
20174 (no)
20175         case $cf_add_cflags in
20176         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20177                 case $cf_add_cflags in
20178                 (-D*)
20179                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20180
20181                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20182                                 && test -z "${cf_tst_cflags}" \
20183                                 && cf_fix_cppflags=yes
20184
20185                         if test $cf_fix_cppflags = yes ; then
20186
20187         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20188         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20189
20190                                 continue
20191                         elif test "${cf_tst_cflags}" = "\"'" ; then
20192
20193         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20194         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20195
20196                                 continue
20197                         fi
20198                         ;;
20199                 esac
20200                 case "$CPPFLAGS" in
20201                 (*$cf_add_cflags)
20202                         ;;
20203                 (*)
20204                         case $cf_add_cflags in
20205                         (-D*)
20206                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20207
20208 CPPFLAGS=`echo "$CPPFLAGS" | \
20209         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20210                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20211
20212                                 ;;
20213                         esac
20214
20215         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20216         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20217
20218                         ;;
20219                 esac
20220                 ;;
20221         (*)
20222
20223         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20224         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20225
20226                 ;;
20227         esac
20228         ;;
20229 (yes)
20230
20231         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20232         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20233
20234         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20235
20236         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20237                 && test -z "${cf_tst_cflags}" \
20238                 && cf_fix_cppflags=no
20239         ;;
20240 esac
20241 done
20242
20243 if test -n "$cf_new_cflags" ; then
20244
20245         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20246         CFLAGS="${CFLAGS}$cf_new_cflags"
20247
20248 fi
20249
20250 if test -n "$cf_new_cppflags" ; then
20251
20252         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20253         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20254
20255 fi
20256
20257 if test -n "$cf_new_extra_cppflags" ; then
20258
20259         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20260         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20261
20262 fi
20263
20264                 ;;
20265         esac
20266         ;;
20267 esac
20268
20269 if test "$with_dbmalloc" = yes ; then
20270         echo "$as_me:20270: checking for dbmalloc.h" >&5
20271 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
20272 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
20273   echo $ECHO_N "(cached) $ECHO_C" >&6
20274 else
20275   cat >conftest.$ac_ext <<_ACEOF
20276 #line 20276 "configure"
20277 #include "confdefs.h"
20278 #include <dbmalloc.h>
20279 _ACEOF
20280 if { (eval echo "$as_me:20280: \"$ac_cpp conftest.$ac_ext\"") >&5
20281   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20282   ac_status=$?
20283   egrep -v '^ *\+' conftest.er1 >conftest.err
20284   rm -f conftest.er1
20285   cat conftest.err >&5
20286   echo "$as_me:20286: \$? = $ac_status" >&5
20287   (exit $ac_status); } >/dev/null; then
20288   if test -s conftest.err; then
20289     ac_cpp_err=$ac_c_preproc_warn_flag
20290   else
20291     ac_cpp_err=
20292   fi
20293 else
20294   ac_cpp_err=yes
20295 fi
20296 if test -z "$ac_cpp_err"; then
20297   ac_cv_header_dbmalloc_h=yes
20298 else
20299   echo "$as_me: failed program was:" >&5
20300   cat conftest.$ac_ext >&5
20301   ac_cv_header_dbmalloc_h=no
20302 fi
20303 rm -f conftest.err conftest.$ac_ext
20304 fi
20305 echo "$as_me:20305: result: $ac_cv_header_dbmalloc_h" >&5
20306 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
20307 if test $ac_cv_header_dbmalloc_h = yes; then
20308
20309 echo "$as_me:20309: checking for debug_malloc in -ldbmalloc" >&5
20310 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
20311 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
20312   echo $ECHO_N "(cached) $ECHO_C" >&6
20313 else
20314   ac_check_lib_save_LIBS=$LIBS
20315 LIBS="-ldbmalloc  $LIBS"
20316 cat >conftest.$ac_ext <<_ACEOF
20317 #line 20317 "configure"
20318 #include "confdefs.h"
20319
20320 /* Override any gcc2 internal prototype to avoid an error.  */
20321 #ifdef __cplusplus
20322 extern "C"
20323 #endif
20324 /* We use char because int might match the return type of a gcc2
20325    builtin and then its argument prototype would still apply.  */
20326 char debug_malloc ();
20327 int
20328 main (void)
20329 {
20330 debug_malloc ();
20331   ;
20332   return 0;
20333 }
20334 _ACEOF
20335 rm -f conftest.$ac_objext conftest$ac_exeext
20336 if { (eval echo "$as_me:20336: \"$ac_link\"") >&5
20337   (eval $ac_link) 2>&5
20338   ac_status=$?
20339   echo "$as_me:20339: \$? = $ac_status" >&5
20340   (exit $ac_status); } &&
20341          { ac_try='test -s conftest$ac_exeext'
20342   { (eval echo "$as_me:20342: \"$ac_try\"") >&5
20343   (eval $ac_try) 2>&5
20344   ac_status=$?
20345   echo "$as_me:20345: \$? = $ac_status" >&5
20346   (exit $ac_status); }; }; then
20347   ac_cv_lib_dbmalloc_debug_malloc=yes
20348 else
20349   echo "$as_me: failed program was:" >&5
20350 cat conftest.$ac_ext >&5
20351 ac_cv_lib_dbmalloc_debug_malloc=no
20352 fi
20353 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20354 LIBS=$ac_check_lib_save_LIBS
20355 fi
20356 echo "$as_me:20356: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
20357 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
20358 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
20359   cat >>confdefs.h <<EOF
20360 #define HAVE_LIBDBMALLOC 1
20361 EOF
20362
20363   LIBS="-ldbmalloc $LIBS"
20364
20365 fi
20366
20367 fi
20368
20369 fi
20370
20371 echo "$as_me:20371: checking if you want to use valgrind for testing" >&5
20372 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
20373
20374 # Check whether --with-valgrind or --without-valgrind was given.
20375 if test "${with_valgrind+set}" = set; then
20376   withval="$with_valgrind"
20377
20378 cat >>confdefs.h <<EOF
20379 #define USE_VALGRIND 1
20380 EOF
20381
20382         : ${with_cflags:=-g}
20383         : ${with_no_leaks:=yes}
20384          with_valgrind=yes
20385 else
20386   with_valgrind=
20387 fi;
20388 echo "$as_me:20388: result: ${with_valgrind:-no}" >&5
20389 echo "${ECHO_T}${with_valgrind:-no}" >&6
20390
20391 case .$with_cflags in
20392 (.*-g*)
20393         case .$CFLAGS in
20394         (.*-g*)
20395                 ;;
20396         (*)
20397
20398 cf_fix_cppflags=no
20399 cf_new_cflags=
20400 cf_new_cppflags=
20401 cf_new_extra_cppflags=
20402
20403 for cf_add_cflags in -g
20404 do
20405 case $cf_fix_cppflags in
20406 (no)
20407         case $cf_add_cflags in
20408         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20409                 case $cf_add_cflags in
20410                 (-D*)
20411                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20412
20413                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20414                                 && test -z "${cf_tst_cflags}" \
20415                                 && cf_fix_cppflags=yes
20416
20417                         if test $cf_fix_cppflags = yes ; then
20418
20419         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20420         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20421
20422                                 continue
20423                         elif test "${cf_tst_cflags}" = "\"'" ; then
20424
20425         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20426         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20427
20428                                 continue
20429                         fi
20430                         ;;
20431                 esac
20432                 case "$CPPFLAGS" in
20433                 (*$cf_add_cflags)
20434                         ;;
20435                 (*)
20436                         case $cf_add_cflags in
20437                         (-D*)
20438                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20439
20440 CPPFLAGS=`echo "$CPPFLAGS" | \
20441         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20442                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20443
20444                                 ;;
20445                         esac
20446
20447         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20448         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20449
20450                         ;;
20451                 esac
20452                 ;;
20453         (*)
20454
20455         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20456         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20457
20458                 ;;
20459         esac
20460         ;;
20461 (yes)
20462
20463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20465
20466         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20467
20468         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20469                 && test -z "${cf_tst_cflags}" \
20470                 && cf_fix_cppflags=no
20471         ;;
20472 esac
20473 done
20474
20475 if test -n "$cf_new_cflags" ; then
20476
20477         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20478         CFLAGS="${CFLAGS}$cf_new_cflags"
20479
20480 fi
20481
20482 if test -n "$cf_new_cppflags" ; then
20483
20484         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20485         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20486
20487 fi
20488
20489 if test -n "$cf_new_extra_cppflags" ; then
20490
20491         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20492         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20493
20494 fi
20495
20496                 ;;
20497         esac
20498         ;;
20499 esac
20500
20501 echo "$as_me:20501: checking if you want to perform memory-leak testing" >&5
20502 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
20503
20504 # Check whether --enable-leaks or --disable-leaks was given.
20505 if test "${enable_leaks+set}" = set; then
20506   enableval="$enable_leaks"
20507   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
20508 else
20509   : ${with_no_leaks:=no}
20510 fi;
20511 echo "$as_me:20511: result: $with_no_leaks" >&5
20512 echo "${ECHO_T}$with_no_leaks" >&6
20513
20514 if test "$with_no_leaks" = yes ; then
20515
20516 cat >>confdefs.h <<\EOF
20517 #define NO_LEAKS 1
20518 EOF
20519
20520 cat >>confdefs.h <<\EOF
20521 #define YY_NO_LEAKS 1
20522 EOF
20523
20524 fi
20525
20526 LD_RPATH_OPT=
20527 if test "x$cf_cv_enable_rpath" != xno
20528 then
20529         echo "$as_me:20529: checking for an rpath option" >&5
20530 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
20531         case $cf_cv_system_name in
20532         (irix*)
20533                 if test "$GCC" = yes; then
20534                         LD_RPATH_OPT="-Wl,-rpath,"
20535                 else
20536                         LD_RPATH_OPT="-rpath "
20537                 fi
20538                 ;;
20539         (linux*|gnu*|k*bsd*-gnu|freebsd*)
20540                 LD_RPATH_OPT="-Wl,-rpath,"
20541                 ;;
20542         (openbsd[2-9].*|mirbsd*)
20543                 LD_RPATH_OPT="-Wl,-rpath,"
20544                 ;;
20545         (dragonfly*)
20546                 LD_RPATH_OPT="-rpath "
20547                 ;;
20548         (netbsd*)
20549                 LD_RPATH_OPT="-Wl,-rpath,"
20550                 ;;
20551         (osf*|mls+*)
20552                 LD_RPATH_OPT="-rpath "
20553                 ;;
20554         (solaris2*)
20555                 LD_RPATH_OPT="-R"
20556                 ;;
20557         (*)
20558                 ;;
20559         esac
20560         echo "$as_me:20560: result: $LD_RPATH_OPT" >&5
20561 echo "${ECHO_T}$LD_RPATH_OPT" >&6
20562
20563         case "x$LD_RPATH_OPT" in
20564         (x-R*)
20565                 echo "$as_me:20565: checking if we need a space after rpath option" >&5
20566 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
20567                 cf_save_LIBS="$LIBS"
20568
20569 cf_add_libs="$LIBS"
20570 # reverse order
20571 cf_add_0lib=
20572 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
20573 # filter duplicates
20574 for cf_add_1lib in $cf_add_0lib; do
20575         for cf_add_2lib in $cf_add_libs; do
20576                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
20577                         cf_add_1lib=
20578                         break
20579                 fi
20580         done
20581         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
20582 done
20583 LIBS="$cf_add_libs"
20584
20585                 cat >conftest.$ac_ext <<_ACEOF
20586 #line 20586 "configure"
20587 #include "confdefs.h"
20588
20589 int
20590 main (void)
20591 {
20592
20593   ;
20594   return 0;
20595 }
20596 _ACEOF
20597 rm -f conftest.$ac_objext conftest$ac_exeext
20598 if { (eval echo "$as_me:20598: \"$ac_link\"") >&5
20599   (eval $ac_link) 2>&5
20600   ac_status=$?
20601   echo "$as_me:20601: \$? = $ac_status" >&5
20602   (exit $ac_status); } &&
20603          { ac_try='test -s conftest$ac_exeext'
20604   { (eval echo "$as_me:20604: \"$ac_try\"") >&5
20605   (eval $ac_try) 2>&5
20606   ac_status=$?
20607   echo "$as_me:20607: \$? = $ac_status" >&5
20608   (exit $ac_status); }; }; then
20609   cf_rpath_space=no
20610 else
20611   echo "$as_me: failed program was:" >&5
20612 cat conftest.$ac_ext >&5
20613 cf_rpath_space=yes
20614 fi
20615 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20616                 LIBS="$cf_save_LIBS"
20617                 echo "$as_me:20617: result: $cf_rpath_space" >&5
20618 echo "${ECHO_T}$cf_rpath_space" >&6
20619                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
20620                 ;;
20621         esac
20622 fi
20623
20624 echo "$as_me:20624: checking if rpath-hack should be disabled" >&5
20625 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
20626
20627 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
20628 if test "${enable_rpath_hack+set}" = set; then
20629   enableval="$enable_rpath_hack"
20630   test "$enableval" != no && enableval=yes
20631         if test "$enableval" != "yes" ; then
20632     cf_disable_rpath_hack=yes
20633         else
20634                 cf_disable_rpath_hack=no
20635         fi
20636 else
20637   enableval=yes
20638         cf_disable_rpath_hack=no
20639
20640 fi;
20641 echo "$as_me:20641: result: $cf_disable_rpath_hack" >&5
20642 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
20643 if test "$cf_disable_rpath_hack" = no ; then
20644
20645 echo "$as_me:20645: checking for updated LDFLAGS" >&5
20646 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
20647 if test -n "$LD_RPATH_OPT" ; then
20648         echo "$as_me:20648: result: maybe" >&5
20649 echo "${ECHO_T}maybe" >&6
20650
20651         for ac_prog in ldd
20652 do
20653   # Extract the first word of "$ac_prog", so it can be a program name with args.
20654 set dummy $ac_prog; ac_word=$2
20655 echo "$as_me:20655: checking for $ac_word" >&5
20656 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
20657 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
20658   echo $ECHO_N "(cached) $ECHO_C" >&6
20659 else
20660   if test -n "$cf_ldd_prog"; then
20661   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
20662 else
20663   ac_save_IFS=$IFS; IFS=$ac_path_separator
20664 ac_dummy="$PATH"
20665 for ac_dir in $ac_dummy; do
20666   IFS=$ac_save_IFS
20667   test -z "$ac_dir" && ac_dir=.
20668   $as_executable_p "$ac_dir/$ac_word" || continue
20669 ac_cv_prog_cf_ldd_prog="$ac_prog"
20670 echo "$as_me:20670: found $ac_dir/$ac_word" >&5
20671 break
20672 done
20673
20674 fi
20675 fi
20676 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
20677 if test -n "$cf_ldd_prog"; then
20678   echo "$as_me:20678: result: $cf_ldd_prog" >&5
20679 echo "${ECHO_T}$cf_ldd_prog" >&6
20680 else
20681   echo "$as_me:20681: result: no" >&5
20682 echo "${ECHO_T}no" >&6
20683 fi
20684
20685   test -n "$cf_ldd_prog" && break
20686 done
20687 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
20688
20689         cf_rpath_list="/usr/lib /lib"
20690         if test "$cf_ldd_prog" != no
20691         then
20692                 cf_rpath_oops=
20693
20694 cat >conftest.$ac_ext <<_ACEOF
20695 #line 20695 "configure"
20696 #include "confdefs.h"
20697 #include <stdio.h>
20698 int
20699 main (void)
20700 {
20701 printf("Hello");
20702   ;
20703   return 0;
20704 }
20705 _ACEOF
20706 rm -f conftest.$ac_objext conftest$ac_exeext
20707 if { (eval echo "$as_me:20707: \"$ac_link\"") >&5
20708   (eval $ac_link) 2>&5
20709   ac_status=$?
20710   echo "$as_me:20710: \$? = $ac_status" >&5
20711   (exit $ac_status); } &&
20712          { ac_try='test -s conftest$ac_exeext'
20713   { (eval echo "$as_me:20713: \"$ac_try\"") >&5
20714   (eval $ac_try) 2>&5
20715   ac_status=$?
20716   echo "$as_me:20716: \$? = $ac_status" >&5
20717   (exit $ac_status); }; }; then
20718   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
20719                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
20720 else
20721   echo "$as_me: failed program was:" >&5
20722 cat conftest.$ac_ext >&5
20723 fi
20724 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20725
20726                 # If we passed the link-test, but get a "not found" on a given library,
20727                 # this could be due to inept reconfiguration of gcc to make it only
20728                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
20729                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
20730                 # /usr/local libraries.
20731                 if test -n "$cf_rpath_oops"
20732                 then
20733                         for cf_rpath_src in $cf_rpath_oops
20734                         do
20735                                 for cf_rpath_dir in \
20736                                         /usr/local \
20737                                         /usr/pkg \
20738                                         /opt/sfw
20739                                 do
20740                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
20741                                         then
20742                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
20743
20744 echo "${as_me:-configure}:20744: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
20745
20746                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
20747                                                 break
20748                                         fi
20749                                 done
20750                         done
20751                 fi
20752         fi
20753
20754         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20755
20756 echo "${as_me:-configure}:20756: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20757
20758 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
20759
20760 echo "${as_me:-configure}:20760: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
20761
20762 cf_rpath_dst=
20763 for cf_rpath_src in $LDFLAGS
20764 do
20765         case $cf_rpath_src in
20766         (-L*)
20767
20768                 # check if this refers to a directory which we will ignore
20769                 cf_rpath_skip=no
20770                 if test -n "$cf_rpath_list"
20771                 then
20772                         for cf_rpath_item in $cf_rpath_list
20773                         do
20774                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20775                                 then
20776                                         cf_rpath_skip=yes
20777                                         break
20778                                 fi
20779                         done
20780                 fi
20781
20782                 if test "$cf_rpath_skip" = no
20783                 then
20784                         # transform the option
20785                         if test "$LD_RPATH_OPT" = "-R " ; then
20786                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20787                         else
20788                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20789                         fi
20790
20791                         # if we have not already added this, add it now
20792                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20793                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20794                         then
20795                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20796
20797 echo "${as_me:-configure}:20797: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20798
20799                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20800                         fi
20801                 fi
20802                 ;;
20803         esac
20804         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20805 done
20806 LDFLAGS=$cf_rpath_dst
20807
20808 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
20809
20810 echo "${as_me:-configure}:20810: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
20811
20812 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
20813
20814 echo "${as_me:-configure}:20814: testing ...checking LIBS $LIBS ..." 1>&5
20815
20816 cf_rpath_dst=
20817 for cf_rpath_src in $LIBS
20818 do
20819         case $cf_rpath_src in
20820         (-L*)
20821
20822                 # check if this refers to a directory which we will ignore
20823                 cf_rpath_skip=no
20824                 if test -n "$cf_rpath_list"
20825                 then
20826                         for cf_rpath_item in $cf_rpath_list
20827                         do
20828                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20829                                 then
20830                                         cf_rpath_skip=yes
20831                                         break
20832                                 fi
20833                         done
20834                 fi
20835
20836                 if test "$cf_rpath_skip" = no
20837                 then
20838                         # transform the option
20839                         if test "$LD_RPATH_OPT" = "-R " ; then
20840                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20841                         else
20842                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20843                         fi
20844
20845                         # if we have not already added this, add it now
20846                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20847                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20848                         then
20849                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20850
20851 echo "${as_me:-configure}:20851: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20852
20853                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20854                         fi
20855                 fi
20856                 ;;
20857         esac
20858         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20859 done
20860 LIBS=$cf_rpath_dst
20861
20862 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
20863
20864 echo "${as_me:-configure}:20864: testing ...checked LIBS $LIBS ..." 1>&5
20865
20866         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20867
20868 echo "${as_me:-configure}:20868: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20869
20870 else
20871         echo "$as_me:20871: result: no" >&5
20872 echo "${ECHO_T}no" >&6
20873 fi
20874
20875 fi
20876
20877 TEST_ARGS="$LIBS"
20878 LIBS=
20879
20880 ac_config_files="$ac_config_files Makefile"
20881 ac_config_commands="$ac_config_commands default"
20882 cat >confcache <<\_ACEOF
20883 # This file is a shell script that caches the results of configure
20884 # tests run on this system so they can be shared between configure
20885 # scripts and configure runs, see configure's option --config-cache.
20886 # It is not useful on other systems.  If it contains results you don't
20887 # want to keep, you may remove or edit it.
20888 #
20889 # config.status only pays attention to the cache file if you give it
20890 # the --recheck option to rerun configure.
20891 #
20892 # `ac_cv_env_foo' variables (set or unset) will be overriden when
20893 # loading this file, other *unset* `ac_cv_foo' will be assigned the
20894 # following values.
20895
20896 _ACEOF
20897
20898 # The following way of writing the cache mishandles newlines in values,
20899 # but we know of no workaround that is simple, portable, and efficient.
20900 # So, don't put newlines in cache variables' values.
20901 # Ultrix sh set writes to stderr and can't be redirected directly,
20902 # and sets the high bit in the cache file unless we assign to the vars.
20903 {
20904   (set) 2>&1 |
20905     case `(ac_space=' '; set | grep ac_space) 2>&1` in
20906     *ac_space=\ *)
20907       # `set' does not quote correctly, so add quotes (double-quote
20908       # substitution turns \\\\ into \\, and sed turns \\ into \).
20909       sed -n \
20910         "s/'/'\\\\''/g;
20911           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
20912       ;;
20913     *)
20914       # `set' quotes correctly as required by POSIX, so do not add quotes.
20915       sed -n \
20916         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
20917       ;;
20918     esac;
20919 } |
20920   sed '
20921      t clear
20922      : clear
20923      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
20924      t end
20925      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
20926      : end' >>confcache
20927 if cmp -s $cache_file confcache; then :; else
20928   if test -w $cache_file; then
20929     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
20930     cat confcache >$cache_file
20931   else
20932     echo "not updating unwritable cache $cache_file"
20933   fi
20934 fi
20935 rm -f confcache
20936
20937 test "x$prefix" = xNONE && prefix=$ac_default_prefix
20938 # Let make expand exec_prefix.
20939 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
20940
20941 # VPATH may cause trouble with some makes, so we remove $(srcdir),
20942 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
20943 # trailing colons and then remove the whole line if VPATH becomes empty
20944 # (actually we leave an empty line to preserve line numbers).
20945 if test "x$srcdir" = x.; then
20946   ac_vpsub='/^[         ]*VPATH[        ]*=/{
20947 s/:*\$(srcdir):*/:/;
20948 s/:*\${srcdir}:*/:/;
20949 s/:*@srcdir@:*/:/;
20950 s/^\([^=]*=[    ]*\):*/\1/;
20951 s/:*$//;
20952 s/^[^=]*=[      ]*$//;
20953 }'
20954 fi
20955
20956 DEFS=-DHAVE_CONFIG_H
20957
20958 : ${CONFIG_STATUS=./config.status}
20959 ac_clean_files_save=$ac_clean_files
20960 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
20961 { echo "$as_me:20961: creating $CONFIG_STATUS" >&5
20962 echo "$as_me: creating $CONFIG_STATUS" >&6;}
20963 cat >$CONFIG_STATUS <<_ACEOF
20964 #! $SHELL
20965 # Generated automatically by configure.
20966 # Run this file to recreate the current configuration.
20967 # Compiler output produced by configure, useful for debugging
20968 # configure, is in config.log if it exists.
20969
20970 debug=false
20971 SHELL=\${CONFIG_SHELL-$SHELL}
20972 ac_cs_invocation="\$0 \$@"
20973
20974 _ACEOF
20975
20976 cat >>$CONFIG_STATUS <<\_ACEOF
20977 # Be Bourne compatible
20978 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
20979   emulate sh
20980   NULLCMD=:
20981 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
20982   set -o posix
20983 fi
20984
20985 # Name of the executable.
20986 as_me=`echo "$0" |sed 's,.*[\\/],,'`
20987
20988 if expr a : '\(a\)' >/dev/null 2>&1; then
20989   as_expr=expr
20990 else
20991   as_expr=false
20992 fi
20993
20994 rm -f conf$$ conf$$.exe conf$$.file
20995 echo >conf$$.file
20996 if ln -s conf$$.file conf$$ 2>/dev/null; then
20997   # We could just check for DJGPP; but this test a) works b) is more generic
20998   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
20999   if test -f conf$$.exe; then
21000     # Don't use ln at all; we don't have any links
21001     as_ln_s='cp -p'
21002   else
21003     as_ln_s='ln -s'
21004   fi
21005 elif ln conf$$.file conf$$ 2>/dev/null; then
21006   as_ln_s=ln
21007 else
21008   as_ln_s='cp -p'
21009 fi
21010 rm -f conf$$ conf$$.exe conf$$.file
21011
21012 as_executable_p="test -f"
21013
21014 # Support unset when possible.
21015 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
21016   as_unset=unset
21017 else
21018   as_unset=false
21019 fi
21020
21021 # NLS nuisances.
21022 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
21023 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
21024 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
21025 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
21026 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
21027 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
21028 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
21029 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
21030
21031 # IFS
21032 # We need space, tab and new line, in precisely that order.
21033 as_nl='
21034 '
21035 IFS="   $as_nl"
21036
21037 # CDPATH.
21038 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
21039
21040 exec 6>&1
21041
21042 _ACEOF
21043
21044 # Files that config.status was made for.
21045 if test -n "$ac_config_files"; then
21046   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
21047 fi
21048
21049 if test -n "$ac_config_headers"; then
21050   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
21051 fi
21052
21053 if test -n "$ac_config_links"; then
21054   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
21055 fi
21056
21057 if test -n "$ac_config_commands"; then
21058   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
21059 fi
21060
21061 cat >>$CONFIG_STATUS <<\EOF
21062
21063 ac_cs_usage="\
21064 \`$as_me' instantiates files from templates according to the
21065 current configuration.
21066
21067 Usage: $0 [OPTIONS] [FILE]...
21068
21069   -h, --help       print this help, then exit
21070   -V, --version    print version number, then exit
21071   -d, --debug      don't remove temporary files
21072       --recheck    update $as_me by reconfiguring in the same conditions
21073   --file=FILE[:TEMPLATE]
21074                    instantiate the configuration file FILE
21075   --header=FILE[:TEMPLATE]
21076                    instantiate the configuration header FILE
21077
21078 Configuration files:
21079 $config_files
21080
21081 Configuration headers:
21082 $config_headers
21083
21084 Configuration commands:
21085 $config_commands
21086
21087 Report bugs to <dickey@invisible-island.net>."
21088 EOF
21089
21090 cat >>$CONFIG_STATUS <<EOF
21091 ac_cs_version="\\
21092 config.status
21093 configured by $0, generated by GNU Autoconf 2.52.20200111,
21094   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
21095
21096 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
21097 Free Software Foundation, Inc.
21098 This config.status script is free software; the Free Software Foundation
21099 gives unlimited permission to copy, distribute and modify it."
21100 srcdir=$srcdir
21101 INSTALL="$INSTALL"
21102 EOF
21103
21104 cat >>$CONFIG_STATUS <<\EOF
21105 # If no file are specified by the user, then we need to provide default
21106 # value.  By we need to know if files were specified by the user.
21107 ac_need_defaults=:
21108 while test $# != 0
21109 do
21110   case $1 in
21111   --*=*)
21112     ac_option=`expr "x$1" : 'x\([^=]*\)='`
21113     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
21114     shift
21115     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
21116     shift
21117     ;;
21118   -*);;
21119   *) # This is not an option, so the user has probably given explicit
21120      # arguments.
21121      ac_need_defaults=false;;
21122   esac
21123
21124   case $1 in
21125   # Handling of the options.
21126 EOF
21127 cat >>$CONFIG_STATUS <<EOF
21128   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
21129     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
21130     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
21131 EOF
21132 cat >>$CONFIG_STATUS <<\EOF
21133   --version | --vers* | -V )
21134     echo "$ac_cs_version"; exit 0 ;;
21135   --he | --h)
21136     # Conflict between --help and --header
21137     { { echo "$as_me:21137: error: ambiguous option: $1
21138 Try \`$0 --help' for more information." >&5
21139 echo "$as_me: error: ambiguous option: $1
21140 Try \`$0 --help' for more information." >&2;}
21141    { (exit 1); exit 1; }; };;
21142   --help | --hel | -h )
21143     echo "$ac_cs_usage"; exit 0 ;;
21144   --debug | --d* | -d )
21145     debug=: ;;
21146   --file | --fil | --fi | --f )
21147     shift
21148     CONFIG_FILES="$CONFIG_FILES $1"
21149     ac_need_defaults=false;;
21150   --header | --heade | --head | --hea )
21151     shift
21152     CONFIG_HEADERS="$CONFIG_HEADERS $1"
21153     ac_need_defaults=false;;
21154
21155   # This is an error.
21156   -*) { { echo "$as_me:21156: error: unrecognized option: $1
21157 Try \`$0 --help' for more information." >&5
21158 echo "$as_me: error: unrecognized option: $1
21159 Try \`$0 --help' for more information." >&2;}
21160    { (exit 1); exit 1; }; } ;;
21161
21162   *) ac_config_targets="$ac_config_targets $1" ;;
21163
21164   esac
21165   shift
21166 done
21167
21168 exec 5>>config.log
21169 cat >&5 << _ACEOF
21170
21171 ## ----------------------- ##
21172 ## Running config.status.  ##
21173 ## ----------------------- ##
21174
21175 This file was extended by $as_me 2.52.20200111, executed with
21176   CONFIG_FILES    = $CONFIG_FILES
21177   CONFIG_HEADERS  = $CONFIG_HEADERS
21178   CONFIG_LINKS    = $CONFIG_LINKS
21179   CONFIG_COMMANDS = $CONFIG_COMMANDS
21180   > $ac_cs_invocation
21181 on `(hostname || uname -n) 2>/dev/null | sed 1q`
21182
21183 _ACEOF
21184 EOF
21185
21186 cat >>$CONFIG_STATUS <<EOF
21187 #
21188 # INIT-COMMANDS section.
21189 #
21190
21191 AWK="$AWK"
21192 ECHO_CC="$ECHO_CC"
21193 ECHO_LD="$ECHO_LD"
21194 SHOW_CC="$SHOW_LD"
21195
21196 EOF
21197
21198 cat >>$CONFIG_STATUS <<\EOF
21199 for ac_config_target in $ac_config_targets
21200 do
21201   case "$ac_config_target" in
21202   # Handling of arguments.
21203   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
21204   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
21205   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
21206   *) { { echo "$as_me:21206: error: invalid argument: $ac_config_target" >&5
21207 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
21208    { (exit 1); exit 1; }; };;
21209   esac
21210 done
21211
21212 # If the user did not use the arguments to specify the items to instantiate,
21213 # then the envvar interface is used.  Set only those that are not.
21214 # We use the long form for the default assignment because of an extremely
21215 # bizarre bug on SunOS 4.1.3.
21216 if $ac_need_defaults; then
21217   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
21218   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
21219   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
21220 fi
21221
21222 # Create a temporary directory, and hook for its removal unless debugging.
21223 $debug ||
21224 {
21225   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
21226   trap '{ (exit 1); exit 1; }' 1 2 13 15
21227 }
21228
21229 # Create a (secure) tmp directory for tmp files.
21230 : ${TMPDIR=/tmp}
21231 {
21232   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
21233   test -n "$tmp" && test -d "$tmp"
21234 }  ||
21235 {
21236   tmp=$TMPDIR/cs$$-$RANDOM
21237   (umask 077 && mkdir $tmp)
21238 } ||
21239 {
21240    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
21241    { (exit 1); exit 1; }
21242 }
21243
21244 EOF
21245
21246 cat >>$CONFIG_STATUS <<EOF
21247
21248 #
21249 # CONFIG_FILES section.
21250 #
21251
21252 # No need to generate the scripts if there are no CONFIG_FILES.
21253 # This happens for instance when ./config.status config.h
21254 if test -n "\$CONFIG_FILES"; then
21255   # Protect against being on the right side of a sed subst in config.status.
21256   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
21257    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
21258 s,@SHELL@,$SHELL,;t t
21259 s,@exec_prefix@,$exec_prefix,;t t
21260 s,@prefix@,$prefix,;t t
21261 s,@program_transform_name@,$program_transform_name,;t t
21262 s,@bindir@,$bindir,;t t
21263 s,@sbindir@,$sbindir,;t t
21264 s,@libexecdir@,$libexecdir,;t t
21265 s,@datarootdir@,$datarootdir,;t t
21266 s,@datadir@,$datadir,;t t
21267 s,@sysconfdir@,$sysconfdir,;t t
21268 s,@sharedstatedir@,$sharedstatedir,;t t
21269 s,@localstatedir@,$localstatedir,;t t
21270 s,@runstatedir@,$runstatedir,;t t
21271 s,@libdir@,$libdir,;t t
21272 s,@includedir@,$includedir,;t t
21273 s,@oldincludedir@,$oldincludedir,;t t
21274 s,@infodir@,$infodir,;t t
21275 s,@mandir@,$mandir,;t t
21276 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
21277 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
21278 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
21279 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
21280 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
21281 s,@build_alias@,$build_alias,;t t
21282 s,@host_alias@,$host_alias,;t t
21283 s,@target_alias@,$target_alias,;t t
21284 s,@ECHO_C@,$ECHO_C,;t t
21285 s,@ECHO_N@,$ECHO_N,;t t
21286 s,@ECHO_T@,$ECHO_T,;t t
21287 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
21288 s,@DEFS@,$DEFS,;t t
21289 s,@LIBS@,$LIBS,;t t
21290 s,@build@,$build,;t t
21291 s,@build_cpu@,$build_cpu,;t t
21292 s,@build_vendor@,$build_vendor,;t t
21293 s,@build_os@,$build_os,;t t
21294 s,@host@,$host,;t t
21295 s,@host_cpu@,$host_cpu,;t t
21296 s,@host_vendor@,$host_vendor,;t t
21297 s,@host_os@,$host_os,;t t
21298 s,@SET_MAKE@,$SET_MAKE,;t t
21299 s,@CC@,$CC,;t t
21300 s,@CFLAGS@,$CFLAGS,;t t
21301 s,@LDFLAGS@,$LDFLAGS,;t t
21302 s,@CPPFLAGS@,$CPPFLAGS,;t t
21303 s,@ac_ct_CC@,$ac_ct_CC,;t t
21304 s,@EXEEXT@,$EXEEXT,;t t
21305 s,@OBJEXT@,$OBJEXT,;t t
21306 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
21307 s,@CPP@,$CPP,;t t
21308 s,@AWK@,$AWK,;t t
21309 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
21310 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
21311 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
21312 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
21313 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
21314 s,@LINT@,$LINT,;t t
21315 s,@LINT_OPTS@,$LINT_OPTS,;t t
21316 s,@CTAGS@,$CTAGS,;t t
21317 s,@ETAGS@,$ETAGS,;t t
21318 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
21319 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
21320 s,@MATH_LIB@,$MATH_LIB,;t t
21321 s,@top_builddir@,$top_builddir,;t t
21322 s,@CC_G_OPT@,$CC_G_OPT,;t t
21323 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
21324 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
21325 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
21326 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
21327 s,@LD@,$LD,;t t
21328 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
21329 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
21330 s,@LD_MODEL@,$LD_MODEL,;t t
21331 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
21332 s,@LIBTOOL@,$LIBTOOL,;t t
21333 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
21334 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
21335 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
21336 s,@LIB_LINK@,$LIB_LINK,;t t
21337 s,@LINK_TESTS@,$LINK_TESTS,;t t
21338 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
21339 s,@PACKAGE@,$PACKAGE,;t t
21340 s,@PTHREAD@,$PTHREAD,;t t
21341 s,@TEST_ARGS@,$TEST_ARGS,;t t
21342 s,@TEST_DEPS@,$TEST_DEPS,;t t
21343 s,@TEST_LIBS@,$TEST_LIBS,;t t
21344 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
21345 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
21346 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
21347 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
21348 s,@includesubdir@,$includesubdir,;t t
21349 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
21350 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
21351 s,@ECHO_LT@,$ECHO_LT,;t t
21352 s,@ECHO_LD@,$ECHO_LD,;t t
21353 s,@RULE_CC@,$RULE_CC,;t t
21354 s,@SHOW_CC@,$SHOW_CC,;t t
21355 s,@ECHO_CC@,$ECHO_CC,;t t
21356 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
21357 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
21358 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
21359 s,@X_CFLAGS@,$X_CFLAGS,;t t
21360 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
21361 s,@X_LIBS@,$X_LIBS,;t t
21362 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
21363 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
21364 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
21365 s,@RGB_PATH@,$RGB_PATH,;t t
21366 s,@no_x11_rgb@,$no_x11_rgb,;t t
21367 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
21368 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
21369 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
21370 CEOF
21371
21372 EOF
21373
21374   cat >>$CONFIG_STATUS <<\EOF
21375   # Split the substitutions into bite-sized pieces for seds with
21376   # small command number limits, like on Digital OSF/1 and HP-UX.
21377   ac_max_sed_lines=48
21378   ac_sed_frag=1 # Number of current file.
21379   ac_beg=1 # First line for current file.
21380   ac_end=$ac_max_sed_lines # Line after last line for current file.
21381   ac_more_lines=:
21382   ac_sed_cmds=
21383   while $ac_more_lines; do
21384     if test $ac_beg -gt 1; then
21385       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21386     else
21387       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21388     fi
21389     if test ! -s $tmp/subs.frag; then
21390       ac_more_lines=false
21391     else
21392       # The purpose of the label and of the branching condition is to
21393       # speed up the sed processing (if there are no `@' at all, there
21394       # is no need to browse any of the substitutions).
21395       # These are the two extra sed commands mentioned above.
21396       (echo ':t
21397   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
21398       # It is possible to make a multiline substitution using escaped newlines.
21399       # Ensure that we do not split the substitution between script fragments.
21400       ac_BEG=$ac_end
21401       ac_END=`expr $ac_end + $ac_max_sed_lines`
21402       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
21403       if test -s $tmp/subs.next; then
21404         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
21405         if test ! -s $tmp/subs.edit; then
21406           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
21407           if test ! -s $tmp/subs.edit; then
21408             if test $ac_beg -gt 1; then
21409               ac_end=`expr $ac_end - 1`
21410               continue
21411             fi
21412           fi
21413         fi
21414       fi
21415
21416       if test -z "$ac_sed_cmds"; then
21417         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
21418       else
21419         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
21420       fi
21421       ac_sed_frag=`expr $ac_sed_frag + 1`
21422       ac_beg=$ac_end
21423       ac_end=`expr $ac_end + $ac_max_sed_lines`
21424     fi
21425   done
21426   if test -z "$ac_sed_cmds"; then
21427     ac_sed_cmds=cat
21428   fi
21429 fi # test -n "$CONFIG_FILES"
21430
21431 EOF
21432 cat >>$CONFIG_STATUS <<\EOF
21433 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
21434   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21435   case $ac_file in
21436   - | *:- | *:-:* ) # input from stdin
21437         cat >$tmp/stdin
21438         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21439         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21440   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21441         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21442   * )   ac_file_in=$ac_file.in ;;
21443   esac
21444
21445   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
21446   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21447          X"$ac_file" : 'X\(//\)[^/]' \| \
21448          X"$ac_file" : 'X\(//\)$' \| \
21449          X"$ac_file" : 'X\(/\)' \| \
21450          .     : '\(.\)' 2>/dev/null ||
21451 echo X"$ac_file" |
21452     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21453           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21454           /^X\(\/\/\)$/{ s//\1/; q; }
21455           /^X\(\/\).*/{ s//\1/; q; }
21456           s/.*/./; q'`
21457   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21458     { case "$ac_dir" in
21459   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21460   *)                      as_incr_dir=.;;
21461 esac
21462 as_dummy="$ac_dir"
21463 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21464   case $as_mkdir_dir in
21465     # Skip DOS drivespec
21466     ?:) as_incr_dir=$as_mkdir_dir ;;
21467     *)
21468       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21469       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21470     ;;
21471   esac
21472 done; }
21473
21474     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21475     # A "../" for each directory in $ac_dir_suffix.
21476     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21477   else
21478     ac_dir_suffix= ac_dots=
21479   fi
21480
21481   case $srcdir in
21482   .)  ac_srcdir=.
21483       if test -z "$ac_dots"; then
21484          ac_top_srcdir=.
21485       else
21486          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21487       fi ;;
21488   [\\/]* | ?:[\\/]* )
21489       ac_srcdir=$srcdir$ac_dir_suffix;
21490       ac_top_srcdir=$srcdir ;;
21491   *) # Relative path.
21492     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
21493     ac_top_srcdir=$ac_dots$srcdir ;;
21494   esac
21495
21496   case $INSTALL in
21497   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21498   *) ac_INSTALL=$ac_dots$INSTALL ;;
21499   esac
21500
21501   if test x"$ac_file" != x-; then
21502     { echo "$as_me:21502: creating $ac_file" >&5
21503 echo "$as_me: creating $ac_file" >&6;}
21504     rm -f "$ac_file"
21505   fi
21506   # Let's still pretend it is `configure' which instantiates (i.e., don't
21507   # use $as_me), people would be surprised to read:
21508   #    /* config.h.  Generated automatically by config.status.  */
21509   configure_input="Generated automatically from `echo $ac_file_in |
21510                                                  sed 's,.*/,,'` by configure."
21511
21512   # First look for the input files in the build tree, otherwise in the
21513   # src tree.
21514   ac_file_inputs=`IFS=:
21515     for f in $ac_file_in; do
21516       case $f in
21517       -) echo $tmp/stdin ;;
21518       [\\/$]*)
21519          # Absolute (can't be DOS-style, as IFS=:)
21520          test -f "$f" || { { echo "$as_me:21520: error: cannot find input file: $f" >&5
21521 echo "$as_me: error: cannot find input file: $f" >&2;}
21522    { (exit 1); exit 1; }; }
21523          echo $f;;
21524       *) # Relative
21525          if test -f "$f"; then
21526            # Build tree
21527            echo $f
21528          elif test -f "$srcdir/$f"; then
21529            # Source tree
21530            echo $srcdir/$f
21531          else
21532            # /dev/null tree
21533            { { echo "$as_me:21533: error: cannot find input file: $f" >&5
21534 echo "$as_me: error: cannot find input file: $f" >&2;}
21535    { (exit 1); exit 1; }; }
21536          fi;;
21537       esac
21538     done` || { (exit 1); exit 1; }
21539 EOF
21540 cat >>$CONFIG_STATUS <<\EOF
21541   ac_warn_datarootdir=no
21542   if test x"$ac_file" != x-; then
21543     for ac_item in $ac_file_inputs
21544     do
21545       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
21546       if test -n "$ac_seen"; then
21547         ac_used=`grep '@datarootdir@' $ac_item`
21548         if test -z "$ac_used"; then
21549           { echo "$as_me:21549: WARNING: datarootdir was used implicitly but not set:
21550 $ac_seen" >&5
21551 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
21552 $ac_seen" >&2;}
21553           ac_warn_datarootdir=yes
21554         fi
21555       fi
21556       ac_seen=`grep '${datarootdir}' $ac_item`
21557       if test -n "$ac_seen"; then
21558         { echo "$as_me:21558: WARNING: datarootdir was used explicitly but not set:
21559 $ac_seen" >&5
21560 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
21561 $ac_seen" >&2;}
21562         ac_warn_datarootdir=yes
21563       fi
21564     done
21565   fi
21566
21567 if test "x$ac_warn_datarootdir" = xyes; then
21568   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
21569 fi
21570
21571 EOF
21572 cat >>$CONFIG_STATUS <<EOF
21573   sed "$ac_vpsub
21574 $extrasub
21575 EOF
21576 cat >>$CONFIG_STATUS <<\EOF
21577 :t
21578 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
21579 s,@configure_input@,$configure_input,;t t
21580 s,@srcdir@,$ac_srcdir,;t t
21581 s,@top_srcdir@,$ac_top_srcdir,;t t
21582 s,@INSTALL@,$ac_INSTALL,;t t
21583 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
21584   rm -f $tmp/stdin
21585   if test x"$ac_file" != x-; then
21586     cp $tmp/out $ac_file
21587
21588     for ac_name in prefix exec_prefix datarootdir
21589     do
21590         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
21591         if test -n "$ac_seen"; then
21592             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
21593             if test -z "$ac_init"; then
21594               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
21595               { echo "$as_me:21595: WARNING: Variable $ac_name is used but was not set:
21596 $ac_seen" >&5
21597 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
21598 $ac_seen" >&2;}
21599             fi
21600         fi
21601     done
21602     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
21603     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
21604     if test -s $tmp/out; then
21605       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
21606       { echo "$as_me:21606: WARNING: Some variables may not be substituted:
21607 $ac_seen" >&5
21608 echo "$as_me: WARNING: Some variables may not be substituted:
21609 $ac_seen" >&2;}
21610     fi
21611   else
21612     cat $tmp/out
21613   fi
21614   rm -f $tmp/out
21615
21616 done
21617 EOF
21618 cat >>$CONFIG_STATUS <<\EOF
21619
21620 #
21621 # CONFIG_HEADER section.
21622 #
21623
21624 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
21625 # NAME is the cpp macro being defined and VALUE is the value it is being given.
21626 #
21627 # ac_d sets the value in "#define NAME VALUE" lines.
21628 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
21629 ac_dB='[        ].*$,\1#\2'
21630 ac_dC=' '
21631 ac_dD=',;t'
21632 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
21633 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21634 ac_iB='\([      ]\),\1#\2define\3'
21635 ac_iC=' '
21636 ac_iD='\4,;t'
21637 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
21638 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21639 ac_uB='$,\1#\2define\3'
21640 ac_uC=' '
21641 ac_uD=',;t'
21642
21643 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
21644   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21645   case $ac_file in
21646   - | *:- | *:-:* ) # input from stdin
21647         cat >$tmp/stdin
21648         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21649         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21650   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21651         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21652   * )   ac_file_in=$ac_file.in ;;
21653   esac
21654
21655   test x"$ac_file" != x- && { echo "$as_me:21655: creating $ac_file" >&5
21656 echo "$as_me: creating $ac_file" >&6;}
21657
21658   # First look for the input files in the build tree, otherwise in the
21659   # src tree.
21660   ac_file_inputs=`IFS=:
21661     for f in $ac_file_in; do
21662       case $f in
21663       -) echo $tmp/stdin ;;
21664       [\\/$]*)
21665          # Absolute (can't be DOS-style, as IFS=:)
21666          test -f "$f" || { { echo "$as_me:21666: error: cannot find input file: $f" >&5
21667 echo "$as_me: error: cannot find input file: $f" >&2;}
21668    { (exit 1); exit 1; }; }
21669          echo $f;;
21670       *) # Relative
21671          if test -f "$f"; then
21672            # Build tree
21673            echo $f
21674          elif test -f "$srcdir/$f"; then
21675            # Source tree
21676            echo $srcdir/$f
21677          else
21678            # /dev/null tree
21679            { { echo "$as_me:21679: error: cannot find input file: $f" >&5
21680 echo "$as_me: error: cannot find input file: $f" >&2;}
21681    { (exit 1); exit 1; }; }
21682          fi;;
21683       esac
21684     done` || { (exit 1); exit 1; }
21685   # Remove the trailing spaces.
21686   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
21687
21688 EOF
21689
21690 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
21691 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
21692 # be either 'cat' or 'sort'.
21693 cat confdefs.h | uniq >conftest.vals
21694
21695 # Break up conftest.vals because some shells have a limit on
21696 # the size of here documents, and old seds have small limits too.
21697
21698 rm -f conftest.tail
21699 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
21700 while grep . conftest.vals >/dev/null
21701 do
21702   # Write chunks of a limited-size here document to conftest.frag.
21703   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
21704   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
21705   echo 'CEOF' >> $CONFIG_STATUS
21706   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
21707   rm -f conftest.vals
21708   mv conftest.tail conftest.vals
21709 done
21710 rm -f conftest.vals
21711
21712 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
21713 # marker @DEFS@.
21714 echo '  cat >> conftest.edit <<CEOF
21715 /@DEFS@/r conftest.frag
21716 /@DEFS@/d
21717 CEOF
21718 sed -f conftest.edit $tmp/in > $tmp/out
21719 rm -f $tmp/in
21720 mv $tmp/out $tmp/in
21721 rm -f conftest.edit conftest.frag
21722 ' >> $CONFIG_STATUS
21723
21724 cat >>$CONFIG_STATUS <<\EOF
21725   # Let's still pretend it is `configure' which instantiates (i.e., don't
21726   # use $as_me), people would be surprised to read:
21727   #    /* config.h.  Generated automatically by config.status.  */
21728   if test x"$ac_file" = x-; then
21729     echo "/* Generated automatically by configure.  */" >$tmp/config.h
21730   else
21731     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
21732   fi
21733   cat $tmp/in >>$tmp/config.h
21734   rm -f $tmp/in
21735   if test x"$ac_file" != x-; then
21736     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
21737       { echo "$as_me:21737: $ac_file is unchanged" >&5
21738 echo "$as_me: $ac_file is unchanged" >&6;}
21739     else
21740       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21741          X"$ac_file" : 'X\(//\)[^/]' \| \
21742          X"$ac_file" : 'X\(//\)$' \| \
21743          X"$ac_file" : 'X\(/\)' \| \
21744          .     : '\(.\)' 2>/dev/null ||
21745 echo X"$ac_file" |
21746     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21747           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21748           /^X\(\/\/\)$/{ s//\1/; q; }
21749           /^X\(\/\).*/{ s//\1/; q; }
21750           s/.*/./; q'`
21751       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21752         { case "$ac_dir" in
21753   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21754   *)                      as_incr_dir=.;;
21755 esac
21756 as_dummy="$ac_dir"
21757 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21758   case $as_mkdir_dir in
21759     # Skip DOS drivespec
21760     ?:) as_incr_dir=$as_mkdir_dir ;;
21761     *)
21762       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21763       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21764     ;;
21765   esac
21766 done; }
21767
21768       fi
21769       rm -f $ac_file
21770       mv $tmp/config.h $ac_file
21771     fi
21772   else
21773     cat $tmp/config.h
21774     rm -f $tmp/config.h
21775   fi
21776 done
21777 EOF
21778 cat >>$CONFIG_STATUS <<\EOF
21779 #
21780 # CONFIG_COMMANDS section.
21781 #
21782 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
21783   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
21784   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
21785
21786   case $ac_dest in
21787     default )
21788
21789 for cf_dir in .
21790 do
21791         if test ! -d $srcdir/$cf_dir; then
21792                 continue
21793         elif test -f $srcdir/$cf_dir/programs; then
21794                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
21795         fi
21796 done
21797
21798         cat >>Makefile <<TEST_EOF
21799
21800 # These rules are generated so we do not rely on suffix rules, which do not
21801 # work consistently for different make-programs (the '\$(MODEL)/' confuses
21802 # some, and the '\$x' confuses others).
21803 TEST_EOF
21804
21805 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
21806 for N in $LIST
21807 do
21808         cat >>Makefile <<TEST_EOF
21809
21810 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
21811         \$(srcdir)/test.priv.h \\
21812         ncurses_cfg.h
21813         $SHOW_CC
21814         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
21815 TEST_EOF
21816 done
21817
21818 if test -f ../config.guess && test -f ../config.sub
21819 then
21820         cat >>Makefile <<TEST_EOF
21821
21822 # if we used CF_INHERIT for getting these files, we can remove them
21823 distclean::
21824         rm -f config.guess config.sub
21825 TEST_EOF
21826 fi
21827  ;;
21828   esac
21829 done
21830 EOF
21831
21832 cat >>$CONFIG_STATUS <<\EOF
21833
21834 { (exit 0); exit 0; }
21835 EOF
21836 chmod +x $CONFIG_STATUS
21837 ac_clean_files=$ac_clean_files_save
21838
21839 # configure is writing to config.log, and then calls config.status.
21840 # config.status does its own redirection, appending to config.log.
21841 # Unfortunately, on DOS this fails, as config.log is still kept open
21842 # by configure, so config.status won't be able to write to it; its
21843 # output is simply discarded.  So we exec the FD to /dev/null,
21844 # effectively closing config.log, so it can be properly (re)opened and
21845 # appended to by config.status.  When coming back to configure, we
21846 # need to make the FD available again.
21847 if test "$no_create" != yes; then
21848   ac_cs_success=:
21849   exec 5>/dev/null
21850   $SHELL $CONFIG_STATUS || ac_cs_success=false
21851   exec 5>>config.log
21852   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
21853   # would make configure fail if this is the last instruction.
21854   $ac_cs_success || { (exit 1); exit 1; }
21855 fi
21856