]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20200308
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20200111.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 runstatedir='${localstatedir}/run'
143 libdir='${exec_prefix}/lib'
144 includedir='${prefix}/include'
145 oldincludedir='/usr/include'
146 infodir='${datarootdir}/info'
147 mandir='${datarootdir}/man'
148
149 # Identity of this package.
150 PACKAGE_NAME=
151 PACKAGE_TARNAME=
152 PACKAGE_VERSION=
153 PACKAGE_STRING=
154 PACKAGE_BUGREPORT=
155
156 ac_prev=
157 for ac_option
158 do
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
167
168   # Accept the important Cygnus configure options, so we can diagnose typos.
169
170   case $ac_option in
171
172   -bindir | --bindir | --bindi | --bind | --bin | --bi)
173     ac_prev=bindir ;;
174   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
175     bindir=$ac_optarg ;;
176
177   -build | --build | --buil | --bui | --bu)
178     ac_prev=build_alias ;;
179   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
180     build_alias=$ac_optarg ;;
181
182   -cache-file | --cache-file | --cache-fil | --cache-fi \
183   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
184     ac_prev=cache_file ;;
185   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
186   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
187     cache_file=$ac_optarg ;;
188
189   --config-cache | -C)
190     cache_file=config.cache ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir=$ac_optarg ;;
197
198   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
199   | --dataroo | --dataro | --datar)
200     ac_prev=datarootdir ;;
201   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
202   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
203     datarootdir=$ac_optarg ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     eval "enable_$ac_feature=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
216     # Reject names that are not valid shell variable names.
217     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
218       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
219    { (exit 1); exit 1; }; }
220     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
221     case $ac_option in
222       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_$ac_feature='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix=$ac_optarg ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he | -h)
241     ac_init_help=long ;;
242   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
243     ac_init_help=recursive ;;
244   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
245     ac_init_help=short ;;
246
247   -host | --host | --hos | --ho)
248     ac_prev=host_alias ;;
249   -host=* | --host=* | --hos=* | --ho=*)
250     host_alias=$ac_optarg ;;
251
252   -includedir | --includedir | --includedi | --included | --include \
253   | --includ | --inclu | --incl | --inc)
254     ac_prev=includedir ;;
255   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
256   | --includ=* | --inclu=* | --incl=* | --inc=*)
257     includedir=$ac_optarg ;;
258
259   -infodir | --infodir | --infodi | --infod | --info | --inf)
260     ac_prev=infodir ;;
261   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
262     infodir=$ac_optarg ;;
263
264   -libdir | --libdir | --libdi | --libd)
265     ac_prev=libdir ;;
266   -libdir=* | --libdir=* | --libdi=* | --libd=*)
267     libdir=$ac_optarg ;;
268
269   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
270   | --libexe | --libex | --libe)
271     ac_prev=libexecdir ;;
272   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
273   | --libexe=* | --libex=* | --libe=*)
274     libexecdir=$ac_optarg ;;
275
276   -localstatedir | --localstatedir | --localstatedi | --localstated \
277   | --localstate | --localstat | --localsta | --localst \
278   | --locals | --local | --loca | --loc | --lo)
279     ac_prev=localstatedir ;;
280   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
281   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
282   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
283     localstatedir=$ac_optarg ;;
284
285   -runstatedir | --runstatedir | --runstatedi | --runstated \
286   | --runstate | --runstat | --runsta | --runst \
287   | --runs | --run | --ru)
288     ac_prev=runstatedir ;;
289   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
290   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
291   | --runs=* | --run=* | --ru=*)
292     runstatedir=$ac_optarg ;;
293
294   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
295     ac_prev=mandir ;;
296   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
297     mandir=$ac_optarg ;;
298
299   -nfp | --nfp | --nf)
300     # Obsolete; use --without-fp.
301     with_fp=no ;;
302
303   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
304   | --no-cr | --no-c)
305     no_create=yes ;;
306
307   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
308   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
309     no_recursion=yes ;;
310
311   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
312   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
313   | --oldin | --oldi | --old | --ol | --o)
314     ac_prev=oldincludedir ;;
315   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
316   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
317   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
318     oldincludedir=$ac_optarg ;;
319
320   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
321     ac_prev=prefix ;;
322   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
323     prefix=$ac_optarg ;;
324
325   -program-prefix | --program-prefix | --program-prefi | --program-pref \
326   | --program-pre | --program-pr | --program-p)
327     ac_prev=program_prefix ;;
328   -program-prefix=* | --program-prefix=* | --program-prefi=* \
329   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
330     program_prefix=$ac_optarg ;;
331
332   -program-suffix | --program-suffix | --program-suffi | --program-suff \
333   | --program-suf | --program-su | --program-s)
334     ac_prev=program_suffix ;;
335   -program-suffix=* | --program-suffix=* | --program-suffi=* \
336   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
337     program_suffix=$ac_optarg ;;
338
339   -program-transform-name | --program-transform-name \
340   | --program-transform-nam | --program-transform-na \
341   | --program-transform-n | --program-transform- \
342   | --program-transform | --program-transfor \
343   | --program-transfo | --program-transf \
344   | --program-trans | --program-tran \
345   | --progr-tra | --program-tr | --program-t)
346     ac_prev=program_transform_name ;;
347   -program-transform-name=* | --program-transform-name=* \
348   | --program-transform-nam=* | --program-transform-na=* \
349   | --program-transform-n=* | --program-transform-=* \
350   | --program-transform=* | --program-transfor=* \
351   | --program-transfo=* | --program-transf=* \
352   | --program-trans=* | --program-tran=* \
353   | --progr-tra=* | --program-tr=* | --program-t=*)
354     program_transform_name=$ac_optarg ;;
355
356   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
357   | -silent | --silent | --silen | --sile | --sil)
358     silent=yes ;;
359
360   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
361     ac_prev=sbindir ;;
362   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
363   | --sbi=* | --sb=*)
364     sbindir=$ac_optarg ;;
365
366   -sharedstatedir | --sharedstatedir | --sharedstatedi \
367   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
368   | --sharedst | --shareds | --shared | --share | --shar \
369   | --sha | --sh)
370     ac_prev=sharedstatedir ;;
371   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
372   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
373   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
374   | --sha=* | --sh=*)
375     sharedstatedir=$ac_optarg ;;
376
377   -site | --site | --sit)
378     ac_prev=site ;;
379   -site=* | --site=* | --sit=*)
380     site=$ac_optarg ;;
381
382   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
383     ac_prev=srcdir ;;
384   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
385     srcdir=$ac_optarg ;;
386
387   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
388   | --syscon | --sysco | --sysc | --sys | --sy)
389     ac_prev=sysconfdir ;;
390   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
391   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
392     sysconfdir=$ac_optarg ;;
393
394   -target | --target | --targe | --targ | --tar | --ta | --t)
395     ac_prev=target_alias ;;
396   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
397     target_alias=$ac_optarg ;;
398
399   -v | -verbose | --verbose | --verbos | --verbo | --verb)
400     verbose=yes ;;
401
402   -version | --version | --versio | --versi | --vers | -V)
403     ac_init_version=: ;;
404
405   -with-* | --with-*)
406     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
407     # Reject names that are not valid shell variable names.
408     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
409       { echo "$as_me: error: invalid package name: $ac_package" >&2
410    { (exit 1); exit 1; }; }
411     ac_package=`echo $ac_package| sed 's/-/_/g'`
412     case $ac_option in
413       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
414       *) ac_optarg=yes ;;
415     esac
416     eval "with_$ac_package='$ac_optarg'" ;;
417
418   -without-* | --without-*)
419     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
420     # Reject names that are not valid shell variable names.
421     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
422       { echo "$as_me: error: invalid package name: $ac_package" >&2
423    { (exit 1); exit 1; }; }
424     ac_package=`echo $ac_package | sed 's/-/_/g'`
425     eval "with_$ac_package=no" ;;
426
427   --x)
428     # Obsolete; use --with-x.
429     with_x=yes ;;
430
431   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
432   | --x-incl | --x-inc | --x-in | --x-i)
433     ac_prev=x_includes ;;
434   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
435   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
436     x_includes=$ac_optarg ;;
437
438   -x-libraries | --x-libraries | --x-librarie | --x-librari \
439   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
440     ac_prev=x_libraries ;;
441   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
442   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
443     x_libraries=$ac_optarg ;;
444
445   -*) { echo "$as_me: error: unrecognized option: $ac_option
446 Try \`$0 --help' for more information." >&2
447    { (exit 1); exit 1; }; }
448     ;;
449
450   *=*)
451     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
452     # Reject names that are not valid shell variable names.
453     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
454       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
455    { (exit 1); exit 1; }; }
456     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
457     eval "$ac_envvar='$ac_optarg'"
458     export $ac_envvar ;;
459
460   *)
461     # FIXME: should be removed in autoconf 3.0.
462     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
463     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
464       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
465     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
466     ;;
467
468   esac
469 done
470
471 if test -n "$ac_prev"; then
472   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
473   { echo "$as_me: error: missing argument to $ac_option" >&2
474    { (exit 1); exit 1; }; }
475 fi
476
477 # Be sure to have absolute paths.
478 for ac_var in exec_prefix prefix
479 do
480   eval ac_val=$`echo $ac_var`
481   case $ac_val in
482     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
483     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
484    { (exit 1); exit 1; }; };;
485   esac
486 done
487
488 # Be sure to have absolute paths.
489 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
490               localstatedir libdir includedir oldincludedir infodir mandir
491 do
492   eval ac_val=$`echo $ac_var`
493   case $ac_val in
494     [\\/$]* | ?:[\\/]* ) ;;
495     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
496    { (exit 1); exit 1; }; };;
497   esac
498 done
499
500 # There might be people who depend on the old broken behavior: `$host'
501 # used to hold the argument of --host etc.
502 build=$build_alias
503 host=$host_alias
504 target=$target_alias
505
506 # FIXME: should be removed in autoconf 3.0.
507 if test "x$host_alias" != x; then
508   if test "x$build_alias" = x; then
509     cross_compiling=maybe
510     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
511     If a cross compiler is detected then cross compile mode will be used." >&2
512   elif test "x$build_alias" != "x$host_alias"; then
513     cross_compiling=yes
514   fi
515 fi
516
517 ac_tool_prefix=
518 test -n "$host_alias" && ac_tool_prefix=$host_alias-
519
520 test "$silent" = yes && exec 6>/dev/null
521
522 # Find the source files, if location was not specified.
523 if test -z "$srcdir"; then
524   ac_srcdir_defaulted=yes
525   # Try the directory containing this script, then its parent.
526   ac_prog=$0
527   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
528   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
529   srcdir=$ac_confdir
530   if test ! -r $srcdir/$ac_unique_file; then
531     srcdir=..
532   fi
533 else
534   ac_srcdir_defaulted=no
535 fi
536 if test ! -r $srcdir/$ac_unique_file; then
537   if test "$ac_srcdir_defaulted" = yes; then
538     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
539    { (exit 1); exit 1; }; }
540   else
541     { echo "$as_me: error: cannot find sources in $srcdir" >&2
542    { (exit 1); exit 1; }; }
543   fi
544 fi
545 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
546 ac_env_build_alias_set=${build_alias+set}
547 ac_env_build_alias_value=$build_alias
548 ac_cv_env_build_alias_set=${build_alias+set}
549 ac_cv_env_build_alias_value=$build_alias
550 ac_env_host_alias_set=${host_alias+set}
551 ac_env_host_alias_value=$host_alias
552 ac_cv_env_host_alias_set=${host_alias+set}
553 ac_cv_env_host_alias_value=$host_alias
554 ac_env_target_alias_set=${target_alias+set}
555 ac_env_target_alias_value=$target_alias
556 ac_cv_env_target_alias_set=${target_alias+set}
557 ac_cv_env_target_alias_value=$target_alias
558 ac_env_CC_set=${CC+set}
559 ac_env_CC_value=$CC
560 ac_cv_env_CC_set=${CC+set}
561 ac_cv_env_CC_value=$CC
562 ac_env_CFLAGS_set=${CFLAGS+set}
563 ac_env_CFLAGS_value=$CFLAGS
564 ac_cv_env_CFLAGS_set=${CFLAGS+set}
565 ac_cv_env_CFLAGS_value=$CFLAGS
566 ac_env_LDFLAGS_set=${LDFLAGS+set}
567 ac_env_LDFLAGS_value=$LDFLAGS
568 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_cv_env_LDFLAGS_value=$LDFLAGS
570 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
571 ac_env_CPPFLAGS_value=$CPPFLAGS
572 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
574 ac_env_CPP_set=${CPP+set}
575 ac_env_CPP_value=$CPP
576 ac_cv_env_CPP_set=${CPP+set}
577 ac_cv_env_CPP_value=$CPP
578
579 #
580 # Report the --help message.
581 #
582 if test "$ac_init_help" = "long"; then
583   # Omit some internal or obsolete options to make the list less imposing.
584   # This message is too long to be a string in the A/UX 3.1 sh.
585   cat <<EOF
586 \`configure' configures this package to adapt to many kinds of systems.
587
588 Usage: $0 [OPTION]... [VAR=VALUE]...
589
590 To assign environment variables (e.g., CC, CFLAGS...), specify them as
591 VAR=VALUE.  See below for descriptions of some of the useful variables.
592
593 Defaults for the options are specified in brackets.
594
595 Configuration:
596   -h, --help              display this help and exit
597       --help=short        display options specific to this package
598       --help=recursive    display the short help of all the included packages
599   -V, --version           display version information and exit
600   -q, --quiet, --silent   do not print \`checking...' messages
601       --cache-file=FILE   cache test results in FILE [disabled]
602   -C, --config-cache      alias for \`--cache-file=config.cache'
603   -n, --no-create         do not create output files
604       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
605
606 EOF
607
608   cat <<EOF
609 Installation directories:
610   --prefix=PREFIX         install architecture-independent files in PREFIX
611                           [$ac_default_prefix]
612   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
613                           [PREFIX]
614
615 By default, \`make install' will install all the files in
616 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
617 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
618 for instance \`--prefix=\$HOME'.
619
620 For better control, use the options below.
621
622 Fine tuning of the installation directories:
623   --bindir=DIR            user executables [EPREFIX/bin]
624   --sbindir=DIR           system admin executables [EPREFIX/sbin]
625   --libexecdir=DIR        program executables [EPREFIX/libexec]
626   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
627   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
628   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
629   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
630   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
631   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
632   --libdir=DIR            object code libraries [EPREFIX/lib]
633   --includedir=DIR        C header files [PREFIX/include]
634   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
635   --infodir=DIR           info documentation [DATAROOTDIR/info]
636   --mandir=DIR            man documentation [DATAROOTDIR/man]
637 EOF
638
639   cat <<\EOF
640
641 Program names:
642   --program-prefix=PREFIX            prepend PREFIX to installed program names
643   --program-suffix=SUFFIX            append SUFFIX to installed program names
644   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
645
646 X features:
647   --x-includes=DIR    X include files are in DIR
648   --x-libraries=DIR   X library files are in DIR
649
650 System types:
651   --build=BUILD           configure for building on BUILD [guessed]
652   --host=HOST       build programs to run on HOST [BUILD]
653 EOF
654 fi
655
656 if test -n "$ac_init_help"; then
657
658   cat <<\EOF
659
660 Optional Features:
661   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
662   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
663
664 Optional Packages:
665   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
666   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
667
668 General Options:
669   --disable-stripping     do not strip (debug info) installed executables
670   --enable-string-hacks   work around bogus compiler/loader warnings
671   --with-pkg-config{=path} enable/disable use of pkg-config
672   --disable-echo          do not display "compiling" commands
673 Curses Version-dependent Options:
674   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
675   --disable-widec         disable checks for wide-character functions
676   --with-curses-dir=DIR   directory in which (n)curses is installed
677   --with-screen=XXX       use specified curses-libraries
678   --with-ncursesw         use wide ncurses-libraries
679   --with-ncurses          use ncurses-libraries
680   --with-pdcurses         compile/link with pdcurses X11 library
681   --with-curses-colr      compile/link with HPUX 10.x color-curses
682   --with-curses-5lib      compile/link with SunOS 5lib curses
683   --with-Xaw3d            link with Xaw 3d library
684   --with-Xaw3dxft         link with Xaw 3d xft library
685   --with-neXtaw           link with neXT Athena library
686   --with-XawPlus          link with Athena-Plus library
687   --with-x                use the X Window System
688   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
689   --with-form-libname=XXX override form basename of library
690   --with-menu-libname=XXX override menu basename of library
691   --with-panel-libname=XXX override panel basename of library
692   --disable-panel         disable checks for panel functions
693   --disable-menu          disable checks for menu functions
694   --disable-form          disable checks for form functions
695 Testing/development Options:
696   --enable-warnings       test: turn on gcc compiler warnings
697   --with-dmalloc          test: use Gray Watson's dmalloc library
698   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
699   --with-valgrind         test: use valgrind
700   --disable-leaks         test: free permanent memory, analyze leaks
701   --disable-rpath-hack    don't add rpath options for additional libraries
702
703 Some influential environment variables:
704   CC          C compiler command
705   CFLAGS      C compiler flags
706   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
707               nonstandard directory <lib dir>
708   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
709               headers in a nonstandard directory <include dir>
710   CPP         C preprocessor
711
712 Use these variables to override the choices made by `configure' or to help
713 it to find libraries and programs with nonstandard names/locations.
714
715 EOF
716 fi
717
718 if test "$ac_init_help" = "recursive"; then
719   # If there are subdirs, report their specific --help.
720   ac_popdir=`pwd`
721   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
722     cd $ac_subdir
723     # A "../" for each directory in /$ac_subdir.
724     ac_dots=`echo $ac_subdir |
725              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
726
727     case $srcdir in
728     .) # No --srcdir option.  We are building in place.
729       ac_sub_srcdir=$srcdir ;;
730     [\\/]* | ?:[\\/]* ) # Absolute path.
731       ac_sub_srcdir=$srcdir/$ac_subdir ;;
732     *) # Relative path.
733       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
734     esac
735
736     # Check for guested configure; otherwise get Cygnus style configure.
737     if test -f $ac_sub_srcdir/configure.gnu; then
738       echo
739       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
740     elif test -f $ac_sub_srcdir/configure; then
741       echo
742       $SHELL $ac_sub_srcdir/configure  --help=recursive
743     elif test -f $ac_sub_srcdir/configure.ac ||
744            test -f $ac_sub_srcdir/configure.in; then
745       echo
746       $ac_configure --help
747     else
748       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
749     fi
750     cd $ac_popdir
751   done
752 fi
753
754 test -n "$ac_init_help" && exit 0
755 if $ac_init_version; then
756   cat <<\EOF
757
758 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
759 Free Software Foundation, Inc.
760 This configure script is free software; the Free Software Foundation
761 gives unlimited permission to copy, distribute and modify it.
762 EOF
763   exit 0
764 fi
765 exec 5>config.log
766 cat >&5 <<EOF
767 This file contains any messages produced by compilers while
768 running configure, to aid debugging if configure makes a mistake.
769
770 It was created by $as_me, which was
771 generated by GNU Autoconf 2.52.20200111.  Invocation command line was
772
773   $ $0 $@
774
775 EOF
776 {
777 cat <<_ASUNAME
778 ## ---------- ##
779 ## Platform.  ##
780 ## ---------- ##
781
782 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
783 uname -m = `(uname -m) 2>/dev/null || echo unknown`
784 uname -r = `(uname -r) 2>/dev/null || echo unknown`
785 uname -s = `(uname -s) 2>/dev/null || echo unknown`
786 uname -v = `(uname -v) 2>/dev/null || echo unknown`
787
788 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
789 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
790
791 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
792 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
793 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
794 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
795 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
796 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
797 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
798
799 PATH = $PATH
800
801 _ASUNAME
802 } >&5
803
804 cat >&5 <<EOF
805 ## ------------ ##
806 ## Core tests.  ##
807 ## ------------ ##
808
809 EOF
810
811 # Keep a trace of the command line.
812 # Strip out --no-create and --no-recursion so they do not pile up.
813 # Also quote any args containing shell meta-characters.
814 ac_configure_args=
815 ac_sep=
816 for ac_arg
817 do
818   case $ac_arg in
819   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
820   | --no-cr | --no-c) ;;
821   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
822   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
823   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
824     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
825     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
826     ac_sep=" " ;;
827   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
828      ac_sep=" " ;;
829   esac
830   # Get rid of the leading space.
831 done
832
833 # When interrupted or exit'd, cleanup temporary files, and complete
834 # config.log.  We remove comments because anyway the quotes in there
835 # would cause problems or look ugly.
836 trap 'exit_status=$?
837   # Save into config.log some information that might help in debugging.
838   echo >&5
839   echo "## ----------------- ##" >&5
840   echo "## Cache variables.  ##" >&5
841   echo "## ----------------- ##" >&5
842   echo >&5
843   # The following way of writing the cache mishandles newlines in values,
844 {
845   (set) 2>&1 |
846     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
847     *ac_space=\ *)
848       sed -n \
849         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
850           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
851       ;;
852     *)
853       sed -n \
854         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
855       ;;
856     esac;
857 } >&5
858   sed "/^$/d" confdefs.h >conftest.log
859   if test -s conftest.log; then
860     echo >&5
861     echo "## ------------ ##" >&5
862     echo "## confdefs.h.  ##" >&5
863     echo "## ------------ ##" >&5
864     echo >&5
865     cat conftest.log >&5
866   fi
867   (echo; echo) >&5
868   test "$ac_signal" != 0 &&
869     echo "$as_me: caught signal $ac_signal" >&5
870   echo "$as_me: exit $exit_status" >&5
871   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
872     exit $exit_status
873      ' 0
874 for ac_signal in 1 2 13 15; do
875   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
876 done
877 ac_signal=0
878
879 # confdefs.h avoids OS command line length limits that DEFS can exceed.
880 rm -rf conftest* confdefs.h
881 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
882 echo >confdefs.h
883
884 # Let the site file select an alternate cache file if it wants to.
885 # Prefer explicitly selected file to automatically selected ones.
886 if test -z "$CONFIG_SITE"; then
887   if test "x$prefix" != xNONE; then
888     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
889   else
890     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
891   fi
892 fi
893 for ac_site_file in $CONFIG_SITE; do
894   if test -r "$ac_site_file"; then
895     { echo "$as_me:895: loading site script $ac_site_file" >&5
896 echo "$as_me: loading site script $ac_site_file" >&6;}
897     cat "$ac_site_file" >&5
898     . "$ac_site_file"
899   fi
900 done
901
902 if test -r "$cache_file"; then
903   # Some versions of bash will fail to source /dev/null (special
904   # files actually), so we avoid doing that.
905   if test -f "$cache_file"; then
906     { echo "$as_me:906: loading cache $cache_file" >&5
907 echo "$as_me: loading cache $cache_file" >&6;}
908     case $cache_file in
909       [\\/]* | ?:[\\/]* ) . $cache_file;;
910       *)                      . ./$cache_file;;
911     esac
912   fi
913 else
914   { echo "$as_me:914: creating cache $cache_file" >&5
915 echo "$as_me: creating cache $cache_file" >&6;}
916   >$cache_file
917 fi
918
919 # Check that the precious variables saved in the cache have kept the same
920 # value.
921 ac_cache_corrupted=false
922 for ac_var in `(set) 2>&1 |
923                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
924   eval ac_old_set=\$ac_cv_env_${ac_var}_set
925   eval ac_new_set=\$ac_env_${ac_var}_set
926   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
927   eval ac_new_val="\$ac_env_${ac_var}_value"
928   case $ac_old_set,$ac_new_set in
929     set,)
930       { echo "$as_me:930: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
931 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
932       ac_cache_corrupted=: ;;
933     ,set)
934       { echo "$as_me:934: error: \`$ac_var' was not set in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,);;
938     *)
939       if test "x$ac_old_val" != "x$ac_new_val"; then
940         { echo "$as_me:940: error: \`$ac_var' has changed since the previous run:" >&5
941 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
942         { echo "$as_me:942:   former value:  $ac_old_val" >&5
943 echo "$as_me:   former value:  $ac_old_val" >&2;}
944         { echo "$as_me:944:   current value: $ac_new_val" >&5
945 echo "$as_me:   current value: $ac_new_val" >&2;}
946         ac_cache_corrupted=:
947       fi;;
948   esac
949   # Pass precious variables to config.status.  It doesn't matter if
950   # we pass some twice (in addition to the command line arguments).
951   if test "$ac_new_set" = set; then
952     case $ac_new_val in
953     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
954       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
955       ac_configure_args="$ac_configure_args '$ac_arg'"
956       ;;
957     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
958        ;;
959     esac
960   fi
961 done
962 if $ac_cache_corrupted; then
963   { echo "$as_me:963: error: changes in the environment can compromise the build" >&5
964 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
965   { { echo "$as_me:965: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
966 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
967    { (exit 1); exit 1; }; }
968 fi
969
970 ac_ext=c
971 ac_cpp='$CPP $CPPFLAGS'
972 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
973 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
974 ac_compiler_gnu=$ac_cv_c_compiler_gnu
975 ac_main_return=return
976
977 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
978   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
979                    ECHO_T='     ' ;;
980   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
981   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
982 esac
983 echo "#! $SHELL" >conftest.sh
984 echo  "exit 0"   >>conftest.sh
985 chmod +x conftest.sh
986 if { (echo "$as_me:986: PATH=\".;.\"; conftest.sh") >&5
987   (PATH=".;."; conftest.sh) 2>&5
988   ac_status=$?
989   echo "$as_me:989: \$? = $ac_status" >&5
990   (exit $ac_status); }; then
991   ac_path_separator=';'
992 else
993   ac_path_separator=:
994 fi
995 PATH_SEPARATOR="$ac_path_separator"
996 rm -f conftest.sh
997
998 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
999
1000 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1001
1002 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1003
1004 ac_aux_dir=
1005 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1006   if test -f $ac_dir/install-sh; then
1007     ac_aux_dir=$ac_dir
1008     ac_install_sh="$ac_aux_dir/install-sh -c"
1009     break
1010   elif test -f $ac_dir/install.sh; then
1011     ac_aux_dir=$ac_dir
1012     ac_install_sh="$ac_aux_dir/install.sh -c"
1013     break
1014   elif test -f $ac_dir/shtool; then
1015     ac_aux_dir=$ac_dir
1016     ac_install_sh="$ac_aux_dir/shtool install -c"
1017     break
1018   fi
1019 done
1020 if test -z "$ac_aux_dir"; then
1021   { { echo "$as_me:1021: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1022 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1023    { (exit 1); exit 1; }; }
1024 fi
1025 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1026 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1027 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1028
1029 # Make sure we can run config.sub.
1030 $ac_config_sub sun4 >/dev/null 2>&1 ||
1031   { { echo "$as_me:1031: error: cannot run $ac_config_sub" >&5
1032 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1033    { (exit 1); exit 1; }; }
1034
1035 echo "$as_me:1035: checking build system type" >&5
1036 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1037 if test "${ac_cv_build+set}" = set; then
1038   echo $ECHO_N "(cached) $ECHO_C" >&6
1039 else
1040   ac_cv_build_alias=$build_alias
1041 test -z "$ac_cv_build_alias" &&
1042   ac_cv_build_alias=`$ac_config_guess`
1043 test -z "$ac_cv_build_alias" &&
1044   { { echo "$as_me:1044: error: cannot guess build type; you must specify one" >&5
1045 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1046    { (exit 1); exit 1; }; }
1047 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1048   { { echo "$as_me:1048: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1049 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1050    { (exit 1); exit 1; }; }
1051
1052 fi
1053 echo "$as_me:1053: result: $ac_cv_build" >&5
1054 echo "${ECHO_T}$ac_cv_build" >&6
1055 build=$ac_cv_build
1056 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1057 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1058 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1059
1060 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1061         echo "$as_me:1061: checking host system type" >&5
1062 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1063 if test "${ac_cv_host+set}" = set; then
1064   echo $ECHO_N "(cached) $ECHO_C" >&6
1065 else
1066   ac_cv_host_alias=$host_alias
1067 test -z "$ac_cv_host_alias" &&
1068   ac_cv_host_alias=$ac_cv_build_alias
1069 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1070   { { echo "$as_me:1070: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1071 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1072    { (exit 1); exit 1; }; }
1073
1074 fi
1075 echo "$as_me:1075: result: $ac_cv_host" >&5
1076 echo "${ECHO_T}$ac_cv_host" >&6
1077 host=$ac_cv_host
1078 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1079 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1080 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1081
1082         system_name="$host_os"
1083 else
1084         system_name="`(uname -s -r) 2>/dev/null`"
1085         if test -z "$system_name" ; then
1086                 system_name="`(hostname) 2>/dev/null`"
1087         fi
1088 fi
1089 test -n "$system_name" &&
1090 cat >>confdefs.h <<EOF
1091 #define SYSTEM_NAME "$system_name"
1092 EOF
1093
1094 if test "${cf_cv_system_name+set}" = set; then
1095   echo $ECHO_N "(cached) $ECHO_C" >&6
1096 else
1097   cf_cv_system_name="$system_name"
1098 fi
1099
1100 test -z "$system_name" && system_name="$cf_cv_system_name"
1101 test -n "$cf_cv_system_name" && echo "$as_me:1101: result: Configuring for $cf_cv_system_name" >&5
1102 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1103
1104 if test ".$system_name" != ".$cf_cv_system_name" ; then
1105         echo "$as_me:1105: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1106 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1107         { { echo "$as_me:1107: error: \"Please remove config.cache and try again.\"" >&5
1108 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1109    { (exit 1); exit 1; }; }
1110 fi
1111
1112 test "$program_prefix" != NONE &&
1113   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1114 # Use a double $ so make ignores it.
1115 test "$program_suffix" != NONE &&
1116   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1117 # Double any \ or $.  echo might interpret backslashes.
1118 # By default was `s,x,x', remove it if useless.
1119 cat <<\_ACEOF >conftest.sed
1120 s/[\\$]/&&/g;s/;s,x,x,$//
1121 _ACEOF
1122 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1123 rm conftest.sed
1124
1125 echo "$as_me:1125: checking whether ${MAKE-make} sets \${MAKE}" >&5
1126 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1127 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1128 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1129   echo $ECHO_N "(cached) $ECHO_C" >&6
1130 else
1131   cat >conftest.make <<\EOF
1132 all:
1133         @echo 'ac_maketemp="${MAKE}"'
1134 EOF
1135 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1136 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1137 if test -n "$ac_maketemp"; then
1138   eval ac_cv_prog_make_${ac_make}_set=yes
1139 else
1140   eval ac_cv_prog_make_${ac_make}_set=no
1141 fi
1142 rm -f conftest.make
1143 fi
1144 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1145   echo "$as_me:1145: result: yes" >&5
1146 echo "${ECHO_T}yes" >&6
1147   SET_MAKE=
1148 else
1149   echo "$as_me:1149: result: no" >&5
1150 echo "${ECHO_T}no" >&6
1151   SET_MAKE="MAKE=${MAKE-make}"
1152 fi
1153
1154 ac_ext=c
1155 ac_cpp='$CPP $CPPFLAGS'
1156 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1157 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1158 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1159 ac_main_return=return
1160 if test -n "$ac_tool_prefix"; then
1161   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1162 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1163 echo "$as_me:1163: checking for $ac_word" >&5
1164 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1165 if test "${ac_cv_prog_CC+set}" = set; then
1166   echo $ECHO_N "(cached) $ECHO_C" >&6
1167 else
1168   if test -n "$CC"; then
1169   ac_cv_prog_CC="$CC" # Let the user override the test.
1170 else
1171   ac_save_IFS=$IFS; IFS=$ac_path_separator
1172 ac_dummy="$PATH"
1173 for ac_dir in $ac_dummy; do
1174   IFS=$ac_save_IFS
1175   test -z "$ac_dir" && ac_dir=.
1176   $as_executable_p "$ac_dir/$ac_word" || continue
1177 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1178 echo "$as_me:1178: found $ac_dir/$ac_word" >&5
1179 break
1180 done
1181
1182 fi
1183 fi
1184 CC=$ac_cv_prog_CC
1185 if test -n "$CC"; then
1186   echo "$as_me:1186: result: $CC" >&5
1187 echo "${ECHO_T}$CC" >&6
1188 else
1189   echo "$as_me:1189: result: no" >&5
1190 echo "${ECHO_T}no" >&6
1191 fi
1192
1193 fi
1194 if test -z "$ac_cv_prog_CC"; then
1195   ac_ct_CC=$CC
1196   # Extract the first word of "gcc", so it can be a program name with args.
1197 set dummy gcc; ac_word=$2
1198 echo "$as_me:1198: checking for $ac_word" >&5
1199 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1200 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1201   echo $ECHO_N "(cached) $ECHO_C" >&6
1202 else
1203   if test -n "$ac_ct_CC"; then
1204   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1205 else
1206   ac_save_IFS=$IFS; IFS=$ac_path_separator
1207 ac_dummy="$PATH"
1208 for ac_dir in $ac_dummy; do
1209   IFS=$ac_save_IFS
1210   test -z "$ac_dir" && ac_dir=.
1211   $as_executable_p "$ac_dir/$ac_word" || continue
1212 ac_cv_prog_ac_ct_CC="gcc"
1213 echo "$as_me:1213: found $ac_dir/$ac_word" >&5
1214 break
1215 done
1216
1217 fi
1218 fi
1219 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1220 if test -n "$ac_ct_CC"; then
1221   echo "$as_me:1221: result: $ac_ct_CC" >&5
1222 echo "${ECHO_T}$ac_ct_CC" >&6
1223 else
1224   echo "$as_me:1224: result: no" >&5
1225 echo "${ECHO_T}no" >&6
1226 fi
1227
1228   CC=$ac_ct_CC
1229 else
1230   CC="$ac_cv_prog_CC"
1231 fi
1232
1233 if test -z "$CC"; then
1234   if test -n "$ac_tool_prefix"; then
1235   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1236 set dummy ${ac_tool_prefix}cc; ac_word=$2
1237 echo "$as_me:1237: checking for $ac_word" >&5
1238 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1239 if test "${ac_cv_prog_CC+set}" = set; then
1240   echo $ECHO_N "(cached) $ECHO_C" >&6
1241 else
1242   if test -n "$CC"; then
1243   ac_cv_prog_CC="$CC" # Let the user override the test.
1244 else
1245   ac_save_IFS=$IFS; IFS=$ac_path_separator
1246 ac_dummy="$PATH"
1247 for ac_dir in $ac_dummy; do
1248   IFS=$ac_save_IFS
1249   test -z "$ac_dir" && ac_dir=.
1250   $as_executable_p "$ac_dir/$ac_word" || continue
1251 ac_cv_prog_CC="${ac_tool_prefix}cc"
1252 echo "$as_me:1252: found $ac_dir/$ac_word" >&5
1253 break
1254 done
1255
1256 fi
1257 fi
1258 CC=$ac_cv_prog_CC
1259 if test -n "$CC"; then
1260   echo "$as_me:1260: result: $CC" >&5
1261 echo "${ECHO_T}$CC" >&6
1262 else
1263   echo "$as_me:1263: result: no" >&5
1264 echo "${ECHO_T}no" >&6
1265 fi
1266
1267 fi
1268 if test -z "$ac_cv_prog_CC"; then
1269   ac_ct_CC=$CC
1270   # Extract the first word of "cc", so it can be a program name with args.
1271 set dummy cc; ac_word=$2
1272 echo "$as_me:1272: checking for $ac_word" >&5
1273 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1274 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1275   echo $ECHO_N "(cached) $ECHO_C" >&6
1276 else
1277   if test -n "$ac_ct_CC"; then
1278   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1279 else
1280   ac_save_IFS=$IFS; IFS=$ac_path_separator
1281 ac_dummy="$PATH"
1282 for ac_dir in $ac_dummy; do
1283   IFS=$ac_save_IFS
1284   test -z "$ac_dir" && ac_dir=.
1285   $as_executable_p "$ac_dir/$ac_word" || continue
1286 ac_cv_prog_ac_ct_CC="cc"
1287 echo "$as_me:1287: found $ac_dir/$ac_word" >&5
1288 break
1289 done
1290
1291 fi
1292 fi
1293 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1294 if test -n "$ac_ct_CC"; then
1295   echo "$as_me:1295: result: $ac_ct_CC" >&5
1296 echo "${ECHO_T}$ac_ct_CC" >&6
1297 else
1298   echo "$as_me:1298: result: no" >&5
1299 echo "${ECHO_T}no" >&6
1300 fi
1301
1302   CC=$ac_ct_CC
1303 else
1304   CC="$ac_cv_prog_CC"
1305 fi
1306
1307 fi
1308 if test -z "$CC"; then
1309   # Extract the first word of "cc", so it can be a program name with args.
1310 set dummy cc; ac_word=$2
1311 echo "$as_me:1311: checking for $ac_word" >&5
1312 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1313 if test "${ac_cv_prog_CC+set}" = set; then
1314   echo $ECHO_N "(cached) $ECHO_C" >&6
1315 else
1316   if test -n "$CC"; then
1317   ac_cv_prog_CC="$CC" # Let the user override the test.
1318 else
1319   ac_prog_rejected=no
1320   ac_save_IFS=$IFS; IFS=$ac_path_separator
1321 ac_dummy="$PATH"
1322 for ac_dir in $ac_dummy; do
1323   IFS=$ac_save_IFS
1324   test -z "$ac_dir" && ac_dir=.
1325   $as_executable_p "$ac_dir/$ac_word" || continue
1326 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1327   ac_prog_rejected=yes
1328   continue
1329 fi
1330 ac_cv_prog_CC="cc"
1331 echo "$as_me:1331: found $ac_dir/$ac_word" >&5
1332 break
1333 done
1334
1335 if test $ac_prog_rejected = yes; then
1336   # We found a bogon in the path, so make sure we never use it.
1337   set dummy $ac_cv_prog_CC
1338   shift
1339   if test $# != 0; then
1340     # We chose a different compiler from the bogus one.
1341     # However, it has the same basename, so the bogon will be chosen
1342     # first if we set CC to just the basename; use the full file name.
1343     shift
1344     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1345     shift
1346     ac_cv_prog_CC="$@"
1347   fi
1348 fi
1349 fi
1350 fi
1351 CC=$ac_cv_prog_CC
1352 if test -n "$CC"; then
1353   echo "$as_me:1353: result: $CC" >&5
1354 echo "${ECHO_T}$CC" >&6
1355 else
1356   echo "$as_me:1356: result: no" >&5
1357 echo "${ECHO_T}no" >&6
1358 fi
1359
1360 fi
1361 if test -z "$CC"; then
1362   if test -n "$ac_tool_prefix"; then
1363   for ac_prog in cl
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in cl
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 fi
1443
1444 test -z "$CC" && { { echo "$as_me:1444: error: no acceptable cc found in \$PATH" >&5
1445 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1446    { (exit 1); exit 1; }; }
1447
1448 # Provide some information about the compiler.
1449 echo "$as_me:1449:" \
1450      "checking for C compiler version" >&5
1451 ac_compiler=`set X $ac_compile; echo $2`
1452 { (eval echo "$as_me:1452: \"$ac_compiler --version </dev/null >&5\"") >&5
1453   (eval $ac_compiler --version </dev/null >&5) 2>&5
1454   ac_status=$?
1455   echo "$as_me:1455: \$? = $ac_status" >&5
1456   (exit $ac_status); }
1457 { (eval echo "$as_me:1457: \"$ac_compiler -v </dev/null >&5\"") >&5
1458   (eval $ac_compiler -v </dev/null >&5) 2>&5
1459   ac_status=$?
1460   echo "$as_me:1460: \$? = $ac_status" >&5
1461   (exit $ac_status); }
1462 { (eval echo "$as_me:1462: \"$ac_compiler -V </dev/null >&5\"") >&5
1463   (eval $ac_compiler -V </dev/null >&5) 2>&5
1464   ac_status=$?
1465   echo "$as_me:1465: \$? = $ac_status" >&5
1466   (exit $ac_status); }
1467
1468 cat >conftest.$ac_ext <<_ACEOF
1469 #line 1469 "configure"
1470 #include "confdefs.h"
1471
1472 int
1473 main (void)
1474 {
1475
1476   ;
1477   return 0;
1478 }
1479 _ACEOF
1480 ac_clean_files_save=$ac_clean_files
1481 ac_clean_files="$ac_clean_files a.out a.exe"
1482 # Try to create an executable without -o first, disregard a.out.
1483 # It will help us diagnose broken compilers, and finding out an intuition
1484 # of exeext.
1485 echo "$as_me:1485: checking for C compiler default output" >&5
1486 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1487 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1488 if { (eval echo "$as_me:1488: \"$ac_link_default\"") >&5
1489   (eval $ac_link_default) 2>&5
1490   ac_status=$?
1491   echo "$as_me:1491: \$? = $ac_status" >&5
1492   (exit $ac_status); }; then
1493   # Find the output, starting from the most likely.  This scheme is
1494 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1495 # resort.
1496 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1497                 ls a.out conftest 2>/dev/null;
1498                 ls a.* conftest.* 2>/dev/null`; do
1499   case $ac_file in
1500     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1501     a.out ) # We found the default executable, but exeext='' is most
1502             # certainly right.
1503             break;;
1504     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1505           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1506           export ac_cv_exeext
1507           break;;
1508     * ) break;;
1509   esac
1510 done
1511 else
1512   echo "$as_me: failed program was:" >&5
1513 cat conftest.$ac_ext >&5
1514 { { echo "$as_me:1514: error: C compiler cannot create executables" >&5
1515 echo "$as_me: error: C compiler cannot create executables" >&2;}
1516    { (exit 77); exit 77; }; }
1517 fi
1518
1519 ac_exeext=$ac_cv_exeext
1520 echo "$as_me:1520: result: $ac_file" >&5
1521 echo "${ECHO_T}$ac_file" >&6
1522
1523 # Check the compiler produces executables we can run.  If not, either
1524 # the compiler is broken, or we cross compile.
1525 echo "$as_me:1525: checking whether the C compiler works" >&5
1526 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1527 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1528 # If not cross compiling, check that we can run a simple program.
1529 if test "$cross_compiling" != yes; then
1530   if { ac_try='./$ac_file'
1531   { (eval echo "$as_me:1531: \"$ac_try\"") >&5
1532   (eval $ac_try) 2>&5
1533   ac_status=$?
1534   echo "$as_me:1534: \$? = $ac_status" >&5
1535   (exit $ac_status); }; }; then
1536     cross_compiling=no
1537   else
1538     if test "$cross_compiling" = maybe; then
1539         cross_compiling=yes
1540     else
1541         { { echo "$as_me:1541: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&5
1543 echo "$as_me: error: cannot run C compiled programs.
1544 If you meant to cross compile, use \`--host'." >&2;}
1545    { (exit 1); exit 1; }; }
1546     fi
1547   fi
1548 fi
1549 echo "$as_me:1549: result: yes" >&5
1550 echo "${ECHO_T}yes" >&6
1551
1552 rm -f a.out a.exe conftest$ac_cv_exeext
1553 ac_clean_files=$ac_clean_files_save
1554 # Check the compiler produces executables we can run.  If not, either
1555 # the compiler is broken, or we cross compile.
1556 echo "$as_me:1556: checking whether we are cross compiling" >&5
1557 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1558 echo "$as_me:1558: result: $cross_compiling" >&5
1559 echo "${ECHO_T}$cross_compiling" >&6
1560
1561 echo "$as_me:1561: checking for executable suffix" >&5
1562 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1563 if { (eval echo "$as_me:1563: \"$ac_link\"") >&5
1564   (eval $ac_link) 2>&5
1565   ac_status=$?
1566   echo "$as_me:1566: \$? = $ac_status" >&5
1567   (exit $ac_status); }; then
1568   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1569 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1570 # work properly (i.e., refer to `conftest.exe'), while it won't with
1571 # `rm'.
1572 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1573   case $ac_file in
1574     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1575     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1576           export ac_cv_exeext
1577           break;;
1578     * ) break;;
1579   esac
1580 done
1581 else
1582   { { echo "$as_me:1582: error: cannot compute EXEEXT: cannot compile and link" >&5
1583 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1584    { (exit 1); exit 1; }; }
1585 fi
1586
1587 rm -f conftest$ac_cv_exeext
1588 echo "$as_me:1588: result: $ac_cv_exeext" >&5
1589 echo "${ECHO_T}$ac_cv_exeext" >&6
1590
1591 rm -f conftest.$ac_ext
1592 EXEEXT=$ac_cv_exeext
1593 ac_exeext=$EXEEXT
1594 echo "$as_me:1594: checking for object suffix" >&5
1595 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1596 if test "${ac_cv_objext+set}" = set; then
1597   echo $ECHO_N "(cached) $ECHO_C" >&6
1598 else
1599   cat >conftest.$ac_ext <<_ACEOF
1600 #line 1600 "configure"
1601 #include "confdefs.h"
1602
1603 int
1604 main (void)
1605 {
1606
1607   ;
1608   return 0;
1609 }
1610 _ACEOF
1611 rm -f conftest.o conftest.obj
1612 if { (eval echo "$as_me:1612: \"$ac_compile\"") >&5
1613   (eval $ac_compile) 2>&5
1614   ac_status=$?
1615   echo "$as_me:1615: \$? = $ac_status" >&5
1616   (exit $ac_status); }; then
1617   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1618   case $ac_file in
1619     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1620     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1621        break;;
1622   esac
1623 done
1624 else
1625   echo "$as_me: failed program was:" >&5
1626 cat conftest.$ac_ext >&5
1627 { { echo "$as_me:1627: error: cannot compute OBJEXT: cannot compile" >&5
1628 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1629    { (exit 1); exit 1; }; }
1630 fi
1631
1632 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1633 fi
1634 echo "$as_me:1634: result: $ac_cv_objext" >&5
1635 echo "${ECHO_T}$ac_cv_objext" >&6
1636 OBJEXT=$ac_cv_objext
1637 ac_objext=$OBJEXT
1638 echo "$as_me:1638: checking whether we are using the GNU C compiler" >&5
1639 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1640 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1641   echo $ECHO_N "(cached) $ECHO_C" >&6
1642 else
1643   cat >conftest.$ac_ext <<_ACEOF
1644 #line 1644 "configure"
1645 #include "confdefs.h"
1646
1647 int
1648 main (void)
1649 {
1650 #ifndef __GNUC__
1651        choke me
1652 #endif
1653
1654   ;
1655   return 0;
1656 }
1657 _ACEOF
1658 rm -f conftest.$ac_objext
1659 if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5
1660   (eval $ac_compile) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit $ac_status); } &&
1664          { ac_try='test -s conftest.$ac_objext'
1665   { (eval echo "$as_me:1665: \"$ac_try\"") >&5
1666   (eval $ac_try) 2>&5
1667   ac_status=$?
1668   echo "$as_me:1668: \$? = $ac_status" >&5
1669   (exit $ac_status); }; }; then
1670   ac_compiler_gnu=yes
1671 else
1672   echo "$as_me: failed program was:" >&5
1673 cat conftest.$ac_ext >&5
1674 ac_compiler_gnu=no
1675 fi
1676 rm -f conftest.$ac_objext conftest.$ac_ext
1677 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1678
1679 fi
1680 echo "$as_me:1680: result: $ac_cv_c_compiler_gnu" >&5
1681 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1682 GCC=`test $ac_compiler_gnu = yes && echo yes`
1683 ac_test_CFLAGS=${CFLAGS+set}
1684 ac_save_CFLAGS=$CFLAGS
1685 CFLAGS="-g"
1686 echo "$as_me:1686: checking whether $CC accepts -g" >&5
1687 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1688 if test "${ac_cv_prog_cc_g+set}" = set; then
1689   echo $ECHO_N "(cached) $ECHO_C" >&6
1690 else
1691   cat >conftest.$ac_ext <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694
1695 int
1696 main (void)
1697 {
1698
1699   ;
1700   return 0;
1701 }
1702 _ACEOF
1703 rm -f conftest.$ac_objext
1704 if { (eval echo "$as_me:1704: \"$ac_compile\"") >&5
1705   (eval $ac_compile) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit $ac_status); } &&
1709          { ac_try='test -s conftest.$ac_objext'
1710   { (eval echo "$as_me:1710: \"$ac_try\"") >&5
1711   (eval $ac_try) 2>&5
1712   ac_status=$?
1713   echo "$as_me:1713: \$? = $ac_status" >&5
1714   (exit $ac_status); }; }; then
1715   ac_cv_prog_cc_g=yes
1716 else
1717   echo "$as_me: failed program was:" >&5
1718 cat conftest.$ac_ext >&5
1719 ac_cv_prog_cc_g=no
1720 fi
1721 rm -f conftest.$ac_objext conftest.$ac_ext
1722 fi
1723 echo "$as_me:1723: result: $ac_cv_prog_cc_g" >&5
1724 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1725 if test "$ac_test_CFLAGS" = set; then
1726   CFLAGS=$ac_save_CFLAGS
1727 elif test $ac_cv_prog_cc_g = yes; then
1728   if test "$GCC" = yes; then
1729     CFLAGS="-g -O2"
1730   else
1731     CFLAGS="-g"
1732   fi
1733 else
1734   if test "$GCC" = yes; then
1735     CFLAGS="-O2"
1736   else
1737     CFLAGS=
1738   fi
1739 fi
1740 # Some people use a C++ compiler to compile C.  Since we use `exit',
1741 # in C++ we need to declare it.  In case someone uses the same compiler
1742 # for both compiling C and C++ we need to have the C++ compiler decide
1743 # the declaration of exit, since it's the most demanding environment.
1744 cat >conftest.$ac_ext <<_ACEOF
1745 #ifndef __cplusplus
1746   choke me
1747 #endif
1748 _ACEOF
1749 rm -f conftest.$ac_objext
1750 if { (eval echo "$as_me:1750: \"$ac_compile\"") >&5
1751   (eval $ac_compile) 2>&5
1752   ac_status=$?
1753   echo "$as_me:1753: \$? = $ac_status" >&5
1754   (exit $ac_status); } &&
1755          { ac_try='test -s conftest.$ac_objext'
1756   { (eval echo "$as_me:1756: \"$ac_try\"") >&5
1757   (eval $ac_try) 2>&5
1758   ac_status=$?
1759   echo "$as_me:1759: \$? = $ac_status" >&5
1760   (exit $ac_status); }; }; then
1761   for ac_declaration in \
1762    ''\
1763    '#include <stdlib.h>' \
1764    'extern "C" void std::exit (int) throw (); using std::exit;' \
1765    'extern "C" void std::exit (int); using std::exit;' \
1766    'extern "C" void exit (int) throw ();' \
1767    'extern "C" void exit (int);' \
1768    'void exit (int);'
1769 do
1770   cat >conftest.$ac_ext <<_ACEOF
1771 #line 1771 "configure"
1772 #include "confdefs.h"
1773 #include <stdlib.h>
1774 $ac_declaration
1775 int
1776 main (void)
1777 {
1778 exit (42);
1779   ;
1780   return 0;
1781 }
1782 _ACEOF
1783 rm -f conftest.$ac_objext
1784 if { (eval echo "$as_me:1784: \"$ac_compile\"") >&5
1785   (eval $ac_compile) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit $ac_status); } &&
1789          { ac_try='test -s conftest.$ac_objext'
1790   { (eval echo "$as_me:1790: \"$ac_try\"") >&5
1791   (eval $ac_try) 2>&5
1792   ac_status=$?
1793   echo "$as_me:1793: \$? = $ac_status" >&5
1794   (exit $ac_status); }; }; then
1795   :
1796 else
1797   echo "$as_me: failed program was:" >&5
1798 cat conftest.$ac_ext >&5
1799 continue
1800 fi
1801 rm -f conftest.$ac_objext conftest.$ac_ext
1802   cat >conftest.$ac_ext <<_ACEOF
1803 #line 1803 "configure"
1804 #include "confdefs.h"
1805 $ac_declaration
1806 int
1807 main (void)
1808 {
1809 exit (42);
1810   ;
1811   return 0;
1812 }
1813 _ACEOF
1814 rm -f conftest.$ac_objext
1815 if { (eval echo "$as_me:1815: \"$ac_compile\"") >&5
1816   (eval $ac_compile) 2>&5
1817   ac_status=$?
1818   echo "$as_me:1818: \$? = $ac_status" >&5
1819   (exit $ac_status); } &&
1820          { ac_try='test -s conftest.$ac_objext'
1821   { (eval echo "$as_me:1821: \"$ac_try\"") >&5
1822   (eval $ac_try) 2>&5
1823   ac_status=$?
1824   echo "$as_me:1824: \$? = $ac_status" >&5
1825   (exit $ac_status); }; }; then
1826   break
1827 else
1828   echo "$as_me: failed program was:" >&5
1829 cat conftest.$ac_ext >&5
1830 fi
1831 rm -f conftest.$ac_objext conftest.$ac_ext
1832 done
1833 rm -rf conftest*
1834 if test -n "$ac_declaration"; then
1835   echo '#ifdef __cplusplus' >>confdefs.h
1836   echo $ac_declaration      >>confdefs.h
1837   echo '#endif'             >>confdefs.h
1838 fi
1839
1840 else
1841   echo "$as_me: failed program was:" >&5
1842 cat conftest.$ac_ext >&5
1843 fi
1844 rm -f conftest.$ac_objext conftest.$ac_ext
1845 ac_ext=c
1846 ac_cpp='$CPP $CPPFLAGS'
1847 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1848 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1849 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1850 ac_main_return=return
1851
1852 GCC_VERSION=none
1853 if test "$GCC" = yes ; then
1854         echo "$as_me:1854: checking version of $CC" >&5
1855 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1856         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1857         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1858         echo "$as_me:1858: result: $GCC_VERSION" >&5
1859 echo "${ECHO_T}$GCC_VERSION" >&6
1860 fi
1861
1862 INTEL_COMPILER=no
1863
1864 if test "$GCC" = yes ; then
1865         case $host_os in
1866         (linux*|gnu*)
1867                 echo "$as_me:1867: checking if this is really Intel C compiler" >&5
1868 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1869                 cf_save_CFLAGS="$CFLAGS"
1870                 CFLAGS="$CFLAGS -no-gcc"
1871                 cat >conftest.$ac_ext <<_ACEOF
1872 #line 1872 "configure"
1873 #include "confdefs.h"
1874
1875 int
1876 main (void)
1877 {
1878
1879 #ifdef __INTEL_COMPILER
1880 #else
1881 make an error
1882 #endif
1883
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 rm -f conftest.$ac_objext
1889 if { (eval echo "$as_me:1889: \"$ac_compile\"") >&5
1890   (eval $ac_compile) 2>&5
1891   ac_status=$?
1892   echo "$as_me:1892: \$? = $ac_status" >&5
1893   (exit $ac_status); } &&
1894          { ac_try='test -s conftest.$ac_objext'
1895   { (eval echo "$as_me:1895: \"$ac_try\"") >&5
1896   (eval $ac_try) 2>&5
1897   ac_status=$?
1898   echo "$as_me:1898: \$? = $ac_status" >&5
1899   (exit $ac_status); }; }; then
1900   INTEL_COMPILER=yes
1901 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1902
1903 else
1904   echo "$as_me: failed program was:" >&5
1905 cat conftest.$ac_ext >&5
1906 fi
1907 rm -f conftest.$ac_objext conftest.$ac_ext
1908                 CFLAGS="$cf_save_CFLAGS"
1909                 echo "$as_me:1909: result: $INTEL_COMPILER" >&5
1910 echo "${ECHO_T}$INTEL_COMPILER" >&6
1911                 ;;
1912         esac
1913 fi
1914
1915 CLANG_COMPILER=no
1916
1917 if test "$GCC" = yes ; then
1918         echo "$as_me:1918: checking if this is really Clang C compiler" >&5
1919 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1920         cf_save_CFLAGS="$CFLAGS"
1921         CFLAGS="$CFLAGS -Qunused-arguments"
1922         cat >conftest.$ac_ext <<_ACEOF
1923 #line 1923 "configure"
1924 #include "confdefs.h"
1925
1926 int
1927 main (void)
1928 {
1929
1930 #ifdef __clang__
1931 #else
1932 make an error
1933 #endif
1934
1935   ;
1936   return 0;
1937 }
1938 _ACEOF
1939 rm -f conftest.$ac_objext
1940 if { (eval echo "$as_me:1940: \"$ac_compile\"") >&5
1941   (eval $ac_compile) 2>&5
1942   ac_status=$?
1943   echo "$as_me:1943: \$? = $ac_status" >&5
1944   (exit $ac_status); } &&
1945          { ac_try='test -s conftest.$ac_objext'
1946   { (eval echo "$as_me:1946: \"$ac_try\"") >&5
1947   (eval $ac_try) 2>&5
1948   ac_status=$?
1949   echo "$as_me:1949: \$? = $ac_status" >&5
1950   (exit $ac_status); }; }; then
1951   CLANG_COMPILER=yes
1952 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
1953
1954 else
1955   echo "$as_me: failed program was:" >&5
1956 cat conftest.$ac_ext >&5
1957 fi
1958 rm -f conftest.$ac_objext conftest.$ac_ext
1959         CFLAGS="$cf_save_CFLAGS"
1960         echo "$as_me:1960: result: $CLANG_COMPILER" >&5
1961 echo "${ECHO_T}$CLANG_COMPILER" >&6
1962 fi
1963
1964 echo "$as_me:1964: checking for $CC option to accept ANSI C" >&5
1965 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1966 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1967   echo $ECHO_N "(cached) $ECHO_C" >&6
1968 else
1969   ac_cv_prog_cc_stdc=no
1970 ac_save_CC=$CC
1971 cat >conftest.$ac_ext <<_ACEOF
1972 #line 1972 "configure"
1973 #include "confdefs.h"
1974 #include <stdarg.h>
1975 #include <stdio.h>
1976 #include <sys/types.h>
1977 #include <sys/stat.h>
1978 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1979 struct buf { int x; };
1980 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1981 static char *e (p, i)
1982      char **p;
1983      int i;
1984 {
1985   return p[i];
1986 }
1987 static char *f (char * (*g) (char **, int), char **p, ...)
1988 {
1989   char *s;
1990   va_list v;
1991   va_start (v,p);
1992   s = g (p, va_arg (v,int));
1993   va_end (v);
1994   return s;
1995 }
1996 int test (int i, double x);
1997 struct s1 {int (*f) (int a);};
1998 struct s2 {int (*f) (double a);};
1999 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2000 int argc;
2001 char **argv;
2002 int
2003 main (void)
2004 {
2005 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2006   ;
2007   return 0;
2008 }
2009 _ACEOF
2010 # Don't try gcc -ansi; that turns off useful extensions and
2011 # breaks some systems' header files.
2012 # AIX                   -qlanglvl=ansi
2013 # Ultrix and OSF/1      -std1
2014 # HP-UX 10.20 and later -Ae
2015 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2016 # SVR4                  -Xc -D__EXTENSIONS__
2017 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2018 do
2019   CC="$ac_save_CC $ac_arg"
2020   rm -f conftest.$ac_objext
2021 if { (eval echo "$as_me:2021: \"$ac_compile\"") >&5
2022   (eval $ac_compile) 2>&5
2023   ac_status=$?
2024   echo "$as_me:2024: \$? = $ac_status" >&5
2025   (exit $ac_status); } &&
2026          { ac_try='test -s conftest.$ac_objext'
2027   { (eval echo "$as_me:2027: \"$ac_try\"") >&5
2028   (eval $ac_try) 2>&5
2029   ac_status=$?
2030   echo "$as_me:2030: \$? = $ac_status" >&5
2031   (exit $ac_status); }; }; then
2032   ac_cv_prog_cc_stdc=$ac_arg
2033 break
2034 else
2035   echo "$as_me: failed program was:" >&5
2036 cat conftest.$ac_ext >&5
2037 fi
2038 rm -f conftest.$ac_objext
2039 done
2040 rm -f conftest.$ac_ext conftest.$ac_objext
2041 CC=$ac_save_CC
2042
2043 fi
2044
2045 case "x$ac_cv_prog_cc_stdc" in
2046   x|xno)
2047     echo "$as_me:2047: result: none needed" >&5
2048 echo "${ECHO_T}none needed" >&6 ;;
2049   *)
2050     echo "$as_me:2050: result: $ac_cv_prog_cc_stdc" >&5
2051 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2052     CC="$CC $ac_cv_prog_cc_stdc" ;;
2053 esac
2054
2055 # This should have been defined by AC_PROG_CC
2056 : ${CC:=cc}
2057
2058 echo "$as_me:2058: checking \$CFLAGS variable" >&5
2059 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2060 case "x$CFLAGS" in
2061 (*-[IUD]*)
2062         echo "$as_me:2062: result: broken" >&5
2063 echo "${ECHO_T}broken" >&6
2064         { echo "$as_me:2064: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2065 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2066         cf_flags="$CFLAGS"
2067         CFLAGS=
2068         for cf_arg in $cf_flags
2069         do
2070
2071 cf_fix_cppflags=no
2072 cf_new_cflags=
2073 cf_new_cppflags=
2074 cf_new_extra_cppflags=
2075
2076 for cf_add_cflags in $cf_arg
2077 do
2078 case $cf_fix_cppflags in
2079 (no)
2080         case $cf_add_cflags in
2081         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2082                 case $cf_add_cflags in
2083                 (-D*)
2084                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2085
2086                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2087                                 && test -z "${cf_tst_cflags}" \
2088                                 && cf_fix_cppflags=yes
2089
2090                         if test $cf_fix_cppflags = yes ; then
2091
2092         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2093         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2094
2095                                 continue
2096                         elif test "${cf_tst_cflags}" = "\"'" ; then
2097
2098         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2099         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2100
2101                                 continue
2102                         fi
2103                         ;;
2104                 esac
2105                 case "$CPPFLAGS" in
2106                 (*$cf_add_cflags)
2107                         ;;
2108                 (*)
2109                         case $cf_add_cflags in
2110                         (-D*)
2111                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2112
2113 CPPFLAGS=`echo "$CPPFLAGS" | \
2114         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2115                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2116
2117                                 ;;
2118                         esac
2119
2120         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2121         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2122
2123                         ;;
2124                 esac
2125                 ;;
2126         (*)
2127
2128         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2129         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2130
2131                 ;;
2132         esac
2133         ;;
2134 (yes)
2135
2136         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2137         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2138
2139         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2140
2141         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2142                 && test -z "${cf_tst_cflags}" \
2143                 && cf_fix_cppflags=no
2144         ;;
2145 esac
2146 done
2147
2148 if test -n "$cf_new_cflags" ; then
2149
2150         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2151         CFLAGS="${CFLAGS}$cf_new_cflags"
2152
2153 fi
2154
2155 if test -n "$cf_new_cppflags" ; then
2156
2157         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2158         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2159
2160 fi
2161
2162 if test -n "$cf_new_extra_cppflags" ; then
2163
2164         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2165         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2166
2167 fi
2168
2169         done
2170         ;;
2171 (*)
2172         echo "$as_me:2172: result: ok" >&5
2173 echo "${ECHO_T}ok" >&6
2174         ;;
2175 esac
2176
2177 echo "$as_me:2177: checking \$CC variable" >&5
2178 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2179 case "$CC" in
2180 (*[\ \  ]-*)
2181         echo "$as_me:2181: result: broken" >&5
2182 echo "${ECHO_T}broken" >&6
2183         { echo "$as_me:2183: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2184 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2185         # humor him...
2186         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2187         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2188         CC="$cf_prog"
2189         for cf_arg in $cf_flags
2190         do
2191                 case "x$cf_arg" in
2192                 (x-[IUDfgOW]*)
2193
2194 cf_fix_cppflags=no
2195 cf_new_cflags=
2196 cf_new_cppflags=
2197 cf_new_extra_cppflags=
2198
2199 for cf_add_cflags in $cf_arg
2200 do
2201 case $cf_fix_cppflags in
2202 (no)
2203         case $cf_add_cflags in
2204         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2205                 case $cf_add_cflags in
2206                 (-D*)
2207                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2208
2209                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2210                                 && test -z "${cf_tst_cflags}" \
2211                                 && cf_fix_cppflags=yes
2212
2213                         if test $cf_fix_cppflags = yes ; then
2214
2215         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2216         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2217
2218                                 continue
2219                         elif test "${cf_tst_cflags}" = "\"'" ; then
2220
2221         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2222         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2223
2224                                 continue
2225                         fi
2226                         ;;
2227                 esac
2228                 case "$CPPFLAGS" in
2229                 (*$cf_add_cflags)
2230                         ;;
2231                 (*)
2232                         case $cf_add_cflags in
2233                         (-D*)
2234                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2235
2236 CPPFLAGS=`echo "$CPPFLAGS" | \
2237         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2238                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2239
2240                                 ;;
2241                         esac
2242
2243         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2244         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2245
2246                         ;;
2247                 esac
2248                 ;;
2249         (*)
2250
2251         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2252         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2253
2254                 ;;
2255         esac
2256         ;;
2257 (yes)
2258
2259         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2260         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2261
2262         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2263
2264         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2265                 && test -z "${cf_tst_cflags}" \
2266                 && cf_fix_cppflags=no
2267         ;;
2268 esac
2269 done
2270
2271 if test -n "$cf_new_cflags" ; then
2272
2273         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2274         CFLAGS="${CFLAGS}$cf_new_cflags"
2275
2276 fi
2277
2278 if test -n "$cf_new_cppflags" ; then
2279
2280         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2281         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2282
2283 fi
2284
2285 if test -n "$cf_new_extra_cppflags" ; then
2286
2287         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2288         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2289
2290 fi
2291
2292                         ;;
2293                 (*)
2294                         CC="$CC $cf_arg"
2295                         ;;
2296                 esac
2297         done
2298         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2299
2300 echo "${as_me:-configure}:2300: testing resulting CC: '$CC' ..." 1>&5
2301
2302         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2303
2304 echo "${as_me:-configure}:2304: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2305
2306         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2307
2308 echo "${as_me:-configure}:2308: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2309
2310         ;;
2311 (*)
2312         echo "$as_me:2312: result: ok" >&5
2313 echo "${ECHO_T}ok" >&6
2314         ;;
2315 esac
2316
2317 echo "$as_me:2317: checking for inline" >&5
2318 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2319 if test "${ac_cv_c_inline+set}" = set; then
2320   echo $ECHO_N "(cached) $ECHO_C" >&6
2321 else
2322   ac_cv_c_inline=no
2323 for ac_kw in inline __inline__ __inline; do
2324   cat >conftest.$ac_ext <<_ACEOF
2325 #line 2325 "configure"
2326 #include "confdefs.h"
2327 #ifndef __cplusplus
2328 static $ac_kw int static_foo () {return 0; }
2329 $ac_kw int foo () {return 0; }
2330 #endif
2331
2332 _ACEOF
2333 rm -f conftest.$ac_objext
2334 if { (eval echo "$as_me:2334: \"$ac_compile\"") >&5
2335   (eval $ac_compile) 2>&5
2336   ac_status=$?
2337   echo "$as_me:2337: \$? = $ac_status" >&5
2338   (exit $ac_status); } &&
2339          { ac_try='test -s conftest.$ac_objext'
2340   { (eval echo "$as_me:2340: \"$ac_try\"") >&5
2341   (eval $ac_try) 2>&5
2342   ac_status=$?
2343   echo "$as_me:2343: \$? = $ac_status" >&5
2344   (exit $ac_status); }; }; then
2345   ac_cv_c_inline=$ac_kw; break
2346 else
2347   echo "$as_me: failed program was:" >&5
2348 cat conftest.$ac_ext >&5
2349 fi
2350 rm -f conftest.$ac_objext conftest.$ac_ext
2351 done
2352
2353 fi
2354 echo "$as_me:2354: result: $ac_cv_c_inline" >&5
2355 echo "${ECHO_T}$ac_cv_c_inline" >&6
2356 case $ac_cv_c_inline in
2357   inline | yes) ;;
2358   no)
2359 cat >>confdefs.h <<\EOF
2360 #define inline
2361 EOF
2362  ;;
2363   *)  cat >>confdefs.h <<EOF
2364 #define inline $ac_cv_c_inline
2365 EOF
2366  ;;
2367 esac
2368
2369 ac_ext=c
2370 ac_cpp='$CPP $CPPFLAGS'
2371 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2372 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2373 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2374 ac_main_return=return
2375 echo "$as_me:2375: checking how to run the C preprocessor" >&5
2376 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2377 # On Suns, sometimes $CPP names a directory.
2378 if test -n "$CPP" && test -d "$CPP"; then
2379   CPP=
2380 fi
2381 if test -z "$CPP"; then
2382   if test "${ac_cv_prog_CPP+set}" = set; then
2383   echo $ECHO_N "(cached) $ECHO_C" >&6
2384 else
2385       # Double quotes because CPP needs to be expanded
2386     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2387     do
2388       ac_preproc_ok=false
2389 for ac_c_preproc_warn_flag in '' yes
2390 do
2391   # Use a header file that comes with gcc, so configuring glibc
2392   # with a fresh cross-compiler works.
2393   # On the NeXT, cc -E runs the code through the compiler's parser,
2394   # not just through cpp. "Syntax error" is here to catch this case.
2395   cat >conftest.$ac_ext <<_ACEOF
2396 #line 2396 "configure"
2397 #include "confdefs.h"
2398 #include <assert.h>
2399                      Syntax error
2400 _ACEOF
2401 if { (eval echo "$as_me:2401: \"$ac_cpp conftest.$ac_ext\"") >&5
2402   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2403   ac_status=$?
2404   egrep -v '^ *\+' conftest.er1 >conftest.err
2405   rm -f conftest.er1
2406   cat conftest.err >&5
2407   echo "$as_me:2407: \$? = $ac_status" >&5
2408   (exit $ac_status); } >/dev/null; then
2409   if test -s conftest.err; then
2410     ac_cpp_err=$ac_c_preproc_warn_flag
2411   else
2412     ac_cpp_err=
2413   fi
2414 else
2415   ac_cpp_err=yes
2416 fi
2417 if test -z "$ac_cpp_err"; then
2418   :
2419 else
2420   echo "$as_me: failed program was:" >&5
2421   cat conftest.$ac_ext >&5
2422   # Broken: fails on valid input.
2423 continue
2424 fi
2425 rm -f conftest.err conftest.$ac_ext
2426
2427   # OK, works on sane cases.  Now check whether non-existent headers
2428   # can be detected and how.
2429   cat >conftest.$ac_ext <<_ACEOF
2430 #line 2430 "configure"
2431 #include "confdefs.h"
2432 #include <ac_nonexistent.h>
2433 _ACEOF
2434 if { (eval echo "$as_me:2434: \"$ac_cpp conftest.$ac_ext\"") >&5
2435   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2436   ac_status=$?
2437   egrep -v '^ *\+' conftest.er1 >conftest.err
2438   rm -f conftest.er1
2439   cat conftest.err >&5
2440   echo "$as_me:2440: \$? = $ac_status" >&5
2441   (exit $ac_status); } >/dev/null; then
2442   if test -s conftest.err; then
2443     ac_cpp_err=$ac_c_preproc_warn_flag
2444   else
2445     ac_cpp_err=
2446   fi
2447 else
2448   ac_cpp_err=yes
2449 fi
2450 if test -z "$ac_cpp_err"; then
2451   # Broken: success on invalid input.
2452 continue
2453 else
2454   echo "$as_me: failed program was:" >&5
2455   cat conftest.$ac_ext >&5
2456   # Passes both tests.
2457 ac_preproc_ok=:
2458 break
2459 fi
2460 rm -f conftest.err conftest.$ac_ext
2461
2462 done
2463 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2464 rm -f conftest.err conftest.$ac_ext
2465 if $ac_preproc_ok; then
2466   break
2467 fi
2468
2469     done
2470     ac_cv_prog_CPP=$CPP
2471
2472 fi
2473   CPP=$ac_cv_prog_CPP
2474 else
2475   ac_cv_prog_CPP=$CPP
2476 fi
2477 echo "$as_me:2477: result: $CPP" >&5
2478 echo "${ECHO_T}$CPP" >&6
2479 ac_preproc_ok=false
2480 for ac_c_preproc_warn_flag in '' yes
2481 do
2482   # Use a header file that comes with gcc, so configuring glibc
2483   # with a fresh cross-compiler works.
2484   # On the NeXT, cc -E runs the code through the compiler's parser,
2485   # not just through cpp. "Syntax error" is here to catch this case.
2486   cat >conftest.$ac_ext <<_ACEOF
2487 #line 2487 "configure"
2488 #include "confdefs.h"
2489 #include <assert.h>
2490                      Syntax error
2491 _ACEOF
2492 if { (eval echo "$as_me:2492: \"$ac_cpp conftest.$ac_ext\"") >&5
2493   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2494   ac_status=$?
2495   egrep -v '^ *\+' conftest.er1 >conftest.err
2496   rm -f conftest.er1
2497   cat conftest.err >&5
2498   echo "$as_me:2498: \$? = $ac_status" >&5
2499   (exit $ac_status); } >/dev/null; then
2500   if test -s conftest.err; then
2501     ac_cpp_err=$ac_c_preproc_warn_flag
2502   else
2503     ac_cpp_err=
2504   fi
2505 else
2506   ac_cpp_err=yes
2507 fi
2508 if test -z "$ac_cpp_err"; then
2509   :
2510 else
2511   echo "$as_me: failed program was:" >&5
2512   cat conftest.$ac_ext >&5
2513   # Broken: fails on valid input.
2514 continue
2515 fi
2516 rm -f conftest.err conftest.$ac_ext
2517
2518   # OK, works on sane cases.  Now check whether non-existent headers
2519   # can be detected and how.
2520   cat >conftest.$ac_ext <<_ACEOF
2521 #line 2521 "configure"
2522 #include "confdefs.h"
2523 #include <ac_nonexistent.h>
2524 _ACEOF
2525 if { (eval echo "$as_me:2525: \"$ac_cpp conftest.$ac_ext\"") >&5
2526   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2527   ac_status=$?
2528   egrep -v '^ *\+' conftest.er1 >conftest.err
2529   rm -f conftest.er1
2530   cat conftest.err >&5
2531   echo "$as_me:2531: \$? = $ac_status" >&5
2532   (exit $ac_status); } >/dev/null; then
2533   if test -s conftest.err; then
2534     ac_cpp_err=$ac_c_preproc_warn_flag
2535   else
2536     ac_cpp_err=
2537   fi
2538 else
2539   ac_cpp_err=yes
2540 fi
2541 if test -z "$ac_cpp_err"; then
2542   # Broken: success on invalid input.
2543 continue
2544 else
2545   echo "$as_me: failed program was:" >&5
2546   cat conftest.$ac_ext >&5
2547   # Passes both tests.
2548 ac_preproc_ok=:
2549 break
2550 fi
2551 rm -f conftest.err conftest.$ac_ext
2552
2553 done
2554 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2555 rm -f conftest.err conftest.$ac_ext
2556 if $ac_preproc_ok; then
2557   :
2558 else
2559   { { echo "$as_me:2559: error: C preprocessor \"$CPP\" fails sanity check" >&5
2560 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2561    { (exit 1); exit 1; }; }
2562 fi
2563
2564 ac_ext=c
2565 ac_cpp='$CPP $CPPFLAGS'
2566 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2567 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2568 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2569 ac_main_return=return
2570
2571 for ac_prog in mawk gawk nawk awk
2572 do
2573   # Extract the first word of "$ac_prog", so it can be a program name with args.
2574 set dummy $ac_prog; ac_word=$2
2575 echo "$as_me:2575: checking for $ac_word" >&5
2576 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2577 if test "${ac_cv_prog_AWK+set}" = set; then
2578   echo $ECHO_N "(cached) $ECHO_C" >&6
2579 else
2580   if test -n "$AWK"; then
2581   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2582 else
2583   ac_save_IFS=$IFS; IFS=$ac_path_separator
2584 ac_dummy="$PATH"
2585 for ac_dir in $ac_dummy; do
2586   IFS=$ac_save_IFS
2587   test -z "$ac_dir" && ac_dir=.
2588   $as_executable_p "$ac_dir/$ac_word" || continue
2589 ac_cv_prog_AWK="$ac_prog"
2590 echo "$as_me:2590: found $ac_dir/$ac_word" >&5
2591 break
2592 done
2593
2594 fi
2595 fi
2596 AWK=$ac_cv_prog_AWK
2597 if test -n "$AWK"; then
2598   echo "$as_me:2598: result: $AWK" >&5
2599 echo "${ECHO_T}$AWK" >&6
2600 else
2601   echo "$as_me:2601: result: no" >&5
2602 echo "${ECHO_T}no" >&6
2603 fi
2604
2605   test -n "$AWK" && break
2606 done
2607
2608 # Find a good install program.  We prefer a C program (faster),
2609 # so one script is as good as another.  But avoid the broken or
2610 # incompatible versions:
2611 # SysV /etc/install, /usr/sbin/install
2612 # SunOS /usr/etc/install
2613 # IRIX /sbin/install
2614 # AIX /bin/install
2615 # AmigaOS /C/install, which installs bootblocks on floppy discs
2616 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2617 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2618 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2619 # ./install, which can be erroneously created by make from ./install.sh.
2620 echo "$as_me:2620: checking for a BSD compatible install" >&5
2621 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2622 if test -z "$INSTALL"; then
2623 if test "${ac_cv_path_install+set}" = set; then
2624   echo $ECHO_N "(cached) $ECHO_C" >&6
2625 else
2626     ac_save_IFS=$IFS; IFS=$ac_path_separator
2627   for ac_dir in $PATH; do
2628     IFS=$ac_save_IFS
2629     # Account for people who put trailing slashes in PATH elements.
2630     case $ac_dir/ in
2631     / | ./ | .// | /cC/* \
2632     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2633     | /usr/ucb/* ) ;;
2634     *)
2635       # OSF1 and SCO ODT 3.0 have their own names for install.
2636       # Don't use installbsd from OSF since it installs stuff as root
2637       # by default.
2638       for ac_prog in ginstall scoinst install; do
2639         if $as_executable_p "$ac_dir/$ac_prog"; then
2640           if test $ac_prog = install &&
2641             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2642             # AIX install.  It has an incompatible calling convention.
2643             :
2644           elif test $ac_prog = install &&
2645             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2646             # program-specific install script used by HP pwplus--don't use.
2647             :
2648           else
2649             ac_cv_path_install="$ac_dir/$ac_prog -c"
2650             break 2
2651           fi
2652         fi
2653       done
2654       ;;
2655     esac
2656   done
2657
2658 fi
2659   if test "${ac_cv_path_install+set}" = set; then
2660     INSTALL=$ac_cv_path_install
2661   else
2662     # As a last resort, use the slow shell script.  We don't cache a
2663     # path for INSTALL within a source directory, because that will
2664     # break other packages using the cache if that directory is
2665     # removed, or if the path is relative.
2666     INSTALL=$ac_install_sh
2667   fi
2668 fi
2669 echo "$as_me:2669: result: $INSTALL" >&5
2670 echo "${ECHO_T}$INSTALL" >&6
2671
2672 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2673 # It thinks the first close brace ends the variable substitution.
2674 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2675
2676 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2677
2678 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2679
2680 case $INSTALL in
2681 (/*)
2682         ;;
2683 (*)
2684         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2685         test -z "$cf_dir" && cf_dir=.
2686         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2687         ;;
2688 esac
2689
2690 echo "$as_me:2690: checking if you want to install stripped executables" >&5
2691 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2692
2693 # Check whether --enable-stripping or --disable-stripping was given.
2694 if test "${enable_stripping+set}" = set; then
2695   enableval="$enable_stripping"
2696   test "$enableval" != no && enableval=yes
2697         if test "$enableval" != "yes" ; then
2698     with_stripping=no
2699         else
2700                 with_stripping=yes
2701         fi
2702 else
2703   enableval=yes
2704         with_stripping=yes
2705
2706 fi;
2707 echo "$as_me:2707: result: $with_stripping" >&5
2708 echo "${ECHO_T}$with_stripping" >&6
2709
2710 if test "$with_stripping" = yes
2711 then
2712         INSTALL_OPT_S="-s"
2713 else
2714         INSTALL_OPT_S=
2715 fi
2716
2717 : ${INSTALL:=install}
2718 echo "$as_me:2718: checking if install accepts -p option" >&5
2719 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2720 if test "${cf_cv_install_p+set}" = set; then
2721   echo $ECHO_N "(cached) $ECHO_C" >&6
2722 else
2723
2724         rm -rf conftest*
2725         date >conftest.in
2726         mkdir conftest.out
2727         sleep 3
2728         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2729         then
2730                 if test -f conftest.out/conftest.in
2731                 then
2732                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2733                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2734                         if test -s conftest.err
2735                         then
2736                                 cf_cv_install_p=no
2737                         else
2738                                 cf_cv_install_p=yes
2739                         fi
2740                 else
2741                         cf_cv_install_p=no
2742                 fi
2743         else
2744                 cf_cv_install_p=no
2745         fi
2746         rm -rf conftest*
2747
2748 fi
2749 echo "$as_me:2749: result: $cf_cv_install_p" >&5
2750 echo "${ECHO_T}$cf_cv_install_p" >&6
2751
2752 echo "$as_me:2752: checking if install needs to be told about ownership" >&5
2753 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2754 case `$ac_config_guess` in
2755 (*minix)
2756         with_install_o=yes
2757         ;;
2758 (*)
2759         with_install_o=no
2760         ;;
2761 esac
2762
2763 echo "$as_me:2763: result: $with_install_o" >&5
2764 echo "${ECHO_T}$with_install_o" >&6
2765 if test "x$with_install_o" = xyes
2766 then
2767         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2768 else
2769         INSTALL_OPT_O=
2770 fi
2771
2772 for ac_prog in lint cppcheck splint
2773 do
2774   # Extract the first word of "$ac_prog", so it can be a program name with args.
2775 set dummy $ac_prog; ac_word=$2
2776 echo "$as_me:2776: checking for $ac_word" >&5
2777 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2778 if test "${ac_cv_prog_LINT+set}" = set; then
2779   echo $ECHO_N "(cached) $ECHO_C" >&6
2780 else
2781   if test -n "$LINT"; then
2782   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2783 else
2784   ac_save_IFS=$IFS; IFS=$ac_path_separator
2785 ac_dummy="$PATH"
2786 for ac_dir in $ac_dummy; do
2787   IFS=$ac_save_IFS
2788   test -z "$ac_dir" && ac_dir=.
2789   $as_executable_p "$ac_dir/$ac_word" || continue
2790 ac_cv_prog_LINT="$ac_prog"
2791 echo "$as_me:2791: found $ac_dir/$ac_word" >&5
2792 break
2793 done
2794
2795 fi
2796 fi
2797 LINT=$ac_cv_prog_LINT
2798 if test -n "$LINT"; then
2799   echo "$as_me:2799: result: $LINT" >&5
2800 echo "${ECHO_T}$LINT" >&6
2801 else
2802   echo "$as_me:2802: result: no" >&5
2803 echo "${ECHO_T}no" >&6
2804 fi
2805
2806   test -n "$LINT" && break
2807 done
2808
2809 case "x$LINT" in
2810 (xcppcheck|x*/cppcheck)
2811         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2812         ;;
2813 esac
2814
2815 echo "$as_me:2815: checking if filesystem supports mixed-case filenames" >&5
2816 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2817 if test "${cf_cv_mixedcase+set}" = set; then
2818   echo $ECHO_N "(cached) $ECHO_C" >&6
2819 else
2820
2821 if test "$cross_compiling" = yes ; then
2822         case $target_alias in
2823         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2824                 cf_cv_mixedcase=no
2825                 ;;
2826         (*)
2827                 cf_cv_mixedcase=yes
2828                 ;;
2829         esac
2830 else
2831         rm -f conftest CONFTEST
2832         echo test >conftest
2833         if test -f CONFTEST ; then
2834                 cf_cv_mixedcase=no
2835         else
2836                 cf_cv_mixedcase=yes
2837         fi
2838         rm -f conftest CONFTEST
2839 fi
2840
2841 fi
2842 echo "$as_me:2842: result: $cf_cv_mixedcase" >&5
2843 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2844 test "$cf_cv_mixedcase" = yes &&
2845 cat >>confdefs.h <<\EOF
2846 #define MIXEDCASE_FILENAMES 1
2847 EOF
2848
2849 for ac_prog in exctags ctags
2850 do
2851   # Extract the first word of "$ac_prog", so it can be a program name with args.
2852 set dummy $ac_prog; ac_word=$2
2853 echo "$as_me:2853: checking for $ac_word" >&5
2854 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2855 if test "${ac_cv_prog_CTAGS+set}" = set; then
2856   echo $ECHO_N "(cached) $ECHO_C" >&6
2857 else
2858   if test -n "$CTAGS"; then
2859   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2860 else
2861   ac_save_IFS=$IFS; IFS=$ac_path_separator
2862 ac_dummy="$PATH"
2863 for ac_dir in $ac_dummy; do
2864   IFS=$ac_save_IFS
2865   test -z "$ac_dir" && ac_dir=.
2866   $as_executable_p "$ac_dir/$ac_word" || continue
2867 ac_cv_prog_CTAGS="$ac_prog"
2868 echo "$as_me:2868: found $ac_dir/$ac_word" >&5
2869 break
2870 done
2871
2872 fi
2873 fi
2874 CTAGS=$ac_cv_prog_CTAGS
2875 if test -n "$CTAGS"; then
2876   echo "$as_me:2876: result: $CTAGS" >&5
2877 echo "${ECHO_T}$CTAGS" >&6
2878 else
2879   echo "$as_me:2879: result: no" >&5
2880 echo "${ECHO_T}no" >&6
2881 fi
2882
2883   test -n "$CTAGS" && break
2884 done
2885
2886 for ac_prog in exetags etags
2887 do
2888   # Extract the first word of "$ac_prog", so it can be a program name with args.
2889 set dummy $ac_prog; ac_word=$2
2890 echo "$as_me:2890: checking for $ac_word" >&5
2891 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2892 if test "${ac_cv_prog_ETAGS+set}" = set; then
2893   echo $ECHO_N "(cached) $ECHO_C" >&6
2894 else
2895   if test -n "$ETAGS"; then
2896   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2897 else
2898   ac_save_IFS=$IFS; IFS=$ac_path_separator
2899 ac_dummy="$PATH"
2900 for ac_dir in $ac_dummy; do
2901   IFS=$ac_save_IFS
2902   test -z "$ac_dir" && ac_dir=.
2903   $as_executable_p "$ac_dir/$ac_word" || continue
2904 ac_cv_prog_ETAGS="$ac_prog"
2905 echo "$as_me:2905: found $ac_dir/$ac_word" >&5
2906 break
2907 done
2908
2909 fi
2910 fi
2911 ETAGS=$ac_cv_prog_ETAGS
2912 if test -n "$ETAGS"; then
2913   echo "$as_me:2913: result: $ETAGS" >&5
2914 echo "${ECHO_T}$ETAGS" >&6
2915 else
2916   echo "$as_me:2916: result: no" >&5
2917 echo "${ECHO_T}no" >&6
2918 fi
2919
2920   test -n "$ETAGS" && break
2921 done
2922
2923 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2924 set dummy ${CTAGS:-ctags}; ac_word=$2
2925 echo "$as_me:2925: checking for $ac_word" >&5
2926 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2927 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2928   echo $ECHO_N "(cached) $ECHO_C" >&6
2929 else
2930   if test -n "$MAKE_LOWER_TAGS"; then
2931   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2932 else
2933   ac_save_IFS=$IFS; IFS=$ac_path_separator
2934 ac_dummy="$PATH"
2935 for ac_dir in $ac_dummy; do
2936   IFS=$ac_save_IFS
2937   test -z "$ac_dir" && ac_dir=.
2938   $as_executable_p "$ac_dir/$ac_word" || continue
2939 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2940 echo "$as_me:2940: found $ac_dir/$ac_word" >&5
2941 break
2942 done
2943
2944   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2945 fi
2946 fi
2947 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2948 if test -n "$MAKE_LOWER_TAGS"; then
2949   echo "$as_me:2949: result: $MAKE_LOWER_TAGS" >&5
2950 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2951 else
2952   echo "$as_me:2952: result: no" >&5
2953 echo "${ECHO_T}no" >&6
2954 fi
2955
2956 if test "$cf_cv_mixedcase" = yes ; then
2957         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2958 set dummy ${ETAGS:-etags}; ac_word=$2
2959 echo "$as_me:2959: checking for $ac_word" >&5
2960 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2961 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2962   echo $ECHO_N "(cached) $ECHO_C" >&6
2963 else
2964   if test -n "$MAKE_UPPER_TAGS"; then
2965   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2966 else
2967   ac_save_IFS=$IFS; IFS=$ac_path_separator
2968 ac_dummy="$PATH"
2969 for ac_dir in $ac_dummy; do
2970   IFS=$ac_save_IFS
2971   test -z "$ac_dir" && ac_dir=.
2972   $as_executable_p "$ac_dir/$ac_word" || continue
2973 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2974 echo "$as_me:2974: found $ac_dir/$ac_word" >&5
2975 break
2976 done
2977
2978   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2979 fi
2980 fi
2981 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2982 if test -n "$MAKE_UPPER_TAGS"; then
2983   echo "$as_me:2983: result: $MAKE_UPPER_TAGS" >&5
2984 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2985 else
2986   echo "$as_me:2986: result: no" >&5
2987 echo "${ECHO_T}no" >&6
2988 fi
2989
2990 else
2991         MAKE_UPPER_TAGS=no
2992 fi
2993
2994 if test "$MAKE_UPPER_TAGS" = yes ; then
2995         MAKE_UPPER_TAGS=
2996 else
2997         MAKE_UPPER_TAGS="#"
2998 fi
2999
3000 if test "$MAKE_LOWER_TAGS" = yes ; then
3001         MAKE_LOWER_TAGS=
3002 else
3003         MAKE_LOWER_TAGS="#"
3004 fi
3005
3006 echo "$as_me:3006: checking if -lm needed for math functions" >&5
3007 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3008 if test "${cf_cv_need_libm+set}" = set; then
3009   echo $ECHO_N "(cached) $ECHO_C" >&6
3010 else
3011
3012         cat >conftest.$ac_ext <<_ACEOF
3013 #line 3013 "configure"
3014 #include "confdefs.h"
3015
3016         #include <stdio.h>
3017         #include <stdlib.h>
3018         #include <math.h>
3019
3020 int
3021 main (void)
3022 {
3023 double x = rand(); printf("result = %g\n", pow(sin(x),x))
3024   ;
3025   return 0;
3026 }
3027 _ACEOF
3028 rm -f conftest.$ac_objext conftest$ac_exeext
3029 if { (eval echo "$as_me:3029: \"$ac_link\"") >&5
3030   (eval $ac_link) 2>&5
3031   ac_status=$?
3032   echo "$as_me:3032: \$? = $ac_status" >&5
3033   (exit $ac_status); } &&
3034          { ac_try='test -s conftest$ac_exeext'
3035   { (eval echo "$as_me:3035: \"$ac_try\"") >&5
3036   (eval $ac_try) 2>&5
3037   ac_status=$?
3038   echo "$as_me:3038: \$? = $ac_status" >&5
3039   (exit $ac_status); }; }; then
3040   cf_cv_need_libm=no
3041 else
3042   echo "$as_me: failed program was:" >&5
3043 cat conftest.$ac_ext >&5
3044 cf_cv_need_libm=yes
3045 fi
3046 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3047 fi
3048 echo "$as_me:3048: result: $cf_cv_need_libm" >&5
3049 echo "${ECHO_T}$cf_cv_need_libm" >&6
3050 if test "$cf_cv_need_libm" = yes
3051 then
3052 MATH_LIB=-lm
3053 fi
3054
3055 top_builddir=`pwd`
3056
3057 CC_G_OPT="-g"
3058 CC_SHARED_OPTS=unknown
3059 CPPFLAGS="$CPPFLAGS"
3060 DFT_DEP_SUFFIX=""
3061 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3062 DFT_UPR_MODEL="NORMAL"
3063 LD="ld"
3064 LDFLAGS_SHARED=""
3065 LDFLAGS_STATIC=""
3066 LD_MODEL=""
3067 LD_SHARED_OPTS=""
3068 LIBTOOL=""
3069 LIBTOOL_OPTS=""
3070 LIB_CLEAN=""
3071 LIB_COMPILE=""
3072 LIB_LINK='${CC}'
3073 LINK_TESTS=""
3074 LOCAL_LDFLAGS=""
3075 PACKAGE="ncurses-examples"
3076 PTHREAD="-lm"
3077 TEST_ARGS=""
3078 TEST_DEPS=""
3079 TEST_LIBS=""
3080 TINFO_LDFLAGS=''
3081 TINFO_LIBS='$(LIBS_CURSES)'
3082 cf_cv_abi_version=""
3083 cf_cv_rel_version=""
3084 includesubdir=""
3085
3086 cf_cv_screen=curses
3087 cf_cv_libtype=
3088
3089 if test "$GCC" = yes
3090 then
3091 cat > conftest.i <<EOF
3092 #ifndef GCC_PRINTF
3093 #define GCC_PRINTF 0
3094 #endif
3095 #ifndef GCC_SCANF
3096 #define GCC_SCANF 0
3097 #endif
3098 #ifndef GCC_NORETURN
3099 #define GCC_NORETURN /* nothing */
3100 #endif
3101 #ifndef GCC_UNUSED
3102 #define GCC_UNUSED /* nothing */
3103 #endif
3104 EOF
3105 if test "$GCC" = yes
3106 then
3107         { echo "$as_me:3107: checking for $CC __attribute__ directives..." >&5
3108 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3109 cat > conftest.$ac_ext <<EOF
3110 #line 3110 "${as_me:-configure}"
3111 #include "confdefs.h"
3112 #include "conftest.h"
3113 #include "conftest.i"
3114 #if     GCC_PRINTF
3115 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3116 #else
3117 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3118 #endif
3119 #if     GCC_SCANF
3120 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3121 #else
3122 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3123 #endif
3124 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3125 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3126 extern void foo(void) GCC_NORETURN;
3127 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3128 EOF
3129         cf_printf_attribute=no
3130         cf_scanf_attribute=no
3131         for cf_attribute in scanf printf unused noreturn
3132         do
3133
3134 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3135
3136                 cf_directive="__attribute__(($cf_attribute))"
3137                 echo "checking for $CC $cf_directive" 1>&5
3138
3139                 case $cf_attribute in
3140                 (printf)
3141                         cf_printf_attribute=yes
3142                         cat >conftest.h <<EOF
3143 #define GCC_$cf_ATTRIBUTE 1
3144 EOF
3145                         ;;
3146                 (scanf)
3147                         cf_scanf_attribute=yes
3148                         cat >conftest.h <<EOF
3149 #define GCC_$cf_ATTRIBUTE 1
3150 EOF
3151                         ;;
3152                 (*)
3153                         cat >conftest.h <<EOF
3154 #define GCC_$cf_ATTRIBUTE $cf_directive
3155 EOF
3156                         ;;
3157                 esac
3158
3159                 if { (eval echo "$as_me:3159: \"$ac_compile\"") >&5
3160   (eval $ac_compile) 2>&5
3161   ac_status=$?
3162   echo "$as_me:3162: \$? = $ac_status" >&5
3163   (exit $ac_status); }; then
3164                         test -n "$verbose" && echo "$as_me:3164: result: ... $cf_attribute" >&5
3165 echo "${ECHO_T}... $cf_attribute" >&6
3166                         cat conftest.h >>confdefs.h
3167                         case $cf_attribute in
3168                         (noreturn)
3169
3170 cat >>confdefs.h <<EOF
3171 #define GCC_NORETURN $cf_directive
3172 EOF
3173
3174                                 ;;
3175                         (printf)
3176                                 cf_value='/* nothing */'
3177                                 if test "$cf_printf_attribute" != no ; then
3178                                         cf_value='__attribute__((format(printf,fmt,var)))'
3179
3180 cat >>confdefs.h <<\EOF
3181 #define GCC_PRINTF 1
3182 EOF
3183
3184                                 fi
3185
3186 cat >>confdefs.h <<EOF
3187 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3188 EOF
3189
3190                                 ;;
3191                         (scanf)
3192                                 cf_value='/* nothing */'
3193                                 if test "$cf_scanf_attribute" != no ; then
3194                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3195
3196 cat >>confdefs.h <<\EOF
3197 #define GCC_SCANF 1
3198 EOF
3199
3200                                 fi
3201
3202 cat >>confdefs.h <<EOF
3203 #define GCC_SCANFLIKE(fmt,var) $cf_value
3204 EOF
3205
3206                                 ;;
3207                         (unused)
3208
3209 cat >>confdefs.h <<EOF
3210 #define GCC_UNUSED $cf_directive
3211 EOF
3212
3213                                 ;;
3214                         esac
3215                 fi
3216         done
3217 else
3218         fgrep define conftest.i >>confdefs.h
3219 fi
3220 rm -rf conftest*
3221 fi
3222
3223 echo "$as_me:3223: checking if you want to work around bogus compiler/loader warnings" >&5
3224 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3225
3226 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3227 if test "${enable_string_hacks+set}" = set; then
3228   enableval="$enable_string_hacks"
3229   with_string_hacks=$enableval
3230 else
3231   with_string_hacks=no
3232 fi;
3233 echo "$as_me:3233: result: $with_string_hacks" >&5
3234 echo "${ECHO_T}$with_string_hacks" >&6
3235
3236 if test "x$with_string_hacks" = "xyes"; then
3237
3238 cat >>confdefs.h <<\EOF
3239 #define USE_STRING_HACKS 1
3240 EOF
3241
3242         { echo "$as_me:3242: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3243 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3244         echo "$as_me:3244: checking for strlcat" >&5
3245 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3246 if test "${ac_cv_func_strlcat+set}" = set; then
3247   echo $ECHO_N "(cached) $ECHO_C" >&6
3248 else
3249   cat >conftest.$ac_ext <<_ACEOF
3250 #line 3250 "configure"
3251 #include "confdefs.h"
3252 #define strlcat autoconf_temporary
3253 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3254 #undef strlcat
3255
3256 #ifdef __cplusplus
3257 extern "C"
3258 #endif
3259
3260 /* We use char because int might match the return type of a gcc2
3261    builtin and then its argument prototype would still apply.  */
3262 char strlcat (void);
3263
3264 int
3265 main (void)
3266 {
3267
3268 /* The GNU C library defines stubs for functions which it implements
3269     to always fail with ENOSYS.  Some functions are actually named
3270     something starting with __ and the normal name is an alias.  */
3271 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3272 #error found stub for strlcat
3273 #endif
3274
3275         return strlcat ();
3276   ;
3277   return 0;
3278 }
3279 _ACEOF
3280 rm -f conftest.$ac_objext conftest$ac_exeext
3281 if { (eval echo "$as_me:3281: \"$ac_link\"") >&5
3282   (eval $ac_link) 2>&5
3283   ac_status=$?
3284   echo "$as_me:3284: \$? = $ac_status" >&5
3285   (exit $ac_status); } &&
3286          { ac_try='test -s conftest$ac_exeext'
3287   { (eval echo "$as_me:3287: \"$ac_try\"") >&5
3288   (eval $ac_try) 2>&5
3289   ac_status=$?
3290   echo "$as_me:3290: \$? = $ac_status" >&5
3291   (exit $ac_status); }; }; then
3292   ac_cv_func_strlcat=yes
3293 else
3294   echo "$as_me: failed program was:" >&5
3295 cat conftest.$ac_ext >&5
3296 ac_cv_func_strlcat=no
3297 fi
3298 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3299 fi
3300 echo "$as_me:3300: result: $ac_cv_func_strlcat" >&5
3301 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3302 if test $ac_cv_func_strlcat = yes; then
3303
3304 cat >>confdefs.h <<\EOF
3305 #define HAVE_STRLCAT 1
3306 EOF
3307
3308 else
3309
3310                 echo "$as_me:3310: checking for strlcat in -lbsd" >&5
3311 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3312 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3313   echo $ECHO_N "(cached) $ECHO_C" >&6
3314 else
3315   ac_check_lib_save_LIBS=$LIBS
3316 LIBS="-lbsd  $LIBS"
3317 cat >conftest.$ac_ext <<_ACEOF
3318 #line 3318 "configure"
3319 #include "confdefs.h"
3320
3321 /* Override any gcc2 internal prototype to avoid an error.  */
3322 #ifdef __cplusplus
3323 extern "C"
3324 #endif
3325 /* We use char because int might match the return type of a gcc2
3326    builtin and then its argument prototype would still apply.  */
3327 char strlcat ();
3328 int
3329 main (void)
3330 {
3331 strlcat ();
3332   ;
3333   return 0;
3334 }
3335 _ACEOF
3336 rm -f conftest.$ac_objext conftest$ac_exeext
3337 if { (eval echo "$as_me:3337: \"$ac_link\"") >&5
3338   (eval $ac_link) 2>&5
3339   ac_status=$?
3340   echo "$as_me:3340: \$? = $ac_status" >&5
3341   (exit $ac_status); } &&
3342          { ac_try='test -s conftest$ac_exeext'
3343   { (eval echo "$as_me:3343: \"$ac_try\"") >&5
3344   (eval $ac_try) 2>&5
3345   ac_status=$?
3346   echo "$as_me:3346: \$? = $ac_status" >&5
3347   (exit $ac_status); }; }; then
3348   ac_cv_lib_bsd_strlcat=yes
3349 else
3350   echo "$as_me: failed program was:" >&5
3351 cat conftest.$ac_ext >&5
3352 ac_cv_lib_bsd_strlcat=no
3353 fi
3354 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3355 LIBS=$ac_check_lib_save_LIBS
3356 fi
3357 echo "$as_me:3357: result: $ac_cv_lib_bsd_strlcat" >&5
3358 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3359 if test $ac_cv_lib_bsd_strlcat = yes; then
3360
3361 cf_add_libs="$LIBS"
3362 # reverse order
3363 cf_add_0lib=
3364 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3365 # filter duplicates
3366 for cf_add_1lib in $cf_add_0lib; do
3367         for cf_add_2lib in $cf_add_libs; do
3368                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3369                         cf_add_1lib=
3370                         break
3371                 fi
3372         done
3373         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3374 done
3375 LIBS="$cf_add_libs"
3376
3377 for ac_header in bsd/string.h
3378 do
3379 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3380 echo "$as_me:3380: checking for $ac_header" >&5
3381 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3382 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3383   echo $ECHO_N "(cached) $ECHO_C" >&6
3384 else
3385   cat >conftest.$ac_ext <<_ACEOF
3386 #line 3386 "configure"
3387 #include "confdefs.h"
3388 #include <$ac_header>
3389 _ACEOF
3390 if { (eval echo "$as_me:3390: \"$ac_cpp conftest.$ac_ext\"") >&5
3391   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3392   ac_status=$?
3393   egrep -v '^ *\+' conftest.er1 >conftest.err
3394   rm -f conftest.er1
3395   cat conftest.err >&5
3396   echo "$as_me:3396: \$? = $ac_status" >&5
3397   (exit $ac_status); } >/dev/null; then
3398   if test -s conftest.err; then
3399     ac_cpp_err=$ac_c_preproc_warn_flag
3400   else
3401     ac_cpp_err=
3402   fi
3403 else
3404   ac_cpp_err=yes
3405 fi
3406 if test -z "$ac_cpp_err"; then
3407   eval "$as_ac_Header=yes"
3408 else
3409   echo "$as_me: failed program was:" >&5
3410   cat conftest.$ac_ext >&5
3411   eval "$as_ac_Header=no"
3412 fi
3413 rm -f conftest.err conftest.$ac_ext
3414 fi
3415 echo "$as_me:3415: result: `eval echo '${'$as_ac_Header'}'`" >&5
3416 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3417 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3418   cat >>confdefs.h <<EOF
3419 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3420 EOF
3421
3422 fi
3423 done
3424
3425 cat >>confdefs.h <<\EOF
3426 #define HAVE_STRLCAT 1
3427 EOF
3428
3429 fi
3430
3431 fi
3432
3433 for ac_func in strlcpy snprintf
3434 do
3435 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3436 echo "$as_me:3436: checking for $ac_func" >&5
3437 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3438 if eval "test \"\${$as_ac_var+set}\" = set"; then
3439   echo $ECHO_N "(cached) $ECHO_C" >&6
3440 else
3441   cat >conftest.$ac_ext <<_ACEOF
3442 #line 3442 "configure"
3443 #include "confdefs.h"
3444 #define $ac_func autoconf_temporary
3445 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3446 #undef $ac_func
3447
3448 #ifdef __cplusplus
3449 extern "C"
3450 #endif
3451
3452 /* We use char because int might match the return type of a gcc2
3453    builtin and then its argument prototype would still apply.  */
3454 char $ac_func (void);
3455
3456 int
3457 main (void)
3458 {
3459
3460 /* The GNU C library defines stubs for functions which it implements
3461     to always fail with ENOSYS.  Some functions are actually named
3462     something starting with __ and the normal name is an alias.  */
3463 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3464 #error found stub for $ac_func
3465 #endif
3466
3467         return $ac_func ();
3468   ;
3469   return 0;
3470 }
3471 _ACEOF
3472 rm -f conftest.$ac_objext conftest$ac_exeext
3473 if { (eval echo "$as_me:3473: \"$ac_link\"") >&5
3474   (eval $ac_link) 2>&5
3475   ac_status=$?
3476   echo "$as_me:3476: \$? = $ac_status" >&5
3477   (exit $ac_status); } &&
3478          { ac_try='test -s conftest$ac_exeext'
3479   { (eval echo "$as_me:3479: \"$ac_try\"") >&5
3480   (eval $ac_try) 2>&5
3481   ac_status=$?
3482   echo "$as_me:3482: \$? = $ac_status" >&5
3483   (exit $ac_status); }; }; then
3484   eval "$as_ac_var=yes"
3485 else
3486   echo "$as_me: failed program was:" >&5
3487 cat conftest.$ac_ext >&5
3488 eval "$as_ac_var=no"
3489 fi
3490 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3491 fi
3492 echo "$as_me:3492: result: `eval echo '${'$as_ac_var'}'`" >&5
3493 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3494 if test `eval echo '${'$as_ac_var'}'` = yes; then
3495   cat >>confdefs.h <<EOF
3496 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3497 EOF
3498
3499 fi
3500 done
3501
3502 fi
3503
3504 echo "$as_me:3504: checking if the POSIX test-macros are already defined" >&5
3505 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3506 if test "${cf_cv_posix_visible+set}" = set; then
3507   echo $ECHO_N "(cached) $ECHO_C" >&6
3508 else
3509
3510 cat >conftest.$ac_ext <<_ACEOF
3511 #line 3511 "configure"
3512 #include "confdefs.h"
3513 #include <stdio.h>
3514 int
3515 main (void)
3516 {
3517
3518 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3519         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3520         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3521         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3522 #error conflicting symbols found
3523 #endif
3524
3525   ;
3526   return 0;
3527 }
3528 _ACEOF
3529 rm -f conftest.$ac_objext
3530 if { (eval echo "$as_me:3530: \"$ac_compile\"") >&5
3531   (eval $ac_compile) 2>&5
3532   ac_status=$?
3533   echo "$as_me:3533: \$? = $ac_status" >&5
3534   (exit $ac_status); } &&
3535          { ac_try='test -s conftest.$ac_objext'
3536   { (eval echo "$as_me:3536: \"$ac_try\"") >&5
3537   (eval $ac_try) 2>&5
3538   ac_status=$?
3539   echo "$as_me:3539: \$? = $ac_status" >&5
3540   (exit $ac_status); }; }; then
3541   cf_cv_posix_visible=no
3542 else
3543   echo "$as_me: failed program was:" >&5
3544 cat conftest.$ac_ext >&5
3545 cf_cv_posix_visible=yes
3546 fi
3547 rm -f conftest.$ac_objext conftest.$ac_ext
3548
3549 fi
3550 echo "$as_me:3550: result: $cf_cv_posix_visible" >&5
3551 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3552
3553 if test "$cf_cv_posix_visible" = no; then
3554
3555 cf_XOPEN_SOURCE=600
3556 cf_POSIX_C_SOURCE=199506L
3557 cf_xopen_source=
3558
3559 case $host_os in
3560 (aix[4-7]*)
3561         cf_xopen_source="-D_ALL_SOURCE"
3562         ;;
3563 (msys)
3564         cf_XOPEN_SOURCE=600
3565         ;;
3566 (darwin[0-8].*)
3567         cf_xopen_source="-D_APPLE_C_SOURCE"
3568         ;;
3569 (darwin*)
3570         cf_xopen_source="-D_DARWIN_C_SOURCE"
3571         cf_XOPEN_SOURCE=
3572         ;;
3573 (freebsd*|dragonfly*|midnightbsd*)
3574         # 5.x headers associate
3575         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3576         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3577         cf_POSIX_C_SOURCE=200112L
3578         cf_XOPEN_SOURCE=600
3579         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3580         ;;
3581 (hpux11*)
3582         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3583         ;;
3584 (hpux*)
3585         cf_xopen_source="-D_HPUX_SOURCE"
3586         ;;
3587 (irix[56].*)
3588         cf_xopen_source="-D_SGI_SOURCE"
3589         cf_XOPEN_SOURCE=
3590         ;;
3591 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3592
3593 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3594
3595 echo "$as_me:3595: checking if this is the GNU C library" >&5
3596 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3597 if test "${cf_cv_gnu_library+set}" = set; then
3598   echo $ECHO_N "(cached) $ECHO_C" >&6
3599 else
3600
3601 cat >conftest.$ac_ext <<_ACEOF
3602 #line 3602 "configure"
3603 #include "confdefs.h"
3604 #include <sys/types.h>
3605 int
3606 main (void)
3607 {
3608
3609         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3610                 return 0;
3611         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3612                 return 0;
3613         #else
3614         #       error not GNU C library
3615         #endif
3616   ;
3617   return 0;
3618 }
3619 _ACEOF
3620 rm -f conftest.$ac_objext
3621 if { (eval echo "$as_me:3621: \"$ac_compile\"") >&5
3622   (eval $ac_compile) 2>&5
3623   ac_status=$?
3624   echo "$as_me:3624: \$? = $ac_status" >&5
3625   (exit $ac_status); } &&
3626          { ac_try='test -s conftest.$ac_objext'
3627   { (eval echo "$as_me:3627: \"$ac_try\"") >&5
3628   (eval $ac_try) 2>&5
3629   ac_status=$?
3630   echo "$as_me:3630: \$? = $ac_status" >&5
3631   (exit $ac_status); }; }; then
3632   cf_cv_gnu_library=yes
3633 else
3634   echo "$as_me: failed program was:" >&5
3635 cat conftest.$ac_ext >&5
3636 cf_cv_gnu_library=no
3637 fi
3638 rm -f conftest.$ac_objext conftest.$ac_ext
3639
3640 fi
3641 echo "$as_me:3641: result: $cf_cv_gnu_library" >&5
3642 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3643
3644 if test x$cf_cv_gnu_library = xyes; then
3645
3646         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3647         # was changed to help a little.  newlib incorporated the change about 4
3648         # years later.
3649         echo "$as_me:3649: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3650 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3651 if test "${cf_cv_gnu_library_219+set}" = set; then
3652   echo $ECHO_N "(cached) $ECHO_C" >&6
3653 else
3654
3655                 cf_save="$CPPFLAGS"
3656
3657         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3658         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3659
3660                 cat >conftest.$ac_ext <<_ACEOF
3661 #line 3661 "configure"
3662 #include "confdefs.h"
3663 #include <sys/types.h>
3664 int
3665 main (void)
3666 {
3667
3668                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3669                                 return 0;
3670                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3671                                 return 0;
3672                         #else
3673                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3674                         #endif
3675   ;
3676   return 0;
3677 }
3678 _ACEOF
3679 rm -f conftest.$ac_objext
3680 if { (eval echo "$as_me:3680: \"$ac_compile\"") >&5
3681   (eval $ac_compile) 2>&5
3682   ac_status=$?
3683   echo "$as_me:3683: \$? = $ac_status" >&5
3684   (exit $ac_status); } &&
3685          { ac_try='test -s conftest.$ac_objext'
3686   { (eval echo "$as_me:3686: \"$ac_try\"") >&5
3687   (eval $ac_try) 2>&5
3688   ac_status=$?
3689   echo "$as_me:3689: \$? = $ac_status" >&5
3690   (exit $ac_status); }; }; then
3691   cf_cv_gnu_library_219=yes
3692 else
3693   echo "$as_me: failed program was:" >&5
3694 cat conftest.$ac_ext >&5
3695 cf_cv_gnu_library_219=no
3696 fi
3697 rm -f conftest.$ac_objext conftest.$ac_ext
3698                 CPPFLAGS="$cf_save"
3699
3700 fi
3701 echo "$as_me:3701: result: $cf_cv_gnu_library_219" >&5
3702 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3703
3704         if test "x$cf_cv_gnu_library_219" = xyes; then
3705                 cf_save="$CPPFLAGS"
3706                 echo "$as_me:3706: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3707 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3708 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3709   echo $ECHO_N "(cached) $ECHO_C" >&6
3710 else
3711
3712 cf_fix_cppflags=no
3713 cf_new_cflags=
3714 cf_new_cppflags=
3715 cf_new_extra_cppflags=
3716
3717 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3718 do
3719 case $cf_fix_cppflags in
3720 (no)
3721         case $cf_add_cflags in
3722         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3723                 case $cf_add_cflags in
3724                 (-D*)
3725                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3726
3727                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3728                                 && test -z "${cf_tst_cflags}" \
3729                                 && cf_fix_cppflags=yes
3730
3731                         if test $cf_fix_cppflags = yes ; then
3732
3733         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3734         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3735
3736                                 continue
3737                         elif test "${cf_tst_cflags}" = "\"'" ; then
3738
3739         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3740         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3741
3742                                 continue
3743                         fi
3744                         ;;
3745                 esac
3746                 case "$CPPFLAGS" in
3747                 (*$cf_add_cflags)
3748                         ;;
3749                 (*)
3750                         case $cf_add_cflags in
3751                         (-D*)
3752                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3753
3754 CPPFLAGS=`echo "$CPPFLAGS" | \
3755         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3756                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3757
3758                                 ;;
3759                         esac
3760
3761         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3762         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3763
3764                         ;;
3765                 esac
3766                 ;;
3767         (*)
3768
3769         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3770         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3771
3772                 ;;
3773         esac
3774         ;;
3775 (yes)
3776
3777         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3778         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3779
3780         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3781
3782         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3783                 && test -z "${cf_tst_cflags}" \
3784                 && cf_fix_cppflags=no
3785         ;;
3786 esac
3787 done
3788
3789 if test -n "$cf_new_cflags" ; then
3790
3791         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3792         CFLAGS="${CFLAGS}$cf_new_cflags"
3793
3794 fi
3795
3796 if test -n "$cf_new_cppflags" ; then
3797
3798         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3799         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3800
3801 fi
3802
3803 if test -n "$cf_new_extra_cppflags" ; then
3804
3805         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3806         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3807
3808 fi
3809
3810                         cat >conftest.$ac_ext <<_ACEOF
3811 #line 3811 "configure"
3812 #include "confdefs.h"
3813
3814                                 #include <limits.h>
3815                                 #include <sys/types.h>
3816
3817 int
3818 main (void)
3819 {
3820
3821                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3822                                         return 0;
3823                                 #else
3824                                 #       error GNU C library is too old
3825                                 #endif
3826   ;
3827   return 0;
3828 }
3829 _ACEOF
3830 rm -f conftest.$ac_objext
3831 if { (eval echo "$as_me:3831: \"$ac_compile\"") >&5
3832   (eval $ac_compile) 2>&5
3833   ac_status=$?
3834   echo "$as_me:3834: \$? = $ac_status" >&5
3835   (exit $ac_status); } &&
3836          { ac_try='test -s conftest.$ac_objext'
3837   { (eval echo "$as_me:3837: \"$ac_try\"") >&5
3838   (eval $ac_try) 2>&5
3839   ac_status=$?
3840   echo "$as_me:3840: \$? = $ac_status" >&5
3841   (exit $ac_status); }; }; then
3842   cf_cv_gnu_dftsrc_219=yes
3843 else
3844   echo "$as_me: failed program was:" >&5
3845 cat conftest.$ac_ext >&5
3846 cf_cv_gnu_dftsrc_219=no
3847 fi
3848 rm -f conftest.$ac_objext conftest.$ac_ext
3849
3850 fi
3851 echo "$as_me:3851: result: $cf_cv_gnu_dftsrc_219" >&5
3852 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3853                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3854         else
3855                 cf_cv_gnu_dftsrc_219=maybe
3856         fi
3857
3858         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3859
3860                 echo "$as_me:3860: checking if we must define _GNU_SOURCE" >&5
3861 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3862 if test "${cf_cv_gnu_source+set}" = set; then
3863   echo $ECHO_N "(cached) $ECHO_C" >&6
3864 else
3865
3866                 cat >conftest.$ac_ext <<_ACEOF
3867 #line 3867 "configure"
3868 #include "confdefs.h"
3869 #include <sys/types.h>
3870 int
3871 main (void)
3872 {
3873
3874                         #ifndef _XOPEN_SOURCE
3875                         #error  expected _XOPEN_SOURCE to be defined
3876                         #endif
3877   ;
3878   return 0;
3879 }
3880 _ACEOF
3881 rm -f conftest.$ac_objext
3882 if { (eval echo "$as_me:3882: \"$ac_compile\"") >&5
3883   (eval $ac_compile) 2>&5
3884   ac_status=$?
3885   echo "$as_me:3885: \$? = $ac_status" >&5
3886   (exit $ac_status); } &&
3887          { ac_try='test -s conftest.$ac_objext'
3888   { (eval echo "$as_me:3888: \"$ac_try\"") >&5
3889   (eval $ac_try) 2>&5
3890   ac_status=$?
3891   echo "$as_me:3891: \$? = $ac_status" >&5
3892   (exit $ac_status); }; }; then
3893   cf_cv_gnu_source=no
3894 else
3895   echo "$as_me: failed program was:" >&5
3896 cat conftest.$ac_ext >&5
3897 cf_save="$CPPFLAGS"
3898
3899 cf_fix_cppflags=no
3900 cf_new_cflags=
3901 cf_new_cppflags=
3902 cf_new_extra_cppflags=
3903
3904 for cf_add_cflags in -D_GNU_SOURCE
3905 do
3906 case $cf_fix_cppflags in
3907 (no)
3908         case $cf_add_cflags in
3909         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3910                 case $cf_add_cflags in
3911                 (-D*)
3912                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3913
3914                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3915                                 && test -z "${cf_tst_cflags}" \
3916                                 && cf_fix_cppflags=yes
3917
3918                         if test $cf_fix_cppflags = yes ; then
3919
3920         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3921         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3922
3923                                 continue
3924                         elif test "${cf_tst_cflags}" = "\"'" ; then
3925
3926         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3927         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3928
3929                                 continue
3930                         fi
3931                         ;;
3932                 esac
3933                 case "$CPPFLAGS" in
3934                 (*$cf_add_cflags)
3935                         ;;
3936                 (*)
3937                         case $cf_add_cflags in
3938                         (-D*)
3939                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3940
3941 CPPFLAGS=`echo "$CPPFLAGS" | \
3942         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3943                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3944
3945                                 ;;
3946                         esac
3947
3948         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3949         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3950
3951                         ;;
3952                 esac
3953                 ;;
3954         (*)
3955
3956         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3957         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3958
3959                 ;;
3960         esac
3961         ;;
3962 (yes)
3963
3964         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3965         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3966
3967         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3968
3969         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3970                 && test -z "${cf_tst_cflags}" \
3971                 && cf_fix_cppflags=no
3972         ;;
3973 esac
3974 done
3975
3976 if test -n "$cf_new_cflags" ; then
3977
3978         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3979         CFLAGS="${CFLAGS}$cf_new_cflags"
3980
3981 fi
3982
3983 if test -n "$cf_new_cppflags" ; then
3984
3985         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3986         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3987
3988 fi
3989
3990 if test -n "$cf_new_extra_cppflags" ; then
3991
3992         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3993         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3994
3995 fi
3996
3997                          cat >conftest.$ac_ext <<_ACEOF
3998 #line 3998 "configure"
3999 #include "confdefs.h"
4000 #include <sys/types.h>
4001 int
4002 main (void)
4003 {
4004
4005                                 #ifdef _XOPEN_SOURCE
4006                                 #error  expected _XOPEN_SOURCE to be undefined
4007                                 #endif
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f conftest.$ac_objext
4013 if { (eval echo "$as_me:4013: \"$ac_compile\"") >&5
4014   (eval $ac_compile) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); } &&
4018          { ac_try='test -s conftest.$ac_objext'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit $ac_status); }; }; then
4024   cf_cv_gnu_source=no
4025 else
4026   echo "$as_me: failed program was:" >&5
4027 cat conftest.$ac_ext >&5
4028 cf_cv_gnu_source=yes
4029 fi
4030 rm -f conftest.$ac_objext conftest.$ac_ext
4031                         CPPFLAGS="$cf_save"
4032
4033 fi
4034 rm -f conftest.$ac_objext conftest.$ac_ext
4035
4036 fi
4037 echo "$as_me:4037: result: $cf_cv_gnu_source" >&5
4038 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4039
4040                 if test "$cf_cv_gnu_source" = yes
4041                 then
4042                 echo "$as_me:4042: checking if we should also define _DEFAULT_SOURCE" >&5
4043 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4044 if test "${cf_cv_default_source+set}" = set; then
4045   echo $ECHO_N "(cached) $ECHO_C" >&6
4046 else
4047
4048         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4049         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4050
4051                         cat >conftest.$ac_ext <<_ACEOF
4052 #line 4052 "configure"
4053 #include "confdefs.h"
4054 #include <sys/types.h>
4055 int
4056 main (void)
4057 {
4058
4059                                 #ifdef _DEFAULT_SOURCE
4060                                 #error  expected _DEFAULT_SOURCE to be undefined
4061                                 #endif
4062   ;
4063   return 0;
4064 }
4065 _ACEOF
4066 rm -f conftest.$ac_objext
4067 if { (eval echo "$as_me:4067: \"$ac_compile\"") >&5
4068   (eval $ac_compile) 2>&5
4069   ac_status=$?
4070   echo "$as_me:4070: \$? = $ac_status" >&5
4071   (exit $ac_status); } &&
4072          { ac_try='test -s conftest.$ac_objext'
4073   { (eval echo "$as_me:4073: \"$ac_try\"") >&5
4074   (eval $ac_try) 2>&5
4075   ac_status=$?
4076   echo "$as_me:4076: \$? = $ac_status" >&5
4077   (exit $ac_status); }; }; then
4078   cf_cv_default_source=no
4079 else
4080   echo "$as_me: failed program was:" >&5
4081 cat conftest.$ac_ext >&5
4082 cf_cv_default_source=yes
4083 fi
4084 rm -f conftest.$ac_objext conftest.$ac_ext
4085
4086 fi
4087 echo "$as_me:4087: result: $cf_cv_default_source" >&5
4088 echo "${ECHO_T}$cf_cv_default_source" >&6
4089                         if test "$cf_cv_default_source" = yes
4090                         then
4091
4092         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4093         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4094
4095                         fi
4096                 fi
4097         fi
4098
4099 fi
4100
4101         ;;
4102 (minix*)
4103         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4104         ;;
4105 (mirbsd*)
4106         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4107         cf_XOPEN_SOURCE=
4108
4109 if test "$cf_cv_posix_visible" = no; then
4110
4111 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4112
4113 cf_save_CFLAGS="$CFLAGS"
4114 cf_save_CPPFLAGS="$CPPFLAGS"
4115
4116 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4117         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4118                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4119
4120 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4121         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4122                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4123
4124 echo "$as_me:4124: checking if we should define _POSIX_C_SOURCE" >&5
4125 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4126 if test "${cf_cv_posix_c_source+set}" = set; then
4127   echo $ECHO_N "(cached) $ECHO_C" >&6
4128 else
4129
4130 echo "${as_me:-configure}:4130: testing if the symbol is already defined go no further ..." 1>&5
4131
4132         cat >conftest.$ac_ext <<_ACEOF
4133 #line 4133 "configure"
4134 #include "confdefs.h"
4135 #include <sys/types.h>
4136 int
4137 main (void)
4138 {
4139
4140 #ifndef _POSIX_C_SOURCE
4141 make an error
4142 #endif
4143   ;
4144   return 0;
4145 }
4146 _ACEOF
4147 rm -f conftest.$ac_objext
4148 if { (eval echo "$as_me:4148: \"$ac_compile\"") >&5
4149   (eval $ac_compile) 2>&5
4150   ac_status=$?
4151   echo "$as_me:4151: \$? = $ac_status" >&5
4152   (exit $ac_status); } &&
4153          { ac_try='test -s conftest.$ac_objext'
4154   { (eval echo "$as_me:4154: \"$ac_try\"") >&5
4155   (eval $ac_try) 2>&5
4156   ac_status=$?
4157   echo "$as_me:4157: \$? = $ac_status" >&5
4158   (exit $ac_status); }; }; then
4159   cf_cv_posix_c_source=no
4160 else
4161   echo "$as_me: failed program was:" >&5
4162 cat conftest.$ac_ext >&5
4163 cf_want_posix_source=no
4164          case .$cf_POSIX_C_SOURCE in
4165          (.[12]??*)
4166                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4167                 ;;
4168          (.2)
4169                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4170                 cf_want_posix_source=yes
4171                 ;;
4172          (.*)
4173                 cf_want_posix_source=yes
4174                 ;;
4175          esac
4176          if test "$cf_want_posix_source" = yes ; then
4177                 cat >conftest.$ac_ext <<_ACEOF
4178 #line 4178 "configure"
4179 #include "confdefs.h"
4180 #include <sys/types.h>
4181 int
4182 main (void)
4183 {
4184
4185 #ifdef _POSIX_SOURCE
4186 make an error
4187 #endif
4188   ;
4189   return 0;
4190 }
4191 _ACEOF
4192 rm -f conftest.$ac_objext
4193 if { (eval echo "$as_me:4193: \"$ac_compile\"") >&5
4194   (eval $ac_compile) 2>&5
4195   ac_status=$?
4196   echo "$as_me:4196: \$? = $ac_status" >&5
4197   (exit $ac_status); } &&
4198          { ac_try='test -s conftest.$ac_objext'
4199   { (eval echo "$as_me:4199: \"$ac_try\"") >&5
4200   (eval $ac_try) 2>&5
4201   ac_status=$?
4202   echo "$as_me:4202: \$? = $ac_status" >&5
4203   (exit $ac_status); }; }; then
4204   :
4205 else
4206   echo "$as_me: failed program was:" >&5
4207 cat conftest.$ac_ext >&5
4208 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4209 fi
4210 rm -f conftest.$ac_objext conftest.$ac_ext
4211          fi
4212
4213 echo "${as_me:-configure}:4213: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4214
4215          CFLAGS="$cf_trim_CFLAGS"
4216          CPPFLAGS="$cf_trim_CPPFLAGS"
4217
4218         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4219         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4220
4221 echo "${as_me:-configure}:4221: testing if the second compile does not leave our definition intact error ..." 1>&5
4222
4223          cat >conftest.$ac_ext <<_ACEOF
4224 #line 4224 "configure"
4225 #include "confdefs.h"
4226 #include <sys/types.h>
4227 int
4228 main (void)
4229 {
4230
4231 #ifndef _POSIX_C_SOURCE
4232 make an error
4233 #endif
4234   ;
4235   return 0;
4236 }
4237 _ACEOF
4238 rm -f conftest.$ac_objext
4239 if { (eval echo "$as_me:4239: \"$ac_compile\"") >&5
4240   (eval $ac_compile) 2>&5
4241   ac_status=$?
4242   echo "$as_me:4242: \$? = $ac_status" >&5
4243   (exit $ac_status); } &&
4244          { ac_try='test -s conftest.$ac_objext'
4245   { (eval echo "$as_me:4245: \"$ac_try\"") >&5
4246   (eval $ac_try) 2>&5
4247   ac_status=$?
4248   echo "$as_me:4248: \$? = $ac_status" >&5
4249   (exit $ac_status); }; }; then
4250   :
4251 else
4252   echo "$as_me: failed program was:" >&5
4253 cat conftest.$ac_ext >&5
4254 cf_cv_posix_c_source=no
4255 fi
4256 rm -f conftest.$ac_objext conftest.$ac_ext
4257          CFLAGS="$cf_save_CFLAGS"
4258          CPPFLAGS="$cf_save_CPPFLAGS"
4259
4260 fi
4261 rm -f conftest.$ac_objext conftest.$ac_ext
4262
4263 fi
4264 echo "$as_me:4264: result: $cf_cv_posix_c_source" >&5
4265 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4266
4267 if test "$cf_cv_posix_c_source" != no ; then
4268         CFLAGS="$cf_trim_CFLAGS"
4269         CPPFLAGS="$cf_trim_CPPFLAGS"
4270
4271 cf_fix_cppflags=no
4272 cf_new_cflags=
4273 cf_new_cppflags=
4274 cf_new_extra_cppflags=
4275
4276 for cf_add_cflags in $cf_cv_posix_c_source
4277 do
4278 case $cf_fix_cppflags in
4279 (no)
4280         case $cf_add_cflags in
4281         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4282                 case $cf_add_cflags in
4283                 (-D*)
4284                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4285
4286                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4287                                 && test -z "${cf_tst_cflags}" \
4288                                 && cf_fix_cppflags=yes
4289
4290                         if test $cf_fix_cppflags = yes ; then
4291
4292         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4293         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4294
4295                                 continue
4296                         elif test "${cf_tst_cflags}" = "\"'" ; then
4297
4298         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4299         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4300
4301                                 continue
4302                         fi
4303                         ;;
4304                 esac
4305                 case "$CPPFLAGS" in
4306                 (*$cf_add_cflags)
4307                         ;;
4308                 (*)
4309                         case $cf_add_cflags in
4310                         (-D*)
4311                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4312
4313 CPPFLAGS=`echo "$CPPFLAGS" | \
4314         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4315                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4316
4317                                 ;;
4318                         esac
4319
4320         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4321         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4322
4323                         ;;
4324                 esac
4325                 ;;
4326         (*)
4327
4328         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4329         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4330
4331                 ;;
4332         esac
4333         ;;
4334 (yes)
4335
4336         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4337         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4338
4339         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4340
4341         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4342                 && test -z "${cf_tst_cflags}" \
4343                 && cf_fix_cppflags=no
4344         ;;
4345 esac
4346 done
4347
4348 if test -n "$cf_new_cflags" ; then
4349
4350         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4351         CFLAGS="${CFLAGS}$cf_new_cflags"
4352
4353 fi
4354
4355 if test -n "$cf_new_cppflags" ; then
4356
4357         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4358         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4359
4360 fi
4361
4362 if test -n "$cf_new_extra_cppflags" ; then
4363
4364         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4365         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4366
4367 fi
4368
4369 fi
4370
4371 fi # cf_cv_posix_visible
4372
4373         ;;
4374 (netbsd*)
4375         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4376         ;;
4377 (openbsd[4-9]*)
4378         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4379         cf_xopen_source="-D_BSD_SOURCE"
4380         cf_XOPEN_SOURCE=600
4381         ;;
4382 (openbsd*)
4383         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4384         ;;
4385 (osf[45]*)
4386         cf_xopen_source="-D_OSF_SOURCE"
4387         ;;
4388 (nto-qnx*)
4389         cf_xopen_source="-D_QNX_SOURCE"
4390         ;;
4391 (sco*)
4392         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4393         ;;
4394 (solaris2.*)
4395         cf_xopen_source="-D__EXTENSIONS__"
4396         cf_cv_xopen_source=broken
4397         ;;
4398 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4399         cf_XOPEN_SOURCE=
4400         cf_POSIX_C_SOURCE=
4401         ;;
4402 (*)
4403
4404 echo "$as_me:4404: checking if we should define _XOPEN_SOURCE" >&5
4405 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4406 if test "${cf_cv_xopen_source+set}" = set; then
4407   echo $ECHO_N "(cached) $ECHO_C" >&6
4408 else
4409
4410         cat >conftest.$ac_ext <<_ACEOF
4411 #line 4411 "configure"
4412 #include "confdefs.h"
4413
4414 #include <stdlib.h>
4415 #include <string.h>
4416 #include <sys/types.h>
4417
4418 int
4419 main (void)
4420 {
4421
4422 #ifndef _XOPEN_SOURCE
4423 make an error
4424 #endif
4425   ;
4426   return 0;
4427 }
4428 _ACEOF
4429 rm -f conftest.$ac_objext
4430 if { (eval echo "$as_me:4430: \"$ac_compile\"") >&5
4431   (eval $ac_compile) 2>&5
4432   ac_status=$?
4433   echo "$as_me:4433: \$? = $ac_status" >&5
4434   (exit $ac_status); } &&
4435          { ac_try='test -s conftest.$ac_objext'
4436   { (eval echo "$as_me:4436: \"$ac_try\"") >&5
4437   (eval $ac_try) 2>&5
4438   ac_status=$?
4439   echo "$as_me:4439: \$? = $ac_status" >&5
4440   (exit $ac_status); }; }; then
4441   cf_cv_xopen_source=no
4442 else
4443   echo "$as_me: failed program was:" >&5
4444 cat conftest.$ac_ext >&5
4445 cf_save="$CPPFLAGS"
4446
4447         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4448         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4449
4450          cat >conftest.$ac_ext <<_ACEOF
4451 #line 4451 "configure"
4452 #include "confdefs.h"
4453
4454 #include <stdlib.h>
4455 #include <string.h>
4456 #include <sys/types.h>
4457
4458 int
4459 main (void)
4460 {
4461
4462 #ifdef _XOPEN_SOURCE
4463 make an error
4464 #endif
4465   ;
4466   return 0;
4467 }
4468 _ACEOF
4469 rm -f conftest.$ac_objext
4470 if { (eval echo "$as_me:4470: \"$ac_compile\"") >&5
4471   (eval $ac_compile) 2>&5
4472   ac_status=$?
4473   echo "$as_me:4473: \$? = $ac_status" >&5
4474   (exit $ac_status); } &&
4475          { ac_try='test -s conftest.$ac_objext'
4476   { (eval echo "$as_me:4476: \"$ac_try\"") >&5
4477   (eval $ac_try) 2>&5
4478   ac_status=$?
4479   echo "$as_me:4479: \$? = $ac_status" >&5
4480   (exit $ac_status); }; }; then
4481   cf_cv_xopen_source=no
4482 else
4483   echo "$as_me: failed program was:" >&5
4484 cat conftest.$ac_ext >&5
4485 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4486 fi
4487 rm -f conftest.$ac_objext conftest.$ac_ext
4488         CPPFLAGS="$cf_save"
4489
4490 fi
4491 rm -f conftest.$ac_objext conftest.$ac_ext
4492
4493 fi
4494 echo "$as_me:4494: result: $cf_cv_xopen_source" >&5
4495 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4496
4497 if test "$cf_cv_xopen_source" != no ; then
4498
4499 CFLAGS=`echo "$CFLAGS" | \
4500         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4501                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4502
4503 CPPFLAGS=`echo "$CPPFLAGS" | \
4504         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4505                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4506
4507         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4508
4509 cf_fix_cppflags=no
4510 cf_new_cflags=
4511 cf_new_cppflags=
4512 cf_new_extra_cppflags=
4513
4514 for cf_add_cflags in $cf_temp_xopen_source
4515 do
4516 case $cf_fix_cppflags in
4517 (no)
4518         case $cf_add_cflags in
4519         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4520                 case $cf_add_cflags in
4521                 (-D*)
4522                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4523
4524                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4525                                 && test -z "${cf_tst_cflags}" \
4526                                 && cf_fix_cppflags=yes
4527
4528                         if test $cf_fix_cppflags = yes ; then
4529
4530         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4531         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4532
4533                                 continue
4534                         elif test "${cf_tst_cflags}" = "\"'" ; then
4535
4536         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4537         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4538
4539                                 continue
4540                         fi
4541                         ;;
4542                 esac
4543                 case "$CPPFLAGS" in
4544                 (*$cf_add_cflags)
4545                         ;;
4546                 (*)
4547                         case $cf_add_cflags in
4548                         (-D*)
4549                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4550
4551 CPPFLAGS=`echo "$CPPFLAGS" | \
4552         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4553                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4554
4555                                 ;;
4556                         esac
4557
4558         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4559         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4560
4561                         ;;
4562                 esac
4563                 ;;
4564         (*)
4565
4566         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4567         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4568
4569                 ;;
4570         esac
4571         ;;
4572 (yes)
4573
4574         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4575         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4576
4577         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4578
4579         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4580                 && test -z "${cf_tst_cflags}" \
4581                 && cf_fix_cppflags=no
4582         ;;
4583 esac
4584 done
4585
4586 if test -n "$cf_new_cflags" ; then
4587
4588         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4589         CFLAGS="${CFLAGS}$cf_new_cflags"
4590
4591 fi
4592
4593 if test -n "$cf_new_cppflags" ; then
4594
4595         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4596         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4597
4598 fi
4599
4600 if test -n "$cf_new_extra_cppflags" ; then
4601
4602         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4603         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4604
4605 fi
4606
4607 fi
4608
4609 if test "$cf_cv_posix_visible" = no; then
4610
4611 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4612
4613 cf_save_CFLAGS="$CFLAGS"
4614 cf_save_CPPFLAGS="$CPPFLAGS"
4615
4616 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4617         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4618                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4619
4620 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4621         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4622                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4623
4624 echo "$as_me:4624: checking if we should define _POSIX_C_SOURCE" >&5
4625 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4626 if test "${cf_cv_posix_c_source+set}" = set; then
4627   echo $ECHO_N "(cached) $ECHO_C" >&6
4628 else
4629
4630 echo "${as_me:-configure}:4630: testing if the symbol is already defined go no further ..." 1>&5
4631
4632         cat >conftest.$ac_ext <<_ACEOF
4633 #line 4633 "configure"
4634 #include "confdefs.h"
4635 #include <sys/types.h>
4636 int
4637 main (void)
4638 {
4639
4640 #ifndef _POSIX_C_SOURCE
4641 make an error
4642 #endif
4643   ;
4644   return 0;
4645 }
4646 _ACEOF
4647 rm -f conftest.$ac_objext
4648 if { (eval echo "$as_me:4648: \"$ac_compile\"") >&5
4649   (eval $ac_compile) 2>&5
4650   ac_status=$?
4651   echo "$as_me:4651: \$? = $ac_status" >&5
4652   (exit $ac_status); } &&
4653          { ac_try='test -s conftest.$ac_objext'
4654   { (eval echo "$as_me:4654: \"$ac_try\"") >&5
4655   (eval $ac_try) 2>&5
4656   ac_status=$?
4657   echo "$as_me:4657: \$? = $ac_status" >&5
4658   (exit $ac_status); }; }; then
4659   cf_cv_posix_c_source=no
4660 else
4661   echo "$as_me: failed program was:" >&5
4662 cat conftest.$ac_ext >&5
4663 cf_want_posix_source=no
4664          case .$cf_POSIX_C_SOURCE in
4665          (.[12]??*)
4666                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4667                 ;;
4668          (.2)
4669                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4670                 cf_want_posix_source=yes
4671                 ;;
4672          (.*)
4673                 cf_want_posix_source=yes
4674                 ;;
4675          esac
4676          if test "$cf_want_posix_source" = yes ; then
4677                 cat >conftest.$ac_ext <<_ACEOF
4678 #line 4678 "configure"
4679 #include "confdefs.h"
4680 #include <sys/types.h>
4681 int
4682 main (void)
4683 {
4684
4685 #ifdef _POSIX_SOURCE
4686 make an error
4687 #endif
4688   ;
4689   return 0;
4690 }
4691 _ACEOF
4692 rm -f conftest.$ac_objext
4693 if { (eval echo "$as_me:4693: \"$ac_compile\"") >&5
4694   (eval $ac_compile) 2>&5
4695   ac_status=$?
4696   echo "$as_me:4696: \$? = $ac_status" >&5
4697   (exit $ac_status); } &&
4698          { ac_try='test -s conftest.$ac_objext'
4699   { (eval echo "$as_me:4699: \"$ac_try\"") >&5
4700   (eval $ac_try) 2>&5
4701   ac_status=$?
4702   echo "$as_me:4702: \$? = $ac_status" >&5
4703   (exit $ac_status); }; }; then
4704   :
4705 else
4706   echo "$as_me: failed program was:" >&5
4707 cat conftest.$ac_ext >&5
4708 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4709 fi
4710 rm -f conftest.$ac_objext conftest.$ac_ext
4711          fi
4712
4713 echo "${as_me:-configure}:4713: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4714
4715          CFLAGS="$cf_trim_CFLAGS"
4716          CPPFLAGS="$cf_trim_CPPFLAGS"
4717
4718         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4719         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4720
4721 echo "${as_me:-configure}:4721: testing if the second compile does not leave our definition intact error ..." 1>&5
4722
4723          cat >conftest.$ac_ext <<_ACEOF
4724 #line 4724 "configure"
4725 #include "confdefs.h"
4726 #include <sys/types.h>
4727 int
4728 main (void)
4729 {
4730
4731 #ifndef _POSIX_C_SOURCE
4732 make an error
4733 #endif
4734   ;
4735   return 0;
4736 }
4737 _ACEOF
4738 rm -f conftest.$ac_objext
4739 if { (eval echo "$as_me:4739: \"$ac_compile\"") >&5
4740   (eval $ac_compile) 2>&5
4741   ac_status=$?
4742   echo "$as_me:4742: \$? = $ac_status" >&5
4743   (exit $ac_status); } &&
4744          { ac_try='test -s conftest.$ac_objext'
4745   { (eval echo "$as_me:4745: \"$ac_try\"") >&5
4746   (eval $ac_try) 2>&5
4747   ac_status=$?
4748   echo "$as_me:4748: \$? = $ac_status" >&5
4749   (exit $ac_status); }; }; then
4750   :
4751 else
4752   echo "$as_me: failed program was:" >&5
4753 cat conftest.$ac_ext >&5
4754 cf_cv_posix_c_source=no
4755 fi
4756 rm -f conftest.$ac_objext conftest.$ac_ext
4757          CFLAGS="$cf_save_CFLAGS"
4758          CPPFLAGS="$cf_save_CPPFLAGS"
4759
4760 fi
4761 rm -f conftest.$ac_objext conftest.$ac_ext
4762
4763 fi
4764 echo "$as_me:4764: result: $cf_cv_posix_c_source" >&5
4765 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4766
4767 if test "$cf_cv_posix_c_source" != no ; then
4768         CFLAGS="$cf_trim_CFLAGS"
4769         CPPFLAGS="$cf_trim_CPPFLAGS"
4770
4771 cf_fix_cppflags=no
4772 cf_new_cflags=
4773 cf_new_cppflags=
4774 cf_new_extra_cppflags=
4775
4776 for cf_add_cflags in $cf_cv_posix_c_source
4777 do
4778 case $cf_fix_cppflags in
4779 (no)
4780         case $cf_add_cflags in
4781         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4782                 case $cf_add_cflags in
4783                 (-D*)
4784                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4785
4786                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4787                                 && test -z "${cf_tst_cflags}" \
4788                                 && cf_fix_cppflags=yes
4789
4790                         if test $cf_fix_cppflags = yes ; then
4791
4792         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4793         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4794
4795                                 continue
4796                         elif test "${cf_tst_cflags}" = "\"'" ; then
4797
4798         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4799         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4800
4801                                 continue
4802                         fi
4803                         ;;
4804                 esac
4805                 case "$CPPFLAGS" in
4806                 (*$cf_add_cflags)
4807                         ;;
4808                 (*)
4809                         case $cf_add_cflags in
4810                         (-D*)
4811                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4812
4813 CPPFLAGS=`echo "$CPPFLAGS" | \
4814         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4815                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4816
4817                                 ;;
4818                         esac
4819
4820         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4821         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4822
4823                         ;;
4824                 esac
4825                 ;;
4826         (*)
4827
4828         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4829         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4830
4831                 ;;
4832         esac
4833         ;;
4834 (yes)
4835
4836         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4837         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4838
4839         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4840
4841         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4842                 && test -z "${cf_tst_cflags}" \
4843                 && cf_fix_cppflags=no
4844         ;;
4845 esac
4846 done
4847
4848 if test -n "$cf_new_cflags" ; then
4849
4850         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4851         CFLAGS="${CFLAGS}$cf_new_cflags"
4852
4853 fi
4854
4855 if test -n "$cf_new_cppflags" ; then
4856
4857         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4858         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4859
4860 fi
4861
4862 if test -n "$cf_new_extra_cppflags" ; then
4863
4864         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4865         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4866
4867 fi
4868
4869 fi
4870
4871 fi # cf_cv_posix_visible
4872
4873         ;;
4874 esac
4875
4876 if test -n "$cf_xopen_source" ; then
4877
4878 cf_fix_cppflags=no
4879 cf_new_cflags=
4880 cf_new_cppflags=
4881 cf_new_extra_cppflags=
4882
4883 for cf_add_cflags in $cf_xopen_source
4884 do
4885 case $cf_fix_cppflags in
4886 (no)
4887         case $cf_add_cflags in
4888         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4889                 case $cf_add_cflags in
4890                 (-D*)
4891                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4892
4893                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4894                                 && test -z "${cf_tst_cflags}" \
4895                                 && cf_fix_cppflags=yes
4896
4897                         if test $cf_fix_cppflags = yes ; then
4898
4899         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4900         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4901
4902                                 continue
4903                         elif test "${cf_tst_cflags}" = "\"'" ; then
4904
4905         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4906         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4907
4908                                 continue
4909                         fi
4910                         ;;
4911                 esac
4912                 case "$CPPFLAGS" in
4913                 (*$cf_add_cflags)
4914                         ;;
4915                 (*)
4916                         case $cf_add_cflags in
4917                         (-D*)
4918                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4919
4920 CPPFLAGS=`echo "$CPPFLAGS" | \
4921         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4922                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4923
4924                                 ;;
4925                         esac
4926
4927         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4928         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4929
4930                         ;;
4931                 esac
4932                 ;;
4933         (*)
4934
4935         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4936         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4937
4938                 ;;
4939         esac
4940         ;;
4941 (yes)
4942
4943         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4944         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4945
4946         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4947
4948         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4949                 && test -z "${cf_tst_cflags}" \
4950                 && cf_fix_cppflags=no
4951         ;;
4952 esac
4953 done
4954
4955 if test -n "$cf_new_cflags" ; then
4956         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4957
4958 echo "${as_me:-configure}:4958: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4959
4960         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4961         CFLAGS="${CFLAGS}$cf_new_cflags"
4962
4963 fi
4964
4965 if test -n "$cf_new_cppflags" ; then
4966         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4967
4968 echo "${as_me:-configure}:4968: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4969
4970         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4971         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4972
4973 fi
4974
4975 if test -n "$cf_new_extra_cppflags" ; then
4976         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4977
4978 echo "${as_me:-configure}:4978: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4979
4980         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4981         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4982
4983 fi
4984
4985 fi
4986
4987 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4988         echo "$as_me:4988: checking if _XOPEN_SOURCE really is set" >&5
4989 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4990         cat >conftest.$ac_ext <<_ACEOF
4991 #line 4991 "configure"
4992 #include "confdefs.h"
4993 #include <stdlib.h>
4994 int
4995 main (void)
4996 {
4997
4998 #ifndef _XOPEN_SOURCE
4999 make an error
5000 #endif
5001   ;
5002   return 0;
5003 }
5004 _ACEOF
5005 rm -f conftest.$ac_objext
5006 if { (eval echo "$as_me:5006: \"$ac_compile\"") >&5
5007   (eval $ac_compile) 2>&5
5008   ac_status=$?
5009   echo "$as_me:5009: \$? = $ac_status" >&5
5010   (exit $ac_status); } &&
5011          { ac_try='test -s conftest.$ac_objext'
5012   { (eval echo "$as_me:5012: \"$ac_try\"") >&5
5013   (eval $ac_try) 2>&5
5014   ac_status=$?
5015   echo "$as_me:5015: \$? = $ac_status" >&5
5016   (exit $ac_status); }; }; then
5017   cf_XOPEN_SOURCE_set=yes
5018 else
5019   echo "$as_me: failed program was:" >&5
5020 cat conftest.$ac_ext >&5
5021 cf_XOPEN_SOURCE_set=no
5022 fi
5023 rm -f conftest.$ac_objext conftest.$ac_ext
5024         echo "$as_me:5024: result: $cf_XOPEN_SOURCE_set" >&5
5025 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5026         if test $cf_XOPEN_SOURCE_set = yes
5027         then
5028                 cat >conftest.$ac_ext <<_ACEOF
5029 #line 5029 "configure"
5030 #include "confdefs.h"
5031 #include <stdlib.h>
5032 int
5033 main (void)
5034 {
5035
5036 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5037 make an error
5038 #endif
5039   ;
5040   return 0;
5041 }
5042 _ACEOF
5043 rm -f conftest.$ac_objext
5044 if { (eval echo "$as_me:5044: \"$ac_compile\"") >&5
5045   (eval $ac_compile) 2>&5
5046   ac_status=$?
5047   echo "$as_me:5047: \$? = $ac_status" >&5
5048   (exit $ac_status); } &&
5049          { ac_try='test -s conftest.$ac_objext'
5050   { (eval echo "$as_me:5050: \"$ac_try\"") >&5
5051   (eval $ac_try) 2>&5
5052   ac_status=$?
5053   echo "$as_me:5053: \$? = $ac_status" >&5
5054   (exit $ac_status); }; }; then
5055   cf_XOPEN_SOURCE_set_ok=yes
5056 else
5057   echo "$as_me: failed program was:" >&5
5058 cat conftest.$ac_ext >&5
5059 cf_XOPEN_SOURCE_set_ok=no
5060 fi
5061 rm -f conftest.$ac_objext conftest.$ac_ext
5062                 if test $cf_XOPEN_SOURCE_set_ok = no
5063                 then
5064                         { echo "$as_me:5064: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5065 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5066                 fi
5067         else
5068
5069 echo "$as_me:5069: checking if we should define _XOPEN_SOURCE" >&5
5070 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5071 if test "${cf_cv_xopen_source+set}" = set; then
5072   echo $ECHO_N "(cached) $ECHO_C" >&6
5073 else
5074
5075         cat >conftest.$ac_ext <<_ACEOF
5076 #line 5076 "configure"
5077 #include "confdefs.h"
5078
5079 #include <stdlib.h>
5080 #include <string.h>
5081 #include <sys/types.h>
5082
5083 int
5084 main (void)
5085 {
5086
5087 #ifndef _XOPEN_SOURCE
5088 make an error
5089 #endif
5090   ;
5091   return 0;
5092 }
5093 _ACEOF
5094 rm -f conftest.$ac_objext
5095 if { (eval echo "$as_me:5095: \"$ac_compile\"") >&5
5096   (eval $ac_compile) 2>&5
5097   ac_status=$?
5098   echo "$as_me:5098: \$? = $ac_status" >&5
5099   (exit $ac_status); } &&
5100          { ac_try='test -s conftest.$ac_objext'
5101   { (eval echo "$as_me:5101: \"$ac_try\"") >&5
5102   (eval $ac_try) 2>&5
5103   ac_status=$?
5104   echo "$as_me:5104: \$? = $ac_status" >&5
5105   (exit $ac_status); }; }; then
5106   cf_cv_xopen_source=no
5107 else
5108   echo "$as_me: failed program was:" >&5
5109 cat conftest.$ac_ext >&5
5110 cf_save="$CPPFLAGS"
5111
5112         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5113         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5114
5115          cat >conftest.$ac_ext <<_ACEOF
5116 #line 5116 "configure"
5117 #include "confdefs.h"
5118
5119 #include <stdlib.h>
5120 #include <string.h>
5121 #include <sys/types.h>
5122
5123 int
5124 main (void)
5125 {
5126
5127 #ifdef _XOPEN_SOURCE
5128 make an error
5129 #endif
5130   ;
5131   return 0;
5132 }
5133 _ACEOF
5134 rm -f conftest.$ac_objext
5135 if { (eval echo "$as_me:5135: \"$ac_compile\"") >&5
5136   (eval $ac_compile) 2>&5
5137   ac_status=$?
5138   echo "$as_me:5138: \$? = $ac_status" >&5
5139   (exit $ac_status); } &&
5140          { ac_try='test -s conftest.$ac_objext'
5141   { (eval echo "$as_me:5141: \"$ac_try\"") >&5
5142   (eval $ac_try) 2>&5
5143   ac_status=$?
5144   echo "$as_me:5144: \$? = $ac_status" >&5
5145   (exit $ac_status); }; }; then
5146   cf_cv_xopen_source=no
5147 else
5148   echo "$as_me: failed program was:" >&5
5149 cat conftest.$ac_ext >&5
5150 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5151 fi
5152 rm -f conftest.$ac_objext conftest.$ac_ext
5153         CPPFLAGS="$cf_save"
5154
5155 fi
5156 rm -f conftest.$ac_objext conftest.$ac_ext
5157
5158 fi
5159 echo "$as_me:5159: result: $cf_cv_xopen_source" >&5
5160 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5161
5162 if test "$cf_cv_xopen_source" != no ; then
5163
5164 CFLAGS=`echo "$CFLAGS" | \
5165         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5166                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5167
5168 CPPFLAGS=`echo "$CPPFLAGS" | \
5169         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5170                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5171
5172         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5173
5174 cf_fix_cppflags=no
5175 cf_new_cflags=
5176 cf_new_cppflags=
5177 cf_new_extra_cppflags=
5178
5179 for cf_add_cflags in $cf_temp_xopen_source
5180 do
5181 case $cf_fix_cppflags in
5182 (no)
5183         case $cf_add_cflags in
5184         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5185                 case $cf_add_cflags in
5186                 (-D*)
5187                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5188
5189                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5190                                 && test -z "${cf_tst_cflags}" \
5191                                 && cf_fix_cppflags=yes
5192
5193                         if test $cf_fix_cppflags = yes ; then
5194
5195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5197
5198                                 continue
5199                         elif test "${cf_tst_cflags}" = "\"'" ; then
5200
5201         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5202         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5203
5204                                 continue
5205                         fi
5206                         ;;
5207                 esac
5208                 case "$CPPFLAGS" in
5209                 (*$cf_add_cflags)
5210                         ;;
5211                 (*)
5212                         case $cf_add_cflags in
5213                         (-D*)
5214                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5215
5216 CPPFLAGS=`echo "$CPPFLAGS" | \
5217         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5218                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5219
5220                                 ;;
5221                         esac
5222
5223         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5224         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5225
5226                         ;;
5227                 esac
5228                 ;;
5229         (*)
5230
5231         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5232         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5233
5234                 ;;
5235         esac
5236         ;;
5237 (yes)
5238
5239         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5240         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5241
5242         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5243
5244         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5245                 && test -z "${cf_tst_cflags}" \
5246                 && cf_fix_cppflags=no
5247         ;;
5248 esac
5249 done
5250
5251 if test -n "$cf_new_cflags" ; then
5252
5253         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5254         CFLAGS="${CFLAGS}$cf_new_cflags"
5255
5256 fi
5257
5258 if test -n "$cf_new_cppflags" ; then
5259
5260         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5261         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5262
5263 fi
5264
5265 if test -n "$cf_new_extra_cppflags" ; then
5266
5267         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5268         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5269
5270 fi
5271
5272 fi
5273
5274         fi
5275 fi
5276 fi # cf_cv_posix_visible
5277
5278 echo "$as_me:5278: checking for signal global datatype" >&5
5279 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5280 if test "${cf_cv_sig_atomic_t+set}" = set; then
5281   echo $ECHO_N "(cached) $ECHO_C" >&6
5282 else
5283
5284         for cf_type in \
5285                 "volatile sig_atomic_t" \
5286                 "sig_atomic_t" \
5287                 "int"
5288         do
5289         cat >conftest.$ac_ext <<_ACEOF
5290 #line 5290 "configure"
5291 #include "confdefs.h"
5292
5293 #include <sys/types.h>
5294 #include <signal.h>
5295 #include <stdio.h>
5296
5297 extern $cf_type x;
5298 $cf_type x;
5299 static void handler(int sig)
5300 {
5301         x = 5;
5302 }
5303 int
5304 main (void)
5305 {
5306 signal(SIGINT, handler);
5307                  x = 1
5308   ;
5309   return 0;
5310 }
5311 _ACEOF
5312 rm -f conftest.$ac_objext
5313 if { (eval echo "$as_me:5313: \"$ac_compile\"") >&5
5314   (eval $ac_compile) 2>&5
5315   ac_status=$?
5316   echo "$as_me:5316: \$? = $ac_status" >&5
5317   (exit $ac_status); } &&
5318          { ac_try='test -s conftest.$ac_objext'
5319   { (eval echo "$as_me:5319: \"$ac_try\"") >&5
5320   (eval $ac_try) 2>&5
5321   ac_status=$?
5322   echo "$as_me:5322: \$? = $ac_status" >&5
5323   (exit $ac_status); }; }; then
5324   cf_cv_sig_atomic_t=$cf_type
5325 else
5326   echo "$as_me: failed program was:" >&5
5327 cat conftest.$ac_ext >&5
5328 cf_cv_sig_atomic_t=no
5329 fi
5330 rm -f conftest.$ac_objext conftest.$ac_ext
5331                 test "$cf_cv_sig_atomic_t" != no && break
5332         done
5333
5334 fi
5335
5336 echo "$as_me:5336: result: $cf_cv_sig_atomic_t" >&5
5337 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5338 test "$cf_cv_sig_atomic_t" != no &&
5339 cat >>confdefs.h <<EOF
5340 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5341 EOF
5342
5343 # Work around breakage on OS X
5344
5345 echo "$as_me:5345: checking if SIGWINCH is defined" >&5
5346 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5347 if test "${cf_cv_define_sigwinch+set}" = set; then
5348   echo $ECHO_N "(cached) $ECHO_C" >&6
5349 else
5350
5351         cat >conftest.$ac_ext <<_ACEOF
5352 #line 5352 "configure"
5353 #include "confdefs.h"
5354
5355 #include <sys/types.h>
5356 #include <sys/signal.h>
5357
5358 int
5359 main (void)
5360 {
5361 int x = SIGWINCH
5362   ;
5363   return 0;
5364 }
5365 _ACEOF
5366 rm -f conftest.$ac_objext
5367 if { (eval echo "$as_me:5367: \"$ac_compile\"") >&5
5368   (eval $ac_compile) 2>&5
5369   ac_status=$?
5370   echo "$as_me:5370: \$? = $ac_status" >&5
5371   (exit $ac_status); } &&
5372          { ac_try='test -s conftest.$ac_objext'
5373   { (eval echo "$as_me:5373: \"$ac_try\"") >&5
5374   (eval $ac_try) 2>&5
5375   ac_status=$?
5376   echo "$as_me:5376: \$? = $ac_status" >&5
5377   (exit $ac_status); }; }; then
5378   cf_cv_define_sigwinch=yes
5379 else
5380   echo "$as_me: failed program was:" >&5
5381 cat conftest.$ac_ext >&5
5382 cat >conftest.$ac_ext <<_ACEOF
5383 #line 5383 "configure"
5384 #include "confdefs.h"
5385
5386 #undef _XOPEN_SOURCE
5387 #undef _POSIX_SOURCE
5388 #undef _POSIX_C_SOURCE
5389 #include <sys/types.h>
5390 #include <sys/signal.h>
5391
5392 int
5393 main (void)
5394 {
5395 int x = SIGWINCH
5396   ;
5397   return 0;
5398 }
5399 _ACEOF
5400 rm -f conftest.$ac_objext
5401 if { (eval echo "$as_me:5401: \"$ac_compile\"") >&5
5402   (eval $ac_compile) 2>&5
5403   ac_status=$?
5404   echo "$as_me:5404: \$? = $ac_status" >&5
5405   (exit $ac_status); } &&
5406          { ac_try='test -s conftest.$ac_objext'
5407   { (eval echo "$as_me:5407: \"$ac_try\"") >&5
5408   (eval $ac_try) 2>&5
5409   ac_status=$?
5410   echo "$as_me:5410: \$? = $ac_status" >&5
5411   (exit $ac_status); }; }; then
5412   cf_cv_define_sigwinch=maybe
5413 else
5414   echo "$as_me: failed program was:" >&5
5415 cat conftest.$ac_ext >&5
5416 cf_cv_define_sigwinch=no
5417 fi
5418 rm -f conftest.$ac_objext conftest.$ac_ext
5419
5420 fi
5421 rm -f conftest.$ac_objext conftest.$ac_ext
5422
5423 fi
5424 echo "$as_me:5424: result: $cf_cv_define_sigwinch" >&5
5425 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5426
5427 if test "$cf_cv_define_sigwinch" = maybe ; then
5428 echo "$as_me:5428: checking for actual SIGWINCH definition" >&5
5429 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5430 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5431   echo $ECHO_N "(cached) $ECHO_C" >&6
5432 else
5433
5434 cf_cv_fixup_sigwinch=unknown
5435 cf_sigwinch=32
5436 while test $cf_sigwinch != 1
5437 do
5438         cat >conftest.$ac_ext <<_ACEOF
5439 #line 5439 "configure"
5440 #include "confdefs.h"
5441
5442 #undef _XOPEN_SOURCE
5443 #undef _POSIX_SOURCE
5444 #undef _POSIX_C_SOURCE
5445 #include <sys/types.h>
5446 #include <sys/signal.h>
5447
5448 int
5449 main (void)
5450 {
5451
5452 #if SIGWINCH != $cf_sigwinch
5453 make an error
5454 #endif
5455 int x = SIGWINCH
5456   ;
5457   return 0;
5458 }
5459 _ACEOF
5460 rm -f conftest.$ac_objext
5461 if { (eval echo "$as_me:5461: \"$ac_compile\"") >&5
5462   (eval $ac_compile) 2>&5
5463   ac_status=$?
5464   echo "$as_me:5464: \$? = $ac_status" >&5
5465   (exit $ac_status); } &&
5466          { ac_try='test -s conftest.$ac_objext'
5467   { (eval echo "$as_me:5467: \"$ac_try\"") >&5
5468   (eval $ac_try) 2>&5
5469   ac_status=$?
5470   echo "$as_me:5470: \$? = $ac_status" >&5
5471   (exit $ac_status); }; }; then
5472   cf_cv_fixup_sigwinch=$cf_sigwinch
5473          break
5474 else
5475   echo "$as_me: failed program was:" >&5
5476 cat conftest.$ac_ext >&5
5477 fi
5478 rm -f conftest.$ac_objext conftest.$ac_ext
5479
5480 cf_sigwinch=`expr $cf_sigwinch - 1`
5481 done
5482
5483 fi
5484 echo "$as_me:5484: result: $cf_cv_fixup_sigwinch" >&5
5485 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5486
5487         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5488                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5489         fi
5490 fi
5491
5492 # Checks for CODESET support.
5493
5494 echo "$as_me:5494: checking for nl_langinfo and CODESET" >&5
5495 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5496 if test "${am_cv_langinfo_codeset+set}" = set; then
5497   echo $ECHO_N "(cached) $ECHO_C" >&6
5498 else
5499   cat >conftest.$ac_ext <<_ACEOF
5500 #line 5500 "configure"
5501 #include "confdefs.h"
5502 #include <langinfo.h>
5503 int
5504 main (void)
5505 {
5506 char* cs = nl_langinfo(CODESET);
5507   ;
5508   return 0;
5509 }
5510 _ACEOF
5511 rm -f conftest.$ac_objext conftest$ac_exeext
5512 if { (eval echo "$as_me:5512: \"$ac_link\"") >&5
5513   (eval $ac_link) 2>&5
5514   ac_status=$?
5515   echo "$as_me:5515: \$? = $ac_status" >&5
5516   (exit $ac_status); } &&
5517          { ac_try='test -s conftest$ac_exeext'
5518   { (eval echo "$as_me:5518: \"$ac_try\"") >&5
5519   (eval $ac_try) 2>&5
5520   ac_status=$?
5521   echo "$as_me:5521: \$? = $ac_status" >&5
5522   (exit $ac_status); }; }; then
5523   am_cv_langinfo_codeset=yes
5524 else
5525   echo "$as_me: failed program was:" >&5
5526 cat conftest.$ac_ext >&5
5527 am_cv_langinfo_codeset=no
5528 fi
5529 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5530
5531 fi
5532 echo "$as_me:5532: result: $am_cv_langinfo_codeset" >&5
5533 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5534         if test $am_cv_langinfo_codeset = yes; then
5535
5536 cat >>confdefs.h <<\EOF
5537 #define HAVE_LANGINFO_CODESET 1
5538 EOF
5539
5540         fi
5541
5542 echo "$as_me:5542: checking if you want to use pkg-config" >&5
5543 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5544
5545 # Check whether --with-pkg-config or --without-pkg-config was given.
5546 if test "${with_pkg_config+set}" = set; then
5547   withval="$with_pkg_config"
5548   cf_pkg_config=$withval
5549 else
5550   cf_pkg_config=yes
5551 fi;
5552 echo "$as_me:5552: result: $cf_pkg_config" >&5
5553 echo "${ECHO_T}$cf_pkg_config" >&6
5554
5555 case $cf_pkg_config in
5556 (no)
5557         PKG_CONFIG=none
5558         ;;
5559 (yes)
5560
5561 if test -n "$ac_tool_prefix"; then
5562   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5563 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5564 echo "$as_me:5564: checking for $ac_word" >&5
5565 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5566 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5567   echo $ECHO_N "(cached) $ECHO_C" >&6
5568 else
5569   case $PKG_CONFIG in
5570   [\\/]* | ?:[\\/]*)
5571   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5572   ;;
5573   *)
5574   ac_save_IFS=$IFS; IFS=$ac_path_separator
5575 ac_dummy="$PATH"
5576 for ac_dir in $ac_dummy; do
5577   IFS=$ac_save_IFS
5578   test -z "$ac_dir" && ac_dir=.
5579   if $as_executable_p "$ac_dir/$ac_word"; then
5580    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5581    echo "$as_me:5581: found $ac_dir/$ac_word" >&5
5582    break
5583 fi
5584 done
5585
5586   ;;
5587 esac
5588 fi
5589 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5590
5591 if test -n "$PKG_CONFIG"; then
5592   echo "$as_me:5592: result: $PKG_CONFIG" >&5
5593 echo "${ECHO_T}$PKG_CONFIG" >&6
5594 else
5595   echo "$as_me:5595: result: no" >&5
5596 echo "${ECHO_T}no" >&6
5597 fi
5598
5599 fi
5600 if test -z "$ac_cv_path_PKG_CONFIG"; then
5601   ac_pt_PKG_CONFIG=$PKG_CONFIG
5602   # Extract the first word of "pkg-config", so it can be a program name with args.
5603 set dummy pkg-config; ac_word=$2
5604 echo "$as_me:5604: checking for $ac_word" >&5
5605 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5606 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5607   echo $ECHO_N "(cached) $ECHO_C" >&6
5608 else
5609   case $ac_pt_PKG_CONFIG in
5610   [\\/]* | ?:[\\/]*)
5611   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5612   ;;
5613   *)
5614   ac_save_IFS=$IFS; IFS=$ac_path_separator
5615 ac_dummy="$PATH"
5616 for ac_dir in $ac_dummy; do
5617   IFS=$ac_save_IFS
5618   test -z "$ac_dir" && ac_dir=.
5619   if $as_executable_p "$ac_dir/$ac_word"; then
5620    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5621    echo "$as_me:5621: found $ac_dir/$ac_word" >&5
5622    break
5623 fi
5624 done
5625
5626   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5627   ;;
5628 esac
5629 fi
5630 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5631
5632 if test -n "$ac_pt_PKG_CONFIG"; then
5633   echo "$as_me:5633: result: $ac_pt_PKG_CONFIG" >&5
5634 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5635 else
5636   echo "$as_me:5636: result: no" >&5
5637 echo "${ECHO_T}no" >&6
5638 fi
5639
5640   PKG_CONFIG=$ac_pt_PKG_CONFIG
5641 else
5642   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5643 fi
5644
5645         ;;
5646 (*)
5647         PKG_CONFIG=$withval
5648         ;;
5649 esac
5650
5651 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5652 if test "$PKG_CONFIG" != none ; then
5653
5654 if test "x$prefix" != xNONE; then
5655         cf_path_syntax="$prefix"
5656 else
5657         cf_path_syntax="$ac_default_prefix"
5658 fi
5659
5660 case ".$PKG_CONFIG" in
5661 (.\$\(*\)*|.\'*\'*)
5662         ;;
5663 (..|./*|.\\*)
5664         ;;
5665 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5666         ;;
5667 (.\${*prefix}*|.\${*dir}*)
5668         eval PKG_CONFIG="$PKG_CONFIG"
5669         case ".$PKG_CONFIG" in
5670         (.NONE/*)
5671                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5672                 ;;
5673         esac
5674         ;;
5675 (.no|.NONE/*)
5676         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5677         ;;
5678 (*)
5679         { { echo "$as_me:5679: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5680 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5681    { (exit 1); exit 1; }; }
5682         ;;
5683 esac
5684
5685 elif test "x$cf_pkg_config" != xno ; then
5686         { echo "$as_me:5686: WARNING: pkg-config is not installed" >&5
5687 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5688 fi
5689
5690 echo "$as_me:5690: checking if you want to see long compiling messages" >&5
5691 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5692
5693 # Check whether --enable-echo or --disable-echo was given.
5694 if test "${enable_echo+set}" = set; then
5695   enableval="$enable_echo"
5696   test "$enableval" != no && enableval=yes
5697         if test "$enableval" != "yes" ; then
5698
5699         ECHO_LT='--silent'
5700         ECHO_LD='@echo linking $@;'
5701         RULE_CC='@echo compiling $<'
5702         SHOW_CC='@echo compiling $@'
5703         ECHO_CC='@'
5704
5705         else
5706
5707         ECHO_LT=''
5708         ECHO_LD=''
5709         RULE_CC=''
5710         SHOW_CC=''
5711         ECHO_CC=''
5712
5713         fi
5714 else
5715   enableval=yes
5716
5717         ECHO_LT=''
5718         ECHO_LD=''
5719         RULE_CC=''
5720         SHOW_CC=''
5721         ECHO_CC=''
5722
5723 fi;
5724 echo "$as_me:5724: result: $enableval" >&5
5725 echo "${ECHO_T}$enableval" >&6
5726
5727 echo "$as_me:5727: checking for ncurses wrap-prefix" >&5
5728 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5729
5730 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5731 if test "${with_ncurses_wrap_prefix+set}" = set; then
5732   withval="$with_ncurses_wrap_prefix"
5733   NCURSES_WRAP_PREFIX=$withval
5734 else
5735   NCURSES_WRAP_PREFIX=_nc_
5736 fi;
5737 echo "$as_me:5737: result: $NCURSES_WRAP_PREFIX" >&5
5738 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5739
5740 echo "$as_me:5740: checking if you want to check for wide-character functions" >&5
5741 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5742
5743 # Check whether --enable-widec or --disable-widec was given.
5744 if test "${enable_widec+set}" = set; then
5745   enableval="$enable_widec"
5746   test "$enableval" != no && enableval=yes
5747         if test "$enableval" != "yes" ; then
5748     cf_enable_widec=no
5749         else
5750                 cf_enable_widec=yes
5751         fi
5752 else
5753   enableval=yes
5754         cf_enable_widec=yes
5755
5756 fi;
5757 echo "$as_me:5757: result: $cf_enable_widec" >&5
5758 echo "${ECHO_T}$cf_enable_widec" >&6
5759
5760 echo "$as_me:5760: checking for specific curses-directory" >&5
5761 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5762
5763 # Check whether --with-curses-dir or --without-curses-dir was given.
5764 if test "${with_curses_dir+set}" = set; then
5765   withval="$with_curses_dir"
5766   cf_cv_curses_dir=$withval
5767 else
5768   cf_cv_curses_dir=no
5769 fi;
5770 echo "$as_me:5770: result: $cf_cv_curses_dir" >&5
5771 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5772
5773 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5774 then
5775
5776 if test "x$prefix" != xNONE; then
5777         cf_path_syntax="$prefix"
5778 else
5779         cf_path_syntax="$ac_default_prefix"
5780 fi
5781
5782 case ".$withval" in
5783 (.\$\(*\)*|.\'*\'*)
5784         ;;
5785 (..|./*|.\\*)
5786         ;;
5787 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5788         ;;
5789 (.\${*prefix}*|.\${*dir}*)
5790         eval withval="$withval"
5791         case ".$withval" in
5792         (.NONE/*)
5793                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5794                 ;;
5795         esac
5796         ;;
5797 (.no|.NONE/*)
5798         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5799         ;;
5800 (*)
5801         { { echo "$as_me:5801: error: expected a pathname, not \"$withval\"" >&5
5802 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5803    { (exit 1); exit 1; }; }
5804         ;;
5805 esac
5806
5807         if test -d "$cf_cv_curses_dir"
5808         then
5809
5810 if test -n "$cf_cv_curses_dir/include" ; then
5811   for cf_add_incdir in $cf_cv_curses_dir/include
5812   do
5813         while test $cf_add_incdir != /usr/include
5814         do
5815           if test -d $cf_add_incdir
5816           then
5817                 cf_have_incdir=no
5818                 if test -n "$CFLAGS$CPPFLAGS" ; then
5819                   # a loop is needed to ensure we can add subdirs of existing dirs
5820                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5821                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5822                           cf_have_incdir=yes; break
5823                         fi
5824                   done
5825                 fi
5826
5827                 if test "$cf_have_incdir" = no ; then
5828                   if test "$cf_add_incdir" = /usr/local/include ; then
5829                         if test "$GCC" = yes
5830                         then
5831                           cf_save_CPPFLAGS=$CPPFLAGS
5832
5833         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5834         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5835
5836                           cat >conftest.$ac_ext <<_ACEOF
5837 #line 5837 "configure"
5838 #include "confdefs.h"
5839 #include <stdio.h>
5840 int
5841 main (void)
5842 {
5843 printf("Hello")
5844   ;
5845   return 0;
5846 }
5847 _ACEOF
5848 rm -f conftest.$ac_objext
5849 if { (eval echo "$as_me:5849: \"$ac_compile\"") >&5
5850   (eval $ac_compile) 2>&5
5851   ac_status=$?
5852   echo "$as_me:5852: \$? = $ac_status" >&5
5853   (exit $ac_status); } &&
5854          { ac_try='test -s conftest.$ac_objext'
5855   { (eval echo "$as_me:5855: \"$ac_try\"") >&5
5856   (eval $ac_try) 2>&5
5857   ac_status=$?
5858   echo "$as_me:5858: \$? = $ac_status" >&5
5859   (exit $ac_status); }; }; then
5860   :
5861 else
5862   echo "$as_me: failed program was:" >&5
5863 cat conftest.$ac_ext >&5
5864 cf_have_incdir=yes
5865 fi
5866 rm -f conftest.$ac_objext conftest.$ac_ext
5867                           CPPFLAGS=$cf_save_CPPFLAGS
5868                         fi
5869                   fi
5870                 fi
5871
5872                 if test "$cf_have_incdir" = no ; then
5873                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5874
5875 echo "${as_me:-configure}:5875: testing adding $cf_add_incdir to include-path ..." 1>&5
5876
5877                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5878
5879                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5880                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5881                   cf_add_incdir="$cf_top_incdir"
5882                 else
5883                   break
5884                 fi
5885           else
5886                 break
5887           fi
5888         done
5889   done
5890 fi
5891
5892 if test -n "$cf_cv_curses_dir/lib" ; then
5893         for cf_add_libdir in $cf_cv_curses_dir/lib
5894         do
5895                 if test $cf_add_libdir = /usr/lib ; then
5896                         :
5897                 elif test -d $cf_add_libdir
5898                 then
5899                         cf_have_libdir=no
5900                         if test -n "$LDFLAGS$LIBS" ; then
5901                                 # a loop is needed to ensure we can add subdirs of existing dirs
5902                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5903                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5904                                                 cf_have_libdir=yes; break
5905                                         fi
5906                                 done
5907                         fi
5908                         if test "$cf_have_libdir" = no ; then
5909                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5910
5911 echo "${as_me:-configure}:5911: testing adding $cf_add_libdir to library-path ..." 1>&5
5912
5913                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5914                         fi
5915                 fi
5916         done
5917 fi
5918
5919         fi
5920 fi
5921
5922 cf_cv_screen=curses
5923
5924 echo "$as_me:5924: checking for specified curses library type" >&5
5925 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5926
5927 # Check whether --with-screen or --without-screen was given.
5928 if test "${with_screen+set}" = set; then
5929   withval="$with_screen"
5930   cf_cv_screen=$withval
5931 else
5932
5933 # Check whether --with-ncursesw or --without-ncursesw was given.
5934 if test "${with_ncursesw+set}" = set; then
5935   withval="$with_ncursesw"
5936   cf_cv_screen=ncursesw
5937 else
5938
5939 # Check whether --with-ncurses or --without-ncurses was given.
5940 if test "${with_ncurses+set}" = set; then
5941   withval="$with_ncurses"
5942   cf_cv_screen=ncurses
5943 else
5944
5945 # Check whether --with-pdcurses or --without-pdcurses was given.
5946 if test "${with_pdcurses+set}" = set; then
5947   withval="$with_pdcurses"
5948   cf_cv_screen=pdcurses
5949 else
5950
5951 # Check whether --with-curses-colr or --without-curses-colr was given.
5952 if test "${with_curses_colr+set}" = set; then
5953   withval="$with_curses_colr"
5954   cf_cv_screen=curses_colr
5955 else
5956
5957 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5958 if test "${with_curses_5lib+set}" = set; then
5959   withval="$with_curses_5lib"
5960   cf_cv_screen=curses_5lib
5961 fi;
5962 fi;
5963 fi;
5964 fi;
5965 fi;
5966 fi;
5967
5968 echo "$as_me:5968: result: $cf_cv_screen" >&5
5969 echo "${ECHO_T}$cf_cv_screen" >&6
5970
5971 case $cf_cv_screen in
5972 (curses|curses_*)
5973
5974 echo "$as_me:5974: checking for extra include directories" >&5
5975 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5976 if test "${cf_cv_curses_incdir+set}" = set; then
5977   echo $ECHO_N "(cached) $ECHO_C" >&6
5978 else
5979
5980 cf_cv_curses_incdir=no
5981 case $host_os in
5982 (hpux10.*)
5983         if test "x$cf_cv_screen" = "xcurses_colr"
5984         then
5985                 test -d /usr/include/curses_colr && \
5986                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5987         fi
5988         ;;
5989 (sunos3*|sunos4*)
5990         if test "x$cf_cv_screen" = "xcurses_5lib"
5991         then
5992                 test -d /usr/5lib && \
5993                 test -d /usr/5include && \
5994                 cf_cv_curses_incdir="-I/usr/5include"
5995         fi
5996         ;;
5997 esac
5998
5999 fi
6000 echo "$as_me:6000: result: $cf_cv_curses_incdir" >&5
6001 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6002 if test "$cf_cv_curses_incdir" != no
6003 then
6004
6005         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6006         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6007
6008 fi
6009
6010 echo "$as_me:6010: checking if we have identified curses headers" >&5
6011 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6012 if test "${cf_cv_ncurses_header+set}" = set; then
6013   echo $ECHO_N "(cached) $ECHO_C" >&6
6014 else
6015
6016 cf_cv_ncurses_header=none
6017 for cf_header in \
6018         ncurses.h  \
6019         curses.h  ncurses/ncurses.h ncurses/curses.h
6020 do
6021 cat >conftest.$ac_ext <<_ACEOF
6022 #line 6022 "configure"
6023 #include "confdefs.h"
6024 #include <${cf_header}>
6025 int
6026 main (void)
6027 {
6028 initscr(); tgoto("?", 0,0)
6029   ;
6030   return 0;
6031 }
6032 _ACEOF
6033 rm -f conftest.$ac_objext
6034 if { (eval echo "$as_me:6034: \"$ac_compile\"") >&5
6035   (eval $ac_compile) 2>&5
6036   ac_status=$?
6037   echo "$as_me:6037: \$? = $ac_status" >&5
6038   (exit $ac_status); } &&
6039          { ac_try='test -s conftest.$ac_objext'
6040   { (eval echo "$as_me:6040: \"$ac_try\"") >&5
6041   (eval $ac_try) 2>&5
6042   ac_status=$?
6043   echo "$as_me:6043: \$? = $ac_status" >&5
6044   (exit $ac_status); }; }; then
6045   cf_cv_ncurses_header=$cf_header; break
6046 else
6047   echo "$as_me: failed program was:" >&5
6048 cat conftest.$ac_ext >&5
6049 fi
6050 rm -f conftest.$ac_objext conftest.$ac_ext
6051 done
6052
6053 fi
6054 echo "$as_me:6054: result: $cf_cv_ncurses_header" >&5
6055 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6056
6057 if test "$cf_cv_ncurses_header" = none ; then
6058         { { echo "$as_me:6058: error: No curses header-files found" >&5
6059 echo "$as_me: error: No curses header-files found" >&2;}
6060    { (exit 1); exit 1; }; }
6061 fi
6062
6063 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6064
6065 for ac_header in $cf_cv_ncurses_header
6066 do
6067 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6068 echo "$as_me:6068: checking for $ac_header" >&5
6069 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6070 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6071   echo $ECHO_N "(cached) $ECHO_C" >&6
6072 else
6073   cat >conftest.$ac_ext <<_ACEOF
6074 #line 6074 "configure"
6075 #include "confdefs.h"
6076 #include <$ac_header>
6077 _ACEOF
6078 if { (eval echo "$as_me:6078: \"$ac_cpp conftest.$ac_ext\"") >&5
6079   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6080   ac_status=$?
6081   egrep -v '^ *\+' conftest.er1 >conftest.err
6082   rm -f conftest.er1
6083   cat conftest.err >&5
6084   echo "$as_me:6084: \$? = $ac_status" >&5
6085   (exit $ac_status); } >/dev/null; then
6086   if test -s conftest.err; then
6087     ac_cpp_err=$ac_c_preproc_warn_flag
6088   else
6089     ac_cpp_err=
6090   fi
6091 else
6092   ac_cpp_err=yes
6093 fi
6094 if test -z "$ac_cpp_err"; then
6095   eval "$as_ac_Header=yes"
6096 else
6097   echo "$as_me: failed program was:" >&5
6098   cat conftest.$ac_ext >&5
6099   eval "$as_ac_Header=no"
6100 fi
6101 rm -f conftest.err conftest.$ac_ext
6102 fi
6103 echo "$as_me:6103: result: `eval echo '${'$as_ac_Header'}'`" >&5
6104 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6105 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6106   cat >>confdefs.h <<EOF
6107 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6108 EOF
6109
6110 fi
6111 done
6112
6113 echo "$as_me:6113: checking for terminfo header" >&5
6114 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6115 if test "${cf_cv_term_header+set}" = set; then
6116   echo $ECHO_N "(cached) $ECHO_C" >&6
6117 else
6118
6119 case ${cf_cv_ncurses_header} in
6120 (*/ncurses.h|*/ncursesw.h)
6121         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6122         ;;
6123 (*)
6124         cf_term_header=term.h
6125         ;;
6126 esac
6127
6128 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6129 do
6130 cat >conftest.$ac_ext <<_ACEOF
6131 #line 6131 "configure"
6132 #include "confdefs.h"
6133 #include <stdio.h>
6134 #include <${cf_cv_ncurses_header:-curses.h}>
6135 #include <$cf_test>
6136
6137 int
6138 main (void)
6139 {
6140 int x = auto_left_margin
6141   ;
6142   return 0;
6143 }
6144 _ACEOF
6145 rm -f conftest.$ac_objext
6146 if { (eval echo "$as_me:6146: \"$ac_compile\"") >&5
6147   (eval $ac_compile) 2>&5
6148   ac_status=$?
6149   echo "$as_me:6149: \$? = $ac_status" >&5
6150   (exit $ac_status); } &&
6151          { ac_try='test -s conftest.$ac_objext'
6152   { (eval echo "$as_me:6152: \"$ac_try\"") >&5
6153   (eval $ac_try) 2>&5
6154   ac_status=$?
6155   echo "$as_me:6155: \$? = $ac_status" >&5
6156   (exit $ac_status); }; }; then
6157
6158         cf_cv_term_header="$cf_test"
6159 else
6160   echo "$as_me: failed program was:" >&5
6161 cat conftest.$ac_ext >&5
6162
6163         cf_cv_term_header=unknown
6164
6165 fi
6166 rm -f conftest.$ac_objext conftest.$ac_ext
6167         test "$cf_cv_term_header" != unknown && break
6168 done
6169
6170 fi
6171 echo "$as_me:6171: result: $cf_cv_term_header" >&5
6172 echo "${ECHO_T}$cf_cv_term_header" >&6
6173
6174 # Set definitions to allow ifdef'ing to accommodate subdirectories
6175
6176 case $cf_cv_term_header in
6177 (*term.h)
6178
6179 cat >>confdefs.h <<\EOF
6180 #define HAVE_TERM_H 1
6181 EOF
6182
6183         ;;
6184 esac
6185
6186 case $cf_cv_term_header in
6187 (ncurses/term.h)
6188
6189 cat >>confdefs.h <<\EOF
6190 #define HAVE_NCURSES_TERM_H 1
6191 EOF
6192
6193         ;;
6194 (ncursesw/term.h)
6195
6196 cat >>confdefs.h <<\EOF
6197 #define HAVE_NCURSESW_TERM_H 1
6198 EOF
6199
6200         ;;
6201 esac
6202
6203 echo "$as_me:6203: checking for ncurses version" >&5
6204 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6205 if test "${cf_cv_ncurses_version+set}" = set; then
6206   echo $ECHO_N "(cached) $ECHO_C" >&6
6207 else
6208
6209         cf_cv_ncurses_version=no
6210         cf_tempfile=out$$
6211         rm -f $cf_tempfile
6212         if test "$cross_compiling" = yes; then
6213
6214         # This will not work if the preprocessor splits the line after the
6215         # Autoconf token.  The 'unproto' program does that.
6216         cat > conftest.$ac_ext <<EOF
6217 #include <${cf_cv_ncurses_header:-curses.h}>
6218 #undef Autoconf
6219 #ifdef NCURSES_VERSION
6220 Autoconf NCURSES_VERSION
6221 #else
6222 #ifdef __NCURSES_H
6223 Autoconf "old"
6224 #endif
6225 ;
6226 #endif
6227 EOF
6228         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6229         { (eval echo "$as_me:6229: \"$cf_try\"") >&5
6230   (eval $cf_try) 2>&5
6231   ac_status=$?
6232   echo "$as_me:6232: \$? = $ac_status" >&5
6233   (exit $ac_status); }
6234         if test -f conftest.out ; then
6235                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6236                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6237                 rm -f conftest.out
6238         fi
6239
6240 else
6241   cat >conftest.$ac_ext <<_ACEOF
6242 #line 6242 "configure"
6243 #include "confdefs.h"
6244
6245 #include <${cf_cv_ncurses_header:-curses.h}>
6246 #include <stdio.h>
6247 int main(void)
6248 {
6249         FILE *fp = fopen("$cf_tempfile", "w");
6250 #ifdef NCURSES_VERSION
6251 # ifdef NCURSES_VERSION_PATCH
6252         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6253 # else
6254         fprintf(fp, "%s\n", NCURSES_VERSION);
6255 # endif
6256 #else
6257 # ifdef __NCURSES_H
6258         fprintf(fp, "old\n");
6259 # else
6260         make an error
6261 # endif
6262 #endif
6263         ${cf_cv_main_return:-return}(0);
6264 }
6265 _ACEOF
6266 rm -f conftest$ac_exeext
6267 if { (eval echo "$as_me:6267: \"$ac_link\"") >&5
6268   (eval $ac_link) 2>&5
6269   ac_status=$?
6270   echo "$as_me:6270: \$? = $ac_status" >&5
6271   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6272   { (eval echo "$as_me:6272: \"$ac_try\"") >&5
6273   (eval $ac_try) 2>&5
6274   ac_status=$?
6275   echo "$as_me:6275: \$? = $ac_status" >&5
6276   (exit $ac_status); }; }; then
6277
6278         cf_cv_ncurses_version=`cat $cf_tempfile`
6279 else
6280   echo "$as_me: program exited with status $ac_status" >&5
6281 echo "$as_me: failed program was:" >&5
6282 cat conftest.$ac_ext >&5
6283 fi
6284 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6285 fi
6286         rm -f $cf_tempfile
6287
6288 fi
6289 echo "$as_me:6289: result: $cf_cv_ncurses_version" >&5
6290 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6291 test "$cf_cv_ncurses_version" = no ||
6292 cat >>confdefs.h <<\EOF
6293 #define NCURSES 1
6294 EOF
6295
6296 echo "$as_me:6296: checking if we have identified curses libraries" >&5
6297 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6298 cat >conftest.$ac_ext <<_ACEOF
6299 #line 6299 "configure"
6300 #include "confdefs.h"
6301 #include <${cf_cv_ncurses_header:-curses.h}>
6302 int
6303 main (void)
6304 {
6305 initscr(); tgoto("?", 0,0)
6306   ;
6307   return 0;
6308 }
6309 _ACEOF
6310 rm -f conftest.$ac_objext conftest$ac_exeext
6311 if { (eval echo "$as_me:6311: \"$ac_link\"") >&5
6312   (eval $ac_link) 2>&5
6313   ac_status=$?
6314   echo "$as_me:6314: \$? = $ac_status" >&5
6315   (exit $ac_status); } &&
6316          { ac_try='test -s conftest$ac_exeext'
6317   { (eval echo "$as_me:6317: \"$ac_try\"") >&5
6318   (eval $ac_try) 2>&5
6319   ac_status=$?
6320   echo "$as_me:6320: \$? = $ac_status" >&5
6321   (exit $ac_status); }; }; then
6322   cf_result=yes
6323 else
6324   echo "$as_me: failed program was:" >&5
6325 cat conftest.$ac_ext >&5
6326 cf_result=no
6327 fi
6328 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6329 echo "$as_me:6329: result: $cf_result" >&5
6330 echo "${ECHO_T}$cf_result" >&6
6331
6332 if test "$cf_result" = no ; then
6333 case $host_os in
6334 (freebsd*)
6335         echo "$as_me:6335: checking for tgoto in -lmytinfo" >&5
6336 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6337 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6338   echo $ECHO_N "(cached) $ECHO_C" >&6
6339 else
6340   ac_check_lib_save_LIBS=$LIBS
6341 LIBS="-lmytinfo  $LIBS"
6342 cat >conftest.$ac_ext <<_ACEOF
6343 #line 6343 "configure"
6344 #include "confdefs.h"
6345
6346 /* Override any gcc2 internal prototype to avoid an error.  */
6347 #ifdef __cplusplus
6348 extern "C"
6349 #endif
6350 /* We use char because int might match the return type of a gcc2
6351    builtin and then its argument prototype would still apply.  */
6352 char tgoto ();
6353 int
6354 main (void)
6355 {
6356 tgoto ();
6357   ;
6358   return 0;
6359 }
6360 _ACEOF
6361 rm -f conftest.$ac_objext conftest$ac_exeext
6362 if { (eval echo "$as_me:6362: \"$ac_link\"") >&5
6363   (eval $ac_link) 2>&5
6364   ac_status=$?
6365   echo "$as_me:6365: \$? = $ac_status" >&5
6366   (exit $ac_status); } &&
6367          { ac_try='test -s conftest$ac_exeext'
6368   { (eval echo "$as_me:6368: \"$ac_try\"") >&5
6369   (eval $ac_try) 2>&5
6370   ac_status=$?
6371   echo "$as_me:6371: \$? = $ac_status" >&5
6372   (exit $ac_status); }; }; then
6373   ac_cv_lib_mytinfo_tgoto=yes
6374 else
6375   echo "$as_me: failed program was:" >&5
6376 cat conftest.$ac_ext >&5
6377 ac_cv_lib_mytinfo_tgoto=no
6378 fi
6379 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6380 LIBS=$ac_check_lib_save_LIBS
6381 fi
6382 echo "$as_me:6382: result: $ac_cv_lib_mytinfo_tgoto" >&5
6383 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6384 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6385
6386 cf_add_libs="$LIBS"
6387 # reverse order
6388 cf_add_0lib=
6389 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6390 # filter duplicates
6391 for cf_add_1lib in $cf_add_0lib; do
6392         for cf_add_2lib in $cf_add_libs; do
6393                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6394                         cf_add_1lib=
6395                         break
6396                 fi
6397         done
6398         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6399 done
6400 LIBS="$cf_add_libs"
6401
6402 fi
6403
6404         ;;
6405 (hpux10.*)
6406         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6407         # next (1998), and xcurses "newer" (2000).  There is no header file for
6408         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6409         # term.h) for cur_colr
6410         if test "x$cf_cv_screen" = "xcurses_colr"
6411         then
6412                 echo "$as_me:6412: checking for initscr in -lcur_colr" >&5
6413 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6414 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6415   echo $ECHO_N "(cached) $ECHO_C" >&6
6416 else
6417   ac_check_lib_save_LIBS=$LIBS
6418 LIBS="-lcur_colr  $LIBS"
6419 cat >conftest.$ac_ext <<_ACEOF
6420 #line 6420 "configure"
6421 #include "confdefs.h"
6422
6423 /* Override any gcc2 internal prototype to avoid an error.  */
6424 #ifdef __cplusplus
6425 extern "C"
6426 #endif
6427 /* We use char because int might match the return type of a gcc2
6428    builtin and then its argument prototype would still apply.  */
6429 char initscr ();
6430 int
6431 main (void)
6432 {
6433 initscr ();
6434   ;
6435   return 0;
6436 }
6437 _ACEOF
6438 rm -f conftest.$ac_objext conftest$ac_exeext
6439 if { (eval echo "$as_me:6439: \"$ac_link\"") >&5
6440   (eval $ac_link) 2>&5
6441   ac_status=$?
6442   echo "$as_me:6442: \$? = $ac_status" >&5
6443   (exit $ac_status); } &&
6444          { ac_try='test -s conftest$ac_exeext'
6445   { (eval echo "$as_me:6445: \"$ac_try\"") >&5
6446   (eval $ac_try) 2>&5
6447   ac_status=$?
6448   echo "$as_me:6448: \$? = $ac_status" >&5
6449   (exit $ac_status); }; }; then
6450   ac_cv_lib_cur_colr_initscr=yes
6451 else
6452   echo "$as_me: failed program was:" >&5
6453 cat conftest.$ac_ext >&5
6454 ac_cv_lib_cur_colr_initscr=no
6455 fi
6456 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6457 LIBS=$ac_check_lib_save_LIBS
6458 fi
6459 echo "$as_me:6459: result: $ac_cv_lib_cur_colr_initscr" >&5
6460 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6461 if test $ac_cv_lib_cur_colr_initscr = yes; then
6462
6463 cf_add_libs="$LIBS"
6464 # reverse order
6465 cf_add_0lib=
6466 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6467 # filter duplicates
6468 for cf_add_1lib in $cf_add_0lib; do
6469         for cf_add_2lib in $cf_add_libs; do
6470                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6471                         cf_add_1lib=
6472                         break
6473                 fi
6474         done
6475         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6476 done
6477 LIBS="$cf_add_libs"
6478
6479                         ac_cv_func_initscr=yes
6480
6481 else
6482
6483                 echo "$as_me:6483: checking for initscr in -lHcurses" >&5
6484 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6485 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6486   echo $ECHO_N "(cached) $ECHO_C" >&6
6487 else
6488   ac_check_lib_save_LIBS=$LIBS
6489 LIBS="-lHcurses  $LIBS"
6490 cat >conftest.$ac_ext <<_ACEOF
6491 #line 6491 "configure"
6492 #include "confdefs.h"
6493
6494 /* Override any gcc2 internal prototype to avoid an error.  */
6495 #ifdef __cplusplus
6496 extern "C"
6497 #endif
6498 /* We use char because int might match the return type of a gcc2
6499    builtin and then its argument prototype would still apply.  */
6500 char initscr ();
6501 int
6502 main (void)
6503 {
6504 initscr ();
6505   ;
6506   return 0;
6507 }
6508 _ACEOF
6509 rm -f conftest.$ac_objext conftest$ac_exeext
6510 if { (eval echo "$as_me:6510: \"$ac_link\"") >&5
6511   (eval $ac_link) 2>&5
6512   ac_status=$?
6513   echo "$as_me:6513: \$? = $ac_status" >&5
6514   (exit $ac_status); } &&
6515          { ac_try='test -s conftest$ac_exeext'
6516   { (eval echo "$as_me:6516: \"$ac_try\"") >&5
6517   (eval $ac_try) 2>&5
6518   ac_status=$?
6519   echo "$as_me:6519: \$? = $ac_status" >&5
6520   (exit $ac_status); }; }; then
6521   ac_cv_lib_Hcurses_initscr=yes
6522 else
6523   echo "$as_me: failed program was:" >&5
6524 cat conftest.$ac_ext >&5
6525 ac_cv_lib_Hcurses_initscr=no
6526 fi
6527 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6528 LIBS=$ac_check_lib_save_LIBS
6529 fi
6530 echo "$as_me:6530: result: $ac_cv_lib_Hcurses_initscr" >&5
6531 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6532 if test $ac_cv_lib_Hcurses_initscr = yes; then
6533
6534                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6535
6536 cf_add_libs="$LIBS"
6537 # reverse order
6538 cf_add_0lib=
6539 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6540 # filter duplicates
6541 for cf_add_1lib in $cf_add_0lib; do
6542         for cf_add_2lib in $cf_add_libs; do
6543                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6544                         cf_add_1lib=
6545                         break
6546                 fi
6547         done
6548         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6549 done
6550 LIBS="$cf_add_libs"
6551
6552         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6553         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6554
6555                         ac_cv_func_initscr=yes
6556
6557 fi
6558
6559 fi
6560
6561         fi
6562         ;;
6563 (linux*)
6564         case `arch 2>/dev/null` in
6565         (x86_64)
6566                 if test -d /lib64
6567                 then
6568
6569 if test -n "/lib64" ; then
6570         for cf_add_libdir in /lib64
6571         do
6572                 if test $cf_add_libdir = /usr/lib ; then
6573                         :
6574                 elif test -d $cf_add_libdir
6575                 then
6576                         cf_have_libdir=no
6577                         if test -n "$LDFLAGS$LIBS" ; then
6578                                 # a loop is needed to ensure we can add subdirs of existing dirs
6579                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6580                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6581                                                 cf_have_libdir=yes; break
6582                                         fi
6583                                 done
6584                         fi
6585                         if test "$cf_have_libdir" = no ; then
6586                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6587
6588 echo "${as_me:-configure}:6588: testing adding $cf_add_libdir to library-path ..." 1>&5
6589
6590                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6591                         fi
6592                 fi
6593         done
6594 fi
6595
6596                 else
6597
6598 if test -n "/lib" ; then
6599         for cf_add_libdir in /lib
6600         do
6601                 if test $cf_add_libdir = /usr/lib ; then
6602                         :
6603                 elif test -d $cf_add_libdir
6604                 then
6605                         cf_have_libdir=no
6606                         if test -n "$LDFLAGS$LIBS" ; then
6607                                 # a loop is needed to ensure we can add subdirs of existing dirs
6608                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6609                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6610                                                 cf_have_libdir=yes; break
6611                                         fi
6612                                 done
6613                         fi
6614                         if test "$cf_have_libdir" = no ; then
6615                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6616
6617 echo "${as_me:-configure}:6617: testing adding $cf_add_libdir to library-path ..." 1>&5
6618
6619                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6620                         fi
6621                 fi
6622         done
6623 fi
6624
6625                 fi
6626                 ;;
6627         (*)
6628
6629 if test -n "/lib" ; then
6630         for cf_add_libdir in /lib
6631         do
6632                 if test $cf_add_libdir = /usr/lib ; then
6633                         :
6634                 elif test -d $cf_add_libdir
6635                 then
6636                         cf_have_libdir=no
6637                         if test -n "$LDFLAGS$LIBS" ; then
6638                                 # a loop is needed to ensure we can add subdirs of existing dirs
6639                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6640                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6641                                                 cf_have_libdir=yes; break
6642                                         fi
6643                                 done
6644                         fi
6645                         if test "$cf_have_libdir" = no ; then
6646                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6647
6648 echo "${as_me:-configure}:6648: testing adding $cf_add_libdir to library-path ..." 1>&5
6649
6650                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6651                         fi
6652                 fi
6653         done
6654 fi
6655
6656                 ;;
6657         esac
6658         ;;
6659 (sunos3*|sunos4*)
6660         if test "x$cf_cv_screen" = "xcurses_5lib"
6661         then
6662                 if test -d /usr/5lib ; then
6663
6664 if test -n "/usr/5lib" ; then
6665         for cf_add_libdir in /usr/5lib
6666         do
6667                 if test $cf_add_libdir = /usr/lib ; then
6668                         :
6669                 elif test -d $cf_add_libdir
6670                 then
6671                         cf_have_libdir=no
6672                         if test -n "$LDFLAGS$LIBS" ; then
6673                                 # a loop is needed to ensure we can add subdirs of existing dirs
6674                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6675                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6676                                                 cf_have_libdir=yes; break
6677                                         fi
6678                                 done
6679                         fi
6680                         if test "$cf_have_libdir" = no ; then
6681                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6682
6683 echo "${as_me:-configure}:6683: testing adding $cf_add_libdir to library-path ..." 1>&5
6684
6685                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6686                         fi
6687                 fi
6688         done
6689 fi
6690
6691 cf_add_libs="$LIBS"
6692 # reverse order
6693 cf_add_0lib=
6694 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6695 # filter duplicates
6696 for cf_add_1lib in $cf_add_0lib; do
6697         for cf_add_2lib in $cf_add_libs; do
6698                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6699                         cf_add_1lib=
6700                         break
6701                 fi
6702         done
6703         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6704 done
6705 LIBS="$cf_add_libs"
6706
6707                 fi
6708         fi
6709         ac_cv_func_initscr=yes
6710         ;;
6711 esac
6712
6713 if test ".$ac_cv_func_initscr" != .yes ; then
6714         cf_save_LIBS="$LIBS"
6715
6716         if test ".${cf_cv_ncurses_version:-no}" != .no
6717         then
6718                 cf_check_list="ncurses curses cursesX"
6719         else
6720                 cf_check_list="cursesX curses ncurses"
6721         fi
6722
6723         # Check for library containing tgoto.  Do this before curses library
6724         # because it may be needed to link the test-case for initscr.
6725         if test "x$cf_term_lib" = x
6726         then
6727                 echo "$as_me:6727: checking for tgoto" >&5
6728 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6729 if test "${ac_cv_func_tgoto+set}" = set; then
6730   echo $ECHO_N "(cached) $ECHO_C" >&6
6731 else
6732   cat >conftest.$ac_ext <<_ACEOF
6733 #line 6733 "configure"
6734 #include "confdefs.h"
6735 #define tgoto autoconf_temporary
6736 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6737 #undef tgoto
6738
6739 #ifdef __cplusplus
6740 extern "C"
6741 #endif
6742
6743 /* We use char because int might match the return type of a gcc2
6744    builtin and then its argument prototype would still apply.  */
6745 char tgoto (void);
6746
6747 int
6748 main (void)
6749 {
6750
6751 /* The GNU C library defines stubs for functions which it implements
6752     to always fail with ENOSYS.  Some functions are actually named
6753     something starting with __ and the normal name is an alias.  */
6754 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6755 #error found stub for tgoto
6756 #endif
6757
6758         return tgoto ();
6759   ;
6760   return 0;
6761 }
6762 _ACEOF
6763 rm -f conftest.$ac_objext conftest$ac_exeext
6764 if { (eval echo "$as_me:6764: \"$ac_link\"") >&5
6765   (eval $ac_link) 2>&5
6766   ac_status=$?
6767   echo "$as_me:6767: \$? = $ac_status" >&5
6768   (exit $ac_status); } &&
6769          { ac_try='test -s conftest$ac_exeext'
6770   { (eval echo "$as_me:6770: \"$ac_try\"") >&5
6771   (eval $ac_try) 2>&5
6772   ac_status=$?
6773   echo "$as_me:6773: \$? = $ac_status" >&5
6774   (exit $ac_status); }; }; then
6775   ac_cv_func_tgoto=yes
6776 else
6777   echo "$as_me: failed program was:" >&5
6778 cat conftest.$ac_ext >&5
6779 ac_cv_func_tgoto=no
6780 fi
6781 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6782 fi
6783 echo "$as_me:6783: result: $ac_cv_func_tgoto" >&5
6784 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6785 if test $ac_cv_func_tgoto = yes; then
6786   cf_term_lib=predefined
6787 else
6788
6789                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6790                         do
6791                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6792 echo "$as_me:6792: checking for tgoto in -l$cf_term_lib" >&5
6793 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6794 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6795   echo $ECHO_N "(cached) $ECHO_C" >&6
6796 else
6797   ac_check_lib_save_LIBS=$LIBS
6798 LIBS="-l$cf_term_lib  $LIBS"
6799 cat >conftest.$ac_ext <<_ACEOF
6800 #line 6800 "configure"
6801 #include "confdefs.h"
6802
6803 /* Override any gcc2 internal prototype to avoid an error.  */
6804 #ifdef __cplusplus
6805 extern "C"
6806 #endif
6807 /* We use char because int might match the return type of a gcc2
6808    builtin and then its argument prototype would still apply.  */
6809 char tgoto ();
6810 int
6811 main (void)
6812 {
6813 tgoto ();
6814   ;
6815   return 0;
6816 }
6817 _ACEOF
6818 rm -f conftest.$ac_objext conftest$ac_exeext
6819 if { (eval echo "$as_me:6819: \"$ac_link\"") >&5
6820   (eval $ac_link) 2>&5
6821   ac_status=$?
6822   echo "$as_me:6822: \$? = $ac_status" >&5
6823   (exit $ac_status); } &&
6824          { ac_try='test -s conftest$ac_exeext'
6825   { (eval echo "$as_me:6825: \"$ac_try\"") >&5
6826   (eval $ac_try) 2>&5
6827   ac_status=$?
6828   echo "$as_me:6828: \$? = $ac_status" >&5
6829   (exit $ac_status); }; }; then
6830   eval "$as_ac_Lib=yes"
6831 else
6832   echo "$as_me: failed program was:" >&5
6833 cat conftest.$ac_ext >&5
6834 eval "$as_ac_Lib=no"
6835 fi
6836 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6837 LIBS=$ac_check_lib_save_LIBS
6838 fi
6839 echo "$as_me:6839: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6840 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6841 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6842
6843                                         : ${cf_nculib_root:=$cf_term_lib}
6844                                         break
6845
6846 fi
6847
6848                         done
6849
6850 fi
6851
6852         fi
6853
6854         # Check for library containing initscr
6855         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6856         if test "x$cf_curs_lib" = x
6857         then
6858                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6859                 do
6860                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6861                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6862                                 echo "$as_me:6862: checking if we can link with $cf_curs_lib library" >&5
6863 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6864                                 cat >conftest.$ac_ext <<_ACEOF
6865 #line 6865 "configure"
6866 #include "confdefs.h"
6867 #include <${cf_cv_ncurses_header:-curses.h}>
6868 int
6869 main (void)
6870 {
6871 initscr()
6872   ;
6873   return 0;
6874 }
6875 _ACEOF
6876 rm -f conftest.$ac_objext conftest$ac_exeext
6877 if { (eval echo "$as_me:6877: \"$ac_link\"") >&5
6878   (eval $ac_link) 2>&5
6879   ac_status=$?
6880   echo "$as_me:6880: \$? = $ac_status" >&5
6881   (exit $ac_status); } &&
6882          { ac_try='test -s conftest$ac_exeext'
6883   { (eval echo "$as_me:6883: \"$ac_try\"") >&5
6884   (eval $ac_try) 2>&5
6885   ac_status=$?
6886   echo "$as_me:6886: \$? = $ac_status" >&5
6887   (exit $ac_status); }; }; then
6888   cf_result=yes
6889 else
6890   echo "$as_me: failed program was:" >&5
6891 cat conftest.$ac_ext >&5
6892 cf_result=no
6893 fi
6894 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6895                                 echo "$as_me:6895: result: $cf_result" >&5
6896 echo "${ECHO_T}$cf_result" >&6
6897                                 test $cf_result = yes && break
6898                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6899                                 cf_result=no
6900                         elif test "$cf_term_lib" != predefined ; then
6901                                 echo "$as_me:6901: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6902 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6903                                 cat >conftest.$ac_ext <<_ACEOF
6904 #line 6904 "configure"
6905 #include "confdefs.h"
6906 #include <${cf_cv_ncurses_header:-curses.h}>
6907 int
6908 main (void)
6909 {
6910 initscr(); tgoto((char *)0, 0, 0);
6911   ;
6912   return 0;
6913 }
6914 _ACEOF
6915 rm -f conftest.$ac_objext conftest$ac_exeext
6916 if { (eval echo "$as_me:6916: \"$ac_link\"") >&5
6917   (eval $ac_link) 2>&5
6918   ac_status=$?
6919   echo "$as_me:6919: \$? = $ac_status" >&5
6920   (exit $ac_status); } &&
6921          { ac_try='test -s conftest$ac_exeext'
6922   { (eval echo "$as_me:6922: \"$ac_try\"") >&5
6923   (eval $ac_try) 2>&5
6924   ac_status=$?
6925   echo "$as_me:6925: \$? = $ac_status" >&5
6926   (exit $ac_status); }; }; then
6927   cf_result=no
6928 else
6929   echo "$as_me: failed program was:" >&5
6930 cat conftest.$ac_ext >&5
6931
6932                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6933                                         cat >conftest.$ac_ext <<_ACEOF
6934 #line 6934 "configure"
6935 #include "confdefs.h"
6936 #include <${cf_cv_ncurses_header:-curses.h}>
6937 int
6938 main (void)
6939 {
6940 initscr()
6941   ;
6942   return 0;
6943 }
6944 _ACEOF
6945 rm -f conftest.$ac_objext conftest$ac_exeext
6946 if { (eval echo "$as_me:6946: \"$ac_link\"") >&5
6947   (eval $ac_link) 2>&5
6948   ac_status=$?
6949   echo "$as_me:6949: \$? = $ac_status" >&5
6950   (exit $ac_status); } &&
6951          { ac_try='test -s conftest$ac_exeext'
6952   { (eval echo "$as_me:6952: \"$ac_try\"") >&5
6953   (eval $ac_try) 2>&5
6954   ac_status=$?
6955   echo "$as_me:6955: \$? = $ac_status" >&5
6956   (exit $ac_status); }; }; then
6957   cf_result=yes
6958 else
6959   echo "$as_me: failed program was:" >&5
6960 cat conftest.$ac_ext >&5
6961 cf_result=error
6962 fi
6963 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6964
6965 fi
6966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6967                                 echo "$as_me:6967: result: $cf_result" >&5
6968 echo "${ECHO_T}$cf_result" >&6
6969                                 test $cf_result != error && break
6970                         fi
6971                 done
6972         fi
6973         test $cf_curs_lib = unknown && { { echo "$as_me:6973: error: no curses library found" >&5
6974 echo "$as_me: error: no curses library found" >&2;}
6975    { (exit 1); exit 1; }; }
6976 fi
6977 fi
6978
6979         ;;
6980 (ncursesw*)
6981
6982 echo "$as_me:6982: checking for multibyte character support" >&5
6983 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6984 if test "${cf_cv_utf8_lib+set}" = set; then
6985   echo $ECHO_N "(cached) $ECHO_C" >&6
6986 else
6987
6988         cf_save_LIBS="$LIBS"
6989         cat >conftest.$ac_ext <<_ACEOF
6990 #line 6990 "configure"
6991 #include "confdefs.h"
6992
6993 #include <stdlib.h>
6994 int
6995 main (void)
6996 {
6997 putwc(0,0);
6998   ;
6999   return 0;
7000 }
7001 _ACEOF
7002 rm -f conftest.$ac_objext conftest$ac_exeext
7003 if { (eval echo "$as_me:7003: \"$ac_link\"") >&5
7004   (eval $ac_link) 2>&5
7005   ac_status=$?
7006   echo "$as_me:7006: \$? = $ac_status" >&5
7007   (exit $ac_status); } &&
7008          { ac_try='test -s conftest$ac_exeext'
7009   { (eval echo "$as_me:7009: \"$ac_try\"") >&5
7010   (eval $ac_try) 2>&5
7011   ac_status=$?
7012   echo "$as_me:7012: \$? = $ac_status" >&5
7013   (exit $ac_status); }; }; then
7014   cf_cv_utf8_lib=yes
7015 else
7016   echo "$as_me: failed program was:" >&5
7017 cat conftest.$ac_ext >&5
7018
7019 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7020 # will be set on completion of the AC_TRY_LINK below.
7021 cf_cv_header_path_utf8=
7022 cf_cv_library_path_utf8=
7023
7024 echo "${as_me:-configure}:7024: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7025
7026 cf_save_LIBS="$LIBS"
7027
7028 cat >conftest.$ac_ext <<_ACEOF
7029 #line 7029 "configure"
7030 #include "confdefs.h"
7031
7032 #include <libutf8.h>
7033 int
7034 main (void)
7035 {
7036 putwc(0,0);
7037   ;
7038   return 0;
7039 }
7040 _ACEOF
7041 rm -f conftest.$ac_objext conftest$ac_exeext
7042 if { (eval echo "$as_me:7042: \"$ac_link\"") >&5
7043   (eval $ac_link) 2>&5
7044   ac_status=$?
7045   echo "$as_me:7045: \$? = $ac_status" >&5
7046   (exit $ac_status); } &&
7047          { ac_try='test -s conftest$ac_exeext'
7048   { (eval echo "$as_me:7048: \"$ac_try\"") >&5
7049   (eval $ac_try) 2>&5
7050   ac_status=$?
7051   echo "$as_me:7051: \$? = $ac_status" >&5
7052   (exit $ac_status); }; }; then
7053
7054         cf_cv_find_linkage_utf8=yes
7055         cf_cv_header_path_utf8=/usr/include
7056         cf_cv_library_path_utf8=/usr/lib
7057
7058 else
7059   echo "$as_me: failed program was:" >&5
7060 cat conftest.$ac_ext >&5
7061
7062 LIBS="-lutf8  $cf_save_LIBS"
7063
7064 cat >conftest.$ac_ext <<_ACEOF
7065 #line 7065 "configure"
7066 #include "confdefs.h"
7067
7068 #include <libutf8.h>
7069 int
7070 main (void)
7071 {
7072 putwc(0,0);
7073   ;
7074   return 0;
7075 }
7076 _ACEOF
7077 rm -f conftest.$ac_objext conftest$ac_exeext
7078 if { (eval echo "$as_me:7078: \"$ac_link\"") >&5
7079   (eval $ac_link) 2>&5
7080   ac_status=$?
7081   echo "$as_me:7081: \$? = $ac_status" >&5
7082   (exit $ac_status); } &&
7083          { ac_try='test -s conftest$ac_exeext'
7084   { (eval echo "$as_me:7084: \"$ac_try\"") >&5
7085   (eval $ac_try) 2>&5
7086   ac_status=$?
7087   echo "$as_me:7087: \$? = $ac_status" >&5
7088   (exit $ac_status); }; }; then
7089
7090         cf_cv_find_linkage_utf8=yes
7091         cf_cv_header_path_utf8=/usr/include
7092         cf_cv_library_path_utf8=/usr/lib
7093         cf_cv_library_file_utf8="-lutf8"
7094
7095 else
7096   echo "$as_me: failed program was:" >&5
7097 cat conftest.$ac_ext >&5
7098
7099         cf_cv_find_linkage_utf8=no
7100         LIBS="$cf_save_LIBS"
7101
7102         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7103
7104 echo "${as_me:-configure}:7104: testing find linkage for utf8 library ..." 1>&5
7105
7106 echo "${as_me:-configure}:7106: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7107
7108         cf_save_CPPFLAGS="$CPPFLAGS"
7109         cf_test_CPPFLAGS="$CPPFLAGS"
7110
7111 cf_search=
7112
7113 # collect the current set of include-directories from compiler flags
7114 cf_header_path_list=""
7115 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7116         for cf_header_path in $CPPFLAGS $CFLAGS
7117         do
7118                 case $cf_header_path in
7119                 (-I*)
7120                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7121
7122 test "x$cf_header_path" != "xNONE" && \
7123 test -d "$cf_header_path" && \
7124  {
7125         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7126         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7127         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7128         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7129         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7130         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7131 }
7132
7133                         cf_header_path_list="$cf_header_path_list $cf_search"
7134                         ;;
7135                 esac
7136         done
7137 fi
7138
7139 # add the variations for the package we are looking for
7140
7141 cf_search=
7142
7143 test "x$prefix" != "xNONE" && \
7144 test -d "$prefix" && \
7145  {
7146         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7147         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7148         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7149         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7150         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7151         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7152 }
7153
7154 for cf_subdir_prefix in \
7155         /usr \
7156         /usr/local \
7157         /usr/pkg \
7158         /opt \
7159         /opt/local \
7160         $HOME
7161 do
7162
7163 test "x$cf_subdir_prefix" != "x$prefix" && \
7164 test -d "$cf_subdir_prefix" && \
7165 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7166         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7167         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7168         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7169         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7170         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7171         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7172 }
7173
7174 done
7175
7176 test "$includedir" != NONE && \
7177 test "$includedir" != "/usr/include" && \
7178 test -d "$includedir" && {
7179         test -d $includedir &&    cf_search="$cf_search $includedir"
7180         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7181 }
7182
7183 test "$oldincludedir" != NONE && \
7184 test "$oldincludedir" != "/usr/include" && \
7185 test -d "$oldincludedir" && {
7186         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7187         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7188 }
7189
7190 cf_search="$cf_search $cf_header_path_list"
7191
7192         for cf_cv_header_path_utf8 in $cf_search
7193         do
7194                 if test -d $cf_cv_header_path_utf8 ; then
7195                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7196
7197 echo "${as_me:-configure}:7197: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7198
7199                         CPPFLAGS="$cf_save_CPPFLAGS"
7200
7201         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7202         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7203
7204                         cat >conftest.$ac_ext <<_ACEOF
7205 #line 7205 "configure"
7206 #include "confdefs.h"
7207
7208 #include <libutf8.h>
7209 int
7210 main (void)
7211 {
7212 putwc(0,0);
7213   ;
7214   return 0;
7215 }
7216 _ACEOF
7217 rm -f conftest.$ac_objext
7218 if { (eval echo "$as_me:7218: \"$ac_compile\"") >&5
7219   (eval $ac_compile) 2>&5
7220   ac_status=$?
7221   echo "$as_me:7221: \$? = $ac_status" >&5
7222   (exit $ac_status); } &&
7223          { ac_try='test -s conftest.$ac_objext'
7224   { (eval echo "$as_me:7224: \"$ac_try\"") >&5
7225   (eval $ac_try) 2>&5
7226   ac_status=$?
7227   echo "$as_me:7227: \$? = $ac_status" >&5
7228   (exit $ac_status); }; }; then
7229
7230                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7231
7232 echo "${as_me:-configure}:7232: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7233
7234                                 cf_cv_find_linkage_utf8=maybe
7235                                 cf_test_CPPFLAGS="$CPPFLAGS"
7236                                 break
7237 else
7238   echo "$as_me: failed program was:" >&5
7239 cat conftest.$ac_ext >&5
7240
7241                                 CPPFLAGS="$cf_save_CPPFLAGS"
7242
7243 fi
7244 rm -f conftest.$ac_objext conftest.$ac_ext
7245                 fi
7246         done
7247
7248         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7249
7250 echo "${as_me:-configure}:7250: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7251
7252                 cf_save_LIBS="$LIBS"
7253                 cf_save_LDFLAGS="$LDFLAGS"
7254
7255                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7256
7257 cf_search=
7258 cf_library_path_list=""
7259 if test -n "${LDFLAGS}${LIBS}" ; then
7260         for cf_library_path in $LDFLAGS $LIBS
7261         do
7262                 case $cf_library_path in
7263                 (-L*)
7264                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7265
7266 test "x$cf_library_path" != "xNONE" && \
7267 test -d "$cf_library_path" && \
7268  {
7269         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7270         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7271         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7272         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7273         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7274         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7275 }
7276
7277                         cf_library_path_list="$cf_library_path_list $cf_search"
7278                         ;;
7279                 esac
7280         done
7281 fi
7282
7283 cf_search=
7284
7285 test "x$prefix" != "xNONE" && \
7286 test -d "$prefix" && \
7287  {
7288         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7289         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7290         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7291         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7292         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7293         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7294 }
7295
7296 for cf_subdir_prefix in \
7297         /usr \
7298         /usr/local \
7299         /usr/pkg \
7300         /opt \
7301         /opt/local \
7302         $HOME
7303 do
7304
7305 test "x$cf_subdir_prefix" != "x$prefix" && \
7306 test -d "$cf_subdir_prefix" && \
7307 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7308         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7309         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7310         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7311         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7312         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7313         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7314 }
7315
7316 done
7317
7318 cf_search="$cf_library_path_list $cf_search"
7319
7320                         for cf_cv_library_path_utf8 in $cf_search
7321                         do
7322                                 if test -d $cf_cv_library_path_utf8 ; then
7323                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7324
7325 echo "${as_me:-configure}:7325: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7326
7327                                         CPPFLAGS="$cf_test_CPPFLAGS"
7328                                         LIBS="-lutf8  $cf_save_LIBS"
7329                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7330                                         cat >conftest.$ac_ext <<_ACEOF
7331 #line 7331 "configure"
7332 #include "confdefs.h"
7333
7334 #include <libutf8.h>
7335 int
7336 main (void)
7337 {
7338 putwc(0,0);
7339   ;
7340   return 0;
7341 }
7342 _ACEOF
7343 rm -f conftest.$ac_objext conftest$ac_exeext
7344 if { (eval echo "$as_me:7344: \"$ac_link\"") >&5
7345   (eval $ac_link) 2>&5
7346   ac_status=$?
7347   echo "$as_me:7347: \$? = $ac_status" >&5
7348   (exit $ac_status); } &&
7349          { ac_try='test -s conftest$ac_exeext'
7350   { (eval echo "$as_me:7350: \"$ac_try\"") >&5
7351   (eval $ac_try) 2>&5
7352   ac_status=$?
7353   echo "$as_me:7353: \$? = $ac_status" >&5
7354   (exit $ac_status); }; }; then
7355
7356                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7357
7358 echo "${as_me:-configure}:7358: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7359
7360                                         cf_cv_find_linkage_utf8=yes
7361                                         cf_cv_library_file_utf8="-lutf8"
7362                                         break
7363 else
7364   echo "$as_me: failed program was:" >&5
7365 cat conftest.$ac_ext >&5
7366
7367                                         CPPFLAGS="$cf_save_CPPFLAGS"
7368                                         LIBS="$cf_save_LIBS"
7369                                         LDFLAGS="$cf_save_LDFLAGS"
7370
7371 fi
7372 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7373                                 fi
7374                         done
7375                         CPPFLAGS="$cf_save_CPPFLAGS"
7376                         LDFLAGS="$cf_save_LDFLAGS"
7377                 fi
7378
7379         else
7380                 cf_cv_find_linkage_utf8=no
7381         fi
7382
7383 fi
7384 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7385
7386 fi
7387 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7388
7389 LIBS="$cf_save_LIBS"
7390
7391 if test "$cf_cv_find_linkage_utf8" = yes ; then
7392 cf_cv_utf8_lib=add-on
7393 else
7394 cf_cv_utf8_lib=no
7395 fi
7396
7397 fi
7398 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7399 fi
7400 echo "$as_me:7400: result: $cf_cv_utf8_lib" >&5
7401 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7402
7403 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7404 # ncurses/ncursesw:
7405 if test "$cf_cv_utf8_lib" = "add-on" ; then
7406
7407 cat >>confdefs.h <<\EOF
7408 #define HAVE_LIBUTF8_H 1
7409 EOF
7410
7411 if test -n "$cf_cv_header_path_utf8" ; then
7412   for cf_add_incdir in $cf_cv_header_path_utf8
7413   do
7414         while test $cf_add_incdir != /usr/include
7415         do
7416           if test -d $cf_add_incdir
7417           then
7418                 cf_have_incdir=no
7419                 if test -n "$CFLAGS$CPPFLAGS" ; then
7420                   # a loop is needed to ensure we can add subdirs of existing dirs
7421                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7422                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7423                           cf_have_incdir=yes; break
7424                         fi
7425                   done
7426                 fi
7427
7428                 if test "$cf_have_incdir" = no ; then
7429                   if test "$cf_add_incdir" = /usr/local/include ; then
7430                         if test "$GCC" = yes
7431                         then
7432                           cf_save_CPPFLAGS=$CPPFLAGS
7433
7434         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7435         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7436
7437                           cat >conftest.$ac_ext <<_ACEOF
7438 #line 7438 "configure"
7439 #include "confdefs.h"
7440 #include <stdio.h>
7441 int
7442 main (void)
7443 {
7444 printf("Hello")
7445   ;
7446   return 0;
7447 }
7448 _ACEOF
7449 rm -f conftest.$ac_objext
7450 if { (eval echo "$as_me:7450: \"$ac_compile\"") >&5
7451   (eval $ac_compile) 2>&5
7452   ac_status=$?
7453   echo "$as_me:7453: \$? = $ac_status" >&5
7454   (exit $ac_status); } &&
7455          { ac_try='test -s conftest.$ac_objext'
7456   { (eval echo "$as_me:7456: \"$ac_try\"") >&5
7457   (eval $ac_try) 2>&5
7458   ac_status=$?
7459   echo "$as_me:7459: \$? = $ac_status" >&5
7460   (exit $ac_status); }; }; then
7461   :
7462 else
7463   echo "$as_me: failed program was:" >&5
7464 cat conftest.$ac_ext >&5
7465 cf_have_incdir=yes
7466 fi
7467 rm -f conftest.$ac_objext conftest.$ac_ext
7468                           CPPFLAGS=$cf_save_CPPFLAGS
7469                         fi
7470                   fi
7471                 fi
7472
7473                 if test "$cf_have_incdir" = no ; then
7474                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7475
7476 echo "${as_me:-configure}:7476: testing adding $cf_add_incdir to include-path ..." 1>&5
7477
7478                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7479
7480                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7481                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7482                   cf_add_incdir="$cf_top_incdir"
7483                 else
7484                   break
7485                 fi
7486           else
7487                 break
7488           fi
7489         done
7490   done
7491 fi
7492
7493 if test -n "$cf_cv_library_path_utf8" ; then
7494         for cf_add_libdir in $cf_cv_library_path_utf8
7495         do
7496                 if test $cf_add_libdir = /usr/lib ; then
7497                         :
7498                 elif test -d $cf_add_libdir
7499                 then
7500                         cf_have_libdir=no
7501                         if test -n "$LDFLAGS$LIBS" ; then
7502                                 # a loop is needed to ensure we can add subdirs of existing dirs
7503                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7504                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7505                                                 cf_have_libdir=yes; break
7506                                         fi
7507                                 done
7508                         fi
7509                         if test "$cf_have_libdir" = no ; then
7510                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7511
7512 echo "${as_me:-configure}:7512: testing adding $cf_add_libdir to library-path ..." 1>&5
7513
7514                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7515                         fi
7516                 fi
7517         done
7518 fi
7519
7520 cf_add_libs="$LIBS"
7521 # reverse order
7522 cf_add_0lib=
7523 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7524 # filter duplicates
7525 for cf_add_1lib in $cf_add_0lib; do
7526         for cf_add_2lib in $cf_add_libs; do
7527                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7528                         cf_add_1lib=
7529                         break
7530                 fi
7531         done
7532         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7533 done
7534 LIBS="$cf_add_libs"
7535
7536 fi
7537
7538 cf_ncuconfig_root=$cf_cv_screen
7539 cf_have_ncuconfig=no
7540
7541 if test "x${PKG_CONFIG:=none}" != xnone; then
7542         echo "$as_me:7542: checking pkg-config for $cf_ncuconfig_root" >&5
7543 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7544         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7545                 echo "$as_me:7545: result: yes" >&5
7546 echo "${ECHO_T}yes" >&6
7547
7548                 echo "$as_me:7548: checking if the $cf_ncuconfig_root package files work" >&5
7549 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7550                 cf_have_ncuconfig=unknown
7551
7552                 cf_save_CFLAGS="$CFLAGS"
7553                 cf_save_CPPFLAGS="$CPPFLAGS"
7554                 cf_save_LIBS="$LIBS"
7555
7556                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
7557                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
7558
7559                 # while -W for passing linker flags is prevalent, it is not "standard".
7560                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7561                 # incompatible _and_ non-standard -W option which gives an error.  Work
7562                 # around that pitfall.
7563                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7564                 (x*c[89]9@@*-W*)
7565
7566 cf_fix_cppflags=no
7567 cf_new_cflags=
7568 cf_new_cppflags=
7569 cf_new_extra_cppflags=
7570
7571 for cf_add_cflags in $cf_pkg_cflags
7572 do
7573 case $cf_fix_cppflags in
7574 (no)
7575         case $cf_add_cflags in
7576         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7577                 case $cf_add_cflags in
7578                 (-D*)
7579                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7580
7581                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7582                                 && test -z "${cf_tst_cflags}" \
7583                                 && cf_fix_cppflags=yes
7584
7585                         if test $cf_fix_cppflags = yes ; then
7586
7587         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7588         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7589
7590                                 continue
7591                         elif test "${cf_tst_cflags}" = "\"'" ; then
7592
7593         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7594         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7595
7596                                 continue
7597                         fi
7598                         ;;
7599                 esac
7600                 case "$CPPFLAGS" in
7601                 (*$cf_add_cflags)
7602                         ;;
7603                 (*)
7604                         case $cf_add_cflags in
7605                         (-D*)
7606                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7607
7608 CPPFLAGS=`echo "$CPPFLAGS" | \
7609         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7610                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7611
7612                                 ;;
7613                         esac
7614
7615         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7616         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7617
7618                         ;;
7619                 esac
7620                 ;;
7621         (*)
7622
7623         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7624         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7625
7626                 ;;
7627         esac
7628         ;;
7629 (yes)
7630
7631         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7632         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7633
7634         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7635
7636         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7637                 && test -z "${cf_tst_cflags}" \
7638                 && cf_fix_cppflags=no
7639         ;;
7640 esac
7641 done
7642
7643 if test -n "$cf_new_cflags" ; then
7644
7645         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7646         CFLAGS="${CFLAGS}$cf_new_cflags"
7647
7648 fi
7649
7650 if test -n "$cf_new_cppflags" ; then
7651
7652         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7653         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7654
7655 fi
7656
7657 if test -n "$cf_new_extra_cppflags" ; then
7658
7659         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7660         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7661
7662 fi
7663
7664 cf_add_libs="$LIBS"
7665 # reverse order
7666 cf_add_0lib=
7667 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7668 # filter duplicates
7669 for cf_add_1lib in $cf_add_0lib; do
7670         for cf_add_2lib in $cf_add_libs; do
7671                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7672                         cf_add_1lib=
7673                         break
7674                 fi
7675         done
7676         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7677 done
7678 LIBS="$cf_add_libs"
7679
7680                         cat >conftest.$ac_ext <<_ACEOF
7681 #line 7681 "configure"
7682 #include "confdefs.h"
7683 #include <${cf_cv_ncurses_header:-curses.h}>
7684 int
7685 main (void)
7686 {
7687 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7688   ;
7689   return 0;
7690 }
7691 _ACEOF
7692 rm -f conftest.$ac_objext conftest$ac_exeext
7693 if { (eval echo "$as_me:7693: \"$ac_link\"") >&5
7694   (eval $ac_link) 2>&5
7695   ac_status=$?
7696   echo "$as_me:7696: \$? = $ac_status" >&5
7697   (exit $ac_status); } &&
7698          { ac_try='test -s conftest$ac_exeext'
7699   { (eval echo "$as_me:7699: \"$ac_try\"") >&5
7700   (eval $ac_try) 2>&5
7701   ac_status=$?
7702   echo "$as_me:7702: \$? = $ac_status" >&5
7703   (exit $ac_status); }; }; then
7704   if test "$cross_compiling" = yes; then
7705   cf_test_ncuconfig=maybe
7706 else
7707   cat >conftest.$ac_ext <<_ACEOF
7708 #line 7708 "configure"
7709 #include "confdefs.h"
7710 #include <${cf_cv_ncurses_header:-curses.h}>
7711                                         int main(void)
7712                                         { char *xx = curses_version(); return (xx == 0); }
7713 _ACEOF
7714 rm -f conftest$ac_exeext
7715 if { (eval echo "$as_me:7715: \"$ac_link\"") >&5
7716   (eval $ac_link) 2>&5
7717   ac_status=$?
7718   echo "$as_me:7718: \$? = $ac_status" >&5
7719   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7720   { (eval echo "$as_me:7720: \"$ac_try\"") >&5
7721   (eval $ac_try) 2>&5
7722   ac_status=$?
7723   echo "$as_me:7723: \$? = $ac_status" >&5
7724   (exit $ac_status); }; }; then
7725   cf_test_ncuconfig=yes
7726 else
7727   echo "$as_me: program exited with status $ac_status" >&5
7728 echo "$as_me: failed program was:" >&5
7729 cat conftest.$ac_ext >&5
7730 cf_test_ncuconfig=no
7731 fi
7732 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7733 fi
7734 else
7735   echo "$as_me: failed program was:" >&5
7736 cat conftest.$ac_ext >&5
7737 cf_test_ncuconfig=no
7738 fi
7739 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7740
7741                         CFLAGS="$cf_save_CFLAGS"
7742                         CPPFLAGS="$cf_save_CPPFLAGS"
7743                         LIBS="$cf_save_LIBS"
7744
7745                         if test "x$cf_test_ncuconfig" != xyes; then
7746                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7747                                 cf_pkg_cflags="$cf_temp"
7748                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7749                                 cf_pkg_libs="$cf_temp"
7750                         fi
7751                         ;;
7752                 esac
7753
7754 cf_fix_cppflags=no
7755 cf_new_cflags=
7756 cf_new_cppflags=
7757 cf_new_extra_cppflags=
7758
7759 for cf_add_cflags in $cf_pkg_cflags
7760 do
7761 case $cf_fix_cppflags in
7762 (no)
7763         case $cf_add_cflags in
7764         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7765                 case $cf_add_cflags in
7766                 (-D*)
7767                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7768
7769                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7770                                 && test -z "${cf_tst_cflags}" \
7771                                 && cf_fix_cppflags=yes
7772
7773                         if test $cf_fix_cppflags = yes ; then
7774
7775         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7776         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7777
7778                                 continue
7779                         elif test "${cf_tst_cflags}" = "\"'" ; then
7780
7781         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7782         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7783
7784                                 continue
7785                         fi
7786                         ;;
7787                 esac
7788                 case "$CPPFLAGS" in
7789                 (*$cf_add_cflags)
7790                         ;;
7791                 (*)
7792                         case $cf_add_cflags in
7793                         (-D*)
7794                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7795
7796 CPPFLAGS=`echo "$CPPFLAGS" | \
7797         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7798                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7799
7800                                 ;;
7801                         esac
7802
7803         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7804         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7805
7806                         ;;
7807                 esac
7808                 ;;
7809         (*)
7810
7811         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7812         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7813
7814                 ;;
7815         esac
7816         ;;
7817 (yes)
7818
7819         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7820         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7821
7822         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7823
7824         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7825                 && test -z "${cf_tst_cflags}" \
7826                 && cf_fix_cppflags=no
7827         ;;
7828 esac
7829 done
7830
7831 if test -n "$cf_new_cflags" ; then
7832
7833         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7834         CFLAGS="${CFLAGS}$cf_new_cflags"
7835
7836 fi
7837
7838 if test -n "$cf_new_cppflags" ; then
7839
7840         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7841         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7842
7843 fi
7844
7845 if test -n "$cf_new_extra_cppflags" ; then
7846
7847         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7848         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7849
7850 fi
7851
7852 cf_add_libs="$LIBS"
7853 # reverse order
7854 cf_add_0lib=
7855 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7856 # filter duplicates
7857 for cf_add_1lib in $cf_add_0lib; do
7858         for cf_add_2lib in $cf_add_libs; do
7859                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7860                         cf_add_1lib=
7861                         break
7862                 fi
7863         done
7864         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7865 done
7866 LIBS="$cf_add_libs"
7867
7868                 cat >conftest.$ac_ext <<_ACEOF
7869 #line 7869 "configure"
7870 #include "confdefs.h"
7871 #include <${cf_cv_ncurses_header:-curses.h}>
7872 int
7873 main (void)
7874 {
7875 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7876   ;
7877   return 0;
7878 }
7879 _ACEOF
7880 rm -f conftest.$ac_objext conftest$ac_exeext
7881 if { (eval echo "$as_me:7881: \"$ac_link\"") >&5
7882   (eval $ac_link) 2>&5
7883   ac_status=$?
7884   echo "$as_me:7884: \$? = $ac_status" >&5
7885   (exit $ac_status); } &&
7886          { ac_try='test -s conftest$ac_exeext'
7887   { (eval echo "$as_me:7887: \"$ac_try\"") >&5
7888   (eval $ac_try) 2>&5
7889   ac_status=$?
7890   echo "$as_me:7890: \$? = $ac_status" >&5
7891   (exit $ac_status); }; }; then
7892   if test "$cross_compiling" = yes; then
7893   cf_have_ncuconfig=maybe
7894 else
7895   cat >conftest.$ac_ext <<_ACEOF
7896 #line 7896 "configure"
7897 #include "confdefs.h"
7898 #include <${cf_cv_ncurses_header:-curses.h}>
7899                                 int main(void)
7900                                 { char *xx = curses_version(); return (xx == 0); }
7901 _ACEOF
7902 rm -f conftest$ac_exeext
7903 if { (eval echo "$as_me:7903: \"$ac_link\"") >&5
7904   (eval $ac_link) 2>&5
7905   ac_status=$?
7906   echo "$as_me:7906: \$? = $ac_status" >&5
7907   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7908   { (eval echo "$as_me:7908: \"$ac_try\"") >&5
7909   (eval $ac_try) 2>&5
7910   ac_status=$?
7911   echo "$as_me:7911: \$? = $ac_status" >&5
7912   (exit $ac_status); }; }; then
7913   cf_have_ncuconfig=yes
7914 else
7915   echo "$as_me: program exited with status $ac_status" >&5
7916 echo "$as_me: failed program was:" >&5
7917 cat conftest.$ac_ext >&5
7918 cf_have_ncuconfig=no
7919 fi
7920 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7921 fi
7922 else
7923   echo "$as_me: failed program was:" >&5
7924 cat conftest.$ac_ext >&5
7925 cf_have_ncuconfig=no
7926 fi
7927 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7928                 echo "$as_me:7928: result: $cf_have_ncuconfig" >&5
7929 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7930                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7931                 if test "$cf_have_ncuconfig" != "yes"
7932                 then
7933                         CPPFLAGS="$cf_save_CPPFLAGS"
7934                         LIBS="$cf_save_LIBS"
7935                         NCURSES_CONFIG_PKG=none
7936                 else
7937
7938 cat >>confdefs.h <<\EOF
7939 #define NCURSES 1
7940 EOF
7941
7942                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7943
7944 echo "$as_me:7944: checking for terminfo header" >&5
7945 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7946 if test "${cf_cv_term_header+set}" = set; then
7947   echo $ECHO_N "(cached) $ECHO_C" >&6
7948 else
7949
7950 case ${cf_cv_ncurses_header} in
7951 (*/ncurses.h|*/ncursesw.h)
7952         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7953         ;;
7954 (*)
7955         cf_term_header=term.h
7956         ;;
7957 esac
7958
7959 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7960 do
7961 cat >conftest.$ac_ext <<_ACEOF
7962 #line 7962 "configure"
7963 #include "confdefs.h"
7964 #include <stdio.h>
7965 #include <${cf_cv_ncurses_header:-curses.h}>
7966 #include <$cf_test>
7967
7968 int
7969 main (void)
7970 {
7971 int x = auto_left_margin
7972   ;
7973   return 0;
7974 }
7975 _ACEOF
7976 rm -f conftest.$ac_objext
7977 if { (eval echo "$as_me:7977: \"$ac_compile\"") >&5
7978   (eval $ac_compile) 2>&5
7979   ac_status=$?
7980   echo "$as_me:7980: \$? = $ac_status" >&5
7981   (exit $ac_status); } &&
7982          { ac_try='test -s conftest.$ac_objext'
7983   { (eval echo "$as_me:7983: \"$ac_try\"") >&5
7984   (eval $ac_try) 2>&5
7985   ac_status=$?
7986   echo "$as_me:7986: \$? = $ac_status" >&5
7987   (exit $ac_status); }; }; then
7988
7989         cf_cv_term_header="$cf_test"
7990 else
7991   echo "$as_me: failed program was:" >&5
7992 cat conftest.$ac_ext >&5
7993
7994         cf_cv_term_header=unknown
7995
7996 fi
7997 rm -f conftest.$ac_objext conftest.$ac_ext
7998         test "$cf_cv_term_header" != unknown && break
7999 done
8000
8001 fi
8002 echo "$as_me:8002: result: $cf_cv_term_header" >&5
8003 echo "${ECHO_T}$cf_cv_term_header" >&6
8004
8005 # Set definitions to allow ifdef'ing to accommodate subdirectories
8006
8007 case $cf_cv_term_header in
8008 (*term.h)
8009
8010 cat >>confdefs.h <<\EOF
8011 #define HAVE_TERM_H 1
8012 EOF
8013
8014         ;;
8015 esac
8016
8017 case $cf_cv_term_header in
8018 (ncurses/term.h)
8019
8020 cat >>confdefs.h <<\EOF
8021 #define HAVE_NCURSES_TERM_H 1
8022 EOF
8023
8024         ;;
8025 (ncursesw/term.h)
8026
8027 cat >>confdefs.h <<\EOF
8028 #define HAVE_NCURSESW_TERM_H 1
8029 EOF
8030
8031         ;;
8032 esac
8033
8034                 fi
8035
8036         else
8037                 echo "$as_me:8037: result: no" >&5
8038 echo "${ECHO_T}no" >&6
8039                 NCURSES_CONFIG_PKG=none
8040         fi
8041 else
8042         NCURSES_CONFIG_PKG=none
8043 fi
8044
8045 if test "x$cf_have_ncuconfig" = "xno"; then
8046         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8047
8048 if test -n "$ac_tool_prefix"; then
8049   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8050   do
8051     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8052 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8053 echo "$as_me:8053: checking for $ac_word" >&5
8054 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8055 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8056   echo $ECHO_N "(cached) $ECHO_C" >&6
8057 else
8058   if test -n "$NCURSES_CONFIG"; then
8059   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8060 else
8061   ac_save_IFS=$IFS; IFS=$ac_path_separator
8062 ac_dummy="$PATH"
8063 for ac_dir in $ac_dummy; do
8064   IFS=$ac_save_IFS
8065   test -z "$ac_dir" && ac_dir=.
8066   $as_executable_p "$ac_dir/$ac_word" || continue
8067 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8068 echo "$as_me:8068: found $ac_dir/$ac_word" >&5
8069 break
8070 done
8071
8072 fi
8073 fi
8074 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8075 if test -n "$NCURSES_CONFIG"; then
8076   echo "$as_me:8076: result: $NCURSES_CONFIG" >&5
8077 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8078 else
8079   echo "$as_me:8079: result: no" >&5
8080 echo "${ECHO_T}no" >&6
8081 fi
8082
8083     test -n "$NCURSES_CONFIG" && break
8084   done
8085 fi
8086 if test -z "$NCURSES_CONFIG"; then
8087   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8088   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8089 do
8090   # Extract the first word of "$ac_prog", so it can be a program name with args.
8091 set dummy $ac_prog; ac_word=$2
8092 echo "$as_me:8092: checking for $ac_word" >&5
8093 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8094 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8095   echo $ECHO_N "(cached) $ECHO_C" >&6
8096 else
8097   if test -n "$ac_ct_NCURSES_CONFIG"; then
8098   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8099 else
8100   ac_save_IFS=$IFS; IFS=$ac_path_separator
8101 ac_dummy="$PATH"
8102 for ac_dir in $ac_dummy; do
8103   IFS=$ac_save_IFS
8104   test -z "$ac_dir" && ac_dir=.
8105   $as_executable_p "$ac_dir/$ac_word" || continue
8106 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8107 echo "$as_me:8107: found $ac_dir/$ac_word" >&5
8108 break
8109 done
8110
8111 fi
8112 fi
8113 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8114 if test -n "$ac_ct_NCURSES_CONFIG"; then
8115   echo "$as_me:8115: result: $ac_ct_NCURSES_CONFIG" >&5
8116 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8117 else
8118   echo "$as_me:8118: result: no" >&5
8119 echo "${ECHO_T}no" >&6
8120 fi
8121
8122   test -n "$ac_ct_NCURSES_CONFIG" && break
8123 done
8124 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8125
8126   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8127 fi
8128
8129         if test "$NCURSES_CONFIG" != none ; then
8130
8131 cf_fix_cppflags=no
8132 cf_new_cflags=
8133 cf_new_cppflags=
8134 cf_new_extra_cppflags=
8135
8136 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8137 do
8138 case $cf_fix_cppflags in
8139 (no)
8140         case $cf_add_cflags in
8141         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8142                 case $cf_add_cflags in
8143                 (-D*)
8144                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8145
8146                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8147                                 && test -z "${cf_tst_cflags}" \
8148                                 && cf_fix_cppflags=yes
8149
8150                         if test $cf_fix_cppflags = yes ; then
8151
8152         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8153         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8154
8155                                 continue
8156                         elif test "${cf_tst_cflags}" = "\"'" ; then
8157
8158         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8159         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8160
8161                                 continue
8162                         fi
8163                         ;;
8164                 esac
8165                 case "$CPPFLAGS" in
8166                 (*$cf_add_cflags)
8167                         ;;
8168                 (*)
8169                         case $cf_add_cflags in
8170                         (-D*)
8171                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8172
8173 CPPFLAGS=`echo "$CPPFLAGS" | \
8174         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8175                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8176
8177                                 ;;
8178                         esac
8179
8180         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8181         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8182
8183                         ;;
8184                 esac
8185                 ;;
8186         (*)
8187
8188         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8189         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8190
8191                 ;;
8192         esac
8193         ;;
8194 (yes)
8195
8196         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8197         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8198
8199         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8200
8201         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8202                 && test -z "${cf_tst_cflags}" \
8203                 && cf_fix_cppflags=no
8204         ;;
8205 esac
8206 done
8207
8208 if test -n "$cf_new_cflags" ; then
8209
8210         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8211         CFLAGS="${CFLAGS}$cf_new_cflags"
8212
8213 fi
8214
8215 if test -n "$cf_new_cppflags" ; then
8216
8217         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8218         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8219
8220 fi
8221
8222 if test -n "$cf_new_extra_cppflags" ; then
8223
8224         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8225         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8226
8227 fi
8228
8229 cf_add_libs="$LIBS"
8230 # reverse order
8231 cf_add_0lib=
8232 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8233 # filter duplicates
8234 for cf_add_1lib in $cf_add_0lib; do
8235         for cf_add_2lib in $cf_add_libs; do
8236                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8237                         cf_add_1lib=
8238                         break
8239                 fi
8240         done
8241         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8242 done
8243 LIBS="$cf_add_libs"
8244
8245                 # even with config script, some packages use no-override for curses.h
8246
8247 echo "$as_me:8247: checking if we have identified curses headers" >&5
8248 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8249 if test "${cf_cv_ncurses_header+set}" = set; then
8250   echo $ECHO_N "(cached) $ECHO_C" >&6
8251 else
8252
8253 cf_cv_ncurses_header=none
8254 for cf_header in \
8255         ncurses.h $cf_cv_screen/ncurses.h \
8256         curses.h $cf_cv_screen/curses.h
8257 do
8258 cat >conftest.$ac_ext <<_ACEOF
8259 #line 8259 "configure"
8260 #include "confdefs.h"
8261 #include <${cf_header}>
8262 int
8263 main (void)
8264 {
8265 initscr(); tgoto("?", 0,0)
8266   ;
8267   return 0;
8268 }
8269 _ACEOF
8270 rm -f conftest.$ac_objext
8271 if { (eval echo "$as_me:8271: \"$ac_compile\"") >&5
8272   (eval $ac_compile) 2>&5
8273   ac_status=$?
8274   echo "$as_me:8274: \$? = $ac_status" >&5
8275   (exit $ac_status); } &&
8276          { ac_try='test -s conftest.$ac_objext'
8277   { (eval echo "$as_me:8277: \"$ac_try\"") >&5
8278   (eval $ac_try) 2>&5
8279   ac_status=$?
8280   echo "$as_me:8280: \$? = $ac_status" >&5
8281   (exit $ac_status); }; }; then
8282   cf_cv_ncurses_header=$cf_header; break
8283 else
8284   echo "$as_me: failed program was:" >&5
8285 cat conftest.$ac_ext >&5
8286 fi
8287 rm -f conftest.$ac_objext conftest.$ac_ext
8288 done
8289
8290 fi
8291 echo "$as_me:8291: result: $cf_cv_ncurses_header" >&5
8292 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8293
8294 if test "$cf_cv_ncurses_header" = none ; then
8295         { { echo "$as_me:8295: error: No curses header-files found" >&5
8296 echo "$as_me: error: No curses header-files found" >&2;}
8297    { (exit 1); exit 1; }; }
8298 fi
8299
8300 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8301
8302 for ac_header in $cf_cv_ncurses_header
8303 do
8304 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8305 echo "$as_me:8305: checking for $ac_header" >&5
8306 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8307 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8308   echo $ECHO_N "(cached) $ECHO_C" >&6
8309 else
8310   cat >conftest.$ac_ext <<_ACEOF
8311 #line 8311 "configure"
8312 #include "confdefs.h"
8313 #include <$ac_header>
8314 _ACEOF
8315 if { (eval echo "$as_me:8315: \"$ac_cpp conftest.$ac_ext\"") >&5
8316   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8317   ac_status=$?
8318   egrep -v '^ *\+' conftest.er1 >conftest.err
8319   rm -f conftest.er1
8320   cat conftest.err >&5
8321   echo "$as_me:8321: \$? = $ac_status" >&5
8322   (exit $ac_status); } >/dev/null; then
8323   if test -s conftest.err; then
8324     ac_cpp_err=$ac_c_preproc_warn_flag
8325   else
8326     ac_cpp_err=
8327   fi
8328 else
8329   ac_cpp_err=yes
8330 fi
8331 if test -z "$ac_cpp_err"; then
8332   eval "$as_ac_Header=yes"
8333 else
8334   echo "$as_me: failed program was:" >&5
8335   cat conftest.$ac_ext >&5
8336   eval "$as_ac_Header=no"
8337 fi
8338 rm -f conftest.err conftest.$ac_ext
8339 fi
8340 echo "$as_me:8340: result: `eval echo '${'$as_ac_Header'}'`" >&5
8341 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8342 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8343   cat >>confdefs.h <<EOF
8344 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8345 EOF
8346
8347 fi
8348 done
8349
8350 cat >>confdefs.h <<\EOF
8351 #define NCURSES 1
8352 EOF
8353
8354 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8355
8356                 cat >>confdefs.h <<EOF
8357 #define $cf_nculib_ROOT 1
8358 EOF
8359
8360                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8361
8362         else
8363
8364 cf_ncuhdr_root=$cf_cv_screen
8365
8366 test -n "$cf_cv_curses_dir" && \
8367 test "$cf_cv_curses_dir" != "no" && { \
8368
8369 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8370   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8371   do
8372         while test $cf_add_incdir != /usr/include
8373         do
8374           if test -d $cf_add_incdir
8375           then
8376                 cf_have_incdir=no
8377                 if test -n "$CFLAGS$CPPFLAGS" ; then
8378                   # a loop is needed to ensure we can add subdirs of existing dirs
8379                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8380                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8381                           cf_have_incdir=yes; break
8382                         fi
8383                   done
8384                 fi
8385
8386                 if test "$cf_have_incdir" = no ; then
8387                   if test "$cf_add_incdir" = /usr/local/include ; then
8388                         if test "$GCC" = yes
8389                         then
8390                           cf_save_CPPFLAGS=$CPPFLAGS
8391
8392         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8393         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8394
8395                           cat >conftest.$ac_ext <<_ACEOF
8396 #line 8396 "configure"
8397 #include "confdefs.h"
8398 #include <stdio.h>
8399 int
8400 main (void)
8401 {
8402 printf("Hello")
8403   ;
8404   return 0;
8405 }
8406 _ACEOF
8407 rm -f conftest.$ac_objext
8408 if { (eval echo "$as_me:8408: \"$ac_compile\"") >&5
8409   (eval $ac_compile) 2>&5
8410   ac_status=$?
8411   echo "$as_me:8411: \$? = $ac_status" >&5
8412   (exit $ac_status); } &&
8413          { ac_try='test -s conftest.$ac_objext'
8414   { (eval echo "$as_me:8414: \"$ac_try\"") >&5
8415   (eval $ac_try) 2>&5
8416   ac_status=$?
8417   echo "$as_me:8417: \$? = $ac_status" >&5
8418   (exit $ac_status); }; }; then
8419   :
8420 else
8421   echo "$as_me: failed program was:" >&5
8422 cat conftest.$ac_ext >&5
8423 cf_have_incdir=yes
8424 fi
8425 rm -f conftest.$ac_objext conftest.$ac_ext
8426                           CPPFLAGS=$cf_save_CPPFLAGS
8427                         fi
8428                   fi
8429                 fi
8430
8431                 if test "$cf_have_incdir" = no ; then
8432                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8433
8434 echo "${as_me:-configure}:8434: testing adding $cf_add_incdir to include-path ..." 1>&5
8435
8436                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8437
8438                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8439                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8440                   cf_add_incdir="$cf_top_incdir"
8441                 else
8442                   break
8443                 fi
8444           else
8445                 break
8446           fi
8447         done
8448   done
8449 fi
8450
8451 }
8452
8453 echo "$as_me:8453: checking for $cf_ncuhdr_root header in include-path" >&5
8454 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8455 if test "${cf_cv_ncurses_h+set}" = set; then
8456   echo $ECHO_N "(cached) $ECHO_C" >&6
8457 else
8458
8459         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8460         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8461         for cf_header in $cf_header_list
8462         do
8463
8464         cat >conftest.$ac_ext <<_ACEOF
8465 #line 8465 "configure"
8466 #include "confdefs.h"
8467
8468 #include <$cf_header>
8469 int
8470 main (void)
8471 {
8472
8473 #ifdef NCURSES_VERSION
8474
8475 printf("%s\n", NCURSES_VERSION);
8476 #else
8477 #ifdef __NCURSES_H
8478 printf("old\n");
8479 #else
8480         make an error
8481 #endif
8482 #endif
8483
8484   ;
8485   return 0;
8486 }
8487 _ACEOF
8488 rm -f conftest.$ac_objext
8489 if { (eval echo "$as_me:8489: \"$ac_compile\"") >&5
8490   (eval $ac_compile) 2>&5
8491   ac_status=$?
8492   echo "$as_me:8492: \$? = $ac_status" >&5
8493   (exit $ac_status); } &&
8494          { ac_try='test -s conftest.$ac_objext'
8495   { (eval echo "$as_me:8495: \"$ac_try\"") >&5
8496   (eval $ac_try) 2>&5
8497   ac_status=$?
8498   echo "$as_me:8498: \$? = $ac_status" >&5
8499   (exit $ac_status); }; }; then
8500   cf_cv_ncurses_h=$cf_header
8501
8502 else
8503   echo "$as_me: failed program was:" >&5
8504 cat conftest.$ac_ext >&5
8505 cf_cv_ncurses_h=no
8506 fi
8507 rm -f conftest.$ac_objext conftest.$ac_ext
8508
8509                 test "$cf_cv_ncurses_h" != no && break
8510         done
8511
8512 fi
8513 echo "$as_me:8513: result: $cf_cv_ncurses_h" >&5
8514 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8515
8516 if test "$cf_cv_ncurses_h" != no ; then
8517         cf_cv_ncurses_header=$cf_cv_ncurses_h
8518 else
8519
8520 echo "$as_me:8520: checking for $cf_ncuhdr_root include-path" >&5
8521 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8522 if test "${cf_cv_ncurses_h2+set}" = set; then
8523   echo $ECHO_N "(cached) $ECHO_C" >&6
8524 else
8525
8526         test -n "$verbose" && echo
8527
8528 cf_search=
8529
8530 # collect the current set of include-directories from compiler flags
8531 cf_header_path_list=""
8532 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8533         for cf_header_path in $CPPFLAGS $CFLAGS
8534         do
8535                 case $cf_header_path in
8536                 (-I*)
8537                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8538
8539 test "x$cf_header_path" != "xNONE" && \
8540 test -d "$cf_header_path" && \
8541  {
8542         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8543         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8544         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8545         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8546         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8547         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"
8548 }
8549
8550                         cf_header_path_list="$cf_header_path_list $cf_search"
8551                         ;;
8552                 esac
8553         done
8554 fi
8555
8556 # add the variations for the package we are looking for
8557
8558 cf_search=
8559
8560 test "x$prefix" != "xNONE" && \
8561 test -d "$prefix" && \
8562  {
8563         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8564         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8565         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8566         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8567         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8568         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8569 }
8570
8571 for cf_subdir_prefix in \
8572         /usr \
8573         /usr/local \
8574         /usr/pkg \
8575         /opt \
8576         /opt/local \
8577         $HOME
8578 do
8579
8580 test "x$cf_subdir_prefix" != "x$prefix" && \
8581 test -d "$cf_subdir_prefix" && \
8582 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8583         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8584         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8585         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8586         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8587         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8588         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"
8589 }
8590
8591 done
8592
8593 test "$includedir" != NONE && \
8594 test "$includedir" != "/usr/include" && \
8595 test -d "$includedir" && {
8596         test -d $includedir &&    cf_search="$cf_search $includedir"
8597         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8598 }
8599
8600 test "$oldincludedir" != NONE && \
8601 test "$oldincludedir" != "/usr/include" && \
8602 test -d "$oldincludedir" && {
8603         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8604         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8605 }
8606
8607 cf_search="$cf_search $cf_header_path_list"
8608
8609         test -n "$verbose" && echo search path $cf_search
8610         cf_save2_CPPFLAGS="$CPPFLAGS"
8611         for cf_incdir in $cf_search
8612         do
8613
8614 if test -n "$cf_incdir" ; then
8615   for cf_add_incdir in $cf_incdir
8616   do
8617         while test $cf_add_incdir != /usr/include
8618         do
8619           if test -d $cf_add_incdir
8620           then
8621                 cf_have_incdir=no
8622                 if test -n "$CFLAGS$CPPFLAGS" ; then
8623                   # a loop is needed to ensure we can add subdirs of existing dirs
8624                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8625                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8626                           cf_have_incdir=yes; break
8627                         fi
8628                   done
8629                 fi
8630
8631                 if test "$cf_have_incdir" = no ; then
8632                   if test "$cf_add_incdir" = /usr/local/include ; then
8633                         if test "$GCC" = yes
8634                         then
8635                           cf_save_CPPFLAGS=$CPPFLAGS
8636
8637         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8638         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8639
8640                           cat >conftest.$ac_ext <<_ACEOF
8641 #line 8641 "configure"
8642 #include "confdefs.h"
8643 #include <stdio.h>
8644 int
8645 main (void)
8646 {
8647 printf("Hello")
8648   ;
8649   return 0;
8650 }
8651 _ACEOF
8652 rm -f conftest.$ac_objext
8653 if { (eval echo "$as_me:8653: \"$ac_compile\"") >&5
8654   (eval $ac_compile) 2>&5
8655   ac_status=$?
8656   echo "$as_me:8656: \$? = $ac_status" >&5
8657   (exit $ac_status); } &&
8658          { ac_try='test -s conftest.$ac_objext'
8659   { (eval echo "$as_me:8659: \"$ac_try\"") >&5
8660   (eval $ac_try) 2>&5
8661   ac_status=$?
8662   echo "$as_me:8662: \$? = $ac_status" >&5
8663   (exit $ac_status); }; }; then
8664   :
8665 else
8666   echo "$as_me: failed program was:" >&5
8667 cat conftest.$ac_ext >&5
8668 cf_have_incdir=yes
8669 fi
8670 rm -f conftest.$ac_objext conftest.$ac_ext
8671                           CPPFLAGS=$cf_save_CPPFLAGS
8672                         fi
8673                   fi
8674                 fi
8675
8676                 if test "$cf_have_incdir" = no ; then
8677                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8678
8679 echo "${as_me:-configure}:8679: testing adding $cf_add_incdir to include-path ..." 1>&5
8680
8681                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8682
8683                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8684                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8685                   cf_add_incdir="$cf_top_incdir"
8686                 else
8687                   break
8688                 fi
8689           else
8690                 break
8691           fi
8692         done
8693   done
8694 fi
8695
8696                 for cf_header in \
8697                         ncurses.h \
8698                         curses.h
8699                 do
8700
8701         cat >conftest.$ac_ext <<_ACEOF
8702 #line 8702 "configure"
8703 #include "confdefs.h"
8704
8705 #include <$cf_header>
8706 int
8707 main (void)
8708 {
8709
8710 #ifdef NCURSES_VERSION
8711
8712 printf("%s\n", NCURSES_VERSION);
8713 #else
8714 #ifdef __NCURSES_H
8715 printf("old\n");
8716 #else
8717         make an error
8718 #endif
8719 #endif
8720
8721   ;
8722   return 0;
8723 }
8724 _ACEOF
8725 rm -f conftest.$ac_objext
8726 if { (eval echo "$as_me:8726: \"$ac_compile\"") >&5
8727   (eval $ac_compile) 2>&5
8728   ac_status=$?
8729   echo "$as_me:8729: \$? = $ac_status" >&5
8730   (exit $ac_status); } &&
8731          { ac_try='test -s conftest.$ac_objext'
8732   { (eval echo "$as_me:8732: \"$ac_try\"") >&5
8733   (eval $ac_try) 2>&5
8734   ac_status=$?
8735   echo "$as_me:8735: \$? = $ac_status" >&5
8736   (exit $ac_status); }; }; then
8737   cf_cv_ncurses_h2=$cf_header
8738
8739 else
8740   echo "$as_me: failed program was:" >&5
8741 cat conftest.$ac_ext >&5
8742 cf_cv_ncurses_h2=no
8743 fi
8744 rm -f conftest.$ac_objext conftest.$ac_ext
8745
8746                         if test "$cf_cv_ncurses_h2" != no ; then
8747                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8748                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8749                                 break
8750                         fi
8751                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8752                 done
8753                 CPPFLAGS="$cf_save2_CPPFLAGS"
8754                 test "$cf_cv_ncurses_h2" != no && break
8755         done
8756         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8756: error: not found" >&5
8757 echo "$as_me: error: not found" >&2;}
8758    { (exit 1); exit 1; }; }
8759
8760 fi
8761 echo "$as_me:8761: result: $cf_cv_ncurses_h2" >&5
8762 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8763
8764         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8765         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8766         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8767                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8768         fi
8769
8770 if test -n "$cf_1st_incdir" ; then
8771   for cf_add_incdir in $cf_1st_incdir
8772   do
8773         while test $cf_add_incdir != /usr/include
8774         do
8775           if test -d $cf_add_incdir
8776           then
8777                 cf_have_incdir=no
8778                 if test -n "$CFLAGS$CPPFLAGS" ; then
8779                   # a loop is needed to ensure we can add subdirs of existing dirs
8780                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8781                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8782                           cf_have_incdir=yes; break
8783                         fi
8784                   done
8785                 fi
8786
8787                 if test "$cf_have_incdir" = no ; then
8788                   if test "$cf_add_incdir" = /usr/local/include ; then
8789                         if test "$GCC" = yes
8790                         then
8791                           cf_save_CPPFLAGS=$CPPFLAGS
8792
8793         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8794         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8795
8796                           cat >conftest.$ac_ext <<_ACEOF
8797 #line 8797 "configure"
8798 #include "confdefs.h"
8799 #include <stdio.h>
8800 int
8801 main (void)
8802 {
8803 printf("Hello")
8804   ;
8805   return 0;
8806 }
8807 _ACEOF
8808 rm -f conftest.$ac_objext
8809 if { (eval echo "$as_me:8809: \"$ac_compile\"") >&5
8810   (eval $ac_compile) 2>&5
8811   ac_status=$?
8812   echo "$as_me:8812: \$? = $ac_status" >&5
8813   (exit $ac_status); } &&
8814          { ac_try='test -s conftest.$ac_objext'
8815   { (eval echo "$as_me:8815: \"$ac_try\"") >&5
8816   (eval $ac_try) 2>&5
8817   ac_status=$?
8818   echo "$as_me:8818: \$? = $ac_status" >&5
8819   (exit $ac_status); }; }; then
8820   :
8821 else
8822   echo "$as_me: failed program was:" >&5
8823 cat conftest.$ac_ext >&5
8824 cf_have_incdir=yes
8825 fi
8826 rm -f conftest.$ac_objext conftest.$ac_ext
8827                           CPPFLAGS=$cf_save_CPPFLAGS
8828                         fi
8829                   fi
8830                 fi
8831
8832                 if test "$cf_have_incdir" = no ; then
8833                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8834
8835 echo "${as_me:-configure}:8835: testing adding $cf_add_incdir to include-path ..." 1>&5
8836
8837                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8838
8839                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8840                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8841                   cf_add_incdir="$cf_top_incdir"
8842                 else
8843                   break
8844                 fi
8845           else
8846                 break
8847           fi
8848         done
8849   done
8850 fi
8851
8852 fi
8853
8854 # Set definitions to allow ifdef'ing for ncurses.h
8855
8856 case $cf_cv_ncurses_header in
8857 (*ncurses.h)
8858
8859 cat >>confdefs.h <<\EOF
8860 #define HAVE_NCURSES_H 1
8861 EOF
8862
8863         ;;
8864 esac
8865
8866 case $cf_cv_ncurses_header in
8867 (ncurses/curses.h|ncurses/ncurses.h)
8868
8869 cat >>confdefs.h <<\EOF
8870 #define HAVE_NCURSES_NCURSES_H 1
8871 EOF
8872
8873         ;;
8874 (ncursesw/curses.h|ncursesw/ncurses.h)
8875
8876 cat >>confdefs.h <<\EOF
8877 #define HAVE_NCURSESW_NCURSES_H 1
8878 EOF
8879
8880         ;;
8881 esac
8882
8883 echo "$as_me:8883: checking for terminfo header" >&5
8884 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8885 if test "${cf_cv_term_header+set}" = set; then
8886   echo $ECHO_N "(cached) $ECHO_C" >&6
8887 else
8888
8889 case ${cf_cv_ncurses_header} in
8890 (*/ncurses.h|*/ncursesw.h)
8891         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8892         ;;
8893 (*)
8894         cf_term_header=term.h
8895         ;;
8896 esac
8897
8898 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8899 do
8900 cat >conftest.$ac_ext <<_ACEOF
8901 #line 8901 "configure"
8902 #include "confdefs.h"
8903 #include <stdio.h>
8904 #include <${cf_cv_ncurses_header:-curses.h}>
8905 #include <$cf_test>
8906
8907 int
8908 main (void)
8909 {
8910 int x = auto_left_margin
8911   ;
8912   return 0;
8913 }
8914 _ACEOF
8915 rm -f conftest.$ac_objext
8916 if { (eval echo "$as_me:8916: \"$ac_compile\"") >&5
8917   (eval $ac_compile) 2>&5
8918   ac_status=$?
8919   echo "$as_me:8919: \$? = $ac_status" >&5
8920   (exit $ac_status); } &&
8921          { ac_try='test -s conftest.$ac_objext'
8922   { (eval echo "$as_me:8922: \"$ac_try\"") >&5
8923   (eval $ac_try) 2>&5
8924   ac_status=$?
8925   echo "$as_me:8925: \$? = $ac_status" >&5
8926   (exit $ac_status); }; }; then
8927
8928         cf_cv_term_header="$cf_test"
8929 else
8930   echo "$as_me: failed program was:" >&5
8931 cat conftest.$ac_ext >&5
8932
8933         cf_cv_term_header=unknown
8934
8935 fi
8936 rm -f conftest.$ac_objext conftest.$ac_ext
8937         test "$cf_cv_term_header" != unknown && break
8938 done
8939
8940 fi
8941 echo "$as_me:8941: result: $cf_cv_term_header" >&5
8942 echo "${ECHO_T}$cf_cv_term_header" >&6
8943
8944 # Set definitions to allow ifdef'ing to accommodate subdirectories
8945
8946 case $cf_cv_term_header in
8947 (*term.h)
8948
8949 cat >>confdefs.h <<\EOF
8950 #define HAVE_TERM_H 1
8951 EOF
8952
8953         ;;
8954 esac
8955
8956 case $cf_cv_term_header in
8957 (ncurses/term.h)
8958
8959 cat >>confdefs.h <<\EOF
8960 #define HAVE_NCURSES_TERM_H 1
8961 EOF
8962
8963         ;;
8964 (ncursesw/term.h)
8965
8966 cat >>confdefs.h <<\EOF
8967 #define HAVE_NCURSESW_TERM_H 1
8968 EOF
8969
8970         ;;
8971 esac
8972
8973 # some applications need this, but should check for NCURSES_VERSION
8974
8975 cat >>confdefs.h <<\EOF
8976 #define NCURSES 1
8977 EOF
8978
8979 echo "$as_me:8979: checking for ncurses version" >&5
8980 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8981 if test "${cf_cv_ncurses_version+set}" = set; then
8982   echo $ECHO_N "(cached) $ECHO_C" >&6
8983 else
8984
8985         cf_cv_ncurses_version=no
8986         cf_tempfile=out$$
8987         rm -f $cf_tempfile
8988         if test "$cross_compiling" = yes; then
8989
8990         # This will not work if the preprocessor splits the line after the
8991         # Autoconf token.  The 'unproto' program does that.
8992         cat > conftest.$ac_ext <<EOF
8993 #include <${cf_cv_ncurses_header:-curses.h}>
8994 #undef Autoconf
8995 #ifdef NCURSES_VERSION
8996 Autoconf NCURSES_VERSION
8997 #else
8998 #ifdef __NCURSES_H
8999 Autoconf "old"
9000 #endif
9001 ;
9002 #endif
9003 EOF
9004         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9005         { (eval echo "$as_me:9005: \"$cf_try\"") >&5
9006   (eval $cf_try) 2>&5
9007   ac_status=$?
9008   echo "$as_me:9008: \$? = $ac_status" >&5
9009   (exit $ac_status); }
9010         if test -f conftest.out ; then
9011                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9012                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9013                 rm -f conftest.out
9014         fi
9015
9016 else
9017   cat >conftest.$ac_ext <<_ACEOF
9018 #line 9018 "configure"
9019 #include "confdefs.h"
9020
9021 #include <${cf_cv_ncurses_header:-curses.h}>
9022 #include <stdio.h>
9023 int main(void)
9024 {
9025         FILE *fp = fopen("$cf_tempfile", "w");
9026 #ifdef NCURSES_VERSION
9027 # ifdef NCURSES_VERSION_PATCH
9028         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9029 # else
9030         fprintf(fp, "%s\n", NCURSES_VERSION);
9031 # endif
9032 #else
9033 # ifdef __NCURSES_H
9034         fprintf(fp, "old\n");
9035 # else
9036         make an error
9037 # endif
9038 #endif
9039         ${cf_cv_main_return:-return}(0);
9040 }
9041 _ACEOF
9042 rm -f conftest$ac_exeext
9043 if { (eval echo "$as_me:9043: \"$ac_link\"") >&5
9044   (eval $ac_link) 2>&5
9045   ac_status=$?
9046   echo "$as_me:9046: \$? = $ac_status" >&5
9047   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9048   { (eval echo "$as_me:9048: \"$ac_try\"") >&5
9049   (eval $ac_try) 2>&5
9050   ac_status=$?
9051   echo "$as_me:9051: \$? = $ac_status" >&5
9052   (exit $ac_status); }; }; then
9053
9054         cf_cv_ncurses_version=`cat $cf_tempfile`
9055 else
9056   echo "$as_me: program exited with status $ac_status" >&5
9057 echo "$as_me: failed program was:" >&5
9058 cat conftest.$ac_ext >&5
9059 fi
9060 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9061 fi
9062         rm -f $cf_tempfile
9063
9064 fi
9065 echo "$as_me:9065: result: $cf_cv_ncurses_version" >&5
9066 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9067 test "$cf_cv_ncurses_version" = no ||
9068 cat >>confdefs.h <<\EOF
9069 #define NCURSES 1
9070 EOF
9071
9072 cf_nculib_root=$cf_cv_screen
9073         # This works, except for the special case where we find gpm, but
9074         # ncurses is in a nonstandard location via $LIBS, and we really want
9075         # to link gpm.
9076 cf_ncurses_LIBS=""
9077 cf_ncurses_SAVE="$LIBS"
9078 echo "$as_me:9078: checking for Gpm_Open in -lgpm" >&5
9079 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9080 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9081   echo $ECHO_N "(cached) $ECHO_C" >&6
9082 else
9083   ac_check_lib_save_LIBS=$LIBS
9084 LIBS="-lgpm  $LIBS"
9085 cat >conftest.$ac_ext <<_ACEOF
9086 #line 9086 "configure"
9087 #include "confdefs.h"
9088
9089 /* Override any gcc2 internal prototype to avoid an error.  */
9090 #ifdef __cplusplus
9091 extern "C"
9092 #endif
9093 /* We use char because int might match the return type of a gcc2
9094    builtin and then its argument prototype would still apply.  */
9095 char Gpm_Open ();
9096 int
9097 main (void)
9098 {
9099 Gpm_Open ();
9100   ;
9101   return 0;
9102 }
9103 _ACEOF
9104 rm -f conftest.$ac_objext conftest$ac_exeext
9105 if { (eval echo "$as_me:9105: \"$ac_link\"") >&5
9106   (eval $ac_link) 2>&5
9107   ac_status=$?
9108   echo "$as_me:9108: \$? = $ac_status" >&5
9109   (exit $ac_status); } &&
9110          { ac_try='test -s conftest$ac_exeext'
9111   { (eval echo "$as_me:9111: \"$ac_try\"") >&5
9112   (eval $ac_try) 2>&5
9113   ac_status=$?
9114   echo "$as_me:9114: \$? = $ac_status" >&5
9115   (exit $ac_status); }; }; then
9116   ac_cv_lib_gpm_Gpm_Open=yes
9117 else
9118   echo "$as_me: failed program was:" >&5
9119 cat conftest.$ac_ext >&5
9120 ac_cv_lib_gpm_Gpm_Open=no
9121 fi
9122 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9123 LIBS=$ac_check_lib_save_LIBS
9124 fi
9125 echo "$as_me:9125: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9126 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9127 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9128   echo "$as_me:9128: checking for initscr in -lgpm" >&5
9129 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9130 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9131   echo $ECHO_N "(cached) $ECHO_C" >&6
9132 else
9133   ac_check_lib_save_LIBS=$LIBS
9134 LIBS="-lgpm  $LIBS"
9135 cat >conftest.$ac_ext <<_ACEOF
9136 #line 9136 "configure"
9137 #include "confdefs.h"
9138
9139 /* Override any gcc2 internal prototype to avoid an error.  */
9140 #ifdef __cplusplus
9141 extern "C"
9142 #endif
9143 /* We use char because int might match the return type of a gcc2
9144    builtin and then its argument prototype would still apply.  */
9145 char initscr ();
9146 int
9147 main (void)
9148 {
9149 initscr ();
9150   ;
9151   return 0;
9152 }
9153 _ACEOF
9154 rm -f conftest.$ac_objext conftest$ac_exeext
9155 if { (eval echo "$as_me:9155: \"$ac_link\"") >&5
9156   (eval $ac_link) 2>&5
9157   ac_status=$?
9158   echo "$as_me:9158: \$? = $ac_status" >&5
9159   (exit $ac_status); } &&
9160          { ac_try='test -s conftest$ac_exeext'
9161   { (eval echo "$as_me:9161: \"$ac_try\"") >&5
9162   (eval $ac_try) 2>&5
9163   ac_status=$?
9164   echo "$as_me:9164: \$? = $ac_status" >&5
9165   (exit $ac_status); }; }; then
9166   ac_cv_lib_gpm_initscr=yes
9167 else
9168   echo "$as_me: failed program was:" >&5
9169 cat conftest.$ac_ext >&5
9170 ac_cv_lib_gpm_initscr=no
9171 fi
9172 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9173 LIBS=$ac_check_lib_save_LIBS
9174 fi
9175 echo "$as_me:9175: result: $ac_cv_lib_gpm_initscr" >&5
9176 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9177 if test $ac_cv_lib_gpm_initscr = yes; then
9178   LIBS="$cf_ncurses_SAVE"
9179 else
9180   cf_ncurses_LIBS="-lgpm"
9181 fi
9182
9183 fi
9184
9185 case $host_os in
9186 (freebsd*)
9187         # This is only necessary if you are linking against an obsolete
9188         # version of ncurses (but it should do no harm, since it's static).
9189         if test "$cf_nculib_root" = ncurses ; then
9190                 echo "$as_me:9190: checking for tgoto in -lmytinfo" >&5
9191 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9192 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9193   echo $ECHO_N "(cached) $ECHO_C" >&6
9194 else
9195   ac_check_lib_save_LIBS=$LIBS
9196 LIBS="-lmytinfo  $LIBS"
9197 cat >conftest.$ac_ext <<_ACEOF
9198 #line 9198 "configure"
9199 #include "confdefs.h"
9200
9201 /* Override any gcc2 internal prototype to avoid an error.  */
9202 #ifdef __cplusplus
9203 extern "C"
9204 #endif
9205 /* We use char because int might match the return type of a gcc2
9206    builtin and then its argument prototype would still apply.  */
9207 char tgoto ();
9208 int
9209 main (void)
9210 {
9211 tgoto ();
9212   ;
9213   return 0;
9214 }
9215 _ACEOF
9216 rm -f conftest.$ac_objext conftest$ac_exeext
9217 if { (eval echo "$as_me:9217: \"$ac_link\"") >&5
9218   (eval $ac_link) 2>&5
9219   ac_status=$?
9220   echo "$as_me:9220: \$? = $ac_status" >&5
9221   (exit $ac_status); } &&
9222          { ac_try='test -s conftest$ac_exeext'
9223   { (eval echo "$as_me:9223: \"$ac_try\"") >&5
9224   (eval $ac_try) 2>&5
9225   ac_status=$?
9226   echo "$as_me:9226: \$? = $ac_status" >&5
9227   (exit $ac_status); }; }; then
9228   ac_cv_lib_mytinfo_tgoto=yes
9229 else
9230   echo "$as_me: failed program was:" >&5
9231 cat conftest.$ac_ext >&5
9232 ac_cv_lib_mytinfo_tgoto=no
9233 fi
9234 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9235 LIBS=$ac_check_lib_save_LIBS
9236 fi
9237 echo "$as_me:9237: result: $ac_cv_lib_mytinfo_tgoto" >&5
9238 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9239 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9240   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9241 fi
9242
9243         fi
9244         ;;
9245 esac
9246
9247 cf_add_libs="$LIBS"
9248 # reverse order
9249 cf_add_0lib=
9250 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9251 # filter duplicates
9252 for cf_add_1lib in $cf_add_0lib; do
9253         for cf_add_2lib in $cf_add_libs; do
9254                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9255                         cf_add_1lib=
9256                         break
9257                 fi
9258         done
9259         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9260 done
9261 LIBS="$cf_add_libs"
9262
9263 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9264 then
9265
9266 cf_add_libs="$LIBS"
9267 # reverse order
9268 cf_add_0lib=
9269 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9270 # filter duplicates
9271 for cf_add_1lib in $cf_add_0lib; do
9272         for cf_add_2lib in $cf_add_libs; do
9273                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9274                         cf_add_1lib=
9275                         break
9276                 fi
9277         done
9278         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9279 done
9280 LIBS="$cf_add_libs"
9281
9282 else
9283
9284         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9285         cf_libdir=""
9286         echo "$as_me:9286: checking for initscr" >&5
9287 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9288 if test "${ac_cv_func_initscr+set}" = set; then
9289   echo $ECHO_N "(cached) $ECHO_C" >&6
9290 else
9291   cat >conftest.$ac_ext <<_ACEOF
9292 #line 9292 "configure"
9293 #include "confdefs.h"
9294 #define initscr autoconf_temporary
9295 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9296 #undef initscr
9297
9298 #ifdef __cplusplus
9299 extern "C"
9300 #endif
9301
9302 /* We use char because int might match the return type of a gcc2
9303    builtin and then its argument prototype would still apply.  */
9304 char initscr (void);
9305
9306 int
9307 main (void)
9308 {
9309
9310 /* The GNU C library defines stubs for functions which it implements
9311     to always fail with ENOSYS.  Some functions are actually named
9312     something starting with __ and the normal name is an alias.  */
9313 #if defined (__stub_initscr) || defined (__stub___initscr)
9314 #error found stub for initscr
9315 #endif
9316
9317         return initscr ();
9318   ;
9319   return 0;
9320 }
9321 _ACEOF
9322 rm -f conftest.$ac_objext conftest$ac_exeext
9323 if { (eval echo "$as_me:9323: \"$ac_link\"") >&5
9324   (eval $ac_link) 2>&5
9325   ac_status=$?
9326   echo "$as_me:9326: \$? = $ac_status" >&5
9327   (exit $ac_status); } &&
9328          { ac_try='test -s conftest$ac_exeext'
9329   { (eval echo "$as_me:9329: \"$ac_try\"") >&5
9330   (eval $ac_try) 2>&5
9331   ac_status=$?
9332   echo "$as_me:9332: \$? = $ac_status" >&5
9333   (exit $ac_status); }; }; then
9334   ac_cv_func_initscr=yes
9335 else
9336   echo "$as_me: failed program was:" >&5
9337 cat conftest.$ac_ext >&5
9338 ac_cv_func_initscr=no
9339 fi
9340 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9341 fi
9342 echo "$as_me:9342: result: $ac_cv_func_initscr" >&5
9343 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9344 if test $ac_cv_func_initscr = yes; then
9345   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9346 else
9347
9348                 cf_save_LIBS="$LIBS"
9349                 echo "$as_me:9349: checking for initscr in -l$cf_nculib_root" >&5
9350 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9351                 LIBS="-l$cf_nculib_root $LIBS"
9352                 cat >conftest.$ac_ext <<_ACEOF
9353 #line 9353 "configure"
9354 #include "confdefs.h"
9355 #include <${cf_cv_ncurses_header:-curses.h}>
9356 int
9357 main (void)
9358 {
9359 initscr()
9360   ;
9361   return 0;
9362 }
9363 _ACEOF
9364 rm -f conftest.$ac_objext conftest$ac_exeext
9365 if { (eval echo "$as_me:9365: \"$ac_link\"") >&5
9366   (eval $ac_link) 2>&5
9367   ac_status=$?
9368   echo "$as_me:9368: \$? = $ac_status" >&5
9369   (exit $ac_status); } &&
9370          { ac_try='test -s conftest$ac_exeext'
9371   { (eval echo "$as_me:9371: \"$ac_try\"") >&5
9372   (eval $ac_try) 2>&5
9373   ac_status=$?
9374   echo "$as_me:9374: \$? = $ac_status" >&5
9375   (exit $ac_status); }; }; then
9376   echo "$as_me:9376: result: yes" >&5
9377 echo "${ECHO_T}yes" >&6
9378                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9379
9380 else
9381   echo "$as_me: failed program was:" >&5
9382 cat conftest.$ac_ext >&5
9383 echo "$as_me:9383: result: no" >&5
9384 echo "${ECHO_T}no" >&6
9385
9386 cf_search=
9387 cf_library_path_list=""
9388 if test -n "${LDFLAGS}${LIBS}" ; then
9389         for cf_library_path in $LDFLAGS $LIBS
9390         do
9391                 case $cf_library_path in
9392                 (-L*)
9393                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9394
9395 test "x$cf_library_path" != "xNONE" && \
9396 test -d "$cf_library_path" && \
9397  {
9398         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9399         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9400         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9401         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9402         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9403         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"
9404 }
9405
9406                         cf_library_path_list="$cf_library_path_list $cf_search"
9407                         ;;
9408                 esac
9409         done
9410 fi
9411
9412 cf_search=
9413
9414 test "x$prefix" != "xNONE" && \
9415 test -d "$prefix" && \
9416  {
9417         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9418         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9419         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9420         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9421         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9422         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9423 }
9424
9425 for cf_subdir_prefix in \
9426         /usr \
9427         /usr/local \
9428         /usr/pkg \
9429         /opt \
9430         /opt/local \
9431         $HOME
9432 do
9433
9434 test "x$cf_subdir_prefix" != "x$prefix" && \
9435 test -d "$cf_subdir_prefix" && \
9436 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9437         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9438         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9439         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9440         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9441         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9442         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"
9443 }
9444
9445 done
9446
9447 cf_search="$cf_library_path_list $cf_search"
9448
9449                         for cf_libdir in $cf_search
9450                         do
9451                                 echo "$as_me:9451: checking for -l$cf_nculib_root in $cf_libdir" >&5
9452 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9453                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9454                                 cat >conftest.$ac_ext <<_ACEOF
9455 #line 9455 "configure"
9456 #include "confdefs.h"
9457 #include <${cf_cv_ncurses_header:-curses.h}>
9458 int
9459 main (void)
9460 {
9461 initscr()
9462   ;
9463   return 0;
9464 }
9465 _ACEOF
9466 rm -f conftest.$ac_objext conftest$ac_exeext
9467 if { (eval echo "$as_me:9467: \"$ac_link\"") >&5
9468   (eval $ac_link) 2>&5
9469   ac_status=$?
9470   echo "$as_me:9470: \$? = $ac_status" >&5
9471   (exit $ac_status); } &&
9472          { ac_try='test -s conftest$ac_exeext'
9473   { (eval echo "$as_me:9473: \"$ac_try\"") >&5
9474   (eval $ac_try) 2>&5
9475   ac_status=$?
9476   echo "$as_me:9476: \$? = $ac_status" >&5
9477   (exit $ac_status); }; }; then
9478   echo "$as_me:9478: result: yes" >&5
9479 echo "${ECHO_T}yes" >&6
9480                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9481                                          break
9482 else
9483   echo "$as_me: failed program was:" >&5
9484 cat conftest.$ac_ext >&5
9485 echo "$as_me:9485: result: no" >&5
9486 echo "${ECHO_T}no" >&6
9487                                          LIBS="$cf_save_LIBS"
9488 fi
9489 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9490                         done
9491
9492 fi
9493 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9494
9495 fi
9496
9497 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9498
9499 if test $cf_found_library = no ; then
9500         { { echo "$as_me:9500: error: Cannot link $cf_nculib_root library" >&5
9501 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9502    { (exit 1); exit 1; }; }
9503 fi
9504
9505 fi
9506
9507 if test -n "$cf_ncurses_LIBS" ; then
9508         echo "$as_me:9508: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9509 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9510         cf_ncurses_SAVE="$LIBS"
9511         for p in $cf_ncurses_LIBS ; do
9512                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9513                 if test "$q" != "$LIBS" ; then
9514                         LIBS="$q"
9515                 fi
9516         done
9517         cat >conftest.$ac_ext <<_ACEOF
9518 #line 9518 "configure"
9519 #include "confdefs.h"
9520 #include <${cf_cv_ncurses_header:-curses.h}>
9521 int
9522 main (void)
9523 {
9524 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9525   ;
9526   return 0;
9527 }
9528 _ACEOF
9529 rm -f conftest.$ac_objext conftest$ac_exeext
9530 if { (eval echo "$as_me:9530: \"$ac_link\"") >&5
9531   (eval $ac_link) 2>&5
9532   ac_status=$?
9533   echo "$as_me:9533: \$? = $ac_status" >&5
9534   (exit $ac_status); } &&
9535          { ac_try='test -s 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   echo "$as_me:9541: result: yes" >&5
9542 echo "${ECHO_T}yes" >&6
9543 else
9544   echo "$as_me: failed program was:" >&5
9545 cat conftest.$ac_ext >&5
9546 echo "$as_me:9546: result: no" >&5
9547 echo "${ECHO_T}no" >&6
9548                  LIBS="$cf_ncurses_SAVE"
9549 fi
9550 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9551 fi
9552
9553 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9554
9555 cat >>confdefs.h <<EOF
9556 #define $cf_nculib_ROOT 1
9557 EOF
9558
9559         fi
9560 else
9561         NCURSES_CONFIG=none
9562 fi
9563
9564         ;;
9565 (ncurses*)
9566
9567 cf_ncuconfig_root=$cf_cv_screen
9568 cf_have_ncuconfig=no
9569
9570 if test "x${PKG_CONFIG:=none}" != xnone; then
9571         echo "$as_me:9571: checking pkg-config for $cf_ncuconfig_root" >&5
9572 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9573         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9574                 echo "$as_me:9574: result: yes" >&5
9575 echo "${ECHO_T}yes" >&6
9576
9577                 echo "$as_me:9577: checking if the $cf_ncuconfig_root package files work" >&5
9578 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9579                 cf_have_ncuconfig=unknown
9580
9581                 cf_save_CFLAGS="$CFLAGS"
9582                 cf_save_CPPFLAGS="$CPPFLAGS"
9583                 cf_save_LIBS="$LIBS"
9584
9585                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
9586                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
9587
9588                 # while -W for passing linker flags is prevalent, it is not "standard".
9589                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9590                 # incompatible _and_ non-standard -W option which gives an error.  Work
9591                 # around that pitfall.
9592                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9593                 (x*c[89]9@@*-W*)
9594
9595 cf_fix_cppflags=no
9596 cf_new_cflags=
9597 cf_new_cppflags=
9598 cf_new_extra_cppflags=
9599
9600 for cf_add_cflags in $cf_pkg_cflags
9601 do
9602 case $cf_fix_cppflags in
9603 (no)
9604         case $cf_add_cflags in
9605         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9606                 case $cf_add_cflags in
9607                 (-D*)
9608                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9609
9610                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9611                                 && test -z "${cf_tst_cflags}" \
9612                                 && cf_fix_cppflags=yes
9613
9614                         if test $cf_fix_cppflags = yes ; then
9615
9616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9618
9619                                 continue
9620                         elif test "${cf_tst_cflags}" = "\"'" ; then
9621
9622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9624
9625                                 continue
9626                         fi
9627                         ;;
9628                 esac
9629                 case "$CPPFLAGS" in
9630                 (*$cf_add_cflags)
9631                         ;;
9632                 (*)
9633                         case $cf_add_cflags in
9634                         (-D*)
9635                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9636
9637 CPPFLAGS=`echo "$CPPFLAGS" | \
9638         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9639                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9640
9641                                 ;;
9642                         esac
9643
9644         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9645         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9646
9647                         ;;
9648                 esac
9649                 ;;
9650         (*)
9651
9652         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9653         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9654
9655                 ;;
9656         esac
9657         ;;
9658 (yes)
9659
9660         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9661         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9662
9663         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9664
9665         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9666                 && test -z "${cf_tst_cflags}" \
9667                 && cf_fix_cppflags=no
9668         ;;
9669 esac
9670 done
9671
9672 if test -n "$cf_new_cflags" ; then
9673
9674         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9675         CFLAGS="${CFLAGS}$cf_new_cflags"
9676
9677 fi
9678
9679 if test -n "$cf_new_cppflags" ; then
9680
9681         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9682         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9683
9684 fi
9685
9686 if test -n "$cf_new_extra_cppflags" ; then
9687
9688         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9689         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9690
9691 fi
9692
9693 cf_add_libs="$LIBS"
9694 # reverse order
9695 cf_add_0lib=
9696 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9697 # filter duplicates
9698 for cf_add_1lib in $cf_add_0lib; do
9699         for cf_add_2lib in $cf_add_libs; do
9700                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9701                         cf_add_1lib=
9702                         break
9703                 fi
9704         done
9705         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9706 done
9707 LIBS="$cf_add_libs"
9708
9709                         cat >conftest.$ac_ext <<_ACEOF
9710 #line 9710 "configure"
9711 #include "confdefs.h"
9712 #include <${cf_cv_ncurses_header:-curses.h}>
9713 int
9714 main (void)
9715 {
9716 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9717   ;
9718   return 0;
9719 }
9720 _ACEOF
9721 rm -f conftest.$ac_objext conftest$ac_exeext
9722 if { (eval echo "$as_me:9722: \"$ac_link\"") >&5
9723   (eval $ac_link) 2>&5
9724   ac_status=$?
9725   echo "$as_me:9725: \$? = $ac_status" >&5
9726   (exit $ac_status); } &&
9727          { ac_try='test -s conftest$ac_exeext'
9728   { (eval echo "$as_me:9728: \"$ac_try\"") >&5
9729   (eval $ac_try) 2>&5
9730   ac_status=$?
9731   echo "$as_me:9731: \$? = $ac_status" >&5
9732   (exit $ac_status); }; }; then
9733   if test "$cross_compiling" = yes; then
9734   cf_test_ncuconfig=maybe
9735 else
9736   cat >conftest.$ac_ext <<_ACEOF
9737 #line 9737 "configure"
9738 #include "confdefs.h"
9739 #include <${cf_cv_ncurses_header:-curses.h}>
9740                                         int main(void)
9741                                         { char *xx = curses_version(); return (xx == 0); }
9742 _ACEOF
9743 rm -f conftest$ac_exeext
9744 if { (eval echo "$as_me:9744: \"$ac_link\"") >&5
9745   (eval $ac_link) 2>&5
9746   ac_status=$?
9747   echo "$as_me:9747: \$? = $ac_status" >&5
9748   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9749   { (eval echo "$as_me:9749: \"$ac_try\"") >&5
9750   (eval $ac_try) 2>&5
9751   ac_status=$?
9752   echo "$as_me:9752: \$? = $ac_status" >&5
9753   (exit $ac_status); }; }; then
9754   cf_test_ncuconfig=yes
9755 else
9756   echo "$as_me: program exited with status $ac_status" >&5
9757 echo "$as_me: failed program was:" >&5
9758 cat conftest.$ac_ext >&5
9759 cf_test_ncuconfig=no
9760 fi
9761 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9762 fi
9763 else
9764   echo "$as_me: failed program was:" >&5
9765 cat conftest.$ac_ext >&5
9766 cf_test_ncuconfig=no
9767 fi
9768 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9769
9770                         CFLAGS="$cf_save_CFLAGS"
9771                         CPPFLAGS="$cf_save_CPPFLAGS"
9772                         LIBS="$cf_save_LIBS"
9773
9774                         if test "x$cf_test_ncuconfig" != xyes; then
9775                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9776                                 cf_pkg_cflags="$cf_temp"
9777                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9778                                 cf_pkg_libs="$cf_temp"
9779                         fi
9780                         ;;
9781                 esac
9782
9783 cf_fix_cppflags=no
9784 cf_new_cflags=
9785 cf_new_cppflags=
9786 cf_new_extra_cppflags=
9787
9788 for cf_add_cflags in $cf_pkg_cflags
9789 do
9790 case $cf_fix_cppflags in
9791 (no)
9792         case $cf_add_cflags in
9793         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9794                 case $cf_add_cflags in
9795                 (-D*)
9796                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9797
9798                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9799                                 && test -z "${cf_tst_cflags}" \
9800                                 && cf_fix_cppflags=yes
9801
9802                         if test $cf_fix_cppflags = yes ; then
9803
9804         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9805         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9806
9807                                 continue
9808                         elif test "${cf_tst_cflags}" = "\"'" ; then
9809
9810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9812
9813                                 continue
9814                         fi
9815                         ;;
9816                 esac
9817                 case "$CPPFLAGS" in
9818                 (*$cf_add_cflags)
9819                         ;;
9820                 (*)
9821                         case $cf_add_cflags in
9822                         (-D*)
9823                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9824
9825 CPPFLAGS=`echo "$CPPFLAGS" | \
9826         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9827                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9828
9829                                 ;;
9830                         esac
9831
9832         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9833         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9834
9835                         ;;
9836                 esac
9837                 ;;
9838         (*)
9839
9840         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9841         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9842
9843                 ;;
9844         esac
9845         ;;
9846 (yes)
9847
9848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9850
9851         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9852
9853         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9854                 && test -z "${cf_tst_cflags}" \
9855                 && cf_fix_cppflags=no
9856         ;;
9857 esac
9858 done
9859
9860 if test -n "$cf_new_cflags" ; then
9861
9862         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9863         CFLAGS="${CFLAGS}$cf_new_cflags"
9864
9865 fi
9866
9867 if test -n "$cf_new_cppflags" ; then
9868
9869         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9870         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9871
9872 fi
9873
9874 if test -n "$cf_new_extra_cppflags" ; then
9875
9876         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9877         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9878
9879 fi
9880
9881 cf_add_libs="$LIBS"
9882 # reverse order
9883 cf_add_0lib=
9884 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9885 # filter duplicates
9886 for cf_add_1lib in $cf_add_0lib; do
9887         for cf_add_2lib in $cf_add_libs; do
9888                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9889                         cf_add_1lib=
9890                         break
9891                 fi
9892         done
9893         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9894 done
9895 LIBS="$cf_add_libs"
9896
9897                 cat >conftest.$ac_ext <<_ACEOF
9898 #line 9898 "configure"
9899 #include "confdefs.h"
9900 #include <${cf_cv_ncurses_header:-curses.h}>
9901 int
9902 main (void)
9903 {
9904 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9905   ;
9906   return 0;
9907 }
9908 _ACEOF
9909 rm -f conftest.$ac_objext conftest$ac_exeext
9910 if { (eval echo "$as_me:9910: \"$ac_link\"") >&5
9911   (eval $ac_link) 2>&5
9912   ac_status=$?
9913   echo "$as_me:9913: \$? = $ac_status" >&5
9914   (exit $ac_status); } &&
9915          { ac_try='test -s conftest$ac_exeext'
9916   { (eval echo "$as_me:9916: \"$ac_try\"") >&5
9917   (eval $ac_try) 2>&5
9918   ac_status=$?
9919   echo "$as_me:9919: \$? = $ac_status" >&5
9920   (exit $ac_status); }; }; then
9921   if test "$cross_compiling" = yes; then
9922   cf_have_ncuconfig=maybe
9923 else
9924   cat >conftest.$ac_ext <<_ACEOF
9925 #line 9925 "configure"
9926 #include "confdefs.h"
9927 #include <${cf_cv_ncurses_header:-curses.h}>
9928                                 int main(void)
9929                                 { char *xx = curses_version(); return (xx == 0); }
9930 _ACEOF
9931 rm -f conftest$ac_exeext
9932 if { (eval echo "$as_me:9932: \"$ac_link\"") >&5
9933   (eval $ac_link) 2>&5
9934   ac_status=$?
9935   echo "$as_me:9935: \$? = $ac_status" >&5
9936   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9937   { (eval echo "$as_me:9937: \"$ac_try\"") >&5
9938   (eval $ac_try) 2>&5
9939   ac_status=$?
9940   echo "$as_me:9940: \$? = $ac_status" >&5
9941   (exit $ac_status); }; }; then
9942   cf_have_ncuconfig=yes
9943 else
9944   echo "$as_me: program exited with status $ac_status" >&5
9945 echo "$as_me: failed program was:" >&5
9946 cat conftest.$ac_ext >&5
9947 cf_have_ncuconfig=no
9948 fi
9949 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9950 fi
9951 else
9952   echo "$as_me: failed program was:" >&5
9953 cat conftest.$ac_ext >&5
9954 cf_have_ncuconfig=no
9955 fi
9956 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9957                 echo "$as_me:9957: result: $cf_have_ncuconfig" >&5
9958 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9959                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9960                 if test "$cf_have_ncuconfig" != "yes"
9961                 then
9962                         CPPFLAGS="$cf_save_CPPFLAGS"
9963                         LIBS="$cf_save_LIBS"
9964                         NCURSES_CONFIG_PKG=none
9965                 else
9966
9967 cat >>confdefs.h <<\EOF
9968 #define NCURSES 1
9969 EOF
9970
9971                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9972
9973 echo "$as_me:9973: checking for terminfo header" >&5
9974 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9975 if test "${cf_cv_term_header+set}" = set; then
9976   echo $ECHO_N "(cached) $ECHO_C" >&6
9977 else
9978
9979 case ${cf_cv_ncurses_header} in
9980 (*/ncurses.h|*/ncursesw.h)
9981         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9982         ;;
9983 (*)
9984         cf_term_header=term.h
9985         ;;
9986 esac
9987
9988 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9989 do
9990 cat >conftest.$ac_ext <<_ACEOF
9991 #line 9991 "configure"
9992 #include "confdefs.h"
9993 #include <stdio.h>
9994 #include <${cf_cv_ncurses_header:-curses.h}>
9995 #include <$cf_test>
9996
9997 int
9998 main (void)
9999 {
10000 int x = auto_left_margin
10001   ;
10002   return 0;
10003 }
10004 _ACEOF
10005 rm -f conftest.$ac_objext
10006 if { (eval echo "$as_me:10006: \"$ac_compile\"") >&5
10007   (eval $ac_compile) 2>&5
10008   ac_status=$?
10009   echo "$as_me:10009: \$? = $ac_status" >&5
10010   (exit $ac_status); } &&
10011          { ac_try='test -s conftest.$ac_objext'
10012   { (eval echo "$as_me:10012: \"$ac_try\"") >&5
10013   (eval $ac_try) 2>&5
10014   ac_status=$?
10015   echo "$as_me:10015: \$? = $ac_status" >&5
10016   (exit $ac_status); }; }; then
10017
10018         cf_cv_term_header="$cf_test"
10019 else
10020   echo "$as_me: failed program was:" >&5
10021 cat conftest.$ac_ext >&5
10022
10023         cf_cv_term_header=unknown
10024
10025 fi
10026 rm -f conftest.$ac_objext conftest.$ac_ext
10027         test "$cf_cv_term_header" != unknown && break
10028 done
10029
10030 fi
10031 echo "$as_me:10031: result: $cf_cv_term_header" >&5
10032 echo "${ECHO_T}$cf_cv_term_header" >&6
10033
10034 # Set definitions to allow ifdef'ing to accommodate subdirectories
10035
10036 case $cf_cv_term_header in
10037 (*term.h)
10038
10039 cat >>confdefs.h <<\EOF
10040 #define HAVE_TERM_H 1
10041 EOF
10042
10043         ;;
10044 esac
10045
10046 case $cf_cv_term_header in
10047 (ncurses/term.h)
10048
10049 cat >>confdefs.h <<\EOF
10050 #define HAVE_NCURSES_TERM_H 1
10051 EOF
10052
10053         ;;
10054 (ncursesw/term.h)
10055
10056 cat >>confdefs.h <<\EOF
10057 #define HAVE_NCURSESW_TERM_H 1
10058 EOF
10059
10060         ;;
10061 esac
10062
10063                 fi
10064
10065         else
10066                 echo "$as_me:10066: result: no" >&5
10067 echo "${ECHO_T}no" >&6
10068                 NCURSES_CONFIG_PKG=none
10069         fi
10070 else
10071         NCURSES_CONFIG_PKG=none
10072 fi
10073
10074 if test "x$cf_have_ncuconfig" = "xno"; then
10075         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10076
10077 if test -n "$ac_tool_prefix"; then
10078   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10079   do
10080     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10081 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10082 echo "$as_me:10082: checking for $ac_word" >&5
10083 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10084 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10085   echo $ECHO_N "(cached) $ECHO_C" >&6
10086 else
10087   if test -n "$NCURSES_CONFIG"; then
10088   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10089 else
10090   ac_save_IFS=$IFS; IFS=$ac_path_separator
10091 ac_dummy="$PATH"
10092 for ac_dir in $ac_dummy; do
10093   IFS=$ac_save_IFS
10094   test -z "$ac_dir" && ac_dir=.
10095   $as_executable_p "$ac_dir/$ac_word" || continue
10096 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10097 echo "$as_me:10097: found $ac_dir/$ac_word" >&5
10098 break
10099 done
10100
10101 fi
10102 fi
10103 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10104 if test -n "$NCURSES_CONFIG"; then
10105   echo "$as_me:10105: result: $NCURSES_CONFIG" >&5
10106 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10107 else
10108   echo "$as_me:10108: result: no" >&5
10109 echo "${ECHO_T}no" >&6
10110 fi
10111
10112     test -n "$NCURSES_CONFIG" && break
10113   done
10114 fi
10115 if test -z "$NCURSES_CONFIG"; then
10116   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10117   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10118 do
10119   # Extract the first word of "$ac_prog", so it can be a program name with args.
10120 set dummy $ac_prog; ac_word=$2
10121 echo "$as_me:10121: checking for $ac_word" >&5
10122 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10123 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10124   echo $ECHO_N "(cached) $ECHO_C" >&6
10125 else
10126   if test -n "$ac_ct_NCURSES_CONFIG"; then
10127   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10128 else
10129   ac_save_IFS=$IFS; IFS=$ac_path_separator
10130 ac_dummy="$PATH"
10131 for ac_dir in $ac_dummy; do
10132   IFS=$ac_save_IFS
10133   test -z "$ac_dir" && ac_dir=.
10134   $as_executable_p "$ac_dir/$ac_word" || continue
10135 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10136 echo "$as_me:10136: found $ac_dir/$ac_word" >&5
10137 break
10138 done
10139
10140 fi
10141 fi
10142 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10143 if test -n "$ac_ct_NCURSES_CONFIG"; then
10144   echo "$as_me:10144: result: $ac_ct_NCURSES_CONFIG" >&5
10145 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10146 else
10147   echo "$as_me:10147: result: no" >&5
10148 echo "${ECHO_T}no" >&6
10149 fi
10150
10151   test -n "$ac_ct_NCURSES_CONFIG" && break
10152 done
10153 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10154
10155   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10156 fi
10157
10158         if test "$NCURSES_CONFIG" != none ; then
10159
10160 cf_fix_cppflags=no
10161 cf_new_cflags=
10162 cf_new_cppflags=
10163 cf_new_extra_cppflags=
10164
10165 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10166 do
10167 case $cf_fix_cppflags in
10168 (no)
10169         case $cf_add_cflags in
10170         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10171                 case $cf_add_cflags in
10172                 (-D*)
10173                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10174
10175                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10176                                 && test -z "${cf_tst_cflags}" \
10177                                 && cf_fix_cppflags=yes
10178
10179                         if test $cf_fix_cppflags = yes ; then
10180
10181         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10182         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10183
10184                                 continue
10185                         elif test "${cf_tst_cflags}" = "\"'" ; then
10186
10187         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10188         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10189
10190                                 continue
10191                         fi
10192                         ;;
10193                 esac
10194                 case "$CPPFLAGS" in
10195                 (*$cf_add_cflags)
10196                         ;;
10197                 (*)
10198                         case $cf_add_cflags in
10199                         (-D*)
10200                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10201
10202 CPPFLAGS=`echo "$CPPFLAGS" | \
10203         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10204                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10205
10206                                 ;;
10207                         esac
10208
10209         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10210         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10211
10212                         ;;
10213                 esac
10214                 ;;
10215         (*)
10216
10217         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10218         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10219
10220                 ;;
10221         esac
10222         ;;
10223 (yes)
10224
10225         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10226         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10227
10228         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10229
10230         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10231                 && test -z "${cf_tst_cflags}" \
10232                 && cf_fix_cppflags=no
10233         ;;
10234 esac
10235 done
10236
10237 if test -n "$cf_new_cflags" ; then
10238
10239         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10240         CFLAGS="${CFLAGS}$cf_new_cflags"
10241
10242 fi
10243
10244 if test -n "$cf_new_cppflags" ; then
10245
10246         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10247         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10248
10249 fi
10250
10251 if test -n "$cf_new_extra_cppflags" ; then
10252
10253         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10254         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10255
10256 fi
10257
10258 cf_add_libs="$LIBS"
10259 # reverse order
10260 cf_add_0lib=
10261 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10262 # filter duplicates
10263 for cf_add_1lib in $cf_add_0lib; do
10264         for cf_add_2lib in $cf_add_libs; do
10265                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10266                         cf_add_1lib=
10267                         break
10268                 fi
10269         done
10270         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10271 done
10272 LIBS="$cf_add_libs"
10273
10274                 # even with config script, some packages use no-override for curses.h
10275
10276 echo "$as_me:10276: checking if we have identified curses headers" >&5
10277 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10278 if test "${cf_cv_ncurses_header+set}" = set; then
10279   echo $ECHO_N "(cached) $ECHO_C" >&6
10280 else
10281
10282 cf_cv_ncurses_header=none
10283 for cf_header in \
10284         ncurses.h $cf_cv_screen/ncurses.h \
10285         curses.h $cf_cv_screen/curses.h
10286 do
10287 cat >conftest.$ac_ext <<_ACEOF
10288 #line 10288 "configure"
10289 #include "confdefs.h"
10290 #include <${cf_header}>
10291 int
10292 main (void)
10293 {
10294 initscr(); tgoto("?", 0,0)
10295   ;
10296   return 0;
10297 }
10298 _ACEOF
10299 rm -f conftest.$ac_objext
10300 if { (eval echo "$as_me:10300: \"$ac_compile\"") >&5
10301   (eval $ac_compile) 2>&5
10302   ac_status=$?
10303   echo "$as_me:10303: \$? = $ac_status" >&5
10304   (exit $ac_status); } &&
10305          { ac_try='test -s conftest.$ac_objext'
10306   { (eval echo "$as_me:10306: \"$ac_try\"") >&5
10307   (eval $ac_try) 2>&5
10308   ac_status=$?
10309   echo "$as_me:10309: \$? = $ac_status" >&5
10310   (exit $ac_status); }; }; then
10311   cf_cv_ncurses_header=$cf_header; break
10312 else
10313   echo "$as_me: failed program was:" >&5
10314 cat conftest.$ac_ext >&5
10315 fi
10316 rm -f conftest.$ac_objext conftest.$ac_ext
10317 done
10318
10319 fi
10320 echo "$as_me:10320: result: $cf_cv_ncurses_header" >&5
10321 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10322
10323 if test "$cf_cv_ncurses_header" = none ; then
10324         { { echo "$as_me:10324: error: No curses header-files found" >&5
10325 echo "$as_me: error: No curses header-files found" >&2;}
10326    { (exit 1); exit 1; }; }
10327 fi
10328
10329 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10330
10331 for ac_header in $cf_cv_ncurses_header
10332 do
10333 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10334 echo "$as_me:10334: checking for $ac_header" >&5
10335 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10336 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10337   echo $ECHO_N "(cached) $ECHO_C" >&6
10338 else
10339   cat >conftest.$ac_ext <<_ACEOF
10340 #line 10340 "configure"
10341 #include "confdefs.h"
10342 #include <$ac_header>
10343 _ACEOF
10344 if { (eval echo "$as_me:10344: \"$ac_cpp conftest.$ac_ext\"") >&5
10345   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10346   ac_status=$?
10347   egrep -v '^ *\+' conftest.er1 >conftest.err
10348   rm -f conftest.er1
10349   cat conftest.err >&5
10350   echo "$as_me:10350: \$? = $ac_status" >&5
10351   (exit $ac_status); } >/dev/null; then
10352   if test -s conftest.err; then
10353     ac_cpp_err=$ac_c_preproc_warn_flag
10354   else
10355     ac_cpp_err=
10356   fi
10357 else
10358   ac_cpp_err=yes
10359 fi
10360 if test -z "$ac_cpp_err"; then
10361   eval "$as_ac_Header=yes"
10362 else
10363   echo "$as_me: failed program was:" >&5
10364   cat conftest.$ac_ext >&5
10365   eval "$as_ac_Header=no"
10366 fi
10367 rm -f conftest.err conftest.$ac_ext
10368 fi
10369 echo "$as_me:10369: result: `eval echo '${'$as_ac_Header'}'`" >&5
10370 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10371 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10372   cat >>confdefs.h <<EOF
10373 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10374 EOF
10375
10376 fi
10377 done
10378
10379 cat >>confdefs.h <<\EOF
10380 #define NCURSES 1
10381 EOF
10382
10383 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10384
10385                 cat >>confdefs.h <<EOF
10386 #define $cf_nculib_ROOT 1
10387 EOF
10388
10389                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
10390
10391         else
10392
10393 cf_ncuhdr_root=$cf_cv_screen
10394
10395 test -n "$cf_cv_curses_dir" && \
10396 test "$cf_cv_curses_dir" != "no" && { \
10397
10398 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10399   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
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 }
10481
10482 echo "$as_me:10482: checking for $cf_ncuhdr_root header in include-path" >&5
10483 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10484 if test "${cf_cv_ncurses_h+set}" = set; then
10485   echo $ECHO_N "(cached) $ECHO_C" >&6
10486 else
10487
10488         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10489         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
10490         for cf_header in $cf_header_list
10491         do
10492
10493         cat >conftest.$ac_ext <<_ACEOF
10494 #line 10494 "configure"
10495 #include "confdefs.h"
10496
10497 #include <$cf_header>
10498 int
10499 main (void)
10500 {
10501
10502 #ifdef NCURSES_VERSION
10503
10504 printf("%s\n", NCURSES_VERSION);
10505 #else
10506 #ifdef __NCURSES_H
10507 printf("old\n");
10508 #else
10509         make an error
10510 #endif
10511 #endif
10512
10513   ;
10514   return 0;
10515 }
10516 _ACEOF
10517 rm -f conftest.$ac_objext
10518 if { (eval echo "$as_me:10518: \"$ac_compile\"") >&5
10519   (eval $ac_compile) 2>&5
10520   ac_status=$?
10521   echo "$as_me:10521: \$? = $ac_status" >&5
10522   (exit $ac_status); } &&
10523          { ac_try='test -s conftest.$ac_objext'
10524   { (eval echo "$as_me:10524: \"$ac_try\"") >&5
10525   (eval $ac_try) 2>&5
10526   ac_status=$?
10527   echo "$as_me:10527: \$? = $ac_status" >&5
10528   (exit $ac_status); }; }; then
10529   cf_cv_ncurses_h=$cf_header
10530
10531 else
10532   echo "$as_me: failed program was:" >&5
10533 cat conftest.$ac_ext >&5
10534 cf_cv_ncurses_h=no
10535 fi
10536 rm -f conftest.$ac_objext conftest.$ac_ext
10537
10538                 test "$cf_cv_ncurses_h" != no && break
10539         done
10540
10541 fi
10542 echo "$as_me:10542: result: $cf_cv_ncurses_h" >&5
10543 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10544
10545 if test "$cf_cv_ncurses_h" != no ; then
10546         cf_cv_ncurses_header=$cf_cv_ncurses_h
10547 else
10548
10549 echo "$as_me:10549: checking for $cf_ncuhdr_root include-path" >&5
10550 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10551 if test "${cf_cv_ncurses_h2+set}" = set; then
10552   echo $ECHO_N "(cached) $ECHO_C" >&6
10553 else
10554
10555         test -n "$verbose" && echo
10556
10557 cf_search=
10558
10559 # collect the current set of include-directories from compiler flags
10560 cf_header_path_list=""
10561 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10562         for cf_header_path in $CPPFLAGS $CFLAGS
10563         do
10564                 case $cf_header_path in
10565                 (-I*)
10566                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10567
10568 test "x$cf_header_path" != "xNONE" && \
10569 test -d "$cf_header_path" && \
10570  {
10571         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10572         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10573         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10574         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10575         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10576         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"
10577 }
10578
10579                         cf_header_path_list="$cf_header_path_list $cf_search"
10580                         ;;
10581                 esac
10582         done
10583 fi
10584
10585 # add the variations for the package we are looking for
10586
10587 cf_search=
10588
10589 test "x$prefix" != "xNONE" && \
10590 test -d "$prefix" && \
10591  {
10592         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10593         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10594         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10595         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10596         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10597         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10598 }
10599
10600 for cf_subdir_prefix in \
10601         /usr \
10602         /usr/local \
10603         /usr/pkg \
10604         /opt \
10605         /opt/local \
10606         $HOME
10607 do
10608
10609 test "x$cf_subdir_prefix" != "x$prefix" && \
10610 test -d "$cf_subdir_prefix" && \
10611 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10612         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10613         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10614         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10615         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10616         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10617         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"
10618 }
10619
10620 done
10621
10622 test "$includedir" != NONE && \
10623 test "$includedir" != "/usr/include" && \
10624 test -d "$includedir" && {
10625         test -d $includedir &&    cf_search="$cf_search $includedir"
10626         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10627 }
10628
10629 test "$oldincludedir" != NONE && \
10630 test "$oldincludedir" != "/usr/include" && \
10631 test -d "$oldincludedir" && {
10632         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10633         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10634 }
10635
10636 cf_search="$cf_search $cf_header_path_list"
10637
10638         test -n "$verbose" && echo search path $cf_search
10639         cf_save2_CPPFLAGS="$CPPFLAGS"
10640         for cf_incdir in $cf_search
10641         do
10642
10643 if test -n "$cf_incdir" ; then
10644   for cf_add_incdir in $cf_incdir
10645   do
10646         while test $cf_add_incdir != /usr/include
10647         do
10648           if test -d $cf_add_incdir
10649           then
10650                 cf_have_incdir=no
10651                 if test -n "$CFLAGS$CPPFLAGS" ; then
10652                   # a loop is needed to ensure we can add subdirs of existing dirs
10653                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10654                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10655                           cf_have_incdir=yes; break
10656                         fi
10657                   done
10658                 fi
10659
10660                 if test "$cf_have_incdir" = no ; then
10661                   if test "$cf_add_incdir" = /usr/local/include ; then
10662                         if test "$GCC" = yes
10663                         then
10664                           cf_save_CPPFLAGS=$CPPFLAGS
10665
10666         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10667         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10668
10669                           cat >conftest.$ac_ext <<_ACEOF
10670 #line 10670 "configure"
10671 #include "confdefs.h"
10672 #include <stdio.h>
10673 int
10674 main (void)
10675 {
10676 printf("Hello")
10677   ;
10678   return 0;
10679 }
10680 _ACEOF
10681 rm -f conftest.$ac_objext
10682 if { (eval echo "$as_me:10682: \"$ac_compile\"") >&5
10683   (eval $ac_compile) 2>&5
10684   ac_status=$?
10685   echo "$as_me:10685: \$? = $ac_status" >&5
10686   (exit $ac_status); } &&
10687          { ac_try='test -s conftest.$ac_objext'
10688   { (eval echo "$as_me:10688: \"$ac_try\"") >&5
10689   (eval $ac_try) 2>&5
10690   ac_status=$?
10691   echo "$as_me:10691: \$? = $ac_status" >&5
10692   (exit $ac_status); }; }; then
10693   :
10694 else
10695   echo "$as_me: failed program was:" >&5
10696 cat conftest.$ac_ext >&5
10697 cf_have_incdir=yes
10698 fi
10699 rm -f conftest.$ac_objext conftest.$ac_ext
10700                           CPPFLAGS=$cf_save_CPPFLAGS
10701                         fi
10702                   fi
10703                 fi
10704
10705                 if test "$cf_have_incdir" = no ; then
10706                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10707
10708 echo "${as_me:-configure}:10708: testing adding $cf_add_incdir to include-path ..." 1>&5
10709
10710                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10711
10712                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10713                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10714                   cf_add_incdir="$cf_top_incdir"
10715                 else
10716                   break
10717                 fi
10718           else
10719                 break
10720           fi
10721         done
10722   done
10723 fi
10724
10725                 for cf_header in \
10726                         ncurses.h \
10727                         curses.h
10728                 do
10729
10730         cat >conftest.$ac_ext <<_ACEOF
10731 #line 10731 "configure"
10732 #include "confdefs.h"
10733
10734 #include <$cf_header>
10735 int
10736 main (void)
10737 {
10738
10739 #ifdef NCURSES_VERSION
10740
10741 printf("%s\n", NCURSES_VERSION);
10742 #else
10743 #ifdef __NCURSES_H
10744 printf("old\n");
10745 #else
10746         make an error
10747 #endif
10748 #endif
10749
10750   ;
10751   return 0;
10752 }
10753 _ACEOF
10754 rm -f conftest.$ac_objext
10755 if { (eval echo "$as_me:10755: \"$ac_compile\"") >&5
10756   (eval $ac_compile) 2>&5
10757   ac_status=$?
10758   echo "$as_me:10758: \$? = $ac_status" >&5
10759   (exit $ac_status); } &&
10760          { ac_try='test -s conftest.$ac_objext'
10761   { (eval echo "$as_me:10761: \"$ac_try\"") >&5
10762   (eval $ac_try) 2>&5
10763   ac_status=$?
10764   echo "$as_me:10764: \$? = $ac_status" >&5
10765   (exit $ac_status); }; }; then
10766   cf_cv_ncurses_h2=$cf_header
10767
10768 else
10769   echo "$as_me: failed program was:" >&5
10770 cat conftest.$ac_ext >&5
10771 cf_cv_ncurses_h2=no
10772 fi
10773 rm -f conftest.$ac_objext conftest.$ac_ext
10774
10775                         if test "$cf_cv_ncurses_h2" != no ; then
10776                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10777                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10778                                 break
10779                         fi
10780                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10781                 done
10782                 CPPFLAGS="$cf_save2_CPPFLAGS"
10783                 test "$cf_cv_ncurses_h2" != no && break
10784         done
10785         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10785: error: not found" >&5
10786 echo "$as_me: error: not found" >&2;}
10787    { (exit 1); exit 1; }; }
10788
10789 fi
10790 echo "$as_me:10790: result: $cf_cv_ncurses_h2" >&5
10791 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10792
10793         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10794         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10795         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10796                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10797         fi
10798
10799 if test -n "$cf_1st_incdir" ; then
10800   for cf_add_incdir in $cf_1st_incdir
10801   do
10802         while test $cf_add_incdir != /usr/include
10803         do
10804           if test -d $cf_add_incdir
10805           then
10806                 cf_have_incdir=no
10807                 if test -n "$CFLAGS$CPPFLAGS" ; then
10808                   # a loop is needed to ensure we can add subdirs of existing dirs
10809                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10810                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10811                           cf_have_incdir=yes; break
10812                         fi
10813                   done
10814                 fi
10815
10816                 if test "$cf_have_incdir" = no ; then
10817                   if test "$cf_add_incdir" = /usr/local/include ; then
10818                         if test "$GCC" = yes
10819                         then
10820                           cf_save_CPPFLAGS=$CPPFLAGS
10821
10822         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10823         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10824
10825                           cat >conftest.$ac_ext <<_ACEOF
10826 #line 10826 "configure"
10827 #include "confdefs.h"
10828 #include <stdio.h>
10829 int
10830 main (void)
10831 {
10832 printf("Hello")
10833   ;
10834   return 0;
10835 }
10836 _ACEOF
10837 rm -f conftest.$ac_objext
10838 if { (eval echo "$as_me:10838: \"$ac_compile\"") >&5
10839   (eval $ac_compile) 2>&5
10840   ac_status=$?
10841   echo "$as_me:10841: \$? = $ac_status" >&5
10842   (exit $ac_status); } &&
10843          { ac_try='test -s conftest.$ac_objext'
10844   { (eval echo "$as_me:10844: \"$ac_try\"") >&5
10845   (eval $ac_try) 2>&5
10846   ac_status=$?
10847   echo "$as_me:10847: \$? = $ac_status" >&5
10848   (exit $ac_status); }; }; then
10849   :
10850 else
10851   echo "$as_me: failed program was:" >&5
10852 cat conftest.$ac_ext >&5
10853 cf_have_incdir=yes
10854 fi
10855 rm -f conftest.$ac_objext conftest.$ac_ext
10856                           CPPFLAGS=$cf_save_CPPFLAGS
10857                         fi
10858                   fi
10859                 fi
10860
10861                 if test "$cf_have_incdir" = no ; then
10862                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10863
10864 echo "${as_me:-configure}:10864: testing adding $cf_add_incdir to include-path ..." 1>&5
10865
10866                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10867
10868                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10869                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10870                   cf_add_incdir="$cf_top_incdir"
10871                 else
10872                   break
10873                 fi
10874           else
10875                 break
10876           fi
10877         done
10878   done
10879 fi
10880
10881 fi
10882
10883 # Set definitions to allow ifdef'ing for ncurses.h
10884
10885 case $cf_cv_ncurses_header in
10886 (*ncurses.h)
10887
10888 cat >>confdefs.h <<\EOF
10889 #define HAVE_NCURSES_H 1
10890 EOF
10891
10892         ;;
10893 esac
10894
10895 case $cf_cv_ncurses_header in
10896 (ncurses/curses.h|ncurses/ncurses.h)
10897
10898 cat >>confdefs.h <<\EOF
10899 #define HAVE_NCURSES_NCURSES_H 1
10900 EOF
10901
10902         ;;
10903 (ncursesw/curses.h|ncursesw/ncurses.h)
10904
10905 cat >>confdefs.h <<\EOF
10906 #define HAVE_NCURSESW_NCURSES_H 1
10907 EOF
10908
10909         ;;
10910 esac
10911
10912 echo "$as_me:10912: checking for terminfo header" >&5
10913 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10914 if test "${cf_cv_term_header+set}" = set; then
10915   echo $ECHO_N "(cached) $ECHO_C" >&6
10916 else
10917
10918 case ${cf_cv_ncurses_header} in
10919 (*/ncurses.h|*/ncursesw.h)
10920         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10921         ;;
10922 (*)
10923         cf_term_header=term.h
10924         ;;
10925 esac
10926
10927 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10928 do
10929 cat >conftest.$ac_ext <<_ACEOF
10930 #line 10930 "configure"
10931 #include "confdefs.h"
10932 #include <stdio.h>
10933 #include <${cf_cv_ncurses_header:-curses.h}>
10934 #include <$cf_test>
10935
10936 int
10937 main (void)
10938 {
10939 int x = auto_left_margin
10940   ;
10941   return 0;
10942 }
10943 _ACEOF
10944 rm -f conftest.$ac_objext
10945 if { (eval echo "$as_me:10945: \"$ac_compile\"") >&5
10946   (eval $ac_compile) 2>&5
10947   ac_status=$?
10948   echo "$as_me:10948: \$? = $ac_status" >&5
10949   (exit $ac_status); } &&
10950          { ac_try='test -s conftest.$ac_objext'
10951   { (eval echo "$as_me:10951: \"$ac_try\"") >&5
10952   (eval $ac_try) 2>&5
10953   ac_status=$?
10954   echo "$as_me:10954: \$? = $ac_status" >&5
10955   (exit $ac_status); }; }; then
10956
10957         cf_cv_term_header="$cf_test"
10958 else
10959   echo "$as_me: failed program was:" >&5
10960 cat conftest.$ac_ext >&5
10961
10962         cf_cv_term_header=unknown
10963
10964 fi
10965 rm -f conftest.$ac_objext conftest.$ac_ext
10966         test "$cf_cv_term_header" != unknown && break
10967 done
10968
10969 fi
10970 echo "$as_me:10970: result: $cf_cv_term_header" >&5
10971 echo "${ECHO_T}$cf_cv_term_header" >&6
10972
10973 # Set definitions to allow ifdef'ing to accommodate subdirectories
10974
10975 case $cf_cv_term_header in
10976 (*term.h)
10977
10978 cat >>confdefs.h <<\EOF
10979 #define HAVE_TERM_H 1
10980 EOF
10981
10982         ;;
10983 esac
10984
10985 case $cf_cv_term_header in
10986 (ncurses/term.h)
10987
10988 cat >>confdefs.h <<\EOF
10989 #define HAVE_NCURSES_TERM_H 1
10990 EOF
10991
10992         ;;
10993 (ncursesw/term.h)
10994
10995 cat >>confdefs.h <<\EOF
10996 #define HAVE_NCURSESW_TERM_H 1
10997 EOF
10998
10999         ;;
11000 esac
11001
11002 # some applications need this, but should check for NCURSES_VERSION
11003
11004 cat >>confdefs.h <<\EOF
11005 #define NCURSES 1
11006 EOF
11007
11008 echo "$as_me:11008: checking for ncurses version" >&5
11009 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11010 if test "${cf_cv_ncurses_version+set}" = set; then
11011   echo $ECHO_N "(cached) $ECHO_C" >&6
11012 else
11013
11014         cf_cv_ncurses_version=no
11015         cf_tempfile=out$$
11016         rm -f $cf_tempfile
11017         if test "$cross_compiling" = yes; then
11018
11019         # This will not work if the preprocessor splits the line after the
11020         # Autoconf token.  The 'unproto' program does that.
11021         cat > conftest.$ac_ext <<EOF
11022 #include <${cf_cv_ncurses_header:-curses.h}>
11023 #undef Autoconf
11024 #ifdef NCURSES_VERSION
11025 Autoconf NCURSES_VERSION
11026 #else
11027 #ifdef __NCURSES_H
11028 Autoconf "old"
11029 #endif
11030 ;
11031 #endif
11032 EOF
11033         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11034         { (eval echo "$as_me:11034: \"$cf_try\"") >&5
11035   (eval $cf_try) 2>&5
11036   ac_status=$?
11037   echo "$as_me:11037: \$? = $ac_status" >&5
11038   (exit $ac_status); }
11039         if test -f conftest.out ; then
11040                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
11041                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11042                 rm -f conftest.out
11043         fi
11044
11045 else
11046   cat >conftest.$ac_ext <<_ACEOF
11047 #line 11047 "configure"
11048 #include "confdefs.h"
11049
11050 #include <${cf_cv_ncurses_header:-curses.h}>
11051 #include <stdio.h>
11052 int main(void)
11053 {
11054         FILE *fp = fopen("$cf_tempfile", "w");
11055 #ifdef NCURSES_VERSION
11056 # ifdef NCURSES_VERSION_PATCH
11057         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11058 # else
11059         fprintf(fp, "%s\n", NCURSES_VERSION);
11060 # endif
11061 #else
11062 # ifdef __NCURSES_H
11063         fprintf(fp, "old\n");
11064 # else
11065         make an error
11066 # endif
11067 #endif
11068         ${cf_cv_main_return:-return}(0);
11069 }
11070 _ACEOF
11071 rm -f conftest$ac_exeext
11072 if { (eval echo "$as_me:11072: \"$ac_link\"") >&5
11073   (eval $ac_link) 2>&5
11074   ac_status=$?
11075   echo "$as_me:11075: \$? = $ac_status" >&5
11076   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11077   { (eval echo "$as_me:11077: \"$ac_try\"") >&5
11078   (eval $ac_try) 2>&5
11079   ac_status=$?
11080   echo "$as_me:11080: \$? = $ac_status" >&5
11081   (exit $ac_status); }; }; then
11082
11083         cf_cv_ncurses_version=`cat $cf_tempfile`
11084 else
11085   echo "$as_me: program exited with status $ac_status" >&5
11086 echo "$as_me: failed program was:" >&5
11087 cat conftest.$ac_ext >&5
11088 fi
11089 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11090 fi
11091         rm -f $cf_tempfile
11092
11093 fi
11094 echo "$as_me:11094: result: $cf_cv_ncurses_version" >&5
11095 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11096 test "$cf_cv_ncurses_version" = no ||
11097 cat >>confdefs.h <<\EOF
11098 #define NCURSES 1
11099 EOF
11100
11101 cf_nculib_root=$cf_cv_screen
11102         # This works, except for the special case where we find gpm, but
11103         # ncurses is in a nonstandard location via $LIBS, and we really want
11104         # to link gpm.
11105 cf_ncurses_LIBS=""
11106 cf_ncurses_SAVE="$LIBS"
11107 echo "$as_me:11107: checking for Gpm_Open in -lgpm" >&5
11108 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11109 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11110   echo $ECHO_N "(cached) $ECHO_C" >&6
11111 else
11112   ac_check_lib_save_LIBS=$LIBS
11113 LIBS="-lgpm  $LIBS"
11114 cat >conftest.$ac_ext <<_ACEOF
11115 #line 11115 "configure"
11116 #include "confdefs.h"
11117
11118 /* Override any gcc2 internal prototype to avoid an error.  */
11119 #ifdef __cplusplus
11120 extern "C"
11121 #endif
11122 /* We use char because int might match the return type of a gcc2
11123    builtin and then its argument prototype would still apply.  */
11124 char Gpm_Open ();
11125 int
11126 main (void)
11127 {
11128 Gpm_Open ();
11129   ;
11130   return 0;
11131 }
11132 _ACEOF
11133 rm -f conftest.$ac_objext conftest$ac_exeext
11134 if { (eval echo "$as_me:11134: \"$ac_link\"") >&5
11135   (eval $ac_link) 2>&5
11136   ac_status=$?
11137   echo "$as_me:11137: \$? = $ac_status" >&5
11138   (exit $ac_status); } &&
11139          { ac_try='test -s conftest$ac_exeext'
11140   { (eval echo "$as_me:11140: \"$ac_try\"") >&5
11141   (eval $ac_try) 2>&5
11142   ac_status=$?
11143   echo "$as_me:11143: \$? = $ac_status" >&5
11144   (exit $ac_status); }; }; then
11145   ac_cv_lib_gpm_Gpm_Open=yes
11146 else
11147   echo "$as_me: failed program was:" >&5
11148 cat conftest.$ac_ext >&5
11149 ac_cv_lib_gpm_Gpm_Open=no
11150 fi
11151 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11152 LIBS=$ac_check_lib_save_LIBS
11153 fi
11154 echo "$as_me:11154: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11155 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11156 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
11157   echo "$as_me:11157: checking for initscr in -lgpm" >&5
11158 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11159 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11160   echo $ECHO_N "(cached) $ECHO_C" >&6
11161 else
11162   ac_check_lib_save_LIBS=$LIBS
11163 LIBS="-lgpm  $LIBS"
11164 cat >conftest.$ac_ext <<_ACEOF
11165 #line 11165 "configure"
11166 #include "confdefs.h"
11167
11168 /* Override any gcc2 internal prototype to avoid an error.  */
11169 #ifdef __cplusplus
11170 extern "C"
11171 #endif
11172 /* We use char because int might match the return type of a gcc2
11173    builtin and then its argument prototype would still apply.  */
11174 char initscr ();
11175 int
11176 main (void)
11177 {
11178 initscr ();
11179   ;
11180   return 0;
11181 }
11182 _ACEOF
11183 rm -f conftest.$ac_objext conftest$ac_exeext
11184 if { (eval echo "$as_me:11184: \"$ac_link\"") >&5
11185   (eval $ac_link) 2>&5
11186   ac_status=$?
11187   echo "$as_me:11187: \$? = $ac_status" >&5
11188   (exit $ac_status); } &&
11189          { ac_try='test -s conftest$ac_exeext'
11190   { (eval echo "$as_me:11190: \"$ac_try\"") >&5
11191   (eval $ac_try) 2>&5
11192   ac_status=$?
11193   echo "$as_me:11193: \$? = $ac_status" >&5
11194   (exit $ac_status); }; }; then
11195   ac_cv_lib_gpm_initscr=yes
11196 else
11197   echo "$as_me: failed program was:" >&5
11198 cat conftest.$ac_ext >&5
11199 ac_cv_lib_gpm_initscr=no
11200 fi
11201 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11202 LIBS=$ac_check_lib_save_LIBS
11203 fi
11204 echo "$as_me:11204: result: $ac_cv_lib_gpm_initscr" >&5
11205 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11206 if test $ac_cv_lib_gpm_initscr = yes; then
11207   LIBS="$cf_ncurses_SAVE"
11208 else
11209   cf_ncurses_LIBS="-lgpm"
11210 fi
11211
11212 fi
11213
11214 case $host_os in
11215 (freebsd*)
11216         # This is only necessary if you are linking against an obsolete
11217         # version of ncurses (but it should do no harm, since it's static).
11218         if test "$cf_nculib_root" = ncurses ; then
11219                 echo "$as_me:11219: checking for tgoto in -lmytinfo" >&5
11220 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11221 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11222   echo $ECHO_N "(cached) $ECHO_C" >&6
11223 else
11224   ac_check_lib_save_LIBS=$LIBS
11225 LIBS="-lmytinfo  $LIBS"
11226 cat >conftest.$ac_ext <<_ACEOF
11227 #line 11227 "configure"
11228 #include "confdefs.h"
11229
11230 /* Override any gcc2 internal prototype to avoid an error.  */
11231 #ifdef __cplusplus
11232 extern "C"
11233 #endif
11234 /* We use char because int might match the return type of a gcc2
11235    builtin and then its argument prototype would still apply.  */
11236 char tgoto ();
11237 int
11238 main (void)
11239 {
11240 tgoto ();
11241   ;
11242   return 0;
11243 }
11244 _ACEOF
11245 rm -f conftest.$ac_objext conftest$ac_exeext
11246 if { (eval echo "$as_me:11246: \"$ac_link\"") >&5
11247   (eval $ac_link) 2>&5
11248   ac_status=$?
11249   echo "$as_me:11249: \$? = $ac_status" >&5
11250   (exit $ac_status); } &&
11251          { ac_try='test -s conftest$ac_exeext'
11252   { (eval echo "$as_me:11252: \"$ac_try\"") >&5
11253   (eval $ac_try) 2>&5
11254   ac_status=$?
11255   echo "$as_me:11255: \$? = $ac_status" >&5
11256   (exit $ac_status); }; }; then
11257   ac_cv_lib_mytinfo_tgoto=yes
11258 else
11259   echo "$as_me: failed program was:" >&5
11260 cat conftest.$ac_ext >&5
11261 ac_cv_lib_mytinfo_tgoto=no
11262 fi
11263 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11264 LIBS=$ac_check_lib_save_LIBS
11265 fi
11266 echo "$as_me:11266: result: $ac_cv_lib_mytinfo_tgoto" >&5
11267 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11268 if test $ac_cv_lib_mytinfo_tgoto = yes; then
11269   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11270 fi
11271
11272         fi
11273         ;;
11274 esac
11275
11276 cf_add_libs="$LIBS"
11277 # reverse order
11278 cf_add_0lib=
11279 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11280 # filter duplicates
11281 for cf_add_1lib in $cf_add_0lib; do
11282         for cf_add_2lib in $cf_add_libs; do
11283                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11284                         cf_add_1lib=
11285                         break
11286                 fi
11287         done
11288         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11289 done
11290 LIBS="$cf_add_libs"
11291
11292 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
11293 then
11294
11295 cf_add_libs="$LIBS"
11296 # reverse order
11297 cf_add_0lib=
11298 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11299 # filter duplicates
11300 for cf_add_1lib in $cf_add_0lib; do
11301         for cf_add_2lib in $cf_add_libs; do
11302                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11303                         cf_add_1lib=
11304                         break
11305                 fi
11306         done
11307         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11308 done
11309 LIBS="$cf_add_libs"
11310
11311 else
11312
11313         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
11314         cf_libdir=""
11315         echo "$as_me:11315: checking for initscr" >&5
11316 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11317 if test "${ac_cv_func_initscr+set}" = set; then
11318   echo $ECHO_N "(cached) $ECHO_C" >&6
11319 else
11320   cat >conftest.$ac_ext <<_ACEOF
11321 #line 11321 "configure"
11322 #include "confdefs.h"
11323 #define initscr autoconf_temporary
11324 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11325 #undef initscr
11326
11327 #ifdef __cplusplus
11328 extern "C"
11329 #endif
11330
11331 /* We use char because int might match the return type of a gcc2
11332    builtin and then its argument prototype would still apply.  */
11333 char initscr (void);
11334
11335 int
11336 main (void)
11337 {
11338
11339 /* The GNU C library defines stubs for functions which it implements
11340     to always fail with ENOSYS.  Some functions are actually named
11341     something starting with __ and the normal name is an alias.  */
11342 #if defined (__stub_initscr) || defined (__stub___initscr)
11343 #error found stub for initscr
11344 #endif
11345
11346         return initscr ();
11347   ;
11348   return 0;
11349 }
11350 _ACEOF
11351 rm -f conftest.$ac_objext conftest$ac_exeext
11352 if { (eval echo "$as_me:11352: \"$ac_link\"") >&5
11353   (eval $ac_link) 2>&5
11354   ac_status=$?
11355   echo "$as_me:11355: \$? = $ac_status" >&5
11356   (exit $ac_status); } &&
11357          { ac_try='test -s conftest$ac_exeext'
11358   { (eval echo "$as_me:11358: \"$ac_try\"") >&5
11359   (eval $ac_try) 2>&5
11360   ac_status=$?
11361   echo "$as_me:11361: \$? = $ac_status" >&5
11362   (exit $ac_status); }; }; then
11363   ac_cv_func_initscr=yes
11364 else
11365   echo "$as_me: failed program was:" >&5
11366 cat conftest.$ac_ext >&5
11367 ac_cv_func_initscr=no
11368 fi
11369 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11370 fi
11371 echo "$as_me:11371: result: $ac_cv_func_initscr" >&5
11372 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11373 if test $ac_cv_func_initscr = yes; then
11374   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11375 else
11376
11377                 cf_save_LIBS="$LIBS"
11378                 echo "$as_me:11378: checking for initscr in -l$cf_nculib_root" >&5
11379 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11380                 LIBS="-l$cf_nculib_root $LIBS"
11381                 cat >conftest.$ac_ext <<_ACEOF
11382 #line 11382 "configure"
11383 #include "confdefs.h"
11384 #include <${cf_cv_ncurses_header:-curses.h}>
11385 int
11386 main (void)
11387 {
11388 initscr()
11389   ;
11390   return 0;
11391 }
11392 _ACEOF
11393 rm -f conftest.$ac_objext conftest$ac_exeext
11394 if { (eval echo "$as_me:11394: \"$ac_link\"") >&5
11395   (eval $ac_link) 2>&5
11396   ac_status=$?
11397   echo "$as_me:11397: \$? = $ac_status" >&5
11398   (exit $ac_status); } &&
11399          { ac_try='test -s conftest$ac_exeext'
11400   { (eval echo "$as_me:11400: \"$ac_try\"") >&5
11401   (eval $ac_try) 2>&5
11402   ac_status=$?
11403   echo "$as_me:11403: \$? = $ac_status" >&5
11404   (exit $ac_status); }; }; then
11405   echo "$as_me:11405: result: yes" >&5
11406 echo "${ECHO_T}yes" >&6
11407                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11408
11409 else
11410   echo "$as_me: failed program was:" >&5
11411 cat conftest.$ac_ext >&5
11412 echo "$as_me:11412: result: no" >&5
11413 echo "${ECHO_T}no" >&6
11414
11415 cf_search=
11416 cf_library_path_list=""
11417 if test -n "${LDFLAGS}${LIBS}" ; then
11418         for cf_library_path in $LDFLAGS $LIBS
11419         do
11420                 case $cf_library_path in
11421                 (-L*)
11422                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11423
11424 test "x$cf_library_path" != "xNONE" && \
11425 test -d "$cf_library_path" && \
11426  {
11427         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11428         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
11429         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11430         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11431         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11432         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"
11433 }
11434
11435                         cf_library_path_list="$cf_library_path_list $cf_search"
11436                         ;;
11437                 esac
11438         done
11439 fi
11440
11441 cf_search=
11442
11443 test "x$prefix" != "xNONE" && \
11444 test -d "$prefix" && \
11445  {
11446         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11447         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
11448         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11449         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11450         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11451         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11452 }
11453
11454 for cf_subdir_prefix in \
11455         /usr \
11456         /usr/local \
11457         /usr/pkg \
11458         /opt \
11459         /opt/local \
11460         $HOME
11461 do
11462
11463 test "x$cf_subdir_prefix" != "x$prefix" && \
11464 test -d "$cf_subdir_prefix" && \
11465 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
11466         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11467         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11468         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11469         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11470         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11471         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"
11472 }
11473
11474 done
11475
11476 cf_search="$cf_library_path_list $cf_search"
11477
11478                         for cf_libdir in $cf_search
11479                         do
11480                                 echo "$as_me:11480: checking for -l$cf_nculib_root in $cf_libdir" >&5
11481 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11482                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11483                                 cat >conftest.$ac_ext <<_ACEOF
11484 #line 11484 "configure"
11485 #include "confdefs.h"
11486 #include <${cf_cv_ncurses_header:-curses.h}>
11487 int
11488 main (void)
11489 {
11490 initscr()
11491   ;
11492   return 0;
11493 }
11494 _ACEOF
11495 rm -f conftest.$ac_objext conftest$ac_exeext
11496 if { (eval echo "$as_me:11496: \"$ac_link\"") >&5
11497   (eval $ac_link) 2>&5
11498   ac_status=$?
11499   echo "$as_me:11499: \$? = $ac_status" >&5
11500   (exit $ac_status); } &&
11501          { ac_try='test -s conftest$ac_exeext'
11502   { (eval echo "$as_me:11502: \"$ac_try\"") >&5
11503   (eval $ac_try) 2>&5
11504   ac_status=$?
11505   echo "$as_me:11505: \$? = $ac_status" >&5
11506   (exit $ac_status); }; }; then
11507   echo "$as_me:11507: result: yes" >&5
11508 echo "${ECHO_T}yes" >&6
11509                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11510                                          break
11511 else
11512   echo "$as_me: failed program was:" >&5
11513 cat conftest.$ac_ext >&5
11514 echo "$as_me:11514: result: no" >&5
11515 echo "${ECHO_T}no" >&6
11516                                          LIBS="$cf_save_LIBS"
11517 fi
11518 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11519                         done
11520
11521 fi
11522 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11523
11524 fi
11525
11526 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11527
11528 if test $cf_found_library = no ; then
11529         { { echo "$as_me:11529: error: Cannot link $cf_nculib_root library" >&5
11530 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11531    { (exit 1); exit 1; }; }
11532 fi
11533
11534 fi
11535
11536 if test -n "$cf_ncurses_LIBS" ; then
11537         echo "$as_me:11537: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11538 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11539         cf_ncurses_SAVE="$LIBS"
11540         for p in $cf_ncurses_LIBS ; do
11541                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11542                 if test "$q" != "$LIBS" ; then
11543                         LIBS="$q"
11544                 fi
11545         done
11546         cat >conftest.$ac_ext <<_ACEOF
11547 #line 11547 "configure"
11548 #include "confdefs.h"
11549 #include <${cf_cv_ncurses_header:-curses.h}>
11550 int
11551 main (void)
11552 {
11553 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11554   ;
11555   return 0;
11556 }
11557 _ACEOF
11558 rm -f conftest.$ac_objext conftest$ac_exeext
11559 if { (eval echo "$as_me:11559: \"$ac_link\"") >&5
11560   (eval $ac_link) 2>&5
11561   ac_status=$?
11562   echo "$as_me:11562: \$? = $ac_status" >&5
11563   (exit $ac_status); } &&
11564          { ac_try='test -s conftest$ac_exeext'
11565   { (eval echo "$as_me:11565: \"$ac_try\"") >&5
11566   (eval $ac_try) 2>&5
11567   ac_status=$?
11568   echo "$as_me:11568: \$? = $ac_status" >&5
11569   (exit $ac_status); }; }; then
11570   echo "$as_me:11570: result: yes" >&5
11571 echo "${ECHO_T}yes" >&6
11572 else
11573   echo "$as_me: failed program was:" >&5
11574 cat conftest.$ac_ext >&5
11575 echo "$as_me:11575: result: no" >&5
11576 echo "${ECHO_T}no" >&6
11577                  LIBS="$cf_ncurses_SAVE"
11578 fi
11579 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11580 fi
11581
11582 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11583
11584 cat >>confdefs.h <<EOF
11585 #define $cf_nculib_ROOT 1
11586 EOF
11587
11588         fi
11589 else
11590         NCURSES_CONFIG=none
11591 fi
11592
11593         ;;
11594 (pdcurses)
11595         echo "$as_me:11595: checking for X" >&5
11596 echo $ECHO_N "checking for X... $ECHO_C" >&6
11597
11598 # Check whether --with-x or --without-x was given.
11599 if test "${with_x+set}" = set; then
11600   withval="$with_x"
11601
11602 fi;
11603 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11604 if test "x$with_x" = xno; then
11605   # The user explicitly disabled X.
11606   have_x=disabled
11607 else
11608   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11609     # Both variables are already set.
11610     have_x=yes
11611   else
11612     if test "${ac_cv_have_x+set}" = set; then
11613   echo $ECHO_N "(cached) $ECHO_C" >&6
11614 else
11615   # One or both of the vars are not set, and there is no cached value.
11616 ac_x_includes=no ac_x_libraries=no
11617 rm -fr conftest.dir
11618 if mkdir conftest.dir; then
11619   cd conftest.dir
11620   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11621   cat >Imakefile <<'EOF'
11622 acfindx:
11623         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11624 EOF
11625   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11626     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11627     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11628     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11629     for ac_extension in a so sl dylib dll; do
11630       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11631          test -f $ac_im_libdir/libX11.$ac_extension; then
11632         ac_im_usrlibdir=$ac_im_libdir; break
11633       fi
11634     done
11635     # Screen out bogus values from the imake configuration.  They are
11636     # bogus both because they are the default anyway, and because
11637     # using them would break gcc on systems where it needs fixed includes.
11638     case $ac_im_incroot in
11639         /usr/include) ;;
11640         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11641     esac
11642     case $ac_im_usrlibdir in
11643         /usr/lib | /lib) ;;
11644         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11645     esac
11646   fi
11647   cd ..
11648   rm -fr conftest.dir
11649 fi
11650
11651 # Standard set of common directories for X headers.
11652 # Check X11 before X11Rn because it is often a symlink to the current release.
11653 ac_x_header_dirs='
11654 /usr/X11/include
11655 /usr/X11R7/include
11656 /usr/X11R6/include
11657 /usr/X11R5/include
11658 /usr/X11R4/include
11659
11660 /opt/local/include
11661 /opt/X11/include
11662
11663 /usr/include/X11
11664 /usr/include/X11R7
11665 /usr/include/X11R6
11666 /usr/include/X11R5
11667 /usr/include/X11R4
11668
11669 /usr/local/X11/include
11670 /usr/local/X11R7/include
11671 /usr/local/X11R6/include
11672 /usr/local/X11R5/include
11673 /usr/local/X11R4/include
11674
11675 /usr/local/include/X11
11676 /usr/local/include/X11R7
11677 /usr/local/include/X11R6
11678 /usr/local/include/X11R5
11679 /usr/local/include/X11R4
11680
11681 /usr/X386/include
11682 /usr/x386/include
11683 /usr/XFree86/include/X11
11684
11685 /usr/include
11686 /usr/local/include
11687 /usr/unsupported/include
11688 /usr/athena/include
11689 /usr/local/x11r5/include
11690 /usr/lpp/Xamples/include
11691
11692 /usr/openwin/include
11693 /usr/openwin/share/include'
11694
11695 if test "$ac_x_includes" = no; then
11696   # Guess where to find include files, by looking for Intrinsic.h.
11697   # First, try using that file with no special directory specified.
11698   cat >conftest.$ac_ext <<_ACEOF
11699 #line 11699 "configure"
11700 #include "confdefs.h"
11701 #include <X11/Intrinsic.h>
11702 _ACEOF
11703 if { (eval echo "$as_me:11703: \"$ac_cpp conftest.$ac_ext\"") >&5
11704   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11705   ac_status=$?
11706   egrep -v '^ *\+' conftest.er1 >conftest.err
11707   rm -f conftest.er1
11708   cat conftest.err >&5
11709   echo "$as_me:11709: \$? = $ac_status" >&5
11710   (exit $ac_status); } >/dev/null; then
11711   if test -s conftest.err; then
11712     ac_cpp_err=$ac_c_preproc_warn_flag
11713   else
11714     ac_cpp_err=
11715   fi
11716 else
11717   ac_cpp_err=yes
11718 fi
11719 if test -z "$ac_cpp_err"; then
11720   # We can compile using X headers with no special include directory.
11721 ac_x_includes=
11722 else
11723   echo "$as_me: failed program was:" >&5
11724   cat conftest.$ac_ext >&5
11725   for ac_dir in $ac_x_header_dirs; do
11726   if test -r "$ac_dir/X11/Intrinsic.h"; then
11727     ac_x_includes=$ac_dir
11728     break
11729   fi
11730 done
11731 fi
11732 rm -f conftest.err conftest.$ac_ext
11733 fi # $ac_x_includes = no
11734
11735 if test "$ac_x_libraries" = no; then
11736   # Check for the libraries.
11737   # See if we find them without any special options.
11738   # Don't add to $LIBS permanently.
11739   ac_save_LIBS=$LIBS
11740   LIBS="-lXt $LIBS"
11741   cat >conftest.$ac_ext <<_ACEOF
11742 #line 11742 "configure"
11743 #include "confdefs.h"
11744 #include <X11/Intrinsic.h>
11745 int
11746 main (void)
11747 {
11748 XtMalloc (0)
11749   ;
11750   return 0;
11751 }
11752 _ACEOF
11753 rm -f conftest.$ac_objext conftest$ac_exeext
11754 if { (eval echo "$as_me:11754: \"$ac_link\"") >&5
11755   (eval $ac_link) 2>&5
11756   ac_status=$?
11757   echo "$as_me:11757: \$? = $ac_status" >&5
11758   (exit $ac_status); } &&
11759          { ac_try='test -s conftest$ac_exeext'
11760   { (eval echo "$as_me:11760: \"$ac_try\"") >&5
11761   (eval $ac_try) 2>&5
11762   ac_status=$?
11763   echo "$as_me:11763: \$? = $ac_status" >&5
11764   (exit $ac_status); }; }; then
11765   LIBS=$ac_save_LIBS
11766 # We can link X programs with no special library path.
11767 ac_x_libraries=
11768 else
11769   echo "$as_me: failed program was:" >&5
11770 cat conftest.$ac_ext >&5
11771 LIBS=$ac_save_LIBS
11772 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11773 do
11774   # Don't even attempt the hair of trying to link an X program!
11775   for ac_extension in a so sl dylib dll; do
11776     if test -r $ac_dir/libXt.$ac_extension; then
11777       ac_x_libraries=$ac_dir
11778       break 2
11779     fi
11780   done
11781 done
11782 fi
11783 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11784 fi # $ac_x_libraries = no
11785
11786 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11787   # Didn't find X anywhere.  Cache the known absence of X.
11788   ac_cv_have_x="have_x=no"
11789 else
11790   # Record where we found X for the cache.
11791   ac_cv_have_x="have_x=yes \
11792                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11793 fi
11794 fi
11795
11796   fi
11797   eval "$ac_cv_have_x"
11798 fi # $with_x != no
11799
11800 if test "$have_x" != yes; then
11801   echo "$as_me:11801: result: $have_x" >&5
11802 echo "${ECHO_T}$have_x" >&6
11803   no_x=yes
11804 else
11805   # If each of the values was on the command line, it overrides each guess.
11806   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11807   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11808   # Update the cache value to reflect the command line values.
11809   ac_cv_have_x="have_x=yes \
11810                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11811   echo "$as_me:11811: result: libraries $x_libraries, headers $x_includes" >&5
11812 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11813 fi
11814
11815 if test "$no_x" = yes; then
11816   # Not all programs may use this symbol, but it does not hurt to define it.
11817
11818 cat >>confdefs.h <<\EOF
11819 #define X_DISPLAY_MISSING 1
11820 EOF
11821
11822   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11823 else
11824   if test -n "$x_includes"; then
11825     X_CFLAGS="$X_CFLAGS -I$x_includes"
11826   fi
11827
11828   # It would also be nice to do this for all -L options, not just this one.
11829   if test -n "$x_libraries"; then
11830     X_LIBS="$X_LIBS -L$x_libraries"
11831     # For Solaris; some versions of Sun CC require a space after -R and
11832     # others require no space.  Words are not sufficient . . . .
11833     case `(uname -sr) 2>/dev/null` in
11834     "SunOS 5"*)
11835       echo "$as_me:11835: checking whether -R must be followed by a space" >&5
11836 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11837       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11838       cat >conftest.$ac_ext <<_ACEOF
11839 #line 11839 "configure"
11840 #include "confdefs.h"
11841
11842 int
11843 main (void)
11844 {
11845
11846   ;
11847   return 0;
11848 }
11849 _ACEOF
11850 rm -f conftest.$ac_objext conftest$ac_exeext
11851 if { (eval echo "$as_me:11851: \"$ac_link\"") >&5
11852   (eval $ac_link) 2>&5
11853   ac_status=$?
11854   echo "$as_me:11854: \$? = $ac_status" >&5
11855   (exit $ac_status); } &&
11856          { ac_try='test -s conftest$ac_exeext'
11857   { (eval echo "$as_me:11857: \"$ac_try\"") >&5
11858   (eval $ac_try) 2>&5
11859   ac_status=$?
11860   echo "$as_me:11860: \$? = $ac_status" >&5
11861   (exit $ac_status); }; }; then
11862   ac_R_nospace=yes
11863 else
11864   echo "$as_me: failed program was:" >&5
11865 cat conftest.$ac_ext >&5
11866 ac_R_nospace=no
11867 fi
11868 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11869       if test $ac_R_nospace = yes; then
11870         echo "$as_me:11870: result: no" >&5
11871 echo "${ECHO_T}no" >&6
11872         X_LIBS="$X_LIBS -R$x_libraries"
11873       else
11874         LIBS="$ac_xsave_LIBS -R $x_libraries"
11875         cat >conftest.$ac_ext <<_ACEOF
11876 #line 11876 "configure"
11877 #include "confdefs.h"
11878
11879 int
11880 main (void)
11881 {
11882
11883   ;
11884   return 0;
11885 }
11886 _ACEOF
11887 rm -f conftest.$ac_objext conftest$ac_exeext
11888 if { (eval echo "$as_me:11888: \"$ac_link\"") >&5
11889   (eval $ac_link) 2>&5
11890   ac_status=$?
11891   echo "$as_me:11891: \$? = $ac_status" >&5
11892   (exit $ac_status); } &&
11893          { ac_try='test -s conftest$ac_exeext'
11894   { (eval echo "$as_me:11894: \"$ac_try\"") >&5
11895   (eval $ac_try) 2>&5
11896   ac_status=$?
11897   echo "$as_me:11897: \$? = $ac_status" >&5
11898   (exit $ac_status); }; }; then
11899   ac_R_space=yes
11900 else
11901   echo "$as_me: failed program was:" >&5
11902 cat conftest.$ac_ext >&5
11903 ac_R_space=no
11904 fi
11905 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11906         if test $ac_R_space = yes; then
11907           echo "$as_me:11907: result: yes" >&5
11908 echo "${ECHO_T}yes" >&6
11909           X_LIBS="$X_LIBS -R $x_libraries"
11910         else
11911           echo "$as_me:11911: result: neither works" >&5
11912 echo "${ECHO_T}neither works" >&6
11913         fi
11914       fi
11915       LIBS=$ac_xsave_LIBS
11916     esac
11917   fi
11918
11919   # Check for system-dependent libraries X programs must link with.
11920   # Do this before checking for the system-independent R6 libraries
11921   # (-lICE), since we may need -lsocket or whatever for X linking.
11922
11923   if test "$ISC" = yes; then
11924     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11925   else
11926     # Martyn Johnson says this is needed for Ultrix, if the X
11927     # libraries were built with DECnet support.  And Karl Berry says
11928     # the Alpha needs dnet_stub (dnet does not exist).
11929     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11930     cat >conftest.$ac_ext <<_ACEOF
11931 #line 11931 "configure"
11932 #include "confdefs.h"
11933
11934 /* Override any gcc2 internal prototype to avoid an error.  */
11935 #ifdef __cplusplus
11936 extern "C"
11937 #endif
11938 /* We use char because int might match the return type of a gcc2
11939    builtin and then its argument prototype would still apply.  */
11940 char XOpenDisplay ();
11941 int
11942 main (void)
11943 {
11944 XOpenDisplay ();
11945   ;
11946   return 0;
11947 }
11948 _ACEOF
11949 rm -f conftest.$ac_objext conftest$ac_exeext
11950 if { (eval echo "$as_me:11950: \"$ac_link\"") >&5
11951   (eval $ac_link) 2>&5
11952   ac_status=$?
11953   echo "$as_me:11953: \$? = $ac_status" >&5
11954   (exit $ac_status); } &&
11955          { ac_try='test -s conftest$ac_exeext'
11956   { (eval echo "$as_me:11956: \"$ac_try\"") >&5
11957   (eval $ac_try) 2>&5
11958   ac_status=$?
11959   echo "$as_me:11959: \$? = $ac_status" >&5
11960   (exit $ac_status); }; }; then
11961   :
11962 else
11963   echo "$as_me: failed program was:" >&5
11964 cat conftest.$ac_ext >&5
11965 echo "$as_me:11965: checking for dnet_ntoa in -ldnet" >&5
11966 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11967 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11968   echo $ECHO_N "(cached) $ECHO_C" >&6
11969 else
11970   ac_check_lib_save_LIBS=$LIBS
11971 LIBS="-ldnet  $LIBS"
11972 cat >conftest.$ac_ext <<_ACEOF
11973 #line 11973 "configure"
11974 #include "confdefs.h"
11975
11976 /* Override any gcc2 internal prototype to avoid an error.  */
11977 #ifdef __cplusplus
11978 extern "C"
11979 #endif
11980 /* We use char because int might match the return type of a gcc2
11981    builtin and then its argument prototype would still apply.  */
11982 char dnet_ntoa ();
11983 int
11984 main (void)
11985 {
11986 dnet_ntoa ();
11987   ;
11988   return 0;
11989 }
11990 _ACEOF
11991 rm -f conftest.$ac_objext conftest$ac_exeext
11992 if { (eval echo "$as_me:11992: \"$ac_link\"") >&5
11993   (eval $ac_link) 2>&5
11994   ac_status=$?
11995   echo "$as_me:11995: \$? = $ac_status" >&5
11996   (exit $ac_status); } &&
11997          { ac_try='test -s conftest$ac_exeext'
11998   { (eval echo "$as_me:11998: \"$ac_try\"") >&5
11999   (eval $ac_try) 2>&5
12000   ac_status=$?
12001   echo "$as_me:12001: \$? = $ac_status" >&5
12002   (exit $ac_status); }; }; then
12003   ac_cv_lib_dnet_dnet_ntoa=yes
12004 else
12005   echo "$as_me: failed program was:" >&5
12006 cat conftest.$ac_ext >&5
12007 ac_cv_lib_dnet_dnet_ntoa=no
12008 fi
12009 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12010 LIBS=$ac_check_lib_save_LIBS
12011 fi
12012 echo "$as_me:12012: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12013 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12014 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
12015   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12016 fi
12017
12018     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12019       echo "$as_me:12019: checking for dnet_ntoa in -ldnet_stub" >&5
12020 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12021 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12022   echo $ECHO_N "(cached) $ECHO_C" >&6
12023 else
12024   ac_check_lib_save_LIBS=$LIBS
12025 LIBS="-ldnet_stub  $LIBS"
12026 cat >conftest.$ac_ext <<_ACEOF
12027 #line 12027 "configure"
12028 #include "confdefs.h"
12029
12030 /* Override any gcc2 internal prototype to avoid an error.  */
12031 #ifdef __cplusplus
12032 extern "C"
12033 #endif
12034 /* We use char because int might match the return type of a gcc2
12035    builtin and then its argument prototype would still apply.  */
12036 char dnet_ntoa ();
12037 int
12038 main (void)
12039 {
12040 dnet_ntoa ();
12041   ;
12042   return 0;
12043 }
12044 _ACEOF
12045 rm -f conftest.$ac_objext conftest$ac_exeext
12046 if { (eval echo "$as_me:12046: \"$ac_link\"") >&5
12047   (eval $ac_link) 2>&5
12048   ac_status=$?
12049   echo "$as_me:12049: \$? = $ac_status" >&5
12050   (exit $ac_status); } &&
12051          { ac_try='test -s conftest$ac_exeext'
12052   { (eval echo "$as_me:12052: \"$ac_try\"") >&5
12053   (eval $ac_try) 2>&5
12054   ac_status=$?
12055   echo "$as_me:12055: \$? = $ac_status" >&5
12056   (exit $ac_status); }; }; then
12057   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12058 else
12059   echo "$as_me: failed program was:" >&5
12060 cat conftest.$ac_ext >&5
12061 ac_cv_lib_dnet_stub_dnet_ntoa=no
12062 fi
12063 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12064 LIBS=$ac_check_lib_save_LIBS
12065 fi
12066 echo "$as_me:12066: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12067 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12068 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
12069   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12070 fi
12071
12072     fi
12073 fi
12074 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12075     LIBS="$ac_xsave_LIBS"
12076
12077     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12078     # to get the SysV transport functions.
12079     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12080     # needs -lnsl.
12081     # The nsl library prevents programs from opening the X display
12082     # on Irix 5.2, according to T.E. Dickey.
12083     # The functions gethostbyname, getservbyname, and inet_addr are
12084     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12085     echo "$as_me:12085: checking for gethostbyname" >&5
12086 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12087 if test "${ac_cv_func_gethostbyname+set}" = set; then
12088   echo $ECHO_N "(cached) $ECHO_C" >&6
12089 else
12090   cat >conftest.$ac_ext <<_ACEOF
12091 #line 12091 "configure"
12092 #include "confdefs.h"
12093 #define gethostbyname autoconf_temporary
12094 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12095 #undef gethostbyname
12096
12097 #ifdef __cplusplus
12098 extern "C"
12099 #endif
12100
12101 /* We use char because int might match the return type of a gcc2
12102    builtin and then its argument prototype would still apply.  */
12103 char gethostbyname (void);
12104
12105 int
12106 main (void)
12107 {
12108
12109 /* The GNU C library defines stubs for functions which it implements
12110     to always fail with ENOSYS.  Some functions are actually named
12111     something starting with __ and the normal name is an alias.  */
12112 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12113 #error found stub for gethostbyname
12114 #endif
12115
12116         return gethostbyname ();
12117   ;
12118   return 0;
12119 }
12120 _ACEOF
12121 rm -f conftest.$ac_objext conftest$ac_exeext
12122 if { (eval echo "$as_me:12122: \"$ac_link\"") >&5
12123   (eval $ac_link) 2>&5
12124   ac_status=$?
12125   echo "$as_me:12125: \$? = $ac_status" >&5
12126   (exit $ac_status); } &&
12127          { ac_try='test -s conftest$ac_exeext'
12128   { (eval echo "$as_me:12128: \"$ac_try\"") >&5
12129   (eval $ac_try) 2>&5
12130   ac_status=$?
12131   echo "$as_me:12131: \$? = $ac_status" >&5
12132   (exit $ac_status); }; }; then
12133   ac_cv_func_gethostbyname=yes
12134 else
12135   echo "$as_me: failed program was:" >&5
12136 cat conftest.$ac_ext >&5
12137 ac_cv_func_gethostbyname=no
12138 fi
12139 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12140 fi
12141 echo "$as_me:12141: result: $ac_cv_func_gethostbyname" >&5
12142 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12143
12144     if test $ac_cv_func_gethostbyname = no; then
12145       echo "$as_me:12145: checking for gethostbyname in -lnsl" >&5
12146 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12147 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12148   echo $ECHO_N "(cached) $ECHO_C" >&6
12149 else
12150   ac_check_lib_save_LIBS=$LIBS
12151 LIBS="-lnsl  $LIBS"
12152 cat >conftest.$ac_ext <<_ACEOF
12153 #line 12153 "configure"
12154 #include "confdefs.h"
12155
12156 /* Override any gcc2 internal prototype to avoid an error.  */
12157 #ifdef __cplusplus
12158 extern "C"
12159 #endif
12160 /* We use char because int might match the return type of a gcc2
12161    builtin and then its argument prototype would still apply.  */
12162 char gethostbyname ();
12163 int
12164 main (void)
12165 {
12166 gethostbyname ();
12167   ;
12168   return 0;
12169 }
12170 _ACEOF
12171 rm -f conftest.$ac_objext conftest$ac_exeext
12172 if { (eval echo "$as_me:12172: \"$ac_link\"") >&5
12173   (eval $ac_link) 2>&5
12174   ac_status=$?
12175   echo "$as_me:12175: \$? = $ac_status" >&5
12176   (exit $ac_status); } &&
12177          { ac_try='test -s conftest$ac_exeext'
12178   { (eval echo "$as_me:12178: \"$ac_try\"") >&5
12179   (eval $ac_try) 2>&5
12180   ac_status=$?
12181   echo "$as_me:12181: \$? = $ac_status" >&5
12182   (exit $ac_status); }; }; then
12183   ac_cv_lib_nsl_gethostbyname=yes
12184 else
12185   echo "$as_me: failed program was:" >&5
12186 cat conftest.$ac_ext >&5
12187 ac_cv_lib_nsl_gethostbyname=no
12188 fi
12189 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12190 LIBS=$ac_check_lib_save_LIBS
12191 fi
12192 echo "$as_me:12192: result: $ac_cv_lib_nsl_gethostbyname" >&5
12193 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12194 if test $ac_cv_lib_nsl_gethostbyname = yes; then
12195   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12196 fi
12197
12198       if test $ac_cv_lib_nsl_gethostbyname = no; then
12199         echo "$as_me:12199: checking for gethostbyname in -lbsd" >&5
12200 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12201 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12202   echo $ECHO_N "(cached) $ECHO_C" >&6
12203 else
12204   ac_check_lib_save_LIBS=$LIBS
12205 LIBS="-lbsd  $LIBS"
12206 cat >conftest.$ac_ext <<_ACEOF
12207 #line 12207 "configure"
12208 #include "confdefs.h"
12209
12210 /* Override any gcc2 internal prototype to avoid an error.  */
12211 #ifdef __cplusplus
12212 extern "C"
12213 #endif
12214 /* We use char because int might match the return type of a gcc2
12215    builtin and then its argument prototype would still apply.  */
12216 char gethostbyname ();
12217 int
12218 main (void)
12219 {
12220 gethostbyname ();
12221   ;
12222   return 0;
12223 }
12224 _ACEOF
12225 rm -f conftest.$ac_objext conftest$ac_exeext
12226 if { (eval echo "$as_me:12226: \"$ac_link\"") >&5
12227   (eval $ac_link) 2>&5
12228   ac_status=$?
12229   echo "$as_me:12229: \$? = $ac_status" >&5
12230   (exit $ac_status); } &&
12231          { ac_try='test -s conftest$ac_exeext'
12232   { (eval echo "$as_me:12232: \"$ac_try\"") >&5
12233   (eval $ac_try) 2>&5
12234   ac_status=$?
12235   echo "$as_me:12235: \$? = $ac_status" >&5
12236   (exit $ac_status); }; }; then
12237   ac_cv_lib_bsd_gethostbyname=yes
12238 else
12239   echo "$as_me: failed program was:" >&5
12240 cat conftest.$ac_ext >&5
12241 ac_cv_lib_bsd_gethostbyname=no
12242 fi
12243 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12244 LIBS=$ac_check_lib_save_LIBS
12245 fi
12246 echo "$as_me:12246: result: $ac_cv_lib_bsd_gethostbyname" >&5
12247 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12248 if test $ac_cv_lib_bsd_gethostbyname = yes; then
12249   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12250 fi
12251
12252       fi
12253     fi
12254
12255     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12256     # socket/setsockopt and other routines are undefined under SCO ODT
12257     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12258     # on later versions), says Simon Leinen: it contains gethostby*
12259     # variants that don't use the nameserver (or something).  -lsocket
12260     # must be given before -lnsl if both are needed.  We assume that
12261     # if connect needs -lnsl, so does gethostbyname.
12262     echo "$as_me:12262: checking for connect" >&5
12263 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12264 if test "${ac_cv_func_connect+set}" = set; then
12265   echo $ECHO_N "(cached) $ECHO_C" >&6
12266 else
12267   cat >conftest.$ac_ext <<_ACEOF
12268 #line 12268 "configure"
12269 #include "confdefs.h"
12270 #define connect autoconf_temporary
12271 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12272 #undef connect
12273
12274 #ifdef __cplusplus
12275 extern "C"
12276 #endif
12277
12278 /* We use char because int might match the return type of a gcc2
12279    builtin and then its argument prototype would still apply.  */
12280 char connect (void);
12281
12282 int
12283 main (void)
12284 {
12285
12286 /* The GNU C library defines stubs for functions which it implements
12287     to always fail with ENOSYS.  Some functions are actually named
12288     something starting with __ and the normal name is an alias.  */
12289 #if defined (__stub_connect) || defined (__stub___connect)
12290 #error found stub for connect
12291 #endif
12292
12293         return connect ();
12294   ;
12295   return 0;
12296 }
12297 _ACEOF
12298 rm -f conftest.$ac_objext conftest$ac_exeext
12299 if { (eval echo "$as_me:12299: \"$ac_link\"") >&5
12300   (eval $ac_link) 2>&5
12301   ac_status=$?
12302   echo "$as_me:12302: \$? = $ac_status" >&5
12303   (exit $ac_status); } &&
12304          { ac_try='test -s conftest$ac_exeext'
12305   { (eval echo "$as_me:12305: \"$ac_try\"") >&5
12306   (eval $ac_try) 2>&5
12307   ac_status=$?
12308   echo "$as_me:12308: \$? = $ac_status" >&5
12309   (exit $ac_status); }; }; then
12310   ac_cv_func_connect=yes
12311 else
12312   echo "$as_me: failed program was:" >&5
12313 cat conftest.$ac_ext >&5
12314 ac_cv_func_connect=no
12315 fi
12316 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12317 fi
12318 echo "$as_me:12318: result: $ac_cv_func_connect" >&5
12319 echo "${ECHO_T}$ac_cv_func_connect" >&6
12320
12321     if test $ac_cv_func_connect = no; then
12322       echo "$as_me:12322: checking for connect in -lsocket" >&5
12323 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12324 if test "${ac_cv_lib_socket_connect+set}" = set; then
12325   echo $ECHO_N "(cached) $ECHO_C" >&6
12326 else
12327   ac_check_lib_save_LIBS=$LIBS
12328 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12329 cat >conftest.$ac_ext <<_ACEOF
12330 #line 12330 "configure"
12331 #include "confdefs.h"
12332
12333 /* Override any gcc2 internal prototype to avoid an error.  */
12334 #ifdef __cplusplus
12335 extern "C"
12336 #endif
12337 /* We use char because int might match the return type of a gcc2
12338    builtin and then its argument prototype would still apply.  */
12339 char connect ();
12340 int
12341 main (void)
12342 {
12343 connect ();
12344   ;
12345   return 0;
12346 }
12347 _ACEOF
12348 rm -f conftest.$ac_objext conftest$ac_exeext
12349 if { (eval echo "$as_me:12349: \"$ac_link\"") >&5
12350   (eval $ac_link) 2>&5
12351   ac_status=$?
12352   echo "$as_me:12352: \$? = $ac_status" >&5
12353   (exit $ac_status); } &&
12354          { ac_try='test -s conftest$ac_exeext'
12355   { (eval echo "$as_me:12355: \"$ac_try\"") >&5
12356   (eval $ac_try) 2>&5
12357   ac_status=$?
12358   echo "$as_me:12358: \$? = $ac_status" >&5
12359   (exit $ac_status); }; }; then
12360   ac_cv_lib_socket_connect=yes
12361 else
12362   echo "$as_me: failed program was:" >&5
12363 cat conftest.$ac_ext >&5
12364 ac_cv_lib_socket_connect=no
12365 fi
12366 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12367 LIBS=$ac_check_lib_save_LIBS
12368 fi
12369 echo "$as_me:12369: result: $ac_cv_lib_socket_connect" >&5
12370 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12371 if test $ac_cv_lib_socket_connect = yes; then
12372   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12373 fi
12374
12375     fi
12376
12377     # Guillermo Gomez says -lposix is necessary on A/UX.
12378     echo "$as_me:12378: checking for remove" >&5
12379 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12380 if test "${ac_cv_func_remove+set}" = set; then
12381   echo $ECHO_N "(cached) $ECHO_C" >&6
12382 else
12383   cat >conftest.$ac_ext <<_ACEOF
12384 #line 12384 "configure"
12385 #include "confdefs.h"
12386 #define remove autoconf_temporary
12387 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12388 #undef remove
12389
12390 #ifdef __cplusplus
12391 extern "C"
12392 #endif
12393
12394 /* We use char because int might match the return type of a gcc2
12395    builtin and then its argument prototype would still apply.  */
12396 char remove (void);
12397
12398 int
12399 main (void)
12400 {
12401
12402 /* The GNU C library defines stubs for functions which it implements
12403     to always fail with ENOSYS.  Some functions are actually named
12404     something starting with __ and the normal name is an alias.  */
12405 #if defined (__stub_remove) || defined (__stub___remove)
12406 #error found stub for remove
12407 #endif
12408
12409         return remove ();
12410   ;
12411   return 0;
12412 }
12413 _ACEOF
12414 rm -f conftest.$ac_objext conftest$ac_exeext
12415 if { (eval echo "$as_me:12415: \"$ac_link\"") >&5
12416   (eval $ac_link) 2>&5
12417   ac_status=$?
12418   echo "$as_me:12418: \$? = $ac_status" >&5
12419   (exit $ac_status); } &&
12420          { ac_try='test -s conftest$ac_exeext'
12421   { (eval echo "$as_me:12421: \"$ac_try\"") >&5
12422   (eval $ac_try) 2>&5
12423   ac_status=$?
12424   echo "$as_me:12424: \$? = $ac_status" >&5
12425   (exit $ac_status); }; }; then
12426   ac_cv_func_remove=yes
12427 else
12428   echo "$as_me: failed program was:" >&5
12429 cat conftest.$ac_ext >&5
12430 ac_cv_func_remove=no
12431 fi
12432 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12433 fi
12434 echo "$as_me:12434: result: $ac_cv_func_remove" >&5
12435 echo "${ECHO_T}$ac_cv_func_remove" >&6
12436
12437     if test $ac_cv_func_remove = no; then
12438       echo "$as_me:12438: checking for remove in -lposix" >&5
12439 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12440 if test "${ac_cv_lib_posix_remove+set}" = set; then
12441   echo $ECHO_N "(cached) $ECHO_C" >&6
12442 else
12443   ac_check_lib_save_LIBS=$LIBS
12444 LIBS="-lposix  $LIBS"
12445 cat >conftest.$ac_ext <<_ACEOF
12446 #line 12446 "configure"
12447 #include "confdefs.h"
12448
12449 /* Override any gcc2 internal prototype to avoid an error.  */
12450 #ifdef __cplusplus
12451 extern "C"
12452 #endif
12453 /* We use char because int might match the return type of a gcc2
12454    builtin and then its argument prototype would still apply.  */
12455 char remove ();
12456 int
12457 main (void)
12458 {
12459 remove ();
12460   ;
12461   return 0;
12462 }
12463 _ACEOF
12464 rm -f conftest.$ac_objext conftest$ac_exeext
12465 if { (eval echo "$as_me:12465: \"$ac_link\"") >&5
12466   (eval $ac_link) 2>&5
12467   ac_status=$?
12468   echo "$as_me:12468: \$? = $ac_status" >&5
12469   (exit $ac_status); } &&
12470          { ac_try='test -s conftest$ac_exeext'
12471   { (eval echo "$as_me:12471: \"$ac_try\"") >&5
12472   (eval $ac_try) 2>&5
12473   ac_status=$?
12474   echo "$as_me:12474: \$? = $ac_status" >&5
12475   (exit $ac_status); }; }; then
12476   ac_cv_lib_posix_remove=yes
12477 else
12478   echo "$as_me: failed program was:" >&5
12479 cat conftest.$ac_ext >&5
12480 ac_cv_lib_posix_remove=no
12481 fi
12482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12483 LIBS=$ac_check_lib_save_LIBS
12484 fi
12485 echo "$as_me:12485: result: $ac_cv_lib_posix_remove" >&5
12486 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12487 if test $ac_cv_lib_posix_remove = yes; then
12488   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12489 fi
12490
12491     fi
12492
12493     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12494     echo "$as_me:12494: checking for shmat" >&5
12495 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12496 if test "${ac_cv_func_shmat+set}" = set; then
12497   echo $ECHO_N "(cached) $ECHO_C" >&6
12498 else
12499   cat >conftest.$ac_ext <<_ACEOF
12500 #line 12500 "configure"
12501 #include "confdefs.h"
12502 #define shmat autoconf_temporary
12503 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12504 #undef shmat
12505
12506 #ifdef __cplusplus
12507 extern "C"
12508 #endif
12509
12510 /* We use char because int might match the return type of a gcc2
12511    builtin and then its argument prototype would still apply.  */
12512 char shmat (void);
12513
12514 int
12515 main (void)
12516 {
12517
12518 /* The GNU C library defines stubs for functions which it implements
12519     to always fail with ENOSYS.  Some functions are actually named
12520     something starting with __ and the normal name is an alias.  */
12521 #if defined (__stub_shmat) || defined (__stub___shmat)
12522 #error found stub for shmat
12523 #endif
12524
12525         return shmat ();
12526   ;
12527   return 0;
12528 }
12529 _ACEOF
12530 rm -f conftest.$ac_objext conftest$ac_exeext
12531 if { (eval echo "$as_me:12531: \"$ac_link\"") >&5
12532   (eval $ac_link) 2>&5
12533   ac_status=$?
12534   echo "$as_me:12534: \$? = $ac_status" >&5
12535   (exit $ac_status); } &&
12536          { ac_try='test -s conftest$ac_exeext'
12537   { (eval echo "$as_me:12537: \"$ac_try\"") >&5
12538   (eval $ac_try) 2>&5
12539   ac_status=$?
12540   echo "$as_me:12540: \$? = $ac_status" >&5
12541   (exit $ac_status); }; }; then
12542   ac_cv_func_shmat=yes
12543 else
12544   echo "$as_me: failed program was:" >&5
12545 cat conftest.$ac_ext >&5
12546 ac_cv_func_shmat=no
12547 fi
12548 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12549 fi
12550 echo "$as_me:12550: result: $ac_cv_func_shmat" >&5
12551 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12552
12553     if test $ac_cv_func_shmat = no; then
12554       echo "$as_me:12554: checking for shmat in -lipc" >&5
12555 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12556 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12557   echo $ECHO_N "(cached) $ECHO_C" >&6
12558 else
12559   ac_check_lib_save_LIBS=$LIBS
12560 LIBS="-lipc  $LIBS"
12561 cat >conftest.$ac_ext <<_ACEOF
12562 #line 12562 "configure"
12563 #include "confdefs.h"
12564
12565 /* Override any gcc2 internal prototype to avoid an error.  */
12566 #ifdef __cplusplus
12567 extern "C"
12568 #endif
12569 /* We use char because int might match the return type of a gcc2
12570    builtin and then its argument prototype would still apply.  */
12571 char shmat ();
12572 int
12573 main (void)
12574 {
12575 shmat ();
12576   ;
12577   return 0;
12578 }
12579 _ACEOF
12580 rm -f conftest.$ac_objext conftest$ac_exeext
12581 if { (eval echo "$as_me:12581: \"$ac_link\"") >&5
12582   (eval $ac_link) 2>&5
12583   ac_status=$?
12584   echo "$as_me:12584: \$? = $ac_status" >&5
12585   (exit $ac_status); } &&
12586          { ac_try='test -s conftest$ac_exeext'
12587   { (eval echo "$as_me:12587: \"$ac_try\"") >&5
12588   (eval $ac_try) 2>&5
12589   ac_status=$?
12590   echo "$as_me:12590: \$? = $ac_status" >&5
12591   (exit $ac_status); }; }; then
12592   ac_cv_lib_ipc_shmat=yes
12593 else
12594   echo "$as_me: failed program was:" >&5
12595 cat conftest.$ac_ext >&5
12596 ac_cv_lib_ipc_shmat=no
12597 fi
12598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12599 LIBS=$ac_check_lib_save_LIBS
12600 fi
12601 echo "$as_me:12601: result: $ac_cv_lib_ipc_shmat" >&5
12602 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12603 if test $ac_cv_lib_ipc_shmat = yes; then
12604   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12605 fi
12606
12607     fi
12608   fi
12609
12610   # Check for libraries that X11R6 Xt/Xaw programs need.
12611   ac_save_LDFLAGS=$LDFLAGS
12612   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12613   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12614   # check for ICE first), but we must link in the order -lSM -lICE or
12615   # we get undefined symbols.  So assume we have SM if we have ICE.
12616   # These have to be linked with before -lX11, unlike the other
12617   # libraries we check for below, so use a different variable.
12618   # John Interrante, Karl Berry
12619   echo "$as_me:12619: checking for IceConnectionNumber in -lICE" >&5
12620 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12621 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12622   echo $ECHO_N "(cached) $ECHO_C" >&6
12623 else
12624   ac_check_lib_save_LIBS=$LIBS
12625 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12626 cat >conftest.$ac_ext <<_ACEOF
12627 #line 12627 "configure"
12628 #include "confdefs.h"
12629
12630 /* Override any gcc2 internal prototype to avoid an error.  */
12631 #ifdef __cplusplus
12632 extern "C"
12633 #endif
12634 /* We use char because int might match the return type of a gcc2
12635    builtin and then its argument prototype would still apply.  */
12636 char IceConnectionNumber ();
12637 int
12638 main (void)
12639 {
12640 IceConnectionNumber ();
12641   ;
12642   return 0;
12643 }
12644 _ACEOF
12645 rm -f conftest.$ac_objext conftest$ac_exeext
12646 if { (eval echo "$as_me:12646: \"$ac_link\"") >&5
12647   (eval $ac_link) 2>&5
12648   ac_status=$?
12649   echo "$as_me:12649: \$? = $ac_status" >&5
12650   (exit $ac_status); } &&
12651          { ac_try='test -s conftest$ac_exeext'
12652   { (eval echo "$as_me:12652: \"$ac_try\"") >&5
12653   (eval $ac_try) 2>&5
12654   ac_status=$?
12655   echo "$as_me:12655: \$? = $ac_status" >&5
12656   (exit $ac_status); }; }; then
12657   ac_cv_lib_ICE_IceConnectionNumber=yes
12658 else
12659   echo "$as_me: failed program was:" >&5
12660 cat conftest.$ac_ext >&5
12661 ac_cv_lib_ICE_IceConnectionNumber=no
12662 fi
12663 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12664 LIBS=$ac_check_lib_save_LIBS
12665 fi
12666 echo "$as_me:12666: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12667 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12668 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12669   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12670 fi
12671
12672   LDFLAGS=$ac_save_LDFLAGS
12673
12674 fi
12675
12676 cf_x_athena=${cf_x_athena:-Xaw}
12677
12678 echo "$as_me:12678: checking if you want to link with Xaw 3d library" >&5
12679 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12680 withval=
12681
12682 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12683 if test "${with_Xaw3d+set}" = set; then
12684   withval="$with_Xaw3d"
12685
12686 fi;
12687 if test "$withval" = yes ; then
12688         cf_x_athena=Xaw3d
12689         echo "$as_me:12689: result: yes" >&5
12690 echo "${ECHO_T}yes" >&6
12691 else
12692         echo "$as_me:12692: result: no" >&5
12693 echo "${ECHO_T}no" >&6
12694 fi
12695
12696 echo "$as_me:12696: checking if you want to link with Xaw 3d xft library" >&5
12697 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12698 withval=
12699
12700 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12701 if test "${with_Xaw3dxft+set}" = set; then
12702   withval="$with_Xaw3dxft"
12703
12704 fi;
12705 if test "$withval" = yes ; then
12706         cf_x_athena=Xaw3dxft
12707         echo "$as_me:12707: result: yes" >&5
12708 echo "${ECHO_T}yes" >&6
12709 else
12710         echo "$as_me:12710: result: no" >&5
12711 echo "${ECHO_T}no" >&6
12712 fi
12713
12714 echo "$as_me:12714: checking if you want to link with neXT Athena library" >&5
12715 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12716 withval=
12717
12718 # Check whether --with-neXtaw or --without-neXtaw was given.
12719 if test "${with_neXtaw+set}" = set; then
12720   withval="$with_neXtaw"
12721
12722 fi;
12723 if test "$withval" = yes ; then
12724         cf_x_athena=neXtaw
12725         echo "$as_me:12725: result: yes" >&5
12726 echo "${ECHO_T}yes" >&6
12727 else
12728         echo "$as_me:12728: result: no" >&5
12729 echo "${ECHO_T}no" >&6
12730 fi
12731
12732 echo "$as_me:12732: checking if you want to link with Athena-Plus library" >&5
12733 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12734 withval=
12735
12736 # Check whether --with-XawPlus or --without-XawPlus was given.
12737 if test "${with_XawPlus+set}" = set; then
12738   withval="$with_XawPlus"
12739
12740 fi;
12741 if test "$withval" = yes ; then
12742         cf_x_athena=XawPlus
12743         echo "$as_me:12743: result: yes" >&5
12744 echo "${ECHO_T}yes" >&6
12745 else
12746         echo "$as_me:12746: result: no" >&5
12747 echo "${ECHO_T}no" >&6
12748 fi
12749
12750 cf_x_athena_lib=""
12751
12752 if test "$PKG_CONFIG" != none ; then
12753         cf_athena_list=
12754         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12755         for cf_athena_pkg in \
12756                 $cf_athena_list \
12757                 ${cf_x_athena} \
12758                 ${cf_x_athena}-devel \
12759                 lib${cf_x_athena} \
12760                 lib${cf_x_athena}-devel
12761         do
12762
12763 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12764         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12765
12766 echo "${as_me:-configure}:12766: testing found package $cf_athena_pkg ..." 1>&5
12767
12768         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12769         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12770         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12771
12772 echo "${as_me:-configure}:12772: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12773
12774         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12775
12776 echo "${as_me:-configure}:12776: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12777
12778 cf_fix_cppflags=no
12779 cf_new_cflags=
12780 cf_new_cppflags=
12781 cf_new_extra_cppflags=
12782
12783 for cf_add_cflags in $cf_pkgconfig_incs
12784 do
12785 case $cf_fix_cppflags in
12786 (no)
12787         case $cf_add_cflags in
12788         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12789                 case $cf_add_cflags in
12790                 (-D*)
12791                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12792
12793                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12794                                 && test -z "${cf_tst_cflags}" \
12795                                 && cf_fix_cppflags=yes
12796
12797                         if test $cf_fix_cppflags = yes ; then
12798
12799         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12800         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12801
12802                                 continue
12803                         elif test "${cf_tst_cflags}" = "\"'" ; then
12804
12805         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12806         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12807
12808                                 continue
12809                         fi
12810                         ;;
12811                 esac
12812                 case "$CPPFLAGS" in
12813                 (*$cf_add_cflags)
12814                         ;;
12815                 (*)
12816                         case $cf_add_cflags in
12817                         (-D*)
12818                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12819
12820 CPPFLAGS=`echo "$CPPFLAGS" | \
12821         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12822                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12823
12824                                 ;;
12825                         esac
12826
12827         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12828         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12829
12830                         ;;
12831                 esac
12832                 ;;
12833         (*)
12834
12835         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12836         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12837
12838                 ;;
12839         esac
12840         ;;
12841 (yes)
12842
12843         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12844         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12845
12846         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12847
12848         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12849                 && test -z "${cf_tst_cflags}" \
12850                 && cf_fix_cppflags=no
12851         ;;
12852 esac
12853 done
12854
12855 if test -n "$cf_new_cflags" ; then
12856
12857         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12858         CFLAGS="${CFLAGS}$cf_new_cflags"
12859
12860 fi
12861
12862 if test -n "$cf_new_cppflags" ; then
12863
12864         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12865         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12866
12867 fi
12868
12869 if test -n "$cf_new_extra_cppflags" ; then
12870
12871         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12872         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12873
12874 fi
12875
12876 cf_add_libs="$LIBS"
12877 # reverse order
12878 cf_add_0lib=
12879 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12880 # filter duplicates
12881 for cf_add_1lib in $cf_add_0lib; do
12882         for cf_add_2lib in $cf_add_libs; do
12883                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12884                         cf_add_1lib=
12885                         break
12886                 fi
12887         done
12888         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12889 done
12890 LIBS="$cf_add_libs"
12891
12892                         cf_x_athena_lib="$cf_pkgconfig_libs"
12893
12894 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12895
12896                         cat >>confdefs.h <<EOF
12897 #define $cf_x_athena_LIBS 1
12898 EOF
12899
12900         for cf_trim_lib in Xmu Xt X11
12901         do
12902                 case "$LIBS" in
12903                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12904                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12905                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12906
12907 echo "${as_me:-configure}:12907: testing ..trimmed $LIBS ..." 1>&5
12908
12909                         ;;
12910                 esac
12911         done
12912
12913 echo "$as_me:12913: checking for usable $cf_x_athena/Xmu package" >&5
12914 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12915 if test "${cf_cv_xaw_compat+set}" = set; then
12916   echo $ECHO_N "(cached) $ECHO_C" >&6
12917 else
12918
12919 cat >conftest.$ac_ext <<_ACEOF
12920 #line 12920 "configure"
12921 #include "confdefs.h"
12922
12923 #include <X11/Xmu/CharSet.h>
12924
12925 int
12926 main (void)
12927 {
12928
12929 int check = XmuCompareISOLatin1("big", "small")
12930
12931   ;
12932   return 0;
12933 }
12934 _ACEOF
12935 rm -f conftest.$ac_objext conftest$ac_exeext
12936 if { (eval echo "$as_me:12936: \"$ac_link\"") >&5
12937   (eval $ac_link) 2>&5
12938   ac_status=$?
12939   echo "$as_me:12939: \$? = $ac_status" >&5
12940   (exit $ac_status); } &&
12941          { ac_try='test -s conftest$ac_exeext'
12942   { (eval echo "$as_me:12942: \"$ac_try\"") >&5
12943   (eval $ac_try) 2>&5
12944   ac_status=$?
12945   echo "$as_me:12945: \$? = $ac_status" >&5
12946   (exit $ac_status); }; }; then
12947   cf_cv_xaw_compat=yes
12948 else
12949   echo "$as_me: failed program was:" >&5
12950 cat conftest.$ac_ext >&5
12951 cf_cv_xaw_compat=no
12952 fi
12953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12954 fi
12955 echo "$as_me:12955: result: $cf_cv_xaw_compat" >&5
12956 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12957
12958                         if test "$cf_cv_xaw_compat" = no
12959                         then
12960                                 # workaround for broken ".pc" files...
12961                                 case "$cf_x_athena_lib" in
12962                                 (*-lXmu*)
12963                                         ;;
12964                                 (*)
12965                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12966
12967 echo "${as_me:-configure}:12967: testing work around broken package ..." 1>&5
12968
12969                                         cf_save_xmu="$LIBS"
12970                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12971
12972 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12973         test -n "$verbose" && echo "    found package xmu" 1>&6
12974
12975 echo "${as_me:-configure}:12975: testing found package xmu ..." 1>&5
12976
12977         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12978         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12979         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12980
12981 echo "${as_me:-configure}:12981: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12982
12983         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12984
12985 echo "${as_me:-configure}:12985: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12986
12987 cf_fix_cppflags=no
12988 cf_new_cflags=
12989 cf_new_cppflags=
12990 cf_new_extra_cppflags=
12991
12992 for cf_add_cflags in $cf_pkgconfig_incs
12993 do
12994 case $cf_fix_cppflags in
12995 (no)
12996         case $cf_add_cflags in
12997         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12998                 case $cf_add_cflags in
12999                 (-D*)
13000                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13001
13002                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13003                                 && test -z "${cf_tst_cflags}" \
13004                                 && cf_fix_cppflags=yes
13005
13006                         if test $cf_fix_cppflags = yes ; then
13007
13008         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13009         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13010
13011                                 continue
13012                         elif test "${cf_tst_cflags}" = "\"'" ; then
13013
13014         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13015         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13016
13017                                 continue
13018                         fi
13019                         ;;
13020                 esac
13021                 case "$CPPFLAGS" in
13022                 (*$cf_add_cflags)
13023                         ;;
13024                 (*)
13025                         case $cf_add_cflags in
13026                         (-D*)
13027                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13028
13029 CPPFLAGS=`echo "$CPPFLAGS" | \
13030         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13031                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13032
13033                                 ;;
13034                         esac
13035
13036         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13037         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13038
13039                         ;;
13040                 esac
13041                 ;;
13042         (*)
13043
13044         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13045         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13046
13047                 ;;
13048         esac
13049         ;;
13050 (yes)
13051
13052         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13053         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13054
13055         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13056
13057         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13058                 && test -z "${cf_tst_cflags}" \
13059                 && cf_fix_cppflags=no
13060         ;;
13061 esac
13062 done
13063
13064 if test -n "$cf_new_cflags" ; then
13065
13066         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13067         CFLAGS="${CFLAGS}$cf_new_cflags"
13068
13069 fi
13070
13071 if test -n "$cf_new_cppflags" ; then
13072
13073         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13074         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13075
13076 fi
13077
13078 if test -n "$cf_new_extra_cppflags" ; then
13079
13080         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13081         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13082
13083 fi
13084
13085 cf_add_libs="$LIBS"
13086 # reverse order
13087 cf_add_0lib=
13088 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13089 # filter duplicates
13090 for cf_add_1lib in $cf_add_0lib; do
13091         for cf_add_2lib in $cf_add_libs; do
13092                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13093                         cf_add_1lib=
13094                         break
13095                 fi
13096         done
13097         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13098 done
13099 LIBS="$cf_add_libs"
13100
13101                                                         LIBS="$cf_save_xmu"
13102
13103 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13104
13105 echo "${as_me:-configure}:13105: testing ...before $LIBS ..." 1>&5
13106
13107 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13108 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13109
13110 echo "${as_me:-configure}:13110: testing ...after  $LIBS ..." 1>&5
13111
13112 else
13113         cf_pkgconfig_incs=
13114         cf_pkgconfig_libs=
13115
13116 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13117
13118 echo "${as_me:-configure}:13118: testing ...before $LIBS ..." 1>&5
13119
13120 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13121 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13122
13123 echo "${as_me:-configure}:13123: testing ...after  $LIBS ..." 1>&5
13124
13125 fi
13126
13127         for cf_trim_lib in Xmu Xt X11
13128         do
13129                 case "$LIBS" in
13130                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13131                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13132                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13133
13134 echo "${as_me:-configure}:13134: testing ..trimmed $LIBS ..." 1>&5
13135
13136                         ;;
13137                 esac
13138         done
13139
13140                                         ;;
13141                                 esac
13142                         fi
13143
13144                         break
13145 else
13146         cf_pkgconfig_incs=
13147         cf_pkgconfig_libs=
13148         :
13149 fi
13150
13151         done
13152 fi
13153
13154 if test -z "$cf_x_athena_lib" ; then
13155
13156 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
13157         test -n "$verbose" && echo "    found package Xext" 1>&6
13158
13159 echo "${as_me:-configure}:13159: testing found package Xext ..." 1>&5
13160
13161         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
13162         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
13163         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13164
13165 echo "${as_me:-configure}:13165: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13166
13167         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13168
13169 echo "${as_me:-configure}:13169: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13170
13171 cf_fix_cppflags=no
13172 cf_new_cflags=
13173 cf_new_cppflags=
13174 cf_new_extra_cppflags=
13175
13176 for cf_add_cflags in $cf_pkgconfig_incs
13177 do
13178 case $cf_fix_cppflags in
13179 (no)
13180         case $cf_add_cflags in
13181         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13182                 case $cf_add_cflags in
13183                 (-D*)
13184                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13185
13186                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13187                                 && test -z "${cf_tst_cflags}" \
13188                                 && cf_fix_cppflags=yes
13189
13190                         if test $cf_fix_cppflags = yes ; then
13191
13192         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13193         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13194
13195                                 continue
13196                         elif test "${cf_tst_cflags}" = "\"'" ; then
13197
13198         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13199         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13200
13201                                 continue
13202                         fi
13203                         ;;
13204                 esac
13205                 case "$CPPFLAGS" in
13206                 (*$cf_add_cflags)
13207                         ;;
13208                 (*)
13209                         case $cf_add_cflags in
13210                         (-D*)
13211                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13212
13213 CPPFLAGS=`echo "$CPPFLAGS" | \
13214         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13215                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13216
13217                                 ;;
13218                         esac
13219
13220         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13221         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13222
13223                         ;;
13224                 esac
13225                 ;;
13226         (*)
13227
13228         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13229         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13230
13231                 ;;
13232         esac
13233         ;;
13234 (yes)
13235
13236         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13237         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13238
13239         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13240
13241         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13242                 && test -z "${cf_tst_cflags}" \
13243                 && cf_fix_cppflags=no
13244         ;;
13245 esac
13246 done
13247
13248 if test -n "$cf_new_cflags" ; then
13249
13250         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13251         CFLAGS="${CFLAGS}$cf_new_cflags"
13252
13253 fi
13254
13255 if test -n "$cf_new_cppflags" ; then
13256
13257         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13258         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13259
13260 fi
13261
13262 if test -n "$cf_new_extra_cppflags" ; then
13263
13264         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13265         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13266
13267 fi
13268
13269 cf_add_libs="$LIBS"
13270 # reverse order
13271 cf_add_0lib=
13272 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13273 # filter duplicates
13274 for cf_add_1lib in $cf_add_0lib; do
13275         for cf_add_2lib in $cf_add_libs; do
13276                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13277                         cf_add_1lib=
13278                         break
13279                 fi
13280         done
13281         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13282 done
13283 LIBS="$cf_add_libs"
13284
13285         :
13286 else
13287         cf_pkgconfig_incs=
13288         cf_pkgconfig_libs=
13289
13290         echo "$as_me:13290: checking for XextCreateExtension in -lXext" >&5
13291 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13292 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13293   echo $ECHO_N "(cached) $ECHO_C" >&6
13294 else
13295   ac_check_lib_save_LIBS=$LIBS
13296 LIBS="-lXext  $LIBS"
13297 cat >conftest.$ac_ext <<_ACEOF
13298 #line 13298 "configure"
13299 #include "confdefs.h"
13300
13301 /* Override any gcc2 internal prototype to avoid an error.  */
13302 #ifdef __cplusplus
13303 extern "C"
13304 #endif
13305 /* We use char because int might match the return type of a gcc2
13306    builtin and then its argument prototype would still apply.  */
13307 char XextCreateExtension ();
13308 int
13309 main (void)
13310 {
13311 XextCreateExtension ();
13312   ;
13313   return 0;
13314 }
13315 _ACEOF
13316 rm -f conftest.$ac_objext conftest$ac_exeext
13317 if { (eval echo "$as_me:13317: \"$ac_link\"") >&5
13318   (eval $ac_link) 2>&5
13319   ac_status=$?
13320   echo "$as_me:13320: \$? = $ac_status" >&5
13321   (exit $ac_status); } &&
13322          { ac_try='test -s conftest$ac_exeext'
13323   { (eval echo "$as_me:13323: \"$ac_try\"") >&5
13324   (eval $ac_try) 2>&5
13325   ac_status=$?
13326   echo "$as_me:13326: \$? = $ac_status" >&5
13327   (exit $ac_status); }; }; then
13328   ac_cv_lib_Xext_XextCreateExtension=yes
13329 else
13330   echo "$as_me: failed program was:" >&5
13331 cat conftest.$ac_ext >&5
13332 ac_cv_lib_Xext_XextCreateExtension=no
13333 fi
13334 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13335 LIBS=$ac_check_lib_save_LIBS
13336 fi
13337 echo "$as_me:13337: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13338 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13339 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
13340
13341 cf_add_libs="$LIBS"
13342 # reverse order
13343 cf_add_0lib=
13344 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13345 # filter duplicates
13346 for cf_add_1lib in $cf_add_0lib; do
13347         for cf_add_2lib in $cf_add_libs; do
13348                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13349                         cf_add_1lib=
13350                         break
13351                 fi
13352         done
13353         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13354 done
13355 LIBS="$cf_add_libs"
13356
13357 fi
13358
13359 fi
13360
13361 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13362 # in some cases has installed dummy files in the former, other cases replaced
13363 # it with a link to the new location).  This complicates the configure script.
13364 # Check for that pitfall, and recover using pkg-config
13365 #
13366 # If none of these are set, the configuration is almost certainly broken.
13367 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13368 then
13369
13370 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13371         test -n "$verbose" && echo "    found package x11" 1>&6
13372
13373 echo "${as_me:-configure}:13373: testing found package x11 ..." 1>&5
13374
13375         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13376         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13377         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13378
13379 echo "${as_me:-configure}:13379: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13380
13381         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13382
13383 echo "${as_me:-configure}:13383: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13384
13385 cf_fix_cppflags=no
13386 cf_new_cflags=
13387 cf_new_cppflags=
13388 cf_new_extra_cppflags=
13389
13390 for cf_add_cflags in $cf_pkgconfig_incs
13391 do
13392 case $cf_fix_cppflags in
13393 (no)
13394         case $cf_add_cflags in
13395         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13396                 case $cf_add_cflags in
13397                 (-D*)
13398                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13399
13400                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13401                                 && test -z "${cf_tst_cflags}" \
13402                                 && cf_fix_cppflags=yes
13403
13404                         if test $cf_fix_cppflags = yes ; then
13405
13406         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13407         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13408
13409                                 continue
13410                         elif test "${cf_tst_cflags}" = "\"'" ; then
13411
13412         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13413         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13414
13415                                 continue
13416                         fi
13417                         ;;
13418                 esac
13419                 case "$CPPFLAGS" in
13420                 (*$cf_add_cflags)
13421                         ;;
13422                 (*)
13423                         case $cf_add_cflags in
13424                         (-D*)
13425                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13426
13427 CPPFLAGS=`echo "$CPPFLAGS" | \
13428         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13429                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13430
13431                                 ;;
13432                         esac
13433
13434         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13435         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13436
13437                         ;;
13438                 esac
13439                 ;;
13440         (*)
13441
13442         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13443         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13444
13445                 ;;
13446         esac
13447         ;;
13448 (yes)
13449
13450         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13451         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13452
13453         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13454
13455         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13456                 && test -z "${cf_tst_cflags}" \
13457                 && cf_fix_cppflags=no
13458         ;;
13459 esac
13460 done
13461
13462 if test -n "$cf_new_cflags" ; then
13463
13464         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13465         CFLAGS="${CFLAGS}$cf_new_cflags"
13466
13467 fi
13468
13469 if test -n "$cf_new_cppflags" ; then
13470
13471         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13472         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13473
13474 fi
13475
13476 if test -n "$cf_new_extra_cppflags" ; then
13477
13478         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13479         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13480
13481 fi
13482
13483 cf_add_libs="$LIBS"
13484 # reverse order
13485 cf_add_0lib=
13486 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13487 # filter duplicates
13488 for cf_add_1lib in $cf_add_0lib; do
13489         for cf_add_2lib in $cf_add_libs; do
13490                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13491                         cf_add_1lib=
13492                         break
13493                 fi
13494         done
13495         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13496 done
13497 LIBS="$cf_add_libs"
13498
13499         :
13500 else
13501         cf_pkgconfig_incs=
13502         cf_pkgconfig_libs=
13503         { echo "$as_me:13503: WARNING: unable to find X11 library" >&5
13504 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13505 fi
13506
13507 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13508         test -n "$verbose" && echo "    found package ice" 1>&6
13509
13510 echo "${as_me:-configure}:13510: testing found package ice ..." 1>&5
13511
13512         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13513         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13514         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13515
13516 echo "${as_me:-configure}:13516: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13517
13518         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13519
13520 echo "${as_me:-configure}:13520: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13521
13522 cf_fix_cppflags=no
13523 cf_new_cflags=
13524 cf_new_cppflags=
13525 cf_new_extra_cppflags=
13526
13527 for cf_add_cflags in $cf_pkgconfig_incs
13528 do
13529 case $cf_fix_cppflags in
13530 (no)
13531         case $cf_add_cflags in
13532         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13533                 case $cf_add_cflags in
13534                 (-D*)
13535                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13536
13537                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13538                                 && test -z "${cf_tst_cflags}" \
13539                                 && cf_fix_cppflags=yes
13540
13541                         if test $cf_fix_cppflags = yes ; then
13542
13543         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13544         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13545
13546                                 continue
13547                         elif test "${cf_tst_cflags}" = "\"'" ; then
13548
13549         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13550         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13551
13552                                 continue
13553                         fi
13554                         ;;
13555                 esac
13556                 case "$CPPFLAGS" in
13557                 (*$cf_add_cflags)
13558                         ;;
13559                 (*)
13560                         case $cf_add_cflags in
13561                         (-D*)
13562                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13563
13564 CPPFLAGS=`echo "$CPPFLAGS" | \
13565         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13566                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13567
13568                                 ;;
13569                         esac
13570
13571         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13572         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13573
13574                         ;;
13575                 esac
13576                 ;;
13577         (*)
13578
13579         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13580         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13581
13582                 ;;
13583         esac
13584         ;;
13585 (yes)
13586
13587         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13588         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13589
13590         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13591
13592         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13593                 && test -z "${cf_tst_cflags}" \
13594                 && cf_fix_cppflags=no
13595         ;;
13596 esac
13597 done
13598
13599 if test -n "$cf_new_cflags" ; then
13600
13601         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13602         CFLAGS="${CFLAGS}$cf_new_cflags"
13603
13604 fi
13605
13606 if test -n "$cf_new_cppflags" ; then
13607
13608         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13609         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13610
13611 fi
13612
13613 if test -n "$cf_new_extra_cppflags" ; then
13614
13615         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13616         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13617
13618 fi
13619
13620 cf_add_libs="$LIBS"
13621 # reverse order
13622 cf_add_0lib=
13623 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13624 # filter duplicates
13625 for cf_add_1lib in $cf_add_0lib; do
13626         for cf_add_2lib in $cf_add_libs; do
13627                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13628                         cf_add_1lib=
13629                         break
13630                 fi
13631         done
13632         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13633 done
13634 LIBS="$cf_add_libs"
13635
13636         :
13637 else
13638         cf_pkgconfig_incs=
13639         cf_pkgconfig_libs=
13640         { echo "$as_me:13640: WARNING: unable to find ICE library" >&5
13641 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13642 fi
13643
13644 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13645         test -n "$verbose" && echo "    found package sm" 1>&6
13646
13647 echo "${as_me:-configure}:13647: testing found package sm ..." 1>&5
13648
13649         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13650         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13651         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13652
13653 echo "${as_me:-configure}:13653: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13654
13655         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13656
13657 echo "${as_me:-configure}:13657: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13658
13659 cf_fix_cppflags=no
13660 cf_new_cflags=
13661 cf_new_cppflags=
13662 cf_new_extra_cppflags=
13663
13664 for cf_add_cflags in $cf_pkgconfig_incs
13665 do
13666 case $cf_fix_cppflags in
13667 (no)
13668         case $cf_add_cflags in
13669         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13670                 case $cf_add_cflags in
13671                 (-D*)
13672                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13673
13674                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13675                                 && test -z "${cf_tst_cflags}" \
13676                                 && cf_fix_cppflags=yes
13677
13678                         if test $cf_fix_cppflags = yes ; then
13679
13680         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13681         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13682
13683                                 continue
13684                         elif test "${cf_tst_cflags}" = "\"'" ; then
13685
13686         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13687         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13688
13689                                 continue
13690                         fi
13691                         ;;
13692                 esac
13693                 case "$CPPFLAGS" in
13694                 (*$cf_add_cflags)
13695                         ;;
13696                 (*)
13697                         case $cf_add_cflags in
13698                         (-D*)
13699                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13700
13701 CPPFLAGS=`echo "$CPPFLAGS" | \
13702         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13703                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13704
13705                                 ;;
13706                         esac
13707
13708         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13709         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13710
13711                         ;;
13712                 esac
13713                 ;;
13714         (*)
13715
13716         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13717         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13718
13719                 ;;
13720         esac
13721         ;;
13722 (yes)
13723
13724         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13725         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13726
13727         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13728
13729         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13730                 && test -z "${cf_tst_cflags}" \
13731                 && cf_fix_cppflags=no
13732         ;;
13733 esac
13734 done
13735
13736 if test -n "$cf_new_cflags" ; then
13737
13738         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13739         CFLAGS="${CFLAGS}$cf_new_cflags"
13740
13741 fi
13742
13743 if test -n "$cf_new_cppflags" ; then
13744
13745         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13746         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13747
13748 fi
13749
13750 if test -n "$cf_new_extra_cppflags" ; then
13751
13752         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13753         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13754
13755 fi
13756
13757 cf_add_libs="$LIBS"
13758 # reverse order
13759 cf_add_0lib=
13760 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13761 # filter duplicates
13762 for cf_add_1lib in $cf_add_0lib; do
13763         for cf_add_2lib in $cf_add_libs; do
13764                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13765                         cf_add_1lib=
13766                         break
13767                 fi
13768         done
13769         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13770 done
13771 LIBS="$cf_add_libs"
13772
13773         :
13774 else
13775         cf_pkgconfig_incs=
13776         cf_pkgconfig_libs=
13777         { echo "$as_me:13777: WARNING: unable to find SM library" >&5
13778 echo "$as_me: WARNING: unable to find SM library" >&2;}
13779 fi
13780
13781 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13782         test -n "$verbose" && echo "    found package xt" 1>&6
13783
13784 echo "${as_me:-configure}:13784: testing found package xt ..." 1>&5
13785
13786         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13787         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13788         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13789
13790 echo "${as_me:-configure}:13790: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13791
13792         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13793
13794 echo "${as_me:-configure}:13794: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13795
13796 cf_fix_cppflags=no
13797 cf_new_cflags=
13798 cf_new_cppflags=
13799 cf_new_extra_cppflags=
13800
13801 for cf_add_cflags in $cf_pkgconfig_incs
13802 do
13803 case $cf_fix_cppflags in
13804 (no)
13805         case $cf_add_cflags in
13806         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13807                 case $cf_add_cflags in
13808                 (-D*)
13809                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13810
13811                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13812                                 && test -z "${cf_tst_cflags}" \
13813                                 && cf_fix_cppflags=yes
13814
13815                         if test $cf_fix_cppflags = yes ; then
13816
13817         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13818         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13819
13820                                 continue
13821                         elif test "${cf_tst_cflags}" = "\"'" ; then
13822
13823         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13824         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13825
13826                                 continue
13827                         fi
13828                         ;;
13829                 esac
13830                 case "$CPPFLAGS" in
13831                 (*$cf_add_cflags)
13832                         ;;
13833                 (*)
13834                         case $cf_add_cflags in
13835                         (-D*)
13836                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13837
13838 CPPFLAGS=`echo "$CPPFLAGS" | \
13839         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13840                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13841
13842                                 ;;
13843                         esac
13844
13845         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13846         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13847
13848                         ;;
13849                 esac
13850                 ;;
13851         (*)
13852
13853         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13854         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13855
13856                 ;;
13857         esac
13858         ;;
13859 (yes)
13860
13861         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13862         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13863
13864         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13865
13866         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13867                 && test -z "${cf_tst_cflags}" \
13868                 && cf_fix_cppflags=no
13869         ;;
13870 esac
13871 done
13872
13873 if test -n "$cf_new_cflags" ; then
13874
13875         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13876         CFLAGS="${CFLAGS}$cf_new_cflags"
13877
13878 fi
13879
13880 if test -n "$cf_new_cppflags" ; then
13881
13882         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13883         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13884
13885 fi
13886
13887 if test -n "$cf_new_extra_cppflags" ; then
13888
13889         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13890         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13891
13892 fi
13893
13894 cf_add_libs="$LIBS"
13895 # reverse order
13896 cf_add_0lib=
13897 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13898 # filter duplicates
13899 for cf_add_1lib in $cf_add_0lib; do
13900         for cf_add_2lib in $cf_add_libs; do
13901                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13902                         cf_add_1lib=
13903                         break
13904                 fi
13905         done
13906         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13907 done
13908 LIBS="$cf_add_libs"
13909
13910         :
13911 else
13912         cf_pkgconfig_incs=
13913         cf_pkgconfig_libs=
13914         { echo "$as_me:13914: WARNING: unable to find Xt library" >&5
13915 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13916 fi
13917
13918 fi
13919
13920 cf_have_X_LIBS=no
13921
13922 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13923         test -n "$verbose" && echo "    found package xt" 1>&6
13924
13925 echo "${as_me:-configure}:13925: testing found package xt ..." 1>&5
13926
13927         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13928         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13929         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13930
13931 echo "${as_me:-configure}:13931: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13932
13933         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13934
13935 echo "${as_me:-configure}:13935: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13936
13937 cf_fix_cppflags=no
13938 cf_new_cflags=
13939 cf_new_cppflags=
13940 cf_new_extra_cppflags=
13941
13942 for cf_add_cflags in $cf_pkgconfig_incs
13943 do
13944 case $cf_fix_cppflags in
13945 (no)
13946         case $cf_add_cflags in
13947         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13948                 case $cf_add_cflags in
13949                 (-D*)
13950                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13951
13952                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13953                                 && test -z "${cf_tst_cflags}" \
13954                                 && cf_fix_cppflags=yes
13955
13956                         if test $cf_fix_cppflags = yes ; 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                         elif test "${cf_tst_cflags}" = "\"'" ; then
13963
13964         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13965         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13966
13967                                 continue
13968                         fi
13969                         ;;
13970                 esac
13971                 case "$CPPFLAGS" in
13972                 (*$cf_add_cflags)
13973                         ;;
13974                 (*)
13975                         case $cf_add_cflags in
13976                         (-D*)
13977                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13978
13979 CPPFLAGS=`echo "$CPPFLAGS" | \
13980         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13981                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13982
13983                                 ;;
13984                         esac
13985
13986         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13987         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13988
13989                         ;;
13990                 esac
13991                 ;;
13992         (*)
13993
13994         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13995         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13996
13997                 ;;
13998         esac
13999         ;;
14000 (yes)
14001
14002         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14003         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14004
14005         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14006
14007         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14008                 && test -z "${cf_tst_cflags}" \
14009                 && cf_fix_cppflags=no
14010         ;;
14011 esac
14012 done
14013
14014 if test -n "$cf_new_cflags" ; then
14015
14016         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14017         CFLAGS="${CFLAGS}$cf_new_cflags"
14018
14019 fi
14020
14021 if test -n "$cf_new_cppflags" ; then
14022
14023         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14024         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14025
14026 fi
14027
14028 if test -n "$cf_new_extra_cppflags" ; then
14029
14030         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14031         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14032
14033 fi
14034
14035 cf_add_libs="$LIBS"
14036 # reverse order
14037 cf_add_0lib=
14038 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14039 # filter duplicates
14040 for cf_add_1lib in $cf_add_0lib; do
14041         for cf_add_2lib in $cf_add_libs; do
14042                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14043                         cf_add_1lib=
14044                         break
14045                 fi
14046         done
14047         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14048 done
14049 LIBS="$cf_add_libs"
14050
14051         case "x$LIBS" in
14052         (*-lX11*)
14053                 ;;
14054         (*)
14055 # we have an "xt" package, but it may omit Xt's dependency on X11
14056 echo "$as_me:14056: checking for usable X dependency" >&5
14057 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14058 if test "${cf_cv_xt_x11_compat+set}" = set; then
14059   echo $ECHO_N "(cached) $ECHO_C" >&6
14060 else
14061
14062 cat >conftest.$ac_ext <<_ACEOF
14063 #line 14063 "configure"
14064 #include "confdefs.h"
14065
14066 #include <X11/Xlib.h>
14067
14068 int
14069 main (void)
14070 {
14071
14072         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14073         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14074         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14075         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14076
14077   ;
14078   return 0;
14079 }
14080 _ACEOF
14081 rm -f conftest.$ac_objext conftest$ac_exeext
14082 if { (eval echo "$as_me:14082: \"$ac_link\"") >&5
14083   (eval $ac_link) 2>&5
14084   ac_status=$?
14085   echo "$as_me:14085: \$? = $ac_status" >&5
14086   (exit $ac_status); } &&
14087          { ac_try='test -s conftest$ac_exeext'
14088   { (eval echo "$as_me:14088: \"$ac_try\"") >&5
14089   (eval $ac_try) 2>&5
14090   ac_status=$?
14091   echo "$as_me:14091: \$? = $ac_status" >&5
14092   (exit $ac_status); }; }; then
14093   cf_cv_xt_x11_compat=yes
14094 else
14095   echo "$as_me: failed program was:" >&5
14096 cat conftest.$ac_ext >&5
14097 cf_cv_xt_x11_compat=no
14098 fi
14099 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14100 fi
14101 echo "$as_me:14101: result: $cf_cv_xt_x11_compat" >&5
14102 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14103                 if test "$cf_cv_xt_x11_compat" = no
14104                 then
14105                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14106
14107 echo "${as_me:-configure}:14107: testing work around broken X11 dependency ..." 1>&5
14108
14109                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14110
14111 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
14112         test -n "$verbose" && echo "    found package x11" 1>&6
14113
14114 echo "${as_me:-configure}:14114: testing found package x11 ..." 1>&5
14115
14116         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
14117         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
14118         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14119
14120 echo "${as_me:-configure}:14120: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14121
14122         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14123
14124 echo "${as_me:-configure}:14124: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14125
14126 cf_fix_cppflags=no
14127 cf_new_cflags=
14128 cf_new_cppflags=
14129 cf_new_extra_cppflags=
14130
14131 for cf_add_cflags in $cf_pkgconfig_incs
14132 do
14133 case $cf_fix_cppflags in
14134 (no)
14135         case $cf_add_cflags in
14136         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14137                 case $cf_add_cflags in
14138                 (-D*)
14139                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14140
14141                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14142                                 && test -z "${cf_tst_cflags}" \
14143                                 && cf_fix_cppflags=yes
14144
14145                         if test $cf_fix_cppflags = yes ; then
14146
14147         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14148         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14149
14150                                 continue
14151                         elif test "${cf_tst_cflags}" = "\"'" ; then
14152
14153         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14154         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14155
14156                                 continue
14157                         fi
14158                         ;;
14159                 esac
14160                 case "$CPPFLAGS" in
14161                 (*$cf_add_cflags)
14162                         ;;
14163                 (*)
14164                         case $cf_add_cflags in
14165                         (-D*)
14166                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14167
14168 CPPFLAGS=`echo "$CPPFLAGS" | \
14169         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14170                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14171
14172                                 ;;
14173                         esac
14174
14175         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14176         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14177
14178                         ;;
14179                 esac
14180                 ;;
14181         (*)
14182
14183         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14184         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14185
14186                 ;;
14187         esac
14188         ;;
14189 (yes)
14190
14191         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14192         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14193
14194         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14195
14196         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14197                 && test -z "${cf_tst_cflags}" \
14198                 && cf_fix_cppflags=no
14199         ;;
14200 esac
14201 done
14202
14203 if test -n "$cf_new_cflags" ; then
14204
14205         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14206         CFLAGS="${CFLAGS}$cf_new_cflags"
14207
14208 fi
14209
14210 if test -n "$cf_new_cppflags" ; then
14211
14212         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14213         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14214
14215 fi
14216
14217 if test -n "$cf_new_extra_cppflags" ; then
14218
14219         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14220         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14221
14222 fi
14223
14224 cf_add_libs="$LIBS"
14225 # reverse order
14226 cf_add_0lib=
14227 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14228 # filter duplicates
14229 for cf_add_1lib in $cf_add_0lib; do
14230         for cf_add_2lib in $cf_add_libs; do
14231                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14232                         cf_add_1lib=
14233                         break
14234                 fi
14235         done
14236         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14237 done
14238 LIBS="$cf_add_libs"
14239
14240         :
14241 else
14242         cf_pkgconfig_incs=
14243         cf_pkgconfig_libs=
14244
14245 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14246
14247 echo "${as_me:-configure}:14247: testing ...before $LIBS ..." 1>&5
14248
14249 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14250 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14251
14252 echo "${as_me:-configure}:14252: testing ...after  $LIBS ..." 1>&5
14253
14254 fi
14255
14256                 fi
14257                 ;;
14258         esac
14259
14260 echo "$as_me:14260: checking for usable X Toolkit package" >&5
14261 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14262 if test "${cf_cv_xt_ice_compat+set}" = set; then
14263   echo $ECHO_N "(cached) $ECHO_C" >&6
14264 else
14265
14266 cat >conftest.$ac_ext <<_ACEOF
14267 #line 14267 "configure"
14268 #include "confdefs.h"
14269
14270 #include <X11/Shell.h>
14271
14272 int
14273 main (void)
14274 {
14275 int num = IceConnectionNumber(0)
14276
14277   ;
14278   return 0;
14279 }
14280 _ACEOF
14281 rm -f conftest.$ac_objext conftest$ac_exeext
14282 if { (eval echo "$as_me:14282: \"$ac_link\"") >&5
14283   (eval $ac_link) 2>&5
14284   ac_status=$?
14285   echo "$as_me:14285: \$? = $ac_status" >&5
14286   (exit $ac_status); } &&
14287          { ac_try='test -s conftest$ac_exeext'
14288   { (eval echo "$as_me:14288: \"$ac_try\"") >&5
14289   (eval $ac_try) 2>&5
14290   ac_status=$?
14291   echo "$as_me:14291: \$? = $ac_status" >&5
14292   (exit $ac_status); }; }; then
14293   cf_cv_xt_ice_compat=yes
14294 else
14295   echo "$as_me: failed program was:" >&5
14296 cat conftest.$ac_ext >&5
14297 cf_cv_xt_ice_compat=no
14298 fi
14299 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14300 fi
14301 echo "$as_me:14301: result: $cf_cv_xt_ice_compat" >&5
14302 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14303
14304         if test "$cf_cv_xt_ice_compat" = no
14305         then
14306                 # workaround for broken ".pc" files used for X Toolkit.
14307                 case "x$X_PRE_LIBS" in
14308                 (*-lICE*)
14309                         case "x$LIBS" in
14310                         (*-lICE*)
14311                                 ;;
14312                         (*)
14313                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14314
14315 echo "${as_me:-configure}:14315: testing work around broken ICE dependency ..." 1>&5
14316
14317 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
14318         test -n "$verbose" && echo "    found package ice" 1>&6
14319
14320 echo "${as_me:-configure}:14320: testing found package ice ..." 1>&5
14321
14322         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
14323         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
14324         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14325
14326 echo "${as_me:-configure}:14326: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14327
14328         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14329
14330 echo "${as_me:-configure}:14330: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14331
14332 cf_fix_cppflags=no
14333 cf_new_cflags=
14334 cf_new_cppflags=
14335 cf_new_extra_cppflags=
14336
14337 for cf_add_cflags in $cf_pkgconfig_incs
14338 do
14339 case $cf_fix_cppflags in
14340 (no)
14341         case $cf_add_cflags in
14342         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14343                 case $cf_add_cflags in
14344                 (-D*)
14345                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14346
14347                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14348                                 && test -z "${cf_tst_cflags}" \
14349                                 && cf_fix_cppflags=yes
14350
14351                         if test $cf_fix_cppflags = yes ; then
14352
14353         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14354         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14355
14356                                 continue
14357                         elif test "${cf_tst_cflags}" = "\"'" ; then
14358
14359         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14360         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14361
14362                                 continue
14363                         fi
14364                         ;;
14365                 esac
14366                 case "$CPPFLAGS" in
14367                 (*$cf_add_cflags)
14368                         ;;
14369                 (*)
14370                         case $cf_add_cflags in
14371                         (-D*)
14372                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14373
14374 CPPFLAGS=`echo "$CPPFLAGS" | \
14375         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14376                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14377
14378                                 ;;
14379                         esac
14380
14381         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14382         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14383
14384                         ;;
14385                 esac
14386                 ;;
14387         (*)
14388
14389         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14390         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14391
14392                 ;;
14393         esac
14394         ;;
14395 (yes)
14396
14397         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14398         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14399
14400         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14401
14402         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14403                 && test -z "${cf_tst_cflags}" \
14404                 && cf_fix_cppflags=no
14405         ;;
14406 esac
14407 done
14408
14409 if test -n "$cf_new_cflags" ; then
14410
14411         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14412         CFLAGS="${CFLAGS}$cf_new_cflags"
14413
14414 fi
14415
14416 if test -n "$cf_new_cppflags" ; then
14417
14418         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14419         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14420
14421 fi
14422
14423 if test -n "$cf_new_extra_cppflags" ; then
14424
14425         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14426         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14427
14428 fi
14429
14430 cf_add_libs="$LIBS"
14431 # reverse order
14432 cf_add_0lib=
14433 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14434 # filter duplicates
14435 for cf_add_1lib in $cf_add_0lib; do
14436         for cf_add_2lib in $cf_add_libs; do
14437                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14438                         cf_add_1lib=
14439                         break
14440                 fi
14441         done
14442         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14443 done
14444 LIBS="$cf_add_libs"
14445
14446 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
14447         test -n "$verbose" && echo "    found package sm" 1>&6
14448
14449 echo "${as_me:-configure}:14449: testing found package sm ..." 1>&5
14450
14451         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
14452         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
14453         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14454
14455 echo "${as_me:-configure}:14455: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14456
14457         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14458
14459 echo "${as_me:-configure}:14459: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14460
14461 cf_fix_cppflags=no
14462 cf_new_cflags=
14463 cf_new_cppflags=
14464 cf_new_extra_cppflags=
14465
14466 for cf_add_cflags in $cf_pkgconfig_incs
14467 do
14468 case $cf_fix_cppflags in
14469 (no)
14470         case $cf_add_cflags in
14471         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14472                 case $cf_add_cflags in
14473                 (-D*)
14474                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14475
14476                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14477                                 && test -z "${cf_tst_cflags}" \
14478                                 && cf_fix_cppflags=yes
14479
14480                         if test $cf_fix_cppflags = yes ; then
14481
14482         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14483         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14484
14485                                 continue
14486                         elif test "${cf_tst_cflags}" = "\"'" ; then
14487
14488         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14489         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14490
14491                                 continue
14492                         fi
14493                         ;;
14494                 esac
14495                 case "$CPPFLAGS" in
14496                 (*$cf_add_cflags)
14497                         ;;
14498                 (*)
14499                         case $cf_add_cflags in
14500                         (-D*)
14501                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14502
14503 CPPFLAGS=`echo "$CPPFLAGS" | \
14504         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14505                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14506
14507                                 ;;
14508                         esac
14509
14510         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14511         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14512
14513                         ;;
14514                 esac
14515                 ;;
14516         (*)
14517
14518         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14519         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14520
14521                 ;;
14522         esac
14523         ;;
14524 (yes)
14525
14526         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14527         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14528
14529         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14530
14531         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14532                 && test -z "${cf_tst_cflags}" \
14533                 && cf_fix_cppflags=no
14534         ;;
14535 esac
14536 done
14537
14538 if test -n "$cf_new_cflags" ; then
14539
14540         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14541         CFLAGS="${CFLAGS}$cf_new_cflags"
14542
14543 fi
14544
14545 if test -n "$cf_new_cppflags" ; then
14546
14547         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14548         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14549
14550 fi
14551
14552 if test -n "$cf_new_extra_cppflags" ; then
14553
14554         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14555         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14556
14557 fi
14558
14559 cf_add_libs="$LIBS"
14560 # reverse order
14561 cf_add_0lib=
14562 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14563 # filter duplicates
14564 for cf_add_1lib in $cf_add_0lib; do
14565         for cf_add_2lib in $cf_add_libs; do
14566                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14567                         cf_add_1lib=
14568                         break
14569                 fi
14570         done
14571         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14572 done
14573 LIBS="$cf_add_libs"
14574
14575         :
14576 else
14577         cf_pkgconfig_incs=
14578         cf_pkgconfig_libs=
14579         :
14580 fi
14581
14582 else
14583         cf_pkgconfig_incs=
14584         cf_pkgconfig_libs=
14585
14586 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14587
14588 echo "${as_me:-configure}:14588: testing ...before $LIBS ..." 1>&5
14589
14590 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14591 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14592
14593 echo "${as_me:-configure}:14593: testing ...after  $LIBS ..." 1>&5
14594
14595 fi
14596
14597                                 ;;
14598                         esac
14599                         ;;
14600                 esac
14601         fi
14602
14603         cf_have_X_LIBS=yes
14604
14605 else
14606         cf_pkgconfig_incs=
14607         cf_pkgconfig_libs=
14608
14609         LDFLAGS="$X_LIBS $LDFLAGS"
14610
14611 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14612
14613 echo "${as_me:-configure}:14613: testing checking additions to CFLAGS ..." 1>&5
14614
14615 cf_check_cflags="$CFLAGS"
14616 cf_check_cppflags="$CPPFLAGS"
14617
14618 cf_fix_cppflags=no
14619 cf_new_cflags=
14620 cf_new_cppflags=
14621 cf_new_extra_cppflags=
14622
14623 for cf_add_cflags in $X_CFLAGS
14624 do
14625 case $cf_fix_cppflags in
14626 (no)
14627         case $cf_add_cflags in
14628         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14629                 case $cf_add_cflags in
14630                 (-D*)
14631                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14632
14633                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14634                                 && test -z "${cf_tst_cflags}" \
14635                                 && cf_fix_cppflags=yes
14636
14637                         if test $cf_fix_cppflags = yes ; then
14638
14639         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14640         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14641
14642                                 continue
14643                         elif test "${cf_tst_cflags}" = "\"'" ; then
14644
14645         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14646         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14647
14648                                 continue
14649                         fi
14650                         ;;
14651                 esac
14652                 case "$CPPFLAGS" in
14653                 (*$cf_add_cflags)
14654                         ;;
14655                 (*)
14656                         case $cf_add_cflags in
14657                         (-D*)
14658                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14659
14660 CPPFLAGS=`echo "$CPPFLAGS" | \
14661         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14662                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14663
14664                                 ;;
14665                         esac
14666
14667         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14668         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14669
14670                         ;;
14671                 esac
14672                 ;;
14673         (*)
14674
14675         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14676         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14677
14678                 ;;
14679         esac
14680         ;;
14681 (yes)
14682
14683         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14684         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14685
14686         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14687
14688         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14689                 && test -z "${cf_tst_cflags}" \
14690                 && cf_fix_cppflags=no
14691         ;;
14692 esac
14693 done
14694
14695 if test -n "$cf_new_cflags" ; then
14696         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14697
14698 echo "${as_me:-configure}:14698: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14699
14700         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14701         CFLAGS="${CFLAGS}$cf_new_cflags"
14702
14703 fi
14704
14705 if test -n "$cf_new_cppflags" ; then
14706         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14707
14708 echo "${as_me:-configure}:14708: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14709
14710         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14711         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14712
14713 fi
14714
14715 if test -n "$cf_new_extra_cppflags" ; then
14716         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14717
14718 echo "${as_me:-configure}:14718: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14719
14720         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14721         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14722
14723 fi
14724
14725 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14726 cat >conftest.$ac_ext <<_ACEOF
14727 #line 14727 "configure"
14728 #include "confdefs.h"
14729 #include <stdio.h>
14730 int
14731 main (void)
14732 {
14733 printf("Hello world");
14734   ;
14735   return 0;
14736 }
14737 _ACEOF
14738 rm -f conftest.$ac_objext conftest$ac_exeext
14739 if { (eval echo "$as_me:14739: \"$ac_link\"") >&5
14740   (eval $ac_link) 2>&5
14741   ac_status=$?
14742   echo "$as_me:14742: \$? = $ac_status" >&5
14743   (exit $ac_status); } &&
14744          { ac_try='test -s conftest$ac_exeext'
14745   { (eval echo "$as_me:14745: \"$ac_try\"") >&5
14746   (eval $ac_try) 2>&5
14747   ac_status=$?
14748   echo "$as_me:14748: \$? = $ac_status" >&5
14749   (exit $ac_status); }; }; then
14750   :
14751 else
14752   echo "$as_me: failed program was:" >&5
14753 cat conftest.$ac_ext >&5
14754 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14755
14756 echo "${as_me:-configure}:14756: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14757
14758          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14759                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14760
14761 echo "${as_me:-configure}:14761: testing but keeping change to \$CPPFLAGS ..." 1>&5
14762
14763          fi
14764          CFLAGS="$cf_check_flags"
14765 fi
14766 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14767 fi
14768
14769         echo "$as_me:14769: checking for XOpenDisplay" >&5
14770 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14771 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14772   echo $ECHO_N "(cached) $ECHO_C" >&6
14773 else
14774   cat >conftest.$ac_ext <<_ACEOF
14775 #line 14775 "configure"
14776 #include "confdefs.h"
14777 #define XOpenDisplay autoconf_temporary
14778 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14779 #undef XOpenDisplay
14780
14781 #ifdef __cplusplus
14782 extern "C"
14783 #endif
14784
14785 /* We use char because int might match the return type of a gcc2
14786    builtin and then its argument prototype would still apply.  */
14787 char XOpenDisplay (void);
14788
14789 int
14790 main (void)
14791 {
14792
14793 /* The GNU C library defines stubs for functions which it implements
14794     to always fail with ENOSYS.  Some functions are actually named
14795     something starting with __ and the normal name is an alias.  */
14796 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14797 #error found stub for XOpenDisplay
14798 #endif
14799
14800         return XOpenDisplay ();
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   ac_cv_func_XOpenDisplay=yes
14818 else
14819   echo "$as_me: failed program was:" >&5
14820 cat conftest.$ac_ext >&5
14821 ac_cv_func_XOpenDisplay=no
14822 fi
14823 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14824 fi
14825 echo "$as_me:14825: result: $ac_cv_func_XOpenDisplay" >&5
14826 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14827 if test $ac_cv_func_XOpenDisplay = yes; then
14828   :
14829 else
14830
14831         echo "$as_me:14831: checking for XOpenDisplay in -lX11" >&5
14832 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14833 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14834   echo $ECHO_N "(cached) $ECHO_C" >&6
14835 else
14836   ac_check_lib_save_LIBS=$LIBS
14837 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14838 cat >conftest.$ac_ext <<_ACEOF
14839 #line 14839 "configure"
14840 #include "confdefs.h"
14841
14842 /* Override any gcc2 internal prototype to avoid an error.  */
14843 #ifdef __cplusplus
14844 extern "C"
14845 #endif
14846 /* We use char because int might match the return type of a gcc2
14847    builtin and then its argument prototype would still apply.  */
14848 char XOpenDisplay ();
14849 int
14850 main (void)
14851 {
14852 XOpenDisplay ();
14853   ;
14854   return 0;
14855 }
14856 _ACEOF
14857 rm -f conftest.$ac_objext conftest$ac_exeext
14858 if { (eval echo "$as_me:14858: \"$ac_link\"") >&5
14859   (eval $ac_link) 2>&5
14860   ac_status=$?
14861   echo "$as_me:14861: \$? = $ac_status" >&5
14862   (exit $ac_status); } &&
14863          { ac_try='test -s conftest$ac_exeext'
14864   { (eval echo "$as_me:14864: \"$ac_try\"") >&5
14865   (eval $ac_try) 2>&5
14866   ac_status=$?
14867   echo "$as_me:14867: \$? = $ac_status" >&5
14868   (exit $ac_status); }; }; then
14869   ac_cv_lib_X11_XOpenDisplay=yes
14870 else
14871   echo "$as_me: failed program was:" >&5
14872 cat conftest.$ac_ext >&5
14873 ac_cv_lib_X11_XOpenDisplay=no
14874 fi
14875 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14876 LIBS=$ac_check_lib_save_LIBS
14877 fi
14878 echo "$as_me:14878: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14879 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14880 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14881
14882 cf_add_libs="$LIBS"
14883 # reverse order
14884 cf_add_0lib=
14885 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14886 # filter duplicates
14887 for cf_add_1lib in $cf_add_0lib; do
14888         for cf_add_2lib in $cf_add_libs; do
14889                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14890                         cf_add_1lib=
14891                         break
14892                 fi
14893         done
14894         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14895 done
14896 LIBS="$cf_add_libs"
14897
14898 fi
14899
14900 fi
14901
14902         echo "$as_me:14902: checking for XtAppInitialize" >&5
14903 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14904 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14905   echo $ECHO_N "(cached) $ECHO_C" >&6
14906 else
14907   cat >conftest.$ac_ext <<_ACEOF
14908 #line 14908 "configure"
14909 #include "confdefs.h"
14910 #define XtAppInitialize autoconf_temporary
14911 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14912 #undef XtAppInitialize
14913
14914 #ifdef __cplusplus
14915 extern "C"
14916 #endif
14917
14918 /* We use char because int might match the return type of a gcc2
14919    builtin and then its argument prototype would still apply.  */
14920 char XtAppInitialize (void);
14921
14922 int
14923 main (void)
14924 {
14925
14926 /* The GNU C library defines stubs for functions which it implements
14927     to always fail with ENOSYS.  Some functions are actually named
14928     something starting with __ and the normal name is an alias.  */
14929 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14930 #error found stub for XtAppInitialize
14931 #endif
14932
14933         return XtAppInitialize ();
14934   ;
14935   return 0;
14936 }
14937 _ACEOF
14938 rm -f conftest.$ac_objext conftest$ac_exeext
14939 if { (eval echo "$as_me:14939: \"$ac_link\"") >&5
14940   (eval $ac_link) 2>&5
14941   ac_status=$?
14942   echo "$as_me:14942: \$? = $ac_status" >&5
14943   (exit $ac_status); } &&
14944          { ac_try='test -s conftest$ac_exeext'
14945   { (eval echo "$as_me:14945: \"$ac_try\"") >&5
14946   (eval $ac_try) 2>&5
14947   ac_status=$?
14948   echo "$as_me:14948: \$? = $ac_status" >&5
14949   (exit $ac_status); }; }; then
14950   ac_cv_func_XtAppInitialize=yes
14951 else
14952   echo "$as_me: failed program was:" >&5
14953 cat conftest.$ac_ext >&5
14954 ac_cv_func_XtAppInitialize=no
14955 fi
14956 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14957 fi
14958 echo "$as_me:14958: result: $ac_cv_func_XtAppInitialize" >&5
14959 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14960 if test $ac_cv_func_XtAppInitialize = yes; then
14961   :
14962 else
14963
14964         echo "$as_me:14964: checking for XtAppInitialize in -lXt" >&5
14965 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14966 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14967   echo $ECHO_N "(cached) $ECHO_C" >&6
14968 else
14969   ac_check_lib_save_LIBS=$LIBS
14970 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14971 cat >conftest.$ac_ext <<_ACEOF
14972 #line 14972 "configure"
14973 #include "confdefs.h"
14974
14975 /* Override any gcc2 internal prototype to avoid an error.  */
14976 #ifdef __cplusplus
14977 extern "C"
14978 #endif
14979 /* We use char because int might match the return type of a gcc2
14980    builtin and then its argument prototype would still apply.  */
14981 char XtAppInitialize ();
14982 int
14983 main (void)
14984 {
14985 XtAppInitialize ();
14986   ;
14987   return 0;
14988 }
14989 _ACEOF
14990 rm -f conftest.$ac_objext conftest$ac_exeext
14991 if { (eval echo "$as_me:14991: \"$ac_link\"") >&5
14992   (eval $ac_link) 2>&5
14993   ac_status=$?
14994   echo "$as_me:14994: \$? = $ac_status" >&5
14995   (exit $ac_status); } &&
14996          { ac_try='test -s conftest$ac_exeext'
14997   { (eval echo "$as_me:14997: \"$ac_try\"") >&5
14998   (eval $ac_try) 2>&5
14999   ac_status=$?
15000   echo "$as_me:15000: \$? = $ac_status" >&5
15001   (exit $ac_status); }; }; then
15002   ac_cv_lib_Xt_XtAppInitialize=yes
15003 else
15004   echo "$as_me: failed program was:" >&5
15005 cat conftest.$ac_ext >&5
15006 ac_cv_lib_Xt_XtAppInitialize=no
15007 fi
15008 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15009 LIBS=$ac_check_lib_save_LIBS
15010 fi
15011 echo "$as_me:15011: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15012 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15013 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
15014
15015 cat >>confdefs.h <<\EOF
15016 #define HAVE_LIBXT 1
15017 EOF
15018
15019                  cf_have_X_LIBS=Xt
15020                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
15021 fi
15022
15023 fi
15024
15025 fi
15026
15027 if test $cf_have_X_LIBS = no ; then
15028         { echo "$as_me:15028: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15029 test program.  You will have to check and add the proper libraries by hand
15030 to makefile." >&5
15031 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15032 test program.  You will have to check and add the proper libraries by hand
15033 to makefile." >&2;}
15034 fi
15035
15036 cf_x_athena_root=$cf_x_athena
15037 cf_x_athena_inc=""
15038
15039 for cf_path in default \
15040         /usr/contrib/X11R6 \
15041         /usr/contrib/X11R5 \
15042         /usr/lib/X11R5 \
15043         /usr/local
15044 do
15045         if test -z "$cf_x_athena_inc" ; then
15046
15047 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15048 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15049 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15050 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15051 for cf_X_CFLAGS in $X_CFLAGS
15052 do
15053         case "x$cf_X_CFLAGS" in
15054         x-[IUD]*)
15055                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15056                 ;;
15057         *)
15058                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15059                 ;;
15060         esac
15061 done
15062
15063                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15064                 if test $cf_path != default ; then
15065
15066         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15067         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15068
15069                         echo "$as_me:15069: checking for $cf_test in $cf_path" >&5
15070 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15071                 else
15072                         echo "$as_me:15072: checking for $cf_test" >&5
15073 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15074                 fi
15075                 cat >conftest.$ac_ext <<_ACEOF
15076 #line 15076 "configure"
15077 #include "confdefs.h"
15078
15079 #include <X11/Intrinsic.h>
15080 #include <$cf_test>
15081 int
15082 main (void)
15083 {
15084
15085   ;
15086   return 0;
15087 }
15088 _ACEOF
15089 rm -f conftest.$ac_objext
15090 if { (eval echo "$as_me:15090: \"$ac_compile\"") >&5
15091   (eval $ac_compile) 2>&5
15092   ac_status=$?
15093   echo "$as_me:15093: \$? = $ac_status" >&5
15094   (exit $ac_status); } &&
15095          { ac_try='test -s conftest.$ac_objext'
15096   { (eval echo "$as_me:15096: \"$ac_try\"") >&5
15097   (eval $ac_try) 2>&5
15098   ac_status=$?
15099   echo "$as_me:15099: \$? = $ac_status" >&5
15100   (exit $ac_status); }; }; then
15101   cf_result=yes
15102 else
15103   echo "$as_me: failed program was:" >&5
15104 cat conftest.$ac_ext >&5
15105 cf_result=no
15106 fi
15107 rm -f conftest.$ac_objext conftest.$ac_ext
15108                 echo "$as_me:15108: result: $cf_result" >&5
15109 echo "${ECHO_T}$cf_result" >&6
15110
15111 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15112 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15113 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15114
15115                 if test "$cf_result" = yes ; then
15116                         test "$cf_path"  = default && cf_x_athena_inc=default
15117                         test "$cf_path" != default && cf_x_athena_inc=$cf_path/include
15118                         break
15119                 fi
15120         fi
15121 done
15122
15123 if test -z "$cf_x_athena_inc" ; then
15124         { echo "$as_me:15124: WARNING: Unable to find Athena header files" >&5
15125 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15126 elif test "$cf_x_athena_inc" != default ; then
15127
15128         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15129         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15130
15131 fi
15132
15133 cf_x_athena_root=$cf_x_athena
15134 cf_x_athena_lib=""
15135
15136 for cf_path in default \
15137         /usr/contrib/X11R6 \
15138         /usr/contrib/X11R5 \
15139         /usr/lib/X11R5 \
15140         /usr/local
15141 do
15142         for cf_lib in \
15143                 ${cf_x_athena_root} \
15144                 ${cf_x_athena_root}7 \
15145                 ${cf_x_athena_root}6
15146         do
15147         for cf_libs in \
15148                 "-l$cf_lib -lXmu" \
15149                 "-l$cf_lib -lXpm -lXmu" \
15150                 "-l${cf_lib}_s -lXmu_s"
15151         do
15152                 test -n "$cf_x_athena_lib" && break
15153
15154 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15155 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15156 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15157 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15158 for cf_X_CFLAGS in $X_CFLAGS
15159 do
15160         case "x$cf_X_CFLAGS" in
15161         x-[IUD]*)
15162                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15163                 ;;
15164         *)
15165                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15166                 ;;
15167         esac
15168 done
15169
15170                 cf_test=XawSimpleMenuAddGlobalActions
15171                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15172
15173 cf_add_libs="$LIBS"
15174 # reverse order
15175 cf_add_0lib=
15176 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15177 # filter duplicates
15178 for cf_add_1lib in $cf_add_0lib; do
15179         for cf_add_2lib in $cf_add_libs; do
15180                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15181                         cf_add_1lib=
15182                         break
15183                 fi
15184         done
15185         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15186 done
15187 LIBS="$cf_add_libs"
15188
15189                 echo "$as_me:15189: checking for $cf_test in $cf_libs" >&5
15190 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15191                 cat >conftest.$ac_ext <<_ACEOF
15192 #line 15192 "configure"
15193 #include "confdefs.h"
15194
15195 #include <X11/Intrinsic.h>
15196 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15197
15198 int
15199 main (void)
15200 {
15201
15202 $cf_test((XtAppContext) 0)
15203   ;
15204   return 0;
15205 }
15206 _ACEOF
15207 rm -f conftest.$ac_objext conftest$ac_exeext
15208 if { (eval echo "$as_me:15208: \"$ac_link\"") >&5
15209   (eval $ac_link) 2>&5
15210   ac_status=$?
15211   echo "$as_me:15211: \$? = $ac_status" >&5
15212   (exit $ac_status); } &&
15213          { ac_try='test -s conftest$ac_exeext'
15214   { (eval echo "$as_me:15214: \"$ac_try\"") >&5
15215   (eval $ac_try) 2>&5
15216   ac_status=$?
15217   echo "$as_me:15217: \$? = $ac_status" >&5
15218   (exit $ac_status); }; }; then
15219   cf_result=yes
15220 else
15221   echo "$as_me: failed program was:" >&5
15222 cat conftest.$ac_ext >&5
15223 cf_result=no
15224 fi
15225 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15226                 echo "$as_me:15226: result: $cf_result" >&5
15227 echo "${ECHO_T}$cf_result" >&6
15228
15229 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15230 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15231 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15232
15233                 if test "$cf_result" = yes ; then
15234                         cf_x_athena_lib="$cf_libs"
15235                         break
15236                 fi
15237         done # cf_libs
15238                 test -n "$cf_x_athena_lib" && break
15239         done # cf_lib
15240 done
15241
15242 if test -z "$cf_x_athena_lib" ; then
15243         { { echo "$as_me:15243: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15244 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15245    { (exit 1); exit 1; }; }
15246 fi
15247
15248 cf_add_libs="$LIBS"
15249 # reverse order
15250 cf_add_0lib=
15251 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15252 # filter duplicates
15253 for cf_add_1lib in $cf_add_0lib; do
15254         for cf_add_2lib in $cf_add_libs; do
15255                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15256                         cf_add_1lib=
15257                         break
15258                 fi
15259         done
15260         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15261 done
15262 LIBS="$cf_add_libs"
15263
15264 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15265
15266 cat >>confdefs.h <<EOF
15267 #define $cf_x_athena_LIBS 1
15268 EOF
15269
15270 fi
15271
15272 if test -n "$ac_tool_prefix"; then
15273   for ac_prog in xcurses-config
15274   do
15275     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15276 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15277 echo "$as_me:15277: checking for $ac_word" >&5
15278 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15279 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15280   echo $ECHO_N "(cached) $ECHO_C" >&6
15281 else
15282   if test -n "$XCURSES_CONFIG"; then
15283   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15284 else
15285   ac_save_IFS=$IFS; IFS=$ac_path_separator
15286 ac_dummy="$PATH"
15287 for ac_dir in $ac_dummy; do
15288   IFS=$ac_save_IFS
15289   test -z "$ac_dir" && ac_dir=.
15290   $as_executable_p "$ac_dir/$ac_word" || continue
15291 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15292 echo "$as_me:15292: found $ac_dir/$ac_word" >&5
15293 break
15294 done
15295
15296 fi
15297 fi
15298 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15299 if test -n "$XCURSES_CONFIG"; then
15300   echo "$as_me:15300: result: $XCURSES_CONFIG" >&5
15301 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15302 else
15303   echo "$as_me:15303: result: no" >&5
15304 echo "${ECHO_T}no" >&6
15305 fi
15306
15307     test -n "$XCURSES_CONFIG" && break
15308   done
15309 fi
15310 if test -z "$XCURSES_CONFIG"; then
15311   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15312   for ac_prog in xcurses-config
15313 do
15314   # Extract the first word of "$ac_prog", so it can be a program name with args.
15315 set dummy $ac_prog; ac_word=$2
15316 echo "$as_me:15316: checking for $ac_word" >&5
15317 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15318 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15319   echo $ECHO_N "(cached) $ECHO_C" >&6
15320 else
15321   if test -n "$ac_ct_XCURSES_CONFIG"; then
15322   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15323 else
15324   ac_save_IFS=$IFS; IFS=$ac_path_separator
15325 ac_dummy="$PATH"
15326 for ac_dir in $ac_dummy; do
15327   IFS=$ac_save_IFS
15328   test -z "$ac_dir" && ac_dir=.
15329   $as_executable_p "$ac_dir/$ac_word" || continue
15330 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15331 echo "$as_me:15331: found $ac_dir/$ac_word" >&5
15332 break
15333 done
15334
15335 fi
15336 fi
15337 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15338 if test -n "$ac_ct_XCURSES_CONFIG"; then
15339   echo "$as_me:15339: result: $ac_ct_XCURSES_CONFIG" >&5
15340 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15341 else
15342   echo "$as_me:15342: result: no" >&5
15343 echo "${ECHO_T}no" >&6
15344 fi
15345
15346   test -n "$ac_ct_XCURSES_CONFIG" && break
15347 done
15348 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15349
15350   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15351 fi
15352
15353 if test "$XCURSES_CONFIG" != none ; then
15354
15355 cf_fix_cppflags=no
15356 cf_new_cflags=
15357 cf_new_cppflags=
15358 cf_new_extra_cppflags=
15359
15360 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15361 do
15362 case $cf_fix_cppflags in
15363 (no)
15364         case $cf_add_cflags in
15365         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15366                 case $cf_add_cflags in
15367                 (-D*)
15368                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15369
15370                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15371                                 && test -z "${cf_tst_cflags}" \
15372                                 && cf_fix_cppflags=yes
15373
15374                         if test $cf_fix_cppflags = yes ; then
15375
15376         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15377         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15378
15379                                 continue
15380                         elif test "${cf_tst_cflags}" = "\"'" ; then
15381
15382         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15383         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15384
15385                                 continue
15386                         fi
15387                         ;;
15388                 esac
15389                 case "$CPPFLAGS" in
15390                 (*$cf_add_cflags)
15391                         ;;
15392                 (*)
15393                         case $cf_add_cflags in
15394                         (-D*)
15395                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15396
15397 CPPFLAGS=`echo "$CPPFLAGS" | \
15398         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15399                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15400
15401                                 ;;
15402                         esac
15403
15404         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15405         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15406
15407                         ;;
15408                 esac
15409                 ;;
15410         (*)
15411
15412         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15413         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15414
15415                 ;;
15416         esac
15417         ;;
15418 (yes)
15419
15420         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15421         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15422
15423         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15424
15425         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15426                 && test -z "${cf_tst_cflags}" \
15427                 && cf_fix_cppflags=no
15428         ;;
15429 esac
15430 done
15431
15432 if test -n "$cf_new_cflags" ; then
15433
15434         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15435         CFLAGS="${CFLAGS}$cf_new_cflags"
15436
15437 fi
15438
15439 if test -n "$cf_new_cppflags" ; then
15440
15441         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15442         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15443
15444 fi
15445
15446 if test -n "$cf_new_extra_cppflags" ; then
15447
15448         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15449         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15450
15451 fi
15452
15453 cf_add_libs="$LIBS"
15454 # reverse order
15455 cf_add_0lib=
15456 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15457 # filter duplicates
15458 for cf_add_1lib in $cf_add_0lib; do
15459         for cf_add_2lib in $cf_add_libs; do
15460                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15461                         cf_add_1lib=
15462                         break
15463                 fi
15464         done
15465         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15466 done
15467 LIBS="$cf_add_libs"
15468
15469 cf_cv_lib_XCurses=yes
15470
15471 else
15472
15473 LDFLAGS="$LDFLAGS $X_LIBS"
15474
15475 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15476
15477 echo "${as_me:-configure}:15477: testing checking additions to CFLAGS ..." 1>&5
15478
15479 cf_check_cflags="$CFLAGS"
15480 cf_check_cppflags="$CPPFLAGS"
15481
15482 cf_fix_cppflags=no
15483 cf_new_cflags=
15484 cf_new_cppflags=
15485 cf_new_extra_cppflags=
15486
15487 for cf_add_cflags in $X_CFLAGS
15488 do
15489 case $cf_fix_cppflags in
15490 (no)
15491         case $cf_add_cflags in
15492         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15493                 case $cf_add_cflags in
15494                 (-D*)
15495                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15496
15497                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15498                                 && test -z "${cf_tst_cflags}" \
15499                                 && cf_fix_cppflags=yes
15500
15501                         if test $cf_fix_cppflags = yes ; then
15502
15503         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15504         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15505
15506                                 continue
15507                         elif test "${cf_tst_cflags}" = "\"'" ; then
15508
15509         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15510         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15511
15512                                 continue
15513                         fi
15514                         ;;
15515                 esac
15516                 case "$CPPFLAGS" in
15517                 (*$cf_add_cflags)
15518                         ;;
15519                 (*)
15520                         case $cf_add_cflags in
15521                         (-D*)
15522                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15523
15524 CPPFLAGS=`echo "$CPPFLAGS" | \
15525         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15526                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15527
15528                                 ;;
15529                         esac
15530
15531         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15532         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15533
15534                         ;;
15535                 esac
15536                 ;;
15537         (*)
15538
15539         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15540         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15541
15542                 ;;
15543         esac
15544         ;;
15545 (yes)
15546
15547         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15548         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15549
15550         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15551
15552         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15553                 && test -z "${cf_tst_cflags}" \
15554                 && cf_fix_cppflags=no
15555         ;;
15556 esac
15557 done
15558
15559 if test -n "$cf_new_cflags" ; then
15560         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15561
15562 echo "${as_me:-configure}:15562: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15563
15564         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15565         CFLAGS="${CFLAGS}$cf_new_cflags"
15566
15567 fi
15568
15569 if test -n "$cf_new_cppflags" ; then
15570         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15571
15572 echo "${as_me:-configure}:15572: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15573
15574         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15575         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15576
15577 fi
15578
15579 if test -n "$cf_new_extra_cppflags" ; then
15580         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15581
15582 echo "${as_me:-configure}:15582: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15583
15584         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15585         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15586
15587 fi
15588
15589 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15590 cat >conftest.$ac_ext <<_ACEOF
15591 #line 15591 "configure"
15592 #include "confdefs.h"
15593 #include <stdio.h>
15594 int
15595 main (void)
15596 {
15597 printf("Hello world");
15598   ;
15599   return 0;
15600 }
15601 _ACEOF
15602 rm -f conftest.$ac_objext conftest$ac_exeext
15603 if { (eval echo "$as_me:15603: \"$ac_link\"") >&5
15604   (eval $ac_link) 2>&5
15605   ac_status=$?
15606   echo "$as_me:15606: \$? = $ac_status" >&5
15607   (exit $ac_status); } &&
15608          { ac_try='test -s conftest$ac_exeext'
15609   { (eval echo "$as_me:15609: \"$ac_try\"") >&5
15610   (eval $ac_try) 2>&5
15611   ac_status=$?
15612   echo "$as_me:15612: \$? = $ac_status" >&5
15613   (exit $ac_status); }; }; then
15614   :
15615 else
15616   echo "$as_me: failed program was:" >&5
15617 cat conftest.$ac_ext >&5
15618 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15619
15620 echo "${as_me:-configure}:15620: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15621
15622          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15623                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15624
15625 echo "${as_me:-configure}:15625: testing but keeping change to \$CPPFLAGS ..." 1>&5
15626
15627          fi
15628          CFLAGS="$cf_check_flags"
15629 fi
15630 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15631 fi
15632
15633 echo "$as_me:15633: checking for XOpenDisplay in -lX11" >&5
15634 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15635 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15636   echo $ECHO_N "(cached) $ECHO_C" >&6
15637 else
15638   ac_check_lib_save_LIBS=$LIBS
15639 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15640 cat >conftest.$ac_ext <<_ACEOF
15641 #line 15641 "configure"
15642 #include "confdefs.h"
15643
15644 /* Override any gcc2 internal prototype to avoid an error.  */
15645 #ifdef __cplusplus
15646 extern "C"
15647 #endif
15648 /* We use char because int might match the return type of a gcc2
15649    builtin and then its argument prototype would still apply.  */
15650 char XOpenDisplay ();
15651 int
15652 main (void)
15653 {
15654 XOpenDisplay ();
15655   ;
15656   return 0;
15657 }
15658 _ACEOF
15659 rm -f conftest.$ac_objext conftest$ac_exeext
15660 if { (eval echo "$as_me:15660: \"$ac_link\"") >&5
15661   (eval $ac_link) 2>&5
15662   ac_status=$?
15663   echo "$as_me:15663: \$? = $ac_status" >&5
15664   (exit $ac_status); } &&
15665          { ac_try='test -s conftest$ac_exeext'
15666   { (eval echo "$as_me:15666: \"$ac_try\"") >&5
15667   (eval $ac_try) 2>&5
15668   ac_status=$?
15669   echo "$as_me:15669: \$? = $ac_status" >&5
15670   (exit $ac_status); }; }; then
15671   ac_cv_lib_X11_XOpenDisplay=yes
15672 else
15673   echo "$as_me: failed program was:" >&5
15674 cat conftest.$ac_ext >&5
15675 ac_cv_lib_X11_XOpenDisplay=no
15676 fi
15677 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15678 LIBS=$ac_check_lib_save_LIBS
15679 fi
15680 echo "$as_me:15680: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15681 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15682 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15683
15684 cf_add_libs="$LIBS"
15685 # reverse order
15686 cf_add_0lib=
15687 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15688 # filter duplicates
15689 for cf_add_1lib in $cf_add_0lib; do
15690         for cf_add_2lib in $cf_add_libs; do
15691                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15692                         cf_add_1lib=
15693                         break
15694                 fi
15695         done
15696         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15697 done
15698 LIBS="$cf_add_libs"
15699
15700 fi
15701
15702 echo "$as_me:15702: checking for XCurses library" >&5
15703 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15704 if test "${cf_cv_lib_XCurses+set}" = set; then
15705   echo $ECHO_N "(cached) $ECHO_C" >&6
15706 else
15707
15708 cf_add_libs="$LIBS"
15709 # reverse order
15710 cf_add_0lib=
15711 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15712 # filter duplicates
15713 for cf_add_1lib in $cf_add_0lib; do
15714         for cf_add_2lib in $cf_add_libs; do
15715                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15716                         cf_add_1lib=
15717                         break
15718                 fi
15719         done
15720         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15721 done
15722 LIBS="$cf_add_libs"
15723
15724 cat >conftest.$ac_ext <<_ACEOF
15725 #line 15725 "configure"
15726 #include "confdefs.h"
15727
15728 #include <xcurses.h>
15729 char *XCursesProgramName = "test";
15730
15731 int
15732 main (void)
15733 {
15734 XCursesExit();
15735   ;
15736   return 0;
15737 }
15738 _ACEOF
15739 rm -f conftest.$ac_objext conftest$ac_exeext
15740 if { (eval echo "$as_me:15740: \"$ac_link\"") >&5
15741   (eval $ac_link) 2>&5
15742   ac_status=$?
15743   echo "$as_me:15743: \$? = $ac_status" >&5
15744   (exit $ac_status); } &&
15745          { ac_try='test -s conftest$ac_exeext'
15746   { (eval echo "$as_me:15746: \"$ac_try\"") >&5
15747   (eval $ac_try) 2>&5
15748   ac_status=$?
15749   echo "$as_me:15749: \$? = $ac_status" >&5
15750   (exit $ac_status); }; }; then
15751   cf_cv_lib_XCurses=yes
15752 else
15753   echo "$as_me: failed program was:" >&5
15754 cat conftest.$ac_ext >&5
15755 cf_cv_lib_XCurses=no
15756 fi
15757 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15758
15759 fi
15760 echo "$as_me:15760: result: $cf_cv_lib_XCurses" >&5
15761 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15762
15763 fi
15764
15765 if test $cf_cv_lib_XCurses = yes ; then
15766
15767 cat >>confdefs.h <<\EOF
15768 #define UNIX 1
15769 EOF
15770
15771 cat >>confdefs.h <<\EOF
15772 #define XCURSES 1
15773 EOF
15774
15775         echo "$as_me:15775: checking for xcurses.h" >&5
15776 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15777 if test "${ac_cv_header_xcurses_h+set}" = set; then
15778   echo $ECHO_N "(cached) $ECHO_C" >&6
15779 else
15780   cat >conftest.$ac_ext <<_ACEOF
15781 #line 15781 "configure"
15782 #include "confdefs.h"
15783 #include <xcurses.h>
15784 _ACEOF
15785 if { (eval echo "$as_me:15785: \"$ac_cpp conftest.$ac_ext\"") >&5
15786   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15787   ac_status=$?
15788   egrep -v '^ *\+' conftest.er1 >conftest.err
15789   rm -f conftest.er1
15790   cat conftest.err >&5
15791   echo "$as_me:15791: \$? = $ac_status" >&5
15792   (exit $ac_status); } >/dev/null; then
15793   if test -s conftest.err; then
15794     ac_cpp_err=$ac_c_preproc_warn_flag
15795   else
15796     ac_cpp_err=
15797   fi
15798 else
15799   ac_cpp_err=yes
15800 fi
15801 if test -z "$ac_cpp_err"; then
15802   ac_cv_header_xcurses_h=yes
15803 else
15804   echo "$as_me: failed program was:" >&5
15805   cat conftest.$ac_ext >&5
15806   ac_cv_header_xcurses_h=no
15807 fi
15808 rm -f conftest.err conftest.$ac_ext
15809 fi
15810 echo "$as_me:15810: result: $ac_cv_header_xcurses_h" >&5
15811 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15812 if test $ac_cv_header_xcurses_h = yes; then
15813
15814 cat >>confdefs.h <<\EOF
15815 #define HAVE_XCURSES 1
15816 EOF
15817
15818 fi
15819
15820 else
15821         { { echo "$as_me:15821: error: Cannot link with XCurses" >&5
15822 echo "$as_me: error: Cannot link with XCurses" >&2;}
15823    { (exit 1); exit 1; }; }
15824 fi
15825
15826         ;;
15827 (*)
15828         { { echo "$as_me:15828: error: unexpected screen-value: $cf_cv_screen" >&5
15829 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15830    { (exit 1); exit 1; }; }
15831         ;;
15832 esac
15833
15834 : ${cf_nculib_root:=$cf_cv_screen}
15835 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15836 echo "$as_me:15836: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15837 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15838 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15839   echo $ECHO_N "(cached) $ECHO_C" >&6
15840 else
15841   ac_check_lib_save_LIBS=$LIBS
15842 LIBS="-l$cf_nculib_root  $LIBS"
15843 cat >conftest.$ac_ext <<_ACEOF
15844 #line 15844 "configure"
15845 #include "confdefs.h"
15846
15847 /* Override any gcc2 internal prototype to avoid an error.  */
15848 #ifdef __cplusplus
15849 extern "C"
15850 #endif
15851 /* We use char because int might match the return type of a gcc2
15852    builtin and then its argument prototype would still apply.  */
15853 char _nc_init_pthreads ();
15854 int
15855 main (void)
15856 {
15857 _nc_init_pthreads ();
15858   ;
15859   return 0;
15860 }
15861 _ACEOF
15862 rm -f conftest.$ac_objext conftest$ac_exeext
15863 if { (eval echo "$as_me:15863: \"$ac_link\"") >&5
15864   (eval $ac_link) 2>&5
15865   ac_status=$?
15866   echo "$as_me:15866: \$? = $ac_status" >&5
15867   (exit $ac_status); } &&
15868          { ac_try='test -s conftest$ac_exeext'
15869   { (eval echo "$as_me:15869: \"$ac_try\"") >&5
15870   (eval $ac_try) 2>&5
15871   ac_status=$?
15872   echo "$as_me:15872: \$? = $ac_status" >&5
15873   (exit $ac_status); }; }; then
15874   eval "$as_ac_Lib=yes"
15875 else
15876   echo "$as_me: failed program was:" >&5
15877 cat conftest.$ac_ext >&5
15878 eval "$as_ac_Lib=no"
15879 fi
15880 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15881 LIBS=$ac_check_lib_save_LIBS
15882 fi
15883 echo "$as_me:15883: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15884 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15885 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15886   cf_cv_ncurses_pthreads=yes
15887 else
15888   cf_cv_ncurses_pthreads=no
15889 fi
15890
15891 if test "$cf_cv_ncurses_pthreads" = yes
15892 then
15893
15894 cf_add_libs="$LIBS"
15895 # reverse order
15896 cf_add_0lib=
15897 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15898 # filter duplicates
15899 for cf_add_1lib in $cf_add_0lib; do
15900         for cf_add_2lib in $cf_add_libs; do
15901                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15902                         cf_add_1lib=
15903                         break
15904                 fi
15905         done
15906         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15907 done
15908 LIBS="$cf_add_libs"
15909
15910 fi
15911
15912 case $cf_cv_screen in
15913 (ncurses*)
15914         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15915         ;;
15916 esac
15917
15918 echo "$as_me:15918: checking for X11 rgb file" >&5
15919 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15920
15921 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15922 if test "${with_x11_rgb+set}" = set; then
15923   withval="$with_x11_rgb"
15924   RGB_PATH=$withval
15925 else
15926   RGB_PATH=auto
15927 fi;
15928
15929 if test "x$RGB_PATH" = xauto
15930 then
15931         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15932         for cf_path in \
15933                 /opt/local/share/X11/rgb.txt \
15934                 /opt/X11/share/X11/rgb.txt \
15935                 /usr/share/X11/rgb.txt \
15936                 /usr/X11/share/X11/rgb.txt \
15937                 /usr/X11/lib/X11/rgb.txt \
15938                 /usr/lib/X11/rgb.txt \
15939                 /etc/X11/rgb.txt \
15940                 /usr/pkg/lib/X11/rgb.txt \
15941                 /usr/X11R7/lib/X11/rgb.txt \
15942                 /usr/X11R6/lib/X11/rgb.txt \
15943                 /usr/X11R5/lib/X11/rgb.txt \
15944                 /usr/X11R4/lib/X11/rgb.txt \
15945                 /usr/local/lib/X11/rgb.txt \
15946                 /usr/local/share/X11/rgb.txt \
15947                 /usr/lib64/X11/rgb.txt
15948         do
15949                 if test -f "$cf_path" ; then
15950                         RGB_PATH="$cf_path"
15951                         break
15952                 fi
15953         done
15954 else
15955         cf_path=$RGB_PATH
15956
15957 if test "x$prefix" != xNONE; then
15958         cf_path_syntax="$prefix"
15959 else
15960         cf_path_syntax="$ac_default_prefix"
15961 fi
15962
15963 case ".$cf_path" in
15964 (.\$\(*\)*|.\'*\'*)
15965         ;;
15966 (..|./*|.\\*)
15967         ;;
15968 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15969         ;;
15970 (.\${*prefix}*|.\${*dir}*)
15971         eval cf_path="$cf_path"
15972         case ".$cf_path" in
15973         (.NONE/*)
15974                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15975                 ;;
15976         esac
15977         ;;
15978 (.no|.NONE/*)
15979         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15980         ;;
15981 (*)
15982         { { echo "$as_me:15982: error: expected a pathname, not \"$cf_path\"" >&5
15983 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15984    { (exit 1); exit 1; }; }
15985         ;;
15986 esac
15987
15988 fi
15989
15990 echo "$as_me:15990: result: $RGB_PATH" >&5
15991 echo "${ECHO_T}$RGB_PATH" >&6
15992
15993 cat >>confdefs.h <<EOF
15994 #define RGB_PATH "$cf_path"
15995 EOF
15996
15997 no_x11_rgb=
15998 if test "$RGB_PATH" = no
15999 then
16000         no_x11_rgb="#"
16001 fi
16002
16003 cf_curses_headers=
16004
16005 case $cf_cv_screen in
16006 (pdcurses)
16007         cf_default_panel=no
16008         cf_default_form=no
16009         cf_default_menu=no
16010         cf_default_tinfo=no
16011         ;;
16012 (xcurses|bsdcurses)
16013         cf_default_panel=no
16014         cf_default_form=no
16015         cf_default_menu=no
16016         cf_default_tinfo=yes
16017         ;;
16018 (*)
16019         cf_default_panel=yes
16020         cf_default_form=yes
16021         cf_default_menu=yes
16022         cf_default_tinfo=yes
16023         case $cf_cv_screen in
16024         (ncurses*)
16025                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16026                 ;;
16027         esac
16028         ;;
16029 esac
16030
16031 echo "$as_me:16031: checking for desired basename for form library" >&5
16032 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16033
16034 # Check whether --with-form-libname or --without-form-libname was given.
16035 if test "${with_form_libname+set}" = set; then
16036   withval="$with_form_libname"
16037   with_lib_basename=$withval
16038 else
16039   with_lib_basename=form
16040 fi;
16041 FORM_NAME="$with_lib_basename"
16042
16043 case "x$FORM_NAME" in
16044 (x|xno|xnone|xyes)
16045         FORM_NAME=form
16046         ;;
16047 (*)
16048         ;;
16049 esac
16050
16051 echo "$as_me:16051: result: $FORM_NAME" >&5
16052 echo "${ECHO_T}$FORM_NAME" >&6
16053
16054 echo "$as_me:16054: checking for desired basename for menu library" >&5
16055 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16056
16057 # Check whether --with-menu-libname or --without-menu-libname was given.
16058 if test "${with_menu_libname+set}" = set; then
16059   withval="$with_menu_libname"
16060   with_lib_basename=$withval
16061 else
16062   with_lib_basename=menu
16063 fi;
16064 MENU_NAME="$with_lib_basename"
16065
16066 case "x$MENU_NAME" in
16067 (x|xno|xnone|xyes)
16068         MENU_NAME=menu
16069         ;;
16070 (*)
16071         ;;
16072 esac
16073
16074 echo "$as_me:16074: result: $MENU_NAME" >&5
16075 echo "${ECHO_T}$MENU_NAME" >&6
16076
16077 echo "$as_me:16077: checking for desired basename for panel library" >&5
16078 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16079
16080 # Check whether --with-panel-libname or --without-panel-libname was given.
16081 if test "${with_panel_libname+set}" = set; then
16082   withval="$with_panel_libname"
16083   with_lib_basename=$withval
16084 else
16085   with_lib_basename=panel
16086 fi;
16087 PANEL_NAME="$with_lib_basename"
16088
16089 case "x$PANEL_NAME" in
16090 (x|xno|xnone|xyes)
16091         PANEL_NAME=panel
16092         ;;
16093 (*)
16094         ;;
16095 esac
16096
16097 echo "$as_me:16097: result: $PANEL_NAME" >&5
16098 echo "${ECHO_T}$PANEL_NAME" >&6
16099
16100 echo "$as_me:16100: checking if you want to check for panel functions" >&5
16101 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16102
16103 # Check whether --enable-panel or --disable-panel was given.
16104 if test "${enable_panel+set}" = set; then
16105   enableval="$enable_panel"
16106   test "$enableval" != no && enableval=yes
16107         if test "$enableval" != "yes" ; then
16108     cf_enable_panel=no
16109         else
16110                 cf_enable_panel=$cf_default_panel
16111         fi
16112 else
16113   enableval=yes
16114         cf_enable_panel=$cf_default_panel
16115
16116 fi;
16117 echo "$as_me:16117: result: $cf_enable_panel" >&5
16118 echo "${ECHO_T}$cf_enable_panel" >&6
16119 if test $cf_enable_panel = yes
16120 then
16121
16122 cf_have_curses_lib=no
16123
16124 : ${NCURSES_CONFIG_PKG:=none}
16125 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16126         :
16127 elif test "x${PKG_CONFIG:=none}" != xnone; then
16128         echo "$as_me:16128: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16129 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16130         if "$PKG_CONFIG" --exists $PANEL_NAME$cf_cv_libtype ; then
16131                 echo "$as_me:16131: result: yes" >&5
16132 echo "${ECHO_T}yes" >&6
16133
16134                 echo "$as_me:16134: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16135 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16136
16137                 cf_save_CPPFLAGS="$CPPFLAGS"
16138                 cf_save_LIBS="$LIBS"
16139
16140 cf_fix_cppflags=no
16141 cf_new_cflags=
16142 cf_new_cppflags=
16143 cf_new_extra_cppflags=
16144
16145 for cf_add_cflags in `$PKG_CONFIG --cflags $PANEL_NAME$cf_cv_libtype`
16146 do
16147 case $cf_fix_cppflags in
16148 (no)
16149         case $cf_add_cflags in
16150         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16151                 case $cf_add_cflags in
16152                 (-D*)
16153                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16154
16155                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16156                                 && test -z "${cf_tst_cflags}" \
16157                                 && cf_fix_cppflags=yes
16158
16159                         if test $cf_fix_cppflags = yes ; then
16160
16161         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16162         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16163
16164                                 continue
16165                         elif test "${cf_tst_cflags}" = "\"'" ; then
16166
16167         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16168         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16169
16170                                 continue
16171                         fi
16172                         ;;
16173                 esac
16174                 case "$CPPFLAGS" in
16175                 (*$cf_add_cflags)
16176                         ;;
16177                 (*)
16178                         case $cf_add_cflags in
16179                         (-D*)
16180                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16181
16182 CPPFLAGS=`echo "$CPPFLAGS" | \
16183         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16184                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16185
16186                                 ;;
16187                         esac
16188
16189         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16190         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16191
16192                         ;;
16193                 esac
16194                 ;;
16195         (*)
16196
16197         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16198         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16199
16200                 ;;
16201         esac
16202         ;;
16203 (yes)
16204
16205         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16206         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16207
16208         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16209
16210         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16211                 && test -z "${cf_tst_cflags}" \
16212                 && cf_fix_cppflags=no
16213         ;;
16214 esac
16215 done
16216
16217 if test -n "$cf_new_cflags" ; then
16218
16219         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16220         CFLAGS="${CFLAGS}$cf_new_cflags"
16221
16222 fi
16223
16224 if test -n "$cf_new_cppflags" ; then
16225
16226         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16227         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16228
16229 fi
16230
16231 if test -n "$cf_new_extra_cppflags" ; then
16232
16233         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16234         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16235
16236 fi
16237
16238 cf_add_libs="$LIBS"
16239 # reverse order
16240 cf_add_0lib=
16241 for cf_add_1lib in `$PKG_CONFIG --libs $PANEL_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16242 # filter duplicates
16243 for cf_add_1lib in $cf_add_0lib; do
16244         for cf_add_2lib in $cf_add_libs; do
16245                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16246                         cf_add_1lib=
16247                         break
16248                 fi
16249         done
16250         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16251 done
16252 LIBS="$cf_add_libs"
16253
16254                 cat >conftest.$ac_ext <<_ACEOF
16255 #line 16255 "configure"
16256 #include "confdefs.h"
16257 #include <$PANEL_NAME.h>
16258 int
16259 main (void)
16260 {
16261 (void) new_panel ( 0 );
16262   ;
16263   return 0;
16264 }
16265 _ACEOF
16266 rm -f conftest.$ac_objext conftest$ac_exeext
16267 if { (eval echo "$as_me:16267: \"$ac_link\"") >&5
16268   (eval $ac_link) 2>&5
16269   ac_status=$?
16270   echo "$as_me:16270: \$? = $ac_status" >&5
16271   (exit $ac_status); } &&
16272          { ac_try='test -s conftest$ac_exeext'
16273   { (eval echo "$as_me:16273: \"$ac_try\"") >&5
16274   (eval $ac_try) 2>&5
16275   ac_status=$?
16276   echo "$as_me:16276: \$? = $ac_status" >&5
16277   (exit $ac_status); }; }; then
16278   if test "$cross_compiling" = yes; then
16279   cf_have_curses_lib=maybe
16280 else
16281   cat >conftest.$ac_ext <<_ACEOF
16282 #line 16282 "configure"
16283 #include "confdefs.h"
16284 #include <$PANEL_NAME.h>
16285                                 int main(void)
16286                                 { (void) new_panel ( 0 ); return 0; }
16287 _ACEOF
16288 rm -f conftest$ac_exeext
16289 if { (eval echo "$as_me:16289: \"$ac_link\"") >&5
16290   (eval $ac_link) 2>&5
16291   ac_status=$?
16292   echo "$as_me:16292: \$? = $ac_status" >&5
16293   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16294   { (eval echo "$as_me:16294: \"$ac_try\"") >&5
16295   (eval $ac_try) 2>&5
16296   ac_status=$?
16297   echo "$as_me:16297: \$? = $ac_status" >&5
16298   (exit $ac_status); }; }; then
16299   cf_have_curses_lib=yes
16300 else
16301   echo "$as_me: program exited with status $ac_status" >&5
16302 echo "$as_me: failed program was:" >&5
16303 cat conftest.$ac_ext >&5
16304 cf_have_curses_lib=no
16305 fi
16306 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16307 fi
16308 else
16309   echo "$as_me: failed program was:" >&5
16310 cat conftest.$ac_ext >&5
16311 cf_have_curses_lib=no
16312 fi
16313 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16314                 echo "$as_me:16314: result: $cf_have_curses_lib" >&5
16315 echo "${ECHO_T}$cf_have_curses_lib" >&6
16316                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16317                 if test "$cf_have_curses_lib" != "yes"
16318                 then
16319                         CPPFLAGS="$cf_save_CPPFLAGS"
16320                         LIBS="$cf_save_LIBS"
16321                 else
16322
16323 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16324
16325                         cat >>confdefs.h <<EOF
16326 #define $cf_upper 1
16327 EOF
16328
16329                 fi
16330         fi
16331 fi
16332 if test "$cf_have_curses_lib" = no; then
16333         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16334 echo "$as_me:16334: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16335 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16336 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16337   echo $ECHO_N "(cached) $ECHO_C" >&6
16338 else
16339   ac_check_lib_save_LIBS=$LIBS
16340 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16341 cat >conftest.$ac_ext <<_ACEOF
16342 #line 16342 "configure"
16343 #include "confdefs.h"
16344
16345 /* Override any gcc2 internal prototype to avoid an error.  */
16346 #ifdef __cplusplus
16347 extern "C"
16348 #endif
16349 /* We use char because int might match the return type of a gcc2
16350    builtin and then its argument prototype would still apply.  */
16351 char new_panel ();
16352 int
16353 main (void)
16354 {
16355 new_panel ();
16356   ;
16357   return 0;
16358 }
16359 _ACEOF
16360 rm -f conftest.$ac_objext conftest$ac_exeext
16361 if { (eval echo "$as_me:16361: \"$ac_link\"") >&5
16362   (eval $ac_link) 2>&5
16363   ac_status=$?
16364   echo "$as_me:16364: \$? = $ac_status" >&5
16365   (exit $ac_status); } &&
16366          { ac_try='test -s conftest$ac_exeext'
16367   { (eval echo "$as_me:16367: \"$ac_try\"") >&5
16368   (eval $ac_try) 2>&5
16369   ac_status=$?
16370   echo "$as_me:16370: \$? = $ac_status" >&5
16371   (exit $ac_status); }; }; then
16372   eval "$as_ac_Lib=yes"
16373 else
16374   echo "$as_me: failed program was:" >&5
16375 cat conftest.$ac_ext >&5
16376 eval "$as_ac_Lib=no"
16377 fi
16378 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16379 LIBS=$ac_check_lib_save_LIBS
16380 fi
16381 echo "$as_me:16381: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16382 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16383 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16384
16385 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16386
16387 cf_add_libs="$LIBS"
16388 # reverse order
16389 cf_add_0lib=
16390 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16391 # filter duplicates
16392 for cf_add_1lib in $cf_add_0lib; do
16393         for cf_add_2lib in $cf_add_libs; do
16394                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16395                         cf_add_1lib=
16396                         break
16397                 fi
16398         done
16399         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16400 done
16401 LIBS="$cf_add_libs"
16402
16403                 cat >>confdefs.h <<EOF
16404 #define $cf_upper 1
16405 EOF
16406
16407 fi
16408
16409 fi
16410
16411         cf_curses_headers="$cf_curses_headers panel.h"
16412 fi
16413
16414 echo "$as_me:16414: checking if you want to check for menu functions" >&5
16415 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16416
16417 # Check whether --enable-menu or --disable-menu was given.
16418 if test "${enable_menu+set}" = set; then
16419   enableval="$enable_menu"
16420   test "$enableval" != no && enableval=yes
16421         if test "$enableval" != "yes" ; then
16422     cf_enable_menu=no
16423         else
16424                 cf_enable_menu=$cf_default_menu
16425         fi
16426 else
16427   enableval=yes
16428         cf_enable_menu=$cf_default_menu
16429
16430 fi;
16431 echo "$as_me:16431: result: $cf_enable_menu" >&5
16432 echo "${ECHO_T}$cf_enable_menu" >&6
16433 if test $cf_enable_menu = yes
16434 then
16435         case $cf_cv_screen in
16436         (ncurses*)
16437                 ;;
16438         (curses*)
16439
16440 echo "$as_me:16440: checking for NetBSD menu.h" >&5
16441 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16442 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16443   echo $ECHO_N "(cached) $ECHO_C" >&6
16444 else
16445
16446 cat >conftest.$ac_ext <<_ACEOF
16447 #line 16447 "configure"
16448 #include "confdefs.h"
16449
16450 #include <${cf_cv_ncurses_header:-curses.h}>
16451 #include <menu.h>
16452
16453 int
16454 main (void)
16455 {
16456
16457         MENU *menu;
16458         int y = menu->max_item_width;
16459
16460   ;
16461   return 0;
16462 }
16463 _ACEOF
16464 rm -f conftest.$ac_objext
16465 if { (eval echo "$as_me:16465: \"$ac_compile\"") >&5
16466   (eval $ac_compile) 2>&5
16467   ac_status=$?
16468   echo "$as_me:16468: \$? = $ac_status" >&5
16469   (exit $ac_status); } &&
16470          { ac_try='test -s conftest.$ac_objext'
16471   { (eval echo "$as_me:16471: \"$ac_try\"") >&5
16472   (eval $ac_try) 2>&5
16473   ac_status=$?
16474   echo "$as_me:16474: \$? = $ac_status" >&5
16475   (exit $ac_status); }; }; then
16476   cf_cv_netbsd_menu_h=yes
16477
16478 else
16479   echo "$as_me: failed program was:" >&5
16480 cat conftest.$ac_ext >&5
16481 cf_cv_netbsd_menu_h=no
16482 fi
16483 rm -f conftest.$ac_objext conftest.$ac_ext
16484
16485 fi
16486 echo "$as_me:16486: result: $cf_cv_netbsd_menu_h" >&5
16487 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16488
16489 test "$cf_cv_netbsd_menu_h" = yes &&
16490 cat >>confdefs.h <<\EOF
16491 #define HAVE_NETBSD_MENU_H 1
16492 EOF
16493
16494                 ;;
16495         esac
16496
16497 cf_have_curses_lib=no
16498
16499 : ${NCURSES_CONFIG_PKG:=none}
16500 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16501         :
16502 elif test "x${PKG_CONFIG:=none}" != xnone; then
16503         echo "$as_me:16503: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16504 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16505         if "$PKG_CONFIG" --exists $MENU_NAME$cf_cv_libtype ; then
16506                 echo "$as_me:16506: result: yes" >&5
16507 echo "${ECHO_T}yes" >&6
16508
16509                 echo "$as_me:16509: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16510 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16511
16512                 cf_save_CPPFLAGS="$CPPFLAGS"
16513                 cf_save_LIBS="$LIBS"
16514
16515 cf_fix_cppflags=no
16516 cf_new_cflags=
16517 cf_new_cppflags=
16518 cf_new_extra_cppflags=
16519
16520 for cf_add_cflags in `$PKG_CONFIG --cflags $MENU_NAME$cf_cv_libtype`
16521 do
16522 case $cf_fix_cppflags in
16523 (no)
16524         case $cf_add_cflags in
16525         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16526                 case $cf_add_cflags in
16527                 (-D*)
16528                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16529
16530                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16531                                 && test -z "${cf_tst_cflags}" \
16532                                 && cf_fix_cppflags=yes
16533
16534                         if test $cf_fix_cppflags = yes ; then
16535
16536         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16537         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16538
16539                                 continue
16540                         elif test "${cf_tst_cflags}" = "\"'" ; then
16541
16542         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16543         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16544
16545                                 continue
16546                         fi
16547                         ;;
16548                 esac
16549                 case "$CPPFLAGS" in
16550                 (*$cf_add_cflags)
16551                         ;;
16552                 (*)
16553                         case $cf_add_cflags in
16554                         (-D*)
16555                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16556
16557 CPPFLAGS=`echo "$CPPFLAGS" | \
16558         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16559                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16560
16561                                 ;;
16562                         esac
16563
16564         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16565         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16566
16567                         ;;
16568                 esac
16569                 ;;
16570         (*)
16571
16572         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16573         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16574
16575                 ;;
16576         esac
16577         ;;
16578 (yes)
16579
16580         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16581         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16582
16583         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16584
16585         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16586                 && test -z "${cf_tst_cflags}" \
16587                 && cf_fix_cppflags=no
16588         ;;
16589 esac
16590 done
16591
16592 if test -n "$cf_new_cflags" ; then
16593
16594         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16595         CFLAGS="${CFLAGS}$cf_new_cflags"
16596
16597 fi
16598
16599 if test -n "$cf_new_cppflags" ; then
16600
16601         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16602         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16603
16604 fi
16605
16606 if test -n "$cf_new_extra_cppflags" ; then
16607
16608         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16609         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16610
16611 fi
16612
16613 cf_add_libs="$LIBS"
16614 # reverse order
16615 cf_add_0lib=
16616 for cf_add_1lib in `$PKG_CONFIG --libs $MENU_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16617 # filter duplicates
16618 for cf_add_1lib in $cf_add_0lib; do
16619         for cf_add_2lib in $cf_add_libs; do
16620                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16621                         cf_add_1lib=
16622                         break
16623                 fi
16624         done
16625         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16626 done
16627 LIBS="$cf_add_libs"
16628
16629                 cat >conftest.$ac_ext <<_ACEOF
16630 #line 16630 "configure"
16631 #include "confdefs.h"
16632 #include <$MENU_NAME.h>
16633 int
16634 main (void)
16635 {
16636 (void) menu_driver ( 0,0 );
16637   ;
16638   return 0;
16639 }
16640 _ACEOF
16641 rm -f conftest.$ac_objext conftest$ac_exeext
16642 if { (eval echo "$as_me:16642: \"$ac_link\"") >&5
16643   (eval $ac_link) 2>&5
16644   ac_status=$?
16645   echo "$as_me:16645: \$? = $ac_status" >&5
16646   (exit $ac_status); } &&
16647          { ac_try='test -s conftest$ac_exeext'
16648   { (eval echo "$as_me:16648: \"$ac_try\"") >&5
16649   (eval $ac_try) 2>&5
16650   ac_status=$?
16651   echo "$as_me:16651: \$? = $ac_status" >&5
16652   (exit $ac_status); }; }; then
16653   if test "$cross_compiling" = yes; then
16654   cf_have_curses_lib=maybe
16655 else
16656   cat >conftest.$ac_ext <<_ACEOF
16657 #line 16657 "configure"
16658 #include "confdefs.h"
16659 #include <$MENU_NAME.h>
16660                                 int main(void)
16661                                 { (void) menu_driver ( 0,0 ); return 0; }
16662 _ACEOF
16663 rm -f conftest$ac_exeext
16664 if { (eval echo "$as_me:16664: \"$ac_link\"") >&5
16665   (eval $ac_link) 2>&5
16666   ac_status=$?
16667   echo "$as_me:16667: \$? = $ac_status" >&5
16668   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16669   { (eval echo "$as_me:16669: \"$ac_try\"") >&5
16670   (eval $ac_try) 2>&5
16671   ac_status=$?
16672   echo "$as_me:16672: \$? = $ac_status" >&5
16673   (exit $ac_status); }; }; then
16674   cf_have_curses_lib=yes
16675 else
16676   echo "$as_me: program exited with status $ac_status" >&5
16677 echo "$as_me: failed program was:" >&5
16678 cat conftest.$ac_ext >&5
16679 cf_have_curses_lib=no
16680 fi
16681 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16682 fi
16683 else
16684   echo "$as_me: failed program was:" >&5
16685 cat conftest.$ac_ext >&5
16686 cf_have_curses_lib=no
16687 fi
16688 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16689                 echo "$as_me:16689: result: $cf_have_curses_lib" >&5
16690 echo "${ECHO_T}$cf_have_curses_lib" >&6
16691                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16692                 if test "$cf_have_curses_lib" != "yes"
16693                 then
16694                         CPPFLAGS="$cf_save_CPPFLAGS"
16695                         LIBS="$cf_save_LIBS"
16696                 else
16697
16698 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16699
16700                         cat >>confdefs.h <<EOF
16701 #define $cf_upper 1
16702 EOF
16703
16704                 fi
16705         fi
16706 fi
16707 if test "$cf_have_curses_lib" = no; then
16708         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16709 echo "$as_me:16709: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
16710 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16711 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16712   echo $ECHO_N "(cached) $ECHO_C" >&6
16713 else
16714   ac_check_lib_save_LIBS=$LIBS
16715 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
16716 cat >conftest.$ac_ext <<_ACEOF
16717 #line 16717 "configure"
16718 #include "confdefs.h"
16719
16720 /* Override any gcc2 internal prototype to avoid an error.  */
16721 #ifdef __cplusplus
16722 extern "C"
16723 #endif
16724 /* We use char because int might match the return type of a gcc2
16725    builtin and then its argument prototype would still apply.  */
16726 char menu_driver ();
16727 int
16728 main (void)
16729 {
16730 menu_driver ();
16731   ;
16732   return 0;
16733 }
16734 _ACEOF
16735 rm -f conftest.$ac_objext conftest$ac_exeext
16736 if { (eval echo "$as_me:16736: \"$ac_link\"") >&5
16737   (eval $ac_link) 2>&5
16738   ac_status=$?
16739   echo "$as_me:16739: \$? = $ac_status" >&5
16740   (exit $ac_status); } &&
16741          { ac_try='test -s conftest$ac_exeext'
16742   { (eval echo "$as_me:16742: \"$ac_try\"") >&5
16743   (eval $ac_try) 2>&5
16744   ac_status=$?
16745   echo "$as_me:16745: \$? = $ac_status" >&5
16746   (exit $ac_status); }; }; then
16747   eval "$as_ac_Lib=yes"
16748 else
16749   echo "$as_me: failed program was:" >&5
16750 cat conftest.$ac_ext >&5
16751 eval "$as_ac_Lib=no"
16752 fi
16753 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16754 LIBS=$ac_check_lib_save_LIBS
16755 fi
16756 echo "$as_me:16756: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16757 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16758 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16759
16760 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16761
16762 cf_add_libs="$LIBS"
16763 # reverse order
16764 cf_add_0lib=
16765 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16766 # filter duplicates
16767 for cf_add_1lib in $cf_add_0lib; do
16768         for cf_add_2lib in $cf_add_libs; do
16769                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16770                         cf_add_1lib=
16771                         break
16772                 fi
16773         done
16774         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16775 done
16776 LIBS="$cf_add_libs"
16777
16778                 cat >>confdefs.h <<EOF
16779 #define $cf_upper 1
16780 EOF
16781
16782 fi
16783
16784 fi
16785
16786         cf_curses_headers="$cf_curses_headers menu.h"
16787 fi
16788
16789 echo "$as_me:16789: checking if you want to check for form functions" >&5
16790 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16791
16792 # Check whether --enable-form or --disable-form was given.
16793 if test "${enable_form+set}" = set; then
16794   enableval="$enable_form"
16795   test "$enableval" != no && enableval=yes
16796         if test "$enableval" != "yes" ; then
16797     cf_enable_form=no
16798         else
16799                 cf_enable_form=$cf_default_form
16800         fi
16801 else
16802   enableval=yes
16803         cf_enable_form=$cf_default_form
16804
16805 fi;
16806 echo "$as_me:16806: result: $cf_enable_form" >&5
16807 echo "${ECHO_T}$cf_enable_form" >&6
16808 if test $cf_enable_form = yes
16809 then
16810         case $cf_cv_screen in
16811         (ncurses*)
16812                 ;;
16813         (curses*)
16814
16815 echo "$as_me:16815: checking for NetBSD form.h" >&5
16816 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16817 if test "${cf_cv_netbsd_form_h+set}" = set; then
16818   echo $ECHO_N "(cached) $ECHO_C" >&6
16819 else
16820
16821 cat >conftest.$ac_ext <<_ACEOF
16822 #line 16822 "configure"
16823 #include "confdefs.h"
16824
16825 #include <${cf_cv_ncurses_header:-curses.h}>
16826 #include <form.h>
16827
16828 int
16829 main (void)
16830 {
16831
16832         FORM *form;
16833         int y = current_field(form)->cursor_ypos;
16834         int x = current_field(form)->cursor_xpos;
16835
16836   ;
16837   return 0;
16838 }
16839 _ACEOF
16840 rm -f conftest.$ac_objext
16841 if { (eval echo "$as_me:16841: \"$ac_compile\"") >&5
16842   (eval $ac_compile) 2>&5
16843   ac_status=$?
16844   echo "$as_me:16844: \$? = $ac_status" >&5
16845   (exit $ac_status); } &&
16846          { ac_try='test -s conftest.$ac_objext'
16847   { (eval echo "$as_me:16847: \"$ac_try\"") >&5
16848   (eval $ac_try) 2>&5
16849   ac_status=$?
16850   echo "$as_me:16850: \$? = $ac_status" >&5
16851   (exit $ac_status); }; }; then
16852   cf_cv_netbsd_form_h=yes
16853
16854 else
16855   echo "$as_me: failed program was:" >&5
16856 cat conftest.$ac_ext >&5
16857 cf_cv_netbsd_form_h=no
16858 fi
16859 rm -f conftest.$ac_objext conftest.$ac_ext
16860
16861 fi
16862 echo "$as_me:16862: result: $cf_cv_netbsd_form_h" >&5
16863 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16864
16865 test "$cf_cv_netbsd_form_h" = yes &&
16866 cat >>confdefs.h <<\EOF
16867 #define HAVE_NETBSD_FORM_H 1
16868 EOF
16869
16870                 ;;
16871         esac
16872
16873 cf_have_curses_lib=no
16874
16875 : ${NCURSES_CONFIG_PKG:=none}
16876 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16877         :
16878 elif test "x${PKG_CONFIG:=none}" != xnone; then
16879         echo "$as_me:16879: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
16880 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
16881         if "$PKG_CONFIG" --exists $FORM_NAME$cf_cv_libtype ; then
16882                 echo "$as_me:16882: result: yes" >&5
16883 echo "${ECHO_T}yes" >&6
16884
16885                 echo "$as_me:16885: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
16886 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16887
16888                 cf_save_CPPFLAGS="$CPPFLAGS"
16889                 cf_save_LIBS="$LIBS"
16890
16891 cf_fix_cppflags=no
16892 cf_new_cflags=
16893 cf_new_cppflags=
16894 cf_new_extra_cppflags=
16895
16896 for cf_add_cflags in `$PKG_CONFIG --cflags $FORM_NAME$cf_cv_libtype`
16897 do
16898 case $cf_fix_cppflags in
16899 (no)
16900         case $cf_add_cflags in
16901         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16902                 case $cf_add_cflags in
16903                 (-D*)
16904                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16905
16906                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16907                                 && test -z "${cf_tst_cflags}" \
16908                                 && cf_fix_cppflags=yes
16909
16910                         if test $cf_fix_cppflags = yes ; then
16911
16912         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16913         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16914
16915                                 continue
16916                         elif test "${cf_tst_cflags}" = "\"'" ; then
16917
16918         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16919         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16920
16921                                 continue
16922                         fi
16923                         ;;
16924                 esac
16925                 case "$CPPFLAGS" in
16926                 (*$cf_add_cflags)
16927                         ;;
16928                 (*)
16929                         case $cf_add_cflags in
16930                         (-D*)
16931                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16932
16933 CPPFLAGS=`echo "$CPPFLAGS" | \
16934         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16935                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16936
16937                                 ;;
16938                         esac
16939
16940         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16941         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16942
16943                         ;;
16944                 esac
16945                 ;;
16946         (*)
16947
16948         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16949         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16950
16951                 ;;
16952         esac
16953         ;;
16954 (yes)
16955
16956         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16957         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16958
16959         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16960
16961         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16962                 && test -z "${cf_tst_cflags}" \
16963                 && cf_fix_cppflags=no
16964         ;;
16965 esac
16966 done
16967
16968 if test -n "$cf_new_cflags" ; then
16969
16970         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16971         CFLAGS="${CFLAGS}$cf_new_cflags"
16972
16973 fi
16974
16975 if test -n "$cf_new_cppflags" ; then
16976
16977         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16978         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16979
16980 fi
16981
16982 if test -n "$cf_new_extra_cppflags" ; then
16983
16984         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16985         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16986
16987 fi
16988
16989 cf_add_libs="$LIBS"
16990 # reverse order
16991 cf_add_0lib=
16992 for cf_add_1lib in `$PKG_CONFIG --libs $FORM_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16993 # filter duplicates
16994 for cf_add_1lib in $cf_add_0lib; do
16995         for cf_add_2lib in $cf_add_libs; do
16996                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16997                         cf_add_1lib=
16998                         break
16999                 fi
17000         done
17001         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17002 done
17003 LIBS="$cf_add_libs"
17004
17005                 cat >conftest.$ac_ext <<_ACEOF
17006 #line 17006 "configure"
17007 #include "confdefs.h"
17008 #include <$FORM_NAME.h>
17009 int
17010 main (void)
17011 {
17012 (void) form_driver ( 0,0 );
17013   ;
17014   return 0;
17015 }
17016 _ACEOF
17017 rm -f conftest.$ac_objext conftest$ac_exeext
17018 if { (eval echo "$as_me:17018: \"$ac_link\"") >&5
17019   (eval $ac_link) 2>&5
17020   ac_status=$?
17021   echo "$as_me:17021: \$? = $ac_status" >&5
17022   (exit $ac_status); } &&
17023          { ac_try='test -s conftest$ac_exeext'
17024   { (eval echo "$as_me:17024: \"$ac_try\"") >&5
17025   (eval $ac_try) 2>&5
17026   ac_status=$?
17027   echo "$as_me:17027: \$? = $ac_status" >&5
17028   (exit $ac_status); }; }; then
17029   if test "$cross_compiling" = yes; then
17030   cf_have_curses_lib=maybe
17031 else
17032   cat >conftest.$ac_ext <<_ACEOF
17033 #line 17033 "configure"
17034 #include "confdefs.h"
17035 #include <$FORM_NAME.h>
17036                                 int main(void)
17037                                 { (void) form_driver ( 0,0 ); return 0; }
17038 _ACEOF
17039 rm -f conftest$ac_exeext
17040 if { (eval echo "$as_me:17040: \"$ac_link\"") >&5
17041   (eval $ac_link) 2>&5
17042   ac_status=$?
17043   echo "$as_me:17043: \$? = $ac_status" >&5
17044   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17045   { (eval echo "$as_me:17045: \"$ac_try\"") >&5
17046   (eval $ac_try) 2>&5
17047   ac_status=$?
17048   echo "$as_me:17048: \$? = $ac_status" >&5
17049   (exit $ac_status); }; }; then
17050   cf_have_curses_lib=yes
17051 else
17052   echo "$as_me: program exited with status $ac_status" >&5
17053 echo "$as_me: failed program was:" >&5
17054 cat conftest.$ac_ext >&5
17055 cf_have_curses_lib=no
17056 fi
17057 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17058 fi
17059 else
17060   echo "$as_me: failed program was:" >&5
17061 cat conftest.$ac_ext >&5
17062 cf_have_curses_lib=no
17063 fi
17064 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17065                 echo "$as_me:17065: result: $cf_have_curses_lib" >&5
17066 echo "${ECHO_T}$cf_have_curses_lib" >&6
17067                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17068                 if test "$cf_have_curses_lib" != "yes"
17069                 then
17070                         CPPFLAGS="$cf_save_CPPFLAGS"
17071                         LIBS="$cf_save_LIBS"
17072                 else
17073
17074 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17075
17076                         cat >>confdefs.h <<EOF
17077 #define $cf_upper 1
17078 EOF
17079
17080                 fi
17081         fi
17082 fi
17083 if test "$cf_have_curses_lib" = no; then
17084         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17085 echo "$as_me:17085: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17086 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17087 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17088   echo $ECHO_N "(cached) $ECHO_C" >&6
17089 else
17090   ac_check_lib_save_LIBS=$LIBS
17091 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17092 cat >conftest.$ac_ext <<_ACEOF
17093 #line 17093 "configure"
17094 #include "confdefs.h"
17095
17096 /* Override any gcc2 internal prototype to avoid an error.  */
17097 #ifdef __cplusplus
17098 extern "C"
17099 #endif
17100 /* We use char because int might match the return type of a gcc2
17101    builtin and then its argument prototype would still apply.  */
17102 char form_driver ();
17103 int
17104 main (void)
17105 {
17106 form_driver ();
17107   ;
17108   return 0;
17109 }
17110 _ACEOF
17111 rm -f conftest.$ac_objext conftest$ac_exeext
17112 if { (eval echo "$as_me:17112: \"$ac_link\"") >&5
17113   (eval $ac_link) 2>&5
17114   ac_status=$?
17115   echo "$as_me:17115: \$? = $ac_status" >&5
17116   (exit $ac_status); } &&
17117          { ac_try='test -s conftest$ac_exeext'
17118   { (eval echo "$as_me:17118: \"$ac_try\"") >&5
17119   (eval $ac_try) 2>&5
17120   ac_status=$?
17121   echo "$as_me:17121: \$? = $ac_status" >&5
17122   (exit $ac_status); }; }; then
17123   eval "$as_ac_Lib=yes"
17124 else
17125   echo "$as_me: failed program was:" >&5
17126 cat conftest.$ac_ext >&5
17127 eval "$as_ac_Lib=no"
17128 fi
17129 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17130 LIBS=$ac_check_lib_save_LIBS
17131 fi
17132 echo "$as_me:17132: result: `eval echo '${'$as_ac_Lib'}'`" >&5
17133 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
17134 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
17135
17136 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17137
17138 cf_add_libs="$LIBS"
17139 # reverse order
17140 cf_add_0lib=
17141 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17142 # filter duplicates
17143 for cf_add_1lib in $cf_add_0lib; do
17144         for cf_add_2lib in $cf_add_libs; do
17145                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17146                         cf_add_1lib=
17147                         break
17148                 fi
17149         done
17150         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17151 done
17152 LIBS="$cf_add_libs"
17153
17154                 cat >>confdefs.h <<EOF
17155 #define $cf_upper 1
17156 EOF
17157
17158 fi
17159
17160 fi
17161
17162         cf_curses_headers="$cf_curses_headers form.h"
17163 fi
17164
17165 # look for curses-related headers
17166
17167 for ac_header in $cf_curses_headers
17168 do
17169 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17170 echo "$as_me:17170: checking for $ac_header" >&5
17171 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17172 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17173   echo $ECHO_N "(cached) $ECHO_C" >&6
17174 else
17175   cat >conftest.$ac_ext <<_ACEOF
17176 #line 17176 "configure"
17177 #include "confdefs.h"
17178 #include <$ac_header>
17179 _ACEOF
17180 if { (eval echo "$as_me:17180: \"$ac_cpp conftest.$ac_ext\"") >&5
17181   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17182   ac_status=$?
17183   egrep -v '^ *\+' conftest.er1 >conftest.err
17184   rm -f conftest.er1
17185   cat conftest.err >&5
17186   echo "$as_me:17186: \$? = $ac_status" >&5
17187   (exit $ac_status); } >/dev/null; then
17188   if test -s conftest.err; then
17189     ac_cpp_err=$ac_c_preproc_warn_flag
17190   else
17191     ac_cpp_err=
17192   fi
17193 else
17194   ac_cpp_err=yes
17195 fi
17196 if test -z "$ac_cpp_err"; then
17197   eval "$as_ac_Header=yes"
17198 else
17199   echo "$as_me: failed program was:" >&5
17200   cat conftest.$ac_ext >&5
17201   eval "$as_ac_Header=no"
17202 fi
17203 rm -f conftest.err conftest.$ac_ext
17204 fi
17205 echo "$as_me:17205: result: `eval echo '${'$as_ac_Header'}'`" >&5
17206 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17207 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17208   cat >>confdefs.h <<EOF
17209 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17210 EOF
17211
17212 fi
17213 done
17214
17215 echo "$as_me:17215: checking for ANSI C header files" >&5
17216 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17217 if test "${ac_cv_header_stdc+set}" = set; then
17218   echo $ECHO_N "(cached) $ECHO_C" >&6
17219 else
17220   cat >conftest.$ac_ext <<_ACEOF
17221 #line 17221 "configure"
17222 #include "confdefs.h"
17223 #include <stdlib.h>
17224 #include <stdarg.h>
17225 #include <string.h>
17226 #include <float.h>
17227
17228 _ACEOF
17229 if { (eval echo "$as_me:17229: \"$ac_cpp conftest.$ac_ext\"") >&5
17230   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17231   ac_status=$?
17232   egrep -v '^ *\+' conftest.er1 >conftest.err
17233   rm -f conftest.er1
17234   cat conftest.err >&5
17235   echo "$as_me:17235: \$? = $ac_status" >&5
17236   (exit $ac_status); } >/dev/null; then
17237   if test -s conftest.err; then
17238     ac_cpp_err=$ac_c_preproc_warn_flag
17239   else
17240     ac_cpp_err=
17241   fi
17242 else
17243   ac_cpp_err=yes
17244 fi
17245 if test -z "$ac_cpp_err"; then
17246   ac_cv_header_stdc=yes
17247 else
17248   echo "$as_me: failed program was:" >&5
17249   cat conftest.$ac_ext >&5
17250   ac_cv_header_stdc=no
17251 fi
17252 rm -f conftest.err conftest.$ac_ext
17253
17254 if test $ac_cv_header_stdc = yes; then
17255   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17256   cat >conftest.$ac_ext <<_ACEOF
17257 #line 17257 "configure"
17258 #include "confdefs.h"
17259 #include <string.h>
17260
17261 _ACEOF
17262 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17263   egrep "memchr" >/dev/null 2>&1; then
17264   :
17265 else
17266   ac_cv_header_stdc=no
17267 fi
17268 rm -rf conftest*
17269
17270 fi
17271
17272 if test $ac_cv_header_stdc = yes; then
17273   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17274   cat >conftest.$ac_ext <<_ACEOF
17275 #line 17275 "configure"
17276 #include "confdefs.h"
17277 #include <stdlib.h>
17278
17279 _ACEOF
17280 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17281   egrep "free" >/dev/null 2>&1; then
17282   :
17283 else
17284   ac_cv_header_stdc=no
17285 fi
17286 rm -rf conftest*
17287
17288 fi
17289
17290 if test $ac_cv_header_stdc = yes; then
17291   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17292   if test "$cross_compiling" = yes; then
17293   :
17294 else
17295   cat >conftest.$ac_ext <<_ACEOF
17296 #line 17296 "configure"
17297 #include "confdefs.h"
17298 #include <ctype.h>
17299 #if ((' ' & 0x0FF) == 0x020)
17300 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17301 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17302 #else
17303 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17304                      || ('j' <= (c) && (c) <= 'r') \
17305                      || ('s' <= (c) && (c) <= 'z'))
17306 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17307 #endif
17308
17309 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17310 int
17311 main (void)
17312 {
17313   int i;
17314   for (i = 0; i < 256; i++)
17315     if (XOR (islower (i), ISLOWER (i))
17316         || toupper (i) != TOUPPER (i))
17317       $ac_main_return(2);
17318   $ac_main_return (0);
17319 }
17320 _ACEOF
17321 rm -f conftest$ac_exeext
17322 if { (eval echo "$as_me:17322: \"$ac_link\"") >&5
17323   (eval $ac_link) 2>&5
17324   ac_status=$?
17325   echo "$as_me:17325: \$? = $ac_status" >&5
17326   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17327   { (eval echo "$as_me:17327: \"$ac_try\"") >&5
17328   (eval $ac_try) 2>&5
17329   ac_status=$?
17330   echo "$as_me:17330: \$? = $ac_status" >&5
17331   (exit $ac_status); }; }; then
17332   :
17333 else
17334   echo "$as_me: program exited with status $ac_status" >&5
17335 echo "$as_me: failed program was:" >&5
17336 cat conftest.$ac_ext >&5
17337 ac_cv_header_stdc=no
17338 fi
17339 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17340 fi
17341 fi
17342 fi
17343 echo "$as_me:17343: result: $ac_cv_header_stdc" >&5
17344 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17345 if test $ac_cv_header_stdc = yes; then
17346
17347 cat >>confdefs.h <<\EOF
17348 #define STDC_HEADERS 1
17349 EOF
17350
17351 fi
17352
17353 echo "$as_me:17353: checking whether time.h and sys/time.h may both be included" >&5
17354 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17355 if test "${ac_cv_header_time+set}" = set; then
17356   echo $ECHO_N "(cached) $ECHO_C" >&6
17357 else
17358   cat >conftest.$ac_ext <<_ACEOF
17359 #line 17359 "configure"
17360 #include "confdefs.h"
17361 #include <sys/types.h>
17362 #include <sys/time.h>
17363 #include <time.h>
17364
17365 int
17366 main (void)
17367 {
17368 if ((struct tm *) 0)
17369 return 0;
17370   ;
17371   return 0;
17372 }
17373 _ACEOF
17374 rm -f conftest.$ac_objext
17375 if { (eval echo "$as_me:17375: \"$ac_compile\"") >&5
17376   (eval $ac_compile) 2>&5
17377   ac_status=$?
17378   echo "$as_me:17378: \$? = $ac_status" >&5
17379   (exit $ac_status); } &&
17380          { ac_try='test -s conftest.$ac_objext'
17381   { (eval echo "$as_me:17381: \"$ac_try\"") >&5
17382   (eval $ac_try) 2>&5
17383   ac_status=$?
17384   echo "$as_me:17384: \$? = $ac_status" >&5
17385   (exit $ac_status); }; }; then
17386   ac_cv_header_time=yes
17387 else
17388   echo "$as_me: failed program was:" >&5
17389 cat conftest.$ac_ext >&5
17390 ac_cv_header_time=no
17391 fi
17392 rm -f conftest.$ac_objext conftest.$ac_ext
17393 fi
17394 echo "$as_me:17394: result: $ac_cv_header_time" >&5
17395 echo "${ECHO_T}$ac_cv_header_time" >&6
17396 if test $ac_cv_header_time = yes; then
17397
17398 cat >>confdefs.h <<\EOF
17399 #define TIME_WITH_SYS_TIME 1
17400 EOF
17401
17402 fi
17403
17404 for ac_header in \
17405 getopt.h \
17406 locale.h \
17407 math.h \
17408 stdarg.h \
17409 stdint.h \
17410 sys/ioctl.h \
17411 sys/select.h \
17412 sys/time.h \
17413 termios.h \
17414 unistd.h \
17415
17416 do
17417 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17418 echo "$as_me:17418: checking for $ac_header" >&5
17419 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17420 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17421   echo $ECHO_N "(cached) $ECHO_C" >&6
17422 else
17423   cat >conftest.$ac_ext <<_ACEOF
17424 #line 17424 "configure"
17425 #include "confdefs.h"
17426 #include <$ac_header>
17427 _ACEOF
17428 if { (eval echo "$as_me:17428: \"$ac_cpp conftest.$ac_ext\"") >&5
17429   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17430   ac_status=$?
17431   egrep -v '^ *\+' conftest.er1 >conftest.err
17432   rm -f conftest.er1
17433   cat conftest.err >&5
17434   echo "$as_me:17434: \$? = $ac_status" >&5
17435   (exit $ac_status); } >/dev/null; then
17436   if test -s conftest.err; then
17437     ac_cpp_err=$ac_c_preproc_warn_flag
17438   else
17439     ac_cpp_err=
17440   fi
17441 else
17442   ac_cpp_err=yes
17443 fi
17444 if test -z "$ac_cpp_err"; then
17445   eval "$as_ac_Header=yes"
17446 else
17447   echo "$as_me: failed program was:" >&5
17448   cat conftest.$ac_ext >&5
17449   eval "$as_ac_Header=no"
17450 fi
17451 rm -f conftest.err conftest.$ac_ext
17452 fi
17453 echo "$as_me:17453: result: `eval echo '${'$as_ac_Header'}'`" >&5
17454 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17455 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17456   cat >>confdefs.h <<EOF
17457 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17458 EOF
17459
17460 fi
17461 done
17462
17463 for ac_header in unistd.h getopt.h
17464 do
17465 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17466 echo "$as_me:17466: checking for $ac_header" >&5
17467 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17468 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17469   echo $ECHO_N "(cached) $ECHO_C" >&6
17470 else
17471   cat >conftest.$ac_ext <<_ACEOF
17472 #line 17472 "configure"
17473 #include "confdefs.h"
17474 #include <$ac_header>
17475 _ACEOF
17476 if { (eval echo "$as_me:17476: \"$ac_cpp conftest.$ac_ext\"") >&5
17477   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17478   ac_status=$?
17479   egrep -v '^ *\+' conftest.er1 >conftest.err
17480   rm -f conftest.er1
17481   cat conftest.err >&5
17482   echo "$as_me:17482: \$? = $ac_status" >&5
17483   (exit $ac_status); } >/dev/null; then
17484   if test -s conftest.err; then
17485     ac_cpp_err=$ac_c_preproc_warn_flag
17486   else
17487     ac_cpp_err=
17488   fi
17489 else
17490   ac_cpp_err=yes
17491 fi
17492 if test -z "$ac_cpp_err"; then
17493   eval "$as_ac_Header=yes"
17494 else
17495   echo "$as_me: failed program was:" >&5
17496   cat conftest.$ac_ext >&5
17497   eval "$as_ac_Header=no"
17498 fi
17499 rm -f conftest.err conftest.$ac_ext
17500 fi
17501 echo "$as_me:17501: result: `eval echo '${'$as_ac_Header'}'`" >&5
17502 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17503 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17504   cat >>confdefs.h <<EOF
17505 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17506 EOF
17507
17508 fi
17509 done
17510
17511 echo "$as_me:17511: checking for header declaring getopt variables" >&5
17512 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17513 if test "${cf_cv_getopt_header+set}" = set; then
17514   echo $ECHO_N "(cached) $ECHO_C" >&6
17515 else
17516
17517 cf_cv_getopt_header=none
17518 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17519 do
17520 cat >conftest.$ac_ext <<_ACEOF
17521 #line 17521 "configure"
17522 #include "confdefs.h"
17523
17524 #include <$cf_header>
17525 int
17526 main (void)
17527 {
17528 int x = optind; char *y = optarg
17529   ;
17530   return 0;
17531 }
17532 _ACEOF
17533 rm -f conftest.$ac_objext
17534 if { (eval echo "$as_me:17534: \"$ac_compile\"") >&5
17535   (eval $ac_compile) 2>&5
17536   ac_status=$?
17537   echo "$as_me:17537: \$? = $ac_status" >&5
17538   (exit $ac_status); } &&
17539          { ac_try='test -s conftest.$ac_objext'
17540   { (eval echo "$as_me:17540: \"$ac_try\"") >&5
17541   (eval $ac_try) 2>&5
17542   ac_status=$?
17543   echo "$as_me:17543: \$? = $ac_status" >&5
17544   (exit $ac_status); }; }; then
17545   cf_cv_getopt_header=$cf_header
17546  break
17547 else
17548   echo "$as_me: failed program was:" >&5
17549 cat conftest.$ac_ext >&5
17550 fi
17551 rm -f conftest.$ac_objext conftest.$ac_ext
17552 done
17553
17554 fi
17555 echo "$as_me:17555: result: $cf_cv_getopt_header" >&5
17556 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17557 if test $cf_cv_getopt_header != none ; then
17558
17559 cat >>confdefs.h <<\EOF
17560 #define HAVE_GETOPT_HEADER 1
17561 EOF
17562
17563 fi
17564 if test $cf_cv_getopt_header = getopt.h ; then
17565
17566 cat >>confdefs.h <<\EOF
17567 #define NEED_GETOPT_H 1
17568 EOF
17569
17570 fi
17571
17572 for ac_func in \
17573 getopt \
17574 gettimeofday \
17575 strstr \
17576 tsearch \
17577
17578 do
17579 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17580 echo "$as_me:17580: checking for $ac_func" >&5
17581 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17582 if eval "test \"\${$as_ac_var+set}\" = set"; then
17583   echo $ECHO_N "(cached) $ECHO_C" >&6
17584 else
17585   cat >conftest.$ac_ext <<_ACEOF
17586 #line 17586 "configure"
17587 #include "confdefs.h"
17588 #define $ac_func autoconf_temporary
17589 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17590 #undef $ac_func
17591
17592 #ifdef __cplusplus
17593 extern "C"
17594 #endif
17595
17596 /* We use char because int might match the return type of a gcc2
17597    builtin and then its argument prototype would still apply.  */
17598 char $ac_func (void);
17599
17600 int
17601 main (void)
17602 {
17603
17604 /* The GNU C library defines stubs for functions which it implements
17605     to always fail with ENOSYS.  Some functions are actually named
17606     something starting with __ and the normal name is an alias.  */
17607 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17608 #error found stub for $ac_func
17609 #endif
17610
17611         return $ac_func ();
17612   ;
17613   return 0;
17614 }
17615 _ACEOF
17616 rm -f conftest.$ac_objext conftest$ac_exeext
17617 if { (eval echo "$as_me:17617: \"$ac_link\"") >&5
17618   (eval $ac_link) 2>&5
17619   ac_status=$?
17620   echo "$as_me:17620: \$? = $ac_status" >&5
17621   (exit $ac_status); } &&
17622          { ac_try='test -s conftest$ac_exeext'
17623   { (eval echo "$as_me:17623: \"$ac_try\"") >&5
17624   (eval $ac_try) 2>&5
17625   ac_status=$?
17626   echo "$as_me:17626: \$? = $ac_status" >&5
17627   (exit $ac_status); }; }; then
17628   eval "$as_ac_var=yes"
17629 else
17630   echo "$as_me: failed program was:" >&5
17631 cat conftest.$ac_ext >&5
17632 eval "$as_ac_var=no"
17633 fi
17634 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17635 fi
17636 echo "$as_me:17636: result: `eval echo '${'$as_ac_var'}'`" >&5
17637 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17638 if test `eval echo '${'$as_ac_var'}'` = yes; then
17639   cat >>confdefs.h <<EOF
17640 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17641 EOF
17642
17643 fi
17644 done
17645
17646 # use a compile-check to work with ncurses*-config and subdirectory includes
17647 echo "$as_me:17647: checking if we can use termcap.h" >&5
17648 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17649 if test "${cf_cv_have_termcap_h+set}" = set; then
17650   echo $ECHO_N "(cached) $ECHO_C" >&6
17651 else
17652
17653         cat >conftest.$ac_ext <<_ACEOF
17654 #line 17654 "configure"
17655 #include "confdefs.h"
17656
17657 #include <curses.h>
17658 #ifdef NCURSES_VERSION
17659 #undef NCURSES_VERSION
17660 #endif
17661 #include <termcap.h>
17662 #ifndef NCURSES_VERSION
17663 #error wrong header
17664 #endif
17665
17666 int
17667 main (void)
17668 {
17669 return 0;
17670   ;
17671   return 0;
17672 }
17673 _ACEOF
17674 rm -f conftest.$ac_objext
17675 if { (eval echo "$as_me:17675: \"$ac_compile\"") >&5
17676   (eval $ac_compile) 2>&5
17677   ac_status=$?
17678   echo "$as_me:17678: \$? = $ac_status" >&5
17679   (exit $ac_status); } &&
17680          { ac_try='test -s conftest.$ac_objext'
17681   { (eval echo "$as_me:17681: \"$ac_try\"") >&5
17682   (eval $ac_try) 2>&5
17683   ac_status=$?
17684   echo "$as_me:17684: \$? = $ac_status" >&5
17685   (exit $ac_status); }; }; then
17686   cf_cv_have_termcap_h=yes
17687 else
17688   echo "$as_me: failed program was:" >&5
17689 cat conftest.$ac_ext >&5
17690 cf_cv_have_termcap_h=no
17691 fi
17692 rm -f conftest.$ac_objext conftest.$ac_ext
17693 fi
17694 echo "$as_me:17694: result: $cf_cv_have_termcap_h" >&5
17695 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17696 if test "x$cf_cv_have_termcap_h" = xyes
17697 then
17698
17699 cat >>confdefs.h <<\EOF
17700 #define HAVE_TERMCAP_H 1
17701 EOF
17702
17703 else
17704 echo "$as_me:17704: checking if we can use ncurses/termcap.h" >&5
17705 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17706 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17707   echo $ECHO_N "(cached) $ECHO_C" >&6
17708 else
17709
17710         cat >conftest.$ac_ext <<_ACEOF
17711 #line 17711 "configure"
17712 #include "confdefs.h"
17713
17714 #include <ncurses/curses.h>
17715 #ifdef NCURSES_VERSION
17716 #undef NCURSES_VERSION
17717 #endif
17718 #include <ncurses/termcap.h>
17719 #ifndef NCURSES_VERSION
17720 #error wrong header
17721 #endif
17722
17723 int
17724 main (void)
17725 {
17726 return 0;
17727   ;
17728   return 0;
17729 }
17730 _ACEOF
17731 rm -f conftest.$ac_objext
17732 if { (eval echo "$as_me:17732: \"$ac_compile\"") >&5
17733   (eval $ac_compile) 2>&5
17734   ac_status=$?
17735   echo "$as_me:17735: \$? = $ac_status" >&5
17736   (exit $ac_status); } &&
17737          { ac_try='test -s conftest.$ac_objext'
17738   { (eval echo "$as_me:17738: \"$ac_try\"") >&5
17739   (eval $ac_try) 2>&5
17740   ac_status=$?
17741   echo "$as_me:17741: \$? = $ac_status" >&5
17742   (exit $ac_status); }; }; then
17743   cf_cv_have_ncurses_termcap_h=yes
17744 else
17745   echo "$as_me: failed program was:" >&5
17746 cat conftest.$ac_ext >&5
17747 cf_cv_have_ncurses_termcap_h=no
17748 fi
17749 rm -f conftest.$ac_objext conftest.$ac_ext
17750 fi
17751 echo "$as_me:17751: result: $cf_cv_have_ncurses_termcap_h" >&5
17752 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17753 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
17754 cat >>confdefs.h <<\EOF
17755 #define HAVE_NCURSES_TERMCAP_H 1
17756 EOF
17757
17758 fi
17759
17760 if test "x$ac_cv_func_getopt" = xno; then
17761         { { echo "$as_me:17761: error: getopt is required for building programs" >&5
17762 echo "$as_me: error: getopt is required for building programs" >&2;}
17763    { (exit 1); exit 1; }; }
17764 fi
17765
17766 if test "$cf_enable_widec" = yes; then
17767
17768 for ac_func in \
17769 mblen \
17770 mbrlen \
17771 mbrtowc \
17772 mbsrtowcs \
17773 mbstowcs \
17774 mbtowc \
17775 wcsrtombs \
17776 wcstombs \
17777
17778 do
17779 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17780 echo "$as_me:17780: checking for $ac_func" >&5
17781 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17782 if eval "test \"\${$as_ac_var+set}\" = set"; then
17783   echo $ECHO_N "(cached) $ECHO_C" >&6
17784 else
17785   cat >conftest.$ac_ext <<_ACEOF
17786 #line 17786 "configure"
17787 #include "confdefs.h"
17788 #define $ac_func autoconf_temporary
17789 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17790 #undef $ac_func
17791
17792 #ifdef __cplusplus
17793 extern "C"
17794 #endif
17795
17796 /* We use char because int might match the return type of a gcc2
17797    builtin and then its argument prototype would still apply.  */
17798 char $ac_func (void);
17799
17800 int
17801 main (void)
17802 {
17803
17804 /* The GNU C library defines stubs for functions which it implements
17805     to always fail with ENOSYS.  Some functions are actually named
17806     something starting with __ and the normal name is an alias.  */
17807 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17808 #error found stub for $ac_func
17809 #endif
17810
17811         return $ac_func ();
17812   ;
17813   return 0;
17814 }
17815 _ACEOF
17816 rm -f conftest.$ac_objext conftest$ac_exeext
17817 if { (eval echo "$as_me:17817: \"$ac_link\"") >&5
17818   (eval $ac_link) 2>&5
17819   ac_status=$?
17820   echo "$as_me:17820: \$? = $ac_status" >&5
17821   (exit $ac_status); } &&
17822          { ac_try='test -s conftest$ac_exeext'
17823   { (eval echo "$as_me:17823: \"$ac_try\"") >&5
17824   (eval $ac_try) 2>&5
17825   ac_status=$?
17826   echo "$as_me:17826: \$? = $ac_status" >&5
17827   (exit $ac_status); }; }; then
17828   eval "$as_ac_var=yes"
17829 else
17830   echo "$as_me: failed program was:" >&5
17831 cat conftest.$ac_ext >&5
17832 eval "$as_ac_var=no"
17833 fi
17834 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17835 fi
17836 echo "$as_me:17836: result: `eval echo '${'$as_ac_var'}'`" >&5
17837 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17838 if test `eval echo '${'$as_ac_var'}'` = yes; then
17839   cat >>confdefs.h <<EOF
17840 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17841 EOF
17842
17843 fi
17844 done
17845
17846 fi
17847
17848 echo "$as_me:17848: checking definition to turn on extended curses functions" >&5
17849 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17850 if test "${cf_cv_need_xopen_extension+set}" = set; then
17851   echo $ECHO_N "(cached) $ECHO_C" >&6
17852 else
17853
17854 cf_cv_need_xopen_extension=unknown
17855 cat >conftest.$ac_ext <<_ACEOF
17856 #line 17856 "configure"
17857 #include "confdefs.h"
17858
17859 #include <stdlib.h>
17860 #include <${cf_cv_ncurses_header:-curses.h}>
17861 int
17862 main (void)
17863 {
17864
17865 #if defined(NCURSES_VERSION_PATCH)
17866 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17867         make an error
17868 #endif
17869 #endif
17870 #ifdef NCURSES_VERSION
17871         cchar_t check;
17872         int check2 = curs_set((int)sizeof(check));
17873 #endif
17874         long x = winnstr(stdscr, "", 0);
17875         int x1, y1;
17876         getbegyx(stdscr, y1, x1)
17877   ;
17878   return 0;
17879 }
17880 _ACEOF
17881 rm -f conftest.$ac_objext conftest$ac_exeext
17882 if { (eval echo "$as_me:17882: \"$ac_link\"") >&5
17883   (eval $ac_link) 2>&5
17884   ac_status=$?
17885   echo "$as_me:17885: \$? = $ac_status" >&5
17886   (exit $ac_status); } &&
17887          { ac_try='test -s conftest$ac_exeext'
17888   { (eval echo "$as_me:17888: \"$ac_try\"") >&5
17889   (eval $ac_try) 2>&5
17890   ac_status=$?
17891   echo "$as_me:17891: \$? = $ac_status" >&5
17892   (exit $ac_status); }; }; then
17893   cf_cv_need_xopen_extension=none
17894 else
17895   echo "$as_me: failed program was:" >&5
17896 cat conftest.$ac_ext >&5
17897
17898         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17899         do
17900                 cat >conftest.$ac_ext <<_ACEOF
17901 #line 17901 "configure"
17902 #include "confdefs.h"
17903
17904 #define $cf_try_xopen_extension 1
17905 #include <stdlib.h>
17906 #include <${cf_cv_ncurses_header:-curses.h}>
17907 int
17908 main (void)
17909 {
17910
17911 #ifdef NCURSES_VERSION
17912                 cchar_t check;
17913                 int check2 = curs_set((int)sizeof(check));
17914 #endif
17915                 long x = winnstr(stdscr, "", 0);
17916                 int x1, y1;
17917                 getbegyx(stdscr, y1, x1)
17918   ;
17919   return 0;
17920 }
17921 _ACEOF
17922 rm -f conftest.$ac_objext conftest$ac_exeext
17923 if { (eval echo "$as_me:17923: \"$ac_link\"") >&5
17924   (eval $ac_link) 2>&5
17925   ac_status=$?
17926   echo "$as_me:17926: \$? = $ac_status" >&5
17927   (exit $ac_status); } &&
17928          { ac_try='test -s conftest$ac_exeext'
17929   { (eval echo "$as_me:17929: \"$ac_try\"") >&5
17930   (eval $ac_try) 2>&5
17931   ac_status=$?
17932   echo "$as_me:17932: \$? = $ac_status" >&5
17933   (exit $ac_status); }; }; then
17934   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17935 else
17936   echo "$as_me: failed program was:" >&5
17937 cat conftest.$ac_ext >&5
17938 fi
17939 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17940         done
17941
17942 fi
17943 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17944
17945 fi
17946 echo "$as_me:17946: result: $cf_cv_need_xopen_extension" >&5
17947 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17948
17949 case $cf_cv_need_xopen_extension in
17950 (*_*)
17951
17952         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17953         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17954
17955         ;;
17956 esac
17957
17958 echo "$as_me:17958: checking for term.h" >&5
17959 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17960 if test "${cf_cv_term_header+set}" = set; then
17961   echo $ECHO_N "(cached) $ECHO_C" >&6
17962 else
17963
17964 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17965 # for <term.h> if we do not find the variant.
17966
17967 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17968
17969 case ${cf_cv_ncurses_header:-curses.h} in
17970 (*/*)
17971         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17972         cf_header_list="$cf_header_item $cf_header_list"
17973         ;;
17974 esac
17975
17976 for cf_header in $cf_header_list
17977 do
17978         cat >conftest.$ac_ext <<_ACEOF
17979 #line 17979 "configure"
17980 #include "confdefs.h"
17981
17982 #include <${cf_cv_ncurses_header:-curses.h}>
17983 #include <${cf_header}>
17984 int
17985 main (void)
17986 {
17987 WINDOW *x
17988   ;
17989   return 0;
17990 }
17991 _ACEOF
17992 rm -f conftest.$ac_objext
17993 if { (eval echo "$as_me:17993: \"$ac_compile\"") >&5
17994   (eval $ac_compile) 2>&5
17995   ac_status=$?
17996   echo "$as_me:17996: \$? = $ac_status" >&5
17997   (exit $ac_status); } &&
17998          { ac_try='test -s conftest.$ac_objext'
17999   { (eval echo "$as_me:17999: \"$ac_try\"") >&5
18000   (eval $ac_try) 2>&5
18001   ac_status=$?
18002   echo "$as_me:18002: \$? = $ac_status" >&5
18003   (exit $ac_status); }; }; then
18004   cf_cv_term_header=$cf_header
18005          break
18006 else
18007   echo "$as_me: failed program was:" >&5
18008 cat conftest.$ac_ext >&5
18009 cf_cv_term_header=no
18010 fi
18011 rm -f conftest.$ac_objext conftest.$ac_ext
18012 done
18013
18014 case $cf_cv_term_header in
18015 (no)
18016         # If curses is ncurses, some packagers still mess it up by trying to make
18017         # us use GNU termcap.  This handles the most common case.
18018         for cf_header in ncurses/term.h ncursesw/term.h
18019         do
18020                 cat >conftest.$ac_ext <<_ACEOF
18021 #line 18021 "configure"
18022 #include "confdefs.h"
18023
18024 #include <${cf_cv_ncurses_header:-curses.h}>
18025 #ifdef NCURSES_VERSION
18026 #include <${cf_header}>
18027 #else
18028 make an error
18029 #endif
18030 int
18031 main (void)
18032 {
18033 WINDOW *x
18034   ;
18035   return 0;
18036 }
18037 _ACEOF
18038 rm -f conftest.$ac_objext
18039 if { (eval echo "$as_me:18039: \"$ac_compile\"") >&5
18040   (eval $ac_compile) 2>&5
18041   ac_status=$?
18042   echo "$as_me:18042: \$? = $ac_status" >&5
18043   (exit $ac_status); } &&
18044          { ac_try='test -s conftest.$ac_objext'
18045   { (eval echo "$as_me:18045: \"$ac_try\"") >&5
18046   (eval $ac_try) 2>&5
18047   ac_status=$?
18048   echo "$as_me:18048: \$? = $ac_status" >&5
18049   (exit $ac_status); }; }; then
18050   cf_cv_term_header=$cf_header
18051                          break
18052 else
18053   echo "$as_me: failed program was:" >&5
18054 cat conftest.$ac_ext >&5
18055 cf_cv_term_header=no
18056 fi
18057 rm -f conftest.$ac_objext conftest.$ac_ext
18058         done
18059         ;;
18060 esac
18061
18062 fi
18063 echo "$as_me:18063: result: $cf_cv_term_header" >&5
18064 echo "${ECHO_T}$cf_cv_term_header" >&6
18065
18066 case $cf_cv_term_header in
18067 (term.h)
18068
18069 cat >>confdefs.h <<\EOF
18070 #define HAVE_TERM_H 1
18071 EOF
18072
18073         ;;
18074 (ncurses/term.h)
18075
18076 cat >>confdefs.h <<\EOF
18077 #define HAVE_NCURSES_TERM_H 1
18078 EOF
18079
18080         ;;
18081 (ncursesw/term.h)
18082
18083 cat >>confdefs.h <<\EOF
18084 #define HAVE_NCURSESW_TERM_H 1
18085 EOF
18086
18087         ;;
18088 esac
18089
18090 echo "$as_me:18090: checking for unctrl.h" >&5
18091 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18092 if test "${cf_cv_unctrl_header+set}" = set; then
18093   echo $ECHO_N "(cached) $ECHO_C" >&6
18094 else
18095
18096 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18097 # for <unctrl.h> if we do not find the variant.
18098
18099 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18100
18101 case ${cf_cv_ncurses_header:-curses.h} in
18102 (*/*)
18103         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18104         cf_header_list="$cf_header_item $cf_header_list"
18105         ;;
18106 esac
18107
18108 for cf_header in $cf_header_list
18109 do
18110         cat >conftest.$ac_ext <<_ACEOF
18111 #line 18111 "configure"
18112 #include "confdefs.h"
18113
18114 #include <${cf_cv_ncurses_header:-curses.h}>
18115 #include <${cf_header}>
18116 int
18117 main (void)
18118 {
18119 WINDOW *x
18120   ;
18121   return 0;
18122 }
18123 _ACEOF
18124 rm -f conftest.$ac_objext
18125 if { (eval echo "$as_me:18125: \"$ac_compile\"") >&5
18126   (eval $ac_compile) 2>&5
18127   ac_status=$?
18128   echo "$as_me:18128: \$? = $ac_status" >&5
18129   (exit $ac_status); } &&
18130          { ac_try='test -s conftest.$ac_objext'
18131   { (eval echo "$as_me:18131: \"$ac_try\"") >&5
18132   (eval $ac_try) 2>&5
18133   ac_status=$?
18134   echo "$as_me:18134: \$? = $ac_status" >&5
18135   (exit $ac_status); }; }; then
18136   cf_cv_unctrl_header=$cf_header
18137          break
18138 else
18139   echo "$as_me: failed program was:" >&5
18140 cat conftest.$ac_ext >&5
18141 cf_cv_unctrl_header=no
18142 fi
18143 rm -f conftest.$ac_objext conftest.$ac_ext
18144 done
18145
18146 fi
18147 echo "$as_me:18147: result: $cf_cv_unctrl_header" >&5
18148 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18149
18150 case $cf_cv_unctrl_header in
18151 (no)
18152         { echo "$as_me:18152: WARNING: unctrl.h header not found" >&5
18153 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18154         ;;
18155 esac
18156
18157 case $cf_cv_unctrl_header in
18158 (unctrl.h)
18159
18160 cat >>confdefs.h <<\EOF
18161 #define HAVE_UNCTRL_H 1
18162 EOF
18163
18164         ;;
18165 (ncurses/unctrl.h)
18166
18167 cat >>confdefs.h <<\EOF
18168 #define HAVE_NCURSES_UNCTRL_H 1
18169 EOF
18170
18171         ;;
18172 (ncursesw/unctrl.h)
18173
18174 cat >>confdefs.h <<\EOF
18175 #define HAVE_NCURSESW_UNCTRL_H 1
18176 EOF
18177
18178         ;;
18179 esac
18180
18181 for cf_func in \
18182 alloc_pair \
18183 assume_default_colors \
18184 chgat \
18185 color_content \
18186 color_set \
18187 copywin \
18188 delscreen \
18189 dupwin \
18190 filter \
18191 getbegx \
18192 getcurx \
18193 getmaxx \
18194 getnstr \
18195 getparx \
18196 getwin \
18197 halfdelay \
18198 init_extended_color \
18199 mvderwin \
18200 mvvline \
18201 mvwin \
18202 mvwvline \
18203 napms \
18204 newpad \
18205 putwin \
18206 reset_color_pairs \
18207 resize_term \
18208 resizeterm \
18209 restartterm \
18210 ripoffline \
18211 scr_dump \
18212 setupterm \
18213 slk_color \
18214 slk_init \
18215 termattrs \
18216 tgetent \
18217 tigetnum \
18218 tigetstr \
18219 tputs_sp \
18220 typeahead \
18221 use_default_colors \
18222 use_env \
18223 use_extended_names \
18224 use_screen \
18225 use_window \
18226 vid_puts \
18227 vidputs \
18228 vsscanf \
18229 vw_printw \
18230 wchgat \
18231 winsdelln \
18232 winsstr \
18233 wresize \
18234 wsyncdown \
18235 _tracef \
18236
18237 do
18238
18239 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18240
18241         echo "$as_me:18241: checking for ${cf_func}" >&5
18242 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18243
18244 echo "${as_me:-configure}:18244: testing ${cf_func} ..." 1>&5
18245
18246         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18247   echo $ECHO_N "(cached) $ECHO_C" >&6
18248 else
18249
18250                 eval cf_result='$ac_cv_func_'$cf_func
18251                 if test ".$cf_result" != ".no"; then
18252                         cat >conftest.$ac_ext <<_ACEOF
18253 #line 18253 "configure"
18254 #include "confdefs.h"
18255
18256 #ifdef HAVE_XCURSES
18257 #include <xcurses.h>
18258 char * XCursesProgramName = "test";
18259 #else
18260 #include <${cf_cv_ncurses_header:-curses.h}>
18261 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18262 #include <ncursesw/term.h>
18263 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18264 #include <ncurses/term.h>
18265 #elif defined(HAVE_TERM_H)
18266 #include <term.h>
18267 #endif
18268 #endif
18269
18270 int
18271 main (void)
18272 {
18273
18274 #ifndef ${cf_func}
18275 long foo = (long)(&${cf_func});
18276 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18277 if (foo + 1234L > 5678L)
18278         ${cf_cv_main_return:-return}(foo != 0);
18279 #endif
18280
18281   ;
18282   return 0;
18283 }
18284 _ACEOF
18285 rm -f conftest.$ac_objext conftest$ac_exeext
18286 if { (eval echo "$as_me:18286: \"$ac_link\"") >&5
18287   (eval $ac_link) 2>&5
18288   ac_status=$?
18289   echo "$as_me:18289: \$? = $ac_status" >&5
18290   (exit $ac_status); } &&
18291          { ac_try='test -s conftest$ac_exeext'
18292   { (eval echo "$as_me:18292: \"$ac_try\"") >&5
18293   (eval $ac_try) 2>&5
18294   ac_status=$?
18295   echo "$as_me:18295: \$? = $ac_status" >&5
18296   (exit $ac_status); }; }; then
18297   cf_result=yes
18298 else
18299   echo "$as_me: failed program was:" >&5
18300 cat conftest.$ac_ext >&5
18301 cf_result=no
18302 fi
18303 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18304                 fi
18305                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18306
18307 fi
18308
18309         # use the computed/retrieved cache-value:
18310         eval 'cf_result=$cf_cv_func_'$cf_func
18311         echo "$as_me:18311: result: $cf_result" >&5
18312 echo "${ECHO_T}$cf_result" >&6
18313         if test $cf_result != no; then
18314                 cat >>confdefs.h <<EOF
18315 #define HAVE_${cf_tr_func} 1
18316 EOF
18317
18318         fi
18319 done
18320
18321 for cf_func in tputs
18322 do
18323
18324 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18325
18326         echo "$as_me:18326: checking for ${cf_func}" >&5
18327 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18328
18329 echo "${as_me:-configure}:18329: testing ${cf_func} ..." 1>&5
18330
18331         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18332   echo $ECHO_N "(cached) $ECHO_C" >&6
18333 else
18334
18335                 eval cf_result='$ac_cv_func_'$cf_func
18336                 if test ".$cf_result" != ".no"; then
18337                         cat >conftest.$ac_ext <<_ACEOF
18338 #line 18338 "configure"
18339 #include "confdefs.h"
18340
18341 #ifdef HAVE_XCURSES
18342 #include <xcurses.h>
18343 char * XCursesProgramName = "test";
18344 #else
18345 #include <${cf_cv_ncurses_header:-curses.h}>
18346 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18347 #include <ncursesw/term.h>
18348 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18349 #include <ncurses/term.h>
18350 #elif defined(HAVE_TERM_H)
18351 #include <term.h>
18352 #endif
18353 #endif
18354
18355 int
18356 main (void)
18357 {
18358
18359 #ifndef ${cf_func}
18360 long foo = (long)(&${cf_func});
18361 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18362 if (foo + 1234L > 5678L)
18363         ${cf_cv_main_return:-return}(foo != 0);
18364 #endif
18365
18366   ;
18367   return 0;
18368 }
18369 _ACEOF
18370 rm -f conftest.$ac_objext conftest$ac_exeext
18371 if { (eval echo "$as_me:18371: \"$ac_link\"") >&5
18372   (eval $ac_link) 2>&5
18373   ac_status=$?
18374   echo "$as_me:18374: \$? = $ac_status" >&5
18375   (exit $ac_status); } &&
18376          { ac_try='test -s conftest$ac_exeext'
18377   { (eval echo "$as_me:18377: \"$ac_try\"") >&5
18378   (eval $ac_try) 2>&5
18379   ac_status=$?
18380   echo "$as_me:18380: \$? = $ac_status" >&5
18381   (exit $ac_status); }; }; then
18382   cf_result=yes
18383 else
18384   echo "$as_me: failed program was:" >&5
18385 cat conftest.$ac_ext >&5
18386 cf_result=no
18387 fi
18388 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18389                 fi
18390                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18391
18392 fi
18393
18394         # use the computed/retrieved cache-value:
18395         eval 'cf_result=$cf_cv_func_'$cf_func
18396         echo "$as_me:18396: result: $cf_result" >&5
18397 echo "${ECHO_T}$cf_result" >&6
18398         if test $cf_result != no; then
18399                 cat >>confdefs.h <<EOF
18400 #define HAVE_${cf_tr_func} 1
18401 EOF
18402
18403         fi
18404 done
18405
18406 if test x$cf_cv_func_tputs = xyes
18407 then
18408         cf_done=no
18409         for cf_arg in int char
18410         do
18411                 for cf_ret in int void
18412                 do
18413                         if test $cf_ret = void
18414                         then
18415                                 cf_return="/* nothing */"
18416                         else
18417                                 cf_return="return value"
18418                         fi
18419                         cat >conftest.$ac_ext <<_ACEOF
18420 #line 18420 "configure"
18421 #include "confdefs.h"
18422
18423 #include <${cf_cv_ncurses_header:-curses.h}>
18424 #include <$cf_cv_term_header>
18425
18426 static $cf_ret outc($cf_arg value) { $cf_return; }
18427
18428 int
18429 main (void)
18430 {
18431
18432         tputs("hello", 0, outc);
18433         ${cf_cv_main_return:-return}(0);
18434
18435   ;
18436   return 0;
18437 }
18438 _ACEOF
18439 rm -f conftest.$ac_objext
18440 if { (eval echo "$as_me:18440: \"$ac_compile\"") >&5
18441   (eval $ac_compile) 2>&5
18442   ac_status=$?
18443   echo "$as_me:18443: \$? = $ac_status" >&5
18444   (exit $ac_status); } &&
18445          { ac_try='test -s conftest.$ac_objext'
18446   { (eval echo "$as_me:18446: \"$ac_try\"") >&5
18447   (eval $ac_try) 2>&5
18448   ac_status=$?
18449   echo "$as_me:18449: \$? = $ac_status" >&5
18450   (exit $ac_status); }; }; then
18451
18452                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18453
18454 echo "${as_me:-configure}:18454: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18455
18456                 cat >>confdefs.h <<EOF
18457 #define TPUTS_ARG               $cf_arg
18458 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18459 #define TPUTS_RETURN(value)     $cf_return
18460 EOF
18461                 cf_done=yes
18462                 break
18463
18464 else
18465   echo "$as_me: failed program was:" >&5
18466 cat conftest.$ac_ext >&5
18467 fi
18468 rm -f conftest.$ac_objext conftest.$ac_ext
18469                 done
18470                 test $cf_done = yes && break
18471         done
18472 fi
18473
18474 echo "$as_me:18474: checking for ncurses extended functions" >&5
18475 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18476 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18477   echo $ECHO_N "(cached) $ECHO_C" >&6
18478 else
18479
18480 cat >conftest.$ac_ext <<_ACEOF
18481 #line 18481 "configure"
18482 #include "confdefs.h"
18483
18484 #include <${cf_cv_ncurses_header:-curses.h}>
18485 int
18486 main (void)
18487 {
18488
18489 int x = NCURSES_EXT_FUNCS
18490
18491   ;
18492   return 0;
18493 }
18494 _ACEOF
18495 rm -f conftest.$ac_objext
18496 if { (eval echo "$as_me:18496: \"$ac_compile\"") >&5
18497   (eval $ac_compile) 2>&5
18498   ac_status=$?
18499   echo "$as_me:18499: \$? = $ac_status" >&5
18500   (exit $ac_status); } &&
18501          { ac_try='test -s conftest.$ac_objext'
18502   { (eval echo "$as_me:18502: \"$ac_try\"") >&5
18503   (eval $ac_try) 2>&5
18504   ac_status=$?
18505   echo "$as_me:18505: \$? = $ac_status" >&5
18506   (exit $ac_status); }; }; then
18507   cf_cv_ncurses_ext_funcs=defined
18508 else
18509   echo "$as_me: failed program was:" >&5
18510 cat conftest.$ac_ext >&5
18511
18512 cat >conftest.$ac_ext <<_ACEOF
18513 #line 18513 "configure"
18514 #include "confdefs.h"
18515
18516 #include <${cf_cv_ncurses_header:-curses.h}>
18517 int
18518 main (void)
18519 {
18520
18521         (void) assume_default_colors (0, 0);
18522         (void) curses_version ();
18523         (void) define_key (0, 0);
18524         (void) is_term_resized (0, 0);
18525         (void) key_defined (0);
18526         (void) keybound (0, 0);
18527         (void) keyok (0, 0);
18528         (void) resize_term (0, 0);
18529         (void) resizeterm (0, 0);
18530         (void) use_default_colors ();
18531         (void) use_extended_names (0);
18532         (void) wresize (0, 0, 0);
18533   ;
18534   return 0;
18535 }
18536 _ACEOF
18537 rm -f conftest.$ac_objext 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); } &&
18543          { ac_try='test -s conftest$ac_exeext'
18544   { (eval echo "$as_me:18544: \"$ac_try\"") >&5
18545   (eval $ac_try) 2>&5
18546   ac_status=$?
18547   echo "$as_me:18547: \$? = $ac_status" >&5
18548   (exit $ac_status); }; }; then
18549   cf_cv_ncurses_ext_funcs=yes
18550 else
18551   echo "$as_me: failed program was:" >&5
18552 cat conftest.$ac_ext >&5
18553 cf_cv_ncurses_ext_funcs=no
18554 fi
18555 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18556
18557 fi
18558 rm -f conftest.$ac_objext conftest.$ac_ext
18559
18560 fi
18561 echo "$as_me:18561: result: $cf_cv_ncurses_ext_funcs" >&5
18562 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18563 test "$cf_cv_ncurses_ext_funcs" = yes &&
18564 cat >>confdefs.h <<\EOF
18565 #define NCURSES_EXT_FUNCS 1
18566 EOF
18567
18568 if test "$cf_enable_widec" = yes
18569 then
18570         # workaround for systems with ncurses before 20111029, due to change of
18571         # feature test macro from _XPG5 to _XOPEN_SOURCE
18572         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18573         then
18574                 cf_define_xpg5=no
18575                 echo "$as_me:18575: checking if _XPG5 should be defined to enable wide-characters" >&5
18576 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18577
18578                 cat >conftest.$ac_ext <<_ACEOF
18579 #line 18579 "configure"
18580 #include "confdefs.h"
18581
18582 #include <${cf_cv_ncurses_header:-curses.h}>
18583 int
18584 main (void)
18585 {
18586 int x = _XPG5
18587   ;
18588   return 0;
18589 }
18590 _ACEOF
18591 rm -f conftest.$ac_objext
18592 if { (eval echo "$as_me:18592: \"$ac_compile\"") >&5
18593   (eval $ac_compile) 2>&5
18594   ac_status=$?
18595   echo "$as_me:18595: \$? = $ac_status" >&5
18596   (exit $ac_status); } &&
18597          { ac_try='test -s conftest.$ac_objext'
18598   { (eval echo "$as_me:18598: \"$ac_try\"") >&5
18599   (eval $ac_try) 2>&5
18600   ac_status=$?
18601   echo "$as_me:18601: \$? = $ac_status" >&5
18602   (exit $ac_status); }; }; then
18603   :
18604 else
18605   echo "$as_me: failed program was:" >&5
18606 cat conftest.$ac_ext >&5
18607 cf_save_cppflags="$CPPFLAGS"
18608                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18609                          cat >conftest.$ac_ext <<_ACEOF
18610 #line 18610 "configure"
18611 #include "confdefs.h"
18612
18613 #include <${cf_cv_ncurses_header:-curses.h}>
18614 int
18615 main (void)
18616 {
18617 int x = _XPG5
18618   ;
18619   return 0;
18620 }
18621 _ACEOF
18622 rm -f conftest.$ac_objext
18623 if { (eval echo "$as_me:18623: \"$ac_compile\"") >&5
18624   (eval $ac_compile) 2>&5
18625   ac_status=$?
18626   echo "$as_me:18626: \$? = $ac_status" >&5
18627   (exit $ac_status); } &&
18628          { ac_try='test -s conftest.$ac_objext'
18629   { (eval echo "$as_me:18629: \"$ac_try\"") >&5
18630   (eval $ac_try) 2>&5
18631   ac_status=$?
18632   echo "$as_me:18632: \$? = $ac_status" >&5
18633   (exit $ac_status); }; }; then
18634   cf_define_xpg5=yes
18635 else
18636   echo "$as_me: failed program was:" >&5
18637 cat conftest.$ac_ext >&5
18638 fi
18639 rm -f conftest.$ac_objext conftest.$ac_ext
18640                          CPPFLAGS="$cf_save_cppflags"
18641 fi
18642 rm -f conftest.$ac_objext conftest.$ac_ext
18643                 echo "$as_me:18643: result: $cf_define_xpg5" >&5
18644 echo "${ECHO_T}$cf_define_xpg5" >&6
18645
18646                 if test "$cf_define_xpg5" = yes
18647                 then
18648                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18649                 fi
18650         fi
18651
18652         echo "$as_me:18652: checking for wide-character functions" >&5
18653 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18654 if test "${cf_cv_widechar_funcs+set}" = set; then
18655   echo $ECHO_N "(cached) $ECHO_C" >&6
18656 else
18657
18658         cat >conftest.$ac_ext <<_ACEOF
18659 #line 18659 "configure"
18660 #include "confdefs.h"
18661
18662 #include <${cf_cv_ncurses_header:-curses.h}>
18663 int
18664 main (void)
18665 {
18666
18667                 static wchar_t src_wchar[2];
18668                 static cchar_t dst_cchar;
18669                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18670
18671   ;
18672   return 0;
18673 }
18674 _ACEOF
18675 rm -f conftest.$ac_objext conftest$ac_exeext
18676 if { (eval echo "$as_me:18676: \"$ac_link\"") >&5
18677   (eval $ac_link) 2>&5
18678   ac_status=$?
18679   echo "$as_me:18679: \$? = $ac_status" >&5
18680   (exit $ac_status); } &&
18681          { ac_try='test -s conftest$ac_exeext'
18682   { (eval echo "$as_me:18682: \"$ac_try\"") >&5
18683   (eval $ac_try) 2>&5
18684   ac_status=$?
18685   echo "$as_me:18685: \$? = $ac_status" >&5
18686   (exit $ac_status); }; }; then
18687   cf_cv_widechar_funcs=yes
18688 else
18689   echo "$as_me: failed program was:" >&5
18690 cat conftest.$ac_ext >&5
18691 cf_cv_widechar_funcs=no
18692 fi
18693 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18694
18695 fi
18696 echo "$as_me:18696: result: $cf_cv_widechar_funcs" >&5
18697 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18698         if test "$cf_cv_widechar_funcs" != no ; then
18699
18700 cat >>confdefs.h <<\EOF
18701 #define USE_WIDEC_SUPPORT 1
18702 EOF
18703
18704         else
18705                 cat >>confdefs.h <<\EOF
18706 #define USE_WIDEC_SUPPORT 0
18707 EOF
18708
18709         fi
18710 else
18711         cat >>confdefs.h <<\EOF
18712 #define USE_WIDEC_SUPPORT 0
18713 EOF
18714
18715 fi
18716
18717 echo "$as_me:18717: checking if $cf_cv_screen library uses pthreads" >&5
18718 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18719 if test "${cf_cv_use_pthreads+set}" = set; then
18720   echo $ECHO_N "(cached) $ECHO_C" >&6
18721 else
18722
18723 cat >conftest.$ac_ext <<_ACEOF
18724 #line 18724 "configure"
18725 #include "confdefs.h"
18726
18727 #include <${cf_cv_ncurses_header:-curses.h}>
18728 extern void _nc_init_pthreads(void);
18729
18730 int
18731 main (void)
18732 {
18733
18734         initscr();
18735         _nc_init_pthreads();
18736
18737   ;
18738   return 0;
18739 }
18740 _ACEOF
18741 rm -f conftest.$ac_objext conftest$ac_exeext
18742 if { (eval echo "$as_me:18742: \"$ac_link\"") >&5
18743   (eval $ac_link) 2>&5
18744   ac_status=$?
18745   echo "$as_me:18745: \$? = $ac_status" >&5
18746   (exit $ac_status); } &&
18747          { ac_try='test -s conftest$ac_exeext'
18748   { (eval echo "$as_me:18748: \"$ac_try\"") >&5
18749   (eval $ac_try) 2>&5
18750   ac_status=$?
18751   echo "$as_me:18751: \$? = $ac_status" >&5
18752   (exit $ac_status); }; }; then
18753   cf_cv_use_pthreads=yes
18754 else
18755   echo "$as_me: failed program was:" >&5
18756 cat conftest.$ac_ext >&5
18757 cf_cv_use_pthreads=no
18758 fi
18759 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18760
18761 fi
18762 echo "$as_me:18762: result: $cf_cv_use_pthreads" >&5
18763 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18764 test $cf_cv_use_pthreads = yes &&
18765 cat >>confdefs.h <<\EOF
18766 #define USE_PTHREADS 1
18767 EOF
18768
18769 echo "$as_me:18769: checking if sys/time.h works with sys/select.h" >&5
18770 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18771 if test "${cf_cv_sys_time_select+set}" = set; then
18772   echo $ECHO_N "(cached) $ECHO_C" >&6
18773 else
18774
18775 cat >conftest.$ac_ext <<_ACEOF
18776 #line 18776 "configure"
18777 #include "confdefs.h"
18778
18779 #include <sys/types.h>
18780 #ifdef HAVE_SYS_TIME_H
18781 #include <sys/time.h>
18782 #endif
18783 #ifdef HAVE_SYS_SELECT_H
18784 #include <sys/select.h>
18785 #endif
18786
18787 int
18788 main (void)
18789 {
18790
18791   ;
18792   return 0;
18793 }
18794 _ACEOF
18795 rm -f conftest.$ac_objext
18796 if { (eval echo "$as_me:18796: \"$ac_compile\"") >&5
18797   (eval $ac_compile) 2>&5
18798   ac_status=$?
18799   echo "$as_me:18799: \$? = $ac_status" >&5
18800   (exit $ac_status); } &&
18801          { ac_try='test -s conftest.$ac_objext'
18802   { (eval echo "$as_me:18802: \"$ac_try\"") >&5
18803   (eval $ac_try) 2>&5
18804   ac_status=$?
18805   echo "$as_me:18805: \$? = $ac_status" >&5
18806   (exit $ac_status); }; }; then
18807   cf_cv_sys_time_select=yes
18808 else
18809   echo "$as_me: failed program was:" >&5
18810 cat conftest.$ac_ext >&5
18811 cf_cv_sys_time_select=no
18812 fi
18813 rm -f conftest.$ac_objext conftest.$ac_ext
18814
18815 fi
18816
18817 echo "$as_me:18817: result: $cf_cv_sys_time_select" >&5
18818 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18819 test "$cf_cv_sys_time_select" = yes &&
18820 cat >>confdefs.h <<\EOF
18821 #define HAVE_SYS_TIME_SELECT 1
18822 EOF
18823
18824 # special check for test/ditto.c
18825
18826 echo "$as_me:18826: checking for openpty in -lutil" >&5
18827 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18828 if test "${ac_cv_lib_util_openpty+set}" = set; then
18829   echo $ECHO_N "(cached) $ECHO_C" >&6
18830 else
18831   ac_check_lib_save_LIBS=$LIBS
18832 LIBS="-lutil  $LIBS"
18833 cat >conftest.$ac_ext <<_ACEOF
18834 #line 18834 "configure"
18835 #include "confdefs.h"
18836
18837 /* Override any gcc2 internal prototype to avoid an error.  */
18838 #ifdef __cplusplus
18839 extern "C"
18840 #endif
18841 /* We use char because int might match the return type of a gcc2
18842    builtin and then its argument prototype would still apply.  */
18843 char openpty ();
18844 int
18845 main (void)
18846 {
18847 openpty ();
18848   ;
18849   return 0;
18850 }
18851 _ACEOF
18852 rm -f conftest.$ac_objext conftest$ac_exeext
18853 if { (eval echo "$as_me:18853: \"$ac_link\"") >&5
18854   (eval $ac_link) 2>&5
18855   ac_status=$?
18856   echo "$as_me:18856: \$? = $ac_status" >&5
18857   (exit $ac_status); } &&
18858          { ac_try='test -s conftest$ac_exeext'
18859   { (eval echo "$as_me:18859: \"$ac_try\"") >&5
18860   (eval $ac_try) 2>&5
18861   ac_status=$?
18862   echo "$as_me:18862: \$? = $ac_status" >&5
18863   (exit $ac_status); }; }; then
18864   ac_cv_lib_util_openpty=yes
18865 else
18866   echo "$as_me: failed program was:" >&5
18867 cat conftest.$ac_ext >&5
18868 ac_cv_lib_util_openpty=no
18869 fi
18870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18871 LIBS=$ac_check_lib_save_LIBS
18872 fi
18873 echo "$as_me:18873: result: $ac_cv_lib_util_openpty" >&5
18874 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18875 if test $ac_cv_lib_util_openpty = yes; then
18876   cf_cv_lib_util=yes
18877 else
18878   cf_cv_lib_util=no
18879 fi
18880
18881 echo "$as_me:18881: checking for openpty header" >&5
18882 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18883 if test "${cf_cv_func_openpty+set}" = set; then
18884   echo $ECHO_N "(cached) $ECHO_C" >&6
18885 else
18886
18887         cf_save_LIBS="$LIBS"
18888         test $cf_cv_lib_util = yes && {
18889 cf_add_libs="$LIBS"
18890 # reverse order
18891 cf_add_0lib=
18892 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18893 # filter duplicates
18894 for cf_add_1lib in $cf_add_0lib; do
18895         for cf_add_2lib in $cf_add_libs; do
18896                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18897                         cf_add_1lib=
18898                         break
18899                 fi
18900         done
18901         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18902 done
18903 LIBS="$cf_add_libs"
18904  }
18905         for cf_header in pty.h libutil.h util.h
18906         do
18907         cat >conftest.$ac_ext <<_ACEOF
18908 #line 18908 "configure"
18909 #include "confdefs.h"
18910
18911 #include <$cf_header>
18912
18913 int
18914 main (void)
18915 {
18916
18917         int x = openpty((int *)0, (int *)0, (char *)0,
18918                                    (struct termios *)0, (struct winsize *)0);
18919
18920   ;
18921   return 0;
18922 }
18923 _ACEOF
18924 rm -f conftest.$ac_objext conftest$ac_exeext
18925 if { (eval echo "$as_me:18925: \"$ac_link\"") >&5
18926   (eval $ac_link) 2>&5
18927   ac_status=$?
18928   echo "$as_me:18928: \$? = $ac_status" >&5
18929   (exit $ac_status); } &&
18930          { ac_try='test -s conftest$ac_exeext'
18931   { (eval echo "$as_me:18931: \"$ac_try\"") >&5
18932   (eval $ac_try) 2>&5
18933   ac_status=$?
18934   echo "$as_me:18934: \$? = $ac_status" >&5
18935   (exit $ac_status); }; }; then
18936
18937                 cf_cv_func_openpty=$cf_header
18938                 break
18939
18940 else
18941   echo "$as_me: failed program was:" >&5
18942 cat conftest.$ac_ext >&5
18943
18944                 cf_cv_func_openpty=no
18945
18946 fi
18947 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18948         done
18949         LIBS="$cf_save_LIBS"
18950
18951 fi
18952 echo "$as_me:18952: result: $cf_cv_func_openpty" >&5
18953 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18954
18955 if test "$cf_cv_func_openpty" != no ; then
18956
18957 cat >>confdefs.h <<EOF
18958 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18959 EOF
18960
18961 cat >>confdefs.h <<\EOF
18962 #define USE_XTERM_PTY 1
18963 EOF
18964
18965         if test "x$cf_cv_lib_util" = xyes ; then
18966
18967 cf_add_libs="$TEST_LIBS"
18968 # reverse order
18969 cf_add_0lib=
18970 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18971 # filter duplicates
18972 for cf_add_1lib in $cf_add_0lib; do
18973         for cf_add_2lib in $cf_add_libs; do
18974                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18975                         cf_add_1lib=
18976                         break
18977                 fi
18978         done
18979         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18980 done
18981 TEST_LIBS="$cf_add_libs"
18982
18983         fi
18984 fi
18985
18986 echo "$as_me:18986: checking for function curses_version" >&5
18987 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
18988 if test "${cf_cv_func_curses_version+set}" = set; then
18989   echo $ECHO_N "(cached) $ECHO_C" >&6
18990 else
18991
18992 if test "$cross_compiling" = yes; then
18993   cf_cv_func_curses_version=unknown
18994 else
18995   cat >conftest.$ac_ext <<_ACEOF
18996 #line 18996 "configure"
18997 #include "confdefs.h"
18998
18999 #include <${cf_cv_ncurses_header:-curses.h}>
19000 int main(void)
19001 {
19002         char temp[1024];
19003         sprintf(temp, "%s\n", curses_version());
19004         ${cf_cv_main_return:-return}(0);
19005 }
19006
19007 _ACEOF
19008 rm -f conftest$ac_exeext
19009 if { (eval echo "$as_me:19009: \"$ac_link\"") >&5
19010   (eval $ac_link) 2>&5
19011   ac_status=$?
19012   echo "$as_me:19012: \$? = $ac_status" >&5
19013   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19014   { (eval echo "$as_me:19014: \"$ac_try\"") >&5
19015   (eval $ac_try) 2>&5
19016   ac_status=$?
19017   echo "$as_me:19017: \$? = $ac_status" >&5
19018   (exit $ac_status); }; }; then
19019   cf_cv_func_curses_version=yes
19020
19021 else
19022   echo "$as_me: program exited with status $ac_status" >&5
19023 echo "$as_me: failed program was:" >&5
19024 cat conftest.$ac_ext >&5
19025 cf_cv_func_curses_version=no
19026
19027 fi
19028 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19029 fi
19030 rm -f core
19031 fi
19032 echo "$as_me:19032: result: $cf_cv_func_curses_version" >&5
19033 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19034 test "$cf_cv_func_curses_version" = yes &&
19035 cat >>confdefs.h <<\EOF
19036 #define HAVE_CURSES_VERSION 1
19037 EOF
19038
19039 echo "$as_me:19039: checking for alternate character set array" >&5
19040 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19041 if test "${cf_cv_curses_acs_map+set}" = set; then
19042   echo $ECHO_N "(cached) $ECHO_C" >&6
19043 else
19044
19045 cf_cv_curses_acs_map=unknown
19046 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19047 do
19048 cat >conftest.$ac_ext <<_ACEOF
19049 #line 19049 "configure"
19050 #include "confdefs.h"
19051
19052 #include <${cf_cv_ncurses_header:-curses.h}>
19053
19054 int
19055 main (void)
19056 {
19057
19058 $name['k'] = ACS_PLUS
19059
19060   ;
19061   return 0;
19062 }
19063 _ACEOF
19064 rm -f conftest.$ac_objext conftest$ac_exeext
19065 if { (eval echo "$as_me:19065: \"$ac_link\"") >&5
19066   (eval $ac_link) 2>&5
19067   ac_status=$?
19068   echo "$as_me:19068: \$? = $ac_status" >&5
19069   (exit $ac_status); } &&
19070          { ac_try='test -s conftest$ac_exeext'
19071   { (eval echo "$as_me:19071: \"$ac_try\"") >&5
19072   (eval $ac_try) 2>&5
19073   ac_status=$?
19074   echo "$as_me:19074: \$? = $ac_status" >&5
19075   (exit $ac_status); }; }; then
19076   cf_cv_curses_acs_map=$name; break
19077 else
19078   echo "$as_me: failed program was:" >&5
19079 cat conftest.$ac_ext >&5
19080 fi
19081 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19082 done
19083
19084 fi
19085 echo "$as_me:19085: result: $cf_cv_curses_acs_map" >&5
19086 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19087
19088 test "$cf_cv_curses_acs_map" != unknown &&
19089 cat >>confdefs.h <<EOF
19090 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19091 EOF
19092
19093 if test "$cf_enable_widec" = yes; then
19094
19095 echo "$as_me:19095: checking for wide alternate character set array" >&5
19096 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19097 if test "${cf_cv_curses_wacs_map+set}" = set; then
19098   echo $ECHO_N "(cached) $ECHO_C" >&6
19099 else
19100
19101         cf_cv_curses_wacs_map=unknown
19102         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19103         do
19104         cat >conftest.$ac_ext <<_ACEOF
19105 #line 19105 "configure"
19106 #include "confdefs.h"
19107
19108 #ifndef _XOPEN_SOURCE_EXTENDED
19109 #define _XOPEN_SOURCE_EXTENDED
19110 #endif
19111 #include <${cf_cv_ncurses_header:-curses.h}>
19112 int
19113 main (void)
19114 {
19115 void *foo = &($name['k'])
19116   ;
19117   return 0;
19118 }
19119 _ACEOF
19120 rm -f conftest.$ac_objext conftest$ac_exeext
19121 if { (eval echo "$as_me:19121: \"$ac_link\"") >&5
19122   (eval $ac_link) 2>&5
19123   ac_status=$?
19124   echo "$as_me:19124: \$? = $ac_status" >&5
19125   (exit $ac_status); } &&
19126          { ac_try='test -s conftest$ac_exeext'
19127   { (eval echo "$as_me:19127: \"$ac_try\"") >&5
19128   (eval $ac_try) 2>&5
19129   ac_status=$?
19130   echo "$as_me:19130: \$? = $ac_status" >&5
19131   (exit $ac_status); }; }; then
19132   cf_cv_curses_wacs_map=$name
19133          break
19134 else
19135   echo "$as_me: failed program was:" >&5
19136 cat conftest.$ac_ext >&5
19137 fi
19138 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19139         done
19140 fi
19141 echo "$as_me:19141: result: $cf_cv_curses_wacs_map" >&5
19142 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19143
19144 test "$cf_cv_curses_wacs_map" != unknown &&
19145 cat >>confdefs.h <<EOF
19146 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19147 EOF
19148
19149 echo "$as_me:19149: checking for wide alternate character constants" >&5
19150 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19151 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19152   echo $ECHO_N "(cached) $ECHO_C" >&6
19153 else
19154
19155 cf_cv_curses_wacs_symbols=no
19156 if test "$cf_cv_curses_wacs_map" != unknown
19157 then
19158         cat >conftest.$ac_ext <<_ACEOF
19159 #line 19159 "configure"
19160 #include "confdefs.h"
19161
19162 #ifndef _XOPEN_SOURCE_EXTENDED
19163 #define _XOPEN_SOURCE_EXTENDED
19164 #endif
19165 #include <${cf_cv_ncurses_header:-curses.h}>
19166 int
19167 main (void)
19168 {
19169 cchar_t *foo = WACS_PLUS;
19170          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
19171   ;
19172   return 0;
19173 }
19174 _ACEOF
19175 rm -f conftest.$ac_objext conftest$ac_exeext
19176 if { (eval echo "$as_me:19176: \"$ac_link\"") >&5
19177   (eval $ac_link) 2>&5
19178   ac_status=$?
19179   echo "$as_me:19179: \$? = $ac_status" >&5
19180   (exit $ac_status); } &&
19181          { ac_try='test -s conftest$ac_exeext'
19182   { (eval echo "$as_me:19182: \"$ac_try\"") >&5
19183   (eval $ac_try) 2>&5
19184   ac_status=$?
19185   echo "$as_me:19185: \$? = $ac_status" >&5
19186   (exit $ac_status); }; }; then
19187   cf_cv_curses_wacs_symbols=yes
19188 else
19189   echo "$as_me: failed program was:" >&5
19190 cat conftest.$ac_ext >&5
19191 fi
19192 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19193 else
19194         cat >conftest.$ac_ext <<_ACEOF
19195 #line 19195 "configure"
19196 #include "confdefs.h"
19197
19198 #ifndef _XOPEN_SOURCE_EXTENDED
19199 #define _XOPEN_SOURCE_EXTENDED
19200 #endif
19201 #include <${cf_cv_ncurses_header:-curses.h}>
19202 int
19203 main (void)
19204 {
19205 cchar_t *foo = WACS_PLUS
19206   ;
19207   return 0;
19208 }
19209 _ACEOF
19210 rm -f conftest.$ac_objext conftest$ac_exeext
19211 if { (eval echo "$as_me:19211: \"$ac_link\"") >&5
19212   (eval $ac_link) 2>&5
19213   ac_status=$?
19214   echo "$as_me:19214: \$? = $ac_status" >&5
19215   (exit $ac_status); } &&
19216          { ac_try='test -s conftest$ac_exeext'
19217   { (eval echo "$as_me:19217: \"$ac_try\"") >&5
19218   (eval $ac_try) 2>&5
19219   ac_status=$?
19220   echo "$as_me:19220: \$? = $ac_status" >&5
19221   (exit $ac_status); }; }; then
19222   cf_cv_curses_wacs_symbols=yes
19223 else
19224   echo "$as_me: failed program was:" >&5
19225 cat conftest.$ac_ext >&5
19226 fi
19227 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19228 fi
19229
19230 fi
19231 echo "$as_me:19231: result: $cf_cv_curses_wacs_symbols" >&5
19232 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19233
19234 test "$cf_cv_curses_wacs_symbols" != no &&
19235 cat >>confdefs.h <<\EOF
19236 #define CURSES_WACS_SYMBOLS 1
19237 EOF
19238
19239 fi
19240
19241 echo "$as_me:19241: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19242 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19243 cat >conftest.$ac_ext <<_ACEOF
19244 #line 19244 "configure"
19245 #include "confdefs.h"
19246
19247 #ifndef _XOPEN_SOURCE_EXTENDED
19248 #define _XOPEN_SOURCE_EXTENDED
19249 #endif
19250 #include <${cf_cv_ncurses_header:-curses.h}>
19251 int
19252 main (void)
19253 {
19254
19255 attr_t foo
19256
19257   ;
19258   return 0;
19259 }
19260 _ACEOF
19261 rm -f conftest.$ac_objext
19262 if { (eval echo "$as_me:19262: \"$ac_compile\"") >&5
19263   (eval $ac_compile) 2>&5
19264   ac_status=$?
19265   echo "$as_me:19265: \$? = $ac_status" >&5
19266   (exit $ac_status); } &&
19267          { ac_try='test -s conftest.$ac_objext'
19268   { (eval echo "$as_me:19268: \"$ac_try\"") >&5
19269   (eval $ac_try) 2>&5
19270   ac_status=$?
19271   echo "$as_me:19271: \$? = $ac_status" >&5
19272   (exit $ac_status); }; }; then
19273   cf_result=yes
19274 else
19275   echo "$as_me: failed program was:" >&5
19276 cat conftest.$ac_ext >&5
19277 cf_result=no
19278 fi
19279 rm -f conftest.$ac_objext conftest.$ac_ext
19280 echo "$as_me:19280: result: $cf_result" >&5
19281 echo "${ECHO_T}$cf_result" >&6
19282 if test $cf_result = yes ; then
19283
19284 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19285
19286 cat >>confdefs.h <<EOF
19287 #define $cf_result 1
19288 EOF
19289
19290 else
19291
19292 cat >>confdefs.h <<EOF
19293 #define attr_t long
19294 EOF
19295
19296 fi
19297
19298 if test "$cf_enable_widec" = yes; then
19299
19300 # This is needed on Tru64 5.0 to declare mbstate_t
19301 echo "$as_me:19301: checking if we must include wchar.h to declare mbstate_t" >&5
19302 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19303 if test "${cf_cv_mbstate_t+set}" = set; then
19304   echo $ECHO_N "(cached) $ECHO_C" >&6
19305 else
19306
19307 cat >conftest.$ac_ext <<_ACEOF
19308 #line 19308 "configure"
19309 #include "confdefs.h"
19310
19311 #include <stdlib.h>
19312 #include <stdarg.h>
19313 #include <stdio.h>
19314 #ifdef HAVE_LIBUTF8_H
19315 #include <libutf8.h>
19316 #endif
19317 int
19318 main (void)
19319 {
19320 mbstate_t state
19321   ;
19322   return 0;
19323 }
19324 _ACEOF
19325 rm -f conftest.$ac_objext
19326 if { (eval echo "$as_me:19326: \"$ac_compile\"") >&5
19327   (eval $ac_compile) 2>&5
19328   ac_status=$?
19329   echo "$as_me:19329: \$? = $ac_status" >&5
19330   (exit $ac_status); } &&
19331          { ac_try='test -s conftest.$ac_objext'
19332   { (eval echo "$as_me:19332: \"$ac_try\"") >&5
19333   (eval $ac_try) 2>&5
19334   ac_status=$?
19335   echo "$as_me:19335: \$? = $ac_status" >&5
19336   (exit $ac_status); }; }; then
19337   cf_cv_mbstate_t=no
19338 else
19339   echo "$as_me: failed program was:" >&5
19340 cat conftest.$ac_ext >&5
19341 cat >conftest.$ac_ext <<_ACEOF
19342 #line 19342 "configure"
19343 #include "confdefs.h"
19344
19345 #include <stdlib.h>
19346 #include <stdarg.h>
19347 #include <stdio.h>
19348 #include <wchar.h>
19349 #ifdef HAVE_LIBUTF8_H
19350 #include <libutf8.h>
19351 #endif
19352 int
19353 main (void)
19354 {
19355 mbstate_t value
19356   ;
19357   return 0;
19358 }
19359 _ACEOF
19360 rm -f conftest.$ac_objext
19361 if { (eval echo "$as_me:19361: \"$ac_compile\"") >&5
19362   (eval $ac_compile) 2>&5
19363   ac_status=$?
19364   echo "$as_me:19364: \$? = $ac_status" >&5
19365   (exit $ac_status); } &&
19366          { ac_try='test -s conftest.$ac_objext'
19367   { (eval echo "$as_me:19367: \"$ac_try\"") >&5
19368   (eval $ac_try) 2>&5
19369   ac_status=$?
19370   echo "$as_me:19370: \$? = $ac_status" >&5
19371   (exit $ac_status); }; }; then
19372   cf_cv_mbstate_t=yes
19373 else
19374   echo "$as_me: failed program was:" >&5
19375 cat conftest.$ac_ext >&5
19376 cf_cv_mbstate_t=unknown
19377 fi
19378 rm -f conftest.$ac_objext conftest.$ac_ext
19379 fi
19380 rm -f conftest.$ac_objext conftest.$ac_ext
19381 fi
19382 echo "$as_me:19382: result: $cf_cv_mbstate_t" >&5
19383 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19384
19385 if test "$cf_cv_mbstate_t" = yes ; then
19386
19387 cat >>confdefs.h <<\EOF
19388 #define NEED_WCHAR_H 1
19389 EOF
19390
19391         NEED_WCHAR_H=1
19392 fi
19393
19394 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19395 if test "$cf_cv_mbstate_t" = unknown ; then
19396         NCURSES_MBSTATE_T=1
19397 fi
19398
19399 # if we find mbstate_t in either place, use substitution to provide a fallback.
19400 if test "$cf_cv_mbstate_t" != unknown ; then
19401         NCURSES_OK_MBSTATE_T=1
19402 fi
19403
19404 # This is needed on Tru64 5.0 to declare wchar_t
19405 echo "$as_me:19405: checking if we must include wchar.h to declare wchar_t" >&5
19406 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19407 if test "${cf_cv_wchar_t+set}" = set; then
19408   echo $ECHO_N "(cached) $ECHO_C" >&6
19409 else
19410
19411 cat >conftest.$ac_ext <<_ACEOF
19412 #line 19412 "configure"
19413 #include "confdefs.h"
19414
19415 #include <stdlib.h>
19416 #include <stdarg.h>
19417 #include <stdio.h>
19418 #ifdef HAVE_LIBUTF8_H
19419 #include <libutf8.h>
19420 #endif
19421 int
19422 main (void)
19423 {
19424 wchar_t state
19425   ;
19426   return 0;
19427 }
19428 _ACEOF
19429 rm -f conftest.$ac_objext
19430 if { (eval echo "$as_me:19430: \"$ac_compile\"") >&5
19431   (eval $ac_compile) 2>&5
19432   ac_status=$?
19433   echo "$as_me:19433: \$? = $ac_status" >&5
19434   (exit $ac_status); } &&
19435          { ac_try='test -s conftest.$ac_objext'
19436   { (eval echo "$as_me:19436: \"$ac_try\"") >&5
19437   (eval $ac_try) 2>&5
19438   ac_status=$?
19439   echo "$as_me:19439: \$? = $ac_status" >&5
19440   (exit $ac_status); }; }; then
19441   cf_cv_wchar_t=no
19442 else
19443   echo "$as_me: failed program was:" >&5
19444 cat conftest.$ac_ext >&5
19445 cat >conftest.$ac_ext <<_ACEOF
19446 #line 19446 "configure"
19447 #include "confdefs.h"
19448
19449 #include <stdlib.h>
19450 #include <stdarg.h>
19451 #include <stdio.h>
19452 #include <wchar.h>
19453 #ifdef HAVE_LIBUTF8_H
19454 #include <libutf8.h>
19455 #endif
19456 int
19457 main (void)
19458 {
19459 wchar_t value
19460   ;
19461   return 0;
19462 }
19463 _ACEOF
19464 rm -f conftest.$ac_objext
19465 if { (eval echo "$as_me:19465: \"$ac_compile\"") >&5
19466   (eval $ac_compile) 2>&5
19467   ac_status=$?
19468   echo "$as_me:19468: \$? = $ac_status" >&5
19469   (exit $ac_status); } &&
19470          { ac_try='test -s conftest.$ac_objext'
19471   { (eval echo "$as_me:19471: \"$ac_try\"") >&5
19472   (eval $ac_try) 2>&5
19473   ac_status=$?
19474   echo "$as_me:19474: \$? = $ac_status" >&5
19475   (exit $ac_status); }; }; then
19476   cf_cv_wchar_t=yes
19477 else
19478   echo "$as_me: failed program was:" >&5
19479 cat conftest.$ac_ext >&5
19480 cf_cv_wchar_t=unknown
19481 fi
19482 rm -f conftest.$ac_objext conftest.$ac_ext
19483 fi
19484 rm -f conftest.$ac_objext conftest.$ac_ext
19485 fi
19486 echo "$as_me:19486: result: $cf_cv_wchar_t" >&5
19487 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19488
19489 if test "$cf_cv_wchar_t" = yes ; then
19490
19491 cat >>confdefs.h <<\EOF
19492 #define NEED_WCHAR_H 1
19493 EOF
19494
19495         NEED_WCHAR_H=1
19496 fi
19497
19498 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19499 if test "$cf_cv_wchar_t" = unknown ; then
19500         NCURSES_WCHAR_T=1
19501 fi
19502
19503 # if we find wchar_t in either place, use substitution to provide a fallback.
19504 if test "$cf_cv_wchar_t" != unknown ; then
19505         NCURSES_OK_WCHAR_T=1
19506 fi
19507
19508 # This is needed on Tru64 5.0 to declare wint_t
19509 echo "$as_me:19509: checking if we must include wchar.h to declare wint_t" >&5
19510 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19511 if test "${cf_cv_wint_t+set}" = set; then
19512   echo $ECHO_N "(cached) $ECHO_C" >&6
19513 else
19514
19515 cat >conftest.$ac_ext <<_ACEOF
19516 #line 19516 "configure"
19517 #include "confdefs.h"
19518
19519 #include <stdlib.h>
19520 #include <stdarg.h>
19521 #include <stdio.h>
19522 #ifdef HAVE_LIBUTF8_H
19523 #include <libutf8.h>
19524 #endif
19525 int
19526 main (void)
19527 {
19528 wint_t state
19529   ;
19530   return 0;
19531 }
19532 _ACEOF
19533 rm -f conftest.$ac_objext
19534 if { (eval echo "$as_me:19534: \"$ac_compile\"") >&5
19535   (eval $ac_compile) 2>&5
19536   ac_status=$?
19537   echo "$as_me:19537: \$? = $ac_status" >&5
19538   (exit $ac_status); } &&
19539          { ac_try='test -s conftest.$ac_objext'
19540   { (eval echo "$as_me:19540: \"$ac_try\"") >&5
19541   (eval $ac_try) 2>&5
19542   ac_status=$?
19543   echo "$as_me:19543: \$? = $ac_status" >&5
19544   (exit $ac_status); }; }; then
19545   cf_cv_wint_t=no
19546 else
19547   echo "$as_me: failed program was:" >&5
19548 cat conftest.$ac_ext >&5
19549 cat >conftest.$ac_ext <<_ACEOF
19550 #line 19550 "configure"
19551 #include "confdefs.h"
19552
19553 #include <stdlib.h>
19554 #include <stdarg.h>
19555 #include <stdio.h>
19556 #include <wchar.h>
19557 #ifdef HAVE_LIBUTF8_H
19558 #include <libutf8.h>
19559 #endif
19560 int
19561 main (void)
19562 {
19563 wint_t value
19564   ;
19565   return 0;
19566 }
19567 _ACEOF
19568 rm -f conftest.$ac_objext
19569 if { (eval echo "$as_me:19569: \"$ac_compile\"") >&5
19570   (eval $ac_compile) 2>&5
19571   ac_status=$?
19572   echo "$as_me:19572: \$? = $ac_status" >&5
19573   (exit $ac_status); } &&
19574          { ac_try='test -s conftest.$ac_objext'
19575   { (eval echo "$as_me:19575: \"$ac_try\"") >&5
19576   (eval $ac_try) 2>&5
19577   ac_status=$?
19578   echo "$as_me:19578: \$? = $ac_status" >&5
19579   (exit $ac_status); }; }; then
19580   cf_cv_wint_t=yes
19581 else
19582   echo "$as_me: failed program was:" >&5
19583 cat conftest.$ac_ext >&5
19584 cf_cv_wint_t=unknown
19585 fi
19586 rm -f conftest.$ac_objext conftest.$ac_ext
19587 fi
19588 rm -f conftest.$ac_objext conftest.$ac_ext
19589 fi
19590 echo "$as_me:19590: result: $cf_cv_wint_t" >&5
19591 echo "${ECHO_T}$cf_cv_wint_t" >&6
19592
19593 if test "$cf_cv_wint_t" = yes ; then
19594
19595 cat >>confdefs.h <<\EOF
19596 #define NEED_WCHAR_H 1
19597 EOF
19598
19599         NEED_WCHAR_H=1
19600 fi
19601
19602 # if we do not find wint_t in either place, use substitution to provide a fallback.
19603 if test "$cf_cv_wint_t" = unknown ; then
19604         NCURSES_WINT_T=1
19605 fi
19606
19607 # if we find wint_t in either place, use substitution to provide a fallback.
19608 if test "$cf_cv_wint_t" != unknown ; then
19609         NCURSES_OK_WINT_T=1
19610 fi
19611
19612         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19613
19614 echo "$as_me:19614: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19615 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19616 cat >conftest.$ac_ext <<_ACEOF
19617 #line 19617 "configure"
19618 #include "confdefs.h"
19619
19620 #ifndef _XOPEN_SOURCE_EXTENDED
19621 #define _XOPEN_SOURCE_EXTENDED
19622 #endif
19623 #include <${cf_cv_ncurses_header:-curses.h}>
19624 int
19625 main (void)
19626 {
19627
19628 mbstate_t foo
19629
19630   ;
19631   return 0;
19632 }
19633 _ACEOF
19634 rm -f conftest.$ac_objext
19635 if { (eval echo "$as_me:19635: \"$ac_compile\"") >&5
19636   (eval $ac_compile) 2>&5
19637   ac_status=$?
19638   echo "$as_me:19638: \$? = $ac_status" >&5
19639   (exit $ac_status); } &&
19640          { ac_try='test -s conftest.$ac_objext'
19641   { (eval echo "$as_me:19641: \"$ac_try\"") >&5
19642   (eval $ac_try) 2>&5
19643   ac_status=$?
19644   echo "$as_me:19644: \$? = $ac_status" >&5
19645   (exit $ac_status); }; }; then
19646   cf_result=yes
19647 else
19648   echo "$as_me: failed program was:" >&5
19649 cat conftest.$ac_ext >&5
19650 cf_result=no
19651 fi
19652 rm -f conftest.$ac_objext conftest.$ac_ext
19653 echo "$as_me:19653: result: $cf_result" >&5
19654 echo "${ECHO_T}$cf_result" >&6
19655 if test $cf_result = yes ; then
19656
19657 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19658
19659 cat >>confdefs.h <<EOF
19660 #define $cf_result 1
19661 EOF
19662
19663 else
19664
19665 cat >>confdefs.h <<EOF
19666 #define mbstate_t long
19667 EOF
19668
19669 fi
19670
19671         fi
19672
19673         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19674
19675 echo "$as_me:19675: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19676 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19677 cat >conftest.$ac_ext <<_ACEOF
19678 #line 19678 "configure"
19679 #include "confdefs.h"
19680
19681 #ifndef _XOPEN_SOURCE_EXTENDED
19682 #define _XOPEN_SOURCE_EXTENDED
19683 #endif
19684 #include <${cf_cv_ncurses_header:-curses.h}>
19685 int
19686 main (void)
19687 {
19688
19689 wchar_t foo
19690
19691   ;
19692   return 0;
19693 }
19694 _ACEOF
19695 rm -f conftest.$ac_objext
19696 if { (eval echo "$as_me:19696: \"$ac_compile\"") >&5
19697   (eval $ac_compile) 2>&5
19698   ac_status=$?
19699   echo "$as_me:19699: \$? = $ac_status" >&5
19700   (exit $ac_status); } &&
19701          { ac_try='test -s conftest.$ac_objext'
19702   { (eval echo "$as_me:19702: \"$ac_try\"") >&5
19703   (eval $ac_try) 2>&5
19704   ac_status=$?
19705   echo "$as_me:19705: \$? = $ac_status" >&5
19706   (exit $ac_status); }; }; then
19707   cf_result=yes
19708 else
19709   echo "$as_me: failed program was:" >&5
19710 cat conftest.$ac_ext >&5
19711 cf_result=no
19712 fi
19713 rm -f conftest.$ac_objext conftest.$ac_ext
19714 echo "$as_me:19714: result: $cf_result" >&5
19715 echo "${ECHO_T}$cf_result" >&6
19716 if test $cf_result = yes ; then
19717
19718 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19719
19720 cat >>confdefs.h <<EOF
19721 #define $cf_result 1
19722 EOF
19723
19724 else
19725
19726 cat >>confdefs.h <<EOF
19727 #define wchar_t long
19728 EOF
19729
19730 fi
19731
19732         fi
19733
19734         if test "$NCURSES_OK_WINT_T" = 0 ; then
19735
19736 echo "$as_me:19736: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19737 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19738 cat >conftest.$ac_ext <<_ACEOF
19739 #line 19739 "configure"
19740 #include "confdefs.h"
19741
19742 #ifndef _XOPEN_SOURCE_EXTENDED
19743 #define _XOPEN_SOURCE_EXTENDED
19744 #endif
19745 #include <${cf_cv_ncurses_header:-curses.h}>
19746 int
19747 main (void)
19748 {
19749
19750 wint_t foo
19751
19752   ;
19753   return 0;
19754 }
19755 _ACEOF
19756 rm -f conftest.$ac_objext
19757 if { (eval echo "$as_me:19757: \"$ac_compile\"") >&5
19758   (eval $ac_compile) 2>&5
19759   ac_status=$?
19760   echo "$as_me:19760: \$? = $ac_status" >&5
19761   (exit $ac_status); } &&
19762          { ac_try='test -s conftest.$ac_objext'
19763   { (eval echo "$as_me:19763: \"$ac_try\"") >&5
19764   (eval $ac_try) 2>&5
19765   ac_status=$?
19766   echo "$as_me:19766: \$? = $ac_status" >&5
19767   (exit $ac_status); }; }; then
19768   cf_result=yes
19769 else
19770   echo "$as_me: failed program was:" >&5
19771 cat conftest.$ac_ext >&5
19772 cf_result=no
19773 fi
19774 rm -f conftest.$ac_objext conftest.$ac_ext
19775 echo "$as_me:19775: result: $cf_result" >&5
19776 echo "${ECHO_T}$cf_result" >&6
19777 if test $cf_result = yes ; then
19778
19779 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19780
19781 cat >>confdefs.h <<EOF
19782 #define $cf_result 1
19783 EOF
19784
19785 else
19786
19787 cat >>confdefs.h <<EOF
19788 #define wint_t long
19789 EOF
19790
19791 fi
19792
19793         fi
19794 fi
19795
19796 for cf_data in \
19797 TABSIZE \
19798 curscr \
19799 ospeed \
19800 boolnames \
19801 boolfnames \
19802 ttytype
19803 do
19804 echo "$as_me:19804: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19805 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19806
19807 cat >conftest.$ac_ext <<_ACEOF
19808 #line 19808 "configure"
19809 #include "confdefs.h"
19810
19811 #ifdef HAVE_XCURSES
19812 #include <xcurses.h>
19813 char * XCursesProgramName = "test";
19814 #else
19815 #include <${cf_cv_ncurses_header:-curses.h}>
19816 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19817 #include <ncursesw/term.h>
19818 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19819 #include <ncurses/term.h>
19820 #elif defined(HAVE_TERM_H)
19821 #include <term.h>
19822 #endif
19823 #endif
19824
19825 int
19826 main (void)
19827 {
19828
19829 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19830         const void *foo = (const void *)($cf_data);
19831 #else
19832         const void *foo = &($cf_data);
19833 #endif
19834         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19835
19836   ;
19837   return 0;
19838 }
19839 _ACEOF
19840 rm -f conftest.$ac_objext
19841 if { (eval echo "$as_me:19841: \"$ac_compile\"") >&5
19842   (eval $ac_compile) 2>&5
19843   ac_status=$?
19844   echo "$as_me:19844: \$? = $ac_status" >&5
19845   (exit $ac_status); } &&
19846          { ac_try='test -s conftest.$ac_objext'
19847   { (eval echo "$as_me:19847: \"$ac_try\"") >&5
19848   (eval $ac_try) 2>&5
19849   ac_status=$?
19850   echo "$as_me:19850: \$? = $ac_status" >&5
19851   (exit $ac_status); }; }; then
19852   cf_result=yes
19853
19854 else
19855   echo "$as_me: failed program was:" >&5
19856 cat conftest.$ac_ext >&5
19857 cf_result=no
19858 fi
19859 rm -f conftest.$ac_objext conftest.$ac_ext
19860 echo "$as_me:19860: result: $cf_result" >&5
19861 echo "${ECHO_T}$cf_result" >&6
19862
19863 if test $cf_result = yes ; then
19864
19865 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19866
19867         cat >>confdefs.h <<EOF
19868 #define $cf_result 1
19869 EOF
19870
19871 else
19872         echo "$as_me:19872: checking for data $cf_data in library" >&5
19873 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19874         # BSD linkers insist on making weak linkage, but resolve at runtime.
19875         if test "$cross_compiling" = yes; then
19876
19877         # cross-compiling
19878         cat >conftest.$ac_ext <<_ACEOF
19879 #line 19879 "configure"
19880 #include "confdefs.h"
19881
19882 #ifdef HAVE_XCURSES
19883 #include <xcurses.h>
19884 char * XCursesProgramName = "test";
19885 #else
19886 #include <${cf_cv_ncurses_header:-curses.h}>
19887 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19888 #include <ncursesw/term.h>
19889 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19890 #include <ncurses/term.h>
19891 #elif defined(HAVE_TERM_H)
19892 #include <term.h>
19893 #endif
19894 #endif
19895
19896 extern char $cf_data;
19897 int
19898 main (void)
19899 {
19900
19901         do {
19902
19903 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19904         const void *foo = (const void *)($cf_data);
19905 #else
19906         const void *foo = &($cf_data);
19907 #endif
19908         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19909
19910                 ${cf_cv_main_return:-return}(foo == 0);
19911         } while (0)
19912
19913   ;
19914   return 0;
19915 }
19916 _ACEOF
19917 rm -f conftest.$ac_objext conftest$ac_exeext
19918 if { (eval echo "$as_me:19918: \"$ac_link\"") >&5
19919   (eval $ac_link) 2>&5
19920   ac_status=$?
19921   echo "$as_me:19921: \$? = $ac_status" >&5
19922   (exit $ac_status); } &&
19923          { ac_try='test -s conftest$ac_exeext'
19924   { (eval echo "$as_me:19924: \"$ac_try\"") >&5
19925   (eval $ac_try) 2>&5
19926   ac_status=$?
19927   echo "$as_me:19927: \$? = $ac_status" >&5
19928   (exit $ac_status); }; }; then
19929   cf_result=yes
19930 else
19931   echo "$as_me: failed program was:" >&5
19932 cat conftest.$ac_ext >&5
19933 cf_result=no
19934 fi
19935 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19936
19937 else
19938   cat >conftest.$ac_ext <<_ACEOF
19939 #line 19939 "configure"
19940 #include "confdefs.h"
19941
19942 #ifdef HAVE_XCURSES
19943 #include <xcurses.h>
19944 char * XCursesProgramName = "test";
19945 #else
19946 #include <${cf_cv_ncurses_header:-curses.h}>
19947 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19948 #include <ncursesw/term.h>
19949 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19950 #include <ncurses/term.h>
19951 #elif defined(HAVE_TERM_H)
19952 #include <term.h>
19953 #endif
19954 #endif
19955
19956 extern char $cf_data;
19957 int main(void)
19958 {
19959
19960 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19961         const void *foo = (const void *)($cf_data);
19962 #else
19963         const void *foo = &($cf_data);
19964 #endif
19965         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19966
19967         ${cf_cv_main_return:-return}(foo == 0);
19968 }
19969 _ACEOF
19970 rm -f conftest$ac_exeext
19971 if { (eval echo "$as_me:19971: \"$ac_link\"") >&5
19972   (eval $ac_link) 2>&5
19973   ac_status=$?
19974   echo "$as_me:19974: \$? = $ac_status" >&5
19975   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19976   { (eval echo "$as_me:19976: \"$ac_try\"") >&5
19977   (eval $ac_try) 2>&5
19978   ac_status=$?
19979   echo "$as_me:19979: \$? = $ac_status" >&5
19980   (exit $ac_status); }; }; then
19981   cf_result=yes
19982
19983 else
19984   echo "$as_me: program exited with status $ac_status" >&5
19985 echo "$as_me: failed program was:" >&5
19986 cat conftest.$ac_ext >&5
19987 cf_result=no
19988 fi
19989 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19990 fi
19991         echo "$as_me:19991: result: $cf_result" >&5
19992 echo "${ECHO_T}$cf_result" >&6
19993         if test $cf_result = yes ; then
19994
19995 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19996
19997                 cat >>confdefs.h <<EOF
19998 #define $cf_result 1
19999 EOF
20000
20001                 # do not exit loop here, since we prefer system's declarations
20002         fi
20003 fi
20004 done
20005
20006 if ( test "$GCC" = yes || test "$GXX" = yes )
20007 then
20008 echo "$as_me:20008: checking if you want to turn on gcc warnings" >&5
20009 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
20010
20011 # Check whether --enable-warnings or --disable-warnings was given.
20012 if test "${enable_warnings+set}" = set; then
20013   enableval="$enable_warnings"
20014   test "$enableval" != yes && enableval=no
20015         if test "$enableval" != "no" ; then
20016     with_warnings=yes
20017         else
20018                 with_warnings=no
20019         fi
20020 else
20021   enableval=no
20022         with_warnings=no
20023
20024 fi;
20025 echo "$as_me:20025: result: $with_warnings" >&5
20026 echo "${ECHO_T}$with_warnings" >&6
20027 if test "$with_warnings" = "yes"
20028 then
20029
20030 if test "$GCC" = yes
20031 then
20032 cat > conftest.i <<EOF
20033 #ifndef GCC_PRINTF
20034 #define GCC_PRINTF 0
20035 #endif
20036 #ifndef GCC_SCANF
20037 #define GCC_SCANF 0
20038 #endif
20039 #ifndef GCC_NORETURN
20040 #define GCC_NORETURN /* nothing */
20041 #endif
20042 #ifndef GCC_UNUSED
20043 #define GCC_UNUSED /* nothing */
20044 #endif
20045 EOF
20046 if test "$GCC" = yes
20047 then
20048         { echo "$as_me:20048: checking for $CC __attribute__ directives..." >&5
20049 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
20050 cat > conftest.$ac_ext <<EOF
20051 #line 20051 "${as_me:-configure}"
20052 #include "confdefs.h"
20053 #include "conftest.h"
20054 #include "conftest.i"
20055 #if     GCC_PRINTF
20056 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
20057 #else
20058 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
20059 #endif
20060 #if     GCC_SCANF
20061 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
20062 #else
20063 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
20064 #endif
20065 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
20066 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
20067 extern void foo(void) GCC_NORETURN;
20068 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
20069 EOF
20070         cf_printf_attribute=no
20071         cf_scanf_attribute=no
20072         for cf_attribute in scanf printf unused noreturn
20073         do
20074
20075 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20076
20077                 cf_directive="__attribute__(($cf_attribute))"
20078                 echo "checking for $CC $cf_directive" 1>&5
20079
20080                 case $cf_attribute in
20081                 (printf)
20082                         cf_printf_attribute=yes
20083                         cat >conftest.h <<EOF
20084 #define GCC_$cf_ATTRIBUTE 1
20085 EOF
20086                         ;;
20087                 (scanf)
20088                         cf_scanf_attribute=yes
20089                         cat >conftest.h <<EOF
20090 #define GCC_$cf_ATTRIBUTE 1
20091 EOF
20092                         ;;
20093                 (*)
20094                         cat >conftest.h <<EOF
20095 #define GCC_$cf_ATTRIBUTE $cf_directive
20096 EOF
20097                         ;;
20098                 esac
20099
20100                 if { (eval echo "$as_me:20100: \"$ac_compile\"") >&5
20101   (eval $ac_compile) 2>&5
20102   ac_status=$?
20103   echo "$as_me:20103: \$? = $ac_status" >&5
20104   (exit $ac_status); }; then
20105                         test -n "$verbose" && echo "$as_me:20105: result: ... $cf_attribute" >&5
20106 echo "${ECHO_T}... $cf_attribute" >&6
20107                         cat conftest.h >>confdefs.h
20108                         case $cf_attribute in
20109                         (noreturn)
20110
20111 cat >>confdefs.h <<EOF
20112 #define GCC_NORETURN $cf_directive
20113 EOF
20114
20115                                 ;;
20116                         (printf)
20117                                 cf_value='/* nothing */'
20118                                 if test "$cf_printf_attribute" != no ; then
20119                                         cf_value='__attribute__((format(printf,fmt,var)))'
20120
20121 cat >>confdefs.h <<\EOF
20122 #define GCC_PRINTF 1
20123 EOF
20124
20125                                 fi
20126
20127 cat >>confdefs.h <<EOF
20128 #define GCC_PRINTFLIKE(fmt,var) $cf_value
20129 EOF
20130
20131                                 ;;
20132                         (scanf)
20133                                 cf_value='/* nothing */'
20134                                 if test "$cf_scanf_attribute" != no ; then
20135                                         cf_value='__attribute__((format(scanf,fmt,var)))'
20136
20137 cat >>confdefs.h <<\EOF
20138 #define GCC_SCANF 1
20139 EOF
20140
20141                                 fi
20142
20143 cat >>confdefs.h <<EOF
20144 #define GCC_SCANFLIKE(fmt,var) $cf_value
20145 EOF
20146
20147                                 ;;
20148                         (unused)
20149
20150 cat >>confdefs.h <<EOF
20151 #define GCC_UNUSED $cf_directive
20152 EOF
20153
20154                                 ;;
20155                         esac
20156                 fi
20157         done
20158 else
20159         fgrep define conftest.i >>confdefs.h
20160 fi
20161 rm -rf conftest*
20162 fi
20163
20164 if test "x$have_x" = xyes; then
20165
20166 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
20167 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
20168 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
20169 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
20170 for cf_X_CFLAGS in $X_CFLAGS
20171 do
20172         case "x$cf_X_CFLAGS" in
20173         x-[IUD]*)
20174                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
20175                 ;;
20176         *)
20177                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
20178                 ;;
20179         esac
20180 done
20181
20182 cat >conftest.$ac_ext <<_ACEOF
20183 #line 20183 "configure"
20184 #include "confdefs.h"
20185
20186 #include <stdlib.h>
20187 #include <X11/Intrinsic.h>
20188
20189 int
20190 main (void)
20191 {
20192 String foo = malloc(1)
20193   ;
20194   return 0;
20195 }
20196 _ACEOF
20197 rm -f conftest.$ac_objext
20198 if { (eval echo "$as_me:20198: \"$ac_compile\"") >&5
20199   (eval $ac_compile) 2>&5
20200   ac_status=$?
20201   echo "$as_me:20201: \$? = $ac_status" >&5
20202   (exit $ac_status); } &&
20203          { ac_try='test -s conftest.$ac_objext'
20204   { (eval echo "$as_me:20204: \"$ac_try\"") >&5
20205   (eval $ac_try) 2>&5
20206   ac_status=$?
20207   echo "$as_me:20207: \$? = $ac_status" >&5
20208   (exit $ac_status); }; }; then
20209
20210 echo "$as_me:20210: checking for X11/Xt const-feature" >&5
20211 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
20212 if test "${cf_cv_const_x_string+set}" = set; then
20213   echo $ECHO_N "(cached) $ECHO_C" >&6
20214 else
20215
20216         cat >conftest.$ac_ext <<_ACEOF
20217 #line 20217 "configure"
20218 #include "confdefs.h"
20219
20220 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
20221 #undef  XTSTRINGDEFINES /* X11R5 and later */
20222 #include <stdlib.h>
20223 #include <X11/Intrinsic.h>
20224
20225 int
20226 main (void)
20227 {
20228 String foo = malloc(1); *foo = 0
20229   ;
20230   return 0;
20231 }
20232 _ACEOF
20233 rm -f conftest.$ac_objext
20234 if { (eval echo "$as_me:20234: \"$ac_compile\"") >&5
20235   (eval $ac_compile) 2>&5
20236   ac_status=$?
20237   echo "$as_me:20237: \$? = $ac_status" >&5
20238   (exit $ac_status); } &&
20239          { ac_try='test -s conftest.$ac_objext'
20240   { (eval echo "$as_me:20240: \"$ac_try\"") >&5
20241   (eval $ac_try) 2>&5
20242   ac_status=$?
20243   echo "$as_me:20243: \$? = $ac_status" >&5
20244   (exit $ac_status); }; }; then
20245
20246                         cf_cv_const_x_string=no
20247
20248 else
20249   echo "$as_me: failed program was:" >&5
20250 cat conftest.$ac_ext >&5
20251
20252                         cf_cv_const_x_string=yes
20253
20254 fi
20255 rm -f conftest.$ac_objext conftest.$ac_ext
20256
20257 fi
20258 echo "$as_me:20258: result: $cf_cv_const_x_string" >&5
20259 echo "${ECHO_T}$cf_cv_const_x_string" >&6
20260
20261 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
20262 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
20263 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
20264
20265 case $cf_cv_const_x_string in
20266 (no)
20267
20268         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20269         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
20270
20271         ;;
20272 (*)
20273
20274         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20275         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
20276
20277         ;;
20278 esac
20279
20280 else
20281   echo "$as_me: failed program was:" >&5
20282 cat conftest.$ac_ext >&5
20283 fi
20284 rm -f conftest.$ac_objext conftest.$ac_ext
20285  fi
20286 cat > conftest.$ac_ext <<EOF
20287 #line 20287 "${as_me:-configure}"
20288 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
20289 EOF
20290 if test "$INTEL_COMPILER" = yes
20291 then
20292 # The "-wdXXX" options suppress warnings:
20293 # remark #1419: external declaration in primary source file
20294 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
20295 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
20296 # remark #193: zero used for undefined preprocessing identifier
20297 # remark #593: variable "curs_sb_left_arrow" was set but never used
20298 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
20299 # remark #869: parameter "tw" was never referenced
20300 # remark #981: operands are evaluated in unspecified order
20301 # warning #279: controlling expression is constant
20302
20303         { echo "$as_me:20303: checking for $CC warning options..." >&5
20304 echo "$as_me: checking for $CC warning options..." >&6;}
20305         cf_save_CFLAGS="$CFLAGS"
20306         EXTRA_CFLAGS="-Wall"
20307         for cf_opt in \
20308                 wd1419 \
20309                 wd1683 \
20310                 wd1684 \
20311                 wd193 \
20312                 wd593 \
20313                 wd279 \
20314                 wd810 \
20315                 wd869 \
20316                 wd981
20317         do
20318                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
20319                 if { (eval echo "$as_me:20319: \"$ac_compile\"") >&5
20320   (eval $ac_compile) 2>&5
20321   ac_status=$?
20322   echo "$as_me:20322: \$? = $ac_status" >&5
20323   (exit $ac_status); }; then
20324                         test -n "$verbose" && echo "$as_me:20324: result: ... -$cf_opt" >&5
20325 echo "${ECHO_T}... -$cf_opt" >&6
20326                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
20327                 fi
20328         done
20329         CFLAGS="$cf_save_CFLAGS"
20330 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
20331 then
20332         { echo "$as_me:20332: checking for $CC warning options..." >&5
20333 echo "$as_me: checking for $CC warning options..." >&6;}
20334         cf_save_CFLAGS="$CFLAGS"
20335         EXTRA_CFLAGS=
20336         cf_warn_CONST=""
20337         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
20338         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
20339         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
20340         for cf_opt in W Wall \
20341                 Wbad-function-cast \
20342                 Wcast-align \
20343                 Wcast-qual \
20344                 Wdeclaration-after-statement \
20345                 Wextra \
20346                 Winline \
20347                 Wmissing-declarations \
20348                 Wmissing-prototypes \
20349                 Wnested-externs \
20350                 Wpointer-arith \
20351                 Wshadow \
20352                 Wstrict-prototypes \
20353                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
20354         do
20355                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
20356                 if { (eval echo "$as_me:20356: \"$ac_compile\"") >&5
20357   (eval $ac_compile) 2>&5
20358   ac_status=$?
20359   echo "$as_me:20359: \$? = $ac_status" >&5
20360   (exit $ac_status); }; then
20361                         test -n "$verbose" && echo "$as_me:20361: result: ... -$cf_opt" >&5
20362 echo "${ECHO_T}... -$cf_opt" >&6
20363                         case $cf_opt in
20364                         (Winline)
20365                                 case $GCC_VERSION in
20366                                 ([34].*)
20367                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
20368
20369 echo "${as_me:-configure}:20369: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
20370
20371                                         continue;;
20372                                 esac
20373                                 ;;
20374                         (Wpointer-arith)
20375                                 case $GCC_VERSION in
20376                                 ([12].*)
20377                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
20378
20379 echo "${as_me:-configure}:20379: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
20380
20381                                         continue;;
20382                                 esac
20383                                 ;;
20384                         esac
20385                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
20386                 fi
20387         done
20388         CFLAGS="$cf_save_CFLAGS"
20389 fi
20390 rm -rf conftest*
20391
20392 fi
20393 fi
20394
20395 echo "$as_me:20395: checking if you want to use dmalloc for testing" >&5
20396 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
20397
20398 # Check whether --with-dmalloc or --without-dmalloc was given.
20399 if test "${with_dmalloc+set}" = set; then
20400   withval="$with_dmalloc"
20401
20402 cat >>confdefs.h <<EOF
20403 #define USE_DMALLOC 1
20404 EOF
20405
20406         : ${with_cflags:=-g}
20407         : ${with_no_leaks:=yes}
20408          with_dmalloc=yes
20409 else
20410   with_dmalloc=
20411 fi;
20412 echo "$as_me:20412: result: ${with_dmalloc:-no}" >&5
20413 echo "${ECHO_T}${with_dmalloc:-no}" >&6
20414
20415 case .$with_cflags in
20416 (.*-g*)
20417         case .$CFLAGS in
20418         (.*-g*)
20419                 ;;
20420         (*)
20421
20422 cf_fix_cppflags=no
20423 cf_new_cflags=
20424 cf_new_cppflags=
20425 cf_new_extra_cppflags=
20426
20427 for cf_add_cflags in -g
20428 do
20429 case $cf_fix_cppflags in
20430 (no)
20431         case $cf_add_cflags in
20432         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20433                 case $cf_add_cflags in
20434                 (-D*)
20435                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20436
20437                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20438                                 && test -z "${cf_tst_cflags}" \
20439                                 && cf_fix_cppflags=yes
20440
20441                         if test $cf_fix_cppflags = yes ; then
20442
20443         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20444         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20445
20446                                 continue
20447                         elif test "${cf_tst_cflags}" = "\"'" ; then
20448
20449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20451
20452                                 continue
20453                         fi
20454                         ;;
20455                 esac
20456                 case "$CPPFLAGS" in
20457                 (*$cf_add_cflags)
20458                         ;;
20459                 (*)
20460                         case $cf_add_cflags in
20461                         (-D*)
20462                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20463
20464 CPPFLAGS=`echo "$CPPFLAGS" | \
20465         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20466                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20467
20468                                 ;;
20469                         esac
20470
20471         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20472         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20473
20474                         ;;
20475                 esac
20476                 ;;
20477         (*)
20478
20479         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20480         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20481
20482                 ;;
20483         esac
20484         ;;
20485 (yes)
20486
20487         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20488         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20489
20490         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20491
20492         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20493                 && test -z "${cf_tst_cflags}" \
20494                 && cf_fix_cppflags=no
20495         ;;
20496 esac
20497 done
20498
20499 if test -n "$cf_new_cflags" ; then
20500
20501         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20502         CFLAGS="${CFLAGS}$cf_new_cflags"
20503
20504 fi
20505
20506 if test -n "$cf_new_cppflags" ; then
20507
20508         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20509         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20510
20511 fi
20512
20513 if test -n "$cf_new_extra_cppflags" ; then
20514
20515         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20516         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20517
20518 fi
20519
20520                 ;;
20521         esac
20522         ;;
20523 esac
20524
20525 if test "$with_dmalloc" = yes ; then
20526         echo "$as_me:20526: checking for dmalloc.h" >&5
20527 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
20528 if test "${ac_cv_header_dmalloc_h+set}" = set; then
20529   echo $ECHO_N "(cached) $ECHO_C" >&6
20530 else
20531   cat >conftest.$ac_ext <<_ACEOF
20532 #line 20532 "configure"
20533 #include "confdefs.h"
20534 #include <dmalloc.h>
20535 _ACEOF
20536 if { (eval echo "$as_me:20536: \"$ac_cpp conftest.$ac_ext\"") >&5
20537   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20538   ac_status=$?
20539   egrep -v '^ *\+' conftest.er1 >conftest.err
20540   rm -f conftest.er1
20541   cat conftest.err >&5
20542   echo "$as_me:20542: \$? = $ac_status" >&5
20543   (exit $ac_status); } >/dev/null; then
20544   if test -s conftest.err; then
20545     ac_cpp_err=$ac_c_preproc_warn_flag
20546   else
20547     ac_cpp_err=
20548   fi
20549 else
20550   ac_cpp_err=yes
20551 fi
20552 if test -z "$ac_cpp_err"; then
20553   ac_cv_header_dmalloc_h=yes
20554 else
20555   echo "$as_me: failed program was:" >&5
20556   cat conftest.$ac_ext >&5
20557   ac_cv_header_dmalloc_h=no
20558 fi
20559 rm -f conftest.err conftest.$ac_ext
20560 fi
20561 echo "$as_me:20561: result: $ac_cv_header_dmalloc_h" >&5
20562 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
20563 if test $ac_cv_header_dmalloc_h = yes; then
20564
20565 echo "$as_me:20565: checking for dmalloc_debug in -ldmalloc" >&5
20566 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
20567 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
20568   echo $ECHO_N "(cached) $ECHO_C" >&6
20569 else
20570   ac_check_lib_save_LIBS=$LIBS
20571 LIBS="-ldmalloc  $LIBS"
20572 cat >conftest.$ac_ext <<_ACEOF
20573 #line 20573 "configure"
20574 #include "confdefs.h"
20575
20576 /* Override any gcc2 internal prototype to avoid an error.  */
20577 #ifdef __cplusplus
20578 extern "C"
20579 #endif
20580 /* We use char because int might match the return type of a gcc2
20581    builtin and then its argument prototype would still apply.  */
20582 char dmalloc_debug ();
20583 int
20584 main (void)
20585 {
20586 dmalloc_debug ();
20587   ;
20588   return 0;
20589 }
20590 _ACEOF
20591 rm -f conftest.$ac_objext conftest$ac_exeext
20592 if { (eval echo "$as_me:20592: \"$ac_link\"") >&5
20593   (eval $ac_link) 2>&5
20594   ac_status=$?
20595   echo "$as_me:20595: \$? = $ac_status" >&5
20596   (exit $ac_status); } &&
20597          { ac_try='test -s conftest$ac_exeext'
20598   { (eval echo "$as_me:20598: \"$ac_try\"") >&5
20599   (eval $ac_try) 2>&5
20600   ac_status=$?
20601   echo "$as_me:20601: \$? = $ac_status" >&5
20602   (exit $ac_status); }; }; then
20603   ac_cv_lib_dmalloc_dmalloc_debug=yes
20604 else
20605   echo "$as_me: failed program was:" >&5
20606 cat conftest.$ac_ext >&5
20607 ac_cv_lib_dmalloc_dmalloc_debug=no
20608 fi
20609 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20610 LIBS=$ac_check_lib_save_LIBS
20611 fi
20612 echo "$as_me:20612: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
20613 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
20614 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
20615   cat >>confdefs.h <<EOF
20616 #define HAVE_LIBDMALLOC 1
20617 EOF
20618
20619   LIBS="-ldmalloc $LIBS"
20620
20621 fi
20622
20623 fi
20624
20625 fi
20626
20627 echo "$as_me:20627: checking if you want to use dbmalloc for testing" >&5
20628 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
20629
20630 # Check whether --with-dbmalloc or --without-dbmalloc was given.
20631 if test "${with_dbmalloc+set}" = set; then
20632   withval="$with_dbmalloc"
20633
20634 cat >>confdefs.h <<EOF
20635 #define USE_DBMALLOC 1
20636 EOF
20637
20638         : ${with_cflags:=-g}
20639         : ${with_no_leaks:=yes}
20640          with_dbmalloc=yes
20641 else
20642   with_dbmalloc=
20643 fi;
20644 echo "$as_me:20644: result: ${with_dbmalloc:-no}" >&5
20645 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
20646
20647 case .$with_cflags in
20648 (.*-g*)
20649         case .$CFLAGS in
20650         (.*-g*)
20651                 ;;
20652         (*)
20653
20654 cf_fix_cppflags=no
20655 cf_new_cflags=
20656 cf_new_cppflags=
20657 cf_new_extra_cppflags=
20658
20659 for cf_add_cflags in -g
20660 do
20661 case $cf_fix_cppflags in
20662 (no)
20663         case $cf_add_cflags in
20664         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20665                 case $cf_add_cflags in
20666                 (-D*)
20667                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20668
20669                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20670                                 && test -z "${cf_tst_cflags}" \
20671                                 && cf_fix_cppflags=yes
20672
20673                         if test $cf_fix_cppflags = yes ; then
20674
20675         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20676         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20677
20678                                 continue
20679                         elif test "${cf_tst_cflags}" = "\"'" ; then
20680
20681         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20682         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20683
20684                                 continue
20685                         fi
20686                         ;;
20687                 esac
20688                 case "$CPPFLAGS" in
20689                 (*$cf_add_cflags)
20690                         ;;
20691                 (*)
20692                         case $cf_add_cflags in
20693                         (-D*)
20694                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20695
20696 CPPFLAGS=`echo "$CPPFLAGS" | \
20697         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20698                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20699
20700                                 ;;
20701                         esac
20702
20703         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20704         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20705
20706                         ;;
20707                 esac
20708                 ;;
20709         (*)
20710
20711         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20712         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20713
20714                 ;;
20715         esac
20716         ;;
20717 (yes)
20718
20719         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20720         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20721
20722         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20723
20724         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20725                 && test -z "${cf_tst_cflags}" \
20726                 && cf_fix_cppflags=no
20727         ;;
20728 esac
20729 done
20730
20731 if test -n "$cf_new_cflags" ; then
20732
20733         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20734         CFLAGS="${CFLAGS}$cf_new_cflags"
20735
20736 fi
20737
20738 if test -n "$cf_new_cppflags" ; then
20739
20740         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20741         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20742
20743 fi
20744
20745 if test -n "$cf_new_extra_cppflags" ; then
20746
20747         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20748         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20749
20750 fi
20751
20752                 ;;
20753         esac
20754         ;;
20755 esac
20756
20757 if test "$with_dbmalloc" = yes ; then
20758         echo "$as_me:20758: checking for dbmalloc.h" >&5
20759 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
20760 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
20761   echo $ECHO_N "(cached) $ECHO_C" >&6
20762 else
20763   cat >conftest.$ac_ext <<_ACEOF
20764 #line 20764 "configure"
20765 #include "confdefs.h"
20766 #include <dbmalloc.h>
20767 _ACEOF
20768 if { (eval echo "$as_me:20768: \"$ac_cpp conftest.$ac_ext\"") >&5
20769   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20770   ac_status=$?
20771   egrep -v '^ *\+' conftest.er1 >conftest.err
20772   rm -f conftest.er1
20773   cat conftest.err >&5
20774   echo "$as_me:20774: \$? = $ac_status" >&5
20775   (exit $ac_status); } >/dev/null; then
20776   if test -s conftest.err; then
20777     ac_cpp_err=$ac_c_preproc_warn_flag
20778   else
20779     ac_cpp_err=
20780   fi
20781 else
20782   ac_cpp_err=yes
20783 fi
20784 if test -z "$ac_cpp_err"; then
20785   ac_cv_header_dbmalloc_h=yes
20786 else
20787   echo "$as_me: failed program was:" >&5
20788   cat conftest.$ac_ext >&5
20789   ac_cv_header_dbmalloc_h=no
20790 fi
20791 rm -f conftest.err conftest.$ac_ext
20792 fi
20793 echo "$as_me:20793: result: $ac_cv_header_dbmalloc_h" >&5
20794 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
20795 if test $ac_cv_header_dbmalloc_h = yes; then
20796
20797 echo "$as_me:20797: checking for debug_malloc in -ldbmalloc" >&5
20798 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
20799 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
20800   echo $ECHO_N "(cached) $ECHO_C" >&6
20801 else
20802   ac_check_lib_save_LIBS=$LIBS
20803 LIBS="-ldbmalloc  $LIBS"
20804 cat >conftest.$ac_ext <<_ACEOF
20805 #line 20805 "configure"
20806 #include "confdefs.h"
20807
20808 /* Override any gcc2 internal prototype to avoid an error.  */
20809 #ifdef __cplusplus
20810 extern "C"
20811 #endif
20812 /* We use char because int might match the return type of a gcc2
20813    builtin and then its argument prototype would still apply.  */
20814 char debug_malloc ();
20815 int
20816 main (void)
20817 {
20818 debug_malloc ();
20819   ;
20820   return 0;
20821 }
20822 _ACEOF
20823 rm -f conftest.$ac_objext conftest$ac_exeext
20824 if { (eval echo "$as_me:20824: \"$ac_link\"") >&5
20825   (eval $ac_link) 2>&5
20826   ac_status=$?
20827   echo "$as_me:20827: \$? = $ac_status" >&5
20828   (exit $ac_status); } &&
20829          { ac_try='test -s conftest$ac_exeext'
20830   { (eval echo "$as_me:20830: \"$ac_try\"") >&5
20831   (eval $ac_try) 2>&5
20832   ac_status=$?
20833   echo "$as_me:20833: \$? = $ac_status" >&5
20834   (exit $ac_status); }; }; then
20835   ac_cv_lib_dbmalloc_debug_malloc=yes
20836 else
20837   echo "$as_me: failed program was:" >&5
20838 cat conftest.$ac_ext >&5
20839 ac_cv_lib_dbmalloc_debug_malloc=no
20840 fi
20841 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20842 LIBS=$ac_check_lib_save_LIBS
20843 fi
20844 echo "$as_me:20844: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
20845 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
20846 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
20847   cat >>confdefs.h <<EOF
20848 #define HAVE_LIBDBMALLOC 1
20849 EOF
20850
20851   LIBS="-ldbmalloc $LIBS"
20852
20853 fi
20854
20855 fi
20856
20857 fi
20858
20859 echo "$as_me:20859: checking if you want to use valgrind for testing" >&5
20860 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
20861
20862 # Check whether --with-valgrind or --without-valgrind was given.
20863 if test "${with_valgrind+set}" = set; then
20864   withval="$with_valgrind"
20865
20866 cat >>confdefs.h <<EOF
20867 #define USE_VALGRIND 1
20868 EOF
20869
20870         : ${with_cflags:=-g}
20871         : ${with_no_leaks:=yes}
20872          with_valgrind=yes
20873 else
20874   with_valgrind=
20875 fi;
20876 echo "$as_me:20876: result: ${with_valgrind:-no}" >&5
20877 echo "${ECHO_T}${with_valgrind:-no}" >&6
20878
20879 case .$with_cflags in
20880 (.*-g*)
20881         case .$CFLAGS in
20882         (.*-g*)
20883                 ;;
20884         (*)
20885
20886 cf_fix_cppflags=no
20887 cf_new_cflags=
20888 cf_new_cppflags=
20889 cf_new_extra_cppflags=
20890
20891 for cf_add_cflags in -g
20892 do
20893 case $cf_fix_cppflags in
20894 (no)
20895         case $cf_add_cflags in
20896         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20897                 case $cf_add_cflags in
20898                 (-D*)
20899                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20900
20901                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20902                                 && test -z "${cf_tst_cflags}" \
20903                                 && cf_fix_cppflags=yes
20904
20905                         if test $cf_fix_cppflags = yes ; then
20906
20907         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20908         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20909
20910                                 continue
20911                         elif test "${cf_tst_cflags}" = "\"'" ; then
20912
20913         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20914         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20915
20916                                 continue
20917                         fi
20918                         ;;
20919                 esac
20920                 case "$CPPFLAGS" in
20921                 (*$cf_add_cflags)
20922                         ;;
20923                 (*)
20924                         case $cf_add_cflags in
20925                         (-D*)
20926                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20927
20928 CPPFLAGS=`echo "$CPPFLAGS" | \
20929         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20930                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20931
20932                                 ;;
20933                         esac
20934
20935         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20936         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20937
20938                         ;;
20939                 esac
20940                 ;;
20941         (*)
20942
20943         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20944         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20945
20946                 ;;
20947         esac
20948         ;;
20949 (yes)
20950
20951         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20952         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20953
20954         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20955
20956         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20957                 && test -z "${cf_tst_cflags}" \
20958                 && cf_fix_cppflags=no
20959         ;;
20960 esac
20961 done
20962
20963 if test -n "$cf_new_cflags" ; then
20964
20965         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20966         CFLAGS="${CFLAGS}$cf_new_cflags"
20967
20968 fi
20969
20970 if test -n "$cf_new_cppflags" ; then
20971
20972         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20973         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20974
20975 fi
20976
20977 if test -n "$cf_new_extra_cppflags" ; then
20978
20979         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20980         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20981
20982 fi
20983
20984                 ;;
20985         esac
20986         ;;
20987 esac
20988
20989 echo "$as_me:20989: checking if you want to perform memory-leak testing" >&5
20990 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
20991
20992 # Check whether --enable-leaks or --disable-leaks was given.
20993 if test "${enable_leaks+set}" = set; then
20994   enableval="$enable_leaks"
20995   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
20996 else
20997   : ${with_no_leaks:=no}
20998 fi;
20999 echo "$as_me:20999: result: $with_no_leaks" >&5
21000 echo "${ECHO_T}$with_no_leaks" >&6
21001
21002 if test "$with_no_leaks" = yes ; then
21003
21004 cat >>confdefs.h <<\EOF
21005 #define NO_LEAKS 1
21006 EOF
21007
21008 cat >>confdefs.h <<\EOF
21009 #define YY_NO_LEAKS 1
21010 EOF
21011
21012 fi
21013
21014 LD_RPATH_OPT=
21015 if test "x$cf_cv_enable_rpath" != xno
21016 then
21017         echo "$as_me:21017: checking for an rpath option" >&5
21018 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
21019         case $cf_cv_system_name in
21020         (irix*)
21021                 if test "$GCC" = yes; then
21022                         LD_RPATH_OPT="-Wl,-rpath,"
21023                 else
21024                         LD_RPATH_OPT="-rpath "
21025                 fi
21026                 ;;
21027         (linux*|gnu*|k*bsd*-gnu|freebsd*)
21028                 LD_RPATH_OPT="-Wl,-rpath,"
21029                 ;;
21030         (openbsd[2-9].*|mirbsd*)
21031                 LD_RPATH_OPT="-Wl,-rpath,"
21032                 ;;
21033         (dragonfly*)
21034                 LD_RPATH_OPT="-rpath "
21035                 ;;
21036         (netbsd*)
21037                 LD_RPATH_OPT="-Wl,-rpath,"
21038                 ;;
21039         (osf*|mls+*)
21040                 LD_RPATH_OPT="-rpath "
21041                 ;;
21042         (solaris2*)
21043                 LD_RPATH_OPT="-R"
21044                 ;;
21045         (*)
21046                 ;;
21047         esac
21048         echo "$as_me:21048: result: $LD_RPATH_OPT" >&5
21049 echo "${ECHO_T}$LD_RPATH_OPT" >&6
21050
21051         case "x$LD_RPATH_OPT" in
21052         (x-R*)
21053                 echo "$as_me:21053: checking if we need a space after rpath option" >&5
21054 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
21055                 cf_save_LIBS="$LIBS"
21056
21057 cf_add_libs="$LIBS"
21058 # reverse order
21059 cf_add_0lib=
21060 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
21061 # filter duplicates
21062 for cf_add_1lib in $cf_add_0lib; do
21063         for cf_add_2lib in $cf_add_libs; do
21064                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
21065                         cf_add_1lib=
21066                         break
21067                 fi
21068         done
21069         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
21070 done
21071 LIBS="$cf_add_libs"
21072
21073                 cat >conftest.$ac_ext <<_ACEOF
21074 #line 21074 "configure"
21075 #include "confdefs.h"
21076
21077 int
21078 main (void)
21079 {
21080
21081   ;
21082   return 0;
21083 }
21084 _ACEOF
21085 rm -f conftest.$ac_objext conftest$ac_exeext
21086 if { (eval echo "$as_me:21086: \"$ac_link\"") >&5
21087   (eval $ac_link) 2>&5
21088   ac_status=$?
21089   echo "$as_me:21089: \$? = $ac_status" >&5
21090   (exit $ac_status); } &&
21091          { ac_try='test -s conftest$ac_exeext'
21092   { (eval echo "$as_me:21092: \"$ac_try\"") >&5
21093   (eval $ac_try) 2>&5
21094   ac_status=$?
21095   echo "$as_me:21095: \$? = $ac_status" >&5
21096   (exit $ac_status); }; }; then
21097   cf_rpath_space=no
21098 else
21099   echo "$as_me: failed program was:" >&5
21100 cat conftest.$ac_ext >&5
21101 cf_rpath_space=yes
21102 fi
21103 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21104                 LIBS="$cf_save_LIBS"
21105                 echo "$as_me:21105: result: $cf_rpath_space" >&5
21106 echo "${ECHO_T}$cf_rpath_space" >&6
21107                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
21108                 ;;
21109         esac
21110 fi
21111
21112 echo "$as_me:21112: checking if rpath-hack should be disabled" >&5
21113 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
21114
21115 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
21116 if test "${enable_rpath_hack+set}" = set; then
21117   enableval="$enable_rpath_hack"
21118   test "$enableval" != no && enableval=yes
21119         if test "$enableval" != "yes" ; then
21120     cf_disable_rpath_hack=yes
21121         else
21122                 cf_disable_rpath_hack=no
21123         fi
21124 else
21125   enableval=yes
21126         cf_disable_rpath_hack=no
21127
21128 fi;
21129 echo "$as_me:21129: result: $cf_disable_rpath_hack" >&5
21130 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
21131 if test "$cf_disable_rpath_hack" = no ; then
21132
21133 echo "$as_me:21133: checking for updated LDFLAGS" >&5
21134 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
21135 if test -n "$LD_RPATH_OPT" ; then
21136         echo "$as_me:21136: result: maybe" >&5
21137 echo "${ECHO_T}maybe" >&6
21138
21139         for ac_prog in ldd
21140 do
21141   # Extract the first word of "$ac_prog", so it can be a program name with args.
21142 set dummy $ac_prog; ac_word=$2
21143 echo "$as_me:21143: checking for $ac_word" >&5
21144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
21145 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
21146   echo $ECHO_N "(cached) $ECHO_C" >&6
21147 else
21148   if test -n "$cf_ldd_prog"; then
21149   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
21150 else
21151   ac_save_IFS=$IFS; IFS=$ac_path_separator
21152 ac_dummy="$PATH"
21153 for ac_dir in $ac_dummy; do
21154   IFS=$ac_save_IFS
21155   test -z "$ac_dir" && ac_dir=.
21156   $as_executable_p "$ac_dir/$ac_word" || continue
21157 ac_cv_prog_cf_ldd_prog="$ac_prog"
21158 echo "$as_me:21158: found $ac_dir/$ac_word" >&5
21159 break
21160 done
21161
21162 fi
21163 fi
21164 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
21165 if test -n "$cf_ldd_prog"; then
21166   echo "$as_me:21166: result: $cf_ldd_prog" >&5
21167 echo "${ECHO_T}$cf_ldd_prog" >&6
21168 else
21169   echo "$as_me:21169: result: no" >&5
21170 echo "${ECHO_T}no" >&6
21171 fi
21172
21173   test -n "$cf_ldd_prog" && break
21174 done
21175 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
21176
21177         cf_rpath_list="/usr/lib /lib"
21178         if test "$cf_ldd_prog" != no
21179         then
21180                 cf_rpath_oops=
21181
21182 cat >conftest.$ac_ext <<_ACEOF
21183 #line 21183 "configure"
21184 #include "confdefs.h"
21185 #include <stdio.h>
21186 int
21187 main (void)
21188 {
21189 printf("Hello");
21190   ;
21191   return 0;
21192 }
21193 _ACEOF
21194 rm -f conftest.$ac_objext conftest$ac_exeext
21195 if { (eval echo "$as_me:21195: \"$ac_link\"") >&5
21196   (eval $ac_link) 2>&5
21197   ac_status=$?
21198   echo "$as_me:21198: \$? = $ac_status" >&5
21199   (exit $ac_status); } &&
21200          { ac_try='test -s conftest$ac_exeext'
21201   { (eval echo "$as_me:21201: \"$ac_try\"") >&5
21202   (eval $ac_try) 2>&5
21203   ac_status=$?
21204   echo "$as_me:21204: \$? = $ac_status" >&5
21205   (exit $ac_status); }; }; then
21206   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
21207                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
21208 else
21209   echo "$as_me: failed program was:" >&5
21210 cat conftest.$ac_ext >&5
21211 fi
21212 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21213
21214                 # If we passed the link-test, but get a "not found" on a given library,
21215                 # this could be due to inept reconfiguration of gcc to make it only
21216                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
21217                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
21218                 # /usr/local libraries.
21219                 if test -n "$cf_rpath_oops"
21220                 then
21221                         for cf_rpath_src in $cf_rpath_oops
21222                         do
21223                                 for cf_rpath_dir in \
21224                                         /usr/local \
21225                                         /usr/pkg \
21226                                         /opt/sfw
21227                                 do
21228                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
21229                                         then
21230                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
21231
21232 echo "${as_me:-configure}:21232: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
21233
21234                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
21235                                                 break
21236                                         fi
21237                                 done
21238                         done
21239                 fi
21240         fi
21241
21242         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
21243
21244 echo "${as_me:-configure}:21244: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
21245
21246 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
21247
21248 echo "${as_me:-configure}:21248: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
21249
21250 cf_rpath_dst=
21251 for cf_rpath_src in $LDFLAGS
21252 do
21253         case $cf_rpath_src in
21254         (-L*)
21255
21256                 # check if this refers to a directory which we will ignore
21257                 cf_rpath_skip=no
21258                 if test -n "$cf_rpath_list"
21259                 then
21260                         for cf_rpath_item in $cf_rpath_list
21261                         do
21262                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
21263                                 then
21264                                         cf_rpath_skip=yes
21265                                         break
21266                                 fi
21267                         done
21268                 fi
21269
21270                 if test "$cf_rpath_skip" = no
21271                 then
21272                         # transform the option
21273                         if test "$LD_RPATH_OPT" = "-R " ; then
21274                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
21275                         else
21276                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
21277                         fi
21278
21279                         # if we have not already added this, add it now
21280                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
21281                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
21282                         then
21283                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
21284
21285 echo "${as_me:-configure}:21285: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
21286
21287                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
21288                         fi
21289                 fi
21290                 ;;
21291         esac
21292         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
21293 done
21294 LDFLAGS=$cf_rpath_dst
21295
21296 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
21297
21298 echo "${as_me:-configure}:21298: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
21299
21300 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
21301
21302 echo "${as_me:-configure}:21302: testing ...checking LIBS $LIBS ..." 1>&5
21303
21304 cf_rpath_dst=
21305 for cf_rpath_src in $LIBS
21306 do
21307         case $cf_rpath_src in
21308         (-L*)
21309
21310                 # check if this refers to a directory which we will ignore
21311                 cf_rpath_skip=no
21312                 if test -n "$cf_rpath_list"
21313                 then
21314                         for cf_rpath_item in $cf_rpath_list
21315                         do
21316                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
21317                                 then
21318                                         cf_rpath_skip=yes
21319                                         break
21320                                 fi
21321                         done
21322                 fi
21323
21324                 if test "$cf_rpath_skip" = no
21325                 then
21326                         # transform the option
21327                         if test "$LD_RPATH_OPT" = "-R " ; then
21328                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
21329                         else
21330                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
21331                         fi
21332
21333                         # if we have not already added this, add it now
21334                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
21335                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
21336                         then
21337                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
21338
21339 echo "${as_me:-configure}:21339: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
21340
21341                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
21342                         fi
21343                 fi
21344                 ;;
21345         esac
21346         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
21347 done
21348 LIBS=$cf_rpath_dst
21349
21350 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
21351
21352 echo "${as_me:-configure}:21352: testing ...checked LIBS $LIBS ..." 1>&5
21353
21354         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
21355
21356 echo "${as_me:-configure}:21356: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
21357
21358 else
21359         echo "$as_me:21359: result: no" >&5
21360 echo "${ECHO_T}no" >&6
21361 fi
21362
21363 fi
21364
21365 TEST_ARGS="$LIBS"
21366 LIBS=
21367
21368 ac_config_files="$ac_config_files Makefile"
21369 ac_config_commands="$ac_config_commands default"
21370 cat >confcache <<\_ACEOF
21371 # This file is a shell script that caches the results of configure
21372 # tests run on this system so they can be shared between configure
21373 # scripts and configure runs, see configure's option --config-cache.
21374 # It is not useful on other systems.  If it contains results you don't
21375 # want to keep, you may remove or edit it.
21376 #
21377 # config.status only pays attention to the cache file if you give it
21378 # the --recheck option to rerun configure.
21379 #
21380 # `ac_cv_env_foo' variables (set or unset) will be overriden when
21381 # loading this file, other *unset* `ac_cv_foo' will be assigned the
21382 # following values.
21383
21384 _ACEOF
21385
21386 # The following way of writing the cache mishandles newlines in values,
21387 # but we know of no workaround that is simple, portable, and efficient.
21388 # So, don't put newlines in cache variables' values.
21389 # Ultrix sh set writes to stderr and can't be redirected directly,
21390 # and sets the high bit in the cache file unless we assign to the vars.
21391 {
21392   (set) 2>&1 |
21393     case `(ac_space=' '; set | grep ac_space) 2>&1` in
21394     *ac_space=\ *)
21395       # `set' does not quote correctly, so add quotes (double-quote
21396       # substitution turns \\\\ into \\, and sed turns \\ into \).
21397       sed -n \
21398         "s/'/'\\\\''/g;
21399           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
21400       ;;
21401     *)
21402       # `set' quotes correctly as required by POSIX, so do not add quotes.
21403       sed -n \
21404         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
21405       ;;
21406     esac;
21407 } |
21408   sed '
21409      t clear
21410      : clear
21411      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
21412      t end
21413      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
21414      : end' >>confcache
21415 if cmp -s $cache_file confcache; then :; else
21416   if test -w $cache_file; then
21417     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
21418     cat confcache >$cache_file
21419   else
21420     echo "not updating unwritable cache $cache_file"
21421   fi
21422 fi
21423 rm -f confcache
21424
21425 test "x$prefix" = xNONE && prefix=$ac_default_prefix
21426 # Let make expand exec_prefix.
21427 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
21428
21429 # VPATH may cause trouble with some makes, so we remove $(srcdir),
21430 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
21431 # trailing colons and then remove the whole line if VPATH becomes empty
21432 # (actually we leave an empty line to preserve line numbers).
21433 if test "x$srcdir" = x.; then
21434   ac_vpsub='/^[         ]*VPATH[        ]*=/{
21435 s/:*\$(srcdir):*/:/;
21436 s/:*\${srcdir}:*/:/;
21437 s/:*@srcdir@:*/:/;
21438 s/^\([^=]*=[    ]*\):*/\1/;
21439 s/:*$//;
21440 s/^[^=]*=[      ]*$//;
21441 }'
21442 fi
21443
21444 DEFS=-DHAVE_CONFIG_H
21445
21446 : ${CONFIG_STATUS=./config.status}
21447 ac_clean_files_save=$ac_clean_files
21448 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
21449 { echo "$as_me:21449: creating $CONFIG_STATUS" >&5
21450 echo "$as_me: creating $CONFIG_STATUS" >&6;}
21451 cat >$CONFIG_STATUS <<_ACEOF
21452 #! $SHELL
21453 # Generated automatically by configure.
21454 # Run this file to recreate the current configuration.
21455 # Compiler output produced by configure, useful for debugging
21456 # configure, is in config.log if it exists.
21457
21458 debug=false
21459 SHELL=\${CONFIG_SHELL-$SHELL}
21460 ac_cs_invocation="\$0 \$@"
21461
21462 _ACEOF
21463
21464 cat >>$CONFIG_STATUS <<\_ACEOF
21465 # Be Bourne compatible
21466 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
21467   emulate sh
21468   NULLCMD=:
21469 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
21470   set -o posix
21471 fi
21472
21473 # Name of the executable.
21474 as_me=`echo "$0" |sed 's,.*[\\/],,'`
21475
21476 if expr a : '\(a\)' >/dev/null 2>&1; then
21477   as_expr=expr
21478 else
21479   as_expr=false
21480 fi
21481
21482 rm -f conf$$ conf$$.exe conf$$.file
21483 echo >conf$$.file
21484 if ln -s conf$$.file conf$$ 2>/dev/null; then
21485   # We could just check for DJGPP; but this test a) works b) is more generic
21486   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
21487   if test -f conf$$.exe; then
21488     # Don't use ln at all; we don't have any links
21489     as_ln_s='cp -p'
21490   else
21491     as_ln_s='ln -s'
21492   fi
21493 elif ln conf$$.file conf$$ 2>/dev/null; then
21494   as_ln_s=ln
21495 else
21496   as_ln_s='cp -p'
21497 fi
21498 rm -f conf$$ conf$$.exe conf$$.file
21499
21500 as_executable_p="test -f"
21501
21502 # Support unset when possible.
21503 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
21504   as_unset=unset
21505 else
21506   as_unset=false
21507 fi
21508
21509 # NLS nuisances.
21510 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
21511 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
21512 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
21513 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
21514 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
21515 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
21516 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
21517 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
21518
21519 # IFS
21520 # We need space, tab and new line, in precisely that order.
21521 as_nl='
21522 '
21523 IFS="   $as_nl"
21524
21525 # CDPATH.
21526 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
21527
21528 exec 6>&1
21529
21530 _ACEOF
21531
21532 # Files that config.status was made for.
21533 if test -n "$ac_config_files"; then
21534   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
21535 fi
21536
21537 if test -n "$ac_config_headers"; then
21538   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
21539 fi
21540
21541 if test -n "$ac_config_links"; then
21542   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
21543 fi
21544
21545 if test -n "$ac_config_commands"; then
21546   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
21547 fi
21548
21549 cat >>$CONFIG_STATUS <<\EOF
21550
21551 ac_cs_usage="\
21552 \`$as_me' instantiates files from templates according to the
21553 current configuration.
21554
21555 Usage: $0 [OPTIONS] [FILE]...
21556
21557   -h, --help       print this help, then exit
21558   -V, --version    print version number, then exit
21559   -d, --debug      don't remove temporary files
21560       --recheck    update $as_me by reconfiguring in the same conditions
21561   --file=FILE[:TEMPLATE]
21562                    instantiate the configuration file FILE
21563   --header=FILE[:TEMPLATE]
21564                    instantiate the configuration header FILE
21565
21566 Configuration files:
21567 $config_files
21568
21569 Configuration headers:
21570 $config_headers
21571
21572 Configuration commands:
21573 $config_commands
21574
21575 Report bugs to <dickey@invisible-island.net>."
21576 EOF
21577
21578 cat >>$CONFIG_STATUS <<EOF
21579 ac_cs_version="\\
21580 config.status
21581 configured by $0, generated by GNU Autoconf 2.52.20200111,
21582   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
21583
21584 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
21585 Free Software Foundation, Inc.
21586 This config.status script is free software; the Free Software Foundation
21587 gives unlimited permission to copy, distribute and modify it."
21588 srcdir=$srcdir
21589 INSTALL="$INSTALL"
21590 EOF
21591
21592 cat >>$CONFIG_STATUS <<\EOF
21593 # If no file are specified by the user, then we need to provide default
21594 # value.  By we need to know if files were specified by the user.
21595 ac_need_defaults=:
21596 while test $# != 0
21597 do
21598   case $1 in
21599   --*=*)
21600     ac_option=`expr "x$1" : 'x\([^=]*\)='`
21601     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
21602     shift
21603     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
21604     shift
21605     ;;
21606   -*);;
21607   *) # This is not an option, so the user has probably given explicit
21608      # arguments.
21609      ac_need_defaults=false;;
21610   esac
21611
21612   case $1 in
21613   # Handling of the options.
21614 EOF
21615 cat >>$CONFIG_STATUS <<EOF
21616   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
21617     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
21618     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
21619 EOF
21620 cat >>$CONFIG_STATUS <<\EOF
21621   --version | --vers* | -V )
21622     echo "$ac_cs_version"; exit 0 ;;
21623   --he | --h)
21624     # Conflict between --help and --header
21625     { { echo "$as_me:21625: error: ambiguous option: $1
21626 Try \`$0 --help' for more information." >&5
21627 echo "$as_me: error: ambiguous option: $1
21628 Try \`$0 --help' for more information." >&2;}
21629    { (exit 1); exit 1; }; };;
21630   --help | --hel | -h )
21631     echo "$ac_cs_usage"; exit 0 ;;
21632   --debug | --d* | -d )
21633     debug=: ;;
21634   --file | --fil | --fi | --f )
21635     shift
21636     CONFIG_FILES="$CONFIG_FILES $1"
21637     ac_need_defaults=false;;
21638   --header | --heade | --head | --hea )
21639     shift
21640     CONFIG_HEADERS="$CONFIG_HEADERS $1"
21641     ac_need_defaults=false;;
21642
21643   # This is an error.
21644   -*) { { echo "$as_me:21644: error: unrecognized option: $1
21645 Try \`$0 --help' for more information." >&5
21646 echo "$as_me: error: unrecognized option: $1
21647 Try \`$0 --help' for more information." >&2;}
21648    { (exit 1); exit 1; }; } ;;
21649
21650   *) ac_config_targets="$ac_config_targets $1" ;;
21651
21652   esac
21653   shift
21654 done
21655
21656 exec 5>>config.log
21657 cat >&5 << _ACEOF
21658
21659 ## ----------------------- ##
21660 ## Running config.status.  ##
21661 ## ----------------------- ##
21662
21663 This file was extended by $as_me 2.52.20200111, executed with
21664   CONFIG_FILES    = $CONFIG_FILES
21665   CONFIG_HEADERS  = $CONFIG_HEADERS
21666   CONFIG_LINKS    = $CONFIG_LINKS
21667   CONFIG_COMMANDS = $CONFIG_COMMANDS
21668   > $ac_cs_invocation
21669 on `(hostname || uname -n) 2>/dev/null | sed 1q`
21670
21671 _ACEOF
21672 EOF
21673
21674 cat >>$CONFIG_STATUS <<EOF
21675 #
21676 # INIT-COMMANDS section.
21677 #
21678
21679 AWK="$AWK"
21680 ECHO_CC="$ECHO_CC"
21681 ECHO_LD="$ECHO_LD"
21682 SHOW_CC="$SHOW_LD"
21683
21684 EOF
21685
21686 cat >>$CONFIG_STATUS <<\EOF
21687 for ac_config_target in $ac_config_targets
21688 do
21689   case "$ac_config_target" in
21690   # Handling of arguments.
21691   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
21692   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
21693   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
21694   *) { { echo "$as_me:21694: error: invalid argument: $ac_config_target" >&5
21695 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
21696    { (exit 1); exit 1; }; };;
21697   esac
21698 done
21699
21700 # If the user did not use the arguments to specify the items to instantiate,
21701 # then the envvar interface is used.  Set only those that are not.
21702 # We use the long form for the default assignment because of an extremely
21703 # bizarre bug on SunOS 4.1.3.
21704 if $ac_need_defaults; then
21705   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
21706   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
21707   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
21708 fi
21709
21710 # Create a temporary directory, and hook for its removal unless debugging.
21711 $debug ||
21712 {
21713   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
21714   trap '{ (exit 1); exit 1; }' 1 2 13 15
21715 }
21716
21717 # Create a (secure) tmp directory for tmp files.
21718 : ${TMPDIR=/tmp}
21719 {
21720   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
21721   test -n "$tmp" && test -d "$tmp"
21722 }  ||
21723 {
21724   tmp=$TMPDIR/cs$$-$RANDOM
21725   (umask 077 && mkdir $tmp)
21726 } ||
21727 {
21728    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
21729    { (exit 1); exit 1; }
21730 }
21731
21732 EOF
21733
21734 cat >>$CONFIG_STATUS <<EOF
21735
21736 #
21737 # CONFIG_FILES section.
21738 #
21739
21740 # No need to generate the scripts if there are no CONFIG_FILES.
21741 # This happens for instance when ./config.status config.h
21742 if test -n "\$CONFIG_FILES"; then
21743   # Protect against being on the right side of a sed subst in config.status.
21744   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
21745    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
21746 s,@SHELL@,$SHELL,;t t
21747 s,@exec_prefix@,$exec_prefix,;t t
21748 s,@prefix@,$prefix,;t t
21749 s,@program_transform_name@,$program_transform_name,;t t
21750 s,@bindir@,$bindir,;t t
21751 s,@sbindir@,$sbindir,;t t
21752 s,@libexecdir@,$libexecdir,;t t
21753 s,@datarootdir@,$datarootdir,;t t
21754 s,@datadir@,$datadir,;t t
21755 s,@sysconfdir@,$sysconfdir,;t t
21756 s,@sharedstatedir@,$sharedstatedir,;t t
21757 s,@localstatedir@,$localstatedir,;t t
21758 s,@runstatedir@,$runstatedir,;t t
21759 s,@libdir@,$libdir,;t t
21760 s,@includedir@,$includedir,;t t
21761 s,@oldincludedir@,$oldincludedir,;t t
21762 s,@infodir@,$infodir,;t t
21763 s,@mandir@,$mandir,;t t
21764 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
21765 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
21766 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
21767 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
21768 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
21769 s,@build_alias@,$build_alias,;t t
21770 s,@host_alias@,$host_alias,;t t
21771 s,@target_alias@,$target_alias,;t t
21772 s,@ECHO_C@,$ECHO_C,;t t
21773 s,@ECHO_N@,$ECHO_N,;t t
21774 s,@ECHO_T@,$ECHO_T,;t t
21775 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
21776 s,@DEFS@,$DEFS,;t t
21777 s,@LIBS@,$LIBS,;t t
21778 s,@build@,$build,;t t
21779 s,@build_cpu@,$build_cpu,;t t
21780 s,@build_vendor@,$build_vendor,;t t
21781 s,@build_os@,$build_os,;t t
21782 s,@host@,$host,;t t
21783 s,@host_cpu@,$host_cpu,;t t
21784 s,@host_vendor@,$host_vendor,;t t
21785 s,@host_os@,$host_os,;t t
21786 s,@SET_MAKE@,$SET_MAKE,;t t
21787 s,@CC@,$CC,;t t
21788 s,@CFLAGS@,$CFLAGS,;t t
21789 s,@LDFLAGS@,$LDFLAGS,;t t
21790 s,@CPPFLAGS@,$CPPFLAGS,;t t
21791 s,@ac_ct_CC@,$ac_ct_CC,;t t
21792 s,@EXEEXT@,$EXEEXT,;t t
21793 s,@OBJEXT@,$OBJEXT,;t t
21794 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
21795 s,@CPP@,$CPP,;t t
21796 s,@AWK@,$AWK,;t t
21797 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
21798 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
21799 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
21800 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
21801 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
21802 s,@LINT@,$LINT,;t t
21803 s,@LINT_OPTS@,$LINT_OPTS,;t t
21804 s,@CTAGS@,$CTAGS,;t t
21805 s,@ETAGS@,$ETAGS,;t t
21806 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
21807 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
21808 s,@MATH_LIB@,$MATH_LIB,;t t
21809 s,@top_builddir@,$top_builddir,;t t
21810 s,@CC_G_OPT@,$CC_G_OPT,;t t
21811 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
21812 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
21813 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
21814 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
21815 s,@LD@,$LD,;t t
21816 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
21817 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
21818 s,@LD_MODEL@,$LD_MODEL,;t t
21819 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
21820 s,@LIBTOOL@,$LIBTOOL,;t t
21821 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
21822 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
21823 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
21824 s,@LIB_LINK@,$LIB_LINK,;t t
21825 s,@LINK_TESTS@,$LINK_TESTS,;t t
21826 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
21827 s,@PACKAGE@,$PACKAGE,;t t
21828 s,@PTHREAD@,$PTHREAD,;t t
21829 s,@TEST_ARGS@,$TEST_ARGS,;t t
21830 s,@TEST_DEPS@,$TEST_DEPS,;t t
21831 s,@TEST_LIBS@,$TEST_LIBS,;t t
21832 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
21833 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
21834 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
21835 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
21836 s,@includesubdir@,$includesubdir,;t t
21837 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
21838 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
21839 s,@ECHO_LT@,$ECHO_LT,;t t
21840 s,@ECHO_LD@,$ECHO_LD,;t t
21841 s,@RULE_CC@,$RULE_CC,;t t
21842 s,@SHOW_CC@,$SHOW_CC,;t t
21843 s,@ECHO_CC@,$ECHO_CC,;t t
21844 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
21845 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
21846 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
21847 s,@X_CFLAGS@,$X_CFLAGS,;t t
21848 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
21849 s,@X_LIBS@,$X_LIBS,;t t
21850 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
21851 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
21852 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
21853 s,@RGB_PATH@,$RGB_PATH,;t t
21854 s,@no_x11_rgb@,$no_x11_rgb,;t t
21855 s,@FORM_NAME@,$FORM_NAME,;t t
21856 s,@MENU_NAME@,$MENU_NAME,;t t
21857 s,@PANEL_NAME@,$PANEL_NAME,;t t
21858 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
21859 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
21860 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
21861 CEOF
21862
21863 EOF
21864
21865   cat >>$CONFIG_STATUS <<\EOF
21866   # Split the substitutions into bite-sized pieces for seds with
21867   # small command number limits, like on Digital OSF/1 and HP-UX.
21868   ac_max_sed_lines=48
21869   ac_sed_frag=1 # Number of current file.
21870   ac_beg=1 # First line for current file.
21871   ac_end=$ac_max_sed_lines # Line after last line for current file.
21872   ac_more_lines=:
21873   ac_sed_cmds=
21874   while $ac_more_lines; do
21875     if test $ac_beg -gt 1; then
21876       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21877     else
21878       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21879     fi
21880     if test ! -s $tmp/subs.frag; then
21881       ac_more_lines=false
21882     else
21883       # The purpose of the label and of the branching condition is to
21884       # speed up the sed processing (if there are no `@' at all, there
21885       # is no need to browse any of the substitutions).
21886       # These are the two extra sed commands mentioned above.
21887       (echo ':t
21888   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
21889       # It is possible to make a multiline substitution using escaped newlines.
21890       # Ensure that we do not split the substitution between script fragments.
21891       ac_BEG=$ac_end
21892       ac_END=`expr $ac_end + $ac_max_sed_lines`
21893       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
21894       if test -s $tmp/subs.next; then
21895         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
21896         if test ! -s $tmp/subs.edit; then
21897           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
21898           if test ! -s $tmp/subs.edit; then
21899             if test $ac_beg -gt 1; then
21900               ac_end=`expr $ac_end - 1`
21901               continue
21902             fi
21903           fi
21904         fi
21905       fi
21906
21907       if test -z "$ac_sed_cmds"; then
21908         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
21909       else
21910         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
21911       fi
21912       ac_sed_frag=`expr $ac_sed_frag + 1`
21913       ac_beg=$ac_end
21914       ac_end=`expr $ac_end + $ac_max_sed_lines`
21915     fi
21916   done
21917   if test -z "$ac_sed_cmds"; then
21918     ac_sed_cmds=cat
21919   fi
21920 fi # test -n "$CONFIG_FILES"
21921
21922 EOF
21923 cat >>$CONFIG_STATUS <<\EOF
21924 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
21925   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21926   case $ac_file in
21927   - | *:- | *:-:* ) # input from stdin
21928         cat >$tmp/stdin
21929         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21930         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21931   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21932         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21933   * )   ac_file_in=$ac_file.in ;;
21934   esac
21935
21936   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
21937   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21938          X"$ac_file" : 'X\(//\)[^/]' \| \
21939          X"$ac_file" : 'X\(//\)$' \| \
21940          X"$ac_file" : 'X\(/\)' \| \
21941          .     : '\(.\)' 2>/dev/null ||
21942 echo X"$ac_file" |
21943     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21944           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21945           /^X\(\/\/\)$/{ s//\1/; q; }
21946           /^X\(\/\).*/{ s//\1/; q; }
21947           s/.*/./; q'`
21948   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21949     { case "$ac_dir" in
21950   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21951   *)                      as_incr_dir=.;;
21952 esac
21953 as_dummy="$ac_dir"
21954 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21955   case $as_mkdir_dir in
21956     # Skip DOS drivespec
21957     ?:) as_incr_dir=$as_mkdir_dir ;;
21958     *)
21959       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21960       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21961     ;;
21962   esac
21963 done; }
21964
21965     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21966     # A "../" for each directory in $ac_dir_suffix.
21967     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21968   else
21969     ac_dir_suffix= ac_dots=
21970   fi
21971
21972   case $srcdir in
21973   .)  ac_srcdir=.
21974       if test -z "$ac_dots"; then
21975          ac_top_srcdir=.
21976       else
21977          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21978       fi ;;
21979   [\\/]* | ?:[\\/]* )
21980       ac_srcdir=$srcdir$ac_dir_suffix;
21981       ac_top_srcdir=$srcdir ;;
21982   *) # Relative path.
21983     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
21984     ac_top_srcdir=$ac_dots$srcdir ;;
21985   esac
21986
21987   case $INSTALL in
21988   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21989   *) ac_INSTALL=$ac_dots$INSTALL ;;
21990   esac
21991
21992   if test x"$ac_file" != x-; then
21993     { echo "$as_me:21993: creating $ac_file" >&5
21994 echo "$as_me: creating $ac_file" >&6;}
21995     rm -f "$ac_file"
21996   fi
21997   # Let's still pretend it is `configure' which instantiates (i.e., don't
21998   # use $as_me), people would be surprised to read:
21999   #    /* config.h.  Generated automatically by config.status.  */
22000   configure_input="Generated automatically from `echo $ac_file_in |
22001                                                  sed 's,.*/,,'` by configure."
22002
22003   # First look for the input files in the build tree, otherwise in the
22004   # src tree.
22005   ac_file_inputs=`IFS=:
22006     for f in $ac_file_in; do
22007       case $f in
22008       -) echo $tmp/stdin ;;
22009       [\\/$]*)
22010          # Absolute (can't be DOS-style, as IFS=:)
22011          test -f "$f" || { { echo "$as_me:22011: error: cannot find input file: $f" >&5
22012 echo "$as_me: error: cannot find input file: $f" >&2;}
22013    { (exit 1); exit 1; }; }
22014          echo $f;;
22015       *) # Relative
22016          if test -f "$f"; then
22017            # Build tree
22018            echo $f
22019          elif test -f "$srcdir/$f"; then
22020            # Source tree
22021            echo $srcdir/$f
22022          else
22023            # /dev/null tree
22024            { { echo "$as_me:22024: error: cannot find input file: $f" >&5
22025 echo "$as_me: error: cannot find input file: $f" >&2;}
22026    { (exit 1); exit 1; }; }
22027          fi;;
22028       esac
22029     done` || { (exit 1); exit 1; }
22030 EOF
22031 cat >>$CONFIG_STATUS <<\EOF
22032   ac_warn_datarootdir=no
22033   if test x"$ac_file" != x-; then
22034     for ac_item in $ac_file_inputs
22035     do
22036       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
22037       if test -n "$ac_seen"; then
22038         ac_used=`grep '@datarootdir@' $ac_item`
22039         if test -z "$ac_used"; then
22040           { echo "$as_me:22040: WARNING: datarootdir was used implicitly but not set:
22041 $ac_seen" >&5
22042 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
22043 $ac_seen" >&2;}
22044           ac_warn_datarootdir=yes
22045         fi
22046       fi
22047       ac_seen=`grep '${datarootdir}' $ac_item`
22048       if test -n "$ac_seen"; then
22049         { echo "$as_me:22049: WARNING: datarootdir was used explicitly but not set:
22050 $ac_seen" >&5
22051 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
22052 $ac_seen" >&2;}
22053         ac_warn_datarootdir=yes
22054       fi
22055     done
22056   fi
22057
22058 if test "x$ac_warn_datarootdir" = xyes; then
22059   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
22060 fi
22061
22062 EOF
22063 cat >>$CONFIG_STATUS <<EOF
22064   sed "$ac_vpsub
22065 $extrasub
22066 EOF
22067 cat >>$CONFIG_STATUS <<\EOF
22068 :t
22069 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
22070 s,@configure_input@,$configure_input,;t t
22071 s,@srcdir@,$ac_srcdir,;t t
22072 s,@top_srcdir@,$ac_top_srcdir,;t t
22073 s,@INSTALL@,$ac_INSTALL,;t t
22074 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
22075   rm -f $tmp/stdin
22076   if test x"$ac_file" != x-; then
22077     cp $tmp/out $ac_file
22078
22079     for ac_name in prefix exec_prefix datarootdir
22080     do
22081         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
22082         if test -n "$ac_seen"; then
22083             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
22084             if test -z "$ac_init"; then
22085               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
22086               { echo "$as_me:22086: WARNING: Variable $ac_name is used but was not set:
22087 $ac_seen" >&5
22088 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
22089 $ac_seen" >&2;}
22090             fi
22091         fi
22092     done
22093     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
22094     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
22095     if test -s $tmp/out; then
22096       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
22097       { echo "$as_me:22097: WARNING: Some variables may not be substituted:
22098 $ac_seen" >&5
22099 echo "$as_me: WARNING: Some variables may not be substituted:
22100 $ac_seen" >&2;}
22101     fi
22102   else
22103     cat $tmp/out
22104   fi
22105   rm -f $tmp/out
22106
22107 done
22108 EOF
22109 cat >>$CONFIG_STATUS <<\EOF
22110
22111 #
22112 # CONFIG_HEADER section.
22113 #
22114
22115 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
22116 # NAME is the cpp macro being defined and VALUE is the value it is being given.
22117 #
22118 # ac_d sets the value in "#define NAME VALUE" lines.
22119 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
22120 ac_dB='[        ].*$,\1#\2'
22121 ac_dC=' '
22122 ac_dD=',;t'
22123 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
22124 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
22125 ac_iB='\([      ]\),\1#\2define\3'
22126 ac_iC=' '
22127 ac_iD='\4,;t'
22128 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
22129 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
22130 ac_uB='$,\1#\2define\3'
22131 ac_uC=' '
22132 ac_uD=',;t'
22133
22134 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
22135   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
22136   case $ac_file in
22137   - | *:- | *:-:* ) # input from stdin
22138         cat >$tmp/stdin
22139         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
22140         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
22141   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
22142         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
22143   * )   ac_file_in=$ac_file.in ;;
22144   esac
22145
22146   test x"$ac_file" != x- && { echo "$as_me:22146: creating $ac_file" >&5
22147 echo "$as_me: creating $ac_file" >&6;}
22148
22149   # First look for the input files in the build tree, otherwise in the
22150   # src tree.
22151   ac_file_inputs=`IFS=:
22152     for f in $ac_file_in; do
22153       case $f in
22154       -) echo $tmp/stdin ;;
22155       [\\/$]*)
22156          # Absolute (can't be DOS-style, as IFS=:)
22157          test -f "$f" || { { echo "$as_me:22157: error: cannot find input file: $f" >&5
22158 echo "$as_me: error: cannot find input file: $f" >&2;}
22159    { (exit 1); exit 1; }; }
22160          echo $f;;
22161       *) # Relative
22162          if test -f "$f"; then
22163            # Build tree
22164            echo $f
22165          elif test -f "$srcdir/$f"; then
22166            # Source tree
22167            echo $srcdir/$f
22168          else
22169            # /dev/null tree
22170            { { echo "$as_me:22170: error: cannot find input file: $f" >&5
22171 echo "$as_me: error: cannot find input file: $f" >&2;}
22172    { (exit 1); exit 1; }; }
22173          fi;;
22174       esac
22175     done` || { (exit 1); exit 1; }
22176   # Remove the trailing spaces.
22177   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
22178
22179 EOF
22180
22181 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
22182 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
22183 # be either 'cat' or 'sort'.
22184 cat confdefs.h | uniq >conftest.vals
22185
22186 # Break up conftest.vals because some shells have a limit on
22187 # the size of here documents, and old seds have small limits too.
22188
22189 rm -f conftest.tail
22190 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
22191 while grep . conftest.vals >/dev/null
22192 do
22193   # Write chunks of a limited-size here document to conftest.frag.
22194   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
22195   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
22196   echo 'CEOF' >> $CONFIG_STATUS
22197   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
22198   rm -f conftest.vals
22199   mv conftest.tail conftest.vals
22200 done
22201 rm -f conftest.vals
22202
22203 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
22204 # marker @DEFS@.
22205 echo '  cat >> conftest.edit <<CEOF
22206 /@DEFS@/r conftest.frag
22207 /@DEFS@/d
22208 CEOF
22209 sed -f conftest.edit $tmp/in > $tmp/out
22210 rm -f $tmp/in
22211 mv $tmp/out $tmp/in
22212 rm -f conftest.edit conftest.frag
22213 ' >> $CONFIG_STATUS
22214
22215 cat >>$CONFIG_STATUS <<\EOF
22216   # Let's still pretend it is `configure' which instantiates (i.e., don't
22217   # use $as_me), people would be surprised to read:
22218   #    /* config.h.  Generated automatically by config.status.  */
22219   if test x"$ac_file" = x-; then
22220     echo "/* Generated automatically by configure.  */" >$tmp/config.h
22221   else
22222     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
22223   fi
22224   cat $tmp/in >>$tmp/config.h
22225   rm -f $tmp/in
22226   if test x"$ac_file" != x-; then
22227     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
22228       { echo "$as_me:22228: $ac_file is unchanged" >&5
22229 echo "$as_me: $ac_file is unchanged" >&6;}
22230     else
22231       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
22232          X"$ac_file" : 'X\(//\)[^/]' \| \
22233          X"$ac_file" : 'X\(//\)$' \| \
22234          X"$ac_file" : 'X\(/\)' \| \
22235          .     : '\(.\)' 2>/dev/null ||
22236 echo X"$ac_file" |
22237     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
22238           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
22239           /^X\(\/\/\)$/{ s//\1/; q; }
22240           /^X\(\/\).*/{ s//\1/; q; }
22241           s/.*/./; q'`
22242       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
22243         { case "$ac_dir" in
22244   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
22245   *)                      as_incr_dir=.;;
22246 esac
22247 as_dummy="$ac_dir"
22248 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
22249   case $as_mkdir_dir in
22250     # Skip DOS drivespec
22251     ?:) as_incr_dir=$as_mkdir_dir ;;
22252     *)
22253       as_incr_dir=$as_incr_dir/$as_mkdir_dir
22254       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
22255     ;;
22256   esac
22257 done; }
22258
22259       fi
22260       rm -f $ac_file
22261       mv $tmp/config.h $ac_file
22262     fi
22263   else
22264     cat $tmp/config.h
22265     rm -f $tmp/config.h
22266   fi
22267 done
22268 EOF
22269 cat >>$CONFIG_STATUS <<\EOF
22270 #
22271 # CONFIG_COMMANDS section.
22272 #
22273 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
22274   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
22275   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
22276
22277   case $ac_dest in
22278     default )
22279
22280 for cf_dir in .
22281 do
22282         if test ! -d $srcdir/$cf_dir; then
22283                 continue
22284         elif test -f $srcdir/$cf_dir/programs; then
22285                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
22286         fi
22287 done
22288
22289         cat >>Makefile <<TEST_EOF
22290
22291 # These rules are generated so we do not rely on suffix rules, which do not
22292 # work consistently for different make-programs (the '\$(MODEL)/' confuses
22293 # some, and the '\$x' confuses others).
22294 TEST_EOF
22295
22296 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
22297 for N in $LIST
22298 do
22299         cat >>Makefile <<TEST_EOF
22300
22301 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
22302         \$(srcdir)/test.priv.h \\
22303         ncurses_cfg.h
22304         $SHOW_CC
22305         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
22306 TEST_EOF
22307 done
22308
22309 if test -f ../config.guess && test -f ../config.sub
22310 then
22311         cat >>Makefile <<TEST_EOF
22312
22313 # if we used CF_INHERIT for getting these files, we can remove them
22314 distclean::
22315         rm -f config.guess config.sub
22316 TEST_EOF
22317 fi
22318  ;;
22319   esac
22320 done
22321 EOF
22322
22323 cat >>$CONFIG_STATUS <<\EOF
22324
22325 { (exit 0); exit 0; }
22326 EOF
22327 chmod +x $CONFIG_STATUS
22328 ac_clean_files=$ac_clean_files_save
22329
22330 # configure is writing to config.log, and then calls config.status.
22331 # config.status does its own redirection, appending to config.log.
22332 # Unfortunately, on DOS this fails, as config.log is still kept open
22333 # by configure, so config.status won't be able to write to it; its
22334 # output is simply discarded.  So we exec the FD to /dev/null,
22335 # effectively closing config.log, so it can be properly (re)opened and
22336 # appended to by config.status.  When coming back to configure, we
22337 # need to make the FD available again.
22338 if test "$no_create" != yes; then
22339   ac_cs_success=:
22340   exec 5>/dev/null
22341   $SHELL $CONFIG_STATUS || ac_cs_success=false
22342   exec 5>>config.log
22343   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
22344   # would make configure fail if this is the last instruction.
22345   $ac_cs_success || { (exit 1); exit 1; }
22346 fi
22347