]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
8bbcf8c6e91e2f8b8c172489d3868b872eb5111d
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20200111.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 runstatedir='${localstatedir}/run'
143 libdir='${exec_prefix}/lib'
144 includedir='${prefix}/include'
145 oldincludedir='/usr/include'
146 infodir='${datarootdir}/info'
147 mandir='${datarootdir}/man'
148
149 # Identity of this package.
150 PACKAGE_NAME=
151 PACKAGE_TARNAME=
152 PACKAGE_VERSION=
153 PACKAGE_STRING=
154 PACKAGE_BUGREPORT=
155
156 ac_prev=
157 for ac_option
158 do
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
167
168   # Accept the important Cygnus configure options, so we can diagnose typos.
169
170   case $ac_option in
171
172   -bindir | --bindir | --bindi | --bind | --bin | --bi)
173     ac_prev=bindir ;;
174   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
175     bindir=$ac_optarg ;;
176
177   -build | --build | --buil | --bui | --bu)
178     ac_prev=build_alias ;;
179   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
180     build_alias=$ac_optarg ;;
181
182   -cache-file | --cache-file | --cache-fil | --cache-fi \
183   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
184     ac_prev=cache_file ;;
185   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
186   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
187     cache_file=$ac_optarg ;;
188
189   --config-cache | -C)
190     cache_file=config.cache ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir=$ac_optarg ;;
197
198   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
199   | --dataroo | --dataro | --datar)
200     ac_prev=datarootdir ;;
201   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
202   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
203     datarootdir=$ac_optarg ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     eval "enable_$ac_feature=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
216     # Reject names that are not valid shell variable names.
217     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
218       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
219    { (exit 1); exit 1; }; }
220     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
221     case $ac_option in
222       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_$ac_feature='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix=$ac_optarg ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he | -h)
241     ac_init_help=long ;;
242   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
243     ac_init_help=recursive ;;
244   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
245     ac_init_help=short ;;
246
247   -host | --host | --hos | --ho)
248     ac_prev=host_alias ;;
249   -host=* | --host=* | --hos=* | --ho=*)
250     host_alias=$ac_optarg ;;
251
252   -includedir | --includedir | --includedi | --included | --include \
253   | --includ | --inclu | --incl | --inc)
254     ac_prev=includedir ;;
255   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
256   | --includ=* | --inclu=* | --incl=* | --inc=*)
257     includedir=$ac_optarg ;;
258
259   -infodir | --infodir | --infodi | --infod | --info | --inf)
260     ac_prev=infodir ;;
261   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
262     infodir=$ac_optarg ;;
263
264   -libdir | --libdir | --libdi | --libd)
265     ac_prev=libdir ;;
266   -libdir=* | --libdir=* | --libdi=* | --libd=*)
267     libdir=$ac_optarg ;;
268
269   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
270   | --libexe | --libex | --libe)
271     ac_prev=libexecdir ;;
272   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
273   | --libexe=* | --libex=* | --libe=*)
274     libexecdir=$ac_optarg ;;
275
276   -localstatedir | --localstatedir | --localstatedi | --localstated \
277   | --localstate | --localstat | --localsta | --localst \
278   | --locals | --local | --loca | --loc | --lo)
279     ac_prev=localstatedir ;;
280   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
281   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
282   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
283     localstatedir=$ac_optarg ;;
284
285   -runstatedir | --runstatedir | --runstatedi | --runstated \
286   | --runstate | --runstat | --runsta | --runst \
287   | --runs | --run | --ru)
288     ac_prev=runstatedir ;;
289   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
290   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
291   | --runs=* | --run=* | --ru=*)
292     runstatedir=$ac_optarg ;;
293
294   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
295     ac_prev=mandir ;;
296   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
297     mandir=$ac_optarg ;;
298
299   -nfp | --nfp | --nf)
300     # Obsolete; use --without-fp.
301     with_fp=no ;;
302
303   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
304   | --no-cr | --no-c)
305     no_create=yes ;;
306
307   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
308   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
309     no_recursion=yes ;;
310
311   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
312   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
313   | --oldin | --oldi | --old | --ol | --o)
314     ac_prev=oldincludedir ;;
315   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
316   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
317   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
318     oldincludedir=$ac_optarg ;;
319
320   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
321     ac_prev=prefix ;;
322   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
323     prefix=$ac_optarg ;;
324
325   -program-prefix | --program-prefix | --program-prefi | --program-pref \
326   | --program-pre | --program-pr | --program-p)
327     ac_prev=program_prefix ;;
328   -program-prefix=* | --program-prefix=* | --program-prefi=* \
329   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
330     program_prefix=$ac_optarg ;;
331
332   -program-suffix | --program-suffix | --program-suffi | --program-suff \
333   | --program-suf | --program-su | --program-s)
334     ac_prev=program_suffix ;;
335   -program-suffix=* | --program-suffix=* | --program-suffi=* \
336   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
337     program_suffix=$ac_optarg ;;
338
339   -program-transform-name | --program-transform-name \
340   | --program-transform-nam | --program-transform-na \
341   | --program-transform-n | --program-transform- \
342   | --program-transform | --program-transfor \
343   | --program-transfo | --program-transf \
344   | --program-trans | --program-tran \
345   | --progr-tra | --program-tr | --program-t)
346     ac_prev=program_transform_name ;;
347   -program-transform-name=* | --program-transform-name=* \
348   | --program-transform-nam=* | --program-transform-na=* \
349   | --program-transform-n=* | --program-transform-=* \
350   | --program-transform=* | --program-transfor=* \
351   | --program-transfo=* | --program-transf=* \
352   | --program-trans=* | --program-tran=* \
353   | --progr-tra=* | --program-tr=* | --program-t=*)
354     program_transform_name=$ac_optarg ;;
355
356   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
357   | -silent | --silent | --silen | --sile | --sil)
358     silent=yes ;;
359
360   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
361     ac_prev=sbindir ;;
362   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
363   | --sbi=* | --sb=*)
364     sbindir=$ac_optarg ;;
365
366   -sharedstatedir | --sharedstatedir | --sharedstatedi \
367   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
368   | --sharedst | --shareds | --shared | --share | --shar \
369   | --sha | --sh)
370     ac_prev=sharedstatedir ;;
371   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
372   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
373   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
374   | --sha=* | --sh=*)
375     sharedstatedir=$ac_optarg ;;
376
377   -site | --site | --sit)
378     ac_prev=site ;;
379   -site=* | --site=* | --sit=*)
380     site=$ac_optarg ;;
381
382   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
383     ac_prev=srcdir ;;
384   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
385     srcdir=$ac_optarg ;;
386
387   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
388   | --syscon | --sysco | --sysc | --sys | --sy)
389     ac_prev=sysconfdir ;;
390   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
391   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
392     sysconfdir=$ac_optarg ;;
393
394   -target | --target | --targe | --targ | --tar | --ta | --t)
395     ac_prev=target_alias ;;
396   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
397     target_alias=$ac_optarg ;;
398
399   -v | -verbose | --verbose | --verbos | --verbo | --verb)
400     verbose=yes ;;
401
402   -version | --version | --versio | --versi | --vers | -V)
403     ac_init_version=: ;;
404
405   -with-* | --with-*)
406     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
407     # Reject names that are not valid shell variable names.
408     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
409       { echo "$as_me: error: invalid package name: $ac_package" >&2
410    { (exit 1); exit 1; }; }
411     ac_package=`echo $ac_package| sed 's/-/_/g'`
412     case $ac_option in
413       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
414       *) ac_optarg=yes ;;
415     esac
416     eval "with_$ac_package='$ac_optarg'" ;;
417
418   -without-* | --without-*)
419     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
420     # Reject names that are not valid shell variable names.
421     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
422       { echo "$as_me: error: invalid package name: $ac_package" >&2
423    { (exit 1); exit 1; }; }
424     ac_package=`echo $ac_package | sed 's/-/_/g'`
425     eval "with_$ac_package=no" ;;
426
427   --x)
428     # Obsolete; use --with-x.
429     with_x=yes ;;
430
431   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
432   | --x-incl | --x-inc | --x-in | --x-i)
433     ac_prev=x_includes ;;
434   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
435   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
436     x_includes=$ac_optarg ;;
437
438   -x-libraries | --x-libraries | --x-librarie | --x-librari \
439   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
440     ac_prev=x_libraries ;;
441   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
442   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
443     x_libraries=$ac_optarg ;;
444
445   -*) { echo "$as_me: error: unrecognized option: $ac_option
446 Try \`$0 --help' for more information." >&2
447    { (exit 1); exit 1; }; }
448     ;;
449
450   *=*)
451     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
452     # Reject names that are not valid shell variable names.
453     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
454       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
455    { (exit 1); exit 1; }; }
456     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
457     eval "$ac_envvar='$ac_optarg'"
458     export $ac_envvar ;;
459
460   *)
461     # FIXME: should be removed in autoconf 3.0.
462     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
463     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
464       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
465     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
466     ;;
467
468   esac
469 done
470
471 if test -n "$ac_prev"; then
472   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
473   { echo "$as_me: error: missing argument to $ac_option" >&2
474    { (exit 1); exit 1; }; }
475 fi
476
477 # Be sure to have absolute paths.
478 for ac_var in exec_prefix prefix
479 do
480   eval ac_val=$`echo $ac_var`
481   case $ac_val in
482     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
483     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
484    { (exit 1); exit 1; }; };;
485   esac
486 done
487
488 # Be sure to have absolute paths.
489 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
490               localstatedir libdir includedir oldincludedir infodir mandir
491 do
492   eval ac_val=$`echo $ac_var`
493   case $ac_val in
494     [\\/$]* | ?:[\\/]* ) ;;
495     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
496    { (exit 1); exit 1; }; };;
497   esac
498 done
499
500 # There might be people who depend on the old broken behavior: `$host'
501 # used to hold the argument of --host etc.
502 build=$build_alias
503 host=$host_alias
504 target=$target_alias
505
506 # FIXME: should be removed in autoconf 3.0.
507 if test "x$host_alias" != x; then
508   if test "x$build_alias" = x; then
509     cross_compiling=maybe
510     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
511     If a cross compiler is detected then cross compile mode will be used." >&2
512   elif test "x$build_alias" != "x$host_alias"; then
513     cross_compiling=yes
514   fi
515 fi
516
517 ac_tool_prefix=
518 test -n "$host_alias" && ac_tool_prefix=$host_alias-
519
520 test "$silent" = yes && exec 6>/dev/null
521
522 # Find the source files, if location was not specified.
523 if test -z "$srcdir"; then
524   ac_srcdir_defaulted=yes
525   # Try the directory containing this script, then its parent.
526   ac_prog=$0
527   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
528   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
529   srcdir=$ac_confdir
530   if test ! -r $srcdir/$ac_unique_file; then
531     srcdir=..
532   fi
533 else
534   ac_srcdir_defaulted=no
535 fi
536 if test ! -r $srcdir/$ac_unique_file; then
537   if test "$ac_srcdir_defaulted" = yes; then
538     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
539    { (exit 1); exit 1; }; }
540   else
541     { echo "$as_me: error: cannot find sources in $srcdir" >&2
542    { (exit 1); exit 1; }; }
543   fi
544 fi
545 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
546 ac_env_build_alias_set=${build_alias+set}
547 ac_env_build_alias_value=$build_alias
548 ac_cv_env_build_alias_set=${build_alias+set}
549 ac_cv_env_build_alias_value=$build_alias
550 ac_env_host_alias_set=${host_alias+set}
551 ac_env_host_alias_value=$host_alias
552 ac_cv_env_host_alias_set=${host_alias+set}
553 ac_cv_env_host_alias_value=$host_alias
554 ac_env_target_alias_set=${target_alias+set}
555 ac_env_target_alias_value=$target_alias
556 ac_cv_env_target_alias_set=${target_alias+set}
557 ac_cv_env_target_alias_value=$target_alias
558 ac_env_CC_set=${CC+set}
559 ac_env_CC_value=$CC
560 ac_cv_env_CC_set=${CC+set}
561 ac_cv_env_CC_value=$CC
562 ac_env_CFLAGS_set=${CFLAGS+set}
563 ac_env_CFLAGS_value=$CFLAGS
564 ac_cv_env_CFLAGS_set=${CFLAGS+set}
565 ac_cv_env_CFLAGS_value=$CFLAGS
566 ac_env_LDFLAGS_set=${LDFLAGS+set}
567 ac_env_LDFLAGS_value=$LDFLAGS
568 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_cv_env_LDFLAGS_value=$LDFLAGS
570 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
571 ac_env_CPPFLAGS_value=$CPPFLAGS
572 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
574 ac_env_CPP_set=${CPP+set}
575 ac_env_CPP_value=$CPP
576 ac_cv_env_CPP_set=${CPP+set}
577 ac_cv_env_CPP_value=$CPP
578
579 #
580 # Report the --help message.
581 #
582 if test "$ac_init_help" = "long"; then
583   # Omit some internal or obsolete options to make the list less imposing.
584   # This message is too long to be a string in the A/UX 3.1 sh.
585   cat <<EOF
586 \`configure' configures this package to adapt to many kinds of systems.
587
588 Usage: $0 [OPTION]... [VAR=VALUE]...
589
590 To assign environment variables (e.g., CC, CFLAGS...), specify them as
591 VAR=VALUE.  See below for descriptions of some of the useful variables.
592
593 Defaults for the options are specified in brackets.
594
595 Configuration:
596   -h, --help              display this help and exit
597       --help=short        display options specific to this package
598       --help=recursive    display the short help of all the included packages
599   -V, --version           display version information and exit
600   -q, --quiet, --silent   do not print \`checking...' messages
601       --cache-file=FILE   cache test results in FILE [disabled]
602   -C, --config-cache      alias for \`--cache-file=config.cache'
603   -n, --no-create         do not create output files
604       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
605
606 EOF
607
608   cat <<EOF
609 Installation directories:
610   --prefix=PREFIX         install architecture-independent files in PREFIX
611                           [$ac_default_prefix]
612   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
613                           [PREFIX]
614
615 By default, \`make install' will install all the files in
616 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
617 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
618 for instance \`--prefix=\$HOME'.
619
620 For better control, use the options below.
621
622 Fine tuning of the installation directories:
623   --bindir=DIR            user executables [EPREFIX/bin]
624   --sbindir=DIR           system admin executables [EPREFIX/sbin]
625   --libexecdir=DIR        program executables [EPREFIX/libexec]
626   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
627   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
628   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
629   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
630   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
631   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
632   --libdir=DIR            object code libraries [EPREFIX/lib]
633   --includedir=DIR        C header files [PREFIX/include]
634   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
635   --infodir=DIR           info documentation [DATAROOTDIR/info]
636   --mandir=DIR            man documentation [DATAROOTDIR/man]
637 EOF
638
639   cat <<\EOF
640
641 Program names:
642   --program-prefix=PREFIX            prepend PREFIX to installed program names
643   --program-suffix=SUFFIX            append SUFFIX to installed program names
644   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
645
646 X features:
647   --x-includes=DIR    X include files are in DIR
648   --x-libraries=DIR   X library files are in DIR
649
650 System types:
651   --build=BUILD           configure for building on BUILD [guessed]
652   --host=HOST       build programs to run on HOST [BUILD]
653 EOF
654 fi
655
656 if test -n "$ac_init_help"; then
657
658   cat <<\EOF
659
660 Optional Features:
661   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
662   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
663
664 Optional Packages:
665   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
666   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
667
668 General Options:
669   --disable-stripping     do not strip (debug info) installed executables
670   --enable-string-hacks   work around bogus compiler/loader warnings
671   --with-pkg-config{=path} enable/disable use of pkg-config
672   --disable-echo          do not display "compiling" commands
673 Curses Version-dependent Options:
674   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
675   --disable-widec         disable checks for wide-character functions
676   --with-curses-dir=DIR   directory in which (n)curses is installed
677   --with-screen=XXX       use specified curses-libraries
678   --with-ncursesw         use wide ncurses-libraries
679   --with-ncurses          use ncurses-libraries
680   --with-pdcurses         compile/link with pdcurses X11 library
681   --with-curses-colr      compile/link with HPUX 10.x color-curses
682   --with-curses-5lib      compile/link with SunOS 5lib curses
683   --with-Xaw3d            link with Xaw 3d library
684   --with-Xaw3dxft         link with Xaw 3d xft library
685   --with-neXtaw           link with neXT Athena library
686   --with-XawPlus          link with Athena-Plus library
687   --with-x                use the X Window System
688   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
689   --disable-panel         disable checks for panel functions
690   --disable-menu          disable checks for menu functions
691   --disable-form          disable checks for form functions
692 Testing/development Options:
693   --enable-warnings       test: turn on gcc compiler warnings
694   --with-dmalloc          test: use Gray Watson's dmalloc library
695   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
696   --with-valgrind         test: use valgrind
697   --disable-leaks         test: free permanent memory, analyze leaks
698   --disable-rpath-hack    don't add rpath options for additional libraries
699
700 Some influential environment variables:
701   CC          C compiler command
702   CFLAGS      C compiler flags
703   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
704               nonstandard directory <lib dir>
705   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
706               headers in a nonstandard directory <include dir>
707   CPP         C preprocessor
708
709 Use these variables to override the choices made by `configure' or to help
710 it to find libraries and programs with nonstandard names/locations.
711
712 EOF
713 fi
714
715 if test "$ac_init_help" = "recursive"; then
716   # If there are subdirs, report their specific --help.
717   ac_popdir=`pwd`
718   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
719     cd $ac_subdir
720     # A "../" for each directory in /$ac_subdir.
721     ac_dots=`echo $ac_subdir |
722              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
723
724     case $srcdir in
725     .) # No --srcdir option.  We are building in place.
726       ac_sub_srcdir=$srcdir ;;
727     [\\/]* | ?:[\\/]* ) # Absolute path.
728       ac_sub_srcdir=$srcdir/$ac_subdir ;;
729     *) # Relative path.
730       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
731     esac
732
733     # Check for guested configure; otherwise get Cygnus style configure.
734     if test -f $ac_sub_srcdir/configure.gnu; then
735       echo
736       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
737     elif test -f $ac_sub_srcdir/configure; then
738       echo
739       $SHELL $ac_sub_srcdir/configure  --help=recursive
740     elif test -f $ac_sub_srcdir/configure.ac ||
741            test -f $ac_sub_srcdir/configure.in; then
742       echo
743       $ac_configure --help
744     else
745       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
746     fi
747     cd $ac_popdir
748   done
749 fi
750
751 test -n "$ac_init_help" && exit 0
752 if $ac_init_version; then
753   cat <<\EOF
754
755 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
756 Free Software Foundation, Inc.
757 This configure script is free software; the Free Software Foundation
758 gives unlimited permission to copy, distribute and modify it.
759 EOF
760   exit 0
761 fi
762 exec 5>config.log
763 cat >&5 <<EOF
764 This file contains any messages produced by compilers while
765 running configure, to aid debugging if configure makes a mistake.
766
767 It was created by $as_me, which was
768 generated by GNU Autoconf 2.52.20200111.  Invocation command line was
769
770   $ $0 $@
771
772 EOF
773 {
774 cat <<_ASUNAME
775 ## ---------- ##
776 ## Platform.  ##
777 ## ---------- ##
778
779 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
780 uname -m = `(uname -m) 2>/dev/null || echo unknown`
781 uname -r = `(uname -r) 2>/dev/null || echo unknown`
782 uname -s = `(uname -s) 2>/dev/null || echo unknown`
783 uname -v = `(uname -v) 2>/dev/null || echo unknown`
784
785 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
786 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
787
788 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
789 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
790 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
791 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
792 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
793 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
794 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
795
796 PATH = $PATH
797
798 _ASUNAME
799 } >&5
800
801 cat >&5 <<EOF
802 ## ------------ ##
803 ## Core tests.  ##
804 ## ------------ ##
805
806 EOF
807
808 # Keep a trace of the command line.
809 # Strip out --no-create and --no-recursion so they do not pile up.
810 # Also quote any args containing shell meta-characters.
811 ac_configure_args=
812 ac_sep=
813 for ac_arg
814 do
815   case $ac_arg in
816   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
817   | --no-cr | --no-c) ;;
818   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
819   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
820   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
821     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
822     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
823     ac_sep=" " ;;
824   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
825      ac_sep=" " ;;
826   esac
827   # Get rid of the leading space.
828 done
829
830 # When interrupted or exit'd, cleanup temporary files, and complete
831 # config.log.  We remove comments because anyway the quotes in there
832 # would cause problems or look ugly.
833 trap 'exit_status=$?
834   # Save into config.log some information that might help in debugging.
835   echo >&5
836   echo "## ----------------- ##" >&5
837   echo "## Cache variables.  ##" >&5
838   echo "## ----------------- ##" >&5
839   echo >&5
840   # The following way of writing the cache mishandles newlines in values,
841 {
842   (set) 2>&1 |
843     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
844     *ac_space=\ *)
845       sed -n \
846         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
847           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
848       ;;
849     *)
850       sed -n \
851         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
852       ;;
853     esac;
854 } >&5
855   sed "/^$/d" confdefs.h >conftest.log
856   if test -s conftest.log; then
857     echo >&5
858     echo "## ------------ ##" >&5
859     echo "## confdefs.h.  ##" >&5
860     echo "## ------------ ##" >&5
861     echo >&5
862     cat conftest.log >&5
863   fi
864   (echo; echo) >&5
865   test "$ac_signal" != 0 &&
866     echo "$as_me: caught signal $ac_signal" >&5
867   echo "$as_me: exit $exit_status" >&5
868   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
869     exit $exit_status
870      ' 0
871 for ac_signal in 1 2 13 15; do
872   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
873 done
874 ac_signal=0
875
876 # confdefs.h avoids OS command line length limits that DEFS can exceed.
877 rm -rf conftest* confdefs.h
878 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
879 echo >confdefs.h
880
881 # Let the site file select an alternate cache file if it wants to.
882 # Prefer explicitly selected file to automatically selected ones.
883 if test -z "$CONFIG_SITE"; then
884   if test "x$prefix" != xNONE; then
885     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
886   else
887     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
888   fi
889 fi
890 for ac_site_file in $CONFIG_SITE; do
891   if test -r "$ac_site_file"; then
892     { echo "$as_me:892: loading site script $ac_site_file" >&5
893 echo "$as_me: loading site script $ac_site_file" >&6;}
894     cat "$ac_site_file" >&5
895     . "$ac_site_file"
896   fi
897 done
898
899 if test -r "$cache_file"; then
900   # Some versions of bash will fail to source /dev/null (special
901   # files actually), so we avoid doing that.
902   if test -f "$cache_file"; then
903     { echo "$as_me:903: loading cache $cache_file" >&5
904 echo "$as_me: loading cache $cache_file" >&6;}
905     case $cache_file in
906       [\\/]* | ?:[\\/]* ) . $cache_file;;
907       *)                      . ./$cache_file;;
908     esac
909   fi
910 else
911   { echo "$as_me:911: creating cache $cache_file" >&5
912 echo "$as_me: creating cache $cache_file" >&6;}
913   >$cache_file
914 fi
915
916 # Check that the precious variables saved in the cache have kept the same
917 # value.
918 ac_cache_corrupted=false
919 for ac_var in `(set) 2>&1 |
920                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
921   eval ac_old_set=\$ac_cv_env_${ac_var}_set
922   eval ac_new_set=\$ac_env_${ac_var}_set
923   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
924   eval ac_new_val="\$ac_env_${ac_var}_value"
925   case $ac_old_set,$ac_new_set in
926     set,)
927       { echo "$as_me:927: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
928 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
929       ac_cache_corrupted=: ;;
930     ,set)
931       { echo "$as_me:931: error: \`$ac_var' was not set in the previous run" >&5
932 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
933       ac_cache_corrupted=: ;;
934     ,);;
935     *)
936       if test "x$ac_old_val" != "x$ac_new_val"; then
937         { echo "$as_me:937: error: \`$ac_var' has changed since the previous run:" >&5
938 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
939         { echo "$as_me:939:   former value:  $ac_old_val" >&5
940 echo "$as_me:   former value:  $ac_old_val" >&2;}
941         { echo "$as_me:941:   current value: $ac_new_val" >&5
942 echo "$as_me:   current value: $ac_new_val" >&2;}
943         ac_cache_corrupted=:
944       fi;;
945   esac
946   # Pass precious variables to config.status.  It doesn't matter if
947   # we pass some twice (in addition to the command line arguments).
948   if test "$ac_new_set" = set; then
949     case $ac_new_val in
950     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
951       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
952       ac_configure_args="$ac_configure_args '$ac_arg'"
953       ;;
954     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
955        ;;
956     esac
957   fi
958 done
959 if $ac_cache_corrupted; then
960   { echo "$as_me:960: error: changes in the environment can compromise the build" >&5
961 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
962   { { echo "$as_me:962: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
963 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
964    { (exit 1); exit 1; }; }
965 fi
966
967 ac_ext=c
968 ac_cpp='$CPP $CPPFLAGS'
969 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
970 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
971 ac_compiler_gnu=$ac_cv_c_compiler_gnu
972 ac_main_return=return
973
974 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
975   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
976                    ECHO_T='     ' ;;
977   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
978   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
979 esac
980 echo "#! $SHELL" >conftest.sh
981 echo  "exit 0"   >>conftest.sh
982 chmod +x conftest.sh
983 if { (echo "$as_me:983: PATH=\".;.\"; conftest.sh") >&5
984   (PATH=".;."; conftest.sh) 2>&5
985   ac_status=$?
986   echo "$as_me:986: \$? = $ac_status" >&5
987   (exit $ac_status); }; then
988   ac_path_separator=';'
989 else
990   ac_path_separator=:
991 fi
992 PATH_SEPARATOR="$ac_path_separator"
993 rm -f conftest.sh
994
995 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
996
997 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
998
999 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1000
1001 ac_aux_dir=
1002 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1003   if test -f $ac_dir/install-sh; then
1004     ac_aux_dir=$ac_dir
1005     ac_install_sh="$ac_aux_dir/install-sh -c"
1006     break
1007   elif test -f $ac_dir/install.sh; then
1008     ac_aux_dir=$ac_dir
1009     ac_install_sh="$ac_aux_dir/install.sh -c"
1010     break
1011   elif test -f $ac_dir/shtool; then
1012     ac_aux_dir=$ac_dir
1013     ac_install_sh="$ac_aux_dir/shtool install -c"
1014     break
1015   fi
1016 done
1017 if test -z "$ac_aux_dir"; then
1018   { { echo "$as_me:1018: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1019 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1020    { (exit 1); exit 1; }; }
1021 fi
1022 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1023 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1024 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1025
1026 # Make sure we can run config.sub.
1027 $ac_config_sub sun4 >/dev/null 2>&1 ||
1028   { { echo "$as_me:1028: error: cannot run $ac_config_sub" >&5
1029 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 echo "$as_me:1032: checking build system type" >&5
1033 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1034 if test "${ac_cv_build+set}" = set; then
1035   echo $ECHO_N "(cached) $ECHO_C" >&6
1036 else
1037   ac_cv_build_alias=$build_alias
1038 test -z "$ac_cv_build_alias" &&
1039   ac_cv_build_alias=`$ac_config_guess`
1040 test -z "$ac_cv_build_alias" &&
1041   { { echo "$as_me:1041: error: cannot guess build type; you must specify one" >&5
1042 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1043    { (exit 1); exit 1; }; }
1044 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1045   { { echo "$as_me:1045: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1046 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1047    { (exit 1); exit 1; }; }
1048
1049 fi
1050 echo "$as_me:1050: result: $ac_cv_build" >&5
1051 echo "${ECHO_T}$ac_cv_build" >&6
1052 build=$ac_cv_build
1053 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1054 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1055 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1056
1057 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1058         echo "$as_me:1058: checking host system type" >&5
1059 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1060 if test "${ac_cv_host+set}" = set; then
1061   echo $ECHO_N "(cached) $ECHO_C" >&6
1062 else
1063   ac_cv_host_alias=$host_alias
1064 test -z "$ac_cv_host_alias" &&
1065   ac_cv_host_alias=$ac_cv_build_alias
1066 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1067   { { echo "$as_me:1067: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1068 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 fi
1072 echo "$as_me:1072: result: $ac_cv_host" >&5
1073 echo "${ECHO_T}$ac_cv_host" >&6
1074 host=$ac_cv_host
1075 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1076 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1077 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1078
1079         system_name="$host_os"
1080 else
1081         system_name="`(uname -s -r) 2>/dev/null`"
1082         if test -z "$system_name" ; then
1083                 system_name="`(hostname) 2>/dev/null`"
1084         fi
1085 fi
1086 test -n "$system_name" &&
1087 cat >>confdefs.h <<EOF
1088 #define SYSTEM_NAME "$system_name"
1089 EOF
1090
1091 if test "${cf_cv_system_name+set}" = set; then
1092   echo $ECHO_N "(cached) $ECHO_C" >&6
1093 else
1094   cf_cv_system_name="$system_name"
1095 fi
1096
1097 test -z "$system_name" && system_name="$cf_cv_system_name"
1098 test -n "$cf_cv_system_name" && echo "$as_me:1098: result: Configuring for $cf_cv_system_name" >&5
1099 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1100
1101 if test ".$system_name" != ".$cf_cv_system_name" ; then
1102         echo "$as_me:1102: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1103 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1104         { { echo "$as_me:1104: error: \"Please remove config.cache and try again.\"" >&5
1105 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1106    { (exit 1); exit 1; }; }
1107 fi
1108
1109 test "$program_prefix" != NONE &&
1110   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1111 # Use a double $ so make ignores it.
1112 test "$program_suffix" != NONE &&
1113   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1114 # Double any \ or $.  echo might interpret backslashes.
1115 # By default was `s,x,x', remove it if useless.
1116 cat <<\_ACEOF >conftest.sed
1117 s/[\\$]/&&/g;s/;s,x,x,$//
1118 _ACEOF
1119 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1120 rm conftest.sed
1121
1122 echo "$as_me:1122: checking whether ${MAKE-make} sets \${MAKE}" >&5
1123 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1124 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1125 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1126   echo $ECHO_N "(cached) $ECHO_C" >&6
1127 else
1128   cat >conftest.make <<\EOF
1129 all:
1130         @echo 'ac_maketemp="${MAKE}"'
1131 EOF
1132 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1133 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1134 if test -n "$ac_maketemp"; then
1135   eval ac_cv_prog_make_${ac_make}_set=yes
1136 else
1137   eval ac_cv_prog_make_${ac_make}_set=no
1138 fi
1139 rm -f conftest.make
1140 fi
1141 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1142   echo "$as_me:1142: result: yes" >&5
1143 echo "${ECHO_T}yes" >&6
1144   SET_MAKE=
1145 else
1146   echo "$as_me:1146: result: no" >&5
1147 echo "${ECHO_T}no" >&6
1148   SET_MAKE="MAKE=${MAKE-make}"
1149 fi
1150
1151 ac_ext=c
1152 ac_cpp='$CPP $CPPFLAGS'
1153 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1154 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1155 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1156 ac_main_return=return
1157 if test -n "$ac_tool_prefix"; then
1158   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1159 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1160 echo "$as_me:1160: checking for $ac_word" >&5
1161 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1162 if test "${ac_cv_prog_CC+set}" = set; then
1163   echo $ECHO_N "(cached) $ECHO_C" >&6
1164 else
1165   if test -n "$CC"; then
1166   ac_cv_prog_CC="$CC" # Let the user override the test.
1167 else
1168   ac_save_IFS=$IFS; IFS=$ac_path_separator
1169 ac_dummy="$PATH"
1170 for ac_dir in $ac_dummy; do
1171   IFS=$ac_save_IFS
1172   test -z "$ac_dir" && ac_dir=.
1173   $as_executable_p "$ac_dir/$ac_word" || continue
1174 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1175 echo "$as_me:1175: found $ac_dir/$ac_word" >&5
1176 break
1177 done
1178
1179 fi
1180 fi
1181 CC=$ac_cv_prog_CC
1182 if test -n "$CC"; then
1183   echo "$as_me:1183: result: $CC" >&5
1184 echo "${ECHO_T}$CC" >&6
1185 else
1186   echo "$as_me:1186: result: no" >&5
1187 echo "${ECHO_T}no" >&6
1188 fi
1189
1190 fi
1191 if test -z "$ac_cv_prog_CC"; then
1192   ac_ct_CC=$CC
1193   # Extract the first word of "gcc", so it can be a program name with args.
1194 set dummy gcc; ac_word=$2
1195 echo "$as_me:1195: checking for $ac_word" >&5
1196 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1197 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1198   echo $ECHO_N "(cached) $ECHO_C" >&6
1199 else
1200   if test -n "$ac_ct_CC"; then
1201   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1202 else
1203   ac_save_IFS=$IFS; IFS=$ac_path_separator
1204 ac_dummy="$PATH"
1205 for ac_dir in $ac_dummy; do
1206   IFS=$ac_save_IFS
1207   test -z "$ac_dir" && ac_dir=.
1208   $as_executable_p "$ac_dir/$ac_word" || continue
1209 ac_cv_prog_ac_ct_CC="gcc"
1210 echo "$as_me:1210: found $ac_dir/$ac_word" >&5
1211 break
1212 done
1213
1214 fi
1215 fi
1216 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1217 if test -n "$ac_ct_CC"; then
1218   echo "$as_me:1218: result: $ac_ct_CC" >&5
1219 echo "${ECHO_T}$ac_ct_CC" >&6
1220 else
1221   echo "$as_me:1221: result: no" >&5
1222 echo "${ECHO_T}no" >&6
1223 fi
1224
1225   CC=$ac_ct_CC
1226 else
1227   CC="$ac_cv_prog_CC"
1228 fi
1229
1230 if test -z "$CC"; then
1231   if test -n "$ac_tool_prefix"; then
1232   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1233 set dummy ${ac_tool_prefix}cc; ac_word=$2
1234 echo "$as_me:1234: checking for $ac_word" >&5
1235 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1236 if test "${ac_cv_prog_CC+set}" = set; then
1237   echo $ECHO_N "(cached) $ECHO_C" >&6
1238 else
1239   if test -n "$CC"; then
1240   ac_cv_prog_CC="$CC" # Let the user override the test.
1241 else
1242   ac_save_IFS=$IFS; IFS=$ac_path_separator
1243 ac_dummy="$PATH"
1244 for ac_dir in $ac_dummy; do
1245   IFS=$ac_save_IFS
1246   test -z "$ac_dir" && ac_dir=.
1247   $as_executable_p "$ac_dir/$ac_word" || continue
1248 ac_cv_prog_CC="${ac_tool_prefix}cc"
1249 echo "$as_me:1249: found $ac_dir/$ac_word" >&5
1250 break
1251 done
1252
1253 fi
1254 fi
1255 CC=$ac_cv_prog_CC
1256 if test -n "$CC"; then
1257   echo "$as_me:1257: result: $CC" >&5
1258 echo "${ECHO_T}$CC" >&6
1259 else
1260   echo "$as_me:1260: result: no" >&5
1261 echo "${ECHO_T}no" >&6
1262 fi
1263
1264 fi
1265 if test -z "$ac_cv_prog_CC"; then
1266   ac_ct_CC=$CC
1267   # Extract the first word of "cc", so it can be a program name with args.
1268 set dummy cc; ac_word=$2
1269 echo "$as_me:1269: checking for $ac_word" >&5
1270 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1271 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1272   echo $ECHO_N "(cached) $ECHO_C" >&6
1273 else
1274   if test -n "$ac_ct_CC"; then
1275   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1276 else
1277   ac_save_IFS=$IFS; IFS=$ac_path_separator
1278 ac_dummy="$PATH"
1279 for ac_dir in $ac_dummy; do
1280   IFS=$ac_save_IFS
1281   test -z "$ac_dir" && ac_dir=.
1282   $as_executable_p "$ac_dir/$ac_word" || continue
1283 ac_cv_prog_ac_ct_CC="cc"
1284 echo "$as_me:1284: found $ac_dir/$ac_word" >&5
1285 break
1286 done
1287
1288 fi
1289 fi
1290 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1291 if test -n "$ac_ct_CC"; then
1292   echo "$as_me:1292: result: $ac_ct_CC" >&5
1293 echo "${ECHO_T}$ac_ct_CC" >&6
1294 else
1295   echo "$as_me:1295: result: no" >&5
1296 echo "${ECHO_T}no" >&6
1297 fi
1298
1299   CC=$ac_ct_CC
1300 else
1301   CC="$ac_cv_prog_CC"
1302 fi
1303
1304 fi
1305 if test -z "$CC"; then
1306   # Extract the first word of "cc", so it can be a program name with args.
1307 set dummy cc; ac_word=$2
1308 echo "$as_me:1308: checking for $ac_word" >&5
1309 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1310 if test "${ac_cv_prog_CC+set}" = set; then
1311   echo $ECHO_N "(cached) $ECHO_C" >&6
1312 else
1313   if test -n "$CC"; then
1314   ac_cv_prog_CC="$CC" # Let the user override the test.
1315 else
1316   ac_prog_rejected=no
1317   ac_save_IFS=$IFS; IFS=$ac_path_separator
1318 ac_dummy="$PATH"
1319 for ac_dir in $ac_dummy; do
1320   IFS=$ac_save_IFS
1321   test -z "$ac_dir" && ac_dir=.
1322   $as_executable_p "$ac_dir/$ac_word" || continue
1323 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1324   ac_prog_rejected=yes
1325   continue
1326 fi
1327 ac_cv_prog_CC="cc"
1328 echo "$as_me:1328: found $ac_dir/$ac_word" >&5
1329 break
1330 done
1331
1332 if test $ac_prog_rejected = yes; then
1333   # We found a bogon in the path, so make sure we never use it.
1334   set dummy $ac_cv_prog_CC
1335   shift
1336   if test $# != 0; then
1337     # We chose a different compiler from the bogus one.
1338     # However, it has the same basename, so the bogon will be chosen
1339     # first if we set CC to just the basename; use the full file name.
1340     shift
1341     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1342     shift
1343     ac_cv_prog_CC="$@"
1344   fi
1345 fi
1346 fi
1347 fi
1348 CC=$ac_cv_prog_CC
1349 if test -n "$CC"; then
1350   echo "$as_me:1350: result: $CC" >&5
1351 echo "${ECHO_T}$CC" >&6
1352 else
1353   echo "$as_me:1353: result: no" >&5
1354 echo "${ECHO_T}no" >&6
1355 fi
1356
1357 fi
1358 if test -z "$CC"; then
1359   if test -n "$ac_tool_prefix"; then
1360   for ac_prog in cl
1361   do
1362     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1363 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1364 echo "$as_me:1364: checking for $ac_word" >&5
1365 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1366 if test "${ac_cv_prog_CC+set}" = set; then
1367   echo $ECHO_N "(cached) $ECHO_C" >&6
1368 else
1369   if test -n "$CC"; then
1370   ac_cv_prog_CC="$CC" # Let the user override the test.
1371 else
1372   ac_save_IFS=$IFS; IFS=$ac_path_separator
1373 ac_dummy="$PATH"
1374 for ac_dir in $ac_dummy; do
1375   IFS=$ac_save_IFS
1376   test -z "$ac_dir" && ac_dir=.
1377   $as_executable_p "$ac_dir/$ac_word" || continue
1378 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1379 echo "$as_me:1379: found $ac_dir/$ac_word" >&5
1380 break
1381 done
1382
1383 fi
1384 fi
1385 CC=$ac_cv_prog_CC
1386 if test -n "$CC"; then
1387   echo "$as_me:1387: result: $CC" >&5
1388 echo "${ECHO_T}$CC" >&6
1389 else
1390   echo "$as_me:1390: result: no" >&5
1391 echo "${ECHO_T}no" >&6
1392 fi
1393
1394     test -n "$CC" && break
1395   done
1396 fi
1397 if test -z "$CC"; then
1398   ac_ct_CC=$CC
1399   for ac_prog in cl
1400 do
1401   # Extract the first word of "$ac_prog", so it can be a program name with args.
1402 set dummy $ac_prog; ac_word=$2
1403 echo "$as_me:1403: checking for $ac_word" >&5
1404 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1405 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1406   echo $ECHO_N "(cached) $ECHO_C" >&6
1407 else
1408   if test -n "$ac_ct_CC"; then
1409   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1410 else
1411   ac_save_IFS=$IFS; IFS=$ac_path_separator
1412 ac_dummy="$PATH"
1413 for ac_dir in $ac_dummy; do
1414   IFS=$ac_save_IFS
1415   test -z "$ac_dir" && ac_dir=.
1416   $as_executable_p "$ac_dir/$ac_word" || continue
1417 ac_cv_prog_ac_ct_CC="$ac_prog"
1418 echo "$as_me:1418: found $ac_dir/$ac_word" >&5
1419 break
1420 done
1421
1422 fi
1423 fi
1424 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1425 if test -n "$ac_ct_CC"; then
1426   echo "$as_me:1426: result: $ac_ct_CC" >&5
1427 echo "${ECHO_T}$ac_ct_CC" >&6
1428 else
1429   echo "$as_me:1429: result: no" >&5
1430 echo "${ECHO_T}no" >&6
1431 fi
1432
1433   test -n "$ac_ct_CC" && break
1434 done
1435
1436   CC=$ac_ct_CC
1437 fi
1438
1439 fi
1440
1441 test -z "$CC" && { { echo "$as_me:1441: error: no acceptable cc found in \$PATH" >&5
1442 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1443    { (exit 1); exit 1; }; }
1444
1445 # Provide some information about the compiler.
1446 echo "$as_me:1446:" \
1447      "checking for C compiler version" >&5
1448 ac_compiler=`set X $ac_compile; echo $2`
1449 { (eval echo "$as_me:1449: \"$ac_compiler --version </dev/null >&5\"") >&5
1450   (eval $ac_compiler --version </dev/null >&5) 2>&5
1451   ac_status=$?
1452   echo "$as_me:1452: \$? = $ac_status" >&5
1453   (exit $ac_status); }
1454 { (eval echo "$as_me:1454: \"$ac_compiler -v </dev/null >&5\"") >&5
1455   (eval $ac_compiler -v </dev/null >&5) 2>&5
1456   ac_status=$?
1457   echo "$as_me:1457: \$? = $ac_status" >&5
1458   (exit $ac_status); }
1459 { (eval echo "$as_me:1459: \"$ac_compiler -V </dev/null >&5\"") >&5
1460   (eval $ac_compiler -V </dev/null >&5) 2>&5
1461   ac_status=$?
1462   echo "$as_me:1462: \$? = $ac_status" >&5
1463   (exit $ac_status); }
1464
1465 cat >conftest.$ac_ext <<_ACEOF
1466 #line 1466 "configure"
1467 #include "confdefs.h"
1468
1469 int
1470 main (void)
1471 {
1472
1473   ;
1474   return 0;
1475 }
1476 _ACEOF
1477 ac_clean_files_save=$ac_clean_files
1478 ac_clean_files="$ac_clean_files a.out a.exe"
1479 # Try to create an executable without -o first, disregard a.out.
1480 # It will help us diagnose broken compilers, and finding out an intuition
1481 # of exeext.
1482 echo "$as_me:1482: checking for C compiler default output" >&5
1483 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1484 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1485 if { (eval echo "$as_me:1485: \"$ac_link_default\"") >&5
1486   (eval $ac_link_default) 2>&5
1487   ac_status=$?
1488   echo "$as_me:1488: \$? = $ac_status" >&5
1489   (exit $ac_status); }; then
1490   # Find the output, starting from the most likely.  This scheme is
1491 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1492 # resort.
1493 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1494                 ls a.out conftest 2>/dev/null;
1495                 ls a.* conftest.* 2>/dev/null`; do
1496   case $ac_file in
1497     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1498     a.out ) # We found the default executable, but exeext='' is most
1499             # certainly right.
1500             break;;
1501     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1502           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1503           export ac_cv_exeext
1504           break;;
1505     * ) break;;
1506   esac
1507 done
1508 else
1509   echo "$as_me: failed program was:" >&5
1510 cat conftest.$ac_ext >&5
1511 { { echo "$as_me:1511: error: C compiler cannot create executables" >&5
1512 echo "$as_me: error: C compiler cannot create executables" >&2;}
1513    { (exit 77); exit 77; }; }
1514 fi
1515
1516 ac_exeext=$ac_cv_exeext
1517 echo "$as_me:1517: result: $ac_file" >&5
1518 echo "${ECHO_T}$ac_file" >&6
1519
1520 # Check the compiler produces executables we can run.  If not, either
1521 # the compiler is broken, or we cross compile.
1522 echo "$as_me:1522: checking whether the C compiler works" >&5
1523 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1524 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1525 # If not cross compiling, check that we can run a simple program.
1526 if test "$cross_compiling" != yes; then
1527   if { ac_try='./$ac_file'
1528   { (eval echo "$as_me:1528: \"$ac_try\"") >&5
1529   (eval $ac_try) 2>&5
1530   ac_status=$?
1531   echo "$as_me:1531: \$? = $ac_status" >&5
1532   (exit $ac_status); }; }; then
1533     cross_compiling=no
1534   else
1535     if test "$cross_compiling" = maybe; then
1536         cross_compiling=yes
1537     else
1538         { { echo "$as_me:1538: error: cannot run C compiled programs.
1539 If you meant to cross compile, use \`--host'." >&5
1540 echo "$as_me: error: cannot run C compiled programs.
1541 If you meant to cross compile, use \`--host'." >&2;}
1542    { (exit 1); exit 1; }; }
1543     fi
1544   fi
1545 fi
1546 echo "$as_me:1546: result: yes" >&5
1547 echo "${ECHO_T}yes" >&6
1548
1549 rm -f a.out a.exe conftest$ac_cv_exeext
1550 ac_clean_files=$ac_clean_files_save
1551 # Check the compiler produces executables we can run.  If not, either
1552 # the compiler is broken, or we cross compile.
1553 echo "$as_me:1553: checking whether we are cross compiling" >&5
1554 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1555 echo "$as_me:1555: result: $cross_compiling" >&5
1556 echo "${ECHO_T}$cross_compiling" >&6
1557
1558 echo "$as_me:1558: checking for executable suffix" >&5
1559 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1560 if { (eval echo "$as_me:1560: \"$ac_link\"") >&5
1561   (eval $ac_link) 2>&5
1562   ac_status=$?
1563   echo "$as_me:1563: \$? = $ac_status" >&5
1564   (exit $ac_status); }; then
1565   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1566 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1567 # work properly (i.e., refer to `conftest.exe'), while it won't with
1568 # `rm'.
1569 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1570   case $ac_file in
1571     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1572     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1573           export ac_cv_exeext
1574           break;;
1575     * ) break;;
1576   esac
1577 done
1578 else
1579   { { echo "$as_me:1579: error: cannot compute EXEEXT: cannot compile and link" >&5
1580 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1581    { (exit 1); exit 1; }; }
1582 fi
1583
1584 rm -f conftest$ac_cv_exeext
1585 echo "$as_me:1585: result: $ac_cv_exeext" >&5
1586 echo "${ECHO_T}$ac_cv_exeext" >&6
1587
1588 rm -f conftest.$ac_ext
1589 EXEEXT=$ac_cv_exeext
1590 ac_exeext=$EXEEXT
1591 echo "$as_me:1591: checking for object suffix" >&5
1592 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1593 if test "${ac_cv_objext+set}" = set; then
1594   echo $ECHO_N "(cached) $ECHO_C" >&6
1595 else
1596   cat >conftest.$ac_ext <<_ACEOF
1597 #line 1597 "configure"
1598 #include "confdefs.h"
1599
1600 int
1601 main (void)
1602 {
1603
1604   ;
1605   return 0;
1606 }
1607 _ACEOF
1608 rm -f conftest.o conftest.obj
1609 if { (eval echo "$as_me:1609: \"$ac_compile\"") >&5
1610   (eval $ac_compile) 2>&5
1611   ac_status=$?
1612   echo "$as_me:1612: \$? = $ac_status" >&5
1613   (exit $ac_status); }; then
1614   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1615   case $ac_file in
1616     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1617     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1618        break;;
1619   esac
1620 done
1621 else
1622   echo "$as_me: failed program was:" >&5
1623 cat conftest.$ac_ext >&5
1624 { { echo "$as_me:1624: error: cannot compute OBJEXT: cannot compile" >&5
1625 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1626    { (exit 1); exit 1; }; }
1627 fi
1628
1629 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1630 fi
1631 echo "$as_me:1631: result: $ac_cv_objext" >&5
1632 echo "${ECHO_T}$ac_cv_objext" >&6
1633 OBJEXT=$ac_cv_objext
1634 ac_objext=$OBJEXT
1635 echo "$as_me:1635: checking whether we are using the GNU C compiler" >&5
1636 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1637 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1638   echo $ECHO_N "(cached) $ECHO_C" >&6
1639 else
1640   cat >conftest.$ac_ext <<_ACEOF
1641 #line 1641 "configure"
1642 #include "confdefs.h"
1643
1644 int
1645 main (void)
1646 {
1647 #ifndef __GNUC__
1648        choke me
1649 #endif
1650
1651   ;
1652   return 0;
1653 }
1654 _ACEOF
1655 rm -f conftest.$ac_objext
1656 if { (eval echo "$as_me:1656: \"$ac_compile\"") >&5
1657   (eval $ac_compile) 2>&5
1658   ac_status=$?
1659   echo "$as_me:1659: \$? = $ac_status" >&5
1660   (exit $ac_status); } &&
1661          { ac_try='test -s conftest.$ac_objext'
1662   { (eval echo "$as_me:1662: \"$ac_try\"") >&5
1663   (eval $ac_try) 2>&5
1664   ac_status=$?
1665   echo "$as_me:1665: \$? = $ac_status" >&5
1666   (exit $ac_status); }; }; then
1667   ac_compiler_gnu=yes
1668 else
1669   echo "$as_me: failed program was:" >&5
1670 cat conftest.$ac_ext >&5
1671 ac_compiler_gnu=no
1672 fi
1673 rm -f conftest.$ac_objext conftest.$ac_ext
1674 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1675
1676 fi
1677 echo "$as_me:1677: result: $ac_cv_c_compiler_gnu" >&5
1678 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1679 GCC=`test $ac_compiler_gnu = yes && echo yes`
1680 ac_test_CFLAGS=${CFLAGS+set}
1681 ac_save_CFLAGS=$CFLAGS
1682 CFLAGS="-g"
1683 echo "$as_me:1683: checking whether $CC accepts -g" >&5
1684 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1685 if test "${ac_cv_prog_cc_g+set}" = set; then
1686   echo $ECHO_N "(cached) $ECHO_C" >&6
1687 else
1688   cat >conftest.$ac_ext <<_ACEOF
1689 #line 1689 "configure"
1690 #include "confdefs.h"
1691
1692 int
1693 main (void)
1694 {
1695
1696   ;
1697   return 0;
1698 }
1699 _ACEOF
1700 rm -f conftest.$ac_objext
1701 if { (eval echo "$as_me:1701: \"$ac_compile\"") >&5
1702   (eval $ac_compile) 2>&5
1703   ac_status=$?
1704   echo "$as_me:1704: \$? = $ac_status" >&5
1705   (exit $ac_status); } &&
1706          { ac_try='test -s conftest.$ac_objext'
1707   { (eval echo "$as_me:1707: \"$ac_try\"") >&5
1708   (eval $ac_try) 2>&5
1709   ac_status=$?
1710   echo "$as_me:1710: \$? = $ac_status" >&5
1711   (exit $ac_status); }; }; then
1712   ac_cv_prog_cc_g=yes
1713 else
1714   echo "$as_me: failed program was:" >&5
1715 cat conftest.$ac_ext >&5
1716 ac_cv_prog_cc_g=no
1717 fi
1718 rm -f conftest.$ac_objext conftest.$ac_ext
1719 fi
1720 echo "$as_me:1720: result: $ac_cv_prog_cc_g" >&5
1721 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1722 if test "$ac_test_CFLAGS" = set; then
1723   CFLAGS=$ac_save_CFLAGS
1724 elif test $ac_cv_prog_cc_g = yes; then
1725   if test "$GCC" = yes; then
1726     CFLAGS="-g -O2"
1727   else
1728     CFLAGS="-g"
1729   fi
1730 else
1731   if test "$GCC" = yes; then
1732     CFLAGS="-O2"
1733   else
1734     CFLAGS=
1735   fi
1736 fi
1737 # Some people use a C++ compiler to compile C.  Since we use `exit',
1738 # in C++ we need to declare it.  In case someone uses the same compiler
1739 # for both compiling C and C++ we need to have the C++ compiler decide
1740 # the declaration of exit, since it's the most demanding environment.
1741 cat >conftest.$ac_ext <<_ACEOF
1742 #ifndef __cplusplus
1743   choke me
1744 #endif
1745 _ACEOF
1746 rm -f conftest.$ac_objext
1747 if { (eval echo "$as_me:1747: \"$ac_compile\"") >&5
1748   (eval $ac_compile) 2>&5
1749   ac_status=$?
1750   echo "$as_me:1750: \$? = $ac_status" >&5
1751   (exit $ac_status); } &&
1752          { ac_try='test -s conftest.$ac_objext'
1753   { (eval echo "$as_me:1753: \"$ac_try\"") >&5
1754   (eval $ac_try) 2>&5
1755   ac_status=$?
1756   echo "$as_me:1756: \$? = $ac_status" >&5
1757   (exit $ac_status); }; }; then
1758   for ac_declaration in \
1759    ''\
1760    '#include <stdlib.h>' \
1761    'extern "C" void std::exit (int) throw (); using std::exit;' \
1762    'extern "C" void std::exit (int); using std::exit;' \
1763    'extern "C" void exit (int) throw ();' \
1764    'extern "C" void exit (int);' \
1765    'void exit (int);'
1766 do
1767   cat >conftest.$ac_ext <<_ACEOF
1768 #line 1768 "configure"
1769 #include "confdefs.h"
1770 #include <stdlib.h>
1771 $ac_declaration
1772 int
1773 main (void)
1774 {
1775 exit (42);
1776   ;
1777   return 0;
1778 }
1779 _ACEOF
1780 rm -f conftest.$ac_objext
1781 if { (eval echo "$as_me:1781: \"$ac_compile\"") >&5
1782   (eval $ac_compile) 2>&5
1783   ac_status=$?
1784   echo "$as_me:1784: \$? = $ac_status" >&5
1785   (exit $ac_status); } &&
1786          { ac_try='test -s conftest.$ac_objext'
1787   { (eval echo "$as_me:1787: \"$ac_try\"") >&5
1788   (eval $ac_try) 2>&5
1789   ac_status=$?
1790   echo "$as_me:1790: \$? = $ac_status" >&5
1791   (exit $ac_status); }; }; then
1792   :
1793 else
1794   echo "$as_me: failed program was:" >&5
1795 cat conftest.$ac_ext >&5
1796 continue
1797 fi
1798 rm -f conftest.$ac_objext conftest.$ac_ext
1799   cat >conftest.$ac_ext <<_ACEOF
1800 #line 1800 "configure"
1801 #include "confdefs.h"
1802 $ac_declaration
1803 int
1804 main (void)
1805 {
1806 exit (42);
1807   ;
1808   return 0;
1809 }
1810 _ACEOF
1811 rm -f conftest.$ac_objext
1812 if { (eval echo "$as_me:1812: \"$ac_compile\"") >&5
1813   (eval $ac_compile) 2>&5
1814   ac_status=$?
1815   echo "$as_me:1815: \$? = $ac_status" >&5
1816   (exit $ac_status); } &&
1817          { ac_try='test -s conftest.$ac_objext'
1818   { (eval echo "$as_me:1818: \"$ac_try\"") >&5
1819   (eval $ac_try) 2>&5
1820   ac_status=$?
1821   echo "$as_me:1821: \$? = $ac_status" >&5
1822   (exit $ac_status); }; }; then
1823   break
1824 else
1825   echo "$as_me: failed program was:" >&5
1826 cat conftest.$ac_ext >&5
1827 fi
1828 rm -f conftest.$ac_objext conftest.$ac_ext
1829 done
1830 rm -rf conftest*
1831 if test -n "$ac_declaration"; then
1832   echo '#ifdef __cplusplus' >>confdefs.h
1833   echo $ac_declaration      >>confdefs.h
1834   echo '#endif'             >>confdefs.h
1835 fi
1836
1837 else
1838   echo "$as_me: failed program was:" >&5
1839 cat conftest.$ac_ext >&5
1840 fi
1841 rm -f conftest.$ac_objext conftest.$ac_ext
1842 ac_ext=c
1843 ac_cpp='$CPP $CPPFLAGS'
1844 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1845 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1846 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1847 ac_main_return=return
1848
1849 GCC_VERSION=none
1850 if test "$GCC" = yes ; then
1851         echo "$as_me:1851: checking version of $CC" >&5
1852 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1853         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1854         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1855         echo "$as_me:1855: result: $GCC_VERSION" >&5
1856 echo "${ECHO_T}$GCC_VERSION" >&6
1857 fi
1858
1859 INTEL_COMPILER=no
1860
1861 if test "$GCC" = yes ; then
1862         case $host_os in
1863         (linux*|gnu*)
1864                 echo "$as_me:1864: checking if this is really Intel C compiler" >&5
1865 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1866                 cf_save_CFLAGS="$CFLAGS"
1867                 CFLAGS="$CFLAGS -no-gcc"
1868                 cat >conftest.$ac_ext <<_ACEOF
1869 #line 1869 "configure"
1870 #include "confdefs.h"
1871
1872 int
1873 main (void)
1874 {
1875
1876 #ifdef __INTEL_COMPILER
1877 #else
1878 make an error
1879 #endif
1880
1881   ;
1882   return 0;
1883 }
1884 _ACEOF
1885 rm -f conftest.$ac_objext
1886 if { (eval echo "$as_me:1886: \"$ac_compile\"") >&5
1887   (eval $ac_compile) 2>&5
1888   ac_status=$?
1889   echo "$as_me:1889: \$? = $ac_status" >&5
1890   (exit $ac_status); } &&
1891          { ac_try='test -s conftest.$ac_objext'
1892   { (eval echo "$as_me:1892: \"$ac_try\"") >&5
1893   (eval $ac_try) 2>&5
1894   ac_status=$?
1895   echo "$as_me:1895: \$? = $ac_status" >&5
1896   (exit $ac_status); }; }; then
1897   INTEL_COMPILER=yes
1898 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1899
1900 else
1901   echo "$as_me: failed program was:" >&5
1902 cat conftest.$ac_ext >&5
1903 fi
1904 rm -f conftest.$ac_objext conftest.$ac_ext
1905                 CFLAGS="$cf_save_CFLAGS"
1906                 echo "$as_me:1906: result: $INTEL_COMPILER" >&5
1907 echo "${ECHO_T}$INTEL_COMPILER" >&6
1908                 ;;
1909         esac
1910 fi
1911
1912 CLANG_COMPILER=no
1913
1914 if test "$GCC" = yes ; then
1915         echo "$as_me:1915: checking if this is really Clang C compiler" >&5
1916 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1917         cf_save_CFLAGS="$CFLAGS"
1918         CFLAGS="$CFLAGS -Qunused-arguments"
1919         cat >conftest.$ac_ext <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __clang__
1928 #else
1929 make an error
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f conftest.$ac_objext
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit $ac_status); } &&
1942          { ac_try='test -s conftest.$ac_objext'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit $ac_status); }; }; then
1948   CLANG_COMPILER=yes
1949 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
1950
1951 else
1952   echo "$as_me: failed program was:" >&5
1953 cat conftest.$ac_ext >&5
1954 fi
1955 rm -f conftest.$ac_objext conftest.$ac_ext
1956         CFLAGS="$cf_save_CFLAGS"
1957         echo "$as_me:1957: result: $CLANG_COMPILER" >&5
1958 echo "${ECHO_T}$CLANG_COMPILER" >&6
1959 fi
1960
1961 echo "$as_me:1961: checking for $CC option to accept ANSI C" >&5
1962 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1963 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1964   echo $ECHO_N "(cached) $ECHO_C" >&6
1965 else
1966   ac_cv_prog_cc_stdc=no
1967 ac_save_CC=$CC
1968 cat >conftest.$ac_ext <<_ACEOF
1969 #line 1969 "configure"
1970 #include "confdefs.h"
1971 #include <stdarg.h>
1972 #include <stdio.h>
1973 #include <sys/types.h>
1974 #include <sys/stat.h>
1975 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1976 struct buf { int x; };
1977 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1978 static char *e (p, i)
1979      char **p;
1980      int i;
1981 {
1982   return p[i];
1983 }
1984 static char *f (char * (*g) (char **, int), char **p, ...)
1985 {
1986   char *s;
1987   va_list v;
1988   va_start (v,p);
1989   s = g (p, va_arg (v,int));
1990   va_end (v);
1991   return s;
1992 }
1993 int test (int i, double x);
1994 struct s1 {int (*f) (int a);};
1995 struct s2 {int (*f) (double a);};
1996 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1997 int argc;
1998 char **argv;
1999 int
2000 main (void)
2001 {
2002 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2003   ;
2004   return 0;
2005 }
2006 _ACEOF
2007 # Don't try gcc -ansi; that turns off useful extensions and
2008 # breaks some systems' header files.
2009 # AIX                   -qlanglvl=ansi
2010 # Ultrix and OSF/1      -std1
2011 # HP-UX 10.20 and later -Ae
2012 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2013 # SVR4                  -Xc -D__EXTENSIONS__
2014 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2015 do
2016   CC="$ac_save_CC $ac_arg"
2017   rm -f conftest.$ac_objext
2018 if { (eval echo "$as_me:2018: \"$ac_compile\"") >&5
2019   (eval $ac_compile) 2>&5
2020   ac_status=$?
2021   echo "$as_me:2021: \$? = $ac_status" >&5
2022   (exit $ac_status); } &&
2023          { ac_try='test -s conftest.$ac_objext'
2024   { (eval echo "$as_me:2024: \"$ac_try\"") >&5
2025   (eval $ac_try) 2>&5
2026   ac_status=$?
2027   echo "$as_me:2027: \$? = $ac_status" >&5
2028   (exit $ac_status); }; }; then
2029   ac_cv_prog_cc_stdc=$ac_arg
2030 break
2031 else
2032   echo "$as_me: failed program was:" >&5
2033 cat conftest.$ac_ext >&5
2034 fi
2035 rm -f conftest.$ac_objext
2036 done
2037 rm -f conftest.$ac_ext conftest.$ac_objext
2038 CC=$ac_save_CC
2039
2040 fi
2041
2042 case "x$ac_cv_prog_cc_stdc" in
2043   x|xno)
2044     echo "$as_me:2044: result: none needed" >&5
2045 echo "${ECHO_T}none needed" >&6 ;;
2046   *)
2047     echo "$as_me:2047: result: $ac_cv_prog_cc_stdc" >&5
2048 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2049     CC="$CC $ac_cv_prog_cc_stdc" ;;
2050 esac
2051
2052 # This should have been defined by AC_PROG_CC
2053 : ${CC:=cc}
2054
2055 echo "$as_me:2055: checking \$CFLAGS variable" >&5
2056 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2057 case "x$CFLAGS" in
2058 (*-[IUD]*)
2059         echo "$as_me:2059: result: broken" >&5
2060 echo "${ECHO_T}broken" >&6
2061         { echo "$as_me:2061: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2062 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2063         cf_flags="$CFLAGS"
2064         CFLAGS=
2065         for cf_arg in $cf_flags
2066         do
2067
2068 cf_fix_cppflags=no
2069 cf_new_cflags=
2070 cf_new_cppflags=
2071 cf_new_extra_cppflags=
2072
2073 for cf_add_cflags in $cf_arg
2074 do
2075 case $cf_fix_cppflags in
2076 (no)
2077         case $cf_add_cflags in
2078         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2079                 case $cf_add_cflags in
2080                 (-D*)
2081                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2082
2083                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2084                                 && test -z "${cf_tst_cflags}" \
2085                                 && cf_fix_cppflags=yes
2086
2087                         if test $cf_fix_cppflags = yes ; then
2088
2089         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2090         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2091
2092                                 continue
2093                         elif test "${cf_tst_cflags}" = "\"'" ; then
2094
2095         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2096         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2097
2098                                 continue
2099                         fi
2100                         ;;
2101                 esac
2102                 case "$CPPFLAGS" in
2103                 (*$cf_add_cflags)
2104                         ;;
2105                 (*)
2106                         case $cf_add_cflags in
2107                         (-D*)
2108                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2109
2110 CPPFLAGS=`echo "$CPPFLAGS" | \
2111         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2112                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2113
2114                                 ;;
2115                         esac
2116
2117         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2118         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2119
2120                         ;;
2121                 esac
2122                 ;;
2123         (*)
2124
2125         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2126         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2127
2128                 ;;
2129         esac
2130         ;;
2131 (yes)
2132
2133         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2134         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2135
2136         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2137
2138         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2139                 && test -z "${cf_tst_cflags}" \
2140                 && cf_fix_cppflags=no
2141         ;;
2142 esac
2143 done
2144
2145 if test -n "$cf_new_cflags" ; then
2146
2147         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2148         CFLAGS="${CFLAGS}$cf_new_cflags"
2149
2150 fi
2151
2152 if test -n "$cf_new_cppflags" ; then
2153
2154         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2155         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2156
2157 fi
2158
2159 if test -n "$cf_new_extra_cppflags" ; then
2160
2161         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2162         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2163
2164 fi
2165
2166         done
2167         ;;
2168 (*)
2169         echo "$as_me:2169: result: ok" >&5
2170 echo "${ECHO_T}ok" >&6
2171         ;;
2172 esac
2173
2174 echo "$as_me:2174: checking \$CC variable" >&5
2175 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2176 case "$CC" in
2177 (*[\ \  ]-*)
2178         echo "$as_me:2178: result: broken" >&5
2179 echo "${ECHO_T}broken" >&6
2180         { echo "$as_me:2180: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2181 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2182         # humor him...
2183         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2184         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2185         CC="$cf_prog"
2186         for cf_arg in $cf_flags
2187         do
2188                 case "x$cf_arg" in
2189                 (x-[IUDfgOW]*)
2190
2191 cf_fix_cppflags=no
2192 cf_new_cflags=
2193 cf_new_cppflags=
2194 cf_new_extra_cppflags=
2195
2196 for cf_add_cflags in $cf_arg
2197 do
2198 case $cf_fix_cppflags in
2199 (no)
2200         case $cf_add_cflags in
2201         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2202                 case $cf_add_cflags in
2203                 (-D*)
2204                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2205
2206                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2207                                 && test -z "${cf_tst_cflags}" \
2208                                 && cf_fix_cppflags=yes
2209
2210                         if test $cf_fix_cppflags = yes ; then
2211
2212         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2213         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2214
2215                                 continue
2216                         elif test "${cf_tst_cflags}" = "\"'" ; then
2217
2218         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2219         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2220
2221                                 continue
2222                         fi
2223                         ;;
2224                 esac
2225                 case "$CPPFLAGS" in
2226                 (*$cf_add_cflags)
2227                         ;;
2228                 (*)
2229                         case $cf_add_cflags in
2230                         (-D*)
2231                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2232
2233 CPPFLAGS=`echo "$CPPFLAGS" | \
2234         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2235                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2236
2237                                 ;;
2238                         esac
2239
2240         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2241         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2242
2243                         ;;
2244                 esac
2245                 ;;
2246         (*)
2247
2248         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2249         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2250
2251                 ;;
2252         esac
2253         ;;
2254 (yes)
2255
2256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2258
2259         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2260
2261         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2262                 && test -z "${cf_tst_cflags}" \
2263                 && cf_fix_cppflags=no
2264         ;;
2265 esac
2266 done
2267
2268 if test -n "$cf_new_cflags" ; then
2269
2270         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2271         CFLAGS="${CFLAGS}$cf_new_cflags"
2272
2273 fi
2274
2275 if test -n "$cf_new_cppflags" ; then
2276
2277         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2278         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2279
2280 fi
2281
2282 if test -n "$cf_new_extra_cppflags" ; then
2283
2284         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2285         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2286
2287 fi
2288
2289                         ;;
2290                 (*)
2291                         CC="$CC $cf_arg"
2292                         ;;
2293                 esac
2294         done
2295         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2296
2297 echo "${as_me:-configure}:2297: testing resulting CC: '$CC' ..." 1>&5
2298
2299         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2300
2301 echo "${as_me:-configure}:2301: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2302
2303         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2304
2305 echo "${as_me:-configure}:2305: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2306
2307         ;;
2308 (*)
2309         echo "$as_me:2309: result: ok" >&5
2310 echo "${ECHO_T}ok" >&6
2311         ;;
2312 esac
2313
2314 echo "$as_me:2314: checking for inline" >&5
2315 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2316 if test "${ac_cv_c_inline+set}" = set; then
2317   echo $ECHO_N "(cached) $ECHO_C" >&6
2318 else
2319   ac_cv_c_inline=no
2320 for ac_kw in inline __inline__ __inline; do
2321   cat >conftest.$ac_ext <<_ACEOF
2322 #line 2322 "configure"
2323 #include "confdefs.h"
2324 #ifndef __cplusplus
2325 static $ac_kw int static_foo () {return 0; }
2326 $ac_kw int foo () {return 0; }
2327 #endif
2328
2329 _ACEOF
2330 rm -f conftest.$ac_objext
2331 if { (eval echo "$as_me:2331: \"$ac_compile\"") >&5
2332   (eval $ac_compile) 2>&5
2333   ac_status=$?
2334   echo "$as_me:2334: \$? = $ac_status" >&5
2335   (exit $ac_status); } &&
2336          { ac_try='test -s conftest.$ac_objext'
2337   { (eval echo "$as_me:2337: \"$ac_try\"") >&5
2338   (eval $ac_try) 2>&5
2339   ac_status=$?
2340   echo "$as_me:2340: \$? = $ac_status" >&5
2341   (exit $ac_status); }; }; then
2342   ac_cv_c_inline=$ac_kw; break
2343 else
2344   echo "$as_me: failed program was:" >&5
2345 cat conftest.$ac_ext >&5
2346 fi
2347 rm -f conftest.$ac_objext conftest.$ac_ext
2348 done
2349
2350 fi
2351 echo "$as_me:2351: result: $ac_cv_c_inline" >&5
2352 echo "${ECHO_T}$ac_cv_c_inline" >&6
2353 case $ac_cv_c_inline in
2354   inline | yes) ;;
2355   no)
2356 cat >>confdefs.h <<\EOF
2357 #define inline
2358 EOF
2359  ;;
2360   *)  cat >>confdefs.h <<EOF
2361 #define inline $ac_cv_c_inline
2362 EOF
2363  ;;
2364 esac
2365
2366 ac_ext=c
2367 ac_cpp='$CPP $CPPFLAGS'
2368 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2369 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2370 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2371 ac_main_return=return
2372 echo "$as_me:2372: checking how to run the C preprocessor" >&5
2373 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2374 # On Suns, sometimes $CPP names a directory.
2375 if test -n "$CPP" && test -d "$CPP"; then
2376   CPP=
2377 fi
2378 if test -z "$CPP"; then
2379   if test "${ac_cv_prog_CPP+set}" = set; then
2380   echo $ECHO_N "(cached) $ECHO_C" >&6
2381 else
2382       # Double quotes because CPP needs to be expanded
2383     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2384     do
2385       ac_preproc_ok=false
2386 for ac_c_preproc_warn_flag in '' yes
2387 do
2388   # Use a header file that comes with gcc, so configuring glibc
2389   # with a fresh cross-compiler works.
2390   # On the NeXT, cc -E runs the code through the compiler's parser,
2391   # not just through cpp. "Syntax error" is here to catch this case.
2392   cat >conftest.$ac_ext <<_ACEOF
2393 #line 2393 "configure"
2394 #include "confdefs.h"
2395 #include <assert.h>
2396                      Syntax error
2397 _ACEOF
2398 if { (eval echo "$as_me:2398: \"$ac_cpp conftest.$ac_ext\"") >&5
2399   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2400   ac_status=$?
2401   egrep -v '^ *\+' conftest.er1 >conftest.err
2402   rm -f conftest.er1
2403   cat conftest.err >&5
2404   echo "$as_me:2404: \$? = $ac_status" >&5
2405   (exit $ac_status); } >/dev/null; then
2406   if test -s conftest.err; then
2407     ac_cpp_err=$ac_c_preproc_warn_flag
2408   else
2409     ac_cpp_err=
2410   fi
2411 else
2412   ac_cpp_err=yes
2413 fi
2414 if test -z "$ac_cpp_err"; then
2415   :
2416 else
2417   echo "$as_me: failed program was:" >&5
2418   cat conftest.$ac_ext >&5
2419   # Broken: fails on valid input.
2420 continue
2421 fi
2422 rm -f conftest.err conftest.$ac_ext
2423
2424   # OK, works on sane cases.  Now check whether non-existent headers
2425   # can be detected and how.
2426   cat >conftest.$ac_ext <<_ACEOF
2427 #line 2427 "configure"
2428 #include "confdefs.h"
2429 #include <ac_nonexistent.h>
2430 _ACEOF
2431 if { (eval echo "$as_me:2431: \"$ac_cpp conftest.$ac_ext\"") >&5
2432   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2433   ac_status=$?
2434   egrep -v '^ *\+' conftest.er1 >conftest.err
2435   rm -f conftest.er1
2436   cat conftest.err >&5
2437   echo "$as_me:2437: \$? = $ac_status" >&5
2438   (exit $ac_status); } >/dev/null; then
2439   if test -s conftest.err; then
2440     ac_cpp_err=$ac_c_preproc_warn_flag
2441   else
2442     ac_cpp_err=
2443   fi
2444 else
2445   ac_cpp_err=yes
2446 fi
2447 if test -z "$ac_cpp_err"; then
2448   # Broken: success on invalid input.
2449 continue
2450 else
2451   echo "$as_me: failed program was:" >&5
2452   cat conftest.$ac_ext >&5
2453   # Passes both tests.
2454 ac_preproc_ok=:
2455 break
2456 fi
2457 rm -f conftest.err conftest.$ac_ext
2458
2459 done
2460 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2461 rm -f conftest.err conftest.$ac_ext
2462 if $ac_preproc_ok; then
2463   break
2464 fi
2465
2466     done
2467     ac_cv_prog_CPP=$CPP
2468
2469 fi
2470   CPP=$ac_cv_prog_CPP
2471 else
2472   ac_cv_prog_CPP=$CPP
2473 fi
2474 echo "$as_me:2474: result: $CPP" >&5
2475 echo "${ECHO_T}$CPP" >&6
2476 ac_preproc_ok=false
2477 for ac_c_preproc_warn_flag in '' yes
2478 do
2479   # Use a header file that comes with gcc, so configuring glibc
2480   # with a fresh cross-compiler works.
2481   # On the NeXT, cc -E runs the code through the compiler's parser,
2482   # not just through cpp. "Syntax error" is here to catch this case.
2483   cat >conftest.$ac_ext <<_ACEOF
2484 #line 2484 "configure"
2485 #include "confdefs.h"
2486 #include <assert.h>
2487                      Syntax error
2488 _ACEOF
2489 if { (eval echo "$as_me:2489: \"$ac_cpp conftest.$ac_ext\"") >&5
2490   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2491   ac_status=$?
2492   egrep -v '^ *\+' conftest.er1 >conftest.err
2493   rm -f conftest.er1
2494   cat conftest.err >&5
2495   echo "$as_me:2495: \$? = $ac_status" >&5
2496   (exit $ac_status); } >/dev/null; then
2497   if test -s conftest.err; then
2498     ac_cpp_err=$ac_c_preproc_warn_flag
2499   else
2500     ac_cpp_err=
2501   fi
2502 else
2503   ac_cpp_err=yes
2504 fi
2505 if test -z "$ac_cpp_err"; then
2506   :
2507 else
2508   echo "$as_me: failed program was:" >&5
2509   cat conftest.$ac_ext >&5
2510   # Broken: fails on valid input.
2511 continue
2512 fi
2513 rm -f conftest.err conftest.$ac_ext
2514
2515   # OK, works on sane cases.  Now check whether non-existent headers
2516   # can be detected and how.
2517   cat >conftest.$ac_ext <<_ACEOF
2518 #line 2518 "configure"
2519 #include "confdefs.h"
2520 #include <ac_nonexistent.h>
2521 _ACEOF
2522 if { (eval echo "$as_me:2522: \"$ac_cpp conftest.$ac_ext\"") >&5
2523   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2524   ac_status=$?
2525   egrep -v '^ *\+' conftest.er1 >conftest.err
2526   rm -f conftest.er1
2527   cat conftest.err >&5
2528   echo "$as_me:2528: \$? = $ac_status" >&5
2529   (exit $ac_status); } >/dev/null; then
2530   if test -s conftest.err; then
2531     ac_cpp_err=$ac_c_preproc_warn_flag
2532   else
2533     ac_cpp_err=
2534   fi
2535 else
2536   ac_cpp_err=yes
2537 fi
2538 if test -z "$ac_cpp_err"; then
2539   # Broken: success on invalid input.
2540 continue
2541 else
2542   echo "$as_me: failed program was:" >&5
2543   cat conftest.$ac_ext >&5
2544   # Passes both tests.
2545 ac_preproc_ok=:
2546 break
2547 fi
2548 rm -f conftest.err conftest.$ac_ext
2549
2550 done
2551 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2552 rm -f conftest.err conftest.$ac_ext
2553 if $ac_preproc_ok; then
2554   :
2555 else
2556   { { echo "$as_me:2556: error: C preprocessor \"$CPP\" fails sanity check" >&5
2557 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2558    { (exit 1); exit 1; }; }
2559 fi
2560
2561 ac_ext=c
2562 ac_cpp='$CPP $CPPFLAGS'
2563 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2564 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2565 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2566 ac_main_return=return
2567
2568 for ac_prog in mawk gawk nawk awk
2569 do
2570   # Extract the first word of "$ac_prog", so it can be a program name with args.
2571 set dummy $ac_prog; ac_word=$2
2572 echo "$as_me:2572: checking for $ac_word" >&5
2573 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2574 if test "${ac_cv_prog_AWK+set}" = set; then
2575   echo $ECHO_N "(cached) $ECHO_C" >&6
2576 else
2577   if test -n "$AWK"; then
2578   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2579 else
2580   ac_save_IFS=$IFS; IFS=$ac_path_separator
2581 ac_dummy="$PATH"
2582 for ac_dir in $ac_dummy; do
2583   IFS=$ac_save_IFS
2584   test -z "$ac_dir" && ac_dir=.
2585   $as_executable_p "$ac_dir/$ac_word" || continue
2586 ac_cv_prog_AWK="$ac_prog"
2587 echo "$as_me:2587: found $ac_dir/$ac_word" >&5
2588 break
2589 done
2590
2591 fi
2592 fi
2593 AWK=$ac_cv_prog_AWK
2594 if test -n "$AWK"; then
2595   echo "$as_me:2595: result: $AWK" >&5
2596 echo "${ECHO_T}$AWK" >&6
2597 else
2598   echo "$as_me:2598: result: no" >&5
2599 echo "${ECHO_T}no" >&6
2600 fi
2601
2602   test -n "$AWK" && break
2603 done
2604
2605 # Find a good install program.  We prefer a C program (faster),
2606 # so one script is as good as another.  But avoid the broken or
2607 # incompatible versions:
2608 # SysV /etc/install, /usr/sbin/install
2609 # SunOS /usr/etc/install
2610 # IRIX /sbin/install
2611 # AIX /bin/install
2612 # AmigaOS /C/install, which installs bootblocks on floppy discs
2613 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2614 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2615 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2616 # ./install, which can be erroneously created by make from ./install.sh.
2617 echo "$as_me:2617: checking for a BSD compatible install" >&5
2618 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2619 if test -z "$INSTALL"; then
2620 if test "${ac_cv_path_install+set}" = set; then
2621   echo $ECHO_N "(cached) $ECHO_C" >&6
2622 else
2623     ac_save_IFS=$IFS; IFS=$ac_path_separator
2624   for ac_dir in $PATH; do
2625     IFS=$ac_save_IFS
2626     # Account for people who put trailing slashes in PATH elements.
2627     case $ac_dir/ in
2628     / | ./ | .// | /cC/* \
2629     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2630     | /usr/ucb/* ) ;;
2631     *)
2632       # OSF1 and SCO ODT 3.0 have their own names for install.
2633       # Don't use installbsd from OSF since it installs stuff as root
2634       # by default.
2635       for ac_prog in ginstall scoinst install; do
2636         if $as_executable_p "$ac_dir/$ac_prog"; then
2637           if test $ac_prog = install &&
2638             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2639             # AIX install.  It has an incompatible calling convention.
2640             :
2641           elif test $ac_prog = install &&
2642             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2643             # program-specific install script used by HP pwplus--don't use.
2644             :
2645           else
2646             ac_cv_path_install="$ac_dir/$ac_prog -c"
2647             break 2
2648           fi
2649         fi
2650       done
2651       ;;
2652     esac
2653   done
2654
2655 fi
2656   if test "${ac_cv_path_install+set}" = set; then
2657     INSTALL=$ac_cv_path_install
2658   else
2659     # As a last resort, use the slow shell script.  We don't cache a
2660     # path for INSTALL within a source directory, because that will
2661     # break other packages using the cache if that directory is
2662     # removed, or if the path is relative.
2663     INSTALL=$ac_install_sh
2664   fi
2665 fi
2666 echo "$as_me:2666: result: $INSTALL" >&5
2667 echo "${ECHO_T}$INSTALL" >&6
2668
2669 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2670 # It thinks the first close brace ends the variable substitution.
2671 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2672
2673 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2674
2675 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2676
2677 case $INSTALL in
2678 (/*)
2679         ;;
2680 (*)
2681         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2682         test -z "$cf_dir" && cf_dir=.
2683         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2684         ;;
2685 esac
2686
2687 echo "$as_me:2687: checking if you want to install stripped executables" >&5
2688 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2689
2690 # Check whether --enable-stripping or --disable-stripping was given.
2691 if test "${enable_stripping+set}" = set; then
2692   enableval="$enable_stripping"
2693   test "$enableval" != no && enableval=yes
2694         if test "$enableval" != "yes" ; then
2695     with_stripping=no
2696         else
2697                 with_stripping=yes
2698         fi
2699 else
2700   enableval=yes
2701         with_stripping=yes
2702
2703 fi;
2704 echo "$as_me:2704: result: $with_stripping" >&5
2705 echo "${ECHO_T}$with_stripping" >&6
2706
2707 if test "$with_stripping" = yes
2708 then
2709         INSTALL_OPT_S="-s"
2710 else
2711         INSTALL_OPT_S=
2712 fi
2713
2714 : ${INSTALL:=install}
2715 echo "$as_me:2715: checking if install accepts -p option" >&5
2716 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2717 if test "${cf_cv_install_p+set}" = set; then
2718   echo $ECHO_N "(cached) $ECHO_C" >&6
2719 else
2720
2721         rm -rf conftest*
2722         date >conftest.in
2723         mkdir conftest.out
2724         sleep 3
2725         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2726         then
2727                 if test -f conftest.out/conftest.in
2728                 then
2729                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2730                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2731                         if test -s conftest.err
2732                         then
2733                                 cf_cv_install_p=no
2734                         else
2735                                 cf_cv_install_p=yes
2736                         fi
2737                 else
2738                         cf_cv_install_p=no
2739                 fi
2740         else
2741                 cf_cv_install_p=no
2742         fi
2743         rm -rf conftest*
2744
2745 fi
2746 echo "$as_me:2746: result: $cf_cv_install_p" >&5
2747 echo "${ECHO_T}$cf_cv_install_p" >&6
2748
2749 echo "$as_me:2749: checking if install needs to be told about ownership" >&5
2750 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2751 case `$ac_config_guess` in
2752 (*minix)
2753         with_install_o=yes
2754         ;;
2755 (*)
2756         with_install_o=no
2757         ;;
2758 esac
2759
2760 echo "$as_me:2760: result: $with_install_o" >&5
2761 echo "${ECHO_T}$with_install_o" >&6
2762 if test "x$with_install_o" = xyes
2763 then
2764         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2765 else
2766         INSTALL_OPT_O=
2767 fi
2768
2769 for ac_prog in lint cppcheck splint
2770 do
2771   # Extract the first word of "$ac_prog", so it can be a program name with args.
2772 set dummy $ac_prog; ac_word=$2
2773 echo "$as_me:2773: checking for $ac_word" >&5
2774 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2775 if test "${ac_cv_prog_LINT+set}" = set; then
2776   echo $ECHO_N "(cached) $ECHO_C" >&6
2777 else
2778   if test -n "$LINT"; then
2779   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2780 else
2781   ac_save_IFS=$IFS; IFS=$ac_path_separator
2782 ac_dummy="$PATH"
2783 for ac_dir in $ac_dummy; do
2784   IFS=$ac_save_IFS
2785   test -z "$ac_dir" && ac_dir=.
2786   $as_executable_p "$ac_dir/$ac_word" || continue
2787 ac_cv_prog_LINT="$ac_prog"
2788 echo "$as_me:2788: found $ac_dir/$ac_word" >&5
2789 break
2790 done
2791
2792 fi
2793 fi
2794 LINT=$ac_cv_prog_LINT
2795 if test -n "$LINT"; then
2796   echo "$as_me:2796: result: $LINT" >&5
2797 echo "${ECHO_T}$LINT" >&6
2798 else
2799   echo "$as_me:2799: result: no" >&5
2800 echo "${ECHO_T}no" >&6
2801 fi
2802
2803   test -n "$LINT" && break
2804 done
2805
2806 case "x$LINT" in
2807 (xcppcheck|x*/cppcheck)
2808         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2809         ;;
2810 esac
2811
2812 echo "$as_me:2812: checking if filesystem supports mixed-case filenames" >&5
2813 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2814 if test "${cf_cv_mixedcase+set}" = set; then
2815   echo $ECHO_N "(cached) $ECHO_C" >&6
2816 else
2817
2818 if test "$cross_compiling" = yes ; then
2819         case $target_alias in
2820         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2821                 cf_cv_mixedcase=no
2822                 ;;
2823         (*)
2824                 cf_cv_mixedcase=yes
2825                 ;;
2826         esac
2827 else
2828         rm -f conftest CONFTEST
2829         echo test >conftest
2830         if test -f CONFTEST ; then
2831                 cf_cv_mixedcase=no
2832         else
2833                 cf_cv_mixedcase=yes
2834         fi
2835         rm -f conftest CONFTEST
2836 fi
2837
2838 fi
2839 echo "$as_me:2839: result: $cf_cv_mixedcase" >&5
2840 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2841 test "$cf_cv_mixedcase" = yes &&
2842 cat >>confdefs.h <<\EOF
2843 #define MIXEDCASE_FILENAMES 1
2844 EOF
2845
2846 for ac_prog in exctags ctags
2847 do
2848   # Extract the first word of "$ac_prog", so it can be a program name with args.
2849 set dummy $ac_prog; ac_word=$2
2850 echo "$as_me:2850: checking for $ac_word" >&5
2851 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2852 if test "${ac_cv_prog_CTAGS+set}" = set; then
2853   echo $ECHO_N "(cached) $ECHO_C" >&6
2854 else
2855   if test -n "$CTAGS"; then
2856   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2857 else
2858   ac_save_IFS=$IFS; IFS=$ac_path_separator
2859 ac_dummy="$PATH"
2860 for ac_dir in $ac_dummy; do
2861   IFS=$ac_save_IFS
2862   test -z "$ac_dir" && ac_dir=.
2863   $as_executable_p "$ac_dir/$ac_word" || continue
2864 ac_cv_prog_CTAGS="$ac_prog"
2865 echo "$as_me:2865: found $ac_dir/$ac_word" >&5
2866 break
2867 done
2868
2869 fi
2870 fi
2871 CTAGS=$ac_cv_prog_CTAGS
2872 if test -n "$CTAGS"; then
2873   echo "$as_me:2873: result: $CTAGS" >&5
2874 echo "${ECHO_T}$CTAGS" >&6
2875 else
2876   echo "$as_me:2876: result: no" >&5
2877 echo "${ECHO_T}no" >&6
2878 fi
2879
2880   test -n "$CTAGS" && break
2881 done
2882
2883 for ac_prog in exetags etags
2884 do
2885   # Extract the first word of "$ac_prog", so it can be a program name with args.
2886 set dummy $ac_prog; ac_word=$2
2887 echo "$as_me:2887: checking for $ac_word" >&5
2888 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2889 if test "${ac_cv_prog_ETAGS+set}" = set; then
2890   echo $ECHO_N "(cached) $ECHO_C" >&6
2891 else
2892   if test -n "$ETAGS"; then
2893   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2894 else
2895   ac_save_IFS=$IFS; IFS=$ac_path_separator
2896 ac_dummy="$PATH"
2897 for ac_dir in $ac_dummy; do
2898   IFS=$ac_save_IFS
2899   test -z "$ac_dir" && ac_dir=.
2900   $as_executable_p "$ac_dir/$ac_word" || continue
2901 ac_cv_prog_ETAGS="$ac_prog"
2902 echo "$as_me:2902: found $ac_dir/$ac_word" >&5
2903 break
2904 done
2905
2906 fi
2907 fi
2908 ETAGS=$ac_cv_prog_ETAGS
2909 if test -n "$ETAGS"; then
2910   echo "$as_me:2910: result: $ETAGS" >&5
2911 echo "${ECHO_T}$ETAGS" >&6
2912 else
2913   echo "$as_me:2913: result: no" >&5
2914 echo "${ECHO_T}no" >&6
2915 fi
2916
2917   test -n "$ETAGS" && break
2918 done
2919
2920 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2921 set dummy ${CTAGS:-ctags}; ac_word=$2
2922 echo "$as_me:2922: checking for $ac_word" >&5
2923 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2924 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2925   echo $ECHO_N "(cached) $ECHO_C" >&6
2926 else
2927   if test -n "$MAKE_LOWER_TAGS"; then
2928   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2929 else
2930   ac_save_IFS=$IFS; IFS=$ac_path_separator
2931 ac_dummy="$PATH"
2932 for ac_dir in $ac_dummy; do
2933   IFS=$ac_save_IFS
2934   test -z "$ac_dir" && ac_dir=.
2935   $as_executable_p "$ac_dir/$ac_word" || continue
2936 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2937 echo "$as_me:2937: found $ac_dir/$ac_word" >&5
2938 break
2939 done
2940
2941   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2942 fi
2943 fi
2944 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2945 if test -n "$MAKE_LOWER_TAGS"; then
2946   echo "$as_me:2946: result: $MAKE_LOWER_TAGS" >&5
2947 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2948 else
2949   echo "$as_me:2949: result: no" >&5
2950 echo "${ECHO_T}no" >&6
2951 fi
2952
2953 if test "$cf_cv_mixedcase" = yes ; then
2954         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2955 set dummy ${ETAGS:-etags}; ac_word=$2
2956 echo "$as_me:2956: checking for $ac_word" >&5
2957 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2958 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2959   echo $ECHO_N "(cached) $ECHO_C" >&6
2960 else
2961   if test -n "$MAKE_UPPER_TAGS"; then
2962   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2963 else
2964   ac_save_IFS=$IFS; IFS=$ac_path_separator
2965 ac_dummy="$PATH"
2966 for ac_dir in $ac_dummy; do
2967   IFS=$ac_save_IFS
2968   test -z "$ac_dir" && ac_dir=.
2969   $as_executable_p "$ac_dir/$ac_word" || continue
2970 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2971 echo "$as_me:2971: found $ac_dir/$ac_word" >&5
2972 break
2973 done
2974
2975   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2976 fi
2977 fi
2978 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2979 if test -n "$MAKE_UPPER_TAGS"; then
2980   echo "$as_me:2980: result: $MAKE_UPPER_TAGS" >&5
2981 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2982 else
2983   echo "$as_me:2983: result: no" >&5
2984 echo "${ECHO_T}no" >&6
2985 fi
2986
2987 else
2988         MAKE_UPPER_TAGS=no
2989 fi
2990
2991 if test "$MAKE_UPPER_TAGS" = yes ; then
2992         MAKE_UPPER_TAGS=
2993 else
2994         MAKE_UPPER_TAGS="#"
2995 fi
2996
2997 if test "$MAKE_LOWER_TAGS" = yes ; then
2998         MAKE_LOWER_TAGS=
2999 else
3000         MAKE_LOWER_TAGS="#"
3001 fi
3002
3003 echo "$as_me:3003: checking if -lm needed for math functions" >&5
3004 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3005 if test "${cf_cv_need_libm+set}" = set; then
3006   echo $ECHO_N "(cached) $ECHO_C" >&6
3007 else
3008
3009         cat >conftest.$ac_ext <<_ACEOF
3010 #line 3010 "configure"
3011 #include "confdefs.h"
3012
3013         #include <stdio.h>
3014         #include <stdlib.h>
3015         #include <math.h>
3016
3017 int
3018 main (void)
3019 {
3020 double x = rand(); printf("result = %g\n", pow(sin(x),x))
3021   ;
3022   return 0;
3023 }
3024 _ACEOF
3025 rm -f conftest.$ac_objext conftest$ac_exeext
3026 if { (eval echo "$as_me:3026: \"$ac_link\"") >&5
3027   (eval $ac_link) 2>&5
3028   ac_status=$?
3029   echo "$as_me:3029: \$? = $ac_status" >&5
3030   (exit $ac_status); } &&
3031          { ac_try='test -s conftest$ac_exeext'
3032   { (eval echo "$as_me:3032: \"$ac_try\"") >&5
3033   (eval $ac_try) 2>&5
3034   ac_status=$?
3035   echo "$as_me:3035: \$? = $ac_status" >&5
3036   (exit $ac_status); }; }; then
3037   cf_cv_need_libm=no
3038 else
3039   echo "$as_me: failed program was:" >&5
3040 cat conftest.$ac_ext >&5
3041 cf_cv_need_libm=yes
3042 fi
3043 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3044 fi
3045 echo "$as_me:3045: result: $cf_cv_need_libm" >&5
3046 echo "${ECHO_T}$cf_cv_need_libm" >&6
3047 if test "$cf_cv_need_libm" = yes
3048 then
3049 MATH_LIB=-lm
3050 fi
3051
3052 top_builddir=`pwd`
3053
3054 CC_G_OPT="-g"
3055 CC_SHARED_OPTS=unknown
3056 CPPFLAGS="$CPPFLAGS"
3057 DFT_DEP_SUFFIX=""
3058 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3059 DFT_UPR_MODEL="NORMAL"
3060 LD="ld"
3061 LDFLAGS_SHARED=""
3062 LDFLAGS_STATIC=""
3063 LD_MODEL=""
3064 LD_SHARED_OPTS=""
3065 LIBTOOL=""
3066 LIBTOOL_OPTS=""
3067 LIB_CLEAN=""
3068 LIB_COMPILE=""
3069 LIB_LINK='${CC}'
3070 LINK_TESTS=""
3071 LOCAL_LDFLAGS=""
3072 PACKAGE="ncurses-examples"
3073 PTHREAD="-lm"
3074 TEST_ARGS=""
3075 TEST_DEPS=""
3076 TEST_LIBS=""
3077 TINFO_LDFLAGS=''
3078 TINFO_LIBS='$(LIBS_CURSES)'
3079 cf_cv_abi_version=""
3080 cf_cv_rel_version=""
3081 includesubdir=""
3082
3083 cf_cv_screen=curses
3084 cf_cv_libtype=
3085
3086 if test "$GCC" = yes
3087 then
3088 cat > conftest.i <<EOF
3089 #ifndef GCC_PRINTF
3090 #define GCC_PRINTF 0
3091 #endif
3092 #ifndef GCC_SCANF
3093 #define GCC_SCANF 0
3094 #endif
3095 #ifndef GCC_NORETURN
3096 #define GCC_NORETURN /* nothing */
3097 #endif
3098 #ifndef GCC_UNUSED
3099 #define GCC_UNUSED /* nothing */
3100 #endif
3101 EOF
3102 if test "$GCC" = yes
3103 then
3104         { echo "$as_me:3104: checking for $CC __attribute__ directives..." >&5
3105 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3106 cat > conftest.$ac_ext <<EOF
3107 #line 3107 "${as_me:-configure}"
3108 #include "confdefs.h"
3109 #include "conftest.h"
3110 #include "conftest.i"
3111 #if     GCC_PRINTF
3112 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3113 #else
3114 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3115 #endif
3116 #if     GCC_SCANF
3117 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3118 #else
3119 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3120 #endif
3121 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3122 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3123 extern void foo(void) GCC_NORETURN;
3124 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3125 EOF
3126         cf_printf_attribute=no
3127         cf_scanf_attribute=no
3128         for cf_attribute in scanf printf unused noreturn
3129         do
3130
3131 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3132
3133                 cf_directive="__attribute__(($cf_attribute))"
3134                 echo "checking for $CC $cf_directive" 1>&5
3135
3136                 case $cf_attribute in
3137                 (printf)
3138                         cf_printf_attribute=yes
3139                         cat >conftest.h <<EOF
3140 #define GCC_$cf_ATTRIBUTE 1
3141 EOF
3142                         ;;
3143                 (scanf)
3144                         cf_scanf_attribute=yes
3145                         cat >conftest.h <<EOF
3146 #define GCC_$cf_ATTRIBUTE 1
3147 EOF
3148                         ;;
3149                 (*)
3150                         cat >conftest.h <<EOF
3151 #define GCC_$cf_ATTRIBUTE $cf_directive
3152 EOF
3153                         ;;
3154                 esac
3155
3156                 if { (eval echo "$as_me:3156: \"$ac_compile\"") >&5
3157   (eval $ac_compile) 2>&5
3158   ac_status=$?
3159   echo "$as_me:3159: \$? = $ac_status" >&5
3160   (exit $ac_status); }; then
3161                         test -n "$verbose" && echo "$as_me:3161: result: ... $cf_attribute" >&5
3162 echo "${ECHO_T}... $cf_attribute" >&6
3163                         cat conftest.h >>confdefs.h
3164                         case $cf_attribute in
3165                         (noreturn)
3166
3167 cat >>confdefs.h <<EOF
3168 #define GCC_NORETURN $cf_directive
3169 EOF
3170
3171                                 ;;
3172                         (printf)
3173                                 cf_value='/* nothing */'
3174                                 if test "$cf_printf_attribute" != no ; then
3175                                         cf_value='__attribute__((format(printf,fmt,var)))'
3176
3177 cat >>confdefs.h <<\EOF
3178 #define GCC_PRINTF 1
3179 EOF
3180
3181                                 fi
3182
3183 cat >>confdefs.h <<EOF
3184 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3185 EOF
3186
3187                                 ;;
3188                         (scanf)
3189                                 cf_value='/* nothing */'
3190                                 if test "$cf_scanf_attribute" != no ; then
3191                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3192
3193 cat >>confdefs.h <<\EOF
3194 #define GCC_SCANF 1
3195 EOF
3196
3197                                 fi
3198
3199 cat >>confdefs.h <<EOF
3200 #define GCC_SCANFLIKE(fmt,var) $cf_value
3201 EOF
3202
3203                                 ;;
3204                         (unused)
3205
3206 cat >>confdefs.h <<EOF
3207 #define GCC_UNUSED $cf_directive
3208 EOF
3209
3210                                 ;;
3211                         esac
3212                 fi
3213         done
3214 else
3215         fgrep define conftest.i >>confdefs.h
3216 fi
3217 rm -rf conftest*
3218 fi
3219
3220 echo "$as_me:3220: checking if you want to work around bogus compiler/loader warnings" >&5
3221 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3222
3223 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3224 if test "${enable_string_hacks+set}" = set; then
3225   enableval="$enable_string_hacks"
3226   with_string_hacks=$enableval
3227 else
3228   with_string_hacks=no
3229 fi;
3230 echo "$as_me:3230: result: $with_string_hacks" >&5
3231 echo "${ECHO_T}$with_string_hacks" >&6
3232
3233 if test "x$with_string_hacks" = "xyes"; then
3234
3235 cat >>confdefs.h <<\EOF
3236 #define USE_STRING_HACKS 1
3237 EOF
3238
3239         { echo "$as_me:3239: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3240 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3241         echo "$as_me:3241: checking for strlcat" >&5
3242 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3243 if test "${ac_cv_func_strlcat+set}" = set; then
3244   echo $ECHO_N "(cached) $ECHO_C" >&6
3245 else
3246   cat >conftest.$ac_ext <<_ACEOF
3247 #line 3247 "configure"
3248 #include "confdefs.h"
3249 #define strlcat autoconf_temporary
3250 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3251 #undef strlcat
3252
3253 #ifdef __cplusplus
3254 extern "C"
3255 #endif
3256
3257 /* We use char because int might match the return type of a gcc2
3258    builtin and then its argument prototype would still apply.  */
3259 char strlcat (void);
3260
3261 int
3262 main (void)
3263 {
3264
3265 /* The GNU C library defines stubs for functions which it implements
3266     to always fail with ENOSYS.  Some functions are actually named
3267     something starting with __ and the normal name is an alias.  */
3268 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3269 #error found stub for strlcat
3270 #endif
3271
3272         return strlcat ();
3273   ;
3274   return 0;
3275 }
3276 _ACEOF
3277 rm -f conftest.$ac_objext conftest$ac_exeext
3278 if { (eval echo "$as_me:3278: \"$ac_link\"") >&5
3279   (eval $ac_link) 2>&5
3280   ac_status=$?
3281   echo "$as_me:3281: \$? = $ac_status" >&5
3282   (exit $ac_status); } &&
3283          { ac_try='test -s conftest$ac_exeext'
3284   { (eval echo "$as_me:3284: \"$ac_try\"") >&5
3285   (eval $ac_try) 2>&5
3286   ac_status=$?
3287   echo "$as_me:3287: \$? = $ac_status" >&5
3288   (exit $ac_status); }; }; then
3289   ac_cv_func_strlcat=yes
3290 else
3291   echo "$as_me: failed program was:" >&5
3292 cat conftest.$ac_ext >&5
3293 ac_cv_func_strlcat=no
3294 fi
3295 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3296 fi
3297 echo "$as_me:3297: result: $ac_cv_func_strlcat" >&5
3298 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3299 if test $ac_cv_func_strlcat = yes; then
3300
3301 cat >>confdefs.h <<\EOF
3302 #define HAVE_STRLCAT 1
3303 EOF
3304
3305 else
3306
3307                 echo "$as_me:3307: checking for strlcat in -lbsd" >&5
3308 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3309 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3310   echo $ECHO_N "(cached) $ECHO_C" >&6
3311 else
3312   ac_check_lib_save_LIBS=$LIBS
3313 LIBS="-lbsd  $LIBS"
3314 cat >conftest.$ac_ext <<_ACEOF
3315 #line 3315 "configure"
3316 #include "confdefs.h"
3317
3318 /* Override any gcc2 internal prototype to avoid an error.  */
3319 #ifdef __cplusplus
3320 extern "C"
3321 #endif
3322 /* We use char because int might match the return type of a gcc2
3323    builtin and then its argument prototype would still apply.  */
3324 char strlcat ();
3325 int
3326 main (void)
3327 {
3328 strlcat ();
3329   ;
3330   return 0;
3331 }
3332 _ACEOF
3333 rm -f conftest.$ac_objext conftest$ac_exeext
3334 if { (eval echo "$as_me:3334: \"$ac_link\"") >&5
3335   (eval $ac_link) 2>&5
3336   ac_status=$?
3337   echo "$as_me:3337: \$? = $ac_status" >&5
3338   (exit $ac_status); } &&
3339          { ac_try='test -s conftest$ac_exeext'
3340   { (eval echo "$as_me:3340: \"$ac_try\"") >&5
3341   (eval $ac_try) 2>&5
3342   ac_status=$?
3343   echo "$as_me:3343: \$? = $ac_status" >&5
3344   (exit $ac_status); }; }; then
3345   ac_cv_lib_bsd_strlcat=yes
3346 else
3347   echo "$as_me: failed program was:" >&5
3348 cat conftest.$ac_ext >&5
3349 ac_cv_lib_bsd_strlcat=no
3350 fi
3351 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3352 LIBS=$ac_check_lib_save_LIBS
3353 fi
3354 echo "$as_me:3354: result: $ac_cv_lib_bsd_strlcat" >&5
3355 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3356 if test $ac_cv_lib_bsd_strlcat = yes; then
3357
3358 cf_add_libs="$LIBS"
3359 # reverse order
3360 cf_add_0lib=
3361 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3362 # filter duplicates
3363 for cf_add_1lib in $cf_add_0lib; do
3364         for cf_add_2lib in $cf_add_libs; do
3365                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3366                         cf_add_1lib=
3367                         break
3368                 fi
3369         done
3370         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3371 done
3372 LIBS="$cf_add_libs"
3373
3374 for ac_header in bsd/string.h
3375 do
3376 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3377 echo "$as_me:3377: checking for $ac_header" >&5
3378 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3379 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3380   echo $ECHO_N "(cached) $ECHO_C" >&6
3381 else
3382   cat >conftest.$ac_ext <<_ACEOF
3383 #line 3383 "configure"
3384 #include "confdefs.h"
3385 #include <$ac_header>
3386 _ACEOF
3387 if { (eval echo "$as_me:3387: \"$ac_cpp conftest.$ac_ext\"") >&5
3388   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3389   ac_status=$?
3390   egrep -v '^ *\+' conftest.er1 >conftest.err
3391   rm -f conftest.er1
3392   cat conftest.err >&5
3393   echo "$as_me:3393: \$? = $ac_status" >&5
3394   (exit $ac_status); } >/dev/null; then
3395   if test -s conftest.err; then
3396     ac_cpp_err=$ac_c_preproc_warn_flag
3397   else
3398     ac_cpp_err=
3399   fi
3400 else
3401   ac_cpp_err=yes
3402 fi
3403 if test -z "$ac_cpp_err"; then
3404   eval "$as_ac_Header=yes"
3405 else
3406   echo "$as_me: failed program was:" >&5
3407   cat conftest.$ac_ext >&5
3408   eval "$as_ac_Header=no"
3409 fi
3410 rm -f conftest.err conftest.$ac_ext
3411 fi
3412 echo "$as_me:3412: result: `eval echo '${'$as_ac_Header'}'`" >&5
3413 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3414 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3415   cat >>confdefs.h <<EOF
3416 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3417 EOF
3418
3419 fi
3420 done
3421
3422 cat >>confdefs.h <<\EOF
3423 #define HAVE_STRLCAT 1
3424 EOF
3425
3426 fi
3427
3428 fi
3429
3430 for ac_func in strlcpy snprintf
3431 do
3432 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3433 echo "$as_me:3433: checking for $ac_func" >&5
3434 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3435 if eval "test \"\${$as_ac_var+set}\" = set"; then
3436   echo $ECHO_N "(cached) $ECHO_C" >&6
3437 else
3438   cat >conftest.$ac_ext <<_ACEOF
3439 #line 3439 "configure"
3440 #include "confdefs.h"
3441 #define $ac_func autoconf_temporary
3442 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3443 #undef $ac_func
3444
3445 #ifdef __cplusplus
3446 extern "C"
3447 #endif
3448
3449 /* We use char because int might match the return type of a gcc2
3450    builtin and then its argument prototype would still apply.  */
3451 char $ac_func (void);
3452
3453 int
3454 main (void)
3455 {
3456
3457 /* The GNU C library defines stubs for functions which it implements
3458     to always fail with ENOSYS.  Some functions are actually named
3459     something starting with __ and the normal name is an alias.  */
3460 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3461 #error found stub for $ac_func
3462 #endif
3463
3464         return $ac_func ();
3465   ;
3466   return 0;
3467 }
3468 _ACEOF
3469 rm -f conftest.$ac_objext conftest$ac_exeext
3470 if { (eval echo "$as_me:3470: \"$ac_link\"") >&5
3471   (eval $ac_link) 2>&5
3472   ac_status=$?
3473   echo "$as_me:3473: \$? = $ac_status" >&5
3474   (exit $ac_status); } &&
3475          { ac_try='test -s conftest$ac_exeext'
3476   { (eval echo "$as_me:3476: \"$ac_try\"") >&5
3477   (eval $ac_try) 2>&5
3478   ac_status=$?
3479   echo "$as_me:3479: \$? = $ac_status" >&5
3480   (exit $ac_status); }; }; then
3481   eval "$as_ac_var=yes"
3482 else
3483   echo "$as_me: failed program was:" >&5
3484 cat conftest.$ac_ext >&5
3485 eval "$as_ac_var=no"
3486 fi
3487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3488 fi
3489 echo "$as_me:3489: result: `eval echo '${'$as_ac_var'}'`" >&5
3490 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3491 if test `eval echo '${'$as_ac_var'}'` = yes; then
3492   cat >>confdefs.h <<EOF
3493 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3494 EOF
3495
3496 fi
3497 done
3498
3499 fi
3500
3501 echo "$as_me:3501: checking if the POSIX test-macros are already defined" >&5
3502 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3503 if test "${cf_cv_posix_visible+set}" = set; then
3504   echo $ECHO_N "(cached) $ECHO_C" >&6
3505 else
3506
3507 cat >conftest.$ac_ext <<_ACEOF
3508 #line 3508 "configure"
3509 #include "confdefs.h"
3510 #include <stdio.h>
3511 int
3512 main (void)
3513 {
3514
3515 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3516         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3517         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3518         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3519 #error conflicting symbols found
3520 #endif
3521
3522   ;
3523   return 0;
3524 }
3525 _ACEOF
3526 rm -f conftest.$ac_objext
3527 if { (eval echo "$as_me:3527: \"$ac_compile\"") >&5
3528   (eval $ac_compile) 2>&5
3529   ac_status=$?
3530   echo "$as_me:3530: \$? = $ac_status" >&5
3531   (exit $ac_status); } &&
3532          { ac_try='test -s conftest.$ac_objext'
3533   { (eval echo "$as_me:3533: \"$ac_try\"") >&5
3534   (eval $ac_try) 2>&5
3535   ac_status=$?
3536   echo "$as_me:3536: \$? = $ac_status" >&5
3537   (exit $ac_status); }; }; then
3538   cf_cv_posix_visible=no
3539 else
3540   echo "$as_me: failed program was:" >&5
3541 cat conftest.$ac_ext >&5
3542 cf_cv_posix_visible=yes
3543 fi
3544 rm -f conftest.$ac_objext conftest.$ac_ext
3545
3546 fi
3547 echo "$as_me:3547: result: $cf_cv_posix_visible" >&5
3548 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3549
3550 if test "$cf_cv_posix_visible" = no; then
3551
3552 cf_XOPEN_SOURCE=600
3553 cf_POSIX_C_SOURCE=199506L
3554 cf_xopen_source=
3555
3556 case $host_os in
3557 (aix[4-7]*)
3558         cf_xopen_source="-D_ALL_SOURCE"
3559         ;;
3560 (msys)
3561         cf_XOPEN_SOURCE=600
3562         ;;
3563 (darwin[0-8].*)
3564         cf_xopen_source="-D_APPLE_C_SOURCE"
3565         ;;
3566 (darwin*)
3567         cf_xopen_source="-D_DARWIN_C_SOURCE"
3568         cf_XOPEN_SOURCE=
3569         ;;
3570 (freebsd*|dragonfly*|midnightbsd*)
3571         # 5.x headers associate
3572         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3573         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3574         cf_POSIX_C_SOURCE=200112L
3575         cf_XOPEN_SOURCE=600
3576         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3577         ;;
3578 (hpux11*)
3579         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3580         ;;
3581 (hpux*)
3582         cf_xopen_source="-D_HPUX_SOURCE"
3583         ;;
3584 (irix[56].*)
3585         cf_xopen_source="-D_SGI_SOURCE"
3586         cf_XOPEN_SOURCE=
3587         ;;
3588 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3589
3590 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3591
3592 echo "$as_me:3592: checking if this is the GNU C library" >&5
3593 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3594 if test "${cf_cv_gnu_library+set}" = set; then
3595   echo $ECHO_N "(cached) $ECHO_C" >&6
3596 else
3597
3598 cat >conftest.$ac_ext <<_ACEOF
3599 #line 3599 "configure"
3600 #include "confdefs.h"
3601 #include <sys/types.h>
3602 int
3603 main (void)
3604 {
3605
3606         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3607                 return 0;
3608         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3609                 return 0;
3610         #else
3611         #       error not GNU C library
3612         #endif
3613   ;
3614   return 0;
3615 }
3616 _ACEOF
3617 rm -f conftest.$ac_objext
3618 if { (eval echo "$as_me:3618: \"$ac_compile\"") >&5
3619   (eval $ac_compile) 2>&5
3620   ac_status=$?
3621   echo "$as_me:3621: \$? = $ac_status" >&5
3622   (exit $ac_status); } &&
3623          { ac_try='test -s conftest.$ac_objext'
3624   { (eval echo "$as_me:3624: \"$ac_try\"") >&5
3625   (eval $ac_try) 2>&5
3626   ac_status=$?
3627   echo "$as_me:3627: \$? = $ac_status" >&5
3628   (exit $ac_status); }; }; then
3629   cf_cv_gnu_library=yes
3630 else
3631   echo "$as_me: failed program was:" >&5
3632 cat conftest.$ac_ext >&5
3633 cf_cv_gnu_library=no
3634 fi
3635 rm -f conftest.$ac_objext conftest.$ac_ext
3636
3637 fi
3638 echo "$as_me:3638: result: $cf_cv_gnu_library" >&5
3639 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3640
3641 if test x$cf_cv_gnu_library = xyes; then
3642
3643         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3644         # was changed to help a little.  newlib incorporated the change about 4
3645         # years later.
3646         echo "$as_me:3646: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3647 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3648 if test "${cf_cv_gnu_library_219+set}" = set; then
3649   echo $ECHO_N "(cached) $ECHO_C" >&6
3650 else
3651
3652                 cf_save="$CPPFLAGS"
3653
3654         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3655         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3656
3657                 cat >conftest.$ac_ext <<_ACEOF
3658 #line 3658 "configure"
3659 #include "confdefs.h"
3660 #include <sys/types.h>
3661 int
3662 main (void)
3663 {
3664
3665                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3666                                 return 0;
3667                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3668                                 return 0;
3669                         #else
3670                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3671                         #endif
3672   ;
3673   return 0;
3674 }
3675 _ACEOF
3676 rm -f conftest.$ac_objext
3677 if { (eval echo "$as_me:3677: \"$ac_compile\"") >&5
3678   (eval $ac_compile) 2>&5
3679   ac_status=$?
3680   echo "$as_me:3680: \$? = $ac_status" >&5
3681   (exit $ac_status); } &&
3682          { ac_try='test -s conftest.$ac_objext'
3683   { (eval echo "$as_me:3683: \"$ac_try\"") >&5
3684   (eval $ac_try) 2>&5
3685   ac_status=$?
3686   echo "$as_me:3686: \$? = $ac_status" >&5
3687   (exit $ac_status); }; }; then
3688   cf_cv_gnu_library_219=yes
3689 else
3690   echo "$as_me: failed program was:" >&5
3691 cat conftest.$ac_ext >&5
3692 cf_cv_gnu_library_219=no
3693 fi
3694 rm -f conftest.$ac_objext conftest.$ac_ext
3695                 CPPFLAGS="$cf_save"
3696
3697 fi
3698 echo "$as_me:3698: result: $cf_cv_gnu_library_219" >&5
3699 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3700
3701         if test "x$cf_cv_gnu_library_219" = xyes; then
3702                 cf_save="$CPPFLAGS"
3703                 echo "$as_me:3703: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3704 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3705 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3706   echo $ECHO_N "(cached) $ECHO_C" >&6
3707 else
3708
3709 cf_fix_cppflags=no
3710 cf_new_cflags=
3711 cf_new_cppflags=
3712 cf_new_extra_cppflags=
3713
3714 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3715 do
3716 case $cf_fix_cppflags in
3717 (no)
3718         case $cf_add_cflags in
3719         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3720                 case $cf_add_cflags in
3721                 (-D*)
3722                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3723
3724                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3725                                 && test -z "${cf_tst_cflags}" \
3726                                 && cf_fix_cppflags=yes
3727
3728                         if test $cf_fix_cppflags = yes ; then
3729
3730         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3731         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3732
3733                                 continue
3734                         elif test "${cf_tst_cflags}" = "\"'" ; then
3735
3736         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3737         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3738
3739                                 continue
3740                         fi
3741                         ;;
3742                 esac
3743                 case "$CPPFLAGS" in
3744                 (*$cf_add_cflags)
3745                         ;;
3746                 (*)
3747                         case $cf_add_cflags in
3748                         (-D*)
3749                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3750
3751 CPPFLAGS=`echo "$CPPFLAGS" | \
3752         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3753                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3754
3755                                 ;;
3756                         esac
3757
3758         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3759         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3760
3761                         ;;
3762                 esac
3763                 ;;
3764         (*)
3765
3766         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3767         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3768
3769                 ;;
3770         esac
3771         ;;
3772 (yes)
3773
3774         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3775         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3776
3777         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3778
3779         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3780                 && test -z "${cf_tst_cflags}" \
3781                 && cf_fix_cppflags=no
3782         ;;
3783 esac
3784 done
3785
3786 if test -n "$cf_new_cflags" ; then
3787
3788         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3789         CFLAGS="${CFLAGS}$cf_new_cflags"
3790
3791 fi
3792
3793 if test -n "$cf_new_cppflags" ; then
3794
3795         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3796         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3797
3798 fi
3799
3800 if test -n "$cf_new_extra_cppflags" ; then
3801
3802         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3803         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3804
3805 fi
3806
3807                         cat >conftest.$ac_ext <<_ACEOF
3808 #line 3808 "configure"
3809 #include "confdefs.h"
3810
3811                                 #include <limits.h>
3812                                 #include <sys/types.h>
3813
3814 int
3815 main (void)
3816 {
3817
3818                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3819                                         return 0;
3820                                 #else
3821                                 #       error GNU C library is too old
3822                                 #endif
3823   ;
3824   return 0;
3825 }
3826 _ACEOF
3827 rm -f conftest.$ac_objext
3828 if { (eval echo "$as_me:3828: \"$ac_compile\"") >&5
3829   (eval $ac_compile) 2>&5
3830   ac_status=$?
3831   echo "$as_me:3831: \$? = $ac_status" >&5
3832   (exit $ac_status); } &&
3833          { ac_try='test -s conftest.$ac_objext'
3834   { (eval echo "$as_me:3834: \"$ac_try\"") >&5
3835   (eval $ac_try) 2>&5
3836   ac_status=$?
3837   echo "$as_me:3837: \$? = $ac_status" >&5
3838   (exit $ac_status); }; }; then
3839   cf_cv_gnu_dftsrc_219=yes
3840 else
3841   echo "$as_me: failed program was:" >&5
3842 cat conftest.$ac_ext >&5
3843 cf_cv_gnu_dftsrc_219=no
3844 fi
3845 rm -f conftest.$ac_objext conftest.$ac_ext
3846
3847 fi
3848 echo "$as_me:3848: result: $cf_cv_gnu_dftsrc_219" >&5
3849 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3850                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3851         else
3852                 cf_cv_gnu_dftsrc_219=maybe
3853         fi
3854
3855         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3856
3857                 echo "$as_me:3857: checking if we must define _GNU_SOURCE" >&5
3858 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3859 if test "${cf_cv_gnu_source+set}" = set; then
3860   echo $ECHO_N "(cached) $ECHO_C" >&6
3861 else
3862
3863                 cat >conftest.$ac_ext <<_ACEOF
3864 #line 3864 "configure"
3865 #include "confdefs.h"
3866 #include <sys/types.h>
3867 int
3868 main (void)
3869 {
3870
3871                         #ifndef _XOPEN_SOURCE
3872                         #error  expected _XOPEN_SOURCE to be defined
3873                         #endif
3874   ;
3875   return 0;
3876 }
3877 _ACEOF
3878 rm -f conftest.$ac_objext
3879 if { (eval echo "$as_me:3879: \"$ac_compile\"") >&5
3880   (eval $ac_compile) 2>&5
3881   ac_status=$?
3882   echo "$as_me:3882: \$? = $ac_status" >&5
3883   (exit $ac_status); } &&
3884          { ac_try='test -s conftest.$ac_objext'
3885   { (eval echo "$as_me:3885: \"$ac_try\"") >&5
3886   (eval $ac_try) 2>&5
3887   ac_status=$?
3888   echo "$as_me:3888: \$? = $ac_status" >&5
3889   (exit $ac_status); }; }; then
3890   cf_cv_gnu_source=no
3891 else
3892   echo "$as_me: failed program was:" >&5
3893 cat conftest.$ac_ext >&5
3894 cf_save="$CPPFLAGS"
3895
3896 cf_fix_cppflags=no
3897 cf_new_cflags=
3898 cf_new_cppflags=
3899 cf_new_extra_cppflags=
3900
3901 for cf_add_cflags in -D_GNU_SOURCE
3902 do
3903 case $cf_fix_cppflags in
3904 (no)
3905         case $cf_add_cflags in
3906         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3907                 case $cf_add_cflags in
3908                 (-D*)
3909                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3910
3911                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3912                                 && test -z "${cf_tst_cflags}" \
3913                                 && cf_fix_cppflags=yes
3914
3915                         if test $cf_fix_cppflags = yes ; then
3916
3917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3919
3920                                 continue
3921                         elif test "${cf_tst_cflags}" = "\"'" ; then
3922
3923         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3924         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3925
3926                                 continue
3927                         fi
3928                         ;;
3929                 esac
3930                 case "$CPPFLAGS" in
3931                 (*$cf_add_cflags)
3932                         ;;
3933                 (*)
3934                         case $cf_add_cflags in
3935                         (-D*)
3936                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3937
3938 CPPFLAGS=`echo "$CPPFLAGS" | \
3939         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3940                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3941
3942                                 ;;
3943                         esac
3944
3945         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3946         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3947
3948                         ;;
3949                 esac
3950                 ;;
3951         (*)
3952
3953         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3954         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3955
3956                 ;;
3957         esac
3958         ;;
3959 (yes)
3960
3961         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3962         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3963
3964         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3965
3966         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3967                 && test -z "${cf_tst_cflags}" \
3968                 && cf_fix_cppflags=no
3969         ;;
3970 esac
3971 done
3972
3973 if test -n "$cf_new_cflags" ; then
3974
3975         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3976         CFLAGS="${CFLAGS}$cf_new_cflags"
3977
3978 fi
3979
3980 if test -n "$cf_new_cppflags" ; then
3981
3982         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3983         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3984
3985 fi
3986
3987 if test -n "$cf_new_extra_cppflags" ; then
3988
3989         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3990         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3991
3992 fi
3993
3994                          cat >conftest.$ac_ext <<_ACEOF
3995 #line 3995 "configure"
3996 #include "confdefs.h"
3997 #include <sys/types.h>
3998 int
3999 main (void)
4000 {
4001
4002                                 #ifdef _XOPEN_SOURCE
4003                                 #error  expected _XOPEN_SOURCE to be undefined
4004                                 #endif
4005   ;
4006   return 0;
4007 }
4008 _ACEOF
4009 rm -f conftest.$ac_objext
4010 if { (eval echo "$as_me:4010: \"$ac_compile\"") >&5
4011   (eval $ac_compile) 2>&5
4012   ac_status=$?
4013   echo "$as_me:4013: \$? = $ac_status" >&5
4014   (exit $ac_status); } &&
4015          { ac_try='test -s conftest.$ac_objext'
4016   { (eval echo "$as_me:4016: \"$ac_try\"") >&5
4017   (eval $ac_try) 2>&5
4018   ac_status=$?
4019   echo "$as_me:4019: \$? = $ac_status" >&5
4020   (exit $ac_status); }; }; then
4021   cf_cv_gnu_source=no
4022 else
4023   echo "$as_me: failed program was:" >&5
4024 cat conftest.$ac_ext >&5
4025 cf_cv_gnu_source=yes
4026 fi
4027 rm -f conftest.$ac_objext conftest.$ac_ext
4028                         CPPFLAGS="$cf_save"
4029
4030 fi
4031 rm -f conftest.$ac_objext conftest.$ac_ext
4032
4033 fi
4034 echo "$as_me:4034: result: $cf_cv_gnu_source" >&5
4035 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4036
4037                 if test "$cf_cv_gnu_source" = yes
4038                 then
4039                 echo "$as_me:4039: checking if we should also define _DEFAULT_SOURCE" >&5
4040 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4041 if test "${cf_cv_default_source+set}" = set; then
4042   echo $ECHO_N "(cached) $ECHO_C" >&6
4043 else
4044
4045         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4046         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4047
4048                         cat >conftest.$ac_ext <<_ACEOF
4049 #line 4049 "configure"
4050 #include "confdefs.h"
4051 #include <sys/types.h>
4052 int
4053 main (void)
4054 {
4055
4056                                 #ifdef _DEFAULT_SOURCE
4057                                 #error  expected _DEFAULT_SOURCE to be undefined
4058                                 #endif
4059   ;
4060   return 0;
4061 }
4062 _ACEOF
4063 rm -f conftest.$ac_objext
4064 if { (eval echo "$as_me:4064: \"$ac_compile\"") >&5
4065   (eval $ac_compile) 2>&5
4066   ac_status=$?
4067   echo "$as_me:4067: \$? = $ac_status" >&5
4068   (exit $ac_status); } &&
4069          { ac_try='test -s conftest.$ac_objext'
4070   { (eval echo "$as_me:4070: \"$ac_try\"") >&5
4071   (eval $ac_try) 2>&5
4072   ac_status=$?
4073   echo "$as_me:4073: \$? = $ac_status" >&5
4074   (exit $ac_status); }; }; then
4075   cf_cv_default_source=no
4076 else
4077   echo "$as_me: failed program was:" >&5
4078 cat conftest.$ac_ext >&5
4079 cf_cv_default_source=yes
4080 fi
4081 rm -f conftest.$ac_objext conftest.$ac_ext
4082
4083 fi
4084 echo "$as_me:4084: result: $cf_cv_default_source" >&5
4085 echo "${ECHO_T}$cf_cv_default_source" >&6
4086                         if test "$cf_cv_default_source" = yes
4087                         then
4088
4089         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4090         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4091
4092                         fi
4093                 fi
4094         fi
4095
4096 fi
4097
4098         ;;
4099 (minix*)
4100         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4101         ;;
4102 (mirbsd*)
4103         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4104         cf_XOPEN_SOURCE=
4105
4106 if test "$cf_cv_posix_visible" = no; then
4107
4108 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4109
4110 cf_save_CFLAGS="$CFLAGS"
4111 cf_save_CPPFLAGS="$CPPFLAGS"
4112
4113 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4114         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4115                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4116
4117 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4118         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4119                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4120
4121 echo "$as_me:4121: checking if we should define _POSIX_C_SOURCE" >&5
4122 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4123 if test "${cf_cv_posix_c_source+set}" = set; then
4124   echo $ECHO_N "(cached) $ECHO_C" >&6
4125 else
4126
4127 echo "${as_me:-configure}:4127: testing if the symbol is already defined go no further ..." 1>&5
4128
4129         cat >conftest.$ac_ext <<_ACEOF
4130 #line 4130 "configure"
4131 #include "confdefs.h"
4132 #include <sys/types.h>
4133 int
4134 main (void)
4135 {
4136
4137 #ifndef _POSIX_C_SOURCE
4138 make an error
4139 #endif
4140   ;
4141   return 0;
4142 }
4143 _ACEOF
4144 rm -f conftest.$ac_objext
4145 if { (eval echo "$as_me:4145: \"$ac_compile\"") >&5
4146   (eval $ac_compile) 2>&5
4147   ac_status=$?
4148   echo "$as_me:4148: \$? = $ac_status" >&5
4149   (exit $ac_status); } &&
4150          { ac_try='test -s conftest.$ac_objext'
4151   { (eval echo "$as_me:4151: \"$ac_try\"") >&5
4152   (eval $ac_try) 2>&5
4153   ac_status=$?
4154   echo "$as_me:4154: \$? = $ac_status" >&5
4155   (exit $ac_status); }; }; then
4156   cf_cv_posix_c_source=no
4157 else
4158   echo "$as_me: failed program was:" >&5
4159 cat conftest.$ac_ext >&5
4160 cf_want_posix_source=no
4161          case .$cf_POSIX_C_SOURCE in
4162          (.[12]??*)
4163                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4164                 ;;
4165          (.2)
4166                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4167                 cf_want_posix_source=yes
4168                 ;;
4169          (.*)
4170                 cf_want_posix_source=yes
4171                 ;;
4172          esac
4173          if test "$cf_want_posix_source" = yes ; then
4174                 cat >conftest.$ac_ext <<_ACEOF
4175 #line 4175 "configure"
4176 #include "confdefs.h"
4177 #include <sys/types.h>
4178 int
4179 main (void)
4180 {
4181
4182 #ifdef _POSIX_SOURCE
4183 make an error
4184 #endif
4185   ;
4186   return 0;
4187 }
4188 _ACEOF
4189 rm -f conftest.$ac_objext
4190 if { (eval echo "$as_me:4190: \"$ac_compile\"") >&5
4191   (eval $ac_compile) 2>&5
4192   ac_status=$?
4193   echo "$as_me:4193: \$? = $ac_status" >&5
4194   (exit $ac_status); } &&
4195          { ac_try='test -s conftest.$ac_objext'
4196   { (eval echo "$as_me:4196: \"$ac_try\"") >&5
4197   (eval $ac_try) 2>&5
4198   ac_status=$?
4199   echo "$as_me:4199: \$? = $ac_status" >&5
4200   (exit $ac_status); }; }; then
4201   :
4202 else
4203   echo "$as_me: failed program was:" >&5
4204 cat conftest.$ac_ext >&5
4205 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4206 fi
4207 rm -f conftest.$ac_objext conftest.$ac_ext
4208          fi
4209
4210 echo "${as_me:-configure}:4210: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4211
4212          CFLAGS="$cf_trim_CFLAGS"
4213          CPPFLAGS="$cf_trim_CPPFLAGS"
4214
4215         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4216         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4217
4218 echo "${as_me:-configure}:4218: testing if the second compile does not leave our definition intact error ..." 1>&5
4219
4220          cat >conftest.$ac_ext <<_ACEOF
4221 #line 4221 "configure"
4222 #include "confdefs.h"
4223 #include <sys/types.h>
4224 int
4225 main (void)
4226 {
4227
4228 #ifndef _POSIX_C_SOURCE
4229 make an error
4230 #endif
4231   ;
4232   return 0;
4233 }
4234 _ACEOF
4235 rm -f conftest.$ac_objext
4236 if { (eval echo "$as_me:4236: \"$ac_compile\"") >&5
4237   (eval $ac_compile) 2>&5
4238   ac_status=$?
4239   echo "$as_me:4239: \$? = $ac_status" >&5
4240   (exit $ac_status); } &&
4241          { ac_try='test -s conftest.$ac_objext'
4242   { (eval echo "$as_me:4242: \"$ac_try\"") >&5
4243   (eval $ac_try) 2>&5
4244   ac_status=$?
4245   echo "$as_me:4245: \$? = $ac_status" >&5
4246   (exit $ac_status); }; }; then
4247   :
4248 else
4249   echo "$as_me: failed program was:" >&5
4250 cat conftest.$ac_ext >&5
4251 cf_cv_posix_c_source=no
4252 fi
4253 rm -f conftest.$ac_objext conftest.$ac_ext
4254          CFLAGS="$cf_save_CFLAGS"
4255          CPPFLAGS="$cf_save_CPPFLAGS"
4256
4257 fi
4258 rm -f conftest.$ac_objext conftest.$ac_ext
4259
4260 fi
4261 echo "$as_me:4261: result: $cf_cv_posix_c_source" >&5
4262 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4263
4264 if test "$cf_cv_posix_c_source" != no ; then
4265         CFLAGS="$cf_trim_CFLAGS"
4266         CPPFLAGS="$cf_trim_CPPFLAGS"
4267
4268 cf_fix_cppflags=no
4269 cf_new_cflags=
4270 cf_new_cppflags=
4271 cf_new_extra_cppflags=
4272
4273 for cf_add_cflags in $cf_cv_posix_c_source
4274 do
4275 case $cf_fix_cppflags in
4276 (no)
4277         case $cf_add_cflags in
4278         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4279                 case $cf_add_cflags in
4280                 (-D*)
4281                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4282
4283                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4284                                 && test -z "${cf_tst_cflags}" \
4285                                 && cf_fix_cppflags=yes
4286
4287                         if test $cf_fix_cppflags = yes ; then
4288
4289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4291
4292                                 continue
4293                         elif test "${cf_tst_cflags}" = "\"'" ; then
4294
4295         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4296         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4297
4298                                 continue
4299                         fi
4300                         ;;
4301                 esac
4302                 case "$CPPFLAGS" in
4303                 (*$cf_add_cflags)
4304                         ;;
4305                 (*)
4306                         case $cf_add_cflags in
4307                         (-D*)
4308                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4309
4310 CPPFLAGS=`echo "$CPPFLAGS" | \
4311         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4312                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4313
4314                                 ;;
4315                         esac
4316
4317         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4318         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4319
4320                         ;;
4321                 esac
4322                 ;;
4323         (*)
4324
4325         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4326         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4327
4328                 ;;
4329         esac
4330         ;;
4331 (yes)
4332
4333         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4334         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4335
4336         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4337
4338         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4339                 && test -z "${cf_tst_cflags}" \
4340                 && cf_fix_cppflags=no
4341         ;;
4342 esac
4343 done
4344
4345 if test -n "$cf_new_cflags" ; then
4346
4347         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4348         CFLAGS="${CFLAGS}$cf_new_cflags"
4349
4350 fi
4351
4352 if test -n "$cf_new_cppflags" ; then
4353
4354         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4355         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4356
4357 fi
4358
4359 if test -n "$cf_new_extra_cppflags" ; then
4360
4361         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4362         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4363
4364 fi
4365
4366 fi
4367
4368 fi # cf_cv_posix_visible
4369
4370         ;;
4371 (netbsd*)
4372         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4373         ;;
4374 (openbsd[4-9]*)
4375         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4376         cf_xopen_source="-D_BSD_SOURCE"
4377         cf_XOPEN_SOURCE=600
4378         ;;
4379 (openbsd*)
4380         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4381         ;;
4382 (osf[45]*)
4383         cf_xopen_source="-D_OSF_SOURCE"
4384         ;;
4385 (nto-qnx*)
4386         cf_xopen_source="-D_QNX_SOURCE"
4387         ;;
4388 (sco*)
4389         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4390         ;;
4391 (solaris2.*)
4392         cf_xopen_source="-D__EXTENSIONS__"
4393         cf_cv_xopen_source=broken
4394         ;;
4395 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4396         cf_XOPEN_SOURCE=
4397         cf_POSIX_C_SOURCE=
4398         ;;
4399 (*)
4400
4401 echo "$as_me:4401: checking if we should define _XOPEN_SOURCE" >&5
4402 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4403 if test "${cf_cv_xopen_source+set}" = set; then
4404   echo $ECHO_N "(cached) $ECHO_C" >&6
4405 else
4406
4407         cat >conftest.$ac_ext <<_ACEOF
4408 #line 4408 "configure"
4409 #include "confdefs.h"
4410
4411 #include <stdlib.h>
4412 #include <string.h>
4413 #include <sys/types.h>
4414
4415 int
4416 main (void)
4417 {
4418
4419 #ifndef _XOPEN_SOURCE
4420 make an error
4421 #endif
4422   ;
4423   return 0;
4424 }
4425 _ACEOF
4426 rm -f conftest.$ac_objext
4427 if { (eval echo "$as_me:4427: \"$ac_compile\"") >&5
4428   (eval $ac_compile) 2>&5
4429   ac_status=$?
4430   echo "$as_me:4430: \$? = $ac_status" >&5
4431   (exit $ac_status); } &&
4432          { ac_try='test -s conftest.$ac_objext'
4433   { (eval echo "$as_me:4433: \"$ac_try\"") >&5
4434   (eval $ac_try) 2>&5
4435   ac_status=$?
4436   echo "$as_me:4436: \$? = $ac_status" >&5
4437   (exit $ac_status); }; }; then
4438   cf_cv_xopen_source=no
4439 else
4440   echo "$as_me: failed program was:" >&5
4441 cat conftest.$ac_ext >&5
4442 cf_save="$CPPFLAGS"
4443
4444         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4445         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4446
4447          cat >conftest.$ac_ext <<_ACEOF
4448 #line 4448 "configure"
4449 #include "confdefs.h"
4450
4451 #include <stdlib.h>
4452 #include <string.h>
4453 #include <sys/types.h>
4454
4455 int
4456 main (void)
4457 {
4458
4459 #ifdef _XOPEN_SOURCE
4460 make an error
4461 #endif
4462   ;
4463   return 0;
4464 }
4465 _ACEOF
4466 rm -f conftest.$ac_objext
4467 if { (eval echo "$as_me:4467: \"$ac_compile\"") >&5
4468   (eval $ac_compile) 2>&5
4469   ac_status=$?
4470   echo "$as_me:4470: \$? = $ac_status" >&5
4471   (exit $ac_status); } &&
4472          { ac_try='test -s conftest.$ac_objext'
4473   { (eval echo "$as_me:4473: \"$ac_try\"") >&5
4474   (eval $ac_try) 2>&5
4475   ac_status=$?
4476   echo "$as_me:4476: \$? = $ac_status" >&5
4477   (exit $ac_status); }; }; then
4478   cf_cv_xopen_source=no
4479 else
4480   echo "$as_me: failed program was:" >&5
4481 cat conftest.$ac_ext >&5
4482 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4483 fi
4484 rm -f conftest.$ac_objext conftest.$ac_ext
4485         CPPFLAGS="$cf_save"
4486
4487 fi
4488 rm -f conftest.$ac_objext conftest.$ac_ext
4489
4490 fi
4491 echo "$as_me:4491: result: $cf_cv_xopen_source" >&5
4492 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4493
4494 if test "$cf_cv_xopen_source" != no ; then
4495
4496 CFLAGS=`echo "$CFLAGS" | \
4497         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4498                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4499
4500 CPPFLAGS=`echo "$CPPFLAGS" | \
4501         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4502                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4503
4504         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4505
4506 cf_fix_cppflags=no
4507 cf_new_cflags=
4508 cf_new_cppflags=
4509 cf_new_extra_cppflags=
4510
4511 for cf_add_cflags in $cf_temp_xopen_source
4512 do
4513 case $cf_fix_cppflags in
4514 (no)
4515         case $cf_add_cflags in
4516         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4517                 case $cf_add_cflags in
4518                 (-D*)
4519                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4520
4521                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4522                                 && test -z "${cf_tst_cflags}" \
4523                                 && cf_fix_cppflags=yes
4524
4525                         if test $cf_fix_cppflags = yes ; then
4526
4527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4529
4530                                 continue
4531                         elif test "${cf_tst_cflags}" = "\"'" ; then
4532
4533         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4534         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4535
4536                                 continue
4537                         fi
4538                         ;;
4539                 esac
4540                 case "$CPPFLAGS" in
4541                 (*$cf_add_cflags)
4542                         ;;
4543                 (*)
4544                         case $cf_add_cflags in
4545                         (-D*)
4546                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4547
4548 CPPFLAGS=`echo "$CPPFLAGS" | \
4549         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4550                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4551
4552                                 ;;
4553                         esac
4554
4555         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4556         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4557
4558                         ;;
4559                 esac
4560                 ;;
4561         (*)
4562
4563         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4564         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4565
4566                 ;;
4567         esac
4568         ;;
4569 (yes)
4570
4571         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4572         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4573
4574         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4575
4576         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4577                 && test -z "${cf_tst_cflags}" \
4578                 && cf_fix_cppflags=no
4579         ;;
4580 esac
4581 done
4582
4583 if test -n "$cf_new_cflags" ; then
4584
4585         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4586         CFLAGS="${CFLAGS}$cf_new_cflags"
4587
4588 fi
4589
4590 if test -n "$cf_new_cppflags" ; then
4591
4592         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4593         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4594
4595 fi
4596
4597 if test -n "$cf_new_extra_cppflags" ; then
4598
4599         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4600         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4601
4602 fi
4603
4604 fi
4605
4606 if test "$cf_cv_posix_visible" = no; then
4607
4608 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4609
4610 cf_save_CFLAGS="$CFLAGS"
4611 cf_save_CPPFLAGS="$CPPFLAGS"
4612
4613 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4614         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4615                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4616
4617 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4618         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4619                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4620
4621 echo "$as_me:4621: checking if we should define _POSIX_C_SOURCE" >&5
4622 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4623 if test "${cf_cv_posix_c_source+set}" = set; then
4624   echo $ECHO_N "(cached) $ECHO_C" >&6
4625 else
4626
4627 echo "${as_me:-configure}:4627: testing if the symbol is already defined go no further ..." 1>&5
4628
4629         cat >conftest.$ac_ext <<_ACEOF
4630 #line 4630 "configure"
4631 #include "confdefs.h"
4632 #include <sys/types.h>
4633 int
4634 main (void)
4635 {
4636
4637 #ifndef _POSIX_C_SOURCE
4638 make an error
4639 #endif
4640   ;
4641   return 0;
4642 }
4643 _ACEOF
4644 rm -f conftest.$ac_objext
4645 if { (eval echo "$as_me:4645: \"$ac_compile\"") >&5
4646   (eval $ac_compile) 2>&5
4647   ac_status=$?
4648   echo "$as_me:4648: \$? = $ac_status" >&5
4649   (exit $ac_status); } &&
4650          { ac_try='test -s conftest.$ac_objext'
4651   { (eval echo "$as_me:4651: \"$ac_try\"") >&5
4652   (eval $ac_try) 2>&5
4653   ac_status=$?
4654   echo "$as_me:4654: \$? = $ac_status" >&5
4655   (exit $ac_status); }; }; then
4656   cf_cv_posix_c_source=no
4657 else
4658   echo "$as_me: failed program was:" >&5
4659 cat conftest.$ac_ext >&5
4660 cf_want_posix_source=no
4661          case .$cf_POSIX_C_SOURCE in
4662          (.[12]??*)
4663                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4664                 ;;
4665          (.2)
4666                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4667                 cf_want_posix_source=yes
4668                 ;;
4669          (.*)
4670                 cf_want_posix_source=yes
4671                 ;;
4672          esac
4673          if test "$cf_want_posix_source" = yes ; then
4674                 cat >conftest.$ac_ext <<_ACEOF
4675 #line 4675 "configure"
4676 #include "confdefs.h"
4677 #include <sys/types.h>
4678 int
4679 main (void)
4680 {
4681
4682 #ifdef _POSIX_SOURCE
4683 make an error
4684 #endif
4685   ;
4686   return 0;
4687 }
4688 _ACEOF
4689 rm -f conftest.$ac_objext
4690 if { (eval echo "$as_me:4690: \"$ac_compile\"") >&5
4691   (eval $ac_compile) 2>&5
4692   ac_status=$?
4693   echo "$as_me:4693: \$? = $ac_status" >&5
4694   (exit $ac_status); } &&
4695          { ac_try='test -s conftest.$ac_objext'
4696   { (eval echo "$as_me:4696: \"$ac_try\"") >&5
4697   (eval $ac_try) 2>&5
4698   ac_status=$?
4699   echo "$as_me:4699: \$? = $ac_status" >&5
4700   (exit $ac_status); }; }; then
4701   :
4702 else
4703   echo "$as_me: failed program was:" >&5
4704 cat conftest.$ac_ext >&5
4705 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4706 fi
4707 rm -f conftest.$ac_objext conftest.$ac_ext
4708          fi
4709
4710 echo "${as_me:-configure}:4710: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4711
4712          CFLAGS="$cf_trim_CFLAGS"
4713          CPPFLAGS="$cf_trim_CPPFLAGS"
4714
4715         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4716         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4717
4718 echo "${as_me:-configure}:4718: testing if the second compile does not leave our definition intact error ..." 1>&5
4719
4720          cat >conftest.$ac_ext <<_ACEOF
4721 #line 4721 "configure"
4722 #include "confdefs.h"
4723 #include <sys/types.h>
4724 int
4725 main (void)
4726 {
4727
4728 #ifndef _POSIX_C_SOURCE
4729 make an error
4730 #endif
4731   ;
4732   return 0;
4733 }
4734 _ACEOF
4735 rm -f conftest.$ac_objext
4736 if { (eval echo "$as_me:4736: \"$ac_compile\"") >&5
4737   (eval $ac_compile) 2>&5
4738   ac_status=$?
4739   echo "$as_me:4739: \$? = $ac_status" >&5
4740   (exit $ac_status); } &&
4741          { ac_try='test -s conftest.$ac_objext'
4742   { (eval echo "$as_me:4742: \"$ac_try\"") >&5
4743   (eval $ac_try) 2>&5
4744   ac_status=$?
4745   echo "$as_me:4745: \$? = $ac_status" >&5
4746   (exit $ac_status); }; }; then
4747   :
4748 else
4749   echo "$as_me: failed program was:" >&5
4750 cat conftest.$ac_ext >&5
4751 cf_cv_posix_c_source=no
4752 fi
4753 rm -f conftest.$ac_objext conftest.$ac_ext
4754          CFLAGS="$cf_save_CFLAGS"
4755          CPPFLAGS="$cf_save_CPPFLAGS"
4756
4757 fi
4758 rm -f conftest.$ac_objext conftest.$ac_ext
4759
4760 fi
4761 echo "$as_me:4761: result: $cf_cv_posix_c_source" >&5
4762 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4763
4764 if test "$cf_cv_posix_c_source" != no ; then
4765         CFLAGS="$cf_trim_CFLAGS"
4766         CPPFLAGS="$cf_trim_CPPFLAGS"
4767
4768 cf_fix_cppflags=no
4769 cf_new_cflags=
4770 cf_new_cppflags=
4771 cf_new_extra_cppflags=
4772
4773 for cf_add_cflags in $cf_cv_posix_c_source
4774 do
4775 case $cf_fix_cppflags in
4776 (no)
4777         case $cf_add_cflags in
4778         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4779                 case $cf_add_cflags in
4780                 (-D*)
4781                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4782
4783                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4784                                 && test -z "${cf_tst_cflags}" \
4785                                 && cf_fix_cppflags=yes
4786
4787                         if test $cf_fix_cppflags = yes ; then
4788
4789         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4790         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4791
4792                                 continue
4793                         elif test "${cf_tst_cflags}" = "\"'" ; then
4794
4795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4797
4798                                 continue
4799                         fi
4800                         ;;
4801                 esac
4802                 case "$CPPFLAGS" in
4803                 (*$cf_add_cflags)
4804                         ;;
4805                 (*)
4806                         case $cf_add_cflags in
4807                         (-D*)
4808                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4809
4810 CPPFLAGS=`echo "$CPPFLAGS" | \
4811         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4812                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4813
4814                                 ;;
4815                         esac
4816
4817         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4818         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4819
4820                         ;;
4821                 esac
4822                 ;;
4823         (*)
4824
4825         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4826         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4827
4828                 ;;
4829         esac
4830         ;;
4831 (yes)
4832
4833         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4834         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4835
4836         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4837
4838         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4839                 && test -z "${cf_tst_cflags}" \
4840                 && cf_fix_cppflags=no
4841         ;;
4842 esac
4843 done
4844
4845 if test -n "$cf_new_cflags" ; then
4846
4847         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4848         CFLAGS="${CFLAGS}$cf_new_cflags"
4849
4850 fi
4851
4852 if test -n "$cf_new_cppflags" ; then
4853
4854         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4855         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4856
4857 fi
4858
4859 if test -n "$cf_new_extra_cppflags" ; then
4860
4861         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4862         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4863
4864 fi
4865
4866 fi
4867
4868 fi # cf_cv_posix_visible
4869
4870         ;;
4871 esac
4872
4873 if test -n "$cf_xopen_source" ; then
4874
4875 cf_fix_cppflags=no
4876 cf_new_cflags=
4877 cf_new_cppflags=
4878 cf_new_extra_cppflags=
4879
4880 for cf_add_cflags in $cf_xopen_source
4881 do
4882 case $cf_fix_cppflags in
4883 (no)
4884         case $cf_add_cflags in
4885         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4886                 case $cf_add_cflags in
4887                 (-D*)
4888                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4889
4890                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4891                                 && test -z "${cf_tst_cflags}" \
4892                                 && cf_fix_cppflags=yes
4893
4894                         if test $cf_fix_cppflags = yes ; then
4895
4896         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4897         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4898
4899                                 continue
4900                         elif test "${cf_tst_cflags}" = "\"'" ; then
4901
4902         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4903         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4904
4905                                 continue
4906                         fi
4907                         ;;
4908                 esac
4909                 case "$CPPFLAGS" in
4910                 (*$cf_add_cflags)
4911                         ;;
4912                 (*)
4913                         case $cf_add_cflags in
4914                         (-D*)
4915                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4916
4917 CPPFLAGS=`echo "$CPPFLAGS" | \
4918         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4919                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4920
4921                                 ;;
4922                         esac
4923
4924         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4925         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4926
4927                         ;;
4928                 esac
4929                 ;;
4930         (*)
4931
4932         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4933         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4934
4935                 ;;
4936         esac
4937         ;;
4938 (yes)
4939
4940         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4941         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4942
4943         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4944
4945         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4946                 && test -z "${cf_tst_cflags}" \
4947                 && cf_fix_cppflags=no
4948         ;;
4949 esac
4950 done
4951
4952 if test -n "$cf_new_cflags" ; then
4953         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4954
4955 echo "${as_me:-configure}:4955: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4956
4957         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4958         CFLAGS="${CFLAGS}$cf_new_cflags"
4959
4960 fi
4961
4962 if test -n "$cf_new_cppflags" ; then
4963         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4964
4965 echo "${as_me:-configure}:4965: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4966
4967         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4968         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4969
4970 fi
4971
4972 if test -n "$cf_new_extra_cppflags" ; then
4973         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4974
4975 echo "${as_me:-configure}:4975: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4976
4977         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4978         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4979
4980 fi
4981
4982 fi
4983
4984 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4985         echo "$as_me:4985: checking if _XOPEN_SOURCE really is set" >&5
4986 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4987         cat >conftest.$ac_ext <<_ACEOF
4988 #line 4988 "configure"
4989 #include "confdefs.h"
4990 #include <stdlib.h>
4991 int
4992 main (void)
4993 {
4994
4995 #ifndef _XOPEN_SOURCE
4996 make an error
4997 #endif
4998   ;
4999   return 0;
5000 }
5001 _ACEOF
5002 rm -f conftest.$ac_objext
5003 if { (eval echo "$as_me:5003: \"$ac_compile\"") >&5
5004   (eval $ac_compile) 2>&5
5005   ac_status=$?
5006   echo "$as_me:5006: \$? = $ac_status" >&5
5007   (exit $ac_status); } &&
5008          { ac_try='test -s conftest.$ac_objext'
5009   { (eval echo "$as_me:5009: \"$ac_try\"") >&5
5010   (eval $ac_try) 2>&5
5011   ac_status=$?
5012   echo "$as_me:5012: \$? = $ac_status" >&5
5013   (exit $ac_status); }; }; then
5014   cf_XOPEN_SOURCE_set=yes
5015 else
5016   echo "$as_me: failed program was:" >&5
5017 cat conftest.$ac_ext >&5
5018 cf_XOPEN_SOURCE_set=no
5019 fi
5020 rm -f conftest.$ac_objext conftest.$ac_ext
5021         echo "$as_me:5021: result: $cf_XOPEN_SOURCE_set" >&5
5022 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5023         if test $cf_XOPEN_SOURCE_set = yes
5024         then
5025                 cat >conftest.$ac_ext <<_ACEOF
5026 #line 5026 "configure"
5027 #include "confdefs.h"
5028 #include <stdlib.h>
5029 int
5030 main (void)
5031 {
5032
5033 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5034 make an error
5035 #endif
5036   ;
5037   return 0;
5038 }
5039 _ACEOF
5040 rm -f conftest.$ac_objext
5041 if { (eval echo "$as_me:5041: \"$ac_compile\"") >&5
5042   (eval $ac_compile) 2>&5
5043   ac_status=$?
5044   echo "$as_me:5044: \$? = $ac_status" >&5
5045   (exit $ac_status); } &&
5046          { ac_try='test -s conftest.$ac_objext'
5047   { (eval echo "$as_me:5047: \"$ac_try\"") >&5
5048   (eval $ac_try) 2>&5
5049   ac_status=$?
5050   echo "$as_me:5050: \$? = $ac_status" >&5
5051   (exit $ac_status); }; }; then
5052   cf_XOPEN_SOURCE_set_ok=yes
5053 else
5054   echo "$as_me: failed program was:" >&5
5055 cat conftest.$ac_ext >&5
5056 cf_XOPEN_SOURCE_set_ok=no
5057 fi
5058 rm -f conftest.$ac_objext conftest.$ac_ext
5059                 if test $cf_XOPEN_SOURCE_set_ok = no
5060                 then
5061                         { echo "$as_me:5061: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5062 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5063                 fi
5064         else
5065
5066 echo "$as_me:5066: checking if we should define _XOPEN_SOURCE" >&5
5067 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5068 if test "${cf_cv_xopen_source+set}" = set; then
5069   echo $ECHO_N "(cached) $ECHO_C" >&6
5070 else
5071
5072         cat >conftest.$ac_ext <<_ACEOF
5073 #line 5073 "configure"
5074 #include "confdefs.h"
5075
5076 #include <stdlib.h>
5077 #include <string.h>
5078 #include <sys/types.h>
5079
5080 int
5081 main (void)
5082 {
5083
5084 #ifndef _XOPEN_SOURCE
5085 make an error
5086 #endif
5087   ;
5088   return 0;
5089 }
5090 _ACEOF
5091 rm -f conftest.$ac_objext
5092 if { (eval echo "$as_me:5092: \"$ac_compile\"") >&5
5093   (eval $ac_compile) 2>&5
5094   ac_status=$?
5095   echo "$as_me:5095: \$? = $ac_status" >&5
5096   (exit $ac_status); } &&
5097          { ac_try='test -s conftest.$ac_objext'
5098   { (eval echo "$as_me:5098: \"$ac_try\"") >&5
5099   (eval $ac_try) 2>&5
5100   ac_status=$?
5101   echo "$as_me:5101: \$? = $ac_status" >&5
5102   (exit $ac_status); }; }; then
5103   cf_cv_xopen_source=no
5104 else
5105   echo "$as_me: failed program was:" >&5
5106 cat conftest.$ac_ext >&5
5107 cf_save="$CPPFLAGS"
5108
5109         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5110         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5111
5112          cat >conftest.$ac_ext <<_ACEOF
5113 #line 5113 "configure"
5114 #include "confdefs.h"
5115
5116 #include <stdlib.h>
5117 #include <string.h>
5118 #include <sys/types.h>
5119
5120 int
5121 main (void)
5122 {
5123
5124 #ifdef _XOPEN_SOURCE
5125 make an error
5126 #endif
5127   ;
5128   return 0;
5129 }
5130 _ACEOF
5131 rm -f conftest.$ac_objext
5132 if { (eval echo "$as_me:5132: \"$ac_compile\"") >&5
5133   (eval $ac_compile) 2>&5
5134   ac_status=$?
5135   echo "$as_me:5135: \$? = $ac_status" >&5
5136   (exit $ac_status); } &&
5137          { ac_try='test -s conftest.$ac_objext'
5138   { (eval echo "$as_me:5138: \"$ac_try\"") >&5
5139   (eval $ac_try) 2>&5
5140   ac_status=$?
5141   echo "$as_me:5141: \$? = $ac_status" >&5
5142   (exit $ac_status); }; }; then
5143   cf_cv_xopen_source=no
5144 else
5145   echo "$as_me: failed program was:" >&5
5146 cat conftest.$ac_ext >&5
5147 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5148 fi
5149 rm -f conftest.$ac_objext conftest.$ac_ext
5150         CPPFLAGS="$cf_save"
5151
5152 fi
5153 rm -f conftest.$ac_objext conftest.$ac_ext
5154
5155 fi
5156 echo "$as_me:5156: result: $cf_cv_xopen_source" >&5
5157 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5158
5159 if test "$cf_cv_xopen_source" != no ; then
5160
5161 CFLAGS=`echo "$CFLAGS" | \
5162         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5163                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5164
5165 CPPFLAGS=`echo "$CPPFLAGS" | \
5166         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5167                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5168
5169         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5170
5171 cf_fix_cppflags=no
5172 cf_new_cflags=
5173 cf_new_cppflags=
5174 cf_new_extra_cppflags=
5175
5176 for cf_add_cflags in $cf_temp_xopen_source
5177 do
5178 case $cf_fix_cppflags in
5179 (no)
5180         case $cf_add_cflags in
5181         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5182                 case $cf_add_cflags in
5183                 (-D*)
5184                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5185
5186                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5187                                 && test -z "${cf_tst_cflags}" \
5188                                 && cf_fix_cppflags=yes
5189
5190                         if test $cf_fix_cppflags = yes ; then
5191
5192         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5193         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5194
5195                                 continue
5196                         elif test "${cf_tst_cflags}" = "\"'" ; then
5197
5198         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5199         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5200
5201                                 continue
5202                         fi
5203                         ;;
5204                 esac
5205                 case "$CPPFLAGS" in
5206                 (*$cf_add_cflags)
5207                         ;;
5208                 (*)
5209                         case $cf_add_cflags in
5210                         (-D*)
5211                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5212
5213 CPPFLAGS=`echo "$CPPFLAGS" | \
5214         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5215                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5216
5217                                 ;;
5218                         esac
5219
5220         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5221         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5222
5223                         ;;
5224                 esac
5225                 ;;
5226         (*)
5227
5228         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5229         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5230
5231                 ;;
5232         esac
5233         ;;
5234 (yes)
5235
5236         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5237         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5238
5239         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5240
5241         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5242                 && test -z "${cf_tst_cflags}" \
5243                 && cf_fix_cppflags=no
5244         ;;
5245 esac
5246 done
5247
5248 if test -n "$cf_new_cflags" ; then
5249
5250         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5251         CFLAGS="${CFLAGS}$cf_new_cflags"
5252
5253 fi
5254
5255 if test -n "$cf_new_cppflags" ; then
5256
5257         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5258         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5259
5260 fi
5261
5262 if test -n "$cf_new_extra_cppflags" ; then
5263
5264         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5265         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5266
5267 fi
5268
5269 fi
5270
5271         fi
5272 fi
5273 fi # cf_cv_posix_visible
5274
5275 echo "$as_me:5275: checking for signal global datatype" >&5
5276 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5277 if test "${cf_cv_sig_atomic_t+set}" = set; then
5278   echo $ECHO_N "(cached) $ECHO_C" >&6
5279 else
5280
5281         for cf_type in \
5282                 "volatile sig_atomic_t" \
5283                 "sig_atomic_t" \
5284                 "int"
5285         do
5286         cat >conftest.$ac_ext <<_ACEOF
5287 #line 5287 "configure"
5288 #include "confdefs.h"
5289
5290 #include <sys/types.h>
5291 #include <signal.h>
5292 #include <stdio.h>
5293
5294 extern $cf_type x;
5295 $cf_type x;
5296 static void handler(int sig)
5297 {
5298         x = 5;
5299 }
5300 int
5301 main (void)
5302 {
5303 signal(SIGINT, handler);
5304                  x = 1
5305   ;
5306   return 0;
5307 }
5308 _ACEOF
5309 rm -f conftest.$ac_objext
5310 if { (eval echo "$as_me:5310: \"$ac_compile\"") >&5
5311   (eval $ac_compile) 2>&5
5312   ac_status=$?
5313   echo "$as_me:5313: \$? = $ac_status" >&5
5314   (exit $ac_status); } &&
5315          { ac_try='test -s conftest.$ac_objext'
5316   { (eval echo "$as_me:5316: \"$ac_try\"") >&5
5317   (eval $ac_try) 2>&5
5318   ac_status=$?
5319   echo "$as_me:5319: \$? = $ac_status" >&5
5320   (exit $ac_status); }; }; then
5321   cf_cv_sig_atomic_t=$cf_type
5322 else
5323   echo "$as_me: failed program was:" >&5
5324 cat conftest.$ac_ext >&5
5325 cf_cv_sig_atomic_t=no
5326 fi
5327 rm -f conftest.$ac_objext conftest.$ac_ext
5328                 test "$cf_cv_sig_atomic_t" != no && break
5329         done
5330
5331 fi
5332
5333 echo "$as_me:5333: result: $cf_cv_sig_atomic_t" >&5
5334 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5335 test "$cf_cv_sig_atomic_t" != no &&
5336 cat >>confdefs.h <<EOF
5337 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5338 EOF
5339
5340 # Work around breakage on OS X
5341
5342 echo "$as_me:5342: checking if SIGWINCH is defined" >&5
5343 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5344 if test "${cf_cv_define_sigwinch+set}" = set; then
5345   echo $ECHO_N "(cached) $ECHO_C" >&6
5346 else
5347
5348         cat >conftest.$ac_ext <<_ACEOF
5349 #line 5349 "configure"
5350 #include "confdefs.h"
5351
5352 #include <sys/types.h>
5353 #include <sys/signal.h>
5354
5355 int
5356 main (void)
5357 {
5358 int x = SIGWINCH
5359   ;
5360   return 0;
5361 }
5362 _ACEOF
5363 rm -f conftest.$ac_objext
5364 if { (eval echo "$as_me:5364: \"$ac_compile\"") >&5
5365   (eval $ac_compile) 2>&5
5366   ac_status=$?
5367   echo "$as_me:5367: \$? = $ac_status" >&5
5368   (exit $ac_status); } &&
5369          { ac_try='test -s conftest.$ac_objext'
5370   { (eval echo "$as_me:5370: \"$ac_try\"") >&5
5371   (eval $ac_try) 2>&5
5372   ac_status=$?
5373   echo "$as_me:5373: \$? = $ac_status" >&5
5374   (exit $ac_status); }; }; then
5375   cf_cv_define_sigwinch=yes
5376 else
5377   echo "$as_me: failed program was:" >&5
5378 cat conftest.$ac_ext >&5
5379 cat >conftest.$ac_ext <<_ACEOF
5380 #line 5380 "configure"
5381 #include "confdefs.h"
5382
5383 #undef _XOPEN_SOURCE
5384 #undef _POSIX_SOURCE
5385 #undef _POSIX_C_SOURCE
5386 #include <sys/types.h>
5387 #include <sys/signal.h>
5388
5389 int
5390 main (void)
5391 {
5392 int x = SIGWINCH
5393   ;
5394   return 0;
5395 }
5396 _ACEOF
5397 rm -f conftest.$ac_objext
5398 if { (eval echo "$as_me:5398: \"$ac_compile\"") >&5
5399   (eval $ac_compile) 2>&5
5400   ac_status=$?
5401   echo "$as_me:5401: \$? = $ac_status" >&5
5402   (exit $ac_status); } &&
5403          { ac_try='test -s conftest.$ac_objext'
5404   { (eval echo "$as_me:5404: \"$ac_try\"") >&5
5405   (eval $ac_try) 2>&5
5406   ac_status=$?
5407   echo "$as_me:5407: \$? = $ac_status" >&5
5408   (exit $ac_status); }; }; then
5409   cf_cv_define_sigwinch=maybe
5410 else
5411   echo "$as_me: failed program was:" >&5
5412 cat conftest.$ac_ext >&5
5413 cf_cv_define_sigwinch=no
5414 fi
5415 rm -f conftest.$ac_objext conftest.$ac_ext
5416
5417 fi
5418 rm -f conftest.$ac_objext conftest.$ac_ext
5419
5420 fi
5421 echo "$as_me:5421: result: $cf_cv_define_sigwinch" >&5
5422 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5423
5424 if test "$cf_cv_define_sigwinch" = maybe ; then
5425 echo "$as_me:5425: checking for actual SIGWINCH definition" >&5
5426 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5427 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5428   echo $ECHO_N "(cached) $ECHO_C" >&6
5429 else
5430
5431 cf_cv_fixup_sigwinch=unknown
5432 cf_sigwinch=32
5433 while test $cf_sigwinch != 1
5434 do
5435         cat >conftest.$ac_ext <<_ACEOF
5436 #line 5436 "configure"
5437 #include "confdefs.h"
5438
5439 #undef _XOPEN_SOURCE
5440 #undef _POSIX_SOURCE
5441 #undef _POSIX_C_SOURCE
5442 #include <sys/types.h>
5443 #include <sys/signal.h>
5444
5445 int
5446 main (void)
5447 {
5448
5449 #if SIGWINCH != $cf_sigwinch
5450 make an error
5451 #endif
5452 int x = SIGWINCH
5453   ;
5454   return 0;
5455 }
5456 _ACEOF
5457 rm -f conftest.$ac_objext
5458 if { (eval echo "$as_me:5458: \"$ac_compile\"") >&5
5459   (eval $ac_compile) 2>&5
5460   ac_status=$?
5461   echo "$as_me:5461: \$? = $ac_status" >&5
5462   (exit $ac_status); } &&
5463          { ac_try='test -s conftest.$ac_objext'
5464   { (eval echo "$as_me:5464: \"$ac_try\"") >&5
5465   (eval $ac_try) 2>&5
5466   ac_status=$?
5467   echo "$as_me:5467: \$? = $ac_status" >&5
5468   (exit $ac_status); }; }; then
5469   cf_cv_fixup_sigwinch=$cf_sigwinch
5470          break
5471 else
5472   echo "$as_me: failed program was:" >&5
5473 cat conftest.$ac_ext >&5
5474 fi
5475 rm -f conftest.$ac_objext conftest.$ac_ext
5476
5477 cf_sigwinch=`expr $cf_sigwinch - 1`
5478 done
5479
5480 fi
5481 echo "$as_me:5481: result: $cf_cv_fixup_sigwinch" >&5
5482 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5483
5484         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5485                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5486         fi
5487 fi
5488
5489 # Checks for CODESET support.
5490
5491 echo "$as_me:5491: checking for nl_langinfo and CODESET" >&5
5492 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5493 if test "${am_cv_langinfo_codeset+set}" = set; then
5494   echo $ECHO_N "(cached) $ECHO_C" >&6
5495 else
5496   cat >conftest.$ac_ext <<_ACEOF
5497 #line 5497 "configure"
5498 #include "confdefs.h"
5499 #include <langinfo.h>
5500 int
5501 main (void)
5502 {
5503 char* cs = nl_langinfo(CODESET);
5504   ;
5505   return 0;
5506 }
5507 _ACEOF
5508 rm -f conftest.$ac_objext conftest$ac_exeext
5509 if { (eval echo "$as_me:5509: \"$ac_link\"") >&5
5510   (eval $ac_link) 2>&5
5511   ac_status=$?
5512   echo "$as_me:5512: \$? = $ac_status" >&5
5513   (exit $ac_status); } &&
5514          { ac_try='test -s conftest$ac_exeext'
5515   { (eval echo "$as_me:5515: \"$ac_try\"") >&5
5516   (eval $ac_try) 2>&5
5517   ac_status=$?
5518   echo "$as_me:5518: \$? = $ac_status" >&5
5519   (exit $ac_status); }; }; then
5520   am_cv_langinfo_codeset=yes
5521 else
5522   echo "$as_me: failed program was:" >&5
5523 cat conftest.$ac_ext >&5
5524 am_cv_langinfo_codeset=no
5525 fi
5526 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5527
5528 fi
5529 echo "$as_me:5529: result: $am_cv_langinfo_codeset" >&5
5530 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5531         if test $am_cv_langinfo_codeset = yes; then
5532
5533 cat >>confdefs.h <<\EOF
5534 #define HAVE_LANGINFO_CODESET 1
5535 EOF
5536
5537         fi
5538
5539 echo "$as_me:5539: checking if you want to use pkg-config" >&5
5540 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5541
5542 # Check whether --with-pkg-config or --without-pkg-config was given.
5543 if test "${with_pkg_config+set}" = set; then
5544   withval="$with_pkg_config"
5545   cf_pkg_config=$withval
5546 else
5547   cf_pkg_config=yes
5548 fi;
5549 echo "$as_me:5549: result: $cf_pkg_config" >&5
5550 echo "${ECHO_T}$cf_pkg_config" >&6
5551
5552 case $cf_pkg_config in
5553 (no)
5554         PKG_CONFIG=none
5555         ;;
5556 (yes)
5557
5558 if test -n "$ac_tool_prefix"; then
5559   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5560 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5561 echo "$as_me:5561: checking for $ac_word" >&5
5562 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5563 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5564   echo $ECHO_N "(cached) $ECHO_C" >&6
5565 else
5566   case $PKG_CONFIG in
5567   [\\/]* | ?:[\\/]*)
5568   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5569   ;;
5570   *)
5571   ac_save_IFS=$IFS; IFS=$ac_path_separator
5572 ac_dummy="$PATH"
5573 for ac_dir in $ac_dummy; do
5574   IFS=$ac_save_IFS
5575   test -z "$ac_dir" && ac_dir=.
5576   if $as_executable_p "$ac_dir/$ac_word"; then
5577    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5578    echo "$as_me:5578: found $ac_dir/$ac_word" >&5
5579    break
5580 fi
5581 done
5582
5583   ;;
5584 esac
5585 fi
5586 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5587
5588 if test -n "$PKG_CONFIG"; then
5589   echo "$as_me:5589: result: $PKG_CONFIG" >&5
5590 echo "${ECHO_T}$PKG_CONFIG" >&6
5591 else
5592   echo "$as_me:5592: result: no" >&5
5593 echo "${ECHO_T}no" >&6
5594 fi
5595
5596 fi
5597 if test -z "$ac_cv_path_PKG_CONFIG"; then
5598   ac_pt_PKG_CONFIG=$PKG_CONFIG
5599   # Extract the first word of "pkg-config", so it can be a program name with args.
5600 set dummy pkg-config; ac_word=$2
5601 echo "$as_me:5601: checking for $ac_word" >&5
5602 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5603 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5604   echo $ECHO_N "(cached) $ECHO_C" >&6
5605 else
5606   case $ac_pt_PKG_CONFIG in
5607   [\\/]* | ?:[\\/]*)
5608   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5609   ;;
5610   *)
5611   ac_save_IFS=$IFS; IFS=$ac_path_separator
5612 ac_dummy="$PATH"
5613 for ac_dir in $ac_dummy; do
5614   IFS=$ac_save_IFS
5615   test -z "$ac_dir" && ac_dir=.
5616   if $as_executable_p "$ac_dir/$ac_word"; then
5617    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5618    echo "$as_me:5618: found $ac_dir/$ac_word" >&5
5619    break
5620 fi
5621 done
5622
5623   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5624   ;;
5625 esac
5626 fi
5627 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5628
5629 if test -n "$ac_pt_PKG_CONFIG"; then
5630   echo "$as_me:5630: result: $ac_pt_PKG_CONFIG" >&5
5631 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5632 else
5633   echo "$as_me:5633: result: no" >&5
5634 echo "${ECHO_T}no" >&6
5635 fi
5636
5637   PKG_CONFIG=$ac_pt_PKG_CONFIG
5638 else
5639   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5640 fi
5641
5642         ;;
5643 (*)
5644         PKG_CONFIG=$withval
5645         ;;
5646 esac
5647
5648 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5649 if test "$PKG_CONFIG" != none ; then
5650
5651 if test "x$prefix" != xNONE; then
5652         cf_path_syntax="$prefix"
5653 else
5654         cf_path_syntax="$ac_default_prefix"
5655 fi
5656
5657 case ".$PKG_CONFIG" in
5658 (.\$\(*\)*|.\'*\'*)
5659         ;;
5660 (..|./*|.\\*)
5661         ;;
5662 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5663         ;;
5664 (.\${*prefix}*|.\${*dir}*)
5665         eval PKG_CONFIG="$PKG_CONFIG"
5666         case ".$PKG_CONFIG" in
5667         (.NONE/*)
5668                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5669                 ;;
5670         esac
5671         ;;
5672 (.no|.NONE/*)
5673         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5674         ;;
5675 (*)
5676         { { echo "$as_me:5676: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5677 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5678    { (exit 1); exit 1; }; }
5679         ;;
5680 esac
5681
5682 elif test "x$cf_pkg_config" != xno ; then
5683         { echo "$as_me:5683: WARNING: pkg-config is not installed" >&5
5684 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5685 fi
5686
5687 echo "$as_me:5687: checking if you want to see long compiling messages" >&5
5688 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5689
5690 # Check whether --enable-echo or --disable-echo was given.
5691 if test "${enable_echo+set}" = set; then
5692   enableval="$enable_echo"
5693   test "$enableval" != no && enableval=yes
5694         if test "$enableval" != "yes" ; then
5695
5696         ECHO_LT='--silent'
5697         ECHO_LD='@echo linking $@;'
5698         RULE_CC='@echo compiling $<'
5699         SHOW_CC='@echo compiling $@'
5700         ECHO_CC='@'
5701
5702         else
5703
5704         ECHO_LT=''
5705         ECHO_LD=''
5706         RULE_CC=''
5707         SHOW_CC=''
5708         ECHO_CC=''
5709
5710         fi
5711 else
5712   enableval=yes
5713
5714         ECHO_LT=''
5715         ECHO_LD=''
5716         RULE_CC=''
5717         SHOW_CC=''
5718         ECHO_CC=''
5719
5720 fi;
5721 echo "$as_me:5721: result: $enableval" >&5
5722 echo "${ECHO_T}$enableval" >&6
5723
5724 echo "$as_me:5724: checking for ncurses wrap-prefix" >&5
5725 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5726
5727 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5728 if test "${with_ncurses_wrap_prefix+set}" = set; then
5729   withval="$with_ncurses_wrap_prefix"
5730   NCURSES_WRAP_PREFIX=$withval
5731 else
5732   NCURSES_WRAP_PREFIX=_nc_
5733 fi;
5734 echo "$as_me:5734: result: $NCURSES_WRAP_PREFIX" >&5
5735 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5736
5737 echo "$as_me:5737: checking if you want to check for wide-character functions" >&5
5738 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5739
5740 # Check whether --enable-widec or --disable-widec was given.
5741 if test "${enable_widec+set}" = set; then
5742   enableval="$enable_widec"
5743   test "$enableval" != no && enableval=yes
5744         if test "$enableval" != "yes" ; then
5745     cf_enable_widec=no
5746         else
5747                 cf_enable_widec=yes
5748         fi
5749 else
5750   enableval=yes
5751         cf_enable_widec=yes
5752
5753 fi;
5754 echo "$as_me:5754: result: $cf_enable_widec" >&5
5755 echo "${ECHO_T}$cf_enable_widec" >&6
5756
5757 echo "$as_me:5757: checking for specific curses-directory" >&5
5758 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5759
5760 # Check whether --with-curses-dir or --without-curses-dir was given.
5761 if test "${with_curses_dir+set}" = set; then
5762   withval="$with_curses_dir"
5763   cf_cv_curses_dir=$withval
5764 else
5765   cf_cv_curses_dir=no
5766 fi;
5767 echo "$as_me:5767: result: $cf_cv_curses_dir" >&5
5768 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5769
5770 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5771 then
5772
5773 if test "x$prefix" != xNONE; then
5774         cf_path_syntax="$prefix"
5775 else
5776         cf_path_syntax="$ac_default_prefix"
5777 fi
5778
5779 case ".$withval" in
5780 (.\$\(*\)*|.\'*\'*)
5781         ;;
5782 (..|./*|.\\*)
5783         ;;
5784 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5785         ;;
5786 (.\${*prefix}*|.\${*dir}*)
5787         eval withval="$withval"
5788         case ".$withval" in
5789         (.NONE/*)
5790                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5791                 ;;
5792         esac
5793         ;;
5794 (.no|.NONE/*)
5795         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5796         ;;
5797 (*)
5798         { { echo "$as_me:5798: error: expected a pathname, not \"$withval\"" >&5
5799 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5800    { (exit 1); exit 1; }; }
5801         ;;
5802 esac
5803
5804         if test -d "$cf_cv_curses_dir"
5805         then
5806
5807 if test -n "$cf_cv_curses_dir/include" ; then
5808   for cf_add_incdir in $cf_cv_curses_dir/include
5809   do
5810         while test $cf_add_incdir != /usr/include
5811         do
5812           if test -d $cf_add_incdir
5813           then
5814                 cf_have_incdir=no
5815                 if test -n "$CFLAGS$CPPFLAGS" ; then
5816                   # a loop is needed to ensure we can add subdirs of existing dirs
5817                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5818                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5819                           cf_have_incdir=yes; break
5820                         fi
5821                   done
5822                 fi
5823
5824                 if test "$cf_have_incdir" = no ; then
5825                   if test "$cf_add_incdir" = /usr/local/include ; then
5826                         if test "$GCC" = yes
5827                         then
5828                           cf_save_CPPFLAGS=$CPPFLAGS
5829
5830         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5831         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5832
5833                           cat >conftest.$ac_ext <<_ACEOF
5834 #line 5834 "configure"
5835 #include "confdefs.h"
5836 #include <stdio.h>
5837 int
5838 main (void)
5839 {
5840 printf("Hello")
5841   ;
5842   return 0;
5843 }
5844 _ACEOF
5845 rm -f conftest.$ac_objext
5846 if { (eval echo "$as_me:5846: \"$ac_compile\"") >&5
5847   (eval $ac_compile) 2>&5
5848   ac_status=$?
5849   echo "$as_me:5849: \$? = $ac_status" >&5
5850   (exit $ac_status); } &&
5851          { ac_try='test -s conftest.$ac_objext'
5852   { (eval echo "$as_me:5852: \"$ac_try\"") >&5
5853   (eval $ac_try) 2>&5
5854   ac_status=$?
5855   echo "$as_me:5855: \$? = $ac_status" >&5
5856   (exit $ac_status); }; }; then
5857   :
5858 else
5859   echo "$as_me: failed program was:" >&5
5860 cat conftest.$ac_ext >&5
5861 cf_have_incdir=yes
5862 fi
5863 rm -f conftest.$ac_objext conftest.$ac_ext
5864                           CPPFLAGS=$cf_save_CPPFLAGS
5865                         fi
5866                   fi
5867                 fi
5868
5869                 if test "$cf_have_incdir" = no ; then
5870                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5871
5872 echo "${as_me:-configure}:5872: testing adding $cf_add_incdir to include-path ..." 1>&5
5873
5874                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5875
5876                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5877                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5878                   cf_add_incdir="$cf_top_incdir"
5879                 else
5880                   break
5881                 fi
5882           else
5883                 break
5884           fi
5885         done
5886   done
5887 fi
5888
5889 if test -n "$cf_cv_curses_dir/lib" ; then
5890         for cf_add_libdir in $cf_cv_curses_dir/lib
5891         do
5892                 if test $cf_add_libdir = /usr/lib ; then
5893                         :
5894                 elif test -d $cf_add_libdir
5895                 then
5896                         cf_have_libdir=no
5897                         if test -n "$LDFLAGS$LIBS" ; then
5898                                 # a loop is needed to ensure we can add subdirs of existing dirs
5899                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5900                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5901                                                 cf_have_libdir=yes; break
5902                                         fi
5903                                 done
5904                         fi
5905                         if test "$cf_have_libdir" = no ; then
5906                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5907
5908 echo "${as_me:-configure}:5908: testing adding $cf_add_libdir to library-path ..." 1>&5
5909
5910                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5911                         fi
5912                 fi
5913         done
5914 fi
5915
5916         fi
5917 fi
5918
5919 cf_cv_screen=curses
5920
5921 echo "$as_me:5921: checking for specified curses library type" >&5
5922 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5923
5924 # Check whether --with-screen or --without-screen was given.
5925 if test "${with_screen+set}" = set; then
5926   withval="$with_screen"
5927   cf_cv_screen=$withval
5928 else
5929
5930 # Check whether --with-ncursesw or --without-ncursesw was given.
5931 if test "${with_ncursesw+set}" = set; then
5932   withval="$with_ncursesw"
5933   cf_cv_screen=ncursesw
5934 else
5935
5936 # Check whether --with-ncurses or --without-ncurses was given.
5937 if test "${with_ncurses+set}" = set; then
5938   withval="$with_ncurses"
5939   cf_cv_screen=ncurses
5940 else
5941
5942 # Check whether --with-pdcurses or --without-pdcurses was given.
5943 if test "${with_pdcurses+set}" = set; then
5944   withval="$with_pdcurses"
5945   cf_cv_screen=pdcurses
5946 else
5947
5948 # Check whether --with-curses-colr or --without-curses-colr was given.
5949 if test "${with_curses_colr+set}" = set; then
5950   withval="$with_curses_colr"
5951   cf_cv_screen=curses_colr
5952 else
5953
5954 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5955 if test "${with_curses_5lib+set}" = set; then
5956   withval="$with_curses_5lib"
5957   cf_cv_screen=curses_5lib
5958 fi;
5959 fi;
5960 fi;
5961 fi;
5962 fi;
5963 fi;
5964
5965 echo "$as_me:5965: result: $cf_cv_screen" >&5
5966 echo "${ECHO_T}$cf_cv_screen" >&6
5967
5968 case $cf_cv_screen in
5969 (curses|curses_*)
5970
5971 echo "$as_me:5971: checking for extra include directories" >&5
5972 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5973 if test "${cf_cv_curses_incdir+set}" = set; then
5974   echo $ECHO_N "(cached) $ECHO_C" >&6
5975 else
5976
5977 cf_cv_curses_incdir=no
5978 case $host_os in
5979 (hpux10.*)
5980         if test "x$cf_cv_screen" = "xcurses_colr"
5981         then
5982                 test -d /usr/include/curses_colr && \
5983                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5984         fi
5985         ;;
5986 (sunos3*|sunos4*)
5987         if test "x$cf_cv_screen" = "xcurses_5lib"
5988         then
5989                 test -d /usr/5lib && \
5990                 test -d /usr/5include && \
5991                 cf_cv_curses_incdir="-I/usr/5include"
5992         fi
5993         ;;
5994 esac
5995
5996 fi
5997 echo "$as_me:5997: result: $cf_cv_curses_incdir" >&5
5998 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5999 if test "$cf_cv_curses_incdir" != no
6000 then
6001
6002         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6003         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6004
6005 fi
6006
6007 echo "$as_me:6007: checking if we have identified curses headers" >&5
6008 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6009 if test "${cf_cv_ncurses_header+set}" = set; then
6010   echo $ECHO_N "(cached) $ECHO_C" >&6
6011 else
6012
6013 cf_cv_ncurses_header=none
6014 for cf_header in \
6015         ncurses.h  \
6016         curses.h  ncurses/ncurses.h ncurses/curses.h
6017 do
6018 cat >conftest.$ac_ext <<_ACEOF
6019 #line 6019 "configure"
6020 #include "confdefs.h"
6021 #include <${cf_header}>
6022 int
6023 main (void)
6024 {
6025 initscr(); tgoto("?", 0,0)
6026   ;
6027   return 0;
6028 }
6029 _ACEOF
6030 rm -f conftest.$ac_objext
6031 if { (eval echo "$as_me:6031: \"$ac_compile\"") >&5
6032   (eval $ac_compile) 2>&5
6033   ac_status=$?
6034   echo "$as_me:6034: \$? = $ac_status" >&5
6035   (exit $ac_status); } &&
6036          { ac_try='test -s conftest.$ac_objext'
6037   { (eval echo "$as_me:6037: \"$ac_try\"") >&5
6038   (eval $ac_try) 2>&5
6039   ac_status=$?
6040   echo "$as_me:6040: \$? = $ac_status" >&5
6041   (exit $ac_status); }; }; then
6042   cf_cv_ncurses_header=$cf_header; break
6043 else
6044   echo "$as_me: failed program was:" >&5
6045 cat conftest.$ac_ext >&5
6046 fi
6047 rm -f conftest.$ac_objext conftest.$ac_ext
6048 done
6049
6050 fi
6051 echo "$as_me:6051: result: $cf_cv_ncurses_header" >&5
6052 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6053
6054 if test "$cf_cv_ncurses_header" = none ; then
6055         { { echo "$as_me:6055: error: No curses header-files found" >&5
6056 echo "$as_me: error: No curses header-files found" >&2;}
6057    { (exit 1); exit 1; }; }
6058 fi
6059
6060 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6061
6062 for ac_header in $cf_cv_ncurses_header
6063 do
6064 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6065 echo "$as_me:6065: checking for $ac_header" >&5
6066 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6067 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6068   echo $ECHO_N "(cached) $ECHO_C" >&6
6069 else
6070   cat >conftest.$ac_ext <<_ACEOF
6071 #line 6071 "configure"
6072 #include "confdefs.h"
6073 #include <$ac_header>
6074 _ACEOF
6075 if { (eval echo "$as_me:6075: \"$ac_cpp conftest.$ac_ext\"") >&5
6076   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6077   ac_status=$?
6078   egrep -v '^ *\+' conftest.er1 >conftest.err
6079   rm -f conftest.er1
6080   cat conftest.err >&5
6081   echo "$as_me:6081: \$? = $ac_status" >&5
6082   (exit $ac_status); } >/dev/null; then
6083   if test -s conftest.err; then
6084     ac_cpp_err=$ac_c_preproc_warn_flag
6085   else
6086     ac_cpp_err=
6087   fi
6088 else
6089   ac_cpp_err=yes
6090 fi
6091 if test -z "$ac_cpp_err"; then
6092   eval "$as_ac_Header=yes"
6093 else
6094   echo "$as_me: failed program was:" >&5
6095   cat conftest.$ac_ext >&5
6096   eval "$as_ac_Header=no"
6097 fi
6098 rm -f conftest.err conftest.$ac_ext
6099 fi
6100 echo "$as_me:6100: result: `eval echo '${'$as_ac_Header'}'`" >&5
6101 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6102 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6103   cat >>confdefs.h <<EOF
6104 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6105 EOF
6106
6107 fi
6108 done
6109
6110 echo "$as_me:6110: checking for terminfo header" >&5
6111 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6112 if test "${cf_cv_term_header+set}" = set; then
6113   echo $ECHO_N "(cached) $ECHO_C" >&6
6114 else
6115
6116 case ${cf_cv_ncurses_header} in
6117 (*/ncurses.h|*/ncursesw.h)
6118         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6119         ;;
6120 (*)
6121         cf_term_header=term.h
6122         ;;
6123 esac
6124
6125 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6126 do
6127 cat >conftest.$ac_ext <<_ACEOF
6128 #line 6128 "configure"
6129 #include "confdefs.h"
6130 #include <stdio.h>
6131 #include <${cf_cv_ncurses_header:-curses.h}>
6132 #include <$cf_test>
6133
6134 int
6135 main (void)
6136 {
6137 int x = auto_left_margin
6138   ;
6139   return 0;
6140 }
6141 _ACEOF
6142 rm -f conftest.$ac_objext
6143 if { (eval echo "$as_me:6143: \"$ac_compile\"") >&5
6144   (eval $ac_compile) 2>&5
6145   ac_status=$?
6146   echo "$as_me:6146: \$? = $ac_status" >&5
6147   (exit $ac_status); } &&
6148          { ac_try='test -s conftest.$ac_objext'
6149   { (eval echo "$as_me:6149: \"$ac_try\"") >&5
6150   (eval $ac_try) 2>&5
6151   ac_status=$?
6152   echo "$as_me:6152: \$? = $ac_status" >&5
6153   (exit $ac_status); }; }; then
6154
6155         cf_cv_term_header="$cf_test"
6156 else
6157   echo "$as_me: failed program was:" >&5
6158 cat conftest.$ac_ext >&5
6159
6160         cf_cv_term_header=unknown
6161
6162 fi
6163 rm -f conftest.$ac_objext conftest.$ac_ext
6164         test "$cf_cv_term_header" != unknown && break
6165 done
6166
6167 fi
6168 echo "$as_me:6168: result: $cf_cv_term_header" >&5
6169 echo "${ECHO_T}$cf_cv_term_header" >&6
6170
6171 # Set definitions to allow ifdef'ing to accommodate subdirectories
6172
6173 case $cf_cv_term_header in
6174 (*term.h)
6175
6176 cat >>confdefs.h <<\EOF
6177 #define HAVE_TERM_H 1
6178 EOF
6179
6180         ;;
6181 esac
6182
6183 case $cf_cv_term_header in
6184 (ncurses/term.h)
6185
6186 cat >>confdefs.h <<\EOF
6187 #define HAVE_NCURSES_TERM_H 1
6188 EOF
6189
6190         ;;
6191 (ncursesw/term.h)
6192
6193 cat >>confdefs.h <<\EOF
6194 #define HAVE_NCURSESW_TERM_H 1
6195 EOF
6196
6197         ;;
6198 esac
6199
6200 echo "$as_me:6200: checking for ncurses version" >&5
6201 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6202 if test "${cf_cv_ncurses_version+set}" = set; then
6203   echo $ECHO_N "(cached) $ECHO_C" >&6
6204 else
6205
6206         cf_cv_ncurses_version=no
6207         cf_tempfile=out$$
6208         rm -f $cf_tempfile
6209         if test "$cross_compiling" = yes; then
6210
6211         # This will not work if the preprocessor splits the line after the
6212         # Autoconf token.  The 'unproto' program does that.
6213         cat > conftest.$ac_ext <<EOF
6214 #include <${cf_cv_ncurses_header:-curses.h}>
6215 #undef Autoconf
6216 #ifdef NCURSES_VERSION
6217 Autoconf NCURSES_VERSION
6218 #else
6219 #ifdef __NCURSES_H
6220 Autoconf "old"
6221 #endif
6222 ;
6223 #endif
6224 EOF
6225         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6226         { (eval echo "$as_me:6226: \"$cf_try\"") >&5
6227   (eval $cf_try) 2>&5
6228   ac_status=$?
6229   echo "$as_me:6229: \$? = $ac_status" >&5
6230   (exit $ac_status); }
6231         if test -f conftest.out ; then
6232                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6233                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6234                 rm -f conftest.out
6235         fi
6236
6237 else
6238   cat >conftest.$ac_ext <<_ACEOF
6239 #line 6239 "configure"
6240 #include "confdefs.h"
6241
6242 #include <${cf_cv_ncurses_header:-curses.h}>
6243 #include <stdio.h>
6244 int main(void)
6245 {
6246         FILE *fp = fopen("$cf_tempfile", "w");
6247 #ifdef NCURSES_VERSION
6248 # ifdef NCURSES_VERSION_PATCH
6249         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6250 # else
6251         fprintf(fp, "%s\n", NCURSES_VERSION);
6252 # endif
6253 #else
6254 # ifdef __NCURSES_H
6255         fprintf(fp, "old\n");
6256 # else
6257         make an error
6258 # endif
6259 #endif
6260         ${cf_cv_main_return:-return}(0);
6261 }
6262 _ACEOF
6263 rm -f conftest$ac_exeext
6264 if { (eval echo "$as_me:6264: \"$ac_link\"") >&5
6265   (eval $ac_link) 2>&5
6266   ac_status=$?
6267   echo "$as_me:6267: \$? = $ac_status" >&5
6268   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6269   { (eval echo "$as_me:6269: \"$ac_try\"") >&5
6270   (eval $ac_try) 2>&5
6271   ac_status=$?
6272   echo "$as_me:6272: \$? = $ac_status" >&5
6273   (exit $ac_status); }; }; then
6274
6275         cf_cv_ncurses_version=`cat $cf_tempfile`
6276 else
6277   echo "$as_me: program exited with status $ac_status" >&5
6278 echo "$as_me: failed program was:" >&5
6279 cat conftest.$ac_ext >&5
6280 fi
6281 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6282 fi
6283         rm -f $cf_tempfile
6284
6285 fi
6286 echo "$as_me:6286: result: $cf_cv_ncurses_version" >&5
6287 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6288 test "$cf_cv_ncurses_version" = no ||
6289 cat >>confdefs.h <<\EOF
6290 #define NCURSES 1
6291 EOF
6292
6293 echo "$as_me:6293: checking if we have identified curses libraries" >&5
6294 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6295 cat >conftest.$ac_ext <<_ACEOF
6296 #line 6296 "configure"
6297 #include "confdefs.h"
6298 #include <${cf_cv_ncurses_header:-curses.h}>
6299 int
6300 main (void)
6301 {
6302 initscr(); tgoto("?", 0,0)
6303   ;
6304   return 0;
6305 }
6306 _ACEOF
6307 rm -f conftest.$ac_objext conftest$ac_exeext
6308 if { (eval echo "$as_me:6308: \"$ac_link\"") >&5
6309   (eval $ac_link) 2>&5
6310   ac_status=$?
6311   echo "$as_me:6311: \$? = $ac_status" >&5
6312   (exit $ac_status); } &&
6313          { ac_try='test -s conftest$ac_exeext'
6314   { (eval echo "$as_me:6314: \"$ac_try\"") >&5
6315   (eval $ac_try) 2>&5
6316   ac_status=$?
6317   echo "$as_me:6317: \$? = $ac_status" >&5
6318   (exit $ac_status); }; }; then
6319   cf_result=yes
6320 else
6321   echo "$as_me: failed program was:" >&5
6322 cat conftest.$ac_ext >&5
6323 cf_result=no
6324 fi
6325 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6326 echo "$as_me:6326: result: $cf_result" >&5
6327 echo "${ECHO_T}$cf_result" >&6
6328
6329 if test "$cf_result" = no ; then
6330 case $host_os in
6331 (freebsd*)
6332         echo "$as_me:6332: checking for tgoto in -lmytinfo" >&5
6333 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6334 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6335   echo $ECHO_N "(cached) $ECHO_C" >&6
6336 else
6337   ac_check_lib_save_LIBS=$LIBS
6338 LIBS="-lmytinfo  $LIBS"
6339 cat >conftest.$ac_ext <<_ACEOF
6340 #line 6340 "configure"
6341 #include "confdefs.h"
6342
6343 /* Override any gcc2 internal prototype to avoid an error.  */
6344 #ifdef __cplusplus
6345 extern "C"
6346 #endif
6347 /* We use char because int might match the return type of a gcc2
6348    builtin and then its argument prototype would still apply.  */
6349 char tgoto ();
6350 int
6351 main (void)
6352 {
6353 tgoto ();
6354   ;
6355   return 0;
6356 }
6357 _ACEOF
6358 rm -f conftest.$ac_objext conftest$ac_exeext
6359 if { (eval echo "$as_me:6359: \"$ac_link\"") >&5
6360   (eval $ac_link) 2>&5
6361   ac_status=$?
6362   echo "$as_me:6362: \$? = $ac_status" >&5
6363   (exit $ac_status); } &&
6364          { ac_try='test -s conftest$ac_exeext'
6365   { (eval echo "$as_me:6365: \"$ac_try\"") >&5
6366   (eval $ac_try) 2>&5
6367   ac_status=$?
6368   echo "$as_me:6368: \$? = $ac_status" >&5
6369   (exit $ac_status); }; }; then
6370   ac_cv_lib_mytinfo_tgoto=yes
6371 else
6372   echo "$as_me: failed program was:" >&5
6373 cat conftest.$ac_ext >&5
6374 ac_cv_lib_mytinfo_tgoto=no
6375 fi
6376 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6377 LIBS=$ac_check_lib_save_LIBS
6378 fi
6379 echo "$as_me:6379: result: $ac_cv_lib_mytinfo_tgoto" >&5
6380 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6381 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6382
6383 cf_add_libs="$LIBS"
6384 # reverse order
6385 cf_add_0lib=
6386 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6387 # filter duplicates
6388 for cf_add_1lib in $cf_add_0lib; do
6389         for cf_add_2lib in $cf_add_libs; do
6390                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6391                         cf_add_1lib=
6392                         break
6393                 fi
6394         done
6395         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6396 done
6397 LIBS="$cf_add_libs"
6398
6399 fi
6400
6401         ;;
6402 (hpux10.*)
6403         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6404         # next (1998), and xcurses "newer" (2000).  There is no header file for
6405         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6406         # term.h) for cur_colr
6407         if test "x$cf_cv_screen" = "xcurses_colr"
6408         then
6409                 echo "$as_me:6409: checking for initscr in -lcur_colr" >&5
6410 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6411 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6412   echo $ECHO_N "(cached) $ECHO_C" >&6
6413 else
6414   ac_check_lib_save_LIBS=$LIBS
6415 LIBS="-lcur_colr  $LIBS"
6416 cat >conftest.$ac_ext <<_ACEOF
6417 #line 6417 "configure"
6418 #include "confdefs.h"
6419
6420 /* Override any gcc2 internal prototype to avoid an error.  */
6421 #ifdef __cplusplus
6422 extern "C"
6423 #endif
6424 /* We use char because int might match the return type of a gcc2
6425    builtin and then its argument prototype would still apply.  */
6426 char initscr ();
6427 int
6428 main (void)
6429 {
6430 initscr ();
6431   ;
6432   return 0;
6433 }
6434 _ACEOF
6435 rm -f conftest.$ac_objext conftest$ac_exeext
6436 if { (eval echo "$as_me:6436: \"$ac_link\"") >&5
6437   (eval $ac_link) 2>&5
6438   ac_status=$?
6439   echo "$as_me:6439: \$? = $ac_status" >&5
6440   (exit $ac_status); } &&
6441          { ac_try='test -s conftest$ac_exeext'
6442   { (eval echo "$as_me:6442: \"$ac_try\"") >&5
6443   (eval $ac_try) 2>&5
6444   ac_status=$?
6445   echo "$as_me:6445: \$? = $ac_status" >&5
6446   (exit $ac_status); }; }; then
6447   ac_cv_lib_cur_colr_initscr=yes
6448 else
6449   echo "$as_me: failed program was:" >&5
6450 cat conftest.$ac_ext >&5
6451 ac_cv_lib_cur_colr_initscr=no
6452 fi
6453 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6454 LIBS=$ac_check_lib_save_LIBS
6455 fi
6456 echo "$as_me:6456: result: $ac_cv_lib_cur_colr_initscr" >&5
6457 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6458 if test $ac_cv_lib_cur_colr_initscr = yes; then
6459
6460 cf_add_libs="$LIBS"
6461 # reverse order
6462 cf_add_0lib=
6463 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6464 # filter duplicates
6465 for cf_add_1lib in $cf_add_0lib; do
6466         for cf_add_2lib in $cf_add_libs; do
6467                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6468                         cf_add_1lib=
6469                         break
6470                 fi
6471         done
6472         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6473 done
6474 LIBS="$cf_add_libs"
6475
6476                         ac_cv_func_initscr=yes
6477
6478 else
6479
6480                 echo "$as_me:6480: checking for initscr in -lHcurses" >&5
6481 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6482 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6483   echo $ECHO_N "(cached) $ECHO_C" >&6
6484 else
6485   ac_check_lib_save_LIBS=$LIBS
6486 LIBS="-lHcurses  $LIBS"
6487 cat >conftest.$ac_ext <<_ACEOF
6488 #line 6488 "configure"
6489 #include "confdefs.h"
6490
6491 /* Override any gcc2 internal prototype to avoid an error.  */
6492 #ifdef __cplusplus
6493 extern "C"
6494 #endif
6495 /* We use char because int might match the return type of a gcc2
6496    builtin and then its argument prototype would still apply.  */
6497 char initscr ();
6498 int
6499 main (void)
6500 {
6501 initscr ();
6502   ;
6503   return 0;
6504 }
6505 _ACEOF
6506 rm -f conftest.$ac_objext conftest$ac_exeext
6507 if { (eval echo "$as_me:6507: \"$ac_link\"") >&5
6508   (eval $ac_link) 2>&5
6509   ac_status=$?
6510   echo "$as_me:6510: \$? = $ac_status" >&5
6511   (exit $ac_status); } &&
6512          { ac_try='test -s conftest$ac_exeext'
6513   { (eval echo "$as_me:6513: \"$ac_try\"") >&5
6514   (eval $ac_try) 2>&5
6515   ac_status=$?
6516   echo "$as_me:6516: \$? = $ac_status" >&5
6517   (exit $ac_status); }; }; then
6518   ac_cv_lib_Hcurses_initscr=yes
6519 else
6520   echo "$as_me: failed program was:" >&5
6521 cat conftest.$ac_ext >&5
6522 ac_cv_lib_Hcurses_initscr=no
6523 fi
6524 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6525 LIBS=$ac_check_lib_save_LIBS
6526 fi
6527 echo "$as_me:6527: result: $ac_cv_lib_Hcurses_initscr" >&5
6528 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6529 if test $ac_cv_lib_Hcurses_initscr = yes; then
6530
6531                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6532
6533 cf_add_libs="$LIBS"
6534 # reverse order
6535 cf_add_0lib=
6536 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6537 # filter duplicates
6538 for cf_add_1lib in $cf_add_0lib; do
6539         for cf_add_2lib in $cf_add_libs; do
6540                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6541                         cf_add_1lib=
6542                         break
6543                 fi
6544         done
6545         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6546 done
6547 LIBS="$cf_add_libs"
6548
6549         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6550         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6551
6552                         ac_cv_func_initscr=yes
6553
6554 fi
6555
6556 fi
6557
6558         fi
6559         ;;
6560 (linux*)
6561         case `arch 2>/dev/null` in
6562         (x86_64)
6563                 if test -d /lib64
6564                 then
6565
6566 if test -n "/lib64" ; then
6567         for cf_add_libdir in /lib64
6568         do
6569                 if test $cf_add_libdir = /usr/lib ; then
6570                         :
6571                 elif test -d $cf_add_libdir
6572                 then
6573                         cf_have_libdir=no
6574                         if test -n "$LDFLAGS$LIBS" ; then
6575                                 # a loop is needed to ensure we can add subdirs of existing dirs
6576                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6577                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6578                                                 cf_have_libdir=yes; break
6579                                         fi
6580                                 done
6581                         fi
6582                         if test "$cf_have_libdir" = no ; then
6583                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6584
6585 echo "${as_me:-configure}:6585: testing adding $cf_add_libdir to library-path ..." 1>&5
6586
6587                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6588                         fi
6589                 fi
6590         done
6591 fi
6592
6593                 else
6594
6595 if test -n "/lib" ; then
6596         for cf_add_libdir in /lib
6597         do
6598                 if test $cf_add_libdir = /usr/lib ; then
6599                         :
6600                 elif test -d $cf_add_libdir
6601                 then
6602                         cf_have_libdir=no
6603                         if test -n "$LDFLAGS$LIBS" ; then
6604                                 # a loop is needed to ensure we can add subdirs of existing dirs
6605                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6606                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6607                                                 cf_have_libdir=yes; break
6608                                         fi
6609                                 done
6610                         fi
6611                         if test "$cf_have_libdir" = no ; then
6612                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6613
6614 echo "${as_me:-configure}:6614: testing adding $cf_add_libdir to library-path ..." 1>&5
6615
6616                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6617                         fi
6618                 fi
6619         done
6620 fi
6621
6622                 fi
6623                 ;;
6624         (*)
6625
6626 if test -n "/lib" ; then
6627         for cf_add_libdir in /lib
6628         do
6629                 if test $cf_add_libdir = /usr/lib ; then
6630                         :
6631                 elif test -d $cf_add_libdir
6632                 then
6633                         cf_have_libdir=no
6634                         if test -n "$LDFLAGS$LIBS" ; then
6635                                 # a loop is needed to ensure we can add subdirs of existing dirs
6636                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6637                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6638                                                 cf_have_libdir=yes; break
6639                                         fi
6640                                 done
6641                         fi
6642                         if test "$cf_have_libdir" = no ; then
6643                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6644
6645 echo "${as_me:-configure}:6645: testing adding $cf_add_libdir to library-path ..." 1>&5
6646
6647                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6648                         fi
6649                 fi
6650         done
6651 fi
6652
6653                 ;;
6654         esac
6655         ;;
6656 (sunos3*|sunos4*)
6657         if test "x$cf_cv_screen" = "xcurses_5lib"
6658         then
6659                 if test -d /usr/5lib ; then
6660
6661 if test -n "/usr/5lib" ; then
6662         for cf_add_libdir in /usr/5lib
6663         do
6664                 if test $cf_add_libdir = /usr/lib ; then
6665                         :
6666                 elif test -d $cf_add_libdir
6667                 then
6668                         cf_have_libdir=no
6669                         if test -n "$LDFLAGS$LIBS" ; then
6670                                 # a loop is needed to ensure we can add subdirs of existing dirs
6671                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6672                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6673                                                 cf_have_libdir=yes; break
6674                                         fi
6675                                 done
6676                         fi
6677                         if test "$cf_have_libdir" = no ; then
6678                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6679
6680 echo "${as_me:-configure}:6680: testing adding $cf_add_libdir to library-path ..." 1>&5
6681
6682                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6683                         fi
6684                 fi
6685         done
6686 fi
6687
6688 cf_add_libs="$LIBS"
6689 # reverse order
6690 cf_add_0lib=
6691 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6692 # filter duplicates
6693 for cf_add_1lib in $cf_add_0lib; do
6694         for cf_add_2lib in $cf_add_libs; do
6695                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6696                         cf_add_1lib=
6697                         break
6698                 fi
6699         done
6700         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6701 done
6702 LIBS="$cf_add_libs"
6703
6704                 fi
6705         fi
6706         ac_cv_func_initscr=yes
6707         ;;
6708 esac
6709
6710 if test ".$ac_cv_func_initscr" != .yes ; then
6711         cf_save_LIBS="$LIBS"
6712
6713         if test ".${cf_cv_ncurses_version:-no}" != .no
6714         then
6715                 cf_check_list="ncurses curses cursesX"
6716         else
6717                 cf_check_list="cursesX curses ncurses"
6718         fi
6719
6720         # Check for library containing tgoto.  Do this before curses library
6721         # because it may be needed to link the test-case for initscr.
6722         if test "x$cf_term_lib" = x
6723         then
6724                 echo "$as_me:6724: checking for tgoto" >&5
6725 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6726 if test "${ac_cv_func_tgoto+set}" = set; then
6727   echo $ECHO_N "(cached) $ECHO_C" >&6
6728 else
6729   cat >conftest.$ac_ext <<_ACEOF
6730 #line 6730 "configure"
6731 #include "confdefs.h"
6732 #define tgoto autoconf_temporary
6733 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6734 #undef tgoto
6735
6736 #ifdef __cplusplus
6737 extern "C"
6738 #endif
6739
6740 /* We use char because int might match the return type of a gcc2
6741    builtin and then its argument prototype would still apply.  */
6742 char tgoto (void);
6743
6744 int
6745 main (void)
6746 {
6747
6748 /* The GNU C library defines stubs for functions which it implements
6749     to always fail with ENOSYS.  Some functions are actually named
6750     something starting with __ and the normal name is an alias.  */
6751 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6752 #error found stub for tgoto
6753 #endif
6754
6755         return tgoto ();
6756   ;
6757   return 0;
6758 }
6759 _ACEOF
6760 rm -f conftest.$ac_objext conftest$ac_exeext
6761 if { (eval echo "$as_me:6761: \"$ac_link\"") >&5
6762   (eval $ac_link) 2>&5
6763   ac_status=$?
6764   echo "$as_me:6764: \$? = $ac_status" >&5
6765   (exit $ac_status); } &&
6766          { ac_try='test -s conftest$ac_exeext'
6767   { (eval echo "$as_me:6767: \"$ac_try\"") >&5
6768   (eval $ac_try) 2>&5
6769   ac_status=$?
6770   echo "$as_me:6770: \$? = $ac_status" >&5
6771   (exit $ac_status); }; }; then
6772   ac_cv_func_tgoto=yes
6773 else
6774   echo "$as_me: failed program was:" >&5
6775 cat conftest.$ac_ext >&5
6776 ac_cv_func_tgoto=no
6777 fi
6778 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6779 fi
6780 echo "$as_me:6780: result: $ac_cv_func_tgoto" >&5
6781 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6782 if test $ac_cv_func_tgoto = yes; then
6783   cf_term_lib=predefined
6784 else
6785
6786                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6787                         do
6788                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6789 echo "$as_me:6789: checking for tgoto in -l$cf_term_lib" >&5
6790 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6791 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6792   echo $ECHO_N "(cached) $ECHO_C" >&6
6793 else
6794   ac_check_lib_save_LIBS=$LIBS
6795 LIBS="-l$cf_term_lib  $LIBS"
6796 cat >conftest.$ac_ext <<_ACEOF
6797 #line 6797 "configure"
6798 #include "confdefs.h"
6799
6800 /* Override any gcc2 internal prototype to avoid an error.  */
6801 #ifdef __cplusplus
6802 extern "C"
6803 #endif
6804 /* We use char because int might match the return type of a gcc2
6805    builtin and then its argument prototype would still apply.  */
6806 char tgoto ();
6807 int
6808 main (void)
6809 {
6810 tgoto ();
6811   ;
6812   return 0;
6813 }
6814 _ACEOF
6815 rm -f conftest.$ac_objext conftest$ac_exeext
6816 if { (eval echo "$as_me:6816: \"$ac_link\"") >&5
6817   (eval $ac_link) 2>&5
6818   ac_status=$?
6819   echo "$as_me:6819: \$? = $ac_status" >&5
6820   (exit $ac_status); } &&
6821          { ac_try='test -s conftest$ac_exeext'
6822   { (eval echo "$as_me:6822: \"$ac_try\"") >&5
6823   (eval $ac_try) 2>&5
6824   ac_status=$?
6825   echo "$as_me:6825: \$? = $ac_status" >&5
6826   (exit $ac_status); }; }; then
6827   eval "$as_ac_Lib=yes"
6828 else
6829   echo "$as_me: failed program was:" >&5
6830 cat conftest.$ac_ext >&5
6831 eval "$as_ac_Lib=no"
6832 fi
6833 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6834 LIBS=$ac_check_lib_save_LIBS
6835 fi
6836 echo "$as_me:6836: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6837 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6838 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6839
6840                                         : ${cf_nculib_root:=$cf_term_lib}
6841                                         break
6842
6843 fi
6844
6845                         done
6846
6847 fi
6848
6849         fi
6850
6851         # Check for library containing initscr
6852         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6853         if test "x$cf_curs_lib" = x
6854         then
6855                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6856                 do
6857                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6858                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6859                                 echo "$as_me:6859: checking if we can link with $cf_curs_lib library" >&5
6860 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6861                                 cat >conftest.$ac_ext <<_ACEOF
6862 #line 6862 "configure"
6863 #include "confdefs.h"
6864 #include <${cf_cv_ncurses_header:-curses.h}>
6865 int
6866 main (void)
6867 {
6868 initscr()
6869   ;
6870   return 0;
6871 }
6872 _ACEOF
6873 rm -f conftest.$ac_objext conftest$ac_exeext
6874 if { (eval echo "$as_me:6874: \"$ac_link\"") >&5
6875   (eval $ac_link) 2>&5
6876   ac_status=$?
6877   echo "$as_me:6877: \$? = $ac_status" >&5
6878   (exit $ac_status); } &&
6879          { ac_try='test -s conftest$ac_exeext'
6880   { (eval echo "$as_me:6880: \"$ac_try\"") >&5
6881   (eval $ac_try) 2>&5
6882   ac_status=$?
6883   echo "$as_me:6883: \$? = $ac_status" >&5
6884   (exit $ac_status); }; }; then
6885   cf_result=yes
6886 else
6887   echo "$as_me: failed program was:" >&5
6888 cat conftest.$ac_ext >&5
6889 cf_result=no
6890 fi
6891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6892                                 echo "$as_me:6892: result: $cf_result" >&5
6893 echo "${ECHO_T}$cf_result" >&6
6894                                 test $cf_result = yes && break
6895                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6896                                 cf_result=no
6897                         elif test "$cf_term_lib" != predefined ; then
6898                                 echo "$as_me:6898: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6899 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6900                                 cat >conftest.$ac_ext <<_ACEOF
6901 #line 6901 "configure"
6902 #include "confdefs.h"
6903 #include <${cf_cv_ncurses_header:-curses.h}>
6904 int
6905 main (void)
6906 {
6907 initscr(); tgoto((char *)0, 0, 0);
6908   ;
6909   return 0;
6910 }
6911 _ACEOF
6912 rm -f conftest.$ac_objext conftest$ac_exeext
6913 if { (eval echo "$as_me:6913: \"$ac_link\"") >&5
6914   (eval $ac_link) 2>&5
6915   ac_status=$?
6916   echo "$as_me:6916: \$? = $ac_status" >&5
6917   (exit $ac_status); } &&
6918          { ac_try='test -s conftest$ac_exeext'
6919   { (eval echo "$as_me:6919: \"$ac_try\"") >&5
6920   (eval $ac_try) 2>&5
6921   ac_status=$?
6922   echo "$as_me:6922: \$? = $ac_status" >&5
6923   (exit $ac_status); }; }; then
6924   cf_result=no
6925 else
6926   echo "$as_me: failed program was:" >&5
6927 cat conftest.$ac_ext >&5
6928
6929                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6930                                         cat >conftest.$ac_ext <<_ACEOF
6931 #line 6931 "configure"
6932 #include "confdefs.h"
6933 #include <${cf_cv_ncurses_header:-curses.h}>
6934 int
6935 main (void)
6936 {
6937 initscr()
6938   ;
6939   return 0;
6940 }
6941 _ACEOF
6942 rm -f conftest.$ac_objext conftest$ac_exeext
6943 if { (eval echo "$as_me:6943: \"$ac_link\"") >&5
6944   (eval $ac_link) 2>&5
6945   ac_status=$?
6946   echo "$as_me:6946: \$? = $ac_status" >&5
6947   (exit $ac_status); } &&
6948          { ac_try='test -s conftest$ac_exeext'
6949   { (eval echo "$as_me:6949: \"$ac_try\"") >&5
6950   (eval $ac_try) 2>&5
6951   ac_status=$?
6952   echo "$as_me:6952: \$? = $ac_status" >&5
6953   (exit $ac_status); }; }; then
6954   cf_result=yes
6955 else
6956   echo "$as_me: failed program was:" >&5
6957 cat conftest.$ac_ext >&5
6958 cf_result=error
6959 fi
6960 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6961
6962 fi
6963 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6964                                 echo "$as_me:6964: result: $cf_result" >&5
6965 echo "${ECHO_T}$cf_result" >&6
6966                                 test $cf_result != error && break
6967                         fi
6968                 done
6969         fi
6970         test $cf_curs_lib = unknown && { { echo "$as_me:6970: error: no curses library found" >&5
6971 echo "$as_me: error: no curses library found" >&2;}
6972    { (exit 1); exit 1; }; }
6973 fi
6974 fi
6975
6976         ;;
6977 (ncursesw*)
6978
6979 echo "$as_me:6979: checking for multibyte character support" >&5
6980 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6981 if test "${cf_cv_utf8_lib+set}" = set; then
6982   echo $ECHO_N "(cached) $ECHO_C" >&6
6983 else
6984
6985         cf_save_LIBS="$LIBS"
6986         cat >conftest.$ac_ext <<_ACEOF
6987 #line 6987 "configure"
6988 #include "confdefs.h"
6989
6990 #include <stdlib.h>
6991 int
6992 main (void)
6993 {
6994 putwc(0,0);
6995   ;
6996   return 0;
6997 }
6998 _ACEOF
6999 rm -f conftest.$ac_objext conftest$ac_exeext
7000 if { (eval echo "$as_me:7000: \"$ac_link\"") >&5
7001   (eval $ac_link) 2>&5
7002   ac_status=$?
7003   echo "$as_me:7003: \$? = $ac_status" >&5
7004   (exit $ac_status); } &&
7005          { ac_try='test -s conftest$ac_exeext'
7006   { (eval echo "$as_me:7006: \"$ac_try\"") >&5
7007   (eval $ac_try) 2>&5
7008   ac_status=$?
7009   echo "$as_me:7009: \$? = $ac_status" >&5
7010   (exit $ac_status); }; }; then
7011   cf_cv_utf8_lib=yes
7012 else
7013   echo "$as_me: failed program was:" >&5
7014 cat conftest.$ac_ext >&5
7015
7016 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7017 # will be set on completion of the AC_TRY_LINK below.
7018 cf_cv_header_path_utf8=
7019 cf_cv_library_path_utf8=
7020
7021 echo "${as_me:-configure}:7021: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7022
7023 cf_save_LIBS="$LIBS"
7024
7025 cat >conftest.$ac_ext <<_ACEOF
7026 #line 7026 "configure"
7027 #include "confdefs.h"
7028
7029 #include <libutf8.h>
7030 int
7031 main (void)
7032 {
7033 putwc(0,0);
7034   ;
7035   return 0;
7036 }
7037 _ACEOF
7038 rm -f conftest.$ac_objext conftest$ac_exeext
7039 if { (eval echo "$as_me:7039: \"$ac_link\"") >&5
7040   (eval $ac_link) 2>&5
7041   ac_status=$?
7042   echo "$as_me:7042: \$? = $ac_status" >&5
7043   (exit $ac_status); } &&
7044          { ac_try='test -s conftest$ac_exeext'
7045   { (eval echo "$as_me:7045: \"$ac_try\"") >&5
7046   (eval $ac_try) 2>&5
7047   ac_status=$?
7048   echo "$as_me:7048: \$? = $ac_status" >&5
7049   (exit $ac_status); }; }; then
7050
7051         cf_cv_find_linkage_utf8=yes
7052         cf_cv_header_path_utf8=/usr/include
7053         cf_cv_library_path_utf8=/usr/lib
7054
7055 else
7056   echo "$as_me: failed program was:" >&5
7057 cat conftest.$ac_ext >&5
7058
7059 LIBS="-lutf8  $cf_save_LIBS"
7060
7061 cat >conftest.$ac_ext <<_ACEOF
7062 #line 7062 "configure"
7063 #include "confdefs.h"
7064
7065 #include <libutf8.h>
7066 int
7067 main (void)
7068 {
7069 putwc(0,0);
7070   ;
7071   return 0;
7072 }
7073 _ACEOF
7074 rm -f conftest.$ac_objext conftest$ac_exeext
7075 if { (eval echo "$as_me:7075: \"$ac_link\"") >&5
7076   (eval $ac_link) 2>&5
7077   ac_status=$?
7078   echo "$as_me:7078: \$? = $ac_status" >&5
7079   (exit $ac_status); } &&
7080          { ac_try='test -s conftest$ac_exeext'
7081   { (eval echo "$as_me:7081: \"$ac_try\"") >&5
7082   (eval $ac_try) 2>&5
7083   ac_status=$?
7084   echo "$as_me:7084: \$? = $ac_status" >&5
7085   (exit $ac_status); }; }; then
7086
7087         cf_cv_find_linkage_utf8=yes
7088         cf_cv_header_path_utf8=/usr/include
7089         cf_cv_library_path_utf8=/usr/lib
7090         cf_cv_library_file_utf8="-lutf8"
7091
7092 else
7093   echo "$as_me: failed program was:" >&5
7094 cat conftest.$ac_ext >&5
7095
7096         cf_cv_find_linkage_utf8=no
7097         LIBS="$cf_save_LIBS"
7098
7099         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7100
7101 echo "${as_me:-configure}:7101: testing find linkage for utf8 library ..." 1>&5
7102
7103 echo "${as_me:-configure}:7103: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7104
7105         cf_save_CPPFLAGS="$CPPFLAGS"
7106         cf_test_CPPFLAGS="$CPPFLAGS"
7107
7108 cf_search=
7109
7110 # collect the current set of include-directories from compiler flags
7111 cf_header_path_list=""
7112 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7113         for cf_header_path in $CPPFLAGS $CFLAGS
7114         do
7115                 case $cf_header_path in
7116                 (-I*)
7117                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7118
7119 test "x$cf_header_path" != "xNONE" && \
7120 test -d "$cf_header_path" && \
7121  {
7122         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7123         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7124         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7125         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7126         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7127         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7128 }
7129
7130                         cf_header_path_list="$cf_header_path_list $cf_search"
7131                         ;;
7132                 esac
7133         done
7134 fi
7135
7136 # add the variations for the package we are looking for
7137
7138 cf_search=
7139
7140 test "x$prefix" != "xNONE" && \
7141 test -d "$prefix" && \
7142  {
7143         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7144         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7145         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7146         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7147         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7148         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7149 }
7150
7151 for cf_subdir_prefix in \
7152         /usr \
7153         /usr/local \
7154         /usr/pkg \
7155         /opt \
7156         /opt/local \
7157         $HOME
7158 do
7159
7160 test "x$cf_subdir_prefix" != "x$prefix" && \
7161 test -d "$cf_subdir_prefix" && \
7162 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7163         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7164         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7165         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7166         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7167         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7168         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7169 }
7170
7171 done
7172
7173 test "$includedir" != NONE && \
7174 test "$includedir" != "/usr/include" && \
7175 test -d "$includedir" && {
7176         test -d $includedir &&    cf_search="$cf_search $includedir"
7177         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7178 }
7179
7180 test "$oldincludedir" != NONE && \
7181 test "$oldincludedir" != "/usr/include" && \
7182 test -d "$oldincludedir" && {
7183         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7184         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7185 }
7186
7187 cf_search="$cf_search $cf_header_path_list"
7188
7189         for cf_cv_header_path_utf8 in $cf_search
7190         do
7191                 if test -d $cf_cv_header_path_utf8 ; then
7192                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7193
7194 echo "${as_me:-configure}:7194: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7195
7196                         CPPFLAGS="$cf_save_CPPFLAGS"
7197
7198         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7199         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7200
7201                         cat >conftest.$ac_ext <<_ACEOF
7202 #line 7202 "configure"
7203 #include "confdefs.h"
7204
7205 #include <libutf8.h>
7206 int
7207 main (void)
7208 {
7209 putwc(0,0);
7210   ;
7211   return 0;
7212 }
7213 _ACEOF
7214 rm -f conftest.$ac_objext
7215 if { (eval echo "$as_me:7215: \"$ac_compile\"") >&5
7216   (eval $ac_compile) 2>&5
7217   ac_status=$?
7218   echo "$as_me:7218: \$? = $ac_status" >&5
7219   (exit $ac_status); } &&
7220          { ac_try='test -s conftest.$ac_objext'
7221   { (eval echo "$as_me:7221: \"$ac_try\"") >&5
7222   (eval $ac_try) 2>&5
7223   ac_status=$?
7224   echo "$as_me:7224: \$? = $ac_status" >&5
7225   (exit $ac_status); }; }; then
7226
7227                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7228
7229 echo "${as_me:-configure}:7229: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7230
7231                                 cf_cv_find_linkage_utf8=maybe
7232                                 cf_test_CPPFLAGS="$CPPFLAGS"
7233                                 break
7234 else
7235   echo "$as_me: failed program was:" >&5
7236 cat conftest.$ac_ext >&5
7237
7238                                 CPPFLAGS="$cf_save_CPPFLAGS"
7239
7240 fi
7241 rm -f conftest.$ac_objext conftest.$ac_ext
7242                 fi
7243         done
7244
7245         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7246
7247 echo "${as_me:-configure}:7247: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7248
7249                 cf_save_LIBS="$LIBS"
7250                 cf_save_LDFLAGS="$LDFLAGS"
7251
7252                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7253
7254 cf_search=
7255 cf_library_path_list=""
7256 if test -n "${LDFLAGS}${LIBS}" ; then
7257         for cf_library_path in $LDFLAGS $LIBS
7258         do
7259                 case $cf_library_path in
7260                 (-L*)
7261                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7262
7263 test "x$cf_library_path" != "xNONE" && \
7264 test -d "$cf_library_path" && \
7265  {
7266         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7267         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7268         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7269         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7270         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7271         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7272 }
7273
7274                         cf_library_path_list="$cf_library_path_list $cf_search"
7275                         ;;
7276                 esac
7277         done
7278 fi
7279
7280 cf_search=
7281
7282 test "x$prefix" != "xNONE" && \
7283 test -d "$prefix" && \
7284  {
7285         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7286         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7287         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7288         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7289         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7290         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7291 }
7292
7293 for cf_subdir_prefix in \
7294         /usr \
7295         /usr/local \
7296         /usr/pkg \
7297         /opt \
7298         /opt/local \
7299         $HOME
7300 do
7301
7302 test "x$cf_subdir_prefix" != "x$prefix" && \
7303 test -d "$cf_subdir_prefix" && \
7304 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7305         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7306         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7307         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7308         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7309         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7310         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7311 }
7312
7313 done
7314
7315 cf_search="$cf_library_path_list $cf_search"
7316
7317                         for cf_cv_library_path_utf8 in $cf_search
7318                         do
7319                                 if test -d $cf_cv_library_path_utf8 ; then
7320                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7321
7322 echo "${as_me:-configure}:7322: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7323
7324                                         CPPFLAGS="$cf_test_CPPFLAGS"
7325                                         LIBS="-lutf8  $cf_save_LIBS"
7326                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7327                                         cat >conftest.$ac_ext <<_ACEOF
7328 #line 7328 "configure"
7329 #include "confdefs.h"
7330
7331 #include <libutf8.h>
7332 int
7333 main (void)
7334 {
7335 putwc(0,0);
7336   ;
7337   return 0;
7338 }
7339 _ACEOF
7340 rm -f conftest.$ac_objext conftest$ac_exeext
7341 if { (eval echo "$as_me:7341: \"$ac_link\"") >&5
7342   (eval $ac_link) 2>&5
7343   ac_status=$?
7344   echo "$as_me:7344: \$? = $ac_status" >&5
7345   (exit $ac_status); } &&
7346          { ac_try='test -s conftest$ac_exeext'
7347   { (eval echo "$as_me:7347: \"$ac_try\"") >&5
7348   (eval $ac_try) 2>&5
7349   ac_status=$?
7350   echo "$as_me:7350: \$? = $ac_status" >&5
7351   (exit $ac_status); }; }; then
7352
7353                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7354
7355 echo "${as_me:-configure}:7355: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7356
7357                                         cf_cv_find_linkage_utf8=yes
7358                                         cf_cv_library_file_utf8="-lutf8"
7359                                         break
7360 else
7361   echo "$as_me: failed program was:" >&5
7362 cat conftest.$ac_ext >&5
7363
7364                                         CPPFLAGS="$cf_save_CPPFLAGS"
7365                                         LIBS="$cf_save_LIBS"
7366                                         LDFLAGS="$cf_save_LDFLAGS"
7367
7368 fi
7369 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7370                                 fi
7371                         done
7372                         CPPFLAGS="$cf_save_CPPFLAGS"
7373                         LDFLAGS="$cf_save_LDFLAGS"
7374                 fi
7375
7376         else
7377                 cf_cv_find_linkage_utf8=no
7378         fi
7379
7380 fi
7381 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7382
7383 fi
7384 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7385
7386 LIBS="$cf_save_LIBS"
7387
7388 if test "$cf_cv_find_linkage_utf8" = yes ; then
7389 cf_cv_utf8_lib=add-on
7390 else
7391 cf_cv_utf8_lib=no
7392 fi
7393
7394 fi
7395 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7396 fi
7397 echo "$as_me:7397: result: $cf_cv_utf8_lib" >&5
7398 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7399
7400 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7401 # ncurses/ncursesw:
7402 if test "$cf_cv_utf8_lib" = "add-on" ; then
7403
7404 cat >>confdefs.h <<\EOF
7405 #define HAVE_LIBUTF8_H 1
7406 EOF
7407
7408 if test -n "$cf_cv_header_path_utf8" ; then
7409   for cf_add_incdir in $cf_cv_header_path_utf8
7410   do
7411         while test $cf_add_incdir != /usr/include
7412         do
7413           if test -d $cf_add_incdir
7414           then
7415                 cf_have_incdir=no
7416                 if test -n "$CFLAGS$CPPFLAGS" ; then
7417                   # a loop is needed to ensure we can add subdirs of existing dirs
7418                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7419                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7420                           cf_have_incdir=yes; break
7421                         fi
7422                   done
7423                 fi
7424
7425                 if test "$cf_have_incdir" = no ; then
7426                   if test "$cf_add_incdir" = /usr/local/include ; then
7427                         if test "$GCC" = yes
7428                         then
7429                           cf_save_CPPFLAGS=$CPPFLAGS
7430
7431         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7432         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7433
7434                           cat >conftest.$ac_ext <<_ACEOF
7435 #line 7435 "configure"
7436 #include "confdefs.h"
7437 #include <stdio.h>
7438 int
7439 main (void)
7440 {
7441 printf("Hello")
7442   ;
7443   return 0;
7444 }
7445 _ACEOF
7446 rm -f conftest.$ac_objext
7447 if { (eval echo "$as_me:7447: \"$ac_compile\"") >&5
7448   (eval $ac_compile) 2>&5
7449   ac_status=$?
7450   echo "$as_me:7450: \$? = $ac_status" >&5
7451   (exit $ac_status); } &&
7452          { ac_try='test -s conftest.$ac_objext'
7453   { (eval echo "$as_me:7453: \"$ac_try\"") >&5
7454   (eval $ac_try) 2>&5
7455   ac_status=$?
7456   echo "$as_me:7456: \$? = $ac_status" >&5
7457   (exit $ac_status); }; }; then
7458   :
7459 else
7460   echo "$as_me: failed program was:" >&5
7461 cat conftest.$ac_ext >&5
7462 cf_have_incdir=yes
7463 fi
7464 rm -f conftest.$ac_objext conftest.$ac_ext
7465                           CPPFLAGS=$cf_save_CPPFLAGS
7466                         fi
7467                   fi
7468                 fi
7469
7470                 if test "$cf_have_incdir" = no ; then
7471                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7472
7473 echo "${as_me:-configure}:7473: testing adding $cf_add_incdir to include-path ..." 1>&5
7474
7475                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7476
7477                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7478                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7479                   cf_add_incdir="$cf_top_incdir"
7480                 else
7481                   break
7482                 fi
7483           else
7484                 break
7485           fi
7486         done
7487   done
7488 fi
7489
7490 if test -n "$cf_cv_library_path_utf8" ; then
7491         for cf_add_libdir in $cf_cv_library_path_utf8
7492         do
7493                 if test $cf_add_libdir = /usr/lib ; then
7494                         :
7495                 elif test -d $cf_add_libdir
7496                 then
7497                         cf_have_libdir=no
7498                         if test -n "$LDFLAGS$LIBS" ; then
7499                                 # a loop is needed to ensure we can add subdirs of existing dirs
7500                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7501                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7502                                                 cf_have_libdir=yes; break
7503                                         fi
7504                                 done
7505                         fi
7506                         if test "$cf_have_libdir" = no ; then
7507                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7508
7509 echo "${as_me:-configure}:7509: testing adding $cf_add_libdir to library-path ..." 1>&5
7510
7511                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7512                         fi
7513                 fi
7514         done
7515 fi
7516
7517 cf_add_libs="$LIBS"
7518 # reverse order
7519 cf_add_0lib=
7520 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7521 # filter duplicates
7522 for cf_add_1lib in $cf_add_0lib; do
7523         for cf_add_2lib in $cf_add_libs; do
7524                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7525                         cf_add_1lib=
7526                         break
7527                 fi
7528         done
7529         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7530 done
7531 LIBS="$cf_add_libs"
7532
7533 fi
7534
7535 cf_ncuconfig_root=$cf_cv_screen
7536 cf_have_ncuconfig=no
7537
7538 if test "x${PKG_CONFIG:=none}" != xnone; then
7539         echo "$as_me:7539: checking pkg-config for $cf_ncuconfig_root" >&5
7540 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7541         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7542                 echo "$as_me:7542: result: yes" >&5
7543 echo "${ECHO_T}yes" >&6
7544
7545                 echo "$as_me:7545: checking if the $cf_ncuconfig_root package files work" >&5
7546 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7547                 cf_have_ncuconfig=unknown
7548
7549                 cf_save_CFLAGS="$CFLAGS"
7550                 cf_save_CPPFLAGS="$CPPFLAGS"
7551                 cf_save_LIBS="$LIBS"
7552
7553                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
7554                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
7555
7556                 # while -W for passing linker flags is prevalent, it is not "standard".
7557                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7558                 # incompatible _and_ non-standard -W option which gives an error.  Work
7559                 # around that pitfall.
7560                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7561                 (x*c[89]9@@*-W*)
7562
7563 cf_fix_cppflags=no
7564 cf_new_cflags=
7565 cf_new_cppflags=
7566 cf_new_extra_cppflags=
7567
7568 for cf_add_cflags in $cf_pkg_cflags
7569 do
7570 case $cf_fix_cppflags in
7571 (no)
7572         case $cf_add_cflags in
7573         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7574                 case $cf_add_cflags in
7575                 (-D*)
7576                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7577
7578                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7579                                 && test -z "${cf_tst_cflags}" \
7580                                 && cf_fix_cppflags=yes
7581
7582                         if test $cf_fix_cppflags = yes ; then
7583
7584         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7585         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7586
7587                                 continue
7588                         elif test "${cf_tst_cflags}" = "\"'" ; then
7589
7590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7592
7593                                 continue
7594                         fi
7595                         ;;
7596                 esac
7597                 case "$CPPFLAGS" in
7598                 (*$cf_add_cflags)
7599                         ;;
7600                 (*)
7601                         case $cf_add_cflags in
7602                         (-D*)
7603                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7604
7605 CPPFLAGS=`echo "$CPPFLAGS" | \
7606         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7607                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7608
7609                                 ;;
7610                         esac
7611
7612         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7613         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7614
7615                         ;;
7616                 esac
7617                 ;;
7618         (*)
7619
7620         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7621         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7622
7623                 ;;
7624         esac
7625         ;;
7626 (yes)
7627
7628         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7629         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7630
7631         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7632
7633         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7634                 && test -z "${cf_tst_cflags}" \
7635                 && cf_fix_cppflags=no
7636         ;;
7637 esac
7638 done
7639
7640 if test -n "$cf_new_cflags" ; then
7641
7642         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7643         CFLAGS="${CFLAGS}$cf_new_cflags"
7644
7645 fi
7646
7647 if test -n "$cf_new_cppflags" ; then
7648
7649         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7650         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7651
7652 fi
7653
7654 if test -n "$cf_new_extra_cppflags" ; then
7655
7656         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7657         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7658
7659 fi
7660
7661 cf_add_libs="$LIBS"
7662 # reverse order
7663 cf_add_0lib=
7664 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7665 # filter duplicates
7666 for cf_add_1lib in $cf_add_0lib; do
7667         for cf_add_2lib in $cf_add_libs; do
7668                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7669                         cf_add_1lib=
7670                         break
7671                 fi
7672         done
7673         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7674 done
7675 LIBS="$cf_add_libs"
7676
7677                         cat >conftest.$ac_ext <<_ACEOF
7678 #line 7678 "configure"
7679 #include "confdefs.h"
7680 #include <${cf_cv_ncurses_header:-curses.h}>
7681 int
7682 main (void)
7683 {
7684 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7685   ;
7686   return 0;
7687 }
7688 _ACEOF
7689 rm -f conftest.$ac_objext conftest$ac_exeext
7690 if { (eval echo "$as_me:7690: \"$ac_link\"") >&5
7691   (eval $ac_link) 2>&5
7692   ac_status=$?
7693   echo "$as_me:7693: \$? = $ac_status" >&5
7694   (exit $ac_status); } &&
7695          { ac_try='test -s conftest$ac_exeext'
7696   { (eval echo "$as_me:7696: \"$ac_try\"") >&5
7697   (eval $ac_try) 2>&5
7698   ac_status=$?
7699   echo "$as_me:7699: \$? = $ac_status" >&5
7700   (exit $ac_status); }; }; then
7701   if test "$cross_compiling" = yes; then
7702   cf_test_ncuconfig=maybe
7703 else
7704   cat >conftest.$ac_ext <<_ACEOF
7705 #line 7705 "configure"
7706 #include "confdefs.h"
7707 #include <${cf_cv_ncurses_header:-curses.h}>
7708                                         int main(void)
7709                                         { char *xx = curses_version(); return (xx == 0); }
7710 _ACEOF
7711 rm -f conftest$ac_exeext
7712 if { (eval echo "$as_me:7712: \"$ac_link\"") >&5
7713   (eval $ac_link) 2>&5
7714   ac_status=$?
7715   echo "$as_me:7715: \$? = $ac_status" >&5
7716   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7717   { (eval echo "$as_me:7717: \"$ac_try\"") >&5
7718   (eval $ac_try) 2>&5
7719   ac_status=$?
7720   echo "$as_me:7720: \$? = $ac_status" >&5
7721   (exit $ac_status); }; }; then
7722   cf_test_ncuconfig=yes
7723 else
7724   echo "$as_me: program exited with status $ac_status" >&5
7725 echo "$as_me: failed program was:" >&5
7726 cat conftest.$ac_ext >&5
7727 cf_test_ncuconfig=no
7728 fi
7729 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7730 fi
7731 else
7732   echo "$as_me: failed program was:" >&5
7733 cat conftest.$ac_ext >&5
7734 cf_test_ncuconfig=no
7735 fi
7736 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7737
7738                         CFLAGS="$cf_save_CFLAGS"
7739                         CPPFLAGS="$cf_save_CPPFLAGS"
7740                         LIBS="$cf_save_LIBS"
7741
7742                         if test "x$cf_test_ncuconfig" != xyes; then
7743                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7744                                 cf_pkg_cflags="$cf_temp"
7745                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7746                                 cf_pkg_libs="$cf_temp"
7747                         fi
7748                         ;;
7749                 esac
7750
7751 cf_fix_cppflags=no
7752 cf_new_cflags=
7753 cf_new_cppflags=
7754 cf_new_extra_cppflags=
7755
7756 for cf_add_cflags in $cf_pkg_cflags
7757 do
7758 case $cf_fix_cppflags in
7759 (no)
7760         case $cf_add_cflags in
7761         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7762                 case $cf_add_cflags in
7763                 (-D*)
7764                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7765
7766                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7767                                 && test -z "${cf_tst_cflags}" \
7768                                 && cf_fix_cppflags=yes
7769
7770                         if test $cf_fix_cppflags = yes ; then
7771
7772         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7773         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7774
7775                                 continue
7776                         elif test "${cf_tst_cflags}" = "\"'" ; then
7777
7778         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7779         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7780
7781                                 continue
7782                         fi
7783                         ;;
7784                 esac
7785                 case "$CPPFLAGS" in
7786                 (*$cf_add_cflags)
7787                         ;;
7788                 (*)
7789                         case $cf_add_cflags in
7790                         (-D*)
7791                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7792
7793 CPPFLAGS=`echo "$CPPFLAGS" | \
7794         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7795                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7796
7797                                 ;;
7798                         esac
7799
7800         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7801         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7802
7803                         ;;
7804                 esac
7805                 ;;
7806         (*)
7807
7808         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7809         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7810
7811                 ;;
7812         esac
7813         ;;
7814 (yes)
7815
7816         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7817         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7818
7819         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7820
7821         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7822                 && test -z "${cf_tst_cflags}" \
7823                 && cf_fix_cppflags=no
7824         ;;
7825 esac
7826 done
7827
7828 if test -n "$cf_new_cflags" ; then
7829
7830         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7831         CFLAGS="${CFLAGS}$cf_new_cflags"
7832
7833 fi
7834
7835 if test -n "$cf_new_cppflags" ; then
7836
7837         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7838         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7839
7840 fi
7841
7842 if test -n "$cf_new_extra_cppflags" ; then
7843
7844         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7845         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7846
7847 fi
7848
7849 cf_add_libs="$LIBS"
7850 # reverse order
7851 cf_add_0lib=
7852 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7853 # filter duplicates
7854 for cf_add_1lib in $cf_add_0lib; do
7855         for cf_add_2lib in $cf_add_libs; do
7856                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7857                         cf_add_1lib=
7858                         break
7859                 fi
7860         done
7861         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7862 done
7863 LIBS="$cf_add_libs"
7864
7865                 cat >conftest.$ac_ext <<_ACEOF
7866 #line 7866 "configure"
7867 #include "confdefs.h"
7868 #include <${cf_cv_ncurses_header:-curses.h}>
7869 int
7870 main (void)
7871 {
7872 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7873   ;
7874   return 0;
7875 }
7876 _ACEOF
7877 rm -f conftest.$ac_objext conftest$ac_exeext
7878 if { (eval echo "$as_me:7878: \"$ac_link\"") >&5
7879   (eval $ac_link) 2>&5
7880   ac_status=$?
7881   echo "$as_me:7881: \$? = $ac_status" >&5
7882   (exit $ac_status); } &&
7883          { ac_try='test -s conftest$ac_exeext'
7884   { (eval echo "$as_me:7884: \"$ac_try\"") >&5
7885   (eval $ac_try) 2>&5
7886   ac_status=$?
7887   echo "$as_me:7887: \$? = $ac_status" >&5
7888   (exit $ac_status); }; }; then
7889   if test "$cross_compiling" = yes; then
7890   cf_have_ncuconfig=maybe
7891 else
7892   cat >conftest.$ac_ext <<_ACEOF
7893 #line 7893 "configure"
7894 #include "confdefs.h"
7895 #include <${cf_cv_ncurses_header:-curses.h}>
7896                                 int main(void)
7897                                 { char *xx = curses_version(); return (xx == 0); }
7898 _ACEOF
7899 rm -f conftest$ac_exeext
7900 if { (eval echo "$as_me:7900: \"$ac_link\"") >&5
7901   (eval $ac_link) 2>&5
7902   ac_status=$?
7903   echo "$as_me:7903: \$? = $ac_status" >&5
7904   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7905   { (eval echo "$as_me:7905: \"$ac_try\"") >&5
7906   (eval $ac_try) 2>&5
7907   ac_status=$?
7908   echo "$as_me:7908: \$? = $ac_status" >&5
7909   (exit $ac_status); }; }; then
7910   cf_have_ncuconfig=yes
7911 else
7912   echo "$as_me: program exited with status $ac_status" >&5
7913 echo "$as_me: failed program was:" >&5
7914 cat conftest.$ac_ext >&5
7915 cf_have_ncuconfig=no
7916 fi
7917 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7918 fi
7919 else
7920   echo "$as_me: failed program was:" >&5
7921 cat conftest.$ac_ext >&5
7922 cf_have_ncuconfig=no
7923 fi
7924 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7925                 echo "$as_me:7925: result: $cf_have_ncuconfig" >&5
7926 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7927                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7928                 if test "$cf_have_ncuconfig" != "yes"
7929                 then
7930                         CPPFLAGS="$cf_save_CPPFLAGS"
7931                         LIBS="$cf_save_LIBS"
7932                         NCURSES_CONFIG_PKG=none
7933                 else
7934
7935 cat >>confdefs.h <<\EOF
7936 #define NCURSES 1
7937 EOF
7938
7939                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7940
7941 echo "$as_me:7941: checking for terminfo header" >&5
7942 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7943 if test "${cf_cv_term_header+set}" = set; then
7944   echo $ECHO_N "(cached) $ECHO_C" >&6
7945 else
7946
7947 case ${cf_cv_ncurses_header} in
7948 (*/ncurses.h|*/ncursesw.h)
7949         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7950         ;;
7951 (*)
7952         cf_term_header=term.h
7953         ;;
7954 esac
7955
7956 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7957 do
7958 cat >conftest.$ac_ext <<_ACEOF
7959 #line 7959 "configure"
7960 #include "confdefs.h"
7961 #include <stdio.h>
7962 #include <${cf_cv_ncurses_header:-curses.h}>
7963 #include <$cf_test>
7964
7965 int
7966 main (void)
7967 {
7968 int x = auto_left_margin
7969   ;
7970   return 0;
7971 }
7972 _ACEOF
7973 rm -f conftest.$ac_objext
7974 if { (eval echo "$as_me:7974: \"$ac_compile\"") >&5
7975   (eval $ac_compile) 2>&5
7976   ac_status=$?
7977   echo "$as_me:7977: \$? = $ac_status" >&5
7978   (exit $ac_status); } &&
7979          { ac_try='test -s conftest.$ac_objext'
7980   { (eval echo "$as_me:7980: \"$ac_try\"") >&5
7981   (eval $ac_try) 2>&5
7982   ac_status=$?
7983   echo "$as_me:7983: \$? = $ac_status" >&5
7984   (exit $ac_status); }; }; then
7985
7986         cf_cv_term_header="$cf_test"
7987 else
7988   echo "$as_me: failed program was:" >&5
7989 cat conftest.$ac_ext >&5
7990
7991         cf_cv_term_header=unknown
7992
7993 fi
7994 rm -f conftest.$ac_objext conftest.$ac_ext
7995         test "$cf_cv_term_header" != unknown && break
7996 done
7997
7998 fi
7999 echo "$as_me:7999: result: $cf_cv_term_header" >&5
8000 echo "${ECHO_T}$cf_cv_term_header" >&6
8001
8002 # Set definitions to allow ifdef'ing to accommodate subdirectories
8003
8004 case $cf_cv_term_header in
8005 (*term.h)
8006
8007 cat >>confdefs.h <<\EOF
8008 #define HAVE_TERM_H 1
8009 EOF
8010
8011         ;;
8012 esac
8013
8014 case $cf_cv_term_header in
8015 (ncurses/term.h)
8016
8017 cat >>confdefs.h <<\EOF
8018 #define HAVE_NCURSES_TERM_H 1
8019 EOF
8020
8021         ;;
8022 (ncursesw/term.h)
8023
8024 cat >>confdefs.h <<\EOF
8025 #define HAVE_NCURSESW_TERM_H 1
8026 EOF
8027
8028         ;;
8029 esac
8030
8031                 fi
8032
8033         else
8034                 echo "$as_me:8034: result: no" >&5
8035 echo "${ECHO_T}no" >&6
8036                 NCURSES_CONFIG_PKG=none
8037         fi
8038 else
8039         NCURSES_CONFIG_PKG=none
8040 fi
8041
8042 if test "x$cf_have_ncuconfig" = "xno"; then
8043         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8044
8045 if test -n "$ac_tool_prefix"; then
8046   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8047   do
8048     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8049 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8050 echo "$as_me:8050: checking for $ac_word" >&5
8051 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8052 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8053   echo $ECHO_N "(cached) $ECHO_C" >&6
8054 else
8055   if test -n "$NCURSES_CONFIG"; then
8056   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8057 else
8058   ac_save_IFS=$IFS; IFS=$ac_path_separator
8059 ac_dummy="$PATH"
8060 for ac_dir in $ac_dummy; do
8061   IFS=$ac_save_IFS
8062   test -z "$ac_dir" && ac_dir=.
8063   $as_executable_p "$ac_dir/$ac_word" || continue
8064 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8065 echo "$as_me:8065: found $ac_dir/$ac_word" >&5
8066 break
8067 done
8068
8069 fi
8070 fi
8071 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8072 if test -n "$NCURSES_CONFIG"; then
8073   echo "$as_me:8073: result: $NCURSES_CONFIG" >&5
8074 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8075 else
8076   echo "$as_me:8076: result: no" >&5
8077 echo "${ECHO_T}no" >&6
8078 fi
8079
8080     test -n "$NCURSES_CONFIG" && break
8081   done
8082 fi
8083 if test -z "$NCURSES_CONFIG"; then
8084   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8085   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8086 do
8087   # Extract the first word of "$ac_prog", so it can be a program name with args.
8088 set dummy $ac_prog; ac_word=$2
8089 echo "$as_me:8089: checking for $ac_word" >&5
8090 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8091 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8092   echo $ECHO_N "(cached) $ECHO_C" >&6
8093 else
8094   if test -n "$ac_ct_NCURSES_CONFIG"; then
8095   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8096 else
8097   ac_save_IFS=$IFS; IFS=$ac_path_separator
8098 ac_dummy="$PATH"
8099 for ac_dir in $ac_dummy; do
8100   IFS=$ac_save_IFS
8101   test -z "$ac_dir" && ac_dir=.
8102   $as_executable_p "$ac_dir/$ac_word" || continue
8103 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8104 echo "$as_me:8104: found $ac_dir/$ac_word" >&5
8105 break
8106 done
8107
8108 fi
8109 fi
8110 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8111 if test -n "$ac_ct_NCURSES_CONFIG"; then
8112   echo "$as_me:8112: result: $ac_ct_NCURSES_CONFIG" >&5
8113 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8114 else
8115   echo "$as_me:8115: result: no" >&5
8116 echo "${ECHO_T}no" >&6
8117 fi
8118
8119   test -n "$ac_ct_NCURSES_CONFIG" && break
8120 done
8121 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8122
8123   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8124 fi
8125
8126         if test "$NCURSES_CONFIG" != none ; then
8127
8128 cf_fix_cppflags=no
8129 cf_new_cflags=
8130 cf_new_cppflags=
8131 cf_new_extra_cppflags=
8132
8133 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8134 do
8135 case $cf_fix_cppflags in
8136 (no)
8137         case $cf_add_cflags in
8138         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8139                 case $cf_add_cflags in
8140                 (-D*)
8141                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8142
8143                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8144                                 && test -z "${cf_tst_cflags}" \
8145                                 && cf_fix_cppflags=yes
8146
8147                         if test $cf_fix_cppflags = yes ; then
8148
8149         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8150         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8151
8152                                 continue
8153                         elif test "${cf_tst_cflags}" = "\"'" ; then
8154
8155         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8156         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8157
8158                                 continue
8159                         fi
8160                         ;;
8161                 esac
8162                 case "$CPPFLAGS" in
8163                 (*$cf_add_cflags)
8164                         ;;
8165                 (*)
8166                         case $cf_add_cflags in
8167                         (-D*)
8168                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8169
8170 CPPFLAGS=`echo "$CPPFLAGS" | \
8171         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8172                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8173
8174                                 ;;
8175                         esac
8176
8177         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8178         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8179
8180                         ;;
8181                 esac
8182                 ;;
8183         (*)
8184
8185         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8186         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8187
8188                 ;;
8189         esac
8190         ;;
8191 (yes)
8192
8193         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8194         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8195
8196         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8197
8198         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8199                 && test -z "${cf_tst_cflags}" \
8200                 && cf_fix_cppflags=no
8201         ;;
8202 esac
8203 done
8204
8205 if test -n "$cf_new_cflags" ; then
8206
8207         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8208         CFLAGS="${CFLAGS}$cf_new_cflags"
8209
8210 fi
8211
8212 if test -n "$cf_new_cppflags" ; then
8213
8214         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8215         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8216
8217 fi
8218
8219 if test -n "$cf_new_extra_cppflags" ; then
8220
8221         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8222         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8223
8224 fi
8225
8226 cf_add_libs="$LIBS"
8227 # reverse order
8228 cf_add_0lib=
8229 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8230 # filter duplicates
8231 for cf_add_1lib in $cf_add_0lib; do
8232         for cf_add_2lib in $cf_add_libs; do
8233                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8234                         cf_add_1lib=
8235                         break
8236                 fi
8237         done
8238         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8239 done
8240 LIBS="$cf_add_libs"
8241
8242                 # even with config script, some packages use no-override for curses.h
8243
8244 echo "$as_me:8244: checking if we have identified curses headers" >&5
8245 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8246 if test "${cf_cv_ncurses_header+set}" = set; then
8247   echo $ECHO_N "(cached) $ECHO_C" >&6
8248 else
8249
8250 cf_cv_ncurses_header=none
8251 for cf_header in \
8252         ncurses.h $cf_cv_screen/ncurses.h \
8253         curses.h $cf_cv_screen/curses.h
8254 do
8255 cat >conftest.$ac_ext <<_ACEOF
8256 #line 8256 "configure"
8257 #include "confdefs.h"
8258 #include <${cf_header}>
8259 int
8260 main (void)
8261 {
8262 initscr(); tgoto("?", 0,0)
8263   ;
8264   return 0;
8265 }
8266 _ACEOF
8267 rm -f conftest.$ac_objext
8268 if { (eval echo "$as_me:8268: \"$ac_compile\"") >&5
8269   (eval $ac_compile) 2>&5
8270   ac_status=$?
8271   echo "$as_me:8271: \$? = $ac_status" >&5
8272   (exit $ac_status); } &&
8273          { ac_try='test -s conftest.$ac_objext'
8274   { (eval echo "$as_me:8274: \"$ac_try\"") >&5
8275   (eval $ac_try) 2>&5
8276   ac_status=$?
8277   echo "$as_me:8277: \$? = $ac_status" >&5
8278   (exit $ac_status); }; }; then
8279   cf_cv_ncurses_header=$cf_header; break
8280 else
8281   echo "$as_me: failed program was:" >&5
8282 cat conftest.$ac_ext >&5
8283 fi
8284 rm -f conftest.$ac_objext conftest.$ac_ext
8285 done
8286
8287 fi
8288 echo "$as_me:8288: result: $cf_cv_ncurses_header" >&5
8289 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8290
8291 if test "$cf_cv_ncurses_header" = none ; then
8292         { { echo "$as_me:8292: error: No curses header-files found" >&5
8293 echo "$as_me: error: No curses header-files found" >&2;}
8294    { (exit 1); exit 1; }; }
8295 fi
8296
8297 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8298
8299 for ac_header in $cf_cv_ncurses_header
8300 do
8301 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8302 echo "$as_me:8302: checking for $ac_header" >&5
8303 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8304 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8305   echo $ECHO_N "(cached) $ECHO_C" >&6
8306 else
8307   cat >conftest.$ac_ext <<_ACEOF
8308 #line 8308 "configure"
8309 #include "confdefs.h"
8310 #include <$ac_header>
8311 _ACEOF
8312 if { (eval echo "$as_me:8312: \"$ac_cpp conftest.$ac_ext\"") >&5
8313   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8314   ac_status=$?
8315   egrep -v '^ *\+' conftest.er1 >conftest.err
8316   rm -f conftest.er1
8317   cat conftest.err >&5
8318   echo "$as_me:8318: \$? = $ac_status" >&5
8319   (exit $ac_status); } >/dev/null; then
8320   if test -s conftest.err; then
8321     ac_cpp_err=$ac_c_preproc_warn_flag
8322   else
8323     ac_cpp_err=
8324   fi
8325 else
8326   ac_cpp_err=yes
8327 fi
8328 if test -z "$ac_cpp_err"; then
8329   eval "$as_ac_Header=yes"
8330 else
8331   echo "$as_me: failed program was:" >&5
8332   cat conftest.$ac_ext >&5
8333   eval "$as_ac_Header=no"
8334 fi
8335 rm -f conftest.err conftest.$ac_ext
8336 fi
8337 echo "$as_me:8337: result: `eval echo '${'$as_ac_Header'}'`" >&5
8338 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8339 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8340   cat >>confdefs.h <<EOF
8341 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8342 EOF
8343
8344 fi
8345 done
8346
8347 cat >>confdefs.h <<\EOF
8348 #define NCURSES 1
8349 EOF
8350
8351 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8352
8353                 cat >>confdefs.h <<EOF
8354 #define $cf_nculib_ROOT 1
8355 EOF
8356
8357                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8358
8359         else
8360
8361 cf_ncuhdr_root=$cf_cv_screen
8362
8363 test -n "$cf_cv_curses_dir" && \
8364 test "$cf_cv_curses_dir" != "no" && { \
8365
8366 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8367   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8368   do
8369         while test $cf_add_incdir != /usr/include
8370         do
8371           if test -d $cf_add_incdir
8372           then
8373                 cf_have_incdir=no
8374                 if test -n "$CFLAGS$CPPFLAGS" ; then
8375                   # a loop is needed to ensure we can add subdirs of existing dirs
8376                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8377                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8378                           cf_have_incdir=yes; break
8379                         fi
8380                   done
8381                 fi
8382
8383                 if test "$cf_have_incdir" = no ; then
8384                   if test "$cf_add_incdir" = /usr/local/include ; then
8385                         if test "$GCC" = yes
8386                         then
8387                           cf_save_CPPFLAGS=$CPPFLAGS
8388
8389         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8390         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8391
8392                           cat >conftest.$ac_ext <<_ACEOF
8393 #line 8393 "configure"
8394 #include "confdefs.h"
8395 #include <stdio.h>
8396 int
8397 main (void)
8398 {
8399 printf("Hello")
8400   ;
8401   return 0;
8402 }
8403 _ACEOF
8404 rm -f conftest.$ac_objext
8405 if { (eval echo "$as_me:8405: \"$ac_compile\"") >&5
8406   (eval $ac_compile) 2>&5
8407   ac_status=$?
8408   echo "$as_me:8408: \$? = $ac_status" >&5
8409   (exit $ac_status); } &&
8410          { ac_try='test -s conftest.$ac_objext'
8411   { (eval echo "$as_me:8411: \"$ac_try\"") >&5
8412   (eval $ac_try) 2>&5
8413   ac_status=$?
8414   echo "$as_me:8414: \$? = $ac_status" >&5
8415   (exit $ac_status); }; }; then
8416   :
8417 else
8418   echo "$as_me: failed program was:" >&5
8419 cat conftest.$ac_ext >&5
8420 cf_have_incdir=yes
8421 fi
8422 rm -f conftest.$ac_objext conftest.$ac_ext
8423                           CPPFLAGS=$cf_save_CPPFLAGS
8424                         fi
8425                   fi
8426                 fi
8427
8428                 if test "$cf_have_incdir" = no ; then
8429                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8430
8431 echo "${as_me:-configure}:8431: testing adding $cf_add_incdir to include-path ..." 1>&5
8432
8433                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8434
8435                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8436                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8437                   cf_add_incdir="$cf_top_incdir"
8438                 else
8439                   break
8440                 fi
8441           else
8442                 break
8443           fi
8444         done
8445   done
8446 fi
8447
8448 }
8449
8450 echo "$as_me:8450: checking for $cf_ncuhdr_root header in include-path" >&5
8451 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8452 if test "${cf_cv_ncurses_h+set}" = set; then
8453   echo $ECHO_N "(cached) $ECHO_C" >&6
8454 else
8455
8456         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8457         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8458         for cf_header in $cf_header_list
8459         do
8460
8461         cat >conftest.$ac_ext <<_ACEOF
8462 #line 8462 "configure"
8463 #include "confdefs.h"
8464
8465 #include <$cf_header>
8466 int
8467 main (void)
8468 {
8469
8470 #ifdef NCURSES_VERSION
8471
8472 printf("%s\n", NCURSES_VERSION);
8473 #else
8474 #ifdef __NCURSES_H
8475 printf("old\n");
8476 #else
8477         make an error
8478 #endif
8479 #endif
8480
8481   ;
8482   return 0;
8483 }
8484 _ACEOF
8485 rm -f conftest.$ac_objext
8486 if { (eval echo "$as_me:8486: \"$ac_compile\"") >&5
8487   (eval $ac_compile) 2>&5
8488   ac_status=$?
8489   echo "$as_me:8489: \$? = $ac_status" >&5
8490   (exit $ac_status); } &&
8491          { ac_try='test -s conftest.$ac_objext'
8492   { (eval echo "$as_me:8492: \"$ac_try\"") >&5
8493   (eval $ac_try) 2>&5
8494   ac_status=$?
8495   echo "$as_me:8495: \$? = $ac_status" >&5
8496   (exit $ac_status); }; }; then
8497   cf_cv_ncurses_h=$cf_header
8498
8499 else
8500   echo "$as_me: failed program was:" >&5
8501 cat conftest.$ac_ext >&5
8502 cf_cv_ncurses_h=no
8503 fi
8504 rm -f conftest.$ac_objext conftest.$ac_ext
8505
8506                 test "$cf_cv_ncurses_h" != no && break
8507         done
8508
8509 fi
8510 echo "$as_me:8510: result: $cf_cv_ncurses_h" >&5
8511 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8512
8513 if test "$cf_cv_ncurses_h" != no ; then
8514         cf_cv_ncurses_header=$cf_cv_ncurses_h
8515 else
8516
8517 echo "$as_me:8517: checking for $cf_ncuhdr_root include-path" >&5
8518 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8519 if test "${cf_cv_ncurses_h2+set}" = set; then
8520   echo $ECHO_N "(cached) $ECHO_C" >&6
8521 else
8522
8523         test -n "$verbose" && echo
8524
8525 cf_search=
8526
8527 # collect the current set of include-directories from compiler flags
8528 cf_header_path_list=""
8529 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8530         for cf_header_path in $CPPFLAGS $CFLAGS
8531         do
8532                 case $cf_header_path in
8533                 (-I*)
8534                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8535
8536 test "x$cf_header_path" != "xNONE" && \
8537 test -d "$cf_header_path" && \
8538  {
8539         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8540         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8541         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8542         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8543         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8544         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"
8545 }
8546
8547                         cf_header_path_list="$cf_header_path_list $cf_search"
8548                         ;;
8549                 esac
8550         done
8551 fi
8552
8553 # add the variations for the package we are looking for
8554
8555 cf_search=
8556
8557 test "x$prefix" != "xNONE" && \
8558 test -d "$prefix" && \
8559  {
8560         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8561         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8562         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8563         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8564         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8565         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8566 }
8567
8568 for cf_subdir_prefix in \
8569         /usr \
8570         /usr/local \
8571         /usr/pkg \
8572         /opt \
8573         /opt/local \
8574         $HOME
8575 do
8576
8577 test "x$cf_subdir_prefix" != "x$prefix" && \
8578 test -d "$cf_subdir_prefix" && \
8579 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8580         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8581         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8582         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8583         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8584         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8585         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"
8586 }
8587
8588 done
8589
8590 test "$includedir" != NONE && \
8591 test "$includedir" != "/usr/include" && \
8592 test -d "$includedir" && {
8593         test -d $includedir &&    cf_search="$cf_search $includedir"
8594         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8595 }
8596
8597 test "$oldincludedir" != NONE && \
8598 test "$oldincludedir" != "/usr/include" && \
8599 test -d "$oldincludedir" && {
8600         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8601         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8602 }
8603
8604 cf_search="$cf_search $cf_header_path_list"
8605
8606         test -n "$verbose" && echo search path $cf_search
8607         cf_save2_CPPFLAGS="$CPPFLAGS"
8608         for cf_incdir in $cf_search
8609         do
8610
8611 if test -n "$cf_incdir" ; then
8612   for cf_add_incdir in $cf_incdir
8613   do
8614         while test $cf_add_incdir != /usr/include
8615         do
8616           if test -d $cf_add_incdir
8617           then
8618                 cf_have_incdir=no
8619                 if test -n "$CFLAGS$CPPFLAGS" ; then
8620                   # a loop is needed to ensure we can add subdirs of existing dirs
8621                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8622                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8623                           cf_have_incdir=yes; break
8624                         fi
8625                   done
8626                 fi
8627
8628                 if test "$cf_have_incdir" = no ; then
8629                   if test "$cf_add_incdir" = /usr/local/include ; then
8630                         if test "$GCC" = yes
8631                         then
8632                           cf_save_CPPFLAGS=$CPPFLAGS
8633
8634         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8635         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8636
8637                           cat >conftest.$ac_ext <<_ACEOF
8638 #line 8638 "configure"
8639 #include "confdefs.h"
8640 #include <stdio.h>
8641 int
8642 main (void)
8643 {
8644 printf("Hello")
8645   ;
8646   return 0;
8647 }
8648 _ACEOF
8649 rm -f conftest.$ac_objext
8650 if { (eval echo "$as_me:8650: \"$ac_compile\"") >&5
8651   (eval $ac_compile) 2>&5
8652   ac_status=$?
8653   echo "$as_me:8653: \$? = $ac_status" >&5
8654   (exit $ac_status); } &&
8655          { ac_try='test -s conftest.$ac_objext'
8656   { (eval echo "$as_me:8656: \"$ac_try\"") >&5
8657   (eval $ac_try) 2>&5
8658   ac_status=$?
8659   echo "$as_me:8659: \$? = $ac_status" >&5
8660   (exit $ac_status); }; }; then
8661   :
8662 else
8663   echo "$as_me: failed program was:" >&5
8664 cat conftest.$ac_ext >&5
8665 cf_have_incdir=yes
8666 fi
8667 rm -f conftest.$ac_objext conftest.$ac_ext
8668                           CPPFLAGS=$cf_save_CPPFLAGS
8669                         fi
8670                   fi
8671                 fi
8672
8673                 if test "$cf_have_incdir" = no ; then
8674                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8675
8676 echo "${as_me:-configure}:8676: testing adding $cf_add_incdir to include-path ..." 1>&5
8677
8678                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8679
8680                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8681                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8682                   cf_add_incdir="$cf_top_incdir"
8683                 else
8684                   break
8685                 fi
8686           else
8687                 break
8688           fi
8689         done
8690   done
8691 fi
8692
8693                 for cf_header in \
8694                         ncurses.h \
8695                         curses.h
8696                 do
8697
8698         cat >conftest.$ac_ext <<_ACEOF
8699 #line 8699 "configure"
8700 #include "confdefs.h"
8701
8702 #include <$cf_header>
8703 int
8704 main (void)
8705 {
8706
8707 #ifdef NCURSES_VERSION
8708
8709 printf("%s\n", NCURSES_VERSION);
8710 #else
8711 #ifdef __NCURSES_H
8712 printf("old\n");
8713 #else
8714         make an error
8715 #endif
8716 #endif
8717
8718   ;
8719   return 0;
8720 }
8721 _ACEOF
8722 rm -f conftest.$ac_objext
8723 if { (eval echo "$as_me:8723: \"$ac_compile\"") >&5
8724   (eval $ac_compile) 2>&5
8725   ac_status=$?
8726   echo "$as_me:8726: \$? = $ac_status" >&5
8727   (exit $ac_status); } &&
8728          { ac_try='test -s conftest.$ac_objext'
8729   { (eval echo "$as_me:8729: \"$ac_try\"") >&5
8730   (eval $ac_try) 2>&5
8731   ac_status=$?
8732   echo "$as_me:8732: \$? = $ac_status" >&5
8733   (exit $ac_status); }; }; then
8734   cf_cv_ncurses_h2=$cf_header
8735
8736 else
8737   echo "$as_me: failed program was:" >&5
8738 cat conftest.$ac_ext >&5
8739 cf_cv_ncurses_h2=no
8740 fi
8741 rm -f conftest.$ac_objext conftest.$ac_ext
8742
8743                         if test "$cf_cv_ncurses_h2" != no ; then
8744                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8745                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8746                                 break
8747                         fi
8748                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8749                 done
8750                 CPPFLAGS="$cf_save2_CPPFLAGS"
8751                 test "$cf_cv_ncurses_h2" != no && break
8752         done
8753         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8753: error: not found" >&5
8754 echo "$as_me: error: not found" >&2;}
8755    { (exit 1); exit 1; }; }
8756
8757 fi
8758 echo "$as_me:8758: result: $cf_cv_ncurses_h2" >&5
8759 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8760
8761         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8762         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8763         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8764                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8765         fi
8766
8767 if test -n "$cf_1st_incdir" ; then
8768   for cf_add_incdir in $cf_1st_incdir
8769   do
8770         while test $cf_add_incdir != /usr/include
8771         do
8772           if test -d $cf_add_incdir
8773           then
8774                 cf_have_incdir=no
8775                 if test -n "$CFLAGS$CPPFLAGS" ; then
8776                   # a loop is needed to ensure we can add subdirs of existing dirs
8777                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8778                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8779                           cf_have_incdir=yes; break
8780                         fi
8781                   done
8782                 fi
8783
8784                 if test "$cf_have_incdir" = no ; then
8785                   if test "$cf_add_incdir" = /usr/local/include ; then
8786                         if test "$GCC" = yes
8787                         then
8788                           cf_save_CPPFLAGS=$CPPFLAGS
8789
8790         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8791         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8792
8793                           cat >conftest.$ac_ext <<_ACEOF
8794 #line 8794 "configure"
8795 #include "confdefs.h"
8796 #include <stdio.h>
8797 int
8798 main (void)
8799 {
8800 printf("Hello")
8801   ;
8802   return 0;
8803 }
8804 _ACEOF
8805 rm -f conftest.$ac_objext
8806 if { (eval echo "$as_me:8806: \"$ac_compile\"") >&5
8807   (eval $ac_compile) 2>&5
8808   ac_status=$?
8809   echo "$as_me:8809: \$? = $ac_status" >&5
8810   (exit $ac_status); } &&
8811          { ac_try='test -s conftest.$ac_objext'
8812   { (eval echo "$as_me:8812: \"$ac_try\"") >&5
8813   (eval $ac_try) 2>&5
8814   ac_status=$?
8815   echo "$as_me:8815: \$? = $ac_status" >&5
8816   (exit $ac_status); }; }; then
8817   :
8818 else
8819   echo "$as_me: failed program was:" >&5
8820 cat conftest.$ac_ext >&5
8821 cf_have_incdir=yes
8822 fi
8823 rm -f conftest.$ac_objext conftest.$ac_ext
8824                           CPPFLAGS=$cf_save_CPPFLAGS
8825                         fi
8826                   fi
8827                 fi
8828
8829                 if test "$cf_have_incdir" = no ; then
8830                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8831
8832 echo "${as_me:-configure}:8832: testing adding $cf_add_incdir to include-path ..." 1>&5
8833
8834                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8835
8836                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8837                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8838                   cf_add_incdir="$cf_top_incdir"
8839                 else
8840                   break
8841                 fi
8842           else
8843                 break
8844           fi
8845         done
8846   done
8847 fi
8848
8849 fi
8850
8851 # Set definitions to allow ifdef'ing for ncurses.h
8852
8853 case $cf_cv_ncurses_header in
8854 (*ncurses.h)
8855
8856 cat >>confdefs.h <<\EOF
8857 #define HAVE_NCURSES_H 1
8858 EOF
8859
8860         ;;
8861 esac
8862
8863 case $cf_cv_ncurses_header in
8864 (ncurses/curses.h|ncurses/ncurses.h)
8865
8866 cat >>confdefs.h <<\EOF
8867 #define HAVE_NCURSES_NCURSES_H 1
8868 EOF
8869
8870         ;;
8871 (ncursesw/curses.h|ncursesw/ncurses.h)
8872
8873 cat >>confdefs.h <<\EOF
8874 #define HAVE_NCURSESW_NCURSES_H 1
8875 EOF
8876
8877         ;;
8878 esac
8879
8880 echo "$as_me:8880: checking for terminfo header" >&5
8881 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8882 if test "${cf_cv_term_header+set}" = set; then
8883   echo $ECHO_N "(cached) $ECHO_C" >&6
8884 else
8885
8886 case ${cf_cv_ncurses_header} in
8887 (*/ncurses.h|*/ncursesw.h)
8888         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8889         ;;
8890 (*)
8891         cf_term_header=term.h
8892         ;;
8893 esac
8894
8895 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8896 do
8897 cat >conftest.$ac_ext <<_ACEOF
8898 #line 8898 "configure"
8899 #include "confdefs.h"
8900 #include <stdio.h>
8901 #include <${cf_cv_ncurses_header:-curses.h}>
8902 #include <$cf_test>
8903
8904 int
8905 main (void)
8906 {
8907 int x = auto_left_margin
8908   ;
8909   return 0;
8910 }
8911 _ACEOF
8912 rm -f conftest.$ac_objext
8913 if { (eval echo "$as_me:8913: \"$ac_compile\"") >&5
8914   (eval $ac_compile) 2>&5
8915   ac_status=$?
8916   echo "$as_me:8916: \$? = $ac_status" >&5
8917   (exit $ac_status); } &&
8918          { ac_try='test -s conftest.$ac_objext'
8919   { (eval echo "$as_me:8919: \"$ac_try\"") >&5
8920   (eval $ac_try) 2>&5
8921   ac_status=$?
8922   echo "$as_me:8922: \$? = $ac_status" >&5
8923   (exit $ac_status); }; }; then
8924
8925         cf_cv_term_header="$cf_test"
8926 else
8927   echo "$as_me: failed program was:" >&5
8928 cat conftest.$ac_ext >&5
8929
8930         cf_cv_term_header=unknown
8931
8932 fi
8933 rm -f conftest.$ac_objext conftest.$ac_ext
8934         test "$cf_cv_term_header" != unknown && break
8935 done
8936
8937 fi
8938 echo "$as_me:8938: result: $cf_cv_term_header" >&5
8939 echo "${ECHO_T}$cf_cv_term_header" >&6
8940
8941 # Set definitions to allow ifdef'ing to accommodate subdirectories
8942
8943 case $cf_cv_term_header in
8944 (*term.h)
8945
8946 cat >>confdefs.h <<\EOF
8947 #define HAVE_TERM_H 1
8948 EOF
8949
8950         ;;
8951 esac
8952
8953 case $cf_cv_term_header in
8954 (ncurses/term.h)
8955
8956 cat >>confdefs.h <<\EOF
8957 #define HAVE_NCURSES_TERM_H 1
8958 EOF
8959
8960         ;;
8961 (ncursesw/term.h)
8962
8963 cat >>confdefs.h <<\EOF
8964 #define HAVE_NCURSESW_TERM_H 1
8965 EOF
8966
8967         ;;
8968 esac
8969
8970 # some applications need this, but should check for NCURSES_VERSION
8971
8972 cat >>confdefs.h <<\EOF
8973 #define NCURSES 1
8974 EOF
8975
8976 echo "$as_me:8976: checking for ncurses version" >&5
8977 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8978 if test "${cf_cv_ncurses_version+set}" = set; then
8979   echo $ECHO_N "(cached) $ECHO_C" >&6
8980 else
8981
8982         cf_cv_ncurses_version=no
8983         cf_tempfile=out$$
8984         rm -f $cf_tempfile
8985         if test "$cross_compiling" = yes; then
8986
8987         # This will not work if the preprocessor splits the line after the
8988         # Autoconf token.  The 'unproto' program does that.
8989         cat > conftest.$ac_ext <<EOF
8990 #include <${cf_cv_ncurses_header:-curses.h}>
8991 #undef Autoconf
8992 #ifdef NCURSES_VERSION
8993 Autoconf NCURSES_VERSION
8994 #else
8995 #ifdef __NCURSES_H
8996 Autoconf "old"
8997 #endif
8998 ;
8999 #endif
9000 EOF
9001         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9002         { (eval echo "$as_me:9002: \"$cf_try\"") >&5
9003   (eval $cf_try) 2>&5
9004   ac_status=$?
9005   echo "$as_me:9005: \$? = $ac_status" >&5
9006   (exit $ac_status); }
9007         if test -f conftest.out ; then
9008                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9009                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9010                 rm -f conftest.out
9011         fi
9012
9013 else
9014   cat >conftest.$ac_ext <<_ACEOF
9015 #line 9015 "configure"
9016 #include "confdefs.h"
9017
9018 #include <${cf_cv_ncurses_header:-curses.h}>
9019 #include <stdio.h>
9020 int main(void)
9021 {
9022         FILE *fp = fopen("$cf_tempfile", "w");
9023 #ifdef NCURSES_VERSION
9024 # ifdef NCURSES_VERSION_PATCH
9025         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9026 # else
9027         fprintf(fp, "%s\n", NCURSES_VERSION);
9028 # endif
9029 #else
9030 # ifdef __NCURSES_H
9031         fprintf(fp, "old\n");
9032 # else
9033         make an error
9034 # endif
9035 #endif
9036         ${cf_cv_main_return:-return}(0);
9037 }
9038 _ACEOF
9039 rm -f conftest$ac_exeext
9040 if { (eval echo "$as_me:9040: \"$ac_link\"") >&5
9041   (eval $ac_link) 2>&5
9042   ac_status=$?
9043   echo "$as_me:9043: \$? = $ac_status" >&5
9044   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9045   { (eval echo "$as_me:9045: \"$ac_try\"") >&5
9046   (eval $ac_try) 2>&5
9047   ac_status=$?
9048   echo "$as_me:9048: \$? = $ac_status" >&5
9049   (exit $ac_status); }; }; then
9050
9051         cf_cv_ncurses_version=`cat $cf_tempfile`
9052 else
9053   echo "$as_me: program exited with status $ac_status" >&5
9054 echo "$as_me: failed program was:" >&5
9055 cat conftest.$ac_ext >&5
9056 fi
9057 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9058 fi
9059         rm -f $cf_tempfile
9060
9061 fi
9062 echo "$as_me:9062: result: $cf_cv_ncurses_version" >&5
9063 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9064 test "$cf_cv_ncurses_version" = no ||
9065 cat >>confdefs.h <<\EOF
9066 #define NCURSES 1
9067 EOF
9068
9069 cf_nculib_root=$cf_cv_screen
9070         # This works, except for the special case where we find gpm, but
9071         # ncurses is in a nonstandard location via $LIBS, and we really want
9072         # to link gpm.
9073 cf_ncurses_LIBS=""
9074 cf_ncurses_SAVE="$LIBS"
9075 echo "$as_me:9075: checking for Gpm_Open in -lgpm" >&5
9076 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9077 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9078   echo $ECHO_N "(cached) $ECHO_C" >&6
9079 else
9080   ac_check_lib_save_LIBS=$LIBS
9081 LIBS="-lgpm  $LIBS"
9082 cat >conftest.$ac_ext <<_ACEOF
9083 #line 9083 "configure"
9084 #include "confdefs.h"
9085
9086 /* Override any gcc2 internal prototype to avoid an error.  */
9087 #ifdef __cplusplus
9088 extern "C"
9089 #endif
9090 /* We use char because int might match the return type of a gcc2
9091    builtin and then its argument prototype would still apply.  */
9092 char Gpm_Open ();
9093 int
9094 main (void)
9095 {
9096 Gpm_Open ();
9097   ;
9098   return 0;
9099 }
9100 _ACEOF
9101 rm -f conftest.$ac_objext conftest$ac_exeext
9102 if { (eval echo "$as_me:9102: \"$ac_link\"") >&5
9103   (eval $ac_link) 2>&5
9104   ac_status=$?
9105   echo "$as_me:9105: \$? = $ac_status" >&5
9106   (exit $ac_status); } &&
9107          { ac_try='test -s conftest$ac_exeext'
9108   { (eval echo "$as_me:9108: \"$ac_try\"") >&5
9109   (eval $ac_try) 2>&5
9110   ac_status=$?
9111   echo "$as_me:9111: \$? = $ac_status" >&5
9112   (exit $ac_status); }; }; then
9113   ac_cv_lib_gpm_Gpm_Open=yes
9114 else
9115   echo "$as_me: failed program was:" >&5
9116 cat conftest.$ac_ext >&5
9117 ac_cv_lib_gpm_Gpm_Open=no
9118 fi
9119 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9120 LIBS=$ac_check_lib_save_LIBS
9121 fi
9122 echo "$as_me:9122: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9123 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9124 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9125   echo "$as_me:9125: checking for initscr in -lgpm" >&5
9126 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9127 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9128   echo $ECHO_N "(cached) $ECHO_C" >&6
9129 else
9130   ac_check_lib_save_LIBS=$LIBS
9131 LIBS="-lgpm  $LIBS"
9132 cat >conftest.$ac_ext <<_ACEOF
9133 #line 9133 "configure"
9134 #include "confdefs.h"
9135
9136 /* Override any gcc2 internal prototype to avoid an error.  */
9137 #ifdef __cplusplus
9138 extern "C"
9139 #endif
9140 /* We use char because int might match the return type of a gcc2
9141    builtin and then its argument prototype would still apply.  */
9142 char initscr ();
9143 int
9144 main (void)
9145 {
9146 initscr ();
9147   ;
9148   return 0;
9149 }
9150 _ACEOF
9151 rm -f conftest.$ac_objext conftest$ac_exeext
9152 if { (eval echo "$as_me:9152: \"$ac_link\"") >&5
9153   (eval $ac_link) 2>&5
9154   ac_status=$?
9155   echo "$as_me:9155: \$? = $ac_status" >&5
9156   (exit $ac_status); } &&
9157          { ac_try='test -s conftest$ac_exeext'
9158   { (eval echo "$as_me:9158: \"$ac_try\"") >&5
9159   (eval $ac_try) 2>&5
9160   ac_status=$?
9161   echo "$as_me:9161: \$? = $ac_status" >&5
9162   (exit $ac_status); }; }; then
9163   ac_cv_lib_gpm_initscr=yes
9164 else
9165   echo "$as_me: failed program was:" >&5
9166 cat conftest.$ac_ext >&5
9167 ac_cv_lib_gpm_initscr=no
9168 fi
9169 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9170 LIBS=$ac_check_lib_save_LIBS
9171 fi
9172 echo "$as_me:9172: result: $ac_cv_lib_gpm_initscr" >&5
9173 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9174 if test $ac_cv_lib_gpm_initscr = yes; then
9175   LIBS="$cf_ncurses_SAVE"
9176 else
9177   cf_ncurses_LIBS="-lgpm"
9178 fi
9179
9180 fi
9181
9182 case $host_os in
9183 (freebsd*)
9184         # This is only necessary if you are linking against an obsolete
9185         # version of ncurses (but it should do no harm, since it's static).
9186         if test "$cf_nculib_root" = ncurses ; then
9187                 echo "$as_me:9187: checking for tgoto in -lmytinfo" >&5
9188 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9189 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9190   echo $ECHO_N "(cached) $ECHO_C" >&6
9191 else
9192   ac_check_lib_save_LIBS=$LIBS
9193 LIBS="-lmytinfo  $LIBS"
9194 cat >conftest.$ac_ext <<_ACEOF
9195 #line 9195 "configure"
9196 #include "confdefs.h"
9197
9198 /* Override any gcc2 internal prototype to avoid an error.  */
9199 #ifdef __cplusplus
9200 extern "C"
9201 #endif
9202 /* We use char because int might match the return type of a gcc2
9203    builtin and then its argument prototype would still apply.  */
9204 char tgoto ();
9205 int
9206 main (void)
9207 {
9208 tgoto ();
9209   ;
9210   return 0;
9211 }
9212 _ACEOF
9213 rm -f conftest.$ac_objext conftest$ac_exeext
9214 if { (eval echo "$as_me:9214: \"$ac_link\"") >&5
9215   (eval $ac_link) 2>&5
9216   ac_status=$?
9217   echo "$as_me:9217: \$? = $ac_status" >&5
9218   (exit $ac_status); } &&
9219          { ac_try='test -s conftest$ac_exeext'
9220   { (eval echo "$as_me:9220: \"$ac_try\"") >&5
9221   (eval $ac_try) 2>&5
9222   ac_status=$?
9223   echo "$as_me:9223: \$? = $ac_status" >&5
9224   (exit $ac_status); }; }; then
9225   ac_cv_lib_mytinfo_tgoto=yes
9226 else
9227   echo "$as_me: failed program was:" >&5
9228 cat conftest.$ac_ext >&5
9229 ac_cv_lib_mytinfo_tgoto=no
9230 fi
9231 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9232 LIBS=$ac_check_lib_save_LIBS
9233 fi
9234 echo "$as_me:9234: result: $ac_cv_lib_mytinfo_tgoto" >&5
9235 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9236 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9237   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9238 fi
9239
9240         fi
9241         ;;
9242 esac
9243
9244 cf_add_libs="$LIBS"
9245 # reverse order
9246 cf_add_0lib=
9247 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9248 # filter duplicates
9249 for cf_add_1lib in $cf_add_0lib; do
9250         for cf_add_2lib in $cf_add_libs; do
9251                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9252                         cf_add_1lib=
9253                         break
9254                 fi
9255         done
9256         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9257 done
9258 LIBS="$cf_add_libs"
9259
9260 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9261 then
9262
9263 cf_add_libs="$LIBS"
9264 # reverse order
9265 cf_add_0lib=
9266 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9267 # filter duplicates
9268 for cf_add_1lib in $cf_add_0lib; do
9269         for cf_add_2lib in $cf_add_libs; do
9270                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9271                         cf_add_1lib=
9272                         break
9273                 fi
9274         done
9275         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9276 done
9277 LIBS="$cf_add_libs"
9278
9279 else
9280
9281         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9282         cf_libdir=""
9283         echo "$as_me:9283: checking for initscr" >&5
9284 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9285 if test "${ac_cv_func_initscr+set}" = set; then
9286   echo $ECHO_N "(cached) $ECHO_C" >&6
9287 else
9288   cat >conftest.$ac_ext <<_ACEOF
9289 #line 9289 "configure"
9290 #include "confdefs.h"
9291 #define initscr autoconf_temporary
9292 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9293 #undef initscr
9294
9295 #ifdef __cplusplus
9296 extern "C"
9297 #endif
9298
9299 /* We use char because int might match the return type of a gcc2
9300    builtin and then its argument prototype would still apply.  */
9301 char initscr (void);
9302
9303 int
9304 main (void)
9305 {
9306
9307 /* The GNU C library defines stubs for functions which it implements
9308     to always fail with ENOSYS.  Some functions are actually named
9309     something starting with __ and the normal name is an alias.  */
9310 #if defined (__stub_initscr) || defined (__stub___initscr)
9311 #error found stub for initscr
9312 #endif
9313
9314         return initscr ();
9315   ;
9316   return 0;
9317 }
9318 _ACEOF
9319 rm -f conftest.$ac_objext conftest$ac_exeext
9320 if { (eval echo "$as_me:9320: \"$ac_link\"") >&5
9321   (eval $ac_link) 2>&5
9322   ac_status=$?
9323   echo "$as_me:9323: \$? = $ac_status" >&5
9324   (exit $ac_status); } &&
9325          { ac_try='test -s conftest$ac_exeext'
9326   { (eval echo "$as_me:9326: \"$ac_try\"") >&5
9327   (eval $ac_try) 2>&5
9328   ac_status=$?
9329   echo "$as_me:9329: \$? = $ac_status" >&5
9330   (exit $ac_status); }; }; then
9331   ac_cv_func_initscr=yes
9332 else
9333   echo "$as_me: failed program was:" >&5
9334 cat conftest.$ac_ext >&5
9335 ac_cv_func_initscr=no
9336 fi
9337 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9338 fi
9339 echo "$as_me:9339: result: $ac_cv_func_initscr" >&5
9340 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9341 if test $ac_cv_func_initscr = yes; then
9342   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9343 else
9344
9345                 cf_save_LIBS="$LIBS"
9346                 echo "$as_me:9346: checking for initscr in -l$cf_nculib_root" >&5
9347 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9348                 LIBS="-l$cf_nculib_root $LIBS"
9349                 cat >conftest.$ac_ext <<_ACEOF
9350 #line 9350 "configure"
9351 #include "confdefs.h"
9352 #include <${cf_cv_ncurses_header:-curses.h}>
9353 int
9354 main (void)
9355 {
9356 initscr()
9357   ;
9358   return 0;
9359 }
9360 _ACEOF
9361 rm -f conftest.$ac_objext conftest$ac_exeext
9362 if { (eval echo "$as_me:9362: \"$ac_link\"") >&5
9363   (eval $ac_link) 2>&5
9364   ac_status=$?
9365   echo "$as_me:9365: \$? = $ac_status" >&5
9366   (exit $ac_status); } &&
9367          { ac_try='test -s conftest$ac_exeext'
9368   { (eval echo "$as_me:9368: \"$ac_try\"") >&5
9369   (eval $ac_try) 2>&5
9370   ac_status=$?
9371   echo "$as_me:9371: \$? = $ac_status" >&5
9372   (exit $ac_status); }; }; then
9373   echo "$as_me:9373: result: yes" >&5
9374 echo "${ECHO_T}yes" >&6
9375                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9376
9377 else
9378   echo "$as_me: failed program was:" >&5
9379 cat conftest.$ac_ext >&5
9380 echo "$as_me:9380: result: no" >&5
9381 echo "${ECHO_T}no" >&6
9382
9383 cf_search=
9384 cf_library_path_list=""
9385 if test -n "${LDFLAGS}${LIBS}" ; then
9386         for cf_library_path in $LDFLAGS $LIBS
9387         do
9388                 case $cf_library_path in
9389                 (-L*)
9390                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9391
9392 test "x$cf_library_path" != "xNONE" && \
9393 test -d "$cf_library_path" && \
9394  {
9395         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9396         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9397         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9398         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9399         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9400         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"
9401 }
9402
9403                         cf_library_path_list="$cf_library_path_list $cf_search"
9404                         ;;
9405                 esac
9406         done
9407 fi
9408
9409 cf_search=
9410
9411 test "x$prefix" != "xNONE" && \
9412 test -d "$prefix" && \
9413  {
9414         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9415         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9416         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9417         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9418         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9419         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9420 }
9421
9422 for cf_subdir_prefix in \
9423         /usr \
9424         /usr/local \
9425         /usr/pkg \
9426         /opt \
9427         /opt/local \
9428         $HOME
9429 do
9430
9431 test "x$cf_subdir_prefix" != "x$prefix" && \
9432 test -d "$cf_subdir_prefix" && \
9433 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9434         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9435         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9436         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9437         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9438         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9439         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"
9440 }
9441
9442 done
9443
9444 cf_search="$cf_library_path_list $cf_search"
9445
9446                         for cf_libdir in $cf_search
9447                         do
9448                                 echo "$as_me:9448: checking for -l$cf_nculib_root in $cf_libdir" >&5
9449 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9450                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9451                                 cat >conftest.$ac_ext <<_ACEOF
9452 #line 9452 "configure"
9453 #include "confdefs.h"
9454 #include <${cf_cv_ncurses_header:-curses.h}>
9455 int
9456 main (void)
9457 {
9458 initscr()
9459   ;
9460   return 0;
9461 }
9462 _ACEOF
9463 rm -f conftest.$ac_objext conftest$ac_exeext
9464 if { (eval echo "$as_me:9464: \"$ac_link\"") >&5
9465   (eval $ac_link) 2>&5
9466   ac_status=$?
9467   echo "$as_me:9467: \$? = $ac_status" >&5
9468   (exit $ac_status); } &&
9469          { ac_try='test -s conftest$ac_exeext'
9470   { (eval echo "$as_me:9470: \"$ac_try\"") >&5
9471   (eval $ac_try) 2>&5
9472   ac_status=$?
9473   echo "$as_me:9473: \$? = $ac_status" >&5
9474   (exit $ac_status); }; }; then
9475   echo "$as_me:9475: result: yes" >&5
9476 echo "${ECHO_T}yes" >&6
9477                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9478                                          break
9479 else
9480   echo "$as_me: failed program was:" >&5
9481 cat conftest.$ac_ext >&5
9482 echo "$as_me:9482: result: no" >&5
9483 echo "${ECHO_T}no" >&6
9484                                          LIBS="$cf_save_LIBS"
9485 fi
9486 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9487                         done
9488
9489 fi
9490 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9491
9492 fi
9493
9494 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9495
9496 if test $cf_found_library = no ; then
9497         { { echo "$as_me:9497: error: Cannot link $cf_nculib_root library" >&5
9498 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9499    { (exit 1); exit 1; }; }
9500 fi
9501
9502 fi
9503
9504 if test -n "$cf_ncurses_LIBS" ; then
9505         echo "$as_me:9505: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9506 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9507         cf_ncurses_SAVE="$LIBS"
9508         for p in $cf_ncurses_LIBS ; do
9509                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9510                 if test "$q" != "$LIBS" ; then
9511                         LIBS="$q"
9512                 fi
9513         done
9514         cat >conftest.$ac_ext <<_ACEOF
9515 #line 9515 "configure"
9516 #include "confdefs.h"
9517 #include <${cf_cv_ncurses_header:-curses.h}>
9518 int
9519 main (void)
9520 {
9521 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9522   ;
9523   return 0;
9524 }
9525 _ACEOF
9526 rm -f conftest.$ac_objext conftest$ac_exeext
9527 if { (eval echo "$as_me:9527: \"$ac_link\"") >&5
9528   (eval $ac_link) 2>&5
9529   ac_status=$?
9530   echo "$as_me:9530: \$? = $ac_status" >&5
9531   (exit $ac_status); } &&
9532          { ac_try='test -s conftest$ac_exeext'
9533   { (eval echo "$as_me:9533: \"$ac_try\"") >&5
9534   (eval $ac_try) 2>&5
9535   ac_status=$?
9536   echo "$as_me:9536: \$? = $ac_status" >&5
9537   (exit $ac_status); }; }; then
9538   echo "$as_me:9538: result: yes" >&5
9539 echo "${ECHO_T}yes" >&6
9540 else
9541   echo "$as_me: failed program was:" >&5
9542 cat conftest.$ac_ext >&5
9543 echo "$as_me:9543: result: no" >&5
9544 echo "${ECHO_T}no" >&6
9545                  LIBS="$cf_ncurses_SAVE"
9546 fi
9547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9548 fi
9549
9550 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9551
9552 cat >>confdefs.h <<EOF
9553 #define $cf_nculib_ROOT 1
9554 EOF
9555
9556         fi
9557 else
9558         NCURSES_CONFIG=none
9559 fi
9560
9561         ;;
9562 (ncurses*)
9563
9564 cf_ncuconfig_root=$cf_cv_screen
9565 cf_have_ncuconfig=no
9566
9567 if test "x${PKG_CONFIG:=none}" != xnone; then
9568         echo "$as_me:9568: checking pkg-config for $cf_ncuconfig_root" >&5
9569 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9570         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9571                 echo "$as_me:9571: result: yes" >&5
9572 echo "${ECHO_T}yes" >&6
9573
9574                 echo "$as_me:9574: checking if the $cf_ncuconfig_root package files work" >&5
9575 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9576                 cf_have_ncuconfig=unknown
9577
9578                 cf_save_CFLAGS="$CFLAGS"
9579                 cf_save_CPPFLAGS="$CPPFLAGS"
9580                 cf_save_LIBS="$LIBS"
9581
9582                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
9583                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
9584
9585                 # while -W for passing linker flags is prevalent, it is not "standard".
9586                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9587                 # incompatible _and_ non-standard -W option which gives an error.  Work
9588                 # around that pitfall.
9589                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9590                 (x*c[89]9@@*-W*)
9591
9592 cf_fix_cppflags=no
9593 cf_new_cflags=
9594 cf_new_cppflags=
9595 cf_new_extra_cppflags=
9596
9597 for cf_add_cflags in $cf_pkg_cflags
9598 do
9599 case $cf_fix_cppflags in
9600 (no)
9601         case $cf_add_cflags in
9602         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9603                 case $cf_add_cflags in
9604                 (-D*)
9605                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9606
9607                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9608                                 && test -z "${cf_tst_cflags}" \
9609                                 && cf_fix_cppflags=yes
9610
9611                         if test $cf_fix_cppflags = yes ; then
9612
9613         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9614         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9615
9616                                 continue
9617                         elif test "${cf_tst_cflags}" = "\"'" ; then
9618
9619         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9620         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9621
9622                                 continue
9623                         fi
9624                         ;;
9625                 esac
9626                 case "$CPPFLAGS" in
9627                 (*$cf_add_cflags)
9628                         ;;
9629                 (*)
9630                         case $cf_add_cflags in
9631                         (-D*)
9632                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9633
9634 CPPFLAGS=`echo "$CPPFLAGS" | \
9635         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9636                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9637
9638                                 ;;
9639                         esac
9640
9641         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9642         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9643
9644                         ;;
9645                 esac
9646                 ;;
9647         (*)
9648
9649         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9650         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9651
9652                 ;;
9653         esac
9654         ;;
9655 (yes)
9656
9657         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9658         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9659
9660         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9661
9662         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9663                 && test -z "${cf_tst_cflags}" \
9664                 && cf_fix_cppflags=no
9665         ;;
9666 esac
9667 done
9668
9669 if test -n "$cf_new_cflags" ; then
9670
9671         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9672         CFLAGS="${CFLAGS}$cf_new_cflags"
9673
9674 fi
9675
9676 if test -n "$cf_new_cppflags" ; then
9677
9678         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9679         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9680
9681 fi
9682
9683 if test -n "$cf_new_extra_cppflags" ; then
9684
9685         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9686         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9687
9688 fi
9689
9690 cf_add_libs="$LIBS"
9691 # reverse order
9692 cf_add_0lib=
9693 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9694 # filter duplicates
9695 for cf_add_1lib in $cf_add_0lib; do
9696         for cf_add_2lib in $cf_add_libs; do
9697                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9698                         cf_add_1lib=
9699                         break
9700                 fi
9701         done
9702         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9703 done
9704 LIBS="$cf_add_libs"
9705
9706                         cat >conftest.$ac_ext <<_ACEOF
9707 #line 9707 "configure"
9708 #include "confdefs.h"
9709 #include <${cf_cv_ncurses_header:-curses.h}>
9710 int
9711 main (void)
9712 {
9713 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9714   ;
9715   return 0;
9716 }
9717 _ACEOF
9718 rm -f conftest.$ac_objext conftest$ac_exeext
9719 if { (eval echo "$as_me:9719: \"$ac_link\"") >&5
9720   (eval $ac_link) 2>&5
9721   ac_status=$?
9722   echo "$as_me:9722: \$? = $ac_status" >&5
9723   (exit $ac_status); } &&
9724          { ac_try='test -s conftest$ac_exeext'
9725   { (eval echo "$as_me:9725: \"$ac_try\"") >&5
9726   (eval $ac_try) 2>&5
9727   ac_status=$?
9728   echo "$as_me:9728: \$? = $ac_status" >&5
9729   (exit $ac_status); }; }; then
9730   if test "$cross_compiling" = yes; then
9731   cf_test_ncuconfig=maybe
9732 else
9733   cat >conftest.$ac_ext <<_ACEOF
9734 #line 9734 "configure"
9735 #include "confdefs.h"
9736 #include <${cf_cv_ncurses_header:-curses.h}>
9737                                         int main(void)
9738                                         { char *xx = curses_version(); return (xx == 0); }
9739 _ACEOF
9740 rm -f conftest$ac_exeext
9741 if { (eval echo "$as_me:9741: \"$ac_link\"") >&5
9742   (eval $ac_link) 2>&5
9743   ac_status=$?
9744   echo "$as_me:9744: \$? = $ac_status" >&5
9745   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9746   { (eval echo "$as_me:9746: \"$ac_try\"") >&5
9747   (eval $ac_try) 2>&5
9748   ac_status=$?
9749   echo "$as_me:9749: \$? = $ac_status" >&5
9750   (exit $ac_status); }; }; then
9751   cf_test_ncuconfig=yes
9752 else
9753   echo "$as_me: program exited with status $ac_status" >&5
9754 echo "$as_me: failed program was:" >&5
9755 cat conftest.$ac_ext >&5
9756 cf_test_ncuconfig=no
9757 fi
9758 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9759 fi
9760 else
9761   echo "$as_me: failed program was:" >&5
9762 cat conftest.$ac_ext >&5
9763 cf_test_ncuconfig=no
9764 fi
9765 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9766
9767                         CFLAGS="$cf_save_CFLAGS"
9768                         CPPFLAGS="$cf_save_CPPFLAGS"
9769                         LIBS="$cf_save_LIBS"
9770
9771                         if test "x$cf_test_ncuconfig" != xyes; then
9772                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9773                                 cf_pkg_cflags="$cf_temp"
9774                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9775                                 cf_pkg_libs="$cf_temp"
9776                         fi
9777                         ;;
9778                 esac
9779
9780 cf_fix_cppflags=no
9781 cf_new_cflags=
9782 cf_new_cppflags=
9783 cf_new_extra_cppflags=
9784
9785 for cf_add_cflags in $cf_pkg_cflags
9786 do
9787 case $cf_fix_cppflags in
9788 (no)
9789         case $cf_add_cflags in
9790         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9791                 case $cf_add_cflags in
9792                 (-D*)
9793                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9794
9795                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9796                                 && test -z "${cf_tst_cflags}" \
9797                                 && cf_fix_cppflags=yes
9798
9799                         if test $cf_fix_cppflags = yes ; then
9800
9801         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9802         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9803
9804                                 continue
9805                         elif test "${cf_tst_cflags}" = "\"'" ; then
9806
9807         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9808         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9809
9810                                 continue
9811                         fi
9812                         ;;
9813                 esac
9814                 case "$CPPFLAGS" in
9815                 (*$cf_add_cflags)
9816                         ;;
9817                 (*)
9818                         case $cf_add_cflags in
9819                         (-D*)
9820                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9821
9822 CPPFLAGS=`echo "$CPPFLAGS" | \
9823         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9824                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9825
9826                                 ;;
9827                         esac
9828
9829         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9830         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9831
9832                         ;;
9833                 esac
9834                 ;;
9835         (*)
9836
9837         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9838         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9839
9840                 ;;
9841         esac
9842         ;;
9843 (yes)
9844
9845         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9846         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9847
9848         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9849
9850         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9851                 && test -z "${cf_tst_cflags}" \
9852                 && cf_fix_cppflags=no
9853         ;;
9854 esac
9855 done
9856
9857 if test -n "$cf_new_cflags" ; then
9858
9859         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9860         CFLAGS="${CFLAGS}$cf_new_cflags"
9861
9862 fi
9863
9864 if test -n "$cf_new_cppflags" ; then
9865
9866         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9867         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9868
9869 fi
9870
9871 if test -n "$cf_new_extra_cppflags" ; then
9872
9873         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9874         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9875
9876 fi
9877
9878 cf_add_libs="$LIBS"
9879 # reverse order
9880 cf_add_0lib=
9881 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9882 # filter duplicates
9883 for cf_add_1lib in $cf_add_0lib; do
9884         for cf_add_2lib in $cf_add_libs; do
9885                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9886                         cf_add_1lib=
9887                         break
9888                 fi
9889         done
9890         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9891 done
9892 LIBS="$cf_add_libs"
9893
9894                 cat >conftest.$ac_ext <<_ACEOF
9895 #line 9895 "configure"
9896 #include "confdefs.h"
9897 #include <${cf_cv_ncurses_header:-curses.h}>
9898 int
9899 main (void)
9900 {
9901 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9902   ;
9903   return 0;
9904 }
9905 _ACEOF
9906 rm -f conftest.$ac_objext conftest$ac_exeext
9907 if { (eval echo "$as_me:9907: \"$ac_link\"") >&5
9908   (eval $ac_link) 2>&5
9909   ac_status=$?
9910   echo "$as_me:9910: \$? = $ac_status" >&5
9911   (exit $ac_status); } &&
9912          { ac_try='test -s conftest$ac_exeext'
9913   { (eval echo "$as_me:9913: \"$ac_try\"") >&5
9914   (eval $ac_try) 2>&5
9915   ac_status=$?
9916   echo "$as_me:9916: \$? = $ac_status" >&5
9917   (exit $ac_status); }; }; then
9918   if test "$cross_compiling" = yes; then
9919   cf_have_ncuconfig=maybe
9920 else
9921   cat >conftest.$ac_ext <<_ACEOF
9922 #line 9922 "configure"
9923 #include "confdefs.h"
9924 #include <${cf_cv_ncurses_header:-curses.h}>
9925                                 int main(void)
9926                                 { char *xx = curses_version(); return (xx == 0); }
9927 _ACEOF
9928 rm -f conftest$ac_exeext
9929 if { (eval echo "$as_me:9929: \"$ac_link\"") >&5
9930   (eval $ac_link) 2>&5
9931   ac_status=$?
9932   echo "$as_me:9932: \$? = $ac_status" >&5
9933   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9934   { (eval echo "$as_me:9934: \"$ac_try\"") >&5
9935   (eval $ac_try) 2>&5
9936   ac_status=$?
9937   echo "$as_me:9937: \$? = $ac_status" >&5
9938   (exit $ac_status); }; }; then
9939   cf_have_ncuconfig=yes
9940 else
9941   echo "$as_me: program exited with status $ac_status" >&5
9942 echo "$as_me: failed program was:" >&5
9943 cat conftest.$ac_ext >&5
9944 cf_have_ncuconfig=no
9945 fi
9946 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9947 fi
9948 else
9949   echo "$as_me: failed program was:" >&5
9950 cat conftest.$ac_ext >&5
9951 cf_have_ncuconfig=no
9952 fi
9953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9954                 echo "$as_me:9954: result: $cf_have_ncuconfig" >&5
9955 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9956                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9957                 if test "$cf_have_ncuconfig" != "yes"
9958                 then
9959                         CPPFLAGS="$cf_save_CPPFLAGS"
9960                         LIBS="$cf_save_LIBS"
9961                         NCURSES_CONFIG_PKG=none
9962                 else
9963
9964 cat >>confdefs.h <<\EOF
9965 #define NCURSES 1
9966 EOF
9967
9968                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9969
9970 echo "$as_me:9970: checking for terminfo header" >&5
9971 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9972 if test "${cf_cv_term_header+set}" = set; then
9973   echo $ECHO_N "(cached) $ECHO_C" >&6
9974 else
9975
9976 case ${cf_cv_ncurses_header} in
9977 (*/ncurses.h|*/ncursesw.h)
9978         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9979         ;;
9980 (*)
9981         cf_term_header=term.h
9982         ;;
9983 esac
9984
9985 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9986 do
9987 cat >conftest.$ac_ext <<_ACEOF
9988 #line 9988 "configure"
9989 #include "confdefs.h"
9990 #include <stdio.h>
9991 #include <${cf_cv_ncurses_header:-curses.h}>
9992 #include <$cf_test>
9993
9994 int
9995 main (void)
9996 {
9997 int x = auto_left_margin
9998   ;
9999   return 0;
10000 }
10001 _ACEOF
10002 rm -f conftest.$ac_objext
10003 if { (eval echo "$as_me:10003: \"$ac_compile\"") >&5
10004   (eval $ac_compile) 2>&5
10005   ac_status=$?
10006   echo "$as_me:10006: \$? = $ac_status" >&5
10007   (exit $ac_status); } &&
10008          { ac_try='test -s conftest.$ac_objext'
10009   { (eval echo "$as_me:10009: \"$ac_try\"") >&5
10010   (eval $ac_try) 2>&5
10011   ac_status=$?
10012   echo "$as_me:10012: \$? = $ac_status" >&5
10013   (exit $ac_status); }; }; then
10014
10015         cf_cv_term_header="$cf_test"
10016 else
10017   echo "$as_me: failed program was:" >&5
10018 cat conftest.$ac_ext >&5
10019
10020         cf_cv_term_header=unknown
10021
10022 fi
10023 rm -f conftest.$ac_objext conftest.$ac_ext
10024         test "$cf_cv_term_header" != unknown && break
10025 done
10026
10027 fi
10028 echo "$as_me:10028: result: $cf_cv_term_header" >&5
10029 echo "${ECHO_T}$cf_cv_term_header" >&6
10030
10031 # Set definitions to allow ifdef'ing to accommodate subdirectories
10032
10033 case $cf_cv_term_header in
10034 (*term.h)
10035
10036 cat >>confdefs.h <<\EOF
10037 #define HAVE_TERM_H 1
10038 EOF
10039
10040         ;;
10041 esac
10042
10043 case $cf_cv_term_header in
10044 (ncurses/term.h)
10045
10046 cat >>confdefs.h <<\EOF
10047 #define HAVE_NCURSES_TERM_H 1
10048 EOF
10049
10050         ;;
10051 (ncursesw/term.h)
10052
10053 cat >>confdefs.h <<\EOF
10054 #define HAVE_NCURSESW_TERM_H 1
10055 EOF
10056
10057         ;;
10058 esac
10059
10060                 fi
10061
10062         else
10063                 echo "$as_me:10063: result: no" >&5
10064 echo "${ECHO_T}no" >&6
10065                 NCURSES_CONFIG_PKG=none
10066         fi
10067 else
10068         NCURSES_CONFIG_PKG=none
10069 fi
10070
10071 if test "x$cf_have_ncuconfig" = "xno"; then
10072         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10073
10074 if test -n "$ac_tool_prefix"; then
10075   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10076   do
10077     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10078 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10079 echo "$as_me:10079: checking for $ac_word" >&5
10080 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10081 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10082   echo $ECHO_N "(cached) $ECHO_C" >&6
10083 else
10084   if test -n "$NCURSES_CONFIG"; then
10085   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10086 else
10087   ac_save_IFS=$IFS; IFS=$ac_path_separator
10088 ac_dummy="$PATH"
10089 for ac_dir in $ac_dummy; do
10090   IFS=$ac_save_IFS
10091   test -z "$ac_dir" && ac_dir=.
10092   $as_executable_p "$ac_dir/$ac_word" || continue
10093 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10094 echo "$as_me:10094: found $ac_dir/$ac_word" >&5
10095 break
10096 done
10097
10098 fi
10099 fi
10100 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10101 if test -n "$NCURSES_CONFIG"; then
10102   echo "$as_me:10102: result: $NCURSES_CONFIG" >&5
10103 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10104 else
10105   echo "$as_me:10105: result: no" >&5
10106 echo "${ECHO_T}no" >&6
10107 fi
10108
10109     test -n "$NCURSES_CONFIG" && break
10110   done
10111 fi
10112 if test -z "$NCURSES_CONFIG"; then
10113   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10114   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10115 do
10116   # Extract the first word of "$ac_prog", so it can be a program name with args.
10117 set dummy $ac_prog; ac_word=$2
10118 echo "$as_me:10118: checking for $ac_word" >&5
10119 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10120 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10121   echo $ECHO_N "(cached) $ECHO_C" >&6
10122 else
10123   if test -n "$ac_ct_NCURSES_CONFIG"; then
10124   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10125 else
10126   ac_save_IFS=$IFS; IFS=$ac_path_separator
10127 ac_dummy="$PATH"
10128 for ac_dir in $ac_dummy; do
10129   IFS=$ac_save_IFS
10130   test -z "$ac_dir" && ac_dir=.
10131   $as_executable_p "$ac_dir/$ac_word" || continue
10132 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10133 echo "$as_me:10133: found $ac_dir/$ac_word" >&5
10134 break
10135 done
10136
10137 fi
10138 fi
10139 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10140 if test -n "$ac_ct_NCURSES_CONFIG"; then
10141   echo "$as_me:10141: result: $ac_ct_NCURSES_CONFIG" >&5
10142 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10143 else
10144   echo "$as_me:10144: result: no" >&5
10145 echo "${ECHO_T}no" >&6
10146 fi
10147
10148   test -n "$ac_ct_NCURSES_CONFIG" && break
10149 done
10150 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10151
10152   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10153 fi
10154
10155         if test "$NCURSES_CONFIG" != none ; then
10156
10157 cf_fix_cppflags=no
10158 cf_new_cflags=
10159 cf_new_cppflags=
10160 cf_new_extra_cppflags=
10161
10162 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10163 do
10164 case $cf_fix_cppflags in
10165 (no)
10166         case $cf_add_cflags in
10167         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10168                 case $cf_add_cflags in
10169                 (-D*)
10170                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10171
10172                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10173                                 && test -z "${cf_tst_cflags}" \
10174                                 && cf_fix_cppflags=yes
10175
10176                         if test $cf_fix_cppflags = yes ; then
10177
10178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10180
10181                                 continue
10182                         elif test "${cf_tst_cflags}" = "\"'" ; then
10183
10184         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10185         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10186
10187                                 continue
10188                         fi
10189                         ;;
10190                 esac
10191                 case "$CPPFLAGS" in
10192                 (*$cf_add_cflags)
10193                         ;;
10194                 (*)
10195                         case $cf_add_cflags in
10196                         (-D*)
10197                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10198
10199 CPPFLAGS=`echo "$CPPFLAGS" | \
10200         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10201                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10202
10203                                 ;;
10204                         esac
10205
10206         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10207         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10208
10209                         ;;
10210                 esac
10211                 ;;
10212         (*)
10213
10214         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10215         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10216
10217                 ;;
10218         esac
10219         ;;
10220 (yes)
10221
10222         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10223         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10224
10225         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10226
10227         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10228                 && test -z "${cf_tst_cflags}" \
10229                 && cf_fix_cppflags=no
10230         ;;
10231 esac
10232 done
10233
10234 if test -n "$cf_new_cflags" ; then
10235
10236         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10237         CFLAGS="${CFLAGS}$cf_new_cflags"
10238
10239 fi
10240
10241 if test -n "$cf_new_cppflags" ; then
10242
10243         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10244         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10245
10246 fi
10247
10248 if test -n "$cf_new_extra_cppflags" ; then
10249
10250         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10251         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10252
10253 fi
10254
10255 cf_add_libs="$LIBS"
10256 # reverse order
10257 cf_add_0lib=
10258 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10259 # filter duplicates
10260 for cf_add_1lib in $cf_add_0lib; do
10261         for cf_add_2lib in $cf_add_libs; do
10262                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10263                         cf_add_1lib=
10264                         break
10265                 fi
10266         done
10267         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10268 done
10269 LIBS="$cf_add_libs"
10270
10271                 # even with config script, some packages use no-override for curses.h
10272
10273 echo "$as_me:10273: checking if we have identified curses headers" >&5
10274 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10275 if test "${cf_cv_ncurses_header+set}" = set; then
10276   echo $ECHO_N "(cached) $ECHO_C" >&6
10277 else
10278
10279 cf_cv_ncurses_header=none
10280 for cf_header in \
10281         ncurses.h $cf_cv_screen/ncurses.h \
10282         curses.h $cf_cv_screen/curses.h
10283 do
10284 cat >conftest.$ac_ext <<_ACEOF
10285 #line 10285 "configure"
10286 #include "confdefs.h"
10287 #include <${cf_header}>
10288 int
10289 main (void)
10290 {
10291 initscr(); tgoto("?", 0,0)
10292   ;
10293   return 0;
10294 }
10295 _ACEOF
10296 rm -f conftest.$ac_objext
10297 if { (eval echo "$as_me:10297: \"$ac_compile\"") >&5
10298   (eval $ac_compile) 2>&5
10299   ac_status=$?
10300   echo "$as_me:10300: \$? = $ac_status" >&5
10301   (exit $ac_status); } &&
10302          { ac_try='test -s conftest.$ac_objext'
10303   { (eval echo "$as_me:10303: \"$ac_try\"") >&5
10304   (eval $ac_try) 2>&5
10305   ac_status=$?
10306   echo "$as_me:10306: \$? = $ac_status" >&5
10307   (exit $ac_status); }; }; then
10308   cf_cv_ncurses_header=$cf_header; break
10309 else
10310   echo "$as_me: failed program was:" >&5
10311 cat conftest.$ac_ext >&5
10312 fi
10313 rm -f conftest.$ac_objext conftest.$ac_ext
10314 done
10315
10316 fi
10317 echo "$as_me:10317: result: $cf_cv_ncurses_header" >&5
10318 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10319
10320 if test "$cf_cv_ncurses_header" = none ; then
10321         { { echo "$as_me:10321: error: No curses header-files found" >&5
10322 echo "$as_me: error: No curses header-files found" >&2;}
10323    { (exit 1); exit 1; }; }
10324 fi
10325
10326 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10327
10328 for ac_header in $cf_cv_ncurses_header
10329 do
10330 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10331 echo "$as_me:10331: checking for $ac_header" >&5
10332 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10333 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10334   echo $ECHO_N "(cached) $ECHO_C" >&6
10335 else
10336   cat >conftest.$ac_ext <<_ACEOF
10337 #line 10337 "configure"
10338 #include "confdefs.h"
10339 #include <$ac_header>
10340 _ACEOF
10341 if { (eval echo "$as_me:10341: \"$ac_cpp conftest.$ac_ext\"") >&5
10342   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10343   ac_status=$?
10344   egrep -v '^ *\+' conftest.er1 >conftest.err
10345   rm -f conftest.er1
10346   cat conftest.err >&5
10347   echo "$as_me:10347: \$? = $ac_status" >&5
10348   (exit $ac_status); } >/dev/null; then
10349   if test -s conftest.err; then
10350     ac_cpp_err=$ac_c_preproc_warn_flag
10351   else
10352     ac_cpp_err=
10353   fi
10354 else
10355   ac_cpp_err=yes
10356 fi
10357 if test -z "$ac_cpp_err"; then
10358   eval "$as_ac_Header=yes"
10359 else
10360   echo "$as_me: failed program was:" >&5
10361   cat conftest.$ac_ext >&5
10362   eval "$as_ac_Header=no"
10363 fi
10364 rm -f conftest.err conftest.$ac_ext
10365 fi
10366 echo "$as_me:10366: result: `eval echo '${'$as_ac_Header'}'`" >&5
10367 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10368 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10369   cat >>confdefs.h <<EOF
10370 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10371 EOF
10372
10373 fi
10374 done
10375
10376 cat >>confdefs.h <<\EOF
10377 #define NCURSES 1
10378 EOF
10379
10380 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10381
10382                 cat >>confdefs.h <<EOF
10383 #define $cf_nculib_ROOT 1
10384 EOF
10385
10386                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
10387
10388         else
10389
10390 cf_ncuhdr_root=$cf_cv_screen
10391
10392 test -n "$cf_cv_curses_dir" && \
10393 test "$cf_cv_curses_dir" != "no" && { \
10394
10395 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10396   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10397   do
10398         while test $cf_add_incdir != /usr/include
10399         do
10400           if test -d $cf_add_incdir
10401           then
10402                 cf_have_incdir=no
10403                 if test -n "$CFLAGS$CPPFLAGS" ; then
10404                   # a loop is needed to ensure we can add subdirs of existing dirs
10405                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10406                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10407                           cf_have_incdir=yes; break
10408                         fi
10409                   done
10410                 fi
10411
10412                 if test "$cf_have_incdir" = no ; then
10413                   if test "$cf_add_incdir" = /usr/local/include ; then
10414                         if test "$GCC" = yes
10415                         then
10416                           cf_save_CPPFLAGS=$CPPFLAGS
10417
10418         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10419         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10420
10421                           cat >conftest.$ac_ext <<_ACEOF
10422 #line 10422 "configure"
10423 #include "confdefs.h"
10424 #include <stdio.h>
10425 int
10426 main (void)
10427 {
10428 printf("Hello")
10429   ;
10430   return 0;
10431 }
10432 _ACEOF
10433 rm -f conftest.$ac_objext
10434 if { (eval echo "$as_me:10434: \"$ac_compile\"") >&5
10435   (eval $ac_compile) 2>&5
10436   ac_status=$?
10437   echo "$as_me:10437: \$? = $ac_status" >&5
10438   (exit $ac_status); } &&
10439          { ac_try='test -s conftest.$ac_objext'
10440   { (eval echo "$as_me:10440: \"$ac_try\"") >&5
10441   (eval $ac_try) 2>&5
10442   ac_status=$?
10443   echo "$as_me:10443: \$? = $ac_status" >&5
10444   (exit $ac_status); }; }; then
10445   :
10446 else
10447   echo "$as_me: failed program was:" >&5
10448 cat conftest.$ac_ext >&5
10449 cf_have_incdir=yes
10450 fi
10451 rm -f conftest.$ac_objext conftest.$ac_ext
10452                           CPPFLAGS=$cf_save_CPPFLAGS
10453                         fi
10454                   fi
10455                 fi
10456
10457                 if test "$cf_have_incdir" = no ; then
10458                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10459
10460 echo "${as_me:-configure}:10460: testing adding $cf_add_incdir to include-path ..." 1>&5
10461
10462                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10463
10464                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10465                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10466                   cf_add_incdir="$cf_top_incdir"
10467                 else
10468                   break
10469                 fi
10470           else
10471                 break
10472           fi
10473         done
10474   done
10475 fi
10476
10477 }
10478
10479 echo "$as_me:10479: checking for $cf_ncuhdr_root header in include-path" >&5
10480 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10481 if test "${cf_cv_ncurses_h+set}" = set; then
10482   echo $ECHO_N "(cached) $ECHO_C" >&6
10483 else
10484
10485         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10486         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
10487         for cf_header in $cf_header_list
10488         do
10489
10490         cat >conftest.$ac_ext <<_ACEOF
10491 #line 10491 "configure"
10492 #include "confdefs.h"
10493
10494 #include <$cf_header>
10495 int
10496 main (void)
10497 {
10498
10499 #ifdef NCURSES_VERSION
10500
10501 printf("%s\n", NCURSES_VERSION);
10502 #else
10503 #ifdef __NCURSES_H
10504 printf("old\n");
10505 #else
10506         make an error
10507 #endif
10508 #endif
10509
10510   ;
10511   return 0;
10512 }
10513 _ACEOF
10514 rm -f conftest.$ac_objext
10515 if { (eval echo "$as_me:10515: \"$ac_compile\"") >&5
10516   (eval $ac_compile) 2>&5
10517   ac_status=$?
10518   echo "$as_me:10518: \$? = $ac_status" >&5
10519   (exit $ac_status); } &&
10520          { ac_try='test -s conftest.$ac_objext'
10521   { (eval echo "$as_me:10521: \"$ac_try\"") >&5
10522   (eval $ac_try) 2>&5
10523   ac_status=$?
10524   echo "$as_me:10524: \$? = $ac_status" >&5
10525   (exit $ac_status); }; }; then
10526   cf_cv_ncurses_h=$cf_header
10527
10528 else
10529   echo "$as_me: failed program was:" >&5
10530 cat conftest.$ac_ext >&5
10531 cf_cv_ncurses_h=no
10532 fi
10533 rm -f conftest.$ac_objext conftest.$ac_ext
10534
10535                 test "$cf_cv_ncurses_h" != no && break
10536         done
10537
10538 fi
10539 echo "$as_me:10539: result: $cf_cv_ncurses_h" >&5
10540 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10541
10542 if test "$cf_cv_ncurses_h" != no ; then
10543         cf_cv_ncurses_header=$cf_cv_ncurses_h
10544 else
10545
10546 echo "$as_me:10546: checking for $cf_ncuhdr_root include-path" >&5
10547 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10548 if test "${cf_cv_ncurses_h2+set}" = set; then
10549   echo $ECHO_N "(cached) $ECHO_C" >&6
10550 else
10551
10552         test -n "$verbose" && echo
10553
10554 cf_search=
10555
10556 # collect the current set of include-directories from compiler flags
10557 cf_header_path_list=""
10558 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10559         for cf_header_path in $CPPFLAGS $CFLAGS
10560         do
10561                 case $cf_header_path in
10562                 (-I*)
10563                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10564
10565 test "x$cf_header_path" != "xNONE" && \
10566 test -d "$cf_header_path" && \
10567  {
10568         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10569         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10570         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10571         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10572         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10573         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"
10574 }
10575
10576                         cf_header_path_list="$cf_header_path_list $cf_search"
10577                         ;;
10578                 esac
10579         done
10580 fi
10581
10582 # add the variations for the package we are looking for
10583
10584 cf_search=
10585
10586 test "x$prefix" != "xNONE" && \
10587 test -d "$prefix" && \
10588  {
10589         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10590         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10591         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10592         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10593         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10594         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10595 }
10596
10597 for cf_subdir_prefix in \
10598         /usr \
10599         /usr/local \
10600         /usr/pkg \
10601         /opt \
10602         /opt/local \
10603         $HOME
10604 do
10605
10606 test "x$cf_subdir_prefix" != "x$prefix" && \
10607 test -d "$cf_subdir_prefix" && \
10608 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10609         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10610         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10611         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10612         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10613         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10614         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"
10615 }
10616
10617 done
10618
10619 test "$includedir" != NONE && \
10620 test "$includedir" != "/usr/include" && \
10621 test -d "$includedir" && {
10622         test -d $includedir &&    cf_search="$cf_search $includedir"
10623         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10624 }
10625
10626 test "$oldincludedir" != NONE && \
10627 test "$oldincludedir" != "/usr/include" && \
10628 test -d "$oldincludedir" && {
10629         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10630         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10631 }
10632
10633 cf_search="$cf_search $cf_header_path_list"
10634
10635         test -n "$verbose" && echo search path $cf_search
10636         cf_save2_CPPFLAGS="$CPPFLAGS"
10637         for cf_incdir in $cf_search
10638         do
10639
10640 if test -n "$cf_incdir" ; then
10641   for cf_add_incdir in $cf_incdir
10642   do
10643         while test $cf_add_incdir != /usr/include
10644         do
10645           if test -d $cf_add_incdir
10646           then
10647                 cf_have_incdir=no
10648                 if test -n "$CFLAGS$CPPFLAGS" ; then
10649                   # a loop is needed to ensure we can add subdirs of existing dirs
10650                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10651                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10652                           cf_have_incdir=yes; break
10653                         fi
10654                   done
10655                 fi
10656
10657                 if test "$cf_have_incdir" = no ; then
10658                   if test "$cf_add_incdir" = /usr/local/include ; then
10659                         if test "$GCC" = yes
10660                         then
10661                           cf_save_CPPFLAGS=$CPPFLAGS
10662
10663         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10664         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10665
10666                           cat >conftest.$ac_ext <<_ACEOF
10667 #line 10667 "configure"
10668 #include "confdefs.h"
10669 #include <stdio.h>
10670 int
10671 main (void)
10672 {
10673 printf("Hello")
10674   ;
10675   return 0;
10676 }
10677 _ACEOF
10678 rm -f conftest.$ac_objext
10679 if { (eval echo "$as_me:10679: \"$ac_compile\"") >&5
10680   (eval $ac_compile) 2>&5
10681   ac_status=$?
10682   echo "$as_me:10682: \$? = $ac_status" >&5
10683   (exit $ac_status); } &&
10684          { ac_try='test -s conftest.$ac_objext'
10685   { (eval echo "$as_me:10685: \"$ac_try\"") >&5
10686   (eval $ac_try) 2>&5
10687   ac_status=$?
10688   echo "$as_me:10688: \$? = $ac_status" >&5
10689   (exit $ac_status); }; }; then
10690   :
10691 else
10692   echo "$as_me: failed program was:" >&5
10693 cat conftest.$ac_ext >&5
10694 cf_have_incdir=yes
10695 fi
10696 rm -f conftest.$ac_objext conftest.$ac_ext
10697                           CPPFLAGS=$cf_save_CPPFLAGS
10698                         fi
10699                   fi
10700                 fi
10701
10702                 if test "$cf_have_incdir" = no ; then
10703                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10704
10705 echo "${as_me:-configure}:10705: testing adding $cf_add_incdir to include-path ..." 1>&5
10706
10707                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10708
10709                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10710                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10711                   cf_add_incdir="$cf_top_incdir"
10712                 else
10713                   break
10714                 fi
10715           else
10716                 break
10717           fi
10718         done
10719   done
10720 fi
10721
10722                 for cf_header in \
10723                         ncurses.h \
10724                         curses.h
10725                 do
10726
10727         cat >conftest.$ac_ext <<_ACEOF
10728 #line 10728 "configure"
10729 #include "confdefs.h"
10730
10731 #include <$cf_header>
10732 int
10733 main (void)
10734 {
10735
10736 #ifdef NCURSES_VERSION
10737
10738 printf("%s\n", NCURSES_VERSION);
10739 #else
10740 #ifdef __NCURSES_H
10741 printf("old\n");
10742 #else
10743         make an error
10744 #endif
10745 #endif
10746
10747   ;
10748   return 0;
10749 }
10750 _ACEOF
10751 rm -f conftest.$ac_objext
10752 if { (eval echo "$as_me:10752: \"$ac_compile\"") >&5
10753   (eval $ac_compile) 2>&5
10754   ac_status=$?
10755   echo "$as_me:10755: \$? = $ac_status" >&5
10756   (exit $ac_status); } &&
10757          { ac_try='test -s conftest.$ac_objext'
10758   { (eval echo "$as_me:10758: \"$ac_try\"") >&5
10759   (eval $ac_try) 2>&5
10760   ac_status=$?
10761   echo "$as_me:10761: \$? = $ac_status" >&5
10762   (exit $ac_status); }; }; then
10763   cf_cv_ncurses_h2=$cf_header
10764
10765 else
10766   echo "$as_me: failed program was:" >&5
10767 cat conftest.$ac_ext >&5
10768 cf_cv_ncurses_h2=no
10769 fi
10770 rm -f conftest.$ac_objext conftest.$ac_ext
10771
10772                         if test "$cf_cv_ncurses_h2" != no ; then
10773                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10774                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10775                                 break
10776                         fi
10777                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10778                 done
10779                 CPPFLAGS="$cf_save2_CPPFLAGS"
10780                 test "$cf_cv_ncurses_h2" != no && break
10781         done
10782         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10782: error: not found" >&5
10783 echo "$as_me: error: not found" >&2;}
10784    { (exit 1); exit 1; }; }
10785
10786 fi
10787 echo "$as_me:10787: result: $cf_cv_ncurses_h2" >&5
10788 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10789
10790         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10791         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10792         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10793                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10794         fi
10795
10796 if test -n "$cf_1st_incdir" ; then
10797   for cf_add_incdir in $cf_1st_incdir
10798   do
10799         while test $cf_add_incdir != /usr/include
10800         do
10801           if test -d $cf_add_incdir
10802           then
10803                 cf_have_incdir=no
10804                 if test -n "$CFLAGS$CPPFLAGS" ; then
10805                   # a loop is needed to ensure we can add subdirs of existing dirs
10806                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10807                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10808                           cf_have_incdir=yes; break
10809                         fi
10810                   done
10811                 fi
10812
10813                 if test "$cf_have_incdir" = no ; then
10814                   if test "$cf_add_incdir" = /usr/local/include ; then
10815                         if test "$GCC" = yes
10816                         then
10817                           cf_save_CPPFLAGS=$CPPFLAGS
10818
10819         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10820         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10821
10822                           cat >conftest.$ac_ext <<_ACEOF
10823 #line 10823 "configure"
10824 #include "confdefs.h"
10825 #include <stdio.h>
10826 int
10827 main (void)
10828 {
10829 printf("Hello")
10830   ;
10831   return 0;
10832 }
10833 _ACEOF
10834 rm -f conftest.$ac_objext
10835 if { (eval echo "$as_me:10835: \"$ac_compile\"") >&5
10836   (eval $ac_compile) 2>&5
10837   ac_status=$?
10838   echo "$as_me:10838: \$? = $ac_status" >&5
10839   (exit $ac_status); } &&
10840          { ac_try='test -s conftest.$ac_objext'
10841   { (eval echo "$as_me:10841: \"$ac_try\"") >&5
10842   (eval $ac_try) 2>&5
10843   ac_status=$?
10844   echo "$as_me:10844: \$? = $ac_status" >&5
10845   (exit $ac_status); }; }; then
10846   :
10847 else
10848   echo "$as_me: failed program was:" >&5
10849 cat conftest.$ac_ext >&5
10850 cf_have_incdir=yes
10851 fi
10852 rm -f conftest.$ac_objext conftest.$ac_ext
10853                           CPPFLAGS=$cf_save_CPPFLAGS
10854                         fi
10855                   fi
10856                 fi
10857
10858                 if test "$cf_have_incdir" = no ; then
10859                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10860
10861 echo "${as_me:-configure}:10861: testing adding $cf_add_incdir to include-path ..." 1>&5
10862
10863                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10864
10865                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10866                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10867                   cf_add_incdir="$cf_top_incdir"
10868                 else
10869                   break
10870                 fi
10871           else
10872                 break
10873           fi
10874         done
10875   done
10876 fi
10877
10878 fi
10879
10880 # Set definitions to allow ifdef'ing for ncurses.h
10881
10882 case $cf_cv_ncurses_header in
10883 (*ncurses.h)
10884
10885 cat >>confdefs.h <<\EOF
10886 #define HAVE_NCURSES_H 1
10887 EOF
10888
10889         ;;
10890 esac
10891
10892 case $cf_cv_ncurses_header in
10893 (ncurses/curses.h|ncurses/ncurses.h)
10894
10895 cat >>confdefs.h <<\EOF
10896 #define HAVE_NCURSES_NCURSES_H 1
10897 EOF
10898
10899         ;;
10900 (ncursesw/curses.h|ncursesw/ncurses.h)
10901
10902 cat >>confdefs.h <<\EOF
10903 #define HAVE_NCURSESW_NCURSES_H 1
10904 EOF
10905
10906         ;;
10907 esac
10908
10909 echo "$as_me:10909: checking for terminfo header" >&5
10910 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10911 if test "${cf_cv_term_header+set}" = set; then
10912   echo $ECHO_N "(cached) $ECHO_C" >&6
10913 else
10914
10915 case ${cf_cv_ncurses_header} in
10916 (*/ncurses.h|*/ncursesw.h)
10917         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10918         ;;
10919 (*)
10920         cf_term_header=term.h
10921         ;;
10922 esac
10923
10924 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10925 do
10926 cat >conftest.$ac_ext <<_ACEOF
10927 #line 10927 "configure"
10928 #include "confdefs.h"
10929 #include <stdio.h>
10930 #include <${cf_cv_ncurses_header:-curses.h}>
10931 #include <$cf_test>
10932
10933 int
10934 main (void)
10935 {
10936 int x = auto_left_margin
10937   ;
10938   return 0;
10939 }
10940 _ACEOF
10941 rm -f conftest.$ac_objext
10942 if { (eval echo "$as_me:10942: \"$ac_compile\"") >&5
10943   (eval $ac_compile) 2>&5
10944   ac_status=$?
10945   echo "$as_me:10945: \$? = $ac_status" >&5
10946   (exit $ac_status); } &&
10947          { ac_try='test -s conftest.$ac_objext'
10948   { (eval echo "$as_me:10948: \"$ac_try\"") >&5
10949   (eval $ac_try) 2>&5
10950   ac_status=$?
10951   echo "$as_me:10951: \$? = $ac_status" >&5
10952   (exit $ac_status); }; }; then
10953
10954         cf_cv_term_header="$cf_test"
10955 else
10956   echo "$as_me: failed program was:" >&5
10957 cat conftest.$ac_ext >&5
10958
10959         cf_cv_term_header=unknown
10960
10961 fi
10962 rm -f conftest.$ac_objext conftest.$ac_ext
10963         test "$cf_cv_term_header" != unknown && break
10964 done
10965
10966 fi
10967 echo "$as_me:10967: result: $cf_cv_term_header" >&5
10968 echo "${ECHO_T}$cf_cv_term_header" >&6
10969
10970 # Set definitions to allow ifdef'ing to accommodate subdirectories
10971
10972 case $cf_cv_term_header in
10973 (*term.h)
10974
10975 cat >>confdefs.h <<\EOF
10976 #define HAVE_TERM_H 1
10977 EOF
10978
10979         ;;
10980 esac
10981
10982 case $cf_cv_term_header in
10983 (ncurses/term.h)
10984
10985 cat >>confdefs.h <<\EOF
10986 #define HAVE_NCURSES_TERM_H 1
10987 EOF
10988
10989         ;;
10990 (ncursesw/term.h)
10991
10992 cat >>confdefs.h <<\EOF
10993 #define HAVE_NCURSESW_TERM_H 1
10994 EOF
10995
10996         ;;
10997 esac
10998
10999 # some applications need this, but should check for NCURSES_VERSION
11000
11001 cat >>confdefs.h <<\EOF
11002 #define NCURSES 1
11003 EOF
11004
11005 echo "$as_me:11005: checking for ncurses version" >&5
11006 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11007 if test "${cf_cv_ncurses_version+set}" = set; then
11008   echo $ECHO_N "(cached) $ECHO_C" >&6
11009 else
11010
11011         cf_cv_ncurses_version=no
11012         cf_tempfile=out$$
11013         rm -f $cf_tempfile
11014         if test "$cross_compiling" = yes; then
11015
11016         # This will not work if the preprocessor splits the line after the
11017         # Autoconf token.  The 'unproto' program does that.
11018         cat > conftest.$ac_ext <<EOF
11019 #include <${cf_cv_ncurses_header:-curses.h}>
11020 #undef Autoconf
11021 #ifdef NCURSES_VERSION
11022 Autoconf NCURSES_VERSION
11023 #else
11024 #ifdef __NCURSES_H
11025 Autoconf "old"
11026 #endif
11027 ;
11028 #endif
11029 EOF
11030         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11031         { (eval echo "$as_me:11031: \"$cf_try\"") >&5
11032   (eval $cf_try) 2>&5
11033   ac_status=$?
11034   echo "$as_me:11034: \$? = $ac_status" >&5
11035   (exit $ac_status); }
11036         if test -f conftest.out ; then
11037                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
11038                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11039                 rm -f conftest.out
11040         fi
11041
11042 else
11043   cat >conftest.$ac_ext <<_ACEOF
11044 #line 11044 "configure"
11045 #include "confdefs.h"
11046
11047 #include <${cf_cv_ncurses_header:-curses.h}>
11048 #include <stdio.h>
11049 int main(void)
11050 {
11051         FILE *fp = fopen("$cf_tempfile", "w");
11052 #ifdef NCURSES_VERSION
11053 # ifdef NCURSES_VERSION_PATCH
11054         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11055 # else
11056         fprintf(fp, "%s\n", NCURSES_VERSION);
11057 # endif
11058 #else
11059 # ifdef __NCURSES_H
11060         fprintf(fp, "old\n");
11061 # else
11062         make an error
11063 # endif
11064 #endif
11065         ${cf_cv_main_return:-return}(0);
11066 }
11067 _ACEOF
11068 rm -f conftest$ac_exeext
11069 if { (eval echo "$as_me:11069: \"$ac_link\"") >&5
11070   (eval $ac_link) 2>&5
11071   ac_status=$?
11072   echo "$as_me:11072: \$? = $ac_status" >&5
11073   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11074   { (eval echo "$as_me:11074: \"$ac_try\"") >&5
11075   (eval $ac_try) 2>&5
11076   ac_status=$?
11077   echo "$as_me:11077: \$? = $ac_status" >&5
11078   (exit $ac_status); }; }; then
11079
11080         cf_cv_ncurses_version=`cat $cf_tempfile`
11081 else
11082   echo "$as_me: program exited with status $ac_status" >&5
11083 echo "$as_me: failed program was:" >&5
11084 cat conftest.$ac_ext >&5
11085 fi
11086 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11087 fi
11088         rm -f $cf_tempfile
11089
11090 fi
11091 echo "$as_me:11091: result: $cf_cv_ncurses_version" >&5
11092 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11093 test "$cf_cv_ncurses_version" = no ||
11094 cat >>confdefs.h <<\EOF
11095 #define NCURSES 1
11096 EOF
11097
11098 cf_nculib_root=$cf_cv_screen
11099         # This works, except for the special case where we find gpm, but
11100         # ncurses is in a nonstandard location via $LIBS, and we really want
11101         # to link gpm.
11102 cf_ncurses_LIBS=""
11103 cf_ncurses_SAVE="$LIBS"
11104 echo "$as_me:11104: checking for Gpm_Open in -lgpm" >&5
11105 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11106 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11107   echo $ECHO_N "(cached) $ECHO_C" >&6
11108 else
11109   ac_check_lib_save_LIBS=$LIBS
11110 LIBS="-lgpm  $LIBS"
11111 cat >conftest.$ac_ext <<_ACEOF
11112 #line 11112 "configure"
11113 #include "confdefs.h"
11114
11115 /* Override any gcc2 internal prototype to avoid an error.  */
11116 #ifdef __cplusplus
11117 extern "C"
11118 #endif
11119 /* We use char because int might match the return type of a gcc2
11120    builtin and then its argument prototype would still apply.  */
11121 char Gpm_Open ();
11122 int
11123 main (void)
11124 {
11125 Gpm_Open ();
11126   ;
11127   return 0;
11128 }
11129 _ACEOF
11130 rm -f conftest.$ac_objext conftest$ac_exeext
11131 if { (eval echo "$as_me:11131: \"$ac_link\"") >&5
11132   (eval $ac_link) 2>&5
11133   ac_status=$?
11134   echo "$as_me:11134: \$? = $ac_status" >&5
11135   (exit $ac_status); } &&
11136          { ac_try='test -s conftest$ac_exeext'
11137   { (eval echo "$as_me:11137: \"$ac_try\"") >&5
11138   (eval $ac_try) 2>&5
11139   ac_status=$?
11140   echo "$as_me:11140: \$? = $ac_status" >&5
11141   (exit $ac_status); }; }; then
11142   ac_cv_lib_gpm_Gpm_Open=yes
11143 else
11144   echo "$as_me: failed program was:" >&5
11145 cat conftest.$ac_ext >&5
11146 ac_cv_lib_gpm_Gpm_Open=no
11147 fi
11148 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11149 LIBS=$ac_check_lib_save_LIBS
11150 fi
11151 echo "$as_me:11151: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11152 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11153 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
11154   echo "$as_me:11154: checking for initscr in -lgpm" >&5
11155 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11156 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11157   echo $ECHO_N "(cached) $ECHO_C" >&6
11158 else
11159   ac_check_lib_save_LIBS=$LIBS
11160 LIBS="-lgpm  $LIBS"
11161 cat >conftest.$ac_ext <<_ACEOF
11162 #line 11162 "configure"
11163 #include "confdefs.h"
11164
11165 /* Override any gcc2 internal prototype to avoid an error.  */
11166 #ifdef __cplusplus
11167 extern "C"
11168 #endif
11169 /* We use char because int might match the return type of a gcc2
11170    builtin and then its argument prototype would still apply.  */
11171 char initscr ();
11172 int
11173 main (void)
11174 {
11175 initscr ();
11176   ;
11177   return 0;
11178 }
11179 _ACEOF
11180 rm -f conftest.$ac_objext conftest$ac_exeext
11181 if { (eval echo "$as_me:11181: \"$ac_link\"") >&5
11182   (eval $ac_link) 2>&5
11183   ac_status=$?
11184   echo "$as_me:11184: \$? = $ac_status" >&5
11185   (exit $ac_status); } &&
11186          { ac_try='test -s conftest$ac_exeext'
11187   { (eval echo "$as_me:11187: \"$ac_try\"") >&5
11188   (eval $ac_try) 2>&5
11189   ac_status=$?
11190   echo "$as_me:11190: \$? = $ac_status" >&5
11191   (exit $ac_status); }; }; then
11192   ac_cv_lib_gpm_initscr=yes
11193 else
11194   echo "$as_me: failed program was:" >&5
11195 cat conftest.$ac_ext >&5
11196 ac_cv_lib_gpm_initscr=no
11197 fi
11198 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11199 LIBS=$ac_check_lib_save_LIBS
11200 fi
11201 echo "$as_me:11201: result: $ac_cv_lib_gpm_initscr" >&5
11202 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11203 if test $ac_cv_lib_gpm_initscr = yes; then
11204   LIBS="$cf_ncurses_SAVE"
11205 else
11206   cf_ncurses_LIBS="-lgpm"
11207 fi
11208
11209 fi
11210
11211 case $host_os in
11212 (freebsd*)
11213         # This is only necessary if you are linking against an obsolete
11214         # version of ncurses (but it should do no harm, since it's static).
11215         if test "$cf_nculib_root" = ncurses ; then
11216                 echo "$as_me:11216: checking for tgoto in -lmytinfo" >&5
11217 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11218 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11219   echo $ECHO_N "(cached) $ECHO_C" >&6
11220 else
11221   ac_check_lib_save_LIBS=$LIBS
11222 LIBS="-lmytinfo  $LIBS"
11223 cat >conftest.$ac_ext <<_ACEOF
11224 #line 11224 "configure"
11225 #include "confdefs.h"
11226
11227 /* Override any gcc2 internal prototype to avoid an error.  */
11228 #ifdef __cplusplus
11229 extern "C"
11230 #endif
11231 /* We use char because int might match the return type of a gcc2
11232    builtin and then its argument prototype would still apply.  */
11233 char tgoto ();
11234 int
11235 main (void)
11236 {
11237 tgoto ();
11238   ;
11239   return 0;
11240 }
11241 _ACEOF
11242 rm -f conftest.$ac_objext conftest$ac_exeext
11243 if { (eval echo "$as_me:11243: \"$ac_link\"") >&5
11244   (eval $ac_link) 2>&5
11245   ac_status=$?
11246   echo "$as_me:11246: \$? = $ac_status" >&5
11247   (exit $ac_status); } &&
11248          { ac_try='test -s conftest$ac_exeext'
11249   { (eval echo "$as_me:11249: \"$ac_try\"") >&5
11250   (eval $ac_try) 2>&5
11251   ac_status=$?
11252   echo "$as_me:11252: \$? = $ac_status" >&5
11253   (exit $ac_status); }; }; then
11254   ac_cv_lib_mytinfo_tgoto=yes
11255 else
11256   echo "$as_me: failed program was:" >&5
11257 cat conftest.$ac_ext >&5
11258 ac_cv_lib_mytinfo_tgoto=no
11259 fi
11260 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11261 LIBS=$ac_check_lib_save_LIBS
11262 fi
11263 echo "$as_me:11263: result: $ac_cv_lib_mytinfo_tgoto" >&5
11264 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11265 if test $ac_cv_lib_mytinfo_tgoto = yes; then
11266   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11267 fi
11268
11269         fi
11270         ;;
11271 esac
11272
11273 cf_add_libs="$LIBS"
11274 # reverse order
11275 cf_add_0lib=
11276 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11277 # filter duplicates
11278 for cf_add_1lib in $cf_add_0lib; do
11279         for cf_add_2lib in $cf_add_libs; do
11280                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11281                         cf_add_1lib=
11282                         break
11283                 fi
11284         done
11285         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11286 done
11287 LIBS="$cf_add_libs"
11288
11289 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
11290 then
11291
11292 cf_add_libs="$LIBS"
11293 # reverse order
11294 cf_add_0lib=
11295 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11296 # filter duplicates
11297 for cf_add_1lib in $cf_add_0lib; do
11298         for cf_add_2lib in $cf_add_libs; do
11299                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11300                         cf_add_1lib=
11301                         break
11302                 fi
11303         done
11304         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11305 done
11306 LIBS="$cf_add_libs"
11307
11308 else
11309
11310         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
11311         cf_libdir=""
11312         echo "$as_me:11312: checking for initscr" >&5
11313 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11314 if test "${ac_cv_func_initscr+set}" = set; then
11315   echo $ECHO_N "(cached) $ECHO_C" >&6
11316 else
11317   cat >conftest.$ac_ext <<_ACEOF
11318 #line 11318 "configure"
11319 #include "confdefs.h"
11320 #define initscr autoconf_temporary
11321 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11322 #undef initscr
11323
11324 #ifdef __cplusplus
11325 extern "C"
11326 #endif
11327
11328 /* We use char because int might match the return type of a gcc2
11329    builtin and then its argument prototype would still apply.  */
11330 char initscr (void);
11331
11332 int
11333 main (void)
11334 {
11335
11336 /* The GNU C library defines stubs for functions which it implements
11337     to always fail with ENOSYS.  Some functions are actually named
11338     something starting with __ and the normal name is an alias.  */
11339 #if defined (__stub_initscr) || defined (__stub___initscr)
11340 #error found stub for initscr
11341 #endif
11342
11343         return initscr ();
11344   ;
11345   return 0;
11346 }
11347 _ACEOF
11348 rm -f conftest.$ac_objext conftest$ac_exeext
11349 if { (eval echo "$as_me:11349: \"$ac_link\"") >&5
11350   (eval $ac_link) 2>&5
11351   ac_status=$?
11352   echo "$as_me:11352: \$? = $ac_status" >&5
11353   (exit $ac_status); } &&
11354          { ac_try='test -s conftest$ac_exeext'
11355   { (eval echo "$as_me:11355: \"$ac_try\"") >&5
11356   (eval $ac_try) 2>&5
11357   ac_status=$?
11358   echo "$as_me:11358: \$? = $ac_status" >&5
11359   (exit $ac_status); }; }; then
11360   ac_cv_func_initscr=yes
11361 else
11362   echo "$as_me: failed program was:" >&5
11363 cat conftest.$ac_ext >&5
11364 ac_cv_func_initscr=no
11365 fi
11366 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11367 fi
11368 echo "$as_me:11368: result: $ac_cv_func_initscr" >&5
11369 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11370 if test $ac_cv_func_initscr = yes; then
11371   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11372 else
11373
11374                 cf_save_LIBS="$LIBS"
11375                 echo "$as_me:11375: checking for initscr in -l$cf_nculib_root" >&5
11376 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11377                 LIBS="-l$cf_nculib_root $LIBS"
11378                 cat >conftest.$ac_ext <<_ACEOF
11379 #line 11379 "configure"
11380 #include "confdefs.h"
11381 #include <${cf_cv_ncurses_header:-curses.h}>
11382 int
11383 main (void)
11384 {
11385 initscr()
11386   ;
11387   return 0;
11388 }
11389 _ACEOF
11390 rm -f conftest.$ac_objext conftest$ac_exeext
11391 if { (eval echo "$as_me:11391: \"$ac_link\"") >&5
11392   (eval $ac_link) 2>&5
11393   ac_status=$?
11394   echo "$as_me:11394: \$? = $ac_status" >&5
11395   (exit $ac_status); } &&
11396          { ac_try='test -s conftest$ac_exeext'
11397   { (eval echo "$as_me:11397: \"$ac_try\"") >&5
11398   (eval $ac_try) 2>&5
11399   ac_status=$?
11400   echo "$as_me:11400: \$? = $ac_status" >&5
11401   (exit $ac_status); }; }; then
11402   echo "$as_me:11402: result: yes" >&5
11403 echo "${ECHO_T}yes" >&6
11404                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11405
11406 else
11407   echo "$as_me: failed program was:" >&5
11408 cat conftest.$ac_ext >&5
11409 echo "$as_me:11409: result: no" >&5
11410 echo "${ECHO_T}no" >&6
11411
11412 cf_search=
11413 cf_library_path_list=""
11414 if test -n "${LDFLAGS}${LIBS}" ; then
11415         for cf_library_path in $LDFLAGS $LIBS
11416         do
11417                 case $cf_library_path in
11418                 (-L*)
11419                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11420
11421 test "x$cf_library_path" != "xNONE" && \
11422 test -d "$cf_library_path" && \
11423  {
11424         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11425         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
11426         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11427         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11428         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11429         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"
11430 }
11431
11432                         cf_library_path_list="$cf_library_path_list $cf_search"
11433                         ;;
11434                 esac
11435         done
11436 fi
11437
11438 cf_search=
11439
11440 test "x$prefix" != "xNONE" && \
11441 test -d "$prefix" && \
11442  {
11443         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11444         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
11445         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11446         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11447         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11448         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11449 }
11450
11451 for cf_subdir_prefix in \
11452         /usr \
11453         /usr/local \
11454         /usr/pkg \
11455         /opt \
11456         /opt/local \
11457         $HOME
11458 do
11459
11460 test "x$cf_subdir_prefix" != "x$prefix" && \
11461 test -d "$cf_subdir_prefix" && \
11462 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
11463         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11464         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11465         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11466         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11467         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11468         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"
11469 }
11470
11471 done
11472
11473 cf_search="$cf_library_path_list $cf_search"
11474
11475                         for cf_libdir in $cf_search
11476                         do
11477                                 echo "$as_me:11477: checking for -l$cf_nculib_root in $cf_libdir" >&5
11478 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11479                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11480                                 cat >conftest.$ac_ext <<_ACEOF
11481 #line 11481 "configure"
11482 #include "confdefs.h"
11483 #include <${cf_cv_ncurses_header:-curses.h}>
11484 int
11485 main (void)
11486 {
11487 initscr()
11488   ;
11489   return 0;
11490 }
11491 _ACEOF
11492 rm -f conftest.$ac_objext conftest$ac_exeext
11493 if { (eval echo "$as_me:11493: \"$ac_link\"") >&5
11494   (eval $ac_link) 2>&5
11495   ac_status=$?
11496   echo "$as_me:11496: \$? = $ac_status" >&5
11497   (exit $ac_status); } &&
11498          { ac_try='test -s conftest$ac_exeext'
11499   { (eval echo "$as_me:11499: \"$ac_try\"") >&5
11500   (eval $ac_try) 2>&5
11501   ac_status=$?
11502   echo "$as_me:11502: \$? = $ac_status" >&5
11503   (exit $ac_status); }; }; then
11504   echo "$as_me:11504: result: yes" >&5
11505 echo "${ECHO_T}yes" >&6
11506                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11507                                          break
11508 else
11509   echo "$as_me: failed program was:" >&5
11510 cat conftest.$ac_ext >&5
11511 echo "$as_me:11511: result: no" >&5
11512 echo "${ECHO_T}no" >&6
11513                                          LIBS="$cf_save_LIBS"
11514 fi
11515 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11516                         done
11517
11518 fi
11519 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11520
11521 fi
11522
11523 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11524
11525 if test $cf_found_library = no ; then
11526         { { echo "$as_me:11526: error: Cannot link $cf_nculib_root library" >&5
11527 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11528    { (exit 1); exit 1; }; }
11529 fi
11530
11531 fi
11532
11533 if test -n "$cf_ncurses_LIBS" ; then
11534         echo "$as_me:11534: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11535 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11536         cf_ncurses_SAVE="$LIBS"
11537         for p in $cf_ncurses_LIBS ; do
11538                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11539                 if test "$q" != "$LIBS" ; then
11540                         LIBS="$q"
11541                 fi
11542         done
11543         cat >conftest.$ac_ext <<_ACEOF
11544 #line 11544 "configure"
11545 #include "confdefs.h"
11546 #include <${cf_cv_ncurses_header:-curses.h}>
11547 int
11548 main (void)
11549 {
11550 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11551   ;
11552   return 0;
11553 }
11554 _ACEOF
11555 rm -f conftest.$ac_objext conftest$ac_exeext
11556 if { (eval echo "$as_me:11556: \"$ac_link\"") >&5
11557   (eval $ac_link) 2>&5
11558   ac_status=$?
11559   echo "$as_me:11559: \$? = $ac_status" >&5
11560   (exit $ac_status); } &&
11561          { ac_try='test -s conftest$ac_exeext'
11562   { (eval echo "$as_me:11562: \"$ac_try\"") >&5
11563   (eval $ac_try) 2>&5
11564   ac_status=$?
11565   echo "$as_me:11565: \$? = $ac_status" >&5
11566   (exit $ac_status); }; }; then
11567   echo "$as_me:11567: result: yes" >&5
11568 echo "${ECHO_T}yes" >&6
11569 else
11570   echo "$as_me: failed program was:" >&5
11571 cat conftest.$ac_ext >&5
11572 echo "$as_me:11572: result: no" >&5
11573 echo "${ECHO_T}no" >&6
11574                  LIBS="$cf_ncurses_SAVE"
11575 fi
11576 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11577 fi
11578
11579 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11580
11581 cat >>confdefs.h <<EOF
11582 #define $cf_nculib_ROOT 1
11583 EOF
11584
11585         fi
11586 else
11587         NCURSES_CONFIG=none
11588 fi
11589
11590         ;;
11591 (pdcurses)
11592         echo "$as_me:11592: checking for X" >&5
11593 echo $ECHO_N "checking for X... $ECHO_C" >&6
11594
11595 # Check whether --with-x or --without-x was given.
11596 if test "${with_x+set}" = set; then
11597   withval="$with_x"
11598
11599 fi;
11600 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11601 if test "x$with_x" = xno; then
11602   # The user explicitly disabled X.
11603   have_x=disabled
11604 else
11605   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11606     # Both variables are already set.
11607     have_x=yes
11608   else
11609     if test "${ac_cv_have_x+set}" = set; then
11610   echo $ECHO_N "(cached) $ECHO_C" >&6
11611 else
11612   # One or both of the vars are not set, and there is no cached value.
11613 ac_x_includes=no ac_x_libraries=no
11614 rm -fr conftest.dir
11615 if mkdir conftest.dir; then
11616   cd conftest.dir
11617   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11618   cat >Imakefile <<'EOF'
11619 acfindx:
11620         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11621 EOF
11622   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11623     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11624     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11625     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11626     for ac_extension in a so sl dylib dll; do
11627       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11628          test -f $ac_im_libdir/libX11.$ac_extension; then
11629         ac_im_usrlibdir=$ac_im_libdir; break
11630       fi
11631     done
11632     # Screen out bogus values from the imake configuration.  They are
11633     # bogus both because they are the default anyway, and because
11634     # using them would break gcc on systems where it needs fixed includes.
11635     case $ac_im_incroot in
11636         /usr/include) ;;
11637         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11638     esac
11639     case $ac_im_usrlibdir in
11640         /usr/lib | /lib) ;;
11641         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11642     esac
11643   fi
11644   cd ..
11645   rm -fr conftest.dir
11646 fi
11647
11648 # Standard set of common directories for X headers.
11649 # Check X11 before X11Rn because it is often a symlink to the current release.
11650 ac_x_header_dirs='
11651 /usr/X11/include
11652 /usr/X11R7/include
11653 /usr/X11R6/include
11654 /usr/X11R5/include
11655 /usr/X11R4/include
11656
11657 /opt/local/include
11658 /opt/X11/include
11659
11660 /usr/include/X11
11661 /usr/include/X11R7
11662 /usr/include/X11R6
11663 /usr/include/X11R5
11664 /usr/include/X11R4
11665
11666 /usr/local/X11/include
11667 /usr/local/X11R7/include
11668 /usr/local/X11R6/include
11669 /usr/local/X11R5/include
11670 /usr/local/X11R4/include
11671
11672 /usr/local/include/X11
11673 /usr/local/include/X11R7
11674 /usr/local/include/X11R6
11675 /usr/local/include/X11R5
11676 /usr/local/include/X11R4
11677
11678 /usr/X386/include
11679 /usr/x386/include
11680 /usr/XFree86/include/X11
11681
11682 /usr/include
11683 /usr/local/include
11684 /usr/unsupported/include
11685 /usr/athena/include
11686 /usr/local/x11r5/include
11687 /usr/lpp/Xamples/include
11688
11689 /usr/openwin/include
11690 /usr/openwin/share/include'
11691
11692 if test "$ac_x_includes" = no; then
11693   # Guess where to find include files, by looking for Intrinsic.h.
11694   # First, try using that file with no special directory specified.
11695   cat >conftest.$ac_ext <<_ACEOF
11696 #line 11696 "configure"
11697 #include "confdefs.h"
11698 #include <X11/Intrinsic.h>
11699 _ACEOF
11700 if { (eval echo "$as_me:11700: \"$ac_cpp conftest.$ac_ext\"") >&5
11701   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11702   ac_status=$?
11703   egrep -v '^ *\+' conftest.er1 >conftest.err
11704   rm -f conftest.er1
11705   cat conftest.err >&5
11706   echo "$as_me:11706: \$? = $ac_status" >&5
11707   (exit $ac_status); } >/dev/null; then
11708   if test -s conftest.err; then
11709     ac_cpp_err=$ac_c_preproc_warn_flag
11710   else
11711     ac_cpp_err=
11712   fi
11713 else
11714   ac_cpp_err=yes
11715 fi
11716 if test -z "$ac_cpp_err"; then
11717   # We can compile using X headers with no special include directory.
11718 ac_x_includes=
11719 else
11720   echo "$as_me: failed program was:" >&5
11721   cat conftest.$ac_ext >&5
11722   for ac_dir in $ac_x_header_dirs; do
11723   if test -r "$ac_dir/X11/Intrinsic.h"; then
11724     ac_x_includes=$ac_dir
11725     break
11726   fi
11727 done
11728 fi
11729 rm -f conftest.err conftest.$ac_ext
11730 fi # $ac_x_includes = no
11731
11732 if test "$ac_x_libraries" = no; then
11733   # Check for the libraries.
11734   # See if we find them without any special options.
11735   # Don't add to $LIBS permanently.
11736   ac_save_LIBS=$LIBS
11737   LIBS="-lXt $LIBS"
11738   cat >conftest.$ac_ext <<_ACEOF
11739 #line 11739 "configure"
11740 #include "confdefs.h"
11741 #include <X11/Intrinsic.h>
11742 int
11743 main (void)
11744 {
11745 XtMalloc (0)
11746   ;
11747   return 0;
11748 }
11749 _ACEOF
11750 rm -f conftest.$ac_objext conftest$ac_exeext
11751 if { (eval echo "$as_me:11751: \"$ac_link\"") >&5
11752   (eval $ac_link) 2>&5
11753   ac_status=$?
11754   echo "$as_me:11754: \$? = $ac_status" >&5
11755   (exit $ac_status); } &&
11756          { ac_try='test -s conftest$ac_exeext'
11757   { (eval echo "$as_me:11757: \"$ac_try\"") >&5
11758   (eval $ac_try) 2>&5
11759   ac_status=$?
11760   echo "$as_me:11760: \$? = $ac_status" >&5
11761   (exit $ac_status); }; }; then
11762   LIBS=$ac_save_LIBS
11763 # We can link X programs with no special library path.
11764 ac_x_libraries=
11765 else
11766   echo "$as_me: failed program was:" >&5
11767 cat conftest.$ac_ext >&5
11768 LIBS=$ac_save_LIBS
11769 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11770 do
11771   # Don't even attempt the hair of trying to link an X program!
11772   for ac_extension in a so sl dylib dll; do
11773     if test -r $ac_dir/libXt.$ac_extension; then
11774       ac_x_libraries=$ac_dir
11775       break 2
11776     fi
11777   done
11778 done
11779 fi
11780 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11781 fi # $ac_x_libraries = no
11782
11783 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11784   # Didn't find X anywhere.  Cache the known absence of X.
11785   ac_cv_have_x="have_x=no"
11786 else
11787   # Record where we found X for the cache.
11788   ac_cv_have_x="have_x=yes \
11789                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11790 fi
11791 fi
11792
11793   fi
11794   eval "$ac_cv_have_x"
11795 fi # $with_x != no
11796
11797 if test "$have_x" != yes; then
11798   echo "$as_me:11798: result: $have_x" >&5
11799 echo "${ECHO_T}$have_x" >&6
11800   no_x=yes
11801 else
11802   # If each of the values was on the command line, it overrides each guess.
11803   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11804   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11805   # Update the cache value to reflect the command line values.
11806   ac_cv_have_x="have_x=yes \
11807                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11808   echo "$as_me:11808: result: libraries $x_libraries, headers $x_includes" >&5
11809 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11810 fi
11811
11812 if test "$no_x" = yes; then
11813   # Not all programs may use this symbol, but it does not hurt to define it.
11814
11815 cat >>confdefs.h <<\EOF
11816 #define X_DISPLAY_MISSING 1
11817 EOF
11818
11819   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11820 else
11821   if test -n "$x_includes"; then
11822     X_CFLAGS="$X_CFLAGS -I$x_includes"
11823   fi
11824
11825   # It would also be nice to do this for all -L options, not just this one.
11826   if test -n "$x_libraries"; then
11827     X_LIBS="$X_LIBS -L$x_libraries"
11828     # For Solaris; some versions of Sun CC require a space after -R and
11829     # others require no space.  Words are not sufficient . . . .
11830     case `(uname -sr) 2>/dev/null` in
11831     "SunOS 5"*)
11832       echo "$as_me:11832: checking whether -R must be followed by a space" >&5
11833 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11834       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11835       cat >conftest.$ac_ext <<_ACEOF
11836 #line 11836 "configure"
11837 #include "confdefs.h"
11838
11839 int
11840 main (void)
11841 {
11842
11843   ;
11844   return 0;
11845 }
11846 _ACEOF
11847 rm -f conftest.$ac_objext conftest$ac_exeext
11848 if { (eval echo "$as_me:11848: \"$ac_link\"") >&5
11849   (eval $ac_link) 2>&5
11850   ac_status=$?
11851   echo "$as_me:11851: \$? = $ac_status" >&5
11852   (exit $ac_status); } &&
11853          { ac_try='test -s conftest$ac_exeext'
11854   { (eval echo "$as_me:11854: \"$ac_try\"") >&5
11855   (eval $ac_try) 2>&5
11856   ac_status=$?
11857   echo "$as_me:11857: \$? = $ac_status" >&5
11858   (exit $ac_status); }; }; then
11859   ac_R_nospace=yes
11860 else
11861   echo "$as_me: failed program was:" >&5
11862 cat conftest.$ac_ext >&5
11863 ac_R_nospace=no
11864 fi
11865 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11866       if test $ac_R_nospace = yes; then
11867         echo "$as_me:11867: result: no" >&5
11868 echo "${ECHO_T}no" >&6
11869         X_LIBS="$X_LIBS -R$x_libraries"
11870       else
11871         LIBS="$ac_xsave_LIBS -R $x_libraries"
11872         cat >conftest.$ac_ext <<_ACEOF
11873 #line 11873 "configure"
11874 #include "confdefs.h"
11875
11876 int
11877 main (void)
11878 {
11879
11880   ;
11881   return 0;
11882 }
11883 _ACEOF
11884 rm -f conftest.$ac_objext conftest$ac_exeext
11885 if { (eval echo "$as_me:11885: \"$ac_link\"") >&5
11886   (eval $ac_link) 2>&5
11887   ac_status=$?
11888   echo "$as_me:11888: \$? = $ac_status" >&5
11889   (exit $ac_status); } &&
11890          { ac_try='test -s conftest$ac_exeext'
11891   { (eval echo "$as_me:11891: \"$ac_try\"") >&5
11892   (eval $ac_try) 2>&5
11893   ac_status=$?
11894   echo "$as_me:11894: \$? = $ac_status" >&5
11895   (exit $ac_status); }; }; then
11896   ac_R_space=yes
11897 else
11898   echo "$as_me: failed program was:" >&5
11899 cat conftest.$ac_ext >&5
11900 ac_R_space=no
11901 fi
11902 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11903         if test $ac_R_space = yes; then
11904           echo "$as_me:11904: result: yes" >&5
11905 echo "${ECHO_T}yes" >&6
11906           X_LIBS="$X_LIBS -R $x_libraries"
11907         else
11908           echo "$as_me:11908: result: neither works" >&5
11909 echo "${ECHO_T}neither works" >&6
11910         fi
11911       fi
11912       LIBS=$ac_xsave_LIBS
11913     esac
11914   fi
11915
11916   # Check for system-dependent libraries X programs must link with.
11917   # Do this before checking for the system-independent R6 libraries
11918   # (-lICE), since we may need -lsocket or whatever for X linking.
11919
11920   if test "$ISC" = yes; then
11921     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11922   else
11923     # Martyn Johnson says this is needed for Ultrix, if the X
11924     # libraries were built with DECnet support.  And Karl Berry says
11925     # the Alpha needs dnet_stub (dnet does not exist).
11926     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11927     cat >conftest.$ac_ext <<_ACEOF
11928 #line 11928 "configure"
11929 #include "confdefs.h"
11930
11931 /* Override any gcc2 internal prototype to avoid an error.  */
11932 #ifdef __cplusplus
11933 extern "C"
11934 #endif
11935 /* We use char because int might match the return type of a gcc2
11936    builtin and then its argument prototype would still apply.  */
11937 char XOpenDisplay ();
11938 int
11939 main (void)
11940 {
11941 XOpenDisplay ();
11942   ;
11943   return 0;
11944 }
11945 _ACEOF
11946 rm -f conftest.$ac_objext conftest$ac_exeext
11947 if { (eval echo "$as_me:11947: \"$ac_link\"") >&5
11948   (eval $ac_link) 2>&5
11949   ac_status=$?
11950   echo "$as_me:11950: \$? = $ac_status" >&5
11951   (exit $ac_status); } &&
11952          { ac_try='test -s conftest$ac_exeext'
11953   { (eval echo "$as_me:11953: \"$ac_try\"") >&5
11954   (eval $ac_try) 2>&5
11955   ac_status=$?
11956   echo "$as_me:11956: \$? = $ac_status" >&5
11957   (exit $ac_status); }; }; then
11958   :
11959 else
11960   echo "$as_me: failed program was:" >&5
11961 cat conftest.$ac_ext >&5
11962 echo "$as_me:11962: checking for dnet_ntoa in -ldnet" >&5
11963 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11964 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11965   echo $ECHO_N "(cached) $ECHO_C" >&6
11966 else
11967   ac_check_lib_save_LIBS=$LIBS
11968 LIBS="-ldnet  $LIBS"
11969 cat >conftest.$ac_ext <<_ACEOF
11970 #line 11970 "configure"
11971 #include "confdefs.h"
11972
11973 /* Override any gcc2 internal prototype to avoid an error.  */
11974 #ifdef __cplusplus
11975 extern "C"
11976 #endif
11977 /* We use char because int might match the return type of a gcc2
11978    builtin and then its argument prototype would still apply.  */
11979 char dnet_ntoa ();
11980 int
11981 main (void)
11982 {
11983 dnet_ntoa ();
11984   ;
11985   return 0;
11986 }
11987 _ACEOF
11988 rm -f conftest.$ac_objext conftest$ac_exeext
11989 if { (eval echo "$as_me:11989: \"$ac_link\"") >&5
11990   (eval $ac_link) 2>&5
11991   ac_status=$?
11992   echo "$as_me:11992: \$? = $ac_status" >&5
11993   (exit $ac_status); } &&
11994          { ac_try='test -s conftest$ac_exeext'
11995   { (eval echo "$as_me:11995: \"$ac_try\"") >&5
11996   (eval $ac_try) 2>&5
11997   ac_status=$?
11998   echo "$as_me:11998: \$? = $ac_status" >&5
11999   (exit $ac_status); }; }; then
12000   ac_cv_lib_dnet_dnet_ntoa=yes
12001 else
12002   echo "$as_me: failed program was:" >&5
12003 cat conftest.$ac_ext >&5
12004 ac_cv_lib_dnet_dnet_ntoa=no
12005 fi
12006 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12007 LIBS=$ac_check_lib_save_LIBS
12008 fi
12009 echo "$as_me:12009: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12010 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12011 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
12012   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12013 fi
12014
12015     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12016       echo "$as_me:12016: checking for dnet_ntoa in -ldnet_stub" >&5
12017 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12018 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12019   echo $ECHO_N "(cached) $ECHO_C" >&6
12020 else
12021   ac_check_lib_save_LIBS=$LIBS
12022 LIBS="-ldnet_stub  $LIBS"
12023 cat >conftest.$ac_ext <<_ACEOF
12024 #line 12024 "configure"
12025 #include "confdefs.h"
12026
12027 /* Override any gcc2 internal prototype to avoid an error.  */
12028 #ifdef __cplusplus
12029 extern "C"
12030 #endif
12031 /* We use char because int might match the return type of a gcc2
12032    builtin and then its argument prototype would still apply.  */
12033 char dnet_ntoa ();
12034 int
12035 main (void)
12036 {
12037 dnet_ntoa ();
12038   ;
12039   return 0;
12040 }
12041 _ACEOF
12042 rm -f conftest.$ac_objext conftest$ac_exeext
12043 if { (eval echo "$as_me:12043: \"$ac_link\"") >&5
12044   (eval $ac_link) 2>&5
12045   ac_status=$?
12046   echo "$as_me:12046: \$? = $ac_status" >&5
12047   (exit $ac_status); } &&
12048          { ac_try='test -s conftest$ac_exeext'
12049   { (eval echo "$as_me:12049: \"$ac_try\"") >&5
12050   (eval $ac_try) 2>&5
12051   ac_status=$?
12052   echo "$as_me:12052: \$? = $ac_status" >&5
12053   (exit $ac_status); }; }; then
12054   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12055 else
12056   echo "$as_me: failed program was:" >&5
12057 cat conftest.$ac_ext >&5
12058 ac_cv_lib_dnet_stub_dnet_ntoa=no
12059 fi
12060 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12061 LIBS=$ac_check_lib_save_LIBS
12062 fi
12063 echo "$as_me:12063: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12064 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12065 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
12066   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12067 fi
12068
12069     fi
12070 fi
12071 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12072     LIBS="$ac_xsave_LIBS"
12073
12074     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12075     # to get the SysV transport functions.
12076     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12077     # needs -lnsl.
12078     # The nsl library prevents programs from opening the X display
12079     # on Irix 5.2, according to T.E. Dickey.
12080     # The functions gethostbyname, getservbyname, and inet_addr are
12081     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12082     echo "$as_me:12082: checking for gethostbyname" >&5
12083 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12084 if test "${ac_cv_func_gethostbyname+set}" = set; then
12085   echo $ECHO_N "(cached) $ECHO_C" >&6
12086 else
12087   cat >conftest.$ac_ext <<_ACEOF
12088 #line 12088 "configure"
12089 #include "confdefs.h"
12090 #define gethostbyname autoconf_temporary
12091 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12092 #undef gethostbyname
12093
12094 #ifdef __cplusplus
12095 extern "C"
12096 #endif
12097
12098 /* We use char because int might match the return type of a gcc2
12099    builtin and then its argument prototype would still apply.  */
12100 char gethostbyname (void);
12101
12102 int
12103 main (void)
12104 {
12105
12106 /* The GNU C library defines stubs for functions which it implements
12107     to always fail with ENOSYS.  Some functions are actually named
12108     something starting with __ and the normal name is an alias.  */
12109 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12110 #error found stub for gethostbyname
12111 #endif
12112
12113         return gethostbyname ();
12114   ;
12115   return 0;
12116 }
12117 _ACEOF
12118 rm -f conftest.$ac_objext conftest$ac_exeext
12119 if { (eval echo "$as_me:12119: \"$ac_link\"") >&5
12120   (eval $ac_link) 2>&5
12121   ac_status=$?
12122   echo "$as_me:12122: \$? = $ac_status" >&5
12123   (exit $ac_status); } &&
12124          { ac_try='test -s conftest$ac_exeext'
12125   { (eval echo "$as_me:12125: \"$ac_try\"") >&5
12126   (eval $ac_try) 2>&5
12127   ac_status=$?
12128   echo "$as_me:12128: \$? = $ac_status" >&5
12129   (exit $ac_status); }; }; then
12130   ac_cv_func_gethostbyname=yes
12131 else
12132   echo "$as_me: failed program was:" >&5
12133 cat conftest.$ac_ext >&5
12134 ac_cv_func_gethostbyname=no
12135 fi
12136 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12137 fi
12138 echo "$as_me:12138: result: $ac_cv_func_gethostbyname" >&5
12139 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12140
12141     if test $ac_cv_func_gethostbyname = no; then
12142       echo "$as_me:12142: checking for gethostbyname in -lnsl" >&5
12143 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12144 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12145   echo $ECHO_N "(cached) $ECHO_C" >&6
12146 else
12147   ac_check_lib_save_LIBS=$LIBS
12148 LIBS="-lnsl  $LIBS"
12149 cat >conftest.$ac_ext <<_ACEOF
12150 #line 12150 "configure"
12151 #include "confdefs.h"
12152
12153 /* Override any gcc2 internal prototype to avoid an error.  */
12154 #ifdef __cplusplus
12155 extern "C"
12156 #endif
12157 /* We use char because int might match the return type of a gcc2
12158    builtin and then its argument prototype would still apply.  */
12159 char gethostbyname ();
12160 int
12161 main (void)
12162 {
12163 gethostbyname ();
12164   ;
12165   return 0;
12166 }
12167 _ACEOF
12168 rm -f conftest.$ac_objext conftest$ac_exeext
12169 if { (eval echo "$as_me:12169: \"$ac_link\"") >&5
12170   (eval $ac_link) 2>&5
12171   ac_status=$?
12172   echo "$as_me:12172: \$? = $ac_status" >&5
12173   (exit $ac_status); } &&
12174          { ac_try='test -s conftest$ac_exeext'
12175   { (eval echo "$as_me:12175: \"$ac_try\"") >&5
12176   (eval $ac_try) 2>&5
12177   ac_status=$?
12178   echo "$as_me:12178: \$? = $ac_status" >&5
12179   (exit $ac_status); }; }; then
12180   ac_cv_lib_nsl_gethostbyname=yes
12181 else
12182   echo "$as_me: failed program was:" >&5
12183 cat conftest.$ac_ext >&5
12184 ac_cv_lib_nsl_gethostbyname=no
12185 fi
12186 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12187 LIBS=$ac_check_lib_save_LIBS
12188 fi
12189 echo "$as_me:12189: result: $ac_cv_lib_nsl_gethostbyname" >&5
12190 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12191 if test $ac_cv_lib_nsl_gethostbyname = yes; then
12192   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12193 fi
12194
12195       if test $ac_cv_lib_nsl_gethostbyname = no; then
12196         echo "$as_me:12196: checking for gethostbyname in -lbsd" >&5
12197 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12198 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12199   echo $ECHO_N "(cached) $ECHO_C" >&6
12200 else
12201   ac_check_lib_save_LIBS=$LIBS
12202 LIBS="-lbsd  $LIBS"
12203 cat >conftest.$ac_ext <<_ACEOF
12204 #line 12204 "configure"
12205 #include "confdefs.h"
12206
12207 /* Override any gcc2 internal prototype to avoid an error.  */
12208 #ifdef __cplusplus
12209 extern "C"
12210 #endif
12211 /* We use char because int might match the return type of a gcc2
12212    builtin and then its argument prototype would still apply.  */
12213 char gethostbyname ();
12214 int
12215 main (void)
12216 {
12217 gethostbyname ();
12218   ;
12219   return 0;
12220 }
12221 _ACEOF
12222 rm -f conftest.$ac_objext conftest$ac_exeext
12223 if { (eval echo "$as_me:12223: \"$ac_link\"") >&5
12224   (eval $ac_link) 2>&5
12225   ac_status=$?
12226   echo "$as_me:12226: \$? = $ac_status" >&5
12227   (exit $ac_status); } &&
12228          { ac_try='test -s conftest$ac_exeext'
12229   { (eval echo "$as_me:12229: \"$ac_try\"") >&5
12230   (eval $ac_try) 2>&5
12231   ac_status=$?
12232   echo "$as_me:12232: \$? = $ac_status" >&5
12233   (exit $ac_status); }; }; then
12234   ac_cv_lib_bsd_gethostbyname=yes
12235 else
12236   echo "$as_me: failed program was:" >&5
12237 cat conftest.$ac_ext >&5
12238 ac_cv_lib_bsd_gethostbyname=no
12239 fi
12240 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12241 LIBS=$ac_check_lib_save_LIBS
12242 fi
12243 echo "$as_me:12243: result: $ac_cv_lib_bsd_gethostbyname" >&5
12244 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12245 if test $ac_cv_lib_bsd_gethostbyname = yes; then
12246   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12247 fi
12248
12249       fi
12250     fi
12251
12252     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12253     # socket/setsockopt and other routines are undefined under SCO ODT
12254     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12255     # on later versions), says Simon Leinen: it contains gethostby*
12256     # variants that don't use the nameserver (or something).  -lsocket
12257     # must be given before -lnsl if both are needed.  We assume that
12258     # if connect needs -lnsl, so does gethostbyname.
12259     echo "$as_me:12259: checking for connect" >&5
12260 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12261 if test "${ac_cv_func_connect+set}" = set; then
12262   echo $ECHO_N "(cached) $ECHO_C" >&6
12263 else
12264   cat >conftest.$ac_ext <<_ACEOF
12265 #line 12265 "configure"
12266 #include "confdefs.h"
12267 #define connect autoconf_temporary
12268 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12269 #undef connect
12270
12271 #ifdef __cplusplus
12272 extern "C"
12273 #endif
12274
12275 /* We use char because int might match the return type of a gcc2
12276    builtin and then its argument prototype would still apply.  */
12277 char connect (void);
12278
12279 int
12280 main (void)
12281 {
12282
12283 /* The GNU C library defines stubs for functions which it implements
12284     to always fail with ENOSYS.  Some functions are actually named
12285     something starting with __ and the normal name is an alias.  */
12286 #if defined (__stub_connect) || defined (__stub___connect)
12287 #error found stub for connect
12288 #endif
12289
12290         return connect ();
12291   ;
12292   return 0;
12293 }
12294 _ACEOF
12295 rm -f conftest.$ac_objext conftest$ac_exeext
12296 if { (eval echo "$as_me:12296: \"$ac_link\"") >&5
12297   (eval $ac_link) 2>&5
12298   ac_status=$?
12299   echo "$as_me:12299: \$? = $ac_status" >&5
12300   (exit $ac_status); } &&
12301          { ac_try='test -s conftest$ac_exeext'
12302   { (eval echo "$as_me:12302: \"$ac_try\"") >&5
12303   (eval $ac_try) 2>&5
12304   ac_status=$?
12305   echo "$as_me:12305: \$? = $ac_status" >&5
12306   (exit $ac_status); }; }; then
12307   ac_cv_func_connect=yes
12308 else
12309   echo "$as_me: failed program was:" >&5
12310 cat conftest.$ac_ext >&5
12311 ac_cv_func_connect=no
12312 fi
12313 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12314 fi
12315 echo "$as_me:12315: result: $ac_cv_func_connect" >&5
12316 echo "${ECHO_T}$ac_cv_func_connect" >&6
12317
12318     if test $ac_cv_func_connect = no; then
12319       echo "$as_me:12319: checking for connect in -lsocket" >&5
12320 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12321 if test "${ac_cv_lib_socket_connect+set}" = set; then
12322   echo $ECHO_N "(cached) $ECHO_C" >&6
12323 else
12324   ac_check_lib_save_LIBS=$LIBS
12325 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12326 cat >conftest.$ac_ext <<_ACEOF
12327 #line 12327 "configure"
12328 #include "confdefs.h"
12329
12330 /* Override any gcc2 internal prototype to avoid an error.  */
12331 #ifdef __cplusplus
12332 extern "C"
12333 #endif
12334 /* We use char because int might match the return type of a gcc2
12335    builtin and then its argument prototype would still apply.  */
12336 char connect ();
12337 int
12338 main (void)
12339 {
12340 connect ();
12341   ;
12342   return 0;
12343 }
12344 _ACEOF
12345 rm -f conftest.$ac_objext conftest$ac_exeext
12346 if { (eval echo "$as_me:12346: \"$ac_link\"") >&5
12347   (eval $ac_link) 2>&5
12348   ac_status=$?
12349   echo "$as_me:12349: \$? = $ac_status" >&5
12350   (exit $ac_status); } &&
12351          { ac_try='test -s conftest$ac_exeext'
12352   { (eval echo "$as_me:12352: \"$ac_try\"") >&5
12353   (eval $ac_try) 2>&5
12354   ac_status=$?
12355   echo "$as_me:12355: \$? = $ac_status" >&5
12356   (exit $ac_status); }; }; then
12357   ac_cv_lib_socket_connect=yes
12358 else
12359   echo "$as_me: failed program was:" >&5
12360 cat conftest.$ac_ext >&5
12361 ac_cv_lib_socket_connect=no
12362 fi
12363 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12364 LIBS=$ac_check_lib_save_LIBS
12365 fi
12366 echo "$as_me:12366: result: $ac_cv_lib_socket_connect" >&5
12367 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12368 if test $ac_cv_lib_socket_connect = yes; then
12369   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12370 fi
12371
12372     fi
12373
12374     # Guillermo Gomez says -lposix is necessary on A/UX.
12375     echo "$as_me:12375: checking for remove" >&5
12376 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12377 if test "${ac_cv_func_remove+set}" = set; then
12378   echo $ECHO_N "(cached) $ECHO_C" >&6
12379 else
12380   cat >conftest.$ac_ext <<_ACEOF
12381 #line 12381 "configure"
12382 #include "confdefs.h"
12383 #define remove autoconf_temporary
12384 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12385 #undef remove
12386
12387 #ifdef __cplusplus
12388 extern "C"
12389 #endif
12390
12391 /* We use char because int might match the return type of a gcc2
12392    builtin and then its argument prototype would still apply.  */
12393 char remove (void);
12394
12395 int
12396 main (void)
12397 {
12398
12399 /* The GNU C library defines stubs for functions which it implements
12400     to always fail with ENOSYS.  Some functions are actually named
12401     something starting with __ and the normal name is an alias.  */
12402 #if defined (__stub_remove) || defined (__stub___remove)
12403 #error found stub for remove
12404 #endif
12405
12406         return remove ();
12407   ;
12408   return 0;
12409 }
12410 _ACEOF
12411 rm -f conftest.$ac_objext conftest$ac_exeext
12412 if { (eval echo "$as_me:12412: \"$ac_link\"") >&5
12413   (eval $ac_link) 2>&5
12414   ac_status=$?
12415   echo "$as_me:12415: \$? = $ac_status" >&5
12416   (exit $ac_status); } &&
12417          { ac_try='test -s conftest$ac_exeext'
12418   { (eval echo "$as_me:12418: \"$ac_try\"") >&5
12419   (eval $ac_try) 2>&5
12420   ac_status=$?
12421   echo "$as_me:12421: \$? = $ac_status" >&5
12422   (exit $ac_status); }; }; then
12423   ac_cv_func_remove=yes
12424 else
12425   echo "$as_me: failed program was:" >&5
12426 cat conftest.$ac_ext >&5
12427 ac_cv_func_remove=no
12428 fi
12429 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12430 fi
12431 echo "$as_me:12431: result: $ac_cv_func_remove" >&5
12432 echo "${ECHO_T}$ac_cv_func_remove" >&6
12433
12434     if test $ac_cv_func_remove = no; then
12435       echo "$as_me:12435: checking for remove in -lposix" >&5
12436 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12437 if test "${ac_cv_lib_posix_remove+set}" = set; then
12438   echo $ECHO_N "(cached) $ECHO_C" >&6
12439 else
12440   ac_check_lib_save_LIBS=$LIBS
12441 LIBS="-lposix  $LIBS"
12442 cat >conftest.$ac_ext <<_ACEOF
12443 #line 12443 "configure"
12444 #include "confdefs.h"
12445
12446 /* Override any gcc2 internal prototype to avoid an error.  */
12447 #ifdef __cplusplus
12448 extern "C"
12449 #endif
12450 /* We use char because int might match the return type of a gcc2
12451    builtin and then its argument prototype would still apply.  */
12452 char remove ();
12453 int
12454 main (void)
12455 {
12456 remove ();
12457   ;
12458   return 0;
12459 }
12460 _ACEOF
12461 rm -f conftest.$ac_objext conftest$ac_exeext
12462 if { (eval echo "$as_me:12462: \"$ac_link\"") >&5
12463   (eval $ac_link) 2>&5
12464   ac_status=$?
12465   echo "$as_me:12465: \$? = $ac_status" >&5
12466   (exit $ac_status); } &&
12467          { ac_try='test -s conftest$ac_exeext'
12468   { (eval echo "$as_me:12468: \"$ac_try\"") >&5
12469   (eval $ac_try) 2>&5
12470   ac_status=$?
12471   echo "$as_me:12471: \$? = $ac_status" >&5
12472   (exit $ac_status); }; }; then
12473   ac_cv_lib_posix_remove=yes
12474 else
12475   echo "$as_me: failed program was:" >&5
12476 cat conftest.$ac_ext >&5
12477 ac_cv_lib_posix_remove=no
12478 fi
12479 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12480 LIBS=$ac_check_lib_save_LIBS
12481 fi
12482 echo "$as_me:12482: result: $ac_cv_lib_posix_remove" >&5
12483 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12484 if test $ac_cv_lib_posix_remove = yes; then
12485   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12486 fi
12487
12488     fi
12489
12490     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12491     echo "$as_me:12491: checking for shmat" >&5
12492 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12493 if test "${ac_cv_func_shmat+set}" = set; then
12494   echo $ECHO_N "(cached) $ECHO_C" >&6
12495 else
12496   cat >conftest.$ac_ext <<_ACEOF
12497 #line 12497 "configure"
12498 #include "confdefs.h"
12499 #define shmat autoconf_temporary
12500 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12501 #undef shmat
12502
12503 #ifdef __cplusplus
12504 extern "C"
12505 #endif
12506
12507 /* We use char because int might match the return type of a gcc2
12508    builtin and then its argument prototype would still apply.  */
12509 char shmat (void);
12510
12511 int
12512 main (void)
12513 {
12514
12515 /* The GNU C library defines stubs for functions which it implements
12516     to always fail with ENOSYS.  Some functions are actually named
12517     something starting with __ and the normal name is an alias.  */
12518 #if defined (__stub_shmat) || defined (__stub___shmat)
12519 #error found stub for shmat
12520 #endif
12521
12522         return shmat ();
12523   ;
12524   return 0;
12525 }
12526 _ACEOF
12527 rm -f conftest.$ac_objext conftest$ac_exeext
12528 if { (eval echo "$as_me:12528: \"$ac_link\"") >&5
12529   (eval $ac_link) 2>&5
12530   ac_status=$?
12531   echo "$as_me:12531: \$? = $ac_status" >&5
12532   (exit $ac_status); } &&
12533          { ac_try='test -s conftest$ac_exeext'
12534   { (eval echo "$as_me:12534: \"$ac_try\"") >&5
12535   (eval $ac_try) 2>&5
12536   ac_status=$?
12537   echo "$as_me:12537: \$? = $ac_status" >&5
12538   (exit $ac_status); }; }; then
12539   ac_cv_func_shmat=yes
12540 else
12541   echo "$as_me: failed program was:" >&5
12542 cat conftest.$ac_ext >&5
12543 ac_cv_func_shmat=no
12544 fi
12545 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12546 fi
12547 echo "$as_me:12547: result: $ac_cv_func_shmat" >&5
12548 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12549
12550     if test $ac_cv_func_shmat = no; then
12551       echo "$as_me:12551: checking for shmat in -lipc" >&5
12552 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12553 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12554   echo $ECHO_N "(cached) $ECHO_C" >&6
12555 else
12556   ac_check_lib_save_LIBS=$LIBS
12557 LIBS="-lipc  $LIBS"
12558 cat >conftest.$ac_ext <<_ACEOF
12559 #line 12559 "configure"
12560 #include "confdefs.h"
12561
12562 /* Override any gcc2 internal prototype to avoid an error.  */
12563 #ifdef __cplusplus
12564 extern "C"
12565 #endif
12566 /* We use char because int might match the return type of a gcc2
12567    builtin and then its argument prototype would still apply.  */
12568 char shmat ();
12569 int
12570 main (void)
12571 {
12572 shmat ();
12573   ;
12574   return 0;
12575 }
12576 _ACEOF
12577 rm -f conftest.$ac_objext conftest$ac_exeext
12578 if { (eval echo "$as_me:12578: \"$ac_link\"") >&5
12579   (eval $ac_link) 2>&5
12580   ac_status=$?
12581   echo "$as_me:12581: \$? = $ac_status" >&5
12582   (exit $ac_status); } &&
12583          { ac_try='test -s conftest$ac_exeext'
12584   { (eval echo "$as_me:12584: \"$ac_try\"") >&5
12585   (eval $ac_try) 2>&5
12586   ac_status=$?
12587   echo "$as_me:12587: \$? = $ac_status" >&5
12588   (exit $ac_status); }; }; then
12589   ac_cv_lib_ipc_shmat=yes
12590 else
12591   echo "$as_me: failed program was:" >&5
12592 cat conftest.$ac_ext >&5
12593 ac_cv_lib_ipc_shmat=no
12594 fi
12595 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12596 LIBS=$ac_check_lib_save_LIBS
12597 fi
12598 echo "$as_me:12598: result: $ac_cv_lib_ipc_shmat" >&5
12599 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12600 if test $ac_cv_lib_ipc_shmat = yes; then
12601   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12602 fi
12603
12604     fi
12605   fi
12606
12607   # Check for libraries that X11R6 Xt/Xaw programs need.
12608   ac_save_LDFLAGS=$LDFLAGS
12609   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12610   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12611   # check for ICE first), but we must link in the order -lSM -lICE or
12612   # we get undefined symbols.  So assume we have SM if we have ICE.
12613   # These have to be linked with before -lX11, unlike the other
12614   # libraries we check for below, so use a different variable.
12615   # John Interrante, Karl Berry
12616   echo "$as_me:12616: checking for IceConnectionNumber in -lICE" >&5
12617 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12618 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12619   echo $ECHO_N "(cached) $ECHO_C" >&6
12620 else
12621   ac_check_lib_save_LIBS=$LIBS
12622 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12623 cat >conftest.$ac_ext <<_ACEOF
12624 #line 12624 "configure"
12625 #include "confdefs.h"
12626
12627 /* Override any gcc2 internal prototype to avoid an error.  */
12628 #ifdef __cplusplus
12629 extern "C"
12630 #endif
12631 /* We use char because int might match the return type of a gcc2
12632    builtin and then its argument prototype would still apply.  */
12633 char IceConnectionNumber ();
12634 int
12635 main (void)
12636 {
12637 IceConnectionNumber ();
12638   ;
12639   return 0;
12640 }
12641 _ACEOF
12642 rm -f conftest.$ac_objext conftest$ac_exeext
12643 if { (eval echo "$as_me:12643: \"$ac_link\"") >&5
12644   (eval $ac_link) 2>&5
12645   ac_status=$?
12646   echo "$as_me:12646: \$? = $ac_status" >&5
12647   (exit $ac_status); } &&
12648          { ac_try='test -s conftest$ac_exeext'
12649   { (eval echo "$as_me:12649: \"$ac_try\"") >&5
12650   (eval $ac_try) 2>&5
12651   ac_status=$?
12652   echo "$as_me:12652: \$? = $ac_status" >&5
12653   (exit $ac_status); }; }; then
12654   ac_cv_lib_ICE_IceConnectionNumber=yes
12655 else
12656   echo "$as_me: failed program was:" >&5
12657 cat conftest.$ac_ext >&5
12658 ac_cv_lib_ICE_IceConnectionNumber=no
12659 fi
12660 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12661 LIBS=$ac_check_lib_save_LIBS
12662 fi
12663 echo "$as_me:12663: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12664 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12665 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12666   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12667 fi
12668
12669   LDFLAGS=$ac_save_LDFLAGS
12670
12671 fi
12672
12673 cf_x_athena=${cf_x_athena:-Xaw}
12674
12675 echo "$as_me:12675: checking if you want to link with Xaw 3d library" >&5
12676 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12677 withval=
12678
12679 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12680 if test "${with_Xaw3d+set}" = set; then
12681   withval="$with_Xaw3d"
12682
12683 fi;
12684 if test "$withval" = yes ; then
12685         cf_x_athena=Xaw3d
12686         echo "$as_me:12686: result: yes" >&5
12687 echo "${ECHO_T}yes" >&6
12688 else
12689         echo "$as_me:12689: result: no" >&5
12690 echo "${ECHO_T}no" >&6
12691 fi
12692
12693 echo "$as_me:12693: checking if you want to link with Xaw 3d xft library" >&5
12694 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12695 withval=
12696
12697 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12698 if test "${with_Xaw3dxft+set}" = set; then
12699   withval="$with_Xaw3dxft"
12700
12701 fi;
12702 if test "$withval" = yes ; then
12703         cf_x_athena=Xaw3dxft
12704         echo "$as_me:12704: result: yes" >&5
12705 echo "${ECHO_T}yes" >&6
12706 else
12707         echo "$as_me:12707: result: no" >&5
12708 echo "${ECHO_T}no" >&6
12709 fi
12710
12711 echo "$as_me:12711: checking if you want to link with neXT Athena library" >&5
12712 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12713 withval=
12714
12715 # Check whether --with-neXtaw or --without-neXtaw was given.
12716 if test "${with_neXtaw+set}" = set; then
12717   withval="$with_neXtaw"
12718
12719 fi;
12720 if test "$withval" = yes ; then
12721         cf_x_athena=neXtaw
12722         echo "$as_me:12722: result: yes" >&5
12723 echo "${ECHO_T}yes" >&6
12724 else
12725         echo "$as_me:12725: result: no" >&5
12726 echo "${ECHO_T}no" >&6
12727 fi
12728
12729 echo "$as_me:12729: checking if you want to link with Athena-Plus library" >&5
12730 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12731 withval=
12732
12733 # Check whether --with-XawPlus or --without-XawPlus was given.
12734 if test "${with_XawPlus+set}" = set; then
12735   withval="$with_XawPlus"
12736
12737 fi;
12738 if test "$withval" = yes ; then
12739         cf_x_athena=XawPlus
12740         echo "$as_me:12740: result: yes" >&5
12741 echo "${ECHO_T}yes" >&6
12742 else
12743         echo "$as_me:12743: result: no" >&5
12744 echo "${ECHO_T}no" >&6
12745 fi
12746
12747 cf_x_athena_lib=""
12748
12749 if test "$PKG_CONFIG" != none ; then
12750         cf_athena_list=
12751         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12752         for cf_athena_pkg in \
12753                 $cf_athena_list \
12754                 ${cf_x_athena} \
12755                 ${cf_x_athena}-devel \
12756                 lib${cf_x_athena} \
12757                 lib${cf_x_athena}-devel
12758         do
12759
12760 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12761         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12762
12763 echo "${as_me:-configure}:12763: testing found package $cf_athena_pkg ..." 1>&5
12764
12765         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12766         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12767         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12768
12769 echo "${as_me:-configure}:12769: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12770
12771         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12772
12773 echo "${as_me:-configure}:12773: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12774
12775 cf_fix_cppflags=no
12776 cf_new_cflags=
12777 cf_new_cppflags=
12778 cf_new_extra_cppflags=
12779
12780 for cf_add_cflags in $cf_pkgconfig_incs
12781 do
12782 case $cf_fix_cppflags in
12783 (no)
12784         case $cf_add_cflags in
12785         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12786                 case $cf_add_cflags in
12787                 (-D*)
12788                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12789
12790                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12791                                 && test -z "${cf_tst_cflags}" \
12792                                 && cf_fix_cppflags=yes
12793
12794                         if test $cf_fix_cppflags = yes ; then
12795
12796         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12797         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12798
12799                                 continue
12800                         elif test "${cf_tst_cflags}" = "\"'" ; then
12801
12802         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12803         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12804
12805                                 continue
12806                         fi
12807                         ;;
12808                 esac
12809                 case "$CPPFLAGS" in
12810                 (*$cf_add_cflags)
12811                         ;;
12812                 (*)
12813                         case $cf_add_cflags in
12814                         (-D*)
12815                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12816
12817 CPPFLAGS=`echo "$CPPFLAGS" | \
12818         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12819                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12820
12821                                 ;;
12822                         esac
12823
12824         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12825         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12826
12827                         ;;
12828                 esac
12829                 ;;
12830         (*)
12831
12832         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12833         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12834
12835                 ;;
12836         esac
12837         ;;
12838 (yes)
12839
12840         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12841         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12842
12843         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12844
12845         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12846                 && test -z "${cf_tst_cflags}" \
12847                 && cf_fix_cppflags=no
12848         ;;
12849 esac
12850 done
12851
12852 if test -n "$cf_new_cflags" ; then
12853
12854         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12855         CFLAGS="${CFLAGS}$cf_new_cflags"
12856
12857 fi
12858
12859 if test -n "$cf_new_cppflags" ; then
12860
12861         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12862         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12863
12864 fi
12865
12866 if test -n "$cf_new_extra_cppflags" ; then
12867
12868         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12869         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12870
12871 fi
12872
12873 cf_add_libs="$LIBS"
12874 # reverse order
12875 cf_add_0lib=
12876 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12877 # filter duplicates
12878 for cf_add_1lib in $cf_add_0lib; do
12879         for cf_add_2lib in $cf_add_libs; do
12880                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12881                         cf_add_1lib=
12882                         break
12883                 fi
12884         done
12885         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12886 done
12887 LIBS="$cf_add_libs"
12888
12889                         cf_x_athena_lib="$cf_pkgconfig_libs"
12890
12891 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12892
12893                         cat >>confdefs.h <<EOF
12894 #define $cf_x_athena_LIBS 1
12895 EOF
12896
12897         for cf_trim_lib in Xmu Xt X11
12898         do
12899                 case "$LIBS" in
12900                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12901                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12902                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12903
12904 echo "${as_me:-configure}:12904: testing ..trimmed $LIBS ..." 1>&5
12905
12906                         ;;
12907                 esac
12908         done
12909
12910 echo "$as_me:12910: checking for usable $cf_x_athena/Xmu package" >&5
12911 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12912 if test "${cf_cv_xaw_compat+set}" = set; then
12913   echo $ECHO_N "(cached) $ECHO_C" >&6
12914 else
12915
12916 cat >conftest.$ac_ext <<_ACEOF
12917 #line 12917 "configure"
12918 #include "confdefs.h"
12919
12920 #include <X11/Xmu/CharSet.h>
12921
12922 int
12923 main (void)
12924 {
12925
12926 int check = XmuCompareISOLatin1("big", "small")
12927
12928   ;
12929   return 0;
12930 }
12931 _ACEOF
12932 rm -f conftest.$ac_objext conftest$ac_exeext
12933 if { (eval echo "$as_me:12933: \"$ac_link\"") >&5
12934   (eval $ac_link) 2>&5
12935   ac_status=$?
12936   echo "$as_me:12936: \$? = $ac_status" >&5
12937   (exit $ac_status); } &&
12938          { ac_try='test -s conftest$ac_exeext'
12939   { (eval echo "$as_me:12939: \"$ac_try\"") >&5
12940   (eval $ac_try) 2>&5
12941   ac_status=$?
12942   echo "$as_me:12942: \$? = $ac_status" >&5
12943   (exit $ac_status); }; }; then
12944   cf_cv_xaw_compat=yes
12945 else
12946   echo "$as_me: failed program was:" >&5
12947 cat conftest.$ac_ext >&5
12948 cf_cv_xaw_compat=no
12949 fi
12950 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12951 fi
12952 echo "$as_me:12952: result: $cf_cv_xaw_compat" >&5
12953 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12954
12955                         if test "$cf_cv_xaw_compat" = no
12956                         then
12957                                 # workaround for broken ".pc" files...
12958                                 case "$cf_x_athena_lib" in
12959                                 (*-lXmu*)
12960                                         ;;
12961                                 (*)
12962                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12963
12964 echo "${as_me:-configure}:12964: testing work around broken package ..." 1>&5
12965
12966                                         cf_save_xmu="$LIBS"
12967                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12968
12969 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12970         test -n "$verbose" && echo "    found package xmu" 1>&6
12971
12972 echo "${as_me:-configure}:12972: testing found package xmu ..." 1>&5
12973
12974         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12975         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12976         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12977
12978 echo "${as_me:-configure}:12978: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12979
12980         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12981
12982 echo "${as_me:-configure}:12982: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12983
12984 cf_fix_cppflags=no
12985 cf_new_cflags=
12986 cf_new_cppflags=
12987 cf_new_extra_cppflags=
12988
12989 for cf_add_cflags in $cf_pkgconfig_incs
12990 do
12991 case $cf_fix_cppflags in
12992 (no)
12993         case $cf_add_cflags in
12994         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12995                 case $cf_add_cflags in
12996                 (-D*)
12997                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12998
12999                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13000                                 && test -z "${cf_tst_cflags}" \
13001                                 && cf_fix_cppflags=yes
13002
13003                         if test $cf_fix_cppflags = yes ; then
13004
13005         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13006         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13007
13008                                 continue
13009                         elif test "${cf_tst_cflags}" = "\"'" ; then
13010
13011         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13012         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13013
13014                                 continue
13015                         fi
13016                         ;;
13017                 esac
13018                 case "$CPPFLAGS" in
13019                 (*$cf_add_cflags)
13020                         ;;
13021                 (*)
13022                         case $cf_add_cflags in
13023                         (-D*)
13024                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13025
13026 CPPFLAGS=`echo "$CPPFLAGS" | \
13027         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13028                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13029
13030                                 ;;
13031                         esac
13032
13033         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13034         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13035
13036                         ;;
13037                 esac
13038                 ;;
13039         (*)
13040
13041         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13042         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13043
13044                 ;;
13045         esac
13046         ;;
13047 (yes)
13048
13049         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13050         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13051
13052         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13053
13054         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13055                 && test -z "${cf_tst_cflags}" \
13056                 && cf_fix_cppflags=no
13057         ;;
13058 esac
13059 done
13060
13061 if test -n "$cf_new_cflags" ; then
13062
13063         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13064         CFLAGS="${CFLAGS}$cf_new_cflags"
13065
13066 fi
13067
13068 if test -n "$cf_new_cppflags" ; then
13069
13070         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13071         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13072
13073 fi
13074
13075 if test -n "$cf_new_extra_cppflags" ; then
13076
13077         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13078         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13079
13080 fi
13081
13082 cf_add_libs="$LIBS"
13083 # reverse order
13084 cf_add_0lib=
13085 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13086 # filter duplicates
13087 for cf_add_1lib in $cf_add_0lib; do
13088         for cf_add_2lib in $cf_add_libs; do
13089                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13090                         cf_add_1lib=
13091                         break
13092                 fi
13093         done
13094         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13095 done
13096 LIBS="$cf_add_libs"
13097
13098                                                         LIBS="$cf_save_xmu"
13099
13100 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13101
13102 echo "${as_me:-configure}:13102: testing ...before $LIBS ..." 1>&5
13103
13104 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13105 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13106
13107 echo "${as_me:-configure}:13107: testing ...after  $LIBS ..." 1>&5
13108
13109 else
13110         cf_pkgconfig_incs=
13111         cf_pkgconfig_libs=
13112
13113 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13114
13115 echo "${as_me:-configure}:13115: testing ...before $LIBS ..." 1>&5
13116
13117 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13118 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13119
13120 echo "${as_me:-configure}:13120: testing ...after  $LIBS ..." 1>&5
13121
13122 fi
13123
13124         for cf_trim_lib in Xmu Xt X11
13125         do
13126                 case "$LIBS" in
13127                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13128                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13129                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13130
13131 echo "${as_me:-configure}:13131: testing ..trimmed $LIBS ..." 1>&5
13132
13133                         ;;
13134                 esac
13135         done
13136
13137                                         ;;
13138                                 esac
13139                         fi
13140
13141                         break
13142 else
13143         cf_pkgconfig_incs=
13144         cf_pkgconfig_libs=
13145         :
13146 fi
13147
13148         done
13149 fi
13150
13151 if test -z "$cf_x_athena_lib" ; then
13152
13153 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
13154         test -n "$verbose" && echo "    found package Xext" 1>&6
13155
13156 echo "${as_me:-configure}:13156: testing found package Xext ..." 1>&5
13157
13158         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
13159         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
13160         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13161
13162 echo "${as_me:-configure}:13162: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13163
13164         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13165
13166 echo "${as_me:-configure}:13166: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13167
13168 cf_fix_cppflags=no
13169 cf_new_cflags=
13170 cf_new_cppflags=
13171 cf_new_extra_cppflags=
13172
13173 for cf_add_cflags in $cf_pkgconfig_incs
13174 do
13175 case $cf_fix_cppflags in
13176 (no)
13177         case $cf_add_cflags in
13178         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13179                 case $cf_add_cflags in
13180                 (-D*)
13181                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13182
13183                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13184                                 && test -z "${cf_tst_cflags}" \
13185                                 && cf_fix_cppflags=yes
13186
13187                         if test $cf_fix_cppflags = yes ; then
13188
13189         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13190         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13191
13192                                 continue
13193                         elif test "${cf_tst_cflags}" = "\"'" ; then
13194
13195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13197
13198                                 continue
13199                         fi
13200                         ;;
13201                 esac
13202                 case "$CPPFLAGS" in
13203                 (*$cf_add_cflags)
13204                         ;;
13205                 (*)
13206                         case $cf_add_cflags in
13207                         (-D*)
13208                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13209
13210 CPPFLAGS=`echo "$CPPFLAGS" | \
13211         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13212                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13213
13214                                 ;;
13215                         esac
13216
13217         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13218         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13219
13220                         ;;
13221                 esac
13222                 ;;
13223         (*)
13224
13225         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13226         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13227
13228                 ;;
13229         esac
13230         ;;
13231 (yes)
13232
13233         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13234         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13235
13236         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13237
13238         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13239                 && test -z "${cf_tst_cflags}" \
13240                 && cf_fix_cppflags=no
13241         ;;
13242 esac
13243 done
13244
13245 if test -n "$cf_new_cflags" ; then
13246
13247         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13248         CFLAGS="${CFLAGS}$cf_new_cflags"
13249
13250 fi
13251
13252 if test -n "$cf_new_cppflags" ; then
13253
13254         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13255         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13256
13257 fi
13258
13259 if test -n "$cf_new_extra_cppflags" ; then
13260
13261         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13262         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13263
13264 fi
13265
13266 cf_add_libs="$LIBS"
13267 # reverse order
13268 cf_add_0lib=
13269 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13270 # filter duplicates
13271 for cf_add_1lib in $cf_add_0lib; do
13272         for cf_add_2lib in $cf_add_libs; do
13273                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13274                         cf_add_1lib=
13275                         break
13276                 fi
13277         done
13278         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13279 done
13280 LIBS="$cf_add_libs"
13281
13282         :
13283 else
13284         cf_pkgconfig_incs=
13285         cf_pkgconfig_libs=
13286
13287         echo "$as_me:13287: checking for XextCreateExtension in -lXext" >&5
13288 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13289 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13290   echo $ECHO_N "(cached) $ECHO_C" >&6
13291 else
13292   ac_check_lib_save_LIBS=$LIBS
13293 LIBS="-lXext  $LIBS"
13294 cat >conftest.$ac_ext <<_ACEOF
13295 #line 13295 "configure"
13296 #include "confdefs.h"
13297
13298 /* Override any gcc2 internal prototype to avoid an error.  */
13299 #ifdef __cplusplus
13300 extern "C"
13301 #endif
13302 /* We use char because int might match the return type of a gcc2
13303    builtin and then its argument prototype would still apply.  */
13304 char XextCreateExtension ();
13305 int
13306 main (void)
13307 {
13308 XextCreateExtension ();
13309   ;
13310   return 0;
13311 }
13312 _ACEOF
13313 rm -f conftest.$ac_objext conftest$ac_exeext
13314 if { (eval echo "$as_me:13314: \"$ac_link\"") >&5
13315   (eval $ac_link) 2>&5
13316   ac_status=$?
13317   echo "$as_me:13317: \$? = $ac_status" >&5
13318   (exit $ac_status); } &&
13319          { ac_try='test -s conftest$ac_exeext'
13320   { (eval echo "$as_me:13320: \"$ac_try\"") >&5
13321   (eval $ac_try) 2>&5
13322   ac_status=$?
13323   echo "$as_me:13323: \$? = $ac_status" >&5
13324   (exit $ac_status); }; }; then
13325   ac_cv_lib_Xext_XextCreateExtension=yes
13326 else
13327   echo "$as_me: failed program was:" >&5
13328 cat conftest.$ac_ext >&5
13329 ac_cv_lib_Xext_XextCreateExtension=no
13330 fi
13331 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13332 LIBS=$ac_check_lib_save_LIBS
13333 fi
13334 echo "$as_me:13334: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13335 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13336 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
13337
13338 cf_add_libs="$LIBS"
13339 # reverse order
13340 cf_add_0lib=
13341 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13342 # filter duplicates
13343 for cf_add_1lib in $cf_add_0lib; do
13344         for cf_add_2lib in $cf_add_libs; do
13345                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13346                         cf_add_1lib=
13347                         break
13348                 fi
13349         done
13350         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13351 done
13352 LIBS="$cf_add_libs"
13353
13354 fi
13355
13356 fi
13357
13358 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13359 # in some cases has installed dummy files in the former, other cases replaced
13360 # it with a link to the new location).  This complicates the configure script.
13361 # Check for that pitfall, and recover using pkg-config
13362 #
13363 # If none of these are set, the configuration is almost certainly broken.
13364 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13365 then
13366
13367 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13368         test -n "$verbose" && echo "    found package x11" 1>&6
13369
13370 echo "${as_me:-configure}:13370: testing found package x11 ..." 1>&5
13371
13372         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13373         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13374         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13375
13376 echo "${as_me:-configure}:13376: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13377
13378         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13379
13380 echo "${as_me:-configure}:13380: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13381
13382 cf_fix_cppflags=no
13383 cf_new_cflags=
13384 cf_new_cppflags=
13385 cf_new_extra_cppflags=
13386
13387 for cf_add_cflags in $cf_pkgconfig_incs
13388 do
13389 case $cf_fix_cppflags in
13390 (no)
13391         case $cf_add_cflags in
13392         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13393                 case $cf_add_cflags in
13394                 (-D*)
13395                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13396
13397                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13398                                 && test -z "${cf_tst_cflags}" \
13399                                 && cf_fix_cppflags=yes
13400
13401                         if test $cf_fix_cppflags = yes ; then
13402
13403         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13404         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13405
13406                                 continue
13407                         elif test "${cf_tst_cflags}" = "\"'" ; then
13408
13409         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13410         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13411
13412                                 continue
13413                         fi
13414                         ;;
13415                 esac
13416                 case "$CPPFLAGS" in
13417                 (*$cf_add_cflags)
13418                         ;;
13419                 (*)
13420                         case $cf_add_cflags in
13421                         (-D*)
13422                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13423
13424 CPPFLAGS=`echo "$CPPFLAGS" | \
13425         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13426                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13427
13428                                 ;;
13429                         esac
13430
13431         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13432         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13433
13434                         ;;
13435                 esac
13436                 ;;
13437         (*)
13438
13439         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13440         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13441
13442                 ;;
13443         esac
13444         ;;
13445 (yes)
13446
13447         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13448         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13449
13450         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13451
13452         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13453                 && test -z "${cf_tst_cflags}" \
13454                 && cf_fix_cppflags=no
13455         ;;
13456 esac
13457 done
13458
13459 if test -n "$cf_new_cflags" ; then
13460
13461         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13462         CFLAGS="${CFLAGS}$cf_new_cflags"
13463
13464 fi
13465
13466 if test -n "$cf_new_cppflags" ; then
13467
13468         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13469         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13470
13471 fi
13472
13473 if test -n "$cf_new_extra_cppflags" ; then
13474
13475         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13476         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13477
13478 fi
13479
13480 cf_add_libs="$LIBS"
13481 # reverse order
13482 cf_add_0lib=
13483 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13484 # filter duplicates
13485 for cf_add_1lib in $cf_add_0lib; do
13486         for cf_add_2lib in $cf_add_libs; do
13487                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13488                         cf_add_1lib=
13489                         break
13490                 fi
13491         done
13492         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13493 done
13494 LIBS="$cf_add_libs"
13495
13496         :
13497 else
13498         cf_pkgconfig_incs=
13499         cf_pkgconfig_libs=
13500         { echo "$as_me:13500: WARNING: unable to find X11 library" >&5
13501 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13502 fi
13503
13504 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13505         test -n "$verbose" && echo "    found package ice" 1>&6
13506
13507 echo "${as_me:-configure}:13507: testing found package ice ..." 1>&5
13508
13509         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13510         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13511         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13512
13513 echo "${as_me:-configure}:13513: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13514
13515         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13516
13517 echo "${as_me:-configure}:13517: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13518
13519 cf_fix_cppflags=no
13520 cf_new_cflags=
13521 cf_new_cppflags=
13522 cf_new_extra_cppflags=
13523
13524 for cf_add_cflags in $cf_pkgconfig_incs
13525 do
13526 case $cf_fix_cppflags in
13527 (no)
13528         case $cf_add_cflags in
13529         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13530                 case $cf_add_cflags in
13531                 (-D*)
13532                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13533
13534                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13535                                 && test -z "${cf_tst_cflags}" \
13536                                 && cf_fix_cppflags=yes
13537
13538                         if test $cf_fix_cppflags = yes ; then
13539
13540         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13541         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13542
13543                                 continue
13544                         elif test "${cf_tst_cflags}" = "\"'" ; then
13545
13546         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13547         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13548
13549                                 continue
13550                         fi
13551                         ;;
13552                 esac
13553                 case "$CPPFLAGS" in
13554                 (*$cf_add_cflags)
13555                         ;;
13556                 (*)
13557                         case $cf_add_cflags in
13558                         (-D*)
13559                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13560
13561 CPPFLAGS=`echo "$CPPFLAGS" | \
13562         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13563                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13564
13565                                 ;;
13566                         esac
13567
13568         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13569         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13570
13571                         ;;
13572                 esac
13573                 ;;
13574         (*)
13575
13576         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13577         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13578
13579                 ;;
13580         esac
13581         ;;
13582 (yes)
13583
13584         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13585         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13586
13587         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13588
13589         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13590                 && test -z "${cf_tst_cflags}" \
13591                 && cf_fix_cppflags=no
13592         ;;
13593 esac
13594 done
13595
13596 if test -n "$cf_new_cflags" ; then
13597
13598         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13599         CFLAGS="${CFLAGS}$cf_new_cflags"
13600
13601 fi
13602
13603 if test -n "$cf_new_cppflags" ; then
13604
13605         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13606         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13607
13608 fi
13609
13610 if test -n "$cf_new_extra_cppflags" ; then
13611
13612         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13613         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13614
13615 fi
13616
13617 cf_add_libs="$LIBS"
13618 # reverse order
13619 cf_add_0lib=
13620 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13621 # filter duplicates
13622 for cf_add_1lib in $cf_add_0lib; do
13623         for cf_add_2lib in $cf_add_libs; do
13624                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13625                         cf_add_1lib=
13626                         break
13627                 fi
13628         done
13629         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13630 done
13631 LIBS="$cf_add_libs"
13632
13633         :
13634 else
13635         cf_pkgconfig_incs=
13636         cf_pkgconfig_libs=
13637         { echo "$as_me:13637: WARNING: unable to find ICE library" >&5
13638 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13639 fi
13640
13641 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13642         test -n "$verbose" && echo "    found package sm" 1>&6
13643
13644 echo "${as_me:-configure}:13644: testing found package sm ..." 1>&5
13645
13646         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13647         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13648         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13649
13650 echo "${as_me:-configure}:13650: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13651
13652         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13653
13654 echo "${as_me:-configure}:13654: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13655
13656 cf_fix_cppflags=no
13657 cf_new_cflags=
13658 cf_new_cppflags=
13659 cf_new_extra_cppflags=
13660
13661 for cf_add_cflags in $cf_pkgconfig_incs
13662 do
13663 case $cf_fix_cppflags in
13664 (no)
13665         case $cf_add_cflags in
13666         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13667                 case $cf_add_cflags in
13668                 (-D*)
13669                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13670
13671                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13672                                 && test -z "${cf_tst_cflags}" \
13673                                 && cf_fix_cppflags=yes
13674
13675                         if test $cf_fix_cppflags = yes ; then
13676
13677         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13678         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13679
13680                                 continue
13681                         elif test "${cf_tst_cflags}" = "\"'" ; then
13682
13683         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13684         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13685
13686                                 continue
13687                         fi
13688                         ;;
13689                 esac
13690                 case "$CPPFLAGS" in
13691                 (*$cf_add_cflags)
13692                         ;;
13693                 (*)
13694                         case $cf_add_cflags in
13695                         (-D*)
13696                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13697
13698 CPPFLAGS=`echo "$CPPFLAGS" | \
13699         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13700                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13701
13702                                 ;;
13703                         esac
13704
13705         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13706         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13707
13708                         ;;
13709                 esac
13710                 ;;
13711         (*)
13712
13713         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13714         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13715
13716                 ;;
13717         esac
13718         ;;
13719 (yes)
13720
13721         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13722         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13723
13724         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13725
13726         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13727                 && test -z "${cf_tst_cflags}" \
13728                 && cf_fix_cppflags=no
13729         ;;
13730 esac
13731 done
13732
13733 if test -n "$cf_new_cflags" ; then
13734
13735         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13736         CFLAGS="${CFLAGS}$cf_new_cflags"
13737
13738 fi
13739
13740 if test -n "$cf_new_cppflags" ; then
13741
13742         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13743         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13744
13745 fi
13746
13747 if test -n "$cf_new_extra_cppflags" ; then
13748
13749         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13750         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13751
13752 fi
13753
13754 cf_add_libs="$LIBS"
13755 # reverse order
13756 cf_add_0lib=
13757 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13758 # filter duplicates
13759 for cf_add_1lib in $cf_add_0lib; do
13760         for cf_add_2lib in $cf_add_libs; do
13761                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13762                         cf_add_1lib=
13763                         break
13764                 fi
13765         done
13766         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13767 done
13768 LIBS="$cf_add_libs"
13769
13770         :
13771 else
13772         cf_pkgconfig_incs=
13773         cf_pkgconfig_libs=
13774         { echo "$as_me:13774: WARNING: unable to find SM library" >&5
13775 echo "$as_me: WARNING: unable to find SM library" >&2;}
13776 fi
13777
13778 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13779         test -n "$verbose" && echo "    found package xt" 1>&6
13780
13781 echo "${as_me:-configure}:13781: testing found package xt ..." 1>&5
13782
13783         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13784         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13785         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13786
13787 echo "${as_me:-configure}:13787: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13788
13789         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13790
13791 echo "${as_me:-configure}:13791: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13792
13793 cf_fix_cppflags=no
13794 cf_new_cflags=
13795 cf_new_cppflags=
13796 cf_new_extra_cppflags=
13797
13798 for cf_add_cflags in $cf_pkgconfig_incs
13799 do
13800 case $cf_fix_cppflags in
13801 (no)
13802         case $cf_add_cflags in
13803         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13804                 case $cf_add_cflags in
13805                 (-D*)
13806                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13807
13808                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13809                                 && test -z "${cf_tst_cflags}" \
13810                                 && cf_fix_cppflags=yes
13811
13812                         if test $cf_fix_cppflags = yes ; then
13813
13814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13816
13817                                 continue
13818                         elif test "${cf_tst_cflags}" = "\"'" ; then
13819
13820         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13821         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13822
13823                                 continue
13824                         fi
13825                         ;;
13826                 esac
13827                 case "$CPPFLAGS" in
13828                 (*$cf_add_cflags)
13829                         ;;
13830                 (*)
13831                         case $cf_add_cflags in
13832                         (-D*)
13833                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13834
13835 CPPFLAGS=`echo "$CPPFLAGS" | \
13836         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13837                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13838
13839                                 ;;
13840                         esac
13841
13842         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13843         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13844
13845                         ;;
13846                 esac
13847                 ;;
13848         (*)
13849
13850         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13851         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13852
13853                 ;;
13854         esac
13855         ;;
13856 (yes)
13857
13858         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13859         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13860
13861         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13862
13863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13864                 && test -z "${cf_tst_cflags}" \
13865                 && cf_fix_cppflags=no
13866         ;;
13867 esac
13868 done
13869
13870 if test -n "$cf_new_cflags" ; then
13871
13872         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13873         CFLAGS="${CFLAGS}$cf_new_cflags"
13874
13875 fi
13876
13877 if test -n "$cf_new_cppflags" ; then
13878
13879         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13880         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13881
13882 fi
13883
13884 if test -n "$cf_new_extra_cppflags" ; then
13885
13886         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13887         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13888
13889 fi
13890
13891 cf_add_libs="$LIBS"
13892 # reverse order
13893 cf_add_0lib=
13894 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13895 # filter duplicates
13896 for cf_add_1lib in $cf_add_0lib; do
13897         for cf_add_2lib in $cf_add_libs; do
13898                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13899                         cf_add_1lib=
13900                         break
13901                 fi
13902         done
13903         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13904 done
13905 LIBS="$cf_add_libs"
13906
13907         :
13908 else
13909         cf_pkgconfig_incs=
13910         cf_pkgconfig_libs=
13911         { echo "$as_me:13911: WARNING: unable to find Xt library" >&5
13912 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13913 fi
13914
13915 fi
13916
13917 cf_have_X_LIBS=no
13918
13919 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13920         test -n "$verbose" && echo "    found package xt" 1>&6
13921
13922 echo "${as_me:-configure}:13922: testing found package xt ..." 1>&5
13923
13924         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13925         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13926         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13927
13928 echo "${as_me:-configure}:13928: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13929
13930         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13931
13932 echo "${as_me:-configure}:13932: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13933
13934 cf_fix_cppflags=no
13935 cf_new_cflags=
13936 cf_new_cppflags=
13937 cf_new_extra_cppflags=
13938
13939 for cf_add_cflags in $cf_pkgconfig_incs
13940 do
13941 case $cf_fix_cppflags in
13942 (no)
13943         case $cf_add_cflags in
13944         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13945                 case $cf_add_cflags in
13946                 (-D*)
13947                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13948
13949                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13950                                 && test -z "${cf_tst_cflags}" \
13951                                 && cf_fix_cppflags=yes
13952
13953                         if test $cf_fix_cppflags = yes ; then
13954
13955         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13956         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13957
13958                                 continue
13959                         elif test "${cf_tst_cflags}" = "\"'" ; then
13960
13961         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13962         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13963
13964                                 continue
13965                         fi
13966                         ;;
13967                 esac
13968                 case "$CPPFLAGS" in
13969                 (*$cf_add_cflags)
13970                         ;;
13971                 (*)
13972                         case $cf_add_cflags in
13973                         (-D*)
13974                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13975
13976 CPPFLAGS=`echo "$CPPFLAGS" | \
13977         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13978                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13979
13980                                 ;;
13981                         esac
13982
13983         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13984         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13985
13986                         ;;
13987                 esac
13988                 ;;
13989         (*)
13990
13991         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13992         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13993
13994                 ;;
13995         esac
13996         ;;
13997 (yes)
13998
13999         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14000         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14001
14002         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14003
14004         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14005                 && test -z "${cf_tst_cflags}" \
14006                 && cf_fix_cppflags=no
14007         ;;
14008 esac
14009 done
14010
14011 if test -n "$cf_new_cflags" ; then
14012
14013         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14014         CFLAGS="${CFLAGS}$cf_new_cflags"
14015
14016 fi
14017
14018 if test -n "$cf_new_cppflags" ; then
14019
14020         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14021         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14022
14023 fi
14024
14025 if test -n "$cf_new_extra_cppflags" ; then
14026
14027         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14028         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14029
14030 fi
14031
14032 cf_add_libs="$LIBS"
14033 # reverse order
14034 cf_add_0lib=
14035 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14036 # filter duplicates
14037 for cf_add_1lib in $cf_add_0lib; do
14038         for cf_add_2lib in $cf_add_libs; do
14039                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14040                         cf_add_1lib=
14041                         break
14042                 fi
14043         done
14044         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14045 done
14046 LIBS="$cf_add_libs"
14047
14048         case "x$LIBS" in
14049         (*-lX11*)
14050                 ;;
14051         (*)
14052 # we have an "xt" package, but it may omit Xt's dependency on X11
14053 echo "$as_me:14053: checking for usable X dependency" >&5
14054 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14055 if test "${cf_cv_xt_x11_compat+set}" = set; then
14056   echo $ECHO_N "(cached) $ECHO_C" >&6
14057 else
14058
14059 cat >conftest.$ac_ext <<_ACEOF
14060 #line 14060 "configure"
14061 #include "confdefs.h"
14062
14063 #include <X11/Xlib.h>
14064
14065 int
14066 main (void)
14067 {
14068
14069         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14070         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14071         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14072         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14073
14074   ;
14075   return 0;
14076 }
14077 _ACEOF
14078 rm -f conftest.$ac_objext conftest$ac_exeext
14079 if { (eval echo "$as_me:14079: \"$ac_link\"") >&5
14080   (eval $ac_link) 2>&5
14081   ac_status=$?
14082   echo "$as_me:14082: \$? = $ac_status" >&5
14083   (exit $ac_status); } &&
14084          { ac_try='test -s conftest$ac_exeext'
14085   { (eval echo "$as_me:14085: \"$ac_try\"") >&5
14086   (eval $ac_try) 2>&5
14087   ac_status=$?
14088   echo "$as_me:14088: \$? = $ac_status" >&5
14089   (exit $ac_status); }; }; then
14090   cf_cv_xt_x11_compat=yes
14091 else
14092   echo "$as_me: failed program was:" >&5
14093 cat conftest.$ac_ext >&5
14094 cf_cv_xt_x11_compat=no
14095 fi
14096 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14097 fi
14098 echo "$as_me:14098: result: $cf_cv_xt_x11_compat" >&5
14099 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14100                 if test "$cf_cv_xt_x11_compat" = no
14101                 then
14102                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14103
14104 echo "${as_me:-configure}:14104: testing work around broken X11 dependency ..." 1>&5
14105
14106                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14107
14108 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
14109         test -n "$verbose" && echo "    found package x11" 1>&6
14110
14111 echo "${as_me:-configure}:14111: testing found package x11 ..." 1>&5
14112
14113         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
14114         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
14115         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14116
14117 echo "${as_me:-configure}:14117: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14118
14119         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14120
14121 echo "${as_me:-configure}:14121: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14122
14123 cf_fix_cppflags=no
14124 cf_new_cflags=
14125 cf_new_cppflags=
14126 cf_new_extra_cppflags=
14127
14128 for cf_add_cflags in $cf_pkgconfig_incs
14129 do
14130 case $cf_fix_cppflags in
14131 (no)
14132         case $cf_add_cflags in
14133         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14134                 case $cf_add_cflags in
14135                 (-D*)
14136                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14137
14138                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14139                                 && test -z "${cf_tst_cflags}" \
14140                                 && cf_fix_cppflags=yes
14141
14142                         if test $cf_fix_cppflags = yes ; then
14143
14144         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14145         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14146
14147                                 continue
14148                         elif test "${cf_tst_cflags}" = "\"'" ; then
14149
14150         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14151         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14152
14153                                 continue
14154                         fi
14155                         ;;
14156                 esac
14157                 case "$CPPFLAGS" in
14158                 (*$cf_add_cflags)
14159                         ;;
14160                 (*)
14161                         case $cf_add_cflags in
14162                         (-D*)
14163                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14164
14165 CPPFLAGS=`echo "$CPPFLAGS" | \
14166         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14167                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14168
14169                                 ;;
14170                         esac
14171
14172         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14173         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14174
14175                         ;;
14176                 esac
14177                 ;;
14178         (*)
14179
14180         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14181         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14182
14183                 ;;
14184         esac
14185         ;;
14186 (yes)
14187
14188         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14189         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14190
14191         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14192
14193         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14194                 && test -z "${cf_tst_cflags}" \
14195                 && cf_fix_cppflags=no
14196         ;;
14197 esac
14198 done
14199
14200 if test -n "$cf_new_cflags" ; then
14201
14202         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14203         CFLAGS="${CFLAGS}$cf_new_cflags"
14204
14205 fi
14206
14207 if test -n "$cf_new_cppflags" ; then
14208
14209         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14210         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14211
14212 fi
14213
14214 if test -n "$cf_new_extra_cppflags" ; then
14215
14216         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14217         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14218
14219 fi
14220
14221 cf_add_libs="$LIBS"
14222 # reverse order
14223 cf_add_0lib=
14224 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14225 # filter duplicates
14226 for cf_add_1lib in $cf_add_0lib; do
14227         for cf_add_2lib in $cf_add_libs; do
14228                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14229                         cf_add_1lib=
14230                         break
14231                 fi
14232         done
14233         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14234 done
14235 LIBS="$cf_add_libs"
14236
14237         :
14238 else
14239         cf_pkgconfig_incs=
14240         cf_pkgconfig_libs=
14241
14242 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14243
14244 echo "${as_me:-configure}:14244: testing ...before $LIBS ..." 1>&5
14245
14246 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14247 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14248
14249 echo "${as_me:-configure}:14249: testing ...after  $LIBS ..." 1>&5
14250
14251 fi
14252
14253                 fi
14254                 ;;
14255         esac
14256
14257 echo "$as_me:14257: checking for usable X Toolkit package" >&5
14258 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14259 if test "${cf_cv_xt_ice_compat+set}" = set; then
14260   echo $ECHO_N "(cached) $ECHO_C" >&6
14261 else
14262
14263 cat >conftest.$ac_ext <<_ACEOF
14264 #line 14264 "configure"
14265 #include "confdefs.h"
14266
14267 #include <X11/Shell.h>
14268
14269 int
14270 main (void)
14271 {
14272 int num = IceConnectionNumber(0)
14273
14274   ;
14275   return 0;
14276 }
14277 _ACEOF
14278 rm -f conftest.$ac_objext conftest$ac_exeext
14279 if { (eval echo "$as_me:14279: \"$ac_link\"") >&5
14280   (eval $ac_link) 2>&5
14281   ac_status=$?
14282   echo "$as_me:14282: \$? = $ac_status" >&5
14283   (exit $ac_status); } &&
14284          { ac_try='test -s conftest$ac_exeext'
14285   { (eval echo "$as_me:14285: \"$ac_try\"") >&5
14286   (eval $ac_try) 2>&5
14287   ac_status=$?
14288   echo "$as_me:14288: \$? = $ac_status" >&5
14289   (exit $ac_status); }; }; then
14290   cf_cv_xt_ice_compat=yes
14291 else
14292   echo "$as_me: failed program was:" >&5
14293 cat conftest.$ac_ext >&5
14294 cf_cv_xt_ice_compat=no
14295 fi
14296 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14297 fi
14298 echo "$as_me:14298: result: $cf_cv_xt_ice_compat" >&5
14299 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14300
14301         if test "$cf_cv_xt_ice_compat" = no
14302         then
14303                 # workaround for broken ".pc" files used for X Toolkit.
14304                 case "x$X_PRE_LIBS" in
14305                 (*-lICE*)
14306                         case "x$LIBS" in
14307                         (*-lICE*)
14308                                 ;;
14309                         (*)
14310                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14311
14312 echo "${as_me:-configure}:14312: testing work around broken ICE dependency ..." 1>&5
14313
14314 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
14315         test -n "$verbose" && echo "    found package ice" 1>&6
14316
14317 echo "${as_me:-configure}:14317: testing found package ice ..." 1>&5
14318
14319         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
14320         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
14321         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14322
14323 echo "${as_me:-configure}:14323: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14324
14325         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14326
14327 echo "${as_me:-configure}:14327: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14328
14329 cf_fix_cppflags=no
14330 cf_new_cflags=
14331 cf_new_cppflags=
14332 cf_new_extra_cppflags=
14333
14334 for cf_add_cflags in $cf_pkgconfig_incs
14335 do
14336 case $cf_fix_cppflags in
14337 (no)
14338         case $cf_add_cflags in
14339         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14340                 case $cf_add_cflags in
14341                 (-D*)
14342                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14343
14344                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14345                                 && test -z "${cf_tst_cflags}" \
14346                                 && cf_fix_cppflags=yes
14347
14348                         if test $cf_fix_cppflags = yes ; then
14349
14350         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14351         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14352
14353                                 continue
14354                         elif test "${cf_tst_cflags}" = "\"'" ; then
14355
14356         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14357         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14358
14359                                 continue
14360                         fi
14361                         ;;
14362                 esac
14363                 case "$CPPFLAGS" in
14364                 (*$cf_add_cflags)
14365                         ;;
14366                 (*)
14367                         case $cf_add_cflags in
14368                         (-D*)
14369                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14370
14371 CPPFLAGS=`echo "$CPPFLAGS" | \
14372         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14373                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14374
14375                                 ;;
14376                         esac
14377
14378         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14379         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14380
14381                         ;;
14382                 esac
14383                 ;;
14384         (*)
14385
14386         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14387         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14388
14389                 ;;
14390         esac
14391         ;;
14392 (yes)
14393
14394         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14395         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14396
14397         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14398
14399         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14400                 && test -z "${cf_tst_cflags}" \
14401                 && cf_fix_cppflags=no
14402         ;;
14403 esac
14404 done
14405
14406 if test -n "$cf_new_cflags" ; then
14407
14408         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14409         CFLAGS="${CFLAGS}$cf_new_cflags"
14410
14411 fi
14412
14413 if test -n "$cf_new_cppflags" ; then
14414
14415         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14416         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14417
14418 fi
14419
14420 if test -n "$cf_new_extra_cppflags" ; then
14421
14422         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14423         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14424
14425 fi
14426
14427 cf_add_libs="$LIBS"
14428 # reverse order
14429 cf_add_0lib=
14430 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14431 # filter duplicates
14432 for cf_add_1lib in $cf_add_0lib; do
14433         for cf_add_2lib in $cf_add_libs; do
14434                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14435                         cf_add_1lib=
14436                         break
14437                 fi
14438         done
14439         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14440 done
14441 LIBS="$cf_add_libs"
14442
14443 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
14444         test -n "$verbose" && echo "    found package sm" 1>&6
14445
14446 echo "${as_me:-configure}:14446: testing found package sm ..." 1>&5
14447
14448         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
14449         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
14450         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14451
14452 echo "${as_me:-configure}:14452: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14453
14454         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14455
14456 echo "${as_me:-configure}:14456: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14457
14458 cf_fix_cppflags=no
14459 cf_new_cflags=
14460 cf_new_cppflags=
14461 cf_new_extra_cppflags=
14462
14463 for cf_add_cflags in $cf_pkgconfig_incs
14464 do
14465 case $cf_fix_cppflags in
14466 (no)
14467         case $cf_add_cflags in
14468         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14469                 case $cf_add_cflags in
14470                 (-D*)
14471                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14472
14473                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14474                                 && test -z "${cf_tst_cflags}" \
14475                                 && cf_fix_cppflags=yes
14476
14477                         if test $cf_fix_cppflags = yes ; then
14478
14479         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14480         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14481
14482                                 continue
14483                         elif test "${cf_tst_cflags}" = "\"'" ; then
14484
14485         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14486         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14487
14488                                 continue
14489                         fi
14490                         ;;
14491                 esac
14492                 case "$CPPFLAGS" in
14493                 (*$cf_add_cflags)
14494                         ;;
14495                 (*)
14496                         case $cf_add_cflags in
14497                         (-D*)
14498                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14499
14500 CPPFLAGS=`echo "$CPPFLAGS" | \
14501         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14502                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14503
14504                                 ;;
14505                         esac
14506
14507         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14508         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14509
14510                         ;;
14511                 esac
14512                 ;;
14513         (*)
14514
14515         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14516         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14517
14518                 ;;
14519         esac
14520         ;;
14521 (yes)
14522
14523         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14524         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14525
14526         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14527
14528         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14529                 && test -z "${cf_tst_cflags}" \
14530                 && cf_fix_cppflags=no
14531         ;;
14532 esac
14533 done
14534
14535 if test -n "$cf_new_cflags" ; then
14536
14537         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14538         CFLAGS="${CFLAGS}$cf_new_cflags"
14539
14540 fi
14541
14542 if test -n "$cf_new_cppflags" ; then
14543
14544         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14545         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14546
14547 fi
14548
14549 if test -n "$cf_new_extra_cppflags" ; then
14550
14551         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14552         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14553
14554 fi
14555
14556 cf_add_libs="$LIBS"
14557 # reverse order
14558 cf_add_0lib=
14559 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14560 # filter duplicates
14561 for cf_add_1lib in $cf_add_0lib; do
14562         for cf_add_2lib in $cf_add_libs; do
14563                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14564                         cf_add_1lib=
14565                         break
14566                 fi
14567         done
14568         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14569 done
14570 LIBS="$cf_add_libs"
14571
14572         :
14573 else
14574         cf_pkgconfig_incs=
14575         cf_pkgconfig_libs=
14576         :
14577 fi
14578
14579 else
14580         cf_pkgconfig_incs=
14581         cf_pkgconfig_libs=
14582
14583 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14584
14585 echo "${as_me:-configure}:14585: testing ...before $LIBS ..." 1>&5
14586
14587 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14588 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14589
14590 echo "${as_me:-configure}:14590: testing ...after  $LIBS ..." 1>&5
14591
14592 fi
14593
14594                                 ;;
14595                         esac
14596                         ;;
14597                 esac
14598         fi
14599
14600         cf_have_X_LIBS=yes
14601
14602 else
14603         cf_pkgconfig_incs=
14604         cf_pkgconfig_libs=
14605
14606         LDFLAGS="$X_LIBS $LDFLAGS"
14607
14608 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14609
14610 echo "${as_me:-configure}:14610: testing checking additions to CFLAGS ..." 1>&5
14611
14612 cf_check_cflags="$CFLAGS"
14613 cf_check_cppflags="$CPPFLAGS"
14614
14615 cf_fix_cppflags=no
14616 cf_new_cflags=
14617 cf_new_cppflags=
14618 cf_new_extra_cppflags=
14619
14620 for cf_add_cflags in $X_CFLAGS
14621 do
14622 case $cf_fix_cppflags in
14623 (no)
14624         case $cf_add_cflags in
14625         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14626                 case $cf_add_cflags in
14627                 (-D*)
14628                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14629
14630                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14631                                 && test -z "${cf_tst_cflags}" \
14632                                 && cf_fix_cppflags=yes
14633
14634                         if test $cf_fix_cppflags = yes ; then
14635
14636         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14637         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14638
14639                                 continue
14640                         elif test "${cf_tst_cflags}" = "\"'" ; then
14641
14642         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14643         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14644
14645                                 continue
14646                         fi
14647                         ;;
14648                 esac
14649                 case "$CPPFLAGS" in
14650                 (*$cf_add_cflags)
14651                         ;;
14652                 (*)
14653                         case $cf_add_cflags in
14654                         (-D*)
14655                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14656
14657 CPPFLAGS=`echo "$CPPFLAGS" | \
14658         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14659                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14660
14661                                 ;;
14662                         esac
14663
14664         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14665         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14666
14667                         ;;
14668                 esac
14669                 ;;
14670         (*)
14671
14672         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14673         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14674
14675                 ;;
14676         esac
14677         ;;
14678 (yes)
14679
14680         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14681         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14682
14683         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14684
14685         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14686                 && test -z "${cf_tst_cflags}" \
14687                 && cf_fix_cppflags=no
14688         ;;
14689 esac
14690 done
14691
14692 if test -n "$cf_new_cflags" ; then
14693         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14694
14695 echo "${as_me:-configure}:14695: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14696
14697         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14698         CFLAGS="${CFLAGS}$cf_new_cflags"
14699
14700 fi
14701
14702 if test -n "$cf_new_cppflags" ; then
14703         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14704
14705 echo "${as_me:-configure}:14705: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14706
14707         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14708         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14709
14710 fi
14711
14712 if test -n "$cf_new_extra_cppflags" ; then
14713         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14714
14715 echo "${as_me:-configure}:14715: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14716
14717         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14718         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14719
14720 fi
14721
14722 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14723 cat >conftest.$ac_ext <<_ACEOF
14724 #line 14724 "configure"
14725 #include "confdefs.h"
14726 #include <stdio.h>
14727 int
14728 main (void)
14729 {
14730 printf("Hello world");
14731   ;
14732   return 0;
14733 }
14734 _ACEOF
14735 rm -f conftest.$ac_objext conftest$ac_exeext
14736 if { (eval echo "$as_me:14736: \"$ac_link\"") >&5
14737   (eval $ac_link) 2>&5
14738   ac_status=$?
14739   echo "$as_me:14739: \$? = $ac_status" >&5
14740   (exit $ac_status); } &&
14741          { ac_try='test -s conftest$ac_exeext'
14742   { (eval echo "$as_me:14742: \"$ac_try\"") >&5
14743   (eval $ac_try) 2>&5
14744   ac_status=$?
14745   echo "$as_me:14745: \$? = $ac_status" >&5
14746   (exit $ac_status); }; }; then
14747   :
14748 else
14749   echo "$as_me: failed program was:" >&5
14750 cat conftest.$ac_ext >&5
14751 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14752
14753 echo "${as_me:-configure}:14753: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14754
14755          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14756                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14757
14758 echo "${as_me:-configure}:14758: testing but keeping change to \$CPPFLAGS ..." 1>&5
14759
14760          fi
14761          CFLAGS="$cf_check_flags"
14762 fi
14763 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14764 fi
14765
14766         echo "$as_me:14766: checking for XOpenDisplay" >&5
14767 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14768 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14769   echo $ECHO_N "(cached) $ECHO_C" >&6
14770 else
14771   cat >conftest.$ac_ext <<_ACEOF
14772 #line 14772 "configure"
14773 #include "confdefs.h"
14774 #define XOpenDisplay autoconf_temporary
14775 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14776 #undef XOpenDisplay
14777
14778 #ifdef __cplusplus
14779 extern "C"
14780 #endif
14781
14782 /* We use char because int might match the return type of a gcc2
14783    builtin and then its argument prototype would still apply.  */
14784 char XOpenDisplay (void);
14785
14786 int
14787 main (void)
14788 {
14789
14790 /* The GNU C library defines stubs for functions which it implements
14791     to always fail with ENOSYS.  Some functions are actually named
14792     something starting with __ and the normal name is an alias.  */
14793 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14794 #error found stub for XOpenDisplay
14795 #endif
14796
14797         return XOpenDisplay ();
14798   ;
14799   return 0;
14800 }
14801 _ACEOF
14802 rm -f conftest.$ac_objext conftest$ac_exeext
14803 if { (eval echo "$as_me:14803: \"$ac_link\"") >&5
14804   (eval $ac_link) 2>&5
14805   ac_status=$?
14806   echo "$as_me:14806: \$? = $ac_status" >&5
14807   (exit $ac_status); } &&
14808          { ac_try='test -s conftest$ac_exeext'
14809   { (eval echo "$as_me:14809: \"$ac_try\"") >&5
14810   (eval $ac_try) 2>&5
14811   ac_status=$?
14812   echo "$as_me:14812: \$? = $ac_status" >&5
14813   (exit $ac_status); }; }; then
14814   ac_cv_func_XOpenDisplay=yes
14815 else
14816   echo "$as_me: failed program was:" >&5
14817 cat conftest.$ac_ext >&5
14818 ac_cv_func_XOpenDisplay=no
14819 fi
14820 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14821 fi
14822 echo "$as_me:14822: result: $ac_cv_func_XOpenDisplay" >&5
14823 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14824 if test $ac_cv_func_XOpenDisplay = yes; then
14825   :
14826 else
14827
14828         echo "$as_me:14828: checking for XOpenDisplay in -lX11" >&5
14829 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14830 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14831   echo $ECHO_N "(cached) $ECHO_C" >&6
14832 else
14833   ac_check_lib_save_LIBS=$LIBS
14834 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14835 cat >conftest.$ac_ext <<_ACEOF
14836 #line 14836 "configure"
14837 #include "confdefs.h"
14838
14839 /* Override any gcc2 internal prototype to avoid an error.  */
14840 #ifdef __cplusplus
14841 extern "C"
14842 #endif
14843 /* We use char because int might match the return type of a gcc2
14844    builtin and then its argument prototype would still apply.  */
14845 char XOpenDisplay ();
14846 int
14847 main (void)
14848 {
14849 XOpenDisplay ();
14850   ;
14851   return 0;
14852 }
14853 _ACEOF
14854 rm -f conftest.$ac_objext conftest$ac_exeext
14855 if { (eval echo "$as_me:14855: \"$ac_link\"") >&5
14856   (eval $ac_link) 2>&5
14857   ac_status=$?
14858   echo "$as_me:14858: \$? = $ac_status" >&5
14859   (exit $ac_status); } &&
14860          { ac_try='test -s conftest$ac_exeext'
14861   { (eval echo "$as_me:14861: \"$ac_try\"") >&5
14862   (eval $ac_try) 2>&5
14863   ac_status=$?
14864   echo "$as_me:14864: \$? = $ac_status" >&5
14865   (exit $ac_status); }; }; then
14866   ac_cv_lib_X11_XOpenDisplay=yes
14867 else
14868   echo "$as_me: failed program was:" >&5
14869 cat conftest.$ac_ext >&5
14870 ac_cv_lib_X11_XOpenDisplay=no
14871 fi
14872 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14873 LIBS=$ac_check_lib_save_LIBS
14874 fi
14875 echo "$as_me:14875: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14876 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14877 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14878
14879 cf_add_libs="$LIBS"
14880 # reverse order
14881 cf_add_0lib=
14882 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14883 # filter duplicates
14884 for cf_add_1lib in $cf_add_0lib; do
14885         for cf_add_2lib in $cf_add_libs; do
14886                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14887                         cf_add_1lib=
14888                         break
14889                 fi
14890         done
14891         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14892 done
14893 LIBS="$cf_add_libs"
14894
14895 fi
14896
14897 fi
14898
14899         echo "$as_me:14899: checking for XtAppInitialize" >&5
14900 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14901 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14902   echo $ECHO_N "(cached) $ECHO_C" >&6
14903 else
14904   cat >conftest.$ac_ext <<_ACEOF
14905 #line 14905 "configure"
14906 #include "confdefs.h"
14907 #define XtAppInitialize autoconf_temporary
14908 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14909 #undef XtAppInitialize
14910
14911 #ifdef __cplusplus
14912 extern "C"
14913 #endif
14914
14915 /* We use char because int might match the return type of a gcc2
14916    builtin and then its argument prototype would still apply.  */
14917 char XtAppInitialize (void);
14918
14919 int
14920 main (void)
14921 {
14922
14923 /* The GNU C library defines stubs for functions which it implements
14924     to always fail with ENOSYS.  Some functions are actually named
14925     something starting with __ and the normal name is an alias.  */
14926 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14927 #error found stub for XtAppInitialize
14928 #endif
14929
14930         return XtAppInitialize ();
14931   ;
14932   return 0;
14933 }
14934 _ACEOF
14935 rm -f conftest.$ac_objext conftest$ac_exeext
14936 if { (eval echo "$as_me:14936: \"$ac_link\"") >&5
14937   (eval $ac_link) 2>&5
14938   ac_status=$?
14939   echo "$as_me:14939: \$? = $ac_status" >&5
14940   (exit $ac_status); } &&
14941          { ac_try='test -s conftest$ac_exeext'
14942   { (eval echo "$as_me:14942: \"$ac_try\"") >&5
14943   (eval $ac_try) 2>&5
14944   ac_status=$?
14945   echo "$as_me:14945: \$? = $ac_status" >&5
14946   (exit $ac_status); }; }; then
14947   ac_cv_func_XtAppInitialize=yes
14948 else
14949   echo "$as_me: failed program was:" >&5
14950 cat conftest.$ac_ext >&5
14951 ac_cv_func_XtAppInitialize=no
14952 fi
14953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14954 fi
14955 echo "$as_me:14955: result: $ac_cv_func_XtAppInitialize" >&5
14956 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14957 if test $ac_cv_func_XtAppInitialize = yes; then
14958   :
14959 else
14960
14961         echo "$as_me:14961: checking for XtAppInitialize in -lXt" >&5
14962 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14963 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14964   echo $ECHO_N "(cached) $ECHO_C" >&6
14965 else
14966   ac_check_lib_save_LIBS=$LIBS
14967 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14968 cat >conftest.$ac_ext <<_ACEOF
14969 #line 14969 "configure"
14970 #include "confdefs.h"
14971
14972 /* Override any gcc2 internal prototype to avoid an error.  */
14973 #ifdef __cplusplus
14974 extern "C"
14975 #endif
14976 /* We use char because int might match the return type of a gcc2
14977    builtin and then its argument prototype would still apply.  */
14978 char XtAppInitialize ();
14979 int
14980 main (void)
14981 {
14982 XtAppInitialize ();
14983   ;
14984   return 0;
14985 }
14986 _ACEOF
14987 rm -f conftest.$ac_objext conftest$ac_exeext
14988 if { (eval echo "$as_me:14988: \"$ac_link\"") >&5
14989   (eval $ac_link) 2>&5
14990   ac_status=$?
14991   echo "$as_me:14991: \$? = $ac_status" >&5
14992   (exit $ac_status); } &&
14993          { ac_try='test -s conftest$ac_exeext'
14994   { (eval echo "$as_me:14994: \"$ac_try\"") >&5
14995   (eval $ac_try) 2>&5
14996   ac_status=$?
14997   echo "$as_me:14997: \$? = $ac_status" >&5
14998   (exit $ac_status); }; }; then
14999   ac_cv_lib_Xt_XtAppInitialize=yes
15000 else
15001   echo "$as_me: failed program was:" >&5
15002 cat conftest.$ac_ext >&5
15003 ac_cv_lib_Xt_XtAppInitialize=no
15004 fi
15005 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15006 LIBS=$ac_check_lib_save_LIBS
15007 fi
15008 echo "$as_me:15008: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15009 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15010 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
15011
15012 cat >>confdefs.h <<\EOF
15013 #define HAVE_LIBXT 1
15014 EOF
15015
15016                  cf_have_X_LIBS=Xt
15017                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
15018 fi
15019
15020 fi
15021
15022 fi
15023
15024 if test $cf_have_X_LIBS = no ; then
15025         { echo "$as_me:15025: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15026 test program.  You will have to check and add the proper libraries by hand
15027 to makefile." >&5
15028 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15029 test program.  You will have to check and add the proper libraries by hand
15030 to makefile." >&2;}
15031 fi
15032
15033 cf_x_athena_root=$cf_x_athena
15034 cf_x_athena_inc=""
15035
15036 for cf_path in default \
15037         /usr/contrib/X11R6 \
15038         /usr/contrib/X11R5 \
15039         /usr/lib/X11R5 \
15040         /usr/local
15041 do
15042         if test -z "$cf_x_athena_inc" ; then
15043
15044 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15045 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15046 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15047 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15048 for cf_X_CFLAGS in $X_CFLAGS
15049 do
15050         case "x$cf_X_CFLAGS" in
15051         x-[IUD]*)
15052                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15053                 ;;
15054         *)
15055                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15056                 ;;
15057         esac
15058 done
15059
15060                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15061                 if test $cf_path != default ; then
15062
15063         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15064         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15065
15066                         echo "$as_me:15066: checking for $cf_test in $cf_path" >&5
15067 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15068                 else
15069                         echo "$as_me:15069: checking for $cf_test" >&5
15070 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15071                 fi
15072                 cat >conftest.$ac_ext <<_ACEOF
15073 #line 15073 "configure"
15074 #include "confdefs.h"
15075
15076 #include <X11/Intrinsic.h>
15077 #include <$cf_test>
15078 int
15079 main (void)
15080 {
15081
15082   ;
15083   return 0;
15084 }
15085 _ACEOF
15086 rm -f conftest.$ac_objext
15087 if { (eval echo "$as_me:15087: \"$ac_compile\"") >&5
15088   (eval $ac_compile) 2>&5
15089   ac_status=$?
15090   echo "$as_me:15090: \$? = $ac_status" >&5
15091   (exit $ac_status); } &&
15092          { ac_try='test -s conftest.$ac_objext'
15093   { (eval echo "$as_me:15093: \"$ac_try\"") >&5
15094   (eval $ac_try) 2>&5
15095   ac_status=$?
15096   echo "$as_me:15096: \$? = $ac_status" >&5
15097   (exit $ac_status); }; }; then
15098   cf_result=yes
15099 else
15100   echo "$as_me: failed program was:" >&5
15101 cat conftest.$ac_ext >&5
15102 cf_result=no
15103 fi
15104 rm -f conftest.$ac_objext conftest.$ac_ext
15105                 echo "$as_me:15105: result: $cf_result" >&5
15106 echo "${ECHO_T}$cf_result" >&6
15107
15108 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15109 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15110 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15111
15112                 if test "$cf_result" = yes ; then
15113                         test "$cf_path"  = default && cf_x_athena_inc=default
15114                         test "$cf_path" != default && cf_x_athena_inc=$cf_path/include
15115                         break
15116                 fi
15117         fi
15118 done
15119
15120 if test -z "$cf_x_athena_inc" ; then
15121         { echo "$as_me:15121: WARNING: Unable to find Athena header files" >&5
15122 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15123 elif test "$cf_x_athena_inc" != default ; then
15124
15125         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15126         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15127
15128 fi
15129
15130 cf_x_athena_root=$cf_x_athena
15131 cf_x_athena_lib=""
15132
15133 for cf_path in default \
15134         /usr/contrib/X11R6 \
15135         /usr/contrib/X11R5 \
15136         /usr/lib/X11R5 \
15137         /usr/local
15138 do
15139         for cf_lib in \
15140                 ${cf_x_athena_root} \
15141                 ${cf_x_athena_root}7 \
15142                 ${cf_x_athena_root}6
15143         do
15144         for cf_libs in \
15145                 "-l$cf_lib -lXmu" \
15146                 "-l$cf_lib -lXpm -lXmu" \
15147                 "-l${cf_lib}_s -lXmu_s"
15148         do
15149                 test -n "$cf_x_athena_lib" && break
15150
15151 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15152 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15153 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15154 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15155 for cf_X_CFLAGS in $X_CFLAGS
15156 do
15157         case "x$cf_X_CFLAGS" in
15158         x-[IUD]*)
15159                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15160                 ;;
15161         *)
15162                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15163                 ;;
15164         esac
15165 done
15166
15167                 cf_test=XawSimpleMenuAddGlobalActions
15168                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15169
15170 cf_add_libs="$LIBS"
15171 # reverse order
15172 cf_add_0lib=
15173 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15174 # filter duplicates
15175 for cf_add_1lib in $cf_add_0lib; do
15176         for cf_add_2lib in $cf_add_libs; do
15177                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15178                         cf_add_1lib=
15179                         break
15180                 fi
15181         done
15182         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15183 done
15184 LIBS="$cf_add_libs"
15185
15186                 echo "$as_me:15186: checking for $cf_test in $cf_libs" >&5
15187 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15188                 cat >conftest.$ac_ext <<_ACEOF
15189 #line 15189 "configure"
15190 #include "confdefs.h"
15191
15192 #include <X11/Intrinsic.h>
15193 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15194
15195 int
15196 main (void)
15197 {
15198
15199 $cf_test((XtAppContext) 0)
15200   ;
15201   return 0;
15202 }
15203 _ACEOF
15204 rm -f conftest.$ac_objext conftest$ac_exeext
15205 if { (eval echo "$as_me:15205: \"$ac_link\"") >&5
15206   (eval $ac_link) 2>&5
15207   ac_status=$?
15208   echo "$as_me:15208: \$? = $ac_status" >&5
15209   (exit $ac_status); } &&
15210          { ac_try='test -s conftest$ac_exeext'
15211   { (eval echo "$as_me:15211: \"$ac_try\"") >&5
15212   (eval $ac_try) 2>&5
15213   ac_status=$?
15214   echo "$as_me:15214: \$? = $ac_status" >&5
15215   (exit $ac_status); }; }; then
15216   cf_result=yes
15217 else
15218   echo "$as_me: failed program was:" >&5
15219 cat conftest.$ac_ext >&5
15220 cf_result=no
15221 fi
15222 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15223                 echo "$as_me:15223: result: $cf_result" >&5
15224 echo "${ECHO_T}$cf_result" >&6
15225
15226 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15227 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15228 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15229
15230                 if test "$cf_result" = yes ; then
15231                         cf_x_athena_lib="$cf_libs"
15232                         break
15233                 fi
15234         done # cf_libs
15235                 test -n "$cf_x_athena_lib" && break
15236         done # cf_lib
15237 done
15238
15239 if test -z "$cf_x_athena_lib" ; then
15240         { { echo "$as_me:15240: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15241 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15242    { (exit 1); exit 1; }; }
15243 fi
15244
15245 cf_add_libs="$LIBS"
15246 # reverse order
15247 cf_add_0lib=
15248 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15249 # filter duplicates
15250 for cf_add_1lib in $cf_add_0lib; do
15251         for cf_add_2lib in $cf_add_libs; do
15252                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15253                         cf_add_1lib=
15254                         break
15255                 fi
15256         done
15257         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15258 done
15259 LIBS="$cf_add_libs"
15260
15261 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15262
15263 cat >>confdefs.h <<EOF
15264 #define $cf_x_athena_LIBS 1
15265 EOF
15266
15267 fi
15268
15269 if test -n "$ac_tool_prefix"; then
15270   for ac_prog in xcurses-config
15271   do
15272     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15273 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15274 echo "$as_me:15274: checking for $ac_word" >&5
15275 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15276 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15277   echo $ECHO_N "(cached) $ECHO_C" >&6
15278 else
15279   if test -n "$XCURSES_CONFIG"; then
15280   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15281 else
15282   ac_save_IFS=$IFS; IFS=$ac_path_separator
15283 ac_dummy="$PATH"
15284 for ac_dir in $ac_dummy; do
15285   IFS=$ac_save_IFS
15286   test -z "$ac_dir" && ac_dir=.
15287   $as_executable_p "$ac_dir/$ac_word" || continue
15288 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15289 echo "$as_me:15289: found $ac_dir/$ac_word" >&5
15290 break
15291 done
15292
15293 fi
15294 fi
15295 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15296 if test -n "$XCURSES_CONFIG"; then
15297   echo "$as_me:15297: result: $XCURSES_CONFIG" >&5
15298 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15299 else
15300   echo "$as_me:15300: result: no" >&5
15301 echo "${ECHO_T}no" >&6
15302 fi
15303
15304     test -n "$XCURSES_CONFIG" && break
15305   done
15306 fi
15307 if test -z "$XCURSES_CONFIG"; then
15308   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15309   for ac_prog in xcurses-config
15310 do
15311   # Extract the first word of "$ac_prog", so it can be a program name with args.
15312 set dummy $ac_prog; ac_word=$2
15313 echo "$as_me:15313: checking for $ac_word" >&5
15314 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15315 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15316   echo $ECHO_N "(cached) $ECHO_C" >&6
15317 else
15318   if test -n "$ac_ct_XCURSES_CONFIG"; then
15319   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15320 else
15321   ac_save_IFS=$IFS; IFS=$ac_path_separator
15322 ac_dummy="$PATH"
15323 for ac_dir in $ac_dummy; do
15324   IFS=$ac_save_IFS
15325   test -z "$ac_dir" && ac_dir=.
15326   $as_executable_p "$ac_dir/$ac_word" || continue
15327 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15328 echo "$as_me:15328: found $ac_dir/$ac_word" >&5
15329 break
15330 done
15331
15332 fi
15333 fi
15334 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15335 if test -n "$ac_ct_XCURSES_CONFIG"; then
15336   echo "$as_me:15336: result: $ac_ct_XCURSES_CONFIG" >&5
15337 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15338 else
15339   echo "$as_me:15339: result: no" >&5
15340 echo "${ECHO_T}no" >&6
15341 fi
15342
15343   test -n "$ac_ct_XCURSES_CONFIG" && break
15344 done
15345 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15346
15347   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15348 fi
15349
15350 if test "$XCURSES_CONFIG" != none ; then
15351
15352 cf_fix_cppflags=no
15353 cf_new_cflags=
15354 cf_new_cppflags=
15355 cf_new_extra_cppflags=
15356
15357 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15358 do
15359 case $cf_fix_cppflags in
15360 (no)
15361         case $cf_add_cflags in
15362         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15363                 case $cf_add_cflags in
15364                 (-D*)
15365                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15366
15367                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15368                                 && test -z "${cf_tst_cflags}" \
15369                                 && cf_fix_cppflags=yes
15370
15371                         if test $cf_fix_cppflags = yes ; then
15372
15373         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15374         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15375
15376                                 continue
15377                         elif test "${cf_tst_cflags}" = "\"'" ; then
15378
15379         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15380         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15381
15382                                 continue
15383                         fi
15384                         ;;
15385                 esac
15386                 case "$CPPFLAGS" in
15387                 (*$cf_add_cflags)
15388                         ;;
15389                 (*)
15390                         case $cf_add_cflags in
15391                         (-D*)
15392                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15393
15394 CPPFLAGS=`echo "$CPPFLAGS" | \
15395         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15396                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15397
15398                                 ;;
15399                         esac
15400
15401         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15402         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15403
15404                         ;;
15405                 esac
15406                 ;;
15407         (*)
15408
15409         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15410         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15411
15412                 ;;
15413         esac
15414         ;;
15415 (yes)
15416
15417         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15418         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15419
15420         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15421
15422         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15423                 && test -z "${cf_tst_cflags}" \
15424                 && cf_fix_cppflags=no
15425         ;;
15426 esac
15427 done
15428
15429 if test -n "$cf_new_cflags" ; then
15430
15431         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15432         CFLAGS="${CFLAGS}$cf_new_cflags"
15433
15434 fi
15435
15436 if test -n "$cf_new_cppflags" ; then
15437
15438         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15439         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15440
15441 fi
15442
15443 if test -n "$cf_new_extra_cppflags" ; then
15444
15445         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15446         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15447
15448 fi
15449
15450 cf_add_libs="$LIBS"
15451 # reverse order
15452 cf_add_0lib=
15453 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15454 # filter duplicates
15455 for cf_add_1lib in $cf_add_0lib; do
15456         for cf_add_2lib in $cf_add_libs; do
15457                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15458                         cf_add_1lib=
15459                         break
15460                 fi
15461         done
15462         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15463 done
15464 LIBS="$cf_add_libs"
15465
15466 cf_cv_lib_XCurses=yes
15467
15468 else
15469
15470 LDFLAGS="$LDFLAGS $X_LIBS"
15471
15472 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15473
15474 echo "${as_me:-configure}:15474: testing checking additions to CFLAGS ..." 1>&5
15475
15476 cf_check_cflags="$CFLAGS"
15477 cf_check_cppflags="$CPPFLAGS"
15478
15479 cf_fix_cppflags=no
15480 cf_new_cflags=
15481 cf_new_cppflags=
15482 cf_new_extra_cppflags=
15483
15484 for cf_add_cflags in $X_CFLAGS
15485 do
15486 case $cf_fix_cppflags in
15487 (no)
15488         case $cf_add_cflags in
15489         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15490                 case $cf_add_cflags in
15491                 (-D*)
15492                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15493
15494                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15495                                 && test -z "${cf_tst_cflags}" \
15496                                 && cf_fix_cppflags=yes
15497
15498                         if test $cf_fix_cppflags = yes ; then
15499
15500         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15501         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15502
15503                                 continue
15504                         elif test "${cf_tst_cflags}" = "\"'" ; then
15505
15506         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15507         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15508
15509                                 continue
15510                         fi
15511                         ;;
15512                 esac
15513                 case "$CPPFLAGS" in
15514                 (*$cf_add_cflags)
15515                         ;;
15516                 (*)
15517                         case $cf_add_cflags in
15518                         (-D*)
15519                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15520
15521 CPPFLAGS=`echo "$CPPFLAGS" | \
15522         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15523                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15524
15525                                 ;;
15526                         esac
15527
15528         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15529         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15530
15531                         ;;
15532                 esac
15533                 ;;
15534         (*)
15535
15536         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15537         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15538
15539                 ;;
15540         esac
15541         ;;
15542 (yes)
15543
15544         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15545         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15546
15547         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15548
15549         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15550                 && test -z "${cf_tst_cflags}" \
15551                 && cf_fix_cppflags=no
15552         ;;
15553 esac
15554 done
15555
15556 if test -n "$cf_new_cflags" ; then
15557         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15558
15559 echo "${as_me:-configure}:15559: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15560
15561         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15562         CFLAGS="${CFLAGS}$cf_new_cflags"
15563
15564 fi
15565
15566 if test -n "$cf_new_cppflags" ; then
15567         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15568
15569 echo "${as_me:-configure}:15569: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15570
15571         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15572         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15573
15574 fi
15575
15576 if test -n "$cf_new_extra_cppflags" ; then
15577         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15578
15579 echo "${as_me:-configure}:15579: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15580
15581         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15582         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15583
15584 fi
15585
15586 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15587 cat >conftest.$ac_ext <<_ACEOF
15588 #line 15588 "configure"
15589 #include "confdefs.h"
15590 #include <stdio.h>
15591 int
15592 main (void)
15593 {
15594 printf("Hello world");
15595   ;
15596   return 0;
15597 }
15598 _ACEOF
15599 rm -f conftest.$ac_objext conftest$ac_exeext
15600 if { (eval echo "$as_me:15600: \"$ac_link\"") >&5
15601   (eval $ac_link) 2>&5
15602   ac_status=$?
15603   echo "$as_me:15603: \$? = $ac_status" >&5
15604   (exit $ac_status); } &&
15605          { ac_try='test -s conftest$ac_exeext'
15606   { (eval echo "$as_me:15606: \"$ac_try\"") >&5
15607   (eval $ac_try) 2>&5
15608   ac_status=$?
15609   echo "$as_me:15609: \$? = $ac_status" >&5
15610   (exit $ac_status); }; }; then
15611   :
15612 else
15613   echo "$as_me: failed program was:" >&5
15614 cat conftest.$ac_ext >&5
15615 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15616
15617 echo "${as_me:-configure}:15617: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15618
15619          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15620                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15621
15622 echo "${as_me:-configure}:15622: testing but keeping change to \$CPPFLAGS ..." 1>&5
15623
15624          fi
15625          CFLAGS="$cf_check_flags"
15626 fi
15627 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15628 fi
15629
15630 echo "$as_me:15630: checking for XOpenDisplay in -lX11" >&5
15631 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15632 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15633   echo $ECHO_N "(cached) $ECHO_C" >&6
15634 else
15635   ac_check_lib_save_LIBS=$LIBS
15636 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15637 cat >conftest.$ac_ext <<_ACEOF
15638 #line 15638 "configure"
15639 #include "confdefs.h"
15640
15641 /* Override any gcc2 internal prototype to avoid an error.  */
15642 #ifdef __cplusplus
15643 extern "C"
15644 #endif
15645 /* We use char because int might match the return type of a gcc2
15646    builtin and then its argument prototype would still apply.  */
15647 char XOpenDisplay ();
15648 int
15649 main (void)
15650 {
15651 XOpenDisplay ();
15652   ;
15653   return 0;
15654 }
15655 _ACEOF
15656 rm -f conftest.$ac_objext conftest$ac_exeext
15657 if { (eval echo "$as_me:15657: \"$ac_link\"") >&5
15658   (eval $ac_link) 2>&5
15659   ac_status=$?
15660   echo "$as_me:15660: \$? = $ac_status" >&5
15661   (exit $ac_status); } &&
15662          { ac_try='test -s conftest$ac_exeext'
15663   { (eval echo "$as_me:15663: \"$ac_try\"") >&5
15664   (eval $ac_try) 2>&5
15665   ac_status=$?
15666   echo "$as_me:15666: \$? = $ac_status" >&5
15667   (exit $ac_status); }; }; then
15668   ac_cv_lib_X11_XOpenDisplay=yes
15669 else
15670   echo "$as_me: failed program was:" >&5
15671 cat conftest.$ac_ext >&5
15672 ac_cv_lib_X11_XOpenDisplay=no
15673 fi
15674 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15675 LIBS=$ac_check_lib_save_LIBS
15676 fi
15677 echo "$as_me:15677: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15678 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15679 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15680
15681 cf_add_libs="$LIBS"
15682 # reverse order
15683 cf_add_0lib=
15684 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15685 # filter duplicates
15686 for cf_add_1lib in $cf_add_0lib; do
15687         for cf_add_2lib in $cf_add_libs; do
15688                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15689                         cf_add_1lib=
15690                         break
15691                 fi
15692         done
15693         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15694 done
15695 LIBS="$cf_add_libs"
15696
15697 fi
15698
15699 echo "$as_me:15699: checking for XCurses library" >&5
15700 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15701 if test "${cf_cv_lib_XCurses+set}" = set; then
15702   echo $ECHO_N "(cached) $ECHO_C" >&6
15703 else
15704
15705 cf_add_libs="$LIBS"
15706 # reverse order
15707 cf_add_0lib=
15708 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15709 # filter duplicates
15710 for cf_add_1lib in $cf_add_0lib; do
15711         for cf_add_2lib in $cf_add_libs; do
15712                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15713                         cf_add_1lib=
15714                         break
15715                 fi
15716         done
15717         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15718 done
15719 LIBS="$cf_add_libs"
15720
15721 cat >conftest.$ac_ext <<_ACEOF
15722 #line 15722 "configure"
15723 #include "confdefs.h"
15724
15725 #include <xcurses.h>
15726 char *XCursesProgramName = "test";
15727
15728 int
15729 main (void)
15730 {
15731 XCursesExit();
15732   ;
15733   return 0;
15734 }
15735 _ACEOF
15736 rm -f conftest.$ac_objext conftest$ac_exeext
15737 if { (eval echo "$as_me:15737: \"$ac_link\"") >&5
15738   (eval $ac_link) 2>&5
15739   ac_status=$?
15740   echo "$as_me:15740: \$? = $ac_status" >&5
15741   (exit $ac_status); } &&
15742          { ac_try='test -s conftest$ac_exeext'
15743   { (eval echo "$as_me:15743: \"$ac_try\"") >&5
15744   (eval $ac_try) 2>&5
15745   ac_status=$?
15746   echo "$as_me:15746: \$? = $ac_status" >&5
15747   (exit $ac_status); }; }; then
15748   cf_cv_lib_XCurses=yes
15749 else
15750   echo "$as_me: failed program was:" >&5
15751 cat conftest.$ac_ext >&5
15752 cf_cv_lib_XCurses=no
15753 fi
15754 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15755
15756 fi
15757 echo "$as_me:15757: result: $cf_cv_lib_XCurses" >&5
15758 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15759
15760 fi
15761
15762 if test $cf_cv_lib_XCurses = yes ; then
15763
15764 cat >>confdefs.h <<\EOF
15765 #define UNIX 1
15766 EOF
15767
15768 cat >>confdefs.h <<\EOF
15769 #define XCURSES 1
15770 EOF
15771
15772         echo "$as_me:15772: checking for xcurses.h" >&5
15773 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15774 if test "${ac_cv_header_xcurses_h+set}" = set; then
15775   echo $ECHO_N "(cached) $ECHO_C" >&6
15776 else
15777   cat >conftest.$ac_ext <<_ACEOF
15778 #line 15778 "configure"
15779 #include "confdefs.h"
15780 #include <xcurses.h>
15781 _ACEOF
15782 if { (eval echo "$as_me:15782: \"$ac_cpp conftest.$ac_ext\"") >&5
15783   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15784   ac_status=$?
15785   egrep -v '^ *\+' conftest.er1 >conftest.err
15786   rm -f conftest.er1
15787   cat conftest.err >&5
15788   echo "$as_me:15788: \$? = $ac_status" >&5
15789   (exit $ac_status); } >/dev/null; then
15790   if test -s conftest.err; then
15791     ac_cpp_err=$ac_c_preproc_warn_flag
15792   else
15793     ac_cpp_err=
15794   fi
15795 else
15796   ac_cpp_err=yes
15797 fi
15798 if test -z "$ac_cpp_err"; then
15799   ac_cv_header_xcurses_h=yes
15800 else
15801   echo "$as_me: failed program was:" >&5
15802   cat conftest.$ac_ext >&5
15803   ac_cv_header_xcurses_h=no
15804 fi
15805 rm -f conftest.err conftest.$ac_ext
15806 fi
15807 echo "$as_me:15807: result: $ac_cv_header_xcurses_h" >&5
15808 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15809 if test $ac_cv_header_xcurses_h = yes; then
15810
15811 cat >>confdefs.h <<\EOF
15812 #define HAVE_XCURSES 1
15813 EOF
15814
15815 fi
15816
15817 else
15818         { { echo "$as_me:15818: error: Cannot link with XCurses" >&5
15819 echo "$as_me: error: Cannot link with XCurses" >&2;}
15820    { (exit 1); exit 1; }; }
15821 fi
15822
15823         ;;
15824 (*)
15825         { { echo "$as_me:15825: error: unexpected screen-value: $cf_cv_screen" >&5
15826 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15827    { (exit 1); exit 1; }; }
15828         ;;
15829 esac
15830
15831 : ${cf_nculib_root:=$cf_cv_screen}
15832 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15833 echo "$as_me:15833: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15834 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15835 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15836   echo $ECHO_N "(cached) $ECHO_C" >&6
15837 else
15838   ac_check_lib_save_LIBS=$LIBS
15839 LIBS="-l$cf_nculib_root  $LIBS"
15840 cat >conftest.$ac_ext <<_ACEOF
15841 #line 15841 "configure"
15842 #include "confdefs.h"
15843
15844 /* Override any gcc2 internal prototype to avoid an error.  */
15845 #ifdef __cplusplus
15846 extern "C"
15847 #endif
15848 /* We use char because int might match the return type of a gcc2
15849    builtin and then its argument prototype would still apply.  */
15850 char _nc_init_pthreads ();
15851 int
15852 main (void)
15853 {
15854 _nc_init_pthreads ();
15855   ;
15856   return 0;
15857 }
15858 _ACEOF
15859 rm -f conftest.$ac_objext conftest$ac_exeext
15860 if { (eval echo "$as_me:15860: \"$ac_link\"") >&5
15861   (eval $ac_link) 2>&5
15862   ac_status=$?
15863   echo "$as_me:15863: \$? = $ac_status" >&5
15864   (exit $ac_status); } &&
15865          { ac_try='test -s conftest$ac_exeext'
15866   { (eval echo "$as_me:15866: \"$ac_try\"") >&5
15867   (eval $ac_try) 2>&5
15868   ac_status=$?
15869   echo "$as_me:15869: \$? = $ac_status" >&5
15870   (exit $ac_status); }; }; then
15871   eval "$as_ac_Lib=yes"
15872 else
15873   echo "$as_me: failed program was:" >&5
15874 cat conftest.$ac_ext >&5
15875 eval "$as_ac_Lib=no"
15876 fi
15877 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15878 LIBS=$ac_check_lib_save_LIBS
15879 fi
15880 echo "$as_me:15880: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15881 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15882 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15883   cf_cv_ncurses_pthreads=yes
15884 else
15885   cf_cv_ncurses_pthreads=no
15886 fi
15887
15888 if test "$cf_cv_ncurses_pthreads" = yes
15889 then
15890
15891 cf_add_libs="$LIBS"
15892 # reverse order
15893 cf_add_0lib=
15894 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15895 # filter duplicates
15896 for cf_add_1lib in $cf_add_0lib; do
15897         for cf_add_2lib in $cf_add_libs; do
15898                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15899                         cf_add_1lib=
15900                         break
15901                 fi
15902         done
15903         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15904 done
15905 LIBS="$cf_add_libs"
15906
15907 fi
15908
15909 case $cf_cv_screen in
15910 (ncurses*)
15911         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15912         ;;
15913 esac
15914
15915 echo "$as_me:15915: checking for X11 rgb file" >&5
15916 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15917
15918 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15919 if test "${with_x11_rgb+set}" = set; then
15920   withval="$with_x11_rgb"
15921   RGB_PATH=$withval
15922 else
15923   RGB_PATH=auto
15924 fi;
15925
15926 if test "x$RGB_PATH" = xauto
15927 then
15928         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15929         for cf_path in \
15930                 /opt/local/share/X11/rgb.txt \
15931                 /opt/X11/share/X11/rgb.txt \
15932                 /usr/share/X11/rgb.txt \
15933                 /usr/X11/share/X11/rgb.txt \
15934                 /usr/X11/lib/X11/rgb.txt \
15935                 /usr/lib/X11/rgb.txt \
15936                 /etc/X11/rgb.txt \
15937                 /usr/pkg/lib/X11/rgb.txt \
15938                 /usr/X11R7/lib/X11/rgb.txt \
15939                 /usr/X11R6/lib/X11/rgb.txt \
15940                 /usr/X11R5/lib/X11/rgb.txt \
15941                 /usr/X11R4/lib/X11/rgb.txt \
15942                 /usr/local/lib/X11/rgb.txt \
15943                 /usr/local/share/X11/rgb.txt \
15944                 /usr/lib64/X11/rgb.txt
15945         do
15946                 if test -f "$cf_path" ; then
15947                         RGB_PATH="$cf_path"
15948                         break
15949                 fi
15950         done
15951 else
15952         cf_path=$RGB_PATH
15953
15954 if test "x$prefix" != xNONE; then
15955         cf_path_syntax="$prefix"
15956 else
15957         cf_path_syntax="$ac_default_prefix"
15958 fi
15959
15960 case ".$cf_path" in
15961 (.\$\(*\)*|.\'*\'*)
15962         ;;
15963 (..|./*|.\\*)
15964         ;;
15965 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15966         ;;
15967 (.\${*prefix}*|.\${*dir}*)
15968         eval cf_path="$cf_path"
15969         case ".$cf_path" in
15970         (.NONE/*)
15971                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15972                 ;;
15973         esac
15974         ;;
15975 (.no|.NONE/*)
15976         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15977         ;;
15978 (*)
15979         { { echo "$as_me:15979: error: expected a pathname, not \"$cf_path\"" >&5
15980 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15981    { (exit 1); exit 1; }; }
15982         ;;
15983 esac
15984
15985 fi
15986
15987 echo "$as_me:15987: result: $RGB_PATH" >&5
15988 echo "${ECHO_T}$RGB_PATH" >&6
15989
15990 cat >>confdefs.h <<EOF
15991 #define RGB_PATH "$cf_path"
15992 EOF
15993
15994 no_x11_rgb=
15995 if test "$RGB_PATH" = no
15996 then
15997         no_x11_rgb="#"
15998 fi
15999
16000 cf_curses_headers=
16001
16002 case $cf_cv_screen in
16003 (pdcurses)
16004         cf_default_panel=no
16005         cf_default_form=no
16006         cf_default_menu=no
16007         cf_default_tinfo=no
16008         ;;
16009 (xcurses|bsdcurses)
16010         cf_default_panel=no
16011         cf_default_form=no
16012         cf_default_menu=no
16013         cf_default_tinfo=yes
16014         ;;
16015 (*)
16016         cf_default_panel=yes
16017         cf_default_form=yes
16018         cf_default_menu=yes
16019         cf_default_tinfo=yes
16020         case $cf_cv_screen in
16021         (ncurses*)
16022                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16023                 ;;
16024         esac
16025         ;;
16026 esac
16027
16028 echo "$as_me:16028: checking if you want to check for panel functions" >&5
16029 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16030
16031 # Check whether --enable-panel or --disable-panel was given.
16032 if test "${enable_panel+set}" = set; then
16033   enableval="$enable_panel"
16034   test "$enableval" != no && enableval=yes
16035         if test "$enableval" != "yes" ; then
16036     cf_enable_panel=no
16037         else
16038                 cf_enable_panel=$cf_default_panel
16039         fi
16040 else
16041   enableval=yes
16042         cf_enable_panel=$cf_default_panel
16043
16044 fi;
16045 echo "$as_me:16045: result: $cf_enable_panel" >&5
16046 echo "${ECHO_T}$cf_enable_panel" >&6
16047 if test $cf_enable_panel = yes
16048 then
16049
16050 cf_have_curses_lib=no
16051
16052 : ${NCURSES_CONFIG_PKG:=none}
16053 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16054         :
16055 elif test "x${PKG_CONFIG:=none}" != xnone; then
16056         echo "$as_me:16056: checking pkg-config for panel$cf_cv_libtype" >&5
16057 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
16058         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
16059                 echo "$as_me:16059: result: yes" >&5
16060 echo "${ECHO_T}yes" >&6
16061
16062                 echo "$as_me:16062: checking if the panel$cf_cv_libtype package files work" >&5
16063 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
16064
16065                 cf_save_CPPFLAGS="$CPPFLAGS"
16066                 cf_save_LIBS="$LIBS"
16067
16068 cf_fix_cppflags=no
16069 cf_new_cflags=
16070 cf_new_cppflags=
16071 cf_new_extra_cppflags=
16072
16073 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
16074 do
16075 case $cf_fix_cppflags in
16076 (no)
16077         case $cf_add_cflags in
16078         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16079                 case $cf_add_cflags in
16080                 (-D*)
16081                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16082
16083                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16084                                 && test -z "${cf_tst_cflags}" \
16085                                 && cf_fix_cppflags=yes
16086
16087                         if test $cf_fix_cppflags = yes ; then
16088
16089         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16090         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16091
16092                                 continue
16093                         elif test "${cf_tst_cflags}" = "\"'" ; then
16094
16095         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16096         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16097
16098                                 continue
16099                         fi
16100                         ;;
16101                 esac
16102                 case "$CPPFLAGS" in
16103                 (*$cf_add_cflags)
16104                         ;;
16105                 (*)
16106                         case $cf_add_cflags in
16107                         (-D*)
16108                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16109
16110 CPPFLAGS=`echo "$CPPFLAGS" | \
16111         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16112                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16113
16114                                 ;;
16115                         esac
16116
16117         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16118         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16119
16120                         ;;
16121                 esac
16122                 ;;
16123         (*)
16124
16125         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16126         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16127
16128                 ;;
16129         esac
16130         ;;
16131 (yes)
16132
16133         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16134         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16135
16136         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16137
16138         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16139                 && test -z "${cf_tst_cflags}" \
16140                 && cf_fix_cppflags=no
16141         ;;
16142 esac
16143 done
16144
16145 if test -n "$cf_new_cflags" ; then
16146
16147         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16148         CFLAGS="${CFLAGS}$cf_new_cflags"
16149
16150 fi
16151
16152 if test -n "$cf_new_cppflags" ; then
16153
16154         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16155         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16156
16157 fi
16158
16159 if test -n "$cf_new_extra_cppflags" ; then
16160
16161         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16162         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16163
16164 fi
16165
16166 cf_add_libs="$LIBS"
16167 # reverse order
16168 cf_add_0lib=
16169 for cf_add_1lib in `$PKG_CONFIG --libs panel$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16170 # filter duplicates
16171 for cf_add_1lib in $cf_add_0lib; do
16172         for cf_add_2lib in $cf_add_libs; do
16173                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16174                         cf_add_1lib=
16175                         break
16176                 fi
16177         done
16178         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16179 done
16180 LIBS="$cf_add_libs"
16181
16182                 cat >conftest.$ac_ext <<_ACEOF
16183 #line 16183 "configure"
16184 #include "confdefs.h"
16185 #include <panel.h>
16186 int
16187 main (void)
16188 {
16189 (void) new_panel ( 0 );
16190   ;
16191   return 0;
16192 }
16193 _ACEOF
16194 rm -f conftest.$ac_objext conftest$ac_exeext
16195 if { (eval echo "$as_me:16195: \"$ac_link\"") >&5
16196   (eval $ac_link) 2>&5
16197   ac_status=$?
16198   echo "$as_me:16198: \$? = $ac_status" >&5
16199   (exit $ac_status); } &&
16200          { ac_try='test -s conftest$ac_exeext'
16201   { (eval echo "$as_me:16201: \"$ac_try\"") >&5
16202   (eval $ac_try) 2>&5
16203   ac_status=$?
16204   echo "$as_me:16204: \$? = $ac_status" >&5
16205   (exit $ac_status); }; }; then
16206   if test "$cross_compiling" = yes; then
16207   cf_have_curses_lib=maybe
16208 else
16209   cat >conftest.$ac_ext <<_ACEOF
16210 #line 16210 "configure"
16211 #include "confdefs.h"
16212 #include <panel.h>
16213                                 int main(void)
16214                                 { (void) new_panel ( 0 ); return 0; }
16215 _ACEOF
16216 rm -f conftest$ac_exeext
16217 if { (eval echo "$as_me:16217: \"$ac_link\"") >&5
16218   (eval $ac_link) 2>&5
16219   ac_status=$?
16220   echo "$as_me:16220: \$? = $ac_status" >&5
16221   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16222   { (eval echo "$as_me:16222: \"$ac_try\"") >&5
16223   (eval $ac_try) 2>&5
16224   ac_status=$?
16225   echo "$as_me:16225: \$? = $ac_status" >&5
16226   (exit $ac_status); }; }; then
16227   cf_have_curses_lib=yes
16228 else
16229   echo "$as_me: program exited with status $ac_status" >&5
16230 echo "$as_me: failed program was:" >&5
16231 cat conftest.$ac_ext >&5
16232 cf_have_curses_lib=no
16233 fi
16234 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16235 fi
16236 else
16237   echo "$as_me: failed program was:" >&5
16238 cat conftest.$ac_ext >&5
16239 cf_have_curses_lib=no
16240 fi
16241 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16242                 echo "$as_me:16242: result: $cf_have_curses_lib" >&5
16243 echo "${ECHO_T}$cf_have_curses_lib" >&6
16244                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16245                 if test "$cf_have_curses_lib" != "yes"
16246                 then
16247                         CPPFLAGS="$cf_save_CPPFLAGS"
16248                         LIBS="$cf_save_LIBS"
16249                 else
16250
16251 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16252
16253                         cat >>confdefs.h <<EOF
16254 #define $cf_upper 1
16255 EOF
16256
16257                 fi
16258         fi
16259 fi
16260 if test "$cf_have_curses_lib" = no; then
16261         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
16262 echo "$as_me:16262: checking for new_panel in -lpanel$cf_cv_libtype" >&5
16263 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
16264 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16265   echo $ECHO_N "(cached) $ECHO_C" >&6
16266 else
16267   ac_check_lib_save_LIBS=$LIBS
16268 LIBS="-lpanel$cf_cv_libtype  $LIBS"
16269 cat >conftest.$ac_ext <<_ACEOF
16270 #line 16270 "configure"
16271 #include "confdefs.h"
16272
16273 /* Override any gcc2 internal prototype to avoid an error.  */
16274 #ifdef __cplusplus
16275 extern "C"
16276 #endif
16277 /* We use char because int might match the return type of a gcc2
16278    builtin and then its argument prototype would still apply.  */
16279 char new_panel ();
16280 int
16281 main (void)
16282 {
16283 new_panel ();
16284   ;
16285   return 0;
16286 }
16287 _ACEOF
16288 rm -f conftest.$ac_objext conftest$ac_exeext
16289 if { (eval echo "$as_me:16289: \"$ac_link\"") >&5
16290   (eval $ac_link) 2>&5
16291   ac_status=$?
16292   echo "$as_me:16292: \$? = $ac_status" >&5
16293   (exit $ac_status); } &&
16294          { ac_try='test -s conftest$ac_exeext'
16295   { (eval echo "$as_me:16295: \"$ac_try\"") >&5
16296   (eval $ac_try) 2>&5
16297   ac_status=$?
16298   echo "$as_me:16298: \$? = $ac_status" >&5
16299   (exit $ac_status); }; }; then
16300   eval "$as_ac_Lib=yes"
16301 else
16302   echo "$as_me: failed program was:" >&5
16303 cat conftest.$ac_ext >&5
16304 eval "$as_ac_Lib=no"
16305 fi
16306 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16307 LIBS=$ac_check_lib_save_LIBS
16308 fi
16309 echo "$as_me:16309: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16310 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16311 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16312
16313 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16314
16315 cf_add_libs="$LIBS"
16316 # reverse order
16317 cf_add_0lib=
16318 for cf_add_1lib in -lpanel$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16319 # filter duplicates
16320 for cf_add_1lib in $cf_add_0lib; do
16321         for cf_add_2lib in $cf_add_libs; do
16322                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16323                         cf_add_1lib=
16324                         break
16325                 fi
16326         done
16327         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16328 done
16329 LIBS="$cf_add_libs"
16330
16331                 cat >>confdefs.h <<EOF
16332 #define $cf_upper 1
16333 EOF
16334
16335 fi
16336
16337 fi
16338
16339         cf_curses_headers="$cf_curses_headers panel.h"
16340 fi
16341
16342 echo "$as_me:16342: checking if you want to check for menu functions" >&5
16343 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16344
16345 # Check whether --enable-menu or --disable-menu was given.
16346 if test "${enable_menu+set}" = set; then
16347   enableval="$enable_menu"
16348   test "$enableval" != no && enableval=yes
16349         if test "$enableval" != "yes" ; then
16350     cf_enable_menu=no
16351         else
16352                 cf_enable_menu=$cf_default_menu
16353         fi
16354 else
16355   enableval=yes
16356         cf_enable_menu=$cf_default_menu
16357
16358 fi;
16359 echo "$as_me:16359: result: $cf_enable_menu" >&5
16360 echo "${ECHO_T}$cf_enable_menu" >&6
16361 if test $cf_enable_menu = yes
16362 then
16363         case $cf_cv_screen in
16364         (ncurses*)
16365                 ;;
16366         (curses*)
16367
16368 echo "$as_me:16368: checking for NetBSD menu.h" >&5
16369 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16370 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16371   echo $ECHO_N "(cached) $ECHO_C" >&6
16372 else
16373
16374 cat >conftest.$ac_ext <<_ACEOF
16375 #line 16375 "configure"
16376 #include "confdefs.h"
16377
16378 #include <${cf_cv_ncurses_header:-curses.h}>
16379 #include <menu.h>
16380
16381 int
16382 main (void)
16383 {
16384
16385         MENU *menu;
16386         int y = menu->max_item_width;
16387
16388   ;
16389   return 0;
16390 }
16391 _ACEOF
16392 rm -f conftest.$ac_objext
16393 if { (eval echo "$as_me:16393: \"$ac_compile\"") >&5
16394   (eval $ac_compile) 2>&5
16395   ac_status=$?
16396   echo "$as_me:16396: \$? = $ac_status" >&5
16397   (exit $ac_status); } &&
16398          { ac_try='test -s conftest.$ac_objext'
16399   { (eval echo "$as_me:16399: \"$ac_try\"") >&5
16400   (eval $ac_try) 2>&5
16401   ac_status=$?
16402   echo "$as_me:16402: \$? = $ac_status" >&5
16403   (exit $ac_status); }; }; then
16404   cf_cv_netbsd_menu_h=yes
16405
16406 else
16407   echo "$as_me: failed program was:" >&5
16408 cat conftest.$ac_ext >&5
16409 cf_cv_netbsd_menu_h=no
16410 fi
16411 rm -f conftest.$ac_objext conftest.$ac_ext
16412
16413 fi
16414 echo "$as_me:16414: result: $cf_cv_netbsd_menu_h" >&5
16415 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16416
16417 test "$cf_cv_netbsd_menu_h" = yes &&
16418 cat >>confdefs.h <<\EOF
16419 #define HAVE_NETBSD_MENU_H 1
16420 EOF
16421
16422                 ;;
16423         esac
16424
16425 cf_have_curses_lib=no
16426
16427 : ${NCURSES_CONFIG_PKG:=none}
16428 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16429         :
16430 elif test "x${PKG_CONFIG:=none}" != xnone; then
16431         echo "$as_me:16431: checking pkg-config for menu$cf_cv_libtype" >&5
16432 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
16433         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
16434                 echo "$as_me:16434: result: yes" >&5
16435 echo "${ECHO_T}yes" >&6
16436
16437                 echo "$as_me:16437: checking if the menu$cf_cv_libtype package files work" >&5
16438 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
16439
16440                 cf_save_CPPFLAGS="$CPPFLAGS"
16441                 cf_save_LIBS="$LIBS"
16442
16443 cf_fix_cppflags=no
16444 cf_new_cflags=
16445 cf_new_cppflags=
16446 cf_new_extra_cppflags=
16447
16448 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
16449 do
16450 case $cf_fix_cppflags in
16451 (no)
16452         case $cf_add_cflags in
16453         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16454                 case $cf_add_cflags in
16455                 (-D*)
16456                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16457
16458                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16459                                 && test -z "${cf_tst_cflags}" \
16460                                 && cf_fix_cppflags=yes
16461
16462                         if test $cf_fix_cppflags = yes ; then
16463
16464         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16465         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16466
16467                                 continue
16468                         elif test "${cf_tst_cflags}" = "\"'" ; then
16469
16470         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16471         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16472
16473                                 continue
16474                         fi
16475                         ;;
16476                 esac
16477                 case "$CPPFLAGS" in
16478                 (*$cf_add_cflags)
16479                         ;;
16480                 (*)
16481                         case $cf_add_cflags in
16482                         (-D*)
16483                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16484
16485 CPPFLAGS=`echo "$CPPFLAGS" | \
16486         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16487                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16488
16489                                 ;;
16490                         esac
16491
16492         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16493         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16494
16495                         ;;
16496                 esac
16497                 ;;
16498         (*)
16499
16500         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16501         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16502
16503                 ;;
16504         esac
16505         ;;
16506 (yes)
16507
16508         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16509         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16510
16511         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16512
16513         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16514                 && test -z "${cf_tst_cflags}" \
16515                 && cf_fix_cppflags=no
16516         ;;
16517 esac
16518 done
16519
16520 if test -n "$cf_new_cflags" ; then
16521
16522         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16523         CFLAGS="${CFLAGS}$cf_new_cflags"
16524
16525 fi
16526
16527 if test -n "$cf_new_cppflags" ; then
16528
16529         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16530         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16531
16532 fi
16533
16534 if test -n "$cf_new_extra_cppflags" ; then
16535
16536         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16537         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16538
16539 fi
16540
16541 cf_add_libs="$LIBS"
16542 # reverse order
16543 cf_add_0lib=
16544 for cf_add_1lib in `$PKG_CONFIG --libs menu$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16545 # filter duplicates
16546 for cf_add_1lib in $cf_add_0lib; do
16547         for cf_add_2lib in $cf_add_libs; do
16548                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16549                         cf_add_1lib=
16550                         break
16551                 fi
16552         done
16553         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16554 done
16555 LIBS="$cf_add_libs"
16556
16557                 cat >conftest.$ac_ext <<_ACEOF
16558 #line 16558 "configure"
16559 #include "confdefs.h"
16560 #include <menu.h>
16561 int
16562 main (void)
16563 {
16564 (void) menu_driver ( 0,0 );
16565   ;
16566   return 0;
16567 }
16568 _ACEOF
16569 rm -f conftest.$ac_objext conftest$ac_exeext
16570 if { (eval echo "$as_me:16570: \"$ac_link\"") >&5
16571   (eval $ac_link) 2>&5
16572   ac_status=$?
16573   echo "$as_me:16573: \$? = $ac_status" >&5
16574   (exit $ac_status); } &&
16575          { ac_try='test -s conftest$ac_exeext'
16576   { (eval echo "$as_me:16576: \"$ac_try\"") >&5
16577   (eval $ac_try) 2>&5
16578   ac_status=$?
16579   echo "$as_me:16579: \$? = $ac_status" >&5
16580   (exit $ac_status); }; }; then
16581   if test "$cross_compiling" = yes; then
16582   cf_have_curses_lib=maybe
16583 else
16584   cat >conftest.$ac_ext <<_ACEOF
16585 #line 16585 "configure"
16586 #include "confdefs.h"
16587 #include <menu.h>
16588                                 int main(void)
16589                                 { (void) menu_driver ( 0,0 ); return 0; }
16590 _ACEOF
16591 rm -f conftest$ac_exeext
16592 if { (eval echo "$as_me:16592: \"$ac_link\"") >&5
16593   (eval $ac_link) 2>&5
16594   ac_status=$?
16595   echo "$as_me:16595: \$? = $ac_status" >&5
16596   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16597   { (eval echo "$as_me:16597: \"$ac_try\"") >&5
16598   (eval $ac_try) 2>&5
16599   ac_status=$?
16600   echo "$as_me:16600: \$? = $ac_status" >&5
16601   (exit $ac_status); }; }; then
16602   cf_have_curses_lib=yes
16603 else
16604   echo "$as_me: program exited with status $ac_status" >&5
16605 echo "$as_me: failed program was:" >&5
16606 cat conftest.$ac_ext >&5
16607 cf_have_curses_lib=no
16608 fi
16609 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16610 fi
16611 else
16612   echo "$as_me: failed program was:" >&5
16613 cat conftest.$ac_ext >&5
16614 cf_have_curses_lib=no
16615 fi
16616 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16617                 echo "$as_me:16617: result: $cf_have_curses_lib" >&5
16618 echo "${ECHO_T}$cf_have_curses_lib" >&6
16619                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16620                 if test "$cf_have_curses_lib" != "yes"
16621                 then
16622                         CPPFLAGS="$cf_save_CPPFLAGS"
16623                         LIBS="$cf_save_LIBS"
16624                 else
16625
16626 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16627
16628                         cat >>confdefs.h <<EOF
16629 #define $cf_upper 1
16630 EOF
16631
16632                 fi
16633         fi
16634 fi
16635 if test "$cf_have_curses_lib" = no; then
16636         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16637 echo "$as_me:16637: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
16638 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
16639 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16640   echo $ECHO_N "(cached) $ECHO_C" >&6
16641 else
16642   ac_check_lib_save_LIBS=$LIBS
16643 LIBS="-lmenu$cf_cv_libtype  $LIBS"
16644 cat >conftest.$ac_ext <<_ACEOF
16645 #line 16645 "configure"
16646 #include "confdefs.h"
16647
16648 /* Override any gcc2 internal prototype to avoid an error.  */
16649 #ifdef __cplusplus
16650 extern "C"
16651 #endif
16652 /* We use char because int might match the return type of a gcc2
16653    builtin and then its argument prototype would still apply.  */
16654 char menu_driver ();
16655 int
16656 main (void)
16657 {
16658 menu_driver ();
16659   ;
16660   return 0;
16661 }
16662 _ACEOF
16663 rm -f conftest.$ac_objext conftest$ac_exeext
16664 if { (eval echo "$as_me:16664: \"$ac_link\"") >&5
16665   (eval $ac_link) 2>&5
16666   ac_status=$?
16667   echo "$as_me:16667: \$? = $ac_status" >&5
16668   (exit $ac_status); } &&
16669          { ac_try='test -s conftest$ac_exeext'
16670   { (eval echo "$as_me:16670: \"$ac_try\"") >&5
16671   (eval $ac_try) 2>&5
16672   ac_status=$?
16673   echo "$as_me:16673: \$? = $ac_status" >&5
16674   (exit $ac_status); }; }; then
16675   eval "$as_ac_Lib=yes"
16676 else
16677   echo "$as_me: failed program was:" >&5
16678 cat conftest.$ac_ext >&5
16679 eval "$as_ac_Lib=no"
16680 fi
16681 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16682 LIBS=$ac_check_lib_save_LIBS
16683 fi
16684 echo "$as_me:16684: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16685 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16686 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16687
16688 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16689
16690 cf_add_libs="$LIBS"
16691 # reverse order
16692 cf_add_0lib=
16693 for cf_add_1lib in -lmenu$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16694 # filter duplicates
16695 for cf_add_1lib in $cf_add_0lib; do
16696         for cf_add_2lib in $cf_add_libs; do
16697                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16698                         cf_add_1lib=
16699                         break
16700                 fi
16701         done
16702         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16703 done
16704 LIBS="$cf_add_libs"
16705
16706                 cat >>confdefs.h <<EOF
16707 #define $cf_upper 1
16708 EOF
16709
16710 fi
16711
16712 fi
16713
16714         cf_curses_headers="$cf_curses_headers menu.h"
16715 fi
16716
16717 echo "$as_me:16717: checking if you want to check for form functions" >&5
16718 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16719
16720 # Check whether --enable-form or --disable-form was given.
16721 if test "${enable_form+set}" = set; then
16722   enableval="$enable_form"
16723   test "$enableval" != no && enableval=yes
16724         if test "$enableval" != "yes" ; then
16725     cf_enable_form=no
16726         else
16727                 cf_enable_form=$cf_default_form
16728         fi
16729 else
16730   enableval=yes
16731         cf_enable_form=$cf_default_form
16732
16733 fi;
16734 echo "$as_me:16734: result: $cf_enable_form" >&5
16735 echo "${ECHO_T}$cf_enable_form" >&6
16736 if test $cf_enable_form = yes
16737 then
16738         case $cf_cv_screen in
16739         (ncurses*)
16740                 ;;
16741         (curses*)
16742
16743 echo "$as_me:16743: checking for NetBSD form.h" >&5
16744 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16745 if test "${cf_cv_netbsd_form_h+set}" = set; then
16746   echo $ECHO_N "(cached) $ECHO_C" >&6
16747 else
16748
16749 cat >conftest.$ac_ext <<_ACEOF
16750 #line 16750 "configure"
16751 #include "confdefs.h"
16752
16753 #include <${cf_cv_ncurses_header:-curses.h}>
16754 #include <form.h>
16755
16756 int
16757 main (void)
16758 {
16759
16760         FORM *form;
16761         int y = current_field(form)->cursor_ypos;
16762         int x = current_field(form)->cursor_xpos;
16763
16764   ;
16765   return 0;
16766 }
16767 _ACEOF
16768 rm -f conftest.$ac_objext
16769 if { (eval echo "$as_me:16769: \"$ac_compile\"") >&5
16770   (eval $ac_compile) 2>&5
16771   ac_status=$?
16772   echo "$as_me:16772: \$? = $ac_status" >&5
16773   (exit $ac_status); } &&
16774          { ac_try='test -s conftest.$ac_objext'
16775   { (eval echo "$as_me:16775: \"$ac_try\"") >&5
16776   (eval $ac_try) 2>&5
16777   ac_status=$?
16778   echo "$as_me:16778: \$? = $ac_status" >&5
16779   (exit $ac_status); }; }; then
16780   cf_cv_netbsd_form_h=yes
16781
16782 else
16783   echo "$as_me: failed program was:" >&5
16784 cat conftest.$ac_ext >&5
16785 cf_cv_netbsd_form_h=no
16786 fi
16787 rm -f conftest.$ac_objext conftest.$ac_ext
16788
16789 fi
16790 echo "$as_me:16790: result: $cf_cv_netbsd_form_h" >&5
16791 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16792
16793 test "$cf_cv_netbsd_form_h" = yes &&
16794 cat >>confdefs.h <<\EOF
16795 #define HAVE_NETBSD_FORM_H 1
16796 EOF
16797
16798                 ;;
16799         esac
16800
16801 cf_have_curses_lib=no
16802
16803 : ${NCURSES_CONFIG_PKG:=none}
16804 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16805         :
16806 elif test "x${PKG_CONFIG:=none}" != xnone; then
16807         echo "$as_me:16807: checking pkg-config for form$cf_cv_libtype" >&5
16808 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
16809         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
16810                 echo "$as_me:16810: result: yes" >&5
16811 echo "${ECHO_T}yes" >&6
16812
16813                 echo "$as_me:16813: checking if the form$cf_cv_libtype package files work" >&5
16814 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
16815
16816                 cf_save_CPPFLAGS="$CPPFLAGS"
16817                 cf_save_LIBS="$LIBS"
16818
16819 cf_fix_cppflags=no
16820 cf_new_cflags=
16821 cf_new_cppflags=
16822 cf_new_extra_cppflags=
16823
16824 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
16825 do
16826 case $cf_fix_cppflags in
16827 (no)
16828         case $cf_add_cflags in
16829         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16830                 case $cf_add_cflags in
16831                 (-D*)
16832                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16833
16834                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16835                                 && test -z "${cf_tst_cflags}" \
16836                                 && cf_fix_cppflags=yes
16837
16838                         if test $cf_fix_cppflags = yes ; then
16839
16840         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16841         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16842
16843                                 continue
16844                         elif test "${cf_tst_cflags}" = "\"'" ; then
16845
16846         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16847         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16848
16849                                 continue
16850                         fi
16851                         ;;
16852                 esac
16853                 case "$CPPFLAGS" in
16854                 (*$cf_add_cflags)
16855                         ;;
16856                 (*)
16857                         case $cf_add_cflags in
16858                         (-D*)
16859                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16860
16861 CPPFLAGS=`echo "$CPPFLAGS" | \
16862         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16863                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16864
16865                                 ;;
16866                         esac
16867
16868         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16869         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16870
16871                         ;;
16872                 esac
16873                 ;;
16874         (*)
16875
16876         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16877         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16878
16879                 ;;
16880         esac
16881         ;;
16882 (yes)
16883
16884         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16885         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16886
16887         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16888
16889         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16890                 && test -z "${cf_tst_cflags}" \
16891                 && cf_fix_cppflags=no
16892         ;;
16893 esac
16894 done
16895
16896 if test -n "$cf_new_cflags" ; then
16897
16898         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16899         CFLAGS="${CFLAGS}$cf_new_cflags"
16900
16901 fi
16902
16903 if test -n "$cf_new_cppflags" ; then
16904
16905         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16906         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16907
16908 fi
16909
16910 if test -n "$cf_new_extra_cppflags" ; then
16911
16912         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16913         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16914
16915 fi
16916
16917 cf_add_libs="$LIBS"
16918 # reverse order
16919 cf_add_0lib=
16920 for cf_add_1lib in `$PKG_CONFIG --libs form$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16921 # filter duplicates
16922 for cf_add_1lib in $cf_add_0lib; do
16923         for cf_add_2lib in $cf_add_libs; do
16924                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16925                         cf_add_1lib=
16926                         break
16927                 fi
16928         done
16929         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16930 done
16931 LIBS="$cf_add_libs"
16932
16933                 cat >conftest.$ac_ext <<_ACEOF
16934 #line 16934 "configure"
16935 #include "confdefs.h"
16936 #include <form.h>
16937 int
16938 main (void)
16939 {
16940 (void) form_driver ( 0,0 );
16941   ;
16942   return 0;
16943 }
16944 _ACEOF
16945 rm -f conftest.$ac_objext conftest$ac_exeext
16946 if { (eval echo "$as_me:16946: \"$ac_link\"") >&5
16947   (eval $ac_link) 2>&5
16948   ac_status=$?
16949   echo "$as_me:16949: \$? = $ac_status" >&5
16950   (exit $ac_status); } &&
16951          { ac_try='test -s conftest$ac_exeext'
16952   { (eval echo "$as_me:16952: \"$ac_try\"") >&5
16953   (eval $ac_try) 2>&5
16954   ac_status=$?
16955   echo "$as_me:16955: \$? = $ac_status" >&5
16956   (exit $ac_status); }; }; then
16957   if test "$cross_compiling" = yes; then
16958   cf_have_curses_lib=maybe
16959 else
16960   cat >conftest.$ac_ext <<_ACEOF
16961 #line 16961 "configure"
16962 #include "confdefs.h"
16963 #include <form.h>
16964                                 int main(void)
16965                                 { (void) form_driver ( 0,0 ); return 0; }
16966 _ACEOF
16967 rm -f conftest$ac_exeext
16968 if { (eval echo "$as_me:16968: \"$ac_link\"") >&5
16969   (eval $ac_link) 2>&5
16970   ac_status=$?
16971   echo "$as_me:16971: \$? = $ac_status" >&5
16972   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16973   { (eval echo "$as_me:16973: \"$ac_try\"") >&5
16974   (eval $ac_try) 2>&5
16975   ac_status=$?
16976   echo "$as_me:16976: \$? = $ac_status" >&5
16977   (exit $ac_status); }; }; then
16978   cf_have_curses_lib=yes
16979 else
16980   echo "$as_me: program exited with status $ac_status" >&5
16981 echo "$as_me: failed program was:" >&5
16982 cat conftest.$ac_ext >&5
16983 cf_have_curses_lib=no
16984 fi
16985 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16986 fi
16987 else
16988   echo "$as_me: failed program was:" >&5
16989 cat conftest.$ac_ext >&5
16990 cf_have_curses_lib=no
16991 fi
16992 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16993                 echo "$as_me:16993: result: $cf_have_curses_lib" >&5
16994 echo "${ECHO_T}$cf_have_curses_lib" >&6
16995                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16996                 if test "$cf_have_curses_lib" != "yes"
16997                 then
16998                         CPPFLAGS="$cf_save_CPPFLAGS"
16999                         LIBS="$cf_save_LIBS"
17000                 else
17001
17002 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17003
17004                         cat >>confdefs.h <<EOF
17005 #define $cf_upper 1
17006 EOF
17007
17008                 fi
17009         fi
17010 fi
17011 if test "$cf_have_curses_lib" = no; then
17012         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
17013 echo "$as_me:17013: checking for form_driver in -lform$cf_cv_libtype" >&5
17014 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
17015 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17016   echo $ECHO_N "(cached) $ECHO_C" >&6
17017 else
17018   ac_check_lib_save_LIBS=$LIBS
17019 LIBS="-lform$cf_cv_libtype  $LIBS"
17020 cat >conftest.$ac_ext <<_ACEOF
17021 #line 17021 "configure"
17022 #include "confdefs.h"
17023
17024 /* Override any gcc2 internal prototype to avoid an error.  */
17025 #ifdef __cplusplus
17026 extern "C"
17027 #endif
17028 /* We use char because int might match the return type of a gcc2
17029    builtin and then its argument prototype would still apply.  */
17030 char form_driver ();
17031 int
17032 main (void)
17033 {
17034 form_driver ();
17035   ;
17036   return 0;
17037 }
17038 _ACEOF
17039 rm -f conftest.$ac_objext conftest$ac_exeext
17040 if { (eval echo "$as_me:17040: \"$ac_link\"") >&5
17041   (eval $ac_link) 2>&5
17042   ac_status=$?
17043   echo "$as_me:17043: \$? = $ac_status" >&5
17044   (exit $ac_status); } &&
17045          { ac_try='test -s conftest$ac_exeext'
17046   { (eval echo "$as_me:17046: \"$ac_try\"") >&5
17047   (eval $ac_try) 2>&5
17048   ac_status=$?
17049   echo "$as_me:17049: \$? = $ac_status" >&5
17050   (exit $ac_status); }; }; then
17051   eval "$as_ac_Lib=yes"
17052 else
17053   echo "$as_me: failed program was:" >&5
17054 cat conftest.$ac_ext >&5
17055 eval "$as_ac_Lib=no"
17056 fi
17057 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17058 LIBS=$ac_check_lib_save_LIBS
17059 fi
17060 echo "$as_me:17060: result: `eval echo '${'$as_ac_Lib'}'`" >&5
17061 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
17062 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
17063
17064 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17065
17066 cf_add_libs="$LIBS"
17067 # reverse order
17068 cf_add_0lib=
17069 for cf_add_1lib in -lform$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17070 # filter duplicates
17071 for cf_add_1lib in $cf_add_0lib; do
17072         for cf_add_2lib in $cf_add_libs; do
17073                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17074                         cf_add_1lib=
17075                         break
17076                 fi
17077         done
17078         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17079 done
17080 LIBS="$cf_add_libs"
17081
17082                 cat >>confdefs.h <<EOF
17083 #define $cf_upper 1
17084 EOF
17085
17086 fi
17087
17088 fi
17089
17090         cf_curses_headers="$cf_curses_headers form.h"
17091 fi
17092
17093 # look for curses-related headers
17094
17095 for ac_header in $cf_curses_headers
17096 do
17097 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17098 echo "$as_me:17098: checking for $ac_header" >&5
17099 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17100 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17101   echo $ECHO_N "(cached) $ECHO_C" >&6
17102 else
17103   cat >conftest.$ac_ext <<_ACEOF
17104 #line 17104 "configure"
17105 #include "confdefs.h"
17106 #include <$ac_header>
17107 _ACEOF
17108 if { (eval echo "$as_me:17108: \"$ac_cpp conftest.$ac_ext\"") >&5
17109   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17110   ac_status=$?
17111   egrep -v '^ *\+' conftest.er1 >conftest.err
17112   rm -f conftest.er1
17113   cat conftest.err >&5
17114   echo "$as_me:17114: \$? = $ac_status" >&5
17115   (exit $ac_status); } >/dev/null; then
17116   if test -s conftest.err; then
17117     ac_cpp_err=$ac_c_preproc_warn_flag
17118   else
17119     ac_cpp_err=
17120   fi
17121 else
17122   ac_cpp_err=yes
17123 fi
17124 if test -z "$ac_cpp_err"; then
17125   eval "$as_ac_Header=yes"
17126 else
17127   echo "$as_me: failed program was:" >&5
17128   cat conftest.$ac_ext >&5
17129   eval "$as_ac_Header=no"
17130 fi
17131 rm -f conftest.err conftest.$ac_ext
17132 fi
17133 echo "$as_me:17133: result: `eval echo '${'$as_ac_Header'}'`" >&5
17134 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17135 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17136   cat >>confdefs.h <<EOF
17137 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17138 EOF
17139
17140 fi
17141 done
17142
17143 echo "$as_me:17143: checking for ANSI C header files" >&5
17144 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17145 if test "${ac_cv_header_stdc+set}" = set; then
17146   echo $ECHO_N "(cached) $ECHO_C" >&6
17147 else
17148   cat >conftest.$ac_ext <<_ACEOF
17149 #line 17149 "configure"
17150 #include "confdefs.h"
17151 #include <stdlib.h>
17152 #include <stdarg.h>
17153 #include <string.h>
17154 #include <float.h>
17155
17156 _ACEOF
17157 if { (eval echo "$as_me:17157: \"$ac_cpp conftest.$ac_ext\"") >&5
17158   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17159   ac_status=$?
17160   egrep -v '^ *\+' conftest.er1 >conftest.err
17161   rm -f conftest.er1
17162   cat conftest.err >&5
17163   echo "$as_me:17163: \$? = $ac_status" >&5
17164   (exit $ac_status); } >/dev/null; then
17165   if test -s conftest.err; then
17166     ac_cpp_err=$ac_c_preproc_warn_flag
17167   else
17168     ac_cpp_err=
17169   fi
17170 else
17171   ac_cpp_err=yes
17172 fi
17173 if test -z "$ac_cpp_err"; then
17174   ac_cv_header_stdc=yes
17175 else
17176   echo "$as_me: failed program was:" >&5
17177   cat conftest.$ac_ext >&5
17178   ac_cv_header_stdc=no
17179 fi
17180 rm -f conftest.err conftest.$ac_ext
17181
17182 if test $ac_cv_header_stdc = yes; then
17183   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17184   cat >conftest.$ac_ext <<_ACEOF
17185 #line 17185 "configure"
17186 #include "confdefs.h"
17187 #include <string.h>
17188
17189 _ACEOF
17190 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17191   egrep "memchr" >/dev/null 2>&1; then
17192   :
17193 else
17194   ac_cv_header_stdc=no
17195 fi
17196 rm -rf conftest*
17197
17198 fi
17199
17200 if test $ac_cv_header_stdc = yes; then
17201   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17202   cat >conftest.$ac_ext <<_ACEOF
17203 #line 17203 "configure"
17204 #include "confdefs.h"
17205 #include <stdlib.h>
17206
17207 _ACEOF
17208 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17209   egrep "free" >/dev/null 2>&1; then
17210   :
17211 else
17212   ac_cv_header_stdc=no
17213 fi
17214 rm -rf conftest*
17215
17216 fi
17217
17218 if test $ac_cv_header_stdc = yes; then
17219   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17220   if test "$cross_compiling" = yes; then
17221   :
17222 else
17223   cat >conftest.$ac_ext <<_ACEOF
17224 #line 17224 "configure"
17225 #include "confdefs.h"
17226 #include <ctype.h>
17227 #if ((' ' & 0x0FF) == 0x020)
17228 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17229 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17230 #else
17231 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17232                      || ('j' <= (c) && (c) <= 'r') \
17233                      || ('s' <= (c) && (c) <= 'z'))
17234 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17235 #endif
17236
17237 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17238 int
17239 main (void)
17240 {
17241   int i;
17242   for (i = 0; i < 256; i++)
17243     if (XOR (islower (i), ISLOWER (i))
17244         || toupper (i) != TOUPPER (i))
17245       $ac_main_return(2);
17246   $ac_main_return (0);
17247 }
17248 _ACEOF
17249 rm -f conftest$ac_exeext
17250 if { (eval echo "$as_me:17250: \"$ac_link\"") >&5
17251   (eval $ac_link) 2>&5
17252   ac_status=$?
17253   echo "$as_me:17253: \$? = $ac_status" >&5
17254   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17255   { (eval echo "$as_me:17255: \"$ac_try\"") >&5
17256   (eval $ac_try) 2>&5
17257   ac_status=$?
17258   echo "$as_me:17258: \$? = $ac_status" >&5
17259   (exit $ac_status); }; }; then
17260   :
17261 else
17262   echo "$as_me: program exited with status $ac_status" >&5
17263 echo "$as_me: failed program was:" >&5
17264 cat conftest.$ac_ext >&5
17265 ac_cv_header_stdc=no
17266 fi
17267 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17268 fi
17269 fi
17270 fi
17271 echo "$as_me:17271: result: $ac_cv_header_stdc" >&5
17272 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17273 if test $ac_cv_header_stdc = yes; then
17274
17275 cat >>confdefs.h <<\EOF
17276 #define STDC_HEADERS 1
17277 EOF
17278
17279 fi
17280
17281 echo "$as_me:17281: checking whether time.h and sys/time.h may both be included" >&5
17282 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17283 if test "${ac_cv_header_time+set}" = set; then
17284   echo $ECHO_N "(cached) $ECHO_C" >&6
17285 else
17286   cat >conftest.$ac_ext <<_ACEOF
17287 #line 17287 "configure"
17288 #include "confdefs.h"
17289 #include <sys/types.h>
17290 #include <sys/time.h>
17291 #include <time.h>
17292
17293 int
17294 main (void)
17295 {
17296 if ((struct tm *) 0)
17297 return 0;
17298   ;
17299   return 0;
17300 }
17301 _ACEOF
17302 rm -f conftest.$ac_objext
17303 if { (eval echo "$as_me:17303: \"$ac_compile\"") >&5
17304   (eval $ac_compile) 2>&5
17305   ac_status=$?
17306   echo "$as_me:17306: \$? = $ac_status" >&5
17307   (exit $ac_status); } &&
17308          { ac_try='test -s conftest.$ac_objext'
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   ac_cv_header_time=yes
17315 else
17316   echo "$as_me: failed program was:" >&5
17317 cat conftest.$ac_ext >&5
17318 ac_cv_header_time=no
17319 fi
17320 rm -f conftest.$ac_objext conftest.$ac_ext
17321 fi
17322 echo "$as_me:17322: result: $ac_cv_header_time" >&5
17323 echo "${ECHO_T}$ac_cv_header_time" >&6
17324 if test $ac_cv_header_time = yes; then
17325
17326 cat >>confdefs.h <<\EOF
17327 #define TIME_WITH_SYS_TIME 1
17328 EOF
17329
17330 fi
17331
17332 for ac_header in \
17333 getopt.h \
17334 locale.h \
17335 math.h \
17336 stdarg.h \
17337 stdint.h \
17338 sys/ioctl.h \
17339 sys/select.h \
17340 sys/time.h \
17341 termios.h \
17342 unistd.h \
17343
17344 do
17345 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17346 echo "$as_me:17346: checking for $ac_header" >&5
17347 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17348 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17349   echo $ECHO_N "(cached) $ECHO_C" >&6
17350 else
17351   cat >conftest.$ac_ext <<_ACEOF
17352 #line 17352 "configure"
17353 #include "confdefs.h"
17354 #include <$ac_header>
17355 _ACEOF
17356 if { (eval echo "$as_me:17356: \"$ac_cpp conftest.$ac_ext\"") >&5
17357   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17358   ac_status=$?
17359   egrep -v '^ *\+' conftest.er1 >conftest.err
17360   rm -f conftest.er1
17361   cat conftest.err >&5
17362   echo "$as_me:17362: \$? = $ac_status" >&5
17363   (exit $ac_status); } >/dev/null; then
17364   if test -s conftest.err; then
17365     ac_cpp_err=$ac_c_preproc_warn_flag
17366   else
17367     ac_cpp_err=
17368   fi
17369 else
17370   ac_cpp_err=yes
17371 fi
17372 if test -z "$ac_cpp_err"; then
17373   eval "$as_ac_Header=yes"
17374 else
17375   echo "$as_me: failed program was:" >&5
17376   cat conftest.$ac_ext >&5
17377   eval "$as_ac_Header=no"
17378 fi
17379 rm -f conftest.err conftest.$ac_ext
17380 fi
17381 echo "$as_me:17381: result: `eval echo '${'$as_ac_Header'}'`" >&5
17382 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17383 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17384   cat >>confdefs.h <<EOF
17385 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17386 EOF
17387
17388 fi
17389 done
17390
17391 for ac_header in unistd.h getopt.h
17392 do
17393 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17394 echo "$as_me:17394: checking for $ac_header" >&5
17395 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17396 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17397   echo $ECHO_N "(cached) $ECHO_C" >&6
17398 else
17399   cat >conftest.$ac_ext <<_ACEOF
17400 #line 17400 "configure"
17401 #include "confdefs.h"
17402 #include <$ac_header>
17403 _ACEOF
17404 if { (eval echo "$as_me:17404: \"$ac_cpp conftest.$ac_ext\"") >&5
17405   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17406   ac_status=$?
17407   egrep -v '^ *\+' conftest.er1 >conftest.err
17408   rm -f conftest.er1
17409   cat conftest.err >&5
17410   echo "$as_me:17410: \$? = $ac_status" >&5
17411   (exit $ac_status); } >/dev/null; then
17412   if test -s conftest.err; then
17413     ac_cpp_err=$ac_c_preproc_warn_flag
17414   else
17415     ac_cpp_err=
17416   fi
17417 else
17418   ac_cpp_err=yes
17419 fi
17420 if test -z "$ac_cpp_err"; then
17421   eval "$as_ac_Header=yes"
17422 else
17423   echo "$as_me: failed program was:" >&5
17424   cat conftest.$ac_ext >&5
17425   eval "$as_ac_Header=no"
17426 fi
17427 rm -f conftest.err conftest.$ac_ext
17428 fi
17429 echo "$as_me:17429: result: `eval echo '${'$as_ac_Header'}'`" >&5
17430 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17431 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17432   cat >>confdefs.h <<EOF
17433 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17434 EOF
17435
17436 fi
17437 done
17438
17439 echo "$as_me:17439: checking for header declaring getopt variables" >&5
17440 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17441 if test "${cf_cv_getopt_header+set}" = set; then
17442   echo $ECHO_N "(cached) $ECHO_C" >&6
17443 else
17444
17445 cf_cv_getopt_header=none
17446 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17447 do
17448 cat >conftest.$ac_ext <<_ACEOF
17449 #line 17449 "configure"
17450 #include "confdefs.h"
17451
17452 #include <$cf_header>
17453 int
17454 main (void)
17455 {
17456 int x = optind; char *y = optarg
17457   ;
17458   return 0;
17459 }
17460 _ACEOF
17461 rm -f conftest.$ac_objext
17462 if { (eval echo "$as_me:17462: \"$ac_compile\"") >&5
17463   (eval $ac_compile) 2>&5
17464   ac_status=$?
17465   echo "$as_me:17465: \$? = $ac_status" >&5
17466   (exit $ac_status); } &&
17467          { ac_try='test -s conftest.$ac_objext'
17468   { (eval echo "$as_me:17468: \"$ac_try\"") >&5
17469   (eval $ac_try) 2>&5
17470   ac_status=$?
17471   echo "$as_me:17471: \$? = $ac_status" >&5
17472   (exit $ac_status); }; }; then
17473   cf_cv_getopt_header=$cf_header
17474  break
17475 else
17476   echo "$as_me: failed program was:" >&5
17477 cat conftest.$ac_ext >&5
17478 fi
17479 rm -f conftest.$ac_objext conftest.$ac_ext
17480 done
17481
17482 fi
17483 echo "$as_me:17483: result: $cf_cv_getopt_header" >&5
17484 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17485 if test $cf_cv_getopt_header != none ; then
17486
17487 cat >>confdefs.h <<\EOF
17488 #define HAVE_GETOPT_HEADER 1
17489 EOF
17490
17491 fi
17492 if test $cf_cv_getopt_header = getopt.h ; then
17493
17494 cat >>confdefs.h <<\EOF
17495 #define NEED_GETOPT_H 1
17496 EOF
17497
17498 fi
17499
17500 for ac_func in \
17501 getopt \
17502 gettimeofday \
17503 strstr \
17504 tsearch \
17505
17506 do
17507 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17508 echo "$as_me:17508: checking for $ac_func" >&5
17509 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17510 if eval "test \"\${$as_ac_var+set}\" = set"; then
17511   echo $ECHO_N "(cached) $ECHO_C" >&6
17512 else
17513   cat >conftest.$ac_ext <<_ACEOF
17514 #line 17514 "configure"
17515 #include "confdefs.h"
17516 #define $ac_func autoconf_temporary
17517 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17518 #undef $ac_func
17519
17520 #ifdef __cplusplus
17521 extern "C"
17522 #endif
17523
17524 /* We use char because int might match the return type of a gcc2
17525    builtin and then its argument prototype would still apply.  */
17526 char $ac_func (void);
17527
17528 int
17529 main (void)
17530 {
17531
17532 /* The GNU C library defines stubs for functions which it implements
17533     to always fail with ENOSYS.  Some functions are actually named
17534     something starting with __ and the normal name is an alias.  */
17535 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17536 #error found stub for $ac_func
17537 #endif
17538
17539         return $ac_func ();
17540   ;
17541   return 0;
17542 }
17543 _ACEOF
17544 rm -f conftest.$ac_objext conftest$ac_exeext
17545 if { (eval echo "$as_me:17545: \"$ac_link\"") >&5
17546   (eval $ac_link) 2>&5
17547   ac_status=$?
17548   echo "$as_me:17548: \$? = $ac_status" >&5
17549   (exit $ac_status); } &&
17550          { ac_try='test -s conftest$ac_exeext'
17551   { (eval echo "$as_me:17551: \"$ac_try\"") >&5
17552   (eval $ac_try) 2>&5
17553   ac_status=$?
17554   echo "$as_me:17554: \$? = $ac_status" >&5
17555   (exit $ac_status); }; }; then
17556   eval "$as_ac_var=yes"
17557 else
17558   echo "$as_me: failed program was:" >&5
17559 cat conftest.$ac_ext >&5
17560 eval "$as_ac_var=no"
17561 fi
17562 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17563 fi
17564 echo "$as_me:17564: result: `eval echo '${'$as_ac_var'}'`" >&5
17565 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17566 if test `eval echo '${'$as_ac_var'}'` = yes; then
17567   cat >>confdefs.h <<EOF
17568 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17569 EOF
17570
17571 fi
17572 done
17573
17574 # use a compile-check to work with ncurses*-config and subdirectory includes
17575 echo "$as_me:17575: checking if we can use termcap.h" >&5
17576 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17577 if test "${cf_cv_have_termcap_h+set}" = set; then
17578   echo $ECHO_N "(cached) $ECHO_C" >&6
17579 else
17580
17581         cat >conftest.$ac_ext <<_ACEOF
17582 #line 17582 "configure"
17583 #include "confdefs.h"
17584
17585 #include <curses.h>
17586 #ifdef NCURSES_VERSION
17587 #undef NCURSES_VERSION
17588 #endif
17589 #include <termcap.h>
17590 #ifndef NCURSES_VERSION
17591 #error wrong header
17592 #endif
17593
17594 int
17595 main (void)
17596 {
17597 return 0;
17598   ;
17599   return 0;
17600 }
17601 _ACEOF
17602 rm -f conftest.$ac_objext
17603 if { (eval echo "$as_me:17603: \"$ac_compile\"") >&5
17604   (eval $ac_compile) 2>&5
17605   ac_status=$?
17606   echo "$as_me:17606: \$? = $ac_status" >&5
17607   (exit $ac_status); } &&
17608          { ac_try='test -s conftest.$ac_objext'
17609   { (eval echo "$as_me:17609: \"$ac_try\"") >&5
17610   (eval $ac_try) 2>&5
17611   ac_status=$?
17612   echo "$as_me:17612: \$? = $ac_status" >&5
17613   (exit $ac_status); }; }; then
17614   cf_cv_have_termcap_h=yes
17615 else
17616   echo "$as_me: failed program was:" >&5
17617 cat conftest.$ac_ext >&5
17618 cf_cv_have_termcap_h=no
17619 fi
17620 rm -f conftest.$ac_objext conftest.$ac_ext
17621 fi
17622 echo "$as_me:17622: result: $cf_cv_have_termcap_h" >&5
17623 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17624 if test "x$cf_cv_have_termcap_h" = xyes
17625 then
17626
17627 cat >>confdefs.h <<\EOF
17628 #define HAVE_TERMCAP_H 1
17629 EOF
17630
17631 else
17632 echo "$as_me:17632: checking if we can use ncurses/termcap.h" >&5
17633 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17634 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17635   echo $ECHO_N "(cached) $ECHO_C" >&6
17636 else
17637
17638         cat >conftest.$ac_ext <<_ACEOF
17639 #line 17639 "configure"
17640 #include "confdefs.h"
17641
17642 #include <ncurses/curses.h>
17643 #ifdef NCURSES_VERSION
17644 #undef NCURSES_VERSION
17645 #endif
17646 #include <ncurses/termcap.h>
17647 #ifndef NCURSES_VERSION
17648 #error wrong header
17649 #endif
17650
17651 int
17652 main (void)
17653 {
17654 return 0;
17655   ;
17656   return 0;
17657 }
17658 _ACEOF
17659 rm -f conftest.$ac_objext
17660 if { (eval echo "$as_me:17660: \"$ac_compile\"") >&5
17661   (eval $ac_compile) 2>&5
17662   ac_status=$?
17663   echo "$as_me:17663: \$? = $ac_status" >&5
17664   (exit $ac_status); } &&
17665          { ac_try='test -s conftest.$ac_objext'
17666   { (eval echo "$as_me:17666: \"$ac_try\"") >&5
17667   (eval $ac_try) 2>&5
17668   ac_status=$?
17669   echo "$as_me:17669: \$? = $ac_status" >&5
17670   (exit $ac_status); }; }; then
17671   cf_cv_have_ncurses_termcap_h=yes
17672 else
17673   echo "$as_me: failed program was:" >&5
17674 cat conftest.$ac_ext >&5
17675 cf_cv_have_ncurses_termcap_h=no
17676 fi
17677 rm -f conftest.$ac_objext conftest.$ac_ext
17678 fi
17679 echo "$as_me:17679: result: $cf_cv_have_ncurses_termcap_h" >&5
17680 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17681 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
17682 cat >>confdefs.h <<\EOF
17683 #define HAVE_NCURSES_TERMCAP_H 1
17684 EOF
17685
17686 fi
17687
17688 if test "x$ac_cv_func_getopt" = xno; then
17689         { { echo "$as_me:17689: error: getopt is required for building programs" >&5
17690 echo "$as_me: error: getopt is required for building programs" >&2;}
17691    { (exit 1); exit 1; }; }
17692 fi
17693
17694 if test "$cf_enable_widec" = yes; then
17695
17696 for ac_func in \
17697 mblen \
17698 mbrlen \
17699 mbrtowc \
17700 mbsrtowcs \
17701 mbstowcs \
17702 mbtowc \
17703 wcsrtombs \
17704 wcstombs \
17705
17706 do
17707 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17708 echo "$as_me:17708: checking for $ac_func" >&5
17709 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17710 if eval "test \"\${$as_ac_var+set}\" = set"; then
17711   echo $ECHO_N "(cached) $ECHO_C" >&6
17712 else
17713   cat >conftest.$ac_ext <<_ACEOF
17714 #line 17714 "configure"
17715 #include "confdefs.h"
17716 #define $ac_func autoconf_temporary
17717 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17718 #undef $ac_func
17719
17720 #ifdef __cplusplus
17721 extern "C"
17722 #endif
17723
17724 /* We use char because int might match the return type of a gcc2
17725    builtin and then its argument prototype would still apply.  */
17726 char $ac_func (void);
17727
17728 int
17729 main (void)
17730 {
17731
17732 /* The GNU C library defines stubs for functions which it implements
17733     to always fail with ENOSYS.  Some functions are actually named
17734     something starting with __ and the normal name is an alias.  */
17735 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17736 #error found stub for $ac_func
17737 #endif
17738
17739         return $ac_func ();
17740   ;
17741   return 0;
17742 }
17743 _ACEOF
17744 rm -f conftest.$ac_objext conftest$ac_exeext
17745 if { (eval echo "$as_me:17745: \"$ac_link\"") >&5
17746   (eval $ac_link) 2>&5
17747   ac_status=$?
17748   echo "$as_me:17748: \$? = $ac_status" >&5
17749   (exit $ac_status); } &&
17750          { ac_try='test -s conftest$ac_exeext'
17751   { (eval echo "$as_me:17751: \"$ac_try\"") >&5
17752   (eval $ac_try) 2>&5
17753   ac_status=$?
17754   echo "$as_me:17754: \$? = $ac_status" >&5
17755   (exit $ac_status); }; }; then
17756   eval "$as_ac_var=yes"
17757 else
17758   echo "$as_me: failed program was:" >&5
17759 cat conftest.$ac_ext >&5
17760 eval "$as_ac_var=no"
17761 fi
17762 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17763 fi
17764 echo "$as_me:17764: result: `eval echo '${'$as_ac_var'}'`" >&5
17765 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17766 if test `eval echo '${'$as_ac_var'}'` = yes; then
17767   cat >>confdefs.h <<EOF
17768 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17769 EOF
17770
17771 fi
17772 done
17773
17774 fi
17775
17776 echo "$as_me:17776: checking definition to turn on extended curses functions" >&5
17777 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17778 if test "${cf_cv_need_xopen_extension+set}" = set; then
17779   echo $ECHO_N "(cached) $ECHO_C" >&6
17780 else
17781
17782 cf_cv_need_xopen_extension=unknown
17783 cat >conftest.$ac_ext <<_ACEOF
17784 #line 17784 "configure"
17785 #include "confdefs.h"
17786
17787 #include <stdlib.h>
17788 #include <${cf_cv_ncurses_header:-curses.h}>
17789 int
17790 main (void)
17791 {
17792
17793 #if defined(NCURSES_VERSION_PATCH)
17794 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17795         make an error
17796 #endif
17797 #endif
17798 #ifdef NCURSES_VERSION
17799         cchar_t check;
17800         int check2 = curs_set((int)sizeof(check));
17801 #endif
17802         long x = winnstr(stdscr, "", 0);
17803         int x1, y1;
17804         getbegyx(stdscr, y1, x1)
17805   ;
17806   return 0;
17807 }
17808 _ACEOF
17809 rm -f conftest.$ac_objext conftest$ac_exeext
17810 if { (eval echo "$as_me:17810: \"$ac_link\"") >&5
17811   (eval $ac_link) 2>&5
17812   ac_status=$?
17813   echo "$as_me:17813: \$? = $ac_status" >&5
17814   (exit $ac_status); } &&
17815          { ac_try='test -s conftest$ac_exeext'
17816   { (eval echo "$as_me:17816: \"$ac_try\"") >&5
17817   (eval $ac_try) 2>&5
17818   ac_status=$?
17819   echo "$as_me:17819: \$? = $ac_status" >&5
17820   (exit $ac_status); }; }; then
17821   cf_cv_need_xopen_extension=none
17822 else
17823   echo "$as_me: failed program was:" >&5
17824 cat conftest.$ac_ext >&5
17825
17826         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17827         do
17828                 cat >conftest.$ac_ext <<_ACEOF
17829 #line 17829 "configure"
17830 #include "confdefs.h"
17831
17832 #define $cf_try_xopen_extension 1
17833 #include <stdlib.h>
17834 #include <${cf_cv_ncurses_header:-curses.h}>
17835 int
17836 main (void)
17837 {
17838
17839 #ifdef NCURSES_VERSION
17840                 cchar_t check;
17841                 int check2 = curs_set((int)sizeof(check));
17842 #endif
17843                 long x = winnstr(stdscr, "", 0);
17844                 int x1, y1;
17845                 getbegyx(stdscr, y1, x1)
17846   ;
17847   return 0;
17848 }
17849 _ACEOF
17850 rm -f conftest.$ac_objext conftest$ac_exeext
17851 if { (eval echo "$as_me:17851: \"$ac_link\"") >&5
17852   (eval $ac_link) 2>&5
17853   ac_status=$?
17854   echo "$as_me:17854: \$? = $ac_status" >&5
17855   (exit $ac_status); } &&
17856          { ac_try='test -s conftest$ac_exeext'
17857   { (eval echo "$as_me:17857: \"$ac_try\"") >&5
17858   (eval $ac_try) 2>&5
17859   ac_status=$?
17860   echo "$as_me:17860: \$? = $ac_status" >&5
17861   (exit $ac_status); }; }; then
17862   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17863 else
17864   echo "$as_me: failed program was:" >&5
17865 cat conftest.$ac_ext >&5
17866 fi
17867 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17868         done
17869
17870 fi
17871 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17872
17873 fi
17874 echo "$as_me:17874: result: $cf_cv_need_xopen_extension" >&5
17875 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17876
17877 case $cf_cv_need_xopen_extension in
17878 (*_*)
17879
17880         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17881         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17882
17883         ;;
17884 esac
17885
17886 echo "$as_me:17886: checking for term.h" >&5
17887 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17888 if test "${cf_cv_term_header+set}" = set; then
17889   echo $ECHO_N "(cached) $ECHO_C" >&6
17890 else
17891
17892 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17893 # for <term.h> if we do not find the variant.
17894
17895 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17896
17897 case ${cf_cv_ncurses_header:-curses.h} in
17898 (*/*)
17899         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17900         cf_header_list="$cf_header_item $cf_header_list"
17901         ;;
17902 esac
17903
17904 for cf_header in $cf_header_list
17905 do
17906         cat >conftest.$ac_ext <<_ACEOF
17907 #line 17907 "configure"
17908 #include "confdefs.h"
17909
17910 #include <${cf_cv_ncurses_header:-curses.h}>
17911 #include <${cf_header}>
17912 int
17913 main (void)
17914 {
17915 WINDOW *x
17916   ;
17917   return 0;
17918 }
17919 _ACEOF
17920 rm -f conftest.$ac_objext
17921 if { (eval echo "$as_me:17921: \"$ac_compile\"") >&5
17922   (eval $ac_compile) 2>&5
17923   ac_status=$?
17924   echo "$as_me:17924: \$? = $ac_status" >&5
17925   (exit $ac_status); } &&
17926          { ac_try='test -s conftest.$ac_objext'
17927   { (eval echo "$as_me:17927: \"$ac_try\"") >&5
17928   (eval $ac_try) 2>&5
17929   ac_status=$?
17930   echo "$as_me:17930: \$? = $ac_status" >&5
17931   (exit $ac_status); }; }; then
17932   cf_cv_term_header=$cf_header
17933          break
17934 else
17935   echo "$as_me: failed program was:" >&5
17936 cat conftest.$ac_ext >&5
17937 cf_cv_term_header=no
17938 fi
17939 rm -f conftest.$ac_objext conftest.$ac_ext
17940 done
17941
17942 case $cf_cv_term_header in
17943 (no)
17944         # If curses is ncurses, some packagers still mess it up by trying to make
17945         # us use GNU termcap.  This handles the most common case.
17946         for cf_header in ncurses/term.h ncursesw/term.h
17947         do
17948                 cat >conftest.$ac_ext <<_ACEOF
17949 #line 17949 "configure"
17950 #include "confdefs.h"
17951
17952 #include <${cf_cv_ncurses_header:-curses.h}>
17953 #ifdef NCURSES_VERSION
17954 #include <${cf_header}>
17955 #else
17956 make an error
17957 #endif
17958 int
17959 main (void)
17960 {
17961 WINDOW *x
17962   ;
17963   return 0;
17964 }
17965 _ACEOF
17966 rm -f conftest.$ac_objext
17967 if { (eval echo "$as_me:17967: \"$ac_compile\"") >&5
17968   (eval $ac_compile) 2>&5
17969   ac_status=$?
17970   echo "$as_me:17970: \$? = $ac_status" >&5
17971   (exit $ac_status); } &&
17972          { ac_try='test -s conftest.$ac_objext'
17973   { (eval echo "$as_me:17973: \"$ac_try\"") >&5
17974   (eval $ac_try) 2>&5
17975   ac_status=$?
17976   echo "$as_me:17976: \$? = $ac_status" >&5
17977   (exit $ac_status); }; }; then
17978   cf_cv_term_header=$cf_header
17979                          break
17980 else
17981   echo "$as_me: failed program was:" >&5
17982 cat conftest.$ac_ext >&5
17983 cf_cv_term_header=no
17984 fi
17985 rm -f conftest.$ac_objext conftest.$ac_ext
17986         done
17987         ;;
17988 esac
17989
17990 fi
17991 echo "$as_me:17991: result: $cf_cv_term_header" >&5
17992 echo "${ECHO_T}$cf_cv_term_header" >&6
17993
17994 case $cf_cv_term_header in
17995 (term.h)
17996
17997 cat >>confdefs.h <<\EOF
17998 #define HAVE_TERM_H 1
17999 EOF
18000
18001         ;;
18002 (ncurses/term.h)
18003
18004 cat >>confdefs.h <<\EOF
18005 #define HAVE_NCURSES_TERM_H 1
18006 EOF
18007
18008         ;;
18009 (ncursesw/term.h)
18010
18011 cat >>confdefs.h <<\EOF
18012 #define HAVE_NCURSESW_TERM_H 1
18013 EOF
18014
18015         ;;
18016 esac
18017
18018 echo "$as_me:18018: checking for unctrl.h" >&5
18019 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18020 if test "${cf_cv_unctrl_header+set}" = set; then
18021   echo $ECHO_N "(cached) $ECHO_C" >&6
18022 else
18023
18024 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18025 # for <unctrl.h> if we do not find the variant.
18026
18027 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18028
18029 case ${cf_cv_ncurses_header:-curses.h} in
18030 (*/*)
18031         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18032         cf_header_list="$cf_header_item $cf_header_list"
18033         ;;
18034 esac
18035
18036 for cf_header in $cf_header_list
18037 do
18038         cat >conftest.$ac_ext <<_ACEOF
18039 #line 18039 "configure"
18040 #include "confdefs.h"
18041
18042 #include <${cf_cv_ncurses_header:-curses.h}>
18043 #include <${cf_header}>
18044 int
18045 main (void)
18046 {
18047 WINDOW *x
18048   ;
18049   return 0;
18050 }
18051 _ACEOF
18052 rm -f conftest.$ac_objext
18053 if { (eval echo "$as_me:18053: \"$ac_compile\"") >&5
18054   (eval $ac_compile) 2>&5
18055   ac_status=$?
18056   echo "$as_me:18056: \$? = $ac_status" >&5
18057   (exit $ac_status); } &&
18058          { ac_try='test -s conftest.$ac_objext'
18059   { (eval echo "$as_me:18059: \"$ac_try\"") >&5
18060   (eval $ac_try) 2>&5
18061   ac_status=$?
18062   echo "$as_me:18062: \$? = $ac_status" >&5
18063   (exit $ac_status); }; }; then
18064   cf_cv_unctrl_header=$cf_header
18065          break
18066 else
18067   echo "$as_me: failed program was:" >&5
18068 cat conftest.$ac_ext >&5
18069 cf_cv_unctrl_header=no
18070 fi
18071 rm -f conftest.$ac_objext conftest.$ac_ext
18072 done
18073
18074 fi
18075 echo "$as_me:18075: result: $cf_cv_unctrl_header" >&5
18076 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18077
18078 case $cf_cv_unctrl_header in
18079 (no)
18080         { echo "$as_me:18080: WARNING: unctrl.h header not found" >&5
18081 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18082         ;;
18083 esac
18084
18085 case $cf_cv_unctrl_header in
18086 (unctrl.h)
18087
18088 cat >>confdefs.h <<\EOF
18089 #define HAVE_UNCTRL_H 1
18090 EOF
18091
18092         ;;
18093 (ncurses/unctrl.h)
18094
18095 cat >>confdefs.h <<\EOF
18096 #define HAVE_NCURSES_UNCTRL_H 1
18097 EOF
18098
18099         ;;
18100 (ncursesw/unctrl.h)
18101
18102 cat >>confdefs.h <<\EOF
18103 #define HAVE_NCURSESW_UNCTRL_H 1
18104 EOF
18105
18106         ;;
18107 esac
18108
18109 for cf_func in \
18110 alloc_pair \
18111 assume_default_colors \
18112 chgat \
18113 color_content \
18114 color_set \
18115 copywin \
18116 delscreen \
18117 dupwin \
18118 filter \
18119 getbegx \
18120 getcurx \
18121 getmaxx \
18122 getnstr \
18123 getparx \
18124 getwin \
18125 halfdelay \
18126 init_extended_color \
18127 mvderwin \
18128 mvvline \
18129 mvwin \
18130 mvwvline \
18131 napms \
18132 newpad \
18133 putwin \
18134 reset_color_pairs \
18135 resize_term \
18136 resizeterm \
18137 restartterm \
18138 ripoffline \
18139 scr_dump \
18140 setupterm \
18141 slk_color \
18142 slk_init \
18143 termattrs \
18144 tgetent \
18145 tigetnum \
18146 tigetstr \
18147 tputs_sp \
18148 typeahead \
18149 use_default_colors \
18150 use_env \
18151 use_extended_names \
18152 use_screen \
18153 use_window \
18154 vid_puts \
18155 vidputs \
18156 vsscanf \
18157 vw_printw \
18158 wchgat \
18159 winsdelln \
18160 winsstr \
18161 wresize \
18162 wsyncdown \
18163 _tracef \
18164
18165 do
18166
18167 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18168
18169         echo "$as_me:18169: checking for ${cf_func}" >&5
18170 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18171
18172 echo "${as_me:-configure}:18172: testing ${cf_func} ..." 1>&5
18173
18174         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18175   echo $ECHO_N "(cached) $ECHO_C" >&6
18176 else
18177
18178                 eval cf_result='$ac_cv_func_'$cf_func
18179                 if test ".$cf_result" != ".no"; then
18180                         cat >conftest.$ac_ext <<_ACEOF
18181 #line 18181 "configure"
18182 #include "confdefs.h"
18183
18184 #ifdef HAVE_XCURSES
18185 #include <xcurses.h>
18186 char * XCursesProgramName = "test";
18187 #else
18188 #include <${cf_cv_ncurses_header:-curses.h}>
18189 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18190 #include <ncursesw/term.h>
18191 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18192 #include <ncurses/term.h>
18193 #elif defined(HAVE_TERM_H)
18194 #include <term.h>
18195 #endif
18196 #endif
18197
18198 int
18199 main (void)
18200 {
18201
18202 #ifndef ${cf_func}
18203 long foo = (long)(&${cf_func});
18204 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18205 if (foo + 1234L > 5678L)
18206         ${cf_cv_main_return:-return}(foo != 0);
18207 #endif
18208
18209   ;
18210   return 0;
18211 }
18212 _ACEOF
18213 rm -f conftest.$ac_objext conftest$ac_exeext
18214 if { (eval echo "$as_me:18214: \"$ac_link\"") >&5
18215   (eval $ac_link) 2>&5
18216   ac_status=$?
18217   echo "$as_me:18217: \$? = $ac_status" >&5
18218   (exit $ac_status); } &&
18219          { ac_try='test -s conftest$ac_exeext'
18220   { (eval echo "$as_me:18220: \"$ac_try\"") >&5
18221   (eval $ac_try) 2>&5
18222   ac_status=$?
18223   echo "$as_me:18223: \$? = $ac_status" >&5
18224   (exit $ac_status); }; }; then
18225   cf_result=yes
18226 else
18227   echo "$as_me: failed program was:" >&5
18228 cat conftest.$ac_ext >&5
18229 cf_result=no
18230 fi
18231 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18232                 fi
18233                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18234
18235 fi
18236
18237         # use the computed/retrieved cache-value:
18238         eval 'cf_result=$cf_cv_func_'$cf_func
18239         echo "$as_me:18239: result: $cf_result" >&5
18240 echo "${ECHO_T}$cf_result" >&6
18241         if test $cf_result != no; then
18242                 cat >>confdefs.h <<EOF
18243 #define HAVE_${cf_tr_func} 1
18244 EOF
18245
18246         fi
18247 done
18248
18249 for cf_func in tputs
18250 do
18251
18252 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18253
18254         echo "$as_me:18254: checking for ${cf_func}" >&5
18255 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18256
18257 echo "${as_me:-configure}:18257: testing ${cf_func} ..." 1>&5
18258
18259         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18260   echo $ECHO_N "(cached) $ECHO_C" >&6
18261 else
18262
18263                 eval cf_result='$ac_cv_func_'$cf_func
18264                 if test ".$cf_result" != ".no"; then
18265                         cat >conftest.$ac_ext <<_ACEOF
18266 #line 18266 "configure"
18267 #include "confdefs.h"
18268
18269 #ifdef HAVE_XCURSES
18270 #include <xcurses.h>
18271 char * XCursesProgramName = "test";
18272 #else
18273 #include <${cf_cv_ncurses_header:-curses.h}>
18274 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18275 #include <ncursesw/term.h>
18276 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18277 #include <ncurses/term.h>
18278 #elif defined(HAVE_TERM_H)
18279 #include <term.h>
18280 #endif
18281 #endif
18282
18283 int
18284 main (void)
18285 {
18286
18287 #ifndef ${cf_func}
18288 long foo = (long)(&${cf_func});
18289 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18290 if (foo + 1234L > 5678L)
18291         ${cf_cv_main_return:-return}(foo != 0);
18292 #endif
18293
18294   ;
18295   return 0;
18296 }
18297 _ACEOF
18298 rm -f conftest.$ac_objext conftest$ac_exeext
18299 if { (eval echo "$as_me:18299: \"$ac_link\"") >&5
18300   (eval $ac_link) 2>&5
18301   ac_status=$?
18302   echo "$as_me:18302: \$? = $ac_status" >&5
18303   (exit $ac_status); } &&
18304          { ac_try='test -s conftest$ac_exeext'
18305   { (eval echo "$as_me:18305: \"$ac_try\"") >&5
18306   (eval $ac_try) 2>&5
18307   ac_status=$?
18308   echo "$as_me:18308: \$? = $ac_status" >&5
18309   (exit $ac_status); }; }; then
18310   cf_result=yes
18311 else
18312   echo "$as_me: failed program was:" >&5
18313 cat conftest.$ac_ext >&5
18314 cf_result=no
18315 fi
18316 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18317                 fi
18318                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18319
18320 fi
18321
18322         # use the computed/retrieved cache-value:
18323         eval 'cf_result=$cf_cv_func_'$cf_func
18324         echo "$as_me:18324: result: $cf_result" >&5
18325 echo "${ECHO_T}$cf_result" >&6
18326         if test $cf_result != no; then
18327                 cat >>confdefs.h <<EOF
18328 #define HAVE_${cf_tr_func} 1
18329 EOF
18330
18331         fi
18332 done
18333
18334 if test x$cf_cv_func_tputs = xyes
18335 then
18336         cf_done=no
18337         for cf_arg in int char
18338         do
18339                 for cf_ret in int void
18340                 do
18341                         if test $cf_ret = void
18342                         then
18343                                 cf_return="/* nothing */"
18344                         else
18345                                 cf_return="return value"
18346                         fi
18347                         cat >conftest.$ac_ext <<_ACEOF
18348 #line 18348 "configure"
18349 #include "confdefs.h"
18350
18351 #include <${cf_cv_ncurses_header:-curses.h}>
18352 #include <$cf_cv_term_header>
18353
18354 static $cf_ret outc($cf_arg value) { $cf_return; }
18355
18356 int
18357 main (void)
18358 {
18359
18360         tputs("hello", 0, outc);
18361         ${cf_cv_main_return:-return}(0);
18362
18363   ;
18364   return 0;
18365 }
18366 _ACEOF
18367 rm -f conftest.$ac_objext
18368 if { (eval echo "$as_me:18368: \"$ac_compile\"") >&5
18369   (eval $ac_compile) 2>&5
18370   ac_status=$?
18371   echo "$as_me:18371: \$? = $ac_status" >&5
18372   (exit $ac_status); } &&
18373          { ac_try='test -s conftest.$ac_objext'
18374   { (eval echo "$as_me:18374: \"$ac_try\"") >&5
18375   (eval $ac_try) 2>&5
18376   ac_status=$?
18377   echo "$as_me:18377: \$? = $ac_status" >&5
18378   (exit $ac_status); }; }; then
18379
18380                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18381
18382 echo "${as_me:-configure}:18382: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18383
18384                 cat >>confdefs.h <<EOF
18385 #define TPUTS_ARG               $cf_arg
18386 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18387 #define TPUTS_RETURN(value)     $cf_return
18388 EOF
18389                 cf_done=yes
18390                 break
18391
18392 else
18393   echo "$as_me: failed program was:" >&5
18394 cat conftest.$ac_ext >&5
18395 fi
18396 rm -f conftest.$ac_objext conftest.$ac_ext
18397                 done
18398                 test $cf_done = yes && break
18399         done
18400 fi
18401
18402 echo "$as_me:18402: checking for ncurses extended functions" >&5
18403 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18404 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18405   echo $ECHO_N "(cached) $ECHO_C" >&6
18406 else
18407
18408 cat >conftest.$ac_ext <<_ACEOF
18409 #line 18409 "configure"
18410 #include "confdefs.h"
18411
18412 #include <${cf_cv_ncurses_header:-curses.h}>
18413 int
18414 main (void)
18415 {
18416
18417 int x = NCURSES_EXT_FUNCS
18418
18419   ;
18420   return 0;
18421 }
18422 _ACEOF
18423 rm -f conftest.$ac_objext
18424 if { (eval echo "$as_me:18424: \"$ac_compile\"") >&5
18425   (eval $ac_compile) 2>&5
18426   ac_status=$?
18427   echo "$as_me:18427: \$? = $ac_status" >&5
18428   (exit $ac_status); } &&
18429          { ac_try='test -s conftest.$ac_objext'
18430   { (eval echo "$as_me:18430: \"$ac_try\"") >&5
18431   (eval $ac_try) 2>&5
18432   ac_status=$?
18433   echo "$as_me:18433: \$? = $ac_status" >&5
18434   (exit $ac_status); }; }; then
18435   cf_cv_ncurses_ext_funcs=defined
18436 else
18437   echo "$as_me: failed program was:" >&5
18438 cat conftest.$ac_ext >&5
18439
18440 cat >conftest.$ac_ext <<_ACEOF
18441 #line 18441 "configure"
18442 #include "confdefs.h"
18443
18444 #include <${cf_cv_ncurses_header:-curses.h}>
18445 int
18446 main (void)
18447 {
18448
18449         (void) assume_default_colors (0, 0);
18450         (void) curses_version ();
18451         (void) define_key (0, 0);
18452         (void) is_term_resized (0, 0);
18453         (void) key_defined (0);
18454         (void) keybound (0, 0);
18455         (void) keyok (0, 0);
18456         (void) resize_term (0, 0);
18457         (void) resizeterm (0, 0);
18458         (void) use_default_colors ();
18459         (void) use_extended_names (0);
18460         (void) wresize (0, 0, 0);
18461   ;
18462   return 0;
18463 }
18464 _ACEOF
18465 rm -f conftest.$ac_objext conftest$ac_exeext
18466 if { (eval echo "$as_me:18466: \"$ac_link\"") >&5
18467   (eval $ac_link) 2>&5
18468   ac_status=$?
18469   echo "$as_me:18469: \$? = $ac_status" >&5
18470   (exit $ac_status); } &&
18471          { ac_try='test -s conftest$ac_exeext'
18472   { (eval echo "$as_me:18472: \"$ac_try\"") >&5
18473   (eval $ac_try) 2>&5
18474   ac_status=$?
18475   echo "$as_me:18475: \$? = $ac_status" >&5
18476   (exit $ac_status); }; }; then
18477   cf_cv_ncurses_ext_funcs=yes
18478 else
18479   echo "$as_me: failed program was:" >&5
18480 cat conftest.$ac_ext >&5
18481 cf_cv_ncurses_ext_funcs=no
18482 fi
18483 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18484
18485 fi
18486 rm -f conftest.$ac_objext conftest.$ac_ext
18487
18488 fi
18489 echo "$as_me:18489: result: $cf_cv_ncurses_ext_funcs" >&5
18490 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18491 test "$cf_cv_ncurses_ext_funcs" = yes &&
18492 cat >>confdefs.h <<\EOF
18493 #define NCURSES_EXT_FUNCS 1
18494 EOF
18495
18496 if test "$cf_enable_widec" = yes
18497 then
18498         # workaround for systems with ncurses before 20111029, due to change of
18499         # feature test macro from _XPG5 to _XOPEN_SOURCE
18500         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18501         then
18502                 cf_define_xpg5=no
18503                 echo "$as_me:18503: checking if _XPG5 should be defined to enable wide-characters" >&5
18504 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18505
18506                 cat >conftest.$ac_ext <<_ACEOF
18507 #line 18507 "configure"
18508 #include "confdefs.h"
18509
18510 #include <${cf_cv_ncurses_header:-curses.h}>
18511 int
18512 main (void)
18513 {
18514 int x = _XPG5
18515   ;
18516   return 0;
18517 }
18518 _ACEOF
18519 rm -f conftest.$ac_objext
18520 if { (eval echo "$as_me:18520: \"$ac_compile\"") >&5
18521   (eval $ac_compile) 2>&5
18522   ac_status=$?
18523   echo "$as_me:18523: \$? = $ac_status" >&5
18524   (exit $ac_status); } &&
18525          { ac_try='test -s conftest.$ac_objext'
18526   { (eval echo "$as_me:18526: \"$ac_try\"") >&5
18527   (eval $ac_try) 2>&5
18528   ac_status=$?
18529   echo "$as_me:18529: \$? = $ac_status" >&5
18530   (exit $ac_status); }; }; then
18531   :
18532 else
18533   echo "$as_me: failed program was:" >&5
18534 cat conftest.$ac_ext >&5
18535 cf_save_cppflags="$CPPFLAGS"
18536                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18537                          cat >conftest.$ac_ext <<_ACEOF
18538 #line 18538 "configure"
18539 #include "confdefs.h"
18540
18541 #include <${cf_cv_ncurses_header:-curses.h}>
18542 int
18543 main (void)
18544 {
18545 int x = _XPG5
18546   ;
18547   return 0;
18548 }
18549 _ACEOF
18550 rm -f conftest.$ac_objext
18551 if { (eval echo "$as_me:18551: \"$ac_compile\"") >&5
18552   (eval $ac_compile) 2>&5
18553   ac_status=$?
18554   echo "$as_me:18554: \$? = $ac_status" >&5
18555   (exit $ac_status); } &&
18556          { ac_try='test -s conftest.$ac_objext'
18557   { (eval echo "$as_me:18557: \"$ac_try\"") >&5
18558   (eval $ac_try) 2>&5
18559   ac_status=$?
18560   echo "$as_me:18560: \$? = $ac_status" >&5
18561   (exit $ac_status); }; }; then
18562   cf_define_xpg5=yes
18563 else
18564   echo "$as_me: failed program was:" >&5
18565 cat conftest.$ac_ext >&5
18566 fi
18567 rm -f conftest.$ac_objext conftest.$ac_ext
18568                          CPPFLAGS="$cf_save_cppflags"
18569 fi
18570 rm -f conftest.$ac_objext conftest.$ac_ext
18571                 echo "$as_me:18571: result: $cf_define_xpg5" >&5
18572 echo "${ECHO_T}$cf_define_xpg5" >&6
18573
18574                 if test "$cf_define_xpg5" = yes
18575                 then
18576                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18577                 fi
18578         fi
18579
18580         echo "$as_me:18580: checking for wide-character functions" >&5
18581 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18582 if test "${cf_cv_widechar_funcs+set}" = set; then
18583   echo $ECHO_N "(cached) $ECHO_C" >&6
18584 else
18585
18586         cat >conftest.$ac_ext <<_ACEOF
18587 #line 18587 "configure"
18588 #include "confdefs.h"
18589
18590 #include <${cf_cv_ncurses_header:-curses.h}>
18591 int
18592 main (void)
18593 {
18594
18595                 static wchar_t src_wchar[2];
18596                 static cchar_t dst_cchar;
18597                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18598
18599   ;
18600   return 0;
18601 }
18602 _ACEOF
18603 rm -f conftest.$ac_objext conftest$ac_exeext
18604 if { (eval echo "$as_me:18604: \"$ac_link\"") >&5
18605   (eval $ac_link) 2>&5
18606   ac_status=$?
18607   echo "$as_me:18607: \$? = $ac_status" >&5
18608   (exit $ac_status); } &&
18609          { ac_try='test -s conftest$ac_exeext'
18610   { (eval echo "$as_me:18610: \"$ac_try\"") >&5
18611   (eval $ac_try) 2>&5
18612   ac_status=$?
18613   echo "$as_me:18613: \$? = $ac_status" >&5
18614   (exit $ac_status); }; }; then
18615   cf_cv_widechar_funcs=yes
18616 else
18617   echo "$as_me: failed program was:" >&5
18618 cat conftest.$ac_ext >&5
18619 cf_cv_widechar_funcs=no
18620 fi
18621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18622
18623 fi
18624 echo "$as_me:18624: result: $cf_cv_widechar_funcs" >&5
18625 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18626         if test "$cf_cv_widechar_funcs" != no ; then
18627
18628 cat >>confdefs.h <<\EOF
18629 #define USE_WIDEC_SUPPORT 1
18630 EOF
18631
18632         else
18633                 cat >>confdefs.h <<\EOF
18634 #define USE_WIDEC_SUPPORT 0
18635 EOF
18636
18637         fi
18638 else
18639         cat >>confdefs.h <<\EOF
18640 #define USE_WIDEC_SUPPORT 0
18641 EOF
18642
18643 fi
18644
18645 echo "$as_me:18645: checking if $cf_cv_screen library uses pthreads" >&5
18646 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18647 if test "${cf_cv_use_pthreads+set}" = set; then
18648   echo $ECHO_N "(cached) $ECHO_C" >&6
18649 else
18650
18651 cat >conftest.$ac_ext <<_ACEOF
18652 #line 18652 "configure"
18653 #include "confdefs.h"
18654
18655 #include <${cf_cv_ncurses_header:-curses.h}>
18656 extern void _nc_init_pthreads(void);
18657
18658 int
18659 main (void)
18660 {
18661
18662         initscr();
18663         _nc_init_pthreads();
18664
18665   ;
18666   return 0;
18667 }
18668 _ACEOF
18669 rm -f conftest.$ac_objext conftest$ac_exeext
18670 if { (eval echo "$as_me:18670: \"$ac_link\"") >&5
18671   (eval $ac_link) 2>&5
18672   ac_status=$?
18673   echo "$as_me:18673: \$? = $ac_status" >&5
18674   (exit $ac_status); } &&
18675          { ac_try='test -s conftest$ac_exeext'
18676   { (eval echo "$as_me:18676: \"$ac_try\"") >&5
18677   (eval $ac_try) 2>&5
18678   ac_status=$?
18679   echo "$as_me:18679: \$? = $ac_status" >&5
18680   (exit $ac_status); }; }; then
18681   cf_cv_use_pthreads=yes
18682 else
18683   echo "$as_me: failed program was:" >&5
18684 cat conftest.$ac_ext >&5
18685 cf_cv_use_pthreads=no
18686 fi
18687 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18688
18689 fi
18690 echo "$as_me:18690: result: $cf_cv_use_pthreads" >&5
18691 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18692 test $cf_cv_use_pthreads = yes &&
18693 cat >>confdefs.h <<\EOF
18694 #define USE_PTHREADS 1
18695 EOF
18696
18697 echo "$as_me:18697: checking if sys/time.h works with sys/select.h" >&5
18698 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18699 if test "${cf_cv_sys_time_select+set}" = set; then
18700   echo $ECHO_N "(cached) $ECHO_C" >&6
18701 else
18702
18703 cat >conftest.$ac_ext <<_ACEOF
18704 #line 18704 "configure"
18705 #include "confdefs.h"
18706
18707 #include <sys/types.h>
18708 #ifdef HAVE_SYS_TIME_H
18709 #include <sys/time.h>
18710 #endif
18711 #ifdef HAVE_SYS_SELECT_H
18712 #include <sys/select.h>
18713 #endif
18714
18715 int
18716 main (void)
18717 {
18718
18719   ;
18720   return 0;
18721 }
18722 _ACEOF
18723 rm -f conftest.$ac_objext
18724 if { (eval echo "$as_me:18724: \"$ac_compile\"") >&5
18725   (eval $ac_compile) 2>&5
18726   ac_status=$?
18727   echo "$as_me:18727: \$? = $ac_status" >&5
18728   (exit $ac_status); } &&
18729          { ac_try='test -s conftest.$ac_objext'
18730   { (eval echo "$as_me:18730: \"$ac_try\"") >&5
18731   (eval $ac_try) 2>&5
18732   ac_status=$?
18733   echo "$as_me:18733: \$? = $ac_status" >&5
18734   (exit $ac_status); }; }; then
18735   cf_cv_sys_time_select=yes
18736 else
18737   echo "$as_me: failed program was:" >&5
18738 cat conftest.$ac_ext >&5
18739 cf_cv_sys_time_select=no
18740 fi
18741 rm -f conftest.$ac_objext conftest.$ac_ext
18742
18743 fi
18744
18745 echo "$as_me:18745: result: $cf_cv_sys_time_select" >&5
18746 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18747 test "$cf_cv_sys_time_select" = yes &&
18748 cat >>confdefs.h <<\EOF
18749 #define HAVE_SYS_TIME_SELECT 1
18750 EOF
18751
18752 # special check for test/ditto.c
18753
18754 echo "$as_me:18754: checking for openpty in -lutil" >&5
18755 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18756 if test "${ac_cv_lib_util_openpty+set}" = set; then
18757   echo $ECHO_N "(cached) $ECHO_C" >&6
18758 else
18759   ac_check_lib_save_LIBS=$LIBS
18760 LIBS="-lutil  $LIBS"
18761 cat >conftest.$ac_ext <<_ACEOF
18762 #line 18762 "configure"
18763 #include "confdefs.h"
18764
18765 /* Override any gcc2 internal prototype to avoid an error.  */
18766 #ifdef __cplusplus
18767 extern "C"
18768 #endif
18769 /* We use char because int might match the return type of a gcc2
18770    builtin and then its argument prototype would still apply.  */
18771 char openpty ();
18772 int
18773 main (void)
18774 {
18775 openpty ();
18776   ;
18777   return 0;
18778 }
18779 _ACEOF
18780 rm -f conftest.$ac_objext conftest$ac_exeext
18781 if { (eval echo "$as_me:18781: \"$ac_link\"") >&5
18782   (eval $ac_link) 2>&5
18783   ac_status=$?
18784   echo "$as_me:18784: \$? = $ac_status" >&5
18785   (exit $ac_status); } &&
18786          { ac_try='test -s conftest$ac_exeext'
18787   { (eval echo "$as_me:18787: \"$ac_try\"") >&5
18788   (eval $ac_try) 2>&5
18789   ac_status=$?
18790   echo "$as_me:18790: \$? = $ac_status" >&5
18791   (exit $ac_status); }; }; then
18792   ac_cv_lib_util_openpty=yes
18793 else
18794   echo "$as_me: failed program was:" >&5
18795 cat conftest.$ac_ext >&5
18796 ac_cv_lib_util_openpty=no
18797 fi
18798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18799 LIBS=$ac_check_lib_save_LIBS
18800 fi
18801 echo "$as_me:18801: result: $ac_cv_lib_util_openpty" >&5
18802 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18803 if test $ac_cv_lib_util_openpty = yes; then
18804   cf_cv_lib_util=yes
18805 else
18806   cf_cv_lib_util=no
18807 fi
18808
18809 echo "$as_me:18809: checking for openpty header" >&5
18810 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18811 if test "${cf_cv_func_openpty+set}" = set; then
18812   echo $ECHO_N "(cached) $ECHO_C" >&6
18813 else
18814
18815         cf_save_LIBS="$LIBS"
18816         test $cf_cv_lib_util = yes && {
18817 cf_add_libs="$LIBS"
18818 # reverse order
18819 cf_add_0lib=
18820 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18821 # filter duplicates
18822 for cf_add_1lib in $cf_add_0lib; do
18823         for cf_add_2lib in $cf_add_libs; do
18824                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18825                         cf_add_1lib=
18826                         break
18827                 fi
18828         done
18829         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18830 done
18831 LIBS="$cf_add_libs"
18832  }
18833         for cf_header in pty.h libutil.h util.h
18834         do
18835         cat >conftest.$ac_ext <<_ACEOF
18836 #line 18836 "configure"
18837 #include "confdefs.h"
18838
18839 #include <$cf_header>
18840
18841 int
18842 main (void)
18843 {
18844
18845         int x = openpty((int *)0, (int *)0, (char *)0,
18846                                    (struct termios *)0, (struct winsize *)0);
18847
18848   ;
18849   return 0;
18850 }
18851 _ACEOF
18852 rm -f conftest.$ac_objext conftest$ac_exeext
18853 if { (eval echo "$as_me:18853: \"$ac_link\"") >&5
18854   (eval $ac_link) 2>&5
18855   ac_status=$?
18856   echo "$as_me:18856: \$? = $ac_status" >&5
18857   (exit $ac_status); } &&
18858          { ac_try='test -s conftest$ac_exeext'
18859   { (eval echo "$as_me:18859: \"$ac_try\"") >&5
18860   (eval $ac_try) 2>&5
18861   ac_status=$?
18862   echo "$as_me:18862: \$? = $ac_status" >&5
18863   (exit $ac_status); }; }; then
18864
18865                 cf_cv_func_openpty=$cf_header
18866                 break
18867
18868 else
18869   echo "$as_me: failed program was:" >&5
18870 cat conftest.$ac_ext >&5
18871
18872                 cf_cv_func_openpty=no
18873
18874 fi
18875 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18876         done
18877         LIBS="$cf_save_LIBS"
18878
18879 fi
18880 echo "$as_me:18880: result: $cf_cv_func_openpty" >&5
18881 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18882
18883 if test "$cf_cv_func_openpty" != no ; then
18884
18885 cat >>confdefs.h <<EOF
18886 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18887 EOF
18888
18889 cat >>confdefs.h <<\EOF
18890 #define USE_XTERM_PTY 1
18891 EOF
18892
18893         if test "x$cf_cv_lib_util" = xyes ; then
18894
18895 cf_add_libs="$TEST_LIBS"
18896 # reverse order
18897 cf_add_0lib=
18898 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18899 # filter duplicates
18900 for cf_add_1lib in $cf_add_0lib; do
18901         for cf_add_2lib in $cf_add_libs; do
18902                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18903                         cf_add_1lib=
18904                         break
18905                 fi
18906         done
18907         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18908 done
18909 TEST_LIBS="$cf_add_libs"
18910
18911         fi
18912 fi
18913
18914 echo "$as_me:18914: checking for function curses_version" >&5
18915 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
18916 if test "${cf_cv_func_curses_version+set}" = set; then
18917   echo $ECHO_N "(cached) $ECHO_C" >&6
18918 else
18919
18920 if test "$cross_compiling" = yes; then
18921   cf_cv_func_curses_version=unknown
18922 else
18923   cat >conftest.$ac_ext <<_ACEOF
18924 #line 18924 "configure"
18925 #include "confdefs.h"
18926
18927 #include <${cf_cv_ncurses_header:-curses.h}>
18928 int main(void)
18929 {
18930         char temp[1024];
18931         sprintf(temp, "%s\n", curses_version());
18932         ${cf_cv_main_return:-return}(0);
18933 }
18934
18935 _ACEOF
18936 rm -f conftest$ac_exeext
18937 if { (eval echo "$as_me:18937: \"$ac_link\"") >&5
18938   (eval $ac_link) 2>&5
18939   ac_status=$?
18940   echo "$as_me:18940: \$? = $ac_status" >&5
18941   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18942   { (eval echo "$as_me:18942: \"$ac_try\"") >&5
18943   (eval $ac_try) 2>&5
18944   ac_status=$?
18945   echo "$as_me:18945: \$? = $ac_status" >&5
18946   (exit $ac_status); }; }; then
18947   cf_cv_func_curses_version=yes
18948
18949 else
18950   echo "$as_me: program exited with status $ac_status" >&5
18951 echo "$as_me: failed program was:" >&5
18952 cat conftest.$ac_ext >&5
18953 cf_cv_func_curses_version=no
18954
18955 fi
18956 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18957 fi
18958 rm -f core
18959 fi
18960 echo "$as_me:18960: result: $cf_cv_func_curses_version" >&5
18961 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
18962 test "$cf_cv_func_curses_version" = yes &&
18963 cat >>confdefs.h <<\EOF
18964 #define HAVE_CURSES_VERSION 1
18965 EOF
18966
18967 echo "$as_me:18967: checking for alternate character set array" >&5
18968 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
18969 if test "${cf_cv_curses_acs_map+set}" = set; then
18970   echo $ECHO_N "(cached) $ECHO_C" >&6
18971 else
18972
18973 cf_cv_curses_acs_map=unknown
18974 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
18975 do
18976 cat >conftest.$ac_ext <<_ACEOF
18977 #line 18977 "configure"
18978 #include "confdefs.h"
18979
18980 #include <${cf_cv_ncurses_header:-curses.h}>
18981
18982 int
18983 main (void)
18984 {
18985
18986 $name['k'] = ACS_PLUS
18987
18988   ;
18989   return 0;
18990 }
18991 _ACEOF
18992 rm -f conftest.$ac_objext conftest$ac_exeext
18993 if { (eval echo "$as_me:18993: \"$ac_link\"") >&5
18994   (eval $ac_link) 2>&5
18995   ac_status=$?
18996   echo "$as_me:18996: \$? = $ac_status" >&5
18997   (exit $ac_status); } &&
18998          { ac_try='test -s conftest$ac_exeext'
18999   { (eval echo "$as_me:18999: \"$ac_try\"") >&5
19000   (eval $ac_try) 2>&5
19001   ac_status=$?
19002   echo "$as_me:19002: \$? = $ac_status" >&5
19003   (exit $ac_status); }; }; then
19004   cf_cv_curses_acs_map=$name; break
19005 else
19006   echo "$as_me: failed program was:" >&5
19007 cat conftest.$ac_ext >&5
19008 fi
19009 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19010 done
19011
19012 fi
19013 echo "$as_me:19013: result: $cf_cv_curses_acs_map" >&5
19014 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19015
19016 test "$cf_cv_curses_acs_map" != unknown &&
19017 cat >>confdefs.h <<EOF
19018 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19019 EOF
19020
19021 if test "$cf_enable_widec" = yes; then
19022
19023 echo "$as_me:19023: checking for wide alternate character set array" >&5
19024 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19025 if test "${cf_cv_curses_wacs_map+set}" = set; then
19026   echo $ECHO_N "(cached) $ECHO_C" >&6
19027 else
19028
19029         cf_cv_curses_wacs_map=unknown
19030         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19031         do
19032         cat >conftest.$ac_ext <<_ACEOF
19033 #line 19033 "configure"
19034 #include "confdefs.h"
19035
19036 #ifndef _XOPEN_SOURCE_EXTENDED
19037 #define _XOPEN_SOURCE_EXTENDED
19038 #endif
19039 #include <${cf_cv_ncurses_header:-curses.h}>
19040 int
19041 main (void)
19042 {
19043 void *foo = &($name['k'])
19044   ;
19045   return 0;
19046 }
19047 _ACEOF
19048 rm -f conftest.$ac_objext conftest$ac_exeext
19049 if { (eval echo "$as_me:19049: \"$ac_link\"") >&5
19050   (eval $ac_link) 2>&5
19051   ac_status=$?
19052   echo "$as_me:19052: \$? = $ac_status" >&5
19053   (exit $ac_status); } &&
19054          { ac_try='test -s conftest$ac_exeext'
19055   { (eval echo "$as_me:19055: \"$ac_try\"") >&5
19056   (eval $ac_try) 2>&5
19057   ac_status=$?
19058   echo "$as_me:19058: \$? = $ac_status" >&5
19059   (exit $ac_status); }; }; then
19060   cf_cv_curses_wacs_map=$name
19061          break
19062 else
19063   echo "$as_me: failed program was:" >&5
19064 cat conftest.$ac_ext >&5
19065 fi
19066 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19067         done
19068 fi
19069 echo "$as_me:19069: result: $cf_cv_curses_wacs_map" >&5
19070 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19071
19072 test "$cf_cv_curses_wacs_map" != unknown &&
19073 cat >>confdefs.h <<EOF
19074 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19075 EOF
19076
19077 echo "$as_me:19077: checking for wide alternate character constants" >&5
19078 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19079 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19080   echo $ECHO_N "(cached) $ECHO_C" >&6
19081 else
19082
19083 cf_cv_curses_wacs_symbols=no
19084 if test "$cf_cv_curses_wacs_map" != unknown
19085 then
19086         cat >conftest.$ac_ext <<_ACEOF
19087 #line 19087 "configure"
19088 #include "confdefs.h"
19089
19090 #ifndef _XOPEN_SOURCE_EXTENDED
19091 #define _XOPEN_SOURCE_EXTENDED
19092 #endif
19093 #include <${cf_cv_ncurses_header:-curses.h}>
19094 int
19095 main (void)
19096 {
19097 cchar_t *foo = WACS_PLUS;
19098          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
19099   ;
19100   return 0;
19101 }
19102 _ACEOF
19103 rm -f conftest.$ac_objext conftest$ac_exeext
19104 if { (eval echo "$as_me:19104: \"$ac_link\"") >&5
19105   (eval $ac_link) 2>&5
19106   ac_status=$?
19107   echo "$as_me:19107: \$? = $ac_status" >&5
19108   (exit $ac_status); } &&
19109          { ac_try='test -s conftest$ac_exeext'
19110   { (eval echo "$as_me:19110: \"$ac_try\"") >&5
19111   (eval $ac_try) 2>&5
19112   ac_status=$?
19113   echo "$as_me:19113: \$? = $ac_status" >&5
19114   (exit $ac_status); }; }; then
19115   cf_cv_curses_wacs_symbols=yes
19116 else
19117   echo "$as_me: failed program was:" >&5
19118 cat conftest.$ac_ext >&5
19119 fi
19120 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19121 else
19122         cat >conftest.$ac_ext <<_ACEOF
19123 #line 19123 "configure"
19124 #include "confdefs.h"
19125
19126 #ifndef _XOPEN_SOURCE_EXTENDED
19127 #define _XOPEN_SOURCE_EXTENDED
19128 #endif
19129 #include <${cf_cv_ncurses_header:-curses.h}>
19130 int
19131 main (void)
19132 {
19133 cchar_t *foo = WACS_PLUS
19134   ;
19135   return 0;
19136 }
19137 _ACEOF
19138 rm -f conftest.$ac_objext conftest$ac_exeext
19139 if { (eval echo "$as_me:19139: \"$ac_link\"") >&5
19140   (eval $ac_link) 2>&5
19141   ac_status=$?
19142   echo "$as_me:19142: \$? = $ac_status" >&5
19143   (exit $ac_status); } &&
19144          { ac_try='test -s conftest$ac_exeext'
19145   { (eval echo "$as_me:19145: \"$ac_try\"") >&5
19146   (eval $ac_try) 2>&5
19147   ac_status=$?
19148   echo "$as_me:19148: \$? = $ac_status" >&5
19149   (exit $ac_status); }; }; then
19150   cf_cv_curses_wacs_symbols=yes
19151 else
19152   echo "$as_me: failed program was:" >&5
19153 cat conftest.$ac_ext >&5
19154 fi
19155 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19156 fi
19157
19158 fi
19159 echo "$as_me:19159: result: $cf_cv_curses_wacs_symbols" >&5
19160 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19161
19162 test "$cf_cv_curses_wacs_symbols" != no &&
19163 cat >>confdefs.h <<\EOF
19164 #define CURSES_WACS_SYMBOLS 1
19165 EOF
19166
19167 fi
19168
19169 echo "$as_me:19169: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19170 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19171 cat >conftest.$ac_ext <<_ACEOF
19172 #line 19172 "configure"
19173 #include "confdefs.h"
19174
19175 #ifndef _XOPEN_SOURCE_EXTENDED
19176 #define _XOPEN_SOURCE_EXTENDED
19177 #endif
19178 #include <${cf_cv_ncurses_header:-curses.h}>
19179 int
19180 main (void)
19181 {
19182
19183 attr_t foo
19184
19185   ;
19186   return 0;
19187 }
19188 _ACEOF
19189 rm -f conftest.$ac_objext
19190 if { (eval echo "$as_me:19190: \"$ac_compile\"") >&5
19191   (eval $ac_compile) 2>&5
19192   ac_status=$?
19193   echo "$as_me:19193: \$? = $ac_status" >&5
19194   (exit $ac_status); } &&
19195          { ac_try='test -s conftest.$ac_objext'
19196   { (eval echo "$as_me:19196: \"$ac_try\"") >&5
19197   (eval $ac_try) 2>&5
19198   ac_status=$?
19199   echo "$as_me:19199: \$? = $ac_status" >&5
19200   (exit $ac_status); }; }; then
19201   cf_result=yes
19202 else
19203   echo "$as_me: failed program was:" >&5
19204 cat conftest.$ac_ext >&5
19205 cf_result=no
19206 fi
19207 rm -f conftest.$ac_objext conftest.$ac_ext
19208 echo "$as_me:19208: result: $cf_result" >&5
19209 echo "${ECHO_T}$cf_result" >&6
19210 if test $cf_result = yes ; then
19211
19212 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19213
19214 cat >>confdefs.h <<EOF
19215 #define $cf_result 1
19216 EOF
19217
19218 else
19219
19220 cat >>confdefs.h <<EOF
19221 #define attr_t long
19222 EOF
19223
19224 fi
19225
19226 if test "$cf_enable_widec" = yes; then
19227
19228 # This is needed on Tru64 5.0 to declare mbstate_t
19229 echo "$as_me:19229: checking if we must include wchar.h to declare mbstate_t" >&5
19230 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19231 if test "${cf_cv_mbstate_t+set}" = set; then
19232   echo $ECHO_N "(cached) $ECHO_C" >&6
19233 else
19234
19235 cat >conftest.$ac_ext <<_ACEOF
19236 #line 19236 "configure"
19237 #include "confdefs.h"
19238
19239 #include <stdlib.h>
19240 #include <stdarg.h>
19241 #include <stdio.h>
19242 #ifdef HAVE_LIBUTF8_H
19243 #include <libutf8.h>
19244 #endif
19245 int
19246 main (void)
19247 {
19248 mbstate_t state
19249   ;
19250   return 0;
19251 }
19252 _ACEOF
19253 rm -f conftest.$ac_objext
19254 if { (eval echo "$as_me:19254: \"$ac_compile\"") >&5
19255   (eval $ac_compile) 2>&5
19256   ac_status=$?
19257   echo "$as_me:19257: \$? = $ac_status" >&5
19258   (exit $ac_status); } &&
19259          { ac_try='test -s conftest.$ac_objext'
19260   { (eval echo "$as_me:19260: \"$ac_try\"") >&5
19261   (eval $ac_try) 2>&5
19262   ac_status=$?
19263   echo "$as_me:19263: \$? = $ac_status" >&5
19264   (exit $ac_status); }; }; then
19265   cf_cv_mbstate_t=no
19266 else
19267   echo "$as_me: failed program was:" >&5
19268 cat conftest.$ac_ext >&5
19269 cat >conftest.$ac_ext <<_ACEOF
19270 #line 19270 "configure"
19271 #include "confdefs.h"
19272
19273 #include <stdlib.h>
19274 #include <stdarg.h>
19275 #include <stdio.h>
19276 #include <wchar.h>
19277 #ifdef HAVE_LIBUTF8_H
19278 #include <libutf8.h>
19279 #endif
19280 int
19281 main (void)
19282 {
19283 mbstate_t value
19284   ;
19285   return 0;
19286 }
19287 _ACEOF
19288 rm -f conftest.$ac_objext
19289 if { (eval echo "$as_me:19289: \"$ac_compile\"") >&5
19290   (eval $ac_compile) 2>&5
19291   ac_status=$?
19292   echo "$as_me:19292: \$? = $ac_status" >&5
19293   (exit $ac_status); } &&
19294          { ac_try='test -s conftest.$ac_objext'
19295   { (eval echo "$as_me:19295: \"$ac_try\"") >&5
19296   (eval $ac_try) 2>&5
19297   ac_status=$?
19298   echo "$as_me:19298: \$? = $ac_status" >&5
19299   (exit $ac_status); }; }; then
19300   cf_cv_mbstate_t=yes
19301 else
19302   echo "$as_me: failed program was:" >&5
19303 cat conftest.$ac_ext >&5
19304 cf_cv_mbstate_t=unknown
19305 fi
19306 rm -f conftest.$ac_objext conftest.$ac_ext
19307 fi
19308 rm -f conftest.$ac_objext conftest.$ac_ext
19309 fi
19310 echo "$as_me:19310: result: $cf_cv_mbstate_t" >&5
19311 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19312
19313 if test "$cf_cv_mbstate_t" = yes ; then
19314
19315 cat >>confdefs.h <<\EOF
19316 #define NEED_WCHAR_H 1
19317 EOF
19318
19319         NEED_WCHAR_H=1
19320 fi
19321
19322 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19323 if test "$cf_cv_mbstate_t" = unknown ; then
19324         NCURSES_MBSTATE_T=1
19325 fi
19326
19327 # if we find mbstate_t in either place, use substitution to provide a fallback.
19328 if test "$cf_cv_mbstate_t" != unknown ; then
19329         NCURSES_OK_MBSTATE_T=1
19330 fi
19331
19332 # This is needed on Tru64 5.0 to declare wchar_t
19333 echo "$as_me:19333: checking if we must include wchar.h to declare wchar_t" >&5
19334 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19335 if test "${cf_cv_wchar_t+set}" = set; then
19336   echo $ECHO_N "(cached) $ECHO_C" >&6
19337 else
19338
19339 cat >conftest.$ac_ext <<_ACEOF
19340 #line 19340 "configure"
19341 #include "confdefs.h"
19342
19343 #include <stdlib.h>
19344 #include <stdarg.h>
19345 #include <stdio.h>
19346 #ifdef HAVE_LIBUTF8_H
19347 #include <libutf8.h>
19348 #endif
19349 int
19350 main (void)
19351 {
19352 wchar_t state
19353   ;
19354   return 0;
19355 }
19356 _ACEOF
19357 rm -f conftest.$ac_objext
19358 if { (eval echo "$as_me:19358: \"$ac_compile\"") >&5
19359   (eval $ac_compile) 2>&5
19360   ac_status=$?
19361   echo "$as_me:19361: \$? = $ac_status" >&5
19362   (exit $ac_status); } &&
19363          { ac_try='test -s conftest.$ac_objext'
19364   { (eval echo "$as_me:19364: \"$ac_try\"") >&5
19365   (eval $ac_try) 2>&5
19366   ac_status=$?
19367   echo "$as_me:19367: \$? = $ac_status" >&5
19368   (exit $ac_status); }; }; then
19369   cf_cv_wchar_t=no
19370 else
19371   echo "$as_me: failed program was:" >&5
19372 cat conftest.$ac_ext >&5
19373 cat >conftest.$ac_ext <<_ACEOF
19374 #line 19374 "configure"
19375 #include "confdefs.h"
19376
19377 #include <stdlib.h>
19378 #include <stdarg.h>
19379 #include <stdio.h>
19380 #include <wchar.h>
19381 #ifdef HAVE_LIBUTF8_H
19382 #include <libutf8.h>
19383 #endif
19384 int
19385 main (void)
19386 {
19387 wchar_t value
19388   ;
19389   return 0;
19390 }
19391 _ACEOF
19392 rm -f conftest.$ac_objext
19393 if { (eval echo "$as_me:19393: \"$ac_compile\"") >&5
19394   (eval $ac_compile) 2>&5
19395   ac_status=$?
19396   echo "$as_me:19396: \$? = $ac_status" >&5
19397   (exit $ac_status); } &&
19398          { ac_try='test -s conftest.$ac_objext'
19399   { (eval echo "$as_me:19399: \"$ac_try\"") >&5
19400   (eval $ac_try) 2>&5
19401   ac_status=$?
19402   echo "$as_me:19402: \$? = $ac_status" >&5
19403   (exit $ac_status); }; }; then
19404   cf_cv_wchar_t=yes
19405 else
19406   echo "$as_me: failed program was:" >&5
19407 cat conftest.$ac_ext >&5
19408 cf_cv_wchar_t=unknown
19409 fi
19410 rm -f conftest.$ac_objext conftest.$ac_ext
19411 fi
19412 rm -f conftest.$ac_objext conftest.$ac_ext
19413 fi
19414 echo "$as_me:19414: result: $cf_cv_wchar_t" >&5
19415 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19416
19417 if test "$cf_cv_wchar_t" = yes ; then
19418
19419 cat >>confdefs.h <<\EOF
19420 #define NEED_WCHAR_H 1
19421 EOF
19422
19423         NEED_WCHAR_H=1
19424 fi
19425
19426 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19427 if test "$cf_cv_wchar_t" = unknown ; then
19428         NCURSES_WCHAR_T=1
19429 fi
19430
19431 # if we find wchar_t in either place, use substitution to provide a fallback.
19432 if test "$cf_cv_wchar_t" != unknown ; then
19433         NCURSES_OK_WCHAR_T=1
19434 fi
19435
19436 # This is needed on Tru64 5.0 to declare wint_t
19437 echo "$as_me:19437: checking if we must include wchar.h to declare wint_t" >&5
19438 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19439 if test "${cf_cv_wint_t+set}" = set; then
19440   echo $ECHO_N "(cached) $ECHO_C" >&6
19441 else
19442
19443 cat >conftest.$ac_ext <<_ACEOF
19444 #line 19444 "configure"
19445 #include "confdefs.h"
19446
19447 #include <stdlib.h>
19448 #include <stdarg.h>
19449 #include <stdio.h>
19450 #ifdef HAVE_LIBUTF8_H
19451 #include <libutf8.h>
19452 #endif
19453 int
19454 main (void)
19455 {
19456 wint_t state
19457   ;
19458   return 0;
19459 }
19460 _ACEOF
19461 rm -f conftest.$ac_objext
19462 if { (eval echo "$as_me:19462: \"$ac_compile\"") >&5
19463   (eval $ac_compile) 2>&5
19464   ac_status=$?
19465   echo "$as_me:19465: \$? = $ac_status" >&5
19466   (exit $ac_status); } &&
19467          { ac_try='test -s conftest.$ac_objext'
19468   { (eval echo "$as_me:19468: \"$ac_try\"") >&5
19469   (eval $ac_try) 2>&5
19470   ac_status=$?
19471   echo "$as_me:19471: \$? = $ac_status" >&5
19472   (exit $ac_status); }; }; then
19473   cf_cv_wint_t=no
19474 else
19475   echo "$as_me: failed program was:" >&5
19476 cat conftest.$ac_ext >&5
19477 cat >conftest.$ac_ext <<_ACEOF
19478 #line 19478 "configure"
19479 #include "confdefs.h"
19480
19481 #include <stdlib.h>
19482 #include <stdarg.h>
19483 #include <stdio.h>
19484 #include <wchar.h>
19485 #ifdef HAVE_LIBUTF8_H
19486 #include <libutf8.h>
19487 #endif
19488 int
19489 main (void)
19490 {
19491 wint_t value
19492   ;
19493   return 0;
19494 }
19495 _ACEOF
19496 rm -f conftest.$ac_objext
19497 if { (eval echo "$as_me:19497: \"$ac_compile\"") >&5
19498   (eval $ac_compile) 2>&5
19499   ac_status=$?
19500   echo "$as_me:19500: \$? = $ac_status" >&5
19501   (exit $ac_status); } &&
19502          { ac_try='test -s conftest.$ac_objext'
19503   { (eval echo "$as_me:19503: \"$ac_try\"") >&5
19504   (eval $ac_try) 2>&5
19505   ac_status=$?
19506   echo "$as_me:19506: \$? = $ac_status" >&5
19507   (exit $ac_status); }; }; then
19508   cf_cv_wint_t=yes
19509 else
19510   echo "$as_me: failed program was:" >&5
19511 cat conftest.$ac_ext >&5
19512 cf_cv_wint_t=unknown
19513 fi
19514 rm -f conftest.$ac_objext conftest.$ac_ext
19515 fi
19516 rm -f conftest.$ac_objext conftest.$ac_ext
19517 fi
19518 echo "$as_me:19518: result: $cf_cv_wint_t" >&5
19519 echo "${ECHO_T}$cf_cv_wint_t" >&6
19520
19521 if test "$cf_cv_wint_t" = yes ; then
19522
19523 cat >>confdefs.h <<\EOF
19524 #define NEED_WCHAR_H 1
19525 EOF
19526
19527         NEED_WCHAR_H=1
19528 fi
19529
19530 # if we do not find wint_t in either place, use substitution to provide a fallback.
19531 if test "$cf_cv_wint_t" = unknown ; then
19532         NCURSES_WINT_T=1
19533 fi
19534
19535 # if we find wint_t in either place, use substitution to provide a fallback.
19536 if test "$cf_cv_wint_t" != unknown ; then
19537         NCURSES_OK_WINT_T=1
19538 fi
19539
19540         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19541
19542 echo "$as_me:19542: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19543 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19544 cat >conftest.$ac_ext <<_ACEOF
19545 #line 19545 "configure"
19546 #include "confdefs.h"
19547
19548 #ifndef _XOPEN_SOURCE_EXTENDED
19549 #define _XOPEN_SOURCE_EXTENDED
19550 #endif
19551 #include <${cf_cv_ncurses_header:-curses.h}>
19552 int
19553 main (void)
19554 {
19555
19556 mbstate_t foo
19557
19558   ;
19559   return 0;
19560 }
19561 _ACEOF
19562 rm -f conftest.$ac_objext
19563 if { (eval echo "$as_me:19563: \"$ac_compile\"") >&5
19564   (eval $ac_compile) 2>&5
19565   ac_status=$?
19566   echo "$as_me:19566: \$? = $ac_status" >&5
19567   (exit $ac_status); } &&
19568          { ac_try='test -s conftest.$ac_objext'
19569   { (eval echo "$as_me:19569: \"$ac_try\"") >&5
19570   (eval $ac_try) 2>&5
19571   ac_status=$?
19572   echo "$as_me:19572: \$? = $ac_status" >&5
19573   (exit $ac_status); }; }; then
19574   cf_result=yes
19575 else
19576   echo "$as_me: failed program was:" >&5
19577 cat conftest.$ac_ext >&5
19578 cf_result=no
19579 fi
19580 rm -f conftest.$ac_objext conftest.$ac_ext
19581 echo "$as_me:19581: result: $cf_result" >&5
19582 echo "${ECHO_T}$cf_result" >&6
19583 if test $cf_result = yes ; then
19584
19585 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19586
19587 cat >>confdefs.h <<EOF
19588 #define $cf_result 1
19589 EOF
19590
19591 else
19592
19593 cat >>confdefs.h <<EOF
19594 #define mbstate_t long
19595 EOF
19596
19597 fi
19598
19599         fi
19600
19601         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19602
19603 echo "$as_me:19603: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19604 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19605 cat >conftest.$ac_ext <<_ACEOF
19606 #line 19606 "configure"
19607 #include "confdefs.h"
19608
19609 #ifndef _XOPEN_SOURCE_EXTENDED
19610 #define _XOPEN_SOURCE_EXTENDED
19611 #endif
19612 #include <${cf_cv_ncurses_header:-curses.h}>
19613 int
19614 main (void)
19615 {
19616
19617 wchar_t foo
19618
19619   ;
19620   return 0;
19621 }
19622 _ACEOF
19623 rm -f conftest.$ac_objext
19624 if { (eval echo "$as_me:19624: \"$ac_compile\"") >&5
19625   (eval $ac_compile) 2>&5
19626   ac_status=$?
19627   echo "$as_me:19627: \$? = $ac_status" >&5
19628   (exit $ac_status); } &&
19629          { ac_try='test -s conftest.$ac_objext'
19630   { (eval echo "$as_me:19630: \"$ac_try\"") >&5
19631   (eval $ac_try) 2>&5
19632   ac_status=$?
19633   echo "$as_me:19633: \$? = $ac_status" >&5
19634   (exit $ac_status); }; }; then
19635   cf_result=yes
19636 else
19637   echo "$as_me: failed program was:" >&5
19638 cat conftest.$ac_ext >&5
19639 cf_result=no
19640 fi
19641 rm -f conftest.$ac_objext conftest.$ac_ext
19642 echo "$as_me:19642: result: $cf_result" >&5
19643 echo "${ECHO_T}$cf_result" >&6
19644 if test $cf_result = yes ; then
19645
19646 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19647
19648 cat >>confdefs.h <<EOF
19649 #define $cf_result 1
19650 EOF
19651
19652 else
19653
19654 cat >>confdefs.h <<EOF
19655 #define wchar_t long
19656 EOF
19657
19658 fi
19659
19660         fi
19661
19662         if test "$NCURSES_OK_WINT_T" = 0 ; then
19663
19664 echo "$as_me:19664: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19665 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19666 cat >conftest.$ac_ext <<_ACEOF
19667 #line 19667 "configure"
19668 #include "confdefs.h"
19669
19670 #ifndef _XOPEN_SOURCE_EXTENDED
19671 #define _XOPEN_SOURCE_EXTENDED
19672 #endif
19673 #include <${cf_cv_ncurses_header:-curses.h}>
19674 int
19675 main (void)
19676 {
19677
19678 wint_t foo
19679
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   cf_result=yes
19697 else
19698   echo "$as_me: failed program was:" >&5
19699 cat conftest.$ac_ext >&5
19700 cf_result=no
19701 fi
19702 rm -f conftest.$ac_objext conftest.$ac_ext
19703 echo "$as_me:19703: result: $cf_result" >&5
19704 echo "${ECHO_T}$cf_result" >&6
19705 if test $cf_result = yes ; then
19706
19707 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19708
19709 cat >>confdefs.h <<EOF
19710 #define $cf_result 1
19711 EOF
19712
19713 else
19714
19715 cat >>confdefs.h <<EOF
19716 #define wint_t long
19717 EOF
19718
19719 fi
19720
19721         fi
19722 fi
19723
19724 for cf_data in \
19725 TABSIZE \
19726 curscr \
19727 ospeed \
19728 boolnames \
19729 boolfnames \
19730 ttytype
19731 do
19732 echo "$as_me:19732: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19733 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19734
19735 cat >conftest.$ac_ext <<_ACEOF
19736 #line 19736 "configure"
19737 #include "confdefs.h"
19738
19739 #ifdef HAVE_XCURSES
19740 #include <xcurses.h>
19741 char * XCursesProgramName = "test";
19742 #else
19743 #include <${cf_cv_ncurses_header:-curses.h}>
19744 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19745 #include <ncursesw/term.h>
19746 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19747 #include <ncurses/term.h>
19748 #elif defined(HAVE_TERM_H)
19749 #include <term.h>
19750 #endif
19751 #endif
19752
19753 int
19754 main (void)
19755 {
19756
19757 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19758         const void *foo = (const void *)($cf_data);
19759 #else
19760         const void *foo = &($cf_data);
19761 #endif
19762         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19763
19764   ;
19765   return 0;
19766 }
19767 _ACEOF
19768 rm -f conftest.$ac_objext
19769 if { (eval echo "$as_me:19769: \"$ac_compile\"") >&5
19770   (eval $ac_compile) 2>&5
19771   ac_status=$?
19772   echo "$as_me:19772: \$? = $ac_status" >&5
19773   (exit $ac_status); } &&
19774          { ac_try='test -s conftest.$ac_objext'
19775   { (eval echo "$as_me:19775: \"$ac_try\"") >&5
19776   (eval $ac_try) 2>&5
19777   ac_status=$?
19778   echo "$as_me:19778: \$? = $ac_status" >&5
19779   (exit $ac_status); }; }; then
19780   cf_result=yes
19781
19782 else
19783   echo "$as_me: failed program was:" >&5
19784 cat conftest.$ac_ext >&5
19785 cf_result=no
19786 fi
19787 rm -f conftest.$ac_objext conftest.$ac_ext
19788 echo "$as_me:19788: result: $cf_result" >&5
19789 echo "${ECHO_T}$cf_result" >&6
19790
19791 if test $cf_result = yes ; then
19792
19793 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19794
19795         cat >>confdefs.h <<EOF
19796 #define $cf_result 1
19797 EOF
19798
19799 else
19800         echo "$as_me:19800: checking for data $cf_data in library" >&5
19801 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19802         # BSD linkers insist on making weak linkage, but resolve at runtime.
19803         if test "$cross_compiling" = yes; then
19804
19805         # cross-compiling
19806         cat >conftest.$ac_ext <<_ACEOF
19807 #line 19807 "configure"
19808 #include "confdefs.h"
19809
19810 #ifdef HAVE_XCURSES
19811 #include <xcurses.h>
19812 char * XCursesProgramName = "test";
19813 #else
19814 #include <${cf_cv_ncurses_header:-curses.h}>
19815 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19816 #include <ncursesw/term.h>
19817 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19818 #include <ncurses/term.h>
19819 #elif defined(HAVE_TERM_H)
19820 #include <term.h>
19821 #endif
19822 #endif
19823
19824 extern char $cf_data;
19825 int
19826 main (void)
19827 {
19828
19829         do {
19830
19831 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19832         const void *foo = (const void *)($cf_data);
19833 #else
19834         const void *foo = &($cf_data);
19835 #endif
19836         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19837
19838                 ${cf_cv_main_return:-return}(foo == 0);
19839         } while (0)
19840
19841   ;
19842   return 0;
19843 }
19844 _ACEOF
19845 rm -f conftest.$ac_objext conftest$ac_exeext
19846 if { (eval echo "$as_me:19846: \"$ac_link\"") >&5
19847   (eval $ac_link) 2>&5
19848   ac_status=$?
19849   echo "$as_me:19849: \$? = $ac_status" >&5
19850   (exit $ac_status); } &&
19851          { ac_try='test -s conftest$ac_exeext'
19852   { (eval echo "$as_me:19852: \"$ac_try\"") >&5
19853   (eval $ac_try) 2>&5
19854   ac_status=$?
19855   echo "$as_me:19855: \$? = $ac_status" >&5
19856   (exit $ac_status); }; }; then
19857   cf_result=yes
19858 else
19859   echo "$as_me: failed program was:" >&5
19860 cat conftest.$ac_ext >&5
19861 cf_result=no
19862 fi
19863 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19864
19865 else
19866   cat >conftest.$ac_ext <<_ACEOF
19867 #line 19867 "configure"
19868 #include "confdefs.h"
19869
19870 #ifdef HAVE_XCURSES
19871 #include <xcurses.h>
19872 char * XCursesProgramName = "test";
19873 #else
19874 #include <${cf_cv_ncurses_header:-curses.h}>
19875 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19876 #include <ncursesw/term.h>
19877 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19878 #include <ncurses/term.h>
19879 #elif defined(HAVE_TERM_H)
19880 #include <term.h>
19881 #endif
19882 #endif
19883
19884 extern char $cf_data;
19885 int main(void)
19886 {
19887
19888 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19889         const void *foo = (const void *)($cf_data);
19890 #else
19891         const void *foo = &($cf_data);
19892 #endif
19893         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19894
19895         ${cf_cv_main_return:-return}(foo == 0);
19896 }
19897 _ACEOF
19898 rm -f conftest$ac_exeext
19899 if { (eval echo "$as_me:19899: \"$ac_link\"") >&5
19900   (eval $ac_link) 2>&5
19901   ac_status=$?
19902   echo "$as_me:19902: \$? = $ac_status" >&5
19903   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19904   { (eval echo "$as_me:19904: \"$ac_try\"") >&5
19905   (eval $ac_try) 2>&5
19906   ac_status=$?
19907   echo "$as_me:19907: \$? = $ac_status" >&5
19908   (exit $ac_status); }; }; then
19909   cf_result=yes
19910
19911 else
19912   echo "$as_me: program exited with status $ac_status" >&5
19913 echo "$as_me: failed program was:" >&5
19914 cat conftest.$ac_ext >&5
19915 cf_result=no
19916 fi
19917 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19918 fi
19919         echo "$as_me:19919: result: $cf_result" >&5
19920 echo "${ECHO_T}$cf_result" >&6
19921         if test $cf_result = yes ; then
19922
19923 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19924
19925                 cat >>confdefs.h <<EOF
19926 #define $cf_result 1
19927 EOF
19928
19929                 # do not exit loop here, since we prefer system's declarations
19930         fi
19931 fi
19932 done
19933
19934 if ( test "$GCC" = yes || test "$GXX" = yes )
19935 then
19936 echo "$as_me:19936: checking if you want to turn on gcc warnings" >&5
19937 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
19938
19939 # Check whether --enable-warnings or --disable-warnings was given.
19940 if test "${enable_warnings+set}" = set; then
19941   enableval="$enable_warnings"
19942   test "$enableval" != yes && enableval=no
19943         if test "$enableval" != "no" ; then
19944     with_warnings=yes
19945         else
19946                 with_warnings=no
19947         fi
19948 else
19949   enableval=no
19950         with_warnings=no
19951
19952 fi;
19953 echo "$as_me:19953: result: $with_warnings" >&5
19954 echo "${ECHO_T}$with_warnings" >&6
19955 if test "$with_warnings" = "yes"
19956 then
19957
19958 if test "$GCC" = yes
19959 then
19960 cat > conftest.i <<EOF
19961 #ifndef GCC_PRINTF
19962 #define GCC_PRINTF 0
19963 #endif
19964 #ifndef GCC_SCANF
19965 #define GCC_SCANF 0
19966 #endif
19967 #ifndef GCC_NORETURN
19968 #define GCC_NORETURN /* nothing */
19969 #endif
19970 #ifndef GCC_UNUSED
19971 #define GCC_UNUSED /* nothing */
19972 #endif
19973 EOF
19974 if test "$GCC" = yes
19975 then
19976         { echo "$as_me:19976: checking for $CC __attribute__ directives..." >&5
19977 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
19978 cat > conftest.$ac_ext <<EOF
19979 #line 19979 "${as_me:-configure}"
19980 #include "confdefs.h"
19981 #include "conftest.h"
19982 #include "conftest.i"
19983 #if     GCC_PRINTF
19984 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
19985 #else
19986 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
19987 #endif
19988 #if     GCC_SCANF
19989 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
19990 #else
19991 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
19992 #endif
19993 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
19994 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
19995 extern void foo(void) GCC_NORETURN;
19996 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
19997 EOF
19998         cf_printf_attribute=no
19999         cf_scanf_attribute=no
20000         for cf_attribute in scanf printf unused noreturn
20001         do
20002
20003 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20004
20005                 cf_directive="__attribute__(($cf_attribute))"
20006                 echo "checking for $CC $cf_directive" 1>&5
20007
20008                 case $cf_attribute in
20009                 (printf)
20010                         cf_printf_attribute=yes
20011                         cat >conftest.h <<EOF
20012 #define GCC_$cf_ATTRIBUTE 1
20013 EOF
20014                         ;;
20015                 (scanf)
20016                         cf_scanf_attribute=yes
20017                         cat >conftest.h <<EOF
20018 #define GCC_$cf_ATTRIBUTE 1
20019 EOF
20020                         ;;
20021                 (*)
20022                         cat >conftest.h <<EOF
20023 #define GCC_$cf_ATTRIBUTE $cf_directive
20024 EOF
20025                         ;;
20026                 esac
20027
20028                 if { (eval echo "$as_me:20028: \"$ac_compile\"") >&5
20029   (eval $ac_compile) 2>&5
20030   ac_status=$?
20031   echo "$as_me:20031: \$? = $ac_status" >&5
20032   (exit $ac_status); }; then
20033                         test -n "$verbose" && echo "$as_me:20033: result: ... $cf_attribute" >&5
20034 echo "${ECHO_T}... $cf_attribute" >&6
20035                         cat conftest.h >>confdefs.h
20036                         case $cf_attribute in
20037                         (noreturn)
20038
20039 cat >>confdefs.h <<EOF
20040 #define GCC_NORETURN $cf_directive
20041 EOF
20042
20043                                 ;;
20044                         (printf)
20045                                 cf_value='/* nothing */'
20046                                 if test "$cf_printf_attribute" != no ; then
20047                                         cf_value='__attribute__((format(printf,fmt,var)))'
20048
20049 cat >>confdefs.h <<\EOF
20050 #define GCC_PRINTF 1
20051 EOF
20052
20053                                 fi
20054
20055 cat >>confdefs.h <<EOF
20056 #define GCC_PRINTFLIKE(fmt,var) $cf_value
20057 EOF
20058
20059                                 ;;
20060                         (scanf)
20061                                 cf_value='/* nothing */'
20062                                 if test "$cf_scanf_attribute" != no ; then
20063                                         cf_value='__attribute__((format(scanf,fmt,var)))'
20064
20065 cat >>confdefs.h <<\EOF
20066 #define GCC_SCANF 1
20067 EOF
20068
20069                                 fi
20070
20071 cat >>confdefs.h <<EOF
20072 #define GCC_SCANFLIKE(fmt,var) $cf_value
20073 EOF
20074
20075                                 ;;
20076                         (unused)
20077
20078 cat >>confdefs.h <<EOF
20079 #define GCC_UNUSED $cf_directive
20080 EOF
20081
20082                                 ;;
20083                         esac
20084                 fi
20085         done
20086 else
20087         fgrep define conftest.i >>confdefs.h
20088 fi
20089 rm -rf conftest*
20090 fi
20091
20092 if test "x$have_x" = xyes; then
20093
20094 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
20095 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
20096 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
20097 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
20098 for cf_X_CFLAGS in $X_CFLAGS
20099 do
20100         case "x$cf_X_CFLAGS" in
20101         x-[IUD]*)
20102                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
20103                 ;;
20104         *)
20105                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
20106                 ;;
20107         esac
20108 done
20109
20110 cat >conftest.$ac_ext <<_ACEOF
20111 #line 20111 "configure"
20112 #include "confdefs.h"
20113
20114 #include <stdlib.h>
20115 #include <X11/Intrinsic.h>
20116
20117 int
20118 main (void)
20119 {
20120 String foo = malloc(1)
20121   ;
20122   return 0;
20123 }
20124 _ACEOF
20125 rm -f conftest.$ac_objext
20126 if { (eval echo "$as_me:20126: \"$ac_compile\"") >&5
20127   (eval $ac_compile) 2>&5
20128   ac_status=$?
20129   echo "$as_me:20129: \$? = $ac_status" >&5
20130   (exit $ac_status); } &&
20131          { ac_try='test -s conftest.$ac_objext'
20132   { (eval echo "$as_me:20132: \"$ac_try\"") >&5
20133   (eval $ac_try) 2>&5
20134   ac_status=$?
20135   echo "$as_me:20135: \$? = $ac_status" >&5
20136   (exit $ac_status); }; }; then
20137
20138 echo "$as_me:20138: checking for X11/Xt const-feature" >&5
20139 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
20140 if test "${cf_cv_const_x_string+set}" = set; then
20141   echo $ECHO_N "(cached) $ECHO_C" >&6
20142 else
20143
20144         cat >conftest.$ac_ext <<_ACEOF
20145 #line 20145 "configure"
20146 #include "confdefs.h"
20147
20148 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
20149 #undef  XTSTRINGDEFINES /* X11R5 and later */
20150 #include <stdlib.h>
20151 #include <X11/Intrinsic.h>
20152
20153 int
20154 main (void)
20155 {
20156 String foo = malloc(1); *foo = 0
20157   ;
20158   return 0;
20159 }
20160 _ACEOF
20161 rm -f conftest.$ac_objext
20162 if { (eval echo "$as_me:20162: \"$ac_compile\"") >&5
20163   (eval $ac_compile) 2>&5
20164   ac_status=$?
20165   echo "$as_me:20165: \$? = $ac_status" >&5
20166   (exit $ac_status); } &&
20167          { ac_try='test -s conftest.$ac_objext'
20168   { (eval echo "$as_me:20168: \"$ac_try\"") >&5
20169   (eval $ac_try) 2>&5
20170   ac_status=$?
20171   echo "$as_me:20171: \$? = $ac_status" >&5
20172   (exit $ac_status); }; }; then
20173
20174                         cf_cv_const_x_string=no
20175
20176 else
20177   echo "$as_me: failed program was:" >&5
20178 cat conftest.$ac_ext >&5
20179
20180                         cf_cv_const_x_string=yes
20181
20182 fi
20183 rm -f conftest.$ac_objext conftest.$ac_ext
20184
20185 fi
20186 echo "$as_me:20186: result: $cf_cv_const_x_string" >&5
20187 echo "${ECHO_T}$cf_cv_const_x_string" >&6
20188
20189 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
20190 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
20191 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
20192
20193 case $cf_cv_const_x_string in
20194 (no)
20195
20196         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20197         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
20198
20199         ;;
20200 (*)
20201
20202         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20203         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
20204
20205         ;;
20206 esac
20207
20208 else
20209   echo "$as_me: failed program was:" >&5
20210 cat conftest.$ac_ext >&5
20211 fi
20212 rm -f conftest.$ac_objext conftest.$ac_ext
20213  fi
20214 cat > conftest.$ac_ext <<EOF
20215 #line 20215 "${as_me:-configure}"
20216 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
20217 EOF
20218 if test "$INTEL_COMPILER" = yes
20219 then
20220 # The "-wdXXX" options suppress warnings:
20221 # remark #1419: external declaration in primary source file
20222 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
20223 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
20224 # remark #193: zero used for undefined preprocessing identifier
20225 # remark #593: variable "curs_sb_left_arrow" was set but never used
20226 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
20227 # remark #869: parameter "tw" was never referenced
20228 # remark #981: operands are evaluated in unspecified order
20229 # warning #279: controlling expression is constant
20230
20231         { echo "$as_me:20231: checking for $CC warning options..." >&5
20232 echo "$as_me: checking for $CC warning options..." >&6;}
20233         cf_save_CFLAGS="$CFLAGS"
20234         EXTRA_CFLAGS="-Wall"
20235         for cf_opt in \
20236                 wd1419 \
20237                 wd1683 \
20238                 wd1684 \
20239                 wd193 \
20240                 wd593 \
20241                 wd279 \
20242                 wd810 \
20243                 wd869 \
20244                 wd981
20245         do
20246                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
20247                 if { (eval echo "$as_me:20247: \"$ac_compile\"") >&5
20248   (eval $ac_compile) 2>&5
20249   ac_status=$?
20250   echo "$as_me:20250: \$? = $ac_status" >&5
20251   (exit $ac_status); }; then
20252                         test -n "$verbose" && echo "$as_me:20252: result: ... -$cf_opt" >&5
20253 echo "${ECHO_T}... -$cf_opt" >&6
20254                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
20255                 fi
20256         done
20257         CFLAGS="$cf_save_CFLAGS"
20258 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
20259 then
20260         { echo "$as_me:20260: checking for $CC warning options..." >&5
20261 echo "$as_me: checking for $CC warning options..." >&6;}
20262         cf_save_CFLAGS="$CFLAGS"
20263         EXTRA_CFLAGS=
20264         cf_warn_CONST=""
20265         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
20266         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
20267         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
20268         for cf_opt in W Wall \
20269                 Wbad-function-cast \
20270                 Wcast-align \
20271                 Wcast-qual \
20272                 Wdeclaration-after-statement \
20273                 Wextra \
20274                 Winline \
20275                 Wmissing-declarations \
20276                 Wmissing-prototypes \
20277                 Wnested-externs \
20278                 Wpointer-arith \
20279                 Wshadow \
20280                 Wstrict-prototypes \
20281                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
20282         do
20283                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
20284                 if { (eval echo "$as_me:20284: \"$ac_compile\"") >&5
20285   (eval $ac_compile) 2>&5
20286   ac_status=$?
20287   echo "$as_me:20287: \$? = $ac_status" >&5
20288   (exit $ac_status); }; then
20289                         test -n "$verbose" && echo "$as_me:20289: result: ... -$cf_opt" >&5
20290 echo "${ECHO_T}... -$cf_opt" >&6
20291                         case $cf_opt in
20292                         (Winline)
20293                                 case $GCC_VERSION in
20294                                 ([34].*)
20295                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
20296
20297 echo "${as_me:-configure}:20297: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
20298
20299                                         continue;;
20300                                 esac
20301                                 ;;
20302                         (Wpointer-arith)
20303                                 case $GCC_VERSION in
20304                                 ([12].*)
20305                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
20306
20307 echo "${as_me:-configure}:20307: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
20308
20309                                         continue;;
20310                                 esac
20311                                 ;;
20312                         esac
20313                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
20314                 fi
20315         done
20316         CFLAGS="$cf_save_CFLAGS"
20317 fi
20318 rm -rf conftest*
20319
20320 fi
20321 fi
20322
20323 echo "$as_me:20323: checking if you want to use dmalloc for testing" >&5
20324 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
20325
20326 # Check whether --with-dmalloc or --without-dmalloc was given.
20327 if test "${with_dmalloc+set}" = set; then
20328   withval="$with_dmalloc"
20329
20330 cat >>confdefs.h <<EOF
20331 #define USE_DMALLOC 1
20332 EOF
20333
20334         : ${with_cflags:=-g}
20335         : ${with_no_leaks:=yes}
20336          with_dmalloc=yes
20337 else
20338   with_dmalloc=
20339 fi;
20340 echo "$as_me:20340: result: ${with_dmalloc:-no}" >&5
20341 echo "${ECHO_T}${with_dmalloc:-no}" >&6
20342
20343 case .$with_cflags in
20344 (.*-g*)
20345         case .$CFLAGS in
20346         (.*-g*)
20347                 ;;
20348         (*)
20349
20350 cf_fix_cppflags=no
20351 cf_new_cflags=
20352 cf_new_cppflags=
20353 cf_new_extra_cppflags=
20354
20355 for cf_add_cflags in -g
20356 do
20357 case $cf_fix_cppflags in
20358 (no)
20359         case $cf_add_cflags in
20360         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20361                 case $cf_add_cflags in
20362                 (-D*)
20363                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20364
20365                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20366                                 && test -z "${cf_tst_cflags}" \
20367                                 && cf_fix_cppflags=yes
20368
20369                         if test $cf_fix_cppflags = yes ; then
20370
20371         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20372         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20373
20374                                 continue
20375                         elif test "${cf_tst_cflags}" = "\"'" ; then
20376
20377         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20378         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20379
20380                                 continue
20381                         fi
20382                         ;;
20383                 esac
20384                 case "$CPPFLAGS" in
20385                 (*$cf_add_cflags)
20386                         ;;
20387                 (*)
20388                         case $cf_add_cflags in
20389                         (-D*)
20390                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20391
20392 CPPFLAGS=`echo "$CPPFLAGS" | \
20393         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20394                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20395
20396                                 ;;
20397                         esac
20398
20399         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20400         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20401
20402                         ;;
20403                 esac
20404                 ;;
20405         (*)
20406
20407         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20408         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20409
20410                 ;;
20411         esac
20412         ;;
20413 (yes)
20414
20415         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20416         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20417
20418         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20419
20420         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20421                 && test -z "${cf_tst_cflags}" \
20422                 && cf_fix_cppflags=no
20423         ;;
20424 esac
20425 done
20426
20427 if test -n "$cf_new_cflags" ; then
20428
20429         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20430         CFLAGS="${CFLAGS}$cf_new_cflags"
20431
20432 fi
20433
20434 if test -n "$cf_new_cppflags" ; then
20435
20436         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20437         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20438
20439 fi
20440
20441 if test -n "$cf_new_extra_cppflags" ; then
20442
20443         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20444         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20445
20446 fi
20447
20448                 ;;
20449         esac
20450         ;;
20451 esac
20452
20453 if test "$with_dmalloc" = yes ; then
20454         echo "$as_me:20454: checking for dmalloc.h" >&5
20455 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
20456 if test "${ac_cv_header_dmalloc_h+set}" = set; then
20457   echo $ECHO_N "(cached) $ECHO_C" >&6
20458 else
20459   cat >conftest.$ac_ext <<_ACEOF
20460 #line 20460 "configure"
20461 #include "confdefs.h"
20462 #include <dmalloc.h>
20463 _ACEOF
20464 if { (eval echo "$as_me:20464: \"$ac_cpp conftest.$ac_ext\"") >&5
20465   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20466   ac_status=$?
20467   egrep -v '^ *\+' conftest.er1 >conftest.err
20468   rm -f conftest.er1
20469   cat conftest.err >&5
20470   echo "$as_me:20470: \$? = $ac_status" >&5
20471   (exit $ac_status); } >/dev/null; then
20472   if test -s conftest.err; then
20473     ac_cpp_err=$ac_c_preproc_warn_flag
20474   else
20475     ac_cpp_err=
20476   fi
20477 else
20478   ac_cpp_err=yes
20479 fi
20480 if test -z "$ac_cpp_err"; then
20481   ac_cv_header_dmalloc_h=yes
20482 else
20483   echo "$as_me: failed program was:" >&5
20484   cat conftest.$ac_ext >&5
20485   ac_cv_header_dmalloc_h=no
20486 fi
20487 rm -f conftest.err conftest.$ac_ext
20488 fi
20489 echo "$as_me:20489: result: $ac_cv_header_dmalloc_h" >&5
20490 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
20491 if test $ac_cv_header_dmalloc_h = yes; then
20492
20493 echo "$as_me:20493: checking for dmalloc_debug in -ldmalloc" >&5
20494 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
20495 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
20496   echo $ECHO_N "(cached) $ECHO_C" >&6
20497 else
20498   ac_check_lib_save_LIBS=$LIBS
20499 LIBS="-ldmalloc  $LIBS"
20500 cat >conftest.$ac_ext <<_ACEOF
20501 #line 20501 "configure"
20502 #include "confdefs.h"
20503
20504 /* Override any gcc2 internal prototype to avoid an error.  */
20505 #ifdef __cplusplus
20506 extern "C"
20507 #endif
20508 /* We use char because int might match the return type of a gcc2
20509    builtin and then its argument prototype would still apply.  */
20510 char dmalloc_debug ();
20511 int
20512 main (void)
20513 {
20514 dmalloc_debug ();
20515   ;
20516   return 0;
20517 }
20518 _ACEOF
20519 rm -f conftest.$ac_objext conftest$ac_exeext
20520 if { (eval echo "$as_me:20520: \"$ac_link\"") >&5
20521   (eval $ac_link) 2>&5
20522   ac_status=$?
20523   echo "$as_me:20523: \$? = $ac_status" >&5
20524   (exit $ac_status); } &&
20525          { ac_try='test -s conftest$ac_exeext'
20526   { (eval echo "$as_me:20526: \"$ac_try\"") >&5
20527   (eval $ac_try) 2>&5
20528   ac_status=$?
20529   echo "$as_me:20529: \$? = $ac_status" >&5
20530   (exit $ac_status); }; }; then
20531   ac_cv_lib_dmalloc_dmalloc_debug=yes
20532 else
20533   echo "$as_me: failed program was:" >&5
20534 cat conftest.$ac_ext >&5
20535 ac_cv_lib_dmalloc_dmalloc_debug=no
20536 fi
20537 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20538 LIBS=$ac_check_lib_save_LIBS
20539 fi
20540 echo "$as_me:20540: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
20541 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
20542 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
20543   cat >>confdefs.h <<EOF
20544 #define HAVE_LIBDMALLOC 1
20545 EOF
20546
20547   LIBS="-ldmalloc $LIBS"
20548
20549 fi
20550
20551 fi
20552
20553 fi
20554
20555 echo "$as_me:20555: checking if you want to use dbmalloc for testing" >&5
20556 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
20557
20558 # Check whether --with-dbmalloc or --without-dbmalloc was given.
20559 if test "${with_dbmalloc+set}" = set; then
20560   withval="$with_dbmalloc"
20561
20562 cat >>confdefs.h <<EOF
20563 #define USE_DBMALLOC 1
20564 EOF
20565
20566         : ${with_cflags:=-g}
20567         : ${with_no_leaks:=yes}
20568          with_dbmalloc=yes
20569 else
20570   with_dbmalloc=
20571 fi;
20572 echo "$as_me:20572: result: ${with_dbmalloc:-no}" >&5
20573 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
20574
20575 case .$with_cflags in
20576 (.*-g*)
20577         case .$CFLAGS in
20578         (.*-g*)
20579                 ;;
20580         (*)
20581
20582 cf_fix_cppflags=no
20583 cf_new_cflags=
20584 cf_new_cppflags=
20585 cf_new_extra_cppflags=
20586
20587 for cf_add_cflags in -g
20588 do
20589 case $cf_fix_cppflags in
20590 (no)
20591         case $cf_add_cflags in
20592         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20593                 case $cf_add_cflags in
20594                 (-D*)
20595                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20596
20597                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20598                                 && test -z "${cf_tst_cflags}" \
20599                                 && cf_fix_cppflags=yes
20600
20601                         if test $cf_fix_cppflags = yes ; then
20602
20603         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20604         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20605
20606                                 continue
20607                         elif test "${cf_tst_cflags}" = "\"'" ; then
20608
20609         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20610         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20611
20612                                 continue
20613                         fi
20614                         ;;
20615                 esac
20616                 case "$CPPFLAGS" in
20617                 (*$cf_add_cflags)
20618                         ;;
20619                 (*)
20620                         case $cf_add_cflags in
20621                         (-D*)
20622                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20623
20624 CPPFLAGS=`echo "$CPPFLAGS" | \
20625         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20626                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20627
20628                                 ;;
20629                         esac
20630
20631         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20632         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20633
20634                         ;;
20635                 esac
20636                 ;;
20637         (*)
20638
20639         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20640         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20641
20642                 ;;
20643         esac
20644         ;;
20645 (yes)
20646
20647         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20648         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20649
20650         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20651
20652         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20653                 && test -z "${cf_tst_cflags}" \
20654                 && cf_fix_cppflags=no
20655         ;;
20656 esac
20657 done
20658
20659 if test -n "$cf_new_cflags" ; then
20660
20661         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20662         CFLAGS="${CFLAGS}$cf_new_cflags"
20663
20664 fi
20665
20666 if test -n "$cf_new_cppflags" ; then
20667
20668         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20669         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20670
20671 fi
20672
20673 if test -n "$cf_new_extra_cppflags" ; then
20674
20675         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20676         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20677
20678 fi
20679
20680                 ;;
20681         esac
20682         ;;
20683 esac
20684
20685 if test "$with_dbmalloc" = yes ; then
20686         echo "$as_me:20686: checking for dbmalloc.h" >&5
20687 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
20688 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
20689   echo $ECHO_N "(cached) $ECHO_C" >&6
20690 else
20691   cat >conftest.$ac_ext <<_ACEOF
20692 #line 20692 "configure"
20693 #include "confdefs.h"
20694 #include <dbmalloc.h>
20695 _ACEOF
20696 if { (eval echo "$as_me:20696: \"$ac_cpp conftest.$ac_ext\"") >&5
20697   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20698   ac_status=$?
20699   egrep -v '^ *\+' conftest.er1 >conftest.err
20700   rm -f conftest.er1
20701   cat conftest.err >&5
20702   echo "$as_me:20702: \$? = $ac_status" >&5
20703   (exit $ac_status); } >/dev/null; then
20704   if test -s conftest.err; then
20705     ac_cpp_err=$ac_c_preproc_warn_flag
20706   else
20707     ac_cpp_err=
20708   fi
20709 else
20710   ac_cpp_err=yes
20711 fi
20712 if test -z "$ac_cpp_err"; then
20713   ac_cv_header_dbmalloc_h=yes
20714 else
20715   echo "$as_me: failed program was:" >&5
20716   cat conftest.$ac_ext >&5
20717   ac_cv_header_dbmalloc_h=no
20718 fi
20719 rm -f conftest.err conftest.$ac_ext
20720 fi
20721 echo "$as_me:20721: result: $ac_cv_header_dbmalloc_h" >&5
20722 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
20723 if test $ac_cv_header_dbmalloc_h = yes; then
20724
20725 echo "$as_me:20725: checking for debug_malloc in -ldbmalloc" >&5
20726 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
20727 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
20728   echo $ECHO_N "(cached) $ECHO_C" >&6
20729 else
20730   ac_check_lib_save_LIBS=$LIBS
20731 LIBS="-ldbmalloc  $LIBS"
20732 cat >conftest.$ac_ext <<_ACEOF
20733 #line 20733 "configure"
20734 #include "confdefs.h"
20735
20736 /* Override any gcc2 internal prototype to avoid an error.  */
20737 #ifdef __cplusplus
20738 extern "C"
20739 #endif
20740 /* We use char because int might match the return type of a gcc2
20741    builtin and then its argument prototype would still apply.  */
20742 char debug_malloc ();
20743 int
20744 main (void)
20745 {
20746 debug_malloc ();
20747   ;
20748   return 0;
20749 }
20750 _ACEOF
20751 rm -f conftest.$ac_objext conftest$ac_exeext
20752 if { (eval echo "$as_me:20752: \"$ac_link\"") >&5
20753   (eval $ac_link) 2>&5
20754   ac_status=$?
20755   echo "$as_me:20755: \$? = $ac_status" >&5
20756   (exit $ac_status); } &&
20757          { ac_try='test -s conftest$ac_exeext'
20758   { (eval echo "$as_me:20758: \"$ac_try\"") >&5
20759   (eval $ac_try) 2>&5
20760   ac_status=$?
20761   echo "$as_me:20761: \$? = $ac_status" >&5
20762   (exit $ac_status); }; }; then
20763   ac_cv_lib_dbmalloc_debug_malloc=yes
20764 else
20765   echo "$as_me: failed program was:" >&5
20766 cat conftest.$ac_ext >&5
20767 ac_cv_lib_dbmalloc_debug_malloc=no
20768 fi
20769 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20770 LIBS=$ac_check_lib_save_LIBS
20771 fi
20772 echo "$as_me:20772: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
20773 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
20774 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
20775   cat >>confdefs.h <<EOF
20776 #define HAVE_LIBDBMALLOC 1
20777 EOF
20778
20779   LIBS="-ldbmalloc $LIBS"
20780
20781 fi
20782
20783 fi
20784
20785 fi
20786
20787 echo "$as_me:20787: checking if you want to use valgrind for testing" >&5
20788 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
20789
20790 # Check whether --with-valgrind or --without-valgrind was given.
20791 if test "${with_valgrind+set}" = set; then
20792   withval="$with_valgrind"
20793
20794 cat >>confdefs.h <<EOF
20795 #define USE_VALGRIND 1
20796 EOF
20797
20798         : ${with_cflags:=-g}
20799         : ${with_no_leaks:=yes}
20800          with_valgrind=yes
20801 else
20802   with_valgrind=
20803 fi;
20804 echo "$as_me:20804: result: ${with_valgrind:-no}" >&5
20805 echo "${ECHO_T}${with_valgrind:-no}" >&6
20806
20807 case .$with_cflags in
20808 (.*-g*)
20809         case .$CFLAGS in
20810         (.*-g*)
20811                 ;;
20812         (*)
20813
20814 cf_fix_cppflags=no
20815 cf_new_cflags=
20816 cf_new_cppflags=
20817 cf_new_extra_cppflags=
20818
20819 for cf_add_cflags in -g
20820 do
20821 case $cf_fix_cppflags in
20822 (no)
20823         case $cf_add_cflags in
20824         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20825                 case $cf_add_cflags in
20826                 (-D*)
20827                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20828
20829                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20830                                 && test -z "${cf_tst_cflags}" \
20831                                 && cf_fix_cppflags=yes
20832
20833                         if test $cf_fix_cppflags = yes ; then
20834
20835         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20836         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20837
20838                                 continue
20839                         elif test "${cf_tst_cflags}" = "\"'" ; then
20840
20841         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20842         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20843
20844                                 continue
20845                         fi
20846                         ;;
20847                 esac
20848                 case "$CPPFLAGS" in
20849                 (*$cf_add_cflags)
20850                         ;;
20851                 (*)
20852                         case $cf_add_cflags in
20853                         (-D*)
20854                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20855
20856 CPPFLAGS=`echo "$CPPFLAGS" | \
20857         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20858                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20859
20860                                 ;;
20861                         esac
20862
20863         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20864         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20865
20866                         ;;
20867                 esac
20868                 ;;
20869         (*)
20870
20871         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20872         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20873
20874                 ;;
20875         esac
20876         ;;
20877 (yes)
20878
20879         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20880         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20881
20882         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20883
20884         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20885                 && test -z "${cf_tst_cflags}" \
20886                 && cf_fix_cppflags=no
20887         ;;
20888 esac
20889 done
20890
20891 if test -n "$cf_new_cflags" ; then
20892
20893         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20894         CFLAGS="${CFLAGS}$cf_new_cflags"
20895
20896 fi
20897
20898 if test -n "$cf_new_cppflags" ; then
20899
20900         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20901         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20902
20903 fi
20904
20905 if test -n "$cf_new_extra_cppflags" ; then
20906
20907         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20908         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20909
20910 fi
20911
20912                 ;;
20913         esac
20914         ;;
20915 esac
20916
20917 echo "$as_me:20917: checking if you want to perform memory-leak testing" >&5
20918 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
20919
20920 # Check whether --enable-leaks or --disable-leaks was given.
20921 if test "${enable_leaks+set}" = set; then
20922   enableval="$enable_leaks"
20923   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
20924 else
20925   : ${with_no_leaks:=no}
20926 fi;
20927 echo "$as_me:20927: result: $with_no_leaks" >&5
20928 echo "${ECHO_T}$with_no_leaks" >&6
20929
20930 if test "$with_no_leaks" = yes ; then
20931
20932 cat >>confdefs.h <<\EOF
20933 #define NO_LEAKS 1
20934 EOF
20935
20936 cat >>confdefs.h <<\EOF
20937 #define YY_NO_LEAKS 1
20938 EOF
20939
20940 fi
20941
20942 LD_RPATH_OPT=
20943 if test "x$cf_cv_enable_rpath" != xno
20944 then
20945         echo "$as_me:20945: checking for an rpath option" >&5
20946 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
20947         case $cf_cv_system_name in
20948         (irix*)
20949                 if test "$GCC" = yes; then
20950                         LD_RPATH_OPT="-Wl,-rpath,"
20951                 else
20952                         LD_RPATH_OPT="-rpath "
20953                 fi
20954                 ;;
20955         (linux*|gnu*|k*bsd*-gnu|freebsd*)
20956                 LD_RPATH_OPT="-Wl,-rpath,"
20957                 ;;
20958         (openbsd[2-9].*|mirbsd*)
20959                 LD_RPATH_OPT="-Wl,-rpath,"
20960                 ;;
20961         (dragonfly*)
20962                 LD_RPATH_OPT="-rpath "
20963                 ;;
20964         (netbsd*)
20965                 LD_RPATH_OPT="-Wl,-rpath,"
20966                 ;;
20967         (osf*|mls+*)
20968                 LD_RPATH_OPT="-rpath "
20969                 ;;
20970         (solaris2*)
20971                 LD_RPATH_OPT="-R"
20972                 ;;
20973         (*)
20974                 ;;
20975         esac
20976         echo "$as_me:20976: result: $LD_RPATH_OPT" >&5
20977 echo "${ECHO_T}$LD_RPATH_OPT" >&6
20978
20979         case "x$LD_RPATH_OPT" in
20980         (x-R*)
20981                 echo "$as_me:20981: checking if we need a space after rpath option" >&5
20982 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
20983                 cf_save_LIBS="$LIBS"
20984
20985 cf_add_libs="$LIBS"
20986 # reverse order
20987 cf_add_0lib=
20988 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
20989 # filter duplicates
20990 for cf_add_1lib in $cf_add_0lib; do
20991         for cf_add_2lib in $cf_add_libs; do
20992                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
20993                         cf_add_1lib=
20994                         break
20995                 fi
20996         done
20997         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
20998 done
20999 LIBS="$cf_add_libs"
21000
21001                 cat >conftest.$ac_ext <<_ACEOF
21002 #line 21002 "configure"
21003 #include "confdefs.h"
21004
21005 int
21006 main (void)
21007 {
21008
21009   ;
21010   return 0;
21011 }
21012 _ACEOF
21013 rm -f conftest.$ac_objext conftest$ac_exeext
21014 if { (eval echo "$as_me:21014: \"$ac_link\"") >&5
21015   (eval $ac_link) 2>&5
21016   ac_status=$?
21017   echo "$as_me:21017: \$? = $ac_status" >&5
21018   (exit $ac_status); } &&
21019          { ac_try='test -s conftest$ac_exeext'
21020   { (eval echo "$as_me:21020: \"$ac_try\"") >&5
21021   (eval $ac_try) 2>&5
21022   ac_status=$?
21023   echo "$as_me:21023: \$? = $ac_status" >&5
21024   (exit $ac_status); }; }; then
21025   cf_rpath_space=no
21026 else
21027   echo "$as_me: failed program was:" >&5
21028 cat conftest.$ac_ext >&5
21029 cf_rpath_space=yes
21030 fi
21031 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21032                 LIBS="$cf_save_LIBS"
21033                 echo "$as_me:21033: result: $cf_rpath_space" >&5
21034 echo "${ECHO_T}$cf_rpath_space" >&6
21035                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
21036                 ;;
21037         esac
21038 fi
21039
21040 echo "$as_me:21040: checking if rpath-hack should be disabled" >&5
21041 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
21042
21043 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
21044 if test "${enable_rpath_hack+set}" = set; then
21045   enableval="$enable_rpath_hack"
21046   test "$enableval" != no && enableval=yes
21047         if test "$enableval" != "yes" ; then
21048     cf_disable_rpath_hack=yes
21049         else
21050                 cf_disable_rpath_hack=no
21051         fi
21052 else
21053   enableval=yes
21054         cf_disable_rpath_hack=no
21055
21056 fi;
21057 echo "$as_me:21057: result: $cf_disable_rpath_hack" >&5
21058 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
21059 if test "$cf_disable_rpath_hack" = no ; then
21060
21061 echo "$as_me:21061: checking for updated LDFLAGS" >&5
21062 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
21063 if test -n "$LD_RPATH_OPT" ; then
21064         echo "$as_me:21064: result: maybe" >&5
21065 echo "${ECHO_T}maybe" >&6
21066
21067         for ac_prog in ldd
21068 do
21069   # Extract the first word of "$ac_prog", so it can be a program name with args.
21070 set dummy $ac_prog; ac_word=$2
21071 echo "$as_me:21071: checking for $ac_word" >&5
21072 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
21073 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
21074   echo $ECHO_N "(cached) $ECHO_C" >&6
21075 else
21076   if test -n "$cf_ldd_prog"; then
21077   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
21078 else
21079   ac_save_IFS=$IFS; IFS=$ac_path_separator
21080 ac_dummy="$PATH"
21081 for ac_dir in $ac_dummy; do
21082   IFS=$ac_save_IFS
21083   test -z "$ac_dir" && ac_dir=.
21084   $as_executable_p "$ac_dir/$ac_word" || continue
21085 ac_cv_prog_cf_ldd_prog="$ac_prog"
21086 echo "$as_me:21086: found $ac_dir/$ac_word" >&5
21087 break
21088 done
21089
21090 fi
21091 fi
21092 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
21093 if test -n "$cf_ldd_prog"; then
21094   echo "$as_me:21094: result: $cf_ldd_prog" >&5
21095 echo "${ECHO_T}$cf_ldd_prog" >&6
21096 else
21097   echo "$as_me:21097: result: no" >&5
21098 echo "${ECHO_T}no" >&6
21099 fi
21100
21101   test -n "$cf_ldd_prog" && break
21102 done
21103 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
21104
21105         cf_rpath_list="/usr/lib /lib"
21106         if test "$cf_ldd_prog" != no
21107         then
21108                 cf_rpath_oops=
21109
21110 cat >conftest.$ac_ext <<_ACEOF
21111 #line 21111 "configure"
21112 #include "confdefs.h"
21113 #include <stdio.h>
21114 int
21115 main (void)
21116 {
21117 printf("Hello");
21118   ;
21119   return 0;
21120 }
21121 _ACEOF
21122 rm -f conftest.$ac_objext conftest$ac_exeext
21123 if { (eval echo "$as_me:21123: \"$ac_link\"") >&5
21124   (eval $ac_link) 2>&5
21125   ac_status=$?
21126   echo "$as_me:21126: \$? = $ac_status" >&5
21127   (exit $ac_status); } &&
21128          { ac_try='test -s conftest$ac_exeext'
21129   { (eval echo "$as_me:21129: \"$ac_try\"") >&5
21130   (eval $ac_try) 2>&5
21131   ac_status=$?
21132   echo "$as_me:21132: \$? = $ac_status" >&5
21133   (exit $ac_status); }; }; then
21134   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
21135                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
21136 else
21137   echo "$as_me: failed program was:" >&5
21138 cat conftest.$ac_ext >&5
21139 fi
21140 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21141
21142                 # If we passed the link-test, but get a "not found" on a given library,
21143                 # this could be due to inept reconfiguration of gcc to make it only
21144                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
21145                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
21146                 # /usr/local libraries.
21147                 if test -n "$cf_rpath_oops"
21148                 then
21149                         for cf_rpath_src in $cf_rpath_oops
21150                         do
21151                                 for cf_rpath_dir in \
21152                                         /usr/local \
21153                                         /usr/pkg \
21154                                         /opt/sfw
21155                                 do
21156                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
21157                                         then
21158                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
21159
21160 echo "${as_me:-configure}:21160: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
21161
21162                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
21163                                                 break
21164                                         fi
21165                                 done
21166                         done
21167                 fi
21168         fi
21169
21170         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
21171
21172 echo "${as_me:-configure}:21172: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
21173
21174 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
21175
21176 echo "${as_me:-configure}:21176: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
21177
21178 cf_rpath_dst=
21179 for cf_rpath_src in $LDFLAGS
21180 do
21181         case $cf_rpath_src in
21182         (-L*)
21183
21184                 # check if this refers to a directory which we will ignore
21185                 cf_rpath_skip=no
21186                 if test -n "$cf_rpath_list"
21187                 then
21188                         for cf_rpath_item in $cf_rpath_list
21189                         do
21190                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
21191                                 then
21192                                         cf_rpath_skip=yes
21193                                         break
21194                                 fi
21195                         done
21196                 fi
21197
21198                 if test "$cf_rpath_skip" = no
21199                 then
21200                         # transform the option
21201                         if test "$LD_RPATH_OPT" = "-R " ; then
21202                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
21203                         else
21204                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
21205                         fi
21206
21207                         # if we have not already added this, add it now
21208                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
21209                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
21210                         then
21211                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
21212
21213 echo "${as_me:-configure}:21213: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
21214
21215                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
21216                         fi
21217                 fi
21218                 ;;
21219         esac
21220         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
21221 done
21222 LDFLAGS=$cf_rpath_dst
21223
21224 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
21225
21226 echo "${as_me:-configure}:21226: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
21227
21228 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
21229
21230 echo "${as_me:-configure}:21230: testing ...checking LIBS $LIBS ..." 1>&5
21231
21232 cf_rpath_dst=
21233 for cf_rpath_src in $LIBS
21234 do
21235         case $cf_rpath_src in
21236         (-L*)
21237
21238                 # check if this refers to a directory which we will ignore
21239                 cf_rpath_skip=no
21240                 if test -n "$cf_rpath_list"
21241                 then
21242                         for cf_rpath_item in $cf_rpath_list
21243                         do
21244                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
21245                                 then
21246                                         cf_rpath_skip=yes
21247                                         break
21248                                 fi
21249                         done
21250                 fi
21251
21252                 if test "$cf_rpath_skip" = no
21253                 then
21254                         # transform the option
21255                         if test "$LD_RPATH_OPT" = "-R " ; then
21256                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
21257                         else
21258                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
21259                         fi
21260
21261                         # if we have not already added this, add it now
21262                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
21263                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
21264                         then
21265                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
21266
21267 echo "${as_me:-configure}:21267: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
21268
21269                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
21270                         fi
21271                 fi
21272                 ;;
21273         esac
21274         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
21275 done
21276 LIBS=$cf_rpath_dst
21277
21278 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
21279
21280 echo "${as_me:-configure}:21280: testing ...checked LIBS $LIBS ..." 1>&5
21281
21282         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
21283
21284 echo "${as_me:-configure}:21284: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
21285
21286 else
21287         echo "$as_me:21287: result: no" >&5
21288 echo "${ECHO_T}no" >&6
21289 fi
21290
21291 fi
21292
21293 TEST_ARGS="$LIBS"
21294 LIBS=
21295
21296 ac_config_files="$ac_config_files Makefile"
21297 ac_config_commands="$ac_config_commands default"
21298 cat >confcache <<\_ACEOF
21299 # This file is a shell script that caches the results of configure
21300 # tests run on this system so they can be shared between configure
21301 # scripts and configure runs, see configure's option --config-cache.
21302 # It is not useful on other systems.  If it contains results you don't
21303 # want to keep, you may remove or edit it.
21304 #
21305 # config.status only pays attention to the cache file if you give it
21306 # the --recheck option to rerun configure.
21307 #
21308 # `ac_cv_env_foo' variables (set or unset) will be overriden when
21309 # loading this file, other *unset* `ac_cv_foo' will be assigned the
21310 # following values.
21311
21312 _ACEOF
21313
21314 # The following way of writing the cache mishandles newlines in values,
21315 # but we know of no workaround that is simple, portable, and efficient.
21316 # So, don't put newlines in cache variables' values.
21317 # Ultrix sh set writes to stderr and can't be redirected directly,
21318 # and sets the high bit in the cache file unless we assign to the vars.
21319 {
21320   (set) 2>&1 |
21321     case `(ac_space=' '; set | grep ac_space) 2>&1` in
21322     *ac_space=\ *)
21323       # `set' does not quote correctly, so add quotes (double-quote
21324       # substitution turns \\\\ into \\, and sed turns \\ into \).
21325       sed -n \
21326         "s/'/'\\\\''/g;
21327           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
21328       ;;
21329     *)
21330       # `set' quotes correctly as required by POSIX, so do not add quotes.
21331       sed -n \
21332         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
21333       ;;
21334     esac;
21335 } |
21336   sed '
21337      t clear
21338      : clear
21339      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
21340      t end
21341      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
21342      : end' >>confcache
21343 if cmp -s $cache_file confcache; then :; else
21344   if test -w $cache_file; then
21345     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
21346     cat confcache >$cache_file
21347   else
21348     echo "not updating unwritable cache $cache_file"
21349   fi
21350 fi
21351 rm -f confcache
21352
21353 test "x$prefix" = xNONE && prefix=$ac_default_prefix
21354 # Let make expand exec_prefix.
21355 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
21356
21357 # VPATH may cause trouble with some makes, so we remove $(srcdir),
21358 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
21359 # trailing colons and then remove the whole line if VPATH becomes empty
21360 # (actually we leave an empty line to preserve line numbers).
21361 if test "x$srcdir" = x.; then
21362   ac_vpsub='/^[         ]*VPATH[        ]*=/{
21363 s/:*\$(srcdir):*/:/;
21364 s/:*\${srcdir}:*/:/;
21365 s/:*@srcdir@:*/:/;
21366 s/^\([^=]*=[    ]*\):*/\1/;
21367 s/:*$//;
21368 s/^[^=]*=[      ]*$//;
21369 }'
21370 fi
21371
21372 DEFS=-DHAVE_CONFIG_H
21373
21374 : ${CONFIG_STATUS=./config.status}
21375 ac_clean_files_save=$ac_clean_files
21376 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
21377 { echo "$as_me:21377: creating $CONFIG_STATUS" >&5
21378 echo "$as_me: creating $CONFIG_STATUS" >&6;}
21379 cat >$CONFIG_STATUS <<_ACEOF
21380 #! $SHELL
21381 # Generated automatically by configure.
21382 # Run this file to recreate the current configuration.
21383 # Compiler output produced by configure, useful for debugging
21384 # configure, is in config.log if it exists.
21385
21386 debug=false
21387 SHELL=\${CONFIG_SHELL-$SHELL}
21388 ac_cs_invocation="\$0 \$@"
21389
21390 _ACEOF
21391
21392 cat >>$CONFIG_STATUS <<\_ACEOF
21393 # Be Bourne compatible
21394 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
21395   emulate sh
21396   NULLCMD=:
21397 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
21398   set -o posix
21399 fi
21400
21401 # Name of the executable.
21402 as_me=`echo "$0" |sed 's,.*[\\/],,'`
21403
21404 if expr a : '\(a\)' >/dev/null 2>&1; then
21405   as_expr=expr
21406 else
21407   as_expr=false
21408 fi
21409
21410 rm -f conf$$ conf$$.exe conf$$.file
21411 echo >conf$$.file
21412 if ln -s conf$$.file conf$$ 2>/dev/null; then
21413   # We could just check for DJGPP; but this test a) works b) is more generic
21414   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
21415   if test -f conf$$.exe; then
21416     # Don't use ln at all; we don't have any links
21417     as_ln_s='cp -p'
21418   else
21419     as_ln_s='ln -s'
21420   fi
21421 elif ln conf$$.file conf$$ 2>/dev/null; then
21422   as_ln_s=ln
21423 else
21424   as_ln_s='cp -p'
21425 fi
21426 rm -f conf$$ conf$$.exe conf$$.file
21427
21428 as_executable_p="test -f"
21429
21430 # Support unset when possible.
21431 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
21432   as_unset=unset
21433 else
21434   as_unset=false
21435 fi
21436
21437 # NLS nuisances.
21438 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
21439 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
21440 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
21441 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
21442 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
21443 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
21444 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
21445 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
21446
21447 # IFS
21448 # We need space, tab and new line, in precisely that order.
21449 as_nl='
21450 '
21451 IFS="   $as_nl"
21452
21453 # CDPATH.
21454 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
21455
21456 exec 6>&1
21457
21458 _ACEOF
21459
21460 # Files that config.status was made for.
21461 if test -n "$ac_config_files"; then
21462   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
21463 fi
21464
21465 if test -n "$ac_config_headers"; then
21466   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
21467 fi
21468
21469 if test -n "$ac_config_links"; then
21470   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
21471 fi
21472
21473 if test -n "$ac_config_commands"; then
21474   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
21475 fi
21476
21477 cat >>$CONFIG_STATUS <<\EOF
21478
21479 ac_cs_usage="\
21480 \`$as_me' instantiates files from templates according to the
21481 current configuration.
21482
21483 Usage: $0 [OPTIONS] [FILE]...
21484
21485   -h, --help       print this help, then exit
21486   -V, --version    print version number, then exit
21487   -d, --debug      don't remove temporary files
21488       --recheck    update $as_me by reconfiguring in the same conditions
21489   --file=FILE[:TEMPLATE]
21490                    instantiate the configuration file FILE
21491   --header=FILE[:TEMPLATE]
21492                    instantiate the configuration header FILE
21493
21494 Configuration files:
21495 $config_files
21496
21497 Configuration headers:
21498 $config_headers
21499
21500 Configuration commands:
21501 $config_commands
21502
21503 Report bugs to <dickey@invisible-island.net>."
21504 EOF
21505
21506 cat >>$CONFIG_STATUS <<EOF
21507 ac_cs_version="\\
21508 config.status
21509 configured by $0, generated by GNU Autoconf 2.52.20200111,
21510   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
21511
21512 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
21513 Free Software Foundation, Inc.
21514 This config.status script is free software; the Free Software Foundation
21515 gives unlimited permission to copy, distribute and modify it."
21516 srcdir=$srcdir
21517 INSTALL="$INSTALL"
21518 EOF
21519
21520 cat >>$CONFIG_STATUS <<\EOF
21521 # If no file are specified by the user, then we need to provide default
21522 # value.  By we need to know if files were specified by the user.
21523 ac_need_defaults=:
21524 while test $# != 0
21525 do
21526   case $1 in
21527   --*=*)
21528     ac_option=`expr "x$1" : 'x\([^=]*\)='`
21529     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
21530     shift
21531     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
21532     shift
21533     ;;
21534   -*);;
21535   *) # This is not an option, so the user has probably given explicit
21536      # arguments.
21537      ac_need_defaults=false;;
21538   esac
21539
21540   case $1 in
21541   # Handling of the options.
21542 EOF
21543 cat >>$CONFIG_STATUS <<EOF
21544   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
21545     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
21546     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
21547 EOF
21548 cat >>$CONFIG_STATUS <<\EOF
21549   --version | --vers* | -V )
21550     echo "$ac_cs_version"; exit 0 ;;
21551   --he | --h)
21552     # Conflict between --help and --header
21553     { { echo "$as_me:21553: error: ambiguous option: $1
21554 Try \`$0 --help' for more information." >&5
21555 echo "$as_me: error: ambiguous option: $1
21556 Try \`$0 --help' for more information." >&2;}
21557    { (exit 1); exit 1; }; };;
21558   --help | --hel | -h )
21559     echo "$ac_cs_usage"; exit 0 ;;
21560   --debug | --d* | -d )
21561     debug=: ;;
21562   --file | --fil | --fi | --f )
21563     shift
21564     CONFIG_FILES="$CONFIG_FILES $1"
21565     ac_need_defaults=false;;
21566   --header | --heade | --head | --hea )
21567     shift
21568     CONFIG_HEADERS="$CONFIG_HEADERS $1"
21569     ac_need_defaults=false;;
21570
21571   # This is an error.
21572   -*) { { echo "$as_me:21572: error: unrecognized option: $1
21573 Try \`$0 --help' for more information." >&5
21574 echo "$as_me: error: unrecognized option: $1
21575 Try \`$0 --help' for more information." >&2;}
21576    { (exit 1); exit 1; }; } ;;
21577
21578   *) ac_config_targets="$ac_config_targets $1" ;;
21579
21580   esac
21581   shift
21582 done
21583
21584 exec 5>>config.log
21585 cat >&5 << _ACEOF
21586
21587 ## ----------------------- ##
21588 ## Running config.status.  ##
21589 ## ----------------------- ##
21590
21591 This file was extended by $as_me 2.52.20200111, executed with
21592   CONFIG_FILES    = $CONFIG_FILES
21593   CONFIG_HEADERS  = $CONFIG_HEADERS
21594   CONFIG_LINKS    = $CONFIG_LINKS
21595   CONFIG_COMMANDS = $CONFIG_COMMANDS
21596   > $ac_cs_invocation
21597 on `(hostname || uname -n) 2>/dev/null | sed 1q`
21598
21599 _ACEOF
21600 EOF
21601
21602 cat >>$CONFIG_STATUS <<EOF
21603 #
21604 # INIT-COMMANDS section.
21605 #
21606
21607 AWK="$AWK"
21608 ECHO_CC="$ECHO_CC"
21609 ECHO_LD="$ECHO_LD"
21610 SHOW_CC="$SHOW_LD"
21611
21612 EOF
21613
21614 cat >>$CONFIG_STATUS <<\EOF
21615 for ac_config_target in $ac_config_targets
21616 do
21617   case "$ac_config_target" in
21618   # Handling of arguments.
21619   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
21620   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
21621   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
21622   *) { { echo "$as_me:21622: error: invalid argument: $ac_config_target" >&5
21623 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
21624    { (exit 1); exit 1; }; };;
21625   esac
21626 done
21627
21628 # If the user did not use the arguments to specify the items to instantiate,
21629 # then the envvar interface is used.  Set only those that are not.
21630 # We use the long form for the default assignment because of an extremely
21631 # bizarre bug on SunOS 4.1.3.
21632 if $ac_need_defaults; then
21633   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
21634   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
21635   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
21636 fi
21637
21638 # Create a temporary directory, and hook for its removal unless debugging.
21639 $debug ||
21640 {
21641   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
21642   trap '{ (exit 1); exit 1; }' 1 2 13 15
21643 }
21644
21645 # Create a (secure) tmp directory for tmp files.
21646 : ${TMPDIR=/tmp}
21647 {
21648   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
21649   test -n "$tmp" && test -d "$tmp"
21650 }  ||
21651 {
21652   tmp=$TMPDIR/cs$$-$RANDOM
21653   (umask 077 && mkdir $tmp)
21654 } ||
21655 {
21656    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
21657    { (exit 1); exit 1; }
21658 }
21659
21660 EOF
21661
21662 cat >>$CONFIG_STATUS <<EOF
21663
21664 #
21665 # CONFIG_FILES section.
21666 #
21667
21668 # No need to generate the scripts if there are no CONFIG_FILES.
21669 # This happens for instance when ./config.status config.h
21670 if test -n "\$CONFIG_FILES"; then
21671   # Protect against being on the right side of a sed subst in config.status.
21672   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
21673    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
21674 s,@SHELL@,$SHELL,;t t
21675 s,@exec_prefix@,$exec_prefix,;t t
21676 s,@prefix@,$prefix,;t t
21677 s,@program_transform_name@,$program_transform_name,;t t
21678 s,@bindir@,$bindir,;t t
21679 s,@sbindir@,$sbindir,;t t
21680 s,@libexecdir@,$libexecdir,;t t
21681 s,@datarootdir@,$datarootdir,;t t
21682 s,@datadir@,$datadir,;t t
21683 s,@sysconfdir@,$sysconfdir,;t t
21684 s,@sharedstatedir@,$sharedstatedir,;t t
21685 s,@localstatedir@,$localstatedir,;t t
21686 s,@runstatedir@,$runstatedir,;t t
21687 s,@libdir@,$libdir,;t t
21688 s,@includedir@,$includedir,;t t
21689 s,@oldincludedir@,$oldincludedir,;t t
21690 s,@infodir@,$infodir,;t t
21691 s,@mandir@,$mandir,;t t
21692 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
21693 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
21694 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
21695 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
21696 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
21697 s,@build_alias@,$build_alias,;t t
21698 s,@host_alias@,$host_alias,;t t
21699 s,@target_alias@,$target_alias,;t t
21700 s,@ECHO_C@,$ECHO_C,;t t
21701 s,@ECHO_N@,$ECHO_N,;t t
21702 s,@ECHO_T@,$ECHO_T,;t t
21703 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
21704 s,@DEFS@,$DEFS,;t t
21705 s,@LIBS@,$LIBS,;t t
21706 s,@build@,$build,;t t
21707 s,@build_cpu@,$build_cpu,;t t
21708 s,@build_vendor@,$build_vendor,;t t
21709 s,@build_os@,$build_os,;t t
21710 s,@host@,$host,;t t
21711 s,@host_cpu@,$host_cpu,;t t
21712 s,@host_vendor@,$host_vendor,;t t
21713 s,@host_os@,$host_os,;t t
21714 s,@SET_MAKE@,$SET_MAKE,;t t
21715 s,@CC@,$CC,;t t
21716 s,@CFLAGS@,$CFLAGS,;t t
21717 s,@LDFLAGS@,$LDFLAGS,;t t
21718 s,@CPPFLAGS@,$CPPFLAGS,;t t
21719 s,@ac_ct_CC@,$ac_ct_CC,;t t
21720 s,@EXEEXT@,$EXEEXT,;t t
21721 s,@OBJEXT@,$OBJEXT,;t t
21722 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
21723 s,@CPP@,$CPP,;t t
21724 s,@AWK@,$AWK,;t t
21725 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
21726 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
21727 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
21728 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
21729 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
21730 s,@LINT@,$LINT,;t t
21731 s,@LINT_OPTS@,$LINT_OPTS,;t t
21732 s,@CTAGS@,$CTAGS,;t t
21733 s,@ETAGS@,$ETAGS,;t t
21734 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
21735 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
21736 s,@MATH_LIB@,$MATH_LIB,;t t
21737 s,@top_builddir@,$top_builddir,;t t
21738 s,@CC_G_OPT@,$CC_G_OPT,;t t
21739 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
21740 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
21741 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
21742 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
21743 s,@LD@,$LD,;t t
21744 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
21745 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
21746 s,@LD_MODEL@,$LD_MODEL,;t t
21747 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
21748 s,@LIBTOOL@,$LIBTOOL,;t t
21749 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
21750 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
21751 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
21752 s,@LIB_LINK@,$LIB_LINK,;t t
21753 s,@LINK_TESTS@,$LINK_TESTS,;t t
21754 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
21755 s,@PACKAGE@,$PACKAGE,;t t
21756 s,@PTHREAD@,$PTHREAD,;t t
21757 s,@TEST_ARGS@,$TEST_ARGS,;t t
21758 s,@TEST_DEPS@,$TEST_DEPS,;t t
21759 s,@TEST_LIBS@,$TEST_LIBS,;t t
21760 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
21761 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
21762 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
21763 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
21764 s,@includesubdir@,$includesubdir,;t t
21765 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
21766 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
21767 s,@ECHO_LT@,$ECHO_LT,;t t
21768 s,@ECHO_LD@,$ECHO_LD,;t t
21769 s,@RULE_CC@,$RULE_CC,;t t
21770 s,@SHOW_CC@,$SHOW_CC,;t t
21771 s,@ECHO_CC@,$ECHO_CC,;t t
21772 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
21773 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
21774 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
21775 s,@X_CFLAGS@,$X_CFLAGS,;t t
21776 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
21777 s,@X_LIBS@,$X_LIBS,;t t
21778 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
21779 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
21780 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
21781 s,@RGB_PATH@,$RGB_PATH,;t t
21782 s,@no_x11_rgb@,$no_x11_rgb,;t t
21783 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
21784 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
21785 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
21786 CEOF
21787
21788 EOF
21789
21790   cat >>$CONFIG_STATUS <<\EOF
21791   # Split the substitutions into bite-sized pieces for seds with
21792   # small command number limits, like on Digital OSF/1 and HP-UX.
21793   ac_max_sed_lines=48
21794   ac_sed_frag=1 # Number of current file.
21795   ac_beg=1 # First line for current file.
21796   ac_end=$ac_max_sed_lines # Line after last line for current file.
21797   ac_more_lines=:
21798   ac_sed_cmds=
21799   while $ac_more_lines; do
21800     if test $ac_beg -gt 1; then
21801       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21802     else
21803       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21804     fi
21805     if test ! -s $tmp/subs.frag; then
21806       ac_more_lines=false
21807     else
21808       # The purpose of the label and of the branching condition is to
21809       # speed up the sed processing (if there are no `@' at all, there
21810       # is no need to browse any of the substitutions).
21811       # These are the two extra sed commands mentioned above.
21812       (echo ':t
21813   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
21814       # It is possible to make a multiline substitution using escaped newlines.
21815       # Ensure that we do not split the substitution between script fragments.
21816       ac_BEG=$ac_end
21817       ac_END=`expr $ac_end + $ac_max_sed_lines`
21818       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
21819       if test -s $tmp/subs.next; then
21820         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
21821         if test ! -s $tmp/subs.edit; then
21822           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
21823           if test ! -s $tmp/subs.edit; then
21824             if test $ac_beg -gt 1; then
21825               ac_end=`expr $ac_end - 1`
21826               continue
21827             fi
21828           fi
21829         fi
21830       fi
21831
21832       if test -z "$ac_sed_cmds"; then
21833         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
21834       else
21835         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
21836       fi
21837       ac_sed_frag=`expr $ac_sed_frag + 1`
21838       ac_beg=$ac_end
21839       ac_end=`expr $ac_end + $ac_max_sed_lines`
21840     fi
21841   done
21842   if test -z "$ac_sed_cmds"; then
21843     ac_sed_cmds=cat
21844   fi
21845 fi # test -n "$CONFIG_FILES"
21846
21847 EOF
21848 cat >>$CONFIG_STATUS <<\EOF
21849 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
21850   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21851   case $ac_file in
21852   - | *:- | *:-:* ) # input from stdin
21853         cat >$tmp/stdin
21854         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21855         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21856   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21857         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21858   * )   ac_file_in=$ac_file.in ;;
21859   esac
21860
21861   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
21862   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21863          X"$ac_file" : 'X\(//\)[^/]' \| \
21864          X"$ac_file" : 'X\(//\)$' \| \
21865          X"$ac_file" : 'X\(/\)' \| \
21866          .     : '\(.\)' 2>/dev/null ||
21867 echo X"$ac_file" |
21868     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21869           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21870           /^X\(\/\/\)$/{ s//\1/; q; }
21871           /^X\(\/\).*/{ s//\1/; q; }
21872           s/.*/./; q'`
21873   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21874     { case "$ac_dir" in
21875   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21876   *)                      as_incr_dir=.;;
21877 esac
21878 as_dummy="$ac_dir"
21879 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21880   case $as_mkdir_dir in
21881     # Skip DOS drivespec
21882     ?:) as_incr_dir=$as_mkdir_dir ;;
21883     *)
21884       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21885       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21886     ;;
21887   esac
21888 done; }
21889
21890     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21891     # A "../" for each directory in $ac_dir_suffix.
21892     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21893   else
21894     ac_dir_suffix= ac_dots=
21895   fi
21896
21897   case $srcdir in
21898   .)  ac_srcdir=.
21899       if test -z "$ac_dots"; then
21900          ac_top_srcdir=.
21901       else
21902          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21903       fi ;;
21904   [\\/]* | ?:[\\/]* )
21905       ac_srcdir=$srcdir$ac_dir_suffix;
21906       ac_top_srcdir=$srcdir ;;
21907   *) # Relative path.
21908     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
21909     ac_top_srcdir=$ac_dots$srcdir ;;
21910   esac
21911
21912   case $INSTALL in
21913   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21914   *) ac_INSTALL=$ac_dots$INSTALL ;;
21915   esac
21916
21917   if test x"$ac_file" != x-; then
21918     { echo "$as_me:21918: creating $ac_file" >&5
21919 echo "$as_me: creating $ac_file" >&6;}
21920     rm -f "$ac_file"
21921   fi
21922   # Let's still pretend it is `configure' which instantiates (i.e., don't
21923   # use $as_me), people would be surprised to read:
21924   #    /* config.h.  Generated automatically by config.status.  */
21925   configure_input="Generated automatically from `echo $ac_file_in |
21926                                                  sed 's,.*/,,'` by configure."
21927
21928   # First look for the input files in the build tree, otherwise in the
21929   # src tree.
21930   ac_file_inputs=`IFS=:
21931     for f in $ac_file_in; do
21932       case $f in
21933       -) echo $tmp/stdin ;;
21934       [\\/$]*)
21935          # Absolute (can't be DOS-style, as IFS=:)
21936          test -f "$f" || { { echo "$as_me:21936: error: cannot find input file: $f" >&5
21937 echo "$as_me: error: cannot find input file: $f" >&2;}
21938    { (exit 1); exit 1; }; }
21939          echo $f;;
21940       *) # Relative
21941          if test -f "$f"; then
21942            # Build tree
21943            echo $f
21944          elif test -f "$srcdir/$f"; then
21945            # Source tree
21946            echo $srcdir/$f
21947          else
21948            # /dev/null tree
21949            { { echo "$as_me:21949: error: cannot find input file: $f" >&5
21950 echo "$as_me: error: cannot find input file: $f" >&2;}
21951    { (exit 1); exit 1; }; }
21952          fi;;
21953       esac
21954     done` || { (exit 1); exit 1; }
21955 EOF
21956 cat >>$CONFIG_STATUS <<\EOF
21957   ac_warn_datarootdir=no
21958   if test x"$ac_file" != x-; then
21959     for ac_item in $ac_file_inputs
21960     do
21961       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
21962       if test -n "$ac_seen"; then
21963         ac_used=`grep '@datarootdir@' $ac_item`
21964         if test -z "$ac_used"; then
21965           { echo "$as_me:21965: WARNING: datarootdir was used implicitly but not set:
21966 $ac_seen" >&5
21967 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
21968 $ac_seen" >&2;}
21969           ac_warn_datarootdir=yes
21970         fi
21971       fi
21972       ac_seen=`grep '${datarootdir}' $ac_item`
21973       if test -n "$ac_seen"; then
21974         { echo "$as_me:21974: WARNING: datarootdir was used explicitly but not set:
21975 $ac_seen" >&5
21976 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
21977 $ac_seen" >&2;}
21978         ac_warn_datarootdir=yes
21979       fi
21980     done
21981   fi
21982
21983 if test "x$ac_warn_datarootdir" = xyes; then
21984   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
21985 fi
21986
21987 EOF
21988 cat >>$CONFIG_STATUS <<EOF
21989   sed "$ac_vpsub
21990 $extrasub
21991 EOF
21992 cat >>$CONFIG_STATUS <<\EOF
21993 :t
21994 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
21995 s,@configure_input@,$configure_input,;t t
21996 s,@srcdir@,$ac_srcdir,;t t
21997 s,@top_srcdir@,$ac_top_srcdir,;t t
21998 s,@INSTALL@,$ac_INSTALL,;t t
21999 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
22000   rm -f $tmp/stdin
22001   if test x"$ac_file" != x-; then
22002     cp $tmp/out $ac_file
22003
22004     for ac_name in prefix exec_prefix datarootdir
22005     do
22006         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
22007         if test -n "$ac_seen"; then
22008             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
22009             if test -z "$ac_init"; then
22010               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
22011               { echo "$as_me:22011: WARNING: Variable $ac_name is used but was not set:
22012 $ac_seen" >&5
22013 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
22014 $ac_seen" >&2;}
22015             fi
22016         fi
22017     done
22018     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
22019     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
22020     if test -s $tmp/out; then
22021       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
22022       { echo "$as_me:22022: WARNING: Some variables may not be substituted:
22023 $ac_seen" >&5
22024 echo "$as_me: WARNING: Some variables may not be substituted:
22025 $ac_seen" >&2;}
22026     fi
22027   else
22028     cat $tmp/out
22029   fi
22030   rm -f $tmp/out
22031
22032 done
22033 EOF
22034 cat >>$CONFIG_STATUS <<\EOF
22035
22036 #
22037 # CONFIG_HEADER section.
22038 #
22039
22040 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
22041 # NAME is the cpp macro being defined and VALUE is the value it is being given.
22042 #
22043 # ac_d sets the value in "#define NAME VALUE" lines.
22044 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
22045 ac_dB='[        ].*$,\1#\2'
22046 ac_dC=' '
22047 ac_dD=',;t'
22048 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
22049 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
22050 ac_iB='\([      ]\),\1#\2define\3'
22051 ac_iC=' '
22052 ac_iD='\4,;t'
22053 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
22054 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
22055 ac_uB='$,\1#\2define\3'
22056 ac_uC=' '
22057 ac_uD=',;t'
22058
22059 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
22060   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
22061   case $ac_file in
22062   - | *:- | *:-:* ) # input from stdin
22063         cat >$tmp/stdin
22064         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
22065         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
22066   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
22067         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
22068   * )   ac_file_in=$ac_file.in ;;
22069   esac
22070
22071   test x"$ac_file" != x- && { echo "$as_me:22071: creating $ac_file" >&5
22072 echo "$as_me: creating $ac_file" >&6;}
22073
22074   # First look for the input files in the build tree, otherwise in the
22075   # src tree.
22076   ac_file_inputs=`IFS=:
22077     for f in $ac_file_in; do
22078       case $f in
22079       -) echo $tmp/stdin ;;
22080       [\\/$]*)
22081          # Absolute (can't be DOS-style, as IFS=:)
22082          test -f "$f" || { { echo "$as_me:22082: error: cannot find input file: $f" >&5
22083 echo "$as_me: error: cannot find input file: $f" >&2;}
22084    { (exit 1); exit 1; }; }
22085          echo $f;;
22086       *) # Relative
22087          if test -f "$f"; then
22088            # Build tree
22089            echo $f
22090          elif test -f "$srcdir/$f"; then
22091            # Source tree
22092            echo $srcdir/$f
22093          else
22094            # /dev/null tree
22095            { { echo "$as_me:22095: error: cannot find input file: $f" >&5
22096 echo "$as_me: error: cannot find input file: $f" >&2;}
22097    { (exit 1); exit 1; }; }
22098          fi;;
22099       esac
22100     done` || { (exit 1); exit 1; }
22101   # Remove the trailing spaces.
22102   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
22103
22104 EOF
22105
22106 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
22107 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
22108 # be either 'cat' or 'sort'.
22109 cat confdefs.h | uniq >conftest.vals
22110
22111 # Break up conftest.vals because some shells have a limit on
22112 # the size of here documents, and old seds have small limits too.
22113
22114 rm -f conftest.tail
22115 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
22116 while grep . conftest.vals >/dev/null
22117 do
22118   # Write chunks of a limited-size here document to conftest.frag.
22119   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
22120   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
22121   echo 'CEOF' >> $CONFIG_STATUS
22122   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
22123   rm -f conftest.vals
22124   mv conftest.tail conftest.vals
22125 done
22126 rm -f conftest.vals
22127
22128 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
22129 # marker @DEFS@.
22130 echo '  cat >> conftest.edit <<CEOF
22131 /@DEFS@/r conftest.frag
22132 /@DEFS@/d
22133 CEOF
22134 sed -f conftest.edit $tmp/in > $tmp/out
22135 rm -f $tmp/in
22136 mv $tmp/out $tmp/in
22137 rm -f conftest.edit conftest.frag
22138 ' >> $CONFIG_STATUS
22139
22140 cat >>$CONFIG_STATUS <<\EOF
22141   # Let's still pretend it is `configure' which instantiates (i.e., don't
22142   # use $as_me), people would be surprised to read:
22143   #    /* config.h.  Generated automatically by config.status.  */
22144   if test x"$ac_file" = x-; then
22145     echo "/* Generated automatically by configure.  */" >$tmp/config.h
22146   else
22147     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
22148   fi
22149   cat $tmp/in >>$tmp/config.h
22150   rm -f $tmp/in
22151   if test x"$ac_file" != x-; then
22152     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
22153       { echo "$as_me:22153: $ac_file is unchanged" >&5
22154 echo "$as_me: $ac_file is unchanged" >&6;}
22155     else
22156       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
22157          X"$ac_file" : 'X\(//\)[^/]' \| \
22158          X"$ac_file" : 'X\(//\)$' \| \
22159          X"$ac_file" : 'X\(/\)' \| \
22160          .     : '\(.\)' 2>/dev/null ||
22161 echo X"$ac_file" |
22162     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
22163           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
22164           /^X\(\/\/\)$/{ s//\1/; q; }
22165           /^X\(\/\).*/{ s//\1/; q; }
22166           s/.*/./; q'`
22167       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
22168         { case "$ac_dir" in
22169   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
22170   *)                      as_incr_dir=.;;
22171 esac
22172 as_dummy="$ac_dir"
22173 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
22174   case $as_mkdir_dir in
22175     # Skip DOS drivespec
22176     ?:) as_incr_dir=$as_mkdir_dir ;;
22177     *)
22178       as_incr_dir=$as_incr_dir/$as_mkdir_dir
22179       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
22180     ;;
22181   esac
22182 done; }
22183
22184       fi
22185       rm -f $ac_file
22186       mv $tmp/config.h $ac_file
22187     fi
22188   else
22189     cat $tmp/config.h
22190     rm -f $tmp/config.h
22191   fi
22192 done
22193 EOF
22194 cat >>$CONFIG_STATUS <<\EOF
22195 #
22196 # CONFIG_COMMANDS section.
22197 #
22198 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
22199   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
22200   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
22201
22202   case $ac_dest in
22203     default )
22204
22205 for cf_dir in .
22206 do
22207         if test ! -d $srcdir/$cf_dir; then
22208                 continue
22209         elif test -f $srcdir/$cf_dir/programs; then
22210                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
22211         fi
22212 done
22213
22214         cat >>Makefile <<TEST_EOF
22215
22216 # These rules are generated so we do not rely on suffix rules, which do not
22217 # work consistently for different make-programs (the '\$(MODEL)/' confuses
22218 # some, and the '\$x' confuses others).
22219 TEST_EOF
22220
22221 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
22222 for N in $LIST
22223 do
22224         cat >>Makefile <<TEST_EOF
22225
22226 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
22227         \$(srcdir)/test.priv.h \\
22228         ncurses_cfg.h
22229         $SHOW_CC
22230         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
22231 TEST_EOF
22232 done
22233
22234 if test -f ../config.guess && test -f ../config.sub
22235 then
22236         cat >>Makefile <<TEST_EOF
22237
22238 # if we used CF_INHERIT for getting these files, we can remove them
22239 distclean::
22240         rm -f config.guess config.sub
22241 TEST_EOF
22242 fi
22243  ;;
22244   esac
22245 done
22246 EOF
22247
22248 cat >>$CONFIG_STATUS <<\EOF
22249
22250 { (exit 0); exit 0; }
22251 EOF
22252 chmod +x $CONFIG_STATUS
22253 ac_clean_files=$ac_clean_files_save
22254
22255 # configure is writing to config.log, and then calls config.status.
22256 # config.status does its own redirection, appending to config.log.
22257 # Unfortunately, on DOS this fails, as config.log is still kept open
22258 # by configure, so config.status won't be able to write to it; its
22259 # output is simply discarded.  So we exec the FD to /dev/null,
22260 # effectively closing config.log, so it can be properly (re)opened and
22261 # appended to by config.status.  When coming back to configure, we
22262 # need to make the FD available again.
22263 if test "$no_create" != yes; then
22264   ac_cs_success=:
22265   exec 5>/dev/null
22266   $SHELL $CONFIG_STATUS || ac_cs_success=false
22267   exec 5>>config.log
22268   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
22269   # would make configure fail if this is the last instruction.
22270   $ac_cs_success || { (exit 1); exit 1; }
22271 fi
22272