]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
85ddca71e6f1cc35266f8706791d1a1b5f50b2c3
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20190901.
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.20190901.  Invocation command line was
769
770   $ $0 $@
771
772 EOF
773 {
774 cat <<_ASUNAME
775 ## ---------- ##
776 ## Platform.  ##
777 ## ---------- ##
778
779 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
780 uname -m = `(uname -m) 2>/dev/null || echo unknown`
781 uname -r = `(uname -r) 2>/dev/null || echo unknown`
782 uname -s = `(uname -s) 2>/dev/null || echo unknown`
783 uname -v = `(uname -v) 2>/dev/null || echo unknown`
784
785 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
786 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
787
788 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
789 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
790 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
791 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
792 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
793 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
794 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
795
796 PATH = $PATH
797
798 _ASUNAME
799 } >&5
800
801 cat >&5 <<EOF
802 ## ------------ ##
803 ## Core tests.  ##
804 ## ------------ ##
805
806 EOF
807
808 # Keep a trace of the command line.
809 # Strip out --no-create and --no-recursion so they do not pile up.
810 # Also quote any args containing shell meta-characters.
811 ac_configure_args=
812 ac_sep=
813 for ac_arg
814 do
815   case $ac_arg in
816   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
817   | --no-cr | --no-c) ;;
818   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
819   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
820   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
821     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
822     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
823     ac_sep=" " ;;
824   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
825      ac_sep=" " ;;
826   esac
827   # Get rid of the leading space.
828 done
829
830 # When interrupted or exit'd, cleanup temporary files, and complete
831 # config.log.  We remove comments because anyway the quotes in there
832 # would cause problems or look ugly.
833 trap 'exit_status=$?
834   # Save into config.log some information that might help in debugging.
835   echo >&5
836   echo "## ----------------- ##" >&5
837   echo "## Cache variables.  ##" >&5
838   echo "## ----------------- ##" >&5
839   echo >&5
840   # The following way of writing the cache mishandles newlines in values,
841 {
842   (set) 2>&1 |
843     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
844     *ac_space=\ *)
845       sed -n \
846         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
847           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
848       ;;
849     *)
850       sed -n \
851         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
852       ;;
853     esac;
854 } >&5
855   sed "/^$/d" confdefs.h >conftest.log
856   if test -s conftest.log; then
857     echo >&5
858     echo "## ------------ ##" >&5
859     echo "## confdefs.h.  ##" >&5
860     echo "## ------------ ##" >&5
861     echo >&5
862     cat conftest.log >&5
863   fi
864   (echo; echo) >&5
865   test "$ac_signal" != 0 &&
866     echo "$as_me: caught signal $ac_signal" >&5
867   echo "$as_me: exit $exit_status" >&5
868   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
869     exit $exit_status
870      ' 0
871 for ac_signal in 1 2 13 15; do
872   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
873 done
874 ac_signal=0
875
876 # confdefs.h avoids OS command line length limits that DEFS can exceed.
877 rm -rf conftest* confdefs.h
878 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
879 echo >confdefs.h
880
881 # Let the site file select an alternate cache file if it wants to.
882 # Prefer explicitly selected file to automatically selected ones.
883 if test -z "$CONFIG_SITE"; then
884   if test "x$prefix" != xNONE; then
885     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
886   else
887     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
888   fi
889 fi
890 for ac_site_file in $CONFIG_SITE; do
891   if test -r "$ac_site_file"; then
892     { echo "$as_me:892: loading site script $ac_site_file" >&5
893 echo "$as_me: loading site script $ac_site_file" >&6;}
894     cat "$ac_site_file" >&5
895     . "$ac_site_file"
896   fi
897 done
898
899 if test -r "$cache_file"; then
900   # Some versions of bash will fail to source /dev/null (special
901   # files actually), so we avoid doing that.
902   if test -f "$cache_file"; then
903     { echo "$as_me:903: loading cache $cache_file" >&5
904 echo "$as_me: loading cache $cache_file" >&6;}
905     case $cache_file in
906       [\\/]* | ?:[\\/]* ) . $cache_file;;
907       *)                      . ./$cache_file;;
908     esac
909   fi
910 else
911   { echo "$as_me:911: creating cache $cache_file" >&5
912 echo "$as_me: creating cache $cache_file" >&6;}
913   >$cache_file
914 fi
915
916 # Check that the precious variables saved in the cache have kept the same
917 # value.
918 ac_cache_corrupted=false
919 for ac_var in `(set) 2>&1 |
920                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
921   eval ac_old_set=\$ac_cv_env_${ac_var}_set
922   eval ac_new_set=\$ac_env_${ac_var}_set
923   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
924   eval ac_new_val="\$ac_env_${ac_var}_value"
925   case $ac_old_set,$ac_new_set in
926     set,)
927       { echo "$as_me:927: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
928 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
929       ac_cache_corrupted=: ;;
930     ,set)
931       { echo "$as_me:931: error: \`$ac_var' was not set in the previous run" >&5
932 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
933       ac_cache_corrupted=: ;;
934     ,);;
935     *)
936       if test "x$ac_old_val" != "x$ac_new_val"; then
937         { echo "$as_me:937: error: \`$ac_var' has changed since the previous run:" >&5
938 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
939         { echo "$as_me:939:   former value:  $ac_old_val" >&5
940 echo "$as_me:   former value:  $ac_old_val" >&2;}
941         { echo "$as_me:941:   current value: $ac_new_val" >&5
942 echo "$as_me:   current value: $ac_new_val" >&2;}
943         ac_cache_corrupted=:
944       fi;;
945   esac
946   # Pass precious variables to config.status.  It doesn't matter if
947   # we pass some twice (in addition to the command line arguments).
948   if test "$ac_new_set" = set; then
949     case $ac_new_val in
950     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
951       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
952       ac_configure_args="$ac_configure_args '$ac_arg'"
953       ;;
954     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
955        ;;
956     esac
957   fi
958 done
959 if $ac_cache_corrupted; then
960   { echo "$as_me:960: error: changes in the environment can compromise the build" >&5
961 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
962   { { echo "$as_me:962: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
963 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
964    { (exit 1); exit 1; }; }
965 fi
966
967 ac_ext=c
968 ac_cpp='$CPP $CPPFLAGS'
969 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
970 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
971 ac_compiler_gnu=$ac_cv_c_compiler_gnu
972 ac_main_return=return
973
974 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
975   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
976                    ECHO_T='     ' ;;
977   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
978   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
979 esac
980 echo "#! $SHELL" >conftest.sh
981 echo  "exit 0"   >>conftest.sh
982 chmod +x conftest.sh
983 if { (echo "$as_me:983: PATH=\".;.\"; conftest.sh") >&5
984   (PATH=".;."; conftest.sh) 2>&5
985   ac_status=$?
986   echo "$as_me:986: \$? = $ac_status" >&5
987   (exit $ac_status); }; then
988   ac_path_separator=';'
989 else
990   ac_path_separator=:
991 fi
992 PATH_SEPARATOR="$ac_path_separator"
993 rm -f conftest.sh
994
995 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
996
997 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
998
999 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1000
1001 ac_aux_dir=
1002 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1003   if test -f $ac_dir/install-sh; then
1004     ac_aux_dir=$ac_dir
1005     ac_install_sh="$ac_aux_dir/install-sh -c"
1006     break
1007   elif test -f $ac_dir/install.sh; then
1008     ac_aux_dir=$ac_dir
1009     ac_install_sh="$ac_aux_dir/install.sh -c"
1010     break
1011   elif test -f $ac_dir/shtool; then
1012     ac_aux_dir=$ac_dir
1013     ac_install_sh="$ac_aux_dir/shtool install -c"
1014     break
1015   fi
1016 done
1017 if test -z "$ac_aux_dir"; then
1018   { { echo "$as_me:1018: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1019 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1020    { (exit 1); exit 1; }; }
1021 fi
1022 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1023 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1024 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1025
1026 # Make sure we can run config.sub.
1027 $ac_config_sub sun4 >/dev/null 2>&1 ||
1028   { { echo "$as_me:1028: error: cannot run $ac_config_sub" >&5
1029 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 echo "$as_me:1032: checking build system type" >&5
1033 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1034 if test "${ac_cv_build+set}" = set; then
1035   echo $ECHO_N "(cached) $ECHO_C" >&6
1036 else
1037   ac_cv_build_alias=$build_alias
1038 test -z "$ac_cv_build_alias" &&
1039   ac_cv_build_alias=`$ac_config_guess`
1040 test -z "$ac_cv_build_alias" &&
1041   { { echo "$as_me:1041: error: cannot guess build type; you must specify one" >&5
1042 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1043    { (exit 1); exit 1; }; }
1044 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1045   { { echo "$as_me:1045: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1046 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1047    { (exit 1); exit 1; }; }
1048
1049 fi
1050 echo "$as_me:1050: result: $ac_cv_build" >&5
1051 echo "${ECHO_T}$ac_cv_build" >&6
1052 build=$ac_cv_build
1053 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1054 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1055 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1056
1057 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1058         echo "$as_me:1058: checking host system type" >&5
1059 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1060 if test "${ac_cv_host+set}" = set; then
1061   echo $ECHO_N "(cached) $ECHO_C" >&6
1062 else
1063   ac_cv_host_alias=$host_alias
1064 test -z "$ac_cv_host_alias" &&
1065   ac_cv_host_alias=$ac_cv_build_alias
1066 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1067   { { echo "$as_me:1067: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1068 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 fi
1072 echo "$as_me:1072: result: $ac_cv_host" >&5
1073 echo "${ECHO_T}$ac_cv_host" >&6
1074 host=$ac_cv_host
1075 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1076 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1077 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1078
1079         system_name="$host_os"
1080 else
1081         system_name="`(uname -s -r) 2>/dev/null`"
1082         if test -z "$system_name" ; then
1083                 system_name="`(hostname) 2>/dev/null`"
1084         fi
1085 fi
1086 test -n "$system_name" &&
1087 cat >>confdefs.h <<EOF
1088 #define SYSTEM_NAME "$system_name"
1089 EOF
1090
1091 if test "${cf_cv_system_name+set}" = set; then
1092   echo $ECHO_N "(cached) $ECHO_C" >&6
1093 else
1094   cf_cv_system_name="$system_name"
1095 fi
1096
1097 test -z "$system_name" && system_name="$cf_cv_system_name"
1098 test -n "$cf_cv_system_name" && echo "$as_me:1098: result: Configuring for $cf_cv_system_name" >&5
1099 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1100
1101 if test ".$system_name" != ".$cf_cv_system_name" ; then
1102         echo "$as_me:1102: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1103 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1104         { { echo "$as_me:1104: error: \"Please remove config.cache and try again.\"" >&5
1105 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1106    { (exit 1); exit 1; }; }
1107 fi
1108
1109 test "$program_prefix" != NONE &&
1110   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1111 # Use a double $ so make ignores it.
1112 test "$program_suffix" != NONE &&
1113   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1114 # Double any \ or $.  echo might interpret backslashes.
1115 # By default was `s,x,x', remove it if useless.
1116 cat <<\_ACEOF >conftest.sed
1117 s/[\\$]/&&/g;s/;s,x,x,$//
1118 _ACEOF
1119 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1120 rm conftest.sed
1121
1122 echo "$as_me:1122: checking whether ${MAKE-make} sets \${MAKE}" >&5
1123 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1124 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1125 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1126   echo $ECHO_N "(cached) $ECHO_C" >&6
1127 else
1128   cat >conftest.make <<\EOF
1129 all:
1130         @echo 'ac_maketemp="${MAKE}"'
1131 EOF
1132 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1133 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1134 if test -n "$ac_maketemp"; then
1135   eval ac_cv_prog_make_${ac_make}_set=yes
1136 else
1137   eval ac_cv_prog_make_${ac_make}_set=no
1138 fi
1139 rm -f conftest.make
1140 fi
1141 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1142   echo "$as_me:1142: result: yes" >&5
1143 echo "${ECHO_T}yes" >&6
1144   SET_MAKE=
1145 else
1146   echo "$as_me:1146: result: no" >&5
1147 echo "${ECHO_T}no" >&6
1148   SET_MAKE="MAKE=${MAKE-make}"
1149 fi
1150
1151 ac_ext=c
1152 ac_cpp='$CPP $CPPFLAGS'
1153 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1154 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1155 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1156 ac_main_return=return
1157 if test -n "$ac_tool_prefix"; then
1158   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1159 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1160 echo "$as_me:1160: checking for $ac_word" >&5
1161 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1162 if test "${ac_cv_prog_CC+set}" = set; then
1163   echo $ECHO_N "(cached) $ECHO_C" >&6
1164 else
1165   if test -n "$CC"; then
1166   ac_cv_prog_CC="$CC" # Let the user override the test.
1167 else
1168   ac_save_IFS=$IFS; IFS=$ac_path_separator
1169 ac_dummy="$PATH"
1170 for ac_dir in $ac_dummy; do
1171   IFS=$ac_save_IFS
1172   test -z "$ac_dir" && ac_dir=.
1173   $as_executable_p "$ac_dir/$ac_word" || continue
1174 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1175 echo "$as_me:1175: found $ac_dir/$ac_word" >&5
1176 break
1177 done
1178
1179 fi
1180 fi
1181 CC=$ac_cv_prog_CC
1182 if test -n "$CC"; then
1183   echo "$as_me:1183: result: $CC" >&5
1184 echo "${ECHO_T}$CC" >&6
1185 else
1186   echo "$as_me:1186: result: no" >&5
1187 echo "${ECHO_T}no" >&6
1188 fi
1189
1190 fi
1191 if test -z "$ac_cv_prog_CC"; then
1192   ac_ct_CC=$CC
1193   # Extract the first word of "gcc", so it can be a program name with args.
1194 set dummy gcc; ac_word=$2
1195 echo "$as_me:1195: checking for $ac_word" >&5
1196 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1197 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1198   echo $ECHO_N "(cached) $ECHO_C" >&6
1199 else
1200   if test -n "$ac_ct_CC"; then
1201   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1202 else
1203   ac_save_IFS=$IFS; IFS=$ac_path_separator
1204 ac_dummy="$PATH"
1205 for ac_dir in $ac_dummy; do
1206   IFS=$ac_save_IFS
1207   test -z "$ac_dir" && ac_dir=.
1208   $as_executable_p "$ac_dir/$ac_word" || continue
1209 ac_cv_prog_ac_ct_CC="gcc"
1210 echo "$as_me:1210: found $ac_dir/$ac_word" >&5
1211 break
1212 done
1213
1214 fi
1215 fi
1216 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1217 if test -n "$ac_ct_CC"; then
1218   echo "$as_me:1218: result: $ac_ct_CC" >&5
1219 echo "${ECHO_T}$ac_ct_CC" >&6
1220 else
1221   echo "$as_me:1221: result: no" >&5
1222 echo "${ECHO_T}no" >&6
1223 fi
1224
1225   CC=$ac_ct_CC
1226 else
1227   CC="$ac_cv_prog_CC"
1228 fi
1229
1230 if test -z "$CC"; then
1231   if test -n "$ac_tool_prefix"; then
1232   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1233 set dummy ${ac_tool_prefix}cc; ac_word=$2
1234 echo "$as_me:1234: checking for $ac_word" >&5
1235 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1236 if test "${ac_cv_prog_CC+set}" = set; then
1237   echo $ECHO_N "(cached) $ECHO_C" >&6
1238 else
1239   if test -n "$CC"; then
1240   ac_cv_prog_CC="$CC" # Let the user override the test.
1241 else
1242   ac_save_IFS=$IFS; IFS=$ac_path_separator
1243 ac_dummy="$PATH"
1244 for ac_dir in $ac_dummy; do
1245   IFS=$ac_save_IFS
1246   test -z "$ac_dir" && ac_dir=.
1247   $as_executable_p "$ac_dir/$ac_word" || continue
1248 ac_cv_prog_CC="${ac_tool_prefix}cc"
1249 echo "$as_me:1249: found $ac_dir/$ac_word" >&5
1250 break
1251 done
1252
1253 fi
1254 fi
1255 CC=$ac_cv_prog_CC
1256 if test -n "$CC"; then
1257   echo "$as_me:1257: result: $CC" >&5
1258 echo "${ECHO_T}$CC" >&6
1259 else
1260   echo "$as_me:1260: result: no" >&5
1261 echo "${ECHO_T}no" >&6
1262 fi
1263
1264 fi
1265 if test -z "$ac_cv_prog_CC"; then
1266   ac_ct_CC=$CC
1267   # Extract the first word of "cc", so it can be a program name with args.
1268 set dummy cc; ac_word=$2
1269 echo "$as_me:1269: checking for $ac_word" >&5
1270 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1271 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1272   echo $ECHO_N "(cached) $ECHO_C" >&6
1273 else
1274   if test -n "$ac_ct_CC"; then
1275   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1276 else
1277   ac_save_IFS=$IFS; IFS=$ac_path_separator
1278 ac_dummy="$PATH"
1279 for ac_dir in $ac_dummy; do
1280   IFS=$ac_save_IFS
1281   test -z "$ac_dir" && ac_dir=.
1282   $as_executable_p "$ac_dir/$ac_word" || continue
1283 ac_cv_prog_ac_ct_CC="cc"
1284 echo "$as_me:1284: found $ac_dir/$ac_word" >&5
1285 break
1286 done
1287
1288 fi
1289 fi
1290 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1291 if test -n "$ac_ct_CC"; then
1292   echo "$as_me:1292: result: $ac_ct_CC" >&5
1293 echo "${ECHO_T}$ac_ct_CC" >&6
1294 else
1295   echo "$as_me:1295: result: no" >&5
1296 echo "${ECHO_T}no" >&6
1297 fi
1298
1299   CC=$ac_ct_CC
1300 else
1301   CC="$ac_cv_prog_CC"
1302 fi
1303
1304 fi
1305 if test -z "$CC"; then
1306   # Extract the first word of "cc", so it can be a program name with args.
1307 set dummy cc; ac_word=$2
1308 echo "$as_me:1308: checking for $ac_word" >&5
1309 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1310 if test "${ac_cv_prog_CC+set}" = set; then
1311   echo $ECHO_N "(cached) $ECHO_C" >&6
1312 else
1313   if test -n "$CC"; then
1314   ac_cv_prog_CC="$CC" # Let the user override the test.
1315 else
1316   ac_prog_rejected=no
1317   ac_save_IFS=$IFS; IFS=$ac_path_separator
1318 ac_dummy="$PATH"
1319 for ac_dir in $ac_dummy; do
1320   IFS=$ac_save_IFS
1321   test -z "$ac_dir" && ac_dir=.
1322   $as_executable_p "$ac_dir/$ac_word" || continue
1323 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1324   ac_prog_rejected=yes
1325   continue
1326 fi
1327 ac_cv_prog_CC="cc"
1328 echo "$as_me:1328: found $ac_dir/$ac_word" >&5
1329 break
1330 done
1331
1332 if test $ac_prog_rejected = yes; then
1333   # We found a bogon in the path, so make sure we never use it.
1334   set dummy $ac_cv_prog_CC
1335   shift
1336   if test $# != 0; then
1337     # We chose a different compiler from the bogus one.
1338     # However, it has the same basename, so the bogon will be chosen
1339     # first if we set CC to just the basename; use the full file name.
1340     shift
1341     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1342     shift
1343     ac_cv_prog_CC="$@"
1344   fi
1345 fi
1346 fi
1347 fi
1348 CC=$ac_cv_prog_CC
1349 if test -n "$CC"; then
1350   echo "$as_me:1350: result: $CC" >&5
1351 echo "${ECHO_T}$CC" >&6
1352 else
1353   echo "$as_me:1353: result: no" >&5
1354 echo "${ECHO_T}no" >&6
1355 fi
1356
1357 fi
1358 if test -z "$CC"; then
1359   if test -n "$ac_tool_prefix"; then
1360   for ac_prog in cl
1361   do
1362     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1363 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1364 echo "$as_me:1364: checking for $ac_word" >&5
1365 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1366 if test "${ac_cv_prog_CC+set}" = set; then
1367   echo $ECHO_N "(cached) $ECHO_C" >&6
1368 else
1369   if test -n "$CC"; then
1370   ac_cv_prog_CC="$CC" # Let the user override the test.
1371 else
1372   ac_save_IFS=$IFS; IFS=$ac_path_separator
1373 ac_dummy="$PATH"
1374 for ac_dir in $ac_dummy; do
1375   IFS=$ac_save_IFS
1376   test -z "$ac_dir" && ac_dir=.
1377   $as_executable_p "$ac_dir/$ac_word" || continue
1378 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1379 echo "$as_me:1379: found $ac_dir/$ac_word" >&5
1380 break
1381 done
1382
1383 fi
1384 fi
1385 CC=$ac_cv_prog_CC
1386 if test -n "$CC"; then
1387   echo "$as_me:1387: result: $CC" >&5
1388 echo "${ECHO_T}$CC" >&6
1389 else
1390   echo "$as_me:1390: result: no" >&5
1391 echo "${ECHO_T}no" >&6
1392 fi
1393
1394     test -n "$CC" && break
1395   done
1396 fi
1397 if test -z "$CC"; then
1398   ac_ct_CC=$CC
1399   for ac_prog in cl
1400 do
1401   # Extract the first word of "$ac_prog", so it can be a program name with args.
1402 set dummy $ac_prog; ac_word=$2
1403 echo "$as_me:1403: checking for $ac_word" >&5
1404 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1405 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1406   echo $ECHO_N "(cached) $ECHO_C" >&6
1407 else
1408   if test -n "$ac_ct_CC"; then
1409   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1410 else
1411   ac_save_IFS=$IFS; IFS=$ac_path_separator
1412 ac_dummy="$PATH"
1413 for ac_dir in $ac_dummy; do
1414   IFS=$ac_save_IFS
1415   test -z "$ac_dir" && ac_dir=.
1416   $as_executable_p "$ac_dir/$ac_word" || continue
1417 ac_cv_prog_ac_ct_CC="$ac_prog"
1418 echo "$as_me:1418: found $ac_dir/$ac_word" >&5
1419 break
1420 done
1421
1422 fi
1423 fi
1424 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1425 if test -n "$ac_ct_CC"; then
1426   echo "$as_me:1426: result: $ac_ct_CC" >&5
1427 echo "${ECHO_T}$ac_ct_CC" >&6
1428 else
1429   echo "$as_me:1429: result: no" >&5
1430 echo "${ECHO_T}no" >&6
1431 fi
1432
1433   test -n "$ac_ct_CC" && break
1434 done
1435
1436   CC=$ac_ct_CC
1437 fi
1438
1439 fi
1440
1441 test -z "$CC" && { { echo "$as_me:1441: error: no acceptable cc found in \$PATH" >&5
1442 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1443    { (exit 1); exit 1; }; }
1444
1445 # Provide some information about the compiler.
1446 echo "$as_me:1446:" \
1447      "checking for C compiler version" >&5
1448 ac_compiler=`set X $ac_compile; echo $2`
1449 { (eval echo "$as_me:1449: \"$ac_compiler --version </dev/null >&5\"") >&5
1450   (eval $ac_compiler --version </dev/null >&5) 2>&5
1451   ac_status=$?
1452   echo "$as_me:1452: \$? = $ac_status" >&5
1453   (exit $ac_status); }
1454 { (eval echo "$as_me:1454: \"$ac_compiler -v </dev/null >&5\"") >&5
1455   (eval $ac_compiler -v </dev/null >&5) 2>&5
1456   ac_status=$?
1457   echo "$as_me:1457: \$? = $ac_status" >&5
1458   (exit $ac_status); }
1459 { (eval echo "$as_me:1459: \"$ac_compiler -V </dev/null >&5\"") >&5
1460   (eval $ac_compiler -V </dev/null >&5) 2>&5
1461   ac_status=$?
1462   echo "$as_me:1462: \$? = $ac_status" >&5
1463   (exit $ac_status); }
1464
1465 cat >conftest.$ac_ext <<_ACEOF
1466 #line 1466 "configure"
1467 #include "confdefs.h"
1468
1469 int
1470 main (void)
1471 {
1472
1473   ;
1474   return 0;
1475 }
1476 _ACEOF
1477 ac_clean_files_save=$ac_clean_files
1478 ac_clean_files="$ac_clean_files a.out a.exe"
1479 # Try to create an executable without -o first, disregard a.out.
1480 # It will help us diagnose broken compilers, and finding out an intuition
1481 # of exeext.
1482 echo "$as_me:1482: checking for C compiler default output" >&5
1483 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1484 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1485 if { (eval echo "$as_me:1485: \"$ac_link_default\"") >&5
1486   (eval $ac_link_default) 2>&5
1487   ac_status=$?
1488   echo "$as_me:1488: \$? = $ac_status" >&5
1489   (exit $ac_status); }; then
1490   # Find the output, starting from the most likely.  This scheme is
1491 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1492 # resort.
1493 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1494                 ls a.out conftest 2>/dev/null;
1495                 ls a.* conftest.* 2>/dev/null`; do
1496   case $ac_file in
1497     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1498     a.out ) # We found the default executable, but exeext='' is most
1499             # certainly right.
1500             break;;
1501     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1502           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1503           export ac_cv_exeext
1504           break;;
1505     * ) break;;
1506   esac
1507 done
1508 else
1509   echo "$as_me: failed program was:" >&5
1510 cat conftest.$ac_ext >&5
1511 { { echo "$as_me:1511: error: C compiler cannot create executables" >&5
1512 echo "$as_me: error: C compiler cannot create executables" >&2;}
1513    { (exit 77); exit 77; }; }
1514 fi
1515
1516 ac_exeext=$ac_cv_exeext
1517 echo "$as_me:1517: result: $ac_file" >&5
1518 echo "${ECHO_T}$ac_file" >&6
1519
1520 # Check the compiler produces executables we can run.  If not, either
1521 # the compiler is broken, or we cross compile.
1522 echo "$as_me:1522: checking whether the C compiler works" >&5
1523 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1524 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1525 # If not cross compiling, check that we can run a simple program.
1526 if test "$cross_compiling" != yes; then
1527   if { ac_try='./$ac_file'
1528   { (eval echo "$as_me:1528: \"$ac_try\"") >&5
1529   (eval $ac_try) 2>&5
1530   ac_status=$?
1531   echo "$as_me:1531: \$? = $ac_status" >&5
1532   (exit $ac_status); }; }; then
1533     cross_compiling=no
1534   else
1535     if test "$cross_compiling" = maybe; then
1536         cross_compiling=yes
1537     else
1538         { { echo "$as_me:1538: error: cannot run C compiled programs.
1539 If you meant to cross compile, use \`--host'." >&5
1540 echo "$as_me: error: cannot run C compiled programs.
1541 If you meant to cross compile, use \`--host'." >&2;}
1542    { (exit 1); exit 1; }; }
1543     fi
1544   fi
1545 fi
1546 echo "$as_me:1546: result: yes" >&5
1547 echo "${ECHO_T}yes" >&6
1548
1549 rm -f a.out a.exe conftest$ac_cv_exeext
1550 ac_clean_files=$ac_clean_files_save
1551 # Check the compiler produces executables we can run.  If not, either
1552 # the compiler is broken, or we cross compile.
1553 echo "$as_me:1553: checking whether we are cross compiling" >&5
1554 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1555 echo "$as_me:1555: result: $cross_compiling" >&5
1556 echo "${ECHO_T}$cross_compiling" >&6
1557
1558 echo "$as_me:1558: checking for executable suffix" >&5
1559 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1560 if { (eval echo "$as_me:1560: \"$ac_link\"") >&5
1561   (eval $ac_link) 2>&5
1562   ac_status=$?
1563   echo "$as_me:1563: \$? = $ac_status" >&5
1564   (exit $ac_status); }; then
1565   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1566 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1567 # work properly (i.e., refer to `conftest.exe'), while it won't with
1568 # `rm'.
1569 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1570   case $ac_file in
1571     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1572     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1573           export ac_cv_exeext
1574           break;;
1575     * ) break;;
1576   esac
1577 done
1578 else
1579   { { echo "$as_me:1579: error: cannot compute EXEEXT: cannot compile and link" >&5
1580 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1581    { (exit 1); exit 1; }; }
1582 fi
1583
1584 rm -f conftest$ac_cv_exeext
1585 echo "$as_me:1585: result: $ac_cv_exeext" >&5
1586 echo "${ECHO_T}$ac_cv_exeext" >&6
1587
1588 rm -f conftest.$ac_ext
1589 EXEEXT=$ac_cv_exeext
1590 ac_exeext=$EXEEXT
1591 echo "$as_me:1591: checking for object suffix" >&5
1592 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1593 if test "${ac_cv_objext+set}" = set; then
1594   echo $ECHO_N "(cached) $ECHO_C" >&6
1595 else
1596   cat >conftest.$ac_ext <<_ACEOF
1597 #line 1597 "configure"
1598 #include "confdefs.h"
1599
1600 int
1601 main (void)
1602 {
1603
1604   ;
1605   return 0;
1606 }
1607 _ACEOF
1608 rm -f conftest.o conftest.obj
1609 if { (eval echo "$as_me:1609: \"$ac_compile\"") >&5
1610   (eval $ac_compile) 2>&5
1611   ac_status=$?
1612   echo "$as_me:1612: \$? = $ac_status" >&5
1613   (exit $ac_status); }; then
1614   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1615   case $ac_file in
1616     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1617     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1618        break;;
1619   esac
1620 done
1621 else
1622   echo "$as_me: failed program was:" >&5
1623 cat conftest.$ac_ext >&5
1624 { { echo "$as_me:1624: error: cannot compute OBJEXT: cannot compile" >&5
1625 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1626    { (exit 1); exit 1; }; }
1627 fi
1628
1629 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1630 fi
1631 echo "$as_me:1631: result: $ac_cv_objext" >&5
1632 echo "${ECHO_T}$ac_cv_objext" >&6
1633 OBJEXT=$ac_cv_objext
1634 ac_objext=$OBJEXT
1635 echo "$as_me:1635: checking whether we are using the GNU C compiler" >&5
1636 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1637 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1638   echo $ECHO_N "(cached) $ECHO_C" >&6
1639 else
1640   cat >conftest.$ac_ext <<_ACEOF
1641 #line 1641 "configure"
1642 #include "confdefs.h"
1643
1644 int
1645 main (void)
1646 {
1647 #ifndef __GNUC__
1648        choke me
1649 #endif
1650
1651   ;
1652   return 0;
1653 }
1654 _ACEOF
1655 rm -f conftest.$ac_objext
1656 if { (eval echo "$as_me:1656: \"$ac_compile\"") >&5
1657   (eval $ac_compile) 2>&5
1658   ac_status=$?
1659   echo "$as_me:1659: \$? = $ac_status" >&5
1660   (exit $ac_status); } &&
1661          { ac_try='test -s conftest.$ac_objext'
1662   { (eval echo "$as_me:1662: \"$ac_try\"") >&5
1663   (eval $ac_try) 2>&5
1664   ac_status=$?
1665   echo "$as_me:1665: \$? = $ac_status" >&5
1666   (exit $ac_status); }; }; then
1667   ac_compiler_gnu=yes
1668 else
1669   echo "$as_me: failed program was:" >&5
1670 cat conftest.$ac_ext >&5
1671 ac_compiler_gnu=no
1672 fi
1673 rm -f conftest.$ac_objext conftest.$ac_ext
1674 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1675
1676 fi
1677 echo "$as_me:1677: result: $ac_cv_c_compiler_gnu" >&5
1678 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1679 GCC=`test $ac_compiler_gnu = yes && echo yes`
1680 ac_test_CFLAGS=${CFLAGS+set}
1681 ac_save_CFLAGS=$CFLAGS
1682 CFLAGS="-g"
1683 echo "$as_me:1683: checking whether $CC accepts -g" >&5
1684 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1685 if test "${ac_cv_prog_cc_g+set}" = set; then
1686   echo $ECHO_N "(cached) $ECHO_C" >&6
1687 else
1688   cat >conftest.$ac_ext <<_ACEOF
1689 #line 1689 "configure"
1690 #include "confdefs.h"
1691
1692 int
1693 main (void)
1694 {
1695
1696   ;
1697   return 0;
1698 }
1699 _ACEOF
1700 rm -f conftest.$ac_objext
1701 if { (eval echo "$as_me:1701: \"$ac_compile\"") >&5
1702   (eval $ac_compile) 2>&5
1703   ac_status=$?
1704   echo "$as_me:1704: \$? = $ac_status" >&5
1705   (exit $ac_status); } &&
1706          { ac_try='test -s conftest.$ac_objext'
1707   { (eval echo "$as_me:1707: \"$ac_try\"") >&5
1708   (eval $ac_try) 2>&5
1709   ac_status=$?
1710   echo "$as_me:1710: \$? = $ac_status" >&5
1711   (exit $ac_status); }; }; then
1712   ac_cv_prog_cc_g=yes
1713 else
1714   echo "$as_me: failed program was:" >&5
1715 cat conftest.$ac_ext >&5
1716 ac_cv_prog_cc_g=no
1717 fi
1718 rm -f conftest.$ac_objext conftest.$ac_ext
1719 fi
1720 echo "$as_me:1720: result: $ac_cv_prog_cc_g" >&5
1721 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1722 if test "$ac_test_CFLAGS" = set; then
1723   CFLAGS=$ac_save_CFLAGS
1724 elif test $ac_cv_prog_cc_g = yes; then
1725   if test "$GCC" = yes; then
1726     CFLAGS="-g -O2"
1727   else
1728     CFLAGS="-g"
1729   fi
1730 else
1731   if test "$GCC" = yes; then
1732     CFLAGS="-O2"
1733   else
1734     CFLAGS=
1735   fi
1736 fi
1737 # Some people use a C++ compiler to compile C.  Since we use `exit',
1738 # in C++ we need to declare it.  In case someone uses the same compiler
1739 # for both compiling C and C++ we need to have the C++ compiler decide
1740 # the declaration of exit, since it's the most demanding environment.
1741 cat >conftest.$ac_ext <<_ACEOF
1742 #ifndef __cplusplus
1743   choke me
1744 #endif
1745 _ACEOF
1746 rm -f conftest.$ac_objext
1747 if { (eval echo "$as_me:1747: \"$ac_compile\"") >&5
1748   (eval $ac_compile) 2>&5
1749   ac_status=$?
1750   echo "$as_me:1750: \$? = $ac_status" >&5
1751   (exit $ac_status); } &&
1752          { ac_try='test -s conftest.$ac_objext'
1753   { (eval echo "$as_me:1753: \"$ac_try\"") >&5
1754   (eval $ac_try) 2>&5
1755   ac_status=$?
1756   echo "$as_me:1756: \$? = $ac_status" >&5
1757   (exit $ac_status); }; }; then
1758   for ac_declaration in \
1759    ''\
1760    '#include <stdlib.h>' \
1761    'extern "C" void std::exit (int) throw (); using std::exit;' \
1762    'extern "C" void std::exit (int); using std::exit;' \
1763    'extern "C" void exit (int) throw ();' \
1764    'extern "C" void exit (int);' \
1765    'void exit (int);'
1766 do
1767   cat >conftest.$ac_ext <<_ACEOF
1768 #line 1768 "configure"
1769 #include "confdefs.h"
1770 #include <stdlib.h>
1771 $ac_declaration
1772 int
1773 main (void)
1774 {
1775 exit (42);
1776   ;
1777   return 0;
1778 }
1779 _ACEOF
1780 rm -f conftest.$ac_objext
1781 if { (eval echo "$as_me:1781: \"$ac_compile\"") >&5
1782   (eval $ac_compile) 2>&5
1783   ac_status=$?
1784   echo "$as_me:1784: \$? = $ac_status" >&5
1785   (exit $ac_status); } &&
1786          { ac_try='test -s conftest.$ac_objext'
1787   { (eval echo "$as_me:1787: \"$ac_try\"") >&5
1788   (eval $ac_try) 2>&5
1789   ac_status=$?
1790   echo "$as_me:1790: \$? = $ac_status" >&5
1791   (exit $ac_status); }; }; then
1792   :
1793 else
1794   echo "$as_me: failed program was:" >&5
1795 cat conftest.$ac_ext >&5
1796 continue
1797 fi
1798 rm -f conftest.$ac_objext conftest.$ac_ext
1799   cat >conftest.$ac_ext <<_ACEOF
1800 #line 1800 "configure"
1801 #include "confdefs.h"
1802 $ac_declaration
1803 int
1804 main (void)
1805 {
1806 exit (42);
1807   ;
1808   return 0;
1809 }
1810 _ACEOF
1811 rm -f conftest.$ac_objext
1812 if { (eval echo "$as_me:1812: \"$ac_compile\"") >&5
1813   (eval $ac_compile) 2>&5
1814   ac_status=$?
1815   echo "$as_me:1815: \$? = $ac_status" >&5
1816   (exit $ac_status); } &&
1817          { ac_try='test -s conftest.$ac_objext'
1818   { (eval echo "$as_me:1818: \"$ac_try\"") >&5
1819   (eval $ac_try) 2>&5
1820   ac_status=$?
1821   echo "$as_me:1821: \$? = $ac_status" >&5
1822   (exit $ac_status); }; }; then
1823   break
1824 else
1825   echo "$as_me: failed program was:" >&5
1826 cat conftest.$ac_ext >&5
1827 fi
1828 rm -f conftest.$ac_objext conftest.$ac_ext
1829 done
1830 rm -rf conftest*
1831 if test -n "$ac_declaration"; then
1832   echo '#ifdef __cplusplus' >>confdefs.h
1833   echo $ac_declaration      >>confdefs.h
1834   echo '#endif'             >>confdefs.h
1835 fi
1836
1837 else
1838   echo "$as_me: failed program was:" >&5
1839 cat conftest.$ac_ext >&5
1840 fi
1841 rm -f conftest.$ac_objext conftest.$ac_ext
1842 ac_ext=c
1843 ac_cpp='$CPP $CPPFLAGS'
1844 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1845 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1846 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1847 ac_main_return=return
1848
1849 GCC_VERSION=none
1850 if test "$GCC" = yes ; then
1851         echo "$as_me:1851: checking version of $CC" >&5
1852 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1853         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1854         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1855         echo "$as_me:1855: result: $GCC_VERSION" >&5
1856 echo "${ECHO_T}$GCC_VERSION" >&6
1857 fi
1858
1859 INTEL_COMPILER=no
1860
1861 if test "$GCC" = yes ; then
1862         case $host_os in
1863         (linux*|gnu*)
1864                 echo "$as_me:1864: checking if this is really Intel C compiler" >&5
1865 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1866                 cf_save_CFLAGS="$CFLAGS"
1867                 CFLAGS="$CFLAGS -no-gcc"
1868                 cat >conftest.$ac_ext <<_ACEOF
1869 #line 1869 "configure"
1870 #include "confdefs.h"
1871
1872 int
1873 main (void)
1874 {
1875
1876 #ifdef __INTEL_COMPILER
1877 #else
1878 make an error
1879 #endif
1880
1881   ;
1882   return 0;
1883 }
1884 _ACEOF
1885 rm -f conftest.$ac_objext
1886 if { (eval echo "$as_me:1886: \"$ac_compile\"") >&5
1887   (eval $ac_compile) 2>&5
1888   ac_status=$?
1889   echo "$as_me:1889: \$? = $ac_status" >&5
1890   (exit $ac_status); } &&
1891          { ac_try='test -s conftest.$ac_objext'
1892   { (eval echo "$as_me:1892: \"$ac_try\"") >&5
1893   (eval $ac_try) 2>&5
1894   ac_status=$?
1895   echo "$as_me:1895: \$? = $ac_status" >&5
1896   (exit $ac_status); }; }; then
1897   INTEL_COMPILER=yes
1898 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1899
1900 else
1901   echo "$as_me: failed program was:" >&5
1902 cat conftest.$ac_ext >&5
1903 fi
1904 rm -f conftest.$ac_objext conftest.$ac_ext
1905                 CFLAGS="$cf_save_CFLAGS"
1906                 echo "$as_me:1906: result: $INTEL_COMPILER" >&5
1907 echo "${ECHO_T}$INTEL_COMPILER" >&6
1908                 ;;
1909         esac
1910 fi
1911
1912 CLANG_COMPILER=no
1913
1914 if test "$GCC" = yes ; then
1915         echo "$as_me:1915: checking if this is really Clang C compiler" >&5
1916 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1917         cf_save_CFLAGS="$CFLAGS"
1918         CFLAGS="$CFLAGS -Qunused-arguments"
1919         cat >conftest.$ac_ext <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __clang__
1928 #else
1929 make an error
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f conftest.$ac_objext
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit $ac_status); } &&
1942          { ac_try='test -s conftest.$ac_objext'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit $ac_status); }; }; then
1948   CLANG_COMPILER=yes
1949 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
1950
1951 else
1952   echo "$as_me: failed program was:" >&5
1953 cat conftest.$ac_ext >&5
1954 fi
1955 rm -f conftest.$ac_objext conftest.$ac_ext
1956         CFLAGS="$cf_save_CFLAGS"
1957         echo "$as_me:1957: result: $CLANG_COMPILER" >&5
1958 echo "${ECHO_T}$CLANG_COMPILER" >&6
1959 fi
1960
1961 echo "$as_me:1961: checking for $CC option to accept ANSI C" >&5
1962 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1963 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1964   echo $ECHO_N "(cached) $ECHO_C" >&6
1965 else
1966   ac_cv_prog_cc_stdc=no
1967 ac_save_CC=$CC
1968 cat >conftest.$ac_ext <<_ACEOF
1969 #line 1969 "configure"
1970 #include "confdefs.h"
1971 #include <stdarg.h>
1972 #include <stdio.h>
1973 #include <sys/types.h>
1974 #include <sys/stat.h>
1975 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1976 struct buf { int x; };
1977 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1978 static char *e (p, i)
1979      char **p;
1980      int i;
1981 {
1982   return p[i];
1983 }
1984 static char *f (char * (*g) (char **, int), char **p, ...)
1985 {
1986   char *s;
1987   va_list v;
1988   va_start (v,p);
1989   s = g (p, va_arg (v,int));
1990   va_end (v);
1991   return s;
1992 }
1993 int test (int i, double x);
1994 struct s1 {int (*f) (int a);};
1995 struct s2 {int (*f) (double a);};
1996 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1997 int argc;
1998 char **argv;
1999 int
2000 main (void)
2001 {
2002 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2003   ;
2004   return 0;
2005 }
2006 _ACEOF
2007 # Don't try gcc -ansi; that turns off useful extensions and
2008 # breaks some systems' header files.
2009 # AIX                   -qlanglvl=ansi
2010 # Ultrix and OSF/1      -std1
2011 # HP-UX 10.20 and later -Ae
2012 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2013 # SVR4                  -Xc -D__EXTENSIONS__
2014 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2015 do
2016   CC="$ac_save_CC $ac_arg"
2017   rm -f conftest.$ac_objext
2018 if { (eval echo "$as_me:2018: \"$ac_compile\"") >&5
2019   (eval $ac_compile) 2>&5
2020   ac_status=$?
2021   echo "$as_me:2021: \$? = $ac_status" >&5
2022   (exit $ac_status); } &&
2023          { ac_try='test -s conftest.$ac_objext'
2024   { (eval echo "$as_me:2024: \"$ac_try\"") >&5
2025   (eval $ac_try) 2>&5
2026   ac_status=$?
2027   echo "$as_me:2027: \$? = $ac_status" >&5
2028   (exit $ac_status); }; }; then
2029   ac_cv_prog_cc_stdc=$ac_arg
2030 break
2031 else
2032   echo "$as_me: failed program was:" >&5
2033 cat conftest.$ac_ext >&5
2034 fi
2035 rm -f conftest.$ac_objext
2036 done
2037 rm -f conftest.$ac_ext conftest.$ac_objext
2038 CC=$ac_save_CC
2039
2040 fi
2041
2042 case "x$ac_cv_prog_cc_stdc" in
2043   x|xno)
2044     echo "$as_me:2044: result: none needed" >&5
2045 echo "${ECHO_T}none needed" >&6 ;;
2046   *)
2047     echo "$as_me:2047: result: $ac_cv_prog_cc_stdc" >&5
2048 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2049     CC="$CC $ac_cv_prog_cc_stdc" ;;
2050 esac
2051
2052 # This should have been defined by AC_PROG_CC
2053 : ${CC:=cc}
2054
2055 echo "$as_me:2055: checking \$CFLAGS variable" >&5
2056 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2057 case "x$CFLAGS" in
2058 (*-[IUD]*)
2059         echo "$as_me:2059: result: broken" >&5
2060 echo "${ECHO_T}broken" >&6
2061         { echo "$as_me:2061: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2062 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2063         cf_flags="$CFLAGS"
2064         CFLAGS=
2065         for cf_arg in $cf_flags
2066         do
2067
2068 cf_fix_cppflags=no
2069 cf_new_cflags=
2070 cf_new_cppflags=
2071 cf_new_extra_cppflags=
2072
2073 for cf_add_cflags in $cf_arg
2074 do
2075 case $cf_fix_cppflags in
2076 (no)
2077         case $cf_add_cflags in
2078         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2079                 case $cf_add_cflags in
2080                 (-D*)
2081                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2082
2083                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2084                                 && test -z "${cf_tst_cflags}" \
2085                                 && cf_fix_cppflags=yes
2086
2087                         if test $cf_fix_cppflags = yes ; then
2088
2089         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2090         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2091
2092                                 continue
2093                         elif test "${cf_tst_cflags}" = "\"'" ; then
2094
2095         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2096         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2097
2098                                 continue
2099                         fi
2100                         ;;
2101                 esac
2102                 case "$CPPFLAGS" in
2103                 (*$cf_add_cflags)
2104                         ;;
2105                 (*)
2106                         case $cf_add_cflags in
2107                         (-D*)
2108                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2109
2110 CPPFLAGS=`echo "$CPPFLAGS" | \
2111         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2112                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2113
2114                                 ;;
2115                         esac
2116
2117         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2118         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2119
2120                         ;;
2121                 esac
2122                 ;;
2123         (*)
2124
2125         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2126         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2127
2128                 ;;
2129         esac
2130         ;;
2131 (yes)
2132
2133         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2134         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2135
2136         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2137
2138         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2139                 && test -z "${cf_tst_cflags}" \
2140                 && cf_fix_cppflags=no
2141         ;;
2142 esac
2143 done
2144
2145 if test -n "$cf_new_cflags" ; then
2146
2147         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2148         CFLAGS="${CFLAGS}$cf_new_cflags"
2149
2150 fi
2151
2152 if test -n "$cf_new_cppflags" ; then
2153
2154         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2155         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2156
2157 fi
2158
2159 if test -n "$cf_new_extra_cppflags" ; then
2160
2161         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2162         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2163
2164 fi
2165
2166         done
2167         ;;
2168 (*)
2169         echo "$as_me:2169: result: ok" >&5
2170 echo "${ECHO_T}ok" >&6
2171         ;;
2172 esac
2173
2174 echo "$as_me:2174: checking \$CC variable" >&5
2175 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2176 case "$CC" in
2177 (*[\ \  ]-*)
2178         echo "$as_me:2178: result: broken" >&5
2179 echo "${ECHO_T}broken" >&6
2180         { echo "$as_me:2180: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2181 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2182         # humor him...
2183         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2184         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2185         CC="$cf_prog"
2186         for cf_arg in $cf_flags
2187         do
2188                 case "x$cf_arg" in
2189                 (x-[IUDfgOW]*)
2190
2191 cf_fix_cppflags=no
2192 cf_new_cflags=
2193 cf_new_cppflags=
2194 cf_new_extra_cppflags=
2195
2196 for cf_add_cflags in $cf_arg
2197 do
2198 case $cf_fix_cppflags in
2199 (no)
2200         case $cf_add_cflags in
2201         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2202                 case $cf_add_cflags in
2203                 (-D*)
2204                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2205
2206                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2207                                 && test -z "${cf_tst_cflags}" \
2208                                 && cf_fix_cppflags=yes
2209
2210                         if test $cf_fix_cppflags = yes ; then
2211
2212         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2213         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2214
2215                                 continue
2216                         elif test "${cf_tst_cflags}" = "\"'" ; then
2217
2218         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2219         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2220
2221                                 continue
2222                         fi
2223                         ;;
2224                 esac
2225                 case "$CPPFLAGS" in
2226                 (*$cf_add_cflags)
2227                         ;;
2228                 (*)
2229                         case $cf_add_cflags in
2230                         (-D*)
2231                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2232
2233 CPPFLAGS=`echo "$CPPFLAGS" | \
2234         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2235                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2236
2237                                 ;;
2238                         esac
2239
2240         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2241         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2242
2243                         ;;
2244                 esac
2245                 ;;
2246         (*)
2247
2248         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2249         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2250
2251                 ;;
2252         esac
2253         ;;
2254 (yes)
2255
2256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2258
2259         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2260
2261         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2262                 && test -z "${cf_tst_cflags}" \
2263                 && cf_fix_cppflags=no
2264         ;;
2265 esac
2266 done
2267
2268 if test -n "$cf_new_cflags" ; then
2269
2270         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2271         CFLAGS="${CFLAGS}$cf_new_cflags"
2272
2273 fi
2274
2275 if test -n "$cf_new_cppflags" ; then
2276
2277         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2278         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2279
2280 fi
2281
2282 if test -n "$cf_new_extra_cppflags" ; then
2283
2284         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2285         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2286
2287 fi
2288
2289                         ;;
2290                 (*)
2291                         CC="$CC $cf_arg"
2292                         ;;
2293                 esac
2294         done
2295         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2296
2297 echo "${as_me:-configure}:2297: testing resulting CC: '$CC' ..." 1>&5
2298
2299         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2300
2301 echo "${as_me:-configure}:2301: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2302
2303         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2304
2305 echo "${as_me:-configure}:2305: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2306
2307         ;;
2308 (*)
2309         echo "$as_me:2309: result: ok" >&5
2310 echo "${ECHO_T}ok" >&6
2311         ;;
2312 esac
2313
2314 echo "$as_me:2314: checking for inline" >&5
2315 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2316 if test "${ac_cv_c_inline+set}" = set; then
2317   echo $ECHO_N "(cached) $ECHO_C" >&6
2318 else
2319   ac_cv_c_inline=no
2320 for ac_kw in inline __inline__ __inline; do
2321   cat >conftest.$ac_ext <<_ACEOF
2322 #line 2322 "configure"
2323 #include "confdefs.h"
2324 #ifndef __cplusplus
2325 static $ac_kw int static_foo () {return 0; }
2326 $ac_kw int foo () {return 0; }
2327 #endif
2328
2329 _ACEOF
2330 rm -f conftest.$ac_objext
2331 if { (eval echo "$as_me:2331: \"$ac_compile\"") >&5
2332   (eval $ac_compile) 2>&5
2333   ac_status=$?
2334   echo "$as_me:2334: \$? = $ac_status" >&5
2335   (exit $ac_status); } &&
2336          { ac_try='test -s conftest.$ac_objext'
2337   { (eval echo "$as_me:2337: \"$ac_try\"") >&5
2338   (eval $ac_try) 2>&5
2339   ac_status=$?
2340   echo "$as_me:2340: \$? = $ac_status" >&5
2341   (exit $ac_status); }; }; then
2342   ac_cv_c_inline=$ac_kw; break
2343 else
2344   echo "$as_me: failed program was:" >&5
2345 cat conftest.$ac_ext >&5
2346 fi
2347 rm -f conftest.$ac_objext conftest.$ac_ext
2348 done
2349
2350 fi
2351 echo "$as_me:2351: result: $ac_cv_c_inline" >&5
2352 echo "${ECHO_T}$ac_cv_c_inline" >&6
2353 case $ac_cv_c_inline in
2354   inline | yes) ;;
2355   no)
2356 cat >>confdefs.h <<\EOF
2357 #define inline
2358 EOF
2359  ;;
2360   *)  cat >>confdefs.h <<EOF
2361 #define inline $ac_cv_c_inline
2362 EOF
2363  ;;
2364 esac
2365
2366 ac_ext=c
2367 ac_cpp='$CPP $CPPFLAGS'
2368 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2369 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2370 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2371 ac_main_return=return
2372 echo "$as_me:2372: checking how to run the C preprocessor" >&5
2373 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2374 # On Suns, sometimes $CPP names a directory.
2375 if test -n "$CPP" && test -d "$CPP"; then
2376   CPP=
2377 fi
2378 if test -z "$CPP"; then
2379   if test "${ac_cv_prog_CPP+set}" = set; then
2380   echo $ECHO_N "(cached) $ECHO_C" >&6
2381 else
2382       # Double quotes because CPP needs to be expanded
2383     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2384     do
2385       ac_preproc_ok=false
2386 for ac_c_preproc_warn_flag in '' yes
2387 do
2388   # Use a header file that comes with gcc, so configuring glibc
2389   # with a fresh cross-compiler works.
2390   # On the NeXT, cc -E runs the code through the compiler's parser,
2391   # not just through cpp. "Syntax error" is here to catch this case.
2392   cat >conftest.$ac_ext <<_ACEOF
2393 #line 2393 "configure"
2394 #include "confdefs.h"
2395 #include <assert.h>
2396                      Syntax error
2397 _ACEOF
2398 if { (eval echo "$as_me:2398: \"$ac_cpp conftest.$ac_ext\"") >&5
2399   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2400   ac_status=$?
2401   egrep -v '^ *\+' conftest.er1 >conftest.err
2402   rm -f conftest.er1
2403   cat conftest.err >&5
2404   echo "$as_me:2404: \$? = $ac_status" >&5
2405   (exit $ac_status); } >/dev/null; then
2406   if test -s conftest.err; then
2407     ac_cpp_err=$ac_c_preproc_warn_flag
2408   else
2409     ac_cpp_err=
2410   fi
2411 else
2412   ac_cpp_err=yes
2413 fi
2414 if test -z "$ac_cpp_err"; then
2415   :
2416 else
2417   echo "$as_me: failed program was:" >&5
2418   cat conftest.$ac_ext >&5
2419   # Broken: fails on valid input.
2420 continue
2421 fi
2422 rm -f conftest.err conftest.$ac_ext
2423
2424   # OK, works on sane cases.  Now check whether non-existent headers
2425   # can be detected and how.
2426   cat >conftest.$ac_ext <<_ACEOF
2427 #line 2427 "configure"
2428 #include "confdefs.h"
2429 #include <ac_nonexistent.h>
2430 _ACEOF
2431 if { (eval echo "$as_me:2431: \"$ac_cpp conftest.$ac_ext\"") >&5
2432   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2433   ac_status=$?
2434   egrep -v '^ *\+' conftest.er1 >conftest.err
2435   rm -f conftest.er1
2436   cat conftest.err >&5
2437   echo "$as_me:2437: \$? = $ac_status" >&5
2438   (exit $ac_status); } >/dev/null; then
2439   if test -s conftest.err; then
2440     ac_cpp_err=$ac_c_preproc_warn_flag
2441   else
2442     ac_cpp_err=
2443   fi
2444 else
2445   ac_cpp_err=yes
2446 fi
2447 if test -z "$ac_cpp_err"; then
2448   # Broken: success on invalid input.
2449 continue
2450 else
2451   echo "$as_me: failed program was:" >&5
2452   cat conftest.$ac_ext >&5
2453   # Passes both tests.
2454 ac_preproc_ok=:
2455 break
2456 fi
2457 rm -f conftest.err conftest.$ac_ext
2458
2459 done
2460 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2461 rm -f conftest.err conftest.$ac_ext
2462 if $ac_preproc_ok; then
2463   break
2464 fi
2465
2466     done
2467     ac_cv_prog_CPP=$CPP
2468
2469 fi
2470   CPP=$ac_cv_prog_CPP
2471 else
2472   ac_cv_prog_CPP=$CPP
2473 fi
2474 echo "$as_me:2474: result: $CPP" >&5
2475 echo "${ECHO_T}$CPP" >&6
2476 ac_preproc_ok=false
2477 for ac_c_preproc_warn_flag in '' yes
2478 do
2479   # Use a header file that comes with gcc, so configuring glibc
2480   # with a fresh cross-compiler works.
2481   # On the NeXT, cc -E runs the code through the compiler's parser,
2482   # not just through cpp. "Syntax error" is here to catch this case.
2483   cat >conftest.$ac_ext <<_ACEOF
2484 #line 2484 "configure"
2485 #include "confdefs.h"
2486 #include <assert.h>
2487                      Syntax error
2488 _ACEOF
2489 if { (eval echo "$as_me:2489: \"$ac_cpp conftest.$ac_ext\"") >&5
2490   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2491   ac_status=$?
2492   egrep -v '^ *\+' conftest.er1 >conftest.err
2493   rm -f conftest.er1
2494   cat conftest.err >&5
2495   echo "$as_me:2495: \$? = $ac_status" >&5
2496   (exit $ac_status); } >/dev/null; then
2497   if test -s conftest.err; then
2498     ac_cpp_err=$ac_c_preproc_warn_flag
2499   else
2500     ac_cpp_err=
2501   fi
2502 else
2503   ac_cpp_err=yes
2504 fi
2505 if test -z "$ac_cpp_err"; then
2506   :
2507 else
2508   echo "$as_me: failed program was:" >&5
2509   cat conftest.$ac_ext >&5
2510   # Broken: fails on valid input.
2511 continue
2512 fi
2513 rm -f conftest.err conftest.$ac_ext
2514
2515   # OK, works on sane cases.  Now check whether non-existent headers
2516   # can be detected and how.
2517   cat >conftest.$ac_ext <<_ACEOF
2518 #line 2518 "configure"
2519 #include "confdefs.h"
2520 #include <ac_nonexistent.h>
2521 _ACEOF
2522 if { (eval echo "$as_me:2522: \"$ac_cpp conftest.$ac_ext\"") >&5
2523   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2524   ac_status=$?
2525   egrep -v '^ *\+' conftest.er1 >conftest.err
2526   rm -f conftest.er1
2527   cat conftest.err >&5
2528   echo "$as_me:2528: \$? = $ac_status" >&5
2529   (exit $ac_status); } >/dev/null; then
2530   if test -s conftest.err; then
2531     ac_cpp_err=$ac_c_preproc_warn_flag
2532   else
2533     ac_cpp_err=
2534   fi
2535 else
2536   ac_cpp_err=yes
2537 fi
2538 if test -z "$ac_cpp_err"; then
2539   # Broken: success on invalid input.
2540 continue
2541 else
2542   echo "$as_me: failed program was:" >&5
2543   cat conftest.$ac_ext >&5
2544   # Passes both tests.
2545 ac_preproc_ok=:
2546 break
2547 fi
2548 rm -f conftest.err conftest.$ac_ext
2549
2550 done
2551 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2552 rm -f conftest.err conftest.$ac_ext
2553 if $ac_preproc_ok; then
2554   :
2555 else
2556   { { echo "$as_me:2556: error: C preprocessor \"$CPP\" fails sanity check" >&5
2557 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2558    { (exit 1); exit 1; }; }
2559 fi
2560
2561 ac_ext=c
2562 ac_cpp='$CPP $CPPFLAGS'
2563 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2564 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2565 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2566 ac_main_return=return
2567
2568 for ac_prog in mawk gawk nawk awk
2569 do
2570   # Extract the first word of "$ac_prog", so it can be a program name with args.
2571 set dummy $ac_prog; ac_word=$2
2572 echo "$as_me:2572: checking for $ac_word" >&5
2573 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2574 if test "${ac_cv_prog_AWK+set}" = set; then
2575   echo $ECHO_N "(cached) $ECHO_C" >&6
2576 else
2577   if test -n "$AWK"; then
2578   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2579 else
2580   ac_save_IFS=$IFS; IFS=$ac_path_separator
2581 ac_dummy="$PATH"
2582 for ac_dir in $ac_dummy; do
2583   IFS=$ac_save_IFS
2584   test -z "$ac_dir" && ac_dir=.
2585   $as_executable_p "$ac_dir/$ac_word" || continue
2586 ac_cv_prog_AWK="$ac_prog"
2587 echo "$as_me:2587: found $ac_dir/$ac_word" >&5
2588 break
2589 done
2590
2591 fi
2592 fi
2593 AWK=$ac_cv_prog_AWK
2594 if test -n "$AWK"; then
2595   echo "$as_me:2595: result: $AWK" >&5
2596 echo "${ECHO_T}$AWK" >&6
2597 else
2598   echo "$as_me:2598: result: no" >&5
2599 echo "${ECHO_T}no" >&6
2600 fi
2601
2602   test -n "$AWK" && break
2603 done
2604
2605 # Find a good install program.  We prefer a C program (faster),
2606 # so one script is as good as another.  But avoid the broken or
2607 # incompatible versions:
2608 # SysV /etc/install, /usr/sbin/install
2609 # SunOS /usr/etc/install
2610 # IRIX /sbin/install
2611 # AIX /bin/install
2612 # AmigaOS /C/install, which installs bootblocks on floppy discs
2613 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2614 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2615 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2616 # ./install, which can be erroneously created by make from ./install.sh.
2617 echo "$as_me:2617: checking for a BSD compatible install" >&5
2618 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2619 if test -z "$INSTALL"; then
2620 if test "${ac_cv_path_install+set}" = set; then
2621   echo $ECHO_N "(cached) $ECHO_C" >&6
2622 else
2623     ac_save_IFS=$IFS; IFS=$ac_path_separator
2624   for ac_dir in $PATH; do
2625     IFS=$ac_save_IFS
2626     # Account for people who put trailing slashes in PATH elements.
2627     case $ac_dir/ in
2628     / | ./ | .// | /cC/* \
2629     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2630     | /usr/ucb/* ) ;;
2631     *)
2632       # OSF1 and SCO ODT 3.0 have their own names for install.
2633       # Don't use installbsd from OSF since it installs stuff as root
2634       # by default.
2635       for ac_prog in ginstall scoinst install; do
2636         if $as_executable_p "$ac_dir/$ac_prog"; then
2637           if test $ac_prog = install &&
2638             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2639             # AIX install.  It has an incompatible calling convention.
2640             :
2641           elif test $ac_prog = install &&
2642             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2643             # program-specific install script used by HP pwplus--don't use.
2644             :
2645           else
2646             ac_cv_path_install="$ac_dir/$ac_prog -c"
2647             break 2
2648           fi
2649         fi
2650       done
2651       ;;
2652     esac
2653   done
2654
2655 fi
2656   if test "${ac_cv_path_install+set}" = set; then
2657     INSTALL=$ac_cv_path_install
2658   else
2659     # As a last resort, use the slow shell script.  We don't cache a
2660     # path for INSTALL within a source directory, because that will
2661     # break other packages using the cache if that directory is
2662     # removed, or if the path is relative.
2663     INSTALL=$ac_install_sh
2664   fi
2665 fi
2666 echo "$as_me:2666: result: $INSTALL" >&5
2667 echo "${ECHO_T}$INSTALL" >&6
2668
2669 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2670 # It thinks the first close brace ends the variable substitution.
2671 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2672
2673 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2674
2675 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2676
2677 case $INSTALL in
2678 (/*)
2679         ;;
2680 (*)
2681         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2682         test -z "$cf_dir" && cf_dir=.
2683         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2684         ;;
2685 esac
2686
2687 echo "$as_me:2687: checking if you want to install stripped executables" >&5
2688 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2689
2690 # Check whether --enable-stripping or --disable-stripping was given.
2691 if test "${enable_stripping+set}" = set; then
2692   enableval="$enable_stripping"
2693   test "$enableval" != no && enableval=yes
2694         if test "$enableval" != "yes" ; then
2695     with_stripping=no
2696         else
2697                 with_stripping=yes
2698         fi
2699 else
2700   enableval=yes
2701         with_stripping=yes
2702
2703 fi;
2704 echo "$as_me:2704: result: $with_stripping" >&5
2705 echo "${ECHO_T}$with_stripping" >&6
2706
2707 if test "$with_stripping" = yes
2708 then
2709         INSTALL_OPT_S="-s"
2710 else
2711         INSTALL_OPT_S=
2712 fi
2713
2714 : ${INSTALL:=install}
2715 echo "$as_me:2715: checking if install accepts -p option" >&5
2716 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2717 if test "${cf_cv_install_p+set}" = set; then
2718   echo $ECHO_N "(cached) $ECHO_C" >&6
2719 else
2720
2721         rm -rf conftest*
2722         date >conftest.in
2723         mkdir conftest.out
2724         sleep 3
2725         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2726         then
2727                 if test -f conftest.out/conftest.in
2728                 then
2729                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2730                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2731                         if test -s conftest.err
2732                         then
2733                                 cf_cv_install_p=no
2734                         else
2735                                 cf_cv_install_p=yes
2736                         fi
2737                 else
2738                         cf_cv_install_p=no
2739                 fi
2740         else
2741                 cf_cv_install_p=no
2742         fi
2743         rm -rf conftest*
2744
2745 fi
2746 echo "$as_me:2746: result: $cf_cv_install_p" >&5
2747 echo "${ECHO_T}$cf_cv_install_p" >&6
2748
2749 echo "$as_me:2749: checking if install needs to be told about ownership" >&5
2750 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2751 case `$ac_config_guess` in
2752 (*minix)
2753         with_install_o=yes
2754         ;;
2755 (*)
2756         with_install_o=no
2757         ;;
2758 esac
2759
2760 echo "$as_me:2760: result: $with_install_o" >&5
2761 echo "${ECHO_T}$with_install_o" >&6
2762 if test "x$with_install_o" = xyes
2763 then
2764         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2765 else
2766         INSTALL_OPT_O=
2767 fi
2768
2769 for ac_prog in lint cppcheck splint
2770 do
2771   # Extract the first word of "$ac_prog", so it can be a program name with args.
2772 set dummy $ac_prog; ac_word=$2
2773 echo "$as_me:2773: checking for $ac_word" >&5
2774 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2775 if test "${ac_cv_prog_LINT+set}" = set; then
2776   echo $ECHO_N "(cached) $ECHO_C" >&6
2777 else
2778   if test -n "$LINT"; then
2779   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2780 else
2781   ac_save_IFS=$IFS; IFS=$ac_path_separator
2782 ac_dummy="$PATH"
2783 for ac_dir in $ac_dummy; do
2784   IFS=$ac_save_IFS
2785   test -z "$ac_dir" && ac_dir=.
2786   $as_executable_p "$ac_dir/$ac_word" || continue
2787 ac_cv_prog_LINT="$ac_prog"
2788 echo "$as_me:2788: found $ac_dir/$ac_word" >&5
2789 break
2790 done
2791
2792 fi
2793 fi
2794 LINT=$ac_cv_prog_LINT
2795 if test -n "$LINT"; then
2796   echo "$as_me:2796: result: $LINT" >&5
2797 echo "${ECHO_T}$LINT" >&6
2798 else
2799   echo "$as_me:2799: result: no" >&5
2800 echo "${ECHO_T}no" >&6
2801 fi
2802
2803   test -n "$LINT" && break
2804 done
2805
2806 echo "$as_me:2806: checking if filesystem supports mixed-case filenames" >&5
2807 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2808 if test "${cf_cv_mixedcase+set}" = set; then
2809   echo $ECHO_N "(cached) $ECHO_C" >&6
2810 else
2811
2812 if test "$cross_compiling" = yes ; then
2813         case $target_alias in
2814         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2815                 cf_cv_mixedcase=no
2816                 ;;
2817         (*)
2818                 cf_cv_mixedcase=yes
2819                 ;;
2820         esac
2821 else
2822         rm -f conftest CONFTEST
2823         echo test >conftest
2824         if test -f CONFTEST ; then
2825                 cf_cv_mixedcase=no
2826         else
2827                 cf_cv_mixedcase=yes
2828         fi
2829         rm -f conftest CONFTEST
2830 fi
2831
2832 fi
2833 echo "$as_me:2833: result: $cf_cv_mixedcase" >&5
2834 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2835 test "$cf_cv_mixedcase" = yes &&
2836 cat >>confdefs.h <<\EOF
2837 #define MIXEDCASE_FILENAMES 1
2838 EOF
2839
2840 for ac_prog in exctags ctags
2841 do
2842   # Extract the first word of "$ac_prog", so it can be a program name with args.
2843 set dummy $ac_prog; ac_word=$2
2844 echo "$as_me:2844: checking for $ac_word" >&5
2845 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2846 if test "${ac_cv_prog_CTAGS+set}" = set; then
2847   echo $ECHO_N "(cached) $ECHO_C" >&6
2848 else
2849   if test -n "$CTAGS"; then
2850   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2851 else
2852   ac_save_IFS=$IFS; IFS=$ac_path_separator
2853 ac_dummy="$PATH"
2854 for ac_dir in $ac_dummy; do
2855   IFS=$ac_save_IFS
2856   test -z "$ac_dir" && ac_dir=.
2857   $as_executable_p "$ac_dir/$ac_word" || continue
2858 ac_cv_prog_CTAGS="$ac_prog"
2859 echo "$as_me:2859: found $ac_dir/$ac_word" >&5
2860 break
2861 done
2862
2863 fi
2864 fi
2865 CTAGS=$ac_cv_prog_CTAGS
2866 if test -n "$CTAGS"; then
2867   echo "$as_me:2867: result: $CTAGS" >&5
2868 echo "${ECHO_T}$CTAGS" >&6
2869 else
2870   echo "$as_me:2870: result: no" >&5
2871 echo "${ECHO_T}no" >&6
2872 fi
2873
2874   test -n "$CTAGS" && break
2875 done
2876
2877 for ac_prog in exetags etags
2878 do
2879   # Extract the first word of "$ac_prog", so it can be a program name with args.
2880 set dummy $ac_prog; ac_word=$2
2881 echo "$as_me:2881: checking for $ac_word" >&5
2882 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2883 if test "${ac_cv_prog_ETAGS+set}" = set; then
2884   echo $ECHO_N "(cached) $ECHO_C" >&6
2885 else
2886   if test -n "$ETAGS"; then
2887   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2888 else
2889   ac_save_IFS=$IFS; IFS=$ac_path_separator
2890 ac_dummy="$PATH"
2891 for ac_dir in $ac_dummy; do
2892   IFS=$ac_save_IFS
2893   test -z "$ac_dir" && ac_dir=.
2894   $as_executable_p "$ac_dir/$ac_word" || continue
2895 ac_cv_prog_ETAGS="$ac_prog"
2896 echo "$as_me:2896: found $ac_dir/$ac_word" >&5
2897 break
2898 done
2899
2900 fi
2901 fi
2902 ETAGS=$ac_cv_prog_ETAGS
2903 if test -n "$ETAGS"; then
2904   echo "$as_me:2904: result: $ETAGS" >&5
2905 echo "${ECHO_T}$ETAGS" >&6
2906 else
2907   echo "$as_me:2907: result: no" >&5
2908 echo "${ECHO_T}no" >&6
2909 fi
2910
2911   test -n "$ETAGS" && break
2912 done
2913
2914 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2915 set dummy ${CTAGS:-ctags}; ac_word=$2
2916 echo "$as_me:2916: checking for $ac_word" >&5
2917 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2918 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2919   echo $ECHO_N "(cached) $ECHO_C" >&6
2920 else
2921   if test -n "$MAKE_LOWER_TAGS"; then
2922   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2923 else
2924   ac_save_IFS=$IFS; IFS=$ac_path_separator
2925 ac_dummy="$PATH"
2926 for ac_dir in $ac_dummy; do
2927   IFS=$ac_save_IFS
2928   test -z "$ac_dir" && ac_dir=.
2929   $as_executable_p "$ac_dir/$ac_word" || continue
2930 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2931 echo "$as_me:2931: found $ac_dir/$ac_word" >&5
2932 break
2933 done
2934
2935   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2936 fi
2937 fi
2938 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2939 if test -n "$MAKE_LOWER_TAGS"; then
2940   echo "$as_me:2940: result: $MAKE_LOWER_TAGS" >&5
2941 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2942 else
2943   echo "$as_me:2943: result: no" >&5
2944 echo "${ECHO_T}no" >&6
2945 fi
2946
2947 if test "$cf_cv_mixedcase" = yes ; then
2948         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2949 set dummy ${ETAGS:-etags}; ac_word=$2
2950 echo "$as_me:2950: checking for $ac_word" >&5
2951 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2952 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2953   echo $ECHO_N "(cached) $ECHO_C" >&6
2954 else
2955   if test -n "$MAKE_UPPER_TAGS"; then
2956   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2957 else
2958   ac_save_IFS=$IFS; IFS=$ac_path_separator
2959 ac_dummy="$PATH"
2960 for ac_dir in $ac_dummy; do
2961   IFS=$ac_save_IFS
2962   test -z "$ac_dir" && ac_dir=.
2963   $as_executable_p "$ac_dir/$ac_word" || continue
2964 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2965 echo "$as_me:2965: found $ac_dir/$ac_word" >&5
2966 break
2967 done
2968
2969   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2970 fi
2971 fi
2972 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2973 if test -n "$MAKE_UPPER_TAGS"; then
2974   echo "$as_me:2974: result: $MAKE_UPPER_TAGS" >&5
2975 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2976 else
2977   echo "$as_me:2977: result: no" >&5
2978 echo "${ECHO_T}no" >&6
2979 fi
2980
2981 else
2982         MAKE_UPPER_TAGS=no
2983 fi
2984
2985 if test "$MAKE_UPPER_TAGS" = yes ; then
2986         MAKE_UPPER_TAGS=
2987 else
2988         MAKE_UPPER_TAGS="#"
2989 fi
2990
2991 if test "$MAKE_LOWER_TAGS" = yes ; then
2992         MAKE_LOWER_TAGS=
2993 else
2994         MAKE_LOWER_TAGS="#"
2995 fi
2996
2997 echo "$as_me:2997: checking if -lm needed for math functions" >&5
2998 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2999 if test "${cf_cv_need_libm+set}" = set; then
3000   echo $ECHO_N "(cached) $ECHO_C" >&6
3001 else
3002
3003         cat >conftest.$ac_ext <<_ACEOF
3004 #line 3004 "configure"
3005 #include "confdefs.h"
3006
3007         #include <stdio.h>
3008         #include <stdlib.h>
3009         #include <math.h>
3010
3011 int
3012 main (void)
3013 {
3014 double x = rand(); printf("result = %g\n", pow(sin(x),x))
3015   ;
3016   return 0;
3017 }
3018 _ACEOF
3019 rm -f conftest.$ac_objext conftest$ac_exeext
3020 if { (eval echo "$as_me:3020: \"$ac_link\"") >&5
3021   (eval $ac_link) 2>&5
3022   ac_status=$?
3023   echo "$as_me:3023: \$? = $ac_status" >&5
3024   (exit $ac_status); } &&
3025          { ac_try='test -s conftest$ac_exeext'
3026   { (eval echo "$as_me:3026: \"$ac_try\"") >&5
3027   (eval $ac_try) 2>&5
3028   ac_status=$?
3029   echo "$as_me:3029: \$? = $ac_status" >&5
3030   (exit $ac_status); }; }; then
3031   cf_cv_need_libm=no
3032 else
3033   echo "$as_me: failed program was:" >&5
3034 cat conftest.$ac_ext >&5
3035 cf_cv_need_libm=yes
3036 fi
3037 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3038 fi
3039 echo "$as_me:3039: result: $cf_cv_need_libm" >&5
3040 echo "${ECHO_T}$cf_cv_need_libm" >&6
3041 if test "$cf_cv_need_libm" = yes
3042 then
3043 MATH_LIB=-lm
3044 fi
3045
3046 top_builddir=`pwd`
3047
3048 CC_G_OPT="-g"
3049 CC_SHARED_OPTS=unknown
3050 CPPFLAGS="$CPPFLAGS"
3051 DFT_DEP_SUFFIX=""
3052 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3053 DFT_UPR_MODEL="NORMAL"
3054 LD="ld"
3055 LDFLAGS_SHARED=""
3056 LDFLAGS_STATIC=""
3057 LD_MODEL=""
3058 LD_SHARED_OPTS=""
3059 LIBTOOL=""
3060 LIBTOOL_OPTS=""
3061 LIB_CLEAN=""
3062 LIB_COMPILE=""
3063 LIB_LINK='${CC}'
3064 LINK_TESTS=""
3065 LOCAL_LDFLAGS=""
3066 PACKAGE="ncurses-examples"
3067 PTHREAD="-lm"
3068 TEST_ARGS=""
3069 TEST_DEPS=""
3070 TEST_LIBS=""
3071 TINFO_LDFLAGS=''
3072 TINFO_LIBS='$(LIBS_CURSES)'
3073 cf_cv_abi_version=""
3074 cf_cv_rel_version=""
3075 includesubdir=""
3076
3077 cf_cv_screen=curses
3078 cf_cv_libtype=
3079
3080 if test "$GCC" = yes
3081 then
3082 cat > conftest.i <<EOF
3083 #ifndef GCC_PRINTF
3084 #define GCC_PRINTF 0
3085 #endif
3086 #ifndef GCC_SCANF
3087 #define GCC_SCANF 0
3088 #endif
3089 #ifndef GCC_NORETURN
3090 #define GCC_NORETURN /* nothing */
3091 #endif
3092 #ifndef GCC_UNUSED
3093 #define GCC_UNUSED /* nothing */
3094 #endif
3095 EOF
3096 if test "$GCC" = yes
3097 then
3098         { echo "$as_me:3098: checking for $CC __attribute__ directives..." >&5
3099 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3100 cat > conftest.$ac_ext <<EOF
3101 #line 3101 "${as_me:-configure}"
3102 #include "confdefs.h"
3103 #include "conftest.h"
3104 #include "conftest.i"
3105 #if     GCC_PRINTF
3106 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3107 #else
3108 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3109 #endif
3110 #if     GCC_SCANF
3111 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3112 #else
3113 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3114 #endif
3115 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3116 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3117 extern void foo(void) GCC_NORETURN;
3118 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3119 EOF
3120         cf_printf_attribute=no
3121         cf_scanf_attribute=no
3122         for cf_attribute in scanf printf unused noreturn
3123         do
3124
3125 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3126
3127                 cf_directive="__attribute__(($cf_attribute))"
3128                 echo "checking for $CC $cf_directive" 1>&5
3129
3130                 case $cf_attribute in
3131                 (printf)
3132                         cf_printf_attribute=yes
3133                         cat >conftest.h <<EOF
3134 #define GCC_$cf_ATTRIBUTE 1
3135 EOF
3136                         ;;
3137                 (scanf)
3138                         cf_scanf_attribute=yes
3139                         cat >conftest.h <<EOF
3140 #define GCC_$cf_ATTRIBUTE 1
3141 EOF
3142                         ;;
3143                 (*)
3144                         cat >conftest.h <<EOF
3145 #define GCC_$cf_ATTRIBUTE $cf_directive
3146 EOF
3147                         ;;
3148                 esac
3149
3150                 if { (eval echo "$as_me:3150: \"$ac_compile\"") >&5
3151   (eval $ac_compile) 2>&5
3152   ac_status=$?
3153   echo "$as_me:3153: \$? = $ac_status" >&5
3154   (exit $ac_status); }; then
3155                         test -n "$verbose" && echo "$as_me:3155: result: ... $cf_attribute" >&5
3156 echo "${ECHO_T}... $cf_attribute" >&6
3157                         cat conftest.h >>confdefs.h
3158                         case $cf_attribute in
3159                         (noreturn)
3160
3161 cat >>confdefs.h <<EOF
3162 #define GCC_NORETURN $cf_directive
3163 EOF
3164
3165                                 ;;
3166                         (printf)
3167                                 cf_value='/* nothing */'
3168                                 if test "$cf_printf_attribute" != no ; then
3169                                         cf_value='__attribute__((format(printf,fmt,var)))'
3170
3171 cat >>confdefs.h <<\EOF
3172 #define GCC_PRINTF 1
3173 EOF
3174
3175                                 fi
3176
3177 cat >>confdefs.h <<EOF
3178 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3179 EOF
3180
3181                                 ;;
3182                         (scanf)
3183                                 cf_value='/* nothing */'
3184                                 if test "$cf_scanf_attribute" != no ; then
3185                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3186
3187 cat >>confdefs.h <<\EOF
3188 #define GCC_SCANF 1
3189 EOF
3190
3191                                 fi
3192
3193 cat >>confdefs.h <<EOF
3194 #define GCC_SCANFLIKE(fmt,var) $cf_value
3195 EOF
3196
3197                                 ;;
3198                         (unused)
3199
3200 cat >>confdefs.h <<EOF
3201 #define GCC_UNUSED $cf_directive
3202 EOF
3203
3204                                 ;;
3205                         esac
3206                 fi
3207         done
3208 else
3209         fgrep define conftest.i >>confdefs.h
3210 fi
3211 rm -rf conftest*
3212 fi
3213
3214 echo "$as_me:3214: checking if you want to work around bogus compiler/loader warnings" >&5
3215 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3216
3217 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3218 if test "${enable_string_hacks+set}" = set; then
3219   enableval="$enable_string_hacks"
3220   with_string_hacks=$enableval
3221 else
3222   with_string_hacks=no
3223 fi;
3224 echo "$as_me:3224: result: $with_string_hacks" >&5
3225 echo "${ECHO_T}$with_string_hacks" >&6
3226
3227 if test "x$with_string_hacks" = "xyes"; then
3228
3229 cat >>confdefs.h <<\EOF
3230 #define USE_STRING_HACKS 1
3231 EOF
3232
3233         { echo "$as_me:3233: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3234 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3235         echo "$as_me:3235: checking for strlcat" >&5
3236 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3237 if test "${ac_cv_func_strlcat+set}" = set; then
3238   echo $ECHO_N "(cached) $ECHO_C" >&6
3239 else
3240   cat >conftest.$ac_ext <<_ACEOF
3241 #line 3241 "configure"
3242 #include "confdefs.h"
3243 #define strlcat autoconf_temporary
3244 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3245 #undef strlcat
3246
3247 #ifdef __cplusplus
3248 extern "C"
3249 #endif
3250
3251 /* We use char because int might match the return type of a gcc2
3252    builtin and then its argument prototype would still apply.  */
3253 char strlcat (void);
3254
3255 int
3256 main (void)
3257 {
3258
3259 /* The GNU C library defines stubs for functions which it implements
3260     to always fail with ENOSYS.  Some functions are actually named
3261     something starting with __ and the normal name is an alias.  */
3262 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3263 #error found stub for strlcat
3264 #endif
3265
3266         return strlcat ();
3267   ;
3268   return 0;
3269 }
3270 _ACEOF
3271 rm -f conftest.$ac_objext conftest$ac_exeext
3272 if { (eval echo "$as_me:3272: \"$ac_link\"") >&5
3273   (eval $ac_link) 2>&5
3274   ac_status=$?
3275   echo "$as_me:3275: \$? = $ac_status" >&5
3276   (exit $ac_status); } &&
3277          { ac_try='test -s conftest$ac_exeext'
3278   { (eval echo "$as_me:3278: \"$ac_try\"") >&5
3279   (eval $ac_try) 2>&5
3280   ac_status=$?
3281   echo "$as_me:3281: \$? = $ac_status" >&5
3282   (exit $ac_status); }; }; then
3283   ac_cv_func_strlcat=yes
3284 else
3285   echo "$as_me: failed program was:" >&5
3286 cat conftest.$ac_ext >&5
3287 ac_cv_func_strlcat=no
3288 fi
3289 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3290 fi
3291 echo "$as_me:3291: result: $ac_cv_func_strlcat" >&5
3292 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3293 if test $ac_cv_func_strlcat = yes; then
3294
3295 cat >>confdefs.h <<\EOF
3296 #define HAVE_STRLCAT 1
3297 EOF
3298
3299 else
3300
3301                 echo "$as_me:3301: checking for strlcat in -lbsd" >&5
3302 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3303 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3304   echo $ECHO_N "(cached) $ECHO_C" >&6
3305 else
3306   ac_check_lib_save_LIBS=$LIBS
3307 LIBS="-lbsd  $LIBS"
3308 cat >conftest.$ac_ext <<_ACEOF
3309 #line 3309 "configure"
3310 #include "confdefs.h"
3311
3312 /* Override any gcc2 internal prototype to avoid an error.  */
3313 #ifdef __cplusplus
3314 extern "C"
3315 #endif
3316 /* We use char because int might match the return type of a gcc2
3317    builtin and then its argument prototype would still apply.  */
3318 char strlcat ();
3319 int
3320 main (void)
3321 {
3322 strlcat ();
3323   ;
3324   return 0;
3325 }
3326 _ACEOF
3327 rm -f conftest.$ac_objext conftest$ac_exeext
3328 if { (eval echo "$as_me:3328: \"$ac_link\"") >&5
3329   (eval $ac_link) 2>&5
3330   ac_status=$?
3331   echo "$as_me:3331: \$? = $ac_status" >&5
3332   (exit $ac_status); } &&
3333          { ac_try='test -s conftest$ac_exeext'
3334   { (eval echo "$as_me:3334: \"$ac_try\"") >&5
3335   (eval $ac_try) 2>&5
3336   ac_status=$?
3337   echo "$as_me:3337: \$? = $ac_status" >&5
3338   (exit $ac_status); }; }; then
3339   ac_cv_lib_bsd_strlcat=yes
3340 else
3341   echo "$as_me: failed program was:" >&5
3342 cat conftest.$ac_ext >&5
3343 ac_cv_lib_bsd_strlcat=no
3344 fi
3345 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3346 LIBS=$ac_check_lib_save_LIBS
3347 fi
3348 echo "$as_me:3348: result: $ac_cv_lib_bsd_strlcat" >&5
3349 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3350 if test $ac_cv_lib_bsd_strlcat = yes; then
3351
3352 cf_add_libs="-lbsd"
3353 # Filter out duplicates - this happens with badly-designed ".pc" files...
3354 for cf_add_1lib in $LIBS
3355 do
3356         for cf_add_2lib in $cf_add_libs
3357         do
3358                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3359                 then
3360                         cf_add_1lib=
3361                         break
3362                 fi
3363         done
3364         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3365 done
3366 LIBS="$cf_add_libs"
3367
3368 for ac_header in bsd/string.h
3369 do
3370 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3371 echo "$as_me:3371: checking for $ac_header" >&5
3372 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3373 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3374   echo $ECHO_N "(cached) $ECHO_C" >&6
3375 else
3376   cat >conftest.$ac_ext <<_ACEOF
3377 #line 3377 "configure"
3378 #include "confdefs.h"
3379 #include <$ac_header>
3380 _ACEOF
3381 if { (eval echo "$as_me:3381: \"$ac_cpp conftest.$ac_ext\"") >&5
3382   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3383   ac_status=$?
3384   egrep -v '^ *\+' conftest.er1 >conftest.err
3385   rm -f conftest.er1
3386   cat conftest.err >&5
3387   echo "$as_me:3387: \$? = $ac_status" >&5
3388   (exit $ac_status); } >/dev/null; then
3389   if test -s conftest.err; then
3390     ac_cpp_err=$ac_c_preproc_warn_flag
3391   else
3392     ac_cpp_err=
3393   fi
3394 else
3395   ac_cpp_err=yes
3396 fi
3397 if test -z "$ac_cpp_err"; then
3398   eval "$as_ac_Header=yes"
3399 else
3400   echo "$as_me: failed program was:" >&5
3401   cat conftest.$ac_ext >&5
3402   eval "$as_ac_Header=no"
3403 fi
3404 rm -f conftest.err conftest.$ac_ext
3405 fi
3406 echo "$as_me:3406: result: `eval echo '${'$as_ac_Header'}'`" >&5
3407 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3408 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3409   cat >>confdefs.h <<EOF
3410 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3411 EOF
3412
3413 fi
3414 done
3415
3416 cat >>confdefs.h <<\EOF
3417 #define HAVE_STRLCAT 1
3418 EOF
3419
3420 fi
3421
3422 fi
3423
3424 for ac_func in strlcpy snprintf
3425 do
3426 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3427 echo "$as_me:3427: checking for $ac_func" >&5
3428 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3429 if eval "test \"\${$as_ac_var+set}\" = set"; then
3430   echo $ECHO_N "(cached) $ECHO_C" >&6
3431 else
3432   cat >conftest.$ac_ext <<_ACEOF
3433 #line 3433 "configure"
3434 #include "confdefs.h"
3435 #define $ac_func autoconf_temporary
3436 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3437 #undef $ac_func
3438
3439 #ifdef __cplusplus
3440 extern "C"
3441 #endif
3442
3443 /* We use char because int might match the return type of a gcc2
3444    builtin and then its argument prototype would still apply.  */
3445 char $ac_func (void);
3446
3447 int
3448 main (void)
3449 {
3450
3451 /* The GNU C library defines stubs for functions which it implements
3452     to always fail with ENOSYS.  Some functions are actually named
3453     something starting with __ and the normal name is an alias.  */
3454 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3455 #error found stub for $ac_func
3456 #endif
3457
3458         return $ac_func ();
3459   ;
3460   return 0;
3461 }
3462 _ACEOF
3463 rm -f conftest.$ac_objext conftest$ac_exeext
3464 if { (eval echo "$as_me:3464: \"$ac_link\"") >&5
3465   (eval $ac_link) 2>&5
3466   ac_status=$?
3467   echo "$as_me:3467: \$? = $ac_status" >&5
3468   (exit $ac_status); } &&
3469          { ac_try='test -s conftest$ac_exeext'
3470   { (eval echo "$as_me:3470: \"$ac_try\"") >&5
3471   (eval $ac_try) 2>&5
3472   ac_status=$?
3473   echo "$as_me:3473: \$? = $ac_status" >&5
3474   (exit $ac_status); }; }; then
3475   eval "$as_ac_var=yes"
3476 else
3477   echo "$as_me: failed program was:" >&5
3478 cat conftest.$ac_ext >&5
3479 eval "$as_ac_var=no"
3480 fi
3481 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3482 fi
3483 echo "$as_me:3483: result: `eval echo '${'$as_ac_var'}'`" >&5
3484 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3485 if test `eval echo '${'$as_ac_var'}'` = yes; then
3486   cat >>confdefs.h <<EOF
3487 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3488 EOF
3489
3490 fi
3491 done
3492
3493 fi
3494
3495 echo "$as_me:3495: checking if the POSIX test-macros are already defined" >&5
3496 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3497 if test "${cf_cv_posix_visible+set}" = set; then
3498   echo $ECHO_N "(cached) $ECHO_C" >&6
3499 else
3500
3501 cat >conftest.$ac_ext <<_ACEOF
3502 #line 3502 "configure"
3503 #include "confdefs.h"
3504 #include <stdio.h>
3505 int
3506 main (void)
3507 {
3508
3509 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3510         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3511         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3512         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3513 #error conflicting symbols found
3514 #endif
3515
3516   ;
3517   return 0;
3518 }
3519 _ACEOF
3520 rm -f conftest.$ac_objext
3521 if { (eval echo "$as_me:3521: \"$ac_compile\"") >&5
3522   (eval $ac_compile) 2>&5
3523   ac_status=$?
3524   echo "$as_me:3524: \$? = $ac_status" >&5
3525   (exit $ac_status); } &&
3526          { ac_try='test -s conftest.$ac_objext'
3527   { (eval echo "$as_me:3527: \"$ac_try\"") >&5
3528   (eval $ac_try) 2>&5
3529   ac_status=$?
3530   echo "$as_me:3530: \$? = $ac_status" >&5
3531   (exit $ac_status); }; }; then
3532   cf_cv_posix_visible=no
3533 else
3534   echo "$as_me: failed program was:" >&5
3535 cat conftest.$ac_ext >&5
3536 cf_cv_posix_visible=yes
3537 fi
3538 rm -f conftest.$ac_objext conftest.$ac_ext
3539
3540 fi
3541 echo "$as_me:3541: result: $cf_cv_posix_visible" >&5
3542 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3543
3544 if test "$cf_cv_posix_visible" = no; then
3545
3546 cf_XOPEN_SOURCE=600
3547 cf_POSIX_C_SOURCE=199506L
3548 cf_xopen_source=
3549
3550 case $host_os in
3551 (aix[4-7]*)
3552         cf_xopen_source="-D_ALL_SOURCE"
3553         ;;
3554 (msys)
3555         cf_XOPEN_SOURCE=600
3556         ;;
3557 (darwin[0-8].*)
3558         cf_xopen_source="-D_APPLE_C_SOURCE"
3559         ;;
3560 (darwin*)
3561         cf_xopen_source="-D_DARWIN_C_SOURCE"
3562         cf_XOPEN_SOURCE=
3563         ;;
3564 (freebsd*|dragonfly*|midnightbsd*)
3565         # 5.x headers associate
3566         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3567         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3568         cf_POSIX_C_SOURCE=200112L
3569         cf_XOPEN_SOURCE=600
3570         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3571         ;;
3572 (hpux11*)
3573         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3574         ;;
3575 (hpux*)
3576         cf_xopen_source="-D_HPUX_SOURCE"
3577         ;;
3578 (irix[56].*)
3579         cf_xopen_source="-D_SGI_SOURCE"
3580         cf_XOPEN_SOURCE=
3581         ;;
3582 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3583
3584 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3585
3586 echo "$as_me:3586: checking if this is the GNU C library" >&5
3587 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3588 if test "${cf_cv_gnu_library+set}" = set; then
3589   echo $ECHO_N "(cached) $ECHO_C" >&6
3590 else
3591
3592 cat >conftest.$ac_ext <<_ACEOF
3593 #line 3593 "configure"
3594 #include "confdefs.h"
3595 #include <sys/types.h>
3596 int
3597 main (void)
3598 {
3599
3600         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3601                 return 0;
3602         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3603                 return 0;
3604         #else
3605         #       error not GNU C library
3606         #endif
3607   ;
3608   return 0;
3609 }
3610 _ACEOF
3611 rm -f conftest.$ac_objext
3612 if { (eval echo "$as_me:3612: \"$ac_compile\"") >&5
3613   (eval $ac_compile) 2>&5
3614   ac_status=$?
3615   echo "$as_me:3615: \$? = $ac_status" >&5
3616   (exit $ac_status); } &&
3617          { ac_try='test -s conftest.$ac_objext'
3618   { (eval echo "$as_me:3618: \"$ac_try\"") >&5
3619   (eval $ac_try) 2>&5
3620   ac_status=$?
3621   echo "$as_me:3621: \$? = $ac_status" >&5
3622   (exit $ac_status); }; }; then
3623   cf_cv_gnu_library=yes
3624 else
3625   echo "$as_me: failed program was:" >&5
3626 cat conftest.$ac_ext >&5
3627 cf_cv_gnu_library=no
3628 fi
3629 rm -f conftest.$ac_objext conftest.$ac_ext
3630
3631 fi
3632 echo "$as_me:3632: result: $cf_cv_gnu_library" >&5
3633 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3634
3635 if test x$cf_cv_gnu_library = xyes; then
3636
3637         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3638         # was changed to help a little.  newlib incorporated the change about 4
3639         # years later.
3640         echo "$as_me:3640: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3641 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3642 if test "${cf_cv_gnu_library_219+set}" = set; then
3643   echo $ECHO_N "(cached) $ECHO_C" >&6
3644 else
3645
3646                 cf_save="$CPPFLAGS"
3647
3648         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3649         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3650
3651                 cat >conftest.$ac_ext <<_ACEOF
3652 #line 3652 "configure"
3653 #include "confdefs.h"
3654 #include <sys/types.h>
3655 int
3656 main (void)
3657 {
3658
3659                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3660                                 return 0;
3661                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3662                                 return 0;
3663                         #else
3664                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3665                         #endif
3666   ;
3667   return 0;
3668 }
3669 _ACEOF
3670 rm -f conftest.$ac_objext
3671 if { (eval echo "$as_me:3671: \"$ac_compile\"") >&5
3672   (eval $ac_compile) 2>&5
3673   ac_status=$?
3674   echo "$as_me:3674: \$? = $ac_status" >&5
3675   (exit $ac_status); } &&
3676          { ac_try='test -s conftest.$ac_objext'
3677   { (eval echo "$as_me:3677: \"$ac_try\"") >&5
3678   (eval $ac_try) 2>&5
3679   ac_status=$?
3680   echo "$as_me:3680: \$? = $ac_status" >&5
3681   (exit $ac_status); }; }; then
3682   cf_cv_gnu_library_219=yes
3683 else
3684   echo "$as_me: failed program was:" >&5
3685 cat conftest.$ac_ext >&5
3686 cf_cv_gnu_library_219=no
3687 fi
3688 rm -f conftest.$ac_objext conftest.$ac_ext
3689                 CPPFLAGS="$cf_save"
3690
3691 fi
3692 echo "$as_me:3692: result: $cf_cv_gnu_library_219" >&5
3693 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3694
3695         if test "x$cf_cv_gnu_library_219" = xyes; then
3696                 cf_save="$CPPFLAGS"
3697                 echo "$as_me:3697: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3698 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3699 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3700   echo $ECHO_N "(cached) $ECHO_C" >&6
3701 else
3702
3703 cf_fix_cppflags=no
3704 cf_new_cflags=
3705 cf_new_cppflags=
3706 cf_new_extra_cppflags=
3707
3708 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3709 do
3710 case $cf_fix_cppflags in
3711 (no)
3712         case $cf_add_cflags in
3713         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3714                 case $cf_add_cflags in
3715                 (-D*)
3716                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3717
3718                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3719                                 && test -z "${cf_tst_cflags}" \
3720                                 && cf_fix_cppflags=yes
3721
3722                         if test $cf_fix_cppflags = yes ; then
3723
3724         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3725         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3726
3727                                 continue
3728                         elif test "${cf_tst_cflags}" = "\"'" ; then
3729
3730         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3731         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3732
3733                                 continue
3734                         fi
3735                         ;;
3736                 esac
3737                 case "$CPPFLAGS" in
3738                 (*$cf_add_cflags)
3739                         ;;
3740                 (*)
3741                         case $cf_add_cflags in
3742                         (-D*)
3743                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3744
3745 CPPFLAGS=`echo "$CPPFLAGS" | \
3746         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3747                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3748
3749                                 ;;
3750                         esac
3751
3752         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3753         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3754
3755                         ;;
3756                 esac
3757                 ;;
3758         (*)
3759
3760         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3761         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3762
3763                 ;;
3764         esac
3765         ;;
3766 (yes)
3767
3768         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3769         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3770
3771         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3772
3773         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3774                 && test -z "${cf_tst_cflags}" \
3775                 && cf_fix_cppflags=no
3776         ;;
3777 esac
3778 done
3779
3780 if test -n "$cf_new_cflags" ; then
3781
3782         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3783         CFLAGS="${CFLAGS}$cf_new_cflags"
3784
3785 fi
3786
3787 if test -n "$cf_new_cppflags" ; then
3788
3789         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3790         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3791
3792 fi
3793
3794 if test -n "$cf_new_extra_cppflags" ; then
3795
3796         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3797         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3798
3799 fi
3800
3801                         cat >conftest.$ac_ext <<_ACEOF
3802 #line 3802 "configure"
3803 #include "confdefs.h"
3804
3805                                 #include <limits.h>
3806                                 #include <sys/types.h>
3807
3808 int
3809 main (void)
3810 {
3811
3812                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3813                                         return 0;
3814                                 #else
3815                                 #       error GNU C library is too old
3816                                 #endif
3817   ;
3818   return 0;
3819 }
3820 _ACEOF
3821 rm -f conftest.$ac_objext
3822 if { (eval echo "$as_me:3822: \"$ac_compile\"") >&5
3823   (eval $ac_compile) 2>&5
3824   ac_status=$?
3825   echo "$as_me:3825: \$? = $ac_status" >&5
3826   (exit $ac_status); } &&
3827          { ac_try='test -s conftest.$ac_objext'
3828   { (eval echo "$as_me:3828: \"$ac_try\"") >&5
3829   (eval $ac_try) 2>&5
3830   ac_status=$?
3831   echo "$as_me:3831: \$? = $ac_status" >&5
3832   (exit $ac_status); }; }; then
3833   cf_cv_gnu_dftsrc_219=yes
3834 else
3835   echo "$as_me: failed program was:" >&5
3836 cat conftest.$ac_ext >&5
3837 cf_cv_gnu_dftsrc_219=no
3838 fi
3839 rm -f conftest.$ac_objext conftest.$ac_ext
3840
3841 fi
3842 echo "$as_me:3842: result: $cf_cv_gnu_dftsrc_219" >&5
3843 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3844                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3845         else
3846                 cf_cv_gnu_dftsrc_219=maybe
3847         fi
3848
3849         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3850
3851                 echo "$as_me:3851: checking if we must define _GNU_SOURCE" >&5
3852 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3853 if test "${cf_cv_gnu_source+set}" = set; then
3854   echo $ECHO_N "(cached) $ECHO_C" >&6
3855 else
3856
3857                 cat >conftest.$ac_ext <<_ACEOF
3858 #line 3858 "configure"
3859 #include "confdefs.h"
3860 #include <sys/types.h>
3861 int
3862 main (void)
3863 {
3864
3865                         #ifndef _XOPEN_SOURCE
3866                         #error  expected _XOPEN_SOURCE to be defined
3867                         #endif
3868   ;
3869   return 0;
3870 }
3871 _ACEOF
3872 rm -f conftest.$ac_objext
3873 if { (eval echo "$as_me:3873: \"$ac_compile\"") >&5
3874   (eval $ac_compile) 2>&5
3875   ac_status=$?
3876   echo "$as_me:3876: \$? = $ac_status" >&5
3877   (exit $ac_status); } &&
3878          { ac_try='test -s conftest.$ac_objext'
3879   { (eval echo "$as_me:3879: \"$ac_try\"") >&5
3880   (eval $ac_try) 2>&5
3881   ac_status=$?
3882   echo "$as_me:3882: \$? = $ac_status" >&5
3883   (exit $ac_status); }; }; then
3884   cf_cv_gnu_source=no
3885 else
3886   echo "$as_me: failed program was:" >&5
3887 cat conftest.$ac_ext >&5
3888 cf_save="$CPPFLAGS"
3889
3890 cf_fix_cppflags=no
3891 cf_new_cflags=
3892 cf_new_cppflags=
3893 cf_new_extra_cppflags=
3894
3895 for cf_add_cflags in -D_GNU_SOURCE
3896 do
3897 case $cf_fix_cppflags in
3898 (no)
3899         case $cf_add_cflags in
3900         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3901                 case $cf_add_cflags in
3902                 (-D*)
3903                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3904
3905                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3906                                 && test -z "${cf_tst_cflags}" \
3907                                 && cf_fix_cppflags=yes
3908
3909                         if test $cf_fix_cppflags = yes ; then
3910
3911         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3912         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3913
3914                                 continue
3915                         elif test "${cf_tst_cflags}" = "\"'" ; then
3916
3917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3919
3920                                 continue
3921                         fi
3922                         ;;
3923                 esac
3924                 case "$CPPFLAGS" in
3925                 (*$cf_add_cflags)
3926                         ;;
3927                 (*)
3928                         case $cf_add_cflags in
3929                         (-D*)
3930                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3931
3932 CPPFLAGS=`echo "$CPPFLAGS" | \
3933         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3934                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3935
3936                                 ;;
3937                         esac
3938
3939         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3940         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3941
3942                         ;;
3943                 esac
3944                 ;;
3945         (*)
3946
3947         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3948         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3949
3950                 ;;
3951         esac
3952         ;;
3953 (yes)
3954
3955         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3956         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3957
3958         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3959
3960         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3961                 && test -z "${cf_tst_cflags}" \
3962                 && cf_fix_cppflags=no
3963         ;;
3964 esac
3965 done
3966
3967 if test -n "$cf_new_cflags" ; then
3968
3969         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3970         CFLAGS="${CFLAGS}$cf_new_cflags"
3971
3972 fi
3973
3974 if test -n "$cf_new_cppflags" ; then
3975
3976         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3977         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3978
3979 fi
3980
3981 if test -n "$cf_new_extra_cppflags" ; then
3982
3983         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3984         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3985
3986 fi
3987
3988                          cat >conftest.$ac_ext <<_ACEOF
3989 #line 3989 "configure"
3990 #include "confdefs.h"
3991 #include <sys/types.h>
3992 int
3993 main (void)
3994 {
3995
3996                                 #ifdef _XOPEN_SOURCE
3997                                 #error  expected _XOPEN_SOURCE to be undefined
3998                                 #endif
3999   ;
4000   return 0;
4001 }
4002 _ACEOF
4003 rm -f conftest.$ac_objext
4004 if { (eval echo "$as_me:4004: \"$ac_compile\"") >&5
4005   (eval $ac_compile) 2>&5
4006   ac_status=$?
4007   echo "$as_me:4007: \$? = $ac_status" >&5
4008   (exit $ac_status); } &&
4009          { ac_try='test -s conftest.$ac_objext'
4010   { (eval echo "$as_me:4010: \"$ac_try\"") >&5
4011   (eval $ac_try) 2>&5
4012   ac_status=$?
4013   echo "$as_me:4013: \$? = $ac_status" >&5
4014   (exit $ac_status); }; }; then
4015   cf_cv_gnu_source=no
4016 else
4017   echo "$as_me: failed program was:" >&5
4018 cat conftest.$ac_ext >&5
4019 cf_cv_gnu_source=yes
4020 fi
4021 rm -f conftest.$ac_objext conftest.$ac_ext
4022                         CPPFLAGS="$cf_save"
4023
4024 fi
4025 rm -f conftest.$ac_objext conftest.$ac_ext
4026
4027 fi
4028 echo "$as_me:4028: result: $cf_cv_gnu_source" >&5
4029 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4030
4031                 if test "$cf_cv_gnu_source" = yes
4032                 then
4033                 echo "$as_me:4033: checking if we should also define _DEFAULT_SOURCE" >&5
4034 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4035 if test "${cf_cv_default_source+set}" = set; then
4036   echo $ECHO_N "(cached) $ECHO_C" >&6
4037 else
4038
4039         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4040         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4041
4042                         cat >conftest.$ac_ext <<_ACEOF
4043 #line 4043 "configure"
4044 #include "confdefs.h"
4045 #include <sys/types.h>
4046 int
4047 main (void)
4048 {
4049
4050                                 #ifdef _DEFAULT_SOURCE
4051                                 #error  expected _DEFAULT_SOURCE to be undefined
4052                                 #endif
4053   ;
4054   return 0;
4055 }
4056 _ACEOF
4057 rm -f conftest.$ac_objext
4058 if { (eval echo "$as_me:4058: \"$ac_compile\"") >&5
4059   (eval $ac_compile) 2>&5
4060   ac_status=$?
4061   echo "$as_me:4061: \$? = $ac_status" >&5
4062   (exit $ac_status); } &&
4063          { ac_try='test -s conftest.$ac_objext'
4064   { (eval echo "$as_me:4064: \"$ac_try\"") >&5
4065   (eval $ac_try) 2>&5
4066   ac_status=$?
4067   echo "$as_me:4067: \$? = $ac_status" >&5
4068   (exit $ac_status); }; }; then
4069   cf_cv_default_source=no
4070 else
4071   echo "$as_me: failed program was:" >&5
4072 cat conftest.$ac_ext >&5
4073 cf_cv_default_source=yes
4074 fi
4075 rm -f conftest.$ac_objext conftest.$ac_ext
4076
4077 fi
4078 echo "$as_me:4078: result: $cf_cv_default_source" >&5
4079 echo "${ECHO_T}$cf_cv_default_source" >&6
4080                         if test "$cf_cv_default_source" = yes
4081                         then
4082
4083         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4084         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4085
4086                         fi
4087                 fi
4088         fi
4089
4090 fi
4091
4092         ;;
4093 (minix*)
4094         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4095         ;;
4096 (mirbsd*)
4097         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4098         cf_XOPEN_SOURCE=
4099
4100 if test "$cf_cv_posix_visible" = no; then
4101
4102 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4103
4104 cf_save_CFLAGS="$CFLAGS"
4105 cf_save_CPPFLAGS="$CPPFLAGS"
4106
4107 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4108         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4109                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4110
4111 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4112         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4113                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4114
4115 echo "$as_me:4115: checking if we should define _POSIX_C_SOURCE" >&5
4116 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4117 if test "${cf_cv_posix_c_source+set}" = set; then
4118   echo $ECHO_N "(cached) $ECHO_C" >&6
4119 else
4120
4121 echo "${as_me:-configure}:4121: testing if the symbol is already defined go no further ..." 1>&5
4122
4123         cat >conftest.$ac_ext <<_ACEOF
4124 #line 4124 "configure"
4125 #include "confdefs.h"
4126 #include <sys/types.h>
4127 int
4128 main (void)
4129 {
4130
4131 #ifndef _POSIX_C_SOURCE
4132 make an error
4133 #endif
4134   ;
4135   return 0;
4136 }
4137 _ACEOF
4138 rm -f conftest.$ac_objext
4139 if { (eval echo "$as_me:4139: \"$ac_compile\"") >&5
4140   (eval $ac_compile) 2>&5
4141   ac_status=$?
4142   echo "$as_me:4142: \$? = $ac_status" >&5
4143   (exit $ac_status); } &&
4144          { ac_try='test -s conftest.$ac_objext'
4145   { (eval echo "$as_me:4145: \"$ac_try\"") >&5
4146   (eval $ac_try) 2>&5
4147   ac_status=$?
4148   echo "$as_me:4148: \$? = $ac_status" >&5
4149   (exit $ac_status); }; }; then
4150   cf_cv_posix_c_source=no
4151 else
4152   echo "$as_me: failed program was:" >&5
4153 cat conftest.$ac_ext >&5
4154 cf_want_posix_source=no
4155          case .$cf_POSIX_C_SOURCE in
4156          (.[12]??*)
4157                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4158                 ;;
4159          (.2)
4160                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4161                 cf_want_posix_source=yes
4162                 ;;
4163          (.*)
4164                 cf_want_posix_source=yes
4165                 ;;
4166          esac
4167          if test "$cf_want_posix_source" = yes ; then
4168                 cat >conftest.$ac_ext <<_ACEOF
4169 #line 4169 "configure"
4170 #include "confdefs.h"
4171 #include <sys/types.h>
4172 int
4173 main (void)
4174 {
4175
4176 #ifdef _POSIX_SOURCE
4177 make an error
4178 #endif
4179   ;
4180   return 0;
4181 }
4182 _ACEOF
4183 rm -f conftest.$ac_objext
4184 if { (eval echo "$as_me:4184: \"$ac_compile\"") >&5
4185   (eval $ac_compile) 2>&5
4186   ac_status=$?
4187   echo "$as_me:4187: \$? = $ac_status" >&5
4188   (exit $ac_status); } &&
4189          { ac_try='test -s conftest.$ac_objext'
4190   { (eval echo "$as_me:4190: \"$ac_try\"") >&5
4191   (eval $ac_try) 2>&5
4192   ac_status=$?
4193   echo "$as_me:4193: \$? = $ac_status" >&5
4194   (exit $ac_status); }; }; then
4195   :
4196 else
4197   echo "$as_me: failed program was:" >&5
4198 cat conftest.$ac_ext >&5
4199 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4200 fi
4201 rm -f conftest.$ac_objext conftest.$ac_ext
4202          fi
4203
4204 echo "${as_me:-configure}:4204: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4205
4206          CFLAGS="$cf_trim_CFLAGS"
4207          CPPFLAGS="$cf_trim_CPPFLAGS"
4208
4209         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4210         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4211
4212 echo "${as_me:-configure}:4212: testing if the second compile does not leave our definition intact error ..." 1>&5
4213
4214          cat >conftest.$ac_ext <<_ACEOF
4215 #line 4215 "configure"
4216 #include "confdefs.h"
4217 #include <sys/types.h>
4218 int
4219 main (void)
4220 {
4221
4222 #ifndef _POSIX_C_SOURCE
4223 make an error
4224 #endif
4225   ;
4226   return 0;
4227 }
4228 _ACEOF
4229 rm -f conftest.$ac_objext
4230 if { (eval echo "$as_me:4230: \"$ac_compile\"") >&5
4231   (eval $ac_compile) 2>&5
4232   ac_status=$?
4233   echo "$as_me:4233: \$? = $ac_status" >&5
4234   (exit $ac_status); } &&
4235          { ac_try='test -s conftest.$ac_objext'
4236   { (eval echo "$as_me:4236: \"$ac_try\"") >&5
4237   (eval $ac_try) 2>&5
4238   ac_status=$?
4239   echo "$as_me:4239: \$? = $ac_status" >&5
4240   (exit $ac_status); }; }; then
4241   :
4242 else
4243   echo "$as_me: failed program was:" >&5
4244 cat conftest.$ac_ext >&5
4245 cf_cv_posix_c_source=no
4246 fi
4247 rm -f conftest.$ac_objext conftest.$ac_ext
4248          CFLAGS="$cf_save_CFLAGS"
4249          CPPFLAGS="$cf_save_CPPFLAGS"
4250
4251 fi
4252 rm -f conftest.$ac_objext conftest.$ac_ext
4253
4254 fi
4255 echo "$as_me:4255: result: $cf_cv_posix_c_source" >&5
4256 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4257
4258 if test "$cf_cv_posix_c_source" != no ; then
4259         CFLAGS="$cf_trim_CFLAGS"
4260         CPPFLAGS="$cf_trim_CPPFLAGS"
4261
4262 cf_fix_cppflags=no
4263 cf_new_cflags=
4264 cf_new_cppflags=
4265 cf_new_extra_cppflags=
4266
4267 for cf_add_cflags in $cf_cv_posix_c_source
4268 do
4269 case $cf_fix_cppflags in
4270 (no)
4271         case $cf_add_cflags in
4272         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4273                 case $cf_add_cflags in
4274                 (-D*)
4275                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4276
4277                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4278                                 && test -z "${cf_tst_cflags}" \
4279                                 && cf_fix_cppflags=yes
4280
4281                         if test $cf_fix_cppflags = yes ; then
4282
4283         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4284         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4285
4286                                 continue
4287                         elif test "${cf_tst_cflags}" = "\"'" ; then
4288
4289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4291
4292                                 continue
4293                         fi
4294                         ;;
4295                 esac
4296                 case "$CPPFLAGS" in
4297                 (*$cf_add_cflags)
4298                         ;;
4299                 (*)
4300                         case $cf_add_cflags in
4301                         (-D*)
4302                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4303
4304 CPPFLAGS=`echo "$CPPFLAGS" | \
4305         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4306                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4307
4308                                 ;;
4309                         esac
4310
4311         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4312         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4313
4314                         ;;
4315                 esac
4316                 ;;
4317         (*)
4318
4319         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4320         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4321
4322                 ;;
4323         esac
4324         ;;
4325 (yes)
4326
4327         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4328         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4329
4330         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4331
4332         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4333                 && test -z "${cf_tst_cflags}" \
4334                 && cf_fix_cppflags=no
4335         ;;
4336 esac
4337 done
4338
4339 if test -n "$cf_new_cflags" ; then
4340
4341         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4342         CFLAGS="${CFLAGS}$cf_new_cflags"
4343
4344 fi
4345
4346 if test -n "$cf_new_cppflags" ; then
4347
4348         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4349         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4350
4351 fi
4352
4353 if test -n "$cf_new_extra_cppflags" ; then
4354
4355         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4356         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4357
4358 fi
4359
4360 fi
4361
4362 fi # cf_cv_posix_visible
4363
4364         ;;
4365 (netbsd*)
4366         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4367         ;;
4368 (openbsd[4-9]*)
4369         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4370         cf_xopen_source="-D_BSD_SOURCE"
4371         cf_XOPEN_SOURCE=600
4372         ;;
4373 (openbsd*)
4374         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4375         ;;
4376 (osf[45]*)
4377         cf_xopen_source="-D_OSF_SOURCE"
4378         ;;
4379 (nto-qnx*)
4380         cf_xopen_source="-D_QNX_SOURCE"
4381         ;;
4382 (sco*)
4383         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4384         ;;
4385 (solaris2.*)
4386         cf_xopen_source="-D__EXTENSIONS__"
4387         cf_cv_xopen_source=broken
4388         ;;
4389 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4390         cf_XOPEN_SOURCE=
4391         cf_POSIX_C_SOURCE=
4392         ;;
4393 (*)
4394
4395 echo "$as_me:4395: checking if we should define _XOPEN_SOURCE" >&5
4396 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4397 if test "${cf_cv_xopen_source+set}" = set; then
4398   echo $ECHO_N "(cached) $ECHO_C" >&6
4399 else
4400
4401         cat >conftest.$ac_ext <<_ACEOF
4402 #line 4402 "configure"
4403 #include "confdefs.h"
4404
4405 #include <stdlib.h>
4406 #include <string.h>
4407 #include <sys/types.h>
4408
4409 int
4410 main (void)
4411 {
4412
4413 #ifndef _XOPEN_SOURCE
4414 make an error
4415 #endif
4416   ;
4417   return 0;
4418 }
4419 _ACEOF
4420 rm -f conftest.$ac_objext
4421 if { (eval echo "$as_me:4421: \"$ac_compile\"") >&5
4422   (eval $ac_compile) 2>&5
4423   ac_status=$?
4424   echo "$as_me:4424: \$? = $ac_status" >&5
4425   (exit $ac_status); } &&
4426          { ac_try='test -s conftest.$ac_objext'
4427   { (eval echo "$as_me:4427: \"$ac_try\"") >&5
4428   (eval $ac_try) 2>&5
4429   ac_status=$?
4430   echo "$as_me:4430: \$? = $ac_status" >&5
4431   (exit $ac_status); }; }; then
4432   cf_cv_xopen_source=no
4433 else
4434   echo "$as_me: failed program was:" >&5
4435 cat conftest.$ac_ext >&5
4436 cf_save="$CPPFLAGS"
4437
4438         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4439         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4440
4441          cat >conftest.$ac_ext <<_ACEOF
4442 #line 4442 "configure"
4443 #include "confdefs.h"
4444
4445 #include <stdlib.h>
4446 #include <string.h>
4447 #include <sys/types.h>
4448
4449 int
4450 main (void)
4451 {
4452
4453 #ifdef _XOPEN_SOURCE
4454 make an error
4455 #endif
4456   ;
4457   return 0;
4458 }
4459 _ACEOF
4460 rm -f conftest.$ac_objext
4461 if { (eval echo "$as_me:4461: \"$ac_compile\"") >&5
4462   (eval $ac_compile) 2>&5
4463   ac_status=$?
4464   echo "$as_me:4464: \$? = $ac_status" >&5
4465   (exit $ac_status); } &&
4466          { ac_try='test -s conftest.$ac_objext'
4467   { (eval echo "$as_me:4467: \"$ac_try\"") >&5
4468   (eval $ac_try) 2>&5
4469   ac_status=$?
4470   echo "$as_me:4470: \$? = $ac_status" >&5
4471   (exit $ac_status); }; }; then
4472   cf_cv_xopen_source=no
4473 else
4474   echo "$as_me: failed program was:" >&5
4475 cat conftest.$ac_ext >&5
4476 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4477 fi
4478 rm -f conftest.$ac_objext conftest.$ac_ext
4479         CPPFLAGS="$cf_save"
4480
4481 fi
4482 rm -f conftest.$ac_objext conftest.$ac_ext
4483
4484 fi
4485 echo "$as_me:4485: result: $cf_cv_xopen_source" >&5
4486 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4487
4488 if test "$cf_cv_xopen_source" != no ; then
4489
4490 CFLAGS=`echo "$CFLAGS" | \
4491         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4492                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4493
4494 CPPFLAGS=`echo "$CPPFLAGS" | \
4495         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4496                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4497
4498         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4499
4500 cf_fix_cppflags=no
4501 cf_new_cflags=
4502 cf_new_cppflags=
4503 cf_new_extra_cppflags=
4504
4505 for cf_add_cflags in $cf_temp_xopen_source
4506 do
4507 case $cf_fix_cppflags in
4508 (no)
4509         case $cf_add_cflags in
4510         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4511                 case $cf_add_cflags in
4512                 (-D*)
4513                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4514
4515                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4516                                 && test -z "${cf_tst_cflags}" \
4517                                 && cf_fix_cppflags=yes
4518
4519                         if test $cf_fix_cppflags = yes ; then
4520
4521         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4522         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4523
4524                                 continue
4525                         elif test "${cf_tst_cflags}" = "\"'" ; then
4526
4527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4529
4530                                 continue
4531                         fi
4532                         ;;
4533                 esac
4534                 case "$CPPFLAGS" in
4535                 (*$cf_add_cflags)
4536                         ;;
4537                 (*)
4538                         case $cf_add_cflags in
4539                         (-D*)
4540                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4541
4542 CPPFLAGS=`echo "$CPPFLAGS" | \
4543         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4544                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4545
4546                                 ;;
4547                         esac
4548
4549         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4550         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4551
4552                         ;;
4553                 esac
4554                 ;;
4555         (*)
4556
4557         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4558         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4559
4560                 ;;
4561         esac
4562         ;;
4563 (yes)
4564
4565         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4566         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4567
4568         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4569
4570         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4571                 && test -z "${cf_tst_cflags}" \
4572                 && cf_fix_cppflags=no
4573         ;;
4574 esac
4575 done
4576
4577 if test -n "$cf_new_cflags" ; then
4578
4579         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4580         CFLAGS="${CFLAGS}$cf_new_cflags"
4581
4582 fi
4583
4584 if test -n "$cf_new_cppflags" ; then
4585
4586         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4587         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4588
4589 fi
4590
4591 if test -n "$cf_new_extra_cppflags" ; then
4592
4593         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4594         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4595
4596 fi
4597
4598 fi
4599
4600 if test "$cf_cv_posix_visible" = no; then
4601
4602 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4603
4604 cf_save_CFLAGS="$CFLAGS"
4605 cf_save_CPPFLAGS="$CPPFLAGS"
4606
4607 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4608         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4609                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4610
4611 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4612         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4613                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4614
4615 echo "$as_me:4615: checking if we should define _POSIX_C_SOURCE" >&5
4616 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4617 if test "${cf_cv_posix_c_source+set}" = set; then
4618   echo $ECHO_N "(cached) $ECHO_C" >&6
4619 else
4620
4621 echo "${as_me:-configure}:4621: testing if the symbol is already defined go no further ..." 1>&5
4622
4623         cat >conftest.$ac_ext <<_ACEOF
4624 #line 4624 "configure"
4625 #include "confdefs.h"
4626 #include <sys/types.h>
4627 int
4628 main (void)
4629 {
4630
4631 #ifndef _POSIX_C_SOURCE
4632 make an error
4633 #endif
4634   ;
4635   return 0;
4636 }
4637 _ACEOF
4638 rm -f conftest.$ac_objext
4639 if { (eval echo "$as_me:4639: \"$ac_compile\"") >&5
4640   (eval $ac_compile) 2>&5
4641   ac_status=$?
4642   echo "$as_me:4642: \$? = $ac_status" >&5
4643   (exit $ac_status); } &&
4644          { ac_try='test -s conftest.$ac_objext'
4645   { (eval echo "$as_me:4645: \"$ac_try\"") >&5
4646   (eval $ac_try) 2>&5
4647   ac_status=$?
4648   echo "$as_me:4648: \$? = $ac_status" >&5
4649   (exit $ac_status); }; }; then
4650   cf_cv_posix_c_source=no
4651 else
4652   echo "$as_me: failed program was:" >&5
4653 cat conftest.$ac_ext >&5
4654 cf_want_posix_source=no
4655          case .$cf_POSIX_C_SOURCE in
4656          (.[12]??*)
4657                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4658                 ;;
4659          (.2)
4660                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4661                 cf_want_posix_source=yes
4662                 ;;
4663          (.*)
4664                 cf_want_posix_source=yes
4665                 ;;
4666          esac
4667          if test "$cf_want_posix_source" = yes ; then
4668                 cat >conftest.$ac_ext <<_ACEOF
4669 #line 4669 "configure"
4670 #include "confdefs.h"
4671 #include <sys/types.h>
4672 int
4673 main (void)
4674 {
4675
4676 #ifdef _POSIX_SOURCE
4677 make an error
4678 #endif
4679   ;
4680   return 0;
4681 }
4682 _ACEOF
4683 rm -f conftest.$ac_objext
4684 if { (eval echo "$as_me:4684: \"$ac_compile\"") >&5
4685   (eval $ac_compile) 2>&5
4686   ac_status=$?
4687   echo "$as_me:4687: \$? = $ac_status" >&5
4688   (exit $ac_status); } &&
4689          { ac_try='test -s conftest.$ac_objext'
4690   { (eval echo "$as_me:4690: \"$ac_try\"") >&5
4691   (eval $ac_try) 2>&5
4692   ac_status=$?
4693   echo "$as_me:4693: \$? = $ac_status" >&5
4694   (exit $ac_status); }; }; then
4695   :
4696 else
4697   echo "$as_me: failed program was:" >&5
4698 cat conftest.$ac_ext >&5
4699 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4700 fi
4701 rm -f conftest.$ac_objext conftest.$ac_ext
4702          fi
4703
4704 echo "${as_me:-configure}:4704: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4705
4706          CFLAGS="$cf_trim_CFLAGS"
4707          CPPFLAGS="$cf_trim_CPPFLAGS"
4708
4709         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4710         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4711
4712 echo "${as_me:-configure}:4712: testing if the second compile does not leave our definition intact error ..." 1>&5
4713
4714          cat >conftest.$ac_ext <<_ACEOF
4715 #line 4715 "configure"
4716 #include "confdefs.h"
4717 #include <sys/types.h>
4718 int
4719 main (void)
4720 {
4721
4722 #ifndef _POSIX_C_SOURCE
4723 make an error
4724 #endif
4725   ;
4726   return 0;
4727 }
4728 _ACEOF
4729 rm -f conftest.$ac_objext
4730 if { (eval echo "$as_me:4730: \"$ac_compile\"") >&5
4731   (eval $ac_compile) 2>&5
4732   ac_status=$?
4733   echo "$as_me:4733: \$? = $ac_status" >&5
4734   (exit $ac_status); } &&
4735          { ac_try='test -s conftest.$ac_objext'
4736   { (eval echo "$as_me:4736: \"$ac_try\"") >&5
4737   (eval $ac_try) 2>&5
4738   ac_status=$?
4739   echo "$as_me:4739: \$? = $ac_status" >&5
4740   (exit $ac_status); }; }; then
4741   :
4742 else
4743   echo "$as_me: failed program was:" >&5
4744 cat conftest.$ac_ext >&5
4745 cf_cv_posix_c_source=no
4746 fi
4747 rm -f conftest.$ac_objext conftest.$ac_ext
4748          CFLAGS="$cf_save_CFLAGS"
4749          CPPFLAGS="$cf_save_CPPFLAGS"
4750
4751 fi
4752 rm -f conftest.$ac_objext conftest.$ac_ext
4753
4754 fi
4755 echo "$as_me:4755: result: $cf_cv_posix_c_source" >&5
4756 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4757
4758 if test "$cf_cv_posix_c_source" != no ; then
4759         CFLAGS="$cf_trim_CFLAGS"
4760         CPPFLAGS="$cf_trim_CPPFLAGS"
4761
4762 cf_fix_cppflags=no
4763 cf_new_cflags=
4764 cf_new_cppflags=
4765 cf_new_extra_cppflags=
4766
4767 for cf_add_cflags in $cf_cv_posix_c_source
4768 do
4769 case $cf_fix_cppflags in
4770 (no)
4771         case $cf_add_cflags in
4772         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4773                 case $cf_add_cflags in
4774                 (-D*)
4775                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4776
4777                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4778                                 && test -z "${cf_tst_cflags}" \
4779                                 && cf_fix_cppflags=yes
4780
4781                         if test $cf_fix_cppflags = yes ; then
4782
4783         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4784         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4785
4786                                 continue
4787                         elif test "${cf_tst_cflags}" = "\"'" ; then
4788
4789         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4790         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4791
4792                                 continue
4793                         fi
4794                         ;;
4795                 esac
4796                 case "$CPPFLAGS" in
4797                 (*$cf_add_cflags)
4798                         ;;
4799                 (*)
4800                         case $cf_add_cflags in
4801                         (-D*)
4802                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4803
4804 CPPFLAGS=`echo "$CPPFLAGS" | \
4805         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4806                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4807
4808                                 ;;
4809                         esac
4810
4811         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4812         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4813
4814                         ;;
4815                 esac
4816                 ;;
4817         (*)
4818
4819         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4820         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4821
4822                 ;;
4823         esac
4824         ;;
4825 (yes)
4826
4827         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4828         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4829
4830         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4831
4832         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4833                 && test -z "${cf_tst_cflags}" \
4834                 && cf_fix_cppflags=no
4835         ;;
4836 esac
4837 done
4838
4839 if test -n "$cf_new_cflags" ; then
4840
4841         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4842         CFLAGS="${CFLAGS}$cf_new_cflags"
4843
4844 fi
4845
4846 if test -n "$cf_new_cppflags" ; then
4847
4848         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4849         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4850
4851 fi
4852
4853 if test -n "$cf_new_extra_cppflags" ; then
4854
4855         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4856         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4857
4858 fi
4859
4860 fi
4861
4862 fi # cf_cv_posix_visible
4863
4864         ;;
4865 esac
4866
4867 if test -n "$cf_xopen_source" ; then
4868
4869 cf_fix_cppflags=no
4870 cf_new_cflags=
4871 cf_new_cppflags=
4872 cf_new_extra_cppflags=
4873
4874 for cf_add_cflags in $cf_xopen_source
4875 do
4876 case $cf_fix_cppflags in
4877 (no)
4878         case $cf_add_cflags in
4879         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4880                 case $cf_add_cflags in
4881                 (-D*)
4882                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4883
4884                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4885                                 && test -z "${cf_tst_cflags}" \
4886                                 && cf_fix_cppflags=yes
4887
4888                         if test $cf_fix_cppflags = yes ; then
4889
4890         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4891         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4892
4893                                 continue
4894                         elif test "${cf_tst_cflags}" = "\"'" ; then
4895
4896         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4897         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4898
4899                                 continue
4900                         fi
4901                         ;;
4902                 esac
4903                 case "$CPPFLAGS" in
4904                 (*$cf_add_cflags)
4905                         ;;
4906                 (*)
4907                         case $cf_add_cflags in
4908                         (-D*)
4909                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4910
4911 CPPFLAGS=`echo "$CPPFLAGS" | \
4912         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4913                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4914
4915                                 ;;
4916                         esac
4917
4918         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4919         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4920
4921                         ;;
4922                 esac
4923                 ;;
4924         (*)
4925
4926         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4927         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4928
4929                 ;;
4930         esac
4931         ;;
4932 (yes)
4933
4934         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4935         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4936
4937         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4938
4939         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4940                 && test -z "${cf_tst_cflags}" \
4941                 && cf_fix_cppflags=no
4942         ;;
4943 esac
4944 done
4945
4946 if test -n "$cf_new_cflags" ; then
4947         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4948
4949 echo "${as_me:-configure}:4949: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4950
4951         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4952         CFLAGS="${CFLAGS}$cf_new_cflags"
4953
4954 fi
4955
4956 if test -n "$cf_new_cppflags" ; then
4957         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4958
4959 echo "${as_me:-configure}:4959: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4960
4961         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4962         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4963
4964 fi
4965
4966 if test -n "$cf_new_extra_cppflags" ; then
4967         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4968
4969 echo "${as_me:-configure}:4969: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4970
4971         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4972         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4973
4974 fi
4975
4976 fi
4977
4978 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4979         echo "$as_me:4979: checking if _XOPEN_SOURCE really is set" >&5
4980 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4981         cat >conftest.$ac_ext <<_ACEOF
4982 #line 4982 "configure"
4983 #include "confdefs.h"
4984 #include <stdlib.h>
4985 int
4986 main (void)
4987 {
4988
4989 #ifndef _XOPEN_SOURCE
4990 make an error
4991 #endif
4992   ;
4993   return 0;
4994 }
4995 _ACEOF
4996 rm -f conftest.$ac_objext
4997 if { (eval echo "$as_me:4997: \"$ac_compile\"") >&5
4998   (eval $ac_compile) 2>&5
4999   ac_status=$?
5000   echo "$as_me:5000: \$? = $ac_status" >&5
5001   (exit $ac_status); } &&
5002          { ac_try='test -s conftest.$ac_objext'
5003   { (eval echo "$as_me:5003: \"$ac_try\"") >&5
5004   (eval $ac_try) 2>&5
5005   ac_status=$?
5006   echo "$as_me:5006: \$? = $ac_status" >&5
5007   (exit $ac_status); }; }; then
5008   cf_XOPEN_SOURCE_set=yes
5009 else
5010   echo "$as_me: failed program was:" >&5
5011 cat conftest.$ac_ext >&5
5012 cf_XOPEN_SOURCE_set=no
5013 fi
5014 rm -f conftest.$ac_objext conftest.$ac_ext
5015         echo "$as_me:5015: result: $cf_XOPEN_SOURCE_set" >&5
5016 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5017         if test $cf_XOPEN_SOURCE_set = yes
5018         then
5019                 cat >conftest.$ac_ext <<_ACEOF
5020 #line 5020 "configure"
5021 #include "confdefs.h"
5022 #include <stdlib.h>
5023 int
5024 main (void)
5025 {
5026
5027 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5028 make an error
5029 #endif
5030   ;
5031   return 0;
5032 }
5033 _ACEOF
5034 rm -f conftest.$ac_objext
5035 if { (eval echo "$as_me:5035: \"$ac_compile\"") >&5
5036   (eval $ac_compile) 2>&5
5037   ac_status=$?
5038   echo "$as_me:5038: \$? = $ac_status" >&5
5039   (exit $ac_status); } &&
5040          { ac_try='test -s conftest.$ac_objext'
5041   { (eval echo "$as_me:5041: \"$ac_try\"") >&5
5042   (eval $ac_try) 2>&5
5043   ac_status=$?
5044   echo "$as_me:5044: \$? = $ac_status" >&5
5045   (exit $ac_status); }; }; then
5046   cf_XOPEN_SOURCE_set_ok=yes
5047 else
5048   echo "$as_me: failed program was:" >&5
5049 cat conftest.$ac_ext >&5
5050 cf_XOPEN_SOURCE_set_ok=no
5051 fi
5052 rm -f conftest.$ac_objext conftest.$ac_ext
5053                 if test $cf_XOPEN_SOURCE_set_ok = no
5054                 then
5055                         { echo "$as_me:5055: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5056 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5057                 fi
5058         else
5059
5060 echo "$as_me:5060: checking if we should define _XOPEN_SOURCE" >&5
5061 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5062 if test "${cf_cv_xopen_source+set}" = set; then
5063   echo $ECHO_N "(cached) $ECHO_C" >&6
5064 else
5065
5066         cat >conftest.$ac_ext <<_ACEOF
5067 #line 5067 "configure"
5068 #include "confdefs.h"
5069
5070 #include <stdlib.h>
5071 #include <string.h>
5072 #include <sys/types.h>
5073
5074 int
5075 main (void)
5076 {
5077
5078 #ifndef _XOPEN_SOURCE
5079 make an error
5080 #endif
5081   ;
5082   return 0;
5083 }
5084 _ACEOF
5085 rm -f conftest.$ac_objext
5086 if { (eval echo "$as_me:5086: \"$ac_compile\"") >&5
5087   (eval $ac_compile) 2>&5
5088   ac_status=$?
5089   echo "$as_me:5089: \$? = $ac_status" >&5
5090   (exit $ac_status); } &&
5091          { ac_try='test -s conftest.$ac_objext'
5092   { (eval echo "$as_me:5092: \"$ac_try\"") >&5
5093   (eval $ac_try) 2>&5
5094   ac_status=$?
5095   echo "$as_me:5095: \$? = $ac_status" >&5
5096   (exit $ac_status); }; }; then
5097   cf_cv_xopen_source=no
5098 else
5099   echo "$as_me: failed program was:" >&5
5100 cat conftest.$ac_ext >&5
5101 cf_save="$CPPFLAGS"
5102
5103         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5104         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5105
5106          cat >conftest.$ac_ext <<_ACEOF
5107 #line 5107 "configure"
5108 #include "confdefs.h"
5109
5110 #include <stdlib.h>
5111 #include <string.h>
5112 #include <sys/types.h>
5113
5114 int
5115 main (void)
5116 {
5117
5118 #ifdef _XOPEN_SOURCE
5119 make an error
5120 #endif
5121   ;
5122   return 0;
5123 }
5124 _ACEOF
5125 rm -f conftest.$ac_objext
5126 if { (eval echo "$as_me:5126: \"$ac_compile\"") >&5
5127   (eval $ac_compile) 2>&5
5128   ac_status=$?
5129   echo "$as_me:5129: \$? = $ac_status" >&5
5130   (exit $ac_status); } &&
5131          { ac_try='test -s conftest.$ac_objext'
5132   { (eval echo "$as_me:5132: \"$ac_try\"") >&5
5133   (eval $ac_try) 2>&5
5134   ac_status=$?
5135   echo "$as_me:5135: \$? = $ac_status" >&5
5136   (exit $ac_status); }; }; then
5137   cf_cv_xopen_source=no
5138 else
5139   echo "$as_me: failed program was:" >&5
5140 cat conftest.$ac_ext >&5
5141 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5142 fi
5143 rm -f conftest.$ac_objext conftest.$ac_ext
5144         CPPFLAGS="$cf_save"
5145
5146 fi
5147 rm -f conftest.$ac_objext conftest.$ac_ext
5148
5149 fi
5150 echo "$as_me:5150: result: $cf_cv_xopen_source" >&5
5151 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5152
5153 if test "$cf_cv_xopen_source" != no ; then
5154
5155 CFLAGS=`echo "$CFLAGS" | \
5156         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5157                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5158
5159 CPPFLAGS=`echo "$CPPFLAGS" | \
5160         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5161                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5162
5163         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5164
5165 cf_fix_cppflags=no
5166 cf_new_cflags=
5167 cf_new_cppflags=
5168 cf_new_extra_cppflags=
5169
5170 for cf_add_cflags in $cf_temp_xopen_source
5171 do
5172 case $cf_fix_cppflags in
5173 (no)
5174         case $cf_add_cflags in
5175         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5176                 case $cf_add_cflags in
5177                 (-D*)
5178                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5179
5180                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5181                                 && test -z "${cf_tst_cflags}" \
5182                                 && cf_fix_cppflags=yes
5183
5184                         if test $cf_fix_cppflags = yes ; then
5185
5186         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5187         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5188
5189                                 continue
5190                         elif test "${cf_tst_cflags}" = "\"'" ; then
5191
5192         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5193         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5194
5195                                 continue
5196                         fi
5197                         ;;
5198                 esac
5199                 case "$CPPFLAGS" in
5200                 (*$cf_add_cflags)
5201                         ;;
5202                 (*)
5203                         case $cf_add_cflags in
5204                         (-D*)
5205                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5206
5207 CPPFLAGS=`echo "$CPPFLAGS" | \
5208         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5209                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5210
5211                                 ;;
5212                         esac
5213
5214         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5215         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5216
5217                         ;;
5218                 esac
5219                 ;;
5220         (*)
5221
5222         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5223         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5224
5225                 ;;
5226         esac
5227         ;;
5228 (yes)
5229
5230         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5231         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5232
5233         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5234
5235         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5236                 && test -z "${cf_tst_cflags}" \
5237                 && cf_fix_cppflags=no
5238         ;;
5239 esac
5240 done
5241
5242 if test -n "$cf_new_cflags" ; then
5243
5244         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5245         CFLAGS="${CFLAGS}$cf_new_cflags"
5246
5247 fi
5248
5249 if test -n "$cf_new_cppflags" ; then
5250
5251         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5252         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5253
5254 fi
5255
5256 if test -n "$cf_new_extra_cppflags" ; then
5257
5258         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5259         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5260
5261 fi
5262
5263 fi
5264
5265         fi
5266 fi
5267 fi # cf_cv_posix_visible
5268
5269 echo "$as_me:5269: checking for signal global datatype" >&5
5270 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5271 if test "${cf_cv_sig_atomic_t+set}" = set; then
5272   echo $ECHO_N "(cached) $ECHO_C" >&6
5273 else
5274
5275         for cf_type in \
5276                 "volatile sig_atomic_t" \
5277                 "sig_atomic_t" \
5278                 "int"
5279         do
5280         cat >conftest.$ac_ext <<_ACEOF
5281 #line 5281 "configure"
5282 #include "confdefs.h"
5283
5284 #include <sys/types.h>
5285 #include <signal.h>
5286 #include <stdio.h>
5287
5288 extern $cf_type x;
5289 $cf_type x;
5290 static void handler(int sig)
5291 {
5292         x = 5;
5293 }
5294 int
5295 main (void)
5296 {
5297 signal(SIGINT, handler);
5298                  x = 1
5299   ;
5300   return 0;
5301 }
5302 _ACEOF
5303 rm -f conftest.$ac_objext
5304 if { (eval echo "$as_me:5304: \"$ac_compile\"") >&5
5305   (eval $ac_compile) 2>&5
5306   ac_status=$?
5307   echo "$as_me:5307: \$? = $ac_status" >&5
5308   (exit $ac_status); } &&
5309          { ac_try='test -s conftest.$ac_objext'
5310   { (eval echo "$as_me:5310: \"$ac_try\"") >&5
5311   (eval $ac_try) 2>&5
5312   ac_status=$?
5313   echo "$as_me:5313: \$? = $ac_status" >&5
5314   (exit $ac_status); }; }; then
5315   cf_cv_sig_atomic_t=$cf_type
5316 else
5317   echo "$as_me: failed program was:" >&5
5318 cat conftest.$ac_ext >&5
5319 cf_cv_sig_atomic_t=no
5320 fi
5321 rm -f conftest.$ac_objext conftest.$ac_ext
5322                 test "$cf_cv_sig_atomic_t" != no && break
5323         done
5324
5325 fi
5326
5327 echo "$as_me:5327: result: $cf_cv_sig_atomic_t" >&5
5328 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5329 test "$cf_cv_sig_atomic_t" != no &&
5330 cat >>confdefs.h <<EOF
5331 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5332 EOF
5333
5334 # Work around breakage on OS X
5335
5336 echo "$as_me:5336: checking if SIGWINCH is defined" >&5
5337 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5338 if test "${cf_cv_define_sigwinch+set}" = set; then
5339   echo $ECHO_N "(cached) $ECHO_C" >&6
5340 else
5341
5342         cat >conftest.$ac_ext <<_ACEOF
5343 #line 5343 "configure"
5344 #include "confdefs.h"
5345
5346 #include <sys/types.h>
5347 #include <sys/signal.h>
5348
5349 int
5350 main (void)
5351 {
5352 int x = SIGWINCH
5353   ;
5354   return 0;
5355 }
5356 _ACEOF
5357 rm -f conftest.$ac_objext
5358 if { (eval echo "$as_me:5358: \"$ac_compile\"") >&5
5359   (eval $ac_compile) 2>&5
5360   ac_status=$?
5361   echo "$as_me:5361: \$? = $ac_status" >&5
5362   (exit $ac_status); } &&
5363          { ac_try='test -s conftest.$ac_objext'
5364   { (eval echo "$as_me:5364: \"$ac_try\"") >&5
5365   (eval $ac_try) 2>&5
5366   ac_status=$?
5367   echo "$as_me:5367: \$? = $ac_status" >&5
5368   (exit $ac_status); }; }; then
5369   cf_cv_define_sigwinch=yes
5370 else
5371   echo "$as_me: failed program was:" >&5
5372 cat conftest.$ac_ext >&5
5373 cat >conftest.$ac_ext <<_ACEOF
5374 #line 5374 "configure"
5375 #include "confdefs.h"
5376
5377 #undef _XOPEN_SOURCE
5378 #undef _POSIX_SOURCE
5379 #undef _POSIX_C_SOURCE
5380 #include <sys/types.h>
5381 #include <sys/signal.h>
5382
5383 int
5384 main (void)
5385 {
5386 int x = SIGWINCH
5387   ;
5388   return 0;
5389 }
5390 _ACEOF
5391 rm -f conftest.$ac_objext
5392 if { (eval echo "$as_me:5392: \"$ac_compile\"") >&5
5393   (eval $ac_compile) 2>&5
5394   ac_status=$?
5395   echo "$as_me:5395: \$? = $ac_status" >&5
5396   (exit $ac_status); } &&
5397          { ac_try='test -s conftest.$ac_objext'
5398   { (eval echo "$as_me:5398: \"$ac_try\"") >&5
5399   (eval $ac_try) 2>&5
5400   ac_status=$?
5401   echo "$as_me:5401: \$? = $ac_status" >&5
5402   (exit $ac_status); }; }; then
5403   cf_cv_define_sigwinch=maybe
5404 else
5405   echo "$as_me: failed program was:" >&5
5406 cat conftest.$ac_ext >&5
5407 cf_cv_define_sigwinch=no
5408 fi
5409 rm -f conftest.$ac_objext conftest.$ac_ext
5410
5411 fi
5412 rm -f conftest.$ac_objext conftest.$ac_ext
5413
5414 fi
5415 echo "$as_me:5415: result: $cf_cv_define_sigwinch" >&5
5416 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5417
5418 if test "$cf_cv_define_sigwinch" = maybe ; then
5419 echo "$as_me:5419: checking for actual SIGWINCH definition" >&5
5420 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5421 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5422   echo $ECHO_N "(cached) $ECHO_C" >&6
5423 else
5424
5425 cf_cv_fixup_sigwinch=unknown
5426 cf_sigwinch=32
5427 while test $cf_sigwinch != 1
5428 do
5429         cat >conftest.$ac_ext <<_ACEOF
5430 #line 5430 "configure"
5431 #include "confdefs.h"
5432
5433 #undef _XOPEN_SOURCE
5434 #undef _POSIX_SOURCE
5435 #undef _POSIX_C_SOURCE
5436 #include <sys/types.h>
5437 #include <sys/signal.h>
5438
5439 int
5440 main (void)
5441 {
5442
5443 #if SIGWINCH != $cf_sigwinch
5444 make an error
5445 #endif
5446 int x = SIGWINCH
5447   ;
5448   return 0;
5449 }
5450 _ACEOF
5451 rm -f conftest.$ac_objext
5452 if { (eval echo "$as_me:5452: \"$ac_compile\"") >&5
5453   (eval $ac_compile) 2>&5
5454   ac_status=$?
5455   echo "$as_me:5455: \$? = $ac_status" >&5
5456   (exit $ac_status); } &&
5457          { ac_try='test -s conftest.$ac_objext'
5458   { (eval echo "$as_me:5458: \"$ac_try\"") >&5
5459   (eval $ac_try) 2>&5
5460   ac_status=$?
5461   echo "$as_me:5461: \$? = $ac_status" >&5
5462   (exit $ac_status); }; }; then
5463   cf_cv_fixup_sigwinch=$cf_sigwinch
5464          break
5465 else
5466   echo "$as_me: failed program was:" >&5
5467 cat conftest.$ac_ext >&5
5468 fi
5469 rm -f conftest.$ac_objext conftest.$ac_ext
5470
5471 cf_sigwinch=`expr $cf_sigwinch - 1`
5472 done
5473
5474 fi
5475 echo "$as_me:5475: result: $cf_cv_fixup_sigwinch" >&5
5476 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5477
5478         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5479                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5480         fi
5481 fi
5482
5483 # Checks for CODESET support.
5484
5485 echo "$as_me:5485: checking for nl_langinfo and CODESET" >&5
5486 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5487 if test "${am_cv_langinfo_codeset+set}" = set; then
5488   echo $ECHO_N "(cached) $ECHO_C" >&6
5489 else
5490   cat >conftest.$ac_ext <<_ACEOF
5491 #line 5491 "configure"
5492 #include "confdefs.h"
5493 #include <langinfo.h>
5494 int
5495 main (void)
5496 {
5497 char* cs = nl_langinfo(CODESET);
5498   ;
5499   return 0;
5500 }
5501 _ACEOF
5502 rm -f conftest.$ac_objext conftest$ac_exeext
5503 if { (eval echo "$as_me:5503: \"$ac_link\"") >&5
5504   (eval $ac_link) 2>&5
5505   ac_status=$?
5506   echo "$as_me:5506: \$? = $ac_status" >&5
5507   (exit $ac_status); } &&
5508          { ac_try='test -s conftest$ac_exeext'
5509   { (eval echo "$as_me:5509: \"$ac_try\"") >&5
5510   (eval $ac_try) 2>&5
5511   ac_status=$?
5512   echo "$as_me:5512: \$? = $ac_status" >&5
5513   (exit $ac_status); }; }; then
5514   am_cv_langinfo_codeset=yes
5515 else
5516   echo "$as_me: failed program was:" >&5
5517 cat conftest.$ac_ext >&5
5518 am_cv_langinfo_codeset=no
5519 fi
5520 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5521
5522 fi
5523 echo "$as_me:5523: result: $am_cv_langinfo_codeset" >&5
5524 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5525         if test $am_cv_langinfo_codeset = yes; then
5526
5527 cat >>confdefs.h <<\EOF
5528 #define HAVE_LANGINFO_CODESET 1
5529 EOF
5530
5531         fi
5532
5533 echo "$as_me:5533: checking if you want to use pkg-config" >&5
5534 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5535
5536 # Check whether --with-pkg-config or --without-pkg-config was given.
5537 if test "${with_pkg_config+set}" = set; then
5538   withval="$with_pkg_config"
5539   cf_pkg_config=$withval
5540 else
5541   cf_pkg_config=yes
5542 fi;
5543 echo "$as_me:5543: result: $cf_pkg_config" >&5
5544 echo "${ECHO_T}$cf_pkg_config" >&6
5545
5546 case $cf_pkg_config in
5547 (no)
5548         PKG_CONFIG=none
5549         ;;
5550 (yes)
5551
5552 if test -n "$ac_tool_prefix"; then
5553   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5554 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5555 echo "$as_me:5555: checking for $ac_word" >&5
5556 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5557 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5558   echo $ECHO_N "(cached) $ECHO_C" >&6
5559 else
5560   case $PKG_CONFIG in
5561   [\\/]* | ?:[\\/]*)
5562   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5563   ;;
5564   *)
5565   ac_save_IFS=$IFS; IFS=$ac_path_separator
5566 ac_dummy="$PATH"
5567 for ac_dir in $ac_dummy; do
5568   IFS=$ac_save_IFS
5569   test -z "$ac_dir" && ac_dir=.
5570   if $as_executable_p "$ac_dir/$ac_word"; then
5571    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5572    echo "$as_me:5572: found $ac_dir/$ac_word" >&5
5573    break
5574 fi
5575 done
5576
5577   ;;
5578 esac
5579 fi
5580 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5581
5582 if test -n "$PKG_CONFIG"; then
5583   echo "$as_me:5583: result: $PKG_CONFIG" >&5
5584 echo "${ECHO_T}$PKG_CONFIG" >&6
5585 else
5586   echo "$as_me:5586: result: no" >&5
5587 echo "${ECHO_T}no" >&6
5588 fi
5589
5590 fi
5591 if test -z "$ac_cv_path_PKG_CONFIG"; then
5592   ac_pt_PKG_CONFIG=$PKG_CONFIG
5593   # Extract the first word of "pkg-config", so it can be a program name with args.
5594 set dummy pkg-config; ac_word=$2
5595 echo "$as_me:5595: checking for $ac_word" >&5
5596 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5597 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5598   echo $ECHO_N "(cached) $ECHO_C" >&6
5599 else
5600   case $ac_pt_PKG_CONFIG in
5601   [\\/]* | ?:[\\/]*)
5602   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5603   ;;
5604   *)
5605   ac_save_IFS=$IFS; IFS=$ac_path_separator
5606 ac_dummy="$PATH"
5607 for ac_dir in $ac_dummy; do
5608   IFS=$ac_save_IFS
5609   test -z "$ac_dir" && ac_dir=.
5610   if $as_executable_p "$ac_dir/$ac_word"; then
5611    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5612    echo "$as_me:5612: found $ac_dir/$ac_word" >&5
5613    break
5614 fi
5615 done
5616
5617   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5618   ;;
5619 esac
5620 fi
5621 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5622
5623 if test -n "$ac_pt_PKG_CONFIG"; then
5624   echo "$as_me:5624: result: $ac_pt_PKG_CONFIG" >&5
5625 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5626 else
5627   echo "$as_me:5627: result: no" >&5
5628 echo "${ECHO_T}no" >&6
5629 fi
5630
5631   PKG_CONFIG=$ac_pt_PKG_CONFIG
5632 else
5633   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5634 fi
5635
5636         ;;
5637 (*)
5638         PKG_CONFIG=$withval
5639         ;;
5640 esac
5641
5642 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5643 if test "$PKG_CONFIG" != none ; then
5644
5645 if test "x$prefix" != xNONE; then
5646         cf_path_syntax="$prefix"
5647 else
5648         cf_path_syntax="$ac_default_prefix"
5649 fi
5650
5651 case ".$PKG_CONFIG" in
5652 (.\$\(*\)*|.\'*\'*)
5653         ;;
5654 (..|./*|.\\*)
5655         ;;
5656 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5657         ;;
5658 (.\${*prefix}*|.\${*dir}*)
5659         eval PKG_CONFIG="$PKG_CONFIG"
5660         case ".$PKG_CONFIG" in
5661         (.NONE/*)
5662                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5663                 ;;
5664         esac
5665         ;;
5666 (.no|.NONE/*)
5667         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5668         ;;
5669 (*)
5670         { { echo "$as_me:5670: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5671 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5672    { (exit 1); exit 1; }; }
5673         ;;
5674 esac
5675
5676 elif test "x$cf_pkg_config" != xno ; then
5677         { echo "$as_me:5677: WARNING: pkg-config is not installed" >&5
5678 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5679 fi
5680
5681 echo "$as_me:5681: checking if you want to see long compiling messages" >&5
5682 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5683
5684 # Check whether --enable-echo or --disable-echo was given.
5685 if test "${enable_echo+set}" = set; then
5686   enableval="$enable_echo"
5687   test "$enableval" != no && enableval=yes
5688         if test "$enableval" != "yes" ; then
5689
5690         ECHO_LT='--silent'
5691         ECHO_LD='@echo linking $@;'
5692         RULE_CC='@echo compiling $<'
5693         SHOW_CC='@echo compiling $@'
5694         ECHO_CC='@'
5695
5696         else
5697
5698         ECHO_LT=''
5699         ECHO_LD=''
5700         RULE_CC=''
5701         SHOW_CC=''
5702         ECHO_CC=''
5703
5704         fi
5705 else
5706   enableval=yes
5707
5708         ECHO_LT=''
5709         ECHO_LD=''
5710         RULE_CC=''
5711         SHOW_CC=''
5712         ECHO_CC=''
5713
5714 fi;
5715 echo "$as_me:5715: result: $enableval" >&5
5716 echo "${ECHO_T}$enableval" >&6
5717
5718 echo "$as_me:5718: checking for ncurses wrap-prefix" >&5
5719 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5720
5721 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5722 if test "${with_ncurses_wrap_prefix+set}" = set; then
5723   withval="$with_ncurses_wrap_prefix"
5724   NCURSES_WRAP_PREFIX=$withval
5725 else
5726   NCURSES_WRAP_PREFIX=_nc_
5727 fi;
5728 echo "$as_me:5728: result: $NCURSES_WRAP_PREFIX" >&5
5729 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5730
5731 echo "$as_me:5731: checking if you want to check for wide-character functions" >&5
5732 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5733
5734 # Check whether --enable-widec or --disable-widec was given.
5735 if test "${enable_widec+set}" = set; then
5736   enableval="$enable_widec"
5737   test "$enableval" != no && enableval=yes
5738         if test "$enableval" != "yes" ; then
5739     cf_enable_widec=no
5740         else
5741                 cf_enable_widec=yes
5742         fi
5743 else
5744   enableval=yes
5745         cf_enable_widec=yes
5746
5747 fi;
5748 echo "$as_me:5748: result: $cf_enable_widec" >&5
5749 echo "${ECHO_T}$cf_enable_widec" >&6
5750
5751 echo "$as_me:5751: checking for specific curses-directory" >&5
5752 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5753
5754 # Check whether --with-curses-dir or --without-curses-dir was given.
5755 if test "${with_curses_dir+set}" = set; then
5756   withval="$with_curses_dir"
5757   cf_cv_curses_dir=$withval
5758 else
5759   cf_cv_curses_dir=no
5760 fi;
5761 echo "$as_me:5761: result: $cf_cv_curses_dir" >&5
5762 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5763
5764 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5765 then
5766
5767 if test "x$prefix" != xNONE; then
5768         cf_path_syntax="$prefix"
5769 else
5770         cf_path_syntax="$ac_default_prefix"
5771 fi
5772
5773 case ".$withval" in
5774 (.\$\(*\)*|.\'*\'*)
5775         ;;
5776 (..|./*|.\\*)
5777         ;;
5778 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5779         ;;
5780 (.\${*prefix}*|.\${*dir}*)
5781         eval withval="$withval"
5782         case ".$withval" in
5783         (.NONE/*)
5784                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5785                 ;;
5786         esac
5787         ;;
5788 (.no|.NONE/*)
5789         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5790         ;;
5791 (*)
5792         { { echo "$as_me:5792: error: expected a pathname, not \"$withval\"" >&5
5793 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5794    { (exit 1); exit 1; }; }
5795         ;;
5796 esac
5797
5798         if test -d "$cf_cv_curses_dir"
5799         then
5800
5801 if test -n "$cf_cv_curses_dir/include" ; then
5802   for cf_add_incdir in $cf_cv_curses_dir/include
5803   do
5804         while test $cf_add_incdir != /usr/include
5805         do
5806           if test -d $cf_add_incdir
5807           then
5808                 cf_have_incdir=no
5809                 if test -n "$CFLAGS$CPPFLAGS" ; then
5810                   # a loop is needed to ensure we can add subdirs of existing dirs
5811                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5812                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5813                           cf_have_incdir=yes; break
5814                         fi
5815                   done
5816                 fi
5817
5818                 if test "$cf_have_incdir" = no ; then
5819                   if test "$cf_add_incdir" = /usr/local/include ; then
5820                         if test "$GCC" = yes
5821                         then
5822                           cf_save_CPPFLAGS=$CPPFLAGS
5823
5824         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5825         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5826
5827                           cat >conftest.$ac_ext <<_ACEOF
5828 #line 5828 "configure"
5829 #include "confdefs.h"
5830 #include <stdio.h>
5831 int
5832 main (void)
5833 {
5834 printf("Hello")
5835   ;
5836   return 0;
5837 }
5838 _ACEOF
5839 rm -f conftest.$ac_objext
5840 if { (eval echo "$as_me:5840: \"$ac_compile\"") >&5
5841   (eval $ac_compile) 2>&5
5842   ac_status=$?
5843   echo "$as_me:5843: \$? = $ac_status" >&5
5844   (exit $ac_status); } &&
5845          { ac_try='test -s conftest.$ac_objext'
5846   { (eval echo "$as_me:5846: \"$ac_try\"") >&5
5847   (eval $ac_try) 2>&5
5848   ac_status=$?
5849   echo "$as_me:5849: \$? = $ac_status" >&5
5850   (exit $ac_status); }; }; then
5851   :
5852 else
5853   echo "$as_me: failed program was:" >&5
5854 cat conftest.$ac_ext >&5
5855 cf_have_incdir=yes
5856 fi
5857 rm -f conftest.$ac_objext conftest.$ac_ext
5858                           CPPFLAGS=$cf_save_CPPFLAGS
5859                         fi
5860                   fi
5861                 fi
5862
5863                 if test "$cf_have_incdir" = no ; then
5864                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5865
5866 echo "${as_me:-configure}:5866: testing adding $cf_add_incdir to include-path ..." 1>&5
5867
5868                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5869
5870                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5871                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5872                   cf_add_incdir="$cf_top_incdir"
5873                 else
5874                   break
5875                 fi
5876           else
5877                 break
5878           fi
5879         done
5880   done
5881 fi
5882
5883 if test -n "$cf_cv_curses_dir/lib" ; then
5884         for cf_add_libdir in $cf_cv_curses_dir/lib
5885         do
5886                 if test $cf_add_libdir = /usr/lib ; then
5887                         :
5888                 elif test -d $cf_add_libdir
5889                 then
5890                         cf_have_libdir=no
5891                         if test -n "$LDFLAGS$LIBS" ; then
5892                                 # a loop is needed to ensure we can add subdirs of existing dirs
5893                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5894                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5895                                                 cf_have_libdir=yes; break
5896                                         fi
5897                                 done
5898                         fi
5899                         if test "$cf_have_libdir" = no ; then
5900                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5901
5902 echo "${as_me:-configure}:5902: testing adding $cf_add_libdir to library-path ..." 1>&5
5903
5904                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5905                         fi
5906                 fi
5907         done
5908 fi
5909
5910         fi
5911 fi
5912
5913 cf_cv_screen=curses
5914
5915 echo "$as_me:5915: checking for specified curses library type" >&5
5916 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5917
5918 # Check whether --with-screen or --without-screen was given.
5919 if test "${with_screen+set}" = set; then
5920   withval="$with_screen"
5921   cf_cv_screen=$withval
5922 else
5923
5924 # Check whether --with-ncursesw or --without-ncursesw was given.
5925 if test "${with_ncursesw+set}" = set; then
5926   withval="$with_ncursesw"
5927   cf_cv_screen=ncursesw
5928 else
5929
5930 # Check whether --with-ncurses or --without-ncurses was given.
5931 if test "${with_ncurses+set}" = set; then
5932   withval="$with_ncurses"
5933   cf_cv_screen=ncurses
5934 else
5935
5936 # Check whether --with-pdcurses or --without-pdcurses was given.
5937 if test "${with_pdcurses+set}" = set; then
5938   withval="$with_pdcurses"
5939   cf_cv_screen=pdcurses
5940 else
5941
5942 # Check whether --with-curses-colr or --without-curses-colr was given.
5943 if test "${with_curses_colr+set}" = set; then
5944   withval="$with_curses_colr"
5945   cf_cv_screen=curses_colr
5946 else
5947
5948 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5949 if test "${with_curses_5lib+set}" = set; then
5950   withval="$with_curses_5lib"
5951   cf_cv_screen=curses_5lib
5952 fi;
5953 fi;
5954 fi;
5955 fi;
5956 fi;
5957 fi;
5958
5959 echo "$as_me:5959: result: $cf_cv_screen" >&5
5960 echo "${ECHO_T}$cf_cv_screen" >&6
5961
5962 case $cf_cv_screen in
5963 (curses|curses_*)
5964
5965 echo "$as_me:5965: checking for extra include directories" >&5
5966 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5967 if test "${cf_cv_curses_incdir+set}" = set; then
5968   echo $ECHO_N "(cached) $ECHO_C" >&6
5969 else
5970
5971 cf_cv_curses_incdir=no
5972 case $host_os in
5973 (hpux10.*)
5974         if test "x$cf_cv_screen" = "xcurses_colr"
5975         then
5976                 test -d /usr/include/curses_colr && \
5977                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5978         fi
5979         ;;
5980 (sunos3*|sunos4*)
5981         if test "x$cf_cv_screen" = "xcurses_5lib"
5982         then
5983                 test -d /usr/5lib && \
5984                 test -d /usr/5include && \
5985                 cf_cv_curses_incdir="-I/usr/5include"
5986         fi
5987         ;;
5988 esac
5989
5990 fi
5991 echo "$as_me:5991: result: $cf_cv_curses_incdir" >&5
5992 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5993 if test "$cf_cv_curses_incdir" != no
5994 then
5995
5996         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5997         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
5998
5999 fi
6000
6001 echo "$as_me:6001: checking if we have identified curses headers" >&5
6002 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6003 if test "${cf_cv_ncurses_header+set}" = set; then
6004   echo $ECHO_N "(cached) $ECHO_C" >&6
6005 else
6006
6007 cf_cv_ncurses_header=none
6008 for cf_header in \
6009         ncurses.h  \
6010         curses.h  ncurses/ncurses.h ncurses/curses.h
6011 do
6012 cat >conftest.$ac_ext <<_ACEOF
6013 #line 6013 "configure"
6014 #include "confdefs.h"
6015 #include <${cf_header}>
6016 int
6017 main (void)
6018 {
6019 initscr(); tgoto("?", 0,0)
6020   ;
6021   return 0;
6022 }
6023 _ACEOF
6024 rm -f conftest.$ac_objext
6025 if { (eval echo "$as_me:6025: \"$ac_compile\"") >&5
6026   (eval $ac_compile) 2>&5
6027   ac_status=$?
6028   echo "$as_me:6028: \$? = $ac_status" >&5
6029   (exit $ac_status); } &&
6030          { ac_try='test -s conftest.$ac_objext'
6031   { (eval echo "$as_me:6031: \"$ac_try\"") >&5
6032   (eval $ac_try) 2>&5
6033   ac_status=$?
6034   echo "$as_me:6034: \$? = $ac_status" >&5
6035   (exit $ac_status); }; }; then
6036   cf_cv_ncurses_header=$cf_header; break
6037 else
6038   echo "$as_me: failed program was:" >&5
6039 cat conftest.$ac_ext >&5
6040 fi
6041 rm -f conftest.$ac_objext conftest.$ac_ext
6042 done
6043
6044 fi
6045 echo "$as_me:6045: result: $cf_cv_ncurses_header" >&5
6046 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6047
6048 if test "$cf_cv_ncurses_header" = none ; then
6049         { { echo "$as_me:6049: error: No curses header-files found" >&5
6050 echo "$as_me: error: No curses header-files found" >&2;}
6051    { (exit 1); exit 1; }; }
6052 fi
6053
6054 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6055
6056 for ac_header in $cf_cv_ncurses_header
6057 do
6058 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6059 echo "$as_me:6059: checking for $ac_header" >&5
6060 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6061 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6062   echo $ECHO_N "(cached) $ECHO_C" >&6
6063 else
6064   cat >conftest.$ac_ext <<_ACEOF
6065 #line 6065 "configure"
6066 #include "confdefs.h"
6067 #include <$ac_header>
6068 _ACEOF
6069 if { (eval echo "$as_me:6069: \"$ac_cpp conftest.$ac_ext\"") >&5
6070   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6071   ac_status=$?
6072   egrep -v '^ *\+' conftest.er1 >conftest.err
6073   rm -f conftest.er1
6074   cat conftest.err >&5
6075   echo "$as_me:6075: \$? = $ac_status" >&5
6076   (exit $ac_status); } >/dev/null; then
6077   if test -s conftest.err; then
6078     ac_cpp_err=$ac_c_preproc_warn_flag
6079   else
6080     ac_cpp_err=
6081   fi
6082 else
6083   ac_cpp_err=yes
6084 fi
6085 if test -z "$ac_cpp_err"; then
6086   eval "$as_ac_Header=yes"
6087 else
6088   echo "$as_me: failed program was:" >&5
6089   cat conftest.$ac_ext >&5
6090   eval "$as_ac_Header=no"
6091 fi
6092 rm -f conftest.err conftest.$ac_ext
6093 fi
6094 echo "$as_me:6094: result: `eval echo '${'$as_ac_Header'}'`" >&5
6095 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6096 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6097   cat >>confdefs.h <<EOF
6098 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6099 EOF
6100
6101 fi
6102 done
6103
6104 echo "$as_me:6104: checking for terminfo header" >&5
6105 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6106 if test "${cf_cv_term_header+set}" = set; then
6107   echo $ECHO_N "(cached) $ECHO_C" >&6
6108 else
6109
6110 case ${cf_cv_ncurses_header} in
6111 (*/ncurses.h|*/ncursesw.h)
6112         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6113         ;;
6114 (*)
6115         cf_term_header=term.h
6116         ;;
6117 esac
6118
6119 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6120 do
6121 cat >conftest.$ac_ext <<_ACEOF
6122 #line 6122 "configure"
6123 #include "confdefs.h"
6124 #include <stdio.h>
6125 #include <${cf_cv_ncurses_header:-curses.h}>
6126 #include <$cf_test>
6127
6128 int
6129 main (void)
6130 {
6131 int x = auto_left_margin
6132   ;
6133   return 0;
6134 }
6135 _ACEOF
6136 rm -f conftest.$ac_objext
6137 if { (eval echo "$as_me:6137: \"$ac_compile\"") >&5
6138   (eval $ac_compile) 2>&5
6139   ac_status=$?
6140   echo "$as_me:6140: \$? = $ac_status" >&5
6141   (exit $ac_status); } &&
6142          { ac_try='test -s conftest.$ac_objext'
6143   { (eval echo "$as_me:6143: \"$ac_try\"") >&5
6144   (eval $ac_try) 2>&5
6145   ac_status=$?
6146   echo "$as_me:6146: \$? = $ac_status" >&5
6147   (exit $ac_status); }; }; then
6148
6149         cf_cv_term_header="$cf_test"
6150 else
6151   echo "$as_me: failed program was:" >&5
6152 cat conftest.$ac_ext >&5
6153
6154         cf_cv_term_header=unknown
6155
6156 fi
6157 rm -f conftest.$ac_objext conftest.$ac_ext
6158         test "$cf_cv_term_header" != unknown && break
6159 done
6160
6161 fi
6162 echo "$as_me:6162: result: $cf_cv_term_header" >&5
6163 echo "${ECHO_T}$cf_cv_term_header" >&6
6164
6165 # Set definitions to allow ifdef'ing to accommodate subdirectories
6166
6167 case $cf_cv_term_header in
6168 (*term.h)
6169
6170 cat >>confdefs.h <<\EOF
6171 #define HAVE_TERM_H 1
6172 EOF
6173
6174         ;;
6175 esac
6176
6177 case $cf_cv_term_header in
6178 (ncurses/term.h)
6179
6180 cat >>confdefs.h <<\EOF
6181 #define HAVE_NCURSES_TERM_H 1
6182 EOF
6183
6184         ;;
6185 (ncursesw/term.h)
6186
6187 cat >>confdefs.h <<\EOF
6188 #define HAVE_NCURSESW_TERM_H 1
6189 EOF
6190
6191         ;;
6192 esac
6193
6194 echo "$as_me:6194: checking for ncurses version" >&5
6195 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6196 if test "${cf_cv_ncurses_version+set}" = set; then
6197   echo $ECHO_N "(cached) $ECHO_C" >&6
6198 else
6199
6200         cf_cv_ncurses_version=no
6201         cf_tempfile=out$$
6202         rm -f $cf_tempfile
6203         if test "$cross_compiling" = yes; then
6204
6205         # This will not work if the preprocessor splits the line after the
6206         # Autoconf token.  The 'unproto' program does that.
6207         cat > conftest.$ac_ext <<EOF
6208 #include <${cf_cv_ncurses_header:-curses.h}>
6209 #undef Autoconf
6210 #ifdef NCURSES_VERSION
6211 Autoconf NCURSES_VERSION
6212 #else
6213 #ifdef __NCURSES_H
6214 Autoconf "old"
6215 #endif
6216 ;
6217 #endif
6218 EOF
6219         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6220         { (eval echo "$as_me:6220: \"$cf_try\"") >&5
6221   (eval $cf_try) 2>&5
6222   ac_status=$?
6223   echo "$as_me:6223: \$? = $ac_status" >&5
6224   (exit $ac_status); }
6225         if test -f conftest.out ; then
6226                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6227                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6228                 rm -f conftest.out
6229         fi
6230
6231 else
6232   cat >conftest.$ac_ext <<_ACEOF
6233 #line 6233 "configure"
6234 #include "confdefs.h"
6235
6236 #include <${cf_cv_ncurses_header:-curses.h}>
6237 #include <stdio.h>
6238 int main(void)
6239 {
6240         FILE *fp = fopen("$cf_tempfile", "w");
6241 #ifdef NCURSES_VERSION
6242 # ifdef NCURSES_VERSION_PATCH
6243         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6244 # else
6245         fprintf(fp, "%s\n", NCURSES_VERSION);
6246 # endif
6247 #else
6248 # ifdef __NCURSES_H
6249         fprintf(fp, "old\n");
6250 # else
6251         make an error
6252 # endif
6253 #endif
6254         ${cf_cv_main_return:-return}(0);
6255 }
6256 _ACEOF
6257 rm -f conftest$ac_exeext
6258 if { (eval echo "$as_me:6258: \"$ac_link\"") >&5
6259   (eval $ac_link) 2>&5
6260   ac_status=$?
6261   echo "$as_me:6261: \$? = $ac_status" >&5
6262   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6263   { (eval echo "$as_me:6263: \"$ac_try\"") >&5
6264   (eval $ac_try) 2>&5
6265   ac_status=$?
6266   echo "$as_me:6266: \$? = $ac_status" >&5
6267   (exit $ac_status); }; }; then
6268
6269         cf_cv_ncurses_version=`cat $cf_tempfile`
6270 else
6271   echo "$as_me: program exited with status $ac_status" >&5
6272 echo "$as_me: failed program was:" >&5
6273 cat conftest.$ac_ext >&5
6274 fi
6275 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6276 fi
6277         rm -f $cf_tempfile
6278
6279 fi
6280 echo "$as_me:6280: result: $cf_cv_ncurses_version" >&5
6281 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6282 test "$cf_cv_ncurses_version" = no ||
6283 cat >>confdefs.h <<\EOF
6284 #define NCURSES 1
6285 EOF
6286
6287 echo "$as_me:6287: checking if we have identified curses libraries" >&5
6288 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6289 cat >conftest.$ac_ext <<_ACEOF
6290 #line 6290 "configure"
6291 #include "confdefs.h"
6292 #include <${cf_cv_ncurses_header:-curses.h}>
6293 int
6294 main (void)
6295 {
6296 initscr(); tgoto("?", 0,0)
6297   ;
6298   return 0;
6299 }
6300 _ACEOF
6301 rm -f conftest.$ac_objext conftest$ac_exeext
6302 if { (eval echo "$as_me:6302: \"$ac_link\"") >&5
6303   (eval $ac_link) 2>&5
6304   ac_status=$?
6305   echo "$as_me:6305: \$? = $ac_status" >&5
6306   (exit $ac_status); } &&
6307          { ac_try='test -s conftest$ac_exeext'
6308   { (eval echo "$as_me:6308: \"$ac_try\"") >&5
6309   (eval $ac_try) 2>&5
6310   ac_status=$?
6311   echo "$as_me:6311: \$? = $ac_status" >&5
6312   (exit $ac_status); }; }; then
6313   cf_result=yes
6314 else
6315   echo "$as_me: failed program was:" >&5
6316 cat conftest.$ac_ext >&5
6317 cf_result=no
6318 fi
6319 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6320 echo "$as_me:6320: result: $cf_result" >&5
6321 echo "${ECHO_T}$cf_result" >&6
6322
6323 if test "$cf_result" = no ; then
6324 case $host_os in
6325 (freebsd*)
6326         echo "$as_me:6326: checking for tgoto in -lmytinfo" >&5
6327 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6328 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6329   echo $ECHO_N "(cached) $ECHO_C" >&6
6330 else
6331   ac_check_lib_save_LIBS=$LIBS
6332 LIBS="-lmytinfo  $LIBS"
6333 cat >conftest.$ac_ext <<_ACEOF
6334 #line 6334 "configure"
6335 #include "confdefs.h"
6336
6337 /* Override any gcc2 internal prototype to avoid an error.  */
6338 #ifdef __cplusplus
6339 extern "C"
6340 #endif
6341 /* We use char because int might match the return type of a gcc2
6342    builtin and then its argument prototype would still apply.  */
6343 char tgoto ();
6344 int
6345 main (void)
6346 {
6347 tgoto ();
6348   ;
6349   return 0;
6350 }
6351 _ACEOF
6352 rm -f conftest.$ac_objext conftest$ac_exeext
6353 if { (eval echo "$as_me:6353: \"$ac_link\"") >&5
6354   (eval $ac_link) 2>&5
6355   ac_status=$?
6356   echo "$as_me:6356: \$? = $ac_status" >&5
6357   (exit $ac_status); } &&
6358          { ac_try='test -s conftest$ac_exeext'
6359   { (eval echo "$as_me:6359: \"$ac_try\"") >&5
6360   (eval $ac_try) 2>&5
6361   ac_status=$?
6362   echo "$as_me:6362: \$? = $ac_status" >&5
6363   (exit $ac_status); }; }; then
6364   ac_cv_lib_mytinfo_tgoto=yes
6365 else
6366   echo "$as_me: failed program was:" >&5
6367 cat conftest.$ac_ext >&5
6368 ac_cv_lib_mytinfo_tgoto=no
6369 fi
6370 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6371 LIBS=$ac_check_lib_save_LIBS
6372 fi
6373 echo "$as_me:6373: result: $ac_cv_lib_mytinfo_tgoto" >&5
6374 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6375 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6376
6377 cf_add_libs="-lmytinfo"
6378 # Filter out duplicates - this happens with badly-designed ".pc" files...
6379 for cf_add_1lib in $LIBS
6380 do
6381         for cf_add_2lib in $cf_add_libs
6382         do
6383                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6384                 then
6385                         cf_add_1lib=
6386                         break
6387                 fi
6388         done
6389         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6390 done
6391 LIBS="$cf_add_libs"
6392
6393 fi
6394
6395         ;;
6396 (hpux10.*)
6397         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6398         # next (1998), and xcurses "newer" (2000).  There is no header file for
6399         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6400         # term.h) for cur_colr
6401         if test "x$cf_cv_screen" = "xcurses_colr"
6402         then
6403                 echo "$as_me:6403: checking for initscr in -lcur_colr" >&5
6404 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6405 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6406   echo $ECHO_N "(cached) $ECHO_C" >&6
6407 else
6408   ac_check_lib_save_LIBS=$LIBS
6409 LIBS="-lcur_colr  $LIBS"
6410 cat >conftest.$ac_ext <<_ACEOF
6411 #line 6411 "configure"
6412 #include "confdefs.h"
6413
6414 /* Override any gcc2 internal prototype to avoid an error.  */
6415 #ifdef __cplusplus
6416 extern "C"
6417 #endif
6418 /* We use char because int might match the return type of a gcc2
6419    builtin and then its argument prototype would still apply.  */
6420 char initscr ();
6421 int
6422 main (void)
6423 {
6424 initscr ();
6425   ;
6426   return 0;
6427 }
6428 _ACEOF
6429 rm -f conftest.$ac_objext conftest$ac_exeext
6430 if { (eval echo "$as_me:6430: \"$ac_link\"") >&5
6431   (eval $ac_link) 2>&5
6432   ac_status=$?
6433   echo "$as_me:6433: \$? = $ac_status" >&5
6434   (exit $ac_status); } &&
6435          { ac_try='test -s conftest$ac_exeext'
6436   { (eval echo "$as_me:6436: \"$ac_try\"") >&5
6437   (eval $ac_try) 2>&5
6438   ac_status=$?
6439   echo "$as_me:6439: \$? = $ac_status" >&5
6440   (exit $ac_status); }; }; then
6441   ac_cv_lib_cur_colr_initscr=yes
6442 else
6443   echo "$as_me: failed program was:" >&5
6444 cat conftest.$ac_ext >&5
6445 ac_cv_lib_cur_colr_initscr=no
6446 fi
6447 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6448 LIBS=$ac_check_lib_save_LIBS
6449 fi
6450 echo "$as_me:6450: result: $ac_cv_lib_cur_colr_initscr" >&5
6451 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6452 if test $ac_cv_lib_cur_colr_initscr = yes; then
6453
6454 cf_add_libs="-lcur_colr"
6455 # Filter out duplicates - this happens with badly-designed ".pc" files...
6456 for cf_add_1lib in $LIBS
6457 do
6458         for cf_add_2lib in $cf_add_libs
6459         do
6460                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6461                 then
6462                         cf_add_1lib=
6463                         break
6464                 fi
6465         done
6466         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6467 done
6468 LIBS="$cf_add_libs"
6469
6470                         ac_cv_func_initscr=yes
6471
6472 else
6473
6474                 echo "$as_me:6474: checking for initscr in -lHcurses" >&5
6475 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6476 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6477   echo $ECHO_N "(cached) $ECHO_C" >&6
6478 else
6479   ac_check_lib_save_LIBS=$LIBS
6480 LIBS="-lHcurses  $LIBS"
6481 cat >conftest.$ac_ext <<_ACEOF
6482 #line 6482 "configure"
6483 #include "confdefs.h"
6484
6485 /* Override any gcc2 internal prototype to avoid an error.  */
6486 #ifdef __cplusplus
6487 extern "C"
6488 #endif
6489 /* We use char because int might match the return type of a gcc2
6490    builtin and then its argument prototype would still apply.  */
6491 char initscr ();
6492 int
6493 main (void)
6494 {
6495 initscr ();
6496   ;
6497   return 0;
6498 }
6499 _ACEOF
6500 rm -f conftest.$ac_objext conftest$ac_exeext
6501 if { (eval echo "$as_me:6501: \"$ac_link\"") >&5
6502   (eval $ac_link) 2>&5
6503   ac_status=$?
6504   echo "$as_me:6504: \$? = $ac_status" >&5
6505   (exit $ac_status); } &&
6506          { ac_try='test -s conftest$ac_exeext'
6507   { (eval echo "$as_me:6507: \"$ac_try\"") >&5
6508   (eval $ac_try) 2>&5
6509   ac_status=$?
6510   echo "$as_me:6510: \$? = $ac_status" >&5
6511   (exit $ac_status); }; }; then
6512   ac_cv_lib_Hcurses_initscr=yes
6513 else
6514   echo "$as_me: failed program was:" >&5
6515 cat conftest.$ac_ext >&5
6516 ac_cv_lib_Hcurses_initscr=no
6517 fi
6518 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6519 LIBS=$ac_check_lib_save_LIBS
6520 fi
6521 echo "$as_me:6521: result: $ac_cv_lib_Hcurses_initscr" >&5
6522 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6523 if test $ac_cv_lib_Hcurses_initscr = yes; then
6524
6525                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6526
6527 cf_add_libs="-lHcurses"
6528 # Filter out duplicates - this happens with badly-designed ".pc" files...
6529 for cf_add_1lib in $LIBS
6530 do
6531         for cf_add_2lib in $cf_add_libs
6532         do
6533                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6534                 then
6535                         cf_add_1lib=
6536                         break
6537                 fi
6538         done
6539         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6540 done
6541 LIBS="$cf_add_libs"
6542
6543         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6544         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6545
6546                         ac_cv_func_initscr=yes
6547
6548 fi
6549
6550 fi
6551
6552         fi
6553         ;;
6554 (linux*)
6555         case `arch 2>/dev/null` in
6556         (x86_64)
6557                 if test -d /lib64
6558                 then
6559
6560 if test -n "/lib64" ; then
6561         for cf_add_libdir in /lib64
6562         do
6563                 if test $cf_add_libdir = /usr/lib ; then
6564                         :
6565                 elif test -d $cf_add_libdir
6566                 then
6567                         cf_have_libdir=no
6568                         if test -n "$LDFLAGS$LIBS" ; then
6569                                 # a loop is needed to ensure we can add subdirs of existing dirs
6570                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6571                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6572                                                 cf_have_libdir=yes; break
6573                                         fi
6574                                 done
6575                         fi
6576                         if test "$cf_have_libdir" = no ; then
6577                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6578
6579 echo "${as_me:-configure}:6579: testing adding $cf_add_libdir to library-path ..." 1>&5
6580
6581                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6582                         fi
6583                 fi
6584         done
6585 fi
6586
6587                 else
6588
6589 if test -n "/lib" ; then
6590         for cf_add_libdir in /lib
6591         do
6592                 if test $cf_add_libdir = /usr/lib ; then
6593                         :
6594                 elif test -d $cf_add_libdir
6595                 then
6596                         cf_have_libdir=no
6597                         if test -n "$LDFLAGS$LIBS" ; then
6598                                 # a loop is needed to ensure we can add subdirs of existing dirs
6599                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6600                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6601                                                 cf_have_libdir=yes; break
6602                                         fi
6603                                 done
6604                         fi
6605                         if test "$cf_have_libdir" = no ; then
6606                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6607
6608 echo "${as_me:-configure}:6608: testing adding $cf_add_libdir to library-path ..." 1>&5
6609
6610                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6611                         fi
6612                 fi
6613         done
6614 fi
6615
6616                 fi
6617                 ;;
6618         (*)
6619
6620 if test -n "/lib" ; then
6621         for cf_add_libdir in /lib
6622         do
6623                 if test $cf_add_libdir = /usr/lib ; then
6624                         :
6625                 elif test -d $cf_add_libdir
6626                 then
6627                         cf_have_libdir=no
6628                         if test -n "$LDFLAGS$LIBS" ; then
6629                                 # a loop is needed to ensure we can add subdirs of existing dirs
6630                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6631                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6632                                                 cf_have_libdir=yes; break
6633                                         fi
6634                                 done
6635                         fi
6636                         if test "$cf_have_libdir" = no ; then
6637                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6638
6639 echo "${as_me:-configure}:6639: testing adding $cf_add_libdir to library-path ..." 1>&5
6640
6641                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6642                         fi
6643                 fi
6644         done
6645 fi
6646
6647                 ;;
6648         esac
6649         ;;
6650 (sunos3*|sunos4*)
6651         if test "x$cf_cv_screen" = "xcurses_5lib"
6652         then
6653                 if test -d /usr/5lib ; then
6654
6655 if test -n "/usr/5lib" ; then
6656         for cf_add_libdir in /usr/5lib
6657         do
6658                 if test $cf_add_libdir = /usr/lib ; then
6659                         :
6660                 elif test -d $cf_add_libdir
6661                 then
6662                         cf_have_libdir=no
6663                         if test -n "$LDFLAGS$LIBS" ; then
6664                                 # a loop is needed to ensure we can add subdirs of existing dirs
6665                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6666                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6667                                                 cf_have_libdir=yes; break
6668                                         fi
6669                                 done
6670                         fi
6671                         if test "$cf_have_libdir" = no ; then
6672                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6673
6674 echo "${as_me:-configure}:6674: testing adding $cf_add_libdir to library-path ..." 1>&5
6675
6676                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6677                         fi
6678                 fi
6679         done
6680 fi
6681
6682 cf_add_libs="-lcurses -ltermcap"
6683 # Filter out duplicates - this happens with badly-designed ".pc" files...
6684 for cf_add_1lib in $LIBS
6685 do
6686         for cf_add_2lib in $cf_add_libs
6687         do
6688                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6689                 then
6690                         cf_add_1lib=
6691                         break
6692                 fi
6693         done
6694         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6695 done
6696 LIBS="$cf_add_libs"
6697
6698                 fi
6699         fi
6700         ac_cv_func_initscr=yes
6701         ;;
6702 esac
6703
6704 if test ".$ac_cv_func_initscr" != .yes ; then
6705         cf_save_LIBS="$LIBS"
6706
6707         if test ".${cf_cv_ncurses_version:-no}" != .no
6708         then
6709                 cf_check_list="ncurses curses cursesX"
6710         else
6711                 cf_check_list="cursesX curses ncurses"
6712         fi
6713
6714         # Check for library containing tgoto.  Do this before curses library
6715         # because it may be needed to link the test-case for initscr.
6716         if test "x$cf_term_lib" = x
6717         then
6718                 echo "$as_me:6718: checking for tgoto" >&5
6719 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6720 if test "${ac_cv_func_tgoto+set}" = set; then
6721   echo $ECHO_N "(cached) $ECHO_C" >&6
6722 else
6723   cat >conftest.$ac_ext <<_ACEOF
6724 #line 6724 "configure"
6725 #include "confdefs.h"
6726 #define tgoto autoconf_temporary
6727 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6728 #undef tgoto
6729
6730 #ifdef __cplusplus
6731 extern "C"
6732 #endif
6733
6734 /* We use char because int might match the return type of a gcc2
6735    builtin and then its argument prototype would still apply.  */
6736 char tgoto (void);
6737
6738 int
6739 main (void)
6740 {
6741
6742 /* The GNU C library defines stubs for functions which it implements
6743     to always fail with ENOSYS.  Some functions are actually named
6744     something starting with __ and the normal name is an alias.  */
6745 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6746 #error found stub for tgoto
6747 #endif
6748
6749         return tgoto ();
6750   ;
6751   return 0;
6752 }
6753 _ACEOF
6754 rm -f conftest.$ac_objext conftest$ac_exeext
6755 if { (eval echo "$as_me:6755: \"$ac_link\"") >&5
6756   (eval $ac_link) 2>&5
6757   ac_status=$?
6758   echo "$as_me:6758: \$? = $ac_status" >&5
6759   (exit $ac_status); } &&
6760          { ac_try='test -s conftest$ac_exeext'
6761   { (eval echo "$as_me:6761: \"$ac_try\"") >&5
6762   (eval $ac_try) 2>&5
6763   ac_status=$?
6764   echo "$as_me:6764: \$? = $ac_status" >&5
6765   (exit $ac_status); }; }; then
6766   ac_cv_func_tgoto=yes
6767 else
6768   echo "$as_me: failed program was:" >&5
6769 cat conftest.$ac_ext >&5
6770 ac_cv_func_tgoto=no
6771 fi
6772 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6773 fi
6774 echo "$as_me:6774: result: $ac_cv_func_tgoto" >&5
6775 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6776 if test $ac_cv_func_tgoto = yes; then
6777   cf_term_lib=predefined
6778 else
6779
6780                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6781                         do
6782                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6783 echo "$as_me:6783: checking for tgoto in -l$cf_term_lib" >&5
6784 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6785 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6786   echo $ECHO_N "(cached) $ECHO_C" >&6
6787 else
6788   ac_check_lib_save_LIBS=$LIBS
6789 LIBS="-l$cf_term_lib  $LIBS"
6790 cat >conftest.$ac_ext <<_ACEOF
6791 #line 6791 "configure"
6792 #include "confdefs.h"
6793
6794 /* Override any gcc2 internal prototype to avoid an error.  */
6795 #ifdef __cplusplus
6796 extern "C"
6797 #endif
6798 /* We use char because int might match the return type of a gcc2
6799    builtin and then its argument prototype would still apply.  */
6800 char tgoto ();
6801 int
6802 main (void)
6803 {
6804 tgoto ();
6805   ;
6806   return 0;
6807 }
6808 _ACEOF
6809 rm -f conftest.$ac_objext conftest$ac_exeext
6810 if { (eval echo "$as_me:6810: \"$ac_link\"") >&5
6811   (eval $ac_link) 2>&5
6812   ac_status=$?
6813   echo "$as_me:6813: \$? = $ac_status" >&5
6814   (exit $ac_status); } &&
6815          { ac_try='test -s conftest$ac_exeext'
6816   { (eval echo "$as_me:6816: \"$ac_try\"") >&5
6817   (eval $ac_try) 2>&5
6818   ac_status=$?
6819   echo "$as_me:6819: \$? = $ac_status" >&5
6820   (exit $ac_status); }; }; then
6821   eval "$as_ac_Lib=yes"
6822 else
6823   echo "$as_me: failed program was:" >&5
6824 cat conftest.$ac_ext >&5
6825 eval "$as_ac_Lib=no"
6826 fi
6827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6828 LIBS=$ac_check_lib_save_LIBS
6829 fi
6830 echo "$as_me:6830: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6831 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6832 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6833
6834                                         : ${cf_nculib_root:=$cf_term_lib}
6835                                         break
6836
6837 fi
6838
6839                         done
6840
6841 fi
6842
6843         fi
6844
6845         # Check for library containing initscr
6846         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6847         if test "x$cf_curs_lib" = x
6848         then
6849                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6850                 do
6851                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6852                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6853                                 echo "$as_me:6853: checking if we can link with $cf_curs_lib library" >&5
6854 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6855                                 cat >conftest.$ac_ext <<_ACEOF
6856 #line 6856 "configure"
6857 #include "confdefs.h"
6858 #include <${cf_cv_ncurses_header:-curses.h}>
6859 int
6860 main (void)
6861 {
6862 initscr()
6863   ;
6864   return 0;
6865 }
6866 _ACEOF
6867 rm -f conftest.$ac_objext conftest$ac_exeext
6868 if { (eval echo "$as_me:6868: \"$ac_link\"") >&5
6869   (eval $ac_link) 2>&5
6870   ac_status=$?
6871   echo "$as_me:6871: \$? = $ac_status" >&5
6872   (exit $ac_status); } &&
6873          { ac_try='test -s conftest$ac_exeext'
6874   { (eval echo "$as_me:6874: \"$ac_try\"") >&5
6875   (eval $ac_try) 2>&5
6876   ac_status=$?
6877   echo "$as_me:6877: \$? = $ac_status" >&5
6878   (exit $ac_status); }; }; then
6879   cf_result=yes
6880 else
6881   echo "$as_me: failed program was:" >&5
6882 cat conftest.$ac_ext >&5
6883 cf_result=no
6884 fi
6885 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6886                                 echo "$as_me:6886: result: $cf_result" >&5
6887 echo "${ECHO_T}$cf_result" >&6
6888                                 test $cf_result = yes && break
6889                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6890                                 cf_result=no
6891                         elif test "$cf_term_lib" != predefined ; then
6892                                 echo "$as_me:6892: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6893 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6894                                 cat >conftest.$ac_ext <<_ACEOF
6895 #line 6895 "configure"
6896 #include "confdefs.h"
6897 #include <${cf_cv_ncurses_header:-curses.h}>
6898 int
6899 main (void)
6900 {
6901 initscr(); tgoto((char *)0, 0, 0);
6902   ;
6903   return 0;
6904 }
6905 _ACEOF
6906 rm -f conftest.$ac_objext conftest$ac_exeext
6907 if { (eval echo "$as_me:6907: \"$ac_link\"") >&5
6908   (eval $ac_link) 2>&5
6909   ac_status=$?
6910   echo "$as_me:6910: \$? = $ac_status" >&5
6911   (exit $ac_status); } &&
6912          { ac_try='test -s conftest$ac_exeext'
6913   { (eval echo "$as_me:6913: \"$ac_try\"") >&5
6914   (eval $ac_try) 2>&5
6915   ac_status=$?
6916   echo "$as_me:6916: \$? = $ac_status" >&5
6917   (exit $ac_status); }; }; then
6918   cf_result=no
6919 else
6920   echo "$as_me: failed program was:" >&5
6921 cat conftest.$ac_ext >&5
6922
6923                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6924                                         cat >conftest.$ac_ext <<_ACEOF
6925 #line 6925 "configure"
6926 #include "confdefs.h"
6927 #include <${cf_cv_ncurses_header:-curses.h}>
6928 int
6929 main (void)
6930 {
6931 initscr()
6932   ;
6933   return 0;
6934 }
6935 _ACEOF
6936 rm -f conftest.$ac_objext conftest$ac_exeext
6937 if { (eval echo "$as_me:6937: \"$ac_link\"") >&5
6938   (eval $ac_link) 2>&5
6939   ac_status=$?
6940   echo "$as_me:6940: \$? = $ac_status" >&5
6941   (exit $ac_status); } &&
6942          { ac_try='test -s conftest$ac_exeext'
6943   { (eval echo "$as_me:6943: \"$ac_try\"") >&5
6944   (eval $ac_try) 2>&5
6945   ac_status=$?
6946   echo "$as_me:6946: \$? = $ac_status" >&5
6947   (exit $ac_status); }; }; then
6948   cf_result=yes
6949 else
6950   echo "$as_me: failed program was:" >&5
6951 cat conftest.$ac_ext >&5
6952 cf_result=error
6953 fi
6954 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6955
6956 fi
6957 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6958                                 echo "$as_me:6958: result: $cf_result" >&5
6959 echo "${ECHO_T}$cf_result" >&6
6960                                 test $cf_result != error && break
6961                         fi
6962                 done
6963         fi
6964         test $cf_curs_lib = unknown && { { echo "$as_me:6964: error: no curses library found" >&5
6965 echo "$as_me: error: no curses library found" >&2;}
6966    { (exit 1); exit 1; }; }
6967 fi
6968 fi
6969
6970         ;;
6971 (ncursesw*)
6972
6973 echo "$as_me:6973: checking for multibyte character support" >&5
6974 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6975 if test "${cf_cv_utf8_lib+set}" = set; then
6976   echo $ECHO_N "(cached) $ECHO_C" >&6
6977 else
6978
6979         cf_save_LIBS="$LIBS"
6980         cat >conftest.$ac_ext <<_ACEOF
6981 #line 6981 "configure"
6982 #include "confdefs.h"
6983
6984 #include <stdlib.h>
6985 int
6986 main (void)
6987 {
6988 putwc(0,0);
6989   ;
6990   return 0;
6991 }
6992 _ACEOF
6993 rm -f conftest.$ac_objext conftest$ac_exeext
6994 if { (eval echo "$as_me:6994: \"$ac_link\"") >&5
6995   (eval $ac_link) 2>&5
6996   ac_status=$?
6997   echo "$as_me:6997: \$? = $ac_status" >&5
6998   (exit $ac_status); } &&
6999          { ac_try='test -s conftest$ac_exeext'
7000   { (eval echo "$as_me:7000: \"$ac_try\"") >&5
7001   (eval $ac_try) 2>&5
7002   ac_status=$?
7003   echo "$as_me:7003: \$? = $ac_status" >&5
7004   (exit $ac_status); }; }; then
7005   cf_cv_utf8_lib=yes
7006 else
7007   echo "$as_me: failed program was:" >&5
7008 cat conftest.$ac_ext >&5
7009
7010 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7011 # will be set on completion of the AC_TRY_LINK below.
7012 cf_cv_header_path_utf8=
7013 cf_cv_library_path_utf8=
7014
7015 echo "${as_me:-configure}:7015: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7016
7017 cf_save_LIBS="$LIBS"
7018
7019 cat >conftest.$ac_ext <<_ACEOF
7020 #line 7020 "configure"
7021 #include "confdefs.h"
7022
7023 #include <libutf8.h>
7024 int
7025 main (void)
7026 {
7027 putwc(0,0);
7028   ;
7029   return 0;
7030 }
7031 _ACEOF
7032 rm -f conftest.$ac_objext conftest$ac_exeext
7033 if { (eval echo "$as_me:7033: \"$ac_link\"") >&5
7034   (eval $ac_link) 2>&5
7035   ac_status=$?
7036   echo "$as_me:7036: \$? = $ac_status" >&5
7037   (exit $ac_status); } &&
7038          { ac_try='test -s conftest$ac_exeext'
7039   { (eval echo "$as_me:7039: \"$ac_try\"") >&5
7040   (eval $ac_try) 2>&5
7041   ac_status=$?
7042   echo "$as_me:7042: \$? = $ac_status" >&5
7043   (exit $ac_status); }; }; then
7044
7045         cf_cv_find_linkage_utf8=yes
7046         cf_cv_header_path_utf8=/usr/include
7047         cf_cv_library_path_utf8=/usr/lib
7048
7049 else
7050   echo "$as_me: failed program was:" >&5
7051 cat conftest.$ac_ext >&5
7052
7053 LIBS="-lutf8  $cf_save_LIBS"
7054
7055 cat >conftest.$ac_ext <<_ACEOF
7056 #line 7056 "configure"
7057 #include "confdefs.h"
7058
7059 #include <libutf8.h>
7060 int
7061 main (void)
7062 {
7063 putwc(0,0);
7064   ;
7065   return 0;
7066 }
7067 _ACEOF
7068 rm -f conftest.$ac_objext conftest$ac_exeext
7069 if { (eval echo "$as_me:7069: \"$ac_link\"") >&5
7070   (eval $ac_link) 2>&5
7071   ac_status=$?
7072   echo "$as_me:7072: \$? = $ac_status" >&5
7073   (exit $ac_status); } &&
7074          { ac_try='test -s conftest$ac_exeext'
7075   { (eval echo "$as_me:7075: \"$ac_try\"") >&5
7076   (eval $ac_try) 2>&5
7077   ac_status=$?
7078   echo "$as_me:7078: \$? = $ac_status" >&5
7079   (exit $ac_status); }; }; then
7080
7081         cf_cv_find_linkage_utf8=yes
7082         cf_cv_header_path_utf8=/usr/include
7083         cf_cv_library_path_utf8=/usr/lib
7084         cf_cv_library_file_utf8="-lutf8"
7085
7086 else
7087   echo "$as_me: failed program was:" >&5
7088 cat conftest.$ac_ext >&5
7089
7090         cf_cv_find_linkage_utf8=no
7091         LIBS="$cf_save_LIBS"
7092
7093         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7094
7095 echo "${as_me:-configure}:7095: testing find linkage for utf8 library ..." 1>&5
7096
7097 echo "${as_me:-configure}:7097: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7098
7099         cf_save_CPPFLAGS="$CPPFLAGS"
7100         cf_test_CPPFLAGS="$CPPFLAGS"
7101
7102 cf_search=
7103
7104 # collect the current set of include-directories from compiler flags
7105 cf_header_path_list=""
7106 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7107         for cf_header_path in $CPPFLAGS $CFLAGS
7108         do
7109                 case $cf_header_path in
7110                 (-I*)
7111                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7112
7113 test "x$cf_header_path" != "xNONE" && \
7114 test -d "$cf_header_path" && \
7115  {
7116         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7117         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7118         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7119         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7120         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7121         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7122 }
7123
7124                         cf_header_path_list="$cf_header_path_list $cf_search"
7125                         ;;
7126                 esac
7127         done
7128 fi
7129
7130 # add the variations for the package we are looking for
7131
7132 cf_search=
7133
7134 test "x$prefix" != "xNONE" && \
7135 test -d "$prefix" && \
7136  {
7137         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7138         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7139         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7140         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7141         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7142         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7143 }
7144
7145 for cf_subdir_prefix in \
7146         /usr \
7147         /usr/local \
7148         /usr/pkg \
7149         /opt \
7150         /opt/local \
7151         $HOME
7152 do
7153
7154 test "x$cf_subdir_prefix" != "x$prefix" && \
7155 test -d "$cf_subdir_prefix" && \
7156 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7157         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7158         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7159         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7160         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7161         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7162         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7163 }
7164
7165 done
7166
7167 test "$includedir" != NONE && \
7168 test "$includedir" != "/usr/include" && \
7169 test -d "$includedir" && {
7170         test -d $includedir &&    cf_search="$cf_search $includedir"
7171         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7172 }
7173
7174 test "$oldincludedir" != NONE && \
7175 test "$oldincludedir" != "/usr/include" && \
7176 test -d "$oldincludedir" && {
7177         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7178         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7179 }
7180
7181 cf_search="$cf_search $cf_header_path_list"
7182
7183         for cf_cv_header_path_utf8 in $cf_search
7184         do
7185                 if test -d $cf_cv_header_path_utf8 ; then
7186                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7187
7188 echo "${as_me:-configure}:7188: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7189
7190                         CPPFLAGS="$cf_save_CPPFLAGS"
7191
7192         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7193         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7194
7195                         cat >conftest.$ac_ext <<_ACEOF
7196 #line 7196 "configure"
7197 #include "confdefs.h"
7198
7199 #include <libutf8.h>
7200 int
7201 main (void)
7202 {
7203 putwc(0,0);
7204   ;
7205   return 0;
7206 }
7207 _ACEOF
7208 rm -f conftest.$ac_objext
7209 if { (eval echo "$as_me:7209: \"$ac_compile\"") >&5
7210   (eval $ac_compile) 2>&5
7211   ac_status=$?
7212   echo "$as_me:7212: \$? = $ac_status" >&5
7213   (exit $ac_status); } &&
7214          { ac_try='test -s conftest.$ac_objext'
7215   { (eval echo "$as_me:7215: \"$ac_try\"") >&5
7216   (eval $ac_try) 2>&5
7217   ac_status=$?
7218   echo "$as_me:7218: \$? = $ac_status" >&5
7219   (exit $ac_status); }; }; then
7220
7221                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7222
7223 echo "${as_me:-configure}:7223: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7224
7225                                 cf_cv_find_linkage_utf8=maybe
7226                                 cf_test_CPPFLAGS="$CPPFLAGS"
7227                                 break
7228 else
7229   echo "$as_me: failed program was:" >&5
7230 cat conftest.$ac_ext >&5
7231
7232                                 CPPFLAGS="$cf_save_CPPFLAGS"
7233
7234 fi
7235 rm -f conftest.$ac_objext conftest.$ac_ext
7236                 fi
7237         done
7238
7239         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7240
7241 echo "${as_me:-configure}:7241: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7242
7243                 cf_save_LIBS="$LIBS"
7244                 cf_save_LDFLAGS="$LDFLAGS"
7245
7246                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7247
7248 cf_search=
7249 cf_library_path_list=""
7250 if test -n "${LDFLAGS}${LIBS}" ; then
7251         for cf_library_path in $LDFLAGS $LIBS
7252         do
7253                 case $cf_library_path in
7254                 (-L*)
7255                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7256
7257 test "x$cf_library_path" != "xNONE" && \
7258 test -d "$cf_library_path" && \
7259  {
7260         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7261         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7262         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7263         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7264         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7265         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7266 }
7267
7268                         cf_library_path_list="$cf_library_path_list $cf_search"
7269                         ;;
7270                 esac
7271         done
7272 fi
7273
7274 cf_search=
7275
7276 test "x$prefix" != "xNONE" && \
7277 test -d "$prefix" && \
7278  {
7279         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7280         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7281         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7282         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7283         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7284         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7285 }
7286
7287 for cf_subdir_prefix in \
7288         /usr \
7289         /usr/local \
7290         /usr/pkg \
7291         /opt \
7292         /opt/local \
7293         $HOME
7294 do
7295
7296 test "x$cf_subdir_prefix" != "x$prefix" && \
7297 test -d "$cf_subdir_prefix" && \
7298 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7299         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7300         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7301         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7302         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7303         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7304         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7305 }
7306
7307 done
7308
7309 cf_search="$cf_library_path_list $cf_search"
7310
7311                         for cf_cv_library_path_utf8 in $cf_search
7312                         do
7313                                 if test -d $cf_cv_library_path_utf8 ; then
7314                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7315
7316 echo "${as_me:-configure}:7316: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7317
7318                                         CPPFLAGS="$cf_test_CPPFLAGS"
7319                                         LIBS="-lutf8  $cf_save_LIBS"
7320                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7321                                         cat >conftest.$ac_ext <<_ACEOF
7322 #line 7322 "configure"
7323 #include "confdefs.h"
7324
7325 #include <libutf8.h>
7326 int
7327 main (void)
7328 {
7329 putwc(0,0);
7330   ;
7331   return 0;
7332 }
7333 _ACEOF
7334 rm -f conftest.$ac_objext conftest$ac_exeext
7335 if { (eval echo "$as_me:7335: \"$ac_link\"") >&5
7336   (eval $ac_link) 2>&5
7337   ac_status=$?
7338   echo "$as_me:7338: \$? = $ac_status" >&5
7339   (exit $ac_status); } &&
7340          { ac_try='test -s conftest$ac_exeext'
7341   { (eval echo "$as_me:7341: \"$ac_try\"") >&5
7342   (eval $ac_try) 2>&5
7343   ac_status=$?
7344   echo "$as_me:7344: \$? = $ac_status" >&5
7345   (exit $ac_status); }; }; then
7346
7347                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7348
7349 echo "${as_me:-configure}:7349: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7350
7351                                         cf_cv_find_linkage_utf8=yes
7352                                         cf_cv_library_file_utf8="-lutf8"
7353                                         break
7354 else
7355   echo "$as_me: failed program was:" >&5
7356 cat conftest.$ac_ext >&5
7357
7358                                         CPPFLAGS="$cf_save_CPPFLAGS"
7359                                         LIBS="$cf_save_LIBS"
7360                                         LDFLAGS="$cf_save_LDFLAGS"
7361
7362 fi
7363 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7364                                 fi
7365                         done
7366                         CPPFLAGS="$cf_save_CPPFLAGS"
7367                         LDFLAGS="$cf_save_LDFLAGS"
7368                 fi
7369
7370         else
7371                 cf_cv_find_linkage_utf8=no
7372         fi
7373
7374 fi
7375 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7376
7377 fi
7378 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7379
7380 LIBS="$cf_save_LIBS"
7381
7382 if test "$cf_cv_find_linkage_utf8" = yes ; then
7383 cf_cv_utf8_lib=add-on
7384 else
7385 cf_cv_utf8_lib=no
7386 fi
7387
7388 fi
7389 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7390 fi
7391 echo "$as_me:7391: result: $cf_cv_utf8_lib" >&5
7392 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7393
7394 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7395 # ncurses/ncursesw:
7396 if test "$cf_cv_utf8_lib" = "add-on" ; then
7397
7398 cat >>confdefs.h <<\EOF
7399 #define HAVE_LIBUTF8_H 1
7400 EOF
7401
7402 if test -n "$cf_cv_header_path_utf8" ; then
7403   for cf_add_incdir in $cf_cv_header_path_utf8
7404   do
7405         while test $cf_add_incdir != /usr/include
7406         do
7407           if test -d $cf_add_incdir
7408           then
7409                 cf_have_incdir=no
7410                 if test -n "$CFLAGS$CPPFLAGS" ; then
7411                   # a loop is needed to ensure we can add subdirs of existing dirs
7412                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7413                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7414                           cf_have_incdir=yes; break
7415                         fi
7416                   done
7417                 fi
7418
7419                 if test "$cf_have_incdir" = no ; then
7420                   if test "$cf_add_incdir" = /usr/local/include ; then
7421                         if test "$GCC" = yes
7422                         then
7423                           cf_save_CPPFLAGS=$CPPFLAGS
7424
7425         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7426         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7427
7428                           cat >conftest.$ac_ext <<_ACEOF
7429 #line 7429 "configure"
7430 #include "confdefs.h"
7431 #include <stdio.h>
7432 int
7433 main (void)
7434 {
7435 printf("Hello")
7436   ;
7437   return 0;
7438 }
7439 _ACEOF
7440 rm -f conftest.$ac_objext
7441 if { (eval echo "$as_me:7441: \"$ac_compile\"") >&5
7442   (eval $ac_compile) 2>&5
7443   ac_status=$?
7444   echo "$as_me:7444: \$? = $ac_status" >&5
7445   (exit $ac_status); } &&
7446          { ac_try='test -s conftest.$ac_objext'
7447   { (eval echo "$as_me:7447: \"$ac_try\"") >&5
7448   (eval $ac_try) 2>&5
7449   ac_status=$?
7450   echo "$as_me:7450: \$? = $ac_status" >&5
7451   (exit $ac_status); }; }; then
7452   :
7453 else
7454   echo "$as_me: failed program was:" >&5
7455 cat conftest.$ac_ext >&5
7456 cf_have_incdir=yes
7457 fi
7458 rm -f conftest.$ac_objext conftest.$ac_ext
7459                           CPPFLAGS=$cf_save_CPPFLAGS
7460                         fi
7461                   fi
7462                 fi
7463
7464                 if test "$cf_have_incdir" = no ; then
7465                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7466
7467 echo "${as_me:-configure}:7467: testing adding $cf_add_incdir to include-path ..." 1>&5
7468
7469                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7470
7471                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7472                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7473                   cf_add_incdir="$cf_top_incdir"
7474                 else
7475                   break
7476                 fi
7477           else
7478                 break
7479           fi
7480         done
7481   done
7482 fi
7483
7484 if test -n "$cf_cv_library_path_utf8" ; then
7485         for cf_add_libdir in $cf_cv_library_path_utf8
7486         do
7487                 if test $cf_add_libdir = /usr/lib ; then
7488                         :
7489                 elif test -d $cf_add_libdir
7490                 then
7491                         cf_have_libdir=no
7492                         if test -n "$LDFLAGS$LIBS" ; then
7493                                 # a loop is needed to ensure we can add subdirs of existing dirs
7494                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7495                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7496                                                 cf_have_libdir=yes; break
7497                                         fi
7498                                 done
7499                         fi
7500                         if test "$cf_have_libdir" = no ; then
7501                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7502
7503 echo "${as_me:-configure}:7503: testing adding $cf_add_libdir to library-path ..." 1>&5
7504
7505                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7506                         fi
7507                 fi
7508         done
7509 fi
7510
7511 cf_add_libs="$cf_cv_library_file_utf8"
7512 # Filter out duplicates - this happens with badly-designed ".pc" files...
7513 for cf_add_1lib in $LIBS
7514 do
7515         for cf_add_2lib in $cf_add_libs
7516         do
7517                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7518                 then
7519                         cf_add_1lib=
7520                         break
7521                 fi
7522         done
7523         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7524 done
7525 LIBS="$cf_add_libs"
7526
7527 fi
7528
7529 cf_ncuconfig_root=$cf_cv_screen
7530 cf_have_ncuconfig=no
7531
7532 if test "x${PKG_CONFIG:=none}" != xnone; then
7533         echo "$as_me:7533: checking pkg-config for $cf_ncuconfig_root" >&5
7534 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7535         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7536                 echo "$as_me:7536: result: yes" >&5
7537 echo "${ECHO_T}yes" >&6
7538
7539                 echo "$as_me:7539: checking if the $cf_ncuconfig_root package files work" >&5
7540 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7541                 cf_have_ncuconfig=unknown
7542
7543                 cf_save_CPPFLAGS="$CPPFLAGS"
7544                 cf_save_LIBS="$LIBS"
7545
7546 cf_fix_cppflags=no
7547 cf_new_cflags=
7548 cf_new_cppflags=
7549 cf_new_extra_cppflags=
7550
7551 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
7552 do
7553 case $cf_fix_cppflags in
7554 (no)
7555         case $cf_add_cflags in
7556         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7557                 case $cf_add_cflags in
7558                 (-D*)
7559                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7560
7561                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7562                                 && test -z "${cf_tst_cflags}" \
7563                                 && cf_fix_cppflags=yes
7564
7565                         if test $cf_fix_cppflags = yes ; then
7566
7567         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7568         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7569
7570                                 continue
7571                         elif test "${cf_tst_cflags}" = "\"'" ; then
7572
7573         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7574         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7575
7576                                 continue
7577                         fi
7578                         ;;
7579                 esac
7580                 case "$CPPFLAGS" in
7581                 (*$cf_add_cflags)
7582                         ;;
7583                 (*)
7584                         case $cf_add_cflags in
7585                         (-D*)
7586                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7587
7588 CPPFLAGS=`echo "$CPPFLAGS" | \
7589         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7590                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7591
7592                                 ;;
7593                         esac
7594
7595         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7596         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7597
7598                         ;;
7599                 esac
7600                 ;;
7601         (*)
7602
7603         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7604         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7605
7606                 ;;
7607         esac
7608         ;;
7609 (yes)
7610
7611         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7612         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7613
7614         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7615
7616         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7617                 && test -z "${cf_tst_cflags}" \
7618                 && cf_fix_cppflags=no
7619         ;;
7620 esac
7621 done
7622
7623 if test -n "$cf_new_cflags" ; then
7624
7625         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7626         CFLAGS="${CFLAGS}$cf_new_cflags"
7627
7628 fi
7629
7630 if test -n "$cf_new_cppflags" ; then
7631
7632         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7633         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7634
7635 fi
7636
7637 if test -n "$cf_new_extra_cppflags" ; then
7638
7639         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7640         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7641
7642 fi
7643
7644 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7645 # Filter out duplicates - this happens with badly-designed ".pc" files...
7646 for cf_add_1lib in $LIBS
7647 do
7648         for cf_add_2lib in $cf_add_libs
7649         do
7650                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7651                 then
7652                         cf_add_1lib=
7653                         break
7654                 fi
7655         done
7656         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7657 done
7658 LIBS="$cf_add_libs"
7659
7660                 cat >conftest.$ac_ext <<_ACEOF
7661 #line 7661 "configure"
7662 #include "confdefs.h"
7663 #include <${cf_cv_ncurses_header:-curses.h}>
7664 int
7665 main (void)
7666 {
7667 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7668   ;
7669   return 0;
7670 }
7671 _ACEOF
7672 rm -f conftest.$ac_objext conftest$ac_exeext
7673 if { (eval echo "$as_me:7673: \"$ac_link\"") >&5
7674   (eval $ac_link) 2>&5
7675   ac_status=$?
7676   echo "$as_me:7676: \$? = $ac_status" >&5
7677   (exit $ac_status); } &&
7678          { ac_try='test -s conftest$ac_exeext'
7679   { (eval echo "$as_me:7679: \"$ac_try\"") >&5
7680   (eval $ac_try) 2>&5
7681   ac_status=$?
7682   echo "$as_me:7682: \$? = $ac_status" >&5
7683   (exit $ac_status); }; }; then
7684   if test "$cross_compiling" = yes; then
7685   cf_have_ncuconfig=maybe
7686 else
7687   cat >conftest.$ac_ext <<_ACEOF
7688 #line 7688 "configure"
7689 #include "confdefs.h"
7690 #include <${cf_cv_ncurses_header:-curses.h}>
7691                                 int main(void)
7692                                 { char *xx = curses_version(); return (xx == 0); }
7693 _ACEOF
7694 rm -f conftest$ac_exeext
7695 if { (eval echo "$as_me:7695: \"$ac_link\"") >&5
7696   (eval $ac_link) 2>&5
7697   ac_status=$?
7698   echo "$as_me:7698: \$? = $ac_status" >&5
7699   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7700   { (eval echo "$as_me:7700: \"$ac_try\"") >&5
7701   (eval $ac_try) 2>&5
7702   ac_status=$?
7703   echo "$as_me:7703: \$? = $ac_status" >&5
7704   (exit $ac_status); }; }; then
7705   cf_have_ncuconfig=yes
7706 else
7707   echo "$as_me: program exited with status $ac_status" >&5
7708 echo "$as_me: failed program was:" >&5
7709 cat conftest.$ac_ext >&5
7710 cf_have_ncuconfig=no
7711 fi
7712 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7713 fi
7714 else
7715   echo "$as_me: failed program was:" >&5
7716 cat conftest.$ac_ext >&5
7717 cf_have_ncuconfig=no
7718 fi
7719 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7720                 echo "$as_me:7720: result: $cf_have_ncuconfig" >&5
7721 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7722                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7723                 if test "$cf_have_ncuconfig" != "yes"
7724                 then
7725                         CPPFLAGS="$cf_save_CPPFLAGS"
7726                         LIBS="$cf_save_LIBS"
7727                         NCURSES_CONFIG_PKG=none
7728                 else
7729
7730 cat >>confdefs.h <<\EOF
7731 #define NCURSES 1
7732 EOF
7733
7734                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7735
7736 echo "$as_me:7736: checking for terminfo header" >&5
7737 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7738 if test "${cf_cv_term_header+set}" = set; then
7739   echo $ECHO_N "(cached) $ECHO_C" >&6
7740 else
7741
7742 case ${cf_cv_ncurses_header} in
7743 (*/ncurses.h|*/ncursesw.h)
7744         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7745         ;;
7746 (*)
7747         cf_term_header=term.h
7748         ;;
7749 esac
7750
7751 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7752 do
7753 cat >conftest.$ac_ext <<_ACEOF
7754 #line 7754 "configure"
7755 #include "confdefs.h"
7756 #include <stdio.h>
7757 #include <${cf_cv_ncurses_header:-curses.h}>
7758 #include <$cf_test>
7759
7760 int
7761 main (void)
7762 {
7763 int x = auto_left_margin
7764   ;
7765   return 0;
7766 }
7767 _ACEOF
7768 rm -f conftest.$ac_objext
7769 if { (eval echo "$as_me:7769: \"$ac_compile\"") >&5
7770   (eval $ac_compile) 2>&5
7771   ac_status=$?
7772   echo "$as_me:7772: \$? = $ac_status" >&5
7773   (exit $ac_status); } &&
7774          { ac_try='test -s conftest.$ac_objext'
7775   { (eval echo "$as_me:7775: \"$ac_try\"") >&5
7776   (eval $ac_try) 2>&5
7777   ac_status=$?
7778   echo "$as_me:7778: \$? = $ac_status" >&5
7779   (exit $ac_status); }; }; then
7780
7781         cf_cv_term_header="$cf_test"
7782 else
7783   echo "$as_me: failed program was:" >&5
7784 cat conftest.$ac_ext >&5
7785
7786         cf_cv_term_header=unknown
7787
7788 fi
7789 rm -f conftest.$ac_objext conftest.$ac_ext
7790         test "$cf_cv_term_header" != unknown && break
7791 done
7792
7793 fi
7794 echo "$as_me:7794: result: $cf_cv_term_header" >&5
7795 echo "${ECHO_T}$cf_cv_term_header" >&6
7796
7797 # Set definitions to allow ifdef'ing to accommodate subdirectories
7798
7799 case $cf_cv_term_header in
7800 (*term.h)
7801
7802 cat >>confdefs.h <<\EOF
7803 #define HAVE_TERM_H 1
7804 EOF
7805
7806         ;;
7807 esac
7808
7809 case $cf_cv_term_header in
7810 (ncurses/term.h)
7811
7812 cat >>confdefs.h <<\EOF
7813 #define HAVE_NCURSES_TERM_H 1
7814 EOF
7815
7816         ;;
7817 (ncursesw/term.h)
7818
7819 cat >>confdefs.h <<\EOF
7820 #define HAVE_NCURSESW_TERM_H 1
7821 EOF
7822
7823         ;;
7824 esac
7825
7826                 fi
7827
7828         else
7829                 echo "$as_me:7829: result: no" >&5
7830 echo "${ECHO_T}no" >&6
7831                 NCURSES_CONFIG_PKG=none
7832         fi
7833 else
7834         NCURSES_CONFIG_PKG=none
7835 fi
7836
7837 if test "x$cf_have_ncuconfig" = "xno"; then
7838         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7839
7840 if test -n "$ac_tool_prefix"; then
7841   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7842   do
7843     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7844 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7845 echo "$as_me:7845: checking for $ac_word" >&5
7846 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7847 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7848   echo $ECHO_N "(cached) $ECHO_C" >&6
7849 else
7850   if test -n "$NCURSES_CONFIG"; then
7851   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7852 else
7853   ac_save_IFS=$IFS; IFS=$ac_path_separator
7854 ac_dummy="$PATH"
7855 for ac_dir in $ac_dummy; do
7856   IFS=$ac_save_IFS
7857   test -z "$ac_dir" && ac_dir=.
7858   $as_executable_p "$ac_dir/$ac_word" || continue
7859 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7860 echo "$as_me:7860: found $ac_dir/$ac_word" >&5
7861 break
7862 done
7863
7864 fi
7865 fi
7866 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7867 if test -n "$NCURSES_CONFIG"; then
7868   echo "$as_me:7868: result: $NCURSES_CONFIG" >&5
7869 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7870 else
7871   echo "$as_me:7871: result: no" >&5
7872 echo "${ECHO_T}no" >&6
7873 fi
7874
7875     test -n "$NCURSES_CONFIG" && break
7876   done
7877 fi
7878 if test -z "$NCURSES_CONFIG"; then
7879   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7880   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7881 do
7882   # Extract the first word of "$ac_prog", so it can be a program name with args.
7883 set dummy $ac_prog; ac_word=$2
7884 echo "$as_me:7884: checking for $ac_word" >&5
7885 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7886 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7887   echo $ECHO_N "(cached) $ECHO_C" >&6
7888 else
7889   if test -n "$ac_ct_NCURSES_CONFIG"; then
7890   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7891 else
7892   ac_save_IFS=$IFS; IFS=$ac_path_separator
7893 ac_dummy="$PATH"
7894 for ac_dir in $ac_dummy; do
7895   IFS=$ac_save_IFS
7896   test -z "$ac_dir" && ac_dir=.
7897   $as_executable_p "$ac_dir/$ac_word" || continue
7898 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7899 echo "$as_me:7899: found $ac_dir/$ac_word" >&5
7900 break
7901 done
7902
7903 fi
7904 fi
7905 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7906 if test -n "$ac_ct_NCURSES_CONFIG"; then
7907   echo "$as_me:7907: result: $ac_ct_NCURSES_CONFIG" >&5
7908 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7909 else
7910   echo "$as_me:7910: result: no" >&5
7911 echo "${ECHO_T}no" >&6
7912 fi
7913
7914   test -n "$ac_ct_NCURSES_CONFIG" && break
7915 done
7916 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7917
7918   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7919 fi
7920
7921         if test "$NCURSES_CONFIG" != none ; then
7922
7923 cf_fix_cppflags=no
7924 cf_new_cflags=
7925 cf_new_cppflags=
7926 cf_new_extra_cppflags=
7927
7928 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7929 do
7930 case $cf_fix_cppflags in
7931 (no)
7932         case $cf_add_cflags in
7933         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7934                 case $cf_add_cflags in
7935                 (-D*)
7936                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7937
7938                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7939                                 && test -z "${cf_tst_cflags}" \
7940                                 && cf_fix_cppflags=yes
7941
7942                         if test $cf_fix_cppflags = yes ; then
7943
7944         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7945         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7946
7947                                 continue
7948                         elif test "${cf_tst_cflags}" = "\"'" ; then
7949
7950         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7951         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7952
7953                                 continue
7954                         fi
7955                         ;;
7956                 esac
7957                 case "$CPPFLAGS" in
7958                 (*$cf_add_cflags)
7959                         ;;
7960                 (*)
7961                         case $cf_add_cflags in
7962                         (-D*)
7963                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7964
7965 CPPFLAGS=`echo "$CPPFLAGS" | \
7966         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7967                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7968
7969                                 ;;
7970                         esac
7971
7972         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7973         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7974
7975                         ;;
7976                 esac
7977                 ;;
7978         (*)
7979
7980         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7981         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7982
7983                 ;;
7984         esac
7985         ;;
7986 (yes)
7987
7988         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7989         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7990
7991         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7992
7993         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7994                 && test -z "${cf_tst_cflags}" \
7995                 && cf_fix_cppflags=no
7996         ;;
7997 esac
7998 done
7999
8000 if test -n "$cf_new_cflags" ; then
8001
8002         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8003         CFLAGS="${CFLAGS}$cf_new_cflags"
8004
8005 fi
8006
8007 if test -n "$cf_new_cppflags" ; then
8008
8009         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8010         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8011
8012 fi
8013
8014 if test -n "$cf_new_extra_cppflags" ; then
8015
8016         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8017         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8018
8019 fi
8020
8021 cf_add_libs="`$NCURSES_CONFIG --libs`"
8022 # Filter out duplicates - this happens with badly-designed ".pc" files...
8023 for cf_add_1lib in $LIBS
8024 do
8025         for cf_add_2lib in $cf_add_libs
8026         do
8027                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8028                 then
8029                         cf_add_1lib=
8030                         break
8031                 fi
8032         done
8033         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8034 done
8035 LIBS="$cf_add_libs"
8036
8037                 # even with config script, some packages use no-override for curses.h
8038
8039 echo "$as_me:8039: checking if we have identified curses headers" >&5
8040 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8041 if test "${cf_cv_ncurses_header+set}" = set; then
8042   echo $ECHO_N "(cached) $ECHO_C" >&6
8043 else
8044
8045 cf_cv_ncurses_header=none
8046 for cf_header in \
8047         ncurses.h $cf_cv_screen/ncurses.h \
8048         curses.h $cf_cv_screen/curses.h
8049 do
8050 cat >conftest.$ac_ext <<_ACEOF
8051 #line 8051 "configure"
8052 #include "confdefs.h"
8053 #include <${cf_header}>
8054 int
8055 main (void)
8056 {
8057 initscr(); tgoto("?", 0,0)
8058   ;
8059   return 0;
8060 }
8061 _ACEOF
8062 rm -f conftest.$ac_objext
8063 if { (eval echo "$as_me:8063: \"$ac_compile\"") >&5
8064   (eval $ac_compile) 2>&5
8065   ac_status=$?
8066   echo "$as_me:8066: \$? = $ac_status" >&5
8067   (exit $ac_status); } &&
8068          { ac_try='test -s conftest.$ac_objext'
8069   { (eval echo "$as_me:8069: \"$ac_try\"") >&5
8070   (eval $ac_try) 2>&5
8071   ac_status=$?
8072   echo "$as_me:8072: \$? = $ac_status" >&5
8073   (exit $ac_status); }; }; then
8074   cf_cv_ncurses_header=$cf_header; break
8075 else
8076   echo "$as_me: failed program was:" >&5
8077 cat conftest.$ac_ext >&5
8078 fi
8079 rm -f conftest.$ac_objext conftest.$ac_ext
8080 done
8081
8082 fi
8083 echo "$as_me:8083: result: $cf_cv_ncurses_header" >&5
8084 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8085
8086 if test "$cf_cv_ncurses_header" = none ; then
8087         { { echo "$as_me:8087: error: No curses header-files found" >&5
8088 echo "$as_me: error: No curses header-files found" >&2;}
8089    { (exit 1); exit 1; }; }
8090 fi
8091
8092 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8093
8094 for ac_header in $cf_cv_ncurses_header
8095 do
8096 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8097 echo "$as_me:8097: checking for $ac_header" >&5
8098 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8099 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8100   echo $ECHO_N "(cached) $ECHO_C" >&6
8101 else
8102   cat >conftest.$ac_ext <<_ACEOF
8103 #line 8103 "configure"
8104 #include "confdefs.h"
8105 #include <$ac_header>
8106 _ACEOF
8107 if { (eval echo "$as_me:8107: \"$ac_cpp conftest.$ac_ext\"") >&5
8108   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8109   ac_status=$?
8110   egrep -v '^ *\+' conftest.er1 >conftest.err
8111   rm -f conftest.er1
8112   cat conftest.err >&5
8113   echo "$as_me:8113: \$? = $ac_status" >&5
8114   (exit $ac_status); } >/dev/null; then
8115   if test -s conftest.err; then
8116     ac_cpp_err=$ac_c_preproc_warn_flag
8117   else
8118     ac_cpp_err=
8119   fi
8120 else
8121   ac_cpp_err=yes
8122 fi
8123 if test -z "$ac_cpp_err"; then
8124   eval "$as_ac_Header=yes"
8125 else
8126   echo "$as_me: failed program was:" >&5
8127   cat conftest.$ac_ext >&5
8128   eval "$as_ac_Header=no"
8129 fi
8130 rm -f conftest.err conftest.$ac_ext
8131 fi
8132 echo "$as_me:8132: result: `eval echo '${'$as_ac_Header'}'`" >&5
8133 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8134 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8135   cat >>confdefs.h <<EOF
8136 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8137 EOF
8138
8139 fi
8140 done
8141
8142 cat >>confdefs.h <<\EOF
8143 #define NCURSES 1
8144 EOF
8145
8146 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8147
8148                 cat >>confdefs.h <<EOF
8149 #define $cf_nculib_ROOT 1
8150 EOF
8151
8152                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8153
8154         else
8155
8156 cf_ncuhdr_root=$cf_cv_screen
8157
8158 test -n "$cf_cv_curses_dir" && \
8159 test "$cf_cv_curses_dir" != "no" && { \
8160
8161 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8162   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8163   do
8164         while test $cf_add_incdir != /usr/include
8165         do
8166           if test -d $cf_add_incdir
8167           then
8168                 cf_have_incdir=no
8169                 if test -n "$CFLAGS$CPPFLAGS" ; then
8170                   # a loop is needed to ensure we can add subdirs of existing dirs
8171                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8172                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8173                           cf_have_incdir=yes; break
8174                         fi
8175                   done
8176                 fi
8177
8178                 if test "$cf_have_incdir" = no ; then
8179                   if test "$cf_add_incdir" = /usr/local/include ; then
8180                         if test "$GCC" = yes
8181                         then
8182                           cf_save_CPPFLAGS=$CPPFLAGS
8183
8184         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8185         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8186
8187                           cat >conftest.$ac_ext <<_ACEOF
8188 #line 8188 "configure"
8189 #include "confdefs.h"
8190 #include <stdio.h>
8191 int
8192 main (void)
8193 {
8194 printf("Hello")
8195   ;
8196   return 0;
8197 }
8198 _ACEOF
8199 rm -f conftest.$ac_objext
8200 if { (eval echo "$as_me:8200: \"$ac_compile\"") >&5
8201   (eval $ac_compile) 2>&5
8202   ac_status=$?
8203   echo "$as_me:8203: \$? = $ac_status" >&5
8204   (exit $ac_status); } &&
8205          { ac_try='test -s conftest.$ac_objext'
8206   { (eval echo "$as_me:8206: \"$ac_try\"") >&5
8207   (eval $ac_try) 2>&5
8208   ac_status=$?
8209   echo "$as_me:8209: \$? = $ac_status" >&5
8210   (exit $ac_status); }; }; then
8211   :
8212 else
8213   echo "$as_me: failed program was:" >&5
8214 cat conftest.$ac_ext >&5
8215 cf_have_incdir=yes
8216 fi
8217 rm -f conftest.$ac_objext conftest.$ac_ext
8218                           CPPFLAGS=$cf_save_CPPFLAGS
8219                         fi
8220                   fi
8221                 fi
8222
8223                 if test "$cf_have_incdir" = no ; then
8224                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8225
8226 echo "${as_me:-configure}:8226: testing adding $cf_add_incdir to include-path ..." 1>&5
8227
8228                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8229
8230                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8231                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8232                   cf_add_incdir="$cf_top_incdir"
8233                 else
8234                   break
8235                 fi
8236           else
8237                 break
8238           fi
8239         done
8240   done
8241 fi
8242
8243 }
8244
8245 echo "$as_me:8245: checking for $cf_ncuhdr_root header in include-path" >&5
8246 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8247 if test "${cf_cv_ncurses_h+set}" = set; then
8248   echo $ECHO_N "(cached) $ECHO_C" >&6
8249 else
8250
8251         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8252         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8253         for cf_header in $cf_header_list
8254         do
8255
8256         cat >conftest.$ac_ext <<_ACEOF
8257 #line 8257 "configure"
8258 #include "confdefs.h"
8259
8260 #include <$cf_header>
8261 int
8262 main (void)
8263 {
8264
8265 #ifdef NCURSES_VERSION
8266
8267 printf("%s\n", NCURSES_VERSION);
8268 #else
8269 #ifdef __NCURSES_H
8270 printf("old\n");
8271 #else
8272         make an error
8273 #endif
8274 #endif
8275
8276   ;
8277   return 0;
8278 }
8279 _ACEOF
8280 rm -f conftest.$ac_objext
8281 if { (eval echo "$as_me:8281: \"$ac_compile\"") >&5
8282   (eval $ac_compile) 2>&5
8283   ac_status=$?
8284   echo "$as_me:8284: \$? = $ac_status" >&5
8285   (exit $ac_status); } &&
8286          { ac_try='test -s conftest.$ac_objext'
8287   { (eval echo "$as_me:8287: \"$ac_try\"") >&5
8288   (eval $ac_try) 2>&5
8289   ac_status=$?
8290   echo "$as_me:8290: \$? = $ac_status" >&5
8291   (exit $ac_status); }; }; then
8292   cf_cv_ncurses_h=$cf_header
8293
8294 else
8295   echo "$as_me: failed program was:" >&5
8296 cat conftest.$ac_ext >&5
8297 cf_cv_ncurses_h=no
8298 fi
8299 rm -f conftest.$ac_objext conftest.$ac_ext
8300
8301                 test "$cf_cv_ncurses_h" != no && break
8302         done
8303
8304 fi
8305 echo "$as_me:8305: result: $cf_cv_ncurses_h" >&5
8306 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8307
8308 if test "$cf_cv_ncurses_h" != no ; then
8309         cf_cv_ncurses_header=$cf_cv_ncurses_h
8310 else
8311
8312 echo "$as_me:8312: checking for $cf_ncuhdr_root include-path" >&5
8313 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8314 if test "${cf_cv_ncurses_h2+set}" = set; then
8315   echo $ECHO_N "(cached) $ECHO_C" >&6
8316 else
8317
8318         test -n "$verbose" && echo
8319
8320 cf_search=
8321
8322 # collect the current set of include-directories from compiler flags
8323 cf_header_path_list=""
8324 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8325         for cf_header_path in $CPPFLAGS $CFLAGS
8326         do
8327                 case $cf_header_path in
8328                 (-I*)
8329                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8330
8331 test "x$cf_header_path" != "xNONE" && \
8332 test -d "$cf_header_path" && \
8333  {
8334         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8335         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8336         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8337         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8338         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8339         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"
8340 }
8341
8342                         cf_header_path_list="$cf_header_path_list $cf_search"
8343                         ;;
8344                 esac
8345         done
8346 fi
8347
8348 # add the variations for the package we are looking for
8349
8350 cf_search=
8351
8352 test "x$prefix" != "xNONE" && \
8353 test -d "$prefix" && \
8354  {
8355         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8356         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8357         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8358         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8359         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8360         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8361 }
8362
8363 for cf_subdir_prefix in \
8364         /usr \
8365         /usr/local \
8366         /usr/pkg \
8367         /opt \
8368         /opt/local \
8369         $HOME
8370 do
8371
8372 test "x$cf_subdir_prefix" != "x$prefix" && \
8373 test -d "$cf_subdir_prefix" && \
8374 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8375         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8376         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8377         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8378         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8379         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8380         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"
8381 }
8382
8383 done
8384
8385 test "$includedir" != NONE && \
8386 test "$includedir" != "/usr/include" && \
8387 test -d "$includedir" && {
8388         test -d $includedir &&    cf_search="$cf_search $includedir"
8389         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8390 }
8391
8392 test "$oldincludedir" != NONE && \
8393 test "$oldincludedir" != "/usr/include" && \
8394 test -d "$oldincludedir" && {
8395         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8396         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8397 }
8398
8399 cf_search="$cf_search $cf_header_path_list"
8400
8401         test -n "$verbose" && echo search path $cf_search
8402         cf_save2_CPPFLAGS="$CPPFLAGS"
8403         for cf_incdir in $cf_search
8404         do
8405
8406 if test -n "$cf_incdir" ; then
8407   for cf_add_incdir in $cf_incdir
8408   do
8409         while test $cf_add_incdir != /usr/include
8410         do
8411           if test -d $cf_add_incdir
8412           then
8413                 cf_have_incdir=no
8414                 if test -n "$CFLAGS$CPPFLAGS" ; then
8415                   # a loop is needed to ensure we can add subdirs of existing dirs
8416                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8417                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8418                           cf_have_incdir=yes; break
8419                         fi
8420                   done
8421                 fi
8422
8423                 if test "$cf_have_incdir" = no ; then
8424                   if test "$cf_add_incdir" = /usr/local/include ; then
8425                         if test "$GCC" = yes
8426                         then
8427                           cf_save_CPPFLAGS=$CPPFLAGS
8428
8429         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8430         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8431
8432                           cat >conftest.$ac_ext <<_ACEOF
8433 #line 8433 "configure"
8434 #include "confdefs.h"
8435 #include <stdio.h>
8436 int
8437 main (void)
8438 {
8439 printf("Hello")
8440   ;
8441   return 0;
8442 }
8443 _ACEOF
8444 rm -f conftest.$ac_objext
8445 if { (eval echo "$as_me:8445: \"$ac_compile\"") >&5
8446   (eval $ac_compile) 2>&5
8447   ac_status=$?
8448   echo "$as_me:8448: \$? = $ac_status" >&5
8449   (exit $ac_status); } &&
8450          { ac_try='test -s conftest.$ac_objext'
8451   { (eval echo "$as_me:8451: \"$ac_try\"") >&5
8452   (eval $ac_try) 2>&5
8453   ac_status=$?
8454   echo "$as_me:8454: \$? = $ac_status" >&5
8455   (exit $ac_status); }; }; then
8456   :
8457 else
8458   echo "$as_me: failed program was:" >&5
8459 cat conftest.$ac_ext >&5
8460 cf_have_incdir=yes
8461 fi
8462 rm -f conftest.$ac_objext conftest.$ac_ext
8463                           CPPFLAGS=$cf_save_CPPFLAGS
8464                         fi
8465                   fi
8466                 fi
8467
8468                 if test "$cf_have_incdir" = no ; then
8469                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8470
8471 echo "${as_me:-configure}:8471: testing adding $cf_add_incdir to include-path ..." 1>&5
8472
8473                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8474
8475                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8476                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8477                   cf_add_incdir="$cf_top_incdir"
8478                 else
8479                   break
8480                 fi
8481           else
8482                 break
8483           fi
8484         done
8485   done
8486 fi
8487
8488                 for cf_header in \
8489                         ncurses.h \
8490                         curses.h
8491                 do
8492
8493         cat >conftest.$ac_ext <<_ACEOF
8494 #line 8494 "configure"
8495 #include "confdefs.h"
8496
8497 #include <$cf_header>
8498 int
8499 main (void)
8500 {
8501
8502 #ifdef NCURSES_VERSION
8503
8504 printf("%s\n", NCURSES_VERSION);
8505 #else
8506 #ifdef __NCURSES_H
8507 printf("old\n");
8508 #else
8509         make an error
8510 #endif
8511 #endif
8512
8513   ;
8514   return 0;
8515 }
8516 _ACEOF
8517 rm -f conftest.$ac_objext
8518 if { (eval echo "$as_me:8518: \"$ac_compile\"") >&5
8519   (eval $ac_compile) 2>&5
8520   ac_status=$?
8521   echo "$as_me:8521: \$? = $ac_status" >&5
8522   (exit $ac_status); } &&
8523          { ac_try='test -s conftest.$ac_objext'
8524   { (eval echo "$as_me:8524: \"$ac_try\"") >&5
8525   (eval $ac_try) 2>&5
8526   ac_status=$?
8527   echo "$as_me:8527: \$? = $ac_status" >&5
8528   (exit $ac_status); }; }; then
8529   cf_cv_ncurses_h2=$cf_header
8530
8531 else
8532   echo "$as_me: failed program was:" >&5
8533 cat conftest.$ac_ext >&5
8534 cf_cv_ncurses_h2=no
8535 fi
8536 rm -f conftest.$ac_objext conftest.$ac_ext
8537
8538                         if test "$cf_cv_ncurses_h2" != no ; then
8539                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8540                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8541                                 break
8542                         fi
8543                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8544                 done
8545                 CPPFLAGS="$cf_save2_CPPFLAGS"
8546                 test "$cf_cv_ncurses_h2" != no && break
8547         done
8548         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8548: error: not found" >&5
8549 echo "$as_me: error: not found" >&2;}
8550    { (exit 1); exit 1; }; }
8551
8552 fi
8553 echo "$as_me:8553: result: $cf_cv_ncurses_h2" >&5
8554 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8555
8556         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8557         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8558         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8559                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8560         fi
8561
8562 if test -n "$cf_1st_incdir" ; then
8563   for cf_add_incdir in $cf_1st_incdir
8564   do
8565         while test $cf_add_incdir != /usr/include
8566         do
8567           if test -d $cf_add_incdir
8568           then
8569                 cf_have_incdir=no
8570                 if test -n "$CFLAGS$CPPFLAGS" ; then
8571                   # a loop is needed to ensure we can add subdirs of existing dirs
8572                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8573                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8574                           cf_have_incdir=yes; break
8575                         fi
8576                   done
8577                 fi
8578
8579                 if test "$cf_have_incdir" = no ; then
8580                   if test "$cf_add_incdir" = /usr/local/include ; then
8581                         if test "$GCC" = yes
8582                         then
8583                           cf_save_CPPFLAGS=$CPPFLAGS
8584
8585         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8586         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8587
8588                           cat >conftest.$ac_ext <<_ACEOF
8589 #line 8589 "configure"
8590 #include "confdefs.h"
8591 #include <stdio.h>
8592 int
8593 main (void)
8594 {
8595 printf("Hello")
8596   ;
8597   return 0;
8598 }
8599 _ACEOF
8600 rm -f conftest.$ac_objext
8601 if { (eval echo "$as_me:8601: \"$ac_compile\"") >&5
8602   (eval $ac_compile) 2>&5
8603   ac_status=$?
8604   echo "$as_me:8604: \$? = $ac_status" >&5
8605   (exit $ac_status); } &&
8606          { ac_try='test -s conftest.$ac_objext'
8607   { (eval echo "$as_me:8607: \"$ac_try\"") >&5
8608   (eval $ac_try) 2>&5
8609   ac_status=$?
8610   echo "$as_me:8610: \$? = $ac_status" >&5
8611   (exit $ac_status); }; }; then
8612   :
8613 else
8614   echo "$as_me: failed program was:" >&5
8615 cat conftest.$ac_ext >&5
8616 cf_have_incdir=yes
8617 fi
8618 rm -f conftest.$ac_objext conftest.$ac_ext
8619                           CPPFLAGS=$cf_save_CPPFLAGS
8620                         fi
8621                   fi
8622                 fi
8623
8624                 if test "$cf_have_incdir" = no ; then
8625                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8626
8627 echo "${as_me:-configure}:8627: testing adding $cf_add_incdir to include-path ..." 1>&5
8628
8629                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8630
8631                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8632                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8633                   cf_add_incdir="$cf_top_incdir"
8634                 else
8635                   break
8636                 fi
8637           else
8638                 break
8639           fi
8640         done
8641   done
8642 fi
8643
8644 fi
8645
8646 # Set definitions to allow ifdef'ing for ncurses.h
8647
8648 case $cf_cv_ncurses_header in
8649 (*ncurses.h)
8650
8651 cat >>confdefs.h <<\EOF
8652 #define HAVE_NCURSES_H 1
8653 EOF
8654
8655         ;;
8656 esac
8657
8658 case $cf_cv_ncurses_header in
8659 (ncurses/curses.h|ncurses/ncurses.h)
8660
8661 cat >>confdefs.h <<\EOF
8662 #define HAVE_NCURSES_NCURSES_H 1
8663 EOF
8664
8665         ;;
8666 (ncursesw/curses.h|ncursesw/ncurses.h)
8667
8668 cat >>confdefs.h <<\EOF
8669 #define HAVE_NCURSESW_NCURSES_H 1
8670 EOF
8671
8672         ;;
8673 esac
8674
8675 echo "$as_me:8675: checking for terminfo header" >&5
8676 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8677 if test "${cf_cv_term_header+set}" = set; then
8678   echo $ECHO_N "(cached) $ECHO_C" >&6
8679 else
8680
8681 case ${cf_cv_ncurses_header} in
8682 (*/ncurses.h|*/ncursesw.h)
8683         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8684         ;;
8685 (*)
8686         cf_term_header=term.h
8687         ;;
8688 esac
8689
8690 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8691 do
8692 cat >conftest.$ac_ext <<_ACEOF
8693 #line 8693 "configure"
8694 #include "confdefs.h"
8695 #include <stdio.h>
8696 #include <${cf_cv_ncurses_header:-curses.h}>
8697 #include <$cf_test>
8698
8699 int
8700 main (void)
8701 {
8702 int x = auto_left_margin
8703   ;
8704   return 0;
8705 }
8706 _ACEOF
8707 rm -f conftest.$ac_objext
8708 if { (eval echo "$as_me:8708: \"$ac_compile\"") >&5
8709   (eval $ac_compile) 2>&5
8710   ac_status=$?
8711   echo "$as_me:8711: \$? = $ac_status" >&5
8712   (exit $ac_status); } &&
8713          { ac_try='test -s conftest.$ac_objext'
8714   { (eval echo "$as_me:8714: \"$ac_try\"") >&5
8715   (eval $ac_try) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit $ac_status); }; }; then
8719
8720         cf_cv_term_header="$cf_test"
8721 else
8722   echo "$as_me: failed program was:" >&5
8723 cat conftest.$ac_ext >&5
8724
8725         cf_cv_term_header=unknown
8726
8727 fi
8728 rm -f conftest.$ac_objext conftest.$ac_ext
8729         test "$cf_cv_term_header" != unknown && break
8730 done
8731
8732 fi
8733 echo "$as_me:8733: result: $cf_cv_term_header" >&5
8734 echo "${ECHO_T}$cf_cv_term_header" >&6
8735
8736 # Set definitions to allow ifdef'ing to accommodate subdirectories
8737
8738 case $cf_cv_term_header in
8739 (*term.h)
8740
8741 cat >>confdefs.h <<\EOF
8742 #define HAVE_TERM_H 1
8743 EOF
8744
8745         ;;
8746 esac
8747
8748 case $cf_cv_term_header in
8749 (ncurses/term.h)
8750
8751 cat >>confdefs.h <<\EOF
8752 #define HAVE_NCURSES_TERM_H 1
8753 EOF
8754
8755         ;;
8756 (ncursesw/term.h)
8757
8758 cat >>confdefs.h <<\EOF
8759 #define HAVE_NCURSESW_TERM_H 1
8760 EOF
8761
8762         ;;
8763 esac
8764
8765 # some applications need this, but should check for NCURSES_VERSION
8766
8767 cat >>confdefs.h <<\EOF
8768 #define NCURSES 1
8769 EOF
8770
8771 echo "$as_me:8771: checking for ncurses version" >&5
8772 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8773 if test "${cf_cv_ncurses_version+set}" = set; then
8774   echo $ECHO_N "(cached) $ECHO_C" >&6
8775 else
8776
8777         cf_cv_ncurses_version=no
8778         cf_tempfile=out$$
8779         rm -f $cf_tempfile
8780         if test "$cross_compiling" = yes; then
8781
8782         # This will not work if the preprocessor splits the line after the
8783         # Autoconf token.  The 'unproto' program does that.
8784         cat > conftest.$ac_ext <<EOF
8785 #include <${cf_cv_ncurses_header:-curses.h}>
8786 #undef Autoconf
8787 #ifdef NCURSES_VERSION
8788 Autoconf NCURSES_VERSION
8789 #else
8790 #ifdef __NCURSES_H
8791 Autoconf "old"
8792 #endif
8793 ;
8794 #endif
8795 EOF
8796         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8797         { (eval echo "$as_me:8797: \"$cf_try\"") >&5
8798   (eval $cf_try) 2>&5
8799   ac_status=$?
8800   echo "$as_me:8800: \$? = $ac_status" >&5
8801   (exit $ac_status); }
8802         if test -f conftest.out ; then
8803                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8804                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8805                 rm -f conftest.out
8806         fi
8807
8808 else
8809   cat >conftest.$ac_ext <<_ACEOF
8810 #line 8810 "configure"
8811 #include "confdefs.h"
8812
8813 #include <${cf_cv_ncurses_header:-curses.h}>
8814 #include <stdio.h>
8815 int main(void)
8816 {
8817         FILE *fp = fopen("$cf_tempfile", "w");
8818 #ifdef NCURSES_VERSION
8819 # ifdef NCURSES_VERSION_PATCH
8820         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8821 # else
8822         fprintf(fp, "%s\n", NCURSES_VERSION);
8823 # endif
8824 #else
8825 # ifdef __NCURSES_H
8826         fprintf(fp, "old\n");
8827 # else
8828         make an error
8829 # endif
8830 #endif
8831         ${cf_cv_main_return:-return}(0);
8832 }
8833 _ACEOF
8834 rm -f conftest$ac_exeext
8835 if { (eval echo "$as_me:8835: \"$ac_link\"") >&5
8836   (eval $ac_link) 2>&5
8837   ac_status=$?
8838   echo "$as_me:8838: \$? = $ac_status" >&5
8839   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8840   { (eval echo "$as_me:8840: \"$ac_try\"") >&5
8841   (eval $ac_try) 2>&5
8842   ac_status=$?
8843   echo "$as_me:8843: \$? = $ac_status" >&5
8844   (exit $ac_status); }; }; then
8845
8846         cf_cv_ncurses_version=`cat $cf_tempfile`
8847 else
8848   echo "$as_me: program exited with status $ac_status" >&5
8849 echo "$as_me: failed program was:" >&5
8850 cat conftest.$ac_ext >&5
8851 fi
8852 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8853 fi
8854         rm -f $cf_tempfile
8855
8856 fi
8857 echo "$as_me:8857: result: $cf_cv_ncurses_version" >&5
8858 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8859 test "$cf_cv_ncurses_version" = no ||
8860 cat >>confdefs.h <<\EOF
8861 #define NCURSES 1
8862 EOF
8863
8864 cf_nculib_root=$cf_cv_screen
8865         # This works, except for the special case where we find gpm, but
8866         # ncurses is in a nonstandard location via $LIBS, and we really want
8867         # to link gpm.
8868 cf_ncurses_LIBS=""
8869 cf_ncurses_SAVE="$LIBS"
8870 echo "$as_me:8870: checking for Gpm_Open in -lgpm" >&5
8871 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8872 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8873   echo $ECHO_N "(cached) $ECHO_C" >&6
8874 else
8875   ac_check_lib_save_LIBS=$LIBS
8876 LIBS="-lgpm  $LIBS"
8877 cat >conftest.$ac_ext <<_ACEOF
8878 #line 8878 "configure"
8879 #include "confdefs.h"
8880
8881 /* Override any gcc2 internal prototype to avoid an error.  */
8882 #ifdef __cplusplus
8883 extern "C"
8884 #endif
8885 /* We use char because int might match the return type of a gcc2
8886    builtin and then its argument prototype would still apply.  */
8887 char Gpm_Open ();
8888 int
8889 main (void)
8890 {
8891 Gpm_Open ();
8892   ;
8893   return 0;
8894 }
8895 _ACEOF
8896 rm -f conftest.$ac_objext conftest$ac_exeext
8897 if { (eval echo "$as_me:8897: \"$ac_link\"") >&5
8898   (eval $ac_link) 2>&5
8899   ac_status=$?
8900   echo "$as_me:8900: \$? = $ac_status" >&5
8901   (exit $ac_status); } &&
8902          { ac_try='test -s conftest$ac_exeext'
8903   { (eval echo "$as_me:8903: \"$ac_try\"") >&5
8904   (eval $ac_try) 2>&5
8905   ac_status=$?
8906   echo "$as_me:8906: \$? = $ac_status" >&5
8907   (exit $ac_status); }; }; then
8908   ac_cv_lib_gpm_Gpm_Open=yes
8909 else
8910   echo "$as_me: failed program was:" >&5
8911 cat conftest.$ac_ext >&5
8912 ac_cv_lib_gpm_Gpm_Open=no
8913 fi
8914 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8915 LIBS=$ac_check_lib_save_LIBS
8916 fi
8917 echo "$as_me:8917: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8918 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8919 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8920   echo "$as_me:8920: checking for initscr in -lgpm" >&5
8921 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8922 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8923   echo $ECHO_N "(cached) $ECHO_C" >&6
8924 else
8925   ac_check_lib_save_LIBS=$LIBS
8926 LIBS="-lgpm  $LIBS"
8927 cat >conftest.$ac_ext <<_ACEOF
8928 #line 8928 "configure"
8929 #include "confdefs.h"
8930
8931 /* Override any gcc2 internal prototype to avoid an error.  */
8932 #ifdef __cplusplus
8933 extern "C"
8934 #endif
8935 /* We use char because int might match the return type of a gcc2
8936    builtin and then its argument prototype would still apply.  */
8937 char initscr ();
8938 int
8939 main (void)
8940 {
8941 initscr ();
8942   ;
8943   return 0;
8944 }
8945 _ACEOF
8946 rm -f conftest.$ac_objext conftest$ac_exeext
8947 if { (eval echo "$as_me:8947: \"$ac_link\"") >&5
8948   (eval $ac_link) 2>&5
8949   ac_status=$?
8950   echo "$as_me:8950: \$? = $ac_status" >&5
8951   (exit $ac_status); } &&
8952          { ac_try='test -s conftest$ac_exeext'
8953   { (eval echo "$as_me:8953: \"$ac_try\"") >&5
8954   (eval $ac_try) 2>&5
8955   ac_status=$?
8956   echo "$as_me:8956: \$? = $ac_status" >&5
8957   (exit $ac_status); }; }; then
8958   ac_cv_lib_gpm_initscr=yes
8959 else
8960   echo "$as_me: failed program was:" >&5
8961 cat conftest.$ac_ext >&5
8962 ac_cv_lib_gpm_initscr=no
8963 fi
8964 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8965 LIBS=$ac_check_lib_save_LIBS
8966 fi
8967 echo "$as_me:8967: result: $ac_cv_lib_gpm_initscr" >&5
8968 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8969 if test $ac_cv_lib_gpm_initscr = yes; then
8970   LIBS="$cf_ncurses_SAVE"
8971 else
8972   cf_ncurses_LIBS="-lgpm"
8973 fi
8974
8975 fi
8976
8977 case $host_os in
8978 (freebsd*)
8979         # This is only necessary if you are linking against an obsolete
8980         # version of ncurses (but it should do no harm, since it's static).
8981         if test "$cf_nculib_root" = ncurses ; then
8982                 echo "$as_me:8982: checking for tgoto in -lmytinfo" >&5
8983 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8984 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8985   echo $ECHO_N "(cached) $ECHO_C" >&6
8986 else
8987   ac_check_lib_save_LIBS=$LIBS
8988 LIBS="-lmytinfo  $LIBS"
8989 cat >conftest.$ac_ext <<_ACEOF
8990 #line 8990 "configure"
8991 #include "confdefs.h"
8992
8993 /* Override any gcc2 internal prototype to avoid an error.  */
8994 #ifdef __cplusplus
8995 extern "C"
8996 #endif
8997 /* We use char because int might match the return type of a gcc2
8998    builtin and then its argument prototype would still apply.  */
8999 char tgoto ();
9000 int
9001 main (void)
9002 {
9003 tgoto ();
9004   ;
9005   return 0;
9006 }
9007 _ACEOF
9008 rm -f conftest.$ac_objext conftest$ac_exeext
9009 if { (eval echo "$as_me:9009: \"$ac_link\"") >&5
9010   (eval $ac_link) 2>&5
9011   ac_status=$?
9012   echo "$as_me:9012: \$? = $ac_status" >&5
9013   (exit $ac_status); } &&
9014          { ac_try='test -s conftest$ac_exeext'
9015   { (eval echo "$as_me:9015: \"$ac_try\"") >&5
9016   (eval $ac_try) 2>&5
9017   ac_status=$?
9018   echo "$as_me:9018: \$? = $ac_status" >&5
9019   (exit $ac_status); }; }; then
9020   ac_cv_lib_mytinfo_tgoto=yes
9021 else
9022   echo "$as_me: failed program was:" >&5
9023 cat conftest.$ac_ext >&5
9024 ac_cv_lib_mytinfo_tgoto=no
9025 fi
9026 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9027 LIBS=$ac_check_lib_save_LIBS
9028 fi
9029 echo "$as_me:9029: result: $ac_cv_lib_mytinfo_tgoto" >&5
9030 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9031 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9032   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9033 fi
9034
9035         fi
9036         ;;
9037 esac
9038
9039 cf_add_libs="$cf_ncurses_LIBS"
9040 # Filter out duplicates - this happens with badly-designed ".pc" files...
9041 for cf_add_1lib in $LIBS
9042 do
9043         for cf_add_2lib in $cf_add_libs
9044         do
9045                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9046                 then
9047                         cf_add_1lib=
9048                         break
9049                 fi
9050         done
9051         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9052 done
9053 LIBS="$cf_add_libs"
9054
9055 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9056 then
9057
9058 cf_add_libs="-l$cf_nculib_root"
9059 # Filter out duplicates - this happens with badly-designed ".pc" files...
9060 for cf_add_1lib in $LIBS
9061 do
9062         for cf_add_2lib in $cf_add_libs
9063         do
9064                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9065                 then
9066                         cf_add_1lib=
9067                         break
9068                 fi
9069         done
9070         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9071 done
9072 LIBS="$cf_add_libs"
9073
9074 else
9075
9076         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9077         cf_libdir=""
9078         echo "$as_me:9078: checking for initscr" >&5
9079 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9080 if test "${ac_cv_func_initscr+set}" = set; then
9081   echo $ECHO_N "(cached) $ECHO_C" >&6
9082 else
9083   cat >conftest.$ac_ext <<_ACEOF
9084 #line 9084 "configure"
9085 #include "confdefs.h"
9086 #define initscr autoconf_temporary
9087 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9088 #undef initscr
9089
9090 #ifdef __cplusplus
9091 extern "C"
9092 #endif
9093
9094 /* We use char because int might match the return type of a gcc2
9095    builtin and then its argument prototype would still apply.  */
9096 char initscr (void);
9097
9098 int
9099 main (void)
9100 {
9101
9102 /* The GNU C library defines stubs for functions which it implements
9103     to always fail with ENOSYS.  Some functions are actually named
9104     something starting with __ and the normal name is an alias.  */
9105 #if defined (__stub_initscr) || defined (__stub___initscr)
9106 #error found stub for initscr
9107 #endif
9108
9109         return initscr ();
9110   ;
9111   return 0;
9112 }
9113 _ACEOF
9114 rm -f conftest.$ac_objext conftest$ac_exeext
9115 if { (eval echo "$as_me:9115: \"$ac_link\"") >&5
9116   (eval $ac_link) 2>&5
9117   ac_status=$?
9118   echo "$as_me:9118: \$? = $ac_status" >&5
9119   (exit $ac_status); } &&
9120          { ac_try='test -s conftest$ac_exeext'
9121   { (eval echo "$as_me:9121: \"$ac_try\"") >&5
9122   (eval $ac_try) 2>&5
9123   ac_status=$?
9124   echo "$as_me:9124: \$? = $ac_status" >&5
9125   (exit $ac_status); }; }; then
9126   ac_cv_func_initscr=yes
9127 else
9128   echo "$as_me: failed program was:" >&5
9129 cat conftest.$ac_ext >&5
9130 ac_cv_func_initscr=no
9131 fi
9132 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9133 fi
9134 echo "$as_me:9134: result: $ac_cv_func_initscr" >&5
9135 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9136 if test $ac_cv_func_initscr = yes; then
9137   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9138 else
9139
9140                 cf_save_LIBS="$LIBS"
9141                 echo "$as_me:9141: checking for initscr in -l$cf_nculib_root" >&5
9142 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9143                 LIBS="-l$cf_nculib_root $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
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
9178 cf_search=
9179 cf_library_path_list=""
9180 if test -n "${LDFLAGS}${LIBS}" ; then
9181         for cf_library_path in $LDFLAGS $LIBS
9182         do
9183                 case $cf_library_path in
9184                 (-L*)
9185                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9186
9187 test "x$cf_library_path" != "xNONE" && \
9188 test -d "$cf_library_path" && \
9189  {
9190         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9191         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9192         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9193         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9194         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9195         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"
9196 }
9197
9198                         cf_library_path_list="$cf_library_path_list $cf_search"
9199                         ;;
9200                 esac
9201         done
9202 fi
9203
9204 cf_search=
9205
9206 test "x$prefix" != "xNONE" && \
9207 test -d "$prefix" && \
9208  {
9209         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9210         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9211         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9212         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9213         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9214         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9215 }
9216
9217 for cf_subdir_prefix in \
9218         /usr \
9219         /usr/local \
9220         /usr/pkg \
9221         /opt \
9222         /opt/local \
9223         $HOME
9224 do
9225
9226 test "x$cf_subdir_prefix" != "x$prefix" && \
9227 test -d "$cf_subdir_prefix" && \
9228 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9229         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9230         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9231         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9232         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9233         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9234         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"
9235 }
9236
9237 done
9238
9239 cf_search="$cf_library_path_list $cf_search"
9240
9241                         for cf_libdir in $cf_search
9242                         do
9243                                 echo "$as_me:9243: checking for -l$cf_nculib_root in $cf_libdir" >&5
9244 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9245                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9246                                 cat >conftest.$ac_ext <<_ACEOF
9247 #line 9247 "configure"
9248 #include "confdefs.h"
9249 #include <${cf_cv_ncurses_header:-curses.h}>
9250 int
9251 main (void)
9252 {
9253 initscr()
9254   ;
9255   return 0;
9256 }
9257 _ACEOF
9258 rm -f conftest.$ac_objext conftest$ac_exeext
9259 if { (eval echo "$as_me:9259: \"$ac_link\"") >&5
9260   (eval $ac_link) 2>&5
9261   ac_status=$?
9262   echo "$as_me:9262: \$? = $ac_status" >&5
9263   (exit $ac_status); } &&
9264          { ac_try='test -s conftest$ac_exeext'
9265   { (eval echo "$as_me:9265: \"$ac_try\"") >&5
9266   (eval $ac_try) 2>&5
9267   ac_status=$?
9268   echo "$as_me:9268: \$? = $ac_status" >&5
9269   (exit $ac_status); }; }; then
9270   echo "$as_me:9270: result: yes" >&5
9271 echo "${ECHO_T}yes" >&6
9272                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9273                                          break
9274 else
9275   echo "$as_me: failed program was:" >&5
9276 cat conftest.$ac_ext >&5
9277 echo "$as_me:9277: result: no" >&5
9278 echo "${ECHO_T}no" >&6
9279                                          LIBS="$cf_save_LIBS"
9280 fi
9281 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9282                         done
9283
9284 fi
9285 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9286
9287 fi
9288
9289 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9290
9291 if test $cf_found_library = no ; then
9292         { { echo "$as_me:9292: error: Cannot link $cf_nculib_root library" >&5
9293 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9294    { (exit 1); exit 1; }; }
9295 fi
9296
9297 fi
9298
9299 if test -n "$cf_ncurses_LIBS" ; then
9300         echo "$as_me:9300: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9301 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9302         cf_ncurses_SAVE="$LIBS"
9303         for p in $cf_ncurses_LIBS ; do
9304                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9305                 if test "$q" != "$LIBS" ; then
9306                         LIBS="$q"
9307                 fi
9308         done
9309         cat >conftest.$ac_ext <<_ACEOF
9310 #line 9310 "configure"
9311 #include "confdefs.h"
9312 #include <${cf_cv_ncurses_header:-curses.h}>
9313 int
9314 main (void)
9315 {
9316 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9317   ;
9318   return 0;
9319 }
9320 _ACEOF
9321 rm -f conftest.$ac_objext conftest$ac_exeext
9322 if { (eval echo "$as_me:9322: \"$ac_link\"") >&5
9323   (eval $ac_link) 2>&5
9324   ac_status=$?
9325   echo "$as_me:9325: \$? = $ac_status" >&5
9326   (exit $ac_status); } &&
9327          { ac_try='test -s conftest$ac_exeext'
9328   { (eval echo "$as_me:9328: \"$ac_try\"") >&5
9329   (eval $ac_try) 2>&5
9330   ac_status=$?
9331   echo "$as_me:9331: \$? = $ac_status" >&5
9332   (exit $ac_status); }; }; then
9333   echo "$as_me:9333: result: yes" >&5
9334 echo "${ECHO_T}yes" >&6
9335 else
9336   echo "$as_me: failed program was:" >&5
9337 cat conftest.$ac_ext >&5
9338 echo "$as_me:9338: result: no" >&5
9339 echo "${ECHO_T}no" >&6
9340                  LIBS="$cf_ncurses_SAVE"
9341 fi
9342 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9343 fi
9344
9345 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9346
9347 cat >>confdefs.h <<EOF
9348 #define $cf_nculib_ROOT 1
9349 EOF
9350
9351         fi
9352 else
9353         NCURSES_CONFIG=none
9354 fi
9355
9356         ;;
9357 (ncurses*)
9358
9359 cf_ncuconfig_root=$cf_cv_screen
9360 cf_have_ncuconfig=no
9361
9362 if test "x${PKG_CONFIG:=none}" != xnone; then
9363         echo "$as_me:9363: checking pkg-config for $cf_ncuconfig_root" >&5
9364 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9365         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9366                 echo "$as_me:9366: result: yes" >&5
9367 echo "${ECHO_T}yes" >&6
9368
9369                 echo "$as_me:9369: checking if the $cf_ncuconfig_root package files work" >&5
9370 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9371                 cf_have_ncuconfig=unknown
9372
9373                 cf_save_CPPFLAGS="$CPPFLAGS"
9374                 cf_save_LIBS="$LIBS"
9375
9376 cf_fix_cppflags=no
9377 cf_new_cflags=
9378 cf_new_cppflags=
9379 cf_new_extra_cppflags=
9380
9381 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
9382 do
9383 case $cf_fix_cppflags in
9384 (no)
9385         case $cf_add_cflags in
9386         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9387                 case $cf_add_cflags in
9388                 (-D*)
9389                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9390
9391                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9392                                 && test -z "${cf_tst_cflags}" \
9393                                 && cf_fix_cppflags=yes
9394
9395                         if test $cf_fix_cppflags = yes ; then
9396
9397         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9398         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9399
9400                                 continue
9401                         elif test "${cf_tst_cflags}" = "\"'" ; then
9402
9403         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9404         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9405
9406                                 continue
9407                         fi
9408                         ;;
9409                 esac
9410                 case "$CPPFLAGS" in
9411                 (*$cf_add_cflags)
9412                         ;;
9413                 (*)
9414                         case $cf_add_cflags in
9415                         (-D*)
9416                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9417
9418 CPPFLAGS=`echo "$CPPFLAGS" | \
9419         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9420                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9421
9422                                 ;;
9423                         esac
9424
9425         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9426         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9427
9428                         ;;
9429                 esac
9430                 ;;
9431         (*)
9432
9433         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9434         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9435
9436                 ;;
9437         esac
9438         ;;
9439 (yes)
9440
9441         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9442         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9443
9444         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9445
9446         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9447                 && test -z "${cf_tst_cflags}" \
9448                 && cf_fix_cppflags=no
9449         ;;
9450 esac
9451 done
9452
9453 if test -n "$cf_new_cflags" ; then
9454
9455         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9456         CFLAGS="${CFLAGS}$cf_new_cflags"
9457
9458 fi
9459
9460 if test -n "$cf_new_cppflags" ; then
9461
9462         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9463         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9464
9465 fi
9466
9467 if test -n "$cf_new_extra_cppflags" ; then
9468
9469         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9470         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9471
9472 fi
9473
9474 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9475 # Filter out duplicates - this happens with badly-designed ".pc" files...
9476 for cf_add_1lib in $LIBS
9477 do
9478         for cf_add_2lib in $cf_add_libs
9479         do
9480                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9481                 then
9482                         cf_add_1lib=
9483                         break
9484                 fi
9485         done
9486         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9487 done
9488 LIBS="$cf_add_libs"
9489
9490                 cat >conftest.$ac_ext <<_ACEOF
9491 #line 9491 "configure"
9492 #include "confdefs.h"
9493 #include <${cf_cv_ncurses_header:-curses.h}>
9494 int
9495 main (void)
9496 {
9497 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9498   ;
9499   return 0;
9500 }
9501 _ACEOF
9502 rm -f conftest.$ac_objext conftest$ac_exeext
9503 if { (eval echo "$as_me:9503: \"$ac_link\"") >&5
9504   (eval $ac_link) 2>&5
9505   ac_status=$?
9506   echo "$as_me:9506: \$? = $ac_status" >&5
9507   (exit $ac_status); } &&
9508          { ac_try='test -s conftest$ac_exeext'
9509   { (eval echo "$as_me:9509: \"$ac_try\"") >&5
9510   (eval $ac_try) 2>&5
9511   ac_status=$?
9512   echo "$as_me:9512: \$? = $ac_status" >&5
9513   (exit $ac_status); }; }; then
9514   if test "$cross_compiling" = yes; then
9515   cf_have_ncuconfig=maybe
9516 else
9517   cat >conftest.$ac_ext <<_ACEOF
9518 #line 9518 "configure"
9519 #include "confdefs.h"
9520 #include <${cf_cv_ncurses_header:-curses.h}>
9521                                 int main(void)
9522                                 { char *xx = curses_version(); return (xx == 0); }
9523 _ACEOF
9524 rm -f conftest$ac_exeext
9525 if { (eval echo "$as_me:9525: \"$ac_link\"") >&5
9526   (eval $ac_link) 2>&5
9527   ac_status=$?
9528   echo "$as_me:9528: \$? = $ac_status" >&5
9529   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9530   { (eval echo "$as_me:9530: \"$ac_try\"") >&5
9531   (eval $ac_try) 2>&5
9532   ac_status=$?
9533   echo "$as_me:9533: \$? = $ac_status" >&5
9534   (exit $ac_status); }; }; then
9535   cf_have_ncuconfig=yes
9536 else
9537   echo "$as_me: program exited with status $ac_status" >&5
9538 echo "$as_me: failed program was:" >&5
9539 cat conftest.$ac_ext >&5
9540 cf_have_ncuconfig=no
9541 fi
9542 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9543 fi
9544 else
9545   echo "$as_me: failed program was:" >&5
9546 cat conftest.$ac_ext >&5
9547 cf_have_ncuconfig=no
9548 fi
9549 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9550                 echo "$as_me:9550: result: $cf_have_ncuconfig" >&5
9551 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9552                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9553                 if test "$cf_have_ncuconfig" != "yes"
9554                 then
9555                         CPPFLAGS="$cf_save_CPPFLAGS"
9556                         LIBS="$cf_save_LIBS"
9557                         NCURSES_CONFIG_PKG=none
9558                 else
9559
9560 cat >>confdefs.h <<\EOF
9561 #define NCURSES 1
9562 EOF
9563
9564                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9565
9566 echo "$as_me:9566: checking for terminfo header" >&5
9567 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9568 if test "${cf_cv_term_header+set}" = set; then
9569   echo $ECHO_N "(cached) $ECHO_C" >&6
9570 else
9571
9572 case ${cf_cv_ncurses_header} in
9573 (*/ncurses.h|*/ncursesw.h)
9574         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9575         ;;
9576 (*)
9577         cf_term_header=term.h
9578         ;;
9579 esac
9580
9581 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9582 do
9583 cat >conftest.$ac_ext <<_ACEOF
9584 #line 9584 "configure"
9585 #include "confdefs.h"
9586 #include <stdio.h>
9587 #include <${cf_cv_ncurses_header:-curses.h}>
9588 #include <$cf_test>
9589
9590 int
9591 main (void)
9592 {
9593 int x = auto_left_margin
9594   ;
9595   return 0;
9596 }
9597 _ACEOF
9598 rm -f conftest.$ac_objext
9599 if { (eval echo "$as_me:9599: \"$ac_compile\"") >&5
9600   (eval $ac_compile) 2>&5
9601   ac_status=$?
9602   echo "$as_me:9602: \$? = $ac_status" >&5
9603   (exit $ac_status); } &&
9604          { ac_try='test -s conftest.$ac_objext'
9605   { (eval echo "$as_me:9605: \"$ac_try\"") >&5
9606   (eval $ac_try) 2>&5
9607   ac_status=$?
9608   echo "$as_me:9608: \$? = $ac_status" >&5
9609   (exit $ac_status); }; }; then
9610
9611         cf_cv_term_header="$cf_test"
9612 else
9613   echo "$as_me: failed program was:" >&5
9614 cat conftest.$ac_ext >&5
9615
9616         cf_cv_term_header=unknown
9617
9618 fi
9619 rm -f conftest.$ac_objext conftest.$ac_ext
9620         test "$cf_cv_term_header" != unknown && break
9621 done
9622
9623 fi
9624 echo "$as_me:9624: result: $cf_cv_term_header" >&5
9625 echo "${ECHO_T}$cf_cv_term_header" >&6
9626
9627 # Set definitions to allow ifdef'ing to accommodate subdirectories
9628
9629 case $cf_cv_term_header in
9630 (*term.h)
9631
9632 cat >>confdefs.h <<\EOF
9633 #define HAVE_TERM_H 1
9634 EOF
9635
9636         ;;
9637 esac
9638
9639 case $cf_cv_term_header in
9640 (ncurses/term.h)
9641
9642 cat >>confdefs.h <<\EOF
9643 #define HAVE_NCURSES_TERM_H 1
9644 EOF
9645
9646         ;;
9647 (ncursesw/term.h)
9648
9649 cat >>confdefs.h <<\EOF
9650 #define HAVE_NCURSESW_TERM_H 1
9651 EOF
9652
9653         ;;
9654 esac
9655
9656                 fi
9657
9658         else
9659                 echo "$as_me:9659: result: no" >&5
9660 echo "${ECHO_T}no" >&6
9661                 NCURSES_CONFIG_PKG=none
9662         fi
9663 else
9664         NCURSES_CONFIG_PKG=none
9665 fi
9666
9667 if test "x$cf_have_ncuconfig" = "xno"; then
9668         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9669
9670 if test -n "$ac_tool_prefix"; then
9671   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9672   do
9673     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9674 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9675 echo "$as_me:9675: checking for $ac_word" >&5
9676 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9677 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9678   echo $ECHO_N "(cached) $ECHO_C" >&6
9679 else
9680   if test -n "$NCURSES_CONFIG"; then
9681   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9682 else
9683   ac_save_IFS=$IFS; IFS=$ac_path_separator
9684 ac_dummy="$PATH"
9685 for ac_dir in $ac_dummy; do
9686   IFS=$ac_save_IFS
9687   test -z "$ac_dir" && ac_dir=.
9688   $as_executable_p "$ac_dir/$ac_word" || continue
9689 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9690 echo "$as_me:9690: found $ac_dir/$ac_word" >&5
9691 break
9692 done
9693
9694 fi
9695 fi
9696 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9697 if test -n "$NCURSES_CONFIG"; then
9698   echo "$as_me:9698: result: $NCURSES_CONFIG" >&5
9699 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9700 else
9701   echo "$as_me:9701: result: no" >&5
9702 echo "${ECHO_T}no" >&6
9703 fi
9704
9705     test -n "$NCURSES_CONFIG" && break
9706   done
9707 fi
9708 if test -z "$NCURSES_CONFIG"; then
9709   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9710   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9711 do
9712   # Extract the first word of "$ac_prog", so it can be a program name with args.
9713 set dummy $ac_prog; ac_word=$2
9714 echo "$as_me:9714: checking for $ac_word" >&5
9715 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9716 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9717   echo $ECHO_N "(cached) $ECHO_C" >&6
9718 else
9719   if test -n "$ac_ct_NCURSES_CONFIG"; then
9720   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9721 else
9722   ac_save_IFS=$IFS; IFS=$ac_path_separator
9723 ac_dummy="$PATH"
9724 for ac_dir in $ac_dummy; do
9725   IFS=$ac_save_IFS
9726   test -z "$ac_dir" && ac_dir=.
9727   $as_executable_p "$ac_dir/$ac_word" || continue
9728 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9729 echo "$as_me:9729: found $ac_dir/$ac_word" >&5
9730 break
9731 done
9732
9733 fi
9734 fi
9735 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9736 if test -n "$ac_ct_NCURSES_CONFIG"; then
9737   echo "$as_me:9737: result: $ac_ct_NCURSES_CONFIG" >&5
9738 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9739 else
9740   echo "$as_me:9740: result: no" >&5
9741 echo "${ECHO_T}no" >&6
9742 fi
9743
9744   test -n "$ac_ct_NCURSES_CONFIG" && break
9745 done
9746 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9747
9748   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9749 fi
9750
9751         if test "$NCURSES_CONFIG" != none ; then
9752
9753 cf_fix_cppflags=no
9754 cf_new_cflags=
9755 cf_new_cppflags=
9756 cf_new_extra_cppflags=
9757
9758 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9759 do
9760 case $cf_fix_cppflags in
9761 (no)
9762         case $cf_add_cflags in
9763         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9764                 case $cf_add_cflags in
9765                 (-D*)
9766                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9767
9768                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9769                                 && test -z "${cf_tst_cflags}" \
9770                                 && cf_fix_cppflags=yes
9771
9772                         if test $cf_fix_cppflags = yes ; then
9773
9774         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9775         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9776
9777                                 continue
9778                         elif test "${cf_tst_cflags}" = "\"'" ; then
9779
9780         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9781         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9782
9783                                 continue
9784                         fi
9785                         ;;
9786                 esac
9787                 case "$CPPFLAGS" in
9788                 (*$cf_add_cflags)
9789                         ;;
9790                 (*)
9791                         case $cf_add_cflags in
9792                         (-D*)
9793                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9794
9795 CPPFLAGS=`echo "$CPPFLAGS" | \
9796         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9797                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9798
9799                                 ;;
9800                         esac
9801
9802         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9803         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9804
9805                         ;;
9806                 esac
9807                 ;;
9808         (*)
9809
9810         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9811         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9812
9813                 ;;
9814         esac
9815         ;;
9816 (yes)
9817
9818         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9819         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9820
9821         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9822
9823         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9824                 && test -z "${cf_tst_cflags}" \
9825                 && cf_fix_cppflags=no
9826         ;;
9827 esac
9828 done
9829
9830 if test -n "$cf_new_cflags" ; then
9831
9832         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9833         CFLAGS="${CFLAGS}$cf_new_cflags"
9834
9835 fi
9836
9837 if test -n "$cf_new_cppflags" ; then
9838
9839         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9840         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9841
9842 fi
9843
9844 if test -n "$cf_new_extra_cppflags" ; then
9845
9846         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9847         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9848
9849 fi
9850
9851 cf_add_libs="`$NCURSES_CONFIG --libs`"
9852 # Filter out duplicates - this happens with badly-designed ".pc" files...
9853 for cf_add_1lib in $LIBS
9854 do
9855         for cf_add_2lib in $cf_add_libs
9856         do
9857                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9858                 then
9859                         cf_add_1lib=
9860                         break
9861                 fi
9862         done
9863         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9864 done
9865 LIBS="$cf_add_libs"
9866
9867                 # even with config script, some packages use no-override for curses.h
9868
9869 echo "$as_me:9869: checking if we have identified curses headers" >&5
9870 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9871 if test "${cf_cv_ncurses_header+set}" = set; then
9872   echo $ECHO_N "(cached) $ECHO_C" >&6
9873 else
9874
9875 cf_cv_ncurses_header=none
9876 for cf_header in \
9877         ncurses.h $cf_cv_screen/ncurses.h \
9878         curses.h $cf_cv_screen/curses.h
9879 do
9880 cat >conftest.$ac_ext <<_ACEOF
9881 #line 9881 "configure"
9882 #include "confdefs.h"
9883 #include <${cf_header}>
9884 int
9885 main (void)
9886 {
9887 initscr(); tgoto("?", 0,0)
9888   ;
9889   return 0;
9890 }
9891 _ACEOF
9892 rm -f conftest.$ac_objext
9893 if { (eval echo "$as_me:9893: \"$ac_compile\"") >&5
9894   (eval $ac_compile) 2>&5
9895   ac_status=$?
9896   echo "$as_me:9896: \$? = $ac_status" >&5
9897   (exit $ac_status); } &&
9898          { ac_try='test -s conftest.$ac_objext'
9899   { (eval echo "$as_me:9899: \"$ac_try\"") >&5
9900   (eval $ac_try) 2>&5
9901   ac_status=$?
9902   echo "$as_me:9902: \$? = $ac_status" >&5
9903   (exit $ac_status); }; }; then
9904   cf_cv_ncurses_header=$cf_header; break
9905 else
9906   echo "$as_me: failed program was:" >&5
9907 cat conftest.$ac_ext >&5
9908 fi
9909 rm -f conftest.$ac_objext conftest.$ac_ext
9910 done
9911
9912 fi
9913 echo "$as_me:9913: result: $cf_cv_ncurses_header" >&5
9914 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9915
9916 if test "$cf_cv_ncurses_header" = none ; then
9917         { { echo "$as_me:9917: error: No curses header-files found" >&5
9918 echo "$as_me: error: No curses header-files found" >&2;}
9919    { (exit 1); exit 1; }; }
9920 fi
9921
9922 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9923
9924 for ac_header in $cf_cv_ncurses_header
9925 do
9926 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9927 echo "$as_me:9927: checking for $ac_header" >&5
9928 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9929 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9930   echo $ECHO_N "(cached) $ECHO_C" >&6
9931 else
9932   cat >conftest.$ac_ext <<_ACEOF
9933 #line 9933 "configure"
9934 #include "confdefs.h"
9935 #include <$ac_header>
9936 _ACEOF
9937 if { (eval echo "$as_me:9937: \"$ac_cpp conftest.$ac_ext\"") >&5
9938   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9939   ac_status=$?
9940   egrep -v '^ *\+' conftest.er1 >conftest.err
9941   rm -f conftest.er1
9942   cat conftest.err >&5
9943   echo "$as_me:9943: \$? = $ac_status" >&5
9944   (exit $ac_status); } >/dev/null; then
9945   if test -s conftest.err; then
9946     ac_cpp_err=$ac_c_preproc_warn_flag
9947   else
9948     ac_cpp_err=
9949   fi
9950 else
9951   ac_cpp_err=yes
9952 fi
9953 if test -z "$ac_cpp_err"; then
9954   eval "$as_ac_Header=yes"
9955 else
9956   echo "$as_me: failed program was:" >&5
9957   cat conftest.$ac_ext >&5
9958   eval "$as_ac_Header=no"
9959 fi
9960 rm -f conftest.err conftest.$ac_ext
9961 fi
9962 echo "$as_me:9962: result: `eval echo '${'$as_ac_Header'}'`" >&5
9963 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9964 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9965   cat >>confdefs.h <<EOF
9966 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9967 EOF
9968
9969 fi
9970 done
9971
9972 cat >>confdefs.h <<\EOF
9973 #define NCURSES 1
9974 EOF
9975
9976 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9977
9978                 cat >>confdefs.h <<EOF
9979 #define $cf_nculib_ROOT 1
9980 EOF
9981
9982                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9983
9984         else
9985
9986 cf_ncuhdr_root=$cf_cv_screen
9987
9988 test -n "$cf_cv_curses_dir" && \
9989 test "$cf_cv_curses_dir" != "no" && { \
9990
9991 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9992   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9993   do
9994         while test $cf_add_incdir != /usr/include
9995         do
9996           if test -d $cf_add_incdir
9997           then
9998                 cf_have_incdir=no
9999                 if test -n "$CFLAGS$CPPFLAGS" ; then
10000                   # a loop is needed to ensure we can add subdirs of existing dirs
10001                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10002                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10003                           cf_have_incdir=yes; break
10004                         fi
10005                   done
10006                 fi
10007
10008                 if test "$cf_have_incdir" = no ; then
10009                   if test "$cf_add_incdir" = /usr/local/include ; then
10010                         if test "$GCC" = yes
10011                         then
10012                           cf_save_CPPFLAGS=$CPPFLAGS
10013
10014         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10015         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10016
10017                           cat >conftest.$ac_ext <<_ACEOF
10018 #line 10018 "configure"
10019 #include "confdefs.h"
10020 #include <stdio.h>
10021 int
10022 main (void)
10023 {
10024 printf("Hello")
10025   ;
10026   return 0;
10027 }
10028 _ACEOF
10029 rm -f conftest.$ac_objext
10030 if { (eval echo "$as_me:10030: \"$ac_compile\"") >&5
10031   (eval $ac_compile) 2>&5
10032   ac_status=$?
10033   echo "$as_me:10033: \$? = $ac_status" >&5
10034   (exit $ac_status); } &&
10035          { ac_try='test -s conftest.$ac_objext'
10036   { (eval echo "$as_me:10036: \"$ac_try\"") >&5
10037   (eval $ac_try) 2>&5
10038   ac_status=$?
10039   echo "$as_me:10039: \$? = $ac_status" >&5
10040   (exit $ac_status); }; }; then
10041   :
10042 else
10043   echo "$as_me: failed program was:" >&5
10044 cat conftest.$ac_ext >&5
10045 cf_have_incdir=yes
10046 fi
10047 rm -f conftest.$ac_objext conftest.$ac_ext
10048                           CPPFLAGS=$cf_save_CPPFLAGS
10049                         fi
10050                   fi
10051                 fi
10052
10053                 if test "$cf_have_incdir" = no ; then
10054                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10055
10056 echo "${as_me:-configure}:10056: testing adding $cf_add_incdir to include-path ..." 1>&5
10057
10058                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10059
10060                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10061                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10062                   cf_add_incdir="$cf_top_incdir"
10063                 else
10064                   break
10065                 fi
10066           else
10067                 break
10068           fi
10069         done
10070   done
10071 fi
10072
10073 }
10074
10075 echo "$as_me:10075: checking for $cf_ncuhdr_root header in include-path" >&5
10076 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10077 if test "${cf_cv_ncurses_h+set}" = set; then
10078   echo $ECHO_N "(cached) $ECHO_C" >&6
10079 else
10080
10081         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10082         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
10083         for cf_header in $cf_header_list
10084         do
10085
10086         cat >conftest.$ac_ext <<_ACEOF
10087 #line 10087 "configure"
10088 #include "confdefs.h"
10089
10090 #include <$cf_header>
10091 int
10092 main (void)
10093 {
10094
10095 #ifdef NCURSES_VERSION
10096
10097 printf("%s\n", NCURSES_VERSION);
10098 #else
10099 #ifdef __NCURSES_H
10100 printf("old\n");
10101 #else
10102         make an error
10103 #endif
10104 #endif
10105
10106   ;
10107   return 0;
10108 }
10109 _ACEOF
10110 rm -f conftest.$ac_objext
10111 if { (eval echo "$as_me:10111: \"$ac_compile\"") >&5
10112   (eval $ac_compile) 2>&5
10113   ac_status=$?
10114   echo "$as_me:10114: \$? = $ac_status" >&5
10115   (exit $ac_status); } &&
10116          { ac_try='test -s conftest.$ac_objext'
10117   { (eval echo "$as_me:10117: \"$ac_try\"") >&5
10118   (eval $ac_try) 2>&5
10119   ac_status=$?
10120   echo "$as_me:10120: \$? = $ac_status" >&5
10121   (exit $ac_status); }; }; then
10122   cf_cv_ncurses_h=$cf_header
10123
10124 else
10125   echo "$as_me: failed program was:" >&5
10126 cat conftest.$ac_ext >&5
10127 cf_cv_ncurses_h=no
10128 fi
10129 rm -f conftest.$ac_objext conftest.$ac_ext
10130
10131                 test "$cf_cv_ncurses_h" != no && break
10132         done
10133
10134 fi
10135 echo "$as_me:10135: result: $cf_cv_ncurses_h" >&5
10136 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10137
10138 if test "$cf_cv_ncurses_h" != no ; then
10139         cf_cv_ncurses_header=$cf_cv_ncurses_h
10140 else
10141
10142 echo "$as_me:10142: checking for $cf_ncuhdr_root include-path" >&5
10143 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10144 if test "${cf_cv_ncurses_h2+set}" = set; then
10145   echo $ECHO_N "(cached) $ECHO_C" >&6
10146 else
10147
10148         test -n "$verbose" && echo
10149
10150 cf_search=
10151
10152 # collect the current set of include-directories from compiler flags
10153 cf_header_path_list=""
10154 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10155         for cf_header_path in $CPPFLAGS $CFLAGS
10156         do
10157                 case $cf_header_path in
10158                 (-I*)
10159                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10160
10161 test "x$cf_header_path" != "xNONE" && \
10162 test -d "$cf_header_path" && \
10163  {
10164         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10165         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10166         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10167         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10168         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10169         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"
10170 }
10171
10172                         cf_header_path_list="$cf_header_path_list $cf_search"
10173                         ;;
10174                 esac
10175         done
10176 fi
10177
10178 # add the variations for the package we are looking for
10179
10180 cf_search=
10181
10182 test "x$prefix" != "xNONE" && \
10183 test -d "$prefix" && \
10184  {
10185         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10186         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10187         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10188         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10189         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10190         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10191 }
10192
10193 for cf_subdir_prefix in \
10194         /usr \
10195         /usr/local \
10196         /usr/pkg \
10197         /opt \
10198         /opt/local \
10199         $HOME
10200 do
10201
10202 test "x$cf_subdir_prefix" != "x$prefix" && \
10203 test -d "$cf_subdir_prefix" && \
10204 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10205         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10206         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10207         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10208         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10209         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10210         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"
10211 }
10212
10213 done
10214
10215 test "$includedir" != NONE && \
10216 test "$includedir" != "/usr/include" && \
10217 test -d "$includedir" && {
10218         test -d $includedir &&    cf_search="$cf_search $includedir"
10219         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10220 }
10221
10222 test "$oldincludedir" != NONE && \
10223 test "$oldincludedir" != "/usr/include" && \
10224 test -d "$oldincludedir" && {
10225         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10226         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10227 }
10228
10229 cf_search="$cf_search $cf_header_path_list"
10230
10231         test -n "$verbose" && echo search path $cf_search
10232         cf_save2_CPPFLAGS="$CPPFLAGS"
10233         for cf_incdir in $cf_search
10234         do
10235
10236 if test -n "$cf_incdir" ; then
10237   for cf_add_incdir in $cf_incdir
10238   do
10239         while test $cf_add_incdir != /usr/include
10240         do
10241           if test -d $cf_add_incdir
10242           then
10243                 cf_have_incdir=no
10244                 if test -n "$CFLAGS$CPPFLAGS" ; then
10245                   # a loop is needed to ensure we can add subdirs of existing dirs
10246                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10247                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10248                           cf_have_incdir=yes; break
10249                         fi
10250                   done
10251                 fi
10252
10253                 if test "$cf_have_incdir" = no ; then
10254                   if test "$cf_add_incdir" = /usr/local/include ; then
10255                         if test "$GCC" = yes
10256                         then
10257                           cf_save_CPPFLAGS=$CPPFLAGS
10258
10259         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10260         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10261
10262                           cat >conftest.$ac_ext <<_ACEOF
10263 #line 10263 "configure"
10264 #include "confdefs.h"
10265 #include <stdio.h>
10266 int
10267 main (void)
10268 {
10269 printf("Hello")
10270   ;
10271   return 0;
10272 }
10273 _ACEOF
10274 rm -f conftest.$ac_objext
10275 if { (eval echo "$as_me:10275: \"$ac_compile\"") >&5
10276   (eval $ac_compile) 2>&5
10277   ac_status=$?
10278   echo "$as_me:10278: \$? = $ac_status" >&5
10279   (exit $ac_status); } &&
10280          { ac_try='test -s conftest.$ac_objext'
10281   { (eval echo "$as_me:10281: \"$ac_try\"") >&5
10282   (eval $ac_try) 2>&5
10283   ac_status=$?
10284   echo "$as_me:10284: \$? = $ac_status" >&5
10285   (exit $ac_status); }; }; then
10286   :
10287 else
10288   echo "$as_me: failed program was:" >&5
10289 cat conftest.$ac_ext >&5
10290 cf_have_incdir=yes
10291 fi
10292 rm -f conftest.$ac_objext conftest.$ac_ext
10293                           CPPFLAGS=$cf_save_CPPFLAGS
10294                         fi
10295                   fi
10296                 fi
10297
10298                 if test "$cf_have_incdir" = no ; then
10299                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10300
10301 echo "${as_me:-configure}:10301: testing adding $cf_add_incdir to include-path ..." 1>&5
10302
10303                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10304
10305                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10306                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10307                   cf_add_incdir="$cf_top_incdir"
10308                 else
10309                   break
10310                 fi
10311           else
10312                 break
10313           fi
10314         done
10315   done
10316 fi
10317
10318                 for cf_header in \
10319                         ncurses.h \
10320                         curses.h
10321                 do
10322
10323         cat >conftest.$ac_ext <<_ACEOF
10324 #line 10324 "configure"
10325 #include "confdefs.h"
10326
10327 #include <$cf_header>
10328 int
10329 main (void)
10330 {
10331
10332 #ifdef NCURSES_VERSION
10333
10334 printf("%s\n", NCURSES_VERSION);
10335 #else
10336 #ifdef __NCURSES_H
10337 printf("old\n");
10338 #else
10339         make an error
10340 #endif
10341 #endif
10342
10343   ;
10344   return 0;
10345 }
10346 _ACEOF
10347 rm -f conftest.$ac_objext
10348 if { (eval echo "$as_me:10348: \"$ac_compile\"") >&5
10349   (eval $ac_compile) 2>&5
10350   ac_status=$?
10351   echo "$as_me:10351: \$? = $ac_status" >&5
10352   (exit $ac_status); } &&
10353          { ac_try='test -s conftest.$ac_objext'
10354   { (eval echo "$as_me:10354: \"$ac_try\"") >&5
10355   (eval $ac_try) 2>&5
10356   ac_status=$?
10357   echo "$as_me:10357: \$? = $ac_status" >&5
10358   (exit $ac_status); }; }; then
10359   cf_cv_ncurses_h2=$cf_header
10360
10361 else
10362   echo "$as_me: failed program was:" >&5
10363 cat conftest.$ac_ext >&5
10364 cf_cv_ncurses_h2=no
10365 fi
10366 rm -f conftest.$ac_objext conftest.$ac_ext
10367
10368                         if test "$cf_cv_ncurses_h2" != no ; then
10369                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10370                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10371                                 break
10372                         fi
10373                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10374                 done
10375                 CPPFLAGS="$cf_save2_CPPFLAGS"
10376                 test "$cf_cv_ncurses_h2" != no && break
10377         done
10378         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10378: error: not found" >&5
10379 echo "$as_me: error: not found" >&2;}
10380    { (exit 1); exit 1; }; }
10381
10382 fi
10383 echo "$as_me:10383: result: $cf_cv_ncurses_h2" >&5
10384 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10385
10386         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10387         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10388         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10389                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10390         fi
10391
10392 if test -n "$cf_1st_incdir" ; then
10393   for cf_add_incdir in $cf_1st_incdir
10394   do
10395         while test $cf_add_incdir != /usr/include
10396         do
10397           if test -d $cf_add_incdir
10398           then
10399                 cf_have_incdir=no
10400                 if test -n "$CFLAGS$CPPFLAGS" ; then
10401                   # a loop is needed to ensure we can add subdirs of existing dirs
10402                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10403                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10404                           cf_have_incdir=yes; break
10405                         fi
10406                   done
10407                 fi
10408
10409                 if test "$cf_have_incdir" = no ; then
10410                   if test "$cf_add_incdir" = /usr/local/include ; then
10411                         if test "$GCC" = yes
10412                         then
10413                           cf_save_CPPFLAGS=$CPPFLAGS
10414
10415         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10416         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10417
10418                           cat >conftest.$ac_ext <<_ACEOF
10419 #line 10419 "configure"
10420 #include "confdefs.h"
10421 #include <stdio.h>
10422 int
10423 main (void)
10424 {
10425 printf("Hello")
10426   ;
10427   return 0;
10428 }
10429 _ACEOF
10430 rm -f conftest.$ac_objext
10431 if { (eval echo "$as_me:10431: \"$ac_compile\"") >&5
10432   (eval $ac_compile) 2>&5
10433   ac_status=$?
10434   echo "$as_me:10434: \$? = $ac_status" >&5
10435   (exit $ac_status); } &&
10436          { ac_try='test -s conftest.$ac_objext'
10437   { (eval echo "$as_me:10437: \"$ac_try\"") >&5
10438   (eval $ac_try) 2>&5
10439   ac_status=$?
10440   echo "$as_me:10440: \$? = $ac_status" >&5
10441   (exit $ac_status); }; }; then
10442   :
10443 else
10444   echo "$as_me: failed program was:" >&5
10445 cat conftest.$ac_ext >&5
10446 cf_have_incdir=yes
10447 fi
10448 rm -f conftest.$ac_objext conftest.$ac_ext
10449                           CPPFLAGS=$cf_save_CPPFLAGS
10450                         fi
10451                   fi
10452                 fi
10453
10454                 if test "$cf_have_incdir" = no ; then
10455                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10456
10457 echo "${as_me:-configure}:10457: testing adding $cf_add_incdir to include-path ..." 1>&5
10458
10459                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10460
10461                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10462                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10463                   cf_add_incdir="$cf_top_incdir"
10464                 else
10465                   break
10466                 fi
10467           else
10468                 break
10469           fi
10470         done
10471   done
10472 fi
10473
10474 fi
10475
10476 # Set definitions to allow ifdef'ing for ncurses.h
10477
10478 case $cf_cv_ncurses_header in
10479 (*ncurses.h)
10480
10481 cat >>confdefs.h <<\EOF
10482 #define HAVE_NCURSES_H 1
10483 EOF
10484
10485         ;;
10486 esac
10487
10488 case $cf_cv_ncurses_header in
10489 (ncurses/curses.h|ncurses/ncurses.h)
10490
10491 cat >>confdefs.h <<\EOF
10492 #define HAVE_NCURSES_NCURSES_H 1
10493 EOF
10494
10495         ;;
10496 (ncursesw/curses.h|ncursesw/ncurses.h)
10497
10498 cat >>confdefs.h <<\EOF
10499 #define HAVE_NCURSESW_NCURSES_H 1
10500 EOF
10501
10502         ;;
10503 esac
10504
10505 echo "$as_me:10505: checking for terminfo header" >&5
10506 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10507 if test "${cf_cv_term_header+set}" = set; then
10508   echo $ECHO_N "(cached) $ECHO_C" >&6
10509 else
10510
10511 case ${cf_cv_ncurses_header} in
10512 (*/ncurses.h|*/ncursesw.h)
10513         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10514         ;;
10515 (*)
10516         cf_term_header=term.h
10517         ;;
10518 esac
10519
10520 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10521 do
10522 cat >conftest.$ac_ext <<_ACEOF
10523 #line 10523 "configure"
10524 #include "confdefs.h"
10525 #include <stdio.h>
10526 #include <${cf_cv_ncurses_header:-curses.h}>
10527 #include <$cf_test>
10528
10529 int
10530 main (void)
10531 {
10532 int x = auto_left_margin
10533   ;
10534   return 0;
10535 }
10536 _ACEOF
10537 rm -f conftest.$ac_objext
10538 if { (eval echo "$as_me:10538: \"$ac_compile\"") >&5
10539   (eval $ac_compile) 2>&5
10540   ac_status=$?
10541   echo "$as_me:10541: \$? = $ac_status" >&5
10542   (exit $ac_status); } &&
10543          { ac_try='test -s conftest.$ac_objext'
10544   { (eval echo "$as_me:10544: \"$ac_try\"") >&5
10545   (eval $ac_try) 2>&5
10546   ac_status=$?
10547   echo "$as_me:10547: \$? = $ac_status" >&5
10548   (exit $ac_status); }; }; then
10549
10550         cf_cv_term_header="$cf_test"
10551 else
10552   echo "$as_me: failed program was:" >&5
10553 cat conftest.$ac_ext >&5
10554
10555         cf_cv_term_header=unknown
10556
10557 fi
10558 rm -f conftest.$ac_objext conftest.$ac_ext
10559         test "$cf_cv_term_header" != unknown && break
10560 done
10561
10562 fi
10563 echo "$as_me:10563: result: $cf_cv_term_header" >&5
10564 echo "${ECHO_T}$cf_cv_term_header" >&6
10565
10566 # Set definitions to allow ifdef'ing to accommodate subdirectories
10567
10568 case $cf_cv_term_header in
10569 (*term.h)
10570
10571 cat >>confdefs.h <<\EOF
10572 #define HAVE_TERM_H 1
10573 EOF
10574
10575         ;;
10576 esac
10577
10578 case $cf_cv_term_header in
10579 (ncurses/term.h)
10580
10581 cat >>confdefs.h <<\EOF
10582 #define HAVE_NCURSES_TERM_H 1
10583 EOF
10584
10585         ;;
10586 (ncursesw/term.h)
10587
10588 cat >>confdefs.h <<\EOF
10589 #define HAVE_NCURSESW_TERM_H 1
10590 EOF
10591
10592         ;;
10593 esac
10594
10595 # some applications need this, but should check for NCURSES_VERSION
10596
10597 cat >>confdefs.h <<\EOF
10598 #define NCURSES 1
10599 EOF
10600
10601 echo "$as_me:10601: checking for ncurses version" >&5
10602 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10603 if test "${cf_cv_ncurses_version+set}" = set; then
10604   echo $ECHO_N "(cached) $ECHO_C" >&6
10605 else
10606
10607         cf_cv_ncurses_version=no
10608         cf_tempfile=out$$
10609         rm -f $cf_tempfile
10610         if test "$cross_compiling" = yes; then
10611
10612         # This will not work if the preprocessor splits the line after the
10613         # Autoconf token.  The 'unproto' program does that.
10614         cat > conftest.$ac_ext <<EOF
10615 #include <${cf_cv_ncurses_header:-curses.h}>
10616 #undef Autoconf
10617 #ifdef NCURSES_VERSION
10618 Autoconf NCURSES_VERSION
10619 #else
10620 #ifdef __NCURSES_H
10621 Autoconf "old"
10622 #endif
10623 ;
10624 #endif
10625 EOF
10626         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10627         { (eval echo "$as_me:10627: \"$cf_try\"") >&5
10628   (eval $cf_try) 2>&5
10629   ac_status=$?
10630   echo "$as_me:10630: \$? = $ac_status" >&5
10631   (exit $ac_status); }
10632         if test -f conftest.out ; then
10633                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10634                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10635                 rm -f conftest.out
10636         fi
10637
10638 else
10639   cat >conftest.$ac_ext <<_ACEOF
10640 #line 10640 "configure"
10641 #include "confdefs.h"
10642
10643 #include <${cf_cv_ncurses_header:-curses.h}>
10644 #include <stdio.h>
10645 int main(void)
10646 {
10647         FILE *fp = fopen("$cf_tempfile", "w");
10648 #ifdef NCURSES_VERSION
10649 # ifdef NCURSES_VERSION_PATCH
10650         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10651 # else
10652         fprintf(fp, "%s\n", NCURSES_VERSION);
10653 # endif
10654 #else
10655 # ifdef __NCURSES_H
10656         fprintf(fp, "old\n");
10657 # else
10658         make an error
10659 # endif
10660 #endif
10661         ${cf_cv_main_return:-return}(0);
10662 }
10663 _ACEOF
10664 rm -f conftest$ac_exeext
10665 if { (eval echo "$as_me:10665: \"$ac_link\"") >&5
10666   (eval $ac_link) 2>&5
10667   ac_status=$?
10668   echo "$as_me:10668: \$? = $ac_status" >&5
10669   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10670   { (eval echo "$as_me:10670: \"$ac_try\"") >&5
10671   (eval $ac_try) 2>&5
10672   ac_status=$?
10673   echo "$as_me:10673: \$? = $ac_status" >&5
10674   (exit $ac_status); }; }; then
10675
10676         cf_cv_ncurses_version=`cat $cf_tempfile`
10677 else
10678   echo "$as_me: program exited with status $ac_status" >&5
10679 echo "$as_me: failed program was:" >&5
10680 cat conftest.$ac_ext >&5
10681 fi
10682 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10683 fi
10684         rm -f $cf_tempfile
10685
10686 fi
10687 echo "$as_me:10687: result: $cf_cv_ncurses_version" >&5
10688 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10689 test "$cf_cv_ncurses_version" = no ||
10690 cat >>confdefs.h <<\EOF
10691 #define NCURSES 1
10692 EOF
10693
10694 cf_nculib_root=$cf_cv_screen
10695         # This works, except for the special case where we find gpm, but
10696         # ncurses is in a nonstandard location via $LIBS, and we really want
10697         # to link gpm.
10698 cf_ncurses_LIBS=""
10699 cf_ncurses_SAVE="$LIBS"
10700 echo "$as_me:10700: checking for Gpm_Open in -lgpm" >&5
10701 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10702 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10703   echo $ECHO_N "(cached) $ECHO_C" >&6
10704 else
10705   ac_check_lib_save_LIBS=$LIBS
10706 LIBS="-lgpm  $LIBS"
10707 cat >conftest.$ac_ext <<_ACEOF
10708 #line 10708 "configure"
10709 #include "confdefs.h"
10710
10711 /* Override any gcc2 internal prototype to avoid an error.  */
10712 #ifdef __cplusplus
10713 extern "C"
10714 #endif
10715 /* We use char because int might match the return type of a gcc2
10716    builtin and then its argument prototype would still apply.  */
10717 char Gpm_Open ();
10718 int
10719 main (void)
10720 {
10721 Gpm_Open ();
10722   ;
10723   return 0;
10724 }
10725 _ACEOF
10726 rm -f conftest.$ac_objext conftest$ac_exeext
10727 if { (eval echo "$as_me:10727: \"$ac_link\"") >&5
10728   (eval $ac_link) 2>&5
10729   ac_status=$?
10730   echo "$as_me:10730: \$? = $ac_status" >&5
10731   (exit $ac_status); } &&
10732          { ac_try='test -s conftest$ac_exeext'
10733   { (eval echo "$as_me:10733: \"$ac_try\"") >&5
10734   (eval $ac_try) 2>&5
10735   ac_status=$?
10736   echo "$as_me:10736: \$? = $ac_status" >&5
10737   (exit $ac_status); }; }; then
10738   ac_cv_lib_gpm_Gpm_Open=yes
10739 else
10740   echo "$as_me: failed program was:" >&5
10741 cat conftest.$ac_ext >&5
10742 ac_cv_lib_gpm_Gpm_Open=no
10743 fi
10744 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10745 LIBS=$ac_check_lib_save_LIBS
10746 fi
10747 echo "$as_me:10747: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10748 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10749 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10750   echo "$as_me:10750: checking for initscr in -lgpm" >&5
10751 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10752 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10753   echo $ECHO_N "(cached) $ECHO_C" >&6
10754 else
10755   ac_check_lib_save_LIBS=$LIBS
10756 LIBS="-lgpm  $LIBS"
10757 cat >conftest.$ac_ext <<_ACEOF
10758 #line 10758 "configure"
10759 #include "confdefs.h"
10760
10761 /* Override any gcc2 internal prototype to avoid an error.  */
10762 #ifdef __cplusplus
10763 extern "C"
10764 #endif
10765 /* We use char because int might match the return type of a gcc2
10766    builtin and then its argument prototype would still apply.  */
10767 char initscr ();
10768 int
10769 main (void)
10770 {
10771 initscr ();
10772   ;
10773   return 0;
10774 }
10775 _ACEOF
10776 rm -f conftest.$ac_objext conftest$ac_exeext
10777 if { (eval echo "$as_me:10777: \"$ac_link\"") >&5
10778   (eval $ac_link) 2>&5
10779   ac_status=$?
10780   echo "$as_me:10780: \$? = $ac_status" >&5
10781   (exit $ac_status); } &&
10782          { ac_try='test -s conftest$ac_exeext'
10783   { (eval echo "$as_me:10783: \"$ac_try\"") >&5
10784   (eval $ac_try) 2>&5
10785   ac_status=$?
10786   echo "$as_me:10786: \$? = $ac_status" >&5
10787   (exit $ac_status); }; }; then
10788   ac_cv_lib_gpm_initscr=yes
10789 else
10790   echo "$as_me: failed program was:" >&5
10791 cat conftest.$ac_ext >&5
10792 ac_cv_lib_gpm_initscr=no
10793 fi
10794 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10795 LIBS=$ac_check_lib_save_LIBS
10796 fi
10797 echo "$as_me:10797: result: $ac_cv_lib_gpm_initscr" >&5
10798 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10799 if test $ac_cv_lib_gpm_initscr = yes; then
10800   LIBS="$cf_ncurses_SAVE"
10801 else
10802   cf_ncurses_LIBS="-lgpm"
10803 fi
10804
10805 fi
10806
10807 case $host_os in
10808 (freebsd*)
10809         # This is only necessary if you are linking against an obsolete
10810         # version of ncurses (but it should do no harm, since it's static).
10811         if test "$cf_nculib_root" = ncurses ; then
10812                 echo "$as_me:10812: checking for tgoto in -lmytinfo" >&5
10813 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10814 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10815   echo $ECHO_N "(cached) $ECHO_C" >&6
10816 else
10817   ac_check_lib_save_LIBS=$LIBS
10818 LIBS="-lmytinfo  $LIBS"
10819 cat >conftest.$ac_ext <<_ACEOF
10820 #line 10820 "configure"
10821 #include "confdefs.h"
10822
10823 /* Override any gcc2 internal prototype to avoid an error.  */
10824 #ifdef __cplusplus
10825 extern "C"
10826 #endif
10827 /* We use char because int might match the return type of a gcc2
10828    builtin and then its argument prototype would still apply.  */
10829 char tgoto ();
10830 int
10831 main (void)
10832 {
10833 tgoto ();
10834   ;
10835   return 0;
10836 }
10837 _ACEOF
10838 rm -f conftest.$ac_objext conftest$ac_exeext
10839 if { (eval echo "$as_me:10839: \"$ac_link\"") >&5
10840   (eval $ac_link) 2>&5
10841   ac_status=$?
10842   echo "$as_me:10842: \$? = $ac_status" >&5
10843   (exit $ac_status); } &&
10844          { ac_try='test -s conftest$ac_exeext'
10845   { (eval echo "$as_me:10845: \"$ac_try\"") >&5
10846   (eval $ac_try) 2>&5
10847   ac_status=$?
10848   echo "$as_me:10848: \$? = $ac_status" >&5
10849   (exit $ac_status); }; }; then
10850   ac_cv_lib_mytinfo_tgoto=yes
10851 else
10852   echo "$as_me: failed program was:" >&5
10853 cat conftest.$ac_ext >&5
10854 ac_cv_lib_mytinfo_tgoto=no
10855 fi
10856 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10857 LIBS=$ac_check_lib_save_LIBS
10858 fi
10859 echo "$as_me:10859: result: $ac_cv_lib_mytinfo_tgoto" >&5
10860 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10861 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10862   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10863 fi
10864
10865         fi
10866         ;;
10867 esac
10868
10869 cf_add_libs="$cf_ncurses_LIBS"
10870 # Filter out duplicates - this happens with badly-designed ".pc" files...
10871 for cf_add_1lib in $LIBS
10872 do
10873         for cf_add_2lib in $cf_add_libs
10874         do
10875                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10876                 then
10877                         cf_add_1lib=
10878                         break
10879                 fi
10880         done
10881         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10882 done
10883 LIBS="$cf_add_libs"
10884
10885 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10886 then
10887
10888 cf_add_libs="-l$cf_nculib_root"
10889 # Filter out duplicates - this happens with badly-designed ".pc" files...
10890 for cf_add_1lib in $LIBS
10891 do
10892         for cf_add_2lib in $cf_add_libs
10893         do
10894                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10895                 then
10896                         cf_add_1lib=
10897                         break
10898                 fi
10899         done
10900         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10901 done
10902 LIBS="$cf_add_libs"
10903
10904 else
10905
10906         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10907         cf_libdir=""
10908         echo "$as_me:10908: checking for initscr" >&5
10909 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10910 if test "${ac_cv_func_initscr+set}" = set; then
10911   echo $ECHO_N "(cached) $ECHO_C" >&6
10912 else
10913   cat >conftest.$ac_ext <<_ACEOF
10914 #line 10914 "configure"
10915 #include "confdefs.h"
10916 #define initscr autoconf_temporary
10917 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10918 #undef initscr
10919
10920 #ifdef __cplusplus
10921 extern "C"
10922 #endif
10923
10924 /* We use char because int might match the return type of a gcc2
10925    builtin and then its argument prototype would still apply.  */
10926 char initscr (void);
10927
10928 int
10929 main (void)
10930 {
10931
10932 /* The GNU C library defines stubs for functions which it implements
10933     to always fail with ENOSYS.  Some functions are actually named
10934     something starting with __ and the normal name is an alias.  */
10935 #if defined (__stub_initscr) || defined (__stub___initscr)
10936 #error found stub for initscr
10937 #endif
10938
10939         return initscr ();
10940   ;
10941   return 0;
10942 }
10943 _ACEOF
10944 rm -f conftest.$ac_objext conftest$ac_exeext
10945 if { (eval echo "$as_me:10945: \"$ac_link\"") >&5
10946   (eval $ac_link) 2>&5
10947   ac_status=$?
10948   echo "$as_me:10948: \$? = $ac_status" >&5
10949   (exit $ac_status); } &&
10950          { ac_try='test -s conftest$ac_exeext'
10951   { (eval echo "$as_me:10951: \"$ac_try\"") >&5
10952   (eval $ac_try) 2>&5
10953   ac_status=$?
10954   echo "$as_me:10954: \$? = $ac_status" >&5
10955   (exit $ac_status); }; }; then
10956   ac_cv_func_initscr=yes
10957 else
10958   echo "$as_me: failed program was:" >&5
10959 cat conftest.$ac_ext >&5
10960 ac_cv_func_initscr=no
10961 fi
10962 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10963 fi
10964 echo "$as_me:10964: result: $ac_cv_func_initscr" >&5
10965 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10966 if test $ac_cv_func_initscr = yes; then
10967   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10968 else
10969
10970                 cf_save_LIBS="$LIBS"
10971                 echo "$as_me:10971: checking for initscr in -l$cf_nculib_root" >&5
10972 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10973                 LIBS="-l$cf_nculib_root $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
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
11008 cf_search=
11009 cf_library_path_list=""
11010 if test -n "${LDFLAGS}${LIBS}" ; then
11011         for cf_library_path in $LDFLAGS $LIBS
11012         do
11013                 case $cf_library_path in
11014                 (-L*)
11015                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11016
11017 test "x$cf_library_path" != "xNONE" && \
11018 test -d "$cf_library_path" && \
11019  {
11020         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11021         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
11022         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11023         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11024         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11025         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"
11026 }
11027
11028                         cf_library_path_list="$cf_library_path_list $cf_search"
11029                         ;;
11030                 esac
11031         done
11032 fi
11033
11034 cf_search=
11035
11036 test "x$prefix" != "xNONE" && \
11037 test -d "$prefix" && \
11038  {
11039         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11040         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
11041         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11042         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11043         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11044         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11045 }
11046
11047 for cf_subdir_prefix in \
11048         /usr \
11049         /usr/local \
11050         /usr/pkg \
11051         /opt \
11052         /opt/local \
11053         $HOME
11054 do
11055
11056 test "x$cf_subdir_prefix" != "x$prefix" && \
11057 test -d "$cf_subdir_prefix" && \
11058 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
11059         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11060         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11061         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11062         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11063         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11064         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"
11065 }
11066
11067 done
11068
11069 cf_search="$cf_library_path_list $cf_search"
11070
11071                         for cf_libdir in $cf_search
11072                         do
11073                                 echo "$as_me:11073: checking for -l$cf_nculib_root in $cf_libdir" >&5
11074 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11075                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11076                                 cat >conftest.$ac_ext <<_ACEOF
11077 #line 11077 "configure"
11078 #include "confdefs.h"
11079 #include <${cf_cv_ncurses_header:-curses.h}>
11080 int
11081 main (void)
11082 {
11083 initscr()
11084   ;
11085   return 0;
11086 }
11087 _ACEOF
11088 rm -f conftest.$ac_objext conftest$ac_exeext
11089 if { (eval echo "$as_me:11089: \"$ac_link\"") >&5
11090   (eval $ac_link) 2>&5
11091   ac_status=$?
11092   echo "$as_me:11092: \$? = $ac_status" >&5
11093   (exit $ac_status); } &&
11094          { ac_try='test -s conftest$ac_exeext'
11095   { (eval echo "$as_me:11095: \"$ac_try\"") >&5
11096   (eval $ac_try) 2>&5
11097   ac_status=$?
11098   echo "$as_me:11098: \$? = $ac_status" >&5
11099   (exit $ac_status); }; }; then
11100   echo "$as_me:11100: result: yes" >&5
11101 echo "${ECHO_T}yes" >&6
11102                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11103                                          break
11104 else
11105   echo "$as_me: failed program was:" >&5
11106 cat conftest.$ac_ext >&5
11107 echo "$as_me:11107: result: no" >&5
11108 echo "${ECHO_T}no" >&6
11109                                          LIBS="$cf_save_LIBS"
11110 fi
11111 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11112                         done
11113
11114 fi
11115 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11116
11117 fi
11118
11119 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11120
11121 if test $cf_found_library = no ; then
11122         { { echo "$as_me:11122: error: Cannot link $cf_nculib_root library" >&5
11123 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11124    { (exit 1); exit 1; }; }
11125 fi
11126
11127 fi
11128
11129 if test -n "$cf_ncurses_LIBS" ; then
11130         echo "$as_me:11130: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11131 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11132         cf_ncurses_SAVE="$LIBS"
11133         for p in $cf_ncurses_LIBS ; do
11134                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11135                 if test "$q" != "$LIBS" ; then
11136                         LIBS="$q"
11137                 fi
11138         done
11139         cat >conftest.$ac_ext <<_ACEOF
11140 #line 11140 "configure"
11141 #include "confdefs.h"
11142 #include <${cf_cv_ncurses_header:-curses.h}>
11143 int
11144 main (void)
11145 {
11146 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11147   ;
11148   return 0;
11149 }
11150 _ACEOF
11151 rm -f conftest.$ac_objext conftest$ac_exeext
11152 if { (eval echo "$as_me:11152: \"$ac_link\"") >&5
11153   (eval $ac_link) 2>&5
11154   ac_status=$?
11155   echo "$as_me:11155: \$? = $ac_status" >&5
11156   (exit $ac_status); } &&
11157          { ac_try='test -s conftest$ac_exeext'
11158   { (eval echo "$as_me:11158: \"$ac_try\"") >&5
11159   (eval $ac_try) 2>&5
11160   ac_status=$?
11161   echo "$as_me:11161: \$? = $ac_status" >&5
11162   (exit $ac_status); }; }; then
11163   echo "$as_me:11163: result: yes" >&5
11164 echo "${ECHO_T}yes" >&6
11165 else
11166   echo "$as_me: failed program was:" >&5
11167 cat conftest.$ac_ext >&5
11168 echo "$as_me:11168: result: no" >&5
11169 echo "${ECHO_T}no" >&6
11170                  LIBS="$cf_ncurses_SAVE"
11171 fi
11172 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11173 fi
11174
11175 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11176
11177 cat >>confdefs.h <<EOF
11178 #define $cf_nculib_ROOT 1
11179 EOF
11180
11181         fi
11182 else
11183         NCURSES_CONFIG=none
11184 fi
11185
11186         ;;
11187 (pdcurses)
11188         echo "$as_me:11188: checking for X" >&5
11189 echo $ECHO_N "checking for X... $ECHO_C" >&6
11190
11191 # Check whether --with-x or --without-x was given.
11192 if test "${with_x+set}" = set; then
11193   withval="$with_x"
11194
11195 fi;
11196 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11197 if test "x$with_x" = xno; then
11198   # The user explicitly disabled X.
11199   have_x=disabled
11200 else
11201   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11202     # Both variables are already set.
11203     have_x=yes
11204   else
11205     if test "${ac_cv_have_x+set}" = set; then
11206   echo $ECHO_N "(cached) $ECHO_C" >&6
11207 else
11208   # One or both of the vars are not set, and there is no cached value.
11209 ac_x_includes=no ac_x_libraries=no
11210 rm -fr conftest.dir
11211 if mkdir conftest.dir; then
11212   cd conftest.dir
11213   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11214   cat >Imakefile <<'EOF'
11215 acfindx:
11216         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11217 EOF
11218   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11219     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11220     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11221     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11222     for ac_extension in a so sl dylib dll; do
11223       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11224          test -f $ac_im_libdir/libX11.$ac_extension; then
11225         ac_im_usrlibdir=$ac_im_libdir; break
11226       fi
11227     done
11228     # Screen out bogus values from the imake configuration.  They are
11229     # bogus both because they are the default anyway, and because
11230     # using them would break gcc on systems where it needs fixed includes.
11231     case $ac_im_incroot in
11232         /usr/include) ;;
11233         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11234     esac
11235     case $ac_im_usrlibdir in
11236         /usr/lib | /lib) ;;
11237         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11238     esac
11239   fi
11240   cd ..
11241   rm -fr conftest.dir
11242 fi
11243
11244 # Standard set of common directories for X headers.
11245 # Check X11 before X11Rn because it is often a symlink to the current release.
11246 ac_x_header_dirs='
11247 /usr/X11/include
11248 /usr/X11R7/include
11249 /usr/X11R6/include
11250 /usr/X11R5/include
11251 /usr/X11R4/include
11252
11253 /usr/include/X11
11254 /usr/include/X11R7
11255 /usr/include/X11R6
11256 /usr/include/X11R5
11257 /usr/include/X11R4
11258
11259 /usr/local/X11/include
11260 /usr/local/X11R7/include
11261 /usr/local/X11R6/include
11262 /usr/local/X11R5/include
11263 /usr/local/X11R4/include
11264
11265 /usr/local/include/X11
11266 /usr/local/include/X11R7
11267 /usr/local/include/X11R6
11268 /usr/local/include/X11R5
11269 /usr/local/include/X11R4
11270
11271 /usr/X386/include
11272 /usr/x386/include
11273 /usr/XFree86/include/X11
11274
11275 /usr/include
11276 /usr/local/include
11277 /usr/unsupported/include
11278 /usr/athena/include
11279 /usr/local/x11r5/include
11280 /usr/lpp/Xamples/include
11281
11282 /usr/openwin/include
11283 /usr/openwin/share/include'
11284
11285 if test "$ac_x_includes" = no; then
11286   # Guess where to find include files, by looking for Intrinsic.h.
11287   # First, try using that file with no special directory specified.
11288   cat >conftest.$ac_ext <<_ACEOF
11289 #line 11289 "configure"
11290 #include "confdefs.h"
11291 #include <X11/Intrinsic.h>
11292 _ACEOF
11293 if { (eval echo "$as_me:11293: \"$ac_cpp conftest.$ac_ext\"") >&5
11294   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11295   ac_status=$?
11296   egrep -v '^ *\+' conftest.er1 >conftest.err
11297   rm -f conftest.er1
11298   cat conftest.err >&5
11299   echo "$as_me:11299: \$? = $ac_status" >&5
11300   (exit $ac_status); } >/dev/null; then
11301   if test -s conftest.err; then
11302     ac_cpp_err=$ac_c_preproc_warn_flag
11303   else
11304     ac_cpp_err=
11305   fi
11306 else
11307   ac_cpp_err=yes
11308 fi
11309 if test -z "$ac_cpp_err"; then
11310   # We can compile using X headers with no special include directory.
11311 ac_x_includes=
11312 else
11313   echo "$as_me: failed program was:" >&5
11314   cat conftest.$ac_ext >&5
11315   for ac_dir in $ac_x_header_dirs; do
11316   if test -r "$ac_dir/X11/Intrinsic.h"; then
11317     ac_x_includes=$ac_dir
11318     break
11319   fi
11320 done
11321 fi
11322 rm -f conftest.err conftest.$ac_ext
11323 fi # $ac_x_includes = no
11324
11325 if test "$ac_x_libraries" = no; then
11326   # Check for the libraries.
11327   # See if we find them without any special options.
11328   # Don't add to $LIBS permanently.
11329   ac_save_LIBS=$LIBS
11330   LIBS="-lXt $LIBS"
11331   cat >conftest.$ac_ext <<_ACEOF
11332 #line 11332 "configure"
11333 #include "confdefs.h"
11334 #include <X11/Intrinsic.h>
11335 int
11336 main (void)
11337 {
11338 XtMalloc (0)
11339   ;
11340   return 0;
11341 }
11342 _ACEOF
11343 rm -f conftest.$ac_objext conftest$ac_exeext
11344 if { (eval echo "$as_me:11344: \"$ac_link\"") >&5
11345   (eval $ac_link) 2>&5
11346   ac_status=$?
11347   echo "$as_me:11347: \$? = $ac_status" >&5
11348   (exit $ac_status); } &&
11349          { ac_try='test -s conftest$ac_exeext'
11350   { (eval echo "$as_me:11350: \"$ac_try\"") >&5
11351   (eval $ac_try) 2>&5
11352   ac_status=$?
11353   echo "$as_me:11353: \$? = $ac_status" >&5
11354   (exit $ac_status); }; }; then
11355   LIBS=$ac_save_LIBS
11356 # We can link X programs with no special library path.
11357 ac_x_libraries=
11358 else
11359   echo "$as_me: failed program was:" >&5
11360 cat conftest.$ac_ext >&5
11361 LIBS=$ac_save_LIBS
11362 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11363 do
11364   # Don't even attempt the hair of trying to link an X program!
11365   for ac_extension in a so sl dylib dll; do
11366     if test -r $ac_dir/libXt.$ac_extension; then
11367       ac_x_libraries=$ac_dir
11368       break 2
11369     fi
11370   done
11371 done
11372 fi
11373 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11374 fi # $ac_x_libraries = no
11375
11376 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11377   # Didn't find X anywhere.  Cache the known absence of X.
11378   ac_cv_have_x="have_x=no"
11379 else
11380   # Record where we found X for the cache.
11381   ac_cv_have_x="have_x=yes \
11382                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11383 fi
11384 fi
11385
11386   fi
11387   eval "$ac_cv_have_x"
11388 fi # $with_x != no
11389
11390 if test "$have_x" != yes; then
11391   echo "$as_me:11391: result: $have_x" >&5
11392 echo "${ECHO_T}$have_x" >&6
11393   no_x=yes
11394 else
11395   # If each of the values was on the command line, it overrides each guess.
11396   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11397   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11398   # Update the cache value to reflect the command line values.
11399   ac_cv_have_x="have_x=yes \
11400                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11401   echo "$as_me:11401: result: libraries $x_libraries, headers $x_includes" >&5
11402 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11403 fi
11404
11405 if test "$no_x" = yes; then
11406   # Not all programs may use this symbol, but it does not hurt to define it.
11407
11408 cat >>confdefs.h <<\EOF
11409 #define X_DISPLAY_MISSING 1
11410 EOF
11411
11412   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11413 else
11414   if test -n "$x_includes"; then
11415     X_CFLAGS="$X_CFLAGS -I$x_includes"
11416   fi
11417
11418   # It would also be nice to do this for all -L options, not just this one.
11419   if test -n "$x_libraries"; then
11420     X_LIBS="$X_LIBS -L$x_libraries"
11421     # For Solaris; some versions of Sun CC require a space after -R and
11422     # others require no space.  Words are not sufficient . . . .
11423     case `(uname -sr) 2>/dev/null` in
11424     "SunOS 5"*)
11425       echo "$as_me:11425: checking whether -R must be followed by a space" >&5
11426 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11427       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11428       cat >conftest.$ac_ext <<_ACEOF
11429 #line 11429 "configure"
11430 #include "confdefs.h"
11431
11432 int
11433 main (void)
11434 {
11435
11436   ;
11437   return 0;
11438 }
11439 _ACEOF
11440 rm -f conftest.$ac_objext conftest$ac_exeext
11441 if { (eval echo "$as_me:11441: \"$ac_link\"") >&5
11442   (eval $ac_link) 2>&5
11443   ac_status=$?
11444   echo "$as_me:11444: \$? = $ac_status" >&5
11445   (exit $ac_status); } &&
11446          { ac_try='test -s conftest$ac_exeext'
11447   { (eval echo "$as_me:11447: \"$ac_try\"") >&5
11448   (eval $ac_try) 2>&5
11449   ac_status=$?
11450   echo "$as_me:11450: \$? = $ac_status" >&5
11451   (exit $ac_status); }; }; then
11452   ac_R_nospace=yes
11453 else
11454   echo "$as_me: failed program was:" >&5
11455 cat conftest.$ac_ext >&5
11456 ac_R_nospace=no
11457 fi
11458 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11459       if test $ac_R_nospace = yes; then
11460         echo "$as_me:11460: result: no" >&5
11461 echo "${ECHO_T}no" >&6
11462         X_LIBS="$X_LIBS -R$x_libraries"
11463       else
11464         LIBS="$ac_xsave_LIBS -R $x_libraries"
11465         cat >conftest.$ac_ext <<_ACEOF
11466 #line 11466 "configure"
11467 #include "confdefs.h"
11468
11469 int
11470 main (void)
11471 {
11472
11473   ;
11474   return 0;
11475 }
11476 _ACEOF
11477 rm -f conftest.$ac_objext conftest$ac_exeext
11478 if { (eval echo "$as_me:11478: \"$ac_link\"") >&5
11479   (eval $ac_link) 2>&5
11480   ac_status=$?
11481   echo "$as_me:11481: \$? = $ac_status" >&5
11482   (exit $ac_status); } &&
11483          { ac_try='test -s conftest$ac_exeext'
11484   { (eval echo "$as_me:11484: \"$ac_try\"") >&5
11485   (eval $ac_try) 2>&5
11486   ac_status=$?
11487   echo "$as_me:11487: \$? = $ac_status" >&5
11488   (exit $ac_status); }; }; then
11489   ac_R_space=yes
11490 else
11491   echo "$as_me: failed program was:" >&5
11492 cat conftest.$ac_ext >&5
11493 ac_R_space=no
11494 fi
11495 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11496         if test $ac_R_space = yes; then
11497           echo "$as_me:11497: result: yes" >&5
11498 echo "${ECHO_T}yes" >&6
11499           X_LIBS="$X_LIBS -R $x_libraries"
11500         else
11501           echo "$as_me:11501: result: neither works" >&5
11502 echo "${ECHO_T}neither works" >&6
11503         fi
11504       fi
11505       LIBS=$ac_xsave_LIBS
11506     esac
11507   fi
11508
11509   # Check for system-dependent libraries X programs must link with.
11510   # Do this before checking for the system-independent R6 libraries
11511   # (-lICE), since we may need -lsocket or whatever for X linking.
11512
11513   if test "$ISC" = yes; then
11514     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11515   else
11516     # Martyn Johnson says this is needed for Ultrix, if the X
11517     # libraries were built with DECnet support.  And Karl Berry says
11518     # the Alpha needs dnet_stub (dnet does not exist).
11519     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11520     cat >conftest.$ac_ext <<_ACEOF
11521 #line 11521 "configure"
11522 #include "confdefs.h"
11523
11524 /* Override any gcc2 internal prototype to avoid an error.  */
11525 #ifdef __cplusplus
11526 extern "C"
11527 #endif
11528 /* We use char because int might match the return type of a gcc2
11529    builtin and then its argument prototype would still apply.  */
11530 char XOpenDisplay ();
11531 int
11532 main (void)
11533 {
11534 XOpenDisplay ();
11535   ;
11536   return 0;
11537 }
11538 _ACEOF
11539 rm -f conftest.$ac_objext conftest$ac_exeext
11540 if { (eval echo "$as_me:11540: \"$ac_link\"") >&5
11541   (eval $ac_link) 2>&5
11542   ac_status=$?
11543   echo "$as_me:11543: \$? = $ac_status" >&5
11544   (exit $ac_status); } &&
11545          { ac_try='test -s conftest$ac_exeext'
11546   { (eval echo "$as_me:11546: \"$ac_try\"") >&5
11547   (eval $ac_try) 2>&5
11548   ac_status=$?
11549   echo "$as_me:11549: \$? = $ac_status" >&5
11550   (exit $ac_status); }; }; then
11551   :
11552 else
11553   echo "$as_me: failed program was:" >&5
11554 cat conftest.$ac_ext >&5
11555 echo "$as_me:11555: checking for dnet_ntoa in -ldnet" >&5
11556 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11557 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11558   echo $ECHO_N "(cached) $ECHO_C" >&6
11559 else
11560   ac_check_lib_save_LIBS=$LIBS
11561 LIBS="-ldnet  $LIBS"
11562 cat >conftest.$ac_ext <<_ACEOF
11563 #line 11563 "configure"
11564 #include "confdefs.h"
11565
11566 /* Override any gcc2 internal prototype to avoid an error.  */
11567 #ifdef __cplusplus
11568 extern "C"
11569 #endif
11570 /* We use char because int might match the return type of a gcc2
11571    builtin and then its argument prototype would still apply.  */
11572 char dnet_ntoa ();
11573 int
11574 main (void)
11575 {
11576 dnet_ntoa ();
11577   ;
11578   return 0;
11579 }
11580 _ACEOF
11581 rm -f conftest.$ac_objext conftest$ac_exeext
11582 if { (eval echo "$as_me:11582: \"$ac_link\"") >&5
11583   (eval $ac_link) 2>&5
11584   ac_status=$?
11585   echo "$as_me:11585: \$? = $ac_status" >&5
11586   (exit $ac_status); } &&
11587          { ac_try='test -s conftest$ac_exeext'
11588   { (eval echo "$as_me:11588: \"$ac_try\"") >&5
11589   (eval $ac_try) 2>&5
11590   ac_status=$?
11591   echo "$as_me:11591: \$? = $ac_status" >&5
11592   (exit $ac_status); }; }; then
11593   ac_cv_lib_dnet_dnet_ntoa=yes
11594 else
11595   echo "$as_me: failed program was:" >&5
11596 cat conftest.$ac_ext >&5
11597 ac_cv_lib_dnet_dnet_ntoa=no
11598 fi
11599 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11600 LIBS=$ac_check_lib_save_LIBS
11601 fi
11602 echo "$as_me:11602: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
11603 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
11604 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
11605   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
11606 fi
11607
11608     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
11609       echo "$as_me:11609: checking for dnet_ntoa in -ldnet_stub" >&5
11610 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
11611 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
11612   echo $ECHO_N "(cached) $ECHO_C" >&6
11613 else
11614   ac_check_lib_save_LIBS=$LIBS
11615 LIBS="-ldnet_stub  $LIBS"
11616 cat >conftest.$ac_ext <<_ACEOF
11617 #line 11617 "configure"
11618 #include "confdefs.h"
11619
11620 /* Override any gcc2 internal prototype to avoid an error.  */
11621 #ifdef __cplusplus
11622 extern "C"
11623 #endif
11624 /* We use char because int might match the return type of a gcc2
11625    builtin and then its argument prototype would still apply.  */
11626 char dnet_ntoa ();
11627 int
11628 main (void)
11629 {
11630 dnet_ntoa ();
11631   ;
11632   return 0;
11633 }
11634 _ACEOF
11635 rm -f conftest.$ac_objext conftest$ac_exeext
11636 if { (eval echo "$as_me:11636: \"$ac_link\"") >&5
11637   (eval $ac_link) 2>&5
11638   ac_status=$?
11639   echo "$as_me:11639: \$? = $ac_status" >&5
11640   (exit $ac_status); } &&
11641          { ac_try='test -s conftest$ac_exeext'
11642   { (eval echo "$as_me:11642: \"$ac_try\"") >&5
11643   (eval $ac_try) 2>&5
11644   ac_status=$?
11645   echo "$as_me:11645: \$? = $ac_status" >&5
11646   (exit $ac_status); }; }; then
11647   ac_cv_lib_dnet_stub_dnet_ntoa=yes
11648 else
11649   echo "$as_me: failed program was:" >&5
11650 cat conftest.$ac_ext >&5
11651 ac_cv_lib_dnet_stub_dnet_ntoa=no
11652 fi
11653 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11654 LIBS=$ac_check_lib_save_LIBS
11655 fi
11656 echo "$as_me:11656: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
11657 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
11658 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
11659   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
11660 fi
11661
11662     fi
11663 fi
11664 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11665     LIBS="$ac_xsave_LIBS"
11666
11667     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
11668     # to get the SysV transport functions.
11669     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
11670     # needs -lnsl.
11671     # The nsl library prevents programs from opening the X display
11672     # on Irix 5.2, according to T.E. Dickey.
11673     # The functions gethostbyname, getservbyname, and inet_addr are
11674     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
11675     echo "$as_me:11675: checking for gethostbyname" >&5
11676 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
11677 if test "${ac_cv_func_gethostbyname+set}" = set; then
11678   echo $ECHO_N "(cached) $ECHO_C" >&6
11679 else
11680   cat >conftest.$ac_ext <<_ACEOF
11681 #line 11681 "configure"
11682 #include "confdefs.h"
11683 #define gethostbyname autoconf_temporary
11684 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11685 #undef gethostbyname
11686
11687 #ifdef __cplusplus
11688 extern "C"
11689 #endif
11690
11691 /* We use char because int might match the return type of a gcc2
11692    builtin and then its argument prototype would still apply.  */
11693 char gethostbyname (void);
11694
11695 int
11696 main (void)
11697 {
11698
11699 /* The GNU C library defines stubs for functions which it implements
11700     to always fail with ENOSYS.  Some functions are actually named
11701     something starting with __ and the normal name is an alias.  */
11702 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
11703 #error found stub for gethostbyname
11704 #endif
11705
11706         return gethostbyname ();
11707   ;
11708   return 0;
11709 }
11710 _ACEOF
11711 rm -f conftest.$ac_objext conftest$ac_exeext
11712 if { (eval echo "$as_me:11712: \"$ac_link\"") >&5
11713   (eval $ac_link) 2>&5
11714   ac_status=$?
11715   echo "$as_me:11715: \$? = $ac_status" >&5
11716   (exit $ac_status); } &&
11717          { ac_try='test -s conftest$ac_exeext'
11718   { (eval echo "$as_me:11718: \"$ac_try\"") >&5
11719   (eval $ac_try) 2>&5
11720   ac_status=$?
11721   echo "$as_me:11721: \$? = $ac_status" >&5
11722   (exit $ac_status); }; }; then
11723   ac_cv_func_gethostbyname=yes
11724 else
11725   echo "$as_me: failed program was:" >&5
11726 cat conftest.$ac_ext >&5
11727 ac_cv_func_gethostbyname=no
11728 fi
11729 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11730 fi
11731 echo "$as_me:11731: result: $ac_cv_func_gethostbyname" >&5
11732 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
11733
11734     if test $ac_cv_func_gethostbyname = no; then
11735       echo "$as_me:11735: checking for gethostbyname in -lnsl" >&5
11736 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
11737 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
11738   echo $ECHO_N "(cached) $ECHO_C" >&6
11739 else
11740   ac_check_lib_save_LIBS=$LIBS
11741 LIBS="-lnsl  $LIBS"
11742 cat >conftest.$ac_ext <<_ACEOF
11743 #line 11743 "configure"
11744 #include "confdefs.h"
11745
11746 /* Override any gcc2 internal prototype to avoid an error.  */
11747 #ifdef __cplusplus
11748 extern "C"
11749 #endif
11750 /* We use char because int might match the return type of a gcc2
11751    builtin and then its argument prototype would still apply.  */
11752 char gethostbyname ();
11753 int
11754 main (void)
11755 {
11756 gethostbyname ();
11757   ;
11758   return 0;
11759 }
11760 _ACEOF
11761 rm -f conftest.$ac_objext conftest$ac_exeext
11762 if { (eval echo "$as_me:11762: \"$ac_link\"") >&5
11763   (eval $ac_link) 2>&5
11764   ac_status=$?
11765   echo "$as_me:11765: \$? = $ac_status" >&5
11766   (exit $ac_status); } &&
11767          { ac_try='test -s conftest$ac_exeext'
11768   { (eval echo "$as_me:11768: \"$ac_try\"") >&5
11769   (eval $ac_try) 2>&5
11770   ac_status=$?
11771   echo "$as_me:11771: \$? = $ac_status" >&5
11772   (exit $ac_status); }; }; then
11773   ac_cv_lib_nsl_gethostbyname=yes
11774 else
11775   echo "$as_me: failed program was:" >&5
11776 cat conftest.$ac_ext >&5
11777 ac_cv_lib_nsl_gethostbyname=no
11778 fi
11779 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11780 LIBS=$ac_check_lib_save_LIBS
11781 fi
11782 echo "$as_me:11782: result: $ac_cv_lib_nsl_gethostbyname" >&5
11783 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
11784 if test $ac_cv_lib_nsl_gethostbyname = yes; then
11785   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
11786 fi
11787
11788       if test $ac_cv_lib_nsl_gethostbyname = no; then
11789         echo "$as_me:11789: checking for gethostbyname in -lbsd" >&5
11790 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
11791 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
11792   echo $ECHO_N "(cached) $ECHO_C" >&6
11793 else
11794   ac_check_lib_save_LIBS=$LIBS
11795 LIBS="-lbsd  $LIBS"
11796 cat >conftest.$ac_ext <<_ACEOF
11797 #line 11797 "configure"
11798 #include "confdefs.h"
11799
11800 /* Override any gcc2 internal prototype to avoid an error.  */
11801 #ifdef __cplusplus
11802 extern "C"
11803 #endif
11804 /* We use char because int might match the return type of a gcc2
11805    builtin and then its argument prototype would still apply.  */
11806 char gethostbyname ();
11807 int
11808 main (void)
11809 {
11810 gethostbyname ();
11811   ;
11812   return 0;
11813 }
11814 _ACEOF
11815 rm -f conftest.$ac_objext conftest$ac_exeext
11816 if { (eval echo "$as_me:11816: \"$ac_link\"") >&5
11817   (eval $ac_link) 2>&5
11818   ac_status=$?
11819   echo "$as_me:11819: \$? = $ac_status" >&5
11820   (exit $ac_status); } &&
11821          { ac_try='test -s conftest$ac_exeext'
11822   { (eval echo "$as_me:11822: \"$ac_try\"") >&5
11823   (eval $ac_try) 2>&5
11824   ac_status=$?
11825   echo "$as_me:11825: \$? = $ac_status" >&5
11826   (exit $ac_status); }; }; then
11827   ac_cv_lib_bsd_gethostbyname=yes
11828 else
11829   echo "$as_me: failed program was:" >&5
11830 cat conftest.$ac_ext >&5
11831 ac_cv_lib_bsd_gethostbyname=no
11832 fi
11833 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11834 LIBS=$ac_check_lib_save_LIBS
11835 fi
11836 echo "$as_me:11836: result: $ac_cv_lib_bsd_gethostbyname" >&5
11837 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
11838 if test $ac_cv_lib_bsd_gethostbyname = yes; then
11839   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
11840 fi
11841
11842       fi
11843     fi
11844
11845     # lieder@skyler.mavd.honeywell.com says without -lsocket,
11846     # socket/setsockopt and other routines are undefined under SCO ODT
11847     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
11848     # on later versions), says Simon Leinen: it contains gethostby*
11849     # variants that don't use the nameserver (or something).  -lsocket
11850     # must be given before -lnsl if both are needed.  We assume that
11851     # if connect needs -lnsl, so does gethostbyname.
11852     echo "$as_me:11852: checking for connect" >&5
11853 echo $ECHO_N "checking for connect... $ECHO_C" >&6
11854 if test "${ac_cv_func_connect+set}" = set; then
11855   echo $ECHO_N "(cached) $ECHO_C" >&6
11856 else
11857   cat >conftest.$ac_ext <<_ACEOF
11858 #line 11858 "configure"
11859 #include "confdefs.h"
11860 #define connect autoconf_temporary
11861 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11862 #undef connect
11863
11864 #ifdef __cplusplus
11865 extern "C"
11866 #endif
11867
11868 /* We use char because int might match the return type of a gcc2
11869    builtin and then its argument prototype would still apply.  */
11870 char connect (void);
11871
11872 int
11873 main (void)
11874 {
11875
11876 /* The GNU C library defines stubs for functions which it implements
11877     to always fail with ENOSYS.  Some functions are actually named
11878     something starting with __ and the normal name is an alias.  */
11879 #if defined (__stub_connect) || defined (__stub___connect)
11880 #error found stub for connect
11881 #endif
11882
11883         return connect ();
11884   ;
11885   return 0;
11886 }
11887 _ACEOF
11888 rm -f conftest.$ac_objext conftest$ac_exeext
11889 if { (eval echo "$as_me:11889: \"$ac_link\"") >&5
11890   (eval $ac_link) 2>&5
11891   ac_status=$?
11892   echo "$as_me:11892: \$? = $ac_status" >&5
11893   (exit $ac_status); } &&
11894          { ac_try='test -s conftest$ac_exeext'
11895   { (eval echo "$as_me:11895: \"$ac_try\"") >&5
11896   (eval $ac_try) 2>&5
11897   ac_status=$?
11898   echo "$as_me:11898: \$? = $ac_status" >&5
11899   (exit $ac_status); }; }; then
11900   ac_cv_func_connect=yes
11901 else
11902   echo "$as_me: failed program was:" >&5
11903 cat conftest.$ac_ext >&5
11904 ac_cv_func_connect=no
11905 fi
11906 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11907 fi
11908 echo "$as_me:11908: result: $ac_cv_func_connect" >&5
11909 echo "${ECHO_T}$ac_cv_func_connect" >&6
11910
11911     if test $ac_cv_func_connect = no; then
11912       echo "$as_me:11912: checking for connect in -lsocket" >&5
11913 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
11914 if test "${ac_cv_lib_socket_connect+set}" = set; then
11915   echo $ECHO_N "(cached) $ECHO_C" >&6
11916 else
11917   ac_check_lib_save_LIBS=$LIBS
11918 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
11919 cat >conftest.$ac_ext <<_ACEOF
11920 #line 11920 "configure"
11921 #include "confdefs.h"
11922
11923 /* Override any gcc2 internal prototype to avoid an error.  */
11924 #ifdef __cplusplus
11925 extern "C"
11926 #endif
11927 /* We use char because int might match the return type of a gcc2
11928    builtin and then its argument prototype would still apply.  */
11929 char connect ();
11930 int
11931 main (void)
11932 {
11933 connect ();
11934   ;
11935   return 0;
11936 }
11937 _ACEOF
11938 rm -f conftest.$ac_objext conftest$ac_exeext
11939 if { (eval echo "$as_me:11939: \"$ac_link\"") >&5
11940   (eval $ac_link) 2>&5
11941   ac_status=$?
11942   echo "$as_me:11942: \$? = $ac_status" >&5
11943   (exit $ac_status); } &&
11944          { ac_try='test -s conftest$ac_exeext'
11945   { (eval echo "$as_me:11945: \"$ac_try\"") >&5
11946   (eval $ac_try) 2>&5
11947   ac_status=$?
11948   echo "$as_me:11948: \$? = $ac_status" >&5
11949   (exit $ac_status); }; }; then
11950   ac_cv_lib_socket_connect=yes
11951 else
11952   echo "$as_me: failed program was:" >&5
11953 cat conftest.$ac_ext >&5
11954 ac_cv_lib_socket_connect=no
11955 fi
11956 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11957 LIBS=$ac_check_lib_save_LIBS
11958 fi
11959 echo "$as_me:11959: result: $ac_cv_lib_socket_connect" >&5
11960 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
11961 if test $ac_cv_lib_socket_connect = yes; then
11962   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
11963 fi
11964
11965     fi
11966
11967     # Guillermo Gomez says -lposix is necessary on A/UX.
11968     echo "$as_me:11968: checking for remove" >&5
11969 echo $ECHO_N "checking for remove... $ECHO_C" >&6
11970 if test "${ac_cv_func_remove+set}" = set; then
11971   echo $ECHO_N "(cached) $ECHO_C" >&6
11972 else
11973   cat >conftest.$ac_ext <<_ACEOF
11974 #line 11974 "configure"
11975 #include "confdefs.h"
11976 #define remove autoconf_temporary
11977 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11978 #undef remove
11979
11980 #ifdef __cplusplus
11981 extern "C"
11982 #endif
11983
11984 /* We use char because int might match the return type of a gcc2
11985    builtin and then its argument prototype would still apply.  */
11986 char remove (void);
11987
11988 int
11989 main (void)
11990 {
11991
11992 /* The GNU C library defines stubs for functions which it implements
11993     to always fail with ENOSYS.  Some functions are actually named
11994     something starting with __ and the normal name is an alias.  */
11995 #if defined (__stub_remove) || defined (__stub___remove)
11996 #error found stub for remove
11997 #endif
11998
11999         return remove ();
12000   ;
12001   return 0;
12002 }
12003 _ACEOF
12004 rm -f conftest.$ac_objext conftest$ac_exeext
12005 if { (eval echo "$as_me:12005: \"$ac_link\"") >&5
12006   (eval $ac_link) 2>&5
12007   ac_status=$?
12008   echo "$as_me:12008: \$? = $ac_status" >&5
12009   (exit $ac_status); } &&
12010          { ac_try='test -s conftest$ac_exeext'
12011   { (eval echo "$as_me:12011: \"$ac_try\"") >&5
12012   (eval $ac_try) 2>&5
12013   ac_status=$?
12014   echo "$as_me:12014: \$? = $ac_status" >&5
12015   (exit $ac_status); }; }; then
12016   ac_cv_func_remove=yes
12017 else
12018   echo "$as_me: failed program was:" >&5
12019 cat conftest.$ac_ext >&5
12020 ac_cv_func_remove=no
12021 fi
12022 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12023 fi
12024 echo "$as_me:12024: result: $ac_cv_func_remove" >&5
12025 echo "${ECHO_T}$ac_cv_func_remove" >&6
12026
12027     if test $ac_cv_func_remove = no; then
12028       echo "$as_me:12028: checking for remove in -lposix" >&5
12029 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12030 if test "${ac_cv_lib_posix_remove+set}" = set; then
12031   echo $ECHO_N "(cached) $ECHO_C" >&6
12032 else
12033   ac_check_lib_save_LIBS=$LIBS
12034 LIBS="-lposix  $LIBS"
12035 cat >conftest.$ac_ext <<_ACEOF
12036 #line 12036 "configure"
12037 #include "confdefs.h"
12038
12039 /* Override any gcc2 internal prototype to avoid an error.  */
12040 #ifdef __cplusplus
12041 extern "C"
12042 #endif
12043 /* We use char because int might match the return type of a gcc2
12044    builtin and then its argument prototype would still apply.  */
12045 char remove ();
12046 int
12047 main (void)
12048 {
12049 remove ();
12050   ;
12051   return 0;
12052 }
12053 _ACEOF
12054 rm -f conftest.$ac_objext conftest$ac_exeext
12055 if { (eval echo "$as_me:12055: \"$ac_link\"") >&5
12056   (eval $ac_link) 2>&5
12057   ac_status=$?
12058   echo "$as_me:12058: \$? = $ac_status" >&5
12059   (exit $ac_status); } &&
12060          { ac_try='test -s conftest$ac_exeext'
12061   { (eval echo "$as_me:12061: \"$ac_try\"") >&5
12062   (eval $ac_try) 2>&5
12063   ac_status=$?
12064   echo "$as_me:12064: \$? = $ac_status" >&5
12065   (exit $ac_status); }; }; then
12066   ac_cv_lib_posix_remove=yes
12067 else
12068   echo "$as_me: failed program was:" >&5
12069 cat conftest.$ac_ext >&5
12070 ac_cv_lib_posix_remove=no
12071 fi
12072 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12073 LIBS=$ac_check_lib_save_LIBS
12074 fi
12075 echo "$as_me:12075: result: $ac_cv_lib_posix_remove" >&5
12076 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12077 if test $ac_cv_lib_posix_remove = yes; then
12078   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12079 fi
12080
12081     fi
12082
12083     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12084     echo "$as_me:12084: checking for shmat" >&5
12085 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12086 if test "${ac_cv_func_shmat+set}" = set; then
12087   echo $ECHO_N "(cached) $ECHO_C" >&6
12088 else
12089   cat >conftest.$ac_ext <<_ACEOF
12090 #line 12090 "configure"
12091 #include "confdefs.h"
12092 #define shmat autoconf_temporary
12093 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12094 #undef shmat
12095
12096 #ifdef __cplusplus
12097 extern "C"
12098 #endif
12099
12100 /* We use char because int might match the return type of a gcc2
12101    builtin and then its argument prototype would still apply.  */
12102 char shmat (void);
12103
12104 int
12105 main (void)
12106 {
12107
12108 /* The GNU C library defines stubs for functions which it implements
12109     to always fail with ENOSYS.  Some functions are actually named
12110     something starting with __ and the normal name is an alias.  */
12111 #if defined (__stub_shmat) || defined (__stub___shmat)
12112 #error found stub for shmat
12113 #endif
12114
12115         return shmat ();
12116   ;
12117   return 0;
12118 }
12119 _ACEOF
12120 rm -f conftest.$ac_objext conftest$ac_exeext
12121 if { (eval echo "$as_me:12121: \"$ac_link\"") >&5
12122   (eval $ac_link) 2>&5
12123   ac_status=$?
12124   echo "$as_me:12124: \$? = $ac_status" >&5
12125   (exit $ac_status); } &&
12126          { ac_try='test -s conftest$ac_exeext'
12127   { (eval echo "$as_me:12127: \"$ac_try\"") >&5
12128   (eval $ac_try) 2>&5
12129   ac_status=$?
12130   echo "$as_me:12130: \$? = $ac_status" >&5
12131   (exit $ac_status); }; }; then
12132   ac_cv_func_shmat=yes
12133 else
12134   echo "$as_me: failed program was:" >&5
12135 cat conftest.$ac_ext >&5
12136 ac_cv_func_shmat=no
12137 fi
12138 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12139 fi
12140 echo "$as_me:12140: result: $ac_cv_func_shmat" >&5
12141 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12142
12143     if test $ac_cv_func_shmat = no; then
12144       echo "$as_me:12144: checking for shmat in -lipc" >&5
12145 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12146 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12147   echo $ECHO_N "(cached) $ECHO_C" >&6
12148 else
12149   ac_check_lib_save_LIBS=$LIBS
12150 LIBS="-lipc  $LIBS"
12151 cat >conftest.$ac_ext <<_ACEOF
12152 #line 12152 "configure"
12153 #include "confdefs.h"
12154
12155 /* Override any gcc2 internal prototype to avoid an error.  */
12156 #ifdef __cplusplus
12157 extern "C"
12158 #endif
12159 /* We use char because int might match the return type of a gcc2
12160    builtin and then its argument prototype would still apply.  */
12161 char shmat ();
12162 int
12163 main (void)
12164 {
12165 shmat ();
12166   ;
12167   return 0;
12168 }
12169 _ACEOF
12170 rm -f conftest.$ac_objext conftest$ac_exeext
12171 if { (eval echo "$as_me:12171: \"$ac_link\"") >&5
12172   (eval $ac_link) 2>&5
12173   ac_status=$?
12174   echo "$as_me:12174: \$? = $ac_status" >&5
12175   (exit $ac_status); } &&
12176          { ac_try='test -s conftest$ac_exeext'
12177   { (eval echo "$as_me:12177: \"$ac_try\"") >&5
12178   (eval $ac_try) 2>&5
12179   ac_status=$?
12180   echo "$as_me:12180: \$? = $ac_status" >&5
12181   (exit $ac_status); }; }; then
12182   ac_cv_lib_ipc_shmat=yes
12183 else
12184   echo "$as_me: failed program was:" >&5
12185 cat conftest.$ac_ext >&5
12186 ac_cv_lib_ipc_shmat=no
12187 fi
12188 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12189 LIBS=$ac_check_lib_save_LIBS
12190 fi
12191 echo "$as_me:12191: result: $ac_cv_lib_ipc_shmat" >&5
12192 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12193 if test $ac_cv_lib_ipc_shmat = yes; then
12194   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12195 fi
12196
12197     fi
12198   fi
12199
12200   # Check for libraries that X11R6 Xt/Xaw programs need.
12201   ac_save_LDFLAGS=$LDFLAGS
12202   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12203   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12204   # check for ICE first), but we must link in the order -lSM -lICE or
12205   # we get undefined symbols.  So assume we have SM if we have ICE.
12206   # These have to be linked with before -lX11, unlike the other
12207   # libraries we check for below, so use a different variable.
12208   # John Interrante, Karl Berry
12209   echo "$as_me:12209: checking for IceConnectionNumber in -lICE" >&5
12210 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12211 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12212   echo $ECHO_N "(cached) $ECHO_C" >&6
12213 else
12214   ac_check_lib_save_LIBS=$LIBS
12215 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12216 cat >conftest.$ac_ext <<_ACEOF
12217 #line 12217 "configure"
12218 #include "confdefs.h"
12219
12220 /* Override any gcc2 internal prototype to avoid an error.  */
12221 #ifdef __cplusplus
12222 extern "C"
12223 #endif
12224 /* We use char because int might match the return type of a gcc2
12225    builtin and then its argument prototype would still apply.  */
12226 char IceConnectionNumber ();
12227 int
12228 main (void)
12229 {
12230 IceConnectionNumber ();
12231   ;
12232   return 0;
12233 }
12234 _ACEOF
12235 rm -f conftest.$ac_objext conftest$ac_exeext
12236 if { (eval echo "$as_me:12236: \"$ac_link\"") >&5
12237   (eval $ac_link) 2>&5
12238   ac_status=$?
12239   echo "$as_me:12239: \$? = $ac_status" >&5
12240   (exit $ac_status); } &&
12241          { ac_try='test -s conftest$ac_exeext'
12242   { (eval echo "$as_me:12242: \"$ac_try\"") >&5
12243   (eval $ac_try) 2>&5
12244   ac_status=$?
12245   echo "$as_me:12245: \$? = $ac_status" >&5
12246   (exit $ac_status); }; }; then
12247   ac_cv_lib_ICE_IceConnectionNumber=yes
12248 else
12249   echo "$as_me: failed program was:" >&5
12250 cat conftest.$ac_ext >&5
12251 ac_cv_lib_ICE_IceConnectionNumber=no
12252 fi
12253 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12254 LIBS=$ac_check_lib_save_LIBS
12255 fi
12256 echo "$as_me:12256: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12257 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12258 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12259   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12260 fi
12261
12262   LDFLAGS=$ac_save_LDFLAGS
12263
12264 fi
12265
12266 cf_x_athena=${cf_x_athena:-Xaw}
12267
12268 echo "$as_me:12268: checking if you want to link with Xaw 3d library" >&5
12269 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12270 withval=
12271
12272 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12273 if test "${with_Xaw3d+set}" = set; then
12274   withval="$with_Xaw3d"
12275
12276 fi;
12277 if test "$withval" = yes ; then
12278         cf_x_athena=Xaw3d
12279         echo "$as_me:12279: result: yes" >&5
12280 echo "${ECHO_T}yes" >&6
12281 else
12282         echo "$as_me:12282: result: no" >&5
12283 echo "${ECHO_T}no" >&6
12284 fi
12285
12286 echo "$as_me:12286: checking if you want to link with Xaw 3d xft library" >&5
12287 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12288 withval=
12289
12290 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12291 if test "${with_Xaw3dxft+set}" = set; then
12292   withval="$with_Xaw3dxft"
12293
12294 fi;
12295 if test "$withval" = yes ; then
12296         cf_x_athena=Xaw3dxft
12297         echo "$as_me:12297: result: yes" >&5
12298 echo "${ECHO_T}yes" >&6
12299 else
12300         echo "$as_me:12300: result: no" >&5
12301 echo "${ECHO_T}no" >&6
12302 fi
12303
12304 echo "$as_me:12304: checking if you want to link with neXT Athena library" >&5
12305 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12306 withval=
12307
12308 # Check whether --with-neXtaw or --without-neXtaw was given.
12309 if test "${with_neXtaw+set}" = set; then
12310   withval="$with_neXtaw"
12311
12312 fi;
12313 if test "$withval" = yes ; then
12314         cf_x_athena=neXtaw
12315         echo "$as_me:12315: result: yes" >&5
12316 echo "${ECHO_T}yes" >&6
12317 else
12318         echo "$as_me:12318: result: no" >&5
12319 echo "${ECHO_T}no" >&6
12320 fi
12321
12322 echo "$as_me:12322: checking if you want to link with Athena-Plus library" >&5
12323 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12324 withval=
12325
12326 # Check whether --with-XawPlus or --without-XawPlus was given.
12327 if test "${with_XawPlus+set}" = set; then
12328   withval="$with_XawPlus"
12329
12330 fi;
12331 if test "$withval" = yes ; then
12332         cf_x_athena=XawPlus
12333         echo "$as_me:12333: result: yes" >&5
12334 echo "${ECHO_T}yes" >&6
12335 else
12336         echo "$as_me:12336: result: no" >&5
12337 echo "${ECHO_T}no" >&6
12338 fi
12339
12340 cf_x_athena_lib=""
12341
12342 if test "$PKG_CONFIG" != none ; then
12343         cf_athena_list=
12344         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12345         for cf_athena_pkg in \
12346                 $cf_athena_list \
12347                 ${cf_x_athena} \
12348                 ${cf_x_athena}-devel \
12349                 lib${cf_x_athena} \
12350                 lib${cf_x_athena}-devel
12351         do
12352
12353 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12354         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12355
12356 echo "${as_me:-configure}:12356: testing found package $cf_athena_pkg ..." 1>&5
12357
12358         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12359         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12360         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12361
12362 echo "${as_me:-configure}:12362: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12363
12364         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12365
12366 echo "${as_me:-configure}:12366: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12367
12368 cf_fix_cppflags=no
12369 cf_new_cflags=
12370 cf_new_cppflags=
12371 cf_new_extra_cppflags=
12372
12373 for cf_add_cflags in $cf_pkgconfig_incs
12374 do
12375 case $cf_fix_cppflags in
12376 (no)
12377         case $cf_add_cflags in
12378         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12379                 case $cf_add_cflags in
12380                 (-D*)
12381                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12382
12383                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12384                                 && test -z "${cf_tst_cflags}" \
12385                                 && cf_fix_cppflags=yes
12386
12387                         if test $cf_fix_cppflags = yes ; then
12388
12389         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12390         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12391
12392                                 continue
12393                         elif test "${cf_tst_cflags}" = "\"'" ; then
12394
12395         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12396         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12397
12398                                 continue
12399                         fi
12400                         ;;
12401                 esac
12402                 case "$CPPFLAGS" in
12403                 (*$cf_add_cflags)
12404                         ;;
12405                 (*)
12406                         case $cf_add_cflags in
12407                         (-D*)
12408                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12409
12410 CPPFLAGS=`echo "$CPPFLAGS" | \
12411         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12412                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12413
12414                                 ;;
12415                         esac
12416
12417         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12418         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12419
12420                         ;;
12421                 esac
12422                 ;;
12423         (*)
12424
12425         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12426         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12427
12428                 ;;
12429         esac
12430         ;;
12431 (yes)
12432
12433         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12434         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12435
12436         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12437
12438         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12439                 && test -z "${cf_tst_cflags}" \
12440                 && cf_fix_cppflags=no
12441         ;;
12442 esac
12443 done
12444
12445 if test -n "$cf_new_cflags" ; then
12446
12447         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12448         CFLAGS="${CFLAGS}$cf_new_cflags"
12449
12450 fi
12451
12452 if test -n "$cf_new_cppflags" ; then
12453
12454         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12455         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12456
12457 fi
12458
12459 if test -n "$cf_new_extra_cppflags" ; then
12460
12461         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12462         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12463
12464 fi
12465
12466 cf_add_libs="$cf_pkgconfig_libs"
12467 # Filter out duplicates - this happens with badly-designed ".pc" files...
12468 for cf_add_1lib in $LIBS
12469 do
12470         for cf_add_2lib in $cf_add_libs
12471         do
12472                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12473                 then
12474                         cf_add_1lib=
12475                         break
12476                 fi
12477         done
12478         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12479 done
12480 LIBS="$cf_add_libs"
12481
12482                         cf_x_athena_lib="$cf_pkgconfig_libs"
12483
12484 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12485
12486                         cat >>confdefs.h <<EOF
12487 #define $cf_x_athena_LIBS 1
12488 EOF
12489
12490         for cf_trim_lib in Xmu Xt X11
12491         do
12492                 case "$LIBS" in
12493                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12494                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12495                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12496
12497 echo "${as_me:-configure}:12497: testing ..trimmed $LIBS ..." 1>&5
12498
12499                         ;;
12500                 esac
12501         done
12502
12503 echo "$as_me:12503: checking for usable $cf_x_athena/Xmu package" >&5
12504 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12505 if test "${cf_cv_xaw_compat+set}" = set; then
12506   echo $ECHO_N "(cached) $ECHO_C" >&6
12507 else
12508
12509 cat >conftest.$ac_ext <<_ACEOF
12510 #line 12510 "configure"
12511 #include "confdefs.h"
12512
12513 #include <X11/Xmu/CharSet.h>
12514
12515 int
12516 main (void)
12517 {
12518
12519 int check = XmuCompareISOLatin1("big", "small")
12520
12521   ;
12522   return 0;
12523 }
12524 _ACEOF
12525 rm -f conftest.$ac_objext conftest$ac_exeext
12526 if { (eval echo "$as_me:12526: \"$ac_link\"") >&5
12527   (eval $ac_link) 2>&5
12528   ac_status=$?
12529   echo "$as_me:12529: \$? = $ac_status" >&5
12530   (exit $ac_status); } &&
12531          { ac_try='test -s conftest$ac_exeext'
12532   { (eval echo "$as_me:12532: \"$ac_try\"") >&5
12533   (eval $ac_try) 2>&5
12534   ac_status=$?
12535   echo "$as_me:12535: \$? = $ac_status" >&5
12536   (exit $ac_status); }; }; then
12537   cf_cv_xaw_compat=yes
12538 else
12539   echo "$as_me: failed program was:" >&5
12540 cat conftest.$ac_ext >&5
12541 cf_cv_xaw_compat=no
12542 fi
12543 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12544 fi
12545 echo "$as_me:12545: result: $cf_cv_xaw_compat" >&5
12546 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12547
12548                         if test "$cf_cv_xaw_compat" = no
12549                         then
12550                                 # workaround for broken ".pc" files...
12551                                 case "$cf_x_athena_lib" in
12552                                 (*-lXmu*)
12553                                         ;;
12554                                 (*)
12555                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12556
12557 echo "${as_me:-configure}:12557: testing work around broken package ..." 1>&5
12558
12559                                         cf_save_xmu="$LIBS"
12560                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12561
12562 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12563         test -n "$verbose" && echo "    found package xmu" 1>&6
12564
12565 echo "${as_me:-configure}:12565: testing found package xmu ..." 1>&5
12566
12567         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12568         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12569         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12570
12571 echo "${as_me:-configure}:12571: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12572
12573         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12574
12575 echo "${as_me:-configure}:12575: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12576
12577 cf_fix_cppflags=no
12578 cf_new_cflags=
12579 cf_new_cppflags=
12580 cf_new_extra_cppflags=
12581
12582 for cf_add_cflags in $cf_pkgconfig_incs
12583 do
12584 case $cf_fix_cppflags in
12585 (no)
12586         case $cf_add_cflags in
12587         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12588                 case $cf_add_cflags in
12589                 (-D*)
12590                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12591
12592                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12593                                 && test -z "${cf_tst_cflags}" \
12594                                 && cf_fix_cppflags=yes
12595
12596                         if test $cf_fix_cppflags = yes ; then
12597
12598         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12599         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12600
12601                                 continue
12602                         elif test "${cf_tst_cflags}" = "\"'" ; then
12603
12604         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12605         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12606
12607                                 continue
12608                         fi
12609                         ;;
12610                 esac
12611                 case "$CPPFLAGS" in
12612                 (*$cf_add_cflags)
12613                         ;;
12614                 (*)
12615                         case $cf_add_cflags in
12616                         (-D*)
12617                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12618
12619 CPPFLAGS=`echo "$CPPFLAGS" | \
12620         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12621                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12622
12623                                 ;;
12624                         esac
12625
12626         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12627         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12628
12629                         ;;
12630                 esac
12631                 ;;
12632         (*)
12633
12634         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12635         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12636
12637                 ;;
12638         esac
12639         ;;
12640 (yes)
12641
12642         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12643         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12644
12645         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12646
12647         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12648                 && test -z "${cf_tst_cflags}" \
12649                 && cf_fix_cppflags=no
12650         ;;
12651 esac
12652 done
12653
12654 if test -n "$cf_new_cflags" ; then
12655
12656         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12657         CFLAGS="${CFLAGS}$cf_new_cflags"
12658
12659 fi
12660
12661 if test -n "$cf_new_cppflags" ; then
12662
12663         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12664         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12665
12666 fi
12667
12668 if test -n "$cf_new_extra_cppflags" ; then
12669
12670         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12671         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12672
12673 fi
12674
12675 cf_add_libs="$cf_pkgconfig_libs"
12676 # Filter out duplicates - this happens with badly-designed ".pc" files...
12677 for cf_add_1lib in $LIBS
12678 do
12679         for cf_add_2lib in $cf_add_libs
12680         do
12681                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12682                 then
12683                         cf_add_1lib=
12684                         break
12685                 fi
12686         done
12687         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12688 done
12689 LIBS="$cf_add_libs"
12690
12691                                                         LIBS="$cf_save_xmu"
12692
12693 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12694
12695 echo "${as_me:-configure}:12695: testing ...before $LIBS ..." 1>&5
12696
12697 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
12698 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12699
12700 echo "${as_me:-configure}:12700: testing ...after  $LIBS ..." 1>&5
12701
12702 else
12703         cf_pkgconfig_incs=
12704         cf_pkgconfig_libs=
12705
12706 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12707
12708 echo "${as_me:-configure}:12708: testing ...before $LIBS ..." 1>&5
12709
12710 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
12711 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12712
12713 echo "${as_me:-configure}:12713: testing ...after  $LIBS ..." 1>&5
12714
12715 fi
12716
12717         for cf_trim_lib in Xmu Xt X11
12718         do
12719                 case "$LIBS" in
12720                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12721                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12722                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12723
12724 echo "${as_me:-configure}:12724: testing ..trimmed $LIBS ..." 1>&5
12725
12726                         ;;
12727                 esac
12728         done
12729
12730                                         ;;
12731                                 esac
12732                         fi
12733
12734                         break
12735 else
12736         cf_pkgconfig_incs=
12737         cf_pkgconfig_libs=
12738         :
12739 fi
12740
12741         done
12742 fi
12743
12744 if test -z "$cf_x_athena_lib" ; then
12745
12746 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
12747         test -n "$verbose" && echo "    found package Xext" 1>&6
12748
12749 echo "${as_me:-configure}:12749: testing found package Xext ..." 1>&5
12750
12751         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
12752         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
12753         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
12754
12755 echo "${as_me:-configure}:12755: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12756
12757         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
12758
12759 echo "${as_me:-configure}:12759: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
12760
12761 cf_fix_cppflags=no
12762 cf_new_cflags=
12763 cf_new_cppflags=
12764 cf_new_extra_cppflags=
12765
12766 for cf_add_cflags in $cf_pkgconfig_incs
12767 do
12768 case $cf_fix_cppflags in
12769 (no)
12770         case $cf_add_cflags in
12771         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12772                 case $cf_add_cflags in
12773                 (-D*)
12774                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12775
12776                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12777                                 && test -z "${cf_tst_cflags}" \
12778                                 && cf_fix_cppflags=yes
12779
12780                         if test $cf_fix_cppflags = yes ; then
12781
12782         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12783         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12784
12785                                 continue
12786                         elif test "${cf_tst_cflags}" = "\"'" ; then
12787
12788         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12789         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12790
12791                                 continue
12792                         fi
12793                         ;;
12794                 esac
12795                 case "$CPPFLAGS" in
12796                 (*$cf_add_cflags)
12797                         ;;
12798                 (*)
12799                         case $cf_add_cflags in
12800                         (-D*)
12801                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12802
12803 CPPFLAGS=`echo "$CPPFLAGS" | \
12804         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12805                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12806
12807                                 ;;
12808                         esac
12809
12810         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12811         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12812
12813                         ;;
12814                 esac
12815                 ;;
12816         (*)
12817
12818         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12819         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12820
12821                 ;;
12822         esac
12823         ;;
12824 (yes)
12825
12826         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12827         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12828
12829         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12830
12831         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12832                 && test -z "${cf_tst_cflags}" \
12833                 && cf_fix_cppflags=no
12834         ;;
12835 esac
12836 done
12837
12838 if test -n "$cf_new_cflags" ; then
12839
12840         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12841         CFLAGS="${CFLAGS}$cf_new_cflags"
12842
12843 fi
12844
12845 if test -n "$cf_new_cppflags" ; then
12846
12847         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12848         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12849
12850 fi
12851
12852 if test -n "$cf_new_extra_cppflags" ; then
12853
12854         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12855         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12856
12857 fi
12858
12859 cf_add_libs="$cf_pkgconfig_libs"
12860 # Filter out duplicates - this happens with badly-designed ".pc" files...
12861 for cf_add_1lib in $LIBS
12862 do
12863         for cf_add_2lib in $cf_add_libs
12864         do
12865                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12866                 then
12867                         cf_add_1lib=
12868                         break
12869                 fi
12870         done
12871         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12872 done
12873 LIBS="$cf_add_libs"
12874
12875         :
12876 else
12877         cf_pkgconfig_incs=
12878         cf_pkgconfig_libs=
12879
12880         echo "$as_me:12880: checking for XextCreateExtension in -lXext" >&5
12881 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
12882 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
12883   echo $ECHO_N "(cached) $ECHO_C" >&6
12884 else
12885   ac_check_lib_save_LIBS=$LIBS
12886 LIBS="-lXext  $LIBS"
12887 cat >conftest.$ac_ext <<_ACEOF
12888 #line 12888 "configure"
12889 #include "confdefs.h"
12890
12891 /* Override any gcc2 internal prototype to avoid an error.  */
12892 #ifdef __cplusplus
12893 extern "C"
12894 #endif
12895 /* We use char because int might match the return type of a gcc2
12896    builtin and then its argument prototype would still apply.  */
12897 char XextCreateExtension ();
12898 int
12899 main (void)
12900 {
12901 XextCreateExtension ();
12902   ;
12903   return 0;
12904 }
12905 _ACEOF
12906 rm -f conftest.$ac_objext conftest$ac_exeext
12907 if { (eval echo "$as_me:12907: \"$ac_link\"") >&5
12908   (eval $ac_link) 2>&5
12909   ac_status=$?
12910   echo "$as_me:12910: \$? = $ac_status" >&5
12911   (exit $ac_status); } &&
12912          { ac_try='test -s conftest$ac_exeext'
12913   { (eval echo "$as_me:12913: \"$ac_try\"") >&5
12914   (eval $ac_try) 2>&5
12915   ac_status=$?
12916   echo "$as_me:12916: \$? = $ac_status" >&5
12917   (exit $ac_status); }; }; then
12918   ac_cv_lib_Xext_XextCreateExtension=yes
12919 else
12920   echo "$as_me: failed program was:" >&5
12921 cat conftest.$ac_ext >&5
12922 ac_cv_lib_Xext_XextCreateExtension=no
12923 fi
12924 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12925 LIBS=$ac_check_lib_save_LIBS
12926 fi
12927 echo "$as_me:12927: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
12928 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
12929 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
12930
12931 cf_add_libs="-lXext"
12932 # Filter out duplicates - this happens with badly-designed ".pc" files...
12933 for cf_add_1lib in $LIBS
12934 do
12935         for cf_add_2lib in $cf_add_libs
12936         do
12937                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12938                 then
12939                         cf_add_1lib=
12940                         break
12941                 fi
12942         done
12943         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12944 done
12945 LIBS="$cf_add_libs"
12946
12947 fi
12948
12949 fi
12950
12951 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
12952 # in some cases has installed dummy files in the former, other cases replaced
12953 # it with a link to the new location).  This complicates the configure script.
12954 # Check for that pitfall, and recover using pkg-config
12955 #
12956 # If none of these are set, the configuration is almost certainly broken.
12957 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
12958 then
12959
12960 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12961         test -n "$verbose" && echo "    found package x11" 1>&6
12962
12963 echo "${as_me:-configure}:12963: testing found package x11 ..." 1>&5
12964
12965         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12966         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12967         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12968
12969 echo "${as_me:-configure}:12969: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12970
12971         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12972
12973 echo "${as_me:-configure}:12973: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12974
12975 cf_fix_cppflags=no
12976 cf_new_cflags=
12977 cf_new_cppflags=
12978 cf_new_extra_cppflags=
12979
12980 for cf_add_cflags in $cf_pkgconfig_incs
12981 do
12982 case $cf_fix_cppflags in
12983 (no)
12984         case $cf_add_cflags in
12985         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12986                 case $cf_add_cflags in
12987                 (-D*)
12988                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12989
12990                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12991                                 && test -z "${cf_tst_cflags}" \
12992                                 && cf_fix_cppflags=yes
12993
12994                         if test $cf_fix_cppflags = yes ; then
12995
12996         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12997         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12998
12999                                 continue
13000                         elif test "${cf_tst_cflags}" = "\"'" ; then
13001
13002         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13003         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13004
13005                                 continue
13006                         fi
13007                         ;;
13008                 esac
13009                 case "$CPPFLAGS" in
13010                 (*$cf_add_cflags)
13011                         ;;
13012                 (*)
13013                         case $cf_add_cflags in
13014                         (-D*)
13015                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13016
13017 CPPFLAGS=`echo "$CPPFLAGS" | \
13018         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13019                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13020
13021                                 ;;
13022                         esac
13023
13024         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13025         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13026
13027                         ;;
13028                 esac
13029                 ;;
13030         (*)
13031
13032         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13033         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13034
13035                 ;;
13036         esac
13037         ;;
13038 (yes)
13039
13040         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13041         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13042
13043         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13044
13045         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13046                 && test -z "${cf_tst_cflags}" \
13047                 && cf_fix_cppflags=no
13048         ;;
13049 esac
13050 done
13051
13052 if test -n "$cf_new_cflags" ; then
13053
13054         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13055         CFLAGS="${CFLAGS}$cf_new_cflags"
13056
13057 fi
13058
13059 if test -n "$cf_new_cppflags" ; then
13060
13061         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13062         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13063
13064 fi
13065
13066 if test -n "$cf_new_extra_cppflags" ; then
13067
13068         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13069         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13070
13071 fi
13072
13073 cf_add_libs="$cf_pkgconfig_libs"
13074 # Filter out duplicates - this happens with badly-designed ".pc" files...
13075 for cf_add_1lib in $LIBS
13076 do
13077         for cf_add_2lib in $cf_add_libs
13078         do
13079                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13080                 then
13081                         cf_add_1lib=
13082                         break
13083                 fi
13084         done
13085         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13086 done
13087 LIBS="$cf_add_libs"
13088
13089         :
13090 else
13091         cf_pkgconfig_incs=
13092         cf_pkgconfig_libs=
13093         { echo "$as_me:13093: WARNING: unable to find X11 library" >&5
13094 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13095 fi
13096
13097 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13098         test -n "$verbose" && echo "    found package ice" 1>&6
13099
13100 echo "${as_me:-configure}:13100: testing found package ice ..." 1>&5
13101
13102         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13103         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13104         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13105
13106 echo "${as_me:-configure}:13106: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13107
13108         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13109
13110 echo "${as_me:-configure}:13110: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13111
13112 cf_fix_cppflags=no
13113 cf_new_cflags=
13114 cf_new_cppflags=
13115 cf_new_extra_cppflags=
13116
13117 for cf_add_cflags in $cf_pkgconfig_incs
13118 do
13119 case $cf_fix_cppflags in
13120 (no)
13121         case $cf_add_cflags in
13122         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13123                 case $cf_add_cflags in
13124                 (-D*)
13125                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13126
13127                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13128                                 && test -z "${cf_tst_cflags}" \
13129                                 && cf_fix_cppflags=yes
13130
13131                         if test $cf_fix_cppflags = yes ; then
13132
13133         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13134         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13135
13136                                 continue
13137                         elif test "${cf_tst_cflags}" = "\"'" ; then
13138
13139         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13140         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13141
13142                                 continue
13143                         fi
13144                         ;;
13145                 esac
13146                 case "$CPPFLAGS" in
13147                 (*$cf_add_cflags)
13148                         ;;
13149                 (*)
13150                         case $cf_add_cflags in
13151                         (-D*)
13152                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13153
13154 CPPFLAGS=`echo "$CPPFLAGS" | \
13155         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13156                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13157
13158                                 ;;
13159                         esac
13160
13161         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13162         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13163
13164                         ;;
13165                 esac
13166                 ;;
13167         (*)
13168
13169         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13170         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13171
13172                 ;;
13173         esac
13174         ;;
13175 (yes)
13176
13177         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13178         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13179
13180         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13181
13182         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13183                 && test -z "${cf_tst_cflags}" \
13184                 && cf_fix_cppflags=no
13185         ;;
13186 esac
13187 done
13188
13189 if test -n "$cf_new_cflags" ; then
13190
13191         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13192         CFLAGS="${CFLAGS}$cf_new_cflags"
13193
13194 fi
13195
13196 if test -n "$cf_new_cppflags" ; then
13197
13198         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13199         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13200
13201 fi
13202
13203 if test -n "$cf_new_extra_cppflags" ; then
13204
13205         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13206         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13207
13208 fi
13209
13210 cf_add_libs="$cf_pkgconfig_libs"
13211 # Filter out duplicates - this happens with badly-designed ".pc" files...
13212 for cf_add_1lib in $LIBS
13213 do
13214         for cf_add_2lib in $cf_add_libs
13215         do
13216                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13217                 then
13218                         cf_add_1lib=
13219                         break
13220                 fi
13221         done
13222         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13223 done
13224 LIBS="$cf_add_libs"
13225
13226         :
13227 else
13228         cf_pkgconfig_incs=
13229         cf_pkgconfig_libs=
13230         { echo "$as_me:13230: WARNING: unable to find ICE library" >&5
13231 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13232 fi
13233
13234 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13235         test -n "$verbose" && echo "    found package sm" 1>&6
13236
13237 echo "${as_me:-configure}:13237: testing found package sm ..." 1>&5
13238
13239         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13240         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13241         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13242
13243 echo "${as_me:-configure}:13243: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13244
13245         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13246
13247 echo "${as_me:-configure}:13247: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13248
13249 cf_fix_cppflags=no
13250 cf_new_cflags=
13251 cf_new_cppflags=
13252 cf_new_extra_cppflags=
13253
13254 for cf_add_cflags in $cf_pkgconfig_incs
13255 do
13256 case $cf_fix_cppflags in
13257 (no)
13258         case $cf_add_cflags in
13259         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13260                 case $cf_add_cflags in
13261                 (-D*)
13262                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13263
13264                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13265                                 && test -z "${cf_tst_cflags}" \
13266                                 && cf_fix_cppflags=yes
13267
13268                         if test $cf_fix_cppflags = yes ; then
13269
13270         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13271         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13272
13273                                 continue
13274                         elif test "${cf_tst_cflags}" = "\"'" ; then
13275
13276         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13277         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13278
13279                                 continue
13280                         fi
13281                         ;;
13282                 esac
13283                 case "$CPPFLAGS" in
13284                 (*$cf_add_cflags)
13285                         ;;
13286                 (*)
13287                         case $cf_add_cflags in
13288                         (-D*)
13289                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13290
13291 CPPFLAGS=`echo "$CPPFLAGS" | \
13292         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13293                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13294
13295                                 ;;
13296                         esac
13297
13298         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13299         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13300
13301                         ;;
13302                 esac
13303                 ;;
13304         (*)
13305
13306         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13307         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13308
13309                 ;;
13310         esac
13311         ;;
13312 (yes)
13313
13314         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13315         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13316
13317         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13318
13319         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13320                 && test -z "${cf_tst_cflags}" \
13321                 && cf_fix_cppflags=no
13322         ;;
13323 esac
13324 done
13325
13326 if test -n "$cf_new_cflags" ; then
13327
13328         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13329         CFLAGS="${CFLAGS}$cf_new_cflags"
13330
13331 fi
13332
13333 if test -n "$cf_new_cppflags" ; then
13334
13335         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13336         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13337
13338 fi
13339
13340 if test -n "$cf_new_extra_cppflags" ; then
13341
13342         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13343         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13344
13345 fi
13346
13347 cf_add_libs="$cf_pkgconfig_libs"
13348 # Filter out duplicates - this happens with badly-designed ".pc" files...
13349 for cf_add_1lib in $LIBS
13350 do
13351         for cf_add_2lib in $cf_add_libs
13352         do
13353                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13354                 then
13355                         cf_add_1lib=
13356                         break
13357                 fi
13358         done
13359         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13360 done
13361 LIBS="$cf_add_libs"
13362
13363         :
13364 else
13365         cf_pkgconfig_incs=
13366         cf_pkgconfig_libs=
13367         { echo "$as_me:13367: WARNING: unable to find SM library" >&5
13368 echo "$as_me: WARNING: unable to find SM library" >&2;}
13369 fi
13370
13371 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13372         test -n "$verbose" && echo "    found package xt" 1>&6
13373
13374 echo "${as_me:-configure}:13374: testing found package xt ..." 1>&5
13375
13376         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13377         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13378         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13379
13380 echo "${as_me:-configure}:13380: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13381
13382         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13383
13384 echo "${as_me:-configure}:13384: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13385
13386 cf_fix_cppflags=no
13387 cf_new_cflags=
13388 cf_new_cppflags=
13389 cf_new_extra_cppflags=
13390
13391 for cf_add_cflags in $cf_pkgconfig_incs
13392 do
13393 case $cf_fix_cppflags in
13394 (no)
13395         case $cf_add_cflags in
13396         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13397                 case $cf_add_cflags in
13398                 (-D*)
13399                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13400
13401                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13402                                 && test -z "${cf_tst_cflags}" \
13403                                 && cf_fix_cppflags=yes
13404
13405                         if test $cf_fix_cppflags = yes ; then
13406
13407         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13408         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13409
13410                                 continue
13411                         elif test "${cf_tst_cflags}" = "\"'" ; then
13412
13413         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13414         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13415
13416                                 continue
13417                         fi
13418                         ;;
13419                 esac
13420                 case "$CPPFLAGS" in
13421                 (*$cf_add_cflags)
13422                         ;;
13423                 (*)
13424                         case $cf_add_cflags in
13425                         (-D*)
13426                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13427
13428 CPPFLAGS=`echo "$CPPFLAGS" | \
13429         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13430                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13431
13432                                 ;;
13433                         esac
13434
13435         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13436         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13437
13438                         ;;
13439                 esac
13440                 ;;
13441         (*)
13442
13443         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13444         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13445
13446                 ;;
13447         esac
13448         ;;
13449 (yes)
13450
13451         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13452         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13453
13454         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13455
13456         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13457                 && test -z "${cf_tst_cflags}" \
13458                 && cf_fix_cppflags=no
13459         ;;
13460 esac
13461 done
13462
13463 if test -n "$cf_new_cflags" ; then
13464
13465         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13466         CFLAGS="${CFLAGS}$cf_new_cflags"
13467
13468 fi
13469
13470 if test -n "$cf_new_cppflags" ; then
13471
13472         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13473         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13474
13475 fi
13476
13477 if test -n "$cf_new_extra_cppflags" ; then
13478
13479         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13480         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13481
13482 fi
13483
13484 cf_add_libs="$cf_pkgconfig_libs"
13485 # Filter out duplicates - this happens with badly-designed ".pc" files...
13486 for cf_add_1lib in $LIBS
13487 do
13488         for cf_add_2lib in $cf_add_libs
13489         do
13490                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13491                 then
13492                         cf_add_1lib=
13493                         break
13494                 fi
13495         done
13496         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13497 done
13498 LIBS="$cf_add_libs"
13499
13500         :
13501 else
13502         cf_pkgconfig_incs=
13503         cf_pkgconfig_libs=
13504         { echo "$as_me:13504: WARNING: unable to find Xt library" >&5
13505 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13506 fi
13507
13508 fi
13509
13510 cf_have_X_LIBS=no
13511
13512 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13513         test -n "$verbose" && echo "    found package xt" 1>&6
13514
13515 echo "${as_me:-configure}:13515: testing found package xt ..." 1>&5
13516
13517         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13518         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13519         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13520
13521 echo "${as_me:-configure}:13521: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13522
13523         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13524
13525 echo "${as_me:-configure}:13525: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13526
13527 cf_fix_cppflags=no
13528 cf_new_cflags=
13529 cf_new_cppflags=
13530 cf_new_extra_cppflags=
13531
13532 for cf_add_cflags in $cf_pkgconfig_incs
13533 do
13534 case $cf_fix_cppflags in
13535 (no)
13536         case $cf_add_cflags in
13537         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13538                 case $cf_add_cflags in
13539                 (-D*)
13540                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13541
13542                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13543                                 && test -z "${cf_tst_cflags}" \
13544                                 && cf_fix_cppflags=yes
13545
13546                         if test $cf_fix_cppflags = yes ; then
13547
13548         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13549         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13550
13551                                 continue
13552                         elif test "${cf_tst_cflags}" = "\"'" ; then
13553
13554         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13555         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13556
13557                                 continue
13558                         fi
13559                         ;;
13560                 esac
13561                 case "$CPPFLAGS" in
13562                 (*$cf_add_cflags)
13563                         ;;
13564                 (*)
13565                         case $cf_add_cflags in
13566                         (-D*)
13567                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13568
13569 CPPFLAGS=`echo "$CPPFLAGS" | \
13570         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13571                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13572
13573                                 ;;
13574                         esac
13575
13576         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13577         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13578
13579                         ;;
13580                 esac
13581                 ;;
13582         (*)
13583
13584         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13585         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13586
13587                 ;;
13588         esac
13589         ;;
13590 (yes)
13591
13592         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13593         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13594
13595         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13596
13597         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13598                 && test -z "${cf_tst_cflags}" \
13599                 && cf_fix_cppflags=no
13600         ;;
13601 esac
13602 done
13603
13604 if test -n "$cf_new_cflags" ; then
13605
13606         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13607         CFLAGS="${CFLAGS}$cf_new_cflags"
13608
13609 fi
13610
13611 if test -n "$cf_new_cppflags" ; then
13612
13613         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13614         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13615
13616 fi
13617
13618 if test -n "$cf_new_extra_cppflags" ; then
13619
13620         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13621         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13622
13623 fi
13624
13625 cf_add_libs="$cf_pkgconfig_libs"
13626 # Filter out duplicates - this happens with badly-designed ".pc" files...
13627 for cf_add_1lib in $LIBS
13628 do
13629         for cf_add_2lib in $cf_add_libs
13630         do
13631                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13632                 then
13633                         cf_add_1lib=
13634                         break
13635                 fi
13636         done
13637         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13638 done
13639 LIBS="$cf_add_libs"
13640
13641         case "x$LIBS" in
13642         (*-lX11*)
13643                 ;;
13644         (*)
13645 # we have an "xt" package, but it may omit Xt's dependency on X11
13646 echo "$as_me:13646: checking for usable X dependency" >&5
13647 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
13648 if test "${cf_cv_xt_x11_compat+set}" = set; then
13649   echo $ECHO_N "(cached) $ECHO_C" >&6
13650 else
13651
13652 cat >conftest.$ac_ext <<_ACEOF
13653 #line 13653 "configure"
13654 #include "confdefs.h"
13655
13656 #include <X11/Xlib.h>
13657
13658 int
13659 main (void)
13660 {
13661
13662         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
13663         int rc2 = XClearWindow((Display*) 0, (Window) 0);
13664         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
13665         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
13666
13667   ;
13668   return 0;
13669 }
13670 _ACEOF
13671 rm -f conftest.$ac_objext conftest$ac_exeext
13672 if { (eval echo "$as_me:13672: \"$ac_link\"") >&5
13673   (eval $ac_link) 2>&5
13674   ac_status=$?
13675   echo "$as_me:13675: \$? = $ac_status" >&5
13676   (exit $ac_status); } &&
13677          { ac_try='test -s conftest$ac_exeext'
13678   { (eval echo "$as_me:13678: \"$ac_try\"") >&5
13679   (eval $ac_try) 2>&5
13680   ac_status=$?
13681   echo "$as_me:13681: \$? = $ac_status" >&5
13682   (exit $ac_status); }; }; then
13683   cf_cv_xt_x11_compat=yes
13684 else
13685   echo "$as_me: failed program was:" >&5
13686 cat conftest.$ac_ext >&5
13687 cf_cv_xt_x11_compat=no
13688 fi
13689 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13690 fi
13691 echo "$as_me:13691: result: $cf_cv_xt_x11_compat" >&5
13692 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
13693                 if test "$cf_cv_xt_x11_compat" = no
13694                 then
13695                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
13696
13697 echo "${as_me:-configure}:13697: testing work around broken X11 dependency ..." 1>&5
13698
13699                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
13700
13701 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13702         test -n "$verbose" && echo "    found package x11" 1>&6
13703
13704 echo "${as_me:-configure}:13704: testing found package x11 ..." 1>&5
13705
13706         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13707         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13708         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13709
13710 echo "${as_me:-configure}:13710: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13711
13712         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13713
13714 echo "${as_me:-configure}:13714: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13715
13716 cf_fix_cppflags=no
13717 cf_new_cflags=
13718 cf_new_cppflags=
13719 cf_new_extra_cppflags=
13720
13721 for cf_add_cflags in $cf_pkgconfig_incs
13722 do
13723 case $cf_fix_cppflags in
13724 (no)
13725         case $cf_add_cflags in
13726         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13727                 case $cf_add_cflags in
13728                 (-D*)
13729                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13730
13731                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13732                                 && test -z "${cf_tst_cflags}" \
13733                                 && cf_fix_cppflags=yes
13734
13735                         if test $cf_fix_cppflags = yes ; then
13736
13737         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13738         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13739
13740                                 continue
13741                         elif test "${cf_tst_cflags}" = "\"'" ; then
13742
13743         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13744         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13745
13746                                 continue
13747                         fi
13748                         ;;
13749                 esac
13750                 case "$CPPFLAGS" in
13751                 (*$cf_add_cflags)
13752                         ;;
13753                 (*)
13754                         case $cf_add_cflags in
13755                         (-D*)
13756                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13757
13758 CPPFLAGS=`echo "$CPPFLAGS" | \
13759         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13760                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13761
13762                                 ;;
13763                         esac
13764
13765         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13766         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13767
13768                         ;;
13769                 esac
13770                 ;;
13771         (*)
13772
13773         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13774         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13775
13776                 ;;
13777         esac
13778         ;;
13779 (yes)
13780
13781         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13782         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13783
13784         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13785
13786         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13787                 && test -z "${cf_tst_cflags}" \
13788                 && cf_fix_cppflags=no
13789         ;;
13790 esac
13791 done
13792
13793 if test -n "$cf_new_cflags" ; then
13794
13795         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13796         CFLAGS="${CFLAGS}$cf_new_cflags"
13797
13798 fi
13799
13800 if test -n "$cf_new_cppflags" ; then
13801
13802         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13803         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13804
13805 fi
13806
13807 if test -n "$cf_new_extra_cppflags" ; then
13808
13809         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13810         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13811
13812 fi
13813
13814 cf_add_libs="$cf_pkgconfig_libs"
13815 # Filter out duplicates - this happens with badly-designed ".pc" files...
13816 for cf_add_1lib in $LIBS
13817 do
13818         for cf_add_2lib in $cf_add_libs
13819         do
13820                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13821                 then
13822                         cf_add_1lib=
13823                         break
13824                 fi
13825         done
13826         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13827 done
13828 LIBS="$cf_add_libs"
13829
13830         :
13831 else
13832         cf_pkgconfig_incs=
13833         cf_pkgconfig_libs=
13834
13835 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13836
13837 echo "${as_me:-configure}:13837: testing ...before $LIBS ..." 1>&5
13838
13839 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
13840 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13841
13842 echo "${as_me:-configure}:13842: testing ...after  $LIBS ..." 1>&5
13843
13844 fi
13845
13846                 fi
13847                 ;;
13848         esac
13849
13850 echo "$as_me:13850: checking for usable X Toolkit package" >&5
13851 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
13852 if test "${cf_cv_xt_ice_compat+set}" = set; then
13853   echo $ECHO_N "(cached) $ECHO_C" >&6
13854 else
13855
13856 cat >conftest.$ac_ext <<_ACEOF
13857 #line 13857 "configure"
13858 #include "confdefs.h"
13859
13860 #include <X11/Shell.h>
13861
13862 int
13863 main (void)
13864 {
13865 int num = IceConnectionNumber(0)
13866
13867   ;
13868   return 0;
13869 }
13870 _ACEOF
13871 rm -f conftest.$ac_objext conftest$ac_exeext
13872 if { (eval echo "$as_me:13872: \"$ac_link\"") >&5
13873   (eval $ac_link) 2>&5
13874   ac_status=$?
13875   echo "$as_me:13875: \$? = $ac_status" >&5
13876   (exit $ac_status); } &&
13877          { ac_try='test -s conftest$ac_exeext'
13878   { (eval echo "$as_me:13878: \"$ac_try\"") >&5
13879   (eval $ac_try) 2>&5
13880   ac_status=$?
13881   echo "$as_me:13881: \$? = $ac_status" >&5
13882   (exit $ac_status); }; }; then
13883   cf_cv_xt_ice_compat=yes
13884 else
13885   echo "$as_me: failed program was:" >&5
13886 cat conftest.$ac_ext >&5
13887 cf_cv_xt_ice_compat=no
13888 fi
13889 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13890 fi
13891 echo "$as_me:13891: result: $cf_cv_xt_ice_compat" >&5
13892 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
13893
13894         if test "$cf_cv_xt_ice_compat" = no
13895         then
13896                 # workaround for broken ".pc" files used for X Toolkit.
13897                 case "x$X_PRE_LIBS" in
13898                 (*-lICE*)
13899                         case "x$LIBS" in
13900                         (*-lICE*)
13901                                 ;;
13902                         (*)
13903                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
13904
13905 echo "${as_me:-configure}:13905: testing work around broken ICE dependency ..." 1>&5
13906
13907 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13908         test -n "$verbose" && echo "    found package ice" 1>&6
13909
13910 echo "${as_me:-configure}:13910: testing found package ice ..." 1>&5
13911
13912         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13913         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13914         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13915
13916 echo "${as_me:-configure}:13916: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13917
13918         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13919
13920 echo "${as_me:-configure}:13920: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13921
13922 cf_fix_cppflags=no
13923 cf_new_cflags=
13924 cf_new_cppflags=
13925 cf_new_extra_cppflags=
13926
13927 for cf_add_cflags in $cf_pkgconfig_incs
13928 do
13929 case $cf_fix_cppflags in
13930 (no)
13931         case $cf_add_cflags in
13932         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13933                 case $cf_add_cflags in
13934                 (-D*)
13935                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13936
13937                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13938                                 && test -z "${cf_tst_cflags}" \
13939                                 && cf_fix_cppflags=yes
13940
13941                         if test $cf_fix_cppflags = yes ; then
13942
13943         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13944         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13945
13946                                 continue
13947                         elif test "${cf_tst_cflags}" = "\"'" ; then
13948
13949         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13950         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13951
13952                                 continue
13953                         fi
13954                         ;;
13955                 esac
13956                 case "$CPPFLAGS" in
13957                 (*$cf_add_cflags)
13958                         ;;
13959                 (*)
13960                         case $cf_add_cflags in
13961                         (-D*)
13962                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13963
13964 CPPFLAGS=`echo "$CPPFLAGS" | \
13965         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13966                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13967
13968                                 ;;
13969                         esac
13970
13971         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13972         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13973
13974                         ;;
13975                 esac
13976                 ;;
13977         (*)
13978
13979         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13980         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13981
13982                 ;;
13983         esac
13984         ;;
13985 (yes)
13986
13987         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13988         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13989
13990         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13991
13992         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13993                 && test -z "${cf_tst_cflags}" \
13994                 && cf_fix_cppflags=no
13995         ;;
13996 esac
13997 done
13998
13999 if test -n "$cf_new_cflags" ; then
14000
14001         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14002         CFLAGS="${CFLAGS}$cf_new_cflags"
14003
14004 fi
14005
14006 if test -n "$cf_new_cppflags" ; then
14007
14008         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14009         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14010
14011 fi
14012
14013 if test -n "$cf_new_extra_cppflags" ; then
14014
14015         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14016         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14017
14018 fi
14019
14020 cf_add_libs="$cf_pkgconfig_libs"
14021 # Filter out duplicates - this happens with badly-designed ".pc" files...
14022 for cf_add_1lib in $LIBS
14023 do
14024         for cf_add_2lib in $cf_add_libs
14025         do
14026                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14027                 then
14028                         cf_add_1lib=
14029                         break
14030                 fi
14031         done
14032         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14033 done
14034 LIBS="$cf_add_libs"
14035
14036 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
14037         test -n "$verbose" && echo "    found package sm" 1>&6
14038
14039 echo "${as_me:-configure}:14039: testing found package sm ..." 1>&5
14040
14041         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
14042         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
14043         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14044
14045 echo "${as_me:-configure}:14045: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14046
14047         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14048
14049 echo "${as_me:-configure}:14049: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14050
14051 cf_fix_cppflags=no
14052 cf_new_cflags=
14053 cf_new_cppflags=
14054 cf_new_extra_cppflags=
14055
14056 for cf_add_cflags in $cf_pkgconfig_incs
14057 do
14058 case $cf_fix_cppflags in
14059 (no)
14060         case $cf_add_cflags in
14061         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14062                 case $cf_add_cflags in
14063                 (-D*)
14064                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14065
14066                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14067                                 && test -z "${cf_tst_cflags}" \
14068                                 && cf_fix_cppflags=yes
14069
14070                         if test $cf_fix_cppflags = yes ; then
14071
14072         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14073         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14074
14075                                 continue
14076                         elif test "${cf_tst_cflags}" = "\"'" ; then
14077
14078         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14079         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14080
14081                                 continue
14082                         fi
14083                         ;;
14084                 esac
14085                 case "$CPPFLAGS" in
14086                 (*$cf_add_cflags)
14087                         ;;
14088                 (*)
14089                         case $cf_add_cflags in
14090                         (-D*)
14091                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14092
14093 CPPFLAGS=`echo "$CPPFLAGS" | \
14094         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14095                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14096
14097                                 ;;
14098                         esac
14099
14100         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14101         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14102
14103                         ;;
14104                 esac
14105                 ;;
14106         (*)
14107
14108         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14109         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14110
14111                 ;;
14112         esac
14113         ;;
14114 (yes)
14115
14116         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14117         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14118
14119         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14120
14121         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14122                 && test -z "${cf_tst_cflags}" \
14123                 && cf_fix_cppflags=no
14124         ;;
14125 esac
14126 done
14127
14128 if test -n "$cf_new_cflags" ; then
14129
14130         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14131         CFLAGS="${CFLAGS}$cf_new_cflags"
14132
14133 fi
14134
14135 if test -n "$cf_new_cppflags" ; then
14136
14137         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14138         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14139
14140 fi
14141
14142 if test -n "$cf_new_extra_cppflags" ; then
14143
14144         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14145         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14146
14147 fi
14148
14149 cf_add_libs="$cf_pkgconfig_libs"
14150 # Filter out duplicates - this happens with badly-designed ".pc" files...
14151 for cf_add_1lib in $LIBS
14152 do
14153         for cf_add_2lib in $cf_add_libs
14154         do
14155                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14156                 then
14157                         cf_add_1lib=
14158                         break
14159                 fi
14160         done
14161         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14162 done
14163 LIBS="$cf_add_libs"
14164
14165         :
14166 else
14167         cf_pkgconfig_incs=
14168         cf_pkgconfig_libs=
14169         :
14170 fi
14171
14172 else
14173         cf_pkgconfig_incs=
14174         cf_pkgconfig_libs=
14175
14176 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14177
14178 echo "${as_me:-configure}:14178: testing ...before $LIBS ..." 1>&5
14179
14180 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14181 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14182
14183 echo "${as_me:-configure}:14183: testing ...after  $LIBS ..." 1>&5
14184
14185 fi
14186
14187                                 ;;
14188                         esac
14189                         ;;
14190                 esac
14191         fi
14192
14193         cf_have_X_LIBS=yes
14194
14195 else
14196         cf_pkgconfig_incs=
14197         cf_pkgconfig_libs=
14198
14199         LDFLAGS="$X_LIBS $LDFLAGS"
14200
14201 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14202
14203 echo "${as_me:-configure}:14203: testing checking additions to CFLAGS ..." 1>&5
14204
14205 cf_check_cflags="$CFLAGS"
14206 cf_check_cppflags="$CPPFLAGS"
14207
14208 cf_fix_cppflags=no
14209 cf_new_cflags=
14210 cf_new_cppflags=
14211 cf_new_extra_cppflags=
14212
14213 for cf_add_cflags in $X_CFLAGS
14214 do
14215 case $cf_fix_cppflags in
14216 (no)
14217         case $cf_add_cflags in
14218         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14219                 case $cf_add_cflags in
14220                 (-D*)
14221                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14222
14223                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14224                                 && test -z "${cf_tst_cflags}" \
14225                                 && cf_fix_cppflags=yes
14226
14227                         if test $cf_fix_cppflags = yes ; then
14228
14229         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14230         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14231
14232                                 continue
14233                         elif test "${cf_tst_cflags}" = "\"'" ; then
14234
14235         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14236         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14237
14238                                 continue
14239                         fi
14240                         ;;
14241                 esac
14242                 case "$CPPFLAGS" in
14243                 (*$cf_add_cflags)
14244                         ;;
14245                 (*)
14246                         case $cf_add_cflags in
14247                         (-D*)
14248                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14249
14250 CPPFLAGS=`echo "$CPPFLAGS" | \
14251         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14252                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14253
14254                                 ;;
14255                         esac
14256
14257         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14258         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14259
14260                         ;;
14261                 esac
14262                 ;;
14263         (*)
14264
14265         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14266         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14267
14268                 ;;
14269         esac
14270         ;;
14271 (yes)
14272
14273         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14274         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14275
14276         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14277
14278         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14279                 && test -z "${cf_tst_cflags}" \
14280                 && cf_fix_cppflags=no
14281         ;;
14282 esac
14283 done
14284
14285 if test -n "$cf_new_cflags" ; then
14286         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14287
14288 echo "${as_me:-configure}:14288: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14289
14290         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14291         CFLAGS="${CFLAGS}$cf_new_cflags"
14292
14293 fi
14294
14295 if test -n "$cf_new_cppflags" ; then
14296         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14297
14298 echo "${as_me:-configure}:14298: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14299
14300         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14301         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14302
14303 fi
14304
14305 if test -n "$cf_new_extra_cppflags" ; then
14306         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14307
14308 echo "${as_me:-configure}:14308: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14309
14310         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14311         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14312
14313 fi
14314
14315 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14316 cat >conftest.$ac_ext <<_ACEOF
14317 #line 14317 "configure"
14318 #include "confdefs.h"
14319 #include <stdio.h>
14320 int
14321 main (void)
14322 {
14323 printf("Hello world");
14324   ;
14325   return 0;
14326 }
14327 _ACEOF
14328 rm -f conftest.$ac_objext conftest$ac_exeext
14329 if { (eval echo "$as_me:14329: \"$ac_link\"") >&5
14330   (eval $ac_link) 2>&5
14331   ac_status=$?
14332   echo "$as_me:14332: \$? = $ac_status" >&5
14333   (exit $ac_status); } &&
14334          { ac_try='test -s conftest$ac_exeext'
14335   { (eval echo "$as_me:14335: \"$ac_try\"") >&5
14336   (eval $ac_try) 2>&5
14337   ac_status=$?
14338   echo "$as_me:14338: \$? = $ac_status" >&5
14339   (exit $ac_status); }; }; then
14340   :
14341 else
14342   echo "$as_me: failed program was:" >&5
14343 cat conftest.$ac_ext >&5
14344 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14345
14346 echo "${as_me:-configure}:14346: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14347
14348          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14349                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14350
14351 echo "${as_me:-configure}:14351: testing but keeping change to \$CPPFLAGS ..." 1>&5
14352
14353          fi
14354          CFLAGS="$cf_check_flags"
14355 fi
14356 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14357 fi
14358
14359         echo "$as_me:14359: checking for XOpenDisplay" >&5
14360 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14361 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14362   echo $ECHO_N "(cached) $ECHO_C" >&6
14363 else
14364   cat >conftest.$ac_ext <<_ACEOF
14365 #line 14365 "configure"
14366 #include "confdefs.h"
14367 #define XOpenDisplay autoconf_temporary
14368 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14369 #undef XOpenDisplay
14370
14371 #ifdef __cplusplus
14372 extern "C"
14373 #endif
14374
14375 /* We use char because int might match the return type of a gcc2
14376    builtin and then its argument prototype would still apply.  */
14377 char XOpenDisplay (void);
14378
14379 int
14380 main (void)
14381 {
14382
14383 /* The GNU C library defines stubs for functions which it implements
14384     to always fail with ENOSYS.  Some functions are actually named
14385     something starting with __ and the normal name is an alias.  */
14386 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14387 #error found stub for XOpenDisplay
14388 #endif
14389
14390         return XOpenDisplay ();
14391   ;
14392   return 0;
14393 }
14394 _ACEOF
14395 rm -f conftest.$ac_objext conftest$ac_exeext
14396 if { (eval echo "$as_me:14396: \"$ac_link\"") >&5
14397   (eval $ac_link) 2>&5
14398   ac_status=$?
14399   echo "$as_me:14399: \$? = $ac_status" >&5
14400   (exit $ac_status); } &&
14401          { ac_try='test -s conftest$ac_exeext'
14402   { (eval echo "$as_me:14402: \"$ac_try\"") >&5
14403   (eval $ac_try) 2>&5
14404   ac_status=$?
14405   echo "$as_me:14405: \$? = $ac_status" >&5
14406   (exit $ac_status); }; }; then
14407   ac_cv_func_XOpenDisplay=yes
14408 else
14409   echo "$as_me: failed program was:" >&5
14410 cat conftest.$ac_ext >&5
14411 ac_cv_func_XOpenDisplay=no
14412 fi
14413 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14414 fi
14415 echo "$as_me:14415: result: $ac_cv_func_XOpenDisplay" >&5
14416 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14417 if test $ac_cv_func_XOpenDisplay = yes; then
14418   :
14419 else
14420
14421         echo "$as_me:14421: checking for XOpenDisplay in -lX11" >&5
14422 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14423 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14424   echo $ECHO_N "(cached) $ECHO_C" >&6
14425 else
14426   ac_check_lib_save_LIBS=$LIBS
14427 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14428 cat >conftest.$ac_ext <<_ACEOF
14429 #line 14429 "configure"
14430 #include "confdefs.h"
14431
14432 /* Override any gcc2 internal prototype to avoid an error.  */
14433 #ifdef __cplusplus
14434 extern "C"
14435 #endif
14436 /* We use char because int might match the return type of a gcc2
14437    builtin and then its argument prototype would still apply.  */
14438 char XOpenDisplay ();
14439 int
14440 main (void)
14441 {
14442 XOpenDisplay ();
14443   ;
14444   return 0;
14445 }
14446 _ACEOF
14447 rm -f conftest.$ac_objext conftest$ac_exeext
14448 if { (eval echo "$as_me:14448: \"$ac_link\"") >&5
14449   (eval $ac_link) 2>&5
14450   ac_status=$?
14451   echo "$as_me:14451: \$? = $ac_status" >&5
14452   (exit $ac_status); } &&
14453          { ac_try='test -s conftest$ac_exeext'
14454   { (eval echo "$as_me:14454: \"$ac_try\"") >&5
14455   (eval $ac_try) 2>&5
14456   ac_status=$?
14457   echo "$as_me:14457: \$? = $ac_status" >&5
14458   (exit $ac_status); }; }; then
14459   ac_cv_lib_X11_XOpenDisplay=yes
14460 else
14461   echo "$as_me: failed program was:" >&5
14462 cat conftest.$ac_ext >&5
14463 ac_cv_lib_X11_XOpenDisplay=no
14464 fi
14465 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14466 LIBS=$ac_check_lib_save_LIBS
14467 fi
14468 echo "$as_me:14468: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14469 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14470 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14471
14472 cf_add_libs="-lX11"
14473 # Filter out duplicates - this happens with badly-designed ".pc" files...
14474 for cf_add_1lib in $LIBS
14475 do
14476         for cf_add_2lib in $cf_add_libs
14477         do
14478                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14479                 then
14480                         cf_add_1lib=
14481                         break
14482                 fi
14483         done
14484         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14485 done
14486 LIBS="$cf_add_libs"
14487
14488 fi
14489
14490 fi
14491
14492         echo "$as_me:14492: checking for XtAppInitialize" >&5
14493 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14494 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14495   echo $ECHO_N "(cached) $ECHO_C" >&6
14496 else
14497   cat >conftest.$ac_ext <<_ACEOF
14498 #line 14498 "configure"
14499 #include "confdefs.h"
14500 #define XtAppInitialize autoconf_temporary
14501 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14502 #undef XtAppInitialize
14503
14504 #ifdef __cplusplus
14505 extern "C"
14506 #endif
14507
14508 /* We use char because int might match the return type of a gcc2
14509    builtin and then its argument prototype would still apply.  */
14510 char XtAppInitialize (void);
14511
14512 int
14513 main (void)
14514 {
14515
14516 /* The GNU C library defines stubs for functions which it implements
14517     to always fail with ENOSYS.  Some functions are actually named
14518     something starting with __ and the normal name is an alias.  */
14519 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14520 #error found stub for XtAppInitialize
14521 #endif
14522
14523         return XtAppInitialize ();
14524   ;
14525   return 0;
14526 }
14527 _ACEOF
14528 rm -f conftest.$ac_objext conftest$ac_exeext
14529 if { (eval echo "$as_me:14529: \"$ac_link\"") >&5
14530   (eval $ac_link) 2>&5
14531   ac_status=$?
14532   echo "$as_me:14532: \$? = $ac_status" >&5
14533   (exit $ac_status); } &&
14534          { ac_try='test -s conftest$ac_exeext'
14535   { (eval echo "$as_me:14535: \"$ac_try\"") >&5
14536   (eval $ac_try) 2>&5
14537   ac_status=$?
14538   echo "$as_me:14538: \$? = $ac_status" >&5
14539   (exit $ac_status); }; }; then
14540   ac_cv_func_XtAppInitialize=yes
14541 else
14542   echo "$as_me: failed program was:" >&5
14543 cat conftest.$ac_ext >&5
14544 ac_cv_func_XtAppInitialize=no
14545 fi
14546 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14547 fi
14548 echo "$as_me:14548: result: $ac_cv_func_XtAppInitialize" >&5
14549 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14550 if test $ac_cv_func_XtAppInitialize = yes; then
14551   :
14552 else
14553
14554         echo "$as_me:14554: checking for XtAppInitialize in -lXt" >&5
14555 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14556 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14557   echo $ECHO_N "(cached) $ECHO_C" >&6
14558 else
14559   ac_check_lib_save_LIBS=$LIBS
14560 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14561 cat >conftest.$ac_ext <<_ACEOF
14562 #line 14562 "configure"
14563 #include "confdefs.h"
14564
14565 /* Override any gcc2 internal prototype to avoid an error.  */
14566 #ifdef __cplusplus
14567 extern "C"
14568 #endif
14569 /* We use char because int might match the return type of a gcc2
14570    builtin and then its argument prototype would still apply.  */
14571 char XtAppInitialize ();
14572 int
14573 main (void)
14574 {
14575 XtAppInitialize ();
14576   ;
14577   return 0;
14578 }
14579 _ACEOF
14580 rm -f conftest.$ac_objext conftest$ac_exeext
14581 if { (eval echo "$as_me:14581: \"$ac_link\"") >&5
14582   (eval $ac_link) 2>&5
14583   ac_status=$?
14584   echo "$as_me:14584: \$? = $ac_status" >&5
14585   (exit $ac_status); } &&
14586          { ac_try='test -s conftest$ac_exeext'
14587   { (eval echo "$as_me:14587: \"$ac_try\"") >&5
14588   (eval $ac_try) 2>&5
14589   ac_status=$?
14590   echo "$as_me:14590: \$? = $ac_status" >&5
14591   (exit $ac_status); }; }; then
14592   ac_cv_lib_Xt_XtAppInitialize=yes
14593 else
14594   echo "$as_me: failed program was:" >&5
14595 cat conftest.$ac_ext >&5
14596 ac_cv_lib_Xt_XtAppInitialize=no
14597 fi
14598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14599 LIBS=$ac_check_lib_save_LIBS
14600 fi
14601 echo "$as_me:14601: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
14602 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
14603 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
14604
14605 cat >>confdefs.h <<\EOF
14606 #define HAVE_LIBXT 1
14607 EOF
14608
14609                  cf_have_X_LIBS=Xt
14610                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14611 fi
14612
14613 fi
14614
14615 fi
14616
14617 if test $cf_have_X_LIBS = no ; then
14618         { echo "$as_me:14618: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14619 test program.  You will have to check and add the proper libraries by hand
14620 to makefile." >&5
14621 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14622 test program.  You will have to check and add the proper libraries by hand
14623 to makefile." >&2;}
14624 fi
14625
14626 cf_x_athena_root=$cf_x_athena
14627 cf_x_athena_inc=""
14628
14629 for cf_path in default \
14630         /usr/contrib/X11R6 \
14631         /usr/contrib/X11R5 \
14632         /usr/lib/X11R5 \
14633         /usr/local
14634 do
14635         if test -z "$cf_x_athena_inc" ; then
14636                 cf_save="$CPPFLAGS"
14637                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
14638                 if test $cf_path != default ; then
14639                         CPPFLAGS="$cf_save"
14640
14641         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14642         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
14643
14644                         echo "$as_me:14644: checking for $cf_test in $cf_path" >&5
14645 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
14646                 else
14647                         echo "$as_me:14647: checking for $cf_test" >&5
14648 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
14649                 fi
14650                 cat >conftest.$ac_ext <<_ACEOF
14651 #line 14651 "configure"
14652 #include "confdefs.h"
14653
14654 #include <X11/Intrinsic.h>
14655 #include <$cf_test>
14656 int
14657 main (void)
14658 {
14659
14660   ;
14661   return 0;
14662 }
14663 _ACEOF
14664 rm -f conftest.$ac_objext
14665 if { (eval echo "$as_me:14665: \"$ac_compile\"") >&5
14666   (eval $ac_compile) 2>&5
14667   ac_status=$?
14668   echo "$as_me:14668: \$? = $ac_status" >&5
14669   (exit $ac_status); } &&
14670          { ac_try='test -s conftest.$ac_objext'
14671   { (eval echo "$as_me:14671: \"$ac_try\"") >&5
14672   (eval $ac_try) 2>&5
14673   ac_status=$?
14674   echo "$as_me:14674: \$? = $ac_status" >&5
14675   (exit $ac_status); }; }; then
14676   cf_result=yes
14677 else
14678   echo "$as_me: failed program was:" >&5
14679 cat conftest.$ac_ext >&5
14680 cf_result=no
14681 fi
14682 rm -f conftest.$ac_objext conftest.$ac_ext
14683                 echo "$as_me:14683: result: $cf_result" >&5
14684 echo "${ECHO_T}$cf_result" >&6
14685                 if test "$cf_result" = yes ; then
14686                         cf_x_athena_inc=$cf_path
14687                         break
14688                 else
14689                         CPPFLAGS="$cf_save"
14690                 fi
14691         fi
14692 done
14693
14694 if test -z "$cf_x_athena_inc" ; then
14695         { echo "$as_me:14695: WARNING: Unable to successfully find Athena header files with test program" >&5
14696 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
14697 elif test "$cf_x_athena_inc" != default ; then
14698
14699         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14700         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
14701
14702 fi
14703
14704 cf_x_athena_root=$cf_x_athena
14705 cf_x_athena_lib=""
14706
14707 for cf_path in default \
14708         /usr/contrib/X11R6 \
14709         /usr/contrib/X11R5 \
14710         /usr/lib/X11R5 \
14711         /usr/local
14712 do
14713         for cf_lib in \
14714                 ${cf_x_athena_root} \
14715                 ${cf_x_athena_root}7 \
14716                 ${cf_x_athena_root}6
14717         do
14718         for cf_libs in \
14719                 "-l$cf_lib -lXmu" \
14720                 "-l$cf_lib -lXpm -lXmu" \
14721                 "-l${cf_lib}_s -lXmu_s"
14722         do
14723                 if test -z "$cf_x_athena_lib" ; then
14724                         cf_save="$LIBS"
14725                         cf_test=XawSimpleMenuAddGlobalActions
14726                         if test $cf_path != default ; then
14727
14728 cf_add_libs="-L$cf_path/lib $cf_libs"
14729 # Filter out duplicates - this happens with badly-designed ".pc" files...
14730 for cf_add_1lib in $LIBS
14731 do
14732         for cf_add_2lib in $cf_add_libs
14733         do
14734                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14735                 then
14736                         cf_add_1lib=
14737                         break
14738                 fi
14739         done
14740         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14741 done
14742 LIBS="$cf_add_libs"
14743
14744                                 echo "$as_me:14744: checking for $cf_libs in $cf_path" >&5
14745 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
14746                         else
14747
14748 cf_add_libs="$cf_libs"
14749 # Filter out duplicates - this happens with badly-designed ".pc" files...
14750 for cf_add_1lib in $LIBS
14751 do
14752         for cf_add_2lib in $cf_add_libs
14753         do
14754                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14755                 then
14756                         cf_add_1lib=
14757                         break
14758                 fi
14759         done
14760         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14761 done
14762 LIBS="$cf_add_libs"
14763
14764                                 echo "$as_me:14764: checking for $cf_test in $cf_libs" >&5
14765 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
14766                         fi
14767                         cat >conftest.$ac_ext <<_ACEOF
14768 #line 14768 "configure"
14769 #include "confdefs.h"
14770
14771 #include <X11/Intrinsic.h>
14772 #include <X11/$cf_x_athena_root/SimpleMenu.h>
14773
14774 int
14775 main (void)
14776 {
14777
14778 $cf_test((XtAppContext) 0)
14779   ;
14780   return 0;
14781 }
14782 _ACEOF
14783 rm -f conftest.$ac_objext conftest$ac_exeext
14784 if { (eval echo "$as_me:14784: \"$ac_link\"") >&5
14785   (eval $ac_link) 2>&5
14786   ac_status=$?
14787   echo "$as_me:14787: \$? = $ac_status" >&5
14788   (exit $ac_status); } &&
14789          { ac_try='test -s conftest$ac_exeext'
14790   { (eval echo "$as_me:14790: \"$ac_try\"") >&5
14791   (eval $ac_try) 2>&5
14792   ac_status=$?
14793   echo "$as_me:14793: \$? = $ac_status" >&5
14794   (exit $ac_status); }; }; then
14795   cf_result=yes
14796 else
14797   echo "$as_me: failed program was:" >&5
14798 cat conftest.$ac_ext >&5
14799 cf_result=no
14800 fi
14801 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14802                         echo "$as_me:14802: result: $cf_result" >&5
14803 echo "${ECHO_T}$cf_result" >&6
14804                         if test "$cf_result" = yes ; then
14805                                 cf_x_athena_lib="$cf_libs"
14806                                 break
14807                         fi
14808                         LIBS="$cf_save"
14809                 fi
14810         done # cf_libs
14811                 test -n "$cf_x_athena_lib" && break
14812         done # cf_lib
14813 done
14814
14815 if test -z "$cf_x_athena_lib" ; then
14816         { { echo "$as_me:14816: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
14817 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
14818    { (exit 1); exit 1; }; }
14819 fi
14820
14821 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14822
14823 cat >>confdefs.h <<EOF
14824 #define $cf_x_athena_LIBS 1
14825 EOF
14826
14827 fi
14828
14829 if test -n "$ac_tool_prefix"; then
14830   for ac_prog in xcurses-config
14831   do
14832     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
14833 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
14834 echo "$as_me:14834: checking for $ac_word" >&5
14835 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14836 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
14837   echo $ECHO_N "(cached) $ECHO_C" >&6
14838 else
14839   if test -n "$XCURSES_CONFIG"; then
14840   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
14841 else
14842   ac_save_IFS=$IFS; IFS=$ac_path_separator
14843 ac_dummy="$PATH"
14844 for ac_dir in $ac_dummy; do
14845   IFS=$ac_save_IFS
14846   test -z "$ac_dir" && ac_dir=.
14847   $as_executable_p "$ac_dir/$ac_word" || continue
14848 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
14849 echo "$as_me:14849: found $ac_dir/$ac_word" >&5
14850 break
14851 done
14852
14853 fi
14854 fi
14855 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
14856 if test -n "$XCURSES_CONFIG"; then
14857   echo "$as_me:14857: result: $XCURSES_CONFIG" >&5
14858 echo "${ECHO_T}$XCURSES_CONFIG" >&6
14859 else
14860   echo "$as_me:14860: result: no" >&5
14861 echo "${ECHO_T}no" >&6
14862 fi
14863
14864     test -n "$XCURSES_CONFIG" && break
14865   done
14866 fi
14867 if test -z "$XCURSES_CONFIG"; then
14868   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
14869   for ac_prog in xcurses-config
14870 do
14871   # Extract the first word of "$ac_prog", so it can be a program name with args.
14872 set dummy $ac_prog; ac_word=$2
14873 echo "$as_me:14873: checking for $ac_word" >&5
14874 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14875 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
14876   echo $ECHO_N "(cached) $ECHO_C" >&6
14877 else
14878   if test -n "$ac_ct_XCURSES_CONFIG"; then
14879   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
14880 else
14881   ac_save_IFS=$IFS; IFS=$ac_path_separator
14882 ac_dummy="$PATH"
14883 for ac_dir in $ac_dummy; do
14884   IFS=$ac_save_IFS
14885   test -z "$ac_dir" && ac_dir=.
14886   $as_executable_p "$ac_dir/$ac_word" || continue
14887 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
14888 echo "$as_me:14888: found $ac_dir/$ac_word" >&5
14889 break
14890 done
14891
14892 fi
14893 fi
14894 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
14895 if test -n "$ac_ct_XCURSES_CONFIG"; then
14896   echo "$as_me:14896: result: $ac_ct_XCURSES_CONFIG" >&5
14897 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
14898 else
14899   echo "$as_me:14899: result: no" >&5
14900 echo "${ECHO_T}no" >&6
14901 fi
14902
14903   test -n "$ac_ct_XCURSES_CONFIG" && break
14904 done
14905 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
14906
14907   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
14908 fi
14909
14910 if test "$XCURSES_CONFIG" != none ; then
14911
14912 cf_fix_cppflags=no
14913 cf_new_cflags=
14914 cf_new_cppflags=
14915 cf_new_extra_cppflags=
14916
14917 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
14918 do
14919 case $cf_fix_cppflags in
14920 (no)
14921         case $cf_add_cflags in
14922         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14923                 case $cf_add_cflags in
14924                 (-D*)
14925                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14926
14927                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14928                                 && test -z "${cf_tst_cflags}" \
14929                                 && cf_fix_cppflags=yes
14930
14931                         if test $cf_fix_cppflags = yes ; then
14932
14933         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14934         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14935
14936                                 continue
14937                         elif test "${cf_tst_cflags}" = "\"'" ; then
14938
14939         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14940         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14941
14942                                 continue
14943                         fi
14944                         ;;
14945                 esac
14946                 case "$CPPFLAGS" in
14947                 (*$cf_add_cflags)
14948                         ;;
14949                 (*)
14950                         case $cf_add_cflags in
14951                         (-D*)
14952                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14953
14954 CPPFLAGS=`echo "$CPPFLAGS" | \
14955         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14956                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14957
14958                                 ;;
14959                         esac
14960
14961         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14962         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14963
14964                         ;;
14965                 esac
14966                 ;;
14967         (*)
14968
14969         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14970         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14971
14972                 ;;
14973         esac
14974         ;;
14975 (yes)
14976
14977         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14978         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14979
14980         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14981
14982         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14983                 && test -z "${cf_tst_cflags}" \
14984                 && cf_fix_cppflags=no
14985         ;;
14986 esac
14987 done
14988
14989 if test -n "$cf_new_cflags" ; then
14990
14991         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14992         CFLAGS="${CFLAGS}$cf_new_cflags"
14993
14994 fi
14995
14996 if test -n "$cf_new_cppflags" ; then
14997
14998         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14999         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15000
15001 fi
15002
15003 if test -n "$cf_new_extra_cppflags" ; then
15004
15005         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15006         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15007
15008 fi
15009
15010 cf_add_libs="`$XCURSES_CONFIG --libs`"
15011 # Filter out duplicates - this happens with badly-designed ".pc" files...
15012 for cf_add_1lib in $LIBS
15013 do
15014         for cf_add_2lib in $cf_add_libs
15015         do
15016                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15017                 then
15018                         cf_add_1lib=
15019                         break
15020                 fi
15021         done
15022         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15023 done
15024 LIBS="$cf_add_libs"
15025
15026 cf_cv_lib_XCurses=yes
15027
15028 else
15029
15030 LDFLAGS="$LDFLAGS $X_LIBS"
15031
15032 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15033
15034 echo "${as_me:-configure}:15034: testing checking additions to CFLAGS ..." 1>&5
15035
15036 cf_check_cflags="$CFLAGS"
15037 cf_check_cppflags="$CPPFLAGS"
15038
15039 cf_fix_cppflags=no
15040 cf_new_cflags=
15041 cf_new_cppflags=
15042 cf_new_extra_cppflags=
15043
15044 for cf_add_cflags in $X_CFLAGS
15045 do
15046 case $cf_fix_cppflags in
15047 (no)
15048         case $cf_add_cflags in
15049         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15050                 case $cf_add_cflags in
15051                 (-D*)
15052                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15053
15054                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15055                                 && test -z "${cf_tst_cflags}" \
15056                                 && cf_fix_cppflags=yes
15057
15058                         if test $cf_fix_cppflags = yes ; then
15059
15060         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15061         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15062
15063                                 continue
15064                         elif test "${cf_tst_cflags}" = "\"'" ; then
15065
15066         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15067         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15068
15069                                 continue
15070                         fi
15071                         ;;
15072                 esac
15073                 case "$CPPFLAGS" in
15074                 (*$cf_add_cflags)
15075                         ;;
15076                 (*)
15077                         case $cf_add_cflags in
15078                         (-D*)
15079                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15080
15081 CPPFLAGS=`echo "$CPPFLAGS" | \
15082         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15083                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15084
15085                                 ;;
15086                         esac
15087
15088         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15089         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15090
15091                         ;;
15092                 esac
15093                 ;;
15094         (*)
15095
15096         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15097         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15098
15099                 ;;
15100         esac
15101         ;;
15102 (yes)
15103
15104         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15105         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15106
15107         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15108
15109         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15110                 && test -z "${cf_tst_cflags}" \
15111                 && cf_fix_cppflags=no
15112         ;;
15113 esac
15114 done
15115
15116 if test -n "$cf_new_cflags" ; then
15117         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15118
15119 echo "${as_me:-configure}:15119: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15120
15121         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15122         CFLAGS="${CFLAGS}$cf_new_cflags"
15123
15124 fi
15125
15126 if test -n "$cf_new_cppflags" ; then
15127         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15128
15129 echo "${as_me:-configure}:15129: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15130
15131         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15132         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15133
15134 fi
15135
15136 if test -n "$cf_new_extra_cppflags" ; then
15137         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15138
15139 echo "${as_me:-configure}:15139: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15140
15141         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15142         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15143
15144 fi
15145
15146 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15147 cat >conftest.$ac_ext <<_ACEOF
15148 #line 15148 "configure"
15149 #include "confdefs.h"
15150 #include <stdio.h>
15151 int
15152 main (void)
15153 {
15154 printf("Hello world");
15155   ;
15156   return 0;
15157 }
15158 _ACEOF
15159 rm -f conftest.$ac_objext conftest$ac_exeext
15160 if { (eval echo "$as_me:15160: \"$ac_link\"") >&5
15161   (eval $ac_link) 2>&5
15162   ac_status=$?
15163   echo "$as_me:15163: \$? = $ac_status" >&5
15164   (exit $ac_status); } &&
15165          { ac_try='test -s conftest$ac_exeext'
15166   { (eval echo "$as_me:15166: \"$ac_try\"") >&5
15167   (eval $ac_try) 2>&5
15168   ac_status=$?
15169   echo "$as_me:15169: \$? = $ac_status" >&5
15170   (exit $ac_status); }; }; then
15171   :
15172 else
15173   echo "$as_me: failed program was:" >&5
15174 cat conftest.$ac_ext >&5
15175 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15176
15177 echo "${as_me:-configure}:15177: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15178
15179          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15180                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15181
15182 echo "${as_me:-configure}:15182: testing but keeping change to \$CPPFLAGS ..." 1>&5
15183
15184          fi
15185          CFLAGS="$cf_check_flags"
15186 fi
15187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15188 fi
15189
15190 echo "$as_me:15190: checking for XOpenDisplay in -lX11" >&5
15191 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15192 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15193   echo $ECHO_N "(cached) $ECHO_C" >&6
15194 else
15195   ac_check_lib_save_LIBS=$LIBS
15196 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15197 cat >conftest.$ac_ext <<_ACEOF
15198 #line 15198 "configure"
15199 #include "confdefs.h"
15200
15201 /* Override any gcc2 internal prototype to avoid an error.  */
15202 #ifdef __cplusplus
15203 extern "C"
15204 #endif
15205 /* We use char because int might match the return type of a gcc2
15206    builtin and then its argument prototype would still apply.  */
15207 char XOpenDisplay ();
15208 int
15209 main (void)
15210 {
15211 XOpenDisplay ();
15212   ;
15213   return 0;
15214 }
15215 _ACEOF
15216 rm -f conftest.$ac_objext conftest$ac_exeext
15217 if { (eval echo "$as_me:15217: \"$ac_link\"") >&5
15218   (eval $ac_link) 2>&5
15219   ac_status=$?
15220   echo "$as_me:15220: \$? = $ac_status" >&5
15221   (exit $ac_status); } &&
15222          { ac_try='test -s conftest$ac_exeext'
15223   { (eval echo "$as_me:15223: \"$ac_try\"") >&5
15224   (eval $ac_try) 2>&5
15225   ac_status=$?
15226   echo "$as_me:15226: \$? = $ac_status" >&5
15227   (exit $ac_status); }; }; then
15228   ac_cv_lib_X11_XOpenDisplay=yes
15229 else
15230   echo "$as_me: failed program was:" >&5
15231 cat conftest.$ac_ext >&5
15232 ac_cv_lib_X11_XOpenDisplay=no
15233 fi
15234 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15235 LIBS=$ac_check_lib_save_LIBS
15236 fi
15237 echo "$as_me:15237: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15238 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15239 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15240
15241 cf_add_libs="-lX11"
15242 # Filter out duplicates - this happens with badly-designed ".pc" files...
15243 for cf_add_1lib in $LIBS
15244 do
15245         for cf_add_2lib in $cf_add_libs
15246         do
15247                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15248                 then
15249                         cf_add_1lib=
15250                         break
15251                 fi
15252         done
15253         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15254 done
15255 LIBS="$cf_add_libs"
15256
15257 fi
15258
15259 echo "$as_me:15259: checking for XCurses library" >&5
15260 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15261 if test "${cf_cv_lib_XCurses+set}" = set; then
15262   echo $ECHO_N "(cached) $ECHO_C" >&6
15263 else
15264
15265 cf_add_libs="-lXCurses"
15266 # Filter out duplicates - this happens with badly-designed ".pc" files...
15267 for cf_add_1lib in $LIBS
15268 do
15269         for cf_add_2lib in $cf_add_libs
15270         do
15271                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15272                 then
15273                         cf_add_1lib=
15274                         break
15275                 fi
15276         done
15277         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15278 done
15279 LIBS="$cf_add_libs"
15280
15281 cat >conftest.$ac_ext <<_ACEOF
15282 #line 15282 "configure"
15283 #include "confdefs.h"
15284
15285 #include <xcurses.h>
15286 char *XCursesProgramName = "test";
15287
15288 int
15289 main (void)
15290 {
15291 XCursesExit();
15292   ;
15293   return 0;
15294 }
15295 _ACEOF
15296 rm -f conftest.$ac_objext conftest$ac_exeext
15297 if { (eval echo "$as_me:15297: \"$ac_link\"") >&5
15298   (eval $ac_link) 2>&5
15299   ac_status=$?
15300   echo "$as_me:15300: \$? = $ac_status" >&5
15301   (exit $ac_status); } &&
15302          { ac_try='test -s conftest$ac_exeext'
15303   { (eval echo "$as_me:15303: \"$ac_try\"") >&5
15304   (eval $ac_try) 2>&5
15305   ac_status=$?
15306   echo "$as_me:15306: \$? = $ac_status" >&5
15307   (exit $ac_status); }; }; then
15308   cf_cv_lib_XCurses=yes
15309 else
15310   echo "$as_me: failed program was:" >&5
15311 cat conftest.$ac_ext >&5
15312 cf_cv_lib_XCurses=no
15313 fi
15314 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15315
15316 fi
15317 echo "$as_me:15317: result: $cf_cv_lib_XCurses" >&5
15318 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15319
15320 fi
15321
15322 if test $cf_cv_lib_XCurses = yes ; then
15323
15324 cat >>confdefs.h <<\EOF
15325 #define UNIX 1
15326 EOF
15327
15328 cat >>confdefs.h <<\EOF
15329 #define XCURSES 1
15330 EOF
15331
15332         echo "$as_me:15332: checking for xcurses.h" >&5
15333 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15334 if test "${ac_cv_header_xcurses_h+set}" = set; then
15335   echo $ECHO_N "(cached) $ECHO_C" >&6
15336 else
15337   cat >conftest.$ac_ext <<_ACEOF
15338 #line 15338 "configure"
15339 #include "confdefs.h"
15340 #include <xcurses.h>
15341 _ACEOF
15342 if { (eval echo "$as_me:15342: \"$ac_cpp conftest.$ac_ext\"") >&5
15343   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15344   ac_status=$?
15345   egrep -v '^ *\+' conftest.er1 >conftest.err
15346   rm -f conftest.er1
15347   cat conftest.err >&5
15348   echo "$as_me:15348: \$? = $ac_status" >&5
15349   (exit $ac_status); } >/dev/null; then
15350   if test -s conftest.err; then
15351     ac_cpp_err=$ac_c_preproc_warn_flag
15352   else
15353     ac_cpp_err=
15354   fi
15355 else
15356   ac_cpp_err=yes
15357 fi
15358 if test -z "$ac_cpp_err"; then
15359   ac_cv_header_xcurses_h=yes
15360 else
15361   echo "$as_me: failed program was:" >&5
15362   cat conftest.$ac_ext >&5
15363   ac_cv_header_xcurses_h=no
15364 fi
15365 rm -f conftest.err conftest.$ac_ext
15366 fi
15367 echo "$as_me:15367: result: $ac_cv_header_xcurses_h" >&5
15368 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15369 if test $ac_cv_header_xcurses_h = yes; then
15370
15371 cat >>confdefs.h <<\EOF
15372 #define HAVE_XCURSES 1
15373 EOF
15374
15375 fi
15376
15377 else
15378         { { echo "$as_me:15378: error: Cannot link with XCurses" >&5
15379 echo "$as_me: error: Cannot link with XCurses" >&2;}
15380    { (exit 1); exit 1; }; }
15381 fi
15382
15383         ;;
15384 (*)
15385         { { echo "$as_me:15385: error: unexpected screen-value: $cf_cv_screen" >&5
15386 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15387    { (exit 1); exit 1; }; }
15388         ;;
15389 esac
15390
15391 : ${cf_nculib_root:=$cf_cv_screen}
15392 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15393 echo "$as_me:15393: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15394 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15395 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15396   echo $ECHO_N "(cached) $ECHO_C" >&6
15397 else
15398   ac_check_lib_save_LIBS=$LIBS
15399 LIBS="-l$cf_nculib_root  $LIBS"
15400 cat >conftest.$ac_ext <<_ACEOF
15401 #line 15401 "configure"
15402 #include "confdefs.h"
15403
15404 /* Override any gcc2 internal prototype to avoid an error.  */
15405 #ifdef __cplusplus
15406 extern "C"
15407 #endif
15408 /* We use char because int might match the return type of a gcc2
15409    builtin and then its argument prototype would still apply.  */
15410 char _nc_init_pthreads ();
15411 int
15412 main (void)
15413 {
15414 _nc_init_pthreads ();
15415   ;
15416   return 0;
15417 }
15418 _ACEOF
15419 rm -f conftest.$ac_objext conftest$ac_exeext
15420 if { (eval echo "$as_me:15420: \"$ac_link\"") >&5
15421   (eval $ac_link) 2>&5
15422   ac_status=$?
15423   echo "$as_me:15423: \$? = $ac_status" >&5
15424   (exit $ac_status); } &&
15425          { ac_try='test -s conftest$ac_exeext'
15426   { (eval echo "$as_me:15426: \"$ac_try\"") >&5
15427   (eval $ac_try) 2>&5
15428   ac_status=$?
15429   echo "$as_me:15429: \$? = $ac_status" >&5
15430   (exit $ac_status); }; }; then
15431   eval "$as_ac_Lib=yes"
15432 else
15433   echo "$as_me: failed program was:" >&5
15434 cat conftest.$ac_ext >&5
15435 eval "$as_ac_Lib=no"
15436 fi
15437 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15438 LIBS=$ac_check_lib_save_LIBS
15439 fi
15440 echo "$as_me:15440: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15441 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15442 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15443   cf_cv_ncurses_pthreads=yes
15444 else
15445   cf_cv_ncurses_pthreads=no
15446 fi
15447
15448 if test "$cf_cv_ncurses_pthreads" = yes
15449 then
15450
15451 cf_add_libs="-lpthread"
15452 # Filter out duplicates - this happens with badly-designed ".pc" files...
15453 for cf_add_1lib in $LIBS
15454 do
15455         for cf_add_2lib in $cf_add_libs
15456         do
15457                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15458                 then
15459                         cf_add_1lib=
15460                         break
15461                 fi
15462         done
15463         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15464 done
15465 LIBS="$cf_add_libs"
15466
15467 fi
15468
15469 case $cf_cv_screen in
15470 (ncurses*)
15471         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15472         ;;
15473 esac
15474
15475 echo "$as_me:15475: checking for X11 rgb file" >&5
15476 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15477
15478 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15479 if test "${with_x11_rgb+set}" = set; then
15480   withval="$with_x11_rgb"
15481   RGB_PATH=$withval
15482 else
15483   RGB_PATH=auto
15484 fi;
15485
15486 if test "x$RGB_PATH" = xauto
15487 then
15488         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15489         for cf_path in \
15490                 /opt/local/share/X11/rgb.txt \
15491                 /opt/X11/share/X11/rgb.txt \
15492                 /usr/share/X11/rgb.txt \
15493                 /usr/X11/share/X11/rgb.txt \
15494                 /usr/X11/lib/X11/rgb.txt \
15495                 /usr/lib/X11/rgb.txt \
15496                 /etc/X11/rgb.txt \
15497                 /usr/pkg/lib/X11/rgb.txt \
15498                 /usr/X11R7/lib/X11/rgb.txt \
15499                 /usr/X11R6/lib/X11/rgb.txt \
15500                 /usr/X11R5/lib/X11/rgb.txt \
15501                 /usr/X11R4/lib/X11/rgb.txt \
15502                 /usr/local/lib/X11/rgb.txt \
15503                 /usr/local/share/X11/rgb.txt \
15504                 /usr/lib64/X11/rgb.txt
15505         do
15506                 if test -f "$cf_path" ; then
15507                         RGB_PATH="$cf_path"
15508                         break
15509                 fi
15510         done
15511 else
15512         cf_path=$RGB_PATH
15513
15514 if test "x$prefix" != xNONE; then
15515         cf_path_syntax="$prefix"
15516 else
15517         cf_path_syntax="$ac_default_prefix"
15518 fi
15519
15520 case ".$cf_path" in
15521 (.\$\(*\)*|.\'*\'*)
15522         ;;
15523 (..|./*|.\\*)
15524         ;;
15525 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15526         ;;
15527 (.\${*prefix}*|.\${*dir}*)
15528         eval cf_path="$cf_path"
15529         case ".$cf_path" in
15530         (.NONE/*)
15531                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15532                 ;;
15533         esac
15534         ;;
15535 (.no|.NONE/*)
15536         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15537         ;;
15538 (*)
15539         { { echo "$as_me:15539: error: expected a pathname, not \"$cf_path\"" >&5
15540 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15541    { (exit 1); exit 1; }; }
15542         ;;
15543 esac
15544
15545 fi
15546
15547 echo "$as_me:15547: result: $RGB_PATH" >&5
15548 echo "${ECHO_T}$RGB_PATH" >&6
15549
15550 cat >>confdefs.h <<EOF
15551 #define RGB_PATH "$cf_path"
15552 EOF
15553
15554 no_x11_rgb=
15555 if test "$RGB_PATH" = no
15556 then
15557         no_x11_rgb="#"
15558 fi
15559
15560 cf_curses_headers=
15561
15562 case $cf_cv_screen in
15563 (pdcurses)
15564         cf_default_panel=no
15565         cf_default_form=no
15566         cf_default_menu=no
15567         cf_default_tinfo=no
15568         ;;
15569 (xcurses|bsdcurses)
15570         cf_default_panel=no
15571         cf_default_form=no
15572         cf_default_menu=no
15573         cf_default_tinfo=yes
15574         ;;
15575 (*)
15576         cf_default_panel=yes
15577         cf_default_form=yes
15578         cf_default_menu=yes
15579         cf_default_tinfo=yes
15580         case $cf_cv_screen in
15581         (ncurses*)
15582                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
15583                 ;;
15584         esac
15585         ;;
15586 esac
15587
15588 echo "$as_me:15588: checking if you want to check for panel functions" >&5
15589 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
15590
15591 # Check whether --enable-panel or --disable-panel was given.
15592 if test "${enable_panel+set}" = set; then
15593   enableval="$enable_panel"
15594   test "$enableval" != no && enableval=yes
15595         if test "$enableval" != "yes" ; then
15596     cf_enable_panel=no
15597         else
15598                 cf_enable_panel=$cf_default_panel
15599         fi
15600 else
15601   enableval=yes
15602         cf_enable_panel=$cf_default_panel
15603
15604 fi;
15605 echo "$as_me:15605: result: $cf_enable_panel" >&5
15606 echo "${ECHO_T}$cf_enable_panel" >&6
15607 if test $cf_enable_panel = yes
15608 then
15609
15610 cf_have_curses_lib=no
15611
15612 : ${NCURSES_CONFIG_PKG:=none}
15613 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15614         :
15615 elif test "x${PKG_CONFIG:=none}" != xnone; then
15616         echo "$as_me:15616: checking pkg-config for panel$cf_cv_libtype" >&5
15617 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
15618         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
15619                 echo "$as_me:15619: result: yes" >&5
15620 echo "${ECHO_T}yes" >&6
15621
15622                 echo "$as_me:15622: checking if the panel$cf_cv_libtype package files work" >&5
15623 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
15624
15625                 cf_save_CPPFLAGS="$CPPFLAGS"
15626                 cf_save_LIBS="$LIBS"
15627
15628 cf_fix_cppflags=no
15629 cf_new_cflags=
15630 cf_new_cppflags=
15631 cf_new_extra_cppflags=
15632
15633 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
15634 do
15635 case $cf_fix_cppflags in
15636 (no)
15637         case $cf_add_cflags in
15638         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15639                 case $cf_add_cflags in
15640                 (-D*)
15641                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15642
15643                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15644                                 && test -z "${cf_tst_cflags}" \
15645                                 && cf_fix_cppflags=yes
15646
15647                         if test $cf_fix_cppflags = yes ; then
15648
15649         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15650         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15651
15652                                 continue
15653                         elif test "${cf_tst_cflags}" = "\"'" ; then
15654
15655         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15656         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15657
15658                                 continue
15659                         fi
15660                         ;;
15661                 esac
15662                 case "$CPPFLAGS" in
15663                 (*$cf_add_cflags)
15664                         ;;
15665                 (*)
15666                         case $cf_add_cflags in
15667                         (-D*)
15668                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15669
15670 CPPFLAGS=`echo "$CPPFLAGS" | \
15671         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15672                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15673
15674                                 ;;
15675                         esac
15676
15677         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15678         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15679
15680                         ;;
15681                 esac
15682                 ;;
15683         (*)
15684
15685         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15686         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15687
15688                 ;;
15689         esac
15690         ;;
15691 (yes)
15692
15693         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15694         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15695
15696         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15697
15698         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15699                 && test -z "${cf_tst_cflags}" \
15700                 && cf_fix_cppflags=no
15701         ;;
15702 esac
15703 done
15704
15705 if test -n "$cf_new_cflags" ; then
15706
15707         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15708         CFLAGS="${CFLAGS}$cf_new_cflags"
15709
15710 fi
15711
15712 if test -n "$cf_new_cppflags" ; then
15713
15714         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15715         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15716
15717 fi
15718
15719 if test -n "$cf_new_extra_cppflags" ; then
15720
15721         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15722         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15723
15724 fi
15725
15726 cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
15727 # Filter out duplicates - this happens with badly-designed ".pc" files...
15728 for cf_add_1lib in $LIBS
15729 do
15730         for cf_add_2lib in $cf_add_libs
15731         do
15732                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15733                 then
15734                         cf_add_1lib=
15735                         break
15736                 fi
15737         done
15738         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15739 done
15740 LIBS="$cf_add_libs"
15741
15742                 cat >conftest.$ac_ext <<_ACEOF
15743 #line 15743 "configure"
15744 #include "confdefs.h"
15745 #include <panel.h>
15746 int
15747 main (void)
15748 {
15749 (void) new_panel ( 0 );
15750   ;
15751   return 0;
15752 }
15753 _ACEOF
15754 rm -f conftest.$ac_objext conftest$ac_exeext
15755 if { (eval echo "$as_me:15755: \"$ac_link\"") >&5
15756   (eval $ac_link) 2>&5
15757   ac_status=$?
15758   echo "$as_me:15758: \$? = $ac_status" >&5
15759   (exit $ac_status); } &&
15760          { ac_try='test -s conftest$ac_exeext'
15761   { (eval echo "$as_me:15761: \"$ac_try\"") >&5
15762   (eval $ac_try) 2>&5
15763   ac_status=$?
15764   echo "$as_me:15764: \$? = $ac_status" >&5
15765   (exit $ac_status); }; }; then
15766   if test "$cross_compiling" = yes; then
15767   cf_have_curses_lib=maybe
15768 else
15769   cat >conftest.$ac_ext <<_ACEOF
15770 #line 15770 "configure"
15771 #include "confdefs.h"
15772 #include <panel.h>
15773                                 int main(void)
15774                                 { (void) new_panel ( 0 ); return 0; }
15775 _ACEOF
15776 rm -f conftest$ac_exeext
15777 if { (eval echo "$as_me:15777: \"$ac_link\"") >&5
15778   (eval $ac_link) 2>&5
15779   ac_status=$?
15780   echo "$as_me:15780: \$? = $ac_status" >&5
15781   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15782   { (eval echo "$as_me:15782: \"$ac_try\"") >&5
15783   (eval $ac_try) 2>&5
15784   ac_status=$?
15785   echo "$as_me:15785: \$? = $ac_status" >&5
15786   (exit $ac_status); }; }; then
15787   cf_have_curses_lib=yes
15788 else
15789   echo "$as_me: program exited with status $ac_status" >&5
15790 echo "$as_me: failed program was:" >&5
15791 cat conftest.$ac_ext >&5
15792 cf_have_curses_lib=no
15793 fi
15794 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15795 fi
15796 else
15797   echo "$as_me: failed program was:" >&5
15798 cat conftest.$ac_ext >&5
15799 cf_have_curses_lib=no
15800 fi
15801 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15802                 echo "$as_me:15802: result: $cf_have_curses_lib" >&5
15803 echo "${ECHO_T}$cf_have_curses_lib" >&6
15804                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15805                 if test "$cf_have_curses_lib" != "yes"
15806                 then
15807                         CPPFLAGS="$cf_save_CPPFLAGS"
15808                         LIBS="$cf_save_LIBS"
15809                 else
15810
15811 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15812
15813                         cat >>confdefs.h <<EOF
15814 #define $cf_upper 1
15815 EOF
15816
15817                 fi
15818         fi
15819 fi
15820 if test "$cf_have_curses_lib" = no; then
15821         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
15822 echo "$as_me:15822: checking for new_panel in -lpanel$cf_cv_libtype" >&5
15823 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
15824 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15825   echo $ECHO_N "(cached) $ECHO_C" >&6
15826 else
15827   ac_check_lib_save_LIBS=$LIBS
15828 LIBS="-lpanel$cf_cv_libtype  $LIBS"
15829 cat >conftest.$ac_ext <<_ACEOF
15830 #line 15830 "configure"
15831 #include "confdefs.h"
15832
15833 /* Override any gcc2 internal prototype to avoid an error.  */
15834 #ifdef __cplusplus
15835 extern "C"
15836 #endif
15837 /* We use char because int might match the return type of a gcc2
15838    builtin and then its argument prototype would still apply.  */
15839 char new_panel ();
15840 int
15841 main (void)
15842 {
15843 new_panel ();
15844   ;
15845   return 0;
15846 }
15847 _ACEOF
15848 rm -f conftest.$ac_objext conftest$ac_exeext
15849 if { (eval echo "$as_me:15849: \"$ac_link\"") >&5
15850   (eval $ac_link) 2>&5
15851   ac_status=$?
15852   echo "$as_me:15852: \$? = $ac_status" >&5
15853   (exit $ac_status); } &&
15854          { ac_try='test -s conftest$ac_exeext'
15855   { (eval echo "$as_me:15855: \"$ac_try\"") >&5
15856   (eval $ac_try) 2>&5
15857   ac_status=$?
15858   echo "$as_me:15858: \$? = $ac_status" >&5
15859   (exit $ac_status); }; }; then
15860   eval "$as_ac_Lib=yes"
15861 else
15862   echo "$as_me: failed program was:" >&5
15863 cat conftest.$ac_ext >&5
15864 eval "$as_ac_Lib=no"
15865 fi
15866 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15867 LIBS=$ac_check_lib_save_LIBS
15868 fi
15869 echo "$as_me:15869: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15870 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15871 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15872
15873 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15874
15875 cf_add_libs="-lpanel$cf_cv_libtype"
15876 # Filter out duplicates - this happens with badly-designed ".pc" files...
15877 for cf_add_1lib in $LIBS
15878 do
15879         for cf_add_2lib in $cf_add_libs
15880         do
15881                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15882                 then
15883                         cf_add_1lib=
15884                         break
15885                 fi
15886         done
15887         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15888 done
15889 LIBS="$cf_add_libs"
15890
15891                 cat >>confdefs.h <<EOF
15892 #define $cf_upper 1
15893 EOF
15894
15895 fi
15896
15897 fi
15898
15899         cf_curses_headers="$cf_curses_headers panel.h"
15900 fi
15901
15902 echo "$as_me:15902: checking if you want to check for menu functions" >&5
15903 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
15904
15905 # Check whether --enable-menu or --disable-menu was given.
15906 if test "${enable_menu+set}" = set; then
15907   enableval="$enable_menu"
15908   test "$enableval" != no && enableval=yes
15909         if test "$enableval" != "yes" ; then
15910     cf_enable_menu=no
15911         else
15912                 cf_enable_menu=$cf_default_menu
15913         fi
15914 else
15915   enableval=yes
15916         cf_enable_menu=$cf_default_menu
15917
15918 fi;
15919 echo "$as_me:15919: result: $cf_enable_menu" >&5
15920 echo "${ECHO_T}$cf_enable_menu" >&6
15921 if test $cf_enable_menu = yes
15922 then
15923         case $cf_cv_screen in
15924         (ncurses*)
15925                 ;;
15926         (curses*)
15927
15928 echo "$as_me:15928: checking for NetBSD menu.h" >&5
15929 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
15930 if test "${cf_cv_netbsd_menu_h+set}" = set; then
15931   echo $ECHO_N "(cached) $ECHO_C" >&6
15932 else
15933
15934 cat >conftest.$ac_ext <<_ACEOF
15935 #line 15935 "configure"
15936 #include "confdefs.h"
15937
15938 #include <${cf_cv_ncurses_header:-curses.h}>
15939 #include <menu.h>
15940
15941 int
15942 main (void)
15943 {
15944
15945         MENU *menu;
15946         int y = menu->max_item_width;
15947
15948   ;
15949   return 0;
15950 }
15951 _ACEOF
15952 rm -f conftest.$ac_objext
15953 if { (eval echo "$as_me:15953: \"$ac_compile\"") >&5
15954   (eval $ac_compile) 2>&5
15955   ac_status=$?
15956   echo "$as_me:15956: \$? = $ac_status" >&5
15957   (exit $ac_status); } &&
15958          { ac_try='test -s conftest.$ac_objext'
15959   { (eval echo "$as_me:15959: \"$ac_try\"") >&5
15960   (eval $ac_try) 2>&5
15961   ac_status=$?
15962   echo "$as_me:15962: \$? = $ac_status" >&5
15963   (exit $ac_status); }; }; then
15964   cf_cv_netbsd_menu_h=yes
15965
15966 else
15967   echo "$as_me: failed program was:" >&5
15968 cat conftest.$ac_ext >&5
15969 cf_cv_netbsd_menu_h=no
15970 fi
15971 rm -f conftest.$ac_objext conftest.$ac_ext
15972
15973 fi
15974 echo "$as_me:15974: result: $cf_cv_netbsd_menu_h" >&5
15975 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
15976
15977 test "$cf_cv_netbsd_menu_h" = yes &&
15978 cat >>confdefs.h <<\EOF
15979 #define HAVE_NETBSD_MENU_H 1
15980 EOF
15981
15982                 ;;
15983         esac
15984
15985 cf_have_curses_lib=no
15986
15987 : ${NCURSES_CONFIG_PKG:=none}
15988 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15989         :
15990 elif test "x${PKG_CONFIG:=none}" != xnone; then
15991         echo "$as_me:15991: checking pkg-config for menu$cf_cv_libtype" >&5
15992 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
15993         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
15994                 echo "$as_me:15994: result: yes" >&5
15995 echo "${ECHO_T}yes" >&6
15996
15997                 echo "$as_me:15997: checking if the menu$cf_cv_libtype package files work" >&5
15998 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
15999
16000                 cf_save_CPPFLAGS="$CPPFLAGS"
16001                 cf_save_LIBS="$LIBS"
16002
16003 cf_fix_cppflags=no
16004 cf_new_cflags=
16005 cf_new_cppflags=
16006 cf_new_extra_cppflags=
16007
16008 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
16009 do
16010 case $cf_fix_cppflags in
16011 (no)
16012         case $cf_add_cflags in
16013         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16014                 case $cf_add_cflags in
16015                 (-D*)
16016                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16017
16018                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16019                                 && test -z "${cf_tst_cflags}" \
16020                                 && cf_fix_cppflags=yes
16021
16022                         if test $cf_fix_cppflags = yes ; then
16023
16024         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16025         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16026
16027                                 continue
16028                         elif test "${cf_tst_cflags}" = "\"'" ; then
16029
16030         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16031         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16032
16033                                 continue
16034                         fi
16035                         ;;
16036                 esac
16037                 case "$CPPFLAGS" in
16038                 (*$cf_add_cflags)
16039                         ;;
16040                 (*)
16041                         case $cf_add_cflags in
16042                         (-D*)
16043                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16044
16045 CPPFLAGS=`echo "$CPPFLAGS" | \
16046         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16047                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16048
16049                                 ;;
16050                         esac
16051
16052         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16053         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16054
16055                         ;;
16056                 esac
16057                 ;;
16058         (*)
16059
16060         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16061         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16062
16063                 ;;
16064         esac
16065         ;;
16066 (yes)
16067
16068         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16069         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16070
16071         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16072
16073         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16074                 && test -z "${cf_tst_cflags}" \
16075                 && cf_fix_cppflags=no
16076         ;;
16077 esac
16078 done
16079
16080 if test -n "$cf_new_cflags" ; then
16081
16082         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16083         CFLAGS="${CFLAGS}$cf_new_cflags"
16084
16085 fi
16086
16087 if test -n "$cf_new_cppflags" ; then
16088
16089         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16090         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16091
16092 fi
16093
16094 if test -n "$cf_new_extra_cppflags" ; then
16095
16096         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16097         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16098
16099 fi
16100
16101 cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
16102 # Filter out duplicates - this happens with badly-designed ".pc" files...
16103 for cf_add_1lib in $LIBS
16104 do
16105         for cf_add_2lib in $cf_add_libs
16106         do
16107                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16108                 then
16109                         cf_add_1lib=
16110                         break
16111                 fi
16112         done
16113         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16114 done
16115 LIBS="$cf_add_libs"
16116
16117                 cat >conftest.$ac_ext <<_ACEOF
16118 #line 16118 "configure"
16119 #include "confdefs.h"
16120 #include <menu.h>
16121 int
16122 main (void)
16123 {
16124 (void) menu_driver ( 0,0 );
16125   ;
16126   return 0;
16127 }
16128 _ACEOF
16129 rm -f conftest.$ac_objext conftest$ac_exeext
16130 if { (eval echo "$as_me:16130: \"$ac_link\"") >&5
16131   (eval $ac_link) 2>&5
16132   ac_status=$?
16133   echo "$as_me:16133: \$? = $ac_status" >&5
16134   (exit $ac_status); } &&
16135          { ac_try='test -s conftest$ac_exeext'
16136   { (eval echo "$as_me:16136: \"$ac_try\"") >&5
16137   (eval $ac_try) 2>&5
16138   ac_status=$?
16139   echo "$as_me:16139: \$? = $ac_status" >&5
16140   (exit $ac_status); }; }; then
16141   if test "$cross_compiling" = yes; then
16142   cf_have_curses_lib=maybe
16143 else
16144   cat >conftest.$ac_ext <<_ACEOF
16145 #line 16145 "configure"
16146 #include "confdefs.h"
16147 #include <menu.h>
16148                                 int main(void)
16149                                 { (void) menu_driver ( 0,0 ); return 0; }
16150 _ACEOF
16151 rm -f conftest$ac_exeext
16152 if { (eval echo "$as_me:16152: \"$ac_link\"") >&5
16153   (eval $ac_link) 2>&5
16154   ac_status=$?
16155   echo "$as_me:16155: \$? = $ac_status" >&5
16156   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16157   { (eval echo "$as_me:16157: \"$ac_try\"") >&5
16158   (eval $ac_try) 2>&5
16159   ac_status=$?
16160   echo "$as_me:16160: \$? = $ac_status" >&5
16161   (exit $ac_status); }; }; then
16162   cf_have_curses_lib=yes
16163 else
16164   echo "$as_me: program exited with status $ac_status" >&5
16165 echo "$as_me: failed program was:" >&5
16166 cat conftest.$ac_ext >&5
16167 cf_have_curses_lib=no
16168 fi
16169 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16170 fi
16171 else
16172   echo "$as_me: failed program was:" >&5
16173 cat conftest.$ac_ext >&5
16174 cf_have_curses_lib=no
16175 fi
16176 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16177                 echo "$as_me:16177: result: $cf_have_curses_lib" >&5
16178 echo "${ECHO_T}$cf_have_curses_lib" >&6
16179                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16180                 if test "$cf_have_curses_lib" != "yes"
16181                 then
16182                         CPPFLAGS="$cf_save_CPPFLAGS"
16183                         LIBS="$cf_save_LIBS"
16184                 else
16185
16186 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16187
16188                         cat >>confdefs.h <<EOF
16189 #define $cf_upper 1
16190 EOF
16191
16192                 fi
16193         fi
16194 fi
16195 if test "$cf_have_curses_lib" = no; then
16196         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16197 echo "$as_me:16197: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
16198 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
16199 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16200   echo $ECHO_N "(cached) $ECHO_C" >&6
16201 else
16202   ac_check_lib_save_LIBS=$LIBS
16203 LIBS="-lmenu$cf_cv_libtype  $LIBS"
16204 cat >conftest.$ac_ext <<_ACEOF
16205 #line 16205 "configure"
16206 #include "confdefs.h"
16207
16208 /* Override any gcc2 internal prototype to avoid an error.  */
16209 #ifdef __cplusplus
16210 extern "C"
16211 #endif
16212 /* We use char because int might match the return type of a gcc2
16213    builtin and then its argument prototype would still apply.  */
16214 char menu_driver ();
16215 int
16216 main (void)
16217 {
16218 menu_driver ();
16219   ;
16220   return 0;
16221 }
16222 _ACEOF
16223 rm -f conftest.$ac_objext conftest$ac_exeext
16224 if { (eval echo "$as_me:16224: \"$ac_link\"") >&5
16225   (eval $ac_link) 2>&5
16226   ac_status=$?
16227   echo "$as_me:16227: \$? = $ac_status" >&5
16228   (exit $ac_status); } &&
16229          { ac_try='test -s conftest$ac_exeext'
16230   { (eval echo "$as_me:16230: \"$ac_try\"") >&5
16231   (eval $ac_try) 2>&5
16232   ac_status=$?
16233   echo "$as_me:16233: \$? = $ac_status" >&5
16234   (exit $ac_status); }; }; then
16235   eval "$as_ac_Lib=yes"
16236 else
16237   echo "$as_me: failed program was:" >&5
16238 cat conftest.$ac_ext >&5
16239 eval "$as_ac_Lib=no"
16240 fi
16241 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16242 LIBS=$ac_check_lib_save_LIBS
16243 fi
16244 echo "$as_me:16244: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16245 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16246 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16247
16248 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16249
16250 cf_add_libs="-lmenu$cf_cv_libtype"
16251 # Filter out duplicates - this happens with badly-designed ".pc" files...
16252 for cf_add_1lib in $LIBS
16253 do
16254         for cf_add_2lib in $cf_add_libs
16255         do
16256                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16257                 then
16258                         cf_add_1lib=
16259                         break
16260                 fi
16261         done
16262         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16263 done
16264 LIBS="$cf_add_libs"
16265
16266                 cat >>confdefs.h <<EOF
16267 #define $cf_upper 1
16268 EOF
16269
16270 fi
16271
16272 fi
16273
16274         cf_curses_headers="$cf_curses_headers menu.h"
16275 fi
16276
16277 echo "$as_me:16277: checking if you want to check for form functions" >&5
16278 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16279
16280 # Check whether --enable-form or --disable-form was given.
16281 if test "${enable_form+set}" = set; then
16282   enableval="$enable_form"
16283   test "$enableval" != no && enableval=yes
16284         if test "$enableval" != "yes" ; then
16285     cf_enable_form=no
16286         else
16287                 cf_enable_form=$cf_default_form
16288         fi
16289 else
16290   enableval=yes
16291         cf_enable_form=$cf_default_form
16292
16293 fi;
16294 echo "$as_me:16294: result: $cf_enable_form" >&5
16295 echo "${ECHO_T}$cf_enable_form" >&6
16296 if test $cf_enable_form = yes
16297 then
16298         case $cf_cv_screen in
16299         (ncurses*)
16300                 ;;
16301         (curses*)
16302
16303 echo "$as_me:16303: checking for NetBSD form.h" >&5
16304 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16305 if test "${cf_cv_netbsd_form_h+set}" = set; then
16306   echo $ECHO_N "(cached) $ECHO_C" >&6
16307 else
16308
16309 cat >conftest.$ac_ext <<_ACEOF
16310 #line 16310 "configure"
16311 #include "confdefs.h"
16312
16313 #include <${cf_cv_ncurses_header:-curses.h}>
16314 #include <form.h>
16315
16316 int
16317 main (void)
16318 {
16319
16320         FORM *form;
16321         int y = current_field(form)->cursor_ypos;
16322         int x = current_field(form)->cursor_xpos;
16323
16324   ;
16325   return 0;
16326 }
16327 _ACEOF
16328 rm -f conftest.$ac_objext
16329 if { (eval echo "$as_me:16329: \"$ac_compile\"") >&5
16330   (eval $ac_compile) 2>&5
16331   ac_status=$?
16332   echo "$as_me:16332: \$? = $ac_status" >&5
16333   (exit $ac_status); } &&
16334          { ac_try='test -s conftest.$ac_objext'
16335   { (eval echo "$as_me:16335: \"$ac_try\"") >&5
16336   (eval $ac_try) 2>&5
16337   ac_status=$?
16338   echo "$as_me:16338: \$? = $ac_status" >&5
16339   (exit $ac_status); }; }; then
16340   cf_cv_netbsd_form_h=yes
16341
16342 else
16343   echo "$as_me: failed program was:" >&5
16344 cat conftest.$ac_ext >&5
16345 cf_cv_netbsd_form_h=no
16346 fi
16347 rm -f conftest.$ac_objext conftest.$ac_ext
16348
16349 fi
16350 echo "$as_me:16350: result: $cf_cv_netbsd_form_h" >&5
16351 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16352
16353 test "$cf_cv_netbsd_form_h" = yes &&
16354 cat >>confdefs.h <<\EOF
16355 #define HAVE_NETBSD_FORM_H 1
16356 EOF
16357
16358                 ;;
16359         esac
16360
16361 cf_have_curses_lib=no
16362
16363 : ${NCURSES_CONFIG_PKG:=none}
16364 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16365         :
16366 elif test "x${PKG_CONFIG:=none}" != xnone; then
16367         echo "$as_me:16367: checking pkg-config for form$cf_cv_libtype" >&5
16368 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
16369         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
16370                 echo "$as_me:16370: result: yes" >&5
16371 echo "${ECHO_T}yes" >&6
16372
16373                 echo "$as_me:16373: checking if the form$cf_cv_libtype package files work" >&5
16374 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
16375
16376                 cf_save_CPPFLAGS="$CPPFLAGS"
16377                 cf_save_LIBS="$LIBS"
16378
16379 cf_fix_cppflags=no
16380 cf_new_cflags=
16381 cf_new_cppflags=
16382 cf_new_extra_cppflags=
16383
16384 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
16385 do
16386 case $cf_fix_cppflags in
16387 (no)
16388         case $cf_add_cflags in
16389         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16390                 case $cf_add_cflags in
16391                 (-D*)
16392                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16393
16394                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16395                                 && test -z "${cf_tst_cflags}" \
16396                                 && cf_fix_cppflags=yes
16397
16398                         if test $cf_fix_cppflags = yes ; then
16399
16400         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16401         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16402
16403                                 continue
16404                         elif test "${cf_tst_cflags}" = "\"'" ; then
16405
16406         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16407         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16408
16409                                 continue
16410                         fi
16411                         ;;
16412                 esac
16413                 case "$CPPFLAGS" in
16414                 (*$cf_add_cflags)
16415                         ;;
16416                 (*)
16417                         case $cf_add_cflags in
16418                         (-D*)
16419                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16420
16421 CPPFLAGS=`echo "$CPPFLAGS" | \
16422         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16423                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16424
16425                                 ;;
16426                         esac
16427
16428         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16429         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16430
16431                         ;;
16432                 esac
16433                 ;;
16434         (*)
16435
16436         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16437         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16438
16439                 ;;
16440         esac
16441         ;;
16442 (yes)
16443
16444         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16445         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16446
16447         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16448
16449         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16450                 && test -z "${cf_tst_cflags}" \
16451                 && cf_fix_cppflags=no
16452         ;;
16453 esac
16454 done
16455
16456 if test -n "$cf_new_cflags" ; then
16457
16458         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16459         CFLAGS="${CFLAGS}$cf_new_cflags"
16460
16461 fi
16462
16463 if test -n "$cf_new_cppflags" ; then
16464
16465         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16466         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16467
16468 fi
16469
16470 if test -n "$cf_new_extra_cppflags" ; then
16471
16472         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16473         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16474
16475 fi
16476
16477 cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
16478 # Filter out duplicates - this happens with badly-designed ".pc" files...
16479 for cf_add_1lib in $LIBS
16480 do
16481         for cf_add_2lib in $cf_add_libs
16482         do
16483                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16484                 then
16485                         cf_add_1lib=
16486                         break
16487                 fi
16488         done
16489         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16490 done
16491 LIBS="$cf_add_libs"
16492
16493                 cat >conftest.$ac_ext <<_ACEOF
16494 #line 16494 "configure"
16495 #include "confdefs.h"
16496 #include <form.h>
16497 int
16498 main (void)
16499 {
16500 (void) form_driver ( 0,0 );
16501   ;
16502   return 0;
16503 }
16504 _ACEOF
16505 rm -f conftest.$ac_objext conftest$ac_exeext
16506 if { (eval echo "$as_me:16506: \"$ac_link\"") >&5
16507   (eval $ac_link) 2>&5
16508   ac_status=$?
16509   echo "$as_me:16509: \$? = $ac_status" >&5
16510   (exit $ac_status); } &&
16511          { ac_try='test -s conftest$ac_exeext'
16512   { (eval echo "$as_me:16512: \"$ac_try\"") >&5
16513   (eval $ac_try) 2>&5
16514   ac_status=$?
16515   echo "$as_me:16515: \$? = $ac_status" >&5
16516   (exit $ac_status); }; }; then
16517   if test "$cross_compiling" = yes; then
16518   cf_have_curses_lib=maybe
16519 else
16520   cat >conftest.$ac_ext <<_ACEOF
16521 #line 16521 "configure"
16522 #include "confdefs.h"
16523 #include <form.h>
16524                                 int main(void)
16525                                 { (void) form_driver ( 0,0 ); return 0; }
16526 _ACEOF
16527 rm -f conftest$ac_exeext
16528 if { (eval echo "$as_me:16528: \"$ac_link\"") >&5
16529   (eval $ac_link) 2>&5
16530   ac_status=$?
16531   echo "$as_me:16531: \$? = $ac_status" >&5
16532   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16533   { (eval echo "$as_me:16533: \"$ac_try\"") >&5
16534   (eval $ac_try) 2>&5
16535   ac_status=$?
16536   echo "$as_me:16536: \$? = $ac_status" >&5
16537   (exit $ac_status); }; }; then
16538   cf_have_curses_lib=yes
16539 else
16540   echo "$as_me: program exited with status $ac_status" >&5
16541 echo "$as_me: failed program was:" >&5
16542 cat conftest.$ac_ext >&5
16543 cf_have_curses_lib=no
16544 fi
16545 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16546 fi
16547 else
16548   echo "$as_me: failed program was:" >&5
16549 cat conftest.$ac_ext >&5
16550 cf_have_curses_lib=no
16551 fi
16552 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16553                 echo "$as_me:16553: result: $cf_have_curses_lib" >&5
16554 echo "${ECHO_T}$cf_have_curses_lib" >&6
16555                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16556                 if test "$cf_have_curses_lib" != "yes"
16557                 then
16558                         CPPFLAGS="$cf_save_CPPFLAGS"
16559                         LIBS="$cf_save_LIBS"
16560                 else
16561
16562 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16563
16564                         cat >>confdefs.h <<EOF
16565 #define $cf_upper 1
16566 EOF
16567
16568                 fi
16569         fi
16570 fi
16571 if test "$cf_have_curses_lib" = no; then
16572         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
16573 echo "$as_me:16573: checking for form_driver in -lform$cf_cv_libtype" >&5
16574 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
16575 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16576   echo $ECHO_N "(cached) $ECHO_C" >&6
16577 else
16578   ac_check_lib_save_LIBS=$LIBS
16579 LIBS="-lform$cf_cv_libtype  $LIBS"
16580 cat >conftest.$ac_ext <<_ACEOF
16581 #line 16581 "configure"
16582 #include "confdefs.h"
16583
16584 /* Override any gcc2 internal prototype to avoid an error.  */
16585 #ifdef __cplusplus
16586 extern "C"
16587 #endif
16588 /* We use char because int might match the return type of a gcc2
16589    builtin and then its argument prototype would still apply.  */
16590 char form_driver ();
16591 int
16592 main (void)
16593 {
16594 form_driver ();
16595   ;
16596   return 0;
16597 }
16598 _ACEOF
16599 rm -f conftest.$ac_objext conftest$ac_exeext
16600 if { (eval echo "$as_me:16600: \"$ac_link\"") >&5
16601   (eval $ac_link) 2>&5
16602   ac_status=$?
16603   echo "$as_me:16603: \$? = $ac_status" >&5
16604   (exit $ac_status); } &&
16605          { ac_try='test -s conftest$ac_exeext'
16606   { (eval echo "$as_me:16606: \"$ac_try\"") >&5
16607   (eval $ac_try) 2>&5
16608   ac_status=$?
16609   echo "$as_me:16609: \$? = $ac_status" >&5
16610   (exit $ac_status); }; }; then
16611   eval "$as_ac_Lib=yes"
16612 else
16613   echo "$as_me: failed program was:" >&5
16614 cat conftest.$ac_ext >&5
16615 eval "$as_ac_Lib=no"
16616 fi
16617 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16618 LIBS=$ac_check_lib_save_LIBS
16619 fi
16620 echo "$as_me:16620: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16621 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16622 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16623
16624 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16625
16626 cf_add_libs="-lform$cf_cv_libtype"
16627 # Filter out duplicates - this happens with badly-designed ".pc" files...
16628 for cf_add_1lib in $LIBS
16629 do
16630         for cf_add_2lib in $cf_add_libs
16631         do
16632                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16633                 then
16634                         cf_add_1lib=
16635                         break
16636                 fi
16637         done
16638         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16639 done
16640 LIBS="$cf_add_libs"
16641
16642                 cat >>confdefs.h <<EOF
16643 #define $cf_upper 1
16644 EOF
16645
16646 fi
16647
16648 fi
16649
16650         cf_curses_headers="$cf_curses_headers form.h"
16651 fi
16652
16653 # look for curses-related headers
16654
16655 for ac_header in $cf_curses_headers
16656 do
16657 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16658 echo "$as_me:16658: checking for $ac_header" >&5
16659 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16660 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16661   echo $ECHO_N "(cached) $ECHO_C" >&6
16662 else
16663   cat >conftest.$ac_ext <<_ACEOF
16664 #line 16664 "configure"
16665 #include "confdefs.h"
16666 #include <$ac_header>
16667 _ACEOF
16668 if { (eval echo "$as_me:16668: \"$ac_cpp conftest.$ac_ext\"") >&5
16669   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16670   ac_status=$?
16671   egrep -v '^ *\+' conftest.er1 >conftest.err
16672   rm -f conftest.er1
16673   cat conftest.err >&5
16674   echo "$as_me:16674: \$? = $ac_status" >&5
16675   (exit $ac_status); } >/dev/null; then
16676   if test -s conftest.err; then
16677     ac_cpp_err=$ac_c_preproc_warn_flag
16678   else
16679     ac_cpp_err=
16680   fi
16681 else
16682   ac_cpp_err=yes
16683 fi
16684 if test -z "$ac_cpp_err"; then
16685   eval "$as_ac_Header=yes"
16686 else
16687   echo "$as_me: failed program was:" >&5
16688   cat conftest.$ac_ext >&5
16689   eval "$as_ac_Header=no"
16690 fi
16691 rm -f conftest.err conftest.$ac_ext
16692 fi
16693 echo "$as_me:16693: result: `eval echo '${'$as_ac_Header'}'`" >&5
16694 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16695 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16696   cat >>confdefs.h <<EOF
16697 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16698 EOF
16699
16700 fi
16701 done
16702
16703 echo "$as_me:16703: checking for ANSI C header files" >&5
16704 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16705 if test "${ac_cv_header_stdc+set}" = set; then
16706   echo $ECHO_N "(cached) $ECHO_C" >&6
16707 else
16708   cat >conftest.$ac_ext <<_ACEOF
16709 #line 16709 "configure"
16710 #include "confdefs.h"
16711 #include <stdlib.h>
16712 #include <stdarg.h>
16713 #include <string.h>
16714 #include <float.h>
16715
16716 _ACEOF
16717 if { (eval echo "$as_me:16717: \"$ac_cpp conftest.$ac_ext\"") >&5
16718   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16719   ac_status=$?
16720   egrep -v '^ *\+' conftest.er1 >conftest.err
16721   rm -f conftest.er1
16722   cat conftest.err >&5
16723   echo "$as_me:16723: \$? = $ac_status" >&5
16724   (exit $ac_status); } >/dev/null; then
16725   if test -s conftest.err; then
16726     ac_cpp_err=$ac_c_preproc_warn_flag
16727   else
16728     ac_cpp_err=
16729   fi
16730 else
16731   ac_cpp_err=yes
16732 fi
16733 if test -z "$ac_cpp_err"; then
16734   ac_cv_header_stdc=yes
16735 else
16736   echo "$as_me: failed program was:" >&5
16737   cat conftest.$ac_ext >&5
16738   ac_cv_header_stdc=no
16739 fi
16740 rm -f conftest.err conftest.$ac_ext
16741
16742 if test $ac_cv_header_stdc = yes; then
16743   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16744   cat >conftest.$ac_ext <<_ACEOF
16745 #line 16745 "configure"
16746 #include "confdefs.h"
16747 #include <string.h>
16748
16749 _ACEOF
16750 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16751   egrep "memchr" >/dev/null 2>&1; then
16752   :
16753 else
16754   ac_cv_header_stdc=no
16755 fi
16756 rm -rf conftest*
16757
16758 fi
16759
16760 if test $ac_cv_header_stdc = yes; then
16761   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16762   cat >conftest.$ac_ext <<_ACEOF
16763 #line 16763 "configure"
16764 #include "confdefs.h"
16765 #include <stdlib.h>
16766
16767 _ACEOF
16768 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16769   egrep "free" >/dev/null 2>&1; then
16770   :
16771 else
16772   ac_cv_header_stdc=no
16773 fi
16774 rm -rf conftest*
16775
16776 fi
16777
16778 if test $ac_cv_header_stdc = yes; then
16779   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16780   if test "$cross_compiling" = yes; then
16781   :
16782 else
16783   cat >conftest.$ac_ext <<_ACEOF
16784 #line 16784 "configure"
16785 #include "confdefs.h"
16786 #include <ctype.h>
16787 #if ((' ' & 0x0FF) == 0x020)
16788 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16789 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16790 #else
16791 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16792                      || ('j' <= (c) && (c) <= 'r') \
16793                      || ('s' <= (c) && (c) <= 'z'))
16794 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16795 #endif
16796
16797 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16798 int
16799 main (void)
16800 {
16801   int i;
16802   for (i = 0; i < 256; i++)
16803     if (XOR (islower (i), ISLOWER (i))
16804         || toupper (i) != TOUPPER (i))
16805       $ac_main_return(2);
16806   $ac_main_return (0);
16807 }
16808 _ACEOF
16809 rm -f conftest$ac_exeext
16810 if { (eval echo "$as_me:16810: \"$ac_link\"") >&5
16811   (eval $ac_link) 2>&5
16812   ac_status=$?
16813   echo "$as_me:16813: \$? = $ac_status" >&5
16814   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16815   { (eval echo "$as_me:16815: \"$ac_try\"") >&5
16816   (eval $ac_try) 2>&5
16817   ac_status=$?
16818   echo "$as_me:16818: \$? = $ac_status" >&5
16819   (exit $ac_status); }; }; then
16820   :
16821 else
16822   echo "$as_me: program exited with status $ac_status" >&5
16823 echo "$as_me: failed program was:" >&5
16824 cat conftest.$ac_ext >&5
16825 ac_cv_header_stdc=no
16826 fi
16827 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16828 fi
16829 fi
16830 fi
16831 echo "$as_me:16831: result: $ac_cv_header_stdc" >&5
16832 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16833 if test $ac_cv_header_stdc = yes; then
16834
16835 cat >>confdefs.h <<\EOF
16836 #define STDC_HEADERS 1
16837 EOF
16838
16839 fi
16840
16841 echo "$as_me:16841: checking whether time.h and sys/time.h may both be included" >&5
16842 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16843 if test "${ac_cv_header_time+set}" = set; then
16844   echo $ECHO_N "(cached) $ECHO_C" >&6
16845 else
16846   cat >conftest.$ac_ext <<_ACEOF
16847 #line 16847 "configure"
16848 #include "confdefs.h"
16849 #include <sys/types.h>
16850 #include <sys/time.h>
16851 #include <time.h>
16852
16853 int
16854 main (void)
16855 {
16856 if ((struct tm *) 0)
16857 return 0;
16858   ;
16859   return 0;
16860 }
16861 _ACEOF
16862 rm -f conftest.$ac_objext
16863 if { (eval echo "$as_me:16863: \"$ac_compile\"") >&5
16864   (eval $ac_compile) 2>&5
16865   ac_status=$?
16866   echo "$as_me:16866: \$? = $ac_status" >&5
16867   (exit $ac_status); } &&
16868          { ac_try='test -s conftest.$ac_objext'
16869   { (eval echo "$as_me:16869: \"$ac_try\"") >&5
16870   (eval $ac_try) 2>&5
16871   ac_status=$?
16872   echo "$as_me:16872: \$? = $ac_status" >&5
16873   (exit $ac_status); }; }; then
16874   ac_cv_header_time=yes
16875 else
16876   echo "$as_me: failed program was:" >&5
16877 cat conftest.$ac_ext >&5
16878 ac_cv_header_time=no
16879 fi
16880 rm -f conftest.$ac_objext conftest.$ac_ext
16881 fi
16882 echo "$as_me:16882: result: $ac_cv_header_time" >&5
16883 echo "${ECHO_T}$ac_cv_header_time" >&6
16884 if test $ac_cv_header_time = yes; then
16885
16886 cat >>confdefs.h <<\EOF
16887 #define TIME_WITH_SYS_TIME 1
16888 EOF
16889
16890 fi
16891
16892 for ac_header in \
16893 getopt.h \
16894 locale.h \
16895 math.h \
16896 stdarg.h \
16897 stdint.h \
16898 sys/ioctl.h \
16899 sys/select.h \
16900 sys/time.h \
16901 termios.h \
16902 unistd.h \
16903
16904 do
16905 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16906 echo "$as_me:16906: checking for $ac_header" >&5
16907 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16908 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16909   echo $ECHO_N "(cached) $ECHO_C" >&6
16910 else
16911   cat >conftest.$ac_ext <<_ACEOF
16912 #line 16912 "configure"
16913 #include "confdefs.h"
16914 #include <$ac_header>
16915 _ACEOF
16916 if { (eval echo "$as_me:16916: \"$ac_cpp conftest.$ac_ext\"") >&5
16917   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16918   ac_status=$?
16919   egrep -v '^ *\+' conftest.er1 >conftest.err
16920   rm -f conftest.er1
16921   cat conftest.err >&5
16922   echo "$as_me:16922: \$? = $ac_status" >&5
16923   (exit $ac_status); } >/dev/null; then
16924   if test -s conftest.err; then
16925     ac_cpp_err=$ac_c_preproc_warn_flag
16926   else
16927     ac_cpp_err=
16928   fi
16929 else
16930   ac_cpp_err=yes
16931 fi
16932 if test -z "$ac_cpp_err"; then
16933   eval "$as_ac_Header=yes"
16934 else
16935   echo "$as_me: failed program was:" >&5
16936   cat conftest.$ac_ext >&5
16937   eval "$as_ac_Header=no"
16938 fi
16939 rm -f conftest.err conftest.$ac_ext
16940 fi
16941 echo "$as_me:16941: result: `eval echo '${'$as_ac_Header'}'`" >&5
16942 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16943 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16944   cat >>confdefs.h <<EOF
16945 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16946 EOF
16947
16948 fi
16949 done
16950
16951 for ac_header in unistd.h getopt.h
16952 do
16953 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16954 echo "$as_me:16954: checking for $ac_header" >&5
16955 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16956 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16957   echo $ECHO_N "(cached) $ECHO_C" >&6
16958 else
16959   cat >conftest.$ac_ext <<_ACEOF
16960 #line 16960 "configure"
16961 #include "confdefs.h"
16962 #include <$ac_header>
16963 _ACEOF
16964 if { (eval echo "$as_me:16964: \"$ac_cpp conftest.$ac_ext\"") >&5
16965   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16966   ac_status=$?
16967   egrep -v '^ *\+' conftest.er1 >conftest.err
16968   rm -f conftest.er1
16969   cat conftest.err >&5
16970   echo "$as_me:16970: \$? = $ac_status" >&5
16971   (exit $ac_status); } >/dev/null; then
16972   if test -s conftest.err; then
16973     ac_cpp_err=$ac_c_preproc_warn_flag
16974   else
16975     ac_cpp_err=
16976   fi
16977 else
16978   ac_cpp_err=yes
16979 fi
16980 if test -z "$ac_cpp_err"; then
16981   eval "$as_ac_Header=yes"
16982 else
16983   echo "$as_me: failed program was:" >&5
16984   cat conftest.$ac_ext >&5
16985   eval "$as_ac_Header=no"
16986 fi
16987 rm -f conftest.err conftest.$ac_ext
16988 fi
16989 echo "$as_me:16989: result: `eval echo '${'$as_ac_Header'}'`" >&5
16990 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16991 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16992   cat >>confdefs.h <<EOF
16993 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16994 EOF
16995
16996 fi
16997 done
16998
16999 echo "$as_me:16999: checking for header declaring getopt variables" >&5
17000 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17001 if test "${cf_cv_getopt_header+set}" = set; then
17002   echo $ECHO_N "(cached) $ECHO_C" >&6
17003 else
17004
17005 cf_cv_getopt_header=none
17006 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17007 do
17008 cat >conftest.$ac_ext <<_ACEOF
17009 #line 17009 "configure"
17010 #include "confdefs.h"
17011
17012 #include <$cf_header>
17013 int
17014 main (void)
17015 {
17016 int x = optind; char *y = optarg
17017   ;
17018   return 0;
17019 }
17020 _ACEOF
17021 rm -f conftest.$ac_objext
17022 if { (eval echo "$as_me:17022: \"$ac_compile\"") >&5
17023   (eval $ac_compile) 2>&5
17024   ac_status=$?
17025   echo "$as_me:17025: \$? = $ac_status" >&5
17026   (exit $ac_status); } &&
17027          { ac_try='test -s conftest.$ac_objext'
17028   { (eval echo "$as_me:17028: \"$ac_try\"") >&5
17029   (eval $ac_try) 2>&5
17030   ac_status=$?
17031   echo "$as_me:17031: \$? = $ac_status" >&5
17032   (exit $ac_status); }; }; then
17033   cf_cv_getopt_header=$cf_header
17034  break
17035 else
17036   echo "$as_me: failed program was:" >&5
17037 cat conftest.$ac_ext >&5
17038 fi
17039 rm -f conftest.$ac_objext conftest.$ac_ext
17040 done
17041
17042 fi
17043 echo "$as_me:17043: result: $cf_cv_getopt_header" >&5
17044 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17045 if test $cf_cv_getopt_header != none ; then
17046
17047 cat >>confdefs.h <<\EOF
17048 #define HAVE_GETOPT_HEADER 1
17049 EOF
17050
17051 fi
17052 if test $cf_cv_getopt_header = getopt.h ; then
17053
17054 cat >>confdefs.h <<\EOF
17055 #define NEED_GETOPT_H 1
17056 EOF
17057
17058 fi
17059
17060 for ac_func in \
17061 getopt \
17062 gettimeofday \
17063 strstr \
17064 tsearch \
17065
17066 do
17067 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17068 echo "$as_me:17068: checking for $ac_func" >&5
17069 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17070 if eval "test \"\${$as_ac_var+set}\" = set"; then
17071   echo $ECHO_N "(cached) $ECHO_C" >&6
17072 else
17073   cat >conftest.$ac_ext <<_ACEOF
17074 #line 17074 "configure"
17075 #include "confdefs.h"
17076 #define $ac_func autoconf_temporary
17077 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17078 #undef $ac_func
17079
17080 #ifdef __cplusplus
17081 extern "C"
17082 #endif
17083
17084 /* We use char because int might match the return type of a gcc2
17085    builtin and then its argument prototype would still apply.  */
17086 char $ac_func (void);
17087
17088 int
17089 main (void)
17090 {
17091
17092 /* The GNU C library defines stubs for functions which it implements
17093     to always fail with ENOSYS.  Some functions are actually named
17094     something starting with __ and the normal name is an alias.  */
17095 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17096 #error found stub for $ac_func
17097 #endif
17098
17099         return $ac_func ();
17100   ;
17101   return 0;
17102 }
17103 _ACEOF
17104 rm -f conftest.$ac_objext conftest$ac_exeext
17105 if { (eval echo "$as_me:17105: \"$ac_link\"") >&5
17106   (eval $ac_link) 2>&5
17107   ac_status=$?
17108   echo "$as_me:17108: \$? = $ac_status" >&5
17109   (exit $ac_status); } &&
17110          { ac_try='test -s conftest$ac_exeext'
17111   { (eval echo "$as_me:17111: \"$ac_try\"") >&5
17112   (eval $ac_try) 2>&5
17113   ac_status=$?
17114   echo "$as_me:17114: \$? = $ac_status" >&5
17115   (exit $ac_status); }; }; then
17116   eval "$as_ac_var=yes"
17117 else
17118   echo "$as_me: failed program was:" >&5
17119 cat conftest.$ac_ext >&5
17120 eval "$as_ac_var=no"
17121 fi
17122 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17123 fi
17124 echo "$as_me:17124: result: `eval echo '${'$as_ac_var'}'`" >&5
17125 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17126 if test `eval echo '${'$as_ac_var'}'` = yes; then
17127   cat >>confdefs.h <<EOF
17128 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17129 EOF
17130
17131 fi
17132 done
17133
17134 # use a compile-check to work with ncurses*-config and subdirectory includes
17135 echo "$as_me:17135: checking if we can use termcap.h" >&5
17136 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17137 if test "${cf_cv_have_termcap_h+set}" = set; then
17138   echo $ECHO_N "(cached) $ECHO_C" >&6
17139 else
17140
17141         cat >conftest.$ac_ext <<_ACEOF
17142 #line 17142 "configure"
17143 #include "confdefs.h"
17144
17145 #include <curses.h>
17146 #ifdef NCURSES_VERSION
17147 #undef NCURSES_VERSION
17148 #endif
17149 #include <termcap.h>
17150 #ifndef NCURSES_VERSION
17151 #error wrong header
17152 #endif
17153
17154 int
17155 main (void)
17156 {
17157 return 0;
17158   ;
17159   return 0;
17160 }
17161 _ACEOF
17162 rm -f conftest.$ac_objext
17163 if { (eval echo "$as_me:17163: \"$ac_compile\"") >&5
17164   (eval $ac_compile) 2>&5
17165   ac_status=$?
17166   echo "$as_me:17166: \$? = $ac_status" >&5
17167   (exit $ac_status); } &&
17168          { ac_try='test -s conftest.$ac_objext'
17169   { (eval echo "$as_me:17169: \"$ac_try\"") >&5
17170   (eval $ac_try) 2>&5
17171   ac_status=$?
17172   echo "$as_me:17172: \$? = $ac_status" >&5
17173   (exit $ac_status); }; }; then
17174   cf_cv_have_termcap_h=yes
17175 else
17176   echo "$as_me: failed program was:" >&5
17177 cat conftest.$ac_ext >&5
17178 cf_cv_have_termcap_h=no
17179 fi
17180 rm -f conftest.$ac_objext conftest.$ac_ext
17181 fi
17182 echo "$as_me:17182: result: $cf_cv_have_termcap_h" >&5
17183 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17184 if test "x$cf_cv_have_termcap_h" = xyes
17185 then
17186         cat >>confdefs.h <<\EOF
17187 #define HAVE_TERMCAP_H 1
17188 EOF
17189
17190 else
17191 echo "$as_me:17191: checking if we can use ncurses/termcap.h" >&5
17192 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17193 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17194   echo $ECHO_N "(cached) $ECHO_C" >&6
17195 else
17196
17197         cat >conftest.$ac_ext <<_ACEOF
17198 #line 17198 "configure"
17199 #include "confdefs.h"
17200
17201 #include <ncurses/curses.h>
17202 #ifdef NCURSES_VERSION
17203 #undef NCURSES_VERSION
17204 #endif
17205 #include <ncurses/termcap.h>
17206 #ifndef NCURSES_VERSION
17207 #error wrong header
17208 #endif
17209
17210 int
17211 main (void)
17212 {
17213 return 0;
17214   ;
17215   return 0;
17216 }
17217 _ACEOF
17218 rm -f conftest.$ac_objext
17219 if { (eval echo "$as_me:17219: \"$ac_compile\"") >&5
17220   (eval $ac_compile) 2>&5
17221   ac_status=$?
17222   echo "$as_me:17222: \$? = $ac_status" >&5
17223   (exit $ac_status); } &&
17224          { ac_try='test -s conftest.$ac_objext'
17225   { (eval echo "$as_me:17225: \"$ac_try\"") >&5
17226   (eval $ac_try) 2>&5
17227   ac_status=$?
17228   echo "$as_me:17228: \$? = $ac_status" >&5
17229   (exit $ac_status); }; }; then
17230   cf_cv_have_ncurses_termcap_h=yes
17231 else
17232   echo "$as_me: failed program was:" >&5
17233 cat conftest.$ac_ext >&5
17234 cf_cv_have_ncurses_termcap_h=no
17235 fi
17236 rm -f conftest.$ac_objext conftest.$ac_ext
17237 fi
17238 echo "$as_me:17238: result: $cf_cv_have_ncurses_termcap_h" >&5
17239 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17240 test "x$cf_cv_have_ncurses_termcap_h" = xyes && cat >>confdefs.h <<\EOF
17241 #define HAVE_NCURSES_TERMCAP_H 1
17242 EOF
17243
17244 fi
17245
17246 if test "x$ac_cv_func_getopt" = xno; then
17247         { { echo "$as_me:17247: error: getopt is required for building programs" >&5
17248 echo "$as_me: error: getopt is required for building programs" >&2;}
17249    { (exit 1); exit 1; }; }
17250 fi
17251
17252 if test "$cf_enable_widec" = yes; then
17253
17254 for ac_func in \
17255 mblen \
17256 mbrlen \
17257 mbrtowc \
17258 mbsrtowcs \
17259 mbstowcs \
17260 mbtowc \
17261 wcsrtombs \
17262 wcstombs \
17263
17264 do
17265 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17266 echo "$as_me:17266: checking for $ac_func" >&5
17267 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17268 if eval "test \"\${$as_ac_var+set}\" = set"; then
17269   echo $ECHO_N "(cached) $ECHO_C" >&6
17270 else
17271   cat >conftest.$ac_ext <<_ACEOF
17272 #line 17272 "configure"
17273 #include "confdefs.h"
17274 #define $ac_func autoconf_temporary
17275 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17276 #undef $ac_func
17277
17278 #ifdef __cplusplus
17279 extern "C"
17280 #endif
17281
17282 /* We use char because int might match the return type of a gcc2
17283    builtin and then its argument prototype would still apply.  */
17284 char $ac_func (void);
17285
17286 int
17287 main (void)
17288 {
17289
17290 /* The GNU C library defines stubs for functions which it implements
17291     to always fail with ENOSYS.  Some functions are actually named
17292     something starting with __ and the normal name is an alias.  */
17293 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17294 #error found stub for $ac_func
17295 #endif
17296
17297         return $ac_func ();
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   eval "$as_ac_var=yes"
17315 else
17316   echo "$as_me: failed program was:" >&5
17317 cat conftest.$ac_ext >&5
17318 eval "$as_ac_var=no"
17319 fi
17320 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17321 fi
17322 echo "$as_me:17322: result: `eval echo '${'$as_ac_var'}'`" >&5
17323 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17324 if test `eval echo '${'$as_ac_var'}'` = yes; then
17325   cat >>confdefs.h <<EOF
17326 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17327 EOF
17328
17329 fi
17330 done
17331
17332 fi
17333
17334 echo "$as_me:17334: checking definition to turn on extended curses functions" >&5
17335 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17336 if test "${cf_cv_need_xopen_extension+set}" = set; then
17337   echo $ECHO_N "(cached) $ECHO_C" >&6
17338 else
17339
17340 cf_cv_need_xopen_extension=unknown
17341 cat >conftest.$ac_ext <<_ACEOF
17342 #line 17342 "configure"
17343 #include "confdefs.h"
17344
17345 #include <stdlib.h>
17346 #include <${cf_cv_ncurses_header:-curses.h}>
17347 int
17348 main (void)
17349 {
17350
17351 #if defined(NCURSES_VERSION_PATCH)
17352 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17353         make an error
17354 #endif
17355 #endif
17356 #ifdef NCURSES_VERSION
17357         cchar_t check;
17358         int check2 = curs_set((int)sizeof(check));
17359 #endif
17360         long x = winnstr(stdscr, "", 0);
17361         int x1, y1;
17362         getbegyx(stdscr, y1, x1)
17363   ;
17364   return 0;
17365 }
17366 _ACEOF
17367 rm -f conftest.$ac_objext conftest$ac_exeext
17368 if { (eval echo "$as_me:17368: \"$ac_link\"") >&5
17369   (eval $ac_link) 2>&5
17370   ac_status=$?
17371   echo "$as_me:17371: \$? = $ac_status" >&5
17372   (exit $ac_status); } &&
17373          { ac_try='test -s conftest$ac_exeext'
17374   { (eval echo "$as_me:17374: \"$ac_try\"") >&5
17375   (eval $ac_try) 2>&5
17376   ac_status=$?
17377   echo "$as_me:17377: \$? = $ac_status" >&5
17378   (exit $ac_status); }; }; then
17379   cf_cv_need_xopen_extension=none
17380 else
17381   echo "$as_me: failed program was:" >&5
17382 cat conftest.$ac_ext >&5
17383
17384         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17385         do
17386                 cat >conftest.$ac_ext <<_ACEOF
17387 #line 17387 "configure"
17388 #include "confdefs.h"
17389
17390 #define $cf_try_xopen_extension 1
17391 #include <stdlib.h>
17392 #include <${cf_cv_ncurses_header:-curses.h}>
17393 int
17394 main (void)
17395 {
17396
17397 #ifdef NCURSES_VERSION
17398                 cchar_t check;
17399                 int check2 = curs_set((int)sizeof(check));
17400 #endif
17401                 long x = winnstr(stdscr, "", 0);
17402                 int x1, y1;
17403                 getbegyx(stdscr, y1, x1)
17404   ;
17405   return 0;
17406 }
17407 _ACEOF
17408 rm -f conftest.$ac_objext conftest$ac_exeext
17409 if { (eval echo "$as_me:17409: \"$ac_link\"") >&5
17410   (eval $ac_link) 2>&5
17411   ac_status=$?
17412   echo "$as_me:17412: \$? = $ac_status" >&5
17413   (exit $ac_status); } &&
17414          { ac_try='test -s conftest$ac_exeext'
17415   { (eval echo "$as_me:17415: \"$ac_try\"") >&5
17416   (eval $ac_try) 2>&5
17417   ac_status=$?
17418   echo "$as_me:17418: \$? = $ac_status" >&5
17419   (exit $ac_status); }; }; then
17420   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17421 else
17422   echo "$as_me: failed program was:" >&5
17423 cat conftest.$ac_ext >&5
17424 fi
17425 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17426         done
17427
17428 fi
17429 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17430
17431 fi
17432 echo "$as_me:17432: result: $cf_cv_need_xopen_extension" >&5
17433 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17434
17435 case $cf_cv_need_xopen_extension in
17436 (*_*)
17437
17438         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17439         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17440
17441         ;;
17442 esac
17443
17444 echo "$as_me:17444: checking for term.h" >&5
17445 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17446 if test "${cf_cv_term_header+set}" = set; then
17447   echo $ECHO_N "(cached) $ECHO_C" >&6
17448 else
17449
17450 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17451 # for <term.h> if we do not find the variant.
17452
17453 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17454
17455 case ${cf_cv_ncurses_header:-curses.h} in
17456 (*/*)
17457         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17458         cf_header_list="$cf_header_item $cf_header_list"
17459         ;;
17460 esac
17461
17462 for cf_header in $cf_header_list
17463 do
17464         cat >conftest.$ac_ext <<_ACEOF
17465 #line 17465 "configure"
17466 #include "confdefs.h"
17467
17468 #include <${cf_cv_ncurses_header:-curses.h}>
17469 #include <${cf_header}>
17470 int
17471 main (void)
17472 {
17473 WINDOW *x
17474   ;
17475   return 0;
17476 }
17477 _ACEOF
17478 rm -f conftest.$ac_objext
17479 if { (eval echo "$as_me:17479: \"$ac_compile\"") >&5
17480   (eval $ac_compile) 2>&5
17481   ac_status=$?
17482   echo "$as_me:17482: \$? = $ac_status" >&5
17483   (exit $ac_status); } &&
17484          { ac_try='test -s conftest.$ac_objext'
17485   { (eval echo "$as_me:17485: \"$ac_try\"") >&5
17486   (eval $ac_try) 2>&5
17487   ac_status=$?
17488   echo "$as_me:17488: \$? = $ac_status" >&5
17489   (exit $ac_status); }; }; then
17490   cf_cv_term_header=$cf_header
17491          break
17492 else
17493   echo "$as_me: failed program was:" >&5
17494 cat conftest.$ac_ext >&5
17495 cf_cv_term_header=no
17496 fi
17497 rm -f conftest.$ac_objext conftest.$ac_ext
17498 done
17499
17500 case $cf_cv_term_header in
17501 (no)
17502         # If curses is ncurses, some packagers still mess it up by trying to make
17503         # us use GNU termcap.  This handles the most common case.
17504         for cf_header in ncurses/term.h ncursesw/term.h
17505         do
17506                 cat >conftest.$ac_ext <<_ACEOF
17507 #line 17507 "configure"
17508 #include "confdefs.h"
17509
17510 #include <${cf_cv_ncurses_header:-curses.h}>
17511 #ifdef NCURSES_VERSION
17512 #include <${cf_header}>
17513 #else
17514 make an error
17515 #endif
17516 int
17517 main (void)
17518 {
17519 WINDOW *x
17520   ;
17521   return 0;
17522 }
17523 _ACEOF
17524 rm -f conftest.$ac_objext
17525 if { (eval echo "$as_me:17525: \"$ac_compile\"") >&5
17526   (eval $ac_compile) 2>&5
17527   ac_status=$?
17528   echo "$as_me:17528: \$? = $ac_status" >&5
17529   (exit $ac_status); } &&
17530          { ac_try='test -s conftest.$ac_objext'
17531   { (eval echo "$as_me:17531: \"$ac_try\"") >&5
17532   (eval $ac_try) 2>&5
17533   ac_status=$?
17534   echo "$as_me:17534: \$? = $ac_status" >&5
17535   (exit $ac_status); }; }; then
17536   cf_cv_term_header=$cf_header
17537                          break
17538 else
17539   echo "$as_me: failed program was:" >&5
17540 cat conftest.$ac_ext >&5
17541 cf_cv_term_header=no
17542 fi
17543 rm -f conftest.$ac_objext conftest.$ac_ext
17544         done
17545         ;;
17546 esac
17547
17548 fi
17549 echo "$as_me:17549: result: $cf_cv_term_header" >&5
17550 echo "${ECHO_T}$cf_cv_term_header" >&6
17551
17552 case $cf_cv_term_header in
17553 (term.h)
17554
17555 cat >>confdefs.h <<\EOF
17556 #define HAVE_TERM_H 1
17557 EOF
17558
17559         ;;
17560 (ncurses/term.h)
17561
17562 cat >>confdefs.h <<\EOF
17563 #define HAVE_NCURSES_TERM_H 1
17564 EOF
17565
17566         ;;
17567 (ncursesw/term.h)
17568
17569 cat >>confdefs.h <<\EOF
17570 #define HAVE_NCURSESW_TERM_H 1
17571 EOF
17572
17573         ;;
17574 esac
17575
17576 echo "$as_me:17576: checking for unctrl.h" >&5
17577 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
17578 if test "${cf_cv_unctrl_header+set}" = set; then
17579   echo $ECHO_N "(cached) $ECHO_C" >&6
17580 else
17581
17582 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
17583 # for <unctrl.h> if we do not find the variant.
17584
17585 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
17586
17587 case ${cf_cv_ncurses_header:-curses.h} in
17588 (*/*)
17589         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
17590         cf_header_list="$cf_header_item $cf_header_list"
17591         ;;
17592 esac
17593
17594 for cf_header in $cf_header_list
17595 do
17596         cat >conftest.$ac_ext <<_ACEOF
17597 #line 17597 "configure"
17598 #include "confdefs.h"
17599
17600 #include <${cf_cv_ncurses_header:-curses.h}>
17601 #include <${cf_header}>
17602 int
17603 main (void)
17604 {
17605 WINDOW *x
17606   ;
17607   return 0;
17608 }
17609 _ACEOF
17610 rm -f conftest.$ac_objext
17611 if { (eval echo "$as_me:17611: \"$ac_compile\"") >&5
17612   (eval $ac_compile) 2>&5
17613   ac_status=$?
17614   echo "$as_me:17614: \$? = $ac_status" >&5
17615   (exit $ac_status); } &&
17616          { ac_try='test -s conftest.$ac_objext'
17617   { (eval echo "$as_me:17617: \"$ac_try\"") >&5
17618   (eval $ac_try) 2>&5
17619   ac_status=$?
17620   echo "$as_me:17620: \$? = $ac_status" >&5
17621   (exit $ac_status); }; }; then
17622   cf_cv_unctrl_header=$cf_header
17623          break
17624 else
17625   echo "$as_me: failed program was:" >&5
17626 cat conftest.$ac_ext >&5
17627 cf_cv_unctrl_header=no
17628 fi
17629 rm -f conftest.$ac_objext conftest.$ac_ext
17630 done
17631
17632 fi
17633 echo "$as_me:17633: result: $cf_cv_unctrl_header" >&5
17634 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
17635
17636 case $cf_cv_unctrl_header in
17637 (no)
17638         { echo "$as_me:17638: WARNING: unctrl.h header not found" >&5
17639 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
17640         ;;
17641 esac
17642
17643 case $cf_cv_unctrl_header in
17644 (unctrl.h)
17645
17646 cat >>confdefs.h <<\EOF
17647 #define HAVE_UNCTRL_H 1
17648 EOF
17649
17650         ;;
17651 (ncurses/unctrl.h)
17652
17653 cat >>confdefs.h <<\EOF
17654 #define HAVE_NCURSES_UNCTRL_H 1
17655 EOF
17656
17657         ;;
17658 (ncursesw/unctrl.h)
17659
17660 cat >>confdefs.h <<\EOF
17661 #define HAVE_NCURSESW_UNCTRL_H 1
17662 EOF
17663
17664         ;;
17665 esac
17666
17667 for cf_func in \
17668 alloc_pair \
17669 assume_default_colors \
17670 chgat \
17671 color_content \
17672 color_set \
17673 copywin \
17674 delscreen \
17675 dupwin \
17676 filter \
17677 getbegx \
17678 getcurx \
17679 getmaxx \
17680 getnstr \
17681 getparx \
17682 getwin \
17683 halfdelay \
17684 init_extended_color \
17685 mvderwin \
17686 mvvline \
17687 mvwin \
17688 mvwvline \
17689 napms \
17690 newpad \
17691 putwin \
17692 reset_color_pairs \
17693 resize_term \
17694 resizeterm \
17695 restartterm \
17696 ripoffline \
17697 scr_dump \
17698 setupterm \
17699 slk_color \
17700 slk_init \
17701 termattrs \
17702 tgetent \
17703 tigetnum \
17704 tigetstr \
17705 tputs_sp \
17706 typeahead \
17707 use_default_colors \
17708 use_env \
17709 use_extended_names \
17710 use_screen \
17711 use_window \
17712 vid_puts \
17713 vidputs \
17714 vsscanf \
17715 vw_printw \
17716 wchgat \
17717 winsdelln \
17718 winsstr \
17719 wresize \
17720 wsyncdown \
17721 _tracef \
17722
17723 do
17724
17725 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17726
17727         echo "$as_me:17727: checking for ${cf_func}" >&5
17728 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17729
17730 echo "${as_me:-configure}:17730: testing ${cf_func} ..." 1>&5
17731
17732         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17733   echo $ECHO_N "(cached) $ECHO_C" >&6
17734 else
17735
17736                 eval cf_result='$ac_cv_func_'$cf_func
17737                 if test ".$cf_result" != ".no"; then
17738                         cat >conftest.$ac_ext <<_ACEOF
17739 #line 17739 "configure"
17740 #include "confdefs.h"
17741
17742 #ifdef HAVE_XCURSES
17743 #include <xcurses.h>
17744 char * XCursesProgramName = "test";
17745 #else
17746 #include <${cf_cv_ncurses_header:-curses.h}>
17747 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17748 #include <ncursesw/term.h>
17749 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17750 #include <ncurses/term.h>
17751 #elif defined(HAVE_TERM_H)
17752 #include <term.h>
17753 #endif
17754 #endif
17755
17756 int
17757 main (void)
17758 {
17759
17760 #ifndef ${cf_func}
17761 long foo = (long)(&${cf_func});
17762 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17763 if (foo + 1234L > 5678L)
17764         ${cf_cv_main_return:-return}(foo != 0);
17765 #endif
17766
17767   ;
17768   return 0;
17769 }
17770 _ACEOF
17771 rm -f conftest.$ac_objext conftest$ac_exeext
17772 if { (eval echo "$as_me:17772: \"$ac_link\"") >&5
17773   (eval $ac_link) 2>&5
17774   ac_status=$?
17775   echo "$as_me:17775: \$? = $ac_status" >&5
17776   (exit $ac_status); } &&
17777          { ac_try='test -s conftest$ac_exeext'
17778   { (eval echo "$as_me:17778: \"$ac_try\"") >&5
17779   (eval $ac_try) 2>&5
17780   ac_status=$?
17781   echo "$as_me:17781: \$? = $ac_status" >&5
17782   (exit $ac_status); }; }; then
17783   cf_result=yes
17784 else
17785   echo "$as_me: failed program was:" >&5
17786 cat conftest.$ac_ext >&5
17787 cf_result=no
17788 fi
17789 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17790                 fi
17791                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17792
17793 fi
17794
17795         # use the computed/retrieved cache-value:
17796         eval 'cf_result=$cf_cv_func_'$cf_func
17797         echo "$as_me:17797: result: $cf_result" >&5
17798 echo "${ECHO_T}$cf_result" >&6
17799         if test $cf_result != no; then
17800                 cat >>confdefs.h <<EOF
17801 #define HAVE_${cf_tr_func} 1
17802 EOF
17803
17804         fi
17805 done
17806
17807 for cf_func in tputs
17808 do
17809
17810 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17811
17812         echo "$as_me:17812: checking for ${cf_func}" >&5
17813 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17814
17815 echo "${as_me:-configure}:17815: testing ${cf_func} ..." 1>&5
17816
17817         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17818   echo $ECHO_N "(cached) $ECHO_C" >&6
17819 else
17820
17821                 eval cf_result='$ac_cv_func_'$cf_func
17822                 if test ".$cf_result" != ".no"; then
17823                         cat >conftest.$ac_ext <<_ACEOF
17824 #line 17824 "configure"
17825 #include "confdefs.h"
17826
17827 #ifdef HAVE_XCURSES
17828 #include <xcurses.h>
17829 char * XCursesProgramName = "test";
17830 #else
17831 #include <${cf_cv_ncurses_header:-curses.h}>
17832 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17833 #include <ncursesw/term.h>
17834 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17835 #include <ncurses/term.h>
17836 #elif defined(HAVE_TERM_H)
17837 #include <term.h>
17838 #endif
17839 #endif
17840
17841 int
17842 main (void)
17843 {
17844
17845 #ifndef ${cf_func}
17846 long foo = (long)(&${cf_func});
17847 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17848 if (foo + 1234L > 5678L)
17849         ${cf_cv_main_return:-return}(foo != 0);
17850 #endif
17851
17852   ;
17853   return 0;
17854 }
17855 _ACEOF
17856 rm -f conftest.$ac_objext conftest$ac_exeext
17857 if { (eval echo "$as_me:17857: \"$ac_link\"") >&5
17858   (eval $ac_link) 2>&5
17859   ac_status=$?
17860   echo "$as_me:17860: \$? = $ac_status" >&5
17861   (exit $ac_status); } &&
17862          { ac_try='test -s conftest$ac_exeext'
17863   { (eval echo "$as_me:17863: \"$ac_try\"") >&5
17864   (eval $ac_try) 2>&5
17865   ac_status=$?
17866   echo "$as_me:17866: \$? = $ac_status" >&5
17867   (exit $ac_status); }; }; then
17868   cf_result=yes
17869 else
17870   echo "$as_me: failed program was:" >&5
17871 cat conftest.$ac_ext >&5
17872 cf_result=no
17873 fi
17874 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17875                 fi
17876                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17877
17878 fi
17879
17880         # use the computed/retrieved cache-value:
17881         eval 'cf_result=$cf_cv_func_'$cf_func
17882         echo "$as_me:17882: result: $cf_result" >&5
17883 echo "${ECHO_T}$cf_result" >&6
17884         if test $cf_result != no; then
17885                 cat >>confdefs.h <<EOF
17886 #define HAVE_${cf_tr_func} 1
17887 EOF
17888
17889         fi
17890 done
17891
17892 if test x$cf_cv_func_tputs = xyes
17893 then
17894         cf_done=no
17895         for cf_arg in int char
17896         do
17897                 for cf_ret in int void
17898                 do
17899                         if test $cf_ret = void
17900                         then
17901                                 cf_return="/* nothing */"
17902                         else
17903                                 cf_return="return value"
17904                         fi
17905                         cat >conftest.$ac_ext <<_ACEOF
17906 #line 17906 "configure"
17907 #include "confdefs.h"
17908
17909 #include <${cf_cv_ncurses_header:-curses.h}>
17910 #include <$cf_cv_term_header>
17911
17912 static $cf_ret outc($cf_arg value) { $cf_return; }
17913
17914 int
17915 main (void)
17916 {
17917
17918         tputs("hello", 0, outc);
17919         ${cf_cv_main_return:-return}(0);
17920
17921   ;
17922   return 0;
17923 }
17924 _ACEOF
17925 rm -f conftest.$ac_objext
17926 if { (eval echo "$as_me:17926: \"$ac_compile\"") >&5
17927   (eval $ac_compile) 2>&5
17928   ac_status=$?
17929   echo "$as_me:17929: \$? = $ac_status" >&5
17930   (exit $ac_status); } &&
17931          { ac_try='test -s conftest.$ac_objext'
17932   { (eval echo "$as_me:17932: \"$ac_try\"") >&5
17933   (eval $ac_try) 2>&5
17934   ac_status=$?
17935   echo "$as_me:17935: \$? = $ac_status" >&5
17936   (exit $ac_status); }; }; then
17937
17938                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
17939
17940 echo "${as_me:-configure}:17940: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
17941
17942                 cat >>confdefs.h <<EOF
17943 #define TPUTS_ARG               $cf_arg
17944 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
17945 #define TPUTS_RETURN(value)     $cf_return
17946 EOF
17947                 cf_done=yes
17948                 break
17949
17950 else
17951   echo "$as_me: failed program was:" >&5
17952 cat conftest.$ac_ext >&5
17953 fi
17954 rm -f conftest.$ac_objext conftest.$ac_ext
17955                 done
17956                 test $cf_done = yes && break
17957         done
17958 fi
17959
17960 echo "$as_me:17960: checking for ncurses extended functions" >&5
17961 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
17962 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
17963   echo $ECHO_N "(cached) $ECHO_C" >&6
17964 else
17965
17966 cat >conftest.$ac_ext <<_ACEOF
17967 #line 17967 "configure"
17968 #include "confdefs.h"
17969
17970 #include <${cf_cv_ncurses_header:-curses.h}>
17971 int
17972 main (void)
17973 {
17974
17975 int x = NCURSES_EXT_FUNCS
17976
17977   ;
17978   return 0;
17979 }
17980 _ACEOF
17981 rm -f conftest.$ac_objext
17982 if { (eval echo "$as_me:17982: \"$ac_compile\"") >&5
17983   (eval $ac_compile) 2>&5
17984   ac_status=$?
17985   echo "$as_me:17985: \$? = $ac_status" >&5
17986   (exit $ac_status); } &&
17987          { ac_try='test -s conftest.$ac_objext'
17988   { (eval echo "$as_me:17988: \"$ac_try\"") >&5
17989   (eval $ac_try) 2>&5
17990   ac_status=$?
17991   echo "$as_me:17991: \$? = $ac_status" >&5
17992   (exit $ac_status); }; }; then
17993   cf_cv_ncurses_ext_funcs=defined
17994 else
17995   echo "$as_me: failed program was:" >&5
17996 cat conftest.$ac_ext >&5
17997
17998 cat >conftest.$ac_ext <<_ACEOF
17999 #line 17999 "configure"
18000 #include "confdefs.h"
18001
18002 #include <${cf_cv_ncurses_header:-curses.h}>
18003 int
18004 main (void)
18005 {
18006
18007         (void) assume_default_colors (0, 0);
18008         (void) curses_version ();
18009         (void) define_key (0, 0);
18010         (void) is_term_resized (0, 0);
18011         (void) key_defined (0);
18012         (void) keybound (0, 0);
18013         (void) keyok (0, 0);
18014         (void) resize_term (0, 0);
18015         (void) resizeterm (0, 0);
18016         (void) use_default_colors ();
18017         (void) use_extended_names (0);
18018         (void) wresize (0, 0, 0);
18019   ;
18020   return 0;
18021 }
18022 _ACEOF
18023 rm -f conftest.$ac_objext conftest$ac_exeext
18024 if { (eval echo "$as_me:18024: \"$ac_link\"") >&5
18025   (eval $ac_link) 2>&5
18026   ac_status=$?
18027   echo "$as_me:18027: \$? = $ac_status" >&5
18028   (exit $ac_status); } &&
18029          { ac_try='test -s conftest$ac_exeext'
18030   { (eval echo "$as_me:18030: \"$ac_try\"") >&5
18031   (eval $ac_try) 2>&5
18032   ac_status=$?
18033   echo "$as_me:18033: \$? = $ac_status" >&5
18034   (exit $ac_status); }; }; then
18035   cf_cv_ncurses_ext_funcs=yes
18036 else
18037   echo "$as_me: failed program was:" >&5
18038 cat conftest.$ac_ext >&5
18039 cf_cv_ncurses_ext_funcs=no
18040 fi
18041 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18042
18043 fi
18044 rm -f conftest.$ac_objext conftest.$ac_ext
18045
18046 fi
18047 echo "$as_me:18047: result: $cf_cv_ncurses_ext_funcs" >&5
18048 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18049 test "$cf_cv_ncurses_ext_funcs" = yes &&
18050 cat >>confdefs.h <<\EOF
18051 #define NCURSES_EXT_FUNCS 1
18052 EOF
18053
18054 if test "$cf_enable_widec" = yes
18055 then
18056         # workaround for systems with ncurses before 20111029, due to change of
18057         # feature test macro from _XPG5 to _XOPEN_SOURCE
18058         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18059         then
18060                 cf_define_xpg5=no
18061                 echo "$as_me:18061: checking if _XPG5 should be defined to enable wide-characters" >&5
18062 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18063
18064                 cat >conftest.$ac_ext <<_ACEOF
18065 #line 18065 "configure"
18066 #include "confdefs.h"
18067
18068 #include <${cf_cv_ncurses_header:-curses.h}>
18069 int
18070 main (void)
18071 {
18072 int x = _XPG5
18073   ;
18074   return 0;
18075 }
18076 _ACEOF
18077 rm -f conftest.$ac_objext
18078 if { (eval echo "$as_me:18078: \"$ac_compile\"") >&5
18079   (eval $ac_compile) 2>&5
18080   ac_status=$?
18081   echo "$as_me:18081: \$? = $ac_status" >&5
18082   (exit $ac_status); } &&
18083          { ac_try='test -s conftest.$ac_objext'
18084   { (eval echo "$as_me:18084: \"$ac_try\"") >&5
18085   (eval $ac_try) 2>&5
18086   ac_status=$?
18087   echo "$as_me:18087: \$? = $ac_status" >&5
18088   (exit $ac_status); }; }; then
18089   :
18090 else
18091   echo "$as_me: failed program was:" >&5
18092 cat conftest.$ac_ext >&5
18093 cf_save_cppflags="$CPPFLAGS"
18094                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18095                          cat >conftest.$ac_ext <<_ACEOF
18096 #line 18096 "configure"
18097 #include "confdefs.h"
18098
18099 #include <${cf_cv_ncurses_header:-curses.h}>
18100 int
18101 main (void)
18102 {
18103 int x = _XPG5
18104   ;
18105   return 0;
18106 }
18107 _ACEOF
18108 rm -f conftest.$ac_objext
18109 if { (eval echo "$as_me:18109: \"$ac_compile\"") >&5
18110   (eval $ac_compile) 2>&5
18111   ac_status=$?
18112   echo "$as_me:18112: \$? = $ac_status" >&5
18113   (exit $ac_status); } &&
18114          { ac_try='test -s conftest.$ac_objext'
18115   { (eval echo "$as_me:18115: \"$ac_try\"") >&5
18116   (eval $ac_try) 2>&5
18117   ac_status=$?
18118   echo "$as_me:18118: \$? = $ac_status" >&5
18119   (exit $ac_status); }; }; then
18120   cf_define_xpg5=yes
18121 else
18122   echo "$as_me: failed program was:" >&5
18123 cat conftest.$ac_ext >&5
18124 fi
18125 rm -f conftest.$ac_objext conftest.$ac_ext
18126                          CPPFLAGS="$cf_save_cppflags"
18127 fi
18128 rm -f conftest.$ac_objext conftest.$ac_ext
18129                 echo "$as_me:18129: result: $cf_define_xpg5" >&5
18130 echo "${ECHO_T}$cf_define_xpg5" >&6
18131
18132                 if test "$cf_define_xpg5" = yes
18133                 then
18134                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18135                 fi
18136         fi
18137
18138         echo "$as_me:18138: checking for wide-character functions" >&5
18139 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18140 if test "${cf_cv_widechar_funcs+set}" = set; then
18141   echo $ECHO_N "(cached) $ECHO_C" >&6
18142 else
18143
18144         cat >conftest.$ac_ext <<_ACEOF
18145 #line 18145 "configure"
18146 #include "confdefs.h"
18147
18148 #include <${cf_cv_ncurses_header:-curses.h}>
18149 int
18150 main (void)
18151 {
18152
18153                 static wchar_t src_wchar[2];
18154                 static cchar_t dst_cchar;
18155                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18156
18157   ;
18158   return 0;
18159 }
18160 _ACEOF
18161 rm -f conftest.$ac_objext conftest$ac_exeext
18162 if { (eval echo "$as_me:18162: \"$ac_link\"") >&5
18163   (eval $ac_link) 2>&5
18164   ac_status=$?
18165   echo "$as_me:18165: \$? = $ac_status" >&5
18166   (exit $ac_status); } &&
18167          { ac_try='test -s conftest$ac_exeext'
18168   { (eval echo "$as_me:18168: \"$ac_try\"") >&5
18169   (eval $ac_try) 2>&5
18170   ac_status=$?
18171   echo "$as_me:18171: \$? = $ac_status" >&5
18172   (exit $ac_status); }; }; then
18173   cf_cv_widechar_funcs=yes
18174 else
18175   echo "$as_me: failed program was:" >&5
18176 cat conftest.$ac_ext >&5
18177 cf_cv_widechar_funcs=no
18178 fi
18179 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18180
18181 fi
18182 echo "$as_me:18182: result: $cf_cv_widechar_funcs" >&5
18183 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18184         if test "$cf_cv_widechar_funcs" != no ; then
18185
18186 cat >>confdefs.h <<\EOF
18187 #define USE_WIDEC_SUPPORT 1
18188 EOF
18189
18190         else
18191                 cat >>confdefs.h <<\EOF
18192 #define USE_WIDEC_SUPPORT 0
18193 EOF
18194
18195         fi
18196 else
18197         cat >>confdefs.h <<\EOF
18198 #define USE_WIDEC_SUPPORT 0
18199 EOF
18200
18201 fi
18202
18203 echo "$as_me:18203: checking if $cf_cv_screen library uses pthreads" >&5
18204 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18205 if test "${cf_cv_use_pthreads+set}" = set; then
18206   echo $ECHO_N "(cached) $ECHO_C" >&6
18207 else
18208
18209 cat >conftest.$ac_ext <<_ACEOF
18210 #line 18210 "configure"
18211 #include "confdefs.h"
18212
18213 #include <${cf_cv_ncurses_header:-curses.h}>
18214 extern void _nc_init_pthreads(void);
18215
18216 int
18217 main (void)
18218 {
18219
18220         initscr();
18221         _nc_init_pthreads();
18222
18223   ;
18224   return 0;
18225 }
18226 _ACEOF
18227 rm -f conftest.$ac_objext conftest$ac_exeext
18228 if { (eval echo "$as_me:18228: \"$ac_link\"") >&5
18229   (eval $ac_link) 2>&5
18230   ac_status=$?
18231   echo "$as_me:18231: \$? = $ac_status" >&5
18232   (exit $ac_status); } &&
18233          { ac_try='test -s conftest$ac_exeext'
18234   { (eval echo "$as_me:18234: \"$ac_try\"") >&5
18235   (eval $ac_try) 2>&5
18236   ac_status=$?
18237   echo "$as_me:18237: \$? = $ac_status" >&5
18238   (exit $ac_status); }; }; then
18239   cf_cv_use_pthreads=yes
18240 else
18241   echo "$as_me: failed program was:" >&5
18242 cat conftest.$ac_ext >&5
18243 cf_cv_use_pthreads=no
18244 fi
18245 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18246
18247 fi
18248 echo "$as_me:18248: result: $cf_cv_use_pthreads" >&5
18249 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18250 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
18251 #define USE_PTHREADS 1
18252 EOF
18253
18254 echo "$as_me:18254: checking if sys/time.h works with sys/select.h" >&5
18255 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18256 if test "${cf_cv_sys_time_select+set}" = set; then
18257   echo $ECHO_N "(cached) $ECHO_C" >&6
18258 else
18259
18260 cat >conftest.$ac_ext <<_ACEOF
18261 #line 18261 "configure"
18262 #include "confdefs.h"
18263
18264 #include <sys/types.h>
18265 #ifdef HAVE_SYS_TIME_H
18266 #include <sys/time.h>
18267 #endif
18268 #ifdef HAVE_SYS_SELECT_H
18269 #include <sys/select.h>
18270 #endif
18271
18272 int
18273 main (void)
18274 {
18275
18276   ;
18277   return 0;
18278 }
18279 _ACEOF
18280 rm -f conftest.$ac_objext
18281 if { (eval echo "$as_me:18281: \"$ac_compile\"") >&5
18282   (eval $ac_compile) 2>&5
18283   ac_status=$?
18284   echo "$as_me:18284: \$? = $ac_status" >&5
18285   (exit $ac_status); } &&
18286          { ac_try='test -s conftest.$ac_objext'
18287   { (eval echo "$as_me:18287: \"$ac_try\"") >&5
18288   (eval $ac_try) 2>&5
18289   ac_status=$?
18290   echo "$as_me:18290: \$? = $ac_status" >&5
18291   (exit $ac_status); }; }; then
18292   cf_cv_sys_time_select=yes
18293 else
18294   echo "$as_me: failed program was:" >&5
18295 cat conftest.$ac_ext >&5
18296 cf_cv_sys_time_select=no
18297 fi
18298 rm -f conftest.$ac_objext conftest.$ac_ext
18299
18300 fi
18301
18302 echo "$as_me:18302: result: $cf_cv_sys_time_select" >&5
18303 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18304 test "$cf_cv_sys_time_select" = yes &&
18305 cat >>confdefs.h <<\EOF
18306 #define HAVE_SYS_TIME_SELECT 1
18307 EOF
18308
18309 # special check for test/ditto.c
18310
18311 echo "$as_me:18311: checking for openpty in -lutil" >&5
18312 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18313 if test "${ac_cv_lib_util_openpty+set}" = set; then
18314   echo $ECHO_N "(cached) $ECHO_C" >&6
18315 else
18316   ac_check_lib_save_LIBS=$LIBS
18317 LIBS="-lutil  $LIBS"
18318 cat >conftest.$ac_ext <<_ACEOF
18319 #line 18319 "configure"
18320 #include "confdefs.h"
18321
18322 /* Override any gcc2 internal prototype to avoid an error.  */
18323 #ifdef __cplusplus
18324 extern "C"
18325 #endif
18326 /* We use char because int might match the return type of a gcc2
18327    builtin and then its argument prototype would still apply.  */
18328 char openpty ();
18329 int
18330 main (void)
18331 {
18332 openpty ();
18333   ;
18334   return 0;
18335 }
18336 _ACEOF
18337 rm -f conftest.$ac_objext conftest$ac_exeext
18338 if { (eval echo "$as_me:18338: \"$ac_link\"") >&5
18339   (eval $ac_link) 2>&5
18340   ac_status=$?
18341   echo "$as_me:18341: \$? = $ac_status" >&5
18342   (exit $ac_status); } &&
18343          { ac_try='test -s conftest$ac_exeext'
18344   { (eval echo "$as_me:18344: \"$ac_try\"") >&5
18345   (eval $ac_try) 2>&5
18346   ac_status=$?
18347   echo "$as_me:18347: \$? = $ac_status" >&5
18348   (exit $ac_status); }; }; then
18349   ac_cv_lib_util_openpty=yes
18350 else
18351   echo "$as_me: failed program was:" >&5
18352 cat conftest.$ac_ext >&5
18353 ac_cv_lib_util_openpty=no
18354 fi
18355 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18356 LIBS=$ac_check_lib_save_LIBS
18357 fi
18358 echo "$as_me:18358: result: $ac_cv_lib_util_openpty" >&5
18359 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18360 if test $ac_cv_lib_util_openpty = yes; then
18361   cf_cv_lib_util=yes
18362 else
18363   cf_cv_lib_util=no
18364 fi
18365
18366 echo "$as_me:18366: checking for openpty header" >&5
18367 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18368 if test "${cf_cv_func_openpty+set}" = set; then
18369   echo $ECHO_N "(cached) $ECHO_C" >&6
18370 else
18371
18372         cf_save_LIBS="$LIBS"
18373         test $cf_cv_lib_util = yes && {
18374 cf_add_libs="-lutil"
18375 # Filter out duplicates - this happens with badly-designed ".pc" files...
18376 for cf_add_1lib in $LIBS
18377 do
18378         for cf_add_2lib in $cf_add_libs
18379         do
18380                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18381                 then
18382                         cf_add_1lib=
18383                         break
18384                 fi
18385         done
18386         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18387 done
18388 LIBS="$cf_add_libs"
18389  }
18390         for cf_header in pty.h libutil.h util.h
18391         do
18392         cat >conftest.$ac_ext <<_ACEOF
18393 #line 18393 "configure"
18394 #include "confdefs.h"
18395
18396 #include <$cf_header>
18397
18398 int
18399 main (void)
18400 {
18401
18402         int x = openpty((int *)0, (int *)0, (char *)0,
18403                                    (struct termios *)0, (struct winsize *)0);
18404
18405   ;
18406   return 0;
18407 }
18408 _ACEOF
18409 rm -f conftest.$ac_objext conftest$ac_exeext
18410 if { (eval echo "$as_me:18410: \"$ac_link\"") >&5
18411   (eval $ac_link) 2>&5
18412   ac_status=$?
18413   echo "$as_me:18413: \$? = $ac_status" >&5
18414   (exit $ac_status); } &&
18415          { ac_try='test -s conftest$ac_exeext'
18416   { (eval echo "$as_me:18416: \"$ac_try\"") >&5
18417   (eval $ac_try) 2>&5
18418   ac_status=$?
18419   echo "$as_me:18419: \$? = $ac_status" >&5
18420   (exit $ac_status); }; }; then
18421
18422                 cf_cv_func_openpty=$cf_header
18423                 break
18424
18425 else
18426   echo "$as_me: failed program was:" >&5
18427 cat conftest.$ac_ext >&5
18428
18429                 cf_cv_func_openpty=no
18430
18431 fi
18432 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18433         done
18434         LIBS="$cf_save_LIBS"
18435
18436 fi
18437 echo "$as_me:18437: result: $cf_cv_func_openpty" >&5
18438 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18439
18440 if test "$cf_cv_func_openpty" != no ; then
18441
18442 cat >>confdefs.h <<EOF
18443 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18444 EOF
18445
18446 cat >>confdefs.h <<\EOF
18447 #define USE_XTERM_PTY 1
18448 EOF
18449
18450         if test "x$cf_cv_lib_util" = xyes ; then
18451
18452 cf_add_libs="-lutil"
18453 # Filter out duplicates - this happens with badly-designed ".pc" files...
18454 for cf_add_1lib in $TEST_LIBS
18455 do
18456         for cf_add_2lib in $cf_add_libs
18457         do
18458                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18459                 then
18460                         cf_add_1lib=
18461                         break
18462                 fi
18463         done
18464         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18465 done
18466 TEST_LIBS="$cf_add_libs"
18467
18468         fi
18469 fi
18470
18471 echo "$as_me:18471: checking for function curses_version" >&5
18472 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
18473 if test "${cf_cv_func_curses_version+set}" = set; then
18474   echo $ECHO_N "(cached) $ECHO_C" >&6
18475 else
18476
18477 if test "$cross_compiling" = yes; then
18478   cf_cv_func_curses_version=unknown
18479 else
18480   cat >conftest.$ac_ext <<_ACEOF
18481 #line 18481 "configure"
18482 #include "confdefs.h"
18483
18484 #include <${cf_cv_ncurses_header:-curses.h}>
18485 int main(void)
18486 {
18487         char temp[1024];
18488         sprintf(temp, "%s\n", curses_version());
18489         ${cf_cv_main_return:-return}(0);
18490 }
18491
18492 _ACEOF
18493 rm -f conftest$ac_exeext
18494 if { (eval echo "$as_me:18494: \"$ac_link\"") >&5
18495   (eval $ac_link) 2>&5
18496   ac_status=$?
18497   echo "$as_me:18497: \$? = $ac_status" >&5
18498   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18499   { (eval echo "$as_me:18499: \"$ac_try\"") >&5
18500   (eval $ac_try) 2>&5
18501   ac_status=$?
18502   echo "$as_me:18502: \$? = $ac_status" >&5
18503   (exit $ac_status); }; }; then
18504   cf_cv_func_curses_version=yes
18505
18506 else
18507   echo "$as_me: program exited with status $ac_status" >&5
18508 echo "$as_me: failed program was:" >&5
18509 cat conftest.$ac_ext >&5
18510 cf_cv_func_curses_version=no
18511
18512 fi
18513 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18514 fi
18515 rm -f core
18516 fi
18517 echo "$as_me:18517: result: $cf_cv_func_curses_version" >&5
18518 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
18519 test "$cf_cv_func_curses_version" = yes &&
18520 cat >>confdefs.h <<\EOF
18521 #define HAVE_CURSES_VERSION 1
18522 EOF
18523
18524 echo "$as_me:18524: checking for alternate character set array" >&5
18525 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
18526 if test "${cf_cv_curses_acs_map+set}" = set; then
18527   echo $ECHO_N "(cached) $ECHO_C" >&6
18528 else
18529
18530 cf_cv_curses_acs_map=unknown
18531 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
18532 do
18533 cat >conftest.$ac_ext <<_ACEOF
18534 #line 18534 "configure"
18535 #include "confdefs.h"
18536
18537 #include <${cf_cv_ncurses_header:-curses.h}>
18538
18539 int
18540 main (void)
18541 {
18542
18543 $name['k'] = ACS_PLUS
18544
18545   ;
18546   return 0;
18547 }
18548 _ACEOF
18549 rm -f conftest.$ac_objext conftest$ac_exeext
18550 if { (eval echo "$as_me:18550: \"$ac_link\"") >&5
18551   (eval $ac_link) 2>&5
18552   ac_status=$?
18553   echo "$as_me:18553: \$? = $ac_status" >&5
18554   (exit $ac_status); } &&
18555          { ac_try='test -s conftest$ac_exeext'
18556   { (eval echo "$as_me:18556: \"$ac_try\"") >&5
18557   (eval $ac_try) 2>&5
18558   ac_status=$?
18559   echo "$as_me:18559: \$? = $ac_status" >&5
18560   (exit $ac_status); }; }; then
18561   cf_cv_curses_acs_map=$name; break
18562 else
18563   echo "$as_me: failed program was:" >&5
18564 cat conftest.$ac_ext >&5
18565 fi
18566 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18567 done
18568
18569 fi
18570 echo "$as_me:18570: result: $cf_cv_curses_acs_map" >&5
18571 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
18572
18573 test "$cf_cv_curses_acs_map" != unknown &&
18574 cat >>confdefs.h <<EOF
18575 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
18576 EOF
18577
18578 if test "$cf_enable_widec" = yes; then
18579
18580 echo "$as_me:18580: checking for wide alternate character set array" >&5
18581 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
18582 if test "${cf_cv_curses_wacs_map+set}" = set; then
18583   echo $ECHO_N "(cached) $ECHO_C" >&6
18584 else
18585
18586         cf_cv_curses_wacs_map=unknown
18587         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
18588         do
18589         cat >conftest.$ac_ext <<_ACEOF
18590 #line 18590 "configure"
18591 #include "confdefs.h"
18592
18593 #ifndef _XOPEN_SOURCE_EXTENDED
18594 #define _XOPEN_SOURCE_EXTENDED
18595 #endif
18596 #include <${cf_cv_ncurses_header:-curses.h}>
18597 int
18598 main (void)
18599 {
18600 void *foo = &($name['k'])
18601   ;
18602   return 0;
18603 }
18604 _ACEOF
18605 rm -f conftest.$ac_objext conftest$ac_exeext
18606 if { (eval echo "$as_me:18606: \"$ac_link\"") >&5
18607   (eval $ac_link) 2>&5
18608   ac_status=$?
18609   echo "$as_me:18609: \$? = $ac_status" >&5
18610   (exit $ac_status); } &&
18611          { ac_try='test -s conftest$ac_exeext'
18612   { (eval echo "$as_me:18612: \"$ac_try\"") >&5
18613   (eval $ac_try) 2>&5
18614   ac_status=$?
18615   echo "$as_me:18615: \$? = $ac_status" >&5
18616   (exit $ac_status); }; }; then
18617   cf_cv_curses_wacs_map=$name
18618          break
18619 else
18620   echo "$as_me: failed program was:" >&5
18621 cat conftest.$ac_ext >&5
18622 fi
18623 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18624         done
18625 fi
18626 echo "$as_me:18626: result: $cf_cv_curses_wacs_map" >&5
18627 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
18628
18629 test "$cf_cv_curses_wacs_map" != unknown &&
18630 cat >>confdefs.h <<EOF
18631 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
18632 EOF
18633
18634 echo "$as_me:18634: checking for wide alternate character constants" >&5
18635 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
18636 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
18637   echo $ECHO_N "(cached) $ECHO_C" >&6
18638 else
18639
18640 cf_cv_curses_wacs_symbols=no
18641 if test "$cf_cv_curses_wacs_map" != unknown
18642 then
18643         cat >conftest.$ac_ext <<_ACEOF
18644 #line 18644 "configure"
18645 #include "confdefs.h"
18646
18647 #ifndef _XOPEN_SOURCE_EXTENDED
18648 #define _XOPEN_SOURCE_EXTENDED
18649 #endif
18650 #include <${cf_cv_ncurses_header:-curses.h}>
18651 int
18652 main (void)
18653 {
18654 cchar_t *foo = WACS_PLUS;
18655          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
18656   ;
18657   return 0;
18658 }
18659 _ACEOF
18660 rm -f conftest.$ac_objext conftest$ac_exeext
18661 if { (eval echo "$as_me:18661: \"$ac_link\"") >&5
18662   (eval $ac_link) 2>&5
18663   ac_status=$?
18664   echo "$as_me:18664: \$? = $ac_status" >&5
18665   (exit $ac_status); } &&
18666          { ac_try='test -s conftest$ac_exeext'
18667   { (eval echo "$as_me:18667: \"$ac_try\"") >&5
18668   (eval $ac_try) 2>&5
18669   ac_status=$?
18670   echo "$as_me:18670: \$? = $ac_status" >&5
18671   (exit $ac_status); }; }; then
18672   cf_cv_curses_wacs_symbols=yes
18673 else
18674   echo "$as_me: failed program was:" >&5
18675 cat conftest.$ac_ext >&5
18676 fi
18677 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18678 else
18679         cat >conftest.$ac_ext <<_ACEOF
18680 #line 18680 "configure"
18681 #include "confdefs.h"
18682
18683 #ifndef _XOPEN_SOURCE_EXTENDED
18684 #define _XOPEN_SOURCE_EXTENDED
18685 #endif
18686 #include <${cf_cv_ncurses_header:-curses.h}>
18687 int
18688 main (void)
18689 {
18690 cchar_t *foo = WACS_PLUS
18691   ;
18692   return 0;
18693 }
18694 _ACEOF
18695 rm -f conftest.$ac_objext conftest$ac_exeext
18696 if { (eval echo "$as_me:18696: \"$ac_link\"") >&5
18697   (eval $ac_link) 2>&5
18698   ac_status=$?
18699   echo "$as_me:18699: \$? = $ac_status" >&5
18700   (exit $ac_status); } &&
18701          { ac_try='test -s conftest$ac_exeext'
18702   { (eval echo "$as_me:18702: \"$ac_try\"") >&5
18703   (eval $ac_try) 2>&5
18704   ac_status=$?
18705   echo "$as_me:18705: \$? = $ac_status" >&5
18706   (exit $ac_status); }; }; then
18707   cf_cv_curses_wacs_symbols=yes
18708 else
18709   echo "$as_me: failed program was:" >&5
18710 cat conftest.$ac_ext >&5
18711 fi
18712 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18713 fi
18714
18715 fi
18716 echo "$as_me:18716: result: $cf_cv_curses_wacs_symbols" >&5
18717 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
18718
18719 test "$cf_cv_curses_wacs_symbols" != no &&
18720 cat >>confdefs.h <<\EOF
18721 #define CURSES_WACS_SYMBOLS 1
18722 EOF
18723
18724 fi
18725
18726 echo "$as_me:18726: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18727 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18728 cat >conftest.$ac_ext <<_ACEOF
18729 #line 18729 "configure"
18730 #include "confdefs.h"
18731
18732 #ifndef _XOPEN_SOURCE_EXTENDED
18733 #define _XOPEN_SOURCE_EXTENDED
18734 #endif
18735 #include <${cf_cv_ncurses_header:-curses.h}>
18736 int
18737 main (void)
18738 {
18739
18740 attr_t foo
18741
18742   ;
18743   return 0;
18744 }
18745 _ACEOF
18746 rm -f conftest.$ac_objext
18747 if { (eval echo "$as_me:18747: \"$ac_compile\"") >&5
18748   (eval $ac_compile) 2>&5
18749   ac_status=$?
18750   echo "$as_me:18750: \$? = $ac_status" >&5
18751   (exit $ac_status); } &&
18752          { ac_try='test -s conftest.$ac_objext'
18753   { (eval echo "$as_me:18753: \"$ac_try\"") >&5
18754   (eval $ac_try) 2>&5
18755   ac_status=$?
18756   echo "$as_me:18756: \$? = $ac_status" >&5
18757   (exit $ac_status); }; }; then
18758   cf_result=yes
18759 else
18760   echo "$as_me: failed program was:" >&5
18761 cat conftest.$ac_ext >&5
18762 cf_result=no
18763 fi
18764 rm -f conftest.$ac_objext conftest.$ac_ext
18765 echo "$as_me:18765: result: $cf_result" >&5
18766 echo "${ECHO_T}$cf_result" >&6
18767 if test $cf_result = yes ; then
18768
18769 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18770
18771 cat >>confdefs.h <<EOF
18772 #define $cf_result 1
18773 EOF
18774
18775 else
18776
18777 cat >>confdefs.h <<EOF
18778 #define attr_t long
18779 EOF
18780
18781 fi
18782
18783 if test "$cf_enable_widec" = yes; then
18784
18785 # This is needed on Tru64 5.0 to declare mbstate_t
18786 echo "$as_me:18786: checking if we must include wchar.h to declare mbstate_t" >&5
18787 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
18788 if test "${cf_cv_mbstate_t+set}" = set; then
18789   echo $ECHO_N "(cached) $ECHO_C" >&6
18790 else
18791
18792 cat >conftest.$ac_ext <<_ACEOF
18793 #line 18793 "configure"
18794 #include "confdefs.h"
18795
18796 #include <stdlib.h>
18797 #include <stdarg.h>
18798 #include <stdio.h>
18799 #ifdef HAVE_LIBUTF8_H
18800 #include <libutf8.h>
18801 #endif
18802 int
18803 main (void)
18804 {
18805 mbstate_t state
18806   ;
18807   return 0;
18808 }
18809 _ACEOF
18810 rm -f conftest.$ac_objext
18811 if { (eval echo "$as_me:18811: \"$ac_compile\"") >&5
18812   (eval $ac_compile) 2>&5
18813   ac_status=$?
18814   echo "$as_me:18814: \$? = $ac_status" >&5
18815   (exit $ac_status); } &&
18816          { ac_try='test -s conftest.$ac_objext'
18817   { (eval echo "$as_me:18817: \"$ac_try\"") >&5
18818   (eval $ac_try) 2>&5
18819   ac_status=$?
18820   echo "$as_me:18820: \$? = $ac_status" >&5
18821   (exit $ac_status); }; }; then
18822   cf_cv_mbstate_t=no
18823 else
18824   echo "$as_me: failed program was:" >&5
18825 cat conftest.$ac_ext >&5
18826 cat >conftest.$ac_ext <<_ACEOF
18827 #line 18827 "configure"
18828 #include "confdefs.h"
18829
18830 #include <stdlib.h>
18831 #include <stdarg.h>
18832 #include <stdio.h>
18833 #include <wchar.h>
18834 #ifdef HAVE_LIBUTF8_H
18835 #include <libutf8.h>
18836 #endif
18837 int
18838 main (void)
18839 {
18840 mbstate_t value
18841   ;
18842   return 0;
18843 }
18844 _ACEOF
18845 rm -f conftest.$ac_objext
18846 if { (eval echo "$as_me:18846: \"$ac_compile\"") >&5
18847   (eval $ac_compile) 2>&5
18848   ac_status=$?
18849   echo "$as_me:18849: \$? = $ac_status" >&5
18850   (exit $ac_status); } &&
18851          { ac_try='test -s conftest.$ac_objext'
18852   { (eval echo "$as_me:18852: \"$ac_try\"") >&5
18853   (eval $ac_try) 2>&5
18854   ac_status=$?
18855   echo "$as_me:18855: \$? = $ac_status" >&5
18856   (exit $ac_status); }; }; then
18857   cf_cv_mbstate_t=yes
18858 else
18859   echo "$as_me: failed program was:" >&5
18860 cat conftest.$ac_ext >&5
18861 cf_cv_mbstate_t=unknown
18862 fi
18863 rm -f conftest.$ac_objext conftest.$ac_ext
18864 fi
18865 rm -f conftest.$ac_objext conftest.$ac_ext
18866 fi
18867 echo "$as_me:18867: result: $cf_cv_mbstate_t" >&5
18868 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
18869
18870 if test "$cf_cv_mbstate_t" = yes ; then
18871
18872 cat >>confdefs.h <<\EOF
18873 #define NEED_WCHAR_H 1
18874 EOF
18875
18876         NEED_WCHAR_H=1
18877 fi
18878
18879 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
18880 if test "$cf_cv_mbstate_t" = unknown ; then
18881         NCURSES_MBSTATE_T=1
18882 fi
18883
18884 # if we find mbstate_t in either place, use substitution to provide a fallback.
18885 if test "$cf_cv_mbstate_t" != unknown ; then
18886         NCURSES_OK_MBSTATE_T=1
18887 fi
18888
18889 # This is needed on Tru64 5.0 to declare wchar_t
18890 echo "$as_me:18890: checking if we must include wchar.h to declare wchar_t" >&5
18891 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
18892 if test "${cf_cv_wchar_t+set}" = set; then
18893   echo $ECHO_N "(cached) $ECHO_C" >&6
18894 else
18895
18896 cat >conftest.$ac_ext <<_ACEOF
18897 #line 18897 "configure"
18898 #include "confdefs.h"
18899
18900 #include <stdlib.h>
18901 #include <stdarg.h>
18902 #include <stdio.h>
18903 #ifdef HAVE_LIBUTF8_H
18904 #include <libutf8.h>
18905 #endif
18906 int
18907 main (void)
18908 {
18909 wchar_t state
18910   ;
18911   return 0;
18912 }
18913 _ACEOF
18914 rm -f conftest.$ac_objext
18915 if { (eval echo "$as_me:18915: \"$ac_compile\"") >&5
18916   (eval $ac_compile) 2>&5
18917   ac_status=$?
18918   echo "$as_me:18918: \$? = $ac_status" >&5
18919   (exit $ac_status); } &&
18920          { ac_try='test -s conftest.$ac_objext'
18921   { (eval echo "$as_me:18921: \"$ac_try\"") >&5
18922   (eval $ac_try) 2>&5
18923   ac_status=$?
18924   echo "$as_me:18924: \$? = $ac_status" >&5
18925   (exit $ac_status); }; }; then
18926   cf_cv_wchar_t=no
18927 else
18928   echo "$as_me: failed program was:" >&5
18929 cat conftest.$ac_ext >&5
18930 cat >conftest.$ac_ext <<_ACEOF
18931 #line 18931 "configure"
18932 #include "confdefs.h"
18933
18934 #include <stdlib.h>
18935 #include <stdarg.h>
18936 #include <stdio.h>
18937 #include <wchar.h>
18938 #ifdef HAVE_LIBUTF8_H
18939 #include <libutf8.h>
18940 #endif
18941 int
18942 main (void)
18943 {
18944 wchar_t value
18945   ;
18946   return 0;
18947 }
18948 _ACEOF
18949 rm -f conftest.$ac_objext
18950 if { (eval echo "$as_me:18950: \"$ac_compile\"") >&5
18951   (eval $ac_compile) 2>&5
18952   ac_status=$?
18953   echo "$as_me:18953: \$? = $ac_status" >&5
18954   (exit $ac_status); } &&
18955          { ac_try='test -s conftest.$ac_objext'
18956   { (eval echo "$as_me:18956: \"$ac_try\"") >&5
18957   (eval $ac_try) 2>&5
18958   ac_status=$?
18959   echo "$as_me:18959: \$? = $ac_status" >&5
18960   (exit $ac_status); }; }; then
18961   cf_cv_wchar_t=yes
18962 else
18963   echo "$as_me: failed program was:" >&5
18964 cat conftest.$ac_ext >&5
18965 cf_cv_wchar_t=unknown
18966 fi
18967 rm -f conftest.$ac_objext conftest.$ac_ext
18968 fi
18969 rm -f conftest.$ac_objext conftest.$ac_ext
18970 fi
18971 echo "$as_me:18971: result: $cf_cv_wchar_t" >&5
18972 echo "${ECHO_T}$cf_cv_wchar_t" >&6
18973
18974 if test "$cf_cv_wchar_t" = yes ; then
18975
18976 cat >>confdefs.h <<\EOF
18977 #define NEED_WCHAR_H 1
18978 EOF
18979
18980         NEED_WCHAR_H=1
18981 fi
18982
18983 # if we do not find wchar_t in either place, use substitution to provide a fallback.
18984 if test "$cf_cv_wchar_t" = unknown ; then
18985         NCURSES_WCHAR_T=1
18986 fi
18987
18988 # if we find wchar_t in either place, use substitution to provide a fallback.
18989 if test "$cf_cv_wchar_t" != unknown ; then
18990         NCURSES_OK_WCHAR_T=1
18991 fi
18992
18993 # This is needed on Tru64 5.0 to declare wint_t
18994 echo "$as_me:18994: checking if we must include wchar.h to declare wint_t" >&5
18995 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
18996 if test "${cf_cv_wint_t+set}" = set; then
18997   echo $ECHO_N "(cached) $ECHO_C" >&6
18998 else
18999
19000 cat >conftest.$ac_ext <<_ACEOF
19001 #line 19001 "configure"
19002 #include "confdefs.h"
19003
19004 #include <stdlib.h>
19005 #include <stdarg.h>
19006 #include <stdio.h>
19007 #ifdef HAVE_LIBUTF8_H
19008 #include <libutf8.h>
19009 #endif
19010 int
19011 main (void)
19012 {
19013 wint_t state
19014   ;
19015   return 0;
19016 }
19017 _ACEOF
19018 rm -f conftest.$ac_objext
19019 if { (eval echo "$as_me:19019: \"$ac_compile\"") >&5
19020   (eval $ac_compile) 2>&5
19021   ac_status=$?
19022   echo "$as_me:19022: \$? = $ac_status" >&5
19023   (exit $ac_status); } &&
19024          { ac_try='test -s conftest.$ac_objext'
19025   { (eval echo "$as_me:19025: \"$ac_try\"") >&5
19026   (eval $ac_try) 2>&5
19027   ac_status=$?
19028   echo "$as_me:19028: \$? = $ac_status" >&5
19029   (exit $ac_status); }; }; then
19030   cf_cv_wint_t=no
19031 else
19032   echo "$as_me: failed program was:" >&5
19033 cat conftest.$ac_ext >&5
19034 cat >conftest.$ac_ext <<_ACEOF
19035 #line 19035 "configure"
19036 #include "confdefs.h"
19037
19038 #include <stdlib.h>
19039 #include <stdarg.h>
19040 #include <stdio.h>
19041 #include <wchar.h>
19042 #ifdef HAVE_LIBUTF8_H
19043 #include <libutf8.h>
19044 #endif
19045 int
19046 main (void)
19047 {
19048 wint_t value
19049   ;
19050   return 0;
19051 }
19052 _ACEOF
19053 rm -f conftest.$ac_objext
19054 if { (eval echo "$as_me:19054: \"$ac_compile\"") >&5
19055   (eval $ac_compile) 2>&5
19056   ac_status=$?
19057   echo "$as_me:19057: \$? = $ac_status" >&5
19058   (exit $ac_status); } &&
19059          { ac_try='test -s conftest.$ac_objext'
19060   { (eval echo "$as_me:19060: \"$ac_try\"") >&5
19061   (eval $ac_try) 2>&5
19062   ac_status=$?
19063   echo "$as_me:19063: \$? = $ac_status" >&5
19064   (exit $ac_status); }; }; then
19065   cf_cv_wint_t=yes
19066 else
19067   echo "$as_me: failed program was:" >&5
19068 cat conftest.$ac_ext >&5
19069 cf_cv_wint_t=unknown
19070 fi
19071 rm -f conftest.$ac_objext conftest.$ac_ext
19072 fi
19073 rm -f conftest.$ac_objext conftest.$ac_ext
19074 fi
19075 echo "$as_me:19075: result: $cf_cv_wint_t" >&5
19076 echo "${ECHO_T}$cf_cv_wint_t" >&6
19077
19078 if test "$cf_cv_wint_t" = yes ; then
19079
19080 cat >>confdefs.h <<\EOF
19081 #define NEED_WCHAR_H 1
19082 EOF
19083
19084         NEED_WCHAR_H=1
19085 fi
19086
19087 # if we do not find wint_t in either place, use substitution to provide a fallback.
19088 if test "$cf_cv_wint_t" = unknown ; then
19089         NCURSES_WINT_T=1
19090 fi
19091
19092 # if we find wint_t in either place, use substitution to provide a fallback.
19093 if test "$cf_cv_wint_t" != unknown ; then
19094         NCURSES_OK_WINT_T=1
19095 fi
19096
19097         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19098
19099 echo "$as_me:19099: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19100 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19101 cat >conftest.$ac_ext <<_ACEOF
19102 #line 19102 "configure"
19103 #include "confdefs.h"
19104
19105 #ifndef _XOPEN_SOURCE_EXTENDED
19106 #define _XOPEN_SOURCE_EXTENDED
19107 #endif
19108 #include <${cf_cv_ncurses_header:-curses.h}>
19109 int
19110 main (void)
19111 {
19112
19113 mbstate_t foo
19114
19115   ;
19116   return 0;
19117 }
19118 _ACEOF
19119 rm -f conftest.$ac_objext
19120 if { (eval echo "$as_me:19120: \"$ac_compile\"") >&5
19121   (eval $ac_compile) 2>&5
19122   ac_status=$?
19123   echo "$as_me:19123: \$? = $ac_status" >&5
19124   (exit $ac_status); } &&
19125          { ac_try='test -s conftest.$ac_objext'
19126   { (eval echo "$as_me:19126: \"$ac_try\"") >&5
19127   (eval $ac_try) 2>&5
19128   ac_status=$?
19129   echo "$as_me:19129: \$? = $ac_status" >&5
19130   (exit $ac_status); }; }; then
19131   cf_result=yes
19132 else
19133   echo "$as_me: failed program was:" >&5
19134 cat conftest.$ac_ext >&5
19135 cf_result=no
19136 fi
19137 rm -f conftest.$ac_objext conftest.$ac_ext
19138 echo "$as_me:19138: result: $cf_result" >&5
19139 echo "${ECHO_T}$cf_result" >&6
19140 if test $cf_result = yes ; then
19141
19142 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19143
19144 cat >>confdefs.h <<EOF
19145 #define $cf_result 1
19146 EOF
19147
19148 else
19149
19150 cat >>confdefs.h <<EOF
19151 #define mbstate_t long
19152 EOF
19153
19154 fi
19155
19156         fi
19157
19158         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19159
19160 echo "$as_me:19160: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19161 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19162 cat >conftest.$ac_ext <<_ACEOF
19163 #line 19163 "configure"
19164 #include "confdefs.h"
19165
19166 #ifndef _XOPEN_SOURCE_EXTENDED
19167 #define _XOPEN_SOURCE_EXTENDED
19168 #endif
19169 #include <${cf_cv_ncurses_header:-curses.h}>
19170 int
19171 main (void)
19172 {
19173
19174 wchar_t foo
19175
19176   ;
19177   return 0;
19178 }
19179 _ACEOF
19180 rm -f conftest.$ac_objext
19181 if { (eval echo "$as_me:19181: \"$ac_compile\"") >&5
19182   (eval $ac_compile) 2>&5
19183   ac_status=$?
19184   echo "$as_me:19184: \$? = $ac_status" >&5
19185   (exit $ac_status); } &&
19186          { ac_try='test -s conftest.$ac_objext'
19187   { (eval echo "$as_me:19187: \"$ac_try\"") >&5
19188   (eval $ac_try) 2>&5
19189   ac_status=$?
19190   echo "$as_me:19190: \$? = $ac_status" >&5
19191   (exit $ac_status); }; }; then
19192   cf_result=yes
19193 else
19194   echo "$as_me: failed program was:" >&5
19195 cat conftest.$ac_ext >&5
19196 cf_result=no
19197 fi
19198 rm -f conftest.$ac_objext conftest.$ac_ext
19199 echo "$as_me:19199: result: $cf_result" >&5
19200 echo "${ECHO_T}$cf_result" >&6
19201 if test $cf_result = yes ; then
19202
19203 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19204
19205 cat >>confdefs.h <<EOF
19206 #define $cf_result 1
19207 EOF
19208
19209 else
19210
19211 cat >>confdefs.h <<EOF
19212 #define wchar_t long
19213 EOF
19214
19215 fi
19216
19217         fi
19218
19219         if test "$NCURSES_OK_WINT_T" = 0 ; then
19220
19221 echo "$as_me:19221: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19222 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19223 cat >conftest.$ac_ext <<_ACEOF
19224 #line 19224 "configure"
19225 #include "confdefs.h"
19226
19227 #ifndef _XOPEN_SOURCE_EXTENDED
19228 #define _XOPEN_SOURCE_EXTENDED
19229 #endif
19230 #include <${cf_cv_ncurses_header:-curses.h}>
19231 int
19232 main (void)
19233 {
19234
19235 wint_t foo
19236
19237   ;
19238   return 0;
19239 }
19240 _ACEOF
19241 rm -f conftest.$ac_objext
19242 if { (eval echo "$as_me:19242: \"$ac_compile\"") >&5
19243   (eval $ac_compile) 2>&5
19244   ac_status=$?
19245   echo "$as_me:19245: \$? = $ac_status" >&5
19246   (exit $ac_status); } &&
19247          { ac_try='test -s conftest.$ac_objext'
19248   { (eval echo "$as_me:19248: \"$ac_try\"") >&5
19249   (eval $ac_try) 2>&5
19250   ac_status=$?
19251   echo "$as_me:19251: \$? = $ac_status" >&5
19252   (exit $ac_status); }; }; then
19253   cf_result=yes
19254 else
19255   echo "$as_me: failed program was:" >&5
19256 cat conftest.$ac_ext >&5
19257 cf_result=no
19258 fi
19259 rm -f conftest.$ac_objext conftest.$ac_ext
19260 echo "$as_me:19260: result: $cf_result" >&5
19261 echo "${ECHO_T}$cf_result" >&6
19262 if test $cf_result = yes ; then
19263
19264 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19265
19266 cat >>confdefs.h <<EOF
19267 #define $cf_result 1
19268 EOF
19269
19270 else
19271
19272 cat >>confdefs.h <<EOF
19273 #define wint_t long
19274 EOF
19275
19276 fi
19277
19278         fi
19279 fi
19280
19281 for cf_data in \
19282 TABSIZE \
19283 curscr \
19284 ospeed \
19285 boolnames \
19286 boolfnames \
19287 ttytype
19288 do
19289 echo "$as_me:19289: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19290 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19291
19292 cat >conftest.$ac_ext <<_ACEOF
19293 #line 19293 "configure"
19294 #include "confdefs.h"
19295
19296 #ifdef HAVE_XCURSES
19297 #include <xcurses.h>
19298 char * XCursesProgramName = "test";
19299 #else
19300 #include <${cf_cv_ncurses_header:-curses.h}>
19301 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19302 #include <ncursesw/term.h>
19303 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19304 #include <ncurses/term.h>
19305 #elif defined(HAVE_TERM_H)
19306 #include <term.h>
19307 #endif
19308 #endif
19309
19310 int
19311 main (void)
19312 {
19313
19314 void *foo = &($cf_data)
19315
19316   ;
19317   return 0;
19318 }
19319 _ACEOF
19320 rm -f conftest.$ac_objext
19321 if { (eval echo "$as_me:19321: \"$ac_compile\"") >&5
19322   (eval $ac_compile) 2>&5
19323   ac_status=$?
19324   echo "$as_me:19324: \$? = $ac_status" >&5
19325   (exit $ac_status); } &&
19326          { ac_try='test -s conftest.$ac_objext'
19327   { (eval echo "$as_me:19327: \"$ac_try\"") >&5
19328   (eval $ac_try) 2>&5
19329   ac_status=$?
19330   echo "$as_me:19330: \$? = $ac_status" >&5
19331   (exit $ac_status); }; }; then
19332   cf_result=yes
19333
19334 else
19335   echo "$as_me: failed program was:" >&5
19336 cat conftest.$ac_ext >&5
19337 cf_result=no
19338 fi
19339 rm -f conftest.$ac_objext conftest.$ac_ext
19340 echo "$as_me:19340: result: $cf_result" >&5
19341 echo "${ECHO_T}$cf_result" >&6
19342
19343 if test $cf_result = yes ; then
19344
19345 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19346
19347         cat >>confdefs.h <<EOF
19348 #define $cf_result 1
19349 EOF
19350
19351 else
19352         echo "$as_me:19352: checking for data $cf_data in library" >&5
19353 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19354         # BSD linkers insist on making weak linkage, but resolve at runtime.
19355         if test "$cross_compiling" = yes; then
19356
19357         # cross-compiling
19358         cat >conftest.$ac_ext <<_ACEOF
19359 #line 19359 "configure"
19360 #include "confdefs.h"
19361
19362 #ifdef HAVE_XCURSES
19363 #include <xcurses.h>
19364 char * XCursesProgramName = "test";
19365 #else
19366 #include <${cf_cv_ncurses_header:-curses.h}>
19367 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19368 #include <ncursesw/term.h>
19369 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19370 #include <ncurses/term.h>
19371 #elif defined(HAVE_TERM_H)
19372 #include <term.h>
19373 #endif
19374 #endif
19375
19376 extern char $cf_data;
19377 int
19378 main (void)
19379 {
19380
19381         do {
19382                 void *foo = &($cf_data);
19383                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19384                 ${cf_cv_main_return:-return}(foo == 0);
19385         } while (0)
19386
19387   ;
19388   return 0;
19389 }
19390 _ACEOF
19391 rm -f conftest.$ac_objext conftest$ac_exeext
19392 if { (eval echo "$as_me:19392: \"$ac_link\"") >&5
19393   (eval $ac_link) 2>&5
19394   ac_status=$?
19395   echo "$as_me:19395: \$? = $ac_status" >&5
19396   (exit $ac_status); } &&
19397          { ac_try='test -s conftest$ac_exeext'
19398   { (eval echo "$as_me:19398: \"$ac_try\"") >&5
19399   (eval $ac_try) 2>&5
19400   ac_status=$?
19401   echo "$as_me:19401: \$? = $ac_status" >&5
19402   (exit $ac_status); }; }; then
19403   cf_result=yes
19404 else
19405   echo "$as_me: failed program was:" >&5
19406 cat conftest.$ac_ext >&5
19407 cf_result=no
19408 fi
19409 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19410
19411 else
19412   cat >conftest.$ac_ext <<_ACEOF
19413 #line 19413 "configure"
19414 #include "confdefs.h"
19415
19416 #ifdef HAVE_XCURSES
19417 #include <xcurses.h>
19418 char * XCursesProgramName = "test";
19419 #else
19420 #include <${cf_cv_ncurses_header:-curses.h}>
19421 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19422 #include <ncursesw/term.h>
19423 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19424 #include <ncurses/term.h>
19425 #elif defined(HAVE_TERM_H)
19426 #include <term.h>
19427 #endif
19428 #endif
19429
19430 extern char $cf_data;
19431 int main(void)
19432 {
19433         void *foo = &($cf_data);
19434         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19435         ${cf_cv_main_return:-return}(foo == 0);
19436 }
19437 _ACEOF
19438 rm -f conftest$ac_exeext
19439 if { (eval echo "$as_me:19439: \"$ac_link\"") >&5
19440   (eval $ac_link) 2>&5
19441   ac_status=$?
19442   echo "$as_me:19442: \$? = $ac_status" >&5
19443   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19444   { (eval echo "$as_me:19444: \"$ac_try\"") >&5
19445   (eval $ac_try) 2>&5
19446   ac_status=$?
19447   echo "$as_me:19447: \$? = $ac_status" >&5
19448   (exit $ac_status); }; }; then
19449   cf_result=yes
19450
19451 else
19452   echo "$as_me: program exited with status $ac_status" >&5
19453 echo "$as_me: failed program was:" >&5
19454 cat conftest.$ac_ext >&5
19455 cf_result=no
19456 fi
19457 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19458 fi
19459         echo "$as_me:19459: result: $cf_result" >&5
19460 echo "${ECHO_T}$cf_result" >&6
19461         if test $cf_result = yes ; then
19462
19463 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19464
19465                 cat >>confdefs.h <<EOF
19466 #define $cf_result 1
19467 EOF
19468
19469                 # do not exit loop here, since we prefer system's declarations
19470         fi
19471 fi
19472 done
19473
19474 if ( test "$GCC" = yes || test "$GXX" = yes )
19475 then
19476 echo "$as_me:19476: checking if you want to turn on gcc warnings" >&5
19477 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
19478
19479 # Check whether --enable-warnings or --disable-warnings was given.
19480 if test "${enable_warnings+set}" = set; then
19481   enableval="$enable_warnings"
19482   test "$enableval" != yes && enableval=no
19483         if test "$enableval" != "no" ; then
19484     with_warnings=yes
19485         else
19486                 with_warnings=no
19487         fi
19488 else
19489   enableval=no
19490         with_warnings=no
19491
19492 fi;
19493 echo "$as_me:19493: result: $with_warnings" >&5
19494 echo "${ECHO_T}$with_warnings" >&6
19495 if test "$with_warnings" = "yes"
19496 then
19497
19498 if test "$GCC" = yes
19499 then
19500 cat > conftest.i <<EOF
19501 #ifndef GCC_PRINTF
19502 #define GCC_PRINTF 0
19503 #endif
19504 #ifndef GCC_SCANF
19505 #define GCC_SCANF 0
19506 #endif
19507 #ifndef GCC_NORETURN
19508 #define GCC_NORETURN /* nothing */
19509 #endif
19510 #ifndef GCC_UNUSED
19511 #define GCC_UNUSED /* nothing */
19512 #endif
19513 EOF
19514 if test "$GCC" = yes
19515 then
19516         { echo "$as_me:19516: checking for $CC __attribute__ directives..." >&5
19517 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
19518 cat > conftest.$ac_ext <<EOF
19519 #line 19519 "${as_me:-configure}"
19520 #include "confdefs.h"
19521 #include "conftest.h"
19522 #include "conftest.i"
19523 #if     GCC_PRINTF
19524 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
19525 #else
19526 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
19527 #endif
19528 #if     GCC_SCANF
19529 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
19530 #else
19531 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
19532 #endif
19533 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
19534 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
19535 extern void foo(void) GCC_NORETURN;
19536 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
19537 EOF
19538         cf_printf_attribute=no
19539         cf_scanf_attribute=no
19540         for cf_attribute in scanf printf unused noreturn
19541         do
19542
19543 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19544
19545                 cf_directive="__attribute__(($cf_attribute))"
19546                 echo "checking for $CC $cf_directive" 1>&5
19547
19548                 case $cf_attribute in
19549                 (printf)
19550                         cf_printf_attribute=yes
19551                         cat >conftest.h <<EOF
19552 #define GCC_$cf_ATTRIBUTE 1
19553 EOF
19554                         ;;
19555                 (scanf)
19556                         cf_scanf_attribute=yes
19557                         cat >conftest.h <<EOF
19558 #define GCC_$cf_ATTRIBUTE 1
19559 EOF
19560                         ;;
19561                 (*)
19562                         cat >conftest.h <<EOF
19563 #define GCC_$cf_ATTRIBUTE $cf_directive
19564 EOF
19565                         ;;
19566                 esac
19567
19568                 if { (eval echo "$as_me:19568: \"$ac_compile\"") >&5
19569   (eval $ac_compile) 2>&5
19570   ac_status=$?
19571   echo "$as_me:19571: \$? = $ac_status" >&5
19572   (exit $ac_status); }; then
19573                         test -n "$verbose" && echo "$as_me:19573: result: ... $cf_attribute" >&5
19574 echo "${ECHO_T}... $cf_attribute" >&6
19575                         cat conftest.h >>confdefs.h
19576                         case $cf_attribute in
19577                         (noreturn)
19578
19579 cat >>confdefs.h <<EOF
19580 #define GCC_NORETURN $cf_directive
19581 EOF
19582
19583                                 ;;
19584                         (printf)
19585                                 cf_value='/* nothing */'
19586                                 if test "$cf_printf_attribute" != no ; then
19587                                         cf_value='__attribute__((format(printf,fmt,var)))'
19588
19589 cat >>confdefs.h <<\EOF
19590 #define GCC_PRINTF 1
19591 EOF
19592
19593                                 fi
19594
19595 cat >>confdefs.h <<EOF
19596 #define GCC_PRINTFLIKE(fmt,var) $cf_value
19597 EOF
19598
19599                                 ;;
19600                         (scanf)
19601                                 cf_value='/* nothing */'
19602                                 if test "$cf_scanf_attribute" != no ; then
19603                                         cf_value='__attribute__((format(scanf,fmt,var)))'
19604
19605 cat >>confdefs.h <<\EOF
19606 #define GCC_SCANF 1
19607 EOF
19608
19609                                 fi
19610
19611 cat >>confdefs.h <<EOF
19612 #define GCC_SCANFLIKE(fmt,var) $cf_value
19613 EOF
19614
19615                                 ;;
19616                         (unused)
19617
19618 cat >>confdefs.h <<EOF
19619 #define GCC_UNUSED $cf_directive
19620 EOF
19621
19622                                 ;;
19623                         esac
19624                 fi
19625         done
19626 else
19627         fgrep define conftest.i >>confdefs.h
19628 fi
19629 rm -rf conftest*
19630 fi
19631
19632 if test "x$have_x" = xyes; then
19633 cat >conftest.$ac_ext <<_ACEOF
19634 #line 19634 "configure"
19635 #include "confdefs.h"
19636
19637 #include <stdlib.h>
19638 #include <X11/Intrinsic.h>
19639
19640 int
19641 main (void)
19642 {
19643 String foo = malloc(1)
19644   ;
19645   return 0;
19646 }
19647 _ACEOF
19648 rm -f conftest.$ac_objext
19649 if { (eval echo "$as_me:19649: \"$ac_compile\"") >&5
19650   (eval $ac_compile) 2>&5
19651   ac_status=$?
19652   echo "$as_me:19652: \$? = $ac_status" >&5
19653   (exit $ac_status); } &&
19654          { ac_try='test -s conftest.$ac_objext'
19655   { (eval echo "$as_me:19655: \"$ac_try\"") >&5
19656   (eval $ac_try) 2>&5
19657   ac_status=$?
19658   echo "$as_me:19658: \$? = $ac_status" >&5
19659   (exit $ac_status); }; }; then
19660
19661 echo "$as_me:19661: checking for X11/Xt const-feature" >&5
19662 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
19663 if test "${cf_cv_const_x_string+set}" = set; then
19664   echo $ECHO_N "(cached) $ECHO_C" >&6
19665 else
19666
19667         cat >conftest.$ac_ext <<_ACEOF
19668 #line 19668 "configure"
19669 #include "confdefs.h"
19670
19671 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
19672 #undef  XTSTRINGDEFINES /* X11R5 and later */
19673 #include <stdlib.h>
19674 #include <X11/Intrinsic.h>
19675
19676 int
19677 main (void)
19678 {
19679 String foo = malloc(1); *foo = 0
19680   ;
19681   return 0;
19682 }
19683 _ACEOF
19684 rm -f conftest.$ac_objext
19685 if { (eval echo "$as_me:19685: \"$ac_compile\"") >&5
19686   (eval $ac_compile) 2>&5
19687   ac_status=$?
19688   echo "$as_me:19688: \$? = $ac_status" >&5
19689   (exit $ac_status); } &&
19690          { ac_try='test -s conftest.$ac_objext'
19691   { (eval echo "$as_me:19691: \"$ac_try\"") >&5
19692   (eval $ac_try) 2>&5
19693   ac_status=$?
19694   echo "$as_me:19694: \$? = $ac_status" >&5
19695   (exit $ac_status); }; }; then
19696
19697                         cf_cv_const_x_string=no
19698
19699 else
19700   echo "$as_me: failed program was:" >&5
19701 cat conftest.$ac_ext >&5
19702
19703                         cf_cv_const_x_string=yes
19704
19705 fi
19706 rm -f conftest.$ac_objext conftest.$ac_ext
19707
19708 fi
19709 echo "$as_me:19709: result: $cf_cv_const_x_string" >&5
19710 echo "${ECHO_T}$cf_cv_const_x_string" >&6
19711
19712 case $cf_cv_const_x_string in
19713 (no)
19714
19715         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19716         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
19717
19718         ;;
19719 (*)
19720
19721         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19722         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
19723
19724         ;;
19725 esac
19726
19727 else
19728   echo "$as_me: failed program was:" >&5
19729 cat conftest.$ac_ext >&5
19730 fi
19731 rm -f conftest.$ac_objext conftest.$ac_ext
19732  fi
19733 cat > conftest.$ac_ext <<EOF
19734 #line 19734 "${as_me:-configure}"
19735 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
19736 EOF
19737 if test "$INTEL_COMPILER" = yes
19738 then
19739 # The "-wdXXX" options suppress warnings:
19740 # remark #1419: external declaration in primary source file
19741 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
19742 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
19743 # remark #193: zero used for undefined preprocessing identifier
19744 # remark #593: variable "curs_sb_left_arrow" was set but never used
19745 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
19746 # remark #869: parameter "tw" was never referenced
19747 # remark #981: operands are evaluated in unspecified order
19748 # warning #279: controlling expression is constant
19749
19750         { echo "$as_me:19750: checking for $CC warning options..." >&5
19751 echo "$as_me: checking for $CC warning options..." >&6;}
19752         cf_save_CFLAGS="$CFLAGS"
19753         EXTRA_CFLAGS="-Wall"
19754         for cf_opt in \
19755                 wd1419 \
19756                 wd1683 \
19757                 wd1684 \
19758                 wd193 \
19759                 wd593 \
19760                 wd279 \
19761                 wd810 \
19762                 wd869 \
19763                 wd981
19764         do
19765                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19766                 if { (eval echo "$as_me:19766: \"$ac_compile\"") >&5
19767   (eval $ac_compile) 2>&5
19768   ac_status=$?
19769   echo "$as_me:19769: \$? = $ac_status" >&5
19770   (exit $ac_status); }; then
19771                         test -n "$verbose" && echo "$as_me:19771: result: ... -$cf_opt" >&5
19772 echo "${ECHO_T}... -$cf_opt" >&6
19773                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19774                 fi
19775         done
19776         CFLAGS="$cf_save_CFLAGS"
19777 elif test "$GCC" = yes
19778 then
19779         { echo "$as_me:19779: checking for $CC warning options..." >&5
19780 echo "$as_me: checking for $CC warning options..." >&6;}
19781         cf_save_CFLAGS="$CFLAGS"
19782         EXTRA_CFLAGS=
19783         cf_warn_CONST=""
19784         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
19785         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
19786         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
19787         for cf_opt in W Wall \
19788                 Wbad-function-cast \
19789                 Wcast-align \
19790                 Wcast-qual \
19791                 Wdeclaration-after-statement \
19792                 Wextra \
19793                 Winline \
19794                 Wmissing-declarations \
19795                 Wmissing-prototypes \
19796                 Wnested-externs \
19797                 Wpointer-arith \
19798                 Wshadow \
19799                 Wstrict-prototypes \
19800                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
19801         do
19802                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19803                 if { (eval echo "$as_me:19803: \"$ac_compile\"") >&5
19804   (eval $ac_compile) 2>&5
19805   ac_status=$?
19806   echo "$as_me:19806: \$? = $ac_status" >&5
19807   (exit $ac_status); }; then
19808                         test -n "$verbose" && echo "$as_me:19808: result: ... -$cf_opt" >&5
19809 echo "${ECHO_T}... -$cf_opt" >&6
19810                         case $cf_opt in
19811                         (Winline)
19812                                 case $GCC_VERSION in
19813                                 ([34].*)
19814                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19815
19816 echo "${as_me:-configure}:19816: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19817
19818                                         continue;;
19819                                 esac
19820                                 ;;
19821                         (Wpointer-arith)
19822                                 case $GCC_VERSION in
19823                                 ([12].*)
19824                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19825
19826 echo "${as_me:-configure}:19826: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19827
19828                                         continue;;
19829                                 esac
19830                                 ;;
19831                         esac
19832                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19833                 fi
19834         done
19835         CFLAGS="$cf_save_CFLAGS"
19836 fi
19837 rm -rf conftest*
19838
19839 fi
19840 fi
19841
19842 echo "$as_me:19842: checking if you want to use dmalloc for testing" >&5
19843 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
19844
19845 # Check whether --with-dmalloc or --without-dmalloc was given.
19846 if test "${with_dmalloc+set}" = set; then
19847   withval="$with_dmalloc"
19848
19849 cat >>confdefs.h <<EOF
19850 #define USE_DMALLOC 1
19851 EOF
19852
19853         : ${with_cflags:=-g}
19854         : ${with_no_leaks:=yes}
19855          with_dmalloc=yes
19856 else
19857   with_dmalloc=
19858 fi;
19859 echo "$as_me:19859: result: ${with_dmalloc:-no}" >&5
19860 echo "${ECHO_T}${with_dmalloc:-no}" >&6
19861
19862 case .$with_cflags in
19863 (.*-g*)
19864         case .$CFLAGS in
19865         (.*-g*)
19866                 ;;
19867         (*)
19868
19869 cf_fix_cppflags=no
19870 cf_new_cflags=
19871 cf_new_cppflags=
19872 cf_new_extra_cppflags=
19873
19874 for cf_add_cflags in -g
19875 do
19876 case $cf_fix_cppflags in
19877 (no)
19878         case $cf_add_cflags in
19879         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19880                 case $cf_add_cflags in
19881                 (-D*)
19882                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19883
19884                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19885                                 && test -z "${cf_tst_cflags}" \
19886                                 && cf_fix_cppflags=yes
19887
19888                         if test $cf_fix_cppflags = yes ; then
19889
19890         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19891         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19892
19893                                 continue
19894                         elif test "${cf_tst_cflags}" = "\"'" ; then
19895
19896         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19897         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19898
19899                                 continue
19900                         fi
19901                         ;;
19902                 esac
19903                 case "$CPPFLAGS" in
19904                 (*$cf_add_cflags)
19905                         ;;
19906                 (*)
19907                         case $cf_add_cflags in
19908                         (-D*)
19909                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19910
19911 CPPFLAGS=`echo "$CPPFLAGS" | \
19912         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19913                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19914
19915                                 ;;
19916                         esac
19917
19918         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19919         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19920
19921                         ;;
19922                 esac
19923                 ;;
19924         (*)
19925
19926         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19927         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19928
19929                 ;;
19930         esac
19931         ;;
19932 (yes)
19933
19934         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19935         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19936
19937         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19938
19939         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19940                 && test -z "${cf_tst_cflags}" \
19941                 && cf_fix_cppflags=no
19942         ;;
19943 esac
19944 done
19945
19946 if test -n "$cf_new_cflags" ; then
19947
19948         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19949         CFLAGS="${CFLAGS}$cf_new_cflags"
19950
19951 fi
19952
19953 if test -n "$cf_new_cppflags" ; then
19954
19955         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19956         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19957
19958 fi
19959
19960 if test -n "$cf_new_extra_cppflags" ; then
19961
19962         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19963         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19964
19965 fi
19966
19967                 ;;
19968         esac
19969         ;;
19970 esac
19971
19972 if test "$with_dmalloc" = yes ; then
19973         echo "$as_me:19973: checking for dmalloc.h" >&5
19974 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
19975 if test "${ac_cv_header_dmalloc_h+set}" = set; then
19976   echo $ECHO_N "(cached) $ECHO_C" >&6
19977 else
19978   cat >conftest.$ac_ext <<_ACEOF
19979 #line 19979 "configure"
19980 #include "confdefs.h"
19981 #include <dmalloc.h>
19982 _ACEOF
19983 if { (eval echo "$as_me:19983: \"$ac_cpp conftest.$ac_ext\"") >&5
19984   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19985   ac_status=$?
19986   egrep -v '^ *\+' conftest.er1 >conftest.err
19987   rm -f conftest.er1
19988   cat conftest.err >&5
19989   echo "$as_me:19989: \$? = $ac_status" >&5
19990   (exit $ac_status); } >/dev/null; then
19991   if test -s conftest.err; then
19992     ac_cpp_err=$ac_c_preproc_warn_flag
19993   else
19994     ac_cpp_err=
19995   fi
19996 else
19997   ac_cpp_err=yes
19998 fi
19999 if test -z "$ac_cpp_err"; then
20000   ac_cv_header_dmalloc_h=yes
20001 else
20002   echo "$as_me: failed program was:" >&5
20003   cat conftest.$ac_ext >&5
20004   ac_cv_header_dmalloc_h=no
20005 fi
20006 rm -f conftest.err conftest.$ac_ext
20007 fi
20008 echo "$as_me:20008: result: $ac_cv_header_dmalloc_h" >&5
20009 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
20010 if test $ac_cv_header_dmalloc_h = yes; then
20011
20012 echo "$as_me:20012: checking for dmalloc_debug in -ldmalloc" >&5
20013 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
20014 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
20015   echo $ECHO_N "(cached) $ECHO_C" >&6
20016 else
20017   ac_check_lib_save_LIBS=$LIBS
20018 LIBS="-ldmalloc  $LIBS"
20019 cat >conftest.$ac_ext <<_ACEOF
20020 #line 20020 "configure"
20021 #include "confdefs.h"
20022
20023 /* Override any gcc2 internal prototype to avoid an error.  */
20024 #ifdef __cplusplus
20025 extern "C"
20026 #endif
20027 /* We use char because int might match the return type of a gcc2
20028    builtin and then its argument prototype would still apply.  */
20029 char dmalloc_debug ();
20030 int
20031 main (void)
20032 {
20033 dmalloc_debug ();
20034   ;
20035   return 0;
20036 }
20037 _ACEOF
20038 rm -f conftest.$ac_objext conftest$ac_exeext
20039 if { (eval echo "$as_me:20039: \"$ac_link\"") >&5
20040   (eval $ac_link) 2>&5
20041   ac_status=$?
20042   echo "$as_me:20042: \$? = $ac_status" >&5
20043   (exit $ac_status); } &&
20044          { ac_try='test -s conftest$ac_exeext'
20045   { (eval echo "$as_me:20045: \"$ac_try\"") >&5
20046   (eval $ac_try) 2>&5
20047   ac_status=$?
20048   echo "$as_me:20048: \$? = $ac_status" >&5
20049   (exit $ac_status); }; }; then
20050   ac_cv_lib_dmalloc_dmalloc_debug=yes
20051 else
20052   echo "$as_me: failed program was:" >&5
20053 cat conftest.$ac_ext >&5
20054 ac_cv_lib_dmalloc_dmalloc_debug=no
20055 fi
20056 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20057 LIBS=$ac_check_lib_save_LIBS
20058 fi
20059 echo "$as_me:20059: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
20060 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
20061 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
20062   cat >>confdefs.h <<EOF
20063 #define HAVE_LIBDMALLOC 1
20064 EOF
20065
20066   LIBS="-ldmalloc $LIBS"
20067
20068 fi
20069
20070 fi
20071
20072 fi
20073
20074 echo "$as_me:20074: checking if you want to use dbmalloc for testing" >&5
20075 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
20076
20077 # Check whether --with-dbmalloc or --without-dbmalloc was given.
20078 if test "${with_dbmalloc+set}" = set; then
20079   withval="$with_dbmalloc"
20080
20081 cat >>confdefs.h <<EOF
20082 #define USE_DBMALLOC 1
20083 EOF
20084
20085         : ${with_cflags:=-g}
20086         : ${with_no_leaks:=yes}
20087          with_dbmalloc=yes
20088 else
20089   with_dbmalloc=
20090 fi;
20091 echo "$as_me:20091: result: ${with_dbmalloc:-no}" >&5
20092 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
20093
20094 case .$with_cflags in
20095 (.*-g*)
20096         case .$CFLAGS in
20097         (.*-g*)
20098                 ;;
20099         (*)
20100
20101 cf_fix_cppflags=no
20102 cf_new_cflags=
20103 cf_new_cppflags=
20104 cf_new_extra_cppflags=
20105
20106 for cf_add_cflags in -g
20107 do
20108 case $cf_fix_cppflags in
20109 (no)
20110         case $cf_add_cflags in
20111         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20112                 case $cf_add_cflags in
20113                 (-D*)
20114                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20115
20116                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20117                                 && test -z "${cf_tst_cflags}" \
20118                                 && cf_fix_cppflags=yes
20119
20120                         if test $cf_fix_cppflags = yes ; then
20121
20122         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20123         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20124
20125                                 continue
20126                         elif test "${cf_tst_cflags}" = "\"'" ; then
20127
20128         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20129         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20130
20131                                 continue
20132                         fi
20133                         ;;
20134                 esac
20135                 case "$CPPFLAGS" in
20136                 (*$cf_add_cflags)
20137                         ;;
20138                 (*)
20139                         case $cf_add_cflags in
20140                         (-D*)
20141                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20142
20143 CPPFLAGS=`echo "$CPPFLAGS" | \
20144         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20145                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20146
20147                                 ;;
20148                         esac
20149
20150         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20151         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20152
20153                         ;;
20154                 esac
20155                 ;;
20156         (*)
20157
20158         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20159         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20160
20161                 ;;
20162         esac
20163         ;;
20164 (yes)
20165
20166         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20167         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20168
20169         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20170
20171         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20172                 && test -z "${cf_tst_cflags}" \
20173                 && cf_fix_cppflags=no
20174         ;;
20175 esac
20176 done
20177
20178 if test -n "$cf_new_cflags" ; then
20179
20180         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20181         CFLAGS="${CFLAGS}$cf_new_cflags"
20182
20183 fi
20184
20185 if test -n "$cf_new_cppflags" ; then
20186
20187         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20188         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20189
20190 fi
20191
20192 if test -n "$cf_new_extra_cppflags" ; then
20193
20194         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20195         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20196
20197 fi
20198
20199                 ;;
20200         esac
20201         ;;
20202 esac
20203
20204 if test "$with_dbmalloc" = yes ; then
20205         echo "$as_me:20205: checking for dbmalloc.h" >&5
20206 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
20207 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
20208   echo $ECHO_N "(cached) $ECHO_C" >&6
20209 else
20210   cat >conftest.$ac_ext <<_ACEOF
20211 #line 20211 "configure"
20212 #include "confdefs.h"
20213 #include <dbmalloc.h>
20214 _ACEOF
20215 if { (eval echo "$as_me:20215: \"$ac_cpp conftest.$ac_ext\"") >&5
20216   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20217   ac_status=$?
20218   egrep -v '^ *\+' conftest.er1 >conftest.err
20219   rm -f conftest.er1
20220   cat conftest.err >&5
20221   echo "$as_me:20221: \$? = $ac_status" >&5
20222   (exit $ac_status); } >/dev/null; then
20223   if test -s conftest.err; then
20224     ac_cpp_err=$ac_c_preproc_warn_flag
20225   else
20226     ac_cpp_err=
20227   fi
20228 else
20229   ac_cpp_err=yes
20230 fi
20231 if test -z "$ac_cpp_err"; then
20232   ac_cv_header_dbmalloc_h=yes
20233 else
20234   echo "$as_me: failed program was:" >&5
20235   cat conftest.$ac_ext >&5
20236   ac_cv_header_dbmalloc_h=no
20237 fi
20238 rm -f conftest.err conftest.$ac_ext
20239 fi
20240 echo "$as_me:20240: result: $ac_cv_header_dbmalloc_h" >&5
20241 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
20242 if test $ac_cv_header_dbmalloc_h = yes; then
20243
20244 echo "$as_me:20244: checking for debug_malloc in -ldbmalloc" >&5
20245 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
20246 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
20247   echo $ECHO_N "(cached) $ECHO_C" >&6
20248 else
20249   ac_check_lib_save_LIBS=$LIBS
20250 LIBS="-ldbmalloc  $LIBS"
20251 cat >conftest.$ac_ext <<_ACEOF
20252 #line 20252 "configure"
20253 #include "confdefs.h"
20254
20255 /* Override any gcc2 internal prototype to avoid an error.  */
20256 #ifdef __cplusplus
20257 extern "C"
20258 #endif
20259 /* We use char because int might match the return type of a gcc2
20260    builtin and then its argument prototype would still apply.  */
20261 char debug_malloc ();
20262 int
20263 main (void)
20264 {
20265 debug_malloc ();
20266   ;
20267   return 0;
20268 }
20269 _ACEOF
20270 rm -f conftest.$ac_objext conftest$ac_exeext
20271 if { (eval echo "$as_me:20271: \"$ac_link\"") >&5
20272   (eval $ac_link) 2>&5
20273   ac_status=$?
20274   echo "$as_me:20274: \$? = $ac_status" >&5
20275   (exit $ac_status); } &&
20276          { ac_try='test -s conftest$ac_exeext'
20277   { (eval echo "$as_me:20277: \"$ac_try\"") >&5
20278   (eval $ac_try) 2>&5
20279   ac_status=$?
20280   echo "$as_me:20280: \$? = $ac_status" >&5
20281   (exit $ac_status); }; }; then
20282   ac_cv_lib_dbmalloc_debug_malloc=yes
20283 else
20284   echo "$as_me: failed program was:" >&5
20285 cat conftest.$ac_ext >&5
20286 ac_cv_lib_dbmalloc_debug_malloc=no
20287 fi
20288 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20289 LIBS=$ac_check_lib_save_LIBS
20290 fi
20291 echo "$as_me:20291: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
20292 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
20293 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
20294   cat >>confdefs.h <<EOF
20295 #define HAVE_LIBDBMALLOC 1
20296 EOF
20297
20298   LIBS="-ldbmalloc $LIBS"
20299
20300 fi
20301
20302 fi
20303
20304 fi
20305
20306 echo "$as_me:20306: checking if you want to use valgrind for testing" >&5
20307 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
20308
20309 # Check whether --with-valgrind or --without-valgrind was given.
20310 if test "${with_valgrind+set}" = set; then
20311   withval="$with_valgrind"
20312
20313 cat >>confdefs.h <<EOF
20314 #define USE_VALGRIND 1
20315 EOF
20316
20317         : ${with_cflags:=-g}
20318         : ${with_no_leaks:=yes}
20319          with_valgrind=yes
20320 else
20321   with_valgrind=
20322 fi;
20323 echo "$as_me:20323: result: ${with_valgrind:-no}" >&5
20324 echo "${ECHO_T}${with_valgrind:-no}" >&6
20325
20326 case .$with_cflags in
20327 (.*-g*)
20328         case .$CFLAGS in
20329         (.*-g*)
20330                 ;;
20331         (*)
20332
20333 cf_fix_cppflags=no
20334 cf_new_cflags=
20335 cf_new_cppflags=
20336 cf_new_extra_cppflags=
20337
20338 for cf_add_cflags in -g
20339 do
20340 case $cf_fix_cppflags in
20341 (no)
20342         case $cf_add_cflags in
20343         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20344                 case $cf_add_cflags in
20345                 (-D*)
20346                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20347
20348                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20349                                 && test -z "${cf_tst_cflags}" \
20350                                 && cf_fix_cppflags=yes
20351
20352                         if test $cf_fix_cppflags = yes ; then
20353
20354         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20355         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20356
20357                                 continue
20358                         elif test "${cf_tst_cflags}" = "\"'" ; then
20359
20360         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20361         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20362
20363                                 continue
20364                         fi
20365                         ;;
20366                 esac
20367                 case "$CPPFLAGS" in
20368                 (*$cf_add_cflags)
20369                         ;;
20370                 (*)
20371                         case $cf_add_cflags in
20372                         (-D*)
20373                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20374
20375 CPPFLAGS=`echo "$CPPFLAGS" | \
20376         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20377                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20378
20379                                 ;;
20380                         esac
20381
20382         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20383         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20384
20385                         ;;
20386                 esac
20387                 ;;
20388         (*)
20389
20390         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20391         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20392
20393                 ;;
20394         esac
20395         ;;
20396 (yes)
20397
20398         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20399         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20400
20401         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20402
20403         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20404                 && test -z "${cf_tst_cflags}" \
20405                 && cf_fix_cppflags=no
20406         ;;
20407 esac
20408 done
20409
20410 if test -n "$cf_new_cflags" ; then
20411
20412         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20413         CFLAGS="${CFLAGS}$cf_new_cflags"
20414
20415 fi
20416
20417 if test -n "$cf_new_cppflags" ; then
20418
20419         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20420         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20421
20422 fi
20423
20424 if test -n "$cf_new_extra_cppflags" ; then
20425
20426         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20427         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20428
20429 fi
20430
20431                 ;;
20432         esac
20433         ;;
20434 esac
20435
20436 echo "$as_me:20436: checking if you want to perform memory-leak testing" >&5
20437 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
20438
20439 # Check whether --enable-leaks or --disable-leaks was given.
20440 if test "${enable_leaks+set}" = set; then
20441   enableval="$enable_leaks"
20442   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
20443 else
20444   : ${with_no_leaks:=no}
20445 fi;
20446 echo "$as_me:20446: result: $with_no_leaks" >&5
20447 echo "${ECHO_T}$with_no_leaks" >&6
20448
20449 if test "$with_no_leaks" = yes ; then
20450
20451 cat >>confdefs.h <<\EOF
20452 #define NO_LEAKS 1
20453 EOF
20454
20455 cat >>confdefs.h <<\EOF
20456 #define YY_NO_LEAKS 1
20457 EOF
20458
20459 fi
20460
20461 LD_RPATH_OPT=
20462 if test "x$cf_cv_enable_rpath" != xno
20463 then
20464         echo "$as_me:20464: checking for an rpath option" >&5
20465 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
20466         case $cf_cv_system_name in
20467         (irix*)
20468                 if test "$GCC" = yes; then
20469                         LD_RPATH_OPT="-Wl,-rpath,"
20470                 else
20471                         LD_RPATH_OPT="-rpath "
20472                 fi
20473                 ;;
20474         (linux*|gnu*|k*bsd*-gnu|freebsd*)
20475                 LD_RPATH_OPT="-Wl,-rpath,"
20476                 ;;
20477         (openbsd[2-9].*|mirbsd*)
20478                 LD_RPATH_OPT="-Wl,-rpath,"
20479                 ;;
20480         (dragonfly*)
20481                 LD_RPATH_OPT="-rpath "
20482                 ;;
20483         (netbsd*)
20484                 LD_RPATH_OPT="-Wl,-rpath,"
20485                 ;;
20486         (osf*|mls+*)
20487                 LD_RPATH_OPT="-rpath "
20488                 ;;
20489         (solaris2*)
20490                 LD_RPATH_OPT="-R"
20491                 ;;
20492         (*)
20493                 ;;
20494         esac
20495         echo "$as_me:20495: result: $LD_RPATH_OPT" >&5
20496 echo "${ECHO_T}$LD_RPATH_OPT" >&6
20497
20498         case "x$LD_RPATH_OPT" in
20499         (x-R*)
20500                 echo "$as_me:20500: checking if we need a space after rpath option" >&5
20501 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
20502                 cf_save_LIBS="$LIBS"
20503
20504 cf_add_libs="${LD_RPATH_OPT}$libdir"
20505 # Filter out duplicates - this happens with badly-designed ".pc" files...
20506 for cf_add_1lib in $LIBS
20507 do
20508         for cf_add_2lib in $cf_add_libs
20509         do
20510                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
20511                 then
20512                         cf_add_1lib=
20513                         break
20514                 fi
20515         done
20516         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
20517 done
20518 LIBS="$cf_add_libs"
20519
20520                 cat >conftest.$ac_ext <<_ACEOF
20521 #line 20521 "configure"
20522 #include "confdefs.h"
20523
20524 int
20525 main (void)
20526 {
20527
20528   ;
20529   return 0;
20530 }
20531 _ACEOF
20532 rm -f conftest.$ac_objext conftest$ac_exeext
20533 if { (eval echo "$as_me:20533: \"$ac_link\"") >&5
20534   (eval $ac_link) 2>&5
20535   ac_status=$?
20536   echo "$as_me:20536: \$? = $ac_status" >&5
20537   (exit $ac_status); } &&
20538          { ac_try='test -s conftest$ac_exeext'
20539   { (eval echo "$as_me:20539: \"$ac_try\"") >&5
20540   (eval $ac_try) 2>&5
20541   ac_status=$?
20542   echo "$as_me:20542: \$? = $ac_status" >&5
20543   (exit $ac_status); }; }; then
20544   cf_rpath_space=no
20545 else
20546   echo "$as_me: failed program was:" >&5
20547 cat conftest.$ac_ext >&5
20548 cf_rpath_space=yes
20549 fi
20550 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20551                 LIBS="$cf_save_LIBS"
20552                 echo "$as_me:20552: result: $cf_rpath_space" >&5
20553 echo "${ECHO_T}$cf_rpath_space" >&6
20554                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
20555                 ;;
20556         esac
20557 fi
20558
20559 echo "$as_me:20559: checking if rpath-hack should be disabled" >&5
20560 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
20561
20562 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
20563 if test "${enable_rpath_hack+set}" = set; then
20564   enableval="$enable_rpath_hack"
20565   test "$enableval" != no && enableval=yes
20566         if test "$enableval" != "yes" ; then
20567     cf_disable_rpath_hack=yes
20568         else
20569                 cf_disable_rpath_hack=no
20570         fi
20571 else
20572   enableval=yes
20573         cf_disable_rpath_hack=no
20574
20575 fi;
20576 echo "$as_me:20576: result: $cf_disable_rpath_hack" >&5
20577 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
20578 if test "$cf_disable_rpath_hack" = no ; then
20579
20580 echo "$as_me:20580: checking for updated LDFLAGS" >&5
20581 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
20582 if test -n "$LD_RPATH_OPT" ; then
20583         echo "$as_me:20583: result: maybe" >&5
20584 echo "${ECHO_T}maybe" >&6
20585
20586         for ac_prog in ldd
20587 do
20588   # Extract the first word of "$ac_prog", so it can be a program name with args.
20589 set dummy $ac_prog; ac_word=$2
20590 echo "$as_me:20590: checking for $ac_word" >&5
20591 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
20592 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
20593   echo $ECHO_N "(cached) $ECHO_C" >&6
20594 else
20595   if test -n "$cf_ldd_prog"; then
20596   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
20597 else
20598   ac_save_IFS=$IFS; IFS=$ac_path_separator
20599 ac_dummy="$PATH"
20600 for ac_dir in $ac_dummy; do
20601   IFS=$ac_save_IFS
20602   test -z "$ac_dir" && ac_dir=.
20603   $as_executable_p "$ac_dir/$ac_word" || continue
20604 ac_cv_prog_cf_ldd_prog="$ac_prog"
20605 echo "$as_me:20605: found $ac_dir/$ac_word" >&5
20606 break
20607 done
20608
20609 fi
20610 fi
20611 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
20612 if test -n "$cf_ldd_prog"; then
20613   echo "$as_me:20613: result: $cf_ldd_prog" >&5
20614 echo "${ECHO_T}$cf_ldd_prog" >&6
20615 else
20616   echo "$as_me:20616: result: no" >&5
20617 echo "${ECHO_T}no" >&6
20618 fi
20619
20620   test -n "$cf_ldd_prog" && break
20621 done
20622 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
20623
20624         cf_rpath_list="/usr/lib /lib"
20625         if test "$cf_ldd_prog" != no
20626         then
20627                 cf_rpath_oops=
20628
20629 cat >conftest.$ac_ext <<_ACEOF
20630 #line 20630 "configure"
20631 #include "confdefs.h"
20632 #include <stdio.h>
20633 int
20634 main (void)
20635 {
20636 printf("Hello");
20637   ;
20638   return 0;
20639 }
20640 _ACEOF
20641 rm -f conftest.$ac_objext conftest$ac_exeext
20642 if { (eval echo "$as_me:20642: \"$ac_link\"") >&5
20643   (eval $ac_link) 2>&5
20644   ac_status=$?
20645   echo "$as_me:20645: \$? = $ac_status" >&5
20646   (exit $ac_status); } &&
20647          { ac_try='test -s conftest$ac_exeext'
20648   { (eval echo "$as_me:20648: \"$ac_try\"") >&5
20649   (eval $ac_try) 2>&5
20650   ac_status=$?
20651   echo "$as_me:20651: \$? = $ac_status" >&5
20652   (exit $ac_status); }; }; then
20653   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
20654                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
20655 else
20656   echo "$as_me: failed program was:" >&5
20657 cat conftest.$ac_ext >&5
20658 fi
20659 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20660
20661                 # If we passed the link-test, but get a "not found" on a given library,
20662                 # this could be due to inept reconfiguration of gcc to make it only
20663                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
20664                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
20665                 # /usr/local libraries.
20666                 if test -n "$cf_rpath_oops"
20667                 then
20668                         for cf_rpath_src in $cf_rpath_oops
20669                         do
20670                                 for cf_rpath_dir in \
20671                                         /usr/local \
20672                                         /usr/pkg \
20673                                         /opt/sfw
20674                                 do
20675                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
20676                                         then
20677                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
20678
20679 echo "${as_me:-configure}:20679: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
20680
20681                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
20682                                                 break
20683                                         fi
20684                                 done
20685                         done
20686                 fi
20687         fi
20688
20689         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20690
20691 echo "${as_me:-configure}:20691: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20692
20693 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
20694
20695 echo "${as_me:-configure}:20695: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
20696
20697 cf_rpath_dst=
20698 for cf_rpath_src in $LDFLAGS
20699 do
20700         case $cf_rpath_src in
20701         (-L*)
20702
20703                 # check if this refers to a directory which we will ignore
20704                 cf_rpath_skip=no
20705                 if test -n "$cf_rpath_list"
20706                 then
20707                         for cf_rpath_item in $cf_rpath_list
20708                         do
20709                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20710                                 then
20711                                         cf_rpath_skip=yes
20712                                         break
20713                                 fi
20714                         done
20715                 fi
20716
20717                 if test "$cf_rpath_skip" = no
20718                 then
20719                         # transform the option
20720                         if test "$LD_RPATH_OPT" = "-R " ; then
20721                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20722                         else
20723                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20724                         fi
20725
20726                         # if we have not already added this, add it now
20727                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20728                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20729                         then
20730                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20731
20732 echo "${as_me:-configure}:20732: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20733
20734                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20735                         fi
20736                 fi
20737                 ;;
20738         esac
20739         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20740 done
20741 LDFLAGS=$cf_rpath_dst
20742
20743 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
20744
20745 echo "${as_me:-configure}:20745: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
20746
20747 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
20748
20749 echo "${as_me:-configure}:20749: testing ...checking LIBS $LIBS ..." 1>&5
20750
20751 cf_rpath_dst=
20752 for cf_rpath_src in $LIBS
20753 do
20754         case $cf_rpath_src in
20755         (-L*)
20756
20757                 # check if this refers to a directory which we will ignore
20758                 cf_rpath_skip=no
20759                 if test -n "$cf_rpath_list"
20760                 then
20761                         for cf_rpath_item in $cf_rpath_list
20762                         do
20763                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20764                                 then
20765                                         cf_rpath_skip=yes
20766                                         break
20767                                 fi
20768                         done
20769                 fi
20770
20771                 if test "$cf_rpath_skip" = no
20772                 then
20773                         # transform the option
20774                         if test "$LD_RPATH_OPT" = "-R " ; then
20775                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20776                         else
20777                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20778                         fi
20779
20780                         # if we have not already added this, add it now
20781                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20782                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20783                         then
20784                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20785
20786 echo "${as_me:-configure}:20786: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20787
20788                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20789                         fi
20790                 fi
20791                 ;;
20792         esac
20793         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20794 done
20795 LIBS=$cf_rpath_dst
20796
20797 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
20798
20799 echo "${as_me:-configure}:20799: testing ...checked LIBS $LIBS ..." 1>&5
20800
20801         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20802
20803 echo "${as_me:-configure}:20803: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20804
20805 else
20806         echo "$as_me:20806: result: no" >&5
20807 echo "${ECHO_T}no" >&6
20808 fi
20809
20810 fi
20811
20812 TEST_ARGS="$LIBS"
20813 LIBS=
20814
20815 ac_config_files="$ac_config_files Makefile"
20816 ac_config_commands="$ac_config_commands default"
20817 cat >confcache <<\_ACEOF
20818 # This file is a shell script that caches the results of configure
20819 # tests run on this system so they can be shared between configure
20820 # scripts and configure runs, see configure's option --config-cache.
20821 # It is not useful on other systems.  If it contains results you don't
20822 # want to keep, you may remove or edit it.
20823 #
20824 # config.status only pays attention to the cache file if you give it
20825 # the --recheck option to rerun configure.
20826 #
20827 # `ac_cv_env_foo' variables (set or unset) will be overriden when
20828 # loading this file, other *unset* `ac_cv_foo' will be assigned the
20829 # following values.
20830
20831 _ACEOF
20832
20833 # The following way of writing the cache mishandles newlines in values,
20834 # but we know of no workaround that is simple, portable, and efficient.
20835 # So, don't put newlines in cache variables' values.
20836 # Ultrix sh set writes to stderr and can't be redirected directly,
20837 # and sets the high bit in the cache file unless we assign to the vars.
20838 {
20839   (set) 2>&1 |
20840     case `(ac_space=' '; set | grep ac_space) 2>&1` in
20841     *ac_space=\ *)
20842       # `set' does not quote correctly, so add quotes (double-quote
20843       # substitution turns \\\\ into \\, and sed turns \\ into \).
20844       sed -n \
20845         "s/'/'\\\\''/g;
20846           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
20847       ;;
20848     *)
20849       # `set' quotes correctly as required by POSIX, so do not add quotes.
20850       sed -n \
20851         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
20852       ;;
20853     esac;
20854 } |
20855   sed '
20856      t clear
20857      : clear
20858      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
20859      t end
20860      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
20861      : end' >>confcache
20862 if cmp -s $cache_file confcache; then :; else
20863   if test -w $cache_file; then
20864     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
20865     cat confcache >$cache_file
20866   else
20867     echo "not updating unwritable cache $cache_file"
20868   fi
20869 fi
20870 rm -f confcache
20871
20872 test "x$prefix" = xNONE && prefix=$ac_default_prefix
20873 # Let make expand exec_prefix.
20874 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
20875
20876 # VPATH may cause trouble with some makes, so we remove $(srcdir),
20877 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
20878 # trailing colons and then remove the whole line if VPATH becomes empty
20879 # (actually we leave an empty line to preserve line numbers).
20880 if test "x$srcdir" = x.; then
20881   ac_vpsub='/^[         ]*VPATH[        ]*=/{
20882 s/:*\$(srcdir):*/:/;
20883 s/:*\${srcdir}:*/:/;
20884 s/:*@srcdir@:*/:/;
20885 s/^\([^=]*=[    ]*\):*/\1/;
20886 s/:*$//;
20887 s/^[^=]*=[      ]*$//;
20888 }'
20889 fi
20890
20891 DEFS=-DHAVE_CONFIG_H
20892
20893 : ${CONFIG_STATUS=./config.status}
20894 ac_clean_files_save=$ac_clean_files
20895 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
20896 { echo "$as_me:20896: creating $CONFIG_STATUS" >&5
20897 echo "$as_me: creating $CONFIG_STATUS" >&6;}
20898 cat >$CONFIG_STATUS <<_ACEOF
20899 #! $SHELL
20900 # Generated automatically by configure.
20901 # Run this file to recreate the current configuration.
20902 # Compiler output produced by configure, useful for debugging
20903 # configure, is in config.log if it exists.
20904
20905 debug=false
20906 SHELL=\${CONFIG_SHELL-$SHELL}
20907 ac_cs_invocation="\$0 \$@"
20908
20909 _ACEOF
20910
20911 cat >>$CONFIG_STATUS <<\_ACEOF
20912 # Be Bourne compatible
20913 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
20914   emulate sh
20915   NULLCMD=:
20916 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
20917   set -o posix
20918 fi
20919
20920 # Name of the executable.
20921 as_me=`echo "$0" |sed 's,.*[\\/],,'`
20922
20923 if expr a : '\(a\)' >/dev/null 2>&1; then
20924   as_expr=expr
20925 else
20926   as_expr=false
20927 fi
20928
20929 rm -f conf$$ conf$$.exe conf$$.file
20930 echo >conf$$.file
20931 if ln -s conf$$.file conf$$ 2>/dev/null; then
20932   # We could just check for DJGPP; but this test a) works b) is more generic
20933   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
20934   if test -f conf$$.exe; then
20935     # Don't use ln at all; we don't have any links
20936     as_ln_s='cp -p'
20937   else
20938     as_ln_s='ln -s'
20939   fi
20940 elif ln conf$$.file conf$$ 2>/dev/null; then
20941   as_ln_s=ln
20942 else
20943   as_ln_s='cp -p'
20944 fi
20945 rm -f conf$$ conf$$.exe conf$$.file
20946
20947 as_executable_p="test -f"
20948
20949 # Support unset when possible.
20950 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
20951   as_unset=unset
20952 else
20953   as_unset=false
20954 fi
20955
20956 # NLS nuisances.
20957 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
20958 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
20959 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
20960 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
20961 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
20962 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
20963 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
20964 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
20965
20966 # IFS
20967 # We need space, tab and new line, in precisely that order.
20968 as_nl='
20969 '
20970 IFS="   $as_nl"
20971
20972 # CDPATH.
20973 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
20974
20975 exec 6>&1
20976
20977 _ACEOF
20978
20979 # Files that config.status was made for.
20980 if test -n "$ac_config_files"; then
20981   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
20982 fi
20983
20984 if test -n "$ac_config_headers"; then
20985   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
20986 fi
20987
20988 if test -n "$ac_config_links"; then
20989   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
20990 fi
20991
20992 if test -n "$ac_config_commands"; then
20993   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
20994 fi
20995
20996 cat >>$CONFIG_STATUS <<\EOF
20997
20998 ac_cs_usage="\
20999 \`$as_me' instantiates files from templates according to the
21000 current configuration.
21001
21002 Usage: $0 [OPTIONS] [FILE]...
21003
21004   -h, --help       print this help, then exit
21005   -V, --version    print version number, then exit
21006   -d, --debug      don't remove temporary files
21007       --recheck    update $as_me by reconfiguring in the same conditions
21008   --file=FILE[:TEMPLATE]
21009                    instantiate the configuration file FILE
21010   --header=FILE[:TEMPLATE]
21011                    instantiate the configuration header FILE
21012
21013 Configuration files:
21014 $config_files
21015
21016 Configuration headers:
21017 $config_headers
21018
21019 Configuration commands:
21020 $config_commands
21021
21022 Report bugs to <dickey@invisible-island.net>."
21023 EOF
21024
21025 cat >>$CONFIG_STATUS <<EOF
21026 ac_cs_version="\\
21027 config.status
21028 configured by $0, generated by GNU Autoconf 2.52.20190901,
21029   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
21030
21031 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
21032 Free Software Foundation, Inc.
21033 This config.status script is free software; the Free Software Foundation
21034 gives unlimited permission to copy, distribute and modify it."
21035 srcdir=$srcdir
21036 INSTALL="$INSTALL"
21037 EOF
21038
21039 cat >>$CONFIG_STATUS <<\EOF
21040 # If no file are specified by the user, then we need to provide default
21041 # value.  By we need to know if files were specified by the user.
21042 ac_need_defaults=:
21043 while test $# != 0
21044 do
21045   case $1 in
21046   --*=*)
21047     ac_option=`expr "x$1" : 'x\([^=]*\)='`
21048     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
21049     shift
21050     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
21051     shift
21052     ;;
21053   -*);;
21054   *) # This is not an option, so the user has probably given explicit
21055      # arguments.
21056      ac_need_defaults=false;;
21057   esac
21058
21059   case $1 in
21060   # Handling of the options.
21061 EOF
21062 cat >>$CONFIG_STATUS <<EOF
21063   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
21064     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
21065     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
21066 EOF
21067 cat >>$CONFIG_STATUS <<\EOF
21068   --version | --vers* | -V )
21069     echo "$ac_cs_version"; exit 0 ;;
21070   --he | --h)
21071     # Conflict between --help and --header
21072     { { echo "$as_me:21072: error: ambiguous option: $1
21073 Try \`$0 --help' for more information." >&5
21074 echo "$as_me: error: ambiguous option: $1
21075 Try \`$0 --help' for more information." >&2;}
21076    { (exit 1); exit 1; }; };;
21077   --help | --hel | -h )
21078     echo "$ac_cs_usage"; exit 0 ;;
21079   --debug | --d* | -d )
21080     debug=: ;;
21081   --file | --fil | --fi | --f )
21082     shift
21083     CONFIG_FILES="$CONFIG_FILES $1"
21084     ac_need_defaults=false;;
21085   --header | --heade | --head | --hea )
21086     shift
21087     CONFIG_HEADERS="$CONFIG_HEADERS $1"
21088     ac_need_defaults=false;;
21089
21090   # This is an error.
21091   -*) { { echo "$as_me:21091: error: unrecognized option: $1
21092 Try \`$0 --help' for more information." >&5
21093 echo "$as_me: error: unrecognized option: $1
21094 Try \`$0 --help' for more information." >&2;}
21095    { (exit 1); exit 1; }; } ;;
21096
21097   *) ac_config_targets="$ac_config_targets $1" ;;
21098
21099   esac
21100   shift
21101 done
21102
21103 exec 5>>config.log
21104 cat >&5 << _ACEOF
21105
21106 ## ----------------------- ##
21107 ## Running config.status.  ##
21108 ## ----------------------- ##
21109
21110 This file was extended by $as_me 2.52.20190901, executed with
21111   CONFIG_FILES    = $CONFIG_FILES
21112   CONFIG_HEADERS  = $CONFIG_HEADERS
21113   CONFIG_LINKS    = $CONFIG_LINKS
21114   CONFIG_COMMANDS = $CONFIG_COMMANDS
21115   > $ac_cs_invocation
21116 on `(hostname || uname -n) 2>/dev/null | sed 1q`
21117
21118 _ACEOF
21119 EOF
21120
21121 cat >>$CONFIG_STATUS <<EOF
21122 #
21123 # INIT-COMMANDS section.
21124 #
21125
21126 AWK="$AWK"
21127 ECHO_CC="$ECHO_CC"
21128 ECHO_LD="$ECHO_LD"
21129 SHOW_CC="$SHOW_LD"
21130
21131 EOF
21132
21133 cat >>$CONFIG_STATUS <<\EOF
21134 for ac_config_target in $ac_config_targets
21135 do
21136   case "$ac_config_target" in
21137   # Handling of arguments.
21138   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
21139   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
21140   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
21141   *) { { echo "$as_me:21141: error: invalid argument: $ac_config_target" >&5
21142 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
21143    { (exit 1); exit 1; }; };;
21144   esac
21145 done
21146
21147 # If the user did not use the arguments to specify the items to instantiate,
21148 # then the envvar interface is used.  Set only those that are not.
21149 # We use the long form for the default assignment because of an extremely
21150 # bizarre bug on SunOS 4.1.3.
21151 if $ac_need_defaults; then
21152   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
21153   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
21154   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
21155 fi
21156
21157 # Create a temporary directory, and hook for its removal unless debugging.
21158 $debug ||
21159 {
21160   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
21161   trap '{ (exit 1); exit 1; }' 1 2 13 15
21162 }
21163
21164 # Create a (secure) tmp directory for tmp files.
21165 : ${TMPDIR=/tmp}
21166 {
21167   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
21168   test -n "$tmp" && test -d "$tmp"
21169 }  ||
21170 {
21171   tmp=$TMPDIR/cs$$-$RANDOM
21172   (umask 077 && mkdir $tmp)
21173 } ||
21174 {
21175    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
21176    { (exit 1); exit 1; }
21177 }
21178
21179 EOF
21180
21181 cat >>$CONFIG_STATUS <<EOF
21182
21183 #
21184 # CONFIG_FILES section.
21185 #
21186
21187 # No need to generate the scripts if there are no CONFIG_FILES.
21188 # This happens for instance when ./config.status config.h
21189 if test -n "\$CONFIG_FILES"; then
21190   # Protect against being on the right side of a sed subst in config.status.
21191   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
21192    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
21193 s,@SHELL@,$SHELL,;t t
21194 s,@exec_prefix@,$exec_prefix,;t t
21195 s,@prefix@,$prefix,;t t
21196 s,@program_transform_name@,$program_transform_name,;t t
21197 s,@bindir@,$bindir,;t t
21198 s,@sbindir@,$sbindir,;t t
21199 s,@libexecdir@,$libexecdir,;t t
21200 s,@datarootdir@,$datarootdir,;t t
21201 s,@datadir@,$datadir,;t t
21202 s,@sysconfdir@,$sysconfdir,;t t
21203 s,@sharedstatedir@,$sharedstatedir,;t t
21204 s,@localstatedir@,$localstatedir,;t t
21205 s,@runstatedir@,$runstatedir,;t t
21206 s,@libdir@,$libdir,;t t
21207 s,@includedir@,$includedir,;t t
21208 s,@oldincludedir@,$oldincludedir,;t t
21209 s,@infodir@,$infodir,;t t
21210 s,@mandir@,$mandir,;t t
21211 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
21212 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
21213 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
21214 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
21215 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
21216 s,@build_alias@,$build_alias,;t t
21217 s,@host_alias@,$host_alias,;t t
21218 s,@target_alias@,$target_alias,;t t
21219 s,@ECHO_C@,$ECHO_C,;t t
21220 s,@ECHO_N@,$ECHO_N,;t t
21221 s,@ECHO_T@,$ECHO_T,;t t
21222 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
21223 s,@DEFS@,$DEFS,;t t
21224 s,@LIBS@,$LIBS,;t t
21225 s,@build@,$build,;t t
21226 s,@build_cpu@,$build_cpu,;t t
21227 s,@build_vendor@,$build_vendor,;t t
21228 s,@build_os@,$build_os,;t t
21229 s,@host@,$host,;t t
21230 s,@host_cpu@,$host_cpu,;t t
21231 s,@host_vendor@,$host_vendor,;t t
21232 s,@host_os@,$host_os,;t t
21233 s,@SET_MAKE@,$SET_MAKE,;t t
21234 s,@CC@,$CC,;t t
21235 s,@CFLAGS@,$CFLAGS,;t t
21236 s,@LDFLAGS@,$LDFLAGS,;t t
21237 s,@CPPFLAGS@,$CPPFLAGS,;t t
21238 s,@ac_ct_CC@,$ac_ct_CC,;t t
21239 s,@EXEEXT@,$EXEEXT,;t t
21240 s,@OBJEXT@,$OBJEXT,;t t
21241 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
21242 s,@CPP@,$CPP,;t t
21243 s,@AWK@,$AWK,;t t
21244 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
21245 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
21246 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
21247 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
21248 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
21249 s,@LINT@,$LINT,;t t
21250 s,@LINT_OPTS@,$LINT_OPTS,;t t
21251 s,@CTAGS@,$CTAGS,;t t
21252 s,@ETAGS@,$ETAGS,;t t
21253 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
21254 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
21255 s,@MATH_LIB@,$MATH_LIB,;t t
21256 s,@top_builddir@,$top_builddir,;t t
21257 s,@CC_G_OPT@,$CC_G_OPT,;t t
21258 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
21259 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
21260 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
21261 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
21262 s,@LD@,$LD,;t t
21263 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
21264 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
21265 s,@LD_MODEL@,$LD_MODEL,;t t
21266 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
21267 s,@LIBTOOL@,$LIBTOOL,;t t
21268 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
21269 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
21270 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
21271 s,@LIB_LINK@,$LIB_LINK,;t t
21272 s,@LINK_TESTS@,$LINK_TESTS,;t t
21273 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
21274 s,@PACKAGE@,$PACKAGE,;t t
21275 s,@PTHREAD@,$PTHREAD,;t t
21276 s,@TEST_ARGS@,$TEST_ARGS,;t t
21277 s,@TEST_DEPS@,$TEST_DEPS,;t t
21278 s,@TEST_LIBS@,$TEST_LIBS,;t t
21279 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
21280 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
21281 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
21282 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
21283 s,@includesubdir@,$includesubdir,;t t
21284 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
21285 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
21286 s,@ECHO_LT@,$ECHO_LT,;t t
21287 s,@ECHO_LD@,$ECHO_LD,;t t
21288 s,@RULE_CC@,$RULE_CC,;t t
21289 s,@SHOW_CC@,$SHOW_CC,;t t
21290 s,@ECHO_CC@,$ECHO_CC,;t t
21291 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
21292 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
21293 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
21294 s,@X_CFLAGS@,$X_CFLAGS,;t t
21295 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
21296 s,@X_LIBS@,$X_LIBS,;t t
21297 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
21298 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
21299 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
21300 s,@RGB_PATH@,$RGB_PATH,;t t
21301 s,@no_x11_rgb@,$no_x11_rgb,;t t
21302 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
21303 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
21304 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
21305 CEOF
21306
21307 EOF
21308
21309   cat >>$CONFIG_STATUS <<\EOF
21310   # Split the substitutions into bite-sized pieces for seds with
21311   # small command number limits, like on Digital OSF/1 and HP-UX.
21312   ac_max_sed_lines=48
21313   ac_sed_frag=1 # Number of current file.
21314   ac_beg=1 # First line for current file.
21315   ac_end=$ac_max_sed_lines # Line after last line for current file.
21316   ac_more_lines=:
21317   ac_sed_cmds=
21318   while $ac_more_lines; do
21319     if test $ac_beg -gt 1; then
21320       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21321     else
21322       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21323     fi
21324     if test ! -s $tmp/subs.frag; then
21325       ac_more_lines=false
21326     else
21327       # The purpose of the label and of the branching condition is to
21328       # speed up the sed processing (if there are no `@' at all, there
21329       # is no need to browse any of the substitutions).
21330       # These are the two extra sed commands mentioned above.
21331       (echo ':t
21332   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
21333       # It is possible to make a multiline substitution using escaped newlines.
21334       # Ensure that we do not split the substitution between script fragments.
21335       ac_BEG=$ac_end
21336       ac_END=`expr $ac_end + $ac_max_sed_lines`
21337       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
21338       if test -s $tmp/subs.next; then
21339         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
21340         if test ! -s $tmp/subs.edit; then
21341           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
21342           if test ! -s $tmp/subs.edit; then
21343             if test $ac_beg -gt 1; then
21344               ac_end=`expr $ac_end - 1`
21345               continue
21346             fi
21347           fi
21348         fi
21349       fi
21350
21351       if test -z "$ac_sed_cmds"; then
21352         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
21353       else
21354         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
21355       fi
21356       ac_sed_frag=`expr $ac_sed_frag + 1`
21357       ac_beg=$ac_end
21358       ac_end=`expr $ac_end + $ac_max_sed_lines`
21359     fi
21360   done
21361   if test -z "$ac_sed_cmds"; then
21362     ac_sed_cmds=cat
21363   fi
21364 fi # test -n "$CONFIG_FILES"
21365
21366 EOF
21367 cat >>$CONFIG_STATUS <<\EOF
21368 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
21369   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21370   case $ac_file in
21371   - | *:- | *:-:* ) # input from stdin
21372         cat >$tmp/stdin
21373         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21374         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21375   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21376         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21377   * )   ac_file_in=$ac_file.in ;;
21378   esac
21379
21380   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
21381   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21382          X"$ac_file" : 'X\(//\)[^/]' \| \
21383          X"$ac_file" : 'X\(//\)$' \| \
21384          X"$ac_file" : 'X\(/\)' \| \
21385          .     : '\(.\)' 2>/dev/null ||
21386 echo X"$ac_file" |
21387     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21388           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21389           /^X\(\/\/\)$/{ s//\1/; q; }
21390           /^X\(\/\).*/{ s//\1/; q; }
21391           s/.*/./; q'`
21392   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21393     { case "$ac_dir" in
21394   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21395   *)                      as_incr_dir=.;;
21396 esac
21397 as_dummy="$ac_dir"
21398 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21399   case $as_mkdir_dir in
21400     # Skip DOS drivespec
21401     ?:) as_incr_dir=$as_mkdir_dir ;;
21402     *)
21403       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21404       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21405     ;;
21406   esac
21407 done; }
21408
21409     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21410     # A "../" for each directory in $ac_dir_suffix.
21411     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21412   else
21413     ac_dir_suffix= ac_dots=
21414   fi
21415
21416   case $srcdir in
21417   .)  ac_srcdir=.
21418       if test -z "$ac_dots"; then
21419          ac_top_srcdir=.
21420       else
21421          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21422       fi ;;
21423   [\\/]* | ?:[\\/]* )
21424       ac_srcdir=$srcdir$ac_dir_suffix;
21425       ac_top_srcdir=$srcdir ;;
21426   *) # Relative path.
21427     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
21428     ac_top_srcdir=$ac_dots$srcdir ;;
21429   esac
21430
21431   case $INSTALL in
21432   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21433   *) ac_INSTALL=$ac_dots$INSTALL ;;
21434   esac
21435
21436   if test x"$ac_file" != x-; then
21437     { echo "$as_me:21437: creating $ac_file" >&5
21438 echo "$as_me: creating $ac_file" >&6;}
21439     rm -f "$ac_file"
21440   fi
21441   # Let's still pretend it is `configure' which instantiates (i.e., don't
21442   # use $as_me), people would be surprised to read:
21443   #    /* config.h.  Generated automatically by config.status.  */
21444   configure_input="Generated automatically from `echo $ac_file_in |
21445                                                  sed 's,.*/,,'` by configure."
21446
21447   # First look for the input files in the build tree, otherwise in the
21448   # src tree.
21449   ac_file_inputs=`IFS=:
21450     for f in $ac_file_in; do
21451       case $f in
21452       -) echo $tmp/stdin ;;
21453       [\\/$]*)
21454          # Absolute (can't be DOS-style, as IFS=:)
21455          test -f "$f" || { { echo "$as_me:21455: error: cannot find input file: $f" >&5
21456 echo "$as_me: error: cannot find input file: $f" >&2;}
21457    { (exit 1); exit 1; }; }
21458          echo $f;;
21459       *) # Relative
21460          if test -f "$f"; then
21461            # Build tree
21462            echo $f
21463          elif test -f "$srcdir/$f"; then
21464            # Source tree
21465            echo $srcdir/$f
21466          else
21467            # /dev/null tree
21468            { { echo "$as_me:21468: error: cannot find input file: $f" >&5
21469 echo "$as_me: error: cannot find input file: $f" >&2;}
21470    { (exit 1); exit 1; }; }
21471          fi;;
21472       esac
21473     done` || { (exit 1); exit 1; }
21474 EOF
21475 cat >>$CONFIG_STATUS <<\EOF
21476   ac_warn_datarootdir=no
21477   if test x"$ac_file" != x-; then
21478     for ac_item in $ac_file_inputs
21479     do
21480       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
21481       if test -n "$ac_seen"; then
21482         ac_used=`grep '@datarootdir@' $ac_item`
21483         if test -z "$ac_used"; then
21484           { echo "$as_me:21484: WARNING: datarootdir was used implicitly but not set:
21485 $ac_seen" >&5
21486 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
21487 $ac_seen" >&2;}
21488           ac_warn_datarootdir=yes
21489         fi
21490       fi
21491       ac_seen=`grep '${datarootdir}' $ac_item`
21492       if test -n "$ac_seen"; then
21493         { echo "$as_me:21493: WARNING: datarootdir was used explicitly but not set:
21494 $ac_seen" >&5
21495 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
21496 $ac_seen" >&2;}
21497         ac_warn_datarootdir=yes
21498       fi
21499     done
21500   fi
21501
21502 if test "x$ac_warn_datarootdir" = xyes; then
21503   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
21504 fi
21505
21506 EOF
21507 cat >>$CONFIG_STATUS <<EOF
21508   sed "$ac_vpsub
21509 $extrasub
21510 EOF
21511 cat >>$CONFIG_STATUS <<\EOF
21512 :t
21513 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
21514 s,@configure_input@,$configure_input,;t t
21515 s,@srcdir@,$ac_srcdir,;t t
21516 s,@top_srcdir@,$ac_top_srcdir,;t t
21517 s,@INSTALL@,$ac_INSTALL,;t t
21518 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
21519   rm -f $tmp/stdin
21520   if test x"$ac_file" != x-; then
21521     cp $tmp/out $ac_file
21522
21523     for ac_name in prefix exec_prefix datarootdir
21524     do
21525         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
21526         if test -n "$ac_seen"; then
21527             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
21528             if test -z "$ac_init"; then
21529               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
21530               { echo "$as_me:21530: WARNING: Variable $ac_name is used but was not set:
21531 $ac_seen" >&5
21532 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
21533 $ac_seen" >&2;}
21534             fi
21535         fi
21536     done
21537     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
21538     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
21539     if test -s $tmp/out; then
21540       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
21541       { echo "$as_me:21541: WARNING: Some variables may not be substituted:
21542 $ac_seen" >&5
21543 echo "$as_me: WARNING: Some variables may not be substituted:
21544 $ac_seen" >&2;}
21545     fi
21546   else
21547     cat $tmp/out
21548   fi
21549   rm -f $tmp/out
21550
21551 done
21552 EOF
21553 cat >>$CONFIG_STATUS <<\EOF
21554
21555 #
21556 # CONFIG_HEADER section.
21557 #
21558
21559 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
21560 # NAME is the cpp macro being defined and VALUE is the value it is being given.
21561 #
21562 # ac_d sets the value in "#define NAME VALUE" lines.
21563 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
21564 ac_dB='[        ].*$,\1#\2'
21565 ac_dC=' '
21566 ac_dD=',;t'
21567 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
21568 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21569 ac_iB='\([      ]\),\1#\2define\3'
21570 ac_iC=' '
21571 ac_iD='\4,;t'
21572 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
21573 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21574 ac_uB='$,\1#\2define\3'
21575 ac_uC=' '
21576 ac_uD=',;t'
21577
21578 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
21579   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21580   case $ac_file in
21581   - | *:- | *:-:* ) # input from stdin
21582         cat >$tmp/stdin
21583         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21584         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21585   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21586         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21587   * )   ac_file_in=$ac_file.in ;;
21588   esac
21589
21590   test x"$ac_file" != x- && { echo "$as_me:21590: creating $ac_file" >&5
21591 echo "$as_me: creating $ac_file" >&6;}
21592
21593   # First look for the input files in the build tree, otherwise in the
21594   # src tree.
21595   ac_file_inputs=`IFS=:
21596     for f in $ac_file_in; do
21597       case $f in
21598       -) echo $tmp/stdin ;;
21599       [\\/$]*)
21600          # Absolute (can't be DOS-style, as IFS=:)
21601          test -f "$f" || { { echo "$as_me:21601: error: cannot find input file: $f" >&5
21602 echo "$as_me: error: cannot find input file: $f" >&2;}
21603    { (exit 1); exit 1; }; }
21604          echo $f;;
21605       *) # Relative
21606          if test -f "$f"; then
21607            # Build tree
21608            echo $f
21609          elif test -f "$srcdir/$f"; then
21610            # Source tree
21611            echo $srcdir/$f
21612          else
21613            # /dev/null tree
21614            { { echo "$as_me:21614: error: cannot find input file: $f" >&5
21615 echo "$as_me: error: cannot find input file: $f" >&2;}
21616    { (exit 1); exit 1; }; }
21617          fi;;
21618       esac
21619     done` || { (exit 1); exit 1; }
21620   # Remove the trailing spaces.
21621   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
21622
21623 EOF
21624
21625 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
21626 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
21627 # be either 'cat' or 'sort'.
21628 cat confdefs.h | uniq >conftest.vals
21629
21630 # Break up conftest.vals because some shells have a limit on
21631 # the size of here documents, and old seds have small limits too.
21632
21633 rm -f conftest.tail
21634 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
21635 while grep . conftest.vals >/dev/null
21636 do
21637   # Write chunks of a limited-size here document to conftest.frag.
21638   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
21639   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
21640   echo 'CEOF' >> $CONFIG_STATUS
21641   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
21642   rm -f conftest.vals
21643   mv conftest.tail conftest.vals
21644 done
21645 rm -f conftest.vals
21646
21647 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
21648 # marker @DEFS@.
21649 echo '  cat >> conftest.edit <<CEOF
21650 /@DEFS@/r conftest.frag
21651 /@DEFS@/d
21652 CEOF
21653 sed -f conftest.edit $tmp/in > $tmp/out
21654 rm -f $tmp/in
21655 mv $tmp/out $tmp/in
21656 rm -f conftest.edit conftest.frag
21657 ' >> $CONFIG_STATUS
21658
21659 cat >>$CONFIG_STATUS <<\EOF
21660   # Let's still pretend it is `configure' which instantiates (i.e., don't
21661   # use $as_me), people would be surprised to read:
21662   #    /* config.h.  Generated automatically by config.status.  */
21663   if test x"$ac_file" = x-; then
21664     echo "/* Generated automatically by configure.  */" >$tmp/config.h
21665   else
21666     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
21667   fi
21668   cat $tmp/in >>$tmp/config.h
21669   rm -f $tmp/in
21670   if test x"$ac_file" != x-; then
21671     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
21672       { echo "$as_me:21672: $ac_file is unchanged" >&5
21673 echo "$as_me: $ac_file is unchanged" >&6;}
21674     else
21675       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21676          X"$ac_file" : 'X\(//\)[^/]' \| \
21677          X"$ac_file" : 'X\(//\)$' \| \
21678          X"$ac_file" : 'X\(/\)' \| \
21679          .     : '\(.\)' 2>/dev/null ||
21680 echo X"$ac_file" |
21681     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21682           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21683           /^X\(\/\/\)$/{ s//\1/; q; }
21684           /^X\(\/\).*/{ s//\1/; q; }
21685           s/.*/./; q'`
21686       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21687         { case "$ac_dir" in
21688   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21689   *)                      as_incr_dir=.;;
21690 esac
21691 as_dummy="$ac_dir"
21692 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21693   case $as_mkdir_dir in
21694     # Skip DOS drivespec
21695     ?:) as_incr_dir=$as_mkdir_dir ;;
21696     *)
21697       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21698       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21699     ;;
21700   esac
21701 done; }
21702
21703       fi
21704       rm -f $ac_file
21705       mv $tmp/config.h $ac_file
21706     fi
21707   else
21708     cat $tmp/config.h
21709     rm -f $tmp/config.h
21710   fi
21711 done
21712 EOF
21713 cat >>$CONFIG_STATUS <<\EOF
21714 #
21715 # CONFIG_COMMANDS section.
21716 #
21717 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
21718   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
21719   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
21720
21721   case $ac_dest in
21722     default )
21723
21724 for cf_dir in .
21725 do
21726         if test ! -d $srcdir/$cf_dir; then
21727                 continue
21728         elif test -f $srcdir/$cf_dir/programs; then
21729                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
21730         fi
21731 done
21732
21733         cat >>Makefile <<TEST_EOF
21734
21735 # These rules are generated so we do not rely on suffix rules, which do not
21736 # work consistently for different make-programs (the '\$(MODEL)/' confuses
21737 # some, and the '\$x' confuses others).
21738 TEST_EOF
21739
21740 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
21741 for N in $LIST
21742 do
21743         cat >>Makefile <<TEST_EOF
21744
21745 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
21746         \$(srcdir)/test.priv.h \\
21747         ncurses_cfg.h
21748         $SHOW_CC
21749         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
21750 TEST_EOF
21751 done
21752
21753 if test -f ../config.guess && test -f ../config.sub
21754 then
21755         cat >>Makefile <<TEST_EOF
21756
21757 # if we used CF_INHERIT for getting these files, we can remove them
21758 distclean::
21759         rm -f config.guess config.sub
21760 TEST_EOF
21761 fi
21762  ;;
21763   esac
21764 done
21765 EOF
21766
21767 cat >>$CONFIG_STATUS <<\EOF
21768
21769 { (exit 0); exit 0; }
21770 EOF
21771 chmod +x $CONFIG_STATUS
21772 ac_clean_files=$ac_clean_files_save
21773
21774 # configure is writing to config.log, and then calls config.status.
21775 # config.status does its own redirection, appending to config.log.
21776 # Unfortunately, on DOS this fails, as config.log is still kept open
21777 # by configure, so config.status won't be able to write to it; its
21778 # output is simply discarded.  So we exec the FD to /dev/null,
21779 # effectively closing config.log, so it can be properly (re)opened and
21780 # appended to by config.status.  When coming back to configure, we
21781 # need to make the FD available again.
21782 if test "$no_create" != yes; then
21783   ac_cs_success=:
21784   exec 5>/dev/null
21785   $SHELL $CONFIG_STATUS || ac_cs_success=false
21786   exec 5>>config.log
21787   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
21788   # would make configure fail if this is the last instruction.
21789   $ac_cs_success || { (exit 1); exit 1; }
21790 fi
21791