]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20200829
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20200802.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 runstatedir='${localstatedir}/run'
143 libdir='${exec_prefix}/lib'
144 includedir='${prefix}/include'
145 oldincludedir='/usr/include'
146 infodir='${datarootdir}/info'
147 mandir='${datarootdir}/man'
148
149 # Identity of this package.
150 PACKAGE_NAME=
151 PACKAGE_TARNAME=
152 PACKAGE_VERSION=
153 PACKAGE_STRING=
154 PACKAGE_BUGREPORT=
155
156 ac_prev=
157 for ac_option
158 do
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
167
168   # Accept the important Cygnus configure options, so we can diagnose typos.
169
170   case $ac_option in
171
172   -bindir | --bindir | --bindi | --bind | --bin | --bi)
173     ac_prev=bindir ;;
174   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
175     bindir=$ac_optarg ;;
176
177   -build | --build | --buil | --bui | --bu)
178     ac_prev=build_alias ;;
179   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
180     build_alias=$ac_optarg ;;
181
182   -cache-file | --cache-file | --cache-fil | --cache-fi \
183   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
184     ac_prev=cache_file ;;
185   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
186   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
187     cache_file=$ac_optarg ;;
188
189   --config-cache | -C)
190     cache_file=config.cache ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir=$ac_optarg ;;
197
198   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
199   | --dataroo | --dataro | --datar)
200     ac_prev=datarootdir ;;
201   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
202   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
203     datarootdir=$ac_optarg ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     eval "enable_$ac_feature=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
216     # Reject names that are not valid shell variable names.
217     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
218       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
219    { (exit 1); exit 1; }; }
220     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
221     case $ac_option in
222       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_$ac_feature='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix=$ac_optarg ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he | -h)
241     ac_init_help=long ;;
242   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
243     ac_init_help=recursive ;;
244   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
245     ac_init_help=short ;;
246
247   -host | --host | --hos | --ho)
248     ac_prev=host_alias ;;
249   -host=* | --host=* | --hos=* | --ho=*)
250     host_alias=$ac_optarg ;;
251
252   -includedir | --includedir | --includedi | --included | --include \
253   | --includ | --inclu | --incl | --inc)
254     ac_prev=includedir ;;
255   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
256   | --includ=* | --inclu=* | --incl=* | --inc=*)
257     includedir=$ac_optarg ;;
258
259   -infodir | --infodir | --infodi | --infod | --info | --inf)
260     ac_prev=infodir ;;
261   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
262     infodir=$ac_optarg ;;
263
264   -libdir | --libdir | --libdi | --libd)
265     ac_prev=libdir ;;
266   -libdir=* | --libdir=* | --libdi=* | --libd=*)
267     libdir=$ac_optarg ;;
268
269   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
270   | --libexe | --libex | --libe)
271     ac_prev=libexecdir ;;
272   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
273   | --libexe=* | --libex=* | --libe=*)
274     libexecdir=$ac_optarg ;;
275
276   -localstatedir | --localstatedir | --localstatedi | --localstated \
277   | --localstate | --localstat | --localsta | --localst \
278   | --locals | --local | --loca | --loc | --lo)
279     ac_prev=localstatedir ;;
280   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
281   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
282   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
283     localstatedir=$ac_optarg ;;
284
285   -runstatedir | --runstatedir | --runstatedi | --runstated \
286   | --runstate | --runstat | --runsta | --runst \
287   | --runs | --run | --ru)
288     ac_prev=runstatedir ;;
289   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
290   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
291   | --runs=* | --run=* | --ru=*)
292     runstatedir=$ac_optarg ;;
293
294   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
295     ac_prev=mandir ;;
296   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
297     mandir=$ac_optarg ;;
298
299   -nfp | --nfp | --nf)
300     # Obsolete; use --without-fp.
301     with_fp=no ;;
302
303   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
304   | --no-cr | --no-c)
305     no_create=yes ;;
306
307   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
308   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
309     no_recursion=yes ;;
310
311   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
312   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
313   | --oldin | --oldi | --old | --ol | --o)
314     ac_prev=oldincludedir ;;
315   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
316   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
317   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
318     oldincludedir=$ac_optarg ;;
319
320   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
321     ac_prev=prefix ;;
322   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
323     prefix=$ac_optarg ;;
324
325   -program-prefix | --program-prefix | --program-prefi | --program-pref \
326   | --program-pre | --program-pr | --program-p)
327     ac_prev=program_prefix ;;
328   -program-prefix=* | --program-prefix=* | --program-prefi=* \
329   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
330     program_prefix=$ac_optarg ;;
331
332   -program-suffix | --program-suffix | --program-suffi | --program-suff \
333   | --program-suf | --program-su | --program-s)
334     ac_prev=program_suffix ;;
335   -program-suffix=* | --program-suffix=* | --program-suffi=* \
336   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
337     program_suffix=$ac_optarg ;;
338
339   -program-transform-name | --program-transform-name \
340   | --program-transform-nam | --program-transform-na \
341   | --program-transform-n | --program-transform- \
342   | --program-transform | --program-transfor \
343   | --program-transfo | --program-transf \
344   | --program-trans | --program-tran \
345   | --progr-tra | --program-tr | --program-t)
346     ac_prev=program_transform_name ;;
347   -program-transform-name=* | --program-transform-name=* \
348   | --program-transform-nam=* | --program-transform-na=* \
349   | --program-transform-n=* | --program-transform-=* \
350   | --program-transform=* | --program-transfor=* \
351   | --program-transfo=* | --program-transf=* \
352   | --program-trans=* | --program-tran=* \
353   | --progr-tra=* | --program-tr=* | --program-t=*)
354     program_transform_name=$ac_optarg ;;
355
356   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
357   | -silent | --silent | --silen | --sile | --sil)
358     silent=yes ;;
359
360   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
361     ac_prev=sbindir ;;
362   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
363   | --sbi=* | --sb=*)
364     sbindir=$ac_optarg ;;
365
366   -sharedstatedir | --sharedstatedir | --sharedstatedi \
367   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
368   | --sharedst | --shareds | --shared | --share | --shar \
369   | --sha | --sh)
370     ac_prev=sharedstatedir ;;
371   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
372   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
373   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
374   | --sha=* | --sh=*)
375     sharedstatedir=$ac_optarg ;;
376
377   -site | --site | --sit)
378     ac_prev=site ;;
379   -site=* | --site=* | --sit=*)
380     site=$ac_optarg ;;
381
382   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
383     ac_prev=srcdir ;;
384   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
385     srcdir=$ac_optarg ;;
386
387   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
388   | --syscon | --sysco | --sysc | --sys | --sy)
389     ac_prev=sysconfdir ;;
390   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
391   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
392     sysconfdir=$ac_optarg ;;
393
394   -target | --target | --targe | --targ | --tar | --ta | --t)
395     ac_prev=target_alias ;;
396   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
397     target_alias=$ac_optarg ;;
398
399   -v | -verbose | --verbose | --verbos | --verbo | --verb)
400     verbose=yes ;;
401
402   -version | --version | --versio | --versi | --vers | -V)
403     ac_init_version=: ;;
404
405   -with-* | --with-*)
406     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
407     # Reject names that are not valid shell variable names.
408     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
409       { echo "$as_me: error: invalid package name: $ac_package" >&2
410    { (exit 1); exit 1; }; }
411     ac_package=`echo $ac_package| sed 's/-/_/g'`
412     case $ac_option in
413       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
414       *) ac_optarg=yes ;;
415     esac
416     eval "with_$ac_package='$ac_optarg'" ;;
417
418   -without-* | --without-*)
419     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
420     # Reject names that are not valid shell variable names.
421     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
422       { echo "$as_me: error: invalid package name: $ac_package" >&2
423    { (exit 1); exit 1; }; }
424     ac_package=`echo $ac_package | sed 's/-/_/g'`
425     eval "with_$ac_package=no" ;;
426
427   --x)
428     # Obsolete; use --with-x.
429     with_x=yes ;;
430
431   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
432   | --x-incl | --x-inc | --x-in | --x-i)
433     ac_prev=x_includes ;;
434   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
435   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
436     x_includes=$ac_optarg ;;
437
438   -x-libraries | --x-libraries | --x-librarie | --x-librari \
439   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
440     ac_prev=x_libraries ;;
441   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
442   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
443     x_libraries=$ac_optarg ;;
444
445   -*) { echo "$as_me: error: unrecognized option: $ac_option
446 Try \`$0 --help' for more information." >&2
447    { (exit 1); exit 1; }; }
448     ;;
449
450   *=*)
451     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
452     # Reject names that are not valid shell variable names.
453     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
454       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
455    { (exit 1); exit 1; }; }
456     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
457     eval "$ac_envvar='$ac_optarg'"
458     export $ac_envvar ;;
459
460   *)
461     # FIXME: should be removed in autoconf 3.0.
462     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
463     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
464       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
465     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
466     ;;
467
468   esac
469 done
470
471 if test -n "$ac_prev"; then
472   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
473   { echo "$as_me: error: missing argument to $ac_option" >&2
474    { (exit 1); exit 1; }; }
475 fi
476
477 # Be sure to have absolute paths.
478 for ac_var in exec_prefix prefix
479 do
480   eval ac_val=$`echo $ac_var`
481   case $ac_val in
482     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
483     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
484    { (exit 1); exit 1; }; };;
485   esac
486 done
487
488 # Be sure to have absolute paths.
489 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
490               localstatedir libdir includedir oldincludedir infodir mandir
491 do
492   eval ac_val=$`echo $ac_var`
493   case $ac_val in
494     [\\/$]* | ?:[\\/]* ) ;;
495     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
496    { (exit 1); exit 1; }; };;
497   esac
498 done
499
500 # There might be people who depend on the old broken behavior: `$host'
501 # used to hold the argument of --host etc.
502 build=$build_alias
503 host=$host_alias
504 target=$target_alias
505
506 # FIXME: should be removed in autoconf 3.0.
507 if test "x$host_alias" != x; then
508   if test "x$build_alias" = x; then
509     cross_compiling=maybe
510     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
511     If a cross compiler is detected then cross compile mode will be used." >&2
512   elif test "x$build_alias" != "x$host_alias"; then
513     cross_compiling=yes
514   fi
515 fi
516
517 ac_tool_prefix=
518 test -n "$host_alias" && ac_tool_prefix=$host_alias-
519
520 test "$silent" = yes && exec 6>/dev/null
521
522 # Find the source files, if location was not specified.
523 if test -z "$srcdir"; then
524   ac_srcdir_defaulted=yes
525   # Try the directory containing this script, then its parent.
526   ac_prog=$0
527   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
528   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
529   srcdir=$ac_confdir
530   if test ! -r $srcdir/$ac_unique_file; then
531     srcdir=..
532   fi
533 else
534   ac_srcdir_defaulted=no
535 fi
536 if test ! -r $srcdir/$ac_unique_file; then
537   if test "$ac_srcdir_defaulted" = yes; then
538     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
539    { (exit 1); exit 1; }; }
540   else
541     { echo "$as_me: error: cannot find sources in $srcdir" >&2
542    { (exit 1); exit 1; }; }
543   fi
544 fi
545 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
546 ac_env_build_alias_set=${build_alias+set}
547 ac_env_build_alias_value=$build_alias
548 ac_cv_env_build_alias_set=${build_alias+set}
549 ac_cv_env_build_alias_value=$build_alias
550 ac_env_host_alias_set=${host_alias+set}
551 ac_env_host_alias_value=$host_alias
552 ac_cv_env_host_alias_set=${host_alias+set}
553 ac_cv_env_host_alias_value=$host_alias
554 ac_env_target_alias_set=${target_alias+set}
555 ac_env_target_alias_value=$target_alias
556 ac_cv_env_target_alias_set=${target_alias+set}
557 ac_cv_env_target_alias_value=$target_alias
558 ac_env_CC_set=${CC+set}
559 ac_env_CC_value=$CC
560 ac_cv_env_CC_set=${CC+set}
561 ac_cv_env_CC_value=$CC
562 ac_env_CFLAGS_set=${CFLAGS+set}
563 ac_env_CFLAGS_value=$CFLAGS
564 ac_cv_env_CFLAGS_set=${CFLAGS+set}
565 ac_cv_env_CFLAGS_value=$CFLAGS
566 ac_env_LDFLAGS_set=${LDFLAGS+set}
567 ac_env_LDFLAGS_value=$LDFLAGS
568 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_cv_env_LDFLAGS_value=$LDFLAGS
570 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
571 ac_env_CPPFLAGS_value=$CPPFLAGS
572 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
574 ac_env_CPP_set=${CPP+set}
575 ac_env_CPP_value=$CPP
576 ac_cv_env_CPP_set=${CPP+set}
577 ac_cv_env_CPP_value=$CPP
578
579 #
580 # Report the --help message.
581 #
582 if test "$ac_init_help" = "long"; then
583   # Omit some internal or obsolete options to make the list less imposing.
584   # This message is too long to be a string in the A/UX 3.1 sh.
585   cat <<EOF
586 \`configure' configures this package to adapt to many kinds of systems.
587
588 Usage: $0 [OPTION]... [VAR=VALUE]...
589
590 To assign environment variables (e.g., CC, CFLAGS...), specify them as
591 VAR=VALUE.  See below for descriptions of some of the useful variables.
592
593 Defaults for the options are specified in brackets.
594
595 Configuration:
596   -h, --help              display this help and exit
597       --help=short        display options specific to this package
598       --help=recursive    display the short help of all the included packages
599   -V, --version           display version information and exit
600   -q, --quiet, --silent   do not print \`checking...' messages
601       --cache-file=FILE   cache test results in FILE [disabled]
602   -C, --config-cache      alias for \`--cache-file=config.cache'
603   -n, --no-create         do not create output files
604       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
605
606 EOF
607
608   cat <<EOF
609 Installation directories:
610   --prefix=PREFIX         install architecture-independent files in PREFIX
611                           [$ac_default_prefix]
612   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
613                           [PREFIX]
614
615 By default, \`make install' will install all the files in
616 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
617 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
618 for instance \`--prefix=\$HOME'.
619
620 For better control, use the options below.
621
622 Fine tuning of the installation directories:
623   --bindir=DIR            user executables [EPREFIX/bin]
624   --sbindir=DIR           system admin executables [EPREFIX/sbin]
625   --libexecdir=DIR        program executables [EPREFIX/libexec]
626   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
627   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
628   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
629   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
630   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
631   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
632   --libdir=DIR            object code libraries [EPREFIX/lib]
633   --includedir=DIR        C header files [PREFIX/include]
634   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
635   --infodir=DIR           info documentation [DATAROOTDIR/info]
636   --mandir=DIR            man documentation [DATAROOTDIR/man]
637 EOF
638
639   cat <<\EOF
640
641 Program names:
642   --program-prefix=PREFIX            prepend PREFIX to installed program names
643   --program-suffix=SUFFIX            append SUFFIX to installed program names
644   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
645
646 X features:
647   --x-includes=DIR    X include files are in DIR
648   --x-libraries=DIR   X library files are in DIR
649
650 System types:
651   --build=BUILD           configure for building on BUILD [guessed]
652   --host=HOST       build programs to run on HOST [BUILD]
653 EOF
654 fi
655
656 if test -n "$ac_init_help"; then
657
658   cat <<\EOF
659
660 Optional Features:
661   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
662   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
663
664 Optional Packages:
665   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
666   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
667
668 General Options:
669   --disable-stripping     do not strip (debug info) installed executables
670   --enable-string-hacks   work around bogus compiler/loader warnings
671   --with-pkg-config{=path} enable/disable use of pkg-config
672   --disable-echo          do not display "compiling" commands
673 Curses Version-dependent Options:
674   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
675   --disable-widec         disable checks for wide-character functions
676   --with-curses-dir=DIR   directory in which (n)curses is installed
677   --with-screen=XXX       use specified curses-libraries
678   --with-ncursesw         use wide ncurses-libraries
679   --with-ncurses          use ncurses-libraries
680   --with-pdcurses         compile/link with pdcurses X11 library
681   --with-curses-colr      compile/link with HPUX 10.x color-curses
682   --with-curses-5lib      compile/link with SunOS 5lib curses
683   --with-Xaw3d            link with Xaw 3d library
684   --with-Xaw3dxft         link with Xaw 3d xft library
685   --with-neXtaw           link with neXT Athena library
686   --with-XawPlus          link with Athena-Plus library
687   --with-x                use the X Window System
688   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
689   --with-form-libname=XXX override form basename of library
690   --with-menu-libname=XXX override menu basename of library
691   --with-panel-libname=XXX override panel basename of library
692   --disable-panel         disable checks for panel functions
693   --disable-menu          disable checks for menu functions
694   --disable-form          disable checks for form functions
695 Testing/development Options:
696   --enable-warnings       test: turn on gcc compiler warnings
697   --with-dmalloc          test: use Gray Watson's dmalloc library
698   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
699   --with-valgrind         test: use valgrind
700   --disable-leaks         test: free permanent memory, analyze leaks
701   --disable-rpath-hack    don't add rpath options for additional libraries
702
703 Some influential environment variables:
704   CC          C compiler command
705   CFLAGS      C compiler flags
706   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
707               nonstandard directory <lib dir>
708   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
709               headers in a nonstandard directory <include dir>
710   CPP         C preprocessor
711
712 Use these variables to override the choices made by `configure' or to help
713 it to find libraries and programs with nonstandard names/locations.
714
715 EOF
716 fi
717
718 if test "$ac_init_help" = "recursive"; then
719   # If there are subdirs, report their specific --help.
720   ac_popdir=`pwd`
721   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
722     cd $ac_subdir
723     # A "../" for each directory in /$ac_subdir.
724     ac_dots=`echo $ac_subdir |
725              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
726
727     case $srcdir in
728     .) # No --srcdir option.  We are building in place.
729       ac_sub_srcdir=$srcdir ;;
730     [\\/]* | ?:[\\/]* ) # Absolute path.
731       ac_sub_srcdir=$srcdir/$ac_subdir ;;
732     *) # Relative path.
733       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
734     esac
735
736     # Check for guested configure; otherwise get Cygnus style configure.
737     if test -f $ac_sub_srcdir/configure.gnu; then
738       echo
739       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
740     elif test -f $ac_sub_srcdir/configure; then
741       echo
742       $SHELL $ac_sub_srcdir/configure  --help=recursive
743     elif test -f $ac_sub_srcdir/configure.ac ||
744            test -f $ac_sub_srcdir/configure.in; then
745       echo
746       $ac_configure --help
747     else
748       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
749     fi
750     cd $ac_popdir
751   done
752 fi
753
754 test -n "$ac_init_help" && exit 0
755 if $ac_init_version; then
756   cat <<\EOF
757
758 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
759 Free Software Foundation, Inc.
760 This configure script is free software; the Free Software Foundation
761 gives unlimited permission to copy, distribute and modify it.
762 EOF
763   exit 0
764 fi
765 exec 5>config.log
766 cat >&5 <<EOF
767 This file contains any messages produced by compilers while
768 running configure, to aid debugging if configure makes a mistake.
769
770 It was created by $as_me, which was
771 generated by GNU Autoconf 2.52.20200802.  Invocation command line was
772
773   $ $0 $@
774
775 EOF
776 {
777 cat <<_ASUNAME
778 ## ---------- ##
779 ## Platform.  ##
780 ## ---------- ##
781
782 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
783 uname -m = `(uname -m) 2>/dev/null || echo unknown`
784 uname -r = `(uname -r) 2>/dev/null || echo unknown`
785 uname -s = `(uname -s) 2>/dev/null || echo unknown`
786 uname -v = `(uname -v) 2>/dev/null || echo unknown`
787
788 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
789 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
790
791 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
792 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
793 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
794 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
795 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
796 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
797 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
798
799 PATH = $PATH
800
801 _ASUNAME
802 } >&5
803
804 cat >&5 <<EOF
805 ## ------------ ##
806 ## Core tests.  ##
807 ## ------------ ##
808
809 EOF
810
811 # Keep a trace of the command line.
812 # Strip out --no-create and --no-recursion so they do not pile up.
813 # Also quote any args containing shell meta-characters.
814 ac_configure_args=
815 ac_sep=
816 for ac_arg
817 do
818   case $ac_arg in
819   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
820   | --no-cr | --no-c) ;;
821   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
822   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
823   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
824     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
825     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
826     ac_sep=" " ;;
827   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
828      ac_sep=" " ;;
829   esac
830   # Get rid of the leading space.
831 done
832
833 # When interrupted or exit'd, cleanup temporary files, and complete
834 # config.log.  We remove comments because anyway the quotes in there
835 # would cause problems or look ugly.
836 trap 'exit_status=$?
837   # Save into config.log some information that might help in debugging.
838   echo >&5
839   echo "## ----------------- ##" >&5
840   echo "## Cache variables.  ##" >&5
841   echo "## ----------------- ##" >&5
842   echo >&5
843   # The following way of writing the cache mishandles newlines in values,
844 {
845   (set) 2>&1 |
846     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
847     *ac_space=\ *)
848       sed -n \
849         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
850           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
851       ;;
852     *)
853       sed -n \
854         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
855       ;;
856     esac;
857 } >&5
858   sed "/^$/d" confdefs.h >conftest.log
859   if test -s conftest.log; then
860     echo >&5
861     echo "## ------------ ##" >&5
862     echo "## confdefs.h.  ##" >&5
863     echo "## ------------ ##" >&5
864     echo >&5
865     cat conftest.log >&5
866   fi
867   (echo; echo) >&5
868   test "$ac_signal" != 0 &&
869     echo "$as_me: caught signal $ac_signal" >&5
870   echo "$as_me: exit $exit_status" >&5
871   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
872     exit $exit_status
873      ' 0
874 for ac_signal in 1 2 13 15; do
875   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
876 done
877 ac_signal=0
878
879 # confdefs.h avoids OS command line length limits that DEFS can exceed.
880 rm -rf conftest* confdefs.h
881 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
882 echo >confdefs.h
883
884 # Let the site file select an alternate cache file if it wants to.
885 # Prefer explicitly selected file to automatically selected ones.
886 if test -z "$CONFIG_SITE"; then
887   if test "x$prefix" != xNONE; then
888     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
889   else
890     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
891   fi
892 fi
893 for ac_site_file in $CONFIG_SITE; do
894   if test -r "$ac_site_file"; then
895     { echo "$as_me:895: loading site script $ac_site_file" >&5
896 echo "$as_me: loading site script $ac_site_file" >&6;}
897     cat "$ac_site_file" >&5
898     . "$ac_site_file"
899   fi
900 done
901
902 if test -r "$cache_file"; then
903   # Some versions of bash will fail to source /dev/null (special
904   # files actually), so we avoid doing that.
905   if test -f "$cache_file"; then
906     { echo "$as_me:906: loading cache $cache_file" >&5
907 echo "$as_me: loading cache $cache_file" >&6;}
908     case $cache_file in
909       [\\/]* | ?:[\\/]* ) . $cache_file;;
910       *)                      . ./$cache_file;;
911     esac
912   fi
913 else
914   { echo "$as_me:914: creating cache $cache_file" >&5
915 echo "$as_me: creating cache $cache_file" >&6;}
916   >$cache_file
917 fi
918
919 # Check that the precious variables saved in the cache have kept the same
920 # value.
921 ac_cache_corrupted=false
922 for ac_var in `(set) 2>&1 |
923                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
924   eval ac_old_set=\$ac_cv_env_${ac_var}_set
925   eval ac_new_set=\$ac_env_${ac_var}_set
926   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
927   eval ac_new_val="\$ac_env_${ac_var}_value"
928   case $ac_old_set,$ac_new_set in
929     set,)
930       { echo "$as_me:930: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
931 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
932       ac_cache_corrupted=: ;;
933     ,set)
934       { echo "$as_me:934: error: \`$ac_var' was not set in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,);;
938     *)
939       if test "x$ac_old_val" != "x$ac_new_val"; then
940         { echo "$as_me:940: error: \`$ac_var' has changed since the previous run:" >&5
941 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
942         { echo "$as_me:942:   former value:  $ac_old_val" >&5
943 echo "$as_me:   former value:  $ac_old_val" >&2;}
944         { echo "$as_me:944:   current value: $ac_new_val" >&5
945 echo "$as_me:   current value: $ac_new_val" >&2;}
946         ac_cache_corrupted=:
947       fi;;
948   esac
949   # Pass precious variables to config.status.  It doesn't matter if
950   # we pass some twice (in addition to the command line arguments).
951   if test "$ac_new_set" = set; then
952     case $ac_new_val in
953     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
954       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
955       ac_configure_args="$ac_configure_args '$ac_arg'"
956       ;;
957     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
958        ;;
959     esac
960   fi
961 done
962 if $ac_cache_corrupted; then
963   { echo "$as_me:963: error: changes in the environment can compromise the build" >&5
964 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
965   { { echo "$as_me:965: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
966 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
967    { (exit 1); exit 1; }; }
968 fi
969
970 ac_ext=c
971 ac_cpp='$CPP $CPPFLAGS'
972 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
973 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
974 ac_compiler_gnu=$ac_cv_c_compiler_gnu
975 ac_main_return=return
976
977 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
978   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
979                    ECHO_T='     ' ;;
980   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
981   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
982 esac
983 echo "#! $SHELL" >conftest.sh
984 echo  "exit 0"   >>conftest.sh
985 chmod +x conftest.sh
986 if { (echo "$as_me:986: PATH=\".;.\"; conftest.sh") >&5
987   (PATH=".;."; conftest.sh) 2>&5
988   ac_status=$?
989   echo "$as_me:989: \$? = $ac_status" >&5
990   (exit $ac_status); }; then
991   ac_path_separator=';'
992 else
993   ac_path_separator=:
994 fi
995 PATH_SEPARATOR="$ac_path_separator"
996 rm -f conftest.sh
997
998 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
999
1000 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1001
1002 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1003
1004 ac_aux_dir=
1005 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1006   if test -f $ac_dir/install-sh; then
1007     ac_aux_dir=$ac_dir
1008     ac_install_sh="$ac_aux_dir/install-sh -c"
1009     break
1010   elif test -f $ac_dir/install.sh; then
1011     ac_aux_dir=$ac_dir
1012     ac_install_sh="$ac_aux_dir/install.sh -c"
1013     break
1014   elif test -f $ac_dir/shtool; then
1015     ac_aux_dir=$ac_dir
1016     ac_install_sh="$ac_aux_dir/shtool install -c"
1017     break
1018   fi
1019 done
1020 if test -z "$ac_aux_dir"; then
1021   { { echo "$as_me:1021: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1022 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1023    { (exit 1); exit 1; }; }
1024 fi
1025 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1026 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1027 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1028
1029 # Make sure we can run config.sub.
1030 $ac_config_sub sun4 >/dev/null 2>&1 ||
1031   { { echo "$as_me:1031: error: cannot run $ac_config_sub" >&5
1032 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1033    { (exit 1); exit 1; }; }
1034
1035 echo "$as_me:1035: checking build system type" >&5
1036 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1037 if test "${ac_cv_build+set}" = set; then
1038   echo $ECHO_N "(cached) $ECHO_C" >&6
1039 else
1040   ac_cv_build_alias=$build_alias
1041 test -z "$ac_cv_build_alias" &&
1042   ac_cv_build_alias=`$ac_config_guess`
1043 test -z "$ac_cv_build_alias" &&
1044   { { echo "$as_me:1044: error: cannot guess build type; you must specify one" >&5
1045 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1046    { (exit 1); exit 1; }; }
1047 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1048   { { echo "$as_me:1048: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1049 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1050    { (exit 1); exit 1; }; }
1051
1052 fi
1053 echo "$as_me:1053: result: $ac_cv_build" >&5
1054 echo "${ECHO_T}$ac_cv_build" >&6
1055 build=$ac_cv_build
1056 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1057 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1058 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1059
1060 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1061         echo "$as_me:1061: checking host system type" >&5
1062 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1063 if test "${ac_cv_host+set}" = set; then
1064   echo $ECHO_N "(cached) $ECHO_C" >&6
1065 else
1066   ac_cv_host_alias=$host_alias
1067 test -z "$ac_cv_host_alias" &&
1068   ac_cv_host_alias=$ac_cv_build_alias
1069 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1070   { { echo "$as_me:1070: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1071 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1072    { (exit 1); exit 1; }; }
1073
1074 fi
1075 echo "$as_me:1075: result: $ac_cv_host" >&5
1076 echo "${ECHO_T}$ac_cv_host" >&6
1077 host=$ac_cv_host
1078 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1079 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1080 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1081
1082         system_name="$host_os"
1083 else
1084         system_name="`(uname -s -r) 2>/dev/null`"
1085         if test -z "$system_name" ; then
1086                 system_name="`(hostname) 2>/dev/null`"
1087         fi
1088 fi
1089 test -n "$system_name" &&
1090 cat >>confdefs.h <<EOF
1091 #define SYSTEM_NAME "$system_name"
1092 EOF
1093
1094 if test "${cf_cv_system_name+set}" = set; then
1095   echo $ECHO_N "(cached) $ECHO_C" >&6
1096 else
1097   cf_cv_system_name="$system_name"
1098 fi
1099
1100 test -z "$system_name" && system_name="$cf_cv_system_name"
1101 test -n "$cf_cv_system_name" && echo "$as_me:1101: result: Configuring for $cf_cv_system_name" >&5
1102 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1103
1104 if test ".$system_name" != ".$cf_cv_system_name" ; then
1105         echo "$as_me:1105: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1106 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1107         { { echo "$as_me:1107: error: \"Please remove config.cache and try again.\"" >&5
1108 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1109    { (exit 1); exit 1; }; }
1110 fi
1111
1112 test "$program_prefix" != NONE &&
1113   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1114 # Use a double $ so make ignores it.
1115 test "$program_suffix" != NONE &&
1116   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1117 # Double any \ or $.  echo might interpret backslashes.
1118 # By default was `s,x,x', remove it if useless.
1119 cat <<\_ACEOF >conftest.sed
1120 s/[\\$]/&&/g;s/;s,x,x,$//
1121 _ACEOF
1122 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1123 rm conftest.sed
1124
1125 echo "$as_me:1125: checking whether ${MAKE-make} sets \${MAKE}" >&5
1126 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1127 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1128 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1129   echo $ECHO_N "(cached) $ECHO_C" >&6
1130 else
1131   cat >conftest.make <<\EOF
1132 all:
1133         @echo 'ac_maketemp="${MAKE}"'
1134 EOF
1135 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1136 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1137 if test -n "$ac_maketemp"; then
1138   eval ac_cv_prog_make_${ac_make}_set=yes
1139 else
1140   eval ac_cv_prog_make_${ac_make}_set=no
1141 fi
1142 rm -f conftest.make
1143 fi
1144 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1145   echo "$as_me:1145: result: yes" >&5
1146 echo "${ECHO_T}yes" >&6
1147   SET_MAKE=
1148 else
1149   echo "$as_me:1149: result: no" >&5
1150 echo "${ECHO_T}no" >&6
1151   SET_MAKE="MAKE=${MAKE-make}"
1152 fi
1153
1154 ac_ext=c
1155 ac_cpp='$CPP $CPPFLAGS'
1156 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1157 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1158 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1159 ac_main_return=return
1160 if test -n "$ac_tool_prefix"; then
1161   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1162 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1163 echo "$as_me:1163: checking for $ac_word" >&5
1164 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1165 if test "${ac_cv_prog_CC+set}" = set; then
1166   echo $ECHO_N "(cached) $ECHO_C" >&6
1167 else
1168   if test -n "$CC"; then
1169   ac_cv_prog_CC="$CC" # Let the user override the test.
1170 else
1171   ac_save_IFS=$IFS; IFS=$ac_path_separator
1172 ac_dummy="$PATH"
1173 for ac_dir in $ac_dummy; do
1174   IFS=$ac_save_IFS
1175   test -z "$ac_dir" && ac_dir=.
1176   $as_executable_p "$ac_dir/$ac_word" || continue
1177 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1178 echo "$as_me:1178: found $ac_dir/$ac_word" >&5
1179 break
1180 done
1181
1182 fi
1183 fi
1184 CC=$ac_cv_prog_CC
1185 if test -n "$CC"; then
1186   echo "$as_me:1186: result: $CC" >&5
1187 echo "${ECHO_T}$CC" >&6
1188 else
1189   echo "$as_me:1189: result: no" >&5
1190 echo "${ECHO_T}no" >&6
1191 fi
1192
1193 fi
1194 if test -z "$ac_cv_prog_CC"; then
1195   ac_ct_CC=$CC
1196   # Extract the first word of "gcc", so it can be a program name with args.
1197 set dummy gcc; ac_word=$2
1198 echo "$as_me:1198: checking for $ac_word" >&5
1199 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1200 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1201   echo $ECHO_N "(cached) $ECHO_C" >&6
1202 else
1203   if test -n "$ac_ct_CC"; then
1204   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1205 else
1206   ac_save_IFS=$IFS; IFS=$ac_path_separator
1207 ac_dummy="$PATH"
1208 for ac_dir in $ac_dummy; do
1209   IFS=$ac_save_IFS
1210   test -z "$ac_dir" && ac_dir=.
1211   $as_executable_p "$ac_dir/$ac_word" || continue
1212 ac_cv_prog_ac_ct_CC="gcc"
1213 echo "$as_me:1213: found $ac_dir/$ac_word" >&5
1214 break
1215 done
1216
1217 fi
1218 fi
1219 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1220 if test -n "$ac_ct_CC"; then
1221   echo "$as_me:1221: result: $ac_ct_CC" >&5
1222 echo "${ECHO_T}$ac_ct_CC" >&6
1223 else
1224   echo "$as_me:1224: result: no" >&5
1225 echo "${ECHO_T}no" >&6
1226 fi
1227
1228   CC=$ac_ct_CC
1229 else
1230   CC="$ac_cv_prog_CC"
1231 fi
1232
1233 if test -z "$CC"; then
1234   if test -n "$ac_tool_prefix"; then
1235   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1236 set dummy ${ac_tool_prefix}cc; ac_word=$2
1237 echo "$as_me:1237: checking for $ac_word" >&5
1238 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1239 if test "${ac_cv_prog_CC+set}" = set; then
1240   echo $ECHO_N "(cached) $ECHO_C" >&6
1241 else
1242   if test -n "$CC"; then
1243   ac_cv_prog_CC="$CC" # Let the user override the test.
1244 else
1245   ac_save_IFS=$IFS; IFS=$ac_path_separator
1246 ac_dummy="$PATH"
1247 for ac_dir in $ac_dummy; do
1248   IFS=$ac_save_IFS
1249   test -z "$ac_dir" && ac_dir=.
1250   $as_executable_p "$ac_dir/$ac_word" || continue
1251 ac_cv_prog_CC="${ac_tool_prefix}cc"
1252 echo "$as_me:1252: found $ac_dir/$ac_word" >&5
1253 break
1254 done
1255
1256 fi
1257 fi
1258 CC=$ac_cv_prog_CC
1259 if test -n "$CC"; then
1260   echo "$as_me:1260: result: $CC" >&5
1261 echo "${ECHO_T}$CC" >&6
1262 else
1263   echo "$as_me:1263: result: no" >&5
1264 echo "${ECHO_T}no" >&6
1265 fi
1266
1267 fi
1268 if test -z "$ac_cv_prog_CC"; then
1269   ac_ct_CC=$CC
1270   # Extract the first word of "cc", so it can be a program name with args.
1271 set dummy cc; ac_word=$2
1272 echo "$as_me:1272: checking for $ac_word" >&5
1273 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1274 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1275   echo $ECHO_N "(cached) $ECHO_C" >&6
1276 else
1277   if test -n "$ac_ct_CC"; then
1278   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1279 else
1280   ac_save_IFS=$IFS; IFS=$ac_path_separator
1281 ac_dummy="$PATH"
1282 for ac_dir in $ac_dummy; do
1283   IFS=$ac_save_IFS
1284   test -z "$ac_dir" && ac_dir=.
1285   $as_executable_p "$ac_dir/$ac_word" || continue
1286 ac_cv_prog_ac_ct_CC="cc"
1287 echo "$as_me:1287: found $ac_dir/$ac_word" >&5
1288 break
1289 done
1290
1291 fi
1292 fi
1293 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1294 if test -n "$ac_ct_CC"; then
1295   echo "$as_me:1295: result: $ac_ct_CC" >&5
1296 echo "${ECHO_T}$ac_ct_CC" >&6
1297 else
1298   echo "$as_me:1298: result: no" >&5
1299 echo "${ECHO_T}no" >&6
1300 fi
1301
1302   CC=$ac_ct_CC
1303 else
1304   CC="$ac_cv_prog_CC"
1305 fi
1306
1307 fi
1308 if test -z "$CC"; then
1309   # Extract the first word of "cc", so it can be a program name with args.
1310 set dummy cc; ac_word=$2
1311 echo "$as_me:1311: checking for $ac_word" >&5
1312 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1313 if test "${ac_cv_prog_CC+set}" = set; then
1314   echo $ECHO_N "(cached) $ECHO_C" >&6
1315 else
1316   if test -n "$CC"; then
1317   ac_cv_prog_CC="$CC" # Let the user override the test.
1318 else
1319   ac_prog_rejected=no
1320   ac_save_IFS=$IFS; IFS=$ac_path_separator
1321 ac_dummy="$PATH"
1322 for ac_dir in $ac_dummy; do
1323   IFS=$ac_save_IFS
1324   test -z "$ac_dir" && ac_dir=.
1325   $as_executable_p "$ac_dir/$ac_word" || continue
1326 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1327   ac_prog_rejected=yes
1328   continue
1329 fi
1330 ac_cv_prog_CC="cc"
1331 echo "$as_me:1331: found $ac_dir/$ac_word" >&5
1332 break
1333 done
1334
1335 if test $ac_prog_rejected = yes; then
1336   # We found a bogon in the path, so make sure we never use it.
1337   set dummy $ac_cv_prog_CC
1338   shift
1339   if test $# != 0; then
1340     # We chose a different compiler from the bogus one.
1341     # However, it has the same basename, so the bogon will be chosen
1342     # first if we set CC to just the basename; use the full file name.
1343     shift
1344     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1345     shift
1346     ac_cv_prog_CC="$@"
1347   fi
1348 fi
1349 fi
1350 fi
1351 CC=$ac_cv_prog_CC
1352 if test -n "$CC"; then
1353   echo "$as_me:1353: result: $CC" >&5
1354 echo "${ECHO_T}$CC" >&6
1355 else
1356   echo "$as_me:1356: result: no" >&5
1357 echo "${ECHO_T}no" >&6
1358 fi
1359
1360 fi
1361 if test -z "$CC"; then
1362   if test -n "$ac_tool_prefix"; then
1363   for ac_prog in cl
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in cl
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 fi
1443
1444 test -z "$CC" && { { echo "$as_me:1444: error: no acceptable cc found in \$PATH" >&5
1445 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1446    { (exit 1); exit 1; }; }
1447
1448 # Provide some information about the compiler.
1449 echo "$as_me:1449:" \
1450      "checking for C compiler version" >&5
1451 ac_compiler=`set X $ac_compile; echo $2`
1452 { (eval echo "$as_me:1452: \"$ac_compiler --version </dev/null >&5\"") >&5
1453   (eval $ac_compiler --version </dev/null >&5) 2>&5
1454   ac_status=$?
1455   echo "$as_me:1455: \$? = $ac_status" >&5
1456   (exit $ac_status); }
1457 { (eval echo "$as_me:1457: \"$ac_compiler -v </dev/null >&5\"") >&5
1458   (eval $ac_compiler -v </dev/null >&5) 2>&5
1459   ac_status=$?
1460   echo "$as_me:1460: \$? = $ac_status" >&5
1461   (exit $ac_status); }
1462 { (eval echo "$as_me:1462: \"$ac_compiler -V </dev/null >&5\"") >&5
1463   (eval $ac_compiler -V </dev/null >&5) 2>&5
1464   ac_status=$?
1465   echo "$as_me:1465: \$? = $ac_status" >&5
1466   (exit $ac_status); }
1467
1468 cat >conftest.$ac_ext <<_ACEOF
1469 #line 1469 "configure"
1470 #include "confdefs.h"
1471
1472 int
1473 main (void)
1474 {
1475
1476   ;
1477   return 0;
1478 }
1479 _ACEOF
1480 ac_clean_files_save=$ac_clean_files
1481 ac_clean_files="$ac_clean_files a.out a.exe"
1482 # Try to create an executable without -o first, disregard a.out.
1483 # It will help us diagnose broken compilers, and finding out an intuition
1484 # of exeext.
1485 echo "$as_me:1485: checking for C compiler default output" >&5
1486 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1487 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1488 if { (eval echo "$as_me:1488: \"$ac_link_default\"") >&5
1489   (eval $ac_link_default) 2>&5
1490   ac_status=$?
1491   echo "$as_me:1491: \$? = $ac_status" >&5
1492   (exit $ac_status); }; then
1493   # Find the output, starting from the most likely.  This scheme is
1494 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1495 # resort.
1496 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1497                 ls a.out conftest 2>/dev/null;
1498                 ls a.* conftest.* 2>/dev/null`; do
1499   case $ac_file in
1500     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1501     a.out ) # We found the default executable, but exeext='' is most
1502             # certainly right.
1503             break;;
1504     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1505           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1506           export ac_cv_exeext
1507           break;;
1508     * ) break;;
1509   esac
1510 done
1511 else
1512   echo "$as_me: failed program was:" >&5
1513 cat conftest.$ac_ext >&5
1514 { { echo "$as_me:1514: error: C compiler cannot create executables" >&5
1515 echo "$as_me: error: C compiler cannot create executables" >&2;}
1516    { (exit 77); exit 77; }; }
1517 fi
1518
1519 ac_exeext=$ac_cv_exeext
1520 echo "$as_me:1520: result: $ac_file" >&5
1521 echo "${ECHO_T}$ac_file" >&6
1522
1523 # Check the compiler produces executables we can run.  If not, either
1524 # the compiler is broken, or we cross compile.
1525 echo "$as_me:1525: checking whether the C compiler works" >&5
1526 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1527 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1528 # If not cross compiling, check that we can run a simple program.
1529 if test "$cross_compiling" != yes; then
1530   if { ac_try='./$ac_file'
1531   { (eval echo "$as_me:1531: \"$ac_try\"") >&5
1532   (eval $ac_try) 2>&5
1533   ac_status=$?
1534   echo "$as_me:1534: \$? = $ac_status" >&5
1535   (exit $ac_status); }; }; then
1536     cross_compiling=no
1537   else
1538     if test "$cross_compiling" = maybe; then
1539         cross_compiling=yes
1540     else
1541         { { echo "$as_me:1541: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&5
1543 echo "$as_me: error: cannot run C compiled programs.
1544 If you meant to cross compile, use \`--host'." >&2;}
1545    { (exit 1); exit 1; }; }
1546     fi
1547   fi
1548 fi
1549 echo "$as_me:1549: result: yes" >&5
1550 echo "${ECHO_T}yes" >&6
1551
1552 rm -f a.out a.exe conftest$ac_cv_exeext
1553 ac_clean_files=$ac_clean_files_save
1554 # Check the compiler produces executables we can run.  If not, either
1555 # the compiler is broken, or we cross compile.
1556 echo "$as_me:1556: checking whether we are cross compiling" >&5
1557 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1558 echo "$as_me:1558: result: $cross_compiling" >&5
1559 echo "${ECHO_T}$cross_compiling" >&6
1560
1561 echo "$as_me:1561: checking for executable suffix" >&5
1562 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1563 if { (eval echo "$as_me:1563: \"$ac_link\"") >&5
1564   (eval $ac_link) 2>&5
1565   ac_status=$?
1566   echo "$as_me:1566: \$? = $ac_status" >&5
1567   (exit $ac_status); }; then
1568   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1569 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1570 # work properly (i.e., refer to `conftest.exe'), while it won't with
1571 # `rm'.
1572 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1573   case $ac_file in
1574     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1575     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1576           export ac_cv_exeext
1577           break;;
1578     * ) break;;
1579   esac
1580 done
1581 else
1582   { { echo "$as_me:1582: error: cannot compute EXEEXT: cannot compile and link" >&5
1583 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1584    { (exit 1); exit 1; }; }
1585 fi
1586
1587 rm -f conftest$ac_cv_exeext
1588 echo "$as_me:1588: result: $ac_cv_exeext" >&5
1589 echo "${ECHO_T}$ac_cv_exeext" >&6
1590
1591 rm -f conftest.$ac_ext
1592 EXEEXT=$ac_cv_exeext
1593 ac_exeext=$EXEEXT
1594 echo "$as_me:1594: checking for object suffix" >&5
1595 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1596 if test "${ac_cv_objext+set}" = set; then
1597   echo $ECHO_N "(cached) $ECHO_C" >&6
1598 else
1599   cat >conftest.$ac_ext <<_ACEOF
1600 #line 1600 "configure"
1601 #include "confdefs.h"
1602
1603 int
1604 main (void)
1605 {
1606
1607   ;
1608   return 0;
1609 }
1610 _ACEOF
1611 rm -f conftest.o conftest.obj
1612 if { (eval echo "$as_me:1612: \"$ac_compile\"") >&5
1613   (eval $ac_compile) 2>&5
1614   ac_status=$?
1615   echo "$as_me:1615: \$? = $ac_status" >&5
1616   (exit $ac_status); }; then
1617   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1618   case $ac_file in
1619     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1620     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1621        break;;
1622   esac
1623 done
1624 else
1625   echo "$as_me: failed program was:" >&5
1626 cat conftest.$ac_ext >&5
1627 { { echo "$as_me:1627: error: cannot compute OBJEXT: cannot compile" >&5
1628 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1629    { (exit 1); exit 1; }; }
1630 fi
1631
1632 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1633 fi
1634 echo "$as_me:1634: result: $ac_cv_objext" >&5
1635 echo "${ECHO_T}$ac_cv_objext" >&6
1636 OBJEXT=$ac_cv_objext
1637 ac_objext=$OBJEXT
1638 echo "$as_me:1638: checking whether we are using the GNU C compiler" >&5
1639 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1640 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1641   echo $ECHO_N "(cached) $ECHO_C" >&6
1642 else
1643   cat >conftest.$ac_ext <<_ACEOF
1644 #line 1644 "configure"
1645 #include "confdefs.h"
1646
1647 int
1648 main (void)
1649 {
1650 #ifndef __GNUC__
1651        choke me
1652 #endif
1653
1654   ;
1655   return 0;
1656 }
1657 _ACEOF
1658 rm -f conftest.$ac_objext
1659 if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5
1660   (eval $ac_compile) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit $ac_status); } &&
1664          { ac_try='test -s conftest.$ac_objext'
1665   { (eval echo "$as_me:1665: \"$ac_try\"") >&5
1666   (eval $ac_try) 2>&5
1667   ac_status=$?
1668   echo "$as_me:1668: \$? = $ac_status" >&5
1669   (exit $ac_status); }; }; then
1670   ac_compiler_gnu=yes
1671 else
1672   echo "$as_me: failed program was:" >&5
1673 cat conftest.$ac_ext >&5
1674 ac_compiler_gnu=no
1675 fi
1676 rm -f conftest.$ac_objext conftest.$ac_ext
1677 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1678
1679 fi
1680 echo "$as_me:1680: result: $ac_cv_c_compiler_gnu" >&5
1681 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1682 GCC=`test $ac_compiler_gnu = yes && echo yes`
1683 ac_test_CFLAGS=${CFLAGS+set}
1684 ac_save_CFLAGS=$CFLAGS
1685 CFLAGS="-g"
1686 echo "$as_me:1686: checking whether $CC accepts -g" >&5
1687 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1688 if test "${ac_cv_prog_cc_g+set}" = set; then
1689   echo $ECHO_N "(cached) $ECHO_C" >&6
1690 else
1691   cat >conftest.$ac_ext <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694
1695 int
1696 main (void)
1697 {
1698
1699   ;
1700   return 0;
1701 }
1702 _ACEOF
1703 rm -f conftest.$ac_objext
1704 if { (eval echo "$as_me:1704: \"$ac_compile\"") >&5
1705   (eval $ac_compile) 2>&5
1706   ac_status=$?
1707   echo "$as_me:1707: \$? = $ac_status" >&5
1708   (exit $ac_status); } &&
1709          { ac_try='test -s conftest.$ac_objext'
1710   { (eval echo "$as_me:1710: \"$ac_try\"") >&5
1711   (eval $ac_try) 2>&5
1712   ac_status=$?
1713   echo "$as_me:1713: \$? = $ac_status" >&5
1714   (exit $ac_status); }; }; then
1715   ac_cv_prog_cc_g=yes
1716 else
1717   echo "$as_me: failed program was:" >&5
1718 cat conftest.$ac_ext >&5
1719 ac_cv_prog_cc_g=no
1720 fi
1721 rm -f conftest.$ac_objext conftest.$ac_ext
1722 fi
1723 echo "$as_me:1723: result: $ac_cv_prog_cc_g" >&5
1724 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1725 if test "$ac_test_CFLAGS" = set; then
1726   CFLAGS=$ac_save_CFLAGS
1727 elif test $ac_cv_prog_cc_g = yes; then
1728   if test "$GCC" = yes; then
1729     CFLAGS="-g -O2"
1730   else
1731     CFLAGS="-g"
1732   fi
1733 else
1734   if test "$GCC" = yes; then
1735     CFLAGS="-O2"
1736   else
1737     CFLAGS=
1738   fi
1739 fi
1740 # Some people use a C++ compiler to compile C.  Since we use `exit',
1741 # in C++ we need to declare it.  In case someone uses the same compiler
1742 # for both compiling C and C++ we need to have the C++ compiler decide
1743 # the declaration of exit, since it's the most demanding environment.
1744 cat >conftest.$ac_ext <<_ACEOF
1745 #ifndef __cplusplus
1746   choke me
1747 #endif
1748 _ACEOF
1749 rm -f conftest.$ac_objext
1750 if { (eval echo "$as_me:1750: \"$ac_compile\"") >&5
1751   (eval $ac_compile) 2>&5
1752   ac_status=$?
1753   echo "$as_me:1753: \$? = $ac_status" >&5
1754   (exit $ac_status); } &&
1755          { ac_try='test -s conftest.$ac_objext'
1756   { (eval echo "$as_me:1756: \"$ac_try\"") >&5
1757   (eval $ac_try) 2>&5
1758   ac_status=$?
1759   echo "$as_me:1759: \$? = $ac_status" >&5
1760   (exit $ac_status); }; }; then
1761   for ac_declaration in \
1762    ''\
1763    '#include <stdlib.h>' \
1764    'extern "C" void std::exit (int) throw (); using std::exit;' \
1765    'extern "C" void std::exit (int); using std::exit;' \
1766    'extern "C" void exit (int) throw ();' \
1767    'extern "C" void exit (int);' \
1768    'void exit (int);'
1769 do
1770   cat >conftest.$ac_ext <<_ACEOF
1771 #line 1771 "configure"
1772 #include "confdefs.h"
1773 #include <stdlib.h>
1774 $ac_declaration
1775 int
1776 main (void)
1777 {
1778 exit (42);
1779   ;
1780   return 0;
1781 }
1782 _ACEOF
1783 rm -f conftest.$ac_objext
1784 if { (eval echo "$as_me:1784: \"$ac_compile\"") >&5
1785   (eval $ac_compile) 2>&5
1786   ac_status=$?
1787   echo "$as_me:1787: \$? = $ac_status" >&5
1788   (exit $ac_status); } &&
1789          { ac_try='test -s conftest.$ac_objext'
1790   { (eval echo "$as_me:1790: \"$ac_try\"") >&5
1791   (eval $ac_try) 2>&5
1792   ac_status=$?
1793   echo "$as_me:1793: \$? = $ac_status" >&5
1794   (exit $ac_status); }; }; then
1795   :
1796 else
1797   echo "$as_me: failed program was:" >&5
1798 cat conftest.$ac_ext >&5
1799 continue
1800 fi
1801 rm -f conftest.$ac_objext conftest.$ac_ext
1802   cat >conftest.$ac_ext <<_ACEOF
1803 #line 1803 "configure"
1804 #include "confdefs.h"
1805 $ac_declaration
1806 int
1807 main (void)
1808 {
1809 exit (42);
1810   ;
1811   return 0;
1812 }
1813 _ACEOF
1814 rm -f conftest.$ac_objext
1815 if { (eval echo "$as_me:1815: \"$ac_compile\"") >&5
1816   (eval $ac_compile) 2>&5
1817   ac_status=$?
1818   echo "$as_me:1818: \$? = $ac_status" >&5
1819   (exit $ac_status); } &&
1820          { ac_try='test -s conftest.$ac_objext'
1821   { (eval echo "$as_me:1821: \"$ac_try\"") >&5
1822   (eval $ac_try) 2>&5
1823   ac_status=$?
1824   echo "$as_me:1824: \$? = $ac_status" >&5
1825   (exit $ac_status); }; }; then
1826   break
1827 else
1828   echo "$as_me: failed program was:" >&5
1829 cat conftest.$ac_ext >&5
1830 fi
1831 rm -f conftest.$ac_objext conftest.$ac_ext
1832 done
1833 rm -rf conftest*
1834 if test -n "$ac_declaration"; then
1835   echo '#ifdef __cplusplus' >>confdefs.h
1836   echo $ac_declaration      >>confdefs.h
1837   echo '#endif'             >>confdefs.h
1838 fi
1839
1840 else
1841   echo "$as_me: failed program was:" >&5
1842 cat conftest.$ac_ext >&5
1843 fi
1844 rm -f conftest.$ac_objext conftest.$ac_ext
1845 ac_ext=c
1846 ac_cpp='$CPP $CPPFLAGS'
1847 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1848 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1849 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1850 ac_main_return=return
1851
1852 GCC_VERSION=none
1853 if test "$GCC" = yes ; then
1854         echo "$as_me:1854: checking version of $CC" >&5
1855 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1856         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1857         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1858         echo "$as_me:1858: result: $GCC_VERSION" >&5
1859 echo "${ECHO_T}$GCC_VERSION" >&6
1860 fi
1861
1862 INTEL_COMPILER=no
1863
1864 if test "$GCC" = yes ; then
1865         case $host_os in
1866         (linux*|gnu*)
1867                 echo "$as_me:1867: checking if this is really Intel C compiler" >&5
1868 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1869                 cf_save_CFLAGS="$CFLAGS"
1870                 CFLAGS="$CFLAGS -no-gcc"
1871                 cat >conftest.$ac_ext <<_ACEOF
1872 #line 1872 "configure"
1873 #include "confdefs.h"
1874
1875 int
1876 main (void)
1877 {
1878
1879 #ifdef __INTEL_COMPILER
1880 #else
1881 make an error
1882 #endif
1883
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 rm -f conftest.$ac_objext
1889 if { (eval echo "$as_me:1889: \"$ac_compile\"") >&5
1890   (eval $ac_compile) 2>&5
1891   ac_status=$?
1892   echo "$as_me:1892: \$? = $ac_status" >&5
1893   (exit $ac_status); } &&
1894          { ac_try='test -s conftest.$ac_objext'
1895   { (eval echo "$as_me:1895: \"$ac_try\"") >&5
1896   (eval $ac_try) 2>&5
1897   ac_status=$?
1898   echo "$as_me:1898: \$? = $ac_status" >&5
1899   (exit $ac_status); }; }; then
1900   INTEL_COMPILER=yes
1901 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1902
1903 else
1904   echo "$as_me: failed program was:" >&5
1905 cat conftest.$ac_ext >&5
1906 fi
1907 rm -f conftest.$ac_objext conftest.$ac_ext
1908                 CFLAGS="$cf_save_CFLAGS"
1909                 echo "$as_me:1909: result: $INTEL_COMPILER" >&5
1910 echo "${ECHO_T}$INTEL_COMPILER" >&6
1911                 ;;
1912         esac
1913 fi
1914
1915 CLANG_COMPILER=no
1916
1917 if test "$GCC" = yes ; then
1918         echo "$as_me:1918: checking if this is really Clang C compiler" >&5
1919 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1920         cf_save_CFLAGS="$CFLAGS"
1921         CFLAGS="$CFLAGS -Qunused-arguments"
1922         cat >conftest.$ac_ext <<_ACEOF
1923 #line 1923 "configure"
1924 #include "confdefs.h"
1925
1926 int
1927 main (void)
1928 {
1929
1930 #ifdef __clang__
1931 #else
1932 make an error
1933 #endif
1934
1935   ;
1936   return 0;
1937 }
1938 _ACEOF
1939 rm -f conftest.$ac_objext
1940 if { (eval echo "$as_me:1940: \"$ac_compile\"") >&5
1941   (eval $ac_compile) 2>&5
1942   ac_status=$?
1943   echo "$as_me:1943: \$? = $ac_status" >&5
1944   (exit $ac_status); } &&
1945          { ac_try='test -s conftest.$ac_objext'
1946   { (eval echo "$as_me:1946: \"$ac_try\"") >&5
1947   (eval $ac_try) 2>&5
1948   ac_status=$?
1949   echo "$as_me:1949: \$? = $ac_status" >&5
1950   (exit $ac_status); }; }; then
1951   CLANG_COMPILER=yes
1952 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
1953
1954 else
1955   echo "$as_me: failed program was:" >&5
1956 cat conftest.$ac_ext >&5
1957 fi
1958 rm -f conftest.$ac_objext conftest.$ac_ext
1959         CFLAGS="$cf_save_CFLAGS"
1960         echo "$as_me:1960: result: $CLANG_COMPILER" >&5
1961 echo "${ECHO_T}$CLANG_COMPILER" >&6
1962 fi
1963
1964 if test "x$CLANG_COMPILER" = "xyes" ; then
1965
1966         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
1967         CFLAGS="${CFLAGS}-Wno-error=implicit-function-declaration"
1968
1969 fi
1970
1971 echo "$as_me:1971: checking for $CC option to accept ANSI C" >&5
1972 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1973 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1974   echo $ECHO_N "(cached) $ECHO_C" >&6
1975 else
1976   ac_cv_prog_cc_stdc=no
1977 ac_save_CC=$CC
1978 cat >conftest.$ac_ext <<_ACEOF
1979 #line 1979 "configure"
1980 #include "confdefs.h"
1981 #include <stdarg.h>
1982 #include <stdio.h>
1983 #include <sys/types.h>
1984 #include <sys/stat.h>
1985 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1986 struct buf { int x; };
1987 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1988 static char *e (p, i)
1989      char **p;
1990      int i;
1991 {
1992   return p[i];
1993 }
1994 static char *f (char * (*g) (char **, int), char **p, ...)
1995 {
1996   char *s;
1997   va_list v;
1998   va_start (v,p);
1999   s = g (p, va_arg (v,int));
2000   va_end (v);
2001   return s;
2002 }
2003 int test (int i, double x);
2004 struct s1 {int (*f) (int a);};
2005 struct s2 {int (*f) (double a);};
2006 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2007 int argc;
2008 char **argv;
2009 int
2010 main (void)
2011 {
2012 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2013   ;
2014   return 0;
2015 }
2016 _ACEOF
2017 # Don't try gcc -ansi; that turns off useful extensions and
2018 # breaks some systems' header files.
2019 # AIX                   -qlanglvl=ansi
2020 # Ultrix and OSF/1      -std1
2021 # HP-UX 10.20 and later -Ae
2022 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2023 # SVR4                  -Xc -D__EXTENSIONS__
2024 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2025 do
2026   CC="$ac_save_CC $ac_arg"
2027   rm -f conftest.$ac_objext
2028 if { (eval echo "$as_me:2028: \"$ac_compile\"") >&5
2029   (eval $ac_compile) 2>&5
2030   ac_status=$?
2031   echo "$as_me:2031: \$? = $ac_status" >&5
2032   (exit $ac_status); } &&
2033          { ac_try='test -s conftest.$ac_objext'
2034   { (eval echo "$as_me:2034: \"$ac_try\"") >&5
2035   (eval $ac_try) 2>&5
2036   ac_status=$?
2037   echo "$as_me:2037: \$? = $ac_status" >&5
2038   (exit $ac_status); }; }; then
2039   ac_cv_prog_cc_stdc=$ac_arg
2040 break
2041 else
2042   echo "$as_me: failed program was:" >&5
2043 cat conftest.$ac_ext >&5
2044 fi
2045 rm -f conftest.$ac_objext
2046 done
2047 rm -f conftest.$ac_ext conftest.$ac_objext
2048 CC=$ac_save_CC
2049
2050 fi
2051
2052 case "x$ac_cv_prog_cc_stdc" in
2053   x|xno)
2054     echo "$as_me:2054: result: none needed" >&5
2055 echo "${ECHO_T}none needed" >&6 ;;
2056   *)
2057     echo "$as_me:2057: result: $ac_cv_prog_cc_stdc" >&5
2058 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2059     CC="$CC $ac_cv_prog_cc_stdc" ;;
2060 esac
2061
2062 # This should have been defined by AC_PROG_CC
2063 : ${CC:=cc}
2064
2065 echo "$as_me:2065: checking \$CFLAGS variable" >&5
2066 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2067 case "x$CFLAGS" in
2068 (*-[IUD]*)
2069         echo "$as_me:2069: result: broken" >&5
2070 echo "${ECHO_T}broken" >&6
2071         { echo "$as_me:2071: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2072 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2073         cf_flags="$CFLAGS"
2074         CFLAGS=
2075         for cf_arg in $cf_flags
2076         do
2077
2078 cf_fix_cppflags=no
2079 cf_new_cflags=
2080 cf_new_cppflags=
2081 cf_new_extra_cppflags=
2082
2083 for cf_add_cflags in $cf_arg
2084 do
2085 case $cf_fix_cppflags in
2086 (no)
2087         case $cf_add_cflags in
2088         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2089                 case $cf_add_cflags in
2090                 (-D*)
2091                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2092
2093                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2094                                 && test -z "${cf_tst_cflags}" \
2095                                 && cf_fix_cppflags=yes
2096
2097                         if test $cf_fix_cppflags = yes ; then
2098
2099         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2100         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2101
2102                                 continue
2103                         elif test "${cf_tst_cflags}" = "\"'" ; then
2104
2105         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2106         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2107
2108                                 continue
2109                         fi
2110                         ;;
2111                 esac
2112                 case "$CPPFLAGS" in
2113                 (*$cf_add_cflags)
2114                         ;;
2115                 (*)
2116                         case $cf_add_cflags in
2117                         (-D*)
2118                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2119
2120 CPPFLAGS=`echo "$CPPFLAGS" | \
2121         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2122                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2123
2124                                 ;;
2125                         esac
2126
2127         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2128         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2129
2130                         ;;
2131                 esac
2132                 ;;
2133         (*)
2134
2135         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2136         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2137
2138                 ;;
2139         esac
2140         ;;
2141 (yes)
2142
2143         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2144         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2145
2146         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2147
2148         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2149                 && test -z "${cf_tst_cflags}" \
2150                 && cf_fix_cppflags=no
2151         ;;
2152 esac
2153 done
2154
2155 if test -n "$cf_new_cflags" ; then
2156
2157         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2158         CFLAGS="${CFLAGS}$cf_new_cflags"
2159
2160 fi
2161
2162 if test -n "$cf_new_cppflags" ; then
2163
2164         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2165         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2166
2167 fi
2168
2169 if test -n "$cf_new_extra_cppflags" ; then
2170
2171         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2172         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2173
2174 fi
2175
2176         done
2177         ;;
2178 (*)
2179         echo "$as_me:2179: result: ok" >&5
2180 echo "${ECHO_T}ok" >&6
2181         ;;
2182 esac
2183
2184 echo "$as_me:2184: checking \$CC variable" >&5
2185 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2186 case "$CC" in
2187 (*[\ \  ]-*)
2188         echo "$as_me:2188: result: broken" >&5
2189 echo "${ECHO_T}broken" >&6
2190         { echo "$as_me:2190: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2191 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2192         # humor him...
2193         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2194         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2195         CC="$cf_prog"
2196         for cf_arg in $cf_flags
2197         do
2198                 case "x$cf_arg" in
2199                 (x-[IUDfgOW]*)
2200
2201 cf_fix_cppflags=no
2202 cf_new_cflags=
2203 cf_new_cppflags=
2204 cf_new_extra_cppflags=
2205
2206 for cf_add_cflags in $cf_arg
2207 do
2208 case $cf_fix_cppflags in
2209 (no)
2210         case $cf_add_cflags in
2211         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2212                 case $cf_add_cflags in
2213                 (-D*)
2214                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2215
2216                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2217                                 && test -z "${cf_tst_cflags}" \
2218                                 && cf_fix_cppflags=yes
2219
2220                         if test $cf_fix_cppflags = yes ; then
2221
2222         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2223         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2224
2225                                 continue
2226                         elif test "${cf_tst_cflags}" = "\"'" ; then
2227
2228         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2229         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2230
2231                                 continue
2232                         fi
2233                         ;;
2234                 esac
2235                 case "$CPPFLAGS" in
2236                 (*$cf_add_cflags)
2237                         ;;
2238                 (*)
2239                         case $cf_add_cflags in
2240                         (-D*)
2241                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2242
2243 CPPFLAGS=`echo "$CPPFLAGS" | \
2244         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2245                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2246
2247                                 ;;
2248                         esac
2249
2250         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2251         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2252
2253                         ;;
2254                 esac
2255                 ;;
2256         (*)
2257
2258         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2259         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2260
2261                 ;;
2262         esac
2263         ;;
2264 (yes)
2265
2266         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2267         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2268
2269         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2270
2271         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2272                 && test -z "${cf_tst_cflags}" \
2273                 && cf_fix_cppflags=no
2274         ;;
2275 esac
2276 done
2277
2278 if test -n "$cf_new_cflags" ; then
2279
2280         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2281         CFLAGS="${CFLAGS}$cf_new_cflags"
2282
2283 fi
2284
2285 if test -n "$cf_new_cppflags" ; then
2286
2287         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2288         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2289
2290 fi
2291
2292 if test -n "$cf_new_extra_cppflags" ; then
2293
2294         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2295         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2296
2297 fi
2298
2299                         ;;
2300                 (*)
2301                         CC="$CC $cf_arg"
2302                         ;;
2303                 esac
2304         done
2305         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2306
2307 echo "${as_me:-configure}:2307: testing resulting CC: '$CC' ..." 1>&5
2308
2309         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2310
2311 echo "${as_me:-configure}:2311: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2312
2313         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2314
2315 echo "${as_me:-configure}:2315: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2316
2317         ;;
2318 (*)
2319         echo "$as_me:2319: result: ok" >&5
2320 echo "${ECHO_T}ok" >&6
2321         ;;
2322 esac
2323
2324 echo "$as_me:2324: checking for inline" >&5
2325 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2326 if test "${ac_cv_c_inline+set}" = set; then
2327   echo $ECHO_N "(cached) $ECHO_C" >&6
2328 else
2329   ac_cv_c_inline=no
2330 for ac_kw in inline __inline__ __inline; do
2331   cat >conftest.$ac_ext <<_ACEOF
2332 #line 2332 "configure"
2333 #include "confdefs.h"
2334 #ifndef __cplusplus
2335 static $ac_kw int static_foo () {return 0; }
2336 $ac_kw int foo () {return 0; }
2337 #endif
2338
2339 _ACEOF
2340 rm -f conftest.$ac_objext
2341 if { (eval echo "$as_me:2341: \"$ac_compile\"") >&5
2342   (eval $ac_compile) 2>&5
2343   ac_status=$?
2344   echo "$as_me:2344: \$? = $ac_status" >&5
2345   (exit $ac_status); } &&
2346          { ac_try='test -s conftest.$ac_objext'
2347   { (eval echo "$as_me:2347: \"$ac_try\"") >&5
2348   (eval $ac_try) 2>&5
2349   ac_status=$?
2350   echo "$as_me:2350: \$? = $ac_status" >&5
2351   (exit $ac_status); }; }; then
2352   ac_cv_c_inline=$ac_kw; break
2353 else
2354   echo "$as_me: failed program was:" >&5
2355 cat conftest.$ac_ext >&5
2356 fi
2357 rm -f conftest.$ac_objext conftest.$ac_ext
2358 done
2359
2360 fi
2361 echo "$as_me:2361: result: $ac_cv_c_inline" >&5
2362 echo "${ECHO_T}$ac_cv_c_inline" >&6
2363 case $ac_cv_c_inline in
2364   inline | yes) ;;
2365   no)
2366 cat >>confdefs.h <<\EOF
2367 #define inline
2368 EOF
2369  ;;
2370   *)  cat >>confdefs.h <<EOF
2371 #define inline $ac_cv_c_inline
2372 EOF
2373  ;;
2374 esac
2375
2376 ac_ext=c
2377 ac_cpp='$CPP $CPPFLAGS'
2378 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2379 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2380 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2381 ac_main_return=return
2382 echo "$as_me:2382: checking how to run the C preprocessor" >&5
2383 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2384 # On Suns, sometimes $CPP names a directory.
2385 if test -n "$CPP" && test -d "$CPP"; then
2386   CPP=
2387 fi
2388 if test -z "$CPP"; then
2389   if test "${ac_cv_prog_CPP+set}" = set; then
2390   echo $ECHO_N "(cached) $ECHO_C" >&6
2391 else
2392       # Double quotes because CPP needs to be expanded
2393     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2394     do
2395       ac_preproc_ok=false
2396 for ac_c_preproc_warn_flag in '' yes
2397 do
2398   # Use a header file that comes with gcc, so configuring glibc
2399   # with a fresh cross-compiler works.
2400   # On the NeXT, cc -E runs the code through the compiler's parser,
2401   # not just through cpp. "Syntax error" is here to catch this case.
2402   cat >conftest.$ac_ext <<_ACEOF
2403 #line 2403 "configure"
2404 #include "confdefs.h"
2405 #include <assert.h>
2406                      Syntax error
2407 _ACEOF
2408 if { (eval echo "$as_me:2408: \"$ac_cpp conftest.$ac_ext\"") >&5
2409   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2410   ac_status=$?
2411   egrep -v '^ *\+' conftest.er1 >conftest.err
2412   rm -f conftest.er1
2413   cat conftest.err >&5
2414   echo "$as_me:2414: \$? = $ac_status" >&5
2415   (exit $ac_status); } >/dev/null; then
2416   if test -s conftest.err; then
2417     ac_cpp_err=$ac_c_preproc_warn_flag
2418   else
2419     ac_cpp_err=
2420   fi
2421 else
2422   ac_cpp_err=yes
2423 fi
2424 if test -z "$ac_cpp_err"; then
2425   :
2426 else
2427   echo "$as_me: failed program was:" >&5
2428   cat conftest.$ac_ext >&5
2429   # Broken: fails on valid input.
2430 continue
2431 fi
2432 rm -f conftest.err conftest.$ac_ext
2433
2434   # OK, works on sane cases.  Now check whether non-existent headers
2435   # can be detected and how.
2436   cat >conftest.$ac_ext <<_ACEOF
2437 #line 2437 "configure"
2438 #include "confdefs.h"
2439 #include <ac_nonexistent.h>
2440 _ACEOF
2441 if { (eval echo "$as_me:2441: \"$ac_cpp conftest.$ac_ext\"") >&5
2442   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2443   ac_status=$?
2444   egrep -v '^ *\+' conftest.er1 >conftest.err
2445   rm -f conftest.er1
2446   cat conftest.err >&5
2447   echo "$as_me:2447: \$? = $ac_status" >&5
2448   (exit $ac_status); } >/dev/null; then
2449   if test -s conftest.err; then
2450     ac_cpp_err=$ac_c_preproc_warn_flag
2451   else
2452     ac_cpp_err=
2453   fi
2454 else
2455   ac_cpp_err=yes
2456 fi
2457 if test -z "$ac_cpp_err"; then
2458   # Broken: success on invalid input.
2459 continue
2460 else
2461   echo "$as_me: failed program was:" >&5
2462   cat conftest.$ac_ext >&5
2463   # Passes both tests.
2464 ac_preproc_ok=:
2465 break
2466 fi
2467 rm -f conftest.err conftest.$ac_ext
2468
2469 done
2470 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2471 rm -f conftest.err conftest.$ac_ext
2472 if $ac_preproc_ok; then
2473   break
2474 fi
2475
2476     done
2477     ac_cv_prog_CPP=$CPP
2478
2479 fi
2480   CPP=$ac_cv_prog_CPP
2481 else
2482   ac_cv_prog_CPP=$CPP
2483 fi
2484 echo "$as_me:2484: result: $CPP" >&5
2485 echo "${ECHO_T}$CPP" >&6
2486 ac_preproc_ok=false
2487 for ac_c_preproc_warn_flag in '' yes
2488 do
2489   # Use a header file that comes with gcc, so configuring glibc
2490   # with a fresh cross-compiler works.
2491   # On the NeXT, cc -E runs the code through the compiler's parser,
2492   # not just through cpp. "Syntax error" is here to catch this case.
2493   cat >conftest.$ac_ext <<_ACEOF
2494 #line 2494 "configure"
2495 #include "confdefs.h"
2496 #include <assert.h>
2497                      Syntax error
2498 _ACEOF
2499 if { (eval echo "$as_me:2499: \"$ac_cpp conftest.$ac_ext\"") >&5
2500   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2501   ac_status=$?
2502   egrep -v '^ *\+' conftest.er1 >conftest.err
2503   rm -f conftest.er1
2504   cat conftest.err >&5
2505   echo "$as_me:2505: \$? = $ac_status" >&5
2506   (exit $ac_status); } >/dev/null; then
2507   if test -s conftest.err; then
2508     ac_cpp_err=$ac_c_preproc_warn_flag
2509   else
2510     ac_cpp_err=
2511   fi
2512 else
2513   ac_cpp_err=yes
2514 fi
2515 if test -z "$ac_cpp_err"; then
2516   :
2517 else
2518   echo "$as_me: failed program was:" >&5
2519   cat conftest.$ac_ext >&5
2520   # Broken: fails on valid input.
2521 continue
2522 fi
2523 rm -f conftest.err conftest.$ac_ext
2524
2525   # OK, works on sane cases.  Now check whether non-existent headers
2526   # can be detected and how.
2527   cat >conftest.$ac_ext <<_ACEOF
2528 #line 2528 "configure"
2529 #include "confdefs.h"
2530 #include <ac_nonexistent.h>
2531 _ACEOF
2532 if { (eval echo "$as_me:2532: \"$ac_cpp conftest.$ac_ext\"") >&5
2533   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2534   ac_status=$?
2535   egrep -v '^ *\+' conftest.er1 >conftest.err
2536   rm -f conftest.er1
2537   cat conftest.err >&5
2538   echo "$as_me:2538: \$? = $ac_status" >&5
2539   (exit $ac_status); } >/dev/null; then
2540   if test -s conftest.err; then
2541     ac_cpp_err=$ac_c_preproc_warn_flag
2542   else
2543     ac_cpp_err=
2544   fi
2545 else
2546   ac_cpp_err=yes
2547 fi
2548 if test -z "$ac_cpp_err"; then
2549   # Broken: success on invalid input.
2550 continue
2551 else
2552   echo "$as_me: failed program was:" >&5
2553   cat conftest.$ac_ext >&5
2554   # Passes both tests.
2555 ac_preproc_ok=:
2556 break
2557 fi
2558 rm -f conftest.err conftest.$ac_ext
2559
2560 done
2561 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2562 rm -f conftest.err conftest.$ac_ext
2563 if $ac_preproc_ok; then
2564   :
2565 else
2566   { { echo "$as_me:2566: error: C preprocessor \"$CPP\" fails sanity check" >&5
2567 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2568    { (exit 1); exit 1; }; }
2569 fi
2570
2571 ac_ext=c
2572 ac_cpp='$CPP $CPPFLAGS'
2573 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2574 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2575 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2576 ac_main_return=return
2577
2578 for ac_prog in mawk gawk nawk awk
2579 do
2580   # Extract the first word of "$ac_prog", so it can be a program name with args.
2581 set dummy $ac_prog; ac_word=$2
2582 echo "$as_me:2582: checking for $ac_word" >&5
2583 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2584 if test "${ac_cv_prog_AWK+set}" = set; then
2585   echo $ECHO_N "(cached) $ECHO_C" >&6
2586 else
2587   if test -n "$AWK"; then
2588   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2589 else
2590   ac_save_IFS=$IFS; IFS=$ac_path_separator
2591 ac_dummy="$PATH"
2592 for ac_dir in $ac_dummy; do
2593   IFS=$ac_save_IFS
2594   test -z "$ac_dir" && ac_dir=.
2595   $as_executable_p "$ac_dir/$ac_word" || continue
2596 ac_cv_prog_AWK="$ac_prog"
2597 echo "$as_me:2597: found $ac_dir/$ac_word" >&5
2598 break
2599 done
2600
2601 fi
2602 fi
2603 AWK=$ac_cv_prog_AWK
2604 if test -n "$AWK"; then
2605   echo "$as_me:2605: result: $AWK" >&5
2606 echo "${ECHO_T}$AWK" >&6
2607 else
2608   echo "$as_me:2608: result: no" >&5
2609 echo "${ECHO_T}no" >&6
2610 fi
2611
2612   test -n "$AWK" && break
2613 done
2614
2615 # Find a good install program.  We prefer a C program (faster),
2616 # so one script is as good as another.  But avoid the broken or
2617 # incompatible versions:
2618 # SysV /etc/install, /usr/sbin/install
2619 # SunOS /usr/etc/install
2620 # IRIX /sbin/install
2621 # AIX /bin/install
2622 # AmigaOS /C/install, which installs bootblocks on floppy discs
2623 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2624 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2625 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2626 # ./install, which can be erroneously created by make from ./install.sh.
2627 echo "$as_me:2627: checking for a BSD compatible install" >&5
2628 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2629 if test -z "$INSTALL"; then
2630 if test "${ac_cv_path_install+set}" = set; then
2631   echo $ECHO_N "(cached) $ECHO_C" >&6
2632 else
2633     ac_save_IFS=$IFS; IFS=$ac_path_separator
2634   for ac_dir in $PATH; do
2635     IFS=$ac_save_IFS
2636     # Account for people who put trailing slashes in PATH elements.
2637     case $ac_dir/ in
2638     / | ./ | .// | /cC/* \
2639     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2640     | /usr/ucb/* ) ;;
2641     *)
2642       # OSF1 and SCO ODT 3.0 have their own names for install.
2643       # Don't use installbsd from OSF since it installs stuff as root
2644       # by default.
2645       for ac_prog in ginstall scoinst install; do
2646         if $as_executable_p "$ac_dir/$ac_prog"; then
2647           if test $ac_prog = install &&
2648             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2649             # AIX install.  It has an incompatible calling convention.
2650             :
2651           elif test $ac_prog = install &&
2652             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2653             # program-specific install script used by HP pwplus--don't use.
2654             :
2655           else
2656             ac_cv_path_install="$ac_dir/$ac_prog -c"
2657             break 2
2658           fi
2659         fi
2660       done
2661       ;;
2662     esac
2663   done
2664
2665 fi
2666   if test "${ac_cv_path_install+set}" = set; then
2667     INSTALL=$ac_cv_path_install
2668   else
2669     # As a last resort, use the slow shell script.  We don't cache a
2670     # path for INSTALL within a source directory, because that will
2671     # break other packages using the cache if that directory is
2672     # removed, or if the path is relative.
2673     INSTALL=$ac_install_sh
2674   fi
2675 fi
2676 echo "$as_me:2676: result: $INSTALL" >&5
2677 echo "${ECHO_T}$INSTALL" >&6
2678
2679 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2680 # It thinks the first close brace ends the variable substitution.
2681 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2682
2683 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2684
2685 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2686
2687 case $INSTALL in
2688 (/*)
2689         ;;
2690 (*)
2691         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2692         test -z "$cf_dir" && cf_dir=.
2693         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2694         ;;
2695 esac
2696
2697 echo "$as_me:2697: checking if you want to install stripped executables" >&5
2698 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2699
2700 # Check whether --enable-stripping or --disable-stripping was given.
2701 if test "${enable_stripping+set}" = set; then
2702   enableval="$enable_stripping"
2703   test "$enableval" != no && enableval=yes
2704         if test "$enableval" != "yes" ; then
2705     with_stripping=no
2706         else
2707                 with_stripping=yes
2708         fi
2709 else
2710   enableval=yes
2711         with_stripping=yes
2712
2713 fi;
2714 echo "$as_me:2714: result: $with_stripping" >&5
2715 echo "${ECHO_T}$with_stripping" >&6
2716
2717 if test "$with_stripping" = yes
2718 then
2719         INSTALL_OPT_S="-s"
2720 else
2721         INSTALL_OPT_S=
2722 fi
2723
2724 : ${INSTALL:=install}
2725 echo "$as_me:2725: checking if install accepts -p option" >&5
2726 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2727 if test "${cf_cv_install_p+set}" = set; then
2728   echo $ECHO_N "(cached) $ECHO_C" >&6
2729 else
2730
2731         rm -rf conftest*
2732         date >conftest.in
2733         mkdir conftest.out
2734         sleep 3
2735         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2736         then
2737                 if test -f conftest.out/conftest.in
2738                 then
2739                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2740                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2741                         if test -s conftest.err
2742                         then
2743                                 cf_cv_install_p=no
2744                         else
2745                                 cf_cv_install_p=yes
2746                         fi
2747                 else
2748                         cf_cv_install_p=no
2749                 fi
2750         else
2751                 cf_cv_install_p=no
2752         fi
2753         rm -rf conftest*
2754
2755 fi
2756 echo "$as_me:2756: result: $cf_cv_install_p" >&5
2757 echo "${ECHO_T}$cf_cv_install_p" >&6
2758
2759 echo "$as_me:2759: checking if install needs to be told about ownership" >&5
2760 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2761 case `$ac_config_guess` in
2762 (*minix)
2763         with_install_o=yes
2764         ;;
2765 (*)
2766         with_install_o=no
2767         ;;
2768 esac
2769
2770 echo "$as_me:2770: result: $with_install_o" >&5
2771 echo "${ECHO_T}$with_install_o" >&6
2772 if test "x$with_install_o" = xyes
2773 then
2774         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'`
2775 else
2776         INSTALL_OPT_O=
2777 fi
2778
2779 for ac_prog in lint cppcheck splint
2780 do
2781   # Extract the first word of "$ac_prog", so it can be a program name with args.
2782 set dummy $ac_prog; ac_word=$2
2783 echo "$as_me:2783: checking for $ac_word" >&5
2784 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2785 if test "${ac_cv_prog_LINT+set}" = set; then
2786   echo $ECHO_N "(cached) $ECHO_C" >&6
2787 else
2788   if test -n "$LINT"; then
2789   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2790 else
2791   ac_save_IFS=$IFS; IFS=$ac_path_separator
2792 ac_dummy="$PATH"
2793 for ac_dir in $ac_dummy; do
2794   IFS=$ac_save_IFS
2795   test -z "$ac_dir" && ac_dir=.
2796   $as_executable_p "$ac_dir/$ac_word" || continue
2797 ac_cv_prog_LINT="$ac_prog"
2798 echo "$as_me:2798: found $ac_dir/$ac_word" >&5
2799 break
2800 done
2801
2802 fi
2803 fi
2804 LINT=$ac_cv_prog_LINT
2805 if test -n "$LINT"; then
2806   echo "$as_me:2806: result: $LINT" >&5
2807 echo "${ECHO_T}$LINT" >&6
2808 else
2809   echo "$as_me:2809: result: no" >&5
2810 echo "${ECHO_T}no" >&6
2811 fi
2812
2813   test -n "$LINT" && break
2814 done
2815
2816 case "x$LINT" in
2817 (xcppcheck|x*/cppcheck)
2818         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2819         ;;
2820 esac
2821
2822 echo "$as_me:2822: checking if filesystem supports mixed-case filenames" >&5
2823 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2824 if test "${cf_cv_mixedcase+set}" = set; then
2825   echo $ECHO_N "(cached) $ECHO_C" >&6
2826 else
2827
2828 if test "$cross_compiling" = yes ; then
2829         case $target_alias in
2830         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2831                 cf_cv_mixedcase=no
2832                 ;;
2833         (*)
2834                 cf_cv_mixedcase=yes
2835                 ;;
2836         esac
2837 else
2838         rm -f conftest CONFTEST
2839         echo test >conftest
2840         if test -f CONFTEST ; then
2841                 cf_cv_mixedcase=no
2842         else
2843                 cf_cv_mixedcase=yes
2844         fi
2845         rm -f conftest CONFTEST
2846 fi
2847
2848 fi
2849 echo "$as_me:2849: result: $cf_cv_mixedcase" >&5
2850 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2851 test "$cf_cv_mixedcase" = yes &&
2852 cat >>confdefs.h <<\EOF
2853 #define MIXEDCASE_FILENAMES 1
2854 EOF
2855
2856 for ac_prog in exctags ctags
2857 do
2858   # Extract the first word of "$ac_prog", so it can be a program name with args.
2859 set dummy $ac_prog; ac_word=$2
2860 echo "$as_me:2860: checking for $ac_word" >&5
2861 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2862 if test "${ac_cv_prog_CTAGS+set}" = set; then
2863   echo $ECHO_N "(cached) $ECHO_C" >&6
2864 else
2865   if test -n "$CTAGS"; then
2866   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2867 else
2868   ac_save_IFS=$IFS; IFS=$ac_path_separator
2869 ac_dummy="$PATH"
2870 for ac_dir in $ac_dummy; do
2871   IFS=$ac_save_IFS
2872   test -z "$ac_dir" && ac_dir=.
2873   $as_executable_p "$ac_dir/$ac_word" || continue
2874 ac_cv_prog_CTAGS="$ac_prog"
2875 echo "$as_me:2875: found $ac_dir/$ac_word" >&5
2876 break
2877 done
2878
2879 fi
2880 fi
2881 CTAGS=$ac_cv_prog_CTAGS
2882 if test -n "$CTAGS"; then
2883   echo "$as_me:2883: result: $CTAGS" >&5
2884 echo "${ECHO_T}$CTAGS" >&6
2885 else
2886   echo "$as_me:2886: result: no" >&5
2887 echo "${ECHO_T}no" >&6
2888 fi
2889
2890   test -n "$CTAGS" && break
2891 done
2892
2893 for ac_prog in exetags etags
2894 do
2895   # Extract the first word of "$ac_prog", so it can be a program name with args.
2896 set dummy $ac_prog; ac_word=$2
2897 echo "$as_me:2897: checking for $ac_word" >&5
2898 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2899 if test "${ac_cv_prog_ETAGS+set}" = set; then
2900   echo $ECHO_N "(cached) $ECHO_C" >&6
2901 else
2902   if test -n "$ETAGS"; then
2903   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2904 else
2905   ac_save_IFS=$IFS; IFS=$ac_path_separator
2906 ac_dummy="$PATH"
2907 for ac_dir in $ac_dummy; do
2908   IFS=$ac_save_IFS
2909   test -z "$ac_dir" && ac_dir=.
2910   $as_executable_p "$ac_dir/$ac_word" || continue
2911 ac_cv_prog_ETAGS="$ac_prog"
2912 echo "$as_me:2912: found $ac_dir/$ac_word" >&5
2913 break
2914 done
2915
2916 fi
2917 fi
2918 ETAGS=$ac_cv_prog_ETAGS
2919 if test -n "$ETAGS"; then
2920   echo "$as_me:2920: result: $ETAGS" >&5
2921 echo "${ECHO_T}$ETAGS" >&6
2922 else
2923   echo "$as_me:2923: result: no" >&5
2924 echo "${ECHO_T}no" >&6
2925 fi
2926
2927   test -n "$ETAGS" && break
2928 done
2929
2930 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2931 set dummy ${CTAGS:-ctags}; ac_word=$2
2932 echo "$as_me:2932: checking for $ac_word" >&5
2933 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2934 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2935   echo $ECHO_N "(cached) $ECHO_C" >&6
2936 else
2937   if test -n "$MAKE_LOWER_TAGS"; then
2938   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2939 else
2940   ac_save_IFS=$IFS; IFS=$ac_path_separator
2941 ac_dummy="$PATH"
2942 for ac_dir in $ac_dummy; do
2943   IFS=$ac_save_IFS
2944   test -z "$ac_dir" && ac_dir=.
2945   $as_executable_p "$ac_dir/$ac_word" || continue
2946 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2947 echo "$as_me:2947: found $ac_dir/$ac_word" >&5
2948 break
2949 done
2950
2951   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2952 fi
2953 fi
2954 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2955 if test -n "$MAKE_LOWER_TAGS"; then
2956   echo "$as_me:2956: result: $MAKE_LOWER_TAGS" >&5
2957 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2958 else
2959   echo "$as_me:2959: result: no" >&5
2960 echo "${ECHO_T}no" >&6
2961 fi
2962
2963 if test "$cf_cv_mixedcase" = yes ; then
2964         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2965 set dummy ${ETAGS:-etags}; ac_word=$2
2966 echo "$as_me:2966: checking for $ac_word" >&5
2967 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2968 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2969   echo $ECHO_N "(cached) $ECHO_C" >&6
2970 else
2971   if test -n "$MAKE_UPPER_TAGS"; then
2972   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2973 else
2974   ac_save_IFS=$IFS; IFS=$ac_path_separator
2975 ac_dummy="$PATH"
2976 for ac_dir in $ac_dummy; do
2977   IFS=$ac_save_IFS
2978   test -z "$ac_dir" && ac_dir=.
2979   $as_executable_p "$ac_dir/$ac_word" || continue
2980 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2981 echo "$as_me:2981: found $ac_dir/$ac_word" >&5
2982 break
2983 done
2984
2985   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2986 fi
2987 fi
2988 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2989 if test -n "$MAKE_UPPER_TAGS"; then
2990   echo "$as_me:2990: result: $MAKE_UPPER_TAGS" >&5
2991 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2992 else
2993   echo "$as_me:2993: result: no" >&5
2994 echo "${ECHO_T}no" >&6
2995 fi
2996
2997 else
2998         MAKE_UPPER_TAGS=no
2999 fi
3000
3001 if test "$MAKE_UPPER_TAGS" = yes ; then
3002         MAKE_UPPER_TAGS=
3003 else
3004         MAKE_UPPER_TAGS="#"
3005 fi
3006
3007 if test "$MAKE_LOWER_TAGS" = yes ; then
3008         MAKE_LOWER_TAGS=
3009 else
3010         MAKE_LOWER_TAGS="#"
3011 fi
3012
3013 echo "$as_me:3013: checking if -lm needed for math functions" >&5
3014 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3015 if test "${cf_cv_need_libm+set}" = set; then
3016   echo $ECHO_N "(cached) $ECHO_C" >&6
3017 else
3018
3019         cat >conftest.$ac_ext <<_ACEOF
3020 #line 3020 "configure"
3021 #include "confdefs.h"
3022
3023         #include <stdio.h>
3024         #include <stdlib.h>
3025         #include <math.h>
3026
3027 int
3028 main (void)
3029 {
3030 double x = rand(); printf("result = %g\n", pow(sin(x),x))
3031   ;
3032   return 0;
3033 }
3034 _ACEOF
3035 rm -f conftest.$ac_objext conftest$ac_exeext
3036 if { (eval echo "$as_me:3036: \"$ac_link\"") >&5
3037   (eval $ac_link) 2>&5
3038   ac_status=$?
3039   echo "$as_me:3039: \$? = $ac_status" >&5
3040   (exit $ac_status); } &&
3041          { ac_try='test -s conftest$ac_exeext'
3042   { (eval echo "$as_me:3042: \"$ac_try\"") >&5
3043   (eval $ac_try) 2>&5
3044   ac_status=$?
3045   echo "$as_me:3045: \$? = $ac_status" >&5
3046   (exit $ac_status); }; }; then
3047   cf_cv_need_libm=no
3048 else
3049   echo "$as_me: failed program was:" >&5
3050 cat conftest.$ac_ext >&5
3051 cf_cv_need_libm=yes
3052 fi
3053 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3054 fi
3055 echo "$as_me:3055: result: $cf_cv_need_libm" >&5
3056 echo "${ECHO_T}$cf_cv_need_libm" >&6
3057 if test "$cf_cv_need_libm" = yes
3058 then
3059 MATH_LIB=-lm
3060 fi
3061
3062 top_builddir=`pwd`
3063
3064 CC_G_OPT="-g"
3065 CC_SHARED_OPTS=unknown
3066 CPPFLAGS="$CPPFLAGS"
3067 DFT_DEP_SUFFIX=""
3068 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3069 DFT_UPR_MODEL="NORMAL"
3070 LD="ld"
3071 LDFLAGS_SHARED=""
3072 LDFLAGS_STATIC=""
3073 LD_MODEL=""
3074 LD_SHARED_OPTS=""
3075 LIBTOOL=""
3076 LIBTOOL_OPTS=""
3077 LIB_CLEAN=""
3078 LIB_COMPILE=""
3079 LIB_LINK='${CC}'
3080 LINK_TESTS=""
3081 LOCAL_LDFLAGS=""
3082 PACKAGE="ncurses-examples"
3083 PTHREAD="-lm"
3084 TEST_ARGS=""
3085 TEST_DEPS=""
3086 TEST_LIBS=""
3087 TINFO_LDFLAGS=''
3088 TINFO_LIBS='$(LIBS_CURSES)'
3089 cf_cv_abi_version=""
3090 cf_cv_rel_version=""
3091 includesubdir=""
3092
3093 cf_cv_screen=curses
3094 cf_cv_libtype=
3095
3096 if test "$GCC" = yes
3097 then
3098 cat > conftest.i <<EOF
3099 #ifndef GCC_PRINTF
3100 #define GCC_PRINTF 0
3101 #endif
3102 #ifndef GCC_SCANF
3103 #define GCC_SCANF 0
3104 #endif
3105 #ifndef GCC_NORETURN
3106 #define GCC_NORETURN /* nothing */
3107 #endif
3108 #ifndef GCC_UNUSED
3109 #define GCC_UNUSED /* nothing */
3110 #endif
3111 EOF
3112 if test "$GCC" = yes
3113 then
3114         { echo "$as_me:3114: checking for $CC __attribute__ directives..." >&5
3115 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3116 cat > conftest.$ac_ext <<EOF
3117 #line 3117 "${as_me:-configure}"
3118 #include "confdefs.h"
3119 #include "conftest.h"
3120 #include "conftest.i"
3121 #if     GCC_PRINTF
3122 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3123 #else
3124 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3125 #endif
3126 #if     GCC_SCANF
3127 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3128 #else
3129 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3130 #endif
3131 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3132 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3133 extern void foo(void) GCC_NORETURN;
3134 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3135 EOF
3136         cf_printf_attribute=no
3137         cf_scanf_attribute=no
3138         for cf_attribute in scanf printf unused noreturn
3139         do
3140
3141 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3142
3143                 cf_directive="__attribute__(($cf_attribute))"
3144                 echo "checking for $CC $cf_directive" 1>&5
3145
3146                 case $cf_attribute in
3147                 (printf)
3148                         cf_printf_attribute=yes
3149                         cat >conftest.h <<EOF
3150 #define GCC_$cf_ATTRIBUTE 1
3151 EOF
3152                         ;;
3153                 (scanf)
3154                         cf_scanf_attribute=yes
3155                         cat >conftest.h <<EOF
3156 #define GCC_$cf_ATTRIBUTE 1
3157 EOF
3158                         ;;
3159                 (*)
3160                         cat >conftest.h <<EOF
3161 #define GCC_$cf_ATTRIBUTE $cf_directive
3162 EOF
3163                         ;;
3164                 esac
3165
3166                 if { (eval echo "$as_me:3166: \"$ac_compile\"") >&5
3167   (eval $ac_compile) 2>&5
3168   ac_status=$?
3169   echo "$as_me:3169: \$? = $ac_status" >&5
3170   (exit $ac_status); }; then
3171                         test -n "$verbose" && echo "$as_me:3171: result: ... $cf_attribute" >&5
3172 echo "${ECHO_T}... $cf_attribute" >&6
3173                         cat conftest.h >>confdefs.h
3174                         case $cf_attribute in
3175                         (noreturn)
3176
3177 cat >>confdefs.h <<EOF
3178 #define GCC_NORETURN $cf_directive
3179 EOF
3180
3181                                 ;;
3182                         (printf)
3183                                 cf_value='/* nothing */'
3184                                 if test "$cf_printf_attribute" != no ; then
3185                                         cf_value='__attribute__((format(printf,fmt,var)))'
3186
3187 cat >>confdefs.h <<\EOF
3188 #define GCC_PRINTF 1
3189 EOF
3190
3191                                 fi
3192
3193 cat >>confdefs.h <<EOF
3194 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3195 EOF
3196
3197                                 ;;
3198                         (scanf)
3199                                 cf_value='/* nothing */'
3200                                 if test "$cf_scanf_attribute" != no ; then
3201                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3202
3203 cat >>confdefs.h <<\EOF
3204 #define GCC_SCANF 1
3205 EOF
3206
3207                                 fi
3208
3209 cat >>confdefs.h <<EOF
3210 #define GCC_SCANFLIKE(fmt,var) $cf_value
3211 EOF
3212
3213                                 ;;
3214                         (unused)
3215
3216 cat >>confdefs.h <<EOF
3217 #define GCC_UNUSED $cf_directive
3218 EOF
3219
3220                                 ;;
3221                         esac
3222                 fi
3223         done
3224 else
3225         fgrep define conftest.i >>confdefs.h
3226 fi
3227 rm -rf conftest*
3228 fi
3229
3230 echo "$as_me:3230: checking if you want to work around bogus compiler/loader warnings" >&5
3231 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3232
3233 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3234 if test "${enable_string_hacks+set}" = set; then
3235   enableval="$enable_string_hacks"
3236   with_string_hacks=$enableval
3237 else
3238   with_string_hacks=no
3239 fi;
3240 echo "$as_me:3240: result: $with_string_hacks" >&5
3241 echo "${ECHO_T}$with_string_hacks" >&6
3242
3243 if test "x$with_string_hacks" = "xyes"; then
3244
3245 cat >>confdefs.h <<\EOF
3246 #define USE_STRING_HACKS 1
3247 EOF
3248
3249         { echo "$as_me:3249: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3250 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3251         echo "$as_me:3251: checking for strlcat" >&5
3252 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3253 if test "${ac_cv_func_strlcat+set}" = set; then
3254   echo $ECHO_N "(cached) $ECHO_C" >&6
3255 else
3256   cat >conftest.$ac_ext <<_ACEOF
3257 #line 3257 "configure"
3258 #include "confdefs.h"
3259 #define strlcat autoconf_temporary
3260 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3261 #undef strlcat
3262
3263 #ifdef __cplusplus
3264 extern "C"
3265 #endif
3266
3267 /* We use char because int might match the return type of a gcc2
3268    builtin and then its argument prototype would still apply.  */
3269 char strlcat (void);
3270
3271 int
3272 main (void)
3273 {
3274
3275 /* The GNU C library defines stubs for functions which it implements
3276     to always fail with ENOSYS.  Some functions are actually named
3277     something starting with __ and the normal name is an alias.  */
3278 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3279 #error found stub for strlcat
3280 #endif
3281
3282         return strlcat ();
3283   ;
3284   return 0;
3285 }
3286 _ACEOF
3287 rm -f conftest.$ac_objext conftest$ac_exeext
3288 if { (eval echo "$as_me:3288: \"$ac_link\"") >&5
3289   (eval $ac_link) 2>&5
3290   ac_status=$?
3291   echo "$as_me:3291: \$? = $ac_status" >&5
3292   (exit $ac_status); } &&
3293          { ac_try='test -s conftest$ac_exeext'
3294   { (eval echo "$as_me:3294: \"$ac_try\"") >&5
3295   (eval $ac_try) 2>&5
3296   ac_status=$?
3297   echo "$as_me:3297: \$? = $ac_status" >&5
3298   (exit $ac_status); }; }; then
3299   ac_cv_func_strlcat=yes
3300 else
3301   echo "$as_me: failed program was:" >&5
3302 cat conftest.$ac_ext >&5
3303 ac_cv_func_strlcat=no
3304 fi
3305 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3306 fi
3307 echo "$as_me:3307: result: $ac_cv_func_strlcat" >&5
3308 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3309 if test $ac_cv_func_strlcat = yes; then
3310
3311 cat >>confdefs.h <<\EOF
3312 #define HAVE_STRLCAT 1
3313 EOF
3314
3315 else
3316
3317                 echo "$as_me:3317: checking for strlcat in -lbsd" >&5
3318 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3319 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3320   echo $ECHO_N "(cached) $ECHO_C" >&6
3321 else
3322   ac_check_lib_save_LIBS=$LIBS
3323 LIBS="-lbsd  $LIBS"
3324 cat >conftest.$ac_ext <<_ACEOF
3325 #line 3325 "configure"
3326 #include "confdefs.h"
3327
3328 /* Override any gcc2 internal prototype to avoid an error.  */
3329 #ifdef __cplusplus
3330 extern "C"
3331 #endif
3332 /* We use char because int might match the return type of a gcc2
3333    builtin and then its argument prototype would still apply.  */
3334 char strlcat ();
3335 int
3336 main (void)
3337 {
3338 strlcat ();
3339   ;
3340   return 0;
3341 }
3342 _ACEOF
3343 rm -f conftest.$ac_objext conftest$ac_exeext
3344 if { (eval echo "$as_me:3344: \"$ac_link\"") >&5
3345   (eval $ac_link) 2>&5
3346   ac_status=$?
3347   echo "$as_me:3347: \$? = $ac_status" >&5
3348   (exit $ac_status); } &&
3349          { ac_try='test -s conftest$ac_exeext'
3350   { (eval echo "$as_me:3350: \"$ac_try\"") >&5
3351   (eval $ac_try) 2>&5
3352   ac_status=$?
3353   echo "$as_me:3353: \$? = $ac_status" >&5
3354   (exit $ac_status); }; }; then
3355   ac_cv_lib_bsd_strlcat=yes
3356 else
3357   echo "$as_me: failed program was:" >&5
3358 cat conftest.$ac_ext >&5
3359 ac_cv_lib_bsd_strlcat=no
3360 fi
3361 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3362 LIBS=$ac_check_lib_save_LIBS
3363 fi
3364 echo "$as_me:3364: result: $ac_cv_lib_bsd_strlcat" >&5
3365 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3366 if test $ac_cv_lib_bsd_strlcat = yes; then
3367
3368 cf_add_libs="$LIBS"
3369 # reverse order
3370 cf_add_0lib=
3371 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3372 # filter duplicates
3373 for cf_add_1lib in $cf_add_0lib; do
3374         for cf_add_2lib in $cf_add_libs; do
3375                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3376                         cf_add_1lib=
3377                         break
3378                 fi
3379         done
3380         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3381 done
3382 LIBS="$cf_add_libs"
3383
3384 for ac_header in bsd/string.h
3385 do
3386 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3387 echo "$as_me:3387: checking for $ac_header" >&5
3388 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3389 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3390   echo $ECHO_N "(cached) $ECHO_C" >&6
3391 else
3392   cat >conftest.$ac_ext <<_ACEOF
3393 #line 3393 "configure"
3394 #include "confdefs.h"
3395 #include <$ac_header>
3396 _ACEOF
3397 if { (eval echo "$as_me:3397: \"$ac_cpp conftest.$ac_ext\"") >&5
3398   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3399   ac_status=$?
3400   egrep -v '^ *\+' conftest.er1 >conftest.err
3401   rm -f conftest.er1
3402   cat conftest.err >&5
3403   echo "$as_me:3403: \$? = $ac_status" >&5
3404   (exit $ac_status); } >/dev/null; then
3405   if test -s conftest.err; then
3406     ac_cpp_err=$ac_c_preproc_warn_flag
3407   else
3408     ac_cpp_err=
3409   fi
3410 else
3411   ac_cpp_err=yes
3412 fi
3413 if test -z "$ac_cpp_err"; then
3414   eval "$as_ac_Header=yes"
3415 else
3416   echo "$as_me: failed program was:" >&5
3417   cat conftest.$ac_ext >&5
3418   eval "$as_ac_Header=no"
3419 fi
3420 rm -f conftest.err conftest.$ac_ext
3421 fi
3422 echo "$as_me:3422: result: `eval echo '${'$as_ac_Header'}'`" >&5
3423 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3424 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3425   cat >>confdefs.h <<EOF
3426 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3427 EOF
3428
3429 fi
3430 done
3431
3432 cat >>confdefs.h <<\EOF
3433 #define HAVE_STRLCAT 1
3434 EOF
3435
3436 fi
3437
3438 fi
3439
3440 for ac_func in strlcpy snprintf
3441 do
3442 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3443 echo "$as_me:3443: checking for $ac_func" >&5
3444 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3445 if eval "test \"\${$as_ac_var+set}\" = set"; then
3446   echo $ECHO_N "(cached) $ECHO_C" >&6
3447 else
3448   cat >conftest.$ac_ext <<_ACEOF
3449 #line 3449 "configure"
3450 #include "confdefs.h"
3451 #define $ac_func autoconf_temporary
3452 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3453 #undef $ac_func
3454
3455 #ifdef __cplusplus
3456 extern "C"
3457 #endif
3458
3459 /* We use char because int might match the return type of a gcc2
3460    builtin and then its argument prototype would still apply.  */
3461 char $ac_func (void);
3462
3463 int
3464 main (void)
3465 {
3466
3467 /* The GNU C library defines stubs for functions which it implements
3468     to always fail with ENOSYS.  Some functions are actually named
3469     something starting with __ and the normal name is an alias.  */
3470 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3471 #error found stub for $ac_func
3472 #endif
3473
3474         return $ac_func ();
3475   ;
3476   return 0;
3477 }
3478 _ACEOF
3479 rm -f conftest.$ac_objext conftest$ac_exeext
3480 if { (eval echo "$as_me:3480: \"$ac_link\"") >&5
3481   (eval $ac_link) 2>&5
3482   ac_status=$?
3483   echo "$as_me:3483: \$? = $ac_status" >&5
3484   (exit $ac_status); } &&
3485          { ac_try='test -s conftest$ac_exeext'
3486   { (eval echo "$as_me:3486: \"$ac_try\"") >&5
3487   (eval $ac_try) 2>&5
3488   ac_status=$?
3489   echo "$as_me:3489: \$? = $ac_status" >&5
3490   (exit $ac_status); }; }; then
3491   eval "$as_ac_var=yes"
3492 else
3493   echo "$as_me: failed program was:" >&5
3494 cat conftest.$ac_ext >&5
3495 eval "$as_ac_var=no"
3496 fi
3497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3498 fi
3499 echo "$as_me:3499: result: `eval echo '${'$as_ac_var'}'`" >&5
3500 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3501 if test `eval echo '${'$as_ac_var'}'` = yes; then
3502   cat >>confdefs.h <<EOF
3503 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3504 EOF
3505
3506 fi
3507 done
3508
3509 fi
3510
3511 echo "$as_me:3511: checking if the POSIX test-macros are already defined" >&5
3512 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3513 if test "${cf_cv_posix_visible+set}" = set; then
3514   echo $ECHO_N "(cached) $ECHO_C" >&6
3515 else
3516
3517 cat >conftest.$ac_ext <<_ACEOF
3518 #line 3518 "configure"
3519 #include "confdefs.h"
3520 #include <stdio.h>
3521 int
3522 main (void)
3523 {
3524
3525 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3526         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3527         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3528         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3529 #error conflicting symbols found
3530 #endif
3531
3532   ;
3533   return 0;
3534 }
3535 _ACEOF
3536 rm -f conftest.$ac_objext
3537 if { (eval echo "$as_me:3537: \"$ac_compile\"") >&5
3538   (eval $ac_compile) 2>&5
3539   ac_status=$?
3540   echo "$as_me:3540: \$? = $ac_status" >&5
3541   (exit $ac_status); } &&
3542          { ac_try='test -s conftest.$ac_objext'
3543   { (eval echo "$as_me:3543: \"$ac_try\"") >&5
3544   (eval $ac_try) 2>&5
3545   ac_status=$?
3546   echo "$as_me:3546: \$? = $ac_status" >&5
3547   (exit $ac_status); }; }; then
3548   cf_cv_posix_visible=no
3549 else
3550   echo "$as_me: failed program was:" >&5
3551 cat conftest.$ac_ext >&5
3552 cf_cv_posix_visible=yes
3553 fi
3554 rm -f conftest.$ac_objext conftest.$ac_ext
3555
3556 fi
3557 echo "$as_me:3557: result: $cf_cv_posix_visible" >&5
3558 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3559
3560 if test "$cf_cv_posix_visible" = no; then
3561
3562 cf_XOPEN_SOURCE=600
3563 cf_POSIX_C_SOURCE=199506L
3564 cf_xopen_source=
3565
3566 case $host_os in
3567 (aix[4-7]*)
3568         cf_xopen_source="-D_ALL_SOURCE"
3569         ;;
3570 (msys)
3571         cf_XOPEN_SOURCE=600
3572         ;;
3573 (darwin[0-8].*)
3574         cf_xopen_source="-D_APPLE_C_SOURCE"
3575         ;;
3576 (darwin*)
3577         cf_xopen_source="-D_DARWIN_C_SOURCE"
3578         cf_XOPEN_SOURCE=
3579         ;;
3580 (freebsd*|dragonfly*|midnightbsd*)
3581         # 5.x headers associate
3582         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3583         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3584         cf_POSIX_C_SOURCE=200112L
3585         cf_XOPEN_SOURCE=600
3586         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3587         ;;
3588 (hpux11*)
3589         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3590         ;;
3591 (hpux*)
3592         cf_xopen_source="-D_HPUX_SOURCE"
3593         ;;
3594 (irix[56].*)
3595         cf_xopen_source="-D_SGI_SOURCE"
3596         cf_XOPEN_SOURCE=
3597         ;;
3598 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3599
3600 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3601
3602 echo "$as_me:3602: checking if this is the GNU C library" >&5
3603 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3604 if test "${cf_cv_gnu_library+set}" = set; then
3605   echo $ECHO_N "(cached) $ECHO_C" >&6
3606 else
3607
3608 cat >conftest.$ac_ext <<_ACEOF
3609 #line 3609 "configure"
3610 #include "confdefs.h"
3611 #include <sys/types.h>
3612 int
3613 main (void)
3614 {
3615
3616         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3617                 return 0;
3618         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3619                 return 0;
3620         #else
3621         #       error not GNU C library
3622         #endif
3623   ;
3624   return 0;
3625 }
3626 _ACEOF
3627 rm -f conftest.$ac_objext
3628 if { (eval echo "$as_me:3628: \"$ac_compile\"") >&5
3629   (eval $ac_compile) 2>&5
3630   ac_status=$?
3631   echo "$as_me:3631: \$? = $ac_status" >&5
3632   (exit $ac_status); } &&
3633          { ac_try='test -s conftest.$ac_objext'
3634   { (eval echo "$as_me:3634: \"$ac_try\"") >&5
3635   (eval $ac_try) 2>&5
3636   ac_status=$?
3637   echo "$as_me:3637: \$? = $ac_status" >&5
3638   (exit $ac_status); }; }; then
3639   cf_cv_gnu_library=yes
3640 else
3641   echo "$as_me: failed program was:" >&5
3642 cat conftest.$ac_ext >&5
3643 cf_cv_gnu_library=no
3644 fi
3645 rm -f conftest.$ac_objext conftest.$ac_ext
3646
3647 fi
3648 echo "$as_me:3648: result: $cf_cv_gnu_library" >&5
3649 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3650
3651 if test x$cf_cv_gnu_library = xyes; then
3652
3653         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3654         # was changed to help a little.  newlib incorporated the change about 4
3655         # years later.
3656         echo "$as_me:3656: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3657 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3658 if test "${cf_cv_gnu_library_219+set}" = set; then
3659   echo $ECHO_N "(cached) $ECHO_C" >&6
3660 else
3661
3662                 cf_save="$CPPFLAGS"
3663
3664         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3665         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3666
3667                 cat >conftest.$ac_ext <<_ACEOF
3668 #line 3668 "configure"
3669 #include "confdefs.h"
3670 #include <sys/types.h>
3671 int
3672 main (void)
3673 {
3674
3675                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3676                                 return 0;
3677                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3678                                 return 0;
3679                         #else
3680                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3681                         #endif
3682   ;
3683   return 0;
3684 }
3685 _ACEOF
3686 rm -f conftest.$ac_objext
3687 if { (eval echo "$as_me:3687: \"$ac_compile\"") >&5
3688   (eval $ac_compile) 2>&5
3689   ac_status=$?
3690   echo "$as_me:3690: \$? = $ac_status" >&5
3691   (exit $ac_status); } &&
3692          { ac_try='test -s conftest.$ac_objext'
3693   { (eval echo "$as_me:3693: \"$ac_try\"") >&5
3694   (eval $ac_try) 2>&5
3695   ac_status=$?
3696   echo "$as_me:3696: \$? = $ac_status" >&5
3697   (exit $ac_status); }; }; then
3698   cf_cv_gnu_library_219=yes
3699 else
3700   echo "$as_me: failed program was:" >&5
3701 cat conftest.$ac_ext >&5
3702 cf_cv_gnu_library_219=no
3703 fi
3704 rm -f conftest.$ac_objext conftest.$ac_ext
3705                 CPPFLAGS="$cf_save"
3706
3707 fi
3708 echo "$as_me:3708: result: $cf_cv_gnu_library_219" >&5
3709 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3710
3711         if test "x$cf_cv_gnu_library_219" = xyes; then
3712                 cf_save="$CPPFLAGS"
3713                 echo "$as_me:3713: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3714 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3715 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3716   echo $ECHO_N "(cached) $ECHO_C" >&6
3717 else
3718
3719 cf_fix_cppflags=no
3720 cf_new_cflags=
3721 cf_new_cppflags=
3722 cf_new_extra_cppflags=
3723
3724 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3725 do
3726 case $cf_fix_cppflags in
3727 (no)
3728         case $cf_add_cflags in
3729         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3730                 case $cf_add_cflags in
3731                 (-D*)
3732                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3733
3734                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3735                                 && test -z "${cf_tst_cflags}" \
3736                                 && cf_fix_cppflags=yes
3737
3738                         if test $cf_fix_cppflags = yes ; then
3739
3740         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3741         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3742
3743                                 continue
3744                         elif test "${cf_tst_cflags}" = "\"'" ; then
3745
3746         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3747         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3748
3749                                 continue
3750                         fi
3751                         ;;
3752                 esac
3753                 case "$CPPFLAGS" in
3754                 (*$cf_add_cflags)
3755                         ;;
3756                 (*)
3757                         case $cf_add_cflags in
3758                         (-D*)
3759                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3760
3761 CPPFLAGS=`echo "$CPPFLAGS" | \
3762         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3763                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3764
3765                                 ;;
3766                         esac
3767
3768         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3769         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3770
3771                         ;;
3772                 esac
3773                 ;;
3774         (*)
3775
3776         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3777         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3778
3779                 ;;
3780         esac
3781         ;;
3782 (yes)
3783
3784         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3785         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3786
3787         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3788
3789         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3790                 && test -z "${cf_tst_cflags}" \
3791                 && cf_fix_cppflags=no
3792         ;;
3793 esac
3794 done
3795
3796 if test -n "$cf_new_cflags" ; then
3797
3798         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3799         CFLAGS="${CFLAGS}$cf_new_cflags"
3800
3801 fi
3802
3803 if test -n "$cf_new_cppflags" ; then
3804
3805         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3806         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3807
3808 fi
3809
3810 if test -n "$cf_new_extra_cppflags" ; then
3811
3812         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3813         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3814
3815 fi
3816
3817                         cat >conftest.$ac_ext <<_ACEOF
3818 #line 3818 "configure"
3819 #include "confdefs.h"
3820
3821                                 #include <limits.h>
3822                                 #include <sys/types.h>
3823
3824 int
3825 main (void)
3826 {
3827
3828                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3829                                         return 0;
3830                                 #else
3831                                 #       error GNU C library is too old
3832                                 #endif
3833   ;
3834   return 0;
3835 }
3836 _ACEOF
3837 rm -f conftest.$ac_objext
3838 if { (eval echo "$as_me:3838: \"$ac_compile\"") >&5
3839   (eval $ac_compile) 2>&5
3840   ac_status=$?
3841   echo "$as_me:3841: \$? = $ac_status" >&5
3842   (exit $ac_status); } &&
3843          { ac_try='test -s conftest.$ac_objext'
3844   { (eval echo "$as_me:3844: \"$ac_try\"") >&5
3845   (eval $ac_try) 2>&5
3846   ac_status=$?
3847   echo "$as_me:3847: \$? = $ac_status" >&5
3848   (exit $ac_status); }; }; then
3849   cf_cv_gnu_dftsrc_219=yes
3850 else
3851   echo "$as_me: failed program was:" >&5
3852 cat conftest.$ac_ext >&5
3853 cf_cv_gnu_dftsrc_219=no
3854 fi
3855 rm -f conftest.$ac_objext conftest.$ac_ext
3856
3857 fi
3858 echo "$as_me:3858: result: $cf_cv_gnu_dftsrc_219" >&5
3859 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3860                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3861         else
3862                 cf_cv_gnu_dftsrc_219=maybe
3863         fi
3864
3865         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3866
3867                 echo "$as_me:3867: checking if we must define _GNU_SOURCE" >&5
3868 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3869 if test "${cf_cv_gnu_source+set}" = set; then
3870   echo $ECHO_N "(cached) $ECHO_C" >&6
3871 else
3872
3873                 cat >conftest.$ac_ext <<_ACEOF
3874 #line 3874 "configure"
3875 #include "confdefs.h"
3876 #include <sys/types.h>
3877 int
3878 main (void)
3879 {
3880
3881                         #ifndef _XOPEN_SOURCE
3882                         #error  expected _XOPEN_SOURCE to be defined
3883                         #endif
3884   ;
3885   return 0;
3886 }
3887 _ACEOF
3888 rm -f conftest.$ac_objext
3889 if { (eval echo "$as_me:3889: \"$ac_compile\"") >&5
3890   (eval $ac_compile) 2>&5
3891   ac_status=$?
3892   echo "$as_me:3892: \$? = $ac_status" >&5
3893   (exit $ac_status); } &&
3894          { ac_try='test -s conftest.$ac_objext'
3895   { (eval echo "$as_me:3895: \"$ac_try\"") >&5
3896   (eval $ac_try) 2>&5
3897   ac_status=$?
3898   echo "$as_me:3898: \$? = $ac_status" >&5
3899   (exit $ac_status); }; }; then
3900   cf_cv_gnu_source=no
3901 else
3902   echo "$as_me: failed program was:" >&5
3903 cat conftest.$ac_ext >&5
3904 cf_save="$CPPFLAGS"
3905
3906 cf_fix_cppflags=no
3907 cf_new_cflags=
3908 cf_new_cppflags=
3909 cf_new_extra_cppflags=
3910
3911 for cf_add_cflags in -D_GNU_SOURCE
3912 do
3913 case $cf_fix_cppflags in
3914 (no)
3915         case $cf_add_cflags in
3916         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3917                 case $cf_add_cflags in
3918                 (-D*)
3919                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3920
3921                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3922                                 && test -z "${cf_tst_cflags}" \
3923                                 && cf_fix_cppflags=yes
3924
3925                         if test $cf_fix_cppflags = yes ; then
3926
3927         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3928         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3929
3930                                 continue
3931                         elif test "${cf_tst_cflags}" = "\"'" ; then
3932
3933         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3934         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3935
3936                                 continue
3937                         fi
3938                         ;;
3939                 esac
3940                 case "$CPPFLAGS" in
3941                 (*$cf_add_cflags)
3942                         ;;
3943                 (*)
3944                         case $cf_add_cflags in
3945                         (-D*)
3946                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3947
3948 CPPFLAGS=`echo "$CPPFLAGS" | \
3949         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3950                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3951
3952                                 ;;
3953                         esac
3954
3955         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3956         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3957
3958                         ;;
3959                 esac
3960                 ;;
3961         (*)
3962
3963         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3964         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3965
3966                 ;;
3967         esac
3968         ;;
3969 (yes)
3970
3971         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3972         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3973
3974         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3975
3976         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3977                 && test -z "${cf_tst_cflags}" \
3978                 && cf_fix_cppflags=no
3979         ;;
3980 esac
3981 done
3982
3983 if test -n "$cf_new_cflags" ; then
3984
3985         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3986         CFLAGS="${CFLAGS}$cf_new_cflags"
3987
3988 fi
3989
3990 if test -n "$cf_new_cppflags" ; then
3991
3992         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3993         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3994
3995 fi
3996
3997 if test -n "$cf_new_extra_cppflags" ; then
3998
3999         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4000         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4001
4002 fi
4003
4004                          cat >conftest.$ac_ext <<_ACEOF
4005 #line 4005 "configure"
4006 #include "confdefs.h"
4007 #include <sys/types.h>
4008 int
4009 main (void)
4010 {
4011
4012                                 #ifdef _XOPEN_SOURCE
4013                                 #error  expected _XOPEN_SOURCE to be undefined
4014                                 #endif
4015   ;
4016   return 0;
4017 }
4018 _ACEOF
4019 rm -f conftest.$ac_objext
4020 if { (eval echo "$as_me:4020: \"$ac_compile\"") >&5
4021   (eval $ac_compile) 2>&5
4022   ac_status=$?
4023   echo "$as_me:4023: \$? = $ac_status" >&5
4024   (exit $ac_status); } &&
4025          { ac_try='test -s conftest.$ac_objext'
4026   { (eval echo "$as_me:4026: \"$ac_try\"") >&5
4027   (eval $ac_try) 2>&5
4028   ac_status=$?
4029   echo "$as_me:4029: \$? = $ac_status" >&5
4030   (exit $ac_status); }; }; then
4031   cf_cv_gnu_source=no
4032 else
4033   echo "$as_me: failed program was:" >&5
4034 cat conftest.$ac_ext >&5
4035 cf_cv_gnu_source=yes
4036 fi
4037 rm -f conftest.$ac_objext conftest.$ac_ext
4038                         CPPFLAGS="$cf_save"
4039
4040 fi
4041 rm -f conftest.$ac_objext conftest.$ac_ext
4042
4043 fi
4044 echo "$as_me:4044: result: $cf_cv_gnu_source" >&5
4045 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4046
4047                 if test "$cf_cv_gnu_source" = yes
4048                 then
4049                 echo "$as_me:4049: checking if we should also define _DEFAULT_SOURCE" >&5
4050 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4051 if test "${cf_cv_default_source+set}" = set; then
4052   echo $ECHO_N "(cached) $ECHO_C" >&6
4053 else
4054
4055         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4056         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4057
4058                         cat >conftest.$ac_ext <<_ACEOF
4059 #line 4059 "configure"
4060 #include "confdefs.h"
4061 #include <sys/types.h>
4062 int
4063 main (void)
4064 {
4065
4066                                 #ifdef _DEFAULT_SOURCE
4067                                 #error  expected _DEFAULT_SOURCE to be undefined
4068                                 #endif
4069   ;
4070   return 0;
4071 }
4072 _ACEOF
4073 rm -f conftest.$ac_objext
4074 if { (eval echo "$as_me:4074: \"$ac_compile\"") >&5
4075   (eval $ac_compile) 2>&5
4076   ac_status=$?
4077   echo "$as_me:4077: \$? = $ac_status" >&5
4078   (exit $ac_status); } &&
4079          { ac_try='test -s conftest.$ac_objext'
4080   { (eval echo "$as_me:4080: \"$ac_try\"") >&5
4081   (eval $ac_try) 2>&5
4082   ac_status=$?
4083   echo "$as_me:4083: \$? = $ac_status" >&5
4084   (exit $ac_status); }; }; then
4085   cf_cv_default_source=no
4086 else
4087   echo "$as_me: failed program was:" >&5
4088 cat conftest.$ac_ext >&5
4089 cf_cv_default_source=yes
4090 fi
4091 rm -f conftest.$ac_objext conftest.$ac_ext
4092
4093 fi
4094 echo "$as_me:4094: result: $cf_cv_default_source" >&5
4095 echo "${ECHO_T}$cf_cv_default_source" >&6
4096                         if test "$cf_cv_default_source" = yes
4097                         then
4098
4099         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4100         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4101
4102                         fi
4103                 fi
4104         fi
4105
4106 fi
4107
4108         ;;
4109 (minix*)
4110         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4111         ;;
4112 (mirbsd*)
4113         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4114         cf_XOPEN_SOURCE=
4115
4116 if test "$cf_cv_posix_visible" = no; then
4117
4118 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4119
4120 cf_save_CFLAGS="$CFLAGS"
4121 cf_save_CPPFLAGS="$CPPFLAGS"
4122
4123 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4124         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4125                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4126
4127 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4128         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4129                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4130
4131 echo "$as_me:4131: checking if we should define _POSIX_C_SOURCE" >&5
4132 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4133 if test "${cf_cv_posix_c_source+set}" = set; then
4134   echo $ECHO_N "(cached) $ECHO_C" >&6
4135 else
4136
4137 echo "${as_me:-configure}:4137: testing if the symbol is already defined go no further ..." 1>&5
4138
4139         cat >conftest.$ac_ext <<_ACEOF
4140 #line 4140 "configure"
4141 #include "confdefs.h"
4142 #include <sys/types.h>
4143 int
4144 main (void)
4145 {
4146
4147 #ifndef _POSIX_C_SOURCE
4148 make an error
4149 #endif
4150   ;
4151   return 0;
4152 }
4153 _ACEOF
4154 rm -f conftest.$ac_objext
4155 if { (eval echo "$as_me:4155: \"$ac_compile\"") >&5
4156   (eval $ac_compile) 2>&5
4157   ac_status=$?
4158   echo "$as_me:4158: \$? = $ac_status" >&5
4159   (exit $ac_status); } &&
4160          { ac_try='test -s conftest.$ac_objext'
4161   { (eval echo "$as_me:4161: \"$ac_try\"") >&5
4162   (eval $ac_try) 2>&5
4163   ac_status=$?
4164   echo "$as_me:4164: \$? = $ac_status" >&5
4165   (exit $ac_status); }; }; then
4166   cf_cv_posix_c_source=no
4167 else
4168   echo "$as_me: failed program was:" >&5
4169 cat conftest.$ac_ext >&5
4170 cf_want_posix_source=no
4171          case .$cf_POSIX_C_SOURCE in
4172          (.[12]??*)
4173                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4174                 ;;
4175          (.2)
4176                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4177                 cf_want_posix_source=yes
4178                 ;;
4179          (.*)
4180                 cf_want_posix_source=yes
4181                 ;;
4182          esac
4183          if test "$cf_want_posix_source" = yes ; then
4184                 cat >conftest.$ac_ext <<_ACEOF
4185 #line 4185 "configure"
4186 #include "confdefs.h"
4187 #include <sys/types.h>
4188 int
4189 main (void)
4190 {
4191
4192 #ifdef _POSIX_SOURCE
4193 make an error
4194 #endif
4195   ;
4196   return 0;
4197 }
4198 _ACEOF
4199 rm -f conftest.$ac_objext
4200 if { (eval echo "$as_me:4200: \"$ac_compile\"") >&5
4201   (eval $ac_compile) 2>&5
4202   ac_status=$?
4203   echo "$as_me:4203: \$? = $ac_status" >&5
4204   (exit $ac_status); } &&
4205          { ac_try='test -s conftest.$ac_objext'
4206   { (eval echo "$as_me:4206: \"$ac_try\"") >&5
4207   (eval $ac_try) 2>&5
4208   ac_status=$?
4209   echo "$as_me:4209: \$? = $ac_status" >&5
4210   (exit $ac_status); }; }; then
4211   :
4212 else
4213   echo "$as_me: failed program was:" >&5
4214 cat conftest.$ac_ext >&5
4215 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4216 fi
4217 rm -f conftest.$ac_objext conftest.$ac_ext
4218          fi
4219
4220 echo "${as_me:-configure}:4220: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4221
4222          CFLAGS="$cf_trim_CFLAGS"
4223          CPPFLAGS="$cf_trim_CPPFLAGS"
4224
4225         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4226         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4227
4228 echo "${as_me:-configure}:4228: testing if the second compile does not leave our definition intact error ..." 1>&5
4229
4230          cat >conftest.$ac_ext <<_ACEOF
4231 #line 4231 "configure"
4232 #include "confdefs.h"
4233 #include <sys/types.h>
4234 int
4235 main (void)
4236 {
4237
4238 #ifndef _POSIX_C_SOURCE
4239 make an error
4240 #endif
4241   ;
4242   return 0;
4243 }
4244 _ACEOF
4245 rm -f conftest.$ac_objext
4246 if { (eval echo "$as_me:4246: \"$ac_compile\"") >&5
4247   (eval $ac_compile) 2>&5
4248   ac_status=$?
4249   echo "$as_me:4249: \$? = $ac_status" >&5
4250   (exit $ac_status); } &&
4251          { ac_try='test -s conftest.$ac_objext'
4252   { (eval echo "$as_me:4252: \"$ac_try\"") >&5
4253   (eval $ac_try) 2>&5
4254   ac_status=$?
4255   echo "$as_me:4255: \$? = $ac_status" >&5
4256   (exit $ac_status); }; }; then
4257   :
4258 else
4259   echo "$as_me: failed program was:" >&5
4260 cat conftest.$ac_ext >&5
4261 cf_cv_posix_c_source=no
4262 fi
4263 rm -f conftest.$ac_objext conftest.$ac_ext
4264          CFLAGS="$cf_save_CFLAGS"
4265          CPPFLAGS="$cf_save_CPPFLAGS"
4266
4267 fi
4268 rm -f conftest.$ac_objext conftest.$ac_ext
4269
4270 fi
4271 echo "$as_me:4271: result: $cf_cv_posix_c_source" >&5
4272 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4273
4274 if test "$cf_cv_posix_c_source" != no ; then
4275         CFLAGS="$cf_trim_CFLAGS"
4276         CPPFLAGS="$cf_trim_CPPFLAGS"
4277
4278 cf_fix_cppflags=no
4279 cf_new_cflags=
4280 cf_new_cppflags=
4281 cf_new_extra_cppflags=
4282
4283 for cf_add_cflags in $cf_cv_posix_c_source
4284 do
4285 case $cf_fix_cppflags in
4286 (no)
4287         case $cf_add_cflags in
4288         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4289                 case $cf_add_cflags in
4290                 (-D*)
4291                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4292
4293                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4294                                 && test -z "${cf_tst_cflags}" \
4295                                 && cf_fix_cppflags=yes
4296
4297                         if test $cf_fix_cppflags = yes ; then
4298
4299         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4300         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4301
4302                                 continue
4303                         elif test "${cf_tst_cflags}" = "\"'" ; then
4304
4305         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4306         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4307
4308                                 continue
4309                         fi
4310                         ;;
4311                 esac
4312                 case "$CPPFLAGS" in
4313                 (*$cf_add_cflags)
4314                         ;;
4315                 (*)
4316                         case $cf_add_cflags in
4317                         (-D*)
4318                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4319
4320 CPPFLAGS=`echo "$CPPFLAGS" | \
4321         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4322                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4323
4324                                 ;;
4325                         esac
4326
4327         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4328         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4329
4330                         ;;
4331                 esac
4332                 ;;
4333         (*)
4334
4335         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4336         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4337
4338                 ;;
4339         esac
4340         ;;
4341 (yes)
4342
4343         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4344         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4345
4346         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4347
4348         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4349                 && test -z "${cf_tst_cflags}" \
4350                 && cf_fix_cppflags=no
4351         ;;
4352 esac
4353 done
4354
4355 if test -n "$cf_new_cflags" ; then
4356
4357         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4358         CFLAGS="${CFLAGS}$cf_new_cflags"
4359
4360 fi
4361
4362 if test -n "$cf_new_cppflags" ; then
4363
4364         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4365         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4366
4367 fi
4368
4369 if test -n "$cf_new_extra_cppflags" ; then
4370
4371         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4372         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4373
4374 fi
4375
4376 fi
4377
4378 fi # cf_cv_posix_visible
4379
4380         ;;
4381 (netbsd*)
4382         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4383         ;;
4384 (openbsd[4-9]*)
4385         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4386         cf_xopen_source="-D_BSD_SOURCE"
4387         cf_XOPEN_SOURCE=600
4388         ;;
4389 (openbsd*)
4390         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4391         ;;
4392 (osf[45]*)
4393         cf_xopen_source="-D_OSF_SOURCE"
4394         ;;
4395 (nto-qnx*)
4396         cf_xopen_source="-D_QNX_SOURCE"
4397         ;;
4398 (sco*)
4399         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4400         ;;
4401 (solaris2.*)
4402         cf_xopen_source="-D__EXTENSIONS__"
4403         cf_cv_xopen_source=broken
4404         ;;
4405 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4406         cf_XOPEN_SOURCE=
4407         cf_POSIX_C_SOURCE=
4408         ;;
4409 (*)
4410
4411 echo "$as_me:4411: checking if we should define _XOPEN_SOURCE" >&5
4412 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4413 if test "${cf_cv_xopen_source+set}" = set; then
4414   echo $ECHO_N "(cached) $ECHO_C" >&6
4415 else
4416
4417         cat >conftest.$ac_ext <<_ACEOF
4418 #line 4418 "configure"
4419 #include "confdefs.h"
4420
4421 #include <stdlib.h>
4422 #include <string.h>
4423 #include <sys/types.h>
4424
4425 int
4426 main (void)
4427 {
4428
4429 #ifndef _XOPEN_SOURCE
4430 make an error
4431 #endif
4432   ;
4433   return 0;
4434 }
4435 _ACEOF
4436 rm -f conftest.$ac_objext
4437 if { (eval echo "$as_me:4437: \"$ac_compile\"") >&5
4438   (eval $ac_compile) 2>&5
4439   ac_status=$?
4440   echo "$as_me:4440: \$? = $ac_status" >&5
4441   (exit $ac_status); } &&
4442          { ac_try='test -s conftest.$ac_objext'
4443   { (eval echo "$as_me:4443: \"$ac_try\"") >&5
4444   (eval $ac_try) 2>&5
4445   ac_status=$?
4446   echo "$as_me:4446: \$? = $ac_status" >&5
4447   (exit $ac_status); }; }; then
4448   cf_cv_xopen_source=no
4449 else
4450   echo "$as_me: failed program was:" >&5
4451 cat conftest.$ac_ext >&5
4452 cf_save="$CPPFLAGS"
4453
4454         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4455         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4456
4457          cat >conftest.$ac_ext <<_ACEOF
4458 #line 4458 "configure"
4459 #include "confdefs.h"
4460
4461 #include <stdlib.h>
4462 #include <string.h>
4463 #include <sys/types.h>
4464
4465 int
4466 main (void)
4467 {
4468
4469 #ifdef _XOPEN_SOURCE
4470 make an error
4471 #endif
4472   ;
4473   return 0;
4474 }
4475 _ACEOF
4476 rm -f conftest.$ac_objext
4477 if { (eval echo "$as_me:4477: \"$ac_compile\"") >&5
4478   (eval $ac_compile) 2>&5
4479   ac_status=$?
4480   echo "$as_me:4480: \$? = $ac_status" >&5
4481   (exit $ac_status); } &&
4482          { ac_try='test -s conftest.$ac_objext'
4483   { (eval echo "$as_me:4483: \"$ac_try\"") >&5
4484   (eval $ac_try) 2>&5
4485   ac_status=$?
4486   echo "$as_me:4486: \$? = $ac_status" >&5
4487   (exit $ac_status); }; }; then
4488   cf_cv_xopen_source=no
4489 else
4490   echo "$as_me: failed program was:" >&5
4491 cat conftest.$ac_ext >&5
4492 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4493 fi
4494 rm -f conftest.$ac_objext conftest.$ac_ext
4495         CPPFLAGS="$cf_save"
4496
4497 fi
4498 rm -f conftest.$ac_objext conftest.$ac_ext
4499
4500 fi
4501 echo "$as_me:4501: result: $cf_cv_xopen_source" >&5
4502 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4503
4504 if test "$cf_cv_xopen_source" != no ; then
4505
4506 CFLAGS=`echo "$CFLAGS" | \
4507         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4508                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4509
4510 CPPFLAGS=`echo "$CPPFLAGS" | \
4511         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4512                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4513
4514         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4515
4516 cf_fix_cppflags=no
4517 cf_new_cflags=
4518 cf_new_cppflags=
4519 cf_new_extra_cppflags=
4520
4521 for cf_add_cflags in $cf_temp_xopen_source
4522 do
4523 case $cf_fix_cppflags in
4524 (no)
4525         case $cf_add_cflags in
4526         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4527                 case $cf_add_cflags in
4528                 (-D*)
4529                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4530
4531                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4532                                 && test -z "${cf_tst_cflags}" \
4533                                 && cf_fix_cppflags=yes
4534
4535                         if test $cf_fix_cppflags = yes ; then
4536
4537         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4538         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4539
4540                                 continue
4541                         elif test "${cf_tst_cflags}" = "\"'" ; then
4542
4543         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4544         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4545
4546                                 continue
4547                         fi
4548                         ;;
4549                 esac
4550                 case "$CPPFLAGS" in
4551                 (*$cf_add_cflags)
4552                         ;;
4553                 (*)
4554                         case $cf_add_cflags in
4555                         (-D*)
4556                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4557
4558 CPPFLAGS=`echo "$CPPFLAGS" | \
4559         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4560                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4561
4562                                 ;;
4563                         esac
4564
4565         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4566         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4567
4568                         ;;
4569                 esac
4570                 ;;
4571         (*)
4572
4573         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4574         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4575
4576                 ;;
4577         esac
4578         ;;
4579 (yes)
4580
4581         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4582         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4583
4584         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4585
4586         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4587                 && test -z "${cf_tst_cflags}" \
4588                 && cf_fix_cppflags=no
4589         ;;
4590 esac
4591 done
4592
4593 if test -n "$cf_new_cflags" ; then
4594
4595         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4596         CFLAGS="${CFLAGS}$cf_new_cflags"
4597
4598 fi
4599
4600 if test -n "$cf_new_cppflags" ; then
4601
4602         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4603         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4604
4605 fi
4606
4607 if test -n "$cf_new_extra_cppflags" ; then
4608
4609         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4610         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4611
4612 fi
4613
4614 fi
4615
4616 if test "$cf_cv_posix_visible" = no; then
4617
4618 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4619
4620 cf_save_CFLAGS="$CFLAGS"
4621 cf_save_CPPFLAGS="$CPPFLAGS"
4622
4623 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4624         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4625                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4626
4627 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4628         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4629                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4630
4631 echo "$as_me:4631: checking if we should define _POSIX_C_SOURCE" >&5
4632 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4633 if test "${cf_cv_posix_c_source+set}" = set; then
4634   echo $ECHO_N "(cached) $ECHO_C" >&6
4635 else
4636
4637 echo "${as_me:-configure}:4637: testing if the symbol is already defined go no further ..." 1>&5
4638
4639         cat >conftest.$ac_ext <<_ACEOF
4640 #line 4640 "configure"
4641 #include "confdefs.h"
4642 #include <sys/types.h>
4643 int
4644 main (void)
4645 {
4646
4647 #ifndef _POSIX_C_SOURCE
4648 make an error
4649 #endif
4650   ;
4651   return 0;
4652 }
4653 _ACEOF
4654 rm -f conftest.$ac_objext
4655 if { (eval echo "$as_me:4655: \"$ac_compile\"") >&5
4656   (eval $ac_compile) 2>&5
4657   ac_status=$?
4658   echo "$as_me:4658: \$? = $ac_status" >&5
4659   (exit $ac_status); } &&
4660          { ac_try='test -s conftest.$ac_objext'
4661   { (eval echo "$as_me:4661: \"$ac_try\"") >&5
4662   (eval $ac_try) 2>&5
4663   ac_status=$?
4664   echo "$as_me:4664: \$? = $ac_status" >&5
4665   (exit $ac_status); }; }; then
4666   cf_cv_posix_c_source=no
4667 else
4668   echo "$as_me: failed program was:" >&5
4669 cat conftest.$ac_ext >&5
4670 cf_want_posix_source=no
4671          case .$cf_POSIX_C_SOURCE in
4672          (.[12]??*)
4673                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4674                 ;;
4675          (.2)
4676                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4677                 cf_want_posix_source=yes
4678                 ;;
4679          (.*)
4680                 cf_want_posix_source=yes
4681                 ;;
4682          esac
4683          if test "$cf_want_posix_source" = yes ; then
4684                 cat >conftest.$ac_ext <<_ACEOF
4685 #line 4685 "configure"
4686 #include "confdefs.h"
4687 #include <sys/types.h>
4688 int
4689 main (void)
4690 {
4691
4692 #ifdef _POSIX_SOURCE
4693 make an error
4694 #endif
4695   ;
4696   return 0;
4697 }
4698 _ACEOF
4699 rm -f conftest.$ac_objext
4700 if { (eval echo "$as_me:4700: \"$ac_compile\"") >&5
4701   (eval $ac_compile) 2>&5
4702   ac_status=$?
4703   echo "$as_me:4703: \$? = $ac_status" >&5
4704   (exit $ac_status); } &&
4705          { ac_try='test -s conftest.$ac_objext'
4706   { (eval echo "$as_me:4706: \"$ac_try\"") >&5
4707   (eval $ac_try) 2>&5
4708   ac_status=$?
4709   echo "$as_me:4709: \$? = $ac_status" >&5
4710   (exit $ac_status); }; }; then
4711   :
4712 else
4713   echo "$as_me: failed program was:" >&5
4714 cat conftest.$ac_ext >&5
4715 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4716 fi
4717 rm -f conftest.$ac_objext conftest.$ac_ext
4718          fi
4719
4720 echo "${as_me:-configure}:4720: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4721
4722          CFLAGS="$cf_trim_CFLAGS"
4723          CPPFLAGS="$cf_trim_CPPFLAGS"
4724
4725         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4726         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4727
4728 echo "${as_me:-configure}:4728: testing if the second compile does not leave our definition intact error ..." 1>&5
4729
4730          cat >conftest.$ac_ext <<_ACEOF
4731 #line 4731 "configure"
4732 #include "confdefs.h"
4733 #include <sys/types.h>
4734 int
4735 main (void)
4736 {
4737
4738 #ifndef _POSIX_C_SOURCE
4739 make an error
4740 #endif
4741   ;
4742   return 0;
4743 }
4744 _ACEOF
4745 rm -f conftest.$ac_objext
4746 if { (eval echo "$as_me:4746: \"$ac_compile\"") >&5
4747   (eval $ac_compile) 2>&5
4748   ac_status=$?
4749   echo "$as_me:4749: \$? = $ac_status" >&5
4750   (exit $ac_status); } &&
4751          { ac_try='test -s conftest.$ac_objext'
4752   { (eval echo "$as_me:4752: \"$ac_try\"") >&5
4753   (eval $ac_try) 2>&5
4754   ac_status=$?
4755   echo "$as_me:4755: \$? = $ac_status" >&5
4756   (exit $ac_status); }; }; then
4757   :
4758 else
4759   echo "$as_me: failed program was:" >&5
4760 cat conftest.$ac_ext >&5
4761 cf_cv_posix_c_source=no
4762 fi
4763 rm -f conftest.$ac_objext conftest.$ac_ext
4764          CFLAGS="$cf_save_CFLAGS"
4765          CPPFLAGS="$cf_save_CPPFLAGS"
4766
4767 fi
4768 rm -f conftest.$ac_objext conftest.$ac_ext
4769
4770 fi
4771 echo "$as_me:4771: result: $cf_cv_posix_c_source" >&5
4772 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4773
4774 if test "$cf_cv_posix_c_source" != no ; then
4775         CFLAGS="$cf_trim_CFLAGS"
4776         CPPFLAGS="$cf_trim_CPPFLAGS"
4777
4778 cf_fix_cppflags=no
4779 cf_new_cflags=
4780 cf_new_cppflags=
4781 cf_new_extra_cppflags=
4782
4783 for cf_add_cflags in $cf_cv_posix_c_source
4784 do
4785 case $cf_fix_cppflags in
4786 (no)
4787         case $cf_add_cflags in
4788         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4789                 case $cf_add_cflags in
4790                 (-D*)
4791                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4792
4793                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4794                                 && test -z "${cf_tst_cflags}" \
4795                                 && cf_fix_cppflags=yes
4796
4797                         if test $cf_fix_cppflags = yes ; then
4798
4799         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4800         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4801
4802                                 continue
4803                         elif test "${cf_tst_cflags}" = "\"'" ; then
4804
4805         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4806         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4807
4808                                 continue
4809                         fi
4810                         ;;
4811                 esac
4812                 case "$CPPFLAGS" in
4813                 (*$cf_add_cflags)
4814                         ;;
4815                 (*)
4816                         case $cf_add_cflags in
4817                         (-D*)
4818                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4819
4820 CPPFLAGS=`echo "$CPPFLAGS" | \
4821         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4822                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4823
4824                                 ;;
4825                         esac
4826
4827         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4828         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4829
4830                         ;;
4831                 esac
4832                 ;;
4833         (*)
4834
4835         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4836         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4837
4838                 ;;
4839         esac
4840         ;;
4841 (yes)
4842
4843         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4844         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4845
4846         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4847
4848         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4849                 && test -z "${cf_tst_cflags}" \
4850                 && cf_fix_cppflags=no
4851         ;;
4852 esac
4853 done
4854
4855 if test -n "$cf_new_cflags" ; then
4856
4857         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4858         CFLAGS="${CFLAGS}$cf_new_cflags"
4859
4860 fi
4861
4862 if test -n "$cf_new_cppflags" ; then
4863
4864         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4865         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4866
4867 fi
4868
4869 if test -n "$cf_new_extra_cppflags" ; then
4870
4871         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4872         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4873
4874 fi
4875
4876 fi
4877
4878 fi # cf_cv_posix_visible
4879
4880         ;;
4881 esac
4882
4883 if test -n "$cf_xopen_source" ; then
4884
4885 cf_fix_cppflags=no
4886 cf_new_cflags=
4887 cf_new_cppflags=
4888 cf_new_extra_cppflags=
4889
4890 for cf_add_cflags in $cf_xopen_source
4891 do
4892 case $cf_fix_cppflags in
4893 (no)
4894         case $cf_add_cflags in
4895         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4896                 case $cf_add_cflags in
4897                 (-D*)
4898                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4899
4900                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4901                                 && test -z "${cf_tst_cflags}" \
4902                                 && cf_fix_cppflags=yes
4903
4904                         if test $cf_fix_cppflags = yes ; then
4905
4906         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4907         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4908
4909                                 continue
4910                         elif test "${cf_tst_cflags}" = "\"'" ; then
4911
4912         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4913         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4914
4915                                 continue
4916                         fi
4917                         ;;
4918                 esac
4919                 case "$CPPFLAGS" in
4920                 (*$cf_add_cflags)
4921                         ;;
4922                 (*)
4923                         case $cf_add_cflags in
4924                         (-D*)
4925                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4926
4927 CPPFLAGS=`echo "$CPPFLAGS" | \
4928         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4929                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4930
4931                                 ;;
4932                         esac
4933
4934         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4935         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4936
4937                         ;;
4938                 esac
4939                 ;;
4940         (*)
4941
4942         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4943         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4944
4945                 ;;
4946         esac
4947         ;;
4948 (yes)
4949
4950         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4951         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4952
4953         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4954
4955         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4956                 && test -z "${cf_tst_cflags}" \
4957                 && cf_fix_cppflags=no
4958         ;;
4959 esac
4960 done
4961
4962 if test -n "$cf_new_cflags" ; then
4963         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4964
4965 echo "${as_me:-configure}:4965: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4966
4967         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4968         CFLAGS="${CFLAGS}$cf_new_cflags"
4969
4970 fi
4971
4972 if test -n "$cf_new_cppflags" ; then
4973         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4974
4975 echo "${as_me:-configure}:4975: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4976
4977         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4978         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4979
4980 fi
4981
4982 if test -n "$cf_new_extra_cppflags" ; then
4983         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4984
4985 echo "${as_me:-configure}:4985: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4986
4987         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4988         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4989
4990 fi
4991
4992 fi
4993
4994 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4995         echo "$as_me:4995: checking if _XOPEN_SOURCE really is set" >&5
4996 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4997         cat >conftest.$ac_ext <<_ACEOF
4998 #line 4998 "configure"
4999 #include "confdefs.h"
5000 #include <stdlib.h>
5001 int
5002 main (void)
5003 {
5004
5005 #ifndef _XOPEN_SOURCE
5006 make an error
5007 #endif
5008   ;
5009   return 0;
5010 }
5011 _ACEOF
5012 rm -f conftest.$ac_objext
5013 if { (eval echo "$as_me:5013: \"$ac_compile\"") >&5
5014   (eval $ac_compile) 2>&5
5015   ac_status=$?
5016   echo "$as_me:5016: \$? = $ac_status" >&5
5017   (exit $ac_status); } &&
5018          { ac_try='test -s conftest.$ac_objext'
5019   { (eval echo "$as_me:5019: \"$ac_try\"") >&5
5020   (eval $ac_try) 2>&5
5021   ac_status=$?
5022   echo "$as_me:5022: \$? = $ac_status" >&5
5023   (exit $ac_status); }; }; then
5024   cf_XOPEN_SOURCE_set=yes
5025 else
5026   echo "$as_me: failed program was:" >&5
5027 cat conftest.$ac_ext >&5
5028 cf_XOPEN_SOURCE_set=no
5029 fi
5030 rm -f conftest.$ac_objext conftest.$ac_ext
5031         echo "$as_me:5031: result: $cf_XOPEN_SOURCE_set" >&5
5032 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5033         if test $cf_XOPEN_SOURCE_set = yes
5034         then
5035                 cat >conftest.$ac_ext <<_ACEOF
5036 #line 5036 "configure"
5037 #include "confdefs.h"
5038 #include <stdlib.h>
5039 int
5040 main (void)
5041 {
5042
5043 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5044 make an error
5045 #endif
5046   ;
5047   return 0;
5048 }
5049 _ACEOF
5050 rm -f conftest.$ac_objext
5051 if { (eval echo "$as_me:5051: \"$ac_compile\"") >&5
5052   (eval $ac_compile) 2>&5
5053   ac_status=$?
5054   echo "$as_me:5054: \$? = $ac_status" >&5
5055   (exit $ac_status); } &&
5056          { ac_try='test -s conftest.$ac_objext'
5057   { (eval echo "$as_me:5057: \"$ac_try\"") >&5
5058   (eval $ac_try) 2>&5
5059   ac_status=$?
5060   echo "$as_me:5060: \$? = $ac_status" >&5
5061   (exit $ac_status); }; }; then
5062   cf_XOPEN_SOURCE_set_ok=yes
5063 else
5064   echo "$as_me: failed program was:" >&5
5065 cat conftest.$ac_ext >&5
5066 cf_XOPEN_SOURCE_set_ok=no
5067 fi
5068 rm -f conftest.$ac_objext conftest.$ac_ext
5069                 if test $cf_XOPEN_SOURCE_set_ok = no
5070                 then
5071                         { echo "$as_me:5071: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5072 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5073                 fi
5074         else
5075
5076 echo "$as_me:5076: checking if we should define _XOPEN_SOURCE" >&5
5077 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5078 if test "${cf_cv_xopen_source+set}" = set; then
5079   echo $ECHO_N "(cached) $ECHO_C" >&6
5080 else
5081
5082         cat >conftest.$ac_ext <<_ACEOF
5083 #line 5083 "configure"
5084 #include "confdefs.h"
5085
5086 #include <stdlib.h>
5087 #include <string.h>
5088 #include <sys/types.h>
5089
5090 int
5091 main (void)
5092 {
5093
5094 #ifndef _XOPEN_SOURCE
5095 make an error
5096 #endif
5097   ;
5098   return 0;
5099 }
5100 _ACEOF
5101 rm -f conftest.$ac_objext
5102 if { (eval echo "$as_me:5102: \"$ac_compile\"") >&5
5103   (eval $ac_compile) 2>&5
5104   ac_status=$?
5105   echo "$as_me:5105: \$? = $ac_status" >&5
5106   (exit $ac_status); } &&
5107          { ac_try='test -s conftest.$ac_objext'
5108   { (eval echo "$as_me:5108: \"$ac_try\"") >&5
5109   (eval $ac_try) 2>&5
5110   ac_status=$?
5111   echo "$as_me:5111: \$? = $ac_status" >&5
5112   (exit $ac_status); }; }; then
5113   cf_cv_xopen_source=no
5114 else
5115   echo "$as_me: failed program was:" >&5
5116 cat conftest.$ac_ext >&5
5117 cf_save="$CPPFLAGS"
5118
5119         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5120         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5121
5122          cat >conftest.$ac_ext <<_ACEOF
5123 #line 5123 "configure"
5124 #include "confdefs.h"
5125
5126 #include <stdlib.h>
5127 #include <string.h>
5128 #include <sys/types.h>
5129
5130 int
5131 main (void)
5132 {
5133
5134 #ifdef _XOPEN_SOURCE
5135 make an error
5136 #endif
5137   ;
5138   return 0;
5139 }
5140 _ACEOF
5141 rm -f conftest.$ac_objext
5142 if { (eval echo "$as_me:5142: \"$ac_compile\"") >&5
5143   (eval $ac_compile) 2>&5
5144   ac_status=$?
5145   echo "$as_me:5145: \$? = $ac_status" >&5
5146   (exit $ac_status); } &&
5147          { ac_try='test -s conftest.$ac_objext'
5148   { (eval echo "$as_me:5148: \"$ac_try\"") >&5
5149   (eval $ac_try) 2>&5
5150   ac_status=$?
5151   echo "$as_me:5151: \$? = $ac_status" >&5
5152   (exit $ac_status); }; }; then
5153   cf_cv_xopen_source=no
5154 else
5155   echo "$as_me: failed program was:" >&5
5156 cat conftest.$ac_ext >&5
5157 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5158 fi
5159 rm -f conftest.$ac_objext conftest.$ac_ext
5160         CPPFLAGS="$cf_save"
5161
5162 fi
5163 rm -f conftest.$ac_objext conftest.$ac_ext
5164
5165 fi
5166 echo "$as_me:5166: result: $cf_cv_xopen_source" >&5
5167 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5168
5169 if test "$cf_cv_xopen_source" != no ; then
5170
5171 CFLAGS=`echo "$CFLAGS" | \
5172         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5173                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5174
5175 CPPFLAGS=`echo "$CPPFLAGS" | \
5176         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5177                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5178
5179         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5180
5181 cf_fix_cppflags=no
5182 cf_new_cflags=
5183 cf_new_cppflags=
5184 cf_new_extra_cppflags=
5185
5186 for cf_add_cflags in $cf_temp_xopen_source
5187 do
5188 case $cf_fix_cppflags in
5189 (no)
5190         case $cf_add_cflags in
5191         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5192                 case $cf_add_cflags in
5193                 (-D*)
5194                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5195
5196                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5197                                 && test -z "${cf_tst_cflags}" \
5198                                 && cf_fix_cppflags=yes
5199
5200                         if test $cf_fix_cppflags = yes ; then
5201
5202         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5203         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5204
5205                                 continue
5206                         elif test "${cf_tst_cflags}" = "\"'" ; then
5207
5208         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5209         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5210
5211                                 continue
5212                         fi
5213                         ;;
5214                 esac
5215                 case "$CPPFLAGS" in
5216                 (*$cf_add_cflags)
5217                         ;;
5218                 (*)
5219                         case $cf_add_cflags in
5220                         (-D*)
5221                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5222
5223 CPPFLAGS=`echo "$CPPFLAGS" | \
5224         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5225                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5226
5227                                 ;;
5228                         esac
5229
5230         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5231         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5232
5233                         ;;
5234                 esac
5235                 ;;
5236         (*)
5237
5238         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5239         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5240
5241                 ;;
5242         esac
5243         ;;
5244 (yes)
5245
5246         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5247         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5248
5249         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5250
5251         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5252                 && test -z "${cf_tst_cflags}" \
5253                 && cf_fix_cppflags=no
5254         ;;
5255 esac
5256 done
5257
5258 if test -n "$cf_new_cflags" ; then
5259
5260         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5261         CFLAGS="${CFLAGS}$cf_new_cflags"
5262
5263 fi
5264
5265 if test -n "$cf_new_cppflags" ; then
5266
5267         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5268         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5269
5270 fi
5271
5272 if test -n "$cf_new_extra_cppflags" ; then
5273
5274         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5275         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5276
5277 fi
5278
5279 fi
5280
5281         fi
5282 fi
5283 fi # cf_cv_posix_visible
5284
5285 echo "$as_me:5285: checking for signal global datatype" >&5
5286 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5287 if test "${cf_cv_sig_atomic_t+set}" = set; then
5288   echo $ECHO_N "(cached) $ECHO_C" >&6
5289 else
5290
5291         for cf_type in \
5292                 "volatile sig_atomic_t" \
5293                 "sig_atomic_t" \
5294                 "int"
5295         do
5296         cat >conftest.$ac_ext <<_ACEOF
5297 #line 5297 "configure"
5298 #include "confdefs.h"
5299
5300 #include <sys/types.h>
5301 #include <signal.h>
5302 #include <stdio.h>
5303
5304 extern $cf_type x;
5305 $cf_type x;
5306 static void handler(int sig)
5307 {
5308         (void)sig;
5309         x = 5;
5310 }
5311 int
5312 main (void)
5313 {
5314 signal(SIGINT, handler);
5315                  x = 1
5316   ;
5317   return 0;
5318 }
5319 _ACEOF
5320 rm -f conftest.$ac_objext
5321 if { (eval echo "$as_me:5321: \"$ac_compile\"") >&5
5322   (eval $ac_compile) 2>&5
5323   ac_status=$?
5324   echo "$as_me:5324: \$? = $ac_status" >&5
5325   (exit $ac_status); } &&
5326          { ac_try='test -s conftest.$ac_objext'
5327   { (eval echo "$as_me:5327: \"$ac_try\"") >&5
5328   (eval $ac_try) 2>&5
5329   ac_status=$?
5330   echo "$as_me:5330: \$? = $ac_status" >&5
5331   (exit $ac_status); }; }; then
5332   cf_cv_sig_atomic_t=$cf_type
5333 else
5334   echo "$as_me: failed program was:" >&5
5335 cat conftest.$ac_ext >&5
5336 cf_cv_sig_atomic_t=no
5337 fi
5338 rm -f conftest.$ac_objext conftest.$ac_ext
5339                 test "$cf_cv_sig_atomic_t" != no && break
5340         done
5341
5342 fi
5343
5344 echo "$as_me:5344: result: $cf_cv_sig_atomic_t" >&5
5345 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5346 test "$cf_cv_sig_atomic_t" != no &&
5347 cat >>confdefs.h <<EOF
5348 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5349 EOF
5350
5351 # Work around breakage on OS X
5352
5353 echo "$as_me:5353: checking if SIGWINCH is defined" >&5
5354 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5355 if test "${cf_cv_define_sigwinch+set}" = set; then
5356   echo $ECHO_N "(cached) $ECHO_C" >&6
5357 else
5358
5359         cat >conftest.$ac_ext <<_ACEOF
5360 #line 5360 "configure"
5361 #include "confdefs.h"
5362
5363 #include <sys/types.h>
5364 #include <sys/signal.h>
5365
5366 int
5367 main (void)
5368 {
5369 int x = SIGWINCH; (void)x
5370   ;
5371   return 0;
5372 }
5373 _ACEOF
5374 rm -f conftest.$ac_objext
5375 if { (eval echo "$as_me:5375: \"$ac_compile\"") >&5
5376   (eval $ac_compile) 2>&5
5377   ac_status=$?
5378   echo "$as_me:5378: \$? = $ac_status" >&5
5379   (exit $ac_status); } &&
5380          { ac_try='test -s conftest.$ac_objext'
5381   { (eval echo "$as_me:5381: \"$ac_try\"") >&5
5382   (eval $ac_try) 2>&5
5383   ac_status=$?
5384   echo "$as_me:5384: \$? = $ac_status" >&5
5385   (exit $ac_status); }; }; then
5386   cf_cv_define_sigwinch=yes
5387 else
5388   echo "$as_me: failed program was:" >&5
5389 cat conftest.$ac_ext >&5
5390 cat >conftest.$ac_ext <<_ACEOF
5391 #line 5391 "configure"
5392 #include "confdefs.h"
5393
5394 #undef _XOPEN_SOURCE
5395 #undef _POSIX_SOURCE
5396 #undef _POSIX_C_SOURCE
5397 #include <sys/types.h>
5398 #include <sys/signal.h>
5399
5400 int
5401 main (void)
5402 {
5403 int x = SIGWINCH; (void)x
5404   ;
5405   return 0;
5406 }
5407 _ACEOF
5408 rm -f conftest.$ac_objext
5409 if { (eval echo "$as_me:5409: \"$ac_compile\"") >&5
5410   (eval $ac_compile) 2>&5
5411   ac_status=$?
5412   echo "$as_me:5412: \$? = $ac_status" >&5
5413   (exit $ac_status); } &&
5414          { ac_try='test -s conftest.$ac_objext'
5415   { (eval echo "$as_me:5415: \"$ac_try\"") >&5
5416   (eval $ac_try) 2>&5
5417   ac_status=$?
5418   echo "$as_me:5418: \$? = $ac_status" >&5
5419   (exit $ac_status); }; }; then
5420   cf_cv_define_sigwinch=maybe
5421 else
5422   echo "$as_me: failed program was:" >&5
5423 cat conftest.$ac_ext >&5
5424 cf_cv_define_sigwinch=no
5425 fi
5426 rm -f conftest.$ac_objext conftest.$ac_ext
5427
5428 fi
5429 rm -f conftest.$ac_objext conftest.$ac_ext
5430
5431 fi
5432 echo "$as_me:5432: result: $cf_cv_define_sigwinch" >&5
5433 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5434
5435 if test "$cf_cv_define_sigwinch" = maybe ; then
5436 echo "$as_me:5436: checking for actual SIGWINCH definition" >&5
5437 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5438 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5439   echo $ECHO_N "(cached) $ECHO_C" >&6
5440 else
5441
5442 cf_cv_fixup_sigwinch=unknown
5443 cf_sigwinch=32
5444 while test $cf_sigwinch != 1
5445 do
5446         cat >conftest.$ac_ext <<_ACEOF
5447 #line 5447 "configure"
5448 #include "confdefs.h"
5449
5450 #undef _XOPEN_SOURCE
5451 #undef _POSIX_SOURCE
5452 #undef _POSIX_C_SOURCE
5453 #include <sys/types.h>
5454 #include <sys/signal.h>
5455
5456 int
5457 main (void)
5458 {
5459
5460 #if SIGWINCH != $cf_sigwinch
5461 make an error
5462 #endif
5463 int x = SIGWINCH; (void)x
5464   ;
5465   return 0;
5466 }
5467 _ACEOF
5468 rm -f conftest.$ac_objext
5469 if { (eval echo "$as_me:5469: \"$ac_compile\"") >&5
5470   (eval $ac_compile) 2>&5
5471   ac_status=$?
5472   echo "$as_me:5472: \$? = $ac_status" >&5
5473   (exit $ac_status); } &&
5474          { ac_try='test -s conftest.$ac_objext'
5475   { (eval echo "$as_me:5475: \"$ac_try\"") >&5
5476   (eval $ac_try) 2>&5
5477   ac_status=$?
5478   echo "$as_me:5478: \$? = $ac_status" >&5
5479   (exit $ac_status); }; }; then
5480   cf_cv_fixup_sigwinch=$cf_sigwinch
5481          break
5482 else
5483   echo "$as_me: failed program was:" >&5
5484 cat conftest.$ac_ext >&5
5485 fi
5486 rm -f conftest.$ac_objext conftest.$ac_ext
5487
5488 cf_sigwinch=`expr $cf_sigwinch - 1`
5489 done
5490
5491 fi
5492 echo "$as_me:5492: result: $cf_cv_fixup_sigwinch" >&5
5493 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5494
5495         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5496                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5497         fi
5498 fi
5499
5500 # Checks for CODESET support.
5501
5502 echo "$as_me:5502: checking for nl_langinfo and CODESET" >&5
5503 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5504 if test "${am_cv_langinfo_codeset+set}" = set; then
5505   echo $ECHO_N "(cached) $ECHO_C" >&6
5506 else
5507   cat >conftest.$ac_ext <<_ACEOF
5508 #line 5508 "configure"
5509 #include "confdefs.h"
5510 #include <langinfo.h>
5511 int
5512 main (void)
5513 {
5514 char* cs = nl_langinfo(CODESET); (void)cs
5515   ;
5516   return 0;
5517 }
5518 _ACEOF
5519 rm -f conftest.$ac_objext conftest$ac_exeext
5520 if { (eval echo "$as_me:5520: \"$ac_link\"") >&5
5521   (eval $ac_link) 2>&5
5522   ac_status=$?
5523   echo "$as_me:5523: \$? = $ac_status" >&5
5524   (exit $ac_status); } &&
5525          { ac_try='test -s conftest$ac_exeext'
5526   { (eval echo "$as_me:5526: \"$ac_try\"") >&5
5527   (eval $ac_try) 2>&5
5528   ac_status=$?
5529   echo "$as_me:5529: \$? = $ac_status" >&5
5530   (exit $ac_status); }; }; then
5531   am_cv_langinfo_codeset=yes
5532 else
5533   echo "$as_me: failed program was:" >&5
5534 cat conftest.$ac_ext >&5
5535 am_cv_langinfo_codeset=no
5536 fi
5537 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5538
5539 fi
5540 echo "$as_me:5540: result: $am_cv_langinfo_codeset" >&5
5541 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5542         if test $am_cv_langinfo_codeset = yes; then
5543
5544 cat >>confdefs.h <<\EOF
5545 #define HAVE_LANGINFO_CODESET 1
5546 EOF
5547
5548         fi
5549
5550 echo "$as_me:5550: checking if you want to use pkg-config" >&5
5551 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5552
5553 # Check whether --with-pkg-config or --without-pkg-config was given.
5554 if test "${with_pkg_config+set}" = set; then
5555   withval="$with_pkg_config"
5556   cf_pkg_config=$withval
5557 else
5558   cf_pkg_config=yes
5559 fi;
5560 echo "$as_me:5560: result: $cf_pkg_config" >&5
5561 echo "${ECHO_T}$cf_pkg_config" >&6
5562
5563 case $cf_pkg_config in
5564 (no)
5565         PKG_CONFIG=none
5566         ;;
5567 (yes)
5568
5569 if test -n "$ac_tool_prefix"; then
5570   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5571 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5572 echo "$as_me:5572: checking for $ac_word" >&5
5573 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5574 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5575   echo $ECHO_N "(cached) $ECHO_C" >&6
5576 else
5577   case $PKG_CONFIG in
5578   [\\/]* | ?:[\\/]*)
5579   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5580   ;;
5581   *)
5582   ac_save_IFS=$IFS; IFS=$ac_path_separator
5583 ac_dummy="$PATH"
5584 for ac_dir in $ac_dummy; do
5585   IFS=$ac_save_IFS
5586   test -z "$ac_dir" && ac_dir=.
5587   if $as_executable_p "$ac_dir/$ac_word"; then
5588    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5589    echo "$as_me:5589: found $ac_dir/$ac_word" >&5
5590    break
5591 fi
5592 done
5593
5594   ;;
5595 esac
5596 fi
5597 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5598
5599 if test -n "$PKG_CONFIG"; then
5600   echo "$as_me:5600: result: $PKG_CONFIG" >&5
5601 echo "${ECHO_T}$PKG_CONFIG" >&6
5602 else
5603   echo "$as_me:5603: result: no" >&5
5604 echo "${ECHO_T}no" >&6
5605 fi
5606
5607 fi
5608 if test -z "$ac_cv_path_PKG_CONFIG"; then
5609   ac_pt_PKG_CONFIG=$PKG_CONFIG
5610   # Extract the first word of "pkg-config", so it can be a program name with args.
5611 set dummy pkg-config; ac_word=$2
5612 echo "$as_me:5612: checking for $ac_word" >&5
5613 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5614 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5615   echo $ECHO_N "(cached) $ECHO_C" >&6
5616 else
5617   case $ac_pt_PKG_CONFIG in
5618   [\\/]* | ?:[\\/]*)
5619   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5620   ;;
5621   *)
5622   ac_save_IFS=$IFS; IFS=$ac_path_separator
5623 ac_dummy="$PATH"
5624 for ac_dir in $ac_dummy; do
5625   IFS=$ac_save_IFS
5626   test -z "$ac_dir" && ac_dir=.
5627   if $as_executable_p "$ac_dir/$ac_word"; then
5628    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5629    echo "$as_me:5629: found $ac_dir/$ac_word" >&5
5630    break
5631 fi
5632 done
5633
5634   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5635   ;;
5636 esac
5637 fi
5638 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5639
5640 if test -n "$ac_pt_PKG_CONFIG"; then
5641   echo "$as_me:5641: result: $ac_pt_PKG_CONFIG" >&5
5642 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5643 else
5644   echo "$as_me:5644: result: no" >&5
5645 echo "${ECHO_T}no" >&6
5646 fi
5647
5648   PKG_CONFIG=$ac_pt_PKG_CONFIG
5649 else
5650   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5651 fi
5652
5653         ;;
5654 (*)
5655         PKG_CONFIG=$withval
5656         ;;
5657 esac
5658
5659 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5660 if test "$PKG_CONFIG" != none ; then
5661
5662 if test "x$prefix" != xNONE; then
5663         cf_path_syntax="$prefix"
5664 else
5665         cf_path_syntax="$ac_default_prefix"
5666 fi
5667
5668 case ".$PKG_CONFIG" in
5669 (.\$\(*\)*|.\'*\'*)
5670         ;;
5671 (..|./*|.\\*)
5672         ;;
5673 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5674         ;;
5675 (.\${*prefix}*|.\${*dir}*)
5676         eval PKG_CONFIG="$PKG_CONFIG"
5677         case ".$PKG_CONFIG" in
5678         (.NONE/*)
5679                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5680                 ;;
5681         esac
5682         ;;
5683 (.no|.NONE/*)
5684         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5685         ;;
5686 (*)
5687         { { echo "$as_me:5687: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5688 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5689    { (exit 1); exit 1; }; }
5690         ;;
5691 esac
5692
5693 elif test "x$cf_pkg_config" != xno ; then
5694         { echo "$as_me:5694: WARNING: pkg-config is not installed" >&5
5695 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5696 fi
5697
5698 echo "$as_me:5698: checking if you want to see long compiling messages" >&5
5699 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5700
5701 # Check whether --enable-echo or --disable-echo was given.
5702 if test "${enable_echo+set}" = set; then
5703   enableval="$enable_echo"
5704   test "$enableval" != no && enableval=yes
5705         if test "$enableval" != "yes" ; then
5706
5707         ECHO_LT='--silent'
5708         ECHO_LD='@echo linking $@;'
5709         RULE_CC='@echo compiling $<'
5710         SHOW_CC='@echo compiling $@'
5711         ECHO_CC='@'
5712
5713         else
5714
5715         ECHO_LT=''
5716         ECHO_LD=''
5717         RULE_CC=''
5718         SHOW_CC=''
5719         ECHO_CC=''
5720
5721         fi
5722 else
5723   enableval=yes
5724
5725         ECHO_LT=''
5726         ECHO_LD=''
5727         RULE_CC=''
5728         SHOW_CC=''
5729         ECHO_CC=''
5730
5731 fi;
5732 echo "$as_me:5732: result: $enableval" >&5
5733 echo "${ECHO_T}$enableval" >&6
5734
5735 echo "$as_me:5735: checking for ncurses wrap-prefix" >&5
5736 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5737
5738 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5739 if test "${with_ncurses_wrap_prefix+set}" = set; then
5740   withval="$with_ncurses_wrap_prefix"
5741   NCURSES_WRAP_PREFIX=$withval
5742 else
5743   NCURSES_WRAP_PREFIX=_nc_
5744 fi;
5745 echo "$as_me:5745: result: $NCURSES_WRAP_PREFIX" >&5
5746 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5747
5748 echo "$as_me:5748: checking if you want to check for wide-character functions" >&5
5749 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5750
5751 # Check whether --enable-widec or --disable-widec was given.
5752 if test "${enable_widec+set}" = set; then
5753   enableval="$enable_widec"
5754   test "$enableval" != no && enableval=yes
5755         if test "$enableval" != "yes" ; then
5756     cf_enable_widec=no
5757         else
5758                 cf_enable_widec=yes
5759         fi
5760 else
5761   enableval=yes
5762         cf_enable_widec=yes
5763
5764 fi;
5765 echo "$as_me:5765: result: $cf_enable_widec" >&5
5766 echo "${ECHO_T}$cf_enable_widec" >&6
5767
5768 echo "$as_me:5768: checking for specific curses-directory" >&5
5769 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5770
5771 # Check whether --with-curses-dir or --without-curses-dir was given.
5772 if test "${with_curses_dir+set}" = set; then
5773   withval="$with_curses_dir"
5774   cf_cv_curses_dir=$withval
5775 else
5776   cf_cv_curses_dir=no
5777 fi;
5778 echo "$as_me:5778: result: $cf_cv_curses_dir" >&5
5779 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5780
5781 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5782 then
5783
5784 if test "x$prefix" != xNONE; then
5785         cf_path_syntax="$prefix"
5786 else
5787         cf_path_syntax="$ac_default_prefix"
5788 fi
5789
5790 case ".$withval" in
5791 (.\$\(*\)*|.\'*\'*)
5792         ;;
5793 (..|./*|.\\*)
5794         ;;
5795 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5796         ;;
5797 (.\${*prefix}*|.\${*dir}*)
5798         eval withval="$withval"
5799         case ".$withval" in
5800         (.NONE/*)
5801                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5802                 ;;
5803         esac
5804         ;;
5805 (.no|.NONE/*)
5806         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5807         ;;
5808 (*)
5809         { { echo "$as_me:5809: error: expected a pathname, not \"$withval\"" >&5
5810 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5811    { (exit 1); exit 1; }; }
5812         ;;
5813 esac
5814
5815         if test -d "$cf_cv_curses_dir"
5816         then
5817
5818 if test -n "$cf_cv_curses_dir/include" ; then
5819   for cf_add_incdir in $cf_cv_curses_dir/include
5820   do
5821         while test $cf_add_incdir != /usr/include
5822         do
5823           if test -d $cf_add_incdir
5824           then
5825                 cf_have_incdir=no
5826                 if test -n "$CFLAGS$CPPFLAGS" ; then
5827                   # a loop is needed to ensure we can add subdirs of existing dirs
5828                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5829                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5830                           cf_have_incdir=yes; break
5831                         fi
5832                   done
5833                 fi
5834
5835                 if test "$cf_have_incdir" = no ; then
5836                   if test "$cf_add_incdir" = /usr/local/include ; then
5837                         if test "$GCC" = yes
5838                         then
5839                           cf_save_CPPFLAGS=$CPPFLAGS
5840
5841         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5842         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5843
5844                           cat >conftest.$ac_ext <<_ACEOF
5845 #line 5845 "configure"
5846 #include "confdefs.h"
5847 #include <stdio.h>
5848 int
5849 main (void)
5850 {
5851 printf("Hello")
5852   ;
5853   return 0;
5854 }
5855 _ACEOF
5856 rm -f conftest.$ac_objext
5857 if { (eval echo "$as_me:5857: \"$ac_compile\"") >&5
5858   (eval $ac_compile) 2>&5
5859   ac_status=$?
5860   echo "$as_me:5860: \$? = $ac_status" >&5
5861   (exit $ac_status); } &&
5862          { ac_try='test -s conftest.$ac_objext'
5863   { (eval echo "$as_me:5863: \"$ac_try\"") >&5
5864   (eval $ac_try) 2>&5
5865   ac_status=$?
5866   echo "$as_me:5866: \$? = $ac_status" >&5
5867   (exit $ac_status); }; }; then
5868   :
5869 else
5870   echo "$as_me: failed program was:" >&5
5871 cat conftest.$ac_ext >&5
5872 cf_have_incdir=yes
5873 fi
5874 rm -f conftest.$ac_objext conftest.$ac_ext
5875                           CPPFLAGS=$cf_save_CPPFLAGS
5876                         fi
5877                   fi
5878                 fi
5879
5880                 if test "$cf_have_incdir" = no ; then
5881                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5882
5883 echo "${as_me:-configure}:5883: testing adding $cf_add_incdir to include-path ..." 1>&5
5884
5885                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5886
5887                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5888                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5889                   cf_add_incdir="$cf_top_incdir"
5890                 else
5891                   break
5892                 fi
5893           else
5894                 break
5895           fi
5896         done
5897   done
5898 fi
5899
5900 if test -n "$cf_cv_curses_dir/lib" ; then
5901         for cf_add_libdir in $cf_cv_curses_dir/lib
5902         do
5903                 if test $cf_add_libdir = /usr/lib ; then
5904                         :
5905                 elif test -d $cf_add_libdir
5906                 then
5907                         cf_have_libdir=no
5908                         if test -n "$LDFLAGS$LIBS" ; then
5909                                 # a loop is needed to ensure we can add subdirs of existing dirs
5910                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5911                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5912                                                 cf_have_libdir=yes; break
5913                                         fi
5914                                 done
5915                         fi
5916                         if test "$cf_have_libdir" = no ; then
5917                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5918
5919 echo "${as_me:-configure}:5919: testing adding $cf_add_libdir to library-path ..." 1>&5
5920
5921                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5922                         fi
5923                 fi
5924         done
5925 fi
5926
5927         fi
5928 fi
5929
5930 cf_cv_screen=curses
5931
5932 echo "$as_me:5932: checking for specified curses library type" >&5
5933 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5934
5935 # Check whether --with-screen or --without-screen was given.
5936 if test "${with_screen+set}" = set; then
5937   withval="$with_screen"
5938   cf_cv_screen=$withval
5939 else
5940
5941 # Check whether --with-ncursesw or --without-ncursesw was given.
5942 if test "${with_ncursesw+set}" = set; then
5943   withval="$with_ncursesw"
5944   cf_cv_screen=ncursesw
5945 else
5946
5947 # Check whether --with-ncurses or --without-ncurses was given.
5948 if test "${with_ncurses+set}" = set; then
5949   withval="$with_ncurses"
5950   cf_cv_screen=ncurses
5951 else
5952
5953 # Check whether --with-pdcurses or --without-pdcurses was given.
5954 if test "${with_pdcurses+set}" = set; then
5955   withval="$with_pdcurses"
5956   cf_cv_screen=pdcurses
5957 else
5958
5959 # Check whether --with-curses-colr or --without-curses-colr was given.
5960 if test "${with_curses_colr+set}" = set; then
5961   withval="$with_curses_colr"
5962   cf_cv_screen=curses_colr
5963 else
5964
5965 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5966 if test "${with_curses_5lib+set}" = set; then
5967   withval="$with_curses_5lib"
5968   cf_cv_screen=curses_5lib
5969 fi;
5970 fi;
5971 fi;
5972 fi;
5973 fi;
5974 fi;
5975
5976 echo "$as_me:5976: result: $cf_cv_screen" >&5
5977 echo "${ECHO_T}$cf_cv_screen" >&6
5978
5979 case $cf_cv_screen in
5980 (curses|curses_*)
5981
5982 echo "$as_me:5982: checking for extra include directories" >&5
5983 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5984 if test "${cf_cv_curses_incdir+set}" = set; then
5985   echo $ECHO_N "(cached) $ECHO_C" >&6
5986 else
5987
5988 cf_cv_curses_incdir=no
5989 case $host_os in
5990 (hpux10.*)
5991         if test "x$cf_cv_screen" = "xcurses_colr"
5992         then
5993                 test -d /usr/include/curses_colr && \
5994                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5995         fi
5996         ;;
5997 (sunos3*|sunos4*)
5998         if test "x$cf_cv_screen" = "xcurses_5lib"
5999         then
6000                 test -d /usr/5lib && \
6001                 test -d /usr/5include && \
6002                 cf_cv_curses_incdir="-I/usr/5include"
6003         fi
6004         ;;
6005 esac
6006
6007 fi
6008 echo "$as_me:6008: result: $cf_cv_curses_incdir" >&5
6009 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6010 if test "$cf_cv_curses_incdir" != no
6011 then
6012
6013         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6014         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6015
6016 fi
6017
6018 echo "$as_me:6018: checking if we have identified curses headers" >&5
6019 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6020 if test "${cf_cv_ncurses_header+set}" = set; then
6021   echo $ECHO_N "(cached) $ECHO_C" >&6
6022 else
6023
6024 cf_cv_ncurses_header=none
6025 for cf_header in \
6026         ncurses.h  \
6027         curses.h  ncurses/ncurses.h ncurses/curses.h
6028 do
6029 cat >conftest.$ac_ext <<_ACEOF
6030 #line 6030 "configure"
6031 #include "confdefs.h"
6032 #include <${cf_header}>
6033 int
6034 main (void)
6035 {
6036 initscr(); tgoto("?", 0,0)
6037   ;
6038   return 0;
6039 }
6040 _ACEOF
6041 rm -f conftest.$ac_objext
6042 if { (eval echo "$as_me:6042: \"$ac_compile\"") >&5
6043   (eval $ac_compile) 2>&5
6044   ac_status=$?
6045   echo "$as_me:6045: \$? = $ac_status" >&5
6046   (exit $ac_status); } &&
6047          { ac_try='test -s conftest.$ac_objext'
6048   { (eval echo "$as_me:6048: \"$ac_try\"") >&5
6049   (eval $ac_try) 2>&5
6050   ac_status=$?
6051   echo "$as_me:6051: \$? = $ac_status" >&5
6052   (exit $ac_status); }; }; then
6053   cf_cv_ncurses_header=$cf_header; break
6054 else
6055   echo "$as_me: failed program was:" >&5
6056 cat conftest.$ac_ext >&5
6057 fi
6058 rm -f conftest.$ac_objext conftest.$ac_ext
6059 done
6060
6061 fi
6062 echo "$as_me:6062: result: $cf_cv_ncurses_header" >&5
6063 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6064
6065 if test "$cf_cv_ncurses_header" = none ; then
6066         { { echo "$as_me:6066: error: No curses header-files found" >&5
6067 echo "$as_me: error: No curses header-files found" >&2;}
6068    { (exit 1); exit 1; }; }
6069 fi
6070
6071 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6072
6073 for ac_header in $cf_cv_ncurses_header
6074 do
6075 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6076 echo "$as_me:6076: checking for $ac_header" >&5
6077 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6078 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6079   echo $ECHO_N "(cached) $ECHO_C" >&6
6080 else
6081   cat >conftest.$ac_ext <<_ACEOF
6082 #line 6082 "configure"
6083 #include "confdefs.h"
6084 #include <$ac_header>
6085 _ACEOF
6086 if { (eval echo "$as_me:6086: \"$ac_cpp conftest.$ac_ext\"") >&5
6087   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6088   ac_status=$?
6089   egrep -v '^ *\+' conftest.er1 >conftest.err
6090   rm -f conftest.er1
6091   cat conftest.err >&5
6092   echo "$as_me:6092: \$? = $ac_status" >&5
6093   (exit $ac_status); } >/dev/null; then
6094   if test -s conftest.err; then
6095     ac_cpp_err=$ac_c_preproc_warn_flag
6096   else
6097     ac_cpp_err=
6098   fi
6099 else
6100   ac_cpp_err=yes
6101 fi
6102 if test -z "$ac_cpp_err"; then
6103   eval "$as_ac_Header=yes"
6104 else
6105   echo "$as_me: failed program was:" >&5
6106   cat conftest.$ac_ext >&5
6107   eval "$as_ac_Header=no"
6108 fi
6109 rm -f conftest.err conftest.$ac_ext
6110 fi
6111 echo "$as_me:6111: result: `eval echo '${'$as_ac_Header'}'`" >&5
6112 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6113 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6114   cat >>confdefs.h <<EOF
6115 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6116 EOF
6117
6118 fi
6119 done
6120
6121 echo "$as_me:6121: checking for terminfo header" >&5
6122 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6123 if test "${cf_cv_term_header+set}" = set; then
6124   echo $ECHO_N "(cached) $ECHO_C" >&6
6125 else
6126
6127 case ${cf_cv_ncurses_header} in
6128 (*/ncurses.h|*/ncursesw.h)
6129         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6130         ;;
6131 (*)
6132         cf_term_header=term.h
6133         ;;
6134 esac
6135
6136 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6137 do
6138 cat >conftest.$ac_ext <<_ACEOF
6139 #line 6139 "configure"
6140 #include "confdefs.h"
6141 #include <stdio.h>
6142 #include <${cf_cv_ncurses_header:-curses.h}>
6143 #include <$cf_test>
6144
6145 int
6146 main (void)
6147 {
6148 int x = auto_left_margin; (void)x
6149   ;
6150   return 0;
6151 }
6152 _ACEOF
6153 rm -f conftest.$ac_objext
6154 if { (eval echo "$as_me:6154: \"$ac_compile\"") >&5
6155   (eval $ac_compile) 2>&5
6156   ac_status=$?
6157   echo "$as_me:6157: \$? = $ac_status" >&5
6158   (exit $ac_status); } &&
6159          { ac_try='test -s conftest.$ac_objext'
6160   { (eval echo "$as_me:6160: \"$ac_try\"") >&5
6161   (eval $ac_try) 2>&5
6162   ac_status=$?
6163   echo "$as_me:6163: \$? = $ac_status" >&5
6164   (exit $ac_status); }; }; then
6165
6166         cf_cv_term_header="$cf_test"
6167 else
6168   echo "$as_me: failed program was:" >&5
6169 cat conftest.$ac_ext >&5
6170
6171         cf_cv_term_header=unknown
6172
6173 fi
6174 rm -f conftest.$ac_objext conftest.$ac_ext
6175         test "$cf_cv_term_header" != unknown && break
6176 done
6177
6178 fi
6179 echo "$as_me:6179: result: $cf_cv_term_header" >&5
6180 echo "${ECHO_T}$cf_cv_term_header" >&6
6181
6182 # Set definitions to allow ifdef'ing to accommodate subdirectories
6183
6184 case $cf_cv_term_header in
6185 (*term.h)
6186
6187 cat >>confdefs.h <<\EOF
6188 #define HAVE_TERM_H 1
6189 EOF
6190
6191         ;;
6192 esac
6193
6194 case $cf_cv_term_header in
6195 (ncurses/term.h)
6196
6197 cat >>confdefs.h <<\EOF
6198 #define HAVE_NCURSES_TERM_H 1
6199 EOF
6200
6201         ;;
6202 (ncursesw/term.h)
6203
6204 cat >>confdefs.h <<\EOF
6205 #define HAVE_NCURSESW_TERM_H 1
6206 EOF
6207
6208         ;;
6209 esac
6210
6211 echo "$as_me:6211: checking for ncurses version" >&5
6212 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6213 if test "${cf_cv_ncurses_version+set}" = set; then
6214   echo $ECHO_N "(cached) $ECHO_C" >&6
6215 else
6216
6217         cf_cv_ncurses_version=no
6218         cf_tempfile=out$$
6219         rm -f $cf_tempfile
6220         if test "$cross_compiling" = yes; then
6221
6222         # This will not work if the preprocessor splits the line after the
6223         # Autoconf token.  The 'unproto' program does that.
6224         cat > conftest.$ac_ext <<EOF
6225 #include <${cf_cv_ncurses_header:-curses.h}>
6226 #undef Autoconf
6227 #ifdef NCURSES_VERSION
6228 Autoconf NCURSES_VERSION
6229 #else
6230 #ifdef __NCURSES_H
6231 Autoconf "old"
6232 #endif
6233 ;
6234 #endif
6235 EOF
6236         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6237         { (eval echo "$as_me:6237: \"$cf_try\"") >&5
6238   (eval $cf_try) 2>&5
6239   ac_status=$?
6240   echo "$as_me:6240: \$? = $ac_status" >&5
6241   (exit $ac_status); }
6242         if test -f conftest.out ; then
6243                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6244                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6245                 rm -f conftest.out
6246         fi
6247
6248 else
6249   cat >conftest.$ac_ext <<_ACEOF
6250 #line 6250 "configure"
6251 #include "confdefs.h"
6252
6253 #include <${cf_cv_ncurses_header:-curses.h}>
6254 #include <stdio.h>
6255 int main(void)
6256 {
6257         FILE *fp = fopen("$cf_tempfile", "w");
6258 #ifdef NCURSES_VERSION
6259 # ifdef NCURSES_VERSION_PATCH
6260         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6261 # else
6262         fprintf(fp, "%s\n", NCURSES_VERSION);
6263 # endif
6264 #else
6265 # ifdef __NCURSES_H
6266         fprintf(fp, "old\n");
6267 # else
6268         make an error
6269 # endif
6270 #endif
6271         ${cf_cv_main_return:-return}(0);
6272 }
6273 _ACEOF
6274 rm -f conftest$ac_exeext
6275 if { (eval echo "$as_me:6275: \"$ac_link\"") >&5
6276   (eval $ac_link) 2>&5
6277   ac_status=$?
6278   echo "$as_me:6278: \$? = $ac_status" >&5
6279   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6280   { (eval echo "$as_me:6280: \"$ac_try\"") >&5
6281   (eval $ac_try) 2>&5
6282   ac_status=$?
6283   echo "$as_me:6283: \$? = $ac_status" >&5
6284   (exit $ac_status); }; }; then
6285
6286         cf_cv_ncurses_version=`cat $cf_tempfile`
6287 else
6288   echo "$as_me: program exited with status $ac_status" >&5
6289 echo "$as_me: failed program was:" >&5
6290 cat conftest.$ac_ext >&5
6291 fi
6292 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6293 fi
6294         rm -f $cf_tempfile
6295
6296 fi
6297 echo "$as_me:6297: result: $cf_cv_ncurses_version" >&5
6298 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6299 test "$cf_cv_ncurses_version" = no ||
6300 cat >>confdefs.h <<\EOF
6301 #define NCURSES 1
6302 EOF
6303
6304 echo "$as_me:6304: checking if we have identified curses libraries" >&5
6305 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6306 cat >conftest.$ac_ext <<_ACEOF
6307 #line 6307 "configure"
6308 #include "confdefs.h"
6309 #include <${cf_cv_ncurses_header:-curses.h}>
6310 int
6311 main (void)
6312 {
6313 initscr(); tgoto("?", 0,0)
6314   ;
6315   return 0;
6316 }
6317 _ACEOF
6318 rm -f conftest.$ac_objext conftest$ac_exeext
6319 if { (eval echo "$as_me:6319: \"$ac_link\"") >&5
6320   (eval $ac_link) 2>&5
6321   ac_status=$?
6322   echo "$as_me:6322: \$? = $ac_status" >&5
6323   (exit $ac_status); } &&
6324          { ac_try='test -s conftest$ac_exeext'
6325   { (eval echo "$as_me:6325: \"$ac_try\"") >&5
6326   (eval $ac_try) 2>&5
6327   ac_status=$?
6328   echo "$as_me:6328: \$? = $ac_status" >&5
6329   (exit $ac_status); }; }; then
6330   cf_result=yes
6331 else
6332   echo "$as_me: failed program was:" >&5
6333 cat conftest.$ac_ext >&5
6334 cf_result=no
6335 fi
6336 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6337 echo "$as_me:6337: result: $cf_result" >&5
6338 echo "${ECHO_T}$cf_result" >&6
6339
6340 if test "$cf_result" = no ; then
6341 case $host_os in
6342 (freebsd*)
6343         echo "$as_me:6343: checking for tgoto in -lmytinfo" >&5
6344 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6345 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6346   echo $ECHO_N "(cached) $ECHO_C" >&6
6347 else
6348   ac_check_lib_save_LIBS=$LIBS
6349 LIBS="-lmytinfo  $LIBS"
6350 cat >conftest.$ac_ext <<_ACEOF
6351 #line 6351 "configure"
6352 #include "confdefs.h"
6353
6354 /* Override any gcc2 internal prototype to avoid an error.  */
6355 #ifdef __cplusplus
6356 extern "C"
6357 #endif
6358 /* We use char because int might match the return type of a gcc2
6359    builtin and then its argument prototype would still apply.  */
6360 char tgoto ();
6361 int
6362 main (void)
6363 {
6364 tgoto ();
6365   ;
6366   return 0;
6367 }
6368 _ACEOF
6369 rm -f conftest.$ac_objext conftest$ac_exeext
6370 if { (eval echo "$as_me:6370: \"$ac_link\"") >&5
6371   (eval $ac_link) 2>&5
6372   ac_status=$?
6373   echo "$as_me:6373: \$? = $ac_status" >&5
6374   (exit $ac_status); } &&
6375          { ac_try='test -s conftest$ac_exeext'
6376   { (eval echo "$as_me:6376: \"$ac_try\"") >&5
6377   (eval $ac_try) 2>&5
6378   ac_status=$?
6379   echo "$as_me:6379: \$? = $ac_status" >&5
6380   (exit $ac_status); }; }; then
6381   ac_cv_lib_mytinfo_tgoto=yes
6382 else
6383   echo "$as_me: failed program was:" >&5
6384 cat conftest.$ac_ext >&5
6385 ac_cv_lib_mytinfo_tgoto=no
6386 fi
6387 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6388 LIBS=$ac_check_lib_save_LIBS
6389 fi
6390 echo "$as_me:6390: result: $ac_cv_lib_mytinfo_tgoto" >&5
6391 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6392 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6393
6394 cf_add_libs="$LIBS"
6395 # reverse order
6396 cf_add_0lib=
6397 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6398 # filter duplicates
6399 for cf_add_1lib in $cf_add_0lib; do
6400         for cf_add_2lib in $cf_add_libs; do
6401                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6402                         cf_add_1lib=
6403                         break
6404                 fi
6405         done
6406         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6407 done
6408 LIBS="$cf_add_libs"
6409
6410 fi
6411
6412         ;;
6413 (hpux10.*)
6414         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6415         # next (1998), and xcurses "newer" (2000).  There is no header file for
6416         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6417         # term.h) for cur_colr
6418         if test "x$cf_cv_screen" = "xcurses_colr"
6419         then
6420                 echo "$as_me:6420: checking for initscr in -lcur_colr" >&5
6421 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6422 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6423   echo $ECHO_N "(cached) $ECHO_C" >&6
6424 else
6425   ac_check_lib_save_LIBS=$LIBS
6426 LIBS="-lcur_colr  $LIBS"
6427 cat >conftest.$ac_ext <<_ACEOF
6428 #line 6428 "configure"
6429 #include "confdefs.h"
6430
6431 /* Override any gcc2 internal prototype to avoid an error.  */
6432 #ifdef __cplusplus
6433 extern "C"
6434 #endif
6435 /* We use char because int might match the return type of a gcc2
6436    builtin and then its argument prototype would still apply.  */
6437 char initscr ();
6438 int
6439 main (void)
6440 {
6441 initscr ();
6442   ;
6443   return 0;
6444 }
6445 _ACEOF
6446 rm -f conftest.$ac_objext conftest$ac_exeext
6447 if { (eval echo "$as_me:6447: \"$ac_link\"") >&5
6448   (eval $ac_link) 2>&5
6449   ac_status=$?
6450   echo "$as_me:6450: \$? = $ac_status" >&5
6451   (exit $ac_status); } &&
6452          { ac_try='test -s conftest$ac_exeext'
6453   { (eval echo "$as_me:6453: \"$ac_try\"") >&5
6454   (eval $ac_try) 2>&5
6455   ac_status=$?
6456   echo "$as_me:6456: \$? = $ac_status" >&5
6457   (exit $ac_status); }; }; then
6458   ac_cv_lib_cur_colr_initscr=yes
6459 else
6460   echo "$as_me: failed program was:" >&5
6461 cat conftest.$ac_ext >&5
6462 ac_cv_lib_cur_colr_initscr=no
6463 fi
6464 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6465 LIBS=$ac_check_lib_save_LIBS
6466 fi
6467 echo "$as_me:6467: result: $ac_cv_lib_cur_colr_initscr" >&5
6468 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6469 if test $ac_cv_lib_cur_colr_initscr = yes; then
6470
6471 cf_add_libs="$LIBS"
6472 # reverse order
6473 cf_add_0lib=
6474 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6475 # filter duplicates
6476 for cf_add_1lib in $cf_add_0lib; do
6477         for cf_add_2lib in $cf_add_libs; do
6478                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6479                         cf_add_1lib=
6480                         break
6481                 fi
6482         done
6483         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6484 done
6485 LIBS="$cf_add_libs"
6486
6487                         ac_cv_func_initscr=yes
6488
6489 else
6490
6491                 echo "$as_me:6491: checking for initscr in -lHcurses" >&5
6492 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6493 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6494   echo $ECHO_N "(cached) $ECHO_C" >&6
6495 else
6496   ac_check_lib_save_LIBS=$LIBS
6497 LIBS="-lHcurses  $LIBS"
6498 cat >conftest.$ac_ext <<_ACEOF
6499 #line 6499 "configure"
6500 #include "confdefs.h"
6501
6502 /* Override any gcc2 internal prototype to avoid an error.  */
6503 #ifdef __cplusplus
6504 extern "C"
6505 #endif
6506 /* We use char because int might match the return type of a gcc2
6507    builtin and then its argument prototype would still apply.  */
6508 char initscr ();
6509 int
6510 main (void)
6511 {
6512 initscr ();
6513   ;
6514   return 0;
6515 }
6516 _ACEOF
6517 rm -f conftest.$ac_objext conftest$ac_exeext
6518 if { (eval echo "$as_me:6518: \"$ac_link\"") >&5
6519   (eval $ac_link) 2>&5
6520   ac_status=$?
6521   echo "$as_me:6521: \$? = $ac_status" >&5
6522   (exit $ac_status); } &&
6523          { ac_try='test -s conftest$ac_exeext'
6524   { (eval echo "$as_me:6524: \"$ac_try\"") >&5
6525   (eval $ac_try) 2>&5
6526   ac_status=$?
6527   echo "$as_me:6527: \$? = $ac_status" >&5
6528   (exit $ac_status); }; }; then
6529   ac_cv_lib_Hcurses_initscr=yes
6530 else
6531   echo "$as_me: failed program was:" >&5
6532 cat conftest.$ac_ext >&5
6533 ac_cv_lib_Hcurses_initscr=no
6534 fi
6535 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6536 LIBS=$ac_check_lib_save_LIBS
6537 fi
6538 echo "$as_me:6538: result: $ac_cv_lib_Hcurses_initscr" >&5
6539 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6540 if test $ac_cv_lib_Hcurses_initscr = yes; then
6541
6542                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6543
6544 cf_add_libs="$LIBS"
6545 # reverse order
6546 cf_add_0lib=
6547 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6548 # filter duplicates
6549 for cf_add_1lib in $cf_add_0lib; do
6550         for cf_add_2lib in $cf_add_libs; do
6551                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6552                         cf_add_1lib=
6553                         break
6554                 fi
6555         done
6556         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6557 done
6558 LIBS="$cf_add_libs"
6559
6560         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6561         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6562
6563                         ac_cv_func_initscr=yes
6564
6565 fi
6566
6567 fi
6568
6569         fi
6570         ;;
6571 (linux*)
6572         case `arch 2>/dev/null` in
6573         (x86_64)
6574                 if test -d /lib64
6575                 then
6576
6577 if test -n "/lib64" ; then
6578         for cf_add_libdir in /lib64
6579         do
6580                 if test $cf_add_libdir = /usr/lib ; then
6581                         :
6582                 elif test -d $cf_add_libdir
6583                 then
6584                         cf_have_libdir=no
6585                         if test -n "$LDFLAGS$LIBS" ; then
6586                                 # a loop is needed to ensure we can add subdirs of existing dirs
6587                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6588                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6589                                                 cf_have_libdir=yes; break
6590                                         fi
6591                                 done
6592                         fi
6593                         if test "$cf_have_libdir" = no ; then
6594                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6595
6596 echo "${as_me:-configure}:6596: testing adding $cf_add_libdir to library-path ..." 1>&5
6597
6598                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6599                         fi
6600                 fi
6601         done
6602 fi
6603
6604                 else
6605
6606 if test -n "/lib" ; then
6607         for cf_add_libdir in /lib
6608         do
6609                 if test $cf_add_libdir = /usr/lib ; then
6610                         :
6611                 elif test -d $cf_add_libdir
6612                 then
6613                         cf_have_libdir=no
6614                         if test -n "$LDFLAGS$LIBS" ; then
6615                                 # a loop is needed to ensure we can add subdirs of existing dirs
6616                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6617                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6618                                                 cf_have_libdir=yes; break
6619                                         fi
6620                                 done
6621                         fi
6622                         if test "$cf_have_libdir" = no ; then
6623                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6624
6625 echo "${as_me:-configure}:6625: testing adding $cf_add_libdir to library-path ..." 1>&5
6626
6627                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6628                         fi
6629                 fi
6630         done
6631 fi
6632
6633                 fi
6634                 ;;
6635         (*)
6636
6637 if test -n "/lib" ; then
6638         for cf_add_libdir in /lib
6639         do
6640                 if test $cf_add_libdir = /usr/lib ; then
6641                         :
6642                 elif test -d $cf_add_libdir
6643                 then
6644                         cf_have_libdir=no
6645                         if test -n "$LDFLAGS$LIBS" ; then
6646                                 # a loop is needed to ensure we can add subdirs of existing dirs
6647                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6648                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6649                                                 cf_have_libdir=yes; break
6650                                         fi
6651                                 done
6652                         fi
6653                         if test "$cf_have_libdir" = no ; then
6654                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6655
6656 echo "${as_me:-configure}:6656: testing adding $cf_add_libdir to library-path ..." 1>&5
6657
6658                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6659                         fi
6660                 fi
6661         done
6662 fi
6663
6664                 ;;
6665         esac
6666         ;;
6667 (sunos3*|sunos4*)
6668         if test "x$cf_cv_screen" = "xcurses_5lib"
6669         then
6670                 if test -d /usr/5lib ; then
6671
6672 if test -n "/usr/5lib" ; then
6673         for cf_add_libdir in /usr/5lib
6674         do
6675                 if test $cf_add_libdir = /usr/lib ; then
6676                         :
6677                 elif test -d $cf_add_libdir
6678                 then
6679                         cf_have_libdir=no
6680                         if test -n "$LDFLAGS$LIBS" ; then
6681                                 # a loop is needed to ensure we can add subdirs of existing dirs
6682                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6683                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6684                                                 cf_have_libdir=yes; break
6685                                         fi
6686                                 done
6687                         fi
6688                         if test "$cf_have_libdir" = no ; then
6689                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6690
6691 echo "${as_me:-configure}:6691: testing adding $cf_add_libdir to library-path ..." 1>&5
6692
6693                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6694                         fi
6695                 fi
6696         done
6697 fi
6698
6699 cf_add_libs="$LIBS"
6700 # reverse order
6701 cf_add_0lib=
6702 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6703 # filter duplicates
6704 for cf_add_1lib in $cf_add_0lib; do
6705         for cf_add_2lib in $cf_add_libs; do
6706                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6707                         cf_add_1lib=
6708                         break
6709                 fi
6710         done
6711         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6712 done
6713 LIBS="$cf_add_libs"
6714
6715                 fi
6716         fi
6717         ac_cv_func_initscr=yes
6718         ;;
6719 esac
6720
6721 if test ".$ac_cv_func_initscr" != .yes ; then
6722         cf_save_LIBS="$LIBS"
6723
6724         if test ".${cf_cv_ncurses_version:-no}" != .no
6725         then
6726                 cf_check_list="ncurses curses cursesX"
6727         else
6728                 cf_check_list="cursesX curses ncurses"
6729         fi
6730
6731         # Check for library containing tgoto.  Do this before curses library
6732         # because it may be needed to link the test-case for initscr.
6733         if test "x$cf_term_lib" = x
6734         then
6735                 echo "$as_me:6735: checking for tgoto" >&5
6736 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6737 if test "${ac_cv_func_tgoto+set}" = set; then
6738   echo $ECHO_N "(cached) $ECHO_C" >&6
6739 else
6740   cat >conftest.$ac_ext <<_ACEOF
6741 #line 6741 "configure"
6742 #include "confdefs.h"
6743 #define tgoto autoconf_temporary
6744 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6745 #undef tgoto
6746
6747 #ifdef __cplusplus
6748 extern "C"
6749 #endif
6750
6751 /* We use char because int might match the return type of a gcc2
6752    builtin and then its argument prototype would still apply.  */
6753 char tgoto (void);
6754
6755 int
6756 main (void)
6757 {
6758
6759 /* The GNU C library defines stubs for functions which it implements
6760     to always fail with ENOSYS.  Some functions are actually named
6761     something starting with __ and the normal name is an alias.  */
6762 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6763 #error found stub for tgoto
6764 #endif
6765
6766         return tgoto ();
6767   ;
6768   return 0;
6769 }
6770 _ACEOF
6771 rm -f conftest.$ac_objext conftest$ac_exeext
6772 if { (eval echo "$as_me:6772: \"$ac_link\"") >&5
6773   (eval $ac_link) 2>&5
6774   ac_status=$?
6775   echo "$as_me:6775: \$? = $ac_status" >&5
6776   (exit $ac_status); } &&
6777          { ac_try='test -s conftest$ac_exeext'
6778   { (eval echo "$as_me:6778: \"$ac_try\"") >&5
6779   (eval $ac_try) 2>&5
6780   ac_status=$?
6781   echo "$as_me:6781: \$? = $ac_status" >&5
6782   (exit $ac_status); }; }; then
6783   ac_cv_func_tgoto=yes
6784 else
6785   echo "$as_me: failed program was:" >&5
6786 cat conftest.$ac_ext >&5
6787 ac_cv_func_tgoto=no
6788 fi
6789 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6790 fi
6791 echo "$as_me:6791: result: $ac_cv_func_tgoto" >&5
6792 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6793 if test $ac_cv_func_tgoto = yes; then
6794   cf_term_lib=predefined
6795 else
6796
6797                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6798                         do
6799                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6800 echo "$as_me:6800: checking for tgoto in -l$cf_term_lib" >&5
6801 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6802 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6803   echo $ECHO_N "(cached) $ECHO_C" >&6
6804 else
6805   ac_check_lib_save_LIBS=$LIBS
6806 LIBS="-l$cf_term_lib  $LIBS"
6807 cat >conftest.$ac_ext <<_ACEOF
6808 #line 6808 "configure"
6809 #include "confdefs.h"
6810
6811 /* Override any gcc2 internal prototype to avoid an error.  */
6812 #ifdef __cplusplus
6813 extern "C"
6814 #endif
6815 /* We use char because int might match the return type of a gcc2
6816    builtin and then its argument prototype would still apply.  */
6817 char tgoto ();
6818 int
6819 main (void)
6820 {
6821 tgoto ();
6822   ;
6823   return 0;
6824 }
6825 _ACEOF
6826 rm -f conftest.$ac_objext conftest$ac_exeext
6827 if { (eval echo "$as_me:6827: \"$ac_link\"") >&5
6828   (eval $ac_link) 2>&5
6829   ac_status=$?
6830   echo "$as_me:6830: \$? = $ac_status" >&5
6831   (exit $ac_status); } &&
6832          { ac_try='test -s conftest$ac_exeext'
6833   { (eval echo "$as_me:6833: \"$ac_try\"") >&5
6834   (eval $ac_try) 2>&5
6835   ac_status=$?
6836   echo "$as_me:6836: \$? = $ac_status" >&5
6837   (exit $ac_status); }; }; then
6838   eval "$as_ac_Lib=yes"
6839 else
6840   echo "$as_me: failed program was:" >&5
6841 cat conftest.$ac_ext >&5
6842 eval "$as_ac_Lib=no"
6843 fi
6844 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6845 LIBS=$ac_check_lib_save_LIBS
6846 fi
6847 echo "$as_me:6847: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6848 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6849 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6850
6851                                         : ${cf_nculib_root:=$cf_term_lib}
6852                                         break
6853
6854 fi
6855
6856                         done
6857
6858 fi
6859
6860         fi
6861
6862         # Check for library containing initscr
6863         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6864         if test "x$cf_curs_lib" = x
6865         then
6866                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6867                 do
6868                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6869                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6870                                 echo "$as_me:6870: checking if we can link with $cf_curs_lib library" >&5
6871 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6872                                 cat >conftest.$ac_ext <<_ACEOF
6873 #line 6873 "configure"
6874 #include "confdefs.h"
6875 #include <${cf_cv_ncurses_header:-curses.h}>
6876 int
6877 main (void)
6878 {
6879 initscr()
6880   ;
6881   return 0;
6882 }
6883 _ACEOF
6884 rm -f conftest.$ac_objext conftest$ac_exeext
6885 if { (eval echo "$as_me:6885: \"$ac_link\"") >&5
6886   (eval $ac_link) 2>&5
6887   ac_status=$?
6888   echo "$as_me:6888: \$? = $ac_status" >&5
6889   (exit $ac_status); } &&
6890          { ac_try='test -s conftest$ac_exeext'
6891   { (eval echo "$as_me:6891: \"$ac_try\"") >&5
6892   (eval $ac_try) 2>&5
6893   ac_status=$?
6894   echo "$as_me:6894: \$? = $ac_status" >&5
6895   (exit $ac_status); }; }; then
6896   cf_result=yes
6897 else
6898   echo "$as_me: failed program was:" >&5
6899 cat conftest.$ac_ext >&5
6900 cf_result=no
6901 fi
6902 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6903                                 echo "$as_me:6903: result: $cf_result" >&5
6904 echo "${ECHO_T}$cf_result" >&6
6905                                 test $cf_result = yes && break
6906                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6907                                 cf_result=no
6908                         elif test "$cf_term_lib" != predefined ; then
6909                                 echo "$as_me:6909: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6910 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6911                                 cat >conftest.$ac_ext <<_ACEOF
6912 #line 6912 "configure"
6913 #include "confdefs.h"
6914 #include <${cf_cv_ncurses_header:-curses.h}>
6915 int
6916 main (void)
6917 {
6918 initscr(); tgoto((char *)0, 0, 0);
6919   ;
6920   return 0;
6921 }
6922 _ACEOF
6923 rm -f conftest.$ac_objext conftest$ac_exeext
6924 if { (eval echo "$as_me:6924: \"$ac_link\"") >&5
6925   (eval $ac_link) 2>&5
6926   ac_status=$?
6927   echo "$as_me:6927: \$? = $ac_status" >&5
6928   (exit $ac_status); } &&
6929          { ac_try='test -s conftest$ac_exeext'
6930   { (eval echo "$as_me:6930: \"$ac_try\"") >&5
6931   (eval $ac_try) 2>&5
6932   ac_status=$?
6933   echo "$as_me:6933: \$? = $ac_status" >&5
6934   (exit $ac_status); }; }; then
6935   cf_result=no
6936 else
6937   echo "$as_me: failed program was:" >&5
6938 cat conftest.$ac_ext >&5
6939
6940                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6941                                         cat >conftest.$ac_ext <<_ACEOF
6942 #line 6942 "configure"
6943 #include "confdefs.h"
6944 #include <${cf_cv_ncurses_header:-curses.h}>
6945 int
6946 main (void)
6947 {
6948 initscr()
6949   ;
6950   return 0;
6951 }
6952 _ACEOF
6953 rm -f conftest.$ac_objext conftest$ac_exeext
6954 if { (eval echo "$as_me:6954: \"$ac_link\"") >&5
6955   (eval $ac_link) 2>&5
6956   ac_status=$?
6957   echo "$as_me:6957: \$? = $ac_status" >&5
6958   (exit $ac_status); } &&
6959          { ac_try='test -s conftest$ac_exeext'
6960   { (eval echo "$as_me:6960: \"$ac_try\"") >&5
6961   (eval $ac_try) 2>&5
6962   ac_status=$?
6963   echo "$as_me:6963: \$? = $ac_status" >&5
6964   (exit $ac_status); }; }; then
6965   cf_result=yes
6966 else
6967   echo "$as_me: failed program was:" >&5
6968 cat conftest.$ac_ext >&5
6969 cf_result=error
6970 fi
6971 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6972
6973 fi
6974 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6975                                 echo "$as_me:6975: result: $cf_result" >&5
6976 echo "${ECHO_T}$cf_result" >&6
6977                                 test $cf_result != error && break
6978                         fi
6979                 done
6980         fi
6981         test $cf_curs_lib = unknown && { { echo "$as_me:6981: error: no curses library found" >&5
6982 echo "$as_me: error: no curses library found" >&2;}
6983    { (exit 1); exit 1; }; }
6984 fi
6985 fi
6986
6987         ;;
6988 (ncursesw*)
6989
6990 echo "$as_me:6990: checking for multibyte character support" >&5
6991 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6992 if test "${cf_cv_utf8_lib+set}" = set; then
6993   echo $ECHO_N "(cached) $ECHO_C" >&6
6994 else
6995
6996         cf_save_LIBS="$LIBS"
6997         cat >conftest.$ac_ext <<_ACEOF
6998 #line 6998 "configure"
6999 #include "confdefs.h"
7000
7001 #include <stdlib.h>
7002 int
7003 main (void)
7004 {
7005 putwc(0,0);
7006   ;
7007   return 0;
7008 }
7009 _ACEOF
7010 rm -f conftest.$ac_objext conftest$ac_exeext
7011 if { (eval echo "$as_me:7011: \"$ac_link\"") >&5
7012   (eval $ac_link) 2>&5
7013   ac_status=$?
7014   echo "$as_me:7014: \$? = $ac_status" >&5
7015   (exit $ac_status); } &&
7016          { ac_try='test -s conftest$ac_exeext'
7017   { (eval echo "$as_me:7017: \"$ac_try\"") >&5
7018   (eval $ac_try) 2>&5
7019   ac_status=$?
7020   echo "$as_me:7020: \$? = $ac_status" >&5
7021   (exit $ac_status); }; }; then
7022   cf_cv_utf8_lib=yes
7023 else
7024   echo "$as_me: failed program was:" >&5
7025 cat conftest.$ac_ext >&5
7026
7027 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7028 # will be set on completion of the AC_TRY_LINK below.
7029 cf_cv_header_path_utf8=
7030 cf_cv_library_path_utf8=
7031
7032 echo "${as_me:-configure}:7032: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7033
7034 cf_save_LIBS="$LIBS"
7035
7036 cat >conftest.$ac_ext <<_ACEOF
7037 #line 7037 "configure"
7038 #include "confdefs.h"
7039
7040 #include <libutf8.h>
7041 int
7042 main (void)
7043 {
7044 putwc(0,0);
7045   ;
7046   return 0;
7047 }
7048 _ACEOF
7049 rm -f conftest.$ac_objext conftest$ac_exeext
7050 if { (eval echo "$as_me:7050: \"$ac_link\"") >&5
7051   (eval $ac_link) 2>&5
7052   ac_status=$?
7053   echo "$as_me:7053: \$? = $ac_status" >&5
7054   (exit $ac_status); } &&
7055          { ac_try='test -s conftest$ac_exeext'
7056   { (eval echo "$as_me:7056: \"$ac_try\"") >&5
7057   (eval $ac_try) 2>&5
7058   ac_status=$?
7059   echo "$as_me:7059: \$? = $ac_status" >&5
7060   (exit $ac_status); }; }; then
7061
7062         cf_cv_find_linkage_utf8=yes
7063         cf_cv_header_path_utf8=/usr/include
7064         cf_cv_library_path_utf8=/usr/lib
7065
7066 else
7067   echo "$as_me: failed program was:" >&5
7068 cat conftest.$ac_ext >&5
7069
7070 LIBS="-lutf8  $cf_save_LIBS"
7071
7072 cat >conftest.$ac_ext <<_ACEOF
7073 #line 7073 "configure"
7074 #include "confdefs.h"
7075
7076 #include <libutf8.h>
7077 int
7078 main (void)
7079 {
7080 putwc(0,0);
7081   ;
7082   return 0;
7083 }
7084 _ACEOF
7085 rm -f conftest.$ac_objext conftest$ac_exeext
7086 if { (eval echo "$as_me:7086: \"$ac_link\"") >&5
7087   (eval $ac_link) 2>&5
7088   ac_status=$?
7089   echo "$as_me:7089: \$? = $ac_status" >&5
7090   (exit $ac_status); } &&
7091          { ac_try='test -s conftest$ac_exeext'
7092   { (eval echo "$as_me:7092: \"$ac_try\"") >&5
7093   (eval $ac_try) 2>&5
7094   ac_status=$?
7095   echo "$as_me:7095: \$? = $ac_status" >&5
7096   (exit $ac_status); }; }; then
7097
7098         cf_cv_find_linkage_utf8=yes
7099         cf_cv_header_path_utf8=/usr/include
7100         cf_cv_library_path_utf8=/usr/lib
7101         cf_cv_library_file_utf8="-lutf8"
7102
7103 else
7104   echo "$as_me: failed program was:" >&5
7105 cat conftest.$ac_ext >&5
7106
7107         cf_cv_find_linkage_utf8=no
7108         LIBS="$cf_save_LIBS"
7109
7110         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7111
7112 echo "${as_me:-configure}:7112: testing find linkage for utf8 library ..." 1>&5
7113
7114 echo "${as_me:-configure}:7114: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7115
7116         cf_save_CPPFLAGS="$CPPFLAGS"
7117         cf_test_CPPFLAGS="$CPPFLAGS"
7118
7119 cf_search=
7120
7121 # collect the current set of include-directories from compiler flags
7122 cf_header_path_list=""
7123 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7124         for cf_header_path in $CPPFLAGS $CFLAGS
7125         do
7126                 case $cf_header_path in
7127                 (-I*)
7128                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7129
7130 test "x$cf_header_path" != "xNONE" && \
7131 test -d "$cf_header_path" && \
7132  {
7133         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7134         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7135         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7136         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7137         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7138         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7139 }
7140
7141                         cf_header_path_list="$cf_header_path_list $cf_search"
7142                         ;;
7143                 esac
7144         done
7145 fi
7146
7147 # add the variations for the package we are looking for
7148
7149 cf_search=
7150
7151 test "x$prefix" != "xNONE" && \
7152 test -d "$prefix" && \
7153  {
7154         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7155         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7156         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7157         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7158         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7159         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7160 }
7161
7162 for cf_subdir_prefix in \
7163         /usr \
7164         /usr/local \
7165         /usr/pkg \
7166         /opt \
7167         /opt/local \
7168         $HOME
7169 do
7170
7171 test "x$cf_subdir_prefix" != "x$prefix" && \
7172 test -d "$cf_subdir_prefix" && \
7173 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7174         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7175         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7176         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7177         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7178         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7179         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7180 }
7181
7182 done
7183
7184 test "$includedir" != NONE && \
7185 test "$includedir" != "/usr/include" && \
7186 test -d "$includedir" && {
7187         test -d $includedir &&    cf_search="$cf_search $includedir"
7188         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7189 }
7190
7191 test "$oldincludedir" != NONE && \
7192 test "$oldincludedir" != "/usr/include" && \
7193 test -d "$oldincludedir" && {
7194         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7195         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7196 }
7197
7198 cf_search="$cf_search $cf_header_path_list"
7199
7200         for cf_cv_header_path_utf8 in $cf_search
7201         do
7202                 if test -d $cf_cv_header_path_utf8 ; then
7203                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7204
7205 echo "${as_me:-configure}:7205: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7206
7207                         CPPFLAGS="$cf_save_CPPFLAGS"
7208
7209         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7210         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7211
7212                         cat >conftest.$ac_ext <<_ACEOF
7213 #line 7213 "configure"
7214 #include "confdefs.h"
7215
7216 #include <libutf8.h>
7217 int
7218 main (void)
7219 {
7220 putwc(0,0);
7221   ;
7222   return 0;
7223 }
7224 _ACEOF
7225 rm -f conftest.$ac_objext
7226 if { (eval echo "$as_me:7226: \"$ac_compile\"") >&5
7227   (eval $ac_compile) 2>&5
7228   ac_status=$?
7229   echo "$as_me:7229: \$? = $ac_status" >&5
7230   (exit $ac_status); } &&
7231          { ac_try='test -s conftest.$ac_objext'
7232   { (eval echo "$as_me:7232: \"$ac_try\"") >&5
7233   (eval $ac_try) 2>&5
7234   ac_status=$?
7235   echo "$as_me:7235: \$? = $ac_status" >&5
7236   (exit $ac_status); }; }; then
7237
7238                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7239
7240 echo "${as_me:-configure}:7240: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7241
7242                                 cf_cv_find_linkage_utf8=maybe
7243                                 cf_test_CPPFLAGS="$CPPFLAGS"
7244                                 break
7245 else
7246   echo "$as_me: failed program was:" >&5
7247 cat conftest.$ac_ext >&5
7248
7249                                 CPPFLAGS="$cf_save_CPPFLAGS"
7250
7251 fi
7252 rm -f conftest.$ac_objext conftest.$ac_ext
7253                 fi
7254         done
7255
7256         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7257
7258 echo "${as_me:-configure}:7258: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7259
7260                 cf_save_LIBS="$LIBS"
7261                 cf_save_LDFLAGS="$LDFLAGS"
7262
7263                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7264
7265 cf_search=
7266 cf_library_path_list=""
7267 if test -n "${LDFLAGS}${LIBS}" ; then
7268         for cf_library_path in $LDFLAGS $LIBS
7269         do
7270                 case $cf_library_path in
7271                 (-L*)
7272                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7273
7274 test "x$cf_library_path" != "xNONE" && \
7275 test -d "$cf_library_path" && \
7276  {
7277         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7278         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7279         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7280         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7281         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7282         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7283 }
7284
7285                         cf_library_path_list="$cf_library_path_list $cf_search"
7286                         ;;
7287                 esac
7288         done
7289 fi
7290
7291 cf_search=
7292
7293 test "x$prefix" != "xNONE" && \
7294 test -d "$prefix" && \
7295  {
7296         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7297         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7298         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7299         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7300         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7301         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7302 }
7303
7304 for cf_subdir_prefix in \
7305         /usr \
7306         /usr/local \
7307         /usr/pkg \
7308         /opt \
7309         /opt/local \
7310         $HOME
7311 do
7312
7313 test "x$cf_subdir_prefix" != "x$prefix" && \
7314 test -d "$cf_subdir_prefix" && \
7315 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7316         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7317         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7318         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7319         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7320         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7321         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7322 }
7323
7324 done
7325
7326 cf_search="$cf_library_path_list $cf_search"
7327
7328                         for cf_cv_library_path_utf8 in $cf_search
7329                         do
7330                                 if test -d $cf_cv_library_path_utf8 ; then
7331                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7332
7333 echo "${as_me:-configure}:7333: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7334
7335                                         CPPFLAGS="$cf_test_CPPFLAGS"
7336                                         LIBS="-lutf8  $cf_save_LIBS"
7337                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7338                                         cat >conftest.$ac_ext <<_ACEOF
7339 #line 7339 "configure"
7340 #include "confdefs.h"
7341
7342 #include <libutf8.h>
7343 int
7344 main (void)
7345 {
7346 putwc(0,0);
7347   ;
7348   return 0;
7349 }
7350 _ACEOF
7351 rm -f conftest.$ac_objext conftest$ac_exeext
7352 if { (eval echo "$as_me:7352: \"$ac_link\"") >&5
7353   (eval $ac_link) 2>&5
7354   ac_status=$?
7355   echo "$as_me:7355: \$? = $ac_status" >&5
7356   (exit $ac_status); } &&
7357          { ac_try='test -s conftest$ac_exeext'
7358   { (eval echo "$as_me:7358: \"$ac_try\"") >&5
7359   (eval $ac_try) 2>&5
7360   ac_status=$?
7361   echo "$as_me:7361: \$? = $ac_status" >&5
7362   (exit $ac_status); }; }; then
7363
7364                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7365
7366 echo "${as_me:-configure}:7366: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7367
7368                                         cf_cv_find_linkage_utf8=yes
7369                                         cf_cv_library_file_utf8="-lutf8"
7370                                         break
7371 else
7372   echo "$as_me: failed program was:" >&5
7373 cat conftest.$ac_ext >&5
7374
7375                                         CPPFLAGS="$cf_save_CPPFLAGS"
7376                                         LIBS="$cf_save_LIBS"
7377                                         LDFLAGS="$cf_save_LDFLAGS"
7378
7379 fi
7380 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7381                                 fi
7382                         done
7383                         CPPFLAGS="$cf_save_CPPFLAGS"
7384                         LDFLAGS="$cf_save_LDFLAGS"
7385                 fi
7386
7387         else
7388                 cf_cv_find_linkage_utf8=no
7389         fi
7390
7391 fi
7392 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7393
7394 fi
7395 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7396
7397 LIBS="$cf_save_LIBS"
7398
7399 if test "$cf_cv_find_linkage_utf8" = yes ; then
7400 cf_cv_utf8_lib=add-on
7401 else
7402 cf_cv_utf8_lib=no
7403 fi
7404
7405 fi
7406 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7407 fi
7408 echo "$as_me:7408: result: $cf_cv_utf8_lib" >&5
7409 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7410
7411 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7412 # ncurses/ncursesw:
7413 if test "$cf_cv_utf8_lib" = "add-on" ; then
7414
7415 cat >>confdefs.h <<\EOF
7416 #define HAVE_LIBUTF8_H 1
7417 EOF
7418
7419 if test -n "$cf_cv_header_path_utf8" ; then
7420   for cf_add_incdir in $cf_cv_header_path_utf8
7421   do
7422         while test $cf_add_incdir != /usr/include
7423         do
7424           if test -d $cf_add_incdir
7425           then
7426                 cf_have_incdir=no
7427                 if test -n "$CFLAGS$CPPFLAGS" ; then
7428                   # a loop is needed to ensure we can add subdirs of existing dirs
7429                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7430                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7431                           cf_have_incdir=yes; break
7432                         fi
7433                   done
7434                 fi
7435
7436                 if test "$cf_have_incdir" = no ; then
7437                   if test "$cf_add_incdir" = /usr/local/include ; then
7438                         if test "$GCC" = yes
7439                         then
7440                           cf_save_CPPFLAGS=$CPPFLAGS
7441
7442         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7443         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7444
7445                           cat >conftest.$ac_ext <<_ACEOF
7446 #line 7446 "configure"
7447 #include "confdefs.h"
7448 #include <stdio.h>
7449 int
7450 main (void)
7451 {
7452 printf("Hello")
7453   ;
7454   return 0;
7455 }
7456 _ACEOF
7457 rm -f conftest.$ac_objext
7458 if { (eval echo "$as_me:7458: \"$ac_compile\"") >&5
7459   (eval $ac_compile) 2>&5
7460   ac_status=$?
7461   echo "$as_me:7461: \$? = $ac_status" >&5
7462   (exit $ac_status); } &&
7463          { ac_try='test -s conftest.$ac_objext'
7464   { (eval echo "$as_me:7464: \"$ac_try\"") >&5
7465   (eval $ac_try) 2>&5
7466   ac_status=$?
7467   echo "$as_me:7467: \$? = $ac_status" >&5
7468   (exit $ac_status); }; }; then
7469   :
7470 else
7471   echo "$as_me: failed program was:" >&5
7472 cat conftest.$ac_ext >&5
7473 cf_have_incdir=yes
7474 fi
7475 rm -f conftest.$ac_objext conftest.$ac_ext
7476                           CPPFLAGS=$cf_save_CPPFLAGS
7477                         fi
7478                   fi
7479                 fi
7480
7481                 if test "$cf_have_incdir" = no ; then
7482                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7483
7484 echo "${as_me:-configure}:7484: testing adding $cf_add_incdir to include-path ..." 1>&5
7485
7486                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7487
7488                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7489                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7490                   cf_add_incdir="$cf_top_incdir"
7491                 else
7492                   break
7493                 fi
7494           else
7495                 break
7496           fi
7497         done
7498   done
7499 fi
7500
7501 if test -n "$cf_cv_library_path_utf8" ; then
7502         for cf_add_libdir in $cf_cv_library_path_utf8
7503         do
7504                 if test $cf_add_libdir = /usr/lib ; then
7505                         :
7506                 elif test -d $cf_add_libdir
7507                 then
7508                         cf_have_libdir=no
7509                         if test -n "$LDFLAGS$LIBS" ; then
7510                                 # a loop is needed to ensure we can add subdirs of existing dirs
7511                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7512                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7513                                                 cf_have_libdir=yes; break
7514                                         fi
7515                                 done
7516                         fi
7517                         if test "$cf_have_libdir" = no ; then
7518                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7519
7520 echo "${as_me:-configure}:7520: testing adding $cf_add_libdir to library-path ..." 1>&5
7521
7522                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7523                         fi
7524                 fi
7525         done
7526 fi
7527
7528 cf_add_libs="$LIBS"
7529 # reverse order
7530 cf_add_0lib=
7531 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7532 # filter duplicates
7533 for cf_add_1lib in $cf_add_0lib; do
7534         for cf_add_2lib in $cf_add_libs; do
7535                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7536                         cf_add_1lib=
7537                         break
7538                 fi
7539         done
7540         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7541 done
7542 LIBS="$cf_add_libs"
7543
7544 fi
7545
7546 cf_ncuconfig_root=$cf_cv_screen
7547 cf_have_ncuconfig=no
7548
7549 if test "x${PKG_CONFIG:=none}" != xnone; then
7550         echo "$as_me:7550: checking pkg-config for $cf_ncuconfig_root" >&5
7551 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7552         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7553                 echo "$as_me:7553: result: yes" >&5
7554 echo "${ECHO_T}yes" >&6
7555
7556                 echo "$as_me:7556: checking if the $cf_ncuconfig_root package files work" >&5
7557 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7558                 cf_have_ncuconfig=unknown
7559
7560                 cf_save_CFLAGS="$CFLAGS"
7561                 cf_save_CPPFLAGS="$CPPFLAGS"
7562                 cf_save_LIBS="$LIBS"
7563
7564                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
7565                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
7566
7567                 # while -W for passing linker flags is prevalent, it is not "standard".
7568                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7569                 # incompatible _and_ non-standard -W option which gives an error.  Work
7570                 # around that pitfall.
7571                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7572                 (x*c[89]9@@*-W*)
7573
7574 cf_fix_cppflags=no
7575 cf_new_cflags=
7576 cf_new_cppflags=
7577 cf_new_extra_cppflags=
7578
7579 for cf_add_cflags in $cf_pkg_cflags
7580 do
7581 case $cf_fix_cppflags in
7582 (no)
7583         case $cf_add_cflags in
7584         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7585                 case $cf_add_cflags in
7586                 (-D*)
7587                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7588
7589                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7590                                 && test -z "${cf_tst_cflags}" \
7591                                 && cf_fix_cppflags=yes
7592
7593                         if test $cf_fix_cppflags = yes ; then
7594
7595         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7596         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7597
7598                                 continue
7599                         elif test "${cf_tst_cflags}" = "\"'" ; then
7600
7601         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7602         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7603
7604                                 continue
7605                         fi
7606                         ;;
7607                 esac
7608                 case "$CPPFLAGS" in
7609                 (*$cf_add_cflags)
7610                         ;;
7611                 (*)
7612                         case $cf_add_cflags in
7613                         (-D*)
7614                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7615
7616 CPPFLAGS=`echo "$CPPFLAGS" | \
7617         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7618                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7619
7620                                 ;;
7621                         esac
7622
7623         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7624         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7625
7626                         ;;
7627                 esac
7628                 ;;
7629         (*)
7630
7631         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7632         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7633
7634                 ;;
7635         esac
7636         ;;
7637 (yes)
7638
7639         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7640         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7641
7642         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7643
7644         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7645                 && test -z "${cf_tst_cflags}" \
7646                 && cf_fix_cppflags=no
7647         ;;
7648 esac
7649 done
7650
7651 if test -n "$cf_new_cflags" ; then
7652
7653         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7654         CFLAGS="${CFLAGS}$cf_new_cflags"
7655
7656 fi
7657
7658 if test -n "$cf_new_cppflags" ; then
7659
7660         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7661         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7662
7663 fi
7664
7665 if test -n "$cf_new_extra_cppflags" ; then
7666
7667         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7668         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7669
7670 fi
7671
7672 cf_add_libs="$LIBS"
7673 # reverse order
7674 cf_add_0lib=
7675 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7676 # filter duplicates
7677 for cf_add_1lib in $cf_add_0lib; do
7678         for cf_add_2lib in $cf_add_libs; do
7679                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7680                         cf_add_1lib=
7681                         break
7682                 fi
7683         done
7684         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7685 done
7686 LIBS="$cf_add_libs"
7687
7688                         cat >conftest.$ac_ext <<_ACEOF
7689 #line 7689 "configure"
7690 #include "confdefs.h"
7691 #include <${cf_cv_ncurses_header:-curses.h}>
7692 int
7693 main (void)
7694 {
7695 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7696   ;
7697   return 0;
7698 }
7699 _ACEOF
7700 rm -f conftest.$ac_objext conftest$ac_exeext
7701 if { (eval echo "$as_me:7701: \"$ac_link\"") >&5
7702   (eval $ac_link) 2>&5
7703   ac_status=$?
7704   echo "$as_me:7704: \$? = $ac_status" >&5
7705   (exit $ac_status); } &&
7706          { ac_try='test -s conftest$ac_exeext'
7707   { (eval echo "$as_me:7707: \"$ac_try\"") >&5
7708   (eval $ac_try) 2>&5
7709   ac_status=$?
7710   echo "$as_me:7710: \$? = $ac_status" >&5
7711   (exit $ac_status); }; }; then
7712   if test "$cross_compiling" = yes; then
7713   cf_test_ncuconfig=maybe
7714 else
7715   cat >conftest.$ac_ext <<_ACEOF
7716 #line 7716 "configure"
7717 #include "confdefs.h"
7718 #include <${cf_cv_ncurses_header:-curses.h}>
7719                                         int main(void)
7720                                         { char *xx = curses_version(); return (xx == 0); }
7721 _ACEOF
7722 rm -f conftest$ac_exeext
7723 if { (eval echo "$as_me:7723: \"$ac_link\"") >&5
7724   (eval $ac_link) 2>&5
7725   ac_status=$?
7726   echo "$as_me:7726: \$? = $ac_status" >&5
7727   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7728   { (eval echo "$as_me:7728: \"$ac_try\"") >&5
7729   (eval $ac_try) 2>&5
7730   ac_status=$?
7731   echo "$as_me:7731: \$? = $ac_status" >&5
7732   (exit $ac_status); }; }; then
7733   cf_test_ncuconfig=yes
7734 else
7735   echo "$as_me: program exited with status $ac_status" >&5
7736 echo "$as_me: failed program was:" >&5
7737 cat conftest.$ac_ext >&5
7738 cf_test_ncuconfig=no
7739 fi
7740 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7741 fi
7742 else
7743   echo "$as_me: failed program was:" >&5
7744 cat conftest.$ac_ext >&5
7745 cf_test_ncuconfig=no
7746 fi
7747 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7748
7749                         CFLAGS="$cf_save_CFLAGS"
7750                         CPPFLAGS="$cf_save_CPPFLAGS"
7751                         LIBS="$cf_save_LIBS"
7752
7753                         if test "x$cf_test_ncuconfig" != xyes; then
7754                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7755                                 cf_pkg_cflags="$cf_temp"
7756                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7757                                 cf_pkg_libs="$cf_temp"
7758                         fi
7759                         ;;
7760                 esac
7761
7762 cf_fix_cppflags=no
7763 cf_new_cflags=
7764 cf_new_cppflags=
7765 cf_new_extra_cppflags=
7766
7767 for cf_add_cflags in $cf_pkg_cflags
7768 do
7769 case $cf_fix_cppflags in
7770 (no)
7771         case $cf_add_cflags in
7772         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7773                 case $cf_add_cflags in
7774                 (-D*)
7775                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7776
7777                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7778                                 && test -z "${cf_tst_cflags}" \
7779                                 && cf_fix_cppflags=yes
7780
7781                         if test $cf_fix_cppflags = yes ; then
7782
7783         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7784         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7785
7786                                 continue
7787                         elif test "${cf_tst_cflags}" = "\"'" ; then
7788
7789         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7790         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7791
7792                                 continue
7793                         fi
7794                         ;;
7795                 esac
7796                 case "$CPPFLAGS" in
7797                 (*$cf_add_cflags)
7798                         ;;
7799                 (*)
7800                         case $cf_add_cflags in
7801                         (-D*)
7802                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7803
7804 CPPFLAGS=`echo "$CPPFLAGS" | \
7805         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7806                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7807
7808                                 ;;
7809                         esac
7810
7811         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7812         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7813
7814                         ;;
7815                 esac
7816                 ;;
7817         (*)
7818
7819         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7820         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7821
7822                 ;;
7823         esac
7824         ;;
7825 (yes)
7826
7827         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7828         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7829
7830         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7831
7832         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7833                 && test -z "${cf_tst_cflags}" \
7834                 && cf_fix_cppflags=no
7835         ;;
7836 esac
7837 done
7838
7839 if test -n "$cf_new_cflags" ; then
7840
7841         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7842         CFLAGS="${CFLAGS}$cf_new_cflags"
7843
7844 fi
7845
7846 if test -n "$cf_new_cppflags" ; then
7847
7848         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7849         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7850
7851 fi
7852
7853 if test -n "$cf_new_extra_cppflags" ; then
7854
7855         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7856         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7857
7858 fi
7859
7860 cf_add_libs="$LIBS"
7861 # reverse order
7862 cf_add_0lib=
7863 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7864 # filter duplicates
7865 for cf_add_1lib in $cf_add_0lib; do
7866         for cf_add_2lib in $cf_add_libs; do
7867                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7868                         cf_add_1lib=
7869                         break
7870                 fi
7871         done
7872         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7873 done
7874 LIBS="$cf_add_libs"
7875
7876                 cat >conftest.$ac_ext <<_ACEOF
7877 #line 7877 "configure"
7878 #include "confdefs.h"
7879 #include <${cf_cv_ncurses_header:-curses.h}>
7880 int
7881 main (void)
7882 {
7883 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7884   ;
7885   return 0;
7886 }
7887 _ACEOF
7888 rm -f conftest.$ac_objext conftest$ac_exeext
7889 if { (eval echo "$as_me:7889: \"$ac_link\"") >&5
7890   (eval $ac_link) 2>&5
7891   ac_status=$?
7892   echo "$as_me:7892: \$? = $ac_status" >&5
7893   (exit $ac_status); } &&
7894          { ac_try='test -s conftest$ac_exeext'
7895   { (eval echo "$as_me:7895: \"$ac_try\"") >&5
7896   (eval $ac_try) 2>&5
7897   ac_status=$?
7898   echo "$as_me:7898: \$? = $ac_status" >&5
7899   (exit $ac_status); }; }; then
7900   if test "$cross_compiling" = yes; then
7901   cf_have_ncuconfig=maybe
7902 else
7903   cat >conftest.$ac_ext <<_ACEOF
7904 #line 7904 "configure"
7905 #include "confdefs.h"
7906 #include <${cf_cv_ncurses_header:-curses.h}>
7907                                 int main(void)
7908                                 { char *xx = curses_version(); return (xx == 0); }
7909 _ACEOF
7910 rm -f conftest$ac_exeext
7911 if { (eval echo "$as_me:7911: \"$ac_link\"") >&5
7912   (eval $ac_link) 2>&5
7913   ac_status=$?
7914   echo "$as_me:7914: \$? = $ac_status" >&5
7915   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7916   { (eval echo "$as_me:7916: \"$ac_try\"") >&5
7917   (eval $ac_try) 2>&5
7918   ac_status=$?
7919   echo "$as_me:7919: \$? = $ac_status" >&5
7920   (exit $ac_status); }; }; then
7921   cf_have_ncuconfig=yes
7922 else
7923   echo "$as_me: program exited with status $ac_status" >&5
7924 echo "$as_me: failed program was:" >&5
7925 cat conftest.$ac_ext >&5
7926 cf_have_ncuconfig=no
7927 fi
7928 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7929 fi
7930 else
7931   echo "$as_me: failed program was:" >&5
7932 cat conftest.$ac_ext >&5
7933 cf_have_ncuconfig=no
7934 fi
7935 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7936                 echo "$as_me:7936: result: $cf_have_ncuconfig" >&5
7937 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7938                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7939                 if test "$cf_have_ncuconfig" != "yes"
7940                 then
7941                         CPPFLAGS="$cf_save_CPPFLAGS"
7942                         LIBS="$cf_save_LIBS"
7943                         NCURSES_CONFIG_PKG=none
7944                 else
7945
7946 cat >>confdefs.h <<\EOF
7947 #define NCURSES 1
7948 EOF
7949
7950                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7951
7952 echo "$as_me:7952: checking for terminfo header" >&5
7953 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7954 if test "${cf_cv_term_header+set}" = set; then
7955   echo $ECHO_N "(cached) $ECHO_C" >&6
7956 else
7957
7958 case ${cf_cv_ncurses_header} in
7959 (*/ncurses.h|*/ncursesw.h)
7960         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7961         ;;
7962 (*)
7963         cf_term_header=term.h
7964         ;;
7965 esac
7966
7967 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7968 do
7969 cat >conftest.$ac_ext <<_ACEOF
7970 #line 7970 "configure"
7971 #include "confdefs.h"
7972 #include <stdio.h>
7973 #include <${cf_cv_ncurses_header:-curses.h}>
7974 #include <$cf_test>
7975
7976 int
7977 main (void)
7978 {
7979 int x = auto_left_margin; (void)x
7980   ;
7981   return 0;
7982 }
7983 _ACEOF
7984 rm -f conftest.$ac_objext
7985 if { (eval echo "$as_me:7985: \"$ac_compile\"") >&5
7986   (eval $ac_compile) 2>&5
7987   ac_status=$?
7988   echo "$as_me:7988: \$? = $ac_status" >&5
7989   (exit $ac_status); } &&
7990          { ac_try='test -s conftest.$ac_objext'
7991   { (eval echo "$as_me:7991: \"$ac_try\"") >&5
7992   (eval $ac_try) 2>&5
7993   ac_status=$?
7994   echo "$as_me:7994: \$? = $ac_status" >&5
7995   (exit $ac_status); }; }; then
7996
7997         cf_cv_term_header="$cf_test"
7998 else
7999   echo "$as_me: failed program was:" >&5
8000 cat conftest.$ac_ext >&5
8001
8002         cf_cv_term_header=unknown
8003
8004 fi
8005 rm -f conftest.$ac_objext conftest.$ac_ext
8006         test "$cf_cv_term_header" != unknown && break
8007 done
8008
8009 fi
8010 echo "$as_me:8010: result: $cf_cv_term_header" >&5
8011 echo "${ECHO_T}$cf_cv_term_header" >&6
8012
8013 # Set definitions to allow ifdef'ing to accommodate subdirectories
8014
8015 case $cf_cv_term_header in
8016 (*term.h)
8017
8018 cat >>confdefs.h <<\EOF
8019 #define HAVE_TERM_H 1
8020 EOF
8021
8022         ;;
8023 esac
8024
8025 case $cf_cv_term_header in
8026 (ncurses/term.h)
8027
8028 cat >>confdefs.h <<\EOF
8029 #define HAVE_NCURSES_TERM_H 1
8030 EOF
8031
8032         ;;
8033 (ncursesw/term.h)
8034
8035 cat >>confdefs.h <<\EOF
8036 #define HAVE_NCURSESW_TERM_H 1
8037 EOF
8038
8039         ;;
8040 esac
8041
8042                 fi
8043
8044         else
8045                 echo "$as_me:8045: result: no" >&5
8046 echo "${ECHO_T}no" >&6
8047                 NCURSES_CONFIG_PKG=none
8048         fi
8049 else
8050         NCURSES_CONFIG_PKG=none
8051 fi
8052
8053 if test "x$cf_have_ncuconfig" = "xno"; then
8054         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8055
8056 if test -n "$ac_tool_prefix"; then
8057   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8058   do
8059     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8060 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8061 echo "$as_me:8061: checking for $ac_word" >&5
8062 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8063 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8064   echo $ECHO_N "(cached) $ECHO_C" >&6
8065 else
8066   if test -n "$NCURSES_CONFIG"; then
8067   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8068 else
8069   ac_save_IFS=$IFS; IFS=$ac_path_separator
8070 ac_dummy="$PATH"
8071 for ac_dir in $ac_dummy; do
8072   IFS=$ac_save_IFS
8073   test -z "$ac_dir" && ac_dir=.
8074   $as_executable_p "$ac_dir/$ac_word" || continue
8075 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8076 echo "$as_me:8076: found $ac_dir/$ac_word" >&5
8077 break
8078 done
8079
8080 fi
8081 fi
8082 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8083 if test -n "$NCURSES_CONFIG"; then
8084   echo "$as_me:8084: result: $NCURSES_CONFIG" >&5
8085 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8086 else
8087   echo "$as_me:8087: result: no" >&5
8088 echo "${ECHO_T}no" >&6
8089 fi
8090
8091     test -n "$NCURSES_CONFIG" && break
8092   done
8093 fi
8094 if test -z "$NCURSES_CONFIG"; then
8095   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8096   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8097 do
8098   # Extract the first word of "$ac_prog", so it can be a program name with args.
8099 set dummy $ac_prog; ac_word=$2
8100 echo "$as_me:8100: checking for $ac_word" >&5
8101 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8102 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8103   echo $ECHO_N "(cached) $ECHO_C" >&6
8104 else
8105   if test -n "$ac_ct_NCURSES_CONFIG"; then
8106   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8107 else
8108   ac_save_IFS=$IFS; IFS=$ac_path_separator
8109 ac_dummy="$PATH"
8110 for ac_dir in $ac_dummy; do
8111   IFS=$ac_save_IFS
8112   test -z "$ac_dir" && ac_dir=.
8113   $as_executable_p "$ac_dir/$ac_word" || continue
8114 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8115 echo "$as_me:8115: found $ac_dir/$ac_word" >&5
8116 break
8117 done
8118
8119 fi
8120 fi
8121 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8122 if test -n "$ac_ct_NCURSES_CONFIG"; then
8123   echo "$as_me:8123: result: $ac_ct_NCURSES_CONFIG" >&5
8124 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8125 else
8126   echo "$as_me:8126: result: no" >&5
8127 echo "${ECHO_T}no" >&6
8128 fi
8129
8130   test -n "$ac_ct_NCURSES_CONFIG" && break
8131 done
8132 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8133
8134   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8135 fi
8136
8137         if test "$NCURSES_CONFIG" != none ; then
8138
8139 cf_fix_cppflags=no
8140 cf_new_cflags=
8141 cf_new_cppflags=
8142 cf_new_extra_cppflags=
8143
8144 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8145 do
8146 case $cf_fix_cppflags in
8147 (no)
8148         case $cf_add_cflags in
8149         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8150                 case $cf_add_cflags in
8151                 (-D*)
8152                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8153
8154                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8155                                 && test -z "${cf_tst_cflags}" \
8156                                 && cf_fix_cppflags=yes
8157
8158                         if test $cf_fix_cppflags = yes ; then
8159
8160         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8161         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8162
8163                                 continue
8164                         elif test "${cf_tst_cflags}" = "\"'" ; then
8165
8166         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8167         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8168
8169                                 continue
8170                         fi
8171                         ;;
8172                 esac
8173                 case "$CPPFLAGS" in
8174                 (*$cf_add_cflags)
8175                         ;;
8176                 (*)
8177                         case $cf_add_cflags in
8178                         (-D*)
8179                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8180
8181 CPPFLAGS=`echo "$CPPFLAGS" | \
8182         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8183                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8184
8185                                 ;;
8186                         esac
8187
8188         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8189         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8190
8191                         ;;
8192                 esac
8193                 ;;
8194         (*)
8195
8196         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8197         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8198
8199                 ;;
8200         esac
8201         ;;
8202 (yes)
8203
8204         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8205         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8206
8207         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8208
8209         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8210                 && test -z "${cf_tst_cflags}" \
8211                 && cf_fix_cppflags=no
8212         ;;
8213 esac
8214 done
8215
8216 if test -n "$cf_new_cflags" ; then
8217
8218         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8219         CFLAGS="${CFLAGS}$cf_new_cflags"
8220
8221 fi
8222
8223 if test -n "$cf_new_cppflags" ; then
8224
8225         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8226         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8227
8228 fi
8229
8230 if test -n "$cf_new_extra_cppflags" ; then
8231
8232         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8233         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8234
8235 fi
8236
8237 cf_add_libs="$LIBS"
8238 # reverse order
8239 cf_add_0lib=
8240 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8241 # filter duplicates
8242 for cf_add_1lib in $cf_add_0lib; do
8243         for cf_add_2lib in $cf_add_libs; do
8244                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8245                         cf_add_1lib=
8246                         break
8247                 fi
8248         done
8249         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8250 done
8251 LIBS="$cf_add_libs"
8252
8253                 # even with config script, some packages use no-override for curses.h
8254
8255 echo "$as_me:8255: checking if we have identified curses headers" >&5
8256 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8257 if test "${cf_cv_ncurses_header+set}" = set; then
8258   echo $ECHO_N "(cached) $ECHO_C" >&6
8259 else
8260
8261 cf_cv_ncurses_header=none
8262 for cf_header in \
8263         ncurses.h $cf_cv_screen/ncurses.h \
8264         curses.h $cf_cv_screen/curses.h
8265 do
8266 cat >conftest.$ac_ext <<_ACEOF
8267 #line 8267 "configure"
8268 #include "confdefs.h"
8269 #include <${cf_header}>
8270 int
8271 main (void)
8272 {
8273 initscr(); tgoto("?", 0,0)
8274   ;
8275   return 0;
8276 }
8277 _ACEOF
8278 rm -f conftest.$ac_objext
8279 if { (eval echo "$as_me:8279: \"$ac_compile\"") >&5
8280   (eval $ac_compile) 2>&5
8281   ac_status=$?
8282   echo "$as_me:8282: \$? = $ac_status" >&5
8283   (exit $ac_status); } &&
8284          { ac_try='test -s conftest.$ac_objext'
8285   { (eval echo "$as_me:8285: \"$ac_try\"") >&5
8286   (eval $ac_try) 2>&5
8287   ac_status=$?
8288   echo "$as_me:8288: \$? = $ac_status" >&5
8289   (exit $ac_status); }; }; then
8290   cf_cv_ncurses_header=$cf_header; break
8291 else
8292   echo "$as_me: failed program was:" >&5
8293 cat conftest.$ac_ext >&5
8294 fi
8295 rm -f conftest.$ac_objext conftest.$ac_ext
8296 done
8297
8298 fi
8299 echo "$as_me:8299: result: $cf_cv_ncurses_header" >&5
8300 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8301
8302 if test "$cf_cv_ncurses_header" = none ; then
8303         { { echo "$as_me:8303: error: No curses header-files found" >&5
8304 echo "$as_me: error: No curses header-files found" >&2;}
8305    { (exit 1); exit 1; }; }
8306 fi
8307
8308 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8309
8310 for ac_header in $cf_cv_ncurses_header
8311 do
8312 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8313 echo "$as_me:8313: checking for $ac_header" >&5
8314 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8315 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8316   echo $ECHO_N "(cached) $ECHO_C" >&6
8317 else
8318   cat >conftest.$ac_ext <<_ACEOF
8319 #line 8319 "configure"
8320 #include "confdefs.h"
8321 #include <$ac_header>
8322 _ACEOF
8323 if { (eval echo "$as_me:8323: \"$ac_cpp conftest.$ac_ext\"") >&5
8324   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8325   ac_status=$?
8326   egrep -v '^ *\+' conftest.er1 >conftest.err
8327   rm -f conftest.er1
8328   cat conftest.err >&5
8329   echo "$as_me:8329: \$? = $ac_status" >&5
8330   (exit $ac_status); } >/dev/null; then
8331   if test -s conftest.err; then
8332     ac_cpp_err=$ac_c_preproc_warn_flag
8333   else
8334     ac_cpp_err=
8335   fi
8336 else
8337   ac_cpp_err=yes
8338 fi
8339 if test -z "$ac_cpp_err"; then
8340   eval "$as_ac_Header=yes"
8341 else
8342   echo "$as_me: failed program was:" >&5
8343   cat conftest.$ac_ext >&5
8344   eval "$as_ac_Header=no"
8345 fi
8346 rm -f conftest.err conftest.$ac_ext
8347 fi
8348 echo "$as_me:8348: result: `eval echo '${'$as_ac_Header'}'`" >&5
8349 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8350 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8351   cat >>confdefs.h <<EOF
8352 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8353 EOF
8354
8355 fi
8356 done
8357
8358 cat >>confdefs.h <<\EOF
8359 #define NCURSES 1
8360 EOF
8361
8362 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8363
8364                 cat >>confdefs.h <<EOF
8365 #define $cf_nculib_ROOT 1
8366 EOF
8367
8368                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8369
8370         else
8371
8372 cf_ncuhdr_root=$cf_cv_screen
8373
8374 test -n "$cf_cv_curses_dir" && \
8375 test "$cf_cv_curses_dir" != "no" && { \
8376
8377 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8378   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8379   do
8380         while test $cf_add_incdir != /usr/include
8381         do
8382           if test -d $cf_add_incdir
8383           then
8384                 cf_have_incdir=no
8385                 if test -n "$CFLAGS$CPPFLAGS" ; then
8386                   # a loop is needed to ensure we can add subdirs of existing dirs
8387                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8388                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8389                           cf_have_incdir=yes; break
8390                         fi
8391                   done
8392                 fi
8393
8394                 if test "$cf_have_incdir" = no ; then
8395                   if test "$cf_add_incdir" = /usr/local/include ; then
8396                         if test "$GCC" = yes
8397                         then
8398                           cf_save_CPPFLAGS=$CPPFLAGS
8399
8400         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8401         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8402
8403                           cat >conftest.$ac_ext <<_ACEOF
8404 #line 8404 "configure"
8405 #include "confdefs.h"
8406 #include <stdio.h>
8407 int
8408 main (void)
8409 {
8410 printf("Hello")
8411   ;
8412   return 0;
8413 }
8414 _ACEOF
8415 rm -f conftest.$ac_objext
8416 if { (eval echo "$as_me:8416: \"$ac_compile\"") >&5
8417   (eval $ac_compile) 2>&5
8418   ac_status=$?
8419   echo "$as_me:8419: \$? = $ac_status" >&5
8420   (exit $ac_status); } &&
8421          { ac_try='test -s conftest.$ac_objext'
8422   { (eval echo "$as_me:8422: \"$ac_try\"") >&5
8423   (eval $ac_try) 2>&5
8424   ac_status=$?
8425   echo "$as_me:8425: \$? = $ac_status" >&5
8426   (exit $ac_status); }; }; then
8427   :
8428 else
8429   echo "$as_me: failed program was:" >&5
8430 cat conftest.$ac_ext >&5
8431 cf_have_incdir=yes
8432 fi
8433 rm -f conftest.$ac_objext conftest.$ac_ext
8434                           CPPFLAGS=$cf_save_CPPFLAGS
8435                         fi
8436                   fi
8437                 fi
8438
8439                 if test "$cf_have_incdir" = no ; then
8440                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8441
8442 echo "${as_me:-configure}:8442: testing adding $cf_add_incdir to include-path ..." 1>&5
8443
8444                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8445
8446                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8447                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8448                   cf_add_incdir="$cf_top_incdir"
8449                 else
8450                   break
8451                 fi
8452           else
8453                 break
8454           fi
8455         done
8456   done
8457 fi
8458
8459 }
8460
8461 echo "$as_me:8461: checking for $cf_ncuhdr_root header in include-path" >&5
8462 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8463 if test "${cf_cv_ncurses_h+set}" = set; then
8464   echo $ECHO_N "(cached) $ECHO_C" >&6
8465 else
8466
8467         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8468         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8469         for cf_header in $cf_header_list
8470         do
8471
8472         cat >conftest.$ac_ext <<_ACEOF
8473 #line 8473 "configure"
8474 #include "confdefs.h"
8475
8476 #include <$cf_header>
8477 int
8478 main (void)
8479 {
8480
8481 #ifdef NCURSES_VERSION
8482
8483 printf("%s\n", NCURSES_VERSION);
8484 #else
8485 #ifdef __NCURSES_H
8486 printf("old\n");
8487 #else
8488         make an error
8489 #endif
8490 #endif
8491
8492   ;
8493   return 0;
8494 }
8495 _ACEOF
8496 rm -f conftest.$ac_objext
8497 if { (eval echo "$as_me:8497: \"$ac_compile\"") >&5
8498   (eval $ac_compile) 2>&5
8499   ac_status=$?
8500   echo "$as_me:8500: \$? = $ac_status" >&5
8501   (exit $ac_status); } &&
8502          { ac_try='test -s conftest.$ac_objext'
8503   { (eval echo "$as_me:8503: \"$ac_try\"") >&5
8504   (eval $ac_try) 2>&5
8505   ac_status=$?
8506   echo "$as_me:8506: \$? = $ac_status" >&5
8507   (exit $ac_status); }; }; then
8508   cf_cv_ncurses_h=$cf_header
8509
8510 else
8511   echo "$as_me: failed program was:" >&5
8512 cat conftest.$ac_ext >&5
8513 cf_cv_ncurses_h=no
8514 fi
8515 rm -f conftest.$ac_objext conftest.$ac_ext
8516
8517                 test "$cf_cv_ncurses_h" != no && break
8518         done
8519
8520 fi
8521 echo "$as_me:8521: result: $cf_cv_ncurses_h" >&5
8522 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8523
8524 if test "$cf_cv_ncurses_h" != no ; then
8525         cf_cv_ncurses_header=$cf_cv_ncurses_h
8526 else
8527
8528 echo "$as_me:8528: checking for $cf_ncuhdr_root include-path" >&5
8529 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8530 if test "${cf_cv_ncurses_h2+set}" = set; then
8531   echo $ECHO_N "(cached) $ECHO_C" >&6
8532 else
8533
8534         test -n "$verbose" && echo
8535
8536 cf_search=
8537
8538 # collect the current set of include-directories from compiler flags
8539 cf_header_path_list=""
8540 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8541         for cf_header_path in $CPPFLAGS $CFLAGS
8542         do
8543                 case $cf_header_path in
8544                 (-I*)
8545                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8546
8547 test "x$cf_header_path" != "xNONE" && \
8548 test -d "$cf_header_path" && \
8549  {
8550         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8551         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8552         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8553         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8554         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8555         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"
8556 }
8557
8558                         cf_header_path_list="$cf_header_path_list $cf_search"
8559                         ;;
8560                 esac
8561         done
8562 fi
8563
8564 # add the variations for the package we are looking for
8565
8566 cf_search=
8567
8568 test "x$prefix" != "xNONE" && \
8569 test -d "$prefix" && \
8570  {
8571         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8572         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8573         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8574         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8575         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8576         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8577 }
8578
8579 for cf_subdir_prefix in \
8580         /usr \
8581         /usr/local \
8582         /usr/pkg \
8583         /opt \
8584         /opt/local \
8585         $HOME
8586 do
8587
8588 test "x$cf_subdir_prefix" != "x$prefix" && \
8589 test -d "$cf_subdir_prefix" && \
8590 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8591         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8592         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8593         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8594         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8595         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8596         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"
8597 }
8598
8599 done
8600
8601 test "$includedir" != NONE && \
8602 test "$includedir" != "/usr/include" && \
8603 test -d "$includedir" && {
8604         test -d $includedir &&    cf_search="$cf_search $includedir"
8605         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8606 }
8607
8608 test "$oldincludedir" != NONE && \
8609 test "$oldincludedir" != "/usr/include" && \
8610 test -d "$oldincludedir" && {
8611         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8612         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8613 }
8614
8615 cf_search="$cf_search $cf_header_path_list"
8616
8617         test -n "$verbose" && echo search path $cf_search
8618         cf_save2_CPPFLAGS="$CPPFLAGS"
8619         for cf_incdir in $cf_search
8620         do
8621
8622 if test -n "$cf_incdir" ; then
8623   for cf_add_incdir in $cf_incdir
8624   do
8625         while test $cf_add_incdir != /usr/include
8626         do
8627           if test -d $cf_add_incdir
8628           then
8629                 cf_have_incdir=no
8630                 if test -n "$CFLAGS$CPPFLAGS" ; then
8631                   # a loop is needed to ensure we can add subdirs of existing dirs
8632                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8633                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8634                           cf_have_incdir=yes; break
8635                         fi
8636                   done
8637                 fi
8638
8639                 if test "$cf_have_incdir" = no ; then
8640                   if test "$cf_add_incdir" = /usr/local/include ; then
8641                         if test "$GCC" = yes
8642                         then
8643                           cf_save_CPPFLAGS=$CPPFLAGS
8644
8645         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8646         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8647
8648                           cat >conftest.$ac_ext <<_ACEOF
8649 #line 8649 "configure"
8650 #include "confdefs.h"
8651 #include <stdio.h>
8652 int
8653 main (void)
8654 {
8655 printf("Hello")
8656   ;
8657   return 0;
8658 }
8659 _ACEOF
8660 rm -f conftest.$ac_objext
8661 if { (eval echo "$as_me:8661: \"$ac_compile\"") >&5
8662   (eval $ac_compile) 2>&5
8663   ac_status=$?
8664   echo "$as_me:8664: \$? = $ac_status" >&5
8665   (exit $ac_status); } &&
8666          { ac_try='test -s conftest.$ac_objext'
8667   { (eval echo "$as_me:8667: \"$ac_try\"") >&5
8668   (eval $ac_try) 2>&5
8669   ac_status=$?
8670   echo "$as_me:8670: \$? = $ac_status" >&5
8671   (exit $ac_status); }; }; then
8672   :
8673 else
8674   echo "$as_me: failed program was:" >&5
8675 cat conftest.$ac_ext >&5
8676 cf_have_incdir=yes
8677 fi
8678 rm -f conftest.$ac_objext conftest.$ac_ext
8679                           CPPFLAGS=$cf_save_CPPFLAGS
8680                         fi
8681                   fi
8682                 fi
8683
8684                 if test "$cf_have_incdir" = no ; then
8685                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8686
8687 echo "${as_me:-configure}:8687: testing adding $cf_add_incdir to include-path ..." 1>&5
8688
8689                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8690
8691                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8692                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8693                   cf_add_incdir="$cf_top_incdir"
8694                 else
8695                   break
8696                 fi
8697           else
8698                 break
8699           fi
8700         done
8701   done
8702 fi
8703
8704                 for cf_header in \
8705                         ncurses.h \
8706                         curses.h
8707                 do
8708
8709         cat >conftest.$ac_ext <<_ACEOF
8710 #line 8710 "configure"
8711 #include "confdefs.h"
8712
8713 #include <$cf_header>
8714 int
8715 main (void)
8716 {
8717
8718 #ifdef NCURSES_VERSION
8719
8720 printf("%s\n", NCURSES_VERSION);
8721 #else
8722 #ifdef __NCURSES_H
8723 printf("old\n");
8724 #else
8725         make an error
8726 #endif
8727 #endif
8728
8729   ;
8730   return 0;
8731 }
8732 _ACEOF
8733 rm -f conftest.$ac_objext
8734 if { (eval echo "$as_me:8734: \"$ac_compile\"") >&5
8735   (eval $ac_compile) 2>&5
8736   ac_status=$?
8737   echo "$as_me:8737: \$? = $ac_status" >&5
8738   (exit $ac_status); } &&
8739          { ac_try='test -s conftest.$ac_objext'
8740   { (eval echo "$as_me:8740: \"$ac_try\"") >&5
8741   (eval $ac_try) 2>&5
8742   ac_status=$?
8743   echo "$as_me:8743: \$? = $ac_status" >&5
8744   (exit $ac_status); }; }; then
8745   cf_cv_ncurses_h2=$cf_header
8746
8747 else
8748   echo "$as_me: failed program was:" >&5
8749 cat conftest.$ac_ext >&5
8750 cf_cv_ncurses_h2=no
8751 fi
8752 rm -f conftest.$ac_objext conftest.$ac_ext
8753
8754                         if test "$cf_cv_ncurses_h2" != no ; then
8755                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8756                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8757                                 break
8758                         fi
8759                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8760                 done
8761                 CPPFLAGS="$cf_save2_CPPFLAGS"
8762                 test "$cf_cv_ncurses_h2" != no && break
8763         done
8764         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8764: error: not found" >&5
8765 echo "$as_me: error: not found" >&2;}
8766    { (exit 1); exit 1; }; }
8767
8768 fi
8769 echo "$as_me:8769: result: $cf_cv_ncurses_h2" >&5
8770 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8771
8772         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8773         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8774         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8775                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8776         fi
8777
8778 if test -n "$cf_1st_incdir" ; then
8779   for cf_add_incdir in $cf_1st_incdir
8780   do
8781         while test $cf_add_incdir != /usr/include
8782         do
8783           if test -d $cf_add_incdir
8784           then
8785                 cf_have_incdir=no
8786                 if test -n "$CFLAGS$CPPFLAGS" ; then
8787                   # a loop is needed to ensure we can add subdirs of existing dirs
8788                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8789                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8790                           cf_have_incdir=yes; break
8791                         fi
8792                   done
8793                 fi
8794
8795                 if test "$cf_have_incdir" = no ; then
8796                   if test "$cf_add_incdir" = /usr/local/include ; then
8797                         if test "$GCC" = yes
8798                         then
8799                           cf_save_CPPFLAGS=$CPPFLAGS
8800
8801         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8802         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8803
8804                           cat >conftest.$ac_ext <<_ACEOF
8805 #line 8805 "configure"
8806 #include "confdefs.h"
8807 #include <stdio.h>
8808 int
8809 main (void)
8810 {
8811 printf("Hello")
8812   ;
8813   return 0;
8814 }
8815 _ACEOF
8816 rm -f conftest.$ac_objext
8817 if { (eval echo "$as_me:8817: \"$ac_compile\"") >&5
8818   (eval $ac_compile) 2>&5
8819   ac_status=$?
8820   echo "$as_me:8820: \$? = $ac_status" >&5
8821   (exit $ac_status); } &&
8822          { ac_try='test -s conftest.$ac_objext'
8823   { (eval echo "$as_me:8823: \"$ac_try\"") >&5
8824   (eval $ac_try) 2>&5
8825   ac_status=$?
8826   echo "$as_me:8826: \$? = $ac_status" >&5
8827   (exit $ac_status); }; }; then
8828   :
8829 else
8830   echo "$as_me: failed program was:" >&5
8831 cat conftest.$ac_ext >&5
8832 cf_have_incdir=yes
8833 fi
8834 rm -f conftest.$ac_objext conftest.$ac_ext
8835                           CPPFLAGS=$cf_save_CPPFLAGS
8836                         fi
8837                   fi
8838                 fi
8839
8840                 if test "$cf_have_incdir" = no ; then
8841                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8842
8843 echo "${as_me:-configure}:8843: testing adding $cf_add_incdir to include-path ..." 1>&5
8844
8845                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8846
8847                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8848                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8849                   cf_add_incdir="$cf_top_incdir"
8850                 else
8851                   break
8852                 fi
8853           else
8854                 break
8855           fi
8856         done
8857   done
8858 fi
8859
8860 fi
8861
8862 # Set definitions to allow ifdef'ing for ncurses.h
8863
8864 case $cf_cv_ncurses_header in
8865 (*ncurses.h)
8866
8867 cat >>confdefs.h <<\EOF
8868 #define HAVE_NCURSES_H 1
8869 EOF
8870
8871         ;;
8872 esac
8873
8874 case $cf_cv_ncurses_header in
8875 (ncurses/curses.h|ncurses/ncurses.h)
8876
8877 cat >>confdefs.h <<\EOF
8878 #define HAVE_NCURSES_NCURSES_H 1
8879 EOF
8880
8881         ;;
8882 (ncursesw/curses.h|ncursesw/ncurses.h)
8883
8884 cat >>confdefs.h <<\EOF
8885 #define HAVE_NCURSESW_NCURSES_H 1
8886 EOF
8887
8888         ;;
8889 esac
8890
8891 echo "$as_me:8891: checking for terminfo header" >&5
8892 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8893 if test "${cf_cv_term_header+set}" = set; then
8894   echo $ECHO_N "(cached) $ECHO_C" >&6
8895 else
8896
8897 case ${cf_cv_ncurses_header} in
8898 (*/ncurses.h|*/ncursesw.h)
8899         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8900         ;;
8901 (*)
8902         cf_term_header=term.h
8903         ;;
8904 esac
8905
8906 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8907 do
8908 cat >conftest.$ac_ext <<_ACEOF
8909 #line 8909 "configure"
8910 #include "confdefs.h"
8911 #include <stdio.h>
8912 #include <${cf_cv_ncurses_header:-curses.h}>
8913 #include <$cf_test>
8914
8915 int
8916 main (void)
8917 {
8918 int x = auto_left_margin; (void)x
8919   ;
8920   return 0;
8921 }
8922 _ACEOF
8923 rm -f conftest.$ac_objext
8924 if { (eval echo "$as_me:8924: \"$ac_compile\"") >&5
8925   (eval $ac_compile) 2>&5
8926   ac_status=$?
8927   echo "$as_me:8927: \$? = $ac_status" >&5
8928   (exit $ac_status); } &&
8929          { ac_try='test -s conftest.$ac_objext'
8930   { (eval echo "$as_me:8930: \"$ac_try\"") >&5
8931   (eval $ac_try) 2>&5
8932   ac_status=$?
8933   echo "$as_me:8933: \$? = $ac_status" >&5
8934   (exit $ac_status); }; }; then
8935
8936         cf_cv_term_header="$cf_test"
8937 else
8938   echo "$as_me: failed program was:" >&5
8939 cat conftest.$ac_ext >&5
8940
8941         cf_cv_term_header=unknown
8942
8943 fi
8944 rm -f conftest.$ac_objext conftest.$ac_ext
8945         test "$cf_cv_term_header" != unknown && break
8946 done
8947
8948 fi
8949 echo "$as_me:8949: result: $cf_cv_term_header" >&5
8950 echo "${ECHO_T}$cf_cv_term_header" >&6
8951
8952 # Set definitions to allow ifdef'ing to accommodate subdirectories
8953
8954 case $cf_cv_term_header in
8955 (*term.h)
8956
8957 cat >>confdefs.h <<\EOF
8958 #define HAVE_TERM_H 1
8959 EOF
8960
8961         ;;
8962 esac
8963
8964 case $cf_cv_term_header in
8965 (ncurses/term.h)
8966
8967 cat >>confdefs.h <<\EOF
8968 #define HAVE_NCURSES_TERM_H 1
8969 EOF
8970
8971         ;;
8972 (ncursesw/term.h)
8973
8974 cat >>confdefs.h <<\EOF
8975 #define HAVE_NCURSESW_TERM_H 1
8976 EOF
8977
8978         ;;
8979 esac
8980
8981 # some applications need this, but should check for NCURSES_VERSION
8982
8983 cat >>confdefs.h <<\EOF
8984 #define NCURSES 1
8985 EOF
8986
8987 echo "$as_me:8987: checking for ncurses version" >&5
8988 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8989 if test "${cf_cv_ncurses_version+set}" = set; then
8990   echo $ECHO_N "(cached) $ECHO_C" >&6
8991 else
8992
8993         cf_cv_ncurses_version=no
8994         cf_tempfile=out$$
8995         rm -f $cf_tempfile
8996         if test "$cross_compiling" = yes; then
8997
8998         # This will not work if the preprocessor splits the line after the
8999         # Autoconf token.  The 'unproto' program does that.
9000         cat > conftest.$ac_ext <<EOF
9001 #include <${cf_cv_ncurses_header:-curses.h}>
9002 #undef Autoconf
9003 #ifdef NCURSES_VERSION
9004 Autoconf NCURSES_VERSION
9005 #else
9006 #ifdef __NCURSES_H
9007 Autoconf "old"
9008 #endif
9009 ;
9010 #endif
9011 EOF
9012         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9013         { (eval echo "$as_me:9013: \"$cf_try\"") >&5
9014   (eval $cf_try) 2>&5
9015   ac_status=$?
9016   echo "$as_me:9016: \$? = $ac_status" >&5
9017   (exit $ac_status); }
9018         if test -f conftest.out ; then
9019                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9020                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9021                 rm -f conftest.out
9022         fi
9023
9024 else
9025   cat >conftest.$ac_ext <<_ACEOF
9026 #line 9026 "configure"
9027 #include "confdefs.h"
9028
9029 #include <${cf_cv_ncurses_header:-curses.h}>
9030 #include <stdio.h>
9031 int main(void)
9032 {
9033         FILE *fp = fopen("$cf_tempfile", "w");
9034 #ifdef NCURSES_VERSION
9035 # ifdef NCURSES_VERSION_PATCH
9036         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9037 # else
9038         fprintf(fp, "%s\n", NCURSES_VERSION);
9039 # endif
9040 #else
9041 # ifdef __NCURSES_H
9042         fprintf(fp, "old\n");
9043 # else
9044         make an error
9045 # endif
9046 #endif
9047         ${cf_cv_main_return:-return}(0);
9048 }
9049 _ACEOF
9050 rm -f conftest$ac_exeext
9051 if { (eval echo "$as_me:9051: \"$ac_link\"") >&5
9052   (eval $ac_link) 2>&5
9053   ac_status=$?
9054   echo "$as_me:9054: \$? = $ac_status" >&5
9055   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9056   { (eval echo "$as_me:9056: \"$ac_try\"") >&5
9057   (eval $ac_try) 2>&5
9058   ac_status=$?
9059   echo "$as_me:9059: \$? = $ac_status" >&5
9060   (exit $ac_status); }; }; then
9061
9062         cf_cv_ncurses_version=`cat $cf_tempfile`
9063 else
9064   echo "$as_me: program exited with status $ac_status" >&5
9065 echo "$as_me: failed program was:" >&5
9066 cat conftest.$ac_ext >&5
9067 fi
9068 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9069 fi
9070         rm -f $cf_tempfile
9071
9072 fi
9073 echo "$as_me:9073: result: $cf_cv_ncurses_version" >&5
9074 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9075 test "$cf_cv_ncurses_version" = no ||
9076 cat >>confdefs.h <<\EOF
9077 #define NCURSES 1
9078 EOF
9079
9080 cf_nculib_root=$cf_cv_screen
9081         # This works, except for the special case where we find gpm, but
9082         # ncurses is in a nonstandard location via $LIBS, and we really want
9083         # to link gpm.
9084 cf_ncurses_LIBS=""
9085 cf_ncurses_SAVE="$LIBS"
9086 echo "$as_me:9086: checking for Gpm_Open in -lgpm" >&5
9087 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9088 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9089   echo $ECHO_N "(cached) $ECHO_C" >&6
9090 else
9091   ac_check_lib_save_LIBS=$LIBS
9092 LIBS="-lgpm  $LIBS"
9093 cat >conftest.$ac_ext <<_ACEOF
9094 #line 9094 "configure"
9095 #include "confdefs.h"
9096
9097 /* Override any gcc2 internal prototype to avoid an error.  */
9098 #ifdef __cplusplus
9099 extern "C"
9100 #endif
9101 /* We use char because int might match the return type of a gcc2
9102    builtin and then its argument prototype would still apply.  */
9103 char Gpm_Open ();
9104 int
9105 main (void)
9106 {
9107 Gpm_Open ();
9108   ;
9109   return 0;
9110 }
9111 _ACEOF
9112 rm -f conftest.$ac_objext conftest$ac_exeext
9113 if { (eval echo "$as_me:9113: \"$ac_link\"") >&5
9114   (eval $ac_link) 2>&5
9115   ac_status=$?
9116   echo "$as_me:9116: \$? = $ac_status" >&5
9117   (exit $ac_status); } &&
9118          { ac_try='test -s conftest$ac_exeext'
9119   { (eval echo "$as_me:9119: \"$ac_try\"") >&5
9120   (eval $ac_try) 2>&5
9121   ac_status=$?
9122   echo "$as_me:9122: \$? = $ac_status" >&5
9123   (exit $ac_status); }; }; then
9124   ac_cv_lib_gpm_Gpm_Open=yes
9125 else
9126   echo "$as_me: failed program was:" >&5
9127 cat conftest.$ac_ext >&5
9128 ac_cv_lib_gpm_Gpm_Open=no
9129 fi
9130 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9131 LIBS=$ac_check_lib_save_LIBS
9132 fi
9133 echo "$as_me:9133: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9134 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9135 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9136   echo "$as_me:9136: checking for initscr in -lgpm" >&5
9137 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9138 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9139   echo $ECHO_N "(cached) $ECHO_C" >&6
9140 else
9141   ac_check_lib_save_LIBS=$LIBS
9142 LIBS="-lgpm  $LIBS"
9143 cat >conftest.$ac_ext <<_ACEOF
9144 #line 9144 "configure"
9145 #include "confdefs.h"
9146
9147 /* Override any gcc2 internal prototype to avoid an error.  */
9148 #ifdef __cplusplus
9149 extern "C"
9150 #endif
9151 /* We use char because int might match the return type of a gcc2
9152    builtin and then its argument prototype would still apply.  */
9153 char initscr ();
9154 int
9155 main (void)
9156 {
9157 initscr ();
9158   ;
9159   return 0;
9160 }
9161 _ACEOF
9162 rm -f conftest.$ac_objext conftest$ac_exeext
9163 if { (eval echo "$as_me:9163: \"$ac_link\"") >&5
9164   (eval $ac_link) 2>&5
9165   ac_status=$?
9166   echo "$as_me:9166: \$? = $ac_status" >&5
9167   (exit $ac_status); } &&
9168          { ac_try='test -s conftest$ac_exeext'
9169   { (eval echo "$as_me:9169: \"$ac_try\"") >&5
9170   (eval $ac_try) 2>&5
9171   ac_status=$?
9172   echo "$as_me:9172: \$? = $ac_status" >&5
9173   (exit $ac_status); }; }; then
9174   ac_cv_lib_gpm_initscr=yes
9175 else
9176   echo "$as_me: failed program was:" >&5
9177 cat conftest.$ac_ext >&5
9178 ac_cv_lib_gpm_initscr=no
9179 fi
9180 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9181 LIBS=$ac_check_lib_save_LIBS
9182 fi
9183 echo "$as_me:9183: result: $ac_cv_lib_gpm_initscr" >&5
9184 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9185 if test $ac_cv_lib_gpm_initscr = yes; then
9186   LIBS="$cf_ncurses_SAVE"
9187 else
9188   cf_ncurses_LIBS="-lgpm"
9189 fi
9190
9191 fi
9192
9193 case $host_os in
9194 (freebsd*)
9195         # This is only necessary if you are linking against an obsolete
9196         # version of ncurses (but it should do no harm, since it's static).
9197         if test "$cf_nculib_root" = ncurses ; then
9198                 echo "$as_me:9198: checking for tgoto in -lmytinfo" >&5
9199 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9200 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9201   echo $ECHO_N "(cached) $ECHO_C" >&6
9202 else
9203   ac_check_lib_save_LIBS=$LIBS
9204 LIBS="-lmytinfo  $LIBS"
9205 cat >conftest.$ac_ext <<_ACEOF
9206 #line 9206 "configure"
9207 #include "confdefs.h"
9208
9209 /* Override any gcc2 internal prototype to avoid an error.  */
9210 #ifdef __cplusplus
9211 extern "C"
9212 #endif
9213 /* We use char because int might match the return type of a gcc2
9214    builtin and then its argument prototype would still apply.  */
9215 char tgoto ();
9216 int
9217 main (void)
9218 {
9219 tgoto ();
9220   ;
9221   return 0;
9222 }
9223 _ACEOF
9224 rm -f conftest.$ac_objext conftest$ac_exeext
9225 if { (eval echo "$as_me:9225: \"$ac_link\"") >&5
9226   (eval $ac_link) 2>&5
9227   ac_status=$?
9228   echo "$as_me:9228: \$? = $ac_status" >&5
9229   (exit $ac_status); } &&
9230          { ac_try='test -s conftest$ac_exeext'
9231   { (eval echo "$as_me:9231: \"$ac_try\"") >&5
9232   (eval $ac_try) 2>&5
9233   ac_status=$?
9234   echo "$as_me:9234: \$? = $ac_status" >&5
9235   (exit $ac_status); }; }; then
9236   ac_cv_lib_mytinfo_tgoto=yes
9237 else
9238   echo "$as_me: failed program was:" >&5
9239 cat conftest.$ac_ext >&5
9240 ac_cv_lib_mytinfo_tgoto=no
9241 fi
9242 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9243 LIBS=$ac_check_lib_save_LIBS
9244 fi
9245 echo "$as_me:9245: result: $ac_cv_lib_mytinfo_tgoto" >&5
9246 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9247 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9248   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9249 fi
9250
9251         fi
9252         ;;
9253 esac
9254
9255 cf_add_libs="$LIBS"
9256 # reverse order
9257 cf_add_0lib=
9258 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9259 # filter duplicates
9260 for cf_add_1lib in $cf_add_0lib; do
9261         for cf_add_2lib in $cf_add_libs; do
9262                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9263                         cf_add_1lib=
9264                         break
9265                 fi
9266         done
9267         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9268 done
9269 LIBS="$cf_add_libs"
9270
9271 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9272 then
9273
9274 cf_add_libs="$LIBS"
9275 # reverse order
9276 cf_add_0lib=
9277 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9278 # filter duplicates
9279 for cf_add_1lib in $cf_add_0lib; do
9280         for cf_add_2lib in $cf_add_libs; do
9281                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9282                         cf_add_1lib=
9283                         break
9284                 fi
9285         done
9286         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9287 done
9288 LIBS="$cf_add_libs"
9289
9290 else
9291
9292         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9293         cf_libdir=""
9294         echo "$as_me:9294: checking for initscr" >&5
9295 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9296 if test "${ac_cv_func_initscr+set}" = set; then
9297   echo $ECHO_N "(cached) $ECHO_C" >&6
9298 else
9299   cat >conftest.$ac_ext <<_ACEOF
9300 #line 9300 "configure"
9301 #include "confdefs.h"
9302 #define initscr autoconf_temporary
9303 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9304 #undef initscr
9305
9306 #ifdef __cplusplus
9307 extern "C"
9308 #endif
9309
9310 /* We use char because int might match the return type of a gcc2
9311    builtin and then its argument prototype would still apply.  */
9312 char initscr (void);
9313
9314 int
9315 main (void)
9316 {
9317
9318 /* The GNU C library defines stubs for functions which it implements
9319     to always fail with ENOSYS.  Some functions are actually named
9320     something starting with __ and the normal name is an alias.  */
9321 #if defined (__stub_initscr) || defined (__stub___initscr)
9322 #error found stub for initscr
9323 #endif
9324
9325         return initscr ();
9326   ;
9327   return 0;
9328 }
9329 _ACEOF
9330 rm -f conftest.$ac_objext conftest$ac_exeext
9331 if { (eval echo "$as_me:9331: \"$ac_link\"") >&5
9332   (eval $ac_link) 2>&5
9333   ac_status=$?
9334   echo "$as_me:9334: \$? = $ac_status" >&5
9335   (exit $ac_status); } &&
9336          { ac_try='test -s conftest$ac_exeext'
9337   { (eval echo "$as_me:9337: \"$ac_try\"") >&5
9338   (eval $ac_try) 2>&5
9339   ac_status=$?
9340   echo "$as_me:9340: \$? = $ac_status" >&5
9341   (exit $ac_status); }; }; then
9342   ac_cv_func_initscr=yes
9343 else
9344   echo "$as_me: failed program was:" >&5
9345 cat conftest.$ac_ext >&5
9346 ac_cv_func_initscr=no
9347 fi
9348 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9349 fi
9350 echo "$as_me:9350: result: $ac_cv_func_initscr" >&5
9351 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9352 if test $ac_cv_func_initscr = yes; then
9353   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9354 else
9355
9356                 cf_save_LIBS="$LIBS"
9357                 echo "$as_me:9357: checking for initscr in -l$cf_nculib_root" >&5
9358 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9359                 LIBS="-l$cf_nculib_root $LIBS"
9360                 cat >conftest.$ac_ext <<_ACEOF
9361 #line 9361 "configure"
9362 #include "confdefs.h"
9363 #include <${cf_cv_ncurses_header:-curses.h}>
9364 int
9365 main (void)
9366 {
9367 initscr()
9368   ;
9369   return 0;
9370 }
9371 _ACEOF
9372 rm -f conftest.$ac_objext conftest$ac_exeext
9373 if { (eval echo "$as_me:9373: \"$ac_link\"") >&5
9374   (eval $ac_link) 2>&5
9375   ac_status=$?
9376   echo "$as_me:9376: \$? = $ac_status" >&5
9377   (exit $ac_status); } &&
9378          { ac_try='test -s conftest$ac_exeext'
9379   { (eval echo "$as_me:9379: \"$ac_try\"") >&5
9380   (eval $ac_try) 2>&5
9381   ac_status=$?
9382   echo "$as_me:9382: \$? = $ac_status" >&5
9383   (exit $ac_status); }; }; then
9384   echo "$as_me:9384: result: yes" >&5
9385 echo "${ECHO_T}yes" >&6
9386                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9387
9388 else
9389   echo "$as_me: failed program was:" >&5
9390 cat conftest.$ac_ext >&5
9391 echo "$as_me:9391: result: no" >&5
9392 echo "${ECHO_T}no" >&6
9393
9394 cf_search=
9395 cf_library_path_list=""
9396 if test -n "${LDFLAGS}${LIBS}" ; then
9397         for cf_library_path in $LDFLAGS $LIBS
9398         do
9399                 case $cf_library_path in
9400                 (-L*)
9401                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9402
9403 test "x$cf_library_path" != "xNONE" && \
9404 test -d "$cf_library_path" && \
9405  {
9406         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9407         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9408         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9409         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9410         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9411         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"
9412 }
9413
9414                         cf_library_path_list="$cf_library_path_list $cf_search"
9415                         ;;
9416                 esac
9417         done
9418 fi
9419
9420 cf_search=
9421
9422 test "x$prefix" != "xNONE" && \
9423 test -d "$prefix" && \
9424  {
9425         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9426         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9427         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9428         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9429         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9430         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9431 }
9432
9433 for cf_subdir_prefix in \
9434         /usr \
9435         /usr/local \
9436         /usr/pkg \
9437         /opt \
9438         /opt/local \
9439         $HOME
9440 do
9441
9442 test "x$cf_subdir_prefix" != "x$prefix" && \
9443 test -d "$cf_subdir_prefix" && \
9444 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9445         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9446         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9447         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9448         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9449         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9450         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"
9451 }
9452
9453 done
9454
9455 cf_search="$cf_library_path_list $cf_search"
9456
9457                         for cf_libdir in $cf_search
9458                         do
9459                                 echo "$as_me:9459: checking for -l$cf_nculib_root in $cf_libdir" >&5
9460 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9461                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9462                                 cat >conftest.$ac_ext <<_ACEOF
9463 #line 9463 "configure"
9464 #include "confdefs.h"
9465 #include <${cf_cv_ncurses_header:-curses.h}>
9466 int
9467 main (void)
9468 {
9469 initscr()
9470   ;
9471   return 0;
9472 }
9473 _ACEOF
9474 rm -f conftest.$ac_objext conftest$ac_exeext
9475 if { (eval echo "$as_me:9475: \"$ac_link\"") >&5
9476   (eval $ac_link) 2>&5
9477   ac_status=$?
9478   echo "$as_me:9478: \$? = $ac_status" >&5
9479   (exit $ac_status); } &&
9480          { ac_try='test -s conftest$ac_exeext'
9481   { (eval echo "$as_me:9481: \"$ac_try\"") >&5
9482   (eval $ac_try) 2>&5
9483   ac_status=$?
9484   echo "$as_me:9484: \$? = $ac_status" >&5
9485   (exit $ac_status); }; }; then
9486   echo "$as_me:9486: result: yes" >&5
9487 echo "${ECHO_T}yes" >&6
9488                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9489                                          break
9490 else
9491   echo "$as_me: failed program was:" >&5
9492 cat conftest.$ac_ext >&5
9493 echo "$as_me:9493: result: no" >&5
9494 echo "${ECHO_T}no" >&6
9495                                          LIBS="$cf_save_LIBS"
9496 fi
9497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9498                         done
9499
9500 fi
9501 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9502
9503 fi
9504
9505 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9506
9507 if test $cf_found_library = no ; then
9508         { { echo "$as_me:9508: error: Cannot link $cf_nculib_root library" >&5
9509 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9510    { (exit 1); exit 1; }; }
9511 fi
9512
9513 fi
9514
9515 if test -n "$cf_ncurses_LIBS" ; then
9516         echo "$as_me:9516: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9517 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9518         cf_ncurses_SAVE="$LIBS"
9519         for p in $cf_ncurses_LIBS ; do
9520                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9521                 if test "$q" != "$LIBS" ; then
9522                         LIBS="$q"
9523                 fi
9524         done
9525         cat >conftest.$ac_ext <<_ACEOF
9526 #line 9526 "configure"
9527 #include "confdefs.h"
9528 #include <${cf_cv_ncurses_header:-curses.h}>
9529 int
9530 main (void)
9531 {
9532 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9533   ;
9534   return 0;
9535 }
9536 _ACEOF
9537 rm -f conftest.$ac_objext conftest$ac_exeext
9538 if { (eval echo "$as_me:9538: \"$ac_link\"") >&5
9539   (eval $ac_link) 2>&5
9540   ac_status=$?
9541   echo "$as_me:9541: \$? = $ac_status" >&5
9542   (exit $ac_status); } &&
9543          { ac_try='test -s conftest$ac_exeext'
9544   { (eval echo "$as_me:9544: \"$ac_try\"") >&5
9545   (eval $ac_try) 2>&5
9546   ac_status=$?
9547   echo "$as_me:9547: \$? = $ac_status" >&5
9548   (exit $ac_status); }; }; then
9549   echo "$as_me:9549: result: yes" >&5
9550 echo "${ECHO_T}yes" >&6
9551 else
9552   echo "$as_me: failed program was:" >&5
9553 cat conftest.$ac_ext >&5
9554 echo "$as_me:9554: result: no" >&5
9555 echo "${ECHO_T}no" >&6
9556                  LIBS="$cf_ncurses_SAVE"
9557 fi
9558 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9559 fi
9560
9561 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9562
9563 cat >>confdefs.h <<EOF
9564 #define $cf_nculib_ROOT 1
9565 EOF
9566
9567         fi
9568 else
9569         NCURSES_CONFIG=none
9570 fi
9571
9572         ;;
9573 (ncurses*)
9574
9575 cf_ncuconfig_root=$cf_cv_screen
9576 cf_have_ncuconfig=no
9577
9578 if test "x${PKG_CONFIG:=none}" != xnone; then
9579         echo "$as_me:9579: checking pkg-config for $cf_ncuconfig_root" >&5
9580 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9581         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9582                 echo "$as_me:9582: result: yes" >&5
9583 echo "${ECHO_T}yes" >&6
9584
9585                 echo "$as_me:9585: checking if the $cf_ncuconfig_root package files work" >&5
9586 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9587                 cf_have_ncuconfig=unknown
9588
9589                 cf_save_CFLAGS="$CFLAGS"
9590                 cf_save_CPPFLAGS="$CPPFLAGS"
9591                 cf_save_LIBS="$LIBS"
9592
9593                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
9594                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
9595
9596                 # while -W for passing linker flags is prevalent, it is not "standard".
9597                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9598                 # incompatible _and_ non-standard -W option which gives an error.  Work
9599                 # around that pitfall.
9600                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9601                 (x*c[89]9@@*-W*)
9602
9603 cf_fix_cppflags=no
9604 cf_new_cflags=
9605 cf_new_cppflags=
9606 cf_new_extra_cppflags=
9607
9608 for cf_add_cflags in $cf_pkg_cflags
9609 do
9610 case $cf_fix_cppflags in
9611 (no)
9612         case $cf_add_cflags in
9613         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9614                 case $cf_add_cflags in
9615                 (-D*)
9616                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9617
9618                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9619                                 && test -z "${cf_tst_cflags}" \
9620                                 && cf_fix_cppflags=yes
9621
9622                         if test $cf_fix_cppflags = yes ; then
9623
9624         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9625         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9626
9627                                 continue
9628                         elif test "${cf_tst_cflags}" = "\"'" ; then
9629
9630         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9631         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9632
9633                                 continue
9634                         fi
9635                         ;;
9636                 esac
9637                 case "$CPPFLAGS" in
9638                 (*$cf_add_cflags)
9639                         ;;
9640                 (*)
9641                         case $cf_add_cflags in
9642                         (-D*)
9643                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9644
9645 CPPFLAGS=`echo "$CPPFLAGS" | \
9646         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9647                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9648
9649                                 ;;
9650                         esac
9651
9652         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9653         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9654
9655                         ;;
9656                 esac
9657                 ;;
9658         (*)
9659
9660         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9661         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9662
9663                 ;;
9664         esac
9665         ;;
9666 (yes)
9667
9668         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9669         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9670
9671         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9672
9673         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9674                 && test -z "${cf_tst_cflags}" \
9675                 && cf_fix_cppflags=no
9676         ;;
9677 esac
9678 done
9679
9680 if test -n "$cf_new_cflags" ; then
9681
9682         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9683         CFLAGS="${CFLAGS}$cf_new_cflags"
9684
9685 fi
9686
9687 if test -n "$cf_new_cppflags" ; then
9688
9689         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9690         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9691
9692 fi
9693
9694 if test -n "$cf_new_extra_cppflags" ; then
9695
9696         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9697         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9698
9699 fi
9700
9701 cf_add_libs="$LIBS"
9702 # reverse order
9703 cf_add_0lib=
9704 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9705 # filter duplicates
9706 for cf_add_1lib in $cf_add_0lib; do
9707         for cf_add_2lib in $cf_add_libs; do
9708                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9709                         cf_add_1lib=
9710                         break
9711                 fi
9712         done
9713         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9714 done
9715 LIBS="$cf_add_libs"
9716
9717                         cat >conftest.$ac_ext <<_ACEOF
9718 #line 9718 "configure"
9719 #include "confdefs.h"
9720 #include <${cf_cv_ncurses_header:-curses.h}>
9721 int
9722 main (void)
9723 {
9724 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9725   ;
9726   return 0;
9727 }
9728 _ACEOF
9729 rm -f conftest.$ac_objext conftest$ac_exeext
9730 if { (eval echo "$as_me:9730: \"$ac_link\"") >&5
9731   (eval $ac_link) 2>&5
9732   ac_status=$?
9733   echo "$as_me:9733: \$? = $ac_status" >&5
9734   (exit $ac_status); } &&
9735          { ac_try='test -s conftest$ac_exeext'
9736   { (eval echo "$as_me:9736: \"$ac_try\"") >&5
9737   (eval $ac_try) 2>&5
9738   ac_status=$?
9739   echo "$as_me:9739: \$? = $ac_status" >&5
9740   (exit $ac_status); }; }; then
9741   if test "$cross_compiling" = yes; then
9742   cf_test_ncuconfig=maybe
9743 else
9744   cat >conftest.$ac_ext <<_ACEOF
9745 #line 9745 "configure"
9746 #include "confdefs.h"
9747 #include <${cf_cv_ncurses_header:-curses.h}>
9748                                         int main(void)
9749                                         { char *xx = curses_version(); return (xx == 0); }
9750 _ACEOF
9751 rm -f conftest$ac_exeext
9752 if { (eval echo "$as_me:9752: \"$ac_link\"") >&5
9753   (eval $ac_link) 2>&5
9754   ac_status=$?
9755   echo "$as_me:9755: \$? = $ac_status" >&5
9756   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9757   { (eval echo "$as_me:9757: \"$ac_try\"") >&5
9758   (eval $ac_try) 2>&5
9759   ac_status=$?
9760   echo "$as_me:9760: \$? = $ac_status" >&5
9761   (exit $ac_status); }; }; then
9762   cf_test_ncuconfig=yes
9763 else
9764   echo "$as_me: program exited with status $ac_status" >&5
9765 echo "$as_me: failed program was:" >&5
9766 cat conftest.$ac_ext >&5
9767 cf_test_ncuconfig=no
9768 fi
9769 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9770 fi
9771 else
9772   echo "$as_me: failed program was:" >&5
9773 cat conftest.$ac_ext >&5
9774 cf_test_ncuconfig=no
9775 fi
9776 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9777
9778                         CFLAGS="$cf_save_CFLAGS"
9779                         CPPFLAGS="$cf_save_CPPFLAGS"
9780                         LIBS="$cf_save_LIBS"
9781
9782                         if test "x$cf_test_ncuconfig" != xyes; then
9783                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9784                                 cf_pkg_cflags="$cf_temp"
9785                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9786                                 cf_pkg_libs="$cf_temp"
9787                         fi
9788                         ;;
9789                 esac
9790
9791 cf_fix_cppflags=no
9792 cf_new_cflags=
9793 cf_new_cppflags=
9794 cf_new_extra_cppflags=
9795
9796 for cf_add_cflags in $cf_pkg_cflags
9797 do
9798 case $cf_fix_cppflags in
9799 (no)
9800         case $cf_add_cflags in
9801         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9802                 case $cf_add_cflags in
9803                 (-D*)
9804                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9805
9806                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9807                                 && test -z "${cf_tst_cflags}" \
9808                                 && cf_fix_cppflags=yes
9809
9810                         if test $cf_fix_cppflags = yes ; then
9811
9812         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9813         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9814
9815                                 continue
9816                         elif test "${cf_tst_cflags}" = "\"'" ; then
9817
9818         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9819         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9820
9821                                 continue
9822                         fi
9823                         ;;
9824                 esac
9825                 case "$CPPFLAGS" in
9826                 (*$cf_add_cflags)
9827                         ;;
9828                 (*)
9829                         case $cf_add_cflags in
9830                         (-D*)
9831                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9832
9833 CPPFLAGS=`echo "$CPPFLAGS" | \
9834         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9835                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9836
9837                                 ;;
9838                         esac
9839
9840         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9841         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9842
9843                         ;;
9844                 esac
9845                 ;;
9846         (*)
9847
9848         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9849         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9850
9851                 ;;
9852         esac
9853         ;;
9854 (yes)
9855
9856         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9857         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9858
9859         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9860
9861         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9862                 && test -z "${cf_tst_cflags}" \
9863                 && cf_fix_cppflags=no
9864         ;;
9865 esac
9866 done
9867
9868 if test -n "$cf_new_cflags" ; then
9869
9870         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9871         CFLAGS="${CFLAGS}$cf_new_cflags"
9872
9873 fi
9874
9875 if test -n "$cf_new_cppflags" ; then
9876
9877         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9878         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9879
9880 fi
9881
9882 if test -n "$cf_new_extra_cppflags" ; then
9883
9884         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9885         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9886
9887 fi
9888
9889 cf_add_libs="$LIBS"
9890 # reverse order
9891 cf_add_0lib=
9892 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9893 # filter duplicates
9894 for cf_add_1lib in $cf_add_0lib; do
9895         for cf_add_2lib in $cf_add_libs; do
9896                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9897                         cf_add_1lib=
9898                         break
9899                 fi
9900         done
9901         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9902 done
9903 LIBS="$cf_add_libs"
9904
9905                 cat >conftest.$ac_ext <<_ACEOF
9906 #line 9906 "configure"
9907 #include "confdefs.h"
9908 #include <${cf_cv_ncurses_header:-curses.h}>
9909 int
9910 main (void)
9911 {
9912 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9913   ;
9914   return 0;
9915 }
9916 _ACEOF
9917 rm -f conftest.$ac_objext conftest$ac_exeext
9918 if { (eval echo "$as_me:9918: \"$ac_link\"") >&5
9919   (eval $ac_link) 2>&5
9920   ac_status=$?
9921   echo "$as_me:9921: \$? = $ac_status" >&5
9922   (exit $ac_status); } &&
9923          { ac_try='test -s conftest$ac_exeext'
9924   { (eval echo "$as_me:9924: \"$ac_try\"") >&5
9925   (eval $ac_try) 2>&5
9926   ac_status=$?
9927   echo "$as_me:9927: \$? = $ac_status" >&5
9928   (exit $ac_status); }; }; then
9929   if test "$cross_compiling" = yes; then
9930   cf_have_ncuconfig=maybe
9931 else
9932   cat >conftest.$ac_ext <<_ACEOF
9933 #line 9933 "configure"
9934 #include "confdefs.h"
9935 #include <${cf_cv_ncurses_header:-curses.h}>
9936                                 int main(void)
9937                                 { char *xx = curses_version(); return (xx == 0); }
9938 _ACEOF
9939 rm -f conftest$ac_exeext
9940 if { (eval echo "$as_me:9940: \"$ac_link\"") >&5
9941   (eval $ac_link) 2>&5
9942   ac_status=$?
9943   echo "$as_me:9943: \$? = $ac_status" >&5
9944   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9945   { (eval echo "$as_me:9945: \"$ac_try\"") >&5
9946   (eval $ac_try) 2>&5
9947   ac_status=$?
9948   echo "$as_me:9948: \$? = $ac_status" >&5
9949   (exit $ac_status); }; }; then
9950   cf_have_ncuconfig=yes
9951 else
9952   echo "$as_me: program exited with status $ac_status" >&5
9953 echo "$as_me: failed program was:" >&5
9954 cat conftest.$ac_ext >&5
9955 cf_have_ncuconfig=no
9956 fi
9957 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9958 fi
9959 else
9960   echo "$as_me: failed program was:" >&5
9961 cat conftest.$ac_ext >&5
9962 cf_have_ncuconfig=no
9963 fi
9964 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9965                 echo "$as_me:9965: result: $cf_have_ncuconfig" >&5
9966 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9967                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9968                 if test "$cf_have_ncuconfig" != "yes"
9969                 then
9970                         CPPFLAGS="$cf_save_CPPFLAGS"
9971                         LIBS="$cf_save_LIBS"
9972                         NCURSES_CONFIG_PKG=none
9973                 else
9974
9975 cat >>confdefs.h <<\EOF
9976 #define NCURSES 1
9977 EOF
9978
9979                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9980
9981 echo "$as_me:9981: checking for terminfo header" >&5
9982 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9983 if test "${cf_cv_term_header+set}" = set; then
9984   echo $ECHO_N "(cached) $ECHO_C" >&6
9985 else
9986
9987 case ${cf_cv_ncurses_header} in
9988 (*/ncurses.h|*/ncursesw.h)
9989         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9990         ;;
9991 (*)
9992         cf_term_header=term.h
9993         ;;
9994 esac
9995
9996 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9997 do
9998 cat >conftest.$ac_ext <<_ACEOF
9999 #line 9999 "configure"
10000 #include "confdefs.h"
10001 #include <stdio.h>
10002 #include <${cf_cv_ncurses_header:-curses.h}>
10003 #include <$cf_test>
10004
10005 int
10006 main (void)
10007 {
10008 int x = auto_left_margin; (void)x
10009   ;
10010   return 0;
10011 }
10012 _ACEOF
10013 rm -f conftest.$ac_objext
10014 if { (eval echo "$as_me:10014: \"$ac_compile\"") >&5
10015   (eval $ac_compile) 2>&5
10016   ac_status=$?
10017   echo "$as_me:10017: \$? = $ac_status" >&5
10018   (exit $ac_status); } &&
10019          { ac_try='test -s conftest.$ac_objext'
10020   { (eval echo "$as_me:10020: \"$ac_try\"") >&5
10021   (eval $ac_try) 2>&5
10022   ac_status=$?
10023   echo "$as_me:10023: \$? = $ac_status" >&5
10024   (exit $ac_status); }; }; then
10025
10026         cf_cv_term_header="$cf_test"
10027 else
10028   echo "$as_me: failed program was:" >&5
10029 cat conftest.$ac_ext >&5
10030
10031         cf_cv_term_header=unknown
10032
10033 fi
10034 rm -f conftest.$ac_objext conftest.$ac_ext
10035         test "$cf_cv_term_header" != unknown && break
10036 done
10037
10038 fi
10039 echo "$as_me:10039: result: $cf_cv_term_header" >&5
10040 echo "${ECHO_T}$cf_cv_term_header" >&6
10041
10042 # Set definitions to allow ifdef'ing to accommodate subdirectories
10043
10044 case $cf_cv_term_header in
10045 (*term.h)
10046
10047 cat >>confdefs.h <<\EOF
10048 #define HAVE_TERM_H 1
10049 EOF
10050
10051         ;;
10052 esac
10053
10054 case $cf_cv_term_header in
10055 (ncurses/term.h)
10056
10057 cat >>confdefs.h <<\EOF
10058 #define HAVE_NCURSES_TERM_H 1
10059 EOF
10060
10061         ;;
10062 (ncursesw/term.h)
10063
10064 cat >>confdefs.h <<\EOF
10065 #define HAVE_NCURSESW_TERM_H 1
10066 EOF
10067
10068         ;;
10069 esac
10070
10071                 fi
10072
10073         else
10074                 echo "$as_me:10074: result: no" >&5
10075 echo "${ECHO_T}no" >&6
10076                 NCURSES_CONFIG_PKG=none
10077         fi
10078 else
10079         NCURSES_CONFIG_PKG=none
10080 fi
10081
10082 if test "x$cf_have_ncuconfig" = "xno"; then
10083         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10084
10085 if test -n "$ac_tool_prefix"; then
10086   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10087   do
10088     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10089 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10090 echo "$as_me:10090: checking for $ac_word" >&5
10091 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10092 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10093   echo $ECHO_N "(cached) $ECHO_C" >&6
10094 else
10095   if test -n "$NCURSES_CONFIG"; then
10096   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10097 else
10098   ac_save_IFS=$IFS; IFS=$ac_path_separator
10099 ac_dummy="$PATH"
10100 for ac_dir in $ac_dummy; do
10101   IFS=$ac_save_IFS
10102   test -z "$ac_dir" && ac_dir=.
10103   $as_executable_p "$ac_dir/$ac_word" || continue
10104 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10105 echo "$as_me:10105: found $ac_dir/$ac_word" >&5
10106 break
10107 done
10108
10109 fi
10110 fi
10111 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10112 if test -n "$NCURSES_CONFIG"; then
10113   echo "$as_me:10113: result: $NCURSES_CONFIG" >&5
10114 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10115 else
10116   echo "$as_me:10116: result: no" >&5
10117 echo "${ECHO_T}no" >&6
10118 fi
10119
10120     test -n "$NCURSES_CONFIG" && break
10121   done
10122 fi
10123 if test -z "$NCURSES_CONFIG"; then
10124   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10125   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10126 do
10127   # Extract the first word of "$ac_prog", so it can be a program name with args.
10128 set dummy $ac_prog; ac_word=$2
10129 echo "$as_me:10129: checking for $ac_word" >&5
10130 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10131 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10132   echo $ECHO_N "(cached) $ECHO_C" >&6
10133 else
10134   if test -n "$ac_ct_NCURSES_CONFIG"; then
10135   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10136 else
10137   ac_save_IFS=$IFS; IFS=$ac_path_separator
10138 ac_dummy="$PATH"
10139 for ac_dir in $ac_dummy; do
10140   IFS=$ac_save_IFS
10141   test -z "$ac_dir" && ac_dir=.
10142   $as_executable_p "$ac_dir/$ac_word" || continue
10143 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10144 echo "$as_me:10144: found $ac_dir/$ac_word" >&5
10145 break
10146 done
10147
10148 fi
10149 fi
10150 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10151 if test -n "$ac_ct_NCURSES_CONFIG"; then
10152   echo "$as_me:10152: result: $ac_ct_NCURSES_CONFIG" >&5
10153 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10154 else
10155   echo "$as_me:10155: result: no" >&5
10156 echo "${ECHO_T}no" >&6
10157 fi
10158
10159   test -n "$ac_ct_NCURSES_CONFIG" && break
10160 done
10161 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10162
10163   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10164 fi
10165
10166         if test "$NCURSES_CONFIG" != none ; then
10167
10168 cf_fix_cppflags=no
10169 cf_new_cflags=
10170 cf_new_cppflags=
10171 cf_new_extra_cppflags=
10172
10173 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10174 do
10175 case $cf_fix_cppflags in
10176 (no)
10177         case $cf_add_cflags in
10178         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10179                 case $cf_add_cflags in
10180                 (-D*)
10181                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10182
10183                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10184                                 && test -z "${cf_tst_cflags}" \
10185                                 && cf_fix_cppflags=yes
10186
10187                         if test $cf_fix_cppflags = yes ; then
10188
10189         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10190         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10191
10192                                 continue
10193                         elif test "${cf_tst_cflags}" = "\"'" ; then
10194
10195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10197
10198                                 continue
10199                         fi
10200                         ;;
10201                 esac
10202                 case "$CPPFLAGS" in
10203                 (*$cf_add_cflags)
10204                         ;;
10205                 (*)
10206                         case $cf_add_cflags in
10207                         (-D*)
10208                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10209
10210 CPPFLAGS=`echo "$CPPFLAGS" | \
10211         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10212                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10213
10214                                 ;;
10215                         esac
10216
10217         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10218         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10219
10220                         ;;
10221                 esac
10222                 ;;
10223         (*)
10224
10225         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10226         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10227
10228                 ;;
10229         esac
10230         ;;
10231 (yes)
10232
10233         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10234         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10235
10236         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10237
10238         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10239                 && test -z "${cf_tst_cflags}" \
10240                 && cf_fix_cppflags=no
10241         ;;
10242 esac
10243 done
10244
10245 if test -n "$cf_new_cflags" ; then
10246
10247         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10248         CFLAGS="${CFLAGS}$cf_new_cflags"
10249
10250 fi
10251
10252 if test -n "$cf_new_cppflags" ; then
10253
10254         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10255         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10256
10257 fi
10258
10259 if test -n "$cf_new_extra_cppflags" ; then
10260
10261         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10262         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10263
10264 fi
10265
10266 cf_add_libs="$LIBS"
10267 # reverse order
10268 cf_add_0lib=
10269 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10270 # filter duplicates
10271 for cf_add_1lib in $cf_add_0lib; do
10272         for cf_add_2lib in $cf_add_libs; do
10273                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10274                         cf_add_1lib=
10275                         break
10276                 fi
10277         done
10278         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10279 done
10280 LIBS="$cf_add_libs"
10281
10282                 # even with config script, some packages use no-override for curses.h
10283
10284 echo "$as_me:10284: checking if we have identified curses headers" >&5
10285 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10286 if test "${cf_cv_ncurses_header+set}" = set; then
10287   echo $ECHO_N "(cached) $ECHO_C" >&6
10288 else
10289
10290 cf_cv_ncurses_header=none
10291 for cf_header in \
10292         ncurses.h $cf_cv_screen/ncurses.h \
10293         curses.h $cf_cv_screen/curses.h
10294 do
10295 cat >conftest.$ac_ext <<_ACEOF
10296 #line 10296 "configure"
10297 #include "confdefs.h"
10298 #include <${cf_header}>
10299 int
10300 main (void)
10301 {
10302 initscr(); tgoto("?", 0,0)
10303   ;
10304   return 0;
10305 }
10306 _ACEOF
10307 rm -f conftest.$ac_objext
10308 if { (eval echo "$as_me:10308: \"$ac_compile\"") >&5
10309   (eval $ac_compile) 2>&5
10310   ac_status=$?
10311   echo "$as_me:10311: \$? = $ac_status" >&5
10312   (exit $ac_status); } &&
10313          { ac_try='test -s conftest.$ac_objext'
10314   { (eval echo "$as_me:10314: \"$ac_try\"") >&5
10315   (eval $ac_try) 2>&5
10316   ac_status=$?
10317   echo "$as_me:10317: \$? = $ac_status" >&5
10318   (exit $ac_status); }; }; then
10319   cf_cv_ncurses_header=$cf_header; break
10320 else
10321   echo "$as_me: failed program was:" >&5
10322 cat conftest.$ac_ext >&5
10323 fi
10324 rm -f conftest.$ac_objext conftest.$ac_ext
10325 done
10326
10327 fi
10328 echo "$as_me:10328: result: $cf_cv_ncurses_header" >&5
10329 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10330
10331 if test "$cf_cv_ncurses_header" = none ; then
10332         { { echo "$as_me:10332: error: No curses header-files found" >&5
10333 echo "$as_me: error: No curses header-files found" >&2;}
10334    { (exit 1); exit 1; }; }
10335 fi
10336
10337 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10338
10339 for ac_header in $cf_cv_ncurses_header
10340 do
10341 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10342 echo "$as_me:10342: checking for $ac_header" >&5
10343 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10344 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10345   echo $ECHO_N "(cached) $ECHO_C" >&6
10346 else
10347   cat >conftest.$ac_ext <<_ACEOF
10348 #line 10348 "configure"
10349 #include "confdefs.h"
10350 #include <$ac_header>
10351 _ACEOF
10352 if { (eval echo "$as_me:10352: \"$ac_cpp conftest.$ac_ext\"") >&5
10353   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10354   ac_status=$?
10355   egrep -v '^ *\+' conftest.er1 >conftest.err
10356   rm -f conftest.er1
10357   cat conftest.err >&5
10358   echo "$as_me:10358: \$? = $ac_status" >&5
10359   (exit $ac_status); } >/dev/null; then
10360   if test -s conftest.err; then
10361     ac_cpp_err=$ac_c_preproc_warn_flag
10362   else
10363     ac_cpp_err=
10364   fi
10365 else
10366   ac_cpp_err=yes
10367 fi
10368 if test -z "$ac_cpp_err"; then
10369   eval "$as_ac_Header=yes"
10370 else
10371   echo "$as_me: failed program was:" >&5
10372   cat conftest.$ac_ext >&5
10373   eval "$as_ac_Header=no"
10374 fi
10375 rm -f conftest.err conftest.$ac_ext
10376 fi
10377 echo "$as_me:10377: result: `eval echo '${'$as_ac_Header'}'`" >&5
10378 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10379 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10380   cat >>confdefs.h <<EOF
10381 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10382 EOF
10383
10384 fi
10385 done
10386
10387 cat >>confdefs.h <<\EOF
10388 #define NCURSES 1
10389 EOF
10390
10391 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10392
10393                 cat >>confdefs.h <<EOF
10394 #define $cf_nculib_ROOT 1
10395 EOF
10396
10397                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
10398
10399         else
10400
10401 cf_ncuhdr_root=$cf_cv_screen
10402
10403 test -n "$cf_cv_curses_dir" && \
10404 test "$cf_cv_curses_dir" != "no" && { \
10405
10406 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10407   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10408   do
10409         while test $cf_add_incdir != /usr/include
10410         do
10411           if test -d $cf_add_incdir
10412           then
10413                 cf_have_incdir=no
10414                 if test -n "$CFLAGS$CPPFLAGS" ; then
10415                   # a loop is needed to ensure we can add subdirs of existing dirs
10416                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10417                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10418                           cf_have_incdir=yes; break
10419                         fi
10420                   done
10421                 fi
10422
10423                 if test "$cf_have_incdir" = no ; then
10424                   if test "$cf_add_incdir" = /usr/local/include ; then
10425                         if test "$GCC" = yes
10426                         then
10427                           cf_save_CPPFLAGS=$CPPFLAGS
10428
10429         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10430         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10431
10432                           cat >conftest.$ac_ext <<_ACEOF
10433 #line 10433 "configure"
10434 #include "confdefs.h"
10435 #include <stdio.h>
10436 int
10437 main (void)
10438 {
10439 printf("Hello")
10440   ;
10441   return 0;
10442 }
10443 _ACEOF
10444 rm -f conftest.$ac_objext
10445 if { (eval echo "$as_me:10445: \"$ac_compile\"") >&5
10446   (eval $ac_compile) 2>&5
10447   ac_status=$?
10448   echo "$as_me:10448: \$? = $ac_status" >&5
10449   (exit $ac_status); } &&
10450          { ac_try='test -s conftest.$ac_objext'
10451   { (eval echo "$as_me:10451: \"$ac_try\"") >&5
10452   (eval $ac_try) 2>&5
10453   ac_status=$?
10454   echo "$as_me:10454: \$? = $ac_status" >&5
10455   (exit $ac_status); }; }; then
10456   :
10457 else
10458   echo "$as_me: failed program was:" >&5
10459 cat conftest.$ac_ext >&5
10460 cf_have_incdir=yes
10461 fi
10462 rm -f conftest.$ac_objext conftest.$ac_ext
10463                           CPPFLAGS=$cf_save_CPPFLAGS
10464                         fi
10465                   fi
10466                 fi
10467
10468                 if test "$cf_have_incdir" = no ; then
10469                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10470
10471 echo "${as_me:-configure}:10471: testing adding $cf_add_incdir to include-path ..." 1>&5
10472
10473                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10474
10475                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10476                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10477                   cf_add_incdir="$cf_top_incdir"
10478                 else
10479                   break
10480                 fi
10481           else
10482                 break
10483           fi
10484         done
10485   done
10486 fi
10487
10488 }
10489
10490 echo "$as_me:10490: checking for $cf_ncuhdr_root header in include-path" >&5
10491 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10492 if test "${cf_cv_ncurses_h+set}" = set; then
10493   echo $ECHO_N "(cached) $ECHO_C" >&6
10494 else
10495
10496         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10497         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
10498         for cf_header in $cf_header_list
10499         do
10500
10501         cat >conftest.$ac_ext <<_ACEOF
10502 #line 10502 "configure"
10503 #include "confdefs.h"
10504
10505 #include <$cf_header>
10506 int
10507 main (void)
10508 {
10509
10510 #ifdef NCURSES_VERSION
10511
10512 printf("%s\n", NCURSES_VERSION);
10513 #else
10514 #ifdef __NCURSES_H
10515 printf("old\n");
10516 #else
10517         make an error
10518 #endif
10519 #endif
10520
10521   ;
10522   return 0;
10523 }
10524 _ACEOF
10525 rm -f conftest.$ac_objext
10526 if { (eval echo "$as_me:10526: \"$ac_compile\"") >&5
10527   (eval $ac_compile) 2>&5
10528   ac_status=$?
10529   echo "$as_me:10529: \$? = $ac_status" >&5
10530   (exit $ac_status); } &&
10531          { ac_try='test -s conftest.$ac_objext'
10532   { (eval echo "$as_me:10532: \"$ac_try\"") >&5
10533   (eval $ac_try) 2>&5
10534   ac_status=$?
10535   echo "$as_me:10535: \$? = $ac_status" >&5
10536   (exit $ac_status); }; }; then
10537   cf_cv_ncurses_h=$cf_header
10538
10539 else
10540   echo "$as_me: failed program was:" >&5
10541 cat conftest.$ac_ext >&5
10542 cf_cv_ncurses_h=no
10543 fi
10544 rm -f conftest.$ac_objext conftest.$ac_ext
10545
10546                 test "$cf_cv_ncurses_h" != no && break
10547         done
10548
10549 fi
10550 echo "$as_me:10550: result: $cf_cv_ncurses_h" >&5
10551 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10552
10553 if test "$cf_cv_ncurses_h" != no ; then
10554         cf_cv_ncurses_header=$cf_cv_ncurses_h
10555 else
10556
10557 echo "$as_me:10557: checking for $cf_ncuhdr_root include-path" >&5
10558 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10559 if test "${cf_cv_ncurses_h2+set}" = set; then
10560   echo $ECHO_N "(cached) $ECHO_C" >&6
10561 else
10562
10563         test -n "$verbose" && echo
10564
10565 cf_search=
10566
10567 # collect the current set of include-directories from compiler flags
10568 cf_header_path_list=""
10569 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10570         for cf_header_path in $CPPFLAGS $CFLAGS
10571         do
10572                 case $cf_header_path in
10573                 (-I*)
10574                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10575
10576 test "x$cf_header_path" != "xNONE" && \
10577 test -d "$cf_header_path" && \
10578  {
10579         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10580         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10581         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10582         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10583         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10584         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"
10585 }
10586
10587                         cf_header_path_list="$cf_header_path_list $cf_search"
10588                         ;;
10589                 esac
10590         done
10591 fi
10592
10593 # add the variations for the package we are looking for
10594
10595 cf_search=
10596
10597 test "x$prefix" != "xNONE" && \
10598 test -d "$prefix" && \
10599  {
10600         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10601         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10602         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10603         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10604         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10605         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10606 }
10607
10608 for cf_subdir_prefix in \
10609         /usr \
10610         /usr/local \
10611         /usr/pkg \
10612         /opt \
10613         /opt/local \
10614         $HOME
10615 do
10616
10617 test "x$cf_subdir_prefix" != "x$prefix" && \
10618 test -d "$cf_subdir_prefix" && \
10619 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10620         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10621         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10622         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10623         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10624         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10625         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"
10626 }
10627
10628 done
10629
10630 test "$includedir" != NONE && \
10631 test "$includedir" != "/usr/include" && \
10632 test -d "$includedir" && {
10633         test -d $includedir &&    cf_search="$cf_search $includedir"
10634         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10635 }
10636
10637 test "$oldincludedir" != NONE && \
10638 test "$oldincludedir" != "/usr/include" && \
10639 test -d "$oldincludedir" && {
10640         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10641         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10642 }
10643
10644 cf_search="$cf_search $cf_header_path_list"
10645
10646         test -n "$verbose" && echo search path $cf_search
10647         cf_save2_CPPFLAGS="$CPPFLAGS"
10648         for cf_incdir in $cf_search
10649         do
10650
10651 if test -n "$cf_incdir" ; then
10652   for cf_add_incdir in $cf_incdir
10653   do
10654         while test $cf_add_incdir != /usr/include
10655         do
10656           if test -d $cf_add_incdir
10657           then
10658                 cf_have_incdir=no
10659                 if test -n "$CFLAGS$CPPFLAGS" ; then
10660                   # a loop is needed to ensure we can add subdirs of existing dirs
10661                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10662                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10663                           cf_have_incdir=yes; break
10664                         fi
10665                   done
10666                 fi
10667
10668                 if test "$cf_have_incdir" = no ; then
10669                   if test "$cf_add_incdir" = /usr/local/include ; then
10670                         if test "$GCC" = yes
10671                         then
10672                           cf_save_CPPFLAGS=$CPPFLAGS
10673
10674         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10675         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10676
10677                           cat >conftest.$ac_ext <<_ACEOF
10678 #line 10678 "configure"
10679 #include "confdefs.h"
10680 #include <stdio.h>
10681 int
10682 main (void)
10683 {
10684 printf("Hello")
10685   ;
10686   return 0;
10687 }
10688 _ACEOF
10689 rm -f conftest.$ac_objext
10690 if { (eval echo "$as_me:10690: \"$ac_compile\"") >&5
10691   (eval $ac_compile) 2>&5
10692   ac_status=$?
10693   echo "$as_me:10693: \$? = $ac_status" >&5
10694   (exit $ac_status); } &&
10695          { ac_try='test -s conftest.$ac_objext'
10696   { (eval echo "$as_me:10696: \"$ac_try\"") >&5
10697   (eval $ac_try) 2>&5
10698   ac_status=$?
10699   echo "$as_me:10699: \$? = $ac_status" >&5
10700   (exit $ac_status); }; }; then
10701   :
10702 else
10703   echo "$as_me: failed program was:" >&5
10704 cat conftest.$ac_ext >&5
10705 cf_have_incdir=yes
10706 fi
10707 rm -f conftest.$ac_objext conftest.$ac_ext
10708                           CPPFLAGS=$cf_save_CPPFLAGS
10709                         fi
10710                   fi
10711                 fi
10712
10713                 if test "$cf_have_incdir" = no ; then
10714                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10715
10716 echo "${as_me:-configure}:10716: testing adding $cf_add_incdir to include-path ..." 1>&5
10717
10718                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10719
10720                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10721                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10722                   cf_add_incdir="$cf_top_incdir"
10723                 else
10724                   break
10725                 fi
10726           else
10727                 break
10728           fi
10729         done
10730   done
10731 fi
10732
10733                 for cf_header in \
10734                         ncurses.h \
10735                         curses.h
10736                 do
10737
10738         cat >conftest.$ac_ext <<_ACEOF
10739 #line 10739 "configure"
10740 #include "confdefs.h"
10741
10742 #include <$cf_header>
10743 int
10744 main (void)
10745 {
10746
10747 #ifdef NCURSES_VERSION
10748
10749 printf("%s\n", NCURSES_VERSION);
10750 #else
10751 #ifdef __NCURSES_H
10752 printf("old\n");
10753 #else
10754         make an error
10755 #endif
10756 #endif
10757
10758   ;
10759   return 0;
10760 }
10761 _ACEOF
10762 rm -f conftest.$ac_objext
10763 if { (eval echo "$as_me:10763: \"$ac_compile\"") >&5
10764   (eval $ac_compile) 2>&5
10765   ac_status=$?
10766   echo "$as_me:10766: \$? = $ac_status" >&5
10767   (exit $ac_status); } &&
10768          { ac_try='test -s conftest.$ac_objext'
10769   { (eval echo "$as_me:10769: \"$ac_try\"") >&5
10770   (eval $ac_try) 2>&5
10771   ac_status=$?
10772   echo "$as_me:10772: \$? = $ac_status" >&5
10773   (exit $ac_status); }; }; then
10774   cf_cv_ncurses_h2=$cf_header
10775
10776 else
10777   echo "$as_me: failed program was:" >&5
10778 cat conftest.$ac_ext >&5
10779 cf_cv_ncurses_h2=no
10780 fi
10781 rm -f conftest.$ac_objext conftest.$ac_ext
10782
10783                         if test "$cf_cv_ncurses_h2" != no ; then
10784                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10785                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10786                                 break
10787                         fi
10788                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10789                 done
10790                 CPPFLAGS="$cf_save2_CPPFLAGS"
10791                 test "$cf_cv_ncurses_h2" != no && break
10792         done
10793         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10793: error: not found" >&5
10794 echo "$as_me: error: not found" >&2;}
10795    { (exit 1); exit 1; }; }
10796
10797 fi
10798 echo "$as_me:10798: result: $cf_cv_ncurses_h2" >&5
10799 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10800
10801         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10802         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10803         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10804                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10805         fi
10806
10807 if test -n "$cf_1st_incdir" ; then
10808   for cf_add_incdir in $cf_1st_incdir
10809   do
10810         while test $cf_add_incdir != /usr/include
10811         do
10812           if test -d $cf_add_incdir
10813           then
10814                 cf_have_incdir=no
10815                 if test -n "$CFLAGS$CPPFLAGS" ; then
10816                   # a loop is needed to ensure we can add subdirs of existing dirs
10817                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10818                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10819                           cf_have_incdir=yes; break
10820                         fi
10821                   done
10822                 fi
10823
10824                 if test "$cf_have_incdir" = no ; then
10825                   if test "$cf_add_incdir" = /usr/local/include ; then
10826                         if test "$GCC" = yes
10827                         then
10828                           cf_save_CPPFLAGS=$CPPFLAGS
10829
10830         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10831         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10832
10833                           cat >conftest.$ac_ext <<_ACEOF
10834 #line 10834 "configure"
10835 #include "confdefs.h"
10836 #include <stdio.h>
10837 int
10838 main (void)
10839 {
10840 printf("Hello")
10841   ;
10842   return 0;
10843 }
10844 _ACEOF
10845 rm -f conftest.$ac_objext
10846 if { (eval echo "$as_me:10846: \"$ac_compile\"") >&5
10847   (eval $ac_compile) 2>&5
10848   ac_status=$?
10849   echo "$as_me:10849: \$? = $ac_status" >&5
10850   (exit $ac_status); } &&
10851          { ac_try='test -s conftest.$ac_objext'
10852   { (eval echo "$as_me:10852: \"$ac_try\"") >&5
10853   (eval $ac_try) 2>&5
10854   ac_status=$?
10855   echo "$as_me:10855: \$? = $ac_status" >&5
10856   (exit $ac_status); }; }; then
10857   :
10858 else
10859   echo "$as_me: failed program was:" >&5
10860 cat conftest.$ac_ext >&5
10861 cf_have_incdir=yes
10862 fi
10863 rm -f conftest.$ac_objext conftest.$ac_ext
10864                           CPPFLAGS=$cf_save_CPPFLAGS
10865                         fi
10866                   fi
10867                 fi
10868
10869                 if test "$cf_have_incdir" = no ; then
10870                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10871
10872 echo "${as_me:-configure}:10872: testing adding $cf_add_incdir to include-path ..." 1>&5
10873
10874                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10875
10876                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10877                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10878                   cf_add_incdir="$cf_top_incdir"
10879                 else
10880                   break
10881                 fi
10882           else
10883                 break
10884           fi
10885         done
10886   done
10887 fi
10888
10889 fi
10890
10891 # Set definitions to allow ifdef'ing for ncurses.h
10892
10893 case $cf_cv_ncurses_header in
10894 (*ncurses.h)
10895
10896 cat >>confdefs.h <<\EOF
10897 #define HAVE_NCURSES_H 1
10898 EOF
10899
10900         ;;
10901 esac
10902
10903 case $cf_cv_ncurses_header in
10904 (ncurses/curses.h|ncurses/ncurses.h)
10905
10906 cat >>confdefs.h <<\EOF
10907 #define HAVE_NCURSES_NCURSES_H 1
10908 EOF
10909
10910         ;;
10911 (ncursesw/curses.h|ncursesw/ncurses.h)
10912
10913 cat >>confdefs.h <<\EOF
10914 #define HAVE_NCURSESW_NCURSES_H 1
10915 EOF
10916
10917         ;;
10918 esac
10919
10920 echo "$as_me:10920: checking for terminfo header" >&5
10921 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10922 if test "${cf_cv_term_header+set}" = set; then
10923   echo $ECHO_N "(cached) $ECHO_C" >&6
10924 else
10925
10926 case ${cf_cv_ncurses_header} in
10927 (*/ncurses.h|*/ncursesw.h)
10928         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10929         ;;
10930 (*)
10931         cf_term_header=term.h
10932         ;;
10933 esac
10934
10935 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10936 do
10937 cat >conftest.$ac_ext <<_ACEOF
10938 #line 10938 "configure"
10939 #include "confdefs.h"
10940 #include <stdio.h>
10941 #include <${cf_cv_ncurses_header:-curses.h}>
10942 #include <$cf_test>
10943
10944 int
10945 main (void)
10946 {
10947 int x = auto_left_margin; (void)x
10948   ;
10949   return 0;
10950 }
10951 _ACEOF
10952 rm -f conftest.$ac_objext
10953 if { (eval echo "$as_me:10953: \"$ac_compile\"") >&5
10954   (eval $ac_compile) 2>&5
10955   ac_status=$?
10956   echo "$as_me:10956: \$? = $ac_status" >&5
10957   (exit $ac_status); } &&
10958          { ac_try='test -s conftest.$ac_objext'
10959   { (eval echo "$as_me:10959: \"$ac_try\"") >&5
10960   (eval $ac_try) 2>&5
10961   ac_status=$?
10962   echo "$as_me:10962: \$? = $ac_status" >&5
10963   (exit $ac_status); }; }; then
10964
10965         cf_cv_term_header="$cf_test"
10966 else
10967   echo "$as_me: failed program was:" >&5
10968 cat conftest.$ac_ext >&5
10969
10970         cf_cv_term_header=unknown
10971
10972 fi
10973 rm -f conftest.$ac_objext conftest.$ac_ext
10974         test "$cf_cv_term_header" != unknown && break
10975 done
10976
10977 fi
10978 echo "$as_me:10978: result: $cf_cv_term_header" >&5
10979 echo "${ECHO_T}$cf_cv_term_header" >&6
10980
10981 # Set definitions to allow ifdef'ing to accommodate subdirectories
10982
10983 case $cf_cv_term_header in
10984 (*term.h)
10985
10986 cat >>confdefs.h <<\EOF
10987 #define HAVE_TERM_H 1
10988 EOF
10989
10990         ;;
10991 esac
10992
10993 case $cf_cv_term_header in
10994 (ncurses/term.h)
10995
10996 cat >>confdefs.h <<\EOF
10997 #define HAVE_NCURSES_TERM_H 1
10998 EOF
10999
11000         ;;
11001 (ncursesw/term.h)
11002
11003 cat >>confdefs.h <<\EOF
11004 #define HAVE_NCURSESW_TERM_H 1
11005 EOF
11006
11007         ;;
11008 esac
11009
11010 # some applications need this, but should check for NCURSES_VERSION
11011
11012 cat >>confdefs.h <<\EOF
11013 #define NCURSES 1
11014 EOF
11015
11016 echo "$as_me:11016: checking for ncurses version" >&5
11017 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11018 if test "${cf_cv_ncurses_version+set}" = set; then
11019   echo $ECHO_N "(cached) $ECHO_C" >&6
11020 else
11021
11022         cf_cv_ncurses_version=no
11023         cf_tempfile=out$$
11024         rm -f $cf_tempfile
11025         if test "$cross_compiling" = yes; then
11026
11027         # This will not work if the preprocessor splits the line after the
11028         # Autoconf token.  The 'unproto' program does that.
11029         cat > conftest.$ac_ext <<EOF
11030 #include <${cf_cv_ncurses_header:-curses.h}>
11031 #undef Autoconf
11032 #ifdef NCURSES_VERSION
11033 Autoconf NCURSES_VERSION
11034 #else
11035 #ifdef __NCURSES_H
11036 Autoconf "old"
11037 #endif
11038 ;
11039 #endif
11040 EOF
11041         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11042         { (eval echo "$as_me:11042: \"$cf_try\"") >&5
11043   (eval $cf_try) 2>&5
11044   ac_status=$?
11045   echo "$as_me:11045: \$? = $ac_status" >&5
11046   (exit $ac_status); }
11047         if test -f conftest.out ; then
11048                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
11049                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11050                 rm -f conftest.out
11051         fi
11052
11053 else
11054   cat >conftest.$ac_ext <<_ACEOF
11055 #line 11055 "configure"
11056 #include "confdefs.h"
11057
11058 #include <${cf_cv_ncurses_header:-curses.h}>
11059 #include <stdio.h>
11060 int main(void)
11061 {
11062         FILE *fp = fopen("$cf_tempfile", "w");
11063 #ifdef NCURSES_VERSION
11064 # ifdef NCURSES_VERSION_PATCH
11065         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11066 # else
11067         fprintf(fp, "%s\n", NCURSES_VERSION);
11068 # endif
11069 #else
11070 # ifdef __NCURSES_H
11071         fprintf(fp, "old\n");
11072 # else
11073         make an error
11074 # endif
11075 #endif
11076         ${cf_cv_main_return:-return}(0);
11077 }
11078 _ACEOF
11079 rm -f conftest$ac_exeext
11080 if { (eval echo "$as_me:11080: \"$ac_link\"") >&5
11081   (eval $ac_link) 2>&5
11082   ac_status=$?
11083   echo "$as_me:11083: \$? = $ac_status" >&5
11084   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11085   { (eval echo "$as_me:11085: \"$ac_try\"") >&5
11086   (eval $ac_try) 2>&5
11087   ac_status=$?
11088   echo "$as_me:11088: \$? = $ac_status" >&5
11089   (exit $ac_status); }; }; then
11090
11091         cf_cv_ncurses_version=`cat $cf_tempfile`
11092 else
11093   echo "$as_me: program exited with status $ac_status" >&5
11094 echo "$as_me: failed program was:" >&5
11095 cat conftest.$ac_ext >&5
11096 fi
11097 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11098 fi
11099         rm -f $cf_tempfile
11100
11101 fi
11102 echo "$as_me:11102: result: $cf_cv_ncurses_version" >&5
11103 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11104 test "$cf_cv_ncurses_version" = no ||
11105 cat >>confdefs.h <<\EOF
11106 #define NCURSES 1
11107 EOF
11108
11109 cf_nculib_root=$cf_cv_screen
11110         # This works, except for the special case where we find gpm, but
11111         # ncurses is in a nonstandard location via $LIBS, and we really want
11112         # to link gpm.
11113 cf_ncurses_LIBS=""
11114 cf_ncurses_SAVE="$LIBS"
11115 echo "$as_me:11115: checking for Gpm_Open in -lgpm" >&5
11116 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11117 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11118   echo $ECHO_N "(cached) $ECHO_C" >&6
11119 else
11120   ac_check_lib_save_LIBS=$LIBS
11121 LIBS="-lgpm  $LIBS"
11122 cat >conftest.$ac_ext <<_ACEOF
11123 #line 11123 "configure"
11124 #include "confdefs.h"
11125
11126 /* Override any gcc2 internal prototype to avoid an error.  */
11127 #ifdef __cplusplus
11128 extern "C"
11129 #endif
11130 /* We use char because int might match the return type of a gcc2
11131    builtin and then its argument prototype would still apply.  */
11132 char Gpm_Open ();
11133 int
11134 main (void)
11135 {
11136 Gpm_Open ();
11137   ;
11138   return 0;
11139 }
11140 _ACEOF
11141 rm -f conftest.$ac_objext conftest$ac_exeext
11142 if { (eval echo "$as_me:11142: \"$ac_link\"") >&5
11143   (eval $ac_link) 2>&5
11144   ac_status=$?
11145   echo "$as_me:11145: \$? = $ac_status" >&5
11146   (exit $ac_status); } &&
11147          { ac_try='test -s conftest$ac_exeext'
11148   { (eval echo "$as_me:11148: \"$ac_try\"") >&5
11149   (eval $ac_try) 2>&5
11150   ac_status=$?
11151   echo "$as_me:11151: \$? = $ac_status" >&5
11152   (exit $ac_status); }; }; then
11153   ac_cv_lib_gpm_Gpm_Open=yes
11154 else
11155   echo "$as_me: failed program was:" >&5
11156 cat conftest.$ac_ext >&5
11157 ac_cv_lib_gpm_Gpm_Open=no
11158 fi
11159 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11160 LIBS=$ac_check_lib_save_LIBS
11161 fi
11162 echo "$as_me:11162: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11163 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11164 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
11165   echo "$as_me:11165: checking for initscr in -lgpm" >&5
11166 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11167 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11168   echo $ECHO_N "(cached) $ECHO_C" >&6
11169 else
11170   ac_check_lib_save_LIBS=$LIBS
11171 LIBS="-lgpm  $LIBS"
11172 cat >conftest.$ac_ext <<_ACEOF
11173 #line 11173 "configure"
11174 #include "confdefs.h"
11175
11176 /* Override any gcc2 internal prototype to avoid an error.  */
11177 #ifdef __cplusplus
11178 extern "C"
11179 #endif
11180 /* We use char because int might match the return type of a gcc2
11181    builtin and then its argument prototype would still apply.  */
11182 char initscr ();
11183 int
11184 main (void)
11185 {
11186 initscr ();
11187   ;
11188   return 0;
11189 }
11190 _ACEOF
11191 rm -f conftest.$ac_objext conftest$ac_exeext
11192 if { (eval echo "$as_me:11192: \"$ac_link\"") >&5
11193   (eval $ac_link) 2>&5
11194   ac_status=$?
11195   echo "$as_me:11195: \$? = $ac_status" >&5
11196   (exit $ac_status); } &&
11197          { ac_try='test -s conftest$ac_exeext'
11198   { (eval echo "$as_me:11198: \"$ac_try\"") >&5
11199   (eval $ac_try) 2>&5
11200   ac_status=$?
11201   echo "$as_me:11201: \$? = $ac_status" >&5
11202   (exit $ac_status); }; }; then
11203   ac_cv_lib_gpm_initscr=yes
11204 else
11205   echo "$as_me: failed program was:" >&5
11206 cat conftest.$ac_ext >&5
11207 ac_cv_lib_gpm_initscr=no
11208 fi
11209 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11210 LIBS=$ac_check_lib_save_LIBS
11211 fi
11212 echo "$as_me:11212: result: $ac_cv_lib_gpm_initscr" >&5
11213 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11214 if test $ac_cv_lib_gpm_initscr = yes; then
11215   LIBS="$cf_ncurses_SAVE"
11216 else
11217   cf_ncurses_LIBS="-lgpm"
11218 fi
11219
11220 fi
11221
11222 case $host_os in
11223 (freebsd*)
11224         # This is only necessary if you are linking against an obsolete
11225         # version of ncurses (but it should do no harm, since it's static).
11226         if test "$cf_nculib_root" = ncurses ; then
11227                 echo "$as_me:11227: checking for tgoto in -lmytinfo" >&5
11228 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11229 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11230   echo $ECHO_N "(cached) $ECHO_C" >&6
11231 else
11232   ac_check_lib_save_LIBS=$LIBS
11233 LIBS="-lmytinfo  $LIBS"
11234 cat >conftest.$ac_ext <<_ACEOF
11235 #line 11235 "configure"
11236 #include "confdefs.h"
11237
11238 /* Override any gcc2 internal prototype to avoid an error.  */
11239 #ifdef __cplusplus
11240 extern "C"
11241 #endif
11242 /* We use char because int might match the return type of a gcc2
11243    builtin and then its argument prototype would still apply.  */
11244 char tgoto ();
11245 int
11246 main (void)
11247 {
11248 tgoto ();
11249   ;
11250   return 0;
11251 }
11252 _ACEOF
11253 rm -f conftest.$ac_objext conftest$ac_exeext
11254 if { (eval echo "$as_me:11254: \"$ac_link\"") >&5
11255   (eval $ac_link) 2>&5
11256   ac_status=$?
11257   echo "$as_me:11257: \$? = $ac_status" >&5
11258   (exit $ac_status); } &&
11259          { ac_try='test -s conftest$ac_exeext'
11260   { (eval echo "$as_me:11260: \"$ac_try\"") >&5
11261   (eval $ac_try) 2>&5
11262   ac_status=$?
11263   echo "$as_me:11263: \$? = $ac_status" >&5
11264   (exit $ac_status); }; }; then
11265   ac_cv_lib_mytinfo_tgoto=yes
11266 else
11267   echo "$as_me: failed program was:" >&5
11268 cat conftest.$ac_ext >&5
11269 ac_cv_lib_mytinfo_tgoto=no
11270 fi
11271 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11272 LIBS=$ac_check_lib_save_LIBS
11273 fi
11274 echo "$as_me:11274: result: $ac_cv_lib_mytinfo_tgoto" >&5
11275 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11276 if test $ac_cv_lib_mytinfo_tgoto = yes; then
11277   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11278 fi
11279
11280         fi
11281         ;;
11282 esac
11283
11284 cf_add_libs="$LIBS"
11285 # reverse order
11286 cf_add_0lib=
11287 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11288 # filter duplicates
11289 for cf_add_1lib in $cf_add_0lib; do
11290         for cf_add_2lib in $cf_add_libs; do
11291                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11292                         cf_add_1lib=
11293                         break
11294                 fi
11295         done
11296         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11297 done
11298 LIBS="$cf_add_libs"
11299
11300 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
11301 then
11302
11303 cf_add_libs="$LIBS"
11304 # reverse order
11305 cf_add_0lib=
11306 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11307 # filter duplicates
11308 for cf_add_1lib in $cf_add_0lib; do
11309         for cf_add_2lib in $cf_add_libs; do
11310                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11311                         cf_add_1lib=
11312                         break
11313                 fi
11314         done
11315         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11316 done
11317 LIBS="$cf_add_libs"
11318
11319 else
11320
11321         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
11322         cf_libdir=""
11323         echo "$as_me:11323: checking for initscr" >&5
11324 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11325 if test "${ac_cv_func_initscr+set}" = set; then
11326   echo $ECHO_N "(cached) $ECHO_C" >&6
11327 else
11328   cat >conftest.$ac_ext <<_ACEOF
11329 #line 11329 "configure"
11330 #include "confdefs.h"
11331 #define initscr autoconf_temporary
11332 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11333 #undef initscr
11334
11335 #ifdef __cplusplus
11336 extern "C"
11337 #endif
11338
11339 /* We use char because int might match the return type of a gcc2
11340    builtin and then its argument prototype would still apply.  */
11341 char initscr (void);
11342
11343 int
11344 main (void)
11345 {
11346
11347 /* The GNU C library defines stubs for functions which it implements
11348     to always fail with ENOSYS.  Some functions are actually named
11349     something starting with __ and the normal name is an alias.  */
11350 #if defined (__stub_initscr) || defined (__stub___initscr)
11351 #error found stub for initscr
11352 #endif
11353
11354         return initscr ();
11355   ;
11356   return 0;
11357 }
11358 _ACEOF
11359 rm -f conftest.$ac_objext conftest$ac_exeext
11360 if { (eval echo "$as_me:11360: \"$ac_link\"") >&5
11361   (eval $ac_link) 2>&5
11362   ac_status=$?
11363   echo "$as_me:11363: \$? = $ac_status" >&5
11364   (exit $ac_status); } &&
11365          { ac_try='test -s conftest$ac_exeext'
11366   { (eval echo "$as_me:11366: \"$ac_try\"") >&5
11367   (eval $ac_try) 2>&5
11368   ac_status=$?
11369   echo "$as_me:11369: \$? = $ac_status" >&5
11370   (exit $ac_status); }; }; then
11371   ac_cv_func_initscr=yes
11372 else
11373   echo "$as_me: failed program was:" >&5
11374 cat conftest.$ac_ext >&5
11375 ac_cv_func_initscr=no
11376 fi
11377 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11378 fi
11379 echo "$as_me:11379: result: $ac_cv_func_initscr" >&5
11380 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11381 if test $ac_cv_func_initscr = yes; then
11382   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11383 else
11384
11385                 cf_save_LIBS="$LIBS"
11386                 echo "$as_me:11386: checking for initscr in -l$cf_nculib_root" >&5
11387 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11388                 LIBS="-l$cf_nculib_root $LIBS"
11389                 cat >conftest.$ac_ext <<_ACEOF
11390 #line 11390 "configure"
11391 #include "confdefs.h"
11392 #include <${cf_cv_ncurses_header:-curses.h}>
11393 int
11394 main (void)
11395 {
11396 initscr()
11397   ;
11398   return 0;
11399 }
11400 _ACEOF
11401 rm -f conftest.$ac_objext conftest$ac_exeext
11402 if { (eval echo "$as_me:11402: \"$ac_link\"") >&5
11403   (eval $ac_link) 2>&5
11404   ac_status=$?
11405   echo "$as_me:11405: \$? = $ac_status" >&5
11406   (exit $ac_status); } &&
11407          { ac_try='test -s conftest$ac_exeext'
11408   { (eval echo "$as_me:11408: \"$ac_try\"") >&5
11409   (eval $ac_try) 2>&5
11410   ac_status=$?
11411   echo "$as_me:11411: \$? = $ac_status" >&5
11412   (exit $ac_status); }; }; then
11413   echo "$as_me:11413: result: yes" >&5
11414 echo "${ECHO_T}yes" >&6
11415                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11416
11417 else
11418   echo "$as_me: failed program was:" >&5
11419 cat conftest.$ac_ext >&5
11420 echo "$as_me:11420: result: no" >&5
11421 echo "${ECHO_T}no" >&6
11422
11423 cf_search=
11424 cf_library_path_list=""
11425 if test -n "${LDFLAGS}${LIBS}" ; then
11426         for cf_library_path in $LDFLAGS $LIBS
11427         do
11428                 case $cf_library_path in
11429                 (-L*)
11430                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11431
11432 test "x$cf_library_path" != "xNONE" && \
11433 test -d "$cf_library_path" && \
11434  {
11435         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11436         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
11437         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11438         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11439         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11440         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"
11441 }
11442
11443                         cf_library_path_list="$cf_library_path_list $cf_search"
11444                         ;;
11445                 esac
11446         done
11447 fi
11448
11449 cf_search=
11450
11451 test "x$prefix" != "xNONE" && \
11452 test -d "$prefix" && \
11453  {
11454         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11455         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
11456         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11457         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11458         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11459         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11460 }
11461
11462 for cf_subdir_prefix in \
11463         /usr \
11464         /usr/local \
11465         /usr/pkg \
11466         /opt \
11467         /opt/local \
11468         $HOME
11469 do
11470
11471 test "x$cf_subdir_prefix" != "x$prefix" && \
11472 test -d "$cf_subdir_prefix" && \
11473 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
11474         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11475         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11476         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11477         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11478         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11479         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"
11480 }
11481
11482 done
11483
11484 cf_search="$cf_library_path_list $cf_search"
11485
11486                         for cf_libdir in $cf_search
11487                         do
11488                                 echo "$as_me:11488: checking for -l$cf_nculib_root in $cf_libdir" >&5
11489 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11490                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11491                                 cat >conftest.$ac_ext <<_ACEOF
11492 #line 11492 "configure"
11493 #include "confdefs.h"
11494 #include <${cf_cv_ncurses_header:-curses.h}>
11495 int
11496 main (void)
11497 {
11498 initscr()
11499   ;
11500   return 0;
11501 }
11502 _ACEOF
11503 rm -f conftest.$ac_objext conftest$ac_exeext
11504 if { (eval echo "$as_me:11504: \"$ac_link\"") >&5
11505   (eval $ac_link) 2>&5
11506   ac_status=$?
11507   echo "$as_me:11507: \$? = $ac_status" >&5
11508   (exit $ac_status); } &&
11509          { ac_try='test -s conftest$ac_exeext'
11510   { (eval echo "$as_me:11510: \"$ac_try\"") >&5
11511   (eval $ac_try) 2>&5
11512   ac_status=$?
11513   echo "$as_me:11513: \$? = $ac_status" >&5
11514   (exit $ac_status); }; }; then
11515   echo "$as_me:11515: result: yes" >&5
11516 echo "${ECHO_T}yes" >&6
11517                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11518                                          break
11519 else
11520   echo "$as_me: failed program was:" >&5
11521 cat conftest.$ac_ext >&5
11522 echo "$as_me:11522: result: no" >&5
11523 echo "${ECHO_T}no" >&6
11524                                          LIBS="$cf_save_LIBS"
11525 fi
11526 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11527                         done
11528
11529 fi
11530 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11531
11532 fi
11533
11534 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11535
11536 if test $cf_found_library = no ; then
11537         { { echo "$as_me:11537: error: Cannot link $cf_nculib_root library" >&5
11538 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11539    { (exit 1); exit 1; }; }
11540 fi
11541
11542 fi
11543
11544 if test -n "$cf_ncurses_LIBS" ; then
11545         echo "$as_me:11545: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11546 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11547         cf_ncurses_SAVE="$LIBS"
11548         for p in $cf_ncurses_LIBS ; do
11549                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11550                 if test "$q" != "$LIBS" ; then
11551                         LIBS="$q"
11552                 fi
11553         done
11554         cat >conftest.$ac_ext <<_ACEOF
11555 #line 11555 "configure"
11556 #include "confdefs.h"
11557 #include <${cf_cv_ncurses_header:-curses.h}>
11558 int
11559 main (void)
11560 {
11561 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11562   ;
11563   return 0;
11564 }
11565 _ACEOF
11566 rm -f conftest.$ac_objext conftest$ac_exeext
11567 if { (eval echo "$as_me:11567: \"$ac_link\"") >&5
11568   (eval $ac_link) 2>&5
11569   ac_status=$?
11570   echo "$as_me:11570: \$? = $ac_status" >&5
11571   (exit $ac_status); } &&
11572          { ac_try='test -s conftest$ac_exeext'
11573   { (eval echo "$as_me:11573: \"$ac_try\"") >&5
11574   (eval $ac_try) 2>&5
11575   ac_status=$?
11576   echo "$as_me:11576: \$? = $ac_status" >&5
11577   (exit $ac_status); }; }; then
11578   echo "$as_me:11578: result: yes" >&5
11579 echo "${ECHO_T}yes" >&6
11580 else
11581   echo "$as_me: failed program was:" >&5
11582 cat conftest.$ac_ext >&5
11583 echo "$as_me:11583: result: no" >&5
11584 echo "${ECHO_T}no" >&6
11585                  LIBS="$cf_ncurses_SAVE"
11586 fi
11587 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11588 fi
11589
11590 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11591
11592 cat >>confdefs.h <<EOF
11593 #define $cf_nculib_ROOT 1
11594 EOF
11595
11596         fi
11597 else
11598         NCURSES_CONFIG=none
11599 fi
11600
11601         ;;
11602 (pdcurses)
11603         echo "$as_me:11603: checking for X" >&5
11604 echo $ECHO_N "checking for X... $ECHO_C" >&6
11605
11606 # Check whether --with-x or --without-x was given.
11607 if test "${with_x+set}" = set; then
11608   withval="$with_x"
11609
11610 fi;
11611 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11612 if test "x$with_x" = xno; then
11613   # The user explicitly disabled X.
11614   have_x=disabled
11615 else
11616   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11617     # Both variables are already set.
11618     have_x=yes
11619   else
11620     if test "${ac_cv_have_x+set}" = set; then
11621   echo $ECHO_N "(cached) $ECHO_C" >&6
11622 else
11623   # One or both of the vars are not set, and there is no cached value.
11624 ac_x_includes=no ac_x_libraries=no
11625 rm -fr conftest.dir
11626 if mkdir conftest.dir; then
11627   cd conftest.dir
11628   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11629   cat >Imakefile <<'EOF'
11630 acfindx:
11631         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11632 EOF
11633   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11634     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11635     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11636     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11637     for ac_extension in a so sl dylib dll; do
11638       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11639          test -f $ac_im_libdir/libX11.$ac_extension; then
11640         ac_im_usrlibdir=$ac_im_libdir; break
11641       fi
11642     done
11643     # Screen out bogus values from the imake configuration.  They are
11644     # bogus both because they are the default anyway, and because
11645     # using them would break gcc on systems where it needs fixed includes.
11646     case $ac_im_incroot in
11647         /usr/include) ;;
11648         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11649     esac
11650     case $ac_im_usrlibdir in
11651         /usr/lib | /lib) ;;
11652         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11653     esac
11654   fi
11655   cd ..
11656   rm -fr conftest.dir
11657 fi
11658
11659 # Standard set of common directories for X headers.
11660 # Check X11 before X11Rn because it is often a symlink to the current release.
11661 ac_x_header_dirs='
11662 /usr/X11/include
11663 /usr/X11R7/include
11664 /usr/X11R6/include
11665 /usr/X11R5/include
11666 /usr/X11R4/include
11667
11668 /opt/local/include
11669 /opt/X11/include
11670
11671 /usr/include/X11
11672 /usr/include/X11R7
11673 /usr/include/X11R6
11674 /usr/include/X11R5
11675 /usr/include/X11R4
11676
11677 /usr/local/X11/include
11678 /usr/local/X11R7/include
11679 /usr/local/X11R6/include
11680 /usr/local/X11R5/include
11681 /usr/local/X11R4/include
11682
11683 /usr/local/include/X11
11684 /usr/local/include/X11R7
11685 /usr/local/include/X11R6
11686 /usr/local/include/X11R5
11687 /usr/local/include/X11R4
11688
11689 /usr/X386/include
11690 /usr/x386/include
11691 /usr/XFree86/include/X11
11692
11693 /usr/include
11694 /usr/local/include
11695 /usr/unsupported/include
11696 /usr/athena/include
11697 /usr/local/x11r5/include
11698 /usr/lpp/Xamples/include
11699
11700 /usr/openwin/include
11701 /usr/openwin/share/include'
11702
11703 if test "$ac_x_includes" = no; then
11704   # Guess where to find include files, by looking for Intrinsic.h.
11705   # First, try using that file with no special directory specified.
11706   cat >conftest.$ac_ext <<_ACEOF
11707 #line 11707 "configure"
11708 #include "confdefs.h"
11709 #include <X11/Intrinsic.h>
11710 _ACEOF
11711 if { (eval echo "$as_me:11711: \"$ac_cpp conftest.$ac_ext\"") >&5
11712   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11713   ac_status=$?
11714   egrep -v '^ *\+' conftest.er1 >conftest.err
11715   rm -f conftest.er1
11716   cat conftest.err >&5
11717   echo "$as_me:11717: \$? = $ac_status" >&5
11718   (exit $ac_status); } >/dev/null; then
11719   if test -s conftest.err; then
11720     ac_cpp_err=$ac_c_preproc_warn_flag
11721   else
11722     ac_cpp_err=
11723   fi
11724 else
11725   ac_cpp_err=yes
11726 fi
11727 if test -z "$ac_cpp_err"; then
11728   # We can compile using X headers with no special include directory.
11729 ac_x_includes=
11730 else
11731   echo "$as_me: failed program was:" >&5
11732   cat conftest.$ac_ext >&5
11733   for ac_dir in $ac_x_header_dirs; do
11734   if test -r "$ac_dir/X11/Intrinsic.h"; then
11735     ac_x_includes=$ac_dir
11736     break
11737   fi
11738 done
11739 fi
11740 rm -f conftest.err conftest.$ac_ext
11741 fi # $ac_x_includes = no
11742
11743 if test "$ac_x_libraries" = no; then
11744   # Check for the libraries.
11745   # See if we find them without any special options.
11746   # Don't add to $LIBS permanently.
11747   ac_save_LIBS=$LIBS
11748   LIBS="-lXt $LIBS"
11749   cat >conftest.$ac_ext <<_ACEOF
11750 #line 11750 "configure"
11751 #include "confdefs.h"
11752 #include <X11/Intrinsic.h>
11753 int
11754 main (void)
11755 {
11756 XtMalloc (0)
11757   ;
11758   return 0;
11759 }
11760 _ACEOF
11761 rm -f conftest.$ac_objext conftest$ac_exeext
11762 if { (eval echo "$as_me:11762: \"$ac_link\"") >&5
11763   (eval $ac_link) 2>&5
11764   ac_status=$?
11765   echo "$as_me:11765: \$? = $ac_status" >&5
11766   (exit $ac_status); } &&
11767          { ac_try='test -s conftest$ac_exeext'
11768   { (eval echo "$as_me:11768: \"$ac_try\"") >&5
11769   (eval $ac_try) 2>&5
11770   ac_status=$?
11771   echo "$as_me:11771: \$? = $ac_status" >&5
11772   (exit $ac_status); }; }; then
11773   LIBS=$ac_save_LIBS
11774 # We can link X programs with no special library path.
11775 ac_x_libraries=
11776 else
11777   echo "$as_me: failed program was:" >&5
11778 cat conftest.$ac_ext >&5
11779 LIBS=$ac_save_LIBS
11780 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11781 do
11782   # Don't even attempt the hair of trying to link an X program!
11783   for ac_extension in a so sl dylib dll; do
11784     if test -r $ac_dir/libXt.$ac_extension; then
11785       ac_x_libraries=$ac_dir
11786       break 2
11787     fi
11788   done
11789 done
11790 fi
11791 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11792 fi # $ac_x_libraries = no
11793
11794 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11795   # Didn't find X anywhere.  Cache the known absence of X.
11796   ac_cv_have_x="have_x=no"
11797 else
11798   # Record where we found X for the cache.
11799   ac_cv_have_x="have_x=yes \
11800                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11801 fi
11802 fi
11803
11804   fi
11805   eval "$ac_cv_have_x"
11806 fi # $with_x != no
11807
11808 if test "$have_x" != yes; then
11809   echo "$as_me:11809: result: $have_x" >&5
11810 echo "${ECHO_T}$have_x" >&6
11811   no_x=yes
11812 else
11813   # If each of the values was on the command line, it overrides each guess.
11814   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11815   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11816   # Update the cache value to reflect the command line values.
11817   ac_cv_have_x="have_x=yes \
11818                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11819   echo "$as_me:11819: result: libraries $x_libraries, headers $x_includes" >&5
11820 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11821 fi
11822
11823 if test "$no_x" = yes; then
11824   # Not all programs may use this symbol, but it does not hurt to define it.
11825
11826 cat >>confdefs.h <<\EOF
11827 #define X_DISPLAY_MISSING 1
11828 EOF
11829
11830   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11831 else
11832   if test -n "$x_includes"; then
11833     X_CFLAGS="$X_CFLAGS -I$x_includes"
11834   fi
11835
11836   # It would also be nice to do this for all -L options, not just this one.
11837   if test -n "$x_libraries"; then
11838     X_LIBS="$X_LIBS -L$x_libraries"
11839     # For Solaris; some versions of Sun CC require a space after -R and
11840     # others require no space.  Words are not sufficient . . . .
11841     case `(uname -sr) 2>/dev/null` in
11842     "SunOS 5"*)
11843       echo "$as_me:11843: checking whether -R must be followed by a space" >&5
11844 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11845       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11846       cat >conftest.$ac_ext <<_ACEOF
11847 #line 11847 "configure"
11848 #include "confdefs.h"
11849
11850 int
11851 main (void)
11852 {
11853
11854   ;
11855   return 0;
11856 }
11857 _ACEOF
11858 rm -f conftest.$ac_objext conftest$ac_exeext
11859 if { (eval echo "$as_me:11859: \"$ac_link\"") >&5
11860   (eval $ac_link) 2>&5
11861   ac_status=$?
11862   echo "$as_me:11862: \$? = $ac_status" >&5
11863   (exit $ac_status); } &&
11864          { ac_try='test -s conftest$ac_exeext'
11865   { (eval echo "$as_me:11865: \"$ac_try\"") >&5
11866   (eval $ac_try) 2>&5
11867   ac_status=$?
11868   echo "$as_me:11868: \$? = $ac_status" >&5
11869   (exit $ac_status); }; }; then
11870   ac_R_nospace=yes
11871 else
11872   echo "$as_me: failed program was:" >&5
11873 cat conftest.$ac_ext >&5
11874 ac_R_nospace=no
11875 fi
11876 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11877       if test $ac_R_nospace = yes; then
11878         echo "$as_me:11878: result: no" >&5
11879 echo "${ECHO_T}no" >&6
11880         X_LIBS="$X_LIBS -R$x_libraries"
11881       else
11882         LIBS="$ac_xsave_LIBS -R $x_libraries"
11883         cat >conftest.$ac_ext <<_ACEOF
11884 #line 11884 "configure"
11885 #include "confdefs.h"
11886
11887 int
11888 main (void)
11889 {
11890
11891   ;
11892   return 0;
11893 }
11894 _ACEOF
11895 rm -f conftest.$ac_objext conftest$ac_exeext
11896 if { (eval echo "$as_me:11896: \"$ac_link\"") >&5
11897   (eval $ac_link) 2>&5
11898   ac_status=$?
11899   echo "$as_me:11899: \$? = $ac_status" >&5
11900   (exit $ac_status); } &&
11901          { ac_try='test -s conftest$ac_exeext'
11902   { (eval echo "$as_me:11902: \"$ac_try\"") >&5
11903   (eval $ac_try) 2>&5
11904   ac_status=$?
11905   echo "$as_me:11905: \$? = $ac_status" >&5
11906   (exit $ac_status); }; }; then
11907   ac_R_space=yes
11908 else
11909   echo "$as_me: failed program was:" >&5
11910 cat conftest.$ac_ext >&5
11911 ac_R_space=no
11912 fi
11913 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11914         if test $ac_R_space = yes; then
11915           echo "$as_me:11915: result: yes" >&5
11916 echo "${ECHO_T}yes" >&6
11917           X_LIBS="$X_LIBS -R $x_libraries"
11918         else
11919           echo "$as_me:11919: result: neither works" >&5
11920 echo "${ECHO_T}neither works" >&6
11921         fi
11922       fi
11923       LIBS=$ac_xsave_LIBS
11924     esac
11925   fi
11926
11927   # Check for system-dependent libraries X programs must link with.
11928   # Do this before checking for the system-independent R6 libraries
11929   # (-lICE), since we may need -lsocket or whatever for X linking.
11930
11931   if test "$ISC" = yes; then
11932     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11933   else
11934     # Martyn Johnson says this is needed for Ultrix, if the X
11935     # libraries were built with DECnet support.  And Karl Berry says
11936     # the Alpha needs dnet_stub (dnet does not exist).
11937     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11938     cat >conftest.$ac_ext <<_ACEOF
11939 #line 11939 "configure"
11940 #include "confdefs.h"
11941
11942 /* Override any gcc2 internal prototype to avoid an error.  */
11943 #ifdef __cplusplus
11944 extern "C"
11945 #endif
11946 /* We use char because int might match the return type of a gcc2
11947    builtin and then its argument prototype would still apply.  */
11948 char XOpenDisplay ();
11949 int
11950 main (void)
11951 {
11952 XOpenDisplay ();
11953   ;
11954   return 0;
11955 }
11956 _ACEOF
11957 rm -f conftest.$ac_objext conftest$ac_exeext
11958 if { (eval echo "$as_me:11958: \"$ac_link\"") >&5
11959   (eval $ac_link) 2>&5
11960   ac_status=$?
11961   echo "$as_me:11961: \$? = $ac_status" >&5
11962   (exit $ac_status); } &&
11963          { ac_try='test -s conftest$ac_exeext'
11964   { (eval echo "$as_me:11964: \"$ac_try\"") >&5
11965   (eval $ac_try) 2>&5
11966   ac_status=$?
11967   echo "$as_me:11967: \$? = $ac_status" >&5
11968   (exit $ac_status); }; }; then
11969   :
11970 else
11971   echo "$as_me: failed program was:" >&5
11972 cat conftest.$ac_ext >&5
11973 echo "$as_me:11973: checking for dnet_ntoa in -ldnet" >&5
11974 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11975 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11976   echo $ECHO_N "(cached) $ECHO_C" >&6
11977 else
11978   ac_check_lib_save_LIBS=$LIBS
11979 LIBS="-ldnet  $LIBS"
11980 cat >conftest.$ac_ext <<_ACEOF
11981 #line 11981 "configure"
11982 #include "confdefs.h"
11983
11984 /* Override any gcc2 internal prototype to avoid an error.  */
11985 #ifdef __cplusplus
11986 extern "C"
11987 #endif
11988 /* We use char because int might match the return type of a gcc2
11989    builtin and then its argument prototype would still apply.  */
11990 char dnet_ntoa ();
11991 int
11992 main (void)
11993 {
11994 dnet_ntoa ();
11995   ;
11996   return 0;
11997 }
11998 _ACEOF
11999 rm -f conftest.$ac_objext conftest$ac_exeext
12000 if { (eval echo "$as_me:12000: \"$ac_link\"") >&5
12001   (eval $ac_link) 2>&5
12002   ac_status=$?
12003   echo "$as_me:12003: \$? = $ac_status" >&5
12004   (exit $ac_status); } &&
12005          { ac_try='test -s conftest$ac_exeext'
12006   { (eval echo "$as_me:12006: \"$ac_try\"") >&5
12007   (eval $ac_try) 2>&5
12008   ac_status=$?
12009   echo "$as_me:12009: \$? = $ac_status" >&5
12010   (exit $ac_status); }; }; then
12011   ac_cv_lib_dnet_dnet_ntoa=yes
12012 else
12013   echo "$as_me: failed program was:" >&5
12014 cat conftest.$ac_ext >&5
12015 ac_cv_lib_dnet_dnet_ntoa=no
12016 fi
12017 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12018 LIBS=$ac_check_lib_save_LIBS
12019 fi
12020 echo "$as_me:12020: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12021 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12022 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
12023   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12024 fi
12025
12026     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12027       echo "$as_me:12027: checking for dnet_ntoa in -ldnet_stub" >&5
12028 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12029 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12030   echo $ECHO_N "(cached) $ECHO_C" >&6
12031 else
12032   ac_check_lib_save_LIBS=$LIBS
12033 LIBS="-ldnet_stub  $LIBS"
12034 cat >conftest.$ac_ext <<_ACEOF
12035 #line 12035 "configure"
12036 #include "confdefs.h"
12037
12038 /* Override any gcc2 internal prototype to avoid an error.  */
12039 #ifdef __cplusplus
12040 extern "C"
12041 #endif
12042 /* We use char because int might match the return type of a gcc2
12043    builtin and then its argument prototype would still apply.  */
12044 char dnet_ntoa ();
12045 int
12046 main (void)
12047 {
12048 dnet_ntoa ();
12049   ;
12050   return 0;
12051 }
12052 _ACEOF
12053 rm -f conftest.$ac_objext conftest$ac_exeext
12054 if { (eval echo "$as_me:12054: \"$ac_link\"") >&5
12055   (eval $ac_link) 2>&5
12056   ac_status=$?
12057   echo "$as_me:12057: \$? = $ac_status" >&5
12058   (exit $ac_status); } &&
12059          { ac_try='test -s conftest$ac_exeext'
12060   { (eval echo "$as_me:12060: \"$ac_try\"") >&5
12061   (eval $ac_try) 2>&5
12062   ac_status=$?
12063   echo "$as_me:12063: \$? = $ac_status" >&5
12064   (exit $ac_status); }; }; then
12065   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12066 else
12067   echo "$as_me: failed program was:" >&5
12068 cat conftest.$ac_ext >&5
12069 ac_cv_lib_dnet_stub_dnet_ntoa=no
12070 fi
12071 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12072 LIBS=$ac_check_lib_save_LIBS
12073 fi
12074 echo "$as_me:12074: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12075 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12076 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
12077   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12078 fi
12079
12080     fi
12081 fi
12082 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12083     LIBS="$ac_xsave_LIBS"
12084
12085     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12086     # to get the SysV transport functions.
12087     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12088     # needs -lnsl.
12089     # The nsl library prevents programs from opening the X display
12090     # on Irix 5.2, according to T.E. Dickey.
12091     # The functions gethostbyname, getservbyname, and inet_addr are
12092     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12093     echo "$as_me:12093: checking for gethostbyname" >&5
12094 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12095 if test "${ac_cv_func_gethostbyname+set}" = set; then
12096   echo $ECHO_N "(cached) $ECHO_C" >&6
12097 else
12098   cat >conftest.$ac_ext <<_ACEOF
12099 #line 12099 "configure"
12100 #include "confdefs.h"
12101 #define gethostbyname autoconf_temporary
12102 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12103 #undef gethostbyname
12104
12105 #ifdef __cplusplus
12106 extern "C"
12107 #endif
12108
12109 /* We use char because int might match the return type of a gcc2
12110    builtin and then its argument prototype would still apply.  */
12111 char gethostbyname (void);
12112
12113 int
12114 main (void)
12115 {
12116
12117 /* The GNU C library defines stubs for functions which it implements
12118     to always fail with ENOSYS.  Some functions are actually named
12119     something starting with __ and the normal name is an alias.  */
12120 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12121 #error found stub for gethostbyname
12122 #endif
12123
12124         return gethostbyname ();
12125   ;
12126   return 0;
12127 }
12128 _ACEOF
12129 rm -f conftest.$ac_objext conftest$ac_exeext
12130 if { (eval echo "$as_me:12130: \"$ac_link\"") >&5
12131   (eval $ac_link) 2>&5
12132   ac_status=$?
12133   echo "$as_me:12133: \$? = $ac_status" >&5
12134   (exit $ac_status); } &&
12135          { ac_try='test -s conftest$ac_exeext'
12136   { (eval echo "$as_me:12136: \"$ac_try\"") >&5
12137   (eval $ac_try) 2>&5
12138   ac_status=$?
12139   echo "$as_me:12139: \$? = $ac_status" >&5
12140   (exit $ac_status); }; }; then
12141   ac_cv_func_gethostbyname=yes
12142 else
12143   echo "$as_me: failed program was:" >&5
12144 cat conftest.$ac_ext >&5
12145 ac_cv_func_gethostbyname=no
12146 fi
12147 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12148 fi
12149 echo "$as_me:12149: result: $ac_cv_func_gethostbyname" >&5
12150 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12151
12152     if test $ac_cv_func_gethostbyname = no; then
12153       echo "$as_me:12153: checking for gethostbyname in -lnsl" >&5
12154 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12155 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12156   echo $ECHO_N "(cached) $ECHO_C" >&6
12157 else
12158   ac_check_lib_save_LIBS=$LIBS
12159 LIBS="-lnsl  $LIBS"
12160 cat >conftest.$ac_ext <<_ACEOF
12161 #line 12161 "configure"
12162 #include "confdefs.h"
12163
12164 /* Override any gcc2 internal prototype to avoid an error.  */
12165 #ifdef __cplusplus
12166 extern "C"
12167 #endif
12168 /* We use char because int might match the return type of a gcc2
12169    builtin and then its argument prototype would still apply.  */
12170 char gethostbyname ();
12171 int
12172 main (void)
12173 {
12174 gethostbyname ();
12175   ;
12176   return 0;
12177 }
12178 _ACEOF
12179 rm -f conftest.$ac_objext conftest$ac_exeext
12180 if { (eval echo "$as_me:12180: \"$ac_link\"") >&5
12181   (eval $ac_link) 2>&5
12182   ac_status=$?
12183   echo "$as_me:12183: \$? = $ac_status" >&5
12184   (exit $ac_status); } &&
12185          { ac_try='test -s conftest$ac_exeext'
12186   { (eval echo "$as_me:12186: \"$ac_try\"") >&5
12187   (eval $ac_try) 2>&5
12188   ac_status=$?
12189   echo "$as_me:12189: \$? = $ac_status" >&5
12190   (exit $ac_status); }; }; then
12191   ac_cv_lib_nsl_gethostbyname=yes
12192 else
12193   echo "$as_me: failed program was:" >&5
12194 cat conftest.$ac_ext >&5
12195 ac_cv_lib_nsl_gethostbyname=no
12196 fi
12197 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12198 LIBS=$ac_check_lib_save_LIBS
12199 fi
12200 echo "$as_me:12200: result: $ac_cv_lib_nsl_gethostbyname" >&5
12201 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12202 if test $ac_cv_lib_nsl_gethostbyname = yes; then
12203   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12204 fi
12205
12206       if test $ac_cv_lib_nsl_gethostbyname = no; then
12207         echo "$as_me:12207: checking for gethostbyname in -lbsd" >&5
12208 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12209 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12210   echo $ECHO_N "(cached) $ECHO_C" >&6
12211 else
12212   ac_check_lib_save_LIBS=$LIBS
12213 LIBS="-lbsd  $LIBS"
12214 cat >conftest.$ac_ext <<_ACEOF
12215 #line 12215 "configure"
12216 #include "confdefs.h"
12217
12218 /* Override any gcc2 internal prototype to avoid an error.  */
12219 #ifdef __cplusplus
12220 extern "C"
12221 #endif
12222 /* We use char because int might match the return type of a gcc2
12223    builtin and then its argument prototype would still apply.  */
12224 char gethostbyname ();
12225 int
12226 main (void)
12227 {
12228 gethostbyname ();
12229   ;
12230   return 0;
12231 }
12232 _ACEOF
12233 rm -f conftest.$ac_objext conftest$ac_exeext
12234 if { (eval echo "$as_me:12234: \"$ac_link\"") >&5
12235   (eval $ac_link) 2>&5
12236   ac_status=$?
12237   echo "$as_me:12237: \$? = $ac_status" >&5
12238   (exit $ac_status); } &&
12239          { ac_try='test -s conftest$ac_exeext'
12240   { (eval echo "$as_me:12240: \"$ac_try\"") >&5
12241   (eval $ac_try) 2>&5
12242   ac_status=$?
12243   echo "$as_me:12243: \$? = $ac_status" >&5
12244   (exit $ac_status); }; }; then
12245   ac_cv_lib_bsd_gethostbyname=yes
12246 else
12247   echo "$as_me: failed program was:" >&5
12248 cat conftest.$ac_ext >&5
12249 ac_cv_lib_bsd_gethostbyname=no
12250 fi
12251 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12252 LIBS=$ac_check_lib_save_LIBS
12253 fi
12254 echo "$as_me:12254: result: $ac_cv_lib_bsd_gethostbyname" >&5
12255 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12256 if test $ac_cv_lib_bsd_gethostbyname = yes; then
12257   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12258 fi
12259
12260       fi
12261     fi
12262
12263     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12264     # socket/setsockopt and other routines are undefined under SCO ODT
12265     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12266     # on later versions), says Simon Leinen: it contains gethostby*
12267     # variants that don't use the nameserver (or something).  -lsocket
12268     # must be given before -lnsl if both are needed.  We assume that
12269     # if connect needs -lnsl, so does gethostbyname.
12270     echo "$as_me:12270: checking for connect" >&5
12271 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12272 if test "${ac_cv_func_connect+set}" = set; then
12273   echo $ECHO_N "(cached) $ECHO_C" >&6
12274 else
12275   cat >conftest.$ac_ext <<_ACEOF
12276 #line 12276 "configure"
12277 #include "confdefs.h"
12278 #define connect autoconf_temporary
12279 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12280 #undef connect
12281
12282 #ifdef __cplusplus
12283 extern "C"
12284 #endif
12285
12286 /* We use char because int might match the return type of a gcc2
12287    builtin and then its argument prototype would still apply.  */
12288 char connect (void);
12289
12290 int
12291 main (void)
12292 {
12293
12294 /* The GNU C library defines stubs for functions which it implements
12295     to always fail with ENOSYS.  Some functions are actually named
12296     something starting with __ and the normal name is an alias.  */
12297 #if defined (__stub_connect) || defined (__stub___connect)
12298 #error found stub for connect
12299 #endif
12300
12301         return connect ();
12302   ;
12303   return 0;
12304 }
12305 _ACEOF
12306 rm -f conftest.$ac_objext conftest$ac_exeext
12307 if { (eval echo "$as_me:12307: \"$ac_link\"") >&5
12308   (eval $ac_link) 2>&5
12309   ac_status=$?
12310   echo "$as_me:12310: \$? = $ac_status" >&5
12311   (exit $ac_status); } &&
12312          { ac_try='test -s conftest$ac_exeext'
12313   { (eval echo "$as_me:12313: \"$ac_try\"") >&5
12314   (eval $ac_try) 2>&5
12315   ac_status=$?
12316   echo "$as_me:12316: \$? = $ac_status" >&5
12317   (exit $ac_status); }; }; then
12318   ac_cv_func_connect=yes
12319 else
12320   echo "$as_me: failed program was:" >&5
12321 cat conftest.$ac_ext >&5
12322 ac_cv_func_connect=no
12323 fi
12324 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12325 fi
12326 echo "$as_me:12326: result: $ac_cv_func_connect" >&5
12327 echo "${ECHO_T}$ac_cv_func_connect" >&6
12328
12329     if test $ac_cv_func_connect = no; then
12330       echo "$as_me:12330: checking for connect in -lsocket" >&5
12331 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12332 if test "${ac_cv_lib_socket_connect+set}" = set; then
12333   echo $ECHO_N "(cached) $ECHO_C" >&6
12334 else
12335   ac_check_lib_save_LIBS=$LIBS
12336 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12337 cat >conftest.$ac_ext <<_ACEOF
12338 #line 12338 "configure"
12339 #include "confdefs.h"
12340
12341 /* Override any gcc2 internal prototype to avoid an error.  */
12342 #ifdef __cplusplus
12343 extern "C"
12344 #endif
12345 /* We use char because int might match the return type of a gcc2
12346    builtin and then its argument prototype would still apply.  */
12347 char connect ();
12348 int
12349 main (void)
12350 {
12351 connect ();
12352   ;
12353   return 0;
12354 }
12355 _ACEOF
12356 rm -f conftest.$ac_objext conftest$ac_exeext
12357 if { (eval echo "$as_me:12357: \"$ac_link\"") >&5
12358   (eval $ac_link) 2>&5
12359   ac_status=$?
12360   echo "$as_me:12360: \$? = $ac_status" >&5
12361   (exit $ac_status); } &&
12362          { ac_try='test -s conftest$ac_exeext'
12363   { (eval echo "$as_me:12363: \"$ac_try\"") >&5
12364   (eval $ac_try) 2>&5
12365   ac_status=$?
12366   echo "$as_me:12366: \$? = $ac_status" >&5
12367   (exit $ac_status); }; }; then
12368   ac_cv_lib_socket_connect=yes
12369 else
12370   echo "$as_me: failed program was:" >&5
12371 cat conftest.$ac_ext >&5
12372 ac_cv_lib_socket_connect=no
12373 fi
12374 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12375 LIBS=$ac_check_lib_save_LIBS
12376 fi
12377 echo "$as_me:12377: result: $ac_cv_lib_socket_connect" >&5
12378 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12379 if test $ac_cv_lib_socket_connect = yes; then
12380   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12381 fi
12382
12383     fi
12384
12385     # Guillermo Gomez says -lposix is necessary on A/UX.
12386     echo "$as_me:12386: checking for remove" >&5
12387 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12388 if test "${ac_cv_func_remove+set}" = set; then
12389   echo $ECHO_N "(cached) $ECHO_C" >&6
12390 else
12391   cat >conftest.$ac_ext <<_ACEOF
12392 #line 12392 "configure"
12393 #include "confdefs.h"
12394 #define remove autoconf_temporary
12395 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12396 #undef remove
12397
12398 #ifdef __cplusplus
12399 extern "C"
12400 #endif
12401
12402 /* We use char because int might match the return type of a gcc2
12403    builtin and then its argument prototype would still apply.  */
12404 char remove (void);
12405
12406 int
12407 main (void)
12408 {
12409
12410 /* The GNU C library defines stubs for functions which it implements
12411     to always fail with ENOSYS.  Some functions are actually named
12412     something starting with __ and the normal name is an alias.  */
12413 #if defined (__stub_remove) || defined (__stub___remove)
12414 #error found stub for remove
12415 #endif
12416
12417         return remove ();
12418   ;
12419   return 0;
12420 }
12421 _ACEOF
12422 rm -f conftest.$ac_objext conftest$ac_exeext
12423 if { (eval echo "$as_me:12423: \"$ac_link\"") >&5
12424   (eval $ac_link) 2>&5
12425   ac_status=$?
12426   echo "$as_me:12426: \$? = $ac_status" >&5
12427   (exit $ac_status); } &&
12428          { ac_try='test -s conftest$ac_exeext'
12429   { (eval echo "$as_me:12429: \"$ac_try\"") >&5
12430   (eval $ac_try) 2>&5
12431   ac_status=$?
12432   echo "$as_me:12432: \$? = $ac_status" >&5
12433   (exit $ac_status); }; }; then
12434   ac_cv_func_remove=yes
12435 else
12436   echo "$as_me: failed program was:" >&5
12437 cat conftest.$ac_ext >&5
12438 ac_cv_func_remove=no
12439 fi
12440 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12441 fi
12442 echo "$as_me:12442: result: $ac_cv_func_remove" >&5
12443 echo "${ECHO_T}$ac_cv_func_remove" >&6
12444
12445     if test $ac_cv_func_remove = no; then
12446       echo "$as_me:12446: checking for remove in -lposix" >&5
12447 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12448 if test "${ac_cv_lib_posix_remove+set}" = set; then
12449   echo $ECHO_N "(cached) $ECHO_C" >&6
12450 else
12451   ac_check_lib_save_LIBS=$LIBS
12452 LIBS="-lposix  $LIBS"
12453 cat >conftest.$ac_ext <<_ACEOF
12454 #line 12454 "configure"
12455 #include "confdefs.h"
12456
12457 /* Override any gcc2 internal prototype to avoid an error.  */
12458 #ifdef __cplusplus
12459 extern "C"
12460 #endif
12461 /* We use char because int might match the return type of a gcc2
12462    builtin and then its argument prototype would still apply.  */
12463 char remove ();
12464 int
12465 main (void)
12466 {
12467 remove ();
12468   ;
12469   return 0;
12470 }
12471 _ACEOF
12472 rm -f conftest.$ac_objext conftest$ac_exeext
12473 if { (eval echo "$as_me:12473: \"$ac_link\"") >&5
12474   (eval $ac_link) 2>&5
12475   ac_status=$?
12476   echo "$as_me:12476: \$? = $ac_status" >&5
12477   (exit $ac_status); } &&
12478          { ac_try='test -s conftest$ac_exeext'
12479   { (eval echo "$as_me:12479: \"$ac_try\"") >&5
12480   (eval $ac_try) 2>&5
12481   ac_status=$?
12482   echo "$as_me:12482: \$? = $ac_status" >&5
12483   (exit $ac_status); }; }; then
12484   ac_cv_lib_posix_remove=yes
12485 else
12486   echo "$as_me: failed program was:" >&5
12487 cat conftest.$ac_ext >&5
12488 ac_cv_lib_posix_remove=no
12489 fi
12490 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12491 LIBS=$ac_check_lib_save_LIBS
12492 fi
12493 echo "$as_me:12493: result: $ac_cv_lib_posix_remove" >&5
12494 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12495 if test $ac_cv_lib_posix_remove = yes; then
12496   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12497 fi
12498
12499     fi
12500
12501     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12502     echo "$as_me:12502: checking for shmat" >&5
12503 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12504 if test "${ac_cv_func_shmat+set}" = set; then
12505   echo $ECHO_N "(cached) $ECHO_C" >&6
12506 else
12507   cat >conftest.$ac_ext <<_ACEOF
12508 #line 12508 "configure"
12509 #include "confdefs.h"
12510 #define shmat autoconf_temporary
12511 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12512 #undef shmat
12513
12514 #ifdef __cplusplus
12515 extern "C"
12516 #endif
12517
12518 /* We use char because int might match the return type of a gcc2
12519    builtin and then its argument prototype would still apply.  */
12520 char shmat (void);
12521
12522 int
12523 main (void)
12524 {
12525
12526 /* The GNU C library defines stubs for functions which it implements
12527     to always fail with ENOSYS.  Some functions are actually named
12528     something starting with __ and the normal name is an alias.  */
12529 #if defined (__stub_shmat) || defined (__stub___shmat)
12530 #error found stub for shmat
12531 #endif
12532
12533         return shmat ();
12534   ;
12535   return 0;
12536 }
12537 _ACEOF
12538 rm -f conftest.$ac_objext conftest$ac_exeext
12539 if { (eval echo "$as_me:12539: \"$ac_link\"") >&5
12540   (eval $ac_link) 2>&5
12541   ac_status=$?
12542   echo "$as_me:12542: \$? = $ac_status" >&5
12543   (exit $ac_status); } &&
12544          { ac_try='test -s conftest$ac_exeext'
12545   { (eval echo "$as_me:12545: \"$ac_try\"") >&5
12546   (eval $ac_try) 2>&5
12547   ac_status=$?
12548   echo "$as_me:12548: \$? = $ac_status" >&5
12549   (exit $ac_status); }; }; then
12550   ac_cv_func_shmat=yes
12551 else
12552   echo "$as_me: failed program was:" >&5
12553 cat conftest.$ac_ext >&5
12554 ac_cv_func_shmat=no
12555 fi
12556 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12557 fi
12558 echo "$as_me:12558: result: $ac_cv_func_shmat" >&5
12559 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12560
12561     if test $ac_cv_func_shmat = no; then
12562       echo "$as_me:12562: checking for shmat in -lipc" >&5
12563 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12564 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12565   echo $ECHO_N "(cached) $ECHO_C" >&6
12566 else
12567   ac_check_lib_save_LIBS=$LIBS
12568 LIBS="-lipc  $LIBS"
12569 cat >conftest.$ac_ext <<_ACEOF
12570 #line 12570 "configure"
12571 #include "confdefs.h"
12572
12573 /* Override any gcc2 internal prototype to avoid an error.  */
12574 #ifdef __cplusplus
12575 extern "C"
12576 #endif
12577 /* We use char because int might match the return type of a gcc2
12578    builtin and then its argument prototype would still apply.  */
12579 char shmat ();
12580 int
12581 main (void)
12582 {
12583 shmat ();
12584   ;
12585   return 0;
12586 }
12587 _ACEOF
12588 rm -f conftest.$ac_objext conftest$ac_exeext
12589 if { (eval echo "$as_me:12589: \"$ac_link\"") >&5
12590   (eval $ac_link) 2>&5
12591   ac_status=$?
12592   echo "$as_me:12592: \$? = $ac_status" >&5
12593   (exit $ac_status); } &&
12594          { ac_try='test -s conftest$ac_exeext'
12595   { (eval echo "$as_me:12595: \"$ac_try\"") >&5
12596   (eval $ac_try) 2>&5
12597   ac_status=$?
12598   echo "$as_me:12598: \$? = $ac_status" >&5
12599   (exit $ac_status); }; }; then
12600   ac_cv_lib_ipc_shmat=yes
12601 else
12602   echo "$as_me: failed program was:" >&5
12603 cat conftest.$ac_ext >&5
12604 ac_cv_lib_ipc_shmat=no
12605 fi
12606 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12607 LIBS=$ac_check_lib_save_LIBS
12608 fi
12609 echo "$as_me:12609: result: $ac_cv_lib_ipc_shmat" >&5
12610 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12611 if test $ac_cv_lib_ipc_shmat = yes; then
12612   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12613 fi
12614
12615     fi
12616   fi
12617
12618   # Check for libraries that X11R6 Xt/Xaw programs need.
12619   ac_save_LDFLAGS=$LDFLAGS
12620   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12621   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12622   # check for ICE first), but we must link in the order -lSM -lICE or
12623   # we get undefined symbols.  So assume we have SM if we have ICE.
12624   # These have to be linked with before -lX11, unlike the other
12625   # libraries we check for below, so use a different variable.
12626   # John Interrante, Karl Berry
12627   echo "$as_me:12627: checking for IceConnectionNumber in -lICE" >&5
12628 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12629 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12630   echo $ECHO_N "(cached) $ECHO_C" >&6
12631 else
12632   ac_check_lib_save_LIBS=$LIBS
12633 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12634 cat >conftest.$ac_ext <<_ACEOF
12635 #line 12635 "configure"
12636 #include "confdefs.h"
12637
12638 /* Override any gcc2 internal prototype to avoid an error.  */
12639 #ifdef __cplusplus
12640 extern "C"
12641 #endif
12642 /* We use char because int might match the return type of a gcc2
12643    builtin and then its argument prototype would still apply.  */
12644 char IceConnectionNumber ();
12645 int
12646 main (void)
12647 {
12648 IceConnectionNumber ();
12649   ;
12650   return 0;
12651 }
12652 _ACEOF
12653 rm -f conftest.$ac_objext conftest$ac_exeext
12654 if { (eval echo "$as_me:12654: \"$ac_link\"") >&5
12655   (eval $ac_link) 2>&5
12656   ac_status=$?
12657   echo "$as_me:12657: \$? = $ac_status" >&5
12658   (exit $ac_status); } &&
12659          { ac_try='test -s conftest$ac_exeext'
12660   { (eval echo "$as_me:12660: \"$ac_try\"") >&5
12661   (eval $ac_try) 2>&5
12662   ac_status=$?
12663   echo "$as_me:12663: \$? = $ac_status" >&5
12664   (exit $ac_status); }; }; then
12665   ac_cv_lib_ICE_IceConnectionNumber=yes
12666 else
12667   echo "$as_me: failed program was:" >&5
12668 cat conftest.$ac_ext >&5
12669 ac_cv_lib_ICE_IceConnectionNumber=no
12670 fi
12671 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12672 LIBS=$ac_check_lib_save_LIBS
12673 fi
12674 echo "$as_me:12674: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12675 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12676 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12677   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12678 fi
12679
12680   LDFLAGS=$ac_save_LDFLAGS
12681
12682 fi
12683
12684 cf_x_athena=${cf_x_athena:-Xaw}
12685
12686 echo "$as_me:12686: checking if you want to link with Xaw 3d library" >&5
12687 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12688 withval=
12689
12690 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12691 if test "${with_Xaw3d+set}" = set; then
12692   withval="$with_Xaw3d"
12693
12694 fi;
12695 if test "$withval" = yes ; then
12696         cf_x_athena=Xaw3d
12697         echo "$as_me:12697: result: yes" >&5
12698 echo "${ECHO_T}yes" >&6
12699 else
12700         echo "$as_me:12700: result: no" >&5
12701 echo "${ECHO_T}no" >&6
12702 fi
12703
12704 echo "$as_me:12704: checking if you want to link with Xaw 3d xft library" >&5
12705 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12706 withval=
12707
12708 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12709 if test "${with_Xaw3dxft+set}" = set; then
12710   withval="$with_Xaw3dxft"
12711
12712 fi;
12713 if test "$withval" = yes ; then
12714         cf_x_athena=Xaw3dxft
12715         echo "$as_me:12715: result: yes" >&5
12716 echo "${ECHO_T}yes" >&6
12717 else
12718         echo "$as_me:12718: result: no" >&5
12719 echo "${ECHO_T}no" >&6
12720 fi
12721
12722 echo "$as_me:12722: checking if you want to link with neXT Athena library" >&5
12723 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12724 withval=
12725
12726 # Check whether --with-neXtaw or --without-neXtaw was given.
12727 if test "${with_neXtaw+set}" = set; then
12728   withval="$with_neXtaw"
12729
12730 fi;
12731 if test "$withval" = yes ; then
12732         cf_x_athena=neXtaw
12733         echo "$as_me:12733: result: yes" >&5
12734 echo "${ECHO_T}yes" >&6
12735 else
12736         echo "$as_me:12736: result: no" >&5
12737 echo "${ECHO_T}no" >&6
12738 fi
12739
12740 echo "$as_me:12740: checking if you want to link with Athena-Plus library" >&5
12741 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12742 withval=
12743
12744 # Check whether --with-XawPlus or --without-XawPlus was given.
12745 if test "${with_XawPlus+set}" = set; then
12746   withval="$with_XawPlus"
12747
12748 fi;
12749 if test "$withval" = yes ; then
12750         cf_x_athena=XawPlus
12751         echo "$as_me:12751: result: yes" >&5
12752 echo "${ECHO_T}yes" >&6
12753 else
12754         echo "$as_me:12754: result: no" >&5
12755 echo "${ECHO_T}no" >&6
12756 fi
12757
12758 cf_x_athena_lib=""
12759
12760 if test "$PKG_CONFIG" != none ; then
12761         cf_athena_list=
12762         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12763         for cf_athena_pkg in \
12764                 $cf_athena_list \
12765                 ${cf_x_athena} \
12766                 ${cf_x_athena}-devel \
12767                 lib${cf_x_athena} \
12768                 lib${cf_x_athena}-devel
12769         do
12770
12771 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12772         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12773
12774 echo "${as_me:-configure}:12774: testing found package $cf_athena_pkg ..." 1>&5
12775
12776         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12777         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12778         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12779
12780 echo "${as_me:-configure}:12780: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12781
12782         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12783
12784 echo "${as_me:-configure}:12784: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12785
12786 cf_fix_cppflags=no
12787 cf_new_cflags=
12788 cf_new_cppflags=
12789 cf_new_extra_cppflags=
12790
12791 for cf_add_cflags in $cf_pkgconfig_incs
12792 do
12793 case $cf_fix_cppflags in
12794 (no)
12795         case $cf_add_cflags in
12796         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12797                 case $cf_add_cflags in
12798                 (-D*)
12799                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12800
12801                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12802                                 && test -z "${cf_tst_cflags}" \
12803                                 && cf_fix_cppflags=yes
12804
12805                         if test $cf_fix_cppflags = yes ; then
12806
12807         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12808         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12809
12810                                 continue
12811                         elif test "${cf_tst_cflags}" = "\"'" ; then
12812
12813         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12814         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12815
12816                                 continue
12817                         fi
12818                         ;;
12819                 esac
12820                 case "$CPPFLAGS" in
12821                 (*$cf_add_cflags)
12822                         ;;
12823                 (*)
12824                         case $cf_add_cflags in
12825                         (-D*)
12826                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12827
12828 CPPFLAGS=`echo "$CPPFLAGS" | \
12829         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12830                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12831
12832                                 ;;
12833                         esac
12834
12835         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12836         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12837
12838                         ;;
12839                 esac
12840                 ;;
12841         (*)
12842
12843         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12844         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12845
12846                 ;;
12847         esac
12848         ;;
12849 (yes)
12850
12851         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12852         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12853
12854         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12855
12856         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12857                 && test -z "${cf_tst_cflags}" \
12858                 && cf_fix_cppflags=no
12859         ;;
12860 esac
12861 done
12862
12863 if test -n "$cf_new_cflags" ; then
12864
12865         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12866         CFLAGS="${CFLAGS}$cf_new_cflags"
12867
12868 fi
12869
12870 if test -n "$cf_new_cppflags" ; then
12871
12872         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12873         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12874
12875 fi
12876
12877 if test -n "$cf_new_extra_cppflags" ; then
12878
12879         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12880         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12881
12882 fi
12883
12884 cf_add_libs="$LIBS"
12885 # reverse order
12886 cf_add_0lib=
12887 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12888 # filter duplicates
12889 for cf_add_1lib in $cf_add_0lib; do
12890         for cf_add_2lib in $cf_add_libs; do
12891                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12892                         cf_add_1lib=
12893                         break
12894                 fi
12895         done
12896         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12897 done
12898 LIBS="$cf_add_libs"
12899
12900                         cf_x_athena_lib="$cf_pkgconfig_libs"
12901
12902 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12903
12904                         cat >>confdefs.h <<EOF
12905 #define $cf_x_athena_LIBS 1
12906 EOF
12907
12908         for cf_trim_lib in Xmu Xt X11
12909         do
12910                 case "$LIBS" in
12911                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12912                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12913                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12914
12915 echo "${as_me:-configure}:12915: testing ..trimmed $LIBS ..." 1>&5
12916
12917                         ;;
12918                 esac
12919         done
12920
12921 echo "$as_me:12921: checking for usable $cf_x_athena/Xmu package" >&5
12922 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12923 if test "${cf_cv_xaw_compat+set}" = set; then
12924   echo $ECHO_N "(cached) $ECHO_C" >&6
12925 else
12926
12927 cat >conftest.$ac_ext <<_ACEOF
12928 #line 12928 "configure"
12929 #include "confdefs.h"
12930
12931 #include <X11/Xmu/CharSet.h>
12932
12933 int
12934 main (void)
12935 {
12936
12937 int check = XmuCompareISOLatin1("big", "small");
12938 (void)check;
12939
12940   ;
12941   return 0;
12942 }
12943 _ACEOF
12944 rm -f conftest.$ac_objext conftest$ac_exeext
12945 if { (eval echo "$as_me:12945: \"$ac_link\"") >&5
12946   (eval $ac_link) 2>&5
12947   ac_status=$?
12948   echo "$as_me:12948: \$? = $ac_status" >&5
12949   (exit $ac_status); } &&
12950          { ac_try='test -s conftest$ac_exeext'
12951   { (eval echo "$as_me:12951: \"$ac_try\"") >&5
12952   (eval $ac_try) 2>&5
12953   ac_status=$?
12954   echo "$as_me:12954: \$? = $ac_status" >&5
12955   (exit $ac_status); }; }; then
12956   cf_cv_xaw_compat=yes
12957 else
12958   echo "$as_me: failed program was:" >&5
12959 cat conftest.$ac_ext >&5
12960 cf_cv_xaw_compat=no
12961 fi
12962 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12963 fi
12964 echo "$as_me:12964: result: $cf_cv_xaw_compat" >&5
12965 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12966
12967                         if test "$cf_cv_xaw_compat" = no
12968                         then
12969                                 # workaround for broken ".pc" files...
12970                                 case "$cf_x_athena_lib" in
12971                                 (*-lXmu*)
12972                                         ;;
12973                                 (*)
12974                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12975
12976 echo "${as_me:-configure}:12976: testing work around broken package ..." 1>&5
12977
12978                                         cf_save_xmu="$LIBS"
12979                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12980
12981 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12982         test -n "$verbose" && echo "    found package xmu" 1>&6
12983
12984 echo "${as_me:-configure}:12984: testing found package xmu ..." 1>&5
12985
12986         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12987         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12988         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12989
12990 echo "${as_me:-configure}:12990: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12991
12992         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12993
12994 echo "${as_me:-configure}:12994: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12995
12996 cf_fix_cppflags=no
12997 cf_new_cflags=
12998 cf_new_cppflags=
12999 cf_new_extra_cppflags=
13000
13001 for cf_add_cflags in $cf_pkgconfig_incs
13002 do
13003 case $cf_fix_cppflags in
13004 (no)
13005         case $cf_add_cflags in
13006         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13007                 case $cf_add_cflags in
13008                 (-D*)
13009                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13010
13011                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13012                                 && test -z "${cf_tst_cflags}" \
13013                                 && cf_fix_cppflags=yes
13014
13015                         if test $cf_fix_cppflags = yes ; then
13016
13017         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13018         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13019
13020                                 continue
13021                         elif test "${cf_tst_cflags}" = "\"'" ; then
13022
13023         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13024         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13025
13026                                 continue
13027                         fi
13028                         ;;
13029                 esac
13030                 case "$CPPFLAGS" in
13031                 (*$cf_add_cflags)
13032                         ;;
13033                 (*)
13034                         case $cf_add_cflags in
13035                         (-D*)
13036                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13037
13038 CPPFLAGS=`echo "$CPPFLAGS" | \
13039         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13040                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13041
13042                                 ;;
13043                         esac
13044
13045         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13046         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13047
13048                         ;;
13049                 esac
13050                 ;;
13051         (*)
13052
13053         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13054         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13055
13056                 ;;
13057         esac
13058         ;;
13059 (yes)
13060
13061         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13062         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13063
13064         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13065
13066         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13067                 && test -z "${cf_tst_cflags}" \
13068                 && cf_fix_cppflags=no
13069         ;;
13070 esac
13071 done
13072
13073 if test -n "$cf_new_cflags" ; then
13074
13075         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13076         CFLAGS="${CFLAGS}$cf_new_cflags"
13077
13078 fi
13079
13080 if test -n "$cf_new_cppflags" ; then
13081
13082         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13083         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13084
13085 fi
13086
13087 if test -n "$cf_new_extra_cppflags" ; then
13088
13089         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13090         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13091
13092 fi
13093
13094 cf_add_libs="$LIBS"
13095 # reverse order
13096 cf_add_0lib=
13097 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13098 # filter duplicates
13099 for cf_add_1lib in $cf_add_0lib; do
13100         for cf_add_2lib in $cf_add_libs; do
13101                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13102                         cf_add_1lib=
13103                         break
13104                 fi
13105         done
13106         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13107 done
13108 LIBS="$cf_add_libs"
13109
13110                                                         LIBS="$cf_save_xmu"
13111
13112 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13113
13114 echo "${as_me:-configure}:13114: testing ...before $LIBS ..." 1>&5
13115
13116 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13117 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13118
13119 echo "${as_me:-configure}:13119: testing ...after  $LIBS ..." 1>&5
13120
13121 else
13122         cf_pkgconfig_incs=
13123         cf_pkgconfig_libs=
13124
13125 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13126
13127 echo "${as_me:-configure}:13127: testing ...before $LIBS ..." 1>&5
13128
13129 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13130 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13131
13132 echo "${as_me:-configure}:13132: testing ...after  $LIBS ..." 1>&5
13133
13134 fi
13135
13136         for cf_trim_lib in Xmu Xt X11
13137         do
13138                 case "$LIBS" in
13139                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13140                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13141                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13142
13143 echo "${as_me:-configure}:13143: testing ..trimmed $LIBS ..." 1>&5
13144
13145                         ;;
13146                 esac
13147         done
13148
13149                                         ;;
13150                                 esac
13151                         fi
13152
13153                         break
13154 else
13155         cf_pkgconfig_incs=
13156         cf_pkgconfig_libs=
13157         :
13158 fi
13159
13160         done
13161 fi
13162
13163 if test -z "$cf_x_athena_lib" ; then
13164
13165 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
13166         test -n "$verbose" && echo "    found package Xext" 1>&6
13167
13168 echo "${as_me:-configure}:13168: testing found package Xext ..." 1>&5
13169
13170         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
13171         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
13172         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13173
13174 echo "${as_me:-configure}:13174: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13175
13176         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13177
13178 echo "${as_me:-configure}:13178: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13179
13180 cf_fix_cppflags=no
13181 cf_new_cflags=
13182 cf_new_cppflags=
13183 cf_new_extra_cppflags=
13184
13185 for cf_add_cflags in $cf_pkgconfig_incs
13186 do
13187 case $cf_fix_cppflags in
13188 (no)
13189         case $cf_add_cflags in
13190         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13191                 case $cf_add_cflags in
13192                 (-D*)
13193                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13194
13195                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13196                                 && test -z "${cf_tst_cflags}" \
13197                                 && cf_fix_cppflags=yes
13198
13199                         if test $cf_fix_cppflags = yes ; then
13200
13201         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13202         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13203
13204                                 continue
13205                         elif test "${cf_tst_cflags}" = "\"'" ; then
13206
13207         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13208         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13209
13210                                 continue
13211                         fi
13212                         ;;
13213                 esac
13214                 case "$CPPFLAGS" in
13215                 (*$cf_add_cflags)
13216                         ;;
13217                 (*)
13218                         case $cf_add_cflags in
13219                         (-D*)
13220                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13221
13222 CPPFLAGS=`echo "$CPPFLAGS" | \
13223         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13224                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13225
13226                                 ;;
13227                         esac
13228
13229         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13230         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13231
13232                         ;;
13233                 esac
13234                 ;;
13235         (*)
13236
13237         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13238         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13239
13240                 ;;
13241         esac
13242         ;;
13243 (yes)
13244
13245         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13246         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13247
13248         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13249
13250         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13251                 && test -z "${cf_tst_cflags}" \
13252                 && cf_fix_cppflags=no
13253         ;;
13254 esac
13255 done
13256
13257 if test -n "$cf_new_cflags" ; then
13258
13259         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13260         CFLAGS="${CFLAGS}$cf_new_cflags"
13261
13262 fi
13263
13264 if test -n "$cf_new_cppflags" ; then
13265
13266         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13267         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13268
13269 fi
13270
13271 if test -n "$cf_new_extra_cppflags" ; then
13272
13273         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13274         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13275
13276 fi
13277
13278 cf_add_libs="$LIBS"
13279 # reverse order
13280 cf_add_0lib=
13281 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13282 # filter duplicates
13283 for cf_add_1lib in $cf_add_0lib; do
13284         for cf_add_2lib in $cf_add_libs; do
13285                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13286                         cf_add_1lib=
13287                         break
13288                 fi
13289         done
13290         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13291 done
13292 LIBS="$cf_add_libs"
13293
13294         :
13295 else
13296         cf_pkgconfig_incs=
13297         cf_pkgconfig_libs=
13298
13299         echo "$as_me:13299: checking for XextCreateExtension in -lXext" >&5
13300 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13301 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13302   echo $ECHO_N "(cached) $ECHO_C" >&6
13303 else
13304   ac_check_lib_save_LIBS=$LIBS
13305 LIBS="-lXext  $LIBS"
13306 cat >conftest.$ac_ext <<_ACEOF
13307 #line 13307 "configure"
13308 #include "confdefs.h"
13309
13310 /* Override any gcc2 internal prototype to avoid an error.  */
13311 #ifdef __cplusplus
13312 extern "C"
13313 #endif
13314 /* We use char because int might match the return type of a gcc2
13315    builtin and then its argument prototype would still apply.  */
13316 char XextCreateExtension ();
13317 int
13318 main (void)
13319 {
13320 XextCreateExtension ();
13321   ;
13322   return 0;
13323 }
13324 _ACEOF
13325 rm -f conftest.$ac_objext conftest$ac_exeext
13326 if { (eval echo "$as_me:13326: \"$ac_link\"") >&5
13327   (eval $ac_link) 2>&5
13328   ac_status=$?
13329   echo "$as_me:13329: \$? = $ac_status" >&5
13330   (exit $ac_status); } &&
13331          { ac_try='test -s conftest$ac_exeext'
13332   { (eval echo "$as_me:13332: \"$ac_try\"") >&5
13333   (eval $ac_try) 2>&5
13334   ac_status=$?
13335   echo "$as_me:13335: \$? = $ac_status" >&5
13336   (exit $ac_status); }; }; then
13337   ac_cv_lib_Xext_XextCreateExtension=yes
13338 else
13339   echo "$as_me: failed program was:" >&5
13340 cat conftest.$ac_ext >&5
13341 ac_cv_lib_Xext_XextCreateExtension=no
13342 fi
13343 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13344 LIBS=$ac_check_lib_save_LIBS
13345 fi
13346 echo "$as_me:13346: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13347 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13348 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
13349
13350 cf_add_libs="$LIBS"
13351 # reverse order
13352 cf_add_0lib=
13353 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13354 # filter duplicates
13355 for cf_add_1lib in $cf_add_0lib; do
13356         for cf_add_2lib in $cf_add_libs; do
13357                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13358                         cf_add_1lib=
13359                         break
13360                 fi
13361         done
13362         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13363 done
13364 LIBS="$cf_add_libs"
13365
13366 fi
13367
13368 fi
13369
13370 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13371 # in some cases has installed dummy files in the former, other cases replaced
13372 # it with a link to the new location).  This complicates the configure script.
13373 # Check for that pitfall, and recover using pkg-config
13374 #
13375 # If none of these are set, the configuration is almost certainly broken.
13376 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13377 then
13378
13379 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13380         test -n "$verbose" && echo "    found package x11" 1>&6
13381
13382 echo "${as_me:-configure}:13382: testing found package x11 ..." 1>&5
13383
13384         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13385         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13386         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13387
13388 echo "${as_me:-configure}:13388: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13389
13390         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13391
13392 echo "${as_me:-configure}:13392: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13393
13394 cf_fix_cppflags=no
13395 cf_new_cflags=
13396 cf_new_cppflags=
13397 cf_new_extra_cppflags=
13398
13399 for cf_add_cflags in $cf_pkgconfig_incs
13400 do
13401 case $cf_fix_cppflags in
13402 (no)
13403         case $cf_add_cflags in
13404         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13405                 case $cf_add_cflags in
13406                 (-D*)
13407                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13408
13409                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13410                                 && test -z "${cf_tst_cflags}" \
13411                                 && cf_fix_cppflags=yes
13412
13413                         if test $cf_fix_cppflags = yes ; then
13414
13415         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13416         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13417
13418                                 continue
13419                         elif test "${cf_tst_cflags}" = "\"'" ; then
13420
13421         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13422         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13423
13424                                 continue
13425                         fi
13426                         ;;
13427                 esac
13428                 case "$CPPFLAGS" in
13429                 (*$cf_add_cflags)
13430                         ;;
13431                 (*)
13432                         case $cf_add_cflags in
13433                         (-D*)
13434                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13435
13436 CPPFLAGS=`echo "$CPPFLAGS" | \
13437         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13438                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13439
13440                                 ;;
13441                         esac
13442
13443         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13444         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13445
13446                         ;;
13447                 esac
13448                 ;;
13449         (*)
13450
13451         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13452         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13453
13454                 ;;
13455         esac
13456         ;;
13457 (yes)
13458
13459         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13460         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13461
13462         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13463
13464         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13465                 && test -z "${cf_tst_cflags}" \
13466                 && cf_fix_cppflags=no
13467         ;;
13468 esac
13469 done
13470
13471 if test -n "$cf_new_cflags" ; then
13472
13473         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13474         CFLAGS="${CFLAGS}$cf_new_cflags"
13475
13476 fi
13477
13478 if test -n "$cf_new_cppflags" ; then
13479
13480         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13481         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13482
13483 fi
13484
13485 if test -n "$cf_new_extra_cppflags" ; then
13486
13487         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13488         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13489
13490 fi
13491
13492 cf_add_libs="$LIBS"
13493 # reverse order
13494 cf_add_0lib=
13495 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13496 # filter duplicates
13497 for cf_add_1lib in $cf_add_0lib; do
13498         for cf_add_2lib in $cf_add_libs; do
13499                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13500                         cf_add_1lib=
13501                         break
13502                 fi
13503         done
13504         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13505 done
13506 LIBS="$cf_add_libs"
13507
13508         :
13509 else
13510         cf_pkgconfig_incs=
13511         cf_pkgconfig_libs=
13512         { echo "$as_me:13512: WARNING: unable to find X11 library" >&5
13513 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13514 fi
13515
13516 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13517         test -n "$verbose" && echo "    found package ice" 1>&6
13518
13519 echo "${as_me:-configure}:13519: testing found package ice ..." 1>&5
13520
13521         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13522         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13523         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13524
13525 echo "${as_me:-configure}:13525: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13526
13527         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13528
13529 echo "${as_me:-configure}:13529: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13530
13531 cf_fix_cppflags=no
13532 cf_new_cflags=
13533 cf_new_cppflags=
13534 cf_new_extra_cppflags=
13535
13536 for cf_add_cflags in $cf_pkgconfig_incs
13537 do
13538 case $cf_fix_cppflags in
13539 (no)
13540         case $cf_add_cflags in
13541         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13542                 case $cf_add_cflags in
13543                 (-D*)
13544                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13545
13546                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13547                                 && test -z "${cf_tst_cflags}" \
13548                                 && cf_fix_cppflags=yes
13549
13550                         if test $cf_fix_cppflags = yes ; then
13551
13552         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13553         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13554
13555                                 continue
13556                         elif test "${cf_tst_cflags}" = "\"'" ; then
13557
13558         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13559         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13560
13561                                 continue
13562                         fi
13563                         ;;
13564                 esac
13565                 case "$CPPFLAGS" in
13566                 (*$cf_add_cflags)
13567                         ;;
13568                 (*)
13569                         case $cf_add_cflags in
13570                         (-D*)
13571                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13572
13573 CPPFLAGS=`echo "$CPPFLAGS" | \
13574         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13575                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13576
13577                                 ;;
13578                         esac
13579
13580         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13581         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13582
13583                         ;;
13584                 esac
13585                 ;;
13586         (*)
13587
13588         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13589         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13590
13591                 ;;
13592         esac
13593         ;;
13594 (yes)
13595
13596         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13597         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13598
13599         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13600
13601         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13602                 && test -z "${cf_tst_cflags}" \
13603                 && cf_fix_cppflags=no
13604         ;;
13605 esac
13606 done
13607
13608 if test -n "$cf_new_cflags" ; then
13609
13610         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13611         CFLAGS="${CFLAGS}$cf_new_cflags"
13612
13613 fi
13614
13615 if test -n "$cf_new_cppflags" ; then
13616
13617         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13618         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13619
13620 fi
13621
13622 if test -n "$cf_new_extra_cppflags" ; then
13623
13624         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13625         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13626
13627 fi
13628
13629 cf_add_libs="$LIBS"
13630 # reverse order
13631 cf_add_0lib=
13632 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13633 # filter duplicates
13634 for cf_add_1lib in $cf_add_0lib; do
13635         for cf_add_2lib in $cf_add_libs; do
13636                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13637                         cf_add_1lib=
13638                         break
13639                 fi
13640         done
13641         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13642 done
13643 LIBS="$cf_add_libs"
13644
13645         :
13646 else
13647         cf_pkgconfig_incs=
13648         cf_pkgconfig_libs=
13649         { echo "$as_me:13649: WARNING: unable to find ICE library" >&5
13650 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13651 fi
13652
13653 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13654         test -n "$verbose" && echo "    found package sm" 1>&6
13655
13656 echo "${as_me:-configure}:13656: testing found package sm ..." 1>&5
13657
13658         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13659         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13660         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13661
13662 echo "${as_me:-configure}:13662: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13663
13664         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13665
13666 echo "${as_me:-configure}:13666: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13667
13668 cf_fix_cppflags=no
13669 cf_new_cflags=
13670 cf_new_cppflags=
13671 cf_new_extra_cppflags=
13672
13673 for cf_add_cflags in $cf_pkgconfig_incs
13674 do
13675 case $cf_fix_cppflags in
13676 (no)
13677         case $cf_add_cflags in
13678         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13679                 case $cf_add_cflags in
13680                 (-D*)
13681                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13682
13683                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13684                                 && test -z "${cf_tst_cflags}" \
13685                                 && cf_fix_cppflags=yes
13686
13687                         if test $cf_fix_cppflags = yes ; then
13688
13689         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13690         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13691
13692                                 continue
13693                         elif test "${cf_tst_cflags}" = "\"'" ; then
13694
13695         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13696         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13697
13698                                 continue
13699                         fi
13700                         ;;
13701                 esac
13702                 case "$CPPFLAGS" in
13703                 (*$cf_add_cflags)
13704                         ;;
13705                 (*)
13706                         case $cf_add_cflags in
13707                         (-D*)
13708                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13709
13710 CPPFLAGS=`echo "$CPPFLAGS" | \
13711         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13712                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13713
13714                                 ;;
13715                         esac
13716
13717         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13718         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13719
13720                         ;;
13721                 esac
13722                 ;;
13723         (*)
13724
13725         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13726         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13727
13728                 ;;
13729         esac
13730         ;;
13731 (yes)
13732
13733         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13734         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13735
13736         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13737
13738         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13739                 && test -z "${cf_tst_cflags}" \
13740                 && cf_fix_cppflags=no
13741         ;;
13742 esac
13743 done
13744
13745 if test -n "$cf_new_cflags" ; then
13746
13747         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13748         CFLAGS="${CFLAGS}$cf_new_cflags"
13749
13750 fi
13751
13752 if test -n "$cf_new_cppflags" ; then
13753
13754         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13755         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13756
13757 fi
13758
13759 if test -n "$cf_new_extra_cppflags" ; then
13760
13761         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13762         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13763
13764 fi
13765
13766 cf_add_libs="$LIBS"
13767 # reverse order
13768 cf_add_0lib=
13769 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13770 # filter duplicates
13771 for cf_add_1lib in $cf_add_0lib; do
13772         for cf_add_2lib in $cf_add_libs; do
13773                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13774                         cf_add_1lib=
13775                         break
13776                 fi
13777         done
13778         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13779 done
13780 LIBS="$cf_add_libs"
13781
13782         :
13783 else
13784         cf_pkgconfig_incs=
13785         cf_pkgconfig_libs=
13786         { echo "$as_me:13786: WARNING: unable to find SM library" >&5
13787 echo "$as_me: WARNING: unable to find SM library" >&2;}
13788 fi
13789
13790 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13791         test -n "$verbose" && echo "    found package xt" 1>&6
13792
13793 echo "${as_me:-configure}:13793: testing found package xt ..." 1>&5
13794
13795         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13796         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13797         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13798
13799 echo "${as_me:-configure}:13799: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13800
13801         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13802
13803 echo "${as_me:-configure}:13803: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13804
13805 cf_fix_cppflags=no
13806 cf_new_cflags=
13807 cf_new_cppflags=
13808 cf_new_extra_cppflags=
13809
13810 for cf_add_cflags in $cf_pkgconfig_incs
13811 do
13812 case $cf_fix_cppflags in
13813 (no)
13814         case $cf_add_cflags in
13815         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13816                 case $cf_add_cflags in
13817                 (-D*)
13818                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13819
13820                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13821                                 && test -z "${cf_tst_cflags}" \
13822                                 && cf_fix_cppflags=yes
13823
13824                         if test $cf_fix_cppflags = yes ; then
13825
13826         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13827         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13828
13829                                 continue
13830                         elif test "${cf_tst_cflags}" = "\"'" ; then
13831
13832         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13833         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13834
13835                                 continue
13836                         fi
13837                         ;;
13838                 esac
13839                 case "$CPPFLAGS" in
13840                 (*$cf_add_cflags)
13841                         ;;
13842                 (*)
13843                         case $cf_add_cflags in
13844                         (-D*)
13845                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13846
13847 CPPFLAGS=`echo "$CPPFLAGS" | \
13848         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13849                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13850
13851                                 ;;
13852                         esac
13853
13854         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13855         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13856
13857                         ;;
13858                 esac
13859                 ;;
13860         (*)
13861
13862         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13863         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13864
13865                 ;;
13866         esac
13867         ;;
13868 (yes)
13869
13870         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13871         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13872
13873         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13874
13875         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13876                 && test -z "${cf_tst_cflags}" \
13877                 && cf_fix_cppflags=no
13878         ;;
13879 esac
13880 done
13881
13882 if test -n "$cf_new_cflags" ; then
13883
13884         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13885         CFLAGS="${CFLAGS}$cf_new_cflags"
13886
13887 fi
13888
13889 if test -n "$cf_new_cppflags" ; then
13890
13891         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13892         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13893
13894 fi
13895
13896 if test -n "$cf_new_extra_cppflags" ; then
13897
13898         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13899         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13900
13901 fi
13902
13903 cf_add_libs="$LIBS"
13904 # reverse order
13905 cf_add_0lib=
13906 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13907 # filter duplicates
13908 for cf_add_1lib in $cf_add_0lib; do
13909         for cf_add_2lib in $cf_add_libs; do
13910                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13911                         cf_add_1lib=
13912                         break
13913                 fi
13914         done
13915         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13916 done
13917 LIBS="$cf_add_libs"
13918
13919         :
13920 else
13921         cf_pkgconfig_incs=
13922         cf_pkgconfig_libs=
13923         { echo "$as_me:13923: WARNING: unable to find Xt library" >&5
13924 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13925 fi
13926
13927 else
13928         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13929 fi
13930
13931 cf_have_X_LIBS=no
13932
13933 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13934         test -n "$verbose" && echo "    found package xt" 1>&6
13935
13936 echo "${as_me:-configure}:13936: testing found package xt ..." 1>&5
13937
13938         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13939         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13940         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13941
13942 echo "${as_me:-configure}:13942: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13943
13944         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13945
13946 echo "${as_me:-configure}:13946: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13947
13948 cf_fix_cppflags=no
13949 cf_new_cflags=
13950 cf_new_cppflags=
13951 cf_new_extra_cppflags=
13952
13953 for cf_add_cflags in $cf_pkgconfig_incs
13954 do
13955 case $cf_fix_cppflags in
13956 (no)
13957         case $cf_add_cflags in
13958         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13959                 case $cf_add_cflags in
13960                 (-D*)
13961                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13962
13963                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13964                                 && test -z "${cf_tst_cflags}" \
13965                                 && cf_fix_cppflags=yes
13966
13967                         if test $cf_fix_cppflags = yes ; then
13968
13969         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13970         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13971
13972                                 continue
13973                         elif test "${cf_tst_cflags}" = "\"'" ; then
13974
13975         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13976         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13977
13978                                 continue
13979                         fi
13980                         ;;
13981                 esac
13982                 case "$CPPFLAGS" in
13983                 (*$cf_add_cflags)
13984                         ;;
13985                 (*)
13986                         case $cf_add_cflags in
13987                         (-D*)
13988                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13989
13990 CPPFLAGS=`echo "$CPPFLAGS" | \
13991         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13992                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13993
13994                                 ;;
13995                         esac
13996
13997         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13998         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13999
14000                         ;;
14001                 esac
14002                 ;;
14003         (*)
14004
14005         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14006         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14007
14008                 ;;
14009         esac
14010         ;;
14011 (yes)
14012
14013         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14014         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14015
14016         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14017
14018         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14019                 && test -z "${cf_tst_cflags}" \
14020                 && cf_fix_cppflags=no
14021         ;;
14022 esac
14023 done
14024
14025 if test -n "$cf_new_cflags" ; then
14026
14027         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14028         CFLAGS="${CFLAGS}$cf_new_cflags"
14029
14030 fi
14031
14032 if test -n "$cf_new_cppflags" ; then
14033
14034         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14035         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14036
14037 fi
14038
14039 if test -n "$cf_new_extra_cppflags" ; then
14040
14041         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14042         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14043
14044 fi
14045
14046 cf_add_libs="$LIBS"
14047 # reverse order
14048 cf_add_0lib=
14049 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14050 # filter duplicates
14051 for cf_add_1lib in $cf_add_0lib; do
14052         for cf_add_2lib in $cf_add_libs; do
14053                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14054                         cf_add_1lib=
14055                         break
14056                 fi
14057         done
14058         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14059 done
14060 LIBS="$cf_add_libs"
14061
14062         case "x$LIBS" in
14063         (*-lX11*)
14064                 ;;
14065         (*)
14066 # we have an "xt" package, but it may omit Xt's dependency on X11
14067 echo "$as_me:14067: checking for usable X dependency" >&5
14068 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14069 if test "${cf_cv_xt_x11_compat+set}" = set; then
14070   echo $ECHO_N "(cached) $ECHO_C" >&6
14071 else
14072
14073 cat >conftest.$ac_ext <<_ACEOF
14074 #line 14074 "configure"
14075 #include "confdefs.h"
14076
14077 #include <X11/Xlib.h>
14078
14079 int
14080 main (void)
14081 {
14082
14083         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14084         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14085         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14086         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14087
14088   ;
14089   return 0;
14090 }
14091 _ACEOF
14092 rm -f conftest.$ac_objext conftest$ac_exeext
14093 if { (eval echo "$as_me:14093: \"$ac_link\"") >&5
14094   (eval $ac_link) 2>&5
14095   ac_status=$?
14096   echo "$as_me:14096: \$? = $ac_status" >&5
14097   (exit $ac_status); } &&
14098          { ac_try='test -s conftest$ac_exeext'
14099   { (eval echo "$as_me:14099: \"$ac_try\"") >&5
14100   (eval $ac_try) 2>&5
14101   ac_status=$?
14102   echo "$as_me:14102: \$? = $ac_status" >&5
14103   (exit $ac_status); }; }; then
14104   cf_cv_xt_x11_compat=yes
14105 else
14106   echo "$as_me: failed program was:" >&5
14107 cat conftest.$ac_ext >&5
14108 cf_cv_xt_x11_compat=no
14109 fi
14110 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14111 fi
14112 echo "$as_me:14112: result: $cf_cv_xt_x11_compat" >&5
14113 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14114                 if test "$cf_cv_xt_x11_compat" = no
14115                 then
14116                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14117
14118 echo "${as_me:-configure}:14118: testing work around broken X11 dependency ..." 1>&5
14119
14120                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14121
14122 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
14123         test -n "$verbose" && echo "    found package x11" 1>&6
14124
14125 echo "${as_me:-configure}:14125: testing found package x11 ..." 1>&5
14126
14127         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
14128         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
14129         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14130
14131 echo "${as_me:-configure}:14131: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14132
14133         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14134
14135 echo "${as_me:-configure}:14135: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14136
14137 cf_fix_cppflags=no
14138 cf_new_cflags=
14139 cf_new_cppflags=
14140 cf_new_extra_cppflags=
14141
14142 for cf_add_cflags in $cf_pkgconfig_incs
14143 do
14144 case $cf_fix_cppflags in
14145 (no)
14146         case $cf_add_cflags in
14147         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14148                 case $cf_add_cflags in
14149                 (-D*)
14150                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14151
14152                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14153                                 && test -z "${cf_tst_cflags}" \
14154                                 && cf_fix_cppflags=yes
14155
14156                         if test $cf_fix_cppflags = yes ; then
14157
14158         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14159         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14160
14161                                 continue
14162                         elif test "${cf_tst_cflags}" = "\"'" ; then
14163
14164         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14165         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14166
14167                                 continue
14168                         fi
14169                         ;;
14170                 esac
14171                 case "$CPPFLAGS" in
14172                 (*$cf_add_cflags)
14173                         ;;
14174                 (*)
14175                         case $cf_add_cflags in
14176                         (-D*)
14177                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14178
14179 CPPFLAGS=`echo "$CPPFLAGS" | \
14180         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14181                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14182
14183                                 ;;
14184                         esac
14185
14186         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14187         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14188
14189                         ;;
14190                 esac
14191                 ;;
14192         (*)
14193
14194         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14195         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14196
14197                 ;;
14198         esac
14199         ;;
14200 (yes)
14201
14202         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14203         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14204
14205         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14206
14207         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14208                 && test -z "${cf_tst_cflags}" \
14209                 && cf_fix_cppflags=no
14210         ;;
14211 esac
14212 done
14213
14214 if test -n "$cf_new_cflags" ; then
14215
14216         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14217         CFLAGS="${CFLAGS}$cf_new_cflags"
14218
14219 fi
14220
14221 if test -n "$cf_new_cppflags" ; then
14222
14223         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14224         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14225
14226 fi
14227
14228 if test -n "$cf_new_extra_cppflags" ; then
14229
14230         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14231         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14232
14233 fi
14234
14235 cf_add_libs="$LIBS"
14236 # reverse order
14237 cf_add_0lib=
14238 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14239 # filter duplicates
14240 for cf_add_1lib in $cf_add_0lib; do
14241         for cf_add_2lib in $cf_add_libs; do
14242                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14243                         cf_add_1lib=
14244                         break
14245                 fi
14246         done
14247         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14248 done
14249 LIBS="$cf_add_libs"
14250
14251         :
14252 else
14253         cf_pkgconfig_incs=
14254         cf_pkgconfig_libs=
14255
14256 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14257
14258 echo "${as_me:-configure}:14258: testing ...before $LIBS ..." 1>&5
14259
14260 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14261 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14262
14263 echo "${as_me:-configure}:14263: testing ...after  $LIBS ..." 1>&5
14264
14265 fi
14266
14267                 fi
14268                 ;;
14269         esac
14270
14271 echo "$as_me:14271: checking for usable X Toolkit package" >&5
14272 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14273 if test "${cf_cv_xt_ice_compat+set}" = set; then
14274   echo $ECHO_N "(cached) $ECHO_C" >&6
14275 else
14276
14277 cat >conftest.$ac_ext <<_ACEOF
14278 #line 14278 "configure"
14279 #include "confdefs.h"
14280
14281 #include <X11/Shell.h>
14282
14283 int
14284 main (void)
14285 {
14286 int num = IceConnectionNumber(0); (void) num
14287
14288   ;
14289   return 0;
14290 }
14291 _ACEOF
14292 rm -f conftest.$ac_objext conftest$ac_exeext
14293 if { (eval echo "$as_me:14293: \"$ac_link\"") >&5
14294   (eval $ac_link) 2>&5
14295   ac_status=$?
14296   echo "$as_me:14296: \$? = $ac_status" >&5
14297   (exit $ac_status); } &&
14298          { ac_try='test -s conftest$ac_exeext'
14299   { (eval echo "$as_me:14299: \"$ac_try\"") >&5
14300   (eval $ac_try) 2>&5
14301   ac_status=$?
14302   echo "$as_me:14302: \$? = $ac_status" >&5
14303   (exit $ac_status); }; }; then
14304   cf_cv_xt_ice_compat=yes
14305 else
14306   echo "$as_me: failed program was:" >&5
14307 cat conftest.$ac_ext >&5
14308 cf_cv_xt_ice_compat=no
14309 fi
14310 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14311 fi
14312 echo "$as_me:14312: result: $cf_cv_xt_ice_compat" >&5
14313 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14314
14315         if test "$cf_cv_xt_ice_compat" = no
14316         then
14317                 # workaround for broken ".pc" files used for X Toolkit.
14318                 case "x$X_PRE_LIBS" in
14319                 (*-lICE*)
14320                         case "x$LIBS" in
14321                         (*-lICE*)
14322                                 ;;
14323                         (*)
14324                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14325
14326 echo "${as_me:-configure}:14326: testing work around broken ICE dependency ..." 1>&5
14327
14328 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
14329         test -n "$verbose" && echo "    found package ice" 1>&6
14330
14331 echo "${as_me:-configure}:14331: testing found package ice ..." 1>&5
14332
14333         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
14334         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
14335         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14336
14337 echo "${as_me:-configure}:14337: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14338
14339         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14340
14341 echo "${as_me:-configure}:14341: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14342
14343 cf_fix_cppflags=no
14344 cf_new_cflags=
14345 cf_new_cppflags=
14346 cf_new_extra_cppflags=
14347
14348 for cf_add_cflags in $cf_pkgconfig_incs
14349 do
14350 case $cf_fix_cppflags in
14351 (no)
14352         case $cf_add_cflags in
14353         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14354                 case $cf_add_cflags in
14355                 (-D*)
14356                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14357
14358                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14359                                 && test -z "${cf_tst_cflags}" \
14360                                 && cf_fix_cppflags=yes
14361
14362                         if test $cf_fix_cppflags = yes ; then
14363
14364         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14365         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14366
14367                                 continue
14368                         elif test "${cf_tst_cflags}" = "\"'" ; then
14369
14370         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14371         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14372
14373                                 continue
14374                         fi
14375                         ;;
14376                 esac
14377                 case "$CPPFLAGS" in
14378                 (*$cf_add_cflags)
14379                         ;;
14380                 (*)
14381                         case $cf_add_cflags in
14382                         (-D*)
14383                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14384
14385 CPPFLAGS=`echo "$CPPFLAGS" | \
14386         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14387                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14388
14389                                 ;;
14390                         esac
14391
14392         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14393         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14394
14395                         ;;
14396                 esac
14397                 ;;
14398         (*)
14399
14400         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14401         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14402
14403                 ;;
14404         esac
14405         ;;
14406 (yes)
14407
14408         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14409         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14410
14411         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14412
14413         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14414                 && test -z "${cf_tst_cflags}" \
14415                 && cf_fix_cppflags=no
14416         ;;
14417 esac
14418 done
14419
14420 if test -n "$cf_new_cflags" ; then
14421
14422         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14423         CFLAGS="${CFLAGS}$cf_new_cflags"
14424
14425 fi
14426
14427 if test -n "$cf_new_cppflags" ; then
14428
14429         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14430         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14431
14432 fi
14433
14434 if test -n "$cf_new_extra_cppflags" ; then
14435
14436         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14437         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14438
14439 fi
14440
14441 cf_add_libs="$LIBS"
14442 # reverse order
14443 cf_add_0lib=
14444 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14445 # filter duplicates
14446 for cf_add_1lib in $cf_add_0lib; do
14447         for cf_add_2lib in $cf_add_libs; do
14448                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14449                         cf_add_1lib=
14450                         break
14451                 fi
14452         done
14453         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14454 done
14455 LIBS="$cf_add_libs"
14456
14457 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
14458         test -n "$verbose" && echo "    found package sm" 1>&6
14459
14460 echo "${as_me:-configure}:14460: testing found package sm ..." 1>&5
14461
14462         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
14463         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
14464         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14465
14466 echo "${as_me:-configure}:14466: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14467
14468         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14469
14470 echo "${as_me:-configure}:14470: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14471
14472 cf_fix_cppflags=no
14473 cf_new_cflags=
14474 cf_new_cppflags=
14475 cf_new_extra_cppflags=
14476
14477 for cf_add_cflags in $cf_pkgconfig_incs
14478 do
14479 case $cf_fix_cppflags in
14480 (no)
14481         case $cf_add_cflags in
14482         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14483                 case $cf_add_cflags in
14484                 (-D*)
14485                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14486
14487                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14488                                 && test -z "${cf_tst_cflags}" \
14489                                 && cf_fix_cppflags=yes
14490
14491                         if test $cf_fix_cppflags = yes ; then
14492
14493         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14494         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14495
14496                                 continue
14497                         elif test "${cf_tst_cflags}" = "\"'" ; then
14498
14499         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14500         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14501
14502                                 continue
14503                         fi
14504                         ;;
14505                 esac
14506                 case "$CPPFLAGS" in
14507                 (*$cf_add_cflags)
14508                         ;;
14509                 (*)
14510                         case $cf_add_cflags in
14511                         (-D*)
14512                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14513
14514 CPPFLAGS=`echo "$CPPFLAGS" | \
14515         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14516                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14517
14518                                 ;;
14519                         esac
14520
14521         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14522         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14523
14524                         ;;
14525                 esac
14526                 ;;
14527         (*)
14528
14529         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14530         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14531
14532                 ;;
14533         esac
14534         ;;
14535 (yes)
14536
14537         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14538         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14539
14540         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14541
14542         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14543                 && test -z "${cf_tst_cflags}" \
14544                 && cf_fix_cppflags=no
14545         ;;
14546 esac
14547 done
14548
14549 if test -n "$cf_new_cflags" ; then
14550
14551         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14552         CFLAGS="${CFLAGS}$cf_new_cflags"
14553
14554 fi
14555
14556 if test -n "$cf_new_cppflags" ; then
14557
14558         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14559         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14560
14561 fi
14562
14563 if test -n "$cf_new_extra_cppflags" ; then
14564
14565         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14566         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14567
14568 fi
14569
14570 cf_add_libs="$LIBS"
14571 # reverse order
14572 cf_add_0lib=
14573 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14574 # filter duplicates
14575 for cf_add_1lib in $cf_add_0lib; do
14576         for cf_add_2lib in $cf_add_libs; do
14577                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14578                         cf_add_1lib=
14579                         break
14580                 fi
14581         done
14582         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14583 done
14584 LIBS="$cf_add_libs"
14585
14586         :
14587 else
14588         cf_pkgconfig_incs=
14589         cf_pkgconfig_libs=
14590         :
14591 fi
14592
14593 else
14594         cf_pkgconfig_incs=
14595         cf_pkgconfig_libs=
14596
14597 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14598
14599 echo "${as_me:-configure}:14599: testing ...before $LIBS ..." 1>&5
14600
14601 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14602 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14603
14604 echo "${as_me:-configure}:14604: testing ...after  $LIBS ..." 1>&5
14605
14606 fi
14607
14608                                 ;;
14609                         esac
14610                         ;;
14611                 esac
14612         fi
14613
14614         cf_have_X_LIBS=yes
14615
14616 else
14617         cf_pkgconfig_incs=
14618         cf_pkgconfig_libs=
14619
14620         LDFLAGS="$X_LIBS $LDFLAGS"
14621
14622 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14623
14624 echo "${as_me:-configure}:14624: testing checking additions to CFLAGS ..." 1>&5
14625
14626 cf_check_cflags="$CFLAGS"
14627 cf_check_cppflags="$CPPFLAGS"
14628
14629 cf_fix_cppflags=no
14630 cf_new_cflags=
14631 cf_new_cppflags=
14632 cf_new_extra_cppflags=
14633
14634 for cf_add_cflags in $X_CFLAGS
14635 do
14636 case $cf_fix_cppflags in
14637 (no)
14638         case $cf_add_cflags in
14639         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14640                 case $cf_add_cflags in
14641                 (-D*)
14642                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14643
14644                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14645                                 && test -z "${cf_tst_cflags}" \
14646                                 && cf_fix_cppflags=yes
14647
14648                         if test $cf_fix_cppflags = yes ; then
14649
14650         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14651         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14652
14653                                 continue
14654                         elif test "${cf_tst_cflags}" = "\"'" ; then
14655
14656         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14657         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14658
14659                                 continue
14660                         fi
14661                         ;;
14662                 esac
14663                 case "$CPPFLAGS" in
14664                 (*$cf_add_cflags)
14665                         ;;
14666                 (*)
14667                         case $cf_add_cflags in
14668                         (-D*)
14669                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14670
14671 CPPFLAGS=`echo "$CPPFLAGS" | \
14672         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14673                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14674
14675                                 ;;
14676                         esac
14677
14678         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14679         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14680
14681                         ;;
14682                 esac
14683                 ;;
14684         (*)
14685
14686         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14687         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14688
14689                 ;;
14690         esac
14691         ;;
14692 (yes)
14693
14694         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14695         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14696
14697         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14698
14699         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14700                 && test -z "${cf_tst_cflags}" \
14701                 && cf_fix_cppflags=no
14702         ;;
14703 esac
14704 done
14705
14706 if test -n "$cf_new_cflags" ; then
14707         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14708
14709 echo "${as_me:-configure}:14709: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14710
14711         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14712         CFLAGS="${CFLAGS}$cf_new_cflags"
14713
14714 fi
14715
14716 if test -n "$cf_new_cppflags" ; then
14717         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14718
14719 echo "${as_me:-configure}:14719: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14720
14721         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14722         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14723
14724 fi
14725
14726 if test -n "$cf_new_extra_cppflags" ; then
14727         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14728
14729 echo "${as_me:-configure}:14729: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14730
14731         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14732         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14733
14734 fi
14735
14736 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14737 cat >conftest.$ac_ext <<_ACEOF
14738 #line 14738 "configure"
14739 #include "confdefs.h"
14740 #include <stdio.h>
14741 int
14742 main (void)
14743 {
14744 printf("Hello world");
14745   ;
14746   return 0;
14747 }
14748 _ACEOF
14749 rm -f conftest.$ac_objext conftest$ac_exeext
14750 if { (eval echo "$as_me:14750: \"$ac_link\"") >&5
14751   (eval $ac_link) 2>&5
14752   ac_status=$?
14753   echo "$as_me:14753: \$? = $ac_status" >&5
14754   (exit $ac_status); } &&
14755          { ac_try='test -s conftest$ac_exeext'
14756   { (eval echo "$as_me:14756: \"$ac_try\"") >&5
14757   (eval $ac_try) 2>&5
14758   ac_status=$?
14759   echo "$as_me:14759: \$? = $ac_status" >&5
14760   (exit $ac_status); }; }; then
14761   :
14762 else
14763   echo "$as_me: failed program was:" >&5
14764 cat conftest.$ac_ext >&5
14765 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14766
14767 echo "${as_me:-configure}:14767: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14768
14769          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14770                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14771
14772 echo "${as_me:-configure}:14772: testing but keeping change to \$CPPFLAGS ..." 1>&5
14773
14774          fi
14775          CFLAGS="$cf_check_flags"
14776 fi
14777 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14778 fi
14779
14780         echo "$as_me:14780: checking for XOpenDisplay" >&5
14781 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14782 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14783   echo $ECHO_N "(cached) $ECHO_C" >&6
14784 else
14785   cat >conftest.$ac_ext <<_ACEOF
14786 #line 14786 "configure"
14787 #include "confdefs.h"
14788 #define XOpenDisplay autoconf_temporary
14789 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14790 #undef XOpenDisplay
14791
14792 #ifdef __cplusplus
14793 extern "C"
14794 #endif
14795
14796 /* We use char because int might match the return type of a gcc2
14797    builtin and then its argument prototype would still apply.  */
14798 char XOpenDisplay (void);
14799
14800 int
14801 main (void)
14802 {
14803
14804 /* The GNU C library defines stubs for functions which it implements
14805     to always fail with ENOSYS.  Some functions are actually named
14806     something starting with __ and the normal name is an alias.  */
14807 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14808 #error found stub for XOpenDisplay
14809 #endif
14810
14811         return XOpenDisplay ();
14812   ;
14813   return 0;
14814 }
14815 _ACEOF
14816 rm -f conftest.$ac_objext conftest$ac_exeext
14817 if { (eval echo "$as_me:14817: \"$ac_link\"") >&5
14818   (eval $ac_link) 2>&5
14819   ac_status=$?
14820   echo "$as_me:14820: \$? = $ac_status" >&5
14821   (exit $ac_status); } &&
14822          { ac_try='test -s conftest$ac_exeext'
14823   { (eval echo "$as_me:14823: \"$ac_try\"") >&5
14824   (eval $ac_try) 2>&5
14825   ac_status=$?
14826   echo "$as_me:14826: \$? = $ac_status" >&5
14827   (exit $ac_status); }; }; then
14828   ac_cv_func_XOpenDisplay=yes
14829 else
14830   echo "$as_me: failed program was:" >&5
14831 cat conftest.$ac_ext >&5
14832 ac_cv_func_XOpenDisplay=no
14833 fi
14834 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14835 fi
14836 echo "$as_me:14836: result: $ac_cv_func_XOpenDisplay" >&5
14837 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14838 if test $ac_cv_func_XOpenDisplay = yes; then
14839   :
14840 else
14841
14842         echo "$as_me:14842: checking for XOpenDisplay in -lX11" >&5
14843 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14844 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14845   echo $ECHO_N "(cached) $ECHO_C" >&6
14846 else
14847   ac_check_lib_save_LIBS=$LIBS
14848 LIBS="-lX11  $LIBS"
14849 cat >conftest.$ac_ext <<_ACEOF
14850 #line 14850 "configure"
14851 #include "confdefs.h"
14852
14853 /* Override any gcc2 internal prototype to avoid an error.  */
14854 #ifdef __cplusplus
14855 extern "C"
14856 #endif
14857 /* We use char because int might match the return type of a gcc2
14858    builtin and then its argument prototype would still apply.  */
14859 char XOpenDisplay ();
14860 int
14861 main (void)
14862 {
14863 XOpenDisplay ();
14864   ;
14865   return 0;
14866 }
14867 _ACEOF
14868 rm -f conftest.$ac_objext conftest$ac_exeext
14869 if { (eval echo "$as_me:14869: \"$ac_link\"") >&5
14870   (eval $ac_link) 2>&5
14871   ac_status=$?
14872   echo "$as_me:14872: \$? = $ac_status" >&5
14873   (exit $ac_status); } &&
14874          { ac_try='test -s conftest$ac_exeext'
14875   { (eval echo "$as_me:14875: \"$ac_try\"") >&5
14876   (eval $ac_try) 2>&5
14877   ac_status=$?
14878   echo "$as_me:14878: \$? = $ac_status" >&5
14879   (exit $ac_status); }; }; then
14880   ac_cv_lib_X11_XOpenDisplay=yes
14881 else
14882   echo "$as_me: failed program was:" >&5
14883 cat conftest.$ac_ext >&5
14884 ac_cv_lib_X11_XOpenDisplay=no
14885 fi
14886 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14887 LIBS=$ac_check_lib_save_LIBS
14888 fi
14889 echo "$as_me:14889: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14890 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14891 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14892
14893 cf_add_libs="$LIBS"
14894 # reverse order
14895 cf_add_0lib=
14896 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14897 # filter duplicates
14898 for cf_add_1lib in $cf_add_0lib; do
14899         for cf_add_2lib in $cf_add_libs; do
14900                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14901                         cf_add_1lib=
14902                         break
14903                 fi
14904         done
14905         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14906 done
14907 LIBS="$cf_add_libs"
14908
14909 fi
14910
14911 fi
14912
14913         echo "$as_me:14913: checking for XtAppInitialize" >&5
14914 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14915 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14916   echo $ECHO_N "(cached) $ECHO_C" >&6
14917 else
14918   cat >conftest.$ac_ext <<_ACEOF
14919 #line 14919 "configure"
14920 #include "confdefs.h"
14921 #define XtAppInitialize autoconf_temporary
14922 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14923 #undef XtAppInitialize
14924
14925 #ifdef __cplusplus
14926 extern "C"
14927 #endif
14928
14929 /* We use char because int might match the return type of a gcc2
14930    builtin and then its argument prototype would still apply.  */
14931 char XtAppInitialize (void);
14932
14933 int
14934 main (void)
14935 {
14936
14937 /* The GNU C library defines stubs for functions which it implements
14938     to always fail with ENOSYS.  Some functions are actually named
14939     something starting with __ and the normal name is an alias.  */
14940 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14941 #error found stub for XtAppInitialize
14942 #endif
14943
14944         return XtAppInitialize ();
14945   ;
14946   return 0;
14947 }
14948 _ACEOF
14949 rm -f conftest.$ac_objext conftest$ac_exeext
14950 if { (eval echo "$as_me:14950: \"$ac_link\"") >&5
14951   (eval $ac_link) 2>&5
14952   ac_status=$?
14953   echo "$as_me:14953: \$? = $ac_status" >&5
14954   (exit $ac_status); } &&
14955          { ac_try='test -s conftest$ac_exeext'
14956   { (eval echo "$as_me:14956: \"$ac_try\"") >&5
14957   (eval $ac_try) 2>&5
14958   ac_status=$?
14959   echo "$as_me:14959: \$? = $ac_status" >&5
14960   (exit $ac_status); }; }; then
14961   ac_cv_func_XtAppInitialize=yes
14962 else
14963   echo "$as_me: failed program was:" >&5
14964 cat conftest.$ac_ext >&5
14965 ac_cv_func_XtAppInitialize=no
14966 fi
14967 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14968 fi
14969 echo "$as_me:14969: result: $ac_cv_func_XtAppInitialize" >&5
14970 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14971 if test $ac_cv_func_XtAppInitialize = yes; then
14972   :
14973 else
14974
14975         echo "$as_me:14975: checking for XtAppInitialize in -lXt" >&5
14976 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14977 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14978   echo $ECHO_N "(cached) $ECHO_C" >&6
14979 else
14980   ac_check_lib_save_LIBS=$LIBS
14981 LIBS="-lXt  $LIBS"
14982 cat >conftest.$ac_ext <<_ACEOF
14983 #line 14983 "configure"
14984 #include "confdefs.h"
14985
14986 /* Override any gcc2 internal prototype to avoid an error.  */
14987 #ifdef __cplusplus
14988 extern "C"
14989 #endif
14990 /* We use char because int might match the return type of a gcc2
14991    builtin and then its argument prototype would still apply.  */
14992 char XtAppInitialize ();
14993 int
14994 main (void)
14995 {
14996 XtAppInitialize ();
14997   ;
14998   return 0;
14999 }
15000 _ACEOF
15001 rm -f conftest.$ac_objext conftest$ac_exeext
15002 if { (eval echo "$as_me:15002: \"$ac_link\"") >&5
15003   (eval $ac_link) 2>&5
15004   ac_status=$?
15005   echo "$as_me:15005: \$? = $ac_status" >&5
15006   (exit $ac_status); } &&
15007          { ac_try='test -s conftest$ac_exeext'
15008   { (eval echo "$as_me:15008: \"$ac_try\"") >&5
15009   (eval $ac_try) 2>&5
15010   ac_status=$?
15011   echo "$as_me:15011: \$? = $ac_status" >&5
15012   (exit $ac_status); }; }; then
15013   ac_cv_lib_Xt_XtAppInitialize=yes
15014 else
15015   echo "$as_me: failed program was:" >&5
15016 cat conftest.$ac_ext >&5
15017 ac_cv_lib_Xt_XtAppInitialize=no
15018 fi
15019 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15020 LIBS=$ac_check_lib_save_LIBS
15021 fi
15022 echo "$as_me:15022: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15023 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15024 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
15025
15026 cat >>confdefs.h <<\EOF
15027 #define HAVE_LIBXT 1
15028 EOF
15029
15030                  cf_have_X_LIBS=Xt
15031                  LIBS="-lXt $LIBS"
15032 fi
15033
15034 fi
15035
15036 fi
15037
15038 if test $cf_have_X_LIBS = no ; then
15039         { echo "$as_me:15039: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15040 test program.  You will have to check and add the proper libraries by hand
15041 to makefile." >&5
15042 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15043 test program.  You will have to check and add the proper libraries by hand
15044 to makefile." >&2;}
15045 fi
15046
15047 cf_x_athena_root=$cf_x_athena
15048 cf_x_athena_inc=""
15049
15050 for cf_path in default \
15051         /usr/contrib/X11R6 \
15052         /usr/contrib/X11R5 \
15053         /usr/lib/X11R5 \
15054         /usr/local
15055 do
15056         if test -z "$cf_x_athena_inc" ; then
15057
15058 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15059 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15060 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15061 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15062 for cf_X_CFLAGS in $X_CFLAGS
15063 do
15064         case "x$cf_X_CFLAGS" in
15065         x-[IUD]*)
15066                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15067                 ;;
15068         *)
15069                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15070                 ;;
15071         esac
15072 done
15073
15074                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15075                 if test $cf_path != default ; then
15076
15077         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15078         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15079
15080                         echo "$as_me:15080: checking for $cf_test in $cf_path" >&5
15081 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15082                 else
15083                         echo "$as_me:15083: checking for $cf_test" >&5
15084 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15085                 fi
15086                 cat >conftest.$ac_ext <<_ACEOF
15087 #line 15087 "configure"
15088 #include "confdefs.h"
15089
15090 #include <X11/Intrinsic.h>
15091 #include <$cf_test>
15092 int
15093 main (void)
15094 {
15095
15096   ;
15097   return 0;
15098 }
15099 _ACEOF
15100 rm -f conftest.$ac_objext
15101 if { (eval echo "$as_me:15101: \"$ac_compile\"") >&5
15102   (eval $ac_compile) 2>&5
15103   ac_status=$?
15104   echo "$as_me:15104: \$? = $ac_status" >&5
15105   (exit $ac_status); } &&
15106          { ac_try='test -s conftest.$ac_objext'
15107   { (eval echo "$as_me:15107: \"$ac_try\"") >&5
15108   (eval $ac_try) 2>&5
15109   ac_status=$?
15110   echo "$as_me:15110: \$? = $ac_status" >&5
15111   (exit $ac_status); }; }; then
15112   cf_result=yes
15113 else
15114   echo "$as_me: failed program was:" >&5
15115 cat conftest.$ac_ext >&5
15116 cf_result=no
15117 fi
15118 rm -f conftest.$ac_objext conftest.$ac_ext
15119                 echo "$as_me:15119: result: $cf_result" >&5
15120 echo "${ECHO_T}$cf_result" >&6
15121
15122 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15123 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15124 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15125
15126                 if test "$cf_result" = yes ; then
15127                         test "$cf_path"  = default && cf_x_athena_inc=default
15128                         test "$cf_path" != default && cf_x_athena_inc=$cf_path/include
15129                         break
15130                 fi
15131         fi
15132 done
15133
15134 if test -z "$cf_x_athena_inc" ; then
15135         { echo "$as_me:15135: WARNING: Unable to find Athena header files" >&5
15136 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15137 elif test "$cf_x_athena_inc" != default ; then
15138
15139         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15140         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15141
15142 fi
15143
15144 cf_x_athena_root=$cf_x_athena
15145 cf_x_athena_lib=""
15146
15147 for cf_path in default \
15148         /usr/contrib/X11R6 \
15149         /usr/contrib/X11R5 \
15150         /usr/lib/X11R5 \
15151         /usr/local
15152 do
15153         for cf_lib in \
15154                 ${cf_x_athena_root} \
15155                 ${cf_x_athena_root}7 \
15156                 ${cf_x_athena_root}6
15157         do
15158         for cf_libs in \
15159                 "-l$cf_lib -lXmu" \
15160                 "-l$cf_lib -lXpm -lXmu" \
15161                 "-l${cf_lib}_s -lXmu_s"
15162         do
15163                 test -n "$cf_x_athena_lib" && break
15164
15165 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15166 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15167 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15168 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15169 for cf_X_CFLAGS in $X_CFLAGS
15170 do
15171         case "x$cf_X_CFLAGS" in
15172         x-[IUD]*)
15173                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15174                 ;;
15175         *)
15176                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15177                 ;;
15178         esac
15179 done
15180
15181                 cf_test=XawSimpleMenuAddGlobalActions
15182                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15183
15184 cf_add_libs="$LIBS"
15185 # reverse order
15186 cf_add_0lib=
15187 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15188 # filter duplicates
15189 for cf_add_1lib in $cf_add_0lib; do
15190         for cf_add_2lib in $cf_add_libs; do
15191                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15192                         cf_add_1lib=
15193                         break
15194                 fi
15195         done
15196         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15197 done
15198 LIBS="$cf_add_libs"
15199
15200                 echo "$as_me:15200: checking for $cf_test in $cf_libs" >&5
15201 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15202                 cat >conftest.$ac_ext <<_ACEOF
15203 #line 15203 "configure"
15204 #include "confdefs.h"
15205
15206 #include <X11/Intrinsic.h>
15207 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15208
15209 int
15210 main (void)
15211 {
15212
15213 $cf_test((XtAppContext) 0)
15214   ;
15215   return 0;
15216 }
15217 _ACEOF
15218 rm -f conftest.$ac_objext conftest$ac_exeext
15219 if { (eval echo "$as_me:15219: \"$ac_link\"") >&5
15220   (eval $ac_link) 2>&5
15221   ac_status=$?
15222   echo "$as_me:15222: \$? = $ac_status" >&5
15223   (exit $ac_status); } &&
15224          { ac_try='test -s conftest$ac_exeext'
15225   { (eval echo "$as_me:15225: \"$ac_try\"") >&5
15226   (eval $ac_try) 2>&5
15227   ac_status=$?
15228   echo "$as_me:15228: \$? = $ac_status" >&5
15229   (exit $ac_status); }; }; then
15230   cf_result=yes
15231 else
15232   echo "$as_me: failed program was:" >&5
15233 cat conftest.$ac_ext >&5
15234 cf_result=no
15235 fi
15236 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15237                 echo "$as_me:15237: result: $cf_result" >&5
15238 echo "${ECHO_T}$cf_result" >&6
15239
15240 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15241 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15242 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15243
15244                 if test "$cf_result" = yes ; then
15245                         cf_x_athena_lib="$cf_libs"
15246                         break
15247                 fi
15248         done # cf_libs
15249                 test -n "$cf_x_athena_lib" && break
15250         done # cf_lib
15251 done
15252
15253 if test -z "$cf_x_athena_lib" ; then
15254         { { echo "$as_me:15254: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15255 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15256    { (exit 1); exit 1; }; }
15257 fi
15258
15259 cf_add_libs="$LIBS"
15260 # reverse order
15261 cf_add_0lib=
15262 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15263 # filter duplicates
15264 for cf_add_1lib in $cf_add_0lib; do
15265         for cf_add_2lib in $cf_add_libs; do
15266                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15267                         cf_add_1lib=
15268                         break
15269                 fi
15270         done
15271         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15272 done
15273 LIBS="$cf_add_libs"
15274
15275 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15276
15277 cat >>confdefs.h <<EOF
15278 #define $cf_x_athena_LIBS 1
15279 EOF
15280
15281 fi
15282
15283 if test -n "$ac_tool_prefix"; then
15284   for ac_prog in xcurses-config
15285   do
15286     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15287 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15288 echo "$as_me:15288: checking for $ac_word" >&5
15289 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15290 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15291   echo $ECHO_N "(cached) $ECHO_C" >&6
15292 else
15293   if test -n "$XCURSES_CONFIG"; then
15294   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15295 else
15296   ac_save_IFS=$IFS; IFS=$ac_path_separator
15297 ac_dummy="$PATH"
15298 for ac_dir in $ac_dummy; do
15299   IFS=$ac_save_IFS
15300   test -z "$ac_dir" && ac_dir=.
15301   $as_executable_p "$ac_dir/$ac_word" || continue
15302 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15303 echo "$as_me:15303: found $ac_dir/$ac_word" >&5
15304 break
15305 done
15306
15307 fi
15308 fi
15309 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15310 if test -n "$XCURSES_CONFIG"; then
15311   echo "$as_me:15311: result: $XCURSES_CONFIG" >&5
15312 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15313 else
15314   echo "$as_me:15314: result: no" >&5
15315 echo "${ECHO_T}no" >&6
15316 fi
15317
15318     test -n "$XCURSES_CONFIG" && break
15319   done
15320 fi
15321 if test -z "$XCURSES_CONFIG"; then
15322   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15323   for ac_prog in xcurses-config
15324 do
15325   # Extract the first word of "$ac_prog", so it can be a program name with args.
15326 set dummy $ac_prog; ac_word=$2
15327 echo "$as_me:15327: checking for $ac_word" >&5
15328 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15329 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15330   echo $ECHO_N "(cached) $ECHO_C" >&6
15331 else
15332   if test -n "$ac_ct_XCURSES_CONFIG"; then
15333   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15334 else
15335   ac_save_IFS=$IFS; IFS=$ac_path_separator
15336 ac_dummy="$PATH"
15337 for ac_dir in $ac_dummy; do
15338   IFS=$ac_save_IFS
15339   test -z "$ac_dir" && ac_dir=.
15340   $as_executable_p "$ac_dir/$ac_word" || continue
15341 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15342 echo "$as_me:15342: found $ac_dir/$ac_word" >&5
15343 break
15344 done
15345
15346 fi
15347 fi
15348 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15349 if test -n "$ac_ct_XCURSES_CONFIG"; then
15350   echo "$as_me:15350: result: $ac_ct_XCURSES_CONFIG" >&5
15351 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15352 else
15353   echo "$as_me:15353: result: no" >&5
15354 echo "${ECHO_T}no" >&6
15355 fi
15356
15357   test -n "$ac_ct_XCURSES_CONFIG" && break
15358 done
15359 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15360
15361   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15362 fi
15363
15364 if test "$XCURSES_CONFIG" != none ; then
15365
15366 cf_fix_cppflags=no
15367 cf_new_cflags=
15368 cf_new_cppflags=
15369 cf_new_extra_cppflags=
15370
15371 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15372 do
15373 case $cf_fix_cppflags in
15374 (no)
15375         case $cf_add_cflags in
15376         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15377                 case $cf_add_cflags in
15378                 (-D*)
15379                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15380
15381                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15382                                 && test -z "${cf_tst_cflags}" \
15383                                 && cf_fix_cppflags=yes
15384
15385                         if test $cf_fix_cppflags = yes ; then
15386
15387         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15388         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15389
15390                                 continue
15391                         elif test "${cf_tst_cflags}" = "\"'" ; then
15392
15393         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15394         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15395
15396                                 continue
15397                         fi
15398                         ;;
15399                 esac
15400                 case "$CPPFLAGS" in
15401                 (*$cf_add_cflags)
15402                         ;;
15403                 (*)
15404                         case $cf_add_cflags in
15405                         (-D*)
15406                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15407
15408 CPPFLAGS=`echo "$CPPFLAGS" | \
15409         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15410                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15411
15412                                 ;;
15413                         esac
15414
15415         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15416         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15417
15418                         ;;
15419                 esac
15420                 ;;
15421         (*)
15422
15423         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15424         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15425
15426                 ;;
15427         esac
15428         ;;
15429 (yes)
15430
15431         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15432         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15433
15434         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15435
15436         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15437                 && test -z "${cf_tst_cflags}" \
15438                 && cf_fix_cppflags=no
15439         ;;
15440 esac
15441 done
15442
15443 if test -n "$cf_new_cflags" ; then
15444
15445         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15446         CFLAGS="${CFLAGS}$cf_new_cflags"
15447
15448 fi
15449
15450 if test -n "$cf_new_cppflags" ; then
15451
15452         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15453         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15454
15455 fi
15456
15457 if test -n "$cf_new_extra_cppflags" ; then
15458
15459         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15460         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15461
15462 fi
15463
15464 cf_add_libs="$LIBS"
15465 # reverse order
15466 cf_add_0lib=
15467 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15468 # filter duplicates
15469 for cf_add_1lib in $cf_add_0lib; do
15470         for cf_add_2lib in $cf_add_libs; do
15471                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15472                         cf_add_1lib=
15473                         break
15474                 fi
15475         done
15476         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15477 done
15478 LIBS="$cf_add_libs"
15479
15480 cf_cv_lib_XCurses=yes
15481
15482 else
15483
15484 LDFLAGS="$LDFLAGS $X_LIBS"
15485
15486 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15487
15488 echo "${as_me:-configure}:15488: testing checking additions to CFLAGS ..." 1>&5
15489
15490 cf_check_cflags="$CFLAGS"
15491 cf_check_cppflags="$CPPFLAGS"
15492
15493 cf_fix_cppflags=no
15494 cf_new_cflags=
15495 cf_new_cppflags=
15496 cf_new_extra_cppflags=
15497
15498 for cf_add_cflags in $X_CFLAGS
15499 do
15500 case $cf_fix_cppflags in
15501 (no)
15502         case $cf_add_cflags in
15503         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15504                 case $cf_add_cflags in
15505                 (-D*)
15506                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15507
15508                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15509                                 && test -z "${cf_tst_cflags}" \
15510                                 && cf_fix_cppflags=yes
15511
15512                         if test $cf_fix_cppflags = yes ; then
15513
15514         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15515         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15516
15517                                 continue
15518                         elif test "${cf_tst_cflags}" = "\"'" ; then
15519
15520         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15521         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15522
15523                                 continue
15524                         fi
15525                         ;;
15526                 esac
15527                 case "$CPPFLAGS" in
15528                 (*$cf_add_cflags)
15529                         ;;
15530                 (*)
15531                         case $cf_add_cflags in
15532                         (-D*)
15533                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15534
15535 CPPFLAGS=`echo "$CPPFLAGS" | \
15536         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15537                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15538
15539                                 ;;
15540                         esac
15541
15542         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15543         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15544
15545                         ;;
15546                 esac
15547                 ;;
15548         (*)
15549
15550         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15551         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15552
15553                 ;;
15554         esac
15555         ;;
15556 (yes)
15557
15558         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15559         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15560
15561         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15562
15563         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15564                 && test -z "${cf_tst_cflags}" \
15565                 && cf_fix_cppflags=no
15566         ;;
15567 esac
15568 done
15569
15570 if test -n "$cf_new_cflags" ; then
15571         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15572
15573 echo "${as_me:-configure}:15573: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15574
15575         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15576         CFLAGS="${CFLAGS}$cf_new_cflags"
15577
15578 fi
15579
15580 if test -n "$cf_new_cppflags" ; then
15581         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15582
15583 echo "${as_me:-configure}:15583: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15584
15585         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15586         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15587
15588 fi
15589
15590 if test -n "$cf_new_extra_cppflags" ; then
15591         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15592
15593 echo "${as_me:-configure}:15593: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15594
15595         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15596         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15597
15598 fi
15599
15600 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15601 cat >conftest.$ac_ext <<_ACEOF
15602 #line 15602 "configure"
15603 #include "confdefs.h"
15604 #include <stdio.h>
15605 int
15606 main (void)
15607 {
15608 printf("Hello world");
15609   ;
15610   return 0;
15611 }
15612 _ACEOF
15613 rm -f conftest.$ac_objext conftest$ac_exeext
15614 if { (eval echo "$as_me:15614: \"$ac_link\"") >&5
15615   (eval $ac_link) 2>&5
15616   ac_status=$?
15617   echo "$as_me:15617: \$? = $ac_status" >&5
15618   (exit $ac_status); } &&
15619          { ac_try='test -s conftest$ac_exeext'
15620   { (eval echo "$as_me:15620: \"$ac_try\"") >&5
15621   (eval $ac_try) 2>&5
15622   ac_status=$?
15623   echo "$as_me:15623: \$? = $ac_status" >&5
15624   (exit $ac_status); }; }; then
15625   :
15626 else
15627   echo "$as_me: failed program was:" >&5
15628 cat conftest.$ac_ext >&5
15629 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15630
15631 echo "${as_me:-configure}:15631: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15632
15633          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15634                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15635
15636 echo "${as_me:-configure}:15636: testing but keeping change to \$CPPFLAGS ..." 1>&5
15637
15638          fi
15639          CFLAGS="$cf_check_flags"
15640 fi
15641 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15642 fi
15643
15644 echo "$as_me:15644: checking for XOpenDisplay in -lX11" >&5
15645 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15646 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15647   echo $ECHO_N "(cached) $ECHO_C" >&6
15648 else
15649   ac_check_lib_save_LIBS=$LIBS
15650 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15651 cat >conftest.$ac_ext <<_ACEOF
15652 #line 15652 "configure"
15653 #include "confdefs.h"
15654
15655 /* Override any gcc2 internal prototype to avoid an error.  */
15656 #ifdef __cplusplus
15657 extern "C"
15658 #endif
15659 /* We use char because int might match the return type of a gcc2
15660    builtin and then its argument prototype would still apply.  */
15661 char XOpenDisplay ();
15662 int
15663 main (void)
15664 {
15665 XOpenDisplay ();
15666   ;
15667   return 0;
15668 }
15669 _ACEOF
15670 rm -f conftest.$ac_objext conftest$ac_exeext
15671 if { (eval echo "$as_me:15671: \"$ac_link\"") >&5
15672   (eval $ac_link) 2>&5
15673   ac_status=$?
15674   echo "$as_me:15674: \$? = $ac_status" >&5
15675   (exit $ac_status); } &&
15676          { ac_try='test -s conftest$ac_exeext'
15677   { (eval echo "$as_me:15677: \"$ac_try\"") >&5
15678   (eval $ac_try) 2>&5
15679   ac_status=$?
15680   echo "$as_me:15680: \$? = $ac_status" >&5
15681   (exit $ac_status); }; }; then
15682   ac_cv_lib_X11_XOpenDisplay=yes
15683 else
15684   echo "$as_me: failed program was:" >&5
15685 cat conftest.$ac_ext >&5
15686 ac_cv_lib_X11_XOpenDisplay=no
15687 fi
15688 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15689 LIBS=$ac_check_lib_save_LIBS
15690 fi
15691 echo "$as_me:15691: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15692 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15693 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15694
15695 cf_add_libs="$LIBS"
15696 # reverse order
15697 cf_add_0lib=
15698 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15699 # filter duplicates
15700 for cf_add_1lib in $cf_add_0lib; do
15701         for cf_add_2lib in $cf_add_libs; do
15702                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15703                         cf_add_1lib=
15704                         break
15705                 fi
15706         done
15707         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15708 done
15709 LIBS="$cf_add_libs"
15710
15711 fi
15712
15713 echo "$as_me:15713: checking for XCurses library" >&5
15714 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15715 if test "${cf_cv_lib_XCurses+set}" = set; then
15716   echo $ECHO_N "(cached) $ECHO_C" >&6
15717 else
15718
15719 cf_add_libs="$LIBS"
15720 # reverse order
15721 cf_add_0lib=
15722 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15723 # filter duplicates
15724 for cf_add_1lib in $cf_add_0lib; do
15725         for cf_add_2lib in $cf_add_libs; do
15726                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15727                         cf_add_1lib=
15728                         break
15729                 fi
15730         done
15731         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15732 done
15733 LIBS="$cf_add_libs"
15734
15735 cat >conftest.$ac_ext <<_ACEOF
15736 #line 15736 "configure"
15737 #include "confdefs.h"
15738
15739 #include <xcurses.h>
15740 char *XCursesProgramName = "test";
15741
15742 int
15743 main (void)
15744 {
15745 XCursesExit();
15746   ;
15747   return 0;
15748 }
15749 _ACEOF
15750 rm -f conftest.$ac_objext conftest$ac_exeext
15751 if { (eval echo "$as_me:15751: \"$ac_link\"") >&5
15752   (eval $ac_link) 2>&5
15753   ac_status=$?
15754   echo "$as_me:15754: \$? = $ac_status" >&5
15755   (exit $ac_status); } &&
15756          { ac_try='test -s conftest$ac_exeext'
15757   { (eval echo "$as_me:15757: \"$ac_try\"") >&5
15758   (eval $ac_try) 2>&5
15759   ac_status=$?
15760   echo "$as_me:15760: \$? = $ac_status" >&5
15761   (exit $ac_status); }; }; then
15762   cf_cv_lib_XCurses=yes
15763 else
15764   echo "$as_me: failed program was:" >&5
15765 cat conftest.$ac_ext >&5
15766 cf_cv_lib_XCurses=no
15767 fi
15768 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15769
15770 fi
15771 echo "$as_me:15771: result: $cf_cv_lib_XCurses" >&5
15772 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15773
15774 fi
15775
15776 if test $cf_cv_lib_XCurses = yes ; then
15777
15778 cat >>confdefs.h <<\EOF
15779 #define UNIX 1
15780 EOF
15781
15782 cat >>confdefs.h <<\EOF
15783 #define XCURSES 1
15784 EOF
15785
15786         echo "$as_me:15786: checking for xcurses.h" >&5
15787 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15788 if test "${ac_cv_header_xcurses_h+set}" = set; then
15789   echo $ECHO_N "(cached) $ECHO_C" >&6
15790 else
15791   cat >conftest.$ac_ext <<_ACEOF
15792 #line 15792 "configure"
15793 #include "confdefs.h"
15794 #include <xcurses.h>
15795 _ACEOF
15796 if { (eval echo "$as_me:15796: \"$ac_cpp conftest.$ac_ext\"") >&5
15797   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15798   ac_status=$?
15799   egrep -v '^ *\+' conftest.er1 >conftest.err
15800   rm -f conftest.er1
15801   cat conftest.err >&5
15802   echo "$as_me:15802: \$? = $ac_status" >&5
15803   (exit $ac_status); } >/dev/null; then
15804   if test -s conftest.err; then
15805     ac_cpp_err=$ac_c_preproc_warn_flag
15806   else
15807     ac_cpp_err=
15808   fi
15809 else
15810   ac_cpp_err=yes
15811 fi
15812 if test -z "$ac_cpp_err"; then
15813   ac_cv_header_xcurses_h=yes
15814 else
15815   echo "$as_me: failed program was:" >&5
15816   cat conftest.$ac_ext >&5
15817   ac_cv_header_xcurses_h=no
15818 fi
15819 rm -f conftest.err conftest.$ac_ext
15820 fi
15821 echo "$as_me:15821: result: $ac_cv_header_xcurses_h" >&5
15822 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15823 if test $ac_cv_header_xcurses_h = yes; then
15824
15825 cat >>confdefs.h <<\EOF
15826 #define HAVE_XCURSES 1
15827 EOF
15828
15829 fi
15830
15831 else
15832         { { echo "$as_me:15832: error: Cannot link with XCurses" >&5
15833 echo "$as_me: error: Cannot link with XCurses" >&2;}
15834    { (exit 1); exit 1; }; }
15835 fi
15836
15837         ;;
15838 (*)
15839         { { echo "$as_me:15839: error: unexpected screen-value: $cf_cv_screen" >&5
15840 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15841    { (exit 1); exit 1; }; }
15842         ;;
15843 esac
15844
15845 : ${cf_nculib_root:=$cf_cv_screen}
15846 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15847 echo "$as_me:15847: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15848 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15849 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15850   echo $ECHO_N "(cached) $ECHO_C" >&6
15851 else
15852   ac_check_lib_save_LIBS=$LIBS
15853 LIBS="-l$cf_nculib_root  $LIBS"
15854 cat >conftest.$ac_ext <<_ACEOF
15855 #line 15855 "configure"
15856 #include "confdefs.h"
15857
15858 /* Override any gcc2 internal prototype to avoid an error.  */
15859 #ifdef __cplusplus
15860 extern "C"
15861 #endif
15862 /* We use char because int might match the return type of a gcc2
15863    builtin and then its argument prototype would still apply.  */
15864 char _nc_init_pthreads ();
15865 int
15866 main (void)
15867 {
15868 _nc_init_pthreads ();
15869   ;
15870   return 0;
15871 }
15872 _ACEOF
15873 rm -f conftest.$ac_objext conftest$ac_exeext
15874 if { (eval echo "$as_me:15874: \"$ac_link\"") >&5
15875   (eval $ac_link) 2>&5
15876   ac_status=$?
15877   echo "$as_me:15877: \$? = $ac_status" >&5
15878   (exit $ac_status); } &&
15879          { ac_try='test -s conftest$ac_exeext'
15880   { (eval echo "$as_me:15880: \"$ac_try\"") >&5
15881   (eval $ac_try) 2>&5
15882   ac_status=$?
15883   echo "$as_me:15883: \$? = $ac_status" >&5
15884   (exit $ac_status); }; }; then
15885   eval "$as_ac_Lib=yes"
15886 else
15887   echo "$as_me: failed program was:" >&5
15888 cat conftest.$ac_ext >&5
15889 eval "$as_ac_Lib=no"
15890 fi
15891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15892 LIBS=$ac_check_lib_save_LIBS
15893 fi
15894 echo "$as_me:15894: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15895 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15896 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15897   cf_cv_ncurses_pthreads=yes
15898 else
15899   cf_cv_ncurses_pthreads=no
15900 fi
15901
15902 if test "$cf_cv_ncurses_pthreads" = yes
15903 then
15904
15905 cf_add_libs="$LIBS"
15906 # reverse order
15907 cf_add_0lib=
15908 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15909 # filter duplicates
15910 for cf_add_1lib in $cf_add_0lib; do
15911         for cf_add_2lib in $cf_add_libs; do
15912                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15913                         cf_add_1lib=
15914                         break
15915                 fi
15916         done
15917         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15918 done
15919 LIBS="$cf_add_libs"
15920
15921 fi
15922
15923 case $cf_cv_screen in
15924 (ncurses*)
15925         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15926         ;;
15927 esac
15928
15929 echo "$as_me:15929: checking for X11 rgb file" >&5
15930 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15931
15932 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15933 if test "${with_x11_rgb+set}" = set; then
15934   withval="$with_x11_rgb"
15935   RGB_PATH=$withval
15936 else
15937   RGB_PATH=auto
15938 fi;
15939
15940 if test "x$RGB_PATH" = xauto
15941 then
15942         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15943         for cf_path in \
15944                 /opt/local/share/X11/rgb.txt \
15945                 /opt/X11/share/X11/rgb.txt \
15946                 /usr/share/X11/rgb.txt \
15947                 /usr/X11/share/X11/rgb.txt \
15948                 /usr/X11/lib/X11/rgb.txt \
15949                 /usr/lib/X11/rgb.txt \
15950                 /etc/X11/rgb.txt \
15951                 /usr/pkg/lib/X11/rgb.txt \
15952                 /usr/X11R7/lib/X11/rgb.txt \
15953                 /usr/X11R6/lib/X11/rgb.txt \
15954                 /usr/X11R5/lib/X11/rgb.txt \
15955                 /usr/X11R4/lib/X11/rgb.txt \
15956                 /usr/local/lib/X11/rgb.txt \
15957                 /usr/local/share/X11/rgb.txt \
15958                 /usr/lib64/X11/rgb.txt
15959         do
15960                 if test -f "$cf_path" ; then
15961                         RGB_PATH="$cf_path"
15962                         break
15963                 fi
15964         done
15965 else
15966         cf_path=$RGB_PATH
15967
15968 if test "x$prefix" != xNONE; then
15969         cf_path_syntax="$prefix"
15970 else
15971         cf_path_syntax="$ac_default_prefix"
15972 fi
15973
15974 case ".$cf_path" in
15975 (.\$\(*\)*|.\'*\'*)
15976         ;;
15977 (..|./*|.\\*)
15978         ;;
15979 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15980         ;;
15981 (.\${*prefix}*|.\${*dir}*)
15982         eval cf_path="$cf_path"
15983         case ".$cf_path" in
15984         (.NONE/*)
15985                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15986                 ;;
15987         esac
15988         ;;
15989 (.no|.NONE/*)
15990         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15991         ;;
15992 (*)
15993         { { echo "$as_me:15993: error: expected a pathname, not \"$cf_path\"" >&5
15994 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15995    { (exit 1); exit 1; }; }
15996         ;;
15997 esac
15998
15999 fi
16000
16001 echo "$as_me:16001: result: $RGB_PATH" >&5
16002 echo "${ECHO_T}$RGB_PATH" >&6
16003
16004 cat >>confdefs.h <<EOF
16005 #define RGB_PATH "$cf_path"
16006 EOF
16007
16008 no_x11_rgb=
16009 if test "$RGB_PATH" = no
16010 then
16011         no_x11_rgb="#"
16012 fi
16013
16014 cf_curses_headers=
16015
16016 case $cf_cv_screen in
16017 (pdcurses)
16018         cf_default_panel=no
16019         cf_default_form=no
16020         cf_default_menu=no
16021         cf_default_tinfo=no
16022         ;;
16023 (xcurses|bsdcurses)
16024         cf_default_panel=no
16025         cf_default_form=no
16026         cf_default_menu=no
16027         cf_default_tinfo=yes
16028         ;;
16029 (*)
16030         cf_default_panel=yes
16031         cf_default_form=yes
16032         cf_default_menu=yes
16033         cf_default_tinfo=yes
16034         case $cf_cv_screen in
16035         (ncurses*)
16036                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16037                 ;;
16038         esac
16039         ;;
16040 esac
16041
16042 echo "$as_me:16042: checking for desired basename for form library" >&5
16043 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16044
16045 # Check whether --with-form-libname or --without-form-libname was given.
16046 if test "${with_form_libname+set}" = set; then
16047   withval="$with_form_libname"
16048   with_lib_basename=$withval
16049 else
16050   with_lib_basename=form
16051 fi;
16052 FORM_NAME="$with_lib_basename"
16053
16054 case "x$FORM_NAME" in
16055 (x|xno|xnone|xyes)
16056         FORM_NAME=form
16057         ;;
16058 (*)
16059         ;;
16060 esac
16061
16062 echo "$as_me:16062: result: $FORM_NAME" >&5
16063 echo "${ECHO_T}$FORM_NAME" >&6
16064
16065 echo "$as_me:16065: checking for desired basename for menu library" >&5
16066 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16067
16068 # Check whether --with-menu-libname or --without-menu-libname was given.
16069 if test "${with_menu_libname+set}" = set; then
16070   withval="$with_menu_libname"
16071   with_lib_basename=$withval
16072 else
16073   with_lib_basename=menu
16074 fi;
16075 MENU_NAME="$with_lib_basename"
16076
16077 case "x$MENU_NAME" in
16078 (x|xno|xnone|xyes)
16079         MENU_NAME=menu
16080         ;;
16081 (*)
16082         ;;
16083 esac
16084
16085 echo "$as_me:16085: result: $MENU_NAME" >&5
16086 echo "${ECHO_T}$MENU_NAME" >&6
16087
16088 echo "$as_me:16088: checking for desired basename for panel library" >&5
16089 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16090
16091 # Check whether --with-panel-libname or --without-panel-libname was given.
16092 if test "${with_panel_libname+set}" = set; then
16093   withval="$with_panel_libname"
16094   with_lib_basename=$withval
16095 else
16096   with_lib_basename=panel
16097 fi;
16098 PANEL_NAME="$with_lib_basename"
16099
16100 case "x$PANEL_NAME" in
16101 (x|xno|xnone|xyes)
16102         PANEL_NAME=panel
16103         ;;
16104 (*)
16105         ;;
16106 esac
16107
16108 echo "$as_me:16108: result: $PANEL_NAME" >&5
16109 echo "${ECHO_T}$PANEL_NAME" >&6
16110
16111 echo "$as_me:16111: checking if you want to check for panel functions" >&5
16112 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16113
16114 # Check whether --enable-panel or --disable-panel was given.
16115 if test "${enable_panel+set}" = set; then
16116   enableval="$enable_panel"
16117   test "$enableval" != no && enableval=yes
16118         if test "$enableval" != "yes" ; then
16119     cf_enable_panel=no
16120         else
16121                 cf_enable_panel=$cf_default_panel
16122         fi
16123 else
16124   enableval=yes
16125         cf_enable_panel=$cf_default_panel
16126
16127 fi;
16128 echo "$as_me:16128: result: $cf_enable_panel" >&5
16129 echo "${ECHO_T}$cf_enable_panel" >&6
16130 if test $cf_enable_panel = yes
16131 then
16132
16133 cf_have_curses_lib=no
16134
16135 : ${NCURSES_CONFIG_PKG:=none}
16136 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16137         :
16138 elif test "x${PKG_CONFIG:=none}" != xnone; then
16139         echo "$as_me:16139: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16140 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16141         if "$PKG_CONFIG" --exists $PANEL_NAME$cf_cv_libtype ; then
16142                 echo "$as_me:16142: result: yes" >&5
16143 echo "${ECHO_T}yes" >&6
16144
16145                 echo "$as_me:16145: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16146 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16147
16148                 cf_save_CPPFLAGS="$CPPFLAGS"
16149                 cf_save_LIBS="$LIBS"
16150
16151 cf_fix_cppflags=no
16152 cf_new_cflags=
16153 cf_new_cppflags=
16154 cf_new_extra_cppflags=
16155
16156 for cf_add_cflags in `$PKG_CONFIG --cflags $PANEL_NAME$cf_cv_libtype`
16157 do
16158 case $cf_fix_cppflags in
16159 (no)
16160         case $cf_add_cflags in
16161         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16162                 case $cf_add_cflags in
16163                 (-D*)
16164                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16165
16166                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16167                                 && test -z "${cf_tst_cflags}" \
16168                                 && cf_fix_cppflags=yes
16169
16170                         if test $cf_fix_cppflags = yes ; then
16171
16172         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16173         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16174
16175                                 continue
16176                         elif test "${cf_tst_cflags}" = "\"'" ; then
16177
16178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16180
16181                                 continue
16182                         fi
16183                         ;;
16184                 esac
16185                 case "$CPPFLAGS" in
16186                 (*$cf_add_cflags)
16187                         ;;
16188                 (*)
16189                         case $cf_add_cflags in
16190                         (-D*)
16191                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16192
16193 CPPFLAGS=`echo "$CPPFLAGS" | \
16194         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16195                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16196
16197                                 ;;
16198                         esac
16199
16200         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16201         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16202
16203                         ;;
16204                 esac
16205                 ;;
16206         (*)
16207
16208         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16209         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16210
16211                 ;;
16212         esac
16213         ;;
16214 (yes)
16215
16216         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16217         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16218
16219         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16220
16221         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16222                 && test -z "${cf_tst_cflags}" \
16223                 && cf_fix_cppflags=no
16224         ;;
16225 esac
16226 done
16227
16228 if test -n "$cf_new_cflags" ; then
16229
16230         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16231         CFLAGS="${CFLAGS}$cf_new_cflags"
16232
16233 fi
16234
16235 if test -n "$cf_new_cppflags" ; then
16236
16237         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16238         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16239
16240 fi
16241
16242 if test -n "$cf_new_extra_cppflags" ; then
16243
16244         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16245         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16246
16247 fi
16248
16249 cf_add_libs="$LIBS"
16250 # reverse order
16251 cf_add_0lib=
16252 for cf_add_1lib in `$PKG_CONFIG --libs $PANEL_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16253 # filter duplicates
16254 for cf_add_1lib in $cf_add_0lib; do
16255         for cf_add_2lib in $cf_add_libs; do
16256                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16257                         cf_add_1lib=
16258                         break
16259                 fi
16260         done
16261         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16262 done
16263 LIBS="$cf_add_libs"
16264
16265                 cat >conftest.$ac_ext <<_ACEOF
16266 #line 16266 "configure"
16267 #include "confdefs.h"
16268 #include <$PANEL_NAME.h>
16269 int
16270 main (void)
16271 {
16272 (void) new_panel ( 0 );
16273   ;
16274   return 0;
16275 }
16276 _ACEOF
16277 rm -f conftest.$ac_objext conftest$ac_exeext
16278 if { (eval echo "$as_me:16278: \"$ac_link\"") >&5
16279   (eval $ac_link) 2>&5
16280   ac_status=$?
16281   echo "$as_me:16281: \$? = $ac_status" >&5
16282   (exit $ac_status); } &&
16283          { ac_try='test -s conftest$ac_exeext'
16284   { (eval echo "$as_me:16284: \"$ac_try\"") >&5
16285   (eval $ac_try) 2>&5
16286   ac_status=$?
16287   echo "$as_me:16287: \$? = $ac_status" >&5
16288   (exit $ac_status); }; }; then
16289   if test "$cross_compiling" = yes; then
16290   cf_have_curses_lib=maybe
16291 else
16292   cat >conftest.$ac_ext <<_ACEOF
16293 #line 16293 "configure"
16294 #include "confdefs.h"
16295 #include <$PANEL_NAME.h>
16296                                 int main(void)
16297                                 { (void) new_panel ( 0 ); return 0; }
16298 _ACEOF
16299 rm -f conftest$ac_exeext
16300 if { (eval echo "$as_me:16300: \"$ac_link\"") >&5
16301   (eval $ac_link) 2>&5
16302   ac_status=$?
16303   echo "$as_me:16303: \$? = $ac_status" >&5
16304   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16305   { (eval echo "$as_me:16305: \"$ac_try\"") >&5
16306   (eval $ac_try) 2>&5
16307   ac_status=$?
16308   echo "$as_me:16308: \$? = $ac_status" >&5
16309   (exit $ac_status); }; }; then
16310   cf_have_curses_lib=yes
16311 else
16312   echo "$as_me: program exited with status $ac_status" >&5
16313 echo "$as_me: failed program was:" >&5
16314 cat conftest.$ac_ext >&5
16315 cf_have_curses_lib=no
16316 fi
16317 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16318 fi
16319 else
16320   echo "$as_me: failed program was:" >&5
16321 cat conftest.$ac_ext >&5
16322 cf_have_curses_lib=no
16323 fi
16324 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16325                 echo "$as_me:16325: result: $cf_have_curses_lib" >&5
16326 echo "${ECHO_T}$cf_have_curses_lib" >&6
16327                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16328                 if test "$cf_have_curses_lib" != "yes"
16329                 then
16330                         CPPFLAGS="$cf_save_CPPFLAGS"
16331                         LIBS="$cf_save_LIBS"
16332                 else
16333
16334 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16335
16336                         cat >>confdefs.h <<EOF
16337 #define $cf_upper 1
16338 EOF
16339
16340                 fi
16341         fi
16342 fi
16343 if test "$cf_have_curses_lib" = no; then
16344         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16345 echo "$as_me:16345: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16346 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16347 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16348   echo $ECHO_N "(cached) $ECHO_C" >&6
16349 else
16350   ac_check_lib_save_LIBS=$LIBS
16351 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16352 cat >conftest.$ac_ext <<_ACEOF
16353 #line 16353 "configure"
16354 #include "confdefs.h"
16355
16356 /* Override any gcc2 internal prototype to avoid an error.  */
16357 #ifdef __cplusplus
16358 extern "C"
16359 #endif
16360 /* We use char because int might match the return type of a gcc2
16361    builtin and then its argument prototype would still apply.  */
16362 char new_panel ();
16363 int
16364 main (void)
16365 {
16366 new_panel ();
16367   ;
16368   return 0;
16369 }
16370 _ACEOF
16371 rm -f conftest.$ac_objext conftest$ac_exeext
16372 if { (eval echo "$as_me:16372: \"$ac_link\"") >&5
16373   (eval $ac_link) 2>&5
16374   ac_status=$?
16375   echo "$as_me:16375: \$? = $ac_status" >&5
16376   (exit $ac_status); } &&
16377          { ac_try='test -s conftest$ac_exeext'
16378   { (eval echo "$as_me:16378: \"$ac_try\"") >&5
16379   (eval $ac_try) 2>&5
16380   ac_status=$?
16381   echo "$as_me:16381: \$? = $ac_status" >&5
16382   (exit $ac_status); }; }; then
16383   eval "$as_ac_Lib=yes"
16384 else
16385   echo "$as_me: failed program was:" >&5
16386 cat conftest.$ac_ext >&5
16387 eval "$as_ac_Lib=no"
16388 fi
16389 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16390 LIBS=$ac_check_lib_save_LIBS
16391 fi
16392 echo "$as_me:16392: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16393 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16394 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16395
16396 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16397
16398 cf_add_libs="$LIBS"
16399 # reverse order
16400 cf_add_0lib=
16401 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16402 # filter duplicates
16403 for cf_add_1lib in $cf_add_0lib; do
16404         for cf_add_2lib in $cf_add_libs; do
16405                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16406                         cf_add_1lib=
16407                         break
16408                 fi
16409         done
16410         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16411 done
16412 LIBS="$cf_add_libs"
16413
16414                 cat >>confdefs.h <<EOF
16415 #define $cf_upper 1
16416 EOF
16417
16418 fi
16419
16420 fi
16421
16422         cf_curses_headers="$cf_curses_headers panel.h"
16423 fi
16424
16425 echo "$as_me:16425: checking if you want to check for menu functions" >&5
16426 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16427
16428 # Check whether --enable-menu or --disable-menu was given.
16429 if test "${enable_menu+set}" = set; then
16430   enableval="$enable_menu"
16431   test "$enableval" != no && enableval=yes
16432         if test "$enableval" != "yes" ; then
16433     cf_enable_menu=no
16434         else
16435                 cf_enable_menu=$cf_default_menu
16436         fi
16437 else
16438   enableval=yes
16439         cf_enable_menu=$cf_default_menu
16440
16441 fi;
16442 echo "$as_me:16442: result: $cf_enable_menu" >&5
16443 echo "${ECHO_T}$cf_enable_menu" >&6
16444 if test $cf_enable_menu = yes
16445 then
16446         case $cf_cv_screen in
16447         (ncurses*)
16448                 ;;
16449         (curses*)
16450
16451 echo "$as_me:16451: checking for NetBSD menu.h" >&5
16452 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16453 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16454   echo $ECHO_N "(cached) $ECHO_C" >&6
16455 else
16456
16457 cat >conftest.$ac_ext <<_ACEOF
16458 #line 16458 "configure"
16459 #include "confdefs.h"
16460
16461 #include <${cf_cv_ncurses_header:-curses.h}>
16462 #include <menu.h>
16463
16464 int
16465 main (void)
16466 {
16467
16468         MENU *menu;
16469         int y = menu->max_item_width;
16470
16471   ;
16472   return 0;
16473 }
16474 _ACEOF
16475 rm -f conftest.$ac_objext
16476 if { (eval echo "$as_me:16476: \"$ac_compile\"") >&5
16477   (eval $ac_compile) 2>&5
16478   ac_status=$?
16479   echo "$as_me:16479: \$? = $ac_status" >&5
16480   (exit $ac_status); } &&
16481          { ac_try='test -s conftest.$ac_objext'
16482   { (eval echo "$as_me:16482: \"$ac_try\"") >&5
16483   (eval $ac_try) 2>&5
16484   ac_status=$?
16485   echo "$as_me:16485: \$? = $ac_status" >&5
16486   (exit $ac_status); }; }; then
16487   cf_cv_netbsd_menu_h=yes
16488
16489 else
16490   echo "$as_me: failed program was:" >&5
16491 cat conftest.$ac_ext >&5
16492 cf_cv_netbsd_menu_h=no
16493 fi
16494 rm -f conftest.$ac_objext conftest.$ac_ext
16495
16496 fi
16497 echo "$as_me:16497: result: $cf_cv_netbsd_menu_h" >&5
16498 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16499
16500 test "$cf_cv_netbsd_menu_h" = yes &&
16501 cat >>confdefs.h <<\EOF
16502 #define HAVE_NETBSD_MENU_H 1
16503 EOF
16504
16505                 ;;
16506         esac
16507
16508 cf_have_curses_lib=no
16509
16510 : ${NCURSES_CONFIG_PKG:=none}
16511 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16512         :
16513 elif test "x${PKG_CONFIG:=none}" != xnone; then
16514         echo "$as_me:16514: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16515 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16516         if "$PKG_CONFIG" --exists $MENU_NAME$cf_cv_libtype ; then
16517                 echo "$as_me:16517: result: yes" >&5
16518 echo "${ECHO_T}yes" >&6
16519
16520                 echo "$as_me:16520: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16521 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16522
16523                 cf_save_CPPFLAGS="$CPPFLAGS"
16524                 cf_save_LIBS="$LIBS"
16525
16526 cf_fix_cppflags=no
16527 cf_new_cflags=
16528 cf_new_cppflags=
16529 cf_new_extra_cppflags=
16530
16531 for cf_add_cflags in `$PKG_CONFIG --cflags $MENU_NAME$cf_cv_libtype`
16532 do
16533 case $cf_fix_cppflags in
16534 (no)
16535         case $cf_add_cflags in
16536         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16537                 case $cf_add_cflags in
16538                 (-D*)
16539                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16540
16541                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16542                                 && test -z "${cf_tst_cflags}" \
16543                                 && cf_fix_cppflags=yes
16544
16545                         if test $cf_fix_cppflags = yes ; then
16546
16547         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16548         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16549
16550                                 continue
16551                         elif test "${cf_tst_cflags}" = "\"'" ; then
16552
16553         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16554         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16555
16556                                 continue
16557                         fi
16558                         ;;
16559                 esac
16560                 case "$CPPFLAGS" in
16561                 (*$cf_add_cflags)
16562                         ;;
16563                 (*)
16564                         case $cf_add_cflags in
16565                         (-D*)
16566                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16567
16568 CPPFLAGS=`echo "$CPPFLAGS" | \
16569         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16570                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16571
16572                                 ;;
16573                         esac
16574
16575         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16576         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16577
16578                         ;;
16579                 esac
16580                 ;;
16581         (*)
16582
16583         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16584         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16585
16586                 ;;
16587         esac
16588         ;;
16589 (yes)
16590
16591         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16592         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16593
16594         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16595
16596         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16597                 && test -z "${cf_tst_cflags}" \
16598                 && cf_fix_cppflags=no
16599         ;;
16600 esac
16601 done
16602
16603 if test -n "$cf_new_cflags" ; then
16604
16605         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16606         CFLAGS="${CFLAGS}$cf_new_cflags"
16607
16608 fi
16609
16610 if test -n "$cf_new_cppflags" ; then
16611
16612         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16613         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16614
16615 fi
16616
16617 if test -n "$cf_new_extra_cppflags" ; then
16618
16619         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16620         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16621
16622 fi
16623
16624 cf_add_libs="$LIBS"
16625 # reverse order
16626 cf_add_0lib=
16627 for cf_add_1lib in `$PKG_CONFIG --libs $MENU_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16628 # filter duplicates
16629 for cf_add_1lib in $cf_add_0lib; do
16630         for cf_add_2lib in $cf_add_libs; do
16631                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16632                         cf_add_1lib=
16633                         break
16634                 fi
16635         done
16636         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16637 done
16638 LIBS="$cf_add_libs"
16639
16640                 cat >conftest.$ac_ext <<_ACEOF
16641 #line 16641 "configure"
16642 #include "confdefs.h"
16643 #include <$MENU_NAME.h>
16644 int
16645 main (void)
16646 {
16647 (void) menu_driver ( 0,0 );
16648   ;
16649   return 0;
16650 }
16651 _ACEOF
16652 rm -f conftest.$ac_objext conftest$ac_exeext
16653 if { (eval echo "$as_me:16653: \"$ac_link\"") >&5
16654   (eval $ac_link) 2>&5
16655   ac_status=$?
16656   echo "$as_me:16656: \$? = $ac_status" >&5
16657   (exit $ac_status); } &&
16658          { ac_try='test -s conftest$ac_exeext'
16659   { (eval echo "$as_me:16659: \"$ac_try\"") >&5
16660   (eval $ac_try) 2>&5
16661   ac_status=$?
16662   echo "$as_me:16662: \$? = $ac_status" >&5
16663   (exit $ac_status); }; }; then
16664   if test "$cross_compiling" = yes; then
16665   cf_have_curses_lib=maybe
16666 else
16667   cat >conftest.$ac_ext <<_ACEOF
16668 #line 16668 "configure"
16669 #include "confdefs.h"
16670 #include <$MENU_NAME.h>
16671                                 int main(void)
16672                                 { (void) menu_driver ( 0,0 ); return 0; }
16673 _ACEOF
16674 rm -f conftest$ac_exeext
16675 if { (eval echo "$as_me:16675: \"$ac_link\"") >&5
16676   (eval $ac_link) 2>&5
16677   ac_status=$?
16678   echo "$as_me:16678: \$? = $ac_status" >&5
16679   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16680   { (eval echo "$as_me:16680: \"$ac_try\"") >&5
16681   (eval $ac_try) 2>&5
16682   ac_status=$?
16683   echo "$as_me:16683: \$? = $ac_status" >&5
16684   (exit $ac_status); }; }; then
16685   cf_have_curses_lib=yes
16686 else
16687   echo "$as_me: program exited with status $ac_status" >&5
16688 echo "$as_me: failed program was:" >&5
16689 cat conftest.$ac_ext >&5
16690 cf_have_curses_lib=no
16691 fi
16692 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16693 fi
16694 else
16695   echo "$as_me: failed program was:" >&5
16696 cat conftest.$ac_ext >&5
16697 cf_have_curses_lib=no
16698 fi
16699 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16700                 echo "$as_me:16700: result: $cf_have_curses_lib" >&5
16701 echo "${ECHO_T}$cf_have_curses_lib" >&6
16702                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16703                 if test "$cf_have_curses_lib" != "yes"
16704                 then
16705                         CPPFLAGS="$cf_save_CPPFLAGS"
16706                         LIBS="$cf_save_LIBS"
16707                 else
16708
16709 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16710
16711                         cat >>confdefs.h <<EOF
16712 #define $cf_upper 1
16713 EOF
16714
16715                 fi
16716         fi
16717 fi
16718 if test "$cf_have_curses_lib" = no; then
16719         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16720 echo "$as_me:16720: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
16721 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16722 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16723   echo $ECHO_N "(cached) $ECHO_C" >&6
16724 else
16725   ac_check_lib_save_LIBS=$LIBS
16726 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
16727 cat >conftest.$ac_ext <<_ACEOF
16728 #line 16728 "configure"
16729 #include "confdefs.h"
16730
16731 /* Override any gcc2 internal prototype to avoid an error.  */
16732 #ifdef __cplusplus
16733 extern "C"
16734 #endif
16735 /* We use char because int might match the return type of a gcc2
16736    builtin and then its argument prototype would still apply.  */
16737 char menu_driver ();
16738 int
16739 main (void)
16740 {
16741 menu_driver ();
16742   ;
16743   return 0;
16744 }
16745 _ACEOF
16746 rm -f conftest.$ac_objext conftest$ac_exeext
16747 if { (eval echo "$as_me:16747: \"$ac_link\"") >&5
16748   (eval $ac_link) 2>&5
16749   ac_status=$?
16750   echo "$as_me:16750: \$? = $ac_status" >&5
16751   (exit $ac_status); } &&
16752          { ac_try='test -s conftest$ac_exeext'
16753   { (eval echo "$as_me:16753: \"$ac_try\"") >&5
16754   (eval $ac_try) 2>&5
16755   ac_status=$?
16756   echo "$as_me:16756: \$? = $ac_status" >&5
16757   (exit $ac_status); }; }; then
16758   eval "$as_ac_Lib=yes"
16759 else
16760   echo "$as_me: failed program was:" >&5
16761 cat conftest.$ac_ext >&5
16762 eval "$as_ac_Lib=no"
16763 fi
16764 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16765 LIBS=$ac_check_lib_save_LIBS
16766 fi
16767 echo "$as_me:16767: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16768 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16769 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16770
16771 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16772
16773 cf_add_libs="$LIBS"
16774 # reverse order
16775 cf_add_0lib=
16776 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16777 # filter duplicates
16778 for cf_add_1lib in $cf_add_0lib; do
16779         for cf_add_2lib in $cf_add_libs; do
16780                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16781                         cf_add_1lib=
16782                         break
16783                 fi
16784         done
16785         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16786 done
16787 LIBS="$cf_add_libs"
16788
16789                 cat >>confdefs.h <<EOF
16790 #define $cf_upper 1
16791 EOF
16792
16793 fi
16794
16795 fi
16796
16797         cf_curses_headers="$cf_curses_headers menu.h"
16798 fi
16799
16800 echo "$as_me:16800: checking if you want to check for form functions" >&5
16801 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16802
16803 # Check whether --enable-form or --disable-form was given.
16804 if test "${enable_form+set}" = set; then
16805   enableval="$enable_form"
16806   test "$enableval" != no && enableval=yes
16807         if test "$enableval" != "yes" ; then
16808     cf_enable_form=no
16809         else
16810                 cf_enable_form=$cf_default_form
16811         fi
16812 else
16813   enableval=yes
16814         cf_enable_form=$cf_default_form
16815
16816 fi;
16817 echo "$as_me:16817: result: $cf_enable_form" >&5
16818 echo "${ECHO_T}$cf_enable_form" >&6
16819 if test $cf_enable_form = yes
16820 then
16821         case $cf_cv_screen in
16822         (ncurses*)
16823                 ;;
16824         (curses*)
16825
16826 echo "$as_me:16826: checking for NetBSD form.h" >&5
16827 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16828 if test "${cf_cv_netbsd_form_h+set}" = set; then
16829   echo $ECHO_N "(cached) $ECHO_C" >&6
16830 else
16831
16832 cat >conftest.$ac_ext <<_ACEOF
16833 #line 16833 "configure"
16834 #include "confdefs.h"
16835
16836 #include <${cf_cv_ncurses_header:-curses.h}>
16837 #include <form.h>
16838
16839 int
16840 main (void)
16841 {
16842
16843         FORM *form;
16844         int y = current_field(form)->cursor_ypos;
16845         int x = current_field(form)->cursor_xpos;
16846
16847   ;
16848   return 0;
16849 }
16850 _ACEOF
16851 rm -f conftest.$ac_objext
16852 if { (eval echo "$as_me:16852: \"$ac_compile\"") >&5
16853   (eval $ac_compile) 2>&5
16854   ac_status=$?
16855   echo "$as_me:16855: \$? = $ac_status" >&5
16856   (exit $ac_status); } &&
16857          { ac_try='test -s conftest.$ac_objext'
16858   { (eval echo "$as_me:16858: \"$ac_try\"") >&5
16859   (eval $ac_try) 2>&5
16860   ac_status=$?
16861   echo "$as_me:16861: \$? = $ac_status" >&5
16862   (exit $ac_status); }; }; then
16863   cf_cv_netbsd_form_h=yes
16864
16865 else
16866   echo "$as_me: failed program was:" >&5
16867 cat conftest.$ac_ext >&5
16868 cf_cv_netbsd_form_h=no
16869 fi
16870 rm -f conftest.$ac_objext conftest.$ac_ext
16871
16872 fi
16873 echo "$as_me:16873: result: $cf_cv_netbsd_form_h" >&5
16874 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16875
16876 test "$cf_cv_netbsd_form_h" = yes &&
16877 cat >>confdefs.h <<\EOF
16878 #define HAVE_NETBSD_FORM_H 1
16879 EOF
16880
16881                 ;;
16882         esac
16883
16884 cf_have_curses_lib=no
16885
16886 : ${NCURSES_CONFIG_PKG:=none}
16887 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16888         :
16889 elif test "x${PKG_CONFIG:=none}" != xnone; then
16890         echo "$as_me:16890: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
16891 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
16892         if "$PKG_CONFIG" --exists $FORM_NAME$cf_cv_libtype ; then
16893                 echo "$as_me:16893: result: yes" >&5
16894 echo "${ECHO_T}yes" >&6
16895
16896                 echo "$as_me:16896: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
16897 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16898
16899                 cf_save_CPPFLAGS="$CPPFLAGS"
16900                 cf_save_LIBS="$LIBS"
16901
16902 cf_fix_cppflags=no
16903 cf_new_cflags=
16904 cf_new_cppflags=
16905 cf_new_extra_cppflags=
16906
16907 for cf_add_cflags in `$PKG_CONFIG --cflags $FORM_NAME$cf_cv_libtype`
16908 do
16909 case $cf_fix_cppflags in
16910 (no)
16911         case $cf_add_cflags in
16912         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16913                 case $cf_add_cflags in
16914                 (-D*)
16915                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16916
16917                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16918                                 && test -z "${cf_tst_cflags}" \
16919                                 && cf_fix_cppflags=yes
16920
16921                         if test $cf_fix_cppflags = yes ; then
16922
16923         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16924         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16925
16926                                 continue
16927                         elif test "${cf_tst_cflags}" = "\"'" ; then
16928
16929         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16930         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16931
16932                                 continue
16933                         fi
16934                         ;;
16935                 esac
16936                 case "$CPPFLAGS" in
16937                 (*$cf_add_cflags)
16938                         ;;
16939                 (*)
16940                         case $cf_add_cflags in
16941                         (-D*)
16942                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16943
16944 CPPFLAGS=`echo "$CPPFLAGS" | \
16945         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16946                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16947
16948                                 ;;
16949                         esac
16950
16951         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16952         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16953
16954                         ;;
16955                 esac
16956                 ;;
16957         (*)
16958
16959         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16960         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16961
16962                 ;;
16963         esac
16964         ;;
16965 (yes)
16966
16967         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16968         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16969
16970         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16971
16972         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16973                 && test -z "${cf_tst_cflags}" \
16974                 && cf_fix_cppflags=no
16975         ;;
16976 esac
16977 done
16978
16979 if test -n "$cf_new_cflags" ; then
16980
16981         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16982         CFLAGS="${CFLAGS}$cf_new_cflags"
16983
16984 fi
16985
16986 if test -n "$cf_new_cppflags" ; then
16987
16988         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16989         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16990
16991 fi
16992
16993 if test -n "$cf_new_extra_cppflags" ; then
16994
16995         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16996         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16997
16998 fi
16999
17000 cf_add_libs="$LIBS"
17001 # reverse order
17002 cf_add_0lib=
17003 for cf_add_1lib in `$PKG_CONFIG --libs $FORM_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17004 # filter duplicates
17005 for cf_add_1lib in $cf_add_0lib; do
17006         for cf_add_2lib in $cf_add_libs; do
17007                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17008                         cf_add_1lib=
17009                         break
17010                 fi
17011         done
17012         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17013 done
17014 LIBS="$cf_add_libs"
17015
17016                 cat >conftest.$ac_ext <<_ACEOF
17017 #line 17017 "configure"
17018 #include "confdefs.h"
17019 #include <$FORM_NAME.h>
17020 int
17021 main (void)
17022 {
17023 (void) form_driver ( 0,0 );
17024   ;
17025   return 0;
17026 }
17027 _ACEOF
17028 rm -f conftest.$ac_objext conftest$ac_exeext
17029 if { (eval echo "$as_me:17029: \"$ac_link\"") >&5
17030   (eval $ac_link) 2>&5
17031   ac_status=$?
17032   echo "$as_me:17032: \$? = $ac_status" >&5
17033   (exit $ac_status); } &&
17034          { ac_try='test -s conftest$ac_exeext'
17035   { (eval echo "$as_me:17035: \"$ac_try\"") >&5
17036   (eval $ac_try) 2>&5
17037   ac_status=$?
17038   echo "$as_me:17038: \$? = $ac_status" >&5
17039   (exit $ac_status); }; }; then
17040   if test "$cross_compiling" = yes; then
17041   cf_have_curses_lib=maybe
17042 else
17043   cat >conftest.$ac_ext <<_ACEOF
17044 #line 17044 "configure"
17045 #include "confdefs.h"
17046 #include <$FORM_NAME.h>
17047                                 int main(void)
17048                                 { (void) form_driver ( 0,0 ); return 0; }
17049 _ACEOF
17050 rm -f conftest$ac_exeext
17051 if { (eval echo "$as_me:17051: \"$ac_link\"") >&5
17052   (eval $ac_link) 2>&5
17053   ac_status=$?
17054   echo "$as_me:17054: \$? = $ac_status" >&5
17055   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17056   { (eval echo "$as_me:17056: \"$ac_try\"") >&5
17057   (eval $ac_try) 2>&5
17058   ac_status=$?
17059   echo "$as_me:17059: \$? = $ac_status" >&5
17060   (exit $ac_status); }; }; then
17061   cf_have_curses_lib=yes
17062 else
17063   echo "$as_me: program exited with status $ac_status" >&5
17064 echo "$as_me: failed program was:" >&5
17065 cat conftest.$ac_ext >&5
17066 cf_have_curses_lib=no
17067 fi
17068 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17069 fi
17070 else
17071   echo "$as_me: failed program was:" >&5
17072 cat conftest.$ac_ext >&5
17073 cf_have_curses_lib=no
17074 fi
17075 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17076                 echo "$as_me:17076: result: $cf_have_curses_lib" >&5
17077 echo "${ECHO_T}$cf_have_curses_lib" >&6
17078                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17079                 if test "$cf_have_curses_lib" != "yes"
17080                 then
17081                         CPPFLAGS="$cf_save_CPPFLAGS"
17082                         LIBS="$cf_save_LIBS"
17083                 else
17084
17085 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17086
17087                         cat >>confdefs.h <<EOF
17088 #define $cf_upper 1
17089 EOF
17090
17091                 fi
17092         fi
17093 fi
17094 if test "$cf_have_curses_lib" = no; then
17095         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17096 echo "$as_me:17096: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17097 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17098 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17099   echo $ECHO_N "(cached) $ECHO_C" >&6
17100 else
17101   ac_check_lib_save_LIBS=$LIBS
17102 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17103 cat >conftest.$ac_ext <<_ACEOF
17104 #line 17104 "configure"
17105 #include "confdefs.h"
17106
17107 /* Override any gcc2 internal prototype to avoid an error.  */
17108 #ifdef __cplusplus
17109 extern "C"
17110 #endif
17111 /* We use char because int might match the return type of a gcc2
17112    builtin and then its argument prototype would still apply.  */
17113 char form_driver ();
17114 int
17115 main (void)
17116 {
17117 form_driver ();
17118   ;
17119   return 0;
17120 }
17121 _ACEOF
17122 rm -f conftest.$ac_objext conftest$ac_exeext
17123 if { (eval echo "$as_me:17123: \"$ac_link\"") >&5
17124   (eval $ac_link) 2>&5
17125   ac_status=$?
17126   echo "$as_me:17126: \$? = $ac_status" >&5
17127   (exit $ac_status); } &&
17128          { ac_try='test -s conftest$ac_exeext'
17129   { (eval echo "$as_me:17129: \"$ac_try\"") >&5
17130   (eval $ac_try) 2>&5
17131   ac_status=$?
17132   echo "$as_me:17132: \$? = $ac_status" >&5
17133   (exit $ac_status); }; }; then
17134   eval "$as_ac_Lib=yes"
17135 else
17136   echo "$as_me: failed program was:" >&5
17137 cat conftest.$ac_ext >&5
17138 eval "$as_ac_Lib=no"
17139 fi
17140 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17141 LIBS=$ac_check_lib_save_LIBS
17142 fi
17143 echo "$as_me:17143: result: `eval echo '${'$as_ac_Lib'}'`" >&5
17144 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
17145 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
17146
17147 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17148
17149 cf_add_libs="$LIBS"
17150 # reverse order
17151 cf_add_0lib=
17152 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17153 # filter duplicates
17154 for cf_add_1lib in $cf_add_0lib; do
17155         for cf_add_2lib in $cf_add_libs; do
17156                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17157                         cf_add_1lib=
17158                         break
17159                 fi
17160         done
17161         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17162 done
17163 LIBS="$cf_add_libs"
17164
17165                 cat >>confdefs.h <<EOF
17166 #define $cf_upper 1
17167 EOF
17168
17169 fi
17170
17171 fi
17172
17173         cf_curses_headers="$cf_curses_headers form.h"
17174 fi
17175
17176 # look for curses-related headers
17177
17178 for ac_header in $cf_curses_headers
17179 do
17180 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17181 echo "$as_me:17181: checking for $ac_header" >&5
17182 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17183 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17184   echo $ECHO_N "(cached) $ECHO_C" >&6
17185 else
17186   cat >conftest.$ac_ext <<_ACEOF
17187 #line 17187 "configure"
17188 #include "confdefs.h"
17189 #include <$ac_header>
17190 _ACEOF
17191 if { (eval echo "$as_me:17191: \"$ac_cpp conftest.$ac_ext\"") >&5
17192   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17193   ac_status=$?
17194   egrep -v '^ *\+' conftest.er1 >conftest.err
17195   rm -f conftest.er1
17196   cat conftest.err >&5
17197   echo "$as_me:17197: \$? = $ac_status" >&5
17198   (exit $ac_status); } >/dev/null; then
17199   if test -s conftest.err; then
17200     ac_cpp_err=$ac_c_preproc_warn_flag
17201   else
17202     ac_cpp_err=
17203   fi
17204 else
17205   ac_cpp_err=yes
17206 fi
17207 if test -z "$ac_cpp_err"; then
17208   eval "$as_ac_Header=yes"
17209 else
17210   echo "$as_me: failed program was:" >&5
17211   cat conftest.$ac_ext >&5
17212   eval "$as_ac_Header=no"
17213 fi
17214 rm -f conftest.err conftest.$ac_ext
17215 fi
17216 echo "$as_me:17216: result: `eval echo '${'$as_ac_Header'}'`" >&5
17217 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17218 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17219   cat >>confdefs.h <<EOF
17220 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17221 EOF
17222
17223 fi
17224 done
17225
17226 echo "$as_me:17226: checking for ANSI C header files" >&5
17227 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17228 if test "${ac_cv_header_stdc+set}" = set; then
17229   echo $ECHO_N "(cached) $ECHO_C" >&6
17230 else
17231   cat >conftest.$ac_ext <<_ACEOF
17232 #line 17232 "configure"
17233 #include "confdefs.h"
17234 #include <stdlib.h>
17235 #include <stdarg.h>
17236 #include <string.h>
17237 #include <float.h>
17238
17239 _ACEOF
17240 if { (eval echo "$as_me:17240: \"$ac_cpp conftest.$ac_ext\"") >&5
17241   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17242   ac_status=$?
17243   egrep -v '^ *\+' conftest.er1 >conftest.err
17244   rm -f conftest.er1
17245   cat conftest.err >&5
17246   echo "$as_me:17246: \$? = $ac_status" >&5
17247   (exit $ac_status); } >/dev/null; then
17248   if test -s conftest.err; then
17249     ac_cpp_err=$ac_c_preproc_warn_flag
17250   else
17251     ac_cpp_err=
17252   fi
17253 else
17254   ac_cpp_err=yes
17255 fi
17256 if test -z "$ac_cpp_err"; then
17257   ac_cv_header_stdc=yes
17258 else
17259   echo "$as_me: failed program was:" >&5
17260   cat conftest.$ac_ext >&5
17261   ac_cv_header_stdc=no
17262 fi
17263 rm -f conftest.err conftest.$ac_ext
17264
17265 if test $ac_cv_header_stdc = yes; then
17266   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17267   cat >conftest.$ac_ext <<_ACEOF
17268 #line 17268 "configure"
17269 #include "confdefs.h"
17270 #include <string.h>
17271
17272 _ACEOF
17273 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17274   egrep "memchr" >/dev/null 2>&1; then
17275   :
17276 else
17277   ac_cv_header_stdc=no
17278 fi
17279 rm -rf conftest*
17280
17281 fi
17282
17283 if test $ac_cv_header_stdc = yes; then
17284   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17285   cat >conftest.$ac_ext <<_ACEOF
17286 #line 17286 "configure"
17287 #include "confdefs.h"
17288 #include <stdlib.h>
17289
17290 _ACEOF
17291 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17292   egrep "free" >/dev/null 2>&1; then
17293   :
17294 else
17295   ac_cv_header_stdc=no
17296 fi
17297 rm -rf conftest*
17298
17299 fi
17300
17301 if test $ac_cv_header_stdc = yes; then
17302   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17303   if test "$cross_compiling" = yes; then
17304   :
17305 else
17306   cat >conftest.$ac_ext <<_ACEOF
17307 #line 17307 "configure"
17308 #include "confdefs.h"
17309 #include <ctype.h>
17310 #if ((' ' & 0x0FF) == 0x020)
17311 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17312 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17313 #else
17314 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17315                      || ('j' <= (c) && (c) <= 'r') \
17316                      || ('s' <= (c) && (c) <= 'z'))
17317 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17318 #endif
17319
17320 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17321 int
17322 main (void)
17323 {
17324   int i;
17325   for (i = 0; i < 256; i++)
17326     if (XOR (islower (i), ISLOWER (i))
17327         || toupper (i) != TOUPPER (i))
17328       $ac_main_return(2);
17329   $ac_main_return (0);
17330 }
17331 _ACEOF
17332 rm -f conftest$ac_exeext
17333 if { (eval echo "$as_me:17333: \"$ac_link\"") >&5
17334   (eval $ac_link) 2>&5
17335   ac_status=$?
17336   echo "$as_me:17336: \$? = $ac_status" >&5
17337   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17338   { (eval echo "$as_me:17338: \"$ac_try\"") >&5
17339   (eval $ac_try) 2>&5
17340   ac_status=$?
17341   echo "$as_me:17341: \$? = $ac_status" >&5
17342   (exit $ac_status); }; }; then
17343   :
17344 else
17345   echo "$as_me: program exited with status $ac_status" >&5
17346 echo "$as_me: failed program was:" >&5
17347 cat conftest.$ac_ext >&5
17348 ac_cv_header_stdc=no
17349 fi
17350 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17351 fi
17352 fi
17353 fi
17354 echo "$as_me:17354: result: $ac_cv_header_stdc" >&5
17355 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17356 if test $ac_cv_header_stdc = yes; then
17357
17358 cat >>confdefs.h <<\EOF
17359 #define STDC_HEADERS 1
17360 EOF
17361
17362 fi
17363
17364 echo "$as_me:17364: checking whether time.h and sys/time.h may both be included" >&5
17365 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17366 if test "${ac_cv_header_time+set}" = set; then
17367   echo $ECHO_N "(cached) $ECHO_C" >&6
17368 else
17369   cat >conftest.$ac_ext <<_ACEOF
17370 #line 17370 "configure"
17371 #include "confdefs.h"
17372 #include <sys/types.h>
17373 #include <sys/time.h>
17374 #include <time.h>
17375
17376 int
17377 main (void)
17378 {
17379 if ((struct tm *) 0)
17380 return 0;
17381   ;
17382   return 0;
17383 }
17384 _ACEOF
17385 rm -f conftest.$ac_objext
17386 if { (eval echo "$as_me:17386: \"$ac_compile\"") >&5
17387   (eval $ac_compile) 2>&5
17388   ac_status=$?
17389   echo "$as_me:17389: \$? = $ac_status" >&5
17390   (exit $ac_status); } &&
17391          { ac_try='test -s conftest.$ac_objext'
17392   { (eval echo "$as_me:17392: \"$ac_try\"") >&5
17393   (eval $ac_try) 2>&5
17394   ac_status=$?
17395   echo "$as_me:17395: \$? = $ac_status" >&5
17396   (exit $ac_status); }; }; then
17397   ac_cv_header_time=yes
17398 else
17399   echo "$as_me: failed program was:" >&5
17400 cat conftest.$ac_ext >&5
17401 ac_cv_header_time=no
17402 fi
17403 rm -f conftest.$ac_objext conftest.$ac_ext
17404 fi
17405 echo "$as_me:17405: result: $ac_cv_header_time" >&5
17406 echo "${ECHO_T}$ac_cv_header_time" >&6
17407 if test $ac_cv_header_time = yes; then
17408
17409 cat >>confdefs.h <<\EOF
17410 #define TIME_WITH_SYS_TIME 1
17411 EOF
17412
17413 fi
17414
17415 for ac_header in \
17416 getopt.h \
17417 locale.h \
17418 math.h \
17419 stdarg.h \
17420 stdint.h \
17421 sys/ioctl.h \
17422 sys/select.h \
17423 sys/time.h \
17424 termios.h \
17425 unistd.h \
17426
17427 do
17428 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17429 echo "$as_me:17429: checking for $ac_header" >&5
17430 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17431 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17432   echo $ECHO_N "(cached) $ECHO_C" >&6
17433 else
17434   cat >conftest.$ac_ext <<_ACEOF
17435 #line 17435 "configure"
17436 #include "confdefs.h"
17437 #include <$ac_header>
17438 _ACEOF
17439 if { (eval echo "$as_me:17439: \"$ac_cpp conftest.$ac_ext\"") >&5
17440   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17441   ac_status=$?
17442   egrep -v '^ *\+' conftest.er1 >conftest.err
17443   rm -f conftest.er1
17444   cat conftest.err >&5
17445   echo "$as_me:17445: \$? = $ac_status" >&5
17446   (exit $ac_status); } >/dev/null; then
17447   if test -s conftest.err; then
17448     ac_cpp_err=$ac_c_preproc_warn_flag
17449   else
17450     ac_cpp_err=
17451   fi
17452 else
17453   ac_cpp_err=yes
17454 fi
17455 if test -z "$ac_cpp_err"; then
17456   eval "$as_ac_Header=yes"
17457 else
17458   echo "$as_me: failed program was:" >&5
17459   cat conftest.$ac_ext >&5
17460   eval "$as_ac_Header=no"
17461 fi
17462 rm -f conftest.err conftest.$ac_ext
17463 fi
17464 echo "$as_me:17464: result: `eval echo '${'$as_ac_Header'}'`" >&5
17465 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17466 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17467   cat >>confdefs.h <<EOF
17468 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17469 EOF
17470
17471 fi
17472 done
17473
17474 for ac_header in unistd.h getopt.h
17475 do
17476 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17477 echo "$as_me:17477: checking for $ac_header" >&5
17478 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17479 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17480   echo $ECHO_N "(cached) $ECHO_C" >&6
17481 else
17482   cat >conftest.$ac_ext <<_ACEOF
17483 #line 17483 "configure"
17484 #include "confdefs.h"
17485 #include <$ac_header>
17486 _ACEOF
17487 if { (eval echo "$as_me:17487: \"$ac_cpp conftest.$ac_ext\"") >&5
17488   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17489   ac_status=$?
17490   egrep -v '^ *\+' conftest.er1 >conftest.err
17491   rm -f conftest.er1
17492   cat conftest.err >&5
17493   echo "$as_me:17493: \$? = $ac_status" >&5
17494   (exit $ac_status); } >/dev/null; then
17495   if test -s conftest.err; then
17496     ac_cpp_err=$ac_c_preproc_warn_flag
17497   else
17498     ac_cpp_err=
17499   fi
17500 else
17501   ac_cpp_err=yes
17502 fi
17503 if test -z "$ac_cpp_err"; then
17504   eval "$as_ac_Header=yes"
17505 else
17506   echo "$as_me: failed program was:" >&5
17507   cat conftest.$ac_ext >&5
17508   eval "$as_ac_Header=no"
17509 fi
17510 rm -f conftest.err conftest.$ac_ext
17511 fi
17512 echo "$as_me:17512: result: `eval echo '${'$as_ac_Header'}'`" >&5
17513 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17514 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17515   cat >>confdefs.h <<EOF
17516 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17517 EOF
17518
17519 fi
17520 done
17521
17522 echo "$as_me:17522: checking for header declaring getopt variables" >&5
17523 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17524 if test "${cf_cv_getopt_header+set}" = set; then
17525   echo $ECHO_N "(cached) $ECHO_C" >&6
17526 else
17527
17528 cf_cv_getopt_header=none
17529 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17530 do
17531 cat >conftest.$ac_ext <<_ACEOF
17532 #line 17532 "configure"
17533 #include "confdefs.h"
17534
17535 #include <$cf_header>
17536 int
17537 main (void)
17538 {
17539 int x = optind; char *y = optarg
17540   ;
17541   return 0;
17542 }
17543 _ACEOF
17544 rm -f conftest.$ac_objext
17545 if { (eval echo "$as_me:17545: \"$ac_compile\"") >&5
17546   (eval $ac_compile) 2>&5
17547   ac_status=$?
17548   echo "$as_me:17548: \$? = $ac_status" >&5
17549   (exit $ac_status); } &&
17550          { ac_try='test -s conftest.$ac_objext'
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   cf_cv_getopt_header=$cf_header
17557  break
17558 else
17559   echo "$as_me: failed program was:" >&5
17560 cat conftest.$ac_ext >&5
17561 fi
17562 rm -f conftest.$ac_objext conftest.$ac_ext
17563 done
17564
17565 fi
17566 echo "$as_me:17566: result: $cf_cv_getopt_header" >&5
17567 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17568 if test $cf_cv_getopt_header != none ; then
17569
17570 cat >>confdefs.h <<\EOF
17571 #define HAVE_GETOPT_HEADER 1
17572 EOF
17573
17574 fi
17575 if test $cf_cv_getopt_header = getopt.h ; then
17576
17577 cat >>confdefs.h <<\EOF
17578 #define NEED_GETOPT_H 1
17579 EOF
17580
17581 fi
17582
17583 for ac_func in \
17584 getopt \
17585 gettimeofday \
17586 snprintf \
17587 strdup \
17588 strstr \
17589 tsearch \
17590
17591 do
17592 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17593 echo "$as_me:17593: checking for $ac_func" >&5
17594 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17595 if eval "test \"\${$as_ac_var+set}\" = set"; then
17596   echo $ECHO_N "(cached) $ECHO_C" >&6
17597 else
17598   cat >conftest.$ac_ext <<_ACEOF
17599 #line 17599 "configure"
17600 #include "confdefs.h"
17601 #define $ac_func autoconf_temporary
17602 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17603 #undef $ac_func
17604
17605 #ifdef __cplusplus
17606 extern "C"
17607 #endif
17608
17609 /* We use char because int might match the return type of a gcc2
17610    builtin and then its argument prototype would still apply.  */
17611 char $ac_func (void);
17612
17613 int
17614 main (void)
17615 {
17616
17617 /* The GNU C library defines stubs for functions which it implements
17618     to always fail with ENOSYS.  Some functions are actually named
17619     something starting with __ and the normal name is an alias.  */
17620 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17621 #error found stub for $ac_func
17622 #endif
17623
17624         return $ac_func ();
17625   ;
17626   return 0;
17627 }
17628 _ACEOF
17629 rm -f conftest.$ac_objext conftest$ac_exeext
17630 if { (eval echo "$as_me:17630: \"$ac_link\"") >&5
17631   (eval $ac_link) 2>&5
17632   ac_status=$?
17633   echo "$as_me:17633: \$? = $ac_status" >&5
17634   (exit $ac_status); } &&
17635          { ac_try='test -s conftest$ac_exeext'
17636   { (eval echo "$as_me:17636: \"$ac_try\"") >&5
17637   (eval $ac_try) 2>&5
17638   ac_status=$?
17639   echo "$as_me:17639: \$? = $ac_status" >&5
17640   (exit $ac_status); }; }; then
17641   eval "$as_ac_var=yes"
17642 else
17643   echo "$as_me: failed program was:" >&5
17644 cat conftest.$ac_ext >&5
17645 eval "$as_ac_var=no"
17646 fi
17647 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17648 fi
17649 echo "$as_me:17649: result: `eval echo '${'$as_ac_var'}'`" >&5
17650 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17651 if test `eval echo '${'$as_ac_var'}'` = yes; then
17652   cat >>confdefs.h <<EOF
17653 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17654 EOF
17655
17656 fi
17657 done
17658
17659 # use a compile-check to work with ncurses*-config and subdirectory includes
17660 echo "$as_me:17660: checking if we can use termcap.h" >&5
17661 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17662 if test "${cf_cv_have_termcap_h+set}" = set; then
17663   echo $ECHO_N "(cached) $ECHO_C" >&6
17664 else
17665
17666         cat >conftest.$ac_ext <<_ACEOF
17667 #line 17667 "configure"
17668 #include "confdefs.h"
17669
17670 #include <curses.h>
17671 #ifdef NCURSES_VERSION
17672 #undef NCURSES_VERSION
17673 #endif
17674 #include <termcap.h>
17675 #ifndef NCURSES_VERSION
17676 #error wrong header
17677 #endif
17678
17679 int
17680 main (void)
17681 {
17682 return 0;
17683   ;
17684   return 0;
17685 }
17686 _ACEOF
17687 rm -f conftest.$ac_objext
17688 if { (eval echo "$as_me:17688: \"$ac_compile\"") >&5
17689   (eval $ac_compile) 2>&5
17690   ac_status=$?
17691   echo "$as_me:17691: \$? = $ac_status" >&5
17692   (exit $ac_status); } &&
17693          { ac_try='test -s conftest.$ac_objext'
17694   { (eval echo "$as_me:17694: \"$ac_try\"") >&5
17695   (eval $ac_try) 2>&5
17696   ac_status=$?
17697   echo "$as_me:17697: \$? = $ac_status" >&5
17698   (exit $ac_status); }; }; then
17699   cf_cv_have_termcap_h=yes
17700 else
17701   echo "$as_me: failed program was:" >&5
17702 cat conftest.$ac_ext >&5
17703 cf_cv_have_termcap_h=no
17704 fi
17705 rm -f conftest.$ac_objext conftest.$ac_ext
17706 fi
17707 echo "$as_me:17707: result: $cf_cv_have_termcap_h" >&5
17708 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17709 if test "x$cf_cv_have_termcap_h" = xyes
17710 then
17711
17712 cat >>confdefs.h <<\EOF
17713 #define HAVE_TERMCAP_H 1
17714 EOF
17715
17716 else
17717 echo "$as_me:17717: checking if we can use ncurses/termcap.h" >&5
17718 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17719 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17720   echo $ECHO_N "(cached) $ECHO_C" >&6
17721 else
17722
17723         cat >conftest.$ac_ext <<_ACEOF
17724 #line 17724 "configure"
17725 #include "confdefs.h"
17726
17727 #include <ncurses/curses.h>
17728 #ifdef NCURSES_VERSION
17729 #undef NCURSES_VERSION
17730 #endif
17731 #include <ncurses/termcap.h>
17732 #ifndef NCURSES_VERSION
17733 #error wrong header
17734 #endif
17735
17736 int
17737 main (void)
17738 {
17739 return 0;
17740   ;
17741   return 0;
17742 }
17743 _ACEOF
17744 rm -f conftest.$ac_objext
17745 if { (eval echo "$as_me:17745: \"$ac_compile\"") >&5
17746   (eval $ac_compile) 2>&5
17747   ac_status=$?
17748   echo "$as_me:17748: \$? = $ac_status" >&5
17749   (exit $ac_status); } &&
17750          { ac_try='test -s conftest.$ac_objext'
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   cf_cv_have_ncurses_termcap_h=yes
17757 else
17758   echo "$as_me: failed program was:" >&5
17759 cat conftest.$ac_ext >&5
17760 cf_cv_have_ncurses_termcap_h=no
17761 fi
17762 rm -f conftest.$ac_objext conftest.$ac_ext
17763 fi
17764 echo "$as_me:17764: result: $cf_cv_have_ncurses_termcap_h" >&5
17765 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17766 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
17767 cat >>confdefs.h <<\EOF
17768 #define HAVE_NCURSES_TERMCAP_H 1
17769 EOF
17770
17771 fi
17772
17773 if test "x$ac_cv_func_getopt" = xno; then
17774         { { echo "$as_me:17774: error: getopt is required for building programs" >&5
17775 echo "$as_me: error: getopt is required for building programs" >&2;}
17776    { (exit 1); exit 1; }; }
17777 fi
17778
17779 if test "$cf_enable_widec" = yes; then
17780
17781 for ac_func in \
17782 mblen \
17783 mbrlen \
17784 mbrtowc \
17785 mbsrtowcs \
17786 mbstowcs \
17787 mbtowc \
17788 wcsrtombs \
17789 wcstombs \
17790
17791 do
17792 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17793 echo "$as_me:17793: checking for $ac_func" >&5
17794 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17795 if eval "test \"\${$as_ac_var+set}\" = set"; then
17796   echo $ECHO_N "(cached) $ECHO_C" >&6
17797 else
17798   cat >conftest.$ac_ext <<_ACEOF
17799 #line 17799 "configure"
17800 #include "confdefs.h"
17801 #define $ac_func autoconf_temporary
17802 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17803 #undef $ac_func
17804
17805 #ifdef __cplusplus
17806 extern "C"
17807 #endif
17808
17809 /* We use char because int might match the return type of a gcc2
17810    builtin and then its argument prototype would still apply.  */
17811 char $ac_func (void);
17812
17813 int
17814 main (void)
17815 {
17816
17817 /* The GNU C library defines stubs for functions which it implements
17818     to always fail with ENOSYS.  Some functions are actually named
17819     something starting with __ and the normal name is an alias.  */
17820 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17821 #error found stub for $ac_func
17822 #endif
17823
17824         return $ac_func ();
17825   ;
17826   return 0;
17827 }
17828 _ACEOF
17829 rm -f conftest.$ac_objext conftest$ac_exeext
17830 if { (eval echo "$as_me:17830: \"$ac_link\"") >&5
17831   (eval $ac_link) 2>&5
17832   ac_status=$?
17833   echo "$as_me:17833: \$? = $ac_status" >&5
17834   (exit $ac_status); } &&
17835          { ac_try='test -s conftest$ac_exeext'
17836   { (eval echo "$as_me:17836: \"$ac_try\"") >&5
17837   (eval $ac_try) 2>&5
17838   ac_status=$?
17839   echo "$as_me:17839: \$? = $ac_status" >&5
17840   (exit $ac_status); }; }; then
17841   eval "$as_ac_var=yes"
17842 else
17843   echo "$as_me: failed program was:" >&5
17844 cat conftest.$ac_ext >&5
17845 eval "$as_ac_var=no"
17846 fi
17847 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17848 fi
17849 echo "$as_me:17849: result: `eval echo '${'$as_ac_var'}'`" >&5
17850 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17851 if test `eval echo '${'$as_ac_var'}'` = yes; then
17852   cat >>confdefs.h <<EOF
17853 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17854 EOF
17855
17856 fi
17857 done
17858
17859 fi
17860
17861 echo "$as_me:17861: checking definition to turn on extended curses functions" >&5
17862 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17863 if test "${cf_cv_need_xopen_extension+set}" = set; then
17864   echo $ECHO_N "(cached) $ECHO_C" >&6
17865 else
17866
17867 cf_cv_need_xopen_extension=unknown
17868 cat >conftest.$ac_ext <<_ACEOF
17869 #line 17869 "configure"
17870 #include "confdefs.h"
17871
17872 #include <stdlib.h>
17873 #include <${cf_cv_ncurses_header:-curses.h}>
17874 int
17875 main (void)
17876 {
17877
17878 #if defined(NCURSES_VERSION_PATCH)
17879 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17880         make an error
17881 #endif
17882 #endif
17883 #ifdef NCURSES_VERSION
17884         cchar_t check;
17885         int check2 = curs_set((int)sizeof(check));
17886 #endif
17887         long x = winnstr(stdscr, "", 0);
17888         int x1, y1;
17889 #ifdef NCURSES_VERSION
17890         (void)check2;
17891 #endif
17892         getbegyx(stdscr, y1, x1);
17893         (void)x;
17894         (void)y1;
17895         (void)x1;
17896
17897   ;
17898   return 0;
17899 }
17900 _ACEOF
17901 rm -f conftest.$ac_objext conftest$ac_exeext
17902 if { (eval echo "$as_me:17902: \"$ac_link\"") >&5
17903   (eval $ac_link) 2>&5
17904   ac_status=$?
17905   echo "$as_me:17905: \$? = $ac_status" >&5
17906   (exit $ac_status); } &&
17907          { ac_try='test -s conftest$ac_exeext'
17908   { (eval echo "$as_me:17908: \"$ac_try\"") >&5
17909   (eval $ac_try) 2>&5
17910   ac_status=$?
17911   echo "$as_me:17911: \$? = $ac_status" >&5
17912   (exit $ac_status); }; }; then
17913   cf_cv_need_xopen_extension=none
17914 else
17915   echo "$as_me: failed program was:" >&5
17916 cat conftest.$ac_ext >&5
17917
17918         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17919         do
17920                 cat >conftest.$ac_ext <<_ACEOF
17921 #line 17921 "configure"
17922 #include "confdefs.h"
17923
17924 #define $cf_try_xopen_extension 1
17925 #include <stdlib.h>
17926 #include <${cf_cv_ncurses_header:-curses.h}>
17927 int
17928 main (void)
17929 {
17930
17931 #ifdef NCURSES_VERSION
17932                 cchar_t check;
17933                 int check2 = curs_set((int)sizeof(check));
17934 #endif
17935                 long x = winnstr(stdscr, "", 0);
17936                 int x1, y1;
17937                 getbegyx(stdscr, y1, x1);
17938 #ifdef NCURSES_VERSION
17939                 (void)check2;
17940 #endif
17941                 (void)x;
17942                 (void)y1;
17943                 (void)x1;
17944
17945   ;
17946   return 0;
17947 }
17948 _ACEOF
17949 rm -f conftest.$ac_objext conftest$ac_exeext
17950 if { (eval echo "$as_me:17950: \"$ac_link\"") >&5
17951   (eval $ac_link) 2>&5
17952   ac_status=$?
17953   echo "$as_me:17953: \$? = $ac_status" >&5
17954   (exit $ac_status); } &&
17955          { ac_try='test -s conftest$ac_exeext'
17956   { (eval echo "$as_me:17956: \"$ac_try\"") >&5
17957   (eval $ac_try) 2>&5
17958   ac_status=$?
17959   echo "$as_me:17959: \$? = $ac_status" >&5
17960   (exit $ac_status); }; }; then
17961   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17962 else
17963   echo "$as_me: failed program was:" >&5
17964 cat conftest.$ac_ext >&5
17965 fi
17966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17967         done
17968
17969 fi
17970 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17971
17972 fi
17973 echo "$as_me:17973: result: $cf_cv_need_xopen_extension" >&5
17974 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17975
17976 case $cf_cv_need_xopen_extension in
17977 (*_*)
17978
17979         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17980         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17981
17982         ;;
17983 esac
17984
17985 echo "$as_me:17985: checking for term.h" >&5
17986 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17987 if test "${cf_cv_term_header+set}" = set; then
17988   echo $ECHO_N "(cached) $ECHO_C" >&6
17989 else
17990
17991 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17992 # for <term.h> if we do not find the variant.
17993
17994 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17995
17996 case ${cf_cv_ncurses_header:-curses.h} in
17997 (*/*)
17998         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17999         cf_header_list="$cf_header_item $cf_header_list"
18000         ;;
18001 esac
18002
18003 for cf_header in $cf_header_list
18004 do
18005         cat >conftest.$ac_ext <<_ACEOF
18006 #line 18006 "configure"
18007 #include "confdefs.h"
18008
18009 #include <${cf_cv_ncurses_header:-curses.h}>
18010 #include <${cf_header}>
18011 int
18012 main (void)
18013 {
18014 WINDOW *x; (void)x
18015   ;
18016   return 0;
18017 }
18018 _ACEOF
18019 rm -f conftest.$ac_objext
18020 if { (eval echo "$as_me:18020: \"$ac_compile\"") >&5
18021   (eval $ac_compile) 2>&5
18022   ac_status=$?
18023   echo "$as_me:18023: \$? = $ac_status" >&5
18024   (exit $ac_status); } &&
18025          { ac_try='test -s conftest.$ac_objext'
18026   { (eval echo "$as_me:18026: \"$ac_try\"") >&5
18027   (eval $ac_try) 2>&5
18028   ac_status=$?
18029   echo "$as_me:18029: \$? = $ac_status" >&5
18030   (exit $ac_status); }; }; then
18031   cf_cv_term_header=$cf_header
18032          break
18033 else
18034   echo "$as_me: failed program was:" >&5
18035 cat conftest.$ac_ext >&5
18036 cf_cv_term_header=no
18037 fi
18038 rm -f conftest.$ac_objext conftest.$ac_ext
18039 done
18040
18041 case $cf_cv_term_header in
18042 (no)
18043         # If curses is ncurses, some packagers still mess it up by trying to make
18044         # us use GNU termcap.  This handles the most common case.
18045         for cf_header in ncurses/term.h ncursesw/term.h
18046         do
18047                 cat >conftest.$ac_ext <<_ACEOF
18048 #line 18048 "configure"
18049 #include "confdefs.h"
18050
18051 #include <${cf_cv_ncurses_header:-curses.h}>
18052 #ifdef NCURSES_VERSION
18053 #include <${cf_header}>
18054 #else
18055 make an error
18056 #endif
18057 int
18058 main (void)
18059 {
18060 WINDOW *x; (void)x
18061   ;
18062   return 0;
18063 }
18064 _ACEOF
18065 rm -f conftest.$ac_objext
18066 if { (eval echo "$as_me:18066: \"$ac_compile\"") >&5
18067   (eval $ac_compile) 2>&5
18068   ac_status=$?
18069   echo "$as_me:18069: \$? = $ac_status" >&5
18070   (exit $ac_status); } &&
18071          { ac_try='test -s conftest.$ac_objext'
18072   { (eval echo "$as_me:18072: \"$ac_try\"") >&5
18073   (eval $ac_try) 2>&5
18074   ac_status=$?
18075   echo "$as_me:18075: \$? = $ac_status" >&5
18076   (exit $ac_status); }; }; then
18077   cf_cv_term_header=$cf_header
18078                          break
18079 else
18080   echo "$as_me: failed program was:" >&5
18081 cat conftest.$ac_ext >&5
18082 cf_cv_term_header=no
18083 fi
18084 rm -f conftest.$ac_objext conftest.$ac_ext
18085         done
18086         ;;
18087 esac
18088
18089 fi
18090 echo "$as_me:18090: result: $cf_cv_term_header" >&5
18091 echo "${ECHO_T}$cf_cv_term_header" >&6
18092
18093 case $cf_cv_term_header in
18094 (term.h)
18095
18096 cat >>confdefs.h <<\EOF
18097 #define HAVE_TERM_H 1
18098 EOF
18099
18100         ;;
18101 (ncurses/term.h)
18102
18103 cat >>confdefs.h <<\EOF
18104 #define HAVE_NCURSES_TERM_H 1
18105 EOF
18106
18107         ;;
18108 (ncursesw/term.h)
18109
18110 cat >>confdefs.h <<\EOF
18111 #define HAVE_NCURSESW_TERM_H 1
18112 EOF
18113
18114         ;;
18115 esac
18116
18117 echo "$as_me:18117: checking for unctrl.h" >&5
18118 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18119 if test "${cf_cv_unctrl_header+set}" = set; then
18120   echo $ECHO_N "(cached) $ECHO_C" >&6
18121 else
18122
18123 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18124 # for <unctrl.h> if we do not find the variant.
18125
18126 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18127
18128 case ${cf_cv_ncurses_header:-curses.h} in
18129 (*/*)
18130         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18131         cf_header_list="$cf_header_item $cf_header_list"
18132         ;;
18133 esac
18134
18135 for cf_header in $cf_header_list
18136 do
18137         cat >conftest.$ac_ext <<_ACEOF
18138 #line 18138 "configure"
18139 #include "confdefs.h"
18140
18141 #include <${cf_cv_ncurses_header:-curses.h}>
18142 #include <${cf_header}>
18143 int
18144 main (void)
18145 {
18146 WINDOW *x; (void)x
18147   ;
18148   return 0;
18149 }
18150 _ACEOF
18151 rm -f conftest.$ac_objext
18152 if { (eval echo "$as_me:18152: \"$ac_compile\"") >&5
18153   (eval $ac_compile) 2>&5
18154   ac_status=$?
18155   echo "$as_me:18155: \$? = $ac_status" >&5
18156   (exit $ac_status); } &&
18157          { ac_try='test -s conftest.$ac_objext'
18158   { (eval echo "$as_me:18158: \"$ac_try\"") >&5
18159   (eval $ac_try) 2>&5
18160   ac_status=$?
18161   echo "$as_me:18161: \$? = $ac_status" >&5
18162   (exit $ac_status); }; }; then
18163   cf_cv_unctrl_header=$cf_header
18164          break
18165 else
18166   echo "$as_me: failed program was:" >&5
18167 cat conftest.$ac_ext >&5
18168 cf_cv_unctrl_header=no
18169 fi
18170 rm -f conftest.$ac_objext conftest.$ac_ext
18171 done
18172
18173 fi
18174 echo "$as_me:18174: result: $cf_cv_unctrl_header" >&5
18175 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18176
18177 case $cf_cv_unctrl_header in
18178 (no)
18179         { echo "$as_me:18179: WARNING: unctrl.h header not found" >&5
18180 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18181         ;;
18182 esac
18183
18184 case $cf_cv_unctrl_header in
18185 (unctrl.h)
18186
18187 cat >>confdefs.h <<\EOF
18188 #define HAVE_UNCTRL_H 1
18189 EOF
18190
18191         ;;
18192 (ncurses/unctrl.h)
18193
18194 cat >>confdefs.h <<\EOF
18195 #define HAVE_NCURSES_UNCTRL_H 1
18196 EOF
18197
18198         ;;
18199 (ncursesw/unctrl.h)
18200
18201 cat >>confdefs.h <<\EOF
18202 #define HAVE_NCURSESW_UNCTRL_H 1
18203 EOF
18204
18205         ;;
18206 esac
18207
18208 for cf_func in \
18209 alloc_pair \
18210 assume_default_colors \
18211 chgat \
18212 color_content \
18213 color_set \
18214 copywin \
18215 delscreen \
18216 dupwin \
18217 exit_curses \
18218 exit_terminfo \
18219 filter \
18220 getbegx \
18221 getcurx \
18222 getmaxx \
18223 getnstr \
18224 getparx \
18225 getwin \
18226 halfdelay \
18227 init_extended_color \
18228 mvderwin \
18229 mvvline \
18230 mvwin \
18231 mvwvline \
18232 napms \
18233 newpad \
18234 putwin \
18235 reset_color_pairs \
18236 resize_term \
18237 resizeterm \
18238 restartterm \
18239 ripoffline \
18240 scr_dump \
18241 setupterm \
18242 slk_color \
18243 slk_init \
18244 termattrs \
18245 termname \
18246 tgetent \
18247 tigetnum \
18248 tigetstr \
18249 tputs_sp \
18250 typeahead \
18251 use_default_colors \
18252 use_env \
18253 use_extended_names \
18254 use_screen \
18255 use_window \
18256 vid_puts \
18257 vidputs \
18258 vsscanf \
18259 vw_printw \
18260 wchgat \
18261 winsdelln \
18262 winsstr \
18263 wresize \
18264 wsyncdown \
18265 _tracef \
18266
18267 do
18268
18269 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18270
18271         echo "$as_me:18271: checking for ${cf_func}" >&5
18272 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18273
18274 echo "${as_me:-configure}:18274: testing ${cf_func} ..." 1>&5
18275
18276         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18277   echo $ECHO_N "(cached) $ECHO_C" >&6
18278 else
18279
18280                 eval cf_result='$ac_cv_func_'$cf_func
18281                 if test ".$cf_result" != ".no"; then
18282                         cat >conftest.$ac_ext <<_ACEOF
18283 #line 18283 "configure"
18284 #include "confdefs.h"
18285
18286 #ifdef HAVE_XCURSES
18287 #include <xcurses.h>
18288 char * XCursesProgramName = "test";
18289 #else
18290 #include <${cf_cv_ncurses_header:-curses.h}>
18291 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18292 #include <ncursesw/term.h>
18293 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18294 #include <ncurses/term.h>
18295 #elif defined(HAVE_TERM_H)
18296 #include <term.h>
18297 #endif
18298 #endif
18299
18300 int
18301 main (void)
18302 {
18303
18304 #ifndef ${cf_func}
18305 long foo = (long)(&${cf_func});
18306 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18307 if (foo + 1234L > 5678L)
18308         ${cf_cv_main_return:-return}(foo != 0);
18309 #endif
18310
18311   ;
18312   return 0;
18313 }
18314 _ACEOF
18315 rm -f conftest.$ac_objext conftest$ac_exeext
18316 if { (eval echo "$as_me:18316: \"$ac_link\"") >&5
18317   (eval $ac_link) 2>&5
18318   ac_status=$?
18319   echo "$as_me:18319: \$? = $ac_status" >&5
18320   (exit $ac_status); } &&
18321          { ac_try='test -s conftest$ac_exeext'
18322   { (eval echo "$as_me:18322: \"$ac_try\"") >&5
18323   (eval $ac_try) 2>&5
18324   ac_status=$?
18325   echo "$as_me:18325: \$? = $ac_status" >&5
18326   (exit $ac_status); }; }; then
18327   cf_result=yes
18328 else
18329   echo "$as_me: failed program was:" >&5
18330 cat conftest.$ac_ext >&5
18331 cf_result=no
18332 fi
18333 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18334                 fi
18335                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18336
18337 fi
18338
18339         # use the computed/retrieved cache-value:
18340         eval 'cf_result=$cf_cv_func_'$cf_func
18341         echo "$as_me:18341: result: $cf_result" >&5
18342 echo "${ECHO_T}$cf_result" >&6
18343         if test $cf_result != no; then
18344                 cat >>confdefs.h <<EOF
18345 #define HAVE_${cf_tr_func} 1
18346 EOF
18347
18348         fi
18349 done
18350
18351 for cf_func in tputs
18352 do
18353
18354 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18355
18356         echo "$as_me:18356: checking for ${cf_func}" >&5
18357 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18358
18359 echo "${as_me:-configure}:18359: testing ${cf_func} ..." 1>&5
18360
18361         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18362   echo $ECHO_N "(cached) $ECHO_C" >&6
18363 else
18364
18365                 eval cf_result='$ac_cv_func_'$cf_func
18366                 if test ".$cf_result" != ".no"; then
18367                         cat >conftest.$ac_ext <<_ACEOF
18368 #line 18368 "configure"
18369 #include "confdefs.h"
18370
18371 #ifdef HAVE_XCURSES
18372 #include <xcurses.h>
18373 char * XCursesProgramName = "test";
18374 #else
18375 #include <${cf_cv_ncurses_header:-curses.h}>
18376 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18377 #include <ncursesw/term.h>
18378 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18379 #include <ncurses/term.h>
18380 #elif defined(HAVE_TERM_H)
18381 #include <term.h>
18382 #endif
18383 #endif
18384
18385 int
18386 main (void)
18387 {
18388
18389 #ifndef ${cf_func}
18390 long foo = (long)(&${cf_func});
18391 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18392 if (foo + 1234L > 5678L)
18393         ${cf_cv_main_return:-return}(foo != 0);
18394 #endif
18395
18396   ;
18397   return 0;
18398 }
18399 _ACEOF
18400 rm -f conftest.$ac_objext conftest$ac_exeext
18401 if { (eval echo "$as_me:18401: \"$ac_link\"") >&5
18402   (eval $ac_link) 2>&5
18403   ac_status=$?
18404   echo "$as_me:18404: \$? = $ac_status" >&5
18405   (exit $ac_status); } &&
18406          { ac_try='test -s conftest$ac_exeext'
18407   { (eval echo "$as_me:18407: \"$ac_try\"") >&5
18408   (eval $ac_try) 2>&5
18409   ac_status=$?
18410   echo "$as_me:18410: \$? = $ac_status" >&5
18411   (exit $ac_status); }; }; then
18412   cf_result=yes
18413 else
18414   echo "$as_me: failed program was:" >&5
18415 cat conftest.$ac_ext >&5
18416 cf_result=no
18417 fi
18418 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18419                 fi
18420                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18421
18422 fi
18423
18424         # use the computed/retrieved cache-value:
18425         eval 'cf_result=$cf_cv_func_'$cf_func
18426         echo "$as_me:18426: result: $cf_result" >&5
18427 echo "${ECHO_T}$cf_result" >&6
18428         if test $cf_result != no; then
18429                 cat >>confdefs.h <<EOF
18430 #define HAVE_${cf_tr_func} 1
18431 EOF
18432
18433         fi
18434 done
18435
18436 if test x$cf_cv_func_tputs = xyes
18437 then
18438         cf_done=no
18439         for cf_arg in int char
18440         do
18441                 for cf_ret in int void
18442                 do
18443                         if test $cf_ret = void
18444                         then
18445                                 cf_return="/* nothing */"
18446                         else
18447                                 cf_return="return value"
18448                         fi
18449                         cat >conftest.$ac_ext <<_ACEOF
18450 #line 18450 "configure"
18451 #include "confdefs.h"
18452
18453 #include <${cf_cv_ncurses_header:-curses.h}>
18454 #include <$cf_cv_term_header>
18455
18456 static $cf_ret outc($cf_arg value) { $cf_return; }
18457
18458 int
18459 main (void)
18460 {
18461
18462         tputs("hello", 0, outc);
18463         ${cf_cv_main_return:-return}(0);
18464
18465   ;
18466   return 0;
18467 }
18468 _ACEOF
18469 rm -f conftest.$ac_objext
18470 if { (eval echo "$as_me:18470: \"$ac_compile\"") >&5
18471   (eval $ac_compile) 2>&5
18472   ac_status=$?
18473   echo "$as_me:18473: \$? = $ac_status" >&5
18474   (exit $ac_status); } &&
18475          { ac_try='test -s conftest.$ac_objext'
18476   { (eval echo "$as_me:18476: \"$ac_try\"") >&5
18477   (eval $ac_try) 2>&5
18478   ac_status=$?
18479   echo "$as_me:18479: \$? = $ac_status" >&5
18480   (exit $ac_status); }; }; then
18481
18482                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18483
18484 echo "${as_me:-configure}:18484: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18485
18486                 cat >>confdefs.h <<EOF
18487 #define TPUTS_ARG               $cf_arg
18488 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18489 #define TPUTS_RETURN(value)     $cf_return
18490 EOF
18491                 cf_done=yes
18492                 break
18493
18494 else
18495   echo "$as_me: failed program was:" >&5
18496 cat conftest.$ac_ext >&5
18497 fi
18498 rm -f conftest.$ac_objext conftest.$ac_ext
18499                 done
18500                 test $cf_done = yes && break
18501         done
18502 fi
18503
18504 echo "$as_me:18504: checking for ncurses extended functions" >&5
18505 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18506 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18507   echo $ECHO_N "(cached) $ECHO_C" >&6
18508 else
18509
18510 cat >conftest.$ac_ext <<_ACEOF
18511 #line 18511 "configure"
18512 #include "confdefs.h"
18513
18514 #include <${cf_cv_ncurses_header:-curses.h}>
18515 int
18516 main (void)
18517 {
18518
18519 int x = NCURSES_EXT_FUNCS
18520
18521   ;
18522   return 0;
18523 }
18524 _ACEOF
18525 rm -f conftest.$ac_objext
18526 if { (eval echo "$as_me:18526: \"$ac_compile\"") >&5
18527   (eval $ac_compile) 2>&5
18528   ac_status=$?
18529   echo "$as_me:18529: \$? = $ac_status" >&5
18530   (exit $ac_status); } &&
18531          { ac_try='test -s conftest.$ac_objext'
18532   { (eval echo "$as_me:18532: \"$ac_try\"") >&5
18533   (eval $ac_try) 2>&5
18534   ac_status=$?
18535   echo "$as_me:18535: \$? = $ac_status" >&5
18536   (exit $ac_status); }; }; then
18537   cf_cv_ncurses_ext_funcs=defined
18538 else
18539   echo "$as_me: failed program was:" >&5
18540 cat conftest.$ac_ext >&5
18541
18542 cat >conftest.$ac_ext <<_ACEOF
18543 #line 18543 "configure"
18544 #include "confdefs.h"
18545
18546 #include <${cf_cv_ncurses_header:-curses.h}>
18547 int
18548 main (void)
18549 {
18550
18551         (void) assume_default_colors (0, 0);
18552         (void) curses_version ();
18553         (void) define_key (0, 0);
18554         (void) is_term_resized (0, 0);
18555         (void) key_defined (0);
18556         (void) keybound (0, 0);
18557         (void) keyok (0, 0);
18558         (void) resize_term (0, 0);
18559         (void) resizeterm (0, 0);
18560         (void) use_default_colors ();
18561         (void) use_extended_names (0);
18562         (void) wresize (0, 0, 0);
18563   ;
18564   return 0;
18565 }
18566 _ACEOF
18567 rm -f conftest.$ac_objext conftest$ac_exeext
18568 if { (eval echo "$as_me:18568: \"$ac_link\"") >&5
18569   (eval $ac_link) 2>&5
18570   ac_status=$?
18571   echo "$as_me:18571: \$? = $ac_status" >&5
18572   (exit $ac_status); } &&
18573          { ac_try='test -s conftest$ac_exeext'
18574   { (eval echo "$as_me:18574: \"$ac_try\"") >&5
18575   (eval $ac_try) 2>&5
18576   ac_status=$?
18577   echo "$as_me:18577: \$? = $ac_status" >&5
18578   (exit $ac_status); }; }; then
18579   cf_cv_ncurses_ext_funcs=yes
18580 else
18581   echo "$as_me: failed program was:" >&5
18582 cat conftest.$ac_ext >&5
18583 cf_cv_ncurses_ext_funcs=no
18584 fi
18585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18586
18587 fi
18588 rm -f conftest.$ac_objext conftest.$ac_ext
18589
18590 fi
18591 echo "$as_me:18591: result: $cf_cv_ncurses_ext_funcs" >&5
18592 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18593 test "$cf_cv_ncurses_ext_funcs" = yes &&
18594 cat >>confdefs.h <<\EOF
18595 #define NCURSES_EXT_FUNCS 1
18596 EOF
18597
18598 if test "$cf_enable_widec" = yes
18599 then
18600         # workaround for systems with ncurses before 20111029, due to change of
18601         # feature test macro from _XPG5 to _XOPEN_SOURCE
18602         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18603         then
18604                 cf_define_xpg5=no
18605                 echo "$as_me:18605: checking if _XPG5 should be defined to enable wide-characters" >&5
18606 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18607
18608                 cat >conftest.$ac_ext <<_ACEOF
18609 #line 18609 "configure"
18610 #include "confdefs.h"
18611
18612 #include <${cf_cv_ncurses_header:-curses.h}>
18613 int
18614 main (void)
18615 {
18616 int x = _XPG5
18617   ;
18618   return 0;
18619 }
18620 _ACEOF
18621 rm -f conftest.$ac_objext
18622 if { (eval echo "$as_me:18622: \"$ac_compile\"") >&5
18623   (eval $ac_compile) 2>&5
18624   ac_status=$?
18625   echo "$as_me:18625: \$? = $ac_status" >&5
18626   (exit $ac_status); } &&
18627          { ac_try='test -s conftest.$ac_objext'
18628   { (eval echo "$as_me:18628: \"$ac_try\"") >&5
18629   (eval $ac_try) 2>&5
18630   ac_status=$?
18631   echo "$as_me:18631: \$? = $ac_status" >&5
18632   (exit $ac_status); }; }; then
18633   :
18634 else
18635   echo "$as_me: failed program was:" >&5
18636 cat conftest.$ac_ext >&5
18637 cf_save_cppflags="$CPPFLAGS"
18638                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18639                          cat >conftest.$ac_ext <<_ACEOF
18640 #line 18640 "configure"
18641 #include "confdefs.h"
18642
18643 #include <${cf_cv_ncurses_header:-curses.h}>
18644 int
18645 main (void)
18646 {
18647 int x = _XPG5
18648   ;
18649   return 0;
18650 }
18651 _ACEOF
18652 rm -f conftest.$ac_objext
18653 if { (eval echo "$as_me:18653: \"$ac_compile\"") >&5
18654   (eval $ac_compile) 2>&5
18655   ac_status=$?
18656   echo "$as_me:18656: \$? = $ac_status" >&5
18657   (exit $ac_status); } &&
18658          { ac_try='test -s conftest.$ac_objext'
18659   { (eval echo "$as_me:18659: \"$ac_try\"") >&5
18660   (eval $ac_try) 2>&5
18661   ac_status=$?
18662   echo "$as_me:18662: \$? = $ac_status" >&5
18663   (exit $ac_status); }; }; then
18664   cf_define_xpg5=yes
18665 else
18666   echo "$as_me: failed program was:" >&5
18667 cat conftest.$ac_ext >&5
18668 fi
18669 rm -f conftest.$ac_objext conftest.$ac_ext
18670                          CPPFLAGS="$cf_save_cppflags"
18671 fi
18672 rm -f conftest.$ac_objext conftest.$ac_ext
18673                 echo "$as_me:18673: result: $cf_define_xpg5" >&5
18674 echo "${ECHO_T}$cf_define_xpg5" >&6
18675
18676                 if test "$cf_define_xpg5" = yes
18677                 then
18678                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18679                 fi
18680         fi
18681
18682         echo "$as_me:18682: checking for wide-character functions" >&5
18683 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18684 if test "${cf_cv_widechar_funcs+set}" = set; then
18685   echo $ECHO_N "(cached) $ECHO_C" >&6
18686 else
18687
18688         cat >conftest.$ac_ext <<_ACEOF
18689 #line 18689 "configure"
18690 #include "confdefs.h"
18691
18692 #include <${cf_cv_ncurses_header:-curses.h}>
18693 int
18694 main (void)
18695 {
18696
18697                 static wchar_t src_wchar[2];
18698                 static cchar_t dst_cchar;
18699                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18700
18701   ;
18702   return 0;
18703 }
18704 _ACEOF
18705 rm -f conftest.$ac_objext conftest$ac_exeext
18706 if { (eval echo "$as_me:18706: \"$ac_link\"") >&5
18707   (eval $ac_link) 2>&5
18708   ac_status=$?
18709   echo "$as_me:18709: \$? = $ac_status" >&5
18710   (exit $ac_status); } &&
18711          { ac_try='test -s conftest$ac_exeext'
18712   { (eval echo "$as_me:18712: \"$ac_try\"") >&5
18713   (eval $ac_try) 2>&5
18714   ac_status=$?
18715   echo "$as_me:18715: \$? = $ac_status" >&5
18716   (exit $ac_status); }; }; then
18717   cf_cv_widechar_funcs=yes
18718 else
18719   echo "$as_me: failed program was:" >&5
18720 cat conftest.$ac_ext >&5
18721 cf_cv_widechar_funcs=no
18722 fi
18723 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18724
18725 fi
18726 echo "$as_me:18726: result: $cf_cv_widechar_funcs" >&5
18727 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18728         if test "$cf_cv_widechar_funcs" != no ; then
18729
18730 cat >>confdefs.h <<\EOF
18731 #define USE_WIDEC_SUPPORT 1
18732 EOF
18733
18734         else
18735                 cat >>confdefs.h <<\EOF
18736 #define USE_WIDEC_SUPPORT 0
18737 EOF
18738
18739         fi
18740 else
18741         cat >>confdefs.h <<\EOF
18742 #define USE_WIDEC_SUPPORT 0
18743 EOF
18744
18745 fi
18746
18747 echo "$as_me:18747: checking if $cf_cv_screen library uses pthreads" >&5
18748 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18749 if test "${cf_cv_use_pthreads+set}" = set; then
18750   echo $ECHO_N "(cached) $ECHO_C" >&6
18751 else
18752
18753 cat >conftest.$ac_ext <<_ACEOF
18754 #line 18754 "configure"
18755 #include "confdefs.h"
18756
18757 #include <${cf_cv_ncurses_header:-curses.h}>
18758 extern void _nc_init_pthreads(void);
18759
18760 int
18761 main (void)
18762 {
18763
18764         initscr();
18765         _nc_init_pthreads();
18766
18767   ;
18768   return 0;
18769 }
18770 _ACEOF
18771 rm -f conftest.$ac_objext conftest$ac_exeext
18772 if { (eval echo "$as_me:18772: \"$ac_link\"") >&5
18773   (eval $ac_link) 2>&5
18774   ac_status=$?
18775   echo "$as_me:18775: \$? = $ac_status" >&5
18776   (exit $ac_status); } &&
18777          { ac_try='test -s conftest$ac_exeext'
18778   { (eval echo "$as_me:18778: \"$ac_try\"") >&5
18779   (eval $ac_try) 2>&5
18780   ac_status=$?
18781   echo "$as_me:18781: \$? = $ac_status" >&5
18782   (exit $ac_status); }; }; then
18783   cf_cv_use_pthreads=yes
18784 else
18785   echo "$as_me: failed program was:" >&5
18786 cat conftest.$ac_ext >&5
18787 cf_cv_use_pthreads=no
18788 fi
18789 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18790
18791 fi
18792 echo "$as_me:18792: result: $cf_cv_use_pthreads" >&5
18793 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18794 test $cf_cv_use_pthreads = yes &&
18795 cat >>confdefs.h <<\EOF
18796 #define USE_PTHREADS 1
18797 EOF
18798
18799 echo "$as_me:18799: checking if sys/time.h works with sys/select.h" >&5
18800 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18801 if test "${cf_cv_sys_time_select+set}" = set; then
18802   echo $ECHO_N "(cached) $ECHO_C" >&6
18803 else
18804
18805 cat >conftest.$ac_ext <<_ACEOF
18806 #line 18806 "configure"
18807 #include "confdefs.h"
18808
18809 #include <sys/types.h>
18810 #ifdef HAVE_SYS_TIME_H
18811 #include <sys/time.h>
18812 #endif
18813 #ifdef HAVE_SYS_SELECT_H
18814 #include <sys/select.h>
18815 #endif
18816
18817 int
18818 main (void)
18819 {
18820
18821   ;
18822   return 0;
18823 }
18824 _ACEOF
18825 rm -f conftest.$ac_objext
18826 if { (eval echo "$as_me:18826: \"$ac_compile\"") >&5
18827   (eval $ac_compile) 2>&5
18828   ac_status=$?
18829   echo "$as_me:18829: \$? = $ac_status" >&5
18830   (exit $ac_status); } &&
18831          { ac_try='test -s conftest.$ac_objext'
18832   { (eval echo "$as_me:18832: \"$ac_try\"") >&5
18833   (eval $ac_try) 2>&5
18834   ac_status=$?
18835   echo "$as_me:18835: \$? = $ac_status" >&5
18836   (exit $ac_status); }; }; then
18837   cf_cv_sys_time_select=yes
18838 else
18839   echo "$as_me: failed program was:" >&5
18840 cat conftest.$ac_ext >&5
18841 cf_cv_sys_time_select=no
18842 fi
18843 rm -f conftest.$ac_objext conftest.$ac_ext
18844
18845 fi
18846
18847 echo "$as_me:18847: result: $cf_cv_sys_time_select" >&5
18848 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18849 test "$cf_cv_sys_time_select" = yes &&
18850 cat >>confdefs.h <<\EOF
18851 #define HAVE_SYS_TIME_SELECT 1
18852 EOF
18853
18854 # special check for test/ditto.c
18855
18856 echo "$as_me:18856: checking for openpty in -lutil" >&5
18857 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18858 if test "${ac_cv_lib_util_openpty+set}" = set; then
18859   echo $ECHO_N "(cached) $ECHO_C" >&6
18860 else
18861   ac_check_lib_save_LIBS=$LIBS
18862 LIBS="-lutil  $LIBS"
18863 cat >conftest.$ac_ext <<_ACEOF
18864 #line 18864 "configure"
18865 #include "confdefs.h"
18866
18867 /* Override any gcc2 internal prototype to avoid an error.  */
18868 #ifdef __cplusplus
18869 extern "C"
18870 #endif
18871 /* We use char because int might match the return type of a gcc2
18872    builtin and then its argument prototype would still apply.  */
18873 char openpty ();
18874 int
18875 main (void)
18876 {
18877 openpty ();
18878   ;
18879   return 0;
18880 }
18881 _ACEOF
18882 rm -f conftest.$ac_objext conftest$ac_exeext
18883 if { (eval echo "$as_me:18883: \"$ac_link\"") >&5
18884   (eval $ac_link) 2>&5
18885   ac_status=$?
18886   echo "$as_me:18886: \$? = $ac_status" >&5
18887   (exit $ac_status); } &&
18888          { ac_try='test -s conftest$ac_exeext'
18889   { (eval echo "$as_me:18889: \"$ac_try\"") >&5
18890   (eval $ac_try) 2>&5
18891   ac_status=$?
18892   echo "$as_me:18892: \$? = $ac_status" >&5
18893   (exit $ac_status); }; }; then
18894   ac_cv_lib_util_openpty=yes
18895 else
18896   echo "$as_me: failed program was:" >&5
18897 cat conftest.$ac_ext >&5
18898 ac_cv_lib_util_openpty=no
18899 fi
18900 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18901 LIBS=$ac_check_lib_save_LIBS
18902 fi
18903 echo "$as_me:18903: result: $ac_cv_lib_util_openpty" >&5
18904 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18905 if test $ac_cv_lib_util_openpty = yes; then
18906   cf_cv_lib_util=yes
18907 else
18908   cf_cv_lib_util=no
18909 fi
18910
18911 echo "$as_me:18911: checking for openpty header" >&5
18912 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18913 if test "${cf_cv_func_openpty+set}" = set; then
18914   echo $ECHO_N "(cached) $ECHO_C" >&6
18915 else
18916
18917         cf_save_LIBS="$LIBS"
18918         test $cf_cv_lib_util = yes && {
18919 cf_add_libs="$LIBS"
18920 # reverse order
18921 cf_add_0lib=
18922 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18923 # filter duplicates
18924 for cf_add_1lib in $cf_add_0lib; do
18925         for cf_add_2lib in $cf_add_libs; do
18926                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18927                         cf_add_1lib=
18928                         break
18929                 fi
18930         done
18931         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18932 done
18933 LIBS="$cf_add_libs"
18934  }
18935         for cf_header in pty.h libutil.h util.h
18936         do
18937         cat >conftest.$ac_ext <<_ACEOF
18938 #line 18938 "configure"
18939 #include "confdefs.h"
18940
18941 #include <$cf_header>
18942
18943 int
18944 main (void)
18945 {
18946
18947         int x = openpty((int *)0, (int *)0, (char *)0,
18948                                    (struct termios *)0, (struct winsize *)0);
18949
18950   ;
18951   return 0;
18952 }
18953 _ACEOF
18954 rm -f conftest.$ac_objext conftest$ac_exeext
18955 if { (eval echo "$as_me:18955: \"$ac_link\"") >&5
18956   (eval $ac_link) 2>&5
18957   ac_status=$?
18958   echo "$as_me:18958: \$? = $ac_status" >&5
18959   (exit $ac_status); } &&
18960          { ac_try='test -s conftest$ac_exeext'
18961   { (eval echo "$as_me:18961: \"$ac_try\"") >&5
18962   (eval $ac_try) 2>&5
18963   ac_status=$?
18964   echo "$as_me:18964: \$? = $ac_status" >&5
18965   (exit $ac_status); }; }; then
18966
18967                 cf_cv_func_openpty=$cf_header
18968                 break
18969
18970 else
18971   echo "$as_me: failed program was:" >&5
18972 cat conftest.$ac_ext >&5
18973
18974                 cf_cv_func_openpty=no
18975
18976 fi
18977 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18978         done
18979         LIBS="$cf_save_LIBS"
18980
18981 fi
18982 echo "$as_me:18982: result: $cf_cv_func_openpty" >&5
18983 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18984
18985 if test "$cf_cv_func_openpty" != no ; then
18986
18987 cat >>confdefs.h <<EOF
18988 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18989 EOF
18990
18991 cat >>confdefs.h <<\EOF
18992 #define USE_XTERM_PTY 1
18993 EOF
18994
18995         if test "x$cf_cv_lib_util" = xyes ; then
18996
18997 cf_add_libs="$TEST_LIBS"
18998 # reverse order
18999 cf_add_0lib=
19000 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19001 # filter duplicates
19002 for cf_add_1lib in $cf_add_0lib; do
19003         for cf_add_2lib in $cf_add_libs; do
19004                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19005                         cf_add_1lib=
19006                         break
19007                 fi
19008         done
19009         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19010 done
19011 TEST_LIBS="$cf_add_libs"
19012
19013         fi
19014 fi
19015
19016 echo "$as_me:19016: checking for function curses_version" >&5
19017 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19018 if test "${cf_cv_func_curses_version+set}" = set; then
19019   echo $ECHO_N "(cached) $ECHO_C" >&6
19020 else
19021
19022 if test "$cross_compiling" = yes; then
19023   cf_cv_func_curses_version=unknown
19024 else
19025   cat >conftest.$ac_ext <<_ACEOF
19026 #line 19026 "configure"
19027 #include "confdefs.h"
19028
19029 #include <${cf_cv_ncurses_header:-curses.h}>
19030 int main(void)
19031 {
19032         char temp[1024];
19033         sprintf(temp, "%s\n", curses_version());
19034         ${cf_cv_main_return:-return}(0);
19035 }
19036
19037 _ACEOF
19038 rm -f conftest$ac_exeext
19039 if { (eval echo "$as_me:19039: \"$ac_link\"") >&5
19040   (eval $ac_link) 2>&5
19041   ac_status=$?
19042   echo "$as_me:19042: \$? = $ac_status" >&5
19043   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19044   { (eval echo "$as_me:19044: \"$ac_try\"") >&5
19045   (eval $ac_try) 2>&5
19046   ac_status=$?
19047   echo "$as_me:19047: \$? = $ac_status" >&5
19048   (exit $ac_status); }; }; then
19049   cf_cv_func_curses_version=yes
19050
19051 else
19052   echo "$as_me: program exited with status $ac_status" >&5
19053 echo "$as_me: failed program was:" >&5
19054 cat conftest.$ac_ext >&5
19055 cf_cv_func_curses_version=no
19056
19057 fi
19058 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19059 fi
19060 rm -f core
19061 fi
19062 echo "$as_me:19062: result: $cf_cv_func_curses_version" >&5
19063 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19064 test "$cf_cv_func_curses_version" = yes &&
19065 cat >>confdefs.h <<\EOF
19066 #define HAVE_CURSES_VERSION 1
19067 EOF
19068
19069 echo "$as_me:19069: checking for alternate character set array" >&5
19070 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19071 if test "${cf_cv_curses_acs_map+set}" = set; then
19072   echo $ECHO_N "(cached) $ECHO_C" >&6
19073 else
19074
19075 cf_cv_curses_acs_map=unknown
19076 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19077 do
19078 cat >conftest.$ac_ext <<_ACEOF
19079 #line 19079 "configure"
19080 #include "confdefs.h"
19081
19082 #include <${cf_cv_ncurses_header:-curses.h}>
19083
19084 int
19085 main (void)
19086 {
19087
19088 $name['k'] = ACS_PLUS
19089
19090   ;
19091   return 0;
19092 }
19093 _ACEOF
19094 rm -f conftest.$ac_objext conftest$ac_exeext
19095 if { (eval echo "$as_me:19095: \"$ac_link\"") >&5
19096   (eval $ac_link) 2>&5
19097   ac_status=$?
19098   echo "$as_me:19098: \$? = $ac_status" >&5
19099   (exit $ac_status); } &&
19100          { ac_try='test -s conftest$ac_exeext'
19101   { (eval echo "$as_me:19101: \"$ac_try\"") >&5
19102   (eval $ac_try) 2>&5
19103   ac_status=$?
19104   echo "$as_me:19104: \$? = $ac_status" >&5
19105   (exit $ac_status); }; }; then
19106   cf_cv_curses_acs_map=$name; break
19107 else
19108   echo "$as_me: failed program was:" >&5
19109 cat conftest.$ac_ext >&5
19110 fi
19111 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19112 done
19113
19114 fi
19115 echo "$as_me:19115: result: $cf_cv_curses_acs_map" >&5
19116 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19117
19118 test "$cf_cv_curses_acs_map" != unknown &&
19119 cat >>confdefs.h <<EOF
19120 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19121 EOF
19122
19123 if test "$cf_enable_widec" = yes; then
19124
19125 echo "$as_me:19125: checking for wide alternate character set array" >&5
19126 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19127 if test "${cf_cv_curses_wacs_map+set}" = set; then
19128   echo $ECHO_N "(cached) $ECHO_C" >&6
19129 else
19130
19131         cf_cv_curses_wacs_map=unknown
19132         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19133         do
19134         cat >conftest.$ac_ext <<_ACEOF
19135 #line 19135 "configure"
19136 #include "confdefs.h"
19137
19138 #ifndef _XOPEN_SOURCE_EXTENDED
19139 #define _XOPEN_SOURCE_EXTENDED
19140 #endif
19141 #include <${cf_cv_ncurses_header:-curses.h}>
19142 int
19143 main (void)
19144 {
19145 void *foo = &($name['k']); (void)foo
19146   ;
19147   return 0;
19148 }
19149 _ACEOF
19150 rm -f conftest.$ac_objext conftest$ac_exeext
19151 if { (eval echo "$as_me:19151: \"$ac_link\"") >&5
19152   (eval $ac_link) 2>&5
19153   ac_status=$?
19154   echo "$as_me:19154: \$? = $ac_status" >&5
19155   (exit $ac_status); } &&
19156          { ac_try='test -s conftest$ac_exeext'
19157   { (eval echo "$as_me:19157: \"$ac_try\"") >&5
19158   (eval $ac_try) 2>&5
19159   ac_status=$?
19160   echo "$as_me:19160: \$? = $ac_status" >&5
19161   (exit $ac_status); }; }; then
19162   cf_cv_curses_wacs_map=$name
19163          break
19164 else
19165   echo "$as_me: failed program was:" >&5
19166 cat conftest.$ac_ext >&5
19167 fi
19168 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19169         done
19170 fi
19171 echo "$as_me:19171: result: $cf_cv_curses_wacs_map" >&5
19172 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19173
19174 test "$cf_cv_curses_wacs_map" != unknown &&
19175 cat >>confdefs.h <<EOF
19176 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19177 EOF
19178
19179 echo "$as_me:19179: checking for wide alternate character constants" >&5
19180 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19181 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19182   echo $ECHO_N "(cached) $ECHO_C" >&6
19183 else
19184
19185 cf_cv_curses_wacs_symbols=no
19186 if test "$cf_cv_curses_wacs_map" != unknown
19187 then
19188         cat >conftest.$ac_ext <<_ACEOF
19189 #line 19189 "configure"
19190 #include "confdefs.h"
19191
19192 #ifndef _XOPEN_SOURCE_EXTENDED
19193 #define _XOPEN_SOURCE_EXTENDED
19194 #endif
19195 #include <${cf_cv_ncurses_header:-curses.h}>
19196 int
19197 main (void)
19198 {
19199 cchar_t *foo = WACS_PLUS;
19200          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS; (void)foo
19201   ;
19202   return 0;
19203 }
19204 _ACEOF
19205 rm -f conftest.$ac_objext conftest$ac_exeext
19206 if { (eval echo "$as_me:19206: \"$ac_link\"") >&5
19207   (eval $ac_link) 2>&5
19208   ac_status=$?
19209   echo "$as_me:19209: \$? = $ac_status" >&5
19210   (exit $ac_status); } &&
19211          { ac_try='test -s conftest$ac_exeext'
19212   { (eval echo "$as_me:19212: \"$ac_try\"") >&5
19213   (eval $ac_try) 2>&5
19214   ac_status=$?
19215   echo "$as_me:19215: \$? = $ac_status" >&5
19216   (exit $ac_status); }; }; then
19217   cf_cv_curses_wacs_symbols=yes
19218 else
19219   echo "$as_me: failed program was:" >&5
19220 cat conftest.$ac_ext >&5
19221 fi
19222 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19223 else
19224         cat >conftest.$ac_ext <<_ACEOF
19225 #line 19225 "configure"
19226 #include "confdefs.h"
19227
19228 #ifndef _XOPEN_SOURCE_EXTENDED
19229 #define _XOPEN_SOURCE_EXTENDED
19230 #endif
19231 #include <${cf_cv_ncurses_header:-curses.h}>
19232 int
19233 main (void)
19234 {
19235 cchar_t *foo = WACS_PLUS; (void)foo
19236   ;
19237   return 0;
19238 }
19239 _ACEOF
19240 rm -f conftest.$ac_objext conftest$ac_exeext
19241 if { (eval echo "$as_me:19241: \"$ac_link\"") >&5
19242   (eval $ac_link) 2>&5
19243   ac_status=$?
19244   echo "$as_me:19244: \$? = $ac_status" >&5
19245   (exit $ac_status); } &&
19246          { ac_try='test -s conftest$ac_exeext'
19247   { (eval echo "$as_me:19247: \"$ac_try\"") >&5
19248   (eval $ac_try) 2>&5
19249   ac_status=$?
19250   echo "$as_me:19250: \$? = $ac_status" >&5
19251   (exit $ac_status); }; }; then
19252   cf_cv_curses_wacs_symbols=yes
19253 else
19254   echo "$as_me: failed program was:" >&5
19255 cat conftest.$ac_ext >&5
19256 fi
19257 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19258 fi
19259
19260 fi
19261 echo "$as_me:19261: result: $cf_cv_curses_wacs_symbols" >&5
19262 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19263
19264 test "$cf_cv_curses_wacs_symbols" != no &&
19265 cat >>confdefs.h <<\EOF
19266 #define CURSES_WACS_SYMBOLS 1
19267 EOF
19268
19269 fi
19270
19271 echo "$as_me:19271: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19272 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19273 cat >conftest.$ac_ext <<_ACEOF
19274 #line 19274 "configure"
19275 #include "confdefs.h"
19276
19277 #ifndef _XOPEN_SOURCE_EXTENDED
19278 #define _XOPEN_SOURCE_EXTENDED
19279 #endif
19280 #include <${cf_cv_ncurses_header:-curses.h}>
19281 int
19282 main (void)
19283 {
19284
19285 attr_t foo
19286
19287   ;
19288   return 0;
19289 }
19290 _ACEOF
19291 rm -f conftest.$ac_objext
19292 if { (eval echo "$as_me:19292: \"$ac_compile\"") >&5
19293   (eval $ac_compile) 2>&5
19294   ac_status=$?
19295   echo "$as_me:19295: \$? = $ac_status" >&5
19296   (exit $ac_status); } &&
19297          { ac_try='test -s conftest.$ac_objext'
19298   { (eval echo "$as_me:19298: \"$ac_try\"") >&5
19299   (eval $ac_try) 2>&5
19300   ac_status=$?
19301   echo "$as_me:19301: \$? = $ac_status" >&5
19302   (exit $ac_status); }; }; then
19303   cf_result=yes
19304 else
19305   echo "$as_me: failed program was:" >&5
19306 cat conftest.$ac_ext >&5
19307 cf_result=no
19308 fi
19309 rm -f conftest.$ac_objext conftest.$ac_ext
19310 echo "$as_me:19310: result: $cf_result" >&5
19311 echo "${ECHO_T}$cf_result" >&6
19312 if test $cf_result = yes ; then
19313
19314 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19315
19316 cat >>confdefs.h <<EOF
19317 #define $cf_result 1
19318 EOF
19319
19320 else
19321
19322 cat >>confdefs.h <<EOF
19323 #define attr_t long
19324 EOF
19325
19326 fi
19327
19328 if test "$cf_enable_widec" = yes; then
19329
19330 # This is needed on Tru64 5.0 to declare mbstate_t
19331 echo "$as_me:19331: checking if we must include wchar.h to declare mbstate_t" >&5
19332 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19333 if test "${cf_cv_mbstate_t+set}" = set; then
19334   echo $ECHO_N "(cached) $ECHO_C" >&6
19335 else
19336
19337 cat >conftest.$ac_ext <<_ACEOF
19338 #line 19338 "configure"
19339 #include "confdefs.h"
19340
19341 #include <stdlib.h>
19342 #include <stdarg.h>
19343 #include <stdio.h>
19344 #ifdef HAVE_LIBUTF8_H
19345 #include <libutf8.h>
19346 #endif
19347 int
19348 main (void)
19349 {
19350 mbstate_t state
19351   ;
19352   return 0;
19353 }
19354 _ACEOF
19355 rm -f conftest.$ac_objext
19356 if { (eval echo "$as_me:19356: \"$ac_compile\"") >&5
19357   (eval $ac_compile) 2>&5
19358   ac_status=$?
19359   echo "$as_me:19359: \$? = $ac_status" >&5
19360   (exit $ac_status); } &&
19361          { ac_try='test -s conftest.$ac_objext'
19362   { (eval echo "$as_me:19362: \"$ac_try\"") >&5
19363   (eval $ac_try) 2>&5
19364   ac_status=$?
19365   echo "$as_me:19365: \$? = $ac_status" >&5
19366   (exit $ac_status); }; }; then
19367   cf_cv_mbstate_t=no
19368 else
19369   echo "$as_me: failed program was:" >&5
19370 cat conftest.$ac_ext >&5
19371 cat >conftest.$ac_ext <<_ACEOF
19372 #line 19372 "configure"
19373 #include "confdefs.h"
19374
19375 #include <stdlib.h>
19376 #include <stdarg.h>
19377 #include <stdio.h>
19378 #include <wchar.h>
19379 #ifdef HAVE_LIBUTF8_H
19380 #include <libutf8.h>
19381 #endif
19382 int
19383 main (void)
19384 {
19385 mbstate_t value
19386   ;
19387   return 0;
19388 }
19389 _ACEOF
19390 rm -f conftest.$ac_objext
19391 if { (eval echo "$as_me:19391: \"$ac_compile\"") >&5
19392   (eval $ac_compile) 2>&5
19393   ac_status=$?
19394   echo "$as_me:19394: \$? = $ac_status" >&5
19395   (exit $ac_status); } &&
19396          { ac_try='test -s conftest.$ac_objext'
19397   { (eval echo "$as_me:19397: \"$ac_try\"") >&5
19398   (eval $ac_try) 2>&5
19399   ac_status=$?
19400   echo "$as_me:19400: \$? = $ac_status" >&5
19401   (exit $ac_status); }; }; then
19402   cf_cv_mbstate_t=yes
19403 else
19404   echo "$as_me: failed program was:" >&5
19405 cat conftest.$ac_ext >&5
19406 cf_cv_mbstate_t=unknown
19407 fi
19408 rm -f conftest.$ac_objext conftest.$ac_ext
19409 fi
19410 rm -f conftest.$ac_objext conftest.$ac_ext
19411 fi
19412 echo "$as_me:19412: result: $cf_cv_mbstate_t" >&5
19413 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19414
19415 if test "$cf_cv_mbstate_t" = yes ; then
19416
19417 cat >>confdefs.h <<\EOF
19418 #define NEED_WCHAR_H 1
19419 EOF
19420
19421         NEED_WCHAR_H=1
19422 fi
19423
19424 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19425 if test "$cf_cv_mbstate_t" = unknown ; then
19426         NCURSES_MBSTATE_T=1
19427 fi
19428
19429 # if we find mbstate_t in either place, use substitution to provide a fallback.
19430 if test "$cf_cv_mbstate_t" != unknown ; then
19431         NCURSES_OK_MBSTATE_T=1
19432 fi
19433
19434 # This is needed on Tru64 5.0 to declare wchar_t
19435 echo "$as_me:19435: checking if we must include wchar.h to declare wchar_t" >&5
19436 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19437 if test "${cf_cv_wchar_t+set}" = set; then
19438   echo $ECHO_N "(cached) $ECHO_C" >&6
19439 else
19440
19441 cat >conftest.$ac_ext <<_ACEOF
19442 #line 19442 "configure"
19443 #include "confdefs.h"
19444
19445 #include <stdlib.h>
19446 #include <stdarg.h>
19447 #include <stdio.h>
19448 #ifdef HAVE_LIBUTF8_H
19449 #include <libutf8.h>
19450 #endif
19451 int
19452 main (void)
19453 {
19454 wchar_t state
19455   ;
19456   return 0;
19457 }
19458 _ACEOF
19459 rm -f conftest.$ac_objext
19460 if { (eval echo "$as_me:19460: \"$ac_compile\"") >&5
19461   (eval $ac_compile) 2>&5
19462   ac_status=$?
19463   echo "$as_me:19463: \$? = $ac_status" >&5
19464   (exit $ac_status); } &&
19465          { ac_try='test -s conftest.$ac_objext'
19466   { (eval echo "$as_me:19466: \"$ac_try\"") >&5
19467   (eval $ac_try) 2>&5
19468   ac_status=$?
19469   echo "$as_me:19469: \$? = $ac_status" >&5
19470   (exit $ac_status); }; }; then
19471   cf_cv_wchar_t=no
19472 else
19473   echo "$as_me: failed program was:" >&5
19474 cat conftest.$ac_ext >&5
19475 cat >conftest.$ac_ext <<_ACEOF
19476 #line 19476 "configure"
19477 #include "confdefs.h"
19478
19479 #include <stdlib.h>
19480 #include <stdarg.h>
19481 #include <stdio.h>
19482 #include <wchar.h>
19483 #ifdef HAVE_LIBUTF8_H
19484 #include <libutf8.h>
19485 #endif
19486 int
19487 main (void)
19488 {
19489 wchar_t value
19490   ;
19491   return 0;
19492 }
19493 _ACEOF
19494 rm -f conftest.$ac_objext
19495 if { (eval echo "$as_me:19495: \"$ac_compile\"") >&5
19496   (eval $ac_compile) 2>&5
19497   ac_status=$?
19498   echo "$as_me:19498: \$? = $ac_status" >&5
19499   (exit $ac_status); } &&
19500          { ac_try='test -s conftest.$ac_objext'
19501   { (eval echo "$as_me:19501: \"$ac_try\"") >&5
19502   (eval $ac_try) 2>&5
19503   ac_status=$?
19504   echo "$as_me:19504: \$? = $ac_status" >&5
19505   (exit $ac_status); }; }; then
19506   cf_cv_wchar_t=yes
19507 else
19508   echo "$as_me: failed program was:" >&5
19509 cat conftest.$ac_ext >&5
19510 cf_cv_wchar_t=unknown
19511 fi
19512 rm -f conftest.$ac_objext conftest.$ac_ext
19513 fi
19514 rm -f conftest.$ac_objext conftest.$ac_ext
19515 fi
19516 echo "$as_me:19516: result: $cf_cv_wchar_t" >&5
19517 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19518
19519 if test "$cf_cv_wchar_t" = yes ; then
19520
19521 cat >>confdefs.h <<\EOF
19522 #define NEED_WCHAR_H 1
19523 EOF
19524
19525         NEED_WCHAR_H=1
19526 fi
19527
19528 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19529 if test "$cf_cv_wchar_t" = unknown ; then
19530         NCURSES_WCHAR_T=1
19531 fi
19532
19533 # if we find wchar_t in either place, use substitution to provide a fallback.
19534 if test "$cf_cv_wchar_t" != unknown ; then
19535         NCURSES_OK_WCHAR_T=1
19536 fi
19537
19538 # This is needed on Tru64 5.0 to declare wint_t
19539 echo "$as_me:19539: checking if we must include wchar.h to declare wint_t" >&5
19540 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19541 if test "${cf_cv_wint_t+set}" = set; then
19542   echo $ECHO_N "(cached) $ECHO_C" >&6
19543 else
19544
19545 cat >conftest.$ac_ext <<_ACEOF
19546 #line 19546 "configure"
19547 #include "confdefs.h"
19548
19549 #include <stdlib.h>
19550 #include <stdarg.h>
19551 #include <stdio.h>
19552 #ifdef HAVE_LIBUTF8_H
19553 #include <libutf8.h>
19554 #endif
19555 int
19556 main (void)
19557 {
19558 wint_t state
19559   ;
19560   return 0;
19561 }
19562 _ACEOF
19563 rm -f conftest.$ac_objext
19564 if { (eval echo "$as_me:19564: \"$ac_compile\"") >&5
19565   (eval $ac_compile) 2>&5
19566   ac_status=$?
19567   echo "$as_me:19567: \$? = $ac_status" >&5
19568   (exit $ac_status); } &&
19569          { ac_try='test -s conftest.$ac_objext'
19570   { (eval echo "$as_me:19570: \"$ac_try\"") >&5
19571   (eval $ac_try) 2>&5
19572   ac_status=$?
19573   echo "$as_me:19573: \$? = $ac_status" >&5
19574   (exit $ac_status); }; }; then
19575   cf_cv_wint_t=no
19576 else
19577   echo "$as_me: failed program was:" >&5
19578 cat conftest.$ac_ext >&5
19579 cat >conftest.$ac_ext <<_ACEOF
19580 #line 19580 "configure"
19581 #include "confdefs.h"
19582
19583 #include <stdlib.h>
19584 #include <stdarg.h>
19585 #include <stdio.h>
19586 #include <wchar.h>
19587 #ifdef HAVE_LIBUTF8_H
19588 #include <libutf8.h>
19589 #endif
19590 int
19591 main (void)
19592 {
19593 wint_t value
19594   ;
19595   return 0;
19596 }
19597 _ACEOF
19598 rm -f conftest.$ac_objext
19599 if { (eval echo "$as_me:19599: \"$ac_compile\"") >&5
19600   (eval $ac_compile) 2>&5
19601   ac_status=$?
19602   echo "$as_me:19602: \$? = $ac_status" >&5
19603   (exit $ac_status); } &&
19604          { ac_try='test -s conftest.$ac_objext'
19605   { (eval echo "$as_me:19605: \"$ac_try\"") >&5
19606   (eval $ac_try) 2>&5
19607   ac_status=$?
19608   echo "$as_me:19608: \$? = $ac_status" >&5
19609   (exit $ac_status); }; }; then
19610   cf_cv_wint_t=yes
19611 else
19612   echo "$as_me: failed program was:" >&5
19613 cat conftest.$ac_ext >&5
19614 cf_cv_wint_t=unknown
19615 fi
19616 rm -f conftest.$ac_objext conftest.$ac_ext
19617 fi
19618 rm -f conftest.$ac_objext conftest.$ac_ext
19619 fi
19620 echo "$as_me:19620: result: $cf_cv_wint_t" >&5
19621 echo "${ECHO_T}$cf_cv_wint_t" >&6
19622
19623 if test "$cf_cv_wint_t" = yes ; then
19624
19625 cat >>confdefs.h <<\EOF
19626 #define NEED_WCHAR_H 1
19627 EOF
19628
19629         NEED_WCHAR_H=1
19630 fi
19631
19632 # if we do not find wint_t in either place, use substitution to provide a fallback.
19633 if test "$cf_cv_wint_t" = unknown ; then
19634         NCURSES_WINT_T=1
19635 fi
19636
19637 # if we find wint_t in either place, use substitution to provide a fallback.
19638 if test "$cf_cv_wint_t" != unknown ; then
19639         NCURSES_OK_WINT_T=1
19640 fi
19641
19642         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19643
19644 echo "$as_me:19644: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19645 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19646 cat >conftest.$ac_ext <<_ACEOF
19647 #line 19647 "configure"
19648 #include "confdefs.h"
19649
19650 #ifndef _XOPEN_SOURCE_EXTENDED
19651 #define _XOPEN_SOURCE_EXTENDED
19652 #endif
19653 #include <${cf_cv_ncurses_header:-curses.h}>
19654 int
19655 main (void)
19656 {
19657
19658 mbstate_t foo
19659
19660   ;
19661   return 0;
19662 }
19663 _ACEOF
19664 rm -f conftest.$ac_objext
19665 if { (eval echo "$as_me:19665: \"$ac_compile\"") >&5
19666   (eval $ac_compile) 2>&5
19667   ac_status=$?
19668   echo "$as_me:19668: \$? = $ac_status" >&5
19669   (exit $ac_status); } &&
19670          { ac_try='test -s conftest.$ac_objext'
19671   { (eval echo "$as_me:19671: \"$ac_try\"") >&5
19672   (eval $ac_try) 2>&5
19673   ac_status=$?
19674   echo "$as_me:19674: \$? = $ac_status" >&5
19675   (exit $ac_status); }; }; then
19676   cf_result=yes
19677 else
19678   echo "$as_me: failed program was:" >&5
19679 cat conftest.$ac_ext >&5
19680 cf_result=no
19681 fi
19682 rm -f conftest.$ac_objext conftest.$ac_ext
19683 echo "$as_me:19683: result: $cf_result" >&5
19684 echo "${ECHO_T}$cf_result" >&6
19685 if test $cf_result = yes ; then
19686
19687 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19688
19689 cat >>confdefs.h <<EOF
19690 #define $cf_result 1
19691 EOF
19692
19693 else
19694
19695 cat >>confdefs.h <<EOF
19696 #define mbstate_t long
19697 EOF
19698
19699 fi
19700
19701         fi
19702
19703         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19704
19705 echo "$as_me:19705: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19706 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19707 cat >conftest.$ac_ext <<_ACEOF
19708 #line 19708 "configure"
19709 #include "confdefs.h"
19710
19711 #ifndef _XOPEN_SOURCE_EXTENDED
19712 #define _XOPEN_SOURCE_EXTENDED
19713 #endif
19714 #include <${cf_cv_ncurses_header:-curses.h}>
19715 int
19716 main (void)
19717 {
19718
19719 wchar_t foo
19720
19721   ;
19722   return 0;
19723 }
19724 _ACEOF
19725 rm -f conftest.$ac_objext
19726 if { (eval echo "$as_me:19726: \"$ac_compile\"") >&5
19727   (eval $ac_compile) 2>&5
19728   ac_status=$?
19729   echo "$as_me:19729: \$? = $ac_status" >&5
19730   (exit $ac_status); } &&
19731          { ac_try='test -s conftest.$ac_objext'
19732   { (eval echo "$as_me:19732: \"$ac_try\"") >&5
19733   (eval $ac_try) 2>&5
19734   ac_status=$?
19735   echo "$as_me:19735: \$? = $ac_status" >&5
19736   (exit $ac_status); }; }; then
19737   cf_result=yes
19738 else
19739   echo "$as_me: failed program was:" >&5
19740 cat conftest.$ac_ext >&5
19741 cf_result=no
19742 fi
19743 rm -f conftest.$ac_objext conftest.$ac_ext
19744 echo "$as_me:19744: result: $cf_result" >&5
19745 echo "${ECHO_T}$cf_result" >&6
19746 if test $cf_result = yes ; then
19747
19748 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19749
19750 cat >>confdefs.h <<EOF
19751 #define $cf_result 1
19752 EOF
19753
19754 else
19755
19756 cat >>confdefs.h <<EOF
19757 #define wchar_t long
19758 EOF
19759
19760 fi
19761
19762         fi
19763
19764         if test "$NCURSES_OK_WINT_T" = 0 ; then
19765
19766 echo "$as_me:19766: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19767 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19768 cat >conftest.$ac_ext <<_ACEOF
19769 #line 19769 "configure"
19770 #include "confdefs.h"
19771
19772 #ifndef _XOPEN_SOURCE_EXTENDED
19773 #define _XOPEN_SOURCE_EXTENDED
19774 #endif
19775 #include <${cf_cv_ncurses_header:-curses.h}>
19776 int
19777 main (void)
19778 {
19779
19780 wint_t foo
19781
19782   ;
19783   return 0;
19784 }
19785 _ACEOF
19786 rm -f conftest.$ac_objext
19787 if { (eval echo "$as_me:19787: \"$ac_compile\"") >&5
19788   (eval $ac_compile) 2>&5
19789   ac_status=$?
19790   echo "$as_me:19790: \$? = $ac_status" >&5
19791   (exit $ac_status); } &&
19792          { ac_try='test -s conftest.$ac_objext'
19793   { (eval echo "$as_me:19793: \"$ac_try\"") >&5
19794   (eval $ac_try) 2>&5
19795   ac_status=$?
19796   echo "$as_me:19796: \$? = $ac_status" >&5
19797   (exit $ac_status); }; }; then
19798   cf_result=yes
19799 else
19800   echo "$as_me: failed program was:" >&5
19801 cat conftest.$ac_ext >&5
19802 cf_result=no
19803 fi
19804 rm -f conftest.$ac_objext conftest.$ac_ext
19805 echo "$as_me:19805: result: $cf_result" >&5
19806 echo "${ECHO_T}$cf_result" >&6
19807 if test $cf_result = yes ; then
19808
19809 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19810
19811 cat >>confdefs.h <<EOF
19812 #define $cf_result 1
19813 EOF
19814
19815 else
19816
19817 cat >>confdefs.h <<EOF
19818 #define wint_t long
19819 EOF
19820
19821 fi
19822
19823         fi
19824 fi
19825
19826 for cf_data in \
19827 TABSIZE \
19828 curscr \
19829 ospeed \
19830 boolnames \
19831 boolfnames \
19832 ttytype
19833 do
19834 echo "$as_me:19834: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19835 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19836
19837 cat >conftest.$ac_ext <<_ACEOF
19838 #line 19838 "configure"
19839 #include "confdefs.h"
19840
19841 #ifdef HAVE_XCURSES
19842 #include <xcurses.h>
19843 char * XCursesProgramName = "test";
19844 #else
19845 #include <${cf_cv_ncurses_header:-curses.h}>
19846 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19847 #include <ncursesw/term.h>
19848 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19849 #include <ncurses/term.h>
19850 #elif defined(HAVE_TERM_H)
19851 #include <term.h>
19852 #endif
19853 #endif
19854
19855 int
19856 main (void)
19857 {
19858
19859 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19860         const void *foo = (const void *)($cf_data);
19861 #else
19862         const void *foo = &($cf_data);
19863 #endif
19864         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19865
19866   ;
19867   return 0;
19868 }
19869 _ACEOF
19870 rm -f conftest.$ac_objext
19871 if { (eval echo "$as_me:19871: \"$ac_compile\"") >&5
19872   (eval $ac_compile) 2>&5
19873   ac_status=$?
19874   echo "$as_me:19874: \$? = $ac_status" >&5
19875   (exit $ac_status); } &&
19876          { ac_try='test -s conftest.$ac_objext'
19877   { (eval echo "$as_me:19877: \"$ac_try\"") >&5
19878   (eval $ac_try) 2>&5
19879   ac_status=$?
19880   echo "$as_me:19880: \$? = $ac_status" >&5
19881   (exit $ac_status); }; }; then
19882   cf_result=yes
19883
19884 else
19885   echo "$as_me: failed program was:" >&5
19886 cat conftest.$ac_ext >&5
19887 cf_result=no
19888 fi
19889 rm -f conftest.$ac_objext conftest.$ac_ext
19890 echo "$as_me:19890: result: $cf_result" >&5
19891 echo "${ECHO_T}$cf_result" >&6
19892
19893 if test $cf_result = yes ; then
19894
19895 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19896
19897         cat >>confdefs.h <<EOF
19898 #define $cf_result 1
19899 EOF
19900
19901 else
19902         echo "$as_me:19902: checking for data $cf_data in library" >&5
19903 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19904         # BSD linkers insist on making weak linkage, but resolve at runtime.
19905         if test "$cross_compiling" = yes; then
19906
19907         # cross-compiling
19908         cat >conftest.$ac_ext <<_ACEOF
19909 #line 19909 "configure"
19910 #include "confdefs.h"
19911
19912 #ifdef HAVE_XCURSES
19913 #include <xcurses.h>
19914 char * XCursesProgramName = "test";
19915 #else
19916 #include <${cf_cv_ncurses_header:-curses.h}>
19917 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19918 #include <ncursesw/term.h>
19919 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19920 #include <ncurses/term.h>
19921 #elif defined(HAVE_TERM_H)
19922 #include <term.h>
19923 #endif
19924 #endif
19925
19926 extern char $cf_data;
19927 int
19928 main (void)
19929 {
19930
19931         do {
19932
19933 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19934         const void *foo = (const void *)($cf_data);
19935 #else
19936         const void *foo = &($cf_data);
19937 #endif
19938         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19939
19940                 ${cf_cv_main_return:-return}(foo == 0);
19941         } while (0)
19942
19943   ;
19944   return 0;
19945 }
19946 _ACEOF
19947 rm -f conftest.$ac_objext conftest$ac_exeext
19948 if { (eval echo "$as_me:19948: \"$ac_link\"") >&5
19949   (eval $ac_link) 2>&5
19950   ac_status=$?
19951   echo "$as_me:19951: \$? = $ac_status" >&5
19952   (exit $ac_status); } &&
19953          { ac_try='test -s conftest$ac_exeext'
19954   { (eval echo "$as_me:19954: \"$ac_try\"") >&5
19955   (eval $ac_try) 2>&5
19956   ac_status=$?
19957   echo "$as_me:19957: \$? = $ac_status" >&5
19958   (exit $ac_status); }; }; then
19959   cf_result=yes
19960 else
19961   echo "$as_me: failed program was:" >&5
19962 cat conftest.$ac_ext >&5
19963 cf_result=no
19964 fi
19965 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19966
19967 else
19968   cat >conftest.$ac_ext <<_ACEOF
19969 #line 19969 "configure"
19970 #include "confdefs.h"
19971
19972 #ifdef HAVE_XCURSES
19973 #include <xcurses.h>
19974 char * XCursesProgramName = "test";
19975 #else
19976 #include <${cf_cv_ncurses_header:-curses.h}>
19977 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19978 #include <ncursesw/term.h>
19979 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19980 #include <ncurses/term.h>
19981 #elif defined(HAVE_TERM_H)
19982 #include <term.h>
19983 #endif
19984 #endif
19985
19986 extern char $cf_data;
19987 int main(void)
19988 {
19989
19990 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19991         const void *foo = (const void *)($cf_data);
19992 #else
19993         const void *foo = &($cf_data);
19994 #endif
19995         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19996
19997         ${cf_cv_main_return:-return}(foo == 0);
19998 }
19999 _ACEOF
20000 rm -f conftest$ac_exeext
20001 if { (eval echo "$as_me:20001: \"$ac_link\"") >&5
20002   (eval $ac_link) 2>&5
20003   ac_status=$?
20004   echo "$as_me:20004: \$? = $ac_status" >&5
20005   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
20006   { (eval echo "$as_me:20006: \"$ac_try\"") >&5
20007   (eval $ac_try) 2>&5
20008   ac_status=$?
20009   echo "$as_me:20009: \$? = $ac_status" >&5
20010   (exit $ac_status); }; }; then
20011   cf_result=yes
20012
20013 else
20014   echo "$as_me: program exited with status $ac_status" >&5
20015 echo "$as_me: failed program was:" >&5
20016 cat conftest.$ac_ext >&5
20017 cf_result=no
20018 fi
20019 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
20020 fi
20021         echo "$as_me:20021: result: $cf_result" >&5
20022 echo "${ECHO_T}$cf_result" >&6
20023         if test $cf_result = yes ; then
20024
20025 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20026
20027                 cat >>confdefs.h <<EOF
20028 #define $cf_result 1
20029 EOF
20030
20031                 # do not exit loop here, since we prefer system's declarations
20032         fi
20033 fi
20034 done
20035
20036 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20037 then
20038         echo "$as_me:20038: checking for X" >&5
20039 echo $ECHO_N "checking for X... $ECHO_C" >&6
20040
20041 # Check whether --with-x or --without-x was given.
20042 if test "${with_x+set}" = set; then
20043   withval="$with_x"
20044
20045 fi;
20046 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20047 if test "x$with_x" = xno; then
20048   # The user explicitly disabled X.
20049   have_x=disabled
20050 else
20051   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20052     # Both variables are already set.
20053     have_x=yes
20054   else
20055     if test "${ac_cv_have_x+set}" = set; then
20056   echo $ECHO_N "(cached) $ECHO_C" >&6
20057 else
20058   # One or both of the vars are not set, and there is no cached value.
20059 ac_x_includes=no ac_x_libraries=no
20060 rm -fr conftest.dir
20061 if mkdir conftest.dir; then
20062   cd conftest.dir
20063   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20064   cat >Imakefile <<'EOF'
20065 acfindx:
20066         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20067 EOF
20068   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20069     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20070     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
20071     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20072     for ac_extension in a so sl dylib dll; do
20073       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
20074          test -f $ac_im_libdir/libX11.$ac_extension; then
20075         ac_im_usrlibdir=$ac_im_libdir; break
20076       fi
20077     done
20078     # Screen out bogus values from the imake configuration.  They are
20079     # bogus both because they are the default anyway, and because
20080     # using them would break gcc on systems where it needs fixed includes.
20081     case $ac_im_incroot in
20082         /usr/include) ;;
20083         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20084     esac
20085     case $ac_im_usrlibdir in
20086         /usr/lib | /lib) ;;
20087         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20088     esac
20089   fi
20090   cd ..
20091   rm -fr conftest.dir
20092 fi
20093
20094 # Standard set of common directories for X headers.
20095 # Check X11 before X11Rn because it is often a symlink to the current release.
20096 ac_x_header_dirs='
20097 /usr/X11/include
20098 /usr/X11R7/include
20099 /usr/X11R6/include
20100 /usr/X11R5/include
20101 /usr/X11R4/include
20102
20103 /opt/local/include
20104 /opt/X11/include
20105
20106 /usr/include/X11
20107 /usr/include/X11R7
20108 /usr/include/X11R6
20109 /usr/include/X11R5
20110 /usr/include/X11R4
20111
20112 /usr/local/X11/include
20113 /usr/local/X11R7/include
20114 /usr/local/X11R6/include
20115 /usr/local/X11R5/include
20116 /usr/local/X11R4/include
20117
20118 /usr/local/include/X11
20119 /usr/local/include/X11R7
20120 /usr/local/include/X11R6
20121 /usr/local/include/X11R5
20122 /usr/local/include/X11R4
20123
20124 /usr/X386/include
20125 /usr/x386/include
20126 /usr/XFree86/include/X11
20127
20128 /usr/include
20129 /usr/local/include
20130 /usr/unsupported/include
20131 /usr/athena/include
20132 /usr/local/x11r5/include
20133 /usr/lpp/Xamples/include
20134
20135 /usr/openwin/include
20136 /usr/openwin/share/include'
20137
20138 if test "$ac_x_includes" = no; then
20139   # Guess where to find include files, by looking for Intrinsic.h.
20140   # First, try using that file with no special directory specified.
20141   cat >conftest.$ac_ext <<_ACEOF
20142 #line 20142 "configure"
20143 #include "confdefs.h"
20144 #include <X11/Intrinsic.h>
20145 _ACEOF
20146 if { (eval echo "$as_me:20146: \"$ac_cpp conftest.$ac_ext\"") >&5
20147   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20148   ac_status=$?
20149   egrep -v '^ *\+' conftest.er1 >conftest.err
20150   rm -f conftest.er1
20151   cat conftest.err >&5
20152   echo "$as_me:20152: \$? = $ac_status" >&5
20153   (exit $ac_status); } >/dev/null; then
20154   if test -s conftest.err; then
20155     ac_cpp_err=$ac_c_preproc_warn_flag
20156   else
20157     ac_cpp_err=
20158   fi
20159 else
20160   ac_cpp_err=yes
20161 fi
20162 if test -z "$ac_cpp_err"; then
20163   # We can compile using X headers with no special include directory.
20164 ac_x_includes=
20165 else
20166   echo "$as_me: failed program was:" >&5
20167   cat conftest.$ac_ext >&5
20168   for ac_dir in $ac_x_header_dirs; do
20169   if test -r "$ac_dir/X11/Intrinsic.h"; then
20170     ac_x_includes=$ac_dir
20171     break
20172   fi
20173 done
20174 fi
20175 rm -f conftest.err conftest.$ac_ext
20176 fi # $ac_x_includes = no
20177
20178 if test "$ac_x_libraries" = no; then
20179   # Check for the libraries.
20180   # See if we find them without any special options.
20181   # Don't add to $LIBS permanently.
20182   ac_save_LIBS=$LIBS
20183   LIBS="-lXt $LIBS"
20184   cat >conftest.$ac_ext <<_ACEOF
20185 #line 20185 "configure"
20186 #include "confdefs.h"
20187 #include <X11/Intrinsic.h>
20188 int
20189 main (void)
20190 {
20191 XtMalloc (0)
20192   ;
20193   return 0;
20194 }
20195 _ACEOF
20196 rm -f conftest.$ac_objext conftest$ac_exeext
20197 if { (eval echo "$as_me:20197: \"$ac_link\"") >&5
20198   (eval $ac_link) 2>&5
20199   ac_status=$?
20200   echo "$as_me:20200: \$? = $ac_status" >&5
20201   (exit $ac_status); } &&
20202          { ac_try='test -s conftest$ac_exeext'
20203   { (eval echo "$as_me:20203: \"$ac_try\"") >&5
20204   (eval $ac_try) 2>&5
20205   ac_status=$?
20206   echo "$as_me:20206: \$? = $ac_status" >&5
20207   (exit $ac_status); }; }; then
20208   LIBS=$ac_save_LIBS
20209 # We can link X programs with no special library path.
20210 ac_x_libraries=
20211 else
20212   echo "$as_me: failed program was:" >&5
20213 cat conftest.$ac_ext >&5
20214 LIBS=$ac_save_LIBS
20215 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20216 do
20217   # Don't even attempt the hair of trying to link an X program!
20218   for ac_extension in a so sl dylib dll; do
20219     if test -r $ac_dir/libXt.$ac_extension; then
20220       ac_x_libraries=$ac_dir
20221       break 2
20222     fi
20223   done
20224 done
20225 fi
20226 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20227 fi # $ac_x_libraries = no
20228
20229 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20230   # Didn't find X anywhere.  Cache the known absence of X.
20231   ac_cv_have_x="have_x=no"
20232 else
20233   # Record where we found X for the cache.
20234   ac_cv_have_x="have_x=yes \
20235                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20236 fi
20237 fi
20238
20239   fi
20240   eval "$ac_cv_have_x"
20241 fi # $with_x != no
20242
20243 if test "$have_x" != yes; then
20244   echo "$as_me:20244: result: $have_x" >&5
20245 echo "${ECHO_T}$have_x" >&6
20246   no_x=yes
20247 else
20248   # If each of the values was on the command line, it overrides each guess.
20249   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20250   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20251   # Update the cache value to reflect the command line values.
20252   ac_cv_have_x="have_x=yes \
20253                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20254   echo "$as_me:20254: result: libraries $x_libraries, headers $x_includes" >&5
20255 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20256 fi
20257
20258         if test "$no_x" = yes; then
20259   # Not all programs may use this symbol, but it does not hurt to define it.
20260
20261 cat >>confdefs.h <<\EOF
20262 #define X_DISPLAY_MISSING 1
20263 EOF
20264
20265   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
20266 else
20267   if test -n "$x_includes"; then
20268     X_CFLAGS="$X_CFLAGS -I$x_includes"
20269   fi
20270
20271   # It would also be nice to do this for all -L options, not just this one.
20272   if test -n "$x_libraries"; then
20273     X_LIBS="$X_LIBS -L$x_libraries"
20274     # For Solaris; some versions of Sun CC require a space after -R and
20275     # others require no space.  Words are not sufficient . . . .
20276     case `(uname -sr) 2>/dev/null` in
20277     "SunOS 5"*)
20278       echo "$as_me:20278: checking whether -R must be followed by a space" >&5
20279 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20280       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20281       cat >conftest.$ac_ext <<_ACEOF
20282 #line 20282 "configure"
20283 #include "confdefs.h"
20284
20285 int
20286 main (void)
20287 {
20288
20289   ;
20290   return 0;
20291 }
20292 _ACEOF
20293 rm -f conftest.$ac_objext conftest$ac_exeext
20294 if { (eval echo "$as_me:20294: \"$ac_link\"") >&5
20295   (eval $ac_link) 2>&5
20296   ac_status=$?
20297   echo "$as_me:20297: \$? = $ac_status" >&5
20298   (exit $ac_status); } &&
20299          { ac_try='test -s conftest$ac_exeext'
20300   { (eval echo "$as_me:20300: \"$ac_try\"") >&5
20301   (eval $ac_try) 2>&5
20302   ac_status=$?
20303   echo "$as_me:20303: \$? = $ac_status" >&5
20304   (exit $ac_status); }; }; then
20305   ac_R_nospace=yes
20306 else
20307   echo "$as_me: failed program was:" >&5
20308 cat conftest.$ac_ext >&5
20309 ac_R_nospace=no
20310 fi
20311 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20312       if test $ac_R_nospace = yes; then
20313         echo "$as_me:20313: result: no" >&5
20314 echo "${ECHO_T}no" >&6
20315         X_LIBS="$X_LIBS -R$x_libraries"
20316       else
20317         LIBS="$ac_xsave_LIBS -R $x_libraries"
20318         cat >conftest.$ac_ext <<_ACEOF
20319 #line 20319 "configure"
20320 #include "confdefs.h"
20321
20322 int
20323 main (void)
20324 {
20325
20326   ;
20327   return 0;
20328 }
20329 _ACEOF
20330 rm -f conftest.$ac_objext conftest$ac_exeext
20331 if { (eval echo "$as_me:20331: \"$ac_link\"") >&5
20332   (eval $ac_link) 2>&5
20333   ac_status=$?
20334   echo "$as_me:20334: \$? = $ac_status" >&5
20335   (exit $ac_status); } &&
20336          { ac_try='test -s conftest$ac_exeext'
20337   { (eval echo "$as_me:20337: \"$ac_try\"") >&5
20338   (eval $ac_try) 2>&5
20339   ac_status=$?
20340   echo "$as_me:20340: \$? = $ac_status" >&5
20341   (exit $ac_status); }; }; then
20342   ac_R_space=yes
20343 else
20344   echo "$as_me: failed program was:" >&5
20345 cat conftest.$ac_ext >&5
20346 ac_R_space=no
20347 fi
20348 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20349         if test $ac_R_space = yes; then
20350           echo "$as_me:20350: result: yes" >&5
20351 echo "${ECHO_T}yes" >&6
20352           X_LIBS="$X_LIBS -R $x_libraries"
20353         else
20354           echo "$as_me:20354: result: neither works" >&5
20355 echo "${ECHO_T}neither works" >&6
20356         fi
20357       fi
20358       LIBS=$ac_xsave_LIBS
20359     esac
20360   fi
20361
20362   # Check for system-dependent libraries X programs must link with.
20363   # Do this before checking for the system-independent R6 libraries
20364   # (-lICE), since we may need -lsocket or whatever for X linking.
20365
20366   if test "$ISC" = yes; then
20367     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20368   else
20369     # Martyn Johnson says this is needed for Ultrix, if the X
20370     # libraries were built with DECnet support.  And Karl Berry says
20371     # the Alpha needs dnet_stub (dnet does not exist).
20372     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20373     cat >conftest.$ac_ext <<_ACEOF
20374 #line 20374 "configure"
20375 #include "confdefs.h"
20376
20377 /* Override any gcc2 internal prototype to avoid an error.  */
20378 #ifdef __cplusplus
20379 extern "C"
20380 #endif
20381 /* We use char because int might match the return type of a gcc2
20382    builtin and then its argument prototype would still apply.  */
20383 char XOpenDisplay ();
20384 int
20385 main (void)
20386 {
20387 XOpenDisplay ();
20388   ;
20389   return 0;
20390 }
20391 _ACEOF
20392 rm -f conftest.$ac_objext conftest$ac_exeext
20393 if { (eval echo "$as_me:20393: \"$ac_link\"") >&5
20394   (eval $ac_link) 2>&5
20395   ac_status=$?
20396   echo "$as_me:20396: \$? = $ac_status" >&5
20397   (exit $ac_status); } &&
20398          { ac_try='test -s conftest$ac_exeext'
20399   { (eval echo "$as_me:20399: \"$ac_try\"") >&5
20400   (eval $ac_try) 2>&5
20401   ac_status=$?
20402   echo "$as_me:20402: \$? = $ac_status" >&5
20403   (exit $ac_status); }; }; then
20404   :
20405 else
20406   echo "$as_me: failed program was:" >&5
20407 cat conftest.$ac_ext >&5
20408 echo "$as_me:20408: checking for dnet_ntoa in -ldnet" >&5
20409 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20410 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20411   echo $ECHO_N "(cached) $ECHO_C" >&6
20412 else
20413   ac_check_lib_save_LIBS=$LIBS
20414 LIBS="-ldnet  $LIBS"
20415 cat >conftest.$ac_ext <<_ACEOF
20416 #line 20416 "configure"
20417 #include "confdefs.h"
20418
20419 /* Override any gcc2 internal prototype to avoid an error.  */
20420 #ifdef __cplusplus
20421 extern "C"
20422 #endif
20423 /* We use char because int might match the return type of a gcc2
20424    builtin and then its argument prototype would still apply.  */
20425 char dnet_ntoa ();
20426 int
20427 main (void)
20428 {
20429 dnet_ntoa ();
20430   ;
20431   return 0;
20432 }
20433 _ACEOF
20434 rm -f conftest.$ac_objext conftest$ac_exeext
20435 if { (eval echo "$as_me:20435: \"$ac_link\"") >&5
20436   (eval $ac_link) 2>&5
20437   ac_status=$?
20438   echo "$as_me:20438: \$? = $ac_status" >&5
20439   (exit $ac_status); } &&
20440          { ac_try='test -s conftest$ac_exeext'
20441   { (eval echo "$as_me:20441: \"$ac_try\"") >&5
20442   (eval $ac_try) 2>&5
20443   ac_status=$?
20444   echo "$as_me:20444: \$? = $ac_status" >&5
20445   (exit $ac_status); }; }; then
20446   ac_cv_lib_dnet_dnet_ntoa=yes
20447 else
20448   echo "$as_me: failed program was:" >&5
20449 cat conftest.$ac_ext >&5
20450 ac_cv_lib_dnet_dnet_ntoa=no
20451 fi
20452 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20453 LIBS=$ac_check_lib_save_LIBS
20454 fi
20455 echo "$as_me:20455: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20456 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20457 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
20458   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20459 fi
20460
20461     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20462       echo "$as_me:20462: checking for dnet_ntoa in -ldnet_stub" >&5
20463 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20464 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20465   echo $ECHO_N "(cached) $ECHO_C" >&6
20466 else
20467   ac_check_lib_save_LIBS=$LIBS
20468 LIBS="-ldnet_stub  $LIBS"
20469 cat >conftest.$ac_ext <<_ACEOF
20470 #line 20470 "configure"
20471 #include "confdefs.h"
20472
20473 /* Override any gcc2 internal prototype to avoid an error.  */
20474 #ifdef __cplusplus
20475 extern "C"
20476 #endif
20477 /* We use char because int might match the return type of a gcc2
20478    builtin and then its argument prototype would still apply.  */
20479 char dnet_ntoa ();
20480 int
20481 main (void)
20482 {
20483 dnet_ntoa ();
20484   ;
20485   return 0;
20486 }
20487 _ACEOF
20488 rm -f conftest.$ac_objext conftest$ac_exeext
20489 if { (eval echo "$as_me:20489: \"$ac_link\"") >&5
20490   (eval $ac_link) 2>&5
20491   ac_status=$?
20492   echo "$as_me:20492: \$? = $ac_status" >&5
20493   (exit $ac_status); } &&
20494          { ac_try='test -s conftest$ac_exeext'
20495   { (eval echo "$as_me:20495: \"$ac_try\"") >&5
20496   (eval $ac_try) 2>&5
20497   ac_status=$?
20498   echo "$as_me:20498: \$? = $ac_status" >&5
20499   (exit $ac_status); }; }; then
20500   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20501 else
20502   echo "$as_me: failed program was:" >&5
20503 cat conftest.$ac_ext >&5
20504 ac_cv_lib_dnet_stub_dnet_ntoa=no
20505 fi
20506 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20507 LIBS=$ac_check_lib_save_LIBS
20508 fi
20509 echo "$as_me:20509: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20510 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20511 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
20512   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20513 fi
20514
20515     fi
20516 fi
20517 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20518     LIBS="$ac_xsave_LIBS"
20519
20520     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20521     # to get the SysV transport functions.
20522     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20523     # needs -lnsl.
20524     # The nsl library prevents programs from opening the X display
20525     # on Irix 5.2, according to T.E. Dickey.
20526     # The functions gethostbyname, getservbyname, and inet_addr are
20527     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20528     echo "$as_me:20528: checking for gethostbyname" >&5
20529 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20530 if test "${ac_cv_func_gethostbyname+set}" = set; then
20531   echo $ECHO_N "(cached) $ECHO_C" >&6
20532 else
20533   cat >conftest.$ac_ext <<_ACEOF
20534 #line 20534 "configure"
20535 #include "confdefs.h"
20536 #define gethostbyname autoconf_temporary
20537 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20538 #undef gethostbyname
20539
20540 #ifdef __cplusplus
20541 extern "C"
20542 #endif
20543
20544 /* We use char because int might match the return type of a gcc2
20545    builtin and then its argument prototype would still apply.  */
20546 char gethostbyname (void);
20547
20548 int
20549 main (void)
20550 {
20551
20552 /* The GNU C library defines stubs for functions which it implements
20553     to always fail with ENOSYS.  Some functions are actually named
20554     something starting with __ and the normal name is an alias.  */
20555 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
20556 #error found stub for gethostbyname
20557 #endif
20558
20559         return gethostbyname ();
20560   ;
20561   return 0;
20562 }
20563 _ACEOF
20564 rm -f conftest.$ac_objext conftest$ac_exeext
20565 if { (eval echo "$as_me:20565: \"$ac_link\"") >&5
20566   (eval $ac_link) 2>&5
20567   ac_status=$?
20568   echo "$as_me:20568: \$? = $ac_status" >&5
20569   (exit $ac_status); } &&
20570          { ac_try='test -s conftest$ac_exeext'
20571   { (eval echo "$as_me:20571: \"$ac_try\"") >&5
20572   (eval $ac_try) 2>&5
20573   ac_status=$?
20574   echo "$as_me:20574: \$? = $ac_status" >&5
20575   (exit $ac_status); }; }; then
20576   ac_cv_func_gethostbyname=yes
20577 else
20578   echo "$as_me: failed program was:" >&5
20579 cat conftest.$ac_ext >&5
20580 ac_cv_func_gethostbyname=no
20581 fi
20582 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20583 fi
20584 echo "$as_me:20584: result: $ac_cv_func_gethostbyname" >&5
20585 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
20586
20587     if test $ac_cv_func_gethostbyname = no; then
20588       echo "$as_me:20588: checking for gethostbyname in -lnsl" >&5
20589 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
20590 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
20591   echo $ECHO_N "(cached) $ECHO_C" >&6
20592 else
20593   ac_check_lib_save_LIBS=$LIBS
20594 LIBS="-lnsl  $LIBS"
20595 cat >conftest.$ac_ext <<_ACEOF
20596 #line 20596 "configure"
20597 #include "confdefs.h"
20598
20599 /* Override any gcc2 internal prototype to avoid an error.  */
20600 #ifdef __cplusplus
20601 extern "C"
20602 #endif
20603 /* We use char because int might match the return type of a gcc2
20604    builtin and then its argument prototype would still apply.  */
20605 char gethostbyname ();
20606 int
20607 main (void)
20608 {
20609 gethostbyname ();
20610   ;
20611   return 0;
20612 }
20613 _ACEOF
20614 rm -f conftest.$ac_objext conftest$ac_exeext
20615 if { (eval echo "$as_me:20615: \"$ac_link\"") >&5
20616   (eval $ac_link) 2>&5
20617   ac_status=$?
20618   echo "$as_me:20618: \$? = $ac_status" >&5
20619   (exit $ac_status); } &&
20620          { ac_try='test -s conftest$ac_exeext'
20621   { (eval echo "$as_me:20621: \"$ac_try\"") >&5
20622   (eval $ac_try) 2>&5
20623   ac_status=$?
20624   echo "$as_me:20624: \$? = $ac_status" >&5
20625   (exit $ac_status); }; }; then
20626   ac_cv_lib_nsl_gethostbyname=yes
20627 else
20628   echo "$as_me: failed program was:" >&5
20629 cat conftest.$ac_ext >&5
20630 ac_cv_lib_nsl_gethostbyname=no
20631 fi
20632 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20633 LIBS=$ac_check_lib_save_LIBS
20634 fi
20635 echo "$as_me:20635: result: $ac_cv_lib_nsl_gethostbyname" >&5
20636 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
20637 if test $ac_cv_lib_nsl_gethostbyname = yes; then
20638   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
20639 fi
20640
20641       if test $ac_cv_lib_nsl_gethostbyname = no; then
20642         echo "$as_me:20642: checking for gethostbyname in -lbsd" >&5
20643 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
20644 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
20645   echo $ECHO_N "(cached) $ECHO_C" >&6
20646 else
20647   ac_check_lib_save_LIBS=$LIBS
20648 LIBS="-lbsd  $LIBS"
20649 cat >conftest.$ac_ext <<_ACEOF
20650 #line 20650 "configure"
20651 #include "confdefs.h"
20652
20653 /* Override any gcc2 internal prototype to avoid an error.  */
20654 #ifdef __cplusplus
20655 extern "C"
20656 #endif
20657 /* We use char because int might match the return type of a gcc2
20658    builtin and then its argument prototype would still apply.  */
20659 char gethostbyname ();
20660 int
20661 main (void)
20662 {
20663 gethostbyname ();
20664   ;
20665   return 0;
20666 }
20667 _ACEOF
20668 rm -f conftest.$ac_objext conftest$ac_exeext
20669 if { (eval echo "$as_me:20669: \"$ac_link\"") >&5
20670   (eval $ac_link) 2>&5
20671   ac_status=$?
20672   echo "$as_me:20672: \$? = $ac_status" >&5
20673   (exit $ac_status); } &&
20674          { ac_try='test -s conftest$ac_exeext'
20675   { (eval echo "$as_me:20675: \"$ac_try\"") >&5
20676   (eval $ac_try) 2>&5
20677   ac_status=$?
20678   echo "$as_me:20678: \$? = $ac_status" >&5
20679   (exit $ac_status); }; }; then
20680   ac_cv_lib_bsd_gethostbyname=yes
20681 else
20682   echo "$as_me: failed program was:" >&5
20683 cat conftest.$ac_ext >&5
20684 ac_cv_lib_bsd_gethostbyname=no
20685 fi
20686 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20687 LIBS=$ac_check_lib_save_LIBS
20688 fi
20689 echo "$as_me:20689: result: $ac_cv_lib_bsd_gethostbyname" >&5
20690 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
20691 if test $ac_cv_lib_bsd_gethostbyname = yes; then
20692   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
20693 fi
20694
20695       fi
20696     fi
20697
20698     # lieder@skyler.mavd.honeywell.com says without -lsocket,
20699     # socket/setsockopt and other routines are undefined under SCO ODT
20700     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
20701     # on later versions), says Simon Leinen: it contains gethostby*
20702     # variants that don't use the nameserver (or something).  -lsocket
20703     # must be given before -lnsl if both are needed.  We assume that
20704     # if connect needs -lnsl, so does gethostbyname.
20705     echo "$as_me:20705: checking for connect" >&5
20706 echo $ECHO_N "checking for connect... $ECHO_C" >&6
20707 if test "${ac_cv_func_connect+set}" = set; then
20708   echo $ECHO_N "(cached) $ECHO_C" >&6
20709 else
20710   cat >conftest.$ac_ext <<_ACEOF
20711 #line 20711 "configure"
20712 #include "confdefs.h"
20713 #define connect autoconf_temporary
20714 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20715 #undef connect
20716
20717 #ifdef __cplusplus
20718 extern "C"
20719 #endif
20720
20721 /* We use char because int might match the return type of a gcc2
20722    builtin and then its argument prototype would still apply.  */
20723 char connect (void);
20724
20725 int
20726 main (void)
20727 {
20728
20729 /* The GNU C library defines stubs for functions which it implements
20730     to always fail with ENOSYS.  Some functions are actually named
20731     something starting with __ and the normal name is an alias.  */
20732 #if defined (__stub_connect) || defined (__stub___connect)
20733 #error found stub for connect
20734 #endif
20735
20736         return connect ();
20737   ;
20738   return 0;
20739 }
20740 _ACEOF
20741 rm -f conftest.$ac_objext conftest$ac_exeext
20742 if { (eval echo "$as_me:20742: \"$ac_link\"") >&5
20743   (eval $ac_link) 2>&5
20744   ac_status=$?
20745   echo "$as_me:20745: \$? = $ac_status" >&5
20746   (exit $ac_status); } &&
20747          { ac_try='test -s conftest$ac_exeext'
20748   { (eval echo "$as_me:20748: \"$ac_try\"") >&5
20749   (eval $ac_try) 2>&5
20750   ac_status=$?
20751   echo "$as_me:20751: \$? = $ac_status" >&5
20752   (exit $ac_status); }; }; then
20753   ac_cv_func_connect=yes
20754 else
20755   echo "$as_me: failed program was:" >&5
20756 cat conftest.$ac_ext >&5
20757 ac_cv_func_connect=no
20758 fi
20759 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20760 fi
20761 echo "$as_me:20761: result: $ac_cv_func_connect" >&5
20762 echo "${ECHO_T}$ac_cv_func_connect" >&6
20763
20764     if test $ac_cv_func_connect = no; then
20765       echo "$as_me:20765: checking for connect in -lsocket" >&5
20766 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
20767 if test "${ac_cv_lib_socket_connect+set}" = set; then
20768   echo $ECHO_N "(cached) $ECHO_C" >&6
20769 else
20770   ac_check_lib_save_LIBS=$LIBS
20771 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
20772 cat >conftest.$ac_ext <<_ACEOF
20773 #line 20773 "configure"
20774 #include "confdefs.h"
20775
20776 /* Override any gcc2 internal prototype to avoid an error.  */
20777 #ifdef __cplusplus
20778 extern "C"
20779 #endif
20780 /* We use char because int might match the return type of a gcc2
20781    builtin and then its argument prototype would still apply.  */
20782 char connect ();
20783 int
20784 main (void)
20785 {
20786 connect ();
20787   ;
20788   return 0;
20789 }
20790 _ACEOF
20791 rm -f conftest.$ac_objext conftest$ac_exeext
20792 if { (eval echo "$as_me:20792: \"$ac_link\"") >&5
20793   (eval $ac_link) 2>&5
20794   ac_status=$?
20795   echo "$as_me:20795: \$? = $ac_status" >&5
20796   (exit $ac_status); } &&
20797          { ac_try='test -s conftest$ac_exeext'
20798   { (eval echo "$as_me:20798: \"$ac_try\"") >&5
20799   (eval $ac_try) 2>&5
20800   ac_status=$?
20801   echo "$as_me:20801: \$? = $ac_status" >&5
20802   (exit $ac_status); }; }; then
20803   ac_cv_lib_socket_connect=yes
20804 else
20805   echo "$as_me: failed program was:" >&5
20806 cat conftest.$ac_ext >&5
20807 ac_cv_lib_socket_connect=no
20808 fi
20809 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20810 LIBS=$ac_check_lib_save_LIBS
20811 fi
20812 echo "$as_me:20812: result: $ac_cv_lib_socket_connect" >&5
20813 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
20814 if test $ac_cv_lib_socket_connect = yes; then
20815   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
20816 fi
20817
20818     fi
20819
20820     # Guillermo Gomez says -lposix is necessary on A/UX.
20821     echo "$as_me:20821: checking for remove" >&5
20822 echo $ECHO_N "checking for remove... $ECHO_C" >&6
20823 if test "${ac_cv_func_remove+set}" = set; then
20824   echo $ECHO_N "(cached) $ECHO_C" >&6
20825 else
20826   cat >conftest.$ac_ext <<_ACEOF
20827 #line 20827 "configure"
20828 #include "confdefs.h"
20829 #define remove autoconf_temporary
20830 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20831 #undef remove
20832
20833 #ifdef __cplusplus
20834 extern "C"
20835 #endif
20836
20837 /* We use char because int might match the return type of a gcc2
20838    builtin and then its argument prototype would still apply.  */
20839 char remove (void);
20840
20841 int
20842 main (void)
20843 {
20844
20845 /* The GNU C library defines stubs for functions which it implements
20846     to always fail with ENOSYS.  Some functions are actually named
20847     something starting with __ and the normal name is an alias.  */
20848 #if defined (__stub_remove) || defined (__stub___remove)
20849 #error found stub for remove
20850 #endif
20851
20852         return remove ();
20853   ;
20854   return 0;
20855 }
20856 _ACEOF
20857 rm -f conftest.$ac_objext conftest$ac_exeext
20858 if { (eval echo "$as_me:20858: \"$ac_link\"") >&5
20859   (eval $ac_link) 2>&5
20860   ac_status=$?
20861   echo "$as_me:20861: \$? = $ac_status" >&5
20862   (exit $ac_status); } &&
20863          { ac_try='test -s conftest$ac_exeext'
20864   { (eval echo "$as_me:20864: \"$ac_try\"") >&5
20865   (eval $ac_try) 2>&5
20866   ac_status=$?
20867   echo "$as_me:20867: \$? = $ac_status" >&5
20868   (exit $ac_status); }; }; then
20869   ac_cv_func_remove=yes
20870 else
20871   echo "$as_me: failed program was:" >&5
20872 cat conftest.$ac_ext >&5
20873 ac_cv_func_remove=no
20874 fi
20875 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20876 fi
20877 echo "$as_me:20877: result: $ac_cv_func_remove" >&5
20878 echo "${ECHO_T}$ac_cv_func_remove" >&6
20879
20880     if test $ac_cv_func_remove = no; then
20881       echo "$as_me:20881: checking for remove in -lposix" >&5
20882 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
20883 if test "${ac_cv_lib_posix_remove+set}" = set; then
20884   echo $ECHO_N "(cached) $ECHO_C" >&6
20885 else
20886   ac_check_lib_save_LIBS=$LIBS
20887 LIBS="-lposix  $LIBS"
20888 cat >conftest.$ac_ext <<_ACEOF
20889 #line 20889 "configure"
20890 #include "confdefs.h"
20891
20892 /* Override any gcc2 internal prototype to avoid an error.  */
20893 #ifdef __cplusplus
20894 extern "C"
20895 #endif
20896 /* We use char because int might match the return type of a gcc2
20897    builtin and then its argument prototype would still apply.  */
20898 char remove ();
20899 int
20900 main (void)
20901 {
20902 remove ();
20903   ;
20904   return 0;
20905 }
20906 _ACEOF
20907 rm -f conftest.$ac_objext conftest$ac_exeext
20908 if { (eval echo "$as_me:20908: \"$ac_link\"") >&5
20909   (eval $ac_link) 2>&5
20910   ac_status=$?
20911   echo "$as_me:20911: \$? = $ac_status" >&5
20912   (exit $ac_status); } &&
20913          { ac_try='test -s conftest$ac_exeext'
20914   { (eval echo "$as_me:20914: \"$ac_try\"") >&5
20915   (eval $ac_try) 2>&5
20916   ac_status=$?
20917   echo "$as_me:20917: \$? = $ac_status" >&5
20918   (exit $ac_status); }; }; then
20919   ac_cv_lib_posix_remove=yes
20920 else
20921   echo "$as_me: failed program was:" >&5
20922 cat conftest.$ac_ext >&5
20923 ac_cv_lib_posix_remove=no
20924 fi
20925 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20926 LIBS=$ac_check_lib_save_LIBS
20927 fi
20928 echo "$as_me:20928: result: $ac_cv_lib_posix_remove" >&5
20929 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
20930 if test $ac_cv_lib_posix_remove = yes; then
20931   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
20932 fi
20933
20934     fi
20935
20936     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
20937     echo "$as_me:20937: checking for shmat" >&5
20938 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
20939 if test "${ac_cv_func_shmat+set}" = set; then
20940   echo $ECHO_N "(cached) $ECHO_C" >&6
20941 else
20942   cat >conftest.$ac_ext <<_ACEOF
20943 #line 20943 "configure"
20944 #include "confdefs.h"
20945 #define shmat autoconf_temporary
20946 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20947 #undef shmat
20948
20949 #ifdef __cplusplus
20950 extern "C"
20951 #endif
20952
20953 /* We use char because int might match the return type of a gcc2
20954    builtin and then its argument prototype would still apply.  */
20955 char shmat (void);
20956
20957 int
20958 main (void)
20959 {
20960
20961 /* The GNU C library defines stubs for functions which it implements
20962     to always fail with ENOSYS.  Some functions are actually named
20963     something starting with __ and the normal name is an alias.  */
20964 #if defined (__stub_shmat) || defined (__stub___shmat)
20965 #error found stub for shmat
20966 #endif
20967
20968         return shmat ();
20969   ;
20970   return 0;
20971 }
20972 _ACEOF
20973 rm -f conftest.$ac_objext conftest$ac_exeext
20974 if { (eval echo "$as_me:20974: \"$ac_link\"") >&5
20975   (eval $ac_link) 2>&5
20976   ac_status=$?
20977   echo "$as_me:20977: \$? = $ac_status" >&5
20978   (exit $ac_status); } &&
20979          { ac_try='test -s conftest$ac_exeext'
20980   { (eval echo "$as_me:20980: \"$ac_try\"") >&5
20981   (eval $ac_try) 2>&5
20982   ac_status=$?
20983   echo "$as_me:20983: \$? = $ac_status" >&5
20984   (exit $ac_status); }; }; then
20985   ac_cv_func_shmat=yes
20986 else
20987   echo "$as_me: failed program was:" >&5
20988 cat conftest.$ac_ext >&5
20989 ac_cv_func_shmat=no
20990 fi
20991 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20992 fi
20993 echo "$as_me:20993: result: $ac_cv_func_shmat" >&5
20994 echo "${ECHO_T}$ac_cv_func_shmat" >&6
20995
20996     if test $ac_cv_func_shmat = no; then
20997       echo "$as_me:20997: checking for shmat in -lipc" >&5
20998 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
20999 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21000   echo $ECHO_N "(cached) $ECHO_C" >&6
21001 else
21002   ac_check_lib_save_LIBS=$LIBS
21003 LIBS="-lipc  $LIBS"
21004 cat >conftest.$ac_ext <<_ACEOF
21005 #line 21005 "configure"
21006 #include "confdefs.h"
21007
21008 /* Override any gcc2 internal prototype to avoid an error.  */
21009 #ifdef __cplusplus
21010 extern "C"
21011 #endif
21012 /* We use char because int might match the return type of a gcc2
21013    builtin and then its argument prototype would still apply.  */
21014 char shmat ();
21015 int
21016 main (void)
21017 {
21018 shmat ();
21019   ;
21020   return 0;
21021 }
21022 _ACEOF
21023 rm -f conftest.$ac_objext conftest$ac_exeext
21024 if { (eval echo "$as_me:21024: \"$ac_link\"") >&5
21025   (eval $ac_link) 2>&5
21026   ac_status=$?
21027   echo "$as_me:21027: \$? = $ac_status" >&5
21028   (exit $ac_status); } &&
21029          { ac_try='test -s conftest$ac_exeext'
21030   { (eval echo "$as_me:21030: \"$ac_try\"") >&5
21031   (eval $ac_try) 2>&5
21032   ac_status=$?
21033   echo "$as_me:21033: \$? = $ac_status" >&5
21034   (exit $ac_status); }; }; then
21035   ac_cv_lib_ipc_shmat=yes
21036 else
21037   echo "$as_me: failed program was:" >&5
21038 cat conftest.$ac_ext >&5
21039 ac_cv_lib_ipc_shmat=no
21040 fi
21041 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21042 LIBS=$ac_check_lib_save_LIBS
21043 fi
21044 echo "$as_me:21044: result: $ac_cv_lib_ipc_shmat" >&5
21045 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21046 if test $ac_cv_lib_ipc_shmat = yes; then
21047   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21048 fi
21049
21050     fi
21051   fi
21052
21053   # Check for libraries that X11R6 Xt/Xaw programs need.
21054   ac_save_LDFLAGS=$LDFLAGS
21055   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21056   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21057   # check for ICE first), but we must link in the order -lSM -lICE or
21058   # we get undefined symbols.  So assume we have SM if we have ICE.
21059   # These have to be linked with before -lX11, unlike the other
21060   # libraries we check for below, so use a different variable.
21061   # John Interrante, Karl Berry
21062   echo "$as_me:21062: checking for IceConnectionNumber in -lICE" >&5
21063 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21064 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21065   echo $ECHO_N "(cached) $ECHO_C" >&6
21066 else
21067   ac_check_lib_save_LIBS=$LIBS
21068 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21069 cat >conftest.$ac_ext <<_ACEOF
21070 #line 21070 "configure"
21071 #include "confdefs.h"
21072
21073 /* Override any gcc2 internal prototype to avoid an error.  */
21074 #ifdef __cplusplus
21075 extern "C"
21076 #endif
21077 /* We use char because int might match the return type of a gcc2
21078    builtin and then its argument prototype would still apply.  */
21079 char IceConnectionNumber ();
21080 int
21081 main (void)
21082 {
21083 IceConnectionNumber ();
21084   ;
21085   return 0;
21086 }
21087 _ACEOF
21088 rm -f conftest.$ac_objext conftest$ac_exeext
21089 if { (eval echo "$as_me:21089: \"$ac_link\"") >&5
21090   (eval $ac_link) 2>&5
21091   ac_status=$?
21092   echo "$as_me:21092: \$? = $ac_status" >&5
21093   (exit $ac_status); } &&
21094          { ac_try='test -s conftest$ac_exeext'
21095   { (eval echo "$as_me:21095: \"$ac_try\"") >&5
21096   (eval $ac_try) 2>&5
21097   ac_status=$?
21098   echo "$as_me:21098: \$? = $ac_status" >&5
21099   (exit $ac_status); }; }; then
21100   ac_cv_lib_ICE_IceConnectionNumber=yes
21101 else
21102   echo "$as_me: failed program was:" >&5
21103 cat conftest.$ac_ext >&5
21104 ac_cv_lib_ICE_IceConnectionNumber=no
21105 fi
21106 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21107 LIBS=$ac_check_lib_save_LIBS
21108 fi
21109 echo "$as_me:21109: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21110 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21111 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
21112   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21113 fi
21114
21115   LDFLAGS=$ac_save_LDFLAGS
21116
21117 fi
21118
21119 fi
21120
21121 if ( test "$GCC" = yes || test "$GXX" = yes )
21122 then
21123
21124 if ( test "$GCC" = yes || test "$GXX" = yes )
21125 then
21126         case $CFLAGS in
21127         (*-Werror=*)
21128                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21129
21130 echo "${as_me:-configure}:21130: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21131
21132                 cf_temp_flags=
21133                 for cf_temp_scan in $CFLAGS
21134                 do
21135                         case "x$cf_temp_scan" in
21136                         (x-Werror=*)
21137
21138         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21139         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21140
21141                                 ;;
21142                         (*)
21143
21144         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21145         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21146
21147                                 ;;
21148                         esac
21149                 done
21150                 CFLAGS="$cf_temp_flags"
21151                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21152
21153 echo "${as_me:-configure}:21153: testing ... fixed $CFLAGS ..." 1>&5
21154
21155                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21156
21157 echo "${as_me:-configure}:21157: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21158
21159                 ;;
21160         esac
21161 fi
21162
21163 if ( test "$GCC" = yes || test "$GXX" = yes )
21164 then
21165         case $CPPFLAGS in
21166         (*-Werror=*)
21167                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21168
21169 echo "${as_me:-configure}:21169: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21170
21171                 cf_temp_flags=
21172                 for cf_temp_scan in $CPPFLAGS
21173                 do
21174                         case "x$cf_temp_scan" in
21175                         (x-Werror=*)
21176
21177         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21178         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21179
21180                                 ;;
21181                         (*)
21182
21183         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21184         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21185
21186                                 ;;
21187                         esac
21188                 done
21189                 CPPFLAGS="$cf_temp_flags"
21190                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21191
21192 echo "${as_me:-configure}:21192: testing ... fixed $CPPFLAGS ..." 1>&5
21193
21194                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21195
21196 echo "${as_me:-configure}:21196: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21197
21198                 ;;
21199         esac
21200 fi
21201
21202 if ( test "$GCC" = yes || test "$GXX" = yes )
21203 then
21204         case $LDFLAGS in
21205         (*-Werror=*)
21206                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21207
21208 echo "${as_me:-configure}:21208: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21209
21210                 cf_temp_flags=
21211                 for cf_temp_scan in $LDFLAGS
21212                 do
21213                         case "x$cf_temp_scan" in
21214                         (x-Werror=*)
21215
21216         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21217         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21218
21219                                 ;;
21220                         (*)
21221
21222         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21223         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21224
21225                                 ;;
21226                         esac
21227                 done
21228                 LDFLAGS="$cf_temp_flags"
21229                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21230
21231 echo "${as_me:-configure}:21231: testing ... fixed $LDFLAGS ..." 1>&5
21232
21233                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21234
21235 echo "${as_me:-configure}:21235: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21236
21237                 ;;
21238         esac
21239 fi
21240
21241 echo "$as_me:21241: checking if you want to turn on gcc warnings" >&5
21242 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21243
21244 # Check whether --enable-warnings or --disable-warnings was given.
21245 if test "${enable_warnings+set}" = set; then
21246   enableval="$enable_warnings"
21247   test "$enableval" != yes && enableval=no
21248         if test "$enableval" != "no" ; then
21249     with_warnings=yes
21250         else
21251                 with_warnings=no
21252         fi
21253 else
21254   enableval=no
21255         with_warnings=no
21256
21257 fi;
21258 echo "$as_me:21258: result: $with_warnings" >&5
21259 echo "${ECHO_T}$with_warnings" >&6
21260 if test "$with_warnings" = "yes"
21261 then
21262
21263 if test "$GCC" = yes
21264 then
21265 cat > conftest.i <<EOF
21266 #ifndef GCC_PRINTF
21267 #define GCC_PRINTF 0
21268 #endif
21269 #ifndef GCC_SCANF
21270 #define GCC_SCANF 0
21271 #endif
21272 #ifndef GCC_NORETURN
21273 #define GCC_NORETURN /* nothing */
21274 #endif
21275 #ifndef GCC_UNUSED
21276 #define GCC_UNUSED /* nothing */
21277 #endif
21278 EOF
21279 if test "$GCC" = yes
21280 then
21281         { echo "$as_me:21281: checking for $CC __attribute__ directives..." >&5
21282 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21283 cat > conftest.$ac_ext <<EOF
21284 #line 21284 "${as_me:-configure}"
21285 #include "confdefs.h"
21286 #include "conftest.h"
21287 #include "conftest.i"
21288 #if     GCC_PRINTF
21289 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21290 #else
21291 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21292 #endif
21293 #if     GCC_SCANF
21294 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21295 #else
21296 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21297 #endif
21298 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21299 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
21300 extern void foo(void) GCC_NORETURN;
21301 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21302 EOF
21303         cf_printf_attribute=no
21304         cf_scanf_attribute=no
21305         for cf_attribute in scanf printf unused noreturn
21306         do
21307
21308 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21309
21310                 cf_directive="__attribute__(($cf_attribute))"
21311                 echo "checking for $CC $cf_directive" 1>&5
21312
21313                 case $cf_attribute in
21314                 (printf)
21315                         cf_printf_attribute=yes
21316                         cat >conftest.h <<EOF
21317 #define GCC_$cf_ATTRIBUTE 1
21318 EOF
21319                         ;;
21320                 (scanf)
21321                         cf_scanf_attribute=yes
21322                         cat >conftest.h <<EOF
21323 #define GCC_$cf_ATTRIBUTE 1
21324 EOF
21325                         ;;
21326                 (*)
21327                         cat >conftest.h <<EOF
21328 #define GCC_$cf_ATTRIBUTE $cf_directive
21329 EOF
21330                         ;;
21331                 esac
21332
21333                 if { (eval echo "$as_me:21333: \"$ac_compile\"") >&5
21334   (eval $ac_compile) 2>&5
21335   ac_status=$?
21336   echo "$as_me:21336: \$? = $ac_status" >&5
21337   (exit $ac_status); }; then
21338                         test -n "$verbose" && echo "$as_me:21338: result: ... $cf_attribute" >&5
21339 echo "${ECHO_T}... $cf_attribute" >&6
21340                         cat conftest.h >>confdefs.h
21341                         case $cf_attribute in
21342                         (noreturn)
21343
21344 cat >>confdefs.h <<EOF
21345 #define GCC_NORETURN $cf_directive
21346 EOF
21347
21348                                 ;;
21349                         (printf)
21350                                 cf_value='/* nothing */'
21351                                 if test "$cf_printf_attribute" != no ; then
21352                                         cf_value='__attribute__((format(printf,fmt,var)))'
21353
21354 cat >>confdefs.h <<\EOF
21355 #define GCC_PRINTF 1
21356 EOF
21357
21358                                 fi
21359
21360 cat >>confdefs.h <<EOF
21361 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21362 EOF
21363
21364                                 ;;
21365                         (scanf)
21366                                 cf_value='/* nothing */'
21367                                 if test "$cf_scanf_attribute" != no ; then
21368                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21369
21370 cat >>confdefs.h <<\EOF
21371 #define GCC_SCANF 1
21372 EOF
21373
21374                                 fi
21375
21376 cat >>confdefs.h <<EOF
21377 #define GCC_SCANFLIKE(fmt,var) $cf_value
21378 EOF
21379
21380                                 ;;
21381                         (unused)
21382
21383 cat >>confdefs.h <<EOF
21384 #define GCC_UNUSED $cf_directive
21385 EOF
21386
21387                                 ;;
21388                         esac
21389                 fi
21390         done
21391 else
21392         fgrep define conftest.i >>confdefs.h
21393 fi
21394 rm -rf conftest*
21395 fi
21396
21397 if test "x$have_x" = xyes; then
21398
21399 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21400 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21401 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21402 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21403 for cf_X_CFLAGS in $X_CFLAGS
21404 do
21405         case "x$cf_X_CFLAGS" in
21406         x-[IUD]*)
21407                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21408                 ;;
21409         *)
21410                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21411                 ;;
21412         esac
21413 done
21414
21415 cat >conftest.$ac_ext <<_ACEOF
21416 #line 21416 "configure"
21417 #include "confdefs.h"
21418
21419 #include <stdlib.h>
21420 #include <X11/Intrinsic.h>
21421
21422 int
21423 main (void)
21424 {
21425 String foo = malloc(1); (void)foo
21426   ;
21427   return 0;
21428 }
21429 _ACEOF
21430 rm -f conftest.$ac_objext
21431 if { (eval echo "$as_me:21431: \"$ac_compile\"") >&5
21432   (eval $ac_compile) 2>&5
21433   ac_status=$?
21434   echo "$as_me:21434: \$? = $ac_status" >&5
21435   (exit $ac_status); } &&
21436          { ac_try='test -s conftest.$ac_objext'
21437   { (eval echo "$as_me:21437: \"$ac_try\"") >&5
21438   (eval $ac_try) 2>&5
21439   ac_status=$?
21440   echo "$as_me:21440: \$? = $ac_status" >&5
21441   (exit $ac_status); }; }; then
21442
21443 echo "$as_me:21443: checking for X11/Xt const-feature" >&5
21444 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21445 if test "${cf_cv_const_x_string+set}" = set; then
21446   echo $ECHO_N "(cached) $ECHO_C" >&6
21447 else
21448
21449         cat >conftest.$ac_ext <<_ACEOF
21450 #line 21450 "configure"
21451 #include "confdefs.h"
21452
21453 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21454 #undef  XTSTRINGDEFINES /* X11R5 and later */
21455 #include <stdlib.h>
21456 #include <X11/Intrinsic.h>
21457
21458 int
21459 main (void)
21460 {
21461 String foo = malloc(1); *foo = 0
21462   ;
21463   return 0;
21464 }
21465 _ACEOF
21466 rm -f conftest.$ac_objext
21467 if { (eval echo "$as_me:21467: \"$ac_compile\"") >&5
21468   (eval $ac_compile) 2>&5
21469   ac_status=$?
21470   echo "$as_me:21470: \$? = $ac_status" >&5
21471   (exit $ac_status); } &&
21472          { ac_try='test -s conftest.$ac_objext'
21473   { (eval echo "$as_me:21473: \"$ac_try\"") >&5
21474   (eval $ac_try) 2>&5
21475   ac_status=$?
21476   echo "$as_me:21476: \$? = $ac_status" >&5
21477   (exit $ac_status); }; }; then
21478
21479                         cf_cv_const_x_string=no
21480
21481 else
21482   echo "$as_me: failed program was:" >&5
21483 cat conftest.$ac_ext >&5
21484
21485                         cf_cv_const_x_string=yes
21486
21487 fi
21488 rm -f conftest.$ac_objext conftest.$ac_ext
21489
21490 fi
21491 echo "$as_me:21491: result: $cf_cv_const_x_string" >&5
21492 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21493
21494 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21495 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21496 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21497
21498 case $cf_cv_const_x_string in
21499 (no)
21500
21501         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21502         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21503
21504         ;;
21505 (*)
21506
21507         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21508         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21509
21510         ;;
21511 esac
21512
21513 else
21514   echo "$as_me: failed program was:" >&5
21515 cat conftest.$ac_ext >&5
21516 fi
21517 rm -f conftest.$ac_objext conftest.$ac_ext
21518  fi
21519 cat > conftest.$ac_ext <<EOF
21520 #line 21520 "${as_me:-configure}"
21521 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21522 EOF
21523 if test "$INTEL_COMPILER" = yes
21524 then
21525 # The "-wdXXX" options suppress warnings:
21526 # remark #1419: external declaration in primary source file
21527 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21528 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21529 # remark #193: zero used for undefined preprocessing identifier
21530 # remark #593: variable "curs_sb_left_arrow" was set but never used
21531 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21532 # remark #869: parameter "tw" was never referenced
21533 # remark #981: operands are evaluated in unspecified order
21534 # warning #279: controlling expression is constant
21535
21536         { echo "$as_me:21536: checking for $CC warning options..." >&5
21537 echo "$as_me: checking for $CC warning options..." >&6;}
21538         cf_save_CFLAGS="$CFLAGS"
21539         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21540         for cf_opt in \
21541                 wd1419 \
21542                 wd1683 \
21543                 wd1684 \
21544                 wd193 \
21545                 wd593 \
21546                 wd279 \
21547                 wd810 \
21548                 wd869 \
21549                 wd981
21550         do
21551                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21552                 if { (eval echo "$as_me:21552: \"$ac_compile\"") >&5
21553   (eval $ac_compile) 2>&5
21554   ac_status=$?
21555   echo "$as_me:21555: \$? = $ac_status" >&5
21556   (exit $ac_status); }; then
21557                         test -n "$verbose" && echo "$as_me:21557: result: ... -$cf_opt" >&5
21558 echo "${ECHO_T}... -$cf_opt" >&6
21559                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21560                 fi
21561         done
21562         CFLAGS="$cf_save_CFLAGS"
21563 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
21564 then
21565         { echo "$as_me:21565: checking for $CC warning options..." >&5
21566 echo "$as_me: checking for $CC warning options..." >&6;}
21567         cf_save_CFLAGS="$CFLAGS"
21568         cf_warn_CONST=""
21569         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
21570         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
21571         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
21572         for cf_opt in W Wall \
21573                 Wbad-function-cast \
21574                 Wcast-align \
21575                 Wcast-qual \
21576                 Wdeclaration-after-statement \
21577                 Wextra \
21578                 Winline \
21579                 Wmissing-declarations \
21580                 Wmissing-prototypes \
21581                 Wnested-externs \
21582                 Wpointer-arith \
21583                 Wshadow \
21584                 Wstrict-prototypes \
21585                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
21586         do
21587                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21588                 if { (eval echo "$as_me:21588: \"$ac_compile\"") >&5
21589   (eval $ac_compile) 2>&5
21590   ac_status=$?
21591   echo "$as_me:21591: \$? = $ac_status" >&5
21592   (exit $ac_status); }; then
21593                         test -n "$verbose" && echo "$as_me:21593: result: ... -$cf_opt" >&5
21594 echo "${ECHO_T}... -$cf_opt" >&6
21595                         case $cf_opt in
21596                         (Winline)
21597                                 case $GCC_VERSION in
21598                                 ([34].*)
21599                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21600
21601 echo "${as_me:-configure}:21601: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21602
21603                                         continue;;
21604                                 esac
21605                                 ;;
21606                         (Wpointer-arith)
21607                                 case $GCC_VERSION in
21608                                 ([12].*)
21609                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21610
21611 echo "${as_me:-configure}:21611: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21612
21613                                         continue;;
21614                                 esac
21615                                 ;;
21616                         esac
21617                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21618                 fi
21619         done
21620         CFLAGS="$cf_save_CFLAGS"
21621 fi
21622 rm -rf conftest*
21623
21624 fi
21625 fi
21626
21627 echo "$as_me:21627: checking if you want to use dmalloc for testing" >&5
21628 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
21629
21630 # Check whether --with-dmalloc or --without-dmalloc was given.
21631 if test "${with_dmalloc+set}" = set; then
21632   withval="$with_dmalloc"
21633
21634 cat >>confdefs.h <<EOF
21635 #define USE_DMALLOC 1
21636 EOF
21637
21638         : ${with_cflags:=-g}
21639         : ${with_no_leaks:=yes}
21640          with_dmalloc=yes
21641 else
21642   with_dmalloc=
21643 fi;
21644 echo "$as_me:21644: result: ${with_dmalloc:-no}" >&5
21645 echo "${ECHO_T}${with_dmalloc:-no}" >&6
21646
21647 case .$with_cflags in
21648 (.*-g*)
21649         case .$CFLAGS in
21650         (.*-g*)
21651                 ;;
21652         (*)
21653
21654 cf_fix_cppflags=no
21655 cf_new_cflags=
21656 cf_new_cppflags=
21657 cf_new_extra_cppflags=
21658
21659 for cf_add_cflags in -g
21660 do
21661 case $cf_fix_cppflags in
21662 (no)
21663         case $cf_add_cflags in
21664         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21665                 case $cf_add_cflags in
21666                 (-D*)
21667                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21668
21669                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21670                                 && test -z "${cf_tst_cflags}" \
21671                                 && cf_fix_cppflags=yes
21672
21673                         if test $cf_fix_cppflags = yes ; then
21674
21675         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21676         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21677
21678                                 continue
21679                         elif test "${cf_tst_cflags}" = "\"'" ; then
21680
21681         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21682         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21683
21684                                 continue
21685                         fi
21686                         ;;
21687                 esac
21688                 case "$CPPFLAGS" in
21689                 (*$cf_add_cflags)
21690                         ;;
21691                 (*)
21692                         case $cf_add_cflags in
21693                         (-D*)
21694                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
21695
21696 CPPFLAGS=`echo "$CPPFLAGS" | \
21697         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
21698                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
21699
21700                                 ;;
21701                         esac
21702
21703         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
21704         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
21705
21706                         ;;
21707                 esac
21708                 ;;
21709         (*)
21710
21711         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
21712         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
21713
21714                 ;;
21715         esac
21716         ;;
21717 (yes)
21718
21719         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21720         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21721
21722         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
21723
21724         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21725                 && test -z "${cf_tst_cflags}" \
21726                 && cf_fix_cppflags=no
21727         ;;
21728 esac
21729 done
21730
21731 if test -n "$cf_new_cflags" ; then
21732
21733         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
21734         CFLAGS="${CFLAGS}$cf_new_cflags"
21735
21736 fi
21737
21738 if test -n "$cf_new_cppflags" ; then
21739
21740         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21741         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
21742
21743 fi
21744
21745 if test -n "$cf_new_extra_cppflags" ; then
21746
21747         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
21748         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
21749
21750 fi
21751
21752                 ;;
21753         esac
21754         ;;
21755 esac
21756
21757 if test "$with_dmalloc" = yes ; then
21758         echo "$as_me:21758: checking for dmalloc.h" >&5
21759 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
21760 if test "${ac_cv_header_dmalloc_h+set}" = set; then
21761   echo $ECHO_N "(cached) $ECHO_C" >&6
21762 else
21763   cat >conftest.$ac_ext <<_ACEOF
21764 #line 21764 "configure"
21765 #include "confdefs.h"
21766 #include <dmalloc.h>
21767 _ACEOF
21768 if { (eval echo "$as_me:21768: \"$ac_cpp conftest.$ac_ext\"") >&5
21769   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
21770   ac_status=$?
21771   egrep -v '^ *\+' conftest.er1 >conftest.err
21772   rm -f conftest.er1
21773   cat conftest.err >&5
21774   echo "$as_me:21774: \$? = $ac_status" >&5
21775   (exit $ac_status); } >/dev/null; then
21776   if test -s conftest.err; then
21777     ac_cpp_err=$ac_c_preproc_warn_flag
21778   else
21779     ac_cpp_err=
21780   fi
21781 else
21782   ac_cpp_err=yes
21783 fi
21784 if test -z "$ac_cpp_err"; then
21785   ac_cv_header_dmalloc_h=yes
21786 else
21787   echo "$as_me: failed program was:" >&5
21788   cat conftest.$ac_ext >&5
21789   ac_cv_header_dmalloc_h=no
21790 fi
21791 rm -f conftest.err conftest.$ac_ext
21792 fi
21793 echo "$as_me:21793: result: $ac_cv_header_dmalloc_h" >&5
21794 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
21795 if test $ac_cv_header_dmalloc_h = yes; then
21796
21797 echo "$as_me:21797: checking for dmalloc_debug in -ldmalloc" >&5
21798 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
21799 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
21800   echo $ECHO_N "(cached) $ECHO_C" >&6
21801 else
21802   ac_check_lib_save_LIBS=$LIBS
21803 LIBS="-ldmalloc  $LIBS"
21804 cat >conftest.$ac_ext <<_ACEOF
21805 #line 21805 "configure"
21806 #include "confdefs.h"
21807
21808 /* Override any gcc2 internal prototype to avoid an error.  */
21809 #ifdef __cplusplus
21810 extern "C"
21811 #endif
21812 /* We use char because int might match the return type of a gcc2
21813    builtin and then its argument prototype would still apply.  */
21814 char dmalloc_debug ();
21815 int
21816 main (void)
21817 {
21818 dmalloc_debug ();
21819   ;
21820   return 0;
21821 }
21822 _ACEOF
21823 rm -f conftest.$ac_objext conftest$ac_exeext
21824 if { (eval echo "$as_me:21824: \"$ac_link\"") >&5
21825   (eval $ac_link) 2>&5
21826   ac_status=$?
21827   echo "$as_me:21827: \$? = $ac_status" >&5
21828   (exit $ac_status); } &&
21829          { ac_try='test -s conftest$ac_exeext'
21830   { (eval echo "$as_me:21830: \"$ac_try\"") >&5
21831   (eval $ac_try) 2>&5
21832   ac_status=$?
21833   echo "$as_me:21833: \$? = $ac_status" >&5
21834   (exit $ac_status); }; }; then
21835   ac_cv_lib_dmalloc_dmalloc_debug=yes
21836 else
21837   echo "$as_me: failed program was:" >&5
21838 cat conftest.$ac_ext >&5
21839 ac_cv_lib_dmalloc_dmalloc_debug=no
21840 fi
21841 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21842 LIBS=$ac_check_lib_save_LIBS
21843 fi
21844 echo "$as_me:21844: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
21845 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
21846 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
21847   cat >>confdefs.h <<EOF
21848 #define HAVE_LIBDMALLOC 1
21849 EOF
21850
21851   LIBS="-ldmalloc $LIBS"
21852
21853 fi
21854
21855 fi
21856
21857 fi
21858
21859 echo "$as_me:21859: checking if you want to use dbmalloc for testing" >&5
21860 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
21861
21862 # Check whether --with-dbmalloc or --without-dbmalloc was given.
21863 if test "${with_dbmalloc+set}" = set; then
21864   withval="$with_dbmalloc"
21865
21866 cat >>confdefs.h <<EOF
21867 #define USE_DBMALLOC 1
21868 EOF
21869
21870         : ${with_cflags:=-g}
21871         : ${with_no_leaks:=yes}
21872          with_dbmalloc=yes
21873 else
21874   with_dbmalloc=
21875 fi;
21876 echo "$as_me:21876: result: ${with_dbmalloc:-no}" >&5
21877 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
21878
21879 case .$with_cflags in
21880 (.*-g*)
21881         case .$CFLAGS in
21882         (.*-g*)
21883                 ;;
21884         (*)
21885
21886 cf_fix_cppflags=no
21887 cf_new_cflags=
21888 cf_new_cppflags=
21889 cf_new_extra_cppflags=
21890
21891 for cf_add_cflags in -g
21892 do
21893 case $cf_fix_cppflags in
21894 (no)
21895         case $cf_add_cflags in
21896         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21897                 case $cf_add_cflags in
21898                 (-D*)
21899                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21900
21901                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21902                                 && test -z "${cf_tst_cflags}" \
21903                                 && cf_fix_cppflags=yes
21904
21905                         if test $cf_fix_cppflags = yes ; then
21906
21907         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21908         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21909
21910                                 continue
21911                         elif test "${cf_tst_cflags}" = "\"'" ; then
21912
21913         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21914         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21915
21916                                 continue
21917                         fi
21918                         ;;
21919                 esac
21920                 case "$CPPFLAGS" in
21921                 (*$cf_add_cflags)
21922                         ;;
21923                 (*)
21924                         case $cf_add_cflags in
21925                         (-D*)
21926                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
21927
21928 CPPFLAGS=`echo "$CPPFLAGS" | \
21929         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
21930                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
21931
21932                                 ;;
21933                         esac
21934
21935         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
21936         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
21937
21938                         ;;
21939                 esac
21940                 ;;
21941         (*)
21942
21943         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
21944         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
21945
21946                 ;;
21947         esac
21948         ;;
21949 (yes)
21950
21951         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21952         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21953
21954         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
21955
21956         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21957                 && test -z "${cf_tst_cflags}" \
21958                 && cf_fix_cppflags=no
21959         ;;
21960 esac
21961 done
21962
21963 if test -n "$cf_new_cflags" ; then
21964
21965         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
21966         CFLAGS="${CFLAGS}$cf_new_cflags"
21967
21968 fi
21969
21970 if test -n "$cf_new_cppflags" ; then
21971
21972         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21973         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
21974
21975 fi
21976
21977 if test -n "$cf_new_extra_cppflags" ; then
21978
21979         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
21980         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
21981
21982 fi
21983
21984                 ;;
21985         esac
21986         ;;
21987 esac
21988
21989 if test "$with_dbmalloc" = yes ; then
21990         echo "$as_me:21990: checking for dbmalloc.h" >&5
21991 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
21992 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
21993   echo $ECHO_N "(cached) $ECHO_C" >&6
21994 else
21995   cat >conftest.$ac_ext <<_ACEOF
21996 #line 21996 "configure"
21997 #include "confdefs.h"
21998 #include <dbmalloc.h>
21999 _ACEOF
22000 if { (eval echo "$as_me:22000: \"$ac_cpp conftest.$ac_ext\"") >&5
22001   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
22002   ac_status=$?
22003   egrep -v '^ *\+' conftest.er1 >conftest.err
22004   rm -f conftest.er1
22005   cat conftest.err >&5
22006   echo "$as_me:22006: \$? = $ac_status" >&5
22007   (exit $ac_status); } >/dev/null; then
22008   if test -s conftest.err; then
22009     ac_cpp_err=$ac_c_preproc_warn_flag
22010   else
22011     ac_cpp_err=
22012   fi
22013 else
22014   ac_cpp_err=yes
22015 fi
22016 if test -z "$ac_cpp_err"; then
22017   ac_cv_header_dbmalloc_h=yes
22018 else
22019   echo "$as_me: failed program was:" >&5
22020   cat conftest.$ac_ext >&5
22021   ac_cv_header_dbmalloc_h=no
22022 fi
22023 rm -f conftest.err conftest.$ac_ext
22024 fi
22025 echo "$as_me:22025: result: $ac_cv_header_dbmalloc_h" >&5
22026 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22027 if test $ac_cv_header_dbmalloc_h = yes; then
22028
22029 echo "$as_me:22029: checking for debug_malloc in -ldbmalloc" >&5
22030 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22031 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22032   echo $ECHO_N "(cached) $ECHO_C" >&6
22033 else
22034   ac_check_lib_save_LIBS=$LIBS
22035 LIBS="-ldbmalloc  $LIBS"
22036 cat >conftest.$ac_ext <<_ACEOF
22037 #line 22037 "configure"
22038 #include "confdefs.h"
22039
22040 /* Override any gcc2 internal prototype to avoid an error.  */
22041 #ifdef __cplusplus
22042 extern "C"
22043 #endif
22044 /* We use char because int might match the return type of a gcc2
22045    builtin and then its argument prototype would still apply.  */
22046 char debug_malloc ();
22047 int
22048 main (void)
22049 {
22050 debug_malloc ();
22051   ;
22052   return 0;
22053 }
22054 _ACEOF
22055 rm -f conftest.$ac_objext conftest$ac_exeext
22056 if { (eval echo "$as_me:22056: \"$ac_link\"") >&5
22057   (eval $ac_link) 2>&5
22058   ac_status=$?
22059   echo "$as_me:22059: \$? = $ac_status" >&5
22060   (exit $ac_status); } &&
22061          { ac_try='test -s conftest$ac_exeext'
22062   { (eval echo "$as_me:22062: \"$ac_try\"") >&5
22063   (eval $ac_try) 2>&5
22064   ac_status=$?
22065   echo "$as_me:22065: \$? = $ac_status" >&5
22066   (exit $ac_status); }; }; then
22067   ac_cv_lib_dbmalloc_debug_malloc=yes
22068 else
22069   echo "$as_me: failed program was:" >&5
22070 cat conftest.$ac_ext >&5
22071 ac_cv_lib_dbmalloc_debug_malloc=no
22072 fi
22073 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22074 LIBS=$ac_check_lib_save_LIBS
22075 fi
22076 echo "$as_me:22076: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22077 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22078 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
22079   cat >>confdefs.h <<EOF
22080 #define HAVE_LIBDBMALLOC 1
22081 EOF
22082
22083   LIBS="-ldbmalloc $LIBS"
22084
22085 fi
22086
22087 fi
22088
22089 fi
22090
22091 echo "$as_me:22091: checking if you want to use valgrind for testing" >&5
22092 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22093
22094 # Check whether --with-valgrind or --without-valgrind was given.
22095 if test "${with_valgrind+set}" = set; then
22096   withval="$with_valgrind"
22097
22098 cat >>confdefs.h <<EOF
22099 #define USE_VALGRIND 1
22100 EOF
22101
22102         : ${with_cflags:=-g}
22103         : ${with_no_leaks:=yes}
22104          with_valgrind=yes
22105 else
22106   with_valgrind=
22107 fi;
22108 echo "$as_me:22108: result: ${with_valgrind:-no}" >&5
22109 echo "${ECHO_T}${with_valgrind:-no}" >&6
22110
22111 case .$with_cflags in
22112 (.*-g*)
22113         case .$CFLAGS in
22114         (.*-g*)
22115                 ;;
22116         (*)
22117
22118 cf_fix_cppflags=no
22119 cf_new_cflags=
22120 cf_new_cppflags=
22121 cf_new_extra_cppflags=
22122
22123 for cf_add_cflags in -g
22124 do
22125 case $cf_fix_cppflags in
22126 (no)
22127         case $cf_add_cflags in
22128         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22129                 case $cf_add_cflags in
22130                 (-D*)
22131                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22132
22133                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22134                                 && test -z "${cf_tst_cflags}" \
22135                                 && cf_fix_cppflags=yes
22136
22137                         if test $cf_fix_cppflags = yes ; then
22138
22139         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22140         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22141
22142                                 continue
22143                         elif test "${cf_tst_cflags}" = "\"'" ; then
22144
22145         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22146         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22147
22148                                 continue
22149                         fi
22150                         ;;
22151                 esac
22152                 case "$CPPFLAGS" in
22153                 (*$cf_add_cflags)
22154                         ;;
22155                 (*)
22156                         case $cf_add_cflags in
22157                         (-D*)
22158                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22159
22160 CPPFLAGS=`echo "$CPPFLAGS" | \
22161         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22162                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22163
22164                                 ;;
22165                         esac
22166
22167         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22168         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22169
22170                         ;;
22171                 esac
22172                 ;;
22173         (*)
22174
22175         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22176         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22177
22178                 ;;
22179         esac
22180         ;;
22181 (yes)
22182
22183         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22184         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22185
22186         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
22187
22188         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22189                 && test -z "${cf_tst_cflags}" \
22190                 && cf_fix_cppflags=no
22191         ;;
22192 esac
22193 done
22194
22195 if test -n "$cf_new_cflags" ; then
22196
22197         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22198         CFLAGS="${CFLAGS}$cf_new_cflags"
22199
22200 fi
22201
22202 if test -n "$cf_new_cppflags" ; then
22203
22204         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22205         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22206
22207 fi
22208
22209 if test -n "$cf_new_extra_cppflags" ; then
22210
22211         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22212         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22213
22214 fi
22215
22216                 ;;
22217         esac
22218         ;;
22219 esac
22220
22221 echo "$as_me:22221: checking if you want to perform memory-leak testing" >&5
22222 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22223
22224 # Check whether --enable-leaks or --disable-leaks was given.
22225 if test "${enable_leaks+set}" = set; then
22226   enableval="$enable_leaks"
22227   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22228 else
22229   : ${with_no_leaks:=no}
22230 fi;
22231 echo "$as_me:22231: result: $with_no_leaks" >&5
22232 echo "${ECHO_T}$with_no_leaks" >&6
22233
22234 if test "$with_no_leaks" = yes ; then
22235
22236 cat >>confdefs.h <<\EOF
22237 #define NO_LEAKS 1
22238 EOF
22239
22240 cat >>confdefs.h <<\EOF
22241 #define YY_NO_LEAKS 1
22242 EOF
22243
22244 fi
22245
22246 LD_RPATH_OPT=
22247 if test "x$cf_cv_enable_rpath" != xno
22248 then
22249         echo "$as_me:22249: checking for an rpath option" >&5
22250 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22251         case $cf_cv_system_name in
22252         (irix*)
22253                 if test "$GCC" = yes; then
22254                         LD_RPATH_OPT="-Wl,-rpath,"
22255                 else
22256                         LD_RPATH_OPT="-rpath "
22257                 fi
22258                 ;;
22259         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22260                 LD_RPATH_OPT="-Wl,-rpath,"
22261                 ;;
22262         (openbsd[2-9].*|mirbsd*)
22263                 LD_RPATH_OPT="-Wl,-rpath,"
22264                 ;;
22265         (dragonfly*)
22266                 LD_RPATH_OPT="-rpath "
22267                 ;;
22268         (netbsd*)
22269                 LD_RPATH_OPT="-Wl,-rpath,"
22270                 ;;
22271         (osf*|mls+*)
22272                 LD_RPATH_OPT="-rpath "
22273                 ;;
22274         (solaris2*)
22275                 LD_RPATH_OPT="-R"
22276                 ;;
22277         (*)
22278                 ;;
22279         esac
22280         echo "$as_me:22280: result: $LD_RPATH_OPT" >&5
22281 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22282
22283         case "x$LD_RPATH_OPT" in
22284         (x-R*)
22285                 echo "$as_me:22285: checking if we need a space after rpath option" >&5
22286 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22287                 cf_save_LIBS="$LIBS"
22288
22289 cf_add_libs="$LIBS"
22290 # reverse order
22291 cf_add_0lib=
22292 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22293 # filter duplicates
22294 for cf_add_1lib in $cf_add_0lib; do
22295         for cf_add_2lib in $cf_add_libs; do
22296                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22297                         cf_add_1lib=
22298                         break
22299                 fi
22300         done
22301         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22302 done
22303 LIBS="$cf_add_libs"
22304
22305                 cat >conftest.$ac_ext <<_ACEOF
22306 #line 22306 "configure"
22307 #include "confdefs.h"
22308
22309 int
22310 main (void)
22311 {
22312
22313   ;
22314   return 0;
22315 }
22316 _ACEOF
22317 rm -f conftest.$ac_objext conftest$ac_exeext
22318 if { (eval echo "$as_me:22318: \"$ac_link\"") >&5
22319   (eval $ac_link) 2>&5
22320   ac_status=$?
22321   echo "$as_me:22321: \$? = $ac_status" >&5
22322   (exit $ac_status); } &&
22323          { ac_try='test -s conftest$ac_exeext'
22324   { (eval echo "$as_me:22324: \"$ac_try\"") >&5
22325   (eval $ac_try) 2>&5
22326   ac_status=$?
22327   echo "$as_me:22327: \$? = $ac_status" >&5
22328   (exit $ac_status); }; }; then
22329   cf_rpath_space=no
22330 else
22331   echo "$as_me: failed program was:" >&5
22332 cat conftest.$ac_ext >&5
22333 cf_rpath_space=yes
22334 fi
22335 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22336                 LIBS="$cf_save_LIBS"
22337                 echo "$as_me:22337: result: $cf_rpath_space" >&5
22338 echo "${ECHO_T}$cf_rpath_space" >&6
22339                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22340                 ;;
22341         esac
22342 fi
22343
22344 echo "$as_me:22344: checking if rpath-hack should be disabled" >&5
22345 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22346
22347 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22348 if test "${enable_rpath_hack+set}" = set; then
22349   enableval="$enable_rpath_hack"
22350   test "$enableval" != no && enableval=yes
22351         if test "$enableval" != "yes" ; then
22352     cf_disable_rpath_hack=yes
22353         else
22354                 cf_disable_rpath_hack=no
22355         fi
22356 else
22357   enableval=yes
22358         cf_disable_rpath_hack=no
22359
22360 fi;
22361 echo "$as_me:22361: result: $cf_disable_rpath_hack" >&5
22362 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22363 if test "$cf_disable_rpath_hack" = no ; then
22364
22365 echo "$as_me:22365: checking for updated LDFLAGS" >&5
22366 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22367 if test -n "$LD_RPATH_OPT" ; then
22368         echo "$as_me:22368: result: maybe" >&5
22369 echo "${ECHO_T}maybe" >&6
22370
22371         for ac_prog in ldd
22372 do
22373   # Extract the first word of "$ac_prog", so it can be a program name with args.
22374 set dummy $ac_prog; ac_word=$2
22375 echo "$as_me:22375: checking for $ac_word" >&5
22376 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22377 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22378   echo $ECHO_N "(cached) $ECHO_C" >&6
22379 else
22380   if test -n "$cf_ldd_prog"; then
22381   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22382 else
22383   ac_save_IFS=$IFS; IFS=$ac_path_separator
22384 ac_dummy="$PATH"
22385 for ac_dir in $ac_dummy; do
22386   IFS=$ac_save_IFS
22387   test -z "$ac_dir" && ac_dir=.
22388   $as_executable_p "$ac_dir/$ac_word" || continue
22389 ac_cv_prog_cf_ldd_prog="$ac_prog"
22390 echo "$as_me:22390: found $ac_dir/$ac_word" >&5
22391 break
22392 done
22393
22394 fi
22395 fi
22396 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22397 if test -n "$cf_ldd_prog"; then
22398   echo "$as_me:22398: result: $cf_ldd_prog" >&5
22399 echo "${ECHO_T}$cf_ldd_prog" >&6
22400 else
22401   echo "$as_me:22401: result: no" >&5
22402 echo "${ECHO_T}no" >&6
22403 fi
22404
22405   test -n "$cf_ldd_prog" && break
22406 done
22407 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22408
22409         cf_rpath_list="/usr/lib /lib"
22410         if test "$cf_ldd_prog" != no
22411         then
22412                 cf_rpath_oops=
22413
22414 cat >conftest.$ac_ext <<_ACEOF
22415 #line 22415 "configure"
22416 #include "confdefs.h"
22417 #include <stdio.h>
22418 int
22419 main (void)
22420 {
22421 printf("Hello");
22422   ;
22423   return 0;
22424 }
22425 _ACEOF
22426 rm -f conftest.$ac_objext conftest$ac_exeext
22427 if { (eval echo "$as_me:22427: \"$ac_link\"") >&5
22428   (eval $ac_link) 2>&5
22429   ac_status=$?
22430   echo "$as_me:22430: \$? = $ac_status" >&5
22431   (exit $ac_status); } &&
22432          { ac_try='test -s conftest$ac_exeext'
22433   { (eval echo "$as_me:22433: \"$ac_try\"") >&5
22434   (eval $ac_try) 2>&5
22435   ac_status=$?
22436   echo "$as_me:22436: \$? = $ac_status" >&5
22437   (exit $ac_status); }; }; then
22438   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22439                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22440 else
22441   echo "$as_me: failed program was:" >&5
22442 cat conftest.$ac_ext >&5
22443 fi
22444 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22445
22446                 # If we passed the link-test, but get a "not found" on a given library,
22447                 # this could be due to inept reconfiguration of gcc to make it only
22448                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22449                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22450                 # /usr/local libraries.
22451                 if test -n "$cf_rpath_oops"
22452                 then
22453                         for cf_rpath_src in $cf_rpath_oops
22454                         do
22455                                 for cf_rpath_dir in \
22456                                         /usr/local \
22457                                         /usr/pkg \
22458                                         /opt/sfw
22459                                 do
22460                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
22461                                         then
22462                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22463
22464 echo "${as_me:-configure}:22464: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22465
22466                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22467                                                 break
22468                                         fi
22469                                 done
22470                         done
22471                 fi
22472         fi
22473
22474         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22475
22476 echo "${as_me:-configure}:22476: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22477
22478 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22479
22480 echo "${as_me:-configure}:22480: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22481
22482 cf_rpath_dst=
22483 for cf_rpath_src in $LDFLAGS
22484 do
22485         case $cf_rpath_src in
22486         (-L*)
22487
22488                 # check if this refers to a directory which we will ignore
22489                 cf_rpath_skip=no
22490                 if test -n "$cf_rpath_list"
22491                 then
22492                         for cf_rpath_item in $cf_rpath_list
22493                         do
22494                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22495                                 then
22496                                         cf_rpath_skip=yes
22497                                         break
22498                                 fi
22499                         done
22500                 fi
22501
22502                 if test "$cf_rpath_skip" = no
22503                 then
22504                         # transform the option
22505                         if test "$LD_RPATH_OPT" = "-R " ; then
22506                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22507                         else
22508                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22509                         fi
22510
22511                         # if we have not already added this, add it now
22512                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22513                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22514                         then
22515                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22516
22517 echo "${as_me:-configure}:22517: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22518
22519                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22520                         fi
22521                 fi
22522                 ;;
22523         esac
22524         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22525 done
22526 LDFLAGS=$cf_rpath_dst
22527
22528 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
22529
22530 echo "${as_me:-configure}:22530: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
22531
22532 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
22533
22534 echo "${as_me:-configure}:22534: testing ...checking LIBS $LIBS ..." 1>&5
22535
22536 cf_rpath_dst=
22537 for cf_rpath_src in $LIBS
22538 do
22539         case $cf_rpath_src in
22540         (-L*)
22541
22542                 # check if this refers to a directory which we will ignore
22543                 cf_rpath_skip=no
22544                 if test -n "$cf_rpath_list"
22545                 then
22546                         for cf_rpath_item in $cf_rpath_list
22547                         do
22548                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22549                                 then
22550                                         cf_rpath_skip=yes
22551                                         break
22552                                 fi
22553                         done
22554                 fi
22555
22556                 if test "$cf_rpath_skip" = no
22557                 then
22558                         # transform the option
22559                         if test "$LD_RPATH_OPT" = "-R " ; then
22560                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22561                         else
22562                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22563                         fi
22564
22565                         # if we have not already added this, add it now
22566                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22567                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22568                         then
22569                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22570
22571 echo "${as_me:-configure}:22571: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22572
22573                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22574                         fi
22575                 fi
22576                 ;;
22577         esac
22578         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22579 done
22580 LIBS=$cf_rpath_dst
22581
22582 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
22583
22584 echo "${as_me:-configure}:22584: testing ...checked LIBS $LIBS ..." 1>&5
22585
22586         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22587
22588 echo "${as_me:-configure}:22588: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22589
22590 else
22591         echo "$as_me:22591: result: no" >&5
22592 echo "${ECHO_T}no" >&6
22593 fi
22594
22595 fi
22596
22597 TEST_ARGS="$LIBS"
22598 LIBS=
22599
22600 ac_config_files="$ac_config_files Makefile"
22601 ac_config_commands="$ac_config_commands default"
22602 cat >confcache <<\_ACEOF
22603 # This file is a shell script that caches the results of configure
22604 # tests run on this system so they can be shared between configure
22605 # scripts and configure runs, see configure's option --config-cache.
22606 # It is not useful on other systems.  If it contains results you don't
22607 # want to keep, you may remove or edit it.
22608 #
22609 # config.status only pays attention to the cache file if you give it
22610 # the --recheck option to rerun configure.
22611 #
22612 # `ac_cv_env_foo' variables (set or unset) will be overriden when
22613 # loading this file, other *unset* `ac_cv_foo' will be assigned the
22614 # following values.
22615
22616 _ACEOF
22617
22618 # The following way of writing the cache mishandles newlines in values,
22619 # but we know of no workaround that is simple, portable, and efficient.
22620 # So, don't put newlines in cache variables' values.
22621 # Ultrix sh set writes to stderr and can't be redirected directly,
22622 # and sets the high bit in the cache file unless we assign to the vars.
22623 {
22624   (set) 2>&1 |
22625     case `(ac_space=' '; set | grep ac_space) 2>&1` in
22626     *ac_space=\ *)
22627       # `set' does not quote correctly, so add quotes (double-quote
22628       # substitution turns \\\\ into \\, and sed turns \\ into \).
22629       sed -n \
22630         "s/'/'\\\\''/g;
22631           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
22632       ;;
22633     *)
22634       # `set' quotes correctly as required by POSIX, so do not add quotes.
22635       sed -n \
22636         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
22637       ;;
22638     esac;
22639 } |
22640   sed '
22641      t clear
22642      : clear
22643      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
22644      t end
22645      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
22646      : end' >>confcache
22647 if cmp -s $cache_file confcache; then :; else
22648   if test -w $cache_file; then
22649     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
22650     cat confcache >$cache_file
22651   else
22652     echo "not updating unwritable cache $cache_file"
22653   fi
22654 fi
22655 rm -f confcache
22656
22657 test "x$prefix" = xNONE && prefix=$ac_default_prefix
22658 # Let make expand exec_prefix.
22659 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
22660
22661 # VPATH may cause trouble with some makes, so we remove $(srcdir),
22662 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
22663 # trailing colons and then remove the whole line if VPATH becomes empty
22664 # (actually we leave an empty line to preserve line numbers).
22665 if test "x$srcdir" = x.; then
22666   ac_vpsub='/^[         ]*VPATH[        ]*=/{
22667 s/:*\$(srcdir):*/:/;
22668 s/:*\${srcdir}:*/:/;
22669 s/:*@srcdir@:*/:/;
22670 s/^\([^=]*=[    ]*\):*/\1/;
22671 s/:*$//;
22672 s/^[^=]*=[      ]*$//;
22673 }'
22674 fi
22675
22676 DEFS=-DHAVE_CONFIG_H
22677
22678 : ${CONFIG_STATUS=./config.status}
22679 ac_clean_files_save=$ac_clean_files
22680 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
22681 { echo "$as_me:22681: creating $CONFIG_STATUS" >&5
22682 echo "$as_me: creating $CONFIG_STATUS" >&6;}
22683 cat >$CONFIG_STATUS <<_ACEOF
22684 #! $SHELL
22685 # Generated automatically by configure.
22686 # Run this file to recreate the current configuration.
22687 # Compiler output produced by configure, useful for debugging
22688 # configure, is in config.log if it exists.
22689
22690 debug=false
22691 SHELL=\${CONFIG_SHELL-$SHELL}
22692 ac_cs_invocation="\$0 \$@"
22693
22694 CLICOLOR_FORCE= GREP_OPTIONS=
22695 unset CLICOLOR_FORCE GREP_OPTIONS
22696 _ACEOF
22697
22698 cat >>$CONFIG_STATUS <<\_ACEOF
22699 # Be Bourne compatible
22700 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
22701   emulate sh
22702   NULLCMD=:
22703 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
22704   set -o posix
22705 fi
22706
22707 # Name of the executable.
22708 as_me=`echo "$0" |sed 's,.*[\\/],,'`
22709
22710 if expr a : '\(a\)' >/dev/null 2>&1; then
22711   as_expr=expr
22712 else
22713   as_expr=false
22714 fi
22715
22716 rm -f conf$$ conf$$.exe conf$$.file
22717 echo >conf$$.file
22718 if ln -s conf$$.file conf$$ 2>/dev/null; then
22719   # We could just check for DJGPP; but this test a) works b) is more generic
22720   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
22721   if test -f conf$$.exe; then
22722     # Don't use ln at all; we don't have any links
22723     as_ln_s='cp -p'
22724   else
22725     as_ln_s='ln -s'
22726   fi
22727 elif ln conf$$.file conf$$ 2>/dev/null; then
22728   as_ln_s=ln
22729 else
22730   as_ln_s='cp -p'
22731 fi
22732 rm -f conf$$ conf$$.exe conf$$.file
22733
22734 as_executable_p="test -f"
22735
22736 # Support unset when possible.
22737 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
22738   as_unset=unset
22739 else
22740   as_unset=false
22741 fi
22742
22743 # NLS nuisances.
22744 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
22745 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
22746 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
22747 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
22748 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
22749 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
22750 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
22751 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
22752
22753 # IFS
22754 # We need space, tab and new line, in precisely that order.
22755 as_nl='
22756 '
22757 IFS="   $as_nl"
22758
22759 # CDPATH.
22760 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
22761
22762 exec 6>&1
22763
22764 _ACEOF
22765
22766 # Files that config.status was made for.
22767 if test -n "$ac_config_files"; then
22768   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
22769 fi
22770
22771 if test -n "$ac_config_headers"; then
22772   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
22773 fi
22774
22775 if test -n "$ac_config_links"; then
22776   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
22777 fi
22778
22779 if test -n "$ac_config_commands"; then
22780   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
22781 fi
22782
22783 cat >>$CONFIG_STATUS <<\EOF
22784
22785 ac_cs_usage="\
22786 \`$as_me' instantiates files from templates according to the
22787 current configuration.
22788
22789 Usage: $0 [OPTIONS] [FILE]...
22790
22791   -h, --help       print this help, then exit
22792   -V, --version    print version number, then exit
22793   -d, --debug      don't remove temporary files
22794       --recheck    update $as_me by reconfiguring in the same conditions
22795   --file=FILE[:TEMPLATE]
22796                    instantiate the configuration file FILE
22797   --header=FILE[:TEMPLATE]
22798                    instantiate the configuration header FILE
22799
22800 Configuration files:
22801 $config_files
22802
22803 Configuration headers:
22804 $config_headers
22805
22806 Configuration commands:
22807 $config_commands
22808
22809 Report bugs to <dickey@invisible-island.net>."
22810 EOF
22811
22812 cat >>$CONFIG_STATUS <<EOF
22813 ac_cs_version="\\
22814 config.status
22815 configured by $0, generated by GNU Autoconf 2.52.20200802,
22816   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
22817
22818 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
22819 Free Software Foundation, Inc.
22820 This config.status script is free software; the Free Software Foundation
22821 gives unlimited permission to copy, distribute and modify it."
22822 srcdir=$srcdir
22823 INSTALL="$INSTALL"
22824 EOF
22825
22826 cat >>$CONFIG_STATUS <<\EOF
22827 # If no file are specified by the user, then we need to provide default
22828 # value.  By we need to know if files were specified by the user.
22829 ac_need_defaults=:
22830 while test $# != 0
22831 do
22832   case $1 in
22833   --*=*)
22834     ac_option=`expr "x$1" : 'x\([^=]*\)='`
22835     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
22836     shift
22837     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
22838     shift
22839     ;;
22840   -*);;
22841   *) # This is not an option, so the user has probably given explicit
22842      # arguments.
22843      ac_need_defaults=false;;
22844   esac
22845
22846   case $1 in
22847   # Handling of the options.
22848 EOF
22849 cat >>$CONFIG_STATUS <<EOF
22850   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
22851     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
22852     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
22853 EOF
22854 cat >>$CONFIG_STATUS <<\EOF
22855   --version | --vers* | -V )
22856     echo "$ac_cs_version"; exit 0 ;;
22857   --he | --h)
22858     # Conflict between --help and --header
22859     { { echo "$as_me:22859: error: ambiguous option: $1
22860 Try \`$0 --help' for more information." >&5
22861 echo "$as_me: error: ambiguous option: $1
22862 Try \`$0 --help' for more information." >&2;}
22863    { (exit 1); exit 1; }; };;
22864   --help | --hel | -h )
22865     echo "$ac_cs_usage"; exit 0 ;;
22866   --debug | --d* | -d )
22867     debug=: ;;
22868   --file | --fil | --fi | --f )
22869     shift
22870     CONFIG_FILES="$CONFIG_FILES $1"
22871     ac_need_defaults=false;;
22872   --header | --heade | --head | --hea )
22873     shift
22874     CONFIG_HEADERS="$CONFIG_HEADERS $1"
22875     ac_need_defaults=false;;
22876
22877   # This is an error.
22878   -*) { { echo "$as_me:22878: error: unrecognized option: $1
22879 Try \`$0 --help' for more information." >&5
22880 echo "$as_me: error: unrecognized option: $1
22881 Try \`$0 --help' for more information." >&2;}
22882    { (exit 1); exit 1; }; } ;;
22883
22884   *) ac_config_targets="$ac_config_targets $1" ;;
22885
22886   esac
22887   shift
22888 done
22889
22890 exec 5>>config.log
22891 cat >&5 << _ACEOF
22892
22893 ## ----------------------- ##
22894 ## Running config.status.  ##
22895 ## ----------------------- ##
22896
22897 This file was extended by $as_me 2.52.20200802, executed with
22898   CONFIG_FILES    = $CONFIG_FILES
22899   CONFIG_HEADERS  = $CONFIG_HEADERS
22900   CONFIG_LINKS    = $CONFIG_LINKS
22901   CONFIG_COMMANDS = $CONFIG_COMMANDS
22902   > $ac_cs_invocation
22903 on `(hostname || uname -n) 2>/dev/null | sed 1q`
22904
22905 _ACEOF
22906 EOF
22907
22908 cat >>$CONFIG_STATUS <<EOF
22909 #
22910 # INIT-COMMANDS section.
22911 #
22912
22913 AWK="$AWK"
22914 ECHO_CC="$ECHO_CC"
22915 ECHO_LD="$ECHO_LD"
22916 SHOW_CC="$SHOW_LD"
22917
22918 EOF
22919
22920 cat >>$CONFIG_STATUS <<\EOF
22921 for ac_config_target in $ac_config_targets
22922 do
22923   case "$ac_config_target" in
22924   # Handling of arguments.
22925   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
22926   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
22927   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
22928   *) { { echo "$as_me:22928: error: invalid argument: $ac_config_target" >&5
22929 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
22930    { (exit 1); exit 1; }; };;
22931   esac
22932 done
22933
22934 # If the user did not use the arguments to specify the items to instantiate,
22935 # then the envvar interface is used.  Set only those that are not.
22936 # We use the long form for the default assignment because of an extremely
22937 # bizarre bug on SunOS 4.1.3.
22938 if $ac_need_defaults; then
22939   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
22940   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
22941   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
22942 fi
22943
22944 # Create a temporary directory, and hook for its removal unless debugging.
22945 $debug ||
22946 {
22947   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
22948   trap '{ (exit 1); exit 1; }' 1 2 13 15
22949 }
22950
22951 # Create a (secure) tmp directory for tmp files.
22952 : ${TMPDIR=/tmp}
22953 {
22954   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
22955   test -n "$tmp" && test -d "$tmp"
22956 }  ||
22957 {
22958   tmp=$TMPDIR/cs$$-$RANDOM
22959   (umask 077 && mkdir $tmp)
22960 } ||
22961 {
22962    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
22963    { (exit 1); exit 1; }
22964 }
22965
22966 EOF
22967
22968 cat >>$CONFIG_STATUS <<EOF
22969
22970 #
22971 # CONFIG_FILES section.
22972 #
22973
22974 # No need to generate the scripts if there are no CONFIG_FILES.
22975 # This happens for instance when ./config.status config.h
22976 if test -n "\$CONFIG_FILES"; then
22977   # Protect against being on the right side of a sed subst in config.status.
22978   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
22979    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
22980 s,@SHELL@,$SHELL,;t t
22981 s,@exec_prefix@,$exec_prefix,;t t
22982 s,@prefix@,$prefix,;t t
22983 s,@program_transform_name@,$program_transform_name,;t t
22984 s,@bindir@,$bindir,;t t
22985 s,@sbindir@,$sbindir,;t t
22986 s,@libexecdir@,$libexecdir,;t t
22987 s,@datarootdir@,$datarootdir,;t t
22988 s,@datadir@,$datadir,;t t
22989 s,@sysconfdir@,$sysconfdir,;t t
22990 s,@sharedstatedir@,$sharedstatedir,;t t
22991 s,@localstatedir@,$localstatedir,;t t
22992 s,@runstatedir@,$runstatedir,;t t
22993 s,@libdir@,$libdir,;t t
22994 s,@includedir@,$includedir,;t t
22995 s,@oldincludedir@,$oldincludedir,;t t
22996 s,@infodir@,$infodir,;t t
22997 s,@mandir@,$mandir,;t t
22998 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
22999 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23000 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23001 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23002 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23003 s,@build_alias@,$build_alias,;t t
23004 s,@host_alias@,$host_alias,;t t
23005 s,@target_alias@,$target_alias,;t t
23006 s,@ECHO_C@,$ECHO_C,;t t
23007 s,@ECHO_N@,$ECHO_N,;t t
23008 s,@ECHO_T@,$ECHO_T,;t t
23009 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23010 s,@DEFS@,$DEFS,;t t
23011 s,@LIBS@,$LIBS,;t t
23012 s,@build@,$build,;t t
23013 s,@build_cpu@,$build_cpu,;t t
23014 s,@build_vendor@,$build_vendor,;t t
23015 s,@build_os@,$build_os,;t t
23016 s,@host@,$host,;t t
23017 s,@host_cpu@,$host_cpu,;t t
23018 s,@host_vendor@,$host_vendor,;t t
23019 s,@host_os@,$host_os,;t t
23020 s,@SET_MAKE@,$SET_MAKE,;t t
23021 s,@CC@,$CC,;t t
23022 s,@CFLAGS@,$CFLAGS,;t t
23023 s,@LDFLAGS@,$LDFLAGS,;t t
23024 s,@CPPFLAGS@,$CPPFLAGS,;t t
23025 s,@ac_ct_CC@,$ac_ct_CC,;t t
23026 s,@EXEEXT@,$EXEEXT,;t t
23027 s,@OBJEXT@,$OBJEXT,;t t
23028 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23029 s,@CPP@,$CPP,;t t
23030 s,@AWK@,$AWK,;t t
23031 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23032 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23033 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23034 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23035 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23036 s,@LINT@,$LINT,;t t
23037 s,@LINT_OPTS@,$LINT_OPTS,;t t
23038 s,@CTAGS@,$CTAGS,;t t
23039 s,@ETAGS@,$ETAGS,;t t
23040 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23041 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23042 s,@MATH_LIB@,$MATH_LIB,;t t
23043 s,@top_builddir@,$top_builddir,;t t
23044 s,@CC_G_OPT@,$CC_G_OPT,;t t
23045 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23046 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23047 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23048 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23049 s,@LD@,$LD,;t t
23050 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23051 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23052 s,@LD_MODEL@,$LD_MODEL,;t t
23053 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23054 s,@LIBTOOL@,$LIBTOOL,;t t
23055 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23056 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23057 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23058 s,@LIB_LINK@,$LIB_LINK,;t t
23059 s,@LINK_TESTS@,$LINK_TESTS,;t t
23060 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23061 s,@PACKAGE@,$PACKAGE,;t t
23062 s,@PTHREAD@,$PTHREAD,;t t
23063 s,@TEST_ARGS@,$TEST_ARGS,;t t
23064 s,@TEST_DEPS@,$TEST_DEPS,;t t
23065 s,@TEST_LIBS@,$TEST_LIBS,;t t
23066 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23067 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23068 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23069 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23070 s,@includesubdir@,$includesubdir,;t t
23071 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23072 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23073 s,@ECHO_LT@,$ECHO_LT,;t t
23074 s,@ECHO_LD@,$ECHO_LD,;t t
23075 s,@RULE_CC@,$RULE_CC,;t t
23076 s,@SHOW_CC@,$SHOW_CC,;t t
23077 s,@ECHO_CC@,$ECHO_CC,;t t
23078 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23079 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23080 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23081 s,@X_CFLAGS@,$X_CFLAGS,;t t
23082 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23083 s,@X_LIBS@,$X_LIBS,;t t
23084 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23085 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23086 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23087 s,@RGB_PATH@,$RGB_PATH,;t t
23088 s,@no_x11_rgb@,$no_x11_rgb,;t t
23089 s,@FORM_NAME@,$FORM_NAME,;t t
23090 s,@MENU_NAME@,$MENU_NAME,;t t
23091 s,@PANEL_NAME@,$PANEL_NAME,;t t
23092 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23093 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23094 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23095 CEOF
23096
23097 EOF
23098
23099   cat >>$CONFIG_STATUS <<\EOF
23100   # Split the substitutions into bite-sized pieces for seds with
23101   # small command number limits, like on Digital OSF/1 and HP-UX.
23102   ac_max_sed_lines=48
23103   ac_sed_frag=1 # Number of current file.
23104   ac_beg=1 # First line for current file.
23105   ac_end=$ac_max_sed_lines # Line after last line for current file.
23106   ac_more_lines=:
23107   ac_sed_cmds=
23108   while $ac_more_lines; do
23109     if test $ac_beg -gt 1; then
23110       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23111     else
23112       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23113     fi
23114     if test ! -s $tmp/subs.frag; then
23115       ac_more_lines=false
23116     else
23117       # The purpose of the label and of the branching condition is to
23118       # speed up the sed processing (if there are no `@' at all, there
23119       # is no need to browse any of the substitutions).
23120       # These are the two extra sed commands mentioned above.
23121       (echo ':t
23122   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23123       # It is possible to make a multiline substitution using escaped newlines.
23124       # Ensure that we do not split the substitution between script fragments.
23125       ac_BEG=$ac_end
23126       ac_END=`expr $ac_end + $ac_max_sed_lines`
23127       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23128       if test -s $tmp/subs.next; then
23129         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23130         if test ! -s $tmp/subs.edit; then
23131           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23132           if test ! -s $tmp/subs.edit; then
23133             if test $ac_beg -gt 1; then
23134               ac_end=`expr $ac_end - 1`
23135               continue
23136             fi
23137           fi
23138         fi
23139       fi
23140
23141       if test -z "$ac_sed_cmds"; then
23142         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23143       else
23144         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23145       fi
23146       ac_sed_frag=`expr $ac_sed_frag + 1`
23147       ac_beg=$ac_end
23148       ac_end=`expr $ac_end + $ac_max_sed_lines`
23149     fi
23150   done
23151   if test -z "$ac_sed_cmds"; then
23152     ac_sed_cmds=cat
23153   fi
23154 fi # test -n "$CONFIG_FILES"
23155
23156 EOF
23157 cat >>$CONFIG_STATUS <<\EOF
23158 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23159   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23160   case $ac_file in
23161   - | *:- | *:-:* ) # input from stdin
23162         cat >$tmp/stdin
23163         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23164         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23165   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23166         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23167   * )   ac_file_in=$ac_file.in ;;
23168   esac
23169
23170   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23171   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23172          X"$ac_file" : 'X\(//\)[^/]' \| \
23173          X"$ac_file" : 'X\(//\)$' \| \
23174          X"$ac_file" : 'X\(/\)' \| \
23175          .     : '\(.\)' 2>/dev/null ||
23176 echo X"$ac_file" |
23177     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23178           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23179           /^X\(\/\/\)$/{ s//\1/; q; }
23180           /^X\(\/\).*/{ s//\1/; q; }
23181           s/.*/./; q'`
23182   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23183     { case "$ac_dir" in
23184   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23185   *)                      as_incr_dir=.;;
23186 esac
23187 as_dummy="$ac_dir"
23188 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23189   case $as_mkdir_dir in
23190     # Skip DOS drivespec
23191     ?:) as_incr_dir=$as_mkdir_dir ;;
23192     *)
23193       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23194       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23195     ;;
23196   esac
23197 done; }
23198
23199     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23200     # A "../" for each directory in $ac_dir_suffix.
23201     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23202   else
23203     ac_dir_suffix= ac_dots=
23204   fi
23205
23206   case $srcdir in
23207   .)  ac_srcdir=.
23208       if test -z "$ac_dots"; then
23209          ac_top_srcdir=.
23210       else
23211          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
23212       fi ;;
23213   [\\/]* | ?:[\\/]* )
23214       ac_srcdir=$srcdir$ac_dir_suffix;
23215       ac_top_srcdir=$srcdir ;;
23216   *) # Relative path.
23217     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
23218     ac_top_srcdir=$ac_dots$srcdir ;;
23219   esac
23220
23221   case $INSTALL in
23222   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23223   *) ac_INSTALL=$ac_dots$INSTALL ;;
23224   esac
23225
23226   if test x"$ac_file" != x-; then
23227     { echo "$as_me:23227: creating $ac_file" >&5
23228 echo "$as_me: creating $ac_file" >&6;}
23229     rm -f "$ac_file"
23230   fi
23231   # Let's still pretend it is `configure' which instantiates (i.e., don't
23232   # use $as_me), people would be surprised to read:
23233   #    /* config.h.  Generated automatically by config.status.  */
23234   configure_input="Generated automatically from `echo $ac_file_in |
23235                                                  sed 's,.*/,,'` by configure."
23236
23237   # First look for the input files in the build tree, otherwise in the
23238   # src tree.
23239   ac_file_inputs=`IFS=:
23240     for f in $ac_file_in; do
23241       case $f in
23242       -) echo $tmp/stdin ;;
23243       [\\/$]*)
23244          # Absolute (can't be DOS-style, as IFS=:)
23245          test -f "$f" || { { echo "$as_me:23245: error: cannot find input file: $f" >&5
23246 echo "$as_me: error: cannot find input file: $f" >&2;}
23247    { (exit 1); exit 1; }; }
23248          echo $f;;
23249       *) # Relative
23250          if test -f "$f"; then
23251            # Build tree
23252            echo $f
23253          elif test -f "$srcdir/$f"; then
23254            # Source tree
23255            echo $srcdir/$f
23256          else
23257            # /dev/null tree
23258            { { echo "$as_me:23258: error: cannot find input file: $f" >&5
23259 echo "$as_me: error: cannot find input file: $f" >&2;}
23260    { (exit 1); exit 1; }; }
23261          fi;;
23262       esac
23263     done` || { (exit 1); exit 1; }
23264 EOF
23265 cat >>$CONFIG_STATUS <<\EOF
23266   ac_warn_datarootdir=no
23267   if test x"$ac_file" != x-; then
23268     for ac_item in $ac_file_inputs
23269     do
23270       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
23271       if test -n "$ac_seen"; then
23272         ac_used=`grep '@datarootdir@' $ac_item`
23273         if test -z "$ac_used"; then
23274           { echo "$as_me:23274: WARNING: datarootdir was used implicitly but not set:
23275 $ac_seen" >&5
23276 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23277 $ac_seen" >&2;}
23278           ac_warn_datarootdir=yes
23279         fi
23280       fi
23281       ac_seen=`grep '${datarootdir}' $ac_item`
23282       if test -n "$ac_seen"; then
23283         { echo "$as_me:23283: WARNING: datarootdir was used explicitly but not set:
23284 $ac_seen" >&5
23285 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23286 $ac_seen" >&2;}
23287         ac_warn_datarootdir=yes
23288       fi
23289     done
23290   fi
23291
23292 if test "x$ac_warn_datarootdir" = xyes; then
23293   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23294 fi
23295
23296 EOF
23297 cat >>$CONFIG_STATUS <<EOF
23298   sed "$ac_vpsub
23299 $extrasub
23300 EOF
23301 cat >>$CONFIG_STATUS <<\EOF
23302 :t
23303 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23304 s,@configure_input@,$configure_input,;t t
23305 s,@srcdir@,$ac_srcdir,;t t
23306 s,@top_srcdir@,$ac_top_srcdir,;t t
23307 s,@INSTALL@,$ac_INSTALL,;t t
23308 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23309   rm -f $tmp/stdin
23310   if test x"$ac_file" != x-; then
23311     cp $tmp/out $ac_file
23312
23313     for ac_name in prefix exec_prefix datarootdir
23314     do
23315         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
23316         if test -n "$ac_seen"; then
23317             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
23318             if test -z "$ac_init"; then
23319               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23320               { echo "$as_me:23320: WARNING: Variable $ac_name is used but was not set:
23321 $ac_seen" >&5
23322 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23323 $ac_seen" >&2;}
23324             fi
23325         fi
23326     done
23327     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
23328     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
23329     if test -s $tmp/out; then
23330       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23331       { echo "$as_me:23331: WARNING: Some variables may not be substituted:
23332 $ac_seen" >&5
23333 echo "$as_me: WARNING: Some variables may not be substituted:
23334 $ac_seen" >&2;}
23335     fi
23336   else
23337     cat $tmp/out
23338   fi
23339   rm -f $tmp/out
23340
23341 done
23342 EOF
23343 cat >>$CONFIG_STATUS <<\EOF
23344
23345 #
23346 # CONFIG_HEADER section.
23347 #
23348
23349 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23350 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23351 #
23352 # ac_d sets the value in "#define NAME VALUE" lines.
23353 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23354 ac_dB='[        ].*$,\1#\2'
23355 ac_dC=' '
23356 ac_dD=',;t'
23357 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23358 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23359 ac_iB='\([      ]\),\1#\2define\3'
23360 ac_iC=' '
23361 ac_iD='\4,;t'
23362 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23363 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23364 ac_uB='$,\1#\2define\3'
23365 ac_uC=' '
23366 ac_uD=',;t'
23367
23368 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23369   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23370   case $ac_file in
23371   - | *:- | *:-:* ) # input from stdin
23372         cat >$tmp/stdin
23373         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23374         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23375   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23376         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23377   * )   ac_file_in=$ac_file.in ;;
23378   esac
23379
23380   test x"$ac_file" != x- && { echo "$as_me:23380: creating $ac_file" >&5
23381 echo "$as_me: creating $ac_file" >&6;}
23382
23383   # First look for the input files in the build tree, otherwise in the
23384   # src tree.
23385   ac_file_inputs=`IFS=:
23386     for f in $ac_file_in; do
23387       case $f in
23388       -) echo $tmp/stdin ;;
23389       [\\/$]*)
23390          # Absolute (can't be DOS-style, as IFS=:)
23391          test -f "$f" || { { echo "$as_me:23391: error: cannot find input file: $f" >&5
23392 echo "$as_me: error: cannot find input file: $f" >&2;}
23393    { (exit 1); exit 1; }; }
23394          echo $f;;
23395       *) # Relative
23396          if test -f "$f"; then
23397            # Build tree
23398            echo $f
23399          elif test -f "$srcdir/$f"; then
23400            # Source tree
23401            echo $srcdir/$f
23402          else
23403            # /dev/null tree
23404            { { echo "$as_me:23404: error: cannot find input file: $f" >&5
23405 echo "$as_me: error: cannot find input file: $f" >&2;}
23406    { (exit 1); exit 1; }; }
23407          fi;;
23408       esac
23409     done` || { (exit 1); exit 1; }
23410   # Remove the trailing spaces.
23411   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23412
23413 EOF
23414
23415 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23416 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23417 # be either 'cat' or 'sort'.
23418 cat confdefs.h | uniq >conftest.vals
23419
23420 # Break up conftest.vals because some shells have a limit on
23421 # the size of here documents, and old seds have small limits too.
23422
23423 rm -f conftest.tail
23424 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
23425 while grep . conftest.vals >/dev/null
23426 do
23427   # Write chunks of a limited-size here document to conftest.frag.
23428   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
23429   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
23430   echo 'CEOF' >> $CONFIG_STATUS
23431   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
23432   rm -f conftest.vals
23433   mv conftest.tail conftest.vals
23434 done
23435 rm -f conftest.vals
23436
23437 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23438 # marker @DEFS@.
23439 echo '  cat >> conftest.edit <<CEOF
23440 /@DEFS@/r conftest.frag
23441 /@DEFS@/d
23442 CEOF
23443 sed -f conftest.edit $tmp/in > $tmp/out
23444 rm -f $tmp/in
23445 mv $tmp/out $tmp/in
23446 rm -f conftest.edit conftest.frag
23447 ' >> $CONFIG_STATUS
23448
23449 cat >>$CONFIG_STATUS <<\EOF
23450   # Let's still pretend it is `configure' which instantiates (i.e., don't
23451   # use $as_me), people would be surprised to read:
23452   #    /* config.h.  Generated automatically by config.status.  */
23453   if test x"$ac_file" = x-; then
23454     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23455   else
23456     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23457   fi
23458   cat $tmp/in >>$tmp/config.h
23459   rm -f $tmp/in
23460   if test x"$ac_file" != x-; then
23461     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
23462       { echo "$as_me:23462: $ac_file is unchanged" >&5
23463 echo "$as_me: $ac_file is unchanged" >&6;}
23464     else
23465       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23466          X"$ac_file" : 'X\(//\)[^/]' \| \
23467          X"$ac_file" : 'X\(//\)$' \| \
23468          X"$ac_file" : 'X\(/\)' \| \
23469          .     : '\(.\)' 2>/dev/null ||
23470 echo X"$ac_file" |
23471     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23472           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23473           /^X\(\/\/\)$/{ s//\1/; q; }
23474           /^X\(\/\).*/{ s//\1/; q; }
23475           s/.*/./; q'`
23476       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23477         { case "$ac_dir" in
23478   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23479   *)                      as_incr_dir=.;;
23480 esac
23481 as_dummy="$ac_dir"
23482 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23483   case $as_mkdir_dir in
23484     # Skip DOS drivespec
23485     ?:) as_incr_dir=$as_mkdir_dir ;;
23486     *)
23487       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23488       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23489     ;;
23490   esac
23491 done; }
23492
23493       fi
23494       rm -f $ac_file
23495       mv $tmp/config.h $ac_file
23496     fi
23497   else
23498     cat $tmp/config.h
23499     rm -f $tmp/config.h
23500   fi
23501 done
23502 EOF
23503 cat >>$CONFIG_STATUS <<\EOF
23504 #
23505 # CONFIG_COMMANDS section.
23506 #
23507 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23508   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23509   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23510
23511   case $ac_dest in
23512     default )
23513
23514 for cf_dir in .
23515 do
23516         if test ! -d $srcdir/$cf_dir; then
23517                 continue
23518         elif test -f $srcdir/$cf_dir/programs; then
23519                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
23520         fi
23521 done
23522
23523         cat >>Makefile <<TEST_EOF
23524
23525 # These rules are generated so we do not rely on suffix rules, which do not
23526 # work consistently for different make-programs (the '\$(MODEL)/' confuses
23527 # some, and the '\$x' confuses others).
23528 TEST_EOF
23529
23530 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
23531 for N in $LIST
23532 do
23533         cat >>Makefile <<TEST_EOF
23534
23535 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
23536         \$(srcdir)/test.priv.h \\
23537         ncurses_cfg.h
23538         $SHOW_CC
23539         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
23540 TEST_EOF
23541 done
23542
23543 if test -f ../config.guess && test -f ../config.sub
23544 then
23545         cat >>Makefile <<TEST_EOF
23546
23547 # if we used CF_INHERIT for getting these files, we can remove them
23548 distclean::
23549         rm -f config.guess config.sub
23550 TEST_EOF
23551 fi
23552  ;;
23553   esac
23554 done
23555 EOF
23556
23557 cat >>$CONFIG_STATUS <<\EOF
23558
23559 { (exit 0); exit 0; }
23560 EOF
23561 chmod +x $CONFIG_STATUS
23562 ac_clean_files=$ac_clean_files_save
23563
23564 # configure is writing to config.log, and then calls config.status.
23565 # config.status does its own redirection, appending to config.log.
23566 # Unfortunately, on DOS this fails, as config.log is still kept open
23567 # by configure, so config.status won't be able to write to it; its
23568 # output is simply discarded.  So we exec the FD to /dev/null,
23569 # effectively closing config.log, so it can be properly (re)opened and
23570 # appended to by config.status.  When coming back to configure, we
23571 # need to make the FD available again.
23572 if test "$no_create" != yes; then
23573   ac_cs_success=:
23574   exec 5>/dev/null
23575   $SHELL $CONFIG_STATUS || ac_cs_success=false
23576   exec 5>>config.log
23577   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
23578   # would make configure fail if this is the last instruction.
23579   $ac_cs_success || { (exit 1); exit 1; }
23580 fi
23581