]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
a606c5c44587d53e8f6f465098a4877693831c9c
[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 echo "$as_me:3393: checking if the POSIX test-macros are already defined" >&5
3394 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3395 if test "${cf_cv_posix_visible+set}" = set; then
3396   echo $ECHO_N "(cached) $ECHO_C" >&6
3397 else
3398
3399 cat >conftest.$ac_ext <<_ACEOF
3400 #line 3400 "configure"
3401 #include "confdefs.h"
3402 #include <stdio.h>
3403 int
3404 main (void)
3405 {
3406
3407 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3408         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3409         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3410         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3411 #error conflicting symbols found
3412 #endif
3413
3414   ;
3415   return 0;
3416 }
3417 _ACEOF
3418 rm -f conftest.$ac_objext
3419 if { (eval echo "$as_me:3419: \"$ac_compile\"") >&5
3420   (eval $ac_compile) 2>&5
3421   ac_status=$?
3422   echo "$as_me:3422: \$? = $ac_status" >&5
3423   (exit $ac_status); } &&
3424          { ac_try='test -s conftest.$ac_objext'
3425   { (eval echo "$as_me:3425: \"$ac_try\"") >&5
3426   (eval $ac_try) 2>&5
3427   ac_status=$?
3428   echo "$as_me:3428: \$? = $ac_status" >&5
3429   (exit $ac_status); }; }; then
3430   cf_cv_posix_visible=no
3431 else
3432   echo "$as_me: failed program was:" >&5
3433 cat conftest.$ac_ext >&5
3434 cf_cv_posix_visible=yes
3435 fi
3436 rm -f conftest.$ac_objext conftest.$ac_ext
3437
3438 fi
3439 echo "$as_me:3439: result: $cf_cv_posix_visible" >&5
3440 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3441
3442 if test "$cf_cv_posix_visible" = no; then
3443
3444 cf_XOPEN_SOURCE=600
3445 cf_POSIX_C_SOURCE=199506L
3446 cf_xopen_source=
3447
3448 case $host_os in
3449 (aix[4-7]*)
3450         cf_xopen_source="-D_ALL_SOURCE"
3451         ;;
3452 (msys)
3453         cf_XOPEN_SOURCE=600
3454         ;;
3455 (darwin[0-8].*)
3456         cf_xopen_source="-D_APPLE_C_SOURCE"
3457         ;;
3458 (darwin*)
3459         cf_xopen_source="-D_DARWIN_C_SOURCE"
3460         cf_XOPEN_SOURCE=
3461         ;;
3462 (freebsd*|dragonfly*|midnightbsd*)
3463         # 5.x headers associate
3464         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3465         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3466         cf_POSIX_C_SOURCE=200112L
3467         cf_XOPEN_SOURCE=600
3468         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3469         ;;
3470 (hpux11*)
3471         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3472         ;;
3473 (hpux*)
3474         cf_xopen_source="-D_HPUX_SOURCE"
3475         ;;
3476 (irix[56].*)
3477         cf_xopen_source="-D_SGI_SOURCE"
3478         cf_XOPEN_SOURCE=
3479         ;;
3480 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3481
3482 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3483
3484 echo "$as_me:3484: checking if this is the GNU C library" >&5
3485 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3486 if test "${cf_cv_gnu_library+set}" = set; then
3487   echo $ECHO_N "(cached) $ECHO_C" >&6
3488 else
3489
3490 cat >conftest.$ac_ext <<_ACEOF
3491 #line 3491 "configure"
3492 #include "confdefs.h"
3493 #include <sys/types.h>
3494 int
3495 main (void)
3496 {
3497
3498         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3499                 return 0;
3500         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3501                 return 0;
3502         #else
3503         #       error not GNU C library
3504         #endif
3505   ;
3506   return 0;
3507 }
3508 _ACEOF
3509 rm -f conftest.$ac_objext
3510 if { (eval echo "$as_me:3510: \"$ac_compile\"") >&5
3511   (eval $ac_compile) 2>&5
3512   ac_status=$?
3513   echo "$as_me:3513: \$? = $ac_status" >&5
3514   (exit $ac_status); } &&
3515          { ac_try='test -s conftest.$ac_objext'
3516   { (eval echo "$as_me:3516: \"$ac_try\"") >&5
3517   (eval $ac_try) 2>&5
3518   ac_status=$?
3519   echo "$as_me:3519: \$? = $ac_status" >&5
3520   (exit $ac_status); }; }; then
3521   cf_cv_gnu_library=yes
3522 else
3523   echo "$as_me: failed program was:" >&5
3524 cat conftest.$ac_ext >&5
3525 cf_cv_gnu_library=no
3526 fi
3527 rm -f conftest.$ac_objext conftest.$ac_ext
3528
3529 fi
3530 echo "$as_me:3530: result: $cf_cv_gnu_library" >&5
3531 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3532
3533 if test x$cf_cv_gnu_library = xyes; then
3534
3535         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3536         # was changed to help a little.  newlib incorporated the change about 4
3537         # years later.
3538         echo "$as_me:3538: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3539 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3540 if test "${cf_cv_gnu_library_219+set}" = set; then
3541   echo $ECHO_N "(cached) $ECHO_C" >&6
3542 else
3543
3544                 cf_save="$CPPFLAGS"
3545
3546         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3547         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3548
3549                 cat >conftest.$ac_ext <<_ACEOF
3550 #line 3550 "configure"
3551 #include "confdefs.h"
3552 #include <sys/types.h>
3553 int
3554 main (void)
3555 {
3556
3557                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3558                                 return 0;
3559                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3560                                 return 0;
3561                         #else
3562                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3563                         #endif
3564   ;
3565   return 0;
3566 }
3567 _ACEOF
3568 rm -f conftest.$ac_objext
3569 if { (eval echo "$as_me:3569: \"$ac_compile\"") >&5
3570   (eval $ac_compile) 2>&5
3571   ac_status=$?
3572   echo "$as_me:3572: \$? = $ac_status" >&5
3573   (exit $ac_status); } &&
3574          { ac_try='test -s conftest.$ac_objext'
3575   { (eval echo "$as_me:3575: \"$ac_try\"") >&5
3576   (eval $ac_try) 2>&5
3577   ac_status=$?
3578   echo "$as_me:3578: \$? = $ac_status" >&5
3579   (exit $ac_status); }; }; then
3580   cf_cv_gnu_library_219=yes
3581 else
3582   echo "$as_me: failed program was:" >&5
3583 cat conftest.$ac_ext >&5
3584 cf_cv_gnu_library_219=no
3585 fi
3586 rm -f conftest.$ac_objext conftest.$ac_ext
3587                 CPPFLAGS="$cf_save"
3588
3589 fi
3590 echo "$as_me:3590: result: $cf_cv_gnu_library_219" >&5
3591 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3592
3593         if test "x$cf_cv_gnu_library_219" = xyes; then
3594                 cf_save="$CPPFLAGS"
3595                 echo "$as_me:3595: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3596 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3597 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3598   echo $ECHO_N "(cached) $ECHO_C" >&6
3599 else
3600
3601 cf_fix_cppflags=no
3602 cf_new_cflags=
3603 cf_new_cppflags=
3604 cf_new_extra_cppflags=
3605
3606 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3607 do
3608 case $cf_fix_cppflags in
3609 (no)
3610         case $cf_add_cflags in
3611         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3612                 case $cf_add_cflags in
3613                 (-D*)
3614                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3615
3616                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3617                                 && test -z "${cf_tst_cflags}" \
3618                                 && cf_fix_cppflags=yes
3619
3620                         if test $cf_fix_cppflags = yes ; then
3621
3622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3624
3625                                 continue
3626                         elif test "${cf_tst_cflags}" = "\"'" ; then
3627
3628         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3629         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3630
3631                                 continue
3632                         fi
3633                         ;;
3634                 esac
3635                 case "$CPPFLAGS" in
3636                 (*$cf_add_cflags)
3637                         ;;
3638                 (*)
3639                         case $cf_add_cflags in
3640                         (-D*)
3641                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3642
3643 CPPFLAGS=`echo "$CPPFLAGS" | \
3644         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3645                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3646
3647                                 ;;
3648                         esac
3649
3650         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3651         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3652
3653                         ;;
3654                 esac
3655                 ;;
3656         (*)
3657
3658         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3659         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3660
3661                 ;;
3662         esac
3663         ;;
3664 (yes)
3665
3666         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3667         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3668
3669         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3670
3671         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3672                 && test -z "${cf_tst_cflags}" \
3673                 && cf_fix_cppflags=no
3674         ;;
3675 esac
3676 done
3677
3678 if test -n "$cf_new_cflags" ; then
3679
3680         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3681         CFLAGS="${CFLAGS}$cf_new_cflags"
3682
3683 fi
3684
3685 if test -n "$cf_new_cppflags" ; then
3686
3687         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3688         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3689
3690 fi
3691
3692 if test -n "$cf_new_extra_cppflags" ; then
3693
3694         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3695         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3696
3697 fi
3698
3699                         cat >conftest.$ac_ext <<_ACEOF
3700 #line 3700 "configure"
3701 #include "confdefs.h"
3702
3703                                 #include <limits.h>
3704                                 #include <sys/types.h>
3705
3706 int
3707 main (void)
3708 {
3709
3710                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3711                                         return 0;
3712                                 #else
3713                                 #       error GNU C library is too old
3714                                 #endif
3715   ;
3716   return 0;
3717 }
3718 _ACEOF
3719 rm -f conftest.$ac_objext
3720 if { (eval echo "$as_me:3720: \"$ac_compile\"") >&5
3721   (eval $ac_compile) 2>&5
3722   ac_status=$?
3723   echo "$as_me:3723: \$? = $ac_status" >&5
3724   (exit $ac_status); } &&
3725          { ac_try='test -s conftest.$ac_objext'
3726   { (eval echo "$as_me:3726: \"$ac_try\"") >&5
3727   (eval $ac_try) 2>&5
3728   ac_status=$?
3729   echo "$as_me:3729: \$? = $ac_status" >&5
3730   (exit $ac_status); }; }; then
3731   cf_cv_gnu_dftsrc_219=yes
3732 else
3733   echo "$as_me: failed program was:" >&5
3734 cat conftest.$ac_ext >&5
3735 cf_cv_gnu_dftsrc_219=no
3736 fi
3737 rm -f conftest.$ac_objext conftest.$ac_ext
3738
3739 fi
3740 echo "$as_me:3740: result: $cf_cv_gnu_dftsrc_219" >&5
3741 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3742                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3743         else
3744                 cf_cv_gnu_dftsrc_219=maybe
3745         fi
3746
3747         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3748
3749                 echo "$as_me:3749: checking if we must define _GNU_SOURCE" >&5
3750 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3751 if test "${cf_cv_gnu_source+set}" = set; then
3752   echo $ECHO_N "(cached) $ECHO_C" >&6
3753 else
3754
3755                 cat >conftest.$ac_ext <<_ACEOF
3756 #line 3756 "configure"
3757 #include "confdefs.h"
3758 #include <sys/types.h>
3759 int
3760 main (void)
3761 {
3762
3763                         #ifndef _XOPEN_SOURCE
3764                         #error  expected _XOPEN_SOURCE to be defined
3765                         #endif
3766   ;
3767   return 0;
3768 }
3769 _ACEOF
3770 rm -f conftest.$ac_objext
3771 if { (eval echo "$as_me:3771: \"$ac_compile\"") >&5
3772   (eval $ac_compile) 2>&5
3773   ac_status=$?
3774   echo "$as_me:3774: \$? = $ac_status" >&5
3775   (exit $ac_status); } &&
3776          { ac_try='test -s conftest.$ac_objext'
3777   { (eval echo "$as_me:3777: \"$ac_try\"") >&5
3778   (eval $ac_try) 2>&5
3779   ac_status=$?
3780   echo "$as_me:3780: \$? = $ac_status" >&5
3781   (exit $ac_status); }; }; then
3782   cf_cv_gnu_source=no
3783 else
3784   echo "$as_me: failed program was:" >&5
3785 cat conftest.$ac_ext >&5
3786 cf_save="$CPPFLAGS"
3787
3788 cf_fix_cppflags=no
3789 cf_new_cflags=
3790 cf_new_cppflags=
3791 cf_new_extra_cppflags=
3792
3793 for cf_add_cflags in -D_GNU_SOURCE
3794 do
3795 case $cf_fix_cppflags in
3796 (no)
3797         case $cf_add_cflags in
3798         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3799                 case $cf_add_cflags in
3800                 (-D*)
3801                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3802
3803                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3804                                 && test -z "${cf_tst_cflags}" \
3805                                 && cf_fix_cppflags=yes
3806
3807                         if test $cf_fix_cppflags = yes ; then
3808
3809         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3810         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3811
3812                                 continue
3813                         elif test "${cf_tst_cflags}" = "\"'" ; then
3814
3815         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3816         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3817
3818                                 continue
3819                         fi
3820                         ;;
3821                 esac
3822                 case "$CPPFLAGS" in
3823                 (*$cf_add_cflags)
3824                         ;;
3825                 (*)
3826                         case $cf_add_cflags in
3827                         (-D*)
3828                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3829
3830 CPPFLAGS=`echo "$CPPFLAGS" | \
3831         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3832                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3833
3834                                 ;;
3835                         esac
3836
3837         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3838         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3839
3840                         ;;
3841                 esac
3842                 ;;
3843         (*)
3844
3845         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3846         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3847
3848                 ;;
3849         esac
3850         ;;
3851 (yes)
3852
3853         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3854         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3855
3856         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3857
3858         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3859                 && test -z "${cf_tst_cflags}" \
3860                 && cf_fix_cppflags=no
3861         ;;
3862 esac
3863 done
3864
3865 if test -n "$cf_new_cflags" ; then
3866
3867         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3868         CFLAGS="${CFLAGS}$cf_new_cflags"
3869
3870 fi
3871
3872 if test -n "$cf_new_cppflags" ; then
3873
3874         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3875         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3876
3877 fi
3878
3879 if test -n "$cf_new_extra_cppflags" ; then
3880
3881         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3882         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3883
3884 fi
3885
3886                          cat >conftest.$ac_ext <<_ACEOF
3887 #line 3887 "configure"
3888 #include "confdefs.h"
3889 #include <sys/types.h>
3890 int
3891 main (void)
3892 {
3893
3894                                 #ifdef _XOPEN_SOURCE
3895                                 #error  expected _XOPEN_SOURCE to be undefined
3896                                 #endif
3897   ;
3898   return 0;
3899 }
3900 _ACEOF
3901 rm -f conftest.$ac_objext
3902 if { (eval echo "$as_me:3902: \"$ac_compile\"") >&5
3903   (eval $ac_compile) 2>&5
3904   ac_status=$?
3905   echo "$as_me:3905: \$? = $ac_status" >&5
3906   (exit $ac_status); } &&
3907          { ac_try='test -s conftest.$ac_objext'
3908   { (eval echo "$as_me:3908: \"$ac_try\"") >&5
3909   (eval $ac_try) 2>&5
3910   ac_status=$?
3911   echo "$as_me:3911: \$? = $ac_status" >&5
3912   (exit $ac_status); }; }; then
3913   cf_cv_gnu_source=no
3914 else
3915   echo "$as_me: failed program was:" >&5
3916 cat conftest.$ac_ext >&5
3917 cf_cv_gnu_source=yes
3918 fi
3919 rm -f conftest.$ac_objext conftest.$ac_ext
3920                         CPPFLAGS="$cf_save"
3921
3922 fi
3923 rm -f conftest.$ac_objext conftest.$ac_ext
3924
3925 fi
3926 echo "$as_me:3926: result: $cf_cv_gnu_source" >&5
3927 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3928
3929                 if test "$cf_cv_gnu_source" = yes
3930                 then
3931                 echo "$as_me:3931: checking if we should also define _DEFAULT_SOURCE" >&5
3932 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3933 if test "${cf_cv_default_source+set}" = set; then
3934   echo $ECHO_N "(cached) $ECHO_C" >&6
3935 else
3936
3937         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3938         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
3939
3940                         cat >conftest.$ac_ext <<_ACEOF
3941 #line 3941 "configure"
3942 #include "confdefs.h"
3943 #include <sys/types.h>
3944 int
3945 main (void)
3946 {
3947
3948                                 #ifdef _DEFAULT_SOURCE
3949                                 #error  expected _DEFAULT_SOURCE to be undefined
3950                                 #endif
3951   ;
3952   return 0;
3953 }
3954 _ACEOF
3955 rm -f conftest.$ac_objext
3956 if { (eval echo "$as_me:3956: \"$ac_compile\"") >&5
3957   (eval $ac_compile) 2>&5
3958   ac_status=$?
3959   echo "$as_me:3959: \$? = $ac_status" >&5
3960   (exit $ac_status); } &&
3961          { ac_try='test -s conftest.$ac_objext'
3962   { (eval echo "$as_me:3962: \"$ac_try\"") >&5
3963   (eval $ac_try) 2>&5
3964   ac_status=$?
3965   echo "$as_me:3965: \$? = $ac_status" >&5
3966   (exit $ac_status); }; }; then
3967   cf_cv_default_source=no
3968 else
3969   echo "$as_me: failed program was:" >&5
3970 cat conftest.$ac_ext >&5
3971 cf_cv_default_source=yes
3972 fi
3973 rm -f conftest.$ac_objext conftest.$ac_ext
3974
3975 fi
3976 echo "$as_me:3976: result: $cf_cv_default_source" >&5
3977 echo "${ECHO_T}$cf_cv_default_source" >&6
3978                         if test "$cf_cv_default_source" = yes
3979                         then
3980
3981         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3982         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3983
3984                         fi
3985                 fi
3986         fi
3987
3988 fi
3989
3990         ;;
3991 (minix*)
3992         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3993         ;;
3994 (mirbsd*)
3995         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3996         cf_XOPEN_SOURCE=
3997
3998 if test "$cf_cv_posix_visible" = no; then
3999
4000 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4001
4002 cf_save_CFLAGS="$CFLAGS"
4003 cf_save_CPPFLAGS="$CPPFLAGS"
4004
4005 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4006         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4007                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4008
4009 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4010         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4011                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4012
4013 echo "$as_me:4013: checking if we should define _POSIX_C_SOURCE" >&5
4014 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4015 if test "${cf_cv_posix_c_source+set}" = set; then
4016   echo $ECHO_N "(cached) $ECHO_C" >&6
4017 else
4018
4019 echo "${as_me:-configure}:4019: testing if the symbol is already defined go no further ..." 1>&5
4020
4021         cat >conftest.$ac_ext <<_ACEOF
4022 #line 4022 "configure"
4023 #include "confdefs.h"
4024 #include <sys/types.h>
4025 int
4026 main (void)
4027 {
4028
4029 #ifndef _POSIX_C_SOURCE
4030 make an error
4031 #endif
4032   ;
4033   return 0;
4034 }
4035 _ACEOF
4036 rm -f conftest.$ac_objext
4037 if { (eval echo "$as_me:4037: \"$ac_compile\"") >&5
4038   (eval $ac_compile) 2>&5
4039   ac_status=$?
4040   echo "$as_me:4040: \$? = $ac_status" >&5
4041   (exit $ac_status); } &&
4042          { ac_try='test -s conftest.$ac_objext'
4043   { (eval echo "$as_me:4043: \"$ac_try\"") >&5
4044   (eval $ac_try) 2>&5
4045   ac_status=$?
4046   echo "$as_me:4046: \$? = $ac_status" >&5
4047   (exit $ac_status); }; }; then
4048   cf_cv_posix_c_source=no
4049 else
4050   echo "$as_me: failed program was:" >&5
4051 cat conftest.$ac_ext >&5
4052 cf_want_posix_source=no
4053          case .$cf_POSIX_C_SOURCE in
4054          (.[12]??*)
4055                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4056                 ;;
4057          (.2)
4058                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4059                 cf_want_posix_source=yes
4060                 ;;
4061          (.*)
4062                 cf_want_posix_source=yes
4063                 ;;
4064          esac
4065          if test "$cf_want_posix_source" = yes ; then
4066                 cat >conftest.$ac_ext <<_ACEOF
4067 #line 4067 "configure"
4068 #include "confdefs.h"
4069 #include <sys/types.h>
4070 int
4071 main (void)
4072 {
4073
4074 #ifdef _POSIX_SOURCE
4075 make an error
4076 #endif
4077   ;
4078   return 0;
4079 }
4080 _ACEOF
4081 rm -f conftest.$ac_objext
4082 if { (eval echo "$as_me:4082: \"$ac_compile\"") >&5
4083   (eval $ac_compile) 2>&5
4084   ac_status=$?
4085   echo "$as_me:4085: \$? = $ac_status" >&5
4086   (exit $ac_status); } &&
4087          { ac_try='test -s conftest.$ac_objext'
4088   { (eval echo "$as_me:4088: \"$ac_try\"") >&5
4089   (eval $ac_try) 2>&5
4090   ac_status=$?
4091   echo "$as_me:4091: \$? = $ac_status" >&5
4092   (exit $ac_status); }; }; then
4093   :
4094 else
4095   echo "$as_me: failed program was:" >&5
4096 cat conftest.$ac_ext >&5
4097 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4098 fi
4099 rm -f conftest.$ac_objext conftest.$ac_ext
4100          fi
4101
4102 echo "${as_me:-configure}:4102: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4103
4104          CFLAGS="$cf_trim_CFLAGS"
4105          CPPFLAGS="$cf_trim_CPPFLAGS"
4106
4107         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4108         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4109
4110 echo "${as_me:-configure}:4110: testing if the second compile does not leave our definition intact error ..." 1>&5
4111
4112          cat >conftest.$ac_ext <<_ACEOF
4113 #line 4113 "configure"
4114 #include "confdefs.h"
4115 #include <sys/types.h>
4116 int
4117 main (void)
4118 {
4119
4120 #ifndef _POSIX_C_SOURCE
4121 make an error
4122 #endif
4123   ;
4124   return 0;
4125 }
4126 _ACEOF
4127 rm -f conftest.$ac_objext
4128 if { (eval echo "$as_me:4128: \"$ac_compile\"") >&5
4129   (eval $ac_compile) 2>&5
4130   ac_status=$?
4131   echo "$as_me:4131: \$? = $ac_status" >&5
4132   (exit $ac_status); } &&
4133          { ac_try='test -s conftest.$ac_objext'
4134   { (eval echo "$as_me:4134: \"$ac_try\"") >&5
4135   (eval $ac_try) 2>&5
4136   ac_status=$?
4137   echo "$as_me:4137: \$? = $ac_status" >&5
4138   (exit $ac_status); }; }; then
4139   :
4140 else
4141   echo "$as_me: failed program was:" >&5
4142 cat conftest.$ac_ext >&5
4143 cf_cv_posix_c_source=no
4144 fi
4145 rm -f conftest.$ac_objext conftest.$ac_ext
4146          CFLAGS="$cf_save_CFLAGS"
4147          CPPFLAGS="$cf_save_CPPFLAGS"
4148
4149 fi
4150 rm -f conftest.$ac_objext conftest.$ac_ext
4151
4152 fi
4153 echo "$as_me:4153: result: $cf_cv_posix_c_source" >&5
4154 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4155
4156 if test "$cf_cv_posix_c_source" != no ; then
4157         CFLAGS="$cf_trim_CFLAGS"
4158         CPPFLAGS="$cf_trim_CPPFLAGS"
4159
4160 cf_fix_cppflags=no
4161 cf_new_cflags=
4162 cf_new_cppflags=
4163 cf_new_extra_cppflags=
4164
4165 for cf_add_cflags in $cf_cv_posix_c_source
4166 do
4167 case $cf_fix_cppflags in
4168 (no)
4169         case $cf_add_cflags in
4170         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4171                 case $cf_add_cflags in
4172                 (-D*)
4173                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4174
4175                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4176                                 && test -z "${cf_tst_cflags}" \
4177                                 && cf_fix_cppflags=yes
4178
4179                         if test $cf_fix_cppflags = yes ; then
4180
4181         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4182         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4183
4184                                 continue
4185                         elif test "${cf_tst_cflags}" = "\"'" ; then
4186
4187         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4188         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4189
4190                                 continue
4191                         fi
4192                         ;;
4193                 esac
4194                 case "$CPPFLAGS" in
4195                 (*$cf_add_cflags)
4196                         ;;
4197                 (*)
4198                         case $cf_add_cflags in
4199                         (-D*)
4200                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4201
4202 CPPFLAGS=`echo "$CPPFLAGS" | \
4203         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4204                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4205
4206                                 ;;
4207                         esac
4208
4209         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4210         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4211
4212                         ;;
4213                 esac
4214                 ;;
4215         (*)
4216
4217         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4218         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4219
4220                 ;;
4221         esac
4222         ;;
4223 (yes)
4224
4225         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4226         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4227
4228         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4229
4230         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4231                 && test -z "${cf_tst_cflags}" \
4232                 && cf_fix_cppflags=no
4233         ;;
4234 esac
4235 done
4236
4237 if test -n "$cf_new_cflags" ; then
4238
4239         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4240         CFLAGS="${CFLAGS}$cf_new_cflags"
4241
4242 fi
4243
4244 if test -n "$cf_new_cppflags" ; then
4245
4246         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4247         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4248
4249 fi
4250
4251 if test -n "$cf_new_extra_cppflags" ; then
4252
4253         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4254         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4255
4256 fi
4257
4258 fi
4259
4260 fi # cf_cv_posix_visible
4261
4262         ;;
4263 (netbsd*)
4264         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4265         ;;
4266 (openbsd[4-9]*)
4267         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4268         cf_xopen_source="-D_BSD_SOURCE"
4269         cf_XOPEN_SOURCE=600
4270         ;;
4271 (openbsd*)
4272         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4273         ;;
4274 (osf[45]*)
4275         cf_xopen_source="-D_OSF_SOURCE"
4276         ;;
4277 (nto-qnx*)
4278         cf_xopen_source="-D_QNX_SOURCE"
4279         ;;
4280 (sco*)
4281         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4282         ;;
4283 (solaris2.*)
4284         cf_xopen_source="-D__EXTENSIONS__"
4285         cf_cv_xopen_source=broken
4286         ;;
4287 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4288         cf_XOPEN_SOURCE=
4289         cf_POSIX_C_SOURCE=
4290         ;;
4291 (*)
4292
4293 echo "$as_me:4293: checking if we should define _XOPEN_SOURCE" >&5
4294 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4295 if test "${cf_cv_xopen_source+set}" = set; then
4296   echo $ECHO_N "(cached) $ECHO_C" >&6
4297 else
4298
4299         cat >conftest.$ac_ext <<_ACEOF
4300 #line 4300 "configure"
4301 #include "confdefs.h"
4302
4303 #include <stdlib.h>
4304 #include <string.h>
4305 #include <sys/types.h>
4306
4307 int
4308 main (void)
4309 {
4310
4311 #ifndef _XOPEN_SOURCE
4312 make an error
4313 #endif
4314   ;
4315   return 0;
4316 }
4317 _ACEOF
4318 rm -f conftest.$ac_objext
4319 if { (eval echo "$as_me:4319: \"$ac_compile\"") >&5
4320   (eval $ac_compile) 2>&5
4321   ac_status=$?
4322   echo "$as_me:4322: \$? = $ac_status" >&5
4323   (exit $ac_status); } &&
4324          { ac_try='test -s conftest.$ac_objext'
4325   { (eval echo "$as_me:4325: \"$ac_try\"") >&5
4326   (eval $ac_try) 2>&5
4327   ac_status=$?
4328   echo "$as_me:4328: \$? = $ac_status" >&5
4329   (exit $ac_status); }; }; then
4330   cf_cv_xopen_source=no
4331 else
4332   echo "$as_me: failed program was:" >&5
4333 cat conftest.$ac_ext >&5
4334 cf_save="$CPPFLAGS"
4335
4336         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4337         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4338
4339          cat >conftest.$ac_ext <<_ACEOF
4340 #line 4340 "configure"
4341 #include "confdefs.h"
4342
4343 #include <stdlib.h>
4344 #include <string.h>
4345 #include <sys/types.h>
4346
4347 int
4348 main (void)
4349 {
4350
4351 #ifdef _XOPEN_SOURCE
4352 make an error
4353 #endif
4354   ;
4355   return 0;
4356 }
4357 _ACEOF
4358 rm -f conftest.$ac_objext
4359 if { (eval echo "$as_me:4359: \"$ac_compile\"") >&5
4360   (eval $ac_compile) 2>&5
4361   ac_status=$?
4362   echo "$as_me:4362: \$? = $ac_status" >&5
4363   (exit $ac_status); } &&
4364          { ac_try='test -s conftest.$ac_objext'
4365   { (eval echo "$as_me:4365: \"$ac_try\"") >&5
4366   (eval $ac_try) 2>&5
4367   ac_status=$?
4368   echo "$as_me:4368: \$? = $ac_status" >&5
4369   (exit $ac_status); }; }; then
4370   cf_cv_xopen_source=no
4371 else
4372   echo "$as_me: failed program was:" >&5
4373 cat conftest.$ac_ext >&5
4374 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4375 fi
4376 rm -f conftest.$ac_objext conftest.$ac_ext
4377         CPPFLAGS="$cf_save"
4378
4379 fi
4380 rm -f conftest.$ac_objext conftest.$ac_ext
4381
4382 fi
4383 echo "$as_me:4383: result: $cf_cv_xopen_source" >&5
4384 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4385
4386 if test "$cf_cv_xopen_source" != no ; then
4387
4388 CFLAGS=`echo "$CFLAGS" | \
4389         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4390                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4391
4392 CPPFLAGS=`echo "$CPPFLAGS" | \
4393         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4394                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4395
4396         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4397
4398 cf_fix_cppflags=no
4399 cf_new_cflags=
4400 cf_new_cppflags=
4401 cf_new_extra_cppflags=
4402
4403 for cf_add_cflags in $cf_temp_xopen_source
4404 do
4405 case $cf_fix_cppflags in
4406 (no)
4407         case $cf_add_cflags in
4408         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4409                 case $cf_add_cflags in
4410                 (-D*)
4411                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4412
4413                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4414                                 && test -z "${cf_tst_cflags}" \
4415                                 && cf_fix_cppflags=yes
4416
4417                         if test $cf_fix_cppflags = yes ; then
4418
4419         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4420         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4421
4422                                 continue
4423                         elif test "${cf_tst_cflags}" = "\"'" ; then
4424
4425         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4426         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4427
4428                                 continue
4429                         fi
4430                         ;;
4431                 esac
4432                 case "$CPPFLAGS" in
4433                 (*$cf_add_cflags)
4434                         ;;
4435                 (*)
4436                         case $cf_add_cflags in
4437                         (-D*)
4438                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4439
4440 CPPFLAGS=`echo "$CPPFLAGS" | \
4441         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4442                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4443
4444                                 ;;
4445                         esac
4446
4447         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4448         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4449
4450                         ;;
4451                 esac
4452                 ;;
4453         (*)
4454
4455         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4456         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4457
4458                 ;;
4459         esac
4460         ;;
4461 (yes)
4462
4463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4465
4466         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4467
4468         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4469                 && test -z "${cf_tst_cflags}" \
4470                 && cf_fix_cppflags=no
4471         ;;
4472 esac
4473 done
4474
4475 if test -n "$cf_new_cflags" ; then
4476
4477         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4478         CFLAGS="${CFLAGS}$cf_new_cflags"
4479
4480 fi
4481
4482 if test -n "$cf_new_cppflags" ; then
4483
4484         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4485         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4486
4487 fi
4488
4489 if test -n "$cf_new_extra_cppflags" ; then
4490
4491         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4492         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4493
4494 fi
4495
4496 fi
4497
4498 if test "$cf_cv_posix_visible" = no; then
4499
4500 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4501
4502 cf_save_CFLAGS="$CFLAGS"
4503 cf_save_CPPFLAGS="$CPPFLAGS"
4504
4505 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4506         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4507                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4508
4509 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4510         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4511                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4512
4513 echo "$as_me:4513: checking if we should define _POSIX_C_SOURCE" >&5
4514 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4515 if test "${cf_cv_posix_c_source+set}" = set; then
4516   echo $ECHO_N "(cached) $ECHO_C" >&6
4517 else
4518
4519 echo "${as_me:-configure}:4519: testing if the symbol is already defined go no further ..." 1>&5
4520
4521         cat >conftest.$ac_ext <<_ACEOF
4522 #line 4522 "configure"
4523 #include "confdefs.h"
4524 #include <sys/types.h>
4525 int
4526 main (void)
4527 {
4528
4529 #ifndef _POSIX_C_SOURCE
4530 make an error
4531 #endif
4532   ;
4533   return 0;
4534 }
4535 _ACEOF
4536 rm -f conftest.$ac_objext
4537 if { (eval echo "$as_me:4537: \"$ac_compile\"") >&5
4538   (eval $ac_compile) 2>&5
4539   ac_status=$?
4540   echo "$as_me:4540: \$? = $ac_status" >&5
4541   (exit $ac_status); } &&
4542          { ac_try='test -s conftest.$ac_objext'
4543   { (eval echo "$as_me:4543: \"$ac_try\"") >&5
4544   (eval $ac_try) 2>&5
4545   ac_status=$?
4546   echo "$as_me:4546: \$? = $ac_status" >&5
4547   (exit $ac_status); }; }; then
4548   cf_cv_posix_c_source=no
4549 else
4550   echo "$as_me: failed program was:" >&5
4551 cat conftest.$ac_ext >&5
4552 cf_want_posix_source=no
4553          case .$cf_POSIX_C_SOURCE in
4554          (.[12]??*)
4555                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4556                 ;;
4557          (.2)
4558                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4559                 cf_want_posix_source=yes
4560                 ;;
4561          (.*)
4562                 cf_want_posix_source=yes
4563                 ;;
4564          esac
4565          if test "$cf_want_posix_source" = yes ; then
4566                 cat >conftest.$ac_ext <<_ACEOF
4567 #line 4567 "configure"
4568 #include "confdefs.h"
4569 #include <sys/types.h>
4570 int
4571 main (void)
4572 {
4573
4574 #ifdef _POSIX_SOURCE
4575 make an error
4576 #endif
4577   ;
4578   return 0;
4579 }
4580 _ACEOF
4581 rm -f conftest.$ac_objext
4582 if { (eval echo "$as_me:4582: \"$ac_compile\"") >&5
4583   (eval $ac_compile) 2>&5
4584   ac_status=$?
4585   echo "$as_me:4585: \$? = $ac_status" >&5
4586   (exit $ac_status); } &&
4587          { ac_try='test -s conftest.$ac_objext'
4588   { (eval echo "$as_me:4588: \"$ac_try\"") >&5
4589   (eval $ac_try) 2>&5
4590   ac_status=$?
4591   echo "$as_me:4591: \$? = $ac_status" >&5
4592   (exit $ac_status); }; }; then
4593   :
4594 else
4595   echo "$as_me: failed program was:" >&5
4596 cat conftest.$ac_ext >&5
4597 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4598 fi
4599 rm -f conftest.$ac_objext conftest.$ac_ext
4600          fi
4601
4602 echo "${as_me:-configure}:4602: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4603
4604          CFLAGS="$cf_trim_CFLAGS"
4605          CPPFLAGS="$cf_trim_CPPFLAGS"
4606
4607         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4608         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4609
4610 echo "${as_me:-configure}:4610: testing if the second compile does not leave our definition intact error ..." 1>&5
4611
4612          cat >conftest.$ac_ext <<_ACEOF
4613 #line 4613 "configure"
4614 #include "confdefs.h"
4615 #include <sys/types.h>
4616 int
4617 main (void)
4618 {
4619
4620 #ifndef _POSIX_C_SOURCE
4621 make an error
4622 #endif
4623   ;
4624   return 0;
4625 }
4626 _ACEOF
4627 rm -f conftest.$ac_objext
4628 if { (eval echo "$as_me:4628: \"$ac_compile\"") >&5
4629   (eval $ac_compile) 2>&5
4630   ac_status=$?
4631   echo "$as_me:4631: \$? = $ac_status" >&5
4632   (exit $ac_status); } &&
4633          { ac_try='test -s conftest.$ac_objext'
4634   { (eval echo "$as_me:4634: \"$ac_try\"") >&5
4635   (eval $ac_try) 2>&5
4636   ac_status=$?
4637   echo "$as_me:4637: \$? = $ac_status" >&5
4638   (exit $ac_status); }; }; then
4639   :
4640 else
4641   echo "$as_me: failed program was:" >&5
4642 cat conftest.$ac_ext >&5
4643 cf_cv_posix_c_source=no
4644 fi
4645 rm -f conftest.$ac_objext conftest.$ac_ext
4646          CFLAGS="$cf_save_CFLAGS"
4647          CPPFLAGS="$cf_save_CPPFLAGS"
4648
4649 fi
4650 rm -f conftest.$ac_objext conftest.$ac_ext
4651
4652 fi
4653 echo "$as_me:4653: result: $cf_cv_posix_c_source" >&5
4654 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4655
4656 if test "$cf_cv_posix_c_source" != no ; then
4657         CFLAGS="$cf_trim_CFLAGS"
4658         CPPFLAGS="$cf_trim_CPPFLAGS"
4659
4660 cf_fix_cppflags=no
4661 cf_new_cflags=
4662 cf_new_cppflags=
4663 cf_new_extra_cppflags=
4664
4665 for cf_add_cflags in $cf_cv_posix_c_source
4666 do
4667 case $cf_fix_cppflags in
4668 (no)
4669         case $cf_add_cflags in
4670         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4671                 case $cf_add_cflags in
4672                 (-D*)
4673                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4674
4675                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4676                                 && test -z "${cf_tst_cflags}" \
4677                                 && cf_fix_cppflags=yes
4678
4679                         if test $cf_fix_cppflags = yes ; then
4680
4681         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4682         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4683
4684                                 continue
4685                         elif test "${cf_tst_cflags}" = "\"'" ; then
4686
4687         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4688         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4689
4690                                 continue
4691                         fi
4692                         ;;
4693                 esac
4694                 case "$CPPFLAGS" in
4695                 (*$cf_add_cflags)
4696                         ;;
4697                 (*)
4698                         case $cf_add_cflags in
4699                         (-D*)
4700                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4701
4702 CPPFLAGS=`echo "$CPPFLAGS" | \
4703         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4704                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4705
4706                                 ;;
4707                         esac
4708
4709         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4710         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4711
4712                         ;;
4713                 esac
4714                 ;;
4715         (*)
4716
4717         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4718         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4719
4720                 ;;
4721         esac
4722         ;;
4723 (yes)
4724
4725         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4726         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4727
4728         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4729
4730         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4731                 && test -z "${cf_tst_cflags}" \
4732                 && cf_fix_cppflags=no
4733         ;;
4734 esac
4735 done
4736
4737 if test -n "$cf_new_cflags" ; then
4738
4739         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4740         CFLAGS="${CFLAGS}$cf_new_cflags"
4741
4742 fi
4743
4744 if test -n "$cf_new_cppflags" ; then
4745
4746         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4747         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4748
4749 fi
4750
4751 if test -n "$cf_new_extra_cppflags" ; then
4752
4753         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4754         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4755
4756 fi
4757
4758 fi
4759
4760 fi # cf_cv_posix_visible
4761
4762         ;;
4763 esac
4764
4765 if test -n "$cf_xopen_source" ; then
4766
4767 cf_fix_cppflags=no
4768 cf_new_cflags=
4769 cf_new_cppflags=
4770 cf_new_extra_cppflags=
4771
4772 for cf_add_cflags in $cf_xopen_source
4773 do
4774 case $cf_fix_cppflags in
4775 (no)
4776         case $cf_add_cflags in
4777         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4778                 case $cf_add_cflags in
4779                 (-D*)
4780                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4781
4782                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4783                                 && test -z "${cf_tst_cflags}" \
4784                                 && cf_fix_cppflags=yes
4785
4786                         if test $cf_fix_cppflags = yes ; then
4787
4788         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4789         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4790
4791                                 continue
4792                         elif test "${cf_tst_cflags}" = "\"'" ; then
4793
4794         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4795         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4796
4797                                 continue
4798                         fi
4799                         ;;
4800                 esac
4801                 case "$CPPFLAGS" in
4802                 (*$cf_add_cflags)
4803                         ;;
4804                 (*)
4805                         case $cf_add_cflags in
4806                         (-D*)
4807                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4808
4809 CPPFLAGS=`echo "$CPPFLAGS" | \
4810         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4811                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4812
4813                                 ;;
4814                         esac
4815
4816         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4817         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4818
4819                         ;;
4820                 esac
4821                 ;;
4822         (*)
4823
4824         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4825         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4826
4827                 ;;
4828         esac
4829         ;;
4830 (yes)
4831
4832         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4833         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4834
4835         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4836
4837         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4838                 && test -z "${cf_tst_cflags}" \
4839                 && cf_fix_cppflags=no
4840         ;;
4841 esac
4842 done
4843
4844 if test -n "$cf_new_cflags" ; then
4845         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4846
4847 echo "${as_me:-configure}:4847: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4848
4849         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4850         CFLAGS="${CFLAGS}$cf_new_cflags"
4851
4852 fi
4853
4854 if test -n "$cf_new_cppflags" ; then
4855         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4856
4857 echo "${as_me:-configure}:4857: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4858
4859         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4860         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4861
4862 fi
4863
4864 if test -n "$cf_new_extra_cppflags" ; then
4865         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4866
4867 echo "${as_me:-configure}:4867: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4868
4869         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4870         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4871
4872 fi
4873
4874 fi
4875
4876 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4877         echo "$as_me:4877: checking if _XOPEN_SOURCE really is set" >&5
4878 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4879         cat >conftest.$ac_ext <<_ACEOF
4880 #line 4880 "configure"
4881 #include "confdefs.h"
4882 #include <stdlib.h>
4883 int
4884 main (void)
4885 {
4886
4887 #ifndef _XOPEN_SOURCE
4888 make an error
4889 #endif
4890   ;
4891   return 0;
4892 }
4893 _ACEOF
4894 rm -f conftest.$ac_objext
4895 if { (eval echo "$as_me:4895: \"$ac_compile\"") >&5
4896   (eval $ac_compile) 2>&5
4897   ac_status=$?
4898   echo "$as_me:4898: \$? = $ac_status" >&5
4899   (exit $ac_status); } &&
4900          { ac_try='test -s conftest.$ac_objext'
4901   { (eval echo "$as_me:4901: \"$ac_try\"") >&5
4902   (eval $ac_try) 2>&5
4903   ac_status=$?
4904   echo "$as_me:4904: \$? = $ac_status" >&5
4905   (exit $ac_status); }; }; then
4906   cf_XOPEN_SOURCE_set=yes
4907 else
4908   echo "$as_me: failed program was:" >&5
4909 cat conftest.$ac_ext >&5
4910 cf_XOPEN_SOURCE_set=no
4911 fi
4912 rm -f conftest.$ac_objext conftest.$ac_ext
4913         echo "$as_me:4913: result: $cf_XOPEN_SOURCE_set" >&5
4914 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4915         if test $cf_XOPEN_SOURCE_set = yes
4916         then
4917                 cat >conftest.$ac_ext <<_ACEOF
4918 #line 4918 "configure"
4919 #include "confdefs.h"
4920 #include <stdlib.h>
4921 int
4922 main (void)
4923 {
4924
4925 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4926 make an error
4927 #endif
4928   ;
4929   return 0;
4930 }
4931 _ACEOF
4932 rm -f conftest.$ac_objext
4933 if { (eval echo "$as_me:4933: \"$ac_compile\"") >&5
4934   (eval $ac_compile) 2>&5
4935   ac_status=$?
4936   echo "$as_me:4936: \$? = $ac_status" >&5
4937   (exit $ac_status); } &&
4938          { ac_try='test -s conftest.$ac_objext'
4939   { (eval echo "$as_me:4939: \"$ac_try\"") >&5
4940   (eval $ac_try) 2>&5
4941   ac_status=$?
4942   echo "$as_me:4942: \$? = $ac_status" >&5
4943   (exit $ac_status); }; }; then
4944   cf_XOPEN_SOURCE_set_ok=yes
4945 else
4946   echo "$as_me: failed program was:" >&5
4947 cat conftest.$ac_ext >&5
4948 cf_XOPEN_SOURCE_set_ok=no
4949 fi
4950 rm -f conftest.$ac_objext conftest.$ac_ext
4951                 if test $cf_XOPEN_SOURCE_set_ok = no
4952                 then
4953                         { echo "$as_me:4953: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4954 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4955                 fi
4956         else
4957
4958 echo "$as_me:4958: checking if we should define _XOPEN_SOURCE" >&5
4959 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4960 if test "${cf_cv_xopen_source+set}" = set; then
4961   echo $ECHO_N "(cached) $ECHO_C" >&6
4962 else
4963
4964         cat >conftest.$ac_ext <<_ACEOF
4965 #line 4965 "configure"
4966 #include "confdefs.h"
4967
4968 #include <stdlib.h>
4969 #include <string.h>
4970 #include <sys/types.h>
4971
4972 int
4973 main (void)
4974 {
4975
4976 #ifndef _XOPEN_SOURCE
4977 make an error
4978 #endif
4979   ;
4980   return 0;
4981 }
4982 _ACEOF
4983 rm -f conftest.$ac_objext
4984 if { (eval echo "$as_me:4984: \"$ac_compile\"") >&5
4985   (eval $ac_compile) 2>&5
4986   ac_status=$?
4987   echo "$as_me:4987: \$? = $ac_status" >&5
4988   (exit $ac_status); } &&
4989          { ac_try='test -s conftest.$ac_objext'
4990   { (eval echo "$as_me:4990: \"$ac_try\"") >&5
4991   (eval $ac_try) 2>&5
4992   ac_status=$?
4993   echo "$as_me:4993: \$? = $ac_status" >&5
4994   (exit $ac_status); }; }; then
4995   cf_cv_xopen_source=no
4996 else
4997   echo "$as_me: failed program was:" >&5
4998 cat conftest.$ac_ext >&5
4999 cf_save="$CPPFLAGS"
5000
5001         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5002         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5003
5004          cat >conftest.$ac_ext <<_ACEOF
5005 #line 5005 "configure"
5006 #include "confdefs.h"
5007
5008 #include <stdlib.h>
5009 #include <string.h>
5010 #include <sys/types.h>
5011
5012 int
5013 main (void)
5014 {
5015
5016 #ifdef _XOPEN_SOURCE
5017 make an error
5018 #endif
5019   ;
5020   return 0;
5021 }
5022 _ACEOF
5023 rm -f conftest.$ac_objext
5024 if { (eval echo "$as_me:5024: \"$ac_compile\"") >&5
5025   (eval $ac_compile) 2>&5
5026   ac_status=$?
5027   echo "$as_me:5027: \$? = $ac_status" >&5
5028   (exit $ac_status); } &&
5029          { ac_try='test -s conftest.$ac_objext'
5030   { (eval echo "$as_me:5030: \"$ac_try\"") >&5
5031   (eval $ac_try) 2>&5
5032   ac_status=$?
5033   echo "$as_me:5033: \$? = $ac_status" >&5
5034   (exit $ac_status); }; }; then
5035   cf_cv_xopen_source=no
5036 else
5037   echo "$as_me: failed program was:" >&5
5038 cat conftest.$ac_ext >&5
5039 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5040 fi
5041 rm -f conftest.$ac_objext conftest.$ac_ext
5042         CPPFLAGS="$cf_save"
5043
5044 fi
5045 rm -f conftest.$ac_objext conftest.$ac_ext
5046
5047 fi
5048 echo "$as_me:5048: result: $cf_cv_xopen_source" >&5
5049 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5050
5051 if test "$cf_cv_xopen_source" != no ; then
5052
5053 CFLAGS=`echo "$CFLAGS" | \
5054         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5055                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5056
5057 CPPFLAGS=`echo "$CPPFLAGS" | \
5058         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5059                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5060
5061         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5062
5063 cf_fix_cppflags=no
5064 cf_new_cflags=
5065 cf_new_cppflags=
5066 cf_new_extra_cppflags=
5067
5068 for cf_add_cflags in $cf_temp_xopen_source
5069 do
5070 case $cf_fix_cppflags in
5071 (no)
5072         case $cf_add_cflags in
5073         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5074                 case $cf_add_cflags in
5075                 (-D*)
5076                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5077
5078                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5079                                 && test -z "${cf_tst_cflags}" \
5080                                 && cf_fix_cppflags=yes
5081
5082                         if test $cf_fix_cppflags = yes ; then
5083
5084         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5085         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5086
5087                                 continue
5088                         elif test "${cf_tst_cflags}" = "\"'" ; then
5089
5090         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5091         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5092
5093                                 continue
5094                         fi
5095                         ;;
5096                 esac
5097                 case "$CPPFLAGS" in
5098                 (*$cf_add_cflags)
5099                         ;;
5100                 (*)
5101                         case $cf_add_cflags in
5102                         (-D*)
5103                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5104
5105 CPPFLAGS=`echo "$CPPFLAGS" | \
5106         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5107                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5108
5109                                 ;;
5110                         esac
5111
5112         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5113         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5114
5115                         ;;
5116                 esac
5117                 ;;
5118         (*)
5119
5120         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5121         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5122
5123                 ;;
5124         esac
5125         ;;
5126 (yes)
5127
5128         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5129         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5130
5131         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5132
5133         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5134                 && test -z "${cf_tst_cflags}" \
5135                 && cf_fix_cppflags=no
5136         ;;
5137 esac
5138 done
5139
5140 if test -n "$cf_new_cflags" ; then
5141
5142         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5143         CFLAGS="${CFLAGS}$cf_new_cflags"
5144
5145 fi
5146
5147 if test -n "$cf_new_cppflags" ; then
5148
5149         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5150         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5151
5152 fi
5153
5154 if test -n "$cf_new_extra_cppflags" ; then
5155
5156         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5157         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5158
5159 fi
5160
5161 fi
5162
5163         fi
5164 fi
5165 fi # cf_cv_posix_visible
5166
5167 echo "$as_me:5167: checking for signal global datatype" >&5
5168 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5169 if test "${cf_cv_sig_atomic_t+set}" = set; then
5170   echo $ECHO_N "(cached) $ECHO_C" >&6
5171 else
5172
5173         for cf_type in \
5174                 "volatile sig_atomic_t" \
5175                 "sig_atomic_t" \
5176                 "int"
5177         do
5178         cat >conftest.$ac_ext <<_ACEOF
5179 #line 5179 "configure"
5180 #include "confdefs.h"
5181
5182 #include <sys/types.h>
5183 #include <signal.h>
5184 #include <stdio.h>
5185
5186 extern $cf_type x;
5187 $cf_type x;
5188 static void handler(int sig)
5189 {
5190         x = 5;
5191 }
5192 int
5193 main (void)
5194 {
5195 signal(SIGINT, handler);
5196                  x = 1
5197   ;
5198   return 0;
5199 }
5200 _ACEOF
5201 rm -f conftest.$ac_objext
5202 if { (eval echo "$as_me:5202: \"$ac_compile\"") >&5
5203   (eval $ac_compile) 2>&5
5204   ac_status=$?
5205   echo "$as_me:5205: \$? = $ac_status" >&5
5206   (exit $ac_status); } &&
5207          { ac_try='test -s conftest.$ac_objext'
5208   { (eval echo "$as_me:5208: \"$ac_try\"") >&5
5209   (eval $ac_try) 2>&5
5210   ac_status=$?
5211   echo "$as_me:5211: \$? = $ac_status" >&5
5212   (exit $ac_status); }; }; then
5213   cf_cv_sig_atomic_t=$cf_type
5214 else
5215   echo "$as_me: failed program was:" >&5
5216 cat conftest.$ac_ext >&5
5217 cf_cv_sig_atomic_t=no
5218 fi
5219 rm -f conftest.$ac_objext conftest.$ac_ext
5220                 test "$cf_cv_sig_atomic_t" != no && break
5221         done
5222
5223 fi
5224
5225 echo "$as_me:5225: result: $cf_cv_sig_atomic_t" >&5
5226 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5227 test "$cf_cv_sig_atomic_t" != no &&
5228 cat >>confdefs.h <<EOF
5229 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5230 EOF
5231
5232 # Work around breakage on OS X
5233
5234 echo "$as_me:5234: checking if SIGWINCH is defined" >&5
5235 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5236 if test "${cf_cv_define_sigwinch+set}" = set; then
5237   echo $ECHO_N "(cached) $ECHO_C" >&6
5238 else
5239
5240         cat >conftest.$ac_ext <<_ACEOF
5241 #line 5241 "configure"
5242 #include "confdefs.h"
5243
5244 #include <sys/types.h>
5245 #include <sys/signal.h>
5246
5247 int
5248 main (void)
5249 {
5250 int x = SIGWINCH
5251   ;
5252   return 0;
5253 }
5254 _ACEOF
5255 rm -f conftest.$ac_objext
5256 if { (eval echo "$as_me:5256: \"$ac_compile\"") >&5
5257   (eval $ac_compile) 2>&5
5258   ac_status=$?
5259   echo "$as_me:5259: \$? = $ac_status" >&5
5260   (exit $ac_status); } &&
5261          { ac_try='test -s conftest.$ac_objext'
5262   { (eval echo "$as_me:5262: \"$ac_try\"") >&5
5263   (eval $ac_try) 2>&5
5264   ac_status=$?
5265   echo "$as_me:5265: \$? = $ac_status" >&5
5266   (exit $ac_status); }; }; then
5267   cf_cv_define_sigwinch=yes
5268 else
5269   echo "$as_me: failed program was:" >&5
5270 cat conftest.$ac_ext >&5
5271 cat >conftest.$ac_ext <<_ACEOF
5272 #line 5272 "configure"
5273 #include "confdefs.h"
5274
5275 #undef _XOPEN_SOURCE
5276 #undef _POSIX_SOURCE
5277 #undef _POSIX_C_SOURCE
5278 #include <sys/types.h>
5279 #include <sys/signal.h>
5280
5281 int
5282 main (void)
5283 {
5284 int x = SIGWINCH
5285   ;
5286   return 0;
5287 }
5288 _ACEOF
5289 rm -f conftest.$ac_objext
5290 if { (eval echo "$as_me:5290: \"$ac_compile\"") >&5
5291   (eval $ac_compile) 2>&5
5292   ac_status=$?
5293   echo "$as_me:5293: \$? = $ac_status" >&5
5294   (exit $ac_status); } &&
5295          { ac_try='test -s conftest.$ac_objext'
5296   { (eval echo "$as_me:5296: \"$ac_try\"") >&5
5297   (eval $ac_try) 2>&5
5298   ac_status=$?
5299   echo "$as_me:5299: \$? = $ac_status" >&5
5300   (exit $ac_status); }; }; then
5301   cf_cv_define_sigwinch=maybe
5302 else
5303   echo "$as_me: failed program was:" >&5
5304 cat conftest.$ac_ext >&5
5305 cf_cv_define_sigwinch=no
5306 fi
5307 rm -f conftest.$ac_objext conftest.$ac_ext
5308
5309 fi
5310 rm -f conftest.$ac_objext conftest.$ac_ext
5311
5312 fi
5313 echo "$as_me:5313: result: $cf_cv_define_sigwinch" >&5
5314 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5315
5316 if test "$cf_cv_define_sigwinch" = maybe ; then
5317 echo "$as_me:5317: checking for actual SIGWINCH definition" >&5
5318 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5319 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5320   echo $ECHO_N "(cached) $ECHO_C" >&6
5321 else
5322
5323 cf_cv_fixup_sigwinch=unknown
5324 cf_sigwinch=32
5325 while test $cf_sigwinch != 1
5326 do
5327         cat >conftest.$ac_ext <<_ACEOF
5328 #line 5328 "configure"
5329 #include "confdefs.h"
5330
5331 #undef _XOPEN_SOURCE
5332 #undef _POSIX_SOURCE
5333 #undef _POSIX_C_SOURCE
5334 #include <sys/types.h>
5335 #include <sys/signal.h>
5336
5337 int
5338 main (void)
5339 {
5340
5341 #if SIGWINCH != $cf_sigwinch
5342 make an error
5343 #endif
5344 int x = SIGWINCH
5345   ;
5346   return 0;
5347 }
5348 _ACEOF
5349 rm -f conftest.$ac_objext
5350 if { (eval echo "$as_me:5350: \"$ac_compile\"") >&5
5351   (eval $ac_compile) 2>&5
5352   ac_status=$?
5353   echo "$as_me:5353: \$? = $ac_status" >&5
5354   (exit $ac_status); } &&
5355          { ac_try='test -s conftest.$ac_objext'
5356   { (eval echo "$as_me:5356: \"$ac_try\"") >&5
5357   (eval $ac_try) 2>&5
5358   ac_status=$?
5359   echo "$as_me:5359: \$? = $ac_status" >&5
5360   (exit $ac_status); }; }; then
5361   cf_cv_fixup_sigwinch=$cf_sigwinch
5362          break
5363 else
5364   echo "$as_me: failed program was:" >&5
5365 cat conftest.$ac_ext >&5
5366 fi
5367 rm -f conftest.$ac_objext conftest.$ac_ext
5368
5369 cf_sigwinch=`expr $cf_sigwinch - 1`
5370 done
5371
5372 fi
5373 echo "$as_me:5373: result: $cf_cv_fixup_sigwinch" >&5
5374 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5375
5376         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5377                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5378         fi
5379 fi
5380
5381 # Checks for CODESET support.
5382
5383 echo "$as_me:5383: checking for nl_langinfo and CODESET" >&5
5384 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5385 if test "${am_cv_langinfo_codeset+set}" = set; then
5386   echo $ECHO_N "(cached) $ECHO_C" >&6
5387 else
5388   cat >conftest.$ac_ext <<_ACEOF
5389 #line 5389 "configure"
5390 #include "confdefs.h"
5391 #include <langinfo.h>
5392 int
5393 main (void)
5394 {
5395 char* cs = nl_langinfo(CODESET);
5396   ;
5397   return 0;
5398 }
5399 _ACEOF
5400 rm -f conftest.$ac_objext conftest$ac_exeext
5401 if { (eval echo "$as_me:5401: \"$ac_link\"") >&5
5402   (eval $ac_link) 2>&5
5403   ac_status=$?
5404   echo "$as_me:5404: \$? = $ac_status" >&5
5405   (exit $ac_status); } &&
5406          { ac_try='test -s conftest$ac_exeext'
5407   { (eval echo "$as_me:5407: \"$ac_try\"") >&5
5408   (eval $ac_try) 2>&5
5409   ac_status=$?
5410   echo "$as_me:5410: \$? = $ac_status" >&5
5411   (exit $ac_status); }; }; then
5412   am_cv_langinfo_codeset=yes
5413 else
5414   echo "$as_me: failed program was:" >&5
5415 cat conftest.$ac_ext >&5
5416 am_cv_langinfo_codeset=no
5417 fi
5418 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5419
5420 fi
5421 echo "$as_me:5421: result: $am_cv_langinfo_codeset" >&5
5422 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5423         if test $am_cv_langinfo_codeset = yes; then
5424
5425 cat >>confdefs.h <<\EOF
5426 #define HAVE_LANGINFO_CODESET 1
5427 EOF
5428
5429         fi
5430
5431 echo "$as_me:5431: checking if you want to use pkg-config" >&5
5432 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5433
5434 # Check whether --with-pkg-config or --without-pkg-config was given.
5435 if test "${with_pkg_config+set}" = set; then
5436   withval="$with_pkg_config"
5437   cf_pkg_config=$withval
5438 else
5439   cf_pkg_config=yes
5440 fi;
5441 echo "$as_me:5441: result: $cf_pkg_config" >&5
5442 echo "${ECHO_T}$cf_pkg_config" >&6
5443
5444 case $cf_pkg_config in
5445 (no)
5446         PKG_CONFIG=none
5447         ;;
5448 (yes)
5449
5450 if test -n "$ac_tool_prefix"; then
5451   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5452 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5453 echo "$as_me:5453: checking for $ac_word" >&5
5454 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5455 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5456   echo $ECHO_N "(cached) $ECHO_C" >&6
5457 else
5458   case $PKG_CONFIG in
5459   [\\/]* | ?:[\\/]*)
5460   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5461   ;;
5462   *)
5463   ac_save_IFS=$IFS; IFS=$ac_path_separator
5464 ac_dummy="$PATH"
5465 for ac_dir in $ac_dummy; do
5466   IFS=$ac_save_IFS
5467   test -z "$ac_dir" && ac_dir=.
5468   if $as_executable_p "$ac_dir/$ac_word"; then
5469    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5470    echo "$as_me:5470: found $ac_dir/$ac_word" >&5
5471    break
5472 fi
5473 done
5474
5475   ;;
5476 esac
5477 fi
5478 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5479
5480 if test -n "$PKG_CONFIG"; then
5481   echo "$as_me:5481: result: $PKG_CONFIG" >&5
5482 echo "${ECHO_T}$PKG_CONFIG" >&6
5483 else
5484   echo "$as_me:5484: result: no" >&5
5485 echo "${ECHO_T}no" >&6
5486 fi
5487
5488 fi
5489 if test -z "$ac_cv_path_PKG_CONFIG"; then
5490   ac_pt_PKG_CONFIG=$PKG_CONFIG
5491   # Extract the first word of "pkg-config", so it can be a program name with args.
5492 set dummy pkg-config; ac_word=$2
5493 echo "$as_me:5493: checking for $ac_word" >&5
5494 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5495 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5496   echo $ECHO_N "(cached) $ECHO_C" >&6
5497 else
5498   case $ac_pt_PKG_CONFIG in
5499   [\\/]* | ?:[\\/]*)
5500   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5501   ;;
5502   *)
5503   ac_save_IFS=$IFS; IFS=$ac_path_separator
5504 ac_dummy="$PATH"
5505 for ac_dir in $ac_dummy; do
5506   IFS=$ac_save_IFS
5507   test -z "$ac_dir" && ac_dir=.
5508   if $as_executable_p "$ac_dir/$ac_word"; then
5509    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5510    echo "$as_me:5510: found $ac_dir/$ac_word" >&5
5511    break
5512 fi
5513 done
5514
5515   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5516   ;;
5517 esac
5518 fi
5519 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5520
5521 if test -n "$ac_pt_PKG_CONFIG"; then
5522   echo "$as_me:5522: result: $ac_pt_PKG_CONFIG" >&5
5523 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5524 else
5525   echo "$as_me:5525: result: no" >&5
5526 echo "${ECHO_T}no" >&6
5527 fi
5528
5529   PKG_CONFIG=$ac_pt_PKG_CONFIG
5530 else
5531   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5532 fi
5533
5534         ;;
5535 (*)
5536         PKG_CONFIG=$withval
5537         ;;
5538 esac
5539
5540 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5541 if test "$PKG_CONFIG" != none ; then
5542
5543 if test "x$prefix" != xNONE; then
5544         cf_path_syntax="$prefix"
5545 else
5546         cf_path_syntax="$ac_default_prefix"
5547 fi
5548
5549 case ".$PKG_CONFIG" in
5550 (.\$\(*\)*|.\'*\'*)
5551         ;;
5552 (..|./*|.\\*)
5553         ;;
5554 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5555         ;;
5556 (.\${*prefix}*|.\${*dir}*)
5557         eval PKG_CONFIG="$PKG_CONFIG"
5558         case ".$PKG_CONFIG" in
5559         (.NONE/*)
5560                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5561                 ;;
5562         esac
5563         ;;
5564 (.no|.NONE/*)
5565         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5566         ;;
5567 (*)
5568         { { echo "$as_me:5568: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5569 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5570    { (exit 1); exit 1; }; }
5571         ;;
5572 esac
5573
5574 elif test "x$cf_pkg_config" != xno ; then
5575         { echo "$as_me:5575: WARNING: pkg-config is not installed" >&5
5576 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5577 fi
5578
5579 echo "$as_me:5579: checking if you want to see long compiling messages" >&5
5580 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5581
5582 # Check whether --enable-echo or --disable-echo was given.
5583 if test "${enable_echo+set}" = set; then
5584   enableval="$enable_echo"
5585   test "$enableval" != no && enableval=yes
5586         if test "$enableval" != "yes" ; then
5587
5588         ECHO_LT='--silent'
5589         ECHO_LD='@echo linking $@;'
5590         RULE_CC='@echo compiling $<'
5591         SHOW_CC='@echo compiling $@'
5592         ECHO_CC='@'
5593
5594         else
5595
5596         ECHO_LT=''
5597         ECHO_LD=''
5598         RULE_CC=''
5599         SHOW_CC=''
5600         ECHO_CC=''
5601
5602         fi
5603 else
5604   enableval=yes
5605
5606         ECHO_LT=''
5607         ECHO_LD=''
5608         RULE_CC=''
5609         SHOW_CC=''
5610         ECHO_CC=''
5611
5612 fi;
5613 echo "$as_me:5613: result: $enableval" >&5
5614 echo "${ECHO_T}$enableval" >&6
5615
5616 echo "$as_me:5616: checking for ncurses wrap-prefix" >&5
5617 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5618
5619 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5620 if test "${with_ncurses_wrap_prefix+set}" = set; then
5621   withval="$with_ncurses_wrap_prefix"
5622   NCURSES_WRAP_PREFIX=$withval
5623 else
5624   NCURSES_WRAP_PREFIX=_nc_
5625 fi;
5626 echo "$as_me:5626: result: $NCURSES_WRAP_PREFIX" >&5
5627 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5628
5629 echo "$as_me:5629: checking if you want to check for wide-character functions" >&5
5630 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5631
5632 # Check whether --enable-widec or --disable-widec was given.
5633 if test "${enable_widec+set}" = set; then
5634   enableval="$enable_widec"
5635   test "$enableval" != no && enableval=yes
5636         if test "$enableval" != "yes" ; then
5637     cf_enable_widec=no
5638         else
5639                 cf_enable_widec=yes
5640         fi
5641 else
5642   enableval=yes
5643         cf_enable_widec=yes
5644
5645 fi;
5646 echo "$as_me:5646: result: $cf_enable_widec" >&5
5647 echo "${ECHO_T}$cf_enable_widec" >&6
5648
5649 echo "$as_me:5649: checking for specific curses-directory" >&5
5650 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5651
5652 # Check whether --with-curses-dir or --without-curses-dir was given.
5653 if test "${with_curses_dir+set}" = set; then
5654   withval="$with_curses_dir"
5655   cf_cv_curses_dir=$withval
5656 else
5657   cf_cv_curses_dir=no
5658 fi;
5659 echo "$as_me:5659: result: $cf_cv_curses_dir" >&5
5660 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5661
5662 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5663 then
5664
5665 if test "x$prefix" != xNONE; then
5666         cf_path_syntax="$prefix"
5667 else
5668         cf_path_syntax="$ac_default_prefix"
5669 fi
5670
5671 case ".$withval" in
5672 (.\$\(*\)*|.\'*\'*)
5673         ;;
5674 (..|./*|.\\*)
5675         ;;
5676 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5677         ;;
5678 (.\${*prefix}*|.\${*dir}*)
5679         eval withval="$withval"
5680         case ".$withval" in
5681         (.NONE/*)
5682                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5683                 ;;
5684         esac
5685         ;;
5686 (.no|.NONE/*)
5687         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5688         ;;
5689 (*)
5690         { { echo "$as_me:5690: error: expected a pathname, not \"$withval\"" >&5
5691 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5692    { (exit 1); exit 1; }; }
5693         ;;
5694 esac
5695
5696         if test -d "$cf_cv_curses_dir"
5697         then
5698
5699 if test -n "$cf_cv_curses_dir/include" ; then
5700   for cf_add_incdir in $cf_cv_curses_dir/include
5701   do
5702         while test $cf_add_incdir != /usr/include
5703         do
5704           if test -d $cf_add_incdir
5705           then
5706                 cf_have_incdir=no
5707                 if test -n "$CFLAGS$CPPFLAGS" ; then
5708                   # a loop is needed to ensure we can add subdirs of existing dirs
5709                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5710                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5711                           cf_have_incdir=yes; break
5712                         fi
5713                   done
5714                 fi
5715
5716                 if test "$cf_have_incdir" = no ; then
5717                   if test "$cf_add_incdir" = /usr/local/include ; then
5718                         if test "$GCC" = yes
5719                         then
5720                           cf_save_CPPFLAGS=$CPPFLAGS
5721
5722         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5723         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5724
5725                           cat >conftest.$ac_ext <<_ACEOF
5726 #line 5726 "configure"
5727 #include "confdefs.h"
5728 #include <stdio.h>
5729 int
5730 main (void)
5731 {
5732 printf("Hello")
5733   ;
5734   return 0;
5735 }
5736 _ACEOF
5737 rm -f conftest.$ac_objext
5738 if { (eval echo "$as_me:5738: \"$ac_compile\"") >&5
5739   (eval $ac_compile) 2>&5
5740   ac_status=$?
5741   echo "$as_me:5741: \$? = $ac_status" >&5
5742   (exit $ac_status); } &&
5743          { ac_try='test -s conftest.$ac_objext'
5744   { (eval echo "$as_me:5744: \"$ac_try\"") >&5
5745   (eval $ac_try) 2>&5
5746   ac_status=$?
5747   echo "$as_me:5747: \$? = $ac_status" >&5
5748   (exit $ac_status); }; }; then
5749   :
5750 else
5751   echo "$as_me: failed program was:" >&5
5752 cat conftest.$ac_ext >&5
5753 cf_have_incdir=yes
5754 fi
5755 rm -f conftest.$ac_objext conftest.$ac_ext
5756                           CPPFLAGS=$cf_save_CPPFLAGS
5757                         fi
5758                   fi
5759                 fi
5760
5761                 if test "$cf_have_incdir" = no ; then
5762                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5763
5764 echo "${as_me:-configure}:5764: testing adding $cf_add_incdir to include-path ..." 1>&5
5765
5766                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5767
5768                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5769                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5770                   cf_add_incdir="$cf_top_incdir"
5771                 else
5772                   break
5773                 fi
5774           else
5775                 break
5776           fi
5777         done
5778   done
5779 fi
5780
5781 if test -n "$cf_cv_curses_dir/lib" ; then
5782         for cf_add_libdir in $cf_cv_curses_dir/lib
5783         do
5784                 if test $cf_add_libdir = /usr/lib ; then
5785                         :
5786                 elif test -d $cf_add_libdir
5787                 then
5788                         cf_have_libdir=no
5789                         if test -n "$LDFLAGS$LIBS" ; then
5790                                 # a loop is needed to ensure we can add subdirs of existing dirs
5791                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5792                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5793                                                 cf_have_libdir=yes; break
5794                                         fi
5795                                 done
5796                         fi
5797                         if test "$cf_have_libdir" = no ; then
5798                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5799
5800 echo "${as_me:-configure}:5800: testing adding $cf_add_libdir to library-path ..." 1>&5
5801
5802                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5803                         fi
5804                 fi
5805         done
5806 fi
5807
5808         fi
5809 fi
5810
5811 cf_cv_screen=curses
5812
5813 echo "$as_me:5813: checking for specified curses library type" >&5
5814 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5815
5816 # Check whether --with-screen or --without-screen was given.
5817 if test "${with_screen+set}" = set; then
5818   withval="$with_screen"
5819   cf_cv_screen=$withval
5820 else
5821
5822 # Check whether --with-ncursesw or --without-ncursesw was given.
5823 if test "${with_ncursesw+set}" = set; then
5824   withval="$with_ncursesw"
5825   cf_cv_screen=ncursesw
5826 else
5827
5828 # Check whether --with-ncurses or --without-ncurses was given.
5829 if test "${with_ncurses+set}" = set; then
5830   withval="$with_ncurses"
5831   cf_cv_screen=ncurses
5832 else
5833
5834 # Check whether --with-pdcurses or --without-pdcurses was given.
5835 if test "${with_pdcurses+set}" = set; then
5836   withval="$with_pdcurses"
5837   cf_cv_screen=pdcurses
5838 else
5839
5840 # Check whether --with-curses-colr or --without-curses-colr was given.
5841 if test "${with_curses_colr+set}" = set; then
5842   withval="$with_curses_colr"
5843   cf_cv_screen=curses_colr
5844 else
5845
5846 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5847 if test "${with_curses_5lib+set}" = set; then
5848   withval="$with_curses_5lib"
5849   cf_cv_screen=curses_5lib
5850 fi;
5851 fi;
5852 fi;
5853 fi;
5854 fi;
5855 fi;
5856
5857 echo "$as_me:5857: result: $cf_cv_screen" >&5
5858 echo "${ECHO_T}$cf_cv_screen" >&6
5859
5860 case $cf_cv_screen in
5861 (curses|curses_*)
5862
5863 echo "$as_me:5863: checking for extra include directories" >&5
5864 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5865 if test "${cf_cv_curses_incdir+set}" = set; then
5866   echo $ECHO_N "(cached) $ECHO_C" >&6
5867 else
5868
5869 cf_cv_curses_incdir=no
5870 case $host_os in
5871 (hpux10.*)
5872         if test "x$cf_cv_screen" = "xcurses_colr"
5873         then
5874                 test -d /usr/include/curses_colr && \
5875                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5876         fi
5877         ;;
5878 (sunos3*|sunos4*)
5879         if test "x$cf_cv_screen" = "xcurses_5lib"
5880         then
5881                 test -d /usr/5lib && \
5882                 test -d /usr/5include && \
5883                 cf_cv_curses_incdir="-I/usr/5include"
5884         fi
5885         ;;
5886 esac
5887
5888 fi
5889 echo "$as_me:5889: result: $cf_cv_curses_incdir" >&5
5890 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5891 if test "$cf_cv_curses_incdir" != no
5892 then
5893
5894         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5895         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
5896
5897 fi
5898
5899 echo "$as_me:5899: checking if we have identified curses headers" >&5
5900 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5901 if test "${cf_cv_ncurses_header+set}" = set; then
5902   echo $ECHO_N "(cached) $ECHO_C" >&6
5903 else
5904
5905 cf_cv_ncurses_header=none
5906 for cf_header in \
5907         ncurses.h  \
5908         curses.h  ncurses/ncurses.h ncurses/curses.h
5909 do
5910 cat >conftest.$ac_ext <<_ACEOF
5911 #line 5911 "configure"
5912 #include "confdefs.h"
5913 #include <${cf_header}>
5914 int
5915 main (void)
5916 {
5917 initscr(); tgoto("?", 0,0)
5918   ;
5919   return 0;
5920 }
5921 _ACEOF
5922 rm -f conftest.$ac_objext
5923 if { (eval echo "$as_me:5923: \"$ac_compile\"") >&5
5924   (eval $ac_compile) 2>&5
5925   ac_status=$?
5926   echo "$as_me:5926: \$? = $ac_status" >&5
5927   (exit $ac_status); } &&
5928          { ac_try='test -s conftest.$ac_objext'
5929   { (eval echo "$as_me:5929: \"$ac_try\"") >&5
5930   (eval $ac_try) 2>&5
5931   ac_status=$?
5932   echo "$as_me:5932: \$? = $ac_status" >&5
5933   (exit $ac_status); }; }; then
5934   cf_cv_ncurses_header=$cf_header; break
5935 else
5936   echo "$as_me: failed program was:" >&5
5937 cat conftest.$ac_ext >&5
5938 fi
5939 rm -f conftest.$ac_objext conftest.$ac_ext
5940 done
5941
5942 fi
5943 echo "$as_me:5943: result: $cf_cv_ncurses_header" >&5
5944 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5945
5946 if test "$cf_cv_ncurses_header" = none ; then
5947         { { echo "$as_me:5947: error: No curses header-files found" >&5
5948 echo "$as_me: error: No curses header-files found" >&2;}
5949    { (exit 1); exit 1; }; }
5950 fi
5951
5952 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5953
5954 for ac_header in $cf_cv_ncurses_header
5955 do
5956 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5957 echo "$as_me:5957: checking for $ac_header" >&5
5958 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5959 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5960   echo $ECHO_N "(cached) $ECHO_C" >&6
5961 else
5962   cat >conftest.$ac_ext <<_ACEOF
5963 #line 5963 "configure"
5964 #include "confdefs.h"
5965 #include <$ac_header>
5966 _ACEOF
5967 if { (eval echo "$as_me:5967: \"$ac_cpp conftest.$ac_ext\"") >&5
5968   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5969   ac_status=$?
5970   egrep -v '^ *\+' conftest.er1 >conftest.err
5971   rm -f conftest.er1
5972   cat conftest.err >&5
5973   echo "$as_me:5973: \$? = $ac_status" >&5
5974   (exit $ac_status); } >/dev/null; then
5975   if test -s conftest.err; then
5976     ac_cpp_err=$ac_c_preproc_warn_flag
5977   else
5978     ac_cpp_err=
5979   fi
5980 else
5981   ac_cpp_err=yes
5982 fi
5983 if test -z "$ac_cpp_err"; then
5984   eval "$as_ac_Header=yes"
5985 else
5986   echo "$as_me: failed program was:" >&5
5987   cat conftest.$ac_ext >&5
5988   eval "$as_ac_Header=no"
5989 fi
5990 rm -f conftest.err conftest.$ac_ext
5991 fi
5992 echo "$as_me:5992: result: `eval echo '${'$as_ac_Header'}'`" >&5
5993 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5994 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5995   cat >>confdefs.h <<EOF
5996 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5997 EOF
5998
5999 fi
6000 done
6001
6002 echo "$as_me:6002: checking for terminfo header" >&5
6003 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6004 if test "${cf_cv_term_header+set}" = set; then
6005   echo $ECHO_N "(cached) $ECHO_C" >&6
6006 else
6007
6008 case ${cf_cv_ncurses_header} in
6009 (*/ncurses.h|*/ncursesw.h)
6010         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6011         ;;
6012 (*)
6013         cf_term_header=term.h
6014         ;;
6015 esac
6016
6017 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6018 do
6019 cat >conftest.$ac_ext <<_ACEOF
6020 #line 6020 "configure"
6021 #include "confdefs.h"
6022 #include <stdio.h>
6023 #include <${cf_cv_ncurses_header:-curses.h}>
6024 #include <$cf_test>
6025
6026 int
6027 main (void)
6028 {
6029 int x = auto_left_margin
6030   ;
6031   return 0;
6032 }
6033 _ACEOF
6034 rm -f conftest.$ac_objext
6035 if { (eval echo "$as_me:6035: \"$ac_compile\"") >&5
6036   (eval $ac_compile) 2>&5
6037   ac_status=$?
6038   echo "$as_me:6038: \$? = $ac_status" >&5
6039   (exit $ac_status); } &&
6040          { ac_try='test -s conftest.$ac_objext'
6041   { (eval echo "$as_me:6041: \"$ac_try\"") >&5
6042   (eval $ac_try) 2>&5
6043   ac_status=$?
6044   echo "$as_me:6044: \$? = $ac_status" >&5
6045   (exit $ac_status); }; }; then
6046
6047         cf_cv_term_header="$cf_test"
6048 else
6049   echo "$as_me: failed program was:" >&5
6050 cat conftest.$ac_ext >&5
6051
6052         cf_cv_term_header=unknown
6053
6054 fi
6055 rm -f conftest.$ac_objext conftest.$ac_ext
6056         test "$cf_cv_term_header" != unknown && break
6057 done
6058
6059 fi
6060 echo "$as_me:6060: result: $cf_cv_term_header" >&5
6061 echo "${ECHO_T}$cf_cv_term_header" >&6
6062
6063 # Set definitions to allow ifdef'ing to accommodate subdirectories
6064
6065 case $cf_cv_term_header in
6066 (*term.h)
6067
6068 cat >>confdefs.h <<\EOF
6069 #define HAVE_TERM_H 1
6070 EOF
6071
6072         ;;
6073 esac
6074
6075 case $cf_cv_term_header in
6076 (ncurses/term.h)
6077
6078 cat >>confdefs.h <<\EOF
6079 #define HAVE_NCURSES_TERM_H 1
6080 EOF
6081
6082         ;;
6083 (ncursesw/term.h)
6084
6085 cat >>confdefs.h <<\EOF
6086 #define HAVE_NCURSESW_TERM_H 1
6087 EOF
6088
6089         ;;
6090 esac
6091
6092 echo "$as_me:6092: checking for ncurses version" >&5
6093 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6094 if test "${cf_cv_ncurses_version+set}" = set; then
6095   echo $ECHO_N "(cached) $ECHO_C" >&6
6096 else
6097
6098         cf_cv_ncurses_version=no
6099         cf_tempfile=out$$
6100         rm -f $cf_tempfile
6101         if test "$cross_compiling" = yes; then
6102
6103         # This will not work if the preprocessor splits the line after the
6104         # Autoconf token.  The 'unproto' program does that.
6105         cat > conftest.$ac_ext <<EOF
6106 #include <${cf_cv_ncurses_header:-curses.h}>
6107 #undef Autoconf
6108 #ifdef NCURSES_VERSION
6109 Autoconf NCURSES_VERSION
6110 #else
6111 #ifdef __NCURSES_H
6112 Autoconf "old"
6113 #endif
6114 ;
6115 #endif
6116 EOF
6117         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6118         { (eval echo "$as_me:6118: \"$cf_try\"") >&5
6119   (eval $cf_try) 2>&5
6120   ac_status=$?
6121   echo "$as_me:6121: \$? = $ac_status" >&5
6122   (exit $ac_status); }
6123         if test -f conftest.out ; then
6124                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6125                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6126                 rm -f conftest.out
6127         fi
6128
6129 else
6130   cat >conftest.$ac_ext <<_ACEOF
6131 #line 6131 "configure"
6132 #include "confdefs.h"
6133
6134 #include <${cf_cv_ncurses_header:-curses.h}>
6135 #include <stdio.h>
6136 int main(void)
6137 {
6138         FILE *fp = fopen("$cf_tempfile", "w");
6139 #ifdef NCURSES_VERSION
6140 # ifdef NCURSES_VERSION_PATCH
6141         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6142 # else
6143         fprintf(fp, "%s\n", NCURSES_VERSION);
6144 # endif
6145 #else
6146 # ifdef __NCURSES_H
6147         fprintf(fp, "old\n");
6148 # else
6149         make an error
6150 # endif
6151 #endif
6152         ${cf_cv_main_return:-return}(0);
6153 }
6154 _ACEOF
6155 rm -f conftest$ac_exeext
6156 if { (eval echo "$as_me:6156: \"$ac_link\"") >&5
6157   (eval $ac_link) 2>&5
6158   ac_status=$?
6159   echo "$as_me:6159: \$? = $ac_status" >&5
6160   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6161   { (eval echo "$as_me:6161: \"$ac_try\"") >&5
6162   (eval $ac_try) 2>&5
6163   ac_status=$?
6164   echo "$as_me:6164: \$? = $ac_status" >&5
6165   (exit $ac_status); }; }; then
6166
6167         cf_cv_ncurses_version=`cat $cf_tempfile`
6168 else
6169   echo "$as_me: program exited with status $ac_status" >&5
6170 echo "$as_me: failed program was:" >&5
6171 cat conftest.$ac_ext >&5
6172 fi
6173 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6174 fi
6175         rm -f $cf_tempfile
6176
6177 fi
6178 echo "$as_me:6178: result: $cf_cv_ncurses_version" >&5
6179 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6180 test "$cf_cv_ncurses_version" = no ||
6181 cat >>confdefs.h <<\EOF
6182 #define NCURSES 1
6183 EOF
6184
6185 echo "$as_me:6185: checking if we have identified curses libraries" >&5
6186 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6187 cat >conftest.$ac_ext <<_ACEOF
6188 #line 6188 "configure"
6189 #include "confdefs.h"
6190 #include <${cf_cv_ncurses_header:-curses.h}>
6191 int
6192 main (void)
6193 {
6194 initscr(); tgoto("?", 0,0)
6195   ;
6196   return 0;
6197 }
6198 _ACEOF
6199 rm -f conftest.$ac_objext conftest$ac_exeext
6200 if { (eval echo "$as_me:6200: \"$ac_link\"") >&5
6201   (eval $ac_link) 2>&5
6202   ac_status=$?
6203   echo "$as_me:6203: \$? = $ac_status" >&5
6204   (exit $ac_status); } &&
6205          { ac_try='test -s conftest$ac_exeext'
6206   { (eval echo "$as_me:6206: \"$ac_try\"") >&5
6207   (eval $ac_try) 2>&5
6208   ac_status=$?
6209   echo "$as_me:6209: \$? = $ac_status" >&5
6210   (exit $ac_status); }; }; then
6211   cf_result=yes
6212 else
6213   echo "$as_me: failed program was:" >&5
6214 cat conftest.$ac_ext >&5
6215 cf_result=no
6216 fi
6217 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6218 echo "$as_me:6218: result: $cf_result" >&5
6219 echo "${ECHO_T}$cf_result" >&6
6220
6221 if test "$cf_result" = no ; then
6222 case $host_os in
6223 (freebsd*)
6224         echo "$as_me:6224: checking for tgoto in -lmytinfo" >&5
6225 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6226 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6227   echo $ECHO_N "(cached) $ECHO_C" >&6
6228 else
6229   ac_check_lib_save_LIBS=$LIBS
6230 LIBS="-lmytinfo  $LIBS"
6231 cat >conftest.$ac_ext <<_ACEOF
6232 #line 6232 "configure"
6233 #include "confdefs.h"
6234
6235 /* Override any gcc2 internal prototype to avoid an error.  */
6236 #ifdef __cplusplus
6237 extern "C"
6238 #endif
6239 /* We use char because int might match the return type of a gcc2
6240    builtin and then its argument prototype would still apply.  */
6241 char tgoto ();
6242 int
6243 main (void)
6244 {
6245 tgoto ();
6246   ;
6247   return 0;
6248 }
6249 _ACEOF
6250 rm -f conftest.$ac_objext conftest$ac_exeext
6251 if { (eval echo "$as_me:6251: \"$ac_link\"") >&5
6252   (eval $ac_link) 2>&5
6253   ac_status=$?
6254   echo "$as_me:6254: \$? = $ac_status" >&5
6255   (exit $ac_status); } &&
6256          { ac_try='test -s conftest$ac_exeext'
6257   { (eval echo "$as_me:6257: \"$ac_try\"") >&5
6258   (eval $ac_try) 2>&5
6259   ac_status=$?
6260   echo "$as_me:6260: \$? = $ac_status" >&5
6261   (exit $ac_status); }; }; then
6262   ac_cv_lib_mytinfo_tgoto=yes
6263 else
6264   echo "$as_me: failed program was:" >&5
6265 cat conftest.$ac_ext >&5
6266 ac_cv_lib_mytinfo_tgoto=no
6267 fi
6268 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6269 LIBS=$ac_check_lib_save_LIBS
6270 fi
6271 echo "$as_me:6271: result: $ac_cv_lib_mytinfo_tgoto" >&5
6272 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6273 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6274
6275 cf_add_libs="-lmytinfo"
6276 # Filter out duplicates - this happens with badly-designed ".pc" files...
6277 for cf_add_1lib in $LIBS
6278 do
6279         for cf_add_2lib in $cf_add_libs
6280         do
6281                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6282                 then
6283                         cf_add_1lib=
6284                         break
6285                 fi
6286         done
6287         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6288 done
6289 LIBS="$cf_add_libs"
6290
6291 fi
6292
6293         ;;
6294 (hpux10.*)
6295         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6296         # next (1998), and xcurses "newer" (2000).  There is no header file for
6297         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6298         # term.h) for cur_colr
6299         if test "x$cf_cv_screen" = "xcurses_colr"
6300         then
6301                 echo "$as_me:6301: checking for initscr in -lcur_colr" >&5
6302 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6303 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6304   echo $ECHO_N "(cached) $ECHO_C" >&6
6305 else
6306   ac_check_lib_save_LIBS=$LIBS
6307 LIBS="-lcur_colr  $LIBS"
6308 cat >conftest.$ac_ext <<_ACEOF
6309 #line 6309 "configure"
6310 #include "confdefs.h"
6311
6312 /* Override any gcc2 internal prototype to avoid an error.  */
6313 #ifdef __cplusplus
6314 extern "C"
6315 #endif
6316 /* We use char because int might match the return type of a gcc2
6317    builtin and then its argument prototype would still apply.  */
6318 char initscr ();
6319 int
6320 main (void)
6321 {
6322 initscr ();
6323   ;
6324   return 0;
6325 }
6326 _ACEOF
6327 rm -f conftest.$ac_objext conftest$ac_exeext
6328 if { (eval echo "$as_me:6328: \"$ac_link\"") >&5
6329   (eval $ac_link) 2>&5
6330   ac_status=$?
6331   echo "$as_me:6331: \$? = $ac_status" >&5
6332   (exit $ac_status); } &&
6333          { ac_try='test -s conftest$ac_exeext'
6334   { (eval echo "$as_me:6334: \"$ac_try\"") >&5
6335   (eval $ac_try) 2>&5
6336   ac_status=$?
6337   echo "$as_me:6337: \$? = $ac_status" >&5
6338   (exit $ac_status); }; }; then
6339   ac_cv_lib_cur_colr_initscr=yes
6340 else
6341   echo "$as_me: failed program was:" >&5
6342 cat conftest.$ac_ext >&5
6343 ac_cv_lib_cur_colr_initscr=no
6344 fi
6345 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6346 LIBS=$ac_check_lib_save_LIBS
6347 fi
6348 echo "$as_me:6348: result: $ac_cv_lib_cur_colr_initscr" >&5
6349 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6350 if test $ac_cv_lib_cur_colr_initscr = yes; then
6351
6352 cf_add_libs="-lcur_colr"
6353 # Filter out duplicates - this happens with badly-designed ".pc" files...
6354 for cf_add_1lib in $LIBS
6355 do
6356         for cf_add_2lib in $cf_add_libs
6357         do
6358                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6359                 then
6360                         cf_add_1lib=
6361                         break
6362                 fi
6363         done
6364         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6365 done
6366 LIBS="$cf_add_libs"
6367
6368                         ac_cv_func_initscr=yes
6369
6370 else
6371
6372                 echo "$as_me:6372: checking for initscr in -lHcurses" >&5
6373 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6374 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6375   echo $ECHO_N "(cached) $ECHO_C" >&6
6376 else
6377   ac_check_lib_save_LIBS=$LIBS
6378 LIBS="-lHcurses  $LIBS"
6379 cat >conftest.$ac_ext <<_ACEOF
6380 #line 6380 "configure"
6381 #include "confdefs.h"
6382
6383 /* Override any gcc2 internal prototype to avoid an error.  */
6384 #ifdef __cplusplus
6385 extern "C"
6386 #endif
6387 /* We use char because int might match the return type of a gcc2
6388    builtin and then its argument prototype would still apply.  */
6389 char initscr ();
6390 int
6391 main (void)
6392 {
6393 initscr ();
6394   ;
6395   return 0;
6396 }
6397 _ACEOF
6398 rm -f conftest.$ac_objext conftest$ac_exeext
6399 if { (eval echo "$as_me:6399: \"$ac_link\"") >&5
6400   (eval $ac_link) 2>&5
6401   ac_status=$?
6402   echo "$as_me:6402: \$? = $ac_status" >&5
6403   (exit $ac_status); } &&
6404          { ac_try='test -s conftest$ac_exeext'
6405   { (eval echo "$as_me:6405: \"$ac_try\"") >&5
6406   (eval $ac_try) 2>&5
6407   ac_status=$?
6408   echo "$as_me:6408: \$? = $ac_status" >&5
6409   (exit $ac_status); }; }; then
6410   ac_cv_lib_Hcurses_initscr=yes
6411 else
6412   echo "$as_me: failed program was:" >&5
6413 cat conftest.$ac_ext >&5
6414 ac_cv_lib_Hcurses_initscr=no
6415 fi
6416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6417 LIBS=$ac_check_lib_save_LIBS
6418 fi
6419 echo "$as_me:6419: result: $ac_cv_lib_Hcurses_initscr" >&5
6420 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6421 if test $ac_cv_lib_Hcurses_initscr = yes; then
6422
6423                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6424
6425 cf_add_libs="-lHcurses"
6426 # Filter out duplicates - this happens with badly-designed ".pc" files...
6427 for cf_add_1lib in $LIBS
6428 do
6429         for cf_add_2lib in $cf_add_libs
6430         do
6431                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6432                 then
6433                         cf_add_1lib=
6434                         break
6435                 fi
6436         done
6437         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6438 done
6439 LIBS="$cf_add_libs"
6440
6441         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6442         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6443
6444                         ac_cv_func_initscr=yes
6445
6446 fi
6447
6448 fi
6449
6450         fi
6451         ;;
6452 (linux*)
6453         case `arch 2>/dev/null` in
6454         (x86_64)
6455                 if test -d /lib64
6456                 then
6457
6458 if test -n "/lib64" ; then
6459         for cf_add_libdir in /lib64
6460         do
6461                 if test $cf_add_libdir = /usr/lib ; then
6462                         :
6463                 elif test -d $cf_add_libdir
6464                 then
6465                         cf_have_libdir=no
6466                         if test -n "$LDFLAGS$LIBS" ; then
6467                                 # a loop is needed to ensure we can add subdirs of existing dirs
6468                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6469                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6470                                                 cf_have_libdir=yes; break
6471                                         fi
6472                                 done
6473                         fi
6474                         if test "$cf_have_libdir" = no ; then
6475                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6476
6477 echo "${as_me:-configure}:6477: testing adding $cf_add_libdir to library-path ..." 1>&5
6478
6479                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6480                         fi
6481                 fi
6482         done
6483 fi
6484
6485                 else
6486
6487 if test -n "/lib" ; then
6488         for cf_add_libdir in /lib
6489         do
6490                 if test $cf_add_libdir = /usr/lib ; then
6491                         :
6492                 elif test -d $cf_add_libdir
6493                 then
6494                         cf_have_libdir=no
6495                         if test -n "$LDFLAGS$LIBS" ; then
6496                                 # a loop is needed to ensure we can add subdirs of existing dirs
6497                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6498                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6499                                                 cf_have_libdir=yes; break
6500                                         fi
6501                                 done
6502                         fi
6503                         if test "$cf_have_libdir" = no ; then
6504                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6505
6506 echo "${as_me:-configure}:6506: testing adding $cf_add_libdir to library-path ..." 1>&5
6507
6508                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6509                         fi
6510                 fi
6511         done
6512 fi
6513
6514                 fi
6515                 ;;
6516         (*)
6517
6518 if test -n "/lib" ; then
6519         for cf_add_libdir in /lib
6520         do
6521                 if test $cf_add_libdir = /usr/lib ; then
6522                         :
6523                 elif test -d $cf_add_libdir
6524                 then
6525                         cf_have_libdir=no
6526                         if test -n "$LDFLAGS$LIBS" ; then
6527                                 # a loop is needed to ensure we can add subdirs of existing dirs
6528                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6529                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6530                                                 cf_have_libdir=yes; break
6531                                         fi
6532                                 done
6533                         fi
6534                         if test "$cf_have_libdir" = no ; then
6535                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6536
6537 echo "${as_me:-configure}:6537: testing adding $cf_add_libdir to library-path ..." 1>&5
6538
6539                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6540                         fi
6541                 fi
6542         done
6543 fi
6544
6545                 ;;
6546         esac
6547         ;;
6548 (sunos3*|sunos4*)
6549         if test "x$cf_cv_screen" = "xcurses_5lib"
6550         then
6551                 if test -d /usr/5lib ; then
6552
6553 if test -n "/usr/5lib" ; then
6554         for cf_add_libdir in /usr/5lib
6555         do
6556                 if test $cf_add_libdir = /usr/lib ; then
6557                         :
6558                 elif test -d $cf_add_libdir
6559                 then
6560                         cf_have_libdir=no
6561                         if test -n "$LDFLAGS$LIBS" ; then
6562                                 # a loop is needed to ensure we can add subdirs of existing dirs
6563                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6564                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6565                                                 cf_have_libdir=yes; break
6566                                         fi
6567                                 done
6568                         fi
6569                         if test "$cf_have_libdir" = no ; then
6570                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6571
6572 echo "${as_me:-configure}:6572: testing adding $cf_add_libdir to library-path ..." 1>&5
6573
6574                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6575                         fi
6576                 fi
6577         done
6578 fi
6579
6580 cf_add_libs="-lcurses -ltermcap"
6581 # Filter out duplicates - this happens with badly-designed ".pc" files...
6582 for cf_add_1lib in $LIBS
6583 do
6584         for cf_add_2lib in $cf_add_libs
6585         do
6586                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6587                 then
6588                         cf_add_1lib=
6589                         break
6590                 fi
6591         done
6592         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6593 done
6594 LIBS="$cf_add_libs"
6595
6596                 fi
6597         fi
6598         ac_cv_func_initscr=yes
6599         ;;
6600 esac
6601
6602 if test ".$ac_cv_func_initscr" != .yes ; then
6603         cf_save_LIBS="$LIBS"
6604
6605         if test ".${cf_cv_ncurses_version:-no}" != .no
6606         then
6607                 cf_check_list="ncurses curses cursesX"
6608         else
6609                 cf_check_list="cursesX curses ncurses"
6610         fi
6611
6612         # Check for library containing tgoto.  Do this before curses library
6613         # because it may be needed to link the test-case for initscr.
6614         if test "x$cf_term_lib" = x
6615         then
6616                 echo "$as_me:6616: checking for tgoto" >&5
6617 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6618 if test "${ac_cv_func_tgoto+set}" = set; then
6619   echo $ECHO_N "(cached) $ECHO_C" >&6
6620 else
6621   cat >conftest.$ac_ext <<_ACEOF
6622 #line 6622 "configure"
6623 #include "confdefs.h"
6624 #define tgoto autoconf_temporary
6625 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6626 #undef tgoto
6627
6628 #ifdef __cplusplus
6629 extern "C"
6630 #endif
6631
6632 /* We use char because int might match the return type of a gcc2
6633    builtin and then its argument prototype would still apply.  */
6634 char tgoto (void);
6635
6636 int
6637 main (void)
6638 {
6639
6640 /* The GNU C library defines stubs for functions which it implements
6641     to always fail with ENOSYS.  Some functions are actually named
6642     something starting with __ and the normal name is an alias.  */
6643 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6644 #error found stub for tgoto
6645 #endif
6646
6647         return tgoto ();
6648   ;
6649   return 0;
6650 }
6651 _ACEOF
6652 rm -f conftest.$ac_objext conftest$ac_exeext
6653 if { (eval echo "$as_me:6653: \"$ac_link\"") >&5
6654   (eval $ac_link) 2>&5
6655   ac_status=$?
6656   echo "$as_me:6656: \$? = $ac_status" >&5
6657   (exit $ac_status); } &&
6658          { ac_try='test -s conftest$ac_exeext'
6659   { (eval echo "$as_me:6659: \"$ac_try\"") >&5
6660   (eval $ac_try) 2>&5
6661   ac_status=$?
6662   echo "$as_me:6662: \$? = $ac_status" >&5
6663   (exit $ac_status); }; }; then
6664   ac_cv_func_tgoto=yes
6665 else
6666   echo "$as_me: failed program was:" >&5
6667 cat conftest.$ac_ext >&5
6668 ac_cv_func_tgoto=no
6669 fi
6670 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6671 fi
6672 echo "$as_me:6672: result: $ac_cv_func_tgoto" >&5
6673 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6674 if test $ac_cv_func_tgoto = yes; then
6675   cf_term_lib=predefined
6676 else
6677
6678                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6679                         do
6680                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6681 echo "$as_me:6681: checking for tgoto in -l$cf_term_lib" >&5
6682 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6683 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6684   echo $ECHO_N "(cached) $ECHO_C" >&6
6685 else
6686   ac_check_lib_save_LIBS=$LIBS
6687 LIBS="-l$cf_term_lib  $LIBS"
6688 cat >conftest.$ac_ext <<_ACEOF
6689 #line 6689 "configure"
6690 #include "confdefs.h"
6691
6692 /* Override any gcc2 internal prototype to avoid an error.  */
6693 #ifdef __cplusplus
6694 extern "C"
6695 #endif
6696 /* We use char because int might match the return type of a gcc2
6697    builtin and then its argument prototype would still apply.  */
6698 char tgoto ();
6699 int
6700 main (void)
6701 {
6702 tgoto ();
6703   ;
6704   return 0;
6705 }
6706 _ACEOF
6707 rm -f conftest.$ac_objext conftest$ac_exeext
6708 if { (eval echo "$as_me:6708: \"$ac_link\"") >&5
6709   (eval $ac_link) 2>&5
6710   ac_status=$?
6711   echo "$as_me:6711: \$? = $ac_status" >&5
6712   (exit $ac_status); } &&
6713          { ac_try='test -s conftest$ac_exeext'
6714   { (eval echo "$as_me:6714: \"$ac_try\"") >&5
6715   (eval $ac_try) 2>&5
6716   ac_status=$?
6717   echo "$as_me:6717: \$? = $ac_status" >&5
6718   (exit $ac_status); }; }; then
6719   eval "$as_ac_Lib=yes"
6720 else
6721   echo "$as_me: failed program was:" >&5
6722 cat conftest.$ac_ext >&5
6723 eval "$as_ac_Lib=no"
6724 fi
6725 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6726 LIBS=$ac_check_lib_save_LIBS
6727 fi
6728 echo "$as_me:6728: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6729 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6730 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6731
6732                                         : ${cf_nculib_root:=$cf_term_lib}
6733                                         break
6734
6735 fi
6736
6737                         done
6738
6739 fi
6740
6741         fi
6742
6743         # Check for library containing initscr
6744         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6745         if test "x$cf_curs_lib" = x
6746         then
6747                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6748                 do
6749                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6750                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6751                                 echo "$as_me:6751: checking if we can link with $cf_curs_lib library" >&5
6752 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6753                                 cat >conftest.$ac_ext <<_ACEOF
6754 #line 6754 "configure"
6755 #include "confdefs.h"
6756 #include <${cf_cv_ncurses_header:-curses.h}>
6757 int
6758 main (void)
6759 {
6760 initscr()
6761   ;
6762   return 0;
6763 }
6764 _ACEOF
6765 rm -f conftest.$ac_objext conftest$ac_exeext
6766 if { (eval echo "$as_me:6766: \"$ac_link\"") >&5
6767   (eval $ac_link) 2>&5
6768   ac_status=$?
6769   echo "$as_me:6769: \$? = $ac_status" >&5
6770   (exit $ac_status); } &&
6771          { ac_try='test -s conftest$ac_exeext'
6772   { (eval echo "$as_me:6772: \"$ac_try\"") >&5
6773   (eval $ac_try) 2>&5
6774   ac_status=$?
6775   echo "$as_me:6775: \$? = $ac_status" >&5
6776   (exit $ac_status); }; }; then
6777   cf_result=yes
6778 else
6779   echo "$as_me: failed program was:" >&5
6780 cat conftest.$ac_ext >&5
6781 cf_result=no
6782 fi
6783 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6784                                 echo "$as_me:6784: result: $cf_result" >&5
6785 echo "${ECHO_T}$cf_result" >&6
6786                                 test $cf_result = yes && break
6787                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6788                                 cf_result=no
6789                         elif test "$cf_term_lib" != predefined ; then
6790                                 echo "$as_me:6790: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6791 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6792                                 cat >conftest.$ac_ext <<_ACEOF
6793 #line 6793 "configure"
6794 #include "confdefs.h"
6795 #include <${cf_cv_ncurses_header:-curses.h}>
6796 int
6797 main (void)
6798 {
6799 initscr(); tgoto((char *)0, 0, 0);
6800   ;
6801   return 0;
6802 }
6803 _ACEOF
6804 rm -f conftest.$ac_objext conftest$ac_exeext
6805 if { (eval echo "$as_me:6805: \"$ac_link\"") >&5
6806   (eval $ac_link) 2>&5
6807   ac_status=$?
6808   echo "$as_me:6808: \$? = $ac_status" >&5
6809   (exit $ac_status); } &&
6810          { ac_try='test -s conftest$ac_exeext'
6811   { (eval echo "$as_me:6811: \"$ac_try\"") >&5
6812   (eval $ac_try) 2>&5
6813   ac_status=$?
6814   echo "$as_me:6814: \$? = $ac_status" >&5
6815   (exit $ac_status); }; }; then
6816   cf_result=no
6817 else
6818   echo "$as_me: failed program was:" >&5
6819 cat conftest.$ac_ext >&5
6820
6821                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6822                                         cat >conftest.$ac_ext <<_ACEOF
6823 #line 6823 "configure"
6824 #include "confdefs.h"
6825 #include <${cf_cv_ncurses_header:-curses.h}>
6826 int
6827 main (void)
6828 {
6829 initscr()
6830   ;
6831   return 0;
6832 }
6833 _ACEOF
6834 rm -f conftest.$ac_objext conftest$ac_exeext
6835 if { (eval echo "$as_me:6835: \"$ac_link\"") >&5
6836   (eval $ac_link) 2>&5
6837   ac_status=$?
6838   echo "$as_me:6838: \$? = $ac_status" >&5
6839   (exit $ac_status); } &&
6840          { ac_try='test -s conftest$ac_exeext'
6841   { (eval echo "$as_me:6841: \"$ac_try\"") >&5
6842   (eval $ac_try) 2>&5
6843   ac_status=$?
6844   echo "$as_me:6844: \$? = $ac_status" >&5
6845   (exit $ac_status); }; }; then
6846   cf_result=yes
6847 else
6848   echo "$as_me: failed program was:" >&5
6849 cat conftest.$ac_ext >&5
6850 cf_result=error
6851 fi
6852 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6853
6854 fi
6855 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6856                                 echo "$as_me:6856: result: $cf_result" >&5
6857 echo "${ECHO_T}$cf_result" >&6
6858                                 test $cf_result != error && break
6859                         fi
6860                 done
6861         fi
6862         test $cf_curs_lib = unknown && { { echo "$as_me:6862: error: no curses library found" >&5
6863 echo "$as_me: error: no curses library found" >&2;}
6864    { (exit 1); exit 1; }; }
6865 fi
6866 fi
6867
6868         ;;
6869 (ncursesw*)
6870
6871 echo "$as_me:6871: checking for multibyte character support" >&5
6872 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6873 if test "${cf_cv_utf8_lib+set}" = set; then
6874   echo $ECHO_N "(cached) $ECHO_C" >&6
6875 else
6876
6877         cf_save_LIBS="$LIBS"
6878         cat >conftest.$ac_ext <<_ACEOF
6879 #line 6879 "configure"
6880 #include "confdefs.h"
6881
6882 #include <stdlib.h>
6883 int
6884 main (void)
6885 {
6886 putwc(0,0);
6887   ;
6888   return 0;
6889 }
6890 _ACEOF
6891 rm -f conftest.$ac_objext conftest$ac_exeext
6892 if { (eval echo "$as_me:6892: \"$ac_link\"") >&5
6893   (eval $ac_link) 2>&5
6894   ac_status=$?
6895   echo "$as_me:6895: \$? = $ac_status" >&5
6896   (exit $ac_status); } &&
6897          { ac_try='test -s conftest$ac_exeext'
6898   { (eval echo "$as_me:6898: \"$ac_try\"") >&5
6899   (eval $ac_try) 2>&5
6900   ac_status=$?
6901   echo "$as_me:6901: \$? = $ac_status" >&5
6902   (exit $ac_status); }; }; then
6903   cf_cv_utf8_lib=yes
6904 else
6905   echo "$as_me: failed program was:" >&5
6906 cat conftest.$ac_ext >&5
6907
6908 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6909 # will be set on completion of the AC_TRY_LINK below.
6910 cf_cv_header_path_utf8=
6911 cf_cv_library_path_utf8=
6912
6913 echo "${as_me:-configure}:6913: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6914
6915 cf_save_LIBS="$LIBS"
6916
6917 cat >conftest.$ac_ext <<_ACEOF
6918 #line 6918 "configure"
6919 #include "confdefs.h"
6920
6921 #include <libutf8.h>
6922 int
6923 main (void)
6924 {
6925 putwc(0,0);
6926   ;
6927   return 0;
6928 }
6929 _ACEOF
6930 rm -f conftest.$ac_objext conftest$ac_exeext
6931 if { (eval echo "$as_me:6931: \"$ac_link\"") >&5
6932   (eval $ac_link) 2>&5
6933   ac_status=$?
6934   echo "$as_me:6934: \$? = $ac_status" >&5
6935   (exit $ac_status); } &&
6936          { ac_try='test -s conftest$ac_exeext'
6937   { (eval echo "$as_me:6937: \"$ac_try\"") >&5
6938   (eval $ac_try) 2>&5
6939   ac_status=$?
6940   echo "$as_me:6940: \$? = $ac_status" >&5
6941   (exit $ac_status); }; }; then
6942
6943         cf_cv_find_linkage_utf8=yes
6944         cf_cv_header_path_utf8=/usr/include
6945         cf_cv_library_path_utf8=/usr/lib
6946
6947 else
6948   echo "$as_me: failed program was:" >&5
6949 cat conftest.$ac_ext >&5
6950
6951 LIBS="-lutf8  $cf_save_LIBS"
6952
6953 cat >conftest.$ac_ext <<_ACEOF
6954 #line 6954 "configure"
6955 #include "confdefs.h"
6956
6957 #include <libutf8.h>
6958 int
6959 main (void)
6960 {
6961 putwc(0,0);
6962   ;
6963   return 0;
6964 }
6965 _ACEOF
6966 rm -f conftest.$ac_objext conftest$ac_exeext
6967 if { (eval echo "$as_me:6967: \"$ac_link\"") >&5
6968   (eval $ac_link) 2>&5
6969   ac_status=$?
6970   echo "$as_me:6970: \$? = $ac_status" >&5
6971   (exit $ac_status); } &&
6972          { ac_try='test -s conftest$ac_exeext'
6973   { (eval echo "$as_me:6973: \"$ac_try\"") >&5
6974   (eval $ac_try) 2>&5
6975   ac_status=$?
6976   echo "$as_me:6976: \$? = $ac_status" >&5
6977   (exit $ac_status); }; }; then
6978
6979         cf_cv_find_linkage_utf8=yes
6980         cf_cv_header_path_utf8=/usr/include
6981         cf_cv_library_path_utf8=/usr/lib
6982         cf_cv_library_file_utf8="-lutf8"
6983
6984 else
6985   echo "$as_me: failed program was:" >&5
6986 cat conftest.$ac_ext >&5
6987
6988         cf_cv_find_linkage_utf8=no
6989         LIBS="$cf_save_LIBS"
6990
6991         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6992
6993 echo "${as_me:-configure}:6993: testing find linkage for utf8 library ..." 1>&5
6994
6995 echo "${as_me:-configure}:6995: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6996
6997         cf_save_CPPFLAGS="$CPPFLAGS"
6998         cf_test_CPPFLAGS="$CPPFLAGS"
6999
7000 cf_search=
7001
7002 # collect the current set of include-directories from compiler flags
7003 cf_header_path_list=""
7004 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7005         for cf_header_path in $CPPFLAGS $CFLAGS
7006         do
7007                 case $cf_header_path in
7008                 (-I*)
7009                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7010
7011 test "x$cf_header_path" != "xNONE" && \
7012 test -d "$cf_header_path" && \
7013  {
7014         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7015         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7016         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7017         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7018         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7019         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7020 }
7021
7022                         cf_header_path_list="$cf_header_path_list $cf_search"
7023                         ;;
7024                 esac
7025         done
7026 fi
7027
7028 # add the variations for the package we are looking for
7029
7030 cf_search=
7031
7032 test "x$prefix" != "xNONE" && \
7033 test -d "$prefix" && \
7034  {
7035         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7036         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7037         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7038         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7039         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7040         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7041 }
7042
7043 for cf_subdir_prefix in \
7044         /usr \
7045         /usr/local \
7046         /usr/pkg \
7047         /opt \
7048         /opt/local \
7049         $HOME
7050 do
7051
7052 test "x$cf_subdir_prefix" != "x$prefix" && \
7053 test -d "$cf_subdir_prefix" && \
7054 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7055         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7056         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7057         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7058         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7059         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7060         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7061 }
7062
7063 done
7064
7065 test "$includedir" != NONE && \
7066 test "$includedir" != "/usr/include" && \
7067 test -d "$includedir" && {
7068         test -d $includedir &&    cf_search="$cf_search $includedir"
7069         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7070 }
7071
7072 test "$oldincludedir" != NONE && \
7073 test "$oldincludedir" != "/usr/include" && \
7074 test -d "$oldincludedir" && {
7075         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7076         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7077 }
7078
7079 cf_search="$cf_search $cf_header_path_list"
7080
7081         for cf_cv_header_path_utf8 in $cf_search
7082         do
7083                 if test -d $cf_cv_header_path_utf8 ; then
7084                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7085
7086 echo "${as_me:-configure}:7086: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7087
7088                         CPPFLAGS="$cf_save_CPPFLAGS"
7089
7090         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7091         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7092
7093                         cat >conftest.$ac_ext <<_ACEOF
7094 #line 7094 "configure"
7095 #include "confdefs.h"
7096
7097 #include <libutf8.h>
7098 int
7099 main (void)
7100 {
7101 putwc(0,0);
7102   ;
7103   return 0;
7104 }
7105 _ACEOF
7106 rm -f conftest.$ac_objext
7107 if { (eval echo "$as_me:7107: \"$ac_compile\"") >&5
7108   (eval $ac_compile) 2>&5
7109   ac_status=$?
7110   echo "$as_me:7110: \$? = $ac_status" >&5
7111   (exit $ac_status); } &&
7112          { ac_try='test -s conftest.$ac_objext'
7113   { (eval echo "$as_me:7113: \"$ac_try\"") >&5
7114   (eval $ac_try) 2>&5
7115   ac_status=$?
7116   echo "$as_me:7116: \$? = $ac_status" >&5
7117   (exit $ac_status); }; }; then
7118
7119                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7120
7121 echo "${as_me:-configure}:7121: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7122
7123                                 cf_cv_find_linkage_utf8=maybe
7124                                 cf_test_CPPFLAGS="$CPPFLAGS"
7125                                 break
7126 else
7127   echo "$as_me: failed program was:" >&5
7128 cat conftest.$ac_ext >&5
7129
7130                                 CPPFLAGS="$cf_save_CPPFLAGS"
7131
7132 fi
7133 rm -f conftest.$ac_objext conftest.$ac_ext
7134                 fi
7135         done
7136
7137         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7138
7139 echo "${as_me:-configure}:7139: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7140
7141                 cf_save_LIBS="$LIBS"
7142                 cf_save_LDFLAGS="$LDFLAGS"
7143
7144                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7145
7146 cf_search=
7147 cf_library_path_list=""
7148 if test -n "${LDFLAGS}${LIBS}" ; then
7149         for cf_library_path in $LDFLAGS $LIBS
7150         do
7151                 case $cf_library_path in
7152                 (-L*)
7153                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7154
7155 test "x$cf_library_path" != "xNONE" && \
7156 test -d "$cf_library_path" && \
7157  {
7158         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7159         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7160         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7161         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7162         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7163         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7164 }
7165
7166                         cf_library_path_list="$cf_library_path_list $cf_search"
7167                         ;;
7168                 esac
7169         done
7170 fi
7171
7172 cf_search=
7173
7174 test "x$prefix" != "xNONE" && \
7175 test -d "$prefix" && \
7176  {
7177         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7178         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7179         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7180         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7181         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7182         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7183 }
7184
7185 for cf_subdir_prefix in \
7186         /usr \
7187         /usr/local \
7188         /usr/pkg \
7189         /opt \
7190         /opt/local \
7191         $HOME
7192 do
7193
7194 test "x$cf_subdir_prefix" != "x$prefix" && \
7195 test -d "$cf_subdir_prefix" && \
7196 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7197         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7198         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7199         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7200         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7201         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7202         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7203 }
7204
7205 done
7206
7207 cf_search="$cf_library_path_list $cf_search"
7208
7209                         for cf_cv_library_path_utf8 in $cf_search
7210                         do
7211                                 if test -d $cf_cv_library_path_utf8 ; then
7212                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7213
7214 echo "${as_me:-configure}:7214: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7215
7216                                         CPPFLAGS="$cf_test_CPPFLAGS"
7217                                         LIBS="-lutf8  $cf_save_LIBS"
7218                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7219                                         cat >conftest.$ac_ext <<_ACEOF
7220 #line 7220 "configure"
7221 #include "confdefs.h"
7222
7223 #include <libutf8.h>
7224 int
7225 main (void)
7226 {
7227 putwc(0,0);
7228   ;
7229   return 0;
7230 }
7231 _ACEOF
7232 rm -f conftest.$ac_objext conftest$ac_exeext
7233 if { (eval echo "$as_me:7233: \"$ac_link\"") >&5
7234   (eval $ac_link) 2>&5
7235   ac_status=$?
7236   echo "$as_me:7236: \$? = $ac_status" >&5
7237   (exit $ac_status); } &&
7238          { ac_try='test -s conftest$ac_exeext'
7239   { (eval echo "$as_me:7239: \"$ac_try\"") >&5
7240   (eval $ac_try) 2>&5
7241   ac_status=$?
7242   echo "$as_me:7242: \$? = $ac_status" >&5
7243   (exit $ac_status); }; }; then
7244
7245                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7246
7247 echo "${as_me:-configure}:7247: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7248
7249                                         cf_cv_find_linkage_utf8=yes
7250                                         cf_cv_library_file_utf8="-lutf8"
7251                                         break
7252 else
7253   echo "$as_me: failed program was:" >&5
7254 cat conftest.$ac_ext >&5
7255
7256                                         CPPFLAGS="$cf_save_CPPFLAGS"
7257                                         LIBS="$cf_save_LIBS"
7258                                         LDFLAGS="$cf_save_LDFLAGS"
7259
7260 fi
7261 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7262                                 fi
7263                         done
7264                         CPPFLAGS="$cf_save_CPPFLAGS"
7265                         LDFLAGS="$cf_save_LDFLAGS"
7266                 fi
7267
7268         else
7269                 cf_cv_find_linkage_utf8=no
7270         fi
7271
7272 fi
7273 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7274
7275 fi
7276 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7277
7278 LIBS="$cf_save_LIBS"
7279
7280 if test "$cf_cv_find_linkage_utf8" = yes ; then
7281 cf_cv_utf8_lib=add-on
7282 else
7283 cf_cv_utf8_lib=no
7284 fi
7285
7286 fi
7287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7288 fi
7289 echo "$as_me:7289: result: $cf_cv_utf8_lib" >&5
7290 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7291
7292 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7293 # ncurses/ncursesw:
7294 if test "$cf_cv_utf8_lib" = "add-on" ; then
7295
7296 cat >>confdefs.h <<\EOF
7297 #define HAVE_LIBUTF8_H 1
7298 EOF
7299
7300 if test -n "$cf_cv_header_path_utf8" ; then
7301   for cf_add_incdir in $cf_cv_header_path_utf8
7302   do
7303         while test $cf_add_incdir != /usr/include
7304         do
7305           if test -d $cf_add_incdir
7306           then
7307                 cf_have_incdir=no
7308                 if test -n "$CFLAGS$CPPFLAGS" ; then
7309                   # a loop is needed to ensure we can add subdirs of existing dirs
7310                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7311                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7312                           cf_have_incdir=yes; break
7313                         fi
7314                   done
7315                 fi
7316
7317                 if test "$cf_have_incdir" = no ; then
7318                   if test "$cf_add_incdir" = /usr/local/include ; then
7319                         if test "$GCC" = yes
7320                         then
7321                           cf_save_CPPFLAGS=$CPPFLAGS
7322
7323         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7324         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7325
7326                           cat >conftest.$ac_ext <<_ACEOF
7327 #line 7327 "configure"
7328 #include "confdefs.h"
7329 #include <stdio.h>
7330 int
7331 main (void)
7332 {
7333 printf("Hello")
7334   ;
7335   return 0;
7336 }
7337 _ACEOF
7338 rm -f conftest.$ac_objext
7339 if { (eval echo "$as_me:7339: \"$ac_compile\"") >&5
7340   (eval $ac_compile) 2>&5
7341   ac_status=$?
7342   echo "$as_me:7342: \$? = $ac_status" >&5
7343   (exit $ac_status); } &&
7344          { ac_try='test -s conftest.$ac_objext'
7345   { (eval echo "$as_me:7345: \"$ac_try\"") >&5
7346   (eval $ac_try) 2>&5
7347   ac_status=$?
7348   echo "$as_me:7348: \$? = $ac_status" >&5
7349   (exit $ac_status); }; }; then
7350   :
7351 else
7352   echo "$as_me: failed program was:" >&5
7353 cat conftest.$ac_ext >&5
7354 cf_have_incdir=yes
7355 fi
7356 rm -f conftest.$ac_objext conftest.$ac_ext
7357                           CPPFLAGS=$cf_save_CPPFLAGS
7358                         fi
7359                   fi
7360                 fi
7361
7362                 if test "$cf_have_incdir" = no ; then
7363                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7364
7365 echo "${as_me:-configure}:7365: testing adding $cf_add_incdir to include-path ..." 1>&5
7366
7367                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7368
7369                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7370                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7371                   cf_add_incdir="$cf_top_incdir"
7372                 else
7373                   break
7374                 fi
7375           else
7376                 break
7377           fi
7378         done
7379   done
7380 fi
7381
7382 if test -n "$cf_cv_library_path_utf8" ; then
7383         for cf_add_libdir in $cf_cv_library_path_utf8
7384         do
7385                 if test $cf_add_libdir = /usr/lib ; then
7386                         :
7387                 elif test -d $cf_add_libdir
7388                 then
7389                         cf_have_libdir=no
7390                         if test -n "$LDFLAGS$LIBS" ; then
7391                                 # a loop is needed to ensure we can add subdirs of existing dirs
7392                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7393                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7394                                                 cf_have_libdir=yes; break
7395                                         fi
7396                                 done
7397                         fi
7398                         if test "$cf_have_libdir" = no ; then
7399                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7400
7401 echo "${as_me:-configure}:7401: testing adding $cf_add_libdir to library-path ..." 1>&5
7402
7403                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7404                         fi
7405                 fi
7406         done
7407 fi
7408
7409 cf_add_libs="$cf_cv_library_file_utf8"
7410 # Filter out duplicates - this happens with badly-designed ".pc" files...
7411 for cf_add_1lib in $LIBS
7412 do
7413         for cf_add_2lib in $cf_add_libs
7414         do
7415                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7416                 then
7417                         cf_add_1lib=
7418                         break
7419                 fi
7420         done
7421         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7422 done
7423 LIBS="$cf_add_libs"
7424
7425 fi
7426
7427 cf_ncuconfig_root=$cf_cv_screen
7428 cf_have_ncuconfig=no
7429
7430 if test "x${PKG_CONFIG:=none}" != xnone; then
7431         echo "$as_me:7431: checking pkg-config for $cf_ncuconfig_root" >&5
7432 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7433         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7434                 echo "$as_me:7434: result: yes" >&5
7435 echo "${ECHO_T}yes" >&6
7436
7437                 echo "$as_me:7437: checking if the $cf_ncuconfig_root package files work" >&5
7438 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7439                 cf_have_ncuconfig=unknown
7440
7441                 cf_save_CPPFLAGS="$CPPFLAGS"
7442                 cf_save_LIBS="$LIBS"
7443
7444 cf_fix_cppflags=no
7445 cf_new_cflags=
7446 cf_new_cppflags=
7447 cf_new_extra_cppflags=
7448
7449 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
7450 do
7451 case $cf_fix_cppflags in
7452 (no)
7453         case $cf_add_cflags in
7454         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7455                 case $cf_add_cflags in
7456                 (-D*)
7457                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7458
7459                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7460                                 && test -z "${cf_tst_cflags}" \
7461                                 && cf_fix_cppflags=yes
7462
7463                         if test $cf_fix_cppflags = yes ; then
7464
7465         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7466         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7467
7468                                 continue
7469                         elif test "${cf_tst_cflags}" = "\"'" ; then
7470
7471         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7472         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7473
7474                                 continue
7475                         fi
7476                         ;;
7477                 esac
7478                 case "$CPPFLAGS" in
7479                 (*$cf_add_cflags)
7480                         ;;
7481                 (*)
7482                         case $cf_add_cflags in
7483                         (-D*)
7484                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7485
7486 CPPFLAGS=`echo "$CPPFLAGS" | \
7487         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7488                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7489
7490                                 ;;
7491                         esac
7492
7493         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7494         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7495
7496                         ;;
7497                 esac
7498                 ;;
7499         (*)
7500
7501         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7502         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7503
7504                 ;;
7505         esac
7506         ;;
7507 (yes)
7508
7509         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7510         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7511
7512         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7513
7514         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7515                 && test -z "${cf_tst_cflags}" \
7516                 && cf_fix_cppflags=no
7517         ;;
7518 esac
7519 done
7520
7521 if test -n "$cf_new_cflags" ; then
7522
7523         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7524         CFLAGS="${CFLAGS}$cf_new_cflags"
7525
7526 fi
7527
7528 if test -n "$cf_new_cppflags" ; then
7529
7530         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7531         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7532
7533 fi
7534
7535 if test -n "$cf_new_extra_cppflags" ; then
7536
7537         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7538         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7539
7540 fi
7541
7542 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7543 # Filter out duplicates - this happens with badly-designed ".pc" files...
7544 for cf_add_1lib in $LIBS
7545 do
7546         for cf_add_2lib in $cf_add_libs
7547         do
7548                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7549                 then
7550                         cf_add_1lib=
7551                         break
7552                 fi
7553         done
7554         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7555 done
7556 LIBS="$cf_add_libs"
7557
7558                 cat >conftest.$ac_ext <<_ACEOF
7559 #line 7559 "configure"
7560 #include "confdefs.h"
7561 #include <${cf_cv_ncurses_header:-curses.h}>
7562 int
7563 main (void)
7564 {
7565 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7566   ;
7567   return 0;
7568 }
7569 _ACEOF
7570 rm -f conftest.$ac_objext conftest$ac_exeext
7571 if { (eval echo "$as_me:7571: \"$ac_link\"") >&5
7572   (eval $ac_link) 2>&5
7573   ac_status=$?
7574   echo "$as_me:7574: \$? = $ac_status" >&5
7575   (exit $ac_status); } &&
7576          { ac_try='test -s conftest$ac_exeext'
7577   { (eval echo "$as_me:7577: \"$ac_try\"") >&5
7578   (eval $ac_try) 2>&5
7579   ac_status=$?
7580   echo "$as_me:7580: \$? = $ac_status" >&5
7581   (exit $ac_status); }; }; then
7582   if test "$cross_compiling" = yes; then
7583   cf_have_ncuconfig=maybe
7584 else
7585   cat >conftest.$ac_ext <<_ACEOF
7586 #line 7586 "configure"
7587 #include "confdefs.h"
7588 #include <${cf_cv_ncurses_header:-curses.h}>
7589                                 int main(void)
7590                                 { char *xx = curses_version(); return (xx == 0); }
7591 _ACEOF
7592 rm -f conftest$ac_exeext
7593 if { (eval echo "$as_me:7593: \"$ac_link\"") >&5
7594   (eval $ac_link) 2>&5
7595   ac_status=$?
7596   echo "$as_me:7596: \$? = $ac_status" >&5
7597   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7598   { (eval echo "$as_me:7598: \"$ac_try\"") >&5
7599   (eval $ac_try) 2>&5
7600   ac_status=$?
7601   echo "$as_me:7601: \$? = $ac_status" >&5
7602   (exit $ac_status); }; }; then
7603   cf_have_ncuconfig=yes
7604 else
7605   echo "$as_me: program exited with status $ac_status" >&5
7606 echo "$as_me: failed program was:" >&5
7607 cat conftest.$ac_ext >&5
7608 cf_have_ncuconfig=no
7609 fi
7610 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7611 fi
7612 else
7613   echo "$as_me: failed program was:" >&5
7614 cat conftest.$ac_ext >&5
7615 cf_have_ncuconfig=no
7616 fi
7617 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7618                 echo "$as_me:7618: result: $cf_have_ncuconfig" >&5
7619 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7620                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7621                 if test "$cf_have_ncuconfig" != "yes"
7622                 then
7623                         CPPFLAGS="$cf_save_CPPFLAGS"
7624                         LIBS="$cf_save_LIBS"
7625                         NCURSES_CONFIG_PKG=none
7626                 else
7627
7628 cat >>confdefs.h <<\EOF
7629 #define NCURSES 1
7630 EOF
7631
7632                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7633
7634 echo "$as_me:7634: checking for terminfo header" >&5
7635 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7636 if test "${cf_cv_term_header+set}" = set; then
7637   echo $ECHO_N "(cached) $ECHO_C" >&6
7638 else
7639
7640 case ${cf_cv_ncurses_header} in
7641 (*/ncurses.h|*/ncursesw.h)
7642         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7643         ;;
7644 (*)
7645         cf_term_header=term.h
7646         ;;
7647 esac
7648
7649 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7650 do
7651 cat >conftest.$ac_ext <<_ACEOF
7652 #line 7652 "configure"
7653 #include "confdefs.h"
7654 #include <stdio.h>
7655 #include <${cf_cv_ncurses_header:-curses.h}>
7656 #include <$cf_test>
7657
7658 int
7659 main (void)
7660 {
7661 int x = auto_left_margin
7662   ;
7663   return 0;
7664 }
7665 _ACEOF
7666 rm -f conftest.$ac_objext
7667 if { (eval echo "$as_me:7667: \"$ac_compile\"") >&5
7668   (eval $ac_compile) 2>&5
7669   ac_status=$?
7670   echo "$as_me:7670: \$? = $ac_status" >&5
7671   (exit $ac_status); } &&
7672          { ac_try='test -s conftest.$ac_objext'
7673   { (eval echo "$as_me:7673: \"$ac_try\"") >&5
7674   (eval $ac_try) 2>&5
7675   ac_status=$?
7676   echo "$as_me:7676: \$? = $ac_status" >&5
7677   (exit $ac_status); }; }; then
7678
7679         cf_cv_term_header="$cf_test"
7680 else
7681   echo "$as_me: failed program was:" >&5
7682 cat conftest.$ac_ext >&5
7683
7684         cf_cv_term_header=unknown
7685
7686 fi
7687 rm -f conftest.$ac_objext conftest.$ac_ext
7688         test "$cf_cv_term_header" != unknown && break
7689 done
7690
7691 fi
7692 echo "$as_me:7692: result: $cf_cv_term_header" >&5
7693 echo "${ECHO_T}$cf_cv_term_header" >&6
7694
7695 # Set definitions to allow ifdef'ing to accommodate subdirectories
7696
7697 case $cf_cv_term_header in
7698 (*term.h)
7699
7700 cat >>confdefs.h <<\EOF
7701 #define HAVE_TERM_H 1
7702 EOF
7703
7704         ;;
7705 esac
7706
7707 case $cf_cv_term_header in
7708 (ncurses/term.h)
7709
7710 cat >>confdefs.h <<\EOF
7711 #define HAVE_NCURSES_TERM_H 1
7712 EOF
7713
7714         ;;
7715 (ncursesw/term.h)
7716
7717 cat >>confdefs.h <<\EOF
7718 #define HAVE_NCURSESW_TERM_H 1
7719 EOF
7720
7721         ;;
7722 esac
7723
7724                 fi
7725
7726         else
7727                 echo "$as_me:7727: result: no" >&5
7728 echo "${ECHO_T}no" >&6
7729                 NCURSES_CONFIG_PKG=none
7730         fi
7731 else
7732         NCURSES_CONFIG_PKG=none
7733 fi
7734
7735 if test "x$cf_have_ncuconfig" = "xno"; then
7736         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7737
7738 if test -n "$ac_tool_prefix"; then
7739   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7740   do
7741     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7742 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7743 echo "$as_me:7743: checking for $ac_word" >&5
7744 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7745 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7746   echo $ECHO_N "(cached) $ECHO_C" >&6
7747 else
7748   if test -n "$NCURSES_CONFIG"; then
7749   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7750 else
7751   ac_save_IFS=$IFS; IFS=$ac_path_separator
7752 ac_dummy="$PATH"
7753 for ac_dir in $ac_dummy; do
7754   IFS=$ac_save_IFS
7755   test -z "$ac_dir" && ac_dir=.
7756   $as_executable_p "$ac_dir/$ac_word" || continue
7757 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7758 echo "$as_me:7758: found $ac_dir/$ac_word" >&5
7759 break
7760 done
7761
7762 fi
7763 fi
7764 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7765 if test -n "$NCURSES_CONFIG"; then
7766   echo "$as_me:7766: result: $NCURSES_CONFIG" >&5
7767 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7768 else
7769   echo "$as_me:7769: result: no" >&5
7770 echo "${ECHO_T}no" >&6
7771 fi
7772
7773     test -n "$NCURSES_CONFIG" && break
7774   done
7775 fi
7776 if test -z "$NCURSES_CONFIG"; then
7777   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7778   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7779 do
7780   # Extract the first word of "$ac_prog", so it can be a program name with args.
7781 set dummy $ac_prog; ac_word=$2
7782 echo "$as_me:7782: checking for $ac_word" >&5
7783 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7784 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7785   echo $ECHO_N "(cached) $ECHO_C" >&6
7786 else
7787   if test -n "$ac_ct_NCURSES_CONFIG"; then
7788   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7789 else
7790   ac_save_IFS=$IFS; IFS=$ac_path_separator
7791 ac_dummy="$PATH"
7792 for ac_dir in $ac_dummy; do
7793   IFS=$ac_save_IFS
7794   test -z "$ac_dir" && ac_dir=.
7795   $as_executable_p "$ac_dir/$ac_word" || continue
7796 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7797 echo "$as_me:7797: found $ac_dir/$ac_word" >&5
7798 break
7799 done
7800
7801 fi
7802 fi
7803 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7804 if test -n "$ac_ct_NCURSES_CONFIG"; then
7805   echo "$as_me:7805: result: $ac_ct_NCURSES_CONFIG" >&5
7806 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7807 else
7808   echo "$as_me:7808: result: no" >&5
7809 echo "${ECHO_T}no" >&6
7810 fi
7811
7812   test -n "$ac_ct_NCURSES_CONFIG" && break
7813 done
7814 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7815
7816   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7817 fi
7818
7819         if test "$NCURSES_CONFIG" != none ; then
7820
7821 cf_fix_cppflags=no
7822 cf_new_cflags=
7823 cf_new_cppflags=
7824 cf_new_extra_cppflags=
7825
7826 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7827 do
7828 case $cf_fix_cppflags in
7829 (no)
7830         case $cf_add_cflags in
7831         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7832                 case $cf_add_cflags in
7833                 (-D*)
7834                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7835
7836                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7837                                 && test -z "${cf_tst_cflags}" \
7838                                 && cf_fix_cppflags=yes
7839
7840                         if test $cf_fix_cppflags = yes ; then
7841
7842         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7843         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7844
7845                                 continue
7846                         elif test "${cf_tst_cflags}" = "\"'" ; then
7847
7848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7850
7851                                 continue
7852                         fi
7853                         ;;
7854                 esac
7855                 case "$CPPFLAGS" in
7856                 (*$cf_add_cflags)
7857                         ;;
7858                 (*)
7859                         case $cf_add_cflags in
7860                         (-D*)
7861                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7862
7863 CPPFLAGS=`echo "$CPPFLAGS" | \
7864         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7865                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7866
7867                                 ;;
7868                         esac
7869
7870         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7871         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7872
7873                         ;;
7874                 esac
7875                 ;;
7876         (*)
7877
7878         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7879         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7880
7881                 ;;
7882         esac
7883         ;;
7884 (yes)
7885
7886         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7887         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7888
7889         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7890
7891         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7892                 && test -z "${cf_tst_cflags}" \
7893                 && cf_fix_cppflags=no
7894         ;;
7895 esac
7896 done
7897
7898 if test -n "$cf_new_cflags" ; then
7899
7900         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7901         CFLAGS="${CFLAGS}$cf_new_cflags"
7902
7903 fi
7904
7905 if test -n "$cf_new_cppflags" ; then
7906
7907         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7908         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7909
7910 fi
7911
7912 if test -n "$cf_new_extra_cppflags" ; then
7913
7914         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7915         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7916
7917 fi
7918
7919 cf_add_libs="`$NCURSES_CONFIG --libs`"
7920 # Filter out duplicates - this happens with badly-designed ".pc" files...
7921 for cf_add_1lib in $LIBS
7922 do
7923         for cf_add_2lib in $cf_add_libs
7924         do
7925                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7926                 then
7927                         cf_add_1lib=
7928                         break
7929                 fi
7930         done
7931         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7932 done
7933 LIBS="$cf_add_libs"
7934
7935                 # even with config script, some packages use no-override for curses.h
7936
7937 echo "$as_me:7937: checking if we have identified curses headers" >&5
7938 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7939 if test "${cf_cv_ncurses_header+set}" = set; then
7940   echo $ECHO_N "(cached) $ECHO_C" >&6
7941 else
7942
7943 cf_cv_ncurses_header=none
7944 for cf_header in \
7945         ncurses.h $cf_cv_screen/ncurses.h \
7946         curses.h $cf_cv_screen/curses.h
7947 do
7948 cat >conftest.$ac_ext <<_ACEOF
7949 #line 7949 "configure"
7950 #include "confdefs.h"
7951 #include <${cf_header}>
7952 int
7953 main (void)
7954 {
7955 initscr(); tgoto("?", 0,0)
7956   ;
7957   return 0;
7958 }
7959 _ACEOF
7960 rm -f conftest.$ac_objext
7961 if { (eval echo "$as_me:7961: \"$ac_compile\"") >&5
7962   (eval $ac_compile) 2>&5
7963   ac_status=$?
7964   echo "$as_me:7964: \$? = $ac_status" >&5
7965   (exit $ac_status); } &&
7966          { ac_try='test -s conftest.$ac_objext'
7967   { (eval echo "$as_me:7967: \"$ac_try\"") >&5
7968   (eval $ac_try) 2>&5
7969   ac_status=$?
7970   echo "$as_me:7970: \$? = $ac_status" >&5
7971   (exit $ac_status); }; }; then
7972   cf_cv_ncurses_header=$cf_header; break
7973 else
7974   echo "$as_me: failed program was:" >&5
7975 cat conftest.$ac_ext >&5
7976 fi
7977 rm -f conftest.$ac_objext conftest.$ac_ext
7978 done
7979
7980 fi
7981 echo "$as_me:7981: result: $cf_cv_ncurses_header" >&5
7982 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7983
7984 if test "$cf_cv_ncurses_header" = none ; then
7985         { { echo "$as_me:7985: error: No curses header-files found" >&5
7986 echo "$as_me: error: No curses header-files found" >&2;}
7987    { (exit 1); exit 1; }; }
7988 fi
7989
7990 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7991
7992 for ac_header in $cf_cv_ncurses_header
7993 do
7994 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7995 echo "$as_me:7995: checking for $ac_header" >&5
7996 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7997 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7998   echo $ECHO_N "(cached) $ECHO_C" >&6
7999 else
8000   cat >conftest.$ac_ext <<_ACEOF
8001 #line 8001 "configure"
8002 #include "confdefs.h"
8003 #include <$ac_header>
8004 _ACEOF
8005 if { (eval echo "$as_me:8005: \"$ac_cpp conftest.$ac_ext\"") >&5
8006   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8007   ac_status=$?
8008   egrep -v '^ *\+' conftest.er1 >conftest.err
8009   rm -f conftest.er1
8010   cat conftest.err >&5
8011   echo "$as_me:8011: \$? = $ac_status" >&5
8012   (exit $ac_status); } >/dev/null; then
8013   if test -s conftest.err; then
8014     ac_cpp_err=$ac_c_preproc_warn_flag
8015   else
8016     ac_cpp_err=
8017   fi
8018 else
8019   ac_cpp_err=yes
8020 fi
8021 if test -z "$ac_cpp_err"; then
8022   eval "$as_ac_Header=yes"
8023 else
8024   echo "$as_me: failed program was:" >&5
8025   cat conftest.$ac_ext >&5
8026   eval "$as_ac_Header=no"
8027 fi
8028 rm -f conftest.err conftest.$ac_ext
8029 fi
8030 echo "$as_me:8030: result: `eval echo '${'$as_ac_Header'}'`" >&5
8031 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8032 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8033   cat >>confdefs.h <<EOF
8034 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8035 EOF
8036
8037 fi
8038 done
8039
8040 cat >>confdefs.h <<\EOF
8041 #define NCURSES 1
8042 EOF
8043
8044 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8045
8046                 cat >>confdefs.h <<EOF
8047 #define $cf_nculib_ROOT 1
8048 EOF
8049
8050                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8051
8052         else
8053
8054 cf_ncuhdr_root=$cf_cv_screen
8055
8056 test -n "$cf_cv_curses_dir" && \
8057 test "$cf_cv_curses_dir" != "no" && { \
8058
8059 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8060   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8061   do
8062         while test $cf_add_incdir != /usr/include
8063         do
8064           if test -d $cf_add_incdir
8065           then
8066                 cf_have_incdir=no
8067                 if test -n "$CFLAGS$CPPFLAGS" ; then
8068                   # a loop is needed to ensure we can add subdirs of existing dirs
8069                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8070                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8071                           cf_have_incdir=yes; break
8072                         fi
8073                   done
8074                 fi
8075
8076                 if test "$cf_have_incdir" = no ; then
8077                   if test "$cf_add_incdir" = /usr/local/include ; then
8078                         if test "$GCC" = yes
8079                         then
8080                           cf_save_CPPFLAGS=$CPPFLAGS
8081
8082         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8083         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8084
8085                           cat >conftest.$ac_ext <<_ACEOF
8086 #line 8086 "configure"
8087 #include "confdefs.h"
8088 #include <stdio.h>
8089 int
8090 main (void)
8091 {
8092 printf("Hello")
8093   ;
8094   return 0;
8095 }
8096 _ACEOF
8097 rm -f conftest.$ac_objext
8098 if { (eval echo "$as_me:8098: \"$ac_compile\"") >&5
8099   (eval $ac_compile) 2>&5
8100   ac_status=$?
8101   echo "$as_me:8101: \$? = $ac_status" >&5
8102   (exit $ac_status); } &&
8103          { ac_try='test -s conftest.$ac_objext'
8104   { (eval echo "$as_me:8104: \"$ac_try\"") >&5
8105   (eval $ac_try) 2>&5
8106   ac_status=$?
8107   echo "$as_me:8107: \$? = $ac_status" >&5
8108   (exit $ac_status); }; }; then
8109   :
8110 else
8111   echo "$as_me: failed program was:" >&5
8112 cat conftest.$ac_ext >&5
8113 cf_have_incdir=yes
8114 fi
8115 rm -f conftest.$ac_objext conftest.$ac_ext
8116                           CPPFLAGS=$cf_save_CPPFLAGS
8117                         fi
8118                   fi
8119                 fi
8120
8121                 if test "$cf_have_incdir" = no ; then
8122                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8123
8124 echo "${as_me:-configure}:8124: testing adding $cf_add_incdir to include-path ..." 1>&5
8125
8126                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8127
8128                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8129                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8130                   cf_add_incdir="$cf_top_incdir"
8131                 else
8132                   break
8133                 fi
8134           else
8135                 break
8136           fi
8137         done
8138   done
8139 fi
8140
8141 }
8142
8143 echo "$as_me:8143: checking for $cf_ncuhdr_root header in include-path" >&5
8144 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8145 if test "${cf_cv_ncurses_h+set}" = set; then
8146   echo $ECHO_N "(cached) $ECHO_C" >&6
8147 else
8148
8149         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8150         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8151         for cf_header in $cf_header_list
8152         do
8153
8154         cat >conftest.$ac_ext <<_ACEOF
8155 #line 8155 "configure"
8156 #include "confdefs.h"
8157
8158 #include <$cf_header>
8159 int
8160 main (void)
8161 {
8162
8163 #ifdef NCURSES_VERSION
8164
8165 printf("%s\n", NCURSES_VERSION);
8166 #else
8167 #ifdef __NCURSES_H
8168 printf("old\n");
8169 #else
8170         make an error
8171 #endif
8172 #endif
8173
8174   ;
8175   return 0;
8176 }
8177 _ACEOF
8178 rm -f conftest.$ac_objext
8179 if { (eval echo "$as_me:8179: \"$ac_compile\"") >&5
8180   (eval $ac_compile) 2>&5
8181   ac_status=$?
8182   echo "$as_me:8182: \$? = $ac_status" >&5
8183   (exit $ac_status); } &&
8184          { ac_try='test -s conftest.$ac_objext'
8185   { (eval echo "$as_me:8185: \"$ac_try\"") >&5
8186   (eval $ac_try) 2>&5
8187   ac_status=$?
8188   echo "$as_me:8188: \$? = $ac_status" >&5
8189   (exit $ac_status); }; }; then
8190   cf_cv_ncurses_h=$cf_header
8191
8192 else
8193   echo "$as_me: failed program was:" >&5
8194 cat conftest.$ac_ext >&5
8195 cf_cv_ncurses_h=no
8196 fi
8197 rm -f conftest.$ac_objext conftest.$ac_ext
8198
8199                 test "$cf_cv_ncurses_h" != no && break
8200         done
8201
8202 fi
8203 echo "$as_me:8203: result: $cf_cv_ncurses_h" >&5
8204 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8205
8206 if test "$cf_cv_ncurses_h" != no ; then
8207         cf_cv_ncurses_header=$cf_cv_ncurses_h
8208 else
8209
8210 echo "$as_me:8210: checking for $cf_ncuhdr_root include-path" >&5
8211 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8212 if test "${cf_cv_ncurses_h2+set}" = set; then
8213   echo $ECHO_N "(cached) $ECHO_C" >&6
8214 else
8215
8216         test -n "$verbose" && echo
8217
8218 cf_search=
8219
8220 # collect the current set of include-directories from compiler flags
8221 cf_header_path_list=""
8222 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8223         for cf_header_path in $CPPFLAGS $CFLAGS
8224         do
8225                 case $cf_header_path in
8226                 (-I*)
8227                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8228
8229 test "x$cf_header_path" != "xNONE" && \
8230 test -d "$cf_header_path" && \
8231  {
8232         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8233         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8234         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8235         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8236         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8237         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8238 }
8239
8240                         cf_header_path_list="$cf_header_path_list $cf_search"
8241                         ;;
8242                 esac
8243         done
8244 fi
8245
8246 # add the variations for the package we are looking for
8247
8248 cf_search=
8249
8250 test "x$prefix" != "xNONE" && \
8251 test -d "$prefix" && \
8252  {
8253         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8254         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8255         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8256         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8257         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8258         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8259 }
8260
8261 for cf_subdir_prefix in \
8262         /usr \
8263         /usr/local \
8264         /usr/pkg \
8265         /opt \
8266         /opt/local \
8267         $HOME
8268 do
8269
8270 test "x$cf_subdir_prefix" != "x$prefix" && \
8271 test -d "$cf_subdir_prefix" && \
8272 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8273         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8274         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8275         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8276         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8277         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8278         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8279 }
8280
8281 done
8282
8283 test "$includedir" != NONE && \
8284 test "$includedir" != "/usr/include" && \
8285 test -d "$includedir" && {
8286         test -d $includedir &&    cf_search="$cf_search $includedir"
8287         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8288 }
8289
8290 test "$oldincludedir" != NONE && \
8291 test "$oldincludedir" != "/usr/include" && \
8292 test -d "$oldincludedir" && {
8293         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8294         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8295 }
8296
8297 cf_search="$cf_search $cf_header_path_list"
8298
8299         test -n "$verbose" && echo search path $cf_search
8300         cf_save2_CPPFLAGS="$CPPFLAGS"
8301         for cf_incdir in $cf_search
8302         do
8303
8304 if test -n "$cf_incdir" ; then
8305   for cf_add_incdir in $cf_incdir
8306   do
8307         while test $cf_add_incdir != /usr/include
8308         do
8309           if test -d $cf_add_incdir
8310           then
8311                 cf_have_incdir=no
8312                 if test -n "$CFLAGS$CPPFLAGS" ; then
8313                   # a loop is needed to ensure we can add subdirs of existing dirs
8314                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8315                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8316                           cf_have_incdir=yes; break
8317                         fi
8318                   done
8319                 fi
8320
8321                 if test "$cf_have_incdir" = no ; then
8322                   if test "$cf_add_incdir" = /usr/local/include ; then
8323                         if test "$GCC" = yes
8324                         then
8325                           cf_save_CPPFLAGS=$CPPFLAGS
8326
8327         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8328         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8329
8330                           cat >conftest.$ac_ext <<_ACEOF
8331 #line 8331 "configure"
8332 #include "confdefs.h"
8333 #include <stdio.h>
8334 int
8335 main (void)
8336 {
8337 printf("Hello")
8338   ;
8339   return 0;
8340 }
8341 _ACEOF
8342 rm -f conftest.$ac_objext
8343 if { (eval echo "$as_me:8343: \"$ac_compile\"") >&5
8344   (eval $ac_compile) 2>&5
8345   ac_status=$?
8346   echo "$as_me:8346: \$? = $ac_status" >&5
8347   (exit $ac_status); } &&
8348          { ac_try='test -s conftest.$ac_objext'
8349   { (eval echo "$as_me:8349: \"$ac_try\"") >&5
8350   (eval $ac_try) 2>&5
8351   ac_status=$?
8352   echo "$as_me:8352: \$? = $ac_status" >&5
8353   (exit $ac_status); }; }; then
8354   :
8355 else
8356   echo "$as_me: failed program was:" >&5
8357 cat conftest.$ac_ext >&5
8358 cf_have_incdir=yes
8359 fi
8360 rm -f conftest.$ac_objext conftest.$ac_ext
8361                           CPPFLAGS=$cf_save_CPPFLAGS
8362                         fi
8363                   fi
8364                 fi
8365
8366                 if test "$cf_have_incdir" = no ; then
8367                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8368
8369 echo "${as_me:-configure}:8369: testing adding $cf_add_incdir to include-path ..." 1>&5
8370
8371                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8372
8373                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8374                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8375                   cf_add_incdir="$cf_top_incdir"
8376                 else
8377                   break
8378                 fi
8379           else
8380                 break
8381           fi
8382         done
8383   done
8384 fi
8385
8386                 for cf_header in \
8387                         ncurses.h \
8388                         curses.h
8389                 do
8390
8391         cat >conftest.$ac_ext <<_ACEOF
8392 #line 8392 "configure"
8393 #include "confdefs.h"
8394
8395 #include <$cf_header>
8396 int
8397 main (void)
8398 {
8399
8400 #ifdef NCURSES_VERSION
8401
8402 printf("%s\n", NCURSES_VERSION);
8403 #else
8404 #ifdef __NCURSES_H
8405 printf("old\n");
8406 #else
8407         make an error
8408 #endif
8409 #endif
8410
8411   ;
8412   return 0;
8413 }
8414 _ACEOF
8415 rm -f conftest.$ac_objext
8416 if { (eval echo "$as_me:8416: \"$ac_compile\"") >&5
8417   (eval $ac_compile) 2>&5
8418   ac_status=$?
8419   echo "$as_me:8419: \$? = $ac_status" >&5
8420   (exit $ac_status); } &&
8421          { ac_try='test -s conftest.$ac_objext'
8422   { (eval echo "$as_me:8422: \"$ac_try\"") >&5
8423   (eval $ac_try) 2>&5
8424   ac_status=$?
8425   echo "$as_me:8425: \$? = $ac_status" >&5
8426   (exit $ac_status); }; }; then
8427   cf_cv_ncurses_h2=$cf_header
8428
8429 else
8430   echo "$as_me: failed program was:" >&5
8431 cat conftest.$ac_ext >&5
8432 cf_cv_ncurses_h2=no
8433 fi
8434 rm -f conftest.$ac_objext conftest.$ac_ext
8435
8436                         if test "$cf_cv_ncurses_h2" != no ; then
8437                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8438                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8439                                 break
8440                         fi
8441                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8442                 done
8443                 CPPFLAGS="$cf_save2_CPPFLAGS"
8444                 test "$cf_cv_ncurses_h2" != no && break
8445         done
8446         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8446: error: not found" >&5
8447 echo "$as_me: error: not found" >&2;}
8448    { (exit 1); exit 1; }; }
8449
8450 fi
8451 echo "$as_me:8451: result: $cf_cv_ncurses_h2" >&5
8452 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8453
8454         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8455         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8456         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8457                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8458         fi
8459
8460 if test -n "$cf_1st_incdir" ; then
8461   for cf_add_incdir in $cf_1st_incdir
8462   do
8463         while test $cf_add_incdir != /usr/include
8464         do
8465           if test -d $cf_add_incdir
8466           then
8467                 cf_have_incdir=no
8468                 if test -n "$CFLAGS$CPPFLAGS" ; then
8469                   # a loop is needed to ensure we can add subdirs of existing dirs
8470                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8471                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8472                           cf_have_incdir=yes; break
8473                         fi
8474                   done
8475                 fi
8476
8477                 if test "$cf_have_incdir" = no ; then
8478                   if test "$cf_add_incdir" = /usr/local/include ; then
8479                         if test "$GCC" = yes
8480                         then
8481                           cf_save_CPPFLAGS=$CPPFLAGS
8482
8483         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8484         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8485
8486                           cat >conftest.$ac_ext <<_ACEOF
8487 #line 8487 "configure"
8488 #include "confdefs.h"
8489 #include <stdio.h>
8490 int
8491 main (void)
8492 {
8493 printf("Hello")
8494   ;
8495   return 0;
8496 }
8497 _ACEOF
8498 rm -f conftest.$ac_objext
8499 if { (eval echo "$as_me:8499: \"$ac_compile\"") >&5
8500   (eval $ac_compile) 2>&5
8501   ac_status=$?
8502   echo "$as_me:8502: \$? = $ac_status" >&5
8503   (exit $ac_status); } &&
8504          { ac_try='test -s conftest.$ac_objext'
8505   { (eval echo "$as_me:8505: \"$ac_try\"") >&5
8506   (eval $ac_try) 2>&5
8507   ac_status=$?
8508   echo "$as_me:8508: \$? = $ac_status" >&5
8509   (exit $ac_status); }; }; then
8510   :
8511 else
8512   echo "$as_me: failed program was:" >&5
8513 cat conftest.$ac_ext >&5
8514 cf_have_incdir=yes
8515 fi
8516 rm -f conftest.$ac_objext conftest.$ac_ext
8517                           CPPFLAGS=$cf_save_CPPFLAGS
8518                         fi
8519                   fi
8520                 fi
8521
8522                 if test "$cf_have_incdir" = no ; then
8523                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8524
8525 echo "${as_me:-configure}:8525: testing adding $cf_add_incdir to include-path ..." 1>&5
8526
8527                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8528
8529                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8530                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8531                   cf_add_incdir="$cf_top_incdir"
8532                 else
8533                   break
8534                 fi
8535           else
8536                 break
8537           fi
8538         done
8539   done
8540 fi
8541
8542 fi
8543
8544 # Set definitions to allow ifdef'ing for ncurses.h
8545
8546 case $cf_cv_ncurses_header in
8547 (*ncurses.h)
8548
8549 cat >>confdefs.h <<\EOF
8550 #define HAVE_NCURSES_H 1
8551 EOF
8552
8553         ;;
8554 esac
8555
8556 case $cf_cv_ncurses_header in
8557 (ncurses/curses.h|ncurses/ncurses.h)
8558
8559 cat >>confdefs.h <<\EOF
8560 #define HAVE_NCURSES_NCURSES_H 1
8561 EOF
8562
8563         ;;
8564 (ncursesw/curses.h|ncursesw/ncurses.h)
8565
8566 cat >>confdefs.h <<\EOF
8567 #define HAVE_NCURSESW_NCURSES_H 1
8568 EOF
8569
8570         ;;
8571 esac
8572
8573 echo "$as_me:8573: checking for terminfo header" >&5
8574 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8575 if test "${cf_cv_term_header+set}" = set; then
8576   echo $ECHO_N "(cached) $ECHO_C" >&6
8577 else
8578
8579 case ${cf_cv_ncurses_header} in
8580 (*/ncurses.h|*/ncursesw.h)
8581         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8582         ;;
8583 (*)
8584         cf_term_header=term.h
8585         ;;
8586 esac
8587
8588 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8589 do
8590 cat >conftest.$ac_ext <<_ACEOF
8591 #line 8591 "configure"
8592 #include "confdefs.h"
8593 #include <stdio.h>
8594 #include <${cf_cv_ncurses_header:-curses.h}>
8595 #include <$cf_test>
8596
8597 int
8598 main (void)
8599 {
8600 int x = auto_left_margin
8601   ;
8602   return 0;
8603 }
8604 _ACEOF
8605 rm -f conftest.$ac_objext
8606 if { (eval echo "$as_me:8606: \"$ac_compile\"") >&5
8607   (eval $ac_compile) 2>&5
8608   ac_status=$?
8609   echo "$as_me:8609: \$? = $ac_status" >&5
8610   (exit $ac_status); } &&
8611          { ac_try='test -s conftest.$ac_objext'
8612   { (eval echo "$as_me:8612: \"$ac_try\"") >&5
8613   (eval $ac_try) 2>&5
8614   ac_status=$?
8615   echo "$as_me:8615: \$? = $ac_status" >&5
8616   (exit $ac_status); }; }; then
8617
8618         cf_cv_term_header="$cf_test"
8619 else
8620   echo "$as_me: failed program was:" >&5
8621 cat conftest.$ac_ext >&5
8622
8623         cf_cv_term_header=unknown
8624
8625 fi
8626 rm -f conftest.$ac_objext conftest.$ac_ext
8627         test "$cf_cv_term_header" != unknown && break
8628 done
8629
8630 fi
8631 echo "$as_me:8631: result: $cf_cv_term_header" >&5
8632 echo "${ECHO_T}$cf_cv_term_header" >&6
8633
8634 # Set definitions to allow ifdef'ing to accommodate subdirectories
8635
8636 case $cf_cv_term_header in
8637 (*term.h)
8638
8639 cat >>confdefs.h <<\EOF
8640 #define HAVE_TERM_H 1
8641 EOF
8642
8643         ;;
8644 esac
8645
8646 case $cf_cv_term_header in
8647 (ncurses/term.h)
8648
8649 cat >>confdefs.h <<\EOF
8650 #define HAVE_NCURSES_TERM_H 1
8651 EOF
8652
8653         ;;
8654 (ncursesw/term.h)
8655
8656 cat >>confdefs.h <<\EOF
8657 #define HAVE_NCURSESW_TERM_H 1
8658 EOF
8659
8660         ;;
8661 esac
8662
8663 # some applications need this, but should check for NCURSES_VERSION
8664
8665 cat >>confdefs.h <<\EOF
8666 #define NCURSES 1
8667 EOF
8668
8669 echo "$as_me:8669: checking for ncurses version" >&5
8670 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8671 if test "${cf_cv_ncurses_version+set}" = set; then
8672   echo $ECHO_N "(cached) $ECHO_C" >&6
8673 else
8674
8675         cf_cv_ncurses_version=no
8676         cf_tempfile=out$$
8677         rm -f $cf_tempfile
8678         if test "$cross_compiling" = yes; then
8679
8680         # This will not work if the preprocessor splits the line after the
8681         # Autoconf token.  The 'unproto' program does that.
8682         cat > conftest.$ac_ext <<EOF
8683 #include <${cf_cv_ncurses_header:-curses.h}>
8684 #undef Autoconf
8685 #ifdef NCURSES_VERSION
8686 Autoconf NCURSES_VERSION
8687 #else
8688 #ifdef __NCURSES_H
8689 Autoconf "old"
8690 #endif
8691 ;
8692 #endif
8693 EOF
8694         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8695         { (eval echo "$as_me:8695: \"$cf_try\"") >&5
8696   (eval $cf_try) 2>&5
8697   ac_status=$?
8698   echo "$as_me:8698: \$? = $ac_status" >&5
8699   (exit $ac_status); }
8700         if test -f conftest.out ; then
8701                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8702                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8703                 rm -f conftest.out
8704         fi
8705
8706 else
8707   cat >conftest.$ac_ext <<_ACEOF
8708 #line 8708 "configure"
8709 #include "confdefs.h"
8710
8711 #include <${cf_cv_ncurses_header:-curses.h}>
8712 #include <stdio.h>
8713 int main(void)
8714 {
8715         FILE *fp = fopen("$cf_tempfile", "w");
8716 #ifdef NCURSES_VERSION
8717 # ifdef NCURSES_VERSION_PATCH
8718         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8719 # else
8720         fprintf(fp, "%s\n", NCURSES_VERSION);
8721 # endif
8722 #else
8723 # ifdef __NCURSES_H
8724         fprintf(fp, "old\n");
8725 # else
8726         make an error
8727 # endif
8728 #endif
8729         ${cf_cv_main_return:-return}(0);
8730 }
8731 _ACEOF
8732 rm -f conftest$ac_exeext
8733 if { (eval echo "$as_me:8733: \"$ac_link\"") >&5
8734   (eval $ac_link) 2>&5
8735   ac_status=$?
8736   echo "$as_me:8736: \$? = $ac_status" >&5
8737   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8738   { (eval echo "$as_me:8738: \"$ac_try\"") >&5
8739   (eval $ac_try) 2>&5
8740   ac_status=$?
8741   echo "$as_me:8741: \$? = $ac_status" >&5
8742   (exit $ac_status); }; }; then
8743
8744         cf_cv_ncurses_version=`cat $cf_tempfile`
8745 else
8746   echo "$as_me: program exited with status $ac_status" >&5
8747 echo "$as_me: failed program was:" >&5
8748 cat conftest.$ac_ext >&5
8749 fi
8750 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8751 fi
8752         rm -f $cf_tempfile
8753
8754 fi
8755 echo "$as_me:8755: result: $cf_cv_ncurses_version" >&5
8756 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8757 test "$cf_cv_ncurses_version" = no ||
8758 cat >>confdefs.h <<\EOF
8759 #define NCURSES 1
8760 EOF
8761
8762 cf_nculib_root=$cf_cv_screen
8763         # This works, except for the special case where we find gpm, but
8764         # ncurses is in a nonstandard location via $LIBS, and we really want
8765         # to link gpm.
8766 cf_ncurses_LIBS=""
8767 cf_ncurses_SAVE="$LIBS"
8768 echo "$as_me:8768: checking for Gpm_Open in -lgpm" >&5
8769 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8770 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8771   echo $ECHO_N "(cached) $ECHO_C" >&6
8772 else
8773   ac_check_lib_save_LIBS=$LIBS
8774 LIBS="-lgpm  $LIBS"
8775 cat >conftest.$ac_ext <<_ACEOF
8776 #line 8776 "configure"
8777 #include "confdefs.h"
8778
8779 /* Override any gcc2 internal prototype to avoid an error.  */
8780 #ifdef __cplusplus
8781 extern "C"
8782 #endif
8783 /* We use char because int might match the return type of a gcc2
8784    builtin and then its argument prototype would still apply.  */
8785 char Gpm_Open ();
8786 int
8787 main (void)
8788 {
8789 Gpm_Open ();
8790   ;
8791   return 0;
8792 }
8793 _ACEOF
8794 rm -f conftest.$ac_objext conftest$ac_exeext
8795 if { (eval echo "$as_me:8795: \"$ac_link\"") >&5
8796   (eval $ac_link) 2>&5
8797   ac_status=$?
8798   echo "$as_me:8798: \$? = $ac_status" >&5
8799   (exit $ac_status); } &&
8800          { ac_try='test -s conftest$ac_exeext'
8801   { (eval echo "$as_me:8801: \"$ac_try\"") >&5
8802   (eval $ac_try) 2>&5
8803   ac_status=$?
8804   echo "$as_me:8804: \$? = $ac_status" >&5
8805   (exit $ac_status); }; }; then
8806   ac_cv_lib_gpm_Gpm_Open=yes
8807 else
8808   echo "$as_me: failed program was:" >&5
8809 cat conftest.$ac_ext >&5
8810 ac_cv_lib_gpm_Gpm_Open=no
8811 fi
8812 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8813 LIBS=$ac_check_lib_save_LIBS
8814 fi
8815 echo "$as_me:8815: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8816 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8817 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8818   echo "$as_me:8818: checking for initscr in -lgpm" >&5
8819 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8820 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8821   echo $ECHO_N "(cached) $ECHO_C" >&6
8822 else
8823   ac_check_lib_save_LIBS=$LIBS
8824 LIBS="-lgpm  $LIBS"
8825 cat >conftest.$ac_ext <<_ACEOF
8826 #line 8826 "configure"
8827 #include "confdefs.h"
8828
8829 /* Override any gcc2 internal prototype to avoid an error.  */
8830 #ifdef __cplusplus
8831 extern "C"
8832 #endif
8833 /* We use char because int might match the return type of a gcc2
8834    builtin and then its argument prototype would still apply.  */
8835 char initscr ();
8836 int
8837 main (void)
8838 {
8839 initscr ();
8840   ;
8841   return 0;
8842 }
8843 _ACEOF
8844 rm -f conftest.$ac_objext conftest$ac_exeext
8845 if { (eval echo "$as_me:8845: \"$ac_link\"") >&5
8846   (eval $ac_link) 2>&5
8847   ac_status=$?
8848   echo "$as_me:8848: \$? = $ac_status" >&5
8849   (exit $ac_status); } &&
8850          { ac_try='test -s conftest$ac_exeext'
8851   { (eval echo "$as_me:8851: \"$ac_try\"") >&5
8852   (eval $ac_try) 2>&5
8853   ac_status=$?
8854   echo "$as_me:8854: \$? = $ac_status" >&5
8855   (exit $ac_status); }; }; then
8856   ac_cv_lib_gpm_initscr=yes
8857 else
8858   echo "$as_me: failed program was:" >&5
8859 cat conftest.$ac_ext >&5
8860 ac_cv_lib_gpm_initscr=no
8861 fi
8862 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8863 LIBS=$ac_check_lib_save_LIBS
8864 fi
8865 echo "$as_me:8865: result: $ac_cv_lib_gpm_initscr" >&5
8866 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8867 if test $ac_cv_lib_gpm_initscr = yes; then
8868   LIBS="$cf_ncurses_SAVE"
8869 else
8870   cf_ncurses_LIBS="-lgpm"
8871 fi
8872
8873 fi
8874
8875 case $host_os in
8876 (freebsd*)
8877         # This is only necessary if you are linking against an obsolete
8878         # version of ncurses (but it should do no harm, since it's static).
8879         if test "$cf_nculib_root" = ncurses ; then
8880                 echo "$as_me:8880: checking for tgoto in -lmytinfo" >&5
8881 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8882 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8883   echo $ECHO_N "(cached) $ECHO_C" >&6
8884 else
8885   ac_check_lib_save_LIBS=$LIBS
8886 LIBS="-lmytinfo  $LIBS"
8887 cat >conftest.$ac_ext <<_ACEOF
8888 #line 8888 "configure"
8889 #include "confdefs.h"
8890
8891 /* Override any gcc2 internal prototype to avoid an error.  */
8892 #ifdef __cplusplus
8893 extern "C"
8894 #endif
8895 /* We use char because int might match the return type of a gcc2
8896    builtin and then its argument prototype would still apply.  */
8897 char tgoto ();
8898 int
8899 main (void)
8900 {
8901 tgoto ();
8902   ;
8903   return 0;
8904 }
8905 _ACEOF
8906 rm -f conftest.$ac_objext conftest$ac_exeext
8907 if { (eval echo "$as_me:8907: \"$ac_link\"") >&5
8908   (eval $ac_link) 2>&5
8909   ac_status=$?
8910   echo "$as_me:8910: \$? = $ac_status" >&5
8911   (exit $ac_status); } &&
8912          { ac_try='test -s conftest$ac_exeext'
8913   { (eval echo "$as_me:8913: \"$ac_try\"") >&5
8914   (eval $ac_try) 2>&5
8915   ac_status=$?
8916   echo "$as_me:8916: \$? = $ac_status" >&5
8917   (exit $ac_status); }; }; then
8918   ac_cv_lib_mytinfo_tgoto=yes
8919 else
8920   echo "$as_me: failed program was:" >&5
8921 cat conftest.$ac_ext >&5
8922 ac_cv_lib_mytinfo_tgoto=no
8923 fi
8924 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8925 LIBS=$ac_check_lib_save_LIBS
8926 fi
8927 echo "$as_me:8927: result: $ac_cv_lib_mytinfo_tgoto" >&5
8928 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8929 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8930   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8931 fi
8932
8933         fi
8934         ;;
8935 esac
8936
8937 cf_add_libs="$cf_ncurses_LIBS"
8938 # Filter out duplicates - this happens with badly-designed ".pc" files...
8939 for cf_add_1lib in $LIBS
8940 do
8941         for cf_add_2lib in $cf_add_libs
8942         do
8943                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8944                 then
8945                         cf_add_1lib=
8946                         break
8947                 fi
8948         done
8949         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8950 done
8951 LIBS="$cf_add_libs"
8952
8953 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8954 then
8955
8956 cf_add_libs="-l$cf_nculib_root"
8957 # Filter out duplicates - this happens with badly-designed ".pc" files...
8958 for cf_add_1lib in $LIBS
8959 do
8960         for cf_add_2lib in $cf_add_libs
8961         do
8962                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8963                 then
8964                         cf_add_1lib=
8965                         break
8966                 fi
8967         done
8968         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8969 done
8970 LIBS="$cf_add_libs"
8971
8972 else
8973
8974         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8975         cf_libdir=""
8976         echo "$as_me:8976: checking for initscr" >&5
8977 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8978 if test "${ac_cv_func_initscr+set}" = set; then
8979   echo $ECHO_N "(cached) $ECHO_C" >&6
8980 else
8981   cat >conftest.$ac_ext <<_ACEOF
8982 #line 8982 "configure"
8983 #include "confdefs.h"
8984 #define initscr autoconf_temporary
8985 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8986 #undef initscr
8987
8988 #ifdef __cplusplus
8989 extern "C"
8990 #endif
8991
8992 /* We use char because int might match the return type of a gcc2
8993    builtin and then its argument prototype would still apply.  */
8994 char initscr (void);
8995
8996 int
8997 main (void)
8998 {
8999
9000 /* The GNU C library defines stubs for functions which it implements
9001     to always fail with ENOSYS.  Some functions are actually named
9002     something starting with __ and the normal name is an alias.  */
9003 #if defined (__stub_initscr) || defined (__stub___initscr)
9004 #error found stub for initscr
9005 #endif
9006
9007         return initscr ();
9008   ;
9009   return 0;
9010 }
9011 _ACEOF
9012 rm -f conftest.$ac_objext conftest$ac_exeext
9013 if { (eval echo "$as_me:9013: \"$ac_link\"") >&5
9014   (eval $ac_link) 2>&5
9015   ac_status=$?
9016   echo "$as_me:9016: \$? = $ac_status" >&5
9017   (exit $ac_status); } &&
9018          { ac_try='test -s conftest$ac_exeext'
9019   { (eval echo "$as_me:9019: \"$ac_try\"") >&5
9020   (eval $ac_try) 2>&5
9021   ac_status=$?
9022   echo "$as_me:9022: \$? = $ac_status" >&5
9023   (exit $ac_status); }; }; then
9024   ac_cv_func_initscr=yes
9025 else
9026   echo "$as_me: failed program was:" >&5
9027 cat conftest.$ac_ext >&5
9028 ac_cv_func_initscr=no
9029 fi
9030 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9031 fi
9032 echo "$as_me:9032: result: $ac_cv_func_initscr" >&5
9033 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9034 if test $ac_cv_func_initscr = yes; then
9035   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9036 else
9037
9038                 cf_save_LIBS="$LIBS"
9039                 echo "$as_me:9039: checking for initscr in -l$cf_nculib_root" >&5
9040 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9041                 LIBS="-l$cf_nculib_root $LIBS"
9042                 cat >conftest.$ac_ext <<_ACEOF
9043 #line 9043 "configure"
9044 #include "confdefs.h"
9045 #include <${cf_cv_ncurses_header:-curses.h}>
9046 int
9047 main (void)
9048 {
9049 initscr()
9050   ;
9051   return 0;
9052 }
9053 _ACEOF
9054 rm -f conftest.$ac_objext conftest$ac_exeext
9055 if { (eval echo "$as_me:9055: \"$ac_link\"") >&5
9056   (eval $ac_link) 2>&5
9057   ac_status=$?
9058   echo "$as_me:9058: \$? = $ac_status" >&5
9059   (exit $ac_status); } &&
9060          { ac_try='test -s conftest$ac_exeext'
9061   { (eval echo "$as_me:9061: \"$ac_try\"") >&5
9062   (eval $ac_try) 2>&5
9063   ac_status=$?
9064   echo "$as_me:9064: \$? = $ac_status" >&5
9065   (exit $ac_status); }; }; then
9066   echo "$as_me:9066: result: yes" >&5
9067 echo "${ECHO_T}yes" >&6
9068                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9069
9070 else
9071   echo "$as_me: failed program was:" >&5
9072 cat conftest.$ac_ext >&5
9073 echo "$as_me:9073: result: no" >&5
9074 echo "${ECHO_T}no" >&6
9075
9076 cf_search=
9077 cf_library_path_list=""
9078 if test -n "${LDFLAGS}${LIBS}" ; then
9079         for cf_library_path in $LDFLAGS $LIBS
9080         do
9081                 case $cf_library_path in
9082                 (-L*)
9083                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9084
9085 test "x$cf_library_path" != "xNONE" && \
9086 test -d "$cf_library_path" && \
9087  {
9088         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9089         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9090         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9091         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9092         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9093         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
9094 }
9095
9096                         cf_library_path_list="$cf_library_path_list $cf_search"
9097                         ;;
9098                 esac
9099         done
9100 fi
9101
9102 cf_search=
9103
9104 test "x$prefix" != "xNONE" && \
9105 test -d "$prefix" && \
9106  {
9107         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9108         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9109         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9110         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9111         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9112         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9113 }
9114
9115 for cf_subdir_prefix in \
9116         /usr \
9117         /usr/local \
9118         /usr/pkg \
9119         /opt \
9120         /opt/local \
9121         $HOME
9122 do
9123
9124 test "x$cf_subdir_prefix" != "x$prefix" && \
9125 test -d "$cf_subdir_prefix" && \
9126 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9127         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9128         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9129         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9130         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9131         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9132         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
9133 }
9134
9135 done
9136
9137 cf_search="$cf_library_path_list $cf_search"
9138
9139                         for cf_libdir in $cf_search
9140                         do
9141                                 echo "$as_me:9141: checking for -l$cf_nculib_root in $cf_libdir" >&5
9142 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9143                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9144                                 cat >conftest.$ac_ext <<_ACEOF
9145 #line 9145 "configure"
9146 #include "confdefs.h"
9147 #include <${cf_cv_ncurses_header:-curses.h}>
9148 int
9149 main (void)
9150 {
9151 initscr()
9152   ;
9153   return 0;
9154 }
9155 _ACEOF
9156 rm -f conftest.$ac_objext conftest$ac_exeext
9157 if { (eval echo "$as_me:9157: \"$ac_link\"") >&5
9158   (eval $ac_link) 2>&5
9159   ac_status=$?
9160   echo "$as_me:9160: \$? = $ac_status" >&5
9161   (exit $ac_status); } &&
9162          { ac_try='test -s conftest$ac_exeext'
9163   { (eval echo "$as_me:9163: \"$ac_try\"") >&5
9164   (eval $ac_try) 2>&5
9165   ac_status=$?
9166   echo "$as_me:9166: \$? = $ac_status" >&5
9167   (exit $ac_status); }; }; then
9168   echo "$as_me:9168: result: yes" >&5
9169 echo "${ECHO_T}yes" >&6
9170                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9171                                          break
9172 else
9173   echo "$as_me: failed program was:" >&5
9174 cat conftest.$ac_ext >&5
9175 echo "$as_me:9175: result: no" >&5
9176 echo "${ECHO_T}no" >&6
9177                                          LIBS="$cf_save_LIBS"
9178 fi
9179 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9180                         done
9181
9182 fi
9183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9184
9185 fi
9186
9187 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9188
9189 if test $cf_found_library = no ; then
9190         { { echo "$as_me:9190: error: Cannot link $cf_nculib_root library" >&5
9191 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9192    { (exit 1); exit 1; }; }
9193 fi
9194
9195 fi
9196
9197 if test -n "$cf_ncurses_LIBS" ; then
9198         echo "$as_me:9198: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9199 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9200         cf_ncurses_SAVE="$LIBS"
9201         for p in $cf_ncurses_LIBS ; do
9202                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9203                 if test "$q" != "$LIBS" ; then
9204                         LIBS="$q"
9205                 fi
9206         done
9207         cat >conftest.$ac_ext <<_ACEOF
9208 #line 9208 "configure"
9209 #include "confdefs.h"
9210 #include <${cf_cv_ncurses_header:-curses.h}>
9211 int
9212 main (void)
9213 {
9214 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9215   ;
9216   return 0;
9217 }
9218 _ACEOF
9219 rm -f conftest.$ac_objext conftest$ac_exeext
9220 if { (eval echo "$as_me:9220: \"$ac_link\"") >&5
9221   (eval $ac_link) 2>&5
9222   ac_status=$?
9223   echo "$as_me:9223: \$? = $ac_status" >&5
9224   (exit $ac_status); } &&
9225          { ac_try='test -s conftest$ac_exeext'
9226   { (eval echo "$as_me:9226: \"$ac_try\"") >&5
9227   (eval $ac_try) 2>&5
9228   ac_status=$?
9229   echo "$as_me:9229: \$? = $ac_status" >&5
9230   (exit $ac_status); }; }; then
9231   echo "$as_me:9231: result: yes" >&5
9232 echo "${ECHO_T}yes" >&6
9233 else
9234   echo "$as_me: failed program was:" >&5
9235 cat conftest.$ac_ext >&5
9236 echo "$as_me:9236: result: no" >&5
9237 echo "${ECHO_T}no" >&6
9238                  LIBS="$cf_ncurses_SAVE"
9239 fi
9240 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9241 fi
9242
9243 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9244
9245 cat >>confdefs.h <<EOF
9246 #define $cf_nculib_ROOT 1
9247 EOF
9248
9249         fi
9250 else
9251         NCURSES_CONFIG=none
9252 fi
9253
9254         ;;
9255 (ncurses*)
9256
9257 cf_ncuconfig_root=$cf_cv_screen
9258 cf_have_ncuconfig=no
9259
9260 if test "x${PKG_CONFIG:=none}" != xnone; then
9261         echo "$as_me:9261: checking pkg-config for $cf_ncuconfig_root" >&5
9262 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9263         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9264                 echo "$as_me:9264: result: yes" >&5
9265 echo "${ECHO_T}yes" >&6
9266
9267                 echo "$as_me:9267: checking if the $cf_ncuconfig_root package files work" >&5
9268 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9269                 cf_have_ncuconfig=unknown
9270
9271                 cf_save_CPPFLAGS="$CPPFLAGS"
9272                 cf_save_LIBS="$LIBS"
9273
9274 cf_fix_cppflags=no
9275 cf_new_cflags=
9276 cf_new_cppflags=
9277 cf_new_extra_cppflags=
9278
9279 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
9280 do
9281 case $cf_fix_cppflags in
9282 (no)
9283         case $cf_add_cflags in
9284         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9285                 case $cf_add_cflags in
9286                 (-D*)
9287                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9288
9289                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9290                                 && test -z "${cf_tst_cflags}" \
9291                                 && cf_fix_cppflags=yes
9292
9293                         if test $cf_fix_cppflags = yes ; then
9294
9295         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9296         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9297
9298                                 continue
9299                         elif test "${cf_tst_cflags}" = "\"'" ; then
9300
9301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9303
9304                                 continue
9305                         fi
9306                         ;;
9307                 esac
9308                 case "$CPPFLAGS" in
9309                 (*$cf_add_cflags)
9310                         ;;
9311                 (*)
9312                         case $cf_add_cflags in
9313                         (-D*)
9314                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9315
9316 CPPFLAGS=`echo "$CPPFLAGS" | \
9317         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9318                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9319
9320                                 ;;
9321                         esac
9322
9323         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9324         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9325
9326                         ;;
9327                 esac
9328                 ;;
9329         (*)
9330
9331         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9332         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9333
9334                 ;;
9335         esac
9336         ;;
9337 (yes)
9338
9339         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9340         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9341
9342         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9343
9344         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9345                 && test -z "${cf_tst_cflags}" \
9346                 && cf_fix_cppflags=no
9347         ;;
9348 esac
9349 done
9350
9351 if test -n "$cf_new_cflags" ; then
9352
9353         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9354         CFLAGS="${CFLAGS}$cf_new_cflags"
9355
9356 fi
9357
9358 if test -n "$cf_new_cppflags" ; then
9359
9360         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9361         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9362
9363 fi
9364
9365 if test -n "$cf_new_extra_cppflags" ; then
9366
9367         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9368         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9369
9370 fi
9371
9372 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9373 # Filter out duplicates - this happens with badly-designed ".pc" files...
9374 for cf_add_1lib in $LIBS
9375 do
9376         for cf_add_2lib in $cf_add_libs
9377         do
9378                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9379                 then
9380                         cf_add_1lib=
9381                         break
9382                 fi
9383         done
9384         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9385 done
9386 LIBS="$cf_add_libs"
9387
9388                 cat >conftest.$ac_ext <<_ACEOF
9389 #line 9389 "configure"
9390 #include "confdefs.h"
9391 #include <${cf_cv_ncurses_header:-curses.h}>
9392 int
9393 main (void)
9394 {
9395 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9396   ;
9397   return 0;
9398 }
9399 _ACEOF
9400 rm -f conftest.$ac_objext conftest$ac_exeext
9401 if { (eval echo "$as_me:9401: \"$ac_link\"") >&5
9402   (eval $ac_link) 2>&5
9403   ac_status=$?
9404   echo "$as_me:9404: \$? = $ac_status" >&5
9405   (exit $ac_status); } &&
9406          { ac_try='test -s conftest$ac_exeext'
9407   { (eval echo "$as_me:9407: \"$ac_try\"") >&5
9408   (eval $ac_try) 2>&5
9409   ac_status=$?
9410   echo "$as_me:9410: \$? = $ac_status" >&5
9411   (exit $ac_status); }; }; then
9412   if test "$cross_compiling" = yes; then
9413   cf_have_ncuconfig=maybe
9414 else
9415   cat >conftest.$ac_ext <<_ACEOF
9416 #line 9416 "configure"
9417 #include "confdefs.h"
9418 #include <${cf_cv_ncurses_header:-curses.h}>
9419                                 int main(void)
9420                                 { char *xx = curses_version(); return (xx == 0); }
9421 _ACEOF
9422 rm -f conftest$ac_exeext
9423 if { (eval echo "$as_me:9423: \"$ac_link\"") >&5
9424   (eval $ac_link) 2>&5
9425   ac_status=$?
9426   echo "$as_me:9426: \$? = $ac_status" >&5
9427   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9428   { (eval echo "$as_me:9428: \"$ac_try\"") >&5
9429   (eval $ac_try) 2>&5
9430   ac_status=$?
9431   echo "$as_me:9431: \$? = $ac_status" >&5
9432   (exit $ac_status); }; }; then
9433   cf_have_ncuconfig=yes
9434 else
9435   echo "$as_me: program exited with status $ac_status" >&5
9436 echo "$as_me: failed program was:" >&5
9437 cat conftest.$ac_ext >&5
9438 cf_have_ncuconfig=no
9439 fi
9440 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9441 fi
9442 else
9443   echo "$as_me: failed program was:" >&5
9444 cat conftest.$ac_ext >&5
9445 cf_have_ncuconfig=no
9446 fi
9447 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9448                 echo "$as_me:9448: result: $cf_have_ncuconfig" >&5
9449 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9450                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9451                 if test "$cf_have_ncuconfig" != "yes"
9452                 then
9453                         CPPFLAGS="$cf_save_CPPFLAGS"
9454                         LIBS="$cf_save_LIBS"
9455                         NCURSES_CONFIG_PKG=none
9456                 else
9457
9458 cat >>confdefs.h <<\EOF
9459 #define NCURSES 1
9460 EOF
9461
9462                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9463
9464 echo "$as_me:9464: checking for terminfo header" >&5
9465 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9466 if test "${cf_cv_term_header+set}" = set; then
9467   echo $ECHO_N "(cached) $ECHO_C" >&6
9468 else
9469
9470 case ${cf_cv_ncurses_header} in
9471 (*/ncurses.h|*/ncursesw.h)
9472         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9473         ;;
9474 (*)
9475         cf_term_header=term.h
9476         ;;
9477 esac
9478
9479 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9480 do
9481 cat >conftest.$ac_ext <<_ACEOF
9482 #line 9482 "configure"
9483 #include "confdefs.h"
9484 #include <stdio.h>
9485 #include <${cf_cv_ncurses_header:-curses.h}>
9486 #include <$cf_test>
9487
9488 int
9489 main (void)
9490 {
9491 int x = auto_left_margin
9492   ;
9493   return 0;
9494 }
9495 _ACEOF
9496 rm -f conftest.$ac_objext
9497 if { (eval echo "$as_me:9497: \"$ac_compile\"") >&5
9498   (eval $ac_compile) 2>&5
9499   ac_status=$?
9500   echo "$as_me:9500: \$? = $ac_status" >&5
9501   (exit $ac_status); } &&
9502          { ac_try='test -s conftest.$ac_objext'
9503   { (eval echo "$as_me:9503: \"$ac_try\"") >&5
9504   (eval $ac_try) 2>&5
9505   ac_status=$?
9506   echo "$as_me:9506: \$? = $ac_status" >&5
9507   (exit $ac_status); }; }; then
9508
9509         cf_cv_term_header="$cf_test"
9510 else
9511   echo "$as_me: failed program was:" >&5
9512 cat conftest.$ac_ext >&5
9513
9514         cf_cv_term_header=unknown
9515
9516 fi
9517 rm -f conftest.$ac_objext conftest.$ac_ext
9518         test "$cf_cv_term_header" != unknown && break
9519 done
9520
9521 fi
9522 echo "$as_me:9522: result: $cf_cv_term_header" >&5
9523 echo "${ECHO_T}$cf_cv_term_header" >&6
9524
9525 # Set definitions to allow ifdef'ing to accommodate subdirectories
9526
9527 case $cf_cv_term_header in
9528 (*term.h)
9529
9530 cat >>confdefs.h <<\EOF
9531 #define HAVE_TERM_H 1
9532 EOF
9533
9534         ;;
9535 esac
9536
9537 case $cf_cv_term_header in
9538 (ncurses/term.h)
9539
9540 cat >>confdefs.h <<\EOF
9541 #define HAVE_NCURSES_TERM_H 1
9542 EOF
9543
9544         ;;
9545 (ncursesw/term.h)
9546
9547 cat >>confdefs.h <<\EOF
9548 #define HAVE_NCURSESW_TERM_H 1
9549 EOF
9550
9551         ;;
9552 esac
9553
9554                 fi
9555
9556         else
9557                 echo "$as_me:9557: result: no" >&5
9558 echo "${ECHO_T}no" >&6
9559                 NCURSES_CONFIG_PKG=none
9560         fi
9561 else
9562         NCURSES_CONFIG_PKG=none
9563 fi
9564
9565 if test "x$cf_have_ncuconfig" = "xno"; then
9566         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9567
9568 if test -n "$ac_tool_prefix"; then
9569   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9570   do
9571     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9572 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9573 echo "$as_me:9573: checking for $ac_word" >&5
9574 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9575 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9576   echo $ECHO_N "(cached) $ECHO_C" >&6
9577 else
9578   if test -n "$NCURSES_CONFIG"; then
9579   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9580 else
9581   ac_save_IFS=$IFS; IFS=$ac_path_separator
9582 ac_dummy="$PATH"
9583 for ac_dir in $ac_dummy; do
9584   IFS=$ac_save_IFS
9585   test -z "$ac_dir" && ac_dir=.
9586   $as_executable_p "$ac_dir/$ac_word" || continue
9587 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9588 echo "$as_me:9588: found $ac_dir/$ac_word" >&5
9589 break
9590 done
9591
9592 fi
9593 fi
9594 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9595 if test -n "$NCURSES_CONFIG"; then
9596   echo "$as_me:9596: result: $NCURSES_CONFIG" >&5
9597 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9598 else
9599   echo "$as_me:9599: result: no" >&5
9600 echo "${ECHO_T}no" >&6
9601 fi
9602
9603     test -n "$NCURSES_CONFIG" && break
9604   done
9605 fi
9606 if test -z "$NCURSES_CONFIG"; then
9607   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9608   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9609 do
9610   # Extract the first word of "$ac_prog", so it can be a program name with args.
9611 set dummy $ac_prog; ac_word=$2
9612 echo "$as_me:9612: checking for $ac_word" >&5
9613 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9614 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9615   echo $ECHO_N "(cached) $ECHO_C" >&6
9616 else
9617   if test -n "$ac_ct_NCURSES_CONFIG"; then
9618   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9619 else
9620   ac_save_IFS=$IFS; IFS=$ac_path_separator
9621 ac_dummy="$PATH"
9622 for ac_dir in $ac_dummy; do
9623   IFS=$ac_save_IFS
9624   test -z "$ac_dir" && ac_dir=.
9625   $as_executable_p "$ac_dir/$ac_word" || continue
9626 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9627 echo "$as_me:9627: found $ac_dir/$ac_word" >&5
9628 break
9629 done
9630
9631 fi
9632 fi
9633 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9634 if test -n "$ac_ct_NCURSES_CONFIG"; then
9635   echo "$as_me:9635: result: $ac_ct_NCURSES_CONFIG" >&5
9636 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9637 else
9638   echo "$as_me:9638: result: no" >&5
9639 echo "${ECHO_T}no" >&6
9640 fi
9641
9642   test -n "$ac_ct_NCURSES_CONFIG" && break
9643 done
9644 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9645
9646   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9647 fi
9648
9649         if test "$NCURSES_CONFIG" != none ; then
9650
9651 cf_fix_cppflags=no
9652 cf_new_cflags=
9653 cf_new_cppflags=
9654 cf_new_extra_cppflags=
9655
9656 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9657 do
9658 case $cf_fix_cppflags in
9659 (no)
9660         case $cf_add_cflags in
9661         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9662                 case $cf_add_cflags in
9663                 (-D*)
9664                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9665
9666                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9667                                 && test -z "${cf_tst_cflags}" \
9668                                 && cf_fix_cppflags=yes
9669
9670                         if test $cf_fix_cppflags = yes ; then
9671
9672         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9673         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9674
9675                                 continue
9676                         elif test "${cf_tst_cflags}" = "\"'" ; then
9677
9678         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9679         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9680
9681                                 continue
9682                         fi
9683                         ;;
9684                 esac
9685                 case "$CPPFLAGS" in
9686                 (*$cf_add_cflags)
9687                         ;;
9688                 (*)
9689                         case $cf_add_cflags in
9690                         (-D*)
9691                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9692
9693 CPPFLAGS=`echo "$CPPFLAGS" | \
9694         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9695                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9696
9697                                 ;;
9698                         esac
9699
9700         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9701         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9702
9703                         ;;
9704                 esac
9705                 ;;
9706         (*)
9707
9708         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9709         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9710
9711                 ;;
9712         esac
9713         ;;
9714 (yes)
9715
9716         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9717         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9718
9719         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9720
9721         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9722                 && test -z "${cf_tst_cflags}" \
9723                 && cf_fix_cppflags=no
9724         ;;
9725 esac
9726 done
9727
9728 if test -n "$cf_new_cflags" ; then
9729
9730         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9731         CFLAGS="${CFLAGS}$cf_new_cflags"
9732
9733 fi
9734
9735 if test -n "$cf_new_cppflags" ; then
9736
9737         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9738         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9739
9740 fi
9741
9742 if test -n "$cf_new_extra_cppflags" ; then
9743
9744         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9745         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9746
9747 fi
9748
9749 cf_add_libs="`$NCURSES_CONFIG --libs`"
9750 # Filter out duplicates - this happens with badly-designed ".pc" files...
9751 for cf_add_1lib in $LIBS
9752 do
9753         for cf_add_2lib in $cf_add_libs
9754         do
9755                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9756                 then
9757                         cf_add_1lib=
9758                         break
9759                 fi
9760         done
9761         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9762 done
9763 LIBS="$cf_add_libs"
9764
9765                 # even with config script, some packages use no-override for curses.h
9766
9767 echo "$as_me:9767: checking if we have identified curses headers" >&5
9768 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9769 if test "${cf_cv_ncurses_header+set}" = set; then
9770   echo $ECHO_N "(cached) $ECHO_C" >&6
9771 else
9772
9773 cf_cv_ncurses_header=none
9774 for cf_header in \
9775         ncurses.h $cf_cv_screen/ncurses.h \
9776         curses.h $cf_cv_screen/curses.h
9777 do
9778 cat >conftest.$ac_ext <<_ACEOF
9779 #line 9779 "configure"
9780 #include "confdefs.h"
9781 #include <${cf_header}>
9782 int
9783 main (void)
9784 {
9785 initscr(); tgoto("?", 0,0)
9786   ;
9787   return 0;
9788 }
9789 _ACEOF
9790 rm -f conftest.$ac_objext
9791 if { (eval echo "$as_me:9791: \"$ac_compile\"") >&5
9792   (eval $ac_compile) 2>&5
9793   ac_status=$?
9794   echo "$as_me:9794: \$? = $ac_status" >&5
9795   (exit $ac_status); } &&
9796          { ac_try='test -s conftest.$ac_objext'
9797   { (eval echo "$as_me:9797: \"$ac_try\"") >&5
9798   (eval $ac_try) 2>&5
9799   ac_status=$?
9800   echo "$as_me:9800: \$? = $ac_status" >&5
9801   (exit $ac_status); }; }; then
9802   cf_cv_ncurses_header=$cf_header; break
9803 else
9804   echo "$as_me: failed program was:" >&5
9805 cat conftest.$ac_ext >&5
9806 fi
9807 rm -f conftest.$ac_objext conftest.$ac_ext
9808 done
9809
9810 fi
9811 echo "$as_me:9811: result: $cf_cv_ncurses_header" >&5
9812 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9813
9814 if test "$cf_cv_ncurses_header" = none ; then
9815         { { echo "$as_me:9815: error: No curses header-files found" >&5
9816 echo "$as_me: error: No curses header-files found" >&2;}
9817    { (exit 1); exit 1; }; }
9818 fi
9819
9820 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9821
9822 for ac_header in $cf_cv_ncurses_header
9823 do
9824 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9825 echo "$as_me:9825: checking for $ac_header" >&5
9826 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9827 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9828   echo $ECHO_N "(cached) $ECHO_C" >&6
9829 else
9830   cat >conftest.$ac_ext <<_ACEOF
9831 #line 9831 "configure"
9832 #include "confdefs.h"
9833 #include <$ac_header>
9834 _ACEOF
9835 if { (eval echo "$as_me:9835: \"$ac_cpp conftest.$ac_ext\"") >&5
9836   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9837   ac_status=$?
9838   egrep -v '^ *\+' conftest.er1 >conftest.err
9839   rm -f conftest.er1
9840   cat conftest.err >&5
9841   echo "$as_me:9841: \$? = $ac_status" >&5
9842   (exit $ac_status); } >/dev/null; then
9843   if test -s conftest.err; then
9844     ac_cpp_err=$ac_c_preproc_warn_flag
9845   else
9846     ac_cpp_err=
9847   fi
9848 else
9849   ac_cpp_err=yes
9850 fi
9851 if test -z "$ac_cpp_err"; then
9852   eval "$as_ac_Header=yes"
9853 else
9854   echo "$as_me: failed program was:" >&5
9855   cat conftest.$ac_ext >&5
9856   eval "$as_ac_Header=no"
9857 fi
9858 rm -f conftest.err conftest.$ac_ext
9859 fi
9860 echo "$as_me:9860: result: `eval echo '${'$as_ac_Header'}'`" >&5
9861 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9862 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9863   cat >>confdefs.h <<EOF
9864 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9865 EOF
9866
9867 fi
9868 done
9869
9870 cat >>confdefs.h <<\EOF
9871 #define NCURSES 1
9872 EOF
9873
9874 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9875
9876                 cat >>confdefs.h <<EOF
9877 #define $cf_nculib_ROOT 1
9878 EOF
9879
9880                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9881
9882         else
9883
9884 cf_ncuhdr_root=$cf_cv_screen
9885
9886 test -n "$cf_cv_curses_dir" && \
9887 test "$cf_cv_curses_dir" != "no" && { \
9888
9889 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9890   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9891   do
9892         while test $cf_add_incdir != /usr/include
9893         do
9894           if test -d $cf_add_incdir
9895           then
9896                 cf_have_incdir=no
9897                 if test -n "$CFLAGS$CPPFLAGS" ; then
9898                   # a loop is needed to ensure we can add subdirs of existing dirs
9899                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9900                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9901                           cf_have_incdir=yes; break
9902                         fi
9903                   done
9904                 fi
9905
9906                 if test "$cf_have_incdir" = no ; then
9907                   if test "$cf_add_incdir" = /usr/local/include ; then
9908                         if test "$GCC" = yes
9909                         then
9910                           cf_save_CPPFLAGS=$CPPFLAGS
9911
9912         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9913         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9914
9915                           cat >conftest.$ac_ext <<_ACEOF
9916 #line 9916 "configure"
9917 #include "confdefs.h"
9918 #include <stdio.h>
9919 int
9920 main (void)
9921 {
9922 printf("Hello")
9923   ;
9924   return 0;
9925 }
9926 _ACEOF
9927 rm -f conftest.$ac_objext
9928 if { (eval echo "$as_me:9928: \"$ac_compile\"") >&5
9929   (eval $ac_compile) 2>&5
9930   ac_status=$?
9931   echo "$as_me:9931: \$? = $ac_status" >&5
9932   (exit $ac_status); } &&
9933          { ac_try='test -s conftest.$ac_objext'
9934   { (eval echo "$as_me:9934: \"$ac_try\"") >&5
9935   (eval $ac_try) 2>&5
9936   ac_status=$?
9937   echo "$as_me:9937: \$? = $ac_status" >&5
9938   (exit $ac_status); }; }; then
9939   :
9940 else
9941   echo "$as_me: failed program was:" >&5
9942 cat conftest.$ac_ext >&5
9943 cf_have_incdir=yes
9944 fi
9945 rm -f conftest.$ac_objext conftest.$ac_ext
9946                           CPPFLAGS=$cf_save_CPPFLAGS
9947                         fi
9948                   fi
9949                 fi
9950
9951                 if test "$cf_have_incdir" = no ; then
9952                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9953
9954 echo "${as_me:-configure}:9954: testing adding $cf_add_incdir to include-path ..." 1>&5
9955
9956                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9957
9958                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9959                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9960                   cf_add_incdir="$cf_top_incdir"
9961                 else
9962                   break
9963                 fi
9964           else
9965                 break
9966           fi
9967         done
9968   done
9969 fi
9970
9971 }
9972
9973 echo "$as_me:9973: checking for $cf_ncuhdr_root header in include-path" >&5
9974 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9975 if test "${cf_cv_ncurses_h+set}" = set; then
9976   echo $ECHO_N "(cached) $ECHO_C" >&6
9977 else
9978
9979         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9980         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9981         for cf_header in $cf_header_list
9982         do
9983
9984         cat >conftest.$ac_ext <<_ACEOF
9985 #line 9985 "configure"
9986 #include "confdefs.h"
9987
9988 #include <$cf_header>
9989 int
9990 main (void)
9991 {
9992
9993 #ifdef NCURSES_VERSION
9994
9995 printf("%s\n", NCURSES_VERSION);
9996 #else
9997 #ifdef __NCURSES_H
9998 printf("old\n");
9999 #else
10000         make an error
10001 #endif
10002 #endif
10003
10004   ;
10005   return 0;
10006 }
10007 _ACEOF
10008 rm -f conftest.$ac_objext
10009 if { (eval echo "$as_me:10009: \"$ac_compile\"") >&5
10010   (eval $ac_compile) 2>&5
10011   ac_status=$?
10012   echo "$as_me:10012: \$? = $ac_status" >&5
10013   (exit $ac_status); } &&
10014          { ac_try='test -s conftest.$ac_objext'
10015   { (eval echo "$as_me:10015: \"$ac_try\"") >&5
10016   (eval $ac_try) 2>&5
10017   ac_status=$?
10018   echo "$as_me:10018: \$? = $ac_status" >&5
10019   (exit $ac_status); }; }; then
10020   cf_cv_ncurses_h=$cf_header
10021
10022 else
10023   echo "$as_me: failed program was:" >&5
10024 cat conftest.$ac_ext >&5
10025 cf_cv_ncurses_h=no
10026 fi
10027 rm -f conftest.$ac_objext conftest.$ac_ext
10028
10029                 test "$cf_cv_ncurses_h" != no && break
10030         done
10031
10032 fi
10033 echo "$as_me:10033: result: $cf_cv_ncurses_h" >&5
10034 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10035
10036 if test "$cf_cv_ncurses_h" != no ; then
10037         cf_cv_ncurses_header=$cf_cv_ncurses_h
10038 else
10039
10040 echo "$as_me:10040: checking for $cf_ncuhdr_root include-path" >&5
10041 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10042 if test "${cf_cv_ncurses_h2+set}" = set; then
10043   echo $ECHO_N "(cached) $ECHO_C" >&6
10044 else
10045
10046         test -n "$verbose" && echo
10047
10048 cf_search=
10049
10050 # collect the current set of include-directories from compiler flags
10051 cf_header_path_list=""
10052 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10053         for cf_header_path in $CPPFLAGS $CFLAGS
10054         do
10055                 case $cf_header_path in
10056                 (-I*)
10057                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10058
10059 test "x$cf_header_path" != "xNONE" && \
10060 test -d "$cf_header_path" && \
10061  {
10062         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10063         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10064         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10065         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10066         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10067         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10068 }
10069
10070                         cf_header_path_list="$cf_header_path_list $cf_search"
10071                         ;;
10072                 esac
10073         done
10074 fi
10075
10076 # add the variations for the package we are looking for
10077
10078 cf_search=
10079
10080 test "x$prefix" != "xNONE" && \
10081 test -d "$prefix" && \
10082  {
10083         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10084         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10085         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10086         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10087         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10088         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10089 }
10090
10091 for cf_subdir_prefix in \
10092         /usr \
10093         /usr/local \
10094         /usr/pkg \
10095         /opt \
10096         /opt/local \
10097         $HOME
10098 do
10099
10100 test "x$cf_subdir_prefix" != "x$prefix" && \
10101 test -d "$cf_subdir_prefix" && \
10102 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10103         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10104         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10105         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10106         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10107         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10108         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10109 }
10110
10111 done
10112
10113 test "$includedir" != NONE && \
10114 test "$includedir" != "/usr/include" && \
10115 test -d "$includedir" && {
10116         test -d $includedir &&    cf_search="$cf_search $includedir"
10117         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10118 }
10119
10120 test "$oldincludedir" != NONE && \
10121 test "$oldincludedir" != "/usr/include" && \
10122 test -d "$oldincludedir" && {
10123         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10124         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10125 }
10126
10127 cf_search="$cf_search $cf_header_path_list"
10128
10129         test -n "$verbose" && echo search path $cf_search
10130         cf_save2_CPPFLAGS="$CPPFLAGS"
10131         for cf_incdir in $cf_search
10132         do
10133
10134 if test -n "$cf_incdir" ; then
10135   for cf_add_incdir in $cf_incdir
10136   do
10137         while test $cf_add_incdir != /usr/include
10138         do
10139           if test -d $cf_add_incdir
10140           then
10141                 cf_have_incdir=no
10142                 if test -n "$CFLAGS$CPPFLAGS" ; then
10143                   # a loop is needed to ensure we can add subdirs of existing dirs
10144                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10145                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10146                           cf_have_incdir=yes; break
10147                         fi
10148                   done
10149                 fi
10150
10151                 if test "$cf_have_incdir" = no ; then
10152                   if test "$cf_add_incdir" = /usr/local/include ; then
10153                         if test "$GCC" = yes
10154                         then
10155                           cf_save_CPPFLAGS=$CPPFLAGS
10156
10157         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10158         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10159
10160                           cat >conftest.$ac_ext <<_ACEOF
10161 #line 10161 "configure"
10162 #include "confdefs.h"
10163 #include <stdio.h>
10164 int
10165 main (void)
10166 {
10167 printf("Hello")
10168   ;
10169   return 0;
10170 }
10171 _ACEOF
10172 rm -f conftest.$ac_objext
10173 if { (eval echo "$as_me:10173: \"$ac_compile\"") >&5
10174   (eval $ac_compile) 2>&5
10175   ac_status=$?
10176   echo "$as_me:10176: \$? = $ac_status" >&5
10177   (exit $ac_status); } &&
10178          { ac_try='test -s conftest.$ac_objext'
10179   { (eval echo "$as_me:10179: \"$ac_try\"") >&5
10180   (eval $ac_try) 2>&5
10181   ac_status=$?
10182   echo "$as_me:10182: \$? = $ac_status" >&5
10183   (exit $ac_status); }; }; then
10184   :
10185 else
10186   echo "$as_me: failed program was:" >&5
10187 cat conftest.$ac_ext >&5
10188 cf_have_incdir=yes
10189 fi
10190 rm -f conftest.$ac_objext conftest.$ac_ext
10191                           CPPFLAGS=$cf_save_CPPFLAGS
10192                         fi
10193                   fi
10194                 fi
10195
10196                 if test "$cf_have_incdir" = no ; then
10197                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10198
10199 echo "${as_me:-configure}:10199: testing adding $cf_add_incdir to include-path ..." 1>&5
10200
10201                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10202
10203                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10204                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10205                   cf_add_incdir="$cf_top_incdir"
10206                 else
10207                   break
10208                 fi
10209           else
10210                 break
10211           fi
10212         done
10213   done
10214 fi
10215
10216                 for cf_header in \
10217                         ncurses.h \
10218                         curses.h
10219                 do
10220
10221         cat >conftest.$ac_ext <<_ACEOF
10222 #line 10222 "configure"
10223 #include "confdefs.h"
10224
10225 #include <$cf_header>
10226 int
10227 main (void)
10228 {
10229
10230 #ifdef NCURSES_VERSION
10231
10232 printf("%s\n", NCURSES_VERSION);
10233 #else
10234 #ifdef __NCURSES_H
10235 printf("old\n");
10236 #else
10237         make an error
10238 #endif
10239 #endif
10240
10241   ;
10242   return 0;
10243 }
10244 _ACEOF
10245 rm -f conftest.$ac_objext
10246 if { (eval echo "$as_me:10246: \"$ac_compile\"") >&5
10247   (eval $ac_compile) 2>&5
10248   ac_status=$?
10249   echo "$as_me:10249: \$? = $ac_status" >&5
10250   (exit $ac_status); } &&
10251          { ac_try='test -s conftest.$ac_objext'
10252   { (eval echo "$as_me:10252: \"$ac_try\"") >&5
10253   (eval $ac_try) 2>&5
10254   ac_status=$?
10255   echo "$as_me:10255: \$? = $ac_status" >&5
10256   (exit $ac_status); }; }; then
10257   cf_cv_ncurses_h2=$cf_header
10258
10259 else
10260   echo "$as_me: failed program was:" >&5
10261 cat conftest.$ac_ext >&5
10262 cf_cv_ncurses_h2=no
10263 fi
10264 rm -f conftest.$ac_objext conftest.$ac_ext
10265
10266                         if test "$cf_cv_ncurses_h2" != no ; then
10267                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10268                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10269                                 break
10270                         fi
10271                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10272                 done
10273                 CPPFLAGS="$cf_save2_CPPFLAGS"
10274                 test "$cf_cv_ncurses_h2" != no && break
10275         done
10276         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10276: error: not found" >&5
10277 echo "$as_me: error: not found" >&2;}
10278    { (exit 1); exit 1; }; }
10279
10280 fi
10281 echo "$as_me:10281: result: $cf_cv_ncurses_h2" >&5
10282 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10283
10284         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10285         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10286         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10287                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10288         fi
10289
10290 if test -n "$cf_1st_incdir" ; then
10291   for cf_add_incdir in $cf_1st_incdir
10292   do
10293         while test $cf_add_incdir != /usr/include
10294         do
10295           if test -d $cf_add_incdir
10296           then
10297                 cf_have_incdir=no
10298                 if test -n "$CFLAGS$CPPFLAGS" ; then
10299                   # a loop is needed to ensure we can add subdirs of existing dirs
10300                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10301                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10302                           cf_have_incdir=yes; break
10303                         fi
10304                   done
10305                 fi
10306
10307                 if test "$cf_have_incdir" = no ; then
10308                   if test "$cf_add_incdir" = /usr/local/include ; then
10309                         if test "$GCC" = yes
10310                         then
10311                           cf_save_CPPFLAGS=$CPPFLAGS
10312
10313         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10314         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10315
10316                           cat >conftest.$ac_ext <<_ACEOF
10317 #line 10317 "configure"
10318 #include "confdefs.h"
10319 #include <stdio.h>
10320 int
10321 main (void)
10322 {
10323 printf("Hello")
10324   ;
10325   return 0;
10326 }
10327 _ACEOF
10328 rm -f conftest.$ac_objext
10329 if { (eval echo "$as_me:10329: \"$ac_compile\"") >&5
10330   (eval $ac_compile) 2>&5
10331   ac_status=$?
10332   echo "$as_me:10332: \$? = $ac_status" >&5
10333   (exit $ac_status); } &&
10334          { ac_try='test -s conftest.$ac_objext'
10335   { (eval echo "$as_me:10335: \"$ac_try\"") >&5
10336   (eval $ac_try) 2>&5
10337   ac_status=$?
10338   echo "$as_me:10338: \$? = $ac_status" >&5
10339   (exit $ac_status); }; }; then
10340   :
10341 else
10342   echo "$as_me: failed program was:" >&5
10343 cat conftest.$ac_ext >&5
10344 cf_have_incdir=yes
10345 fi
10346 rm -f conftest.$ac_objext conftest.$ac_ext
10347                           CPPFLAGS=$cf_save_CPPFLAGS
10348                         fi
10349                   fi
10350                 fi
10351
10352                 if test "$cf_have_incdir" = no ; then
10353                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10354
10355 echo "${as_me:-configure}:10355: testing adding $cf_add_incdir to include-path ..." 1>&5
10356
10357                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10358
10359                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10360                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10361                   cf_add_incdir="$cf_top_incdir"
10362                 else
10363                   break
10364                 fi
10365           else
10366                 break
10367           fi
10368         done
10369   done
10370 fi
10371
10372 fi
10373
10374 # Set definitions to allow ifdef'ing for ncurses.h
10375
10376 case $cf_cv_ncurses_header in
10377 (*ncurses.h)
10378
10379 cat >>confdefs.h <<\EOF
10380 #define HAVE_NCURSES_H 1
10381 EOF
10382
10383         ;;
10384 esac
10385
10386 case $cf_cv_ncurses_header in
10387 (ncurses/curses.h|ncurses/ncurses.h)
10388
10389 cat >>confdefs.h <<\EOF
10390 #define HAVE_NCURSES_NCURSES_H 1
10391 EOF
10392
10393         ;;
10394 (ncursesw/curses.h|ncursesw/ncurses.h)
10395
10396 cat >>confdefs.h <<\EOF
10397 #define HAVE_NCURSESW_NCURSES_H 1
10398 EOF
10399
10400         ;;
10401 esac
10402
10403 echo "$as_me:10403: checking for terminfo header" >&5
10404 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10405 if test "${cf_cv_term_header+set}" = set; then
10406   echo $ECHO_N "(cached) $ECHO_C" >&6
10407 else
10408
10409 case ${cf_cv_ncurses_header} in
10410 (*/ncurses.h|*/ncursesw.h)
10411         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10412         ;;
10413 (*)
10414         cf_term_header=term.h
10415         ;;
10416 esac
10417
10418 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10419 do
10420 cat >conftest.$ac_ext <<_ACEOF
10421 #line 10421 "configure"
10422 #include "confdefs.h"
10423 #include <stdio.h>
10424 #include <${cf_cv_ncurses_header:-curses.h}>
10425 #include <$cf_test>
10426
10427 int
10428 main (void)
10429 {
10430 int x = auto_left_margin
10431   ;
10432   return 0;
10433 }
10434 _ACEOF
10435 rm -f conftest.$ac_objext
10436 if { (eval echo "$as_me:10436: \"$ac_compile\"") >&5
10437   (eval $ac_compile) 2>&5
10438   ac_status=$?
10439   echo "$as_me:10439: \$? = $ac_status" >&5
10440   (exit $ac_status); } &&
10441          { ac_try='test -s conftest.$ac_objext'
10442   { (eval echo "$as_me:10442: \"$ac_try\"") >&5
10443   (eval $ac_try) 2>&5
10444   ac_status=$?
10445   echo "$as_me:10445: \$? = $ac_status" >&5
10446   (exit $ac_status); }; }; then
10447
10448         cf_cv_term_header="$cf_test"
10449 else
10450   echo "$as_me: failed program was:" >&5
10451 cat conftest.$ac_ext >&5
10452
10453         cf_cv_term_header=unknown
10454
10455 fi
10456 rm -f conftest.$ac_objext conftest.$ac_ext
10457         test "$cf_cv_term_header" != unknown && break
10458 done
10459
10460 fi
10461 echo "$as_me:10461: result: $cf_cv_term_header" >&5
10462 echo "${ECHO_T}$cf_cv_term_header" >&6
10463
10464 # Set definitions to allow ifdef'ing to accommodate subdirectories
10465
10466 case $cf_cv_term_header in
10467 (*term.h)
10468
10469 cat >>confdefs.h <<\EOF
10470 #define HAVE_TERM_H 1
10471 EOF
10472
10473         ;;
10474 esac
10475
10476 case $cf_cv_term_header in
10477 (ncurses/term.h)
10478
10479 cat >>confdefs.h <<\EOF
10480 #define HAVE_NCURSES_TERM_H 1
10481 EOF
10482
10483         ;;
10484 (ncursesw/term.h)
10485
10486 cat >>confdefs.h <<\EOF
10487 #define HAVE_NCURSESW_TERM_H 1
10488 EOF
10489
10490         ;;
10491 esac
10492
10493 # some applications need this, but should check for NCURSES_VERSION
10494
10495 cat >>confdefs.h <<\EOF
10496 #define NCURSES 1
10497 EOF
10498
10499 echo "$as_me:10499: checking for ncurses version" >&5
10500 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10501 if test "${cf_cv_ncurses_version+set}" = set; then
10502   echo $ECHO_N "(cached) $ECHO_C" >&6
10503 else
10504
10505         cf_cv_ncurses_version=no
10506         cf_tempfile=out$$
10507         rm -f $cf_tempfile
10508         if test "$cross_compiling" = yes; then
10509
10510         # This will not work if the preprocessor splits the line after the
10511         # Autoconf token.  The 'unproto' program does that.
10512         cat > conftest.$ac_ext <<EOF
10513 #include <${cf_cv_ncurses_header:-curses.h}>
10514 #undef Autoconf
10515 #ifdef NCURSES_VERSION
10516 Autoconf NCURSES_VERSION
10517 #else
10518 #ifdef __NCURSES_H
10519 Autoconf "old"
10520 #endif
10521 ;
10522 #endif
10523 EOF
10524         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10525         { (eval echo "$as_me:10525: \"$cf_try\"") >&5
10526   (eval $cf_try) 2>&5
10527   ac_status=$?
10528   echo "$as_me:10528: \$? = $ac_status" >&5
10529   (exit $ac_status); }
10530         if test -f conftest.out ; then
10531                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10532                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10533                 rm -f conftest.out
10534         fi
10535
10536 else
10537   cat >conftest.$ac_ext <<_ACEOF
10538 #line 10538 "configure"
10539 #include "confdefs.h"
10540
10541 #include <${cf_cv_ncurses_header:-curses.h}>
10542 #include <stdio.h>
10543 int main(void)
10544 {
10545         FILE *fp = fopen("$cf_tempfile", "w");
10546 #ifdef NCURSES_VERSION
10547 # ifdef NCURSES_VERSION_PATCH
10548         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10549 # else
10550         fprintf(fp, "%s\n", NCURSES_VERSION);
10551 # endif
10552 #else
10553 # ifdef __NCURSES_H
10554         fprintf(fp, "old\n");
10555 # else
10556         make an error
10557 # endif
10558 #endif
10559         ${cf_cv_main_return:-return}(0);
10560 }
10561 _ACEOF
10562 rm -f conftest$ac_exeext
10563 if { (eval echo "$as_me:10563: \"$ac_link\"") >&5
10564   (eval $ac_link) 2>&5
10565   ac_status=$?
10566   echo "$as_me:10566: \$? = $ac_status" >&5
10567   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10568   { (eval echo "$as_me:10568: \"$ac_try\"") >&5
10569   (eval $ac_try) 2>&5
10570   ac_status=$?
10571   echo "$as_me:10571: \$? = $ac_status" >&5
10572   (exit $ac_status); }; }; then
10573
10574         cf_cv_ncurses_version=`cat $cf_tempfile`
10575 else
10576   echo "$as_me: program exited with status $ac_status" >&5
10577 echo "$as_me: failed program was:" >&5
10578 cat conftest.$ac_ext >&5
10579 fi
10580 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10581 fi
10582         rm -f $cf_tempfile
10583
10584 fi
10585 echo "$as_me:10585: result: $cf_cv_ncurses_version" >&5
10586 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10587 test "$cf_cv_ncurses_version" = no ||
10588 cat >>confdefs.h <<\EOF
10589 #define NCURSES 1
10590 EOF
10591
10592 cf_nculib_root=$cf_cv_screen
10593         # This works, except for the special case where we find gpm, but
10594         # ncurses is in a nonstandard location via $LIBS, and we really want
10595         # to link gpm.
10596 cf_ncurses_LIBS=""
10597 cf_ncurses_SAVE="$LIBS"
10598 echo "$as_me:10598: checking for Gpm_Open in -lgpm" >&5
10599 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10600 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10601   echo $ECHO_N "(cached) $ECHO_C" >&6
10602 else
10603   ac_check_lib_save_LIBS=$LIBS
10604 LIBS="-lgpm  $LIBS"
10605 cat >conftest.$ac_ext <<_ACEOF
10606 #line 10606 "configure"
10607 #include "confdefs.h"
10608
10609 /* Override any gcc2 internal prototype to avoid an error.  */
10610 #ifdef __cplusplus
10611 extern "C"
10612 #endif
10613 /* We use char because int might match the return type of a gcc2
10614    builtin and then its argument prototype would still apply.  */
10615 char Gpm_Open ();
10616 int
10617 main (void)
10618 {
10619 Gpm_Open ();
10620   ;
10621   return 0;
10622 }
10623 _ACEOF
10624 rm -f conftest.$ac_objext conftest$ac_exeext
10625 if { (eval echo "$as_me:10625: \"$ac_link\"") >&5
10626   (eval $ac_link) 2>&5
10627   ac_status=$?
10628   echo "$as_me:10628: \$? = $ac_status" >&5
10629   (exit $ac_status); } &&
10630          { ac_try='test -s conftest$ac_exeext'
10631   { (eval echo "$as_me:10631: \"$ac_try\"") >&5
10632   (eval $ac_try) 2>&5
10633   ac_status=$?
10634   echo "$as_me:10634: \$? = $ac_status" >&5
10635   (exit $ac_status); }; }; then
10636   ac_cv_lib_gpm_Gpm_Open=yes
10637 else
10638   echo "$as_me: failed program was:" >&5
10639 cat conftest.$ac_ext >&5
10640 ac_cv_lib_gpm_Gpm_Open=no
10641 fi
10642 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10643 LIBS=$ac_check_lib_save_LIBS
10644 fi
10645 echo "$as_me:10645: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10646 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10647 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10648   echo "$as_me:10648: checking for initscr in -lgpm" >&5
10649 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10650 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10651   echo $ECHO_N "(cached) $ECHO_C" >&6
10652 else
10653   ac_check_lib_save_LIBS=$LIBS
10654 LIBS="-lgpm  $LIBS"
10655 cat >conftest.$ac_ext <<_ACEOF
10656 #line 10656 "configure"
10657 #include "confdefs.h"
10658
10659 /* Override any gcc2 internal prototype to avoid an error.  */
10660 #ifdef __cplusplus
10661 extern "C"
10662 #endif
10663 /* We use char because int might match the return type of a gcc2
10664    builtin and then its argument prototype would still apply.  */
10665 char initscr ();
10666 int
10667 main (void)
10668 {
10669 initscr ();
10670   ;
10671   return 0;
10672 }
10673 _ACEOF
10674 rm -f conftest.$ac_objext conftest$ac_exeext
10675 if { (eval echo "$as_me:10675: \"$ac_link\"") >&5
10676   (eval $ac_link) 2>&5
10677   ac_status=$?
10678   echo "$as_me:10678: \$? = $ac_status" >&5
10679   (exit $ac_status); } &&
10680          { ac_try='test -s conftest$ac_exeext'
10681   { (eval echo "$as_me:10681: \"$ac_try\"") >&5
10682   (eval $ac_try) 2>&5
10683   ac_status=$?
10684   echo "$as_me:10684: \$? = $ac_status" >&5
10685   (exit $ac_status); }; }; then
10686   ac_cv_lib_gpm_initscr=yes
10687 else
10688   echo "$as_me: failed program was:" >&5
10689 cat conftest.$ac_ext >&5
10690 ac_cv_lib_gpm_initscr=no
10691 fi
10692 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10693 LIBS=$ac_check_lib_save_LIBS
10694 fi
10695 echo "$as_me:10695: result: $ac_cv_lib_gpm_initscr" >&5
10696 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10697 if test $ac_cv_lib_gpm_initscr = yes; then
10698   LIBS="$cf_ncurses_SAVE"
10699 else
10700   cf_ncurses_LIBS="-lgpm"
10701 fi
10702
10703 fi
10704
10705 case $host_os in
10706 (freebsd*)
10707         # This is only necessary if you are linking against an obsolete
10708         # version of ncurses (but it should do no harm, since it's static).
10709         if test "$cf_nculib_root" = ncurses ; then
10710                 echo "$as_me:10710: checking for tgoto in -lmytinfo" >&5
10711 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10712 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10713   echo $ECHO_N "(cached) $ECHO_C" >&6
10714 else
10715   ac_check_lib_save_LIBS=$LIBS
10716 LIBS="-lmytinfo  $LIBS"
10717 cat >conftest.$ac_ext <<_ACEOF
10718 #line 10718 "configure"
10719 #include "confdefs.h"
10720
10721 /* Override any gcc2 internal prototype to avoid an error.  */
10722 #ifdef __cplusplus
10723 extern "C"
10724 #endif
10725 /* We use char because int might match the return type of a gcc2
10726    builtin and then its argument prototype would still apply.  */
10727 char tgoto ();
10728 int
10729 main (void)
10730 {
10731 tgoto ();
10732   ;
10733   return 0;
10734 }
10735 _ACEOF
10736 rm -f conftest.$ac_objext conftest$ac_exeext
10737 if { (eval echo "$as_me:10737: \"$ac_link\"") >&5
10738   (eval $ac_link) 2>&5
10739   ac_status=$?
10740   echo "$as_me:10740: \$? = $ac_status" >&5
10741   (exit $ac_status); } &&
10742          { ac_try='test -s conftest$ac_exeext'
10743   { (eval echo "$as_me:10743: \"$ac_try\"") >&5
10744   (eval $ac_try) 2>&5
10745   ac_status=$?
10746   echo "$as_me:10746: \$? = $ac_status" >&5
10747   (exit $ac_status); }; }; then
10748   ac_cv_lib_mytinfo_tgoto=yes
10749 else
10750   echo "$as_me: failed program was:" >&5
10751 cat conftest.$ac_ext >&5
10752 ac_cv_lib_mytinfo_tgoto=no
10753 fi
10754 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10755 LIBS=$ac_check_lib_save_LIBS
10756 fi
10757 echo "$as_me:10757: result: $ac_cv_lib_mytinfo_tgoto" >&5
10758 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10759 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10760   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10761 fi
10762
10763         fi
10764         ;;
10765 esac
10766
10767 cf_add_libs="$cf_ncurses_LIBS"
10768 # Filter out duplicates - this happens with badly-designed ".pc" files...
10769 for cf_add_1lib in $LIBS
10770 do
10771         for cf_add_2lib in $cf_add_libs
10772         do
10773                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10774                 then
10775                         cf_add_1lib=
10776                         break
10777                 fi
10778         done
10779         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10780 done
10781 LIBS="$cf_add_libs"
10782
10783 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10784 then
10785
10786 cf_add_libs="-l$cf_nculib_root"
10787 # Filter out duplicates - this happens with badly-designed ".pc" files...
10788 for cf_add_1lib in $LIBS
10789 do
10790         for cf_add_2lib in $cf_add_libs
10791         do
10792                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10793                 then
10794                         cf_add_1lib=
10795                         break
10796                 fi
10797         done
10798         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10799 done
10800 LIBS="$cf_add_libs"
10801
10802 else
10803
10804         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10805         cf_libdir=""
10806         echo "$as_me:10806: checking for initscr" >&5
10807 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10808 if test "${ac_cv_func_initscr+set}" = set; then
10809   echo $ECHO_N "(cached) $ECHO_C" >&6
10810 else
10811   cat >conftest.$ac_ext <<_ACEOF
10812 #line 10812 "configure"
10813 #include "confdefs.h"
10814 #define initscr autoconf_temporary
10815 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10816 #undef initscr
10817
10818 #ifdef __cplusplus
10819 extern "C"
10820 #endif
10821
10822 /* We use char because int might match the return type of a gcc2
10823    builtin and then its argument prototype would still apply.  */
10824 char initscr (void);
10825
10826 int
10827 main (void)
10828 {
10829
10830 /* The GNU C library defines stubs for functions which it implements
10831     to always fail with ENOSYS.  Some functions are actually named
10832     something starting with __ and the normal name is an alias.  */
10833 #if defined (__stub_initscr) || defined (__stub___initscr)
10834 #error found stub for initscr
10835 #endif
10836
10837         return initscr ();
10838   ;
10839   return 0;
10840 }
10841 _ACEOF
10842 rm -f conftest.$ac_objext conftest$ac_exeext
10843 if { (eval echo "$as_me:10843: \"$ac_link\"") >&5
10844   (eval $ac_link) 2>&5
10845   ac_status=$?
10846   echo "$as_me:10846: \$? = $ac_status" >&5
10847   (exit $ac_status); } &&
10848          { ac_try='test -s conftest$ac_exeext'
10849   { (eval echo "$as_me:10849: \"$ac_try\"") >&5
10850   (eval $ac_try) 2>&5
10851   ac_status=$?
10852   echo "$as_me:10852: \$? = $ac_status" >&5
10853   (exit $ac_status); }; }; then
10854   ac_cv_func_initscr=yes
10855 else
10856   echo "$as_me: failed program was:" >&5
10857 cat conftest.$ac_ext >&5
10858 ac_cv_func_initscr=no
10859 fi
10860 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10861 fi
10862 echo "$as_me:10862: result: $ac_cv_func_initscr" >&5
10863 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10864 if test $ac_cv_func_initscr = yes; then
10865   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10866 else
10867
10868                 cf_save_LIBS="$LIBS"
10869                 echo "$as_me:10869: checking for initscr in -l$cf_nculib_root" >&5
10870 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10871                 LIBS="-l$cf_nculib_root $LIBS"
10872                 cat >conftest.$ac_ext <<_ACEOF
10873 #line 10873 "configure"
10874 #include "confdefs.h"
10875 #include <${cf_cv_ncurses_header:-curses.h}>
10876 int
10877 main (void)
10878 {
10879 initscr()
10880   ;
10881   return 0;
10882 }
10883 _ACEOF
10884 rm -f conftest.$ac_objext conftest$ac_exeext
10885 if { (eval echo "$as_me:10885: \"$ac_link\"") >&5
10886   (eval $ac_link) 2>&5
10887   ac_status=$?
10888   echo "$as_me:10888: \$? = $ac_status" >&5
10889   (exit $ac_status); } &&
10890          { ac_try='test -s conftest$ac_exeext'
10891   { (eval echo "$as_me:10891: \"$ac_try\"") >&5
10892   (eval $ac_try) 2>&5
10893   ac_status=$?
10894   echo "$as_me:10894: \$? = $ac_status" >&5
10895   (exit $ac_status); }; }; then
10896   echo "$as_me:10896: result: yes" >&5
10897 echo "${ECHO_T}yes" >&6
10898                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10899
10900 else
10901   echo "$as_me: failed program was:" >&5
10902 cat conftest.$ac_ext >&5
10903 echo "$as_me:10903: result: no" >&5
10904 echo "${ECHO_T}no" >&6
10905
10906 cf_search=
10907 cf_library_path_list=""
10908 if test -n "${LDFLAGS}${LIBS}" ; then
10909         for cf_library_path in $LDFLAGS $LIBS
10910         do
10911                 case $cf_library_path in
10912                 (-L*)
10913                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10914
10915 test "x$cf_library_path" != "xNONE" && \
10916 test -d "$cf_library_path" && \
10917  {
10918         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10919         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10920         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10921         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10922         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10923         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
10924 }
10925
10926                         cf_library_path_list="$cf_library_path_list $cf_search"
10927                         ;;
10928                 esac
10929         done
10930 fi
10931
10932 cf_search=
10933
10934 test "x$prefix" != "xNONE" && \
10935 test -d "$prefix" && \
10936  {
10937         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10938         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10939         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10940         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10941         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10942         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10943 }
10944
10945 for cf_subdir_prefix in \
10946         /usr \
10947         /usr/local \
10948         /usr/pkg \
10949         /opt \
10950         /opt/local \
10951         $HOME
10952 do
10953
10954 test "x$cf_subdir_prefix" != "x$prefix" && \
10955 test -d "$cf_subdir_prefix" && \
10956 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10957         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10958         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10959         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10960         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10961         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10962         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
10963 }
10964
10965 done
10966
10967 cf_search="$cf_library_path_list $cf_search"
10968
10969                         for cf_libdir in $cf_search
10970                         do
10971                                 echo "$as_me:10971: checking for -l$cf_nculib_root in $cf_libdir" >&5
10972 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10973                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10974                                 cat >conftest.$ac_ext <<_ACEOF
10975 #line 10975 "configure"
10976 #include "confdefs.h"
10977 #include <${cf_cv_ncurses_header:-curses.h}>
10978 int
10979 main (void)
10980 {
10981 initscr()
10982   ;
10983   return 0;
10984 }
10985 _ACEOF
10986 rm -f conftest.$ac_objext conftest$ac_exeext
10987 if { (eval echo "$as_me:10987: \"$ac_link\"") >&5
10988   (eval $ac_link) 2>&5
10989   ac_status=$?
10990   echo "$as_me:10990: \$? = $ac_status" >&5
10991   (exit $ac_status); } &&
10992          { ac_try='test -s conftest$ac_exeext'
10993   { (eval echo "$as_me:10993: \"$ac_try\"") >&5
10994   (eval $ac_try) 2>&5
10995   ac_status=$?
10996   echo "$as_me:10996: \$? = $ac_status" >&5
10997   (exit $ac_status); }; }; then
10998   echo "$as_me:10998: result: yes" >&5
10999 echo "${ECHO_T}yes" >&6
11000                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11001                                          break
11002 else
11003   echo "$as_me: failed program was:" >&5
11004 cat conftest.$ac_ext >&5
11005 echo "$as_me:11005: result: no" >&5
11006 echo "${ECHO_T}no" >&6
11007                                          LIBS="$cf_save_LIBS"
11008 fi
11009 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11010                         done
11011
11012 fi
11013 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11014
11015 fi
11016
11017 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11018
11019 if test $cf_found_library = no ; then
11020         { { echo "$as_me:11020: error: Cannot link $cf_nculib_root library" >&5
11021 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11022    { (exit 1); exit 1; }; }
11023 fi
11024
11025 fi
11026
11027 if test -n "$cf_ncurses_LIBS" ; then
11028         echo "$as_me:11028: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11029 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11030         cf_ncurses_SAVE="$LIBS"
11031         for p in $cf_ncurses_LIBS ; do
11032                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11033                 if test "$q" != "$LIBS" ; then
11034                         LIBS="$q"
11035                 fi
11036         done
11037         cat >conftest.$ac_ext <<_ACEOF
11038 #line 11038 "configure"
11039 #include "confdefs.h"
11040 #include <${cf_cv_ncurses_header:-curses.h}>
11041 int
11042 main (void)
11043 {
11044 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11045   ;
11046   return 0;
11047 }
11048 _ACEOF
11049 rm -f conftest.$ac_objext conftest$ac_exeext
11050 if { (eval echo "$as_me:11050: \"$ac_link\"") >&5
11051   (eval $ac_link) 2>&5
11052   ac_status=$?
11053   echo "$as_me:11053: \$? = $ac_status" >&5
11054   (exit $ac_status); } &&
11055          { ac_try='test -s conftest$ac_exeext'
11056   { (eval echo "$as_me:11056: \"$ac_try\"") >&5
11057   (eval $ac_try) 2>&5
11058   ac_status=$?
11059   echo "$as_me:11059: \$? = $ac_status" >&5
11060   (exit $ac_status); }; }; then
11061   echo "$as_me:11061: result: yes" >&5
11062 echo "${ECHO_T}yes" >&6
11063 else
11064   echo "$as_me: failed program was:" >&5
11065 cat conftest.$ac_ext >&5
11066 echo "$as_me:11066: result: no" >&5
11067 echo "${ECHO_T}no" >&6
11068                  LIBS="$cf_ncurses_SAVE"
11069 fi
11070 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11071 fi
11072
11073 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11074
11075 cat >>confdefs.h <<EOF
11076 #define $cf_nculib_ROOT 1
11077 EOF
11078
11079         fi
11080 else
11081         NCURSES_CONFIG=none
11082 fi
11083
11084         ;;
11085 (pdcurses)
11086         echo "$as_me:11086: checking for X" >&5
11087 echo $ECHO_N "checking for X... $ECHO_C" >&6
11088
11089 # Check whether --with-x or --without-x was given.
11090 if test "${with_x+set}" = set; then
11091   withval="$with_x"
11092
11093 fi;
11094 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11095 if test "x$with_x" = xno; then
11096   # The user explicitly disabled X.
11097   have_x=disabled
11098 else
11099   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11100     # Both variables are already set.
11101     have_x=yes
11102   else
11103     if test "${ac_cv_have_x+set}" = set; then
11104   echo $ECHO_N "(cached) $ECHO_C" >&6
11105 else
11106   # One or both of the vars are not set, and there is no cached value.
11107 ac_x_includes=no ac_x_libraries=no
11108 rm -fr conftest.dir
11109 if mkdir conftest.dir; then
11110   cd conftest.dir
11111   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11112   cat >Imakefile <<'EOF'
11113 acfindx:
11114         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11115 EOF
11116   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11117     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11118     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11119     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11120     for ac_extension in a so sl dylib dll; do
11121       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11122          test -f $ac_im_libdir/libX11.$ac_extension; then
11123         ac_im_usrlibdir=$ac_im_libdir; break
11124       fi
11125     done
11126     # Screen out bogus values from the imake configuration.  They are
11127     # bogus both because they are the default anyway, and because
11128     # using them would break gcc on systems where it needs fixed includes.
11129     case $ac_im_incroot in
11130         /usr/include) ;;
11131         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11132     esac
11133     case $ac_im_usrlibdir in
11134         /usr/lib | /lib) ;;
11135         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11136     esac
11137   fi
11138   cd ..
11139   rm -fr conftest.dir
11140 fi
11141
11142 # Standard set of common directories for X headers.
11143 # Check X11 before X11Rn because it is often a symlink to the current release.
11144 ac_x_header_dirs='
11145 /usr/X11/include
11146 /usr/X11R6/include
11147 /usr/X11R5/include
11148 /usr/X11R4/include
11149
11150 /usr/include/X11
11151 /usr/include/X11R6
11152 /usr/include/X11R5
11153 /usr/include/X11R4
11154
11155 /usr/local/X11/include
11156 /usr/local/X11R6/include
11157 /usr/local/X11R5/include
11158 /usr/local/X11R4/include
11159
11160 /usr/local/include/X11
11161 /usr/local/include/X11R6
11162 /usr/local/include/X11R5
11163 /usr/local/include/X11R4
11164
11165 /usr/X386/include
11166 /usr/x386/include
11167 /usr/XFree86/include/X11
11168
11169 /usr/include
11170 /usr/local/include
11171 /usr/unsupported/include
11172 /usr/athena/include
11173 /usr/local/x11r5/include
11174 /usr/lpp/Xamples/include
11175
11176 /usr/openwin/include
11177 /usr/openwin/share/include'
11178
11179 if test "$ac_x_includes" = no; then
11180   # Guess where to find include files, by looking for Intrinsic.h.
11181   # First, try using that file with no special directory specified.
11182   cat >conftest.$ac_ext <<_ACEOF
11183 #line 11183 "configure"
11184 #include "confdefs.h"
11185 #include <X11/Intrinsic.h>
11186 _ACEOF
11187 if { (eval echo "$as_me:11187: \"$ac_cpp conftest.$ac_ext\"") >&5
11188   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11189   ac_status=$?
11190   egrep -v '^ *\+' conftest.er1 >conftest.err
11191   rm -f conftest.er1
11192   cat conftest.err >&5
11193   echo "$as_me:11193: \$? = $ac_status" >&5
11194   (exit $ac_status); } >/dev/null; then
11195   if test -s conftest.err; then
11196     ac_cpp_err=$ac_c_preproc_warn_flag
11197   else
11198     ac_cpp_err=
11199   fi
11200 else
11201   ac_cpp_err=yes
11202 fi
11203 if test -z "$ac_cpp_err"; then
11204   # We can compile using X headers with no special include directory.
11205 ac_x_includes=
11206 else
11207   echo "$as_me: failed program was:" >&5
11208   cat conftest.$ac_ext >&5
11209   for ac_dir in $ac_x_header_dirs; do
11210   if test -r "$ac_dir/X11/Intrinsic.h"; then
11211     ac_x_includes=$ac_dir
11212     break
11213   fi
11214 done
11215 fi
11216 rm -f conftest.err conftest.$ac_ext
11217 fi # $ac_x_includes = no
11218
11219 if test "$ac_x_libraries" = no; then
11220   # Check for the libraries.
11221   # See if we find them without any special options.
11222   # Don't add to $LIBS permanently.
11223   ac_save_LIBS=$LIBS
11224   LIBS="-lXt $LIBS"
11225   cat >conftest.$ac_ext <<_ACEOF
11226 #line 11226 "configure"
11227 #include "confdefs.h"
11228 #include <X11/Intrinsic.h>
11229 int
11230 main (void)
11231 {
11232 XtMalloc (0)
11233   ;
11234   return 0;
11235 }
11236 _ACEOF
11237 rm -f conftest.$ac_objext conftest$ac_exeext
11238 if { (eval echo "$as_me:11238: \"$ac_link\"") >&5
11239   (eval $ac_link) 2>&5
11240   ac_status=$?
11241   echo "$as_me:11241: \$? = $ac_status" >&5
11242   (exit $ac_status); } &&
11243          { ac_try='test -s conftest$ac_exeext'
11244   { (eval echo "$as_me:11244: \"$ac_try\"") >&5
11245   (eval $ac_try) 2>&5
11246   ac_status=$?
11247   echo "$as_me:11247: \$? = $ac_status" >&5
11248   (exit $ac_status); }; }; then
11249   LIBS=$ac_save_LIBS
11250 # We can link X programs with no special library path.
11251 ac_x_libraries=
11252 else
11253   echo "$as_me: failed program was:" >&5
11254 cat conftest.$ac_ext >&5
11255 LIBS=$ac_save_LIBS
11256 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11257 do
11258   # Don't even attempt the hair of trying to link an X program!
11259   for ac_extension in a so sl dylib dll; do
11260     if test -r $ac_dir/libXt.$ac_extension; then
11261       ac_x_libraries=$ac_dir
11262       break 2
11263     fi
11264   done
11265 done
11266 fi
11267 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11268 fi # $ac_x_libraries = no
11269
11270 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11271   # Didn't find X anywhere.  Cache the known absence of X.
11272   ac_cv_have_x="have_x=no"
11273 else
11274   # Record where we found X for the cache.
11275   ac_cv_have_x="have_x=yes \
11276                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11277 fi
11278 fi
11279
11280   fi
11281   eval "$ac_cv_have_x"
11282 fi # $with_x != no
11283
11284 if test "$have_x" != yes; then
11285   echo "$as_me:11285: result: $have_x" >&5
11286 echo "${ECHO_T}$have_x" >&6
11287   no_x=yes
11288 else
11289   # If each of the values was on the command line, it overrides each guess.
11290   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11291   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11292   # Update the cache value to reflect the command line values.
11293   ac_cv_have_x="have_x=yes \
11294                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11295   echo "$as_me:11295: result: libraries $x_libraries, headers $x_includes" >&5
11296 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11297 fi
11298
11299 if test "$no_x" = yes; then
11300   # Not all programs may use this symbol, but it does not hurt to define it.
11301
11302 cat >>confdefs.h <<\EOF
11303 #define X_DISPLAY_MISSING 1
11304 EOF
11305
11306   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11307 else
11308   if test -n "$x_includes"; then
11309     X_CFLAGS="$X_CFLAGS -I$x_includes"
11310   fi
11311
11312   # It would also be nice to do this for all -L options, not just this one.
11313   if test -n "$x_libraries"; then
11314     X_LIBS="$X_LIBS -L$x_libraries"
11315     # For Solaris; some versions of Sun CC require a space after -R and
11316     # others require no space.  Words are not sufficient . . . .
11317     case `(uname -sr) 2>/dev/null` in
11318     "SunOS 5"*)
11319       echo "$as_me:11319: checking whether -R must be followed by a space" >&5
11320 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11321       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11322       cat >conftest.$ac_ext <<_ACEOF
11323 #line 11323 "configure"
11324 #include "confdefs.h"
11325
11326 int
11327 main (void)
11328 {
11329
11330   ;
11331   return 0;
11332 }
11333 _ACEOF
11334 rm -f conftest.$ac_objext conftest$ac_exeext
11335 if { (eval echo "$as_me:11335: \"$ac_link\"") >&5
11336   (eval $ac_link) 2>&5
11337   ac_status=$?
11338   echo "$as_me:11338: \$? = $ac_status" >&5
11339   (exit $ac_status); } &&
11340          { ac_try='test -s conftest$ac_exeext'
11341   { (eval echo "$as_me:11341: \"$ac_try\"") >&5
11342   (eval $ac_try) 2>&5
11343   ac_status=$?
11344   echo "$as_me:11344: \$? = $ac_status" >&5
11345   (exit $ac_status); }; }; then
11346   ac_R_nospace=yes
11347 else
11348   echo "$as_me: failed program was:" >&5
11349 cat conftest.$ac_ext >&5
11350 ac_R_nospace=no
11351 fi
11352 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11353       if test $ac_R_nospace = yes; then
11354         echo "$as_me:11354: result: no" >&5
11355 echo "${ECHO_T}no" >&6
11356         X_LIBS="$X_LIBS -R$x_libraries"
11357       else
11358         LIBS="$ac_xsave_LIBS -R $x_libraries"
11359         cat >conftest.$ac_ext <<_ACEOF
11360 #line 11360 "configure"
11361 #include "confdefs.h"
11362
11363 int
11364 main (void)
11365 {
11366
11367   ;
11368   return 0;
11369 }
11370 _ACEOF
11371 rm -f conftest.$ac_objext conftest$ac_exeext
11372 if { (eval echo "$as_me:11372: \"$ac_link\"") >&5
11373   (eval $ac_link) 2>&5
11374   ac_status=$?
11375   echo "$as_me:11375: \$? = $ac_status" >&5
11376   (exit $ac_status); } &&
11377          { ac_try='test -s conftest$ac_exeext'
11378   { (eval echo "$as_me:11378: \"$ac_try\"") >&5
11379   (eval $ac_try) 2>&5
11380   ac_status=$?
11381   echo "$as_me:11381: \$? = $ac_status" >&5
11382   (exit $ac_status); }; }; then
11383   ac_R_space=yes
11384 else
11385   echo "$as_me: failed program was:" >&5
11386 cat conftest.$ac_ext >&5
11387 ac_R_space=no
11388 fi
11389 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11390         if test $ac_R_space = yes; then
11391           echo "$as_me:11391: result: yes" >&5
11392 echo "${ECHO_T}yes" >&6
11393           X_LIBS="$X_LIBS -R $x_libraries"
11394         else
11395           echo "$as_me:11395: result: neither works" >&5
11396 echo "${ECHO_T}neither works" >&6
11397         fi
11398       fi
11399       LIBS=$ac_xsave_LIBS
11400     esac
11401   fi
11402
11403   # Check for system-dependent libraries X programs must link with.
11404   # Do this before checking for the system-independent R6 libraries
11405   # (-lICE), since we may need -lsocket or whatever for X linking.
11406
11407   if test "$ISC" = yes; then
11408     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11409   else
11410     # Martyn Johnson says this is needed for Ultrix, if the X
11411     # libraries were built with DECnet support.  And Karl Berry says
11412     # the Alpha needs dnet_stub (dnet does not exist).
11413     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11414     cat >conftest.$ac_ext <<_ACEOF
11415 #line 11415 "configure"
11416 #include "confdefs.h"
11417
11418 /* Override any gcc2 internal prototype to avoid an error.  */
11419 #ifdef __cplusplus
11420 extern "C"
11421 #endif
11422 /* We use char because int might match the return type of a gcc2
11423    builtin and then its argument prototype would still apply.  */
11424 char XOpenDisplay ();
11425 int
11426 main (void)
11427 {
11428 XOpenDisplay ();
11429   ;
11430   return 0;
11431 }
11432 _ACEOF
11433 rm -f conftest.$ac_objext conftest$ac_exeext
11434 if { (eval echo "$as_me:11434: \"$ac_link\"") >&5
11435   (eval $ac_link) 2>&5
11436   ac_status=$?
11437   echo "$as_me:11437: \$? = $ac_status" >&5
11438   (exit $ac_status); } &&
11439          { ac_try='test -s conftest$ac_exeext'
11440   { (eval echo "$as_me:11440: \"$ac_try\"") >&5
11441   (eval $ac_try) 2>&5
11442   ac_status=$?
11443   echo "$as_me:11443: \$? = $ac_status" >&5
11444   (exit $ac_status); }; }; then
11445   :
11446 else
11447   echo "$as_me: failed program was:" >&5
11448 cat conftest.$ac_ext >&5
11449 echo "$as_me:11449: checking for dnet_ntoa in -ldnet" >&5
11450 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11451 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11452   echo $ECHO_N "(cached) $ECHO_C" >&6
11453 else
11454   ac_check_lib_save_LIBS=$LIBS
11455 LIBS="-ldnet  $LIBS"
11456 cat >conftest.$ac_ext <<_ACEOF
11457 #line 11457 "configure"
11458 #include "confdefs.h"
11459
11460 /* Override any gcc2 internal prototype to avoid an error.  */
11461 #ifdef __cplusplus
11462 extern "C"
11463 #endif
11464 /* We use char because int might match the return type of a gcc2
11465    builtin and then its argument prototype would still apply.  */
11466 char dnet_ntoa ();
11467 int
11468 main (void)
11469 {
11470 dnet_ntoa ();
11471   ;
11472   return 0;
11473 }
11474 _ACEOF
11475 rm -f conftest.$ac_objext conftest$ac_exeext
11476 if { (eval echo "$as_me:11476: \"$ac_link\"") >&5
11477   (eval $ac_link) 2>&5
11478   ac_status=$?
11479   echo "$as_me:11479: \$? = $ac_status" >&5
11480   (exit $ac_status); } &&
11481          { ac_try='test -s conftest$ac_exeext'
11482   { (eval echo "$as_me:11482: \"$ac_try\"") >&5
11483   (eval $ac_try) 2>&5
11484   ac_status=$?
11485   echo "$as_me:11485: \$? = $ac_status" >&5
11486   (exit $ac_status); }; }; then
11487   ac_cv_lib_dnet_dnet_ntoa=yes
11488 else
11489   echo "$as_me: failed program was:" >&5
11490 cat conftest.$ac_ext >&5
11491 ac_cv_lib_dnet_dnet_ntoa=no
11492 fi
11493 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11494 LIBS=$ac_check_lib_save_LIBS
11495 fi
11496 echo "$as_me:11496: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
11497 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
11498 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
11499   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
11500 fi
11501
11502     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
11503       echo "$as_me:11503: checking for dnet_ntoa in -ldnet_stub" >&5
11504 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
11505 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
11506   echo $ECHO_N "(cached) $ECHO_C" >&6
11507 else
11508   ac_check_lib_save_LIBS=$LIBS
11509 LIBS="-ldnet_stub  $LIBS"
11510 cat >conftest.$ac_ext <<_ACEOF
11511 #line 11511 "configure"
11512 #include "confdefs.h"
11513
11514 /* Override any gcc2 internal prototype to avoid an error.  */
11515 #ifdef __cplusplus
11516 extern "C"
11517 #endif
11518 /* We use char because int might match the return type of a gcc2
11519    builtin and then its argument prototype would still apply.  */
11520 char dnet_ntoa ();
11521 int
11522 main (void)
11523 {
11524 dnet_ntoa ();
11525   ;
11526   return 0;
11527 }
11528 _ACEOF
11529 rm -f conftest.$ac_objext conftest$ac_exeext
11530 if { (eval echo "$as_me:11530: \"$ac_link\"") >&5
11531   (eval $ac_link) 2>&5
11532   ac_status=$?
11533   echo "$as_me:11533: \$? = $ac_status" >&5
11534   (exit $ac_status); } &&
11535          { ac_try='test -s conftest$ac_exeext'
11536   { (eval echo "$as_me:11536: \"$ac_try\"") >&5
11537   (eval $ac_try) 2>&5
11538   ac_status=$?
11539   echo "$as_me:11539: \$? = $ac_status" >&5
11540   (exit $ac_status); }; }; then
11541   ac_cv_lib_dnet_stub_dnet_ntoa=yes
11542 else
11543   echo "$as_me: failed program was:" >&5
11544 cat conftest.$ac_ext >&5
11545 ac_cv_lib_dnet_stub_dnet_ntoa=no
11546 fi
11547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11548 LIBS=$ac_check_lib_save_LIBS
11549 fi
11550 echo "$as_me:11550: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
11551 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
11552 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
11553   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
11554 fi
11555
11556     fi
11557 fi
11558 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11559     LIBS="$ac_xsave_LIBS"
11560
11561     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
11562     # to get the SysV transport functions.
11563     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
11564     # needs -lnsl.
11565     # The nsl library prevents programs from opening the X display
11566     # on Irix 5.2, according to T.E. Dickey.
11567     # The functions gethostbyname, getservbyname, and inet_addr are
11568     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
11569     echo "$as_me:11569: checking for gethostbyname" >&5
11570 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
11571 if test "${ac_cv_func_gethostbyname+set}" = set; then
11572   echo $ECHO_N "(cached) $ECHO_C" >&6
11573 else
11574   cat >conftest.$ac_ext <<_ACEOF
11575 #line 11575 "configure"
11576 #include "confdefs.h"
11577 #define gethostbyname autoconf_temporary
11578 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11579 #undef gethostbyname
11580
11581 #ifdef __cplusplus
11582 extern "C"
11583 #endif
11584
11585 /* We use char because int might match the return type of a gcc2
11586    builtin and then its argument prototype would still apply.  */
11587 char gethostbyname (void);
11588
11589 int
11590 main (void)
11591 {
11592
11593 /* The GNU C library defines stubs for functions which it implements
11594     to always fail with ENOSYS.  Some functions are actually named
11595     something starting with __ and the normal name is an alias.  */
11596 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
11597 #error found stub for gethostbyname
11598 #endif
11599
11600         return gethostbyname ();
11601   ;
11602   return 0;
11603 }
11604 _ACEOF
11605 rm -f conftest.$ac_objext conftest$ac_exeext
11606 if { (eval echo "$as_me:11606: \"$ac_link\"") >&5
11607   (eval $ac_link) 2>&5
11608   ac_status=$?
11609   echo "$as_me:11609: \$? = $ac_status" >&5
11610   (exit $ac_status); } &&
11611          { ac_try='test -s conftest$ac_exeext'
11612   { (eval echo "$as_me:11612: \"$ac_try\"") >&5
11613   (eval $ac_try) 2>&5
11614   ac_status=$?
11615   echo "$as_me:11615: \$? = $ac_status" >&5
11616   (exit $ac_status); }; }; then
11617   ac_cv_func_gethostbyname=yes
11618 else
11619   echo "$as_me: failed program was:" >&5
11620 cat conftest.$ac_ext >&5
11621 ac_cv_func_gethostbyname=no
11622 fi
11623 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11624 fi
11625 echo "$as_me:11625: result: $ac_cv_func_gethostbyname" >&5
11626 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
11627
11628     if test $ac_cv_func_gethostbyname = no; then
11629       echo "$as_me:11629: checking for gethostbyname in -lnsl" >&5
11630 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
11631 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
11632   echo $ECHO_N "(cached) $ECHO_C" >&6
11633 else
11634   ac_check_lib_save_LIBS=$LIBS
11635 LIBS="-lnsl  $LIBS"
11636 cat >conftest.$ac_ext <<_ACEOF
11637 #line 11637 "configure"
11638 #include "confdefs.h"
11639
11640 /* Override any gcc2 internal prototype to avoid an error.  */
11641 #ifdef __cplusplus
11642 extern "C"
11643 #endif
11644 /* We use char because int might match the return type of a gcc2
11645    builtin and then its argument prototype would still apply.  */
11646 char gethostbyname ();
11647 int
11648 main (void)
11649 {
11650 gethostbyname ();
11651   ;
11652   return 0;
11653 }
11654 _ACEOF
11655 rm -f conftest.$ac_objext conftest$ac_exeext
11656 if { (eval echo "$as_me:11656: \"$ac_link\"") >&5
11657   (eval $ac_link) 2>&5
11658   ac_status=$?
11659   echo "$as_me:11659: \$? = $ac_status" >&5
11660   (exit $ac_status); } &&
11661          { ac_try='test -s conftest$ac_exeext'
11662   { (eval echo "$as_me:11662: \"$ac_try\"") >&5
11663   (eval $ac_try) 2>&5
11664   ac_status=$?
11665   echo "$as_me:11665: \$? = $ac_status" >&5
11666   (exit $ac_status); }; }; then
11667   ac_cv_lib_nsl_gethostbyname=yes
11668 else
11669   echo "$as_me: failed program was:" >&5
11670 cat conftest.$ac_ext >&5
11671 ac_cv_lib_nsl_gethostbyname=no
11672 fi
11673 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11674 LIBS=$ac_check_lib_save_LIBS
11675 fi
11676 echo "$as_me:11676: result: $ac_cv_lib_nsl_gethostbyname" >&5
11677 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
11678 if test $ac_cv_lib_nsl_gethostbyname = yes; then
11679   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
11680 fi
11681
11682       if test $ac_cv_lib_nsl_gethostbyname = no; then
11683         echo "$as_me:11683: checking for gethostbyname in -lbsd" >&5
11684 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
11685 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
11686   echo $ECHO_N "(cached) $ECHO_C" >&6
11687 else
11688   ac_check_lib_save_LIBS=$LIBS
11689 LIBS="-lbsd  $LIBS"
11690 cat >conftest.$ac_ext <<_ACEOF
11691 #line 11691 "configure"
11692 #include "confdefs.h"
11693
11694 /* Override any gcc2 internal prototype to avoid an error.  */
11695 #ifdef __cplusplus
11696 extern "C"
11697 #endif
11698 /* We use char because int might match the return type of a gcc2
11699    builtin and then its argument prototype would still apply.  */
11700 char gethostbyname ();
11701 int
11702 main (void)
11703 {
11704 gethostbyname ();
11705   ;
11706   return 0;
11707 }
11708 _ACEOF
11709 rm -f conftest.$ac_objext conftest$ac_exeext
11710 if { (eval echo "$as_me:11710: \"$ac_link\"") >&5
11711   (eval $ac_link) 2>&5
11712   ac_status=$?
11713   echo "$as_me:11713: \$? = $ac_status" >&5
11714   (exit $ac_status); } &&
11715          { ac_try='test -s conftest$ac_exeext'
11716   { (eval echo "$as_me:11716: \"$ac_try\"") >&5
11717   (eval $ac_try) 2>&5
11718   ac_status=$?
11719   echo "$as_me:11719: \$? = $ac_status" >&5
11720   (exit $ac_status); }; }; then
11721   ac_cv_lib_bsd_gethostbyname=yes
11722 else
11723   echo "$as_me: failed program was:" >&5
11724 cat conftest.$ac_ext >&5
11725 ac_cv_lib_bsd_gethostbyname=no
11726 fi
11727 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11728 LIBS=$ac_check_lib_save_LIBS
11729 fi
11730 echo "$as_me:11730: result: $ac_cv_lib_bsd_gethostbyname" >&5
11731 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
11732 if test $ac_cv_lib_bsd_gethostbyname = yes; then
11733   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
11734 fi
11735
11736       fi
11737     fi
11738
11739     # lieder@skyler.mavd.honeywell.com says without -lsocket,
11740     # socket/setsockopt and other routines are undefined under SCO ODT
11741     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
11742     # on later versions), says Simon Leinen: it contains gethostby*
11743     # variants that don't use the nameserver (or something).  -lsocket
11744     # must be given before -lnsl if both are needed.  We assume that
11745     # if connect needs -lnsl, so does gethostbyname.
11746     echo "$as_me:11746: checking for connect" >&5
11747 echo $ECHO_N "checking for connect... $ECHO_C" >&6
11748 if test "${ac_cv_func_connect+set}" = set; then
11749   echo $ECHO_N "(cached) $ECHO_C" >&6
11750 else
11751   cat >conftest.$ac_ext <<_ACEOF
11752 #line 11752 "configure"
11753 #include "confdefs.h"
11754 #define connect autoconf_temporary
11755 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11756 #undef connect
11757
11758 #ifdef __cplusplus
11759 extern "C"
11760 #endif
11761
11762 /* We use char because int might match the return type of a gcc2
11763    builtin and then its argument prototype would still apply.  */
11764 char connect (void);
11765
11766 int
11767 main (void)
11768 {
11769
11770 /* The GNU C library defines stubs for functions which it implements
11771     to always fail with ENOSYS.  Some functions are actually named
11772     something starting with __ and the normal name is an alias.  */
11773 #if defined (__stub_connect) || defined (__stub___connect)
11774 #error found stub for connect
11775 #endif
11776
11777         return connect ();
11778   ;
11779   return 0;
11780 }
11781 _ACEOF
11782 rm -f conftest.$ac_objext conftest$ac_exeext
11783 if { (eval echo "$as_me:11783: \"$ac_link\"") >&5
11784   (eval $ac_link) 2>&5
11785   ac_status=$?
11786   echo "$as_me:11786: \$? = $ac_status" >&5
11787   (exit $ac_status); } &&
11788          { ac_try='test -s conftest$ac_exeext'
11789   { (eval echo "$as_me:11789: \"$ac_try\"") >&5
11790   (eval $ac_try) 2>&5
11791   ac_status=$?
11792   echo "$as_me:11792: \$? = $ac_status" >&5
11793   (exit $ac_status); }; }; then
11794   ac_cv_func_connect=yes
11795 else
11796   echo "$as_me: failed program was:" >&5
11797 cat conftest.$ac_ext >&5
11798 ac_cv_func_connect=no
11799 fi
11800 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11801 fi
11802 echo "$as_me:11802: result: $ac_cv_func_connect" >&5
11803 echo "${ECHO_T}$ac_cv_func_connect" >&6
11804
11805     if test $ac_cv_func_connect = no; then
11806       echo "$as_me:11806: checking for connect in -lsocket" >&5
11807 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
11808 if test "${ac_cv_lib_socket_connect+set}" = set; then
11809   echo $ECHO_N "(cached) $ECHO_C" >&6
11810 else
11811   ac_check_lib_save_LIBS=$LIBS
11812 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
11813 cat >conftest.$ac_ext <<_ACEOF
11814 #line 11814 "configure"
11815 #include "confdefs.h"
11816
11817 /* Override any gcc2 internal prototype to avoid an error.  */
11818 #ifdef __cplusplus
11819 extern "C"
11820 #endif
11821 /* We use char because int might match the return type of a gcc2
11822    builtin and then its argument prototype would still apply.  */
11823 char connect ();
11824 int
11825 main (void)
11826 {
11827 connect ();
11828   ;
11829   return 0;
11830 }
11831 _ACEOF
11832 rm -f conftest.$ac_objext conftest$ac_exeext
11833 if { (eval echo "$as_me:11833: \"$ac_link\"") >&5
11834   (eval $ac_link) 2>&5
11835   ac_status=$?
11836   echo "$as_me:11836: \$? = $ac_status" >&5
11837   (exit $ac_status); } &&
11838          { ac_try='test -s conftest$ac_exeext'
11839   { (eval echo "$as_me:11839: \"$ac_try\"") >&5
11840   (eval $ac_try) 2>&5
11841   ac_status=$?
11842   echo "$as_me:11842: \$? = $ac_status" >&5
11843   (exit $ac_status); }; }; then
11844   ac_cv_lib_socket_connect=yes
11845 else
11846   echo "$as_me: failed program was:" >&5
11847 cat conftest.$ac_ext >&5
11848 ac_cv_lib_socket_connect=no
11849 fi
11850 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11851 LIBS=$ac_check_lib_save_LIBS
11852 fi
11853 echo "$as_me:11853: result: $ac_cv_lib_socket_connect" >&5
11854 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
11855 if test $ac_cv_lib_socket_connect = yes; then
11856   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
11857 fi
11858
11859     fi
11860
11861     # Guillermo Gomez says -lposix is necessary on A/UX.
11862     echo "$as_me:11862: checking for remove" >&5
11863 echo $ECHO_N "checking for remove... $ECHO_C" >&6
11864 if test "${ac_cv_func_remove+set}" = set; then
11865   echo $ECHO_N "(cached) $ECHO_C" >&6
11866 else
11867   cat >conftest.$ac_ext <<_ACEOF
11868 #line 11868 "configure"
11869 #include "confdefs.h"
11870 #define remove autoconf_temporary
11871 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11872 #undef remove
11873
11874 #ifdef __cplusplus
11875 extern "C"
11876 #endif
11877
11878 /* We use char because int might match the return type of a gcc2
11879    builtin and then its argument prototype would still apply.  */
11880 char remove (void);
11881
11882 int
11883 main (void)
11884 {
11885
11886 /* The GNU C library defines stubs for functions which it implements
11887     to always fail with ENOSYS.  Some functions are actually named
11888     something starting with __ and the normal name is an alias.  */
11889 #if defined (__stub_remove) || defined (__stub___remove)
11890 #error found stub for remove
11891 #endif
11892
11893         return remove ();
11894   ;
11895   return 0;
11896 }
11897 _ACEOF
11898 rm -f conftest.$ac_objext conftest$ac_exeext
11899 if { (eval echo "$as_me:11899: \"$ac_link\"") >&5
11900   (eval $ac_link) 2>&5
11901   ac_status=$?
11902   echo "$as_me:11902: \$? = $ac_status" >&5
11903   (exit $ac_status); } &&
11904          { ac_try='test -s conftest$ac_exeext'
11905   { (eval echo "$as_me:11905: \"$ac_try\"") >&5
11906   (eval $ac_try) 2>&5
11907   ac_status=$?
11908   echo "$as_me:11908: \$? = $ac_status" >&5
11909   (exit $ac_status); }; }; then
11910   ac_cv_func_remove=yes
11911 else
11912   echo "$as_me: failed program was:" >&5
11913 cat conftest.$ac_ext >&5
11914 ac_cv_func_remove=no
11915 fi
11916 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11917 fi
11918 echo "$as_me:11918: result: $ac_cv_func_remove" >&5
11919 echo "${ECHO_T}$ac_cv_func_remove" >&6
11920
11921     if test $ac_cv_func_remove = no; then
11922       echo "$as_me:11922: checking for remove in -lposix" >&5
11923 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
11924 if test "${ac_cv_lib_posix_remove+set}" = set; then
11925   echo $ECHO_N "(cached) $ECHO_C" >&6
11926 else
11927   ac_check_lib_save_LIBS=$LIBS
11928 LIBS="-lposix  $LIBS"
11929 cat >conftest.$ac_ext <<_ACEOF
11930 #line 11930 "configure"
11931 #include "confdefs.h"
11932
11933 /* Override any gcc2 internal prototype to avoid an error.  */
11934 #ifdef __cplusplus
11935 extern "C"
11936 #endif
11937 /* We use char because int might match the return type of a gcc2
11938    builtin and then its argument prototype would still apply.  */
11939 char remove ();
11940 int
11941 main (void)
11942 {
11943 remove ();
11944   ;
11945   return 0;
11946 }
11947 _ACEOF
11948 rm -f conftest.$ac_objext conftest$ac_exeext
11949 if { (eval echo "$as_me:11949: \"$ac_link\"") >&5
11950   (eval $ac_link) 2>&5
11951   ac_status=$?
11952   echo "$as_me:11952: \$? = $ac_status" >&5
11953   (exit $ac_status); } &&
11954          { ac_try='test -s conftest$ac_exeext'
11955   { (eval echo "$as_me:11955: \"$ac_try\"") >&5
11956   (eval $ac_try) 2>&5
11957   ac_status=$?
11958   echo "$as_me:11958: \$? = $ac_status" >&5
11959   (exit $ac_status); }; }; then
11960   ac_cv_lib_posix_remove=yes
11961 else
11962   echo "$as_me: failed program was:" >&5
11963 cat conftest.$ac_ext >&5
11964 ac_cv_lib_posix_remove=no
11965 fi
11966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11967 LIBS=$ac_check_lib_save_LIBS
11968 fi
11969 echo "$as_me:11969: result: $ac_cv_lib_posix_remove" >&5
11970 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
11971 if test $ac_cv_lib_posix_remove = yes; then
11972   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
11973 fi
11974
11975     fi
11976
11977     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
11978     echo "$as_me:11978: checking for shmat" >&5
11979 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
11980 if test "${ac_cv_func_shmat+set}" = set; then
11981   echo $ECHO_N "(cached) $ECHO_C" >&6
11982 else
11983   cat >conftest.$ac_ext <<_ACEOF
11984 #line 11984 "configure"
11985 #include "confdefs.h"
11986 #define shmat autoconf_temporary
11987 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11988 #undef shmat
11989
11990 #ifdef __cplusplus
11991 extern "C"
11992 #endif
11993
11994 /* We use char because int might match the return type of a gcc2
11995    builtin and then its argument prototype would still apply.  */
11996 char shmat (void);
11997
11998 int
11999 main (void)
12000 {
12001
12002 /* The GNU C library defines stubs for functions which it implements
12003     to always fail with ENOSYS.  Some functions are actually named
12004     something starting with __ and the normal name is an alias.  */
12005 #if defined (__stub_shmat) || defined (__stub___shmat)
12006 #error found stub for shmat
12007 #endif
12008
12009         return shmat ();
12010   ;
12011   return 0;
12012 }
12013 _ACEOF
12014 rm -f conftest.$ac_objext conftest$ac_exeext
12015 if { (eval echo "$as_me:12015: \"$ac_link\"") >&5
12016   (eval $ac_link) 2>&5
12017   ac_status=$?
12018   echo "$as_me:12018: \$? = $ac_status" >&5
12019   (exit $ac_status); } &&
12020          { ac_try='test -s conftest$ac_exeext'
12021   { (eval echo "$as_me:12021: \"$ac_try\"") >&5
12022   (eval $ac_try) 2>&5
12023   ac_status=$?
12024   echo "$as_me:12024: \$? = $ac_status" >&5
12025   (exit $ac_status); }; }; then
12026   ac_cv_func_shmat=yes
12027 else
12028   echo "$as_me: failed program was:" >&5
12029 cat conftest.$ac_ext >&5
12030 ac_cv_func_shmat=no
12031 fi
12032 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12033 fi
12034 echo "$as_me:12034: result: $ac_cv_func_shmat" >&5
12035 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12036
12037     if test $ac_cv_func_shmat = no; then
12038       echo "$as_me:12038: checking for shmat in -lipc" >&5
12039 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12040 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12041   echo $ECHO_N "(cached) $ECHO_C" >&6
12042 else
12043   ac_check_lib_save_LIBS=$LIBS
12044 LIBS="-lipc  $LIBS"
12045 cat >conftest.$ac_ext <<_ACEOF
12046 #line 12046 "configure"
12047 #include "confdefs.h"
12048
12049 /* Override any gcc2 internal prototype to avoid an error.  */
12050 #ifdef __cplusplus
12051 extern "C"
12052 #endif
12053 /* We use char because int might match the return type of a gcc2
12054    builtin and then its argument prototype would still apply.  */
12055 char shmat ();
12056 int
12057 main (void)
12058 {
12059 shmat ();
12060   ;
12061   return 0;
12062 }
12063 _ACEOF
12064 rm -f conftest.$ac_objext conftest$ac_exeext
12065 if { (eval echo "$as_me:12065: \"$ac_link\"") >&5
12066   (eval $ac_link) 2>&5
12067   ac_status=$?
12068   echo "$as_me:12068: \$? = $ac_status" >&5
12069   (exit $ac_status); } &&
12070          { ac_try='test -s conftest$ac_exeext'
12071   { (eval echo "$as_me:12071: \"$ac_try\"") >&5
12072   (eval $ac_try) 2>&5
12073   ac_status=$?
12074   echo "$as_me:12074: \$? = $ac_status" >&5
12075   (exit $ac_status); }; }; then
12076   ac_cv_lib_ipc_shmat=yes
12077 else
12078   echo "$as_me: failed program was:" >&5
12079 cat conftest.$ac_ext >&5
12080 ac_cv_lib_ipc_shmat=no
12081 fi
12082 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12083 LIBS=$ac_check_lib_save_LIBS
12084 fi
12085 echo "$as_me:12085: result: $ac_cv_lib_ipc_shmat" >&5
12086 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12087 if test $ac_cv_lib_ipc_shmat = yes; then
12088   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12089 fi
12090
12091     fi
12092   fi
12093
12094   # Check for libraries that X11R6 Xt/Xaw programs need.
12095   ac_save_LDFLAGS=$LDFLAGS
12096   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12097   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12098   # check for ICE first), but we must link in the order -lSM -lICE or
12099   # we get undefined symbols.  So assume we have SM if we have ICE.
12100   # These have to be linked with before -lX11, unlike the other
12101   # libraries we check for below, so use a different variable.
12102   # John Interrante, Karl Berry
12103   echo "$as_me:12103: checking for IceConnectionNumber in -lICE" >&5
12104 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12105 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12106   echo $ECHO_N "(cached) $ECHO_C" >&6
12107 else
12108   ac_check_lib_save_LIBS=$LIBS
12109 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12110 cat >conftest.$ac_ext <<_ACEOF
12111 #line 12111 "configure"
12112 #include "confdefs.h"
12113
12114 /* Override any gcc2 internal prototype to avoid an error.  */
12115 #ifdef __cplusplus
12116 extern "C"
12117 #endif
12118 /* We use char because int might match the return type of a gcc2
12119    builtin and then its argument prototype would still apply.  */
12120 char IceConnectionNumber ();
12121 int
12122 main (void)
12123 {
12124 IceConnectionNumber ();
12125   ;
12126   return 0;
12127 }
12128 _ACEOF
12129 rm -f conftest.$ac_objext conftest$ac_exeext
12130 if { (eval echo "$as_me:12130: \"$ac_link\"") >&5
12131   (eval $ac_link) 2>&5
12132   ac_status=$?
12133   echo "$as_me:12133: \$? = $ac_status" >&5
12134   (exit $ac_status); } &&
12135          { ac_try='test -s conftest$ac_exeext'
12136   { (eval echo "$as_me:12136: \"$ac_try\"") >&5
12137   (eval $ac_try) 2>&5
12138   ac_status=$?
12139   echo "$as_me:12139: \$? = $ac_status" >&5
12140   (exit $ac_status); }; }; then
12141   ac_cv_lib_ICE_IceConnectionNumber=yes
12142 else
12143   echo "$as_me: failed program was:" >&5
12144 cat conftest.$ac_ext >&5
12145 ac_cv_lib_ICE_IceConnectionNumber=no
12146 fi
12147 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12148 LIBS=$ac_check_lib_save_LIBS
12149 fi
12150 echo "$as_me:12150: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12151 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12152 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12153   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12154 fi
12155
12156   LDFLAGS=$ac_save_LDFLAGS
12157
12158 fi
12159
12160 cf_x_athena=${cf_x_athena:-Xaw}
12161
12162 echo "$as_me:12162: checking if you want to link with Xaw 3d library" >&5
12163 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12164 withval=
12165
12166 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12167 if test "${with_Xaw3d+set}" = set; then
12168   withval="$with_Xaw3d"
12169
12170 fi;
12171 if test "$withval" = yes ; then
12172         cf_x_athena=Xaw3d
12173         echo "$as_me:12173: result: yes" >&5
12174 echo "${ECHO_T}yes" >&6
12175 else
12176         echo "$as_me:12176: result: no" >&5
12177 echo "${ECHO_T}no" >&6
12178 fi
12179
12180 echo "$as_me:12180: checking if you want to link with Xaw 3d xft library" >&5
12181 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12182 withval=
12183
12184 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12185 if test "${with_Xaw3dxft+set}" = set; then
12186   withval="$with_Xaw3dxft"
12187
12188 fi;
12189 if test "$withval" = yes ; then
12190         cf_x_athena=Xaw3dxft
12191         echo "$as_me:12191: result: yes" >&5
12192 echo "${ECHO_T}yes" >&6
12193 else
12194         echo "$as_me:12194: result: no" >&5
12195 echo "${ECHO_T}no" >&6
12196 fi
12197
12198 echo "$as_me:12198: checking if you want to link with neXT Athena library" >&5
12199 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12200 withval=
12201
12202 # Check whether --with-neXtaw or --without-neXtaw was given.
12203 if test "${with_neXtaw+set}" = set; then
12204   withval="$with_neXtaw"
12205
12206 fi;
12207 if test "$withval" = yes ; then
12208         cf_x_athena=neXtaw
12209         echo "$as_me:12209: result: yes" >&5
12210 echo "${ECHO_T}yes" >&6
12211 else
12212         echo "$as_me:12212: result: no" >&5
12213 echo "${ECHO_T}no" >&6
12214 fi
12215
12216 echo "$as_me:12216: checking if you want to link with Athena-Plus library" >&5
12217 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12218 withval=
12219
12220 # Check whether --with-XawPlus or --without-XawPlus was given.
12221 if test "${with_XawPlus+set}" = set; then
12222   withval="$with_XawPlus"
12223
12224 fi;
12225 if test "$withval" = yes ; then
12226         cf_x_athena=XawPlus
12227         echo "$as_me:12227: result: yes" >&5
12228 echo "${ECHO_T}yes" >&6
12229 else
12230         echo "$as_me:12230: result: no" >&5
12231 echo "${ECHO_T}no" >&6
12232 fi
12233
12234 cf_x_athena_lib=""
12235
12236 if test "$PKG_CONFIG" != none ; then
12237         cf_athena_list=
12238         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12239         for cf_athena_pkg in \
12240                 $cf_athena_list \
12241                 ${cf_x_athena} \
12242                 ${cf_x_athena}-devel \
12243                 lib${cf_x_athena} \
12244                 lib${cf_x_athena}-devel
12245         do
12246
12247 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12248         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12249
12250 echo "${as_me:-configure}:12250: testing found package $cf_athena_pkg ..." 1>&5
12251
12252         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12253         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12254         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12255
12256 echo "${as_me:-configure}:12256: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12257
12258         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12259
12260 echo "${as_me:-configure}:12260: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12261
12262 cf_fix_cppflags=no
12263 cf_new_cflags=
12264 cf_new_cppflags=
12265 cf_new_extra_cppflags=
12266
12267 for cf_add_cflags in $cf_pkgconfig_incs
12268 do
12269 case $cf_fix_cppflags in
12270 (no)
12271         case $cf_add_cflags in
12272         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12273                 case $cf_add_cflags in
12274                 (-D*)
12275                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12276
12277                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12278                                 && test -z "${cf_tst_cflags}" \
12279                                 && cf_fix_cppflags=yes
12280
12281                         if test $cf_fix_cppflags = yes ; then
12282
12283         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12284         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12285
12286                                 continue
12287                         elif test "${cf_tst_cflags}" = "\"'" ; then
12288
12289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12291
12292                                 continue
12293                         fi
12294                         ;;
12295                 esac
12296                 case "$CPPFLAGS" in
12297                 (*$cf_add_cflags)
12298                         ;;
12299                 (*)
12300                         case $cf_add_cflags in
12301                         (-D*)
12302                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12303
12304 CPPFLAGS=`echo "$CPPFLAGS" | \
12305         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12306                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12307
12308                                 ;;
12309                         esac
12310
12311         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12312         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12313
12314                         ;;
12315                 esac
12316                 ;;
12317         (*)
12318
12319         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12320         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12321
12322                 ;;
12323         esac
12324         ;;
12325 (yes)
12326
12327         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12328         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12329
12330         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12331
12332         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12333                 && test -z "${cf_tst_cflags}" \
12334                 && cf_fix_cppflags=no
12335         ;;
12336 esac
12337 done
12338
12339 if test -n "$cf_new_cflags" ; then
12340
12341         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12342         CFLAGS="${CFLAGS}$cf_new_cflags"
12343
12344 fi
12345
12346 if test -n "$cf_new_cppflags" ; then
12347
12348         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12349         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12350
12351 fi
12352
12353 if test -n "$cf_new_extra_cppflags" ; then
12354
12355         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12356         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12357
12358 fi
12359
12360 cf_add_libs="$cf_pkgconfig_libs"
12361 # Filter out duplicates - this happens with badly-designed ".pc" files...
12362 for cf_add_1lib in $LIBS
12363 do
12364         for cf_add_2lib in $cf_add_libs
12365         do
12366                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12367                 then
12368                         cf_add_1lib=
12369                         break
12370                 fi
12371         done
12372         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12373 done
12374 LIBS="$cf_add_libs"
12375
12376                         cf_x_athena_lib="$cf_pkgconfig_libs"
12377
12378 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12379
12380                         cat >>confdefs.h <<EOF
12381 #define $cf_x_athena_LIBS 1
12382 EOF
12383
12384         for cf_trim_lib in Xmu Xt X11
12385         do
12386                 case "$LIBS" in
12387                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12388                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12389                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12390
12391 echo "${as_me:-configure}:12391: testing ..trimmed $LIBS ..." 1>&5
12392
12393                         ;;
12394                 esac
12395         done
12396
12397 echo "$as_me:12397: checking for usable $cf_x_athena/Xmu package" >&5
12398 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12399 if test "${cf_cv_xaw_compat+set}" = set; then
12400   echo $ECHO_N "(cached) $ECHO_C" >&6
12401 else
12402
12403 cat >conftest.$ac_ext <<_ACEOF
12404 #line 12404 "configure"
12405 #include "confdefs.h"
12406
12407 #include <X11/Xmu/CharSet.h>
12408
12409 int
12410 main (void)
12411 {
12412
12413 int check = XmuCompareISOLatin1("big", "small")
12414
12415   ;
12416   return 0;
12417 }
12418 _ACEOF
12419 rm -f conftest.$ac_objext conftest$ac_exeext
12420 if { (eval echo "$as_me:12420: \"$ac_link\"") >&5
12421   (eval $ac_link) 2>&5
12422   ac_status=$?
12423   echo "$as_me:12423: \$? = $ac_status" >&5
12424   (exit $ac_status); } &&
12425          { ac_try='test -s conftest$ac_exeext'
12426   { (eval echo "$as_me:12426: \"$ac_try\"") >&5
12427   (eval $ac_try) 2>&5
12428   ac_status=$?
12429   echo "$as_me:12429: \$? = $ac_status" >&5
12430   (exit $ac_status); }; }; then
12431   cf_cv_xaw_compat=yes
12432 else
12433   echo "$as_me: failed program was:" >&5
12434 cat conftest.$ac_ext >&5
12435 cf_cv_xaw_compat=no
12436 fi
12437 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12438 fi
12439 echo "$as_me:12439: result: $cf_cv_xaw_compat" >&5
12440 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12441
12442                         if test "$cf_cv_xaw_compat" = no
12443                         then
12444                                 # workaround for broken ".pc" files...
12445                                 case "$cf_x_athena_lib" in
12446                                 (*-lXmu*)
12447                                         ;;
12448                                 (*)
12449                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12450
12451 echo "${as_me:-configure}:12451: testing work around broken package ..." 1>&5
12452
12453                                         cf_save_xmu="$LIBS"
12454                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12455
12456 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12457         test -n "$verbose" && echo "    found package xmu" 1>&6
12458
12459 echo "${as_me:-configure}:12459: testing found package xmu ..." 1>&5
12460
12461         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12462         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12463         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12464
12465 echo "${as_me:-configure}:12465: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12466
12467         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12468
12469 echo "${as_me:-configure}:12469: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12470
12471 cf_fix_cppflags=no
12472 cf_new_cflags=
12473 cf_new_cppflags=
12474 cf_new_extra_cppflags=
12475
12476 for cf_add_cflags in $cf_pkgconfig_incs
12477 do
12478 case $cf_fix_cppflags in
12479 (no)
12480         case $cf_add_cflags in
12481         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12482                 case $cf_add_cflags in
12483                 (-D*)
12484                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12485
12486                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12487                                 && test -z "${cf_tst_cflags}" \
12488                                 && cf_fix_cppflags=yes
12489
12490                         if test $cf_fix_cppflags = yes ; then
12491
12492         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12493         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12494
12495                                 continue
12496                         elif test "${cf_tst_cflags}" = "\"'" ; then
12497
12498         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12499         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12500
12501                                 continue
12502                         fi
12503                         ;;
12504                 esac
12505                 case "$CPPFLAGS" in
12506                 (*$cf_add_cflags)
12507                         ;;
12508                 (*)
12509                         case $cf_add_cflags in
12510                         (-D*)
12511                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12512
12513 CPPFLAGS=`echo "$CPPFLAGS" | \
12514         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12515                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12516
12517                                 ;;
12518                         esac
12519
12520         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12521         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12522
12523                         ;;
12524                 esac
12525                 ;;
12526         (*)
12527
12528         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12529         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12530
12531                 ;;
12532         esac
12533         ;;
12534 (yes)
12535
12536         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12537         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12538
12539         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12540
12541         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12542                 && test -z "${cf_tst_cflags}" \
12543                 && cf_fix_cppflags=no
12544         ;;
12545 esac
12546 done
12547
12548 if test -n "$cf_new_cflags" ; then
12549
12550         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12551         CFLAGS="${CFLAGS}$cf_new_cflags"
12552
12553 fi
12554
12555 if test -n "$cf_new_cppflags" ; then
12556
12557         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12558         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12559
12560 fi
12561
12562 if test -n "$cf_new_extra_cppflags" ; then
12563
12564         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12565         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12566
12567 fi
12568
12569 cf_add_libs="$cf_pkgconfig_libs"
12570 # Filter out duplicates - this happens with badly-designed ".pc" files...
12571 for cf_add_1lib in $LIBS
12572 do
12573         for cf_add_2lib in $cf_add_libs
12574         do
12575                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12576                 then
12577                         cf_add_1lib=
12578                         break
12579                 fi
12580         done
12581         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12582 done
12583 LIBS="$cf_add_libs"
12584
12585                                                         LIBS="$cf_save_xmu"
12586
12587 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12588
12589 echo "${as_me:-configure}:12589: testing ...before $LIBS ..." 1>&5
12590
12591 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
12592 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12593
12594 echo "${as_me:-configure}:12594: testing ...after  $LIBS ..." 1>&5
12595
12596 else
12597         cf_pkgconfig_incs=
12598         cf_pkgconfig_libs=
12599
12600 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12601
12602 echo "${as_me:-configure}:12602: testing ...before $LIBS ..." 1>&5
12603
12604 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
12605 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12606
12607 echo "${as_me:-configure}:12607: testing ...after  $LIBS ..." 1>&5
12608
12609 fi
12610
12611         for cf_trim_lib in Xmu Xt X11
12612         do
12613                 case "$LIBS" in
12614                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12615                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12616                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12617
12618 echo "${as_me:-configure}:12618: testing ..trimmed $LIBS ..." 1>&5
12619
12620                         ;;
12621                 esac
12622         done
12623
12624                                         ;;
12625                                 esac
12626                         fi
12627
12628                         break
12629 else
12630         cf_pkgconfig_incs=
12631         cf_pkgconfig_libs=
12632         :
12633 fi
12634
12635         done
12636 fi
12637
12638 if test -z "$cf_x_athena_lib" ; then
12639
12640 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
12641         test -n "$verbose" && echo "    found package Xext" 1>&6
12642
12643 echo "${as_me:-configure}:12643: testing found package Xext ..." 1>&5
12644
12645         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
12646         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
12647         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
12648
12649 echo "${as_me:-configure}:12649: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12650
12651         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
12652
12653 echo "${as_me:-configure}:12653: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
12654
12655 cf_fix_cppflags=no
12656 cf_new_cflags=
12657 cf_new_cppflags=
12658 cf_new_extra_cppflags=
12659
12660 for cf_add_cflags in $cf_pkgconfig_incs
12661 do
12662 case $cf_fix_cppflags in
12663 (no)
12664         case $cf_add_cflags in
12665         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12666                 case $cf_add_cflags in
12667                 (-D*)
12668                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12669
12670                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12671                                 && test -z "${cf_tst_cflags}" \
12672                                 && cf_fix_cppflags=yes
12673
12674                         if test $cf_fix_cppflags = yes ; then
12675
12676         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12677         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12678
12679                                 continue
12680                         elif test "${cf_tst_cflags}" = "\"'" ; then
12681
12682         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12683         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12684
12685                                 continue
12686                         fi
12687                         ;;
12688                 esac
12689                 case "$CPPFLAGS" in
12690                 (*$cf_add_cflags)
12691                         ;;
12692                 (*)
12693                         case $cf_add_cflags in
12694                         (-D*)
12695                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12696
12697 CPPFLAGS=`echo "$CPPFLAGS" | \
12698         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12699                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12700
12701                                 ;;
12702                         esac
12703
12704         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12705         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12706
12707                         ;;
12708                 esac
12709                 ;;
12710         (*)
12711
12712         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12713         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12714
12715                 ;;
12716         esac
12717         ;;
12718 (yes)
12719
12720         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12721         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12722
12723         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12724
12725         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12726                 && test -z "${cf_tst_cflags}" \
12727                 && cf_fix_cppflags=no
12728         ;;
12729 esac
12730 done
12731
12732 if test -n "$cf_new_cflags" ; then
12733
12734         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12735         CFLAGS="${CFLAGS}$cf_new_cflags"
12736
12737 fi
12738
12739 if test -n "$cf_new_cppflags" ; then
12740
12741         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12742         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12743
12744 fi
12745
12746 if test -n "$cf_new_extra_cppflags" ; then
12747
12748         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12749         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12750
12751 fi
12752
12753 cf_add_libs="$cf_pkgconfig_libs"
12754 # Filter out duplicates - this happens with badly-designed ".pc" files...
12755 for cf_add_1lib in $LIBS
12756 do
12757         for cf_add_2lib in $cf_add_libs
12758         do
12759                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12760                 then
12761                         cf_add_1lib=
12762                         break
12763                 fi
12764         done
12765         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12766 done
12767 LIBS="$cf_add_libs"
12768
12769         :
12770 else
12771         cf_pkgconfig_incs=
12772         cf_pkgconfig_libs=
12773
12774         echo "$as_me:12774: checking for XextCreateExtension in -lXext" >&5
12775 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
12776 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
12777   echo $ECHO_N "(cached) $ECHO_C" >&6
12778 else
12779   ac_check_lib_save_LIBS=$LIBS
12780 LIBS="-lXext  $LIBS"
12781 cat >conftest.$ac_ext <<_ACEOF
12782 #line 12782 "configure"
12783 #include "confdefs.h"
12784
12785 /* Override any gcc2 internal prototype to avoid an error.  */
12786 #ifdef __cplusplus
12787 extern "C"
12788 #endif
12789 /* We use char because int might match the return type of a gcc2
12790    builtin and then its argument prototype would still apply.  */
12791 char XextCreateExtension ();
12792 int
12793 main (void)
12794 {
12795 XextCreateExtension ();
12796   ;
12797   return 0;
12798 }
12799 _ACEOF
12800 rm -f conftest.$ac_objext conftest$ac_exeext
12801 if { (eval echo "$as_me:12801: \"$ac_link\"") >&5
12802   (eval $ac_link) 2>&5
12803   ac_status=$?
12804   echo "$as_me:12804: \$? = $ac_status" >&5
12805   (exit $ac_status); } &&
12806          { ac_try='test -s conftest$ac_exeext'
12807   { (eval echo "$as_me:12807: \"$ac_try\"") >&5
12808   (eval $ac_try) 2>&5
12809   ac_status=$?
12810   echo "$as_me:12810: \$? = $ac_status" >&5
12811   (exit $ac_status); }; }; then
12812   ac_cv_lib_Xext_XextCreateExtension=yes
12813 else
12814   echo "$as_me: failed program was:" >&5
12815 cat conftest.$ac_ext >&5
12816 ac_cv_lib_Xext_XextCreateExtension=no
12817 fi
12818 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12819 LIBS=$ac_check_lib_save_LIBS
12820 fi
12821 echo "$as_me:12821: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
12822 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
12823 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
12824
12825 cf_add_libs="-lXext"
12826 # Filter out duplicates - this happens with badly-designed ".pc" files...
12827 for cf_add_1lib in $LIBS
12828 do
12829         for cf_add_2lib in $cf_add_libs
12830         do
12831                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12832                 then
12833                         cf_add_1lib=
12834                         break
12835                 fi
12836         done
12837         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12838 done
12839 LIBS="$cf_add_libs"
12840
12841 fi
12842
12843 fi
12844
12845 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
12846 # in some cases has installed dummy files in the former, other cases replaced
12847 # it with a link to the new location).  This complicates the configure script.
12848 # Check for that pitfall, and recover using pkg-config
12849 #
12850 # If none of these are set, the configuration is almost certainly broken.
12851 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
12852 then
12853
12854 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12855         test -n "$verbose" && echo "    found package x11" 1>&6
12856
12857 echo "${as_me:-configure}:12857: testing found package x11 ..." 1>&5
12858
12859         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12860         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12861         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12862
12863 echo "${as_me:-configure}:12863: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12864
12865         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12866
12867 echo "${as_me:-configure}:12867: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12868
12869 cf_fix_cppflags=no
12870 cf_new_cflags=
12871 cf_new_cppflags=
12872 cf_new_extra_cppflags=
12873
12874 for cf_add_cflags in $cf_pkgconfig_incs
12875 do
12876 case $cf_fix_cppflags in
12877 (no)
12878         case $cf_add_cflags in
12879         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12880                 case $cf_add_cflags in
12881                 (-D*)
12882                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12883
12884                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12885                                 && test -z "${cf_tst_cflags}" \
12886                                 && cf_fix_cppflags=yes
12887
12888                         if test $cf_fix_cppflags = yes ; then
12889
12890         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12891         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12892
12893                                 continue
12894                         elif test "${cf_tst_cflags}" = "\"'" ; then
12895
12896         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12897         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12898
12899                                 continue
12900                         fi
12901                         ;;
12902                 esac
12903                 case "$CPPFLAGS" in
12904                 (*$cf_add_cflags)
12905                         ;;
12906                 (*)
12907                         case $cf_add_cflags in
12908                         (-D*)
12909                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12910
12911 CPPFLAGS=`echo "$CPPFLAGS" | \
12912         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12913                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12914
12915                                 ;;
12916                         esac
12917
12918         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12919         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12920
12921                         ;;
12922                 esac
12923                 ;;
12924         (*)
12925
12926         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12927         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12928
12929                 ;;
12930         esac
12931         ;;
12932 (yes)
12933
12934         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12935         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12936
12937         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12938
12939         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12940                 && test -z "${cf_tst_cflags}" \
12941                 && cf_fix_cppflags=no
12942         ;;
12943 esac
12944 done
12945
12946 if test -n "$cf_new_cflags" ; then
12947
12948         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12949         CFLAGS="${CFLAGS}$cf_new_cflags"
12950
12951 fi
12952
12953 if test -n "$cf_new_cppflags" ; then
12954
12955         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12956         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12957
12958 fi
12959
12960 if test -n "$cf_new_extra_cppflags" ; then
12961
12962         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12963         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12964
12965 fi
12966
12967 cf_add_libs="$cf_pkgconfig_libs"
12968 # Filter out duplicates - this happens with badly-designed ".pc" files...
12969 for cf_add_1lib in $LIBS
12970 do
12971         for cf_add_2lib in $cf_add_libs
12972         do
12973                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12974                 then
12975                         cf_add_1lib=
12976                         break
12977                 fi
12978         done
12979         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12980 done
12981 LIBS="$cf_add_libs"
12982
12983         :
12984 else
12985         cf_pkgconfig_incs=
12986         cf_pkgconfig_libs=
12987         { echo "$as_me:12987: WARNING: unable to find X11 library" >&5
12988 echo "$as_me: WARNING: unable to find X11 library" >&2;}
12989 fi
12990
12991 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12992         test -n "$verbose" && echo "    found package ice" 1>&6
12993
12994 echo "${as_me:-configure}:12994: testing found package ice ..." 1>&5
12995
12996         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12997         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12998         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12999
13000 echo "${as_me:-configure}:13000: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13001
13002         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13003
13004 echo "${as_me:-configure}:13004: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13005
13006 cf_fix_cppflags=no
13007 cf_new_cflags=
13008 cf_new_cppflags=
13009 cf_new_extra_cppflags=
13010
13011 for cf_add_cflags in $cf_pkgconfig_incs
13012 do
13013 case $cf_fix_cppflags in
13014 (no)
13015         case $cf_add_cflags in
13016         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13017                 case $cf_add_cflags in
13018                 (-D*)
13019                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13020
13021                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13022                                 && test -z "${cf_tst_cflags}" \
13023                                 && cf_fix_cppflags=yes
13024
13025                         if test $cf_fix_cppflags = yes ; then
13026
13027         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13028         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13029
13030                                 continue
13031                         elif test "${cf_tst_cflags}" = "\"'" ; then
13032
13033         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13034         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13035
13036                                 continue
13037                         fi
13038                         ;;
13039                 esac
13040                 case "$CPPFLAGS" in
13041                 (*$cf_add_cflags)
13042                         ;;
13043                 (*)
13044                         case $cf_add_cflags in
13045                         (-D*)
13046                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13047
13048 CPPFLAGS=`echo "$CPPFLAGS" | \
13049         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13050                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13051
13052                                 ;;
13053                         esac
13054
13055         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13056         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13057
13058                         ;;
13059                 esac
13060                 ;;
13061         (*)
13062
13063         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13064         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13065
13066                 ;;
13067         esac
13068         ;;
13069 (yes)
13070
13071         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13072         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13073
13074         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13075
13076         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13077                 && test -z "${cf_tst_cflags}" \
13078                 && cf_fix_cppflags=no
13079         ;;
13080 esac
13081 done
13082
13083 if test -n "$cf_new_cflags" ; then
13084
13085         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13086         CFLAGS="${CFLAGS}$cf_new_cflags"
13087
13088 fi
13089
13090 if test -n "$cf_new_cppflags" ; then
13091
13092         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13093         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13094
13095 fi
13096
13097 if test -n "$cf_new_extra_cppflags" ; then
13098
13099         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13100         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13101
13102 fi
13103
13104 cf_add_libs="$cf_pkgconfig_libs"
13105 # Filter out duplicates - this happens with badly-designed ".pc" files...
13106 for cf_add_1lib in $LIBS
13107 do
13108         for cf_add_2lib in $cf_add_libs
13109         do
13110                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13111                 then
13112                         cf_add_1lib=
13113                         break
13114                 fi
13115         done
13116         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13117 done
13118 LIBS="$cf_add_libs"
13119
13120         :
13121 else
13122         cf_pkgconfig_incs=
13123         cf_pkgconfig_libs=
13124         { echo "$as_me:13124: WARNING: unable to find ICE library" >&5
13125 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13126 fi
13127
13128 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13129         test -n "$verbose" && echo "    found package sm" 1>&6
13130
13131 echo "${as_me:-configure}:13131: testing found package sm ..." 1>&5
13132
13133         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13134         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13135         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13136
13137 echo "${as_me:-configure}:13137: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13138
13139         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13140
13141 echo "${as_me:-configure}:13141: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13142
13143 cf_fix_cppflags=no
13144 cf_new_cflags=
13145 cf_new_cppflags=
13146 cf_new_extra_cppflags=
13147
13148 for cf_add_cflags in $cf_pkgconfig_incs
13149 do
13150 case $cf_fix_cppflags in
13151 (no)
13152         case $cf_add_cflags in
13153         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13154                 case $cf_add_cflags in
13155                 (-D*)
13156                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13157
13158                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13159                                 && test -z "${cf_tst_cflags}" \
13160                                 && cf_fix_cppflags=yes
13161
13162                         if test $cf_fix_cppflags = yes ; then
13163
13164         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13165         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13166
13167                                 continue
13168                         elif test "${cf_tst_cflags}" = "\"'" ; then
13169
13170         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13171         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13172
13173                                 continue
13174                         fi
13175                         ;;
13176                 esac
13177                 case "$CPPFLAGS" in
13178                 (*$cf_add_cflags)
13179                         ;;
13180                 (*)
13181                         case $cf_add_cflags in
13182                         (-D*)
13183                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13184
13185 CPPFLAGS=`echo "$CPPFLAGS" | \
13186         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13187                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13188
13189                                 ;;
13190                         esac
13191
13192         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13193         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13194
13195                         ;;
13196                 esac
13197                 ;;
13198         (*)
13199
13200         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13201         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13202
13203                 ;;
13204         esac
13205         ;;
13206 (yes)
13207
13208         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13209         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13210
13211         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13212
13213         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13214                 && test -z "${cf_tst_cflags}" \
13215                 && cf_fix_cppflags=no
13216         ;;
13217 esac
13218 done
13219
13220 if test -n "$cf_new_cflags" ; then
13221
13222         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13223         CFLAGS="${CFLAGS}$cf_new_cflags"
13224
13225 fi
13226
13227 if test -n "$cf_new_cppflags" ; then
13228
13229         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13230         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13231
13232 fi
13233
13234 if test -n "$cf_new_extra_cppflags" ; then
13235
13236         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13237         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13238
13239 fi
13240
13241 cf_add_libs="$cf_pkgconfig_libs"
13242 # Filter out duplicates - this happens with badly-designed ".pc" files...
13243 for cf_add_1lib in $LIBS
13244 do
13245         for cf_add_2lib in $cf_add_libs
13246         do
13247                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13248                 then
13249                         cf_add_1lib=
13250                         break
13251                 fi
13252         done
13253         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13254 done
13255 LIBS="$cf_add_libs"
13256
13257         :
13258 else
13259         cf_pkgconfig_incs=
13260         cf_pkgconfig_libs=
13261         { echo "$as_me:13261: WARNING: unable to find SM library" >&5
13262 echo "$as_me: WARNING: unable to find SM library" >&2;}
13263 fi
13264
13265 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13266         test -n "$verbose" && echo "    found package xt" 1>&6
13267
13268 echo "${as_me:-configure}:13268: testing found package xt ..." 1>&5
13269
13270         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13271         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13272         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13273
13274 echo "${as_me:-configure}:13274: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13275
13276         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13277
13278 echo "${as_me:-configure}:13278: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13279
13280 cf_fix_cppflags=no
13281 cf_new_cflags=
13282 cf_new_cppflags=
13283 cf_new_extra_cppflags=
13284
13285 for cf_add_cflags in $cf_pkgconfig_incs
13286 do
13287 case $cf_fix_cppflags in
13288 (no)
13289         case $cf_add_cflags in
13290         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13291                 case $cf_add_cflags in
13292                 (-D*)
13293                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13294
13295                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13296                                 && test -z "${cf_tst_cflags}" \
13297                                 && cf_fix_cppflags=yes
13298
13299                         if test $cf_fix_cppflags = yes ; then
13300
13301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13303
13304                                 continue
13305                         elif test "${cf_tst_cflags}" = "\"'" ; then
13306
13307         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13308         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13309
13310                                 continue
13311                         fi
13312                         ;;
13313                 esac
13314                 case "$CPPFLAGS" in
13315                 (*$cf_add_cflags)
13316                         ;;
13317                 (*)
13318                         case $cf_add_cflags in
13319                         (-D*)
13320                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13321
13322 CPPFLAGS=`echo "$CPPFLAGS" | \
13323         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13324                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13325
13326                                 ;;
13327                         esac
13328
13329         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13330         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13331
13332                         ;;
13333                 esac
13334                 ;;
13335         (*)
13336
13337         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13338         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13339
13340                 ;;
13341         esac
13342         ;;
13343 (yes)
13344
13345         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13346         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13347
13348         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13349
13350         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13351                 && test -z "${cf_tst_cflags}" \
13352                 && cf_fix_cppflags=no
13353         ;;
13354 esac
13355 done
13356
13357 if test -n "$cf_new_cflags" ; then
13358
13359         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13360         CFLAGS="${CFLAGS}$cf_new_cflags"
13361
13362 fi
13363
13364 if test -n "$cf_new_cppflags" ; then
13365
13366         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13367         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13368
13369 fi
13370
13371 if test -n "$cf_new_extra_cppflags" ; then
13372
13373         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13374         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13375
13376 fi
13377
13378 cf_add_libs="$cf_pkgconfig_libs"
13379 # Filter out duplicates - this happens with badly-designed ".pc" files...
13380 for cf_add_1lib in $LIBS
13381 do
13382         for cf_add_2lib in $cf_add_libs
13383         do
13384                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13385                 then
13386                         cf_add_1lib=
13387                         break
13388                 fi
13389         done
13390         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13391 done
13392 LIBS="$cf_add_libs"
13393
13394         :
13395 else
13396         cf_pkgconfig_incs=
13397         cf_pkgconfig_libs=
13398         { echo "$as_me:13398: WARNING: unable to find Xt library" >&5
13399 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13400 fi
13401
13402 fi
13403
13404 cf_have_X_LIBS=no
13405
13406 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13407         test -n "$verbose" && echo "    found package xt" 1>&6
13408
13409 echo "${as_me:-configure}:13409: testing found package xt ..." 1>&5
13410
13411         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13412         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13413         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13414
13415 echo "${as_me:-configure}:13415: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13416
13417         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13418
13419 echo "${as_me:-configure}:13419: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13420
13421 cf_fix_cppflags=no
13422 cf_new_cflags=
13423 cf_new_cppflags=
13424 cf_new_extra_cppflags=
13425
13426 for cf_add_cflags in $cf_pkgconfig_incs
13427 do
13428 case $cf_fix_cppflags in
13429 (no)
13430         case $cf_add_cflags in
13431         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13432                 case $cf_add_cflags in
13433                 (-D*)
13434                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13435
13436                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13437                                 && test -z "${cf_tst_cflags}" \
13438                                 && cf_fix_cppflags=yes
13439
13440                         if test $cf_fix_cppflags = yes ; then
13441
13442         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13443         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13444
13445                                 continue
13446                         elif test "${cf_tst_cflags}" = "\"'" ; then
13447
13448         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13449         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13450
13451                                 continue
13452                         fi
13453                         ;;
13454                 esac
13455                 case "$CPPFLAGS" in
13456                 (*$cf_add_cflags)
13457                         ;;
13458                 (*)
13459                         case $cf_add_cflags in
13460                         (-D*)
13461                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13462
13463 CPPFLAGS=`echo "$CPPFLAGS" | \
13464         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13465                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13466
13467                                 ;;
13468                         esac
13469
13470         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13471         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13472
13473                         ;;
13474                 esac
13475                 ;;
13476         (*)
13477
13478         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13479         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13480
13481                 ;;
13482         esac
13483         ;;
13484 (yes)
13485
13486         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13487         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13488
13489         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13490
13491         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13492                 && test -z "${cf_tst_cflags}" \
13493                 && cf_fix_cppflags=no
13494         ;;
13495 esac
13496 done
13497
13498 if test -n "$cf_new_cflags" ; then
13499
13500         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13501         CFLAGS="${CFLAGS}$cf_new_cflags"
13502
13503 fi
13504
13505 if test -n "$cf_new_cppflags" ; then
13506
13507         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13508         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13509
13510 fi
13511
13512 if test -n "$cf_new_extra_cppflags" ; then
13513
13514         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13515         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13516
13517 fi
13518
13519 cf_add_libs="$cf_pkgconfig_libs"
13520 # Filter out duplicates - this happens with badly-designed ".pc" files...
13521 for cf_add_1lib in $LIBS
13522 do
13523         for cf_add_2lib in $cf_add_libs
13524         do
13525                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13526                 then
13527                         cf_add_1lib=
13528                         break
13529                 fi
13530         done
13531         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13532 done
13533 LIBS="$cf_add_libs"
13534
13535         case "x$LIBS" in
13536         (*-lX11*)
13537                 ;;
13538         (*)
13539 # we have an "xt" package, but it may omit Xt's dependency on X11
13540 echo "$as_me:13540: checking for usable X dependency" >&5
13541 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
13542 if test "${cf_cv_xt_x11_compat+set}" = set; then
13543   echo $ECHO_N "(cached) $ECHO_C" >&6
13544 else
13545
13546 cat >conftest.$ac_ext <<_ACEOF
13547 #line 13547 "configure"
13548 #include "confdefs.h"
13549
13550 #include <X11/Xlib.h>
13551
13552 int
13553 main (void)
13554 {
13555
13556         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
13557         int rc2 = XClearWindow((Display*) 0, (Window) 0);
13558         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
13559         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
13560
13561   ;
13562   return 0;
13563 }
13564 _ACEOF
13565 rm -f conftest.$ac_objext conftest$ac_exeext
13566 if { (eval echo "$as_me:13566: \"$ac_link\"") >&5
13567   (eval $ac_link) 2>&5
13568   ac_status=$?
13569   echo "$as_me:13569: \$? = $ac_status" >&5
13570   (exit $ac_status); } &&
13571          { ac_try='test -s conftest$ac_exeext'
13572   { (eval echo "$as_me:13572: \"$ac_try\"") >&5
13573   (eval $ac_try) 2>&5
13574   ac_status=$?
13575   echo "$as_me:13575: \$? = $ac_status" >&5
13576   (exit $ac_status); }; }; then
13577   cf_cv_xt_x11_compat=yes
13578 else
13579   echo "$as_me: failed program was:" >&5
13580 cat conftest.$ac_ext >&5
13581 cf_cv_xt_x11_compat=no
13582 fi
13583 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13584 fi
13585 echo "$as_me:13585: result: $cf_cv_xt_x11_compat" >&5
13586 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
13587                 if test "$cf_cv_xt_x11_compat" = no
13588                 then
13589                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
13590
13591 echo "${as_me:-configure}:13591: testing work around broken X11 dependency ..." 1>&5
13592
13593                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
13594
13595 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13596         test -n "$verbose" && echo "    found package x11" 1>&6
13597
13598 echo "${as_me:-configure}:13598: testing found package x11 ..." 1>&5
13599
13600         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13601         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13602         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13603
13604 echo "${as_me:-configure}:13604: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13605
13606         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13607
13608 echo "${as_me:-configure}:13608: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13609
13610 cf_fix_cppflags=no
13611 cf_new_cflags=
13612 cf_new_cppflags=
13613 cf_new_extra_cppflags=
13614
13615 for cf_add_cflags in $cf_pkgconfig_incs
13616 do
13617 case $cf_fix_cppflags in
13618 (no)
13619         case $cf_add_cflags in
13620         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13621                 case $cf_add_cflags in
13622                 (-D*)
13623                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13624
13625                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13626                                 && test -z "${cf_tst_cflags}" \
13627                                 && cf_fix_cppflags=yes
13628
13629                         if test $cf_fix_cppflags = yes ; then
13630
13631         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13632         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13633
13634                                 continue
13635                         elif test "${cf_tst_cflags}" = "\"'" ; then
13636
13637         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13638         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13639
13640                                 continue
13641                         fi
13642                         ;;
13643                 esac
13644                 case "$CPPFLAGS" in
13645                 (*$cf_add_cflags)
13646                         ;;
13647                 (*)
13648                         case $cf_add_cflags in
13649                         (-D*)
13650                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13651
13652 CPPFLAGS=`echo "$CPPFLAGS" | \
13653         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13654                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13655
13656                                 ;;
13657                         esac
13658
13659         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13660         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13661
13662                         ;;
13663                 esac
13664                 ;;
13665         (*)
13666
13667         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13668         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13669
13670                 ;;
13671         esac
13672         ;;
13673 (yes)
13674
13675         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13676         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13677
13678         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13679
13680         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13681                 && test -z "${cf_tst_cflags}" \
13682                 && cf_fix_cppflags=no
13683         ;;
13684 esac
13685 done
13686
13687 if test -n "$cf_new_cflags" ; then
13688
13689         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13690         CFLAGS="${CFLAGS}$cf_new_cflags"
13691
13692 fi
13693
13694 if test -n "$cf_new_cppflags" ; then
13695
13696         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13697         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13698
13699 fi
13700
13701 if test -n "$cf_new_extra_cppflags" ; then
13702
13703         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13704         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13705
13706 fi
13707
13708 cf_add_libs="$cf_pkgconfig_libs"
13709 # Filter out duplicates - this happens with badly-designed ".pc" files...
13710 for cf_add_1lib in $LIBS
13711 do
13712         for cf_add_2lib in $cf_add_libs
13713         do
13714                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13715                 then
13716                         cf_add_1lib=
13717                         break
13718                 fi
13719         done
13720         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13721 done
13722 LIBS="$cf_add_libs"
13723
13724         :
13725 else
13726         cf_pkgconfig_incs=
13727         cf_pkgconfig_libs=
13728
13729 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13730
13731 echo "${as_me:-configure}:13731: testing ...before $LIBS ..." 1>&5
13732
13733 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
13734 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13735
13736 echo "${as_me:-configure}:13736: testing ...after  $LIBS ..." 1>&5
13737
13738 fi
13739
13740                 fi
13741                 ;;
13742         esac
13743
13744 echo "$as_me:13744: checking for usable X Toolkit package" >&5
13745 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
13746 if test "${cf_cv_xt_ice_compat+set}" = set; then
13747   echo $ECHO_N "(cached) $ECHO_C" >&6
13748 else
13749
13750 cat >conftest.$ac_ext <<_ACEOF
13751 #line 13751 "configure"
13752 #include "confdefs.h"
13753
13754 #include <X11/Shell.h>
13755
13756 int
13757 main (void)
13758 {
13759 int num = IceConnectionNumber(0)
13760
13761   ;
13762   return 0;
13763 }
13764 _ACEOF
13765 rm -f conftest.$ac_objext conftest$ac_exeext
13766 if { (eval echo "$as_me:13766: \"$ac_link\"") >&5
13767   (eval $ac_link) 2>&5
13768   ac_status=$?
13769   echo "$as_me:13769: \$? = $ac_status" >&5
13770   (exit $ac_status); } &&
13771          { ac_try='test -s conftest$ac_exeext'
13772   { (eval echo "$as_me:13772: \"$ac_try\"") >&5
13773   (eval $ac_try) 2>&5
13774   ac_status=$?
13775   echo "$as_me:13775: \$? = $ac_status" >&5
13776   (exit $ac_status); }; }; then
13777   cf_cv_xt_ice_compat=yes
13778 else
13779   echo "$as_me: failed program was:" >&5
13780 cat conftest.$ac_ext >&5
13781 cf_cv_xt_ice_compat=no
13782 fi
13783 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13784 fi
13785 echo "$as_me:13785: result: $cf_cv_xt_ice_compat" >&5
13786 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
13787
13788         if test "$cf_cv_xt_ice_compat" = no
13789         then
13790                 # workaround for broken ".pc" files used for X Toolkit.
13791                 case "x$X_PRE_LIBS" in
13792                 (*-lICE*)
13793                         case "x$LIBS" in
13794                         (*-lICE*)
13795                                 ;;
13796                         (*)
13797                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
13798
13799 echo "${as_me:-configure}:13799: testing work around broken ICE dependency ..." 1>&5
13800
13801 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13802         test -n "$verbose" && echo "    found package ice" 1>&6
13803
13804 echo "${as_me:-configure}:13804: testing found package ice ..." 1>&5
13805
13806         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13807         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13808         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13809
13810 echo "${as_me:-configure}:13810: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13811
13812         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13813
13814 echo "${as_me:-configure}:13814: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13815
13816 cf_fix_cppflags=no
13817 cf_new_cflags=
13818 cf_new_cppflags=
13819 cf_new_extra_cppflags=
13820
13821 for cf_add_cflags in $cf_pkgconfig_incs
13822 do
13823 case $cf_fix_cppflags in
13824 (no)
13825         case $cf_add_cflags in
13826         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13827                 case $cf_add_cflags in
13828                 (-D*)
13829                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13830
13831                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13832                                 && test -z "${cf_tst_cflags}" \
13833                                 && cf_fix_cppflags=yes
13834
13835                         if test $cf_fix_cppflags = yes ; then
13836
13837         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13838         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13839
13840                                 continue
13841                         elif test "${cf_tst_cflags}" = "\"'" ; then
13842
13843         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13844         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13845
13846                                 continue
13847                         fi
13848                         ;;
13849                 esac
13850                 case "$CPPFLAGS" in
13851                 (*$cf_add_cflags)
13852                         ;;
13853                 (*)
13854                         case $cf_add_cflags in
13855                         (-D*)
13856                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13857
13858 CPPFLAGS=`echo "$CPPFLAGS" | \
13859         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13860                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13861
13862                                 ;;
13863                         esac
13864
13865         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13866         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13867
13868                         ;;
13869                 esac
13870                 ;;
13871         (*)
13872
13873         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13874         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13875
13876                 ;;
13877         esac
13878         ;;
13879 (yes)
13880
13881         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13882         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13883
13884         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13885
13886         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13887                 && test -z "${cf_tst_cflags}" \
13888                 && cf_fix_cppflags=no
13889         ;;
13890 esac
13891 done
13892
13893 if test -n "$cf_new_cflags" ; then
13894
13895         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13896         CFLAGS="${CFLAGS}$cf_new_cflags"
13897
13898 fi
13899
13900 if test -n "$cf_new_cppflags" ; then
13901
13902         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13903         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13904
13905 fi
13906
13907 if test -n "$cf_new_extra_cppflags" ; then
13908
13909         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13910         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13911
13912 fi
13913
13914 cf_add_libs="$cf_pkgconfig_libs"
13915 # Filter out duplicates - this happens with badly-designed ".pc" files...
13916 for cf_add_1lib in $LIBS
13917 do
13918         for cf_add_2lib in $cf_add_libs
13919         do
13920                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13921                 then
13922                         cf_add_1lib=
13923                         break
13924                 fi
13925         done
13926         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13927 done
13928 LIBS="$cf_add_libs"
13929
13930 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13931         test -n "$verbose" && echo "    found package sm" 1>&6
13932
13933 echo "${as_me:-configure}:13933: testing found package sm ..." 1>&5
13934
13935         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13936         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13937         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13938
13939 echo "${as_me:-configure}:13939: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13940
13941         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13942
13943 echo "${as_me:-configure}:13943: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13944
13945 cf_fix_cppflags=no
13946 cf_new_cflags=
13947 cf_new_cppflags=
13948 cf_new_extra_cppflags=
13949
13950 for cf_add_cflags in $cf_pkgconfig_incs
13951 do
13952 case $cf_fix_cppflags in
13953 (no)
13954         case $cf_add_cflags in
13955         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13956                 case $cf_add_cflags in
13957                 (-D*)
13958                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13959
13960                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13961                                 && test -z "${cf_tst_cflags}" \
13962                                 && cf_fix_cppflags=yes
13963
13964                         if test $cf_fix_cppflags = yes ; then
13965
13966         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13967         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13968
13969                                 continue
13970                         elif test "${cf_tst_cflags}" = "\"'" ; then
13971
13972         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13973         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13974
13975                                 continue
13976                         fi
13977                         ;;
13978                 esac
13979                 case "$CPPFLAGS" in
13980                 (*$cf_add_cflags)
13981                         ;;
13982                 (*)
13983                         case $cf_add_cflags in
13984                         (-D*)
13985                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13986
13987 CPPFLAGS=`echo "$CPPFLAGS" | \
13988         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13989                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13990
13991                                 ;;
13992                         esac
13993
13994         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13995         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13996
13997                         ;;
13998                 esac
13999                 ;;
14000         (*)
14001
14002         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14003         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14004
14005                 ;;
14006         esac
14007         ;;
14008 (yes)
14009
14010         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14011         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14012
14013         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14014
14015         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14016                 && test -z "${cf_tst_cflags}" \
14017                 && cf_fix_cppflags=no
14018         ;;
14019 esac
14020 done
14021
14022 if test -n "$cf_new_cflags" ; then
14023
14024         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14025         CFLAGS="${CFLAGS}$cf_new_cflags"
14026
14027 fi
14028
14029 if test -n "$cf_new_cppflags" ; then
14030
14031         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14032         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14033
14034 fi
14035
14036 if test -n "$cf_new_extra_cppflags" ; then
14037
14038         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14039         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14040
14041 fi
14042
14043 cf_add_libs="$cf_pkgconfig_libs"
14044 # Filter out duplicates - this happens with badly-designed ".pc" files...
14045 for cf_add_1lib in $LIBS
14046 do
14047         for cf_add_2lib in $cf_add_libs
14048         do
14049                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14050                 then
14051                         cf_add_1lib=
14052                         break
14053                 fi
14054         done
14055         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14056 done
14057 LIBS="$cf_add_libs"
14058
14059         :
14060 else
14061         cf_pkgconfig_incs=
14062         cf_pkgconfig_libs=
14063         :
14064 fi
14065
14066 else
14067         cf_pkgconfig_incs=
14068         cf_pkgconfig_libs=
14069
14070 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14071
14072 echo "${as_me:-configure}:14072: testing ...before $LIBS ..." 1>&5
14073
14074 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14075 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14076
14077 echo "${as_me:-configure}:14077: testing ...after  $LIBS ..." 1>&5
14078
14079 fi
14080
14081                                 ;;
14082                         esac
14083                         ;;
14084                 esac
14085         fi
14086
14087         cf_have_X_LIBS=yes
14088
14089 else
14090         cf_pkgconfig_incs=
14091         cf_pkgconfig_libs=
14092
14093         LDFLAGS="$X_LIBS $LDFLAGS"
14094
14095 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14096
14097 echo "${as_me:-configure}:14097: testing checking additions to CFLAGS ..." 1>&5
14098
14099 cf_check_cflags="$CFLAGS"
14100 cf_check_cppflags="$CPPFLAGS"
14101
14102 cf_fix_cppflags=no
14103 cf_new_cflags=
14104 cf_new_cppflags=
14105 cf_new_extra_cppflags=
14106
14107 for cf_add_cflags in $X_CFLAGS
14108 do
14109 case $cf_fix_cppflags in
14110 (no)
14111         case $cf_add_cflags in
14112         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14113                 case $cf_add_cflags in
14114                 (-D*)
14115                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14116
14117                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14118                                 && test -z "${cf_tst_cflags}" \
14119                                 && cf_fix_cppflags=yes
14120
14121                         if test $cf_fix_cppflags = yes ; then
14122
14123         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14124         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14125
14126                                 continue
14127                         elif test "${cf_tst_cflags}" = "\"'" ; then
14128
14129         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14130         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14131
14132                                 continue
14133                         fi
14134                         ;;
14135                 esac
14136                 case "$CPPFLAGS" in
14137                 (*$cf_add_cflags)
14138                         ;;
14139                 (*)
14140                         case $cf_add_cflags in
14141                         (-D*)
14142                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14143
14144 CPPFLAGS=`echo "$CPPFLAGS" | \
14145         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14146                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14147
14148                                 ;;
14149                         esac
14150
14151         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14152         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14153
14154                         ;;
14155                 esac
14156                 ;;
14157         (*)
14158
14159         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14160         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14161
14162                 ;;
14163         esac
14164         ;;
14165 (yes)
14166
14167         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14168         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14169
14170         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14171
14172         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14173                 && test -z "${cf_tst_cflags}" \
14174                 && cf_fix_cppflags=no
14175         ;;
14176 esac
14177 done
14178
14179 if test -n "$cf_new_cflags" ; then
14180         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14181
14182 echo "${as_me:-configure}:14182: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14183
14184         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14185         CFLAGS="${CFLAGS}$cf_new_cflags"
14186
14187 fi
14188
14189 if test -n "$cf_new_cppflags" ; then
14190         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14191
14192 echo "${as_me:-configure}:14192: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14193
14194         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14195         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14196
14197 fi
14198
14199 if test -n "$cf_new_extra_cppflags" ; then
14200         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14201
14202 echo "${as_me:-configure}:14202: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14203
14204         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14205         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14206
14207 fi
14208
14209 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14210 cat >conftest.$ac_ext <<_ACEOF
14211 #line 14211 "configure"
14212 #include "confdefs.h"
14213 #include <stdio.h>
14214 int
14215 main (void)
14216 {
14217 printf("Hello world");
14218   ;
14219   return 0;
14220 }
14221 _ACEOF
14222 rm -f conftest.$ac_objext conftest$ac_exeext
14223 if { (eval echo "$as_me:14223: \"$ac_link\"") >&5
14224   (eval $ac_link) 2>&5
14225   ac_status=$?
14226   echo "$as_me:14226: \$? = $ac_status" >&5
14227   (exit $ac_status); } &&
14228          { ac_try='test -s conftest$ac_exeext'
14229   { (eval echo "$as_me:14229: \"$ac_try\"") >&5
14230   (eval $ac_try) 2>&5
14231   ac_status=$?
14232   echo "$as_me:14232: \$? = $ac_status" >&5
14233   (exit $ac_status); }; }; then
14234   :
14235 else
14236   echo "$as_me: failed program was:" >&5
14237 cat conftest.$ac_ext >&5
14238 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14239
14240 echo "${as_me:-configure}:14240: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14241
14242          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14243                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14244
14245 echo "${as_me:-configure}:14245: testing but keeping change to \$CPPFLAGS ..." 1>&5
14246
14247          fi
14248          CFLAGS="$cf_check_flags"
14249 fi
14250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14251 fi
14252
14253         echo "$as_me:14253: checking for XOpenDisplay" >&5
14254 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14255 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14256   echo $ECHO_N "(cached) $ECHO_C" >&6
14257 else
14258   cat >conftest.$ac_ext <<_ACEOF
14259 #line 14259 "configure"
14260 #include "confdefs.h"
14261 #define XOpenDisplay autoconf_temporary
14262 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14263 #undef XOpenDisplay
14264
14265 #ifdef __cplusplus
14266 extern "C"
14267 #endif
14268
14269 /* We use char because int might match the return type of a gcc2
14270    builtin and then its argument prototype would still apply.  */
14271 char XOpenDisplay (void);
14272
14273 int
14274 main (void)
14275 {
14276
14277 /* The GNU C library defines stubs for functions which it implements
14278     to always fail with ENOSYS.  Some functions are actually named
14279     something starting with __ and the normal name is an alias.  */
14280 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14281 #error found stub for XOpenDisplay
14282 #endif
14283
14284         return XOpenDisplay ();
14285   ;
14286   return 0;
14287 }
14288 _ACEOF
14289 rm -f conftest.$ac_objext conftest$ac_exeext
14290 if { (eval echo "$as_me:14290: \"$ac_link\"") >&5
14291   (eval $ac_link) 2>&5
14292   ac_status=$?
14293   echo "$as_me:14293: \$? = $ac_status" >&5
14294   (exit $ac_status); } &&
14295          { ac_try='test -s conftest$ac_exeext'
14296   { (eval echo "$as_me:14296: \"$ac_try\"") >&5
14297   (eval $ac_try) 2>&5
14298   ac_status=$?
14299   echo "$as_me:14299: \$? = $ac_status" >&5
14300   (exit $ac_status); }; }; then
14301   ac_cv_func_XOpenDisplay=yes
14302 else
14303   echo "$as_me: failed program was:" >&5
14304 cat conftest.$ac_ext >&5
14305 ac_cv_func_XOpenDisplay=no
14306 fi
14307 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14308 fi
14309 echo "$as_me:14309: result: $ac_cv_func_XOpenDisplay" >&5
14310 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14311 if test $ac_cv_func_XOpenDisplay = yes; then
14312   :
14313 else
14314
14315         echo "$as_me:14315: checking for XOpenDisplay in -lX11" >&5
14316 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14317 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14318   echo $ECHO_N "(cached) $ECHO_C" >&6
14319 else
14320   ac_check_lib_save_LIBS=$LIBS
14321 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14322 cat >conftest.$ac_ext <<_ACEOF
14323 #line 14323 "configure"
14324 #include "confdefs.h"
14325
14326 /* Override any gcc2 internal prototype to avoid an error.  */
14327 #ifdef __cplusplus
14328 extern "C"
14329 #endif
14330 /* We use char because int might match the return type of a gcc2
14331    builtin and then its argument prototype would still apply.  */
14332 char XOpenDisplay ();
14333 int
14334 main (void)
14335 {
14336 XOpenDisplay ();
14337   ;
14338   return 0;
14339 }
14340 _ACEOF
14341 rm -f conftest.$ac_objext conftest$ac_exeext
14342 if { (eval echo "$as_me:14342: \"$ac_link\"") >&5
14343   (eval $ac_link) 2>&5
14344   ac_status=$?
14345   echo "$as_me:14345: \$? = $ac_status" >&5
14346   (exit $ac_status); } &&
14347          { ac_try='test -s conftest$ac_exeext'
14348   { (eval echo "$as_me:14348: \"$ac_try\"") >&5
14349   (eval $ac_try) 2>&5
14350   ac_status=$?
14351   echo "$as_me:14351: \$? = $ac_status" >&5
14352   (exit $ac_status); }; }; then
14353   ac_cv_lib_X11_XOpenDisplay=yes
14354 else
14355   echo "$as_me: failed program was:" >&5
14356 cat conftest.$ac_ext >&5
14357 ac_cv_lib_X11_XOpenDisplay=no
14358 fi
14359 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14360 LIBS=$ac_check_lib_save_LIBS
14361 fi
14362 echo "$as_me:14362: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14363 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14364 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14365
14366 cf_add_libs="-lX11"
14367 # Filter out duplicates - this happens with badly-designed ".pc" files...
14368 for cf_add_1lib in $LIBS
14369 do
14370         for cf_add_2lib in $cf_add_libs
14371         do
14372                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14373                 then
14374                         cf_add_1lib=
14375                         break
14376                 fi
14377         done
14378         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14379 done
14380 LIBS="$cf_add_libs"
14381
14382 fi
14383
14384 fi
14385
14386         echo "$as_me:14386: checking for XtAppInitialize" >&5
14387 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14388 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14389   echo $ECHO_N "(cached) $ECHO_C" >&6
14390 else
14391   cat >conftest.$ac_ext <<_ACEOF
14392 #line 14392 "configure"
14393 #include "confdefs.h"
14394 #define XtAppInitialize autoconf_temporary
14395 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14396 #undef XtAppInitialize
14397
14398 #ifdef __cplusplus
14399 extern "C"
14400 #endif
14401
14402 /* We use char because int might match the return type of a gcc2
14403    builtin and then its argument prototype would still apply.  */
14404 char XtAppInitialize (void);
14405
14406 int
14407 main (void)
14408 {
14409
14410 /* The GNU C library defines stubs for functions which it implements
14411     to always fail with ENOSYS.  Some functions are actually named
14412     something starting with __ and the normal name is an alias.  */
14413 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14414 #error found stub for XtAppInitialize
14415 #endif
14416
14417         return XtAppInitialize ();
14418   ;
14419   return 0;
14420 }
14421 _ACEOF
14422 rm -f conftest.$ac_objext conftest$ac_exeext
14423 if { (eval echo "$as_me:14423: \"$ac_link\"") >&5
14424   (eval $ac_link) 2>&5
14425   ac_status=$?
14426   echo "$as_me:14426: \$? = $ac_status" >&5
14427   (exit $ac_status); } &&
14428          { ac_try='test -s conftest$ac_exeext'
14429   { (eval echo "$as_me:14429: \"$ac_try\"") >&5
14430   (eval $ac_try) 2>&5
14431   ac_status=$?
14432   echo "$as_me:14432: \$? = $ac_status" >&5
14433   (exit $ac_status); }; }; then
14434   ac_cv_func_XtAppInitialize=yes
14435 else
14436   echo "$as_me: failed program was:" >&5
14437 cat conftest.$ac_ext >&5
14438 ac_cv_func_XtAppInitialize=no
14439 fi
14440 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14441 fi
14442 echo "$as_me:14442: result: $ac_cv_func_XtAppInitialize" >&5
14443 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14444 if test $ac_cv_func_XtAppInitialize = yes; then
14445   :
14446 else
14447
14448         echo "$as_me:14448: checking for XtAppInitialize in -lXt" >&5
14449 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14450 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14451   echo $ECHO_N "(cached) $ECHO_C" >&6
14452 else
14453   ac_check_lib_save_LIBS=$LIBS
14454 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14455 cat >conftest.$ac_ext <<_ACEOF
14456 #line 14456 "configure"
14457 #include "confdefs.h"
14458
14459 /* Override any gcc2 internal prototype to avoid an error.  */
14460 #ifdef __cplusplus
14461 extern "C"
14462 #endif
14463 /* We use char because int might match the return type of a gcc2
14464    builtin and then its argument prototype would still apply.  */
14465 char XtAppInitialize ();
14466 int
14467 main (void)
14468 {
14469 XtAppInitialize ();
14470   ;
14471   return 0;
14472 }
14473 _ACEOF
14474 rm -f conftest.$ac_objext conftest$ac_exeext
14475 if { (eval echo "$as_me:14475: \"$ac_link\"") >&5
14476   (eval $ac_link) 2>&5
14477   ac_status=$?
14478   echo "$as_me:14478: \$? = $ac_status" >&5
14479   (exit $ac_status); } &&
14480          { ac_try='test -s conftest$ac_exeext'
14481   { (eval echo "$as_me:14481: \"$ac_try\"") >&5
14482   (eval $ac_try) 2>&5
14483   ac_status=$?
14484   echo "$as_me:14484: \$? = $ac_status" >&5
14485   (exit $ac_status); }; }; then
14486   ac_cv_lib_Xt_XtAppInitialize=yes
14487 else
14488   echo "$as_me: failed program was:" >&5
14489 cat conftest.$ac_ext >&5
14490 ac_cv_lib_Xt_XtAppInitialize=no
14491 fi
14492 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14493 LIBS=$ac_check_lib_save_LIBS
14494 fi
14495 echo "$as_me:14495: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
14496 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
14497 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
14498
14499 cat >>confdefs.h <<\EOF
14500 #define HAVE_LIBXT 1
14501 EOF
14502
14503                  cf_have_X_LIBS=Xt
14504                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14505 fi
14506
14507 fi
14508
14509 fi
14510
14511 if test $cf_have_X_LIBS = no ; then
14512         { echo "$as_me:14512: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14513 test program.  You will have to check and add the proper libraries by hand
14514 to makefile." >&5
14515 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14516 test program.  You will have to check and add the proper libraries by hand
14517 to makefile." >&2;}
14518 fi
14519
14520 cf_x_athena_root=$cf_x_athena
14521 cf_x_athena_inc=""
14522
14523 for cf_path in default \
14524         /usr/contrib/X11R6 \
14525         /usr/contrib/X11R5 \
14526         /usr/lib/X11R5 \
14527         /usr/local
14528 do
14529         if test -z "$cf_x_athena_inc" ; then
14530                 cf_save="$CPPFLAGS"
14531                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
14532                 if test $cf_path != default ; then
14533                         CPPFLAGS="$cf_save"
14534
14535         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14536         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
14537
14538                         echo "$as_me:14538: checking for $cf_test in $cf_path" >&5
14539 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
14540                 else
14541                         echo "$as_me:14541: checking for $cf_test" >&5
14542 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
14543                 fi
14544                 cat >conftest.$ac_ext <<_ACEOF
14545 #line 14545 "configure"
14546 #include "confdefs.h"
14547
14548 #include <X11/Intrinsic.h>
14549 #include <$cf_test>
14550 int
14551 main (void)
14552 {
14553
14554   ;
14555   return 0;
14556 }
14557 _ACEOF
14558 rm -f conftest.$ac_objext
14559 if { (eval echo "$as_me:14559: \"$ac_compile\"") >&5
14560   (eval $ac_compile) 2>&5
14561   ac_status=$?
14562   echo "$as_me:14562: \$? = $ac_status" >&5
14563   (exit $ac_status); } &&
14564          { ac_try='test -s conftest.$ac_objext'
14565   { (eval echo "$as_me:14565: \"$ac_try\"") >&5
14566   (eval $ac_try) 2>&5
14567   ac_status=$?
14568   echo "$as_me:14568: \$? = $ac_status" >&5
14569   (exit $ac_status); }; }; then
14570   cf_result=yes
14571 else
14572   echo "$as_me: failed program was:" >&5
14573 cat conftest.$ac_ext >&5
14574 cf_result=no
14575 fi
14576 rm -f conftest.$ac_objext conftest.$ac_ext
14577                 echo "$as_me:14577: result: $cf_result" >&5
14578 echo "${ECHO_T}$cf_result" >&6
14579                 if test "$cf_result" = yes ; then
14580                         cf_x_athena_inc=$cf_path
14581                         break
14582                 else
14583                         CPPFLAGS="$cf_save"
14584                 fi
14585         fi
14586 done
14587
14588 if test -z "$cf_x_athena_inc" ; then
14589         { echo "$as_me:14589: WARNING: Unable to successfully find Athena header files with test program" >&5
14590 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
14591 elif test "$cf_x_athena_inc" != default ; then
14592
14593         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14594         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
14595
14596 fi
14597
14598 cf_x_athena_root=$cf_x_athena
14599 cf_x_athena_lib=""
14600
14601 for cf_path in default \
14602         /usr/contrib/X11R6 \
14603         /usr/contrib/X11R5 \
14604         /usr/lib/X11R5 \
14605         /usr/local
14606 do
14607         for cf_lib in \
14608                 ${cf_x_athena_root} \
14609                 ${cf_x_athena_root}7 \
14610                 ${cf_x_athena_root}6
14611         do
14612         for cf_libs in \
14613                 "-l$cf_lib -lXmu" \
14614                 "-l$cf_lib -lXpm -lXmu" \
14615                 "-l${cf_lib}_s -lXmu_s"
14616         do
14617                 if test -z "$cf_x_athena_lib" ; then
14618                         cf_save="$LIBS"
14619                         cf_test=XawSimpleMenuAddGlobalActions
14620                         if test $cf_path != default ; then
14621
14622 cf_add_libs="-L$cf_path/lib $cf_libs"
14623 # Filter out duplicates - this happens with badly-designed ".pc" files...
14624 for cf_add_1lib in $LIBS
14625 do
14626         for cf_add_2lib in $cf_add_libs
14627         do
14628                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14629                 then
14630                         cf_add_1lib=
14631                         break
14632                 fi
14633         done
14634         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14635 done
14636 LIBS="$cf_add_libs"
14637
14638                                 echo "$as_me:14638: checking for $cf_libs in $cf_path" >&5
14639 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
14640                         else
14641
14642 cf_add_libs="$cf_libs"
14643 # Filter out duplicates - this happens with badly-designed ".pc" files...
14644 for cf_add_1lib in $LIBS
14645 do
14646         for cf_add_2lib in $cf_add_libs
14647         do
14648                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14649                 then
14650                         cf_add_1lib=
14651                         break
14652                 fi
14653         done
14654         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14655 done
14656 LIBS="$cf_add_libs"
14657
14658                                 echo "$as_me:14658: checking for $cf_test in $cf_libs" >&5
14659 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
14660                         fi
14661                         cat >conftest.$ac_ext <<_ACEOF
14662 #line 14662 "configure"
14663 #include "confdefs.h"
14664
14665 #include <X11/Intrinsic.h>
14666 #include <X11/$cf_x_athena_root/SimpleMenu.h>
14667
14668 int
14669 main (void)
14670 {
14671
14672 $cf_test((XtAppContext) 0)
14673   ;
14674   return 0;
14675 }
14676 _ACEOF
14677 rm -f conftest.$ac_objext conftest$ac_exeext
14678 if { (eval echo "$as_me:14678: \"$ac_link\"") >&5
14679   (eval $ac_link) 2>&5
14680   ac_status=$?
14681   echo "$as_me:14681: \$? = $ac_status" >&5
14682   (exit $ac_status); } &&
14683          { ac_try='test -s conftest$ac_exeext'
14684   { (eval echo "$as_me:14684: \"$ac_try\"") >&5
14685   (eval $ac_try) 2>&5
14686   ac_status=$?
14687   echo "$as_me:14687: \$? = $ac_status" >&5
14688   (exit $ac_status); }; }; then
14689   cf_result=yes
14690 else
14691   echo "$as_me: failed program was:" >&5
14692 cat conftest.$ac_ext >&5
14693 cf_result=no
14694 fi
14695 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14696                         echo "$as_me:14696: result: $cf_result" >&5
14697 echo "${ECHO_T}$cf_result" >&6
14698                         if test "$cf_result" = yes ; then
14699                                 cf_x_athena_lib="$cf_libs"
14700                                 break
14701                         fi
14702                         LIBS="$cf_save"
14703                 fi
14704         done # cf_libs
14705                 test -n "$cf_x_athena_lib" && break
14706         done # cf_lib
14707 done
14708
14709 if test -z "$cf_x_athena_lib" ; then
14710         { { echo "$as_me:14710: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
14711 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
14712    { (exit 1); exit 1; }; }
14713 fi
14714
14715 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14716
14717 cat >>confdefs.h <<EOF
14718 #define $cf_x_athena_LIBS 1
14719 EOF
14720
14721 fi
14722
14723 if test -n "$ac_tool_prefix"; then
14724   for ac_prog in xcurses-config
14725   do
14726     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
14727 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
14728 echo "$as_me:14728: checking for $ac_word" >&5
14729 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14730 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
14731   echo $ECHO_N "(cached) $ECHO_C" >&6
14732 else
14733   if test -n "$XCURSES_CONFIG"; then
14734   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
14735 else
14736   ac_save_IFS=$IFS; IFS=$ac_path_separator
14737 ac_dummy="$PATH"
14738 for ac_dir in $ac_dummy; do
14739   IFS=$ac_save_IFS
14740   test -z "$ac_dir" && ac_dir=.
14741   $as_executable_p "$ac_dir/$ac_word" || continue
14742 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
14743 echo "$as_me:14743: found $ac_dir/$ac_word" >&5
14744 break
14745 done
14746
14747 fi
14748 fi
14749 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
14750 if test -n "$XCURSES_CONFIG"; then
14751   echo "$as_me:14751: result: $XCURSES_CONFIG" >&5
14752 echo "${ECHO_T}$XCURSES_CONFIG" >&6
14753 else
14754   echo "$as_me:14754: result: no" >&5
14755 echo "${ECHO_T}no" >&6
14756 fi
14757
14758     test -n "$XCURSES_CONFIG" && break
14759   done
14760 fi
14761 if test -z "$XCURSES_CONFIG"; then
14762   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
14763   for ac_prog in xcurses-config
14764 do
14765   # Extract the first word of "$ac_prog", so it can be a program name with args.
14766 set dummy $ac_prog; ac_word=$2
14767 echo "$as_me:14767: checking for $ac_word" >&5
14768 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14769 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
14770   echo $ECHO_N "(cached) $ECHO_C" >&6
14771 else
14772   if test -n "$ac_ct_XCURSES_CONFIG"; then
14773   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
14774 else
14775   ac_save_IFS=$IFS; IFS=$ac_path_separator
14776 ac_dummy="$PATH"
14777 for ac_dir in $ac_dummy; do
14778   IFS=$ac_save_IFS
14779   test -z "$ac_dir" && ac_dir=.
14780   $as_executable_p "$ac_dir/$ac_word" || continue
14781 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
14782 echo "$as_me:14782: found $ac_dir/$ac_word" >&5
14783 break
14784 done
14785
14786 fi
14787 fi
14788 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
14789 if test -n "$ac_ct_XCURSES_CONFIG"; then
14790   echo "$as_me:14790: result: $ac_ct_XCURSES_CONFIG" >&5
14791 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
14792 else
14793   echo "$as_me:14793: result: no" >&5
14794 echo "${ECHO_T}no" >&6
14795 fi
14796
14797   test -n "$ac_ct_XCURSES_CONFIG" && break
14798 done
14799 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
14800
14801   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
14802 fi
14803
14804 if test "$XCURSES_CONFIG" != none ; then
14805
14806 cf_fix_cppflags=no
14807 cf_new_cflags=
14808 cf_new_cppflags=
14809 cf_new_extra_cppflags=
14810
14811 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
14812 do
14813 case $cf_fix_cppflags in
14814 (no)
14815         case $cf_add_cflags in
14816         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14817                 case $cf_add_cflags in
14818                 (-D*)
14819                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14820
14821                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14822                                 && test -z "${cf_tst_cflags}" \
14823                                 && cf_fix_cppflags=yes
14824
14825                         if test $cf_fix_cppflags = yes ; then
14826
14827         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14828         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14829
14830                                 continue
14831                         elif test "${cf_tst_cflags}" = "\"'" ; then
14832
14833         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14834         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14835
14836                                 continue
14837                         fi
14838                         ;;
14839                 esac
14840                 case "$CPPFLAGS" in
14841                 (*$cf_add_cflags)
14842                         ;;
14843                 (*)
14844                         case $cf_add_cflags in
14845                         (-D*)
14846                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14847
14848 CPPFLAGS=`echo "$CPPFLAGS" | \
14849         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14850                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14851
14852                                 ;;
14853                         esac
14854
14855         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14856         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14857
14858                         ;;
14859                 esac
14860                 ;;
14861         (*)
14862
14863         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14864         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14865
14866                 ;;
14867         esac
14868         ;;
14869 (yes)
14870
14871         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14872         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14873
14874         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14875
14876         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14877                 && test -z "${cf_tst_cflags}" \
14878                 && cf_fix_cppflags=no
14879         ;;
14880 esac
14881 done
14882
14883 if test -n "$cf_new_cflags" ; then
14884
14885         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14886         CFLAGS="${CFLAGS}$cf_new_cflags"
14887
14888 fi
14889
14890 if test -n "$cf_new_cppflags" ; then
14891
14892         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14893         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14894
14895 fi
14896
14897 if test -n "$cf_new_extra_cppflags" ; then
14898
14899         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14900         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14901
14902 fi
14903
14904 cf_add_libs="`$XCURSES_CONFIG --libs`"
14905 # Filter out duplicates - this happens with badly-designed ".pc" files...
14906 for cf_add_1lib in $LIBS
14907 do
14908         for cf_add_2lib in $cf_add_libs
14909         do
14910                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14911                 then
14912                         cf_add_1lib=
14913                         break
14914                 fi
14915         done
14916         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14917 done
14918 LIBS="$cf_add_libs"
14919
14920 cf_cv_lib_XCurses=yes
14921
14922 else
14923
14924 LDFLAGS="$LDFLAGS $X_LIBS"
14925
14926 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14927
14928 echo "${as_me:-configure}:14928: testing checking additions to CFLAGS ..." 1>&5
14929
14930 cf_check_cflags="$CFLAGS"
14931 cf_check_cppflags="$CPPFLAGS"
14932
14933 cf_fix_cppflags=no
14934 cf_new_cflags=
14935 cf_new_cppflags=
14936 cf_new_extra_cppflags=
14937
14938 for cf_add_cflags in $X_CFLAGS
14939 do
14940 case $cf_fix_cppflags in
14941 (no)
14942         case $cf_add_cflags in
14943         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14944                 case $cf_add_cflags in
14945                 (-D*)
14946                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14947
14948                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14949                                 && test -z "${cf_tst_cflags}" \
14950                                 && cf_fix_cppflags=yes
14951
14952                         if test $cf_fix_cppflags = yes ; then
14953
14954         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14955         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14956
14957                                 continue
14958                         elif test "${cf_tst_cflags}" = "\"'" ; then
14959
14960         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14961         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14962
14963                                 continue
14964                         fi
14965                         ;;
14966                 esac
14967                 case "$CPPFLAGS" in
14968                 (*$cf_add_cflags)
14969                         ;;
14970                 (*)
14971                         case $cf_add_cflags in
14972                         (-D*)
14973                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14974
14975 CPPFLAGS=`echo "$CPPFLAGS" | \
14976         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14977                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14978
14979                                 ;;
14980                         esac
14981
14982         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14983         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14984
14985                         ;;
14986                 esac
14987                 ;;
14988         (*)
14989
14990         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14991         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14992
14993                 ;;
14994         esac
14995         ;;
14996 (yes)
14997
14998         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14999         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15000
15001         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15002
15003         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15004                 && test -z "${cf_tst_cflags}" \
15005                 && cf_fix_cppflags=no
15006         ;;
15007 esac
15008 done
15009
15010 if test -n "$cf_new_cflags" ; then
15011         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15012
15013 echo "${as_me:-configure}:15013: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15014
15015         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15016         CFLAGS="${CFLAGS}$cf_new_cflags"
15017
15018 fi
15019
15020 if test -n "$cf_new_cppflags" ; then
15021         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15022
15023 echo "${as_me:-configure}:15023: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15024
15025         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15026         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15027
15028 fi
15029
15030 if test -n "$cf_new_extra_cppflags" ; then
15031         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15032
15033 echo "${as_me:-configure}:15033: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15034
15035         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15036         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15037
15038 fi
15039
15040 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15041 cat >conftest.$ac_ext <<_ACEOF
15042 #line 15042 "configure"
15043 #include "confdefs.h"
15044 #include <stdio.h>
15045 int
15046 main (void)
15047 {
15048 printf("Hello world");
15049   ;
15050   return 0;
15051 }
15052 _ACEOF
15053 rm -f conftest.$ac_objext conftest$ac_exeext
15054 if { (eval echo "$as_me:15054: \"$ac_link\"") >&5
15055   (eval $ac_link) 2>&5
15056   ac_status=$?
15057   echo "$as_me:15057: \$? = $ac_status" >&5
15058   (exit $ac_status); } &&
15059          { ac_try='test -s conftest$ac_exeext'
15060   { (eval echo "$as_me:15060: \"$ac_try\"") >&5
15061   (eval $ac_try) 2>&5
15062   ac_status=$?
15063   echo "$as_me:15063: \$? = $ac_status" >&5
15064   (exit $ac_status); }; }; then
15065   :
15066 else
15067   echo "$as_me: failed program was:" >&5
15068 cat conftest.$ac_ext >&5
15069 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15070
15071 echo "${as_me:-configure}:15071: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15072
15073          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15074                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15075
15076 echo "${as_me:-configure}:15076: testing but keeping change to \$CPPFLAGS ..." 1>&5
15077
15078          fi
15079          CFLAGS="$cf_check_flags"
15080 fi
15081 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15082 fi
15083
15084 echo "$as_me:15084: checking for XOpenDisplay in -lX11" >&5
15085 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15086 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15087   echo $ECHO_N "(cached) $ECHO_C" >&6
15088 else
15089   ac_check_lib_save_LIBS=$LIBS
15090 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15091 cat >conftest.$ac_ext <<_ACEOF
15092 #line 15092 "configure"
15093 #include "confdefs.h"
15094
15095 /* Override any gcc2 internal prototype to avoid an error.  */
15096 #ifdef __cplusplus
15097 extern "C"
15098 #endif
15099 /* We use char because int might match the return type of a gcc2
15100    builtin and then its argument prototype would still apply.  */
15101 char XOpenDisplay ();
15102 int
15103 main (void)
15104 {
15105 XOpenDisplay ();
15106   ;
15107   return 0;
15108 }
15109 _ACEOF
15110 rm -f conftest.$ac_objext conftest$ac_exeext
15111 if { (eval echo "$as_me:15111: \"$ac_link\"") >&5
15112   (eval $ac_link) 2>&5
15113   ac_status=$?
15114   echo "$as_me:15114: \$? = $ac_status" >&5
15115   (exit $ac_status); } &&
15116          { ac_try='test -s conftest$ac_exeext'
15117   { (eval echo "$as_me:15117: \"$ac_try\"") >&5
15118   (eval $ac_try) 2>&5
15119   ac_status=$?
15120   echo "$as_me:15120: \$? = $ac_status" >&5
15121   (exit $ac_status); }; }; then
15122   ac_cv_lib_X11_XOpenDisplay=yes
15123 else
15124   echo "$as_me: failed program was:" >&5
15125 cat conftest.$ac_ext >&5
15126 ac_cv_lib_X11_XOpenDisplay=no
15127 fi
15128 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15129 LIBS=$ac_check_lib_save_LIBS
15130 fi
15131 echo "$as_me:15131: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15132 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15133 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15134
15135 cf_add_libs="-lX11"
15136 # Filter out duplicates - this happens with badly-designed ".pc" files...
15137 for cf_add_1lib in $LIBS
15138 do
15139         for cf_add_2lib in $cf_add_libs
15140         do
15141                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15142                 then
15143                         cf_add_1lib=
15144                         break
15145                 fi
15146         done
15147         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15148 done
15149 LIBS="$cf_add_libs"
15150
15151 fi
15152
15153 echo "$as_me:15153: checking for XCurses library" >&5
15154 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15155 if test "${cf_cv_lib_XCurses+set}" = set; then
15156   echo $ECHO_N "(cached) $ECHO_C" >&6
15157 else
15158
15159 cf_add_libs="-lXCurses"
15160 # Filter out duplicates - this happens with badly-designed ".pc" files...
15161 for cf_add_1lib in $LIBS
15162 do
15163         for cf_add_2lib in $cf_add_libs
15164         do
15165                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15166                 then
15167                         cf_add_1lib=
15168                         break
15169                 fi
15170         done
15171         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15172 done
15173 LIBS="$cf_add_libs"
15174
15175 cat >conftest.$ac_ext <<_ACEOF
15176 #line 15176 "configure"
15177 #include "confdefs.h"
15178
15179 #include <xcurses.h>
15180 char *XCursesProgramName = "test";
15181
15182 int
15183 main (void)
15184 {
15185 XCursesExit();
15186   ;
15187   return 0;
15188 }
15189 _ACEOF
15190 rm -f conftest.$ac_objext conftest$ac_exeext
15191 if { (eval echo "$as_me:15191: \"$ac_link\"") >&5
15192   (eval $ac_link) 2>&5
15193   ac_status=$?
15194   echo "$as_me:15194: \$? = $ac_status" >&5
15195   (exit $ac_status); } &&
15196          { ac_try='test -s conftest$ac_exeext'
15197   { (eval echo "$as_me:15197: \"$ac_try\"") >&5
15198   (eval $ac_try) 2>&5
15199   ac_status=$?
15200   echo "$as_me:15200: \$? = $ac_status" >&5
15201   (exit $ac_status); }; }; then
15202   cf_cv_lib_XCurses=yes
15203 else
15204   echo "$as_me: failed program was:" >&5
15205 cat conftest.$ac_ext >&5
15206 cf_cv_lib_XCurses=no
15207 fi
15208 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15209
15210 fi
15211 echo "$as_me:15211: result: $cf_cv_lib_XCurses" >&5
15212 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15213
15214 fi
15215
15216 if test $cf_cv_lib_XCurses = yes ; then
15217
15218 cat >>confdefs.h <<\EOF
15219 #define UNIX 1
15220 EOF
15221
15222 cat >>confdefs.h <<\EOF
15223 #define XCURSES 1
15224 EOF
15225
15226         echo "$as_me:15226: checking for xcurses.h" >&5
15227 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15228 if test "${ac_cv_header_xcurses_h+set}" = set; then
15229   echo $ECHO_N "(cached) $ECHO_C" >&6
15230 else
15231   cat >conftest.$ac_ext <<_ACEOF
15232 #line 15232 "configure"
15233 #include "confdefs.h"
15234 #include <xcurses.h>
15235 _ACEOF
15236 if { (eval echo "$as_me:15236: \"$ac_cpp conftest.$ac_ext\"") >&5
15237   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15238   ac_status=$?
15239   egrep -v '^ *\+' conftest.er1 >conftest.err
15240   rm -f conftest.er1
15241   cat conftest.err >&5
15242   echo "$as_me:15242: \$? = $ac_status" >&5
15243   (exit $ac_status); } >/dev/null; then
15244   if test -s conftest.err; then
15245     ac_cpp_err=$ac_c_preproc_warn_flag
15246   else
15247     ac_cpp_err=
15248   fi
15249 else
15250   ac_cpp_err=yes
15251 fi
15252 if test -z "$ac_cpp_err"; then
15253   ac_cv_header_xcurses_h=yes
15254 else
15255   echo "$as_me: failed program was:" >&5
15256   cat conftest.$ac_ext >&5
15257   ac_cv_header_xcurses_h=no
15258 fi
15259 rm -f conftest.err conftest.$ac_ext
15260 fi
15261 echo "$as_me:15261: result: $ac_cv_header_xcurses_h" >&5
15262 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15263 if test $ac_cv_header_xcurses_h = yes; then
15264
15265 cat >>confdefs.h <<\EOF
15266 #define HAVE_XCURSES 1
15267 EOF
15268
15269 fi
15270
15271 else
15272         { { echo "$as_me:15272: error: Cannot link with XCurses" >&5
15273 echo "$as_me: error: Cannot link with XCurses" >&2;}
15274    { (exit 1); exit 1; }; }
15275 fi
15276
15277         ;;
15278 (*)
15279         { { echo "$as_me:15279: error: unexpected screen-value: $cf_cv_screen" >&5
15280 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15281    { (exit 1); exit 1; }; }
15282         ;;
15283 esac
15284
15285 : ${cf_nculib_root:=$cf_cv_screen}
15286 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15287 echo "$as_me:15287: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15288 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15289 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15290   echo $ECHO_N "(cached) $ECHO_C" >&6
15291 else
15292   ac_check_lib_save_LIBS=$LIBS
15293 LIBS="-l$cf_nculib_root  $LIBS"
15294 cat >conftest.$ac_ext <<_ACEOF
15295 #line 15295 "configure"
15296 #include "confdefs.h"
15297
15298 /* Override any gcc2 internal prototype to avoid an error.  */
15299 #ifdef __cplusplus
15300 extern "C"
15301 #endif
15302 /* We use char because int might match the return type of a gcc2
15303    builtin and then its argument prototype would still apply.  */
15304 char _nc_init_pthreads ();
15305 int
15306 main (void)
15307 {
15308 _nc_init_pthreads ();
15309   ;
15310   return 0;
15311 }
15312 _ACEOF
15313 rm -f conftest.$ac_objext conftest$ac_exeext
15314 if { (eval echo "$as_me:15314: \"$ac_link\"") >&5
15315   (eval $ac_link) 2>&5
15316   ac_status=$?
15317   echo "$as_me:15317: \$? = $ac_status" >&5
15318   (exit $ac_status); } &&
15319          { ac_try='test -s conftest$ac_exeext'
15320   { (eval echo "$as_me:15320: \"$ac_try\"") >&5
15321   (eval $ac_try) 2>&5
15322   ac_status=$?
15323   echo "$as_me:15323: \$? = $ac_status" >&5
15324   (exit $ac_status); }; }; then
15325   eval "$as_ac_Lib=yes"
15326 else
15327   echo "$as_me: failed program was:" >&5
15328 cat conftest.$ac_ext >&5
15329 eval "$as_ac_Lib=no"
15330 fi
15331 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15332 LIBS=$ac_check_lib_save_LIBS
15333 fi
15334 echo "$as_me:15334: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15335 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15336 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15337   cf_cv_ncurses_pthreads=yes
15338 else
15339   cf_cv_ncurses_pthreads=no
15340 fi
15341
15342 if test "$cf_cv_ncurses_pthreads" = yes
15343 then
15344
15345 cf_add_libs="-lpthread"
15346 # Filter out duplicates - this happens with badly-designed ".pc" files...
15347 for cf_add_1lib in $LIBS
15348 do
15349         for cf_add_2lib in $cf_add_libs
15350         do
15351                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15352                 then
15353                         cf_add_1lib=
15354                         break
15355                 fi
15356         done
15357         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15358 done
15359 LIBS="$cf_add_libs"
15360
15361 fi
15362
15363 case $cf_cv_screen in
15364 (ncurses*)
15365         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15366         ;;
15367 esac
15368
15369 echo "$as_me:15369: checking for X11 rgb file" >&5
15370 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15371
15372 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15373 if test "${with_x11_rgb+set}" = set; then
15374   withval="$with_x11_rgb"
15375   RGB_PATH=$withval
15376 else
15377   RGB_PATH=auto
15378 fi;
15379
15380 if test "x$RGB_PATH" = xauto
15381 then
15382         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15383         for cf_path in \
15384                 /opt/local/share/X11/rgb.txt \
15385                 /opt/X11/share/X11/rgb.txt \
15386                 /usr/share/X11/rgb.txt \
15387                 /usr/X11/share/X11/rgb.txt \
15388                 /usr/X11/lib/X11/rgb.txt \
15389                 /usr/lib/X11/rgb.txt \
15390                 /etc/X11/rgb.txt \
15391                 /usr/pkg/lib/X11/rgb.txt \
15392                 /usr/X11R7/lib/X11/rgb.txt \
15393                 /usr/X11R6/lib/X11/rgb.txt \
15394                 /usr/X11R5/lib/X11/rgb.txt \
15395                 /usr/X11R4/lib/X11/rgb.txt \
15396                 /usr/local/lib/X11/rgb.txt \
15397                 /usr/local/share/X11/rgb.txt \
15398                 /usr/lib64/X11/rgb.txt
15399         do
15400                 if test -f "$cf_path" ; then
15401                         RGB_PATH="$cf_path"
15402                         break
15403                 fi
15404         done
15405 else
15406         cf_path=$RGB_PATH
15407
15408 if test "x$prefix" != xNONE; then
15409         cf_path_syntax="$prefix"
15410 else
15411         cf_path_syntax="$ac_default_prefix"
15412 fi
15413
15414 case ".$cf_path" in
15415 (.\$\(*\)*|.\'*\'*)
15416         ;;
15417 (..|./*|.\\*)
15418         ;;
15419 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15420         ;;
15421 (.\${*prefix}*|.\${*dir}*)
15422         eval cf_path="$cf_path"
15423         case ".$cf_path" in
15424         (.NONE/*)
15425                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15426                 ;;
15427         esac
15428         ;;
15429 (.no|.NONE/*)
15430         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15431         ;;
15432 (*)
15433         { { echo "$as_me:15433: error: expected a pathname, not \"$cf_path\"" >&5
15434 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15435    { (exit 1); exit 1; }; }
15436         ;;
15437 esac
15438
15439 fi
15440
15441 echo "$as_me:15441: result: $RGB_PATH" >&5
15442 echo "${ECHO_T}$RGB_PATH" >&6
15443
15444 cat >>confdefs.h <<EOF
15445 #define RGB_PATH "$cf_path"
15446 EOF
15447
15448 no_x11_rgb=
15449 if test "$RGB_PATH" = no
15450 then
15451         no_x11_rgb="#"
15452 fi
15453
15454 cf_curses_headers=
15455
15456 case $cf_cv_screen in
15457 (pdcurses)
15458         cf_default_panel=no
15459         cf_default_form=no
15460         cf_default_menu=no
15461         cf_default_tinfo=no
15462         ;;
15463 (xcurses|bsdcurses)
15464         cf_default_panel=no
15465         cf_default_form=no
15466         cf_default_menu=no
15467         cf_default_tinfo=yes
15468         ;;
15469 (*)
15470         cf_default_panel=yes
15471         cf_default_form=yes
15472         cf_default_menu=yes
15473         cf_default_tinfo=yes
15474         case $cf_cv_screen in
15475         (ncurses*)
15476                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
15477                 ;;
15478         esac
15479         ;;
15480 esac
15481
15482 echo "$as_me:15482: checking if you want to check for panel functions" >&5
15483 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
15484
15485 # Check whether --enable-panel or --disable-panel was given.
15486 if test "${enable_panel+set}" = set; then
15487   enableval="$enable_panel"
15488   test "$enableval" != no && enableval=yes
15489         if test "$enableval" != "yes" ; then
15490     cf_enable_panel=no
15491         else
15492                 cf_enable_panel=$cf_default_panel
15493         fi
15494 else
15495   enableval=yes
15496         cf_enable_panel=$cf_default_panel
15497
15498 fi;
15499 echo "$as_me:15499: result: $cf_enable_panel" >&5
15500 echo "${ECHO_T}$cf_enable_panel" >&6
15501 if test $cf_enable_panel = yes
15502 then
15503
15504 cf_have_curses_lib=no
15505
15506 : ${NCURSES_CONFIG_PKG:=none}
15507 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15508         :
15509 elif test "x${PKG_CONFIG:=none}" != xnone; then
15510         echo "$as_me:15510: checking pkg-config for panel$cf_cv_libtype" >&5
15511 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
15512         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
15513                 echo "$as_me:15513: result: yes" >&5
15514 echo "${ECHO_T}yes" >&6
15515
15516                 echo "$as_me:15516: checking if the panel$cf_cv_libtype package files work" >&5
15517 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
15518
15519                 cf_save_CPPFLAGS="$CPPFLAGS"
15520                 cf_save_LIBS="$LIBS"
15521
15522 cf_fix_cppflags=no
15523 cf_new_cflags=
15524 cf_new_cppflags=
15525 cf_new_extra_cppflags=
15526
15527 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
15528 do
15529 case $cf_fix_cppflags in
15530 (no)
15531         case $cf_add_cflags in
15532         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15533                 case $cf_add_cflags in
15534                 (-D*)
15535                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15536
15537                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15538                                 && test -z "${cf_tst_cflags}" \
15539                                 && cf_fix_cppflags=yes
15540
15541                         if test $cf_fix_cppflags = yes ; then
15542
15543         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15544         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15545
15546                                 continue
15547                         elif test "${cf_tst_cflags}" = "\"'" ; then
15548
15549         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15550         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15551
15552                                 continue
15553                         fi
15554                         ;;
15555                 esac
15556                 case "$CPPFLAGS" in
15557                 (*$cf_add_cflags)
15558                         ;;
15559                 (*)
15560                         case $cf_add_cflags in
15561                         (-D*)
15562                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15563
15564 CPPFLAGS=`echo "$CPPFLAGS" | \
15565         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15566                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15567
15568                                 ;;
15569                         esac
15570
15571         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15572         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15573
15574                         ;;
15575                 esac
15576                 ;;
15577         (*)
15578
15579         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15580         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15581
15582                 ;;
15583         esac
15584         ;;
15585 (yes)
15586
15587         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15588         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15589
15590         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15591
15592         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15593                 && test -z "${cf_tst_cflags}" \
15594                 && cf_fix_cppflags=no
15595         ;;
15596 esac
15597 done
15598
15599 if test -n "$cf_new_cflags" ; then
15600
15601         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15602         CFLAGS="${CFLAGS}$cf_new_cflags"
15603
15604 fi
15605
15606 if test -n "$cf_new_cppflags" ; then
15607
15608         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15609         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15610
15611 fi
15612
15613 if test -n "$cf_new_extra_cppflags" ; then
15614
15615         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15616         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15617
15618 fi
15619
15620 cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
15621 # Filter out duplicates - this happens with badly-designed ".pc" files...
15622 for cf_add_1lib in $LIBS
15623 do
15624         for cf_add_2lib in $cf_add_libs
15625         do
15626                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15627                 then
15628                         cf_add_1lib=
15629                         break
15630                 fi
15631         done
15632         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15633 done
15634 LIBS="$cf_add_libs"
15635
15636                 cat >conftest.$ac_ext <<_ACEOF
15637 #line 15637 "configure"
15638 #include "confdefs.h"
15639 #include <panel.h>
15640 int
15641 main (void)
15642 {
15643 (void) new_panel ( 0 );
15644   ;
15645   return 0;
15646 }
15647 _ACEOF
15648 rm -f conftest.$ac_objext conftest$ac_exeext
15649 if { (eval echo "$as_me:15649: \"$ac_link\"") >&5
15650   (eval $ac_link) 2>&5
15651   ac_status=$?
15652   echo "$as_me:15652: \$? = $ac_status" >&5
15653   (exit $ac_status); } &&
15654          { ac_try='test -s conftest$ac_exeext'
15655   { (eval echo "$as_me:15655: \"$ac_try\"") >&5
15656   (eval $ac_try) 2>&5
15657   ac_status=$?
15658   echo "$as_me:15658: \$? = $ac_status" >&5
15659   (exit $ac_status); }; }; then
15660   if test "$cross_compiling" = yes; then
15661   cf_have_curses_lib=maybe
15662 else
15663   cat >conftest.$ac_ext <<_ACEOF
15664 #line 15664 "configure"
15665 #include "confdefs.h"
15666 #include <panel.h>
15667                                 int main(void)
15668                                 { (void) new_panel ( 0 ); return 0; }
15669 _ACEOF
15670 rm -f conftest$ac_exeext
15671 if { (eval echo "$as_me:15671: \"$ac_link\"") >&5
15672   (eval $ac_link) 2>&5
15673   ac_status=$?
15674   echo "$as_me:15674: \$? = $ac_status" >&5
15675   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15676   { (eval echo "$as_me:15676: \"$ac_try\"") >&5
15677   (eval $ac_try) 2>&5
15678   ac_status=$?
15679   echo "$as_me:15679: \$? = $ac_status" >&5
15680   (exit $ac_status); }; }; then
15681   cf_have_curses_lib=yes
15682 else
15683   echo "$as_me: program exited with status $ac_status" >&5
15684 echo "$as_me: failed program was:" >&5
15685 cat conftest.$ac_ext >&5
15686 cf_have_curses_lib=no
15687 fi
15688 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15689 fi
15690 else
15691   echo "$as_me: failed program was:" >&5
15692 cat conftest.$ac_ext >&5
15693 cf_have_curses_lib=no
15694 fi
15695 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15696                 echo "$as_me:15696: result: $cf_have_curses_lib" >&5
15697 echo "${ECHO_T}$cf_have_curses_lib" >&6
15698                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15699                 if test "$cf_have_curses_lib" != "yes"
15700                 then
15701                         CPPFLAGS="$cf_save_CPPFLAGS"
15702                         LIBS="$cf_save_LIBS"
15703                 else
15704
15705 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15706
15707                         cat >>confdefs.h <<EOF
15708 #define $cf_upper 1
15709 EOF
15710
15711                 fi
15712         fi
15713 fi
15714 if test "$cf_have_curses_lib" = no; then
15715         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
15716 echo "$as_me:15716: checking for new_panel in -lpanel$cf_cv_libtype" >&5
15717 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
15718 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15719   echo $ECHO_N "(cached) $ECHO_C" >&6
15720 else
15721   ac_check_lib_save_LIBS=$LIBS
15722 LIBS="-lpanel$cf_cv_libtype  $LIBS"
15723 cat >conftest.$ac_ext <<_ACEOF
15724 #line 15724 "configure"
15725 #include "confdefs.h"
15726
15727 /* Override any gcc2 internal prototype to avoid an error.  */
15728 #ifdef __cplusplus
15729 extern "C"
15730 #endif
15731 /* We use char because int might match the return type of a gcc2
15732    builtin and then its argument prototype would still apply.  */
15733 char new_panel ();
15734 int
15735 main (void)
15736 {
15737 new_panel ();
15738   ;
15739   return 0;
15740 }
15741 _ACEOF
15742 rm -f conftest.$ac_objext conftest$ac_exeext
15743 if { (eval echo "$as_me:15743: \"$ac_link\"") >&5
15744   (eval $ac_link) 2>&5
15745   ac_status=$?
15746   echo "$as_me:15746: \$? = $ac_status" >&5
15747   (exit $ac_status); } &&
15748          { ac_try='test -s conftest$ac_exeext'
15749   { (eval echo "$as_me:15749: \"$ac_try\"") >&5
15750   (eval $ac_try) 2>&5
15751   ac_status=$?
15752   echo "$as_me:15752: \$? = $ac_status" >&5
15753   (exit $ac_status); }; }; then
15754   eval "$as_ac_Lib=yes"
15755 else
15756   echo "$as_me: failed program was:" >&5
15757 cat conftest.$ac_ext >&5
15758 eval "$as_ac_Lib=no"
15759 fi
15760 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15761 LIBS=$ac_check_lib_save_LIBS
15762 fi
15763 echo "$as_me:15763: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15764 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15765 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15766
15767 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15768
15769 cf_add_libs="-lpanel$cf_cv_libtype"
15770 # Filter out duplicates - this happens with badly-designed ".pc" files...
15771 for cf_add_1lib in $LIBS
15772 do
15773         for cf_add_2lib in $cf_add_libs
15774         do
15775                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15776                 then
15777                         cf_add_1lib=
15778                         break
15779                 fi
15780         done
15781         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15782 done
15783 LIBS="$cf_add_libs"
15784
15785                 cat >>confdefs.h <<EOF
15786 #define $cf_upper 1
15787 EOF
15788
15789 fi
15790
15791 fi
15792
15793         cf_curses_headers="$cf_curses_headers panel.h"
15794 fi
15795
15796 echo "$as_me:15796: checking if you want to check for menu functions" >&5
15797 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
15798
15799 # Check whether --enable-menu or --disable-menu was given.
15800 if test "${enable_menu+set}" = set; then
15801   enableval="$enable_menu"
15802   test "$enableval" != no && enableval=yes
15803         if test "$enableval" != "yes" ; then
15804     cf_enable_menu=no
15805         else
15806                 cf_enable_menu=$cf_default_menu
15807         fi
15808 else
15809   enableval=yes
15810         cf_enable_menu=$cf_default_menu
15811
15812 fi;
15813 echo "$as_me:15813: result: $cf_enable_menu" >&5
15814 echo "${ECHO_T}$cf_enable_menu" >&6
15815 if test $cf_enable_menu = yes
15816 then
15817         case $cf_cv_screen in
15818         (ncurses*)
15819                 ;;
15820         (curses*)
15821
15822 echo "$as_me:15822: checking for NetBSD menu.h" >&5
15823 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
15824 if test "${cf_cv_netbsd_menu_h+set}" = set; then
15825   echo $ECHO_N "(cached) $ECHO_C" >&6
15826 else
15827
15828 cat >conftest.$ac_ext <<_ACEOF
15829 #line 15829 "configure"
15830 #include "confdefs.h"
15831
15832 #include <${cf_cv_ncurses_header:-curses.h}>
15833 #include <menu.h>
15834
15835 int
15836 main (void)
15837 {
15838
15839         MENU *menu;
15840         int y = menu->max_item_width;
15841
15842   ;
15843   return 0;
15844 }
15845 _ACEOF
15846 rm -f conftest.$ac_objext
15847 if { (eval echo "$as_me:15847: \"$ac_compile\"") >&5
15848   (eval $ac_compile) 2>&5
15849   ac_status=$?
15850   echo "$as_me:15850: \$? = $ac_status" >&5
15851   (exit $ac_status); } &&
15852          { ac_try='test -s conftest.$ac_objext'
15853   { (eval echo "$as_me:15853: \"$ac_try\"") >&5
15854   (eval $ac_try) 2>&5
15855   ac_status=$?
15856   echo "$as_me:15856: \$? = $ac_status" >&5
15857   (exit $ac_status); }; }; then
15858   cf_cv_netbsd_menu_h=yes
15859
15860 else
15861   echo "$as_me: failed program was:" >&5
15862 cat conftest.$ac_ext >&5
15863 cf_cv_netbsd_menu_h=no
15864 fi
15865 rm -f conftest.$ac_objext conftest.$ac_ext
15866
15867 fi
15868 echo "$as_me:15868: result: $cf_cv_netbsd_menu_h" >&5
15869 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
15870
15871 test "$cf_cv_netbsd_menu_h" = yes &&
15872 cat >>confdefs.h <<\EOF
15873 #define HAVE_NETBSD_MENU_H 1
15874 EOF
15875
15876                 ;;
15877         esac
15878
15879 cf_have_curses_lib=no
15880
15881 : ${NCURSES_CONFIG_PKG:=none}
15882 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15883         :
15884 elif test "x${PKG_CONFIG:=none}" != xnone; then
15885         echo "$as_me:15885: checking pkg-config for menu$cf_cv_libtype" >&5
15886 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
15887         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
15888                 echo "$as_me:15888: result: yes" >&5
15889 echo "${ECHO_T}yes" >&6
15890
15891                 echo "$as_me:15891: checking if the menu$cf_cv_libtype package files work" >&5
15892 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
15893
15894                 cf_save_CPPFLAGS="$CPPFLAGS"
15895                 cf_save_LIBS="$LIBS"
15896
15897 cf_fix_cppflags=no
15898 cf_new_cflags=
15899 cf_new_cppflags=
15900 cf_new_extra_cppflags=
15901
15902 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
15903 do
15904 case $cf_fix_cppflags in
15905 (no)
15906         case $cf_add_cflags in
15907         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15908                 case $cf_add_cflags in
15909                 (-D*)
15910                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15911
15912                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15913                                 && test -z "${cf_tst_cflags}" \
15914                                 && cf_fix_cppflags=yes
15915
15916                         if test $cf_fix_cppflags = yes ; then
15917
15918         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15919         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15920
15921                                 continue
15922                         elif test "${cf_tst_cflags}" = "\"'" ; then
15923
15924         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15925         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15926
15927                                 continue
15928                         fi
15929                         ;;
15930                 esac
15931                 case "$CPPFLAGS" in
15932                 (*$cf_add_cflags)
15933                         ;;
15934                 (*)
15935                         case $cf_add_cflags in
15936                         (-D*)
15937                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15938
15939 CPPFLAGS=`echo "$CPPFLAGS" | \
15940         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15941                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15942
15943                                 ;;
15944                         esac
15945
15946         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15947         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15948
15949                         ;;
15950                 esac
15951                 ;;
15952         (*)
15953
15954         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15955         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15956
15957                 ;;
15958         esac
15959         ;;
15960 (yes)
15961
15962         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15963         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15964
15965         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15966
15967         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15968                 && test -z "${cf_tst_cflags}" \
15969                 && cf_fix_cppflags=no
15970         ;;
15971 esac
15972 done
15973
15974 if test -n "$cf_new_cflags" ; then
15975
15976         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15977         CFLAGS="${CFLAGS}$cf_new_cflags"
15978
15979 fi
15980
15981 if test -n "$cf_new_cppflags" ; then
15982
15983         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15984         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15985
15986 fi
15987
15988 if test -n "$cf_new_extra_cppflags" ; then
15989
15990         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15991         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15992
15993 fi
15994
15995 cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
15996 # Filter out duplicates - this happens with badly-designed ".pc" files...
15997 for cf_add_1lib in $LIBS
15998 do
15999         for cf_add_2lib in $cf_add_libs
16000         do
16001                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16002                 then
16003                         cf_add_1lib=
16004                         break
16005                 fi
16006         done
16007         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16008 done
16009 LIBS="$cf_add_libs"
16010
16011                 cat >conftest.$ac_ext <<_ACEOF
16012 #line 16012 "configure"
16013 #include "confdefs.h"
16014 #include <menu.h>
16015 int
16016 main (void)
16017 {
16018 (void) menu_driver ( 0,0 );
16019   ;
16020   return 0;
16021 }
16022 _ACEOF
16023 rm -f conftest.$ac_objext conftest$ac_exeext
16024 if { (eval echo "$as_me:16024: \"$ac_link\"") >&5
16025   (eval $ac_link) 2>&5
16026   ac_status=$?
16027   echo "$as_me:16027: \$? = $ac_status" >&5
16028   (exit $ac_status); } &&
16029          { ac_try='test -s conftest$ac_exeext'
16030   { (eval echo "$as_me:16030: \"$ac_try\"") >&5
16031   (eval $ac_try) 2>&5
16032   ac_status=$?
16033   echo "$as_me:16033: \$? = $ac_status" >&5
16034   (exit $ac_status); }; }; then
16035   if test "$cross_compiling" = yes; then
16036   cf_have_curses_lib=maybe
16037 else
16038   cat >conftest.$ac_ext <<_ACEOF
16039 #line 16039 "configure"
16040 #include "confdefs.h"
16041 #include <menu.h>
16042                                 int main(void)
16043                                 { (void) menu_driver ( 0,0 ); return 0; }
16044 _ACEOF
16045 rm -f conftest$ac_exeext
16046 if { (eval echo "$as_me:16046: \"$ac_link\"") >&5
16047   (eval $ac_link) 2>&5
16048   ac_status=$?
16049   echo "$as_me:16049: \$? = $ac_status" >&5
16050   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16051   { (eval echo "$as_me:16051: \"$ac_try\"") >&5
16052   (eval $ac_try) 2>&5
16053   ac_status=$?
16054   echo "$as_me:16054: \$? = $ac_status" >&5
16055   (exit $ac_status); }; }; then
16056   cf_have_curses_lib=yes
16057 else
16058   echo "$as_me: program exited with status $ac_status" >&5
16059 echo "$as_me: failed program was:" >&5
16060 cat conftest.$ac_ext >&5
16061 cf_have_curses_lib=no
16062 fi
16063 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16064 fi
16065 else
16066   echo "$as_me: failed program was:" >&5
16067 cat conftest.$ac_ext >&5
16068 cf_have_curses_lib=no
16069 fi
16070 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16071                 echo "$as_me:16071: result: $cf_have_curses_lib" >&5
16072 echo "${ECHO_T}$cf_have_curses_lib" >&6
16073                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16074                 if test "$cf_have_curses_lib" != "yes"
16075                 then
16076                         CPPFLAGS="$cf_save_CPPFLAGS"
16077                         LIBS="$cf_save_LIBS"
16078                 else
16079
16080 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16081
16082                         cat >>confdefs.h <<EOF
16083 #define $cf_upper 1
16084 EOF
16085
16086                 fi
16087         fi
16088 fi
16089 if test "$cf_have_curses_lib" = no; then
16090         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16091 echo "$as_me:16091: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
16092 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
16093 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16094   echo $ECHO_N "(cached) $ECHO_C" >&6
16095 else
16096   ac_check_lib_save_LIBS=$LIBS
16097 LIBS="-lmenu$cf_cv_libtype  $LIBS"
16098 cat >conftest.$ac_ext <<_ACEOF
16099 #line 16099 "configure"
16100 #include "confdefs.h"
16101
16102 /* Override any gcc2 internal prototype to avoid an error.  */
16103 #ifdef __cplusplus
16104 extern "C"
16105 #endif
16106 /* We use char because int might match the return type of a gcc2
16107    builtin and then its argument prototype would still apply.  */
16108 char menu_driver ();
16109 int
16110 main (void)
16111 {
16112 menu_driver ();
16113   ;
16114   return 0;
16115 }
16116 _ACEOF
16117 rm -f conftest.$ac_objext conftest$ac_exeext
16118 if { (eval echo "$as_me:16118: \"$ac_link\"") >&5
16119   (eval $ac_link) 2>&5
16120   ac_status=$?
16121   echo "$as_me:16121: \$? = $ac_status" >&5
16122   (exit $ac_status); } &&
16123          { ac_try='test -s conftest$ac_exeext'
16124   { (eval echo "$as_me:16124: \"$ac_try\"") >&5
16125   (eval $ac_try) 2>&5
16126   ac_status=$?
16127   echo "$as_me:16127: \$? = $ac_status" >&5
16128   (exit $ac_status); }; }; then
16129   eval "$as_ac_Lib=yes"
16130 else
16131   echo "$as_me: failed program was:" >&5
16132 cat conftest.$ac_ext >&5
16133 eval "$as_ac_Lib=no"
16134 fi
16135 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16136 LIBS=$ac_check_lib_save_LIBS
16137 fi
16138 echo "$as_me:16138: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16139 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16140 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16141
16142 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16143
16144 cf_add_libs="-lmenu$cf_cv_libtype"
16145 # Filter out duplicates - this happens with badly-designed ".pc" files...
16146 for cf_add_1lib in $LIBS
16147 do
16148         for cf_add_2lib in $cf_add_libs
16149         do
16150                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16151                 then
16152                         cf_add_1lib=
16153                         break
16154                 fi
16155         done
16156         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16157 done
16158 LIBS="$cf_add_libs"
16159
16160                 cat >>confdefs.h <<EOF
16161 #define $cf_upper 1
16162 EOF
16163
16164 fi
16165
16166 fi
16167
16168         cf_curses_headers="$cf_curses_headers menu.h"
16169 fi
16170
16171 echo "$as_me:16171: checking if you want to check for form functions" >&5
16172 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16173
16174 # Check whether --enable-form or --disable-form was given.
16175 if test "${enable_form+set}" = set; then
16176   enableval="$enable_form"
16177   test "$enableval" != no && enableval=yes
16178         if test "$enableval" != "yes" ; then
16179     cf_enable_form=no
16180         else
16181                 cf_enable_form=$cf_default_form
16182         fi
16183 else
16184   enableval=yes
16185         cf_enable_form=$cf_default_form
16186
16187 fi;
16188 echo "$as_me:16188: result: $cf_enable_form" >&5
16189 echo "${ECHO_T}$cf_enable_form" >&6
16190 if test $cf_enable_form = yes
16191 then
16192         case $cf_cv_screen in
16193         (ncurses*)
16194                 ;;
16195         (curses*)
16196
16197 echo "$as_me:16197: checking for NetBSD form.h" >&5
16198 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16199 if test "${cf_cv_netbsd_form_h+set}" = set; then
16200   echo $ECHO_N "(cached) $ECHO_C" >&6
16201 else
16202
16203 cat >conftest.$ac_ext <<_ACEOF
16204 #line 16204 "configure"
16205 #include "confdefs.h"
16206
16207 #include <${cf_cv_ncurses_header:-curses.h}>
16208 #include <form.h>
16209
16210 int
16211 main (void)
16212 {
16213
16214         FORM *form;
16215         int y = current_field(form)->cursor_ypos;
16216         int x = current_field(form)->cursor_xpos;
16217
16218   ;
16219   return 0;
16220 }
16221 _ACEOF
16222 rm -f conftest.$ac_objext
16223 if { (eval echo "$as_me:16223: \"$ac_compile\"") >&5
16224   (eval $ac_compile) 2>&5
16225   ac_status=$?
16226   echo "$as_me:16226: \$? = $ac_status" >&5
16227   (exit $ac_status); } &&
16228          { ac_try='test -s conftest.$ac_objext'
16229   { (eval echo "$as_me:16229: \"$ac_try\"") >&5
16230   (eval $ac_try) 2>&5
16231   ac_status=$?
16232   echo "$as_me:16232: \$? = $ac_status" >&5
16233   (exit $ac_status); }; }; then
16234   cf_cv_netbsd_form_h=yes
16235
16236 else
16237   echo "$as_me: failed program was:" >&5
16238 cat conftest.$ac_ext >&5
16239 cf_cv_netbsd_form_h=no
16240 fi
16241 rm -f conftest.$ac_objext conftest.$ac_ext
16242
16243 fi
16244 echo "$as_me:16244: result: $cf_cv_netbsd_form_h" >&5
16245 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16246
16247 test "$cf_cv_netbsd_form_h" = yes &&
16248 cat >>confdefs.h <<\EOF
16249 #define HAVE_NETBSD_FORM_H 1
16250 EOF
16251
16252                 ;;
16253         esac
16254
16255 cf_have_curses_lib=no
16256
16257 : ${NCURSES_CONFIG_PKG:=none}
16258 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16259         :
16260 elif test "x${PKG_CONFIG:=none}" != xnone; then
16261         echo "$as_me:16261: checking pkg-config for form$cf_cv_libtype" >&5
16262 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
16263         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
16264                 echo "$as_me:16264: result: yes" >&5
16265 echo "${ECHO_T}yes" >&6
16266
16267                 echo "$as_me:16267: checking if the form$cf_cv_libtype package files work" >&5
16268 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
16269
16270                 cf_save_CPPFLAGS="$CPPFLAGS"
16271                 cf_save_LIBS="$LIBS"
16272
16273 cf_fix_cppflags=no
16274 cf_new_cflags=
16275 cf_new_cppflags=
16276 cf_new_extra_cppflags=
16277
16278 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
16279 do
16280 case $cf_fix_cppflags in
16281 (no)
16282         case $cf_add_cflags in
16283         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16284                 case $cf_add_cflags in
16285                 (-D*)
16286                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16287
16288                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16289                                 && test -z "${cf_tst_cflags}" \
16290                                 && cf_fix_cppflags=yes
16291
16292                         if test $cf_fix_cppflags = yes ; then
16293
16294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16296
16297                                 continue
16298                         elif test "${cf_tst_cflags}" = "\"'" ; then
16299
16300         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16301         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16302
16303                                 continue
16304                         fi
16305                         ;;
16306                 esac
16307                 case "$CPPFLAGS" in
16308                 (*$cf_add_cflags)
16309                         ;;
16310                 (*)
16311                         case $cf_add_cflags in
16312                         (-D*)
16313                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16314
16315 CPPFLAGS=`echo "$CPPFLAGS" | \
16316         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16317                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16318
16319                                 ;;
16320                         esac
16321
16322         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16323         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16324
16325                         ;;
16326                 esac
16327                 ;;
16328         (*)
16329
16330         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16331         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16332
16333                 ;;
16334         esac
16335         ;;
16336 (yes)
16337
16338         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16339         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16340
16341         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16342
16343         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16344                 && test -z "${cf_tst_cflags}" \
16345                 && cf_fix_cppflags=no
16346         ;;
16347 esac
16348 done
16349
16350 if test -n "$cf_new_cflags" ; then
16351
16352         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16353         CFLAGS="${CFLAGS}$cf_new_cflags"
16354
16355 fi
16356
16357 if test -n "$cf_new_cppflags" ; then
16358
16359         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16360         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16361
16362 fi
16363
16364 if test -n "$cf_new_extra_cppflags" ; then
16365
16366         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16367         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16368
16369 fi
16370
16371 cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
16372 # Filter out duplicates - this happens with badly-designed ".pc" files...
16373 for cf_add_1lib in $LIBS
16374 do
16375         for cf_add_2lib in $cf_add_libs
16376         do
16377                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16378                 then
16379                         cf_add_1lib=
16380                         break
16381                 fi
16382         done
16383         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16384 done
16385 LIBS="$cf_add_libs"
16386
16387                 cat >conftest.$ac_ext <<_ACEOF
16388 #line 16388 "configure"
16389 #include "confdefs.h"
16390 #include <form.h>
16391 int
16392 main (void)
16393 {
16394 (void) form_driver ( 0,0 );
16395   ;
16396   return 0;
16397 }
16398 _ACEOF
16399 rm -f conftest.$ac_objext conftest$ac_exeext
16400 if { (eval echo "$as_me:16400: \"$ac_link\"") >&5
16401   (eval $ac_link) 2>&5
16402   ac_status=$?
16403   echo "$as_me:16403: \$? = $ac_status" >&5
16404   (exit $ac_status); } &&
16405          { ac_try='test -s conftest$ac_exeext'
16406   { (eval echo "$as_me:16406: \"$ac_try\"") >&5
16407   (eval $ac_try) 2>&5
16408   ac_status=$?
16409   echo "$as_me:16409: \$? = $ac_status" >&5
16410   (exit $ac_status); }; }; then
16411   if test "$cross_compiling" = yes; then
16412   cf_have_curses_lib=maybe
16413 else
16414   cat >conftest.$ac_ext <<_ACEOF
16415 #line 16415 "configure"
16416 #include "confdefs.h"
16417 #include <form.h>
16418                                 int main(void)
16419                                 { (void) form_driver ( 0,0 ); return 0; }
16420 _ACEOF
16421 rm -f conftest$ac_exeext
16422 if { (eval echo "$as_me:16422: \"$ac_link\"") >&5
16423   (eval $ac_link) 2>&5
16424   ac_status=$?
16425   echo "$as_me:16425: \$? = $ac_status" >&5
16426   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16427   { (eval echo "$as_me:16427: \"$ac_try\"") >&5
16428   (eval $ac_try) 2>&5
16429   ac_status=$?
16430   echo "$as_me:16430: \$? = $ac_status" >&5
16431   (exit $ac_status); }; }; then
16432   cf_have_curses_lib=yes
16433 else
16434   echo "$as_me: program exited with status $ac_status" >&5
16435 echo "$as_me: failed program was:" >&5
16436 cat conftest.$ac_ext >&5
16437 cf_have_curses_lib=no
16438 fi
16439 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16440 fi
16441 else
16442   echo "$as_me: failed program was:" >&5
16443 cat conftest.$ac_ext >&5
16444 cf_have_curses_lib=no
16445 fi
16446 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16447                 echo "$as_me:16447: result: $cf_have_curses_lib" >&5
16448 echo "${ECHO_T}$cf_have_curses_lib" >&6
16449                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16450                 if test "$cf_have_curses_lib" != "yes"
16451                 then
16452                         CPPFLAGS="$cf_save_CPPFLAGS"
16453                         LIBS="$cf_save_LIBS"
16454                 else
16455
16456 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16457
16458                         cat >>confdefs.h <<EOF
16459 #define $cf_upper 1
16460 EOF
16461
16462                 fi
16463         fi
16464 fi
16465 if test "$cf_have_curses_lib" = no; then
16466         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
16467 echo "$as_me:16467: checking for form_driver in -lform$cf_cv_libtype" >&5
16468 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
16469 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16470   echo $ECHO_N "(cached) $ECHO_C" >&6
16471 else
16472   ac_check_lib_save_LIBS=$LIBS
16473 LIBS="-lform$cf_cv_libtype  $LIBS"
16474 cat >conftest.$ac_ext <<_ACEOF
16475 #line 16475 "configure"
16476 #include "confdefs.h"
16477
16478 /* Override any gcc2 internal prototype to avoid an error.  */
16479 #ifdef __cplusplus
16480 extern "C"
16481 #endif
16482 /* We use char because int might match the return type of a gcc2
16483    builtin and then its argument prototype would still apply.  */
16484 char form_driver ();
16485 int
16486 main (void)
16487 {
16488 form_driver ();
16489   ;
16490   return 0;
16491 }
16492 _ACEOF
16493 rm -f conftest.$ac_objext conftest$ac_exeext
16494 if { (eval echo "$as_me:16494: \"$ac_link\"") >&5
16495   (eval $ac_link) 2>&5
16496   ac_status=$?
16497   echo "$as_me:16497: \$? = $ac_status" >&5
16498   (exit $ac_status); } &&
16499          { ac_try='test -s conftest$ac_exeext'
16500   { (eval echo "$as_me:16500: \"$ac_try\"") >&5
16501   (eval $ac_try) 2>&5
16502   ac_status=$?
16503   echo "$as_me:16503: \$? = $ac_status" >&5
16504   (exit $ac_status); }; }; then
16505   eval "$as_ac_Lib=yes"
16506 else
16507   echo "$as_me: failed program was:" >&5
16508 cat conftest.$ac_ext >&5
16509 eval "$as_ac_Lib=no"
16510 fi
16511 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16512 LIBS=$ac_check_lib_save_LIBS
16513 fi
16514 echo "$as_me:16514: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16515 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16516 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16517
16518 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16519
16520 cf_add_libs="-lform$cf_cv_libtype"
16521 # Filter out duplicates - this happens with badly-designed ".pc" files...
16522 for cf_add_1lib in $LIBS
16523 do
16524         for cf_add_2lib in $cf_add_libs
16525         do
16526                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16527                 then
16528                         cf_add_1lib=
16529                         break
16530                 fi
16531         done
16532         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16533 done
16534 LIBS="$cf_add_libs"
16535
16536                 cat >>confdefs.h <<EOF
16537 #define $cf_upper 1
16538 EOF
16539
16540 fi
16541
16542 fi
16543
16544         cf_curses_headers="$cf_curses_headers form.h"
16545 fi
16546
16547 # look for curses-related headers
16548
16549 for ac_header in $cf_curses_headers
16550 do
16551 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16552 echo "$as_me:16552: checking for $ac_header" >&5
16553 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16554 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16555   echo $ECHO_N "(cached) $ECHO_C" >&6
16556 else
16557   cat >conftest.$ac_ext <<_ACEOF
16558 #line 16558 "configure"
16559 #include "confdefs.h"
16560 #include <$ac_header>
16561 _ACEOF
16562 if { (eval echo "$as_me:16562: \"$ac_cpp conftest.$ac_ext\"") >&5
16563   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16564   ac_status=$?
16565   egrep -v '^ *\+' conftest.er1 >conftest.err
16566   rm -f conftest.er1
16567   cat conftest.err >&5
16568   echo "$as_me:16568: \$? = $ac_status" >&5
16569   (exit $ac_status); } >/dev/null; then
16570   if test -s conftest.err; then
16571     ac_cpp_err=$ac_c_preproc_warn_flag
16572   else
16573     ac_cpp_err=
16574   fi
16575 else
16576   ac_cpp_err=yes
16577 fi
16578 if test -z "$ac_cpp_err"; then
16579   eval "$as_ac_Header=yes"
16580 else
16581   echo "$as_me: failed program was:" >&5
16582   cat conftest.$ac_ext >&5
16583   eval "$as_ac_Header=no"
16584 fi
16585 rm -f conftest.err conftest.$ac_ext
16586 fi
16587 echo "$as_me:16587: result: `eval echo '${'$as_ac_Header'}'`" >&5
16588 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16589 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16590   cat >>confdefs.h <<EOF
16591 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16592 EOF
16593
16594 fi
16595 done
16596
16597 echo "$as_me:16597: checking for ANSI C header files" >&5
16598 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16599 if test "${ac_cv_header_stdc+set}" = set; then
16600   echo $ECHO_N "(cached) $ECHO_C" >&6
16601 else
16602   cat >conftest.$ac_ext <<_ACEOF
16603 #line 16603 "configure"
16604 #include "confdefs.h"
16605 #include <stdlib.h>
16606 #include <stdarg.h>
16607 #include <string.h>
16608 #include <float.h>
16609
16610 _ACEOF
16611 if { (eval echo "$as_me:16611: \"$ac_cpp conftest.$ac_ext\"") >&5
16612   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16613   ac_status=$?
16614   egrep -v '^ *\+' conftest.er1 >conftest.err
16615   rm -f conftest.er1
16616   cat conftest.err >&5
16617   echo "$as_me:16617: \$? = $ac_status" >&5
16618   (exit $ac_status); } >/dev/null; then
16619   if test -s conftest.err; then
16620     ac_cpp_err=$ac_c_preproc_warn_flag
16621   else
16622     ac_cpp_err=
16623   fi
16624 else
16625   ac_cpp_err=yes
16626 fi
16627 if test -z "$ac_cpp_err"; then
16628   ac_cv_header_stdc=yes
16629 else
16630   echo "$as_me: failed program was:" >&5
16631   cat conftest.$ac_ext >&5
16632   ac_cv_header_stdc=no
16633 fi
16634 rm -f conftest.err conftest.$ac_ext
16635
16636 if test $ac_cv_header_stdc = yes; then
16637   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16638   cat >conftest.$ac_ext <<_ACEOF
16639 #line 16639 "configure"
16640 #include "confdefs.h"
16641 #include <string.h>
16642
16643 _ACEOF
16644 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16645   egrep "memchr" >/dev/null 2>&1; then
16646   :
16647 else
16648   ac_cv_header_stdc=no
16649 fi
16650 rm -rf conftest*
16651
16652 fi
16653
16654 if test $ac_cv_header_stdc = yes; then
16655   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16656   cat >conftest.$ac_ext <<_ACEOF
16657 #line 16657 "configure"
16658 #include "confdefs.h"
16659 #include <stdlib.h>
16660
16661 _ACEOF
16662 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16663   egrep "free" >/dev/null 2>&1; then
16664   :
16665 else
16666   ac_cv_header_stdc=no
16667 fi
16668 rm -rf conftest*
16669
16670 fi
16671
16672 if test $ac_cv_header_stdc = yes; then
16673   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16674   if test "$cross_compiling" = yes; then
16675   :
16676 else
16677   cat >conftest.$ac_ext <<_ACEOF
16678 #line 16678 "configure"
16679 #include "confdefs.h"
16680 #include <ctype.h>
16681 #if ((' ' & 0x0FF) == 0x020)
16682 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16683 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16684 #else
16685 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16686                      || ('j' <= (c) && (c) <= 'r') \
16687                      || ('s' <= (c) && (c) <= 'z'))
16688 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16689 #endif
16690
16691 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16692 int
16693 main (void)
16694 {
16695   int i;
16696   for (i = 0; i < 256; i++)
16697     if (XOR (islower (i), ISLOWER (i))
16698         || toupper (i) != TOUPPER (i))
16699       $ac_main_return(2);
16700   $ac_main_return (0);
16701 }
16702 _ACEOF
16703 rm -f conftest$ac_exeext
16704 if { (eval echo "$as_me:16704: \"$ac_link\"") >&5
16705   (eval $ac_link) 2>&5
16706   ac_status=$?
16707   echo "$as_me:16707: \$? = $ac_status" >&5
16708   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16709   { (eval echo "$as_me:16709: \"$ac_try\"") >&5
16710   (eval $ac_try) 2>&5
16711   ac_status=$?
16712   echo "$as_me:16712: \$? = $ac_status" >&5
16713   (exit $ac_status); }; }; then
16714   :
16715 else
16716   echo "$as_me: program exited with status $ac_status" >&5
16717 echo "$as_me: failed program was:" >&5
16718 cat conftest.$ac_ext >&5
16719 ac_cv_header_stdc=no
16720 fi
16721 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16722 fi
16723 fi
16724 fi
16725 echo "$as_me:16725: result: $ac_cv_header_stdc" >&5
16726 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16727 if test $ac_cv_header_stdc = yes; then
16728
16729 cat >>confdefs.h <<\EOF
16730 #define STDC_HEADERS 1
16731 EOF
16732
16733 fi
16734
16735 echo "$as_me:16735: checking whether time.h and sys/time.h may both be included" >&5
16736 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16737 if test "${ac_cv_header_time+set}" = set; then
16738   echo $ECHO_N "(cached) $ECHO_C" >&6
16739 else
16740   cat >conftest.$ac_ext <<_ACEOF
16741 #line 16741 "configure"
16742 #include "confdefs.h"
16743 #include <sys/types.h>
16744 #include <sys/time.h>
16745 #include <time.h>
16746
16747 int
16748 main (void)
16749 {
16750 if ((struct tm *) 0)
16751 return 0;
16752   ;
16753   return 0;
16754 }
16755 _ACEOF
16756 rm -f conftest.$ac_objext
16757 if { (eval echo "$as_me:16757: \"$ac_compile\"") >&5
16758   (eval $ac_compile) 2>&5
16759   ac_status=$?
16760   echo "$as_me:16760: \$? = $ac_status" >&5
16761   (exit $ac_status); } &&
16762          { ac_try='test -s conftest.$ac_objext'
16763   { (eval echo "$as_me:16763: \"$ac_try\"") >&5
16764   (eval $ac_try) 2>&5
16765   ac_status=$?
16766   echo "$as_me:16766: \$? = $ac_status" >&5
16767   (exit $ac_status); }; }; then
16768   ac_cv_header_time=yes
16769 else
16770   echo "$as_me: failed program was:" >&5
16771 cat conftest.$ac_ext >&5
16772 ac_cv_header_time=no
16773 fi
16774 rm -f conftest.$ac_objext conftest.$ac_ext
16775 fi
16776 echo "$as_me:16776: result: $ac_cv_header_time" >&5
16777 echo "${ECHO_T}$ac_cv_header_time" >&6
16778 if test $ac_cv_header_time = yes; then
16779
16780 cat >>confdefs.h <<\EOF
16781 #define TIME_WITH_SYS_TIME 1
16782 EOF
16783
16784 fi
16785
16786 for ac_header in \
16787 getopt.h \
16788 locale.h \
16789 math.h \
16790 stdarg.h \
16791 stdint.h \
16792 sys/ioctl.h \
16793 sys/select.h \
16794 sys/time.h \
16795 termios.h \
16796 unistd.h \
16797
16798 do
16799 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16800 echo "$as_me:16800: checking for $ac_header" >&5
16801 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16802 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16803   echo $ECHO_N "(cached) $ECHO_C" >&6
16804 else
16805   cat >conftest.$ac_ext <<_ACEOF
16806 #line 16806 "configure"
16807 #include "confdefs.h"
16808 #include <$ac_header>
16809 _ACEOF
16810 if { (eval echo "$as_me:16810: \"$ac_cpp conftest.$ac_ext\"") >&5
16811   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16812   ac_status=$?
16813   egrep -v '^ *\+' conftest.er1 >conftest.err
16814   rm -f conftest.er1
16815   cat conftest.err >&5
16816   echo "$as_me:16816: \$? = $ac_status" >&5
16817   (exit $ac_status); } >/dev/null; then
16818   if test -s conftest.err; then
16819     ac_cpp_err=$ac_c_preproc_warn_flag
16820   else
16821     ac_cpp_err=
16822   fi
16823 else
16824   ac_cpp_err=yes
16825 fi
16826 if test -z "$ac_cpp_err"; then
16827   eval "$as_ac_Header=yes"
16828 else
16829   echo "$as_me: failed program was:" >&5
16830   cat conftest.$ac_ext >&5
16831   eval "$as_ac_Header=no"
16832 fi
16833 rm -f conftest.err conftest.$ac_ext
16834 fi
16835 echo "$as_me:16835: result: `eval echo '${'$as_ac_Header'}'`" >&5
16836 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16837 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16838   cat >>confdefs.h <<EOF
16839 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16840 EOF
16841
16842 fi
16843 done
16844
16845 for ac_header in unistd.h getopt.h
16846 do
16847 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16848 echo "$as_me:16848: checking for $ac_header" >&5
16849 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16850 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16851   echo $ECHO_N "(cached) $ECHO_C" >&6
16852 else
16853   cat >conftest.$ac_ext <<_ACEOF
16854 #line 16854 "configure"
16855 #include "confdefs.h"
16856 #include <$ac_header>
16857 _ACEOF
16858 if { (eval echo "$as_me:16858: \"$ac_cpp conftest.$ac_ext\"") >&5
16859   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16860   ac_status=$?
16861   egrep -v '^ *\+' conftest.er1 >conftest.err
16862   rm -f conftest.er1
16863   cat conftest.err >&5
16864   echo "$as_me:16864: \$? = $ac_status" >&5
16865   (exit $ac_status); } >/dev/null; then
16866   if test -s conftest.err; then
16867     ac_cpp_err=$ac_c_preproc_warn_flag
16868   else
16869     ac_cpp_err=
16870   fi
16871 else
16872   ac_cpp_err=yes
16873 fi
16874 if test -z "$ac_cpp_err"; then
16875   eval "$as_ac_Header=yes"
16876 else
16877   echo "$as_me: failed program was:" >&5
16878   cat conftest.$ac_ext >&5
16879   eval "$as_ac_Header=no"
16880 fi
16881 rm -f conftest.err conftest.$ac_ext
16882 fi
16883 echo "$as_me:16883: result: `eval echo '${'$as_ac_Header'}'`" >&5
16884 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16885 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16886   cat >>confdefs.h <<EOF
16887 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16888 EOF
16889
16890 fi
16891 done
16892
16893 echo "$as_me:16893: checking for header declaring getopt variables" >&5
16894 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
16895 if test "${cf_cv_getopt_header+set}" = set; then
16896   echo $ECHO_N "(cached) $ECHO_C" >&6
16897 else
16898
16899 cf_cv_getopt_header=none
16900 for cf_header in stdio.h stdlib.h unistd.h getopt.h
16901 do
16902 cat >conftest.$ac_ext <<_ACEOF
16903 #line 16903 "configure"
16904 #include "confdefs.h"
16905
16906 #include <$cf_header>
16907 int
16908 main (void)
16909 {
16910 int x = optind; char *y = optarg
16911   ;
16912   return 0;
16913 }
16914 _ACEOF
16915 rm -f conftest.$ac_objext
16916 if { (eval echo "$as_me:16916: \"$ac_compile\"") >&5
16917   (eval $ac_compile) 2>&5
16918   ac_status=$?
16919   echo "$as_me:16919: \$? = $ac_status" >&5
16920   (exit $ac_status); } &&
16921          { ac_try='test -s conftest.$ac_objext'
16922   { (eval echo "$as_me:16922: \"$ac_try\"") >&5
16923   (eval $ac_try) 2>&5
16924   ac_status=$?
16925   echo "$as_me:16925: \$? = $ac_status" >&5
16926   (exit $ac_status); }; }; then
16927   cf_cv_getopt_header=$cf_header
16928  break
16929 else
16930   echo "$as_me: failed program was:" >&5
16931 cat conftest.$ac_ext >&5
16932 fi
16933 rm -f conftest.$ac_objext conftest.$ac_ext
16934 done
16935
16936 fi
16937 echo "$as_me:16937: result: $cf_cv_getopt_header" >&5
16938 echo "${ECHO_T}$cf_cv_getopt_header" >&6
16939 if test $cf_cv_getopt_header != none ; then
16940
16941 cat >>confdefs.h <<\EOF
16942 #define HAVE_GETOPT_HEADER 1
16943 EOF
16944
16945 fi
16946 if test $cf_cv_getopt_header = getopt.h ; then
16947
16948 cat >>confdefs.h <<\EOF
16949 #define NEED_GETOPT_H 1
16950 EOF
16951
16952 fi
16953
16954 for ac_func in \
16955 getopt \
16956 gettimeofday \
16957 strstr \
16958 tsearch \
16959
16960 do
16961 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16962 echo "$as_me:16962: checking for $ac_func" >&5
16963 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
16964 if eval "test \"\${$as_ac_var+set}\" = set"; then
16965   echo $ECHO_N "(cached) $ECHO_C" >&6
16966 else
16967   cat >conftest.$ac_ext <<_ACEOF
16968 #line 16968 "configure"
16969 #include "confdefs.h"
16970 #define $ac_func autoconf_temporary
16971 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16972 #undef $ac_func
16973
16974 #ifdef __cplusplus
16975 extern "C"
16976 #endif
16977
16978 /* We use char because int might match the return type of a gcc2
16979    builtin and then its argument prototype would still apply.  */
16980 char $ac_func (void);
16981
16982 int
16983 main (void)
16984 {
16985
16986 /* The GNU C library defines stubs for functions which it implements
16987     to always fail with ENOSYS.  Some functions are actually named
16988     something starting with __ and the normal name is an alias.  */
16989 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16990 #error found stub for $ac_func
16991 #endif
16992
16993         return $ac_func ();
16994   ;
16995   return 0;
16996 }
16997 _ACEOF
16998 rm -f conftest.$ac_objext conftest$ac_exeext
16999 if { (eval echo "$as_me:16999: \"$ac_link\"") >&5
17000   (eval $ac_link) 2>&5
17001   ac_status=$?
17002   echo "$as_me:17002: \$? = $ac_status" >&5
17003   (exit $ac_status); } &&
17004          { ac_try='test -s conftest$ac_exeext'
17005   { (eval echo "$as_me:17005: \"$ac_try\"") >&5
17006   (eval $ac_try) 2>&5
17007   ac_status=$?
17008   echo "$as_me:17008: \$? = $ac_status" >&5
17009   (exit $ac_status); }; }; then
17010   eval "$as_ac_var=yes"
17011 else
17012   echo "$as_me: failed program was:" >&5
17013 cat conftest.$ac_ext >&5
17014 eval "$as_ac_var=no"
17015 fi
17016 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17017 fi
17018 echo "$as_me:17018: result: `eval echo '${'$as_ac_var'}'`" >&5
17019 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17020 if test `eval echo '${'$as_ac_var'}'` = yes; then
17021   cat >>confdefs.h <<EOF
17022 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17023 EOF
17024
17025 fi
17026 done
17027
17028 # use a compile-check to work with ncurses*-config and subdirectory includes
17029 echo "$as_me:17029: checking if we can use termcap.h" >&5
17030 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17031 if test "${cf_cv_have_termcap_h+set}" = set; then
17032   echo $ECHO_N "(cached) $ECHO_C" >&6
17033 else
17034
17035         cat >conftest.$ac_ext <<_ACEOF
17036 #line 17036 "configure"
17037 #include "confdefs.h"
17038
17039 #include <curses.h>
17040 #ifdef NCURSES_VERSION
17041 #undef NCURSES_VERSION
17042 #endif
17043 #include <termcap.h>
17044 #ifndef NCURSES_VERSION
17045 #error wrong header
17046 #endif
17047
17048 int
17049 main (void)
17050 {
17051 return 0;
17052   ;
17053   return 0;
17054 }
17055 _ACEOF
17056 rm -f conftest.$ac_objext
17057 if { (eval echo "$as_me:17057: \"$ac_compile\"") >&5
17058   (eval $ac_compile) 2>&5
17059   ac_status=$?
17060   echo "$as_me:17060: \$? = $ac_status" >&5
17061   (exit $ac_status); } &&
17062          { ac_try='test -s conftest.$ac_objext'
17063   { (eval echo "$as_me:17063: \"$ac_try\"") >&5
17064   (eval $ac_try) 2>&5
17065   ac_status=$?
17066   echo "$as_me:17066: \$? = $ac_status" >&5
17067   (exit $ac_status); }; }; then
17068   cf_cv_have_termcap_h=yes
17069 else
17070   echo "$as_me: failed program was:" >&5
17071 cat conftest.$ac_ext >&5
17072 cf_cv_have_termcap_h=no
17073 fi
17074 rm -f conftest.$ac_objext conftest.$ac_ext
17075 fi
17076 echo "$as_me:17076: result: $cf_cv_have_termcap_h" >&5
17077 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17078 if test "x$cf_cv_have_termcap_h" = xyes
17079 then
17080         cat >>confdefs.h <<\EOF
17081 #define HAVE_TERMCAP_H 1
17082 EOF
17083
17084 else
17085 echo "$as_me:17085: checking if we can use ncurses/termcap.h" >&5
17086 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17087 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17088   echo $ECHO_N "(cached) $ECHO_C" >&6
17089 else
17090
17091         cat >conftest.$ac_ext <<_ACEOF
17092 #line 17092 "configure"
17093 #include "confdefs.h"
17094
17095 #include <ncurses/curses.h>
17096 #ifdef NCURSES_VERSION
17097 #undef NCURSES_VERSION
17098 #endif
17099 #include <ncurses/termcap.h>
17100 #ifndef NCURSES_VERSION
17101 #error wrong header
17102 #endif
17103
17104 int
17105 main (void)
17106 {
17107 return 0;
17108   ;
17109   return 0;
17110 }
17111 _ACEOF
17112 rm -f conftest.$ac_objext
17113 if { (eval echo "$as_me:17113: \"$ac_compile\"") >&5
17114   (eval $ac_compile) 2>&5
17115   ac_status=$?
17116   echo "$as_me:17116: \$? = $ac_status" >&5
17117   (exit $ac_status); } &&
17118          { ac_try='test -s conftest.$ac_objext'
17119   { (eval echo "$as_me:17119: \"$ac_try\"") >&5
17120   (eval $ac_try) 2>&5
17121   ac_status=$?
17122   echo "$as_me:17122: \$? = $ac_status" >&5
17123   (exit $ac_status); }; }; then
17124   cf_cv_have_ncurses_termcap_h=yes
17125 else
17126   echo "$as_me: failed program was:" >&5
17127 cat conftest.$ac_ext >&5
17128 cf_cv_have_ncurses_termcap_h=no
17129 fi
17130 rm -f conftest.$ac_objext conftest.$ac_ext
17131 fi
17132 echo "$as_me:17132: result: $cf_cv_have_ncurses_termcap_h" >&5
17133 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17134 test "x$cf_cv_have_ncurses_termcap_h" = xyes && cat >>confdefs.h <<\EOF
17135 #define HAVE_NCURSES_TERMCAP_H 1
17136 EOF
17137
17138 fi
17139
17140 if test "x$ac_cv_func_getopt" = xno; then
17141         { { echo "$as_me:17141: error: getopt is required for building programs" >&5
17142 echo "$as_me: error: getopt is required for building programs" >&2;}
17143    { (exit 1); exit 1; }; }
17144 fi
17145
17146 if test "$cf_enable_widec" = yes; then
17147
17148 for ac_func in \
17149 mblen \
17150 mbrlen \
17151 mbrtowc \
17152 mbsrtowcs \
17153 mbstowcs \
17154 mbtowc \
17155 wcsrtombs \
17156 wcstombs \
17157
17158 do
17159 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17160 echo "$as_me:17160: checking for $ac_func" >&5
17161 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17162 if eval "test \"\${$as_ac_var+set}\" = set"; then
17163   echo $ECHO_N "(cached) $ECHO_C" >&6
17164 else
17165   cat >conftest.$ac_ext <<_ACEOF
17166 #line 17166 "configure"
17167 #include "confdefs.h"
17168 #define $ac_func autoconf_temporary
17169 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17170 #undef $ac_func
17171
17172 #ifdef __cplusplus
17173 extern "C"
17174 #endif
17175
17176 /* We use char because int might match the return type of a gcc2
17177    builtin and then its argument prototype would still apply.  */
17178 char $ac_func (void);
17179
17180 int
17181 main (void)
17182 {
17183
17184 /* The GNU C library defines stubs for functions which it implements
17185     to always fail with ENOSYS.  Some functions are actually named
17186     something starting with __ and the normal name is an alias.  */
17187 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17188 #error found stub for $ac_func
17189 #endif
17190
17191         return $ac_func ();
17192   ;
17193   return 0;
17194 }
17195 _ACEOF
17196 rm -f conftest.$ac_objext conftest$ac_exeext
17197 if { (eval echo "$as_me:17197: \"$ac_link\"") >&5
17198   (eval $ac_link) 2>&5
17199   ac_status=$?
17200   echo "$as_me:17200: \$? = $ac_status" >&5
17201   (exit $ac_status); } &&
17202          { ac_try='test -s conftest$ac_exeext'
17203   { (eval echo "$as_me:17203: \"$ac_try\"") >&5
17204   (eval $ac_try) 2>&5
17205   ac_status=$?
17206   echo "$as_me:17206: \$? = $ac_status" >&5
17207   (exit $ac_status); }; }; then
17208   eval "$as_ac_var=yes"
17209 else
17210   echo "$as_me: failed program was:" >&5
17211 cat conftest.$ac_ext >&5
17212 eval "$as_ac_var=no"
17213 fi
17214 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17215 fi
17216 echo "$as_me:17216: result: `eval echo '${'$as_ac_var'}'`" >&5
17217 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17218 if test `eval echo '${'$as_ac_var'}'` = yes; then
17219   cat >>confdefs.h <<EOF
17220 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17221 EOF
17222
17223 fi
17224 done
17225
17226 fi
17227
17228 echo "$as_me:17228: checking definition to turn on extended curses functions" >&5
17229 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17230 if test "${cf_cv_need_xopen_extension+set}" = set; then
17231   echo $ECHO_N "(cached) $ECHO_C" >&6
17232 else
17233
17234 cf_cv_need_xopen_extension=unknown
17235 cat >conftest.$ac_ext <<_ACEOF
17236 #line 17236 "configure"
17237 #include "confdefs.h"
17238
17239 #include <stdlib.h>
17240 #include <${cf_cv_ncurses_header:-curses.h}>
17241 int
17242 main (void)
17243 {
17244
17245 #if defined(NCURSES_VERSION_PATCH)
17246 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17247         make an error
17248 #endif
17249 #endif
17250 #ifdef NCURSES_VERSION
17251         cchar_t check;
17252         int check2 = curs_set((int)sizeof(check));
17253 #endif
17254         long x = winnstr(stdscr, "", 0);
17255         int x1, y1;
17256         getbegyx(stdscr, y1, x1)
17257   ;
17258   return 0;
17259 }
17260 _ACEOF
17261 rm -f conftest.$ac_objext conftest$ac_exeext
17262 if { (eval echo "$as_me:17262: \"$ac_link\"") >&5
17263   (eval $ac_link) 2>&5
17264   ac_status=$?
17265   echo "$as_me:17265: \$? = $ac_status" >&5
17266   (exit $ac_status); } &&
17267          { ac_try='test -s conftest$ac_exeext'
17268   { (eval echo "$as_me:17268: \"$ac_try\"") >&5
17269   (eval $ac_try) 2>&5
17270   ac_status=$?
17271   echo "$as_me:17271: \$? = $ac_status" >&5
17272   (exit $ac_status); }; }; then
17273   cf_cv_need_xopen_extension=none
17274 else
17275   echo "$as_me: failed program was:" >&5
17276 cat conftest.$ac_ext >&5
17277
17278         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17279         do
17280                 cat >conftest.$ac_ext <<_ACEOF
17281 #line 17281 "configure"
17282 #include "confdefs.h"
17283
17284 #define $cf_try_xopen_extension 1
17285 #include <stdlib.h>
17286 #include <${cf_cv_ncurses_header:-curses.h}>
17287 int
17288 main (void)
17289 {
17290
17291 #ifdef NCURSES_VERSION
17292                 cchar_t check;
17293                 int check2 = curs_set((int)sizeof(check));
17294 #endif
17295                 long x = winnstr(stdscr, "", 0);
17296                 int x1, y1;
17297                 getbegyx(stdscr, y1, x1)
17298   ;
17299   return 0;
17300 }
17301 _ACEOF
17302 rm -f conftest.$ac_objext conftest$ac_exeext
17303 if { (eval echo "$as_me:17303: \"$ac_link\"") >&5
17304   (eval $ac_link) 2>&5
17305   ac_status=$?
17306   echo "$as_me:17306: \$? = $ac_status" >&5
17307   (exit $ac_status); } &&
17308          { ac_try='test -s conftest$ac_exeext'
17309   { (eval echo "$as_me:17309: \"$ac_try\"") >&5
17310   (eval $ac_try) 2>&5
17311   ac_status=$?
17312   echo "$as_me:17312: \$? = $ac_status" >&5
17313   (exit $ac_status); }; }; then
17314   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17315 else
17316   echo "$as_me: failed program was:" >&5
17317 cat conftest.$ac_ext >&5
17318 fi
17319 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17320         done
17321
17322 fi
17323 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17324
17325 fi
17326 echo "$as_me:17326: result: $cf_cv_need_xopen_extension" >&5
17327 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17328
17329 case $cf_cv_need_xopen_extension in
17330 (*_*)
17331
17332         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17333         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17334
17335         ;;
17336 esac
17337
17338 echo "$as_me:17338: checking for term.h" >&5
17339 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17340 if test "${cf_cv_term_header+set}" = set; then
17341   echo $ECHO_N "(cached) $ECHO_C" >&6
17342 else
17343
17344 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17345 # for <term.h> if we do not find the variant.
17346
17347 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17348
17349 case ${cf_cv_ncurses_header:-curses.h} in
17350 (*/*)
17351         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17352         cf_header_list="$cf_header_item $cf_header_list"
17353         ;;
17354 esac
17355
17356 for cf_header in $cf_header_list
17357 do
17358         cat >conftest.$ac_ext <<_ACEOF
17359 #line 17359 "configure"
17360 #include "confdefs.h"
17361
17362 #include <${cf_cv_ncurses_header:-curses.h}>
17363 #include <${cf_header}>
17364 int
17365 main (void)
17366 {
17367 WINDOW *x
17368   ;
17369   return 0;
17370 }
17371 _ACEOF
17372 rm -f conftest.$ac_objext
17373 if { (eval echo "$as_me:17373: \"$ac_compile\"") >&5
17374   (eval $ac_compile) 2>&5
17375   ac_status=$?
17376   echo "$as_me:17376: \$? = $ac_status" >&5
17377   (exit $ac_status); } &&
17378          { ac_try='test -s conftest.$ac_objext'
17379   { (eval echo "$as_me:17379: \"$ac_try\"") >&5
17380   (eval $ac_try) 2>&5
17381   ac_status=$?
17382   echo "$as_me:17382: \$? = $ac_status" >&5
17383   (exit $ac_status); }; }; then
17384   cf_cv_term_header=$cf_header
17385          break
17386 else
17387   echo "$as_me: failed program was:" >&5
17388 cat conftest.$ac_ext >&5
17389 cf_cv_term_header=no
17390 fi
17391 rm -f conftest.$ac_objext conftest.$ac_ext
17392 done
17393
17394 case $cf_cv_term_header in
17395 (no)
17396         # If curses is ncurses, some packagers still mess it up by trying to make
17397         # us use GNU termcap.  This handles the most common case.
17398         for cf_header in ncurses/term.h ncursesw/term.h
17399         do
17400                 cat >conftest.$ac_ext <<_ACEOF
17401 #line 17401 "configure"
17402 #include "confdefs.h"
17403
17404 #include <${cf_cv_ncurses_header:-curses.h}>
17405 #ifdef NCURSES_VERSION
17406 #include <${cf_header}>
17407 #else
17408 make an error
17409 #endif
17410 int
17411 main (void)
17412 {
17413 WINDOW *x
17414   ;
17415   return 0;
17416 }
17417 _ACEOF
17418 rm -f conftest.$ac_objext
17419 if { (eval echo "$as_me:17419: \"$ac_compile\"") >&5
17420   (eval $ac_compile) 2>&5
17421   ac_status=$?
17422   echo "$as_me:17422: \$? = $ac_status" >&5
17423   (exit $ac_status); } &&
17424          { ac_try='test -s conftest.$ac_objext'
17425   { (eval echo "$as_me:17425: \"$ac_try\"") >&5
17426   (eval $ac_try) 2>&5
17427   ac_status=$?
17428   echo "$as_me:17428: \$? = $ac_status" >&5
17429   (exit $ac_status); }; }; then
17430   cf_cv_term_header=$cf_header
17431                          break
17432 else
17433   echo "$as_me: failed program was:" >&5
17434 cat conftest.$ac_ext >&5
17435 cf_cv_term_header=no
17436 fi
17437 rm -f conftest.$ac_objext conftest.$ac_ext
17438         done
17439         ;;
17440 esac
17441
17442 fi
17443 echo "$as_me:17443: result: $cf_cv_term_header" >&5
17444 echo "${ECHO_T}$cf_cv_term_header" >&6
17445
17446 case $cf_cv_term_header in
17447 (term.h)
17448
17449 cat >>confdefs.h <<\EOF
17450 #define HAVE_TERM_H 1
17451 EOF
17452
17453         ;;
17454 (ncurses/term.h)
17455
17456 cat >>confdefs.h <<\EOF
17457 #define HAVE_NCURSES_TERM_H 1
17458 EOF
17459
17460         ;;
17461 (ncursesw/term.h)
17462
17463 cat >>confdefs.h <<\EOF
17464 #define HAVE_NCURSESW_TERM_H 1
17465 EOF
17466
17467         ;;
17468 esac
17469
17470 echo "$as_me:17470: checking for unctrl.h" >&5
17471 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
17472 if test "${cf_cv_unctrl_header+set}" = set; then
17473   echo $ECHO_N "(cached) $ECHO_C" >&6
17474 else
17475
17476 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
17477 # for <unctrl.h> if we do not find the variant.
17478
17479 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
17480
17481 case ${cf_cv_ncurses_header:-curses.h} in
17482 (*/*)
17483         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
17484         cf_header_list="$cf_header_item $cf_header_list"
17485         ;;
17486 esac
17487
17488 for cf_header in $cf_header_list
17489 do
17490         cat >conftest.$ac_ext <<_ACEOF
17491 #line 17491 "configure"
17492 #include "confdefs.h"
17493
17494 #include <${cf_cv_ncurses_header:-curses.h}>
17495 #include <${cf_header}>
17496 int
17497 main (void)
17498 {
17499 WINDOW *x
17500   ;
17501   return 0;
17502 }
17503 _ACEOF
17504 rm -f conftest.$ac_objext
17505 if { (eval echo "$as_me:17505: \"$ac_compile\"") >&5
17506   (eval $ac_compile) 2>&5
17507   ac_status=$?
17508   echo "$as_me:17508: \$? = $ac_status" >&5
17509   (exit $ac_status); } &&
17510          { ac_try='test -s conftest.$ac_objext'
17511   { (eval echo "$as_me:17511: \"$ac_try\"") >&5
17512   (eval $ac_try) 2>&5
17513   ac_status=$?
17514   echo "$as_me:17514: \$? = $ac_status" >&5
17515   (exit $ac_status); }; }; then
17516   cf_cv_unctrl_header=$cf_header
17517          break
17518 else
17519   echo "$as_me: failed program was:" >&5
17520 cat conftest.$ac_ext >&5
17521 cf_cv_unctrl_header=no
17522 fi
17523 rm -f conftest.$ac_objext conftest.$ac_ext
17524 done
17525
17526 fi
17527 echo "$as_me:17527: result: $cf_cv_unctrl_header" >&5
17528 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
17529
17530 case $cf_cv_unctrl_header in
17531 (no)
17532         { echo "$as_me:17532: WARNING: unctrl.h header not found" >&5
17533 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
17534         ;;
17535 esac
17536
17537 case $cf_cv_unctrl_header in
17538 (unctrl.h)
17539
17540 cat >>confdefs.h <<\EOF
17541 #define HAVE_UNCTRL_H 1
17542 EOF
17543
17544         ;;
17545 (ncurses/unctrl.h)
17546
17547 cat >>confdefs.h <<\EOF
17548 #define HAVE_NCURSES_UNCTRL_H 1
17549 EOF
17550
17551         ;;
17552 (ncursesw/unctrl.h)
17553
17554 cat >>confdefs.h <<\EOF
17555 #define HAVE_NCURSESW_UNCTRL_H 1
17556 EOF
17557
17558         ;;
17559 esac
17560
17561 for cf_func in \
17562 alloc_pair \
17563 assume_default_colors \
17564 chgat \
17565 color_content \
17566 color_set \
17567 copywin \
17568 delscreen \
17569 dupwin \
17570 filter \
17571 getbegx \
17572 getcurx \
17573 getmaxx \
17574 getnstr \
17575 getparx \
17576 getwin \
17577 halfdelay \
17578 init_extended_color \
17579 mvderwin \
17580 mvvline \
17581 mvwin \
17582 mvwvline \
17583 napms \
17584 newpad \
17585 putwin \
17586 reset_color_pairs \
17587 resize_term \
17588 resizeterm \
17589 restartterm \
17590 ripoffline \
17591 scr_dump \
17592 setupterm \
17593 slk_color \
17594 slk_init \
17595 termattrs \
17596 tgetent \
17597 tigetnum \
17598 tigetstr \
17599 tputs_sp \
17600 typeahead \
17601 use_default_colors \
17602 use_env \
17603 use_extended_names \
17604 use_screen \
17605 use_window \
17606 vid_puts \
17607 vidputs \
17608 vsscanf \
17609 vw_printw \
17610 wchgat \
17611 winsdelln \
17612 winsstr \
17613 wresize \
17614 wsyncdown \
17615 _tracef \
17616
17617 do
17618
17619 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17620
17621         echo "$as_me:17621: checking for ${cf_func}" >&5
17622 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17623
17624 echo "${as_me:-configure}:17624: testing ${cf_func} ..." 1>&5
17625
17626         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17627   echo $ECHO_N "(cached) $ECHO_C" >&6
17628 else
17629
17630                 eval cf_result='$ac_cv_func_'$cf_func
17631                 if test ".$cf_result" != ".no"; then
17632                         cat >conftest.$ac_ext <<_ACEOF
17633 #line 17633 "configure"
17634 #include "confdefs.h"
17635
17636 #ifdef HAVE_XCURSES
17637 #include <xcurses.h>
17638 char * XCursesProgramName = "test";
17639 #else
17640 #include <${cf_cv_ncurses_header:-curses.h}>
17641 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17642 #include <ncursesw/term.h>
17643 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17644 #include <ncurses/term.h>
17645 #elif defined(HAVE_TERM_H)
17646 #include <term.h>
17647 #endif
17648 #endif
17649
17650 int
17651 main (void)
17652 {
17653
17654 #ifndef ${cf_func}
17655 long foo = (long)(&${cf_func});
17656 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17657 if (foo + 1234L > 5678L)
17658         ${cf_cv_main_return:-return}(foo != 0);
17659 #endif
17660
17661   ;
17662   return 0;
17663 }
17664 _ACEOF
17665 rm -f conftest.$ac_objext conftest$ac_exeext
17666 if { (eval echo "$as_me:17666: \"$ac_link\"") >&5
17667   (eval $ac_link) 2>&5
17668   ac_status=$?
17669   echo "$as_me:17669: \$? = $ac_status" >&5
17670   (exit $ac_status); } &&
17671          { ac_try='test -s conftest$ac_exeext'
17672   { (eval echo "$as_me:17672: \"$ac_try\"") >&5
17673   (eval $ac_try) 2>&5
17674   ac_status=$?
17675   echo "$as_me:17675: \$? = $ac_status" >&5
17676   (exit $ac_status); }; }; then
17677   cf_result=yes
17678 else
17679   echo "$as_me: failed program was:" >&5
17680 cat conftest.$ac_ext >&5
17681 cf_result=no
17682 fi
17683 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17684                 fi
17685                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17686
17687 fi
17688
17689         # use the computed/retrieved cache-value:
17690         eval 'cf_result=$cf_cv_func_'$cf_func
17691         echo "$as_me:17691: result: $cf_result" >&5
17692 echo "${ECHO_T}$cf_result" >&6
17693         if test $cf_result != no; then
17694                 cat >>confdefs.h <<EOF
17695 #define HAVE_${cf_tr_func} 1
17696 EOF
17697
17698         fi
17699 done
17700
17701 for cf_func in tputs
17702 do
17703
17704 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17705
17706         echo "$as_me:17706: checking for ${cf_func}" >&5
17707 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17708
17709 echo "${as_me:-configure}:17709: testing ${cf_func} ..." 1>&5
17710
17711         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17712   echo $ECHO_N "(cached) $ECHO_C" >&6
17713 else
17714
17715                 eval cf_result='$ac_cv_func_'$cf_func
17716                 if test ".$cf_result" != ".no"; then
17717                         cat >conftest.$ac_ext <<_ACEOF
17718 #line 17718 "configure"
17719 #include "confdefs.h"
17720
17721 #ifdef HAVE_XCURSES
17722 #include <xcurses.h>
17723 char * XCursesProgramName = "test";
17724 #else
17725 #include <${cf_cv_ncurses_header:-curses.h}>
17726 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17727 #include <ncursesw/term.h>
17728 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17729 #include <ncurses/term.h>
17730 #elif defined(HAVE_TERM_H)
17731 #include <term.h>
17732 #endif
17733 #endif
17734
17735 int
17736 main (void)
17737 {
17738
17739 #ifndef ${cf_func}
17740 long foo = (long)(&${cf_func});
17741 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17742 if (foo + 1234L > 5678L)
17743         ${cf_cv_main_return:-return}(foo != 0);
17744 #endif
17745
17746   ;
17747   return 0;
17748 }
17749 _ACEOF
17750 rm -f conftest.$ac_objext conftest$ac_exeext
17751 if { (eval echo "$as_me:17751: \"$ac_link\"") >&5
17752   (eval $ac_link) 2>&5
17753   ac_status=$?
17754   echo "$as_me:17754: \$? = $ac_status" >&5
17755   (exit $ac_status); } &&
17756          { ac_try='test -s conftest$ac_exeext'
17757   { (eval echo "$as_me:17757: \"$ac_try\"") >&5
17758   (eval $ac_try) 2>&5
17759   ac_status=$?
17760   echo "$as_me:17760: \$? = $ac_status" >&5
17761   (exit $ac_status); }; }; then
17762   cf_result=yes
17763 else
17764   echo "$as_me: failed program was:" >&5
17765 cat conftest.$ac_ext >&5
17766 cf_result=no
17767 fi
17768 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17769                 fi
17770                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17771
17772 fi
17773
17774         # use the computed/retrieved cache-value:
17775         eval 'cf_result=$cf_cv_func_'$cf_func
17776         echo "$as_me:17776: result: $cf_result" >&5
17777 echo "${ECHO_T}$cf_result" >&6
17778         if test $cf_result != no; then
17779                 cat >>confdefs.h <<EOF
17780 #define HAVE_${cf_tr_func} 1
17781 EOF
17782
17783         fi
17784 done
17785
17786 if test x$cf_cv_func_tputs = xyes
17787 then
17788         cf_done=no
17789         for cf_arg in int char
17790         do
17791                 for cf_ret in int void
17792                 do
17793                         if test $cf_ret = void
17794                         then
17795                                 cf_return="/* nothing */"
17796                         else
17797                                 cf_return="return value"
17798                         fi
17799                         cat >conftest.$ac_ext <<_ACEOF
17800 #line 17800 "configure"
17801 #include "confdefs.h"
17802
17803 #include <${cf_cv_ncurses_header:-curses.h}>
17804 #include <$cf_cv_term_header>
17805
17806 static $cf_ret outc($cf_arg value) { $cf_return; }
17807
17808 int
17809 main (void)
17810 {
17811
17812         tputs("hello", 0, outc);
17813         ${cf_cv_main_return:-return}(0);
17814
17815   ;
17816   return 0;
17817 }
17818 _ACEOF
17819 rm -f conftest.$ac_objext
17820 if { (eval echo "$as_me:17820: \"$ac_compile\"") >&5
17821   (eval $ac_compile) 2>&5
17822   ac_status=$?
17823   echo "$as_me:17823: \$? = $ac_status" >&5
17824   (exit $ac_status); } &&
17825          { ac_try='test -s conftest.$ac_objext'
17826   { (eval echo "$as_me:17826: \"$ac_try\"") >&5
17827   (eval $ac_try) 2>&5
17828   ac_status=$?
17829   echo "$as_me:17829: \$? = $ac_status" >&5
17830   (exit $ac_status); }; }; then
17831
17832                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
17833
17834 echo "${as_me:-configure}:17834: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
17835
17836                 cat >>confdefs.h <<EOF
17837 #define TPUTS_ARG               $cf_arg
17838 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
17839 #define TPUTS_RETURN(value)     $cf_return
17840 EOF
17841                 cf_done=yes
17842                 break
17843
17844 else
17845   echo "$as_me: failed program was:" >&5
17846 cat conftest.$ac_ext >&5
17847 fi
17848 rm -f conftest.$ac_objext conftest.$ac_ext
17849                 done
17850                 test $cf_done = yes && break
17851         done
17852 fi
17853
17854 echo "$as_me:17854: checking for ncurses extended functions" >&5
17855 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
17856 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
17857   echo $ECHO_N "(cached) $ECHO_C" >&6
17858 else
17859
17860 cat >conftest.$ac_ext <<_ACEOF
17861 #line 17861 "configure"
17862 #include "confdefs.h"
17863
17864 #include <${cf_cv_ncurses_header:-curses.h}>
17865 int
17866 main (void)
17867 {
17868
17869 int x = NCURSES_EXT_FUNCS
17870
17871   ;
17872   return 0;
17873 }
17874 _ACEOF
17875 rm -f conftest.$ac_objext
17876 if { (eval echo "$as_me:17876: \"$ac_compile\"") >&5
17877   (eval $ac_compile) 2>&5
17878   ac_status=$?
17879   echo "$as_me:17879: \$? = $ac_status" >&5
17880   (exit $ac_status); } &&
17881          { ac_try='test -s conftest.$ac_objext'
17882   { (eval echo "$as_me:17882: \"$ac_try\"") >&5
17883   (eval $ac_try) 2>&5
17884   ac_status=$?
17885   echo "$as_me:17885: \$? = $ac_status" >&5
17886   (exit $ac_status); }; }; then
17887   cf_cv_ncurses_ext_funcs=defined
17888 else
17889   echo "$as_me: failed program was:" >&5
17890 cat conftest.$ac_ext >&5
17891
17892 cat >conftest.$ac_ext <<_ACEOF
17893 #line 17893 "configure"
17894 #include "confdefs.h"
17895
17896 #include <${cf_cv_ncurses_header:-curses.h}>
17897 int
17898 main (void)
17899 {
17900
17901         (void) assume_default_colors (0, 0);
17902         (void) curses_version ();
17903         (void) define_key (0, 0);
17904         (void) is_term_resized (0, 0);
17905         (void) key_defined (0);
17906         (void) keybound (0, 0);
17907         (void) keyok (0, 0);
17908         (void) resize_term (0, 0);
17909         (void) resizeterm (0, 0);
17910         (void) use_default_colors ();
17911         (void) use_extended_names (0);
17912         (void) wresize (0, 0, 0);
17913   ;
17914   return 0;
17915 }
17916 _ACEOF
17917 rm -f conftest.$ac_objext conftest$ac_exeext
17918 if { (eval echo "$as_me:17918: \"$ac_link\"") >&5
17919   (eval $ac_link) 2>&5
17920   ac_status=$?
17921   echo "$as_me:17921: \$? = $ac_status" >&5
17922   (exit $ac_status); } &&
17923          { ac_try='test -s conftest$ac_exeext'
17924   { (eval echo "$as_me:17924: \"$ac_try\"") >&5
17925   (eval $ac_try) 2>&5
17926   ac_status=$?
17927   echo "$as_me:17927: \$? = $ac_status" >&5
17928   (exit $ac_status); }; }; then
17929   cf_cv_ncurses_ext_funcs=yes
17930 else
17931   echo "$as_me: failed program was:" >&5
17932 cat conftest.$ac_ext >&5
17933 cf_cv_ncurses_ext_funcs=no
17934 fi
17935 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17936
17937 fi
17938 rm -f conftest.$ac_objext conftest.$ac_ext
17939
17940 fi
17941 echo "$as_me:17941: result: $cf_cv_ncurses_ext_funcs" >&5
17942 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
17943 test "$cf_cv_ncurses_ext_funcs" = yes &&
17944 cat >>confdefs.h <<\EOF
17945 #define NCURSES_EXT_FUNCS 1
17946 EOF
17947
17948 if test "$cf_enable_widec" = yes
17949 then
17950         # workaround for systems with ncurses before 20111029, due to change of
17951         # feature test macro from _XPG5 to _XOPEN_SOURCE
17952         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
17953         then
17954                 cf_define_xpg5=no
17955                 echo "$as_me:17955: checking if _XPG5 should be defined to enable wide-characters" >&5
17956 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
17957
17958                 cat >conftest.$ac_ext <<_ACEOF
17959 #line 17959 "configure"
17960 #include "confdefs.h"
17961
17962 #include <${cf_cv_ncurses_header:-curses.h}>
17963 int
17964 main (void)
17965 {
17966 int x = _XPG5
17967   ;
17968   return 0;
17969 }
17970 _ACEOF
17971 rm -f conftest.$ac_objext
17972 if { (eval echo "$as_me:17972: \"$ac_compile\"") >&5
17973   (eval $ac_compile) 2>&5
17974   ac_status=$?
17975   echo "$as_me:17975: \$? = $ac_status" >&5
17976   (exit $ac_status); } &&
17977          { ac_try='test -s conftest.$ac_objext'
17978   { (eval echo "$as_me:17978: \"$ac_try\"") >&5
17979   (eval $ac_try) 2>&5
17980   ac_status=$?
17981   echo "$as_me:17981: \$? = $ac_status" >&5
17982   (exit $ac_status); }; }; then
17983   :
17984 else
17985   echo "$as_me: failed program was:" >&5
17986 cat conftest.$ac_ext >&5
17987 cf_save_cppflags="$CPPFLAGS"
17988                          CPPFLAGS="$CPPFLAGS -D_XPG5"
17989                          cat >conftest.$ac_ext <<_ACEOF
17990 #line 17990 "configure"
17991 #include "confdefs.h"
17992
17993 #include <${cf_cv_ncurses_header:-curses.h}>
17994 int
17995 main (void)
17996 {
17997 int x = _XPG5
17998   ;
17999   return 0;
18000 }
18001 _ACEOF
18002 rm -f conftest.$ac_objext
18003 if { (eval echo "$as_me:18003: \"$ac_compile\"") >&5
18004   (eval $ac_compile) 2>&5
18005   ac_status=$?
18006   echo "$as_me:18006: \$? = $ac_status" >&5
18007   (exit $ac_status); } &&
18008          { ac_try='test -s conftest.$ac_objext'
18009   { (eval echo "$as_me:18009: \"$ac_try\"") >&5
18010   (eval $ac_try) 2>&5
18011   ac_status=$?
18012   echo "$as_me:18012: \$? = $ac_status" >&5
18013   (exit $ac_status); }; }; then
18014   cf_define_xpg5=yes
18015 else
18016   echo "$as_me: failed program was:" >&5
18017 cat conftest.$ac_ext >&5
18018 fi
18019 rm -f conftest.$ac_objext conftest.$ac_ext
18020                          CPPFLAGS="$cf_save_cppflags"
18021 fi
18022 rm -f conftest.$ac_objext conftest.$ac_ext
18023                 echo "$as_me:18023: result: $cf_define_xpg5" >&5
18024 echo "${ECHO_T}$cf_define_xpg5" >&6
18025
18026                 if test "$cf_define_xpg5" = yes
18027                 then
18028                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18029                 fi
18030         fi
18031
18032         echo "$as_me:18032: checking for wide-character functions" >&5
18033 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18034 if test "${cf_cv_widechar_funcs+set}" = set; then
18035   echo $ECHO_N "(cached) $ECHO_C" >&6
18036 else
18037
18038         cat >conftest.$ac_ext <<_ACEOF
18039 #line 18039 "configure"
18040 #include "confdefs.h"
18041
18042 #include <${cf_cv_ncurses_header:-curses.h}>
18043 int
18044 main (void)
18045 {
18046
18047                 static wchar_t src_wchar[2];
18048                 static cchar_t dst_cchar;
18049                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18050
18051   ;
18052   return 0;
18053 }
18054 _ACEOF
18055 rm -f conftest.$ac_objext conftest$ac_exeext
18056 if { (eval echo "$as_me:18056: \"$ac_link\"") >&5
18057   (eval $ac_link) 2>&5
18058   ac_status=$?
18059   echo "$as_me:18059: \$? = $ac_status" >&5
18060   (exit $ac_status); } &&
18061          { ac_try='test -s conftest$ac_exeext'
18062   { (eval echo "$as_me:18062: \"$ac_try\"") >&5
18063   (eval $ac_try) 2>&5
18064   ac_status=$?
18065   echo "$as_me:18065: \$? = $ac_status" >&5
18066   (exit $ac_status); }; }; then
18067   cf_cv_widechar_funcs=yes
18068 else
18069   echo "$as_me: failed program was:" >&5
18070 cat conftest.$ac_ext >&5
18071 cf_cv_widechar_funcs=no
18072 fi
18073 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18074
18075 fi
18076 echo "$as_me:18076: result: $cf_cv_widechar_funcs" >&5
18077 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18078         if test "$cf_cv_widechar_funcs" != no ; then
18079
18080 cat >>confdefs.h <<\EOF
18081 #define USE_WIDEC_SUPPORT 1
18082 EOF
18083
18084         else
18085                 cat >>confdefs.h <<\EOF
18086 #define USE_WIDEC_SUPPORT 0
18087 EOF
18088
18089         fi
18090 else
18091         cat >>confdefs.h <<\EOF
18092 #define USE_WIDEC_SUPPORT 0
18093 EOF
18094
18095 fi
18096
18097 echo "$as_me:18097: checking if $cf_cv_screen library uses pthreads" >&5
18098 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18099 if test "${cf_cv_use_pthreads+set}" = set; then
18100   echo $ECHO_N "(cached) $ECHO_C" >&6
18101 else
18102
18103 cat >conftest.$ac_ext <<_ACEOF
18104 #line 18104 "configure"
18105 #include "confdefs.h"
18106
18107 #include <${cf_cv_ncurses_header:-curses.h}>
18108 extern void _nc_init_pthreads(void);
18109
18110 int
18111 main (void)
18112 {
18113
18114         initscr();
18115         _nc_init_pthreads();
18116
18117   ;
18118   return 0;
18119 }
18120 _ACEOF
18121 rm -f conftest.$ac_objext conftest$ac_exeext
18122 if { (eval echo "$as_me:18122: \"$ac_link\"") >&5
18123   (eval $ac_link) 2>&5
18124   ac_status=$?
18125   echo "$as_me:18125: \$? = $ac_status" >&5
18126   (exit $ac_status); } &&
18127          { ac_try='test -s conftest$ac_exeext'
18128   { (eval echo "$as_me:18128: \"$ac_try\"") >&5
18129   (eval $ac_try) 2>&5
18130   ac_status=$?
18131   echo "$as_me:18131: \$? = $ac_status" >&5
18132   (exit $ac_status); }; }; then
18133   cf_cv_use_pthreads=yes
18134 else
18135   echo "$as_me: failed program was:" >&5
18136 cat conftest.$ac_ext >&5
18137 cf_cv_use_pthreads=no
18138 fi
18139 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18140
18141 fi
18142 echo "$as_me:18142: result: $cf_cv_use_pthreads" >&5
18143 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18144 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
18145 #define USE_PTHREADS 1
18146 EOF
18147
18148 echo "$as_me:18148: checking if sys/time.h works with sys/select.h" >&5
18149 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18150 if test "${cf_cv_sys_time_select+set}" = set; then
18151   echo $ECHO_N "(cached) $ECHO_C" >&6
18152 else
18153
18154 cat >conftest.$ac_ext <<_ACEOF
18155 #line 18155 "configure"
18156 #include "confdefs.h"
18157
18158 #include <sys/types.h>
18159 #ifdef HAVE_SYS_TIME_H
18160 #include <sys/time.h>
18161 #endif
18162 #ifdef HAVE_SYS_SELECT_H
18163 #include <sys/select.h>
18164 #endif
18165
18166 int
18167 main (void)
18168 {
18169
18170   ;
18171   return 0;
18172 }
18173 _ACEOF
18174 rm -f conftest.$ac_objext
18175 if { (eval echo "$as_me:18175: \"$ac_compile\"") >&5
18176   (eval $ac_compile) 2>&5
18177   ac_status=$?
18178   echo "$as_me:18178: \$? = $ac_status" >&5
18179   (exit $ac_status); } &&
18180          { ac_try='test -s conftest.$ac_objext'
18181   { (eval echo "$as_me:18181: \"$ac_try\"") >&5
18182   (eval $ac_try) 2>&5
18183   ac_status=$?
18184   echo "$as_me:18184: \$? = $ac_status" >&5
18185   (exit $ac_status); }; }; then
18186   cf_cv_sys_time_select=yes
18187 else
18188   echo "$as_me: failed program was:" >&5
18189 cat conftest.$ac_ext >&5
18190 cf_cv_sys_time_select=no
18191 fi
18192 rm -f conftest.$ac_objext conftest.$ac_ext
18193
18194 fi
18195
18196 echo "$as_me:18196: result: $cf_cv_sys_time_select" >&5
18197 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18198 test "$cf_cv_sys_time_select" = yes &&
18199 cat >>confdefs.h <<\EOF
18200 #define HAVE_SYS_TIME_SELECT 1
18201 EOF
18202
18203 # special check for test/ditto.c
18204
18205 echo "$as_me:18205: checking for openpty in -lutil" >&5
18206 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18207 if test "${ac_cv_lib_util_openpty+set}" = set; then
18208   echo $ECHO_N "(cached) $ECHO_C" >&6
18209 else
18210   ac_check_lib_save_LIBS=$LIBS
18211 LIBS="-lutil  $LIBS"
18212 cat >conftest.$ac_ext <<_ACEOF
18213 #line 18213 "configure"
18214 #include "confdefs.h"
18215
18216 /* Override any gcc2 internal prototype to avoid an error.  */
18217 #ifdef __cplusplus
18218 extern "C"
18219 #endif
18220 /* We use char because int might match the return type of a gcc2
18221    builtin and then its argument prototype would still apply.  */
18222 char openpty ();
18223 int
18224 main (void)
18225 {
18226 openpty ();
18227   ;
18228   return 0;
18229 }
18230 _ACEOF
18231 rm -f conftest.$ac_objext conftest$ac_exeext
18232 if { (eval echo "$as_me:18232: \"$ac_link\"") >&5
18233   (eval $ac_link) 2>&5
18234   ac_status=$?
18235   echo "$as_me:18235: \$? = $ac_status" >&5
18236   (exit $ac_status); } &&
18237          { ac_try='test -s conftest$ac_exeext'
18238   { (eval echo "$as_me:18238: \"$ac_try\"") >&5
18239   (eval $ac_try) 2>&5
18240   ac_status=$?
18241   echo "$as_me:18241: \$? = $ac_status" >&5
18242   (exit $ac_status); }; }; then
18243   ac_cv_lib_util_openpty=yes
18244 else
18245   echo "$as_me: failed program was:" >&5
18246 cat conftest.$ac_ext >&5
18247 ac_cv_lib_util_openpty=no
18248 fi
18249 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18250 LIBS=$ac_check_lib_save_LIBS
18251 fi
18252 echo "$as_me:18252: result: $ac_cv_lib_util_openpty" >&5
18253 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18254 if test $ac_cv_lib_util_openpty = yes; then
18255   cf_cv_lib_util=yes
18256 else
18257   cf_cv_lib_util=no
18258 fi
18259
18260 echo "$as_me:18260: checking for openpty header" >&5
18261 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18262 if test "${cf_cv_func_openpty+set}" = set; then
18263   echo $ECHO_N "(cached) $ECHO_C" >&6
18264 else
18265
18266         cf_save_LIBS="$LIBS"
18267         test $cf_cv_lib_util = yes && {
18268 cf_add_libs="-lutil"
18269 # Filter out duplicates - this happens with badly-designed ".pc" files...
18270 for cf_add_1lib in $LIBS
18271 do
18272         for cf_add_2lib in $cf_add_libs
18273         do
18274                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18275                 then
18276                         cf_add_1lib=
18277                         break
18278                 fi
18279         done
18280         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18281 done
18282 LIBS="$cf_add_libs"
18283  }
18284         for cf_header in pty.h libutil.h util.h
18285         do
18286         cat >conftest.$ac_ext <<_ACEOF
18287 #line 18287 "configure"
18288 #include "confdefs.h"
18289
18290 #include <$cf_header>
18291
18292 int
18293 main (void)
18294 {
18295
18296         int x = openpty((int *)0, (int *)0, (char *)0,
18297                                    (struct termios *)0, (struct winsize *)0);
18298
18299   ;
18300   return 0;
18301 }
18302 _ACEOF
18303 rm -f conftest.$ac_objext conftest$ac_exeext
18304 if { (eval echo "$as_me:18304: \"$ac_link\"") >&5
18305   (eval $ac_link) 2>&5
18306   ac_status=$?
18307   echo "$as_me:18307: \$? = $ac_status" >&5
18308   (exit $ac_status); } &&
18309          { ac_try='test -s conftest$ac_exeext'
18310   { (eval echo "$as_me:18310: \"$ac_try\"") >&5
18311   (eval $ac_try) 2>&5
18312   ac_status=$?
18313   echo "$as_me:18313: \$? = $ac_status" >&5
18314   (exit $ac_status); }; }; then
18315
18316                 cf_cv_func_openpty=$cf_header
18317                 break
18318
18319 else
18320   echo "$as_me: failed program was:" >&5
18321 cat conftest.$ac_ext >&5
18322
18323                 cf_cv_func_openpty=no
18324
18325 fi
18326 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18327         done
18328         LIBS="$cf_save_LIBS"
18329
18330 fi
18331 echo "$as_me:18331: result: $cf_cv_func_openpty" >&5
18332 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18333
18334 if test "$cf_cv_func_openpty" != no ; then
18335
18336 cat >>confdefs.h <<EOF
18337 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18338 EOF
18339
18340 cat >>confdefs.h <<\EOF
18341 #define USE_XTERM_PTY 1
18342 EOF
18343
18344         if test "x$cf_cv_lib_util" = xyes ; then
18345
18346 cf_add_libs="-lutil"
18347 # Filter out duplicates - this happens with badly-designed ".pc" files...
18348 for cf_add_1lib in $TEST_LIBS
18349 do
18350         for cf_add_2lib in $cf_add_libs
18351         do
18352                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18353                 then
18354                         cf_add_1lib=
18355                         break
18356                 fi
18357         done
18358         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18359 done
18360 TEST_LIBS="$cf_add_libs"
18361
18362         fi
18363 fi
18364
18365 echo "$as_me:18365: checking for function curses_version" >&5
18366 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
18367 if test "${cf_cv_func_curses_version+set}" = set; then
18368   echo $ECHO_N "(cached) $ECHO_C" >&6
18369 else
18370
18371 if test "$cross_compiling" = yes; then
18372   cf_cv_func_curses_version=unknown
18373 else
18374   cat >conftest.$ac_ext <<_ACEOF
18375 #line 18375 "configure"
18376 #include "confdefs.h"
18377
18378 #include <${cf_cv_ncurses_header:-curses.h}>
18379 int main(void)
18380 {
18381         char temp[1024];
18382         sprintf(temp, "%s\n", curses_version());
18383         ${cf_cv_main_return:-return}(0);
18384 }
18385
18386 _ACEOF
18387 rm -f conftest$ac_exeext
18388 if { (eval echo "$as_me:18388: \"$ac_link\"") >&5
18389   (eval $ac_link) 2>&5
18390   ac_status=$?
18391   echo "$as_me:18391: \$? = $ac_status" >&5
18392   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18393   { (eval echo "$as_me:18393: \"$ac_try\"") >&5
18394   (eval $ac_try) 2>&5
18395   ac_status=$?
18396   echo "$as_me:18396: \$? = $ac_status" >&5
18397   (exit $ac_status); }; }; then
18398   cf_cv_func_curses_version=yes
18399
18400 else
18401   echo "$as_me: program exited with status $ac_status" >&5
18402 echo "$as_me: failed program was:" >&5
18403 cat conftest.$ac_ext >&5
18404 cf_cv_func_curses_version=no
18405
18406 fi
18407 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18408 fi
18409 rm -f core
18410 fi
18411 echo "$as_me:18411: result: $cf_cv_func_curses_version" >&5
18412 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
18413 test "$cf_cv_func_curses_version" = yes &&
18414 cat >>confdefs.h <<\EOF
18415 #define HAVE_CURSES_VERSION 1
18416 EOF
18417
18418 echo "$as_me:18418: checking for alternate character set array" >&5
18419 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
18420 if test "${cf_cv_curses_acs_map+set}" = set; then
18421   echo $ECHO_N "(cached) $ECHO_C" >&6
18422 else
18423
18424 cf_cv_curses_acs_map=unknown
18425 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
18426 do
18427 cat >conftest.$ac_ext <<_ACEOF
18428 #line 18428 "configure"
18429 #include "confdefs.h"
18430
18431 #include <${cf_cv_ncurses_header:-curses.h}>
18432
18433 int
18434 main (void)
18435 {
18436
18437 $name['k'] = ACS_PLUS
18438
18439   ;
18440   return 0;
18441 }
18442 _ACEOF
18443 rm -f conftest.$ac_objext conftest$ac_exeext
18444 if { (eval echo "$as_me:18444: \"$ac_link\"") >&5
18445   (eval $ac_link) 2>&5
18446   ac_status=$?
18447   echo "$as_me:18447: \$? = $ac_status" >&5
18448   (exit $ac_status); } &&
18449          { ac_try='test -s conftest$ac_exeext'
18450   { (eval echo "$as_me:18450: \"$ac_try\"") >&5
18451   (eval $ac_try) 2>&5
18452   ac_status=$?
18453   echo "$as_me:18453: \$? = $ac_status" >&5
18454   (exit $ac_status); }; }; then
18455   cf_cv_curses_acs_map=$name; break
18456 else
18457   echo "$as_me: failed program was:" >&5
18458 cat conftest.$ac_ext >&5
18459 fi
18460 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18461 done
18462
18463 fi
18464 echo "$as_me:18464: result: $cf_cv_curses_acs_map" >&5
18465 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
18466
18467 test "$cf_cv_curses_acs_map" != unknown &&
18468 cat >>confdefs.h <<EOF
18469 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
18470 EOF
18471
18472 if test "$cf_enable_widec" = yes; then
18473
18474 echo "$as_me:18474: checking for wide alternate character set array" >&5
18475 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
18476 if test "${cf_cv_curses_wacs_map+set}" = set; then
18477   echo $ECHO_N "(cached) $ECHO_C" >&6
18478 else
18479
18480         cf_cv_curses_wacs_map=unknown
18481         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
18482         do
18483         cat >conftest.$ac_ext <<_ACEOF
18484 #line 18484 "configure"
18485 #include "confdefs.h"
18486
18487 #ifndef _XOPEN_SOURCE_EXTENDED
18488 #define _XOPEN_SOURCE_EXTENDED
18489 #endif
18490 #include <${cf_cv_ncurses_header:-curses.h}>
18491 int
18492 main (void)
18493 {
18494 void *foo = &($name['k'])
18495   ;
18496   return 0;
18497 }
18498 _ACEOF
18499 rm -f conftest.$ac_objext conftest$ac_exeext
18500 if { (eval echo "$as_me:18500: \"$ac_link\"") >&5
18501   (eval $ac_link) 2>&5
18502   ac_status=$?
18503   echo "$as_me:18503: \$? = $ac_status" >&5
18504   (exit $ac_status); } &&
18505          { ac_try='test -s conftest$ac_exeext'
18506   { (eval echo "$as_me:18506: \"$ac_try\"") >&5
18507   (eval $ac_try) 2>&5
18508   ac_status=$?
18509   echo "$as_me:18509: \$? = $ac_status" >&5
18510   (exit $ac_status); }; }; then
18511   cf_cv_curses_wacs_map=$name
18512          break
18513 else
18514   echo "$as_me: failed program was:" >&5
18515 cat conftest.$ac_ext >&5
18516 fi
18517 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18518         done
18519 fi
18520 echo "$as_me:18520: result: $cf_cv_curses_wacs_map" >&5
18521 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
18522
18523 test "$cf_cv_curses_wacs_map" != unknown &&
18524 cat >>confdefs.h <<EOF
18525 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
18526 EOF
18527
18528 echo "$as_me:18528: checking for wide alternate character constants" >&5
18529 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
18530 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
18531   echo $ECHO_N "(cached) $ECHO_C" >&6
18532 else
18533
18534 cf_cv_curses_wacs_symbols=no
18535 if test "$cf_cv_curses_wacs_map" != unknown
18536 then
18537         cat >conftest.$ac_ext <<_ACEOF
18538 #line 18538 "configure"
18539 #include "confdefs.h"
18540
18541 #ifndef _XOPEN_SOURCE_EXTENDED
18542 #define _XOPEN_SOURCE_EXTENDED
18543 #endif
18544 #include <${cf_cv_ncurses_header:-curses.h}>
18545 int
18546 main (void)
18547 {
18548 cchar_t *foo = WACS_PLUS;
18549          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
18550   ;
18551   return 0;
18552 }
18553 _ACEOF
18554 rm -f conftest.$ac_objext conftest$ac_exeext
18555 if { (eval echo "$as_me:18555: \"$ac_link\"") >&5
18556   (eval $ac_link) 2>&5
18557   ac_status=$?
18558   echo "$as_me:18558: \$? = $ac_status" >&5
18559   (exit $ac_status); } &&
18560          { ac_try='test -s conftest$ac_exeext'
18561   { (eval echo "$as_me:18561: \"$ac_try\"") >&5
18562   (eval $ac_try) 2>&5
18563   ac_status=$?
18564   echo "$as_me:18564: \$? = $ac_status" >&5
18565   (exit $ac_status); }; }; then
18566   cf_cv_curses_wacs_symbols=yes
18567 else
18568   echo "$as_me: failed program was:" >&5
18569 cat conftest.$ac_ext >&5
18570 fi
18571 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18572 else
18573         cat >conftest.$ac_ext <<_ACEOF
18574 #line 18574 "configure"
18575 #include "confdefs.h"
18576
18577 #ifndef _XOPEN_SOURCE_EXTENDED
18578 #define _XOPEN_SOURCE_EXTENDED
18579 #endif
18580 #include <${cf_cv_ncurses_header:-curses.h}>
18581 int
18582 main (void)
18583 {
18584 cchar_t *foo = WACS_PLUS
18585   ;
18586   return 0;
18587 }
18588 _ACEOF
18589 rm -f conftest.$ac_objext conftest$ac_exeext
18590 if { (eval echo "$as_me:18590: \"$ac_link\"") >&5
18591   (eval $ac_link) 2>&5
18592   ac_status=$?
18593   echo "$as_me:18593: \$? = $ac_status" >&5
18594   (exit $ac_status); } &&
18595          { ac_try='test -s conftest$ac_exeext'
18596   { (eval echo "$as_me:18596: \"$ac_try\"") >&5
18597   (eval $ac_try) 2>&5
18598   ac_status=$?
18599   echo "$as_me:18599: \$? = $ac_status" >&5
18600   (exit $ac_status); }; }; then
18601   cf_cv_curses_wacs_symbols=yes
18602 else
18603   echo "$as_me: failed program was:" >&5
18604 cat conftest.$ac_ext >&5
18605 fi
18606 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18607 fi
18608
18609 fi
18610 echo "$as_me:18610: result: $cf_cv_curses_wacs_symbols" >&5
18611 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
18612
18613 test "$cf_cv_curses_wacs_symbols" != no &&
18614 cat >>confdefs.h <<\EOF
18615 #define CURSES_WACS_SYMBOLS 1
18616 EOF
18617
18618 fi
18619
18620 echo "$as_me:18620: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18621 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18622 cat >conftest.$ac_ext <<_ACEOF
18623 #line 18623 "configure"
18624 #include "confdefs.h"
18625
18626 #ifndef _XOPEN_SOURCE_EXTENDED
18627 #define _XOPEN_SOURCE_EXTENDED
18628 #endif
18629 #include <${cf_cv_ncurses_header:-curses.h}>
18630 int
18631 main (void)
18632 {
18633
18634 attr_t foo
18635
18636   ;
18637   return 0;
18638 }
18639 _ACEOF
18640 rm -f conftest.$ac_objext
18641 if { (eval echo "$as_me:18641: \"$ac_compile\"") >&5
18642   (eval $ac_compile) 2>&5
18643   ac_status=$?
18644   echo "$as_me:18644: \$? = $ac_status" >&5
18645   (exit $ac_status); } &&
18646          { ac_try='test -s conftest.$ac_objext'
18647   { (eval echo "$as_me:18647: \"$ac_try\"") >&5
18648   (eval $ac_try) 2>&5
18649   ac_status=$?
18650   echo "$as_me:18650: \$? = $ac_status" >&5
18651   (exit $ac_status); }; }; then
18652   cf_result=yes
18653 else
18654   echo "$as_me: failed program was:" >&5
18655 cat conftest.$ac_ext >&5
18656 cf_result=no
18657 fi
18658 rm -f conftest.$ac_objext conftest.$ac_ext
18659 echo "$as_me:18659: result: $cf_result" >&5
18660 echo "${ECHO_T}$cf_result" >&6
18661 if test $cf_result = yes ; then
18662
18663 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18664
18665 cat >>confdefs.h <<EOF
18666 #define $cf_result 1
18667 EOF
18668
18669 else
18670
18671 cat >>confdefs.h <<EOF
18672 #define attr_t long
18673 EOF
18674
18675 fi
18676
18677 if test "$cf_enable_widec" = yes; then
18678
18679 # This is needed on Tru64 5.0 to declare mbstate_t
18680 echo "$as_me:18680: checking if we must include wchar.h to declare mbstate_t" >&5
18681 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
18682 if test "${cf_cv_mbstate_t+set}" = set; then
18683   echo $ECHO_N "(cached) $ECHO_C" >&6
18684 else
18685
18686 cat >conftest.$ac_ext <<_ACEOF
18687 #line 18687 "configure"
18688 #include "confdefs.h"
18689
18690 #include <stdlib.h>
18691 #include <stdarg.h>
18692 #include <stdio.h>
18693 #ifdef HAVE_LIBUTF8_H
18694 #include <libutf8.h>
18695 #endif
18696 int
18697 main (void)
18698 {
18699 mbstate_t state
18700   ;
18701   return 0;
18702 }
18703 _ACEOF
18704 rm -f conftest.$ac_objext
18705 if { (eval echo "$as_me:18705: \"$ac_compile\"") >&5
18706   (eval $ac_compile) 2>&5
18707   ac_status=$?
18708   echo "$as_me:18708: \$? = $ac_status" >&5
18709   (exit $ac_status); } &&
18710          { ac_try='test -s conftest.$ac_objext'
18711   { (eval echo "$as_me:18711: \"$ac_try\"") >&5
18712   (eval $ac_try) 2>&5
18713   ac_status=$?
18714   echo "$as_me:18714: \$? = $ac_status" >&5
18715   (exit $ac_status); }; }; then
18716   cf_cv_mbstate_t=no
18717 else
18718   echo "$as_me: failed program was:" >&5
18719 cat conftest.$ac_ext >&5
18720 cat >conftest.$ac_ext <<_ACEOF
18721 #line 18721 "configure"
18722 #include "confdefs.h"
18723
18724 #include <stdlib.h>
18725 #include <stdarg.h>
18726 #include <stdio.h>
18727 #include <wchar.h>
18728 #ifdef HAVE_LIBUTF8_H
18729 #include <libutf8.h>
18730 #endif
18731 int
18732 main (void)
18733 {
18734 mbstate_t value
18735   ;
18736   return 0;
18737 }
18738 _ACEOF
18739 rm -f conftest.$ac_objext
18740 if { (eval echo "$as_me:18740: \"$ac_compile\"") >&5
18741   (eval $ac_compile) 2>&5
18742   ac_status=$?
18743   echo "$as_me:18743: \$? = $ac_status" >&5
18744   (exit $ac_status); } &&
18745          { ac_try='test -s conftest.$ac_objext'
18746   { (eval echo "$as_me:18746: \"$ac_try\"") >&5
18747   (eval $ac_try) 2>&5
18748   ac_status=$?
18749   echo "$as_me:18749: \$? = $ac_status" >&5
18750   (exit $ac_status); }; }; then
18751   cf_cv_mbstate_t=yes
18752 else
18753   echo "$as_me: failed program was:" >&5
18754 cat conftest.$ac_ext >&5
18755 cf_cv_mbstate_t=unknown
18756 fi
18757 rm -f conftest.$ac_objext conftest.$ac_ext
18758 fi
18759 rm -f conftest.$ac_objext conftest.$ac_ext
18760 fi
18761 echo "$as_me:18761: result: $cf_cv_mbstate_t" >&5
18762 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
18763
18764 if test "$cf_cv_mbstate_t" = yes ; then
18765
18766 cat >>confdefs.h <<\EOF
18767 #define NEED_WCHAR_H 1
18768 EOF
18769
18770         NEED_WCHAR_H=1
18771 fi
18772
18773 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
18774 if test "$cf_cv_mbstate_t" = unknown ; then
18775         NCURSES_MBSTATE_T=1
18776 fi
18777
18778 # if we find mbstate_t in either place, use substitution to provide a fallback.
18779 if test "$cf_cv_mbstate_t" != unknown ; then
18780         NCURSES_OK_MBSTATE_T=1
18781 fi
18782
18783 # This is needed on Tru64 5.0 to declare wchar_t
18784 echo "$as_me:18784: checking if we must include wchar.h to declare wchar_t" >&5
18785 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
18786 if test "${cf_cv_wchar_t+set}" = set; then
18787   echo $ECHO_N "(cached) $ECHO_C" >&6
18788 else
18789
18790 cat >conftest.$ac_ext <<_ACEOF
18791 #line 18791 "configure"
18792 #include "confdefs.h"
18793
18794 #include <stdlib.h>
18795 #include <stdarg.h>
18796 #include <stdio.h>
18797 #ifdef HAVE_LIBUTF8_H
18798 #include <libutf8.h>
18799 #endif
18800 int
18801 main (void)
18802 {
18803 wchar_t state
18804   ;
18805   return 0;
18806 }
18807 _ACEOF
18808 rm -f conftest.$ac_objext
18809 if { (eval echo "$as_me:18809: \"$ac_compile\"") >&5
18810   (eval $ac_compile) 2>&5
18811   ac_status=$?
18812   echo "$as_me:18812: \$? = $ac_status" >&5
18813   (exit $ac_status); } &&
18814          { ac_try='test -s conftest.$ac_objext'
18815   { (eval echo "$as_me:18815: \"$ac_try\"") >&5
18816   (eval $ac_try) 2>&5
18817   ac_status=$?
18818   echo "$as_me:18818: \$? = $ac_status" >&5
18819   (exit $ac_status); }; }; then
18820   cf_cv_wchar_t=no
18821 else
18822   echo "$as_me: failed program was:" >&5
18823 cat conftest.$ac_ext >&5
18824 cat >conftest.$ac_ext <<_ACEOF
18825 #line 18825 "configure"
18826 #include "confdefs.h"
18827
18828 #include <stdlib.h>
18829 #include <stdarg.h>
18830 #include <stdio.h>
18831 #include <wchar.h>
18832 #ifdef HAVE_LIBUTF8_H
18833 #include <libutf8.h>
18834 #endif
18835 int
18836 main (void)
18837 {
18838 wchar_t value
18839   ;
18840   return 0;
18841 }
18842 _ACEOF
18843 rm -f conftest.$ac_objext
18844 if { (eval echo "$as_me:18844: \"$ac_compile\"") >&5
18845   (eval $ac_compile) 2>&5
18846   ac_status=$?
18847   echo "$as_me:18847: \$? = $ac_status" >&5
18848   (exit $ac_status); } &&
18849          { ac_try='test -s conftest.$ac_objext'
18850   { (eval echo "$as_me:18850: \"$ac_try\"") >&5
18851   (eval $ac_try) 2>&5
18852   ac_status=$?
18853   echo "$as_me:18853: \$? = $ac_status" >&5
18854   (exit $ac_status); }; }; then
18855   cf_cv_wchar_t=yes
18856 else
18857   echo "$as_me: failed program was:" >&5
18858 cat conftest.$ac_ext >&5
18859 cf_cv_wchar_t=unknown
18860 fi
18861 rm -f conftest.$ac_objext conftest.$ac_ext
18862 fi
18863 rm -f conftest.$ac_objext conftest.$ac_ext
18864 fi
18865 echo "$as_me:18865: result: $cf_cv_wchar_t" >&5
18866 echo "${ECHO_T}$cf_cv_wchar_t" >&6
18867
18868 if test "$cf_cv_wchar_t" = yes ; then
18869
18870 cat >>confdefs.h <<\EOF
18871 #define NEED_WCHAR_H 1
18872 EOF
18873
18874         NEED_WCHAR_H=1
18875 fi
18876
18877 # if we do not find wchar_t in either place, use substitution to provide a fallback.
18878 if test "$cf_cv_wchar_t" = unknown ; then
18879         NCURSES_WCHAR_T=1
18880 fi
18881
18882 # if we find wchar_t in either place, use substitution to provide a fallback.
18883 if test "$cf_cv_wchar_t" != unknown ; then
18884         NCURSES_OK_WCHAR_T=1
18885 fi
18886
18887 # This is needed on Tru64 5.0 to declare wint_t
18888 echo "$as_me:18888: checking if we must include wchar.h to declare wint_t" >&5
18889 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
18890 if test "${cf_cv_wint_t+set}" = set; then
18891   echo $ECHO_N "(cached) $ECHO_C" >&6
18892 else
18893
18894 cat >conftest.$ac_ext <<_ACEOF
18895 #line 18895 "configure"
18896 #include "confdefs.h"
18897
18898 #include <stdlib.h>
18899 #include <stdarg.h>
18900 #include <stdio.h>
18901 #ifdef HAVE_LIBUTF8_H
18902 #include <libutf8.h>
18903 #endif
18904 int
18905 main (void)
18906 {
18907 wint_t state
18908   ;
18909   return 0;
18910 }
18911 _ACEOF
18912 rm -f conftest.$ac_objext
18913 if { (eval echo "$as_me:18913: \"$ac_compile\"") >&5
18914   (eval $ac_compile) 2>&5
18915   ac_status=$?
18916   echo "$as_me:18916: \$? = $ac_status" >&5
18917   (exit $ac_status); } &&
18918          { ac_try='test -s conftest.$ac_objext'
18919   { (eval echo "$as_me:18919: \"$ac_try\"") >&5
18920   (eval $ac_try) 2>&5
18921   ac_status=$?
18922   echo "$as_me:18922: \$? = $ac_status" >&5
18923   (exit $ac_status); }; }; then
18924   cf_cv_wint_t=no
18925 else
18926   echo "$as_me: failed program was:" >&5
18927 cat conftest.$ac_ext >&5
18928 cat >conftest.$ac_ext <<_ACEOF
18929 #line 18929 "configure"
18930 #include "confdefs.h"
18931
18932 #include <stdlib.h>
18933 #include <stdarg.h>
18934 #include <stdio.h>
18935 #include <wchar.h>
18936 #ifdef HAVE_LIBUTF8_H
18937 #include <libutf8.h>
18938 #endif
18939 int
18940 main (void)
18941 {
18942 wint_t value
18943   ;
18944   return 0;
18945 }
18946 _ACEOF
18947 rm -f conftest.$ac_objext
18948 if { (eval echo "$as_me:18948: \"$ac_compile\"") >&5
18949   (eval $ac_compile) 2>&5
18950   ac_status=$?
18951   echo "$as_me:18951: \$? = $ac_status" >&5
18952   (exit $ac_status); } &&
18953          { ac_try='test -s conftest.$ac_objext'
18954   { (eval echo "$as_me:18954: \"$ac_try\"") >&5
18955   (eval $ac_try) 2>&5
18956   ac_status=$?
18957   echo "$as_me:18957: \$? = $ac_status" >&5
18958   (exit $ac_status); }; }; then
18959   cf_cv_wint_t=yes
18960 else
18961   echo "$as_me: failed program was:" >&5
18962 cat conftest.$ac_ext >&5
18963 cf_cv_wint_t=unknown
18964 fi
18965 rm -f conftest.$ac_objext conftest.$ac_ext
18966 fi
18967 rm -f conftest.$ac_objext conftest.$ac_ext
18968 fi
18969 echo "$as_me:18969: result: $cf_cv_wint_t" >&5
18970 echo "${ECHO_T}$cf_cv_wint_t" >&6
18971
18972 if test "$cf_cv_wint_t" = yes ; then
18973
18974 cat >>confdefs.h <<\EOF
18975 #define NEED_WCHAR_H 1
18976 EOF
18977
18978         NEED_WCHAR_H=1
18979 fi
18980
18981 # if we do not find wint_t in either place, use substitution to provide a fallback.
18982 if test "$cf_cv_wint_t" = unknown ; then
18983         NCURSES_WINT_T=1
18984 fi
18985
18986 # if we find wint_t in either place, use substitution to provide a fallback.
18987 if test "$cf_cv_wint_t" != unknown ; then
18988         NCURSES_OK_WINT_T=1
18989 fi
18990
18991         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
18992
18993 echo "$as_me:18993: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18994 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18995 cat >conftest.$ac_ext <<_ACEOF
18996 #line 18996 "configure"
18997 #include "confdefs.h"
18998
18999 #ifndef _XOPEN_SOURCE_EXTENDED
19000 #define _XOPEN_SOURCE_EXTENDED
19001 #endif
19002 #include <${cf_cv_ncurses_header:-curses.h}>
19003 int
19004 main (void)
19005 {
19006
19007 mbstate_t foo
19008
19009   ;
19010   return 0;
19011 }
19012 _ACEOF
19013 rm -f conftest.$ac_objext
19014 if { (eval echo "$as_me:19014: \"$ac_compile\"") >&5
19015   (eval $ac_compile) 2>&5
19016   ac_status=$?
19017   echo "$as_me:19017: \$? = $ac_status" >&5
19018   (exit $ac_status); } &&
19019          { ac_try='test -s conftest.$ac_objext'
19020   { (eval echo "$as_me:19020: \"$ac_try\"") >&5
19021   (eval $ac_try) 2>&5
19022   ac_status=$?
19023   echo "$as_me:19023: \$? = $ac_status" >&5
19024   (exit $ac_status); }; }; then
19025   cf_result=yes
19026 else
19027   echo "$as_me: failed program was:" >&5
19028 cat conftest.$ac_ext >&5
19029 cf_result=no
19030 fi
19031 rm -f conftest.$ac_objext conftest.$ac_ext
19032 echo "$as_me:19032: result: $cf_result" >&5
19033 echo "${ECHO_T}$cf_result" >&6
19034 if test $cf_result = yes ; then
19035
19036 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19037
19038 cat >>confdefs.h <<EOF
19039 #define $cf_result 1
19040 EOF
19041
19042 else
19043
19044 cat >>confdefs.h <<EOF
19045 #define mbstate_t long
19046 EOF
19047
19048 fi
19049
19050         fi
19051
19052         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19053
19054 echo "$as_me:19054: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19055 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19056 cat >conftest.$ac_ext <<_ACEOF
19057 #line 19057 "configure"
19058 #include "confdefs.h"
19059
19060 #ifndef _XOPEN_SOURCE_EXTENDED
19061 #define _XOPEN_SOURCE_EXTENDED
19062 #endif
19063 #include <${cf_cv_ncurses_header:-curses.h}>
19064 int
19065 main (void)
19066 {
19067
19068 wchar_t foo
19069
19070   ;
19071   return 0;
19072 }
19073 _ACEOF
19074 rm -f conftest.$ac_objext
19075 if { (eval echo "$as_me:19075: \"$ac_compile\"") >&5
19076   (eval $ac_compile) 2>&5
19077   ac_status=$?
19078   echo "$as_me:19078: \$? = $ac_status" >&5
19079   (exit $ac_status); } &&
19080          { ac_try='test -s conftest.$ac_objext'
19081   { (eval echo "$as_me:19081: \"$ac_try\"") >&5
19082   (eval $ac_try) 2>&5
19083   ac_status=$?
19084   echo "$as_me:19084: \$? = $ac_status" >&5
19085   (exit $ac_status); }; }; then
19086   cf_result=yes
19087 else
19088   echo "$as_me: failed program was:" >&5
19089 cat conftest.$ac_ext >&5
19090 cf_result=no
19091 fi
19092 rm -f conftest.$ac_objext conftest.$ac_ext
19093 echo "$as_me:19093: result: $cf_result" >&5
19094 echo "${ECHO_T}$cf_result" >&6
19095 if test $cf_result = yes ; then
19096
19097 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19098
19099 cat >>confdefs.h <<EOF
19100 #define $cf_result 1
19101 EOF
19102
19103 else
19104
19105 cat >>confdefs.h <<EOF
19106 #define wchar_t long
19107 EOF
19108
19109 fi
19110
19111         fi
19112
19113         if test "$NCURSES_OK_WINT_T" = 0 ; then
19114
19115 echo "$as_me:19115: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19116 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19117 cat >conftest.$ac_ext <<_ACEOF
19118 #line 19118 "configure"
19119 #include "confdefs.h"
19120
19121 #ifndef _XOPEN_SOURCE_EXTENDED
19122 #define _XOPEN_SOURCE_EXTENDED
19123 #endif
19124 #include <${cf_cv_ncurses_header:-curses.h}>
19125 int
19126 main (void)
19127 {
19128
19129 wint_t foo
19130
19131   ;
19132   return 0;
19133 }
19134 _ACEOF
19135 rm -f conftest.$ac_objext
19136 if { (eval echo "$as_me:19136: \"$ac_compile\"") >&5
19137   (eval $ac_compile) 2>&5
19138   ac_status=$?
19139   echo "$as_me:19139: \$? = $ac_status" >&5
19140   (exit $ac_status); } &&
19141          { ac_try='test -s conftest.$ac_objext'
19142   { (eval echo "$as_me:19142: \"$ac_try\"") >&5
19143   (eval $ac_try) 2>&5
19144   ac_status=$?
19145   echo "$as_me:19145: \$? = $ac_status" >&5
19146   (exit $ac_status); }; }; then
19147   cf_result=yes
19148 else
19149   echo "$as_me: failed program was:" >&5
19150 cat conftest.$ac_ext >&5
19151 cf_result=no
19152 fi
19153 rm -f conftest.$ac_objext conftest.$ac_ext
19154 echo "$as_me:19154: result: $cf_result" >&5
19155 echo "${ECHO_T}$cf_result" >&6
19156 if test $cf_result = yes ; then
19157
19158 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19159
19160 cat >>confdefs.h <<EOF
19161 #define $cf_result 1
19162 EOF
19163
19164 else
19165
19166 cat >>confdefs.h <<EOF
19167 #define wint_t long
19168 EOF
19169
19170 fi
19171
19172         fi
19173 fi
19174
19175 for cf_data in \
19176 curscr \
19177 ospeed \
19178 boolnames \
19179 boolfnames \
19180 ttytype
19181 do
19182 echo "$as_me:19182: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19183 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19184
19185 cat >conftest.$ac_ext <<_ACEOF
19186 #line 19186 "configure"
19187 #include "confdefs.h"
19188
19189 #ifdef HAVE_XCURSES
19190 #include <xcurses.h>
19191 char * XCursesProgramName = "test";
19192 #else
19193 #include <${cf_cv_ncurses_header:-curses.h}>
19194 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19195 #include <ncursesw/term.h>
19196 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19197 #include <ncurses/term.h>
19198 #elif defined(HAVE_TERM_H)
19199 #include <term.h>
19200 #endif
19201 #endif
19202
19203 int
19204 main (void)
19205 {
19206
19207 void *foo = &($cf_data)
19208
19209   ;
19210   return 0;
19211 }
19212 _ACEOF
19213 rm -f conftest.$ac_objext
19214 if { (eval echo "$as_me:19214: \"$ac_compile\"") >&5
19215   (eval $ac_compile) 2>&5
19216   ac_status=$?
19217   echo "$as_me:19217: \$? = $ac_status" >&5
19218   (exit $ac_status); } &&
19219          { ac_try='test -s conftest.$ac_objext'
19220   { (eval echo "$as_me:19220: \"$ac_try\"") >&5
19221   (eval $ac_try) 2>&5
19222   ac_status=$?
19223   echo "$as_me:19223: \$? = $ac_status" >&5
19224   (exit $ac_status); }; }; then
19225   cf_result=yes
19226
19227 else
19228   echo "$as_me: failed program was:" >&5
19229 cat conftest.$ac_ext >&5
19230 cf_result=no
19231 fi
19232 rm -f conftest.$ac_objext conftest.$ac_ext
19233 echo "$as_me:19233: result: $cf_result" >&5
19234 echo "${ECHO_T}$cf_result" >&6
19235
19236 if test $cf_result = yes ; then
19237
19238 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19239
19240         cat >>confdefs.h <<EOF
19241 #define $cf_result 1
19242 EOF
19243
19244 else
19245         echo "$as_me:19245: checking for data $cf_data in library" >&5
19246 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19247         # BSD linkers insist on making weak linkage, but resolve at runtime.
19248         if test "$cross_compiling" = yes; then
19249
19250         # cross-compiling
19251         cat >conftest.$ac_ext <<_ACEOF
19252 #line 19252 "configure"
19253 #include "confdefs.h"
19254
19255 #ifdef HAVE_XCURSES
19256 #include <xcurses.h>
19257 char * XCursesProgramName = "test";
19258 #else
19259 #include <${cf_cv_ncurses_header:-curses.h}>
19260 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19261 #include <ncursesw/term.h>
19262 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19263 #include <ncurses/term.h>
19264 #elif defined(HAVE_TERM_H)
19265 #include <term.h>
19266 #endif
19267 #endif
19268
19269 extern char $cf_data;
19270 int
19271 main (void)
19272 {
19273
19274         do {
19275                 void *foo = &($cf_data);
19276                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19277                 ${cf_cv_main_return:-return}(foo == 0);
19278         } while (0)
19279
19280   ;
19281   return 0;
19282 }
19283 _ACEOF
19284 rm -f conftest.$ac_objext conftest$ac_exeext
19285 if { (eval echo "$as_me:19285: \"$ac_link\"") >&5
19286   (eval $ac_link) 2>&5
19287   ac_status=$?
19288   echo "$as_me:19288: \$? = $ac_status" >&5
19289   (exit $ac_status); } &&
19290          { ac_try='test -s conftest$ac_exeext'
19291   { (eval echo "$as_me:19291: \"$ac_try\"") >&5
19292   (eval $ac_try) 2>&5
19293   ac_status=$?
19294   echo "$as_me:19294: \$? = $ac_status" >&5
19295   (exit $ac_status); }; }; then
19296   cf_result=yes
19297 else
19298   echo "$as_me: failed program was:" >&5
19299 cat conftest.$ac_ext >&5
19300 cf_result=no
19301 fi
19302 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19303
19304 else
19305   cat >conftest.$ac_ext <<_ACEOF
19306 #line 19306 "configure"
19307 #include "confdefs.h"
19308
19309 #ifdef HAVE_XCURSES
19310 #include <xcurses.h>
19311 char * XCursesProgramName = "test";
19312 #else
19313 #include <${cf_cv_ncurses_header:-curses.h}>
19314 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19315 #include <ncursesw/term.h>
19316 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19317 #include <ncurses/term.h>
19318 #elif defined(HAVE_TERM_H)
19319 #include <term.h>
19320 #endif
19321 #endif
19322
19323 extern char $cf_data;
19324 int main(void)
19325 {
19326         void *foo = &($cf_data);
19327         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19328         ${cf_cv_main_return:-return}(foo == 0);
19329 }
19330 _ACEOF
19331 rm -f conftest$ac_exeext
19332 if { (eval echo "$as_me:19332: \"$ac_link\"") >&5
19333   (eval $ac_link) 2>&5
19334   ac_status=$?
19335   echo "$as_me:19335: \$? = $ac_status" >&5
19336   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19337   { (eval echo "$as_me:19337: \"$ac_try\"") >&5
19338   (eval $ac_try) 2>&5
19339   ac_status=$?
19340   echo "$as_me:19340: \$? = $ac_status" >&5
19341   (exit $ac_status); }; }; then
19342   cf_result=yes
19343
19344 else
19345   echo "$as_me: program exited with status $ac_status" >&5
19346 echo "$as_me: failed program was:" >&5
19347 cat conftest.$ac_ext >&5
19348 cf_result=no
19349 fi
19350 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19351 fi
19352         echo "$as_me:19352: result: $cf_result" >&5
19353 echo "${ECHO_T}$cf_result" >&6
19354         if test $cf_result = yes ; then
19355
19356 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19357
19358                 cat >>confdefs.h <<EOF
19359 #define $cf_result 1
19360 EOF
19361
19362                 # do not exit loop here, since we prefer system's declarations
19363         fi
19364 fi
19365 done
19366
19367 if ( test "$GCC" = yes || test "$GXX" = yes )
19368 then
19369 echo "$as_me:19369: checking if you want to turn on gcc warnings" >&5
19370 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
19371
19372 # Check whether --enable-warnings or --disable-warnings was given.
19373 if test "${enable_warnings+set}" = set; then
19374   enableval="$enable_warnings"
19375   test "$enableval" != yes && enableval=no
19376         if test "$enableval" != "no" ; then
19377     with_warnings=yes
19378         else
19379                 with_warnings=no
19380         fi
19381 else
19382   enableval=no
19383         with_warnings=no
19384
19385 fi;
19386 echo "$as_me:19386: result: $with_warnings" >&5
19387 echo "${ECHO_T}$with_warnings" >&6
19388 if test "$with_warnings" = "yes"
19389 then
19390
19391 if test "$GCC" = yes
19392 then
19393 cat > conftest.i <<EOF
19394 #ifndef GCC_PRINTF
19395 #define GCC_PRINTF 0
19396 #endif
19397 #ifndef GCC_SCANF
19398 #define GCC_SCANF 0
19399 #endif
19400 #ifndef GCC_NORETURN
19401 #define GCC_NORETURN /* nothing */
19402 #endif
19403 #ifndef GCC_UNUSED
19404 #define GCC_UNUSED /* nothing */
19405 #endif
19406 EOF
19407 if test "$GCC" = yes
19408 then
19409         { echo "$as_me:19409: checking for $CC __attribute__ directives..." >&5
19410 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
19411 cat > conftest.$ac_ext <<EOF
19412 #line 19412 "${as_me:-configure}"
19413 #include "confdefs.h"
19414 #include "conftest.h"
19415 #include "conftest.i"
19416 #if     GCC_PRINTF
19417 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
19418 #else
19419 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
19420 #endif
19421 #if     GCC_SCANF
19422 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
19423 #else
19424 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
19425 #endif
19426 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
19427 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
19428 extern void foo(void) GCC_NORETURN;
19429 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
19430 EOF
19431         cf_printf_attribute=no
19432         cf_scanf_attribute=no
19433         for cf_attribute in scanf printf unused noreturn
19434         do
19435
19436 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19437
19438                 cf_directive="__attribute__(($cf_attribute))"
19439                 echo "checking for $CC $cf_directive" 1>&5
19440
19441                 case $cf_attribute in
19442                 (printf)
19443                         cf_printf_attribute=yes
19444                         cat >conftest.h <<EOF
19445 #define GCC_$cf_ATTRIBUTE 1
19446 EOF
19447                         ;;
19448                 (scanf)
19449                         cf_scanf_attribute=yes
19450                         cat >conftest.h <<EOF
19451 #define GCC_$cf_ATTRIBUTE 1
19452 EOF
19453                         ;;
19454                 (*)
19455                         cat >conftest.h <<EOF
19456 #define GCC_$cf_ATTRIBUTE $cf_directive
19457 EOF
19458                         ;;
19459                 esac
19460
19461                 if { (eval echo "$as_me:19461: \"$ac_compile\"") >&5
19462   (eval $ac_compile) 2>&5
19463   ac_status=$?
19464   echo "$as_me:19464: \$? = $ac_status" >&5
19465   (exit $ac_status); }; then
19466                         test -n "$verbose" && echo "$as_me:19466: result: ... $cf_attribute" >&5
19467 echo "${ECHO_T}... $cf_attribute" >&6
19468                         cat conftest.h >>confdefs.h
19469                         case $cf_attribute in
19470                         (noreturn)
19471
19472 cat >>confdefs.h <<EOF
19473 #define GCC_NORETURN $cf_directive
19474 EOF
19475
19476                                 ;;
19477                         (printf)
19478                                 cf_value='/* nothing */'
19479                                 if test "$cf_printf_attribute" != no ; then
19480                                         cf_value='__attribute__((format(printf,fmt,var)))'
19481
19482 cat >>confdefs.h <<\EOF
19483 #define GCC_PRINTF 1
19484 EOF
19485
19486                                 fi
19487
19488 cat >>confdefs.h <<EOF
19489 #define GCC_PRINTFLIKE(fmt,var) $cf_value
19490 EOF
19491
19492                                 ;;
19493                         (scanf)
19494                                 cf_value='/* nothing */'
19495                                 if test "$cf_scanf_attribute" != no ; then
19496                                         cf_value='__attribute__((format(scanf,fmt,var)))'
19497
19498 cat >>confdefs.h <<\EOF
19499 #define GCC_SCANF 1
19500 EOF
19501
19502                                 fi
19503
19504 cat >>confdefs.h <<EOF
19505 #define GCC_SCANFLIKE(fmt,var) $cf_value
19506 EOF
19507
19508                                 ;;
19509                         (unused)
19510
19511 cat >>confdefs.h <<EOF
19512 #define GCC_UNUSED $cf_directive
19513 EOF
19514
19515                                 ;;
19516                         esac
19517                 fi
19518         done
19519 else
19520         fgrep define conftest.i >>confdefs.h
19521 fi
19522 rm -rf conftest*
19523 fi
19524
19525 INTEL_COMPILER=no
19526
19527 if test "$GCC" = yes ; then
19528         case $host_os in
19529         (linux*|gnu*)
19530                 echo "$as_me:19530: checking if this is really Intel C compiler" >&5
19531 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
19532                 cf_save_CFLAGS="$CFLAGS"
19533                 CFLAGS="$CFLAGS -no-gcc"
19534                 cat >conftest.$ac_ext <<_ACEOF
19535 #line 19535 "configure"
19536 #include "confdefs.h"
19537
19538 int
19539 main (void)
19540 {
19541
19542 #ifdef __INTEL_COMPILER
19543 #else
19544 make an error
19545 #endif
19546
19547   ;
19548   return 0;
19549 }
19550 _ACEOF
19551 rm -f conftest.$ac_objext
19552 if { (eval echo "$as_me:19552: \"$ac_compile\"") >&5
19553   (eval $ac_compile) 2>&5
19554   ac_status=$?
19555   echo "$as_me:19555: \$? = $ac_status" >&5
19556   (exit $ac_status); } &&
19557          { ac_try='test -s conftest.$ac_objext'
19558   { (eval echo "$as_me:19558: \"$ac_try\"") >&5
19559   (eval $ac_try) 2>&5
19560   ac_status=$?
19561   echo "$as_me:19561: \$? = $ac_status" >&5
19562   (exit $ac_status); }; }; then
19563   INTEL_COMPILER=yes
19564 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
19565
19566 else
19567   echo "$as_me: failed program was:" >&5
19568 cat conftest.$ac_ext >&5
19569 fi
19570 rm -f conftest.$ac_objext conftest.$ac_ext
19571                 CFLAGS="$cf_save_CFLAGS"
19572                 echo "$as_me:19572: result: $INTEL_COMPILER" >&5
19573 echo "${ECHO_T}$INTEL_COMPILER" >&6
19574                 ;;
19575         esac
19576 fi
19577
19578 CLANG_COMPILER=no
19579
19580 if test "$GCC" = yes ; then
19581         echo "$as_me:19581: checking if this is really Clang C compiler" >&5
19582 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
19583         cf_save_CFLAGS="$CFLAGS"
19584         CFLAGS="$CFLAGS -Qunused-arguments"
19585         cat >conftest.$ac_ext <<_ACEOF
19586 #line 19586 "configure"
19587 #include "confdefs.h"
19588
19589 int
19590 main (void)
19591 {
19592
19593 #ifdef __clang__
19594 #else
19595 make an error
19596 #endif
19597
19598   ;
19599   return 0;
19600 }
19601 _ACEOF
19602 rm -f conftest.$ac_objext
19603 if { (eval echo "$as_me:19603: \"$ac_compile\"") >&5
19604   (eval $ac_compile) 2>&5
19605   ac_status=$?
19606   echo "$as_me:19606: \$? = $ac_status" >&5
19607   (exit $ac_status); } &&
19608          { ac_try='test -s conftest.$ac_objext'
19609   { (eval echo "$as_me:19609: \"$ac_try\"") >&5
19610   (eval $ac_try) 2>&5
19611   ac_status=$?
19612   echo "$as_me:19612: \$? = $ac_status" >&5
19613   (exit $ac_status); }; }; then
19614   CLANG_COMPILER=yes
19615 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
19616
19617 else
19618   echo "$as_me: failed program was:" >&5
19619 cat conftest.$ac_ext >&5
19620 fi
19621 rm -f conftest.$ac_objext conftest.$ac_ext
19622         CFLAGS="$cf_save_CFLAGS"
19623         echo "$as_me:19623: result: $CLANG_COMPILER" >&5
19624 echo "${ECHO_T}$CLANG_COMPILER" >&6
19625 fi
19626
19627 cat > conftest.$ac_ext <<EOF
19628 #line 19628 "${as_me:-configure}"
19629 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
19630 EOF
19631
19632 if test "$INTEL_COMPILER" = yes
19633 then
19634 # The "-wdXXX" options suppress warnings:
19635 # remark #1419: external declaration in primary source file
19636 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
19637 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
19638 # remark #193: zero used for undefined preprocessing identifier
19639 # remark #593: variable "curs_sb_left_arrow" was set but never used
19640 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
19641 # remark #869: parameter "tw" was never referenced
19642 # remark #981: operands are evaluated in unspecified order
19643 # warning #279: controlling expression is constant
19644
19645         { echo "$as_me:19645: checking for $CC warning options..." >&5
19646 echo "$as_me: checking for $CC warning options..." >&6;}
19647         cf_save_CFLAGS="$CFLAGS"
19648         EXTRA_CFLAGS="-Wall"
19649         for cf_opt in \
19650                 wd1419 \
19651                 wd1683 \
19652                 wd1684 \
19653                 wd193 \
19654                 wd593 \
19655                 wd279 \
19656                 wd810 \
19657                 wd869 \
19658                 wd981
19659         do
19660                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19661                 if { (eval echo "$as_me:19661: \"$ac_compile\"") >&5
19662   (eval $ac_compile) 2>&5
19663   ac_status=$?
19664   echo "$as_me:19664: \$? = $ac_status" >&5
19665   (exit $ac_status); }; then
19666                         test -n "$verbose" && echo "$as_me:19666: result: ... -$cf_opt" >&5
19667 echo "${ECHO_T}... -$cf_opt" >&6
19668                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19669                 fi
19670         done
19671         CFLAGS="$cf_save_CFLAGS"
19672
19673 elif test "$GCC" = yes
19674 then
19675         { echo "$as_me:19675: checking for $CC warning options..." >&5
19676 echo "$as_me: checking for $CC warning options..." >&6;}
19677         cf_save_CFLAGS="$CFLAGS"
19678         EXTRA_CFLAGS=
19679         cf_warn_CONST=""
19680         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
19681         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
19682         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
19683         for cf_opt in W Wall \
19684                 Wbad-function-cast \
19685                 Wcast-align \
19686                 Wcast-qual \
19687                 Wdeclaration-after-statement \
19688                 Wextra \
19689                 Winline \
19690                 Wmissing-declarations \
19691                 Wmissing-prototypes \
19692                 Wnested-externs \
19693                 Wpointer-arith \
19694                 Wshadow \
19695                 Wstrict-prototypes \
19696                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
19697         do
19698                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19699                 if { (eval echo "$as_me:19699: \"$ac_compile\"") >&5
19700   (eval $ac_compile) 2>&5
19701   ac_status=$?
19702   echo "$as_me:19702: \$? = $ac_status" >&5
19703   (exit $ac_status); }; then
19704                         test -n "$verbose" && echo "$as_me:19704: result: ... -$cf_opt" >&5
19705 echo "${ECHO_T}... -$cf_opt" >&6
19706                         case $cf_opt in
19707                         (Wcast-qual)
19708
19709         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19710         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
19711
19712                                 ;;
19713                         (Winline)
19714                                 case $GCC_VERSION in
19715                                 ([34].*)
19716                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19717
19718 echo "${as_me:-configure}:19718: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19719
19720                                         continue;;
19721                                 esac
19722                                 ;;
19723                         (Wpointer-arith)
19724                                 case $GCC_VERSION in
19725                                 ([12].*)
19726                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19727
19728 echo "${as_me:-configure}:19728: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19729
19730                                         continue;;
19731                                 esac
19732                                 ;;
19733                         esac
19734                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19735                 fi
19736         done
19737         CFLAGS="$cf_save_CFLAGS"
19738 fi
19739 rm -rf conftest*
19740
19741 fi
19742 fi
19743
19744 echo "$as_me:19744: checking if you want to use dmalloc for testing" >&5
19745 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
19746
19747 # Check whether --with-dmalloc or --without-dmalloc was given.
19748 if test "${with_dmalloc+set}" = set; then
19749   withval="$with_dmalloc"
19750
19751 cat >>confdefs.h <<EOF
19752 #define USE_DMALLOC 1
19753 EOF
19754
19755         : ${with_cflags:=-g}
19756         : ${with_no_leaks:=yes}
19757          with_dmalloc=yes
19758 else
19759   with_dmalloc=
19760 fi;
19761 echo "$as_me:19761: result: ${with_dmalloc:-no}" >&5
19762 echo "${ECHO_T}${with_dmalloc:-no}" >&6
19763
19764 case .$with_cflags in
19765 (.*-g*)
19766         case .$CFLAGS in
19767         (.*-g*)
19768                 ;;
19769         (*)
19770
19771 cf_fix_cppflags=no
19772 cf_new_cflags=
19773 cf_new_cppflags=
19774 cf_new_extra_cppflags=
19775
19776 for cf_add_cflags in -g
19777 do
19778 case $cf_fix_cppflags in
19779 (no)
19780         case $cf_add_cflags in
19781         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19782                 case $cf_add_cflags in
19783                 (-D*)
19784                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19785
19786                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19787                                 && test -z "${cf_tst_cflags}" \
19788                                 && cf_fix_cppflags=yes
19789
19790                         if test $cf_fix_cppflags = yes ; then
19791
19792         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19793         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19794
19795                                 continue
19796                         elif test "${cf_tst_cflags}" = "\"'" ; then
19797
19798         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19799         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19800
19801                                 continue
19802                         fi
19803                         ;;
19804                 esac
19805                 case "$CPPFLAGS" in
19806                 (*$cf_add_cflags)
19807                         ;;
19808                 (*)
19809                         case $cf_add_cflags in
19810                         (-D*)
19811                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19812
19813 CPPFLAGS=`echo "$CPPFLAGS" | \
19814         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19815                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19816
19817                                 ;;
19818                         esac
19819
19820         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19821         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19822
19823                         ;;
19824                 esac
19825                 ;;
19826         (*)
19827
19828         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19829         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19830
19831                 ;;
19832         esac
19833         ;;
19834 (yes)
19835
19836         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19837         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19838
19839         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19840
19841         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19842                 && test -z "${cf_tst_cflags}" \
19843                 && cf_fix_cppflags=no
19844         ;;
19845 esac
19846 done
19847
19848 if test -n "$cf_new_cflags" ; then
19849
19850         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19851         CFLAGS="${CFLAGS}$cf_new_cflags"
19852
19853 fi
19854
19855 if test -n "$cf_new_cppflags" ; then
19856
19857         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19858         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19859
19860 fi
19861
19862 if test -n "$cf_new_extra_cppflags" ; then
19863
19864         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19865         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19866
19867 fi
19868
19869                 ;;
19870         esac
19871         ;;
19872 esac
19873
19874 if test "$with_dmalloc" = yes ; then
19875         echo "$as_me:19875: checking for dmalloc.h" >&5
19876 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
19877 if test "${ac_cv_header_dmalloc_h+set}" = set; then
19878   echo $ECHO_N "(cached) $ECHO_C" >&6
19879 else
19880   cat >conftest.$ac_ext <<_ACEOF
19881 #line 19881 "configure"
19882 #include "confdefs.h"
19883 #include <dmalloc.h>
19884 _ACEOF
19885 if { (eval echo "$as_me:19885: \"$ac_cpp conftest.$ac_ext\"") >&5
19886   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19887   ac_status=$?
19888   egrep -v '^ *\+' conftest.er1 >conftest.err
19889   rm -f conftest.er1
19890   cat conftest.err >&5
19891   echo "$as_me:19891: \$? = $ac_status" >&5
19892   (exit $ac_status); } >/dev/null; then
19893   if test -s conftest.err; then
19894     ac_cpp_err=$ac_c_preproc_warn_flag
19895   else
19896     ac_cpp_err=
19897   fi
19898 else
19899   ac_cpp_err=yes
19900 fi
19901 if test -z "$ac_cpp_err"; then
19902   ac_cv_header_dmalloc_h=yes
19903 else
19904   echo "$as_me: failed program was:" >&5
19905   cat conftest.$ac_ext >&5
19906   ac_cv_header_dmalloc_h=no
19907 fi
19908 rm -f conftest.err conftest.$ac_ext
19909 fi
19910 echo "$as_me:19910: result: $ac_cv_header_dmalloc_h" >&5
19911 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
19912 if test $ac_cv_header_dmalloc_h = yes; then
19913
19914 echo "$as_me:19914: checking for dmalloc_debug in -ldmalloc" >&5
19915 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
19916 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
19917   echo $ECHO_N "(cached) $ECHO_C" >&6
19918 else
19919   ac_check_lib_save_LIBS=$LIBS
19920 LIBS="-ldmalloc  $LIBS"
19921 cat >conftest.$ac_ext <<_ACEOF
19922 #line 19922 "configure"
19923 #include "confdefs.h"
19924
19925 /* Override any gcc2 internal prototype to avoid an error.  */
19926 #ifdef __cplusplus
19927 extern "C"
19928 #endif
19929 /* We use char because int might match the return type of a gcc2
19930    builtin and then its argument prototype would still apply.  */
19931 char dmalloc_debug ();
19932 int
19933 main (void)
19934 {
19935 dmalloc_debug ();
19936   ;
19937   return 0;
19938 }
19939 _ACEOF
19940 rm -f conftest.$ac_objext conftest$ac_exeext
19941 if { (eval echo "$as_me:19941: \"$ac_link\"") >&5
19942   (eval $ac_link) 2>&5
19943   ac_status=$?
19944   echo "$as_me:19944: \$? = $ac_status" >&5
19945   (exit $ac_status); } &&
19946          { ac_try='test -s conftest$ac_exeext'
19947   { (eval echo "$as_me:19947: \"$ac_try\"") >&5
19948   (eval $ac_try) 2>&5
19949   ac_status=$?
19950   echo "$as_me:19950: \$? = $ac_status" >&5
19951   (exit $ac_status); }; }; then
19952   ac_cv_lib_dmalloc_dmalloc_debug=yes
19953 else
19954   echo "$as_me: failed program was:" >&5
19955 cat conftest.$ac_ext >&5
19956 ac_cv_lib_dmalloc_dmalloc_debug=no
19957 fi
19958 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19959 LIBS=$ac_check_lib_save_LIBS
19960 fi
19961 echo "$as_me:19961: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
19962 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
19963 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
19964   cat >>confdefs.h <<EOF
19965 #define HAVE_LIBDMALLOC 1
19966 EOF
19967
19968   LIBS="-ldmalloc $LIBS"
19969
19970 fi
19971
19972 fi
19973
19974 fi
19975
19976 echo "$as_me:19976: checking if you want to use dbmalloc for testing" >&5
19977 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
19978
19979 # Check whether --with-dbmalloc or --without-dbmalloc was given.
19980 if test "${with_dbmalloc+set}" = set; then
19981   withval="$with_dbmalloc"
19982
19983 cat >>confdefs.h <<EOF
19984 #define USE_DBMALLOC 1
19985 EOF
19986
19987         : ${with_cflags:=-g}
19988         : ${with_no_leaks:=yes}
19989          with_dbmalloc=yes
19990 else
19991   with_dbmalloc=
19992 fi;
19993 echo "$as_me:19993: result: ${with_dbmalloc:-no}" >&5
19994 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
19995
19996 case .$with_cflags in
19997 (.*-g*)
19998         case .$CFLAGS in
19999         (.*-g*)
20000                 ;;
20001         (*)
20002
20003 cf_fix_cppflags=no
20004 cf_new_cflags=
20005 cf_new_cppflags=
20006 cf_new_extra_cppflags=
20007
20008 for cf_add_cflags in -g
20009 do
20010 case $cf_fix_cppflags in
20011 (no)
20012         case $cf_add_cflags in
20013         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20014                 case $cf_add_cflags in
20015                 (-D*)
20016                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20017
20018                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20019                                 && test -z "${cf_tst_cflags}" \
20020                                 && cf_fix_cppflags=yes
20021
20022                         if test $cf_fix_cppflags = yes ; then
20023
20024         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20025         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20026
20027                                 continue
20028                         elif test "${cf_tst_cflags}" = "\"'" ; then
20029
20030         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20031         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20032
20033                                 continue
20034                         fi
20035                         ;;
20036                 esac
20037                 case "$CPPFLAGS" in
20038                 (*$cf_add_cflags)
20039                         ;;
20040                 (*)
20041                         case $cf_add_cflags in
20042                         (-D*)
20043                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20044
20045 CPPFLAGS=`echo "$CPPFLAGS" | \
20046         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20047                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20048
20049                                 ;;
20050                         esac
20051
20052         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20053         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20054
20055                         ;;
20056                 esac
20057                 ;;
20058         (*)
20059
20060         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20061         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20062
20063                 ;;
20064         esac
20065         ;;
20066 (yes)
20067
20068         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20069         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20070
20071         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20072
20073         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20074                 && test -z "${cf_tst_cflags}" \
20075                 && cf_fix_cppflags=no
20076         ;;
20077 esac
20078 done
20079
20080 if test -n "$cf_new_cflags" ; then
20081
20082         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20083         CFLAGS="${CFLAGS}$cf_new_cflags"
20084
20085 fi
20086
20087 if test -n "$cf_new_cppflags" ; then
20088
20089         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20090         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20091
20092 fi
20093
20094 if test -n "$cf_new_extra_cppflags" ; then
20095
20096         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20097         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20098
20099 fi
20100
20101                 ;;
20102         esac
20103         ;;
20104 esac
20105
20106 if test "$with_dbmalloc" = yes ; then
20107         echo "$as_me:20107: checking for dbmalloc.h" >&5
20108 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
20109 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
20110   echo $ECHO_N "(cached) $ECHO_C" >&6
20111 else
20112   cat >conftest.$ac_ext <<_ACEOF
20113 #line 20113 "configure"
20114 #include "confdefs.h"
20115 #include <dbmalloc.h>
20116 _ACEOF
20117 if { (eval echo "$as_me:20117: \"$ac_cpp conftest.$ac_ext\"") >&5
20118   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20119   ac_status=$?
20120   egrep -v '^ *\+' conftest.er1 >conftest.err
20121   rm -f conftest.er1
20122   cat conftest.err >&5
20123   echo "$as_me:20123: \$? = $ac_status" >&5
20124   (exit $ac_status); } >/dev/null; then
20125   if test -s conftest.err; then
20126     ac_cpp_err=$ac_c_preproc_warn_flag
20127   else
20128     ac_cpp_err=
20129   fi
20130 else
20131   ac_cpp_err=yes
20132 fi
20133 if test -z "$ac_cpp_err"; then
20134   ac_cv_header_dbmalloc_h=yes
20135 else
20136   echo "$as_me: failed program was:" >&5
20137   cat conftest.$ac_ext >&5
20138   ac_cv_header_dbmalloc_h=no
20139 fi
20140 rm -f conftest.err conftest.$ac_ext
20141 fi
20142 echo "$as_me:20142: result: $ac_cv_header_dbmalloc_h" >&5
20143 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
20144 if test $ac_cv_header_dbmalloc_h = yes; then
20145
20146 echo "$as_me:20146: checking for debug_malloc in -ldbmalloc" >&5
20147 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
20148 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
20149   echo $ECHO_N "(cached) $ECHO_C" >&6
20150 else
20151   ac_check_lib_save_LIBS=$LIBS
20152 LIBS="-ldbmalloc  $LIBS"
20153 cat >conftest.$ac_ext <<_ACEOF
20154 #line 20154 "configure"
20155 #include "confdefs.h"
20156
20157 /* Override any gcc2 internal prototype to avoid an error.  */
20158 #ifdef __cplusplus
20159 extern "C"
20160 #endif
20161 /* We use char because int might match the return type of a gcc2
20162    builtin and then its argument prototype would still apply.  */
20163 char debug_malloc ();
20164 int
20165 main (void)
20166 {
20167 debug_malloc ();
20168   ;
20169   return 0;
20170 }
20171 _ACEOF
20172 rm -f conftest.$ac_objext conftest$ac_exeext
20173 if { (eval echo "$as_me:20173: \"$ac_link\"") >&5
20174   (eval $ac_link) 2>&5
20175   ac_status=$?
20176   echo "$as_me:20176: \$? = $ac_status" >&5
20177   (exit $ac_status); } &&
20178          { ac_try='test -s conftest$ac_exeext'
20179   { (eval echo "$as_me:20179: \"$ac_try\"") >&5
20180   (eval $ac_try) 2>&5
20181   ac_status=$?
20182   echo "$as_me:20182: \$? = $ac_status" >&5
20183   (exit $ac_status); }; }; then
20184   ac_cv_lib_dbmalloc_debug_malloc=yes
20185 else
20186   echo "$as_me: failed program was:" >&5
20187 cat conftest.$ac_ext >&5
20188 ac_cv_lib_dbmalloc_debug_malloc=no
20189 fi
20190 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20191 LIBS=$ac_check_lib_save_LIBS
20192 fi
20193 echo "$as_me:20193: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
20194 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
20195 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
20196   cat >>confdefs.h <<EOF
20197 #define HAVE_LIBDBMALLOC 1
20198 EOF
20199
20200   LIBS="-ldbmalloc $LIBS"
20201
20202 fi
20203
20204 fi
20205
20206 fi
20207
20208 echo "$as_me:20208: checking if you want to use valgrind for testing" >&5
20209 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
20210
20211 # Check whether --with-valgrind or --without-valgrind was given.
20212 if test "${with_valgrind+set}" = set; then
20213   withval="$with_valgrind"
20214
20215 cat >>confdefs.h <<EOF
20216 #define USE_VALGRIND 1
20217 EOF
20218
20219         : ${with_cflags:=-g}
20220         : ${with_no_leaks:=yes}
20221          with_valgrind=yes
20222 else
20223   with_valgrind=
20224 fi;
20225 echo "$as_me:20225: result: ${with_valgrind:-no}" >&5
20226 echo "${ECHO_T}${with_valgrind:-no}" >&6
20227
20228 case .$with_cflags in
20229 (.*-g*)
20230         case .$CFLAGS in
20231         (.*-g*)
20232                 ;;
20233         (*)
20234
20235 cf_fix_cppflags=no
20236 cf_new_cflags=
20237 cf_new_cppflags=
20238 cf_new_extra_cppflags=
20239
20240 for cf_add_cflags in -g
20241 do
20242 case $cf_fix_cppflags in
20243 (no)
20244         case $cf_add_cflags in
20245         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20246                 case $cf_add_cflags in
20247                 (-D*)
20248                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20249
20250                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20251                                 && test -z "${cf_tst_cflags}" \
20252                                 && cf_fix_cppflags=yes
20253
20254                         if test $cf_fix_cppflags = yes ; then
20255
20256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20258
20259                                 continue
20260                         elif test "${cf_tst_cflags}" = "\"'" ; then
20261
20262         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20263         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20264
20265                                 continue
20266                         fi
20267                         ;;
20268                 esac
20269                 case "$CPPFLAGS" in
20270                 (*$cf_add_cflags)
20271                         ;;
20272                 (*)
20273                         case $cf_add_cflags in
20274                         (-D*)
20275                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20276
20277 CPPFLAGS=`echo "$CPPFLAGS" | \
20278         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20279                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20280
20281                                 ;;
20282                         esac
20283
20284         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20285         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20286
20287                         ;;
20288                 esac
20289                 ;;
20290         (*)
20291
20292         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20293         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20294
20295                 ;;
20296         esac
20297         ;;
20298 (yes)
20299
20300         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20301         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20302
20303         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20304
20305         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20306                 && test -z "${cf_tst_cflags}" \
20307                 && cf_fix_cppflags=no
20308         ;;
20309 esac
20310 done
20311
20312 if test -n "$cf_new_cflags" ; then
20313
20314         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20315         CFLAGS="${CFLAGS}$cf_new_cflags"
20316
20317 fi
20318
20319 if test -n "$cf_new_cppflags" ; then
20320
20321         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20322         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20323
20324 fi
20325
20326 if test -n "$cf_new_extra_cppflags" ; then
20327
20328         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20329         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20330
20331 fi
20332
20333                 ;;
20334         esac
20335         ;;
20336 esac
20337
20338 echo "$as_me:20338: checking if you want to perform memory-leak testing" >&5
20339 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
20340
20341 # Check whether --enable-leaks or --disable-leaks was given.
20342 if test "${enable_leaks+set}" = set; then
20343   enableval="$enable_leaks"
20344   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
20345 else
20346   : ${with_no_leaks:=no}
20347 fi;
20348 echo "$as_me:20348: result: $with_no_leaks" >&5
20349 echo "${ECHO_T}$with_no_leaks" >&6
20350
20351 if test "$with_no_leaks" = yes ; then
20352
20353 cat >>confdefs.h <<\EOF
20354 #define NO_LEAKS 1
20355 EOF
20356
20357 cat >>confdefs.h <<\EOF
20358 #define YY_NO_LEAKS 1
20359 EOF
20360
20361 fi
20362
20363 LD_RPATH_OPT=
20364 if test "x$cf_cv_enable_rpath" != xno
20365 then
20366         echo "$as_me:20366: checking for an rpath option" >&5
20367 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
20368         case $cf_cv_system_name in
20369         (irix*)
20370                 if test "$GCC" = yes; then
20371                         LD_RPATH_OPT="-Wl,-rpath,"
20372                 else
20373                         LD_RPATH_OPT="-rpath "
20374                 fi
20375                 ;;
20376         (linux*|gnu*|k*bsd*-gnu|freebsd*)
20377                 LD_RPATH_OPT="-Wl,-rpath,"
20378                 ;;
20379         (openbsd[2-9].*|mirbsd*)
20380                 LD_RPATH_OPT="-Wl,-rpath,"
20381                 ;;
20382         (dragonfly*)
20383                 LD_RPATH_OPT="-rpath "
20384                 ;;
20385         (netbsd*)
20386                 LD_RPATH_OPT="-Wl,-rpath,"
20387                 ;;
20388         (osf*|mls+*)
20389                 LD_RPATH_OPT="-rpath "
20390                 ;;
20391         (solaris2*)
20392                 LD_RPATH_OPT="-R"
20393                 ;;
20394         (*)
20395                 ;;
20396         esac
20397         echo "$as_me:20397: result: $LD_RPATH_OPT" >&5
20398 echo "${ECHO_T}$LD_RPATH_OPT" >&6
20399
20400         case "x$LD_RPATH_OPT" in
20401         (x-R*)
20402                 echo "$as_me:20402: checking if we need a space after rpath option" >&5
20403 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
20404                 cf_save_LIBS="$LIBS"
20405
20406 cf_add_libs="${LD_RPATH_OPT}$libdir"
20407 # Filter out duplicates - this happens with badly-designed ".pc" files...
20408 for cf_add_1lib in $LIBS
20409 do
20410         for cf_add_2lib in $cf_add_libs
20411         do
20412                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
20413                 then
20414                         cf_add_1lib=
20415                         break
20416                 fi
20417         done
20418         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
20419 done
20420 LIBS="$cf_add_libs"
20421
20422                 cat >conftest.$ac_ext <<_ACEOF
20423 #line 20423 "configure"
20424 #include "confdefs.h"
20425
20426 int
20427 main (void)
20428 {
20429
20430   ;
20431   return 0;
20432 }
20433 _ACEOF
20434 rm -f conftest.$ac_objext conftest$ac_exeext
20435 if { (eval echo "$as_me:20435: \"$ac_link\"") >&5
20436   (eval $ac_link) 2>&5
20437   ac_status=$?
20438   echo "$as_me:20438: \$? = $ac_status" >&5
20439   (exit $ac_status); } &&
20440          { ac_try='test -s conftest$ac_exeext'
20441   { (eval echo "$as_me:20441: \"$ac_try\"") >&5
20442   (eval $ac_try) 2>&5
20443   ac_status=$?
20444   echo "$as_me:20444: \$? = $ac_status" >&5
20445   (exit $ac_status); }; }; then
20446   cf_rpath_space=no
20447 else
20448   echo "$as_me: failed program was:" >&5
20449 cat conftest.$ac_ext >&5
20450 cf_rpath_space=yes
20451 fi
20452 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20453                 LIBS="$cf_save_LIBS"
20454                 echo "$as_me:20454: result: $cf_rpath_space" >&5
20455 echo "${ECHO_T}$cf_rpath_space" >&6
20456                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
20457                 ;;
20458         esac
20459 fi
20460
20461 echo "$as_me:20461: checking if rpath-hack should be disabled" >&5
20462 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
20463
20464 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
20465 if test "${enable_rpath_hack+set}" = set; then
20466   enableval="$enable_rpath_hack"
20467   test "$enableval" != no && enableval=yes
20468         if test "$enableval" != "yes" ; then
20469     cf_disable_rpath_hack=yes
20470         else
20471                 cf_disable_rpath_hack=no
20472         fi
20473 else
20474   enableval=yes
20475         cf_disable_rpath_hack=no
20476
20477 fi;
20478 echo "$as_me:20478: result: $cf_disable_rpath_hack" >&5
20479 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
20480 if test "$cf_disable_rpath_hack" = no ; then
20481
20482 echo "$as_me:20482: checking for updated LDFLAGS" >&5
20483 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
20484 if test -n "$LD_RPATH_OPT" ; then
20485         echo "$as_me:20485: result: maybe" >&5
20486 echo "${ECHO_T}maybe" >&6
20487
20488         for ac_prog in ldd
20489 do
20490   # Extract the first word of "$ac_prog", so it can be a program name with args.
20491 set dummy $ac_prog; ac_word=$2
20492 echo "$as_me:20492: checking for $ac_word" >&5
20493 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
20494 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
20495   echo $ECHO_N "(cached) $ECHO_C" >&6
20496 else
20497   if test -n "$cf_ldd_prog"; then
20498   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
20499 else
20500   ac_save_IFS=$IFS; IFS=$ac_path_separator
20501 ac_dummy="$PATH"
20502 for ac_dir in $ac_dummy; do
20503   IFS=$ac_save_IFS
20504   test -z "$ac_dir" && ac_dir=.
20505   $as_executable_p "$ac_dir/$ac_word" || continue
20506 ac_cv_prog_cf_ldd_prog="$ac_prog"
20507 echo "$as_me:20507: found $ac_dir/$ac_word" >&5
20508 break
20509 done
20510
20511 fi
20512 fi
20513 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
20514 if test -n "$cf_ldd_prog"; then
20515   echo "$as_me:20515: result: $cf_ldd_prog" >&5
20516 echo "${ECHO_T}$cf_ldd_prog" >&6
20517 else
20518   echo "$as_me:20518: result: no" >&5
20519 echo "${ECHO_T}no" >&6
20520 fi
20521
20522   test -n "$cf_ldd_prog" && break
20523 done
20524 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
20525
20526         cf_rpath_list="/usr/lib /lib"
20527         if test "$cf_ldd_prog" != no
20528         then
20529                 cf_rpath_oops=
20530
20531 cat >conftest.$ac_ext <<_ACEOF
20532 #line 20532 "configure"
20533 #include "confdefs.h"
20534 #include <stdio.h>
20535 int
20536 main (void)
20537 {
20538 printf("Hello");
20539   ;
20540   return 0;
20541 }
20542 _ACEOF
20543 rm -f conftest.$ac_objext conftest$ac_exeext
20544 if { (eval echo "$as_me:20544: \"$ac_link\"") >&5
20545   (eval $ac_link) 2>&5
20546   ac_status=$?
20547   echo "$as_me:20547: \$? = $ac_status" >&5
20548   (exit $ac_status); } &&
20549          { ac_try='test -s conftest$ac_exeext'
20550   { (eval echo "$as_me:20550: \"$ac_try\"") >&5
20551   (eval $ac_try) 2>&5
20552   ac_status=$?
20553   echo "$as_me:20553: \$? = $ac_status" >&5
20554   (exit $ac_status); }; }; then
20555   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
20556                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
20557 else
20558   echo "$as_me: failed program was:" >&5
20559 cat conftest.$ac_ext >&5
20560 fi
20561 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20562
20563                 # If we passed the link-test, but get a "not found" on a given library,
20564                 # this could be due to inept reconfiguration of gcc to make it only
20565                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
20566                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
20567                 # /usr/local libraries.
20568                 if test -n "$cf_rpath_oops"
20569                 then
20570                         for cf_rpath_src in $cf_rpath_oops
20571                         do
20572                                 for cf_rpath_dir in \
20573                                         /usr/local \
20574                                         /usr/pkg \
20575                                         /opt/sfw
20576                                 do
20577                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
20578                                         then
20579                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
20580
20581 echo "${as_me:-configure}:20581: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
20582
20583                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
20584                                                 break
20585                                         fi
20586                                 done
20587                         done
20588                 fi
20589         fi
20590
20591         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20592
20593 echo "${as_me:-configure}:20593: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20594
20595 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
20596
20597 echo "${as_me:-configure}:20597: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
20598
20599 cf_rpath_dst=
20600 for cf_rpath_src in $LDFLAGS
20601 do
20602         case $cf_rpath_src in
20603         (-L*)
20604
20605                 # check if this refers to a directory which we will ignore
20606                 cf_rpath_skip=no
20607                 if test -n "$cf_rpath_list"
20608                 then
20609                         for cf_rpath_item in $cf_rpath_list
20610                         do
20611                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20612                                 then
20613                                         cf_rpath_skip=yes
20614                                         break
20615                                 fi
20616                         done
20617                 fi
20618
20619                 if test "$cf_rpath_skip" = no
20620                 then
20621                         # transform the option
20622                         if test "$LD_RPATH_OPT" = "-R " ; then
20623                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20624                         else
20625                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20626                         fi
20627
20628                         # if we have not already added this, add it now
20629                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20630                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20631                         then
20632                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20633
20634 echo "${as_me:-configure}:20634: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20635
20636                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20637                         fi
20638                 fi
20639                 ;;
20640         esac
20641         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20642 done
20643 LDFLAGS=$cf_rpath_dst
20644
20645 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
20646
20647 echo "${as_me:-configure}:20647: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
20648
20649 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
20650
20651 echo "${as_me:-configure}:20651: testing ...checking LIBS $LIBS ..." 1>&5
20652
20653 cf_rpath_dst=
20654 for cf_rpath_src in $LIBS
20655 do
20656         case $cf_rpath_src in
20657         (-L*)
20658
20659                 # check if this refers to a directory which we will ignore
20660                 cf_rpath_skip=no
20661                 if test -n "$cf_rpath_list"
20662                 then
20663                         for cf_rpath_item in $cf_rpath_list
20664                         do
20665                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20666                                 then
20667                                         cf_rpath_skip=yes
20668                                         break
20669                                 fi
20670                         done
20671                 fi
20672
20673                 if test "$cf_rpath_skip" = no
20674                 then
20675                         # transform the option
20676                         if test "$LD_RPATH_OPT" = "-R " ; then
20677                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20678                         else
20679                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20680                         fi
20681
20682                         # if we have not already added this, add it now
20683                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20684                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20685                         then
20686                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20687
20688 echo "${as_me:-configure}:20688: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20689
20690                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20691                         fi
20692                 fi
20693                 ;;
20694         esac
20695         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20696 done
20697 LIBS=$cf_rpath_dst
20698
20699 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
20700
20701 echo "${as_me:-configure}:20701: testing ...checked LIBS $LIBS ..." 1>&5
20702
20703         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20704
20705 echo "${as_me:-configure}:20705: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20706
20707 else
20708         echo "$as_me:20708: result: no" >&5
20709 echo "${ECHO_T}no" >&6
20710 fi
20711
20712 fi
20713
20714 TEST_ARGS="$LIBS"
20715 LIBS=
20716
20717 ac_config_files="$ac_config_files Makefile"
20718 ac_config_commands="$ac_config_commands default"
20719 cat >confcache <<\_ACEOF
20720 # This file is a shell script that caches the results of configure
20721 # tests run on this system so they can be shared between configure
20722 # scripts and configure runs, see configure's option --config-cache.
20723 # It is not useful on other systems.  If it contains results you don't
20724 # want to keep, you may remove or edit it.
20725 #
20726 # config.status only pays attention to the cache file if you give it
20727 # the --recheck option to rerun configure.
20728 #
20729 # `ac_cv_env_foo' variables (set or unset) will be overriden when
20730 # loading this file, other *unset* `ac_cv_foo' will be assigned the
20731 # following values.
20732
20733 _ACEOF
20734
20735 # The following way of writing the cache mishandles newlines in values,
20736 # but we know of no workaround that is simple, portable, and efficient.
20737 # So, don't put newlines in cache variables' values.
20738 # Ultrix sh set writes to stderr and can't be redirected directly,
20739 # and sets the high bit in the cache file unless we assign to the vars.
20740 {
20741   (set) 2>&1 |
20742     case `(ac_space=' '; set | grep ac_space) 2>&1` in
20743     *ac_space=\ *)
20744       # `set' does not quote correctly, so add quotes (double-quote
20745       # substitution turns \\\\ into \\, and sed turns \\ into \).
20746       sed -n \
20747         "s/'/'\\\\''/g;
20748           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
20749       ;;
20750     *)
20751       # `set' quotes correctly as required by POSIX, so do not add quotes.
20752       sed -n \
20753         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
20754       ;;
20755     esac;
20756 } |
20757   sed '
20758      t clear
20759      : clear
20760      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
20761      t end
20762      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
20763      : end' >>confcache
20764 if cmp -s $cache_file confcache; then :; else
20765   if test -w $cache_file; then
20766     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
20767     cat confcache >$cache_file
20768   else
20769     echo "not updating unwritable cache $cache_file"
20770   fi
20771 fi
20772 rm -f confcache
20773
20774 test "x$prefix" = xNONE && prefix=$ac_default_prefix
20775 # Let make expand exec_prefix.
20776 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
20777
20778 # VPATH may cause trouble with some makes, so we remove $(srcdir),
20779 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
20780 # trailing colons and then remove the whole line if VPATH becomes empty
20781 # (actually we leave an empty line to preserve line numbers).
20782 if test "x$srcdir" = x.; then
20783   ac_vpsub='/^[         ]*VPATH[        ]*=/{
20784 s/:*\$(srcdir):*/:/;
20785 s/:*\${srcdir}:*/:/;
20786 s/:*@srcdir@:*/:/;
20787 s/^\([^=]*=[    ]*\):*/\1/;
20788 s/:*$//;
20789 s/^[^=]*=[      ]*$//;
20790 }'
20791 fi
20792
20793 DEFS=-DHAVE_CONFIG_H
20794
20795 : ${CONFIG_STATUS=./config.status}
20796 ac_clean_files_save=$ac_clean_files
20797 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
20798 { echo "$as_me:20798: creating $CONFIG_STATUS" >&5
20799 echo "$as_me: creating $CONFIG_STATUS" >&6;}
20800 cat >$CONFIG_STATUS <<_ACEOF
20801 #! $SHELL
20802 # Generated automatically by configure.
20803 # Run this file to recreate the current configuration.
20804 # Compiler output produced by configure, useful for debugging
20805 # configure, is in config.log if it exists.
20806
20807 debug=false
20808 SHELL=\${CONFIG_SHELL-$SHELL}
20809 ac_cs_invocation="\$0 \$@"
20810
20811 _ACEOF
20812
20813 cat >>$CONFIG_STATUS <<\_ACEOF
20814 # Be Bourne compatible
20815 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
20816   emulate sh
20817   NULLCMD=:
20818 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
20819   set -o posix
20820 fi
20821
20822 # Name of the executable.
20823 as_me=`echo "$0" |sed 's,.*[\\/],,'`
20824
20825 if expr a : '\(a\)' >/dev/null 2>&1; then
20826   as_expr=expr
20827 else
20828   as_expr=false
20829 fi
20830
20831 rm -f conf$$ conf$$.exe conf$$.file
20832 echo >conf$$.file
20833 if ln -s conf$$.file conf$$ 2>/dev/null; then
20834   # We could just check for DJGPP; but this test a) works b) is more generic
20835   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
20836   if test -f conf$$.exe; then
20837     # Don't use ln at all; we don't have any links
20838     as_ln_s='cp -p'
20839   else
20840     as_ln_s='ln -s'
20841   fi
20842 elif ln conf$$.file conf$$ 2>/dev/null; then
20843   as_ln_s=ln
20844 else
20845   as_ln_s='cp -p'
20846 fi
20847 rm -f conf$$ conf$$.exe conf$$.file
20848
20849 as_executable_p="test -f"
20850
20851 # Support unset when possible.
20852 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
20853   as_unset=unset
20854 else
20855   as_unset=false
20856 fi
20857
20858 # NLS nuisances.
20859 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
20860 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
20861 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
20862 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
20863 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
20864 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
20865 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
20866 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
20867
20868 # IFS
20869 # We need space, tab and new line, in precisely that order.
20870 as_nl='
20871 '
20872 IFS="   $as_nl"
20873
20874 # CDPATH.
20875 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
20876
20877 exec 6>&1
20878
20879 _ACEOF
20880
20881 # Files that config.status was made for.
20882 if test -n "$ac_config_files"; then
20883   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
20884 fi
20885
20886 if test -n "$ac_config_headers"; then
20887   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
20888 fi
20889
20890 if test -n "$ac_config_links"; then
20891   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
20892 fi
20893
20894 if test -n "$ac_config_commands"; then
20895   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
20896 fi
20897
20898 cat >>$CONFIG_STATUS <<\EOF
20899
20900 ac_cs_usage="\
20901 \`$as_me' instantiates files from templates according to the
20902 current configuration.
20903
20904 Usage: $0 [OPTIONS] [FILE]...
20905
20906   -h, --help       print this help, then exit
20907   -V, --version    print version number, then exit
20908   -d, --debug      don't remove temporary files
20909       --recheck    update $as_me by reconfiguring in the same conditions
20910   --file=FILE[:TEMPLATE]
20911                    instantiate the configuration file FILE
20912   --header=FILE[:TEMPLATE]
20913                    instantiate the configuration header FILE
20914
20915 Configuration files:
20916 $config_files
20917
20918 Configuration headers:
20919 $config_headers
20920
20921 Configuration commands:
20922 $config_commands
20923
20924 Report bugs to <dickey@invisible-island.net>."
20925 EOF
20926
20927 cat >>$CONFIG_STATUS <<EOF
20928 ac_cs_version="\\
20929 config.status
20930 configured by $0, generated by GNU Autoconf 2.52.20181006,
20931   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
20932
20933 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
20934 Free Software Foundation, Inc.
20935 This config.status script is free software; the Free Software Foundation
20936 gives unlimited permission to copy, distribute and modify it."
20937 srcdir=$srcdir
20938 INSTALL="$INSTALL"
20939 EOF
20940
20941 cat >>$CONFIG_STATUS <<\EOF
20942 # If no file are specified by the user, then we need to provide default
20943 # value.  By we need to know if files were specified by the user.
20944 ac_need_defaults=:
20945 while test $# != 0
20946 do
20947   case $1 in
20948   --*=*)
20949     ac_option=`expr "x$1" : 'x\([^=]*\)='`
20950     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
20951     shift
20952     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
20953     shift
20954     ;;
20955   -*);;
20956   *) # This is not an option, so the user has probably given explicit
20957      # arguments.
20958      ac_need_defaults=false;;
20959   esac
20960
20961   case $1 in
20962   # Handling of the options.
20963 EOF
20964 cat >>$CONFIG_STATUS <<EOF
20965   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
20966     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
20967     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
20968 EOF
20969 cat >>$CONFIG_STATUS <<\EOF
20970   --version | --vers* | -V )
20971     echo "$ac_cs_version"; exit 0 ;;
20972   --he | --h)
20973     # Conflict between --help and --header
20974     { { echo "$as_me:20974: error: ambiguous option: $1
20975 Try \`$0 --help' for more information." >&5
20976 echo "$as_me: error: ambiguous option: $1
20977 Try \`$0 --help' for more information." >&2;}
20978    { (exit 1); exit 1; }; };;
20979   --help | --hel | -h )
20980     echo "$ac_cs_usage"; exit 0 ;;
20981   --debug | --d* | -d )
20982     debug=: ;;
20983   --file | --fil | --fi | --f )
20984     shift
20985     CONFIG_FILES="$CONFIG_FILES $1"
20986     ac_need_defaults=false;;
20987   --header | --heade | --head | --hea )
20988     shift
20989     CONFIG_HEADERS="$CONFIG_HEADERS $1"
20990     ac_need_defaults=false;;
20991
20992   # This is an error.
20993   -*) { { echo "$as_me:20993: error: unrecognized option: $1
20994 Try \`$0 --help' for more information." >&5
20995 echo "$as_me: error: unrecognized option: $1
20996 Try \`$0 --help' for more information." >&2;}
20997    { (exit 1); exit 1; }; } ;;
20998
20999   *) ac_config_targets="$ac_config_targets $1" ;;
21000
21001   esac
21002   shift
21003 done
21004
21005 exec 5>>config.log
21006 cat >&5 << _ACEOF
21007
21008 ## ----------------------- ##
21009 ## Running config.status.  ##
21010 ## ----------------------- ##
21011
21012 This file was extended by $as_me 2.52.20181006, executed with
21013   CONFIG_FILES    = $CONFIG_FILES
21014   CONFIG_HEADERS  = $CONFIG_HEADERS
21015   CONFIG_LINKS    = $CONFIG_LINKS
21016   CONFIG_COMMANDS = $CONFIG_COMMANDS
21017   > $ac_cs_invocation
21018 on `(hostname || uname -n) 2>/dev/null | sed 1q`
21019
21020 _ACEOF
21021 EOF
21022
21023 cat >>$CONFIG_STATUS <<EOF
21024 #
21025 # INIT-COMMANDS section.
21026 #
21027
21028 AWK="$AWK"
21029 ECHO_CC="$ECHO_CC"
21030 ECHO_LD="$ECHO_LD"
21031 SHOW_CC="$SHOW_LD"
21032
21033 EOF
21034
21035 cat >>$CONFIG_STATUS <<\EOF
21036 for ac_config_target in $ac_config_targets
21037 do
21038   case "$ac_config_target" in
21039   # Handling of arguments.
21040   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
21041   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
21042   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
21043   *) { { echo "$as_me:21043: error: invalid argument: $ac_config_target" >&5
21044 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
21045    { (exit 1); exit 1; }; };;
21046   esac
21047 done
21048
21049 # If the user did not use the arguments to specify the items to instantiate,
21050 # then the envvar interface is used.  Set only those that are not.
21051 # We use the long form for the default assignment because of an extremely
21052 # bizarre bug on SunOS 4.1.3.
21053 if $ac_need_defaults; then
21054   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
21055   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
21056   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
21057 fi
21058
21059 # Create a temporary directory, and hook for its removal unless debugging.
21060 $debug ||
21061 {
21062   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
21063   trap '{ (exit 1); exit 1; }' 1 2 13 15
21064 }
21065
21066 # Create a (secure) tmp directory for tmp files.
21067 : ${TMPDIR=/tmp}
21068 {
21069   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
21070   test -n "$tmp" && test -d "$tmp"
21071 }  ||
21072 {
21073   tmp=$TMPDIR/cs$$-$RANDOM
21074   (umask 077 && mkdir $tmp)
21075 } ||
21076 {
21077    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
21078    { (exit 1); exit 1; }
21079 }
21080
21081 EOF
21082
21083 cat >>$CONFIG_STATUS <<EOF
21084
21085 #
21086 # CONFIG_FILES section.
21087 #
21088
21089 # No need to generate the scripts if there are no CONFIG_FILES.
21090 # This happens for instance when ./config.status config.h
21091 if test -n "\$CONFIG_FILES"; then
21092   # Protect against being on the right side of a sed subst in config.status.
21093   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
21094    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
21095 s,@SHELL@,$SHELL,;t t
21096 s,@exec_prefix@,$exec_prefix,;t t
21097 s,@prefix@,$prefix,;t t
21098 s,@program_transform_name@,$program_transform_name,;t t
21099 s,@bindir@,$bindir,;t t
21100 s,@sbindir@,$sbindir,;t t
21101 s,@libexecdir@,$libexecdir,;t t
21102 s,@datarootdir@,$datarootdir,;t t
21103 s,@datadir@,$datadir,;t t
21104 s,@sysconfdir@,$sysconfdir,;t t
21105 s,@sharedstatedir@,$sharedstatedir,;t t
21106 s,@localstatedir@,$localstatedir,;t t
21107 s,@runstatedir@,$runstatedir,;t t
21108 s,@libdir@,$libdir,;t t
21109 s,@includedir@,$includedir,;t t
21110 s,@oldincludedir@,$oldincludedir,;t t
21111 s,@infodir@,$infodir,;t t
21112 s,@mandir@,$mandir,;t t
21113 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
21114 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
21115 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
21116 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
21117 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
21118 s,@build_alias@,$build_alias,;t t
21119 s,@host_alias@,$host_alias,;t t
21120 s,@target_alias@,$target_alias,;t t
21121 s,@ECHO_C@,$ECHO_C,;t t
21122 s,@ECHO_N@,$ECHO_N,;t t
21123 s,@ECHO_T@,$ECHO_T,;t t
21124 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
21125 s,@DEFS@,$DEFS,;t t
21126 s,@LIBS@,$LIBS,;t t
21127 s,@build@,$build,;t t
21128 s,@build_cpu@,$build_cpu,;t t
21129 s,@build_vendor@,$build_vendor,;t t
21130 s,@build_os@,$build_os,;t t
21131 s,@host@,$host,;t t
21132 s,@host_cpu@,$host_cpu,;t t
21133 s,@host_vendor@,$host_vendor,;t t
21134 s,@host_os@,$host_os,;t t
21135 s,@SET_MAKE@,$SET_MAKE,;t t
21136 s,@CC@,$CC,;t t
21137 s,@CFLAGS@,$CFLAGS,;t t
21138 s,@LDFLAGS@,$LDFLAGS,;t t
21139 s,@CPPFLAGS@,$CPPFLAGS,;t t
21140 s,@ac_ct_CC@,$ac_ct_CC,;t t
21141 s,@EXEEXT@,$EXEEXT,;t t
21142 s,@OBJEXT@,$OBJEXT,;t t
21143 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
21144 s,@CPP@,$CPP,;t t
21145 s,@AWK@,$AWK,;t t
21146 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
21147 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
21148 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
21149 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
21150 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
21151 s,@LINT@,$LINT,;t t
21152 s,@LINT_OPTS@,$LINT_OPTS,;t t
21153 s,@CTAGS@,$CTAGS,;t t
21154 s,@ETAGS@,$ETAGS,;t t
21155 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
21156 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
21157 s,@MATH_LIB@,$MATH_LIB,;t t
21158 s,@top_builddir@,$top_builddir,;t t
21159 s,@CC_G_OPT@,$CC_G_OPT,;t t
21160 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
21161 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
21162 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
21163 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
21164 s,@LD@,$LD,;t t
21165 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
21166 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
21167 s,@LD_MODEL@,$LD_MODEL,;t t
21168 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
21169 s,@LIBTOOL@,$LIBTOOL,;t t
21170 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
21171 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
21172 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
21173 s,@LIB_LINK@,$LIB_LINK,;t t
21174 s,@LINK_TESTS@,$LINK_TESTS,;t t
21175 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
21176 s,@PACKAGE@,$PACKAGE,;t t
21177 s,@PTHREAD@,$PTHREAD,;t t
21178 s,@TEST_ARGS@,$TEST_ARGS,;t t
21179 s,@TEST_DEPS@,$TEST_DEPS,;t t
21180 s,@TEST_LIBS@,$TEST_LIBS,;t t
21181 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
21182 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
21183 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
21184 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
21185 s,@includesubdir@,$includesubdir,;t t
21186 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
21187 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
21188 s,@ECHO_LT@,$ECHO_LT,;t t
21189 s,@ECHO_LD@,$ECHO_LD,;t t
21190 s,@RULE_CC@,$RULE_CC,;t t
21191 s,@SHOW_CC@,$SHOW_CC,;t t
21192 s,@ECHO_CC@,$ECHO_CC,;t t
21193 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
21194 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
21195 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
21196 s,@X_CFLAGS@,$X_CFLAGS,;t t
21197 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
21198 s,@X_LIBS@,$X_LIBS,;t t
21199 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
21200 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
21201 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
21202 s,@RGB_PATH@,$RGB_PATH,;t t
21203 s,@no_x11_rgb@,$no_x11_rgb,;t t
21204 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
21205 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
21206 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
21207 CEOF
21208
21209 EOF
21210
21211   cat >>$CONFIG_STATUS <<\EOF
21212   # Split the substitutions into bite-sized pieces for seds with
21213   # small command number limits, like on Digital OSF/1 and HP-UX.
21214   ac_max_sed_lines=48
21215   ac_sed_frag=1 # Number of current file.
21216   ac_beg=1 # First line for current file.
21217   ac_end=$ac_max_sed_lines # Line after last line for current file.
21218   ac_more_lines=:
21219   ac_sed_cmds=
21220   while $ac_more_lines; do
21221     if test $ac_beg -gt 1; then
21222       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21223     else
21224       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21225     fi
21226     if test ! -s $tmp/subs.frag; then
21227       ac_more_lines=false
21228     else
21229       # The purpose of the label and of the branching condition is to
21230       # speed up the sed processing (if there are no `@' at all, there
21231       # is no need to browse any of the substitutions).
21232       # These are the two extra sed commands mentioned above.
21233       (echo ':t
21234   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
21235       # It is possible to make a multiline substitution using escaped newlines.
21236       # Ensure that we do not split the substitution between script fragments.
21237       ac_BEG=$ac_end
21238       ac_END=`expr $ac_end + $ac_max_sed_lines`
21239       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
21240       if test -s $tmp/subs.next; then
21241         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
21242         if test ! -s $tmp/subs.edit; then
21243           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
21244           if test ! -s $tmp/subs.edit; then
21245             if test $ac_beg -gt 1; then
21246               ac_end=`expr $ac_end - 1`
21247               continue
21248             fi
21249           fi
21250         fi
21251       fi
21252
21253       if test -z "$ac_sed_cmds"; then
21254         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
21255       else
21256         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
21257       fi
21258       ac_sed_frag=`expr $ac_sed_frag + 1`
21259       ac_beg=$ac_end
21260       ac_end=`expr $ac_end + $ac_max_sed_lines`
21261     fi
21262   done
21263   if test -z "$ac_sed_cmds"; then
21264     ac_sed_cmds=cat
21265   fi
21266 fi # test -n "$CONFIG_FILES"
21267
21268 EOF
21269 cat >>$CONFIG_STATUS <<\EOF
21270 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
21271   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21272   case $ac_file in
21273   - | *:- | *:-:* ) # input from stdin
21274         cat >$tmp/stdin
21275         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21276         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21277   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21278         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21279   * )   ac_file_in=$ac_file.in ;;
21280   esac
21281
21282   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
21283   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21284          X"$ac_file" : 'X\(//\)[^/]' \| \
21285          X"$ac_file" : 'X\(//\)$' \| \
21286          X"$ac_file" : 'X\(/\)' \| \
21287          .     : '\(.\)' 2>/dev/null ||
21288 echo X"$ac_file" |
21289     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21290           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21291           /^X\(\/\/\)$/{ s//\1/; q; }
21292           /^X\(\/\).*/{ s//\1/; q; }
21293           s/.*/./; q'`
21294   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21295     { case "$ac_dir" in
21296   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21297   *)                      as_incr_dir=.;;
21298 esac
21299 as_dummy="$ac_dir"
21300 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21301   case $as_mkdir_dir in
21302     # Skip DOS drivespec
21303     ?:) as_incr_dir=$as_mkdir_dir ;;
21304     *)
21305       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21306       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21307     ;;
21308   esac
21309 done; }
21310
21311     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21312     # A "../" for each directory in $ac_dir_suffix.
21313     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21314   else
21315     ac_dir_suffix= ac_dots=
21316   fi
21317
21318   case $srcdir in
21319   .)  ac_srcdir=.
21320       if test -z "$ac_dots"; then
21321          ac_top_srcdir=.
21322       else
21323          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21324       fi ;;
21325   [\\/]* | ?:[\\/]* )
21326       ac_srcdir=$srcdir$ac_dir_suffix;
21327       ac_top_srcdir=$srcdir ;;
21328   *) # Relative path.
21329     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
21330     ac_top_srcdir=$ac_dots$srcdir ;;
21331   esac
21332
21333   case $INSTALL in
21334   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21335   *) ac_INSTALL=$ac_dots$INSTALL ;;
21336   esac
21337
21338   if test x"$ac_file" != x-; then
21339     { echo "$as_me:21339: creating $ac_file" >&5
21340 echo "$as_me: creating $ac_file" >&6;}
21341     rm -f "$ac_file"
21342   fi
21343   # Let's still pretend it is `configure' which instantiates (i.e., don't
21344   # use $as_me), people would be surprised to read:
21345   #    /* config.h.  Generated automatically by config.status.  */
21346   configure_input="Generated automatically from `echo $ac_file_in |
21347                                                  sed 's,.*/,,'` by configure."
21348
21349   # First look for the input files in the build tree, otherwise in the
21350   # src tree.
21351   ac_file_inputs=`IFS=:
21352     for f in $ac_file_in; do
21353       case $f in
21354       -) echo $tmp/stdin ;;
21355       [\\/$]*)
21356          # Absolute (can't be DOS-style, as IFS=:)
21357          test -f "$f" || { { echo "$as_me:21357: error: cannot find input file: $f" >&5
21358 echo "$as_me: error: cannot find input file: $f" >&2;}
21359    { (exit 1); exit 1; }; }
21360          echo $f;;
21361       *) # Relative
21362          if test -f "$f"; then
21363            # Build tree
21364            echo $f
21365          elif test -f "$srcdir/$f"; then
21366            # Source tree
21367            echo $srcdir/$f
21368          else
21369            # /dev/null tree
21370            { { echo "$as_me:21370: error: cannot find input file: $f" >&5
21371 echo "$as_me: error: cannot find input file: $f" >&2;}
21372    { (exit 1); exit 1; }; }
21373          fi;;
21374       esac
21375     done` || { (exit 1); exit 1; }
21376 EOF
21377 cat >>$CONFIG_STATUS <<\EOF
21378   ac_warn_datarootdir=no
21379   if test x"$ac_file" != x-; then
21380     for ac_item in $ac_file_inputs
21381     do
21382       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
21383       if test -n "$ac_seen"; then
21384         ac_used=`grep '@datarootdir@' $ac_item`
21385         if test -z "$ac_used"; then
21386           { echo "$as_me:21386: WARNING: datarootdir was used implicitly but not set:
21387 $ac_seen" >&5
21388 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
21389 $ac_seen" >&2;}
21390           ac_warn_datarootdir=yes
21391         fi
21392       fi
21393       ac_seen=`grep '${datarootdir}' $ac_item`
21394       if test -n "$ac_seen"; then
21395         { echo "$as_me:21395: WARNING: datarootdir was used explicitly but not set:
21396 $ac_seen" >&5
21397 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
21398 $ac_seen" >&2;}
21399         ac_warn_datarootdir=yes
21400       fi
21401     done
21402   fi
21403
21404 if test "x$ac_warn_datarootdir" = xyes; then
21405   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
21406 fi
21407
21408 EOF
21409 cat >>$CONFIG_STATUS <<EOF
21410   sed "$ac_vpsub
21411 $extrasub
21412 EOF
21413 cat >>$CONFIG_STATUS <<\EOF
21414 :t
21415 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
21416 s,@configure_input@,$configure_input,;t t
21417 s,@srcdir@,$ac_srcdir,;t t
21418 s,@top_srcdir@,$ac_top_srcdir,;t t
21419 s,@INSTALL@,$ac_INSTALL,;t t
21420 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
21421   rm -f $tmp/stdin
21422   if test x"$ac_file" != x-; then
21423     cp $tmp/out $ac_file
21424
21425     for ac_name in prefix exec_prefix datarootdir
21426     do
21427         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
21428         if test -n "$ac_seen"; then
21429             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
21430             if test -z "$ac_init"; then
21431               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
21432               { echo "$as_me:21432: WARNING: Variable $ac_name is used but was not set:
21433 $ac_seen" >&5
21434 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
21435 $ac_seen" >&2;}
21436             fi
21437         fi
21438     done
21439     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
21440     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
21441     if test -s $tmp/out; then
21442       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
21443       { echo "$as_me:21443: WARNING: Some variables may not be substituted:
21444 $ac_seen" >&5
21445 echo "$as_me: WARNING: Some variables may not be substituted:
21446 $ac_seen" >&2;}
21447     fi
21448   else
21449     cat $tmp/out
21450   fi
21451   rm -f $tmp/out
21452
21453 done
21454 EOF
21455 cat >>$CONFIG_STATUS <<\EOF
21456
21457 #
21458 # CONFIG_HEADER section.
21459 #
21460
21461 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
21462 # NAME is the cpp macro being defined and VALUE is the value it is being given.
21463 #
21464 # ac_d sets the value in "#define NAME VALUE" lines.
21465 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
21466 ac_dB='[        ].*$,\1#\2'
21467 ac_dC=' '
21468 ac_dD=',;t'
21469 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
21470 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21471 ac_iB='\([      ]\),\1#\2define\3'
21472 ac_iC=' '
21473 ac_iD='\4,;t'
21474 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
21475 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21476 ac_uB='$,\1#\2define\3'
21477 ac_uC=' '
21478 ac_uD=',;t'
21479
21480 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
21481   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21482   case $ac_file in
21483   - | *:- | *:-:* ) # input from stdin
21484         cat >$tmp/stdin
21485         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21486         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21487   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21488         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21489   * )   ac_file_in=$ac_file.in ;;
21490   esac
21491
21492   test x"$ac_file" != x- && { echo "$as_me:21492: creating $ac_file" >&5
21493 echo "$as_me: creating $ac_file" >&6;}
21494
21495   # First look for the input files in the build tree, otherwise in the
21496   # src tree.
21497   ac_file_inputs=`IFS=:
21498     for f in $ac_file_in; do
21499       case $f in
21500       -) echo $tmp/stdin ;;
21501       [\\/$]*)
21502          # Absolute (can't be DOS-style, as IFS=:)
21503          test -f "$f" || { { echo "$as_me:21503: error: cannot find input file: $f" >&5
21504 echo "$as_me: error: cannot find input file: $f" >&2;}
21505    { (exit 1); exit 1; }; }
21506          echo $f;;
21507       *) # Relative
21508          if test -f "$f"; then
21509            # Build tree
21510            echo $f
21511          elif test -f "$srcdir/$f"; then
21512            # Source tree
21513            echo $srcdir/$f
21514          else
21515            # /dev/null tree
21516            { { echo "$as_me:21516: error: cannot find input file: $f" >&5
21517 echo "$as_me: error: cannot find input file: $f" >&2;}
21518    { (exit 1); exit 1; }; }
21519          fi;;
21520       esac
21521     done` || { (exit 1); exit 1; }
21522   # Remove the trailing spaces.
21523   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
21524
21525 EOF
21526
21527 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
21528 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
21529 # be either 'cat' or 'sort'.
21530 cat confdefs.h | uniq >conftest.vals
21531
21532 # Break up conftest.vals because some shells have a limit on
21533 # the size of here documents, and old seds have small limits too.
21534
21535 rm -f conftest.tail
21536 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
21537 while grep . conftest.vals >/dev/null
21538 do
21539   # Write chunks of a limited-size here document to conftest.frag.
21540   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
21541   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
21542   echo 'CEOF' >> $CONFIG_STATUS
21543   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
21544   rm -f conftest.vals
21545   mv conftest.tail conftest.vals
21546 done
21547 rm -f conftest.vals
21548
21549 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
21550 # marker @DEFS@.
21551 echo '  cat >> conftest.edit <<CEOF
21552 /@DEFS@/r conftest.frag
21553 /@DEFS@/d
21554 CEOF
21555 sed -f conftest.edit $tmp/in > $tmp/out
21556 rm -f $tmp/in
21557 mv $tmp/out $tmp/in
21558 rm -f conftest.edit conftest.frag
21559 ' >> $CONFIG_STATUS
21560
21561 cat >>$CONFIG_STATUS <<\EOF
21562   # Let's still pretend it is `configure' which instantiates (i.e., don't
21563   # use $as_me), people would be surprised to read:
21564   #    /* config.h.  Generated automatically by config.status.  */
21565   if test x"$ac_file" = x-; then
21566     echo "/* Generated automatically by configure.  */" >$tmp/config.h
21567   else
21568     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
21569   fi
21570   cat $tmp/in >>$tmp/config.h
21571   rm -f $tmp/in
21572   if test x"$ac_file" != x-; then
21573     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
21574       { echo "$as_me:21574: $ac_file is unchanged" >&5
21575 echo "$as_me: $ac_file is unchanged" >&6;}
21576     else
21577       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21578          X"$ac_file" : 'X\(//\)[^/]' \| \
21579          X"$ac_file" : 'X\(//\)$' \| \
21580          X"$ac_file" : 'X\(/\)' \| \
21581          .     : '\(.\)' 2>/dev/null ||
21582 echo X"$ac_file" |
21583     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21584           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21585           /^X\(\/\/\)$/{ s//\1/; q; }
21586           /^X\(\/\).*/{ s//\1/; q; }
21587           s/.*/./; q'`
21588       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21589         { case "$ac_dir" in
21590   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21591   *)                      as_incr_dir=.;;
21592 esac
21593 as_dummy="$ac_dir"
21594 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21595   case $as_mkdir_dir in
21596     # Skip DOS drivespec
21597     ?:) as_incr_dir=$as_mkdir_dir ;;
21598     *)
21599       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21600       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21601     ;;
21602   esac
21603 done; }
21604
21605       fi
21606       rm -f $ac_file
21607       mv $tmp/config.h $ac_file
21608     fi
21609   else
21610     cat $tmp/config.h
21611     rm -f $tmp/config.h
21612   fi
21613 done
21614 EOF
21615 cat >>$CONFIG_STATUS <<\EOF
21616 #
21617 # CONFIG_COMMANDS section.
21618 #
21619 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
21620   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
21621   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
21622
21623   case $ac_dest in
21624     default )
21625
21626 for cf_dir in .
21627 do
21628         if test ! -d $srcdir/$cf_dir; then
21629                 continue
21630         elif test -f $srcdir/$cf_dir/programs; then
21631                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
21632         fi
21633 done
21634
21635         cat >>Makefile <<TEST_EOF
21636
21637 # These rules are generated so we do not rely on suffix rules, which do not
21638 # work consistently for different make-programs (the '\$(MODEL)/' confuses
21639 # some, and the '\$x' confuses others).
21640 TEST_EOF
21641
21642 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
21643 for N in $LIST
21644 do
21645         cat >>Makefile <<TEST_EOF
21646
21647 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
21648         \$(srcdir)/test.priv.h \\
21649         ncurses_cfg.h
21650         $SHOW_CC
21651         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
21652 TEST_EOF
21653 done
21654
21655 if test -f ../config.guess && test -f ../config.sub
21656 then
21657         cat >>Makefile <<TEST_EOF
21658
21659 # if we used CF_INHERIT for getting these files, we can remove them
21660 distclean::
21661         rm -f config.guess config.sub
21662 TEST_EOF
21663 fi
21664  ;;
21665   esac
21666 done
21667 EOF
21668
21669 cat >>$CONFIG_STATUS <<\EOF
21670
21671 { (exit 0); exit 0; }
21672 EOF
21673 chmod +x $CONFIG_STATUS
21674 ac_clean_files=$ac_clean_files_save
21675
21676 # configure is writing to config.log, and then calls config.status.
21677 # config.status does its own redirection, appending to config.log.
21678 # Unfortunately, on DOS this fails, as config.log is still kept open
21679 # by configure, so config.status won't be able to write to it; its
21680 # output is simply discarded.  So we exec the FD to /dev/null,
21681 # effectively closing config.log, so it can be properly (re)opened and
21682 # appended to by config.status.  When coming back to configure, we
21683 # need to make the FD available again.
21684 if test "$no_create" != yes; then
21685   ac_cs_success=:
21686   exec 5>/dev/null
21687   $SHELL $CONFIG_STATUS || ac_cs_success=false
21688   exec 5>>config.log
21689   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
21690   # would make configure fail if this is the last instruction.
21691   $ac_cs_success || { (exit 1); exit 1; }
21692 fi
21693