]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.1 - patch 20181215
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20181006.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 runstatedir='${localstatedir}/run'
143 libdir='${exec_prefix}/lib'
144 includedir='${prefix}/include'
145 oldincludedir='/usr/include'
146 infodir='${datarootdir}/info'
147 mandir='${datarootdir}/man'
148
149 # Identity of this package.
150 PACKAGE_NAME=
151 PACKAGE_TARNAME=
152 PACKAGE_VERSION=
153 PACKAGE_STRING=
154 PACKAGE_BUGREPORT=
155
156 ac_prev=
157 for ac_option
158 do
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
167
168   # Accept the important Cygnus configure options, so we can diagnose typos.
169
170   case $ac_option in
171
172   -bindir | --bindir | --bindi | --bind | --bin | --bi)
173     ac_prev=bindir ;;
174   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
175     bindir=$ac_optarg ;;
176
177   -build | --build | --buil | --bui | --bu)
178     ac_prev=build_alias ;;
179   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
180     build_alias=$ac_optarg ;;
181
182   -cache-file | --cache-file | --cache-fil | --cache-fi \
183   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
184     ac_prev=cache_file ;;
185   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
186   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
187     cache_file=$ac_optarg ;;
188
189   --config-cache | -C)
190     cache_file=config.cache ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir=$ac_optarg ;;
197
198   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
199   | --dataroo | --dataro | --datar)
200     ac_prev=datarootdir ;;
201   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
202   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
203     datarootdir=$ac_optarg ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     eval "enable_$ac_feature=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
216     # Reject names that are not valid shell variable names.
217     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
218       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
219    { (exit 1); exit 1; }; }
220     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
221     case $ac_option in
222       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_$ac_feature='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix=$ac_optarg ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he | -h)
241     ac_init_help=long ;;
242   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
243     ac_init_help=recursive ;;
244   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
245     ac_init_help=short ;;
246
247   -host | --host | --hos | --ho)
248     ac_prev=host_alias ;;
249   -host=* | --host=* | --hos=* | --ho=*)
250     host_alias=$ac_optarg ;;
251
252   -includedir | --includedir | --includedi | --included | --include \
253   | --includ | --inclu | --incl | --inc)
254     ac_prev=includedir ;;
255   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
256   | --includ=* | --inclu=* | --incl=* | --inc=*)
257     includedir=$ac_optarg ;;
258
259   -infodir | --infodir | --infodi | --infod | --info | --inf)
260     ac_prev=infodir ;;
261   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
262     infodir=$ac_optarg ;;
263
264   -libdir | --libdir | --libdi | --libd)
265     ac_prev=libdir ;;
266   -libdir=* | --libdir=* | --libdi=* | --libd=*)
267     libdir=$ac_optarg ;;
268
269   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
270   | --libexe | --libex | --libe)
271     ac_prev=libexecdir ;;
272   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
273   | --libexe=* | --libex=* | --libe=*)
274     libexecdir=$ac_optarg ;;
275
276   -localstatedir | --localstatedir | --localstatedi | --localstated \
277   | --localstate | --localstat | --localsta | --localst \
278   | --locals | --local | --loca | --loc | --lo)
279     ac_prev=localstatedir ;;
280   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
281   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
282   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
283     localstatedir=$ac_optarg ;;
284
285   -runstatedir | --runstatedir | --runstatedi | --runstated \
286   | --runstate | --runstat | --runsta | --runst \
287   | --runs | --run | --ru)
288     ac_prev=runstatedir ;;
289   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
290   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
291   | --runs=* | --run=* | --ru=*)
292     runstatedir=$ac_optarg ;;
293
294   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
295     ac_prev=mandir ;;
296   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
297     mandir=$ac_optarg ;;
298
299   -nfp | --nfp | --nf)
300     # Obsolete; use --without-fp.
301     with_fp=no ;;
302
303   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
304   | --no-cr | --no-c)
305     no_create=yes ;;
306
307   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
308   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
309     no_recursion=yes ;;
310
311   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
312   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
313   | --oldin | --oldi | --old | --ol | --o)
314     ac_prev=oldincludedir ;;
315   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
316   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
317   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
318     oldincludedir=$ac_optarg ;;
319
320   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
321     ac_prev=prefix ;;
322   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
323     prefix=$ac_optarg ;;
324
325   -program-prefix | --program-prefix | --program-prefi | --program-pref \
326   | --program-pre | --program-pr | --program-p)
327     ac_prev=program_prefix ;;
328   -program-prefix=* | --program-prefix=* | --program-prefi=* \
329   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
330     program_prefix=$ac_optarg ;;
331
332   -program-suffix | --program-suffix | --program-suffi | --program-suff \
333   | --program-suf | --program-su | --program-s)
334     ac_prev=program_suffix ;;
335   -program-suffix=* | --program-suffix=* | --program-suffi=* \
336   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
337     program_suffix=$ac_optarg ;;
338
339   -program-transform-name | --program-transform-name \
340   | --program-transform-nam | --program-transform-na \
341   | --program-transform-n | --program-transform- \
342   | --program-transform | --program-transfor \
343   | --program-transfo | --program-transf \
344   | --program-trans | --program-tran \
345   | --progr-tra | --program-tr | --program-t)
346     ac_prev=program_transform_name ;;
347   -program-transform-name=* | --program-transform-name=* \
348   | --program-transform-nam=* | --program-transform-na=* \
349   | --program-transform-n=* | --program-transform-=* \
350   | --program-transform=* | --program-transfor=* \
351   | --program-transfo=* | --program-transf=* \
352   | --program-trans=* | --program-tran=* \
353   | --progr-tra=* | --program-tr=* | --program-t=*)
354     program_transform_name=$ac_optarg ;;
355
356   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
357   | -silent | --silent | --silen | --sile | --sil)
358     silent=yes ;;
359
360   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
361     ac_prev=sbindir ;;
362   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
363   | --sbi=* | --sb=*)
364     sbindir=$ac_optarg ;;
365
366   -sharedstatedir | --sharedstatedir | --sharedstatedi \
367   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
368   | --sharedst | --shareds | --shared | --share | --shar \
369   | --sha | --sh)
370     ac_prev=sharedstatedir ;;
371   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
372   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
373   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
374   | --sha=* | --sh=*)
375     sharedstatedir=$ac_optarg ;;
376
377   -site | --site | --sit)
378     ac_prev=site ;;
379   -site=* | --site=* | --sit=*)
380     site=$ac_optarg ;;
381
382   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
383     ac_prev=srcdir ;;
384   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
385     srcdir=$ac_optarg ;;
386
387   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
388   | --syscon | --sysco | --sysc | --sys | --sy)
389     ac_prev=sysconfdir ;;
390   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
391   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
392     sysconfdir=$ac_optarg ;;
393
394   -target | --target | --targe | --targ | --tar | --ta | --t)
395     ac_prev=target_alias ;;
396   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
397     target_alias=$ac_optarg ;;
398
399   -v | -verbose | --verbose | --verbos | --verbo | --verb)
400     verbose=yes ;;
401
402   -version | --version | --versio | --versi | --vers | -V)
403     ac_init_version=: ;;
404
405   -with-* | --with-*)
406     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
407     # Reject names that are not valid shell variable names.
408     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
409       { echo "$as_me: error: invalid package name: $ac_package" >&2
410    { (exit 1); exit 1; }; }
411     ac_package=`echo $ac_package| sed 's/-/_/g'`
412     case $ac_option in
413       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
414       *) ac_optarg=yes ;;
415     esac
416     eval "with_$ac_package='$ac_optarg'" ;;
417
418   -without-* | --without-*)
419     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
420     # Reject names that are not valid shell variable names.
421     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
422       { echo "$as_me: error: invalid package name: $ac_package" >&2
423    { (exit 1); exit 1; }; }
424     ac_package=`echo $ac_package | sed 's/-/_/g'`
425     eval "with_$ac_package=no" ;;
426
427   --x)
428     # Obsolete; use --with-x.
429     with_x=yes ;;
430
431   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
432   | --x-incl | --x-inc | --x-in | --x-i)
433     ac_prev=x_includes ;;
434   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
435   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
436     x_includes=$ac_optarg ;;
437
438   -x-libraries | --x-libraries | --x-librarie | --x-librari \
439   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
440     ac_prev=x_libraries ;;
441   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
442   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
443     x_libraries=$ac_optarg ;;
444
445   -*) { echo "$as_me: error: unrecognized option: $ac_option
446 Try \`$0 --help' for more information." >&2
447    { (exit 1); exit 1; }; }
448     ;;
449
450   *=*)
451     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
452     # Reject names that are not valid shell variable names.
453     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
454       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
455    { (exit 1); exit 1; }; }
456     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
457     eval "$ac_envvar='$ac_optarg'"
458     export $ac_envvar ;;
459
460   *)
461     # FIXME: should be removed in autoconf 3.0.
462     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
463     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
464       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
465     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
466     ;;
467
468   esac
469 done
470
471 if test -n "$ac_prev"; then
472   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
473   { echo "$as_me: error: missing argument to $ac_option" >&2
474    { (exit 1); exit 1; }; }
475 fi
476
477 # Be sure to have absolute paths.
478 for ac_var in exec_prefix prefix
479 do
480   eval ac_val=$`echo $ac_var`
481   case $ac_val in
482     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
483     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
484    { (exit 1); exit 1; }; };;
485   esac
486 done
487
488 # Be sure to have absolute paths.
489 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
490               localstatedir libdir includedir oldincludedir infodir mandir
491 do
492   eval ac_val=$`echo $ac_var`
493   case $ac_val in
494     [\\/$]* | ?:[\\/]* ) ;;
495     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
496    { (exit 1); exit 1; }; };;
497   esac
498 done
499
500 # There might be people who depend on the old broken behavior: `$host'
501 # used to hold the argument of --host etc.
502 build=$build_alias
503 host=$host_alias
504 target=$target_alias
505
506 # FIXME: should be removed in autoconf 3.0.
507 if test "x$host_alias" != x; then
508   if test "x$build_alias" = x; then
509     cross_compiling=maybe
510     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
511     If a cross compiler is detected then cross compile mode will be used." >&2
512   elif test "x$build_alias" != "x$host_alias"; then
513     cross_compiling=yes
514   fi
515 fi
516
517 ac_tool_prefix=
518 test -n "$host_alias" && ac_tool_prefix=$host_alias-
519
520 test "$silent" = yes && exec 6>/dev/null
521
522 # Find the source files, if location was not specified.
523 if test -z "$srcdir"; then
524   ac_srcdir_defaulted=yes
525   # Try the directory containing this script, then its parent.
526   ac_prog=$0
527   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
528   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
529   srcdir=$ac_confdir
530   if test ! -r $srcdir/$ac_unique_file; then
531     srcdir=..
532   fi
533 else
534   ac_srcdir_defaulted=no
535 fi
536 if test ! -r $srcdir/$ac_unique_file; then
537   if test "$ac_srcdir_defaulted" = yes; then
538     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
539    { (exit 1); exit 1; }; }
540   else
541     { echo "$as_me: error: cannot find sources in $srcdir" >&2
542    { (exit 1); exit 1; }; }
543   fi
544 fi
545 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
546 ac_env_build_alias_set=${build_alias+set}
547 ac_env_build_alias_value=$build_alias
548 ac_cv_env_build_alias_set=${build_alias+set}
549 ac_cv_env_build_alias_value=$build_alias
550 ac_env_host_alias_set=${host_alias+set}
551 ac_env_host_alias_value=$host_alias
552 ac_cv_env_host_alias_set=${host_alias+set}
553 ac_cv_env_host_alias_value=$host_alias
554 ac_env_target_alias_set=${target_alias+set}
555 ac_env_target_alias_value=$target_alias
556 ac_cv_env_target_alias_set=${target_alias+set}
557 ac_cv_env_target_alias_value=$target_alias
558 ac_env_CC_set=${CC+set}
559 ac_env_CC_value=$CC
560 ac_cv_env_CC_set=${CC+set}
561 ac_cv_env_CC_value=$CC
562 ac_env_CFLAGS_set=${CFLAGS+set}
563 ac_env_CFLAGS_value=$CFLAGS
564 ac_cv_env_CFLAGS_set=${CFLAGS+set}
565 ac_cv_env_CFLAGS_value=$CFLAGS
566 ac_env_LDFLAGS_set=${LDFLAGS+set}
567 ac_env_LDFLAGS_value=$LDFLAGS
568 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_cv_env_LDFLAGS_value=$LDFLAGS
570 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
571 ac_env_CPPFLAGS_value=$CPPFLAGS
572 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
574 ac_env_CPP_set=${CPP+set}
575 ac_env_CPP_value=$CPP
576 ac_cv_env_CPP_set=${CPP+set}
577 ac_cv_env_CPP_value=$CPP
578
579 #
580 # Report the --help message.
581 #
582 if test "$ac_init_help" = "long"; then
583   # Omit some internal or obsolete options to make the list less imposing.
584   # This message is too long to be a string in the A/UX 3.1 sh.
585   cat <<EOF
586 \`configure' configures this package to adapt to many kinds of systems.
587
588 Usage: $0 [OPTION]... [VAR=VALUE]...
589
590 To assign environment variables (e.g., CC, CFLAGS...), specify them as
591 VAR=VALUE.  See below for descriptions of some of the useful variables.
592
593 Defaults for the options are specified in brackets.
594
595 Configuration:
596   -h, --help              display this help and exit
597       --help=short        display options specific to this package
598       --help=recursive    display the short help of all the included packages
599   -V, --version           display version information and exit
600   -q, --quiet, --silent   do not print \`checking...' messages
601       --cache-file=FILE   cache test results in FILE [disabled]
602   -C, --config-cache      alias for \`--cache-file=config.cache'
603   -n, --no-create         do not create output files
604       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
605
606 EOF
607
608   cat <<EOF
609 Installation directories:
610   --prefix=PREFIX         install architecture-independent files in PREFIX
611                           [$ac_default_prefix]
612   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
613                           [PREFIX]
614
615 By default, \`make install' will install all the files in
616 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
617 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
618 for instance \`--prefix=\$HOME'.
619
620 For better control, use the options below.
621
622 Fine tuning of the installation directories:
623   --bindir=DIR            user executables [EPREFIX/bin]
624   --sbindir=DIR           system admin executables [EPREFIX/sbin]
625   --libexecdir=DIR        program executables [EPREFIX/libexec]
626   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
627   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
628   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
629   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
630   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
631   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
632   --libdir=DIR            object code libraries [EPREFIX/lib]
633   --includedir=DIR        C header files [PREFIX/include]
634   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
635   --infodir=DIR           info documentation [DATAROOTDIR/info]
636   --mandir=DIR            man documentation [DATAROOTDIR/man]
637 EOF
638
639   cat <<\EOF
640
641 Program names:
642   --program-prefix=PREFIX            prepend PREFIX to installed program names
643   --program-suffix=SUFFIX            append SUFFIX to installed program names
644   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
645
646 X features:
647   --x-includes=DIR    X include files are in DIR
648   --x-libraries=DIR   X library files are in DIR
649
650 System types:
651   --build=BUILD           configure for building on BUILD [guessed]
652   --host=HOST       build programs to run on HOST [BUILD]
653 EOF
654 fi
655
656 if test -n "$ac_init_help"; then
657
658   cat <<\EOF
659
660 Optional Features:
661   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
662   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
663
664 Optional Packages:
665   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
666   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
667
668 General Options:
669   --disable-stripping     do not strip (debug info) installed executables
670   --enable-string-hacks   work around bogus compiler/loader warnings
671   --with-pkg-config{=path} enable/disable use of pkg-config
672   --disable-echo          do not display "compiling" commands
673 Curses Version-dependent Options:
674   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
675   --disable-widec         disable checks for wide-character functions
676   --with-curses-dir=DIR   directory in which (n)curses is installed
677   --with-screen=XXX       use specified curses-libraries
678   --with-ncursesw         use wide ncurses-libraries
679   --with-ncurses          use ncurses-libraries
680   --with-pdcurses         compile/link with pdcurses X11 library
681   --with-curses-colr      compile/link with HPUX 10.x color-curses
682   --with-curses-5lib      compile/link with SunOS 5lib curses
683   --with-Xaw3d            link with Xaw 3d library
684   --with-Xaw3dxft         link with Xaw 3d xft library
685   --with-neXtaw           link with neXT Athena library
686   --with-XawPlus          link with Athena-Plus library
687   --with-x                use the X Window System
688   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
689   --disable-panel         disable checks for panel functions
690   --disable-menu          disable checks for menu functions
691   --disable-form          disable checks for form functions
692 Testing/development Options:
693   --enable-warnings       test: turn on gcc compiler warnings
694   --with-dmalloc          test: use Gray Watson's dmalloc library
695   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
696   --with-valgrind         test: use valgrind
697   --disable-leaks         test: free permanent memory, analyze leaks
698   --disable-rpath-hack    don't add rpath options for additional libraries
699
700 Some influential environment variables:
701   CC          C compiler command
702   CFLAGS      C compiler flags
703   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
704               nonstandard directory <lib dir>
705   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
706               headers in a nonstandard directory <include dir>
707   CPP         C preprocessor
708
709 Use these variables to override the choices made by `configure' or to help
710 it to find libraries and programs with nonstandard names/locations.
711
712 EOF
713 fi
714
715 if test "$ac_init_help" = "recursive"; then
716   # If there are subdirs, report their specific --help.
717   ac_popdir=`pwd`
718   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
719     cd $ac_subdir
720     # A "../" for each directory in /$ac_subdir.
721     ac_dots=`echo $ac_subdir |
722              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
723
724     case $srcdir in
725     .) # No --srcdir option.  We are building in place.
726       ac_sub_srcdir=$srcdir ;;
727     [\\/]* | ?:[\\/]* ) # Absolute path.
728       ac_sub_srcdir=$srcdir/$ac_subdir ;;
729     *) # Relative path.
730       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
731     esac
732
733     # Check for guested configure; otherwise get Cygnus style configure.
734     if test -f $ac_sub_srcdir/configure.gnu; then
735       echo
736       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
737     elif test -f $ac_sub_srcdir/configure; then
738       echo
739       $SHELL $ac_sub_srcdir/configure  --help=recursive
740     elif test -f $ac_sub_srcdir/configure.ac ||
741            test -f $ac_sub_srcdir/configure.in; then
742       echo
743       $ac_configure --help
744     else
745       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
746     fi
747     cd $ac_popdir
748   done
749 fi
750
751 test -n "$ac_init_help" && exit 0
752 if $ac_init_version; then
753   cat <<\EOF
754
755 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
756 Free Software Foundation, Inc.
757 This configure script is free software; the Free Software Foundation
758 gives unlimited permission to copy, distribute and modify it.
759 EOF
760   exit 0
761 fi
762 exec 5>config.log
763 cat >&5 <<EOF
764 This file contains any messages produced by compilers while
765 running configure, to aid debugging if configure makes a mistake.
766
767 It was created by $as_me, which was
768 generated by GNU Autoconf 2.52.20181006.  Invocation command line was
769
770   $ $0 $@
771
772 EOF
773 {
774 cat <<_ASUNAME
775 ## ---------- ##
776 ## Platform.  ##
777 ## ---------- ##
778
779 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
780 uname -m = `(uname -m) 2>/dev/null || echo unknown`
781 uname -r = `(uname -r) 2>/dev/null || echo unknown`
782 uname -s = `(uname -s) 2>/dev/null || echo unknown`
783 uname -v = `(uname -v) 2>/dev/null || echo unknown`
784
785 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
786 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
787
788 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
789 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
790 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
791 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
792 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
793 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
794 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
795
796 PATH = $PATH
797
798 _ASUNAME
799 } >&5
800
801 cat >&5 <<EOF
802 ## ------------ ##
803 ## Core tests.  ##
804 ## ------------ ##
805
806 EOF
807
808 # Keep a trace of the command line.
809 # Strip out --no-create and --no-recursion so they do not pile up.
810 # Also quote any args containing shell meta-characters.
811 ac_configure_args=
812 ac_sep=
813 for ac_arg
814 do
815   case $ac_arg in
816   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
817   | --no-cr | --no-c) ;;
818   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
819   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
820   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
821     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
822     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
823     ac_sep=" " ;;
824   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
825      ac_sep=" " ;;
826   esac
827   # Get rid of the leading space.
828 done
829
830 # When interrupted or exit'd, cleanup temporary files, and complete
831 # config.log.  We remove comments because anyway the quotes in there
832 # would cause problems or look ugly.
833 trap 'exit_status=$?
834   # Save into config.log some information that might help in debugging.
835   echo >&5
836   echo "## ----------------- ##" >&5
837   echo "## Cache variables.  ##" >&5
838   echo "## ----------------- ##" >&5
839   echo >&5
840   # The following way of writing the cache mishandles newlines in values,
841 {
842   (set) 2>&1 |
843     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
844     *ac_space=\ *)
845       sed -n \
846         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
847           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
848       ;;
849     *)
850       sed -n \
851         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
852       ;;
853     esac;
854 } >&5
855   sed "/^$/d" confdefs.h >conftest.log
856   if test -s conftest.log; then
857     echo >&5
858     echo "## ------------ ##" >&5
859     echo "## confdefs.h.  ##" >&5
860     echo "## ------------ ##" >&5
861     echo >&5
862     cat conftest.log >&5
863   fi
864   (echo; echo) >&5
865   test "$ac_signal" != 0 &&
866     echo "$as_me: caught signal $ac_signal" >&5
867   echo "$as_me: exit $exit_status" >&5
868   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
869     exit $exit_status
870      ' 0
871 for ac_signal in 1 2 13 15; do
872   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
873 done
874 ac_signal=0
875
876 # confdefs.h avoids OS command line length limits that DEFS can exceed.
877 rm -rf conftest* confdefs.h
878 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
879 echo >confdefs.h
880
881 # Let the site file select an alternate cache file if it wants to.
882 # Prefer explicitly selected file to automatically selected ones.
883 if test -z "$CONFIG_SITE"; then
884   if test "x$prefix" != xNONE; then
885     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
886   else
887     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
888   fi
889 fi
890 for ac_site_file in $CONFIG_SITE; do
891   if test -r "$ac_site_file"; then
892     { echo "$as_me:892: loading site script $ac_site_file" >&5
893 echo "$as_me: loading site script $ac_site_file" >&6;}
894     cat "$ac_site_file" >&5
895     . "$ac_site_file"
896   fi
897 done
898
899 if test -r "$cache_file"; then
900   # Some versions of bash will fail to source /dev/null (special
901   # files actually), so we avoid doing that.
902   if test -f "$cache_file"; then
903     { echo "$as_me:903: loading cache $cache_file" >&5
904 echo "$as_me: loading cache $cache_file" >&6;}
905     case $cache_file in
906       [\\/]* | ?:[\\/]* ) . $cache_file;;
907       *)                      . ./$cache_file;;
908     esac
909   fi
910 else
911   { echo "$as_me:911: creating cache $cache_file" >&5
912 echo "$as_me: creating cache $cache_file" >&6;}
913   >$cache_file
914 fi
915
916 # Check that the precious variables saved in the cache have kept the same
917 # value.
918 ac_cache_corrupted=false
919 for ac_var in `(set) 2>&1 |
920                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
921   eval ac_old_set=\$ac_cv_env_${ac_var}_set
922   eval ac_new_set=\$ac_env_${ac_var}_set
923   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
924   eval ac_new_val="\$ac_env_${ac_var}_value"
925   case $ac_old_set,$ac_new_set in
926     set,)
927       { echo "$as_me:927: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
928 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
929       ac_cache_corrupted=: ;;
930     ,set)
931       { echo "$as_me:931: error: \`$ac_var' was not set in the previous run" >&5
932 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
933       ac_cache_corrupted=: ;;
934     ,);;
935     *)
936       if test "x$ac_old_val" != "x$ac_new_val"; then
937         { echo "$as_me:937: error: \`$ac_var' has changed since the previous run:" >&5
938 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
939         { echo "$as_me:939:   former value:  $ac_old_val" >&5
940 echo "$as_me:   former value:  $ac_old_val" >&2;}
941         { echo "$as_me:941:   current value: $ac_new_val" >&5
942 echo "$as_me:   current value: $ac_new_val" >&2;}
943         ac_cache_corrupted=:
944       fi;;
945   esac
946   # Pass precious variables to config.status.  It doesn't matter if
947   # we pass some twice (in addition to the command line arguments).
948   if test "$ac_new_set" = set; then
949     case $ac_new_val in
950     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
951       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
952       ac_configure_args="$ac_configure_args '$ac_arg'"
953       ;;
954     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
955        ;;
956     esac
957   fi
958 done
959 if $ac_cache_corrupted; then
960   { echo "$as_me:960: error: changes in the environment can compromise the build" >&5
961 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
962   { { echo "$as_me:962: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
963 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
964    { (exit 1); exit 1; }; }
965 fi
966
967 ac_ext=c
968 ac_cpp='$CPP $CPPFLAGS'
969 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
970 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
971 ac_compiler_gnu=$ac_cv_c_compiler_gnu
972 ac_main_return=return
973
974 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
975   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
976                    ECHO_T='     ' ;;
977   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
978   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
979 esac
980 echo "#! $SHELL" >conftest.sh
981 echo  "exit 0"   >>conftest.sh
982 chmod +x conftest.sh
983 if { (echo "$as_me:983: PATH=\".;.\"; conftest.sh") >&5
984   (PATH=".;."; conftest.sh) 2>&5
985   ac_status=$?
986   echo "$as_me:986: \$? = $ac_status" >&5
987   (exit $ac_status); }; then
988   ac_path_separator=';'
989 else
990   ac_path_separator=:
991 fi
992 PATH_SEPARATOR="$ac_path_separator"
993 rm -f conftest.sh
994
995 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
996
997 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
998
999 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1000
1001 ac_aux_dir=
1002 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1003   if test -f $ac_dir/install-sh; then
1004     ac_aux_dir=$ac_dir
1005     ac_install_sh="$ac_aux_dir/install-sh -c"
1006     break
1007   elif test -f $ac_dir/install.sh; then
1008     ac_aux_dir=$ac_dir
1009     ac_install_sh="$ac_aux_dir/install.sh -c"
1010     break
1011   elif test -f $ac_dir/shtool; then
1012     ac_aux_dir=$ac_dir
1013     ac_install_sh="$ac_aux_dir/shtool install -c"
1014     break
1015   fi
1016 done
1017 if test -z "$ac_aux_dir"; then
1018   { { echo "$as_me:1018: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1019 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1020    { (exit 1); exit 1; }; }
1021 fi
1022 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1023 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1024 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1025
1026 # Make sure we can run config.sub.
1027 $ac_config_sub sun4 >/dev/null 2>&1 ||
1028   { { echo "$as_me:1028: error: cannot run $ac_config_sub" >&5
1029 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 echo "$as_me:1032: checking build system type" >&5
1033 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1034 if test "${ac_cv_build+set}" = set; then
1035   echo $ECHO_N "(cached) $ECHO_C" >&6
1036 else
1037   ac_cv_build_alias=$build_alias
1038 test -z "$ac_cv_build_alias" &&
1039   ac_cv_build_alias=`$ac_config_guess`
1040 test -z "$ac_cv_build_alias" &&
1041   { { echo "$as_me:1041: error: cannot guess build type; you must specify one" >&5
1042 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1043    { (exit 1); exit 1; }; }
1044 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1045   { { echo "$as_me:1045: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1046 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1047    { (exit 1); exit 1; }; }
1048
1049 fi
1050 echo "$as_me:1050: result: $ac_cv_build" >&5
1051 echo "${ECHO_T}$ac_cv_build" >&6
1052 build=$ac_cv_build
1053 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1054 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1055 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1056
1057 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1058         echo "$as_me:1058: checking host system type" >&5
1059 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1060 if test "${ac_cv_host+set}" = set; then
1061   echo $ECHO_N "(cached) $ECHO_C" >&6
1062 else
1063   ac_cv_host_alias=$host_alias
1064 test -z "$ac_cv_host_alias" &&
1065   ac_cv_host_alias=$ac_cv_build_alias
1066 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1067   { { echo "$as_me:1067: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1068 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 fi
1072 echo "$as_me:1072: result: $ac_cv_host" >&5
1073 echo "${ECHO_T}$ac_cv_host" >&6
1074 host=$ac_cv_host
1075 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1076 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1077 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1078
1079         system_name="$host_os"
1080 else
1081         system_name="`(uname -s -r) 2>/dev/null`"
1082         if test -z "$system_name" ; then
1083                 system_name="`(hostname) 2>/dev/null`"
1084         fi
1085 fi
1086 test -n "$system_name" &&
1087 cat >>confdefs.h <<EOF
1088 #define SYSTEM_NAME "$system_name"
1089 EOF
1090
1091 if test "${cf_cv_system_name+set}" = set; then
1092   echo $ECHO_N "(cached) $ECHO_C" >&6
1093 else
1094   cf_cv_system_name="$system_name"
1095 fi
1096
1097 test -z "$system_name" && system_name="$cf_cv_system_name"
1098 test -n "$cf_cv_system_name" && echo "$as_me:1098: result: Configuring for $cf_cv_system_name" >&5
1099 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1100
1101 if test ".$system_name" != ".$cf_cv_system_name" ; then
1102         echo "$as_me:1102: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1103 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1104         { { echo "$as_me:1104: error: \"Please remove config.cache and try again.\"" >&5
1105 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1106    { (exit 1); exit 1; }; }
1107 fi
1108
1109 test "$program_prefix" != NONE &&
1110   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1111 # Use a double $ so make ignores it.
1112 test "$program_suffix" != NONE &&
1113   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1114 # Double any \ or $.  echo might interpret backslashes.
1115 # By default was `s,x,x', remove it if useless.
1116 cat <<\_ACEOF >conftest.sed
1117 s/[\\$]/&&/g;s/;s,x,x,$//
1118 _ACEOF
1119 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1120 rm conftest.sed
1121
1122 echo "$as_me:1122: checking whether ${MAKE-make} sets \${MAKE}" >&5
1123 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1124 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1125 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1126   echo $ECHO_N "(cached) $ECHO_C" >&6
1127 else
1128   cat >conftest.make <<\EOF
1129 all:
1130         @echo 'ac_maketemp="${MAKE}"'
1131 EOF
1132 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1133 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1134 if test -n "$ac_maketemp"; then
1135   eval ac_cv_prog_make_${ac_make}_set=yes
1136 else
1137   eval ac_cv_prog_make_${ac_make}_set=no
1138 fi
1139 rm -f conftest.make
1140 fi
1141 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1142   echo "$as_me:1142: result: yes" >&5
1143 echo "${ECHO_T}yes" >&6
1144   SET_MAKE=
1145 else
1146   echo "$as_me:1146: result: no" >&5
1147 echo "${ECHO_T}no" >&6
1148   SET_MAKE="MAKE=${MAKE-make}"
1149 fi
1150
1151 ac_ext=c
1152 ac_cpp='$CPP $CPPFLAGS'
1153 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1154 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1155 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1156 ac_main_return=return
1157 if test -n "$ac_tool_prefix"; then
1158   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1159 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1160 echo "$as_me:1160: checking for $ac_word" >&5
1161 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1162 if test "${ac_cv_prog_CC+set}" = set; then
1163   echo $ECHO_N "(cached) $ECHO_C" >&6
1164 else
1165   if test -n "$CC"; then
1166   ac_cv_prog_CC="$CC" # Let the user override the test.
1167 else
1168   ac_save_IFS=$IFS; IFS=$ac_path_separator
1169 ac_dummy="$PATH"
1170 for ac_dir in $ac_dummy; do
1171   IFS=$ac_save_IFS
1172   test -z "$ac_dir" && ac_dir=.
1173   $as_executable_p "$ac_dir/$ac_word" || continue
1174 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1175 echo "$as_me:1175: found $ac_dir/$ac_word" >&5
1176 break
1177 done
1178
1179 fi
1180 fi
1181 CC=$ac_cv_prog_CC
1182 if test -n "$CC"; then
1183   echo "$as_me:1183: result: $CC" >&5
1184 echo "${ECHO_T}$CC" >&6
1185 else
1186   echo "$as_me:1186: result: no" >&5
1187 echo "${ECHO_T}no" >&6
1188 fi
1189
1190 fi
1191 if test -z "$ac_cv_prog_CC"; then
1192   ac_ct_CC=$CC
1193   # Extract the first word of "gcc", so it can be a program name with args.
1194 set dummy gcc; ac_word=$2
1195 echo "$as_me:1195: checking for $ac_word" >&5
1196 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1197 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1198   echo $ECHO_N "(cached) $ECHO_C" >&6
1199 else
1200   if test -n "$ac_ct_CC"; then
1201   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1202 else
1203   ac_save_IFS=$IFS; IFS=$ac_path_separator
1204 ac_dummy="$PATH"
1205 for ac_dir in $ac_dummy; do
1206   IFS=$ac_save_IFS
1207   test -z "$ac_dir" && ac_dir=.
1208   $as_executable_p "$ac_dir/$ac_word" || continue
1209 ac_cv_prog_ac_ct_CC="gcc"
1210 echo "$as_me:1210: found $ac_dir/$ac_word" >&5
1211 break
1212 done
1213
1214 fi
1215 fi
1216 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1217 if test -n "$ac_ct_CC"; then
1218   echo "$as_me:1218: result: $ac_ct_CC" >&5
1219 echo "${ECHO_T}$ac_ct_CC" >&6
1220 else
1221   echo "$as_me:1221: result: no" >&5
1222 echo "${ECHO_T}no" >&6
1223 fi
1224
1225   CC=$ac_ct_CC
1226 else
1227   CC="$ac_cv_prog_CC"
1228 fi
1229
1230 if test -z "$CC"; then
1231   if test -n "$ac_tool_prefix"; then
1232   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1233 set dummy ${ac_tool_prefix}cc; ac_word=$2
1234 echo "$as_me:1234: checking for $ac_word" >&5
1235 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1236 if test "${ac_cv_prog_CC+set}" = set; then
1237   echo $ECHO_N "(cached) $ECHO_C" >&6
1238 else
1239   if test -n "$CC"; then
1240   ac_cv_prog_CC="$CC" # Let the user override the test.
1241 else
1242   ac_save_IFS=$IFS; IFS=$ac_path_separator
1243 ac_dummy="$PATH"
1244 for ac_dir in $ac_dummy; do
1245   IFS=$ac_save_IFS
1246   test -z "$ac_dir" && ac_dir=.
1247   $as_executable_p "$ac_dir/$ac_word" || continue
1248 ac_cv_prog_CC="${ac_tool_prefix}cc"
1249 echo "$as_me:1249: found $ac_dir/$ac_word" >&5
1250 break
1251 done
1252
1253 fi
1254 fi
1255 CC=$ac_cv_prog_CC
1256 if test -n "$CC"; then
1257   echo "$as_me:1257: result: $CC" >&5
1258 echo "${ECHO_T}$CC" >&6
1259 else
1260   echo "$as_me:1260: result: no" >&5
1261 echo "${ECHO_T}no" >&6
1262 fi
1263
1264 fi
1265 if test -z "$ac_cv_prog_CC"; then
1266   ac_ct_CC=$CC
1267   # Extract the first word of "cc", so it can be a program name with args.
1268 set dummy cc; ac_word=$2
1269 echo "$as_me:1269: checking for $ac_word" >&5
1270 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1271 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1272   echo $ECHO_N "(cached) $ECHO_C" >&6
1273 else
1274   if test -n "$ac_ct_CC"; then
1275   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1276 else
1277   ac_save_IFS=$IFS; IFS=$ac_path_separator
1278 ac_dummy="$PATH"
1279 for ac_dir in $ac_dummy; do
1280   IFS=$ac_save_IFS
1281   test -z "$ac_dir" && ac_dir=.
1282   $as_executable_p "$ac_dir/$ac_word" || continue
1283 ac_cv_prog_ac_ct_CC="cc"
1284 echo "$as_me:1284: found $ac_dir/$ac_word" >&5
1285 break
1286 done
1287
1288 fi
1289 fi
1290 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1291 if test -n "$ac_ct_CC"; then
1292   echo "$as_me:1292: result: $ac_ct_CC" >&5
1293 echo "${ECHO_T}$ac_ct_CC" >&6
1294 else
1295   echo "$as_me:1295: result: no" >&5
1296 echo "${ECHO_T}no" >&6
1297 fi
1298
1299   CC=$ac_ct_CC
1300 else
1301   CC="$ac_cv_prog_CC"
1302 fi
1303
1304 fi
1305 if test -z "$CC"; then
1306   # Extract the first word of "cc", so it can be a program name with args.
1307 set dummy cc; ac_word=$2
1308 echo "$as_me:1308: checking for $ac_word" >&5
1309 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1310 if test "${ac_cv_prog_CC+set}" = set; then
1311   echo $ECHO_N "(cached) $ECHO_C" >&6
1312 else
1313   if test -n "$CC"; then
1314   ac_cv_prog_CC="$CC" # Let the user override the test.
1315 else
1316   ac_prog_rejected=no
1317   ac_save_IFS=$IFS; IFS=$ac_path_separator
1318 ac_dummy="$PATH"
1319 for ac_dir in $ac_dummy; do
1320   IFS=$ac_save_IFS
1321   test -z "$ac_dir" && ac_dir=.
1322   $as_executable_p "$ac_dir/$ac_word" || continue
1323 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1324   ac_prog_rejected=yes
1325   continue
1326 fi
1327 ac_cv_prog_CC="cc"
1328 echo "$as_me:1328: found $ac_dir/$ac_word" >&5
1329 break
1330 done
1331
1332 if test $ac_prog_rejected = yes; then
1333   # We found a bogon in the path, so make sure we never use it.
1334   set dummy $ac_cv_prog_CC
1335   shift
1336   if test $# != 0; then
1337     # We chose a different compiler from the bogus one.
1338     # However, it has the same basename, so the bogon will be chosen
1339     # first if we set CC to just the basename; use the full file name.
1340     shift
1341     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1342     shift
1343     ac_cv_prog_CC="$@"
1344   fi
1345 fi
1346 fi
1347 fi
1348 CC=$ac_cv_prog_CC
1349 if test -n "$CC"; then
1350   echo "$as_me:1350: result: $CC" >&5
1351 echo "${ECHO_T}$CC" >&6
1352 else
1353   echo "$as_me:1353: result: no" >&5
1354 echo "${ECHO_T}no" >&6
1355 fi
1356
1357 fi
1358 if test -z "$CC"; then
1359   if test -n "$ac_tool_prefix"; then
1360   for ac_prog in cl
1361   do
1362     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1363 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1364 echo "$as_me:1364: checking for $ac_word" >&5
1365 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1366 if test "${ac_cv_prog_CC+set}" = set; then
1367   echo $ECHO_N "(cached) $ECHO_C" >&6
1368 else
1369   if test -n "$CC"; then
1370   ac_cv_prog_CC="$CC" # Let the user override the test.
1371 else
1372   ac_save_IFS=$IFS; IFS=$ac_path_separator
1373 ac_dummy="$PATH"
1374 for ac_dir in $ac_dummy; do
1375   IFS=$ac_save_IFS
1376   test -z "$ac_dir" && ac_dir=.
1377   $as_executable_p "$ac_dir/$ac_word" || continue
1378 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1379 echo "$as_me:1379: found $ac_dir/$ac_word" >&5
1380 break
1381 done
1382
1383 fi
1384 fi
1385 CC=$ac_cv_prog_CC
1386 if test -n "$CC"; then
1387   echo "$as_me:1387: result: $CC" >&5
1388 echo "${ECHO_T}$CC" >&6
1389 else
1390   echo "$as_me:1390: result: no" >&5
1391 echo "${ECHO_T}no" >&6
1392 fi
1393
1394     test -n "$CC" && break
1395   done
1396 fi
1397 if test -z "$CC"; then
1398   ac_ct_CC=$CC
1399   for ac_prog in cl
1400 do
1401   # Extract the first word of "$ac_prog", so it can be a program name with args.
1402 set dummy $ac_prog; ac_word=$2
1403 echo "$as_me:1403: checking for $ac_word" >&5
1404 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1405 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1406   echo $ECHO_N "(cached) $ECHO_C" >&6
1407 else
1408   if test -n "$ac_ct_CC"; then
1409   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1410 else
1411   ac_save_IFS=$IFS; IFS=$ac_path_separator
1412 ac_dummy="$PATH"
1413 for ac_dir in $ac_dummy; do
1414   IFS=$ac_save_IFS
1415   test -z "$ac_dir" && ac_dir=.
1416   $as_executable_p "$ac_dir/$ac_word" || continue
1417 ac_cv_prog_ac_ct_CC="$ac_prog"
1418 echo "$as_me:1418: found $ac_dir/$ac_word" >&5
1419 break
1420 done
1421
1422 fi
1423 fi
1424 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1425 if test -n "$ac_ct_CC"; then
1426   echo "$as_me:1426: result: $ac_ct_CC" >&5
1427 echo "${ECHO_T}$ac_ct_CC" >&6
1428 else
1429   echo "$as_me:1429: result: no" >&5
1430 echo "${ECHO_T}no" >&6
1431 fi
1432
1433   test -n "$ac_ct_CC" && break
1434 done
1435
1436   CC=$ac_ct_CC
1437 fi
1438
1439 fi
1440
1441 test -z "$CC" && { { echo "$as_me:1441: error: no acceptable cc found in \$PATH" >&5
1442 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1443    { (exit 1); exit 1; }; }
1444
1445 # Provide some information about the compiler.
1446 echo "$as_me:1446:" \
1447      "checking for C compiler version" >&5
1448 ac_compiler=`set X $ac_compile; echo $2`
1449 { (eval echo "$as_me:1449: \"$ac_compiler --version </dev/null >&5\"") >&5
1450   (eval $ac_compiler --version </dev/null >&5) 2>&5
1451   ac_status=$?
1452   echo "$as_me:1452: \$? = $ac_status" >&5
1453   (exit $ac_status); }
1454 { (eval echo "$as_me:1454: \"$ac_compiler -v </dev/null >&5\"") >&5
1455   (eval $ac_compiler -v </dev/null >&5) 2>&5
1456   ac_status=$?
1457   echo "$as_me:1457: \$? = $ac_status" >&5
1458   (exit $ac_status); }
1459 { (eval echo "$as_me:1459: \"$ac_compiler -V </dev/null >&5\"") >&5
1460   (eval $ac_compiler -V </dev/null >&5) 2>&5
1461   ac_status=$?
1462   echo "$as_me:1462: \$? = $ac_status" >&5
1463   (exit $ac_status); }
1464
1465 cat >conftest.$ac_ext <<_ACEOF
1466 #line 1466 "configure"
1467 #include "confdefs.h"
1468
1469 int
1470 main (void)
1471 {
1472
1473   ;
1474   return 0;
1475 }
1476 _ACEOF
1477 ac_clean_files_save=$ac_clean_files
1478 ac_clean_files="$ac_clean_files a.out a.exe"
1479 # Try to create an executable without -o first, disregard a.out.
1480 # It will help us diagnose broken compilers, and finding out an intuition
1481 # of exeext.
1482 echo "$as_me:1482: checking for C compiler default output" >&5
1483 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1484 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1485 if { (eval echo "$as_me:1485: \"$ac_link_default\"") >&5
1486   (eval $ac_link_default) 2>&5
1487   ac_status=$?
1488   echo "$as_me:1488: \$? = $ac_status" >&5
1489   (exit $ac_status); }; then
1490   # Find the output, starting from the most likely.  This scheme is
1491 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1492 # resort.
1493 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1494                 ls a.out conftest 2>/dev/null;
1495                 ls a.* conftest.* 2>/dev/null`; do
1496   case $ac_file in
1497     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1498     a.out ) # We found the default executable, but exeext='' is most
1499             # certainly right.
1500             break;;
1501     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1502           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1503           export ac_cv_exeext
1504           break;;
1505     * ) break;;
1506   esac
1507 done
1508 else
1509   echo "$as_me: failed program was:" >&5
1510 cat conftest.$ac_ext >&5
1511 { { echo "$as_me:1511: error: C compiler cannot create executables" >&5
1512 echo "$as_me: error: C compiler cannot create executables" >&2;}
1513    { (exit 77); exit 77; }; }
1514 fi
1515
1516 ac_exeext=$ac_cv_exeext
1517 echo "$as_me:1517: result: $ac_file" >&5
1518 echo "${ECHO_T}$ac_file" >&6
1519
1520 # Check the compiler produces executables we can run.  If not, either
1521 # the compiler is broken, or we cross compile.
1522 echo "$as_me:1522: checking whether the C compiler works" >&5
1523 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1524 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1525 # If not cross compiling, check that we can run a simple program.
1526 if test "$cross_compiling" != yes; then
1527   if { ac_try='./$ac_file'
1528   { (eval echo "$as_me:1528: \"$ac_try\"") >&5
1529   (eval $ac_try) 2>&5
1530   ac_status=$?
1531   echo "$as_me:1531: \$? = $ac_status" >&5
1532   (exit $ac_status); }; }; then
1533     cross_compiling=no
1534   else
1535     if test "$cross_compiling" = maybe; then
1536         cross_compiling=yes
1537     else
1538         { { echo "$as_me:1538: error: cannot run C compiled programs.
1539 If you meant to cross compile, use \`--host'." >&5
1540 echo "$as_me: error: cannot run C compiled programs.
1541 If you meant to cross compile, use \`--host'." >&2;}
1542    { (exit 1); exit 1; }; }
1543     fi
1544   fi
1545 fi
1546 echo "$as_me:1546: result: yes" >&5
1547 echo "${ECHO_T}yes" >&6
1548
1549 rm -f a.out a.exe conftest$ac_cv_exeext
1550 ac_clean_files=$ac_clean_files_save
1551 # Check the compiler produces executables we can run.  If not, either
1552 # the compiler is broken, or we cross compile.
1553 echo "$as_me:1553: checking whether we are cross compiling" >&5
1554 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1555 echo "$as_me:1555: result: $cross_compiling" >&5
1556 echo "${ECHO_T}$cross_compiling" >&6
1557
1558 echo "$as_me:1558: checking for executable suffix" >&5
1559 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1560 if { (eval echo "$as_me:1560: \"$ac_link\"") >&5
1561   (eval $ac_link) 2>&5
1562   ac_status=$?
1563   echo "$as_me:1563: \$? = $ac_status" >&5
1564   (exit $ac_status); }; then
1565   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1566 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1567 # work properly (i.e., refer to `conftest.exe'), while it won't with
1568 # `rm'.
1569 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1570   case $ac_file in
1571     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1572     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1573           export ac_cv_exeext
1574           break;;
1575     * ) break;;
1576   esac
1577 done
1578 else
1579   { { echo "$as_me:1579: error: cannot compute EXEEXT: cannot compile and link" >&5
1580 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1581    { (exit 1); exit 1; }; }
1582 fi
1583
1584 rm -f conftest$ac_cv_exeext
1585 echo "$as_me:1585: result: $ac_cv_exeext" >&5
1586 echo "${ECHO_T}$ac_cv_exeext" >&6
1587
1588 rm -f conftest.$ac_ext
1589 EXEEXT=$ac_cv_exeext
1590 ac_exeext=$EXEEXT
1591 echo "$as_me:1591: checking for object suffix" >&5
1592 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1593 if test "${ac_cv_objext+set}" = set; then
1594   echo $ECHO_N "(cached) $ECHO_C" >&6
1595 else
1596   cat >conftest.$ac_ext <<_ACEOF
1597 #line 1597 "configure"
1598 #include "confdefs.h"
1599
1600 int
1601 main (void)
1602 {
1603
1604   ;
1605   return 0;
1606 }
1607 _ACEOF
1608 rm -f conftest.o conftest.obj
1609 if { (eval echo "$as_me:1609: \"$ac_compile\"") >&5
1610   (eval $ac_compile) 2>&5
1611   ac_status=$?
1612   echo "$as_me:1612: \$? = $ac_status" >&5
1613   (exit $ac_status); }; then
1614   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1615   case $ac_file in
1616     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1617     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1618        break;;
1619   esac
1620 done
1621 else
1622   echo "$as_me: failed program was:" >&5
1623 cat conftest.$ac_ext >&5
1624 { { echo "$as_me:1624: error: cannot compute OBJEXT: cannot compile" >&5
1625 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1626    { (exit 1); exit 1; }; }
1627 fi
1628
1629 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1630 fi
1631 echo "$as_me:1631: result: $ac_cv_objext" >&5
1632 echo "${ECHO_T}$ac_cv_objext" >&6
1633 OBJEXT=$ac_cv_objext
1634 ac_objext=$OBJEXT
1635 echo "$as_me:1635: checking whether we are using the GNU C compiler" >&5
1636 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1637 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1638   echo $ECHO_N "(cached) $ECHO_C" >&6
1639 else
1640   cat >conftest.$ac_ext <<_ACEOF
1641 #line 1641 "configure"
1642 #include "confdefs.h"
1643
1644 int
1645 main (void)
1646 {
1647 #ifndef __GNUC__
1648        choke me
1649 #endif
1650
1651   ;
1652   return 0;
1653 }
1654 _ACEOF
1655 rm -f conftest.$ac_objext
1656 if { (eval echo "$as_me:1656: \"$ac_compile\"") >&5
1657   (eval $ac_compile) 2>&5
1658   ac_status=$?
1659   echo "$as_me:1659: \$? = $ac_status" >&5
1660   (exit $ac_status); } &&
1661          { ac_try='test -s conftest.$ac_objext'
1662   { (eval echo "$as_me:1662: \"$ac_try\"") >&5
1663   (eval $ac_try) 2>&5
1664   ac_status=$?
1665   echo "$as_me:1665: \$? = $ac_status" >&5
1666   (exit $ac_status); }; }; then
1667   ac_compiler_gnu=yes
1668 else
1669   echo "$as_me: failed program was:" >&5
1670 cat conftest.$ac_ext >&5
1671 ac_compiler_gnu=no
1672 fi
1673 rm -f conftest.$ac_objext conftest.$ac_ext
1674 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1675
1676 fi
1677 echo "$as_me:1677: result: $ac_cv_c_compiler_gnu" >&5
1678 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1679 GCC=`test $ac_compiler_gnu = yes && echo yes`
1680 ac_test_CFLAGS=${CFLAGS+set}
1681 ac_save_CFLAGS=$CFLAGS
1682 CFLAGS="-g"
1683 echo "$as_me:1683: checking whether $CC accepts -g" >&5
1684 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1685 if test "${ac_cv_prog_cc_g+set}" = set; then
1686   echo $ECHO_N "(cached) $ECHO_C" >&6
1687 else
1688   cat >conftest.$ac_ext <<_ACEOF
1689 #line 1689 "configure"
1690 #include "confdefs.h"
1691
1692 int
1693 main (void)
1694 {
1695
1696   ;
1697   return 0;
1698 }
1699 _ACEOF
1700 rm -f conftest.$ac_objext
1701 if { (eval echo "$as_me:1701: \"$ac_compile\"") >&5
1702   (eval $ac_compile) 2>&5
1703   ac_status=$?
1704   echo "$as_me:1704: \$? = $ac_status" >&5
1705   (exit $ac_status); } &&
1706          { ac_try='test -s conftest.$ac_objext'
1707   { (eval echo "$as_me:1707: \"$ac_try\"") >&5
1708   (eval $ac_try) 2>&5
1709   ac_status=$?
1710   echo "$as_me:1710: \$? = $ac_status" >&5
1711   (exit $ac_status); }; }; then
1712   ac_cv_prog_cc_g=yes
1713 else
1714   echo "$as_me: failed program was:" >&5
1715 cat conftest.$ac_ext >&5
1716 ac_cv_prog_cc_g=no
1717 fi
1718 rm -f conftest.$ac_objext conftest.$ac_ext
1719 fi
1720 echo "$as_me:1720: result: $ac_cv_prog_cc_g" >&5
1721 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1722 if test "$ac_test_CFLAGS" = set; then
1723   CFLAGS=$ac_save_CFLAGS
1724 elif test $ac_cv_prog_cc_g = yes; then
1725   if test "$GCC" = yes; then
1726     CFLAGS="-g -O2"
1727   else
1728     CFLAGS="-g"
1729   fi
1730 else
1731   if test "$GCC" = yes; then
1732     CFLAGS="-O2"
1733   else
1734     CFLAGS=
1735   fi
1736 fi
1737 # Some people use a C++ compiler to compile C.  Since we use `exit',
1738 # in C++ we need to declare it.  In case someone uses the same compiler
1739 # for both compiling C and C++ we need to have the C++ compiler decide
1740 # the declaration of exit, since it's the most demanding environment.
1741 cat >conftest.$ac_ext <<_ACEOF
1742 #ifndef __cplusplus
1743   choke me
1744 #endif
1745 _ACEOF
1746 rm -f conftest.$ac_objext
1747 if { (eval echo "$as_me:1747: \"$ac_compile\"") >&5
1748   (eval $ac_compile) 2>&5
1749   ac_status=$?
1750   echo "$as_me:1750: \$? = $ac_status" >&5
1751   (exit $ac_status); } &&
1752          { ac_try='test -s conftest.$ac_objext'
1753   { (eval echo "$as_me:1753: \"$ac_try\"") >&5
1754   (eval $ac_try) 2>&5
1755   ac_status=$?
1756   echo "$as_me:1756: \$? = $ac_status" >&5
1757   (exit $ac_status); }; }; then
1758   for ac_declaration in \
1759    ''\
1760    '#include <stdlib.h>' \
1761    'extern "C" void std::exit (int) throw (); using std::exit;' \
1762    'extern "C" void std::exit (int); using std::exit;' \
1763    'extern "C" void exit (int) throw ();' \
1764    'extern "C" void exit (int);' \
1765    'void exit (int);'
1766 do
1767   cat >conftest.$ac_ext <<_ACEOF
1768 #line 1768 "configure"
1769 #include "confdefs.h"
1770 #include <stdlib.h>
1771 $ac_declaration
1772 int
1773 main (void)
1774 {
1775 exit (42);
1776   ;
1777   return 0;
1778 }
1779 _ACEOF
1780 rm -f conftest.$ac_objext
1781 if { (eval echo "$as_me:1781: \"$ac_compile\"") >&5
1782   (eval $ac_compile) 2>&5
1783   ac_status=$?
1784   echo "$as_me:1784: \$? = $ac_status" >&5
1785   (exit $ac_status); } &&
1786          { ac_try='test -s conftest.$ac_objext'
1787   { (eval echo "$as_me:1787: \"$ac_try\"") >&5
1788   (eval $ac_try) 2>&5
1789   ac_status=$?
1790   echo "$as_me:1790: \$? = $ac_status" >&5
1791   (exit $ac_status); }; }; then
1792   :
1793 else
1794   echo "$as_me: failed program was:" >&5
1795 cat conftest.$ac_ext >&5
1796 continue
1797 fi
1798 rm -f conftest.$ac_objext conftest.$ac_ext
1799   cat >conftest.$ac_ext <<_ACEOF
1800 #line 1800 "configure"
1801 #include "confdefs.h"
1802 $ac_declaration
1803 int
1804 main (void)
1805 {
1806 exit (42);
1807   ;
1808   return 0;
1809 }
1810 _ACEOF
1811 rm -f conftest.$ac_objext
1812 if { (eval echo "$as_me:1812: \"$ac_compile\"") >&5
1813   (eval $ac_compile) 2>&5
1814   ac_status=$?
1815   echo "$as_me:1815: \$? = $ac_status" >&5
1816   (exit $ac_status); } &&
1817          { ac_try='test -s conftest.$ac_objext'
1818   { (eval echo "$as_me:1818: \"$ac_try\"") >&5
1819   (eval $ac_try) 2>&5
1820   ac_status=$?
1821   echo "$as_me:1821: \$? = $ac_status" >&5
1822   (exit $ac_status); }; }; then
1823   break
1824 else
1825   echo "$as_me: failed program was:" >&5
1826 cat conftest.$ac_ext >&5
1827 fi
1828 rm -f conftest.$ac_objext conftest.$ac_ext
1829 done
1830 rm -rf conftest*
1831 if test -n "$ac_declaration"; then
1832   echo '#ifdef __cplusplus' >>confdefs.h
1833   echo $ac_declaration      >>confdefs.h
1834   echo '#endif'             >>confdefs.h
1835 fi
1836
1837 else
1838   echo "$as_me: failed program was:" >&5
1839 cat conftest.$ac_ext >&5
1840 fi
1841 rm -f conftest.$ac_objext conftest.$ac_ext
1842 ac_ext=c
1843 ac_cpp='$CPP $CPPFLAGS'
1844 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1845 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1846 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1847 ac_main_return=return
1848
1849 GCC_VERSION=none
1850 if test "$GCC" = yes ; then
1851         echo "$as_me:1851: checking version of $CC" >&5
1852 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1853         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1854         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1855         echo "$as_me:1855: result: $GCC_VERSION" >&5
1856 echo "${ECHO_T}$GCC_VERSION" >&6
1857 fi
1858
1859 echo "$as_me:1859: checking for $CC option to accept ANSI C" >&5
1860 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1861 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1862   echo $ECHO_N "(cached) $ECHO_C" >&6
1863 else
1864   ac_cv_prog_cc_stdc=no
1865 ac_save_CC=$CC
1866 cat >conftest.$ac_ext <<_ACEOF
1867 #line 1867 "configure"
1868 #include "confdefs.h"
1869 #include <stdarg.h>
1870 #include <stdio.h>
1871 #include <sys/types.h>
1872 #include <sys/stat.h>
1873 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1874 struct buf { int x; };
1875 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1876 static char *e (p, i)
1877      char **p;
1878      int i;
1879 {
1880   return p[i];
1881 }
1882 static char *f (char * (*g) (char **, int), char **p, ...)
1883 {
1884   char *s;
1885   va_list v;
1886   va_start (v,p);
1887   s = g (p, va_arg (v,int));
1888   va_end (v);
1889   return s;
1890 }
1891 int test (int i, double x);
1892 struct s1 {int (*f) (int a);};
1893 struct s2 {int (*f) (double a);};
1894 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1895 int argc;
1896 char **argv;
1897 int
1898 main (void)
1899 {
1900 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1901   ;
1902   return 0;
1903 }
1904 _ACEOF
1905 # Don't try gcc -ansi; that turns off useful extensions and
1906 # breaks some systems' header files.
1907 # AIX                   -qlanglvl=ansi
1908 # Ultrix and OSF/1      -std1
1909 # HP-UX 10.20 and later -Ae
1910 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1911 # SVR4                  -Xc -D__EXTENSIONS__
1912 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1913 do
1914   CC="$ac_save_CC $ac_arg"
1915   rm -f conftest.$ac_objext
1916 if { (eval echo "$as_me:1916: \"$ac_compile\"") >&5
1917   (eval $ac_compile) 2>&5
1918   ac_status=$?
1919   echo "$as_me:1919: \$? = $ac_status" >&5
1920   (exit $ac_status); } &&
1921          { ac_try='test -s conftest.$ac_objext'
1922   { (eval echo "$as_me:1922: \"$ac_try\"") >&5
1923   (eval $ac_try) 2>&5
1924   ac_status=$?
1925   echo "$as_me:1925: \$? = $ac_status" >&5
1926   (exit $ac_status); }; }; then
1927   ac_cv_prog_cc_stdc=$ac_arg
1928 break
1929 else
1930   echo "$as_me: failed program was:" >&5
1931 cat conftest.$ac_ext >&5
1932 fi
1933 rm -f conftest.$ac_objext
1934 done
1935 rm -f conftest.$ac_ext conftest.$ac_objext
1936 CC=$ac_save_CC
1937
1938 fi
1939
1940 case "x$ac_cv_prog_cc_stdc" in
1941   x|xno)
1942     echo "$as_me:1942: result: none needed" >&5
1943 echo "${ECHO_T}none needed" >&6 ;;
1944   *)
1945     echo "$as_me:1945: result: $ac_cv_prog_cc_stdc" >&5
1946 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1947     CC="$CC $ac_cv_prog_cc_stdc" ;;
1948 esac
1949
1950 # This should have been defined by AC_PROG_CC
1951 : ${CC:=cc}
1952
1953 echo "$as_me:1953: checking \$CFLAGS variable" >&5
1954 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
1955 case "x$CFLAGS" in
1956 (*-[IUD]*)
1957         echo "$as_me:1957: result: broken" >&5
1958 echo "${ECHO_T}broken" >&6
1959         { echo "$as_me:1959: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
1960 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
1961         cf_flags="$CFLAGS"
1962         CFLAGS=
1963         for cf_arg in $cf_flags
1964         do
1965
1966 cf_fix_cppflags=no
1967 cf_new_cflags=
1968 cf_new_cppflags=
1969 cf_new_extra_cppflags=
1970
1971 for cf_add_cflags in $cf_arg
1972 do
1973 case $cf_fix_cppflags in
1974 (no)
1975         case $cf_add_cflags in
1976         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1977                 case $cf_add_cflags in
1978                 (-D*)
1979                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1980
1981                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1982                                 && test -z "${cf_tst_cflags}" \
1983                                 && cf_fix_cppflags=yes
1984
1985                         if test $cf_fix_cppflags = yes ; then
1986
1987         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1988         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1989
1990                                 continue
1991                         elif test "${cf_tst_cflags}" = "\"'" ; then
1992
1993         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1994         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1995
1996                                 continue
1997                         fi
1998                         ;;
1999                 esac
2000                 case "$CPPFLAGS" in
2001                 (*$cf_add_cflags)
2002                         ;;
2003                 (*)
2004                         case $cf_add_cflags in
2005                         (-D*)
2006                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2007
2008 CPPFLAGS=`echo "$CPPFLAGS" | \
2009         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2010                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2011
2012                                 ;;
2013                         esac
2014
2015         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2016         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2017
2018                         ;;
2019                 esac
2020                 ;;
2021         (*)
2022
2023         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2024         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2025
2026                 ;;
2027         esac
2028         ;;
2029 (yes)
2030
2031         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2032         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2033
2034         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2035
2036         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2037                 && test -z "${cf_tst_cflags}" \
2038                 && cf_fix_cppflags=no
2039         ;;
2040 esac
2041 done
2042
2043 if test -n "$cf_new_cflags" ; then
2044
2045         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2046         CFLAGS="${CFLAGS}$cf_new_cflags"
2047
2048 fi
2049
2050 if test -n "$cf_new_cppflags" ; then
2051
2052         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2053         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2054
2055 fi
2056
2057 if test -n "$cf_new_extra_cppflags" ; then
2058
2059         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2060         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2061
2062 fi
2063
2064         done
2065         ;;
2066 (*)
2067         echo "$as_me:2067: result: ok" >&5
2068 echo "${ECHO_T}ok" >&6
2069         ;;
2070 esac
2071
2072 echo "$as_me:2072: checking \$CC variable" >&5
2073 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2074 case "$CC" in
2075 (*[\ \  ]-*)
2076         echo "$as_me:2076: result: broken" >&5
2077 echo "${ECHO_T}broken" >&6
2078         { echo "$as_me:2078: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2079 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2080         # humor him...
2081         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2082         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2083         CC="$cf_prog"
2084         for cf_arg in $cf_flags
2085         do
2086                 case "x$cf_arg" in
2087                 (x-[IUDfgOW]*)
2088
2089 cf_fix_cppflags=no
2090 cf_new_cflags=
2091 cf_new_cppflags=
2092 cf_new_extra_cppflags=
2093
2094 for cf_add_cflags in $cf_arg
2095 do
2096 case $cf_fix_cppflags in
2097 (no)
2098         case $cf_add_cflags in
2099         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2100                 case $cf_add_cflags in
2101                 (-D*)
2102                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2103
2104                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2105                                 && test -z "${cf_tst_cflags}" \
2106                                 && cf_fix_cppflags=yes
2107
2108                         if test $cf_fix_cppflags = yes ; then
2109
2110         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2111         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2112
2113                                 continue
2114                         elif test "${cf_tst_cflags}" = "\"'" ; then
2115
2116         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2117         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2118
2119                                 continue
2120                         fi
2121                         ;;
2122                 esac
2123                 case "$CPPFLAGS" in
2124                 (*$cf_add_cflags)
2125                         ;;
2126                 (*)
2127                         case $cf_add_cflags in
2128                         (-D*)
2129                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2130
2131 CPPFLAGS=`echo "$CPPFLAGS" | \
2132         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2133                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2134
2135                                 ;;
2136                         esac
2137
2138         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2139         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2140
2141                         ;;
2142                 esac
2143                 ;;
2144         (*)
2145
2146         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2147         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2148
2149                 ;;
2150         esac
2151         ;;
2152 (yes)
2153
2154         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2155         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2156
2157         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2158
2159         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                 && test -z "${cf_tst_cflags}" \
2161                 && cf_fix_cppflags=no
2162         ;;
2163 esac
2164 done
2165
2166 if test -n "$cf_new_cflags" ; then
2167
2168         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2169         CFLAGS="${CFLAGS}$cf_new_cflags"
2170
2171 fi
2172
2173 if test -n "$cf_new_cppflags" ; then
2174
2175         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2176         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2177
2178 fi
2179
2180 if test -n "$cf_new_extra_cppflags" ; then
2181
2182         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2183         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2184
2185 fi
2186
2187                         ;;
2188                 (*)
2189                         CC="$CC $cf_arg"
2190                         ;;
2191                 esac
2192         done
2193         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2194
2195 echo "${as_me:-configure}:2195: testing resulting CC: '$CC' ..." 1>&5
2196
2197         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2198
2199 echo "${as_me:-configure}:2199: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2200
2201         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2202
2203 echo "${as_me:-configure}:2203: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2204
2205         ;;
2206 (*)
2207         echo "$as_me:2207: result: ok" >&5
2208 echo "${ECHO_T}ok" >&6
2209         ;;
2210 esac
2211
2212 echo "$as_me:2212: checking for inline" >&5
2213 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2214 if test "${ac_cv_c_inline+set}" = set; then
2215   echo $ECHO_N "(cached) $ECHO_C" >&6
2216 else
2217   ac_cv_c_inline=no
2218 for ac_kw in inline __inline__ __inline; do
2219   cat >conftest.$ac_ext <<_ACEOF
2220 #line 2220 "configure"
2221 #include "confdefs.h"
2222 #ifndef __cplusplus
2223 static $ac_kw int static_foo () {return 0; }
2224 $ac_kw int foo () {return 0; }
2225 #endif
2226
2227 _ACEOF
2228 rm -f conftest.$ac_objext
2229 if { (eval echo "$as_me:2229: \"$ac_compile\"") >&5
2230   (eval $ac_compile) 2>&5
2231   ac_status=$?
2232   echo "$as_me:2232: \$? = $ac_status" >&5
2233   (exit $ac_status); } &&
2234          { ac_try='test -s conftest.$ac_objext'
2235   { (eval echo "$as_me:2235: \"$ac_try\"") >&5
2236   (eval $ac_try) 2>&5
2237   ac_status=$?
2238   echo "$as_me:2238: \$? = $ac_status" >&5
2239   (exit $ac_status); }; }; then
2240   ac_cv_c_inline=$ac_kw; break
2241 else
2242   echo "$as_me: failed program was:" >&5
2243 cat conftest.$ac_ext >&5
2244 fi
2245 rm -f conftest.$ac_objext conftest.$ac_ext
2246 done
2247
2248 fi
2249 echo "$as_me:2249: result: $ac_cv_c_inline" >&5
2250 echo "${ECHO_T}$ac_cv_c_inline" >&6
2251 case $ac_cv_c_inline in
2252   inline | yes) ;;
2253   no)
2254 cat >>confdefs.h <<\EOF
2255 #define inline
2256 EOF
2257  ;;
2258   *)  cat >>confdefs.h <<EOF
2259 #define inline $ac_cv_c_inline
2260 EOF
2261  ;;
2262 esac
2263
2264 ac_ext=c
2265 ac_cpp='$CPP $CPPFLAGS'
2266 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2267 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2268 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2269 ac_main_return=return
2270 echo "$as_me:2270: checking how to run the C preprocessor" >&5
2271 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2272 # On Suns, sometimes $CPP names a directory.
2273 if test -n "$CPP" && test -d "$CPP"; then
2274   CPP=
2275 fi
2276 if test -z "$CPP"; then
2277   if test "${ac_cv_prog_CPP+set}" = set; then
2278   echo $ECHO_N "(cached) $ECHO_C" >&6
2279 else
2280       # Double quotes because CPP needs to be expanded
2281     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2282     do
2283       ac_preproc_ok=false
2284 for ac_c_preproc_warn_flag in '' yes
2285 do
2286   # Use a header file that comes with gcc, so configuring glibc
2287   # with a fresh cross-compiler works.
2288   # On the NeXT, cc -E runs the code through the compiler's parser,
2289   # not just through cpp. "Syntax error" is here to catch this case.
2290   cat >conftest.$ac_ext <<_ACEOF
2291 #line 2291 "configure"
2292 #include "confdefs.h"
2293 #include <assert.h>
2294                      Syntax error
2295 _ACEOF
2296 if { (eval echo "$as_me:2296: \"$ac_cpp conftest.$ac_ext\"") >&5
2297   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2298   ac_status=$?
2299   egrep -v '^ *\+' conftest.er1 >conftest.err
2300   rm -f conftest.er1
2301   cat conftest.err >&5
2302   echo "$as_me:2302: \$? = $ac_status" >&5
2303   (exit $ac_status); } >/dev/null; then
2304   if test -s conftest.err; then
2305     ac_cpp_err=$ac_c_preproc_warn_flag
2306   else
2307     ac_cpp_err=
2308   fi
2309 else
2310   ac_cpp_err=yes
2311 fi
2312 if test -z "$ac_cpp_err"; then
2313   :
2314 else
2315   echo "$as_me: failed program was:" >&5
2316   cat conftest.$ac_ext >&5
2317   # Broken: fails on valid input.
2318 continue
2319 fi
2320 rm -f conftest.err conftest.$ac_ext
2321
2322   # OK, works on sane cases.  Now check whether non-existent headers
2323   # can be detected and how.
2324   cat >conftest.$ac_ext <<_ACEOF
2325 #line 2325 "configure"
2326 #include "confdefs.h"
2327 #include <ac_nonexistent.h>
2328 _ACEOF
2329 if { (eval echo "$as_me:2329: \"$ac_cpp conftest.$ac_ext\"") >&5
2330   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2331   ac_status=$?
2332   egrep -v '^ *\+' conftest.er1 >conftest.err
2333   rm -f conftest.er1
2334   cat conftest.err >&5
2335   echo "$as_me:2335: \$? = $ac_status" >&5
2336   (exit $ac_status); } >/dev/null; then
2337   if test -s conftest.err; then
2338     ac_cpp_err=$ac_c_preproc_warn_flag
2339   else
2340     ac_cpp_err=
2341   fi
2342 else
2343   ac_cpp_err=yes
2344 fi
2345 if test -z "$ac_cpp_err"; then
2346   # Broken: success on invalid input.
2347 continue
2348 else
2349   echo "$as_me: failed program was:" >&5
2350   cat conftest.$ac_ext >&5
2351   # Passes both tests.
2352 ac_preproc_ok=:
2353 break
2354 fi
2355 rm -f conftest.err conftest.$ac_ext
2356
2357 done
2358 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2359 rm -f conftest.err conftest.$ac_ext
2360 if $ac_preproc_ok; then
2361   break
2362 fi
2363
2364     done
2365     ac_cv_prog_CPP=$CPP
2366
2367 fi
2368   CPP=$ac_cv_prog_CPP
2369 else
2370   ac_cv_prog_CPP=$CPP
2371 fi
2372 echo "$as_me:2372: result: $CPP" >&5
2373 echo "${ECHO_T}$CPP" >&6
2374 ac_preproc_ok=false
2375 for ac_c_preproc_warn_flag in '' yes
2376 do
2377   # Use a header file that comes with gcc, so configuring glibc
2378   # with a fresh cross-compiler works.
2379   # On the NeXT, cc -E runs the code through the compiler's parser,
2380   # not just through cpp. "Syntax error" is here to catch this case.
2381   cat >conftest.$ac_ext <<_ACEOF
2382 #line 2382 "configure"
2383 #include "confdefs.h"
2384 #include <assert.h>
2385                      Syntax error
2386 _ACEOF
2387 if { (eval echo "$as_me:2387: \"$ac_cpp conftest.$ac_ext\"") >&5
2388   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2389   ac_status=$?
2390   egrep -v '^ *\+' conftest.er1 >conftest.err
2391   rm -f conftest.er1
2392   cat conftest.err >&5
2393   echo "$as_me:2393: \$? = $ac_status" >&5
2394   (exit $ac_status); } >/dev/null; then
2395   if test -s conftest.err; then
2396     ac_cpp_err=$ac_c_preproc_warn_flag
2397   else
2398     ac_cpp_err=
2399   fi
2400 else
2401   ac_cpp_err=yes
2402 fi
2403 if test -z "$ac_cpp_err"; then
2404   :
2405 else
2406   echo "$as_me: failed program was:" >&5
2407   cat conftest.$ac_ext >&5
2408   # Broken: fails on valid input.
2409 continue
2410 fi
2411 rm -f conftest.err conftest.$ac_ext
2412
2413   # OK, works on sane cases.  Now check whether non-existent headers
2414   # can be detected and how.
2415   cat >conftest.$ac_ext <<_ACEOF
2416 #line 2416 "configure"
2417 #include "confdefs.h"
2418 #include <ac_nonexistent.h>
2419 _ACEOF
2420 if { (eval echo "$as_me:2420: \"$ac_cpp conftest.$ac_ext\"") >&5
2421   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2422   ac_status=$?
2423   egrep -v '^ *\+' conftest.er1 >conftest.err
2424   rm -f conftest.er1
2425   cat conftest.err >&5
2426   echo "$as_me:2426: \$? = $ac_status" >&5
2427   (exit $ac_status); } >/dev/null; then
2428   if test -s conftest.err; then
2429     ac_cpp_err=$ac_c_preproc_warn_flag
2430   else
2431     ac_cpp_err=
2432   fi
2433 else
2434   ac_cpp_err=yes
2435 fi
2436 if test -z "$ac_cpp_err"; then
2437   # Broken: success on invalid input.
2438 continue
2439 else
2440   echo "$as_me: failed program was:" >&5
2441   cat conftest.$ac_ext >&5
2442   # Passes both tests.
2443 ac_preproc_ok=:
2444 break
2445 fi
2446 rm -f conftest.err conftest.$ac_ext
2447
2448 done
2449 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2450 rm -f conftest.err conftest.$ac_ext
2451 if $ac_preproc_ok; then
2452   :
2453 else
2454   { { echo "$as_me:2454: error: C preprocessor \"$CPP\" fails sanity check" >&5
2455 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2456    { (exit 1); exit 1; }; }
2457 fi
2458
2459 ac_ext=c
2460 ac_cpp='$CPP $CPPFLAGS'
2461 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2462 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2463 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2464 ac_main_return=return
2465
2466 for ac_prog in mawk gawk nawk awk
2467 do
2468   # Extract the first word of "$ac_prog", so it can be a program name with args.
2469 set dummy $ac_prog; ac_word=$2
2470 echo "$as_me:2470: checking for $ac_word" >&5
2471 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2472 if test "${ac_cv_prog_AWK+set}" = set; then
2473   echo $ECHO_N "(cached) $ECHO_C" >&6
2474 else
2475   if test -n "$AWK"; then
2476   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2477 else
2478   ac_save_IFS=$IFS; IFS=$ac_path_separator
2479 ac_dummy="$PATH"
2480 for ac_dir in $ac_dummy; do
2481   IFS=$ac_save_IFS
2482   test -z "$ac_dir" && ac_dir=.
2483   $as_executable_p "$ac_dir/$ac_word" || continue
2484 ac_cv_prog_AWK="$ac_prog"
2485 echo "$as_me:2485: found $ac_dir/$ac_word" >&5
2486 break
2487 done
2488
2489 fi
2490 fi
2491 AWK=$ac_cv_prog_AWK
2492 if test -n "$AWK"; then
2493   echo "$as_me:2493: result: $AWK" >&5
2494 echo "${ECHO_T}$AWK" >&6
2495 else
2496   echo "$as_me:2496: result: no" >&5
2497 echo "${ECHO_T}no" >&6
2498 fi
2499
2500   test -n "$AWK" && break
2501 done
2502
2503 # Find a good install program.  We prefer a C program (faster),
2504 # so one script is as good as another.  But avoid the broken or
2505 # incompatible versions:
2506 # SysV /etc/install, /usr/sbin/install
2507 # SunOS /usr/etc/install
2508 # IRIX /sbin/install
2509 # AIX /bin/install
2510 # AmigaOS /C/install, which installs bootblocks on floppy discs
2511 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2512 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2513 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2514 # ./install, which can be erroneously created by make from ./install.sh.
2515 echo "$as_me:2515: checking for a BSD compatible install" >&5
2516 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2517 if test -z "$INSTALL"; then
2518 if test "${ac_cv_path_install+set}" = set; then
2519   echo $ECHO_N "(cached) $ECHO_C" >&6
2520 else
2521     ac_save_IFS=$IFS; IFS=$ac_path_separator
2522   for ac_dir in $PATH; do
2523     IFS=$ac_save_IFS
2524     # Account for people who put trailing slashes in PATH elements.
2525     case $ac_dir/ in
2526     / | ./ | .// | /cC/* \
2527     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2528     | /usr/ucb/* ) ;;
2529     *)
2530       # OSF1 and SCO ODT 3.0 have their own names for install.
2531       # Don't use installbsd from OSF since it installs stuff as root
2532       # by default.
2533       for ac_prog in ginstall scoinst install; do
2534         if $as_executable_p "$ac_dir/$ac_prog"; then
2535           if test $ac_prog = install &&
2536             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2537             # AIX install.  It has an incompatible calling convention.
2538             :
2539           elif test $ac_prog = install &&
2540             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2541             # program-specific install script used by HP pwplus--don't use.
2542             :
2543           else
2544             ac_cv_path_install="$ac_dir/$ac_prog -c"
2545             break 2
2546           fi
2547         fi
2548       done
2549       ;;
2550     esac
2551   done
2552
2553 fi
2554   if test "${ac_cv_path_install+set}" = set; then
2555     INSTALL=$ac_cv_path_install
2556   else
2557     # As a last resort, use the slow shell script.  We don't cache a
2558     # path for INSTALL within a source directory, because that will
2559     # break other packages using the cache if that directory is
2560     # removed, or if the path is relative.
2561     INSTALL=$ac_install_sh
2562   fi
2563 fi
2564 echo "$as_me:2564: result: $INSTALL" >&5
2565 echo "${ECHO_T}$INSTALL" >&6
2566
2567 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2568 # It thinks the first close brace ends the variable substitution.
2569 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2570
2571 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2572
2573 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2574
2575 case $INSTALL in
2576 (/*)
2577         ;;
2578 (*)
2579         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2580         test -z "$cf_dir" && cf_dir=.
2581         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2582         ;;
2583 esac
2584
2585 echo "$as_me:2585: checking if you want to install stripped executables" >&5
2586 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2587
2588 # Check whether --enable-stripping or --disable-stripping was given.
2589 if test "${enable_stripping+set}" = set; then
2590   enableval="$enable_stripping"
2591   test "$enableval" != no && enableval=yes
2592         if test "$enableval" != "yes" ; then
2593     with_stripping=no
2594         else
2595                 with_stripping=yes
2596         fi
2597 else
2598   enableval=yes
2599         with_stripping=yes
2600
2601 fi;
2602 echo "$as_me:2602: result: $with_stripping" >&5
2603 echo "${ECHO_T}$with_stripping" >&6
2604
2605 if test "$with_stripping" = yes
2606 then
2607         INSTALL_OPT_S="-s"
2608 else
2609         INSTALL_OPT_S=
2610 fi
2611
2612 : ${INSTALL:=install}
2613 echo "$as_me:2613: checking if install accepts -p option" >&5
2614 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2615 if test "${cf_cv_install_p+set}" = set; then
2616   echo $ECHO_N "(cached) $ECHO_C" >&6
2617 else
2618
2619         rm -rf conftest*
2620         date >conftest.in
2621         mkdir conftest.out
2622         sleep 3
2623         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2624         then
2625                 if test -f conftest.out/conftest.in
2626                 then
2627                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2628                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2629                         if test -s conftest.err
2630                         then
2631                                 cf_cv_install_p=no
2632                         else
2633                                 cf_cv_install_p=yes
2634                         fi
2635                 else
2636                         cf_cv_install_p=no
2637                 fi
2638         else
2639                 cf_cv_install_p=no
2640         fi
2641         rm -rf conftest*
2642
2643 fi
2644 echo "$as_me:2644: result: $cf_cv_install_p" >&5
2645 echo "${ECHO_T}$cf_cv_install_p" >&6
2646
2647 echo "$as_me:2647: checking if install needs to be told about ownership" >&5
2648 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2649 case `$ac_config_guess` in
2650 (*minix)
2651         with_install_o=yes
2652         ;;
2653 (*)
2654         with_install_o=no
2655         ;;
2656 esac
2657
2658 echo "$as_me:2658: result: $with_install_o" >&5
2659 echo "${ECHO_T}$with_install_o" >&6
2660 if test "x$with_install_o" = xyes
2661 then
2662         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2663 else
2664         INSTALL_OPT_O=
2665 fi
2666
2667 for ac_prog in lint cppcheck splint
2668 do
2669   # Extract the first word of "$ac_prog", so it can be a program name with args.
2670 set dummy $ac_prog; ac_word=$2
2671 echo "$as_me:2671: checking for $ac_word" >&5
2672 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2673 if test "${ac_cv_prog_LINT+set}" = set; then
2674   echo $ECHO_N "(cached) $ECHO_C" >&6
2675 else
2676   if test -n "$LINT"; then
2677   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2678 else
2679   ac_save_IFS=$IFS; IFS=$ac_path_separator
2680 ac_dummy="$PATH"
2681 for ac_dir in $ac_dummy; do
2682   IFS=$ac_save_IFS
2683   test -z "$ac_dir" && ac_dir=.
2684   $as_executable_p "$ac_dir/$ac_word" || continue
2685 ac_cv_prog_LINT="$ac_prog"
2686 echo "$as_me:2686: found $ac_dir/$ac_word" >&5
2687 break
2688 done
2689
2690 fi
2691 fi
2692 LINT=$ac_cv_prog_LINT
2693 if test -n "$LINT"; then
2694   echo "$as_me:2694: result: $LINT" >&5
2695 echo "${ECHO_T}$LINT" >&6
2696 else
2697   echo "$as_me:2697: result: no" >&5
2698 echo "${ECHO_T}no" >&6
2699 fi
2700
2701   test -n "$LINT" && break
2702 done
2703
2704 echo "$as_me:2704: checking if filesystem supports mixed-case filenames" >&5
2705 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2706 if test "${cf_cv_mixedcase+set}" = set; then
2707   echo $ECHO_N "(cached) $ECHO_C" >&6
2708 else
2709
2710 if test "$cross_compiling" = yes ; then
2711         case $target_alias in
2712         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2713                 cf_cv_mixedcase=no
2714                 ;;
2715         (*)
2716                 cf_cv_mixedcase=yes
2717                 ;;
2718         esac
2719 else
2720         rm -f conftest CONFTEST
2721         echo test >conftest
2722         if test -f CONFTEST ; then
2723                 cf_cv_mixedcase=no
2724         else
2725                 cf_cv_mixedcase=yes
2726         fi
2727         rm -f conftest CONFTEST
2728 fi
2729
2730 fi
2731 echo "$as_me:2731: result: $cf_cv_mixedcase" >&5
2732 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2733 test "$cf_cv_mixedcase" = yes &&
2734 cat >>confdefs.h <<\EOF
2735 #define MIXEDCASE_FILENAMES 1
2736 EOF
2737
2738 for ac_prog in exctags ctags
2739 do
2740   # Extract the first word of "$ac_prog", so it can be a program name with args.
2741 set dummy $ac_prog; ac_word=$2
2742 echo "$as_me:2742: checking for $ac_word" >&5
2743 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2744 if test "${ac_cv_prog_CTAGS+set}" = set; then
2745   echo $ECHO_N "(cached) $ECHO_C" >&6
2746 else
2747   if test -n "$CTAGS"; then
2748   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2749 else
2750   ac_save_IFS=$IFS; IFS=$ac_path_separator
2751 ac_dummy="$PATH"
2752 for ac_dir in $ac_dummy; do
2753   IFS=$ac_save_IFS
2754   test -z "$ac_dir" && ac_dir=.
2755   $as_executable_p "$ac_dir/$ac_word" || continue
2756 ac_cv_prog_CTAGS="$ac_prog"
2757 echo "$as_me:2757: found $ac_dir/$ac_word" >&5
2758 break
2759 done
2760
2761 fi
2762 fi
2763 CTAGS=$ac_cv_prog_CTAGS
2764 if test -n "$CTAGS"; then
2765   echo "$as_me:2765: result: $CTAGS" >&5
2766 echo "${ECHO_T}$CTAGS" >&6
2767 else
2768   echo "$as_me:2768: result: no" >&5
2769 echo "${ECHO_T}no" >&6
2770 fi
2771
2772   test -n "$CTAGS" && break
2773 done
2774
2775 for ac_prog in exetags etags
2776 do
2777   # Extract the first word of "$ac_prog", so it can be a program name with args.
2778 set dummy $ac_prog; ac_word=$2
2779 echo "$as_me:2779: checking for $ac_word" >&5
2780 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2781 if test "${ac_cv_prog_ETAGS+set}" = set; then
2782   echo $ECHO_N "(cached) $ECHO_C" >&6
2783 else
2784   if test -n "$ETAGS"; then
2785   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2786 else
2787   ac_save_IFS=$IFS; IFS=$ac_path_separator
2788 ac_dummy="$PATH"
2789 for ac_dir in $ac_dummy; do
2790   IFS=$ac_save_IFS
2791   test -z "$ac_dir" && ac_dir=.
2792   $as_executable_p "$ac_dir/$ac_word" || continue
2793 ac_cv_prog_ETAGS="$ac_prog"
2794 echo "$as_me:2794: found $ac_dir/$ac_word" >&5
2795 break
2796 done
2797
2798 fi
2799 fi
2800 ETAGS=$ac_cv_prog_ETAGS
2801 if test -n "$ETAGS"; then
2802   echo "$as_me:2802: result: $ETAGS" >&5
2803 echo "${ECHO_T}$ETAGS" >&6
2804 else
2805   echo "$as_me:2805: result: no" >&5
2806 echo "${ECHO_T}no" >&6
2807 fi
2808
2809   test -n "$ETAGS" && break
2810 done
2811
2812 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2813 set dummy ${CTAGS:-ctags}; ac_word=$2
2814 echo "$as_me:2814: checking for $ac_word" >&5
2815 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2816 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2817   echo $ECHO_N "(cached) $ECHO_C" >&6
2818 else
2819   if test -n "$MAKE_LOWER_TAGS"; then
2820   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2821 else
2822   ac_save_IFS=$IFS; IFS=$ac_path_separator
2823 ac_dummy="$PATH"
2824 for ac_dir in $ac_dummy; do
2825   IFS=$ac_save_IFS
2826   test -z "$ac_dir" && ac_dir=.
2827   $as_executable_p "$ac_dir/$ac_word" || continue
2828 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2829 echo "$as_me:2829: found $ac_dir/$ac_word" >&5
2830 break
2831 done
2832
2833   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2834 fi
2835 fi
2836 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2837 if test -n "$MAKE_LOWER_TAGS"; then
2838   echo "$as_me:2838: result: $MAKE_LOWER_TAGS" >&5
2839 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2840 else
2841   echo "$as_me:2841: result: no" >&5
2842 echo "${ECHO_T}no" >&6
2843 fi
2844
2845 if test "$cf_cv_mixedcase" = yes ; then
2846         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2847 set dummy ${ETAGS:-etags}; ac_word=$2
2848 echo "$as_me:2848: checking for $ac_word" >&5
2849 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2850 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2851   echo $ECHO_N "(cached) $ECHO_C" >&6
2852 else
2853   if test -n "$MAKE_UPPER_TAGS"; then
2854   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2855 else
2856   ac_save_IFS=$IFS; IFS=$ac_path_separator
2857 ac_dummy="$PATH"
2858 for ac_dir in $ac_dummy; do
2859   IFS=$ac_save_IFS
2860   test -z "$ac_dir" && ac_dir=.
2861   $as_executable_p "$ac_dir/$ac_word" || continue
2862 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2863 echo "$as_me:2863: found $ac_dir/$ac_word" >&5
2864 break
2865 done
2866
2867   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2868 fi
2869 fi
2870 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2871 if test -n "$MAKE_UPPER_TAGS"; then
2872   echo "$as_me:2872: result: $MAKE_UPPER_TAGS" >&5
2873 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2874 else
2875   echo "$as_me:2875: result: no" >&5
2876 echo "${ECHO_T}no" >&6
2877 fi
2878
2879 else
2880         MAKE_UPPER_TAGS=no
2881 fi
2882
2883 if test "$MAKE_UPPER_TAGS" = yes ; then
2884         MAKE_UPPER_TAGS=
2885 else
2886         MAKE_UPPER_TAGS="#"
2887 fi
2888
2889 if test "$MAKE_LOWER_TAGS" = yes ; then
2890         MAKE_LOWER_TAGS=
2891 else
2892         MAKE_LOWER_TAGS="#"
2893 fi
2894
2895 echo "$as_me:2895: checking if -lm needed for math functions" >&5
2896 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2897 if test "${cf_cv_need_libm+set}" = set; then
2898   echo $ECHO_N "(cached) $ECHO_C" >&6
2899 else
2900
2901         cat >conftest.$ac_ext <<_ACEOF
2902 #line 2902 "configure"
2903 #include "confdefs.h"
2904
2905         #include <stdio.h>
2906         #include <stdlib.h>
2907         #include <math.h>
2908
2909 int
2910 main (void)
2911 {
2912 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2913   ;
2914   return 0;
2915 }
2916 _ACEOF
2917 rm -f conftest.$ac_objext conftest$ac_exeext
2918 if { (eval echo "$as_me:2918: \"$ac_link\"") >&5
2919   (eval $ac_link) 2>&5
2920   ac_status=$?
2921   echo "$as_me:2921: \$? = $ac_status" >&5
2922   (exit $ac_status); } &&
2923          { ac_try='test -s conftest$ac_exeext'
2924   { (eval echo "$as_me:2924: \"$ac_try\"") >&5
2925   (eval $ac_try) 2>&5
2926   ac_status=$?
2927   echo "$as_me:2927: \$? = $ac_status" >&5
2928   (exit $ac_status); }; }; then
2929   cf_cv_need_libm=no
2930 else
2931   echo "$as_me: failed program was:" >&5
2932 cat conftest.$ac_ext >&5
2933 cf_cv_need_libm=yes
2934 fi
2935 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2936 fi
2937 echo "$as_me:2937: result: $cf_cv_need_libm" >&5
2938 echo "${ECHO_T}$cf_cv_need_libm" >&6
2939 if test "$cf_cv_need_libm" = yes
2940 then
2941 MATH_LIB=-lm
2942 fi
2943
2944 top_builddir=`pwd`
2945
2946 CC_G_OPT="-g"
2947 CC_SHARED_OPTS=unknown
2948 CPPFLAGS="$CPPFLAGS"
2949 DFT_DEP_SUFFIX=""
2950 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2951 DFT_UPR_MODEL="NORMAL"
2952 LD="ld"
2953 LDFLAGS_SHARED=""
2954 LDFLAGS_STATIC=""
2955 LD_MODEL=""
2956 LD_SHARED_OPTS=""
2957 LIBTOOL=""
2958 LIBTOOL_OPTS=""
2959 LIB_CLEAN=""
2960 LIB_COMPILE=""
2961 LIB_LINK='${CC}'
2962 LINK_TESTS=""
2963 LOCAL_LDFLAGS=""
2964 PACKAGE="ncurses-examples"
2965 PTHREAD="-lm"
2966 TEST_ARGS=""
2967 TEST_DEPS=""
2968 TEST_LIBS=""
2969 TINFO_LDFLAGS=''
2970 TINFO_LIBS='$(LIBS_CURSES)'
2971 cf_cv_abi_version=""
2972 cf_cv_rel_version=""
2973 includesubdir=""
2974
2975 cf_cv_screen=curses
2976 cf_cv_libtype=
2977
2978 if test "$GCC" = yes
2979 then
2980 cat > conftest.i <<EOF
2981 #ifndef GCC_PRINTF
2982 #define GCC_PRINTF 0
2983 #endif
2984 #ifndef GCC_SCANF
2985 #define GCC_SCANF 0
2986 #endif
2987 #ifndef GCC_NORETURN
2988 #define GCC_NORETURN /* nothing */
2989 #endif
2990 #ifndef GCC_UNUSED
2991 #define GCC_UNUSED /* nothing */
2992 #endif
2993 EOF
2994 if test "$GCC" = yes
2995 then
2996         { echo "$as_me:2996: checking for $CC __attribute__ directives..." >&5
2997 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2998 cat > conftest.$ac_ext <<EOF
2999 #line 2999 "${as_me:-configure}"
3000 #include "confdefs.h"
3001 #include "conftest.h"
3002 #include "conftest.i"
3003 #if     GCC_PRINTF
3004 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3005 #else
3006 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3007 #endif
3008 #if     GCC_SCANF
3009 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3010 #else
3011 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3012 #endif
3013 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3014 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3015 extern void foo(void) GCC_NORETURN;
3016 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3017 EOF
3018         cf_printf_attribute=no
3019         cf_scanf_attribute=no
3020         for cf_attribute in scanf printf unused noreturn
3021         do
3022
3023 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3024
3025                 cf_directive="__attribute__(($cf_attribute))"
3026                 echo "checking for $CC $cf_directive" 1>&5
3027
3028                 case $cf_attribute in
3029                 (printf)
3030                         cf_printf_attribute=yes
3031                         cat >conftest.h <<EOF
3032 #define GCC_$cf_ATTRIBUTE 1
3033 EOF
3034                         ;;
3035                 (scanf)
3036                         cf_scanf_attribute=yes
3037                         cat >conftest.h <<EOF
3038 #define GCC_$cf_ATTRIBUTE 1
3039 EOF
3040                         ;;
3041                 (*)
3042                         cat >conftest.h <<EOF
3043 #define GCC_$cf_ATTRIBUTE $cf_directive
3044 EOF
3045                         ;;
3046                 esac
3047
3048                 if { (eval echo "$as_me:3048: \"$ac_compile\"") >&5
3049   (eval $ac_compile) 2>&5
3050   ac_status=$?
3051   echo "$as_me:3051: \$? = $ac_status" >&5
3052   (exit $ac_status); }; then
3053                         test -n "$verbose" && echo "$as_me:3053: result: ... $cf_attribute" >&5
3054 echo "${ECHO_T}... $cf_attribute" >&6
3055                         cat conftest.h >>confdefs.h
3056                         case $cf_attribute in
3057                         (noreturn)
3058
3059 cat >>confdefs.h <<EOF
3060 #define GCC_NORETURN $cf_directive
3061 EOF
3062
3063                                 ;;
3064                         (printf)
3065                                 cf_value='/* nothing */'
3066                                 if test "$cf_printf_attribute" != no ; then
3067                                         cf_value='__attribute__((format(printf,fmt,var)))'
3068
3069 cat >>confdefs.h <<\EOF
3070 #define GCC_PRINTF 1
3071 EOF
3072
3073                                 fi
3074
3075 cat >>confdefs.h <<EOF
3076 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3077 EOF
3078
3079                                 ;;
3080                         (scanf)
3081                                 cf_value='/* nothing */'
3082                                 if test "$cf_scanf_attribute" != no ; then
3083                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3084
3085 cat >>confdefs.h <<\EOF
3086 #define GCC_SCANF 1
3087 EOF
3088
3089                                 fi
3090
3091 cat >>confdefs.h <<EOF
3092 #define GCC_SCANFLIKE(fmt,var) $cf_value
3093 EOF
3094
3095                                 ;;
3096                         (unused)
3097
3098 cat >>confdefs.h <<EOF
3099 #define GCC_UNUSED $cf_directive
3100 EOF
3101
3102                                 ;;
3103                         esac
3104                 fi
3105         done
3106 else
3107         fgrep define conftest.i >>confdefs.h
3108 fi
3109 rm -rf conftest*
3110 fi
3111
3112 echo "$as_me:3112: checking if you want to work around bogus compiler/loader warnings" >&5
3113 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3114
3115 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3116 if test "${enable_string_hacks+set}" = set; then
3117   enableval="$enable_string_hacks"
3118   with_string_hacks=$enableval
3119 else
3120   with_string_hacks=no
3121 fi;
3122 echo "$as_me:3122: result: $with_string_hacks" >&5
3123 echo "${ECHO_T}$with_string_hacks" >&6
3124
3125 if test "x$with_string_hacks" = "xyes"; then
3126
3127 cat >>confdefs.h <<\EOF
3128 #define USE_STRING_HACKS 1
3129 EOF
3130
3131         { echo "$as_me:3131: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3132 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3133         echo "$as_me:3133: checking for strlcat" >&5
3134 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3135 if test "${ac_cv_func_strlcat+set}" = set; then
3136   echo $ECHO_N "(cached) $ECHO_C" >&6
3137 else
3138   cat >conftest.$ac_ext <<_ACEOF
3139 #line 3139 "configure"
3140 #include "confdefs.h"
3141 #define strlcat autoconf_temporary
3142 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3143 #undef strlcat
3144
3145 #ifdef __cplusplus
3146 extern "C"
3147 #endif
3148
3149 /* We use char because int might match the return type of a gcc2
3150    builtin and then its argument prototype would still apply.  */
3151 char strlcat (void);
3152
3153 int
3154 main (void)
3155 {
3156
3157 /* The GNU C library defines stubs for functions which it implements
3158     to always fail with ENOSYS.  Some functions are actually named
3159     something starting with __ and the normal name is an alias.  */
3160 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3161 #error found stub for strlcat
3162 #endif
3163
3164         return strlcat ();
3165   ;
3166   return 0;
3167 }
3168 _ACEOF
3169 rm -f conftest.$ac_objext conftest$ac_exeext
3170 if { (eval echo "$as_me:3170: \"$ac_link\"") >&5
3171   (eval $ac_link) 2>&5
3172   ac_status=$?
3173   echo "$as_me:3173: \$? = $ac_status" >&5
3174   (exit $ac_status); } &&
3175          { ac_try='test -s conftest$ac_exeext'
3176   { (eval echo "$as_me:3176: \"$ac_try\"") >&5
3177   (eval $ac_try) 2>&5
3178   ac_status=$?
3179   echo "$as_me:3179: \$? = $ac_status" >&5
3180   (exit $ac_status); }; }; then
3181   ac_cv_func_strlcat=yes
3182 else
3183   echo "$as_me: failed program was:" >&5
3184 cat conftest.$ac_ext >&5
3185 ac_cv_func_strlcat=no
3186 fi
3187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3188 fi
3189 echo "$as_me:3189: result: $ac_cv_func_strlcat" >&5
3190 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3191 if test $ac_cv_func_strlcat = yes; then
3192
3193 cat >>confdefs.h <<\EOF
3194 #define HAVE_STRLCAT 1
3195 EOF
3196
3197 else
3198
3199                 echo "$as_me:3199: checking for strlcat in -lbsd" >&5
3200 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3201 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3202   echo $ECHO_N "(cached) $ECHO_C" >&6
3203 else
3204   ac_check_lib_save_LIBS=$LIBS
3205 LIBS="-lbsd  $LIBS"
3206 cat >conftest.$ac_ext <<_ACEOF
3207 #line 3207 "configure"
3208 #include "confdefs.h"
3209
3210 /* Override any gcc2 internal prototype to avoid an error.  */
3211 #ifdef __cplusplus
3212 extern "C"
3213 #endif
3214 /* We use char because int might match the return type of a gcc2
3215    builtin and then its argument prototype would still apply.  */
3216 char strlcat ();
3217 int
3218 main (void)
3219 {
3220 strlcat ();
3221   ;
3222   return 0;
3223 }
3224 _ACEOF
3225 rm -f conftest.$ac_objext conftest$ac_exeext
3226 if { (eval echo "$as_me:3226: \"$ac_link\"") >&5
3227   (eval $ac_link) 2>&5
3228   ac_status=$?
3229   echo "$as_me:3229: \$? = $ac_status" >&5
3230   (exit $ac_status); } &&
3231          { ac_try='test -s conftest$ac_exeext'
3232   { (eval echo "$as_me:3232: \"$ac_try\"") >&5
3233   (eval $ac_try) 2>&5
3234   ac_status=$?
3235   echo "$as_me:3235: \$? = $ac_status" >&5
3236   (exit $ac_status); }; }; then
3237   ac_cv_lib_bsd_strlcat=yes
3238 else
3239   echo "$as_me: failed program was:" >&5
3240 cat conftest.$ac_ext >&5
3241 ac_cv_lib_bsd_strlcat=no
3242 fi
3243 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3244 LIBS=$ac_check_lib_save_LIBS
3245 fi
3246 echo "$as_me:3246: result: $ac_cv_lib_bsd_strlcat" >&5
3247 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3248 if test $ac_cv_lib_bsd_strlcat = yes; then
3249
3250 cf_add_libs="-lbsd"
3251 # Filter out duplicates - this happens with badly-designed ".pc" files...
3252 for cf_add_1lib in $LIBS
3253 do
3254         for cf_add_2lib in $cf_add_libs
3255         do
3256                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3257                 then
3258                         cf_add_1lib=
3259                         break
3260                 fi
3261         done
3262         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3263 done
3264 LIBS="$cf_add_libs"
3265
3266 for ac_header in bsd/string.h
3267 do
3268 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3269 echo "$as_me:3269: checking for $ac_header" >&5
3270 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3271 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3272   echo $ECHO_N "(cached) $ECHO_C" >&6
3273 else
3274   cat >conftest.$ac_ext <<_ACEOF
3275 #line 3275 "configure"
3276 #include "confdefs.h"
3277 #include <$ac_header>
3278 _ACEOF
3279 if { (eval echo "$as_me:3279: \"$ac_cpp conftest.$ac_ext\"") >&5
3280   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3281   ac_status=$?
3282   egrep -v '^ *\+' conftest.er1 >conftest.err
3283   rm -f conftest.er1
3284   cat conftest.err >&5
3285   echo "$as_me:3285: \$? = $ac_status" >&5
3286   (exit $ac_status); } >/dev/null; then
3287   if test -s conftest.err; then
3288     ac_cpp_err=$ac_c_preproc_warn_flag
3289   else
3290     ac_cpp_err=
3291   fi
3292 else
3293   ac_cpp_err=yes
3294 fi
3295 if test -z "$ac_cpp_err"; then
3296   eval "$as_ac_Header=yes"
3297 else
3298   echo "$as_me: failed program was:" >&5
3299   cat conftest.$ac_ext >&5
3300   eval "$as_ac_Header=no"
3301 fi
3302 rm -f conftest.err conftest.$ac_ext
3303 fi
3304 echo "$as_me:3304: result: `eval echo '${'$as_ac_Header'}'`" >&5
3305 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3306 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3307   cat >>confdefs.h <<EOF
3308 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3309 EOF
3310
3311 fi
3312 done
3313
3314 cat >>confdefs.h <<\EOF
3315 #define HAVE_STRLCAT 1
3316 EOF
3317
3318 fi
3319
3320 fi
3321
3322 for ac_func in strlcpy snprintf
3323 do
3324 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3325 echo "$as_me:3325: checking for $ac_func" >&5
3326 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3327 if eval "test \"\${$as_ac_var+set}\" = set"; then
3328   echo $ECHO_N "(cached) $ECHO_C" >&6
3329 else
3330   cat >conftest.$ac_ext <<_ACEOF
3331 #line 3331 "configure"
3332 #include "confdefs.h"
3333 #define $ac_func autoconf_temporary
3334 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3335 #undef $ac_func
3336
3337 #ifdef __cplusplus
3338 extern "C"
3339 #endif
3340
3341 /* We use char because int might match the return type of a gcc2
3342    builtin and then its argument prototype would still apply.  */
3343 char $ac_func (void);
3344
3345 int
3346 main (void)
3347 {
3348
3349 /* The GNU C library defines stubs for functions which it implements
3350     to always fail with ENOSYS.  Some functions are actually named
3351     something starting with __ and the normal name is an alias.  */
3352 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3353 #error found stub for $ac_func
3354 #endif
3355
3356         return $ac_func ();
3357   ;
3358   return 0;
3359 }
3360 _ACEOF
3361 rm -f conftest.$ac_objext conftest$ac_exeext
3362 if { (eval echo "$as_me:3362: \"$ac_link\"") >&5
3363   (eval $ac_link) 2>&5
3364   ac_status=$?
3365   echo "$as_me:3365: \$? = $ac_status" >&5
3366   (exit $ac_status); } &&
3367          { ac_try='test -s conftest$ac_exeext'
3368   { (eval echo "$as_me:3368: \"$ac_try\"") >&5
3369   (eval $ac_try) 2>&5
3370   ac_status=$?
3371   echo "$as_me:3371: \$? = $ac_status" >&5
3372   (exit $ac_status); }; }; then
3373   eval "$as_ac_var=yes"
3374 else
3375   echo "$as_me: failed program was:" >&5
3376 cat conftest.$ac_ext >&5
3377 eval "$as_ac_var=no"
3378 fi
3379 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3380 fi
3381 echo "$as_me:3381: result: `eval echo '${'$as_ac_var'}'`" >&5
3382 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3383 if test `eval echo '${'$as_ac_var'}'` = yes; then
3384   cat >>confdefs.h <<EOF
3385 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3386 EOF
3387
3388 fi
3389 done
3390
3391 fi
3392
3393 cf_XOPEN_SOURCE=600
3394 cf_POSIX_C_SOURCE=199506L
3395 cf_xopen_source=
3396
3397 case $host_os in
3398 (aix[4-7]*)
3399         cf_xopen_source="-D_ALL_SOURCE"
3400         ;;
3401 (msys)
3402         cf_XOPEN_SOURCE=600
3403         ;;
3404 (darwin[0-8].*)
3405         cf_xopen_source="-D_APPLE_C_SOURCE"
3406         ;;
3407 (darwin*)
3408         cf_xopen_source="-D_DARWIN_C_SOURCE"
3409         cf_XOPEN_SOURCE=
3410         ;;
3411 (freebsd*|dragonfly*|midnightbsd*)
3412         # 5.x headers associate
3413         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3414         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3415         cf_POSIX_C_SOURCE=200112L
3416         cf_XOPEN_SOURCE=600
3417         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3418         ;;
3419 (hpux11*)
3420         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3421         ;;
3422 (hpux*)
3423         cf_xopen_source="-D_HPUX_SOURCE"
3424         ;;
3425 (irix[56].*)
3426         cf_xopen_source="-D_SGI_SOURCE"
3427         cf_XOPEN_SOURCE=
3428         ;;
3429 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3430
3431 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3432
3433 echo "$as_me:3433: checking if this is the GNU C library" >&5
3434 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3435 if test "${cf_cv_gnu_library+set}" = set; then
3436   echo $ECHO_N "(cached) $ECHO_C" >&6
3437 else
3438
3439 cat >conftest.$ac_ext <<_ACEOF
3440 #line 3440 "configure"
3441 #include "confdefs.h"
3442 #include <sys/types.h>
3443 int
3444 main (void)
3445 {
3446
3447         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3448                 return 0;
3449         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3450                 return 0;
3451         #else
3452         #       error not GNU C library
3453         #endif
3454   ;
3455   return 0;
3456 }
3457 _ACEOF
3458 rm -f conftest.$ac_objext
3459 if { (eval echo "$as_me:3459: \"$ac_compile\"") >&5
3460   (eval $ac_compile) 2>&5
3461   ac_status=$?
3462   echo "$as_me:3462: \$? = $ac_status" >&5
3463   (exit $ac_status); } &&
3464          { ac_try='test -s conftest.$ac_objext'
3465   { (eval echo "$as_me:3465: \"$ac_try\"") >&5
3466   (eval $ac_try) 2>&5
3467   ac_status=$?
3468   echo "$as_me:3468: \$? = $ac_status" >&5
3469   (exit $ac_status); }; }; then
3470   cf_cv_gnu_library=yes
3471 else
3472   echo "$as_me: failed program was:" >&5
3473 cat conftest.$ac_ext >&5
3474 cf_cv_gnu_library=no
3475 fi
3476 rm -f conftest.$ac_objext conftest.$ac_ext
3477
3478 fi
3479 echo "$as_me:3479: result: $cf_cv_gnu_library" >&5
3480 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3481
3482 if test x$cf_cv_gnu_library = xyes; then
3483
3484         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3485         # was changed to help a little.  newlib incorporated the change about 4
3486         # years later.
3487         echo "$as_me:3487: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3488 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3489 if test "${cf_cv_gnu_library_219+set}" = set; then
3490   echo $ECHO_N "(cached) $ECHO_C" >&6
3491 else
3492
3493                 cf_save="$CPPFLAGS"
3494
3495         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3496         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3497
3498                 cat >conftest.$ac_ext <<_ACEOF
3499 #line 3499 "configure"
3500 #include "confdefs.h"
3501 #include <sys/types.h>
3502 int
3503 main (void)
3504 {
3505
3506                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3507                                 return 0;
3508                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3509                                 return 0;
3510                         #else
3511                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3512                         #endif
3513   ;
3514   return 0;
3515 }
3516 _ACEOF
3517 rm -f conftest.$ac_objext
3518 if { (eval echo "$as_me:3518: \"$ac_compile\"") >&5
3519   (eval $ac_compile) 2>&5
3520   ac_status=$?
3521   echo "$as_me:3521: \$? = $ac_status" >&5
3522   (exit $ac_status); } &&
3523          { ac_try='test -s conftest.$ac_objext'
3524   { (eval echo "$as_me:3524: \"$ac_try\"") >&5
3525   (eval $ac_try) 2>&5
3526   ac_status=$?
3527   echo "$as_me:3527: \$? = $ac_status" >&5
3528   (exit $ac_status); }; }; then
3529   cf_cv_gnu_library_219=yes
3530 else
3531   echo "$as_me: failed program was:" >&5
3532 cat conftest.$ac_ext >&5
3533 cf_cv_gnu_library_219=no
3534 fi
3535 rm -f conftest.$ac_objext conftest.$ac_ext
3536                 CPPFLAGS="$cf_save"
3537
3538 fi
3539 echo "$as_me:3539: result: $cf_cv_gnu_library_219" >&5
3540 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3541
3542         if test "x$cf_cv_gnu_library_219" = xyes; then
3543                 cf_save="$CPPFLAGS"
3544                 echo "$as_me:3544: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3545 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3546 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3547   echo $ECHO_N "(cached) $ECHO_C" >&6
3548 else
3549
3550 cf_fix_cppflags=no
3551 cf_new_cflags=
3552 cf_new_cppflags=
3553 cf_new_extra_cppflags=
3554
3555 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3556 do
3557 case $cf_fix_cppflags in
3558 (no)
3559         case $cf_add_cflags in
3560         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3561                 case $cf_add_cflags in
3562                 (-D*)
3563                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3564
3565                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3566                                 && test -z "${cf_tst_cflags}" \
3567                                 && cf_fix_cppflags=yes
3568
3569                         if test $cf_fix_cppflags = yes ; then
3570
3571         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3572         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3573
3574                                 continue
3575                         elif test "${cf_tst_cflags}" = "\"'" ; then
3576
3577         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3578         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3579
3580                                 continue
3581                         fi
3582                         ;;
3583                 esac
3584                 case "$CPPFLAGS" in
3585                 (*$cf_add_cflags)
3586                         ;;
3587                 (*)
3588                         case $cf_add_cflags in
3589                         (-D*)
3590                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3591
3592 CPPFLAGS=`echo "$CPPFLAGS" | \
3593         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3594                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3595
3596                                 ;;
3597                         esac
3598
3599         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3600         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3601
3602                         ;;
3603                 esac
3604                 ;;
3605         (*)
3606
3607         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3608         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3609
3610                 ;;
3611         esac
3612         ;;
3613 (yes)
3614
3615         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3616         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3617
3618         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3619
3620         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3621                 && test -z "${cf_tst_cflags}" \
3622                 && cf_fix_cppflags=no
3623         ;;
3624 esac
3625 done
3626
3627 if test -n "$cf_new_cflags" ; then
3628
3629         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3630         CFLAGS="${CFLAGS}$cf_new_cflags"
3631
3632 fi
3633
3634 if test -n "$cf_new_cppflags" ; then
3635
3636         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3637         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3638
3639 fi
3640
3641 if test -n "$cf_new_extra_cppflags" ; then
3642
3643         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3644         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3645
3646 fi
3647
3648                         cat >conftest.$ac_ext <<_ACEOF
3649 #line 3649 "configure"
3650 #include "confdefs.h"
3651
3652                                 #include <limits.h>
3653                                 #include <sys/types.h>
3654
3655 int
3656 main (void)
3657 {
3658
3659                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3660                                         return 0;
3661                                 #else
3662                                 #       error GNU C library is too old
3663                                 #endif
3664   ;
3665   return 0;
3666 }
3667 _ACEOF
3668 rm -f conftest.$ac_objext
3669 if { (eval echo "$as_me:3669: \"$ac_compile\"") >&5
3670   (eval $ac_compile) 2>&5
3671   ac_status=$?
3672   echo "$as_me:3672: \$? = $ac_status" >&5
3673   (exit $ac_status); } &&
3674          { ac_try='test -s conftest.$ac_objext'
3675   { (eval echo "$as_me:3675: \"$ac_try\"") >&5
3676   (eval $ac_try) 2>&5
3677   ac_status=$?
3678   echo "$as_me:3678: \$? = $ac_status" >&5
3679   (exit $ac_status); }; }; then
3680   cf_cv_gnu_dftsrc_219=yes
3681 else
3682   echo "$as_me: failed program was:" >&5
3683 cat conftest.$ac_ext >&5
3684 cf_cv_gnu_dftsrc_219=no
3685 fi
3686 rm -f conftest.$ac_objext conftest.$ac_ext
3687
3688 fi
3689 echo "$as_me:3689: result: $cf_cv_gnu_dftsrc_219" >&5
3690 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3691                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3692         else
3693                 cf_cv_gnu_dftsrc_219=maybe
3694         fi
3695
3696         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3697
3698                 echo "$as_me:3698: checking if we must define _GNU_SOURCE" >&5
3699 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3700 if test "${cf_cv_gnu_source+set}" = set; then
3701   echo $ECHO_N "(cached) $ECHO_C" >&6
3702 else
3703
3704                 cat >conftest.$ac_ext <<_ACEOF
3705 #line 3705 "configure"
3706 #include "confdefs.h"
3707 #include <sys/types.h>
3708 int
3709 main (void)
3710 {
3711
3712                         #ifndef _XOPEN_SOURCE
3713                         #error  expected _XOPEN_SOURCE to be defined
3714                         #endif
3715   ;
3716   return 0;
3717 }
3718 _ACEOF
3719 rm -f conftest.$ac_objext
3720 if { (eval echo "$as_me:3720: \"$ac_compile\"") >&5
3721   (eval $ac_compile) 2>&5
3722   ac_status=$?
3723   echo "$as_me:3723: \$? = $ac_status" >&5
3724   (exit $ac_status); } &&
3725          { ac_try='test -s conftest.$ac_objext'
3726   { (eval echo "$as_me:3726: \"$ac_try\"") >&5
3727   (eval $ac_try) 2>&5
3728   ac_status=$?
3729   echo "$as_me:3729: \$? = $ac_status" >&5
3730   (exit $ac_status); }; }; then
3731   cf_cv_gnu_source=no
3732 else
3733   echo "$as_me: failed program was:" >&5
3734 cat conftest.$ac_ext >&5
3735 cf_save="$CPPFLAGS"
3736
3737 cf_fix_cppflags=no
3738 cf_new_cflags=
3739 cf_new_cppflags=
3740 cf_new_extra_cppflags=
3741
3742 for cf_add_cflags in -D_GNU_SOURCE
3743 do
3744 case $cf_fix_cppflags in
3745 (no)
3746         case $cf_add_cflags in
3747         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3748                 case $cf_add_cflags in
3749                 (-D*)
3750                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3751
3752                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3753                                 && test -z "${cf_tst_cflags}" \
3754                                 && cf_fix_cppflags=yes
3755
3756                         if test $cf_fix_cppflags = yes ; then
3757
3758         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3759         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3760
3761                                 continue
3762                         elif test "${cf_tst_cflags}" = "\"'" ; then
3763
3764         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3765         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3766
3767                                 continue
3768                         fi
3769                         ;;
3770                 esac
3771                 case "$CPPFLAGS" in
3772                 (*$cf_add_cflags)
3773                         ;;
3774                 (*)
3775                         case $cf_add_cflags in
3776                         (-D*)
3777                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3778
3779 CPPFLAGS=`echo "$CPPFLAGS" | \
3780         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3781                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3782
3783                                 ;;
3784                         esac
3785
3786         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3787         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3788
3789                         ;;
3790                 esac
3791                 ;;
3792         (*)
3793
3794         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3795         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3796
3797                 ;;
3798         esac
3799         ;;
3800 (yes)
3801
3802         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3803         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3804
3805         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3806
3807         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3808                 && test -z "${cf_tst_cflags}" \
3809                 && cf_fix_cppflags=no
3810         ;;
3811 esac
3812 done
3813
3814 if test -n "$cf_new_cflags" ; then
3815
3816         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3817         CFLAGS="${CFLAGS}$cf_new_cflags"
3818
3819 fi
3820
3821 if test -n "$cf_new_cppflags" ; then
3822
3823         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3824         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3825
3826 fi
3827
3828 if test -n "$cf_new_extra_cppflags" ; then
3829
3830         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3831         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3832
3833 fi
3834
3835                          cat >conftest.$ac_ext <<_ACEOF
3836 #line 3836 "configure"
3837 #include "confdefs.h"
3838 #include <sys/types.h>
3839 int
3840 main (void)
3841 {
3842
3843                                 #ifdef _XOPEN_SOURCE
3844                                 #error  expected _XOPEN_SOURCE to be undefined
3845                                 #endif
3846   ;
3847   return 0;
3848 }
3849 _ACEOF
3850 rm -f conftest.$ac_objext
3851 if { (eval echo "$as_me:3851: \"$ac_compile\"") >&5
3852   (eval $ac_compile) 2>&5
3853   ac_status=$?
3854   echo "$as_me:3854: \$? = $ac_status" >&5
3855   (exit $ac_status); } &&
3856          { ac_try='test -s conftest.$ac_objext'
3857   { (eval echo "$as_me:3857: \"$ac_try\"") >&5
3858   (eval $ac_try) 2>&5
3859   ac_status=$?
3860   echo "$as_me:3860: \$? = $ac_status" >&5
3861   (exit $ac_status); }; }; then
3862   cf_cv_gnu_source=no
3863 else
3864   echo "$as_me: failed program was:" >&5
3865 cat conftest.$ac_ext >&5
3866 cf_cv_gnu_source=yes
3867 fi
3868 rm -f conftest.$ac_objext conftest.$ac_ext
3869                         CPPFLAGS="$cf_save"
3870
3871 fi
3872 rm -f conftest.$ac_objext conftest.$ac_ext
3873
3874 fi
3875 echo "$as_me:3875: result: $cf_cv_gnu_source" >&5
3876 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3877
3878                 if test "$cf_cv_gnu_source" = yes
3879                 then
3880                 echo "$as_me:3880: checking if we should also define _DEFAULT_SOURCE" >&5
3881 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3882 if test "${cf_cv_default_source+set}" = set; then
3883   echo $ECHO_N "(cached) $ECHO_C" >&6
3884 else
3885
3886         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3887         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
3888
3889                         cat >conftest.$ac_ext <<_ACEOF
3890 #line 3890 "configure"
3891 #include "confdefs.h"
3892 #include <sys/types.h>
3893 int
3894 main (void)
3895 {
3896
3897                                 #ifdef _DEFAULT_SOURCE
3898                                 #error  expected _DEFAULT_SOURCE to be undefined
3899                                 #endif
3900   ;
3901   return 0;
3902 }
3903 _ACEOF
3904 rm -f conftest.$ac_objext
3905 if { (eval echo "$as_me:3905: \"$ac_compile\"") >&5
3906   (eval $ac_compile) 2>&5
3907   ac_status=$?
3908   echo "$as_me:3908: \$? = $ac_status" >&5
3909   (exit $ac_status); } &&
3910          { ac_try='test -s conftest.$ac_objext'
3911   { (eval echo "$as_me:3911: \"$ac_try\"") >&5
3912   (eval $ac_try) 2>&5
3913   ac_status=$?
3914   echo "$as_me:3914: \$? = $ac_status" >&5
3915   (exit $ac_status); }; }; then
3916   cf_cv_default_source=no
3917 else
3918   echo "$as_me: failed program was:" >&5
3919 cat conftest.$ac_ext >&5
3920 cf_cv_default_source=yes
3921 fi
3922 rm -f conftest.$ac_objext conftest.$ac_ext
3923
3924 fi
3925 echo "$as_me:3925: result: $cf_cv_default_source" >&5
3926 echo "${ECHO_T}$cf_cv_default_source" >&6
3927                         if test "$cf_cv_default_source" = yes
3928                         then
3929
3930         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3931         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3932
3933                         fi
3934                 fi
3935         fi
3936
3937 fi
3938
3939         ;;
3940 (minix*)
3941         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3942         ;;
3943 (mirbsd*)
3944         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3945         cf_XOPEN_SOURCE=
3946
3947 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3948
3949 cf_save_CFLAGS="$CFLAGS"
3950 cf_save_CPPFLAGS="$CPPFLAGS"
3951
3952 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3953         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3954                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3955
3956 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3957         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3958                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3959
3960 echo "$as_me:3960: checking if we should define _POSIX_C_SOURCE" >&5
3961 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3962 if test "${cf_cv_posix_c_source+set}" = set; then
3963   echo $ECHO_N "(cached) $ECHO_C" >&6
3964 else
3965
3966 echo "${as_me:-configure}:3966: testing if the symbol is already defined go no further ..." 1>&5
3967
3968         cat >conftest.$ac_ext <<_ACEOF
3969 #line 3969 "configure"
3970 #include "confdefs.h"
3971 #include <sys/types.h>
3972 int
3973 main (void)
3974 {
3975
3976 #ifndef _POSIX_C_SOURCE
3977 make an error
3978 #endif
3979   ;
3980   return 0;
3981 }
3982 _ACEOF
3983 rm -f conftest.$ac_objext
3984 if { (eval echo "$as_me:3984: \"$ac_compile\"") >&5
3985   (eval $ac_compile) 2>&5
3986   ac_status=$?
3987   echo "$as_me:3987: \$? = $ac_status" >&5
3988   (exit $ac_status); } &&
3989          { ac_try='test -s conftest.$ac_objext'
3990   { (eval echo "$as_me:3990: \"$ac_try\"") >&5
3991   (eval $ac_try) 2>&5
3992   ac_status=$?
3993   echo "$as_me:3993: \$? = $ac_status" >&5
3994   (exit $ac_status); }; }; then
3995   cf_cv_posix_c_source=no
3996 else
3997   echo "$as_me: failed program was:" >&5
3998 cat conftest.$ac_ext >&5
3999 cf_want_posix_source=no
4000          case .$cf_POSIX_C_SOURCE in
4001          (.[12]??*)
4002                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4003                 ;;
4004          (.2)
4005                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4006                 cf_want_posix_source=yes
4007                 ;;
4008          (.*)
4009                 cf_want_posix_source=yes
4010                 ;;
4011          esac
4012          if test "$cf_want_posix_source" = yes ; then
4013                 cat >conftest.$ac_ext <<_ACEOF
4014 #line 4014 "configure"
4015 #include "confdefs.h"
4016 #include <sys/types.h>
4017 int
4018 main (void)
4019 {
4020
4021 #ifdef _POSIX_SOURCE
4022 make an error
4023 #endif
4024   ;
4025   return 0;
4026 }
4027 _ACEOF
4028 rm -f conftest.$ac_objext
4029 if { (eval echo "$as_me:4029: \"$ac_compile\"") >&5
4030   (eval $ac_compile) 2>&5
4031   ac_status=$?
4032   echo "$as_me:4032: \$? = $ac_status" >&5
4033   (exit $ac_status); } &&
4034          { ac_try='test -s conftest.$ac_objext'
4035   { (eval echo "$as_me:4035: \"$ac_try\"") >&5
4036   (eval $ac_try) 2>&5
4037   ac_status=$?
4038   echo "$as_me:4038: \$? = $ac_status" >&5
4039   (exit $ac_status); }; }; then
4040   :
4041 else
4042   echo "$as_me: failed program was:" >&5
4043 cat conftest.$ac_ext >&5
4044 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4045 fi
4046 rm -f conftest.$ac_objext conftest.$ac_ext
4047          fi
4048
4049 echo "${as_me:-configure}:4049: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4050
4051          CFLAGS="$cf_trim_CFLAGS"
4052          CPPFLAGS="$cf_trim_CPPFLAGS"
4053
4054         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4055         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4056
4057 echo "${as_me:-configure}:4057: testing if the second compile does not leave our definition intact error ..." 1>&5
4058
4059          cat >conftest.$ac_ext <<_ACEOF
4060 #line 4060 "configure"
4061 #include "confdefs.h"
4062 #include <sys/types.h>
4063 int
4064 main (void)
4065 {
4066
4067 #ifndef _POSIX_C_SOURCE
4068 make an error
4069 #endif
4070   ;
4071   return 0;
4072 }
4073 _ACEOF
4074 rm -f conftest.$ac_objext
4075 if { (eval echo "$as_me:4075: \"$ac_compile\"") >&5
4076   (eval $ac_compile) 2>&5
4077   ac_status=$?
4078   echo "$as_me:4078: \$? = $ac_status" >&5
4079   (exit $ac_status); } &&
4080          { ac_try='test -s conftest.$ac_objext'
4081   { (eval echo "$as_me:4081: \"$ac_try\"") >&5
4082   (eval $ac_try) 2>&5
4083   ac_status=$?
4084   echo "$as_me:4084: \$? = $ac_status" >&5
4085   (exit $ac_status); }; }; then
4086   :
4087 else
4088   echo "$as_me: failed program was:" >&5
4089 cat conftest.$ac_ext >&5
4090 cf_cv_posix_c_source=no
4091 fi
4092 rm -f conftest.$ac_objext conftest.$ac_ext
4093          CFLAGS="$cf_save_CFLAGS"
4094          CPPFLAGS="$cf_save_CPPFLAGS"
4095
4096 fi
4097 rm -f conftest.$ac_objext conftest.$ac_ext
4098
4099 fi
4100 echo "$as_me:4100: result: $cf_cv_posix_c_source" >&5
4101 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4102
4103 if test "$cf_cv_posix_c_source" != no ; then
4104         CFLAGS="$cf_trim_CFLAGS"
4105         CPPFLAGS="$cf_trim_CPPFLAGS"
4106
4107 cf_fix_cppflags=no
4108 cf_new_cflags=
4109 cf_new_cppflags=
4110 cf_new_extra_cppflags=
4111
4112 for cf_add_cflags in $cf_cv_posix_c_source
4113 do
4114 case $cf_fix_cppflags in
4115 (no)
4116         case $cf_add_cflags in
4117         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4118                 case $cf_add_cflags in
4119                 (-D*)
4120                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4121
4122                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4123                                 && test -z "${cf_tst_cflags}" \
4124                                 && cf_fix_cppflags=yes
4125
4126                         if test $cf_fix_cppflags = yes ; then
4127
4128         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4129         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4130
4131                                 continue
4132                         elif test "${cf_tst_cflags}" = "\"'" ; then
4133
4134         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4135         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4136
4137                                 continue
4138                         fi
4139                         ;;
4140                 esac
4141                 case "$CPPFLAGS" in
4142                 (*$cf_add_cflags)
4143                         ;;
4144                 (*)
4145                         case $cf_add_cflags in
4146                         (-D*)
4147                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4148
4149 CPPFLAGS=`echo "$CPPFLAGS" | \
4150         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4151                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4152
4153                                 ;;
4154                         esac
4155
4156         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4157         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4158
4159                         ;;
4160                 esac
4161                 ;;
4162         (*)
4163
4164         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4165         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4166
4167                 ;;
4168         esac
4169         ;;
4170 (yes)
4171
4172         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4173         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4174
4175         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4176
4177         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4178                 && test -z "${cf_tst_cflags}" \
4179                 && cf_fix_cppflags=no
4180         ;;
4181 esac
4182 done
4183
4184 if test -n "$cf_new_cflags" ; then
4185
4186         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4187         CFLAGS="${CFLAGS}$cf_new_cflags"
4188
4189 fi
4190
4191 if test -n "$cf_new_cppflags" ; then
4192
4193         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4194         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4195
4196 fi
4197
4198 if test -n "$cf_new_extra_cppflags" ; then
4199
4200         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4201         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4202
4203 fi
4204
4205 fi
4206
4207         ;;
4208 (netbsd*)
4209         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4210         ;;
4211 (openbsd[4-9]*)
4212         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4213         cf_xopen_source="-D_BSD_SOURCE"
4214         cf_XOPEN_SOURCE=600
4215         ;;
4216 (openbsd*)
4217         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4218         ;;
4219 (osf[45]*)
4220         cf_xopen_source="-D_OSF_SOURCE"
4221         ;;
4222 (nto-qnx*)
4223         cf_xopen_source="-D_QNX_SOURCE"
4224         ;;
4225 (sco*)
4226         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4227         ;;
4228 (solaris2.*)
4229         cf_xopen_source="-D__EXTENSIONS__"
4230         cf_cv_xopen_source=broken
4231         ;;
4232 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4233         cf_XOPEN_SOURCE=
4234         cf_POSIX_C_SOURCE=
4235         ;;
4236 (*)
4237
4238 echo "$as_me:4238: checking if we should define _XOPEN_SOURCE" >&5
4239 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4240 if test "${cf_cv_xopen_source+set}" = set; then
4241   echo $ECHO_N "(cached) $ECHO_C" >&6
4242 else
4243
4244         cat >conftest.$ac_ext <<_ACEOF
4245 #line 4245 "configure"
4246 #include "confdefs.h"
4247
4248 #include <stdlib.h>
4249 #include <string.h>
4250 #include <sys/types.h>
4251
4252 int
4253 main (void)
4254 {
4255
4256 #ifndef _XOPEN_SOURCE
4257 make an error
4258 #endif
4259   ;
4260   return 0;
4261 }
4262 _ACEOF
4263 rm -f conftest.$ac_objext
4264 if { (eval echo "$as_me:4264: \"$ac_compile\"") >&5
4265   (eval $ac_compile) 2>&5
4266   ac_status=$?
4267   echo "$as_me:4267: \$? = $ac_status" >&5
4268   (exit $ac_status); } &&
4269          { ac_try='test -s conftest.$ac_objext'
4270   { (eval echo "$as_me:4270: \"$ac_try\"") >&5
4271   (eval $ac_try) 2>&5
4272   ac_status=$?
4273   echo "$as_me:4273: \$? = $ac_status" >&5
4274   (exit $ac_status); }; }; then
4275   cf_cv_xopen_source=no
4276 else
4277   echo "$as_me: failed program was:" >&5
4278 cat conftest.$ac_ext >&5
4279 cf_save="$CPPFLAGS"
4280
4281         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4282         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4283
4284          cat >conftest.$ac_ext <<_ACEOF
4285 #line 4285 "configure"
4286 #include "confdefs.h"
4287
4288 #include <stdlib.h>
4289 #include <string.h>
4290 #include <sys/types.h>
4291
4292 int
4293 main (void)
4294 {
4295
4296 #ifdef _XOPEN_SOURCE
4297 make an error
4298 #endif
4299   ;
4300   return 0;
4301 }
4302 _ACEOF
4303 rm -f conftest.$ac_objext
4304 if { (eval echo "$as_me:4304: \"$ac_compile\"") >&5
4305   (eval $ac_compile) 2>&5
4306   ac_status=$?
4307   echo "$as_me:4307: \$? = $ac_status" >&5
4308   (exit $ac_status); } &&
4309          { ac_try='test -s conftest.$ac_objext'
4310   { (eval echo "$as_me:4310: \"$ac_try\"") >&5
4311   (eval $ac_try) 2>&5
4312   ac_status=$?
4313   echo "$as_me:4313: \$? = $ac_status" >&5
4314   (exit $ac_status); }; }; then
4315   cf_cv_xopen_source=no
4316 else
4317   echo "$as_me: failed program was:" >&5
4318 cat conftest.$ac_ext >&5
4319 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4320 fi
4321 rm -f conftest.$ac_objext conftest.$ac_ext
4322         CPPFLAGS="$cf_save"
4323
4324 fi
4325 rm -f conftest.$ac_objext conftest.$ac_ext
4326
4327 fi
4328 echo "$as_me:4328: result: $cf_cv_xopen_source" >&5
4329 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4330
4331 if test "$cf_cv_xopen_source" != no ; then
4332
4333 CFLAGS=`echo "$CFLAGS" | \
4334         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4335                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4336
4337 CPPFLAGS=`echo "$CPPFLAGS" | \
4338         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4339                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4340
4341         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4342
4343 cf_fix_cppflags=no
4344 cf_new_cflags=
4345 cf_new_cppflags=
4346 cf_new_extra_cppflags=
4347
4348 for cf_add_cflags in $cf_temp_xopen_source
4349 do
4350 case $cf_fix_cppflags in
4351 (no)
4352         case $cf_add_cflags in
4353         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4354                 case $cf_add_cflags in
4355                 (-D*)
4356                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4357
4358                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4359                                 && test -z "${cf_tst_cflags}" \
4360                                 && cf_fix_cppflags=yes
4361
4362                         if test $cf_fix_cppflags = yes ; then
4363
4364         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4365         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4366
4367                                 continue
4368                         elif test "${cf_tst_cflags}" = "\"'" ; then
4369
4370         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4371         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4372
4373                                 continue
4374                         fi
4375                         ;;
4376                 esac
4377                 case "$CPPFLAGS" in
4378                 (*$cf_add_cflags)
4379                         ;;
4380                 (*)
4381                         case $cf_add_cflags in
4382                         (-D*)
4383                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4384
4385 CPPFLAGS=`echo "$CPPFLAGS" | \
4386         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4387                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4388
4389                                 ;;
4390                         esac
4391
4392         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4393         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4394
4395                         ;;
4396                 esac
4397                 ;;
4398         (*)
4399
4400         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4401         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4402
4403                 ;;
4404         esac
4405         ;;
4406 (yes)
4407
4408         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4409         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4410
4411         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4412
4413         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4414                 && test -z "${cf_tst_cflags}" \
4415                 && cf_fix_cppflags=no
4416         ;;
4417 esac
4418 done
4419
4420 if test -n "$cf_new_cflags" ; then
4421
4422         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4423         CFLAGS="${CFLAGS}$cf_new_cflags"
4424
4425 fi
4426
4427 if test -n "$cf_new_cppflags" ; then
4428
4429         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4430         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4431
4432 fi
4433
4434 if test -n "$cf_new_extra_cppflags" ; then
4435
4436         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4437         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4438
4439 fi
4440
4441 fi
4442
4443 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4444
4445 cf_save_CFLAGS="$CFLAGS"
4446 cf_save_CPPFLAGS="$CPPFLAGS"
4447
4448 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4449         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4450                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4451
4452 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4453         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4454                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4455
4456 echo "$as_me:4456: checking if we should define _POSIX_C_SOURCE" >&5
4457 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4458 if test "${cf_cv_posix_c_source+set}" = set; then
4459   echo $ECHO_N "(cached) $ECHO_C" >&6
4460 else
4461
4462 echo "${as_me:-configure}:4462: testing if the symbol is already defined go no further ..." 1>&5
4463
4464         cat >conftest.$ac_ext <<_ACEOF
4465 #line 4465 "configure"
4466 #include "confdefs.h"
4467 #include <sys/types.h>
4468 int
4469 main (void)
4470 {
4471
4472 #ifndef _POSIX_C_SOURCE
4473 make an error
4474 #endif
4475   ;
4476   return 0;
4477 }
4478 _ACEOF
4479 rm -f conftest.$ac_objext
4480 if { (eval echo "$as_me:4480: \"$ac_compile\"") >&5
4481   (eval $ac_compile) 2>&5
4482   ac_status=$?
4483   echo "$as_me:4483: \$? = $ac_status" >&5
4484   (exit $ac_status); } &&
4485          { ac_try='test -s conftest.$ac_objext'
4486   { (eval echo "$as_me:4486: \"$ac_try\"") >&5
4487   (eval $ac_try) 2>&5
4488   ac_status=$?
4489   echo "$as_me:4489: \$? = $ac_status" >&5
4490   (exit $ac_status); }; }; then
4491   cf_cv_posix_c_source=no
4492 else
4493   echo "$as_me: failed program was:" >&5
4494 cat conftest.$ac_ext >&5
4495 cf_want_posix_source=no
4496          case .$cf_POSIX_C_SOURCE in
4497          (.[12]??*)
4498                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4499                 ;;
4500          (.2)
4501                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4502                 cf_want_posix_source=yes
4503                 ;;
4504          (.*)
4505                 cf_want_posix_source=yes
4506                 ;;
4507          esac
4508          if test "$cf_want_posix_source" = yes ; then
4509                 cat >conftest.$ac_ext <<_ACEOF
4510 #line 4510 "configure"
4511 #include "confdefs.h"
4512 #include <sys/types.h>
4513 int
4514 main (void)
4515 {
4516
4517 #ifdef _POSIX_SOURCE
4518 make an error
4519 #endif
4520   ;
4521   return 0;
4522 }
4523 _ACEOF
4524 rm -f conftest.$ac_objext
4525 if { (eval echo "$as_me:4525: \"$ac_compile\"") >&5
4526   (eval $ac_compile) 2>&5
4527   ac_status=$?
4528   echo "$as_me:4528: \$? = $ac_status" >&5
4529   (exit $ac_status); } &&
4530          { ac_try='test -s conftest.$ac_objext'
4531   { (eval echo "$as_me:4531: \"$ac_try\"") >&5
4532   (eval $ac_try) 2>&5
4533   ac_status=$?
4534   echo "$as_me:4534: \$? = $ac_status" >&5
4535   (exit $ac_status); }; }; then
4536   :
4537 else
4538   echo "$as_me: failed program was:" >&5
4539 cat conftest.$ac_ext >&5
4540 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4541 fi
4542 rm -f conftest.$ac_objext conftest.$ac_ext
4543          fi
4544
4545 echo "${as_me:-configure}:4545: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4546
4547          CFLAGS="$cf_trim_CFLAGS"
4548          CPPFLAGS="$cf_trim_CPPFLAGS"
4549
4550         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4551         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4552
4553 echo "${as_me:-configure}:4553: testing if the second compile does not leave our definition intact error ..." 1>&5
4554
4555          cat >conftest.$ac_ext <<_ACEOF
4556 #line 4556 "configure"
4557 #include "confdefs.h"
4558 #include <sys/types.h>
4559 int
4560 main (void)
4561 {
4562
4563 #ifndef _POSIX_C_SOURCE
4564 make an error
4565 #endif
4566   ;
4567   return 0;
4568 }
4569 _ACEOF
4570 rm -f conftest.$ac_objext
4571 if { (eval echo "$as_me:4571: \"$ac_compile\"") >&5
4572   (eval $ac_compile) 2>&5
4573   ac_status=$?
4574   echo "$as_me:4574: \$? = $ac_status" >&5
4575   (exit $ac_status); } &&
4576          { ac_try='test -s conftest.$ac_objext'
4577   { (eval echo "$as_me:4577: \"$ac_try\"") >&5
4578   (eval $ac_try) 2>&5
4579   ac_status=$?
4580   echo "$as_me:4580: \$? = $ac_status" >&5
4581   (exit $ac_status); }; }; then
4582   :
4583 else
4584   echo "$as_me: failed program was:" >&5
4585 cat conftest.$ac_ext >&5
4586 cf_cv_posix_c_source=no
4587 fi
4588 rm -f conftest.$ac_objext conftest.$ac_ext
4589          CFLAGS="$cf_save_CFLAGS"
4590          CPPFLAGS="$cf_save_CPPFLAGS"
4591
4592 fi
4593 rm -f conftest.$ac_objext conftest.$ac_ext
4594
4595 fi
4596 echo "$as_me:4596: result: $cf_cv_posix_c_source" >&5
4597 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4598
4599 if test "$cf_cv_posix_c_source" != no ; then
4600         CFLAGS="$cf_trim_CFLAGS"
4601         CPPFLAGS="$cf_trim_CPPFLAGS"
4602
4603 cf_fix_cppflags=no
4604 cf_new_cflags=
4605 cf_new_cppflags=
4606 cf_new_extra_cppflags=
4607
4608 for cf_add_cflags in $cf_cv_posix_c_source
4609 do
4610 case $cf_fix_cppflags in
4611 (no)
4612         case $cf_add_cflags in
4613         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4614                 case $cf_add_cflags in
4615                 (-D*)
4616                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4617
4618                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4619                                 && test -z "${cf_tst_cflags}" \
4620                                 && cf_fix_cppflags=yes
4621
4622                         if test $cf_fix_cppflags = yes ; then
4623
4624         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4625         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4626
4627                                 continue
4628                         elif test "${cf_tst_cflags}" = "\"'" ; then
4629
4630         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4631         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4632
4633                                 continue
4634                         fi
4635                         ;;
4636                 esac
4637                 case "$CPPFLAGS" in
4638                 (*$cf_add_cflags)
4639                         ;;
4640                 (*)
4641                         case $cf_add_cflags in
4642                         (-D*)
4643                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4644
4645 CPPFLAGS=`echo "$CPPFLAGS" | \
4646         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4647                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4648
4649                                 ;;
4650                         esac
4651
4652         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4653         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4654
4655                         ;;
4656                 esac
4657                 ;;
4658         (*)
4659
4660         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4661         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4662
4663                 ;;
4664         esac
4665         ;;
4666 (yes)
4667
4668         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4669         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4670
4671         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4672
4673         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4674                 && test -z "${cf_tst_cflags}" \
4675                 && cf_fix_cppflags=no
4676         ;;
4677 esac
4678 done
4679
4680 if test -n "$cf_new_cflags" ; then
4681
4682         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4683         CFLAGS="${CFLAGS}$cf_new_cflags"
4684
4685 fi
4686
4687 if test -n "$cf_new_cppflags" ; then
4688
4689         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4690         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4691
4692 fi
4693
4694 if test -n "$cf_new_extra_cppflags" ; then
4695
4696         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4697         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4698
4699 fi
4700
4701 fi
4702
4703         ;;
4704 esac
4705
4706 if test -n "$cf_xopen_source" ; then
4707
4708 cf_fix_cppflags=no
4709 cf_new_cflags=
4710 cf_new_cppflags=
4711 cf_new_extra_cppflags=
4712
4713 for cf_add_cflags in $cf_xopen_source
4714 do
4715 case $cf_fix_cppflags in
4716 (no)
4717         case $cf_add_cflags in
4718         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4719                 case $cf_add_cflags in
4720                 (-D*)
4721                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4722
4723                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4724                                 && test -z "${cf_tst_cflags}" \
4725                                 && cf_fix_cppflags=yes
4726
4727                         if test $cf_fix_cppflags = yes ; then
4728
4729         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4730         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4731
4732                                 continue
4733                         elif test "${cf_tst_cflags}" = "\"'" ; then
4734
4735         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4736         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4737
4738                                 continue
4739                         fi
4740                         ;;
4741                 esac
4742                 case "$CPPFLAGS" in
4743                 (*$cf_add_cflags)
4744                         ;;
4745                 (*)
4746                         case $cf_add_cflags in
4747                         (-D*)
4748                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4749
4750 CPPFLAGS=`echo "$CPPFLAGS" | \
4751         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4752                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4753
4754                                 ;;
4755                         esac
4756
4757         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4758         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4759
4760                         ;;
4761                 esac
4762                 ;;
4763         (*)
4764
4765         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4766         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4767
4768                 ;;
4769         esac
4770         ;;
4771 (yes)
4772
4773         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4774         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4775
4776         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4777
4778         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4779                 && test -z "${cf_tst_cflags}" \
4780                 && cf_fix_cppflags=no
4781         ;;
4782 esac
4783 done
4784
4785 if test -n "$cf_new_cflags" ; then
4786         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4787
4788 echo "${as_me:-configure}:4788: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4789
4790         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4791         CFLAGS="${CFLAGS}$cf_new_cflags"
4792
4793 fi
4794
4795 if test -n "$cf_new_cppflags" ; then
4796         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4797
4798 echo "${as_me:-configure}:4798: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4799
4800         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4801         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4802
4803 fi
4804
4805 if test -n "$cf_new_extra_cppflags" ; then
4806         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4807
4808 echo "${as_me:-configure}:4808: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4809
4810         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4811         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4812
4813 fi
4814
4815 fi
4816
4817 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4818         echo "$as_me:4818: checking if _XOPEN_SOURCE really is set" >&5
4819 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4820         cat >conftest.$ac_ext <<_ACEOF
4821 #line 4821 "configure"
4822 #include "confdefs.h"
4823 #include <stdlib.h>
4824 int
4825 main (void)
4826 {
4827
4828 #ifndef _XOPEN_SOURCE
4829 make an error
4830 #endif
4831   ;
4832   return 0;
4833 }
4834 _ACEOF
4835 rm -f conftest.$ac_objext
4836 if { (eval echo "$as_me:4836: \"$ac_compile\"") >&5
4837   (eval $ac_compile) 2>&5
4838   ac_status=$?
4839   echo "$as_me:4839: \$? = $ac_status" >&5
4840   (exit $ac_status); } &&
4841          { ac_try='test -s conftest.$ac_objext'
4842   { (eval echo "$as_me:4842: \"$ac_try\"") >&5
4843   (eval $ac_try) 2>&5
4844   ac_status=$?
4845   echo "$as_me:4845: \$? = $ac_status" >&5
4846   (exit $ac_status); }; }; then
4847   cf_XOPEN_SOURCE_set=yes
4848 else
4849   echo "$as_me: failed program was:" >&5
4850 cat conftest.$ac_ext >&5
4851 cf_XOPEN_SOURCE_set=no
4852 fi
4853 rm -f conftest.$ac_objext conftest.$ac_ext
4854         echo "$as_me:4854: result: $cf_XOPEN_SOURCE_set" >&5
4855 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4856         if test $cf_XOPEN_SOURCE_set = yes
4857         then
4858                 cat >conftest.$ac_ext <<_ACEOF
4859 #line 4859 "configure"
4860 #include "confdefs.h"
4861 #include <stdlib.h>
4862 int
4863 main (void)
4864 {
4865
4866 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4867 make an error
4868 #endif
4869   ;
4870   return 0;
4871 }
4872 _ACEOF
4873 rm -f conftest.$ac_objext
4874 if { (eval echo "$as_me:4874: \"$ac_compile\"") >&5
4875   (eval $ac_compile) 2>&5
4876   ac_status=$?
4877   echo "$as_me:4877: \$? = $ac_status" >&5
4878   (exit $ac_status); } &&
4879          { ac_try='test -s conftest.$ac_objext'
4880   { (eval echo "$as_me:4880: \"$ac_try\"") >&5
4881   (eval $ac_try) 2>&5
4882   ac_status=$?
4883   echo "$as_me:4883: \$? = $ac_status" >&5
4884   (exit $ac_status); }; }; then
4885   cf_XOPEN_SOURCE_set_ok=yes
4886 else
4887   echo "$as_me: failed program was:" >&5
4888 cat conftest.$ac_ext >&5
4889 cf_XOPEN_SOURCE_set_ok=no
4890 fi
4891 rm -f conftest.$ac_objext conftest.$ac_ext
4892                 if test $cf_XOPEN_SOURCE_set_ok = no
4893                 then
4894                         { echo "$as_me:4894: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4895 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4896                 fi
4897         else
4898
4899 echo "$as_me:4899: checking if we should define _XOPEN_SOURCE" >&5
4900 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4901 if test "${cf_cv_xopen_source+set}" = set; then
4902   echo $ECHO_N "(cached) $ECHO_C" >&6
4903 else
4904
4905         cat >conftest.$ac_ext <<_ACEOF
4906 #line 4906 "configure"
4907 #include "confdefs.h"
4908
4909 #include <stdlib.h>
4910 #include <string.h>
4911 #include <sys/types.h>
4912
4913 int
4914 main (void)
4915 {
4916
4917 #ifndef _XOPEN_SOURCE
4918 make an error
4919 #endif
4920   ;
4921   return 0;
4922 }
4923 _ACEOF
4924 rm -f conftest.$ac_objext
4925 if { (eval echo "$as_me:4925: \"$ac_compile\"") >&5
4926   (eval $ac_compile) 2>&5
4927   ac_status=$?
4928   echo "$as_me:4928: \$? = $ac_status" >&5
4929   (exit $ac_status); } &&
4930          { ac_try='test -s conftest.$ac_objext'
4931   { (eval echo "$as_me:4931: \"$ac_try\"") >&5
4932   (eval $ac_try) 2>&5
4933   ac_status=$?
4934   echo "$as_me:4934: \$? = $ac_status" >&5
4935   (exit $ac_status); }; }; then
4936   cf_cv_xopen_source=no
4937 else
4938   echo "$as_me: failed program was:" >&5
4939 cat conftest.$ac_ext >&5
4940 cf_save="$CPPFLAGS"
4941
4942         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4943         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4944
4945          cat >conftest.$ac_ext <<_ACEOF
4946 #line 4946 "configure"
4947 #include "confdefs.h"
4948
4949 #include <stdlib.h>
4950 #include <string.h>
4951 #include <sys/types.h>
4952
4953 int
4954 main (void)
4955 {
4956
4957 #ifdef _XOPEN_SOURCE
4958 make an error
4959 #endif
4960   ;
4961   return 0;
4962 }
4963 _ACEOF
4964 rm -f conftest.$ac_objext
4965 if { (eval echo "$as_me:4965: \"$ac_compile\"") >&5
4966   (eval $ac_compile) 2>&5
4967   ac_status=$?
4968   echo "$as_me:4968: \$? = $ac_status" >&5
4969   (exit $ac_status); } &&
4970          { ac_try='test -s conftest.$ac_objext'
4971   { (eval echo "$as_me:4971: \"$ac_try\"") >&5
4972   (eval $ac_try) 2>&5
4973   ac_status=$?
4974   echo "$as_me:4974: \$? = $ac_status" >&5
4975   (exit $ac_status); }; }; then
4976   cf_cv_xopen_source=no
4977 else
4978   echo "$as_me: failed program was:" >&5
4979 cat conftest.$ac_ext >&5
4980 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4981 fi
4982 rm -f conftest.$ac_objext conftest.$ac_ext
4983         CPPFLAGS="$cf_save"
4984
4985 fi
4986 rm -f conftest.$ac_objext conftest.$ac_ext
4987
4988 fi
4989 echo "$as_me:4989: result: $cf_cv_xopen_source" >&5
4990 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4991
4992 if test "$cf_cv_xopen_source" != no ; then
4993
4994 CFLAGS=`echo "$CFLAGS" | \
4995         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4996                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4997
4998 CPPFLAGS=`echo "$CPPFLAGS" | \
4999         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5000                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5001
5002         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5003
5004 cf_fix_cppflags=no
5005 cf_new_cflags=
5006 cf_new_cppflags=
5007 cf_new_extra_cppflags=
5008
5009 for cf_add_cflags in $cf_temp_xopen_source
5010 do
5011 case $cf_fix_cppflags in
5012 (no)
5013         case $cf_add_cflags in
5014         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5015                 case $cf_add_cflags in
5016                 (-D*)
5017                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5018
5019                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5020                                 && test -z "${cf_tst_cflags}" \
5021                                 && cf_fix_cppflags=yes
5022
5023                         if test $cf_fix_cppflags = yes ; then
5024
5025         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5026         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5027
5028                                 continue
5029                         elif test "${cf_tst_cflags}" = "\"'" ; then
5030
5031         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5032         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5033
5034                                 continue
5035                         fi
5036                         ;;
5037                 esac
5038                 case "$CPPFLAGS" in
5039                 (*$cf_add_cflags)
5040                         ;;
5041                 (*)
5042                         case $cf_add_cflags in
5043                         (-D*)
5044                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5045
5046 CPPFLAGS=`echo "$CPPFLAGS" | \
5047         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5048                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5049
5050                                 ;;
5051                         esac
5052
5053         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5054         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5055
5056                         ;;
5057                 esac
5058                 ;;
5059         (*)
5060
5061         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5062         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5063
5064                 ;;
5065         esac
5066         ;;
5067 (yes)
5068
5069         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5070         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5071
5072         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5073
5074         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5075                 && test -z "${cf_tst_cflags}" \
5076                 && cf_fix_cppflags=no
5077         ;;
5078 esac
5079 done
5080
5081 if test -n "$cf_new_cflags" ; then
5082
5083         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5084         CFLAGS="${CFLAGS}$cf_new_cflags"
5085
5086 fi
5087
5088 if test -n "$cf_new_cppflags" ; then
5089
5090         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5091         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5092
5093 fi
5094
5095 if test -n "$cf_new_extra_cppflags" ; then
5096
5097         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5098         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5099
5100 fi
5101
5102 fi
5103
5104         fi
5105 fi
5106
5107 echo "$as_me:5107: checking for signal global datatype" >&5
5108 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5109 if test "${cf_cv_sig_atomic_t+set}" = set; then
5110   echo $ECHO_N "(cached) $ECHO_C" >&6
5111 else
5112
5113         for cf_type in \
5114                 "volatile sig_atomic_t" \
5115                 "sig_atomic_t" \
5116                 "int"
5117         do
5118         cat >conftest.$ac_ext <<_ACEOF
5119 #line 5119 "configure"
5120 #include "confdefs.h"
5121
5122 #include <sys/types.h>
5123 #include <signal.h>
5124 #include <stdio.h>
5125
5126 extern $cf_type x;
5127 $cf_type x;
5128 static void handler(int sig)
5129 {
5130         x = 5;
5131 }
5132 int
5133 main (void)
5134 {
5135 signal(SIGINT, handler);
5136                  x = 1
5137   ;
5138   return 0;
5139 }
5140 _ACEOF
5141 rm -f conftest.$ac_objext
5142 if { (eval echo "$as_me:5142: \"$ac_compile\"") >&5
5143   (eval $ac_compile) 2>&5
5144   ac_status=$?
5145   echo "$as_me:5145: \$? = $ac_status" >&5
5146   (exit $ac_status); } &&
5147          { ac_try='test -s conftest.$ac_objext'
5148   { (eval echo "$as_me:5148: \"$ac_try\"") >&5
5149   (eval $ac_try) 2>&5
5150   ac_status=$?
5151   echo "$as_me:5151: \$? = $ac_status" >&5
5152   (exit $ac_status); }; }; then
5153   cf_cv_sig_atomic_t=$cf_type
5154 else
5155   echo "$as_me: failed program was:" >&5
5156 cat conftest.$ac_ext >&5
5157 cf_cv_sig_atomic_t=no
5158 fi
5159 rm -f conftest.$ac_objext conftest.$ac_ext
5160                 test "$cf_cv_sig_atomic_t" != no && break
5161         done
5162
5163 fi
5164
5165 echo "$as_me:5165: result: $cf_cv_sig_atomic_t" >&5
5166 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5167 test "$cf_cv_sig_atomic_t" != no &&
5168 cat >>confdefs.h <<EOF
5169 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5170 EOF
5171
5172 # Work around breakage on OS X
5173
5174 echo "$as_me:5174: checking if SIGWINCH is defined" >&5
5175 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5176 if test "${cf_cv_define_sigwinch+set}" = set; then
5177   echo $ECHO_N "(cached) $ECHO_C" >&6
5178 else
5179
5180         cat >conftest.$ac_ext <<_ACEOF
5181 #line 5181 "configure"
5182 #include "confdefs.h"
5183
5184 #include <sys/types.h>
5185 #include <sys/signal.h>
5186
5187 int
5188 main (void)
5189 {
5190 int x = SIGWINCH
5191   ;
5192   return 0;
5193 }
5194 _ACEOF
5195 rm -f conftest.$ac_objext
5196 if { (eval echo "$as_me:5196: \"$ac_compile\"") >&5
5197   (eval $ac_compile) 2>&5
5198   ac_status=$?
5199   echo "$as_me:5199: \$? = $ac_status" >&5
5200   (exit $ac_status); } &&
5201          { ac_try='test -s conftest.$ac_objext'
5202   { (eval echo "$as_me:5202: \"$ac_try\"") >&5
5203   (eval $ac_try) 2>&5
5204   ac_status=$?
5205   echo "$as_me:5205: \$? = $ac_status" >&5
5206   (exit $ac_status); }; }; then
5207   cf_cv_define_sigwinch=yes
5208 else
5209   echo "$as_me: failed program was:" >&5
5210 cat conftest.$ac_ext >&5
5211 cat >conftest.$ac_ext <<_ACEOF
5212 #line 5212 "configure"
5213 #include "confdefs.h"
5214
5215 #undef _XOPEN_SOURCE
5216 #undef _POSIX_SOURCE
5217 #undef _POSIX_C_SOURCE
5218 #include <sys/types.h>
5219 #include <sys/signal.h>
5220
5221 int
5222 main (void)
5223 {
5224 int x = SIGWINCH
5225   ;
5226   return 0;
5227 }
5228 _ACEOF
5229 rm -f conftest.$ac_objext
5230 if { (eval echo "$as_me:5230: \"$ac_compile\"") >&5
5231   (eval $ac_compile) 2>&5
5232   ac_status=$?
5233   echo "$as_me:5233: \$? = $ac_status" >&5
5234   (exit $ac_status); } &&
5235          { ac_try='test -s conftest.$ac_objext'
5236   { (eval echo "$as_me:5236: \"$ac_try\"") >&5
5237   (eval $ac_try) 2>&5
5238   ac_status=$?
5239   echo "$as_me:5239: \$? = $ac_status" >&5
5240   (exit $ac_status); }; }; then
5241   cf_cv_define_sigwinch=maybe
5242 else
5243   echo "$as_me: failed program was:" >&5
5244 cat conftest.$ac_ext >&5
5245 cf_cv_define_sigwinch=no
5246 fi
5247 rm -f conftest.$ac_objext conftest.$ac_ext
5248
5249 fi
5250 rm -f conftest.$ac_objext conftest.$ac_ext
5251
5252 fi
5253 echo "$as_me:5253: result: $cf_cv_define_sigwinch" >&5
5254 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5255
5256 if test "$cf_cv_define_sigwinch" = maybe ; then
5257 echo "$as_me:5257: checking for actual SIGWINCH definition" >&5
5258 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5259 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5260   echo $ECHO_N "(cached) $ECHO_C" >&6
5261 else
5262
5263 cf_cv_fixup_sigwinch=unknown
5264 cf_sigwinch=32
5265 while test $cf_sigwinch != 1
5266 do
5267         cat >conftest.$ac_ext <<_ACEOF
5268 #line 5268 "configure"
5269 #include "confdefs.h"
5270
5271 #undef _XOPEN_SOURCE
5272 #undef _POSIX_SOURCE
5273 #undef _POSIX_C_SOURCE
5274 #include <sys/types.h>
5275 #include <sys/signal.h>
5276
5277 int
5278 main (void)
5279 {
5280
5281 #if SIGWINCH != $cf_sigwinch
5282 make an error
5283 #endif
5284 int x = SIGWINCH
5285   ;
5286   return 0;
5287 }
5288 _ACEOF
5289 rm -f conftest.$ac_objext
5290 if { (eval echo "$as_me:5290: \"$ac_compile\"") >&5
5291   (eval $ac_compile) 2>&5
5292   ac_status=$?
5293   echo "$as_me:5293: \$? = $ac_status" >&5
5294   (exit $ac_status); } &&
5295          { ac_try='test -s conftest.$ac_objext'
5296   { (eval echo "$as_me:5296: \"$ac_try\"") >&5
5297   (eval $ac_try) 2>&5
5298   ac_status=$?
5299   echo "$as_me:5299: \$? = $ac_status" >&5
5300   (exit $ac_status); }; }; then
5301   cf_cv_fixup_sigwinch=$cf_sigwinch
5302          break
5303 else
5304   echo "$as_me: failed program was:" >&5
5305 cat conftest.$ac_ext >&5
5306 fi
5307 rm -f conftest.$ac_objext conftest.$ac_ext
5308
5309 cf_sigwinch=`expr $cf_sigwinch - 1`
5310 done
5311
5312 fi
5313 echo "$as_me:5313: result: $cf_cv_fixup_sigwinch" >&5
5314 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5315
5316         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5317                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5318         fi
5319 fi
5320
5321 # Checks for CODESET support.
5322
5323 echo "$as_me:5323: checking for nl_langinfo and CODESET" >&5
5324 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5325 if test "${am_cv_langinfo_codeset+set}" = set; then
5326   echo $ECHO_N "(cached) $ECHO_C" >&6
5327 else
5328   cat >conftest.$ac_ext <<_ACEOF
5329 #line 5329 "configure"
5330 #include "confdefs.h"
5331 #include <langinfo.h>
5332 int
5333 main (void)
5334 {
5335 char* cs = nl_langinfo(CODESET);
5336   ;
5337   return 0;
5338 }
5339 _ACEOF
5340 rm -f conftest.$ac_objext conftest$ac_exeext
5341 if { (eval echo "$as_me:5341: \"$ac_link\"") >&5
5342   (eval $ac_link) 2>&5
5343   ac_status=$?
5344   echo "$as_me:5344: \$? = $ac_status" >&5
5345   (exit $ac_status); } &&
5346          { ac_try='test -s conftest$ac_exeext'
5347   { (eval echo "$as_me:5347: \"$ac_try\"") >&5
5348   (eval $ac_try) 2>&5
5349   ac_status=$?
5350   echo "$as_me:5350: \$? = $ac_status" >&5
5351   (exit $ac_status); }; }; then
5352   am_cv_langinfo_codeset=yes
5353 else
5354   echo "$as_me: failed program was:" >&5
5355 cat conftest.$ac_ext >&5
5356 am_cv_langinfo_codeset=no
5357 fi
5358 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5359
5360 fi
5361 echo "$as_me:5361: result: $am_cv_langinfo_codeset" >&5
5362 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5363         if test $am_cv_langinfo_codeset = yes; then
5364
5365 cat >>confdefs.h <<\EOF
5366 #define HAVE_LANGINFO_CODESET 1
5367 EOF
5368
5369         fi
5370
5371 echo "$as_me:5371: checking if you want to use pkg-config" >&5
5372 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5373
5374 # Check whether --with-pkg-config or --without-pkg-config was given.
5375 if test "${with_pkg_config+set}" = set; then
5376   withval="$with_pkg_config"
5377   cf_pkg_config=$withval
5378 else
5379   cf_pkg_config=yes
5380 fi;
5381 echo "$as_me:5381: result: $cf_pkg_config" >&5
5382 echo "${ECHO_T}$cf_pkg_config" >&6
5383
5384 case $cf_pkg_config in
5385 (no)
5386         PKG_CONFIG=none
5387         ;;
5388 (yes)
5389
5390 if test -n "$ac_tool_prefix"; then
5391   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5392 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5393 echo "$as_me:5393: checking for $ac_word" >&5
5394 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5395 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5396   echo $ECHO_N "(cached) $ECHO_C" >&6
5397 else
5398   case $PKG_CONFIG in
5399   [\\/]* | ?:[\\/]*)
5400   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5401   ;;
5402   *)
5403   ac_save_IFS=$IFS; IFS=$ac_path_separator
5404 ac_dummy="$PATH"
5405 for ac_dir in $ac_dummy; do
5406   IFS=$ac_save_IFS
5407   test -z "$ac_dir" && ac_dir=.
5408   if $as_executable_p "$ac_dir/$ac_word"; then
5409    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5410    echo "$as_me:5410: found $ac_dir/$ac_word" >&5
5411    break
5412 fi
5413 done
5414
5415   ;;
5416 esac
5417 fi
5418 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5419
5420 if test -n "$PKG_CONFIG"; then
5421   echo "$as_me:5421: result: $PKG_CONFIG" >&5
5422 echo "${ECHO_T}$PKG_CONFIG" >&6
5423 else
5424   echo "$as_me:5424: result: no" >&5
5425 echo "${ECHO_T}no" >&6
5426 fi
5427
5428 fi
5429 if test -z "$ac_cv_path_PKG_CONFIG"; then
5430   ac_pt_PKG_CONFIG=$PKG_CONFIG
5431   # Extract the first word of "pkg-config", so it can be a program name with args.
5432 set dummy pkg-config; ac_word=$2
5433 echo "$as_me:5433: checking for $ac_word" >&5
5434 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5435 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5436   echo $ECHO_N "(cached) $ECHO_C" >&6
5437 else
5438   case $ac_pt_PKG_CONFIG in
5439   [\\/]* | ?:[\\/]*)
5440   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5441   ;;
5442   *)
5443   ac_save_IFS=$IFS; IFS=$ac_path_separator
5444 ac_dummy="$PATH"
5445 for ac_dir in $ac_dummy; do
5446   IFS=$ac_save_IFS
5447   test -z "$ac_dir" && ac_dir=.
5448   if $as_executable_p "$ac_dir/$ac_word"; then
5449    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5450    echo "$as_me:5450: found $ac_dir/$ac_word" >&5
5451    break
5452 fi
5453 done
5454
5455   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5456   ;;
5457 esac
5458 fi
5459 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5460
5461 if test -n "$ac_pt_PKG_CONFIG"; then
5462   echo "$as_me:5462: result: $ac_pt_PKG_CONFIG" >&5
5463 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5464 else
5465   echo "$as_me:5465: result: no" >&5
5466 echo "${ECHO_T}no" >&6
5467 fi
5468
5469   PKG_CONFIG=$ac_pt_PKG_CONFIG
5470 else
5471   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5472 fi
5473
5474         ;;
5475 (*)
5476         PKG_CONFIG=$withval
5477         ;;
5478 esac
5479
5480 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5481 if test "$PKG_CONFIG" != none ; then
5482
5483 if test "x$prefix" != xNONE; then
5484         cf_path_syntax="$prefix"
5485 else
5486         cf_path_syntax="$ac_default_prefix"
5487 fi
5488
5489 case ".$PKG_CONFIG" in
5490 (.\$\(*\)*|.\'*\'*)
5491         ;;
5492 (..|./*|.\\*)
5493         ;;
5494 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5495         ;;
5496 (.\${*prefix}*|.\${*dir}*)
5497         eval PKG_CONFIG="$PKG_CONFIG"
5498         case ".$PKG_CONFIG" in
5499         (.NONE/*)
5500                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5501                 ;;
5502         esac
5503         ;;
5504 (.no|.NONE/*)
5505         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5506         ;;
5507 (*)
5508         { { echo "$as_me:5508: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5509 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5510    { (exit 1); exit 1; }; }
5511         ;;
5512 esac
5513
5514 elif test "x$cf_pkg_config" != xno ; then
5515         { echo "$as_me:5515: WARNING: pkg-config is not installed" >&5
5516 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5517 fi
5518
5519 echo "$as_me:5519: checking if you want to see long compiling messages" >&5
5520 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5521
5522 # Check whether --enable-echo or --disable-echo was given.
5523 if test "${enable_echo+set}" = set; then
5524   enableval="$enable_echo"
5525   test "$enableval" != no && enableval=yes
5526         if test "$enableval" != "yes" ; then
5527
5528         ECHO_LT='--silent'
5529         ECHO_LD='@echo linking $@;'
5530         RULE_CC='@echo compiling $<'
5531         SHOW_CC='@echo compiling $@'
5532         ECHO_CC='@'
5533
5534         else
5535
5536         ECHO_LT=''
5537         ECHO_LD=''
5538         RULE_CC=''
5539         SHOW_CC=''
5540         ECHO_CC=''
5541
5542         fi
5543 else
5544   enableval=yes
5545
5546         ECHO_LT=''
5547         ECHO_LD=''
5548         RULE_CC=''
5549         SHOW_CC=''
5550         ECHO_CC=''
5551
5552 fi;
5553 echo "$as_me:5553: result: $enableval" >&5
5554 echo "${ECHO_T}$enableval" >&6
5555
5556 echo "$as_me:5556: checking for ncurses wrap-prefix" >&5
5557 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5558
5559 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5560 if test "${with_ncurses_wrap_prefix+set}" = set; then
5561   withval="$with_ncurses_wrap_prefix"
5562   NCURSES_WRAP_PREFIX=$withval
5563 else
5564   NCURSES_WRAP_PREFIX=_nc_
5565 fi;
5566 echo "$as_me:5566: result: $NCURSES_WRAP_PREFIX" >&5
5567 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5568
5569 echo "$as_me:5569: checking if you want to check for wide-character functions" >&5
5570 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5571
5572 # Check whether --enable-widec or --disable-widec was given.
5573 if test "${enable_widec+set}" = set; then
5574   enableval="$enable_widec"
5575   test "$enableval" != no && enableval=yes
5576         if test "$enableval" != "yes" ; then
5577     cf_enable_widec=no
5578         else
5579                 cf_enable_widec=yes
5580         fi
5581 else
5582   enableval=yes
5583         cf_enable_widec=yes
5584
5585 fi;
5586 echo "$as_me:5586: result: $cf_enable_widec" >&5
5587 echo "${ECHO_T}$cf_enable_widec" >&6
5588
5589 echo "$as_me:5589: checking for specific curses-directory" >&5
5590 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5591
5592 # Check whether --with-curses-dir or --without-curses-dir was given.
5593 if test "${with_curses_dir+set}" = set; then
5594   withval="$with_curses_dir"
5595   cf_cv_curses_dir=$withval
5596 else
5597   cf_cv_curses_dir=no
5598 fi;
5599 echo "$as_me:5599: result: $cf_cv_curses_dir" >&5
5600 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5601
5602 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5603 then
5604
5605 if test "x$prefix" != xNONE; then
5606         cf_path_syntax="$prefix"
5607 else
5608         cf_path_syntax="$ac_default_prefix"
5609 fi
5610
5611 case ".$withval" in
5612 (.\$\(*\)*|.\'*\'*)
5613         ;;
5614 (..|./*|.\\*)
5615         ;;
5616 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5617         ;;
5618 (.\${*prefix}*|.\${*dir}*)
5619         eval withval="$withval"
5620         case ".$withval" in
5621         (.NONE/*)
5622                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5623                 ;;
5624         esac
5625         ;;
5626 (.no|.NONE/*)
5627         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5628         ;;
5629 (*)
5630         { { echo "$as_me:5630: error: expected a pathname, not \"$withval\"" >&5
5631 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5632    { (exit 1); exit 1; }; }
5633         ;;
5634 esac
5635
5636         if test -d "$cf_cv_curses_dir"
5637         then
5638
5639 if test -n "$cf_cv_curses_dir/include" ; then
5640   for cf_add_incdir in $cf_cv_curses_dir/include
5641   do
5642         while test $cf_add_incdir != /usr/include
5643         do
5644           if test -d $cf_add_incdir
5645           then
5646                 cf_have_incdir=no
5647                 if test -n "$CFLAGS$CPPFLAGS" ; then
5648                   # a loop is needed to ensure we can add subdirs of existing dirs
5649                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5650                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5651                           cf_have_incdir=yes; break
5652                         fi
5653                   done
5654                 fi
5655
5656                 if test "$cf_have_incdir" = no ; then
5657                   if test "$cf_add_incdir" = /usr/local/include ; then
5658                         if test "$GCC" = yes
5659                         then
5660                           cf_save_CPPFLAGS=$CPPFLAGS
5661
5662         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5663         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5664
5665                           cat >conftest.$ac_ext <<_ACEOF
5666 #line 5666 "configure"
5667 #include "confdefs.h"
5668 #include <stdio.h>
5669 int
5670 main (void)
5671 {
5672 printf("Hello")
5673   ;
5674   return 0;
5675 }
5676 _ACEOF
5677 rm -f conftest.$ac_objext
5678 if { (eval echo "$as_me:5678: \"$ac_compile\"") >&5
5679   (eval $ac_compile) 2>&5
5680   ac_status=$?
5681   echo "$as_me:5681: \$? = $ac_status" >&5
5682   (exit $ac_status); } &&
5683          { ac_try='test -s conftest.$ac_objext'
5684   { (eval echo "$as_me:5684: \"$ac_try\"") >&5
5685   (eval $ac_try) 2>&5
5686   ac_status=$?
5687   echo "$as_me:5687: \$? = $ac_status" >&5
5688   (exit $ac_status); }; }; then
5689   :
5690 else
5691   echo "$as_me: failed program was:" >&5
5692 cat conftest.$ac_ext >&5
5693 cf_have_incdir=yes
5694 fi
5695 rm -f conftest.$ac_objext conftest.$ac_ext
5696                           CPPFLAGS=$cf_save_CPPFLAGS
5697                         fi
5698                   fi
5699                 fi
5700
5701                 if test "$cf_have_incdir" = no ; then
5702                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5703
5704 echo "${as_me:-configure}:5704: testing adding $cf_add_incdir to include-path ..." 1>&5
5705
5706                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5707
5708                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5709                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5710                   cf_add_incdir="$cf_top_incdir"
5711                 else
5712                   break
5713                 fi
5714           else
5715                 break
5716           fi
5717         done
5718   done
5719 fi
5720
5721 if test -n "$cf_cv_curses_dir/lib" ; then
5722         for cf_add_libdir in $cf_cv_curses_dir/lib
5723         do
5724                 if test $cf_add_libdir = /usr/lib ; then
5725                         :
5726                 elif test -d $cf_add_libdir
5727                 then
5728                         cf_have_libdir=no
5729                         if test -n "$LDFLAGS$LIBS" ; then
5730                                 # a loop is needed to ensure we can add subdirs of existing dirs
5731                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5732                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5733                                                 cf_have_libdir=yes; break
5734                                         fi
5735                                 done
5736                         fi
5737                         if test "$cf_have_libdir" = no ; then
5738                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5739
5740 echo "${as_me:-configure}:5740: testing adding $cf_add_libdir to library-path ..." 1>&5
5741
5742                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5743                         fi
5744                 fi
5745         done
5746 fi
5747
5748         fi
5749 fi
5750
5751 cf_cv_screen=curses
5752
5753 echo "$as_me:5753: checking for specified curses library type" >&5
5754 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5755
5756 # Check whether --with-screen or --without-screen was given.
5757 if test "${with_screen+set}" = set; then
5758   withval="$with_screen"
5759   cf_cv_screen=$withval
5760 else
5761
5762 # Check whether --with-ncursesw or --without-ncursesw was given.
5763 if test "${with_ncursesw+set}" = set; then
5764   withval="$with_ncursesw"
5765   cf_cv_screen=ncursesw
5766 else
5767
5768 # Check whether --with-ncurses or --without-ncurses was given.
5769 if test "${with_ncurses+set}" = set; then
5770   withval="$with_ncurses"
5771   cf_cv_screen=ncurses
5772 else
5773
5774 # Check whether --with-pdcurses or --without-pdcurses was given.
5775 if test "${with_pdcurses+set}" = set; then
5776   withval="$with_pdcurses"
5777   cf_cv_screen=pdcurses
5778 else
5779
5780 # Check whether --with-curses-colr or --without-curses-colr was given.
5781 if test "${with_curses_colr+set}" = set; then
5782   withval="$with_curses_colr"
5783   cf_cv_screen=curses_colr
5784 else
5785
5786 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5787 if test "${with_curses_5lib+set}" = set; then
5788   withval="$with_curses_5lib"
5789   cf_cv_screen=curses_5lib
5790 fi;
5791 fi;
5792 fi;
5793 fi;
5794 fi;
5795 fi;
5796
5797 echo "$as_me:5797: result: $cf_cv_screen" >&5
5798 echo "${ECHO_T}$cf_cv_screen" >&6
5799
5800 case $cf_cv_screen in
5801 (curses|curses_*)
5802
5803 echo "$as_me:5803: checking for extra include directories" >&5
5804 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5805 if test "${cf_cv_curses_incdir+set}" = set; then
5806   echo $ECHO_N "(cached) $ECHO_C" >&6
5807 else
5808
5809 cf_cv_curses_incdir=no
5810 case $host_os in
5811 (hpux10.*)
5812         if test "x$cf_cv_screen" = "xcurses_colr"
5813         then
5814                 test -d /usr/include/curses_colr && \
5815                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5816         fi
5817         ;;
5818 (sunos3*|sunos4*)
5819         if test "x$cf_cv_screen" = "xcurses_5lib"
5820         then
5821                 test -d /usr/5lib && \
5822                 test -d /usr/5include && \
5823                 cf_cv_curses_incdir="-I/usr/5include"
5824         fi
5825         ;;
5826 esac
5827
5828 fi
5829 echo "$as_me:5829: result: $cf_cv_curses_incdir" >&5
5830 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5831 if test "$cf_cv_curses_incdir" != no
5832 then
5833
5834         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5835         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
5836
5837 fi
5838
5839 echo "$as_me:5839: checking if we have identified curses headers" >&5
5840 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5841 if test "${cf_cv_ncurses_header+set}" = set; then
5842   echo $ECHO_N "(cached) $ECHO_C" >&6
5843 else
5844
5845 cf_cv_ncurses_header=none
5846 for cf_header in \
5847         ncurses.h  \
5848         curses.h  ncurses/ncurses.h ncurses/curses.h
5849 do
5850 cat >conftest.$ac_ext <<_ACEOF
5851 #line 5851 "configure"
5852 #include "confdefs.h"
5853 #include <${cf_header}>
5854 int
5855 main (void)
5856 {
5857 initscr(); tgoto("?", 0,0)
5858   ;
5859   return 0;
5860 }
5861 _ACEOF
5862 rm -f conftest.$ac_objext
5863 if { (eval echo "$as_me:5863: \"$ac_compile\"") >&5
5864   (eval $ac_compile) 2>&5
5865   ac_status=$?
5866   echo "$as_me:5866: \$? = $ac_status" >&5
5867   (exit $ac_status); } &&
5868          { ac_try='test -s conftest.$ac_objext'
5869   { (eval echo "$as_me:5869: \"$ac_try\"") >&5
5870   (eval $ac_try) 2>&5
5871   ac_status=$?
5872   echo "$as_me:5872: \$? = $ac_status" >&5
5873   (exit $ac_status); }; }; then
5874   cf_cv_ncurses_header=$cf_header; break
5875 else
5876   echo "$as_me: failed program was:" >&5
5877 cat conftest.$ac_ext >&5
5878 fi
5879 rm -f conftest.$ac_objext conftest.$ac_ext
5880 done
5881
5882 fi
5883 echo "$as_me:5883: result: $cf_cv_ncurses_header" >&5
5884 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5885
5886 if test "$cf_cv_ncurses_header" = none ; then
5887         { { echo "$as_me:5887: error: No curses header-files found" >&5
5888 echo "$as_me: error: No curses header-files found" >&2;}
5889    { (exit 1); exit 1; }; }
5890 fi
5891
5892 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5893
5894 for ac_header in $cf_cv_ncurses_header
5895 do
5896 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5897 echo "$as_me:5897: checking for $ac_header" >&5
5898 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5899 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5900   echo $ECHO_N "(cached) $ECHO_C" >&6
5901 else
5902   cat >conftest.$ac_ext <<_ACEOF
5903 #line 5903 "configure"
5904 #include "confdefs.h"
5905 #include <$ac_header>
5906 _ACEOF
5907 if { (eval echo "$as_me:5907: \"$ac_cpp conftest.$ac_ext\"") >&5
5908   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5909   ac_status=$?
5910   egrep -v '^ *\+' conftest.er1 >conftest.err
5911   rm -f conftest.er1
5912   cat conftest.err >&5
5913   echo "$as_me:5913: \$? = $ac_status" >&5
5914   (exit $ac_status); } >/dev/null; then
5915   if test -s conftest.err; then
5916     ac_cpp_err=$ac_c_preproc_warn_flag
5917   else
5918     ac_cpp_err=
5919   fi
5920 else
5921   ac_cpp_err=yes
5922 fi
5923 if test -z "$ac_cpp_err"; then
5924   eval "$as_ac_Header=yes"
5925 else
5926   echo "$as_me: failed program was:" >&5
5927   cat conftest.$ac_ext >&5
5928   eval "$as_ac_Header=no"
5929 fi
5930 rm -f conftest.err conftest.$ac_ext
5931 fi
5932 echo "$as_me:5932: result: `eval echo '${'$as_ac_Header'}'`" >&5
5933 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5934 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5935   cat >>confdefs.h <<EOF
5936 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5937 EOF
5938
5939 fi
5940 done
5941
5942 echo "$as_me:5942: checking for terminfo header" >&5
5943 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5944 if test "${cf_cv_term_header+set}" = set; then
5945   echo $ECHO_N "(cached) $ECHO_C" >&6
5946 else
5947
5948 case ${cf_cv_ncurses_header} in
5949 (*/ncurses.h|*/ncursesw.h)
5950         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5951         ;;
5952 (*)
5953         cf_term_header=term.h
5954         ;;
5955 esac
5956
5957 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5958 do
5959 cat >conftest.$ac_ext <<_ACEOF
5960 #line 5960 "configure"
5961 #include "confdefs.h"
5962 #include <stdio.h>
5963 #include <${cf_cv_ncurses_header:-curses.h}>
5964 #include <$cf_test>
5965
5966 int
5967 main (void)
5968 {
5969 int x = auto_left_margin
5970   ;
5971   return 0;
5972 }
5973 _ACEOF
5974 rm -f conftest.$ac_objext
5975 if { (eval echo "$as_me:5975: \"$ac_compile\"") >&5
5976   (eval $ac_compile) 2>&5
5977   ac_status=$?
5978   echo "$as_me:5978: \$? = $ac_status" >&5
5979   (exit $ac_status); } &&
5980          { ac_try='test -s conftest.$ac_objext'
5981   { (eval echo "$as_me:5981: \"$ac_try\"") >&5
5982   (eval $ac_try) 2>&5
5983   ac_status=$?
5984   echo "$as_me:5984: \$? = $ac_status" >&5
5985   (exit $ac_status); }; }; then
5986
5987         cf_cv_term_header="$cf_test"
5988 else
5989   echo "$as_me: failed program was:" >&5
5990 cat conftest.$ac_ext >&5
5991
5992         cf_cv_term_header=unknown
5993
5994 fi
5995 rm -f conftest.$ac_objext conftest.$ac_ext
5996         test "$cf_cv_term_header" != unknown && break
5997 done
5998
5999 fi
6000 echo "$as_me:6000: result: $cf_cv_term_header" >&5
6001 echo "${ECHO_T}$cf_cv_term_header" >&6
6002
6003 # Set definitions to allow ifdef'ing to accommodate subdirectories
6004
6005 case $cf_cv_term_header in
6006 (*term.h)
6007
6008 cat >>confdefs.h <<\EOF
6009 #define HAVE_TERM_H 1
6010 EOF
6011
6012         ;;
6013 esac
6014
6015 case $cf_cv_term_header in
6016 (ncurses/term.h)
6017
6018 cat >>confdefs.h <<\EOF
6019 #define HAVE_NCURSES_TERM_H 1
6020 EOF
6021
6022         ;;
6023 (ncursesw/term.h)
6024
6025 cat >>confdefs.h <<\EOF
6026 #define HAVE_NCURSESW_TERM_H 1
6027 EOF
6028
6029         ;;
6030 esac
6031
6032 echo "$as_me:6032: checking for ncurses version" >&5
6033 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6034 if test "${cf_cv_ncurses_version+set}" = set; then
6035   echo $ECHO_N "(cached) $ECHO_C" >&6
6036 else
6037
6038         cf_cv_ncurses_version=no
6039         cf_tempfile=out$$
6040         rm -f $cf_tempfile
6041         if test "$cross_compiling" = yes; then
6042
6043         # This will not work if the preprocessor splits the line after the
6044         # Autoconf token.  The 'unproto' program does that.
6045         cat > conftest.$ac_ext <<EOF
6046 #include <${cf_cv_ncurses_header:-curses.h}>
6047 #undef Autoconf
6048 #ifdef NCURSES_VERSION
6049 Autoconf NCURSES_VERSION
6050 #else
6051 #ifdef __NCURSES_H
6052 Autoconf "old"
6053 #endif
6054 ;
6055 #endif
6056 EOF
6057         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6058         { (eval echo "$as_me:6058: \"$cf_try\"") >&5
6059   (eval $cf_try) 2>&5
6060   ac_status=$?
6061   echo "$as_me:6061: \$? = $ac_status" >&5
6062   (exit $ac_status); }
6063         if test -f conftest.out ; then
6064                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6065                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6066                 rm -f conftest.out
6067         fi
6068
6069 else
6070   cat >conftest.$ac_ext <<_ACEOF
6071 #line 6071 "configure"
6072 #include "confdefs.h"
6073
6074 #include <${cf_cv_ncurses_header:-curses.h}>
6075 #include <stdio.h>
6076 int main(void)
6077 {
6078         FILE *fp = fopen("$cf_tempfile", "w");
6079 #ifdef NCURSES_VERSION
6080 # ifdef NCURSES_VERSION_PATCH
6081         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6082 # else
6083         fprintf(fp, "%s\n", NCURSES_VERSION);
6084 # endif
6085 #else
6086 # ifdef __NCURSES_H
6087         fprintf(fp, "old\n");
6088 # else
6089         make an error
6090 # endif
6091 #endif
6092         ${cf_cv_main_return:-return}(0);
6093 }
6094 _ACEOF
6095 rm -f conftest$ac_exeext
6096 if { (eval echo "$as_me:6096: \"$ac_link\"") >&5
6097   (eval $ac_link) 2>&5
6098   ac_status=$?
6099   echo "$as_me:6099: \$? = $ac_status" >&5
6100   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6101   { (eval echo "$as_me:6101: \"$ac_try\"") >&5
6102   (eval $ac_try) 2>&5
6103   ac_status=$?
6104   echo "$as_me:6104: \$? = $ac_status" >&5
6105   (exit $ac_status); }; }; then
6106
6107         cf_cv_ncurses_version=`cat $cf_tempfile`
6108 else
6109   echo "$as_me: program exited with status $ac_status" >&5
6110 echo "$as_me: failed program was:" >&5
6111 cat conftest.$ac_ext >&5
6112 fi
6113 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6114 fi
6115         rm -f $cf_tempfile
6116
6117 fi
6118 echo "$as_me:6118: result: $cf_cv_ncurses_version" >&5
6119 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6120 test "$cf_cv_ncurses_version" = no ||
6121 cat >>confdefs.h <<\EOF
6122 #define NCURSES 1
6123 EOF
6124
6125 echo "$as_me:6125: checking if we have identified curses libraries" >&5
6126 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6127 cat >conftest.$ac_ext <<_ACEOF
6128 #line 6128 "configure"
6129 #include "confdefs.h"
6130 #include <${cf_cv_ncurses_header:-curses.h}>
6131 int
6132 main (void)
6133 {
6134 initscr(); tgoto("?", 0,0)
6135   ;
6136   return 0;
6137 }
6138 _ACEOF
6139 rm -f conftest.$ac_objext conftest$ac_exeext
6140 if { (eval echo "$as_me:6140: \"$ac_link\"") >&5
6141   (eval $ac_link) 2>&5
6142   ac_status=$?
6143   echo "$as_me:6143: \$? = $ac_status" >&5
6144   (exit $ac_status); } &&
6145          { ac_try='test -s conftest$ac_exeext'
6146   { (eval echo "$as_me:6146: \"$ac_try\"") >&5
6147   (eval $ac_try) 2>&5
6148   ac_status=$?
6149   echo "$as_me:6149: \$? = $ac_status" >&5
6150   (exit $ac_status); }; }; then
6151   cf_result=yes
6152 else
6153   echo "$as_me: failed program was:" >&5
6154 cat conftest.$ac_ext >&5
6155 cf_result=no
6156 fi
6157 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6158 echo "$as_me:6158: result: $cf_result" >&5
6159 echo "${ECHO_T}$cf_result" >&6
6160
6161 if test "$cf_result" = no ; then
6162 case $host_os in
6163 (freebsd*)
6164         echo "$as_me:6164: checking for tgoto in -lmytinfo" >&5
6165 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6166 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6167   echo $ECHO_N "(cached) $ECHO_C" >&6
6168 else
6169   ac_check_lib_save_LIBS=$LIBS
6170 LIBS="-lmytinfo  $LIBS"
6171 cat >conftest.$ac_ext <<_ACEOF
6172 #line 6172 "configure"
6173 #include "confdefs.h"
6174
6175 /* Override any gcc2 internal prototype to avoid an error.  */
6176 #ifdef __cplusplus
6177 extern "C"
6178 #endif
6179 /* We use char because int might match the return type of a gcc2
6180    builtin and then its argument prototype would still apply.  */
6181 char tgoto ();
6182 int
6183 main (void)
6184 {
6185 tgoto ();
6186   ;
6187   return 0;
6188 }
6189 _ACEOF
6190 rm -f conftest.$ac_objext conftest$ac_exeext
6191 if { (eval echo "$as_me:6191: \"$ac_link\"") >&5
6192   (eval $ac_link) 2>&5
6193   ac_status=$?
6194   echo "$as_me:6194: \$? = $ac_status" >&5
6195   (exit $ac_status); } &&
6196          { ac_try='test -s conftest$ac_exeext'
6197   { (eval echo "$as_me:6197: \"$ac_try\"") >&5
6198   (eval $ac_try) 2>&5
6199   ac_status=$?
6200   echo "$as_me:6200: \$? = $ac_status" >&5
6201   (exit $ac_status); }; }; then
6202   ac_cv_lib_mytinfo_tgoto=yes
6203 else
6204   echo "$as_me: failed program was:" >&5
6205 cat conftest.$ac_ext >&5
6206 ac_cv_lib_mytinfo_tgoto=no
6207 fi
6208 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6209 LIBS=$ac_check_lib_save_LIBS
6210 fi
6211 echo "$as_me:6211: result: $ac_cv_lib_mytinfo_tgoto" >&5
6212 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6213 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6214
6215 cf_add_libs="-lmytinfo"
6216 # Filter out duplicates - this happens with badly-designed ".pc" files...
6217 for cf_add_1lib in $LIBS
6218 do
6219         for cf_add_2lib in $cf_add_libs
6220         do
6221                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6222                 then
6223                         cf_add_1lib=
6224                         break
6225                 fi
6226         done
6227         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6228 done
6229 LIBS="$cf_add_libs"
6230
6231 fi
6232
6233         ;;
6234 (hpux10.*)
6235         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6236         # next (1998), and xcurses "newer" (2000).  There is no header file for
6237         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6238         # term.h) for cur_colr
6239         if test "x$cf_cv_screen" = "xcurses_colr"
6240         then
6241                 echo "$as_me:6241: checking for initscr in -lcur_colr" >&5
6242 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6243 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6244   echo $ECHO_N "(cached) $ECHO_C" >&6
6245 else
6246   ac_check_lib_save_LIBS=$LIBS
6247 LIBS="-lcur_colr  $LIBS"
6248 cat >conftest.$ac_ext <<_ACEOF
6249 #line 6249 "configure"
6250 #include "confdefs.h"
6251
6252 /* Override any gcc2 internal prototype to avoid an error.  */
6253 #ifdef __cplusplus
6254 extern "C"
6255 #endif
6256 /* We use char because int might match the return type of a gcc2
6257    builtin and then its argument prototype would still apply.  */
6258 char initscr ();
6259 int
6260 main (void)
6261 {
6262 initscr ();
6263   ;
6264   return 0;
6265 }
6266 _ACEOF
6267 rm -f conftest.$ac_objext conftest$ac_exeext
6268 if { (eval echo "$as_me:6268: \"$ac_link\"") >&5
6269   (eval $ac_link) 2>&5
6270   ac_status=$?
6271   echo "$as_me:6271: \$? = $ac_status" >&5
6272   (exit $ac_status); } &&
6273          { ac_try='test -s conftest$ac_exeext'
6274   { (eval echo "$as_me:6274: \"$ac_try\"") >&5
6275   (eval $ac_try) 2>&5
6276   ac_status=$?
6277   echo "$as_me:6277: \$? = $ac_status" >&5
6278   (exit $ac_status); }; }; then
6279   ac_cv_lib_cur_colr_initscr=yes
6280 else
6281   echo "$as_me: failed program was:" >&5
6282 cat conftest.$ac_ext >&5
6283 ac_cv_lib_cur_colr_initscr=no
6284 fi
6285 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6286 LIBS=$ac_check_lib_save_LIBS
6287 fi
6288 echo "$as_me:6288: result: $ac_cv_lib_cur_colr_initscr" >&5
6289 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6290 if test $ac_cv_lib_cur_colr_initscr = yes; then
6291
6292 cf_add_libs="-lcur_colr"
6293 # Filter out duplicates - this happens with badly-designed ".pc" files...
6294 for cf_add_1lib in $LIBS
6295 do
6296         for cf_add_2lib in $cf_add_libs
6297         do
6298                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6299                 then
6300                         cf_add_1lib=
6301                         break
6302                 fi
6303         done
6304         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6305 done
6306 LIBS="$cf_add_libs"
6307
6308                         ac_cv_func_initscr=yes
6309
6310 else
6311
6312                 echo "$as_me:6312: checking for initscr in -lHcurses" >&5
6313 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6314 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6315   echo $ECHO_N "(cached) $ECHO_C" >&6
6316 else
6317   ac_check_lib_save_LIBS=$LIBS
6318 LIBS="-lHcurses  $LIBS"
6319 cat >conftest.$ac_ext <<_ACEOF
6320 #line 6320 "configure"
6321 #include "confdefs.h"
6322
6323 /* Override any gcc2 internal prototype to avoid an error.  */
6324 #ifdef __cplusplus
6325 extern "C"
6326 #endif
6327 /* We use char because int might match the return type of a gcc2
6328    builtin and then its argument prototype would still apply.  */
6329 char initscr ();
6330 int
6331 main (void)
6332 {
6333 initscr ();
6334   ;
6335   return 0;
6336 }
6337 _ACEOF
6338 rm -f conftest.$ac_objext conftest$ac_exeext
6339 if { (eval echo "$as_me:6339: \"$ac_link\"") >&5
6340   (eval $ac_link) 2>&5
6341   ac_status=$?
6342   echo "$as_me:6342: \$? = $ac_status" >&5
6343   (exit $ac_status); } &&
6344          { ac_try='test -s conftest$ac_exeext'
6345   { (eval echo "$as_me:6345: \"$ac_try\"") >&5
6346   (eval $ac_try) 2>&5
6347   ac_status=$?
6348   echo "$as_me:6348: \$? = $ac_status" >&5
6349   (exit $ac_status); }; }; then
6350   ac_cv_lib_Hcurses_initscr=yes
6351 else
6352   echo "$as_me: failed program was:" >&5
6353 cat conftest.$ac_ext >&5
6354 ac_cv_lib_Hcurses_initscr=no
6355 fi
6356 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6357 LIBS=$ac_check_lib_save_LIBS
6358 fi
6359 echo "$as_me:6359: result: $ac_cv_lib_Hcurses_initscr" >&5
6360 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6361 if test $ac_cv_lib_Hcurses_initscr = yes; then
6362
6363                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6364
6365 cf_add_libs="-lHcurses"
6366 # Filter out duplicates - this happens with badly-designed ".pc" files...
6367 for cf_add_1lib in $LIBS
6368 do
6369         for cf_add_2lib in $cf_add_libs
6370         do
6371                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6372                 then
6373                         cf_add_1lib=
6374                         break
6375                 fi
6376         done
6377         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6378 done
6379 LIBS="$cf_add_libs"
6380
6381         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6382         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6383
6384                         ac_cv_func_initscr=yes
6385
6386 fi
6387
6388 fi
6389
6390         fi
6391         ;;
6392 (linux*)
6393         case `arch 2>/dev/null` in
6394         (x86_64)
6395                 if test -d /lib64
6396                 then
6397
6398 if test -n "/lib64" ; then
6399         for cf_add_libdir in /lib64
6400         do
6401                 if test $cf_add_libdir = /usr/lib ; then
6402                         :
6403                 elif test -d $cf_add_libdir
6404                 then
6405                         cf_have_libdir=no
6406                         if test -n "$LDFLAGS$LIBS" ; then
6407                                 # a loop is needed to ensure we can add subdirs of existing dirs
6408                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6409                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6410                                                 cf_have_libdir=yes; break
6411                                         fi
6412                                 done
6413                         fi
6414                         if test "$cf_have_libdir" = no ; then
6415                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6416
6417 echo "${as_me:-configure}:6417: testing adding $cf_add_libdir to library-path ..." 1>&5
6418
6419                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6420                         fi
6421                 fi
6422         done
6423 fi
6424
6425                 else
6426
6427 if test -n "/lib" ; then
6428         for cf_add_libdir in /lib
6429         do
6430                 if test $cf_add_libdir = /usr/lib ; then
6431                         :
6432                 elif test -d $cf_add_libdir
6433                 then
6434                         cf_have_libdir=no
6435                         if test -n "$LDFLAGS$LIBS" ; then
6436                                 # a loop is needed to ensure we can add subdirs of existing dirs
6437                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6438                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6439                                                 cf_have_libdir=yes; break
6440                                         fi
6441                                 done
6442                         fi
6443                         if test "$cf_have_libdir" = no ; then
6444                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6445
6446 echo "${as_me:-configure}:6446: testing adding $cf_add_libdir to library-path ..." 1>&5
6447
6448                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6449                         fi
6450                 fi
6451         done
6452 fi
6453
6454                 fi
6455                 ;;
6456         (*)
6457
6458 if test -n "/lib" ; then
6459         for cf_add_libdir in /lib
6460         do
6461                 if test $cf_add_libdir = /usr/lib ; then
6462                         :
6463                 elif test -d $cf_add_libdir
6464                 then
6465                         cf_have_libdir=no
6466                         if test -n "$LDFLAGS$LIBS" ; then
6467                                 # a loop is needed to ensure we can add subdirs of existing dirs
6468                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6469                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6470                                                 cf_have_libdir=yes; break
6471                                         fi
6472                                 done
6473                         fi
6474                         if test "$cf_have_libdir" = no ; then
6475                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6476
6477 echo "${as_me:-configure}:6477: testing adding $cf_add_libdir to library-path ..." 1>&5
6478
6479                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6480                         fi
6481                 fi
6482         done
6483 fi
6484
6485                 ;;
6486         esac
6487         ;;
6488 (sunos3*|sunos4*)
6489         if test "x$cf_cv_screen" = "xcurses_5lib"
6490         then
6491                 if test -d /usr/5lib ; then
6492
6493 if test -n "/usr/5lib" ; then
6494         for cf_add_libdir in /usr/5lib
6495         do
6496                 if test $cf_add_libdir = /usr/lib ; then
6497                         :
6498                 elif test -d $cf_add_libdir
6499                 then
6500                         cf_have_libdir=no
6501                         if test -n "$LDFLAGS$LIBS" ; then
6502                                 # a loop is needed to ensure we can add subdirs of existing dirs
6503                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6504                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6505                                                 cf_have_libdir=yes; break
6506                                         fi
6507                                 done
6508                         fi
6509                         if test "$cf_have_libdir" = no ; then
6510                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6511
6512 echo "${as_me:-configure}:6512: testing adding $cf_add_libdir to library-path ..." 1>&5
6513
6514                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6515                         fi
6516                 fi
6517         done
6518 fi
6519
6520 cf_add_libs="-lcurses -ltermcap"
6521 # Filter out duplicates - this happens with badly-designed ".pc" files...
6522 for cf_add_1lib in $LIBS
6523 do
6524         for cf_add_2lib in $cf_add_libs
6525         do
6526                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6527                 then
6528                         cf_add_1lib=
6529                         break
6530                 fi
6531         done
6532         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6533 done
6534 LIBS="$cf_add_libs"
6535
6536                 fi
6537         fi
6538         ac_cv_func_initscr=yes
6539         ;;
6540 esac
6541
6542 if test ".$ac_cv_func_initscr" != .yes ; then
6543         cf_save_LIBS="$LIBS"
6544
6545         if test ".${cf_cv_ncurses_version:-no}" != .no
6546         then
6547                 cf_check_list="ncurses curses cursesX"
6548         else
6549                 cf_check_list="cursesX curses ncurses"
6550         fi
6551
6552         # Check for library containing tgoto.  Do this before curses library
6553         # because it may be needed to link the test-case for initscr.
6554         if test "x$cf_term_lib" = x
6555         then
6556                 echo "$as_me:6556: checking for tgoto" >&5
6557 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6558 if test "${ac_cv_func_tgoto+set}" = set; then
6559   echo $ECHO_N "(cached) $ECHO_C" >&6
6560 else
6561   cat >conftest.$ac_ext <<_ACEOF
6562 #line 6562 "configure"
6563 #include "confdefs.h"
6564 #define tgoto autoconf_temporary
6565 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6566 #undef tgoto
6567
6568 #ifdef __cplusplus
6569 extern "C"
6570 #endif
6571
6572 /* We use char because int might match the return type of a gcc2
6573    builtin and then its argument prototype would still apply.  */
6574 char tgoto (void);
6575
6576 int
6577 main (void)
6578 {
6579
6580 /* The GNU C library defines stubs for functions which it implements
6581     to always fail with ENOSYS.  Some functions are actually named
6582     something starting with __ and the normal name is an alias.  */
6583 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6584 #error found stub for tgoto
6585 #endif
6586
6587         return tgoto ();
6588   ;
6589   return 0;
6590 }
6591 _ACEOF
6592 rm -f conftest.$ac_objext conftest$ac_exeext
6593 if { (eval echo "$as_me:6593: \"$ac_link\"") >&5
6594   (eval $ac_link) 2>&5
6595   ac_status=$?
6596   echo "$as_me:6596: \$? = $ac_status" >&5
6597   (exit $ac_status); } &&
6598          { ac_try='test -s conftest$ac_exeext'
6599   { (eval echo "$as_me:6599: \"$ac_try\"") >&5
6600   (eval $ac_try) 2>&5
6601   ac_status=$?
6602   echo "$as_me:6602: \$? = $ac_status" >&5
6603   (exit $ac_status); }; }; then
6604   ac_cv_func_tgoto=yes
6605 else
6606   echo "$as_me: failed program was:" >&5
6607 cat conftest.$ac_ext >&5
6608 ac_cv_func_tgoto=no
6609 fi
6610 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6611 fi
6612 echo "$as_me:6612: result: $ac_cv_func_tgoto" >&5
6613 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6614 if test $ac_cv_func_tgoto = yes; then
6615   cf_term_lib=predefined
6616 else
6617
6618                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6619                         do
6620                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6621 echo "$as_me:6621: checking for tgoto in -l$cf_term_lib" >&5
6622 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6623 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6624   echo $ECHO_N "(cached) $ECHO_C" >&6
6625 else
6626   ac_check_lib_save_LIBS=$LIBS
6627 LIBS="-l$cf_term_lib  $LIBS"
6628 cat >conftest.$ac_ext <<_ACEOF
6629 #line 6629 "configure"
6630 #include "confdefs.h"
6631
6632 /* Override any gcc2 internal prototype to avoid an error.  */
6633 #ifdef __cplusplus
6634 extern "C"
6635 #endif
6636 /* We use char because int might match the return type of a gcc2
6637    builtin and then its argument prototype would still apply.  */
6638 char tgoto ();
6639 int
6640 main (void)
6641 {
6642 tgoto ();
6643   ;
6644   return 0;
6645 }
6646 _ACEOF
6647 rm -f conftest.$ac_objext conftest$ac_exeext
6648 if { (eval echo "$as_me:6648: \"$ac_link\"") >&5
6649   (eval $ac_link) 2>&5
6650   ac_status=$?
6651   echo "$as_me:6651: \$? = $ac_status" >&5
6652   (exit $ac_status); } &&
6653          { ac_try='test -s conftest$ac_exeext'
6654   { (eval echo "$as_me:6654: \"$ac_try\"") >&5
6655   (eval $ac_try) 2>&5
6656   ac_status=$?
6657   echo "$as_me:6657: \$? = $ac_status" >&5
6658   (exit $ac_status); }; }; then
6659   eval "$as_ac_Lib=yes"
6660 else
6661   echo "$as_me: failed program was:" >&5
6662 cat conftest.$ac_ext >&5
6663 eval "$as_ac_Lib=no"
6664 fi
6665 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6666 LIBS=$ac_check_lib_save_LIBS
6667 fi
6668 echo "$as_me:6668: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6669 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6670 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6671
6672                                         : ${cf_nculib_root:=$cf_term_lib}
6673                                         break
6674
6675 fi
6676
6677                         done
6678
6679 fi
6680
6681         fi
6682
6683         # Check for library containing initscr
6684         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6685         if test "x$cf_curs_lib" = x
6686         then
6687                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6688                 do
6689                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6690                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6691                                 echo "$as_me:6691: checking if we can link with $cf_curs_lib library" >&5
6692 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6693                                 cat >conftest.$ac_ext <<_ACEOF
6694 #line 6694 "configure"
6695 #include "confdefs.h"
6696 #include <${cf_cv_ncurses_header:-curses.h}>
6697 int
6698 main (void)
6699 {
6700 initscr()
6701   ;
6702   return 0;
6703 }
6704 _ACEOF
6705 rm -f conftest.$ac_objext conftest$ac_exeext
6706 if { (eval echo "$as_me:6706: \"$ac_link\"") >&5
6707   (eval $ac_link) 2>&5
6708   ac_status=$?
6709   echo "$as_me:6709: \$? = $ac_status" >&5
6710   (exit $ac_status); } &&
6711          { ac_try='test -s conftest$ac_exeext'
6712   { (eval echo "$as_me:6712: \"$ac_try\"") >&5
6713   (eval $ac_try) 2>&5
6714   ac_status=$?
6715   echo "$as_me:6715: \$? = $ac_status" >&5
6716   (exit $ac_status); }; }; then
6717   cf_result=yes
6718 else
6719   echo "$as_me: failed program was:" >&5
6720 cat conftest.$ac_ext >&5
6721 cf_result=no
6722 fi
6723 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6724                                 echo "$as_me:6724: result: $cf_result" >&5
6725 echo "${ECHO_T}$cf_result" >&6
6726                                 test $cf_result = yes && break
6727                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6728                                 cf_result=no
6729                         elif test "$cf_term_lib" != predefined ; then
6730                                 echo "$as_me:6730: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6731 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6732                                 cat >conftest.$ac_ext <<_ACEOF
6733 #line 6733 "configure"
6734 #include "confdefs.h"
6735 #include <${cf_cv_ncurses_header:-curses.h}>
6736 int
6737 main (void)
6738 {
6739 initscr(); tgoto((char *)0, 0, 0);
6740   ;
6741   return 0;
6742 }
6743 _ACEOF
6744 rm -f conftest.$ac_objext conftest$ac_exeext
6745 if { (eval echo "$as_me:6745: \"$ac_link\"") >&5
6746   (eval $ac_link) 2>&5
6747   ac_status=$?
6748   echo "$as_me:6748: \$? = $ac_status" >&5
6749   (exit $ac_status); } &&
6750          { ac_try='test -s conftest$ac_exeext'
6751   { (eval echo "$as_me:6751: \"$ac_try\"") >&5
6752   (eval $ac_try) 2>&5
6753   ac_status=$?
6754   echo "$as_me:6754: \$? = $ac_status" >&5
6755   (exit $ac_status); }; }; then
6756   cf_result=no
6757 else
6758   echo "$as_me: failed program was:" >&5
6759 cat conftest.$ac_ext >&5
6760
6761                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6762                                         cat >conftest.$ac_ext <<_ACEOF
6763 #line 6763 "configure"
6764 #include "confdefs.h"
6765 #include <${cf_cv_ncurses_header:-curses.h}>
6766 int
6767 main (void)
6768 {
6769 initscr()
6770   ;
6771   return 0;
6772 }
6773 _ACEOF
6774 rm -f conftest.$ac_objext conftest$ac_exeext
6775 if { (eval echo "$as_me:6775: \"$ac_link\"") >&5
6776   (eval $ac_link) 2>&5
6777   ac_status=$?
6778   echo "$as_me:6778: \$? = $ac_status" >&5
6779   (exit $ac_status); } &&
6780          { ac_try='test -s conftest$ac_exeext'
6781   { (eval echo "$as_me:6781: \"$ac_try\"") >&5
6782   (eval $ac_try) 2>&5
6783   ac_status=$?
6784   echo "$as_me:6784: \$? = $ac_status" >&5
6785   (exit $ac_status); }; }; then
6786   cf_result=yes
6787 else
6788   echo "$as_me: failed program was:" >&5
6789 cat conftest.$ac_ext >&5
6790 cf_result=error
6791 fi
6792 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6793
6794 fi
6795 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6796                                 echo "$as_me:6796: result: $cf_result" >&5
6797 echo "${ECHO_T}$cf_result" >&6
6798                                 test $cf_result != error && break
6799                         fi
6800                 done
6801         fi
6802         test $cf_curs_lib = unknown && { { echo "$as_me:6802: error: no curses library found" >&5
6803 echo "$as_me: error: no curses library found" >&2;}
6804    { (exit 1); exit 1; }; }
6805 fi
6806 fi
6807
6808         ;;
6809 (ncursesw*)
6810
6811 echo "$as_me:6811: checking for multibyte character support" >&5
6812 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6813 if test "${cf_cv_utf8_lib+set}" = set; then
6814   echo $ECHO_N "(cached) $ECHO_C" >&6
6815 else
6816
6817         cf_save_LIBS="$LIBS"
6818         cat >conftest.$ac_ext <<_ACEOF
6819 #line 6819 "configure"
6820 #include "confdefs.h"
6821
6822 #include <stdlib.h>
6823 int
6824 main (void)
6825 {
6826 putwc(0,0);
6827   ;
6828   return 0;
6829 }
6830 _ACEOF
6831 rm -f conftest.$ac_objext conftest$ac_exeext
6832 if { (eval echo "$as_me:6832: \"$ac_link\"") >&5
6833   (eval $ac_link) 2>&5
6834   ac_status=$?
6835   echo "$as_me:6835: \$? = $ac_status" >&5
6836   (exit $ac_status); } &&
6837          { ac_try='test -s conftest$ac_exeext'
6838   { (eval echo "$as_me:6838: \"$ac_try\"") >&5
6839   (eval $ac_try) 2>&5
6840   ac_status=$?
6841   echo "$as_me:6841: \$? = $ac_status" >&5
6842   (exit $ac_status); }; }; then
6843   cf_cv_utf8_lib=yes
6844 else
6845   echo "$as_me: failed program was:" >&5
6846 cat conftest.$ac_ext >&5
6847
6848 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6849 # will be set on completion of the AC_TRY_LINK below.
6850 cf_cv_header_path_utf8=
6851 cf_cv_library_path_utf8=
6852
6853 echo "${as_me:-configure}:6853: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6854
6855 cf_save_LIBS="$LIBS"
6856
6857 cat >conftest.$ac_ext <<_ACEOF
6858 #line 6858 "configure"
6859 #include "confdefs.h"
6860
6861 #include <libutf8.h>
6862 int
6863 main (void)
6864 {
6865 putwc(0,0);
6866   ;
6867   return 0;
6868 }
6869 _ACEOF
6870 rm -f conftest.$ac_objext conftest$ac_exeext
6871 if { (eval echo "$as_me:6871: \"$ac_link\"") >&5
6872   (eval $ac_link) 2>&5
6873   ac_status=$?
6874   echo "$as_me:6874: \$? = $ac_status" >&5
6875   (exit $ac_status); } &&
6876          { ac_try='test -s conftest$ac_exeext'
6877   { (eval echo "$as_me:6877: \"$ac_try\"") >&5
6878   (eval $ac_try) 2>&5
6879   ac_status=$?
6880   echo "$as_me:6880: \$? = $ac_status" >&5
6881   (exit $ac_status); }; }; then
6882
6883         cf_cv_find_linkage_utf8=yes
6884         cf_cv_header_path_utf8=/usr/include
6885         cf_cv_library_path_utf8=/usr/lib
6886
6887 else
6888   echo "$as_me: failed program was:" >&5
6889 cat conftest.$ac_ext >&5
6890
6891 LIBS="-lutf8  $cf_save_LIBS"
6892
6893 cat >conftest.$ac_ext <<_ACEOF
6894 #line 6894 "configure"
6895 #include "confdefs.h"
6896
6897 #include <libutf8.h>
6898 int
6899 main (void)
6900 {
6901 putwc(0,0);
6902   ;
6903   return 0;
6904 }
6905 _ACEOF
6906 rm -f conftest.$ac_objext conftest$ac_exeext
6907 if { (eval echo "$as_me:6907: \"$ac_link\"") >&5
6908   (eval $ac_link) 2>&5
6909   ac_status=$?
6910   echo "$as_me:6910: \$? = $ac_status" >&5
6911   (exit $ac_status); } &&
6912          { ac_try='test -s conftest$ac_exeext'
6913   { (eval echo "$as_me:6913: \"$ac_try\"") >&5
6914   (eval $ac_try) 2>&5
6915   ac_status=$?
6916   echo "$as_me:6916: \$? = $ac_status" >&5
6917   (exit $ac_status); }; }; then
6918
6919         cf_cv_find_linkage_utf8=yes
6920         cf_cv_header_path_utf8=/usr/include
6921         cf_cv_library_path_utf8=/usr/lib
6922         cf_cv_library_file_utf8="-lutf8"
6923
6924 else
6925   echo "$as_me: failed program was:" >&5
6926 cat conftest.$ac_ext >&5
6927
6928         cf_cv_find_linkage_utf8=no
6929         LIBS="$cf_save_LIBS"
6930
6931         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6932
6933 echo "${as_me:-configure}:6933: testing find linkage for utf8 library ..." 1>&5
6934
6935 echo "${as_me:-configure}:6935: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6936
6937         cf_save_CPPFLAGS="$CPPFLAGS"
6938         cf_test_CPPFLAGS="$CPPFLAGS"
6939
6940 cf_search=
6941
6942 # collect the current set of include-directories from compiler flags
6943 cf_header_path_list=""
6944 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6945         for cf_header_path in $CPPFLAGS $CFLAGS
6946         do
6947                 case $cf_header_path in
6948                 (-I*)
6949                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6950
6951 test "x$cf_header_path" != "xNONE" && \
6952 test -d "$cf_header_path" && \
6953  {
6954         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6955         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6956         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6957         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6958         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6959         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6960 }
6961
6962                         cf_header_path_list="$cf_header_path_list $cf_search"
6963                         ;;
6964                 esac
6965         done
6966 fi
6967
6968 # add the variations for the package we are looking for
6969
6970 cf_search=
6971
6972 test "x$prefix" != "xNONE" && \
6973 test -d "$prefix" && \
6974  {
6975         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6976         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6977         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6978         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6979         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6980         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6981 }
6982
6983 for cf_subdir_prefix in \
6984         /usr \
6985         /usr/local \
6986         /usr/pkg \
6987         /opt \
6988         /opt/local \
6989         $HOME
6990 do
6991
6992 test "x$cf_subdir_prefix" != "x$prefix" && \
6993 test -d "$cf_subdir_prefix" && \
6994 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6995         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6996         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6997         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6998         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6999         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7000         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7001 }
7002
7003 done
7004
7005 test "$includedir" != NONE && \
7006 test "$includedir" != "/usr/include" && \
7007 test -d "$includedir" && {
7008         test -d $includedir &&    cf_search="$cf_search $includedir"
7009         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7010 }
7011
7012 test "$oldincludedir" != NONE && \
7013 test "$oldincludedir" != "/usr/include" && \
7014 test -d "$oldincludedir" && {
7015         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7016         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7017 }
7018
7019 cf_search="$cf_search $cf_header_path_list"
7020
7021         for cf_cv_header_path_utf8 in $cf_search
7022         do
7023                 if test -d $cf_cv_header_path_utf8 ; then
7024                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7025
7026 echo "${as_me:-configure}:7026: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7027
7028                         CPPFLAGS="$cf_save_CPPFLAGS"
7029
7030         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7031         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7032
7033                         cat >conftest.$ac_ext <<_ACEOF
7034 #line 7034 "configure"
7035 #include "confdefs.h"
7036
7037 #include <libutf8.h>
7038 int
7039 main (void)
7040 {
7041 putwc(0,0);
7042   ;
7043   return 0;
7044 }
7045 _ACEOF
7046 rm -f conftest.$ac_objext
7047 if { (eval echo "$as_me:7047: \"$ac_compile\"") >&5
7048   (eval $ac_compile) 2>&5
7049   ac_status=$?
7050   echo "$as_me:7050: \$? = $ac_status" >&5
7051   (exit $ac_status); } &&
7052          { ac_try='test -s conftest.$ac_objext'
7053   { (eval echo "$as_me:7053: \"$ac_try\"") >&5
7054   (eval $ac_try) 2>&5
7055   ac_status=$?
7056   echo "$as_me:7056: \$? = $ac_status" >&5
7057   (exit $ac_status); }; }; then
7058
7059                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7060
7061 echo "${as_me:-configure}:7061: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7062
7063                                 cf_cv_find_linkage_utf8=maybe
7064                                 cf_test_CPPFLAGS="$CPPFLAGS"
7065                                 break
7066 else
7067   echo "$as_me: failed program was:" >&5
7068 cat conftest.$ac_ext >&5
7069
7070                                 CPPFLAGS="$cf_save_CPPFLAGS"
7071
7072 fi
7073 rm -f conftest.$ac_objext conftest.$ac_ext
7074                 fi
7075         done
7076
7077         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7078
7079 echo "${as_me:-configure}:7079: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7080
7081                 cf_save_LIBS="$LIBS"
7082                 cf_save_LDFLAGS="$LDFLAGS"
7083
7084                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7085
7086 cf_search=
7087 cf_library_path_list=""
7088 if test -n "${LDFLAGS}${LIBS}" ; then
7089         for cf_library_path in $LDFLAGS $LIBS
7090         do
7091                 case $cf_library_path in
7092                 (-L*)
7093                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7094
7095 test "x$cf_library_path" != "xNONE" && \
7096 test -d "$cf_library_path" && \
7097  {
7098         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7099         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7100         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7101         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7102         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7103         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7104 }
7105
7106                         cf_library_path_list="$cf_library_path_list $cf_search"
7107                         ;;
7108                 esac
7109         done
7110 fi
7111
7112 cf_search=
7113
7114 test "x$prefix" != "xNONE" && \
7115 test -d "$prefix" && \
7116  {
7117         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7118         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7119         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7120         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7121         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7122         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7123 }
7124
7125 for cf_subdir_prefix in \
7126         /usr \
7127         /usr/local \
7128         /usr/pkg \
7129         /opt \
7130         /opt/local \
7131         $HOME
7132 do
7133
7134 test "x$cf_subdir_prefix" != "x$prefix" && \
7135 test -d "$cf_subdir_prefix" && \
7136 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7137         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7138         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7139         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7140         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7141         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7142         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7143 }
7144
7145 done
7146
7147 cf_search="$cf_library_path_list $cf_search"
7148
7149                         for cf_cv_library_path_utf8 in $cf_search
7150                         do
7151                                 if test -d $cf_cv_library_path_utf8 ; then
7152                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7153
7154 echo "${as_me:-configure}:7154: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7155
7156                                         CPPFLAGS="$cf_test_CPPFLAGS"
7157                                         LIBS="-lutf8  $cf_save_LIBS"
7158                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7159                                         cat >conftest.$ac_ext <<_ACEOF
7160 #line 7160 "configure"
7161 #include "confdefs.h"
7162
7163 #include <libutf8.h>
7164 int
7165 main (void)
7166 {
7167 putwc(0,0);
7168   ;
7169   return 0;
7170 }
7171 _ACEOF
7172 rm -f conftest.$ac_objext conftest$ac_exeext
7173 if { (eval echo "$as_me:7173: \"$ac_link\"") >&5
7174   (eval $ac_link) 2>&5
7175   ac_status=$?
7176   echo "$as_me:7176: \$? = $ac_status" >&5
7177   (exit $ac_status); } &&
7178          { ac_try='test -s conftest$ac_exeext'
7179   { (eval echo "$as_me:7179: \"$ac_try\"") >&5
7180   (eval $ac_try) 2>&5
7181   ac_status=$?
7182   echo "$as_me:7182: \$? = $ac_status" >&5
7183   (exit $ac_status); }; }; then
7184
7185                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7186
7187 echo "${as_me:-configure}:7187: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7188
7189                                         cf_cv_find_linkage_utf8=yes
7190                                         cf_cv_library_file_utf8="-lutf8"
7191                                         break
7192 else
7193   echo "$as_me: failed program was:" >&5
7194 cat conftest.$ac_ext >&5
7195
7196                                         CPPFLAGS="$cf_save_CPPFLAGS"
7197                                         LIBS="$cf_save_LIBS"
7198                                         LDFLAGS="$cf_save_LDFLAGS"
7199
7200 fi
7201 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7202                                 fi
7203                         done
7204                         CPPFLAGS="$cf_save_CPPFLAGS"
7205                         LDFLAGS="$cf_save_LDFLAGS"
7206                 fi
7207
7208         else
7209                 cf_cv_find_linkage_utf8=no
7210         fi
7211
7212 fi
7213 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7214
7215 fi
7216 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7217
7218 LIBS="$cf_save_LIBS"
7219
7220 if test "$cf_cv_find_linkage_utf8" = yes ; then
7221 cf_cv_utf8_lib=add-on
7222 else
7223 cf_cv_utf8_lib=no
7224 fi
7225
7226 fi
7227 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7228 fi
7229 echo "$as_me:7229: result: $cf_cv_utf8_lib" >&5
7230 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7231
7232 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7233 # ncurses/ncursesw:
7234 if test "$cf_cv_utf8_lib" = "add-on" ; then
7235
7236 cat >>confdefs.h <<\EOF
7237 #define HAVE_LIBUTF8_H 1
7238 EOF
7239
7240 if test -n "$cf_cv_header_path_utf8" ; then
7241   for cf_add_incdir in $cf_cv_header_path_utf8
7242   do
7243         while test $cf_add_incdir != /usr/include
7244         do
7245           if test -d $cf_add_incdir
7246           then
7247                 cf_have_incdir=no
7248                 if test -n "$CFLAGS$CPPFLAGS" ; then
7249                   # a loop is needed to ensure we can add subdirs of existing dirs
7250                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7251                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7252                           cf_have_incdir=yes; break
7253                         fi
7254                   done
7255                 fi
7256
7257                 if test "$cf_have_incdir" = no ; then
7258                   if test "$cf_add_incdir" = /usr/local/include ; then
7259                         if test "$GCC" = yes
7260                         then
7261                           cf_save_CPPFLAGS=$CPPFLAGS
7262
7263         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7264         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7265
7266                           cat >conftest.$ac_ext <<_ACEOF
7267 #line 7267 "configure"
7268 #include "confdefs.h"
7269 #include <stdio.h>
7270 int
7271 main (void)
7272 {
7273 printf("Hello")
7274   ;
7275   return 0;
7276 }
7277 _ACEOF
7278 rm -f conftest.$ac_objext
7279 if { (eval echo "$as_me:7279: \"$ac_compile\"") >&5
7280   (eval $ac_compile) 2>&5
7281   ac_status=$?
7282   echo "$as_me:7282: \$? = $ac_status" >&5
7283   (exit $ac_status); } &&
7284          { ac_try='test -s conftest.$ac_objext'
7285   { (eval echo "$as_me:7285: \"$ac_try\"") >&5
7286   (eval $ac_try) 2>&5
7287   ac_status=$?
7288   echo "$as_me:7288: \$? = $ac_status" >&5
7289   (exit $ac_status); }; }; then
7290   :
7291 else
7292   echo "$as_me: failed program was:" >&5
7293 cat conftest.$ac_ext >&5
7294 cf_have_incdir=yes
7295 fi
7296 rm -f conftest.$ac_objext conftest.$ac_ext
7297                           CPPFLAGS=$cf_save_CPPFLAGS
7298                         fi
7299                   fi
7300                 fi
7301
7302                 if test "$cf_have_incdir" = no ; then
7303                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7304
7305 echo "${as_me:-configure}:7305: testing adding $cf_add_incdir to include-path ..." 1>&5
7306
7307                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7308
7309                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7310                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7311                   cf_add_incdir="$cf_top_incdir"
7312                 else
7313                   break
7314                 fi
7315           else
7316                 break
7317           fi
7318         done
7319   done
7320 fi
7321
7322 if test -n "$cf_cv_library_path_utf8" ; then
7323         for cf_add_libdir in $cf_cv_library_path_utf8
7324         do
7325                 if test $cf_add_libdir = /usr/lib ; then
7326                         :
7327                 elif test -d $cf_add_libdir
7328                 then
7329                         cf_have_libdir=no
7330                         if test -n "$LDFLAGS$LIBS" ; then
7331                                 # a loop is needed to ensure we can add subdirs of existing dirs
7332                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7333                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7334                                                 cf_have_libdir=yes; break
7335                                         fi
7336                                 done
7337                         fi
7338                         if test "$cf_have_libdir" = no ; then
7339                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7340
7341 echo "${as_me:-configure}:7341: testing adding $cf_add_libdir to library-path ..." 1>&5
7342
7343                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7344                         fi
7345                 fi
7346         done
7347 fi
7348
7349 cf_add_libs="$cf_cv_library_file_utf8"
7350 # Filter out duplicates - this happens with badly-designed ".pc" files...
7351 for cf_add_1lib in $LIBS
7352 do
7353         for cf_add_2lib in $cf_add_libs
7354         do
7355                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7356                 then
7357                         cf_add_1lib=
7358                         break
7359                 fi
7360         done
7361         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7362 done
7363 LIBS="$cf_add_libs"
7364
7365 fi
7366
7367 cf_ncuconfig_root=$cf_cv_screen
7368 cf_have_ncuconfig=no
7369
7370 if test "x${PKG_CONFIG:=none}" != xnone; then
7371         echo "$as_me:7371: checking pkg-config for $cf_ncuconfig_root" >&5
7372 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7373         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7374                 echo "$as_me:7374: result: yes" >&5
7375 echo "${ECHO_T}yes" >&6
7376
7377                 echo "$as_me:7377: checking if the $cf_ncuconfig_root package files work" >&5
7378 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7379                 cf_have_ncuconfig=unknown
7380
7381                 cf_save_CPPFLAGS="$CPPFLAGS"
7382                 cf_save_LIBS="$LIBS"
7383
7384 cf_fix_cppflags=no
7385 cf_new_cflags=
7386 cf_new_cppflags=
7387 cf_new_extra_cppflags=
7388
7389 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
7390 do
7391 case $cf_fix_cppflags in
7392 (no)
7393         case $cf_add_cflags in
7394         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7395                 case $cf_add_cflags in
7396                 (-D*)
7397                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7398
7399                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7400                                 && test -z "${cf_tst_cflags}" \
7401                                 && cf_fix_cppflags=yes
7402
7403                         if test $cf_fix_cppflags = yes ; then
7404
7405         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7406         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7407
7408                                 continue
7409                         elif test "${cf_tst_cflags}" = "\"'" ; then
7410
7411         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7412         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7413
7414                                 continue
7415                         fi
7416                         ;;
7417                 esac
7418                 case "$CPPFLAGS" in
7419                 (*$cf_add_cflags)
7420                         ;;
7421                 (*)
7422                         case $cf_add_cflags in
7423                         (-D*)
7424                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7425
7426 CPPFLAGS=`echo "$CPPFLAGS" | \
7427         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7428                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7429
7430                                 ;;
7431                         esac
7432
7433         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7434         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7435
7436                         ;;
7437                 esac
7438                 ;;
7439         (*)
7440
7441         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7442         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7443
7444                 ;;
7445         esac
7446         ;;
7447 (yes)
7448
7449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7451
7452         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7453
7454         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7455                 && test -z "${cf_tst_cflags}" \
7456                 && cf_fix_cppflags=no
7457         ;;
7458 esac
7459 done
7460
7461 if test -n "$cf_new_cflags" ; then
7462
7463         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7464         CFLAGS="${CFLAGS}$cf_new_cflags"
7465
7466 fi
7467
7468 if test -n "$cf_new_cppflags" ; then
7469
7470         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7471         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7472
7473 fi
7474
7475 if test -n "$cf_new_extra_cppflags" ; then
7476
7477         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7478         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7479
7480 fi
7481
7482 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7483 # Filter out duplicates - this happens with badly-designed ".pc" files...
7484 for cf_add_1lib in $LIBS
7485 do
7486         for cf_add_2lib in $cf_add_libs
7487         do
7488                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7489                 then
7490                         cf_add_1lib=
7491                         break
7492                 fi
7493         done
7494         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7495 done
7496 LIBS="$cf_add_libs"
7497
7498                 cat >conftest.$ac_ext <<_ACEOF
7499 #line 7499 "configure"
7500 #include "confdefs.h"
7501 #include <${cf_cv_ncurses_header:-curses.h}>
7502 int
7503 main (void)
7504 {
7505 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7506   ;
7507   return 0;
7508 }
7509 _ACEOF
7510 rm -f conftest.$ac_objext conftest$ac_exeext
7511 if { (eval echo "$as_me:7511: \"$ac_link\"") >&5
7512   (eval $ac_link) 2>&5
7513   ac_status=$?
7514   echo "$as_me:7514: \$? = $ac_status" >&5
7515   (exit $ac_status); } &&
7516          { ac_try='test -s conftest$ac_exeext'
7517   { (eval echo "$as_me:7517: \"$ac_try\"") >&5
7518   (eval $ac_try) 2>&5
7519   ac_status=$?
7520   echo "$as_me:7520: \$? = $ac_status" >&5
7521   (exit $ac_status); }; }; then
7522   if test "$cross_compiling" = yes; then
7523   cf_have_ncuconfig=maybe
7524 else
7525   cat >conftest.$ac_ext <<_ACEOF
7526 #line 7526 "configure"
7527 #include "confdefs.h"
7528 #include <${cf_cv_ncurses_header:-curses.h}>
7529                                 int main(void)
7530                                 { char *xx = curses_version(); return (xx == 0); }
7531 _ACEOF
7532 rm -f conftest$ac_exeext
7533 if { (eval echo "$as_me:7533: \"$ac_link\"") >&5
7534   (eval $ac_link) 2>&5
7535   ac_status=$?
7536   echo "$as_me:7536: \$? = $ac_status" >&5
7537   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7538   { (eval echo "$as_me:7538: \"$ac_try\"") >&5
7539   (eval $ac_try) 2>&5
7540   ac_status=$?
7541   echo "$as_me:7541: \$? = $ac_status" >&5
7542   (exit $ac_status); }; }; then
7543   cf_have_ncuconfig=yes
7544 else
7545   echo "$as_me: program exited with status $ac_status" >&5
7546 echo "$as_me: failed program was:" >&5
7547 cat conftest.$ac_ext >&5
7548 cf_have_ncuconfig=no
7549 fi
7550 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7551 fi
7552 else
7553   echo "$as_me: failed program was:" >&5
7554 cat conftest.$ac_ext >&5
7555 cf_have_ncuconfig=no
7556 fi
7557 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7558                 echo "$as_me:7558: result: $cf_have_ncuconfig" >&5
7559 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7560                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7561                 if test "$cf_have_ncuconfig" != "yes"
7562                 then
7563                         CPPFLAGS="$cf_save_CPPFLAGS"
7564                         LIBS="$cf_save_LIBS"
7565                         NCURSES_CONFIG_PKG=none
7566                 else
7567
7568 cat >>confdefs.h <<\EOF
7569 #define NCURSES 1
7570 EOF
7571
7572                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7573
7574 echo "$as_me:7574: checking for terminfo header" >&5
7575 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7576 if test "${cf_cv_term_header+set}" = set; then
7577   echo $ECHO_N "(cached) $ECHO_C" >&6
7578 else
7579
7580 case ${cf_cv_ncurses_header} in
7581 (*/ncurses.h|*/ncursesw.h)
7582         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7583         ;;
7584 (*)
7585         cf_term_header=term.h
7586         ;;
7587 esac
7588
7589 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7590 do
7591 cat >conftest.$ac_ext <<_ACEOF
7592 #line 7592 "configure"
7593 #include "confdefs.h"
7594 #include <stdio.h>
7595 #include <${cf_cv_ncurses_header:-curses.h}>
7596 #include <$cf_test>
7597
7598 int
7599 main (void)
7600 {
7601 int x = auto_left_margin
7602   ;
7603   return 0;
7604 }
7605 _ACEOF
7606 rm -f conftest.$ac_objext
7607 if { (eval echo "$as_me:7607: \"$ac_compile\"") >&5
7608   (eval $ac_compile) 2>&5
7609   ac_status=$?
7610   echo "$as_me:7610: \$? = $ac_status" >&5
7611   (exit $ac_status); } &&
7612          { ac_try='test -s conftest.$ac_objext'
7613   { (eval echo "$as_me:7613: \"$ac_try\"") >&5
7614   (eval $ac_try) 2>&5
7615   ac_status=$?
7616   echo "$as_me:7616: \$? = $ac_status" >&5
7617   (exit $ac_status); }; }; then
7618
7619         cf_cv_term_header="$cf_test"
7620 else
7621   echo "$as_me: failed program was:" >&5
7622 cat conftest.$ac_ext >&5
7623
7624         cf_cv_term_header=unknown
7625
7626 fi
7627 rm -f conftest.$ac_objext conftest.$ac_ext
7628         test "$cf_cv_term_header" != unknown && break
7629 done
7630
7631 fi
7632 echo "$as_me:7632: result: $cf_cv_term_header" >&5
7633 echo "${ECHO_T}$cf_cv_term_header" >&6
7634
7635 # Set definitions to allow ifdef'ing to accommodate subdirectories
7636
7637 case $cf_cv_term_header in
7638 (*term.h)
7639
7640 cat >>confdefs.h <<\EOF
7641 #define HAVE_TERM_H 1
7642 EOF
7643
7644         ;;
7645 esac
7646
7647 case $cf_cv_term_header in
7648 (ncurses/term.h)
7649
7650 cat >>confdefs.h <<\EOF
7651 #define HAVE_NCURSES_TERM_H 1
7652 EOF
7653
7654         ;;
7655 (ncursesw/term.h)
7656
7657 cat >>confdefs.h <<\EOF
7658 #define HAVE_NCURSESW_TERM_H 1
7659 EOF
7660
7661         ;;
7662 esac
7663
7664                 fi
7665
7666         else
7667                 echo "$as_me:7667: result: no" >&5
7668 echo "${ECHO_T}no" >&6
7669                 NCURSES_CONFIG_PKG=none
7670         fi
7671 else
7672         NCURSES_CONFIG_PKG=none
7673 fi
7674
7675 if test "x$cf_have_ncuconfig" = "xno"; then
7676         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7677
7678 if test -n "$ac_tool_prefix"; then
7679   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7680   do
7681     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7682 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7683 echo "$as_me:7683: checking for $ac_word" >&5
7684 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7685 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7686   echo $ECHO_N "(cached) $ECHO_C" >&6
7687 else
7688   if test -n "$NCURSES_CONFIG"; then
7689   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7690 else
7691   ac_save_IFS=$IFS; IFS=$ac_path_separator
7692 ac_dummy="$PATH"
7693 for ac_dir in $ac_dummy; do
7694   IFS=$ac_save_IFS
7695   test -z "$ac_dir" && ac_dir=.
7696   $as_executable_p "$ac_dir/$ac_word" || continue
7697 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7698 echo "$as_me:7698: found $ac_dir/$ac_word" >&5
7699 break
7700 done
7701
7702 fi
7703 fi
7704 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7705 if test -n "$NCURSES_CONFIG"; then
7706   echo "$as_me:7706: result: $NCURSES_CONFIG" >&5
7707 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7708 else
7709   echo "$as_me:7709: result: no" >&5
7710 echo "${ECHO_T}no" >&6
7711 fi
7712
7713     test -n "$NCURSES_CONFIG" && break
7714   done
7715 fi
7716 if test -z "$NCURSES_CONFIG"; then
7717   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7718   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7719 do
7720   # Extract the first word of "$ac_prog", so it can be a program name with args.
7721 set dummy $ac_prog; ac_word=$2
7722 echo "$as_me:7722: checking for $ac_word" >&5
7723 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7724 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7725   echo $ECHO_N "(cached) $ECHO_C" >&6
7726 else
7727   if test -n "$ac_ct_NCURSES_CONFIG"; then
7728   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7729 else
7730   ac_save_IFS=$IFS; IFS=$ac_path_separator
7731 ac_dummy="$PATH"
7732 for ac_dir in $ac_dummy; do
7733   IFS=$ac_save_IFS
7734   test -z "$ac_dir" && ac_dir=.
7735   $as_executable_p "$ac_dir/$ac_word" || continue
7736 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7737 echo "$as_me:7737: found $ac_dir/$ac_word" >&5
7738 break
7739 done
7740
7741 fi
7742 fi
7743 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7744 if test -n "$ac_ct_NCURSES_CONFIG"; then
7745   echo "$as_me:7745: result: $ac_ct_NCURSES_CONFIG" >&5
7746 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7747 else
7748   echo "$as_me:7748: result: no" >&5
7749 echo "${ECHO_T}no" >&6
7750 fi
7751
7752   test -n "$ac_ct_NCURSES_CONFIG" && break
7753 done
7754 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7755
7756   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7757 fi
7758
7759         if test "$NCURSES_CONFIG" != none ; then
7760
7761 cf_fix_cppflags=no
7762 cf_new_cflags=
7763 cf_new_cppflags=
7764 cf_new_extra_cppflags=
7765
7766 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7767 do
7768 case $cf_fix_cppflags in
7769 (no)
7770         case $cf_add_cflags in
7771         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7772                 case $cf_add_cflags in
7773                 (-D*)
7774                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7775
7776                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7777                                 && test -z "${cf_tst_cflags}" \
7778                                 && cf_fix_cppflags=yes
7779
7780                         if test $cf_fix_cppflags = yes ; then
7781
7782         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7783         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7784
7785                                 continue
7786                         elif test "${cf_tst_cflags}" = "\"'" ; then
7787
7788         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7789         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7790
7791                                 continue
7792                         fi
7793                         ;;
7794                 esac
7795                 case "$CPPFLAGS" in
7796                 (*$cf_add_cflags)
7797                         ;;
7798                 (*)
7799                         case $cf_add_cflags in
7800                         (-D*)
7801                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7802
7803 CPPFLAGS=`echo "$CPPFLAGS" | \
7804         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7805                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7806
7807                                 ;;
7808                         esac
7809
7810         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7811         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7812
7813                         ;;
7814                 esac
7815                 ;;
7816         (*)
7817
7818         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7819         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7820
7821                 ;;
7822         esac
7823         ;;
7824 (yes)
7825
7826         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7827         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7828
7829         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7830
7831         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7832                 && test -z "${cf_tst_cflags}" \
7833                 && cf_fix_cppflags=no
7834         ;;
7835 esac
7836 done
7837
7838 if test -n "$cf_new_cflags" ; then
7839
7840         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7841         CFLAGS="${CFLAGS}$cf_new_cflags"
7842
7843 fi
7844
7845 if test -n "$cf_new_cppflags" ; then
7846
7847         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7848         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7849
7850 fi
7851
7852 if test -n "$cf_new_extra_cppflags" ; then
7853
7854         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7855         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7856
7857 fi
7858
7859 cf_add_libs="`$NCURSES_CONFIG --libs`"
7860 # Filter out duplicates - this happens with badly-designed ".pc" files...
7861 for cf_add_1lib in $LIBS
7862 do
7863         for cf_add_2lib in $cf_add_libs
7864         do
7865                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7866                 then
7867                         cf_add_1lib=
7868                         break
7869                 fi
7870         done
7871         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7872 done
7873 LIBS="$cf_add_libs"
7874
7875                 # even with config script, some packages use no-override for curses.h
7876
7877 echo "$as_me:7877: checking if we have identified curses headers" >&5
7878 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7879 if test "${cf_cv_ncurses_header+set}" = set; then
7880   echo $ECHO_N "(cached) $ECHO_C" >&6
7881 else
7882
7883 cf_cv_ncurses_header=none
7884 for cf_header in \
7885         ncurses.h $cf_cv_screen/ncurses.h \
7886         curses.h $cf_cv_screen/curses.h
7887 do
7888 cat >conftest.$ac_ext <<_ACEOF
7889 #line 7889 "configure"
7890 #include "confdefs.h"
7891 #include <${cf_header}>
7892 int
7893 main (void)
7894 {
7895 initscr(); tgoto("?", 0,0)
7896   ;
7897   return 0;
7898 }
7899 _ACEOF
7900 rm -f conftest.$ac_objext
7901 if { (eval echo "$as_me:7901: \"$ac_compile\"") >&5
7902   (eval $ac_compile) 2>&5
7903   ac_status=$?
7904   echo "$as_me:7904: \$? = $ac_status" >&5
7905   (exit $ac_status); } &&
7906          { ac_try='test -s conftest.$ac_objext'
7907   { (eval echo "$as_me:7907: \"$ac_try\"") >&5
7908   (eval $ac_try) 2>&5
7909   ac_status=$?
7910   echo "$as_me:7910: \$? = $ac_status" >&5
7911   (exit $ac_status); }; }; then
7912   cf_cv_ncurses_header=$cf_header; break
7913 else
7914   echo "$as_me: failed program was:" >&5
7915 cat conftest.$ac_ext >&5
7916 fi
7917 rm -f conftest.$ac_objext conftest.$ac_ext
7918 done
7919
7920 fi
7921 echo "$as_me:7921: result: $cf_cv_ncurses_header" >&5
7922 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7923
7924 if test "$cf_cv_ncurses_header" = none ; then
7925         { { echo "$as_me:7925: error: No curses header-files found" >&5
7926 echo "$as_me: error: No curses header-files found" >&2;}
7927    { (exit 1); exit 1; }; }
7928 fi
7929
7930 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7931
7932 for ac_header in $cf_cv_ncurses_header
7933 do
7934 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7935 echo "$as_me:7935: checking for $ac_header" >&5
7936 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7937 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7938   echo $ECHO_N "(cached) $ECHO_C" >&6
7939 else
7940   cat >conftest.$ac_ext <<_ACEOF
7941 #line 7941 "configure"
7942 #include "confdefs.h"
7943 #include <$ac_header>
7944 _ACEOF
7945 if { (eval echo "$as_me:7945: \"$ac_cpp conftest.$ac_ext\"") >&5
7946   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7947   ac_status=$?
7948   egrep -v '^ *\+' conftest.er1 >conftest.err
7949   rm -f conftest.er1
7950   cat conftest.err >&5
7951   echo "$as_me:7951: \$? = $ac_status" >&5
7952   (exit $ac_status); } >/dev/null; then
7953   if test -s conftest.err; then
7954     ac_cpp_err=$ac_c_preproc_warn_flag
7955   else
7956     ac_cpp_err=
7957   fi
7958 else
7959   ac_cpp_err=yes
7960 fi
7961 if test -z "$ac_cpp_err"; then
7962   eval "$as_ac_Header=yes"
7963 else
7964   echo "$as_me: failed program was:" >&5
7965   cat conftest.$ac_ext >&5
7966   eval "$as_ac_Header=no"
7967 fi
7968 rm -f conftest.err conftest.$ac_ext
7969 fi
7970 echo "$as_me:7970: result: `eval echo '${'$as_ac_Header'}'`" >&5
7971 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7972 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7973   cat >>confdefs.h <<EOF
7974 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7975 EOF
7976
7977 fi
7978 done
7979
7980 cat >>confdefs.h <<\EOF
7981 #define NCURSES 1
7982 EOF
7983
7984 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7985
7986                 cat >>confdefs.h <<EOF
7987 #define $cf_nculib_ROOT 1
7988 EOF
7989
7990                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7991
7992         else
7993
7994 cf_ncuhdr_root=$cf_cv_screen
7995
7996 test -n "$cf_cv_curses_dir" && \
7997 test "$cf_cv_curses_dir" != "no" && { \
7998
7999 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8000   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8001   do
8002         while test $cf_add_incdir != /usr/include
8003         do
8004           if test -d $cf_add_incdir
8005           then
8006                 cf_have_incdir=no
8007                 if test -n "$CFLAGS$CPPFLAGS" ; then
8008                   # a loop is needed to ensure we can add subdirs of existing dirs
8009                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8010                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8011                           cf_have_incdir=yes; break
8012                         fi
8013                   done
8014                 fi
8015
8016                 if test "$cf_have_incdir" = no ; then
8017                   if test "$cf_add_incdir" = /usr/local/include ; then
8018                         if test "$GCC" = yes
8019                         then
8020                           cf_save_CPPFLAGS=$CPPFLAGS
8021
8022         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8023         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8024
8025                           cat >conftest.$ac_ext <<_ACEOF
8026 #line 8026 "configure"
8027 #include "confdefs.h"
8028 #include <stdio.h>
8029 int
8030 main (void)
8031 {
8032 printf("Hello")
8033   ;
8034   return 0;
8035 }
8036 _ACEOF
8037 rm -f conftest.$ac_objext
8038 if { (eval echo "$as_me:8038: \"$ac_compile\"") >&5
8039   (eval $ac_compile) 2>&5
8040   ac_status=$?
8041   echo "$as_me:8041: \$? = $ac_status" >&5
8042   (exit $ac_status); } &&
8043          { ac_try='test -s conftest.$ac_objext'
8044   { (eval echo "$as_me:8044: \"$ac_try\"") >&5
8045   (eval $ac_try) 2>&5
8046   ac_status=$?
8047   echo "$as_me:8047: \$? = $ac_status" >&5
8048   (exit $ac_status); }; }; then
8049   :
8050 else
8051   echo "$as_me: failed program was:" >&5
8052 cat conftest.$ac_ext >&5
8053 cf_have_incdir=yes
8054 fi
8055 rm -f conftest.$ac_objext conftest.$ac_ext
8056                           CPPFLAGS=$cf_save_CPPFLAGS
8057                         fi
8058                   fi
8059                 fi
8060
8061                 if test "$cf_have_incdir" = no ; then
8062                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8063
8064 echo "${as_me:-configure}:8064: testing adding $cf_add_incdir to include-path ..." 1>&5
8065
8066                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8067
8068                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8069                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8070                   cf_add_incdir="$cf_top_incdir"
8071                 else
8072                   break
8073                 fi
8074           else
8075                 break
8076           fi
8077         done
8078   done
8079 fi
8080
8081 }
8082
8083 echo "$as_me:8083: checking for $cf_ncuhdr_root header in include-path" >&5
8084 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8085 if test "${cf_cv_ncurses_h+set}" = set; then
8086   echo $ECHO_N "(cached) $ECHO_C" >&6
8087 else
8088
8089         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8090         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8091         for cf_header in $cf_header_list
8092         do
8093
8094         cat >conftest.$ac_ext <<_ACEOF
8095 #line 8095 "configure"
8096 #include "confdefs.h"
8097
8098 #include <$cf_header>
8099 int
8100 main (void)
8101 {
8102
8103 #ifdef NCURSES_VERSION
8104
8105 printf("%s\n", NCURSES_VERSION);
8106 #else
8107 #ifdef __NCURSES_H
8108 printf("old\n");
8109 #else
8110         make an error
8111 #endif
8112 #endif
8113
8114   ;
8115   return 0;
8116 }
8117 _ACEOF
8118 rm -f conftest.$ac_objext
8119 if { (eval echo "$as_me:8119: \"$ac_compile\"") >&5
8120   (eval $ac_compile) 2>&5
8121   ac_status=$?
8122   echo "$as_me:8122: \$? = $ac_status" >&5
8123   (exit $ac_status); } &&
8124          { ac_try='test -s conftest.$ac_objext'
8125   { (eval echo "$as_me:8125: \"$ac_try\"") >&5
8126   (eval $ac_try) 2>&5
8127   ac_status=$?
8128   echo "$as_me:8128: \$? = $ac_status" >&5
8129   (exit $ac_status); }; }; then
8130   cf_cv_ncurses_h=$cf_header
8131
8132 else
8133   echo "$as_me: failed program was:" >&5
8134 cat conftest.$ac_ext >&5
8135 cf_cv_ncurses_h=no
8136 fi
8137 rm -f conftest.$ac_objext conftest.$ac_ext
8138
8139                 test "$cf_cv_ncurses_h" != no && break
8140         done
8141
8142 fi
8143 echo "$as_me:8143: result: $cf_cv_ncurses_h" >&5
8144 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8145
8146 if test "$cf_cv_ncurses_h" != no ; then
8147         cf_cv_ncurses_header=$cf_cv_ncurses_h
8148 else
8149
8150 echo "$as_me:8150: checking for $cf_ncuhdr_root include-path" >&5
8151 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8152 if test "${cf_cv_ncurses_h2+set}" = set; then
8153   echo $ECHO_N "(cached) $ECHO_C" >&6
8154 else
8155
8156         test -n "$verbose" && echo
8157
8158 cf_search=
8159
8160 # collect the current set of include-directories from compiler flags
8161 cf_header_path_list=""
8162 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8163         for cf_header_path in $CPPFLAGS $CFLAGS
8164         do
8165                 case $cf_header_path in
8166                 (-I*)
8167                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8168
8169 test "x$cf_header_path" != "xNONE" && \
8170 test -d "$cf_header_path" && \
8171  {
8172         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8173         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8174         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8175         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8176         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8177         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"
8178 }
8179
8180                         cf_header_path_list="$cf_header_path_list $cf_search"
8181                         ;;
8182                 esac
8183         done
8184 fi
8185
8186 # add the variations for the package we are looking for
8187
8188 cf_search=
8189
8190 test "x$prefix" != "xNONE" && \
8191 test -d "$prefix" && \
8192  {
8193         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8194         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8195         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8196         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8197         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8198         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8199 }
8200
8201 for cf_subdir_prefix in \
8202         /usr \
8203         /usr/local \
8204         /usr/pkg \
8205         /opt \
8206         /opt/local \
8207         $HOME
8208 do
8209
8210 test "x$cf_subdir_prefix" != "x$prefix" && \
8211 test -d "$cf_subdir_prefix" && \
8212 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8213         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8214         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8215         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8216         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8217         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8218         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"
8219 }
8220
8221 done
8222
8223 test "$includedir" != NONE && \
8224 test "$includedir" != "/usr/include" && \
8225 test -d "$includedir" && {
8226         test -d $includedir &&    cf_search="$cf_search $includedir"
8227         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8228 }
8229
8230 test "$oldincludedir" != NONE && \
8231 test "$oldincludedir" != "/usr/include" && \
8232 test -d "$oldincludedir" && {
8233         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8234         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8235 }
8236
8237 cf_search="$cf_search $cf_header_path_list"
8238
8239         test -n "$verbose" && echo search path $cf_search
8240         cf_save2_CPPFLAGS="$CPPFLAGS"
8241         for cf_incdir in $cf_search
8242         do
8243
8244 if test -n "$cf_incdir" ; then
8245   for cf_add_incdir in $cf_incdir
8246   do
8247         while test $cf_add_incdir != /usr/include
8248         do
8249           if test -d $cf_add_incdir
8250           then
8251                 cf_have_incdir=no
8252                 if test -n "$CFLAGS$CPPFLAGS" ; then
8253                   # a loop is needed to ensure we can add subdirs of existing dirs
8254                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8255                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8256                           cf_have_incdir=yes; break
8257                         fi
8258                   done
8259                 fi
8260
8261                 if test "$cf_have_incdir" = no ; then
8262                   if test "$cf_add_incdir" = /usr/local/include ; then
8263                         if test "$GCC" = yes
8264                         then
8265                           cf_save_CPPFLAGS=$CPPFLAGS
8266
8267         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8268         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8269
8270                           cat >conftest.$ac_ext <<_ACEOF
8271 #line 8271 "configure"
8272 #include "confdefs.h"
8273 #include <stdio.h>
8274 int
8275 main (void)
8276 {
8277 printf("Hello")
8278   ;
8279   return 0;
8280 }
8281 _ACEOF
8282 rm -f conftest.$ac_objext
8283 if { (eval echo "$as_me:8283: \"$ac_compile\"") >&5
8284   (eval $ac_compile) 2>&5
8285   ac_status=$?
8286   echo "$as_me:8286: \$? = $ac_status" >&5
8287   (exit $ac_status); } &&
8288          { ac_try='test -s conftest.$ac_objext'
8289   { (eval echo "$as_me:8289: \"$ac_try\"") >&5
8290   (eval $ac_try) 2>&5
8291   ac_status=$?
8292   echo "$as_me:8292: \$? = $ac_status" >&5
8293   (exit $ac_status); }; }; then
8294   :
8295 else
8296   echo "$as_me: failed program was:" >&5
8297 cat conftest.$ac_ext >&5
8298 cf_have_incdir=yes
8299 fi
8300 rm -f conftest.$ac_objext conftest.$ac_ext
8301                           CPPFLAGS=$cf_save_CPPFLAGS
8302                         fi
8303                   fi
8304                 fi
8305
8306                 if test "$cf_have_incdir" = no ; then
8307                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8308
8309 echo "${as_me:-configure}:8309: testing adding $cf_add_incdir to include-path ..." 1>&5
8310
8311                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8312
8313                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8314                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8315                   cf_add_incdir="$cf_top_incdir"
8316                 else
8317                   break
8318                 fi
8319           else
8320                 break
8321           fi
8322         done
8323   done
8324 fi
8325
8326                 for cf_header in \
8327                         ncurses.h \
8328                         curses.h
8329                 do
8330
8331         cat >conftest.$ac_ext <<_ACEOF
8332 #line 8332 "configure"
8333 #include "confdefs.h"
8334
8335 #include <$cf_header>
8336 int
8337 main (void)
8338 {
8339
8340 #ifdef NCURSES_VERSION
8341
8342 printf("%s\n", NCURSES_VERSION);
8343 #else
8344 #ifdef __NCURSES_H
8345 printf("old\n");
8346 #else
8347         make an error
8348 #endif
8349 #endif
8350
8351   ;
8352   return 0;
8353 }
8354 _ACEOF
8355 rm -f conftest.$ac_objext
8356 if { (eval echo "$as_me:8356: \"$ac_compile\"") >&5
8357   (eval $ac_compile) 2>&5
8358   ac_status=$?
8359   echo "$as_me:8359: \$? = $ac_status" >&5
8360   (exit $ac_status); } &&
8361          { ac_try='test -s conftest.$ac_objext'
8362   { (eval echo "$as_me:8362: \"$ac_try\"") >&5
8363   (eval $ac_try) 2>&5
8364   ac_status=$?
8365   echo "$as_me:8365: \$? = $ac_status" >&5
8366   (exit $ac_status); }; }; then
8367   cf_cv_ncurses_h2=$cf_header
8368
8369 else
8370   echo "$as_me: failed program was:" >&5
8371 cat conftest.$ac_ext >&5
8372 cf_cv_ncurses_h2=no
8373 fi
8374 rm -f conftest.$ac_objext conftest.$ac_ext
8375
8376                         if test "$cf_cv_ncurses_h2" != no ; then
8377                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8378                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8379                                 break
8380                         fi
8381                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8382                 done
8383                 CPPFLAGS="$cf_save2_CPPFLAGS"
8384                 test "$cf_cv_ncurses_h2" != no && break
8385         done
8386         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8386: error: not found" >&5
8387 echo "$as_me: error: not found" >&2;}
8388    { (exit 1); exit 1; }; }
8389
8390 fi
8391 echo "$as_me:8391: result: $cf_cv_ncurses_h2" >&5
8392 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8393
8394         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8395         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8396         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8397                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8398         fi
8399
8400 if test -n "$cf_1st_incdir" ; then
8401   for cf_add_incdir in $cf_1st_incdir
8402   do
8403         while test $cf_add_incdir != /usr/include
8404         do
8405           if test -d $cf_add_incdir
8406           then
8407                 cf_have_incdir=no
8408                 if test -n "$CFLAGS$CPPFLAGS" ; then
8409                   # a loop is needed to ensure we can add subdirs of existing dirs
8410                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8411                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8412                           cf_have_incdir=yes; break
8413                         fi
8414                   done
8415                 fi
8416
8417                 if test "$cf_have_incdir" = no ; then
8418                   if test "$cf_add_incdir" = /usr/local/include ; then
8419                         if test "$GCC" = yes
8420                         then
8421                           cf_save_CPPFLAGS=$CPPFLAGS
8422
8423         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8424         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8425
8426                           cat >conftest.$ac_ext <<_ACEOF
8427 #line 8427 "configure"
8428 #include "confdefs.h"
8429 #include <stdio.h>
8430 int
8431 main (void)
8432 {
8433 printf("Hello")
8434   ;
8435   return 0;
8436 }
8437 _ACEOF
8438 rm -f conftest.$ac_objext
8439 if { (eval echo "$as_me:8439: \"$ac_compile\"") >&5
8440   (eval $ac_compile) 2>&5
8441   ac_status=$?
8442   echo "$as_me:8442: \$? = $ac_status" >&5
8443   (exit $ac_status); } &&
8444          { ac_try='test -s conftest.$ac_objext'
8445   { (eval echo "$as_me:8445: \"$ac_try\"") >&5
8446   (eval $ac_try) 2>&5
8447   ac_status=$?
8448   echo "$as_me:8448: \$? = $ac_status" >&5
8449   (exit $ac_status); }; }; then
8450   :
8451 else
8452   echo "$as_me: failed program was:" >&5
8453 cat conftest.$ac_ext >&5
8454 cf_have_incdir=yes
8455 fi
8456 rm -f conftest.$ac_objext conftest.$ac_ext
8457                           CPPFLAGS=$cf_save_CPPFLAGS
8458                         fi
8459                   fi
8460                 fi
8461
8462                 if test "$cf_have_incdir" = no ; then
8463                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8464
8465 echo "${as_me:-configure}:8465: testing adding $cf_add_incdir to include-path ..." 1>&5
8466
8467                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8468
8469                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8470                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8471                   cf_add_incdir="$cf_top_incdir"
8472                 else
8473                   break
8474                 fi
8475           else
8476                 break
8477           fi
8478         done
8479   done
8480 fi
8481
8482 fi
8483
8484 # Set definitions to allow ifdef'ing for ncurses.h
8485
8486 case $cf_cv_ncurses_header in
8487 (*ncurses.h)
8488
8489 cat >>confdefs.h <<\EOF
8490 #define HAVE_NCURSES_H 1
8491 EOF
8492
8493         ;;
8494 esac
8495
8496 case $cf_cv_ncurses_header in
8497 (ncurses/curses.h|ncurses/ncurses.h)
8498
8499 cat >>confdefs.h <<\EOF
8500 #define HAVE_NCURSES_NCURSES_H 1
8501 EOF
8502
8503         ;;
8504 (ncursesw/curses.h|ncursesw/ncurses.h)
8505
8506 cat >>confdefs.h <<\EOF
8507 #define HAVE_NCURSESW_NCURSES_H 1
8508 EOF
8509
8510         ;;
8511 esac
8512
8513 echo "$as_me:8513: checking for terminfo header" >&5
8514 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8515 if test "${cf_cv_term_header+set}" = set; then
8516   echo $ECHO_N "(cached) $ECHO_C" >&6
8517 else
8518
8519 case ${cf_cv_ncurses_header} in
8520 (*/ncurses.h|*/ncursesw.h)
8521         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8522         ;;
8523 (*)
8524         cf_term_header=term.h
8525         ;;
8526 esac
8527
8528 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8529 do
8530 cat >conftest.$ac_ext <<_ACEOF
8531 #line 8531 "configure"
8532 #include "confdefs.h"
8533 #include <stdio.h>
8534 #include <${cf_cv_ncurses_header:-curses.h}>
8535 #include <$cf_test>
8536
8537 int
8538 main (void)
8539 {
8540 int x = auto_left_margin
8541   ;
8542   return 0;
8543 }
8544 _ACEOF
8545 rm -f conftest.$ac_objext
8546 if { (eval echo "$as_me:8546: \"$ac_compile\"") >&5
8547   (eval $ac_compile) 2>&5
8548   ac_status=$?
8549   echo "$as_me:8549: \$? = $ac_status" >&5
8550   (exit $ac_status); } &&
8551          { ac_try='test -s conftest.$ac_objext'
8552   { (eval echo "$as_me:8552: \"$ac_try\"") >&5
8553   (eval $ac_try) 2>&5
8554   ac_status=$?
8555   echo "$as_me:8555: \$? = $ac_status" >&5
8556   (exit $ac_status); }; }; then
8557
8558         cf_cv_term_header="$cf_test"
8559 else
8560   echo "$as_me: failed program was:" >&5
8561 cat conftest.$ac_ext >&5
8562
8563         cf_cv_term_header=unknown
8564
8565 fi
8566 rm -f conftest.$ac_objext conftest.$ac_ext
8567         test "$cf_cv_term_header" != unknown && break
8568 done
8569
8570 fi
8571 echo "$as_me:8571: result: $cf_cv_term_header" >&5
8572 echo "${ECHO_T}$cf_cv_term_header" >&6
8573
8574 # Set definitions to allow ifdef'ing to accommodate subdirectories
8575
8576 case $cf_cv_term_header in
8577 (*term.h)
8578
8579 cat >>confdefs.h <<\EOF
8580 #define HAVE_TERM_H 1
8581 EOF
8582
8583         ;;
8584 esac
8585
8586 case $cf_cv_term_header in
8587 (ncurses/term.h)
8588
8589 cat >>confdefs.h <<\EOF
8590 #define HAVE_NCURSES_TERM_H 1
8591 EOF
8592
8593         ;;
8594 (ncursesw/term.h)
8595
8596 cat >>confdefs.h <<\EOF
8597 #define HAVE_NCURSESW_TERM_H 1
8598 EOF
8599
8600         ;;
8601 esac
8602
8603 # some applications need this, but should check for NCURSES_VERSION
8604
8605 cat >>confdefs.h <<\EOF
8606 #define NCURSES 1
8607 EOF
8608
8609 echo "$as_me:8609: checking for ncurses version" >&5
8610 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8611 if test "${cf_cv_ncurses_version+set}" = set; then
8612   echo $ECHO_N "(cached) $ECHO_C" >&6
8613 else
8614
8615         cf_cv_ncurses_version=no
8616         cf_tempfile=out$$
8617         rm -f $cf_tempfile
8618         if test "$cross_compiling" = yes; then
8619
8620         # This will not work if the preprocessor splits the line after the
8621         # Autoconf token.  The 'unproto' program does that.
8622         cat > conftest.$ac_ext <<EOF
8623 #include <${cf_cv_ncurses_header:-curses.h}>
8624 #undef Autoconf
8625 #ifdef NCURSES_VERSION
8626 Autoconf NCURSES_VERSION
8627 #else
8628 #ifdef __NCURSES_H
8629 Autoconf "old"
8630 #endif
8631 ;
8632 #endif
8633 EOF
8634         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8635         { (eval echo "$as_me:8635: \"$cf_try\"") >&5
8636   (eval $cf_try) 2>&5
8637   ac_status=$?
8638   echo "$as_me:8638: \$? = $ac_status" >&5
8639   (exit $ac_status); }
8640         if test -f conftest.out ; then
8641                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8642                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8643                 rm -f conftest.out
8644         fi
8645
8646 else
8647   cat >conftest.$ac_ext <<_ACEOF
8648 #line 8648 "configure"
8649 #include "confdefs.h"
8650
8651 #include <${cf_cv_ncurses_header:-curses.h}>
8652 #include <stdio.h>
8653 int main(void)
8654 {
8655         FILE *fp = fopen("$cf_tempfile", "w");
8656 #ifdef NCURSES_VERSION
8657 # ifdef NCURSES_VERSION_PATCH
8658         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8659 # else
8660         fprintf(fp, "%s\n", NCURSES_VERSION);
8661 # endif
8662 #else
8663 # ifdef __NCURSES_H
8664         fprintf(fp, "old\n");
8665 # else
8666         make an error
8667 # endif
8668 #endif
8669         ${cf_cv_main_return:-return}(0);
8670 }
8671 _ACEOF
8672 rm -f conftest$ac_exeext
8673 if { (eval echo "$as_me:8673: \"$ac_link\"") >&5
8674   (eval $ac_link) 2>&5
8675   ac_status=$?
8676   echo "$as_me:8676: \$? = $ac_status" >&5
8677   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8678   { (eval echo "$as_me:8678: \"$ac_try\"") >&5
8679   (eval $ac_try) 2>&5
8680   ac_status=$?
8681   echo "$as_me:8681: \$? = $ac_status" >&5
8682   (exit $ac_status); }; }; then
8683
8684         cf_cv_ncurses_version=`cat $cf_tempfile`
8685 else
8686   echo "$as_me: program exited with status $ac_status" >&5
8687 echo "$as_me: failed program was:" >&5
8688 cat conftest.$ac_ext >&5
8689 fi
8690 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8691 fi
8692         rm -f $cf_tempfile
8693
8694 fi
8695 echo "$as_me:8695: result: $cf_cv_ncurses_version" >&5
8696 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8697 test "$cf_cv_ncurses_version" = no ||
8698 cat >>confdefs.h <<\EOF
8699 #define NCURSES 1
8700 EOF
8701
8702 cf_nculib_root=$cf_cv_screen
8703         # This works, except for the special case where we find gpm, but
8704         # ncurses is in a nonstandard location via $LIBS, and we really want
8705         # to link gpm.
8706 cf_ncurses_LIBS=""
8707 cf_ncurses_SAVE="$LIBS"
8708 echo "$as_me:8708: checking for Gpm_Open in -lgpm" >&5
8709 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8710 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8711   echo $ECHO_N "(cached) $ECHO_C" >&6
8712 else
8713   ac_check_lib_save_LIBS=$LIBS
8714 LIBS="-lgpm  $LIBS"
8715 cat >conftest.$ac_ext <<_ACEOF
8716 #line 8716 "configure"
8717 #include "confdefs.h"
8718
8719 /* Override any gcc2 internal prototype to avoid an error.  */
8720 #ifdef __cplusplus
8721 extern "C"
8722 #endif
8723 /* We use char because int might match the return type of a gcc2
8724    builtin and then its argument prototype would still apply.  */
8725 char Gpm_Open ();
8726 int
8727 main (void)
8728 {
8729 Gpm_Open ();
8730   ;
8731   return 0;
8732 }
8733 _ACEOF
8734 rm -f conftest.$ac_objext conftest$ac_exeext
8735 if { (eval echo "$as_me:8735: \"$ac_link\"") >&5
8736   (eval $ac_link) 2>&5
8737   ac_status=$?
8738   echo "$as_me:8738: \$? = $ac_status" >&5
8739   (exit $ac_status); } &&
8740          { ac_try='test -s conftest$ac_exeext'
8741   { (eval echo "$as_me:8741: \"$ac_try\"") >&5
8742   (eval $ac_try) 2>&5
8743   ac_status=$?
8744   echo "$as_me:8744: \$? = $ac_status" >&5
8745   (exit $ac_status); }; }; then
8746   ac_cv_lib_gpm_Gpm_Open=yes
8747 else
8748   echo "$as_me: failed program was:" >&5
8749 cat conftest.$ac_ext >&5
8750 ac_cv_lib_gpm_Gpm_Open=no
8751 fi
8752 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8753 LIBS=$ac_check_lib_save_LIBS
8754 fi
8755 echo "$as_me:8755: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8756 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8757 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8758   echo "$as_me:8758: checking for initscr in -lgpm" >&5
8759 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8760 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8761   echo $ECHO_N "(cached) $ECHO_C" >&6
8762 else
8763   ac_check_lib_save_LIBS=$LIBS
8764 LIBS="-lgpm  $LIBS"
8765 cat >conftest.$ac_ext <<_ACEOF
8766 #line 8766 "configure"
8767 #include "confdefs.h"
8768
8769 /* Override any gcc2 internal prototype to avoid an error.  */
8770 #ifdef __cplusplus
8771 extern "C"
8772 #endif
8773 /* We use char because int might match the return type of a gcc2
8774    builtin and then its argument prototype would still apply.  */
8775 char initscr ();
8776 int
8777 main (void)
8778 {
8779 initscr ();
8780   ;
8781   return 0;
8782 }
8783 _ACEOF
8784 rm -f conftest.$ac_objext conftest$ac_exeext
8785 if { (eval echo "$as_me:8785: \"$ac_link\"") >&5
8786   (eval $ac_link) 2>&5
8787   ac_status=$?
8788   echo "$as_me:8788: \$? = $ac_status" >&5
8789   (exit $ac_status); } &&
8790          { ac_try='test -s conftest$ac_exeext'
8791   { (eval echo "$as_me:8791: \"$ac_try\"") >&5
8792   (eval $ac_try) 2>&5
8793   ac_status=$?
8794   echo "$as_me:8794: \$? = $ac_status" >&5
8795   (exit $ac_status); }; }; then
8796   ac_cv_lib_gpm_initscr=yes
8797 else
8798   echo "$as_me: failed program was:" >&5
8799 cat conftest.$ac_ext >&5
8800 ac_cv_lib_gpm_initscr=no
8801 fi
8802 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8803 LIBS=$ac_check_lib_save_LIBS
8804 fi
8805 echo "$as_me:8805: result: $ac_cv_lib_gpm_initscr" >&5
8806 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8807 if test $ac_cv_lib_gpm_initscr = yes; then
8808   LIBS="$cf_ncurses_SAVE"
8809 else
8810   cf_ncurses_LIBS="-lgpm"
8811 fi
8812
8813 fi
8814
8815 case $host_os in
8816 (freebsd*)
8817         # This is only necessary if you are linking against an obsolete
8818         # version of ncurses (but it should do no harm, since it's static).
8819         if test "$cf_nculib_root" = ncurses ; then
8820                 echo "$as_me:8820: checking for tgoto in -lmytinfo" >&5
8821 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8822 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8823   echo $ECHO_N "(cached) $ECHO_C" >&6
8824 else
8825   ac_check_lib_save_LIBS=$LIBS
8826 LIBS="-lmytinfo  $LIBS"
8827 cat >conftest.$ac_ext <<_ACEOF
8828 #line 8828 "configure"
8829 #include "confdefs.h"
8830
8831 /* Override any gcc2 internal prototype to avoid an error.  */
8832 #ifdef __cplusplus
8833 extern "C"
8834 #endif
8835 /* We use char because int might match the return type of a gcc2
8836    builtin and then its argument prototype would still apply.  */
8837 char tgoto ();
8838 int
8839 main (void)
8840 {
8841 tgoto ();
8842   ;
8843   return 0;
8844 }
8845 _ACEOF
8846 rm -f conftest.$ac_objext conftest$ac_exeext
8847 if { (eval echo "$as_me:8847: \"$ac_link\"") >&5
8848   (eval $ac_link) 2>&5
8849   ac_status=$?
8850   echo "$as_me:8850: \$? = $ac_status" >&5
8851   (exit $ac_status); } &&
8852          { ac_try='test -s conftest$ac_exeext'
8853   { (eval echo "$as_me:8853: \"$ac_try\"") >&5
8854   (eval $ac_try) 2>&5
8855   ac_status=$?
8856   echo "$as_me:8856: \$? = $ac_status" >&5
8857   (exit $ac_status); }; }; then
8858   ac_cv_lib_mytinfo_tgoto=yes
8859 else
8860   echo "$as_me: failed program was:" >&5
8861 cat conftest.$ac_ext >&5
8862 ac_cv_lib_mytinfo_tgoto=no
8863 fi
8864 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8865 LIBS=$ac_check_lib_save_LIBS
8866 fi
8867 echo "$as_me:8867: result: $ac_cv_lib_mytinfo_tgoto" >&5
8868 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8869 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8870   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8871 fi
8872
8873         fi
8874         ;;
8875 esac
8876
8877 cf_add_libs="$cf_ncurses_LIBS"
8878 # Filter out duplicates - this happens with badly-designed ".pc" files...
8879 for cf_add_1lib in $LIBS
8880 do
8881         for cf_add_2lib in $cf_add_libs
8882         do
8883                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8884                 then
8885                         cf_add_1lib=
8886                         break
8887                 fi
8888         done
8889         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8890 done
8891 LIBS="$cf_add_libs"
8892
8893 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8894 then
8895
8896 cf_add_libs="-l$cf_nculib_root"
8897 # Filter out duplicates - this happens with badly-designed ".pc" files...
8898 for cf_add_1lib in $LIBS
8899 do
8900         for cf_add_2lib in $cf_add_libs
8901         do
8902                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8903                 then
8904                         cf_add_1lib=
8905                         break
8906                 fi
8907         done
8908         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8909 done
8910 LIBS="$cf_add_libs"
8911
8912 else
8913
8914         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8915         cf_libdir=""
8916         echo "$as_me:8916: checking for initscr" >&5
8917 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8918 if test "${ac_cv_func_initscr+set}" = set; then
8919   echo $ECHO_N "(cached) $ECHO_C" >&6
8920 else
8921   cat >conftest.$ac_ext <<_ACEOF
8922 #line 8922 "configure"
8923 #include "confdefs.h"
8924 #define initscr autoconf_temporary
8925 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8926 #undef initscr
8927
8928 #ifdef __cplusplus
8929 extern "C"
8930 #endif
8931
8932 /* We use char because int might match the return type of a gcc2
8933    builtin and then its argument prototype would still apply.  */
8934 char initscr (void);
8935
8936 int
8937 main (void)
8938 {
8939
8940 /* The GNU C library defines stubs for functions which it implements
8941     to always fail with ENOSYS.  Some functions are actually named
8942     something starting with __ and the normal name is an alias.  */
8943 #if defined (__stub_initscr) || defined (__stub___initscr)
8944 #error found stub for initscr
8945 #endif
8946
8947         return initscr ();
8948   ;
8949   return 0;
8950 }
8951 _ACEOF
8952 rm -f conftest.$ac_objext conftest$ac_exeext
8953 if { (eval echo "$as_me:8953: \"$ac_link\"") >&5
8954   (eval $ac_link) 2>&5
8955   ac_status=$?
8956   echo "$as_me:8956: \$? = $ac_status" >&5
8957   (exit $ac_status); } &&
8958          { ac_try='test -s conftest$ac_exeext'
8959   { (eval echo "$as_me:8959: \"$ac_try\"") >&5
8960   (eval $ac_try) 2>&5
8961   ac_status=$?
8962   echo "$as_me:8962: \$? = $ac_status" >&5
8963   (exit $ac_status); }; }; then
8964   ac_cv_func_initscr=yes
8965 else
8966   echo "$as_me: failed program was:" >&5
8967 cat conftest.$ac_ext >&5
8968 ac_cv_func_initscr=no
8969 fi
8970 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8971 fi
8972 echo "$as_me:8972: result: $ac_cv_func_initscr" >&5
8973 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8974 if test $ac_cv_func_initscr = yes; then
8975   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8976 else
8977
8978                 cf_save_LIBS="$LIBS"
8979                 echo "$as_me:8979: checking for initscr in -l$cf_nculib_root" >&5
8980 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8981                 LIBS="-l$cf_nculib_root $LIBS"
8982                 cat >conftest.$ac_ext <<_ACEOF
8983 #line 8983 "configure"
8984 #include "confdefs.h"
8985 #include <${cf_cv_ncurses_header:-curses.h}>
8986 int
8987 main (void)
8988 {
8989 initscr()
8990   ;
8991   return 0;
8992 }
8993 _ACEOF
8994 rm -f conftest.$ac_objext conftest$ac_exeext
8995 if { (eval echo "$as_me:8995: \"$ac_link\"") >&5
8996   (eval $ac_link) 2>&5
8997   ac_status=$?
8998   echo "$as_me:8998: \$? = $ac_status" >&5
8999   (exit $ac_status); } &&
9000          { ac_try='test -s conftest$ac_exeext'
9001   { (eval echo "$as_me:9001: \"$ac_try\"") >&5
9002   (eval $ac_try) 2>&5
9003   ac_status=$?
9004   echo "$as_me:9004: \$? = $ac_status" >&5
9005   (exit $ac_status); }; }; then
9006   echo "$as_me:9006: result: yes" >&5
9007 echo "${ECHO_T}yes" >&6
9008                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9009
9010 else
9011   echo "$as_me: failed program was:" >&5
9012 cat conftest.$ac_ext >&5
9013 echo "$as_me:9013: result: no" >&5
9014 echo "${ECHO_T}no" >&6
9015
9016 cf_search=
9017 cf_library_path_list=""
9018 if test -n "${LDFLAGS}${LIBS}" ; then
9019         for cf_library_path in $LDFLAGS $LIBS
9020         do
9021                 case $cf_library_path in
9022                 (-L*)
9023                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9024
9025 test "x$cf_library_path" != "xNONE" && \
9026 test -d "$cf_library_path" && \
9027  {
9028         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9029         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9030         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9031         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9032         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9033         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"
9034 }
9035
9036                         cf_library_path_list="$cf_library_path_list $cf_search"
9037                         ;;
9038                 esac
9039         done
9040 fi
9041
9042 cf_search=
9043
9044 test "x$prefix" != "xNONE" && \
9045 test -d "$prefix" && \
9046  {
9047         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9048         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9049         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9050         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9051         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9052         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9053 }
9054
9055 for cf_subdir_prefix in \
9056         /usr \
9057         /usr/local \
9058         /usr/pkg \
9059         /opt \
9060         /opt/local \
9061         $HOME
9062 do
9063
9064 test "x$cf_subdir_prefix" != "x$prefix" && \
9065 test -d "$cf_subdir_prefix" && \
9066 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9067         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9068         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9069         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9070         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9071         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9072         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"
9073 }
9074
9075 done
9076
9077 cf_search="$cf_library_path_list $cf_search"
9078
9079                         for cf_libdir in $cf_search
9080                         do
9081                                 echo "$as_me:9081: checking for -l$cf_nculib_root in $cf_libdir" >&5
9082 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9083                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9084                                 cat >conftest.$ac_ext <<_ACEOF
9085 #line 9085 "configure"
9086 #include "confdefs.h"
9087 #include <${cf_cv_ncurses_header:-curses.h}>
9088 int
9089 main (void)
9090 {
9091 initscr()
9092   ;
9093   return 0;
9094 }
9095 _ACEOF
9096 rm -f conftest.$ac_objext conftest$ac_exeext
9097 if { (eval echo "$as_me:9097: \"$ac_link\"") >&5
9098   (eval $ac_link) 2>&5
9099   ac_status=$?
9100   echo "$as_me:9100: \$? = $ac_status" >&5
9101   (exit $ac_status); } &&
9102          { ac_try='test -s conftest$ac_exeext'
9103   { (eval echo "$as_me:9103: \"$ac_try\"") >&5
9104   (eval $ac_try) 2>&5
9105   ac_status=$?
9106   echo "$as_me:9106: \$? = $ac_status" >&5
9107   (exit $ac_status); }; }; then
9108   echo "$as_me:9108: result: yes" >&5
9109 echo "${ECHO_T}yes" >&6
9110                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9111                                          break
9112 else
9113   echo "$as_me: failed program was:" >&5
9114 cat conftest.$ac_ext >&5
9115 echo "$as_me:9115: result: no" >&5
9116 echo "${ECHO_T}no" >&6
9117                                          LIBS="$cf_save_LIBS"
9118 fi
9119 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9120                         done
9121
9122 fi
9123 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9124
9125 fi
9126
9127 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9128
9129 if test $cf_found_library = no ; then
9130         { { echo "$as_me:9130: error: Cannot link $cf_nculib_root library" >&5
9131 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9132    { (exit 1); exit 1; }; }
9133 fi
9134
9135 fi
9136
9137 if test -n "$cf_ncurses_LIBS" ; then
9138         echo "$as_me:9138: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9139 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9140         cf_ncurses_SAVE="$LIBS"
9141         for p in $cf_ncurses_LIBS ; do
9142                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9143                 if test "$q" != "$LIBS" ; then
9144                         LIBS="$q"
9145                 fi
9146         done
9147         cat >conftest.$ac_ext <<_ACEOF
9148 #line 9148 "configure"
9149 #include "confdefs.h"
9150 #include <${cf_cv_ncurses_header:-curses.h}>
9151 int
9152 main (void)
9153 {
9154 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9155   ;
9156   return 0;
9157 }
9158 _ACEOF
9159 rm -f conftest.$ac_objext conftest$ac_exeext
9160 if { (eval echo "$as_me:9160: \"$ac_link\"") >&5
9161   (eval $ac_link) 2>&5
9162   ac_status=$?
9163   echo "$as_me:9163: \$? = $ac_status" >&5
9164   (exit $ac_status); } &&
9165          { ac_try='test -s conftest$ac_exeext'
9166   { (eval echo "$as_me:9166: \"$ac_try\"") >&5
9167   (eval $ac_try) 2>&5
9168   ac_status=$?
9169   echo "$as_me:9169: \$? = $ac_status" >&5
9170   (exit $ac_status); }; }; then
9171   echo "$as_me:9171: result: yes" >&5
9172 echo "${ECHO_T}yes" >&6
9173 else
9174   echo "$as_me: failed program was:" >&5
9175 cat conftest.$ac_ext >&5
9176 echo "$as_me:9176: result: no" >&5
9177 echo "${ECHO_T}no" >&6
9178                  LIBS="$cf_ncurses_SAVE"
9179 fi
9180 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9181 fi
9182
9183 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9184
9185 cat >>confdefs.h <<EOF
9186 #define $cf_nculib_ROOT 1
9187 EOF
9188
9189         fi
9190 else
9191         NCURSES_CONFIG=none
9192 fi
9193
9194         ;;
9195 (ncurses*)
9196
9197 cf_ncuconfig_root=$cf_cv_screen
9198 cf_have_ncuconfig=no
9199
9200 if test "x${PKG_CONFIG:=none}" != xnone; then
9201         echo "$as_me:9201: checking pkg-config for $cf_ncuconfig_root" >&5
9202 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9203         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9204                 echo "$as_me:9204: result: yes" >&5
9205 echo "${ECHO_T}yes" >&6
9206
9207                 echo "$as_me:9207: checking if the $cf_ncuconfig_root package files work" >&5
9208 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9209                 cf_have_ncuconfig=unknown
9210
9211                 cf_save_CPPFLAGS="$CPPFLAGS"
9212                 cf_save_LIBS="$LIBS"
9213
9214 cf_fix_cppflags=no
9215 cf_new_cflags=
9216 cf_new_cppflags=
9217 cf_new_extra_cppflags=
9218
9219 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
9220 do
9221 case $cf_fix_cppflags in
9222 (no)
9223         case $cf_add_cflags in
9224         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9225                 case $cf_add_cflags in
9226                 (-D*)
9227                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9228
9229                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9230                                 && test -z "${cf_tst_cflags}" \
9231                                 && cf_fix_cppflags=yes
9232
9233                         if test $cf_fix_cppflags = yes ; then
9234
9235         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9236         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9237
9238                                 continue
9239                         elif test "${cf_tst_cflags}" = "\"'" ; then
9240
9241         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9242         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9243
9244                                 continue
9245                         fi
9246                         ;;
9247                 esac
9248                 case "$CPPFLAGS" in
9249                 (*$cf_add_cflags)
9250                         ;;
9251                 (*)
9252                         case $cf_add_cflags in
9253                         (-D*)
9254                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9255
9256 CPPFLAGS=`echo "$CPPFLAGS" | \
9257         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9258                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9259
9260                                 ;;
9261                         esac
9262
9263         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9264         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9265
9266                         ;;
9267                 esac
9268                 ;;
9269         (*)
9270
9271         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9272         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9273
9274                 ;;
9275         esac
9276         ;;
9277 (yes)
9278
9279         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9280         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9281
9282         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9283
9284         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9285                 && test -z "${cf_tst_cflags}" \
9286                 && cf_fix_cppflags=no
9287         ;;
9288 esac
9289 done
9290
9291 if test -n "$cf_new_cflags" ; then
9292
9293         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9294         CFLAGS="${CFLAGS}$cf_new_cflags"
9295
9296 fi
9297
9298 if test -n "$cf_new_cppflags" ; then
9299
9300         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9301         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9302
9303 fi
9304
9305 if test -n "$cf_new_extra_cppflags" ; then
9306
9307         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9308         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9309
9310 fi
9311
9312 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9313 # Filter out duplicates - this happens with badly-designed ".pc" files...
9314 for cf_add_1lib in $LIBS
9315 do
9316         for cf_add_2lib in $cf_add_libs
9317         do
9318                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9319                 then
9320                         cf_add_1lib=
9321                         break
9322                 fi
9323         done
9324         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9325 done
9326 LIBS="$cf_add_libs"
9327
9328                 cat >conftest.$ac_ext <<_ACEOF
9329 #line 9329 "configure"
9330 #include "confdefs.h"
9331 #include <${cf_cv_ncurses_header:-curses.h}>
9332 int
9333 main (void)
9334 {
9335 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9336   ;
9337   return 0;
9338 }
9339 _ACEOF
9340 rm -f conftest.$ac_objext conftest$ac_exeext
9341 if { (eval echo "$as_me:9341: \"$ac_link\"") >&5
9342   (eval $ac_link) 2>&5
9343   ac_status=$?
9344   echo "$as_me:9344: \$? = $ac_status" >&5
9345   (exit $ac_status); } &&
9346          { ac_try='test -s conftest$ac_exeext'
9347   { (eval echo "$as_me:9347: \"$ac_try\"") >&5
9348   (eval $ac_try) 2>&5
9349   ac_status=$?
9350   echo "$as_me:9350: \$? = $ac_status" >&5
9351   (exit $ac_status); }; }; then
9352   if test "$cross_compiling" = yes; then
9353   cf_have_ncuconfig=maybe
9354 else
9355   cat >conftest.$ac_ext <<_ACEOF
9356 #line 9356 "configure"
9357 #include "confdefs.h"
9358 #include <${cf_cv_ncurses_header:-curses.h}>
9359                                 int main(void)
9360                                 { char *xx = curses_version(); return (xx == 0); }
9361 _ACEOF
9362 rm -f conftest$ac_exeext
9363 if { (eval echo "$as_me:9363: \"$ac_link\"") >&5
9364   (eval $ac_link) 2>&5
9365   ac_status=$?
9366   echo "$as_me:9366: \$? = $ac_status" >&5
9367   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9368   { (eval echo "$as_me:9368: \"$ac_try\"") >&5
9369   (eval $ac_try) 2>&5
9370   ac_status=$?
9371   echo "$as_me:9371: \$? = $ac_status" >&5
9372   (exit $ac_status); }; }; then
9373   cf_have_ncuconfig=yes
9374 else
9375   echo "$as_me: program exited with status $ac_status" >&5
9376 echo "$as_me: failed program was:" >&5
9377 cat conftest.$ac_ext >&5
9378 cf_have_ncuconfig=no
9379 fi
9380 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9381 fi
9382 else
9383   echo "$as_me: failed program was:" >&5
9384 cat conftest.$ac_ext >&5
9385 cf_have_ncuconfig=no
9386 fi
9387 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9388                 echo "$as_me:9388: result: $cf_have_ncuconfig" >&5
9389 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9390                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9391                 if test "$cf_have_ncuconfig" != "yes"
9392                 then
9393                         CPPFLAGS="$cf_save_CPPFLAGS"
9394                         LIBS="$cf_save_LIBS"
9395                         NCURSES_CONFIG_PKG=none
9396                 else
9397
9398 cat >>confdefs.h <<\EOF
9399 #define NCURSES 1
9400 EOF
9401
9402                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9403
9404 echo "$as_me:9404: checking for terminfo header" >&5
9405 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9406 if test "${cf_cv_term_header+set}" = set; then
9407   echo $ECHO_N "(cached) $ECHO_C" >&6
9408 else
9409
9410 case ${cf_cv_ncurses_header} in
9411 (*/ncurses.h|*/ncursesw.h)
9412         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9413         ;;
9414 (*)
9415         cf_term_header=term.h
9416         ;;
9417 esac
9418
9419 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9420 do
9421 cat >conftest.$ac_ext <<_ACEOF
9422 #line 9422 "configure"
9423 #include "confdefs.h"
9424 #include <stdio.h>
9425 #include <${cf_cv_ncurses_header:-curses.h}>
9426 #include <$cf_test>
9427
9428 int
9429 main (void)
9430 {
9431 int x = auto_left_margin
9432   ;
9433   return 0;
9434 }
9435 _ACEOF
9436 rm -f conftest.$ac_objext
9437 if { (eval echo "$as_me:9437: \"$ac_compile\"") >&5
9438   (eval $ac_compile) 2>&5
9439   ac_status=$?
9440   echo "$as_me:9440: \$? = $ac_status" >&5
9441   (exit $ac_status); } &&
9442          { ac_try='test -s conftest.$ac_objext'
9443   { (eval echo "$as_me:9443: \"$ac_try\"") >&5
9444   (eval $ac_try) 2>&5
9445   ac_status=$?
9446   echo "$as_me:9446: \$? = $ac_status" >&5
9447   (exit $ac_status); }; }; then
9448
9449         cf_cv_term_header="$cf_test"
9450 else
9451   echo "$as_me: failed program was:" >&5
9452 cat conftest.$ac_ext >&5
9453
9454         cf_cv_term_header=unknown
9455
9456 fi
9457 rm -f conftest.$ac_objext conftest.$ac_ext
9458         test "$cf_cv_term_header" != unknown && break
9459 done
9460
9461 fi
9462 echo "$as_me:9462: result: $cf_cv_term_header" >&5
9463 echo "${ECHO_T}$cf_cv_term_header" >&6
9464
9465 # Set definitions to allow ifdef'ing to accommodate subdirectories
9466
9467 case $cf_cv_term_header in
9468 (*term.h)
9469
9470 cat >>confdefs.h <<\EOF
9471 #define HAVE_TERM_H 1
9472 EOF
9473
9474         ;;
9475 esac
9476
9477 case $cf_cv_term_header in
9478 (ncurses/term.h)
9479
9480 cat >>confdefs.h <<\EOF
9481 #define HAVE_NCURSES_TERM_H 1
9482 EOF
9483
9484         ;;
9485 (ncursesw/term.h)
9486
9487 cat >>confdefs.h <<\EOF
9488 #define HAVE_NCURSESW_TERM_H 1
9489 EOF
9490
9491         ;;
9492 esac
9493
9494                 fi
9495
9496         else
9497                 echo "$as_me:9497: result: no" >&5
9498 echo "${ECHO_T}no" >&6
9499                 NCURSES_CONFIG_PKG=none
9500         fi
9501 else
9502         NCURSES_CONFIG_PKG=none
9503 fi
9504
9505 if test "x$cf_have_ncuconfig" = "xno"; then
9506         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9507
9508 if test -n "$ac_tool_prefix"; then
9509   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9510   do
9511     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9512 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9513 echo "$as_me:9513: checking for $ac_word" >&5
9514 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9515 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9516   echo $ECHO_N "(cached) $ECHO_C" >&6
9517 else
9518   if test -n "$NCURSES_CONFIG"; then
9519   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9520 else
9521   ac_save_IFS=$IFS; IFS=$ac_path_separator
9522 ac_dummy="$PATH"
9523 for ac_dir in $ac_dummy; do
9524   IFS=$ac_save_IFS
9525   test -z "$ac_dir" && ac_dir=.
9526   $as_executable_p "$ac_dir/$ac_word" || continue
9527 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9528 echo "$as_me:9528: found $ac_dir/$ac_word" >&5
9529 break
9530 done
9531
9532 fi
9533 fi
9534 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9535 if test -n "$NCURSES_CONFIG"; then
9536   echo "$as_me:9536: result: $NCURSES_CONFIG" >&5
9537 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9538 else
9539   echo "$as_me:9539: result: no" >&5
9540 echo "${ECHO_T}no" >&6
9541 fi
9542
9543     test -n "$NCURSES_CONFIG" && break
9544   done
9545 fi
9546 if test -z "$NCURSES_CONFIG"; then
9547   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9548   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9549 do
9550   # Extract the first word of "$ac_prog", so it can be a program name with args.
9551 set dummy $ac_prog; ac_word=$2
9552 echo "$as_me:9552: checking for $ac_word" >&5
9553 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9554 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9555   echo $ECHO_N "(cached) $ECHO_C" >&6
9556 else
9557   if test -n "$ac_ct_NCURSES_CONFIG"; then
9558   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9559 else
9560   ac_save_IFS=$IFS; IFS=$ac_path_separator
9561 ac_dummy="$PATH"
9562 for ac_dir in $ac_dummy; do
9563   IFS=$ac_save_IFS
9564   test -z "$ac_dir" && ac_dir=.
9565   $as_executable_p "$ac_dir/$ac_word" || continue
9566 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9567 echo "$as_me:9567: found $ac_dir/$ac_word" >&5
9568 break
9569 done
9570
9571 fi
9572 fi
9573 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9574 if test -n "$ac_ct_NCURSES_CONFIG"; then
9575   echo "$as_me:9575: result: $ac_ct_NCURSES_CONFIG" >&5
9576 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9577 else
9578   echo "$as_me:9578: result: no" >&5
9579 echo "${ECHO_T}no" >&6
9580 fi
9581
9582   test -n "$ac_ct_NCURSES_CONFIG" && break
9583 done
9584 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9585
9586   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9587 fi
9588
9589         if test "$NCURSES_CONFIG" != none ; then
9590
9591 cf_fix_cppflags=no
9592 cf_new_cflags=
9593 cf_new_cppflags=
9594 cf_new_extra_cppflags=
9595
9596 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9597 do
9598 case $cf_fix_cppflags in
9599 (no)
9600         case $cf_add_cflags in
9601         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9602                 case $cf_add_cflags in
9603                 (-D*)
9604                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9605
9606                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9607                                 && test -z "${cf_tst_cflags}" \
9608                                 && cf_fix_cppflags=yes
9609
9610                         if test $cf_fix_cppflags = yes ; then
9611
9612         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9613         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9614
9615                                 continue
9616                         elif test "${cf_tst_cflags}" = "\"'" ; then
9617
9618         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9619         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9620
9621                                 continue
9622                         fi
9623                         ;;
9624                 esac
9625                 case "$CPPFLAGS" in
9626                 (*$cf_add_cflags)
9627                         ;;
9628                 (*)
9629                         case $cf_add_cflags in
9630                         (-D*)
9631                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9632
9633 CPPFLAGS=`echo "$CPPFLAGS" | \
9634         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9635                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9636
9637                                 ;;
9638                         esac
9639
9640         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9641         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9642
9643                         ;;
9644                 esac
9645                 ;;
9646         (*)
9647
9648         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9649         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9650
9651                 ;;
9652         esac
9653         ;;
9654 (yes)
9655
9656         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9657         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9658
9659         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9660
9661         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9662                 && test -z "${cf_tst_cflags}" \
9663                 && cf_fix_cppflags=no
9664         ;;
9665 esac
9666 done
9667
9668 if test -n "$cf_new_cflags" ; then
9669
9670         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9671         CFLAGS="${CFLAGS}$cf_new_cflags"
9672
9673 fi
9674
9675 if test -n "$cf_new_cppflags" ; then
9676
9677         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9678         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9679
9680 fi
9681
9682 if test -n "$cf_new_extra_cppflags" ; then
9683
9684         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9685         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9686
9687 fi
9688
9689 cf_add_libs="`$NCURSES_CONFIG --libs`"
9690 # Filter out duplicates - this happens with badly-designed ".pc" files...
9691 for cf_add_1lib in $LIBS
9692 do
9693         for cf_add_2lib in $cf_add_libs
9694         do
9695                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9696                 then
9697                         cf_add_1lib=
9698                         break
9699                 fi
9700         done
9701         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9702 done
9703 LIBS="$cf_add_libs"
9704
9705                 # even with config script, some packages use no-override for curses.h
9706
9707 echo "$as_me:9707: checking if we have identified curses headers" >&5
9708 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9709 if test "${cf_cv_ncurses_header+set}" = set; then
9710   echo $ECHO_N "(cached) $ECHO_C" >&6
9711 else
9712
9713 cf_cv_ncurses_header=none
9714 for cf_header in \
9715         ncurses.h $cf_cv_screen/ncurses.h \
9716         curses.h $cf_cv_screen/curses.h
9717 do
9718 cat >conftest.$ac_ext <<_ACEOF
9719 #line 9719 "configure"
9720 #include "confdefs.h"
9721 #include <${cf_header}>
9722 int
9723 main (void)
9724 {
9725 initscr(); tgoto("?", 0,0)
9726   ;
9727   return 0;
9728 }
9729 _ACEOF
9730 rm -f conftest.$ac_objext
9731 if { (eval echo "$as_me:9731: \"$ac_compile\"") >&5
9732   (eval $ac_compile) 2>&5
9733   ac_status=$?
9734   echo "$as_me:9734: \$? = $ac_status" >&5
9735   (exit $ac_status); } &&
9736          { ac_try='test -s conftest.$ac_objext'
9737   { (eval echo "$as_me:9737: \"$ac_try\"") >&5
9738   (eval $ac_try) 2>&5
9739   ac_status=$?
9740   echo "$as_me:9740: \$? = $ac_status" >&5
9741   (exit $ac_status); }; }; then
9742   cf_cv_ncurses_header=$cf_header; break
9743 else
9744   echo "$as_me: failed program was:" >&5
9745 cat conftest.$ac_ext >&5
9746 fi
9747 rm -f conftest.$ac_objext conftest.$ac_ext
9748 done
9749
9750 fi
9751 echo "$as_me:9751: result: $cf_cv_ncurses_header" >&5
9752 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9753
9754 if test "$cf_cv_ncurses_header" = none ; then
9755         { { echo "$as_me:9755: error: No curses header-files found" >&5
9756 echo "$as_me: error: No curses header-files found" >&2;}
9757    { (exit 1); exit 1; }; }
9758 fi
9759
9760 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9761
9762 for ac_header in $cf_cv_ncurses_header
9763 do
9764 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9765 echo "$as_me:9765: checking for $ac_header" >&5
9766 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9767 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9768   echo $ECHO_N "(cached) $ECHO_C" >&6
9769 else
9770   cat >conftest.$ac_ext <<_ACEOF
9771 #line 9771 "configure"
9772 #include "confdefs.h"
9773 #include <$ac_header>
9774 _ACEOF
9775 if { (eval echo "$as_me:9775: \"$ac_cpp conftest.$ac_ext\"") >&5
9776   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9777   ac_status=$?
9778   egrep -v '^ *\+' conftest.er1 >conftest.err
9779   rm -f conftest.er1
9780   cat conftest.err >&5
9781   echo "$as_me:9781: \$? = $ac_status" >&5
9782   (exit $ac_status); } >/dev/null; then
9783   if test -s conftest.err; then
9784     ac_cpp_err=$ac_c_preproc_warn_flag
9785   else
9786     ac_cpp_err=
9787   fi
9788 else
9789   ac_cpp_err=yes
9790 fi
9791 if test -z "$ac_cpp_err"; then
9792   eval "$as_ac_Header=yes"
9793 else
9794   echo "$as_me: failed program was:" >&5
9795   cat conftest.$ac_ext >&5
9796   eval "$as_ac_Header=no"
9797 fi
9798 rm -f conftest.err conftest.$ac_ext
9799 fi
9800 echo "$as_me:9800: result: `eval echo '${'$as_ac_Header'}'`" >&5
9801 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9802 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9803   cat >>confdefs.h <<EOF
9804 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9805 EOF
9806
9807 fi
9808 done
9809
9810 cat >>confdefs.h <<\EOF
9811 #define NCURSES 1
9812 EOF
9813
9814 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9815
9816                 cat >>confdefs.h <<EOF
9817 #define $cf_nculib_ROOT 1
9818 EOF
9819
9820                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9821
9822         else
9823
9824 cf_ncuhdr_root=$cf_cv_screen
9825
9826 test -n "$cf_cv_curses_dir" && \
9827 test "$cf_cv_curses_dir" != "no" && { \
9828
9829 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9830   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9831   do
9832         while test $cf_add_incdir != /usr/include
9833         do
9834           if test -d $cf_add_incdir
9835           then
9836                 cf_have_incdir=no
9837                 if test -n "$CFLAGS$CPPFLAGS" ; then
9838                   # a loop is needed to ensure we can add subdirs of existing dirs
9839                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9840                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9841                           cf_have_incdir=yes; break
9842                         fi
9843                   done
9844                 fi
9845
9846                 if test "$cf_have_incdir" = no ; then
9847                   if test "$cf_add_incdir" = /usr/local/include ; then
9848                         if test "$GCC" = yes
9849                         then
9850                           cf_save_CPPFLAGS=$CPPFLAGS
9851
9852         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9853         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9854
9855                           cat >conftest.$ac_ext <<_ACEOF
9856 #line 9856 "configure"
9857 #include "confdefs.h"
9858 #include <stdio.h>
9859 int
9860 main (void)
9861 {
9862 printf("Hello")
9863   ;
9864   return 0;
9865 }
9866 _ACEOF
9867 rm -f conftest.$ac_objext
9868 if { (eval echo "$as_me:9868: \"$ac_compile\"") >&5
9869   (eval $ac_compile) 2>&5
9870   ac_status=$?
9871   echo "$as_me:9871: \$? = $ac_status" >&5
9872   (exit $ac_status); } &&
9873          { ac_try='test -s conftest.$ac_objext'
9874   { (eval echo "$as_me:9874: \"$ac_try\"") >&5
9875   (eval $ac_try) 2>&5
9876   ac_status=$?
9877   echo "$as_me:9877: \$? = $ac_status" >&5
9878   (exit $ac_status); }; }; then
9879   :
9880 else
9881   echo "$as_me: failed program was:" >&5
9882 cat conftest.$ac_ext >&5
9883 cf_have_incdir=yes
9884 fi
9885 rm -f conftest.$ac_objext conftest.$ac_ext
9886                           CPPFLAGS=$cf_save_CPPFLAGS
9887                         fi
9888                   fi
9889                 fi
9890
9891                 if test "$cf_have_incdir" = no ; then
9892                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9893
9894 echo "${as_me:-configure}:9894: testing adding $cf_add_incdir to include-path ..." 1>&5
9895
9896                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9897
9898                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9899                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9900                   cf_add_incdir="$cf_top_incdir"
9901                 else
9902                   break
9903                 fi
9904           else
9905                 break
9906           fi
9907         done
9908   done
9909 fi
9910
9911 }
9912
9913 echo "$as_me:9913: checking for $cf_ncuhdr_root header in include-path" >&5
9914 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9915 if test "${cf_cv_ncurses_h+set}" = set; then
9916   echo $ECHO_N "(cached) $ECHO_C" >&6
9917 else
9918
9919         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9920         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9921         for cf_header in $cf_header_list
9922         do
9923
9924         cat >conftest.$ac_ext <<_ACEOF
9925 #line 9925 "configure"
9926 #include "confdefs.h"
9927
9928 #include <$cf_header>
9929 int
9930 main (void)
9931 {
9932
9933 #ifdef NCURSES_VERSION
9934
9935 printf("%s\n", NCURSES_VERSION);
9936 #else
9937 #ifdef __NCURSES_H
9938 printf("old\n");
9939 #else
9940         make an error
9941 #endif
9942 #endif
9943
9944   ;
9945   return 0;
9946 }
9947 _ACEOF
9948 rm -f conftest.$ac_objext
9949 if { (eval echo "$as_me:9949: \"$ac_compile\"") >&5
9950   (eval $ac_compile) 2>&5
9951   ac_status=$?
9952   echo "$as_me:9952: \$? = $ac_status" >&5
9953   (exit $ac_status); } &&
9954          { ac_try='test -s conftest.$ac_objext'
9955   { (eval echo "$as_me:9955: \"$ac_try\"") >&5
9956   (eval $ac_try) 2>&5
9957   ac_status=$?
9958   echo "$as_me:9958: \$? = $ac_status" >&5
9959   (exit $ac_status); }; }; then
9960   cf_cv_ncurses_h=$cf_header
9961
9962 else
9963   echo "$as_me: failed program was:" >&5
9964 cat conftest.$ac_ext >&5
9965 cf_cv_ncurses_h=no
9966 fi
9967 rm -f conftest.$ac_objext conftest.$ac_ext
9968
9969                 test "$cf_cv_ncurses_h" != no && break
9970         done
9971
9972 fi
9973 echo "$as_me:9973: result: $cf_cv_ncurses_h" >&5
9974 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9975
9976 if test "$cf_cv_ncurses_h" != no ; then
9977         cf_cv_ncurses_header=$cf_cv_ncurses_h
9978 else
9979
9980 echo "$as_me:9980: checking for $cf_ncuhdr_root include-path" >&5
9981 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9982 if test "${cf_cv_ncurses_h2+set}" = set; then
9983   echo $ECHO_N "(cached) $ECHO_C" >&6
9984 else
9985
9986         test -n "$verbose" && echo
9987
9988 cf_search=
9989
9990 # collect the current set of include-directories from compiler flags
9991 cf_header_path_list=""
9992 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9993         for cf_header_path in $CPPFLAGS $CFLAGS
9994         do
9995                 case $cf_header_path in
9996                 (-I*)
9997                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9998
9999 test "x$cf_header_path" != "xNONE" && \
10000 test -d "$cf_header_path" && \
10001  {
10002         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10003         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10004         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10005         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10006         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10007         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"
10008 }
10009
10010                         cf_header_path_list="$cf_header_path_list $cf_search"
10011                         ;;
10012                 esac
10013         done
10014 fi
10015
10016 # add the variations for the package we are looking for
10017
10018 cf_search=
10019
10020 test "x$prefix" != "xNONE" && \
10021 test -d "$prefix" && \
10022  {
10023         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10024         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10025         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10026         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10027         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10028         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10029 }
10030
10031 for cf_subdir_prefix in \
10032         /usr \
10033         /usr/local \
10034         /usr/pkg \
10035         /opt \
10036         /opt/local \
10037         $HOME
10038 do
10039
10040 test "x$cf_subdir_prefix" != "x$prefix" && \
10041 test -d "$cf_subdir_prefix" && \
10042 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10043         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10044         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10045         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10046         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10047         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10048         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"
10049 }
10050
10051 done
10052
10053 test "$includedir" != NONE && \
10054 test "$includedir" != "/usr/include" && \
10055 test -d "$includedir" && {
10056         test -d $includedir &&    cf_search="$cf_search $includedir"
10057         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10058 }
10059
10060 test "$oldincludedir" != NONE && \
10061 test "$oldincludedir" != "/usr/include" && \
10062 test -d "$oldincludedir" && {
10063         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10064         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10065 }
10066
10067 cf_search="$cf_search $cf_header_path_list"
10068
10069         test -n "$verbose" && echo search path $cf_search
10070         cf_save2_CPPFLAGS="$CPPFLAGS"
10071         for cf_incdir in $cf_search
10072         do
10073
10074 if test -n "$cf_incdir" ; then
10075   for cf_add_incdir in $cf_incdir
10076   do
10077         while test $cf_add_incdir != /usr/include
10078         do
10079           if test -d $cf_add_incdir
10080           then
10081                 cf_have_incdir=no
10082                 if test -n "$CFLAGS$CPPFLAGS" ; then
10083                   # a loop is needed to ensure we can add subdirs of existing dirs
10084                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10085                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10086                           cf_have_incdir=yes; break
10087                         fi
10088                   done
10089                 fi
10090
10091                 if test "$cf_have_incdir" = no ; then
10092                   if test "$cf_add_incdir" = /usr/local/include ; then
10093                         if test "$GCC" = yes
10094                         then
10095                           cf_save_CPPFLAGS=$CPPFLAGS
10096
10097         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10098         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10099
10100                           cat >conftest.$ac_ext <<_ACEOF
10101 #line 10101 "configure"
10102 #include "confdefs.h"
10103 #include <stdio.h>
10104 int
10105 main (void)
10106 {
10107 printf("Hello")
10108   ;
10109   return 0;
10110 }
10111 _ACEOF
10112 rm -f conftest.$ac_objext
10113 if { (eval echo "$as_me:10113: \"$ac_compile\"") >&5
10114   (eval $ac_compile) 2>&5
10115   ac_status=$?
10116   echo "$as_me:10116: \$? = $ac_status" >&5
10117   (exit $ac_status); } &&
10118          { ac_try='test -s conftest.$ac_objext'
10119   { (eval echo "$as_me:10119: \"$ac_try\"") >&5
10120   (eval $ac_try) 2>&5
10121   ac_status=$?
10122   echo "$as_me:10122: \$? = $ac_status" >&5
10123   (exit $ac_status); }; }; then
10124   :
10125 else
10126   echo "$as_me: failed program was:" >&5
10127 cat conftest.$ac_ext >&5
10128 cf_have_incdir=yes
10129 fi
10130 rm -f conftest.$ac_objext conftest.$ac_ext
10131                           CPPFLAGS=$cf_save_CPPFLAGS
10132                         fi
10133                   fi
10134                 fi
10135
10136                 if test "$cf_have_incdir" = no ; then
10137                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10138
10139 echo "${as_me:-configure}:10139: testing adding $cf_add_incdir to include-path ..." 1>&5
10140
10141                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10142
10143                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10144                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10145                   cf_add_incdir="$cf_top_incdir"
10146                 else
10147                   break
10148                 fi
10149           else
10150                 break
10151           fi
10152         done
10153   done
10154 fi
10155
10156                 for cf_header in \
10157                         ncurses.h \
10158                         curses.h
10159                 do
10160
10161         cat >conftest.$ac_ext <<_ACEOF
10162 #line 10162 "configure"
10163 #include "confdefs.h"
10164
10165 #include <$cf_header>
10166 int
10167 main (void)
10168 {
10169
10170 #ifdef NCURSES_VERSION
10171
10172 printf("%s\n", NCURSES_VERSION);
10173 #else
10174 #ifdef __NCURSES_H
10175 printf("old\n");
10176 #else
10177         make an error
10178 #endif
10179 #endif
10180
10181   ;
10182   return 0;
10183 }
10184 _ACEOF
10185 rm -f conftest.$ac_objext
10186 if { (eval echo "$as_me:10186: \"$ac_compile\"") >&5
10187   (eval $ac_compile) 2>&5
10188   ac_status=$?
10189   echo "$as_me:10189: \$? = $ac_status" >&5
10190   (exit $ac_status); } &&
10191          { ac_try='test -s conftest.$ac_objext'
10192   { (eval echo "$as_me:10192: \"$ac_try\"") >&5
10193   (eval $ac_try) 2>&5
10194   ac_status=$?
10195   echo "$as_me:10195: \$? = $ac_status" >&5
10196   (exit $ac_status); }; }; then
10197   cf_cv_ncurses_h2=$cf_header
10198
10199 else
10200   echo "$as_me: failed program was:" >&5
10201 cat conftest.$ac_ext >&5
10202 cf_cv_ncurses_h2=no
10203 fi
10204 rm -f conftest.$ac_objext conftest.$ac_ext
10205
10206                         if test "$cf_cv_ncurses_h2" != no ; then
10207                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10208                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10209                                 break
10210                         fi
10211                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10212                 done
10213                 CPPFLAGS="$cf_save2_CPPFLAGS"
10214                 test "$cf_cv_ncurses_h2" != no && break
10215         done
10216         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10216: error: not found" >&5
10217 echo "$as_me: error: not found" >&2;}
10218    { (exit 1); exit 1; }; }
10219
10220 fi
10221 echo "$as_me:10221: result: $cf_cv_ncurses_h2" >&5
10222 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10223
10224         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10225         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10226         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10227                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10228         fi
10229
10230 if test -n "$cf_1st_incdir" ; then
10231   for cf_add_incdir in $cf_1st_incdir
10232   do
10233         while test $cf_add_incdir != /usr/include
10234         do
10235           if test -d $cf_add_incdir
10236           then
10237                 cf_have_incdir=no
10238                 if test -n "$CFLAGS$CPPFLAGS" ; then
10239                   # a loop is needed to ensure we can add subdirs of existing dirs
10240                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10241                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10242                           cf_have_incdir=yes; break
10243                         fi
10244                   done
10245                 fi
10246
10247                 if test "$cf_have_incdir" = no ; then
10248                   if test "$cf_add_incdir" = /usr/local/include ; then
10249                         if test "$GCC" = yes
10250                         then
10251                           cf_save_CPPFLAGS=$CPPFLAGS
10252
10253         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10254         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10255
10256                           cat >conftest.$ac_ext <<_ACEOF
10257 #line 10257 "configure"
10258 #include "confdefs.h"
10259 #include <stdio.h>
10260 int
10261 main (void)
10262 {
10263 printf("Hello")
10264   ;
10265   return 0;
10266 }
10267 _ACEOF
10268 rm -f conftest.$ac_objext
10269 if { (eval echo "$as_me:10269: \"$ac_compile\"") >&5
10270   (eval $ac_compile) 2>&5
10271   ac_status=$?
10272   echo "$as_me:10272: \$? = $ac_status" >&5
10273   (exit $ac_status); } &&
10274          { ac_try='test -s conftest.$ac_objext'
10275   { (eval echo "$as_me:10275: \"$ac_try\"") >&5
10276   (eval $ac_try) 2>&5
10277   ac_status=$?
10278   echo "$as_me:10278: \$? = $ac_status" >&5
10279   (exit $ac_status); }; }; then
10280   :
10281 else
10282   echo "$as_me: failed program was:" >&5
10283 cat conftest.$ac_ext >&5
10284 cf_have_incdir=yes
10285 fi
10286 rm -f conftest.$ac_objext conftest.$ac_ext
10287                           CPPFLAGS=$cf_save_CPPFLAGS
10288                         fi
10289                   fi
10290                 fi
10291
10292                 if test "$cf_have_incdir" = no ; then
10293                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10294
10295 echo "${as_me:-configure}:10295: testing adding $cf_add_incdir to include-path ..." 1>&5
10296
10297                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10298
10299                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10300                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10301                   cf_add_incdir="$cf_top_incdir"
10302                 else
10303                   break
10304                 fi
10305           else
10306                 break
10307           fi
10308         done
10309   done
10310 fi
10311
10312 fi
10313
10314 # Set definitions to allow ifdef'ing for ncurses.h
10315
10316 case $cf_cv_ncurses_header in
10317 (*ncurses.h)
10318
10319 cat >>confdefs.h <<\EOF
10320 #define HAVE_NCURSES_H 1
10321 EOF
10322
10323         ;;
10324 esac
10325
10326 case $cf_cv_ncurses_header in
10327 (ncurses/curses.h|ncurses/ncurses.h)
10328
10329 cat >>confdefs.h <<\EOF
10330 #define HAVE_NCURSES_NCURSES_H 1
10331 EOF
10332
10333         ;;
10334 (ncursesw/curses.h|ncursesw/ncurses.h)
10335
10336 cat >>confdefs.h <<\EOF
10337 #define HAVE_NCURSESW_NCURSES_H 1
10338 EOF
10339
10340         ;;
10341 esac
10342
10343 echo "$as_me:10343: checking for terminfo header" >&5
10344 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10345 if test "${cf_cv_term_header+set}" = set; then
10346   echo $ECHO_N "(cached) $ECHO_C" >&6
10347 else
10348
10349 case ${cf_cv_ncurses_header} in
10350 (*/ncurses.h|*/ncursesw.h)
10351         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10352         ;;
10353 (*)
10354         cf_term_header=term.h
10355         ;;
10356 esac
10357
10358 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10359 do
10360 cat >conftest.$ac_ext <<_ACEOF
10361 #line 10361 "configure"
10362 #include "confdefs.h"
10363 #include <stdio.h>
10364 #include <${cf_cv_ncurses_header:-curses.h}>
10365 #include <$cf_test>
10366
10367 int
10368 main (void)
10369 {
10370 int x = auto_left_margin
10371   ;
10372   return 0;
10373 }
10374 _ACEOF
10375 rm -f conftest.$ac_objext
10376 if { (eval echo "$as_me:10376: \"$ac_compile\"") >&5
10377   (eval $ac_compile) 2>&5
10378   ac_status=$?
10379   echo "$as_me:10379: \$? = $ac_status" >&5
10380   (exit $ac_status); } &&
10381          { ac_try='test -s conftest.$ac_objext'
10382   { (eval echo "$as_me:10382: \"$ac_try\"") >&5
10383   (eval $ac_try) 2>&5
10384   ac_status=$?
10385   echo "$as_me:10385: \$? = $ac_status" >&5
10386   (exit $ac_status); }; }; then
10387
10388         cf_cv_term_header="$cf_test"
10389 else
10390   echo "$as_me: failed program was:" >&5
10391 cat conftest.$ac_ext >&5
10392
10393         cf_cv_term_header=unknown
10394
10395 fi
10396 rm -f conftest.$ac_objext conftest.$ac_ext
10397         test "$cf_cv_term_header" != unknown && break
10398 done
10399
10400 fi
10401 echo "$as_me:10401: result: $cf_cv_term_header" >&5
10402 echo "${ECHO_T}$cf_cv_term_header" >&6
10403
10404 # Set definitions to allow ifdef'ing to accommodate subdirectories
10405
10406 case $cf_cv_term_header in
10407 (*term.h)
10408
10409 cat >>confdefs.h <<\EOF
10410 #define HAVE_TERM_H 1
10411 EOF
10412
10413         ;;
10414 esac
10415
10416 case $cf_cv_term_header in
10417 (ncurses/term.h)
10418
10419 cat >>confdefs.h <<\EOF
10420 #define HAVE_NCURSES_TERM_H 1
10421 EOF
10422
10423         ;;
10424 (ncursesw/term.h)
10425
10426 cat >>confdefs.h <<\EOF
10427 #define HAVE_NCURSESW_TERM_H 1
10428 EOF
10429
10430         ;;
10431 esac
10432
10433 # some applications need this, but should check for NCURSES_VERSION
10434
10435 cat >>confdefs.h <<\EOF
10436 #define NCURSES 1
10437 EOF
10438
10439 echo "$as_me:10439: checking for ncurses version" >&5
10440 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10441 if test "${cf_cv_ncurses_version+set}" = set; then
10442   echo $ECHO_N "(cached) $ECHO_C" >&6
10443 else
10444
10445         cf_cv_ncurses_version=no
10446         cf_tempfile=out$$
10447         rm -f $cf_tempfile
10448         if test "$cross_compiling" = yes; then
10449
10450         # This will not work if the preprocessor splits the line after the
10451         # Autoconf token.  The 'unproto' program does that.
10452         cat > conftest.$ac_ext <<EOF
10453 #include <${cf_cv_ncurses_header:-curses.h}>
10454 #undef Autoconf
10455 #ifdef NCURSES_VERSION
10456 Autoconf NCURSES_VERSION
10457 #else
10458 #ifdef __NCURSES_H
10459 Autoconf "old"
10460 #endif
10461 ;
10462 #endif
10463 EOF
10464         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10465         { (eval echo "$as_me:10465: \"$cf_try\"") >&5
10466   (eval $cf_try) 2>&5
10467   ac_status=$?
10468   echo "$as_me:10468: \$? = $ac_status" >&5
10469   (exit $ac_status); }
10470         if test -f conftest.out ; then
10471                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10472                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10473                 rm -f conftest.out
10474         fi
10475
10476 else
10477   cat >conftest.$ac_ext <<_ACEOF
10478 #line 10478 "configure"
10479 #include "confdefs.h"
10480
10481 #include <${cf_cv_ncurses_header:-curses.h}>
10482 #include <stdio.h>
10483 int main(void)
10484 {
10485         FILE *fp = fopen("$cf_tempfile", "w");
10486 #ifdef NCURSES_VERSION
10487 # ifdef NCURSES_VERSION_PATCH
10488         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10489 # else
10490         fprintf(fp, "%s\n", NCURSES_VERSION);
10491 # endif
10492 #else
10493 # ifdef __NCURSES_H
10494         fprintf(fp, "old\n");
10495 # else
10496         make an error
10497 # endif
10498 #endif
10499         ${cf_cv_main_return:-return}(0);
10500 }
10501 _ACEOF
10502 rm -f conftest$ac_exeext
10503 if { (eval echo "$as_me:10503: \"$ac_link\"") >&5
10504   (eval $ac_link) 2>&5
10505   ac_status=$?
10506   echo "$as_me:10506: \$? = $ac_status" >&5
10507   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10508   { (eval echo "$as_me:10508: \"$ac_try\"") >&5
10509   (eval $ac_try) 2>&5
10510   ac_status=$?
10511   echo "$as_me:10511: \$? = $ac_status" >&5
10512   (exit $ac_status); }; }; then
10513
10514         cf_cv_ncurses_version=`cat $cf_tempfile`
10515 else
10516   echo "$as_me: program exited with status $ac_status" >&5
10517 echo "$as_me: failed program was:" >&5
10518 cat conftest.$ac_ext >&5
10519 fi
10520 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10521 fi
10522         rm -f $cf_tempfile
10523
10524 fi
10525 echo "$as_me:10525: result: $cf_cv_ncurses_version" >&5
10526 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10527 test "$cf_cv_ncurses_version" = no ||
10528 cat >>confdefs.h <<\EOF
10529 #define NCURSES 1
10530 EOF
10531
10532 cf_nculib_root=$cf_cv_screen
10533         # This works, except for the special case where we find gpm, but
10534         # ncurses is in a nonstandard location via $LIBS, and we really want
10535         # to link gpm.
10536 cf_ncurses_LIBS=""
10537 cf_ncurses_SAVE="$LIBS"
10538 echo "$as_me:10538: checking for Gpm_Open in -lgpm" >&5
10539 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10540 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10541   echo $ECHO_N "(cached) $ECHO_C" >&6
10542 else
10543   ac_check_lib_save_LIBS=$LIBS
10544 LIBS="-lgpm  $LIBS"
10545 cat >conftest.$ac_ext <<_ACEOF
10546 #line 10546 "configure"
10547 #include "confdefs.h"
10548
10549 /* Override any gcc2 internal prototype to avoid an error.  */
10550 #ifdef __cplusplus
10551 extern "C"
10552 #endif
10553 /* We use char because int might match the return type of a gcc2
10554    builtin and then its argument prototype would still apply.  */
10555 char Gpm_Open ();
10556 int
10557 main (void)
10558 {
10559 Gpm_Open ();
10560   ;
10561   return 0;
10562 }
10563 _ACEOF
10564 rm -f conftest.$ac_objext conftest$ac_exeext
10565 if { (eval echo "$as_me:10565: \"$ac_link\"") >&5
10566   (eval $ac_link) 2>&5
10567   ac_status=$?
10568   echo "$as_me:10568: \$? = $ac_status" >&5
10569   (exit $ac_status); } &&
10570          { ac_try='test -s conftest$ac_exeext'
10571   { (eval echo "$as_me:10571: \"$ac_try\"") >&5
10572   (eval $ac_try) 2>&5
10573   ac_status=$?
10574   echo "$as_me:10574: \$? = $ac_status" >&5
10575   (exit $ac_status); }; }; then
10576   ac_cv_lib_gpm_Gpm_Open=yes
10577 else
10578   echo "$as_me: failed program was:" >&5
10579 cat conftest.$ac_ext >&5
10580 ac_cv_lib_gpm_Gpm_Open=no
10581 fi
10582 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10583 LIBS=$ac_check_lib_save_LIBS
10584 fi
10585 echo "$as_me:10585: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10586 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10587 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10588   echo "$as_me:10588: checking for initscr in -lgpm" >&5
10589 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10590 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10591   echo $ECHO_N "(cached) $ECHO_C" >&6
10592 else
10593   ac_check_lib_save_LIBS=$LIBS
10594 LIBS="-lgpm  $LIBS"
10595 cat >conftest.$ac_ext <<_ACEOF
10596 #line 10596 "configure"
10597 #include "confdefs.h"
10598
10599 /* Override any gcc2 internal prototype to avoid an error.  */
10600 #ifdef __cplusplus
10601 extern "C"
10602 #endif
10603 /* We use char because int might match the return type of a gcc2
10604    builtin and then its argument prototype would still apply.  */
10605 char initscr ();
10606 int
10607 main (void)
10608 {
10609 initscr ();
10610   ;
10611   return 0;
10612 }
10613 _ACEOF
10614 rm -f conftest.$ac_objext conftest$ac_exeext
10615 if { (eval echo "$as_me:10615: \"$ac_link\"") >&5
10616   (eval $ac_link) 2>&5
10617   ac_status=$?
10618   echo "$as_me:10618: \$? = $ac_status" >&5
10619   (exit $ac_status); } &&
10620          { ac_try='test -s conftest$ac_exeext'
10621   { (eval echo "$as_me:10621: \"$ac_try\"") >&5
10622   (eval $ac_try) 2>&5
10623   ac_status=$?
10624   echo "$as_me:10624: \$? = $ac_status" >&5
10625   (exit $ac_status); }; }; then
10626   ac_cv_lib_gpm_initscr=yes
10627 else
10628   echo "$as_me: failed program was:" >&5
10629 cat conftest.$ac_ext >&5
10630 ac_cv_lib_gpm_initscr=no
10631 fi
10632 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10633 LIBS=$ac_check_lib_save_LIBS
10634 fi
10635 echo "$as_me:10635: result: $ac_cv_lib_gpm_initscr" >&5
10636 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10637 if test $ac_cv_lib_gpm_initscr = yes; then
10638   LIBS="$cf_ncurses_SAVE"
10639 else
10640   cf_ncurses_LIBS="-lgpm"
10641 fi
10642
10643 fi
10644
10645 case $host_os in
10646 (freebsd*)
10647         # This is only necessary if you are linking against an obsolete
10648         # version of ncurses (but it should do no harm, since it's static).
10649         if test "$cf_nculib_root" = ncurses ; then
10650                 echo "$as_me:10650: checking for tgoto in -lmytinfo" >&5
10651 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10652 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10653   echo $ECHO_N "(cached) $ECHO_C" >&6
10654 else
10655   ac_check_lib_save_LIBS=$LIBS
10656 LIBS="-lmytinfo  $LIBS"
10657 cat >conftest.$ac_ext <<_ACEOF
10658 #line 10658 "configure"
10659 #include "confdefs.h"
10660
10661 /* Override any gcc2 internal prototype to avoid an error.  */
10662 #ifdef __cplusplus
10663 extern "C"
10664 #endif
10665 /* We use char because int might match the return type of a gcc2
10666    builtin and then its argument prototype would still apply.  */
10667 char tgoto ();
10668 int
10669 main (void)
10670 {
10671 tgoto ();
10672   ;
10673   return 0;
10674 }
10675 _ACEOF
10676 rm -f conftest.$ac_objext conftest$ac_exeext
10677 if { (eval echo "$as_me:10677: \"$ac_link\"") >&5
10678   (eval $ac_link) 2>&5
10679   ac_status=$?
10680   echo "$as_me:10680: \$? = $ac_status" >&5
10681   (exit $ac_status); } &&
10682          { ac_try='test -s conftest$ac_exeext'
10683   { (eval echo "$as_me:10683: \"$ac_try\"") >&5
10684   (eval $ac_try) 2>&5
10685   ac_status=$?
10686   echo "$as_me:10686: \$? = $ac_status" >&5
10687   (exit $ac_status); }; }; then
10688   ac_cv_lib_mytinfo_tgoto=yes
10689 else
10690   echo "$as_me: failed program was:" >&5
10691 cat conftest.$ac_ext >&5
10692 ac_cv_lib_mytinfo_tgoto=no
10693 fi
10694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10695 LIBS=$ac_check_lib_save_LIBS
10696 fi
10697 echo "$as_me:10697: result: $ac_cv_lib_mytinfo_tgoto" >&5
10698 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10699 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10700   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10701 fi
10702
10703         fi
10704         ;;
10705 esac
10706
10707 cf_add_libs="$cf_ncurses_LIBS"
10708 # Filter out duplicates - this happens with badly-designed ".pc" files...
10709 for cf_add_1lib in $LIBS
10710 do
10711         for cf_add_2lib in $cf_add_libs
10712         do
10713                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10714                 then
10715                         cf_add_1lib=
10716                         break
10717                 fi
10718         done
10719         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10720 done
10721 LIBS="$cf_add_libs"
10722
10723 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10724 then
10725
10726 cf_add_libs="-l$cf_nculib_root"
10727 # Filter out duplicates - this happens with badly-designed ".pc" files...
10728 for cf_add_1lib in $LIBS
10729 do
10730         for cf_add_2lib in $cf_add_libs
10731         do
10732                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10733                 then
10734                         cf_add_1lib=
10735                         break
10736                 fi
10737         done
10738         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10739 done
10740 LIBS="$cf_add_libs"
10741
10742 else
10743
10744         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10745         cf_libdir=""
10746         echo "$as_me:10746: checking for initscr" >&5
10747 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10748 if test "${ac_cv_func_initscr+set}" = set; then
10749   echo $ECHO_N "(cached) $ECHO_C" >&6
10750 else
10751   cat >conftest.$ac_ext <<_ACEOF
10752 #line 10752 "configure"
10753 #include "confdefs.h"
10754 #define initscr autoconf_temporary
10755 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10756 #undef initscr
10757
10758 #ifdef __cplusplus
10759 extern "C"
10760 #endif
10761
10762 /* We use char because int might match the return type of a gcc2
10763    builtin and then its argument prototype would still apply.  */
10764 char initscr (void);
10765
10766 int
10767 main (void)
10768 {
10769
10770 /* The GNU C library defines stubs for functions which it implements
10771     to always fail with ENOSYS.  Some functions are actually named
10772     something starting with __ and the normal name is an alias.  */
10773 #if defined (__stub_initscr) || defined (__stub___initscr)
10774 #error found stub for initscr
10775 #endif
10776
10777         return initscr ();
10778   ;
10779   return 0;
10780 }
10781 _ACEOF
10782 rm -f conftest.$ac_objext conftest$ac_exeext
10783 if { (eval echo "$as_me:10783: \"$ac_link\"") >&5
10784   (eval $ac_link) 2>&5
10785   ac_status=$?
10786   echo "$as_me:10786: \$? = $ac_status" >&5
10787   (exit $ac_status); } &&
10788          { ac_try='test -s conftest$ac_exeext'
10789   { (eval echo "$as_me:10789: \"$ac_try\"") >&5
10790   (eval $ac_try) 2>&5
10791   ac_status=$?
10792   echo "$as_me:10792: \$? = $ac_status" >&5
10793   (exit $ac_status); }; }; then
10794   ac_cv_func_initscr=yes
10795 else
10796   echo "$as_me: failed program was:" >&5
10797 cat conftest.$ac_ext >&5
10798 ac_cv_func_initscr=no
10799 fi
10800 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10801 fi
10802 echo "$as_me:10802: result: $ac_cv_func_initscr" >&5
10803 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10804 if test $ac_cv_func_initscr = yes; then
10805   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10806 else
10807
10808                 cf_save_LIBS="$LIBS"
10809                 echo "$as_me:10809: checking for initscr in -l$cf_nculib_root" >&5
10810 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10811                 LIBS="-l$cf_nculib_root $LIBS"
10812                 cat >conftest.$ac_ext <<_ACEOF
10813 #line 10813 "configure"
10814 #include "confdefs.h"
10815 #include <${cf_cv_ncurses_header:-curses.h}>
10816 int
10817 main (void)
10818 {
10819 initscr()
10820   ;
10821   return 0;
10822 }
10823 _ACEOF
10824 rm -f conftest.$ac_objext conftest$ac_exeext
10825 if { (eval echo "$as_me:10825: \"$ac_link\"") >&5
10826   (eval $ac_link) 2>&5
10827   ac_status=$?
10828   echo "$as_me:10828: \$? = $ac_status" >&5
10829   (exit $ac_status); } &&
10830          { ac_try='test -s conftest$ac_exeext'
10831   { (eval echo "$as_me:10831: \"$ac_try\"") >&5
10832   (eval $ac_try) 2>&5
10833   ac_status=$?
10834   echo "$as_me:10834: \$? = $ac_status" >&5
10835   (exit $ac_status); }; }; then
10836   echo "$as_me:10836: result: yes" >&5
10837 echo "${ECHO_T}yes" >&6
10838                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10839
10840 else
10841   echo "$as_me: failed program was:" >&5
10842 cat conftest.$ac_ext >&5
10843 echo "$as_me:10843: result: no" >&5
10844 echo "${ECHO_T}no" >&6
10845
10846 cf_search=
10847 cf_library_path_list=""
10848 if test -n "${LDFLAGS}${LIBS}" ; then
10849         for cf_library_path in $LDFLAGS $LIBS
10850         do
10851                 case $cf_library_path in
10852                 (-L*)
10853                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10854
10855 test "x$cf_library_path" != "xNONE" && \
10856 test -d "$cf_library_path" && \
10857  {
10858         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10859         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10860         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10861         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10862         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10863         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"
10864 }
10865
10866                         cf_library_path_list="$cf_library_path_list $cf_search"
10867                         ;;
10868                 esac
10869         done
10870 fi
10871
10872 cf_search=
10873
10874 test "x$prefix" != "xNONE" && \
10875 test -d "$prefix" && \
10876  {
10877         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10878         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10879         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10880         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10881         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10882         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10883 }
10884
10885 for cf_subdir_prefix in \
10886         /usr \
10887         /usr/local \
10888         /usr/pkg \
10889         /opt \
10890         /opt/local \
10891         $HOME
10892 do
10893
10894 test "x$cf_subdir_prefix" != "x$prefix" && \
10895 test -d "$cf_subdir_prefix" && \
10896 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10897         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10898         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10899         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10900         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10901         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10902         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"
10903 }
10904
10905 done
10906
10907 cf_search="$cf_library_path_list $cf_search"
10908
10909                         for cf_libdir in $cf_search
10910                         do
10911                                 echo "$as_me:10911: checking for -l$cf_nculib_root in $cf_libdir" >&5
10912 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10913                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10914                                 cat >conftest.$ac_ext <<_ACEOF
10915 #line 10915 "configure"
10916 #include "confdefs.h"
10917 #include <${cf_cv_ncurses_header:-curses.h}>
10918 int
10919 main (void)
10920 {
10921 initscr()
10922   ;
10923   return 0;
10924 }
10925 _ACEOF
10926 rm -f conftest.$ac_objext conftest$ac_exeext
10927 if { (eval echo "$as_me:10927: \"$ac_link\"") >&5
10928   (eval $ac_link) 2>&5
10929   ac_status=$?
10930   echo "$as_me:10930: \$? = $ac_status" >&5
10931   (exit $ac_status); } &&
10932          { ac_try='test -s conftest$ac_exeext'
10933   { (eval echo "$as_me:10933: \"$ac_try\"") >&5
10934   (eval $ac_try) 2>&5
10935   ac_status=$?
10936   echo "$as_me:10936: \$? = $ac_status" >&5
10937   (exit $ac_status); }; }; then
10938   echo "$as_me:10938: result: yes" >&5
10939 echo "${ECHO_T}yes" >&6
10940                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10941                                          break
10942 else
10943   echo "$as_me: failed program was:" >&5
10944 cat conftest.$ac_ext >&5
10945 echo "$as_me:10945: result: no" >&5
10946 echo "${ECHO_T}no" >&6
10947                                          LIBS="$cf_save_LIBS"
10948 fi
10949 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10950                         done
10951
10952 fi
10953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10954
10955 fi
10956
10957 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10958
10959 if test $cf_found_library = no ; then
10960         { { echo "$as_me:10960: error: Cannot link $cf_nculib_root library" >&5
10961 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10962    { (exit 1); exit 1; }; }
10963 fi
10964
10965 fi
10966
10967 if test -n "$cf_ncurses_LIBS" ; then
10968         echo "$as_me:10968: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10969 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10970         cf_ncurses_SAVE="$LIBS"
10971         for p in $cf_ncurses_LIBS ; do
10972                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10973                 if test "$q" != "$LIBS" ; then
10974                         LIBS="$q"
10975                 fi
10976         done
10977         cat >conftest.$ac_ext <<_ACEOF
10978 #line 10978 "configure"
10979 #include "confdefs.h"
10980 #include <${cf_cv_ncurses_header:-curses.h}>
10981 int
10982 main (void)
10983 {
10984 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10985   ;
10986   return 0;
10987 }
10988 _ACEOF
10989 rm -f conftest.$ac_objext conftest$ac_exeext
10990 if { (eval echo "$as_me:10990: \"$ac_link\"") >&5
10991   (eval $ac_link) 2>&5
10992   ac_status=$?
10993   echo "$as_me:10993: \$? = $ac_status" >&5
10994   (exit $ac_status); } &&
10995          { ac_try='test -s conftest$ac_exeext'
10996   { (eval echo "$as_me:10996: \"$ac_try\"") >&5
10997   (eval $ac_try) 2>&5
10998   ac_status=$?
10999   echo "$as_me:10999: \$? = $ac_status" >&5
11000   (exit $ac_status); }; }; then
11001   echo "$as_me:11001: result: yes" >&5
11002 echo "${ECHO_T}yes" >&6
11003 else
11004   echo "$as_me: failed program was:" >&5
11005 cat conftest.$ac_ext >&5
11006 echo "$as_me:11006: result: no" >&5
11007 echo "${ECHO_T}no" >&6
11008                  LIBS="$cf_ncurses_SAVE"
11009 fi
11010 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11011 fi
11012
11013 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11014
11015 cat >>confdefs.h <<EOF
11016 #define $cf_nculib_ROOT 1
11017 EOF
11018
11019         fi
11020 else
11021         NCURSES_CONFIG=none
11022 fi
11023
11024         ;;
11025 (pdcurses)
11026         echo "$as_me:11026: checking for X" >&5
11027 echo $ECHO_N "checking for X... $ECHO_C" >&6
11028
11029 # Check whether --with-x or --without-x was given.
11030 if test "${with_x+set}" = set; then
11031   withval="$with_x"
11032
11033 fi;
11034 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11035 if test "x$with_x" = xno; then
11036   # The user explicitly disabled X.
11037   have_x=disabled
11038 else
11039   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11040     # Both variables are already set.
11041     have_x=yes
11042   else
11043     if test "${ac_cv_have_x+set}" = set; then
11044   echo $ECHO_N "(cached) $ECHO_C" >&6
11045 else
11046   # One or both of the vars are not set, and there is no cached value.
11047 ac_x_includes=no ac_x_libraries=no
11048 rm -fr conftest.dir
11049 if mkdir conftest.dir; then
11050   cd conftest.dir
11051   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11052   cat >Imakefile <<'EOF'
11053 acfindx:
11054         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11055 EOF
11056   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11057     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11058     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11059     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11060     for ac_extension in a so sl dylib dll; do
11061       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11062          test -f $ac_im_libdir/libX11.$ac_extension; then
11063         ac_im_usrlibdir=$ac_im_libdir; break
11064       fi
11065     done
11066     # Screen out bogus values from the imake configuration.  They are
11067     # bogus both because they are the default anyway, and because
11068     # using them would break gcc on systems where it needs fixed includes.
11069     case $ac_im_incroot in
11070         /usr/include) ;;
11071         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11072     esac
11073     case $ac_im_usrlibdir in
11074         /usr/lib | /lib) ;;
11075         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11076     esac
11077   fi
11078   cd ..
11079   rm -fr conftest.dir
11080 fi
11081
11082 # Standard set of common directories for X headers.
11083 # Check X11 before X11Rn because it is often a symlink to the current release.
11084 ac_x_header_dirs='
11085 /usr/X11/include
11086 /usr/X11R6/include
11087 /usr/X11R5/include
11088 /usr/X11R4/include
11089
11090 /usr/include/X11
11091 /usr/include/X11R6
11092 /usr/include/X11R5
11093 /usr/include/X11R4
11094
11095 /usr/local/X11/include
11096 /usr/local/X11R6/include
11097 /usr/local/X11R5/include
11098 /usr/local/X11R4/include
11099
11100 /usr/local/include/X11
11101 /usr/local/include/X11R6
11102 /usr/local/include/X11R5
11103 /usr/local/include/X11R4
11104
11105 /usr/X386/include
11106 /usr/x386/include
11107 /usr/XFree86/include/X11
11108
11109 /usr/include
11110 /usr/local/include
11111 /usr/unsupported/include
11112 /usr/athena/include
11113 /usr/local/x11r5/include
11114 /usr/lpp/Xamples/include
11115
11116 /usr/openwin/include
11117 /usr/openwin/share/include'
11118
11119 if test "$ac_x_includes" = no; then
11120   # Guess where to find include files, by looking for Intrinsic.h.
11121   # First, try using that file with no special directory specified.
11122   cat >conftest.$ac_ext <<_ACEOF
11123 #line 11123 "configure"
11124 #include "confdefs.h"
11125 #include <X11/Intrinsic.h>
11126 _ACEOF
11127 if { (eval echo "$as_me:11127: \"$ac_cpp conftest.$ac_ext\"") >&5
11128   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11129   ac_status=$?
11130   egrep -v '^ *\+' conftest.er1 >conftest.err
11131   rm -f conftest.er1
11132   cat conftest.err >&5
11133   echo "$as_me:11133: \$? = $ac_status" >&5
11134   (exit $ac_status); } >/dev/null; then
11135   if test -s conftest.err; then
11136     ac_cpp_err=$ac_c_preproc_warn_flag
11137   else
11138     ac_cpp_err=
11139   fi
11140 else
11141   ac_cpp_err=yes
11142 fi
11143 if test -z "$ac_cpp_err"; then
11144   # We can compile using X headers with no special include directory.
11145 ac_x_includes=
11146 else
11147   echo "$as_me: failed program was:" >&5
11148   cat conftest.$ac_ext >&5
11149   for ac_dir in $ac_x_header_dirs; do
11150   if test -r "$ac_dir/X11/Intrinsic.h"; then
11151     ac_x_includes=$ac_dir
11152     break
11153   fi
11154 done
11155 fi
11156 rm -f conftest.err conftest.$ac_ext
11157 fi # $ac_x_includes = no
11158
11159 if test "$ac_x_libraries" = no; then
11160   # Check for the libraries.
11161   # See if we find them without any special options.
11162   # Don't add to $LIBS permanently.
11163   ac_save_LIBS=$LIBS
11164   LIBS="-lXt $LIBS"
11165   cat >conftest.$ac_ext <<_ACEOF
11166 #line 11166 "configure"
11167 #include "confdefs.h"
11168 #include <X11/Intrinsic.h>
11169 int
11170 main (void)
11171 {
11172 XtMalloc (0)
11173   ;
11174   return 0;
11175 }
11176 _ACEOF
11177 rm -f conftest.$ac_objext conftest$ac_exeext
11178 if { (eval echo "$as_me:11178: \"$ac_link\"") >&5
11179   (eval $ac_link) 2>&5
11180   ac_status=$?
11181   echo "$as_me:11181: \$? = $ac_status" >&5
11182   (exit $ac_status); } &&
11183          { ac_try='test -s conftest$ac_exeext'
11184   { (eval echo "$as_me:11184: \"$ac_try\"") >&5
11185   (eval $ac_try) 2>&5
11186   ac_status=$?
11187   echo "$as_me:11187: \$? = $ac_status" >&5
11188   (exit $ac_status); }; }; then
11189   LIBS=$ac_save_LIBS
11190 # We can link X programs with no special library path.
11191 ac_x_libraries=
11192 else
11193   echo "$as_me: failed program was:" >&5
11194 cat conftest.$ac_ext >&5
11195 LIBS=$ac_save_LIBS
11196 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11197 do
11198   # Don't even attempt the hair of trying to link an X program!
11199   for ac_extension in a so sl dylib dll; do
11200     if test -r $ac_dir/libXt.$ac_extension; then
11201       ac_x_libraries=$ac_dir
11202       break 2
11203     fi
11204   done
11205 done
11206 fi
11207 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11208 fi # $ac_x_libraries = no
11209
11210 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11211   # Didn't find X anywhere.  Cache the known absence of X.
11212   ac_cv_have_x="have_x=no"
11213 else
11214   # Record where we found X for the cache.
11215   ac_cv_have_x="have_x=yes \
11216                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11217 fi
11218 fi
11219
11220   fi
11221   eval "$ac_cv_have_x"
11222 fi # $with_x != no
11223
11224 if test "$have_x" != yes; then
11225   echo "$as_me:11225: result: $have_x" >&5
11226 echo "${ECHO_T}$have_x" >&6
11227   no_x=yes
11228 else
11229   # If each of the values was on the command line, it overrides each guess.
11230   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11231   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11232   # Update the cache value to reflect the command line values.
11233   ac_cv_have_x="have_x=yes \
11234                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11235   echo "$as_me:11235: result: libraries $x_libraries, headers $x_includes" >&5
11236 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11237 fi
11238
11239 if test "$no_x" = yes; then
11240   # Not all programs may use this symbol, but it does not hurt to define it.
11241
11242 cat >>confdefs.h <<\EOF
11243 #define X_DISPLAY_MISSING 1
11244 EOF
11245
11246   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11247 else
11248   if test -n "$x_includes"; then
11249     X_CFLAGS="$X_CFLAGS -I$x_includes"
11250   fi
11251
11252   # It would also be nice to do this for all -L options, not just this one.
11253   if test -n "$x_libraries"; then
11254     X_LIBS="$X_LIBS -L$x_libraries"
11255     # For Solaris; some versions of Sun CC require a space after -R and
11256     # others require no space.  Words are not sufficient . . . .
11257     case `(uname -sr) 2>/dev/null` in
11258     "SunOS 5"*)
11259       echo "$as_me:11259: checking whether -R must be followed by a space" >&5
11260 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11261       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11262       cat >conftest.$ac_ext <<_ACEOF
11263 #line 11263 "configure"
11264 #include "confdefs.h"
11265
11266 int
11267 main (void)
11268 {
11269
11270   ;
11271   return 0;
11272 }
11273 _ACEOF
11274 rm -f conftest.$ac_objext conftest$ac_exeext
11275 if { (eval echo "$as_me:11275: \"$ac_link\"") >&5
11276   (eval $ac_link) 2>&5
11277   ac_status=$?
11278   echo "$as_me:11278: \$? = $ac_status" >&5
11279   (exit $ac_status); } &&
11280          { ac_try='test -s conftest$ac_exeext'
11281   { (eval echo "$as_me:11281: \"$ac_try\"") >&5
11282   (eval $ac_try) 2>&5
11283   ac_status=$?
11284   echo "$as_me:11284: \$? = $ac_status" >&5
11285   (exit $ac_status); }; }; then
11286   ac_R_nospace=yes
11287 else
11288   echo "$as_me: failed program was:" >&5
11289 cat conftest.$ac_ext >&5
11290 ac_R_nospace=no
11291 fi
11292 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11293       if test $ac_R_nospace = yes; then
11294         echo "$as_me:11294: result: no" >&5
11295 echo "${ECHO_T}no" >&6
11296         X_LIBS="$X_LIBS -R$x_libraries"
11297       else
11298         LIBS="$ac_xsave_LIBS -R $x_libraries"
11299         cat >conftest.$ac_ext <<_ACEOF
11300 #line 11300 "configure"
11301 #include "confdefs.h"
11302
11303 int
11304 main (void)
11305 {
11306
11307   ;
11308   return 0;
11309 }
11310 _ACEOF
11311 rm -f conftest.$ac_objext conftest$ac_exeext
11312 if { (eval echo "$as_me:11312: \"$ac_link\"") >&5
11313   (eval $ac_link) 2>&5
11314   ac_status=$?
11315   echo "$as_me:11315: \$? = $ac_status" >&5
11316   (exit $ac_status); } &&
11317          { ac_try='test -s conftest$ac_exeext'
11318   { (eval echo "$as_me:11318: \"$ac_try\"") >&5
11319   (eval $ac_try) 2>&5
11320   ac_status=$?
11321   echo "$as_me:11321: \$? = $ac_status" >&5
11322   (exit $ac_status); }; }; then
11323   ac_R_space=yes
11324 else
11325   echo "$as_me: failed program was:" >&5
11326 cat conftest.$ac_ext >&5
11327 ac_R_space=no
11328 fi
11329 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11330         if test $ac_R_space = yes; then
11331           echo "$as_me:11331: result: yes" >&5
11332 echo "${ECHO_T}yes" >&6
11333           X_LIBS="$X_LIBS -R $x_libraries"
11334         else
11335           echo "$as_me:11335: result: neither works" >&5
11336 echo "${ECHO_T}neither works" >&6
11337         fi
11338       fi
11339       LIBS=$ac_xsave_LIBS
11340     esac
11341   fi
11342
11343   # Check for system-dependent libraries X programs must link with.
11344   # Do this before checking for the system-independent R6 libraries
11345   # (-lICE), since we may need -lsocket or whatever for X linking.
11346
11347   if test "$ISC" = yes; then
11348     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11349   else
11350     # Martyn Johnson says this is needed for Ultrix, if the X
11351     # libraries were built with DECnet support.  And Karl Berry says
11352     # the Alpha needs dnet_stub (dnet does not exist).
11353     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11354     cat >conftest.$ac_ext <<_ACEOF
11355 #line 11355 "configure"
11356 #include "confdefs.h"
11357
11358 /* Override any gcc2 internal prototype to avoid an error.  */
11359 #ifdef __cplusplus
11360 extern "C"
11361 #endif
11362 /* We use char because int might match the return type of a gcc2
11363    builtin and then its argument prototype would still apply.  */
11364 char XOpenDisplay ();
11365 int
11366 main (void)
11367 {
11368 XOpenDisplay ();
11369   ;
11370   return 0;
11371 }
11372 _ACEOF
11373 rm -f conftest.$ac_objext conftest$ac_exeext
11374 if { (eval echo "$as_me:11374: \"$ac_link\"") >&5
11375   (eval $ac_link) 2>&5
11376   ac_status=$?
11377   echo "$as_me:11377: \$? = $ac_status" >&5
11378   (exit $ac_status); } &&
11379          { ac_try='test -s conftest$ac_exeext'
11380   { (eval echo "$as_me:11380: \"$ac_try\"") >&5
11381   (eval $ac_try) 2>&5
11382   ac_status=$?
11383   echo "$as_me:11383: \$? = $ac_status" >&5
11384   (exit $ac_status); }; }; then
11385   :
11386 else
11387   echo "$as_me: failed program was:" >&5
11388 cat conftest.$ac_ext >&5
11389 echo "$as_me:11389: checking for dnet_ntoa in -ldnet" >&5
11390 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11391 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11392   echo $ECHO_N "(cached) $ECHO_C" >&6
11393 else
11394   ac_check_lib_save_LIBS=$LIBS
11395 LIBS="-ldnet  $LIBS"
11396 cat >conftest.$ac_ext <<_ACEOF
11397 #line 11397 "configure"
11398 #include "confdefs.h"
11399
11400 /* Override any gcc2 internal prototype to avoid an error.  */
11401 #ifdef __cplusplus
11402 extern "C"
11403 #endif
11404 /* We use char because int might match the return type of a gcc2
11405    builtin and then its argument prototype would still apply.  */
11406 char dnet_ntoa ();
11407 int
11408 main (void)
11409 {
11410 dnet_ntoa ();
11411   ;
11412   return 0;
11413 }
11414 _ACEOF
11415 rm -f conftest.$ac_objext conftest$ac_exeext
11416 if { (eval echo "$as_me:11416: \"$ac_link\"") >&5
11417   (eval $ac_link) 2>&5
11418   ac_status=$?
11419   echo "$as_me:11419: \$? = $ac_status" >&5
11420   (exit $ac_status); } &&
11421          { ac_try='test -s conftest$ac_exeext'
11422   { (eval echo "$as_me:11422: \"$ac_try\"") >&5
11423   (eval $ac_try) 2>&5
11424   ac_status=$?
11425   echo "$as_me:11425: \$? = $ac_status" >&5
11426   (exit $ac_status); }; }; then
11427   ac_cv_lib_dnet_dnet_ntoa=yes
11428 else
11429   echo "$as_me: failed program was:" >&5
11430 cat conftest.$ac_ext >&5
11431 ac_cv_lib_dnet_dnet_ntoa=no
11432 fi
11433 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11434 LIBS=$ac_check_lib_save_LIBS
11435 fi
11436 echo "$as_me:11436: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
11437 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
11438 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
11439   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
11440 fi
11441
11442     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
11443       echo "$as_me:11443: checking for dnet_ntoa in -ldnet_stub" >&5
11444 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
11445 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
11446   echo $ECHO_N "(cached) $ECHO_C" >&6
11447 else
11448   ac_check_lib_save_LIBS=$LIBS
11449 LIBS="-ldnet_stub  $LIBS"
11450 cat >conftest.$ac_ext <<_ACEOF
11451 #line 11451 "configure"
11452 #include "confdefs.h"
11453
11454 /* Override any gcc2 internal prototype to avoid an error.  */
11455 #ifdef __cplusplus
11456 extern "C"
11457 #endif
11458 /* We use char because int might match the return type of a gcc2
11459    builtin and then its argument prototype would still apply.  */
11460 char dnet_ntoa ();
11461 int
11462 main (void)
11463 {
11464 dnet_ntoa ();
11465   ;
11466   return 0;
11467 }
11468 _ACEOF
11469 rm -f conftest.$ac_objext conftest$ac_exeext
11470 if { (eval echo "$as_me:11470: \"$ac_link\"") >&5
11471   (eval $ac_link) 2>&5
11472   ac_status=$?
11473   echo "$as_me:11473: \$? = $ac_status" >&5
11474   (exit $ac_status); } &&
11475          { ac_try='test -s conftest$ac_exeext'
11476   { (eval echo "$as_me:11476: \"$ac_try\"") >&5
11477   (eval $ac_try) 2>&5
11478   ac_status=$?
11479   echo "$as_me:11479: \$? = $ac_status" >&5
11480   (exit $ac_status); }; }; then
11481   ac_cv_lib_dnet_stub_dnet_ntoa=yes
11482 else
11483   echo "$as_me: failed program was:" >&5
11484 cat conftest.$ac_ext >&5
11485 ac_cv_lib_dnet_stub_dnet_ntoa=no
11486 fi
11487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11488 LIBS=$ac_check_lib_save_LIBS
11489 fi
11490 echo "$as_me:11490: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
11491 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
11492 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
11493   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
11494 fi
11495
11496     fi
11497 fi
11498 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11499     LIBS="$ac_xsave_LIBS"
11500
11501     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
11502     # to get the SysV transport functions.
11503     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
11504     # needs -lnsl.
11505     # The nsl library prevents programs from opening the X display
11506     # on Irix 5.2, according to T.E. Dickey.
11507     # The functions gethostbyname, getservbyname, and inet_addr are
11508     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
11509     echo "$as_me:11509: checking for gethostbyname" >&5
11510 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
11511 if test "${ac_cv_func_gethostbyname+set}" = set; then
11512   echo $ECHO_N "(cached) $ECHO_C" >&6
11513 else
11514   cat >conftest.$ac_ext <<_ACEOF
11515 #line 11515 "configure"
11516 #include "confdefs.h"
11517 #define gethostbyname autoconf_temporary
11518 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11519 #undef gethostbyname
11520
11521 #ifdef __cplusplus
11522 extern "C"
11523 #endif
11524
11525 /* We use char because int might match the return type of a gcc2
11526    builtin and then its argument prototype would still apply.  */
11527 char gethostbyname (void);
11528
11529 int
11530 main (void)
11531 {
11532
11533 /* The GNU C library defines stubs for functions which it implements
11534     to always fail with ENOSYS.  Some functions are actually named
11535     something starting with __ and the normal name is an alias.  */
11536 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
11537 #error found stub for gethostbyname
11538 #endif
11539
11540         return gethostbyname ();
11541   ;
11542   return 0;
11543 }
11544 _ACEOF
11545 rm -f conftest.$ac_objext conftest$ac_exeext
11546 if { (eval echo "$as_me:11546: \"$ac_link\"") >&5
11547   (eval $ac_link) 2>&5
11548   ac_status=$?
11549   echo "$as_me:11549: \$? = $ac_status" >&5
11550   (exit $ac_status); } &&
11551          { ac_try='test -s conftest$ac_exeext'
11552   { (eval echo "$as_me:11552: \"$ac_try\"") >&5
11553   (eval $ac_try) 2>&5
11554   ac_status=$?
11555   echo "$as_me:11555: \$? = $ac_status" >&5
11556   (exit $ac_status); }; }; then
11557   ac_cv_func_gethostbyname=yes
11558 else
11559   echo "$as_me: failed program was:" >&5
11560 cat conftest.$ac_ext >&5
11561 ac_cv_func_gethostbyname=no
11562 fi
11563 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11564 fi
11565 echo "$as_me:11565: result: $ac_cv_func_gethostbyname" >&5
11566 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
11567
11568     if test $ac_cv_func_gethostbyname = no; then
11569       echo "$as_me:11569: checking for gethostbyname in -lnsl" >&5
11570 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
11571 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
11572   echo $ECHO_N "(cached) $ECHO_C" >&6
11573 else
11574   ac_check_lib_save_LIBS=$LIBS
11575 LIBS="-lnsl  $LIBS"
11576 cat >conftest.$ac_ext <<_ACEOF
11577 #line 11577 "configure"
11578 #include "confdefs.h"
11579
11580 /* Override any gcc2 internal prototype to avoid an error.  */
11581 #ifdef __cplusplus
11582 extern "C"
11583 #endif
11584 /* We use char because int might match the return type of a gcc2
11585    builtin and then its argument prototype would still apply.  */
11586 char gethostbyname ();
11587 int
11588 main (void)
11589 {
11590 gethostbyname ();
11591   ;
11592   return 0;
11593 }
11594 _ACEOF
11595 rm -f conftest.$ac_objext conftest$ac_exeext
11596 if { (eval echo "$as_me:11596: \"$ac_link\"") >&5
11597   (eval $ac_link) 2>&5
11598   ac_status=$?
11599   echo "$as_me:11599: \$? = $ac_status" >&5
11600   (exit $ac_status); } &&
11601          { ac_try='test -s conftest$ac_exeext'
11602   { (eval echo "$as_me:11602: \"$ac_try\"") >&5
11603   (eval $ac_try) 2>&5
11604   ac_status=$?
11605   echo "$as_me:11605: \$? = $ac_status" >&5
11606   (exit $ac_status); }; }; then
11607   ac_cv_lib_nsl_gethostbyname=yes
11608 else
11609   echo "$as_me: failed program was:" >&5
11610 cat conftest.$ac_ext >&5
11611 ac_cv_lib_nsl_gethostbyname=no
11612 fi
11613 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11614 LIBS=$ac_check_lib_save_LIBS
11615 fi
11616 echo "$as_me:11616: result: $ac_cv_lib_nsl_gethostbyname" >&5
11617 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
11618 if test $ac_cv_lib_nsl_gethostbyname = yes; then
11619   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
11620 fi
11621
11622       if test $ac_cv_lib_nsl_gethostbyname = no; then
11623         echo "$as_me:11623: checking for gethostbyname in -lbsd" >&5
11624 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
11625 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
11626   echo $ECHO_N "(cached) $ECHO_C" >&6
11627 else
11628   ac_check_lib_save_LIBS=$LIBS
11629 LIBS="-lbsd  $LIBS"
11630 cat >conftest.$ac_ext <<_ACEOF
11631 #line 11631 "configure"
11632 #include "confdefs.h"
11633
11634 /* Override any gcc2 internal prototype to avoid an error.  */
11635 #ifdef __cplusplus
11636 extern "C"
11637 #endif
11638 /* We use char because int might match the return type of a gcc2
11639    builtin and then its argument prototype would still apply.  */
11640 char gethostbyname ();
11641 int
11642 main (void)
11643 {
11644 gethostbyname ();
11645   ;
11646   return 0;
11647 }
11648 _ACEOF
11649 rm -f conftest.$ac_objext conftest$ac_exeext
11650 if { (eval echo "$as_me:11650: \"$ac_link\"") >&5
11651   (eval $ac_link) 2>&5
11652   ac_status=$?
11653   echo "$as_me:11653: \$? = $ac_status" >&5
11654   (exit $ac_status); } &&
11655          { ac_try='test -s conftest$ac_exeext'
11656   { (eval echo "$as_me:11656: \"$ac_try\"") >&5
11657   (eval $ac_try) 2>&5
11658   ac_status=$?
11659   echo "$as_me:11659: \$? = $ac_status" >&5
11660   (exit $ac_status); }; }; then
11661   ac_cv_lib_bsd_gethostbyname=yes
11662 else
11663   echo "$as_me: failed program was:" >&5
11664 cat conftest.$ac_ext >&5
11665 ac_cv_lib_bsd_gethostbyname=no
11666 fi
11667 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11668 LIBS=$ac_check_lib_save_LIBS
11669 fi
11670 echo "$as_me:11670: result: $ac_cv_lib_bsd_gethostbyname" >&5
11671 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
11672 if test $ac_cv_lib_bsd_gethostbyname = yes; then
11673   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
11674 fi
11675
11676       fi
11677     fi
11678
11679     # lieder@skyler.mavd.honeywell.com says without -lsocket,
11680     # socket/setsockopt and other routines are undefined under SCO ODT
11681     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
11682     # on later versions), says Simon Leinen: it contains gethostby*
11683     # variants that don't use the nameserver (or something).  -lsocket
11684     # must be given before -lnsl if both are needed.  We assume that
11685     # if connect needs -lnsl, so does gethostbyname.
11686     echo "$as_me:11686: checking for connect" >&5
11687 echo $ECHO_N "checking for connect... $ECHO_C" >&6
11688 if test "${ac_cv_func_connect+set}" = set; then
11689   echo $ECHO_N "(cached) $ECHO_C" >&6
11690 else
11691   cat >conftest.$ac_ext <<_ACEOF
11692 #line 11692 "configure"
11693 #include "confdefs.h"
11694 #define connect autoconf_temporary
11695 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11696 #undef connect
11697
11698 #ifdef __cplusplus
11699 extern "C"
11700 #endif
11701
11702 /* We use char because int might match the return type of a gcc2
11703    builtin and then its argument prototype would still apply.  */
11704 char connect (void);
11705
11706 int
11707 main (void)
11708 {
11709
11710 /* The GNU C library defines stubs for functions which it implements
11711     to always fail with ENOSYS.  Some functions are actually named
11712     something starting with __ and the normal name is an alias.  */
11713 #if defined (__stub_connect) || defined (__stub___connect)
11714 #error found stub for connect
11715 #endif
11716
11717         return connect ();
11718   ;
11719   return 0;
11720 }
11721 _ACEOF
11722 rm -f conftest.$ac_objext conftest$ac_exeext
11723 if { (eval echo "$as_me:11723: \"$ac_link\"") >&5
11724   (eval $ac_link) 2>&5
11725   ac_status=$?
11726   echo "$as_me:11726: \$? = $ac_status" >&5
11727   (exit $ac_status); } &&
11728          { ac_try='test -s conftest$ac_exeext'
11729   { (eval echo "$as_me:11729: \"$ac_try\"") >&5
11730   (eval $ac_try) 2>&5
11731   ac_status=$?
11732   echo "$as_me:11732: \$? = $ac_status" >&5
11733   (exit $ac_status); }; }; then
11734   ac_cv_func_connect=yes
11735 else
11736   echo "$as_me: failed program was:" >&5
11737 cat conftest.$ac_ext >&5
11738 ac_cv_func_connect=no
11739 fi
11740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11741 fi
11742 echo "$as_me:11742: result: $ac_cv_func_connect" >&5
11743 echo "${ECHO_T}$ac_cv_func_connect" >&6
11744
11745     if test $ac_cv_func_connect = no; then
11746       echo "$as_me:11746: checking for connect in -lsocket" >&5
11747 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
11748 if test "${ac_cv_lib_socket_connect+set}" = set; then
11749   echo $ECHO_N "(cached) $ECHO_C" >&6
11750 else
11751   ac_check_lib_save_LIBS=$LIBS
11752 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
11753 cat >conftest.$ac_ext <<_ACEOF
11754 #line 11754 "configure"
11755 #include "confdefs.h"
11756
11757 /* Override any gcc2 internal prototype to avoid an error.  */
11758 #ifdef __cplusplus
11759 extern "C"
11760 #endif
11761 /* We use char because int might match the return type of a gcc2
11762    builtin and then its argument prototype would still apply.  */
11763 char connect ();
11764 int
11765 main (void)
11766 {
11767 connect ();
11768   ;
11769   return 0;
11770 }
11771 _ACEOF
11772 rm -f conftest.$ac_objext conftest$ac_exeext
11773 if { (eval echo "$as_me:11773: \"$ac_link\"") >&5
11774   (eval $ac_link) 2>&5
11775   ac_status=$?
11776   echo "$as_me:11776: \$? = $ac_status" >&5
11777   (exit $ac_status); } &&
11778          { ac_try='test -s conftest$ac_exeext'
11779   { (eval echo "$as_me:11779: \"$ac_try\"") >&5
11780   (eval $ac_try) 2>&5
11781   ac_status=$?
11782   echo "$as_me:11782: \$? = $ac_status" >&5
11783   (exit $ac_status); }; }; then
11784   ac_cv_lib_socket_connect=yes
11785 else
11786   echo "$as_me: failed program was:" >&5
11787 cat conftest.$ac_ext >&5
11788 ac_cv_lib_socket_connect=no
11789 fi
11790 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11791 LIBS=$ac_check_lib_save_LIBS
11792 fi
11793 echo "$as_me:11793: result: $ac_cv_lib_socket_connect" >&5
11794 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
11795 if test $ac_cv_lib_socket_connect = yes; then
11796   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
11797 fi
11798
11799     fi
11800
11801     # Guillermo Gomez says -lposix is necessary on A/UX.
11802     echo "$as_me:11802: checking for remove" >&5
11803 echo $ECHO_N "checking for remove... $ECHO_C" >&6
11804 if test "${ac_cv_func_remove+set}" = set; then
11805   echo $ECHO_N "(cached) $ECHO_C" >&6
11806 else
11807   cat >conftest.$ac_ext <<_ACEOF
11808 #line 11808 "configure"
11809 #include "confdefs.h"
11810 #define remove autoconf_temporary
11811 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11812 #undef remove
11813
11814 #ifdef __cplusplus
11815 extern "C"
11816 #endif
11817
11818 /* We use char because int might match the return type of a gcc2
11819    builtin and then its argument prototype would still apply.  */
11820 char remove (void);
11821
11822 int
11823 main (void)
11824 {
11825
11826 /* The GNU C library defines stubs for functions which it implements
11827     to always fail with ENOSYS.  Some functions are actually named
11828     something starting with __ and the normal name is an alias.  */
11829 #if defined (__stub_remove) || defined (__stub___remove)
11830 #error found stub for remove
11831 #endif
11832
11833         return remove ();
11834   ;
11835   return 0;
11836 }
11837 _ACEOF
11838 rm -f conftest.$ac_objext conftest$ac_exeext
11839 if { (eval echo "$as_me:11839: \"$ac_link\"") >&5
11840   (eval $ac_link) 2>&5
11841   ac_status=$?
11842   echo "$as_me:11842: \$? = $ac_status" >&5
11843   (exit $ac_status); } &&
11844          { ac_try='test -s conftest$ac_exeext'
11845   { (eval echo "$as_me:11845: \"$ac_try\"") >&5
11846   (eval $ac_try) 2>&5
11847   ac_status=$?
11848   echo "$as_me:11848: \$? = $ac_status" >&5
11849   (exit $ac_status); }; }; then
11850   ac_cv_func_remove=yes
11851 else
11852   echo "$as_me: failed program was:" >&5
11853 cat conftest.$ac_ext >&5
11854 ac_cv_func_remove=no
11855 fi
11856 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11857 fi
11858 echo "$as_me:11858: result: $ac_cv_func_remove" >&5
11859 echo "${ECHO_T}$ac_cv_func_remove" >&6
11860
11861     if test $ac_cv_func_remove = no; then
11862       echo "$as_me:11862: checking for remove in -lposix" >&5
11863 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
11864 if test "${ac_cv_lib_posix_remove+set}" = set; then
11865   echo $ECHO_N "(cached) $ECHO_C" >&6
11866 else
11867   ac_check_lib_save_LIBS=$LIBS
11868 LIBS="-lposix  $LIBS"
11869 cat >conftest.$ac_ext <<_ACEOF
11870 #line 11870 "configure"
11871 #include "confdefs.h"
11872
11873 /* Override any gcc2 internal prototype to avoid an error.  */
11874 #ifdef __cplusplus
11875 extern "C"
11876 #endif
11877 /* We use char because int might match the return type of a gcc2
11878    builtin and then its argument prototype would still apply.  */
11879 char remove ();
11880 int
11881 main (void)
11882 {
11883 remove ();
11884   ;
11885   return 0;
11886 }
11887 _ACEOF
11888 rm -f conftest.$ac_objext conftest$ac_exeext
11889 if { (eval echo "$as_me:11889: \"$ac_link\"") >&5
11890   (eval $ac_link) 2>&5
11891   ac_status=$?
11892   echo "$as_me:11892: \$? = $ac_status" >&5
11893   (exit $ac_status); } &&
11894          { ac_try='test -s conftest$ac_exeext'
11895   { (eval echo "$as_me:11895: \"$ac_try\"") >&5
11896   (eval $ac_try) 2>&5
11897   ac_status=$?
11898   echo "$as_me:11898: \$? = $ac_status" >&5
11899   (exit $ac_status); }; }; then
11900   ac_cv_lib_posix_remove=yes
11901 else
11902   echo "$as_me: failed program was:" >&5
11903 cat conftest.$ac_ext >&5
11904 ac_cv_lib_posix_remove=no
11905 fi
11906 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11907 LIBS=$ac_check_lib_save_LIBS
11908 fi
11909 echo "$as_me:11909: result: $ac_cv_lib_posix_remove" >&5
11910 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
11911 if test $ac_cv_lib_posix_remove = yes; then
11912   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
11913 fi
11914
11915     fi
11916
11917     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
11918     echo "$as_me:11918: checking for shmat" >&5
11919 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
11920 if test "${ac_cv_func_shmat+set}" = set; then
11921   echo $ECHO_N "(cached) $ECHO_C" >&6
11922 else
11923   cat >conftest.$ac_ext <<_ACEOF
11924 #line 11924 "configure"
11925 #include "confdefs.h"
11926 #define shmat autoconf_temporary
11927 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11928 #undef shmat
11929
11930 #ifdef __cplusplus
11931 extern "C"
11932 #endif
11933
11934 /* We use char because int might match the return type of a gcc2
11935    builtin and then its argument prototype would still apply.  */
11936 char shmat (void);
11937
11938 int
11939 main (void)
11940 {
11941
11942 /* The GNU C library defines stubs for functions which it implements
11943     to always fail with ENOSYS.  Some functions are actually named
11944     something starting with __ and the normal name is an alias.  */
11945 #if defined (__stub_shmat) || defined (__stub___shmat)
11946 #error found stub for shmat
11947 #endif
11948
11949         return shmat ();
11950   ;
11951   return 0;
11952 }
11953 _ACEOF
11954 rm -f conftest.$ac_objext conftest$ac_exeext
11955 if { (eval echo "$as_me:11955: \"$ac_link\"") >&5
11956   (eval $ac_link) 2>&5
11957   ac_status=$?
11958   echo "$as_me:11958: \$? = $ac_status" >&5
11959   (exit $ac_status); } &&
11960          { ac_try='test -s conftest$ac_exeext'
11961   { (eval echo "$as_me:11961: \"$ac_try\"") >&5
11962   (eval $ac_try) 2>&5
11963   ac_status=$?
11964   echo "$as_me:11964: \$? = $ac_status" >&5
11965   (exit $ac_status); }; }; then
11966   ac_cv_func_shmat=yes
11967 else
11968   echo "$as_me: failed program was:" >&5
11969 cat conftest.$ac_ext >&5
11970 ac_cv_func_shmat=no
11971 fi
11972 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11973 fi
11974 echo "$as_me:11974: result: $ac_cv_func_shmat" >&5
11975 echo "${ECHO_T}$ac_cv_func_shmat" >&6
11976
11977     if test $ac_cv_func_shmat = no; then
11978       echo "$as_me:11978: checking for shmat in -lipc" >&5
11979 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
11980 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
11981   echo $ECHO_N "(cached) $ECHO_C" >&6
11982 else
11983   ac_check_lib_save_LIBS=$LIBS
11984 LIBS="-lipc  $LIBS"
11985 cat >conftest.$ac_ext <<_ACEOF
11986 #line 11986 "configure"
11987 #include "confdefs.h"
11988
11989 /* Override any gcc2 internal prototype to avoid an error.  */
11990 #ifdef __cplusplus
11991 extern "C"
11992 #endif
11993 /* We use char because int might match the return type of a gcc2
11994    builtin and then its argument prototype would still apply.  */
11995 char shmat ();
11996 int
11997 main (void)
11998 {
11999 shmat ();
12000   ;
12001   return 0;
12002 }
12003 _ACEOF
12004 rm -f conftest.$ac_objext conftest$ac_exeext
12005 if { (eval echo "$as_me:12005: \"$ac_link\"") >&5
12006   (eval $ac_link) 2>&5
12007   ac_status=$?
12008   echo "$as_me:12008: \$? = $ac_status" >&5
12009   (exit $ac_status); } &&
12010          { ac_try='test -s conftest$ac_exeext'
12011   { (eval echo "$as_me:12011: \"$ac_try\"") >&5
12012   (eval $ac_try) 2>&5
12013   ac_status=$?
12014   echo "$as_me:12014: \$? = $ac_status" >&5
12015   (exit $ac_status); }; }; then
12016   ac_cv_lib_ipc_shmat=yes
12017 else
12018   echo "$as_me: failed program was:" >&5
12019 cat conftest.$ac_ext >&5
12020 ac_cv_lib_ipc_shmat=no
12021 fi
12022 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12023 LIBS=$ac_check_lib_save_LIBS
12024 fi
12025 echo "$as_me:12025: result: $ac_cv_lib_ipc_shmat" >&5
12026 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12027 if test $ac_cv_lib_ipc_shmat = yes; then
12028   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12029 fi
12030
12031     fi
12032   fi
12033
12034   # Check for libraries that X11R6 Xt/Xaw programs need.
12035   ac_save_LDFLAGS=$LDFLAGS
12036   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12037   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12038   # check for ICE first), but we must link in the order -lSM -lICE or
12039   # we get undefined symbols.  So assume we have SM if we have ICE.
12040   # These have to be linked with before -lX11, unlike the other
12041   # libraries we check for below, so use a different variable.
12042   # John Interrante, Karl Berry
12043   echo "$as_me:12043: checking for IceConnectionNumber in -lICE" >&5
12044 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12045 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12046   echo $ECHO_N "(cached) $ECHO_C" >&6
12047 else
12048   ac_check_lib_save_LIBS=$LIBS
12049 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12050 cat >conftest.$ac_ext <<_ACEOF
12051 #line 12051 "configure"
12052 #include "confdefs.h"
12053
12054 /* Override any gcc2 internal prototype to avoid an error.  */
12055 #ifdef __cplusplus
12056 extern "C"
12057 #endif
12058 /* We use char because int might match the return type of a gcc2
12059    builtin and then its argument prototype would still apply.  */
12060 char IceConnectionNumber ();
12061 int
12062 main (void)
12063 {
12064 IceConnectionNumber ();
12065   ;
12066   return 0;
12067 }
12068 _ACEOF
12069 rm -f conftest.$ac_objext conftest$ac_exeext
12070 if { (eval echo "$as_me:12070: \"$ac_link\"") >&5
12071   (eval $ac_link) 2>&5
12072   ac_status=$?
12073   echo "$as_me:12073: \$? = $ac_status" >&5
12074   (exit $ac_status); } &&
12075          { ac_try='test -s conftest$ac_exeext'
12076   { (eval echo "$as_me:12076: \"$ac_try\"") >&5
12077   (eval $ac_try) 2>&5
12078   ac_status=$?
12079   echo "$as_me:12079: \$? = $ac_status" >&5
12080   (exit $ac_status); }; }; then
12081   ac_cv_lib_ICE_IceConnectionNumber=yes
12082 else
12083   echo "$as_me: failed program was:" >&5
12084 cat conftest.$ac_ext >&5
12085 ac_cv_lib_ICE_IceConnectionNumber=no
12086 fi
12087 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12088 LIBS=$ac_check_lib_save_LIBS
12089 fi
12090 echo "$as_me:12090: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12091 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12092 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12093   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12094 fi
12095
12096   LDFLAGS=$ac_save_LDFLAGS
12097
12098 fi
12099
12100 cf_x_athena=${cf_x_athena:-Xaw}
12101
12102 echo "$as_me:12102: checking if you want to link with Xaw 3d library" >&5
12103 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12104 withval=
12105
12106 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12107 if test "${with_Xaw3d+set}" = set; then
12108   withval="$with_Xaw3d"
12109
12110 fi;
12111 if test "$withval" = yes ; then
12112         cf_x_athena=Xaw3d
12113         echo "$as_me:12113: result: yes" >&5
12114 echo "${ECHO_T}yes" >&6
12115 else
12116         echo "$as_me:12116: result: no" >&5
12117 echo "${ECHO_T}no" >&6
12118 fi
12119
12120 echo "$as_me:12120: checking if you want to link with Xaw 3d xft library" >&5
12121 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12122 withval=
12123
12124 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12125 if test "${with_Xaw3dxft+set}" = set; then
12126   withval="$with_Xaw3dxft"
12127
12128 fi;
12129 if test "$withval" = yes ; then
12130         cf_x_athena=Xaw3dxft
12131         echo "$as_me:12131: result: yes" >&5
12132 echo "${ECHO_T}yes" >&6
12133 else
12134         echo "$as_me:12134: result: no" >&5
12135 echo "${ECHO_T}no" >&6
12136 fi
12137
12138 echo "$as_me:12138: checking if you want to link with neXT Athena library" >&5
12139 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12140 withval=
12141
12142 # Check whether --with-neXtaw or --without-neXtaw was given.
12143 if test "${with_neXtaw+set}" = set; then
12144   withval="$with_neXtaw"
12145
12146 fi;
12147 if test "$withval" = yes ; then
12148         cf_x_athena=neXtaw
12149         echo "$as_me:12149: result: yes" >&5
12150 echo "${ECHO_T}yes" >&6
12151 else
12152         echo "$as_me:12152: result: no" >&5
12153 echo "${ECHO_T}no" >&6
12154 fi
12155
12156 echo "$as_me:12156: checking if you want to link with Athena-Plus library" >&5
12157 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12158 withval=
12159
12160 # Check whether --with-XawPlus or --without-XawPlus was given.
12161 if test "${with_XawPlus+set}" = set; then
12162   withval="$with_XawPlus"
12163
12164 fi;
12165 if test "$withval" = yes ; then
12166         cf_x_athena=XawPlus
12167         echo "$as_me:12167: result: yes" >&5
12168 echo "${ECHO_T}yes" >&6
12169 else
12170         echo "$as_me:12170: result: no" >&5
12171 echo "${ECHO_T}no" >&6
12172 fi
12173
12174 cf_x_athena_lib=""
12175
12176 if test "$PKG_CONFIG" != none ; then
12177         cf_athena_list=
12178         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12179         for cf_athena_pkg in \
12180                 $cf_athena_list \
12181                 ${cf_x_athena} \
12182                 ${cf_x_athena}-devel \
12183                 lib${cf_x_athena} \
12184                 lib${cf_x_athena}-devel
12185         do
12186
12187 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12188         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12189
12190 echo "${as_me:-configure}:12190: testing found package $cf_athena_pkg ..." 1>&5
12191
12192         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12193         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12194         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12195
12196 echo "${as_me:-configure}:12196: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12197
12198         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12199
12200 echo "${as_me:-configure}:12200: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12201
12202 cf_fix_cppflags=no
12203 cf_new_cflags=
12204 cf_new_cppflags=
12205 cf_new_extra_cppflags=
12206
12207 for cf_add_cflags in $cf_pkgconfig_incs
12208 do
12209 case $cf_fix_cppflags in
12210 (no)
12211         case $cf_add_cflags in
12212         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12213                 case $cf_add_cflags in
12214                 (-D*)
12215                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12216
12217                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12218                                 && test -z "${cf_tst_cflags}" \
12219                                 && cf_fix_cppflags=yes
12220
12221                         if test $cf_fix_cppflags = yes ; then
12222
12223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12225
12226                                 continue
12227                         elif test "${cf_tst_cflags}" = "\"'" ; then
12228
12229         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12230         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12231
12232                                 continue
12233                         fi
12234                         ;;
12235                 esac
12236                 case "$CPPFLAGS" in
12237                 (*$cf_add_cflags)
12238                         ;;
12239                 (*)
12240                         case $cf_add_cflags in
12241                         (-D*)
12242                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12243
12244 CPPFLAGS=`echo "$CPPFLAGS" | \
12245         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12246                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12247
12248                                 ;;
12249                         esac
12250
12251         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12252         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12253
12254                         ;;
12255                 esac
12256                 ;;
12257         (*)
12258
12259         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12260         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12261
12262                 ;;
12263         esac
12264         ;;
12265 (yes)
12266
12267         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12268         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12269
12270         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12271
12272         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12273                 && test -z "${cf_tst_cflags}" \
12274                 && cf_fix_cppflags=no
12275         ;;
12276 esac
12277 done
12278
12279 if test -n "$cf_new_cflags" ; then
12280
12281         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12282         CFLAGS="${CFLAGS}$cf_new_cflags"
12283
12284 fi
12285
12286 if test -n "$cf_new_cppflags" ; then
12287
12288         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12289         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12290
12291 fi
12292
12293 if test -n "$cf_new_extra_cppflags" ; then
12294
12295         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12296         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12297
12298 fi
12299
12300 cf_add_libs="$cf_pkgconfig_libs"
12301 # Filter out duplicates - this happens with badly-designed ".pc" files...
12302 for cf_add_1lib in $LIBS
12303 do
12304         for cf_add_2lib in $cf_add_libs
12305         do
12306                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12307                 then
12308                         cf_add_1lib=
12309                         break
12310                 fi
12311         done
12312         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12313 done
12314 LIBS="$cf_add_libs"
12315
12316                         cf_x_athena_lib="$cf_pkgconfig_libs"
12317
12318 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12319
12320                         cat >>confdefs.h <<EOF
12321 #define $cf_x_athena_LIBS 1
12322 EOF
12323
12324         for cf_trim_lib in Xmu Xt X11
12325         do
12326                 case "$LIBS" in
12327                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12328                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12329                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12330
12331 echo "${as_me:-configure}:12331: testing ..trimmed $LIBS ..." 1>&5
12332
12333                         ;;
12334                 esac
12335         done
12336
12337 echo "$as_me:12337: checking for usable $cf_x_athena/Xmu package" >&5
12338 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12339 if test "${cf_cv_xaw_compat+set}" = set; then
12340   echo $ECHO_N "(cached) $ECHO_C" >&6
12341 else
12342
12343 cat >conftest.$ac_ext <<_ACEOF
12344 #line 12344 "configure"
12345 #include "confdefs.h"
12346
12347 #include <X11/Xmu/CharSet.h>
12348
12349 int
12350 main (void)
12351 {
12352
12353 int check = XmuCompareISOLatin1("big", "small")
12354
12355   ;
12356   return 0;
12357 }
12358 _ACEOF
12359 rm -f conftest.$ac_objext conftest$ac_exeext
12360 if { (eval echo "$as_me:12360: \"$ac_link\"") >&5
12361   (eval $ac_link) 2>&5
12362   ac_status=$?
12363   echo "$as_me:12363: \$? = $ac_status" >&5
12364   (exit $ac_status); } &&
12365          { ac_try='test -s conftest$ac_exeext'
12366   { (eval echo "$as_me:12366: \"$ac_try\"") >&5
12367   (eval $ac_try) 2>&5
12368   ac_status=$?
12369   echo "$as_me:12369: \$? = $ac_status" >&5
12370   (exit $ac_status); }; }; then
12371   cf_cv_xaw_compat=yes
12372 else
12373   echo "$as_me: failed program was:" >&5
12374 cat conftest.$ac_ext >&5
12375 cf_cv_xaw_compat=no
12376 fi
12377 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12378 fi
12379 echo "$as_me:12379: result: $cf_cv_xaw_compat" >&5
12380 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12381
12382                         if test "$cf_cv_xaw_compat" = no
12383                         then
12384                                 # workaround for broken ".pc" files...
12385                                 case "$cf_x_athena_lib" in
12386                                 (*-lXmu*)
12387                                         ;;
12388                                 (*)
12389                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12390
12391 echo "${as_me:-configure}:12391: testing work around broken package ..." 1>&5
12392
12393                                         cf_save_xmu="$LIBS"
12394                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12395
12396 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12397         test -n "$verbose" && echo "    found package xmu" 1>&6
12398
12399 echo "${as_me:-configure}:12399: testing found package xmu ..." 1>&5
12400
12401         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12402         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12403         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12404
12405 echo "${as_me:-configure}:12405: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12406
12407         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12408
12409 echo "${as_me:-configure}:12409: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12410
12411 cf_fix_cppflags=no
12412 cf_new_cflags=
12413 cf_new_cppflags=
12414 cf_new_extra_cppflags=
12415
12416 for cf_add_cflags in $cf_pkgconfig_incs
12417 do
12418 case $cf_fix_cppflags in
12419 (no)
12420         case $cf_add_cflags in
12421         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12422                 case $cf_add_cflags in
12423                 (-D*)
12424                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12425
12426                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12427                                 && test -z "${cf_tst_cflags}" \
12428                                 && cf_fix_cppflags=yes
12429
12430                         if test $cf_fix_cppflags = yes ; then
12431
12432         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12433         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12434
12435                                 continue
12436                         elif test "${cf_tst_cflags}" = "\"'" ; then
12437
12438         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12439         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12440
12441                                 continue
12442                         fi
12443                         ;;
12444                 esac
12445                 case "$CPPFLAGS" in
12446                 (*$cf_add_cflags)
12447                         ;;
12448                 (*)
12449                         case $cf_add_cflags in
12450                         (-D*)
12451                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12452
12453 CPPFLAGS=`echo "$CPPFLAGS" | \
12454         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12455                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12456
12457                                 ;;
12458                         esac
12459
12460         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12461         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12462
12463                         ;;
12464                 esac
12465                 ;;
12466         (*)
12467
12468         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12469         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12470
12471                 ;;
12472         esac
12473         ;;
12474 (yes)
12475
12476         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12477         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12478
12479         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12480
12481         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12482                 && test -z "${cf_tst_cflags}" \
12483                 && cf_fix_cppflags=no
12484         ;;
12485 esac
12486 done
12487
12488 if test -n "$cf_new_cflags" ; then
12489
12490         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12491         CFLAGS="${CFLAGS}$cf_new_cflags"
12492
12493 fi
12494
12495 if test -n "$cf_new_cppflags" ; then
12496
12497         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12498         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12499
12500 fi
12501
12502 if test -n "$cf_new_extra_cppflags" ; then
12503
12504         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12505         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12506
12507 fi
12508
12509 cf_add_libs="$cf_pkgconfig_libs"
12510 # Filter out duplicates - this happens with badly-designed ".pc" files...
12511 for cf_add_1lib in $LIBS
12512 do
12513         for cf_add_2lib in $cf_add_libs
12514         do
12515                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12516                 then
12517                         cf_add_1lib=
12518                         break
12519                 fi
12520         done
12521         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12522 done
12523 LIBS="$cf_add_libs"
12524
12525                                                         LIBS="$cf_save_xmu"
12526
12527 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12528
12529 echo "${as_me:-configure}:12529: testing ...before $LIBS ..." 1>&5
12530
12531 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
12532 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12533
12534 echo "${as_me:-configure}:12534: testing ...after  $LIBS ..." 1>&5
12535
12536 else
12537         cf_pkgconfig_incs=
12538         cf_pkgconfig_libs=
12539
12540 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12541
12542 echo "${as_me:-configure}:12542: testing ...before $LIBS ..." 1>&5
12543
12544 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
12545 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12546
12547 echo "${as_me:-configure}:12547: testing ...after  $LIBS ..." 1>&5
12548
12549 fi
12550
12551         for cf_trim_lib in Xmu Xt X11
12552         do
12553                 case "$LIBS" in
12554                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12555                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12556                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12557
12558 echo "${as_me:-configure}:12558: testing ..trimmed $LIBS ..." 1>&5
12559
12560                         ;;
12561                 esac
12562         done
12563
12564                                         ;;
12565                                 esac
12566                         fi
12567
12568                         break
12569 else
12570         cf_pkgconfig_incs=
12571         cf_pkgconfig_libs=
12572         :
12573 fi
12574
12575         done
12576 fi
12577
12578 if test -z "$cf_x_athena_lib" ; then
12579
12580 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
12581         test -n "$verbose" && echo "    found package Xext" 1>&6
12582
12583 echo "${as_me:-configure}:12583: testing found package Xext ..." 1>&5
12584
12585         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
12586         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
12587         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
12588
12589 echo "${as_me:-configure}:12589: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12590
12591         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
12592
12593 echo "${as_me:-configure}:12593: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
12594
12595 cf_fix_cppflags=no
12596 cf_new_cflags=
12597 cf_new_cppflags=
12598 cf_new_extra_cppflags=
12599
12600 for cf_add_cflags in $cf_pkgconfig_incs
12601 do
12602 case $cf_fix_cppflags in
12603 (no)
12604         case $cf_add_cflags in
12605         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12606                 case $cf_add_cflags in
12607                 (-D*)
12608                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12609
12610                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12611                                 && test -z "${cf_tst_cflags}" \
12612                                 && cf_fix_cppflags=yes
12613
12614                         if test $cf_fix_cppflags = yes ; then
12615
12616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12618
12619                                 continue
12620                         elif test "${cf_tst_cflags}" = "\"'" ; then
12621
12622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12624
12625                                 continue
12626                         fi
12627                         ;;
12628                 esac
12629                 case "$CPPFLAGS" in
12630                 (*$cf_add_cflags)
12631                         ;;
12632                 (*)
12633                         case $cf_add_cflags in
12634                         (-D*)
12635                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12636
12637 CPPFLAGS=`echo "$CPPFLAGS" | \
12638         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12639                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12640
12641                                 ;;
12642                         esac
12643
12644         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12645         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12646
12647                         ;;
12648                 esac
12649                 ;;
12650         (*)
12651
12652         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12653         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12654
12655                 ;;
12656         esac
12657         ;;
12658 (yes)
12659
12660         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12661         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12662
12663         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12664
12665         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12666                 && test -z "${cf_tst_cflags}" \
12667                 && cf_fix_cppflags=no
12668         ;;
12669 esac
12670 done
12671
12672 if test -n "$cf_new_cflags" ; then
12673
12674         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12675         CFLAGS="${CFLAGS}$cf_new_cflags"
12676
12677 fi
12678
12679 if test -n "$cf_new_cppflags" ; then
12680
12681         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12682         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12683
12684 fi
12685
12686 if test -n "$cf_new_extra_cppflags" ; then
12687
12688         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12689         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12690
12691 fi
12692
12693 cf_add_libs="$cf_pkgconfig_libs"
12694 # Filter out duplicates - this happens with badly-designed ".pc" files...
12695 for cf_add_1lib in $LIBS
12696 do
12697         for cf_add_2lib in $cf_add_libs
12698         do
12699                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12700                 then
12701                         cf_add_1lib=
12702                         break
12703                 fi
12704         done
12705         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12706 done
12707 LIBS="$cf_add_libs"
12708
12709         :
12710 else
12711         cf_pkgconfig_incs=
12712         cf_pkgconfig_libs=
12713
12714         echo "$as_me:12714: checking for XextCreateExtension in -lXext" >&5
12715 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
12716 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
12717   echo $ECHO_N "(cached) $ECHO_C" >&6
12718 else
12719   ac_check_lib_save_LIBS=$LIBS
12720 LIBS="-lXext  $LIBS"
12721 cat >conftest.$ac_ext <<_ACEOF
12722 #line 12722 "configure"
12723 #include "confdefs.h"
12724
12725 /* Override any gcc2 internal prototype to avoid an error.  */
12726 #ifdef __cplusplus
12727 extern "C"
12728 #endif
12729 /* We use char because int might match the return type of a gcc2
12730    builtin and then its argument prototype would still apply.  */
12731 char XextCreateExtension ();
12732 int
12733 main (void)
12734 {
12735 XextCreateExtension ();
12736   ;
12737   return 0;
12738 }
12739 _ACEOF
12740 rm -f conftest.$ac_objext conftest$ac_exeext
12741 if { (eval echo "$as_me:12741: \"$ac_link\"") >&5
12742   (eval $ac_link) 2>&5
12743   ac_status=$?
12744   echo "$as_me:12744: \$? = $ac_status" >&5
12745   (exit $ac_status); } &&
12746          { ac_try='test -s conftest$ac_exeext'
12747   { (eval echo "$as_me:12747: \"$ac_try\"") >&5
12748   (eval $ac_try) 2>&5
12749   ac_status=$?
12750   echo "$as_me:12750: \$? = $ac_status" >&5
12751   (exit $ac_status); }; }; then
12752   ac_cv_lib_Xext_XextCreateExtension=yes
12753 else
12754   echo "$as_me: failed program was:" >&5
12755 cat conftest.$ac_ext >&5
12756 ac_cv_lib_Xext_XextCreateExtension=no
12757 fi
12758 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12759 LIBS=$ac_check_lib_save_LIBS
12760 fi
12761 echo "$as_me:12761: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
12762 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
12763 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
12764
12765 cf_add_libs="-lXext"
12766 # Filter out duplicates - this happens with badly-designed ".pc" files...
12767 for cf_add_1lib in $LIBS
12768 do
12769         for cf_add_2lib in $cf_add_libs
12770         do
12771                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12772                 then
12773                         cf_add_1lib=
12774                         break
12775                 fi
12776         done
12777         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12778 done
12779 LIBS="$cf_add_libs"
12780
12781 fi
12782
12783 fi
12784
12785 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
12786 # in some cases has installed dummy files in the former, other cases replaced
12787 # it with a link to the new location).  This complicates the configure script.
12788 # Check for that pitfall, and recover using pkg-config
12789 #
12790 # If none of these are set, the configuration is almost certainly broken.
12791 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
12792 then
12793
12794 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12795         test -n "$verbose" && echo "    found package x11" 1>&6
12796
12797 echo "${as_me:-configure}:12797: testing found package x11 ..." 1>&5
12798
12799         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12800         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12801         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12802
12803 echo "${as_me:-configure}:12803: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12804
12805         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12806
12807 echo "${as_me:-configure}:12807: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12808
12809 cf_fix_cppflags=no
12810 cf_new_cflags=
12811 cf_new_cppflags=
12812 cf_new_extra_cppflags=
12813
12814 for cf_add_cflags in $cf_pkgconfig_incs
12815 do
12816 case $cf_fix_cppflags in
12817 (no)
12818         case $cf_add_cflags in
12819         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12820                 case $cf_add_cflags in
12821                 (-D*)
12822                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12823
12824                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12825                                 && test -z "${cf_tst_cflags}" \
12826                                 && cf_fix_cppflags=yes
12827
12828                         if test $cf_fix_cppflags = yes ; then
12829
12830         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12831         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12832
12833                                 continue
12834                         elif test "${cf_tst_cflags}" = "\"'" ; then
12835
12836         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12837         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12838
12839                                 continue
12840                         fi
12841                         ;;
12842                 esac
12843                 case "$CPPFLAGS" in
12844                 (*$cf_add_cflags)
12845                         ;;
12846                 (*)
12847                         case $cf_add_cflags in
12848                         (-D*)
12849                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12850
12851 CPPFLAGS=`echo "$CPPFLAGS" | \
12852         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12853                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12854
12855                                 ;;
12856                         esac
12857
12858         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12859         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12860
12861                         ;;
12862                 esac
12863                 ;;
12864         (*)
12865
12866         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12867         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12868
12869                 ;;
12870         esac
12871         ;;
12872 (yes)
12873
12874         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12875         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12876
12877         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12878
12879         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12880                 && test -z "${cf_tst_cflags}" \
12881                 && cf_fix_cppflags=no
12882         ;;
12883 esac
12884 done
12885
12886 if test -n "$cf_new_cflags" ; then
12887
12888         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12889         CFLAGS="${CFLAGS}$cf_new_cflags"
12890
12891 fi
12892
12893 if test -n "$cf_new_cppflags" ; then
12894
12895         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12896         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12897
12898 fi
12899
12900 if test -n "$cf_new_extra_cppflags" ; then
12901
12902         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12903         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12904
12905 fi
12906
12907 cf_add_libs="$cf_pkgconfig_libs"
12908 # Filter out duplicates - this happens with badly-designed ".pc" files...
12909 for cf_add_1lib in $LIBS
12910 do
12911         for cf_add_2lib in $cf_add_libs
12912         do
12913                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12914                 then
12915                         cf_add_1lib=
12916                         break
12917                 fi
12918         done
12919         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12920 done
12921 LIBS="$cf_add_libs"
12922
12923         :
12924 else
12925         cf_pkgconfig_incs=
12926         cf_pkgconfig_libs=
12927         { echo "$as_me:12927: WARNING: unable to find X11 library" >&5
12928 echo "$as_me: WARNING: unable to find X11 library" >&2;}
12929 fi
12930
12931 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12932         test -n "$verbose" && echo "    found package ice" 1>&6
12933
12934 echo "${as_me:-configure}:12934: testing found package ice ..." 1>&5
12935
12936         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12937         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12938         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12939
12940 echo "${as_me:-configure}:12940: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12941
12942         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12943
12944 echo "${as_me:-configure}:12944: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12945
12946 cf_fix_cppflags=no
12947 cf_new_cflags=
12948 cf_new_cppflags=
12949 cf_new_extra_cppflags=
12950
12951 for cf_add_cflags in $cf_pkgconfig_incs
12952 do
12953 case $cf_fix_cppflags in
12954 (no)
12955         case $cf_add_cflags in
12956         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12957                 case $cf_add_cflags in
12958                 (-D*)
12959                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12960
12961                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12962                                 && test -z "${cf_tst_cflags}" \
12963                                 && cf_fix_cppflags=yes
12964
12965                         if test $cf_fix_cppflags = yes ; then
12966
12967         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12968         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12969
12970                                 continue
12971                         elif test "${cf_tst_cflags}" = "\"'" ; then
12972
12973         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12974         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12975
12976                                 continue
12977                         fi
12978                         ;;
12979                 esac
12980                 case "$CPPFLAGS" in
12981                 (*$cf_add_cflags)
12982                         ;;
12983                 (*)
12984                         case $cf_add_cflags in
12985                         (-D*)
12986                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12987
12988 CPPFLAGS=`echo "$CPPFLAGS" | \
12989         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12990                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12991
12992                                 ;;
12993                         esac
12994
12995         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12996         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12997
12998                         ;;
12999                 esac
13000                 ;;
13001         (*)
13002
13003         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13004         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13005
13006                 ;;
13007         esac
13008         ;;
13009 (yes)
13010
13011         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13012         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13013
13014         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13015
13016         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13017                 && test -z "${cf_tst_cflags}" \
13018                 && cf_fix_cppflags=no
13019         ;;
13020 esac
13021 done
13022
13023 if test -n "$cf_new_cflags" ; then
13024
13025         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13026         CFLAGS="${CFLAGS}$cf_new_cflags"
13027
13028 fi
13029
13030 if test -n "$cf_new_cppflags" ; then
13031
13032         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13033         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13034
13035 fi
13036
13037 if test -n "$cf_new_extra_cppflags" ; then
13038
13039         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13040         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13041
13042 fi
13043
13044 cf_add_libs="$cf_pkgconfig_libs"
13045 # Filter out duplicates - this happens with badly-designed ".pc" files...
13046 for cf_add_1lib in $LIBS
13047 do
13048         for cf_add_2lib in $cf_add_libs
13049         do
13050                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13051                 then
13052                         cf_add_1lib=
13053                         break
13054                 fi
13055         done
13056         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13057 done
13058 LIBS="$cf_add_libs"
13059
13060         :
13061 else
13062         cf_pkgconfig_incs=
13063         cf_pkgconfig_libs=
13064         { echo "$as_me:13064: WARNING: unable to find ICE library" >&5
13065 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13066 fi
13067
13068 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13069         test -n "$verbose" && echo "    found package sm" 1>&6
13070
13071 echo "${as_me:-configure}:13071: testing found package sm ..." 1>&5
13072
13073         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13074         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13075         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13076
13077 echo "${as_me:-configure}:13077: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13078
13079         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13080
13081 echo "${as_me:-configure}:13081: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13082
13083 cf_fix_cppflags=no
13084 cf_new_cflags=
13085 cf_new_cppflags=
13086 cf_new_extra_cppflags=
13087
13088 for cf_add_cflags in $cf_pkgconfig_incs
13089 do
13090 case $cf_fix_cppflags in
13091 (no)
13092         case $cf_add_cflags in
13093         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13094                 case $cf_add_cflags in
13095                 (-D*)
13096                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13097
13098                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13099                                 && test -z "${cf_tst_cflags}" \
13100                                 && cf_fix_cppflags=yes
13101
13102                         if test $cf_fix_cppflags = yes ; then
13103
13104         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13105         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13106
13107                                 continue
13108                         elif test "${cf_tst_cflags}" = "\"'" ; then
13109
13110         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13111         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13112
13113                                 continue
13114                         fi
13115                         ;;
13116                 esac
13117                 case "$CPPFLAGS" in
13118                 (*$cf_add_cflags)
13119                         ;;
13120                 (*)
13121                         case $cf_add_cflags in
13122                         (-D*)
13123                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13124
13125 CPPFLAGS=`echo "$CPPFLAGS" | \
13126         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13127                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13128
13129                                 ;;
13130                         esac
13131
13132         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13133         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13134
13135                         ;;
13136                 esac
13137                 ;;
13138         (*)
13139
13140         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13141         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13142
13143                 ;;
13144         esac
13145         ;;
13146 (yes)
13147
13148         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13149         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13150
13151         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13152
13153         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13154                 && test -z "${cf_tst_cflags}" \
13155                 && cf_fix_cppflags=no
13156         ;;
13157 esac
13158 done
13159
13160 if test -n "$cf_new_cflags" ; then
13161
13162         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13163         CFLAGS="${CFLAGS}$cf_new_cflags"
13164
13165 fi
13166
13167 if test -n "$cf_new_cppflags" ; then
13168
13169         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13170         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13171
13172 fi
13173
13174 if test -n "$cf_new_extra_cppflags" ; then
13175
13176         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13177         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13178
13179 fi
13180
13181 cf_add_libs="$cf_pkgconfig_libs"
13182 # Filter out duplicates - this happens with badly-designed ".pc" files...
13183 for cf_add_1lib in $LIBS
13184 do
13185         for cf_add_2lib in $cf_add_libs
13186         do
13187                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13188                 then
13189                         cf_add_1lib=
13190                         break
13191                 fi
13192         done
13193         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13194 done
13195 LIBS="$cf_add_libs"
13196
13197         :
13198 else
13199         cf_pkgconfig_incs=
13200         cf_pkgconfig_libs=
13201         { echo "$as_me:13201: WARNING: unable to find SM library" >&5
13202 echo "$as_me: WARNING: unable to find SM library" >&2;}
13203 fi
13204
13205 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13206         test -n "$verbose" && echo "    found package xt" 1>&6
13207
13208 echo "${as_me:-configure}:13208: testing found package xt ..." 1>&5
13209
13210         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13211         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13212         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13213
13214 echo "${as_me:-configure}:13214: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13215
13216         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13217
13218 echo "${as_me:-configure}:13218: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13219
13220 cf_fix_cppflags=no
13221 cf_new_cflags=
13222 cf_new_cppflags=
13223 cf_new_extra_cppflags=
13224
13225 for cf_add_cflags in $cf_pkgconfig_incs
13226 do
13227 case $cf_fix_cppflags in
13228 (no)
13229         case $cf_add_cflags in
13230         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13231                 case $cf_add_cflags in
13232                 (-D*)
13233                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13234
13235                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13236                                 && test -z "${cf_tst_cflags}" \
13237                                 && cf_fix_cppflags=yes
13238
13239                         if test $cf_fix_cppflags = yes ; then
13240
13241         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13242         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13243
13244                                 continue
13245                         elif test "${cf_tst_cflags}" = "\"'" ; then
13246
13247         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13248         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13249
13250                                 continue
13251                         fi
13252                         ;;
13253                 esac
13254                 case "$CPPFLAGS" in
13255                 (*$cf_add_cflags)
13256                         ;;
13257                 (*)
13258                         case $cf_add_cflags in
13259                         (-D*)
13260                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13261
13262 CPPFLAGS=`echo "$CPPFLAGS" | \
13263         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13264                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13265
13266                                 ;;
13267                         esac
13268
13269         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13270         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13271
13272                         ;;
13273                 esac
13274                 ;;
13275         (*)
13276
13277         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13278         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13279
13280                 ;;
13281         esac
13282         ;;
13283 (yes)
13284
13285         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13286         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13287
13288         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13289
13290         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13291                 && test -z "${cf_tst_cflags}" \
13292                 && cf_fix_cppflags=no
13293         ;;
13294 esac
13295 done
13296
13297 if test -n "$cf_new_cflags" ; then
13298
13299         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13300         CFLAGS="${CFLAGS}$cf_new_cflags"
13301
13302 fi
13303
13304 if test -n "$cf_new_cppflags" ; then
13305
13306         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13307         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13308
13309 fi
13310
13311 if test -n "$cf_new_extra_cppflags" ; then
13312
13313         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13314         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13315
13316 fi
13317
13318 cf_add_libs="$cf_pkgconfig_libs"
13319 # Filter out duplicates - this happens with badly-designed ".pc" files...
13320 for cf_add_1lib in $LIBS
13321 do
13322         for cf_add_2lib in $cf_add_libs
13323         do
13324                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13325                 then
13326                         cf_add_1lib=
13327                         break
13328                 fi
13329         done
13330         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13331 done
13332 LIBS="$cf_add_libs"
13333
13334         :
13335 else
13336         cf_pkgconfig_incs=
13337         cf_pkgconfig_libs=
13338         { echo "$as_me:13338: WARNING: unable to find Xt library" >&5
13339 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13340 fi
13341
13342 fi
13343
13344 cf_have_X_LIBS=no
13345
13346 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13347         test -n "$verbose" && echo "    found package xt" 1>&6
13348
13349 echo "${as_me:-configure}:13349: testing found package xt ..." 1>&5
13350
13351         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13352         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13353         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13354
13355 echo "${as_me:-configure}:13355: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13356
13357         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13358
13359 echo "${as_me:-configure}:13359: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13360
13361 cf_fix_cppflags=no
13362 cf_new_cflags=
13363 cf_new_cppflags=
13364 cf_new_extra_cppflags=
13365
13366 for cf_add_cflags in $cf_pkgconfig_incs
13367 do
13368 case $cf_fix_cppflags in
13369 (no)
13370         case $cf_add_cflags in
13371         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13372                 case $cf_add_cflags in
13373                 (-D*)
13374                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13375
13376                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13377                                 && test -z "${cf_tst_cflags}" \
13378                                 && cf_fix_cppflags=yes
13379
13380                         if test $cf_fix_cppflags = yes ; then
13381
13382         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13383         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13384
13385                                 continue
13386                         elif test "${cf_tst_cflags}" = "\"'" ; then
13387
13388         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13389         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13390
13391                                 continue
13392                         fi
13393                         ;;
13394                 esac
13395                 case "$CPPFLAGS" in
13396                 (*$cf_add_cflags)
13397                         ;;
13398                 (*)
13399                         case $cf_add_cflags in
13400                         (-D*)
13401                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13402
13403 CPPFLAGS=`echo "$CPPFLAGS" | \
13404         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13405                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13406
13407                                 ;;
13408                         esac
13409
13410         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13411         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13412
13413                         ;;
13414                 esac
13415                 ;;
13416         (*)
13417
13418         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13419         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13420
13421                 ;;
13422         esac
13423         ;;
13424 (yes)
13425
13426         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13427         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13428
13429         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13430
13431         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13432                 && test -z "${cf_tst_cflags}" \
13433                 && cf_fix_cppflags=no
13434         ;;
13435 esac
13436 done
13437
13438 if test -n "$cf_new_cflags" ; then
13439
13440         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13441         CFLAGS="${CFLAGS}$cf_new_cflags"
13442
13443 fi
13444
13445 if test -n "$cf_new_cppflags" ; then
13446
13447         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13448         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13449
13450 fi
13451
13452 if test -n "$cf_new_extra_cppflags" ; then
13453
13454         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13455         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13456
13457 fi
13458
13459 cf_add_libs="$cf_pkgconfig_libs"
13460 # Filter out duplicates - this happens with badly-designed ".pc" files...
13461 for cf_add_1lib in $LIBS
13462 do
13463         for cf_add_2lib in $cf_add_libs
13464         do
13465                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13466                 then
13467                         cf_add_1lib=
13468                         break
13469                 fi
13470         done
13471         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13472 done
13473 LIBS="$cf_add_libs"
13474
13475         case "x$LIBS" in
13476         (*-lX11*)
13477                 ;;
13478         (*)
13479 # we have an "xt" package, but it may omit Xt's dependency on X11
13480 echo "$as_me:13480: checking for usable X dependency" >&5
13481 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
13482 if test "${cf_cv_xt_x11_compat+set}" = set; then
13483   echo $ECHO_N "(cached) $ECHO_C" >&6
13484 else
13485
13486 cat >conftest.$ac_ext <<_ACEOF
13487 #line 13487 "configure"
13488 #include "confdefs.h"
13489
13490 #include <X11/Xlib.h>
13491
13492 int
13493 main (void)
13494 {
13495
13496         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
13497         int rc2 = XClearWindow((Display*) 0, (Window) 0);
13498         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
13499         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
13500
13501   ;
13502   return 0;
13503 }
13504 _ACEOF
13505 rm -f conftest.$ac_objext conftest$ac_exeext
13506 if { (eval echo "$as_me:13506: \"$ac_link\"") >&5
13507   (eval $ac_link) 2>&5
13508   ac_status=$?
13509   echo "$as_me:13509: \$? = $ac_status" >&5
13510   (exit $ac_status); } &&
13511          { ac_try='test -s conftest$ac_exeext'
13512   { (eval echo "$as_me:13512: \"$ac_try\"") >&5
13513   (eval $ac_try) 2>&5
13514   ac_status=$?
13515   echo "$as_me:13515: \$? = $ac_status" >&5
13516   (exit $ac_status); }; }; then
13517   cf_cv_xt_x11_compat=yes
13518 else
13519   echo "$as_me: failed program was:" >&5
13520 cat conftest.$ac_ext >&5
13521 cf_cv_xt_x11_compat=no
13522 fi
13523 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13524 fi
13525 echo "$as_me:13525: result: $cf_cv_xt_x11_compat" >&5
13526 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
13527                 if test "$cf_cv_xt_x11_compat" = no
13528                 then
13529                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
13530
13531 echo "${as_me:-configure}:13531: testing work around broken X11 dependency ..." 1>&5
13532
13533                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
13534
13535 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13536         test -n "$verbose" && echo "    found package x11" 1>&6
13537
13538 echo "${as_me:-configure}:13538: testing found package x11 ..." 1>&5
13539
13540         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13541         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13542         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13543
13544 echo "${as_me:-configure}:13544: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13545
13546         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13547
13548 echo "${as_me:-configure}:13548: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13549
13550 cf_fix_cppflags=no
13551 cf_new_cflags=
13552 cf_new_cppflags=
13553 cf_new_extra_cppflags=
13554
13555 for cf_add_cflags in $cf_pkgconfig_incs
13556 do
13557 case $cf_fix_cppflags in
13558 (no)
13559         case $cf_add_cflags in
13560         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13561                 case $cf_add_cflags in
13562                 (-D*)
13563                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13564
13565                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13566                                 && test -z "${cf_tst_cflags}" \
13567                                 && cf_fix_cppflags=yes
13568
13569                         if test $cf_fix_cppflags = yes ; then
13570
13571         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13572         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13573
13574                                 continue
13575                         elif test "${cf_tst_cflags}" = "\"'" ; then
13576
13577         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13578         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13579
13580                                 continue
13581                         fi
13582                         ;;
13583                 esac
13584                 case "$CPPFLAGS" in
13585                 (*$cf_add_cflags)
13586                         ;;
13587                 (*)
13588                         case $cf_add_cflags in
13589                         (-D*)
13590                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13591
13592 CPPFLAGS=`echo "$CPPFLAGS" | \
13593         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13594                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13595
13596                                 ;;
13597                         esac
13598
13599         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13600         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13601
13602                         ;;
13603                 esac
13604                 ;;
13605         (*)
13606
13607         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13608         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13609
13610                 ;;
13611         esac
13612         ;;
13613 (yes)
13614
13615         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13616         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13617
13618         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13619
13620         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13621                 && test -z "${cf_tst_cflags}" \
13622                 && cf_fix_cppflags=no
13623         ;;
13624 esac
13625 done
13626
13627 if test -n "$cf_new_cflags" ; then
13628
13629         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13630         CFLAGS="${CFLAGS}$cf_new_cflags"
13631
13632 fi
13633
13634 if test -n "$cf_new_cppflags" ; then
13635
13636         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13637         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13638
13639 fi
13640
13641 if test -n "$cf_new_extra_cppflags" ; then
13642
13643         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13644         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13645
13646 fi
13647
13648 cf_add_libs="$cf_pkgconfig_libs"
13649 # Filter out duplicates - this happens with badly-designed ".pc" files...
13650 for cf_add_1lib in $LIBS
13651 do
13652         for cf_add_2lib in $cf_add_libs
13653         do
13654                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13655                 then
13656                         cf_add_1lib=
13657                         break
13658                 fi
13659         done
13660         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13661 done
13662 LIBS="$cf_add_libs"
13663
13664         :
13665 else
13666         cf_pkgconfig_incs=
13667         cf_pkgconfig_libs=
13668
13669 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13670
13671 echo "${as_me:-configure}:13671: testing ...before $LIBS ..." 1>&5
13672
13673 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
13674 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13675
13676 echo "${as_me:-configure}:13676: testing ...after  $LIBS ..." 1>&5
13677
13678 fi
13679
13680                 fi
13681                 ;;
13682         esac
13683
13684 echo "$as_me:13684: checking for usable X Toolkit package" >&5
13685 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
13686 if test "${cf_cv_xt_ice_compat+set}" = set; then
13687   echo $ECHO_N "(cached) $ECHO_C" >&6
13688 else
13689
13690 cat >conftest.$ac_ext <<_ACEOF
13691 #line 13691 "configure"
13692 #include "confdefs.h"
13693
13694 #include <X11/Shell.h>
13695
13696 int
13697 main (void)
13698 {
13699 int num = IceConnectionNumber(0)
13700
13701   ;
13702   return 0;
13703 }
13704 _ACEOF
13705 rm -f conftest.$ac_objext conftest$ac_exeext
13706 if { (eval echo "$as_me:13706: \"$ac_link\"") >&5
13707   (eval $ac_link) 2>&5
13708   ac_status=$?
13709   echo "$as_me:13709: \$? = $ac_status" >&5
13710   (exit $ac_status); } &&
13711          { ac_try='test -s conftest$ac_exeext'
13712   { (eval echo "$as_me:13712: \"$ac_try\"") >&5
13713   (eval $ac_try) 2>&5
13714   ac_status=$?
13715   echo "$as_me:13715: \$? = $ac_status" >&5
13716   (exit $ac_status); }; }; then
13717   cf_cv_xt_ice_compat=yes
13718 else
13719   echo "$as_me: failed program was:" >&5
13720 cat conftest.$ac_ext >&5
13721 cf_cv_xt_ice_compat=no
13722 fi
13723 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13724 fi
13725 echo "$as_me:13725: result: $cf_cv_xt_ice_compat" >&5
13726 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
13727
13728         if test "$cf_cv_xt_ice_compat" = no
13729         then
13730                 # workaround for broken ".pc" files used for X Toolkit.
13731                 case "x$X_PRE_LIBS" in
13732                 (*-lICE*)
13733                         case "x$LIBS" in
13734                         (*-lICE*)
13735                                 ;;
13736                         (*)
13737                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
13738
13739 echo "${as_me:-configure}:13739: testing work around broken ICE dependency ..." 1>&5
13740
13741 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13742         test -n "$verbose" && echo "    found package ice" 1>&6
13743
13744 echo "${as_me:-configure}:13744: testing found package ice ..." 1>&5
13745
13746         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13747         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13748         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13749
13750 echo "${as_me:-configure}:13750: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13751
13752         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13753
13754 echo "${as_me:-configure}:13754: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13755
13756 cf_fix_cppflags=no
13757 cf_new_cflags=
13758 cf_new_cppflags=
13759 cf_new_extra_cppflags=
13760
13761 for cf_add_cflags in $cf_pkgconfig_incs
13762 do
13763 case $cf_fix_cppflags in
13764 (no)
13765         case $cf_add_cflags in
13766         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13767                 case $cf_add_cflags in
13768                 (-D*)
13769                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13770
13771                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13772                                 && test -z "${cf_tst_cflags}" \
13773                                 && cf_fix_cppflags=yes
13774
13775                         if test $cf_fix_cppflags = yes ; then
13776
13777         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13778         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13779
13780                                 continue
13781                         elif test "${cf_tst_cflags}" = "\"'" ; then
13782
13783         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13784         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13785
13786                                 continue
13787                         fi
13788                         ;;
13789                 esac
13790                 case "$CPPFLAGS" in
13791                 (*$cf_add_cflags)
13792                         ;;
13793                 (*)
13794                         case $cf_add_cflags in
13795                         (-D*)
13796                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13797
13798 CPPFLAGS=`echo "$CPPFLAGS" | \
13799         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13800                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13801
13802                                 ;;
13803                         esac
13804
13805         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13806         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13807
13808                         ;;
13809                 esac
13810                 ;;
13811         (*)
13812
13813         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13814         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13815
13816                 ;;
13817         esac
13818         ;;
13819 (yes)
13820
13821         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13822         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13823
13824         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13825
13826         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13827                 && test -z "${cf_tst_cflags}" \
13828                 && cf_fix_cppflags=no
13829         ;;
13830 esac
13831 done
13832
13833 if test -n "$cf_new_cflags" ; then
13834
13835         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13836         CFLAGS="${CFLAGS}$cf_new_cflags"
13837
13838 fi
13839
13840 if test -n "$cf_new_cppflags" ; then
13841
13842         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13843         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13844
13845 fi
13846
13847 if test -n "$cf_new_extra_cppflags" ; then
13848
13849         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13850         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13851
13852 fi
13853
13854 cf_add_libs="$cf_pkgconfig_libs"
13855 # Filter out duplicates - this happens with badly-designed ".pc" files...
13856 for cf_add_1lib in $LIBS
13857 do
13858         for cf_add_2lib in $cf_add_libs
13859         do
13860                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13861                 then
13862                         cf_add_1lib=
13863                         break
13864                 fi
13865         done
13866         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13867 done
13868 LIBS="$cf_add_libs"
13869
13870 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13871         test -n "$verbose" && echo "    found package sm" 1>&6
13872
13873 echo "${as_me:-configure}:13873: testing found package sm ..." 1>&5
13874
13875         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13876         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13877         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13878
13879 echo "${as_me:-configure}:13879: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13880
13881         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13882
13883 echo "${as_me:-configure}:13883: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13884
13885 cf_fix_cppflags=no
13886 cf_new_cflags=
13887 cf_new_cppflags=
13888 cf_new_extra_cppflags=
13889
13890 for cf_add_cflags in $cf_pkgconfig_incs
13891 do
13892 case $cf_fix_cppflags in
13893 (no)
13894         case $cf_add_cflags in
13895         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13896                 case $cf_add_cflags in
13897                 (-D*)
13898                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13899
13900                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13901                                 && test -z "${cf_tst_cflags}" \
13902                                 && cf_fix_cppflags=yes
13903
13904                         if test $cf_fix_cppflags = yes ; then
13905
13906         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13907         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13908
13909                                 continue
13910                         elif test "${cf_tst_cflags}" = "\"'" ; then
13911
13912         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13913         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13914
13915                                 continue
13916                         fi
13917                         ;;
13918                 esac
13919                 case "$CPPFLAGS" in
13920                 (*$cf_add_cflags)
13921                         ;;
13922                 (*)
13923                         case $cf_add_cflags in
13924                         (-D*)
13925                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13926
13927 CPPFLAGS=`echo "$CPPFLAGS" | \
13928         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13929                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13930
13931                                 ;;
13932                         esac
13933
13934         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13935         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13936
13937                         ;;
13938                 esac
13939                 ;;
13940         (*)
13941
13942         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13943         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13944
13945                 ;;
13946         esac
13947         ;;
13948 (yes)
13949
13950         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13951         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13952
13953         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13954
13955         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13956                 && test -z "${cf_tst_cflags}" \
13957                 && cf_fix_cppflags=no
13958         ;;
13959 esac
13960 done
13961
13962 if test -n "$cf_new_cflags" ; then
13963
13964         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13965         CFLAGS="${CFLAGS}$cf_new_cflags"
13966
13967 fi
13968
13969 if test -n "$cf_new_cppflags" ; then
13970
13971         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13972         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13973
13974 fi
13975
13976 if test -n "$cf_new_extra_cppflags" ; then
13977
13978         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13979         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13980
13981 fi
13982
13983 cf_add_libs="$cf_pkgconfig_libs"
13984 # Filter out duplicates - this happens with badly-designed ".pc" files...
13985 for cf_add_1lib in $LIBS
13986 do
13987         for cf_add_2lib in $cf_add_libs
13988         do
13989                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13990                 then
13991                         cf_add_1lib=
13992                         break
13993                 fi
13994         done
13995         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13996 done
13997 LIBS="$cf_add_libs"
13998
13999         :
14000 else
14001         cf_pkgconfig_incs=
14002         cf_pkgconfig_libs=
14003         :
14004 fi
14005
14006 else
14007         cf_pkgconfig_incs=
14008         cf_pkgconfig_libs=
14009
14010 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14011
14012 echo "${as_me:-configure}:14012: testing ...before $LIBS ..." 1>&5
14013
14014 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14015 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14016
14017 echo "${as_me:-configure}:14017: testing ...after  $LIBS ..." 1>&5
14018
14019 fi
14020
14021                                 ;;
14022                         esac
14023                         ;;
14024                 esac
14025         fi
14026
14027         cf_have_X_LIBS=yes
14028
14029 else
14030         cf_pkgconfig_incs=
14031         cf_pkgconfig_libs=
14032
14033         LDFLAGS="$X_LIBS $LDFLAGS"
14034
14035 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14036
14037 echo "${as_me:-configure}:14037: testing checking additions to CFLAGS ..." 1>&5
14038
14039 cf_check_cflags="$CFLAGS"
14040 cf_check_cppflags="$CPPFLAGS"
14041
14042 cf_fix_cppflags=no
14043 cf_new_cflags=
14044 cf_new_cppflags=
14045 cf_new_extra_cppflags=
14046
14047 for cf_add_cflags in $X_CFLAGS
14048 do
14049 case $cf_fix_cppflags in
14050 (no)
14051         case $cf_add_cflags in
14052         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14053                 case $cf_add_cflags in
14054                 (-D*)
14055                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14056
14057                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14058                                 && test -z "${cf_tst_cflags}" \
14059                                 && cf_fix_cppflags=yes
14060
14061                         if test $cf_fix_cppflags = yes ; then
14062
14063         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14064         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14065
14066                                 continue
14067                         elif test "${cf_tst_cflags}" = "\"'" ; then
14068
14069         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14070         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14071
14072                                 continue
14073                         fi
14074                         ;;
14075                 esac
14076                 case "$CPPFLAGS" in
14077                 (*$cf_add_cflags)
14078                         ;;
14079                 (*)
14080                         case $cf_add_cflags in
14081                         (-D*)
14082                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14083
14084 CPPFLAGS=`echo "$CPPFLAGS" | \
14085         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14086                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14087
14088                                 ;;
14089                         esac
14090
14091         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14092         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14093
14094                         ;;
14095                 esac
14096                 ;;
14097         (*)
14098
14099         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14100         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14101
14102                 ;;
14103         esac
14104         ;;
14105 (yes)
14106
14107         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14108         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14109
14110         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14111
14112         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14113                 && test -z "${cf_tst_cflags}" \
14114                 && cf_fix_cppflags=no
14115         ;;
14116 esac
14117 done
14118
14119 if test -n "$cf_new_cflags" ; then
14120         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14121
14122 echo "${as_me:-configure}:14122: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14123
14124         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14125         CFLAGS="${CFLAGS}$cf_new_cflags"
14126
14127 fi
14128
14129 if test -n "$cf_new_cppflags" ; then
14130         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14131
14132 echo "${as_me:-configure}:14132: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14133
14134         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14135         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14136
14137 fi
14138
14139 if test -n "$cf_new_extra_cppflags" ; then
14140         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14141
14142 echo "${as_me:-configure}:14142: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14143
14144         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14145         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14146
14147 fi
14148
14149 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14150 cat >conftest.$ac_ext <<_ACEOF
14151 #line 14151 "configure"
14152 #include "confdefs.h"
14153 #include <stdio.h>
14154 int
14155 main (void)
14156 {
14157 printf("Hello world");
14158   ;
14159   return 0;
14160 }
14161 _ACEOF
14162 rm -f conftest.$ac_objext conftest$ac_exeext
14163 if { (eval echo "$as_me:14163: \"$ac_link\"") >&5
14164   (eval $ac_link) 2>&5
14165   ac_status=$?
14166   echo "$as_me:14166: \$? = $ac_status" >&5
14167   (exit $ac_status); } &&
14168          { ac_try='test -s conftest$ac_exeext'
14169   { (eval echo "$as_me:14169: \"$ac_try\"") >&5
14170   (eval $ac_try) 2>&5
14171   ac_status=$?
14172   echo "$as_me:14172: \$? = $ac_status" >&5
14173   (exit $ac_status); }; }; then
14174   :
14175 else
14176   echo "$as_me: failed program was:" >&5
14177 cat conftest.$ac_ext >&5
14178 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14179
14180 echo "${as_me:-configure}:14180: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14181
14182          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14183                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14184
14185 echo "${as_me:-configure}:14185: testing but keeping change to \$CPPFLAGS ..." 1>&5
14186
14187          fi
14188          CFLAGS="$cf_check_flags"
14189 fi
14190 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14191 fi
14192
14193         echo "$as_me:14193: checking for XOpenDisplay" >&5
14194 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14195 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14196   echo $ECHO_N "(cached) $ECHO_C" >&6
14197 else
14198   cat >conftest.$ac_ext <<_ACEOF
14199 #line 14199 "configure"
14200 #include "confdefs.h"
14201 #define XOpenDisplay autoconf_temporary
14202 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14203 #undef XOpenDisplay
14204
14205 #ifdef __cplusplus
14206 extern "C"
14207 #endif
14208
14209 /* We use char because int might match the return type of a gcc2
14210    builtin and then its argument prototype would still apply.  */
14211 char XOpenDisplay (void);
14212
14213 int
14214 main (void)
14215 {
14216
14217 /* The GNU C library defines stubs for functions which it implements
14218     to always fail with ENOSYS.  Some functions are actually named
14219     something starting with __ and the normal name is an alias.  */
14220 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14221 #error found stub for XOpenDisplay
14222 #endif
14223
14224         return XOpenDisplay ();
14225   ;
14226   return 0;
14227 }
14228 _ACEOF
14229 rm -f conftest.$ac_objext conftest$ac_exeext
14230 if { (eval echo "$as_me:14230: \"$ac_link\"") >&5
14231   (eval $ac_link) 2>&5
14232   ac_status=$?
14233   echo "$as_me:14233: \$? = $ac_status" >&5
14234   (exit $ac_status); } &&
14235          { ac_try='test -s conftest$ac_exeext'
14236   { (eval echo "$as_me:14236: \"$ac_try\"") >&5
14237   (eval $ac_try) 2>&5
14238   ac_status=$?
14239   echo "$as_me:14239: \$? = $ac_status" >&5
14240   (exit $ac_status); }; }; then
14241   ac_cv_func_XOpenDisplay=yes
14242 else
14243   echo "$as_me: failed program was:" >&5
14244 cat conftest.$ac_ext >&5
14245 ac_cv_func_XOpenDisplay=no
14246 fi
14247 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14248 fi
14249 echo "$as_me:14249: result: $ac_cv_func_XOpenDisplay" >&5
14250 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14251 if test $ac_cv_func_XOpenDisplay = yes; then
14252   :
14253 else
14254
14255         echo "$as_me:14255: checking for XOpenDisplay in -lX11" >&5
14256 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14257 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14258   echo $ECHO_N "(cached) $ECHO_C" >&6
14259 else
14260   ac_check_lib_save_LIBS=$LIBS
14261 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14262 cat >conftest.$ac_ext <<_ACEOF
14263 #line 14263 "configure"
14264 #include "confdefs.h"
14265
14266 /* Override any gcc2 internal prototype to avoid an error.  */
14267 #ifdef __cplusplus
14268 extern "C"
14269 #endif
14270 /* We use char because int might match the return type of a gcc2
14271    builtin and then its argument prototype would still apply.  */
14272 char XOpenDisplay ();
14273 int
14274 main (void)
14275 {
14276 XOpenDisplay ();
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   ac_cv_lib_X11_XOpenDisplay=yes
14294 else
14295   echo "$as_me: failed program was:" >&5
14296 cat conftest.$ac_ext >&5
14297 ac_cv_lib_X11_XOpenDisplay=no
14298 fi
14299 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14300 LIBS=$ac_check_lib_save_LIBS
14301 fi
14302 echo "$as_me:14302: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14303 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14304 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14305
14306 cf_add_libs="-lX11"
14307 # Filter out duplicates - this happens with badly-designed ".pc" files...
14308 for cf_add_1lib in $LIBS
14309 do
14310         for cf_add_2lib in $cf_add_libs
14311         do
14312                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14313                 then
14314                         cf_add_1lib=
14315                         break
14316                 fi
14317         done
14318         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14319 done
14320 LIBS="$cf_add_libs"
14321
14322 fi
14323
14324 fi
14325
14326         echo "$as_me:14326: checking for XtAppInitialize" >&5
14327 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14328 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14329   echo $ECHO_N "(cached) $ECHO_C" >&6
14330 else
14331   cat >conftest.$ac_ext <<_ACEOF
14332 #line 14332 "configure"
14333 #include "confdefs.h"
14334 #define XtAppInitialize autoconf_temporary
14335 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14336 #undef XtAppInitialize
14337
14338 #ifdef __cplusplus
14339 extern "C"
14340 #endif
14341
14342 /* We use char because int might match the return type of a gcc2
14343    builtin and then its argument prototype would still apply.  */
14344 char XtAppInitialize (void);
14345
14346 int
14347 main (void)
14348 {
14349
14350 /* The GNU C library defines stubs for functions which it implements
14351     to always fail with ENOSYS.  Some functions are actually named
14352     something starting with __ and the normal name is an alias.  */
14353 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14354 #error found stub for XtAppInitialize
14355 #endif
14356
14357         return XtAppInitialize ();
14358   ;
14359   return 0;
14360 }
14361 _ACEOF
14362 rm -f conftest.$ac_objext conftest$ac_exeext
14363 if { (eval echo "$as_me:14363: \"$ac_link\"") >&5
14364   (eval $ac_link) 2>&5
14365   ac_status=$?
14366   echo "$as_me:14366: \$? = $ac_status" >&5
14367   (exit $ac_status); } &&
14368          { ac_try='test -s conftest$ac_exeext'
14369   { (eval echo "$as_me:14369: \"$ac_try\"") >&5
14370   (eval $ac_try) 2>&5
14371   ac_status=$?
14372   echo "$as_me:14372: \$? = $ac_status" >&5
14373   (exit $ac_status); }; }; then
14374   ac_cv_func_XtAppInitialize=yes
14375 else
14376   echo "$as_me: failed program was:" >&5
14377 cat conftest.$ac_ext >&5
14378 ac_cv_func_XtAppInitialize=no
14379 fi
14380 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14381 fi
14382 echo "$as_me:14382: result: $ac_cv_func_XtAppInitialize" >&5
14383 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14384 if test $ac_cv_func_XtAppInitialize = yes; then
14385   :
14386 else
14387
14388         echo "$as_me:14388: checking for XtAppInitialize in -lXt" >&5
14389 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14390 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14391   echo $ECHO_N "(cached) $ECHO_C" >&6
14392 else
14393   ac_check_lib_save_LIBS=$LIBS
14394 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14395 cat >conftest.$ac_ext <<_ACEOF
14396 #line 14396 "configure"
14397 #include "confdefs.h"
14398
14399 /* Override any gcc2 internal prototype to avoid an error.  */
14400 #ifdef __cplusplus
14401 extern "C"
14402 #endif
14403 /* We use char because int might match the return type of a gcc2
14404    builtin and then its argument prototype would still apply.  */
14405 char XtAppInitialize ();
14406 int
14407 main (void)
14408 {
14409 XtAppInitialize ();
14410   ;
14411   return 0;
14412 }
14413 _ACEOF
14414 rm -f conftest.$ac_objext conftest$ac_exeext
14415 if { (eval echo "$as_me:14415: \"$ac_link\"") >&5
14416   (eval $ac_link) 2>&5
14417   ac_status=$?
14418   echo "$as_me:14418: \$? = $ac_status" >&5
14419   (exit $ac_status); } &&
14420          { ac_try='test -s conftest$ac_exeext'
14421   { (eval echo "$as_me:14421: \"$ac_try\"") >&5
14422   (eval $ac_try) 2>&5
14423   ac_status=$?
14424   echo "$as_me:14424: \$? = $ac_status" >&5
14425   (exit $ac_status); }; }; then
14426   ac_cv_lib_Xt_XtAppInitialize=yes
14427 else
14428   echo "$as_me: failed program was:" >&5
14429 cat conftest.$ac_ext >&5
14430 ac_cv_lib_Xt_XtAppInitialize=no
14431 fi
14432 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14433 LIBS=$ac_check_lib_save_LIBS
14434 fi
14435 echo "$as_me:14435: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
14436 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
14437 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
14438
14439 cat >>confdefs.h <<\EOF
14440 #define HAVE_LIBXT 1
14441 EOF
14442
14443                  cf_have_X_LIBS=Xt
14444                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14445 fi
14446
14447 fi
14448
14449 fi
14450
14451 if test $cf_have_X_LIBS = no ; then
14452         { echo "$as_me:14452: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14453 test program.  You will have to check and add the proper libraries by hand
14454 to makefile." >&5
14455 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14456 test program.  You will have to check and add the proper libraries by hand
14457 to makefile." >&2;}
14458 fi
14459
14460 cf_x_athena_root=$cf_x_athena
14461 cf_x_athena_inc=""
14462
14463 for cf_path in default \
14464         /usr/contrib/X11R6 \
14465         /usr/contrib/X11R5 \
14466         /usr/lib/X11R5 \
14467         /usr/local
14468 do
14469         if test -z "$cf_x_athena_inc" ; then
14470                 cf_save="$CPPFLAGS"
14471                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
14472                 if test $cf_path != default ; then
14473                         CPPFLAGS="$cf_save"
14474
14475         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14476         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
14477
14478                         echo "$as_me:14478: checking for $cf_test in $cf_path" >&5
14479 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
14480                 else
14481                         echo "$as_me:14481: checking for $cf_test" >&5
14482 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
14483                 fi
14484                 cat >conftest.$ac_ext <<_ACEOF
14485 #line 14485 "configure"
14486 #include "confdefs.h"
14487
14488 #include <X11/Intrinsic.h>
14489 #include <$cf_test>
14490 int
14491 main (void)
14492 {
14493
14494   ;
14495   return 0;
14496 }
14497 _ACEOF
14498 rm -f conftest.$ac_objext
14499 if { (eval echo "$as_me:14499: \"$ac_compile\"") >&5
14500   (eval $ac_compile) 2>&5
14501   ac_status=$?
14502   echo "$as_me:14502: \$? = $ac_status" >&5
14503   (exit $ac_status); } &&
14504          { ac_try='test -s conftest.$ac_objext'
14505   { (eval echo "$as_me:14505: \"$ac_try\"") >&5
14506   (eval $ac_try) 2>&5
14507   ac_status=$?
14508   echo "$as_me:14508: \$? = $ac_status" >&5
14509   (exit $ac_status); }; }; then
14510   cf_result=yes
14511 else
14512   echo "$as_me: failed program was:" >&5
14513 cat conftest.$ac_ext >&5
14514 cf_result=no
14515 fi
14516 rm -f conftest.$ac_objext conftest.$ac_ext
14517                 echo "$as_me:14517: result: $cf_result" >&5
14518 echo "${ECHO_T}$cf_result" >&6
14519                 if test "$cf_result" = yes ; then
14520                         cf_x_athena_inc=$cf_path
14521                         break
14522                 else
14523                         CPPFLAGS="$cf_save"
14524                 fi
14525         fi
14526 done
14527
14528 if test -z "$cf_x_athena_inc" ; then
14529         { echo "$as_me:14529: WARNING: Unable to successfully find Athena header files with test program" >&5
14530 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
14531 elif test "$cf_x_athena_inc" != default ; then
14532
14533         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14534         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
14535
14536 fi
14537
14538 cf_x_athena_root=$cf_x_athena
14539 cf_x_athena_lib=""
14540
14541 for cf_path in default \
14542         /usr/contrib/X11R6 \
14543         /usr/contrib/X11R5 \
14544         /usr/lib/X11R5 \
14545         /usr/local
14546 do
14547         for cf_lib in \
14548                 ${cf_x_athena_root} \
14549                 ${cf_x_athena_root}7 \
14550                 ${cf_x_athena_root}6
14551         do
14552         for cf_libs in \
14553                 "-l$cf_lib -lXmu" \
14554                 "-l$cf_lib -lXpm -lXmu" \
14555                 "-l${cf_lib}_s -lXmu_s"
14556         do
14557                 if test -z "$cf_x_athena_lib" ; then
14558                         cf_save="$LIBS"
14559                         cf_test=XawSimpleMenuAddGlobalActions
14560                         if test $cf_path != default ; then
14561
14562 cf_add_libs="-L$cf_path/lib $cf_libs"
14563 # Filter out duplicates - this happens with badly-designed ".pc" files...
14564 for cf_add_1lib in $LIBS
14565 do
14566         for cf_add_2lib in $cf_add_libs
14567         do
14568                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14569                 then
14570                         cf_add_1lib=
14571                         break
14572                 fi
14573         done
14574         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14575 done
14576 LIBS="$cf_add_libs"
14577
14578                                 echo "$as_me:14578: checking for $cf_libs in $cf_path" >&5
14579 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
14580                         else
14581
14582 cf_add_libs="$cf_libs"
14583 # Filter out duplicates - this happens with badly-designed ".pc" files...
14584 for cf_add_1lib in $LIBS
14585 do
14586         for cf_add_2lib in $cf_add_libs
14587         do
14588                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14589                 then
14590                         cf_add_1lib=
14591                         break
14592                 fi
14593         done
14594         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14595 done
14596 LIBS="$cf_add_libs"
14597
14598                                 echo "$as_me:14598: checking for $cf_test in $cf_libs" >&5
14599 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
14600                         fi
14601                         cat >conftest.$ac_ext <<_ACEOF
14602 #line 14602 "configure"
14603 #include "confdefs.h"
14604
14605 #include <X11/Intrinsic.h>
14606 #include <X11/$cf_x_athena_root/SimpleMenu.h>
14607
14608 int
14609 main (void)
14610 {
14611
14612 $cf_test((XtAppContext) 0)
14613   ;
14614   return 0;
14615 }
14616 _ACEOF
14617 rm -f conftest.$ac_objext conftest$ac_exeext
14618 if { (eval echo "$as_me:14618: \"$ac_link\"") >&5
14619   (eval $ac_link) 2>&5
14620   ac_status=$?
14621   echo "$as_me:14621: \$? = $ac_status" >&5
14622   (exit $ac_status); } &&
14623          { ac_try='test -s conftest$ac_exeext'
14624   { (eval echo "$as_me:14624: \"$ac_try\"") >&5
14625   (eval $ac_try) 2>&5
14626   ac_status=$?
14627   echo "$as_me:14627: \$? = $ac_status" >&5
14628   (exit $ac_status); }; }; then
14629   cf_result=yes
14630 else
14631   echo "$as_me: failed program was:" >&5
14632 cat conftest.$ac_ext >&5
14633 cf_result=no
14634 fi
14635 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14636                         echo "$as_me:14636: result: $cf_result" >&5
14637 echo "${ECHO_T}$cf_result" >&6
14638                         if test "$cf_result" = yes ; then
14639                                 cf_x_athena_lib="$cf_libs"
14640                                 break
14641                         fi
14642                         LIBS="$cf_save"
14643                 fi
14644         done # cf_libs
14645                 test -n "$cf_x_athena_lib" && break
14646         done # cf_lib
14647 done
14648
14649 if test -z "$cf_x_athena_lib" ; then
14650         { { echo "$as_me:14650: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
14651 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
14652    { (exit 1); exit 1; }; }
14653 fi
14654
14655 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14656
14657 cat >>confdefs.h <<EOF
14658 #define $cf_x_athena_LIBS 1
14659 EOF
14660
14661 fi
14662
14663 if test -n "$ac_tool_prefix"; then
14664   for ac_prog in xcurses-config
14665   do
14666     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
14667 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
14668 echo "$as_me:14668: checking for $ac_word" >&5
14669 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14670 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
14671   echo $ECHO_N "(cached) $ECHO_C" >&6
14672 else
14673   if test -n "$XCURSES_CONFIG"; then
14674   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
14675 else
14676   ac_save_IFS=$IFS; IFS=$ac_path_separator
14677 ac_dummy="$PATH"
14678 for ac_dir in $ac_dummy; do
14679   IFS=$ac_save_IFS
14680   test -z "$ac_dir" && ac_dir=.
14681   $as_executable_p "$ac_dir/$ac_word" || continue
14682 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
14683 echo "$as_me:14683: found $ac_dir/$ac_word" >&5
14684 break
14685 done
14686
14687 fi
14688 fi
14689 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
14690 if test -n "$XCURSES_CONFIG"; then
14691   echo "$as_me:14691: result: $XCURSES_CONFIG" >&5
14692 echo "${ECHO_T}$XCURSES_CONFIG" >&6
14693 else
14694   echo "$as_me:14694: result: no" >&5
14695 echo "${ECHO_T}no" >&6
14696 fi
14697
14698     test -n "$XCURSES_CONFIG" && break
14699   done
14700 fi
14701 if test -z "$XCURSES_CONFIG"; then
14702   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
14703   for ac_prog in xcurses-config
14704 do
14705   # Extract the first word of "$ac_prog", so it can be a program name with args.
14706 set dummy $ac_prog; ac_word=$2
14707 echo "$as_me:14707: checking for $ac_word" >&5
14708 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14709 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
14710   echo $ECHO_N "(cached) $ECHO_C" >&6
14711 else
14712   if test -n "$ac_ct_XCURSES_CONFIG"; then
14713   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
14714 else
14715   ac_save_IFS=$IFS; IFS=$ac_path_separator
14716 ac_dummy="$PATH"
14717 for ac_dir in $ac_dummy; do
14718   IFS=$ac_save_IFS
14719   test -z "$ac_dir" && ac_dir=.
14720   $as_executable_p "$ac_dir/$ac_word" || continue
14721 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
14722 echo "$as_me:14722: found $ac_dir/$ac_word" >&5
14723 break
14724 done
14725
14726 fi
14727 fi
14728 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
14729 if test -n "$ac_ct_XCURSES_CONFIG"; then
14730   echo "$as_me:14730: result: $ac_ct_XCURSES_CONFIG" >&5
14731 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
14732 else
14733   echo "$as_me:14733: result: no" >&5
14734 echo "${ECHO_T}no" >&6
14735 fi
14736
14737   test -n "$ac_ct_XCURSES_CONFIG" && break
14738 done
14739 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
14740
14741   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
14742 fi
14743
14744 if test "$XCURSES_CONFIG" != none ; then
14745
14746 cf_fix_cppflags=no
14747 cf_new_cflags=
14748 cf_new_cppflags=
14749 cf_new_extra_cppflags=
14750
14751 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
14752 do
14753 case $cf_fix_cppflags in
14754 (no)
14755         case $cf_add_cflags in
14756         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14757                 case $cf_add_cflags in
14758                 (-D*)
14759                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14760
14761                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14762                                 && test -z "${cf_tst_cflags}" \
14763                                 && cf_fix_cppflags=yes
14764
14765                         if test $cf_fix_cppflags = yes ; then
14766
14767         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14768         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14769
14770                                 continue
14771                         elif test "${cf_tst_cflags}" = "\"'" ; then
14772
14773         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14774         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14775
14776                                 continue
14777                         fi
14778                         ;;
14779                 esac
14780                 case "$CPPFLAGS" in
14781                 (*$cf_add_cflags)
14782                         ;;
14783                 (*)
14784                         case $cf_add_cflags in
14785                         (-D*)
14786                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14787
14788 CPPFLAGS=`echo "$CPPFLAGS" | \
14789         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14790                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14791
14792                                 ;;
14793                         esac
14794
14795         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14796         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14797
14798                         ;;
14799                 esac
14800                 ;;
14801         (*)
14802
14803         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14804         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14805
14806                 ;;
14807         esac
14808         ;;
14809 (yes)
14810
14811         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14812         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14813
14814         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14815
14816         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14817                 && test -z "${cf_tst_cflags}" \
14818                 && cf_fix_cppflags=no
14819         ;;
14820 esac
14821 done
14822
14823 if test -n "$cf_new_cflags" ; then
14824
14825         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14826         CFLAGS="${CFLAGS}$cf_new_cflags"
14827
14828 fi
14829
14830 if test -n "$cf_new_cppflags" ; then
14831
14832         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14833         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14834
14835 fi
14836
14837 if test -n "$cf_new_extra_cppflags" ; then
14838
14839         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14840         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14841
14842 fi
14843
14844 cf_add_libs="`$XCURSES_CONFIG --libs`"
14845 # Filter out duplicates - this happens with badly-designed ".pc" files...
14846 for cf_add_1lib in $LIBS
14847 do
14848         for cf_add_2lib in $cf_add_libs
14849         do
14850                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14851                 then
14852                         cf_add_1lib=
14853                         break
14854                 fi
14855         done
14856         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14857 done
14858 LIBS="$cf_add_libs"
14859
14860 cf_cv_lib_XCurses=yes
14861
14862 else
14863
14864 LDFLAGS="$LDFLAGS $X_LIBS"
14865
14866 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14867
14868 echo "${as_me:-configure}:14868: testing checking additions to CFLAGS ..." 1>&5
14869
14870 cf_check_cflags="$CFLAGS"
14871 cf_check_cppflags="$CPPFLAGS"
14872
14873 cf_fix_cppflags=no
14874 cf_new_cflags=
14875 cf_new_cppflags=
14876 cf_new_extra_cppflags=
14877
14878 for cf_add_cflags in $X_CFLAGS
14879 do
14880 case $cf_fix_cppflags in
14881 (no)
14882         case $cf_add_cflags in
14883         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14884                 case $cf_add_cflags in
14885                 (-D*)
14886                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14887
14888                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14889                                 && test -z "${cf_tst_cflags}" \
14890                                 && cf_fix_cppflags=yes
14891
14892                         if test $cf_fix_cppflags = yes ; then
14893
14894         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14895         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14896
14897                                 continue
14898                         elif test "${cf_tst_cflags}" = "\"'" ; then
14899
14900         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14901         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14902
14903                                 continue
14904                         fi
14905                         ;;
14906                 esac
14907                 case "$CPPFLAGS" in
14908                 (*$cf_add_cflags)
14909                         ;;
14910                 (*)
14911                         case $cf_add_cflags in
14912                         (-D*)
14913                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14914
14915 CPPFLAGS=`echo "$CPPFLAGS" | \
14916         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14917                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14918
14919                                 ;;
14920                         esac
14921
14922         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14923         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14924
14925                         ;;
14926                 esac
14927                 ;;
14928         (*)
14929
14930         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14931         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14932
14933                 ;;
14934         esac
14935         ;;
14936 (yes)
14937
14938         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14939         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14940
14941         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14942
14943         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14944                 && test -z "${cf_tst_cflags}" \
14945                 && cf_fix_cppflags=no
14946         ;;
14947 esac
14948 done
14949
14950 if test -n "$cf_new_cflags" ; then
14951         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14952
14953 echo "${as_me:-configure}:14953: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14954
14955         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14956         CFLAGS="${CFLAGS}$cf_new_cflags"
14957
14958 fi
14959
14960 if test -n "$cf_new_cppflags" ; then
14961         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14962
14963 echo "${as_me:-configure}:14963: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14964
14965         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14966         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14967
14968 fi
14969
14970 if test -n "$cf_new_extra_cppflags" ; then
14971         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14972
14973 echo "${as_me:-configure}:14973: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14974
14975         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14976         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14977
14978 fi
14979
14980 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14981 cat >conftest.$ac_ext <<_ACEOF
14982 #line 14982 "configure"
14983 #include "confdefs.h"
14984 #include <stdio.h>
14985 int
14986 main (void)
14987 {
14988 printf("Hello world");
14989   ;
14990   return 0;
14991 }
14992 _ACEOF
14993 rm -f conftest.$ac_objext conftest$ac_exeext
14994 if { (eval echo "$as_me:14994: \"$ac_link\"") >&5
14995   (eval $ac_link) 2>&5
14996   ac_status=$?
14997   echo "$as_me:14997: \$? = $ac_status" >&5
14998   (exit $ac_status); } &&
14999          { ac_try='test -s conftest$ac_exeext'
15000   { (eval echo "$as_me:15000: \"$ac_try\"") >&5
15001   (eval $ac_try) 2>&5
15002   ac_status=$?
15003   echo "$as_me:15003: \$? = $ac_status" >&5
15004   (exit $ac_status); }; }; then
15005   :
15006 else
15007   echo "$as_me: failed program was:" >&5
15008 cat conftest.$ac_ext >&5
15009 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15010
15011 echo "${as_me:-configure}:15011: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15012
15013          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15014                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15015
15016 echo "${as_me:-configure}:15016: testing but keeping change to \$CPPFLAGS ..." 1>&5
15017
15018          fi
15019          CFLAGS="$cf_check_flags"
15020 fi
15021 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15022 fi
15023
15024 echo "$as_me:15024: checking for XOpenDisplay in -lX11" >&5
15025 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15026 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15027   echo $ECHO_N "(cached) $ECHO_C" >&6
15028 else
15029   ac_check_lib_save_LIBS=$LIBS
15030 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15031 cat >conftest.$ac_ext <<_ACEOF
15032 #line 15032 "configure"
15033 #include "confdefs.h"
15034
15035 /* Override any gcc2 internal prototype to avoid an error.  */
15036 #ifdef __cplusplus
15037 extern "C"
15038 #endif
15039 /* We use char because int might match the return type of a gcc2
15040    builtin and then its argument prototype would still apply.  */
15041 char XOpenDisplay ();
15042 int
15043 main (void)
15044 {
15045 XOpenDisplay ();
15046   ;
15047   return 0;
15048 }
15049 _ACEOF
15050 rm -f conftest.$ac_objext conftest$ac_exeext
15051 if { (eval echo "$as_me:15051: \"$ac_link\"") >&5
15052   (eval $ac_link) 2>&5
15053   ac_status=$?
15054   echo "$as_me:15054: \$? = $ac_status" >&5
15055   (exit $ac_status); } &&
15056          { ac_try='test -s conftest$ac_exeext'
15057   { (eval echo "$as_me:15057: \"$ac_try\"") >&5
15058   (eval $ac_try) 2>&5
15059   ac_status=$?
15060   echo "$as_me:15060: \$? = $ac_status" >&5
15061   (exit $ac_status); }; }; then
15062   ac_cv_lib_X11_XOpenDisplay=yes
15063 else
15064   echo "$as_me: failed program was:" >&5
15065 cat conftest.$ac_ext >&5
15066 ac_cv_lib_X11_XOpenDisplay=no
15067 fi
15068 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15069 LIBS=$ac_check_lib_save_LIBS
15070 fi
15071 echo "$as_me:15071: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15072 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15073 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15074
15075 cf_add_libs="-lX11"
15076 # Filter out duplicates - this happens with badly-designed ".pc" files...
15077 for cf_add_1lib in $LIBS
15078 do
15079         for cf_add_2lib in $cf_add_libs
15080         do
15081                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15082                 then
15083                         cf_add_1lib=
15084                         break
15085                 fi
15086         done
15087         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15088 done
15089 LIBS="$cf_add_libs"
15090
15091 fi
15092
15093 echo "$as_me:15093: checking for XCurses library" >&5
15094 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15095 if test "${cf_cv_lib_XCurses+set}" = set; then
15096   echo $ECHO_N "(cached) $ECHO_C" >&6
15097 else
15098
15099 cf_add_libs="-lXCurses"
15100 # Filter out duplicates - this happens with badly-designed ".pc" files...
15101 for cf_add_1lib in $LIBS
15102 do
15103         for cf_add_2lib in $cf_add_libs
15104         do
15105                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15106                 then
15107                         cf_add_1lib=
15108                         break
15109                 fi
15110         done
15111         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15112 done
15113 LIBS="$cf_add_libs"
15114
15115 cat >conftest.$ac_ext <<_ACEOF
15116 #line 15116 "configure"
15117 #include "confdefs.h"
15118
15119 #include <xcurses.h>
15120 char *XCursesProgramName = "test";
15121
15122 int
15123 main (void)
15124 {
15125 XCursesExit();
15126   ;
15127   return 0;
15128 }
15129 _ACEOF
15130 rm -f conftest.$ac_objext conftest$ac_exeext
15131 if { (eval echo "$as_me:15131: \"$ac_link\"") >&5
15132   (eval $ac_link) 2>&5
15133   ac_status=$?
15134   echo "$as_me:15134: \$? = $ac_status" >&5
15135   (exit $ac_status); } &&
15136          { ac_try='test -s conftest$ac_exeext'
15137   { (eval echo "$as_me:15137: \"$ac_try\"") >&5
15138   (eval $ac_try) 2>&5
15139   ac_status=$?
15140   echo "$as_me:15140: \$? = $ac_status" >&5
15141   (exit $ac_status); }; }; then
15142   cf_cv_lib_XCurses=yes
15143 else
15144   echo "$as_me: failed program was:" >&5
15145 cat conftest.$ac_ext >&5
15146 cf_cv_lib_XCurses=no
15147 fi
15148 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15149
15150 fi
15151 echo "$as_me:15151: result: $cf_cv_lib_XCurses" >&5
15152 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15153
15154 fi
15155
15156 if test $cf_cv_lib_XCurses = yes ; then
15157
15158 cat >>confdefs.h <<\EOF
15159 #define UNIX 1
15160 EOF
15161
15162 cat >>confdefs.h <<\EOF
15163 #define XCURSES 1
15164 EOF
15165
15166         echo "$as_me:15166: checking for xcurses.h" >&5
15167 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15168 if test "${ac_cv_header_xcurses_h+set}" = set; then
15169   echo $ECHO_N "(cached) $ECHO_C" >&6
15170 else
15171   cat >conftest.$ac_ext <<_ACEOF
15172 #line 15172 "configure"
15173 #include "confdefs.h"
15174 #include <xcurses.h>
15175 _ACEOF
15176 if { (eval echo "$as_me:15176: \"$ac_cpp conftest.$ac_ext\"") >&5
15177   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15178   ac_status=$?
15179   egrep -v '^ *\+' conftest.er1 >conftest.err
15180   rm -f conftest.er1
15181   cat conftest.err >&5
15182   echo "$as_me:15182: \$? = $ac_status" >&5
15183   (exit $ac_status); } >/dev/null; then
15184   if test -s conftest.err; then
15185     ac_cpp_err=$ac_c_preproc_warn_flag
15186   else
15187     ac_cpp_err=
15188   fi
15189 else
15190   ac_cpp_err=yes
15191 fi
15192 if test -z "$ac_cpp_err"; then
15193   ac_cv_header_xcurses_h=yes
15194 else
15195   echo "$as_me: failed program was:" >&5
15196   cat conftest.$ac_ext >&5
15197   ac_cv_header_xcurses_h=no
15198 fi
15199 rm -f conftest.err conftest.$ac_ext
15200 fi
15201 echo "$as_me:15201: result: $ac_cv_header_xcurses_h" >&5
15202 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15203 if test $ac_cv_header_xcurses_h = yes; then
15204
15205 cat >>confdefs.h <<\EOF
15206 #define HAVE_XCURSES 1
15207 EOF
15208
15209 fi
15210
15211 else
15212         { { echo "$as_me:15212: error: Cannot link with XCurses" >&5
15213 echo "$as_me: error: Cannot link with XCurses" >&2;}
15214    { (exit 1); exit 1; }; }
15215 fi
15216
15217         ;;
15218 (*)
15219         { { echo "$as_me:15219: error: unexpected screen-value: $cf_cv_screen" >&5
15220 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15221    { (exit 1); exit 1; }; }
15222         ;;
15223 esac
15224
15225 : ${cf_nculib_root:=$cf_cv_screen}
15226 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15227 echo "$as_me:15227: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15228 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15229 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15230   echo $ECHO_N "(cached) $ECHO_C" >&6
15231 else
15232   ac_check_lib_save_LIBS=$LIBS
15233 LIBS="-l$cf_nculib_root  $LIBS"
15234 cat >conftest.$ac_ext <<_ACEOF
15235 #line 15235 "configure"
15236 #include "confdefs.h"
15237
15238 /* Override any gcc2 internal prototype to avoid an error.  */
15239 #ifdef __cplusplus
15240 extern "C"
15241 #endif
15242 /* We use char because int might match the return type of a gcc2
15243    builtin and then its argument prototype would still apply.  */
15244 char _nc_init_pthreads ();
15245 int
15246 main (void)
15247 {
15248 _nc_init_pthreads ();
15249   ;
15250   return 0;
15251 }
15252 _ACEOF
15253 rm -f conftest.$ac_objext conftest$ac_exeext
15254 if { (eval echo "$as_me:15254: \"$ac_link\"") >&5
15255   (eval $ac_link) 2>&5
15256   ac_status=$?
15257   echo "$as_me:15257: \$? = $ac_status" >&5
15258   (exit $ac_status); } &&
15259          { ac_try='test -s conftest$ac_exeext'
15260   { (eval echo "$as_me:15260: \"$ac_try\"") >&5
15261   (eval $ac_try) 2>&5
15262   ac_status=$?
15263   echo "$as_me:15263: \$? = $ac_status" >&5
15264   (exit $ac_status); }; }; then
15265   eval "$as_ac_Lib=yes"
15266 else
15267   echo "$as_me: failed program was:" >&5
15268 cat conftest.$ac_ext >&5
15269 eval "$as_ac_Lib=no"
15270 fi
15271 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15272 LIBS=$ac_check_lib_save_LIBS
15273 fi
15274 echo "$as_me:15274: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15275 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15276 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15277   cf_cv_ncurses_pthreads=yes
15278 else
15279   cf_cv_ncurses_pthreads=no
15280 fi
15281
15282 if test "$cf_cv_ncurses_pthreads" = yes
15283 then
15284
15285 cf_add_libs="-lpthread"
15286 # Filter out duplicates - this happens with badly-designed ".pc" files...
15287 for cf_add_1lib in $LIBS
15288 do
15289         for cf_add_2lib in $cf_add_libs
15290         do
15291                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15292                 then
15293                         cf_add_1lib=
15294                         break
15295                 fi
15296         done
15297         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15298 done
15299 LIBS="$cf_add_libs"
15300
15301 fi
15302
15303 case $cf_cv_screen in
15304 (ncurses*)
15305         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15306         ;;
15307 esac
15308
15309 echo "$as_me:15309: checking for X11 rgb file" >&5
15310 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15311
15312 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15313 if test "${with_x11_rgb+set}" = set; then
15314   withval="$with_x11_rgb"
15315   RGB_PATH=$withval
15316 else
15317   RGB_PATH=auto
15318 fi;
15319
15320 if test "x$RGB_PATH" = xauto
15321 then
15322         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15323         for cf_path in \
15324                 /opt/local/share/X11/rgb.txt \
15325                 /opt/X11/share/X11/rgb.txt \
15326                 /usr/share/X11/rgb.txt \
15327                 /usr/X11/share/X11/rgb.txt \
15328                 /usr/X11/lib/X11/rgb.txt \
15329                 /usr/lib/X11/rgb.txt \
15330                 /etc/X11/rgb.txt \
15331                 /usr/pkg/lib/X11/rgb.txt \
15332                 /usr/X11R7/lib/X11/rgb.txt \
15333                 /usr/X11R6/lib/X11/rgb.txt \
15334                 /usr/X11R5/lib/X11/rgb.txt \
15335                 /usr/X11R4/lib/X11/rgb.txt \
15336                 /usr/local/lib/X11/rgb.txt \
15337                 /usr/local/share/X11/rgb.txt \
15338                 /usr/lib64/X11/rgb.txt
15339         do
15340                 if test -f "$cf_path" ; then
15341                         RGB_PATH="$cf_path"
15342                         break
15343                 fi
15344         done
15345 else
15346         cf_path=$RGB_PATH
15347
15348 if test "x$prefix" != xNONE; then
15349         cf_path_syntax="$prefix"
15350 else
15351         cf_path_syntax="$ac_default_prefix"
15352 fi
15353
15354 case ".$cf_path" in
15355 (.\$\(*\)*|.\'*\'*)
15356         ;;
15357 (..|./*|.\\*)
15358         ;;
15359 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15360         ;;
15361 (.\${*prefix}*|.\${*dir}*)
15362         eval cf_path="$cf_path"
15363         case ".$cf_path" in
15364         (.NONE/*)
15365                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15366                 ;;
15367         esac
15368         ;;
15369 (.no|.NONE/*)
15370         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15371         ;;
15372 (*)
15373         { { echo "$as_me:15373: error: expected a pathname, not \"$cf_path\"" >&5
15374 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15375    { (exit 1); exit 1; }; }
15376         ;;
15377 esac
15378
15379 fi
15380
15381 echo "$as_me:15381: result: $RGB_PATH" >&5
15382 echo "${ECHO_T}$RGB_PATH" >&6
15383
15384 cat >>confdefs.h <<EOF
15385 #define RGB_PATH "$cf_path"
15386 EOF
15387
15388 no_x11_rgb=
15389 if test "$RGB_PATH" = no
15390 then
15391         no_x11_rgb="#"
15392 fi
15393
15394 cf_curses_headers=
15395
15396 case $cf_cv_screen in
15397 (pdcurses)
15398         cf_default_panel=no
15399         cf_default_form=no
15400         cf_default_menu=no
15401         cf_default_tinfo=no
15402         ;;
15403 (xcurses|bsdcurses)
15404         cf_default_panel=no
15405         cf_default_form=no
15406         cf_default_menu=no
15407         cf_default_tinfo=yes
15408         ;;
15409 (*)
15410         cf_default_panel=yes
15411         cf_default_form=yes
15412         cf_default_menu=yes
15413         cf_default_tinfo=yes
15414         case $cf_cv_screen in
15415         (ncurses*)
15416                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
15417                 ;;
15418         esac
15419         ;;
15420 esac
15421
15422 echo "$as_me:15422: checking if you want to check for panel functions" >&5
15423 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
15424
15425 # Check whether --enable-panel or --disable-panel was given.
15426 if test "${enable_panel+set}" = set; then
15427   enableval="$enable_panel"
15428   test "$enableval" != no && enableval=yes
15429         if test "$enableval" != "yes" ; then
15430     cf_enable_panel=no
15431         else
15432                 cf_enable_panel=$cf_default_panel
15433         fi
15434 else
15435   enableval=yes
15436         cf_enable_panel=$cf_default_panel
15437
15438 fi;
15439 echo "$as_me:15439: result: $cf_enable_panel" >&5
15440 echo "${ECHO_T}$cf_enable_panel" >&6
15441 if test $cf_enable_panel = yes
15442 then
15443
15444 cf_have_curses_lib=no
15445
15446 : ${NCURSES_CONFIG_PKG:=none}
15447 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15448         :
15449 elif test "x${PKG_CONFIG:=none}" != xnone; then
15450         echo "$as_me:15450: checking pkg-config for panel$cf_cv_libtype" >&5
15451 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
15452         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
15453                 echo "$as_me:15453: result: yes" >&5
15454 echo "${ECHO_T}yes" >&6
15455
15456                 echo "$as_me:15456: checking if the panel$cf_cv_libtype package files work" >&5
15457 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
15458
15459                 cf_save_CPPFLAGS="$CPPFLAGS"
15460                 cf_save_LIBS="$LIBS"
15461
15462 cf_fix_cppflags=no
15463 cf_new_cflags=
15464 cf_new_cppflags=
15465 cf_new_extra_cppflags=
15466
15467 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
15468 do
15469 case $cf_fix_cppflags in
15470 (no)
15471         case $cf_add_cflags in
15472         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15473                 case $cf_add_cflags in
15474                 (-D*)
15475                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15476
15477                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15478                                 && test -z "${cf_tst_cflags}" \
15479                                 && cf_fix_cppflags=yes
15480
15481                         if test $cf_fix_cppflags = yes ; then
15482
15483         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15484         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15485
15486                                 continue
15487                         elif test "${cf_tst_cflags}" = "\"'" ; then
15488
15489         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15490         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15491
15492                                 continue
15493                         fi
15494                         ;;
15495                 esac
15496                 case "$CPPFLAGS" in
15497                 (*$cf_add_cflags)
15498                         ;;
15499                 (*)
15500                         case $cf_add_cflags in
15501                         (-D*)
15502                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15503
15504 CPPFLAGS=`echo "$CPPFLAGS" | \
15505         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15506                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15507
15508                                 ;;
15509                         esac
15510
15511         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15512         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15513
15514                         ;;
15515                 esac
15516                 ;;
15517         (*)
15518
15519         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15520         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15521
15522                 ;;
15523         esac
15524         ;;
15525 (yes)
15526
15527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15529
15530         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15531
15532         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15533                 && test -z "${cf_tst_cflags}" \
15534                 && cf_fix_cppflags=no
15535         ;;
15536 esac
15537 done
15538
15539 if test -n "$cf_new_cflags" ; then
15540
15541         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15542         CFLAGS="${CFLAGS}$cf_new_cflags"
15543
15544 fi
15545
15546 if test -n "$cf_new_cppflags" ; then
15547
15548         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15549         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15550
15551 fi
15552
15553 if test -n "$cf_new_extra_cppflags" ; then
15554
15555         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15556         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15557
15558 fi
15559
15560 cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
15561 # Filter out duplicates - this happens with badly-designed ".pc" files...
15562 for cf_add_1lib in $LIBS
15563 do
15564         for cf_add_2lib in $cf_add_libs
15565         do
15566                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15567                 then
15568                         cf_add_1lib=
15569                         break
15570                 fi
15571         done
15572         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15573 done
15574 LIBS="$cf_add_libs"
15575
15576                 cat >conftest.$ac_ext <<_ACEOF
15577 #line 15577 "configure"
15578 #include "confdefs.h"
15579 #include <panel.h>
15580 int
15581 main (void)
15582 {
15583 (void) new_panel ( 0 );
15584   ;
15585   return 0;
15586 }
15587 _ACEOF
15588 rm -f conftest.$ac_objext conftest$ac_exeext
15589 if { (eval echo "$as_me:15589: \"$ac_link\"") >&5
15590   (eval $ac_link) 2>&5
15591   ac_status=$?
15592   echo "$as_me:15592: \$? = $ac_status" >&5
15593   (exit $ac_status); } &&
15594          { ac_try='test -s conftest$ac_exeext'
15595   { (eval echo "$as_me:15595: \"$ac_try\"") >&5
15596   (eval $ac_try) 2>&5
15597   ac_status=$?
15598   echo "$as_me:15598: \$? = $ac_status" >&5
15599   (exit $ac_status); }; }; then
15600   if test "$cross_compiling" = yes; then
15601   cf_have_curses_lib=maybe
15602 else
15603   cat >conftest.$ac_ext <<_ACEOF
15604 #line 15604 "configure"
15605 #include "confdefs.h"
15606 #include <panel.h>
15607                                 int main(void)
15608                                 { (void) new_panel ( 0 ); return 0; }
15609 _ACEOF
15610 rm -f conftest$ac_exeext
15611 if { (eval echo "$as_me:15611: \"$ac_link\"") >&5
15612   (eval $ac_link) 2>&5
15613   ac_status=$?
15614   echo "$as_me:15614: \$? = $ac_status" >&5
15615   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15616   { (eval echo "$as_me:15616: \"$ac_try\"") >&5
15617   (eval $ac_try) 2>&5
15618   ac_status=$?
15619   echo "$as_me:15619: \$? = $ac_status" >&5
15620   (exit $ac_status); }; }; then
15621   cf_have_curses_lib=yes
15622 else
15623   echo "$as_me: program exited with status $ac_status" >&5
15624 echo "$as_me: failed program was:" >&5
15625 cat conftest.$ac_ext >&5
15626 cf_have_curses_lib=no
15627 fi
15628 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15629 fi
15630 else
15631   echo "$as_me: failed program was:" >&5
15632 cat conftest.$ac_ext >&5
15633 cf_have_curses_lib=no
15634 fi
15635 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15636                 echo "$as_me:15636: result: $cf_have_curses_lib" >&5
15637 echo "${ECHO_T}$cf_have_curses_lib" >&6
15638                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15639                 if test "$cf_have_curses_lib" != "yes"
15640                 then
15641                         CPPFLAGS="$cf_save_CPPFLAGS"
15642                         LIBS="$cf_save_LIBS"
15643                 else
15644
15645 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15646
15647                         cat >>confdefs.h <<EOF
15648 #define $cf_upper 1
15649 EOF
15650
15651                 fi
15652         fi
15653 fi
15654 if test "$cf_have_curses_lib" = no; then
15655         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
15656 echo "$as_me:15656: checking for new_panel in -lpanel$cf_cv_libtype" >&5
15657 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
15658 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15659   echo $ECHO_N "(cached) $ECHO_C" >&6
15660 else
15661   ac_check_lib_save_LIBS=$LIBS
15662 LIBS="-lpanel$cf_cv_libtype  $LIBS"
15663 cat >conftest.$ac_ext <<_ACEOF
15664 #line 15664 "configure"
15665 #include "confdefs.h"
15666
15667 /* Override any gcc2 internal prototype to avoid an error.  */
15668 #ifdef __cplusplus
15669 extern "C"
15670 #endif
15671 /* We use char because int might match the return type of a gcc2
15672    builtin and then its argument prototype would still apply.  */
15673 char new_panel ();
15674 int
15675 main (void)
15676 {
15677 new_panel ();
15678   ;
15679   return 0;
15680 }
15681 _ACEOF
15682 rm -f conftest.$ac_objext conftest$ac_exeext
15683 if { (eval echo "$as_me:15683: \"$ac_link\"") >&5
15684   (eval $ac_link) 2>&5
15685   ac_status=$?
15686   echo "$as_me:15686: \$? = $ac_status" >&5
15687   (exit $ac_status); } &&
15688          { ac_try='test -s conftest$ac_exeext'
15689   { (eval echo "$as_me:15689: \"$ac_try\"") >&5
15690   (eval $ac_try) 2>&5
15691   ac_status=$?
15692   echo "$as_me:15692: \$? = $ac_status" >&5
15693   (exit $ac_status); }; }; then
15694   eval "$as_ac_Lib=yes"
15695 else
15696   echo "$as_me: failed program was:" >&5
15697 cat conftest.$ac_ext >&5
15698 eval "$as_ac_Lib=no"
15699 fi
15700 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15701 LIBS=$ac_check_lib_save_LIBS
15702 fi
15703 echo "$as_me:15703: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15704 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15705 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15706
15707 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15708
15709 cf_add_libs="-lpanel$cf_cv_libtype"
15710 # Filter out duplicates - this happens with badly-designed ".pc" files...
15711 for cf_add_1lib in $LIBS
15712 do
15713         for cf_add_2lib in $cf_add_libs
15714         do
15715                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15716                 then
15717                         cf_add_1lib=
15718                         break
15719                 fi
15720         done
15721         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15722 done
15723 LIBS="$cf_add_libs"
15724
15725                 cat >>confdefs.h <<EOF
15726 #define $cf_upper 1
15727 EOF
15728
15729 fi
15730
15731 fi
15732
15733         cf_curses_headers="$cf_curses_headers panel.h"
15734 fi
15735
15736 echo "$as_me:15736: checking if you want to check for menu functions" >&5
15737 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
15738
15739 # Check whether --enable-menu or --disable-menu was given.
15740 if test "${enable_menu+set}" = set; then
15741   enableval="$enable_menu"
15742   test "$enableval" != no && enableval=yes
15743         if test "$enableval" != "yes" ; then
15744     cf_enable_menu=no
15745         else
15746                 cf_enable_menu=$cf_default_menu
15747         fi
15748 else
15749   enableval=yes
15750         cf_enable_menu=$cf_default_menu
15751
15752 fi;
15753 echo "$as_me:15753: result: $cf_enable_menu" >&5
15754 echo "${ECHO_T}$cf_enable_menu" >&6
15755 if test $cf_enable_menu = yes
15756 then
15757         case $cf_cv_screen in
15758         (ncurses*)
15759                 ;;
15760         (curses*)
15761
15762 echo "$as_me:15762: checking for NetBSD menu.h" >&5
15763 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
15764 if test "${cf_cv_netbsd_menu_h+set}" = set; then
15765   echo $ECHO_N "(cached) $ECHO_C" >&6
15766 else
15767
15768 cat >conftest.$ac_ext <<_ACEOF
15769 #line 15769 "configure"
15770 #include "confdefs.h"
15771
15772 #include <${cf_cv_ncurses_header:-curses.h}>
15773 #include <menu.h>
15774
15775 int
15776 main (void)
15777 {
15778
15779         MENU *menu;
15780         int y = menu->max_item_width;
15781
15782   ;
15783   return 0;
15784 }
15785 _ACEOF
15786 rm -f conftest.$ac_objext
15787 if { (eval echo "$as_me:15787: \"$ac_compile\"") >&5
15788   (eval $ac_compile) 2>&5
15789   ac_status=$?
15790   echo "$as_me:15790: \$? = $ac_status" >&5
15791   (exit $ac_status); } &&
15792          { ac_try='test -s conftest.$ac_objext'
15793   { (eval echo "$as_me:15793: \"$ac_try\"") >&5
15794   (eval $ac_try) 2>&5
15795   ac_status=$?
15796   echo "$as_me:15796: \$? = $ac_status" >&5
15797   (exit $ac_status); }; }; then
15798   cf_cv_netbsd_menu_h=yes
15799
15800 else
15801   echo "$as_me: failed program was:" >&5
15802 cat conftest.$ac_ext >&5
15803 cf_cv_netbsd_menu_h=no
15804 fi
15805 rm -f conftest.$ac_objext conftest.$ac_ext
15806
15807 fi
15808 echo "$as_me:15808: result: $cf_cv_netbsd_menu_h" >&5
15809 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
15810
15811 test "$cf_cv_netbsd_menu_h" = yes &&
15812 cat >>confdefs.h <<\EOF
15813 #define HAVE_NETBSD_MENU_H 1
15814 EOF
15815
15816                 ;;
15817         esac
15818
15819 cf_have_curses_lib=no
15820
15821 : ${NCURSES_CONFIG_PKG:=none}
15822 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15823         :
15824 elif test "x${PKG_CONFIG:=none}" != xnone; then
15825         echo "$as_me:15825: checking pkg-config for menu$cf_cv_libtype" >&5
15826 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
15827         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
15828                 echo "$as_me:15828: result: yes" >&5
15829 echo "${ECHO_T}yes" >&6
15830
15831                 echo "$as_me:15831: checking if the menu$cf_cv_libtype package files work" >&5
15832 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
15833
15834                 cf_save_CPPFLAGS="$CPPFLAGS"
15835                 cf_save_LIBS="$LIBS"
15836
15837 cf_fix_cppflags=no
15838 cf_new_cflags=
15839 cf_new_cppflags=
15840 cf_new_extra_cppflags=
15841
15842 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
15843 do
15844 case $cf_fix_cppflags in
15845 (no)
15846         case $cf_add_cflags in
15847         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15848                 case $cf_add_cflags in
15849                 (-D*)
15850                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15851
15852                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15853                                 && test -z "${cf_tst_cflags}" \
15854                                 && cf_fix_cppflags=yes
15855
15856                         if test $cf_fix_cppflags = yes ; then
15857
15858         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15859         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15860
15861                                 continue
15862                         elif test "${cf_tst_cflags}" = "\"'" ; then
15863
15864         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15865         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15866
15867                                 continue
15868                         fi
15869                         ;;
15870                 esac
15871                 case "$CPPFLAGS" in
15872                 (*$cf_add_cflags)
15873                         ;;
15874                 (*)
15875                         case $cf_add_cflags in
15876                         (-D*)
15877                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15878
15879 CPPFLAGS=`echo "$CPPFLAGS" | \
15880         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15881                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15882
15883                                 ;;
15884                         esac
15885
15886         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15887         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15888
15889                         ;;
15890                 esac
15891                 ;;
15892         (*)
15893
15894         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15895         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15896
15897                 ;;
15898         esac
15899         ;;
15900 (yes)
15901
15902         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15903         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15904
15905         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15906
15907         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15908                 && test -z "${cf_tst_cflags}" \
15909                 && cf_fix_cppflags=no
15910         ;;
15911 esac
15912 done
15913
15914 if test -n "$cf_new_cflags" ; then
15915
15916         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15917         CFLAGS="${CFLAGS}$cf_new_cflags"
15918
15919 fi
15920
15921 if test -n "$cf_new_cppflags" ; then
15922
15923         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15924         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15925
15926 fi
15927
15928 if test -n "$cf_new_extra_cppflags" ; then
15929
15930         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15931         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15932
15933 fi
15934
15935 cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
15936 # Filter out duplicates - this happens with badly-designed ".pc" files...
15937 for cf_add_1lib in $LIBS
15938 do
15939         for cf_add_2lib in $cf_add_libs
15940         do
15941                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15942                 then
15943                         cf_add_1lib=
15944                         break
15945                 fi
15946         done
15947         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15948 done
15949 LIBS="$cf_add_libs"
15950
15951                 cat >conftest.$ac_ext <<_ACEOF
15952 #line 15952 "configure"
15953 #include "confdefs.h"
15954 #include <menu.h>
15955 int
15956 main (void)
15957 {
15958 (void) menu_driver ( 0,0 );
15959   ;
15960   return 0;
15961 }
15962 _ACEOF
15963 rm -f conftest.$ac_objext conftest$ac_exeext
15964 if { (eval echo "$as_me:15964: \"$ac_link\"") >&5
15965   (eval $ac_link) 2>&5
15966   ac_status=$?
15967   echo "$as_me:15967: \$? = $ac_status" >&5
15968   (exit $ac_status); } &&
15969          { ac_try='test -s conftest$ac_exeext'
15970   { (eval echo "$as_me:15970: \"$ac_try\"") >&5
15971   (eval $ac_try) 2>&5
15972   ac_status=$?
15973   echo "$as_me:15973: \$? = $ac_status" >&5
15974   (exit $ac_status); }; }; then
15975   if test "$cross_compiling" = yes; then
15976   cf_have_curses_lib=maybe
15977 else
15978   cat >conftest.$ac_ext <<_ACEOF
15979 #line 15979 "configure"
15980 #include "confdefs.h"
15981 #include <menu.h>
15982                                 int main(void)
15983                                 { (void) menu_driver ( 0,0 ); return 0; }
15984 _ACEOF
15985 rm -f conftest$ac_exeext
15986 if { (eval echo "$as_me:15986: \"$ac_link\"") >&5
15987   (eval $ac_link) 2>&5
15988   ac_status=$?
15989   echo "$as_me:15989: \$? = $ac_status" >&5
15990   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15991   { (eval echo "$as_me:15991: \"$ac_try\"") >&5
15992   (eval $ac_try) 2>&5
15993   ac_status=$?
15994   echo "$as_me:15994: \$? = $ac_status" >&5
15995   (exit $ac_status); }; }; then
15996   cf_have_curses_lib=yes
15997 else
15998   echo "$as_me: program exited with status $ac_status" >&5
15999 echo "$as_me: failed program was:" >&5
16000 cat conftest.$ac_ext >&5
16001 cf_have_curses_lib=no
16002 fi
16003 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16004 fi
16005 else
16006   echo "$as_me: failed program was:" >&5
16007 cat conftest.$ac_ext >&5
16008 cf_have_curses_lib=no
16009 fi
16010 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16011                 echo "$as_me:16011: result: $cf_have_curses_lib" >&5
16012 echo "${ECHO_T}$cf_have_curses_lib" >&6
16013                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16014                 if test "$cf_have_curses_lib" != "yes"
16015                 then
16016                         CPPFLAGS="$cf_save_CPPFLAGS"
16017                         LIBS="$cf_save_LIBS"
16018                 else
16019
16020 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16021
16022                         cat >>confdefs.h <<EOF
16023 #define $cf_upper 1
16024 EOF
16025
16026                 fi
16027         fi
16028 fi
16029 if test "$cf_have_curses_lib" = no; then
16030         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16031 echo "$as_me:16031: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
16032 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
16033 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16034   echo $ECHO_N "(cached) $ECHO_C" >&6
16035 else
16036   ac_check_lib_save_LIBS=$LIBS
16037 LIBS="-lmenu$cf_cv_libtype  $LIBS"
16038 cat >conftest.$ac_ext <<_ACEOF
16039 #line 16039 "configure"
16040 #include "confdefs.h"
16041
16042 /* Override any gcc2 internal prototype to avoid an error.  */
16043 #ifdef __cplusplus
16044 extern "C"
16045 #endif
16046 /* We use char because int might match the return type of a gcc2
16047    builtin and then its argument prototype would still apply.  */
16048 char menu_driver ();
16049 int
16050 main (void)
16051 {
16052 menu_driver ();
16053   ;
16054   return 0;
16055 }
16056 _ACEOF
16057 rm -f conftest.$ac_objext conftest$ac_exeext
16058 if { (eval echo "$as_me:16058: \"$ac_link\"") >&5
16059   (eval $ac_link) 2>&5
16060   ac_status=$?
16061   echo "$as_me:16061: \$? = $ac_status" >&5
16062   (exit $ac_status); } &&
16063          { ac_try='test -s conftest$ac_exeext'
16064   { (eval echo "$as_me:16064: \"$ac_try\"") >&5
16065   (eval $ac_try) 2>&5
16066   ac_status=$?
16067   echo "$as_me:16067: \$? = $ac_status" >&5
16068   (exit $ac_status); }; }; then
16069   eval "$as_ac_Lib=yes"
16070 else
16071   echo "$as_me: failed program was:" >&5
16072 cat conftest.$ac_ext >&5
16073 eval "$as_ac_Lib=no"
16074 fi
16075 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16076 LIBS=$ac_check_lib_save_LIBS
16077 fi
16078 echo "$as_me:16078: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16079 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16080 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16081
16082 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16083
16084 cf_add_libs="-lmenu$cf_cv_libtype"
16085 # Filter out duplicates - this happens with badly-designed ".pc" files...
16086 for cf_add_1lib in $LIBS
16087 do
16088         for cf_add_2lib in $cf_add_libs
16089         do
16090                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16091                 then
16092                         cf_add_1lib=
16093                         break
16094                 fi
16095         done
16096         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16097 done
16098 LIBS="$cf_add_libs"
16099
16100                 cat >>confdefs.h <<EOF
16101 #define $cf_upper 1
16102 EOF
16103
16104 fi
16105
16106 fi
16107
16108         cf_curses_headers="$cf_curses_headers menu.h"
16109 fi
16110
16111 echo "$as_me:16111: checking if you want to check for form functions" >&5
16112 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16113
16114 # Check whether --enable-form or --disable-form was given.
16115 if test "${enable_form+set}" = set; then
16116   enableval="$enable_form"
16117   test "$enableval" != no && enableval=yes
16118         if test "$enableval" != "yes" ; then
16119     cf_enable_form=no
16120         else
16121                 cf_enable_form=$cf_default_form
16122         fi
16123 else
16124   enableval=yes
16125         cf_enable_form=$cf_default_form
16126
16127 fi;
16128 echo "$as_me:16128: result: $cf_enable_form" >&5
16129 echo "${ECHO_T}$cf_enable_form" >&6
16130 if test $cf_enable_form = yes
16131 then
16132         case $cf_cv_screen in
16133         (ncurses*)
16134                 ;;
16135         (curses*)
16136
16137 echo "$as_me:16137: checking for NetBSD form.h" >&5
16138 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16139 if test "${cf_cv_netbsd_form_h+set}" = set; then
16140   echo $ECHO_N "(cached) $ECHO_C" >&6
16141 else
16142
16143 cat >conftest.$ac_ext <<_ACEOF
16144 #line 16144 "configure"
16145 #include "confdefs.h"
16146
16147 #include <${cf_cv_ncurses_header:-curses.h}>
16148 #include <form.h>
16149
16150 int
16151 main (void)
16152 {
16153
16154         FORM *form;
16155         int y = current_field(form)->cursor_ypos;
16156         int x = current_field(form)->cursor_xpos;
16157
16158   ;
16159   return 0;
16160 }
16161 _ACEOF
16162 rm -f conftest.$ac_objext
16163 if { (eval echo "$as_me:16163: \"$ac_compile\"") >&5
16164   (eval $ac_compile) 2>&5
16165   ac_status=$?
16166   echo "$as_me:16166: \$? = $ac_status" >&5
16167   (exit $ac_status); } &&
16168          { ac_try='test -s conftest.$ac_objext'
16169   { (eval echo "$as_me:16169: \"$ac_try\"") >&5
16170   (eval $ac_try) 2>&5
16171   ac_status=$?
16172   echo "$as_me:16172: \$? = $ac_status" >&5
16173   (exit $ac_status); }; }; then
16174   cf_cv_netbsd_form_h=yes
16175
16176 else
16177   echo "$as_me: failed program was:" >&5
16178 cat conftest.$ac_ext >&5
16179 cf_cv_netbsd_form_h=no
16180 fi
16181 rm -f conftest.$ac_objext conftest.$ac_ext
16182
16183 fi
16184 echo "$as_me:16184: result: $cf_cv_netbsd_form_h" >&5
16185 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16186
16187 test "$cf_cv_netbsd_form_h" = yes &&
16188 cat >>confdefs.h <<\EOF
16189 #define HAVE_NETBSD_FORM_H 1
16190 EOF
16191
16192                 ;;
16193         esac
16194
16195 cf_have_curses_lib=no
16196
16197 : ${NCURSES_CONFIG_PKG:=none}
16198 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16199         :
16200 elif test "x${PKG_CONFIG:=none}" != xnone; then
16201         echo "$as_me:16201: checking pkg-config for form$cf_cv_libtype" >&5
16202 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
16203         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
16204                 echo "$as_me:16204: result: yes" >&5
16205 echo "${ECHO_T}yes" >&6
16206
16207                 echo "$as_me:16207: checking if the form$cf_cv_libtype package files work" >&5
16208 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
16209
16210                 cf_save_CPPFLAGS="$CPPFLAGS"
16211                 cf_save_LIBS="$LIBS"
16212
16213 cf_fix_cppflags=no
16214 cf_new_cflags=
16215 cf_new_cppflags=
16216 cf_new_extra_cppflags=
16217
16218 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
16219 do
16220 case $cf_fix_cppflags in
16221 (no)
16222         case $cf_add_cflags in
16223         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16224                 case $cf_add_cflags in
16225                 (-D*)
16226                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16227
16228                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16229                                 && test -z "${cf_tst_cflags}" \
16230                                 && cf_fix_cppflags=yes
16231
16232                         if test $cf_fix_cppflags = yes ; then
16233
16234         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16235         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16236
16237                                 continue
16238                         elif test "${cf_tst_cflags}" = "\"'" ; then
16239
16240         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16241         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16242
16243                                 continue
16244                         fi
16245                         ;;
16246                 esac
16247                 case "$CPPFLAGS" in
16248                 (*$cf_add_cflags)
16249                         ;;
16250                 (*)
16251                         case $cf_add_cflags in
16252                         (-D*)
16253                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16254
16255 CPPFLAGS=`echo "$CPPFLAGS" | \
16256         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16257                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16258
16259                                 ;;
16260                         esac
16261
16262         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16263         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16264
16265                         ;;
16266                 esac
16267                 ;;
16268         (*)
16269
16270         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16271         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16272
16273                 ;;
16274         esac
16275         ;;
16276 (yes)
16277
16278         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16279         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16280
16281         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16282
16283         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16284                 && test -z "${cf_tst_cflags}" \
16285                 && cf_fix_cppflags=no
16286         ;;
16287 esac
16288 done
16289
16290 if test -n "$cf_new_cflags" ; then
16291
16292         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16293         CFLAGS="${CFLAGS}$cf_new_cflags"
16294
16295 fi
16296
16297 if test -n "$cf_new_cppflags" ; then
16298
16299         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16300         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16301
16302 fi
16303
16304 if test -n "$cf_new_extra_cppflags" ; then
16305
16306         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16307         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16308
16309 fi
16310
16311 cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
16312 # Filter out duplicates - this happens with badly-designed ".pc" files...
16313 for cf_add_1lib in $LIBS
16314 do
16315         for cf_add_2lib in $cf_add_libs
16316         do
16317                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16318                 then
16319                         cf_add_1lib=
16320                         break
16321                 fi
16322         done
16323         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16324 done
16325 LIBS="$cf_add_libs"
16326
16327                 cat >conftest.$ac_ext <<_ACEOF
16328 #line 16328 "configure"
16329 #include "confdefs.h"
16330 #include <form.h>
16331 int
16332 main (void)
16333 {
16334 (void) form_driver ( 0,0 );
16335   ;
16336   return 0;
16337 }
16338 _ACEOF
16339 rm -f conftest.$ac_objext conftest$ac_exeext
16340 if { (eval echo "$as_me:16340: \"$ac_link\"") >&5
16341   (eval $ac_link) 2>&5
16342   ac_status=$?
16343   echo "$as_me:16343: \$? = $ac_status" >&5
16344   (exit $ac_status); } &&
16345          { ac_try='test -s conftest$ac_exeext'
16346   { (eval echo "$as_me:16346: \"$ac_try\"") >&5
16347   (eval $ac_try) 2>&5
16348   ac_status=$?
16349   echo "$as_me:16349: \$? = $ac_status" >&5
16350   (exit $ac_status); }; }; then
16351   if test "$cross_compiling" = yes; then
16352   cf_have_curses_lib=maybe
16353 else
16354   cat >conftest.$ac_ext <<_ACEOF
16355 #line 16355 "configure"
16356 #include "confdefs.h"
16357 #include <form.h>
16358                                 int main(void)
16359                                 { (void) form_driver ( 0,0 ); return 0; }
16360 _ACEOF
16361 rm -f conftest$ac_exeext
16362 if { (eval echo "$as_me:16362: \"$ac_link\"") >&5
16363   (eval $ac_link) 2>&5
16364   ac_status=$?
16365   echo "$as_me:16365: \$? = $ac_status" >&5
16366   (exit $ac_status); } && { ac_try='./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   cf_have_curses_lib=yes
16373 else
16374   echo "$as_me: program exited with status $ac_status" >&5
16375 echo "$as_me: failed program was:" >&5
16376 cat conftest.$ac_ext >&5
16377 cf_have_curses_lib=no
16378 fi
16379 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16380 fi
16381 else
16382   echo "$as_me: failed program was:" >&5
16383 cat conftest.$ac_ext >&5
16384 cf_have_curses_lib=no
16385 fi
16386 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16387                 echo "$as_me:16387: result: $cf_have_curses_lib" >&5
16388 echo "${ECHO_T}$cf_have_curses_lib" >&6
16389                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16390                 if test "$cf_have_curses_lib" != "yes"
16391                 then
16392                         CPPFLAGS="$cf_save_CPPFLAGS"
16393                         LIBS="$cf_save_LIBS"
16394                 else
16395
16396 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16397
16398                         cat >>confdefs.h <<EOF
16399 #define $cf_upper 1
16400 EOF
16401
16402                 fi
16403         fi
16404 fi
16405 if test "$cf_have_curses_lib" = no; then
16406         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
16407 echo "$as_me:16407: checking for form_driver in -lform$cf_cv_libtype" >&5
16408 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
16409 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16410   echo $ECHO_N "(cached) $ECHO_C" >&6
16411 else
16412   ac_check_lib_save_LIBS=$LIBS
16413 LIBS="-lform$cf_cv_libtype  $LIBS"
16414 cat >conftest.$ac_ext <<_ACEOF
16415 #line 16415 "configure"
16416 #include "confdefs.h"
16417
16418 /* Override any gcc2 internal prototype to avoid an error.  */
16419 #ifdef __cplusplus
16420 extern "C"
16421 #endif
16422 /* We use char because int might match the return type of a gcc2
16423    builtin and then its argument prototype would still apply.  */
16424 char form_driver ();
16425 int
16426 main (void)
16427 {
16428 form_driver ();
16429   ;
16430   return 0;
16431 }
16432 _ACEOF
16433 rm -f conftest.$ac_objext conftest$ac_exeext
16434 if { (eval echo "$as_me:16434: \"$ac_link\"") >&5
16435   (eval $ac_link) 2>&5
16436   ac_status=$?
16437   echo "$as_me:16437: \$? = $ac_status" >&5
16438   (exit $ac_status); } &&
16439          { ac_try='test -s conftest$ac_exeext'
16440   { (eval echo "$as_me:16440: \"$ac_try\"") >&5
16441   (eval $ac_try) 2>&5
16442   ac_status=$?
16443   echo "$as_me:16443: \$? = $ac_status" >&5
16444   (exit $ac_status); }; }; then
16445   eval "$as_ac_Lib=yes"
16446 else
16447   echo "$as_me: failed program was:" >&5
16448 cat conftest.$ac_ext >&5
16449 eval "$as_ac_Lib=no"
16450 fi
16451 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16452 LIBS=$ac_check_lib_save_LIBS
16453 fi
16454 echo "$as_me:16454: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16455 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16456 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16457
16458 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16459
16460 cf_add_libs="-lform$cf_cv_libtype"
16461 # Filter out duplicates - this happens with badly-designed ".pc" files...
16462 for cf_add_1lib in $LIBS
16463 do
16464         for cf_add_2lib in $cf_add_libs
16465         do
16466                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16467                 then
16468                         cf_add_1lib=
16469                         break
16470                 fi
16471         done
16472         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16473 done
16474 LIBS="$cf_add_libs"
16475
16476                 cat >>confdefs.h <<EOF
16477 #define $cf_upper 1
16478 EOF
16479
16480 fi
16481
16482 fi
16483
16484         cf_curses_headers="$cf_curses_headers form.h"
16485 fi
16486
16487 # look for curses-related headers
16488
16489 for ac_header in $cf_curses_headers
16490 do
16491 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16492 echo "$as_me:16492: checking for $ac_header" >&5
16493 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16494 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16495   echo $ECHO_N "(cached) $ECHO_C" >&6
16496 else
16497   cat >conftest.$ac_ext <<_ACEOF
16498 #line 16498 "configure"
16499 #include "confdefs.h"
16500 #include <$ac_header>
16501 _ACEOF
16502 if { (eval echo "$as_me:16502: \"$ac_cpp conftest.$ac_ext\"") >&5
16503   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16504   ac_status=$?
16505   egrep -v '^ *\+' conftest.er1 >conftest.err
16506   rm -f conftest.er1
16507   cat conftest.err >&5
16508   echo "$as_me:16508: \$? = $ac_status" >&5
16509   (exit $ac_status); } >/dev/null; then
16510   if test -s conftest.err; then
16511     ac_cpp_err=$ac_c_preproc_warn_flag
16512   else
16513     ac_cpp_err=
16514   fi
16515 else
16516   ac_cpp_err=yes
16517 fi
16518 if test -z "$ac_cpp_err"; then
16519   eval "$as_ac_Header=yes"
16520 else
16521   echo "$as_me: failed program was:" >&5
16522   cat conftest.$ac_ext >&5
16523   eval "$as_ac_Header=no"
16524 fi
16525 rm -f conftest.err conftest.$ac_ext
16526 fi
16527 echo "$as_me:16527: result: `eval echo '${'$as_ac_Header'}'`" >&5
16528 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16529 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16530   cat >>confdefs.h <<EOF
16531 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16532 EOF
16533
16534 fi
16535 done
16536
16537 echo "$as_me:16537: checking for ANSI C header files" >&5
16538 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16539 if test "${ac_cv_header_stdc+set}" = set; then
16540   echo $ECHO_N "(cached) $ECHO_C" >&6
16541 else
16542   cat >conftest.$ac_ext <<_ACEOF
16543 #line 16543 "configure"
16544 #include "confdefs.h"
16545 #include <stdlib.h>
16546 #include <stdarg.h>
16547 #include <string.h>
16548 #include <float.h>
16549
16550 _ACEOF
16551 if { (eval echo "$as_me:16551: \"$ac_cpp conftest.$ac_ext\"") >&5
16552   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16553   ac_status=$?
16554   egrep -v '^ *\+' conftest.er1 >conftest.err
16555   rm -f conftest.er1
16556   cat conftest.err >&5
16557   echo "$as_me:16557: \$? = $ac_status" >&5
16558   (exit $ac_status); } >/dev/null; then
16559   if test -s conftest.err; then
16560     ac_cpp_err=$ac_c_preproc_warn_flag
16561   else
16562     ac_cpp_err=
16563   fi
16564 else
16565   ac_cpp_err=yes
16566 fi
16567 if test -z "$ac_cpp_err"; then
16568   ac_cv_header_stdc=yes
16569 else
16570   echo "$as_me: failed program was:" >&5
16571   cat conftest.$ac_ext >&5
16572   ac_cv_header_stdc=no
16573 fi
16574 rm -f conftest.err conftest.$ac_ext
16575
16576 if test $ac_cv_header_stdc = yes; then
16577   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16578   cat >conftest.$ac_ext <<_ACEOF
16579 #line 16579 "configure"
16580 #include "confdefs.h"
16581 #include <string.h>
16582
16583 _ACEOF
16584 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16585   egrep "memchr" >/dev/null 2>&1; then
16586   :
16587 else
16588   ac_cv_header_stdc=no
16589 fi
16590 rm -rf conftest*
16591
16592 fi
16593
16594 if test $ac_cv_header_stdc = yes; then
16595   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16596   cat >conftest.$ac_ext <<_ACEOF
16597 #line 16597 "configure"
16598 #include "confdefs.h"
16599 #include <stdlib.h>
16600
16601 _ACEOF
16602 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16603   egrep "free" >/dev/null 2>&1; then
16604   :
16605 else
16606   ac_cv_header_stdc=no
16607 fi
16608 rm -rf conftest*
16609
16610 fi
16611
16612 if test $ac_cv_header_stdc = yes; then
16613   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16614   if test "$cross_compiling" = yes; then
16615   :
16616 else
16617   cat >conftest.$ac_ext <<_ACEOF
16618 #line 16618 "configure"
16619 #include "confdefs.h"
16620 #include <ctype.h>
16621 #if ((' ' & 0x0FF) == 0x020)
16622 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16623 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16624 #else
16625 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16626                      || ('j' <= (c) && (c) <= 'r') \
16627                      || ('s' <= (c) && (c) <= 'z'))
16628 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16629 #endif
16630
16631 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16632 int
16633 main (void)
16634 {
16635   int i;
16636   for (i = 0; i < 256; i++)
16637     if (XOR (islower (i), ISLOWER (i))
16638         || toupper (i) != TOUPPER (i))
16639       $ac_main_return(2);
16640   $ac_main_return (0);
16641 }
16642 _ACEOF
16643 rm -f conftest$ac_exeext
16644 if { (eval echo "$as_me:16644: \"$ac_link\"") >&5
16645   (eval $ac_link) 2>&5
16646   ac_status=$?
16647   echo "$as_me:16647: \$? = $ac_status" >&5
16648   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16649   { (eval echo "$as_me:16649: \"$ac_try\"") >&5
16650   (eval $ac_try) 2>&5
16651   ac_status=$?
16652   echo "$as_me:16652: \$? = $ac_status" >&5
16653   (exit $ac_status); }; }; then
16654   :
16655 else
16656   echo "$as_me: program exited with status $ac_status" >&5
16657 echo "$as_me: failed program was:" >&5
16658 cat conftest.$ac_ext >&5
16659 ac_cv_header_stdc=no
16660 fi
16661 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16662 fi
16663 fi
16664 fi
16665 echo "$as_me:16665: result: $ac_cv_header_stdc" >&5
16666 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16667 if test $ac_cv_header_stdc = yes; then
16668
16669 cat >>confdefs.h <<\EOF
16670 #define STDC_HEADERS 1
16671 EOF
16672
16673 fi
16674
16675 echo "$as_me:16675: checking whether time.h and sys/time.h may both be included" >&5
16676 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16677 if test "${ac_cv_header_time+set}" = set; then
16678   echo $ECHO_N "(cached) $ECHO_C" >&6
16679 else
16680   cat >conftest.$ac_ext <<_ACEOF
16681 #line 16681 "configure"
16682 #include "confdefs.h"
16683 #include <sys/types.h>
16684 #include <sys/time.h>
16685 #include <time.h>
16686
16687 int
16688 main (void)
16689 {
16690 if ((struct tm *) 0)
16691 return 0;
16692   ;
16693   return 0;
16694 }
16695 _ACEOF
16696 rm -f conftest.$ac_objext
16697 if { (eval echo "$as_me:16697: \"$ac_compile\"") >&5
16698   (eval $ac_compile) 2>&5
16699   ac_status=$?
16700   echo "$as_me:16700: \$? = $ac_status" >&5
16701   (exit $ac_status); } &&
16702          { ac_try='test -s conftest.$ac_objext'
16703   { (eval echo "$as_me:16703: \"$ac_try\"") >&5
16704   (eval $ac_try) 2>&5
16705   ac_status=$?
16706   echo "$as_me:16706: \$? = $ac_status" >&5
16707   (exit $ac_status); }; }; then
16708   ac_cv_header_time=yes
16709 else
16710   echo "$as_me: failed program was:" >&5
16711 cat conftest.$ac_ext >&5
16712 ac_cv_header_time=no
16713 fi
16714 rm -f conftest.$ac_objext conftest.$ac_ext
16715 fi
16716 echo "$as_me:16716: result: $ac_cv_header_time" >&5
16717 echo "${ECHO_T}$ac_cv_header_time" >&6
16718 if test $ac_cv_header_time = yes; then
16719
16720 cat >>confdefs.h <<\EOF
16721 #define TIME_WITH_SYS_TIME 1
16722 EOF
16723
16724 fi
16725
16726 for ac_header in \
16727 getopt.h \
16728 locale.h \
16729 math.h \
16730 stdarg.h \
16731 stdint.h \
16732 sys/ioctl.h \
16733 sys/select.h \
16734 sys/time.h \
16735 termios.h \
16736 unistd.h \
16737
16738 do
16739 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16740 echo "$as_me:16740: checking for $ac_header" >&5
16741 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16742 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16743   echo $ECHO_N "(cached) $ECHO_C" >&6
16744 else
16745   cat >conftest.$ac_ext <<_ACEOF
16746 #line 16746 "configure"
16747 #include "confdefs.h"
16748 #include <$ac_header>
16749 _ACEOF
16750 if { (eval echo "$as_me:16750: \"$ac_cpp conftest.$ac_ext\"") >&5
16751   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16752   ac_status=$?
16753   egrep -v '^ *\+' conftest.er1 >conftest.err
16754   rm -f conftest.er1
16755   cat conftest.err >&5
16756   echo "$as_me:16756: \$? = $ac_status" >&5
16757   (exit $ac_status); } >/dev/null; then
16758   if test -s conftest.err; then
16759     ac_cpp_err=$ac_c_preproc_warn_flag
16760   else
16761     ac_cpp_err=
16762   fi
16763 else
16764   ac_cpp_err=yes
16765 fi
16766 if test -z "$ac_cpp_err"; then
16767   eval "$as_ac_Header=yes"
16768 else
16769   echo "$as_me: failed program was:" >&5
16770   cat conftest.$ac_ext >&5
16771   eval "$as_ac_Header=no"
16772 fi
16773 rm -f conftest.err conftest.$ac_ext
16774 fi
16775 echo "$as_me:16775: result: `eval echo '${'$as_ac_Header'}'`" >&5
16776 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16777 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16778   cat >>confdefs.h <<EOF
16779 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16780 EOF
16781
16782 fi
16783 done
16784
16785 for ac_header in unistd.h getopt.h
16786 do
16787 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16788 echo "$as_me:16788: checking for $ac_header" >&5
16789 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16790 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16791   echo $ECHO_N "(cached) $ECHO_C" >&6
16792 else
16793   cat >conftest.$ac_ext <<_ACEOF
16794 #line 16794 "configure"
16795 #include "confdefs.h"
16796 #include <$ac_header>
16797 _ACEOF
16798 if { (eval echo "$as_me:16798: \"$ac_cpp conftest.$ac_ext\"") >&5
16799   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16800   ac_status=$?
16801   egrep -v '^ *\+' conftest.er1 >conftest.err
16802   rm -f conftest.er1
16803   cat conftest.err >&5
16804   echo "$as_me:16804: \$? = $ac_status" >&5
16805   (exit $ac_status); } >/dev/null; then
16806   if test -s conftest.err; then
16807     ac_cpp_err=$ac_c_preproc_warn_flag
16808   else
16809     ac_cpp_err=
16810   fi
16811 else
16812   ac_cpp_err=yes
16813 fi
16814 if test -z "$ac_cpp_err"; then
16815   eval "$as_ac_Header=yes"
16816 else
16817   echo "$as_me: failed program was:" >&5
16818   cat conftest.$ac_ext >&5
16819   eval "$as_ac_Header=no"
16820 fi
16821 rm -f conftest.err conftest.$ac_ext
16822 fi
16823 echo "$as_me:16823: result: `eval echo '${'$as_ac_Header'}'`" >&5
16824 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16825 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16826   cat >>confdefs.h <<EOF
16827 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16828 EOF
16829
16830 fi
16831 done
16832
16833 echo "$as_me:16833: checking for header declaring getopt variables" >&5
16834 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
16835 if test "${cf_cv_getopt_header+set}" = set; then
16836   echo $ECHO_N "(cached) $ECHO_C" >&6
16837 else
16838
16839 cf_cv_getopt_header=none
16840 for cf_header in stdio.h stdlib.h unistd.h getopt.h
16841 do
16842 cat >conftest.$ac_ext <<_ACEOF
16843 #line 16843 "configure"
16844 #include "confdefs.h"
16845
16846 #include <$cf_header>
16847 int
16848 main (void)
16849 {
16850 int x = optind; char *y = optarg
16851   ;
16852   return 0;
16853 }
16854 _ACEOF
16855 rm -f conftest.$ac_objext
16856 if { (eval echo "$as_me:16856: \"$ac_compile\"") >&5
16857   (eval $ac_compile) 2>&5
16858   ac_status=$?
16859   echo "$as_me:16859: \$? = $ac_status" >&5
16860   (exit $ac_status); } &&
16861          { ac_try='test -s conftest.$ac_objext'
16862   { (eval echo "$as_me:16862: \"$ac_try\"") >&5
16863   (eval $ac_try) 2>&5
16864   ac_status=$?
16865   echo "$as_me:16865: \$? = $ac_status" >&5
16866   (exit $ac_status); }; }; then
16867   cf_cv_getopt_header=$cf_header
16868  break
16869 else
16870   echo "$as_me: failed program was:" >&5
16871 cat conftest.$ac_ext >&5
16872 fi
16873 rm -f conftest.$ac_objext conftest.$ac_ext
16874 done
16875
16876 fi
16877 echo "$as_me:16877: result: $cf_cv_getopt_header" >&5
16878 echo "${ECHO_T}$cf_cv_getopt_header" >&6
16879 if test $cf_cv_getopt_header != none ; then
16880
16881 cat >>confdefs.h <<\EOF
16882 #define HAVE_GETOPT_HEADER 1
16883 EOF
16884
16885 fi
16886 if test $cf_cv_getopt_header = getopt.h ; then
16887
16888 cat >>confdefs.h <<\EOF
16889 #define NEED_GETOPT_H 1
16890 EOF
16891
16892 fi
16893
16894 for ac_func in \
16895 getopt \
16896 gettimeofday \
16897 tdestroy \
16898 tsearch \
16899
16900 do
16901 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16902 echo "$as_me:16902: checking for $ac_func" >&5
16903 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
16904 if eval "test \"\${$as_ac_var+set}\" = set"; then
16905   echo $ECHO_N "(cached) $ECHO_C" >&6
16906 else
16907   cat >conftest.$ac_ext <<_ACEOF
16908 #line 16908 "configure"
16909 #include "confdefs.h"
16910 #define $ac_func autoconf_temporary
16911 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16912 #undef $ac_func
16913
16914 #ifdef __cplusplus
16915 extern "C"
16916 #endif
16917
16918 /* We use char because int might match the return type of a gcc2
16919    builtin and then its argument prototype would still apply.  */
16920 char $ac_func (void);
16921
16922 int
16923 main (void)
16924 {
16925
16926 /* The GNU C library defines stubs for functions which it implements
16927     to always fail with ENOSYS.  Some functions are actually named
16928     something starting with __ and the normal name is an alias.  */
16929 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16930 #error found stub for $ac_func
16931 #endif
16932
16933         return $ac_func ();
16934   ;
16935   return 0;
16936 }
16937 _ACEOF
16938 rm -f conftest.$ac_objext conftest$ac_exeext
16939 if { (eval echo "$as_me:16939: \"$ac_link\"") >&5
16940   (eval $ac_link) 2>&5
16941   ac_status=$?
16942   echo "$as_me:16942: \$? = $ac_status" >&5
16943   (exit $ac_status); } &&
16944          { ac_try='test -s conftest$ac_exeext'
16945   { (eval echo "$as_me:16945: \"$ac_try\"") >&5
16946   (eval $ac_try) 2>&5
16947   ac_status=$?
16948   echo "$as_me:16948: \$? = $ac_status" >&5
16949   (exit $ac_status); }; }; then
16950   eval "$as_ac_var=yes"
16951 else
16952   echo "$as_me: failed program was:" >&5
16953 cat conftest.$ac_ext >&5
16954 eval "$as_ac_var=no"
16955 fi
16956 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16957 fi
16958 echo "$as_me:16958: result: `eval echo '${'$as_ac_var'}'`" >&5
16959 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
16960 if test `eval echo '${'$as_ac_var'}'` = yes; then
16961   cat >>confdefs.h <<EOF
16962 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
16963 EOF
16964
16965 fi
16966 done
16967
16968 # use a compile-check to work with ncurses*-config and subdirectory includes
16969 echo "$as_me:16969: checking if we can use termcap.h" >&5
16970 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
16971 if test "${cf_cv_have_termcap_h+set}" = set; then
16972   echo $ECHO_N "(cached) $ECHO_C" >&6
16973 else
16974
16975         cat >conftest.$ac_ext <<_ACEOF
16976 #line 16976 "configure"
16977 #include "confdefs.h"
16978
16979 #include <curses.h>
16980 #include <termcap.h>
16981
16982 int
16983 main (void)
16984 {
16985 return 0;
16986   ;
16987   return 0;
16988 }
16989 _ACEOF
16990 rm -f conftest.$ac_objext
16991 if { (eval echo "$as_me:16991: \"$ac_compile\"") >&5
16992   (eval $ac_compile) 2>&5
16993   ac_status=$?
16994   echo "$as_me:16994: \$? = $ac_status" >&5
16995   (exit $ac_status); } &&
16996          { ac_try='test -s conftest.$ac_objext'
16997   { (eval echo "$as_me:16997: \"$ac_try\"") >&5
16998   (eval $ac_try) 2>&5
16999   ac_status=$?
17000   echo "$as_me:17000: \$? = $ac_status" >&5
17001   (exit $ac_status); }; }; then
17002   cf_cv_have_termcap_h=yes
17003 else
17004   echo "$as_me: failed program was:" >&5
17005 cat conftest.$ac_ext >&5
17006 cf_cv_have_termcap_h=no
17007 fi
17008 rm -f conftest.$ac_objext conftest.$ac_ext
17009 fi
17010 echo "$as_me:17010: result: $cf_cv_have_termcap_h" >&5
17011 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17012 test "x$cf_cv_have_termcap_h" = xyes && cat >>confdefs.h <<\EOF
17013 #define HAVE_TERMCAP_H 1
17014 EOF
17015
17016 if test "x$ac_cv_func_getopt" = xno; then
17017         { { echo "$as_me:17017: error: getopt is required for building programs" >&5
17018 echo "$as_me: error: getopt is required for building programs" >&2;}
17019    { (exit 1); exit 1; }; }
17020 fi
17021
17022 if test "$cf_enable_widec" = yes; then
17023
17024 for ac_func in \
17025 mblen \
17026 mbrlen \
17027 mbrtowc \
17028 mbsrtowcs \
17029 mbstowcs \
17030 mbtowc \
17031 wcsrtombs \
17032 wcstombs \
17033
17034 do
17035 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17036 echo "$as_me:17036: checking for $ac_func" >&5
17037 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17038 if eval "test \"\${$as_ac_var+set}\" = set"; then
17039   echo $ECHO_N "(cached) $ECHO_C" >&6
17040 else
17041   cat >conftest.$ac_ext <<_ACEOF
17042 #line 17042 "configure"
17043 #include "confdefs.h"
17044 #define $ac_func autoconf_temporary
17045 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17046 #undef $ac_func
17047
17048 #ifdef __cplusplus
17049 extern "C"
17050 #endif
17051
17052 /* We use char because int might match the return type of a gcc2
17053    builtin and then its argument prototype would still apply.  */
17054 char $ac_func (void);
17055
17056 int
17057 main (void)
17058 {
17059
17060 /* The GNU C library defines stubs for functions which it implements
17061     to always fail with ENOSYS.  Some functions are actually named
17062     something starting with __ and the normal name is an alias.  */
17063 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17064 #error found stub for $ac_func
17065 #endif
17066
17067         return $ac_func ();
17068   ;
17069   return 0;
17070 }
17071 _ACEOF
17072 rm -f conftest.$ac_objext conftest$ac_exeext
17073 if { (eval echo "$as_me:17073: \"$ac_link\"") >&5
17074   (eval $ac_link) 2>&5
17075   ac_status=$?
17076   echo "$as_me:17076: \$? = $ac_status" >&5
17077   (exit $ac_status); } &&
17078          { ac_try='test -s conftest$ac_exeext'
17079   { (eval echo "$as_me:17079: \"$ac_try\"") >&5
17080   (eval $ac_try) 2>&5
17081   ac_status=$?
17082   echo "$as_me:17082: \$? = $ac_status" >&5
17083   (exit $ac_status); }; }; then
17084   eval "$as_ac_var=yes"
17085 else
17086   echo "$as_me: failed program was:" >&5
17087 cat conftest.$ac_ext >&5
17088 eval "$as_ac_var=no"
17089 fi
17090 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17091 fi
17092 echo "$as_me:17092: result: `eval echo '${'$as_ac_var'}'`" >&5
17093 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17094 if test `eval echo '${'$as_ac_var'}'` = yes; then
17095   cat >>confdefs.h <<EOF
17096 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17097 EOF
17098
17099 fi
17100 done
17101
17102 fi
17103
17104 echo "$as_me:17104: checking definition to turn on extended curses functions" >&5
17105 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17106 if test "${cf_cv_need_xopen_extension+set}" = set; then
17107   echo $ECHO_N "(cached) $ECHO_C" >&6
17108 else
17109
17110 cf_cv_need_xopen_extension=unknown
17111 cat >conftest.$ac_ext <<_ACEOF
17112 #line 17112 "configure"
17113 #include "confdefs.h"
17114
17115 #include <stdlib.h>
17116 #include <${cf_cv_ncurses_header:-curses.h}>
17117 int
17118 main (void)
17119 {
17120
17121 #if defined(NCURSES_VERSION_PATCH)
17122 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17123         make an error
17124 #endif
17125 #endif
17126 #ifdef NCURSES_VERSION
17127         cchar_t check;
17128         int check2 = curs_set((int)sizeof(check));
17129 #endif
17130         long x = winnstr(stdscr, "", 0);
17131         int x1, y1;
17132         getbegyx(stdscr, y1, x1)
17133   ;
17134   return 0;
17135 }
17136 _ACEOF
17137 rm -f conftest.$ac_objext conftest$ac_exeext
17138 if { (eval echo "$as_me:17138: \"$ac_link\"") >&5
17139   (eval $ac_link) 2>&5
17140   ac_status=$?
17141   echo "$as_me:17141: \$? = $ac_status" >&5
17142   (exit $ac_status); } &&
17143          { ac_try='test -s conftest$ac_exeext'
17144   { (eval echo "$as_me:17144: \"$ac_try\"") >&5
17145   (eval $ac_try) 2>&5
17146   ac_status=$?
17147   echo "$as_me:17147: \$? = $ac_status" >&5
17148   (exit $ac_status); }; }; then
17149   cf_cv_need_xopen_extension=none
17150 else
17151   echo "$as_me: failed program was:" >&5
17152 cat conftest.$ac_ext >&5
17153
17154         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17155         do
17156                 cat >conftest.$ac_ext <<_ACEOF
17157 #line 17157 "configure"
17158 #include "confdefs.h"
17159
17160 #define $cf_try_xopen_extension 1
17161 #include <stdlib.h>
17162 #include <${cf_cv_ncurses_header:-curses.h}>
17163 int
17164 main (void)
17165 {
17166
17167 #ifdef NCURSES_VERSION
17168                 cchar_t check;
17169                 int check2 = curs_set((int)sizeof(check));
17170 #endif
17171                 long x = winnstr(stdscr, "", 0);
17172                 int x1, y1;
17173                 getbegyx(stdscr, y1, x1)
17174   ;
17175   return 0;
17176 }
17177 _ACEOF
17178 rm -f conftest.$ac_objext conftest$ac_exeext
17179 if { (eval echo "$as_me:17179: \"$ac_link\"") >&5
17180   (eval $ac_link) 2>&5
17181   ac_status=$?
17182   echo "$as_me:17182: \$? = $ac_status" >&5
17183   (exit $ac_status); } &&
17184          { ac_try='test -s conftest$ac_exeext'
17185   { (eval echo "$as_me:17185: \"$ac_try\"") >&5
17186   (eval $ac_try) 2>&5
17187   ac_status=$?
17188   echo "$as_me:17188: \$? = $ac_status" >&5
17189   (exit $ac_status); }; }; then
17190   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17191 else
17192   echo "$as_me: failed program was:" >&5
17193 cat conftest.$ac_ext >&5
17194 fi
17195 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17196         done
17197
17198 fi
17199 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17200
17201 fi
17202 echo "$as_me:17202: result: $cf_cv_need_xopen_extension" >&5
17203 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17204
17205 case $cf_cv_need_xopen_extension in
17206 (*_*)
17207
17208         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17209         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17210
17211         ;;
17212 esac
17213
17214 echo "$as_me:17214: checking for term.h" >&5
17215 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17216 if test "${cf_cv_term_header+set}" = set; then
17217   echo $ECHO_N "(cached) $ECHO_C" >&6
17218 else
17219
17220 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17221 # for <term.h> if we do not find the variant.
17222
17223 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17224
17225 case ${cf_cv_ncurses_header:-curses.h} in
17226 (*/*)
17227         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17228         cf_header_list="$cf_header_item $cf_header_list"
17229         ;;
17230 esac
17231
17232 for cf_header in $cf_header_list
17233 do
17234         cat >conftest.$ac_ext <<_ACEOF
17235 #line 17235 "configure"
17236 #include "confdefs.h"
17237
17238 #include <${cf_cv_ncurses_header:-curses.h}>
17239 #include <${cf_header}>
17240 int
17241 main (void)
17242 {
17243 WINDOW *x
17244   ;
17245   return 0;
17246 }
17247 _ACEOF
17248 rm -f conftest.$ac_objext
17249 if { (eval echo "$as_me:17249: \"$ac_compile\"") >&5
17250   (eval $ac_compile) 2>&5
17251   ac_status=$?
17252   echo "$as_me:17252: \$? = $ac_status" >&5
17253   (exit $ac_status); } &&
17254          { ac_try='test -s conftest.$ac_objext'
17255   { (eval echo "$as_me:17255: \"$ac_try\"") >&5
17256   (eval $ac_try) 2>&5
17257   ac_status=$?
17258   echo "$as_me:17258: \$? = $ac_status" >&5
17259   (exit $ac_status); }; }; then
17260   cf_cv_term_header=$cf_header
17261          break
17262 else
17263   echo "$as_me: failed program was:" >&5
17264 cat conftest.$ac_ext >&5
17265 cf_cv_term_header=no
17266 fi
17267 rm -f conftest.$ac_objext conftest.$ac_ext
17268 done
17269
17270 case $cf_cv_term_header in
17271 (no)
17272         # If curses is ncurses, some packagers still mess it up by trying to make
17273         # us use GNU termcap.  This handles the most common case.
17274         for cf_header in ncurses/term.h ncursesw/term.h
17275         do
17276                 cat >conftest.$ac_ext <<_ACEOF
17277 #line 17277 "configure"
17278 #include "confdefs.h"
17279
17280 #include <${cf_cv_ncurses_header:-curses.h}>
17281 #ifdef NCURSES_VERSION
17282 #include <${cf_header}>
17283 #else
17284 make an error
17285 #endif
17286 int
17287 main (void)
17288 {
17289 WINDOW *x
17290   ;
17291   return 0;
17292 }
17293 _ACEOF
17294 rm -f conftest.$ac_objext
17295 if { (eval echo "$as_me:17295: \"$ac_compile\"") >&5
17296   (eval $ac_compile) 2>&5
17297   ac_status=$?
17298   echo "$as_me:17298: \$? = $ac_status" >&5
17299   (exit $ac_status); } &&
17300          { ac_try='test -s conftest.$ac_objext'
17301   { (eval echo "$as_me:17301: \"$ac_try\"") >&5
17302   (eval $ac_try) 2>&5
17303   ac_status=$?
17304   echo "$as_me:17304: \$? = $ac_status" >&5
17305   (exit $ac_status); }; }; then
17306   cf_cv_term_header=$cf_header
17307                          break
17308 else
17309   echo "$as_me: failed program was:" >&5
17310 cat conftest.$ac_ext >&5
17311 cf_cv_term_header=no
17312 fi
17313 rm -f conftest.$ac_objext conftest.$ac_ext
17314         done
17315         ;;
17316 esac
17317
17318 fi
17319 echo "$as_me:17319: result: $cf_cv_term_header" >&5
17320 echo "${ECHO_T}$cf_cv_term_header" >&6
17321
17322 case $cf_cv_term_header in
17323 (term.h)
17324
17325 cat >>confdefs.h <<\EOF
17326 #define HAVE_TERM_H 1
17327 EOF
17328
17329         ;;
17330 (ncurses/term.h)
17331
17332 cat >>confdefs.h <<\EOF
17333 #define HAVE_NCURSES_TERM_H 1
17334 EOF
17335
17336         ;;
17337 (ncursesw/term.h)
17338
17339 cat >>confdefs.h <<\EOF
17340 #define HAVE_NCURSESW_TERM_H 1
17341 EOF
17342
17343         ;;
17344 esac
17345
17346 echo "$as_me:17346: checking for unctrl.h" >&5
17347 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
17348 if test "${cf_cv_unctrl_header+set}" = set; then
17349   echo $ECHO_N "(cached) $ECHO_C" >&6
17350 else
17351
17352 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
17353 # for <unctrl.h> if we do not find the variant.
17354
17355 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
17356
17357 case ${cf_cv_ncurses_header:-curses.h} in
17358 (*/*)
17359         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
17360         cf_header_list="$cf_header_item $cf_header_list"
17361         ;;
17362 esac
17363
17364 for cf_header in $cf_header_list
17365 do
17366         cat >conftest.$ac_ext <<_ACEOF
17367 #line 17367 "configure"
17368 #include "confdefs.h"
17369
17370 #include <${cf_cv_ncurses_header:-curses.h}>
17371 #include <${cf_header}>
17372 int
17373 main (void)
17374 {
17375 WINDOW *x
17376   ;
17377   return 0;
17378 }
17379 _ACEOF
17380 rm -f conftest.$ac_objext
17381 if { (eval echo "$as_me:17381: \"$ac_compile\"") >&5
17382   (eval $ac_compile) 2>&5
17383   ac_status=$?
17384   echo "$as_me:17384: \$? = $ac_status" >&5
17385   (exit $ac_status); } &&
17386          { ac_try='test -s conftest.$ac_objext'
17387   { (eval echo "$as_me:17387: \"$ac_try\"") >&5
17388   (eval $ac_try) 2>&5
17389   ac_status=$?
17390   echo "$as_me:17390: \$? = $ac_status" >&5
17391   (exit $ac_status); }; }; then
17392   cf_cv_unctrl_header=$cf_header
17393          break
17394 else
17395   echo "$as_me: failed program was:" >&5
17396 cat conftest.$ac_ext >&5
17397 cf_cv_unctrl_header=no
17398 fi
17399 rm -f conftest.$ac_objext conftest.$ac_ext
17400 done
17401
17402 fi
17403 echo "$as_me:17403: result: $cf_cv_unctrl_header" >&5
17404 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
17405
17406 case $cf_cv_unctrl_header in
17407 (no)
17408         { echo "$as_me:17408: WARNING: unctrl.h header not found" >&5
17409 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
17410         ;;
17411 esac
17412
17413 case $cf_cv_unctrl_header in
17414 (unctrl.h)
17415
17416 cat >>confdefs.h <<\EOF
17417 #define HAVE_UNCTRL_H 1
17418 EOF
17419
17420         ;;
17421 (ncurses/unctrl.h)
17422
17423 cat >>confdefs.h <<\EOF
17424 #define HAVE_NCURSES_UNCTRL_H 1
17425 EOF
17426
17427         ;;
17428 (ncursesw/unctrl.h)
17429
17430 cat >>confdefs.h <<\EOF
17431 #define HAVE_NCURSESW_UNCTRL_H 1
17432 EOF
17433
17434         ;;
17435 esac
17436
17437 for cf_func in \
17438 alloc_pair \
17439 assume_default_colors \
17440 chgat \
17441 color_content \
17442 color_set \
17443 copywin \
17444 delscreen \
17445 dupwin \
17446 filter \
17447 getbegx \
17448 getcurx \
17449 getmaxx \
17450 getnstr \
17451 getparx \
17452 getwin \
17453 halfdelay \
17454 init_extended_color \
17455 mvderwin \
17456 mvvline \
17457 mvwin \
17458 mvwvline \
17459 napms \
17460 newpad \
17461 putwin \
17462 reset_color_pairs \
17463 resize_term \
17464 resizeterm \
17465 restartterm \
17466 ripoffline \
17467 scr_dump \
17468 setupterm \
17469 slk_color \
17470 slk_init \
17471 termattrs \
17472 tgetent \
17473 tigetnum \
17474 tigetstr \
17475 tputs_sp \
17476 typeahead \
17477 use_default_colors \
17478 use_env \
17479 use_extended_names \
17480 use_screen \
17481 use_window \
17482 vid_puts \
17483 vidputs \
17484 vsscanf \
17485 vw_printw \
17486 wchgat \
17487 winsdelln \
17488 winsstr \
17489 wresize \
17490 wsyncdown \
17491 _tracef \
17492
17493 do
17494
17495 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17496
17497         echo "$as_me:17497: checking for ${cf_func}" >&5
17498 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17499
17500 echo "${as_me:-configure}:17500: testing ${cf_func} ..." 1>&5
17501
17502         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17503   echo $ECHO_N "(cached) $ECHO_C" >&6
17504 else
17505
17506                 eval cf_result='$ac_cv_func_'$cf_func
17507                 if test ".$cf_result" != ".no"; then
17508                         cat >conftest.$ac_ext <<_ACEOF
17509 #line 17509 "configure"
17510 #include "confdefs.h"
17511
17512 #ifdef HAVE_XCURSES
17513 #include <xcurses.h>
17514 char * XCursesProgramName = "test";
17515 #else
17516 #include <${cf_cv_ncurses_header:-curses.h}>
17517 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17518 #include <ncursesw/term.h>
17519 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17520 #include <ncurses/term.h>
17521 #elif defined(HAVE_TERM_H)
17522 #include <term.h>
17523 #endif
17524 #endif
17525
17526 int
17527 main (void)
17528 {
17529
17530 #ifndef ${cf_func}
17531 long foo = (long)(&${cf_func});
17532 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17533 if (foo + 1234L > 5678L)
17534         ${cf_cv_main_return:-return}(foo != 0);
17535 #endif
17536
17537   ;
17538   return 0;
17539 }
17540 _ACEOF
17541 rm -f conftest.$ac_objext conftest$ac_exeext
17542 if { (eval echo "$as_me:17542: \"$ac_link\"") >&5
17543   (eval $ac_link) 2>&5
17544   ac_status=$?
17545   echo "$as_me:17545: \$? = $ac_status" >&5
17546   (exit $ac_status); } &&
17547          { ac_try='test -s conftest$ac_exeext'
17548   { (eval echo "$as_me:17548: \"$ac_try\"") >&5
17549   (eval $ac_try) 2>&5
17550   ac_status=$?
17551   echo "$as_me:17551: \$? = $ac_status" >&5
17552   (exit $ac_status); }; }; then
17553   cf_result=yes
17554 else
17555   echo "$as_me: failed program was:" >&5
17556 cat conftest.$ac_ext >&5
17557 cf_result=no
17558 fi
17559 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17560                 fi
17561                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17562
17563 fi
17564
17565         # use the computed/retrieved cache-value:
17566         eval 'cf_result=$cf_cv_func_'$cf_func
17567         echo "$as_me:17567: result: $cf_result" >&5
17568 echo "${ECHO_T}$cf_result" >&6
17569         if test $cf_result != no; then
17570                 cat >>confdefs.h <<EOF
17571 #define HAVE_${cf_tr_func} 1
17572 EOF
17573
17574         fi
17575 done
17576
17577 for cf_func in tputs
17578 do
17579
17580 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17581
17582         echo "$as_me:17582: checking for ${cf_func}" >&5
17583 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17584
17585 echo "${as_me:-configure}:17585: testing ${cf_func} ..." 1>&5
17586
17587         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17588   echo $ECHO_N "(cached) $ECHO_C" >&6
17589 else
17590
17591                 eval cf_result='$ac_cv_func_'$cf_func
17592                 if test ".$cf_result" != ".no"; then
17593                         cat >conftest.$ac_ext <<_ACEOF
17594 #line 17594 "configure"
17595 #include "confdefs.h"
17596
17597 #ifdef HAVE_XCURSES
17598 #include <xcurses.h>
17599 char * XCursesProgramName = "test";
17600 #else
17601 #include <${cf_cv_ncurses_header:-curses.h}>
17602 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17603 #include <ncursesw/term.h>
17604 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17605 #include <ncurses/term.h>
17606 #elif defined(HAVE_TERM_H)
17607 #include <term.h>
17608 #endif
17609 #endif
17610
17611 int
17612 main (void)
17613 {
17614
17615 #ifndef ${cf_func}
17616 long foo = (long)(&${cf_func});
17617 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17618 if (foo + 1234L > 5678L)
17619         ${cf_cv_main_return:-return}(foo != 0);
17620 #endif
17621
17622   ;
17623   return 0;
17624 }
17625 _ACEOF
17626 rm -f conftest.$ac_objext conftest$ac_exeext
17627 if { (eval echo "$as_me:17627: \"$ac_link\"") >&5
17628   (eval $ac_link) 2>&5
17629   ac_status=$?
17630   echo "$as_me:17630: \$? = $ac_status" >&5
17631   (exit $ac_status); } &&
17632          { ac_try='test -s conftest$ac_exeext'
17633   { (eval echo "$as_me:17633: \"$ac_try\"") >&5
17634   (eval $ac_try) 2>&5
17635   ac_status=$?
17636   echo "$as_me:17636: \$? = $ac_status" >&5
17637   (exit $ac_status); }; }; then
17638   cf_result=yes
17639 else
17640   echo "$as_me: failed program was:" >&5
17641 cat conftest.$ac_ext >&5
17642 cf_result=no
17643 fi
17644 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17645                 fi
17646                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17647
17648 fi
17649
17650         # use the computed/retrieved cache-value:
17651         eval 'cf_result=$cf_cv_func_'$cf_func
17652         echo "$as_me:17652: result: $cf_result" >&5
17653 echo "${ECHO_T}$cf_result" >&6
17654         if test $cf_result != no; then
17655                 cat >>confdefs.h <<EOF
17656 #define HAVE_${cf_tr_func} 1
17657 EOF
17658
17659         fi
17660 done
17661
17662 if test x$cf_cv_func_tputs = xyes
17663 then
17664         cf_done=no
17665         for cf_arg in int char
17666         do
17667                 for cf_ret in int void
17668                 do
17669                         if test $cf_ret = void
17670                         then
17671                                 cf_return="/* nothing */"
17672                         else
17673                                 cf_return="return value"
17674                         fi
17675                         cat >conftest.$ac_ext <<_ACEOF
17676 #line 17676 "configure"
17677 #include "confdefs.h"
17678
17679 #include <${cf_cv_ncurses_header:-curses.h}>
17680 #include <$cf_cv_term_header>
17681
17682 static $cf_ret outc($cf_arg value) { $cf_return; }
17683
17684 int
17685 main (void)
17686 {
17687
17688         tputs("hello", 0, outc);
17689         ${cf_cv_main_return:-return}(0);
17690
17691   ;
17692   return 0;
17693 }
17694 _ACEOF
17695 rm -f conftest.$ac_objext
17696 if { (eval echo "$as_me:17696: \"$ac_compile\"") >&5
17697   (eval $ac_compile) 2>&5
17698   ac_status=$?
17699   echo "$as_me:17699: \$? = $ac_status" >&5
17700   (exit $ac_status); } &&
17701          { ac_try='test -s conftest.$ac_objext'
17702   { (eval echo "$as_me:17702: \"$ac_try\"") >&5
17703   (eval $ac_try) 2>&5
17704   ac_status=$?
17705   echo "$as_me:17705: \$? = $ac_status" >&5
17706   (exit $ac_status); }; }; then
17707
17708                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
17709
17710 echo "${as_me:-configure}:17710: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
17711
17712                 cat >>confdefs.h <<EOF
17713 #define TPUTS_ARG               $cf_arg
17714 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
17715 #define TPUTS_RETURN(value)     $cf_return
17716 EOF
17717                 cf_done=yes
17718                 break
17719
17720 else
17721   echo "$as_me: failed program was:" >&5
17722 cat conftest.$ac_ext >&5
17723 fi
17724 rm -f conftest.$ac_objext conftest.$ac_ext
17725                 done
17726                 test $cf_done = yes && break
17727         done
17728 fi
17729
17730 echo "$as_me:17730: checking for ncurses extended functions" >&5
17731 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
17732 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
17733   echo $ECHO_N "(cached) $ECHO_C" >&6
17734 else
17735
17736 cat >conftest.$ac_ext <<_ACEOF
17737 #line 17737 "configure"
17738 #include "confdefs.h"
17739
17740 #include <${cf_cv_ncurses_header:-curses.h}>
17741 int
17742 main (void)
17743 {
17744
17745 int x = NCURSES_EXT_FUNCS
17746
17747   ;
17748   return 0;
17749 }
17750 _ACEOF
17751 rm -f conftest.$ac_objext
17752 if { (eval echo "$as_me:17752: \"$ac_compile\"") >&5
17753   (eval $ac_compile) 2>&5
17754   ac_status=$?
17755   echo "$as_me:17755: \$? = $ac_status" >&5
17756   (exit $ac_status); } &&
17757          { ac_try='test -s conftest.$ac_objext'
17758   { (eval echo "$as_me:17758: \"$ac_try\"") >&5
17759   (eval $ac_try) 2>&5
17760   ac_status=$?
17761   echo "$as_me:17761: \$? = $ac_status" >&5
17762   (exit $ac_status); }; }; then
17763   cf_cv_ncurses_ext_funcs=defined
17764 else
17765   echo "$as_me: failed program was:" >&5
17766 cat conftest.$ac_ext >&5
17767
17768 cat >conftest.$ac_ext <<_ACEOF
17769 #line 17769 "configure"
17770 #include "confdefs.h"
17771
17772 #include <${cf_cv_ncurses_header:-curses.h}>
17773 int
17774 main (void)
17775 {
17776
17777         (void) assume_default_colors (0, 0);
17778         (void) curses_version ();
17779         (void) define_key (0, 0);
17780         (void) is_term_resized (0, 0);
17781         (void) key_defined (0);
17782         (void) keybound (0, 0);
17783         (void) keyok (0, 0);
17784         (void) resize_term (0, 0);
17785         (void) resizeterm (0, 0);
17786         (void) use_default_colors ();
17787         (void) use_extended_names (0);
17788         (void) wresize (0, 0, 0);
17789   ;
17790   return 0;
17791 }
17792 _ACEOF
17793 rm -f conftest.$ac_objext conftest$ac_exeext
17794 if { (eval echo "$as_me:17794: \"$ac_link\"") >&5
17795   (eval $ac_link) 2>&5
17796   ac_status=$?
17797   echo "$as_me:17797: \$? = $ac_status" >&5
17798   (exit $ac_status); } &&
17799          { ac_try='test -s conftest$ac_exeext'
17800   { (eval echo "$as_me:17800: \"$ac_try\"") >&5
17801   (eval $ac_try) 2>&5
17802   ac_status=$?
17803   echo "$as_me:17803: \$? = $ac_status" >&5
17804   (exit $ac_status); }; }; then
17805   cf_cv_ncurses_ext_funcs=yes
17806 else
17807   echo "$as_me: failed program was:" >&5
17808 cat conftest.$ac_ext >&5
17809 cf_cv_ncurses_ext_funcs=no
17810 fi
17811 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17812
17813 fi
17814 rm -f conftest.$ac_objext conftest.$ac_ext
17815
17816 fi
17817 echo "$as_me:17817: result: $cf_cv_ncurses_ext_funcs" >&5
17818 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
17819 test "$cf_cv_ncurses_ext_funcs" = yes &&
17820 cat >>confdefs.h <<\EOF
17821 #define NCURSES_EXT_FUNCS 1
17822 EOF
17823
17824 if test "$cf_enable_widec" = yes
17825 then
17826         # workaround for systems with ncurses before 20111029, due to change of
17827         # feature test macro from _XPG5 to _XOPEN_SOURCE
17828         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
17829         then
17830                 cf_define_xpg5=no
17831                 echo "$as_me:17831: checking if _XPG5 should be defined to enable wide-characters" >&5
17832 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
17833
17834                 cat >conftest.$ac_ext <<_ACEOF
17835 #line 17835 "configure"
17836 #include "confdefs.h"
17837
17838 #include <${cf_cv_ncurses_header:-curses.h}>
17839 int
17840 main (void)
17841 {
17842 int x = _XPG5
17843   ;
17844   return 0;
17845 }
17846 _ACEOF
17847 rm -f conftest.$ac_objext
17848 if { (eval echo "$as_me:17848: \"$ac_compile\"") >&5
17849   (eval $ac_compile) 2>&5
17850   ac_status=$?
17851   echo "$as_me:17851: \$? = $ac_status" >&5
17852   (exit $ac_status); } &&
17853          { ac_try='test -s conftest.$ac_objext'
17854   { (eval echo "$as_me:17854: \"$ac_try\"") >&5
17855   (eval $ac_try) 2>&5
17856   ac_status=$?
17857   echo "$as_me:17857: \$? = $ac_status" >&5
17858   (exit $ac_status); }; }; then
17859   :
17860 else
17861   echo "$as_me: failed program was:" >&5
17862 cat conftest.$ac_ext >&5
17863 cf_save_cppflags="$CPPFLAGS"
17864                          CPPFLAGS="$CPPFLAGS -D_XPG5"
17865                          cat >conftest.$ac_ext <<_ACEOF
17866 #line 17866 "configure"
17867 #include "confdefs.h"
17868
17869 #include <${cf_cv_ncurses_header:-curses.h}>
17870 int
17871 main (void)
17872 {
17873 int x = _XPG5
17874   ;
17875   return 0;
17876 }
17877 _ACEOF
17878 rm -f conftest.$ac_objext
17879 if { (eval echo "$as_me:17879: \"$ac_compile\"") >&5
17880   (eval $ac_compile) 2>&5
17881   ac_status=$?
17882   echo "$as_me:17882: \$? = $ac_status" >&5
17883   (exit $ac_status); } &&
17884          { ac_try='test -s conftest.$ac_objext'
17885   { (eval echo "$as_me:17885: \"$ac_try\"") >&5
17886   (eval $ac_try) 2>&5
17887   ac_status=$?
17888   echo "$as_me:17888: \$? = $ac_status" >&5
17889   (exit $ac_status); }; }; then
17890   cf_define_xpg5=yes
17891 else
17892   echo "$as_me: failed program was:" >&5
17893 cat conftest.$ac_ext >&5
17894 fi
17895 rm -f conftest.$ac_objext conftest.$ac_ext
17896                          CPPFLAGS="$cf_save_cppflags"
17897 fi
17898 rm -f conftest.$ac_objext conftest.$ac_ext
17899                 echo "$as_me:17899: result: $cf_define_xpg5" >&5
17900 echo "${ECHO_T}$cf_define_xpg5" >&6
17901
17902                 if test "$cf_define_xpg5" = yes
17903                 then
17904                         CPPFLAGS="$CPPFLAGS -D_XPG5"
17905                 fi
17906         fi
17907
17908         echo "$as_me:17908: checking for wide-character functions" >&5
17909 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
17910 if test "${cf_cv_widechar_funcs+set}" = set; then
17911   echo $ECHO_N "(cached) $ECHO_C" >&6
17912 else
17913
17914         cat >conftest.$ac_ext <<_ACEOF
17915 #line 17915 "configure"
17916 #include "confdefs.h"
17917
17918 #include <${cf_cv_ncurses_header:-curses.h}>
17919 int
17920 main (void)
17921 {
17922
17923                 static wchar_t src_wchar[2];
17924                 static cchar_t dst_cchar;
17925                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
17926
17927   ;
17928   return 0;
17929 }
17930 _ACEOF
17931 rm -f conftest.$ac_objext conftest$ac_exeext
17932 if { (eval echo "$as_me:17932: \"$ac_link\"") >&5
17933   (eval $ac_link) 2>&5
17934   ac_status=$?
17935   echo "$as_me:17935: \$? = $ac_status" >&5
17936   (exit $ac_status); } &&
17937          { ac_try='test -s conftest$ac_exeext'
17938   { (eval echo "$as_me:17938: \"$ac_try\"") >&5
17939   (eval $ac_try) 2>&5
17940   ac_status=$?
17941   echo "$as_me:17941: \$? = $ac_status" >&5
17942   (exit $ac_status); }; }; then
17943   cf_cv_widechar_funcs=yes
17944 else
17945   echo "$as_me: failed program was:" >&5
17946 cat conftest.$ac_ext >&5
17947 cf_cv_widechar_funcs=no
17948 fi
17949 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17950
17951 fi
17952 echo "$as_me:17952: result: $cf_cv_widechar_funcs" >&5
17953 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
17954         if test "$cf_cv_widechar_funcs" != no ; then
17955
17956 cat >>confdefs.h <<\EOF
17957 #define USE_WIDEC_SUPPORT 1
17958 EOF
17959
17960         else
17961                 cat >>confdefs.h <<\EOF
17962 #define USE_WIDEC_SUPPORT 0
17963 EOF
17964
17965         fi
17966 else
17967         cat >>confdefs.h <<\EOF
17968 #define USE_WIDEC_SUPPORT 0
17969 EOF
17970
17971 fi
17972
17973 echo "$as_me:17973: checking if $cf_cv_screen library uses pthreads" >&5
17974 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
17975 if test "${cf_cv_use_pthreads+set}" = set; then
17976   echo $ECHO_N "(cached) $ECHO_C" >&6
17977 else
17978
17979 cat >conftest.$ac_ext <<_ACEOF
17980 #line 17980 "configure"
17981 #include "confdefs.h"
17982
17983 #include <${cf_cv_ncurses_header:-curses.h}>
17984 extern void _nc_init_pthreads(void);
17985
17986 int
17987 main (void)
17988 {
17989
17990         initscr();
17991         _nc_init_pthreads();
17992
17993   ;
17994   return 0;
17995 }
17996 _ACEOF
17997 rm -f conftest.$ac_objext conftest$ac_exeext
17998 if { (eval echo "$as_me:17998: \"$ac_link\"") >&5
17999   (eval $ac_link) 2>&5
18000   ac_status=$?
18001   echo "$as_me:18001: \$? = $ac_status" >&5
18002   (exit $ac_status); } &&
18003          { ac_try='test -s conftest$ac_exeext'
18004   { (eval echo "$as_me:18004: \"$ac_try\"") >&5
18005   (eval $ac_try) 2>&5
18006   ac_status=$?
18007   echo "$as_me:18007: \$? = $ac_status" >&5
18008   (exit $ac_status); }; }; then
18009   cf_cv_use_pthreads=yes
18010 else
18011   echo "$as_me: failed program was:" >&5
18012 cat conftest.$ac_ext >&5
18013 cf_cv_use_pthreads=no
18014 fi
18015 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18016
18017 fi
18018 echo "$as_me:18018: result: $cf_cv_use_pthreads" >&5
18019 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18020 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
18021 #define USE_PTHREADS 1
18022 EOF
18023
18024 echo "$as_me:18024: checking if sys/time.h works with sys/select.h" >&5
18025 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18026 if test "${cf_cv_sys_time_select+set}" = set; then
18027   echo $ECHO_N "(cached) $ECHO_C" >&6
18028 else
18029
18030 cat >conftest.$ac_ext <<_ACEOF
18031 #line 18031 "configure"
18032 #include "confdefs.h"
18033
18034 #include <sys/types.h>
18035 #ifdef HAVE_SYS_TIME_H
18036 #include <sys/time.h>
18037 #endif
18038 #ifdef HAVE_SYS_SELECT_H
18039 #include <sys/select.h>
18040 #endif
18041
18042 int
18043 main (void)
18044 {
18045
18046   ;
18047   return 0;
18048 }
18049 _ACEOF
18050 rm -f conftest.$ac_objext
18051 if { (eval echo "$as_me:18051: \"$ac_compile\"") >&5
18052   (eval $ac_compile) 2>&5
18053   ac_status=$?
18054   echo "$as_me:18054: \$? = $ac_status" >&5
18055   (exit $ac_status); } &&
18056          { ac_try='test -s conftest.$ac_objext'
18057   { (eval echo "$as_me:18057: \"$ac_try\"") >&5
18058   (eval $ac_try) 2>&5
18059   ac_status=$?
18060   echo "$as_me:18060: \$? = $ac_status" >&5
18061   (exit $ac_status); }; }; then
18062   cf_cv_sys_time_select=yes
18063 else
18064   echo "$as_me: failed program was:" >&5
18065 cat conftest.$ac_ext >&5
18066 cf_cv_sys_time_select=no
18067 fi
18068 rm -f conftest.$ac_objext conftest.$ac_ext
18069
18070 fi
18071
18072 echo "$as_me:18072: result: $cf_cv_sys_time_select" >&5
18073 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18074 test "$cf_cv_sys_time_select" = yes &&
18075 cat >>confdefs.h <<\EOF
18076 #define HAVE_SYS_TIME_SELECT 1
18077 EOF
18078
18079 # special check for test/ditto.c
18080
18081 echo "$as_me:18081: checking for openpty in -lutil" >&5
18082 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18083 if test "${ac_cv_lib_util_openpty+set}" = set; then
18084   echo $ECHO_N "(cached) $ECHO_C" >&6
18085 else
18086   ac_check_lib_save_LIBS=$LIBS
18087 LIBS="-lutil  $LIBS"
18088 cat >conftest.$ac_ext <<_ACEOF
18089 #line 18089 "configure"
18090 #include "confdefs.h"
18091
18092 /* Override any gcc2 internal prototype to avoid an error.  */
18093 #ifdef __cplusplus
18094 extern "C"
18095 #endif
18096 /* We use char because int might match the return type of a gcc2
18097    builtin and then its argument prototype would still apply.  */
18098 char openpty ();
18099 int
18100 main (void)
18101 {
18102 openpty ();
18103   ;
18104   return 0;
18105 }
18106 _ACEOF
18107 rm -f conftest.$ac_objext conftest$ac_exeext
18108 if { (eval echo "$as_me:18108: \"$ac_link\"") >&5
18109   (eval $ac_link) 2>&5
18110   ac_status=$?
18111   echo "$as_me:18111: \$? = $ac_status" >&5
18112   (exit $ac_status); } &&
18113          { ac_try='test -s conftest$ac_exeext'
18114   { (eval echo "$as_me:18114: \"$ac_try\"") >&5
18115   (eval $ac_try) 2>&5
18116   ac_status=$?
18117   echo "$as_me:18117: \$? = $ac_status" >&5
18118   (exit $ac_status); }; }; then
18119   ac_cv_lib_util_openpty=yes
18120 else
18121   echo "$as_me: failed program was:" >&5
18122 cat conftest.$ac_ext >&5
18123 ac_cv_lib_util_openpty=no
18124 fi
18125 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18126 LIBS=$ac_check_lib_save_LIBS
18127 fi
18128 echo "$as_me:18128: result: $ac_cv_lib_util_openpty" >&5
18129 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18130 if test $ac_cv_lib_util_openpty = yes; then
18131   cf_cv_lib_util=yes
18132 else
18133   cf_cv_lib_util=no
18134 fi
18135
18136 echo "$as_me:18136: checking for openpty header" >&5
18137 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18138 if test "${cf_cv_func_openpty+set}" = set; then
18139   echo $ECHO_N "(cached) $ECHO_C" >&6
18140 else
18141
18142         cf_save_LIBS="$LIBS"
18143         test $cf_cv_lib_util = yes && {
18144 cf_add_libs="-lutil"
18145 # Filter out duplicates - this happens with badly-designed ".pc" files...
18146 for cf_add_1lib in $LIBS
18147 do
18148         for cf_add_2lib in $cf_add_libs
18149         do
18150                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18151                 then
18152                         cf_add_1lib=
18153                         break
18154                 fi
18155         done
18156         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18157 done
18158 LIBS="$cf_add_libs"
18159  }
18160         for cf_header in pty.h libutil.h util.h
18161         do
18162         cat >conftest.$ac_ext <<_ACEOF
18163 #line 18163 "configure"
18164 #include "confdefs.h"
18165
18166 #include <$cf_header>
18167
18168 int
18169 main (void)
18170 {
18171
18172         int x = openpty((int *)0, (int *)0, (char *)0,
18173                                    (struct termios *)0, (struct winsize *)0);
18174
18175   ;
18176   return 0;
18177 }
18178 _ACEOF
18179 rm -f conftest.$ac_objext conftest$ac_exeext
18180 if { (eval echo "$as_me:18180: \"$ac_link\"") >&5
18181   (eval $ac_link) 2>&5
18182   ac_status=$?
18183   echo "$as_me:18183: \$? = $ac_status" >&5
18184   (exit $ac_status); } &&
18185          { ac_try='test -s conftest$ac_exeext'
18186   { (eval echo "$as_me:18186: \"$ac_try\"") >&5
18187   (eval $ac_try) 2>&5
18188   ac_status=$?
18189   echo "$as_me:18189: \$? = $ac_status" >&5
18190   (exit $ac_status); }; }; then
18191
18192                 cf_cv_func_openpty=$cf_header
18193                 break
18194
18195 else
18196   echo "$as_me: failed program was:" >&5
18197 cat conftest.$ac_ext >&5
18198
18199                 cf_cv_func_openpty=no
18200
18201 fi
18202 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18203         done
18204         LIBS="$cf_save_LIBS"
18205
18206 fi
18207 echo "$as_me:18207: result: $cf_cv_func_openpty" >&5
18208 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18209
18210 if test "$cf_cv_func_openpty" != no ; then
18211
18212 cat >>confdefs.h <<EOF
18213 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18214 EOF
18215
18216 cat >>confdefs.h <<\EOF
18217 #define USE_XTERM_PTY 1
18218 EOF
18219
18220         if test "x$cf_cv_lib_util" = xyes ; then
18221
18222 cf_add_libs="-lutil"
18223 # Filter out duplicates - this happens with badly-designed ".pc" files...
18224 for cf_add_1lib in $TEST_LIBS
18225 do
18226         for cf_add_2lib in $cf_add_libs
18227         do
18228                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18229                 then
18230                         cf_add_1lib=
18231                         break
18232                 fi
18233         done
18234         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18235 done
18236 TEST_LIBS="$cf_add_libs"
18237
18238         fi
18239 fi
18240
18241 echo "$as_me:18241: checking for function curses_version" >&5
18242 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
18243 if test "${cf_cv_func_curses_version+set}" = set; then
18244   echo $ECHO_N "(cached) $ECHO_C" >&6
18245 else
18246
18247 if test "$cross_compiling" = yes; then
18248   cf_cv_func_curses_version=unknown
18249 else
18250   cat >conftest.$ac_ext <<_ACEOF
18251 #line 18251 "configure"
18252 #include "confdefs.h"
18253
18254 #include <${cf_cv_ncurses_header:-curses.h}>
18255 int main(void)
18256 {
18257         char temp[1024];
18258         sprintf(temp, "%s\n", curses_version());
18259         ${cf_cv_main_return:-return}(0);
18260 }
18261
18262 _ACEOF
18263 rm -f conftest$ac_exeext
18264 if { (eval echo "$as_me:18264: \"$ac_link\"") >&5
18265   (eval $ac_link) 2>&5
18266   ac_status=$?
18267   echo "$as_me:18267: \$? = $ac_status" >&5
18268   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18269   { (eval echo "$as_me:18269: \"$ac_try\"") >&5
18270   (eval $ac_try) 2>&5
18271   ac_status=$?
18272   echo "$as_me:18272: \$? = $ac_status" >&5
18273   (exit $ac_status); }; }; then
18274   cf_cv_func_curses_version=yes
18275
18276 else
18277   echo "$as_me: program exited with status $ac_status" >&5
18278 echo "$as_me: failed program was:" >&5
18279 cat conftest.$ac_ext >&5
18280 cf_cv_func_curses_version=no
18281
18282 fi
18283 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18284 fi
18285 rm -f core
18286 fi
18287 echo "$as_me:18287: result: $cf_cv_func_curses_version" >&5
18288 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
18289 test "$cf_cv_func_curses_version" = yes &&
18290 cat >>confdefs.h <<\EOF
18291 #define HAVE_CURSES_VERSION 1
18292 EOF
18293
18294 echo "$as_me:18294: checking for alternate character set array" >&5
18295 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
18296 if test "${cf_cv_curses_acs_map+set}" = set; then
18297   echo $ECHO_N "(cached) $ECHO_C" >&6
18298 else
18299
18300 cf_cv_curses_acs_map=unknown
18301 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
18302 do
18303 cat >conftest.$ac_ext <<_ACEOF
18304 #line 18304 "configure"
18305 #include "confdefs.h"
18306
18307 #include <${cf_cv_ncurses_header:-curses.h}>
18308
18309 int
18310 main (void)
18311 {
18312
18313 $name['k'] = ACS_PLUS
18314
18315   ;
18316   return 0;
18317 }
18318 _ACEOF
18319 rm -f conftest.$ac_objext conftest$ac_exeext
18320 if { (eval echo "$as_me:18320: \"$ac_link\"") >&5
18321   (eval $ac_link) 2>&5
18322   ac_status=$?
18323   echo "$as_me:18323: \$? = $ac_status" >&5
18324   (exit $ac_status); } &&
18325          { ac_try='test -s conftest$ac_exeext'
18326   { (eval echo "$as_me:18326: \"$ac_try\"") >&5
18327   (eval $ac_try) 2>&5
18328   ac_status=$?
18329   echo "$as_me:18329: \$? = $ac_status" >&5
18330   (exit $ac_status); }; }; then
18331   cf_cv_curses_acs_map=$name; break
18332 else
18333   echo "$as_me: failed program was:" >&5
18334 cat conftest.$ac_ext >&5
18335 fi
18336 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18337 done
18338
18339 fi
18340 echo "$as_me:18340: result: $cf_cv_curses_acs_map" >&5
18341 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
18342
18343 test "$cf_cv_curses_acs_map" != unknown &&
18344 cat >>confdefs.h <<EOF
18345 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
18346 EOF
18347
18348 if test "$cf_enable_widec" = yes; then
18349
18350 echo "$as_me:18350: checking for wide alternate character set array" >&5
18351 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
18352 if test "${cf_cv_curses_wacs_map+set}" = set; then
18353   echo $ECHO_N "(cached) $ECHO_C" >&6
18354 else
18355
18356         cf_cv_curses_wacs_map=unknown
18357         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
18358         do
18359         cat >conftest.$ac_ext <<_ACEOF
18360 #line 18360 "configure"
18361 #include "confdefs.h"
18362
18363 #ifndef _XOPEN_SOURCE_EXTENDED
18364 #define _XOPEN_SOURCE_EXTENDED
18365 #endif
18366 #include <${cf_cv_ncurses_header:-curses.h}>
18367 int
18368 main (void)
18369 {
18370 void *foo = &($name['k'])
18371   ;
18372   return 0;
18373 }
18374 _ACEOF
18375 rm -f conftest.$ac_objext conftest$ac_exeext
18376 if { (eval echo "$as_me:18376: \"$ac_link\"") >&5
18377   (eval $ac_link) 2>&5
18378   ac_status=$?
18379   echo "$as_me:18379: \$? = $ac_status" >&5
18380   (exit $ac_status); } &&
18381          { ac_try='test -s conftest$ac_exeext'
18382   { (eval echo "$as_me:18382: \"$ac_try\"") >&5
18383   (eval $ac_try) 2>&5
18384   ac_status=$?
18385   echo "$as_me:18385: \$? = $ac_status" >&5
18386   (exit $ac_status); }; }; then
18387   cf_cv_curses_wacs_map=$name
18388          break
18389 else
18390   echo "$as_me: failed program was:" >&5
18391 cat conftest.$ac_ext >&5
18392 fi
18393 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18394         done
18395 fi
18396 echo "$as_me:18396: result: $cf_cv_curses_wacs_map" >&5
18397 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
18398
18399 test "$cf_cv_curses_wacs_map" != unknown &&
18400 cat >>confdefs.h <<EOF
18401 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
18402 EOF
18403
18404 echo "$as_me:18404: checking for wide alternate character constants" >&5
18405 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
18406 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
18407   echo $ECHO_N "(cached) $ECHO_C" >&6
18408 else
18409
18410 cf_cv_curses_wacs_symbols=no
18411 if test "$cf_cv_curses_wacs_map" != unknown
18412 then
18413         cat >conftest.$ac_ext <<_ACEOF
18414 #line 18414 "configure"
18415 #include "confdefs.h"
18416
18417 #ifndef _XOPEN_SOURCE_EXTENDED
18418 #define _XOPEN_SOURCE_EXTENDED
18419 #endif
18420 #include <${cf_cv_ncurses_header:-curses.h}>
18421 int
18422 main (void)
18423 {
18424 cchar_t *foo = WACS_PLUS;
18425          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
18426   ;
18427   return 0;
18428 }
18429 _ACEOF
18430 rm -f conftest.$ac_objext conftest$ac_exeext
18431 if { (eval echo "$as_me:18431: \"$ac_link\"") >&5
18432   (eval $ac_link) 2>&5
18433   ac_status=$?
18434   echo "$as_me:18434: \$? = $ac_status" >&5
18435   (exit $ac_status); } &&
18436          { ac_try='test -s conftest$ac_exeext'
18437   { (eval echo "$as_me:18437: \"$ac_try\"") >&5
18438   (eval $ac_try) 2>&5
18439   ac_status=$?
18440   echo "$as_me:18440: \$? = $ac_status" >&5
18441   (exit $ac_status); }; }; then
18442   cf_cv_curses_wacs_symbols=yes
18443 else
18444   echo "$as_me: failed program was:" >&5
18445 cat conftest.$ac_ext >&5
18446 fi
18447 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18448 else
18449         cat >conftest.$ac_ext <<_ACEOF
18450 #line 18450 "configure"
18451 #include "confdefs.h"
18452
18453 #ifndef _XOPEN_SOURCE_EXTENDED
18454 #define _XOPEN_SOURCE_EXTENDED
18455 #endif
18456 #include <${cf_cv_ncurses_header:-curses.h}>
18457 int
18458 main (void)
18459 {
18460 cchar_t *foo = WACS_PLUS
18461   ;
18462   return 0;
18463 }
18464 _ACEOF
18465 rm -f conftest.$ac_objext conftest$ac_exeext
18466 if { (eval echo "$as_me:18466: \"$ac_link\"") >&5
18467   (eval $ac_link) 2>&5
18468   ac_status=$?
18469   echo "$as_me:18469: \$? = $ac_status" >&5
18470   (exit $ac_status); } &&
18471          { ac_try='test -s conftest$ac_exeext'
18472   { (eval echo "$as_me:18472: \"$ac_try\"") >&5
18473   (eval $ac_try) 2>&5
18474   ac_status=$?
18475   echo "$as_me:18475: \$? = $ac_status" >&5
18476   (exit $ac_status); }; }; then
18477   cf_cv_curses_wacs_symbols=yes
18478 else
18479   echo "$as_me: failed program was:" >&5
18480 cat conftest.$ac_ext >&5
18481 fi
18482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18483 fi
18484
18485 fi
18486 echo "$as_me:18486: result: $cf_cv_curses_wacs_symbols" >&5
18487 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
18488
18489 test "$cf_cv_curses_wacs_symbols" != no &&
18490 cat >>confdefs.h <<\EOF
18491 #define CURSES_WACS_SYMBOLS 1
18492 EOF
18493
18494 fi
18495
18496 echo "$as_me:18496: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18497 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18498 cat >conftest.$ac_ext <<_ACEOF
18499 #line 18499 "configure"
18500 #include "confdefs.h"
18501
18502 #ifndef _XOPEN_SOURCE_EXTENDED
18503 #define _XOPEN_SOURCE_EXTENDED
18504 #endif
18505 #include <${cf_cv_ncurses_header:-curses.h}>
18506 int
18507 main (void)
18508 {
18509
18510 attr_t foo
18511
18512   ;
18513   return 0;
18514 }
18515 _ACEOF
18516 rm -f conftest.$ac_objext
18517 if { (eval echo "$as_me:18517: \"$ac_compile\"") >&5
18518   (eval $ac_compile) 2>&5
18519   ac_status=$?
18520   echo "$as_me:18520: \$? = $ac_status" >&5
18521   (exit $ac_status); } &&
18522          { ac_try='test -s conftest.$ac_objext'
18523   { (eval echo "$as_me:18523: \"$ac_try\"") >&5
18524   (eval $ac_try) 2>&5
18525   ac_status=$?
18526   echo "$as_me:18526: \$? = $ac_status" >&5
18527   (exit $ac_status); }; }; then
18528   cf_result=yes
18529 else
18530   echo "$as_me: failed program was:" >&5
18531 cat conftest.$ac_ext >&5
18532 cf_result=no
18533 fi
18534 rm -f conftest.$ac_objext conftest.$ac_ext
18535 echo "$as_me:18535: result: $cf_result" >&5
18536 echo "${ECHO_T}$cf_result" >&6
18537 if test $cf_result = yes ; then
18538
18539 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18540
18541 cat >>confdefs.h <<EOF
18542 #define $cf_result 1
18543 EOF
18544
18545 else
18546
18547 cat >>confdefs.h <<EOF
18548 #define attr_t long
18549 EOF
18550
18551 fi
18552
18553 if test "$cf_enable_widec" = yes; then
18554
18555 # This is needed on Tru64 5.0 to declare mbstate_t
18556 echo "$as_me:18556: checking if we must include wchar.h to declare mbstate_t" >&5
18557 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
18558 if test "${cf_cv_mbstate_t+set}" = set; then
18559   echo $ECHO_N "(cached) $ECHO_C" >&6
18560 else
18561
18562 cat >conftest.$ac_ext <<_ACEOF
18563 #line 18563 "configure"
18564 #include "confdefs.h"
18565
18566 #include <stdlib.h>
18567 #include <stdarg.h>
18568 #include <stdio.h>
18569 #ifdef HAVE_LIBUTF8_H
18570 #include <libutf8.h>
18571 #endif
18572 int
18573 main (void)
18574 {
18575 mbstate_t state
18576   ;
18577   return 0;
18578 }
18579 _ACEOF
18580 rm -f conftest.$ac_objext
18581 if { (eval echo "$as_me:18581: \"$ac_compile\"") >&5
18582   (eval $ac_compile) 2>&5
18583   ac_status=$?
18584   echo "$as_me:18584: \$? = $ac_status" >&5
18585   (exit $ac_status); } &&
18586          { ac_try='test -s conftest.$ac_objext'
18587   { (eval echo "$as_me:18587: \"$ac_try\"") >&5
18588   (eval $ac_try) 2>&5
18589   ac_status=$?
18590   echo "$as_me:18590: \$? = $ac_status" >&5
18591   (exit $ac_status); }; }; then
18592   cf_cv_mbstate_t=no
18593 else
18594   echo "$as_me: failed program was:" >&5
18595 cat conftest.$ac_ext >&5
18596 cat >conftest.$ac_ext <<_ACEOF
18597 #line 18597 "configure"
18598 #include "confdefs.h"
18599
18600 #include <stdlib.h>
18601 #include <stdarg.h>
18602 #include <stdio.h>
18603 #include <wchar.h>
18604 #ifdef HAVE_LIBUTF8_H
18605 #include <libutf8.h>
18606 #endif
18607 int
18608 main (void)
18609 {
18610 mbstate_t value
18611   ;
18612   return 0;
18613 }
18614 _ACEOF
18615 rm -f conftest.$ac_objext
18616 if { (eval echo "$as_me:18616: \"$ac_compile\"") >&5
18617   (eval $ac_compile) 2>&5
18618   ac_status=$?
18619   echo "$as_me:18619: \$? = $ac_status" >&5
18620   (exit $ac_status); } &&
18621          { ac_try='test -s conftest.$ac_objext'
18622   { (eval echo "$as_me:18622: \"$ac_try\"") >&5
18623   (eval $ac_try) 2>&5
18624   ac_status=$?
18625   echo "$as_me:18625: \$? = $ac_status" >&5
18626   (exit $ac_status); }; }; then
18627   cf_cv_mbstate_t=yes
18628 else
18629   echo "$as_me: failed program was:" >&5
18630 cat conftest.$ac_ext >&5
18631 cf_cv_mbstate_t=unknown
18632 fi
18633 rm -f conftest.$ac_objext conftest.$ac_ext
18634 fi
18635 rm -f conftest.$ac_objext conftest.$ac_ext
18636 fi
18637 echo "$as_me:18637: result: $cf_cv_mbstate_t" >&5
18638 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
18639
18640 if test "$cf_cv_mbstate_t" = yes ; then
18641
18642 cat >>confdefs.h <<\EOF
18643 #define NEED_WCHAR_H 1
18644 EOF
18645
18646         NEED_WCHAR_H=1
18647 fi
18648
18649 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
18650 if test "$cf_cv_mbstate_t" = unknown ; then
18651         NCURSES_MBSTATE_T=1
18652 fi
18653
18654 # if we find mbstate_t in either place, use substitution to provide a fallback.
18655 if test "$cf_cv_mbstate_t" != unknown ; then
18656         NCURSES_OK_MBSTATE_T=1
18657 fi
18658
18659 # This is needed on Tru64 5.0 to declare wchar_t
18660 echo "$as_me:18660: checking if we must include wchar.h to declare wchar_t" >&5
18661 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
18662 if test "${cf_cv_wchar_t+set}" = set; then
18663   echo $ECHO_N "(cached) $ECHO_C" >&6
18664 else
18665
18666 cat >conftest.$ac_ext <<_ACEOF
18667 #line 18667 "configure"
18668 #include "confdefs.h"
18669
18670 #include <stdlib.h>
18671 #include <stdarg.h>
18672 #include <stdio.h>
18673 #ifdef HAVE_LIBUTF8_H
18674 #include <libutf8.h>
18675 #endif
18676 int
18677 main (void)
18678 {
18679 wchar_t state
18680   ;
18681   return 0;
18682 }
18683 _ACEOF
18684 rm -f conftest.$ac_objext
18685 if { (eval echo "$as_me:18685: \"$ac_compile\"") >&5
18686   (eval $ac_compile) 2>&5
18687   ac_status=$?
18688   echo "$as_me:18688: \$? = $ac_status" >&5
18689   (exit $ac_status); } &&
18690          { ac_try='test -s conftest.$ac_objext'
18691   { (eval echo "$as_me:18691: \"$ac_try\"") >&5
18692   (eval $ac_try) 2>&5
18693   ac_status=$?
18694   echo "$as_me:18694: \$? = $ac_status" >&5
18695   (exit $ac_status); }; }; then
18696   cf_cv_wchar_t=no
18697 else
18698   echo "$as_me: failed program was:" >&5
18699 cat conftest.$ac_ext >&5
18700 cat >conftest.$ac_ext <<_ACEOF
18701 #line 18701 "configure"
18702 #include "confdefs.h"
18703
18704 #include <stdlib.h>
18705 #include <stdarg.h>
18706 #include <stdio.h>
18707 #include <wchar.h>
18708 #ifdef HAVE_LIBUTF8_H
18709 #include <libutf8.h>
18710 #endif
18711 int
18712 main (void)
18713 {
18714 wchar_t value
18715   ;
18716   return 0;
18717 }
18718 _ACEOF
18719 rm -f conftest.$ac_objext
18720 if { (eval echo "$as_me:18720: \"$ac_compile\"") >&5
18721   (eval $ac_compile) 2>&5
18722   ac_status=$?
18723   echo "$as_me:18723: \$? = $ac_status" >&5
18724   (exit $ac_status); } &&
18725          { ac_try='test -s conftest.$ac_objext'
18726   { (eval echo "$as_me:18726: \"$ac_try\"") >&5
18727   (eval $ac_try) 2>&5
18728   ac_status=$?
18729   echo "$as_me:18729: \$? = $ac_status" >&5
18730   (exit $ac_status); }; }; then
18731   cf_cv_wchar_t=yes
18732 else
18733   echo "$as_me: failed program was:" >&5
18734 cat conftest.$ac_ext >&5
18735 cf_cv_wchar_t=unknown
18736 fi
18737 rm -f conftest.$ac_objext conftest.$ac_ext
18738 fi
18739 rm -f conftest.$ac_objext conftest.$ac_ext
18740 fi
18741 echo "$as_me:18741: result: $cf_cv_wchar_t" >&5
18742 echo "${ECHO_T}$cf_cv_wchar_t" >&6
18743
18744 if test "$cf_cv_wchar_t" = yes ; then
18745
18746 cat >>confdefs.h <<\EOF
18747 #define NEED_WCHAR_H 1
18748 EOF
18749
18750         NEED_WCHAR_H=1
18751 fi
18752
18753 # if we do not find wchar_t in either place, use substitution to provide a fallback.
18754 if test "$cf_cv_wchar_t" = unknown ; then
18755         NCURSES_WCHAR_T=1
18756 fi
18757
18758 # if we find wchar_t in either place, use substitution to provide a fallback.
18759 if test "$cf_cv_wchar_t" != unknown ; then
18760         NCURSES_OK_WCHAR_T=1
18761 fi
18762
18763 # This is needed on Tru64 5.0 to declare wint_t
18764 echo "$as_me:18764: checking if we must include wchar.h to declare wint_t" >&5
18765 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
18766 if test "${cf_cv_wint_t+set}" = set; then
18767   echo $ECHO_N "(cached) $ECHO_C" >&6
18768 else
18769
18770 cat >conftest.$ac_ext <<_ACEOF
18771 #line 18771 "configure"
18772 #include "confdefs.h"
18773
18774 #include <stdlib.h>
18775 #include <stdarg.h>
18776 #include <stdio.h>
18777 #ifdef HAVE_LIBUTF8_H
18778 #include <libutf8.h>
18779 #endif
18780 int
18781 main (void)
18782 {
18783 wint_t state
18784   ;
18785   return 0;
18786 }
18787 _ACEOF
18788 rm -f conftest.$ac_objext
18789 if { (eval echo "$as_me:18789: \"$ac_compile\"") >&5
18790   (eval $ac_compile) 2>&5
18791   ac_status=$?
18792   echo "$as_me:18792: \$? = $ac_status" >&5
18793   (exit $ac_status); } &&
18794          { ac_try='test -s conftest.$ac_objext'
18795   { (eval echo "$as_me:18795: \"$ac_try\"") >&5
18796   (eval $ac_try) 2>&5
18797   ac_status=$?
18798   echo "$as_me:18798: \$? = $ac_status" >&5
18799   (exit $ac_status); }; }; then
18800   cf_cv_wint_t=no
18801 else
18802   echo "$as_me: failed program was:" >&5
18803 cat conftest.$ac_ext >&5
18804 cat >conftest.$ac_ext <<_ACEOF
18805 #line 18805 "configure"
18806 #include "confdefs.h"
18807
18808 #include <stdlib.h>
18809 #include <stdarg.h>
18810 #include <stdio.h>
18811 #include <wchar.h>
18812 #ifdef HAVE_LIBUTF8_H
18813 #include <libutf8.h>
18814 #endif
18815 int
18816 main (void)
18817 {
18818 wint_t value
18819   ;
18820   return 0;
18821 }
18822 _ACEOF
18823 rm -f conftest.$ac_objext
18824 if { (eval echo "$as_me:18824: \"$ac_compile\"") >&5
18825   (eval $ac_compile) 2>&5
18826   ac_status=$?
18827   echo "$as_me:18827: \$? = $ac_status" >&5
18828   (exit $ac_status); } &&
18829          { ac_try='test -s conftest.$ac_objext'
18830   { (eval echo "$as_me:18830: \"$ac_try\"") >&5
18831   (eval $ac_try) 2>&5
18832   ac_status=$?
18833   echo "$as_me:18833: \$? = $ac_status" >&5
18834   (exit $ac_status); }; }; then
18835   cf_cv_wint_t=yes
18836 else
18837   echo "$as_me: failed program was:" >&5
18838 cat conftest.$ac_ext >&5
18839 cf_cv_wint_t=unknown
18840 fi
18841 rm -f conftest.$ac_objext conftest.$ac_ext
18842 fi
18843 rm -f conftest.$ac_objext conftest.$ac_ext
18844 fi
18845 echo "$as_me:18845: result: $cf_cv_wint_t" >&5
18846 echo "${ECHO_T}$cf_cv_wint_t" >&6
18847
18848 if test "$cf_cv_wint_t" = yes ; then
18849
18850 cat >>confdefs.h <<\EOF
18851 #define NEED_WCHAR_H 1
18852 EOF
18853
18854         NEED_WCHAR_H=1
18855 fi
18856
18857 # if we do not find wint_t in either place, use substitution to provide a fallback.
18858 if test "$cf_cv_wint_t" = unknown ; then
18859         NCURSES_WINT_T=1
18860 fi
18861
18862 # if we find wint_t in either place, use substitution to provide a fallback.
18863 if test "$cf_cv_wint_t" != unknown ; then
18864         NCURSES_OK_WINT_T=1
18865 fi
18866
18867         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
18868
18869 echo "$as_me:18869: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18870 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18871 cat >conftest.$ac_ext <<_ACEOF
18872 #line 18872 "configure"
18873 #include "confdefs.h"
18874
18875 #ifndef _XOPEN_SOURCE_EXTENDED
18876 #define _XOPEN_SOURCE_EXTENDED
18877 #endif
18878 #include <${cf_cv_ncurses_header:-curses.h}>
18879 int
18880 main (void)
18881 {
18882
18883 mbstate_t foo
18884
18885   ;
18886   return 0;
18887 }
18888 _ACEOF
18889 rm -f conftest.$ac_objext
18890 if { (eval echo "$as_me:18890: \"$ac_compile\"") >&5
18891   (eval $ac_compile) 2>&5
18892   ac_status=$?
18893   echo "$as_me:18893: \$? = $ac_status" >&5
18894   (exit $ac_status); } &&
18895          { ac_try='test -s conftest.$ac_objext'
18896   { (eval echo "$as_me:18896: \"$ac_try\"") >&5
18897   (eval $ac_try) 2>&5
18898   ac_status=$?
18899   echo "$as_me:18899: \$? = $ac_status" >&5
18900   (exit $ac_status); }; }; then
18901   cf_result=yes
18902 else
18903   echo "$as_me: failed program was:" >&5
18904 cat conftest.$ac_ext >&5
18905 cf_result=no
18906 fi
18907 rm -f conftest.$ac_objext conftest.$ac_ext
18908 echo "$as_me:18908: result: $cf_result" >&5
18909 echo "${ECHO_T}$cf_result" >&6
18910 if test $cf_result = yes ; then
18911
18912 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18913
18914 cat >>confdefs.h <<EOF
18915 #define $cf_result 1
18916 EOF
18917
18918 else
18919
18920 cat >>confdefs.h <<EOF
18921 #define mbstate_t long
18922 EOF
18923
18924 fi
18925
18926         fi
18927
18928         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
18929
18930 echo "$as_me:18930: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18931 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18932 cat >conftest.$ac_ext <<_ACEOF
18933 #line 18933 "configure"
18934 #include "confdefs.h"
18935
18936 #ifndef _XOPEN_SOURCE_EXTENDED
18937 #define _XOPEN_SOURCE_EXTENDED
18938 #endif
18939 #include <${cf_cv_ncurses_header:-curses.h}>
18940 int
18941 main (void)
18942 {
18943
18944 wchar_t foo
18945
18946   ;
18947   return 0;
18948 }
18949 _ACEOF
18950 rm -f conftest.$ac_objext
18951 if { (eval echo "$as_me:18951: \"$ac_compile\"") >&5
18952   (eval $ac_compile) 2>&5
18953   ac_status=$?
18954   echo "$as_me:18954: \$? = $ac_status" >&5
18955   (exit $ac_status); } &&
18956          { ac_try='test -s conftest.$ac_objext'
18957   { (eval echo "$as_me:18957: \"$ac_try\"") >&5
18958   (eval $ac_try) 2>&5
18959   ac_status=$?
18960   echo "$as_me:18960: \$? = $ac_status" >&5
18961   (exit $ac_status); }; }; then
18962   cf_result=yes
18963 else
18964   echo "$as_me: failed program was:" >&5
18965 cat conftest.$ac_ext >&5
18966 cf_result=no
18967 fi
18968 rm -f conftest.$ac_objext conftest.$ac_ext
18969 echo "$as_me:18969: result: $cf_result" >&5
18970 echo "${ECHO_T}$cf_result" >&6
18971 if test $cf_result = yes ; then
18972
18973 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18974
18975 cat >>confdefs.h <<EOF
18976 #define $cf_result 1
18977 EOF
18978
18979 else
18980
18981 cat >>confdefs.h <<EOF
18982 #define wchar_t long
18983 EOF
18984
18985 fi
18986
18987         fi
18988
18989         if test "$NCURSES_OK_WINT_T" = 0 ; then
18990
18991 echo "$as_me:18991: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18992 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18993 cat >conftest.$ac_ext <<_ACEOF
18994 #line 18994 "configure"
18995 #include "confdefs.h"
18996
18997 #ifndef _XOPEN_SOURCE_EXTENDED
18998 #define _XOPEN_SOURCE_EXTENDED
18999 #endif
19000 #include <${cf_cv_ncurses_header:-curses.h}>
19001 int
19002 main (void)
19003 {
19004
19005 wint_t foo
19006
19007   ;
19008   return 0;
19009 }
19010 _ACEOF
19011 rm -f conftest.$ac_objext
19012 if { (eval echo "$as_me:19012: \"$ac_compile\"") >&5
19013   (eval $ac_compile) 2>&5
19014   ac_status=$?
19015   echo "$as_me:19015: \$? = $ac_status" >&5
19016   (exit $ac_status); } &&
19017          { ac_try='test -s conftest.$ac_objext'
19018   { (eval echo "$as_me:19018: \"$ac_try\"") >&5
19019   (eval $ac_try) 2>&5
19020   ac_status=$?
19021   echo "$as_me:19021: \$? = $ac_status" >&5
19022   (exit $ac_status); }; }; then
19023   cf_result=yes
19024 else
19025   echo "$as_me: failed program was:" >&5
19026 cat conftest.$ac_ext >&5
19027 cf_result=no
19028 fi
19029 rm -f conftest.$ac_objext conftest.$ac_ext
19030 echo "$as_me:19030: result: $cf_result" >&5
19031 echo "${ECHO_T}$cf_result" >&6
19032 if test $cf_result = yes ; then
19033
19034 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19035
19036 cat >>confdefs.h <<EOF
19037 #define $cf_result 1
19038 EOF
19039
19040 else
19041
19042 cat >>confdefs.h <<EOF
19043 #define wint_t long
19044 EOF
19045
19046 fi
19047
19048         fi
19049 fi
19050
19051 for cf_data in \
19052 curscr \
19053 ospeed \
19054 boolnames \
19055 boolfnames \
19056 ttytype
19057 do
19058 echo "$as_me:19058: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19059 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19060
19061 cat >conftest.$ac_ext <<_ACEOF
19062 #line 19062 "configure"
19063 #include "confdefs.h"
19064
19065 #ifdef HAVE_XCURSES
19066 #include <xcurses.h>
19067 char * XCursesProgramName = "test";
19068 #else
19069 #include <${cf_cv_ncurses_header:-curses.h}>
19070 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19071 #include <ncursesw/term.h>
19072 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19073 #include <ncurses/term.h>
19074 #elif defined(HAVE_TERM_H)
19075 #include <term.h>
19076 #endif
19077 #endif
19078
19079 int
19080 main (void)
19081 {
19082
19083 void *foo = &($cf_data)
19084
19085   ;
19086   return 0;
19087 }
19088 _ACEOF
19089 rm -f conftest.$ac_objext
19090 if { (eval echo "$as_me:19090: \"$ac_compile\"") >&5
19091   (eval $ac_compile) 2>&5
19092   ac_status=$?
19093   echo "$as_me:19093: \$? = $ac_status" >&5
19094   (exit $ac_status); } &&
19095          { ac_try='test -s conftest.$ac_objext'
19096   { (eval echo "$as_me:19096: \"$ac_try\"") >&5
19097   (eval $ac_try) 2>&5
19098   ac_status=$?
19099   echo "$as_me:19099: \$? = $ac_status" >&5
19100   (exit $ac_status); }; }; then
19101   cf_result=yes
19102
19103 else
19104   echo "$as_me: failed program was:" >&5
19105 cat conftest.$ac_ext >&5
19106 cf_result=no
19107 fi
19108 rm -f conftest.$ac_objext conftest.$ac_ext
19109 echo "$as_me:19109: result: $cf_result" >&5
19110 echo "${ECHO_T}$cf_result" >&6
19111
19112 if test $cf_result = yes ; then
19113
19114 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19115
19116         cat >>confdefs.h <<EOF
19117 #define $cf_result 1
19118 EOF
19119
19120 else
19121         echo "$as_me:19121: checking for data $cf_data in library" >&5
19122 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19123         # BSD linkers insist on making weak linkage, but resolve at runtime.
19124         if test "$cross_compiling" = yes; then
19125
19126         # cross-compiling
19127         cat >conftest.$ac_ext <<_ACEOF
19128 #line 19128 "configure"
19129 #include "confdefs.h"
19130
19131 #ifdef HAVE_XCURSES
19132 #include <xcurses.h>
19133 char * XCursesProgramName = "test";
19134 #else
19135 #include <${cf_cv_ncurses_header:-curses.h}>
19136 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19137 #include <ncursesw/term.h>
19138 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19139 #include <ncurses/term.h>
19140 #elif defined(HAVE_TERM_H)
19141 #include <term.h>
19142 #endif
19143 #endif
19144
19145 extern char $cf_data;
19146 int
19147 main (void)
19148 {
19149
19150         do {
19151                 void *foo = &($cf_data);
19152                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19153                 ${cf_cv_main_return:-return}(foo == 0);
19154         } while (0)
19155
19156   ;
19157   return 0;
19158 }
19159 _ACEOF
19160 rm -f conftest.$ac_objext conftest$ac_exeext
19161 if { (eval echo "$as_me:19161: \"$ac_link\"") >&5
19162   (eval $ac_link) 2>&5
19163   ac_status=$?
19164   echo "$as_me:19164: \$? = $ac_status" >&5
19165   (exit $ac_status); } &&
19166          { ac_try='test -s conftest$ac_exeext'
19167   { (eval echo "$as_me:19167: \"$ac_try\"") >&5
19168   (eval $ac_try) 2>&5
19169   ac_status=$?
19170   echo "$as_me:19170: \$? = $ac_status" >&5
19171   (exit $ac_status); }; }; then
19172   cf_result=yes
19173 else
19174   echo "$as_me: failed program was:" >&5
19175 cat conftest.$ac_ext >&5
19176 cf_result=no
19177 fi
19178 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19179
19180 else
19181   cat >conftest.$ac_ext <<_ACEOF
19182 #line 19182 "configure"
19183 #include "confdefs.h"
19184
19185 #ifdef HAVE_XCURSES
19186 #include <xcurses.h>
19187 char * XCursesProgramName = "test";
19188 #else
19189 #include <${cf_cv_ncurses_header:-curses.h}>
19190 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19191 #include <ncursesw/term.h>
19192 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19193 #include <ncurses/term.h>
19194 #elif defined(HAVE_TERM_H)
19195 #include <term.h>
19196 #endif
19197 #endif
19198
19199 extern char $cf_data;
19200 int main(void)
19201 {
19202         void *foo = &($cf_data);
19203         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19204         ${cf_cv_main_return:-return}(foo == 0);
19205 }
19206 _ACEOF
19207 rm -f conftest$ac_exeext
19208 if { (eval echo "$as_me:19208: \"$ac_link\"") >&5
19209   (eval $ac_link) 2>&5
19210   ac_status=$?
19211   echo "$as_me:19211: \$? = $ac_status" >&5
19212   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19213   { (eval echo "$as_me:19213: \"$ac_try\"") >&5
19214   (eval $ac_try) 2>&5
19215   ac_status=$?
19216   echo "$as_me:19216: \$? = $ac_status" >&5
19217   (exit $ac_status); }; }; then
19218   cf_result=yes
19219
19220 else
19221   echo "$as_me: program exited with status $ac_status" >&5
19222 echo "$as_me: failed program was:" >&5
19223 cat conftest.$ac_ext >&5
19224 cf_result=no
19225 fi
19226 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19227 fi
19228         echo "$as_me:19228: result: $cf_result" >&5
19229 echo "${ECHO_T}$cf_result" >&6
19230         if test $cf_result = yes ; then
19231
19232 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19233
19234                 cat >>confdefs.h <<EOF
19235 #define $cf_result 1
19236 EOF
19237
19238                 # do not exit loop here, since we prefer system's declarations
19239         fi
19240 fi
19241 done
19242
19243 if ( test "$GCC" = yes || test "$GXX" = yes )
19244 then
19245 echo "$as_me:19245: checking if you want to turn on gcc warnings" >&5
19246 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
19247
19248 # Check whether --enable-warnings or --disable-warnings was given.
19249 if test "${enable_warnings+set}" = set; then
19250   enableval="$enable_warnings"
19251   test "$enableval" != yes && enableval=no
19252         if test "$enableval" != "no" ; then
19253     with_warnings=yes
19254         else
19255                 with_warnings=no
19256         fi
19257 else
19258   enableval=no
19259         with_warnings=no
19260
19261 fi;
19262 echo "$as_me:19262: result: $with_warnings" >&5
19263 echo "${ECHO_T}$with_warnings" >&6
19264 if test "$with_warnings" = "yes"
19265 then
19266
19267 if test "$GCC" = yes
19268 then
19269 cat > conftest.i <<EOF
19270 #ifndef GCC_PRINTF
19271 #define GCC_PRINTF 0
19272 #endif
19273 #ifndef GCC_SCANF
19274 #define GCC_SCANF 0
19275 #endif
19276 #ifndef GCC_NORETURN
19277 #define GCC_NORETURN /* nothing */
19278 #endif
19279 #ifndef GCC_UNUSED
19280 #define GCC_UNUSED /* nothing */
19281 #endif
19282 EOF
19283 if test "$GCC" = yes
19284 then
19285         { echo "$as_me:19285: checking for $CC __attribute__ directives..." >&5
19286 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
19287 cat > conftest.$ac_ext <<EOF
19288 #line 19288 "${as_me:-configure}"
19289 #include "confdefs.h"
19290 #include "conftest.h"
19291 #include "conftest.i"
19292 #if     GCC_PRINTF
19293 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
19294 #else
19295 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
19296 #endif
19297 #if     GCC_SCANF
19298 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
19299 #else
19300 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
19301 #endif
19302 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
19303 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
19304 extern void foo(void) GCC_NORETURN;
19305 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
19306 EOF
19307         cf_printf_attribute=no
19308         cf_scanf_attribute=no
19309         for cf_attribute in scanf printf unused noreturn
19310         do
19311
19312 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19313
19314                 cf_directive="__attribute__(($cf_attribute))"
19315                 echo "checking for $CC $cf_directive" 1>&5
19316
19317                 case $cf_attribute in
19318                 (printf)
19319                         cf_printf_attribute=yes
19320                         cat >conftest.h <<EOF
19321 #define GCC_$cf_ATTRIBUTE 1
19322 EOF
19323                         ;;
19324                 (scanf)
19325                         cf_scanf_attribute=yes
19326                         cat >conftest.h <<EOF
19327 #define GCC_$cf_ATTRIBUTE 1
19328 EOF
19329                         ;;
19330                 (*)
19331                         cat >conftest.h <<EOF
19332 #define GCC_$cf_ATTRIBUTE $cf_directive
19333 EOF
19334                         ;;
19335                 esac
19336
19337                 if { (eval echo "$as_me:19337: \"$ac_compile\"") >&5
19338   (eval $ac_compile) 2>&5
19339   ac_status=$?
19340   echo "$as_me:19340: \$? = $ac_status" >&5
19341   (exit $ac_status); }; then
19342                         test -n "$verbose" && echo "$as_me:19342: result: ... $cf_attribute" >&5
19343 echo "${ECHO_T}... $cf_attribute" >&6
19344                         cat conftest.h >>confdefs.h
19345                         case $cf_attribute in
19346                         (noreturn)
19347
19348 cat >>confdefs.h <<EOF
19349 #define GCC_NORETURN $cf_directive
19350 EOF
19351
19352                                 ;;
19353                         (printf)
19354                                 cf_value='/* nothing */'
19355                                 if test "$cf_printf_attribute" != no ; then
19356                                         cf_value='__attribute__((format(printf,fmt,var)))'
19357
19358 cat >>confdefs.h <<\EOF
19359 #define GCC_PRINTF 1
19360 EOF
19361
19362                                 fi
19363
19364 cat >>confdefs.h <<EOF
19365 #define GCC_PRINTFLIKE(fmt,var) $cf_value
19366 EOF
19367
19368                                 ;;
19369                         (scanf)
19370                                 cf_value='/* nothing */'
19371                                 if test "$cf_scanf_attribute" != no ; then
19372                                         cf_value='__attribute__((format(scanf,fmt,var)))'
19373
19374 cat >>confdefs.h <<\EOF
19375 #define GCC_SCANF 1
19376 EOF
19377
19378                                 fi
19379
19380 cat >>confdefs.h <<EOF
19381 #define GCC_SCANFLIKE(fmt,var) $cf_value
19382 EOF
19383
19384                                 ;;
19385                         (unused)
19386
19387 cat >>confdefs.h <<EOF
19388 #define GCC_UNUSED $cf_directive
19389 EOF
19390
19391                                 ;;
19392                         esac
19393                 fi
19394         done
19395 else
19396         fgrep define conftest.i >>confdefs.h
19397 fi
19398 rm -rf conftest*
19399 fi
19400
19401 INTEL_COMPILER=no
19402
19403 if test "$GCC" = yes ; then
19404         case $host_os in
19405         (linux*|gnu*)
19406                 echo "$as_me:19406: checking if this is really Intel C compiler" >&5
19407 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
19408                 cf_save_CFLAGS="$CFLAGS"
19409                 CFLAGS="$CFLAGS -no-gcc"
19410                 cat >conftest.$ac_ext <<_ACEOF
19411 #line 19411 "configure"
19412 #include "confdefs.h"
19413
19414 int
19415 main (void)
19416 {
19417
19418 #ifdef __INTEL_COMPILER
19419 #else
19420 make an error
19421 #endif
19422
19423   ;
19424   return 0;
19425 }
19426 _ACEOF
19427 rm -f conftest.$ac_objext
19428 if { (eval echo "$as_me:19428: \"$ac_compile\"") >&5
19429   (eval $ac_compile) 2>&5
19430   ac_status=$?
19431   echo "$as_me:19431: \$? = $ac_status" >&5
19432   (exit $ac_status); } &&
19433          { ac_try='test -s conftest.$ac_objext'
19434   { (eval echo "$as_me:19434: \"$ac_try\"") >&5
19435   (eval $ac_try) 2>&5
19436   ac_status=$?
19437   echo "$as_me:19437: \$? = $ac_status" >&5
19438   (exit $ac_status); }; }; then
19439   INTEL_COMPILER=yes
19440 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
19441
19442 else
19443   echo "$as_me: failed program was:" >&5
19444 cat conftest.$ac_ext >&5
19445 fi
19446 rm -f conftest.$ac_objext conftest.$ac_ext
19447                 CFLAGS="$cf_save_CFLAGS"
19448                 echo "$as_me:19448: result: $INTEL_COMPILER" >&5
19449 echo "${ECHO_T}$INTEL_COMPILER" >&6
19450                 ;;
19451         esac
19452 fi
19453
19454 CLANG_COMPILER=no
19455
19456 if test "$GCC" = yes ; then
19457         echo "$as_me:19457: checking if this is really Clang C compiler" >&5
19458 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
19459         cf_save_CFLAGS="$CFLAGS"
19460         CFLAGS="$CFLAGS -Qunused-arguments"
19461         cat >conftest.$ac_ext <<_ACEOF
19462 #line 19462 "configure"
19463 #include "confdefs.h"
19464
19465 int
19466 main (void)
19467 {
19468
19469 #ifdef __clang__
19470 #else
19471 make an error
19472 #endif
19473
19474   ;
19475   return 0;
19476 }
19477 _ACEOF
19478 rm -f conftest.$ac_objext
19479 if { (eval echo "$as_me:19479: \"$ac_compile\"") >&5
19480   (eval $ac_compile) 2>&5
19481   ac_status=$?
19482   echo "$as_me:19482: \$? = $ac_status" >&5
19483   (exit $ac_status); } &&
19484          { ac_try='test -s conftest.$ac_objext'
19485   { (eval echo "$as_me:19485: \"$ac_try\"") >&5
19486   (eval $ac_try) 2>&5
19487   ac_status=$?
19488   echo "$as_me:19488: \$? = $ac_status" >&5
19489   (exit $ac_status); }; }; then
19490   CLANG_COMPILER=yes
19491 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
19492
19493 else
19494   echo "$as_me: failed program was:" >&5
19495 cat conftest.$ac_ext >&5
19496 fi
19497 rm -f conftest.$ac_objext conftest.$ac_ext
19498         CFLAGS="$cf_save_CFLAGS"
19499         echo "$as_me:19499: result: $CLANG_COMPILER" >&5
19500 echo "${ECHO_T}$CLANG_COMPILER" >&6
19501 fi
19502
19503 cat > conftest.$ac_ext <<EOF
19504 #line 19504 "${as_me:-configure}"
19505 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
19506 EOF
19507
19508 if test "$INTEL_COMPILER" = yes
19509 then
19510 # The "-wdXXX" options suppress warnings:
19511 # remark #1419: external declaration in primary source file
19512 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
19513 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
19514 # remark #193: zero used for undefined preprocessing identifier
19515 # remark #593: variable "curs_sb_left_arrow" was set but never used
19516 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
19517 # remark #869: parameter "tw" was never referenced
19518 # remark #981: operands are evaluated in unspecified order
19519 # warning #279: controlling expression is constant
19520
19521         { echo "$as_me:19521: checking for $CC warning options..." >&5
19522 echo "$as_me: checking for $CC warning options..." >&6;}
19523         cf_save_CFLAGS="$CFLAGS"
19524         EXTRA_CFLAGS="-Wall"
19525         for cf_opt in \
19526                 wd1419 \
19527                 wd1683 \
19528                 wd1684 \
19529                 wd193 \
19530                 wd593 \
19531                 wd279 \
19532                 wd810 \
19533                 wd869 \
19534                 wd981
19535         do
19536                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19537                 if { (eval echo "$as_me:19537: \"$ac_compile\"") >&5
19538   (eval $ac_compile) 2>&5
19539   ac_status=$?
19540   echo "$as_me:19540: \$? = $ac_status" >&5
19541   (exit $ac_status); }; then
19542                         test -n "$verbose" && echo "$as_me:19542: result: ... -$cf_opt" >&5
19543 echo "${ECHO_T}... -$cf_opt" >&6
19544                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19545                 fi
19546         done
19547         CFLAGS="$cf_save_CFLAGS"
19548
19549 elif test "$GCC" = yes
19550 then
19551         { echo "$as_me:19551: checking for $CC warning options..." >&5
19552 echo "$as_me: checking for $CC warning options..." >&6;}
19553         cf_save_CFLAGS="$CFLAGS"
19554         EXTRA_CFLAGS=
19555         cf_warn_CONST=""
19556         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
19557         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
19558         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
19559         for cf_opt in W Wall \
19560                 Wbad-function-cast \
19561                 Wcast-align \
19562                 Wcast-qual \
19563                 Wdeclaration-after-statement \
19564                 Wextra \
19565                 Winline \
19566                 Wmissing-declarations \
19567                 Wmissing-prototypes \
19568                 Wnested-externs \
19569                 Wpointer-arith \
19570                 Wshadow \
19571                 Wstrict-prototypes \
19572                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
19573         do
19574                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19575                 if { (eval echo "$as_me:19575: \"$ac_compile\"") >&5
19576   (eval $ac_compile) 2>&5
19577   ac_status=$?
19578   echo "$as_me:19578: \$? = $ac_status" >&5
19579   (exit $ac_status); }; then
19580                         test -n "$verbose" && echo "$as_me:19580: result: ... -$cf_opt" >&5
19581 echo "${ECHO_T}... -$cf_opt" >&6
19582                         case $cf_opt in
19583                         (Wcast-qual)
19584
19585         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19586         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
19587
19588                                 ;;
19589                         (Winline)
19590                                 case $GCC_VERSION in
19591                                 ([34].*)
19592                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19593
19594 echo "${as_me:-configure}:19594: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19595
19596                                         continue;;
19597                                 esac
19598                                 ;;
19599                         (Wpointer-arith)
19600                                 case $GCC_VERSION in
19601                                 ([12].*)
19602                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19603
19604 echo "${as_me:-configure}:19604: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19605
19606                                         continue;;
19607                                 esac
19608                                 ;;
19609                         esac
19610                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19611                 fi
19612         done
19613         CFLAGS="$cf_save_CFLAGS"
19614 fi
19615 rm -rf conftest*
19616
19617 fi
19618 fi
19619
19620 echo "$as_me:19620: checking if you want to use dmalloc for testing" >&5
19621 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
19622
19623 # Check whether --with-dmalloc or --without-dmalloc was given.
19624 if test "${with_dmalloc+set}" = set; then
19625   withval="$with_dmalloc"
19626
19627 cat >>confdefs.h <<EOF
19628 #define USE_DMALLOC 1
19629 EOF
19630
19631         : ${with_cflags:=-g}
19632         : ${with_no_leaks:=yes}
19633          with_dmalloc=yes
19634 else
19635   with_dmalloc=
19636 fi;
19637 echo "$as_me:19637: result: ${with_dmalloc:-no}" >&5
19638 echo "${ECHO_T}${with_dmalloc:-no}" >&6
19639
19640 case .$with_cflags in
19641 (.*-g*)
19642         case .$CFLAGS in
19643         (.*-g*)
19644                 ;;
19645         (*)
19646
19647 cf_fix_cppflags=no
19648 cf_new_cflags=
19649 cf_new_cppflags=
19650 cf_new_extra_cppflags=
19651
19652 for cf_add_cflags in -g
19653 do
19654 case $cf_fix_cppflags in
19655 (no)
19656         case $cf_add_cflags in
19657         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19658                 case $cf_add_cflags in
19659                 (-D*)
19660                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19661
19662                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19663                                 && test -z "${cf_tst_cflags}" \
19664                                 && cf_fix_cppflags=yes
19665
19666                         if test $cf_fix_cppflags = yes ; then
19667
19668         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19669         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19670
19671                                 continue
19672                         elif test "${cf_tst_cflags}" = "\"'" ; then
19673
19674         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19675         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19676
19677                                 continue
19678                         fi
19679                         ;;
19680                 esac
19681                 case "$CPPFLAGS" in
19682                 (*$cf_add_cflags)
19683                         ;;
19684                 (*)
19685                         case $cf_add_cflags in
19686                         (-D*)
19687                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19688
19689 CPPFLAGS=`echo "$CPPFLAGS" | \
19690         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19691                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19692
19693                                 ;;
19694                         esac
19695
19696         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19697         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19698
19699                         ;;
19700                 esac
19701                 ;;
19702         (*)
19703
19704         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19705         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19706
19707                 ;;
19708         esac
19709         ;;
19710 (yes)
19711
19712         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19713         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19714
19715         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19716
19717         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19718                 && test -z "${cf_tst_cflags}" \
19719                 && cf_fix_cppflags=no
19720         ;;
19721 esac
19722 done
19723
19724 if test -n "$cf_new_cflags" ; then
19725
19726         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19727         CFLAGS="${CFLAGS}$cf_new_cflags"
19728
19729 fi
19730
19731 if test -n "$cf_new_cppflags" ; then
19732
19733         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19734         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19735
19736 fi
19737
19738 if test -n "$cf_new_extra_cppflags" ; then
19739
19740         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19741         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19742
19743 fi
19744
19745                 ;;
19746         esac
19747         ;;
19748 esac
19749
19750 if test "$with_dmalloc" = yes ; then
19751         echo "$as_me:19751: checking for dmalloc.h" >&5
19752 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
19753 if test "${ac_cv_header_dmalloc_h+set}" = set; then
19754   echo $ECHO_N "(cached) $ECHO_C" >&6
19755 else
19756   cat >conftest.$ac_ext <<_ACEOF
19757 #line 19757 "configure"
19758 #include "confdefs.h"
19759 #include <dmalloc.h>
19760 _ACEOF
19761 if { (eval echo "$as_me:19761: \"$ac_cpp conftest.$ac_ext\"") >&5
19762   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19763   ac_status=$?
19764   egrep -v '^ *\+' conftest.er1 >conftest.err
19765   rm -f conftest.er1
19766   cat conftest.err >&5
19767   echo "$as_me:19767: \$? = $ac_status" >&5
19768   (exit $ac_status); } >/dev/null; then
19769   if test -s conftest.err; then
19770     ac_cpp_err=$ac_c_preproc_warn_flag
19771   else
19772     ac_cpp_err=
19773   fi
19774 else
19775   ac_cpp_err=yes
19776 fi
19777 if test -z "$ac_cpp_err"; then
19778   ac_cv_header_dmalloc_h=yes
19779 else
19780   echo "$as_me: failed program was:" >&5
19781   cat conftest.$ac_ext >&5
19782   ac_cv_header_dmalloc_h=no
19783 fi
19784 rm -f conftest.err conftest.$ac_ext
19785 fi
19786 echo "$as_me:19786: result: $ac_cv_header_dmalloc_h" >&5
19787 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
19788 if test $ac_cv_header_dmalloc_h = yes; then
19789
19790 echo "$as_me:19790: checking for dmalloc_debug in -ldmalloc" >&5
19791 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
19792 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
19793   echo $ECHO_N "(cached) $ECHO_C" >&6
19794 else
19795   ac_check_lib_save_LIBS=$LIBS
19796 LIBS="-ldmalloc  $LIBS"
19797 cat >conftest.$ac_ext <<_ACEOF
19798 #line 19798 "configure"
19799 #include "confdefs.h"
19800
19801 /* Override any gcc2 internal prototype to avoid an error.  */
19802 #ifdef __cplusplus
19803 extern "C"
19804 #endif
19805 /* We use char because int might match the return type of a gcc2
19806    builtin and then its argument prototype would still apply.  */
19807 char dmalloc_debug ();
19808 int
19809 main (void)
19810 {
19811 dmalloc_debug ();
19812   ;
19813   return 0;
19814 }
19815 _ACEOF
19816 rm -f conftest.$ac_objext conftest$ac_exeext
19817 if { (eval echo "$as_me:19817: \"$ac_link\"") >&5
19818   (eval $ac_link) 2>&5
19819   ac_status=$?
19820   echo "$as_me:19820: \$? = $ac_status" >&5
19821   (exit $ac_status); } &&
19822          { ac_try='test -s conftest$ac_exeext'
19823   { (eval echo "$as_me:19823: \"$ac_try\"") >&5
19824   (eval $ac_try) 2>&5
19825   ac_status=$?
19826   echo "$as_me:19826: \$? = $ac_status" >&5
19827   (exit $ac_status); }; }; then
19828   ac_cv_lib_dmalloc_dmalloc_debug=yes
19829 else
19830   echo "$as_me: failed program was:" >&5
19831 cat conftest.$ac_ext >&5
19832 ac_cv_lib_dmalloc_dmalloc_debug=no
19833 fi
19834 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19835 LIBS=$ac_check_lib_save_LIBS
19836 fi
19837 echo "$as_me:19837: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
19838 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
19839 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
19840   cat >>confdefs.h <<EOF
19841 #define HAVE_LIBDMALLOC 1
19842 EOF
19843
19844   LIBS="-ldmalloc $LIBS"
19845
19846 fi
19847
19848 fi
19849
19850 fi
19851
19852 echo "$as_me:19852: checking if you want to use dbmalloc for testing" >&5
19853 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
19854
19855 # Check whether --with-dbmalloc or --without-dbmalloc was given.
19856 if test "${with_dbmalloc+set}" = set; then
19857   withval="$with_dbmalloc"
19858
19859 cat >>confdefs.h <<EOF
19860 #define USE_DBMALLOC 1
19861 EOF
19862
19863         : ${with_cflags:=-g}
19864         : ${with_no_leaks:=yes}
19865          with_dbmalloc=yes
19866 else
19867   with_dbmalloc=
19868 fi;
19869 echo "$as_me:19869: result: ${with_dbmalloc:-no}" >&5
19870 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
19871
19872 case .$with_cflags in
19873 (.*-g*)
19874         case .$CFLAGS in
19875         (.*-g*)
19876                 ;;
19877         (*)
19878
19879 cf_fix_cppflags=no
19880 cf_new_cflags=
19881 cf_new_cppflags=
19882 cf_new_extra_cppflags=
19883
19884 for cf_add_cflags in -g
19885 do
19886 case $cf_fix_cppflags in
19887 (no)
19888         case $cf_add_cflags in
19889         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19890                 case $cf_add_cflags in
19891                 (-D*)
19892                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19893
19894                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19895                                 && test -z "${cf_tst_cflags}" \
19896                                 && cf_fix_cppflags=yes
19897
19898                         if test $cf_fix_cppflags = yes ; then
19899
19900         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19901         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19902
19903                                 continue
19904                         elif test "${cf_tst_cflags}" = "\"'" ; then
19905
19906         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19907         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19908
19909                                 continue
19910                         fi
19911                         ;;
19912                 esac
19913                 case "$CPPFLAGS" in
19914                 (*$cf_add_cflags)
19915                         ;;
19916                 (*)
19917                         case $cf_add_cflags in
19918                         (-D*)
19919                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19920
19921 CPPFLAGS=`echo "$CPPFLAGS" | \
19922         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19923                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19924
19925                                 ;;
19926                         esac
19927
19928         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19929         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19930
19931                         ;;
19932                 esac
19933                 ;;
19934         (*)
19935
19936         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19937         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19938
19939                 ;;
19940         esac
19941         ;;
19942 (yes)
19943
19944         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19945         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19946
19947         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19948
19949         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19950                 && test -z "${cf_tst_cflags}" \
19951                 && cf_fix_cppflags=no
19952         ;;
19953 esac
19954 done
19955
19956 if test -n "$cf_new_cflags" ; then
19957
19958         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19959         CFLAGS="${CFLAGS}$cf_new_cflags"
19960
19961 fi
19962
19963 if test -n "$cf_new_cppflags" ; then
19964
19965         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19966         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19967
19968 fi
19969
19970 if test -n "$cf_new_extra_cppflags" ; then
19971
19972         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19973         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19974
19975 fi
19976
19977                 ;;
19978         esac
19979         ;;
19980 esac
19981
19982 if test "$with_dbmalloc" = yes ; then
19983         echo "$as_me:19983: checking for dbmalloc.h" >&5
19984 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
19985 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
19986   echo $ECHO_N "(cached) $ECHO_C" >&6
19987 else
19988   cat >conftest.$ac_ext <<_ACEOF
19989 #line 19989 "configure"
19990 #include "confdefs.h"
19991 #include <dbmalloc.h>
19992 _ACEOF
19993 if { (eval echo "$as_me:19993: \"$ac_cpp conftest.$ac_ext\"") >&5
19994   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19995   ac_status=$?
19996   egrep -v '^ *\+' conftest.er1 >conftest.err
19997   rm -f conftest.er1
19998   cat conftest.err >&5
19999   echo "$as_me:19999: \$? = $ac_status" >&5
20000   (exit $ac_status); } >/dev/null; then
20001   if test -s conftest.err; then
20002     ac_cpp_err=$ac_c_preproc_warn_flag
20003   else
20004     ac_cpp_err=
20005   fi
20006 else
20007   ac_cpp_err=yes
20008 fi
20009 if test -z "$ac_cpp_err"; then
20010   ac_cv_header_dbmalloc_h=yes
20011 else
20012   echo "$as_me: failed program was:" >&5
20013   cat conftest.$ac_ext >&5
20014   ac_cv_header_dbmalloc_h=no
20015 fi
20016 rm -f conftest.err conftest.$ac_ext
20017 fi
20018 echo "$as_me:20018: result: $ac_cv_header_dbmalloc_h" >&5
20019 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
20020 if test $ac_cv_header_dbmalloc_h = yes; then
20021
20022 echo "$as_me:20022: checking for debug_malloc in -ldbmalloc" >&5
20023 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
20024 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
20025   echo $ECHO_N "(cached) $ECHO_C" >&6
20026 else
20027   ac_check_lib_save_LIBS=$LIBS
20028 LIBS="-ldbmalloc  $LIBS"
20029 cat >conftest.$ac_ext <<_ACEOF
20030 #line 20030 "configure"
20031 #include "confdefs.h"
20032
20033 /* Override any gcc2 internal prototype to avoid an error.  */
20034 #ifdef __cplusplus
20035 extern "C"
20036 #endif
20037 /* We use char because int might match the return type of a gcc2
20038    builtin and then its argument prototype would still apply.  */
20039 char debug_malloc ();
20040 int
20041 main (void)
20042 {
20043 debug_malloc ();
20044   ;
20045   return 0;
20046 }
20047 _ACEOF
20048 rm -f conftest.$ac_objext conftest$ac_exeext
20049 if { (eval echo "$as_me:20049: \"$ac_link\"") >&5
20050   (eval $ac_link) 2>&5
20051   ac_status=$?
20052   echo "$as_me:20052: \$? = $ac_status" >&5
20053   (exit $ac_status); } &&
20054          { ac_try='test -s conftest$ac_exeext'
20055   { (eval echo "$as_me:20055: \"$ac_try\"") >&5
20056   (eval $ac_try) 2>&5
20057   ac_status=$?
20058   echo "$as_me:20058: \$? = $ac_status" >&5
20059   (exit $ac_status); }; }; then
20060   ac_cv_lib_dbmalloc_debug_malloc=yes
20061 else
20062   echo "$as_me: failed program was:" >&5
20063 cat conftest.$ac_ext >&5
20064 ac_cv_lib_dbmalloc_debug_malloc=no
20065 fi
20066 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20067 LIBS=$ac_check_lib_save_LIBS
20068 fi
20069 echo "$as_me:20069: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
20070 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
20071 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
20072   cat >>confdefs.h <<EOF
20073 #define HAVE_LIBDBMALLOC 1
20074 EOF
20075
20076   LIBS="-ldbmalloc $LIBS"
20077
20078 fi
20079
20080 fi
20081
20082 fi
20083
20084 echo "$as_me:20084: checking if you want to use valgrind for testing" >&5
20085 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
20086
20087 # Check whether --with-valgrind or --without-valgrind was given.
20088 if test "${with_valgrind+set}" = set; then
20089   withval="$with_valgrind"
20090
20091 cat >>confdefs.h <<EOF
20092 #define USE_VALGRIND 1
20093 EOF
20094
20095         : ${with_cflags:=-g}
20096         : ${with_no_leaks:=yes}
20097          with_valgrind=yes
20098 else
20099   with_valgrind=
20100 fi;
20101 echo "$as_me:20101: result: ${with_valgrind:-no}" >&5
20102 echo "${ECHO_T}${with_valgrind:-no}" >&6
20103
20104 case .$with_cflags in
20105 (.*-g*)
20106         case .$CFLAGS in
20107         (.*-g*)
20108                 ;;
20109         (*)
20110
20111 cf_fix_cppflags=no
20112 cf_new_cflags=
20113 cf_new_cppflags=
20114 cf_new_extra_cppflags=
20115
20116 for cf_add_cflags in -g
20117 do
20118 case $cf_fix_cppflags in
20119 (no)
20120         case $cf_add_cflags in
20121         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20122                 case $cf_add_cflags in
20123                 (-D*)
20124                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20125
20126                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20127                                 && test -z "${cf_tst_cflags}" \
20128                                 && cf_fix_cppflags=yes
20129
20130                         if test $cf_fix_cppflags = yes ; then
20131
20132         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20133         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20134
20135                                 continue
20136                         elif test "${cf_tst_cflags}" = "\"'" ; then
20137
20138         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20139         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20140
20141                                 continue
20142                         fi
20143                         ;;
20144                 esac
20145                 case "$CPPFLAGS" in
20146                 (*$cf_add_cflags)
20147                         ;;
20148                 (*)
20149                         case $cf_add_cflags in
20150                         (-D*)
20151                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20152
20153 CPPFLAGS=`echo "$CPPFLAGS" | \
20154         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20155                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20156
20157                                 ;;
20158                         esac
20159
20160         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20161         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20162
20163                         ;;
20164                 esac
20165                 ;;
20166         (*)
20167
20168         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20169         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20170
20171                 ;;
20172         esac
20173         ;;
20174 (yes)
20175
20176         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20177         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20178
20179         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20180
20181         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20182                 && test -z "${cf_tst_cflags}" \
20183                 && cf_fix_cppflags=no
20184         ;;
20185 esac
20186 done
20187
20188 if test -n "$cf_new_cflags" ; then
20189
20190         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20191         CFLAGS="${CFLAGS}$cf_new_cflags"
20192
20193 fi
20194
20195 if test -n "$cf_new_cppflags" ; then
20196
20197         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20198         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20199
20200 fi
20201
20202 if test -n "$cf_new_extra_cppflags" ; then
20203
20204         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20205         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20206
20207 fi
20208
20209                 ;;
20210         esac
20211         ;;
20212 esac
20213
20214 echo "$as_me:20214: checking if you want to perform memory-leak testing" >&5
20215 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
20216
20217 # Check whether --enable-leaks or --disable-leaks was given.
20218 if test "${enable_leaks+set}" = set; then
20219   enableval="$enable_leaks"
20220   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
20221 else
20222   : ${with_no_leaks:=no}
20223 fi;
20224 echo "$as_me:20224: result: $with_no_leaks" >&5
20225 echo "${ECHO_T}$with_no_leaks" >&6
20226
20227 if test "$with_no_leaks" = yes ; then
20228
20229 cat >>confdefs.h <<\EOF
20230 #define NO_LEAKS 1
20231 EOF
20232
20233 cat >>confdefs.h <<\EOF
20234 #define YY_NO_LEAKS 1
20235 EOF
20236
20237 fi
20238
20239 LD_RPATH_OPT=
20240 if test "x$cf_cv_enable_rpath" != xno
20241 then
20242         echo "$as_me:20242: checking for an rpath option" >&5
20243 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
20244         case $cf_cv_system_name in
20245         (irix*)
20246                 if test "$GCC" = yes; then
20247                         LD_RPATH_OPT="-Wl,-rpath,"
20248                 else
20249                         LD_RPATH_OPT="-rpath "
20250                 fi
20251                 ;;
20252         (linux*|gnu*|k*bsd*-gnu|freebsd*)
20253                 LD_RPATH_OPT="-Wl,-rpath,"
20254                 ;;
20255         (openbsd[2-9].*|mirbsd*)
20256                 LD_RPATH_OPT="-Wl,-rpath,"
20257                 ;;
20258         (dragonfly*)
20259                 LD_RPATH_OPT="-rpath "
20260                 ;;
20261         (netbsd*)
20262                 LD_RPATH_OPT="-Wl,-rpath,"
20263                 ;;
20264         (osf*|mls+*)
20265                 LD_RPATH_OPT="-rpath "
20266                 ;;
20267         (solaris2*)
20268                 LD_RPATH_OPT="-R"
20269                 ;;
20270         (*)
20271                 ;;
20272         esac
20273         echo "$as_me:20273: result: $LD_RPATH_OPT" >&5
20274 echo "${ECHO_T}$LD_RPATH_OPT" >&6
20275
20276         case "x$LD_RPATH_OPT" in
20277         (x-R*)
20278                 echo "$as_me:20278: checking if we need a space after rpath option" >&5
20279 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
20280                 cf_save_LIBS="$LIBS"
20281
20282 cf_add_libs="${LD_RPATH_OPT}$libdir"
20283 # Filter out duplicates - this happens with badly-designed ".pc" files...
20284 for cf_add_1lib in $LIBS
20285 do
20286         for cf_add_2lib in $cf_add_libs
20287         do
20288                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
20289                 then
20290                         cf_add_1lib=
20291                         break
20292                 fi
20293         done
20294         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
20295 done
20296 LIBS="$cf_add_libs"
20297
20298                 cat >conftest.$ac_ext <<_ACEOF
20299 #line 20299 "configure"
20300 #include "confdefs.h"
20301
20302 int
20303 main (void)
20304 {
20305
20306   ;
20307   return 0;
20308 }
20309 _ACEOF
20310 rm -f conftest.$ac_objext conftest$ac_exeext
20311 if { (eval echo "$as_me:20311: \"$ac_link\"") >&5
20312   (eval $ac_link) 2>&5
20313   ac_status=$?
20314   echo "$as_me:20314: \$? = $ac_status" >&5
20315   (exit $ac_status); } &&
20316          { ac_try='test -s conftest$ac_exeext'
20317   { (eval echo "$as_me:20317: \"$ac_try\"") >&5
20318   (eval $ac_try) 2>&5
20319   ac_status=$?
20320   echo "$as_me:20320: \$? = $ac_status" >&5
20321   (exit $ac_status); }; }; then
20322   cf_rpath_space=no
20323 else
20324   echo "$as_me: failed program was:" >&5
20325 cat conftest.$ac_ext >&5
20326 cf_rpath_space=yes
20327 fi
20328 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20329                 LIBS="$cf_save_LIBS"
20330                 echo "$as_me:20330: result: $cf_rpath_space" >&5
20331 echo "${ECHO_T}$cf_rpath_space" >&6
20332                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
20333                 ;;
20334         esac
20335 fi
20336
20337 echo "$as_me:20337: checking if rpath-hack should be disabled" >&5
20338 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
20339
20340 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
20341 if test "${enable_rpath_hack+set}" = set; then
20342   enableval="$enable_rpath_hack"
20343   test "$enableval" != no && enableval=yes
20344         if test "$enableval" != "yes" ; then
20345     cf_disable_rpath_hack=yes
20346         else
20347                 cf_disable_rpath_hack=no
20348         fi
20349 else
20350   enableval=yes
20351         cf_disable_rpath_hack=no
20352
20353 fi;
20354 echo "$as_me:20354: result: $cf_disable_rpath_hack" >&5
20355 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
20356 if test "$cf_disable_rpath_hack" = no ; then
20357
20358 echo "$as_me:20358: checking for updated LDFLAGS" >&5
20359 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
20360 if test -n "$LD_RPATH_OPT" ; then
20361         echo "$as_me:20361: result: maybe" >&5
20362 echo "${ECHO_T}maybe" >&6
20363
20364         for ac_prog in ldd
20365 do
20366   # Extract the first word of "$ac_prog", so it can be a program name with args.
20367 set dummy $ac_prog; ac_word=$2
20368 echo "$as_me:20368: checking for $ac_word" >&5
20369 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
20370 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
20371   echo $ECHO_N "(cached) $ECHO_C" >&6
20372 else
20373   if test -n "$cf_ldd_prog"; then
20374   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
20375 else
20376   ac_save_IFS=$IFS; IFS=$ac_path_separator
20377 ac_dummy="$PATH"
20378 for ac_dir in $ac_dummy; do
20379   IFS=$ac_save_IFS
20380   test -z "$ac_dir" && ac_dir=.
20381   $as_executable_p "$ac_dir/$ac_word" || continue
20382 ac_cv_prog_cf_ldd_prog="$ac_prog"
20383 echo "$as_me:20383: found $ac_dir/$ac_word" >&5
20384 break
20385 done
20386
20387 fi
20388 fi
20389 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
20390 if test -n "$cf_ldd_prog"; then
20391   echo "$as_me:20391: result: $cf_ldd_prog" >&5
20392 echo "${ECHO_T}$cf_ldd_prog" >&6
20393 else
20394   echo "$as_me:20394: result: no" >&5
20395 echo "${ECHO_T}no" >&6
20396 fi
20397
20398   test -n "$cf_ldd_prog" && break
20399 done
20400 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
20401
20402         cf_rpath_list="/usr/lib /lib"
20403         if test "$cf_ldd_prog" != no
20404         then
20405                 cf_rpath_oops=
20406
20407 cat >conftest.$ac_ext <<_ACEOF
20408 #line 20408 "configure"
20409 #include "confdefs.h"
20410 #include <stdio.h>
20411 int
20412 main (void)
20413 {
20414 printf("Hello");
20415   ;
20416   return 0;
20417 }
20418 _ACEOF
20419 rm -f conftest.$ac_objext conftest$ac_exeext
20420 if { (eval echo "$as_me:20420: \"$ac_link\"") >&5
20421   (eval $ac_link) 2>&5
20422   ac_status=$?
20423   echo "$as_me:20423: \$? = $ac_status" >&5
20424   (exit $ac_status); } &&
20425          { ac_try='test -s conftest$ac_exeext'
20426   { (eval echo "$as_me:20426: \"$ac_try\"") >&5
20427   (eval $ac_try) 2>&5
20428   ac_status=$?
20429   echo "$as_me:20429: \$? = $ac_status" >&5
20430   (exit $ac_status); }; }; then
20431   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
20432                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
20433 else
20434   echo "$as_me: failed program was:" >&5
20435 cat conftest.$ac_ext >&5
20436 fi
20437 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20438
20439                 # If we passed the link-test, but get a "not found" on a given library,
20440                 # this could be due to inept reconfiguration of gcc to make it only
20441                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
20442                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
20443                 # /usr/local libraries.
20444                 if test -n "$cf_rpath_oops"
20445                 then
20446                         for cf_rpath_src in $cf_rpath_oops
20447                         do
20448                                 for cf_rpath_dir in \
20449                                         /usr/local \
20450                                         /usr/pkg \
20451                                         /opt/sfw
20452                                 do
20453                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
20454                                         then
20455                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
20456
20457 echo "${as_me:-configure}:20457: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
20458
20459                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
20460                                                 break
20461                                         fi
20462                                 done
20463                         done
20464                 fi
20465         fi
20466
20467         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20468
20469 echo "${as_me:-configure}:20469: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20470
20471 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
20472
20473 echo "${as_me:-configure}:20473: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
20474
20475 cf_rpath_dst=
20476 for cf_rpath_src in $LDFLAGS
20477 do
20478         case $cf_rpath_src in
20479         (-L*)
20480
20481                 # check if this refers to a directory which we will ignore
20482                 cf_rpath_skip=no
20483                 if test -n "$cf_rpath_list"
20484                 then
20485                         for cf_rpath_item in $cf_rpath_list
20486                         do
20487                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20488                                 then
20489                                         cf_rpath_skip=yes
20490                                         break
20491                                 fi
20492                         done
20493                 fi
20494
20495                 if test "$cf_rpath_skip" = no
20496                 then
20497                         # transform the option
20498                         if test "$LD_RPATH_OPT" = "-R " ; then
20499                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20500                         else
20501                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20502                         fi
20503
20504                         # if we have not already added this, add it now
20505                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20506                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20507                         then
20508                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20509
20510 echo "${as_me:-configure}:20510: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20511
20512                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20513                         fi
20514                 fi
20515                 ;;
20516         esac
20517         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20518 done
20519 LDFLAGS=$cf_rpath_dst
20520
20521 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
20522
20523 echo "${as_me:-configure}:20523: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
20524
20525 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
20526
20527 echo "${as_me:-configure}:20527: testing ...checking LIBS $LIBS ..." 1>&5
20528
20529 cf_rpath_dst=
20530 for cf_rpath_src in $LIBS
20531 do
20532         case $cf_rpath_src in
20533         (-L*)
20534
20535                 # check if this refers to a directory which we will ignore
20536                 cf_rpath_skip=no
20537                 if test -n "$cf_rpath_list"
20538                 then
20539                         for cf_rpath_item in $cf_rpath_list
20540                         do
20541                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20542                                 then
20543                                         cf_rpath_skip=yes
20544                                         break
20545                                 fi
20546                         done
20547                 fi
20548
20549                 if test "$cf_rpath_skip" = no
20550                 then
20551                         # transform the option
20552                         if test "$LD_RPATH_OPT" = "-R " ; then
20553                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20554                         else
20555                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20556                         fi
20557
20558                         # if we have not already added this, add it now
20559                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20560                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20561                         then
20562                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20563
20564 echo "${as_me:-configure}:20564: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20565
20566                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20567                         fi
20568                 fi
20569                 ;;
20570         esac
20571         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20572 done
20573 LIBS=$cf_rpath_dst
20574
20575 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
20576
20577 echo "${as_me:-configure}:20577: testing ...checked LIBS $LIBS ..." 1>&5
20578
20579         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20580
20581 echo "${as_me:-configure}:20581: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20582
20583 else
20584         echo "$as_me:20584: result: no" >&5
20585 echo "${ECHO_T}no" >&6
20586 fi
20587
20588 fi
20589
20590 TEST_ARGS="$LIBS"
20591 LIBS=
20592
20593 ac_config_files="$ac_config_files Makefile"
20594 ac_config_commands="$ac_config_commands default"
20595 cat >confcache <<\_ACEOF
20596 # This file is a shell script that caches the results of configure
20597 # tests run on this system so they can be shared between configure
20598 # scripts and configure runs, see configure's option --config-cache.
20599 # It is not useful on other systems.  If it contains results you don't
20600 # want to keep, you may remove or edit it.
20601 #
20602 # config.status only pays attention to the cache file if you give it
20603 # the --recheck option to rerun configure.
20604 #
20605 # `ac_cv_env_foo' variables (set or unset) will be overriden when
20606 # loading this file, other *unset* `ac_cv_foo' will be assigned the
20607 # following values.
20608
20609 _ACEOF
20610
20611 # The following way of writing the cache mishandles newlines in values,
20612 # but we know of no workaround that is simple, portable, and efficient.
20613 # So, don't put newlines in cache variables' values.
20614 # Ultrix sh set writes to stderr and can't be redirected directly,
20615 # and sets the high bit in the cache file unless we assign to the vars.
20616 {
20617   (set) 2>&1 |
20618     case `(ac_space=' '; set | grep ac_space) 2>&1` in
20619     *ac_space=\ *)
20620       # `set' does not quote correctly, so add quotes (double-quote
20621       # substitution turns \\\\ into \\, and sed turns \\ into \).
20622       sed -n \
20623         "s/'/'\\\\''/g;
20624           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
20625       ;;
20626     *)
20627       # `set' quotes correctly as required by POSIX, so do not add quotes.
20628       sed -n \
20629         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
20630       ;;
20631     esac;
20632 } |
20633   sed '
20634      t clear
20635      : clear
20636      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
20637      t end
20638      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
20639      : end' >>confcache
20640 if cmp -s $cache_file confcache; then :; else
20641   if test -w $cache_file; then
20642     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
20643     cat confcache >$cache_file
20644   else
20645     echo "not updating unwritable cache $cache_file"
20646   fi
20647 fi
20648 rm -f confcache
20649
20650 test "x$prefix" = xNONE && prefix=$ac_default_prefix
20651 # Let make expand exec_prefix.
20652 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
20653
20654 # VPATH may cause trouble with some makes, so we remove $(srcdir),
20655 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
20656 # trailing colons and then remove the whole line if VPATH becomes empty
20657 # (actually we leave an empty line to preserve line numbers).
20658 if test "x$srcdir" = x.; then
20659   ac_vpsub='/^[         ]*VPATH[        ]*=/{
20660 s/:*\$(srcdir):*/:/;
20661 s/:*\${srcdir}:*/:/;
20662 s/:*@srcdir@:*/:/;
20663 s/^\([^=]*=[    ]*\):*/\1/;
20664 s/:*$//;
20665 s/^[^=]*=[      ]*$//;
20666 }'
20667 fi
20668
20669 DEFS=-DHAVE_CONFIG_H
20670
20671 : ${CONFIG_STATUS=./config.status}
20672 ac_clean_files_save=$ac_clean_files
20673 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
20674 { echo "$as_me:20674: creating $CONFIG_STATUS" >&5
20675 echo "$as_me: creating $CONFIG_STATUS" >&6;}
20676 cat >$CONFIG_STATUS <<_ACEOF
20677 #! $SHELL
20678 # Generated automatically by configure.
20679 # Run this file to recreate the current configuration.
20680 # Compiler output produced by configure, useful for debugging
20681 # configure, is in config.log if it exists.
20682
20683 debug=false
20684 SHELL=\${CONFIG_SHELL-$SHELL}
20685 ac_cs_invocation="\$0 \$@"
20686
20687 _ACEOF
20688
20689 cat >>$CONFIG_STATUS <<\_ACEOF
20690 # Be Bourne compatible
20691 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
20692   emulate sh
20693   NULLCMD=:
20694 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
20695   set -o posix
20696 fi
20697
20698 # Name of the executable.
20699 as_me=`echo "$0" |sed 's,.*[\\/],,'`
20700
20701 if expr a : '\(a\)' >/dev/null 2>&1; then
20702   as_expr=expr
20703 else
20704   as_expr=false
20705 fi
20706
20707 rm -f conf$$ conf$$.exe conf$$.file
20708 echo >conf$$.file
20709 if ln -s conf$$.file conf$$ 2>/dev/null; then
20710   # We could just check for DJGPP; but this test a) works b) is more generic
20711   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
20712   if test -f conf$$.exe; then
20713     # Don't use ln at all; we don't have any links
20714     as_ln_s='cp -p'
20715   else
20716     as_ln_s='ln -s'
20717   fi
20718 elif ln conf$$.file conf$$ 2>/dev/null; then
20719   as_ln_s=ln
20720 else
20721   as_ln_s='cp -p'
20722 fi
20723 rm -f conf$$ conf$$.exe conf$$.file
20724
20725 as_executable_p="test -f"
20726
20727 # Support unset when possible.
20728 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
20729   as_unset=unset
20730 else
20731   as_unset=false
20732 fi
20733
20734 # NLS nuisances.
20735 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
20736 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
20737 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
20738 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
20739 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
20740 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
20741 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
20742 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
20743
20744 # IFS
20745 # We need space, tab and new line, in precisely that order.
20746 as_nl='
20747 '
20748 IFS="   $as_nl"
20749
20750 # CDPATH.
20751 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
20752
20753 exec 6>&1
20754
20755 _ACEOF
20756
20757 # Files that config.status was made for.
20758 if test -n "$ac_config_files"; then
20759   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
20760 fi
20761
20762 if test -n "$ac_config_headers"; then
20763   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
20764 fi
20765
20766 if test -n "$ac_config_links"; then
20767   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
20768 fi
20769
20770 if test -n "$ac_config_commands"; then
20771   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
20772 fi
20773
20774 cat >>$CONFIG_STATUS <<\EOF
20775
20776 ac_cs_usage="\
20777 \`$as_me' instantiates files from templates according to the
20778 current configuration.
20779
20780 Usage: $0 [OPTIONS] [FILE]...
20781
20782   -h, --help       print this help, then exit
20783   -V, --version    print version number, then exit
20784   -d, --debug      don't remove temporary files
20785       --recheck    update $as_me by reconfiguring in the same conditions
20786   --file=FILE[:TEMPLATE]
20787                    instantiate the configuration file FILE
20788   --header=FILE[:TEMPLATE]
20789                    instantiate the configuration header FILE
20790
20791 Configuration files:
20792 $config_files
20793
20794 Configuration headers:
20795 $config_headers
20796
20797 Configuration commands:
20798 $config_commands
20799
20800 Report bugs to <dickey@invisible-island.net>."
20801 EOF
20802
20803 cat >>$CONFIG_STATUS <<EOF
20804 ac_cs_version="\\
20805 config.status
20806 configured by $0, generated by GNU Autoconf 2.52.20181006,
20807   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
20808
20809 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
20810 Free Software Foundation, Inc.
20811 This config.status script is free software; the Free Software Foundation
20812 gives unlimited permission to copy, distribute and modify it."
20813 srcdir=$srcdir
20814 INSTALL="$INSTALL"
20815 EOF
20816
20817 cat >>$CONFIG_STATUS <<\EOF
20818 # If no file are specified by the user, then we need to provide default
20819 # value.  By we need to know if files were specified by the user.
20820 ac_need_defaults=:
20821 while test $# != 0
20822 do
20823   case $1 in
20824   --*=*)
20825     ac_option=`expr "x$1" : 'x\([^=]*\)='`
20826     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
20827     shift
20828     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
20829     shift
20830     ;;
20831   -*);;
20832   *) # This is not an option, so the user has probably given explicit
20833      # arguments.
20834      ac_need_defaults=false;;
20835   esac
20836
20837   case $1 in
20838   # Handling of the options.
20839 EOF
20840 cat >>$CONFIG_STATUS <<EOF
20841   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
20842     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
20843     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
20844 EOF
20845 cat >>$CONFIG_STATUS <<\EOF
20846   --version | --vers* | -V )
20847     echo "$ac_cs_version"; exit 0 ;;
20848   --he | --h)
20849     # Conflict between --help and --header
20850     { { echo "$as_me:20850: error: ambiguous option: $1
20851 Try \`$0 --help' for more information." >&5
20852 echo "$as_me: error: ambiguous option: $1
20853 Try \`$0 --help' for more information." >&2;}
20854    { (exit 1); exit 1; }; };;
20855   --help | --hel | -h )
20856     echo "$ac_cs_usage"; exit 0 ;;
20857   --debug | --d* | -d )
20858     debug=: ;;
20859   --file | --fil | --fi | --f )
20860     shift
20861     CONFIG_FILES="$CONFIG_FILES $1"
20862     ac_need_defaults=false;;
20863   --header | --heade | --head | --hea )
20864     shift
20865     CONFIG_HEADERS="$CONFIG_HEADERS $1"
20866     ac_need_defaults=false;;
20867
20868   # This is an error.
20869   -*) { { echo "$as_me:20869: error: unrecognized option: $1
20870 Try \`$0 --help' for more information." >&5
20871 echo "$as_me: error: unrecognized option: $1
20872 Try \`$0 --help' for more information." >&2;}
20873    { (exit 1); exit 1; }; } ;;
20874
20875   *) ac_config_targets="$ac_config_targets $1" ;;
20876
20877   esac
20878   shift
20879 done
20880
20881 exec 5>>config.log
20882 cat >&5 << _ACEOF
20883
20884 ## ----------------------- ##
20885 ## Running config.status.  ##
20886 ## ----------------------- ##
20887
20888 This file was extended by $as_me 2.52.20181006, executed with
20889   CONFIG_FILES    = $CONFIG_FILES
20890   CONFIG_HEADERS  = $CONFIG_HEADERS
20891   CONFIG_LINKS    = $CONFIG_LINKS
20892   CONFIG_COMMANDS = $CONFIG_COMMANDS
20893   > $ac_cs_invocation
20894 on `(hostname || uname -n) 2>/dev/null | sed 1q`
20895
20896 _ACEOF
20897 EOF
20898
20899 cat >>$CONFIG_STATUS <<EOF
20900 #
20901 # INIT-COMMANDS section.
20902 #
20903
20904 AWK="$AWK"
20905 ECHO_CC="$ECHO_CC"
20906 ECHO_LD="$ECHO_LD"
20907 SHOW_CC="$SHOW_LD"
20908
20909 EOF
20910
20911 cat >>$CONFIG_STATUS <<\EOF
20912 for ac_config_target in $ac_config_targets
20913 do
20914   case "$ac_config_target" in
20915   # Handling of arguments.
20916   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
20917   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
20918   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
20919   *) { { echo "$as_me:20919: error: invalid argument: $ac_config_target" >&5
20920 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
20921    { (exit 1); exit 1; }; };;
20922   esac
20923 done
20924
20925 # If the user did not use the arguments to specify the items to instantiate,
20926 # then the envvar interface is used.  Set only those that are not.
20927 # We use the long form for the default assignment because of an extremely
20928 # bizarre bug on SunOS 4.1.3.
20929 if $ac_need_defaults; then
20930   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
20931   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
20932   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
20933 fi
20934
20935 # Create a temporary directory, and hook for its removal unless debugging.
20936 $debug ||
20937 {
20938   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
20939   trap '{ (exit 1); exit 1; }' 1 2 13 15
20940 }
20941
20942 # Create a (secure) tmp directory for tmp files.
20943 : ${TMPDIR=/tmp}
20944 {
20945   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
20946   test -n "$tmp" && test -d "$tmp"
20947 }  ||
20948 {
20949   tmp=$TMPDIR/cs$$-$RANDOM
20950   (umask 077 && mkdir $tmp)
20951 } ||
20952 {
20953    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
20954    { (exit 1); exit 1; }
20955 }
20956
20957 EOF
20958
20959 cat >>$CONFIG_STATUS <<EOF
20960
20961 #
20962 # CONFIG_FILES section.
20963 #
20964
20965 # No need to generate the scripts if there are no CONFIG_FILES.
20966 # This happens for instance when ./config.status config.h
20967 if test -n "\$CONFIG_FILES"; then
20968   # Protect against being on the right side of a sed subst in config.status.
20969   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
20970    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
20971 s,@SHELL@,$SHELL,;t t
20972 s,@exec_prefix@,$exec_prefix,;t t
20973 s,@prefix@,$prefix,;t t
20974 s,@program_transform_name@,$program_transform_name,;t t
20975 s,@bindir@,$bindir,;t t
20976 s,@sbindir@,$sbindir,;t t
20977 s,@libexecdir@,$libexecdir,;t t
20978 s,@datarootdir@,$datarootdir,;t t
20979 s,@datadir@,$datadir,;t t
20980 s,@sysconfdir@,$sysconfdir,;t t
20981 s,@sharedstatedir@,$sharedstatedir,;t t
20982 s,@localstatedir@,$localstatedir,;t t
20983 s,@runstatedir@,$runstatedir,;t t
20984 s,@libdir@,$libdir,;t t
20985 s,@includedir@,$includedir,;t t
20986 s,@oldincludedir@,$oldincludedir,;t t
20987 s,@infodir@,$infodir,;t t
20988 s,@mandir@,$mandir,;t t
20989 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
20990 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
20991 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
20992 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
20993 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
20994 s,@build_alias@,$build_alias,;t t
20995 s,@host_alias@,$host_alias,;t t
20996 s,@target_alias@,$target_alias,;t t
20997 s,@ECHO_C@,$ECHO_C,;t t
20998 s,@ECHO_N@,$ECHO_N,;t t
20999 s,@ECHO_T@,$ECHO_T,;t t
21000 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
21001 s,@DEFS@,$DEFS,;t t
21002 s,@LIBS@,$LIBS,;t t
21003 s,@build@,$build,;t t
21004 s,@build_cpu@,$build_cpu,;t t
21005 s,@build_vendor@,$build_vendor,;t t
21006 s,@build_os@,$build_os,;t t
21007 s,@host@,$host,;t t
21008 s,@host_cpu@,$host_cpu,;t t
21009 s,@host_vendor@,$host_vendor,;t t
21010 s,@host_os@,$host_os,;t t
21011 s,@SET_MAKE@,$SET_MAKE,;t t
21012 s,@CC@,$CC,;t t
21013 s,@CFLAGS@,$CFLAGS,;t t
21014 s,@LDFLAGS@,$LDFLAGS,;t t
21015 s,@CPPFLAGS@,$CPPFLAGS,;t t
21016 s,@ac_ct_CC@,$ac_ct_CC,;t t
21017 s,@EXEEXT@,$EXEEXT,;t t
21018 s,@OBJEXT@,$OBJEXT,;t t
21019 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
21020 s,@CPP@,$CPP,;t t
21021 s,@AWK@,$AWK,;t t
21022 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
21023 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
21024 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
21025 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
21026 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
21027 s,@LINT@,$LINT,;t t
21028 s,@LINT_OPTS@,$LINT_OPTS,;t t
21029 s,@CTAGS@,$CTAGS,;t t
21030 s,@ETAGS@,$ETAGS,;t t
21031 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
21032 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
21033 s,@MATH_LIB@,$MATH_LIB,;t t
21034 s,@top_builddir@,$top_builddir,;t t
21035 s,@CC_G_OPT@,$CC_G_OPT,;t t
21036 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
21037 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
21038 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
21039 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
21040 s,@LD@,$LD,;t t
21041 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
21042 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
21043 s,@LD_MODEL@,$LD_MODEL,;t t
21044 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
21045 s,@LIBTOOL@,$LIBTOOL,;t t
21046 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
21047 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
21048 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
21049 s,@LIB_LINK@,$LIB_LINK,;t t
21050 s,@LINK_TESTS@,$LINK_TESTS,;t t
21051 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
21052 s,@PACKAGE@,$PACKAGE,;t t
21053 s,@PTHREAD@,$PTHREAD,;t t
21054 s,@TEST_ARGS@,$TEST_ARGS,;t t
21055 s,@TEST_DEPS@,$TEST_DEPS,;t t
21056 s,@TEST_LIBS@,$TEST_LIBS,;t t
21057 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
21058 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
21059 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
21060 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
21061 s,@includesubdir@,$includesubdir,;t t
21062 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
21063 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
21064 s,@ECHO_LT@,$ECHO_LT,;t t
21065 s,@ECHO_LD@,$ECHO_LD,;t t
21066 s,@RULE_CC@,$RULE_CC,;t t
21067 s,@SHOW_CC@,$SHOW_CC,;t t
21068 s,@ECHO_CC@,$ECHO_CC,;t t
21069 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
21070 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
21071 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
21072 s,@X_CFLAGS@,$X_CFLAGS,;t t
21073 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
21074 s,@X_LIBS@,$X_LIBS,;t t
21075 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
21076 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
21077 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
21078 s,@RGB_PATH@,$RGB_PATH,;t t
21079 s,@no_x11_rgb@,$no_x11_rgb,;t t
21080 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
21081 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
21082 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
21083 CEOF
21084
21085 EOF
21086
21087   cat >>$CONFIG_STATUS <<\EOF
21088   # Split the substitutions into bite-sized pieces for seds with
21089   # small command number limits, like on Digital OSF/1 and HP-UX.
21090   ac_max_sed_lines=48
21091   ac_sed_frag=1 # Number of current file.
21092   ac_beg=1 # First line for current file.
21093   ac_end=$ac_max_sed_lines # Line after last line for current file.
21094   ac_more_lines=:
21095   ac_sed_cmds=
21096   while $ac_more_lines; do
21097     if test $ac_beg -gt 1; then
21098       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21099     else
21100       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21101     fi
21102     if test ! -s $tmp/subs.frag; then
21103       ac_more_lines=false
21104     else
21105       # The purpose of the label and of the branching condition is to
21106       # speed up the sed processing (if there are no `@' at all, there
21107       # is no need to browse any of the substitutions).
21108       # These are the two extra sed commands mentioned above.
21109       (echo ':t
21110   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
21111       # It is possible to make a multiline substitution using escaped newlines.
21112       # Ensure that we do not split the substitution between script fragments.
21113       ac_BEG=$ac_end
21114       ac_END=`expr $ac_end + $ac_max_sed_lines`
21115       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
21116       if test -s $tmp/subs.next; then
21117         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
21118         if test ! -s $tmp/subs.edit; then
21119           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
21120           if test ! -s $tmp/subs.edit; then
21121             if test $ac_beg -gt 1; then
21122               ac_end=`expr $ac_end - 1`
21123               continue
21124             fi
21125           fi
21126         fi
21127       fi
21128
21129       if test -z "$ac_sed_cmds"; then
21130         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
21131       else
21132         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
21133       fi
21134       ac_sed_frag=`expr $ac_sed_frag + 1`
21135       ac_beg=$ac_end
21136       ac_end=`expr $ac_end + $ac_max_sed_lines`
21137     fi
21138   done
21139   if test -z "$ac_sed_cmds"; then
21140     ac_sed_cmds=cat
21141   fi
21142 fi # test -n "$CONFIG_FILES"
21143
21144 EOF
21145 cat >>$CONFIG_STATUS <<\EOF
21146 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
21147   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21148   case $ac_file in
21149   - | *:- | *:-:* ) # input from stdin
21150         cat >$tmp/stdin
21151         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21152         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21153   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21154         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21155   * )   ac_file_in=$ac_file.in ;;
21156   esac
21157
21158   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
21159   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21160          X"$ac_file" : 'X\(//\)[^/]' \| \
21161          X"$ac_file" : 'X\(//\)$' \| \
21162          X"$ac_file" : 'X\(/\)' \| \
21163          .     : '\(.\)' 2>/dev/null ||
21164 echo X"$ac_file" |
21165     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21166           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21167           /^X\(\/\/\)$/{ s//\1/; q; }
21168           /^X\(\/\).*/{ s//\1/; q; }
21169           s/.*/./; q'`
21170   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21171     { case "$ac_dir" in
21172   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21173   *)                      as_incr_dir=.;;
21174 esac
21175 as_dummy="$ac_dir"
21176 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21177   case $as_mkdir_dir in
21178     # Skip DOS drivespec
21179     ?:) as_incr_dir=$as_mkdir_dir ;;
21180     *)
21181       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21182       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21183     ;;
21184   esac
21185 done; }
21186
21187     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21188     # A "../" for each directory in $ac_dir_suffix.
21189     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21190   else
21191     ac_dir_suffix= ac_dots=
21192   fi
21193
21194   case $srcdir in
21195   .)  ac_srcdir=.
21196       if test -z "$ac_dots"; then
21197          ac_top_srcdir=.
21198       else
21199          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21200       fi ;;
21201   [\\/]* | ?:[\\/]* )
21202       ac_srcdir=$srcdir$ac_dir_suffix;
21203       ac_top_srcdir=$srcdir ;;
21204   *) # Relative path.
21205     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
21206     ac_top_srcdir=$ac_dots$srcdir ;;
21207   esac
21208
21209   case $INSTALL in
21210   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21211   *) ac_INSTALL=$ac_dots$INSTALL ;;
21212   esac
21213
21214   if test x"$ac_file" != x-; then
21215     { echo "$as_me:21215: creating $ac_file" >&5
21216 echo "$as_me: creating $ac_file" >&6;}
21217     rm -f "$ac_file"
21218   fi
21219   # Let's still pretend it is `configure' which instantiates (i.e., don't
21220   # use $as_me), people would be surprised to read:
21221   #    /* config.h.  Generated automatically by config.status.  */
21222   configure_input="Generated automatically from `echo $ac_file_in |
21223                                                  sed 's,.*/,,'` by configure."
21224
21225   # First look for the input files in the build tree, otherwise in the
21226   # src tree.
21227   ac_file_inputs=`IFS=:
21228     for f in $ac_file_in; do
21229       case $f in
21230       -) echo $tmp/stdin ;;
21231       [\\/$]*)
21232          # Absolute (can't be DOS-style, as IFS=:)
21233          test -f "$f" || { { echo "$as_me:21233: error: cannot find input file: $f" >&5
21234 echo "$as_me: error: cannot find input file: $f" >&2;}
21235    { (exit 1); exit 1; }; }
21236          echo $f;;
21237       *) # Relative
21238          if test -f "$f"; then
21239            # Build tree
21240            echo $f
21241          elif test -f "$srcdir/$f"; then
21242            # Source tree
21243            echo $srcdir/$f
21244          else
21245            # /dev/null tree
21246            { { echo "$as_me:21246: error: cannot find input file: $f" >&5
21247 echo "$as_me: error: cannot find input file: $f" >&2;}
21248    { (exit 1); exit 1; }; }
21249          fi;;
21250       esac
21251     done` || { (exit 1); exit 1; }
21252 EOF
21253 cat >>$CONFIG_STATUS <<\EOF
21254   ac_warn_datarootdir=no
21255   if test x"$ac_file" != x-; then
21256     for ac_item in $ac_file_inputs
21257     do
21258       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
21259       if test -n "$ac_seen"; then
21260         ac_used=`grep '@datarootdir@' $ac_item`
21261         if test -z "$ac_used"; then
21262           { echo "$as_me:21262: WARNING: datarootdir was used implicitly but not set:
21263 $ac_seen" >&5
21264 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
21265 $ac_seen" >&2;}
21266           ac_warn_datarootdir=yes
21267         fi
21268       fi
21269       ac_seen=`grep '${datarootdir}' $ac_item`
21270       if test -n "$ac_seen"; then
21271         { echo "$as_me:21271: WARNING: datarootdir was used explicitly but not set:
21272 $ac_seen" >&5
21273 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
21274 $ac_seen" >&2;}
21275         ac_warn_datarootdir=yes
21276       fi
21277     done
21278   fi
21279
21280 if test "x$ac_warn_datarootdir" = xyes; then
21281   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
21282 fi
21283
21284 EOF
21285 cat >>$CONFIG_STATUS <<EOF
21286   sed "$ac_vpsub
21287 $extrasub
21288 EOF
21289 cat >>$CONFIG_STATUS <<\EOF
21290 :t
21291 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
21292 s,@configure_input@,$configure_input,;t t
21293 s,@srcdir@,$ac_srcdir,;t t
21294 s,@top_srcdir@,$ac_top_srcdir,;t t
21295 s,@INSTALL@,$ac_INSTALL,;t t
21296 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
21297   rm -f $tmp/stdin
21298   if test x"$ac_file" != x-; then
21299     cp $tmp/out $ac_file
21300
21301     for ac_name in prefix exec_prefix datarootdir
21302     do
21303         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
21304         if test -n "$ac_seen"; then
21305             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
21306             if test -z "$ac_init"; then
21307               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
21308               { echo "$as_me:21308: WARNING: Variable $ac_name is used but was not set:
21309 $ac_seen" >&5
21310 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
21311 $ac_seen" >&2;}
21312             fi
21313         fi
21314     done
21315     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
21316     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
21317     if test -s $tmp/out; then
21318       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
21319       { echo "$as_me:21319: WARNING: Some variables may not be substituted:
21320 $ac_seen" >&5
21321 echo "$as_me: WARNING: Some variables may not be substituted:
21322 $ac_seen" >&2;}
21323     fi
21324   else
21325     cat $tmp/out
21326   fi
21327   rm -f $tmp/out
21328
21329 done
21330 EOF
21331 cat >>$CONFIG_STATUS <<\EOF
21332
21333 #
21334 # CONFIG_HEADER section.
21335 #
21336
21337 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
21338 # NAME is the cpp macro being defined and VALUE is the value it is being given.
21339 #
21340 # ac_d sets the value in "#define NAME VALUE" lines.
21341 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
21342 ac_dB='[        ].*$,\1#\2'
21343 ac_dC=' '
21344 ac_dD=',;t'
21345 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
21346 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21347 ac_iB='\([      ]\),\1#\2define\3'
21348 ac_iC=' '
21349 ac_iD='\4,;t'
21350 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
21351 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21352 ac_uB='$,\1#\2define\3'
21353 ac_uC=' '
21354 ac_uD=',;t'
21355
21356 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
21357   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21358   case $ac_file in
21359   - | *:- | *:-:* ) # input from stdin
21360         cat >$tmp/stdin
21361         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21362         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21363   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21364         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21365   * )   ac_file_in=$ac_file.in ;;
21366   esac
21367
21368   test x"$ac_file" != x- && { echo "$as_me:21368: creating $ac_file" >&5
21369 echo "$as_me: creating $ac_file" >&6;}
21370
21371   # First look for the input files in the build tree, otherwise in the
21372   # src tree.
21373   ac_file_inputs=`IFS=:
21374     for f in $ac_file_in; do
21375       case $f in
21376       -) echo $tmp/stdin ;;
21377       [\\/$]*)
21378          # Absolute (can't be DOS-style, as IFS=:)
21379          test -f "$f" || { { echo "$as_me:21379: error: cannot find input file: $f" >&5
21380 echo "$as_me: error: cannot find input file: $f" >&2;}
21381    { (exit 1); exit 1; }; }
21382          echo $f;;
21383       *) # Relative
21384          if test -f "$f"; then
21385            # Build tree
21386            echo $f
21387          elif test -f "$srcdir/$f"; then
21388            # Source tree
21389            echo $srcdir/$f
21390          else
21391            # /dev/null tree
21392            { { echo "$as_me:21392: error: cannot find input file: $f" >&5
21393 echo "$as_me: error: cannot find input file: $f" >&2;}
21394    { (exit 1); exit 1; }; }
21395          fi;;
21396       esac
21397     done` || { (exit 1); exit 1; }
21398   # Remove the trailing spaces.
21399   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
21400
21401 EOF
21402
21403 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
21404 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
21405 # be either 'cat' or 'sort'.
21406 cat confdefs.h | uniq >conftest.vals
21407
21408 # Break up conftest.vals because some shells have a limit on
21409 # the size of here documents, and old seds have small limits too.
21410
21411 rm -f conftest.tail
21412 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
21413 while grep . conftest.vals >/dev/null
21414 do
21415   # Write chunks of a limited-size here document to conftest.frag.
21416   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
21417   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
21418   echo 'CEOF' >> $CONFIG_STATUS
21419   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
21420   rm -f conftest.vals
21421   mv conftest.tail conftest.vals
21422 done
21423 rm -f conftest.vals
21424
21425 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
21426 # marker @DEFS@.
21427 echo '  cat >> conftest.edit <<CEOF
21428 /@DEFS@/r conftest.frag
21429 /@DEFS@/d
21430 CEOF
21431 sed -f conftest.edit $tmp/in > $tmp/out
21432 rm -f $tmp/in
21433 mv $tmp/out $tmp/in
21434 rm -f conftest.edit conftest.frag
21435 ' >> $CONFIG_STATUS
21436
21437 cat >>$CONFIG_STATUS <<\EOF
21438   # Let's still pretend it is `configure' which instantiates (i.e., don't
21439   # use $as_me), people would be surprised to read:
21440   #    /* config.h.  Generated automatically by config.status.  */
21441   if test x"$ac_file" = x-; then
21442     echo "/* Generated automatically by configure.  */" >$tmp/config.h
21443   else
21444     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
21445   fi
21446   cat $tmp/in >>$tmp/config.h
21447   rm -f $tmp/in
21448   if test x"$ac_file" != x-; then
21449     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
21450       { echo "$as_me:21450: $ac_file is unchanged" >&5
21451 echo "$as_me: $ac_file is unchanged" >&6;}
21452     else
21453       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21454          X"$ac_file" : 'X\(//\)[^/]' \| \
21455          X"$ac_file" : 'X\(//\)$' \| \
21456          X"$ac_file" : 'X\(/\)' \| \
21457          .     : '\(.\)' 2>/dev/null ||
21458 echo X"$ac_file" |
21459     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21460           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21461           /^X\(\/\/\)$/{ s//\1/; q; }
21462           /^X\(\/\).*/{ s//\1/; q; }
21463           s/.*/./; q'`
21464       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21465         { case "$ac_dir" in
21466   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21467   *)                      as_incr_dir=.;;
21468 esac
21469 as_dummy="$ac_dir"
21470 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21471   case $as_mkdir_dir in
21472     # Skip DOS drivespec
21473     ?:) as_incr_dir=$as_mkdir_dir ;;
21474     *)
21475       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21476       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21477     ;;
21478   esac
21479 done; }
21480
21481       fi
21482       rm -f $ac_file
21483       mv $tmp/config.h $ac_file
21484     fi
21485   else
21486     cat $tmp/config.h
21487     rm -f $tmp/config.h
21488   fi
21489 done
21490 EOF
21491 cat >>$CONFIG_STATUS <<\EOF
21492 #
21493 # CONFIG_COMMANDS section.
21494 #
21495 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
21496   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
21497   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
21498
21499   case $ac_dest in
21500     default )
21501
21502 for cf_dir in .
21503 do
21504         if test ! -d $srcdir/$cf_dir; then
21505                 continue
21506         elif test -f $srcdir/$cf_dir/programs; then
21507                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
21508         fi
21509 done
21510
21511         cat >>Makefile <<TEST_EOF
21512
21513 # These rules are generated so we do not rely on suffix rules, which do not
21514 # work consistently for different make-programs (the '\$(MODEL)/' confuses
21515 # some, and the '\$x' confuses others).
21516 TEST_EOF
21517
21518 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
21519 for N in $LIST
21520 do
21521         cat >>Makefile <<TEST_EOF
21522
21523 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
21524         \$(srcdir)/test.priv.h \\
21525         ncurses_cfg.h
21526         $SHOW_CC
21527         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
21528 TEST_EOF
21529 done
21530
21531 if test -f ../config.guess && test -f ../config.sub
21532 then
21533         cat >>Makefile <<TEST_EOF
21534
21535 # if we used CF_INHERIT for getting these files, we can remove them
21536 distclean::
21537         rm -f config.guess config.sub
21538 TEST_EOF
21539 fi
21540  ;;
21541   esac
21542 done
21543 EOF
21544
21545 cat >>$CONFIG_STATUS <<\EOF
21546
21547 { (exit 0); exit 0; }
21548 EOF
21549 chmod +x $CONFIG_STATUS
21550 ac_clean_files=$ac_clean_files_save
21551
21552 # configure is writing to config.log, and then calls config.status.
21553 # config.status does its own redirection, appending to config.log.
21554 # Unfortunately, on DOS this fails, as config.log is still kept open
21555 # by configure, so config.status won't be able to write to it; its
21556 # output is simply discarded.  So we exec the FD to /dev/null,
21557 # effectively closing config.log, so it can be properly (re)opened and
21558 # appended to by config.status.  When coming back to configure, we
21559 # need to make the FD available again.
21560 if test "$no_create" != yes; then
21561   ac_cs_success=:
21562   exec 5>/dev/null
21563   $SHELL $CONFIG_STATUS || ac_cs_success=false
21564   exec 5>>config.log
21565   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
21566   # would make configure fail if this is the last instruction.
21567   $ac_cs_success || { (exit 1); exit 1; }
21568 fi
21569